webpackJsonp([4], [function(t, e, i) {
    (function(t) {
        "use strict";

        function e() { JSON.parse(urlParams.disabledFeatures).forEach(function(e) { t.setEnabled(e, !1) }), JSON.parse(urlParams.enabledFeatures).forEach(function(e) { t.setEnabled(e, !0) }) }

        function o() { t.enabled("saveload_storage_customization") && (void 0 !== urlParams.chartsStorageUrl && urlParams.chartsStorageUrl && void 0 !== urlParams.clientId && urlParams.clientId ? r.initialize(urlParams.clientId, urlParams.userId, urlParams.chartsStorageUrl, urlParams.chartsStorageVer || "1.0") : (t.setEnabled("saveload_storage_customization", !1), t.setEnabled("header_saveload", !1))) }

        function n() { O.resolve() }
        var s, r, a, l, h, c, d, p, u, _, f, m, g, v, y, b, w, S, T, C, x, P, L, k, I, A, E, M, D, O, V;
        i(513), i(729), i(28), s = i(756), i(711), i(683), i(581), r = i(279), a = i(47).Action, l = i(361).ChartSaver, h = i(666), c = i(72), d = i(34), p = i(27), u = p.formatterOptions, _ = p.customFormatters, f = i(541), m = i(583), g = i(259).Root, v = i(536).ChartPage, y = new g(window), b = new v(y.allocate()), i(575), w = i(598), S = i(595), T = i(662), C = i(643), x = i(572), P = i(53).UndoHistory, L = i(281), k = i(670), i(141), i(578), I = i(77), A = !!urlParams.indicatorsFile, E = $.Deferred(), M = $.Deferred(), $.when(E, M).done(function() { ChartApiInstance.start() }), A ? $.getScript(urlParams.indicatorsFile).done(function() { void 0 !== window.__customIndicators && window.isArray(window.__customIndicators) && (window.PineJS = i(56), JSServer.studyLibrary = JSServer.studyLibrary.concat(window.__customIndicators), console.log("{0} custom indicators loaded.".format(window.__customIndicators.length)), E.resolve()) }).fail(function(t) { console.warn("Error loading custom indicators @ `{0}`: {1} ({2}) ".format(urlParams.indicatorsFile, t.statusText, t.status)), E.resolve() }) : E.resolve(), window.widgetReady = function(t) { d.subscribe("onChartReady", t) }, window.customizeUI = function(t) { window.applyStudiesOverrides(t.studiesOverrides), window.__defaultsOverrides = t.defaultsOverrides }, window.applyStudiesOverrides = function(t) {
                if (t) {
                    for (var e in t) L.setProperty(e, t[e]);
                    L.applyDefaultsToFactoryDefaults(Object.keys(t))
                }
            }, window.applyOverrides = function(t) { $.extend(!0, window.__defaultsOverrides, t), window.applyDefaultsOverrides(TradingView.defaultProperties.chartproperties), window.applyDefaultOverridesToLinetools(), window.chartWidgetCollection.applyOverrides(t) }, window.is_authenticated = !1, window.parent[urlParams.uid].brokerFactory, D = function() {
                var e, i, o, n, s, r, a, p, g, v;
                if (!Modernizr.canvas || !Modernizr.canvastext) throw Error("Charting library cannot be running under this browser");
                t.setEnabled("charting_library_debug_mode", "true" === urlParams.debug), t.setEnabled("chart_property_page_trading", !1), t.setEnabled("chart_property_page_template_button", !1), e = window.headerChartPanel = $(".header-chart-panel"), i = $("#library-container"), t.enabled("remove_library_container_border") && (i.css("border", "0px"), i.css("padding", "1px")), window.customizeUI({ studiesOverrides: urlParams.studiesOverrides ? JSON.parse(urlParams.studiesOverrides) : void 0, defaultsOverrides: JSON.parse(urlParams.overrides) }), urlParams.numeric_formatting = urlParams.numeric_formatting && JSON.parse(urlParams.numeric_formatting),
                    urlParams.numeric_formatting && "string" == typeof urlParams.numeric_formatting.decimal_sign && (u.decimalSign = urlParams.numeric_formatting.decimal_sign[0]), window.ChartApiInstance = new x(window.parent[urlParams.uid].datafeed), window.parent[urlParams.uid].customFormatters && (window.parent[urlParams.uid].customFormatters.timeFormatter && (_.timeFormatter = window.parent[urlParams.uid].customFormatters.timeFormatter), window.parent[urlParams.uid].customFormatters.dateFormatter && (_.dateFormatter = window.parent[urlParams.uid].customFormatters.dateFormatter)), urlParams.autoSaveDelay && ChartApiInstance.setAutoSaveDelay(urlParams.autoSaveDelay), ChartApiInstance.setTimeFramesList(JSON.parse(urlParams.timeFrames)), ChartApiInstance.setStudiesAccessController(ChartApiInstance.createStudiesAccessController(urlParams.studiesAccess)), o = window.parent[window.urlParams.uid].settingsAdapter, null != o ? (TVSettings.setSettingsAdapter(o), TVSettings.sync()) : t.enabled("use_localstorage_for_settings") && TVSettings.sync(), n = urlParams.chartContent ? JSON.parse(urlParams.chartContent).json : void 0, s = urlParams.interval || "D", r = { resizerBridge: b.allocate({ areaName: "center" }), padding: t.enabled("border_around_the_chart") ? 5 : 0, edge: t.enabled("border_around_the_chart") ? 5 : 0, content: n, widgetOptions: { hideIdeas: !0, addVolume: !0, handleSessionErrors: !0, muteSessionErrors: !0, timezone: urlParams.timezone, defSymbol: urlParams.symbol, defInterval: s, defTimeframe: urlParams.timeframe && urlParams.timeframe.toLowerCase() }, globalEvents: !0, snapshotUrl: urlParams.snapshotUrl }, n && void 0 !== n.extendedData && (a = n.extendedData, r.metaInfo = { id: a.uid, name: a.name, description: a.description, uid: a.uid, username: "", tags: "" }), p = window.chartWidgetCollection = new w(r), "undefined" != typeof serviceLocator && serviceLocator.registerService(CHART_WIDGET_COLLECTION_SERVICE, p), p.activeChartWidget.subscribe(function(t) { d.emit("activeChartChanged", p.getAll().indexOf(t)) }), window.saver = new l(p), window.chartWidget = p.activeChartWidget.value(), window.pro = new TradingView.Pro, g = JSON.parse(urlParams.favorites), g.intervals = g.intervals.map(function(t) { var e = "" + t; return e.match(/1[DWMYdwmy]/) && (e = e.slice(1)), e }), t.enabled("study_templates") && (window.studyTemplates = new h({ chartWidgetCollection: p, notShowQuicks: !t.enabled("items_favoriting") })), v = null, window.headerWidget = new S({ resizerBridge: b.allocate({ areaName: "top" }), chartWidgetCollection: p, headerChartPanel: e, domePanel: v, hideStudyTemplates: !0, favoriteIntervals: g.intervals, interval_options: { interval: s }, favoriteChartTypes: g.chartTypes }), window.tradingViewApi = new k(p, window.saver, ChartApiInstance, window.headerWidget.saveLoadWidget()), c.bindToChartWidgetCollection(p), 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: p, 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(p), 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(), O = $.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(), V = $.Deferred(), $.when(s, V, O).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", "anonymizeIp", !0), 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, V.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(3))
}, function(t, e, i) {
    (function(t) {
        "use strict";

        function o(t, e) { r.call(this, t, e), this._linetool = t, this._pointIndex = e, this._text = "", this._coordinate = 0, this._background = "#5592C9", this._activeBackground = "#0F6DBF", this._borderColor = "#2E84A6", this._color = "white", this._invalidated = !0, this._model = t._model }

        function n(t, e) { l.call(this), this._linetool = t, this._pointindex = e, this._model = t._model, this._text = "", this._coordinate = 0, this._background = "#5592C9", this._activeBackground = "#0F6DBF", this._borderColor = "#2E84A6", this._color = "white", this._visible = !1, this._invalidated = !0 }

        function s(t, e, i) {
            var o, r, a;
            if (c.call(this), this._model = t, this._properties = i, this._pointAdded = new w, this._pointChanged = new w, i.visible && i.frozen || this._properties.merge(defaults("linetool")), o = defaults("linetoolvisibilities"), i.intervalsVisibilities)
                for (r in o.intervalsVisibilities) this._properties.intervalsVisibilities[r] || this._properties.intervalsVisibilities.addProperty(r, o.intervalsVisibilities[r]);
            else this._properties.merge(o);
            if ($.isArray(e) ? this._paneViews = e : this._paneViews = [e], this._points = [], this._fixedPoints = [], this._timePoint = [], this._properties.symbol || this._properties.merge({ symbol: t.mainSeries().symbol() }), this._properties.interval || this._properties.merge({ interval: t.mainSeries().interval() }), this._properties.addExclusion && (this._properties.addExclusion("symbol"), this._properties.addExclusion("symbolInfo"), this._properties.addExclusion("points"), this._properties.addExclusion("interval"), this._properties.addExclusion("visible"), this._properties.addExclusion("lastUpdateTime")), this.calcIsActualSymbol(), this._properties.intervalsVisibilities.listeners().subscribe(this, s.prototype.calcIsActualSymbol),
                this._properties.listeners().subscribe(this, s.prototype.propertiesChanged), this._createPointsProperties(), "_tooltipFieldsHash" in this && !this.hasOwnProperty("_tooltipFieldsHash") && (this._tooltipFieldsHash = $.extend(!0, {}, this._tooltipFieldsHash)), this.m_priceAxisViews = [], this.m_timeAxisViews = [], this.pointsCount() > 0)
                for (a = 0; a < this.pointsCount(); a++) this.m_priceAxisViews.push(this.createPriceAxisView(a)), this.m_timeAxisViews.push(new n(this, a));
            this._properties.visible.listeners().subscribe(this, function(t) { t.value() || this._model.selectedSource() !== this || this._model.setSelectedSource(null) }), this.customization = this.customization || { forcePriceAxisLabel: !1, disableSelection: !1, disableErasing: !1, disableSave: !1, showInObjectsTree: !0 }, $(window).resize(function() { this.isFixed() && this.restoreFixedPoints() }.bind(this)), this._properties.lastUpdateTime || this._properties.addProperty("lastUpdateTime", 0)
        }
        var r = i(66),
            a = i(67),
            l = i(212),
            h = i(213),
            c = i(48).DataSource,
            d = i(42),
            p = i(36).Interval,
            u = i(121).DateTimeFormatter,
            _ = i(2),
            f = i(587),
            m = i(21),
            g = i(47),
            v = g.Action,
            y = i(53).UndoHistory,
            b = i(12).getLogger("Chart.LineDataSource"),
            w = i(15);
        inherit(o, r), o.prototype.update = function() { this._invalidated = !0 }, o.prototype.setActive = function(t) { this._active = t }, o.prototype._updateImpl = function() {
                var t, e, i, o, n;
                if (this._visible = !1, this._text = "", this._model.timeScale() && !this._model.timeScale().isEmpty() && this._linetool.priceScale() && !this._linetool.priceScale().isEmpty() && (this._model.selectedSource() === this._linetool || this._linetool.customization.forcePriceAxisLabel) && (t = this._model.timeScale().visibleBars(), !t.isEmpty() && (e = this._linetool.axisPoints(), !(e.length <= this._pointIndex) && (i = e[this._pointIndex], isFinite(i.price))))) {
                    if (o = this._linetool.priceScale(), o.isPercent()) {
                        if (n = this._linetool.ownerSource().firstValue(), !isNumber(n)) return;
                        i.price = o.priceRange().convertToPercent(i.price, n)
                    }
                    this._text = o.formatter().format(i.price), this._coordinate = o.priceToCoordinate(i.price), this._visible = !0
                }
            }, o.prototype.renderer = function() { this._invalidated && (this._updateImpl(), this._invalidated = !1); var t = { text: this._text, coordinate: this._coordinate, color: this._color, borderColor: this._borderColor, background: this._active ? this._activeBackground : this._background, visible: this._visible }; return new a(t) }, o.prototype.text = function() { return this._invalidated && (this._updateImpl(), this._invalidated = !1), r.prototype.text.call(this) }, inherit(n, l), n.prototype.setActive = function(t) { this._active = t }, n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() {
                var t, e, i;
                this._visible = !1, this._model.timeScale().isEmpty() || (t = this._linetool.axisPoints(), t.length <= this._pointindex || this._linetool === this._model.selectedSource() && (this._text = "", e = t[this._pointindex].index, this._coordinate = this._model.timeScale().indexToCoordinate(e), i = this._model.timeScale().indexToUserTime(e), i && (this._text = new u(this._model.mainSeries().isDWM()).format(i)), this._visible = !0, this._invalidated = !1))
            }, n.prototype.renderer = function() {
                this._invalidated && (this.updateImpl(), this._invalidated = !1);
                var t = { text: this._text, coordinate: this._coordinate, color: this._color, background: this._active ? this._activeBackground : this._background, borderColor: this._borderColor, visible: this._visible };
                return new h(t)
            }, inherit(s, c), s.LINEEND_NORMAL = 0, s.LINEEND_ARROW = 1, s.LINEEND_CIRCLE = 2, s.prototype.pointAdded = function() { return this._pointAdded }, s.prototype.pointChanged = function() { return this._pointChanged }, s.PointPriceProperty = function(e, i) { t.call(this), this._lineSource = e, this._pointIndex = i, e.pointAdded().subscribe(this, function(t) { this._pointIndex === t && this._listeners.fire(this) }), e.pointChanged().subscribe(this, function(t) { this._pointIndex === t && this._listeners.fire(this) }) }, inherit(s.PointPriceProperty, t), s.prototype.enableCurrentIntervalVisibility = function() {
                var t, e, i, o, n, s, r, a = p.parse(this._model.mainSeries().interval());
                a.kind() === p.SECONDS && (a.multiplier() < 60 ? (this.properties().intervalsVisibilities.seconds.setValue(!0), t = Math.min(this.properties().intervalsVisibilities.secondsFrom.value(), a.multiplier()), this.properties().intervalsVisibilities.secondsFrom.setValue(t), e = Math.max(this.properties().intervalsVisibilities.secondsTo.value(), a.multiplier()), this.properties().intervalsVisibilities.secondsTo.setValue(e)) : a = new p(p.MINUTES, a.multiplier() / 60)), a.kind() === p.MINUTES && (a.multiplier() < 60 ? (this.properties().intervalsVisibilities.minutes.setValue(!0), t = Math.min(this.properties().intervalsVisibilities.minutesFrom.value(), a.multiplier()), this.properties().intervalsVisibilities.minutesFrom.setValue(t), e = Math.max(this.properties().intervalsVisibilities.minutesTo.value(), a.multiplier()), this.properties().intervalsVisibilities.minutesTo.setValue(e)) : (i = Math.floor(a.multiplier() / 60), this.properties().intervalsVisibilities.hours.setValue(!0), o = Math.min(this.properties().intervalsVisibilities.hoursFrom.value(), i), this.properties().intervalsVisibilities.hoursFrom.setValue(o), n = Math.max(this.properties().intervalsVisibilities.hoursTo.value(), i), this.properties().intervalsVisibilities.hoursTo.setValue(n))), a.kind() === p.DAYS && (this.properties().intervalsVisibilities.days.setValue(!0), s = Math.min(this.properties().intervalsVisibilities.daysFrom.value(), a.multiplier()), this.properties().intervalsVisibilities.daysFrom.setValue(s), r = Math.max(this.properties().intervalsVisibilities.daysTo.value(), a.multiplier()), this.properties().intervalsVisibilities.daysTo.setValue(r)), a.kind() === p.WEEKS && this.properties().intervalsVisibilities.weeks.setValue(!0), a.kind() === p.MONTHS && this.properties().intervalsVisibilities.months.setValue(!0)
            }, s.prototype.getType = function() { return TradingView.className(this.constructor) }, s.prototype.getConstructor = function() { return this._constructor || null }, s.prototype.isActualSymbol = function() { return this._isActualSymbol }, s.prototype.isActualInterval = function() { return this._isActualInterval }, s.prototype.isSavedInChart = function(t) { return !this.customization.disableSave }, s.prototype.showInObjectTree = function() { return this.customization.showInObjectsTree }, s.prototype.visibilityKeyByInterval = function(t) {
                var e, i = p.parse(t);
                return s.IntervalsVisibilities.forEach(function(t) { t.kind === i.kind() && t.from <= i.multiplier() && t.to >= i.multiplier() && (e = t.key) }), e
            }, s.prototype.calcIsActualSymbol = function() {
                var t = this._properties.symbol,
                    e = this._model.mainSeries();
                this._isActualSymbol = e.symbolSameAsCurrent(t.value()), this._isActualSymbol && t.setValue(e.symbol()), this.calcIsActualInterval()
            }, s.prototype.calcIsActualInterval = function() {
                var t, e, i, o, n = this._properties,
                    s = this._model.mainSeries(),
                    r = p.parse(s.interval()),
                    a = n.intervalsVisibilities;
                this._isActualInterval = !1, r.kind() === p.SECONDS && (t = a.seconds.value(), e = a.secondsFrom.value(), i = a.secondsTo.value(), this._isActualInterval = t && r.multiplier() >= e && r.multiplier() <= i), r.kind() === p.MINUTES && r.multiplier() < 60 && (t = a.minutes.value(), e = a.minutesFrom.value(), i = a.minutesTo.value(), this._isActualInterval = t && r.multiplier() >= e && r.multiplier() <= i), r.kind() === p.MINUTES && r.multiplier() >= 60 && (o = Math.floor(r.multiplier() / 60), t = a.hours.value(), e = a.hoursFrom.value(), i = a.hoursTo.value(), this._isActualInterval = t && o >= e && o <= i), r.kind() === p.DAYS && (t = a.days.value(), e = a.daysFrom.value(), i = a.daysTo.value(), this._isActualInterval = t && r.multiplier() >= e && r.multiplier() <= i), r.kind() === p.WEEKS && (this._isActualInterval = a.weeks.value()), r.kind() === p.MONTHS && (this._isActualInterval = a.months.value()), this._isActualInterval || this._model.selectedSource() !== this || this._model.setSelectedSource(null)
            }, s.PointPriceProperty.prototype.value = function() {
                var t = this._lineSource.points()[this._pointIndex].price,
                    e = this._lineSource.ownerSource().formatter(),
                    i = e.parse(e.format(t));
                return i.price ? i.price : i.value
            }, s.PointPriceProperty.prototype.setValue = function(t) {
                var e, i, o = this._lineSource.points()[this._pointIndex];
                o.price = parseFloat(t), e = this._lineSource.priceScale(), e.isPercent() && (i = this._lineSource.ownerSource().firstValue(), o.price = e.priceRange().convertToPercent(o.price, i)), this._lineSource.setPoint(this._pointIndex, o), this._lineSource._model.updateSource(this._lineSource), this._listeners.fire(this), this._lineSource.endChanging(!0), this._lineSource._syncMultichartState(), this._lineSource._properties.lastUpdateTime.setValue((new Date).valueOf())
            }, s.PointIndexProperty = function(e, i) { t.call(this), this._lineSource = e, this._pointIndex = i }, inherit(s.PointIndexProperty, t), s.PointIndexProperty.prototype.value = function() { return this._lineSource.points()[this._pointIndex].index }, s.PointIndexProperty.prototype.setValue = function(t) {
                var e, i, o = this._lineSource.points()[this._pointIndex];
                o.index = t, e = this._lineSource.priceScale(), e.isPercent() && (i = this._lineSource.ownerSource().firstValue(), o.price = e.priceRange().convertToPercent(o.price, i)), this._lineSource.setPoint(this._pointIndex, o), this._lineSource._model.updateSource(this._lineSource), this._listeners.fire(this), this._lineSource.endChanging(!0), this._lineSource._syncMultichartState(), this._lineSource._properties.lastUpdateTime.setValue((new Date).valueOf())
            }, s.prototype._syncMultichartState = function() {
                var t = { points: this._timePoint, interval: this._model.mainSeries().interval() };
                this.linkKey && !this.properties().singleChartOnly && d.finishChangingLineTool({ model: this._model, linkKey: this.linkKey, symbol: this._model.mainSeries().symbol(), finalState: t })
            }, s.prototype._createPointProperty = function(t) {
                var e, i = this._properties.points;
                i.addProperty(t), e = i[t], e.addChild("price", new s.PointPriceProperty(this, t)), e.addChild("bar", new s.PointIndexProperty(this, t))
            }, s.prototype._createPointsProperties = function() { this._properties.addProperty("points"); for (var t = 0; t < this.pointsCount(); t++) this._createPointProperty(t) }, s.prototype.priceScale = function() { return this._ownerSource ? this._ownerSource.m_priceScale : null }, s.prototype.symbol = function() { return this._properties.symbol.value() }, s.prototype.properties = function() { return this._properties }, s.prototype.isSavedInStudyTemplates = function() { return !1 }, s.prototype.state = function(t) {
                var e = TradingView.className(this.constructor),
                    i = { type: e, id: this.id(), state: this.properties().state(), points: this._timePoint, zorder: this.zorder(), linkKey: this.linkKey };
                return i.state._isActualInterval = this.isActualInterval(), delete i.state.points, t && (i.indexes = this._points), this.ownerSource() && (i.ownerSource = this.ownerSource().id()), this.isFixed() && (i.positionPercents = this._positionPercents || this.calcPositionPercents()), "version" in this && 1 !== this.version && (i.version = this.version), this.hasAlert.value() && (i.alertId = this._alertId), i
            }, s.prototype.template = function() { var t = this.properties().state(); return delete t.points, delete t.symbol, delete t.symbolInfo, t }, s.prototype.restoreTemplate = function(t) { delete t.symbolInfo, this._model._undoModel.drawingLoadTemplate(this, t) }, s.prototype.clearData = function() { this._points = [] }, s.prototype.currentPointsetId = function() { return "pointset_" + this._currentPointsetId }, s.prototype.stop = function() { this._currentPointsetId && (this._model.chartApi().removePointset(this.currentPointsetId()), this._currentPointsetId = null), this.hasAlert.value() && TradingView.alertsDispatcher && TradingView.alertsDispatcher.deleteAlert(this._alertId) }, s.prototype.isStarted = function() { return !!this._currentPointsetId }, s.prototype.restart = function() { this.isFixed() || (this._currentPointsetId = 0, this.createServerPoints()) }, s.prototype.tryCreateServerPoints = function() { this.isFixed() || this._currentPointsetId || this.createServerPoints() }, s.prototype.normalizePoint = function(t) { var e = this._model.timeScale().normalizeBarIndex(t.index); return e.price = t.price, e }, s.prototype.normalizePoints = function() {
                var t, e;
                for (this._timePoint = [], t = 0; t < this._points.length; t++) {
                    if (e = this._model.timeScale().normalizeBarIndex(this._points[t].index), !e.time_t) { this._timePoint = []; break }
                    e.price = this._points[t].price, this._timePoint.push(e)
                }
            }, s.prototype.denormalizeTimePoints = function() {
                var t, e, i = [];
                for (t = 0; t < this._timePoint.length; t++) {
                    if (void 0 === (e = this._model.timeScale().denormalizeTimePoint(this._timePoint[t]))) { i = []; break }
                    i.push({ index: e, price: this._timePoint[t].price })
                }
                i.length > 0 && (this._points = i)
            }, s.prototype.restorePoints = function(t, e, i) { this._timePoint = t, this._points = e, i || this.denormalizeTimePoints() },
            s.prototype.restoreExternalPoints = function(t) { this.properties().interval.setValue(t.interval), this._timePoint = t.points, this.denormalizeTimePoints(), this.createServerPoints() }, s.prototype.restorePositionPercents = function(t) { this._positionPercents = t }, s.prototype.updateAllViewsAndRedraw = function() { this.updateAllViews(), this._model.updateSource(this) }, s.prototype.propertiesChanged = function() {
                if (this.calcIsActualSymbol(), this.updateAllViewsAndRedraw(), this.linkKey) {
                    var t = this.properties().state();
                    delete t.interval, d.changeLineStyle({ linkKey: this.linkKey, state: t, model: this._model })
                }
            }, s.prototype.points = function() { var t, e, i = []; for (t = 0; t < this._points.length; t++) e = this._points[t], i.push({ index: e.index, price: e.price, time: e.time }); return this._lastPoint && i.push({ index: this._lastPoint.index, price: this._lastPoint.price, time: this._lastPoint.time }), this._currentMovingPoint && this._startMovingPoint && this.correctPoints(i), i }, s.prototype.axisPoints = function() { return this.points() }, s.prototype.fixedPoints = function() {
                var t, e, i, o, n = [];
                if (this._positionPercents && !this.priceScale().isEmpty())
                    for (t = 0; t < this._positionPercents.length; t++) e = this._positionPercents[t], i = this._model.timeScale().width() * e.x, o = this.priceScale().height() * e.y, n.push(new _.Point(i, o));
                else
                    for (t = 0; t < this._fixedPoints.length; t++) n.push(this._fixedPoints[t].clone());
                return this._lastPoint && n.push(this._lastPoint.clone()), this._currentMovingPoint && this._startMovingPoint && this.correctFixedPoints(n), n
            }, s.prototype._convertPriceFromPercentIfNeeded = function(t) {
                var e, i = this.priceScale();
                i.isPercent() && (e = this.ownerSource().firstValue(), t.price = i.priceRange().convertFromPercent(t.price, e))
            }, s.prototype._preparePoint = function(t, e) { var i = t; return e && e.shift && this.points().length >= 2 && this._properties.snapTo45Degrees && this._snapPoint45Degree(i, this.points()[this.points().length - 2]), this._convertPriceFromPercentIfNeeded(i), i }, s.prototype.addPoint = function(t, e, i) { var o = this._preparePoint(t, e); return this._addPointIntenal(o, e, i) }, s.prototype._addPointIntenal = function(t, e, i) { this._points.push(t); var o = this._points.length === this.pointsCount(); return o ? (this._lastPoint = null, i || (this.normalizePoints(), this.createServerPoints())) : this._lastPoint = t, this._pointAdded.fire(this._points.length - 1), o }, s.prototype.addFixedPoint = function(t) { this._fixedPoints.push(t); var e = this._fixedPoints.length === this.pointsCount(); return e && this.calcPositionPercents(), e }, s.prototype.calcPositionPercents = function() { var t, e, i, o; if (!this.priceScale() || this.priceScale().isEmpty()) return []; for (this._positionPercents = [], t = 0; t < this._fixedPoints.length; t++) e = this._fixedPoints[0], i = e.x / this._model.timeScale().width(), o = e.y / this.priceScale().height(), this._positionPercents.push({ x: i, y: o }); return this._positionPercents }, s.prototype.restoreFixedPoints = function() { this._fixedPoints = this.fixedPoints() }, s.prototype.onData = function(t) {
                var e, i, o, n, s, r;
                if (t.params.customId === this.currentPointsetId() && 0 !== t.params.plots.length) {
                    for (e = 0; e < t.params.plots.length; e++) i = t.params.plots[e], o = this._timePoint[i.index], n = i.value[0],
                        s = new Date(1e3 * i.value[1]), r = { index: n, time: s, price: o.price }, this._points.length <= i.index ? (this._points.push(r), this._pointAdded.fire(this._points.length - 1)) : (this._points[i.index] = r, this._pointChanged.fire(i.index));
                    this.checkAlert && this.checkAlert(), this.updateAllViewsAndRedraw()
                }
            }, s.prototype.correctPricesToPercents = function() {
                var t, e, i = this.priceScale(),
                    o = this.ownerSource().firstValue();
                for (t = 0; t < this._points.length; t++) e = this._points[t], e.price = i.priceRange().convertFromPercent(e.price, o), this._pointChanged.fire(t)
            }, s.prototype.startChanging = function(t, e) { t < this.m_priceAxisViews.length && this.m_priceAxisViews[t].setActive(!0), t < this.m_timeAxisViews.length && this.m_timeAxisViews[t].setActive(!0), this._properties.lastUpdateTime.setValue((new Date).valueOf()) }, s.prototype.setPoint = function(t, e, i) {
                if (i && i.shift && this._properties.snapTo45Degrees) {
                    var o = 0 === t ? 1 : t - 1;
                    this._snapPoint45Degree(e, this.points()[o])
                }
                this._convertPriceFromPercentIfNeeded(e), this._points[t] = e, this._pointChanged.fire(t), this.normalizePoints()
            }, s.prototype.startMoving = function(t) { this.isFixed() && this.restoreFixedPoints(), this._convertPriceFromPercentIfNeeded(t), this._startMovingPoint = t, this._properties.lastUpdateTime.setValue((new Date).valueOf()) }, s.prototype.move = function(t) { this._convertPriceFromPercentIfNeeded(t), this._currentMovingPoint = t, this.updateAllViews() }, s.prototype.correctPoints = function(t) {
                var e, i, o = this._currentMovingPoint.index - this._startMovingPoint.index,
                    n = this._currentMovingPoint.price - this._startMovingPoint.price;
                if (0 === o && 0 === n) return !1;
                for (e = 0; e < t.length; e++) i = t[e], i.index += o, i.price += n, t[e] = i;
                return !0
            }, s.prototype.correctFixedPoints = function(t) { var e, i = this._currentMovingPoint.substract(this._startMovingPoint); for (e = 0; e < t.length; e++) t[e] = t[e].add(i) }, s.prototype.endMoving = function(t) {
                var e, i, o;
                if (this._properties.interval.setValue(this._model.mainSeries().interval()), e = !1, i = !1, this._currentMovingPoint && this._startMovingPoint) {
                    if (e = this._currentMovingPoint.index !== this._startMovingPoint.index, i = this._currentMovingPoint.price !== this._startMovingPoint.price, this.isFixed()) this.correctFixedPoints(this._fixedPoints);
                    else if (this.correctPoints(this._points))
                        for (o = 0; o < this._points.length; o++) this._pointChanged.fire(o);
                    this._startMovingPoint = null, this._currentMovingPoint = null
                }
                if (this.isFixed()) return this.calcPositionPercents(), void this.updateAllViews();
                this.normalizePoints(), this.updateAllViews(), e && !t && this.createServerPoints(), (i || e) && this.synchronizeAlert(!this._alertUndoMode)
            }, s.prototype.endChanging = function(t, e) {
                var i;
                for (this._properties.interval.setValue(this._model.mainSeries().interval()), e || (this.normalizePoints(), this.createServerPoints()), i = 0; i < this.m_priceAxisViews.length; i++) this.m_priceAxisViews[i].setActive(!1);
                for (i = 0; i < this.m_timeAxisViews.length; i++) this.m_timeAxisViews[i].setActive(!1);
                this.synchronizeAlert(!t)
            }, s.prototype.paneViews = function(t) {
                var e, i;
                if (!this._isActualSymbol || !this._isActualInterval) return null;
                if (!this._properties.visible.value()) return null;
                if (d.hideAllDrawings().value() && this.canBeHidden()) return null;
                for (e = [], i = this._paneViews.length - 1; i >= 0; --i) e.push(this._paneViews[i]);
                return e
            }, s.prototype.dataWindowView = function() { return null }, s.prototype.statusView = function() { return null }, s.prototype.priceAxisViews = function(t, e) { var i, o, n; return this._isActualSymbol && -1 !== t.dataSources().indexOf(this) && e === this.priceScale() ? this._model.lineBeingEdited() === this ? (i = this._model.linePointBeingEdited(), i < this.m_priceAxisViews.length ? (o = this.m_priceAxisViews.slice(), n = o[i], o.splice(i, 1), o.push(n), o) : this.m_priceAxisViews) : this.m_priceAxisViews : null }, s.prototype.timeAxisViews = function() { var t, e, i; return this._model.lineBeingEdited() === this ? (t = this._model.linePointBeingEdited(), t < this.m_timeAxisViews.length ? (e = this.m_timeAxisViews.slice(), i = e[t], e.splice(t, 1), e.push(i), e) : this.m_timeAxisViews) : this.m_timeAxisViews }, s.prototype.updateAllViews = function() {
                var t, e, i;
                if (!this._isActualSymbol) return null;
                if (!this._properties.visible.value()) return null;
                if (null !== (t = this.paneViews()))
                    for (e = t, i = 0; i < e.length; i++) e[i].update();
                for (e = this.m_priceAxisViews, i = 0; i < e.length; i++) e[i].update();
                for (e = this.m_timeAxisViews, i = 0; i < e.length; i++) e[i].update()
            }, s.prototype.setLastPoint = function(t, e) { this._lastPoint = this._preparePoint(t, e), this.updateAllViews() }, s.prototype.setLastFixedPoint = function(t) { this._lastFixedPoint = t, this.updateAllViews() }, s.prototype.title = function() { return "Line Tool" }, s._pointSetId = 1, s.prototype.start = function() { this.createServerPoints() }, s.prototype.createServerPoints = function() {
                var t, e, i, o, n, r;
                if (!this._recursiveGuard && this._isActualSymbol && this._model.chartApi().connected() && (this._currentPointsetId && (this._model.chartApi().removePointset(this.currentPointsetId()), this._currentPointsetId = null), !this._model.timeScale().isEmpty() && (0 === this._timePoint.length && this.normalizePoints(), 0 !== this._timePoint.length))) {
                    for (this._currentPointsetId = ++s._pointSetId, t = this._model.mainSeries().symbolId(), e = this.properties().interval.value(), i = [], o = 0; o < this._timePoint.length; o++) n = this._timePoint[o], i.push([n.time_t, n.offset]);
                    r = this, this._model.chartApi().createPointset(this.currentPointsetId(), "turnaround", t, e, i, function(t) { r.onData(t) })
                }
            }, s.prototype.isBeingEdited = function() { return this === this._model.lineBeingEdited() || this === this._model.sourceBeingMoved }, s.prototype.isFixed = function() { return this.properties().locked && this.properties().locked.value() }, s.prototype.isLocked = s.prototype.isFrozen = function() { return this.properties().frozen && this.properties().frozen.value() }, s.prototype._tooltipFieldsHash = {}, s.prototype._tooltipFieldsOrder = ["time", "price", "index", "time0", "price0", "time1", "price1", "time2", "price2", "time3", "price3", "time4", "price4", "distance", "term", "pointsPerBar"], s.prototype._tooltipFieldsOrdered = null, s.prototype._formatTooltip = function() {
                return null === this._tooltipFieldsOrdered && (this._tooltipFieldsOrdered = new f(this._tooltipFieldsHash, f.byOrder(this._tooltipFieldsOrder))), this._tooltipFieldsOrdered.array.filter(function(t) {
                    return null !== t.value && "" !== t.value
                }).map(function(t) { return "<span>" + t.title + ":</span> " + t.value }).join("<br />")
            }, s.prototype.pointToScreenPoint = function(t) {
                var e, i, o, n, s, r, a = this._model.timeScale(),
                    l = this.priceScale();
                if (!l || l.isEmpty() || a.isEmpty()) return [new _.Point(0, 0), new _.Point(0, 0)];
                if (e = null, l.isPercent()) { if (!this.ownerSource()) return; if (null === (e = this.ownerSource().firstValue()) || !isFinite(e)) return }
                return i = a.indexToCoordinate(t.index, !0), o = t.price, l.isPercent() && (o = l.priceRange().convertToPercent(o, e)), n = l.priceToCoordinate(o, !0), s = new _.Point(i, n), i = a.indexToCoordinate(t.index, !1), n = l.priceToCoordinate(o, !1), r = new _.Point(i, n), [s, r]
            }, s.prototype.screenPointToPoint = function(t) {
                var e = this._model.timeScale(),
                    i = this.priceScale(),
                    o = e.coordinateToIndex(t.x),
                    n = i.coordinateToPrice(t.y),
                    s = null;
                if (i.isPercent()) { if (!this.ownerSource()) return; if (null === (s = this.ownerSource().firstValue()) || !isFinite(s)) return }
                return i.isPercent() && (n = i.priceRange().convertFromPercent(n, s)), { price: n, index: o }
            }, s.prototype.tags = function() { return [this._constructor] }, s.prototype._snapPoint45Degree = function(t, e, i) {
                var o, n, s, r, a, l, h, c, d, p, u, _, f = this._model.timeScale(),
                    m = f.indexToCoordinate(e.index),
                    g = f.indexToCoordinate(t.index) - m,
                    v = this.m_priceScale,
                    y = e.price,
                    b = t.price,
                    w = this.ownerSource().firstValue();
                v.isPercent() && (y = v.priceRange().convertToPercent(y, w)), o = v.priceToCoordinate(y), n = v.priceToCoordinate(b) - o, s = Math.round(Math.atan2(g, n) / Math.PI * 4), 2 === Math.abs(s) ? i || (t.price = y) : 0 === Math.abs(s) || 4 === Math.abs(s) ? i || (t.index = e.index) : 0 === Math.abs(s) || 4 === Math.abs(s) ? i || (t.index = e.index) : (r = Math.sqrt(g * g + n * n), a = g < 0 ? -1 : 1, l = n < 0 ? -1 : 1, h = Math.max(Math.abs(n), Math.abs(g)), c = h * Math.sqrt(2), d = c / r, h /= d, p = Math.round(f.coordinateToIndex(m + h * a)), u = Math.abs(f.indexToCoordinate(p) - m), _ = v.coordinateToPrice(o + u * l), t.index = p, t.price = _)
            }, s.prototype.createPriceAxisView = function(t) { return new o(this, t) }, s.prototype.version = 1, s.isLineTool = function(t) { var e = TradingView[t]; return !!e && TradingView.isInherited(e, s) }, s.prototype.alertId = function() { return this._alertId }, s.prototype.setAlert = function(t, e) {}, s.prototype._flushAlert = function(t) { delete this._alertId, delete this._alert, this.hasAlert.setValue(!1), window.saver && window.saver.saveChartSilently(null, !1) }, s.prototype._processAlertHanders = function(t) {
                var e, i, o, n = this;
                ("unsubscribe" !== (t = "subscribe" === t ? "subscribe" : "unsubscribe") || n._alertCallbacks) && (i = "subscribe" === t ? "on" : "off", e = n.properties(), o = n._alertCallbacks || { flush: n._flushAlert.bind(n), hovered: function(t, e) { e ? n._model.setHoveredSource(n) : n._model.hoveredSource() === n && n._model.setHoveredSource(null) }, selected: function(t, e) { e && n._model.setSelectedSource(n) }, synchronizeSilently: function(t) { n.synchronizeAlert(!1) } }, n._alertCallbacks || (n._alertCallbacks = o), n.getAlert().done(function(s) { s && (s[i]("destroy", o.flush), s[i]("change:hovered", o.hovered), s[i]("change:selected", o.selected), e.extendLeft && e.extendLeft[t](n, o.synchronizeSilently), e.extendRight && e.extendRight[t](n, o.synchronizeSilently)) }))
            }, s.prototype.editAlert = function() {}, s.prototype.getAlert = function(t) {
                var e, i = this;
                return t = t || {},
                    e = $.Deferred(), TradingView.alertsDispatcher ? TradingView.alertsDispatcher.requestAlert(i._alertId, { success: e.resolve.bind(e), error: e.reject.bind(e), fromCache: t.fromCache }) : b.logError("[Alerts] Can't get alert without alerts dispatcher"), e.promise()
            }, s.prototype.synchronizeAlert = function(t) {
                var e = this;
                e.hasAlert.value() && setTimeout(function() {
                    function i() { e._alertUndoMode = !0, r.undoToCheckpoint(e._undoCheckpointAlert), setTimeout(function() { e._alertUndoMode = !1, e.localAndServerAlersMismatch = !1 }, 0) }

                    function o(t) { t.set("resolution", e.properties().interval.value()), t.get("extra").drawing(e), e.localAndServerAlersMismatch = !0 }

                    function n(t) { TradingView.alertsDispatcher.restartAlert(t, { success: function() { e.localAndServerAlersMismatch = !1 }, error: i, complete: function() { delete e._undoCheckpointAlert } }) }
                    var s, r = e._model._undoModel;
                    e._undoCheckpointAlert || e._alertUndoMode || (s = y.undoStack().pop(), e._undoCheckpointAlert = r.createUndoCheckpoint(), y.undoStack().push(s)), e.getAlert().done(function(e) { o(e), t && n(e) }).fail(i)
                }, 0)
            }, s.prototype.stateForAlert = function() { var t, e; if (this.canHasAlert()) return t = this.state(), t.uniqueId = this.uniqueId(), t.title = this.title(), e = this._getAlertPlots(), e && (t.plots = e), t }, s.prototype._getAlertPlots = function() { return null }, s.prototype._linePointsToAlertPlot = function(t, e, i, o) { if (2 !== t.length) return b.logError("[Drawing Alert] Wrong points"), null; var n = this._model.timeScale(); return !n || n.isEmpty() ? null : { type: "LinePlot", title: e || this.title(), timestamp: Math.round(n.indexToTimePoint(0).getTime() / 1e3), offset1: t[0].index, offset2: t[1].index, price1: t[0].price, price2: t[1].price, extendBackward: i || !1, extendForward: o || !1 } }, s.prototype.getAlertIsActive = function(t) { this.getAlert({ fromCache: !0 }).done(function(e) { t(!!e && e.get("active")) }).fail(function() { t(!1) }) }, s.prototype.geometry = function() {
                var t = this,
                    e = function(e) {
                        var i = e.x / t._model.timeScale().width(),
                            o = e.y / t.priceScale().height();
                        return new _.Point(i, o)
                    };
                return this.points().map(function(i) { var o = t.pointToScreenPoint(i)[0]; return e(o) })
            }, s.prototype.onlyYMoving = function() { return !1 }, s.prototype.contextMenuActions = function() { return [] }, s.prototype.updateContextMenuActions = function() {}, s.prototype._makeAdjustScaleAction = function(t) {
                var e = new v({ text: $.t("Adjust Scale") });
                return e.callbacks().subscribe(this, function() {
                    var e = t ? t() : this.points();
                    e.length < 2 || this._adjustScaleForSquare(e[0], e[1])
                }), e
            }, s.prototype._adjustScaleForSquare = function(t, e) {
                var i, o, n, s = this._model.timeScale(),
                    r = this.priceScale(),
                    a = Math.abs(r.priceToCoordinate(t.price) - r.priceToCoordinate(e.price)),
                    l = Math.abs(s.indexToCoordinate(t.index) - s.indexToCoordinate(e.index));
                r.setAutoScale(!1), i = r.priceRange().clone(), i.scaleAroundCenter(a / l), o = Math.min(r.priceToLogical(t.price), r.priceToLogical(e.price)), n = Math.max(r.priceToLogical(t.price), r.priceToLogical(e.price)), i.minValue() > o ? i.shift(o - i.minValue()) : i.maxValue() < n && i.shift(n - i.maxValue()), r.setPriceRange(i), this._model.invalidate(new m(m.FULL_UPDATE))
            }, e.LineToolPriceAxisView = o, e.LineDataSource = s
    }).call(e, i(24))
}, 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 x.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 ? (x.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) {
        var n, s = g(t, e, i, new P(o.x, i.y)),
            r = g(t, e, new P(o.x, i.y), o),
            a = g(t, e, o, new P(i.x, o.y)),
            l = g(t, e, new P(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 P(0, 0) : new P(0, o) : 0 === Math.round(t.y) || 0 === Math.round(e.y) ? new P(i, 0) : new P(i, o) : null }
    var C, x, P, L;
    Object.defineProperty(e, "__esModule", { value: !0 }), C = i(12), x = C.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, P = 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 = P, L = 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 P(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 = L, 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) {
    var o = i(568),
        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, i) {
    (function(t) {
        "use strict";

        function o(t, e) { this._model = e, this._bindings = [], this._property = t }

        function n(t, e, i, o, n, s) {
            if (!t) return void N.logDebug("Binding: missing control");
            this._control = t, this._property = e, this._applyOnFly = i, this._undoModel = o, this._undoText = n, e && (this._formatters = [], this._changed = !1, this.setValue(e.value()), e.listeners().subscribe(this, this.propertyChanged))
        }

        function s(t) { return t.toUpperCase() }

        function r(t) { return function(e) { return e < t ? t : e } }

        function a(t) { return function(e) { return e > t ? t : e } }

        function l(t) { return function(e) { var i = parseInt(e, 10); return TradingView.isNaN(i) ? t : i } }

        function h(t) {
            var e = new V;
            return function(i) {
                var o = e.parse(i);
                return TradingView.isNaN(o) ? t : o
            }
        }

        function c() { 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 d(t) { return function(e) { return 0 === e.length ? t : e } }

        function p(t, e, i, o, s, r) { n.call(this, t, e, o, s, r), this._transformFunction = i, this._attachToControl(t, o) }

        function u(t, e, i, o, n) { p.call(this, t, e, h(e.value()), i, o, n), this.addFormatter(function(t) { return (new V).format(t) }) }

        function _(t, e, i, o, s, r) { this._subControlIds = e, n.call(this, t, i, o, s, r), this._forEachSubControl(function(t) { this._attachToControl(t, o) }) }

        function f(t, e, i, o, s, r, a) {
            this._model = o, this._mainSeries = r, this._toIntTransformer = l(a), this._disabled = !1, n.call(this, t, e, i, o, s);
            var h = this;
            i && t.change(function() { h.setValueToProperty(h.value()) }), this._mainSeries.onBarReceived().subscribe(this, function(t) { h.setValue(this.property().value()) })
        }

        function m(t, e, i, o, s) { n.call(this, t, e, i, o, s), i && t.on("accept-symbol", function(t, e) { this.setValueToProperty(e) }.bind(this)) }

        function g(t, e, i, o, s, r, a, l) {
            n.call(this, t, e, o, s, r), this._transformFunction = i, this._propertyChangedHook = l, this._setter = a;
            var h = this;
            o && t.change(function() { h._setter ? h._setter.call(h, h.value()) : h.setValueToProperty(h.value()) })
        }

        function v(t, e) { n.call(this, t, e) }

        function y(t, e, i, o, s, r) {
            if (!t.is(":checkbox, :radio")) return new w(t, e, i, o, s);
            n.call(this, t, e, i, o, s), this._setter = r;
            var a = this;
            i && t.change(function() { a._setter ? a._setter.call(a, a.value()) : a.setValueToProperty(a.value()) })
        }

        function b(t, e, i, o, s, r) { n.call(this, t, e, i, o, s), this._inverted = !0 === r }

        function w(t, e, i, o, s) {
            n.call(this, t, e, i, o, s);
            var r = this;
            i && t.click(function() {
                var t = $(this).toggleClass("active").hasClass("active");
                r.setValueToProperty(t)
            })
        }

        function S(t, e, i, o, s) {
            if (!i) return void N.logDebug("ActionBinder: Missed undo model");
            n.call(this, t, e, !0, i, o), s ? t.callbacks().subscribe(this, s) : t.callbacks().subscribe(this, S.prototype.onActionCallback)
        }

        function T(t, e, i, o, s, r) {
            var a, l;
            a = t.is("input") ? t : t.find("input"), n.call(this, a, e, i, o, s), this._transparencyProperty = r, this.applyOldTransparency(), l = this, i && a.change(function() { l.setValueToProperty(l.value()) })
        }

        function C(e, i, o, s, r, a) {
            function l(t, e) {
                var i = c.control().slider("option", "min"),
                    o = c.control().slider("option", "max"),
                    n = c._property.value();
                (i <= n && n <= o || i < e.value && e.value < o) && c.setValueToProperty(e.value)
            }

            function h(t, e) { c.setValueToProperty(e.value) }
            isNumber(i.value()) || (N.logWarn("Property cannot be binded to control, bad value (expect number): " + i.value()), i = new t), n.call(this, e, i, o, s, r);
            var c = this;
            o && (a ? (e.bind("slidechange", l), e.bind("slide", l)) : (e.bind("slidechange", h), e.bind("slide", h))), e.bind("slidestart", function(t, e) { s.beginUndoMacro(r) }), e.bind("slidestop", function(t, e) { s.endUndoMacro() })
        }

        function x(t, e, i, o, n, s) { y.call(this, t, e, o, n, s), this._intervalProperty = i, this._intervalProperty.listeners().subscribe(this, this.onIntervalChanged), this.onIntervalChanged() }

        function P(t, e, i, o) {
            this._control = t, this._wv = e, this._transformFunction = i, this._undoText = o, this._attachToControl(this._control),
                this._setValueBinded = this.setValue.bind(this)
        }

        function L(t, e, i, o, n) { this._not = !!n, P.apply(this, arguments) }

        function k(t, e, i, o, n, s, r, a) {
            this._propFrom = e[0], this._propTo = e[1], this._control = t, this._applyOnFly = o, this._undoModel = n, this._undoText = r, this._properties = e, this._inputsText = s, this._transformers = i;
            var l = this;
            t.slider({ range: !0, min: i[0], max: i[1], values: [l._propFrom.value(), l._propTo.value()] }), this.$rangeHandleFrom = $(t.find(".ui-slider-handle")[0]).addClass("from"), this.$rangeHandleTo = $(t.find(".ui-slider-handle")[1]).addClass("to"), this.setValue(this._propFrom, 0), this.setValue(this._propTo, 1), a && ($(a).on("change", function(t) { $(this).is(":checked") ? (l._control.slider("enable"), $(l._inputsText[0]).prop("disabled", !1), $(l._inputsText[1]).prop("disabled", !1)) : (l._control.slider("disable"), $(l._inputsText[0]).prop("disabled", !0), $(l._inputsText[1]).prop("disabled", !0)) }), $(a).is(":checked") ? (l._control.slider("enable"), $(l._inputsText[0]).prop("disabled", !1), $(l._inputsText[1]).prop("disabled", !1)) : (l._control.slider("disable"), $(l._inputsText[0]).prop("disabled", !0), $(l._inputsText[1]).prop("disabled", !0))), s && ($(s[0]).val(this._control.slider("values", 0)), $(s[1]).val(this._control.slider("values", 1)), t.slider({ slide: function(t, e) { $(s[0]).val(e.values[0]), $(s[1]).val(e.values[1]) } }), $(s).each(function() { $(this).on("keydown", function(t) { parseInt($(s[0]).val()) < l._transformers[0] ? $(s[0]).val(l._transformers[0]) : parseInt($(s[1]).val()) > l._transformers[1] && $(s[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() }) }), $(s[0]).on("keyup", function(t) { parseInt($(this).val()) < l._transformers[0] ? $(this).val(l._transformers[0]) : parseInt($(this).val()) > l._transformers[1] && $(this).val(l._transformers[1]), parseInt($(this).val()) > parseInt($(s[1]).val()) && $(this).val(s[1].val()), l._control.slider("values", 0, $(this).val()), k.prototype.setValueToProperty.call(l, l._control.slider("values"), "from") }), $(s[1]).on("keyup", function(t) { parseInt($(this).val()) < l._transformers[0] ? $(this).val(l._transformers[0]) : parseInt($(this).val()) > l._transformers[1] && $(this).val(l._transformers[1]), parseInt($(this).val()) < $(s[0]).val() && $(this).val(s[0].val()), l._control.slider("values", 1, $(this).val()), k.prototype.setValueToProperty.call(l, l._control.slider("values"), "to") })), this._propFrom.listeners().subscribe(this, k.prototype.propertyChanged), this._propTo.listeners().subscribe(this, k.prototype.propertyChanged), o && t.on("slide", function(t, e) { l.setValueToProperty(l._control.slider("values"), e.handle) }), t.slider({
                stop: function(t, e) { s && ($(s[0]).val(l._control.slider("values", 0)), $(s[1]).val(l._control.slider("values", 1))), l.setValueToProperty(l._control.slider("values"), e.handle) },
                start: function(t, e) {
                    s && ($(s[0]).val(l._control.slider("values", 0)), $(s[1]).val(l._control.slider("values", 1))),
                        l.setValueToProperty(l._control.slider("values"), e.handle)
                }
            })
        }

        function I(t, e, i, o, s, r) {
            n.call(this, t, e, i, o, s), this._separator = r || " ";
            var a = this;
            i && t.change(function() { a.setValueToProperty(a.value()) })
        }
        var A = i(37),
            E = A.rgba,
            M = A.rgbaToString,
            D = A.parseRgb,
            O = i(53).UndoHistory,
            V = i(26).NumericFormatter,
            B = i(14),
            R = i(32).addColorPicker,
            N = i(12).getLogger("Chart.PropertyPage");
        o.prototype.model = function() { return this._model }, o.prototype.bindControl = function(t) { return this._bindings.push(t), t }, o.prototype.unbindControl = function(t) { var e = this._bindings.indexOf(t); - 1 !== e && this._bindings.splice(e, 1) }, o.prototype.loadData = function() { var t, e, i; for (t = 0; t < this._bindings.length; t++) e = this._bindings[t], e.properties ? (i = e.properties(), e.setValue(i[0], 0), e.setValue(i[1], 1)) : e.property && (e.transparencyProperty && e.transparencyProperty() ? e.applyOldTransparency() : e.setValue(e.property().value())) }, o.prototype.saveData = function() {
                var t, e;
                for (this._model.beginUndoMacro(), t = 0; t < this._bindings.length; t++) e = this._bindings[t], e.changed() && this._model.setProperty(e.property(), e.value());
                this._model.endUndoMacro()
            }, o.prototype.createColorPicker = function(t) { return R(null, t) }, o.prototype.createTextEditor = function(t, e) { var i = {}; return t && (i.width = t), e && (i.height = e), $(document.createElement("textarea")).css(i) }, o.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)
            }, o.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 }, o.prototype.createFontEditor = function(t) { var e = t || TradingView.factoryDefaults("chartproperties.editorFontsList"); return this.createCombo(e) }, o.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") }, o.prototype.createSeriesMinTickEditor = function() {
                var t, e, i, o, n = "<select><option value='default'>" + $.t("Default") + "</option>",
                    s = [{ priceScale: 1, minMove: 1, frac: !1 }, { priceScale: 10, minMove: 1, frac: !1 }, { priceScale: 100, minMove: 1, frac: !1 }, { priceScale: 1e3, minMove: 1, frac: !1 }, { priceScale: 1e4, minMove: 1, frac: !1 }, { priceScale: 1e5, minMove: 1, frac: !1 }, { priceScale: 1e6, minMove: 1, frac: !1 }, { priceScale: 2, minMove: 1, frac: !0 }, { priceScale: 4, minMove: 1, frac: !0 }, { priceScale: 8, minMove: 1, frac: !0 }, { priceScale: 16, minMove: 1, frac: !0 }, { priceScale: 32, minMove: 1, frac: !0 }, { priceScale: 64, minMove: 1, frac: !0 }, { priceScale: 128, minMove: 1, frac: !0 }, { priceScale: 320, minMove: 1, frac: !0 }];
                for (t in s) e = s[t], i = e.priceScale + "," + e.minMove + "," + e.frac, o = e.minMove + "/" + e.priceScale, n += "<option value='" + i + "'>" + o + "</option>";
                return n += "</select>", $(n)
            }, o.prototype.createPrecisionEditor = function() { var t, e = "<select><option value='default'>" + $.t("Default") + "</option>"; for (t = 0; t <= 6; t++) e += "<option value='" + t + "'>" + t + "</option>"; return e += "</select>", $(e) }, o.prototype.createLabeledCell = function(t, e, i) {
                var o, n, s, r, a = null;
                return "number" == typeof t.valueOf() ? (a = t, o = e, n = i) : (o = t, n = e), o += "", s = this._labelToId(o), r = $("<td>"), $("<label>").html(o.length > 0 ? $.t(o) : "").attr("for", s).appendTo(r), a && r.attr("colspan", a), n && n.attr("id", s), r
            }, o.prototype.createTableInTable = function(t) {
                var e = $("<tr>").appendTo(t),
                    i = $("<td>").appendTo(e);
                return $('<table cellpadding="0" cellspacing="0">').appendTo(i)
            }, o.prototype._labelToId = function(t) { return "control" + t.replace(/(^| )\w/g, function(t) { return "-" + t.trim().toLowerCase() }) + Math.floor(1e3 * Math.random()) }, o.prototype.addRow = function(t) { return $(document.createElement("tr")).appendTo(t) }, o.prototype.addLabeledRow = function(t, e, i, o) {
                var n, s = e && e.length > 0 ? $.t(e) : "",
                    r = $(document.createElement("tr")),
                    a = $(document.createElement("td")).html(s);
                return o && a.attr("colspan", 2), i && (n = this._labelToId(e), i.attr("id", n), a.html('<label for="' + n + '">' + s + "</label>")), r.append(a).appendTo(t)
            }, o.prototype.addEditorRow = function(t, e, i, o) { var n = $(document.createElement("td")); return i.row = this.addLabeledRow(t, e, i, o), i.appendTo(n.appendTo(i.row)), i }, o.prototype.addColorPickerRow = function(t, e) { return this.addEditorRow(t, e, this.createColorPicker()) }, o.prototype.addOffsetEditorRow = function(t, e) { var i = $("<input/>"); return i.attr("type", "text"), i.css("width", "100px"), i.addClass("ticker"), this.addEditorRow(t, e, i) }, o.prototype.addFontEditorRow = function(t, e) { return this.addEditorRow(t, e, this.createFontEditor()) }, o.prototype.refreshStateControls = function(t, e, i) { var o, n, s; for (o = 0; o < e.length; o++) n = e[o], s = t[n.id], s.toggle(this.parseRule(n.visible, e, i)), s.attr("disabled", !this.parseRule(n.visible, e, i)) }, o.prototype.parseRule = function(t, e, i) { if (!t) return !0; var o = t.split("=="); return !(o.length < 2) && i[o[0]].value() === o[1] }, o.prototype.destroy = function() {
                for (var t = this._bindings.length; t--;) this._bindings[t].destroy();
                this._bindings.length = 0
            }, o.prototype.bindInteger = function(t, e, i, o, n) {
                var s = [l(e.value())];
                void 0 !== o && s.push(r(1)), void 0 !== n && s.push(a(1e3)), this.bindControl(new p(t, e, s, !1, this.model(), i))
            }, o.prototype.bindColor = function(t, e, i) { this.bindControl(new T(t, e, !0, this.model(), i)) }, o.prototype.bindBoolean = function(t, e, i) { this.bindControl(new y(t, e, !0, this.model(), i)) }, n.prototype.addFormatter = function(t) { this._formatters.push(t), this.setValue(this._property.value()) }, n.prototype._formatValue = function(t) { return this._formatters.reduce(function(t, e) { return e(t) }, t) }, n.prototype._attachToControl = function(t, e) {
                var i = this;
                e ? t.on("keyup change input", function(t) {
                    var e = i.value();
                    i.setValueToProperty(e), i.setValue(e)
                }) : (t.keypress(function(t) {
                    if (this._changed = !0, 13 === t.which) {
                        var e = i.value();
                        i.setValueToProperty(e), i.setValue(e)
                    }
                }), t.focusout(function(t) {
                    var e = i.value();
                    i.changed() && (i.setValueToProperty(e), i.setValue(e))
                }), t.change(function(t) {
                    var e = i.value();
                    $(t.target).is(".ticker") ? (void 0 !== i._changeTimerId && clearTimeout(i._changeTimerId), i._changeTimerId = setTimeout(function() { i.setValueToProperty(e) }, 250)) : i.setValueToProperty(e), i.setValue(e)
                }))
            }, n.prototype.control = function() { return this._control }, n.prototype.changed = function() {
                return this._changed
            }, n.prototype.setValueToProperty = function(t) { this._undoModel.setProperty(this._property, t, this._undoText), this._changed = !1 }, n.prototype.property = function() { return this._property }, n.prototype.propertyChanged = function(t) { this.setValue(t.value()) }, n.prototype.destroy = function() { this._property && this._property.listeners().unsubscribe(this, this.propertyChanged) }, inherit(p, n), p.prototype.value = function() {
                var t, e = this._control.val();
                if (this._transformFunction)
                    if (Array.isArray(this._transformFunction))
                        for (t = 0; t < this._transformFunction.length; t++) e = this._transformFunction[t](e);
                    else e = this._transformFunction(e);
                return e
            }, p.prototype.setValue = function(t) {
                var e = this._control.val(),
                    i = this._formatValue(t);
                e !== i && this._control.val(i)
            }, inherit(u, p), inherit(_, n), _.prototype._forEachSubControl = function(t) {
                this._subControlIds.forEach(function(e) {
                    var i = "#" + e,
                        o = this.control().find(i);
                    t.call(this, o)
                }, this)
            }, _.prototype._parseSessions = function(t) { var e, i, o = t.split("-", 2); return 2 !== o.length && (o = ["0", "0"]), e = parseInt(o[0]), i = parseInt(o[1]), [Math.floor(e / 100), e % 100, Math.floor(i / 100), i % 100] }, _.prototype.value = function() { var t, e, i, o = []; return this._forEachSubControl(function(t) { o.push(t.val()) }), t = function(t, e) { return e.forEach(function(e) { t = e(t) }), ("0" + t).slice(-2) }, e = [l(0), r(0), a(23)], i = [l(0), r(0), a(59)], t(o[0], e) + t(o[1], i) + "-" + t(o[2], e) + t(o[3], i) }, _.prototype.setValue = function(t) {
                var e = this._parseSessions(t);
                this._forEachSubControl(function(t) {
                    var i = t.val(),
                        o = ("0" + e[0]).slice(-2);
                    e.shift(), i !== o && t.val(o)
                })
            }, inherit(f, n), f.prototype.value = function() { var t, e, i; return this._disabled ? (this._control.attr("disabled", !0), null) : (t = this._control.val(), e = this._toIntTransformer(t), e < 0 && (e = 0), i = this._mainSeries.bars().size(), i <= e && (e = i - 1), 1e3 * this._mainSeries.bars()._valueAt(this._mainSeries.bars().lastIndex() - e)[TradingView.TIME_PLOT]) }, f.prototype.setValue = function(t) { var e, i, o; return this._disabled || null == t ? void this._control.attr("disabled", !0) : t < 0 ? (this._control.val(-t), void this._property.setValue(this.value())) : null === (e = this._mainSeries.data().timeToBarIndex(t / 1e3, TradingView.SEARCH_FROM_RIGHT)) ? void(this._disabled = !0) : (i = this._mainSeries.bars().lastIndex(), o = i - e, void(this._control.val() !== "" + o && this._control.val(o))) }, inherit(m, n), m.prototype.value = function() { return this._control.val() }, m.prototype.setValue = function(t) {
                var e = this.value();
                t && e !== t && this._control.val(t)
            }, inherit(g, n), g.prototype.value = function() { var t = this._control.val(); return this._transformFunction && (t = this._transformFunction(t)), t }, g.prototype.setValue = function(t) { var e, i; if (this._control.val(t), this._control.selectbox) try { e = this._control.find("[value='" + t + "']"), e.length > 0 && (i = e[0], this._control.selectbox("change", i.value, i.text)) } catch (t) {} }, g.prototype.propertyChanged = function(t) { var e = t.value(); "function" == typeof this._propertyChangedHook && (e = this._propertyChangedHook(e)), this.setValue(e) }, inherit(v, n), v.prototype.value = function() { return this._property.value() }, v.prototype.setValue = function(t) { return this._control.html(t) }, inherit(y, n),
            y.prototype.value = function() { return this.control().is(":checked") }, y.prototype.setValue = function(t) {
                var e, i, o, n;
                return this.control().is(".visibility-checker") && (t ? (this.control().closest("tr").find(".slider-range").slider("enable"), this.control().closest("tr").find('input[type="text"]').each(function() { $(this).prop("disabled", !1) })) : (this.control().closest("tr").find(".slider-range").slider("disable"), this.control().closest("tr").find('input[type="text"]').each(function() { $(this).prop("disabled", !0) }))), this.control().is(".visibility-switch") && (e = { opacity: t ? 1 : .5 }, i = t ? "enable" : "disable", o = this.control().data("hides"), o ? o.closest("td").css(e) : (n = this.control(), n.parent().parent().data("visible", t).find("td").filter(function() { var t = $(this); return !t.find("label").length && t.find(":checkbox").attr("id") !== n.attr("id") }).each(function() {
                    var o = $(this);
                    o.children().each(function() {
                        var n = $(this);
                        n.is(".ui-slider") ? n.slider(i) : n.is("select") ? (n.selectbox(i), o.css(e)) : n.is(".custom-select") ? (n.data(i)(), o.css(e)) : n.is(".tvcolorpicker-container") ? (n.find("input").prop("disabled", !t), o.css(e)) : (n.prop("disabled", !t), o.css(e))
                    })
                }))), this.control().attr("checked", !!t)
            }, inherit(b, n), b.prototype.value = function() { return this.control().is(":disabled") }, b.prototype.setValue = function(t) { return t = !!t, this._inverted && (t = !t), this.control().parents("label").toggleClass("disabled", t), this.control().attr("disabled", t) }, inherit(w, n), w.prototype.value = function() { return this.control().hasClass("active") }, w.prototype.setValue = function(t) { return this.control().toggleClass("active", !!t) }, inherit(S, n), S.prototype.onActionCallback = function(t) { this._undoModel.setProperty(this._property, this.value(), this._undoText) }, S.prototype.value = function() { return this.control().checked }, S.prototype.setValue = function(t) { return this.control().checked = !!t }, inherit(T, n), T.prototype.applyOldTransparency = function() {
                var t, e, i;
                this.transparencyProperty() && (B.isHexColor(this.property().value()) ? (t = this.transparencyProperty().value ? this.transparencyProperty().value() : this.transparencyProperty(), e = D(this.property().value()), i = (100 - t) / 100, this.control().val(M(E(e, i)))) : this.control().val(this.property().value()), this.control().change())
            }, T.prototype.transparencyProperty = function() { return this._transparencyProperty }, T.prototype.value = function() { return this._control.val() }, T.prototype.setValue = function(t) { this._control.val(t), this._control.change(), this._control.color && this._control.color.fromString(t) }, inherit(C, n), C.prototype.value = function() { return this._control.slider("option", "value") }, C.prototype.setValue = function(t) { this._control.slider("option", "value", t) }, inherit(x, y), x.prototype.onIntervalChanged = function() {+this._intervalProperty.value() < 1440 ? this._control.attr({ disabled: !1, checked: !!this._property.value() }) : this._control.attr({ disabled: !0, checked: !1 }) }, x.prototype.value = function() { return this._control.is(":disabled") ? this._property.value() : y.prototype.value.call(this) }, x.prototype.setValue = function(t) {
                if (!this._control.is(":disabled")) return y.prototype.setValue.call(this, t)
            }, x.prototype.destroy = function() { this._intervalProperty.listeners().unsubscribe(this, this.onIntervalChanged), delete this._intervalProperty, y.prototype.destroy.call(this, arguments) }, P.prototype._attachToControl = function(t) {
                var e = this;
                this._wv.subscribe(this._setValueBinded, { callWithLast: !0 }), $(this._control).on("change", function() { e.setValueToProperty(e.value()) })
            }, P.prototype.control = function() { return this._control }, P.prototype.value = function() { var t = $(this._control).val(); return this._transformFunction && (t = this._transformFunction(t)), t }, P.prototype.setValue = function(t) { $(this._control).val(t) }, P.prototype.setValueToProperty = function(t) { O.setWatchedValue(this._wv, t, this._undoText) }, P.prototype.watchedValue = function() { return this._wv }, P.prototype.destroy = function() { this._wv.unsubscribe(this._setValueBinded) }, inherit(L, P), L.prototype._attachToControl = function(t) {
                var e = this;
                this._wv.subscribe(this.setValue.bind(this), { callWithLast: !0 }), $(this._control).on("click", function() { e.setValueToProperty(e.value()) })
            }, L.prototype.value = function() { var t = $(this._control).attr("checked"); return this._not && (t = !t), this._transformFunction && (t = this._transformFunction(t)), t }, L.prototype.setValue = function(t) { this._not && (t = !t), $(this._control).attr("checked", !!t) }, k.prototype.properties = function() { return this._properties }, k.prototype.value = function(t) { return this._control.slider("values", t) }, k.prototype.setValue = function(t, e) { this._control.slider("values", e, t.value()), this._inputsText && $(this._inputsText[e]).val(t.value()) }, k.prototype.propertyChanged = function(t) { this.setValue(t) }, k.prototype.setValueToProperty = function(t, e) {
                ($(e).hasClass("from") || "from" === e) && (this._undoModel.beginUndoMacro(this._undoText[0]), this._undoModel.setProperty(this._propFrom, t[0], this._undoText[0]), this._propFrom.setValue(t[0], 0), this._undoModel.endUndoMacro()), ($(e).hasClass("to") || "to" === e) && (this._undoModel.beginUndoMacro(this._undoText[1]), this._undoModel.setProperty(this._propTo, t[1], this._undoText[1]), this._propTo.setValue(t[1], 1), this._undoModel.endUndoMacro())
            }, k.prototype.destroy = function() { this._propFrom && this._propTo && (this._propFrom.listeners().unsubscribe(this, n.prototype.propertyChanged), this._propTo.listeners().unsubscribe(this, n.prototype.propertyChanged)) }, inherit(I, n), I.prototype.value = function() {
                var t = [];
                return this._control.each(function() {
                    var e = $(this);
                    e.is(":checked") && t.push(e.attr("value"))
                }), t.join(this._separator)
            }, I.prototype.setValue = function(t) {
                var e = t.split(this._separator).filter(Boolean);
                this._control.each(function() {
                    var t = $(this),
                        i = -1 !== e.indexOf(t.attr("value"));
                    t.attr("checked", i), t.parents("label").toggleClass("active", i)
                })
            }, e.PropertyPage = o, e.UppercaseTransformer = s, e.GreateTransformer = r, e.LessTransformer = a, e.ToIntTransformer = l, e.ToFloatTransformer = h, e.ToAsciiTransformer = c, e.ReplaceEmptyTransformer = d, e.SimpleStringBinder = p, e.FloatBinder = u, e.SessionBinder = _, e.BarTimeBinder = f, e.SymbolBinder = m, e.SimpleComboBinder = g, e.StaticContentBinder = v,
            e.BooleanBinder = y, e.DisabledBinder = b, e.ActionBinder = S, e.ColorBinding = T, e.SliderBinder = C, e.CheckboxWVBinding = L, e.RangeBinder = k
    }).call(e, i(24))
}, function(t, e) {
    "use strict";

    function i() { this._renderers = [], this._globalAlpha = 1 }
    i.prototype.setGlobalAlpha = function(t) { this._globalAlpha = t }, i.prototype.append = function(t) { this._renderers.push(t) }, i.prototype.insert = function(t, e) { this._renderers.splice(e, 0, t) }, i.prototype.draw = function(t) { for (var e = 0; e < this._renderers.length; e++) t.save(), t.globalAlpha = this._globalAlpha, this._renderers[e].draw(t), t.restore() }, i.prototype.drawBackground = function(t) {
        t.save(), t.globalAlpha = this._globalAlpha;
        for (var e = 0; e < this._renderers.length; e++) this._renderers[e].drawBackground && this._renderers[e].drawBackground(t);
        t.restore()
    }, i.prototype.hitTest = function(t) { var e, i, o = null; for (e = this._renderers.length - 1; e >= 0; e--)(i = this._renderers[e].hitTest(t)) && (null == o || i.result() > o.result()) && (o = i); return o }, t.exports = i
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) {
        this._defaultName = t;
        var n;
        i ? n = e : (n = TradingView.clone(defaults(t)), e && TradingView.merge(n, e)), s.call(this, n), this._defaultName = t, this.listeners().subscribe(this, o.prototype.onPropertyChanged), this._exclusions = []
    }

    function n(t) { o._saveDefaults = t }
    var s = i(24);
    inherit(o, s), o._saveDefaults = !1, o.prototype.addExclusion = function(t) { this._exclusions.push(t) }, o.prototype.restoreFactoryDefaults = function() {
        var t, e = {};
        this._defaultName.startsWith("study_") && (e = TradingView.clone(TradingView.factoryDefaults("study"))), this._defaultName.startsWith("linetool") && (e = TradingView.clone(TradingView.factoryDefaults("linetoolvisibilities"))), t = TradingView.clone(TradingView.factoryDefaults(this._defaultName)), this._defaultName.startsWith("study_") && t.inputs && delete t.inputs.symbol, "linetoolicon" === this._defaultName && (t.icon = defaults(this._defaultName).icon), ~["linetooltext", "linetooltextabsolute", "linetoolnote", "linetoolnoteabsolute", "linetoolcallout", "linetoolballoon", "linetoolarrowmark", "linetoolarrowmarkleft", "linetoolarrowmarkup", "linetoolarrowmarkright", "linetoolarrowmarkdown", "linetoolhorzline", "linetoolhorzray"].indexOf(this._defaultName) && delete t.text, this._exclusions.forEach(function(e) { delete t[e] }), TradingView.merge(e, t), this.merge(e), this._defaultName.startsWith("study_") || TradingView.saveDefaults(this._defaultName, this.state(this._exclusions)), this.listeners().fire(this)
    }, o.prototype.cleanupFactoryDefaults = function() {
        var t = {};
        TradingView.saveDefaults(this._defaultName, t), this.listeners().fire(this)
    }, o.prototype.onPropertyChanged = function() { o._saveDefaults && !this._defaultName.startsWith("study_") && this.saveDefaults() }, o.prototype.saveDefaults = function() { TradingView.saveDefaults(this._defaultName, this.state(this._exclusions)) }, o.prototype.clone = function(t) { return new o(this._defaultName, this.state(), t && t.replaceByState) }, e.DefaultProperty = o, e.saveDefaultProperties = n
}, function(t, e) {
    "use strict";

    function i(t, e, i) { this._result = t, this._data = e, this._eraseMarker = i }
    i.MOVEPOINT_BACKGROUND = 1, i.REGULAR = 2, i.MOVEPOINT = 3, i.CHANGEPOINT = 4, i.CUSTOM = 5,
        i.prototype.result = function() { return this._result }, i.prototype.data = function() { return this._data }, i.prototype.eraseMarker = function() { return this._eraseMarker }, t.exports = i
}, function(t, e, i) {
    "use strict";

    function o(t, e) { this._source = t, this._model = e, this._points = [], this._floatPoints = [] }
    var n = i(2),
        s = i(8),
        r = i(68).LineAnchor;
    o.prototype.priceToCoordinate = function(t) { var e, i = this._source.priceScale(); return i.isPercent() && (e = this._source.ownerSource().firstValue(), t = i.priceRange().convertToPercent(t, e)), i.priceToCoordinate(t) }, o.prototype.addAnchors = function(t) {
        if (this.isAnchorsRequired()) {
            var e = this._points;
            this._model.lineBeingCreated() === this._source && (e = e.slice(0, -1)), t.append(this.createLineAnchor({ points: e }))
        }
    }, o.prototype.update = function() {
        var t, e, i, o, n, s, r, a;
        if (this._points = [], t = this._source.priceScale(), e = this._model.timeScale(), t && !t.isEmpty() && !e.isEmpty())
            for (this._floatPoints = [], i = this._source.points(), o = 0; o < i.length; o++) {
                if (n = i[o], !(s = this._source.pointToScreenPoint(n))) return;
                r = s[0], r.data = o, a = s[1], a.data = o, this._floatPoints.push(r), this._points.push(a)
            }
    }, o.prototype.currentPoint = function() { var t = this._model.crossHairSource(); return new n.Point(t.x, t.y) }, o.prototype.anchorColor = function() { return this._source.isBeingEdited() ? "#D61AD3" : this._model.isDark() ? "#FFFFFF" : "#606060" }, o.prototype.isHoveredSource = function() { return this._source === this._model.hoveredSource() }, o.prototype.isSelectedSource = function() { return this._source === this._model.selectedSource() }, o.prototype.isAnchorsRequired = function() { return (this.isHoveredSource() || this.isSelectedSource()) && !this._model.isSnapshot() }, o.prototype.createLineAnchor = function(t) { return new r($.extend({ color: this.anchorColor(), backgroundColor: this._model.backgroundColor(), currentPoint: this.currentPoint(), linePointBeingEdited: this._model.linePointBeingEdited(), hittestResult: s.CHANGEPOINT, radius: (TradingView.isMobile.any() ? 15 : 7) + (this.isSelectedSource() ? 1 : 0), strokeWidth: (TradingView.isMobile.any() ? 3 : 1) + (this.isSelectedSource() ? 1 : 0) }, t)) }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { s.call(this, t, e), this._linetool = i, this._templateList = new l(this._linetool._constructor, this.applyTemplate.bind(this)) }
    var n = i(5),
        s = n.PropertyPage,
        r = n.ColorBinding,
        a = i(32).addColorPicker,
        l = i(295);
    inherit(o, s), o.prototype.applyTemplate = function(t) { this._linetool.restoreTemplate(t), this._model.model().updateSource(this._linetool), this.loadData() }, o.prototype.createTemplateButton = function(t) { var e = this; return t = $.extend({}, t, { getDataForSaveAs: function() { return e._linetool.template() } }), this._templateList.createButton(t) }, o.prototype.createOneColorForAllLinesWidget = function() { var t = $("<td class='colorpicker-cell'>"); return this.bindControl(new r(a(t), this._linetool.properties().collectibleColors, !0, this.model(), "Change All Lines Color", 0)), { label: $("<td>" + $.t("Use one color") + "</td>"), editor: t } }, o.prototype.addOneColorPropertyWidget = function(t) {
            var e = this.createOneColorForAllLinesWidget(),
                i = $("<tr>");
            i.append($("<td>")).append(e.label).append(e.editor), i.appendTo(t)
        },
        o.prototype.appendTemplateRow = function(t) {
            var e, i, o;
            is_authenticated && (e = $(document.createElement("tr")), e.appendTo(t), i = $(document.createElement("td")), i.attr("colspan", 2), i.appendTo(e), o = $('<div class="dialog-theme-buttons"></div>').appendTo(i), this.templateButton = $(this.createTemplateButton()), this.templateButton.appendTo(o), $('<tr><td class="property-page-separator-cell" colspan="6"><div class="property-page-separator"></div></td></tr>').appendTo(t))
        }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o() {
        var t, e, i, o;
        this._registeredSources = {}, this._sourcesToRow = {}, this._rowsToSources = {}, this._currentSymbol = "", this._actualCapacity = 0, this._actualWidth = 0, this._canvas = $("<canvas>"), this._cache = this._canvas.get(0).getContext("2d"), this._currentWidth = 400, this._canvas.prop("width", this._currentWidth).prop("height", 1).css("position", "absolute").css("top", 0).css("z-index", 1e3).css("left", 0), this._ctx = this._canvas.get(0).getContext("2d"), this._ctx.font = l.LABEL_FONTSIZE + "px" + l.LABEL_FONT, t = l.LABEL_FONTSIZE, e = l.LABEL_LINESPACING, i = t + e, o = 3, this._padding = 8, this._rowHeight = i * o - e + 2 * this._padding + 2
    }

    function n(t, e, i) { this._textSizeCache = e, this._data = t, this._fontSize = t.fontsize ? t.fontsize : t.fontSize ? t.fontSize : 12, this._lineSpacing = "number" == typeof this._data.lineSpacing && this._data.lineSpacing ? this._data.lineSpacing : 0, t.lines = this._lines = f.prototype.wordWrap.call(this, t.text, t.wordWrapWidth), this._hittest = i || new g(g.MOVEPOINT) }

    function s() {
        var t = document.createElement("canvas");
        t.width = 0, t.height = 0, h = t.getContext("2d"), t = null
    }

    function r(t, e) { this._data = t, this._hittest = e || new g(g.MOVEPOINT) }

    function a(t, e) { u.call(this, t, e), this._label = null, this._rendererCache = {}, this._invalidated = !0, this._labelDataInvalidated = !0, this._percentageFormatter = new w, this._numericFormatter = new S }

    function l(t, e) {
        this._constructor = "LineToolTrendLine";
        var i = e || new b("linetooltrendline");
        _.call(this, t, new a(this, t), i), t._trendLineStatsCache || (t._trendLineStatsCache = new o)
    }
    var h, c, d = i(2),
        p = i(365).clipSegmentToViewport,
        u = i(9),
        _ = i(1).LineDataSource,
        f = i(16).TextRenderer,
        m = i(91),
        g = i(8),
        v = i(59).PaneRendererClockIcon,
        y = i(6),
        b = i(7).DefaultProperty,
        w = i(70).PercentageFormatter,
        S = i(26).NumericFormatter,
        T = i(123).TimeSpanFormatter,
        C = i(12).getLogger("Chart.LineToolTrendLine");
    o.prototype.canvas = function() { return this._canvas }, o.prototype.topByRow = function(t) { return t * this._rowHeight }, o.prototype.rowHeight = function(t) { return this._rowHeight }, o.prototype.rowWidth = function(t) { var e = this._rowsToSources[t]; return this._sourcesToRow[e].width }, o.prototype.currentWidth = function() { return this._currentWidth }, o.prototype._findEmptyRow = function(t) { for (var e = 0; this._rowsToSources[e];) e++; return this._rowsToSources[e] = t, e >= this._actualCapacity && (this._actualCapacity++, TradingView.resizeCanvas(this._canvas, this._currentWidth, this._rowHeight * this._actualCapacity), this._ctx = this._canvas.get(0).getContext("2d"), C.logDebug("TrendLineCache. Expanging cache to " + this._actualCapacity + " items")), e }, o.prototype._effectiveState = function(t) {
        var e, i = {};
        return i.p1 = $.extend({}, t.points()[0]),
            i.p2 = $.extend({}, t.points()[1]), e = t.properties(), i.showBars = e.showBarsRange.value(), i.showTimeRange = e.showDateTimeRange.value(), i.showDistance = e.showDistance.value(), i.showPriceRange = e.showPriceRange.value(), i.showAngle = e.showAngle.value(), i.color = e.textcolor.value(), i.showAngle && (i.priceRange = t.priceScale().priceRange().state(), i.barSpacing = t._model.timeScale().barSpacing()), i
    }, o.prototype._effectiveStatesEquals = function(t, e) { var i = function(t, e) { return !(!t && !e) && (!(!t || e) || (!(t || !e) || (t.index !== e.index || t.price !== e.price))) }; if (t && !e) return !1; if (!t && e) return !1; if (i(t.p1, e.p1)) return !1; if (i(t.p2, e.p2)) return !1; if (t.color !== e.color) return !1; if (t.showBars !== e.showBars) return !1; if (t.showTimeRange !== e.showTimeRange) return !1; if (t.showDistance !== e.showDistance) return !1; if (t.showPriceRange !== e.showPriceRange) return !1; if (t.showAngle !== e.showAngle) return !1; if (t.showAngle) { if (t.priceRange.min !== e.priceRange.min) return !1; if (t.priceRange.max !== e.priceRange.max) return !1; if (t.barSpacing !== e.barSpacing) return !1 } return !0 }, o.prototype.removeSource = function(t) {
        if (this._sourcesToRow[t]) {
            var e = this._sourcesToRow[t].row;
            this._ctx.save(), this._ctx.clearRect(0, this.topByRow(e), this._currentWidth, this.rowHeight(e)), this._ctx.restore(), delete this._sourcesToRow[t], delete this._rowsToSources[e]
        }
    }, o.prototype._repaintSource = function(t, e, i) {
        var o, s;
        this._ctx.save(), this._ctx.translate(0, this.topByRow(e) + .5), i.points[0] = new d.Point(0, 0), i.offsetX = 0, i.offsetY = 0, delete i.horzAlign, delete i.vertAlign, this._ctx.clearRect(0, 0, this._currentWidth, this.rowHeight(e)), o = new n(i, {}), s = o.draw(this._ctx), this._sourcesToRow[t].width = s.width, this._ctx.restore()
    }, o.prototype.updateSource = function(t, e) { var i, o, n, s, r, a = t.properties().symbol.value(); return this._currentSymbol !== a && (C.logDebug("TrendLineCache. Clearing canvas because of changing symbol from " + this._currentSymbol + " to " + a), this._currentSymbol = a, this._sourcesToRow = {}, this._rowsToSources = {}), i = t.id(), this._sourcesToRow[i] || (o = this._findEmptyRow(i), this._sourcesToRow[i] = { effectiveState: null, row: o }), n = this._sourcesToRow[t.id()].effectiveState, s = this._effectiveState(t), this._effectiveStatesEquals(n, s) || (o = this._sourcesToRow[t.id()], r = e(), this._repaintSource(i, o.row, r), this._sourcesToRow[i].effectiveState = s), this._sourcesToRow[i] }, c = {
        priceRange: {
            width: 15,
            height: 14,
            data: [134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255]
        },
        barsRange: {
            width: 16,
            height: 15,
            data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 136, 136, 136, 56, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 136, 136, 136, 56, 134, 134, 138, 255, 134, 134, 138, 255, 136, 136, 136, 56, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 136, 136, 136, 56, 134, 134, 138, 255, 134, 134, 138, 255, 136, 136, 136, 56, 134, 134, 138, 255, 0, 0, 0, 0, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 0, 0, 0, 0, 134, 134, 138, 255, 136, 136, 136, 56, 134, 134, 138, 255, 134, 134, 138, 255, 136, 136, 136, 56, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 136, 136, 136, 56, 134, 134, 138, 255, 134, 134, 138, 255, 137, 137, 137, 74, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 137, 137, 137, 74, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        },
        angle: {
            width: 14,
            height: 12,
            data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 130, 130, 134, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 130, 130, 134, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 130, 130, 134, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 130, 130, 134, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 130, 130, 134, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 130, 130, 134, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 130, 130, 134, 76, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 130, 130, 134, 76, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 130, 130, 134, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 130, 130, 134, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255, 134, 134, 138, 255]
        }
    }, n.prototype._preRender = function() {
        var t, e, i, o, n, r, a, l, c, p, u, _, f, m, g, v, y, b, w, S, T, C, x;
        if (!this._preRendered) {
            if (h || s(), t = this._data.points[0].x + (this._data.offsetX || 0), e = t, i = this._data.points[0].y + (this._data.offsetY || 0), o = i, n = this._fontSize, r = this._lineSpacing, a = n + r, l = a * this._lines.length - r, h.textBaseline = "top", h.font = this.fontStyle(), c = [], this._data.wordWrapWidth)
                for (p = this._data.wordWrapWidth, u = 0; u < this._lines.length; u++) c.push(this._data.wordWrapWidth);
            else
                for (p = 0, u = 0; u < this._lines.length; u++) _ = h.measureText(this._lines[u]).width, c.push(_), p = Math.max(p, _);
            if (this._data.backgroundColor || this._data.borderColor || this._data.highlightBorder && this._data.wordWrapWidth) {
                f = { top: this._data.paddingTop || 0, right: this._data.paddingRight || 0, bottom: this._data.paddingBottom || 0, left: this._data.paddingLeft || 0 }, m = { x: 0, y: 0 }, this._data.backgroundHorzInflate && (g = this._data.backgroundHorzInflate / 2, f.left += g, f.right += g, m.x = -g), this._data.backgroundVertInflate && (v = this._data.backgroundVertInflate / 2, f.top += v, f.bottom += v, m.y = -v), y = "number" == typeof this._data.padding ? this._data.padding : ~~(n / 6);
                for (u in f) f[u] || (f[u] = y);
                b = { x: Math.floor(t + m.x), y: Math.floor(i + m.y), w: Math.ceil(p + f.left + f.right), h: Math.ceil(l + f.top + f.bottom) }, e += f.left + m.x, o += f.top + m.y, "bottom" !== this._data.vertAlign && "middle" !== this._data.vertAlign || (w = "middle" === this._data.vertAlign ? i - b.h / 2 : i - b.h - (b.y - i), S = w - b.y, o += S, b.y = w),
                    "right" !== this._data.horzAlign && "center" !== this._data.horzAlign || (T = "center" === this._data.horzAlign ? t - b.w / 2 : t - b.w - (b.x - t), C = T - b.x, e += C, b.x = T, !0 !== this._data.doNotAlignText && ("right" === this._data.horzAlign ? (h.textAlign = "end", e += p) : (h.textAlign = "center", e += p / 2))), b.w % 2 != 0 && b.w++, b.x += .5, b.y += .5, this._boundingRect = [new d.Point(b.x, b.y), new d.Point(b.x + b.w, b.y + b.h)], this._rect = b, this._padding = f, this._defaultPadding = y
            } else "bottom" !== this._data.vertAlign && "middle" !== this._data.vertAlign || (o -= Math.round(l * ("middle" === this._data.vertAlign ? .5 : 1))), x = e, "right" !== this._data.horzAlign && "center" !== this._data.horzAlign || (x -= Math.round(p * ("center" === this._data.horzAlign ? .5 : 1))), this._boundingRect = [new d.Point(x, o), new d.Point(x + p, o + l)];
            this._textPoint = { x: e, y: o }, this._textSizeCache && (this._textSizeCache.widths = c), this._preRendered = !0, this._maxWidth = p
        }
    }, n.prototype._drawIcon = function(t, e, i, o) {
        var n, s, r, a;
        if (c.hasOwnProperty(o)) {
            if (n = c[o], !n.src) {
                for (n.src = document.createElement("canvas"), n.src.width = n.width, n.src.height = n.height, s = n.src.getContext("2d"), r = s.createImageData(n.width, n.height), a = 0; a < n.data.length; a++) r.data[a] = n.data[a];
                s.putImageData(r, 0, 0)
            }
            t.drawImage(n.src, e, i)
        }
    }, n.prototype.fontStyle = function() { return (this._data.bold ? "bold " : "") + (this._data.italic ? "italic " : "") + this._fontSize + "px " + this._data.font }, n.prototype.draw = function(t) {
        var e, i, o, n, s, r, a, l, h, c, d;
        if (0 !== this._data.points.length) {
            for (this._preRender(), e = this._fontSize, i = this._lineSpacing, o = e + i, t.textBaseline = "top", t.font = this.fontStyle(), n = this._rect, (this._data.backgroundColor || this._data.borderColor || this._data.highlightBorder && this._data.wordWrapWidth) && this._rect ? ("right" !== this._data.horzAlign && "center" !== this._data.horzAlign || !0 !== this._data.doNotAlignText && (t.textAlign = "right" === this._data.horzAlign ? "end" : "center"), this._data.backgroundRoundRect ? (t.roundRect(n.x, n.y, n.w, n.h, this._data.backgroundRoundRect), this._data.backgroundColor && (t.fillStyle = this._data.backgroundColor, t.globalAlpha = this._data.backgroundTransparency, t.fill(), t.globalAlpha = 1), this._data.borderColor && (s = "number" == typeof this._data.borderWidth ? this._data.borderWidth : ~~Math.max(e / 12, 1), t.strokeStyle = this._data.borderColor, t.lineWidth = s, t.stroke())) : (this._data.backgroundColor && (t.fillStyle = this._data.backgroundColor, t.globalAlpha = this._data.backgroundTransparency, t.fillRect(n.x, n.y, n.w, n.h), t.globalAlpha = 1), this._data.borderColor ? (s = "number" == typeof this._data.borderWidth ? this._data.borderWidth : ~~Math.max(e / 12, 1), t.strokeStyle = this._data.borderColor, t.lineWidth = s, t.strokeRect(n.x - s / 2, n.y - s / 2, n.w + s, n.h + s)) : this._data.highlightBorder && (t.strokeStyle = this._data.color, t.lineWidth = 1, t.beginPath(), l = [3, 1], t.dashedLineTo(n.x - .5, a = n.y - .5, r = n.x + n.w + .5, a, l), t.dashedLineTo(r, a, r, a = n.y + n.h + .5, l), t.dashedLineTo(r = n.x - .5, a, n.x + n.w + .5, a, l), t.dashedLineTo(r, n.y - .5, r, a, l), t.globalAlpha = .5, t.stroke(), t.globalAlpha = 1)), this._data.icons && this._data.icons.forEach(function(e, i) {
                    var s = n.x + this._defaultPadding,
                        r = n.y + this._padding.top + o * i;
                    this._drawIcon(t, s, r, e)
                }, this)) : "right" === this._data.horzAlign ? t.textAlign = "end" : "center" === this._data.horzAlign && (t.textAlign = "center"), h = this._textPoint.x, c = this._textPoint.y, t.fillStyle = this._data.color, d = 0; d < this._lines.length; d++) t.fillText(this._lines[d], h, c), c += o;
            return { width: n.w + 2 }
        }
    }, n.prototype.hitTest = function(t) { return 0 === this._data.points.length ? null : (this._preRender(), this._boundingRect && d.pointInRect(t, this._boundingRect[0], this._boundingRect[1]) ? this._hittest : null) }, r.prototype.drawArrow = function(t, e, i, o) {
        var n, s, r, a, l, h, c, d, p;
        e.substract(t).length() < 1 || (n = e.substract(t).normalized(), s = 5 * o, r = n.scaled(s), a = e.substract(r), l = n.transponed(), h = 3 * o, c = l.scaled(h), d = a.add(c), p = a.substract(c), CanvasEx.drawLine(i, Math.round(d.x), Math.round(d.y), e.x, e.y), CanvasEx.drawLine(i, Math.round(p.x), Math.round(p.y), e.x, e.y))
    }, r.prototype.expandPoints = function(t, e, i, o) {
        var n, s, r = new d.Point(0, 0),
            a = new d.Point(i, o);
        return this._data.extendleft && (n = t.substract(e), (s = d.intersectRayWithRect(t, t.add(n), r, a)) && (t = s)), this._data.extendright && (n = e.substract(t), (s = d.intersectRayWithRect(e, e.add(n), r, a)) && (e = s)), [t, e]
    }, r.prototype.drawCircle = function(t, e, i, o) { o = $.extend({ fillStyle: "#000000" }, o), e.save(), e.fillStyle = o.fillStyle, e.beginPath(), e.arc(t.x, t.y, i, 0, 2 * Math.PI, !1), e.fill(), o.strokeWidth && (e.lineWidth = o.strokeWidth, e.stroke()), e.restore() }, r.prototype.draw = function(t) {
        var e, i, o, n, s, r;
        this._data.points && this._data.points.length < 2 || this._data.floatPoints && this._data.floatPoints.length < 2 || (t.lineCap = "butt", t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, t.lineStyle = this._data.linestyle, e = this._data.floatPoints || this._data.points, i = e[0], o = e[1], this._data.overlayLineEndings ? n = [$.extend(!0, {}, i), $.extend(!0, {}, o)] : this.drawEnds(t, [i, o]), s = this.expandPoints(i, o, this._data.width, this._data.height), r = p(s[0], s[1], this._data.width, this._data.height), r && this._data.linewidth > 0 && CanvasEx.drawLine(t, r[0].x, r[0].y, r[1].x, r[1].y), this._data.overlayLineEndings && this.drawEnds(t, n))
    }, r.prototype.drawEnds = function(t, e) {
        var i = e[0],
            o = e[1];
        switch (this._data.leftend) {
            case _.LINEEND_ARROW:
                this.drawArrow(o, i, t, t.lineWidth);
                break;
            case _.LINEEND_CIRCLE:
                this.drawCircle(i, t, t.lineWidth, this._data.endstyle)
        }
        switch (this._data.rightend) {
            case _.LINEEND_ARROW:
                this.drawArrow(i, o, t, t.lineWidth);
                break;
            case _.LINEEND_CIRCLE:
                this.drawCircle(o, t, t.lineWidth, this._data.endstyle)
        }
    }, r.prototype.hitTest = function(t) { var e, i, o, n, s, r; return this._data.points && this._data.points.length < 2 ? null : this._data.floatPoints && this._data.floatPoints.length < 2 ? null : (e = TradingView.isMobile.any() ? 24 : 3, i = this._data.floatPoints || this._data.points, o = i[0], n = i[1], s = this.expandPoints(o, n, this._data.width, this._data.height), r = d.distanceToSegment(s[0], s[1], t), r.distance <= e ? this._hittest : null) }, inherit(a, u), a.prototype.update = function() { this._invalidated = !0, this._labelDataInvalidated = !0 }, a.prototype.updateImpl = function() {
        var t, e, i, o, n, s, r, a, l, h, c = this._source.points();
        c.length < 2 || (t = c[0], e = c[1], void 0 === (i = this._model.timeScale().visibleBars()) || i.isEmpty() || (i = i.clone(), o = this._source.properties(),
            t.index < i.firstBar() && e.index < i.firstBar() && !o.extendLeft.value() && !o.extendRight.value() || (u.prototype.update.call(this), this._points.length < 2 || (n = o.showBarsRange.value(), s = o.showDateTimeRange.value(), r = o.showDistance.value(), a = o.showPriceRange.value(), l = o.showAngle.value(), a || n || s || r || l ? (h = this, this._statCache = this._model._trendLineStatsCache.updateSource(this._source, function() { return h._statLabelData() })) : (this._model._trendLineStatsCache.removeSource(this._source.id()), this._label = null, this._labelData && (this._labelData.text = "", this._labelData.lines = [])), this._invalidated = !1))))
    }, a.prototype._statLabelData = function() { var t, e, i, o, n, s, r, a, h, c, p, u, _, f, m, g, v, y, b, w, S, C, x, P, L, k, I, A; return this._labelDataInvalidated && (t = this._source.points(), e = t[0], i = t[1], o = this._source.properties(), n = [], p = o.showPriceRange.value(), p && this._source.priceScale() && (h = i.price - e.price, u = h / e.price, s = this._source.priceScale().formatter().format(h) + " (" + this._percentageFormatter.format(100 * u) + ")", _ = this._model.mainSeries().base(), _ && (f = Math.round(h * _), s += ", " + f), n.push("priceRange")), m = o.showBarsRange.value(), g = o.showDateTimeRange.value(), v = o.showDistance.value(), (m || g || v) && (r = "", m && (c = i.index - e.index, r += $.t("{0} bars").format(c)), g && (y = this._model.timeScale().indexToUserTime(e.index), b = this._model.timeScale().indexToUserTime(i.index), y && b && (w = (b.valueOf() - y.valueOf()) / 1e3, (S = (new T).format(w)) && (r += m ? " (" + S + ")" : S))), v && (r && (r += ", "), void 0 === h && (h = i.price - e.price), void 0 === c && (c = i.index - e.index), C = Math.round(1e5 * Math.sqrt(h * h + c * c)) / 1e5, r += $.t("distance: {0}").format(this._numericFormatter.format(C))), r && n.push("barsRange")), x = o.showAngle.value(), x && (P = this._source.pointToScreenPoint(e), L = this._source.pointToScreenPoint(i), P = P instanceof Array ? P[0] : P instanceof d.Point ? P : null, L = L instanceof Array ? L[0] : L instanceof d.Point ? L : null, P instanceof d.Point && L instanceof d.Point && (I = L.substract(P), I.length() > 0 && (I = I.normalized(), k = Math.acos(I.x), I.y > 0 && (k = -k))), "number" != typeof k || TradingView.isNaN(k) || (a = Math.round(180 * k / Math.PI) + "º", n.push("angle"))), this._label = [s, r, a].filter(function(t) { return t }).join("\n") || null, this._icons = n, this._labelDataInvalidated = !1), A = { points: [this._points[1]], text: this._label, color: this._source.properties().textcolor.value(), font: l.LABEL_FONT, fontsize: l.LABEL_FONTSIZE, lineSpacing: l.LABEL_LINESPACING, backgroundColor: l.LABEL_BGCOLOR, borderColor: l.LABEL_BORDERCOLOR, borderWidth: 1, padding: l.LABEL_PADDING, paddingLeft: 30, doNotAlignText: !0, icons: this._icons }, this._points[1].y < this._points[0].y && (A.vertAlign = "bottom"), this._points[1].x < this._points[0].x && (A.horzAlign = "right"), this._labelData = A, A }, a.prototype.renderer = function() {
        var t, e, i, o, n, s, a, h, c;
        return this._invalidated && this.updateImpl(), t = new y, this._invalidated ? t : this._source.priceScale() ? (e = {}, e.points = this._points, e.floatPoints = this._floatPoints, 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 = this._source.properties().leftEnd.value(), e.rightend = this._source.properties().rightEnd.value(), t.append(new r(e)), i = this.isAnchorsRequired(), o = i || this._source.properties().alwaysShowStats.value(), o && this._label && 2 === this._points.length && (n = this._points[1], s = { left: 0, top: this._model._trendLineStatsCache.topByRow(this._statCache.row), width: this._model._trendLineStatsCache.rowWidth(this._statCache.row), height: this._model._trendLineStatsCache.rowHeight(this._statCache.row) }, a = { left: n.x, top: n.y, width: s.width, height: s.height }, "right" === this._labelData.horzAlign ? a.left -= l.LABEL_PADDING + a.width : a.left += l.LABEL_PADDING, "bottom" === this._labelData.vertAlign ? a.top -= l.LABEL_PADDING + a.height : a.top += l.LABEL_PADDING, h = this._model._trendLineStatsCache.canvas(), c = new m(h.get(0), s, a), t.append(c)), this.addAnchors(t), !TradingView.printing && this._source.hasAlert.value() && !this._model.readOnly() && e.points.length >= 2 && this._source.getAlertIsActive(function(i) { t.append(new v({ point1: e.points[0], point2: e.points[1], color: i ? e.color : defaults("chartproperties.alertsProperties.drawingIcon.color") })) }), t) : t
    }, inherit(l, _), l.LABEL_OFFSET = 8, l.LABEL_FONT = "Arial", l.LABEL_FONTSIZE = 12, l.LABEL_LINESPACING = 10, l.LABEL_BGCOLOR = "rgba(255,255,255,.8)", l.LABEL_BORDERCOLOR = "#e3e3e3", l.LABEL_PADDING = 8, l.prototype.stop = function() { _.prototype.stop.call(this), this._model._trendLineStatsCache.removeSource(this.id()) }, l.prototype.pointsCount = function() { return 2 }, l.prototype.title = function() { return "Trend Line" }, l.prototype.canHasAlert = function() { return !0 }, l.prototype._getAlertPlots = function() { return [this._linePointsToAlertPlot(this._points, null, this.properties().extendLeft.value(), this.properties().extendRight.value())] }, e.TrendLineStatsRenderer = n, e.LineToolTrendLine = l, e.TrendLineRenderer = r
}, function(t, e, i) {
    "use strict";

    function o() { return void 0 === C && (C = d.getInt(g)), C }

    function n() { return void 0 === x && (x = d.getBool(v)), x }

    function s(t) { t = "number" == typeof t ? Math.max(u.ERROR, Math.min(u.DEBUG, t)) : f, C = t, d.setValue(g, 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, n) {
        var s = { id: _, message: e, subSystemId: o, timestamp: +t };
        _ += 1, i.unshift(s), void 0 !== n && i.length > n && (i.length = n)
    }

    function l(t) { var e, i = y.reduce(function(t, e) { return t.concat(e) }, []); return i.sort(function(t, e) { return t.id - e.id }), "number" == typeof t && (i = i.slice(-t)), e = i.map(function(t) { return new Date(t.timestamp).toISOString() + ":" + t.subSystemId + ":" + t.message.replace(/"/g, "'") }), r(e, m) }

    function h(t, e, i, s) {
        var r, l, h;
        if ((e !== w || s.id !== S) && (r = new Date, t <= u.NORMAL && a(r, e, i, s.id, s.maxCount), void 0 !== (h = o()) && t <= h && (!s.highRate || n()) && (!b || s.id.match(b)))) {
            switch (l = r.toISOString() + ":" + s.id + ":" + e, t) {
                case u.DEBUG:
                    console.debug(l);
                    break;
                case u.INFO:
                case u.NORMAL:
                    s.color ? console.log("%c" + l, "color: " + s.color) : console.log(l);
                    break;
                case u.WARNING:
                    console.warn(l);
                    break;
                case u.ERROR:
                    console.error(l)
            }
            w = e, S = s.id, T && clearTimeout(T), T = setTimeout(function() { w = null, S = null, T = NaN }, 1e3)
        }
    }

    function c(t, e) {
        function i(t) { return function(e) { return h(t, e, o, n) } }
        var o, n;
        return void 0 === e && (e = {}), o = [], y.push(o), n = Object.assign(e, { id: t }), { logDebug: i(u.DEBUG), logError: i(u.ERROR), logInfo: i(u.INFO), logNormal: i(u.NORMAL), logWarn: i(u.WARNING) }
    }
    var d, p, u, _, f, m, g, v, y, b, w, S, T, C, x, P;
    Object.defineProperty(e, "__esModule", { value: !0 }), d = i(69), p = "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" }(u = e.LOGLEVEL || (e.LOGLEVEL = {})), _ = 0, f = u.INFO, m = 75497472, g = "loglevel", v = "logHighRate", y = [], b = null, w = null, S = null, T = NaN, C = void 0, x = void 0, e.getLogLevel = o, e.isHighRateEnabled = n, e.setLogLevel = s, e.getLogHistory = l, e.getLogger = c, P = c("logger"), e.loggingOn = window.lon = p.loggingOn = function(t, e) { s(u.DEBUG), P.logNormal("Debug logging enabled"), x = t, d.setValue(v, t), b = e || null }, e.loggingNormal = p.loggingNormal = function() { s(u.NORMAL), P.logNormal("Logging set to normal level") }, e.loggingOff = window.loff = function() { s(f), P.logInfo("Debug logging disabled") }
}, function(t, e, i) {
    "use strict";

    function o() { return $('<div class="linewidth-slider">').slider({ max: 4, min: 1, step: 1 }) }
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17), e.createLineWidthEditor = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { var o, n, r, l, h; if (e = e || 0, !s(t)) return i ? a.rgbaToString(a.rgba(a.parseRgb(t), a.normalizeAlphaComponent(1 - e / 100))) : t; if (e < 0 && e > 100) throw Error("invalid transparency"); return o = a.parseRgb(t), n = o[0], r = o[1], l = o[2], h = a.normalizeAlphaComponent(1 - e / 100), a.rgbaToString([n, r, l, h]) }

    function n(t) { return s(t) ? t : a.rgbaToString(a.rgba(a.parseRgb(t), a.normalizeAlphaComponent(1))) }

    function s(t) { return 0 === t.indexOf("#") }

    function r(t) { var e = a.parseRgb(t).map(function(t) { return t /= 255, t <= .03928 ? t / 12.92 : Math.pow((t + .055) / 1.055, 2.4) }); return +(.2126 * e[0] + .7152 * e[1] + .0722 * e[2]).toFixed(3) }
    Object.defineProperty(e, "__esModule", { value: !0 });
    var a = i(37);
    e.generateColor = o, e.resetTransparency = n, e.isHexColor = s, e.getLuminance = r
}, 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 }
        }, 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(50)(t))
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { this._textSizeCache = e, this._data = t, this._fontSize = t.fontsize ? t.fontsize : t.fontSize ? t.fontSize : 20, t.lines = this._lines = this.wordWrap(t.text, t.wordWrapWidth), this._hittest = i || new d(d.MOVEPOINT) }

    function n(t, e, i, o, n, s) { l.call(this, t, e), this._offsetX = i, this._offsetY = o, this._vertAlign = n, this._horzAlign = s, this._rendererCache = {}, this._renderer = null, this._invalidated = !0 }

    function s(t, e) {
        this._constructor = "LineToolText";
        var i = e || new u("linetooltext");
        h.call(this, t, new n(this, t), i), this._timeScale = t.timeScale(), this._barSpacing = t.timeScale().barSpacing()
    }

    function r(t, e) {
        var i = e || new u("linetooltextabsolute");
        i.locked.value() || i.locked.setValue(!0), s.call(this, t, i)
    }
    var a = i(2),
        l = i(9),
        h = i(1).LineDataSource,
        c = i(48).DataSource,
        d = i(8),
        p = i(6),
        u = i(7).DefaultProperty;
    ! function() {
        function t() {
            var t = document.createElement("canvas");
            t.width = 0, t.height = 0, e = t.getContext("2d"), t = null
        }
        var e;
        o.prototype.setPoints = function(t, e) { this._data.points = t, this._hittest = e || new d(d.MOVEPOINT) }, o.prototype._calcLinesWidths = function() {
            var i, o, n, s;
            if (e || t(), e.textBaseline = "alphabetic", e.font = this.fontStyle(), i = [], this._data.wordWrapWidth)
                for (o = this._data.wordWrapWidth, n = 0; n < this._lines.length; n++) i.push(this._data.wordWrapWidth);
            else
                for (o = 0, n = 0; n < this._lines.length; n++) s = e.measureText(this._lines[n]).width, i.push(s), o = Math.max(o, s);
            return { widths: i, maxWidth: o }
        }, o.prototype.measure = function() {
            var t = this._fontSize,
                e = this._calcLinesWidths().maxWidth,
                i = t * this._lines.length,
                o = ~~(t / 6);
            return this._data.backgroundHorzInflate && (e += 2 * this._data.backgroundHorzInflate), this._data.backgroundVertInflate && (i += 2 * this._data.backgroundVertInflate), e = Math.ceil(e + 2 * o), i = Math.ceil(i + 2 * o), e % 2 != 0 && e++, this._data.padding && (i += this._data.padding), { width: e, height: i, textBgPadding: o }
        }, o.prototype.wordWrap = function(i, o, n) {
            var s, r, a, l, h, c, d, p, u;
            if (e || t(), o = +o, i += "", s = i.split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/), s[s.length - 1] || s.pop(), !isFinite(o) || o <= 0) return s;
            for (e.font = n || this.fontStyle(), r = [], a = 0; a < s.length; a++)
                if (l = s[a], (h = e.measureText(l).width) <= o) r.push(l);
                else
                    for (c = l.split(/([-\)\]\},.!?:;])|(\s+)/); c.length;) {
                        if ((d = ~~(o / h * (c.length + 2) / 3)) <= 0 || e.measureText(c.slice(0, 3 * d - 1).join("")).width <= o)
                            for (; e.measureText(c.slice(0, 3 * (d + 1) - 1).join("")).width <= o;) d++;
                        else
                            for (; d > 0 && e.measureText(c.slice(0, 3 * --d - 1).join("")).width > o;);
                        if (d > 0) r.push(c.slice(0, 3 * d - 1).join("")), c.splice(0, 3 * d);
                        else {
                            if (p = c[0] + (c[1] || ""), u = 1 === u ? 1 : ~~(o / e.measureText(p) * p.length), e.measureText(p.substr(0, u)).width <= o)
                                for (; e.measureText(p.substr(0, u + 1)).width <= o;) u++;
                            else
                                for (; u > 1 && e.measureText(p.substr(0, --u)).width > o;);
                            u < 1 && (u = 1), r.push(p.substr(0, u)), c[0] = p.substr(u), c[1] = ""
                        }
                        if ((h = e.measureText(c.join("")).width) <= o) { r.push(c.join("")); break }
                    }
            return r
        }
    }(), o.prototype._x = function() { return this._data.points[0].x + this._data.offsetX }, o.prototype._y = function() {
        var t, e = this._fontSize * this._lines.length;
        switch (this._data.scaleY && (e *= this._data.scaleY), t = this._data.points[0].y + this._data.offsetY + e, this._data.vertAlign) {
            case "top":
                break;
            case "bottom":
                t -= e;
                break;
            case "middle":
                t -= e / 2
        }
        return t
    }, o.prototype.fontStyle = function() { return (this._data.bold ? "bold " : "") + (this._data.italic ? "italic " : "") + this._fontSize + "px " + this._data.font }, o.prototype.draw = function(t) {
        var e, i, o, n, s, r, a, l, h, c, d, p, u, _, f, m;
        if (0 !== this._data.points.length) {
            switch (e = this._x(), i = this._y(), o = this._fontSize, this._data.scaleY && (o *= this._data.scaleY), i -= o * (this._lines.length - 1), t.textBaseline = "alphabetic", t.font = this.fontStyle(), this._data.horzAlign) {
                case "left":
                    t.textAlign = "start";
                    break;
                case "right":
                    t.textAlign = "end";
                    break;
                case "center":
                    t.textAlign = "center"
            }
            if (t.translate(e + .5, i + .5), e = 0, i = 0, o = this._fontSize, this._data.scaleX && this._data.scaleY && (n = Math.min(this._data.scaleX, this._data.scaleY), t.scale(n, n)), s = this._calcLinesWidths(), r = s.maxWidth, a = 0, this._data.backgroundColor || this._data.borderColor || this._data.highlightBorder && this._data.wordWrapWidth) {
                switch (l = e, this._data.horzAlign) {
                    case "left":
                        break;
                    case "right":
                        l -= r;
                        break;
                    case "center":
                        l -= r / 2
                }
                h = o * this._lines.length, c = ~~(o / 6), this._data.backgroundHorzInflate && (r += 2 * this._data.backgroundHorzInflate, l -= this._data.backgroundHorzInflate), this._data.backgroundVertInflate && (h += 2 * this._data.backgroundVertInflate, i += this._data.backgroundVertInflate), d = { x: Math.floor(l - c), y: Math.floor(i - o), w: Math.ceil(r + 2 * c), h: Math.ceil(h + 2 * c) }, d.w % 2 != 0 && d.w++, this._data.padding && (d.h += this._data.padding, a = this._data.padding), this._data.backgroundVertInflate && (i += this._data.backgroundVertInflate), this._data.backgroundRoundRect ? (t.roundRect(d.x, d.y, d.w, d.h, this._data.backgroundRoundRect), this._data.backgroundColor && (t.fillStyle = this._data.backgroundColor, t.fill()), this._data.borderColor && (p = ~~Math.max(o / 12, 1), t.strokeStyle = this._data.borderColor, t.lineWidth = p, t.stroke())) : (this._data.backgroundColor && (t.fillStyle = this._data.backgroundColor, t.fillRect(d.x, d.y, d.w, d.h)), this._data.borderColor ? (p = ~~Math.max(o / 12, 1), t.strokeStyle = this._data.borderColor, t.lineWidth = p, t.strokeRect(d.x - p / 2, d.y - p / 2, d.w + p, d.h + p)) : this._data.highlightBorder && (t.strokeStyle = this._data.color, t.lineWidth = 1, t.beginPath(), f = [3, 1], t.dashedLineTo(d.x - .5, _ = d.y - .5, u = d.x + d.w + .5, _, f), t.dashedLineTo(u, _, u, _ = d.y + d.h + .5, f), t.dashedLineTo(u = d.x - .5, _, d.x + d.w + .5, _, f), t.dashedLineTo(u, d.y - .5, u, _, f), t.stroke()))
            }
            for (this._data.backgroundVertInflate && !this._data.backgroundColor && (i += 2 * this._data.backgroundVertInflate), t.fillStyle = this._data.color, m = 0; m < this._lines.length; m++) t.fillText(this._lines[m], e, i), i += o + a;
            this._textSizeCache && (this._textSizeCache.widths = s.widths)
        }
    }, o.prototype.hitTest = function(t) {
        var e, i, o, n, s, r, a, l;
        if (0 === this._data.points.length) return null;
        if (e = this._fontSize, this._data.scaleY && (e *= this._data.scaleY), !(i = this._textSizeCache.widths)) return null;
        for (o = 0, n = 0; n < i.length; n++) o = Math.max(o, i[n]);
        return this._data.scaleX && (o *= this._data.scaleX), s = this._data.points[0].x + this._data.offsetX, r = this._data.points[0].y + this._data.offsetY, "bottom" === this._data.vertAlign && (r -= this._lines.length * this._fontSize), "middle" === this._data.vertAlign && (r -= this._lines.length * this._fontSize / 2),
            "right" === this._data.horzAlign ? s -= o : "center" === this._data.horzAlign && (s -= o / 2), a = this._data.backgroundColor || this._data.borderColor ? ~~(e / 6) : 0, l = this._data.borderColor ? ~~Math.max(e / 12, 1) : 0, t.x >= s - a - l && t.x <= s + o + a + l && t.y >= r - l && t.y <= r + this._lines.length * this._fontSize + 2 * a + l ? this._hittest : null
    }, inherit(n, l), n.prototype.update = function() { this._renderer = null, this._invalidated = !0 }, n.prototype.updateImpl = function() { l.prototype.update.call(this), this._invalidated = !1 }, n.prototype.renderer = function() { var t, e, i, n, s, r, l, h, c, d, u, _; return this._invalidated && this.updateImpl(), this._renderer ? this._renderer : !(t = this._source.priceScale()) || t.isEmpty() ? (this._renderer = new p, this._renderer) : (e = {}, i = this._source.properties(), n = i.locked && i.locked.value(), e.points = n ? this._source.fixedPoints() : this._points, e.text = i.text.value(), e.color = i.color.value(), e.font = i.font.value(), e.offsetX = this._offsetX ? this._offsetX : 0, e.offsetY = this._offsetY ? this._offsetY : 0, e.vertAlign = this._vertAlign ? this._vertAlign : "top", e.horzAlign = this._horzAlign ? this._horzAlign : "left", e.fontsize = i.fontsize.value(), i.fillBackground && i.fillBackground.value() && (e.backgroundColor = i.backgroundColor.value(), e.backgroundTransparency = 1 - i.backgroundTransparency.value() / 100 || 0), i.drawBorder && i.drawBorder.value() && (e.borderColor = i.borderColor.value()), i.wordWrap && i.wordWrap.value() && (e.wordWrapWidth = i.wordWrapWidth.value()), e.bold = i.bold && i.bold.value(), e.italic = i.italic && i.italic.value(), e.highlightBorder = this._model.selectedSource() === this._source, n || !i.fixedSize || i.fixedSize.value() || (e.scaleX = this._source._model.timeScale().barSpacing() / this._source._barSpacing, s = t.height() / t.priceRange().length(), this._source._isPriceDencityLog && !t.isLog() && (r = t.priceRange().minValue(), l = t.priceRange().maxValue(), r = t._toLog(r), l = t._toLog(l), h = l - r, s = t.height() / h), !this._source._isPriceDencityLog && t.isLog() && (r = t.priceRange().minValue(), l = t.priceRange().maxValue(), r = t._fromLog(r), l = t._fromLog(l), h = l - r, s = t.height() / h), e.scaleY = s / this._source._priceDencity, (!isFinite(e.scaleY) || e.scaleY <= 0) && delete e.scaleY), c = new o(e, this._rendererCache), this.isAnchorsRequired() && 1 === e.points.length && !this._noSelection ? (d = e.points[0], u = new p, u.append(c), e.wordWrapWidth && (_ = new a.Point(d.x + e.wordWrapWidth + ~~(e.fontsize / 6), d.y + (e.lines ? e.lines.length * e.fontsize / 2 + ~~(e.fontsize / 6) : 0)), _.data = 0, u.append(this.createLineAnchor({ points: [_] }))), this._renderer = u, this._renderer) : (this._renderer = c, this._renderer)) }, inherit(s, h), s.MIN_WIDTH = 100, s.prototype.setPoint = function(t, e) {
        var i, o, n = this.properties();
        if (0 === t && n.wordWrapWidth && n.wordWrapWidth.value()) {
            if (i = n.locked && n.locked.value() ? this.fixedPoints()[0].x : this._timeScale.indexToCoordinate(this.points()[0].index), o = this._timeScale.indexToCoordinate(e.index) - i - ~~(n.fontsize.value() / 6), !isFinite(o)) return;
            n.wordWrapWidth.setValue(Math.max(s.MIN_WIDTH, o))
        }
    }, s.prototype.pointsCount = function() { return 1 }, s.prototype.title = function() { return $.t("Text") }, s.prototype.setPriceScale = function(t) {
        c.prototype.setPriceScale.call(this, t),
            t && t.priceRange() && (this._priceDencity = t.height() / t.priceRange().length(), this._isPriceDencityLog = t.isLog())
    }, s.prototype.restoreSize = function() { this._barSpacing = this._model.timeScale().barSpacing(), this._priceDencity = this.priceScale().height() / this.priceScale().priceRange().length(), this.updateAllViews(), this._model.updateSource(this) }, s.prototype.restoreTemplate = function(t) { delete t.locked, delete t.text, h.prototype.restoreTemplate.call(this, t) }, inherit(r, s), r.prototype.title = function() { return $.t("Anchored Text") }, s.prototype.state = function(t) { var e = h.prototype.state.call(this, t); return t && (e.state.fixedSize = !1), e }, e.TextRenderer = o, e.TextPaneView = n, e.LineToolText = s, e.LineToolTextAbsolute = r
}, , , function(t, e, i) {
    "use strict";

    function o() { return new n.Combobox([{ html: '<div class="linestyle solidline"/>', value: s.LINESTYLE_SOLID }, { html: '<div class="linestyle dottedline"/>', value: s.LINESTYLE_DOTTED }, { html: '<div class="linestyle dashedline"/>', value: s.LINESTYLE_DASHED }]) }
    var n, s;
    Object.defineProperty(e, "__esModule", { value: !0 }), n = i(586), s = i(142), e.createLineStyleEditor = o
}, , function(t, e) {
    "use strict";

    function i(t) { this._invalidationLevel = t || i.UPDATE_CURSOR_ONLY, this._invalidatedPanes = {} }
    i.UPDATE_CURSOR_ONLY = 1, i.LIGHT_UPDATE = 2, i.FULL_UPDATE = 3, i.prototype.invalidatePane = function(t, e) { this._invalidatedPanes[t] ? this._invalidatedPanes[t] = Math.max(this._invalidatedPanes[t], e) : this._invalidatedPanes[t] = e }, i.prototype.invalidateAll = function(t) { this._invalidationLevel = Math.max(this._invalidationLevel, t) }, i.prototype.fullInvalidation = function() { return this._invalidationLevel }, i.prototype.invalidateForPane = function(t) { return this._invalidatedPanes[t] ? Math.max(this._invalidatedPanes[t], this._invalidationLevel) : this._invalidationLevel }, i.prototype.merge = function(t) { this.force = this.force || t.force, this._invalidationLevel = Math.max(this._invalidationLevel, t._invalidationLevel); for (var e in t._invalidatedPanes) this._invalidatedPanes[e] ? this._invalidatedPanes[e] = Math.max(this._invalidatedPanes[e], t._invalidatedPanes[e]) : this._invalidatedPanes[e] = t._invalidatedPanes[e] }, i.prototype.exclude = function(t) { this._invalidationLevel <= t && (this._invalidationLevel = 0); for (var e in this._invalidatedPanes) this._invalidatedPanes[e] <= t && (this._invalidatedPanes[e] = 0) }, i.prototype.start = function() { this._timeStart = window.performance.now() }, i.prototype.end = function() { this._timeEnd = window.performance.now() }, t.exports = i
}, , function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t, e, i, o) { this._map = $.extend({}, this._map, o), e && (e = this.unpackLevels(e)), s.call(this, t, e, i), this.updateCollectibleProperty() }
        var n = i(35).isSameType,
            s = i(7).DefaultProperty,
            r = i(677);
        inherit(o, s), o.prototype.state = function(t, i) { t = t || [], t.push("__collectibleLines"); var o = e.prototype.state.call(this, t); return i ? o : this.packLevels(o) }, o.prototype.clone = function() { var t = this.state(); return this.__collectibleLines && (t.__collectibleLines = this.__collectibleLines.state()), new o(this._defaultName, t) }, o.prototype.merge = function(t) {
            e.prototype.merge.call(this, this.unpackLevels(t)), this.updateCollectibleProperty()
        }, o.prototype._map = { prefixes: [""], range: [0, 0], names: ["coeff", "color", "visible", "linestyle", "linewidth"], typecheck: { pack: Object, unpack: Array } }, o.prototype._packLvlTpl = function() { return [] }, o.prototype._unpackLvlTpl = function() { return {} }, o.prototype._packLvlFill = function(t, e, i, o) { return o.push(i[e]), o }, o.prototype._unpackLvlFill = function(t, e, i, o) { return o[e] = i[t], o }, o.prototype._iterateLevels = function(t, e) {
            var i, o, s, r, a;
            for (i in this._map.prefixes)
                for (o = (this._map.prefixes[i] || "") + "level", s = this._map.range[0]; s <= this._map.range[1]; s++)
                    if (t[o + s] && n(t[o + s], e.typecheck())) {
                        r = e.tpl();
                        for (a in this._map.names) r = e.fill(a, this._map.names[a], t[o + s], r);
                        t[o + s] = r
                    }
            return t
        }, o.prototype.packLevels = function(t) { return this._iterateLevels(t, { tpl: this._packLvlTpl, fill: this._packLvlFill, typecheck: this._map.typecheck.pack }) }, o.prototype.unpackLevels = function(t) { return this._iterateLevels(t, { tpl: this._unpackLvlTpl, fill: this._unpackLvlFill, typecheck: this._map.typecheck.unpack }) }, o.prototype.saveDefaults = function() { TradingView.saveDefaults(this._defaultName, this.state(this._exclusions, !0)) }, o.prototype.updateCollectibleProperty = function() {
            var t, e;
            this.__collectibleLines && (t = this, e = [], this.__collectibleLines._childs.forEach(function(i) {
                var o, n = t.__collectibleLines[i].value(),
                    s = n.split("."),
                    r = t[s[0]];
                for (o = 1; o < s.length && r; ++o) r = r[s[o]];
                r && e.push({ property: r.color, defaultValue: r.color.value() })
            }), this.collectibleColors ? this.collectibleColors.reloadProperties(e) : this.collectibleColors = new r(e))
        }, t.exports = o
    }).call(e, i(24))
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function i(t) {
            if (this._listeners = new e, this._childs = [], void 0 !== t && null !== t)
                if (this.isPrimitiveType(t)) this._value = t;
                else
                    for (var i in t) this.addProperty(i, t[i])
        }
        i.prototype.merge = function(t) {
            var e, i;
            if (null != t)
                if (this.isPrimitiveType(t)) this._value = t;
                else if (Array.isArray(t))
                for (e = 0; e < t.length; e++) this[e] ? this[e].merge(t[e]) : this.addProperty(e, t[e]);
            else
                for (i in t) this[i] ? this[i].merge(t[i]) : this.addProperty(i, t[i])
        }, i.prototype.state = function(t) {
            var e, i, o, n, s, r = this._value;
            for (void 0 === r && (r = {}), e = 0; e < this._childs.length; e++)
                if (i = this._childs[e], !t || -1 === t.indexOf(i))
                    if (t) {
                        for (o = [], n = 0; n < t.length; n++) s = t[n], s.startsWith(i + ".") && o.push(s.substr(i.length + 1));
                        r[i] = this[i].state(o)
                    } else r[i] = this[i].state();
            return r
        }, i.prototype.clone = function(t) { return new i(this.state()) }, i.prototype.isPrimitiveType = function(t) { return !!isNumber(t) || (!!new TradingView.TypeValidator(String).check(t) || TradingView.isBoolean(t)) }, i.prototype.value = function() { return this._value }, i.prototype.listeners = function() { return this._listeners }, i.prototype.childCount = function() { return this._childs.length }, i.prototype.setValue = function(t, e) {
            (this._value !== t || e) && (this._value = t, this._listeners.fire(this))
        }, i.prototype.setValueSilently = function(t) { this._value = t }, i.prototype.addProperty = function(t, e) {
            var o = new i(e);
            this[t] = o, this._childs.push(t), o.listeners().subscribe(this, i.prototype.childChanged)
        }, i.prototype.removeProperty = function(t) {
            this[t].listeners().unsubscribe(this, i.prototype.childChanged), delete this[t],
                this._childs = this._childs.filter(function(e) { return e !== t })
        }, i.prototype.addChild = function(t, e) { this[t] = e, -1 === $.inArray(t, this._childs) && this._childs.push(t), e.listeners().subscribe(this, i.prototype.childChanged) }, i.prototype.childChanged = function(t, e) { this.listeners().fire(this) }, i.prototype.subscribe = function(t, e) { this.listeners().subscribe(t, e) }, i.prototype.unsubscribe = function(t, e) { this.listeners().unsubscribe(t, e) }, i.prototype.unsubscribeAll = function(t) { this.listeners().unsubscribeAll(t) }, t.exports = i
    }).call(e, i(15))
}, function(t, e, i) {
    (function(t, e) {
        "use strict";

        function o(t) {
            TradingView.merge(this, { palettes: {}, inputs: [], plots: [], graphics: {}, defaults: {} }), TradingView.merge(this, t);
            var e = t.fullId || t.id;
            TradingView.merge(this, o.parseIdString(e)), this.name = this.id
        }
        var n = i(44).assert,
            s = i(12).getLogger("Chart.Study.MetaInfo");
        o.VERSION_STUDY_ARG_SOURCE = 41, o.METAINFO_FORMAT_VERSION_SOS_V2 = 42, o.VERSION_PINE_PROTECT_TV_4164 = 43, o.CURRENT_METAINFO_FORMAT_VERSION = 44, o.CHILD_STUDY_ALLOWED_PLOT_TYPES = ["line"], o.CHILD_STUDY_EXCLUDE_IDS = ["CorrelationCoefficient@tv-basicstudies"], o.CHILD_STUDY_PARENT_EXCLUDE_IDS = [], o.FilledArea = {}, o.FilledArea.TYPE_PLOTS = "plot_plot", o.FilledArea.TYPE_HLINES = "hline_hline", o.versionOf = function(t) { var e = "_metainfoVersion" in t && isNumber(t._metainfoVersion) ? t._metainfoVersion : 0; return e < 0 && s.logError("Metainfo format version cannot be negative: " + e), e > o.CURRENT_METAINFO_FORMAT_VERSION && s.logWarn("Client doesn't support this version of metainfo format: " + e), e }, o.parseIdString = function(t) {
            var e, i, o, n, s = {};
            if (-1 === t.indexOf("@")) s.shortId = t, s.packageId = "tv-basicstudies", s.id = t + "@" + s.packageId, s.version = 1;
            else if (e = t.split("@"), s.shortId = e[0], i = e[1].split("-"), 3 === i.length) s.packageId = i.slice(0, 2).join("-"), s.id = s.shortId + "@" + s.packageId, s.version = i[2];
            else if (1 === i.length && "decisionbar" === i[0]) s.packageId = "les-" + i[0], s.id = s.shortId + "@" + s.packageId, s.version = 1;
            else {
                if (1 !== i.length) throw Error("unexpected study id:" + t);
                s.packageId = "tv-" + i[0], s.id = s.shortId + "@" + s.packageId, s.version = 1
            }
            return s.fullId = s.id + "-" + s.version, "tv-scripting" === s.packageId ? (o = s.shortId, 0 === o.indexOf("Script$") || 0 === o.indexOf("StrategyScript$") ? (n = o.indexOf("_"), s.productId = n >= 0 ? o.substring(0, n) : s.packageId) : s.productId = s.packageId) : s.productId = s.packageId, s
        }, o.getPackageName = function(t) { return (/^[^@]+@([^-]+-[^-]+)/.exec(t || "") || [0, "tv-basicstudies"])[1] }, o.cutFullId = function(t) { return t.replace(/(@[^-]+-[^-]+).*$/, "$1") }, o.cutDollarHash = function(t) {
            var e, i, o = t.indexOf("$"),
                n = t.indexOf("@");
            return -1 === o ? t : (e = t.substr(0, o), i = n >= 0 ? t.substr(n) : "", e + i)
        }, o.cutScriptIdPart = function(t) {
            var e = t.indexOf("$"),
                i = t.indexOf("@");
            return e < 0 && i >= 0 ? "" : t.substring(Math.max(e + 1, 0), i >= 0 ? i : t.length)
        }, o.hasUserIdSuffix = function(t) { return /^USER;[\d\w]+;\d+$/.test(t) }, o.getSourceIdByInputs = function(t, e) {
            var i, n, s;
            if (!Array.isArray(t) || !e) return null;
            for (i = 0; i < t.length; ++i)
                if (n = t[i], o.isSourceInput(n) && "string" == typeof e[n.id]) return s = e[n.id], ~s.indexOf("$") && (s = s.split("$")[0]), s;
            return null
        }, o.getSourceInputIds = function(t) {
            var e, i, n = [],
                s = t.inputs;
            for (e = 0; e < s.length; ++e) i = s[e], o.isSourceInput(i) && n.push(i.id);
            return n
        }, o.setChildStudyMetaInfoPropertiesSourceId = function(e, i, n) { var s, r, a, l; for (s = 0; s < e.inputs.length; ++s) r = e.inputs[s], o.isSourceInput(r) && n instanceof t && n.inputs && n.inputs[s] && (a = n.inputs[r.id].value(), a.indexOf("$") > 0 && (l = a.replace(/^[^\$]+/, i), n.inputs[r.id].setValue(l))) }, o.patchChildStudyMetaInfoState = function(t) {
            function e(t) {
                if ("object" == typeof t)
                    for (var i in t) "string" == typeof t[i] && /^[^\$]+\$\d+$/.test(t[i]) ? t[i] = t[i].replace(/^[^\$]+/, "{pid}") : e(t[i])
            }
            t.state && e(t.state.inputs), t.state.isChildStudy = !0
        }, o.prototype.parseValue = function(t, e) { return "bool" === t ? TradingView.parseBool(e) : e }, o.prototype.defaultInputs = function() { var t, e = []; for (t = 0; t < this.inputs.length; t++) e.push(this.inputs[t].defval); return e }, o.prototype.state = function(t) { var e, i = {}; for (e in this) this.hasOwnProperty(e) && (i[e] = this[e], !0 !== t && "id" === e && (i[e] += "-" + this.version)); return i }, o.findStudyMetaInfoByDescription = function(t, e) {
            if (t) {
                for (var i = 0; i < t.length; ++i)
                    if (t[i].description.toLowerCase() === e.toLowerCase()) return t[i];
                throw Error("unexpected study id:" + e)
            }
            throw Error("There is no studies metainfo")
        }, o._findStudyMetaInfo = function(t, e) {
            for (var i = 0; i < t.length; i += 1)
                if (t[i].id === e) return [i, t[i]];
            return []
        }, o.findStudyMetaInfo = function(t, e) { if (!t) throw new ReferenceError("There is no studies metainfo"); var i = o._findStudyMetaInfo(t, e)[1]; if (!i) throw new ReferenceError("unexpected study id:" + e); return i }, o.isParentSourceId = function(t) { return "string" == typeof t && /^[^\$]+\$\d+$/.test(t) }, o.isSourceInput = function(t) { return t.id && (("source" === t.id || "src" === t.id) && ("text" === t.type || "source" === t.type) || "source" === t.type) }, o.getChildSourceInputTitles = function(t, e, i) {
            var n, s, r, a, l = {};
            if (e.plots && e.plots.length && t.options && t.options.length)
                for (n = 0; n < t.options.length; ++n) s = t.options[n], r = s && +s.split("$")[1], (a = isFinite(r) && e.plots[r]) && ~o.CHILD_STUDY_ALLOWED_PLOT_TYPES.indexOf(a.type) && (l[s] = e.styles && e.styles[a.id] && e.styles[a.id].title || a.id, i && (l[s] = i + ": " + l[s]));
            return l
        }, o.removeStudyMetaInfo = function(t, e, i) { var n = function(i) { return void 0 !== (i = void 0 !== i ? i : o._findStudyMetaInfo(t, e)[0]) && (t.splice(i, 1), defaults.remove("study_" + e), !0) }; if (t) return n(i); throw Error("There are no studies metainfo") }, o.addOrReplaceStudyMetaInfo = function(t, e) {
            var i, n = new o(e),
                r = o._findStudyMetaInfo(t, n.id),
                a = r[0];
            if (r[1]) o.removeStudyMetaInfo(t, n.id, a);
            else {
                if (0 === e.id.indexOf("ElliottWave@tv-basicstudies-")) return null;
                o.removeStudyMetaInfo(t, n.id, a) && s.logDebug("Study with id=" + n.id + " already exists in the model!")
            }
            return t.push(n), n.defaults && (i = TradingView.clone(n.defaults), i.precision = "default", defaults.create("study_" + n.fullId, i)), n
        }, o.createDefaultsForStudy = function(t) {
            var e, i = new o(t);
            i.defaults && (e = TradingView.clone(i.defaults), applyOverridesToStudies("study_" + i.fullId, e))
        }, o.createMetaInfoStub = function(t, e) {
            var i, o, s;
            return n(TradingView.isExistent(t.scriptIdPart), "scriptIdPart is missing, study: " + JSON.stringify(t)), i = t.extra && "strategy" === t.extra.kind || !0 === t.isTVScriptStrategy,
                o = TVScript.createScriptStudyId(t.scriptIdPart, e, i), s = { isTVScriptStubToCompile: !0, id: o, scriptIdPart: t.scriptIdPart, description: t.scriptName, TVScriptSourceCode: t.scriptSource, is_hidden_study: t.extra && t.extra.is_hidden_study, extra: t.extra, version: e }, s.pine = {}, s.pine.version = TradingView.isExistent(t.version) ? t.version : -1, s.pine.access = TVScript.Access.MAP_ID_TO_NAME[t.access], s.pine.userHaveAccess = t.userHaveAccess, !0 === i && (s.isTVScriptStrategy = !0), s
        }, o.isScriptStrategy = function(t) { if (t.extra && t.extra.kind) return t.extra.kind === TVScript.Kinds.STRATEGY; if (!0 === t.isTVScriptStrategy) return !0; var e = t.TVScriptSourceCode || t.scriptSource; return !!e && TVScript.isStrategy(e) }, o.replaceWithFullStudyMetaInfoAsync = function(t, e) { var i = $.Deferred(); return e.isTVScriptStubToCompile || i.resolve(e), i.promise() }, o.getOrderedInputIds = function(t) {
            var e, i, o = [],
                n = t.inputs;
            for (e = 0; e < n.length; ++e) i = n[e], o.push(i.id);
            return o
        }, o.canBeChild = function(t) { var e, i, n; if (t && "string" == typeof t) return !0; if (!t || t.extra && null != t.extra.sourceInputsCount && 1 !== t.extra.sourceInputsCount || !0 === t.canNotBeChild || !1 === t.canBeChild || ~o.CHILD_STUDY_EXCLUDE_IDS.indexOf(t.id) || t.isTVScriptStrategy || t.TVScriptSourceCode && TVScript.isStrategy(t.TVScriptSourceCode)) return !1; if (t.isTVScriptStubToCompile) return !0; for (e = t.inputs, i = 0, n = 0; n < e.length; ++n) o.isSourceInput(e[n]) && ++i; return 1 === i }, o.canHaveChildren = function(t) {
            if (t) {
                if (t.isTVScriptStrategy || t.TVScriptSourceCode && TVScript.isStrategy(t.TVScriptSourceCode)) return !1;
                if (t.id && !~o.CHILD_STUDY_PARENT_EXCLUDE_IDS.indexOf(t.id) && Array.isArray(t.plots))
                    for (var e = 0; e < t.plots.length; ++e)
                        if (~o.CHILD_STUDY_ALLOWED_PLOT_TYPES.indexOf(t.plots[e].type)) return !0
            }
            return !1
        }, TradingView.StudyMetaInfo = o, void 0 !== e && e && e.exports && (e.exports = o)
    }).call(e, i(24), i(50)(t))
}, function(t, e, i) {
    "use strict";
    var o, n;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(27), n = function() {
        function t(t) { this._precision = t }
        return t.prototype.format = function(t) { return (void 0 !== this._precision ? t.toFixed(this._precision) : t + "").replace(".", o.formatterOptions.decimalSign) }, t.prototype.parse = function(t) {
            var e = t.replace(o.formatterOptions.decimalSign, "."),
                i = parseFloat(e);
            return this._precision && (i = +i.toFixed(this._precision)), i
        }, t
    }(), e.NumericFormatter = n
}, function(t, e, i) {
    "use strict";

    function o(t, e) { if (!n.isNumber(t)) return "n/a"; if (!n.isInteger(e)) throw new TypeError("invalid length"); if (e < 0 || e > 16) throw new TypeError("invalid length"); return 0 === e ? "" + t : ("0000000000000000" + t).slice(-e) }
    var n, s, r, a, l;
    Object.defineProperty(e, "__esModule", { value: !0 }), i(28), n = i(35), s = i(12), r = s.getLogger("Chart.PriceFormatter"), e.customFormatters = { dateFormatter: null, timeFormatter: null }, e.formatterOptions = { decimalSign: ".", decimalSignFractional: "'" }, a = { custom: $.t("Price format is invalid."), fraction: $.t("Fraction part is invalid."), secondFraction: $.t("Second fraction part is invalid.") }, e.numberToStringWithLeadingZero = o, l = function() {
        function t(t, e, i, o) {
            if (e || (e = 1), n.isInteger(t) || (t = 100), t < 0) throw new TypeError("invalid base");
            if (this._priceScale = t, this._minMove = e, this._minMove2 = o,
                i && void 0 !== o && o > 0 && 2 !== o && 4 !== o && 8 !== o) return void r.logDebug("invalid minmove2");
            this._fractional = i, this.calculateDecimal()
        }
        return t.prototype.isFractional = function() { return !!this._fractional }, t.prototype.state = function() { return { fractional: this._fractional, fractionalLength: this._fractionalLength, minMove: this._minMove, minMove2: this._minMove2, priceScale: this._priceScale } }, t.prototype.calculateDecimal = function() { if (this._fractionalLength = 0, this._priceScale > 0 && this._minMove > 0) { var t = this._priceScale; for (this._fractional && this._minMove2 && (t /= this._minMove2); t > 1;) t /= 10, this._fractionalLength++ } }, t.prototype.format = function(t, e, i, o) { void 0 === o && (o = !0); var n = ""; return t < 0 ? (n = !0 === e ? "−" : !1 === o ? "" : "-", t = -t) : t && !0 === e && (n = "+"), this._fractional ? n + this.formatAsFractional(t, i) : n + this.formatAsDecimal(t, i) }, t.prototype.formatAsDecimal = function(t, i) { var n, s, r, a, l; return i = i || 0, n = this._fractional ? Math.pow(10, this._fractionalLength || 0) : Math.pow(10, i) * this._priceScale / this._minMove, s = Math.floor(t), r = +(Math.round(t * n) - s * n).toFixed(this._fractionalLength), r >= n && (r -= n, s += 1), a = "", 1 !== n && (l = void 0 !== this._fractionalLength ? this._fractionalLength : NaN, a = e.formatterOptions.decimalSign + o(+r.toFixed(this._fractionalLength) * this._minMove, l + i), a = this._removeEndingZeros(a, i)), "" + s + a }, t.prototype.formatAsFractional = function(t, i) {
            var n, s, r, a, l, h, c, d, p, u = this._priceScale / this._minMove,
                _ = Math.floor(t),
                f = i ? Math.floor(t * u) - _ * u : Math.round(t * u) - _ * u;
            if (f === u && (f = 0, _ += 1), n = "", i && (s = (t - _ - f / u) * u, s = Math.round(s * Math.pow(10, i)), n = o(s, i), n = this._removeEndingZeros(n, i)), !this._fractionalLength) throw Error("_fractionalLength is not calculated");
            return r = "", this._minMove2 ? (a = ["0", "5"], l = ["0", "2", "5", "7"], h = ["0", "1", "2", "3", "4", "5", "6", "7"], c = f % this._minMove2, f = (f - c) / this._minMove2, d = o(f, this._fractionalLength), p = 2 === this._minMove2 ? a[c] : 8 === this._minMove2 ? h[c] : l[c], r = d + e.formatterOptions.decimalSignFractional + p) : r = o(f * this._minMove, this._fractionalLength), "" + _ + e.formatterOptions.decimalSignFractional + r + n
        }, t.prototype.parse = function(t) { return this._fractional ? this._minMove2 ? this._parseAsDoubleFractional(t) : this._parseAsSingleFractional(t) : this._parseAsDecimal(t) }, t.prototype.hasForexAdditionalPrecision = function() { return !this._fractional && 10 === this._minMove2 }, t.prototype._removeEndingZeros = function(t, e) { for (var i = 0; i < e && "0" === t[t.length - 1]; i++) t = t.substr(0, t.length - 1); return t }, t.prototype._parseAsDecimal = function(t) {
            var i, o, n = RegExp(/^(\-?)[0-9]+$/),
                s = n.exec(t);
            return s ? (i = parseFloat(t), { price: i, res: !0, suggest: this.format(i) }) : (o = RegExp("^(-?)[0-9]+\\" + e.formatterOptions.decimalSign + "[0-9]*$"), s = o.exec(t), s ? (i = parseFloat(t.replace(e.formatterOptions.decimalSign, ".")), { price: i, res: !0, suggest: this.format(i) }) : { error: a.custom, res: !1 })
        }, t.prototype._patchFractPart = function(t, e) {
            var i = { 0: 0, 5: 1 },
                o = { 0: 0, 2: 1, 5: 2, 7: 3 };
            return 2 === e ? void 0 === i[t] ? -1 : i[t] : 4 === e ? void 0 === o[t] ? -1 : o[t] : t
        }, t.prototype._parseAsSingleFractional = function(t) {
            var i, o, n, s, r, l = RegExp(/^[0-9]+$/),
                h = l.exec(t);
            return h ? (i = parseFloat(t), {
                price: i,
                res: !0,
                suggest: this.format(i)
            }) : (o = RegExp("^([0-9]+)\\" + e.formatterOptions.decimalSignFractional + "([0-9]+)$"), h = o.exec(t), h ? (n = parseInt(h[1]), s = this._priceScale, (r = this._patchFractPart(parseInt(h[2]), s)) >= s || r < 0 ? { error: a.fraction, res: !1 } : (i = n + r / s, { price: i, res: !0, suggest: this.format(i) })) : { error: a.custom, res: !1 })
        }, t.prototype._parseAsDoubleFractional = function(t) {
            var i, o, n, s, r, l, h, c, d = RegExp(/^[0-9]+$/),
                p = d.exec(t);
            return p ? (i = parseFloat(t), { price: i, res: !0, suggest: this.format(i) }) : (o = RegExp("^([0-9]+)\\" + e.formatterOptions.decimalSignFractional + "([0-9]+)\\" + e.formatterOptions.decimalSignFractional + "([0-9]+)$"), p = o.exec(t), p ? (n = parseInt(p[1]), s = void 0 !== this._minMove2 ? this._minMove2 : NaN, r = this._priceScale / s, l = this._minMove2, h = this._patchFractPart(parseInt(p[2]), r), c = this._patchFractPart(parseInt(p[3]), l), h >= r || h < 0 ? { error: a.fraction, res: !1 } : void 0 !== l && c >= l || c < 0 ? { error: a.secondFraction, res: !1 } : (i = void 0 !== l ? n + h / r + c / (r * l) : NaN, { price: i, res: !0, suggest: this.format(i) })) : { error: a.custom, res: !1 })
        }, t
    }(), e.PriceFormatter = l
}, 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(757), s = i(376), r = i(267), a = i(542), l = { translate: s.translationFunction }, window.__tradingviewI18nextInited || (h = window.language || null, c = o(h), h && c || (console.error("No translation data"), h = "en", c = o("en")), h && c ? (d = { interpolation: { prefix: "__", suffix: "__" }, 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) {
    (function(e, o, n, s) {
        "use strict";

        function r(t, e, i, o) { this._study = t, this.m_series = e, this.m_model = i, this._plotName = o, this._visible = !1, this._points = [new it.Point(0, 0)], this._invalidated = !0 }

        function a() { return { visible: !0, color: "#0496FF", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 2, plottype: ht.PlotType.Line, histogramBase: 0, transparency: 50, trackPrice: !1, joinPoints: !1 } }

        function l(t, e, i, o) { var n, s; return o.isTVScriptStrategy ? n = "StudyStrategy" : (s = "study_" + (o.classId || o.shortId), n = s in TradingView ? s : "Study"), new TradingView[n](t, e, i, o) }

        function h(t, e, i, o, n) { return c(t, e, i, o, "study_" + t.id, n) }

        function c(t, e, i, o, n, s) { var r, a, l, h, c, d = u(t, e, i, o); for (s instanceof S && (r = lt.getSourceInputIds(t), r.length > 0 && (a = r[0], d.inputs[a] = "{pid}$0")), l = new ot(n, d, !0), l.addExclusion("visible"), l.addExclusion("precision"), l.addExclusion("minTick"), h = 0; h < t.inputs.length; ++h) c = t.inputs[h], c.isHidden && (l.addExclusion("inputs." + h), l.addExclusion("inputs." + c.id)); return l }

        function d(t, e, i, o, n, s) { return p(t, e, i, o, n, "study_" + t.id, s) }

        function p(t, e, i, o, n, s, r) {
            var a, l, h, c = _(t, e, i, o, n),
                d = new ot(s, c, !0);
            for (d.addExclusion("visible"), d.addExclusion("precision"), d.addExclusion("minTick"), a = e || t, l = 0; l < a.inputs.length; ++l) h = a.inputs[l], h.isHidden && (d.addExclusion("inputs." + l), d.addExclusion("inputs." + h.id));
            return d
        }

        function u(t, o, n, s) {
            var r, a, l, h, c, d, p = i(80);
            if (lt.versionOf(t) < 1) throw Error("This function cannot work with metainfo of the old format version. Required format version >= 1");
            return r = TradingView.clone(defaults("study")), g(r, t), a = TradingView.clone(defaults("study_" + t.id, s)), t.isTVScript && t.TVScriptSourceCode !== a.TVScriptSourceCode && (a = TradingView.clone(TradingView.factoryDefaults("study_" + t.id, s))), TradingView.merge(r, a), o && (ct(!(o instanceof e), "propsState should not be an instance of Property"), TradingView.merge(r, o)), l = v(t), h = {}, p.mergeInputs(h, l.defaults.inputs), p.mergeInputsObjPart(h, r.inputs), p.mergeInputsArrPart(h, l.inputs), r.inputs = h, delete l.inputs, delete l.defaults.inputs, c = {}, TradingView.merge(c, l.defaults), TradingView.merge(c, TradingView.factoryDefaults("study_" + l.id)), TradingView.merge(c, r), TradingView.merge(c, l), delete c.defaults, r = c, d = y(n, t), TradingView.merge(r, b(r, d)), o && TradingView.merge(r.styles, o.styles), r
        }

        function _(t, e, o, n, s) {
            var r, a, l, h, c, d, p = i(80),
                u = lt.versionOf(t);
            return t.version && o.version && t.version !== o.version && dt.logWarn("Serialized metaInfo version " + t.version + " is not equal to the saved state version " + o.version), r = TradingView.clone(defaults("study")), 0 === u ? (TradingView.merge(r, TradingView.clone(t)), a = v(t), TradingView.merge(r.inputs, a.inputs)) : u >= 1 && TradingView.merge(r, TradingView.clone(t.defaults)), TradingView.merge(r, TradingView.factoryDefaults("study_" + t.id)), g(r, t), TradingView.merge(r, o), u >= 1 && (TradingView.merge(r, TradingView.clone(t)), delete r.defaults), r = s.updateStudyState(r, t, e), l = e || t, l && lt.versionOf(l) >= 1 && (l = v(l), h = {}, p.mergeInputs(h, l.defaults.inputs), p.mergeInputs(h, r.inputs), p.mergeInputsArrPart(h, l.inputs), r.inputs = h, delete l.inputs, delete l.defaults.inputs, c = {}, TradingView.merge(c, l.defaults), TradingView.merge(c, TradingView.factoryDefaults("study_" + l.id)), TradingView.merge(c, r), TradingView.merge(c, l), delete c.defaults, r = c), d = y(n, l), TradingView.merge(r, b(r, d)), r
        }

        function f(t) { var e = JSON.stringify(t); return e = e.replace(/'/g, "\\'") }

        function m(t, e) {
            var i, o, n, s, r, a = {};
            if (e.isTVScript) i = e.defaults.inputs.text, a.text = TVScript.patchILTemplate(i, e, t);
            else
                for (o = Object.keys(t), n = o.length - 1; n >= 0; n--) s = o[n], (r = t[s] ? t[s].id : null) && t[r] && (a[r] = t[r]);
            return f(a)
        }

        function g(t, e) {
            var i, o, n, s;
            if (e.plots)
                for (i = 0; i < e.plots.length; i++) o = e.plots[i].id, (n = e.plots[i].type) !== ht.PlotTypes.COLORER && (s = a(), n === ht.PlotTypes.COLORER && (s.transparency = 0), s.plottype = n, s.title = o, t.styles && o in t.styles && TradingView.merge(s, t.styles[o]), t.styles[o] = s)
        }

        function v(t) {
            var e, i, o = TradingView.clone(t);
            if (o.inputs = {}, t.inputs)
                for (e = 0; e < t.inputs.length; e++) i = t.inputs[e].id, o.inputs[i] = t.inputs[e].defval, o.inputs[e] = t.inputs[e];
            return o
        }

        function y(t, e) {
            var i, o, n, s, r = 0;
            if (t)
                for (i = 0; i < t.dataSources().length; i++) o = t.dataSources()[i], o.metaInfo && o.metaInfo() && (n = o.metaInfo().id === e.id, s = (o.metaInfo().pine && o.metaInfo().pine.version) === (e.pine && e.pine.version), n && s && r++);
            return r
        }

        function b(t, e) { var i, o; if (!e) return t; for (i in t.styles)(o = t.styles[i].color) && (t.styles[i].color = w(o, e)); return t }

        function w(t, e) {
            var i = Q(J(t)),
                o = i[0] + .05 * e;
            return i[0] = o - Math.floor(o), et(tt(i))
        }

        function S(t, e, s, r) {
            var a, l, h, c, d, p, u, _, f = i(153);
            this._titleCache = {}, this._resolvedSymbols = {}, this._priceAxisViewsBase = [], this._paneViews = [], this._hlinesPriceAsisViews = [], this._horizlinesPriceAsisViews = [], W.call(this, t), this.m_data = new at, this._graphics = new Y(r), this._plotOffsets = {}, this._plotOffsetsMetaInfoOverride = {}, this._model = t, this._chartApi = t._chartApi, this._series = s instanceof TradingView.Series ? s : this._model.mainSeries(), s instanceof S && (this._source = s, this._isChildStudy = !0, this._source.setChild(this)), this._numericFormatter = new rt, this._metaInfo = r, this._properties = e, this._properties.listeners().subscribe(this, this.changeStyles), this._properties.visible.listeners().subscribe(this, this.visibleChanged), this._properties.visible.listeners().subscribe(this, this.processHibernate);
            for (a in this._metaInfo.graphics)
                for (l in this._metaInfo.graphics[a]) h = this._properties.graphics[a][l], h.visible && h.visible.listeners().subscribe(this, this.processHibernate);
            if (this._showStudyArgumentsProperty = this.model().properties().paneProperties.legendProperties.showStudyArguments, this._turnaroundCounter = 1, this._turnaround = "st" + this._turnaroundCounter, this._status = "", this._plotFields = [], c = this.metaInfo().plots)
                for (d = 0, p = c.length; d < p; d++) l = c[d].id, this._plotFields.push(l);
            this.clearData(), this._studyModified = !1, this._tagsChanged = new o, this.createViews(), u = this, this._handler = function(t) { u.onData(t) }, this._handler.isTVScriptStrategy = this._metaInfo.isTVScriptStrategy, this._createFormatter(), u = this, this._properties.precision.listeners().subscribe(null, function() { u._createFormatter(), u._model.invalidate(new G(G.FULL_UPDATE)) }), this._showStudyArgumentsProperty.listeners().subscribe(this, this.invalidateTitleCache), this._properties.description.listeners().subscribe(this, this.invalidateTitleCache), this._properties.shortDescription && this._properties.shortDescription.listeners().subscribe(this, this.invalidateTitleCache), n.enabled("update_study_formatter_on_symbol_resolve") && t.mainSeries().onSymbolResolved().subscribe(this, S.prototype._createFormatter), u = this, _ = {}, this._simplePlotsCount = r.plots.filter(function(t, e) { if (u.isLinePlot(e)) return !0; if (u.isOHLCSeriesPlot(e)) { var i = u.metaInfo().plots[e].target; return !_[i] && (_[i] = i, !0) } return !1 }).length, this._properties.showInDataWindow.listeners().subscribe(t, f.prototype.fullUpdate), this.hasBarColorer() && this._properties.visible.listeners().subscribe(t.mainSeries(), TradingView.Series.prototype.invalidateBarStylesCache), this.onStart = new o, this._childStudyByRebind = new o
        }
        var T = i(196).StudyBarColorer,
            C = i(89).HorzLineRenderer,
            x = i(674),
            P = x.BandPaneView,
            L = x.BandBackgroundPaneView,
            k = x.HlineFillPaneView,
            I = i(352),
            A = i(79),
            E = A.StudyPaneView,
            M = A.StudyBackgroundPaneView,
            D = A.StudyPlotShapesPaneView,
            O = A.StudyPlotCharsPaneView,
            V = A.StudyPlotArrowsPaneView,
            B = A.StudyPlotBarsPaneView,
            R = A.StudyPlotCandlesPaneView,
            N = i(673),
            F = N.PlotFillPaneView,
            z = N.AreaBackgroundPaneView,
            W = i(48).PriceDataSource,
            H = i(158),
            U = i(154).StudyDataWindowView,
            j = i(156),
            q = i(8),
            Y = i(155),
            G = i(21),
            K = i(35).parseJSONorNot,
            X = i(278).ChartApiInterface,
            Z = i(37),
            J = Z.parseRgb,
            Q = Z.rgbToHsl,
            tt = Z.hslToRgb,
            et = Z.rgbToHexString,
            it = i(2),
            ot = i(7).DefaultProperty,
            nt = i(27).PriceFormatter,
            st = i(220).VolumeFormatter,
            rt = i(26).NumericFormatter,
            at = i(86),
            lt = i(25),
            ht = i(81),
            ct = i(44).assert,
            dt = i(12).getLogger("Chart.Study");
        r.prototype.update = function() { this._invalidated = !0 }, r.prototype.updateImpl = function() {
                this._visible = !1;
                var t = this._study.lastValueData(this._plotName, !0);
                t.noData || (this._visible = !0, this._points = [new it.Point(0, t.coordinate)], this._color = t.color)
            }, r.prototype.renderer = function() { this._invalidated && (this.updateImpl(), this._invalidated = !1); var t = {}; return t.points = this._points, t.color = this._color, t.linewidth = this._study.properties().styles[this._plotName].linewidth.value(), t.linestyle = CanvasEx.LINESTYLE_DOTTED, t.hitTestResult = q.REGULAR, t.visible = this._visible, new C(t) }, inherit(S, W), TradingView.Study = S, i(701), S.prototype.lastValueData = function(t, e, i) {
                var o, n, s, r, a, l, h, c, d, p, u, _, f, m, g, v, y, b, w, S = { noData: !0 };
                if (this._model.timeScale().isEmpty() || null == this.priceScale() || this.priceScale().isEmpty() || this.data().isEmpty()) return S;
                if (o = this._model.timeScale().visibleBars(), o.isEmpty()) return S;
                if (!this.properties().visible.value()) return S;
                if (n = this.properties().styles, s = this.properties().ohlcPlots, n && n[t] && (r = n[t]), s && s[t] && (r = s[t]), !r || !r.visible.value()) return S;
                if (a = this.offset(t), null == (l = this.nearestIndex(o.lastBar() - a, TradingView.SEARCH_NEAREST_LEFT)) || void 0 === l) return S;
                for (c = this.metaInfo().plots, h = 0; h < c.length && !(c[h].id === t || this.isOHLCClosePlot(h) && c[h].target === t); h++);
                if (!(d = e ? this.data().last().value : this.data().valueAt(l)) || !isNumber(d[h + 1])) return S;
                for (p = { noData: !1 }, u = null, _ = null, m = 0; m < c.length; m++) c[m].target === t && (this.isSelfColorerPlot(m) || this.isOHLCColorerPlot(m)) && (u = m, _ = this.metaInfo().palettes[c[m].palette], f = this.properties().palettes[c[m].palette]);
                if (g = d[h + 1], i && (p.price = g), this.priceScale().properties().percentage.value()) {
                    if (!(v = this.firstValue(!0))) return S;
                    g = this.priceScale().priceRange().convertToPercent(g, v)
                }
                return p.text = this.priceScale().formatter().format(g), y = r.color.value(), u && d.length > u + 1 ? (b = d[u + 1], void 0 !== b && null !== b ? (w = _.valToIndex ? _.valToIndex[b] : b, p.color = f.colors[w].color.value()) : p.color = y) : p.color = y, p.floatCoordinate = this.priceScale().priceToCoordinate(g, !0), p.coordinate = Math.round(p.floatCoordinate), p.item = d, p
            }, S.prototype.series = function() { return this._series }, S.prototype.model = function() { return this._model }, S.prototype.clearData = function() {
                this.m_data = new at(this._plotFields),
                    this._graphics = new Y(this._metaInfo), this._plotOffsets = {}
            }, S.prototype.onTagsChanged = function() { return this._tagsChanged }, S.prototype.properties = function() { return this._properties }, S.prototype.state = function(t) {
                var e, i, o, n, s = TradingView.className(this.constructor),
                    r = { type: s, id: this.id(), state: this.properties().state(), zorder: this.zorder() };
                for (this.metaInfo() instanceof lt ? r.metaInfo = TradingView.clone(this.metaInfo().state()) : (r.metaInfo = TradingView.clone(this.metaInfo()), r.metaInfo.id = lt.parseIdString(r.metaInfo.id + (r.metaInfo.version ? "-" + r.metaInfo.version : "")).fullId), t && (r.data = this.m_data.state(), r.data.symbols = this._resolvedSymbols, r.data.graphics = this._graphics.graphics(), r.data.plotOffsets = this._plotOffsets), this.ownerSource() && (r.ownerSource = this.ownerSource().id()), e = 0; e < this._metaInfo.inputs.length; e++) "bar_time" === this._metaInfo.inputs[e].type && (i = this._metaInfo.inputs[e].id, (o = r.state.inputs[i]) < 0 && (n = this._rightOffsetToUnixTime(-o), r.state.inputs[i] = n && n >= 0 ? n : 0));
                return this._isChildStudy && lt.patchChildStudyMetaInfoState(r), r
            }, S.prototype.dependenciesForAlerts = function(t) {
                var e = this;
                return this.getAllOwnerSources().filter(function(t) { return t instanceof TradingView.Study }).map(function(i) {
                    var o, n, s = i.inputs({ onlyAtomValues: t }),
                        r = TradingView.StudyMetaInfo.cutDollarHash(i._metaInfo.fullId);
                    return "tv-scripting" === i._metaInfo.productId && (o = TradingView.StudyMetaInfo.findStudyMetaInfo(e._model._studiesMetaData, "Script@tv-scripting").fullId, r = o), t || (r += "!"), n = { id: i._studyId, study: r, inputs: s }, t && null != i._metaInfo.pine && (n.scriptIdPart = i._metaInfo.scriptIdPart, n.scriptVersion = i._metaInfo.pine.version), n
                })
            }, S.prototype.stateForAlert = function() {
                var t, e, i, o = this,
                    n = this._metaInfo,
                    s = this.inputs({ onlyAtomValues: !0 });
                return s.text && (t = s.text, s.text = TVScript.patchILTemplate(t, this._metaInfo, s)), e = [ht.PlotTypes.LINE, ht.PlotTypes.SHAPES, ht.PlotTypes.CHARS, ht.PlotTypes.ARROWS, ht.PlotTypes.OHLC_OPEN, ht.PlotTypes.OHLC_HIGH, ht.PlotTypes.OHLC_LOW, ht.PlotTypes.OHLC_CLOSE], i = n.plots.map(function(t, e) { return t.pinePlotIndex = e, t }).filter(function(t) { return -1 !== e.indexOf(t.type) }).map(function(t) { var e = { id: t.id, type: t.type, pinePlotIndex: t.pinePlotIndex, offset: o.offset(t.id) }; return n.styles && void 0 !== n.styles[t.id] && (e.title = n.styles[t.id].title || ""), t.target && n.ohlcPlots && n.ohlcPlots[t.target] && (e.ohlcTitle = n.ohlcPlots[t.target].title), e }), { id: this.id(), uniqueId: this.uniqueId(), type: TradingView.className(this.constructor), title: TradingView.clean(this.title(), !0), shortTitle: TradingView.clean(this.title(!0), !0), shortDescription: TradingView.clean(n.shortDescription || "Study", !0), fullId: n.fullId, isTVScript: n.isTVScript, scriptIdPart: n.scriptIdPart, scriptVersion: n.pine ? n.pine.version : "-1", plots: i, inputs: s, alerts: n.alerts, callStudyDependencies: f(this.dependenciesForAlerts(!0)) }
            }, S.prototype.uniqueId = function() { var t = this.inputsForAlert(); return t = JSON.stringify(t).replace(/\W/g, ""), this.id() + "|" + t }, S.prototype.isSavedInStudyTemplates = function() {
                for (var t = 0; t < this._metaInfo.inputs.length; t++)
                    if ("bar_time" === this._metaInfo.inputs[t].type) return !1;
                return !0
            }, S.prototype.restoreData = function(t) { this.m_data.restoreState(t), this._resolvedSymbols = t.symbols, this._graphics.setGraphics(t.graphics), this._postProcessGraphics(), this._plotOffsets = t.plotOffsets }, S.prototype.restart = function() { this._restarting = !0, this.clearData(), n.enabled("stop_study_on_restart") && this.stop(), setTimeout(this.start.bind(this), 0) }, S.prototype.stop = function(t) {
                if (!0 === t && this._children)
                    for (var e = 0; e < this._children.length; ++e) this._children[e].stop(!0);
                this._chartApi && this._chartApi.connected() && this._studyId && this._chartApi.removeStudy(this._studyId, this._handler, this._isChildStudy), n.enabled("update_study_formatter_on_symbol_resolve") && this._model.mainSeries().onSymbolResolved().unsubscribe(this, S.prototype._createFormatter), this._studyId = null, this.clearData(), this._unsubscribeExtendedHours(), this.recalculate()
            }, S.prototype._resolveSymbol = function(t) {
                var e = function e(i, o) {
                        this._chartApi.resolveSymbol(this._makeNextSymbolId(), i, function(i) {
                            switch (i.method) {
                                case "symbol_resolved":
                                    this._resolvedSymbols[t] = i.params[1], this.invalidateTitleCache(!0), o.resolve(t);
                                    break;
                                case "symbol_error":
                                    if ("permission denied" === i.params[1] && i.params[2]) switch (i.params[2]) {
                                        case TradingView.Series.PD_REASON_EXTENDED_HOURS:
                                            break;
                                        case TradingView.Series.PD_REASON_SYMBOL:
                                            if (i.params[3]) return void e(i.params[3], o);
                                            break;
                                        default:
                                            return void e(i.params[2], o)
                                    }
                                    o.reject(t)
                            }
                        }.bind(this))
                    }.bind(this),
                    i = $.Deferred();
                return e(t, i), i.promise()
            }, S.prototype._allSymbolsAreResolved = function() {
                var t, e, i, o, n = $.Deferred(),
                    s = [];
                for (t = 0; t < this._metaInfo.inputs.length; t++) "symbol" === this._metaInfo.inputs[t].type && (e = this._metaInfo.inputs[t].id, i = this._properties.inputs[e].value(), this._resolvedSymbols[i] || (o = this._resolveSymbol(i), s.push(o)));
                return s.length > 0 ? $.when.apply($, s).done(function() { 0 !== this._studyId && this.stop(!0), this.start(!0), n.resolve("All symbols are resolved now") }.bind(this)).fail(function(t) { this._status = $.t("Invalid Symbol"), this.stop(!0), this._model.updateSource(this), n.reject("Invalid symbol, " + t) }.bind(this)) : n.resolve("There are no symbols to resolve"), n.promise()
            }, S.prototype._allInputsAreValid = function() {
                var t, e, i;
                for (t = 0; t < this._metaInfo.inputs.length; t++)
                    if ("bar_time" === this._metaInfo.inputs[t].type && (e = this._metaInfo.inputs[t].id, void 0 === (i = this._properties.inputs[e].value()) || null == i)) return !1;
                return !0
            }, S.prototype.sourceId = function() { return this._studyId }, S.prototype.source = function() { return this._source || this._series }, S.prototype.ownerSource = function() { return this._isChildStudy ? this._source : W.prototype.ownerSource.call(this) }, S.prototype.getAllOwnerSources = function() { for (var t = [], e = this.ownerSource(); null != e;) t.push(e), e = e.ownerSource(); return t }, S.prototype.isChildStudy = function() { return !!this._isChildStudy }, S.prototype.setChild = function(t) { t instanceof S && t.source() === this && (this._children || (this._children = []), -1 === this._children.indexOf(t) && this._children.push(t)) }, S.prototype.unsetChild = function(t) {
                if (t instanceof S && t.source() === this && this._children) { var e = this._children.indexOf(t);~e && this._children.splice(e, 1) }
            }, S.prototype.hasChildren = function() { return !(!this._children || !this._children.length) }, S.prototype.getAllChildren = function() {
                var t, e, i, o;
                if (!Array.isArray(this._children)) return [];
                for (t = this._children.slice(), e = 0; e < t.length; ++e)
                    for (i = t[e].getAllChildren(), o = 0; o < i.length; ++o) ~t.indexOf(i[o]) || t.push(i[o]);
                return t
            }, S.prototype._debugId = function() { var t = []; return this._studyId && t.push(this._studyId), t.push(this._metaInfo.fullId), t.push(this._metaInfo.description), JSON.stringify({ study: t }) }, S.prototype.isStarted = function() { return !!this._studyId }, S.prototype.isRestarting = function() { return !!this._restarting }, S.prototype.isVisible = function() {
                var t, e, i, o;
                if (!this.properties().visible.value()) return !1;
                if (this._metaInfo.plots.length > 0)
                    for (t = 0; t < this._metaInfo.plots.length; t++)
                        if (!(e = this.properties().plots[t].visible) || e.value()) return !0;
                for (i in this._metaInfo.graphics)
                    for (o in this._metaInfo.graphics[i])
                        if (e = this.properties().graphics[i][o], !e.visible || e.visible.value()) return !0;
                return !!this._metaInfo.isTVScriptStrategy
            }, S.prototype.start = function(t, e) {
                var i, o = this._model.mainSeries();
                if (!o.isStarted()) return void o.onCompleted().subscribe(this, function() { this.start(t, e) }, !0);
                this._isChildStudy && this._source.isHibernated() && this._source.start(), i = !this._isChildStudy && !this.hasChildren() && !this.isVisible(), !this._chartApi || !this._chartApi.connected() || i && !0 !== e || this._allSymbolsAreResolved().done(function(i) { this._startAfterSymbolsResolved(t, e) }.bind(this)).fail(function(t) { dt.logError("ERROR: " + this._debugId() + " start failed, " + t), delete this._restarting }.bind(this))
            }, S.prototype._startAfterSymbolsResolved = function(t, e) {
                var i, o;
                if (!this.isStarted() || this._restarting) {
                    if (this._isChildStudy) {
                        if (!this._source.isStarted() || this._source.isRestarting()) return void this._source.onStart.subscribe(this, this._startAfterSymbolsResolved, !0);
                        lt.setChildStudyMetaInfoPropertiesSourceId(this._metaInfo, this._source.sourceId(), this._properties)
                    }
                    if (this._studyId = S.makeNextStudyId(), delete this._restarting, this._allInputsAreValid() && (this._inputs = this.inputs(), i = this._metaInfo.id + "-" + (this._metaInfo.version || "1"), i = lt.cutDollarHash(i), (i.startsWith("Script@tv-scripting") || i.startsWith("StrategyScript@tv-scripting") || i.startsWith("ESD@tv-scripting")) && (i += "!"), this._chartApi.createStudy(this._studyId, this._turnaround, this._isChildStudy ? this._source.sourceId() : this._series._seriesId, i, this._inputs, this._handler, this._isChildStudy), this._studyName = i, this._subscribeExtendedHours(), this.onStart.fire(this._studyId), !0 === t && this._children))
                        for (o = 0; o < this._children.length; ++o) this._children[o].start(!0, e)
                }
            }, S._nextSymbolId = 0, S.prototype._makeNextSymbolId = function() { return "ss_" + ++S._nextSymbolId }, S._nextStudyId = 0, S.makeNextStudyId = function() { return "st" + ++S._nextStudyId }, S.prototype._rightOffsetToUnixTime = function(t) {
                return this._series.bars().size() >= t && this._series.bars()._valueAt(this._series.bars().lastIndex() - t)[TradingView.TIME_PLOT], null
            }, S.prototype.getSymbolString = function(t) { return this._series && this._series.extendedHours.value() ? "=" + JSON.stringify({ symbol: t, session: "extended" }) : t }, S.prototype.inputsForGUI = function() { return this.inputs({ symbolsForDisplay: !0, skipHiddenInputs: !0, skipFakeInputs: !1, fakeInputsForDisplay: !0, asObject: !1 }) }, S.prototype.inputsForAlert = function() {
                var t = this.offset(),
                    e = this.inputs({ symbolsForDisplay: !0, symbolsForChartApi: !0, skipHiddenInputs: !1, skipFakeInputs: !1, asObject: !1 });
                return t && e.push(t), e
            }, S.prototype.inputs = function(t) { var e = { symbolsForDisplay: !1, symbolsForChartApi: !0, skipHiddenInputs: !1, skipFakeInputs: !1, asObject: !0 }; return TradingView.merge(e, t), this._buildInputs(e) }, S.prototype._buildInputs = function(t) {
                var e, i;
                ct(!!t, "options not set"), e = {};
                try { e = this._prepareInputs(t) } catch (t) { dt.logWarn("Failed to prepare study inputs: " + t) }
                return t.asObject ? (i = {}, Object.keys(e).forEach(function(t) { null != e[t] && (i[t] = e[t]) }), i) : (i = [], Object.keys(e).forEach(function(t) { null != e[t] && i.push(e[t]) }), i)
            }, S.prototype._prepareInputs = function(t) { var e, i, o, s; for (ct(!!t, "options not set"), e = {}, i = 0; i < this._metaInfo.inputs.length; i++) o = this._metaInfo.inputs[i], o.isFake && t.skipFakeInputs || o.isHidden && t.skipHiddenInputs || "bool" === o.type && t.skipHiddenInputs && n.enabled("dont_show_boolean_study_arguments") || (s = this._prepareInput(o, t), e[o.id] = TradingView.clone(s)); return e }, S.prototype._prepareInput = function(t, e) { var i = this._prepareInputValue(t, e); return !t.isFake || e.fakeInputsForDisplay ? i : e.onlyAtomValues ? i : { v: i, f: !0, t: t.type } }, S.prototype._prepareInputValue = function(t, e) { var i, o, n, s, r = t.id; return "symbol" === t.type ? (i = this._properties.inputs[r].value(), e && e.symbolsForDisplay ? this._resolvedSymbols && this._resolvedSymbols[i] && (i = this._resolvedSymbols[i].name + ", " + this._resolvedSymbols[i].exchange) : (this._resolvedSymbols && this._resolvedSymbols[i] && (o = this._resolvedSymbols[i], i = o.ticker || o.full_name), e && e.symbolsForChartApi && (i = this.getSymbolString(i))), i) : "bar_time" === t.type ? (n = this._properties.inputs[r].value(), n < 0 && (s = this._rightOffsetToUnixTime(-n), n = s && s >= 0 ? s : n), n) : this._metaInfo.isTVScript || this._metaInfo.pine ? "text" === r ? this._metaInfo.defaults.inputs.text : "pineId" === r ? this._metaInfo.scriptIdPart : "pineVersion" === r ? this._metaInfo.pine ? this._metaInfo.pine.version : "-1" : this._properties.inputs[r].value() : this._properties.inputs[r].value() }, S.prototype._rebindToSource = function(t, e) {
                var i, o, n, s, r, a, l, h, c, d, p;
                if (this._isChildStudy) {
                    if (this._source.unsetChild(this), delete this._nonPriceParent, o = null, t === this._model.mainSeries()) {
                        for (n = this._model.studiesMetaData(), r = 0; r < n.length; ++r)
                            if (this._metaInfo.id === n[r].id) { s = n[r]; break }
                        if (!s) return void dt.logError("Can not find " + this._metaInfo.id + " meta info");
                        delete this._source, delete this._isChildStudy, delete this._ownerSource, this._metaInfo = s.state(!0), i = this._series._seriesId, o = X.REBIND_STUDY_CHILD_TO_STANDALONE
                    } else {
                        if (!(t instanceof S)) return dt.logError("Unable to rebind study to source of this type"), !1;
                        this._ownerSource = t, this._source = t, i = this._source.sourceId(), this._source.setChild(this), this._source.isHibernated() && this._source.start()
                    }
                    this._chartApi.rebindStudy(this._studyId, this._turnaround, i, this._studyName, e, this._handler, o)
                } else {
                    if (!(t instanceof S)) return dt.logError("Unable to rebind study to source of this type"), !1;
                    if (a = t.isHibernated(), a && t.start(), l = !1, this._canCreateStudyWithRebindType(X.REBIND_STUDY_STANDALONE_TO_CHILD) ? l = this._chartApi.rebindStudy(this._studyId, this._turnaround, t.sourceId(), this._studyName, e, this._handler, X.REBIND_STUDY_STANDALONE_TO_CHILD) : goProDialog({ feature: "studyOnStudy" }).open(), !l) return a && t.stop(), !1;
                    this._metaInfo = TradingView.clone(this._metaInfo), this._isChildStudy = !0, this._ownerSource = t, this._source = t, this._source.setChild(this), this._childStudyByRebind.fire()
                }
                return h = this.m_priceScale, c = t.priceScale(), h !== c && (d = this._model.paneForSource(this), p = this._model.paneForSource(t), d === p && (~h.dataSources().indexOf(this) && h.removeDataSource(this), c.addDataSource(this), this.setPriceScale(c))), !0
            }, S.prototype.childStudyByRebind = function() { return this._childStudyByRebind }, S.prototype._changeInputsImpl = function(t, e) {
                var i, o, n, s, r = this.source(),
                    a = this._properties.inputs && this._properties.inputs.state(),
                    l = lt.getSourceIdByInputs(this._metaInfo.inputs, a),
                    h = !0;
                if (l)
                    if ("high" === l || "open" === l || "low" === l || "close" === l || "hl2" === l || "ohl3" === l || "ohlc4" === l) r = this._model.mainSeries();
                    else
                        for (i = this._model.dataSources(), o = 0; o < i.length; ++o)
                            if (i[o] instanceof S && i[o].sourceId() === l) { r = i[o]; break }
                if (r !== this.source()) {
                    if (!this._rebindToSource(r, t) && a) {
                        for (n = null, s = null, o = 0; o < e.length; ++o)
                            if (e[o] !== t[o] && 0 === t[o].indexOf(l)) { n = this._properties.inputs[a[o].id], s = e[o], h = !1; break }
                        n && n.setValue(s)
                    }
                } else this._chartApi.modifyStudy(this._studyId, this._turnaround, t, this._handler);
                h && (this._studyModified = h)
            }, S.prototype._changeInputs = function(t) {
                var e = TradingView.clone(this._inputs);
                this._studyId && this._chartApi.connected() ? (this._turnaround = "st" + ++this._turnaroundCounter, this._allInputsAreValid() ? this._allSymbolsAreResolved().done(this._changeInputsImpl.bind(this, t, e)).fail(function(t) { dt.logError("ERROR: " + this._debugId() + " _changeInputs: cannot modify study, " + t) }.bind(this)) : this.stop()) : (this.stop(!0), this.start(!0)), this._inputs = t, this._tagsChanged.fire(), this._titleCache = {}
            }, S.prototype.testInputValue = function(t, e) { var i, o; return !lt.canBeChild(this._metaInfo) || !lt.isSourceInput(t) || (!(i = this._properties.inputs && this._properties.inputs[t.id]) || (o = S.getInputRebindType(t, i.value(), e), !!this._canCreateStudyWithRebindType(o) || (goProDialog({ feature: "studyOnStudy" }).open(), !1))) }, S.prototype._canCreateStudyWithRebindType = function(t) { return t !== X.REBIND_STUDY_STANDALONE_TO_CHILD || this._chartApi.isCanCreateStudy(!0) }, S.prototype.changeStyles = function() {
                var t, e = null != this._metaInfo.inputs.filter(function(t) { return "symbol" === t.type })[0];
                !this.isStarted() && !e || this._restarting || (this._inputs ? (t = this.inputs(),
                    JSON.stringify(t) !== JSON.stringify(this._inputs) && this._changeInputs(t)) : this._chartApi && this._chartApi.connected() && this.restart(), this.hasBarColorer() && this._model.mainSeries().invalidateBarStylesCache(), e && this.invalidateBarStylesCache(), this.createViews(), this.recalculate(!0), this.updateAllViews())
            }, S.prototype._isModifiedStudyInputs = function(t) { if (void 0 === this._oldStudyInputs) return this._oldStudyInputs = t, !0; var e = Object.keys(this._oldStudyInputs); return ct(e.length === Object.keys(t).length, "keys quantity should be equal"), e.forEach(function(e) { ct(t.hasOwnProperty(e), "key '" + e + "' should existing in studyInputs"), this._oldStudyInputs[e] !== t[e] && (this._oldStudyInputs = t) }, this), this._oldStudyInputs === t }, S.prototype.visibleChanged = function() { this._series instanceof TradingView.Series && this._series.invalidateBarColorerCache() }, S.prototype.invalidateBarStylesCache = function() {
                var t, e, i = this.m_data;
                0 !== i.size() && (t = +i.first(), e = +i.last() + 1, i.range(t, e).each(function(t, e) { e[TradingView.STYLE_PLOT] = null }))
            }, S.prototype.processHibernate = function() { this.isHibernateAllowed() && (!this._studyId && this.isVisible() && this.start(), this._studyId && !this.isVisible() && this.stop()) }, S.prototype.isHibernated = function() { return !this.isVisible() && !this._studyId }, S.prototype.isHibernateAllowed = function() { return !this._isChildStudy && !this.hasChildren() }, S.prototype.lastPriceLabelFixedCoordinate = function(t) { return this._priceAxisViewsCache[t]._fixedCoordinate }, S.prototype.priceLabelText = function(t) { var e, i, o, n; return 1 === this._simplePlotsCount ? this._metaInfo.shortDescription : (e = this._metaInfo.styles, i = this._metaInfo.ohlcPlots, e && e[t] && (o = e[t]), i && i[t] && (o = i[t]), n = o.title, this._metaInfo.is_price_study ? this._metaInfo.shortDescription + ":" + n : n) }, S.prototype.createPlotLabels = function(t) { for (var e = 0; e < t.length; e++) this._paneViews.push(new H(this._model, this, t[e], "priceLabelText", "showStudyPlotLabels")) }, S.prototype.createViews = function() {
                var t, e, i, o, n, s, a, l, h, c, d, p, u;
                if (this._priceAxisViewsBase = [], this._paneViews = [], t = {}, this._priceAxisViewsCache = {}, e = [], this.metaInfo().plots)
                    for (i = 0; i < this.metaInfo().plots.length; i++)
                        if (!(this.isSelfColorerPlot(i) || this.isBarColorerPlot(i) || this.isBarColorerPlot(i) || this.isOHLCColorerPlot(i)))
                            if (o = this.metaInfo().plots[i].id, this.isBgColorerPlot(i)) this._paneViews.push(new M(this, this._series, this._model, o));
                            else if (this.isPlotShapesPlot(i)) this._paneViews.push(new D(this, this._series, this._model, o));
                else if (this.isPlotCharsPlot(i)) this._paneViews.push(new O(this, this._series, this._model, o));
                else if (this.isPlotArrowsPlot(i)) this._paneViews.push(new V(this, this._series, this._model, o));
                else if (this.isOHLCSeriesPlot(i)) {
                    if (n = this.metaInfo().plots[i].target, t[n]) continue;
                    t[n] = n, this.isOHLCBarsPlot(i) ? this._paneViews.push(new B(this, this._series, this._model, n)) : this.isOHLCCandlesPlot(i) && this._paneViews.push(new R(this, this._series, this._model, n)), s = new I(this, this._model, n), this._priceAxisViewsCache[n] = s, this._priceAxisViewsBase.push(s), e.push(n)
                } else s = new I(this, this._model, o), this._priceAxisViewsCache[o] = s,
                    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 === lt.FilledArea.TYPE_PLOTS || p.palette ? this._paneViews.push(new F(this, p, u)) : p.type === lt.FilledArea.TYPE_HLINES ? this._paneViews.push(new k(this, p, u)) : dt.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], lt.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, s = 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(s._metaInfo.description) && (s._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 = "", this._statusView.update(), this._model.updateSource(this);
                        break;
                    case "study_completed":
                        if (!this._checkTurnaround(t.params[1])) return Promise.resolve();
                        e = "chartSession:" + s._chartApi._sessionid, i = (new Date).getTime() - this._loadingStartTime, dt.logDebug(e + ", Study " + this._metaInfo.description + " loading took " + i + " ms"), delete this._loadingStartTime, this._status = "", this._statusView.update(), o = this._model.paneForSource(this), this._model.recalculatePane(o), 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), n = 0 === this.m_data.size() && this._metaInfo.plots.length > 0, ct(!!t.params.nonseries, "data.params.nonseries is missing"), new Promise(function(e) {
                            s._makeJSONForNSData(t).then(function(i) {
                                var o, r;
                                t.params.nonseries.d = i, s._processPlotOffsets(t.params), s.transformData(t.params.plots), o = s._mergeData(t.params.plots).earliestRow, s.hasBarColorer() && (null !== o ? s._model.mainSeries().invalidateBarStylesCache(o.index) : dt.logNormal("ERROR: No earliestRow in studies plots, " + s._debugId())), s._graphics.process(t.params.nonseries), s._postProcessGraphics(), r = s._model.paneForSource(s), s._model.recalculatePane(r, n), s._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 dt.logDebug("Study.priceRange: incorrect startBar");
                if (!TradingView.isInteger(e)) return void dt.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 && [ht.PlotType.Histogram, ht.PlotType.Columns, ht.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 === ht.PlotTypes.LINE }, S.isSelfColorerPlot = function(t, e) { return t._metaInfo.plots[e].type === ht.PlotTypes.COLORER }, S.prototype.isSelfColorerPlot = function(t) { return S.isSelfColorerPlot(this, t) }, S.prototype.isTextColorerPlot = function(t) { return this._metaInfo.plots[t].type === ht.PlotTypes.TEXT_COLORER }, S.prototype.isBarColorerPlot = function(t) { return this._metaInfo.plots[t].type === ht.PlotTypes.BAR_COLORER }, S.prototype.isBgColorerPlot = function(t) { return this._metaInfo.plots[t].type === ht.PlotTypes.BG_COLORER }, S.prototype.isPlotShapesPlot = function(t) { return this._metaInfo.plots[t].type === ht.PlotTypes.SHAPES }, S.prototype.isPlotCharsPlot = function(t) { return this._metaInfo.plots[t].type === ht.PlotTypes.CHARS }, S.prototype.isPlotArrowsPlot = function(t) { return this._metaInfo.plots[t].type === ht.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 === ht.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 === ht.OHLCType.CANDLES
            }, S.prototype.isOHLCSeriesPlot = function(t) { var e = this._metaInfo.plots[t].type; return e === ht.PlotTypes.OHLC_OPEN || e === ht.PlotTypes.OHLC_HIGH || e === ht.PlotTypes.OHLC_LOW || e === ht.PlotTypes.OHLC_CLOSE }, S.prototype.isOHLCOpenPlot = function(t) { return this._metaInfo.plots[t].type === ht.PlotTypes.OHLC_OPEN }, S.prototype.isOHLCHighPlot = function(t) {
                return this._metaInfo.plots[t].type === ht.PlotTypes.OHLC_HIGH
            }, S.prototype.isOHLCLowPlot = function(t) { return this._metaInfo.plots[t].type === ht.PlotTypes.OHLC_LOW }, S.prototype.isOHLCClosePlot = function(t) { return this._metaInfo.plots[t].type === ht.PlotTypes.OHLC_CLOSE }, S.prototype.isOHLCColorerPlot = function(t) { return this._metaInfo.plots[t].type === ht.PlotTypes.OHLC_COLORER }, S.prototype.isDataOffsetPlot = function(t) { return this._metaInfo.plots[t].type === ht.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 st(i)) : this._formatter = new nt(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 dt.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":
                    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(78).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 = !!lt.canHaveChildren(this._metaInfo)), this._canHaveChildren }, S.getInputRebindType = function(t, e, i) { var o = lt.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(24), i(15), i(3), i(107))
}, function(t, e, i) {
    "use strict";

    function o(t) {
        var e = r.parseRgb(t),
            i = e.map(function(t) { return t > 50 ? t - 50 : 0 });
        return r.rgbToString(i)
    }

    function n(t) { var e, i, o, n = []; for (e = 0, i = t; e < i.length; e++) o = i[e], null !== r.tryParseRgb(o) && n.push(o); return n }

    function s(t, e) { void 0 === e && (e = {}); var i = $('<span class="tvcolorpicker-container">'); return null !== t && i.appendTo(t), void 0 !== e.addClass && i.addClass(e.addClass), $('<div class="tvcolorpicker-transparency">').appendTo(i), $('<input class="colorpicker-widget">').tvcolorpicker({ customColors: n(a.getJSON("pickerCustomColors", [])), direction: e.direction, hideTransparency: !!e.hideTransparency }).on("change", function() { $(this).css("border-color", o($(this).val() || l)) }).bind("customcolorchange", function(t, e) { a.setJSON("pickerCustomColors", e) }).appendTo(i), i }
    var r, a, l;
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17), i(360), r = i(37), a = i(69), l = "#727272", e.addColorPicker = s
}, 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, s, r, a, l;
    Object.defineProperty(e, "__esModule", { value: !0 }), n = i(34), s = i(3), r = i(12), 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, c, d, p;
    Object.defineProperty(e, "__esModule", { value: !0 }), h = i(15), 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) {
    (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];
                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(50)(t))
}, function(t, e) {
    "use strict";
    var i, o, n, s;
    Object.defineProperty(e, "__esModule", { value: !0 }), i = {}, o = RegExp("^([0-9]*)$"), n = RegExp("^(\\d*)([DWMS])$"), s = function() {
        function t(e, i) {
            if (void 0 === i && e !== t.INVALID) return t.parse(e);
            var o = e;
            o !== t.SECONDS && o !== t.MINUTES && o !== t.HOURS && o !== t.DAYS && o !== t.WEEKS && o !== t.MONTHS && o !== t.INVALID && (o = "invalid"), this._kind = o, this._multiplier = i
        }
        return t.prototype.kind = function() { return this._kind }, t.prototype.multiplier = function() { return this._multiplier }, t.prototype.isValid = function() { return this.kind() !== t.INVALID }, t.prototype.isDWM = function() { return this.isValid() && !this.isIntraday() }, t.prototype.isIntraday = function() { return -1 !== [t.SECONDS, t.MINUTES, t.HOURS].indexOf(this.kind()) }, t.prototype.letter = function() { return this.isValid() && this.kind() !== t.MINUTES ? this.kind()[0].toUpperCase() : "" }, t.prototype.value = function() { return this.isValid() ? this.kind() === t.MINUTES ? this.multiplier() + "" : this.multiplier() + this.letter() : "" }, t.prototype.isEqualTo = function(e) { if (!(e instanceof t)) throw Error("Argument is not an Interval"); return this.kind() !== t.INVALID && e.kind() !== t.INVALID && (this.kind() === e.kind() && this.multiplier() === e.multiplier()) }, t.prototype.inMilliseconds = function() { if (!this.isValid() || this.kind() === t.MONTHS) return NaN; var e = this.multiplier(); return void 0 === e ? NaN : i[this.kind()] * e }, t.isEqual = function(e, i) { return t.parse(e).isEqualTo(t.parse(i)) }, t.parse = function(e) { var i, s; return e = (e + "").toUpperCase().split(",")[0], i = { D: t.DAYS, W: t.WEEKS, M: t.MONTHS, H: t.HOURS, S: t.SECONDS }, (s = o.exec(e)) ? new t(t.MINUTES, parseInt(e, 10)) : (s = n.exec(e), s ? new t(i[s[2]], parseInt(s[1], 10) ? parseInt(s[1], 10) : 1) : new t(t.INVALID)) }, t.isDWM = function(e) { return t.parse(e).isDWM() }, t.kind = function(e) { return t.parse(e).kind() }, t.isValid = function(e) { return t.parse(e).isValid() }, t
    }(), s.SECONDS = "seconds", s.MINUTES = "minutes", s.HOURS = "hours", s.DAYS = "days", s.WEEKS = "weeks", s.MONTHS = "months", s.INVALID = "invalid", e.Interval = s, i[s.SECONDS] = 1e3, i[s.MINUTES] = 60 * i[s.SECONDS], i[s.HOURS] = 60 * i[s.MINUTES], i[s.DAYS] = 24 * i[s.HOURS], i[s.WEEKS] = 7 * i[s.DAYS]
}, , , , , function(t, e, i) {
    (function(t) {
        "use strict";

        function e() {}

        function i(t) {
            if (!(this instanceof i)) return new i(t);
            arguments.length > 0 && (this._value = t), this._listeners = []
        }
        i.prototype.value = function() { return this._owner ? this._owner._value : this._value }, i.prototype.setValue = function(t, e) { var i, o, n, s = this._owner ? this._owner : this; if ("function" == typeof s.hook && (t = s.hook(t)), s.writeLock) return s._value; if (!e && s._value === t && s.hasOwnProperty("_value")) return t; for (s._value = t, i = s._listeners.slice(), o = 0, n = 0; n < i.length; n++) i[n].once && (s._listeners.splice(n - o, 1), o++), i[n].cb(t); return t },
            i.prototype.deleteValue = function() { var t, e, i, o = this._owner ? this._owner : this; if (o.hasOwnProperty("_value")) { if (o.writeLock) return o._value; for (delete o._value, t = o._listeners.slice(), e = 0, i = 0; i < t.length; i++) t[i].once && (o._listeners.splice(i - e, 1), e++), t[i].cb() } }, i.prototype.subscribe = function(t, e) {
                var i, o, n;
                if ("function" != typeof t) throw new TypeError("callback must be a function");
                i = !!e && !!e.once, o = !!e && !!e.callWithLast, n = this._owner ? this._owner : this, o && n.hasOwnProperty("_value") && (t(n._value), i) || n._listeners.push({ cb: t, owner: this, once: !!e && !!e.once })
            }, i.prototype.unsubscribe = function(t) { var e, i, o = this._owner ? this._owner : this; for (void 0 === t && (t = null), e = o._listeners, i = e.length; i--;) e[i].owner !== this && o !== this || e[i].cb !== t && null !== t || e.splice(i, 1) }, i.prototype.listeners = function() { return (this._owner ? this._owner : this)._listeners }, i.prototype.readonly = function() { if (this._readonlyInstance) return this._readonlyInstance; var t = this._readonlyInstance = new e; return t.subscribe = this.subscribe.bind(this), t.unsubscribe = this.unsubscribe.bind(this), t.value = this.value.bind(this), t.when = this.when.bind(this), t.spawn = function() { return this.spawn().readonly() }.bind(this), t }, i.prototype.spawn = function() { var t = new i; return delete t._listeners, t._owner = this._owner || this, t.destroy = function() { this.unsubscribe(), delete this._owner }, t }, i.prototype.when = function(t) {
                var e, i = this;
                if (this.value()) return void t();
                e = function(o) { o && (i.unsubscribe(e), t()) }, i.subscribe(e)
            }, i.prototype.opposite = function() { var t, e; return this._opposite || (t = this, e = new i(!this.value()), this.subscribe(function(t) { e.setValue(!t) }), e.subscribe(function(e) { t.setValue(!e) }), this._opposite = e), this._opposite }, "undefined" != typeof window && (window.WatchedValue = i), void 0 !== t && t && t.exports && (t.exports = i)
    }).call(e, i(50)(t))
}, function(t, e, i) {
    (function(e, o, n) {
        "use strict";

        function s(t) { return "cursor" === t || "arrow" === t || "dot" === t }

        function r(t) {!t && d && d.stayInDrawingMode.value() || this.tool.setValue(this.cursorTool.value()) }

        function a(t, e) { return function(e) { t.inFire || (t.inFire = !0, t.fire(e), t.inFire = !1) } }

        function l() { K || (g.setValue(TVSettings.getValue("chart.cursorPreference", "cursor")), g.subscribe(function(t) { s(t) && v.setValue(t) }, { callWithLast: !0 }), v.subscribe(function(t) { t && TVSettings.setValue("chart.cursorPreference", t) }), d = new h("drawings"), p = new n, u = new n, _ = new n, f = new n, p.setValue(!1), u.setValue(!1), _.setValue(!1), f.setValue(!1), g.subscribe(function() { c.emit("onSelectedLineToolChanged") }), K = !0) }
        var h = i(7).DefaultProperty,
            c = i(34),
            d = null,
            p = null,
            u = null,
            _ = null,
            f = null,
            m = new e,
            g = new e,
            v = new e,
            y = new o,
            b = new o,
            w = new o,
            S = new o,
            T = new o,
            C = new o,
            x = new o,
            P = new o,
            L = new o,
            k = new o,
            I = new o,
            A = new o,
            E = new o,
            M = new o,
            D = new o,
            O = a(y),
            $ = a(b),
            V = a(w),
            B = a(S),
            R = a(T),
            N = a(C),
            F = a(x),
            z = a(P),
            W = a(L),
            H = a(k),
            U = a(I),
            j = a(A),
            q = a(E),
            Y = a(M),
            G = a(D),
            K = !1;
        t.exports = {
            tool: g,
            cursorTool: v,
            toolIsCursor: s,
            resetToCursor: r,
            init: l,
            createdLineTool: y,
            continuedLineTool: b,
            cancelledLineTool: w,
            createLineTool: O,
            continueLineTool: $,
            cancelLineTool: V,
            startedMovingLineTool: S,
            movedLineTool: T,
            finishedMovingLineTool: C,
            startMovingLineTool: B,
            moveLineTool: R,
            finishMovingLineTool: N,
            startedChangingLineTool: x,
            changedLineTool: P,
            finishedChangingLineTool: L,
            startChangingLineTool: F,
            changeLineTool: z,
            finishChangingLineTool: W,
            removedLineTool: k,
            removeLineTool: H,
            restoredLineTool: M,
            restoreLineTool: Y,
            restoredLineToolState: D,
            restoreLineToolState: G,
            finishedLineTool: I,
            finishLineTool: U,
            changedLineStyle: A,
            changeLineStyle: j,
            copiedLineTool: E,
            copyLineTool: q,
            properties: function() { return d },
            hideAllDrawings: function() { return p },
            hideMarksOnBars: function() { return _ },
            lockDrawings: function() { return u },
            drawOnAllCharts: function() { return d.drawOnAllCharts },
            lockTimeAxis: function() { return f },
            lockTimeAxisTime: m
        }
    }).call(e, i(41), i(15), i(24))
}, function(t, e, i) {
    (function(e, o, n, s) {
        "use strict";

        function r(t) { this._series = t, this._model = t.m_model, this._points = [new D.Point(0, 0)], this._invalidated = !0 }

        function a() { return { count: TradingView.DEFAULT_BAR_COUNT } }

        function l(t, n, s) {
            var u, _ = i(153);
            x.call(this, t), this._boxSizeChanged = new e, this._tagsChanged = new e, this._symbolIntervalChanged = new e, this._symbolResolved = new e, this._symbolError = new e, this._symbolNotPermitted = new e, this._symbolGroupNotPermitted = new e, this._intervalChanged = new e, this._extendedHoursChanged = new e, this._extendedHoursNotPermitted = new e, this.chartTypeNotPermitted = new e, this.intradaySpreadNotPermitted = new e, this.intradayExchangeNotPermitted = new e, this.customIntervalNotPermitted = new e, this.chartWidgetInitialized = new e, this._startLoading = new e, this._dataLoaded = new e, this._tickmarksRangeChanged = new e, this._barReceived = new e, this._onChangedStyle = new e, this._onCompleted = new e, this._onStatusChanged = new e, this._onRestarted = new e, this._onSessionsStudyCreated = new e, this.requestingIntradayWhenNotSupported = new e, this.requestingResolutionWhenNotSupported = new e, this.priceScaleChanged = new e, this._requestOptions = s || a(), this.m_model = t, this._chartApi = t._chartApi, this.m_data = new E(this, t), this.setProperties(n), this._prevChartStyle = n.style.value(), this.createPaneView(), this._dataWindowView = new p(this, t), this._statusView = new h(this, t.properties()), this._priceAxisViews = [new d(this, t), new c(this, t)], this._symbolInfo = null, this._status = l.STATUS_OFFLINE, this._syncModel = null, u = this, this._turnaroundCounter = 1, this._turnaround = "s" + this._turnaroundCounter, this._handler = function(t) { u.onData(t) }, this._properties.addExclusion && this._properties.addExclusion("visible"), this._base = 100, this._formatter = new V(this._base), this._predictBars = 0, this._futureBarsPaneView = null, this._properties.showInDataWindow.listeners().subscribe(t, _.prototype.fullUpdate), this.marketStatus = new o, this._seriesLoaded = !1, this.properties().minTick.listeners().subscribe(this, l.prototype._recreateFormatter), u = this, this.properties().minTick.listeners().subscribe(null, function() { u.m_model.invalidate(new M(M.FULL_UPDATE)) }), this._priceLineView = new r(this), this._gotoDateView = new C(this), this.bindStyleChange(), this.bindJapChartsInputs(), this.createExtendedHoursProperty(), this.extendedHours.listeners().subscribe(this, function() { this._extendedHoursChanged.fire() }),
                this._extendedHoursNotPermitted.subscribe(this, function() { this._properties.extendedHours.setValue(!1) }), this._extendedHoursChanged.subscribe(this, function() { this._status !== l.STATUS_SNAPSHOT && this.restart() }), this._symbolIntervalChanged.subscribe(this, this.checkInterval), this.properties().showCountdown.listeners().subscribe(this, l.prototype._onChangeShowCountdown), this._onChangeShowCountdown(this.properties().showCountdown), this._recreateFormatter(), this._isDWMCached = null
        }
        var h, c, d, p, u, _, f, m, g, v, y, b, w, S, T, C, x, P, L, k, I, A, E, M, D, O, V, B, R, N, F, z, W, H, U, j;
        TradingView.DEFAULT_BAR_COUNT = 300, TradingView.TIME_PLOT = 0, TradingView.OPEN_PLOT = 1, TradingView.HIGH_PLOT = 2, TradingView.LOW_PLOT = 3, TradingView.CLOSE_PLOT = 4, TradingView.ADT_PLOT = 6, TradingView.STYLE_PLOT = 7, TradingView.SEARCH_FROM_LEFT = -1, TradingView.SEARCH_FROM_RIGHT = 1, h = i(699), c = i(696), d = i(347), p = i(698), u = i(346), _ = u.SeriesAreaPaneView, f = u.SeriesLinePaneView, m = u.SeriesHollowCandlesPaneView, g = u.SeriesCandlesPaneView, v = u.SeriesBarsPaneView, y = u.SeriesHeikenAshiPaneView, b = i(3), w = i(304), S = i(196).SeriesBarColorer, T = i(89).HorzLineRenderer, C = i(685), x = i(48).PriceDataSource, P = i(158), L = i(700).FutureBarsPaneView, k = i(36).Interval, I = i(8), A = i(198), E = i(345), M = i(21), D = i(2), O = i(285), V = i(27).PriceFormatter, B = i(86), R = i(25), N = i(356).SyncModel, F = i(33).trackEvent, z = i(164).translatedIntervalString, W = i(60), H = i(12), U = H.getLogger("Chart.Series"), j = H.getLogger("Chart.Series.Updates", { highRate: !0 }), r.prototype.update = function() { this._invalidated = !0 }, r.prototype.updateImpl = function() {
            if (this._visible = !1, this._series.properties().showPriceLine.value()) {
                var t = this._series.lastValueData(TradingView.CLOSE_PLOT, !0);
                t.noData || (this._visible = !0, this._points = [new D.Point(0, t.coordinate)], this._color = t.color)
            }
        }, r.prototype.renderer = function() { this._invalidated && (this.updateImpl(), this._invalidated = !1); var t = {}; return t.points = this._points, t.color = this._color, t.linewidth = this._series.properties().priceLineWidth.value(), t.linestyle = CanvasEx.LINESTYLE_DOTTED, t.hitTestResult = I.REGULAR, t.visible = this._visible, new T(t) }, inherit(l, x), l.prototype.endOfData = function() { return this._endOfData }, l.prototype.serverTimeOffset = function() { return this._chartApi.serverTimeOffset() }, l.prototype._onChangeShowCountdown = function(t) {
            var e = this;
            t.value() ? this._countdownUpdateTimer = this.m_model.setInterval(function() { e.isDWM() || (e._priceAxisViews[0].update(), e.m_model.invalidate(new M(M.LIGHT_UPDATE))) }, 500) : (this.m_model.clearInterval(this._countdownUpdateTimer), delete this._countdownUpdateTimer)
        }, l.prototype.lastValueData = function(t, e, i) {
            var o, n, s, r, a, l, h, c, d, p, u = { noData: !0 };
            if (this.m_model.timeScale().isEmpty() || this.priceScale().isEmpty() || this.data().isEmpty()) return u;
            if (o = this.m_model.timeScale().visibleBars(), o.isEmpty()) return u;
            if (e) {
                if (null === (r = this.data().bars().last()) || void 0 === r) return u;
                n = r.value, s = parseInt(r)
            } else {
                if (null === (a = this.data().bars().search(o.lastBar(), TradingView.SEARCH_NEAREST_LEFT)) || void 0 === a) return u;
                n = this.data().bars().valueAt(a.index), s = a.index
            }
            return l = { noData: !1 }, h = n[TradingView.CLOSE_PLOT],
                i && (l.price = h), this.priceScale().properties().percentage.value() && (c = this.firstValue(), h = this.priceScale().priceRange().convertToPercent(h, c)), l.text = this.priceScale().formatter().format(h), d = this.barColorer(), p = d.barStyle(s, !1), l.color = p.barColor, l.floatCoordinate = this.priceScale().priceToCoordinate(h, !0), l.coordinate = Math.round(l.floatCoordinate), l.index = s, l
        }, l.prototype._prepareChartApiParams = function() { return this._requestOptions.startDate ? !this._requestOptions.startDate || this._requestOptions.endDate || this._requestOptions.count ? this._requestOptions.startDate && this._requestOptions.endDate ? ["from_to", this._requestOptions.startDate, this._requestOptions.endDate] : ["from_to", this._requestOptions.startDate, this._requestOptions.count] : ["from_to", this._requestOptions.startDate] : this._requestOptions.count || TradingView.DEFAULT_BAR_COUNT }, l.prototype._nextSymbolId = 1, l.prototype._nextSeriesId = 1, l.STYLE_BARS = 0, l.STYLE_CANDLES = 1, l.STYLE_LINE = 2, l.STYLE_LINE_TYPE_MARKERS = 0, l.STYLE_LINE_TYPE_STEP = 1, l.STYLE_LINE_TYPE_SIMPLE = 2, l.STYLE_AREA = 3, l.STYLE_RENKO = 4, l.STYLE_KAGI = 5, l.STYLE_PNF = 6, l.STYLE_PB = 7, l.STYLE_HEIKEN_ASHI = 8, l.STYLE_HOLLOW_CANDLES = 9, Object.assign(l, i(697)), l.PERMISSION_DENIED = "permission denied", l.PD_REASON_SYMBOL = "symbol", l.PD_REASON_EXTENDED_HOURS = "extended_hours", l.PD_REASON_GROUP_PERMISSION = "group", l.STUDY_NOT_AUTH = "study_not_auth", l.STYLE_SHORT_NAMES = {}, l.STYLE_SHORT_NAMES[l.STYLE_BARS] = "bar", l.STYLE_SHORT_NAMES[l.STYLE_CANDLES] = "candle", l.STYLE_SHORT_NAMES[l.STYLE_HOLLOW_CANDLES] = "hollowCandle", l.STYLE_SHORT_NAMES[l.STYLE_LINE] = "line", l.STYLE_SHORT_NAMES[l.STYLE_AREA] = "area", l.STYLE_SHORT_NAMES[l.STYLE_RENKO] = "renko", l.STYLE_SHORT_NAMES[l.STYLE_PB] = "pb", l.STYLE_SHORT_NAMES[l.STYLE_KAGI] = "kagi", l.STYLE_SHORT_NAMES[l.STYLE_PNF] = "pnf", l.STYLE_SHORT_NAMES[l.STYLE_HEIKEN_ASHI] = "ha", l._SYMBOL_STRING_DATA = {}, l._SYMBOL_STRING_DATA[l.STYLE_RENKO] = { type: "BarSetRenko@tv-prostudies-1!", inputNames: ["source", "style", "boxSize", "atrLength"] }, l._SYMBOL_STRING_DATA[l.STYLE_PB] = { type: "BarSetPriceBreak@tv-prostudies-1!", inputNames: ["source", "lb"] }, l._SYMBOL_STRING_DATA[l.STYLE_KAGI] = { type: "BarSetKagi@tv-prostudies-1!", inputNames: ["source", "style", "atrLength", "reversalAmount"] }, l._SYMBOL_STRING_DATA[l.STYLE_PNF] = { type: "BarSetPnF@tv-prostudies-1!", inputNames: ["sources", "style", "boxSize", "atrLength", "reversalAmount"] }, l._SYMBOL_STRING_DATA[l.STYLE_HEIKEN_ASHI] = { type: "BarSetHeikenAshi@tv-basicstudies-1!", inputNames: [] }, l.prototype.model = function() { return this.m_model }, l.prototype.fixLastBar = function(t) { this._futureBarsPaneView || (this._futureBarsPaneView = new L(this, this.data().bars().lastTimeIndex(), t)) }, l.prototype.clearData = function() { this.data().clear() }, l.prototype.data = function() { return this.m_data }, l.prototype.symbolId = function() { return this._symbolId }, l.prototype.isPulse = function() { return this._symbolInfo && this._symbolInfo.resolutions.length > 0 }, l.prototype.onTagsChanged = function() { return this._tagsChanged }, l.prototype.onSymbolIntervalChanged = function() { return this._symbolIntervalChanged }, l.prototype.onSymbolResolved = function() {
            return this._symbolResolved
        }, l.prototype.onSymbolError = function() { return this._symbolError }, l.prototype.onSymbolNotPermitted = function() { return this._symbolNotPermitted }, l.prototype.onSymbolGroupNotPermitted = function() { return this._symbolGroupNotPermitted }, l.prototype.onIntervalChanged = function() { return this._intervalChanged }, l.prototype.onExtendedHoursNotPermitted = function() { return this._extendedHoursNotPermitted }, l.prototype.onStartLoading = function() { return this._startLoading }, l.prototype.onDataLoaded = function() { return this._dataLoaded }, l.prototype.onStatusChanged = function() { return this._onStatusChanged }, l.prototype.onTickmarksRangeChanged = function() { return this._tickmarksRangeChanged }, l.prototype.onBarReceived = function() { return this._barReceived }, l.prototype.onChangedStyle = function() { return this._onChangedStyle }, l.prototype.onCompleted = function() { return this._onCompleted }, l.prototype.onRestarted = function() { return this._onRestarted }, l.prototype.onBoxSizeChanged = function() { return this._boxSizeChanged }, l.prototype.status = function() { return this._status }, l.prototype.isDWM = function() { var t, e; return null !== this._isDWMCached ? this._isDWMCached : (t = new k(this._properties.interval.value()), t.isDWM() ? this._isDWMCached = !0 : (e = t.kind() === k.SECONDS ? t.multiplier() : 60 * t.multiplier(), this._isDWMCached = !(e < 216e3)), this._isDWMCached) }, l.prototype.lastPriceLabelFixedCoordinate = function() { return this._priceAxisViews[0]._fixedCoordinate }, l.prototype.createPaneView = function() {
            this._paneView = null, this._projectionBarsPaneView = null, this._symbolLabelView = new P(this.m_model, this, TradingView.CLOSE_PLOT, "firstShortName", "showSymbolLabels");
            var t = this._properties.style.value();
            switch (t) {
                case l.STYLE_BARS:
                    this._paneView = new v(this, this.m_model);
                    break;
                case l.STYLE_CANDLES:
                    this._paneView = new g(this, this.m_model);
                    break;
                case l.STYLE_LINE:
                    this._paneView = new f(this, this._properties.lineStyle.priceSource.value(), this.m_model);
                    break;
                case l.STYLE_AREA:
                    this._paneView = new _(this, this._properties.areaStyle.priceSource.value(), this.m_model);
                    break;
                case l.STYLE_HEIKEN_ASHI:
                    this._paneView = new y(this, this.m_model);
                    break;
                case l.STYLE_HOLLOW_CANDLES:
                    this._paneView = new m(this, this.m_model);
                    break;
                default:
                    throw Error("Unknown chart style assigned: " + t)
            }
        }, l.prototype._clearStylePlot = function(t, e) {
            var i, o;
            t.size() && (i = e || +t.first(), o = +t.last() + 1, t.range(i, o).each(function(t, e) { e[TradingView.STYLE_PLOT] = null }))
        }, l.prototype.invalidateBarStylesCache = function(t) { U.logDebug("Invalidate style cache starting from " + t), this._clearStylePlot(this.m_data.m_bars, t), this._clearStylePlot(this.m_data.m_nsBars) }, l.prototype.invalidateBarColorerCache = function() { delete this._barColorerCache, this.invalidateBarStylesCache() }, l.prototype.barColorer = function() {
            var t, e, i, o;
            if (this._barColorerCache) return this._barColorerCache;
            for (t = null, e = this.m_model.dataSources().length - 1; e >= 0; e--) i = this.m_model.dataSources()[e], i.metaInfo && TradingView.isInherited(i.constructor, TradingView.Study) && i.hasBarColorer() && i.properties().visible.value() && (o = i.barColorer(), null === t ? t = o : t.pushBackBarColorer(o));
            return null === t ? t = new S(this) : t.pushBackBarColorer(new S(this)), this._barColorerCache = t, this._barColorerCache
        }, l.prototype.properties = function() { return this._properties }, l.prototype._barsState = function(t) { var e = t.state(); return e.columns = e.columns.filter(function(t) { return "style" !== t }), e.data.forEach(function(t) { t.value.splice(7, 1) }), e }, l.prototype.state = function(t) {
            var e = this === this.m_model.mainSeries() ? "MainSeries" : TradingView.className(this.constructor),
                i = { type: e, id: this.id(), state: this.properties().state(), zorder: this.zorder() };
            return this._symbolInfo && this._symbolInfo.ticker && (i.state.symbol = this._symbolInfo.ticker), t && (i.bars = this._barsState(this.m_data.m_bars), i.nsBars = this._barsState(this.m_data.m_nsBars), i.symbolInfo = this._symbolInfo, i.rtPrice = this.data().lastProjectionPrice), i.boxSize = this.data().boxSize, i.reversalAmount = this.data().reversalAmount, i
        }, l.prototype.stateForAlert = function() { var t = this === this.m_model.mainSeries() ? "MainSeries" : TradingView.className(this.constructor); return { id: this.id(), uniqueId: this.uniqueId(), type: t, proSymbol: this.proSymbol(), actualSymbol: this.actualSymbol(), symbolString: this.getSymbolString(), interval: this.interval(), style: this.properties().style.value(), styleInputs: this.getInputsProperties().state(), extendedHours: this.extendedHours.value(), boxSize: this.data().boxSize, reversalAmount: this.data().reversalAmount } }, l.prototype.uniqueId = function() { return this.actualSymbol() + "|" + this.interval() }, l.prototype.restoreData = function(t, e, i, o, n, s) { this._status = l.STATUS_SNAPSHOT, this.m_data.m_bars.restoreState(t), this.m_data.m_nsBars.restoreState(e), this.updateSymbolInfo(i), this.m_data.lastProjectionPrice = o, this.m_data.boxSize = n, n || (this.properties().style.value() === l.STYLE_PNF ? this.m_data.boxSize = this.properties().pnfStyle.inputs.boxSize.value() : this.properties().style.value() === l.STYLE_RENKO && (this.m_data.boxSize = this.properties().renkoStyle.inputs.boxSize.value())), this.m_data.reversalAmount = s, s || this.properties().style.value() === l.STYLE_KAGI && (this.m_data.reversalAmount = this.properties().kagiStyle.inputs.reversalAmount.value()) }, l.prototype.setProperties = function(t) { t.timeframe || t.merge({ timeframe: "" }), t.shortName || t.merge({ shortName: "" }), this._properties = t, this._properties.symbol.listeners().subscribe(this, l.prototype.changeSymbol), this._properties.interval.listeners().subscribe(this, l.prototype.changeInterval), this._properties.timeframe.listeners().subscribe(this, l.prototype.changeTimeFrame), this._properties.listeners().subscribe(this, l.prototype.changeProperties) }, l.prototype.changeSymbol = function() { this.setSymbolIntervalDelayed(), this.m_model.checkLineToolSelection() }, l.prototype.changeInterval = function() { this.setSymbolIntervalDelayed() }, l.prototype.changeTimeFrame = function() { F("GUI", "Change timeframe") }, l.prototype.title = function() { return this.properties().symbol.value() + ", " + z(this.properties().interval.value()) }, l.generateTitleForGui = function(t) {
            function e(t, e) { return Math.round(t * Math.pow(10, e)) / Math.pow(10, e) || "" }
            var i, o, n, s = t || {},
                r = "QUANDL" === s.exchange,
                a = "",
                h = {
                    symbolDescription: "",
                    interval: "",
                    exchange: "",
                    chartStyle: ""
                };
            switch (s.description && r ? 2 === s.description.split("/").length ? h.symbolDescription = s.description.split("/")[1] : (i = s.description.split("'").filter(function(t) { return t.length }), i.forEach(function(t) { t = t && ("/" === t[0] || /\d+\/\(?/.test(t)) ? [t] : t.split("/").filter(function(t) { return t.length }), h.symbolDescription += t[2 === t.length ? 1 : 0] })) : s.description ? h.symbolDescription = s.description : h.symbolDescription = s.symbol, s.interval && (h.interval = z(s.interval)), r && s.description && (o = /[\w_]+\/[\w_]+/.exec(s.description), o && o[0] ? h.provider = o[0].split("/")[0] : h.provider = s.description.split("/")[0]), s.exchange && (h.exchange = s.exchange), s.style) {
                case l.STYLE_RENKO:
                    n = s.inputs.style + ("ATR" === s.inputs.style ? "(" + s.inputs.atrLength + ")" : ""), h.chartStyle = $.t("Renko") + " [" + s.inputs.source + ", " + n + ", " + e(s.boxSize, 4) + "]";
                    break;
                case l.STYLE_PB:
                    h.chartStyle = $.t("Line Break") + " [" + s.inputs.source + ", " + s.inputs.lb + "]";
                    break;
                case l.STYLE_KAGI:
                    n = s.inputs.style + ("ATR" === s.inputs.style ? "(" + s.inputs.atrLength + ")" : ""), h.chartStyle = $.t("Kagi") + " [" + s.inputs.source + ", " + n + ", " + e(s.reversalAmount, 8) + "]";
                    break;
                case l.STYLE_PNF:
                    n = s.inputs.style + ("ATR" === s.inputs.style ? "(" + s.inputs.atrLength + ")" : ""), h.chartStyle = $.t("PnF") + " [" + s.inputs.sources + ", " + n + ", " + e(s.boxSize, 8) + ", " + s.inputs.reversalAmount + "]";
                    break;
                case l.STYLE_HEIKEN_ASHI:
                    h.chartStyle = $.t("Heikin Ashi")
            }
            return a = h.symbolDescription + (h.interval ? ", " + h.interval : "") + (h.provider ? ", " + h.provider : "") + (h.exchange ? ", " + h.exchange : "") + (h.chartStyle ? ", " + h.chartStyle : ""), a = a.replace(/\'/g, "")
        }, l.prototype.changeProperties = function(t) { t !== this._properties.symbol && t !== this._properties.interval && t !== this._properties.timeframe && (this._tagsChanged.fire(), this.createPaneView(), this.updateAllViews(), this.m_model.updateSource(this)) }, l.prototype._makeNextSymbolId = function() { return "symbol_" + this._nextSymbolId++ }, l.prototype._makeNextSeriesId = function() { return "s" + this._nextSeriesId++ }, l.prototype.onData = function(t) {
            var e, i, o, n, s, r, a, h, c, d, p, u, _, f, m, g, v, y, w = this;
            switch (t.method) {
                case "symbol_resolved":
                    if (t.params[0] !== this._symbolId) { U.logNormal("command for old symbol. Expected:" + this._symbolId + ", actual" + t.params[0]); break }
                    this.updateSymbolInfo(t.params[1]), this.m_model.updateSource(this), this._symbolResolved.fire(this._symbolInfo), this.m_model.realignLineTools(), TradingView.onWidget() || F("Symbol", t.params[1].listed_exchange, t.params[1].name), e = this.symbolInfo().minmov / this.symbolInfo().pricescale, i = this.properties(), i.style.value() === l.STYLE_RENKO && i.renkoStyle.inputs.boxSize.value() < e ? i.renkoStyle.inputs.merge({ boxSize: e }) : i.style.value() === l.STYLE_PNF && i.pnfStyle.inputs.boxSize.value() < e ? i.pnfStyle.inputs.merge({ boxSize: e }) : i.style.value() === l.STYLE_KAGI && i.kagiStyle.inputs.reversalAmount.value() < e && i.kagiStyle.inputs.merge({ reversalAmount: e });
                    break;
                case "symbol_error":
                    if (t.params[0] !== this._symbolId) { U.logNormal("command for old symbol. Expected:" + this._symbolId + ", actual" + t.params[0]); break }
                    if (this._setStatus(l.STATUS_INVALID_SYMBOL),
                        this._properties.shortName.setValue(this._properties.symbol.value()), this.m_model.clearAllStudies(), this.updateAllViews(), this.m_model.updateSource(this), t.params[1] === l.PERMISSION_DENIED) switch (t.params[2]) {
                        case l.PD_REASON_EXTENDED_HOURS:
                            this._extendedHoursNotPermitted.fire();
                            break;
                        case l.PD_REASON_SYMBOL:
                            this._symbolNotPermitted.fire(t.params[3]);
                            break;
                        case l.PD_REASON_GROUP_PERMISSION:
                            this._symbolGroupNotPermitted.fire(t.params[3]);
                            break;
                        default:
                            this._symbolNotPermitted.fire(t.params[2])
                    } else this.m_model.resetTimeScale(), this._symbolError.fire();
                    this.m_model.realignLineTools();
                    break;
                case "series_timeframe":
                    if (t.params[1] !== this._turnaround) break;
                    o = t.params[2], n = t.params[3], s = t.params[4], r = void 0 !== s && s ? n : n + 10, this.m_model.setTimeViewport(o, r);
                    break;
                case "series_error":
                    a = t.params[2], delete this._loadingStartTime, b.enabled("charting_library_debug_mode") && U.logNormal("Error reason: " + a), this._setStatus(b.enabled("no_bars_status") && this._symbolInfo ? l.STATUS_NO_BARS : l.STATUS_INVALID_SYMBOL), a && a.startsWith("study_not_auth:") ? (h = a.split(":", 2)[1].split("@", 2)[0], h in { BarSetRenko: !0, BarSetPriceBreak: !0, BarSetKagi: !0, BarSetPnF: !0 } ? this.chartTypeNotPermitted.fire(h) : "BarSetSpread" === h && this.intradaySpreadNotPermitted.fire()) : "resolution_not_entitled" === a ? this.intradayExchangeNotPermitted.fire() : "custom_resolution" === a && this.customIntervalNotPermitted.fire(), this._seriesLoaded = !0;
                    break;
                case "series_loading":
                    if (t.params[1] !== this._turnaround) break;
                    if (t.params[0] !== this._seriesId) { U.logNormal("command for old series. Expected:" + this._seriesId + ", actual" + t.params.customId); break }
                    this._setStatus(l.STATUS_LOADING), w._loadingStartTime = (new Date).getTime();
                    break;
                case "series_completed":
                    if (t.params[2] !== this._turnaround) break;
                    if (t.params[0] !== this._seriesId) { U.logNormal("command for old series. Expected:" + this._seriesId + ", actual" + t.params.customId); break }
                    switch (c = "chartSession:" + w._chartApi._sessionid, d = (new Date).getTime() - this._loadingStartTime, U.logDebug(c + ", Series loading took " + d + " ms, eod:" + this._endOfData), delete this._loadingStartTime, p = t.params[1], "pulsed" === p && (p = "delayed"), p) {
                        case "streaming":
                            this._setStatus(l.STATUS_READY);
                            break;
                        case "endofday":
                            this._setStatus(l.STATUS_EOD);
                            break;
                        case "delayed":
                            this._setStatus(l.STATUS_DELAYED);
                            break;
                        case "pulsed":
                            this._setStatus(l.STATUS_PULSE)
                    }
                    p.match(/delayed_streaming/) && this._setStatus(l.STATUS_DELAYED_STREAMING), u = this.m_model.paneForSource(this), u.recalculatePriceScale(this.priceScale()), this.m_model.invalidate(new M(M.FULL_UPDATE)), this.m_data.size() && this._tickmarksRangeChanged.fire({ start: this.data().first().value[TradingView.TIME_PLOT], end: this.data().last().value[TradingView.TIME_PLOT] }), this.model().recalcVisibleRangeStudy(this.model().dataSources(), !0), this.model().recalcStudyBasedLineTools(), !this.isLockScale() || this.model().timeScale().isEmpty() || this._seriesLoaded || (this.model().timeScale()._correctOffset(), this.model().timeScale().correctBarSpacing(), _ = this.model().timeScale().visibleBars(), this.priceScale().setPriceRange(this.priceRange(_.firstBar(), _.lastBar()))),
                        this._seriesLoaded = !0, this._onCompleted.fire(this._endOfData), this.requestMoreData();
                    break;
                case "series_deleted":
                    break;
                case "data_update":
                    if (t.params.customId !== this._seriesId) { U.logNormal("command for old series. Expected:" + this._seriesId + ", actual" + t.params.customId); break }
                    if (this.status() === l.STATUS_INVALID_SYMBOL) break;
                    t.params.plots.length ? (f = this.m_data.m_bars.size(), m = this.m_data.m_bars.first(), g = void 0 !== m ? m.valueOf() : null, v = this.m_data.m_bars.merge(t.params.plots), (null === g || v.earliestRow.index < g) && (this._endOfData = !1), y = "Merge bars. Changes:{length:" + v.length + ", earliestRow:" + v.earliestRow.index + "} ", y += "bars state:{firstBar:" + this.m_data.m_bars.first() + ",lastBar:" + this.m_data.m_bars.last() + ",size:" + this.m_data.m_bars.size() + "}", j.logDebug(y), f !== this.bars().size() && (this._barReceived.fire(this.m_data.m_bars.size()), this.model().recalcVisibleRangeStudy(this.model().dataSources(), !0))) : (this.m_data.clear(), this._startLoading.fire()), new Promise(function(e) {
                        var i = w.properties().style.value();
                        !t.params.nonseries || i !== l.STYLE_RENKO && i !== l.STYLE_KAGI && i !== l.STYLE_PNF && i !== l.STYLE_HEIKEN_ASHI && i !== l.STYLE_PB ? (t.params.nonseries || (w.m_data.m_nsBars.clear(), w.m_data.lastProjectionPrice = void 0), e(), e()) : w.parseJapProjBars(t.params.nonseries).then(function(t) {
                            w.m_data.m_nsBars = t.nsBars, w.m_data.lastProjectionPrice = t.lastPrice;
                            var i = w.m_data.boxSize !== t.boxSize;
                            w.m_data.boxSize = t.boxSize, w.m_data.reversalAmount = t.reversalAmount, i && w._boxSizeChanged.fire(w.m_data.boxSize), e()
                        })
                    }).then(function() {
                        var t = w.m_model.paneForSource(w);
                        w.m_model.updateAllVolumeStudies(), w.m_model.recalculatePane(t), w.m_model.updateSource(w), w.m_model.updateLineTools(), w.m_model.updateCrossHair()
                    })
            }
            this._dataLoaded.fire(t)
        }, l.prototype.fixBoxSize = function() {
            var t = this.model().timeScale(),
                e = this.priceScale();
            e.isEmpty() || t.isEmpty() || (this.m_data.boxSize = Math.abs(e.coordinateToPrice(t.barSpacing()) - e.coordinateToPrice(0)))
        }, l.prototype.parseJapProjBars = function(t) {
            var e, i, o, n = new B(["time", "open", "high", "low", "close", "adt", "style"]),
                s = this.model().timeScale(),
                r = this.properties().style.value(),
                a = this;
            return new Promise(function(h) {
                t.d && "" !== t.d ? TradingView.Study.prototype._makeJSONForNSData.call(a, { params: { nonseries: t } }).then(function(a) {
                    var c, d, p, u, _ = a.data;
                    for (e = _.price, i = _.boxSize, o = _.reversalAmount, c = _.bars, d = 0; c && d < c.length; d++) p = [], u = t.indexes[c[d].time], p.push(s.points().valueAt(u)), p.push(c[d].open), p.push(c[d].high), p.push(c[d].low), p.push(c[d].close), p.push(c[d].volume), r === l.STYLE_KAGI ? p.push(c[d].additionalPrice) : r === l.STYLE_PNF && p.push(c[d].factor), n.add(u, p);
                    h({ nsBars: n, lastPrice: e, boxSize: i, reversalAmount: o })
                }) : h({ nsBars: n, lastPrice: e, boxSize: i, reversalAmount: o })
            })
        }, l.prototype.disconnect = function() { this._symbolId = null, this._seriesId = null, this._predictBars = 0, this._status = l.STATUS_OFFLINE }, l.prototype.isStarted = function() { return !!this._symbolId }, l.prototype.restart = function() {
            var t, e = i(153);
            this._onRestarted.fire(), this._setStatus(l.STATUS_RESOLVING), this.m_data = new E(this, this.model()), this._prevSymbolId = this._symbolId,
                this._symbolId = this._makeNextSymbolId(), t = this._properties.interval.value(), this._pendingTimeRange && (t = this._generateTimeframe(t, this._pendingTimeRange), delete this._pendingTimeRange), this._chartApi.resolveSymbol(this._symbolId, this.getSymbolString(), this._handler), this._seriesId ? (this._turnaround = "s" + ++this._turnaroundCounter, this._chartApi.modifySeries(this._seriesId, this._turnaround, this._symbolId, t, this._handler, this._prevSymbolId)) : (this._seriesId = this._makeNextSeriesId(), !1 === this._chartApi.createSeries(this._seriesId, this._turnaround, this._symbolId, t, this._prepareChartApiParams(), this._handler) && (this._seriesId = void 0)), this._properties.showInDataWindow.listeners().subscribe(this.m_model, e.prototype.fullUpdate), this.m_symbol = this._properties.symbol.value(), this.m_interval = this._properties.interval.value()
        }, l.prototype._generateTimeframe = function(t, e) {
            var i, o = e.right(1),
                n = t;
            return "ytd" === e ? n += ",YTD" : "d" === o ? (i = e.left(e.length - 1), n += "," + i, b.enabled("daily_timeframe_suffix") && (n += "D")) : "m" === o ? (i = e.left(e.length - 1), n += "," + i + "M") : "all" === e && (n += ",ALL"), n
        }, l.prototype.hasDelayedSymbolIntervalChange = function() { return !!this._setSymbolIntervalDelay }, l.prototype.setSymbolIntervalDelayed = function() { this._isDWMCached = null, (this._checkSymbolWillChanged(this._properties.symbol.value()) || this._checkIntervalWillChanged(this._parseInterval(this._properties.interval.value()).interval)) && (this._setSymbolIntervalDelay && clearTimeout(this._setSymbolIntervalDelay), this._setSymbolIntervalDelay = setTimeout(function() { delete this._setSymbolIntervalDelay, this._setSymbolInterval(this._properties.symbol.value(), this._properties.interval.value()) }.bind(this), 30)) }, l.prototype._checkSymbolWillChanged = function(t) { return !this.symbolSameAsCurrent(t) || b.enabled("same_data_requery") }, l.prototype._checkIntervalWillChanged = function(t) { return this.m_interval !== t || b.enabled("same_data_requery") }, l.prototype._parseInterval = function(t) { var e = (t + "").split(","); return { interval: 2 === e.length ? e[0] : t, timeframe: 2 === e.length ? e[1] : 0 } }, l.prototype.rerequestData = function() { this._setSymbolInterval(this.m_symbol, this.m_interval, !0) }, l.prototype._setSymbolInterval = function(t, e, i) {
            var o, n, s, r, a, h;
            delete this._gotoDateResult, o = this._parseInterval(e), n = o.interval, s = o.timeframe, r = this._checkSymbolWillChanged(t), a = this._checkIntervalWillChanged(n), (r || a || i) && (this._syncModel = null, this.m_symbol = t, this.m_interval = n, this.m_timeframe = s, this._symbolId && !r || this.updateSymbolInfo(null), this.m_model.realignLineTools(), this._status !== l.STATUS_SNAPSHOT && (this._setStatus(l.STATUS_RESOLVING), this._symbolIntervalChanged.fire(), a && (h = { timeframe: this._pendingTimeRange }, this._intervalChanged.fire(this.m_interval, h), this._pendingTimeRange = h.timeframe && h.timeframe.toLowerCase()), this._onRestarted.fire(), this._seriesLoaded = !1, this._chartApi && this._chartApi.connected() && (this._symbolId && !r || (this._prevSymbolId = this._symbolId, this._symbolId = this._makeNextSymbolId(), this._chartApi.resolveSymbol(this._symbolId, this.getSymbolString(), this._handler)),
                this._seriesId ? (this._turnaround = "s" + ++this._turnaroundCounter, this._pendingTimeRange && (e = this._generateTimeframe(e, this._pendingTimeRange), delete this._pendingTimeRange), this._predictBars = 0, this._chartApi.modifySeries(this._seriesId, this._turnaround, this._symbolId, e, this._handler, this._prevSymbolId)) : (this._seriesId = this._makeNextSeriesId(), this._chartApi.createSeries(this._seriesId, this._turnaround, this._symbolId, e, this._prepareChartApiParams(), this._handler)))))
        }, l.prototype.setDefaultTimeframe = function(t) { this._pendingTimeRange = t }, l.prototype.actualSymbol = function() { return this.symbolInfo() ? this.symbolInfo().full_name : this.symbol() }, l.prototype.proSymbol = function() { return this.symbolInfo() ? this.symbolInfo().pro_name : this.symbol() }, l.prototype.symbol = function() { return this.properties().symbol.value() }, l.prototype.interval = function() { return this.properties().interval.value() }, l.prototype.isIntradayInterval = function() { return !!/^\d*$/.test(this.interval()) && this.interval() <= 1440 }, l.prototype.bars = function() { return this.m_data.m_bars }, l.prototype.nsBars = function() { return this.m_data.m_nsBars }, l.prototype.open = function(t) { return this.m_data.valueAt(t)[TradingView.OPEN_PLOT] }, l.prototype.high = function(t) { return this.m_data.valueAt(t)[TradingView.HIGH_PLOT] }, l.prototype.low = function(t) { return this.m_data.valueAt(t)[TradingView.LOW_PLOT] }, l.prototype.close = function(t) { return this.m_data.valueAt(t)[TradingView.CLOSE_PLOT] }, l.prototype.hl2 = function(t) { return (this.high(t) + this.low(t)) / 2 }, l.prototype.hlc3 = function(t) { return (this.high(t) + this.low(t) + this.close(t)) / 3 }, l.prototype.ohlc4 = function(t) { return (this.open(t) + this.high(t) + this.low(t) + this.close(t)) / 4 }, l.prototype.priceRange = function(t, e) {
            var i, o, s, r, a, l, h, c;
            return TradingView.isInteger(t) ? TradingView.isInteger(e) ? this.data().isEmpty() ? null : (o = this.data().boxSize, this.isLockScale() ? (void 0 === o && this.fixBoxSize(), s = this.priceScale().internalHeight() / (this.model().timeScale().barSpacing() / this.data().boxSize), r = this.data().search(e, TradingView.SEARCH_NEAREST_LEFT), a = (r.value[TradingView.HIGH_PLOT] + r.value[TradingView.LOW_PLOT]) / 2, i = new n(a - .5 * s, a + .5 * s), l = this.data().search(t, TradingView.SEARCH_NEAREST_RIGHT), this.priceScale().properties().percentage.value() && i ? i.convertToPercents(l.value[TradingView.CLOSE_PLOT]) : i) : (h = this.data().bars().minMaxOnRange2(t, e, [{ index: TradingView.LOW_PLOT, offset: 0 }, { index: TradingView.HIGH_PLOT, offset: 0 }]), c = this.data().nsBars().minMaxOnRange(t, e, [{ index: TradingView.LOW_PLOT, offset: 0 }, { index: TradingView.HIGH_PLOT, offset: 0 }]), null != c.min && (h.min = Math.min(h.min, c.min)), null != c.max && (h.max = Math.max(h.max, c.max)), i = new n(h.min, h.max), i.minValue() === i.maxValue() && (i = new n(i.minValue() - .5, i.maxValue() + .5)), this.priceScale().properties().percentage.value() && i ? (l = this.data().search(t, TradingView.SEARCH_NEAREST_RIGHT),
                l ? i.convertToPercents(l.value[TradingView.CLOSE_PLOT]) : null) : this.priceScale().isLog() && i ? new n(this.priceScale().priceToLogical(i.minValue()), this.priceScale().priceToLogical(i.maxValue())) : i)) : (U.logDebug("Series.priceRange: incorrect endBar"), null) : (U.logDebug("Series.priceRange: incorrect startBar"), null)
        }, l.prototype.nearestData = function(t, e) { return TradingView.isInteger(t) ? this.data().search(t, e) || void 0 : void U.logDebug("Series.nearestData: incorrect logicalPoint") }, l.prototype.nearestIndex = function(t, e) { var i = this.nearestData(t, e); return i ? i.index : void 0 }, l.prototype.paneViews = function(t) { if (!this.properties().visible.value()) return null; var e = [this._paneView]; return this._futureBarsPaneView && e.push(this._futureBarsPaneView), this._projectionBarsPaneView && e.push(this._projectionBarsPaneView), e.push(this._priceLineView), e.push(this._symbolLabelView), e.push(this._gotoDateView), e }, l.prototype.dataWindowView = function() { return this._dataWindowView }, l.prototype.statusView = function() { return this._statusView }, l.prototype.priceAxisViews = function(t, e) { return this.m_model.paneForSource(this) === t && e === this.priceScale() && (this.m_model.properties().scalesProperties.showSeriesLastValue.value() || this.properties().showCountdown.value()) ? this._priceAxisViews : null }, l.prototype.base = function() { return this._base }, l.prototype.formatter = function() { return this._formatter }, l.prototype.purgeSymbolInfo = function() { this._symbolInfo = null }, l.prototype.symbolInfo = function() { return this._symbolInfo }, l.prototype._recreateFormatter = function() { var t, e, i, o; "default" === this.properties().minTick.value() ? this._formatter = new V(this._symbolInfo ? this._symbolInfo.pricescale : 100, this._symbolInfo ? this._symbolInfo.minmov : 1, !!this._symbolInfo && this._symbolInfo.fractional, this._symbolInfo ? this._symbolInfo.minmove2 : void 0) : (t = this.properties().minTick.value().split(","), e = parseInt(t[0]), i = parseInt(t[1]), o = "true" === t[2], this._formatter = new V(e, i, o)), this.priceScale() && this.priceScale().updateFormatter() }, l.prototype.updateSymbolInfo = function(t) {
            var e = this,
                i = t && (t.pro_name || t.full_name || t.name);
            b.enabled("charting_library_single_symbol_request") && this.m_symbol && (i = this.m_symbol), this._symbolInfo = t, t && (this._properties.shortName.setValue(t.name), i && this._properties.symbol.value().toUpperCase() !== i.toUpperCase() && this._properties.symbol.setValue(i)), this._base = t ? t.pricescale / t.minmov : 100, this._recreateFormatter(), this._statusView.update(), this.priceScale().updateFormatter(), "undefined" != typeof quoteSessionMultiplexerInstance && this._quoteSessionSymbol !== i && (this._quoteSessionClientId || (this._quoteSessionClientId = "series-" + W.guid()), this._quoteSessionSymbol && (quoteSessionMultiplexerInstance.simple.unsubscribe(this._quoteSessionClientId, this._quoteSessionSymbol), this._quoteSessionSymbol = void 0), i && (this._quoteSessionSymbol = i, quoteSessionMultiplexerInstance.simple.subscribe(this._quoteSessionClientId, this._quoteSessionSymbol, function(t, i) { e.quoteData = t && t.values || null, i && i.values && i.values.current_session && e.marketStatus.setValue(i.values.current_session) }))),
                this.checkInterval(), this.dataPoweredBy = A(t)
        }, l.prototype.symbolSameAsCurrent = function(t) { if (this.m_symbol === t) return !0; var e = this._symbolInfo; if (e) { if (e.full_name === t || e.pro_name === t) return !0; if (e.ticker === t) return !0; if (e.aliases && -1 !== e.aliases.indexOf(t)) return !0; if (e.alternatives && -1 !== e.alternatives.indexOf(t)) return !0 } return !1 }, l.prototype.updateAllViews = function() { this._paneView.update(), this._dataWindowView.update(), this._statusView.update(), this._priceAxisViews[0].update(), this._priceAxisViews[1].update(), this._futureBarsPaneView && this._futureBarsPaneView.update(), this._projectionBarsPaneView && this._projectionBarsPaneView.update(), this._priceLineView.update(), this._gotoDateView.update(), this._symbolInfo && this._symbolLabelView.update() }, l.prototype._setStatus = function(t) { this._status = t, this._statusView.update(), this.m_model.updateSource(this), this._onStatusChanged.fire() }, l.prototype.requestMoreData = function(t) {
            var e, i, o, n;
            this._status !== l.STATUS_READY && this._status !== l.STATUS_PULSE && this._status !== l.STATUS_DELAYED && this._status !== l.STATUS_DELAYED_STREAMING && this._status !== l.STATUS_EOD || this.m_model.timeScale().isEmpty() || (e = this.m_model.timeScale().visibleBars(), e.isEmpty() || 0 !== this.bars().size() && (i = t || e.lastBar() - this.data().last(), this._predictBars < i && (this._predictBars = i, this._chartApi && this._chartApi.connected() && this._chartApi.requestMoreTickmarks(this._seriesId, i, this._handler)), this._endOfData || (o = this.bars()._indexAt(0), (n = t || o - e.firstBar()) <= 0 || (this._endOfData = !0, this._chartApi && this._chartApi.connected() && (this._chartApi.requestMoreData(this._seriesId, n, this._handler), b.enabled("charting_library_base") && (this._predictBars = 0)), this._setStatus(l.STATUS_LOADING)))))
        }, l.prototype.bindStyleChange = function() {
            var t = this;
            ["candleStyle", "hollowCandleStyle", "haStyle", "barStyle", "lineStyle", "areaStyle", "renkoStyle", "pbStyle", "kagiStyle", "pnfStyle"].forEach(function(e) { t._properties[e].listeners().subscribe(t, l.prototype.invalidateBarStylesCache) })
        }, l.prototype.bindJapChartsInputs = function() {
            this._properties.style.listeners().subscribe(this, this.onChartStyleChanged), this._properties.renkoStyle.inputs.boxSize.listeners().subscribe(this, this.onInputChanged), this._properties.renkoStyle.inputs.source.listeners().subscribe(this, this.onInputChanged), this._properties.renkoStyle.inputs.style.listeners().subscribe(this, this.onInputChanged), this._properties.renkoStyle.inputs.atrLength.listeners().subscribe(this, this.onInputChanged), this._properties.pbStyle.inputs.lb.listeners().subscribe(this, this.onInputChanged), this._properties.pbStyle.inputs.source.listeners().subscribe(this, this.onInputChanged), this._properties.kagiStyle.inputs.reversalAmount.listeners().subscribe(this, this.onInputChanged), this._properties.kagiStyle.inputs.style.listeners().subscribe(this, this.onInputChanged), this._properties.kagiStyle.inputs.atrLength.listeners().subscribe(this, this.onInputChanged), this._properties.kagiStyle.inputs.source.listeners().subscribe(this, this.onInputChanged),
                this._properties.pnfStyle.inputs.boxSize.listeners().subscribe(this, this.onInputChanged), this._properties.pnfStyle.inputs.reversalAmount.listeners().subscribe(this, this.onInputChanged), this._properties.pnfStyle.inputs.sources.listeners().subscribe(this, this.onInputChanged), this._properties.pnfStyle.inputs.style.listeners().subscribe(this, this.onInputChanged), this._properties.pnfStyle.inputs.atrLength.listeners().subscribe(this, this.onInputChanged);
            var t = this;
            this._properties.lockScale.listeners().subscribe(this, function(e) { e.value() && t.model().timeScale().recalcLockedScale() })
        }, l.prototype.createExtendedHoursProperty = function() {
            function t() {
                var t = "undefined" != typeof productFeatures && b.enabled(productFeatures.EXTENDED_SESSION),
                    i = e.model().readOnly(),
                    o = e._properties.extendedHours.value(),
                    n = b.enabled("widget");
                !o || n || i || t || (e._extendedHoursNotPermitted.fire(), o = !1), o && !e.isIntradayInterval() && (o = !1), e.extendedHours.setValue(o)
            }
            var e = this;
            e.extendedHours = new s, e._properties.extendedHours.listeners().subscribe(null, t), e._properties.interval.listeners().subscribe(null, t), e.chartWidgetInitialized.subscribe(null, t), t()
        }, l.prototype.isNeedRestart = function(t) { if (void 0 === t && (t = this.properties().style.value()), this._prevChartStyle !== t) { var e = [l.STYLE_BARS, l.STYLE_CANDLES, l.STYLE_HOLLOW_CANDLES, l.STYLE_LINE, l.STYLE_AREA]; if (!(e.indexOf(this._prevChartStyle) > -1 && e.indexOf(t) > -1)) return !0 } return !1 }, l.prototype.onChartStyleChanged = function() { this.isNeedRestart() && (this.data().clear(), this.model().timeScale().scrollToRealtime(!1), this.restart()), this._prevChartStyle = this.properties().style.value(), this._onChangedStyle.fire(this.properties().style.value()), this.invalidateBarStylesCache() }, l.prototype.onInputChanged = function() { this.restart() }, l.prototype.onExtendedHoursChanged = function() { return this._extendedHoursChanged }, l.prototype.getSymbolString = function() { var t, e, i; return t = b.enabled("pay_attention_to_ticker_not_symbol") && this._symbolInfo ? this._symbolInfo.ticker : this.actualSymbol(), this.extendedHours.value() && (t = { symbol: t, session: "extended" }), l._SYMBOL_STRING_DATA.hasOwnProperty(this._properties.style.value()) && (e = this.getInputsProperties(), i = l._SYMBOL_STRING_DATA[this._properties.style.value()], t = { symbol: t, type: i.type, inputs: i.inputNames.map(function(t) { return e[t].value() }) }), "string" != typeof t && (t = "=" + JSON.stringify(t)), t }, l.parseSymbolString = function(t) {
            var e, i, o, n, s, r, a, h = Object.keys(l._SYMBOL_STRING_DATA),
                c = { symbol: null, style: null, extendedHours: null, inputs: null };
            if (t && 0 === t.indexOf("=")) {
                if (e = t.slice(1), e = JSON.parse(e), c.symbol = e.symbol, e.type)
                    for (r = 0; r < h.length; r++)
                        if (o = h[r], i = l._SYMBOL_STRING_DATA[o], i.type === e.type) { for (c.style = parseInt(o), c.inputs = {}, a = 0; a < i.inputNames.length; a++) s = e.inputs[a], n = i.inputNames[a], c.inputs[n] = s; break }
                        "extended" === c.symbol.session && (c.extendedHours = !0, c.symbol = c.symbol.symbol)
            } else c.symbol = t;
            return c
        }, l.prototype.getStyleShortName = function() {
            var t = this._properties.style.value();
            if (l.STYLE_SHORT_NAMES.hasOwnProperty(t)) return l.STYLE_SHORT_NAMES[t];
            throw Error("Missed short name for style " + t)
        }, l.prototype.getInputsProperties = function() { return this._properties[this.getStyleShortName() + "Style"].inputs || new s }, l.prototype.getRealVisibleRange = function() {
            var t = this.model().timeScale().visibleBars(),
                e = this.data().search(t.m_firstBar, TradingView.SEARCH_NEAREST_RIGHT),
                i = this.data().search(t.m_lastBar, TradingView.SEARCH_NEAREST_LEFT);
            return void 0 === e || void 0 === i ? null : new w(e.index, i.index)
        }, l.prototype.isLockScale = function() { return this.properties().lockScale.value() }, l.prototype.firstValue = function() { return this.data().firstValue() }, l.prototype.firstBar = function() { return this.data().firstBar() };
        l.prototype.sessionsStudy = function() {
            var t, e, i, o;
            if (this._sessionsStudy) return this._sessionsStudy;
            for (t = this.model().paneForSource(this), e = t.dataSources(), i = 0; i < e.length; i++)
                if ((o = e[i]) instanceof TradingView.Study && "Sessions" === o.metaInfo().shortId) return this._sessionsStudy = o, this._sessionsStudy;
            return !1
        }, l.prototype.createSessStudy = function() {
            if (!b.enabled("charting_library_base") && !this.sessionsStudy()) {
                var t = R.findStudyMetaInfo(this.model().studiesMetaData(), "Sessions@tv-basicstudies");
                this.model().insertStudy(t, !1, !0), this._onSessionsStudyCreated.fire()
            }
        }, l.prototype.checkSessStudy = function() { b.enabled("charting_library_base") || (this.sessionsStudy() || this.createSessStudy(), this.sessionsStudy().start()) }, l.prototype.isSpread = function() { return "spread" === this._symbolInfo.type }, l.prototype.firstSymbol = function() { return this._symbolInfo ? this._symbolInfo.legs[0] : "" }, l.prototype.firstShortName = function() { return O.ticker(this.firstSymbol()) }, l.prototype.onSessionsStudyCreated = function() { return this._onSessionsStudyCreated }, l.prototype.loadDataTo = function(t) {
            this._turnaround = "s" + ++this._turnaroundCounter;
            var e = this._properties.interval.value();
            e = this._generateTimeframe(e, t), this._chartApi.modifySeries(this._seriesId, this._turnaround, this._symbolId, e, this._handler)
        }, l.prototype.checkInterval = function() { if (this._symbolInfo && (k.kind(this.interval()) !== k.MINUTES || this._symbolInfo.has_intraday || this.requestingIntradayWhenNotSupported.fire(), this._symbolInfo.hasOwnProperty("supported_resolutions"))) { var t = this._properties.interval.value(); - 1 === this._symbolInfo.supported_resolutions.indexOf(t) && this.requestingResolutionWhenNotSupported.fire(this._symbolInfo.supported_resolutions[0]) } }, l.prototype.setPriceScale = function(t) { this.m_priceScale !== t && (this.m_priceScale = t, this.priceScaleChanged.fire(t)) }, l.prototype.setGotoDateResult = function(t) { this._gotoDateResult = t }, l.prototype.gotoDateResult = function() { return this._gotoDateResult }, l.prototype.syncModel = function() {
            var t, e;
            if (!this._syncModel) {
                if (t = this.symbolInfo(), e = this.interval(), !t || !e) return null;
                this._syncModel = new N(t, e)
            }
            return this._syncModel
        }, l.prototype.turnaround = function() { return this._turnaround }, TradingView.Series = l, t.exports = l
    }).call(e, i(15), i(41), i(107), i(24))
}, function(t, e) {
    "use strict";

    function i(t, e) { if (!t) throw Error("Assertion failed" + (e ? ": " + e : "")) }
    Object.defineProperty(e, "__esModule", { value: !0 }), e.assert = i
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { this._data = t, this._hittestResult = e || new c(c.MOVEPOINT), this._backHittestResult = i || new c(c.MOVEPOINT_BACKGROUND) }

    function n(t, e) { h.call(this, t, e), this._invalidated = !0 }

    function s(t, e) {
        this._constructor = "LineToolRectangle";
        var i = e || new p("linetoolrectangle");
        l.call(this, t, new n(this, t), i)
    }

    function r(t, e, i) { o.call(this, t, e, i) }
    var a = i(2),
        l = i(1).LineDataSource,
        h = i(9),
        c = i(8),
        d = i(6),
        p = i(7).DefaultProperty,
        u = i(14);
    o.prototype.getColor = function() { return u.generateColor(this._data.backcolor, this._data.transparency) }, o.prototype.draw = function(t) {
        var e, i, o;
        this._data.points.length < 2 || (t.lineCap = "butt", t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, t.lineStyle = this._data.linestyle, e = this._data.points[0], i = this._data.points[1], o = i.substract(e), t.beginPath(), t.rect(e.x, e.y, o.x, o.y), this._data.linewidth > 0 && t.stroke(), this._data.fillBackground && (t.fillStyle = this.getColor(), t.fill()))
    }, o.prototype.hitTest = function(t) { var e, i, o, n, s, r, l, h, c, d; return this._data.points.length < 2 || this._data.nohittest ? null : (e = 3, i = this._data.points[0], o = this._data.points[1], n = new a.Point(o.x, i.y), s = new a.Point(i.x, o.y), r = a.distanceToSegment(i, n, t), r.distance <= e ? this._hittestResult : (r = a.distanceToSegment(n, o, t), r.distance <= e ? this._hittestResult : (r = a.distanceToSegment(o, s, t), r.distance <= e ? this._hittestResult : (r = a.distanceToSegment(s, i, t), r.distance <= e ? this._hittestResult : this._data.fillBackground && (l = Math.min(i.x, o.x), h = Math.max(i.x, o.x), c = Math.min(i.y, o.y), d = Math.max(i.y, o.y), i = new a.Point(l, c), o = new a.Point(h, d), a.pointInRect(t, i, o)) ? this._backHittestResult : null)))) }, inherit(n, h), n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() { h.prototype.update.call(this), this._invalidated = !1 }, n.prototype.renderer = function() { var t, e, i, n, s, r; return this._invalidated && this.updateImpl(), t = {}, t.points = this._points, t.color = this._source.properties().color.value(), t.linewidth = this._source.properties().linewidth.value(), t.backcolor = this._source.properties().backgroundColor.value(), t.fillBackground = this._source.properties().fillBackground.value(), t.transparency = this._source.properties().transparency.value(), this.isAnchorsRequired() ? (e = new d, e.append(new o(t)), i = this._points[0], n = this._points[1], s = new a.Point(i.x, n.y), s.data = 2, r = new a.Point(n.x, i.y), r.data = 3, e.append(this.createLineAnchor({ points: [i, n, s, r] })), e) : new o(t) }, inherit(s, l), s.prototype.pointsCount = function() { return 2 }, s.prototype.title = function() { return "Rectangle" }, s.prototype.setPoint = function(t, e, i) {
        var o, n, s;
        if (t < 2) return void l.prototype.setPoint.call(this, t, e, i);
        i && i.shift && this._properties.snapTo45Degrees && (o = this.points()[0], n = this.points()[1], s = { price: 2 === t ? o.price : n.price, index: 2 === t ? n.index : o.index }, this._snapPoint45Degree(e, s)), this._convertPriceFromPercentIfNeeded(e), 3 === t ? (this._points[0].price = e.price, this._points[1].index = e.index) : (this._points[1].price = e.price, this._points[0].index = e.index), this.normalizePoints()
    }, inherit(r, o), r.prototype.getColor = function() {
        return u.generateColor(this._data.backcolor, this._data.transparency, !0)
    }, e.RectangleRenderer = o, e.RectangleTransparencyRenderer = r, e.LineToolRectangle = s
}, function(t, e, i) {
    "use strict";

    function o(t) {
        var e = $('<div class="transparency-slider"><div class="gradient"></div></div>').slider({ max: 100, min: 0, step: 1 }),
            i = ["-moz-linear-gradient(left, %COLOR 0%, transparent 100%)", "-webkit-gradient(linear, left top, right top, color-stop(0%,%COLOR), color-stop(100%,transparent))", "-webkit-linear-gradient(left, %COLOR 0%,transparent 100%)", "-o-linear-gradient(left, %COLOR 0%,transparent 100%)", "linear-gradient(to right, %COLOR 0%,transparent 100%)"];
        return e.updateColor = function(t) {
            var o = e.find(".gradient");
            i.forEach(function(e) { o.css("background-image", e.replace(/%COLOR/, t)) })
        }, t ? (e.updateColor(t.val() || "black"), t.on("change", function(t) { e.updateColor(t.target.value) })) : e.updateColor("black"), e
    }
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17), e.createTransparencyEditor = o
}, function(t, e, i) {
    (function(t) {
        "use strict";

        function o(e) { e || (e = {}), this.checkable = e.checkable || !1, this.checked = e.checked || null, this.enabled = void 0 === e.enabled || e.enabled, this.visible = e.visible || !0, this.active = !0, this.font = e.font || "Arial", this.icon = e.icon || null, this.iconText = e.iconText || null, this.iconVisibleInMenu = e.iconVisibleMenu || !0, this.deleteButton = e.deleteButton || null, this.shortcut = null, this.setShortCut(e.shortcut, e.doNotBindShortcut), this.statusTip = e.statusTip || null, this.text = e.text || null, this.toolTip = e.toolTip || null, this.htmlclass = e.htmlclass || null, this._callbackContext = e.callbackContext || this, this._callbacks = new t, this.subActions = e.subActions || [] }

        function n() { o.call(this), this.font = null, this.subActions = null, this.htmlclass = "action-separator" }

        function s(t) { o.call(this), this.deferred = t }
        var r = i(366);
        o.prototype.callbacks = function() { return this._callbacks }, o.prototype.callbackContext = function() { return this._callbackContext }, o.prototype.setCallbackContext = function(t) { this._callbackContext = t }, o.prototype.hasSubActions = function() { return this.subActions && this.subActions.length }, o.prototype.setChecked = function(t) { this.checked = t }, o.prototype._toggleChecked = function() { this.checked = !this.checked }, o.prototype.setVisible = function(t) { this.visible = t }, o.prototype.setEnabled = function(t) { this.enabled = t }, o.prototype.disable = function() { this.setEnabled(!1) }, o.prototype.enable = function() { this.setEnabled(!0) }, o.prototype.setActive = function(t) { this.active !== t && (this.active = t, this.shortcut && !this.doNotBindShortcut && (t ? this._bindShortCut() : this._unbindShortCut())) }, o.prototype.setShortCut = function(t, e) { t && (this.shortcut = t, !0 !== e && this._bindShortCut()) }, o.prototype._bindShortCut = function() { r.bind(this.shortcut, function(t) { if (t.preventDefault(), this.enabled) return this.executeCallback(), !1 }.bind(this)) }, o.prototype._unbindShortCut = function() { r.unbind(this.shortcut) }, o.prototype.setIconVisible = function(t) { this.iconVisibleInMenu = t }, o.prototype.executeCallback = function(t) { this._lastEvent = t, this._toggleChecked(), this._callbacks.fire(this) }, inherit(n, o), inherit(s, o), e.Action = o,
            e.ActionSeparator = n, e.ActionPlaceholder = s
    }).call(e, i(15))
}, function(t, e, i) {
    (function(t) {
        "use strict";

        function o() { this._zorder = 0, this.m_priceScale = null, this._id = r.randomHashN(6), this._ownerSource = null, this._userEditEnabled = !0, this.hasAlert = new t(!1) }

        function n(t) { o.call(this), this._isOverlay = null, this._model = t }
        var s = i(7).DefaultProperty,
            r = i(60);
        o.prototype.createPropertiesObject = function(t, e, i) { return new s(t, e, i) }, o.prototype.id = function() { return this._id }, o.prototype.uniqueId = function() { return this._id }, o.prototype.setId = function(t) { this._id = t }, o.prototype.zorder = function() { return this._zorder }, o.prototype.setZorder = function(t) { "number" == typeof t && this._zorder !== t && (this._zorder = t) }, o.prototype.title = function() { throw Error("Implement this fun in a subclass") }, o.prototype.priceScale = function() { return this.m_priceScale }, o.prototype.setPriceScale = function(t) { this.m_priceScale = t }, o.prototype.ownerSource = function() { return this._ownerSource }, o.prototype.setOwnerSource = function(t) { this._ownerSource = t, t && this.setPriceScale(t.priceScale()) }, o.prototype.isSavedInChart = function(t) { return !0 }, o.prototype.isSavedInStudyTemplates = function() { return !0 }, o.prototype.isRemovedByStudyTemplates = function() { return !0 }, o.prototype.hasContextMenu = function() { return !0 }, o.prototype.showInObjectTree = function() { return !0 }, o.prototype.setUserEditEnabled = function(t) { this._userEditEnabled = t }, o.prototype.userEditEnabled = function() { return this._userEditEnabled }, o.prototype.canBeHidden = function() { return this.userEditEnabled() }, o.prototype.isUserDeletable = function() { return this.userEditEnabled() }, o.prototype.canHasAlert = function() { return !1 }, o.prototype.properties = function() { throw Error("Implement this fun in a subclass") }, o.prototype.statusView = function() { return null }, o.prototype.dataWindowView = function() { return null }, o.prototype.priceAxisViews = function(t, e) { return null }, o.prototype.updateAllViews = function() {}, o.prototype.paneViews = function(t) { return null }, o.prototype.isChildStudy = function() { return !1 }, o.prototype.hasChildren = function() { return !1 }, o.prototype.canHaveChildren = function() { return !1 }, o.prototype.onClickOutside = function() {}, inherit(n, o), n.prototype.isNoScale = function() { return !!this._isOverlay }, n.prototype.base = function() { return 0 }, n.prototype.formatter = function() { return null }, n.prototype.model = function() { return this._model }, n.prototype.priceRange = function(t, e) { return null }, n.prototype.isDraggable = function() { return !this._metaInfo || !this._metaInfo.linkedToSeries }, e.DataSource = o, e.PriceDataSource = n
    }).call(e, i(41))
}, 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(104);
    inherit(o, m), o.prototype._studyInputs = function() {
        var t, e, i, o, n = this.points();
        if (n.length < this.pointsCount()) return null;
        for (t = [this.properties().inputs.displayZoneLabels.value()], e = 0; e < this.pointsCount(); ++e) {
            if (i = n[e].index, !(o = this._model.mainSeries().bars().valueAt(i))) return null;
            t.push(1e3 * o[TradingView.TIME_PLOT])
        }
        return t
    }, 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) { 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) {
    "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(2),
        c = i(9),
        d = i(1).LineDataSource,
        p = i(23),
        u = i(11).TrendLineRenderer,
        _ = i(47).Action,
        f = i(8),
        m = i(6),
        g = i(14);
    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(), 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, 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))), a = g.coeff.value(), S = { points: [v, y], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: g.color.value(), linewidth: g.linewidth.value(), linestyle: g.linestyle.value(), extendleft: !1, extendright: !0, leftend: d.LINEEND_NORMAL, rightend: d.LINEEND_NORMAL }, T = new f(f.MOVEPOINT, null, p), t.append(new u(S, T)), C = { points: [b, w], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: g.color.value(), linewidth: g.linewidth.value(), linestyle: g.linestyle.value(), extendleft: !1, extendright: !0, leftend: d.LINEEND_NORMAL, rightend: d.LINEEND_NORMAL }, T = new f(f.MOVEPOINT, null, p), t.append(new u(C, T)));
        return this.addAnchors(t), t
    }, inherit(l, d), l.STYLE_ORIGINAL = 0, l.STYLE_SCHIFF = 1, l.STYLE_INSIDE = 2, l.STYLE_SCHIFF2 = 3, l.prototype.additionalActions = function() {
        var t, e, i = [],
            o = ["Original", "Modified Schiff", "Inside", "Schiff"];
        for (t = 0; t < 4; t++) e = new _({ checked: this.properties().style.value() === t, checkable: !0, text: $.t(o[t]), callbackContext: { target: this, value: t } }), e.callbacks().subscribe(null, function(t) {
            var e = t.callbackContext(),
                i = e.target,
                o = e.value;
            i.properties().style.setValue(o), i.updateAllViews(), i._model.updateSource(i)
        }), i.push(e);
        return [i[0], i[3], i[1], i[2]]
    }, l.prototype._recreatePaneView = function() {
        this._properties.style.value() === l.STYLE_ORIGINAL ? this._paneViews = [new n(this, this._model)] : this._properties.style.value() === l.STYLE_SCHIFF ? this._paneViews = [new s(this, this._model)] : this._properties.style.value() === l.STYLE_SCHIFF2 ? this._paneViews = [new r(this, this._model)] : this._properties.style.value() === l.STYLE_INSIDE && (this._paneViews = [new a(this, this._model)])
    }, l.prototype.pointsCount = function() { return 3 }, l.prototype.title = function() { return $.t("Pitchfork") }, l.prototype.processErase = function(t, e) {
        var i = "level" + e,
            o = this.properties()[i].visible;
        t.setProperty(o, !1, "Erase level line")
    }, l.prototype.createPropertiesObject = function(t, e, i) { return new p(t, e, i, { range: [0, 8] }) }, e.ChannelRenderer = o, e.LineToolPitchfork = l
}, function(t, e, i) {
    "use strict";
    var o, n, s, r, a;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(374), n = i(373), s = i(742), r = i(12), a = r.getLogger("Common.UndoHistory"), e.UndoHistory = function() {
        function t(t) { return f && e(), f = new n.UndoMacroCommand(t) }

        function e() {
            if (f) {
                var t = f;
                f = null, t.isEmpty() || l(t)
            }
        }

        function i() { if (m.isEmpty()) return !1; var t = m.pop(); return !!t && (t.undo(), g.push(t), a.logNormal("UNDO: " + t.text()), !0) }

        function r() { if (g.isEmpty()) return !1; var t = g.pop(); return !!t && (t.redo(), m.push(t), a.logNormal("REDO: " + t.text()), !0) }

        function l(t) {
            var e, i, o;
            f ? f.addCommand(t) : (g.clear(), e = m.head(), i = e && e.text(), m.push(t), "" !== (o = t.text()) && o !== i && a.logNormal("DO: " + o)), t.executeOnPush() && t.redo()
        }

        function h() { return { lastActualCommand: m.isEmpty() ? null : m.head() } }

        function c(t) {
            for (; !m.isEmpty() && t.lastActualCommand !== m.head();) m.pop().undo();
            g.clear()
        }

        function d() { return m }

        function p() { return g }

        function u() { m.clear(), g.clear() }

        function _(t, e, i) {
            if (t.value() !== e) {
                var o = new s.SetWatchedValueCommand(t, e, i);
                this.pushUndoCommand(o), o.redo()
            }
        }
        var f = null,
            m = new o.UndoStack,
            g = new o.UndoStack;
        return { beginUndoMacro: t, clearStack: u, createUndoCheckpoint: h, endUndoMacro: e, pushUndoCommand: l, redo: r, redoStack: p, setWatchedValue: _, undo: i, undoStack: d, undoToCheckpoint: c }
    }()
}, function(t, e) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 }), e.dur = 350, e.easingFunc = { linear: function(t) { return t }, easeInQuad: function(t) { return t * t }, easeOutQuad: function(t) { return t * (2 - t) }, easeInOutQuad: function(t) { return t < .5 ? 2 * t * t : (4 - 2 * t) * t - 1 }, easeInCubic: function(t) { return t * t * t }, easeOutCubic: function(t) { return --t * t * t + 1 }, easeInOutCubic: function(t) { return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1 }, easeInQuart: function(t) { return t * t * t * t }, easeOutQuart: function(t) { return 1 - --t * t * t * t }, easeInOutQuart: function(t) { return t < .5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t }, easeInQuint: function(t) { return t * t * t * t * t }, easeOutQuint: function(t) { return 1 + --t * t * t * t * t }, easeInOutQuint: function(t) { return t < .5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t } }, e.color = {
        black0: "#000",
        black30: "#212121",
        black70: "#4A4A4A",
        black80: "#535353",
        black110: "#757575",
        black140: "#8A8A8A",
        black170: "#ADAEB0",
        black180: "#b4b4b4",
        black200: "#C8C8C8",
        black220: "#DADDE0",
        black230: "#ECECEC",
        black240: "#F2F2F2",
        black248: "#F8F8F8",
        black255: "#FFF",
        brand: "#3BB3E4",
        brandHover: "#3BABD8",
        brandActive: "#3898C2",
        brandDown: "#049DDC",
        brand220: "#3BB3E0",
        brand255: "#3BB3FF",
        spinner: "#00A2E2",
        brandMedium80: "#3C4650",
        brandMedium90: "#465a6e",
        brandMedium100: "#627384",
        brandMedium120: "#758696",
        brandMedium150: "#94959C",
        brandMedium190: "#9DB2BD",
        brandMedium220: "#E9EFF2",
        brandMedium230: "#EAECEF",
        brandMedium240: "#F1F3F6",
        brandDark: "#2A2C39",
        brandDark50: "#252733",
        brandDark45: "#20222D",
        brandDarkText: "#6A6B74",
        danger: "#FF4A68",
        dangerHover: "#F24965",
        dangerDown: "#FF173E",
        success: "#3CBC98",
        success55: "#37BC9B",
        success250: "#00FFC0",
        successHover: "#38B395",
        successDown: "#00A97F",
        attention: "#FFC84A",
        attention50: "#F89E30"
    }
}, , function(t, e, i) {
    (function(e) {
        "use strict";
        var o = i(364),
            n = 1e-10,
            s = function() {
                function t(t, e, i, o, n) {
                    var s, r = n,
                        a = 0;
                    if (isNaN(t.get(e - 1))) return { index: NaN, value: NaN };
                    for (s = 0; s < e; ++s) o(t.get(s), r) && (a = s, r = t.get(s));
                    return { index: a, value: r }
                }

                function s(t, e) { return 100 * t / e }

                function r(t, e, i, o, n) {
                    var s, r, a;
                    this._areaRight = t, this._areaLeft = e, this._pivotType = i, this._series = o, this._currentIndex = n.new_var(0), this._currentValue = n.new_var(NaN), this._pivotIndex = n.new_var(-1), this._index = S.n(n), this._isNewBar = n.symbol.isNewBar, s = this._currentIndex.get(1), r = this._currentValue.get(1), a = this._pivotIndex.get(1), this._index > 1 && (this._currentIndex.set(s), this._currentValue.set(r), this._pivotIndex.set(a))
                }

                function a(t, e, i) {
                    var o, n, s, a, l;
                    this._deviation = t, o = i.new_var(S.high(i)), n = i.new_var(S.low(i)), o.get(2 * e + 1), n.get(2 * e + 1), this._pivotHigh = new r(e, e, r.HIGH, o, i), this._pivotLow = new r(e, e, r.LOW, n, i), this._lastVal = i.new_var(NaN), this._lastIndex = i.new_var(-1), this._lastType = i.new_var(), this._index = S.n(i), this._isNewBar = i.symbol.isNewBar, this._isBarClosed = i.symbol.isBarClosed, s = this._lastIndex.get(1), a = this._lastVal.get(1), l = this._lastType.get(1), this._index > 1 && this.addPivot(s, a, l), this.processPivot(this._pivotHigh), this.processPivot(this._pivotLow)
                }

                function l(t) { this.symbol = t, this.vars = [], this.vars_index = 0, this.ctx = [], this.ctx_index = 0 }

                function h(t) { this.mindepth = 0, this.original = NaN, this.modified = !1, this.symbol = t }

                function c(t, e) { this.timezone = t || "America/New_York", this.session = e || "0000-0000" }

                function d(t, e, i, o, n) {
                    this.periodBase = i, this.tickerid = t, this.period = e, this.index = -1, this.time = NaN, this.open = NaN, this.high = NaN, this.low = NaN, this.close = NaN, this.volume = NaN, this.updatetime = NaN, this.isNewBar = !1, this.isBarClosed = !1, this.session = new w.Session, this.other_sessions = {}, this.script = o, this.ticker = d.parseTicker(t);
                    var s = d.parsePeriod(e);
                    this.resolution = s.resolution, this.interval = s.interval, this.bb_cache = {}, this.minTick = n
                }

                function p(t, e, i, o, n, s, r, a, h) { this.body = n, this.symbols = [], this.runner = o, this.inputCallback = r, this.out = s, this.nonseriesOut = h, this.ctx = new l(this.add_sym(t, e, i, a)), this.init() }

                function u(t) { this.symbols = [], this.barsets = [], this.subscription = [], this.host = t, this.isRecalculated = !1, this.start() }

                function _(t) { u.feed = t }

                function f(t) { this.runner = new u(t) }

                function m(t, e) { this.info = t, this.bars = e || [], this.isBarClosed = !0 }

                function g(t, e) { this.period = t, this.generateEmptyBars = !!e }

                function v() {}
                var y = "undefined" != typeof window ? window : e,
                    b = y.PineJsCalendar ? y.PineJsCalendar : i(57),
                    w = i(58),
                    S = {};
                return S.max_series_size = 10001, S.n = function(t) { return t.symbol.index + 1 }, S.nz = function(t, e) { return e = e || 0, isFinite(t) ? t : e }, S.na = function(t) { return 0 === arguments.length ? NaN : isNaN(t) ? 1 : 0 }, S.isZero = function(t) { return Math.abs(t) <= 1e-10 }, S.toBool = function(t) { return isFinite(t) && !S.isZero(t) }, S.eq = function(t, e) { return S.isZero(t - e) }, S.neq = function(t, e) { return !S.eq(t, e) }, S.ge = function(t, e) { return S.isZero(t - e) || t > e }, S.gt = function(t, e) { return !S.isZero(t - e) && t > e }, S.lt = function(t, e) { return !S.isZero(t - e) && t < e }, S.le = function(t, e) { return S.isZero(t - e) || t < e }, S.and = function(t, e) { return isNaN(t) || isNaN(e) ? NaN : S.isZero(t) || S.isZero(e) ? 0 : 1 }, S.or = function(t, e) { return isNaN(t) || isNaN(e) ? NaN : S.isZero(t) && S.isZero(e) ? 0 : 1 }, S.not = function(t) { return isNaN(t) ? NaN : S.isZero(t) ? 1 : 0 }, S.greaterOrEqual = function(t, e) { return e - t < n }, S.lessOrEqual = function(t, e) { return t - e < n }, S.equal = function(t, e) { return Math.abs(t - e) < n }, S.greater = function(t, e) { return t - e > n }, S.less = function(t, e) { return e - t > n }, S.max = Math.max, S.min = Math.min, S.pow = Math.pow, S.abs = Math.abs, S.log = Math.log, S.log10 = function(t) { return Math.log(t) / Math.LN10 }, S.sqrt = Math.sqrt, S.sign = function(t) { return isNaN(t) ? NaN : S.isZero(t) ? 0 : t > 0 ? 1 : -1 }, S.exp = Math.exp, S.sin = Math.sin, S.cos = Math.cos, S.tan = Math.tan, S.asin = Math.asin, S.acos = Math.acos, S.atan = Math.atan, S.floor = Math.floor, S.ceil = Math.ceil, S.round = Math.round, S.avg = function(t, e, i, o, n, s) { var r, a; if (2 === arguments.length) return (t + e) / 2; for (r = 0, a = 0; a < arguments.length; a++) r += arguments[a]; return r / arguments.length }, S.open = function(t) { return t.symbol.open }, S.high = function(t) { return t.symbol.high }, S.low = function(t) { return t.symbol.low }, S.close = function(t) { return t.symbol.close }, S.hl2 = function(t) { return (t.symbol.high + t.symbol.low) / 2 }, S.hlc3 = function(t) { return (t.symbol.high + t.symbol.low + t.symbol.close) / 3 }, S.ohlc4 = function(t) { return (t.symbol.open + t.symbol.high + t.symbol.low + t.symbol.close) / 4 }, S.volume = function(t) { return t.symbol.volume }, S.updatetime = function(t) { return t.symbol.updatetime }, S.time = function(t, e, i) { return t.symbol.bartime(e, i) }, S.period = function(t) { return t.symbol.period }, S.tickerid = function(t) { return t.symbol.tickerid }, S.ticker = function(t) { return t.symbol.ticker }, S.interval = function(t) { return t.symbol.interval }, S.isdwm = function(t) { return t.symbol.isdwm() }, S.isintraday = function(t) { return !t.symbol.isdwm() }, S.isdaily = function(t) { return "D" === t.symbol.resolution }, S.isweekly = function(t) { return "W" === t.symbol.resolution }, S.ismonthly = function(t) { return "M" === t.symbol.resolution }, S.year = function(t) { return S.timepart(t.symbol, b.YEAR, arguments[1]) }, S.month = function(t) { return S.timepart(t.symbol, b.MONTH, arguments[1]) }, S.weekofyear = function(t) { return S.timepart(t.symbol, b.WEEK_OF_YEAR, arguments[1]) }, S.dayofmonth = function(t) { return S.timepart(t.symbol, b.DAY_OF_MONTH, arguments[1]) }, S.dayofweek = function(t) { return S.timepart(t.symbol, b.DAY_OF_WEEK, arguments[1]) }, S.hour = function(t) { return S.timepart(t.symbol, b.HOUR_OF_DAY, arguments[1]) }, S.minute = function(t) { return S.timepart(t.symbol, b.MINUTE, arguments[1]) }, S.second = function(t) {
                        return S.timepart(t.symbol, b.SECOND, arguments[1])
                    }, S.iff = function(t, e, i) { return S.not(t) ? i : e }, S.rising = function(t, e) {
                        for (var i = 1; i < e + 1; ++i)
                            if (t.get(i) > t.get(0)) return 0;
                        return 1
                    }, S.falling = function(t, e) {
                        for (var i = 1; i < e + 1; ++i)
                            if (t.get(i) < t.get(0)) return 0;
                        return 1
                    }, S.timepart = function(t, e, i) { var o = b.utc_to_cal(t.timezone, i || t.bartime()); return b.get_part(o, e) }, S.rsi = function(t, e) { return S.isZero(e) ? 100 : S.isZero(t) ? 0 : 100 - 100 / (1 + t / e) }, S.sum = function(t, e, i) {
                        var o = i.new_var(),
                            n = S.nz(t.get()) + S.nz(o.get(1)) - S.nz(t.get(e));
                        return o.set(n), n
                    }, S.sma = function(t, e, i) { var o = S.sum(t, e, i); return S.na(t.get(e - 1)) ? NaN : o / e }, S.rma = function(t, e, i) {
                        var o = S.sum(t, e, i),
                            n = e - 1,
                            s = t.get(n),
                            r = i.new_var(),
                            a = r.get(1),
                            l = t.get(),
                            h = S.na(s) ? NaN : S.na(a) ? o / e : (l + a * n) / e;
                        return r.set(h), h
                    }, S.fixnan = function(t, e) { var i = e.new_var(); return isNaN(t) ? i.get(1) : (i.set(t), t) }, S.tr = function(t, e) { var i, o, n; return 1 === arguments.length && (e = t, t = void 0), i = void 0 !== t && !!t, o = e.new_var(S.close(e)), n = o.get(1), i && isNaN(n) && (n = S.close(e)), S.max(S.max(S.high(e) - S.low(e), S.abs(S.high(e) - n)), S.abs(S.low(e) - n)) }, S.atr = function(t, e) { var i = e.new_var(S.tr(e)); return S.sma(i, t, e) }, S.ema = function(t, e, i) {
                        var o = S.sum(t, e, i),
                            n = i.new_var(),
                            s = t.get(0),
                            r = t.get(e - 1),
                            a = n.get(1),
                            l = S.na(r) ? NaN : S.na(a) ? o / e : 2 * (s - a) / (e + 1) + a;
                        return n.set(l), l
                    }, S.wma = function(t, e, i) { var o, n, s = 0; for (e = Math.round(e), o = e; o >= 0; o--) n = e - o, s += n * t.get(o); return 2 * s / (e * (e + 1)) }, S.vwma = function(t, e, i) {
                        var o = i.new_var(S.volume(i)),
                            n = i.new_var(t.get(0) * S.volume(i));
                        return S.sma(n, e, i) / S.sma(o, e, i)
                    }, S.swma = function(t, e) { return (t.get(0) + 2 * t.get(1) + 2 * t.get(2) + t.get(3)) / 6 }, S.lowestbars = function(e, i, o) { return -t(e, i, o, function(t, e) { return S.lt(t, e) }, Number.MAX_VALUE).index }, S.lowest = function(e, i, o) { return t(e, i, o, function(t, e) { return S.lt(t, e) }, Number.MAX_VALUE).value }, S.highestbars = function(e, i, o) { return -t(e, i, o, function(t, e) { return S.gt(t, e) }, Number.MIN_VALUE).index }, S.highest = function(e, i, o) { return t(e, i, o, function(t, e) { return S.gt(t, e) }, Number.MIN_VALUE).value }, S.cum = function(t, e) {
                        var i = e.new_var(),
                            o = S.nz(i.get(1)) + t;
                        return i.set(o), o
                    }, S.accdist = function(t) {
                        var e = S.high(t),
                            i = S.low(t),
                            o = S.close(t),
                            n = S.volume(t);
                        return S.cum(o === e && o === i || e === i ? 0 : n * (2 * o - i - e) / (e - i), t)
                    }, S.correlation = function(t, e, i, o) {
                        var n = S.sma(t, i, o),
                            s = S.sma(e, i, o),
                            r = o.new_var(t.get() * e.get());
                        return (S.sma(r, i, o) - n * s) / Math.sqrt(S.variance2(t, n, i) * S.variance2(e, s, i))
                    }, S.stoch = function(t, e, i, o, n) {
                        var r = S.highest(e, o),
                            a = S.lowest(i, o);
                        return S.fixnan(s(t.get() - a, r - a), n)
                    }, S.tsi = function(t, e, i, o) {
                        var n = o.new_var(S.change(t)),
                            s = o.new_var(S.abs(S.change(t))),
                            r = o.new_var(S.ema(n, i, o)),
                            a = o.new_var(S.ema(s, i, o));
                        return S.ema(r, e, o) / S.ema(a, e, o)
                    }, S.cross = function(t, e, i) {
                        function o(t) { return t < 0 ? -1 : 0 === t ? 0 : 1 }
                        if (isNaN(t) || isNaN(e)) return !1;
                        var n = i.new_var(o(t - e));
                        return !isNaN(n.get(1)) && n.get(1) !== n.get()
                    }, S.linreg = function(t, e, i) {
                        var o, n, s, r, a, l, h = 0,
                            c = 0,
                            d = 0,
                            p = 0;
                        for (o = 0; o < e; ++o) n = t.get(o), s = e - 1 - o, r = s + 1, h += r, c += n, d += r * r, p += n * r;
                        return a = (e * p - h * c) / (e * d - h * h), l = c / e, l - a * h / e + a + a * (e - 1 - i)
                    }, S.sar = function(t, e, i, o) {
                        function n(e, i) {
                            var o = m.get();
                            return g.set(e), m.set(i), v.set(1e3 * t),
                                y.set(o), o
                        }
                        var s, r, a = S.high(o),
                            l = S.low(o),
                            h = S.close(o),
                            c = o.new_var(a),
                            d = o.new_var(l),
                            p = o.new_var(h),
                            u = p.get(1),
                            _ = d.get(1),
                            f = c.get(1),
                            m = o.new_var(),
                            g = o.new_var(),
                            v = o.new_var(),
                            y = o.new_var(),
                            b = y.get(1);
                        if (isNaN(u)) return NaN;
                        if (s = 1e-7, isNaN(b) && (S.ge(h, u) ? (g.set(1), m.set(Math.max(a, f)), b = Math.min(l, _)) : (g.set(-1), b = Math.max(a, f), m.set(Math.min(l, _))), v.set(1e3 * t)), 1 === g.get()) { if (S.gt(a, m.get()) && (m.set(a), v.set(Math.min(v.get() + 1e3 * e, 1e3 * i))), S.le(l, b)) return n(-1, l) } else if (S.lt(l, m.get()) && (m.set(l), v.set(Math.min(v.get() + 1e3 * e, 1e3 * i))), S.ge(a, b)) return n(1, a);
                        return r = b + v.get() * (m.get() - b) / 1e3, 1 === g.get() ? S.ge(r, l) && (r = l - s) : S.le(r, a) && (r = a + s), y.set(r), r
                    }, S.alma = function(t, e, i, o) {
                        var n, s, r, a = Math.floor(i * (e - 1)),
                            l = e / o * (e / o),
                            h = [],
                            c = 0;
                        for (n = 0; n < e; ++n) s = Math.exp(-1 * Math.pow(n - a, 2) / (2 * l)), c += s, h.push(s);
                        for (n = 0; n < e; ++n) h[n] /= c;
                        for (r = 0, n = 0; n < e; ++n) r += h[n] * t.get(e - n - 1);
                        return r
                    }, S.wvap = function(t, e) { return t.get() - t.get(1) }, S.change = function(t) { return t.get() - t.get(1) }, S.roc = function(t, e) { var i = t.get(e); return 100 * (t.get() - i) / i }, S.dev = function(t, e, i) { var o = S.sma(t, e, i); return S.dev2(t, e, o) }, S.dev2 = function(t, e, i) { var o, n, s, r = 0; for (o = 0; o < e; o++) n = t.get(o), s = S.abs(n - i), r += s; return r / e }, S.stdev = function(t, e, i) { var o = S.variance(t, e, i); return S.sqrt(o) }, S.variance = function(t, e, i) { var o = S.sma(t, e, i); return S.variance2(t, o, e) }, S.variance2 = function(t, e, i) { var o, n, s, r = 0; for (o = 0; o < i; o++) n = t.get(o), s = S.abs(n - e), r += s * s; return r / i }, S.percentrank = function(t, e) { var i, o, n, s; if (S.na(t.get(e - 1))) return NaN; for (i = 0, o = t.get(), n = 1; n < e; n++) s = t.get(n), S.ge(o, s) && i++; return 100 * i / e }, r.LOW = 0, r.HIGH = 1, r.prototype.isPivotFound = function() { return -1 !== this._pivotIndex.get() }, r.prototype.pivotIndex = function() { return this._pivotIndex.get() }, r.prototype.currentValue = function() { return this._currentValue.get() }, r.prototype.pivotType = function() { return this._pivotType }, r.prototype.reset = function() { this._currentValue.set(NaN), this._currentIndex.set(0), this._pivotIndex.set(-1) }, r.prototype.isRightSideOk = function(t) { return t - this._currentIndex.get() === this._areaRight }, r.prototype.isViolate = function(t, e) { if (t < 1 || isNaN(this._currentValue.get())) return !0; var i = this._series.get(this._index - t); return !!isNaN(i) || (i === this._currentValue.get() ? e : this._pivotType === r.HIGH ? i > this._currentValue.get() : i < this._currentValue.get()) }, r.prototype.processPoint = function(t) { this.isViolate(t, !1) && (this._currentValue.set(this._series.get()), this._currentIndex.set(t)) }, r.prototype.isRestartNeeded = function(t) { return t - this._currentIndex.get() > this._areaRight }, r.prototype.update = function() {
                        var t, e;
                        if (this._isNewBar && this.isPivotFound() && this.reset(), this.processPoint(this._index), this.isRightSideOk(this._index)) {
                            if (-1 === this._pivotIndex.get()) {
                                for (t = !0, e = 0; e < this._areaLeft; ++e)
                                    if (this.isViolate(this._currentIndex.get() - 1 - e, !0)) { t = !1; break }
                                t && this._pivotIndex.set(this._currentIndex.get())
                            }
                        } else -1 !== this._pivotIndex.get() && this._pivotIndex.set(-1);
                        if (this.isRestartNeeded(this._index))
                            for (this.reset(), e = 0; e <= this._areaRight; ++e) this.processPoint(this._index - this._areaRight + e)
                    },
                    a.prototype.addPivot = function(t, e, i) { this._lastIndex.set(t), this._lastVal.set(e), this._lastType.set(i) }, a.prototype.updatePivot = function(t, e) { this._lastIndex.set(t), this._lastVal.set(e) }, a.prototype.lastPrice = function() { return this._lastVal.get() }, a.prototype.lastIndex = function() { return this._lastIndex.get() }, a.prototype.addPoint = function(t, e, i) { var o; return isNaN(this._lastVal.get()) ? void this.addPivot(t, e, i) : (o = this._lastVal.get(), this._lastType.get() === i ? void((i === r.HIGH ? e > o : e < o) && this.updatePivot(t, e)) : void(Math.abs(o - e) / e > this._deviation && this.addPivot(t, e, i))) }, a.prototype.processPivot = function(t) { t.update(), this._isBarClosed && t.isPivotFound() && this.addPoint(t.pivotIndex(), t.currentValue(), t.pivotType()) }, S.zigzag = function(t, e, i) { return new a(t, e, i).lastPrice() }, S.zigzagbars = function(t, e, i) { var o = new a(t, e, i); return -1 === o.lastIndex() ? NaN : o.lastIndex() - S.n(i) }, l.prototype.new_sym = function(t, e, i) { return this.symbol.script.add_sym(t, e, i) }, l.prototype.select_sym = function(t) { this.symbol = this.symbol.script.get_sym(t) }, l.prototype.new_var = function(t) { var e, i = this.vars; return i.length <= this.vars_index && i.push(new h(this.symbol)), e = i[this.vars_index++], arguments.length > 0 && e.set(t), e }, l.prototype.new_ctx = function() { return this.ctx.length <= this.ctx_index && this.ctx.push(new l(this.symbol)), this.ctx[this.ctx_index++] }, l.prototype.prepare = function(t) { var e, i; for (this.ctx_index = 0, this.vars_index = 0, e = 0; e < this.vars.length; e++) this.vars[e].prepare(t); for (i = 0; i < this.ctx.length; i++) this.ctx[i].prepare(t) }, l.prototype.stop = function() { this.symbol = null, this.vars = null }, h.prototype.valueOf = function() { return this.get(0) }, h.prototype.get = function(t) { return isNaN(t) && (t = 0), t = t || 0, this.hist ? t >= this.hist.length ? (console.error("not enough depth: " + this), NaN) : this._get(t) : (this.mindepth = S.max(this.mindepth, t), NaN) }, h.prototype._get = function(t) { var e = this.hist_pos - t; return e < 0 && (e += this.hist.length), this.hist[e] }, h.prototype.set = function(t) { this.hist && (this.hist[this.hist_pos] = t, this.modified = !0) }, h.prototype.prepare = function(t) { t === this.symbol && (t.isNewBar ? (this.original = this.get(0), !this.modified && this.hist || this.add_hist()) : this.set(this.original), this.modified = !1) }, h.prototype.add_hist = function() {
                        var t, e, i;
                        if (!this.hist) {
                            for (t = S.na(this.mindepth) ? S.max_series_size : S.min(this.mindepth + 1, S.max_series_size), t = Math.round(t), e = Array(t), i = 0; i < t; i++) e[i] = NaN;
                            this.hist = e, this.hist_pos = -1
                        }
                        this.hist_pos = Math.min(this.hist_pos + 1, this.hist.length), this.hist_pos === this.hist.length && (this.hist_pos = this.hist.length - 1, this.hist.shift(), this.hist.push(NaN)), this.hist[this.hist_pos] = this.original
                    }, h.prototype.adopt = function(t, e, i) { var o, n, s, r; return this.hist || (this.mindepth = NaN), o = e.get(), n = t.indexOf(o), 0 !== i && (s = e.get(1), S.na(s) || (r = t.indexOf(s), n = n === r ? -1 : n)), n < 0 ? NaN : this._get(n) }, h.prototype.indexOf = function(t) { var e, i, n, s; return this.hist ? S.na(t) ? -1 : (e = this.hist.length, i = this.symbol.index + 1, n = Math.min(e, i), s = o.upperbound_int(this.hist, t, 0, n), 0 === s ? -1 : n - s) : (this.mindepth = NaN, -1) }, d.parseTicker = function(t) {
                        var e = t.indexOf(":");
                        return -1 === e ? t : t.substr(e + 1)
                    }, d.parsePeriod = function(t) { var e, i, o, n, s, r, a, l; return t += "", e = t.slice(0), i = e.indexOf(",") >= 0, i && (n = e.split(","), o = d.parsePeriod(n[1]), e = n[0]), s = !1, r = !1, a = e[e.length - 1], -1 === "DWM".indexOf(a) && ("S" === a ? r = !0 : (s = !0, a = "")), l = parseInt(s ? e : e.length > 1 ? e.slice(0, e.length - 1) : 1), { resolution: a, interval: l, pureResolution: "" + l + a, isIntraday: s, isSeconds: r, range: o } }, d.newBarBuilder = function(t, e, i) { var o = d.parsePeriod(t); return w.newBarBuilder(o.resolution, o.interval, e, i) }, d.newSession = function(t, e) { var i = b.get_timezone(t); return (new w.Session).init(i, e) }, d.prototype.set_symbolinfo = function(t) { t || console.error("WARN: symbolinfo isn't defined for " + this.tickerid), this.info = t, this.timezone = b.get_timezone(t.timezone), this.session.init(this.timezone, t.session); for (var e in this.other_sessions) this.other_sessions.hasOwnProperty(e) && this.other_sessions[e].init(this.timezone, e) }, d.prototype.get_session = function(t) { if (!t) return this.session; var e = this.other_sessions[t]; return e || (e = new w.Session, this.other_sessions[t] = e), e }, d.prototype.isdwm = function() { return "" !== this.resolution && "S" !== this.resolution }, d.prototype.enable_dwm_aligning = function(t, e) { this.dwm_aligner = d.newBarBuilder(this.period, t, e) }, d.prototype.bartime = function(t, e) { var i, o, n, s, r = this.time; return t && (i = t, e && (i += e), o = this.bb_cache[i], o || (n = this.get_session(e), o = d.newBarBuilder(t, n), this.bb_cache[i] = o), r = o.alignTime(r)), !this.isdwm() || isNaN(r) ? r : (s = b.utc_to_cal(this.timezone, r), this.session.spec.correctTradingDay(s, this.timezone), b.cal_to_utc(this.timezone, s)) }, d.prototype.lastbar = function(t) {
                        var e, i;
                        isNaN(t.time) || (e = t.time, this.dwm_aligner && (this.dwm_aligner.moveTo(e), e = this.dwm_aligner.startOfBar(0)), i = this.time !== e, i && this.index >= 0 && !this.isBarClosed && (this.isNewBar = !1, this.isBarClosed = !0, this.script.calc(this)), this.time = e, this.open = t.open, this.high = t.high, this.low = t.low, this.close = t.close, this.volume = t.volume, this.updatetime = t.updatetime, this.isNewBar = i, this.isBarClosed = t.isBarClosed, this.isLastBar = t.isLastBar, this.isNewBar && this.index++, this.script.calc(this))
                    }, p.prototype.calc = function(t) {
                        var e, i, o = this.ctx,
                            n = this.body;
                        o.prepare(t), e = n.main(o, this.inputCallback), i = this, !isNaN(o.symbol.time) && this.out && e && (e.nonseries ? (e.projectionTime = o.symbol.time, this.nonseriesOut(o.symbol, e)) : e.bars ? e.bars.forEach(function(t) { i.out(o.symbol, t) }) : this.out(o.symbol, e))
                    }, p.prototype.init = function() {
                        var t = this.ctx,
                            e = this.body;
                        e.init && e.init(t, this.inputCallback), e.main(t, this.inputCallback)
                    }, p.prototype.add_sym = function(t, e, i, o) { var n = this.runner.add_sym(t, e, i, this, o); return this.symbols.push(n), n.isdwm() && this.symbols.length > 1 && n.enable_dwm_aligning(this.symbols[0].session, n.session), n }, p.prototype.stop = function() { this.symbols = null, this.ctx.stop(), this.ctx = null }, p.prototype.get_sym = function(t) { return this.symbols[t] }, u.prototype.add_sym = function(t, e, i, o, n) { var s = new d(t, e, i, o, n); return this.symbols.push(s), s }, u.prototype.get_sym = function(t) { return this.symbols[t] }, u.prototype.out = function(t, e) {
                        if (this.nonseriesUpdate) {
                            var i = $.extend({}, this.nonseriesUpdate);
                            e.splice(0, 0, t.time), i.lastBar = e, this.host.nonseriesOut(i)
                        } else this.host.out(t, e)
                    }, u.prototype.start = function() {
                        function t(t, o) {
                            var n = u.feed.subscribe(t.tickerid, t.period, t.periodBase, function(t) { "series" == (t.nonseries ? "nonseries" : "series") ? e.update(o, t): t.lastBar ? (e.nonseriesUpdate = t, t.lastBar.isLastBar = !0, e.symbols[0].lastbar(t.lastBar), e.nonseriesUpdate = null) : s.nonseriesOut(t) }, s.onErrorCallback, s.symbolInfo, s.sessionId, s.rangeExtension);
                            i.push(n)
                        }
                        var e, i, o, n, s = this.host;
                        for (this._script = new p(s.tickerid, s.period, s.periodBase || s.period, this, s.body, this.out.bind(this), s.input, s.symbolInfo.minmov / s.symbolInfo.pricescale, s.nonseriesOut), e = this, i = [], o = this.symbols, n = 0; n < o.length; n++) t(o[n], n);
                        this.subscription = i
                    }, u.prototype.stop = function() {
                        var t, e = this.subscription;
                        if (!e && !this._script) return void console.warn("Recurring script engine stop happened.");
                        for (t = 0; t < e.length; t++) u.feed.unsubscribe(e[t]);
                        this.subscription = null, this._script.stop(), this._script = null, this.symbols = null
                    }, u.prototype.update = function(t, e) {
                        var i, o;
                        if (!e) return void console.error("Unexpected barset = null");
                        i = this.symbols[t], this.isRecalculated ? (o = e.bar(e.count() - 1), o.isBarClosed = e.isLastBarClosed(), o.isLastBar = !0, i.lastbar(o)) : this.barsets[t] || (this.barsets[t] = e, i.set_symbolinfo(e.symbolinfo()), this.recalc())
                    }, u.prototype.recalc = function() {
                        var t, e, i, o, n, s, r, a = this.symbols;
                        for (t = 0; t < a.length; t++)
                            if (!this.barsets[t]) return;
                        for (e = a.length - 1; e >= 0; e--)
                            for (i = a[e], o = this.barsets[e], n = o.count(), s = 0; s < n; s++) r = o.bar(s), r.isLastBar = s === n - 1, r.isBarClosed = !r.isLastBar || o.isLastBarClosed(), i.lastbar(r);
                        this.isRecalculated = !0, this.barsets[0] && this.barsets[0].endOfData && this.host.setNoMoreData(), this.host.recalc(this, { endOfData: this.barsets[0].endOfData, nextTime: this.barsets[0].nextTime })
                    }, u.feed = { subscribe: function(t, e, i, o) { console.error("must be initialized with setupFeed") }, unsubscribe: function(t) { console.error("must be initialized with setupFeed") } }, f.prototype.stop = function() { this.runner.stop() }, m.prototype.symbolinfo = function() { return this.info }, m.prototype.isLastBarClosed = function() { return this.isBarClosed }, m.prototype.setLastBarClosed = function(t) { this.isBarClosed = t }, m.prototype.bar = function(t) { return this.bars[t] }, m.prototype.count = function() { return this.bars.length }, m.prototype.add = function(t, e) {
                        var i = t,
                            o = this.bars,
                            n = o.length,
                            s = i.time,
                            r = 0 === n ? NaN : o[n - 1].time;
                        0 === n || r < s ? o.push(i) : r === s ? o[n - 1] = i : console.error("time order violation, prev: " + new Date(r).toUTCString() + ", cur: " + new Date(s).toUTCString()), this.isBarClosed = !!e
                    }, g.prototype.init = function(t) { this.bb = d.newBarBuilder(this.period, t.symbol.session), this.bbEmptyBars = this.generateEmptyBars ? d.newBarBuilder(this.period, t.symbol.session) : void 0 }, g.prototype.extrapolate = function(t, e) { return isNaN(t) || isNaN(e) ? void 0 : w.extrapolateBarsFrontToTime(this.bbEmptyBars, t, e) }, g.prototype.main = function(t) {
                        var e = t.symbol.time,
                            i = this.bb.alignTime(e),
                            o = t.new_var(i),
                            n = S.na(i),
                            s = o.get(1),
                            r = S.na(s) ? 1 : S.neq(i, s),
                            a = t.new_var(),
                            l = t.new_var(),
                            h = t.new_var(),
                            c = t.new_var(),
                            d = a.get(1),
                            p = l.get(1),
                            u = h.get(1),
                            _ = c.get(1),
                            f = n ? NaN : r ? S.open(t) : d,
                            m = n ? NaN : r ? S.high(t) : S.max(S.high(t), p),
                            g = n ? NaN : r ? S.low(t) : S.min(S.low(t), u),
                            v = n ? NaN : S.close(t),
                            y = n ? NaN : r ? S.volume(t) : S.volume(t) + _,
                            b = n ? NaN : e,
                            w = t.symbol.isBarClosed && this.bb.isLastBar(0, e),
                            T = this.generateEmptyBars && r ? this.extrapolate(s, i) : void 0,
                            C = t.new_var(S.close(t)),
                            x = C.get(1),
                            P = T instanceof Array ? x : NaN;
                        return a.set(f), l.set(m), h.set(g), c.set(y), [i, f, m, g, v, y, b, w, T, P]
                    }, v.prototype.main = function(t) { return [S.open(t), S.high(t), S.low(t), S.close(t), S.volume(t), S.updatetime(t)] }, { Std: S, Series: h, Symbol: d, SymbolInfo: c, StudyEngine: f, BarSet: m, OHLCV: v, BarBuilder: g, setupFeed: _ }
            }();
        t.exports = s
    }).call(e, function() { return this }())
}, function(t, e, i) {
    "use strict";

    function o(t) {
        var e, i, o, n, s, r;
        if (this._name = t, e = d[t], e || (e = { time: [], offset: [] }, this._invalid = !0), e.time.length !== e.offset.length && (e = { time: [], offset: [] }, this._invalid = !0), !e.time_utc) {
            for (i = e.time, o = e.offset, n = i.length, s = Array(n), r = 0; r < n; r++) i[r] *= 1e3, o[r] *= 1e3, s[r] = i[r] - o[r];
            e.time_utc = s
        }
        this.tz = e
    }

    function n(t, e) {
        var i, o, n, r = t.length;
        if (0 === r) return -1;
        if (isNaN(e)) throw Error("Key is NaN");
        for (i = 0, o = r - 1, n = s((i + o) / 2);;) {
            if (t[n] > e) { if ((o = n - 1) < i) return n } else if (i = n + 1, o < i) return n < r - 1 ? n + 1 : -1;
            n = s((i + o) / 2)
        }
    }
    var s, r, a, l, h, c, d = i(588);
    o.prototype.offset_utc = function(t) { return o._offset(this.tz.time_utc, this.tz.offset, t) }, o.prototype.offset_loc = function(t) { return o._offset(this.tz.time, this.tz.offset, t) }, o.prototype.is_valid = function() { return !this._invalid }, o._offset = function(t, e, i) { var o = n(t, i); return -1 === o ? 0 : e[o] }, s = function(t) { return 0 | t }, r = function(t) { return 60 * t * 1e3 }, a = function(t) { return 1e3 * t }, l = function(t, e) { return s((s(t / 1e3) - s(e / 1e3)) / 60) }, h = function(t, e) { return s(s(t / 1e3) - s(e / 1e3)) }, c = {
        SUNDAY: 1,
        MONDAY: 2,
        TUESDAY: 3,
        WEDNESDAY: 4,
        THURSDAY: 5,
        FRIDAY: 6,
        SATURDAY: 7,
        JANUARY: 0,
        DECEMBER: 11,
        YEAR: 1,
        MONTH: 2,
        WEEK_OF_YEAR: 3,
        DAY_OF_MONTH: 5,
        DAY_OF_YEAR: 6,
        DAY_OF_WEEK: 7,
        HOUR_OF_DAY: 11,
        MINUTE: 12,
        SECOND: 13,
        minutesPerDay: 1440,
        secondsPerDay: r(1440),
        get_year: function(t) { return t.getUTCFullYear() },
        get_month: function(t) { return t.getUTCMonth() },
        get_hours: function(t) { return t.getUTCHours() },
        get_minutes: function(t) { return t.getUTCMinutes() },
        get_seconds: function(t) { return t.getUTCSeconds() },
        get_day_of_month: function(t) { return t.getUTCDate() },
        get_day_of_week: function(t) { return t.getUTCDay() + 1 },
        get_day_of_year: function(t) { var e = Date.UTC(t.getUTCFullYear(), 0, 1, 0, 0, 0, 0); return s((t.getTime() - e) / c.secondsPerDay) + 1 },
        get_week_of_year: function(t) {
            var e = Date.UTC(t.getUTCFullYear(), 0, 1, 0, 0, 0, 0),
                i = c.clone(t);
            return c.set_hms(i, 0, 0, 0, 0), i.setUTCDate(i.getUTCDate() + 4 - (i.getUTCDay() || 7)), s(((i.getTime() - e) / c.secondsPerDay + 1) / 7)
        },
        get_minutes_from_midnight: function(t) { return 60 * c.get_hours(t) + c.get_minutes(t) },
        set_hms: function(t, e, i, o, n) { t.setUTCHours(e), t.setUTCMinutes(i), t.setUTCSeconds(o), t.setUTCMilliseconds(n) },
        add_days_considering_dst: function(t, e, i) {
            var o, n = t.offset_utc(e),
                s = this.clone(e);
            return this.add_date(s, i), o = t.offset_utc(s), s.setTime(s.getTime() + n - o), s
        },
        add_date: function(t, e) { t.setTime(t.getTime() + e * c.secondsPerDay) },
        clone: function(t) { return new Date(t.getTime()) },
        get_days_per_year: function(t) { var e = t.getUTCFullYear(); return this.days_per_year(e) },
        days_per_year: function(t) { return t % 4 != 0 || t % 100 == 0 && t % 400 != 0 ? 365 : 366 },
        get_part: function(t, e) {
            switch (e) {
                case c.YEAR:
                    return c.get_year(t);
                case c.MONTH:
                    return c.get_month(t);
                case c.DAY_OF_MONTH:
                    return c.get_day_of_month(t);
                case c.WEEK_OF_YEAR:
                    return c.get_week_of_year(t);
                case c.DAY_OF_WEEK:
                    return c.get_day_of_week(t);
                case c.HOUR_OF_DAY:
                    return c.get_hours(t);
                case c.MINUTE:
                    return c.get_minutes(t);
                case c.DAY_OF_YEAR:
                    return c.get_day_of_year(t);
                case c.SECOND:
                    return c.get_seconds(t);
                default:
                    return t.getTime()
            }
        },
        time_minutes: r,
        time_seconds: a,
        time_minutes_diff: l,
        time_seconds_diff: h,
        utc_to_cal: function(t, e) { var i = t.offset_utc(e); return new Date(e + i) },
        get_cal: function(t, e, i, o) {
            var n = new Date(Date.UTC(e, i, o)),
                s = t.offset_utc(+n);
            return new Date(n.valueOf() - s)
        },
        get_cal_utc: function(t, e, i) { return new Date(Date.UTC(t, e, i)) },
        cal_to_utc: function(t, e) { var i = e.getTime(); return i - t.offset_loc(i) },
        get_timezone: function(t) { return new o(t) },
        shift_day: function(t, e) { var i = t - 1; return i += e, i > 6 ? i %= 7 : i < 0 && (i = (7 + i % 7) % 7), i + 1 }
    }, t.exports = c
}, function(t, e, i) {
    (function(e) {
        "use strict";
        var o = function() {
            function t(t, e, i, n) { return "" === t ? new h(60 * e, i) : "S" === t ? new h(e, i) : new c(i, n, e, o(t, i)) }

            function o(t, e) {
                switch (t) {
                    case "D":
                        return new S(e);
                    case "W":
                        return new T(e);
                    case "M":
                        return new C(e)
                }
                return console.error("unknown dwm resolution: " + t), null
            }

            function n(t, e, i, o, n) {
                var s, r, a, l, h, c, d, p = (new E).init("UTC", t),
                    u = "" !== e;
                return u ? (r = i * F[e], s = F.D) : (r = 60 * i * 1e3, s = 60 * p.spec.findSession(0, 0)._length * 1e3), a = s / r, l = u ? 7 : 7 - p.spec.weekEndsCount(), h = l * a, o < h ? (c = o / a, n - c * F.D) : (d = o / h, n - d * F.W)
            }

            function s(t, e, i, o) { if ("number" != typeof i || "number" != typeof e || isNaN(i) || isNaN(e)) throw Error("Cannot extrapolate from " + e + " to " + i); return a(t, e, function(t, e) { return e > i || o && t.length > o }) }

            function r(t, e, i) { return a(t, e, function(t, e) { return t.length >= i }) }

            function a(t, e, i) {
                var o, n, s, r, a, l = e;
                for (t.moveTo(l), o = [], n = 0, s = 0; !i(o, l);) {
                    if (n > 5) throw console.trace(["0x10", new Date(e), "->", new Date(l)]), Error("Internal error 0x10 while extrapolating.");
                    if ((r = t.indexOfBar(l)) === V) l = t.startOfBar(0);
                    else if (r === B) l = t.startOfBar(B);
                    else {
                        if ((a = t.startOfBar(r)) !== e) {
                            if (s && s === a) throw console.trace(["0x11", new Date(e), "->", new Date(a)]), Error("Internal error 0x11 while extrapolating.");
                            s = a, n = 0, o.push(a)
                        }
                        l = t.startOfBar(r + 1)
                    }
                    t.moveTo(l), n++
                }
                return o
            }

            function l(t) { if (isNaN(t)) return NaN; var e = this.indexOfBar(t); return e === B && (this.moveTo(t), e = this.indexOfBar(t)), e < 0 ? NaN : this.startOfBar(e) }

            function h(t, e) { this.period = t, this.session = e, this.sessionStart = Number.MIN_VALUE, this.sessionEnd = Number.MIN_VALUE }

            function c(t, e, i, o) { this.period = i, this.sessionTgt = t, this.sessionSrc = e || t, this.builder = o, this.periodStart = -Number.MAX_VALUE, this.periodEnd = -Number.MAX_VALUE, this.periodLastBarStart = -Number.MAX_VALUE }

            function d(t, e, i) {
                var o = 6e4,
                    n = new Date(e.valueOf() + t * o);
                return t + (i.offset_loc(e) / o - i.offset_loc(n) / o)
            }

            function p(t, e, i) { var o = N.clone(i); return e.alignToSessionStart(o, t), N.cal_to_utc(t, o) }

            function u(t) { return t.firstDayOfWeek }

            function _(t, e) { var i = N.get_day_of_week(e) - u(t); return i < 0 ? i + 7 : i }

            function f(t, e) { var i = e + u(t); return i > N.SATURDAY ? i - N.SATURDAY : i }

            function m(t, e) {
                var i = N.get_day_of_year(e) - 1,
                    o = _(t, e) - i % 7;
                return 0 === o ? x(i / 7) : (o >= 0 && (o -= 7), x((o + i) / 7))
            }

            function g(t, e, i) { var o, n = 0; for (o = e; o < i; ++o) n += t.isWeekEnd(f(t, o)) ? 1 : 0; return n }

            function v(t, e) {
                var i = new Date(Date.UTC(e, 11, 31, 23, 59)),
                    o = N.days_per_year(e) - y(t, i);
                return N.get_day_of_week(i) !== N.SUNDAY && N.get_day_of_week(i) !== N.SATURDAY || o--, o
            }

            function y(t, e) {
                var i, o, n = N.get_day_of_year(e) - 1,
                    s = _(t, e),
                    r = s - n % 7;
                return r < 0 && (r += 7), i = 0, n < 7 - r ? i += g(t, r, s) : (o = 0 === r ? 0 : g(t, r, 7), i += g(t, 0, s) + o), i + m(t, e) * t.weekEndsCount()
            }

            function b() {}

            function w(t) { this.sessionsSpec = t }

            function S(t) { this.session = t }

            function T(t) { this.session = t }

            function C(t) { this.session = t }

            function x(t) { return 0 | t }

            function P(t) { return t % 100 + 60 * x(t / 100) }

            function L(t, e, i) { this._dayOfWeek = t, this._start = e, this._length = i }

            function k(t, e) { return t.compareTo(e) }

            function I(t) {
                function e(t) { var e, i, o, s = t.split(";"); return s.length > 2 ? (console.error("Only one `first day` specification expected @ session " + t), t) : 1 === s.length ? t : (e = 1, i = s[0].indexOf("-") >= 0, o = i ? NaN : parseInt(s[0]), isNaN(o) && (e = 0, o = parseInt(s[1])), o < N.SUNDAY || o > N.SATURDAY ? (console.error("Unexpected day index @ session: " + t + "; day index " + o), t) : (n.firstDayOfWeek = o, s[e])) }
                var i, o, n = this;
                t = t || "0000-0000", this.entries = [], this.firstDayOfWeek = N.MONDAY, "24x7" === t.toLowerCase() ? $.forEach(function(t) { this.addSessionEntry(t, 0, 0) }, this) : (t = e(t), i = !1, o = {}, t.split("|").forEach(function(t) {
                    var e, n, s = t.split(":");
                    1 !== s.length && 2 !== s.length && console.error("bad session section: " + t), e = 1 === s.length, e && (i && console.error("duplicated default section: " + t), i = !0), n = e ? O : A(s[1]), n.forEach(function(t) { e && o[t] || (o[t] = s[0]) }, this)
                }, this), $.forEach(function(e) {
                    var i = o[e];
                    i && i.split(",").forEach(function(i) {
                        var o, n, s = i.split("-");
                        2 !== s.length && (console.error("bad sessions spec: " + t), s = ["0000", "0000"]), o = parseInt(s[0]), n = parseInt(s[1]), this.addSessionEntry(e, P(o), P(n))
                    }, this)
                }, this)), this.entries.sort(k)
            }

            function A(t) { var e, i, o = []; for (e = 0; e < t.length; e++) i = t.charAt(e) - "0", -1 === o.indexOf(i) && o.push(i); return o }

            function E() {}

            function M(t, e, i) {
                var o, n, s, r, a = t.length;
                if (0 === a) return -1;
                for (o = 0, n = a - 1, s = x((o + n) / 2);;) {
                    if (0 === (r = i(t[s], e)) || r > 0) { if ((n = s - 1) < o) return s } else if (o = s + 1, n < o) return s < a - 1 ? s + 1 : -1;
                    s = x((o + n) / 2)
                }
            }

            function D(t, e) {
                var i = N.utc_to_cal(e.timezone, +t),
                    o = N.get_day_of_week(i),
                    n = N.get_minutes_from_midnight(i),
                    s = e.spec.findSession(o, n);
                return s.isOvernight() && n > s._start + s._length && o === s._dayOfWeek - 1 && (o++, n -= 1440), o === s._dayOfWeek && n >= s._start && n < s._start + s._length
            }
            var O, $, V = -1,
                B = -2,
                R = "undefined" != typeof window ? window : e,
                N = R.PineJsCalendar ? R.PineJsCalendar : i(57),
                F = { S: 1e3, D: 864e5, W: 6048e5, M: 2592e6 };
            return h.prototype.alignTime = l, h.prototype.alignTimeIfPossible = function(t) { var e = this.alignTime(t); return isNaN(e) ? t : e },
                h.prototype.indexOfBar = function(t) { return t < this.sessionStart ? V : t >= this.sessionEnd ? B : x(N.time_seconds_diff(t, this.sessionStart) / this.period) }, h.prototype.startOfBar = function(t) { if (t === B) return this.sessionEnd; if (t < 0) throw Error("Negative offset is not supported"); return this.sessionStart + N.time_seconds(this.period * t) }, h.prototype.isLastBar = function(t, e) { return e >= this.sessionStart + N.time_seconds(this.period * (t + 1) - 1) }, h.prototype.moveTo = function(t) {
                    var e = this.session.timezone,
                        i = N.utc_to_cal(e, t),
                        o = this.session.spec,
                        n = o.alignToSessionStart(i, this.session.timezone);
                    this.sessionStart = N.cal_to_utc(e, i), this.sessionEnd = this.sessionStart + N.time_minutes(n)
                }, c.prototype.alignTime = l, c.prototype.alignTimeIfPossible = function(t) { return this.tradingDayToSessionStart(t) }, c.prototype.tradingDayToSessionStart = function(t) { return this.moveTo(t), this.startOfBar(0) }, c.prototype.indexOfBar = function(t) { return t < this.periodStart ? V : t >= this.periodEnd ? B : 0 }, c.prototype.startOfBar = function(t) { if (t === B || t > 0) return this.periodEnd; if (t === V) throw Error("PRE_SESSION is not supported"); return this.periodStart }, c.prototype.isLastBar = function(t, e) { return e >= this.periodLastBarStart }, c.prototype.moveTo = function(t) {
                    var e, i, o, n, s, r, a, l, h = N.utc_to_cal(this.sessionSrc.timezone, t);
                    h = this.sessionSrc.spec.correctTradingDay(h, this.sessionSrc.timezone), e = this.sessionTgt.timezone, i = this.builder.indexOfPeriod(h, e), o = x(i / this.period) * this.period, n = N.get_year(h), s = this.sessionTgt.spec, r = this.builder.startOfPeriod(e, o, n), this.periodStart = p(e, s, r), a = o + this.period, l = this.builder.startOfPeriod(e, a, n), this.periodEnd = p(e, s, l), N.add_date(l, -1), this.moveToPrevWorkDay(s, l), this.periodLastBarStart = p(e, s, l), (this.periodLastBarStart < this.periodStart || this.periodLastBarStart === this.periodEnd) && (this.periodLastBarStart = this.periodStart)
                }, c.prototype.moveToPrevWorkDay = function(t, e) { for (; t.isWeekEnd(N.get_day_of_week(e));) N.add_date(e, -1) }, b.prototype.indexOfPeriod = function(t) { return N.get_day_of_year(t) - 1 }, b.prototype.startOfPeriod = function(t, e, i) {
                    var o = N.get_cal(t, i, N.JANUARY, 1),
                        n = N.add_days_considering_dst(t, o, e);
                    return N.utc_to_cal(t, +n)
                }, w.prototype.uber = new b, w.prototype.indexOfPeriod = function(t) { return this.uber.indexOfPeriod(t) - y(this.sessionsSpec, t) }, w.prototype.startOfPeriod = function(t, e, i) {
                    function o(t, e) { this.weekEnds = g(t, e, 7), this.calendarDays = 7 - e, this.businessDays = this.calendarDays - this.weekEnds }

                    function n(t, e) { var i, o = 0; for (i = t; i < 7 && (r.sessionsSpec.isWeekEnd(f(r.sessionsSpec, i)) || !(--e < 0)); ++i) o++; return o }

                    function s(t, e, i) {
                        var o, n, s, a, l, h, c = 0,
                            d = i % (7 - r.sessionsSpec.weekEndsCount());
                        for (o = 0, n = d - (0 === t ? 0 : e.businessDays); o < 7 && n > 0; ++o) s = r.sessionsSpec.isWeekEnd(f(r.sessionsSpec, o)), c += s ? 1 : 0, n -= s ? 0 : 1;
                        return a = e.weekEnds + c, l = x((i - e.businessDays) / (7 - r.sessionsSpec.weekEndsCount())), h = a + r.sessionsSpec.weekEndsCount() * l, i + h
                    }
                    var r, a, l, h, c;
                    return e >= v(this.sessionsSpec, i) && (i++, e = 0), r = this, a = new Date(Date.UTC(i, N.JANUARY, 1)), l = _(this.sessionsSpec, a), h = new o(this.sessionsSpec, l), c = e < h.businessDays ? n(l, e) : s(l, h, e), this.uber.startOfPeriod(t, c, i)
                },
                S.prototype.indexOfPeriod = function(t) { return this.builder().indexOfPeriod(t) }, S.prototype.startOfPeriod = function(t, e, i) { return this.builder().startOfPeriod(t, e, i) }, S.prototype.builder = function() { return this._builder || (this._builder = this.session.spec.hasWeekEnds() ? new w(this.session.spec) : new b), this._builder }, T.prototype.indexOfPeriod = function(t, e) { var i = m(this.session.spec, t); return 0 === i && t < this.startOfPeriod(e, 0, N.get_year(t)) && (i = -1), i }, T.prototype.startOfPeriod = function(t, e, i) {
                    var o, n, s = new Date(Date.UTC(i, N.JANUARY, 1)),
                        r = _(this.session.spec, s),
                        a = 0 === r ? 7 * e : 7 * (e + 1) - r,
                        l = N.get_days_per_year(s);
                    return a > l ? this.startOfPeriod(t, 0, i + x(a / l)) : (o = N.get_cal(t, i, N.JANUARY, 1), n = N.add_days_considering_dst(t, o, a), N.utc_to_cal(t, +n))
                }, C.prototype.indexOfPeriod = function(t) { return N.get_month(t) }, C.prototype.startOfPeriod = function(t, e, i) { var o, n, s, r; return e < 0 ? (o = x((11 - e) / 12), i -= o, e += 12 * o) : e > N.DECEMBER && (i++, e = N.JANUARY), n = N.get_cal_utc(i, e, 1), s = _(this.session.spec, n), s > 4 && (r = 7 - s, N.add_date(n, r)), n }, L.prototype.start = function() { return this._start < 0 ? this._start + N.minutesPerDay : this._start }, L.prototype.isOvernight = function() { return this._start < 0 }, L.prototype.dayOfWeek = function() { return this._dayOfWeek }, L.prototype.length = function() { return this._length }, L.prototype.weight = function() { return this._dayOfWeek * N.minutesPerDay + this._start }, L.prototype.compareTo = function(t) {
                    var e = this.weight(),
                        i = e + this._length,
                        o = t.weight();
                    return e <= o && o < i ? 0 : e > o ? 1 : -1
                }, O = [N.MONDAY, N.TUESDAY, N.WEDNESDAY, N.THURSDAY, N.FRIDAY], $ = [N.SUNDAY, N.MONDAY, N.TUESDAY, N.WEDNESDAY, N.THURSDAY, N.FRIDAY, N.SATURDAY], I.prototype.addSessionEntry = function(t, e, i) {
                    i <= e && 0 !== e && (e -= N.minutesPerDay);
                    var o = i === e ? N.minutesPerDay : i - e;
                    this.entries.push(new L(t, e, o))
                }, I.prototype.isWeekEnd = function(t) { var e = M(this.entries, new L(t, 0, 0), function(t, e) { return t.dayOfWeek() - e.dayOfWeek() }); return e < 0 || this.entries[e].dayOfWeek() !== t }, I.prototype.hasWeekEnds = function() { return this.weekEndsCount() > 0 }, I.prototype.weekEndsCount = function() {
                    if (void 0 === this._weekEndsCount) {
                        var t = [];
                        this.entries.forEach(function(e) { t[e.dayOfWeek()] = 1 }, this), this._weekEndsCount = 7 - t.reduce(function(t, e) { return t + (e || 0) }, 0)
                    }
                    return this._weekEndsCount
                }, I.prototype.indexOfSession = function(t, e) { var i = M(this.entries, new L(t, e, 0), k); return -1 === i ? 0 : i }, I.prototype.findSession = function(t, e) { return this.entries[this.indexOfSession(t, e)] }, I.prototype.correctTradingDay = function(t, e) {
                    var i = N.get_day_of_week(t),
                        o = 60 * N.get_hours(t) + N.get_minutes(t),
                        n = this.findSession(i, o),
                        s = n.dayOfWeek(),
                        r = (s - i + 7) % 7;
                    return 0 !== r ? N.add_days_considering_dst(e, t, r) : t
                }, I.prototype.alignToSessionStart = function(t, e) {
                    var i, o = N.get_day_of_week(t),
                        n = N.get_minutes_from_midnight(t),
                        s = this.findSession(o, n),
                        r = s.dayOfWeek(),
                        a = s.isOvernight(),
                        l = (r - o + 7) % 7 - (a ? 1 : 0);
                    return 0 !== l && N.add_date(t, l), i = s.start(), N.set_hms(t, x(i / 60), i % 60, 0, 0), d(s.length(), t, e)
                }, E.prototype.init = function(t, e) { return this.timezone = "string" == typeof t ? N.get_timezone(t) : t, this.spec = new I(e), this }, {
                    PRE_SESSION: V,
                    POST_SESSION: B,
                    LASTBAR_SESSION: -3,
                    newBarBuilder: t,
                    Session: E,
                    alignPeriodsBack: n,
                    extrapolateBarsFrontByCount: r,
                    extrapolateBarsFrontToTime: s,
                    lower_bound: M,
                    isTradingNow: D,
                    numberOfFullWeeks: m,
                    numberOfWeekEndsSinceYearStart: y,
                    BusinessDaysBuilder: w,
                    alignExchangeTimeToSessionStartAndReturnUTC: p
                }
        }();
        t.exports = o
    }).call(e, function() { return this }())
}, function(t, e, i) {
    "use strict";

    function o(t) { this.bars = t.bars, this.barSpacing = t.barSpacing, this.barWidth = N.optimalBarWidth(t.barSpacing), this.barLineWidth = Math.max(1, Math.round(this.barWidth)), this.dontDrawOpen = t.dontDrawOpen }

    function n(t) { this.bars = t.bars, this.barWidth = t.barWidth, this.barLineWidth = 1 }

    function s(t) { this.bars = t.bars, this.barSpacing = t.barSpacing, this.barLineWidth = Math.max(1, N.optimalBarWidth(t.barSpacing)) }

    function r(t) { this.bars = t.bars, this.barSpacing = t.barSpacing, this.blockSize = t.blockSize, this.barWidth = t.barSpacing }

    function a(t) { this.items = t.items, this.barSpacing = t.barSpacing, this.histogramBase = t.histogramBase, this.lineColor = t.lineColor, this.lineWidth = t.lineWidth }

    function l(t) { this.items = t.items, this.barSpacing = t.barSpacing, this.histogramBase = t.histogramBase, this.lineColor = t.lineColor, this.lineWidth = t.lineWidth }

    function h(t) { this.items = t.items, this._simpleMode = t.simpleMode, this.barSpacing = t.barSpacing, this.lineColor = t.lineColor, this.lineWidth = t.lineWidth, this.lineStyle = t.lineStyle, this.withMarkers = t.withMarkers, this.withSteps = t.withSteps, this.hittest = t.hittest, this.ignorePaletteLineWidth = t.ignorePaletteLineWidth, this.forceLineColor = !!t.forceLineColor }

    function c(t) { t.forceLineColor = !1, h.call(this, t), this.color1 = t.color1, this.color2 = t.color2, this.bottom = t.bottom, this.isSeries = !!t.isSeries, this._simpleMode = t.simpleMode }

    function d(t) { this._data = t, this.bars = t.bars, this._barWidth = N.optimalBarWidth(t.barSpacing), this._barBorderWidth = 1 }

    function p(t) { this.items = t.items, this.barSpacing = t.barSpacing, this.lineColor = t.lineColor, this.lineWidth = t.lineWidth, this.lineStyle = t.lineStyle }

    function u(t) { this.items = t.items, this.barSpacing = t.barSpacing, this.lineColor = t.lineColor || t.color, this.radius = t.lineWidth || t.height / 2, this.vertOffset = t.vertOffset || 0 }

    function _(t, e, i, o) { this.x = t, this.y = e, this.height = i, this.isUp = o }

    function f(t) { this.items = t.items, this.barSpacing = t.barSpacing, this.colorUp = t.colorup, this.colorDn = t.colordown, this.colorBorderUp = t.colorBorderUp, this.colorBorderDown = t.colorBorderDown, this.width = this._calculateWidth(t.barSpacing), this.minHeight = t.minHeight, this.vertOffset = this._calculateVerticalOffset(t.barSpacing) }

    function m(t) { this.items = t.items, this.height = t.height || t.width, this.width = t.width || t.height, this._color = t.color, this._borderColor = t.borderColor, this._vertOffset = t.vertOffset || 0, t.textCache && (this._textCache = t.textCache, this._textColor = t.textColor, this._textVertOffset = this._vertOffset > 0 ? this.height : -this.height, this._textImageWidth = this._textCache.textImageWidth, this._textImageHeight = this._textCache.textImageHeight) }

    function g(t) { m.call(this, t), this.ch = t.char[0] || " ", this.fontFamily = t.fontFamily || "Arial", this._charCache = new z(this.ch, !1, !1, this.fontFamily, this.height) }

    function v(t) { m.call(this, t) }

    function y(t) { m.call(this, t) }

    function b(t) {
        m.call(this, t)
    }

    function w(t) { m.call(this, t) }

    function S(t) { m.call(this, t) }

    function T(t) { m.call(this, t) }

    function C(t) { m.call(this, t) }

    function x(t) { m.call(this, t), this.width = this._calculateWidth(t.barSpacing), this._isUp = !1 }

    function P(t) { x.call(this, t), this._isUp = !0 }

    function L(t) { x.call(this, t), this._isUp = !1 }

    function k(t, e) { m.call(this, t), this._isUp = e, this._stepX = Math.round(this.height / 2 * .65) + .5, this._stepY = Math.round(this.height / 2) + .5, this._textCache ? (this._padding = this._stepX / 2, this._shapeWidth = this._textImageWidth + 2 * this._stepX, this._shapeHeight = this._textImageHeight + 2 * this._padding + this._stepY, 0 === this._vertOffset ? this._isUp ? this._textVertOffset = this._stepY + this._padding + this._textImageHeight : this._textVertOffset = -this._stepY - this._padding : this._textVertOffset = this._vertOffset > 0 ? this._stepY + this._padding : -this._stepY - this._padding) : (this._padding = 0, this._shapeWidth = 2 * this._stepX, this._shapeHeight = 2.5 * this._stepY) }

    function I(t) { k.call(this, t, !0) }

    function A(t) { k.call(this, t, !1) }

    function E(t) { m.call(this, t) }

    function M(t) { m.call(this, t) }

    function D(t) { this._items = t.items, this._y = t.y, this._h = t.h, this._w = t.w }

    function O(t) {
        var e, i, o, n, s, r, a, l, h, c;
        t.point2 || (t.point2 = t.point1), e = t.point1.x, i = t.point1.y, o = t.point2.x, n = t.point2.y, s = 16, r = s - 6, a = s - 6, l = e <= o ? e - r : e + r, h = i <= n ? i + a : i - a, l -= 1, h -= 3, c = { items: [new R.Point(l, h)], char: [String.fromCharCode("0xF017").toUpperCase()], color: t.color, vertOffset: 0, height: s, fontFamily: "FontAwesome" }, g.call(this, c)
    }

    function $(t, e) { this._items = t.items, this._color = t.color, this._orderArrow = t.orderArrow, this._exitLineWidth = t.exitLineWidth, this._priceArrow = t.priceArrow, this._text = t.text, this._textWidths = e }

    function V(t) { this.data = t }

    function B(t) { this._data = t }
    var R = i(2),
        N = i(343),
        F = i(8),
        z = i(303);
    o.prototype.draw = function(t) {
            var e, i, o;
            for (t.save(), t.translate(.5, .5), i = 0; i < this.bars.length; ++i) o = this.bars[i], e !== o.color && (t.fillStyle = o.color, e = o.color), t.fillRect(Math.round(o.time - this.barLineWidth / 2), Math.round(o.high - this.barWidth / 2), Math.round(this.barLineWidth), Math.round(o.low - o.high + this.barWidth)), this.barLineWidth < this.barSpacing - 1 && (this.dontDrawOpen || t.fillRect(Math.round(o.time - 1.5 * this.barWidth), Math.round(o.open - this.barWidth / 2), Math.round(1.5 * this.barWidth), Math.round(this.barWidth)), t.fillRect(Math.round(o.time), Math.round(o.close - this.barWidth / 2), Math.round(1.5 * this.barWidth), Math.round(this.barWidth)));
            t.restore()
        }, o.prototype.hitTest = function(t) {
            var e, i, o, n, s = this.bars,
                r = .5 * this.barSpacing;
            if (0 === s.length) return null;
            if (t.x < s[0].time - r) return null;
            if (t.x > s[s.length - 1].time + r) return null;
            for (e = null, i = 0; i < s.length; ++i)
                if (o = s[i], t.x <= o.time + r) { e = o; break }
            return n = N.selectionTolerance(this.barLineWidth), e && e.high - n <= t.y && t.y <= e.low + n ? new F(F.REGULAR) : null
        }, n.prototype.draw = function(t) {
            var e, i, o, n, s, r, a;
            for (t.save(), t.lineCap = "butt", t.translate(.5, .5), t.lineWidth = this.barLineWidth, e = this.barWidth / 2, i = 0; i < this.bars.length; ++i) o = this.bars[i], n = o.exactTime - e, s = o.exactTime + e - n, r = Math.round(o.high), a = o.low - o.high == 0 ? 1 : Math.round(o.low - o.high), t.fillStyle = o.borderColor, t.fillRect(n, r, s, a),
                t.fillStyle = o.color, t.fillRect(n + this.barLineWidth, r + this.barLineWidth, s - 2 * this.barLineWidth, a - 2 * this.barLineWidth);
            t.restore()
        }, n.prototype.hitTest = function(t) {
            var e, i, o, n, s = this.bars,
                r = .5 * this.barWidth;
            if (0 === s.length) return null;
            if (t.x < s[0].time - r) return null;
            if (t.x > s[s.length - 1].time + r) return null;
            for (e = null, i = 0; i < s.length; ++i)
                if (o = s[i], t.x <= o.time + r) { e = o; break }
            return n = N.selectionTolerance(this.barLineWidth), e && e.high - n <= t.y && t.y <= e.low + n ? new F(F.REGULAR) : null
        }, s.prototype.draw = function(t) {
            var e, i, o;
            for (t.save(), t.lineCap = "square", t.translate(.5, .5), e = 0; e < this.bars.length; ++e) i = this.bars[e], o = Math.round(.5 * this.barLineWidth), i.isTwoColorBar ? (t.fillStyle = i.upColor, t.fillRect(Math.round(i.exactTime - o), Math.round(i.high - o), Math.round(2 * o), Math.round(i.additionalPrice - i.high + o)), t.fillStyle = i.downColor, t.fillRect(Math.round(i.exactTime - o), Math.round(i.additionalPrice), Math.round(2 * o), Math.round(i.low - i.additionalPrice + o))) : (t.fillStyle = i.color, t.fillRect(Math.round(i.exactTime - o), Math.round(i.high - o), Math.round(2 * o), Math.round(i.low - i.high) + 2 * o)), i.combinedWithProjection || (i.isTwoColorBar ? t.fillStyle = i.isUp ? i.downColor : i.upColor : t.fillStyle = i.color, t.fillRect(Math.round(i.exactTime - this.barSpacing + o), Math.round(i.open - o), Math.round(this.barSpacing - 2 * o + 1), Math.round(2 * o)));
            t.restore()
        }, s.prototype.hitTest = function(t) {
            var e, i, o, n, s = this.bars,
                r = .5 * this.barLineWidth;
            if (0 === s.length) return null;
            if (t.x < s[0].time - r) return null;
            if (t.x > s[s.length - 1].time + r) return null;
            for (e = null, i = 0; i < s.length; ++i)
                if (o = s[i], t.x <= o.time + r) { e = o; break }
            return n = N.selectionTolerance(.5 * this.barLineWidth), e && e.high - n <= t.y && t.y <= e.low + n ? new F(F.REGULAR) : null
        }, r.prototype.draw = function(t) {
            var e, i, o, n;
            for (t.save(), t.lineCap = "butt", t.translate(.5, .5), e = 0; e < this.bars.length; ++e) {
                for (i = this.bars[e], o = (i.low - i.high) / i.additionalNum, t.beginPath(), n = 0; n < i.additionalNum; n++) i.isUp ? (t.moveTo(Math.round(i.time - .5 * this.barWidth) + .5, i.high + n * o), t.lineTo(Math.round(i.time + .5 * this.barWidth) - .5, i.high + (n + 1) * o), t.moveTo(Math.round(i.time + .5 * this.barWidth) - .5, i.high + n * o), t.lineTo(Math.round(i.time - .5 * this.barWidth) + .5, i.high + (n + 1) * o)) : this.drawEllipse(t, i.time - .45 * this.barWidth + .5, i.high + n * o, Math.round(.9 * this.barWidth), Math.round(o));
                t.strokeStyle = i.color, t.lineWidth = 1, t.stroke()
            }
            t.restore()
        }, r.prototype.drawEllipse = function(t, e, i, o, n) { t.save(), t.translate(e + o / 2, i + n / 2), t.scale(o / 2, n / 2), t.moveTo(1, 0), t.arc(0, 0, .95, 0, 2 * Math.PI, !1), t.restore() }, r.prototype.hitTest = function(t) {
            var e, i, o, n, s = this.bars,
                r = .5 * this.barSpacing;
            if (0 === s.length) return null;
            if (t.x < s[0].time - r) return null;
            if (t.x > s[s.length - 1].time + r) return null;
            for (e = null, i = 0; i < s.length; ++i)
                if (o = s[i], t.x <= o.time + r) { e = o; break }
            return n = N.selectionTolerance(this.barWidth), e && e.high - n <= t.y && t.y <= e.low + n ? new F(F.REGULAR) : null
        }, a.prototype.draw = function(t) { var e, i, o, n, s; for (t.translate(.5, .5), t.fillStyle = this.lineColor, e = this.lineWidth, i = 0; i < this.items.length; ++i) o = this.items[i], n = o.x, s = o.y, o.style && (t.fillStyle = o.style.color, e = o.style.width), t.fillRect(Math.round(n - .5 * e), s, e, this.histogramBase - s) },
        a.prototype.hitTest = function(t) {
            var e, i, o, n, s, r = N.selectionTolerance(this.lineWidth);
            for (s = 0; s < this.items.length; ++s)
                if (e = this.items[s], i = e.x, o = e.y, n = R.distanceToSegment(new R.Point(i, o), new R.Point(i, this.histogramBase), new R.Point(t.x, t.y)), n.distance <= r) return new F(F.REGULAR);
            return null
        }, l.prototype.draw = function(t) {
            var e, i, o, n, s, r, a, l, h, c, d, p, u;
            if (0 !== this.items.length) {
                for (e = this.barSpacing, i = this.lineColor, o = this.histogramBase, t.translate(.5, .5), n = {}, s = this.items, r = 0; r < s.length; ++r) a = s[r], l = 0 === r ? null : s[r - 1], h = a.style ? a.style.color : i, c = n[h] || [], c.push({ item: a, prev: l }), n[h] = c;
                for (h in n) {
                    for (c = n[h], t.fillStyle = h, t.strokeStyle = h, t.lineWidth = 1, t.beginPath(), r = 0; r < c.length; r++) a = c[r].item, d = Math.ceil(a.x - .5 * e), p = Math.ceil(d + e), u = a.y, t.rect(d, u, p - d, o - u);
                    for (t.fill(), t.beginPath(), r = 0; r < c.length; r++) a = c[r].item, d = Math.ceil(a.x - .5 * e), p = Math.ceil(d + e), u = a.y, l = c[r].prev, t.moveTo(p - .5, o), t.lineTo(p - .5, u + .5), t.lineTo(d + .5, u + .5), l && l.y > u && t.lineTo(d + .5, l.y);
                    t.stroke()
                }
            }
        }, l.prototype.hitTest = function(t) {
            var e, i, o, n = .5 * this.barSpacing + this.lineWidth,
                s = t.x - n,
                r = t.x + n,
                a = this.items;
            for (e = a.length; e--;)
                if ((i = a[e].x) >= s && i <= r && (o = a[e].y, t.y >= Math.min(o, this.histogramBase) && t.y <= Math.max(o, this.histogramBase))) return new F(F.REGULAR);
            return null
        }, h.prototype.draw = function(t) { t.lineCap = "square", t.lineJoin = this.withMarkers ? "round" : "miter", t.strokeStyle = this.lineColor, t.fillStyle = this.lineColor, t.lineWidth = this.lineWidth, t.lineStyle = this.lineStyle, this._simpleMode ? this._drawSimpleMode(t) : this._drawLines(t) }, h.prototype._drawSimpleMode = function(t) {
            var e, i, o, n;
            if (t.beginPath(), this.walkLine(t, this.items), t.stroke(), this.withMarkers) {
                for (e = this.lineWidth + 2, i = 2 * Math.PI, t.beginPath(), n = this.items.length; n--;)(o = this.items[n]) && (t.moveTo(o.x, o.y), t.arc(o.x, o.y, e, 0, i));
                t.fill()
            }
        }, h.prototype.walkLine = function(t, e, i, o) {
            var n, s, r, a, l, h, c, d, p, u, _;
            if (e) {
                for (n = .25 * this.barSpacing, c = N.paneRendererCoordinateIsValid, d = 0, p = e.length; d < p; d++)
                    if (u = e[d], c(u.y)) { r = u, s = d; break }
                if (void 0 !== s && r)
                    for (_ = this.withSteps && this.lineWidth && this.lineWidth % 2 == 0 ? .5 : 0, d = s, p = e.length; d < p; d++) {
                        if (l = e[d], h = e[d + 1] || {}, c(l.y))
                            if (a && c(a.y)) this.withSteps && t.lineTo(a.x + _, l.y + _), t.lineTo(l.x + _, l.y + _), i && !c(h.y) && t.lineTo(l.x + _, o);
                            else if (h && c(h.y)) i ? (d !== s && t.lineTo(l.x + _, o), t.lineTo(l.x + _, l.y + _)) : t.moveTo(l.x + _, l.y + _);
                        else if (i) {
                            if (0 === d) continue;
                            d !== s && t.lineTo(l.x - n + _, o), t.lineTo(l.x - n + _, l.y + _), t.lineTo(l.x + n + _, l.y + _), t.lineTo(l.x + n + _, o)
                        } else t.moveTo(l.x - n + _, l.y + _), t.lineTo(l.x + n + _, l.y + _);
                        a = l
                    }
            }
        }, h.prototype._drawLines = function(t) {
            function e(e, i, o) { r(i.y) && (r(e.y) ? t.lineTo(i.x, i.y) : o && r(o.y) ? t.moveTo(i.x, i.y) : (t.moveTo(i.x - s, i.y), t.lineTo(i.x + s, i.y))) }
            var i, o, n, s, r, a, l, h, c, d, p, u, _, f;
            if (this.items.length) {
                for (s = .25 * this.barSpacing, r = N.paneRendererCoordinateIsValid, t.beginPath(), a = this.items[0], a && t.moveTo(a.x, a.y), l = t.strokeStyle, h = t.lineWidth, c = t.lineStyle, d = 1; d < this.items.length; ++d) i = this.items[d - 1], o = this.items[d], n = this.items[d + 1], o.style && !this.forceLineColor ? (p = o.style.color, u = o.style.width, _ = o.style.style) : (p = this.lineColor, u = this.lineWidth, _ = this.lineStyle),
                    this.ignorePaletteLineWidth && (u = this.lineWidth), f = p !== l || u !== h || _ !== c, f ? (l = p, h = u, c = _, t.stroke(), t.beginPath(), t.strokeStyle = p, t.lineWidth = u, t.lineStyle = _, _ === CanvasEx.LINESTYLE_SOLID ? (t.moveTo(i.x, i.y), e(i, o, n)) : CanvasEx.drawLine(t, i.x, i.y, o.x, o.y)) : e(i, o, n);
                t.stroke()
            }
        }, h.prototype.hitTest = function(t) {
            for (var e, i, o, n, s, r, a, l, h = N.selectionTolerance(this.lineWidth), c = 0, d = this.items.length - 1; d - c > 2;) r = Math.round((d + c) / 2), a = this.items[r], a.x <= t.x ? c = r : d = r;
            for (c = Math.max(1, c - 1), d = Math.min(this.items.length - 1, d + 1), l = c; l <= d; ++l)
                if (e = this.items[l - 1], i = this.items[l], o = e.x, n = i.x, s = R.distanceToSegment(new R.Point(o, e.y), new R.Point(n, i.y), new R.Point(t.x, t.y)), s.distance <= h) return this.hittest ? this.hittest : new F(F.REGULAR);
            return null
        }, inherit(c, h), c.prototype.draw = function(t) {
            var e, i, o, n, s, r, a, l, c, d, p, u;
            if (0 !== this.items.length) {
                for (t.lineCap = "square", t.strokeStyle = this.lineColor, t.lineWidth = this.lineWidth, t.lineStyle = this.lineStyle, t.lineWidth = 1, e = 0; e < this.items.length && !N.paneRendererCoordinateIsValid(this.items[e].y);) e++;
                for (i = this.items.length - 1; i >= 0 && !N.paneRendererCoordinateIsValid(this.items[i].y);) i--;
                if (!(e >= i)) {
                    for (t.translate(.5, .5), o = {}, n = this.items, s = e; s <= i; s++) r = n[s], a = r.style ? r.style.color : this.lineColor, s < i && n[s + 1].style && (l = n[s + 1].style.color, a !== l && (c = o[l] || [], c.push(r), o[l] = c)), d = o[a] || [], d.push(r), o[a] = d;
                    for (a in o) {
                        for (d = o[a], t.beginPath(), p = 0, s = 0; s < d.length; s++) d[s].style && d[s].style.color !== a && (t.moveTo(d[p].x, this.bottom), this.walkLine(t, d.slice(p, s), !0, this.bottom), p = s);
                        t.moveTo(d[p].x, this.bottom), this.walkLine(t, d.slice(p, d.length), !0, this.bottom), t.closePath(), this.isSeries ? (u = t.createLinearGradient(0, 0, 0, this.bottom), u.addColorStop(0, this.color1), u.addColorStop(1, this.color2), t.fillStyle = u, this._simpleMode = !0) : t.fillStyle = a, t.fill()
                    }
                    t.lineWidth = this.lineWidth, h.prototype.draw.call(this, t)
                }
            }
        }, d.prototype.draw = function(t) {
            var e, i, o, n, s, r, a, l, h, c, d, p, u, _, f = this.bars,
                m = this._data.barSpacing,
                g = this._data.drawWick,
                v = this._data.drawBorder,
                y = this._data.wickColor,
                b = this._barBorderWidth,
                w = this._barWidth;
            if (t.lineCap = "square", t.lineStyle = this._data.lineStyle, m < 1) {
                if (g) {
                    for (t.strokeStyle = y, t.lineWidth = 1, t.beginPath(), c = f.length; c-- > 0;) d = f[c], t.moveTo(d.time, d.low), t.lineTo(d.time, d.high);
                    t.stroke()
                }
                for (t.lineWidth = 1, p = "", u = !1, t.beginPath(), c = f.length; c-- > 0;) d = f[c], h = d.time, p !== d.color && (u && (t.stroke(), t.beginPath(), u = !1), t.strokeStyle = d.color, p = d.color), t.moveTo(d.time, d.open), t.lineTo(d.time, d.close), u = !0;
                u && t.stroke()
            } else {
                if (f = f.slice().sort(function(t, e) { return t.color > e.color ? -1 : t.color < e.color ? 1 : 0 }), t.translate(.5, .5), t.lineWidth = b, g)
                    for (_ = y, t.fillStyle = y, c = f.length; c--;) d = f[c], h = d.time, e = d.open, i = d.high, o = d.low, n = d.close, d.wickColor && d.wickColor !== _ && (t.fillStyle = d.wickColor, _ = d.wickColor), a = Math.min(e, n), l = Math.max(e, n), d.hollow ? (t.fillRect(h, i, 1, a - i), t.fillRect(h, l, 1, o - l)) : t.fillRect(h, i, 1, o - i);
                if (v)
                    for (c = f.length; c--;) d = f[c], f[c + 1] && d.borderColor === f[c + 1].borderColor || (t.fillStyle = d.borderColor), d.hollow || (h = d.time, e = d.open, n = d.close, s = Math.round(h - w), r = Math.round(h + w), a = Math.min(e, n),
                        l = Math.max(e, n), t.fillRect(s, a, r - s + 1, l - a + 1));
                for (c = f.length; c--;) d = f[c], h = d.time, e = d.open, i = d.high, o = d.low, n = d.close, s = Math.round(h - w), r = Math.round(h + w), a = Math.min(e, n), l = Math.max(e, n), f[c + 1] && d.color === f[c + 1].color || (t.strokeStyle = d.color), t.fillStyle = d.color, Math.abs(a - l) <= 1 && (t.fillStyle = d.borderColor), d.hollow ? (t.translate(-.5, -.5), t.strokeRect(s + 1, a + 1, r - s, l - a), t.translate(.5, .5)) : (v && (s += 1, a += 1, r -= 1, l -= 1), t.fillRect(s, a, r - s + 1, l - a + 1))
            }
        }, d.prototype.hitTest = function(t) {
            var e, i, o, n, s = this.bars,
                r = .5 * this._data.barSpacing;
            if (0 === s.length) return null;
            if (t.x < s[0].time - r) return null;
            if (t.x > s[s.length - 1].time + r) return null;
            for (e = null, i = 0; i < s.length; ++i)
                if (o = s[i], t.x <= o.time + r) { e = o; break }
            return n = N.selectionTolerance(this._barBorderWidth), e && e.high - n <= t.y && t.y <= e.low + n ? this._data.hittest || new F(F.REGULAR) : null
        }, p.prototype.draw = function(t) {
            var e, i, o, n, s, r, a, l, h = !1;
            for (o = 0; o < this.items.length; ++o) n = this.items[o], s = n.x, r = n.y, TradingView.isNaN(s) || TradingView.isNaN(r) || (null != n.style ? (a = n.style.color, e = n.style.width) : (a = this.lineColor, e = this.lineWidth), a !== i && (i = a, h && t.fill(), t.beginPath(), t.fillStyle = a), l = 3 * e, t.rect(s - l / 2, r - e / 2, l, e), t.rect(s - e / 2, r - l / 2, e, l), h = !0);
            h && t.fill()
        }, p.prototype.hitTest = function(t) {
            var e, i, o, n, s, r, a = N.selectionTolerance(this.lineWidth);
            for (r = 1; r < this.items.length; ++r)
                if (e = this.items[r - 1], i = this.items[r], o = e.x, n = i.x, s = R.distanceToSegment(new R.Point(o, e.y), new R.Point(n, i.y), new R.Point(t.x, t.y)), s.distance <= a) return new F(F.REGULAR);
            return null
        }, u.prototype.draw = function(t) {
            var e, i, o, n, s, r, a, l = 2 * Math.PI,
                h = !1;
            for (o = 0; o < this.items.length; ++o) n = this.items[o], s = n.x, r = n.y + this.vertOffset, TradingView.isNaN(s) || TradingView.isNaN(r) || (null != n.style ? (a = n.style.color, e = n.style.width) : (a = this.lineColor, e = this.radius), a !== i && (i = a, h && t.fill(), t.beginPath(), t.fillStyle = a), t.moveTo(s + e, r), t.arc(s, r, e, 0, l, !1), h = !0);
            h && t.fill()
        }, u.prototype.hitTest = function(t) {
            var e, i, o, n = 2 * this.radius,
                s = this.vertOffset,
                r = N.selectionTolerance(n);
            for (e = 0; e < this.items.length; ++e)
                if ((i = this.items[e]) && (o = new R.Point(i.x, i.y + s), o.substract(t).length() + this.radius <= r)) return new F(F.REGULAR);
            return null
        }, inherit(_, R.Point), f.prototype._calculateVerticalOffset = function(t) { return Math.round((t || 0) / 4) }, f.prototype._calculateMinHeight = function(t) { return this.width || this._calculateWidth(t) }, f.prototype._calculateWidth = function(t) { var t = t || this.barSpacing; return Math.round(t / 2) }, f.prototype.draw = function(t) {
            var e, i, o, n, s, r, a, l = this.width,
                h = l < 4,
                c = Math.max(parseInt(l / 2), 1),
                d = Math.round(this.width / 2),
                p = Math.round(this.width);
            for (t.translate(1, 1), e = 0, i = this.items.length; e < i; e++) o = this.items[e], n = o.isUp ? -1 : 1, s = Math.abs(o.height), r = o.y - n * this.vertOffset, t.beginPath(), t.translate(o.x, r), h ? (t.moveTo(0, 0), t.lineTo(-d, -d * n), t.moveTo(0, 0), t.lineTo(d, -d * n), t.moveTo(0, 0), t.lineTo(0, -s * n), t.moveTo(-d, -s * n), t.lineTo(d, -s * n), t.lineWidth = c, t.strokeStyle = o.isUp ? this.colorUp : this.colorDn, t.stroke()) : (t.moveTo(0, 0), s < p ? (t.lineTo(l, -s * n), t.lineTo(-l, -s * n)) : (t.lineTo(l, -p * n), t.lineTo(d, -p * n), t.lineTo(d, -s * n), t.lineTo(-d, -s * n), t.lineTo(-d, -p * n), t.lineTo(-l, -p * n)),
                t.lineTo(0, 0), a = o.isUp ? this.colorBorderUp : this.colorBorderDown, t.strokeStyle = a, t.stroke(), t.fillStyle = o.isUp ? this.colorUp : this.colorDn, t.fill()), t.translate(-o.x, -r);
            t.translate(-1, -1)
        }, f.prototype.hitTest = function(t) {
            var e, i, o, n, s, r, a, l, h, c = Math.round(this.width / 2),
                d = Math.round(this.width);
            for (e = 0; e < this.items.length; ++e)
                if ((i = this.items[e]) && void 0 !== i.x && null !== i.x && !TradingView.isNaN(i.x) && void 0 !== i.y && null !== i.y && !TradingView.isNaN(i.y) && (o = Math.abs(i.height), n = i.isUp ? -1 : 1, s = o + d, r = i.y - n * this.vertOffset, a = r - n * s, l = i.x - c, h = i.x + c, l < t.x && t.x < h && (i.isUp ? r < t.y && t.y < a : a < t.y && t.y < r))) return new F(F.REGULAR)
        }, m.prototype.draw = function(t) { this.drawShape(t), this.drawText(t) }, m.prototype.drawShape = function(t) { throw Error("Not implemented") }, m.prototype.drawText = function(t) {
            var e, i, o, n, s, r;
            if (this._textCache)
                for (e = 0, i = this.items.length; e < i; e++) o = this.items[e], n = o.x, s = o.y + this._vertOffset + this._textVertOffset, r = o.style && null != o.style.textColor ? o.style.textColor : this._textColor, this._textCache.paintTo(t, r, n, s, "center", this._vertOffset > 0 ? "top" : "bottom")
        }, m.prototype.hitTest = function(t, e) {
            var i, o, n, s, r, a, l, h, c, d, p, u, _, f = Math.max(this.height, this.width),
                m = this._vertOffset,
                g = this._textVertOffset;
            for (e = e || F.REGULAR, o = 0; o < this.items.length; ++o)
                if (n = this.items[o]) { if (i = new R.Point(n.x, n.y + m), i.substract(t).length() <= f) return new F(e, {}); if (this._textCache && (s = this._textImageWidth / 2, r = n.y + m + g, a = m > 0 ? 0 : -this._textImageHeight, l = m > 0 ? this._textImageHeight : 0, h = t.x, c = t.y, d = n.x - s, p = r + a, u = n.x + s, _ = r + l, h > d && h < u && c > p && c < _)) return new F(e, {}) }
            return null
        }, inherit(g, m), g.prototype.drawShape = function(t) { var e, i, o, n, s, r, a = this._vertOffset > 0 ? 1 : -1; for (e = 0, i = this.items.length; e < i; e++) o = this.items[e], n = o.x, s = o.y + this._vertOffset - a * Math.round(this.height / 2), r = o.style && null != o.style.color ? o.style.color : this._color, this._charCache.paintTo(t, r, n, s, "center", this._vertOffset > 0 ? "middle" : "bottom") }, g.prototype.hitTest = function(t) {
            var e, i, o, n = this._vertOffset,
                s = N.selectionTolerance(this.height);
            for (e = 0; e < this.items.length; ++e)
                if ((i = this.items[e]) && (o = new R.Point(i.x, i.y + n), o.substract(t).length() <= s)) return new F(F.REGULAR);
            return null
        }, inherit(v, m), v.prototype.drawShape = function(t) {
            var e, i, o, n, s, r, a, l, h, c, d;
            for (t.lineWidth = 2, e = this.width, i = this.height, o = this._vertOffset, s = !1, r = 0, a = this.items.length; r < a; r++) l = this.items[r], h = l.style && null != l.style.color ? l.style.color : this._color, h !== n && (n = h, s && t.stroke(), t.beginPath(), t.strokeStyle = h), c = l.x - e / 2, d = l.y - i / 2 + o, t.moveTo(c, d), t.lineTo(c + e, d + i), t.moveTo(c, d + i), t.lineTo(c + e, d), s = !0;
            s && t.stroke()
        }, inherit(y, m), y.prototype.drawShape = function(t) {
            var e, i, o, n, s, r, a, l, h = this.width,
                c = this.height,
                d = Math.round(c / 3),
                p = this._vertOffset - 2 * d,
                u = !1;
            for (i = 0, o = this.items.length; i < o; i++) n = this.items[i], n.style && null != n.style.color ? (s = n.style.color, r = n.style.borderColor) : (s = this._color, r = this._borderColor), s !== e && (e = s, u && (t.fill(), t.stroke()), t.beginPath(), t.fillStyle = s, t.strokeStyle = r), a = n.x, l = n.y + p, t.moveTo(a, l), t.lineTo(a + h / 2, l + c), t.lineTo(a - h / 2, l + c), t.lineTo(a, l), u = !0;
            u && (t.fill(), t.stroke())
        }, inherit(b, m),
        b.prototype.drawShape = function(t) {
            var e, i, o, n, s, r, a, l, h = this.width,
                c = this.height,
                d = Math.round(c / 3),
                p = this._vertOffset - d,
                u = !1;
            for (i = 0, o = this.items.length; i < o; i++) n = this.items[i], n.style && null != n.style.color ? (s = n.style.color, r = n.style.borderColor) : (s = this._color, r = this._borderColor), s !== e && (e = s, u && (t.fill(), t.stroke()), t.beginPath(), t.fillStyle = s, t.strokeStyle = r), a = n.x - h / 2, l = n.y + p, t.moveTo(a, l), t.lineTo(a + h, l), t.lineTo(a + h / 2, l + c), t.lineTo(a, l), u = !0;
            u && (t.fill(), t.stroke())
        }, inherit(w, m), w.prototype.drawShape = function(t) {
            var e, i, o, n, s, r, a, l = this.width,
                h = this.height,
                c = this._vertOffset,
                d = !1;
            for (i = 0, o = this.items.length; i < o; i++) n = this.items[i], s = n.style && null != n.style.color ? n.style.color : this._color, s !== e && (e = s, d && t.fill(), t.beginPath(), t.fillStyle = s), r = n.x + l / 2, a = n.y - h / 2 + c, t.moveTo(r, a), t.lineTo(r, a + h), t.lineTo(r - l, a + h / 2), t.lineTo(r, a), d = !0;
            d && t.fill()
        }, inherit(S, m), S.prototype.drawShape = function(t) {
            var e, i, o, n, s, r, a, l, h = this.width,
                c = this.height,
                d = c / 2,
                p = this._vertOffset,
                u = 3,
                _ = (h - u) / 3,
                f = !1;
            for (i = 0, o = this.items.length; i < o; i++) n = this.items[i], n.style && null != n.style.color ? (s = n.style.color, r = n.style.borderColor) : (s = this._color, r = this._borderColor), s !== e && (e = s, f && (t.fill(), t.stroke()), t.beginPath(), t.fillStyle = s, t.strokeStyle = r), a = n.x - h / 2, l = n.y - d + p, t.moveTo(a, l), t.lineTo(a + u, l), t.bezierCurveTo(a + _, l - _, a + 2 * _, l + _, a + h, l), t.lineTo(a + h, l + d), t.bezierCurveTo(a + h - _, l + d + _, a + h - 2 * _, l + d - _, a + u, l + d), t.lineTo(a + u, l + c), t.lineTo(a, l + c), t.lineTo(a, l), f = !0;
            f && (t.fill(), t.stroke())
        }, inherit(T, m), T.prototype.drawShape = function(t) {
            var e, i, o, n, s, r, a, l, h, c, d;
            for (t.lineWidth = 2, e = this.width, i = this.height, o = this._vertOffset, s = !1, r = 0, a = this.items.length; r < a; r++) l = this.items[r], h = l.style && null != l.style.color ? l.style.color : this._color, h !== n && (n = h, s && t.stroke(), t.beginPath(), t.strokeStyle = h), c = l.x - e / 2, d = l.y - i / 2 + o, t.moveTo(c + e / 2, d), t.lineTo(c + e / 2, d + i), t.moveTo(c, d + i / 2), t.lineTo(c + e, d + i / 2), s = !0;
            s && t.stroke()
        }, inherit(C, m), C.prototype.drawShape = function(t) {
            var e, i, o, n, s, r, a, l, h = Math.max(this.width, this.height) / 2,
                c = this._vertOffset,
                d = 2 * Math.PI,
                p = !1;
            for (i = 0, o = this.items.length; i < o; i++) n = this.items[i], n.style && null != n.style.color ? (s = n.style.color, r = n.style.borderColor) : (s = this._color, r = this._borderColor), s !== e && (e = s, p && (t.fill(), t.stroke()), t.beginPath(), t.fillStyle = s, t.strokeStyle = r), a = n.x, l = n.y + c, t.moveTo(a + h, l), t.arc(a, l, h, 0, d, !1), p = !0;
            p && (t.fill(), t.stroke())
        }, inherit(x, m), x.prototype._calculateWidth = function(t) { return t = t || this.barSpacing, Math.round(t / 4) }, x.prototype.drawShape = function(t) {
            var e, i, o, n, s, r, a, l, h = !1,
                c = this.width,
                d = Math.abs(this.height),
                p = c < 4,
                u = Math.max(parseInt(c / 2), 1),
                _ = Math.round(this.width / 2),
                f = Math.round(this.width),
                m = this._isUp ? -1 : 1;
            for (i = 0, o = this.items.length; i < o; i++) n = this.items[i], s = n.x, r = n.y + this._vertOffset + m * Math.round(d / 2), n.style && null != n.style.color ? (a = n.style.color, l = n.style.borderColor) : (a = this._color, l = this._borderColor), a !== e && (e = a, h && (t.fill(), t.stroke()), t.beginPath(), t.fillStyle = a, t.strokeStyle = l), t.translate(s, r), p ? (t.moveTo(0, 0), t.lineTo(-_, -_ * m), t.moveTo(0, 0), t.lineTo(_, -_ * m), t.moveTo(0, 0), t.lineTo(0, -d * m),
                t.moveTo(-_, -d * m), t.lineTo(_, -d * m), t.lineWidth = u) : (t.moveTo(0, 0), d < f ? (t.lineTo(c, -d * m), t.lineTo(-c, -d * m)) : (t.lineTo(c, -f * m), t.lineTo(_, -f * m), t.lineTo(_, -d * m), t.lineTo(-_, -d * m), t.lineTo(-_, -f * m), t.lineTo(-c, -f * m)), t.lineTo(0, 0)), t.translate(-s, -r), h = !0;
            h && (t.fill(), t.stroke())
        }, inherit(P, x), inherit(L, x), inherit(k, m), k.prototype.drawShape = function(t) {
            var e, i, o, n, s, r, a, l, h = !1,
                c = this._isUp ? 1 : -1,
                d = Math.round(this._shapeWidth / 2) - .5,
                p = Math.round(this._shapeHeight) - .5,
                u = 0;
            for (0 !== this._vertOffset && this._vertOffset < 0 === this._isUp && (u = -c * Math.round(p + this._stepY)), i = 0, o = this.items.length; i < o; i++) n = this.items[i], s = n.x + .5, r = n.y + this._vertOffset + u + .5, n.style && null != n.style.color ? (a = n.style.color, l = n.style.borderColor) : (a = this._color, l = this._borderColor), a !== e && (e = a, h && (t.fill(), t.stroke()), t.beginPath(), t.fillStyle = a, t.strokeStyle = l), t.translate(s, r), t.moveTo(0, 0), t.lineTo(this._stepX, this._stepY * c), t.lineTo(d, this._stepY * c), t.lineTo(d, p * c), t.lineTo(-d, p * c), t.lineTo(-d, this._stepY * c), t.lineTo(-this._stepX, this._stepY * c), t.lineTo(0, 0), t.translate(-s, -r), h = !0;
            h && (t.fill(), t.stroke())
        }, k.prototype.hitTest = function(t, e) {
            var i, o, n, s, r, a, l, h, c, d, p, u, _, f, m = this._stepY / 2,
                g = this._vertOffset,
                v = this._isUp ? 1 : -1;
            for (o = 0; o < this.items.length; ++o)
                if (n = this.items[o]) { if (s = v * m, 0 !== this._vertOffset && this._vertOffset < 0 === this._isUp && (s = -v * (this._shapeHeight + m)), i = new R.Point(n.x, n.y + g + s), i.substract(t).length() <= m) return new F(F.REGULAR); if (r = this._shapeWidth / 2, s = 0, 0 !== this._vertOffset && this._vertOffset < 0 === this._isUp && (s = -v * (this._shapeHeight + this._stepY)), a = n.y + g + s, l = this._isUp ? this._stepY : -this._shapeHeight, h = this._isUp ? this._shapeHeight : -this._stepY, c = t.x, d = t.y, p = n.x - r, u = a + l, _ = n.x + r, f = a + h, c > p && c < _ && d > u && d < f) return new F(F.REGULAR) }
            return null
        }, inherit(I, k), inherit(A, k), inherit(E, m), E.prototype.drawShape = function(t) {
            var e, i, o, n, s, r, a, l, h = !1,
                c = Math.round(this.height / 2);
            for (i = 0, o = this.items.length; i < o; i++) n = this.items[i], n.style && null != n.style.color ? (s = n.style.color, r = n.style.borderColor) : (s = this._color, r = this._borderColor), s !== e && (e = s, h && (t.fill(), t.stroke()), t.beginPath(), t.fillStyle = s, t.strokeStyle = r), a = n.x - c, l = n.y + this._vertOffset - c, t.rect(a, l, this.height, this.height), h = !0;
            h && (t.fill(), t.stroke())
        }, inherit(M, m), M.prototype.drawShape = function(t) {
            var e, i, o, n, s, r, a, l, h = !1,
                c = Math.round(this.height / 2);
            for (i = 0, o = this.items.length; i < o; i++) n = this.items[i], n.style && null != n.style.color ? (s = n.style.color, r = n.style.borderColor) : (s = this._color, r = this._borderColor), s !== e && (e = s, h && (t.fill(), t.stroke()), t.beginPath(), t.fillStyle = s, t.strokeStyle = r), a = n.x, l = n.y + this._vertOffset, t.moveTo(a, l - c), t.lineTo(a + c, l), t.lineTo(a, l + c), t.lineTo(a - c, l), t.lineTo(a, l - c), h = !0;
            h && (t.fill(), t.stroke())
        }, D.prototype.draw = function(t) {}, D.prototype.drawBackground = function(t) {
            var e, i, o;
            for (t.save(), t.translate(-.5, -.5), e = 0; e < this._items.length; ++e) i = this._items[e], null != i.color && (t.fillStyle = i.color, o = e === this._items.length - 1 ? this._w : this._items[e + 1].x - i.x, t.fillRect(i.x, this._y, o, this._h));
            t.restore()
        }, D.prototype.hitTest = function(t) { return null }, inherit(O, g),
        $.prototype._drawOrderArrow = function(t, e, i, o) {
            var n, s = e.x,
                r = e.y;
            o ? (t.rotate(Math.PI), s = -s - this._orderArrow.width / 2, r = -r - this._orderArrow.height) : (s -= this._orderArrow.width / 2, r -= this._orderArrow.height), i && (r -= i), n = o ? "floor" : "ceil", s = Math[n](s) + (o ? -.5 : .5), r = Math[n](r) + .5, t.translate(s, r), t.moveTo(.25 * this._orderArrow.width, 0), t.lineTo(.75 * this._orderArrow.width, 0), t.lineTo(.75 * this._orderArrow.width, .45 * this._orderArrow.height), t.lineTo(this._orderArrow.width, .45 * this._orderArrow.height), t.lineTo(.5 * this._orderArrow.width, this._orderArrow.height), i && (t.lineTo(this._orderArrow.width, this._orderArrow.height), t.lineTo(this._orderArrow.width, this._orderArrow.height + i), t.lineTo(0, this._orderArrow.height + i), t.lineTo(0, this._orderArrow.height), t.lineTo(.5 * this._orderArrow.width, this._orderArrow.height)), t.lineTo(0, .45 * this._orderArrow.height), t.lineTo(.25 * this._orderArrow.width, .45 * this._orderArrow.height)
        }, $.prototype._drawPriceArrow = function(t, e, i) {
            var o = e.x,
                n = e.y;
            i ? (t.rotate(Math.PI), o = -o - this._priceArrow.width, n = -n - this._priceArrow.height / 2) : (o -= this._priceArrow.width, n -= this._priceArrow.height / 2), o = Math.round(o) + (i ? -1.5 : .5), n = Math.floor(n) + .5, t.translate(o, n), t.moveTo(0, 0), t.lineTo(this._priceArrow.width, .5 * this._priceArrow.height), t.lineTo(0, this._priceArrow.height)
        }, $.prototype.draw = function(t) {
            t.beginPath();
            for (var e, i, o = 0; o < this._items.length; o++) e = this._items[o], i = "lower" === e.pos, t.save(), t.translate(0, i ? this._orderArrow.vMargin : -this._orderArrow.vMargin), this._drawOrderArrow(t, e.orderPoint, this._exitLineWidth, i), t.restore(), t.save(), this._drawPriceArrow(t, e.pricePoint, !i), t.restore();
            if (t.closePath(), t.fillStyle = this._color, t.fill(), this._text)
                for (t.font = this._text.fontSize + "px " + this._text.font, t.textAlign = "center", t.textBaseline = "top", o = 0; o < this._items.length; o++) e = this._items[o], i = "lower" === e.pos, t.save(), t.translate(0, i ? this._orderArrow.vMargin : -this._orderArrow.height - this._orderArrow.vMargin), e.label && (t.translate(0, i ? this._text.fontSize + this._text.vMargin + this._exitLineWidth : -this._text.fontSize - this._text.vMargin - this._exitLineWidth), t.fillText(e.label, Math.ceil(e.orderPoint.x), e.orderPoint.y), "number" != typeof this._textWidths[e.label] && (this._textWidths[e.label] = t.measureText(e.label).width)), e.qty && (t.translate(0, i ? this._text.fontSize + this._text.vMargin + this._exitLineWidth : -this._text.fontSize - this._text.vMargin - this._exitLineWidth), t.fillText(e.qty, Math.ceil(e.orderPoint.x), e.orderPoint.y), "number" != typeof this._textWidths[e.qty] && (this._textWidths[e.qty] = t.measureText(e.qty).width)), t.restore()
        }, $.prototype._testOrderArrows = function(t) {
            for (var e, i, o, n, s, r, a, l = 0, h = this._orderArrow.width / 2; l < this._items.length; l++)
                if (e = this._items[l].orderPoint, !(t.x < e.x - h || t.x > e.x + h || (i = this._items[l], o = "lower" === i.pos, n = this._orderArrow.height + this._exitLineWidth, o || (n = -n), s = e.y + (o ? this._orderArrow.vMargin : -this._orderArrow.vMargin), r = Math.min(s, s + n), a = Math.max(s, s + n), t.y < r || t.y > a))) return !0;
            return !1
        }, $.prototype._testText = function(t) {
            for (var e, i, o, n, s, r, a, l, h, c, d, p = 0; p < this._items.length; p++)
                if (e = this._items[p],
                    i = e.orderPoint, o = "lower" === e.pos, n = this._orderArrow.vMargin + this._orderArrow.height + this._exitLineWidth, o || (n = -n), s = i.y + n, r = this._text.vMargin + this._text.fontSize * (!!e.label + !!e.qty), o || (r = -r), a = Math.min(s, s + r), l = Math.max(s, s + r), !(t.y < a || t.y > l || (h = e.label && e.qty ? o && t.y < s + this._text.fontSize || !o && t.y > s - this._text.fontSize ? e.label : e.qty : e.label || e.qty, c = this._textWidths[h], d = c && c / 2, !c || t.x < i.x - d || t.x > i.x + d))) return !0;
            return !1
        }, $.prototype.hitTest = function(t) {
            var e = this._testOrderArrows(t),
                i = !e && this._text && this._testText(t);
            if (e || i) return new F(F.REGULAR)
        }, V.prototype.draw = function(t) {
            var e, i, o, n, s, r = this.data.vertLinesVisible,
                a = this.data.horzLinesVisible;
            (r || a) && this.data && (t.lineStyle = this.data.lineStyle, t.lineWidth = this.data.lineWidth, t.strokeStyle = this.data.color, e = this.data.lineWidth % 2 == 0 ? .5 : 0, i = this.data.x + 1 + e, o = this.data.y + e, n = this.data.w, s = this.data.h, r && i >= 0 && CanvasEx.drawLine(t, i, 0, i, s), a && o >= 0 && CanvasEx.drawLine(t, 0, o, n, o), this.data.drawCenter && (t.beginPath(), t.arc(i, o, 3, 0, 2 * Math.PI, !0), t.fillStyle = this.data.color, t.fill()))
        }, B.prototype._drawShackle = function(t) {
            var e = this._data.width - 3,
                i = e / 2,
                o = this._data.height - this._data.bodyHeight;
            t.moveTo(1.5, i), t.arc(this._data.width / 2, i, i, Math.PI, 2 * Math.PI), o > i && (t.moveTo(1.5, i), t.lineTo(1.5, o), t.moveTo(this._data.width - 1.5, i), t.lineTo(this._data.width - 1.5, o))
        }, B.prototype.draw = function(t) {
            var e, i, o, n;
            t.translate(this._data.x - this._data.width / 2, this._data.y - this._data.height / 2), e = "rgba(153,153,153,.3)", i = "rgba(153,153,153,.7)", o = "#777", n = "rgba(255,255,255,.7)", t.strokeStyle = e, t.lineWidth = 2, t.beginPath(), this._drawShackle(t), t.stroke(), t.closePath(), t.strokeStyle = i, t.lineWidth = 1, t.beginPath(), t.rect(0, this._data.height - this._data.bodyHeight + .5, this._data.width, this._data.bodyHeight), t.closePath(), t.stroke(), t.translate(0, -1), t.strokeStyle = o, t.beginPath(), this._drawShackle(t), t.stroke(), t.closePath(), t.fillStyle = n, t.beginPath(), t.rect(1, this._data.height - this._data.bodyHeight + 1.5, this._data.width - 2, this._data.bodyHeight - 2), t.fill(), t.beginPath(), t.rect(.5, this._data.height - this._data.bodyHeight + 1, this._data.width - 1, this._data.bodyHeight - 1), t.stroke(), t.closePath(), t.fillStyle = o, t.fillRect(this._data.width / 2 - .5, this._data.height - this._data.bodyHeight / 2, 1, 2)
        }, e.PaneRendererBars = TradingView.PaneRendererBars = o, e.PaneRendererRenkoPB = TradingView.PaneRendererRenkoPB = n, e.PaneRendererKagi = TradingView.PaneRendererKagi = s, e.PaneRendererPnF = TradingView.PaneRendererPnF = r, e.PaneRendererHistogram = TradingView.PaneRendererHistogram = a, e.PaneRendererColumns = TradingView.PaneRendererColumns = l, e.PaneRendererLine = TradingView.PaneRendererLine = h, e.PaneRendererArea = TradingView.PaneRendererArea = c, e.PaneRendererCandles = TradingView.PaneRendererCandles = d, e.PaneRendererCross = TradingView.PaneRendererCross = p, e.PaneRendererCircles = TradingView.PaneRendererCircles = u, e.PaneRendererCrossShape = TradingView.PaneRendererCrossShape = T, e.PaneRendererCrossHair = TradingView.PaneRendererCrossHair = V, e.PaneRendererCrossHairLock = TradingView.PaneRendererCrossHairLock = B,
        e.PaneRendererArrowsUpDownItem = TradingView.PaneRendererArrowsUpDownItem = _, e.PaneRendererArrowsUpDown = TradingView.PaneRendererArrowsUpDown = f, e.PaneRendererAbstractShape = TradingView.PaneRendererAbstractShape = m, e.PaneRendererUnicodeChar = TradingView.PaneRendererUnicodeChar = g, e.PaneRendererXCross = TradingView.PaneRendererXCross = v, e.PaneRendererTriangleApexUp = TradingView.PaneRendererTriangleApexUp = y, e.PaneRendererTriangleApexDown = TradingView.PaneRendererTriangleApexDown = b, e.PaneRendererTriangleApexLeft = TradingView.PaneRendererTriangleApexLeft = w, e.PaneRendererFlagShape = TradingView.PaneRendererFlagShape = S, e.PaneRendererCircleShape = TradingView.PaneRendererCircleShape = C, e.PaneRendererArrowsBase = TradingView.PaneRendererArrowsBase = x, e.PaneRendererArrowUp = TradingView.PaneRendererArrowUp = P, e.PaneRendererArrowDown = TradingView.PaneRendererArrowDown = L, e.PaneRendererLabelsBase = TradingView.PaneRendererLabelsBase = k, e.PaneRendererLabelUp = TradingView.PaneRendererLabelUp = I, e.PaneRendererLabelDown = TradingView.PaneRendererLabelDown = A, e.PaneRendererSquare = TradingView.PaneRendererSquare = E, e.PaneRendererDiamond = TradingView.PaneRendererDiamond = M, e.PaneRendererBackground = TradingView.PaneRendererBackground = D, e.PaneRendererClockIcon = TradingView.PaneRendererClockIcon = O, e.PaneRendererStudyStrategyOrders = TradingView.PaneRendererStudyStrategyOrders = $
}, function(t, e) {
    "use strict";

    function i() { return s.replace(/[xy]/g, function(t) { var e = 16 * Math.random() | 0; return ("x" === t ? e : 3 & e | 8).toString(16) }) }

    function o() { return n(12) }

    function n(t) { var e, i, o = ""; for (e = 0; e < t; ++e) i = Math.round(Math.random() * (r.length - 1)), o += r[i]; return o }
    var s, r;
    Object.defineProperty(e, "__esModule", { value: !0 }), s = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx", r = "0123456789abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", e.guid = i, e.randomHash = o, e.randomHashN = n
}, , , function(t, e, i) {
    "use strict";
    var o, n = function(t, e, o) {
        var s, r, a, l, h, c;
        t = $(t), o = o || {}, o.activeClass = o.activeClass || "", s = (o.event || "click") + ".popup-menu", o.hideEvent && (r = o.hideEvent + ".popup-menu"), a = function() {}, l = a, h = {}, c = function(s, r, c) {
            function d(e) {
                var i = $(e.target).parents().andSelf();
                i.is(f) || i.is(t) || i.is(".charts-popup-tab-headers, .charts-popup-itemheader") || l()
            }

            function p(t) {
                var e = $(t.target).parents().andSelf();
                e.is(".charts-popup-tab-headers, .charts-popup-itemheader") || o.notCloseOnButtons && e.is(".icon-delete") || l()
            }

            function u(e, s, r) {
                var a, l, h, c, d, p, _, m, g, v, y, b, w, S, T, C;
                if (e instanceof n.TabGroup) {
                    if (!e.tabs || !e.tabs.length) return;
                    return 1 !== e.tabs.length || e.tabs[0].title ? (a = $('<div class="charts-popup-tab-group"></div>').appendTo(r), l = $('<div class="charts-popup-tab-headers"></div>').appendTo(a), h = null, void $.each(e.tabs || [], function(t, i) {
                        var o, n;
                        i.items && i.items.length && (o = $('<div class="charts-popup-tab"></div>').hide().appendTo(a), $.each(i.items, function() { u(this, void 0, o) }), n = $('<span class="charts-popup-tab-header">').append($('<a href="javascript://" class="charts-popup-tab-header-label">').text(i.name)).appendTo(l), n.on("click", function(t) {
                            n.is(".active") || (l.find(".active").removeClass("active"),
                                n.addClass("active"), a.find(".charts-popup-tab").hide(), o.show(), t && t.preventDefault(), "function" == typeof e.onChange && e.onChange.call(e, i.name))
                        }), h && !i.active || (h = n, l.find(".active").removeClass("active"), n.addClass("active"), a.find(".charts-popup-tab").hide(), o.show()))
                    })) : void $.each(e.tabs[0].items, function() { u(this, void 0, r) })
                }
                return e instanceof n.Group ? (c = $('<div class="charts-popup-group"></div>').appendTo(r), e.title && (d = $('<div class="charts-popup-itemheader"></div>').text(e.title).prepend($('<span class="charts-popup-itemheader-icon"></span>')), e.collapsible && (c.addClass("charts-popup-group-collapsible"), c.toggleClass("collapsed", e.collapsed), d.on("click", function() { c.toggleClass("collapsed"), "function" == typeof e.onChange && e.onChange(c.hasClass("collapsed")), f.height() === parseInt(f.css("max-height")) ? f.addClass("popup-menu-scroll-y") : f.height() < parseInt(f.css("max-height")) && f.removeClass("popup-menu-scroll-y") })), c.append(d)), void $.each(e.items, function(t) { u(this, 1, c) })) : e instanceof n.Header ? void r.append($('<div class="charts-popup-itemheader"></div>').text(e.title)) : e.separator ? (p = $('<span class="separator"></span>'), void r.append(p)) : (p = $('<a class="item" href="#">'), e.url && p.attr("href", e.url), e.target && p.attr("target", e.target), s || p.addClass("first"), "function" == typeof e.active ? e.active(e) && p.addClass("active") : e.active && p.addClass("active"), e.addClass && p.addClass(e.addClass), e.addData && p.data(e.addData), e.disabled && p.addClass("disabled"), "function" == typeof e.action && (_ = e.action, m = function(t) { $(t.target).parents().andSelf().is(S) || (_.apply(p, arguments), !e.url && t && "function" == typeof t.preventDefault && t.preventDefault()) }, o.upAction ? p.bind("mouseup", m) : p.bind("click", m)), e.date ? (g = $('<span class="title"></span>').appendTo(p), $('<span class="date"></span>').text(e.date || "").appendTo(p)) : e.icon && !o.svg ? (v = $('<span class="icon"></span>').appendTo(p), v.css("background-image", e.icon.image || ""), e.icon.offset && v.css("background-position", "string" == typeof e.icon.offset ? e.icon.offset : e.icon.offset.x + "px " + e.icon.offset.y + "px"), g = $('<span class="title"></span>').appendTo(p)) : !0 === o.svg && e.svg ? (o.wrapIcon ? p.append($('<span class="icon-wrap">').append(e.svg)) : p.append(e.svg), g = $('<span class="title"></span>').appendTo(p)) : e.iconClass ? (p.append($('<span class="icon"></span>').addClass(e.iconClass)), g = $('<span class="title"></span>').appendTo(p)) : g = $('<span class="title-expanded"></span>').appendTo(p), e.html ? g.html(e.html) : g.text(TradingView.clean(e.title, !0) || ""), y = $('<span class="shortcut"></span>').appendTo(p), e.shortcut && y.text(e.shortcut.keys), "function" == typeof e.deleteAction && (b = e.deleteAction, w = e.deleteAction.title || $.t("Delete"), S = $('<span class="icon-delete">'), S.html(i(129)), S.attr("title", w), S.on("click", function(t) { b.apply(p, arguments), t.preventDefault() }), p.append(S)), e.buttons instanceof Array && e.buttons.length && e.buttons.forEach(function(t) { t.el instanceof $ || (t.el = $(t.el)), t.el.appendTo(p), t.handler && t.el.on("click", function(e) { t.handler.apply(p, arguments) }) }),
                    void 0 !== e.counter && ("function" == typeof e.counter ? (T = $('<span class="counter"></span>').html(e.counter()), T.appendTo(p)) : (C = e.counterBlue ? "blue" : "", $('<span class="counter"></span>').text(e.counter + "").addClass(C).appendTo(p))), r.append(p), void t.data("popup-menu", r))
            }
            var _, f, m, g, v, y, b, w, S, T, C, x, P, L, k, I, A, E, M, D, O, V, B, R, N, F, z = r || e;
            if ("function" == typeof z && (z = z()), $(this).hasClass("open") || $(this).hasClass("active")) return s.preventDefault(), l(), void(_ = h.scrollTop);
            switch (l = function() { h.scrollTop = f.scrollTop(), f.remove(), t.removeClass("active open " + o.activeClass), t.data("popup-menu", null), $(document).off("click", p), $(document).off("mousedown", d), Modernizr.touch && $(document).off("touchstart.chartgui", d), $(document).off("selectstart.popup-menu"), l = a, o.onRemove && o.onRemove() }, t.addClass("active open " + o.activeClass), f = $('<div class="charts-popup-list">'), o.addClass && f.addClass(o.addClass), o.zIndex && f.css("z-index", o.zIndex), m = f, o.listInner && (m = $('<div class="list-inner">').appendTo(m)), o.listTable && (m = $('<div class="list-table">').appendTo(m)), $.each(z, function(t) { u(this, t, m) }), setTimeout(function() { $(document).on("click", p), $(document).on("mousedown", d), Modernizr.touch && $(document).on("touchstart.chartgui", d) }, 0), o.upAction && $(document).on("selectstart.popup-menu", function() { return !1 }), f.appendTo(document.body), g = $(window).width(), v = Math.min($(window).height(), $("body").height()), y = t.outerWidth(), b = t.outerHeight(), w = t.offset(), _ = $(window).scrollTop() || 0, w.top -= _, w.top = Math.round(w.top), w.left = Math.round(w.left), S = f.outerWidth(), T = f.outerHeight(), C = void 0 !== o.viewportSpacing ? o.viewportSpacing : 10, x = o.popupSpacing ? ~~o.popupSpacing : 1, P = o.popupDrift ? ~~o.popupDrift : 0, L = T - f.height(), k = "down", o.direction && (k = "function" == typeof o.direction ? o.direction() : o.direction), I = !!o.reverse, "down" === k ? (A = v - w.top - b - x - C - L, E = w.top - x - C - L, A < Math.max(T || 0, 100) && E > A && (k = "up")) : "right" === k && (M = g - w.left - y - x - C - L, D = w.left - x - C - L, M < Math.max(S || 0, 100) && D > M && (k = "left")), k) {
                case "down":
                case "up":
                    "down" === k ? f.css("top", w.top + b + x + "px") : f.css("bottom", v - w.top + x + "px").css("top", "auto"), I ? f.css("left", Math.max(w.left + P + y - S, C) + "px").css("right", "auto") : f.css("left", w.left + P + "px").css("right", "auto");
                    break;
                case "right":
                case "left":
                    x = Math.max(x, 4), "right" === k ? f.css("left", Math.floor(w.left + y + x) + "px").css("right", "auto") : f.css("left", Math.floor(Math.max(w.left - S - x, C)) + "px").css("right", "auto"), I ? f.css("top", Math.floor(Math.max(w.top + P + b - T, C)) + "px") : f.css("top", Math.floor(w.top + P) + "px")
            }
            for (f.show(), O = w.top, "up" === k || { left: 1, right: 1 }[k] && I ? "up" !== k ? O += b : O -= b + x + L + C : O = v - O - b - 2 * x - L, f.height() > O && f.addClass("popup-menu-scroll-y"), f.css("max-height", O + "px"), o.careRightBorder && (V = g + $(window).scrollLeft(), parseInt(f.css("left")) + f.width() + C > V && f.css("left", V - f.width() - C + "px").css("right", "auto")), o.careBottomBorder && parseInt(f.css("top")) + f.height() + C > v + _ && f.css("top", v - f.height() - C + _ + "px"), R = t.parents().andSelf(), N = R.size(); N--;)
                if ("fixed" === R.eq(N).css("position")) { B = R.eq(N); break }
            B && (F = f.offset(), f.css({ position: "fixed", left: F.left - $(document).scrollLeft(), right: "auto" })),
                f[0].scrollHeight > f.height() && f.addClass("popup-with-scroll"), s && s.preventDefault()
        }, s && t.bind(s, c), r && t.bind(r, function() { l() }), o.runOpened && c()
    };
    n.TabGroup = function t(e) {
        if (!(this instanceof t)) return new t(e);
        e = e || {}, this.tabs = [], "function" == typeof e.onChange && (this.onChange = e.onChange)
    }, n.TabGroup.prototype.appendTab = function(t, e, i) { if (null == t ? t = "" : t += "", e || (e = []), i || (i = {}), !Array.isArray(e)) throw new TypeError("items must be an array"); return this.tabs.push({ name: t, items: e, active: !!i.active }), e }, n.Header = function t(e) {
        if (!(this instanceof t)) return new t(e);
        this.title = e
    }, n.Group = function t(e) {
        if (!(this instanceof t)) return new t(e);
        e = e || {}, this.items = [], this.title = null == e.title ? "" : e.title + "", this.collapsible = !!e.collapsible, this.collapsed = !!e.collapsed, "function" == typeof e.onChange && (this.onChange = e.onChange)
    }, n.Group.prototype.push = function() { this.items.push.apply(this.items, arguments) }, e.bindPopupMenu = n, o = function(t) { t = $(t), t.unbind(".popup-menu"), t.removeData("popup-menu") }, e.unbindPopupMenu = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { s.call(this, t, e), this._linetool = i, this.prepareLayout() }
    var n = i(5),
        s = n.PropertyPage,
        r = n.GreateTransformer,
        a = n.LessTransformer,
        l = n.ToIntTransformer,
        h = n.SimpleStringBinder;
    i(126), inherit(o, s), o.BarIndexPastLimit = -5e4, o.BarIndexFutureLimit = 15e3, o.prototype.bindBarIndex = function(t, e, i, n) {
        var s = [l(t.value()), r(o.BarIndexPastLimit), a(o.BarIndexFutureLimit)];
        this.bindControl(new h(e, t, s, !1, i, n))
    }, o.prototype.createPriceEditor = function(t) {
        var e, i = this._linetool.ownerSource().formatter(),
            o = function(t) { return i.format(t) },
            n = function(t) { var e = i.parse(t); if (e.res) return e.price ? e.price : e.value },
            s = $("<input type='text'>");
        return s.TVTicker({ step: i._minMove / i._priceScale || 1, formatter: o, parser: n }), t && (e = [function(e) { var i = n(e); return void 0 === i ? t.value() : i }], this.bindControl(new h(s, t, e, !1, this.model(), "Change " + this._linetool + " point price")).addFormatter(function(t) { return i.format(t) })), s
    }, o.prototype._createPointRow = function(t, e, i) {
        var o, n, s, r, a, l = $("<tr>"),
            h = $("<td>");
        return h.html($.t("Price") + i), h.appendTo(l), o = $("<td>"), o.appendTo(l), n = this.createPriceEditor(e.price), n.appendTo(o), s = $("<td>"), s.html($.t("Bar #")), s.appendTo(l), r = $("<td>"), r.appendTo(l), a = $("<input type='text'>"), a.appendTo(r), a.addClass("ticker"), this.bindBarIndex(e.bar, a, this.model(), "Change " + this._linetool + " point bar index"), l
    }, o.prototype.prepareLayoutForTable = function(t) {
        var e, i, o, n, s, r = this._linetool.points(),
            a = r.length;
        for (e = 0; e < r.length; e++) i = r[e], (o = this._linetool.properties().points[e]) && (n = e || a > 1 ? " " + (e + 1) : "", s = this._createPointRow(i, o, n), s.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 }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e) { b.call(this, t, e), this._rendererCache = [{}, {}, {}, {}, {}, {}], this._invalidated = !0 }

    function n(t, e) {
        var i = e || new P("linetoolelliott");
        y.call(this, t, new o(this, t), i)
    }

    function s(t, e) {
        var i = e || new P("linetoolelliott");
        y.call(this, t, new o(this, t), i), this.version = s.version
    }

    function r(t, e) {
        this._constructor = "LineToolElliottImpulse";
        var i = e || new P("linetoolelliottimpulse");
        s.call(this, t, i)
    }

    function a(t, e) {
        this._constructor = "LineToolElliottTriangle";
        var i = e || new P("linetoolelliotttriangle");
        s.call(this, t, i)
    }

    function l(t, e) {
        this._constructor = "LineToolElliottTripleCombo";
        var i = e || new P("linetoolelliotttriplecombo");
        s.call(this, t, i)
    }

    function h(t, e) {
        var i = e || new P("linetoolelliott");
        y.call(this, t, new o(this, t), i), this.version = h.version
    }

    function c(t, e) {
        this._constructor = "LineToolElliottCorrection";
        var i = e || new P("linetoolelliottcorrection");
        h.call(this, t, i)
    }

    function d(t, e) {
        this._constructor = "LineToolElliottLineToolElliottDoubleCombo";
        var i = e || new P("linetoolelliottdoublecombo");
        h.call(this, t, i)
    }
    var p = i(37),
        u = p.parseRgb,
        _ = p.darkenRgb,
        f = p.rgbToHexString,
        m = p.rgbToBlackWhiteString,
        g = i(204).EllipseRendererSimple,
        v = i(16).TextRenderer,
        y = i(1).LineDataSource,
        b = i(9),
        w = i(11).TrendLineRenderer,
        S = i(47).Action,
        T = i(8),
        C = i(6),
        x = i(2),
        P = i(7).DefaultProperty,
        L = i(14);
    inherit(o, b), o.prototype.renderer = function() {
            var t, e, i, o, n, s, r, a, l, h, c, d, p, y, b, S, P, L, k, I, A;
            if (this._invalidated && (this.updateImpl(), this._invalidated = !1), !this._wave) return null;
            for (t = this.isAnchorsRequired() ? 0 : 1, e = new C, i = this._source.properties(), o = 0; o < this._wave.length; o++) e.append(new w(this._wave[o]));
            for (n = 1, this._points.length > 2 && (s = this._points[2], r = this._points[1], n = x.sign(s.y - r.y)), a = [], l = 0, this._model.lineBeingCreated() === this._source && (l = 1), h = m(u(this._model.backgroundColor())), c = i.color.value(), o = 0; o < this._points.length - l; o++, n = -n) o < t || (d = this._source.label(o), p = d.label, "circle" === d.decoration && (y = this._points[o].clone(), 1 === n ? y.y += 13 + d.fontIncrease / 2 : y.y -= 14 + d.fontIncrease / 2, b = (12 + d.fontIncrease) / 2 + 2, s = y.substract(new x.Point(b, b)), r = y.add(new x.Point(b, b)), S = { points: [s, r], color: f(_(u(c), "black" === h ? 15 : -15)), linewidth: 1, fillBackground: !1 }, P = new g(S), e.append(P)), "brackets" === d.decoration && (p = "(" + p + ")"), L = { points: [this._points[o]], text: p, color: f(_(u(c), "black" === h ? 15 : -15)), vertAlign: 1 === n ? "top" : "bottom", horzAlign: "center", font: "Arial", offsetX: 0, offsetY: 1 === n ? 5 : -10, fontsize: 12 + d.fontIncrease, bold: d.bold }, a.push(L), "" !== d && e.append(new v(L, this._rendererCache[o], new T(T.CHANGEPOINT, o))));
            if (this.isAnchorsRequired()) {
                for (k = [], I = 0; I < a.length; I++) A = this._points[I].clone(), A.y = a[I].points[0].y, A.data = I, k.push(A);
                this._model.lineBeingCreated() === this._source && k.pop(), e.append(this.createLineAnchor({ points: k }))
            }
            return e
        }, o.prototype.update = function() { this._invalidated = !0 }, o.prototype.updateImpl = function() {
            var t, e, i, o, n, s, r, a, l, h, c, d, p, u, _, f;
            if (b.prototype.update.call(this), this._wave = [], t = this._source.properties(), e = this._source.priceScale(), i = this._model.timeScale(), e && !e.isEmpty() && !i.isEmpty() && (this._source.priceScale().isPercent() && (o = this._source.ownerSource().firstValue()), n = t.color.value(), t.showWave.value()))
                for (s = this._source.points(), r = 1; r < s.length; r++) a = s[r - 1], l = s[r],
                    h = i.indexToCoordinate(a.index), c = i.indexToCoordinate(l.index), d = a.price, p = l.price, this._source.priceScale().isPercent() && (d = this._source.priceScale().priceRange().convertToPercent(d, o), p = this._source.priceScale().priceRange().convertToPercent(p, o)), u = e.priceToCoordinate(d), _ = e.priceToCoordinate(p), f = { points: [new x.Point(h, u), new x.Point(c, _)], width: i.width(), height: e.height(), color: L.generateColor(n, 0), linewidth: t.linewidth.value(), linestyle: CanvasEx.LINESTYLE_SOLID, extendleft: !1, extendright: !1, leftend: y.LINEEND_CIRCLE, rightend: y.LINEEND_CIRCLE, endstyle: { strokeWidth: 1, fillStyle: this._model.backgroundColor() }, overlayLineEndings: !0 }, this._wave.push(f)
        }, inherit(n, y), n.migrateState = function(t) {
            var e = { 0: 11, 1: 10, 2: 9, 3: 8, 4: 7, 5: 6, 6: 5, 7: 4, 8: 3 },
                i = { 0: 11, 1: 8 };
            "LineToolElliottSubminuette" === t.type && (t.type = "LineToolElliottImpulse", t.state.degree = e[t.state.wavesize]), "LineToolElliottMinor" === t.type && (t.type = "LineToolElliottImpulse", t.state.degree = e[t.state.wavesize]), "LineToolElliottCircle" === t.type && (t.type = "LineToolElliottImpulse", t.state.degree = e[t.state.wavesize]), "LineToolElliottMinorRetr" === t.type && (t.type = "LineToolElliottCorrection", t.state.degree = i[t.state.wavesize]), "LineToolElliottMajorRetr" === t.type && (t.type = "LineToolElliottCorrection", t.state.degree = i[t.state.wavesize])
        }, n.prototype.title = function() { return "Elliott Labels" }, n.degrees = [$.t("Supermillennium"), $.t("Millennium"), $.t("Submillennium"), $.t("Grand Supercycle"), $.t("Supercycle"), $.t("Cycle"), $.t("Primary"), $.t("Intermediate"), $.t("Minor"), $.t("Minute"), $.t("Minuette"), $.t("Subminuette"), $.t("Micro"), $.t("Submicro"), $.t("Miniscule")], n.prototype.additionalActions = function(t) {
            var e = new S({ text: $.t("Degree") }),
                i = this;
            return e.subActions = n.degrees.map(function(e, o) { var n = new S({ text: e, checkable: !0, checked: i.properties().degree.value() === o }); return n.callbacks().subscribe(null, function() { t.setProperty(i.properties().degree, o, "Change Elliott Degree") }), n }), [e]
        }, n.prototype.label = function(t) {
            var e = n.degrees.length - this.properties().degree.value() - 1,
                i = Math.floor(e / 3),
                o = e % 3;
            return { fontIncrease: 4 * Math.floor(i), bold: !!(i % 2), decoration: ["", "brackets", "circle"][o], label: this.labelsGroup()[i][t] }
        }, inherit(s, n), s.version = 3, s.prototype.pointsCount = function() { return 6 }, s.prototype.migrateVersion = function(t, e, i) {
            if (1 === t) {
                var o = $.extend({}, this._timePoint[0]);
                this._timePoint.unshift(o), this._points.length > 0 && (o = $.extend({}, this._points[0]), this._points.unshift(o))
            }
        }, inherit(r, s), r._labelsGroups = [
            ["0", "1", "2", "3", "4", "5"],
            ["0", "i", "ii", "iii", "iv", "v"],
            ["0", "1", "2", "3", "4", "5"],
            ["0", "I", "II", "III", "IV", "V"],
            ["0", "1", "2", "3", "4", "5"]
        ], r.prototype.labelsGroup = function() { return r._labelsGroups }, inherit(a, s), a._labelsGroups = [
            ["0", "A", "B", "C", "D", "E"],
            ["0", "a", "b", "c", "d", "e"],
            ["0", "A", "B", "C", "D", "E"],
            ["0", "a", "b", "c", "d", "e"],
            ["0", "A", "B", "C", "D", "E"]
        ], a.prototype.labelsGroup = function() { return a._labelsGroups }, inherit(l, s), l._labelsGroups = [
            ["0", "W", "X", "Y", "X", "Z"],
            ["0", "w", "x", "y", "x", "z"],
            ["0", "W", "X", "Y", "X", "Z"],
            ["0", "w", "x", "y", "x", "z"],
            ["0", "W", "X", "Y", "X", "Z"]
        ],
        l.prototype.labelsGroup = function() { return l._labelsGroups }, inherit(h, n), h.version = 3, h.prototype.pointsCount = function() { return 4 }, h.prototype.migrateVersion = function(t, e, i) {
            if (1 === t) {
                var o = $.extend({}, this._timePoint[0]);
                this._timePoint.insert(o, 0), this._points.length > 0 && (o = $.extend({}, this._points[0]), this._points.insert(o, 0))
            }
        }, inherit(c, h), c._labelsGroups = [
            ["0", "A", "B", "C"],
            ["0", "a", "b", "c"],
            ["0", "A", "B", "C"],
            ["0", "a", "b", "c"],
            ["0", "A", "B", "C"]
        ], c.prototype.labelsGroup = function() { return c._labelsGroups }, inherit(d, h), d._labelsGroups = [
            ["0", "W", "X", "Y"],
            ["0", "w", "x", "y"],
            ["0", "W", "X", "Y"],
            ["0", "w", "x", "y"],
            ["0", "W", "X", "Y"]
        ], d.prototype.labelsGroup = function() { return d._labelsGroups }, e.LineToolElliott = n, e.LineToolElliottImpulse = r, e.LineToolElliottTriangle = a, e.LineToolElliottTripleCombo = l, e.LineToolElliottCorrection = c, e.LineToolElliottDoubleCombo = d
}, function(t, e, i) {
    "use strict";

    function o() { this._text = "", this._background = "#585858", this._coordinate = 0 }
    var n = i(37),
        s = n.parseRgb,
        r = n.rgbToBlackWhiteString;
    o.prototype.text = function() { return this._text }, o.prototype.background = function() { return this._background }, o.prototype.color = function() { return r(s(this._background)) }, o.prototype.coordinate = function() { return this._coordinate }, o.prototype.floatCoordinate = function() { return this._floatCoordinate || this._coordinate }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t) { this._data = t }
    var n = i(14);
    o.prototype.draw = function(t, e) {
        var i, o, s, r, a, l, h, c, d, p, u, _, f, m, g, v, y, b, w, S;
        this._data.visible && (i = e.fontSize, t.font = e.font, o = e.tickLength, s = e.borderSize, r = e.paddingTop, a = e.paddingBottom, l = e.paddingInner, h = e.paddingOuter, c = Math.ceil(e.widthCache.measureText(t, this._data.text)), d = e.baselineOffset, t.strokeStyle = this._data.borderColor, t.fillStyle = n.resetTransparency(this._data.background), t.lineWidth = 1, p = e.fontSize + r + a, u = s + c + l + h + o, _ = this._data.coordinate, f = _ - Math.floor(i / 2) - r - .5, m = f + p, g = e.isLeft ? e.width - s - .5 : .5, v = g, this._data.text && (e.isLeft ? (v = g - u, y = g - o, b = v + h) : (v = g + u, y = g + o, b = g + s + o + l), t.beginPath(), t.moveTo(g, f), t.lineTo(v, f), t.lineTo(v, m), t.lineTo(g, m), t.fill(), t.beginPath(), t.strokeStyle = this._data.color, t.moveTo(g, _), t.lineTo(y, _), t.stroke(), t.textAlign = "left", t.fillStyle = this._data.color, t.fillText(this._data.text, b, m - a - d)), this._data.secondLine && (w = Math.ceil(e.widthCache.measureText(t, this._data.secondLine)), S = w + l + h, t.fillStyle = this._data.background, this._data.text && (f += p + 1, m += p + 1), e.isLeft ? (v = Math.min(v, e.width - o), g = v + S, b = v + h) : (g = Math.max(v - S, s), v = g + S, b = g + l), t.beginPath(), t.moveTo(g, f), t.lineTo(v, f), t.lineTo(v, m), t.lineTo(g, m), t.fill(), t.textAlign = "left", t.fillStyle = this._data.color, t.fillText(this._data.secondLine, b, m - a - d)))
    }, o.prototype.height = function(t, e) { var i = t.fontSize + t.paddingTop + t.paddingBottom; return this._data.secondLine && e ? 2 * i + 1 : i }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t) { this._data = t }

    function n(t, e) { this._data = t, this._model = e, this.radius = this._data.radius || n.OUTER_RADIUS }

    function s(t) { o.call(this, t) }
    var r = i(8),
        a = i(59).PaneRendererArrowsUpDown;
    o.RADIUS = 3.5, o.prototype.tolerance = 2, o.prototype.draw = function(t) {
        function e(t) { return void 0 === t.x || TradingView.isNaN(t.x) || null === t.x || void 0 === t.y || TradingView.isNaN(t.y) || null === t.y }
        var i, o, n;
        if (this._data)
            for (t.strokeStyle = "#6B6B6B", t.fillStyle = "#D6D6D6", i = this._data.vertOffset || 0, o = 0; o < this._data.points.length; o++) n = this._data.points[o], e(n) || this._drawMarker(t, n, i)
    }, o.prototype._drawMarker = function(t, e, i) { t.beginPath(), t.arc(e.x + .5, e.y + .5 + i, o.RADIUS, 0, 2 * Math.PI, !0), t.closePath(), t.fill(), t.stroke() }, o.prototype.hitTest = function(t) {
        var e, i;
        if (!this._data) return null;
        for (e = 0; e < this._data.points.length; e++)
            if (i = this._data.points[e], i.substract(t).length() <= o.RADIUS + this.tolerance) return new r(this._data.hittestResult, i.data);
        return null
    }, n.OUTER_RADIUS = TradingView.isMobile.any() ? 16 : 8, n.prototype.tolerance = 2, n.prototype.draw = function(t) {
        var e, i, o, n, s, r, a, l, h, c = this._data.currentPoint,
            d = this._data.outerStrokeWidth || 1;
        for (e = 0; e < this._data.points.length; e++) i = this._data.points[e], o = i.substract(c).length(), n = TradingView.isInteger(i.data) && this._data.linePointBeingEdited === i.data, s = this.radius, r = this._data.strokeWidth || 2, a = o <= s + this.tolerance, l = a ? 1 : 0, s += l, r += l, n || (i.square ? (t.fillStyle = this._data.backgroundColor, t.fillRect(i.x - s, i.y - s, 2 * s, 2 * s), t.fillStyle = this._data.color, h = s - d, t.fillRect(i.x - h, i.y - h, 2 * h, 2 * h), h = s - d - r, t.fillStyle = this._data.backgroundColor, t.fillRect(i.x - h, i.y - h, 2 * h, 2 * h)) : (t.beginPath(), t.arc(i.x, i.y, s, 0, 2 * Math.PI, !0), t.closePath(), t.fillStyle = this._data.backgroundColor, t.fill(), t.beginPath(), t.arc(i.x, i.y, s - d, 0, 2 * Math.PI, !0), t.closePath(), t.fillStyle = this._data.color, t.fill(), t.beginPath(), t.arc(i.x, i.y, s - d - r, 0, 2 * Math.PI, !0), t.closePath(), t.fillStyle = this._data.backgroundColor, t.fill()))
    }, n.prototype.hitTest = function(t) {
        var e, i, o;
        for (e = 0; e < this._data.points.length; e++)
            if (i = this._data.points[e], o = i.substract(t).length(), o <= this.radius + this.tolerance) return new r(this._data.hittestResult, i.data);
        return null
    }, inherit(s, o), s.prototype._drawMarker = function(t, e, i) {
        var n = e.isUp ? 1 : -1,
            s = a.prototype._calculateVerticalOffset(this._data.barSpacing),
            r = a.prototype._calculateMinHeight(this._data.barSpacing),
            l = i + n * s + n * r;
        t.beginPath(), t.arc(e.x + .5, e.y + .5 + l, o.RADIUS, 0, 2 * Math.PI, !0), t.closePath(), t.fill(), t.stroke()
    }, e.SelectionRenderer = o, e.LineAnchor = n, e.SelectionRendererArrowsUpDown = s
}, function(t, e, i) {
    (function(t, e, o) {
        "use strict";
        var n = i(222).regExpEscape,
            s = i(128).TVXWindowEvents,
            r = i(216).TVLocalStorage,
            a = window.TVSettings = function() {
                function i(t) { return E + "." + t }

                function o(t, e) { var i; return i = M[t], window.is_authenticated && !F || null != i || (i = M[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 M[t] !== o && (M[t] = o, m(t)), i.forceFlush && !V && (V = setTimeout(function() { V = void 0, g() }, A)), a
                }

                function u(t, e, i) { return p(t, JSON.stringify(e), i), a }

                function _(t, e) { return e = e || {}, null != M[t] && (delete M[t], m(t)), e.forceFlush && g(), a }

                function f() { O = void 0, D.length && g() }

                function m(t) {
                    if (z) null == M[t] ? z.removeValue(i(t)) : z.setValue(i(t), M[t]);
                    else if (!window.is_authenticated || F) try { null == M[t] ? r.removeItem(i(t)) : r.setItem(i(t), M[t]) } catch (t) {} else D.push(t), O || (O = setTimeout(f, I));
                    s.emit("settings", JSON.stringify({ key: t, value: M[t] }))
                }

                function g(e) {
                    var i, o, n, s, r;
                    if (!t.enabled("widget") && window.is_authenticated && !F && 0 !== D.length) {
                        for (i = D, D = [], o = {}, n = i.length; n--;) s = i[n], r = M[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 = E.length, e.substring(0, i + 1) === E + "." && (D = [], r.removeItem(e));
                    $.post("/restoredefaults/", {}, function(t) { TVDialogs.showNotice("Success", "Defaults has been successfully restored") }).error(function(t) {})
                }

                function y() { return Object.keys(M) }

                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 < B.length; ++e)
                        if (B[e].exec(t)) return !0;
                    return !1
                }

                function S() { var e, i, o, n, s; for (M = {}, e = E + ".", 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) || (M[s] = r.getItem(n))) }

                function T(t) {
                    var e, i, o, n, s;
                    for (M = {}, e = 0 === Object.keys(t).length, i = E + ".", 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));
                    Object.keys(t).forEach(function(e) { M[e] = t[e] + "" })
                }

                function C(t) { z ? T(z.initialSettings || {}) : window.is_authenticated && !F ? T(t || {}) : S(), R.fire() }

                function x(t) { z = t }
                var P, L, k, I, A, E, M, D, O, V, B, R, N = !1,
                    F = t.enabled("cqg_terminal"),
                    z = null;
                try { N = !TradingView.onWidget() && parent && parent !== window && !!parent.IS_DEMO_PAGE } catch (t) {}
                return N ? (P = { "widgetbar.layout-settings": { widgets: {}, settings: { minimized: !0 } }, notShowMainWizard: !0 }, L = function(t, e, i) { var o = P[t]; return null == o ? e : o }, k = function() {}, { loaded: !1, loadedModel: !1, getValue: L, getJSON: L, getBool: L, getFloat: L, getInt: L, setValue: k, setJSON: k, remove: k, restoreDefaults: k, keys: function() { return Object.keys(P) }, keysMask: function() { return [] }, sync: k, onSync: { subscribe: function() {} } }) : (I = 12e4, A = 10, "local" === window.environment && (I = 5e3), E = "tradingview", M = {}, D = [], B = [/^widgetbar\.widget\.watchlist.+/, /.+quicks$/, /^widgetbar\.layout-settings$/, /^ChartSideToolbarWidget\.visible$/, /^onwidget\.watchlist$/, /^domepanel.visible$/, /^chart\.favoriteDrawings$/, /^chart\.favoriteDrawingsPosition$/, /^ChartFavoriteDrawingToolbarWidget\.visible/, /^trading\.chart\.proterty$/, /^trading_floating_toolbar\.position$/], s.on("settings", function(t) {
                    var e = JSON.parse(t);
                    null == e.value ? delete M[e.key] : M[e.key] = e.value
                }), R = 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: R, setSettingsAdapter: x })
            }();
        void 0 !== o && o && o.exports && (o.exports = a)
    }).call(e, i(3), i(15), i(50)(t))
}, function(t, e, i) {
    "use strict";
    var o, n, s;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(73), n = i(27), s = function(t) {
        function e(e) { return void 0 === e && (e = 100), t.call(this, e) || this }
        return o.__extends(e, t), e.prototype.state = function() { var t = n.PriceFormatter.prototype.state.call(this); return t.percent = !0, t }, e.prototype.format = function(e, i, o, n) { return t.prototype.format.call(this, e, i, o, n) + "%" }, e
    }(n.PriceFormatter), e.PercentageFormatter = s
}, function(t, e, i) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 });
    var o = i(749);
    e.createDialog = o.createDialog
}, function(t, e, i) {
    "use strict";
    var o, n, s = i(41),
        r = i(3);
    ! function(t) { t[t.NotBound = 0] = "NotBound", t[t.BoundToWidget = 1] = "BoundToWidget", t[t.BoundToModel = 2] = "BoundToModel" }(o || (o = {})), n = function() {
        function t() { this._watchedSymbol = new s, this._seriesShortSymbol = new s, this._proSymbol = new s, this._watchedInterval = new s, this._watchedIntraday = new s, this._watchedSupportedResolutions = new s, this._symbolNamesList = new s, this._chartWidgetBindingState = o.NotBound, this._activeChartWidget = null, this._watchedSymbolListenerBound = this._watchedSymbolListener.bind(this), this._watchedIntervalListenerBound = this._watchedIntervalListener.bind(this), this._onSymbolLinkBound = this._onSymbolLink.bind(this), this._searchCharts = null, this._selfEmit = !1 }
        return Object.defineProperty(t.prototype, "symbol", { get: function() { return this._watchedSymbol }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "proSymbol", { get: function() { return this._proSymbol }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "symbolNamesList", { get: function() { return this._symbolNamesList }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "seriesShortSymbol", { get: function() { return this._seriesShortSymbol.readonly() }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "interval", { get: function() { return this._watchedInterval }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "intraday", { get: function() { return this._watchedIntraday.readonly() }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "supportedResolutions", { get: function() { return this._watchedSupportedResolutions.readonly() }, enumerable: !0, configurable: !0 }), t.prototype.bindToChartWidget = function(t) {
            var e, i;
            if (this.unbindFromChartWidget(), this._activeChartWidget = t, e = t.model()) return void this._onChartModelCreated(e);
            t.modelCreated().subscribe(this, this._onChartModelCreated), this._chartWidgetBindingState = o.BoundToWidget, i = t.properties().mainSeriesProperties, this._watchedSymbol.setValue(i.symbol.value()), this._watchedInterval.setValue(i.interval.value())
        }, t.prototype.unbindFromChartWidget = function() {
            switch (this._chartWidgetBindingState) {
                case o.BoundToWidget:
                    if (!this._activeChartWidget) throw Error("ChartWidget is undefined");
                    this._activeChartWidget.modelCreated().unsubscribe(this, this._onChartModelCreated);
                    break;
                case o.BoundToModel:
                    this._symbolProperty().unsubscribe(this, this._onSymbolPropertyChange), this._watchedSymbol.unsubscribe(this._watchedSymbolListenerBound), this._mainSeries().onSymbolResolved().unsubscribe(this, this._updateSeriesSymbolInfo), this._mainSeries().onSymbolError().unsubscribe(this, this._updateSeriesSymbolInfo), this._intervalProperty().unsubscribe(this, this._onIntervalPropertyChange), this._watchedInterval.unsubscribe(this._watchedIntervalListenerBound), delete this._watchedSymbol.hook, delete this._watchedSymbol.writeLock
            }
            this._activeChartWidget = null, this._chartWidgetBindingState = o.NotBound
        }, t.prototype.getChartWidget = function() { return this._activeChartWidget }, t.prototype.bindToChartWidgetCollection = function(t) {
            var e = this;
            this._chartWidgetCollection = t, this.unbindFromChartWidget(), t.activeChartWidget.subscribe(function(t) { e.unbindFromChartWidget(), e.bindToChartWidget(t) }, { callWithLast: !0 })
        }, t.prototype.bindToSearchCharts = function(t) { this.unbindFromSearchCharts(), this._searchCharts = t, t.onSearchBySymbol.subscribe(this, this._onSearchBySymbol), this._watchedSymbol.subscribe(this._onSymbolLinkBound) }, t.prototype.unbindFromSearchCharts = function() { this._searchCharts && (this._searchCharts.onSearchBySymbol.unsubscribe(this, this._onSearchBySymbol), this._watchedSymbol.unsubscribe(this._onSymbolLinkBound), this._searchCharts = null) }, t.prototype._onSearchBySymbol = function(t) {
            if (!t.resolved_symbol) throw Error("no resolved_symbol");
            this._selfEmit = !0, this._watchedSymbol.setValue(t.resolved_symbol), this._selfEmit = !1
        }, t.prototype._onSymbolLink = function(t) {
            if (!this._selfEmit) {
                if (!this._searchCharts) throw Error("No search charts defined");
                this._searchCharts.search(t)
            }
        }, t.prototype._mainSeries = function() { if (!this._activeChartWidget) throw Error("ChartWidget is undefined"); return this._activeChartWidget.model().mainSeries() }, t.prototype._properties = function() { return this._mainSeries().properties() }, t.prototype._symbolProperty = function() { return this._properties().symbol }, t.prototype._intervalProperty = function() { return this._properties().interval }, t.prototype._watchedSymbolListener = function(t) {
            (r.enabled("same_data_requery") || this._symbolProperty().value() !== t) && this._chartWidgetCollection.setSymbol(t)
        }, t.prototype._onSymbolPropertyChange = function() { this._watchedSymbol.setValue(this._symbolProperty().value()) }, t.prototype._onSymbolResolved = function(t) { this._proSymbol.setValue(t.pro_name || r.enabled("trading_terminal") && (t.full_name || t.name) || ""), t.aliases && this._symbolNamesList.setValue(t.aliases) }, t.prototype._updateSeriesSymbolInfo = function() {
            this._seriesShortSymbol.setValue(this._properties().shortName.value());
            var t = this._mainSeries().symbolInfo();
            t ? (this._onSymbolResolved(t), t.hasOwnProperty("supported_resolutions") ? this._watchedSupportedResolutions.setValue(t.supported_resolutions) : this._watchedSupportedResolutions.setValue(void 0),
                this._watchedIntraday.setValue(!!t.has_intraday)) : (this._watchedIntraday.deleteValue(), this._proSymbol.deleteValue())
        }, t.prototype._watchedIntervalListener = function(t) {
            (r.enabled("same_data_requery") || this._intervalProperty().value() !== t) && this._chartWidgetCollection.setResolution(t)
        }, t.prototype._onIntervalPropertyChange = function() { this._watchedInterval.setValue(this._intervalProperty().value()) }, t.prototype._onChartModelCreated = function(t) {
            var e, i, n;
            if (!this._activeChartWidget) throw Error("ChartWidget is undefined");
            this._chartWidgetBindingState = o.BoundToModel, this._activeChartWidget.modelCreated().unsubscribe(this, this._onChartModelCreated), e = this._symbolProperty(), e.subscribe(this, this._onSymbolPropertyChange), this._watchedSymbol.setValue(e.value()), this._watchedSymbol.subscribe(this._watchedSymbolListenerBound), i = this._mainSeries(), i.onSymbolResolved().subscribe(this, this._onSymbolResolved), this._watchedSymbol.hook = function(t) { return i.symbolSameAsCurrent(t) && (t = i.symbol()), t }, i.onSymbolResolved().subscribe(this, this._updateSeriesSymbolInfo), i.onSymbolError().subscribe(this, this._updateSeriesSymbolInfo), i.onSymbolNotPermitted().subscribe(this, this._updateSeriesSymbolInfo), i.onSymbolGroupNotPermitted().subscribe(this, this._updateSeriesSymbolInfo), i.onExtendedHoursNotPermitted().subscribe(this, this._updateSeriesSymbolInfo), this._updateSeriesSymbolInfo(), n = this._intervalProperty(), n.subscribe(this, this._onIntervalPropertyChange), this._watchedInterval.setValue(n.value()), this._watchedInterval.subscribe(this._watchedIntervalListenerBound), this._activeChartWidget.readOnly() && (this._watchedSymbol.writeLock = !0)
        }, t
    }(), window.TradingView = window.TradingView || {}, window.TradingView.Linking = new n, t.exports = window.TradingView.Linking
}, function(t, e, i) {
    var o, n;
    (function(i) {
        var s, r, a, l, h, c, d, p, u, _, f, m, g, v, y, b;
        ! function(s) {
            function r(t, e) { return function(i, o) { return t[i] = e ? e(i, o) : o } }
            var a = "object" == typeof i ? i : "object" == typeof self ? self : "object" == typeof this ? this : {};
            o = [e], void 0 !== (n = function(t) { s(r(a, r(t))) }.apply(e, o)) && (t.exports = n)
        }(function(t) {
            var e = Object.setPrototypeOf || { __proto__: [] }
            instanceof Array && function(t, e) { t.__proto__ = e } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]) };
            s = function(t, i) {
                function o() { this.constructor = t }
                e(t, i), t.prototype = null === i ? Object.create(i) : (o.prototype = i.prototype, new o)
            }, r = Object.assign || function(t) { var e, i, o, n; for (i = 1, o = arguments.length; i < o; i++) { e = arguments[i]; for (n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]) } return t }, a = function(t, e) {
                var i, o, n = {};
                for (i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
                if (null != t && "function" == typeof Object.getOwnPropertySymbols)
                    for (o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++) e.indexOf(i[o]) < 0 && (n[i[o]] = t[i[o]]);
                return n
            }, l = function(t, e, i, o) {
                var n, s, r = arguments.length,
                    a = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
                if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) a = Reflect.decorate(t, e, i, o);
                else
                    for (s = t.length - 1; s >= 0; s--)(n = t[s]) && (a = (r < 3 ? n(a) : r > 3 ? n(e, i, a) : n(e, i)) || a);
                return r > 3 && a && Object.defineProperty(e, i, a), a
            }, h = function(t, e) { return function(i, o) { e(i, o, t) } }, c = function(t, e) { if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(t, e) }, d = function(t, e, i, o) {
                return new(i || (i = Promise))(function(n, s) {
                    function r(t) { try { l(o.next(t)) } catch (t) { s(t) } }

                    function a(t) { try { l(o.throw(t)) } catch (t) { s(t) } }

                    function l(t) { t.done ? n(t.value) : new i(function(e) { e(t.value) }).then(r, a) }
                    l((o = o.apply(t, e || [])).next())
                })
            }, p = function(t, e) {
                function i(t) { return function(e) { return o([t, e]) } }

                function o(i) {
                    if (n) throw new TypeError("Generator is already executing.");
                    for (; l;) try {
                        if (n = 1, s && (r = s[2 & i[0] ? "return" : i[0] ? "throw" : "next"]) && !(r = r.call(s, i[1])).done) return r;
                        switch (s = 0, r && (i = [0, r.value]), i[0]) {
                            case 0:
                            case 1:
                                r = i;
                                break;
                            case 4:
                                return l.label++, { value: i[1], done: !1 };
                            case 5:
                                l.label++, s = i[1], i = [0];
                                continue;
                            case 7:
                                i = l.ops.pop(), l.trys.pop();
                                continue;
                            default:
                                if (r = l.trys, !(r = r.length > 0 && r[r.length - 1]) && (6 === i[0] || 2 === i[0])) { l = 0; continue }
                                if (3 === i[0] && (!r || i[1] > r[0] && i[1] < r[3])) { l.label = i[1]; break }
                                if (6 === i[0] && l.label < r[1]) { l.label = r[1], r = i; break }
                                if (r && l.label < r[2]) { l.label = r[2], l.ops.push(i); break }
                                r[2] && l.ops.pop(), l.trys.pop();
                                continue
                        }
                        i = e.call(t, l)
                    } catch (t) { i = [6, t], s = 0 } finally { n = r = 0 }
                    if (5 & i[0]) throw i[1];
                    return { value: i[0] ? i[1] : void 0, done: !0 }
                }
                var n, s, r, a, l = { label: 0, sent: function() { if (1 & r[0]) throw r[1]; return r[1] }, trys: [], ops: [] };
                return a = { next: i(0), throw: i(1), return: i(2) }, "function" == typeof Symbol && (a[Symbol.iterator] = function() { return this }), a
            }, u = function(t, e) { for (var i in t) e.hasOwnProperty(i) || (e[i] = t[i]) }, _ = function(t) {
                var e = "function" == typeof Symbol && t[Symbol.iterator],
                    i = 0;
                return e ? e.call(t) : { next: function() { return t && i >= t.length && (t = void 0), { value: t && t[i++], done: !t } } }
            }, f = function(t, e) {
                var i, o, n, s, r = "function" == typeof Symbol && t[Symbol.iterator];
                if (!r) return t;
                i = r.call(t), n = [];
                try {
                    for (;
                        (void 0 === e || e-- > 0) && !(o = i.next()).done;) n.push(o.value)
                } catch (t) { s = { error: t } } finally { try { o && !o.done && (r = i.return) && r.call(i) } finally { if (s) throw s.error } }
                return n
            }, m = function() { for (var t = [], e = 0; e < arguments.length; e++) t = t.concat(f(arguments[e])); return t }, g = function(t) { return this instanceof g ? (this.v = t, this) : new g(t) }, v = function(t, e, i) {
                function o(t) { c[t] && (h[t] = function(e) { return new Promise(function(i, o) { d.push([t, e, i, o]) > 1 || n(t, e) }) }) }

                function n(t, e) { try { s(c[t](e)) } catch (t) { l(d[0][3], t) } }

                function s(t) { t.value instanceof g ? Promise.resolve(t.value.v).then(r, a) : l(d[0][2], t) }

                function r(t) { n("next", t) }

                function a(t) { n("throw", t) }

                function l(t, e) { t(e), d.shift(), d.length && n(d[0][0], d[0][1]) }
                if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
                var h, c = i.apply(t, e || []),
                    d = [];
                return h = {}, o("next"), o("throw"), o("return"), h[Symbol.asyncIterator] = function() { return this }, h
            }, y = function(t) {
                function e(e, n) { t[e] && (i[e] = function(i) { return (o = !o) ? { value: g(t[e](i)), done: "return" === e } : n ? n(i) : i }) }
                var i, o;
                return i = {}, e("next"), e("throw", function(t) { throw t }), e("return"), i[Symbol.iterator] = function() { return this }, i
            }, b = function(t) {
                if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
                var e = t[Symbol.asyncIterator];
                return e ? e.call(t) : "function" == typeof _ ? _(t) : t[Symbol.iterator]()
            }, t("__extends", s), t("__assign", r), t("__rest", a), t("__decorate", l), t("__param", h), t("__metadata", c), t("__awaiter", d), t("__generator", p), t("__exportStar", u), t("__values", _), t("__read", f), t("__spread", m), t("__await", g), t("__asyncGenerator", v), t("__asyncDelegator", y), t("__asyncValues", b)
        })
    }).call(e, function() { return this }())
}, , , function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t, e, i) { this._source = t, this._model = e, this._undoCheckpoint = i }
        var n = i(1).LineDataSource,
            s = i(31).Study,
            r = i(43),
            a = i(48).DataSource,
            l = i(34),
            h = i(63).bindPopupMenu,
            c = i(191),
            d = i(33).trackEvent;
        i(126), $.extend(o, { TAB_PRIORITY_COORDINATES: 100, TAB_PRIORITY_DISPLAY: 100, TAB_PRIORITY_STYLE: 200, TAB_PRIORITY_INPUTS: 300, TAB_PRIORITY_PROPERTIES: 250, TAB_NAME_COORDINATES: "Coordinates", TAB_NAME_DISPLAY: "Properties", TAB_NAME_STYLE: "Style", TAB_NAME_INPUTS: "Inputs", TAB_NAME_PROPERTIES: "Properties", TAB_NAME_GRAPHICS: "Graphics", TAB_NAME_VISIBILITY: "Visibility", TAB_NAME_SOURCE_CODE: "Source Code", LOCALIZED_TAB_NAME_COORDINATES: $.t("Coordinates"), LOCALIZED_TAB_NAME_DISPLAY: $.t("Properties"), LOCALIZED_TAB_NAME_STYLE: $.t("Style"), LOCALIZED_TAB_NAME_INPUTS: $.t("Inputs"), LOCALIZED_TAB_NAME_PROPERTIES: $.t("Properties"), LOCALIZED_TAB_NAME_GRAPHICS: $.t("Graphics"), LOCALIZED_TAB_NAME_VISIBILITY: $.t("Visibility"), LOCALIZED_TAB_NAME_SOURCE_CODE: $.t("Source Code"), TAB_OPEN_DEFAULT: 100, TAB_OPEN_USERSAVE: 200, TAB_OPEN_OVERRIDE: 300 }), o.prototype.hide = function(t) { TVDialogs.destroy(this._dialogTitle, { undoChanges: !!t }) }, o.prototype._onDestroy = function(t, e) {
            var i, o = (e || {}).undoChanges;
            $(window).unbind("keyup.hidePropertyDialog"), o ? (i = this._undoCheckpoint ? this._undoCheckpoint : this._undoCheckpointOnShow) && this._model.undoToCheckpoint(i) : this._source.hasAlert.value() && this._source.localAndServerAlersMismatch && this._source.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, s) {
            var r, a;
            $(t).is("table") && !$(t).find("tr").size() || (this._tabs || (this._tabs = []), $.each(this._tabs, function(t, i) { if (i.name === e) return r = t, !1 }), void 0 === r && (this._tabs.push({ name: e, localizedName: $.t(e), objects: $(), displayPriority: 0, defaultOpen: 0, isButton: !!n, callback: n ? s || function() {} : null }), r = this._tabs.length - 1), a = this._tabs[r], a.objects = a.objects.add(t), a.displayPriority = Math.max(a.displayPriority || 0, i || 0), a.defaultOpen = Math.max(a.defaultOpen || 0, o || 0))
        }, o.prototype.insertTabs = function() {
            function t(t) {
                r && r === t.name && (t.defaultOpen = Math.max(~~t.defaultOpen, o.TAB_OPEN_USERSAVE)), (!n || ~~n.defaultOpen < ~~t.defaultOpen) && (n = t), t.labelObject = $('<a href="#" class="properties-tabs-label tv-tabs__tab"></a>').text(t.localizedName).appendTo(i._tabContainer), t.labelObject.bind("click", function(t) { t.preventDefault(), i.switchTab(this, !0) });
                var e = $('<div class="main-properties"></div>');
                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('<div class="properties-separator"></div>').add(e = $('<div class="main-properties"></div>')), 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('<div class="properties-separator"></div>').add(e = $('<div class="main-properties"></div>'));
                            var s = $(o).clone(!0, !1).appendTo(e);
                            s.children().remove(), s.append(n), $(n).removeData("layout-separated")
                        }
                    })) : e.append(n)
                }), t.wrapperObject.appendTo(i._container)
            }

            function e(t) { t.labelObject = $('<a href="#" class="properties-tabs-label tv-tabs__tab"></a>').text(t.localizedName).appendTo(i._tabContainer), t.labelObject.bind("click", t.callback) }
            var i, n, s, r;
            this._tabs && (this._tabs.sort(function(t, e) { return (e.displayPriority || 0) - (t.displayPriority || 0) }), i = this, n = null, s = this.activeTabSettingsName(), s && (r = TVSettings.getValue(s)), $.each(this._tabs, function(i, o) { o.isButton ? e(o) : t(o) }), this.switchTab(n))
        }, o.prototype.activeTabSettingsName = function() { var t = this._source; if (t) return t instanceof r || t instanceof c.ChartWidget ? "properties_dialog.active_tab.chart" : t instanceof n ? "properties_dialog.active_tab.drawing" : t instanceof s ? "properties_dialog.active_tab.study" : void 0 }, o.prototype.show = function(t) {
            function c() { y.hide(!0) }
            var p, u, _, f, m, g, v, y, b, w, S, T, C, x, P, L, k, I, A, E, M, D, O, V;
            if (e.enabled("property_pages") && (p = i(195), t = t || {}, u = t.onWidget || !1, TradingView.isInherited(this._source.constructor, r) && d("GUI", "Series Properties"), TradingView.isInherited(this._source.constructor, s) && d("GUI", "Study Properties"), TradingView.isInherited(this._source.constructor, a) && this._model.setSelectedSource(this._source), _ = p.createStudyStrategyPropertyPage(this._source, this._model), f = p.createInputsPropertyPage(this._source, this._model), m = p.createStylesPropertyPage(this._source, this._model), g = p.createVisibilitiesPropertyPage(this._source, this._model),
                    v = p.createDisplayPropertyPage(this._source, this._model), f && !f.widget().is(":empty") || m || _)) return y = this, b = null !== f, w = this._source.title(), S = TVDialogs.createDialog(w, { hideTitle: !0, dragHandle: ".properties-tabs" }), T = S.find("._tv-dialog-content"), C = $('<div class="properties-tabs tv-tabs"></div>').appendTo(T), x = [], P = 400, this._tabs = x, this._dialog = S, this._dialogTitle = w, this._dialog = S, this._container = T, this._tabContainer = C, this._undoCheckpointOnShow = this._model.createUndoCheckpoint(), S.on("destroy", function(t, e) { y._onDestroy(t, e), f && f.destroy(), _ && _.destroy(), m && m.destroy(), v && v.destroy(), g && g.destroy(), $("select", T).each(function() { $(this).selectbox("detach") }) }), t.selectScales && m.setScalesOpenTab && m.setScalesOpenTab(), t.selectTmz && m.setTmzOpenTab && m.setTmzOpenTab(), !this._model.readOnly() && _ && _.widget().each(function(t, e) {
                var i, n, s = +$(e).data("layout-tab-priority");
                isNaN(s) && (s = o.TAB_PRIORITY_PROPERTIES), i = ~~$(e).data("layout-tab-open"), n = $(e).data("layout-tab"), void 0 === n && (n = o.TAB_NAME_PROPERTIES), y.appendToTab(e, n, s, i)
            }), this._model.readOnly() || !b || f.widget().is(":empty") || f.widget().each(function(t, e) {
                var n, s, r = i(64),
                    a = f instanceof r,
                    l = +$(e).data("layout-tab-priority");
                TradingView.isNaN(l) && (l = a ? o.TAB_PRIORITY_COORDINATES : o.TAB_PRIORITY_INPUTS), n = ~~$(e).data("layout-tab-open"), s = $(e).data("layout-tab"), void 0 === s && (s = a ? o.TAB_NAME_COORDINATES : o.TAB_NAME_INPUTS), y.appendToTab(e, s, l, n)
            }), m && m.widget().each(function(t, e) {
                var n, s, r, a = +$(e).data("layout-tab-priority");
                TradingView.isNaN(a) && (a = o.TAB_PRIORITY_STYLE), n = ~~$(e).data("layout-tab-open"), s = i(10), !n && m instanceof s && (n = o.TAB_OPEN_DEFAULT), r = $(e).data("layout-tab"), void 0 === r && (r = o.TAB_NAME_STYLE), y.appendToTab(e, r, a, n)
            }), v && v.widget().each(function(t, e) {
                var i, n, s = +$(e).data("layout-tab-priority");
                TradingView.isNaN(s) && (s = o.TAB_PRIORITY_DISPLAY), i = ~~$(e).data("layout-tab-open"), n = $(e).data("layout-tab"), void 0 === n && (n = o.TAB_NAME_DISPLAY), y.appendToTab(e, n, s, i)
            }), g && g.widget().each(function(t, e) { y.appendToTab(e, o.TAB_NAME_VISIBILITY, o.TAB_PRIORITY_DISPLAY, !1) }), I = this._source instanceof s && !!this._source.metaInfo().pine, I && 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)
            }), S.css("z-index", A), L = $('<div class="main-properties main-properties-aftertabs"></div>').appendTo(T), k = $('<div class="dialog-buttons">').appendTo(L), E = 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 = [];
                m && "function" == typeof m.defaultProperties && (e = e.concat(m.defaultProperties())), f && "function" == typeof f.defaultProperties && (e = e.concat(f.defaultProperties())), 0 === e.length && y._source.properties ? e = [y._source.properties()] : y._source._sessionsStudy && (e = e.concat(y._source._sessionsStudy.properties())), e.length && ($.each(e, function(e, i) { y._model.restoreFactoryDefaults(i), y._source.calcIsActualSymbol && y._source.calcIsActualSymbol(), t(i) }),
                    y._source.properties().minTick && y._source.properties().minTick.listeners().fire(y._source.properties().minTick), y._source.properties().precision && y._source.properties().precision.listeners().fire(y._source.properties().precision), f && f.loadData(), _ && _.loadData(), m.onResoreDefaults && m.onResoreDefaults(), m && m.loadData(), g && g.loadData())
            }, M = function() { g && g.loadData(), f && f.loadData() }, (!u || window.is_authenticated) && m && "function" == typeof m.createTemplateButton && e.enabled("linetoolpropertieswidget_template_button") ? m.createTemplateButton({ popupZIndex: A, defaultsCallback: E, loadTemplateCallback: M }).addClass("tv-left").appendTo(k) : TradingView.isInherited(this._source.constructor, s) ? (D = [{ title: $.t("Reset Settings"), action: E }, { title: $.t("Save As Default"), action: function() { y._source.properties().saveDefaults() } }], O = $('<a href="#" class="_tv-button tv-left">' + $.t("Defaults") + '<span class="icon-dropdown"></span></a>'), O.on("click", function(t) {
                t.preventDefault();
                var e = $(this);
                e.is(".active") || e.trigger("button-popup", [D, !0])
            }).appendTo(k), h(O, null, { direction: "down", event: "button-popup", notCloseOnButtons: !0, zIndex: A })) : $('<a class="_tv-button tv-left">' + $.t("Defaults") + "</a>").appendTo(k).click(E), $('<a class="_tv-button ok">' + $.t("OK") + "</a>").appendTo(k).click(function() { y.hide() }), $('<a class="_tv-button cancel">' + $.t("Cancel") + "</a>").appendTo(k).on("click", c), S.find("._tv-dialog-title a").on("click", c), $(window).bind("keyup.hidePropertyDialog", function(t) { 13 === t.keyCode && "textarea" !== t.target.tagName.toLowerCase() && y.hide() }), $("select", T).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"]', T).addClass("tv-text-input inset dialog"), $("input.ticker", T).TVTicker(), S.css("min-width", P + "px"), TVDialogs.applyHandlers(S, t), V = { top: ($(window).height() - S.height()) / 2, left: ($(window).width() - S.width()) / 2 }, m && "function" == typeof m.dialogPosition && (V = m.dialogPosition(V, S) || V), TVDialogs.positionDialog(S, V), 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 s ? "study" : "other", scriptTitle: this._source.title() }), S
        }, o.prototype._helpItemRequired = function() { return this._source._metaInfo && !!this._source._metaInfo.helpURL }, o.prototype._createHelp = function() {
            var t = $('<a class="help" href="#" target="_blank" title="' + $.t("Help") + '"></a>');
            t.attr("href", this._source._metaInfo.helpURL), this._tabContainer.prepend(t)
        }, t.exports = o
    }).call(e, i(3))
}, function(t, e, i) {
    (function(e) {
        "use strict";
        var o = i(215),
            n = i(72),
            s = i(668),
            r = i(140),
            a = i(127).unifiedSpinner,
            l = i(125),
            h = i(222).regExpEscape,
            c = i(740),
            d = i(214).isFeatureEnabled,
            p = i(113),
            u = function() {
                function t(i) {
                    var o, n, s, r;
                    if (!(this instanceof t)) throw new TypeError("SymbolSearch is a constructor");
                    if (i = i || {},
                        o = !i.dontUseInputParser && e.enabled("symbol_search_parser_mixin") && t.canShowSpreadActions(), this._inputParserMixin = o ? new SymbolSearchInputParserMixin(this) : void 0, this._inputElement = $(i.input).get(0), !this._inputElement) throw new TypeError("options.input must be a DOM element, jQuery object or selector");
                    if (this.$list = $(i.list).eq(0), 0 === this.$list.size() && delete this.$list, void 0 !== i.callback) {
                        if ("function" != typeof i.callback) throw new TypeError("options.callback must be function");
                        this._callback = i.callback
                    }
                    if (void 0 !== i.onValueChanged) {
                        if ("function" != typeof i.onValueChanged) throw new TypeError("options.onValueChanged must be function");
                        this._onValueChanged = i.onValueChanged
                    }
                    if (void 0 !== i.onEmptyApply) {
                        if ("function" != typeof i.onEmptyApply) throw new TypeError("options.onEmptyApply must be function");
                        this._onEmptyApply = i.onEmptyApply
                    }
                    if (i.ignoreInterval && (this._ignoreInterval = !0), t.resetStoredInterval(), i.hidePro && (this._hidePro = !0), i.allowMultipleSymbols && (this._allowMultipleSymbols = !0), void 0 !== i.onParse) {
                        if ("function" != typeof i.onParse) throw new TypeError("options.onParse must be function");
                        this._onParse = i.onParse
                    }
                    for (this._state = {}, this.acceptEmpty = !!i.acceptEmpty, $(this._inputElement).data("symbol-search-instance", this), n = this._boundListener = this._eventListener.bind(this), s = this.boundTimeoutListener = function(t) { setTimeout(function() { n(t) }, 0) }, r = 0; r < w.length; r++) w[r].immediate ? $(this._inputElement).on(w[r].name, n) : $(this._inputElement).on(w[r].name, s);
                    this._boundOnKeyDown = this._onKeyDown.bind(this), this._boundOnKeyPress = this._onKeyPress.bind(this), $(this._inputElement).on("keydown", this._boundOnKeyDown).on("keypress", this._boundOnKeyPress), this._eventListener(), i.autoFocus && t.registerAutoFocus(this)
                }

                function u(t, e) {
                    var i = ChartApiInstance.supportedSymbolsTypes(),
                        o = TVSettings.getValue("symboledit.filter");
                    return !i.some(function(t) { return t.value === o }) && i.length > 0 && (o = i[0].value), 0 !== i.length && (i.forEach(function(i) {
                        var n = i.value,
                            s = $('<a class="type-filter">').attr("href", "#" + n).text($.t(i.name));
                        n === o && s.addClass("active"), s.on("click", function(i) { i.preventDefault(), e.find(".type-filter").removeClass("active"), $(this).addClass("active"), t.typeFilter(n), TVSettings.setValue("symboledit.filter", n) }), s.appendTo(e)
                    }), t.typeFilter(o), !0)
                }

                function _(t, i) {
                    var o, n, r, a = ChartApiInstance.supportedExchangesList();
                    if (a = s.displayedExchangesFilter(a), a = s.sortExchangesListByFlagIfNeeded(a), o = TVSettings.getValue("symboledit.exchangefilter"), "bovespa" !== TradingView.widgetCustomer) return !a.some(function(t) { return t.value === o }) && a.length > 0 && (o = a[0].value), 0 !== a.length && (n = $('<div id="exchange-filter" class="exchange-filter">').appendTo(i), r = $("<select>").appendTo(n), a.forEach(function(t) {
                        var e = t.value,
                            i = t.name || e,
                            n = t.desc || i,
                            s = $("<option>").addClass("filter-item").attr("value", e).text($.t(i)).data("custom-option-text", $.t(n)).appendTo(r);
                        t.value === o && s.attr("selected", !0)
                    }), r.change(function() {
                        var e = $(this).val() || "";
                        TVSettings.setValue("symboledit.exchangefilter", e), t.setExchangeFilter(e)
                    }), r.selectbox({
                        speed: 0,
                        useCustomPrependWithSelector: "after",
                        customPrependSelectorClass: "exchange-with-flag",
                        classHolder: "tv-unstyled-select-container tv-symbol-select",
                        classOptions: e.enabled("symbol_search_three_columns_exchanges") ? "sbOptions three-column-filter" : "sbOptions"
                    }), t.setExchangeFilter(o), !0)
                }

                function f(t) { var e = _(t, t.$filterContainer); return t.selectExchangeFilter(), e }

                function m(t) {
                    var e, i, o, n, s, r, a, l, h, c, d = $('<div class="symbol-edit-popup">').appendTo(document.body),
                        p = $('<div class="filter">').appendTo(d);
                    return t.$filterContainer = p, u(t, p), f(t, p), e = $('<div class="table-wrapper">').appendTo(d), i = $(t._inputElement), o = i.offset(), n = 0, s = Math.max(0, Math.min(o.left + n, $(window).width() - d.outerWidth())), d.css("left", s + "px"), d.css("top", o.top + i.outerHeight() + 1), r = p.outerHeight(), a = $(window).scrollTop(), l = i.height(), h = TradingView.isMobile.any() ? parseInt(window.screen.height, 10) : parseInt($(window).height(), 10), c = h - (o.top - a) - l / 2, e.css("maxHeight", c - l - r + "px"), { popup: d, listWrapper: e }
                }

                function g(t) { return !t.ctrlKey && (!t.metaKey && (!!t.charCode && (!(!t.which || t.which <= 32) && (!/^(input|textarea)$/i.test(t.target.tagName) && !TVDialogs.modalDialog)))) }

                function v(t, e, i) { this._container = t, this._tickerRegExp = e, this._translationCache = i, this._roots = {}, this._itemsByTicker = {} }
                var y, b, w = [{ name: "input", immediate: !0 }, { name: "sync", immediate: !0 }, { name: "keypress" }, { name: "keydown" }, { name: "keyup" }, { name: "mousedown" }, { name: "mouseup" }, { name: "cut" }, { name: "paste" }],
                    S = d("symbol_search_server_highlight");
                return S = !1, y = [/^e\-m/i], b = /<\/?[^>]+(>|$)/g, t.registerAutoFocus = function(e) {
                        if (e instanceof jQuery && (e = e.data("symbol-search-instance")), !(e instanceof t)) throw new TypeError("arg must be an SymbolSearch instance of jQuery input with bound SymbolSearch object");
                        r.registerListener("symbolEdit", function(t) { if (g(t)) { t.preventDefault(), this.resetState(), this._skipAutoFocus = !0, this._inputElement.focus(); var e = String.fromCharCode(t.charCode); "function" == typeof this._setInputValue ? this._setInputValue(e) : this._inputElement.value = e, this._eventListener() } }.bind(e))
                    }, t.prototype.searchRequestDelay = 0, t.setSearchRequestDelay = function(e) { t.prototype.searchRequestDelay = e }, t.prototype.resetState = function() { this._state = {} }, t.prototype.typeFilter = function(t) {
                        if (!(arguments.length > 0)) return this._state.typeFilter;
                        t !== this._state.typeFilter && (null == t ? delete this._state.typeFilter : this._state.typeFilter = t + "", delete this._state.keepListFor, this._onSelectionChanged(), this.selectExchangeFilter())
                    }, t.prototype.setExchangeFilter = function(t) { t !== this._state.exchangeFilter && (null == t ? delete this._state.exchangeFilter : this._state.exchangeFilter = t + "", delete this._state.keepListFor, this._onSelectionChanged()) }, t.prototype.getExchangeFilter = function() { return this._state.exchangeFilter }, t.prototype.destroy = function() { $(this._inputElement).off(), $(this._inputElement).removeData("symbol-search-instance") }, t.prototype._moveSelection = function(t, e) {
                        var i, o, n, s, r, a, l, h, c;
                        this.$list && (i = this.$list.find("table.symbol-edit-popup"), o = i.find("tr:not(.hidden)"),
                            n = i.find("tr.symbol-edit-popup-active").removeClass("symbol-edit-popup-active"), s = 0 !== n.length ? o.index(n) : -1, r = 1 === t ? n.get(0) === o.get(-1) ? 0 : s + t : Math.max(-1, s + t), s !== r && (a = o.get(r)) && (l = this._getItemByElement(a), h = v.isRoot(l), h ? (c = a.getAttribute("data-root"), a.classList.add("symbol-edit-popup-active"), this._scrollHighlightIntoView(), c ? (this._state.highlightedItem = null, this._selectedGroupRoot = c) : (this._state.highlightedItem = l, this._replaceCurrentSymbol(e))) : (delete this._selectedGroupRoot, this._highlightItem(l, !0, e))))
                    }, t.prototype._groupToggleCollapsed = function(t, e) { this._groupListHandler && this._groupListHandler.toggleCollapsed(t, e) }, t.prototype._onKeyDown = function(t) { t.keyCode !== p.DOWN_ARROW && t.keyCode !== p.UP_ARROW || (this._moveSelection(t.keyCode === p.DOWN_ARROW ? 1 : -1, !0), t.preventDefault()), !this._selectedGroupRoot || t.keyCode !== p.LEFT_ARROW && t.keyCode !== p.RIGHT_ARROW || (this._groupToggleCollapsed(this._selectedGroupRoot, t.keyCode === p.LEFT_ARROW), t.preventDefault()) }, t.prototype._onKeyPress = function(t) {
                        if (t.keyCode === p.DOWN_ARROW || t.keyCode === p.UP_ARROW) {
                            if (t.charCode) return;
                            if (this._boundOnKeyDown) return $(this._inputElement).off("keydown", this._boundOnKeyDown), delete this._boundOnKeyDown, void t.preventDefault();
                            this._moveSelection(t.keyCode === p.DOWN_ARROW ? 1 : -1), t.preventDefault()
                        }
                        t.keyCode === p.ENTER && (this._selectedGroupRoot ? (this._groupToggleCollapsed(this._selectedGroupRoot, !1), t.preventDefault()) : this.acceptTypeIn())
                    }, t.prototype._eventListener = function(t, e) {
                        var i, o, n, s = this._inputElement,
                            r = this._getInputValue().toUpperCase(),
                            a = !1,
                            l = !1;
                        this._state.value !== r && (ChartApiInstance._symbolSearchRequest && ChartApiInstance._symbolSearchRequest.abort(), this._state.hasOwnProperty("value") && this._onValueChanged && this._onValueChanged(r), this._state.value = r, a = !0, this._inputParserMixin && this._inputParserMixin.parse()), this._fixIntervalCase(), i = this._limitInputSelectionValue("selectionStart"), this._state.selectionStart !== i && (this._state.selectionStart = i, l = !0), o = this._limitInputSelectionValue("selectionEnd"), this._state.selectionEnd !== o && (this._state.selectionEnd = o, l = !0), this._state.selectionDirection !== s.selectionDirection && (this._state.selectionDirection = s.selectionDirection, l = !0), (a || l && this._inputParserMixin) && (this._onSelectionChanged(void 0, e), n = !1, this._getInputValue() !== this._state.value && (this._setInputValue(this._state.value), n = !0), (n || this._state.selectionStart !== this._limitInputSelectionValue("selectionStart") || this._state.selectionEnd !== this._limitInputSelectionValue("selectionEnd")) && s.setSelectionRange && s.setSelectionRange(this._state.selectionStart, this._state.selectionEnd, this._state.selectionDirection))
                    }, t.prototype._fixIntervalCase = function() { if (this._selectionInsideInterval()) { var e = t.detachInterval(this._inputElement.value); /[a-z]/.test(e.detached) && (this._inputElement.value = e.rest + e.detached.toUpperCase()) } }, t.prototype._selectionInsideInterval = function(e) {
                        if (this._ignoreInterval) return !1;
                        var i = t.detachInterval(this._inputElement.value);
                        return !!i && ("string" == typeof e ? this._inputElement[e] > i.rest.length : this._inputElement.selectionStart > i.rest.length && this._inputElement.selectionEnd > i.rest.length)
                    }, t.prototype._limitInputSelectionValue = function(e) { return this._selectionInsideInterval(e) ? t.detachInterval(this._inputElement.value).rest.length : e in this._inputElement ? this._inputElement[e] : this._inputElement.value.length }, t.prototype._getInputValue = function() { if (this._ignoreInterval) return this._inputElement.value; var e = t.detachStoreInterval(this._inputElement.value); return $(this._inputElement).toggleClass("interval-error", t.intervalError()), e }, t.prototype._setInputValue = function(e) { this._ignoreInterval ? this._inputElement.value = e : this._inputElement.value = t.recallAttachInterval(e) }, t.prototype._onSelectionChanged = function(t, e) {
                        function i(t, e, i, o) { n._state.contextTicker = t, n._state.contextExchange = e, n._state.contextType = i, n._state.keepListFor && n._state.keepListFor === o || (n._getSuggestList(), delete n._state.keepListFor) }
                        var o, n = this;
                        !y.some(function(t) { return t.test(n._state.value) }) && this._inputParserMixin && !0 !== e ? this._inputParserMixin.onSelectionChanged(i) : this.$list && (this._state._selectedTicker = null, o = this._state.value, i(o, this.getExchangeFilter(), this._state.typeFilter, o))
                    }, t.prototype._clearSelectionState = function() { delete this._state.contextTicker, delete this._state.contextExchange, delete this._state.contextType, delete this._state.contextToken, delete this._state.keepListFor }, t.prototype._clearSearchTimeout = function() { this._searchTimeout && (clearTimeout(this._searchTimeout), this._searchTimeout = null) }, t.prototype._doGetSuggestList = function() {
                        var t, e, i, o, n;
                        this._clearSearchTimeout(), t = this._state.contextTicker || "", e = this._state.contextExchange || this.getExchangeFilter() || "", i = this._state.typeFilter || "", o = window.language || "", this._showLoading(), n = this, ChartApiInstance.searchSymbols(t, e, i, o, S, "undefined" != typeof chartWidget ? chartWidget : void 0, function(o) { t !== (n._state.contextTicker || "") || e !== (n._state.contextExchange || n.getExchangeFilter() || "") || i !== (n._state.typeFilter || "") || (i === c.types.QUANDL && (o = n._processQuandlResponse(o)), n._renderSuggestList(o), n._onResponse(o)) })
                    }, t.prototype._getSuggestList = function() { this._clearSearchTimeout(), this._searchTimeout = setTimeout(this._doGetSuggestList.bind(this), t.prototype.searchRequestDelay) }, t.prototype._showLoading = function() {
                        if (this.$list && !this._spinner) {
                            this._clearSuggestList();
                            var t = $('<div class="symbol-search-loading">').appendTo(this.$list);
                            this._spinner = a("medium").spin(t.get(0))
                        }
                    }, t.prototype._groupContracts = function(t) {
                        var e, i, o, n, s, r = ChartApiInstance.futuresRegex(),
                            a = {},
                            l = [];
                        for (e = 0; e < t.length; ++e) { if (i = t[e], i.prefix || Array.isArray(i.contracts)) return t; "futures" === i.type ? (o = r.exec(i.symbol), o ? (n = o[1], n in a ? s = a[n] : (s = l.length, a[n] = s, l.push({ type: i.type, symbol: n, exchange: i.exchange, description: i.description, full_name: i.exchange + ":" + n, contracts: [] })), l[s].contracts.push(i)) : l.push(i)) : l.push(i) }
                        return l
                    }, t.prototype._renderSuggestList = function(i) {
                        var o, n, s, r, a, l, c, d, p, u;
                        if (this.$list) {
                            if (i = this._groupContracts(i), o = this, n = this._state, this._clearSuggestList(), s = h(n.contextTicker).trim(), r = RegExp(s.replace(" ", "|"), "i" + (s.length > 1 ? "g" : "")), delete n.highlightedItem, this._hidePro && (i = i.filter(function(t) { return !t.params || -1 === t.params.indexOf("pro") })), 0 === i.length) return void this.$list.html('<div style="text-align: center; padding: 7px 0; font-style: italic;">' + $.t("No symbols matched your criteria") + "</div>");
                            for (a = document.createElement("table"), a.setAttribute("class", "symbol-edit-popup"), l = {}, c = new t.GroupListHandler(a, r, l), d = null, this._renderedResponse = [], p = 0; p < i.length; p++) u = i[p], c.append(u), d || u.ticker !== n.contextTicker || u.exchange !== n.contextExchange || (d = u), this._renderedResponse.push(u);
                            e.enabled("expand_symbolsearch_items") || c.collapse(), this._groupListHandler = c, d && this._highlightItem(u), $(a).on("click", "tr", function(t) {
                                if (!t.isDefaultPrevented()) {
                                    t.preventDefault();
                                    var e = o._getItemByElement(this);
                                    e && e.full_name && o.accept(e.full_name, e.ticker)
                                }
                            }).appendTo(this.$list)
                        }
                    }, t.prototype._getItemByElement = function(t) { return this._renderedResponse && this._groupListHandler ? this._groupListHandler.getItemByTicker(t.getAttribute("data-item-ticker")) : null }, t.prototype._getElementByItem = function(t) { return this._renderedResponse && this.$list ? this.$list.get(0).querySelector('tr[data-item-ticker="' + (t.ticker || t.full_name) + '"]') : null }, t.prototype._highlightItem = function(t, e, i) {
                        var o, n, s = this._state;
                        s.highlightedItem && (o = this._getElementByItem(s.highlightedItem)) && $(o).removeClass("symbol-edit-popup-active"), s.highlightedItem = t, n = this._getElementByItem(s.highlightedItem), n && ($(n).addClass("symbol-edit-popup-active"), this._scrollHighlightIntoView()), e && this._replaceCurrentSymbol(i)
                    }, t.prototype._scrollHighlightIntoView = function() {
                        var t = this.$list.find("tr.symbol-edit-popup-active");
                        t.length && (t.offset().top < this.$list.offset().top ? this.$list.scrollTop(this.$list.scrollTop() - (this.$list.offset().top - t.offset().top)) : t.offset().top + t.outerHeight() > this.$list.offset().top + this.$list.outerHeight() && this.$list.scrollTop(this.$list.scrollTop() + (t.offset().top + t.outerHeight() - (this.$list.offset().top + this.$list.outerHeight()))))
                    }, t.prototype._clearSuggestList = function() { this._renderedResponse = null, this._spinner && (this._spinner.stop(), delete this._spinner), this.$list && this.$list.empty() }, t.prototype._showErrorNotice = function() { this.$list && (this._clearSuggestList(), this.$list.text("Invalid expression")) }, t.prototype._replaceCurrentSymbol = function(t) {
                        var e, i, o, n, s = this._state;
                        if (s.highlightedItem) {
                            if (e = s.highlightedItem, i = "", o = 0, this._inputParserMixin && !0 !== t) {
                                if (n = this._inputParserMixin.replaceCurrentSymbol(e), !n.ok) return;
                                i = n.newValue, o = n.newCaretPos, s.keepListFor = n.keepListFor
                            } else i = !0 === t && e.full_name && this._inputParserMixin ? e.full_name : e.symbol, o = i.length, this._state._selectedTicker = s.keepListFor = e.ticker || e.symbol;
                            this._setInputValue(S ? i.replace(b, "") : i), this._inputElement.setSelectionRange ? this._inputElement.setSelectionRange(o, o) : this._inputElement.select(), this._eventListener(void 0, t)
                        }
                    },
                    t.prototype.splitAndAcceptUserInput = function() { var t, e = this._getInputValue().split(","); for (t = 0; t < e.length; t++) this.acceptSymbolIn(e[t]) }, t.prototype.acceptSymbolIn = function(t) {
                        var e, i;
                        this._inputParserMixin ? e = this._inputParserMixin.parseSymbol(t) : (e = t, i = this._state._selectedTicker || t), this.accept(e, i)
                    }, t.prototype.acceptTypeIn = function() { this._allowMultipleSymbols ? this.splitAndAcceptUserInput() : this.acceptSymbolIn(this._getInputValue()) }, t.prototype.accept = function(e, i) {
                        if ((i = i || e) || "" === i && this.acceptEmpty) {
                            delete this._state.keepListFor;
                            var o = this._ignoreInterval ? void 0 : t.getInterval(!0);
                            this._inputElement.value = e, this._eventListener(), this._callback && this._callback(i, o), $(this._inputElement).trigger("accept-symbol", [i])
                        }
                    }, t.prototype.bindListWrapper = function(t) {
                        if (t = $(t).eq(0), 0 === t.size()) throw new TypeError("element must be a DOM element, jQuery object or selector");
                        this.$list = t, this._clearSelectionState(), this._eventListener()
                    }, t.prototype.removeListWrapper = function() { delete this.$list, this._clearSuggestList(), this._clearSelectionState(), this._eventListener() }, t.prototype.selectExchangeFilter = function() { this.$filterContainer.find(".exchange-filter").hide(), this._state.typeFilter === c.types.QUANDL ? this.$filterContainer.find("#quandl-filter").show() : this._state.typeFilter !== c.types.ECONOMIC && this.$filterContainer.find("#exchange-filter").show() }, t.prototype._onResponse = function(t) { if (t.length > 0) { this._state.typeFilter === c.types.QUANDL && this._showNotification() } }, t.prototype._showNotification = function() {
                        var t, e, i;
                        TVSettings.getBool("symboledit.show_quandl_notification", !0) && (t = $.t("Quandl is a huge financial database that we have connected to TradingView. Most of its data is EOD and is not updated in real-time, however the information may be extremely useful for fundamental analysis.") + ' <a target="_blank" href="' + ("ru" === window.locale ? "http://blog.tradingview.com/?p=1530&lang=ru" : "http://blog.tradingview.com/?p=1530") + '">' + $.t("Read our blog for more info!") + "</a>", e = $('<div class="symbol-edit-notification">').prependTo(this.$list), e.html(t), e.find("a").click(function(t) {
                            t.preventDefault();
                            var e = $(this).attr("href");
                            window.open(e, "_blank")
                        }), i = $('<a class="close">').appendTo(e), i.click(function() { TVSettings.setValue("symboledit.show_quandl_notification", !1), e.remove() }))
                    }, t.prototype._processQuandlResponse = function(t) { return t.datasets.filter(function(t) { return !t.premium }).map(function(t) { return { description: t.name, exchange: t.database_code, full_name: "QUANDL:" + t.database_code + "/" + t.dataset_code, params: ["eod"], symbol: t.dataset_code, type: "quandl" } }) }, t.createSuggestListRow = function(e, i, o, n) {
                        var s, r, a, l, h, c, d, p, u, _;
                        if (n || (n = {}), s = document.createElement("tr"), r = "symbol-edit-popup", n.addClass && (r += " " + n.addClass), s.setAttribute("class", r), a = !S || "quandl" === e.type, l = document.createElement("td"), l.setAttribute("class", "symbol-edit-popup-td name apply-overflow-tooltip"), h = a ? e.symbol.replace(i, "<strong>$&</strong>") : e.symbol, l.innerHTML = n.nameContent || h, c = document.createElement("td"),
                            c.setAttribute("class", "symbol-edit-popup-td desc apply-overflow-tooltip"), c.innerHTML = !a || i.test(e.symbol) ? e.description : e.description.replace(i, "<strong>$&</strong>"), d = document.createElement("td"), d.setAttribute("class", "symbol-edit-popup-td type apply-overflow-tooltip"), p = "", n.typeContent) p = n.typeContent;
                        else switch (e.params && ~e.params.indexOf("eod") && (p = '<i class="eod">eod</i>&nbsp;'), e.type in o || (o[e.type] = $.t(e.type)), e.type) {
                            case "index":
                                p += o[e.type];
                                break;
                            default:
                                e.exchange ? e.exchange.startsWith("CHXEUR_") ? p += o[e.type] + " - " + e.exchange.split("_")[0] : p += o[e.type] + " - " + e.exchange : p += o[e.type]
                        }
                        return d.innerHTML = p, u = document.createElement("td"), u.setAttribute("class", "symbol-edit-popup-td flag apply-overflow-tooltip"), u.innerHTML = t.getItemFlag(e), _ = u.getElementsByTagName("svg")[0], _ && _.setAttribute("class", "flag"), s.appendChild(l), s.appendChild(c), s.appendChild(d), s.appendChild(u), s
                    }, t.getItemFlag = function(t) { return "" }, t.showDialog = function(e) {
                        var o, n, s, r, a, l, h, c, d, p, _, m, g = i(160);
                        if (e = e || {}, o = "Symbol Search", !TVDialogs.get(o)) return n = TVDialogs.createDialog(o, { hideTitle: !0, hideCloseCross: !0, dragHandle: ".filter", width: "750px", dragOptions: { cancel: ".sbOptions" }, content: g.dialogs.symbolSearch }), TVDialogs.positionDialog(n), s = n.find("._tv-dialog-content").addClass("symbol-search-dialog"), r = s.find(".results"), r.mousewheel(function(t, e) {
                            var i = $(this);
                            e > 0 ? i.scrollTop(i.scrollTop() - 15) : i.scrollTop(i.scrollTop() + 15)
                        }), a = s.find("input").get(0), e.initialValue && (a.value = e.initialValue), "selectionStart" in a && (a.selectionStart = a.selectionEnd = a.value.length), a.focus(), this.canShowSpreadActions() && (e.ignoreInterval || (h = t.getInputValueGetter(a), c = t.getInputValueSetter(a)), l = SymbolSearchInputParserMixin.addSpreadActions(s.find(".spread-actions"), a, h, c)), d = new t({ input: a, list: s.find(".results").get(0), callback: function(t, i) { e.callback && e.callback(t, i), TVDialogs.destroy(o) }, onParse: l, ignoreInterval: e.ignoreInterval }), p = s.find(".filter"), d.$filterContainer = p, _ = u(d, p), m = f(d, p), _ || m || p.attr("style", "display: none"), TVDialogs.resizeContent(n.height(), r), TVDialogs.applyHandlers(n), TVDialogs.positionDialog(n), n.on("destroy", function() { TVSettings.setValue("symboledit.dialog_last_entry", a.value) }), n
                    }, t.bindToInput = function(i, o) {
                        function s() { g && (S.removeListWrapper(), g.off(), g.remove(), g = null, l.hide(), "function" == typeof o.onPopupClose && o.onPopupClose()) }

                        function r(t) { t.preventDefault() }

                        function a() {
                            var t, i, n, s;
                            if (g || (t = m(S), g = t.popup, S.bindListWrapper(t.listWrapper), g.on("focus", r), g.on("click", r), g.on("mousedown", r), g.on("focus", "*", r), g.on("click", "*", r), g.on("mousedown", "*", r), "function" == typeof o.onPopupOpen && o.onPopupOpen(t.popup)), e.enabled("charting_library_base") && (i = this._state, i.keepListFor)) {
                                if (!i.highlightedItem) return void delete this._state.keepListFor;
                                n = i.highlightedItem, s = this._getInputValue().toUpperCase(), n.symbol !== s && delete this._state.keepListFor
                            }
                        }

                        function h(t, e) { var i; return e ? (RegExp("^" + c.types.QUANDL, "i").test(t) ? (i = t.split(/\//), i.length && (t = i[i.length - 1])) : t = n.seriesShortSymbol.value() || t, t) : t }

                        function d(t) {
                            var e = n.symbol.value() || "";
                            e = h(e, t), i.val(e), S.resetState()
                        }
                        var u, _, f, g, v, y, b, w, S, T, C, x;
                        return o = o || {}, i = $(i).eq(0), u = o.callback, _ = null, f = null, g = null, y = o.spreadActions && $(o.spreadActions).eq(0), y && y.size() && this.canShowSpreadActions() && (o.ignoreInterval || (b = t.getInputValueGetter(i.get(0)), w = t.getInputValueSetter(i.get(0))), v = SymbolSearchInputParserMixin.addSpreadActions(y, i.get(0), b, w)), S = new t({ input: i, onValueChanged: a, callback: function(t, e) { s(), "function" == typeof f && f(t, e) || ("function" == typeof u && u(t, e), "function" == typeof _ && _(t, e)), o.clearAfterAccept && i.val(""), o.keepFocus ? i.get(0).focus() : i.get(0).blur(), S.resetState() }, hidePro: o.hidePro, autoFocus: o.autoFocus, onEmptyApply: o.onEmptyApply, onParse: v, acceptEmpty: o.acceptEmpty, dontUseInputParser: o.dontUseInputParser, allowMultipleSymbols: o.allowMultipleSymbols, ignoreInterval: o.ignoreInterval }), T = !1, C = !0, TradingView.isMobile.iOS() && $("body").css("cursor", "pointer"), i.on("focus", function(t, e) { T = !0, S._skipAutoFocus ? delete S._skipAutoFocus : setTimeout(function() { T && i.get(0).select() }, 0) }), i.on("blur", function(t) {
                            var e, o, n, r, a = this;
                            if (g && (e = document.activeElement, o = g.is(e), n = g.has(e).length > 0, (-1 !== navigator.userAgent.indexOf("Trident") || -1 !== navigator.userAgent.indexOf("MSIE")) && (o || n))) return t.preventDefault(), t.stopImmediatePropagation(), void setTimeout(function() { i.focus() }, 0);
                            TradingView.isMobile.iOS() && C && (C = !1, T = !0), TradingView.isMobile.iOS() && T && null === t.relatedTarget ? (r = function(t) { $(a).is($(t.target)) || (T = !1, setTimeout(function() { s() }, 0), $(document).off("click", "body", r)) }, $(document).on("click", "body", r)) : T = !1, setTimeout(function() { T || s() }, 0)
                        }), o.syncWithChartWidget && (d(!0), n.seriesShortSymbol.subscribe(function() { d(!0) }), _ = function(t, e) { t && n.symbol.setValue(t), e && n.interval.setValue(e) }, f = function(t, e) { return !e && (t === n.symbol.value() || (t === n.seriesShortSymbol.value() || void 0)) }, x = function() { i.get(0).blur(), d(!1) }, i.on("keypress", function(t) { t.keyCode === p.ESC && x() }), i.on("keydown", function(t) { t.keyCode === p.ESC && x() })), S
                    }, v.isRoot = function(t) { return !(!t || !Array.isArray(t.contracts)) }, v.prototype.addRoot = function(t, e) {
                        var i, o;
                        this._currentTbody = null, i = document.createElement("tbody"), this._container.appendChild(i), o = this, e.addEventListener("click", function(i) { i.preventDefault(), e.classList.contains("collapsed") ? o.expand(t) : o.collapse(t) }), e.setAttribute("data-root", t), i.appendChild(e), this._roots[t] = { titleRow: e, tbody: i }
                    }, v.prototype.append = function(e) {
                        var i, o, n, s, r, a = null,
                            l = null;
                        if (v.isRoot(e))
                            for (i = e.symbol, o = (e.exchange || "unknown") + "_" + i, this._translationCache[e.type] || (this._translationCache[e.type] = $.t(e.type)), a = t.createSuggestListRow(e, this._tickerRegExp, this._translationCache, { nameContent: "<div>" + (S ? i : i.replace(this._tickerRegExp, "<strong>$&</strong>")) + "</div>", typeContent: this._translationCache[e.type] + (e.exchange && " - " + e.exchange || ""), addClass: "group-title" }), this._roots[o] || this.addRoot(o, a), n = 0; n < e.contracts.length; ++n) s = e.contracts[n], r = t.createSuggestListRow(s, this._tickerRegExp, this._translationCache), l = s.ticker || s.full_name, this._itemsByTicker[l] = s,
                                r.setAttribute("data-item-ticker", l), this._roots[o].tbody.appendChild(r);
                        else this._currentTbody || (this._currentTbody = document.createElement("tbody"), this._container.appendChild(this._currentTbody)), a = t.createSuggestListRow(e, this._tickerRegExp, this._translationCache), this._currentTbody.appendChild(a);
                        l = e.ticker || e.full_name, this._itemsByTicker[l] = e, a.setAttribute("data-item-ticker", l)
                    }, v.prototype.toggleCollapsed = function(t, e) {
                        var i;
                        if (t)(i = this._roots[t]) && ($(i.titleRow).toggleClass("collapsed", !!e), $(i.tbody).find("tr:not(.group-title)").toggleClass("hidden", !!e));
                        else
                            for (t in this._roots) this.toggleCollapsed(t, e)
                    }, v.prototype.collapse = function(t) { this.toggleCollapsed(t, !0) }, v.prototype.expand = function(t) { this.toggleCollapsed(t, !1) }, v.prototype.getItemByTicker = function(t) { return this._itemsByTicker[t] || null }, t.GroupListHandler = v, t.isIntervalInit = function(t) { return /[\d,]/.test(t) && e.enabled("show_interval_dialog_on_key_press") }, t.isIntervalChar = function(t) { return e.enabled("seconds_resolution") ? /[\dhdwms]/i.test(t) : /[\dhdwm]/i.test(t) }, t.parseIntervalValue = function(t) {
                        var e = /^[,\s]*(\d*)\s*([hdwms]?)\s*$/i.exec(t) || [],
                            i = ~~e[1],
                            o = e[2] && e[2].toUpperCase(),
                            n = { qty: !i && o ? 1 : i, unit: o || null };
                        return n.error = !i && !o, n.intraday = !(n.error || n.unit && "H" !== n.unit), n
                    }, t.sanitizeIntervalValue = function(e) {
                        var i = t.parseIntervalValue(e),
                            o = i.qty,
                            n = i.unit;
                        return i.error ? null : ("H" === n && (o *= 60, n = null), o && !n ? o + "" : n && (!o || 1 === o && "S" !== n) ? n : o + n)
                    }, t.detachInterval = function(t) { var e = /,[^,]*$/i.exec(t) || []; if (e[0]) return { rest: t.substr(0, t.length - e[0].length), detached: e[0] } }, t.intervalIsSupported = function(i) { var s, r, a; return e.enabled("allow_supported_resolutions_set_only") ? null !== (s = this.sanitizeIntervalValue(i)) && o.isAvailable(s) : (r = t.parseIntervalValue(i), !r.error && (r.intraday ? n.intraday.value() : !(a = n.supportedResolutions.value()) || !!~a.indexOf(r.unit))) },
                    function() {
                        var e = "",
                            i = null;
                        t.resetStoredInterval = function() { e = "", i = null }, t.detachStoreInterval = function(o) { var n = t.detachInterval(o); return n ? (e = n.detached, i = t.sanitizeIntervalValue(e), n.rest) : (t.resetStoredInterval(), o) }, t.recallAttachInterval = function(t) { return t + e }, t.getInterval = function(e) { var o = i; return !0 === e && t.resetStoredInterval(), o }, t.getInputValueGetter = function(e) { return function() { return t.detachStoreInterval(e.value) } }, t.getInputValueSetter = function(e) { return function(i) { e.value = t.recallAttachInterval(i) } }, t.intervalError = function() { return !(!e || /^,\s*$/.test(e)) && !i }
                    }(), t.registerDialogKeypressHandler = function(o) {
                        if (!o) throw new TypeError("chartWidget is required");
                        r.pushBackListener("symbolEdit", function(o) {
                            var s, r = i(190);
                            if (g(o))
                                if (o.preventDefault(), s = String.fromCharCode(o.charCode), t.isIntervalInit(s)) new r({ callback: function(t) { n.interval.setValue(t) } }).show(s);
                                else {
                                    if (!e.enabled("symbol_search_hot_key")) return;
                                    t.showDialog({ initialValue: s, callback: function(t, e) { n.symbol.setValue(t), e && n.interval.setValue(e) } })
                                }
                        })
                    }, t.canShowSpreadActions = function() {
                        return "undefined" != typeof SymbolSearchInputParserMixin && "cme" !== TradingView.widgetCustomer && "bovespa" !== TradingView.widgetCustomer
                    }, t
            }();
        t.exports = u
    }).call(e, i(3))
}, function(t, e, i) {
    "use strict";

    function o(t, e, i, s) {
        var a = new n(this, t);
        e.push(a), r.call(this, t, e, i), this.properties().listeners().subscribe(this, o.prototype.changeStyles), this._constructor = s, this._studyId = null, this._nonseriesdata = null, this._indexes = null, this._metaInfo = null, this._graphics = null, this._inputs = null
    }

    function n(t, e) { a.call(this, t, e) }

    function s(t, e) { a.call(this, t, e) }
    var r = i(1).LineDataSource,
        a = i(9),
        l = i(90).VertLineRenderer,
        h = i(11).TrendLineRenderer,
        c = i(68).SelectionRenderer,
        d = i(6),
        p = i(155),
        u = i(86),
        _ = i(25);
    inherit(o, r), o.prototype.pointsCount = function() { throw Error("Reimplement this in a child class") }, o.prototype.title = function() { return this._metaInfo.description }, o.prototype.studyId = function() { return this._metaInfo.id }, o.prototype._requestStudy = function() { throw Error("Reimplement this in a child class") }, o.prototype.changeStyles = function() {
        var t, e, o, n = i(80);
        if (this._inputs) {
            t = n.splitInputs(this.properties().inputs.state()), e = t.obj;
            for (o in e)
                if (e[o] !== this._inputs[o]) { this._inputs = e, this._requestStudy(), this._properties.lastUpdateTime.setValue((new Date).valueOf()); break }
        } else t = n.splitInputs(this.properties().inputs.state()), this._inputs = TradingView.clone(t.obj), this._requestStudy(), this._properties.lastUpdateTime.setValue((new Date).valueOf())
    }, o.prototype._checkTurnaround = function(t) { return t === this._turnaround || t === this._model.mainSeries()._turnaround || t === this._model.mainSeries()._turnaround + "_" + this._turnaround }, o.prototype.stop = function() { r.prototype.stop.call(this), this._studyId && this._model.chartApi().removeStudy(this._studyId) }, o.prototype.onData = function(t) { throw Error("Reimplement this in a child class") }, o.prototype._correctedPoint = function(t) {
        var e = parseInt(this._model.mainSeries().bars().first(), 10),
            i = parseInt(this._model.mainSeries().bars().last(), 10);
        return t.index = Math.max(t.index, e), t.index = Math.min(t.index, i), t
    }, o.prototype.addPoint = function(t) { return r.prototype.addPoint.call(this, this._correctedPoint(t)) }, o.prototype.setLastPoint = function(t) { return r.prototype.setLastPoint.call(this, this._correctedPoint(t)) }, o.prototype.move = function(t) {}, o.prototype.clearData = function() { void 0 !== this.m_data && (this.m_data = new u(this._plotFields)), this._nonseriesdata = null, this._indexes = null, this._graphics = new p(this._metaInfo), this.updateAllViews() }, o.prototype.state = function(t) { var e = r.prototype.state.call(this, t); return t && (void 0 !== this.m_data && (e.data = this.m_data.state()), e.nonseriesdata = this._nonseriesdata, e.nonseriesindexes = this._indexes, e.graphics = this._graphics.graphics()), this.metaInfo() instanceof _ ? e.metaInfo = this.metaInfo().state() : (e.metaInfo = $.extend({}, this.metaInfo()), e.metaInfo.id = _.parseIdString(e.metaInfo.id + (e.metaInfo.version ? "-" + e.metaInfo.version : "")).fullId), e }, o.prototype.restoreData = function(t) {
        void 0 !== this.m_data && void 0 !== t.data && this.m_data.restoreState(t.data),
            this._nonseriesdata = t.nonseriesdata ? t.nonseriesdata : null, this._indexes = t.nonseriesindexes ? t.nonseriesindexes : null, this._graphics.setGraphics(t.graphics ? t.graphics : p.emptyGraphics())
    }, o.prototype.setPoint = function(t, e) { this._nonseriesdata = null, this._indexes = null, r.prototype.setPoint.call(this, t, this._correctedPoint(e)) }, o.prototype.disconnect = function() { this._studyId = 0 }, o.prototype.graphics = function() { return this._graphics.graphics() }, o.prototype.firstValue = function() { return this._model.mainSeries().data().firstValue() }, o.prototype.formatter = function() { return this._model.mainSeries().data().formatter() }, o.prototype.metaInfo = function() { return this._metaInfo }, inherit(n, a), n.prototype.renderer = function() { var t, e, i, o, n, s = new d; return this._points.length < 2 ? s : this._source._nonseriesdata ? s : this._source._graphics && !this._source._graphics.isEmpty() ? s : (t = this._points[0], e = this._points[1], i = {}, i.points = [t], i.color = "#808080", i.linewidth = this._source._doNotNeedLine ? 0 : 1, i.linestyle = CanvasEx.LINESTYLE_SOLID, s.append(new l(i)), o = {}, o.points = [e], o.color = "#808080", o.linewidth = this._source._doNotNeedLine ? 0 : 1, o.linestyle = CanvasEx.LINESTYLE_SOLID, s.append(new l(o)), n = { points: [t, e], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: "#808080", linewidth: this._source._doNotNeedLine ? 0 : 1, linestyle: CanvasEx.LINESTYLE_SOLID, extendleft: !1, extendright: !1, leftend: r.LINEEND_NORMAL, rightend: r.LINEEND_NORMAL }, s.append(new h(n)), s) }, inherit(s, a), s.prototype.renderer = function() { var t = new d; return this.isAnchorsRequired() && (t.append(new c({ points: this._points })), t.append(this.createLineAnchor({ points: this._points }))), t }, e.StudyLineDataSource = o, e.StudyLineDataSourcePaneView = s
}, 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, this._isMarkersEnabled = H.enabled("source_selection_markers"), 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, this._isMarkersEnabled = H.enabled("source_selection_markers"), n = this._study.metaInfo().plots, s = 0; s < n.length; s++) n[s].id === this._plotName && (this._plotIndex = s, z(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._isMarkersEnabled = H.enabled("source_selection_markers"), 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; for (this.m_study = t, this.m_series = e, this.m_model = i, this.m_plotName = o, this.m_bars = [], this._invalidated = !0, this._isMarkersEnabled = H.enabled("source_selection_markers"), 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(37),
        u = p.rgbToHsl,
        _ = p.hslToRgb,
        f = p.rgbToHexString,
        m = p.parseRgb,
        g = p.parseRgba,
        v = i(8),
        y = i(68),
        b = y.SelectionRenderer,
        w = y.SelectionRendererArrowsUpDown,
        S = i(59),
        T = S.PaneRendererBars,
        C = S.PaneRendererHistogram,
        x = S.PaneRendererColumns,
        P = S.PaneRendererLine,
        L = S.PaneRendererArea,
        k = S.PaneRendererCandles,
        I = S.PaneRendererCross,
        A = S.PaneRendererCircles,
        E = S.PaneRendererArrowsUpDownItem,
        M = S.PaneRendererArrowsUpDown,
        D = S.PaneRendererUnicodeChar,
        O = S.PaneRendererBackground,
        $ = i(303),
        V = i(6),
        B = i(344),
        R = i(2),
        N = i(81),
        F = i(552),
        z = i(44).assert,
        W = i(14),
        H = i(3);
    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, p, u, _, f, m, g, y, b, w, S, T, C, x, P, L, k, I, A, E, M, D, O, $;
            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 = [N.PlotType.Line, N.PlotType.Area, N.PlotType.Circles, N.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), p = this.m_study.priceScale(), u = p.properties().percentage.value(), _ = R.clamp(this._getTranspValue(), 0, 100), f = {}, m = function(t, e) { var i = t + "@" + e; return f[i] || (this._plotName && "vol" === this._plotName ? f[i] = W.generateColor(t, e) : f[i] = W.generateColor(t, e, !0)), f[i] }.bind(this), g = d._start; g < d._end; ++g) y = d._indexAt(g), y += n, y = Math.floor(y), b = d._valueAt(g), w = b[this._plotIndex + 1], S = void 0 === w || null === w, w = S ? NaN : w, u && !S && (w = 100 * (w - l) / l), r && S || (T = new R.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], null != w ? (P = this._palette.valToIndex ? this._palette.valToIndex[w] : w, L = this._paletterProps.colors[P], k = L.color.value(), T.style.color = W.isHexColor(k) ? m(k, _) : k) : (k = x.color.value(), T.style.color = m(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 (p.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 = B(e, i), this._selectionData = { points: [] }, this._selectionData.hittestResult = v.REGULAR, g = 0; g < E.length; g++) y = E[g], b = this.m_study.data().valueAt(y), y += n, void 0 !== b && (w = b[this._plotIndex + 1], p.properties().percentage.value() && (w = 100 * (w - l) / l), M = this.m_model.timeScale().indexToCoordinate(Math.floor(y)), D = this.m_study.priceScale().priceToCoordinate(w), this._selectionData.points.push(new R.Point(M, D)));
                O = this.m_study.properties().styles[this._plotName], this._lineColor = W.generateColor(O.color.value(), _), this._lineWidth = O.linewidth.value(), $ = O.color.value(), this._colorer && null != (w = this._paletterProps.colors[0]) && ($ = w.color.value(), this._lineWidth = w.width.value(), this._lineColor = W.generateColor(w.color.value(), _)), this._color2 = W.generateColor($, _), this._color1 = W.generateColor(o.addHueForColor($), _)
            }
        }, o.addHueForColor = F(function(t) {
            var e = u(m(t)),
                i = e[0] + .05;
            return e[0] = i - Math.floor(i), f(_(e))
        }), 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 V, i = !!n.joinPoints && n.joinPoints.value(), n.plottype.value()) {
                    case N.PlotType.Line:
                    case N.PlotType.Line_with_breaks:
                        e.append(new P(t));
                        break;
                    case N.PlotType.Area:
                    case N.PlotType.Area_with_breaks:
                        e.append(new L(t));
                        break;
                    case N.PlotType.Histogram:
                        e.append(new C(t));
                        break;
                    case N.PlotType.Columns:
                        e.append(new x(t));
                        break;
                    case N.PlotType.Cross:
                        e.append(new I(t)), i && (o = TradingView.merge({}, t), o.lineWidth = 1, o.forceLineWidth = !0, e.append(new P(o)));
                        break;
                    case N.PlotType.Circles:
                        e.append(new A(t)), i && (o = TradingView.merge({}, t), o.lineWidth = 1, o.ignorePaletteLineWidth = !0, e.append(new P(o)));
                        break;
                    default:
                        e.append(new P(t))
                }
                return this.m_study === this.m_model.selectedSource() && this._isMarkersEnabled && e.append(new b(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 = [], z(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 R.Point(Math.floor(u) - .5), g = isNumber(r) ? r : 50, g = Math.min(g, 100), g = Math.max(g, 0), null != f ? (v = s.valToIndex ? s.valToIndex[f] : f, m.color = W.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 V, e.append(new O(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, p, u, _, f, m, g, 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 = B(o, n), p = this.m_study === this.m_model.selectedSource(), p && (this.m_selectionData = { points: [], hittestResult: v.REGULAR, vertOffset: 0 }), u = this.m_series.properties().style.value(), _ = u === TradingView.Series.STYLE_LINE ? "lineStyle" : u === TradingView.Series.STYLE_AREA ? "areaStyle" : null, _ ? (f = this.m_series.properties()[_].priceSource.value(), m = f) : (f = "high", m = "low"), this._topCoord = e.coordinateToPrice(e.height() * e.topMargin()), this._bottomCoord = e.coordinateToPrice(e.height() * (1 - e.bottomMargin())), g = l._start; g < l._end; ++g) y = l._indexAt(g), b = Math.floor(y + s), w = l._valueAt(g), null !== (S = w[this.m_plotIndex + 1]) && void 0 !== S && void 0 !== (T = this._createItem(b, S, f, m, 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 = {}, null != S ? (P = this._palette.valToIndex ? this._palette.valToIndex[S] : S, x = this._paletterProps.colors[P].color.value(), T.style.color = W.generateColor(x, c)) : (x = this.m_study.properties().styles[this.m_plotName].color.value(), T.style.color = W.generateColor(x, 100)), L = c > 9 ? c - 10 : 0, T.style.borderColor = W.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 = {}), null != S ? (P = this._textPalette.valToIndex ? this._textPalette.valToIndex[S] : S, I = this._textPaletterProps.colors[P].color.value(), T.style.textColor = W.generateColor(I, c)) : (I = this.m_study.properties().styles[this.m_plotName].textColor.value(), T.style.textColor = W.generateColor(I, 100))), p && -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), R.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 R.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:
                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 = W.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 = N.plotShapesData[a], h = new V, l && h.append(new TradingView[l.paneRendererClass](e)), this.m_study === this.m_model.selectedSource() && this._isMarkersEnabled && (this.m_selectionData.vertOffset = r, h.append(new b(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, 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 = W.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 = W.generateColor(w.color.value(), l), e.height = n, e.vertOffset = h, c = w.plottype.value(), d = N.plotShapesData[c], p = new V, u = w.text ? w.text.value() : void 0, void 0 !== u && "" !== u.trim() && (_ = u.trim().replace(/\\n/gm, "\n"), _ = TradingView.cleanButAmpersand(_, !0), f = !1, m = !1, g = "Arial", v = 12, e.textCache = new $(_, f, m, g, v), y = w.textColor ? w.textColor.value() : void 0,
                e.textColor = y ? W.generateColor(y, i) : a), null != d && p.append(new TradingView[d.paneRendererClass](e)), this.m_study === this.m_model.selectedSource() && this._isMarkersEnabled && (this.m_selectionData.vertOffset = h, p.append(new b(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 = this.m_study.properties().styles[this.m_plotName]; if (g.visible && g.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(), g.size ? (s = g.size.value(), n = this._calculateShapeHeight(50, s)) : n = Math.round(o), r = g.location.value(), a = W.generateColor(g.color.value(), i), l = this._calculateVerticalOffset(r, n), e.items = this.items(), e.char = g.char.value(), e.height = n, e.vertOffset = l, e.color = a, h = new V, c = g.text ? g.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, _ = "Arial", f = 12, e.textCache = new $(d, p, u, _, f), m = g.textColor ? g.textColor.value() : void 0, e.textColor = m ? W.generateColor(m, i) : a), h.append(new D(e)), this.m_study === this.m_model.selectedSource() && this._isMarkersEnabled && (this.m_selectionData.vertOffset = l, h.append(new b(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 = R.clamp(this._getTranspValue(), 0, 100), i = this.m_model.timeScale().barSpacing(), t.items = this.m_items, t.barSpacing = i, t.colorup = W.generateColor(this.m_study.properties().styles[this.m_plotName].colorup.value(), e), t.colordown = W.generateColor(this.m_study.properties().styles[this.m_plotName].colordown.value(), e), o = g(t.colorup), n = o ? 100 * (1 - o[3]) : 0, s = g(t.colordown), r = s ? 100 * (1 - s[3]) : 0, t.colorBorderUp = W.generateColor("#000000", n), t.colorBorderDown = W.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 V, a.append(new M(t)), this.m_study === this.m_model.selectedSource() && (l = this.m_selectionData, l.barSpacing = i, a.append(new w(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 E(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, p, g, y, b, w, S, T, C, x, P, L, k, I, A, E, M, D, O, $, V, N, F;
            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] = W.generateColor(t, e)), c[i] }, p = s._start; p < s._end; ++p) {
                    for (g = s._indexAt(p), g = Math.floor(g), y = s._valueAt(p), b = !0, w = {}, S = TradingView.OPEN_PLOT; S <= TradingView.CLOSE_PLOT; ++S) {
                        if (void 0 === (T = y[this._ohlcPlotIndexes[S] + 1]) || null === T) { b = !1; break }
                        w[S] = T
                    }
                    b && (C = w[TradingView.OPEN_PLOT], x = w[TradingView.CLOSE_PLOT], P = Math.max(C, w[TradingView.HIGH_PLOT], w[TradingView.LOW_PLOT], x), L = Math.min(C, w[TradingView.HIGH_PLOT], w[TradingView.LOW_PLOT], x), k = {}, k.time = Math.round(g), a ? (k.open = 100 * (C - n) / n, k.high = 100 * (P - n) / n, k.low = 100 * (L - n) / n, k.close = 100 * (x - n) / n) : (k.open = C, k.high = P, k.low = L, k.close = x), I = h.color.value(), A = void 0 !== y[this._colorer + 1] || this._palette && this._palette.addDefaultColor, this._colorer && A && null != (T = y[this._colorer + 1]) && (E = this._palette.valToIndex ? this._palette.valToIndex[T] : T, M = this._paletterProps.colors[E], I = M.color.value()), k.color = d(I, l), D = u(m(I)), O = D[2] > .25 ? D[2] - .26 : D[2] + .75, $ = _(D[0], D[1], O), k.borderColor = d(f($), l), k.hollow = null, this.m_bars.push(k))
                }
                if (r.barPricesToCoordinates(this.m_bars), this.m_model.timeScale().barIndexesToCoordinates(this.m_bars), this.m_study === this.m_model.selectedSource())
                    for (V = B(e, i), this._selectionData = { points: [], hittestResult: v.REGULAR }, p = 0; p < V.length; p++) g = V[p], void 0 !== (y = this.m_study.data().valueAt(g)) && (T = y[this._plotIndex + 1], r.properties().percentage.value() && (T = 100 * (T - n) / n), N = this.m_model.timeScale().indexToCoordinate(Math.floor(g)), F = this.m_study.priceScale().priceToCoordinate(T), this._selectionData.points.push(new R.Point(N, F)))
            }
        }, 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 V, e.append(new T(t)), this.m_series === this.m_model.selectedSource() && this._isMarkersEnabled && e.append(new b(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 V, i.append(new k(t)), this.m_series === this.m_model.selectedSource() && this._isMarkersEnabled && i.append(new b(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, i) {
    "use strict";

    function o(t, e) {
        var o, n, s, r, a, l, h, c, d, p, u;
        if (!t) throw Error("No studies metainfo");
        if (o = i(350), this._studiesMetainfo = t, !e) throw Error("No studies migrations");
        for (this._studiesMigrations = e, this._migrations = {}, n = 0; n < this._studiesMigrations.length; n++)
            for (s = this._studiesMigrations[n], r = 0; r < s.length; r++)
                for (a = s[r], l = a.versFrom, h = a.versTo, c = 0; c < a.studyMigrations.length; c++) {
                    if (d = a.studyMigrations[c], p = d.studyId, 0 === d.rules.length) throw Error("Study Migration should have at least one convertion rule");
                    u = p in this._migrations ? this._migrations[p] : new o(p), u.addMigration(l, h, d.rules), this._migrations[p] = u
                }
        this._clientMigrations = [function(t, e) { var i, o, n, s, r; if (0 === this._studiesMetainfo.length || !t.isTVScript || t.version >= 22) return e; for (i = {}, o = 0, n = 0; void 0 !== (s = e[n]);) r = e[s.id], s.isFake && (s.id = "in_" + o++), i[n] = s, i[s.id] = r, n++; return i }]
    }
    var n = i(12).getLogger("Chart.Study.Versioning"),
        s = i(752),
        r = i(25),
        a = i(44).assert;
    o.prototype.updateMetaInfo = function(t) {
        var e, i, o;
        if (!t) return t;
        for (a(!t.isTVScript, "This method should update only built-in java indicators metaInfo. For Pine indicators use updateMetaInfoAsync"), e = null, i = this._studiesMetainfo, o = 0; o < i.length; o++)
            if (i[o].id === t.id) { e = i[o]; break }
        return TradingView.clone(e)
    }, o.prototype.updateMetaInfoAsync = function(t, e) {
        var i, o, n, s, a, l = $.Deferred(),
            h = l.promise();
        if (!t) return l.reject("No old metaInfo was given"), h;
        if (e) return l.resolve(null), h;
        if (i = t.isTVScript && t.scriptIdPart && TVScript.pineType(t.scriptIdPart) === TVScript.PineType.Addon, o = r.versionOf(t), t.isTVScript && !t.pine && !i && o < r.VERSION_PINE_PROTECT_TV_4164);
        else if ((t.isTVScript || t.isTVScriptStubToCompile) && t.pine && !i);
        else {
            for (n = null, s = this._studiesMetainfo, a = 0; a < s.length; a++)
                if (s[a].id === t.id) { n = s[a]; break }
            n ? l.resolve(TradingView.clone(n)) : l.resolve(null)
        }
        return h
    }, o.prototype.updateStudyState = function(t, e, i) {
        var s, a, l, h, c, d, p, u, _, f, m, g, v, y, b;
        if (t) { t = TradingView.clone(t), s = e.id, s in this._migrations && (a = this._migrations[s].updateInputs(e.version, t.inputs), t.inputs = a); for (l = 0; l < this._clientMigrations.length; ++l) a = this._clientMigrations[l].call(this, e, t.inputs), Object.keys(a).length === Object.keys(t.inputs).length ? t.inputs = a : n.logWarn("StudyVersioning._clientMigrations application returned bad result. Skipping it...") }
        if ((h = TradingView.clone(i)) && t && (c = {}, o.mergeInputs(c, h.inputs), o.mergeInputs(c, h.defaults.inputs), o.mergeInputs(c, t.inputs), t.inputs = c, d = r.versionOf(e), e.isTVScript && e.TVScriptSourceCode && d >= 12 && d <= 26)) {
            for (p = {}, l = 0; l < e.plots.length; ++l) u = e.plots[l], _ = h.plots[l], p[u.id] = _.id;
            for (f = Object.keys(t.styles),
                l = 0; l < f.length; ++l) m = f[l], g = t.styles[m], delete t.styles[m], v = p[m], t.styles[v] = g;
            for (y = Object.keys(t.plots), l = 0; l < y.length; ++l) b = y[l], m = t.plots[b].id, t.plots[b].id = p[m]
        }
        return t
    }, o.prototype.patchPointsBasedStudyState = function(t) { return o._fixInputsMaxValue(t.state, t.metaInfo), t }, o.prototype.patchPointsBasedStudyData = function(t, e) { if (!s.isProd()) return e; if (!t || !e) return e; var i = TradingView.clone(e); return "VbPFixed@tv-volumebyprice" === t.id && t.version && t.version <= 4 && o._patchOldVolumeProfiles(0, i), i }, o.prototype.patchStudyData = function(t, e, i, n) {
        var a, l, h, c, d, p, u;
        if (!s.isProd()) return { data: e, nsData: i, indexes: n };
        if (a = TradingView.clone(e), l = TradingView.clone(i), h = TradingView.clone(n), "VbPVisible@tv-volumebyprice" === t.id && t.version && t.version <= 4 && o._patchOldVolumeProfiles(0, a.graphics), "VbPSessions@tv-volumebyprice" === t.id && t.version && t.version <= 4 && o._patchOldVolumeProfiles(0, a.graphics), c = r.versionOf(t), t.isTVScript && t.TVScriptSourceCode && c >= 12 && c <= 26)
            for (d = a.columns, a.columns = [], p = 0; p < d.length; ++p) u = "plot_" + p, a.columns.push(u);
        return { data: a, nsData: l, indexes: h }
    }, o._patchOldVolumeProfiles = function(t, e) {
        var i, o = e.hhists[t].data,
            n = [];
        for (i in o) n = n.concat(o[i]);
        e.hhists[0].data = n
    }, o._fixInputsOrder = function(t, e) {
        var i, n, s, a, l = r.getOrderedInputIds(e),
            h = o.splitInputs(t.inputs),
            c = h.arr,
            d = h.obj,
            p = TradingView.merge({}, d);
        for (i = 0; i < l.length; ++i) n = l[i], null !== (s = o.findInputKeyById(c, n)) && (a = c[s], p[i] = a);
        t.inputs = p
    }, o.INPUT_MAX_VALUE = 1e12, o._verifyInputsMaxValue = function(t) {
        var e, i, s = o.INPUT_MAX_VALUE;
        if (t.inputs)
            for (e = 0; e < t.inputs.length; e++) i = t.inputs[e], "integer" === i.type && i.max && i.max > s && n.logWarn("Bad integer input max value in metaInfo id=" + t.id + " title=" + t.description)
    }, o._fixInputsMaxValue = function(t, e) {
        var i, n, s, r, a, l;
        if (!TradingView.isAbsent(e)) {
            if (i = o.INPUT_MAX_VALUE, e.inputs)
                for (n = 0; n < e.inputs.length; n++) s = e.inputs[n], "integer" === s.type && s.max && s.max > i && (s.max = i);
            if (t && t.inputs) {
                r = o.splitInputs(t.inputs), a = r.arr;
                for (l in a) s = a[l], "integer" === s.type && s.max && s.max > i && (s.max = i);
                t.inputs = TradingView.merge(r.obj, r.arr)
            }
        }
    }, o.prototype.patchPropsStateAndMetaInfo = function(t, e, i) {
        var n, s, a, l, h, c, d, p, u, _, f, m, g, v, y, b, w;
        if ("Script$BOOKER" !== e.productId || e.alerts || delete t.alerts, o._fixInputsOrder(t, e), o._fixInputsMaxValue(t, e), r.versionOf(e) < r.METAINFO_FORMAT_VERSION_SOS_V2 && e.isChildStudy && (t.isChildStudy = e.isChildStudy), n = 60, e.isTVScript && e.version < n && ("Script$TV_EARNINGS@tv-scripting" !== e.id && "Script$TV_DIVIDENDS@tv-scripting" !== e.id && "Script$TV_SPLITS@tv-scripting" !== e.id || delete e.TVScriptSourceCode), "Volume" !== e.id && "Volume@tv-basicstudies" !== e.id || 0 !== e.inputs.length || (e.inputs = [{ id: "length", type: "integer", defval: 20, min: 1, max: 1e3 }], e.plots.push({ id: "vol_ma", type: "line" })), "Volume@tv-basicstudies" === e.id && e.version && e.version <= 46 && (t.styles.vol.transparency = t.transparency || 87), "PivotPointsStandard@tv-basicstudies" === e.id && (0 === e.inputs.length ? (t.inputs = { kind: "Traditional", showHistoricalPivots: !0 }, e.inputs = [{ defval: "Traditional", id: "kind", type: "text", options: ["Traditional", "Fibonacci", "Woodie", "Classic", "DeMark", "Camarilla"] }, {
                id: "showHistoricalPivots",
                type: "bool",
                defval: !0
            }]) : 1 === e.inputs.length && (t.inputs = { kind: "Traditional" }, e.inputs = [{ defval: "Traditional", id: "kind", type: "text", options: ["Traditional", "Fibonacci", "Woodie", "Classic", "DeMark", "Camarilla"] }, { id: "showHistoricalPivots", type: "bool", defval: !0 }]), void 0 === t._hardCodedDefaultsVersion && (t._hardCodedDefaultsVersion = 1, s = t.color, delete t.color, t.levelsStyle = { colors: { P: s, "S1/R1": s, "S2/R2": s, "S3/R3": s, "S4/R4": s, "S5/R5": s } })), "CMF" === e.shortId && 2 === e.inputs.length && (t.inputs = { length: t.inputs["length fast"] }, e.inputs = e.inputs.splice(0, 1), e.inputs[0].id = "length"), e.defaults && void 0 === e.defaults.precision && (-1 !== ["Volume@tv-basicstudies", "VbPVisible@tv-volumebyprice", "VbPSessions@tv-volumebyprice"].indexOf(e.id) ? e.defaults.precision = 0 : e.defaults.precision = 4), a = 60, e.version < a)
            for (l = ["TV_DIVIDENDS", "TV_SPLITS", "TV_EARNINGS"], h = 6, c = 0; c < l.length; c++) e.id.startsWith("Script$" + l[c] + "@tv-scripting") && (e.fullId = "ESD" + e.fullId.substring(h), e.id = "ESD" + e.id.substring(h), e.name = "ESD" + e.name.substring(h), e.shortId = "ESD" + e.shortId.substring(h), e.productId = "ESD" + e.productId.substring(h));
        if (r.versionOf(e) < r.VERSION_PINE_PROTECT_TV_4164 && (d = { "StrategyScript$STD;Consecutive%1Ups/Downs%1Strategy": { pineId: "STD;Consecutive%1Ups%1Downs%1Strategy", className: "StrategyScript" }, Script$EDGR_NET_INCOME_FROM_CONTINUING_OPERATIONS_APPLICABLE_TO_COMMON_V2: { pineId: "Script$EDGR_NET_INCOME_FROM_CONTINUING_OPS_APPLICABLE_TO_COMMON_V2", className: "Script" } }, e.shortId in d && (p = d[e.shortId].className + "$" + d[e.shortId].pineId, u = { scriptIdPart: d[e.shortId].pineId, fullId: e.fullId.replace(e.shortId, p), id: e.id.replace(e.shortId, p), name: e.name.replace(e.shortId, p), shortId: p }, TradingView.merge(e, u), TradingView.merge(t, u)), _ = TradingView.StudyMetaInfo.cutScriptIdPart(e.fullId), (f = _.match(/^(USER)(_\d+)(;)(.*)$/)) && (m = f[0], g = f[1] + f[3] + f[2] + f[4], u = { scriptIdPart: g, fullId: e.fullId.replace(m, g), id: e.id.replace(m, g), name: e.name.replace(m, g), shortId: e.shortId.replace(m, g) }, TradingView.merge(e, u), TradingView.merge(t, u))), "MA" === e.id) {
            switch (v = new r({ id: "MAExp", properties: [{ id: "is_price_study", type: "bool", value: "true" }], inputs: [{ id: "length", type: "integer", defval: 20, min: 1, max: 500 }, { id: "source", type: "text", defval: "close", options: ["open", "high", "low", "close"] }], plots: [{ id: "MovAvgExp", type: "line" }], palettes: {} }), y = new r({ id: "MASimple", properties: [{ id: "is_price_study", type: "bool", value: "true" }], inputs: [{ id: "length", type: "integer", defval: 20, min: 1, max: 500 }, { id: "source", type: "text", defval: "close", options: ["open", "high", "low", "close"] }], plots: [{ id: "MovAvgSimple", type: "line" }], palettes: {} }), b = new r({ id: "MAVolumeWeighted", properties: [{ id: "is_price_study", type: "bool", value: "true" }], inputs: [{ id: "length", type: "integer", defval: 20, min: 1, max: 500 }, { id: "source", type: "text", defval: "close", options: ["open", "high", "low", "close"] }], plots: [{ id: "MovAvgVolumeWeighted", type: "line" }], palettes: {} }), w = new r({
                id: "MAWeighted",
                properties: [{ id: "is_price_study", type: "bool", value: "true" }],
                inputs: [{ id: "length", type: "integer", defval: 20, min: 1, max: 500 }, {
                    id: "source",
                    type: "text",
                    defval: "close",
                    options: ["open", "high", "low", "close"]
                }],
                plots: [{ id: "MovAvgWeighted", type: "line" }],
                palettes: {}
            }), t.inputs.type) {
                case "exp":
                    e = v;
                    break;
                case "simple":
                    e = y;
                    break;
                case "weighted":
                    e = w;
                    break;
                case "volume weighted":
                    e = b
            }
            t.styles[e.plots[0].id] = t.styles.MovAvg, delete t.styles.MovAvg, delete t.inputs.type
        }
        return i.oldShowStudyLastValueProperty && (t.oldShowLastValue = t.showLastValue), delete t.showLastValue, delete t.showStudyArguments, { propsState: t, metaInfo: e }
    }, o.isVersionTesting = function(t) { var e; return !!t && (t = "" + t, e = RegExp("\\d+.\\d+"), e.exec(t) === t) }, o.isVersionHead = function(t) { var e; return !!t && (t = "" + t, e = RegExp("\\d+"), e.exec(t) === t) }, o.mergeInputs = function(t, e) { o.mergeInputsArrPart(t, e), o.mergeInputsObjPart(t, e) }, o.mergeInputsArrPart = function(t, e) { var i, n, s = o.splitInputs(e); for (i in s.arr) n = o.findInputKeyById(t, s.arr[i].id), n ? TradingView.merge(t[n], s.arr[i]) : o.appendInputInfoToArr(t, s.arr[i]) }, o.mergeInputsObjPart = function(t, e) {
        var i = o.splitInputs(e);
        TradingView.merge(t, i.obj)
    }, o.appendInputInfoToArr = function(t, e) {
        var i, o, n = -1;
        for (i in t) o = parseInt(i, 10), isNumber(o) && o > n && (n = o);
        t[n + 1] = e
    }, o.splitInputs = function(t) {
        var e, i = {},
            o = {};
        for (e in t) isNumber(parseInt(e, 10)) ? i[e] = t[e] : o[e] = t[e];
        return { arr: i, obj: o }
    }, o.findInputKeyById = function(t, e) {
        var i, o = null;
        for (i in t)
            if (isNumber(parseInt(i, 10)) && t[i].id === e) { o = i; break }
        return o
    }, o.getInputKeyById = function(t, e) { var i = o.findInputKeyById(t, e); if (!i) throw Error("Cannot find input with id: " + e); return i }, t.exports = o
}, function(t, e, i) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 }), i(28),
        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: $.t("Arrow Down"), id: "shape_arrow_down", paneRendererClass: "PaneRendererArrowDown", pineName: "shape.arrowdown" },
            shape_arrow_up: { guiName: $.t("Arrow Up"), id: "shape_arrow_up", paneRendererClass: "PaneRendererArrowUp", pineName: "shape.arrowup" },
            shape_circle: { guiName: $.t("Circle"), id: "shape_circle", paneRendererClass: "PaneRendererCircleShape", pineName: "shape.circle" },
            shape_cross: { guiName: $.t("Cross"), id: "shape_cross", paneRendererClass: "PaneRendererCrossShape", pineName: "shape.cross" },
            shape_diamond: { guiName: $.t("Diamond"), id: "shape_diamond", paneRendererClass: "PaneRendererDiamond", pineName: "shape.diamond" },
            shape_flag: {
                guiName: $.t("Flag"),
                id: "shape_flag",
                paneRendererClass: "PaneRendererFlagShape",
                pineName: "shape.flag"
            },
            shape_label_down: { guiName: $.t("Label Down"), id: "shape_label_down", paneRendererClass: "PaneRendererLabelDown", pineName: "shape.labeldown" },
            shape_label_up: { guiName: $.t("Label Up"), id: "shape_label_up", paneRendererClass: "PaneRendererLabelUp", pineName: "shape.labelup" },
            shape_square: { guiName: $.t("Square"), id: "shape_square", paneRendererClass: "PaneRendererSquare", pineName: "shape.square" },
            shape_triangle_down: { guiName: $.t("Triangle Down"), id: "shape_triangle_down", paneRendererClass: "PaneRendererTriangleApexDown", pineName: "shape.triangledown" },
            shape_triangle_up: { guiName: $.t("Triangle Up"), id: "shape_triangle_up", paneRendererClass: "PaneRendererTriangleApexUp", pineName: "shape.triangleup" },
            shape_xcross: { guiName: $.t("X Cross"), id: "shape_xcross", paneRendererClass: "PaneRendererXCross", pineName: "shape.xcross" }
        }
}, , , , , function(t, e, i) {
    "use strict";

    function o() { this._chunks = {} }

    function n(t) { var e, i; for (this._items = [], this._columns = t || [], this._start = 0, this._end = 0, this._shareread = !1, this._plotCaches = {}, this._itemsSearchCache = {}, e = 0; e < this._columns.length; e++) i = this._columns[e], this._plotCaches[i] = new o }
    var s = i(12).getLogger("Chart.PlotList");
    o.CHUNK_SIZE = 30, n.prototype.clear = function() { this._items = [], this._itemsSearchCache = {}, this._columns = [], this._start = 0, this._end = 0, this._shareread = !1, this._plotCaches = {} }, n.prototype.columns = function() { return this._columns }, n.prototype.last = function() { return this._items[this._end - this._start - 1] }, n.prototype.first = function() { return this._items[0] }, n.prototype.firstIndex = function() { return this._start }, n.prototype.lastIndex = function() { return this._end - this._start - 1 }, n.prototype.size = function() { return this._end - this._start }, n.prototype.isEmpty = function() { return 0 === this.size() }, n.prototype.contains = function(t) { return -1 !== this._search(t) }, n.prototype.valueAt = function(t) { var e = this.search(t); if (e) return e.value }, n.prototype.add = function(t, e) { var i, o; return this._shareread ? (s.logDebug("add: readonly collection modification attempt"), !1) : (i = this._createPair(t, e), o = this._search(t), this._itemsSearchCache = {}, o < 0 ? (o = this._lowerbound(t, -1), this._items.splice(o, 0, i), this._start = 0, this._end = this._items.length, !0) : (this._items[o] = i, !1)) }, TradingView.SEARCH_NEAREST_LEFT = -1, TradingView.SEARCH_EXACT = 0, TradingView.SEARCH_NEAREST_RIGHT = 1, n.prototype.search = function(t, e) { var i, o; return this._itemsSearchCache[t] && this._itemsSearchCache[t][e] ? this._itemsSearchCache[t][e] : (i = this._search(t, e)) < 0 ? void 0 : (o = { index: this._indexAt(i), value: this._valueAt(i) }, this._itemsSearchCache[t] = this._itemsSearchCache[t] || {}, this._itemsSearchCache[t][e] = o, o) }, n.prototype.fold = function(t, e) { var i, o = e; for (i = this._start; i < this._end; ++i) o = t(this._indexAt(i), this._valueAt(i), o); return o }, n.prototype.each = function(t) { for (var e = this._start; e < this._end && !t(this._indexAt(e), this._valueAt(e)); ++e); }, n.prototype.reduce = function(t, e) { var i, o = e; for (i = this._start; i < this._end; ++i) o = t(o, this._indexAt(i), this._valueAt(i)); return o }, n.prototype.range = function(t, e) {
        var i = new n;
        return i._items = this._items, i._start = this._lowerbound(t), i._end = Math.min(this._lowerbound(e) + 1, i._items.length), i._shareread = !0, i
    }, n.prototype.minMaxOnRange2 = function(t, e, i) {
        var n, s, r, a, l, h, c, d, p, u, _, f, m, g, v, y, b = null,
            w = null;
        if (0 === this._items.length) return { min: b, max: w };
        for (n = this._items[0], s = 0; s < i.length; s++) {
            for (r = i[s], a = t - r.offset, l = e - r.offset, a = Math.max(a, n), l = Math.min(l, n + this._items.length - 1), h = Math.ceil(a / o.CHUNK_SIZE) * o.CHUNK_SIZE, c = Math.max(h, Math.floor(l / o.CHUNK_SIZE) * o.CHUNK_SIZE), this._plotCaches[r.index] || (this._plotCaches[r.index] = {}), d = this._plotCaches[r.index], p = a; p <= Math.min(l, h) && p <= e; p++) u = this._items[p - n].value, void 0 !== (_ = u[r.index]) && null !== _ && ((null === b || _ < b) && (b = _), (null == w || _ > w) && (w = _));
            for (f = Math.max(h + 1, a); f < c; f += o.CHUNK_SIZE) m = Math.floor(f / o.CHUNK_SIZE), g = d[m], g || (v = m * o.CHUNK_SIZE, y = (m + 1) * o.CHUNK_SIZE - 1, g = this.minMaxOnRange(v, y, [r]), d[m] = g), null !== g.min && (g.min < b || null === b) && (b = g.min), null !== g.max && (g.max > w || null === w) && (w = g.max);
            for (p = c; p <= l; p++) u = this._items[p - n].value, void 0 !== (_ = u[r.index]) && null !== _ && ((null === b || _ < b) && (b = _), (null == w || _ > w) && (w = _));
            void 0 !== r.baseValue && (b = Math.min(r.baseValue, b), w = Math.max(r.baseValue, w))
        }
        return { min: b, max: w }
    }, n.prototype.minMaxOnRange = function(t, e, i) {
        var o, n, s, r, a, l, h, c = this._lowerbound(t),
            d = Math.min(this._lowerbound(e) + 1, this._items.length);
        for (this._items[this._end - 1] > e && (d = c), o = null, n = null, s = 0; s < i.length; s++) {
            for (r = i[s], c = this._lowerbound(t - r.offset), d = Math.min(this._lowerbound(e - r.offset) + 1, this._items.length), this._items[d - 1] > e - r.offset && (d = c), a = c; a < d; a++) l = this._items[a].value, void 0 !== (h = l[r.index]) && null !== h && ((null === o || h < o) && (o = h), (null == n || h > n) && (n = h));
            void 0 !== r.baseValue && (o = Math.min(r.baseValue, o), n = Math.max(r.baseValue, n))
        }
        return { min: o, max: n }
    }, n.prototype.merge = function(t) {
        var e, i, n, r, a;
        if (this._shareread) return s.logDebug("merge: shared collection modification attempt"), [];
        for (e = [], e.earliestRow = null, i = 0; i < t.length; ++i) {
            for (n = t[i], r = Math.floor(n.index / o.CHUNK_SIZE), a = 0; a < this._columns.length; a++) this._plotCaches[a] && delete this._plotCaches[a][r];
            (null === e.earliestRow || e.earliestRow > n) && (e.earliestRow = n), this.add(n.index, n.value) ? e.push({ insert: n }) : e.push({ update: n })
        }
        return e
    }, n.prototype.addTail = function(t, e) {
        var i, o, n = 0;
        for (e && this._end - this._start > 0 && (n = 1, this._items[this._end - this._start - 1].value = t[0].value), i = n; i < t.length; ++i) o = t[i], this.add(parseInt(this.last(), 10) + 1, o.value);
        this._itemsSearchCache = {}
    }, n.prototype._createPair = function(t, e) { var i = new Number(t); return i.value = e, i }, n.prototype._valueAt = function(t) { return this._items[t].value }, n.prototype._length = function(t) { return this._items.length }, n.prototype._indexAt = function(t) { return this._items[t].valueOf() }, n.prototype._search = function(t, e) { var i = this._bsearch(t); return -1 === i && e ? e < 0 ? (i = this._lowerbound(t), i > this._start && (i -= 1), i !== this._end && this._indexAt(i) < t ? i : -1) : (i = this._upperbound(t), i !== this._end && t < this._indexAt(i) ? i : -1) : i }, n.prototype._bsearch = function(t) { var e = this._lowerbound(t); return e === this._end || t < this._items[e] ? -1 : e }, n.prototype._lowerbound = function(t) {
        for (var e, i, o = this._start, n = this._end, s = n - o; 0 < s;) e = s >> 1, i = o + e, this._items[i] < t ? (o = i + 1, s -= e + 1) : s = e;
        return o
    }, n.prototype._upperbound = function(t) { for (var e, i, o = this._start, n = this._end, s = n - o; 0 < s;) e = s >> 1, i = o + e, t < this._items[i] ? s = e : (o = i + 1, s -= e + 1); return o }, n.prototype.state = function() {
        var t, e = {};
        e.columns = this._columns, e.start = this._start, e.end = this._end, e.shareread = this._shareread, e.data = [];
        for (t in this._items) e.data.push({ index: new Number(this._items[t]), value: this._items[t].value });
        return e
    }, n.prototype.restoreState = function(t) { var e, i; if (!t) return void this.clear(); for (this._columns = t.columns, this._start = t.start, this._end = t.end, this._shareread = t.shareread, this._items = [], this._itemsSearchCache = {}, e = 0; e < t.data.length; e++) i = new Number(t.data[e].index), i.value = t.data[e].value, this._items.push(i) }, n.prototype.firstTimeIndex = function() { return this._indexAt(this._start) }, n.prototype.lastTimeIndex = function() { return this._indexAt(this._end - 1) }, t.exports = n
}, function(t, e, i) {
    (function(t) {
        "use strict";

        function o(t, e, i, o, n) { a.call(this, t, e), this._study = i, this._showOnlyConfirmInputs = o, this._symbolSearchZindex = n, this.prepareLayout(), this._$symbolSearchPopup = null }

        function n(t, e, i) { a.call(this, t, e), this._study = i, this.prepareLayout() }

        function s(t, e, i) { a.call(this, t, e), this._study = i, this._property = t, this.prepareLayout() }
        var r = i(5),
            a = r.PropertyPage,
            l = r.UppercaseTransformer,
            h = r.GreateTransformer,
            c = r.LessTransformer,
            d = r.ToIntTransformer,
            p = r.ToFloatTransformer,
            u = r.SimpleComboBinder,
            _ = r.BooleanBinder,
            f = r.SymbolBinder,
            m = r.DisabledBinder,
            g = r.BarTimeBinder,
            v = r.ColorBinding,
            y = r.SliderBinder,
            b = r.SessionBinder,
            w = r.SimpleStringBinder,
            S = i(77),
            T = i(32).addColorPicker,
            C = i(19).createLineStyleEditor,
            x = i(737).createShapeLocationEditor,
            P = i(738).createShapeStyleEditor,
            L = i(13).createLineWidthEditor,
            k = i(739).createVisibilityEditor,
            I = i(735).createHHistDirectionEditor,
            A = i(369).createPlotEditor,
            E = i(26).NumericFormatter,
            M = i(25),
            D = i(81).PlotType,
            O = i(31),
            V = O.Study,
            B = i(12).getLogger("Chart.Study.PropertyPage");
        inherit(o, a), o.prototype.i18nCache = [window.t("open"), window.t("high"), window.t("low"), window.t("close"), window.t("hl2"), window.t("hlc3"), window.t("ohlc4")], o.prototype._addSessionEditor = function(t, e, i, o) {
                var n, s, r, a, l, h;
                if ("session" !== i.type) return void B.logError("Session editor adding FAILED: wrong input type.");
                n = function(t, e) {
                    var i, o = $("<td/>");
                    o.appendTo(t), o.css("padding-left", "0px"), o.css("padding-right", "0px"), i = $("<input>"), i.attr("type", "text"), i.addClass("ticker"), i.css("width", "40px"), i.attr("id", e), i.appendTo(o)
                }, s = function(t, e, i) {
                    var o, n = $("<td/>");
                    n.css("padding-left", i), n.css("padding-right", i), n.appendTo(t), o = $("<div/>"), o.appendTo(n), o.append(e), o.css("font-size", "150%")
                }, r = $("<table/>"), r.appendTo(t), a = $("<tr/>"), a.appendTo(r), l = ["start_hours", "start_minutes", "end_hours", "end_minutes"], n.call(this, a, l[0]), s.call(this, a, ":", 0), n.call(this, a, l[1]), s.call(this, a, "-", 4), n.call(this, a, l[2]), s.call(this, a, ":", 0), n.call(this, a, l[3]), h = !1, this.bindControl(new b(a, l, e, h, this.model(), o))
            }, o.prototype.prepareLayoutImpl = function(e, i) {
                function o(t) {
                    return (new E).format(t)
                }

                function n(t) {
                    return function(e) {
                        var i, o, n, s = this,
                            r = null;
                        if (0 === e.indexOf("#")) {
                            if (i = e.slice(1, e.indexOf("$")), !((o = et._model.dataSourceForId(i)) && o instanceof V)) return void B.logError("Can not get Study by id " + i);
                            if (o.isStarted() || o.start(null, !0), !(n = o.sourceId())) return void B.logError("Can not get source id for " + o.metaInfo().id);
                            r = e.replace(/^[^\$]+/, n)
                        }!~e.indexOf("$") && !~e.indexOf("#") || et._study.isStarted() || et._study.start(null, !0), et._study.testInputValue(t, e) ? s.setValueToProperty(r || s.value()) : s.setValue(et._property.inputs[t.id].value())
                    }
                }

                function s(t) {
                    return function(e) {
                        var i, o, n, s;
                        if (t.hasOwnProperty(e) || 0 === e.indexOf("#") || !~e.indexOf("$")) return e;
                        for (i = e.slice(0, e.indexOf("$")), o = et._model.dataSources(), n = 0; n < o.length; ++n)
                            if ((s = o[n]) instanceof V && s.sourceId() === i) { e = e.replace(/^[^\$]+/, "#" + s.id()); break }
                        return e
                    }
                }
                var r, a, m, v, y, b, T, C, x, P, L, k, I, A, D, O, R, N, F, z, W, H, U, j, q, Y, G, K, X, Z, J, Q, tt, et = this;
                for (r = 0; r < e.inputs.length; r++)
                    if (a = e.inputs[r], "first_visible_bar_time" !== (m = a.id) && "last_visible_bar_time" !== m && "time" !== a.type && !a.isHidden && (!this._showOnlyConfirmInputs || a.confirm) && void 0 === a.groupId) {
                        if (v = a.name || m.toLowerCase().replace(/\b\w/g, function(t) { return t.toUpperCase() }), y = "Change " + v, b = $("<tr/>"), b.appendTo(i), T = $("<td/>"), T.appendTo(b), T.addClass("propertypage-name-label"), T.text($.t(v, { context: "input" })), C = $("<td/>"), C.appendTo(b), x = null, P = null, L = null, "resolution" === a.type) x = $('<select><option value="1">1</option><option value="3">3</option><option value="5">5</option><option value="15">15</option><option value="30">30</option><option value="45">45</option><option value="60">1' + $.t("h", { context: "interval_short" }) + '</option><option value="120">2' + $.t("h", { context: "interval_short" }) + '</option><option value="180">3' + $.t("h", { context: "interval_short" }) + '</option><option value="D">1' + $.t("D", { context: "interval_short" }) + '</option><option value="W">1' + $.t("W", { context: "interval_short" }) + "</option></select>");
                        else if ("symbol" === a.type) x = $('<input class="symbol-edit single">'), S.bindToInput(x, { onPopupOpen: function(t) { this._$symbolSearchPopup = t, this._symbolSearchZindex && t.css("z-index", this._symbolSearchZindex) }.bind(this), onPopupClose: function() { this._$symbolSearchPopup = null }.bind(this) });
                        else if ("session" === a.type) this._addSessionEditor(C, this._property.inputs[m], a, y);
                        else if ("source" === a.type) {
                            for (k = {}, I = ["open", "high", "low", "close", "hl2", "hlc3", "ohlc4"], A = 0; A < I.length; ++A) k[I[A]] || (k[I[A]] = I[A]);
                            if (D = this._study && this._study.isChildStudy()) { O = this._study.source(), R = O.title(!0, null, !0), N = M.getChildSourceInputTitles(a, this._study.source().metaInfo(), R); for (F in k) N[F] && (k[F] = 1 === Object.keys(N).length ? R : N[F]) }
                            if (t.enabled("study_on_study") && this._study && M.isSourceInput(a) && (D || M.canBeChild(this._study.metaInfo()))) {
                                for (z = [this._study], z = z.concat(this._study.getAllChildren()), W = this._model.dataSources(), H = 0; H < W.length; ++H)
                                    if ((U = W[H]) instanceof V && !~z.indexOf(U) && U.canHaveChildren())
                                        if (j = U.title(!0, null, !0), q = U.sourceId() || "#" + U.id(), Y = U.metaInfo(), G = Y.styles, K = Y.plots || [],
                                            1 === K.length) k[q + "$0"] = j;
                                        else
                                            for (A = 0; A < K.length; ++A) X = K[A], ~M.CHILD_STUDY_ALLOWED_PLOT_TYPES.indexOf(X.type) && (k[q + "$" + A] = j + ": " + (G && G[X.id] && G[X.id].title || X.id));
                                P = n(a), L = s(k)
                            }
                            x = $(document.createElement("select"));
                            for (Z in k) $("<option>").attr("value", Z).text(k[Z]).appendTo(x);
                            C.addClass("js-value-cell")
                        } else if (a.options)
                            for (x = $("<select/>"), H = 0; H < a.options.length; H++) Z = a.options[H], $("<option value='" + Z + "'>" + Z + "</option>").appendTo(x);
                        else x = $("<input/>"), "bool" === a.type ? x.attr("type", "checkbox") : x.attr("type", "text");
                        x && (x.appendTo(C), x.is(":checkbox") || x.css("width", "100px")), a.options ? this.bindControl(new u(x, this._property.inputs[m], null, !0, this.model(), y, P, L)) : "bar_time" === a.type ? (J = 10, this.bindControl(new g(x, this._property.inputs[m], !0, this.model(), y, this.model().mainSeries(), J)), x.addClass("ticker")) : "integer" === a.type ? (Q = [d(a.defval)], (0 === a.min || a.min) && Q.push(h(a.min)), (0 === a.max || a.max) && Q.push(c(a.max)), this.bindControl(new w(x, this._property.inputs[m], Q, !1, this.model(), y)), x.addClass("ticker"), isFinite(a.step) && a.step > 0 && x.attr("data-step", a.step)) : "float" === a.type ? (Q = [p(a.defval)], (0 === a.min || a.min) && Q.push(h(a.min)), (0 === a.max || a.max) && Q.push(c(a.max)), tt = new w(x, this._property.inputs[m], Q, !1, this.model(), y), tt.addFormatter(o), this.bindControl(tt), x.addClass("ticker"), isFinite(a.step) && a.step > 0 && x.attr("data-step", a.step)) : "text" === a.type ? this.bindControl(new w(x, this._property.inputs[m], null, !1, this.model(), y)) : "bool" === a.type ? this.bindControl(new _(x, this._property.inputs[m], !0, this.model(), y)) : "resolution" === a.type ? this.bindControl(new u(x, this._property.inputs[m], l, !0, this.model(), "Change Interval")) : "symbol" === a.type && this.bindControl(new f(x, this._property.inputs[m], !0, this.model(), "Change Symbol"))
                    }
                this._property.offset && (v = this._property.offset.title ? this._property.offset.title.value() : $.t("Offset"), x = this.addOffsetEditorRow(i, v), Q = [d(this._property.offset.val)], Q.push(h(this._property.offset.min)), Q.push(c(this._property.offset.max)), this.bindControl(new w(x, this._property.offset.val, Q, !1, this.model(), "Undo " + v))), this._property.offsets && $.each(e.plots, function(t, e) {
                    var o, n, s, r;
                    this._property.offsets[e.id] && (o = this._property.offsets[e.id], void 0 !== o.isHidden && o.isHidden.value() || (n = o.title.value(), s = this.addOffsetEditorRow(i, n), r = [d(o.val)], r.push(h(o.min)), r.push(c(o.max)), this.bindControl(new w(s, o.val, r, !1, this.model(), "Undo " + n))))
                }.bind(this))
            }, o.prototype.prepareLayout = function() {
                this._table = $("<table/>"), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2");
                var t = this._study.metaInfo();
                this.prepareLayoutImpl(t, this._table), this.loadData()
            }, o.prototype.symbolSearchPopup = function() { return this._$symbolSearchPopup }, o.prototype.widget = function() { return this._table }, inherit(n, a), n.prototype.prepareLayout = function() {
                function t(t) { return (new E).format(t) }
                var e, i, o, s, r, a, l, h, c, d, f, m, g, b, S, x, P, k, I, A, D, O, V, R, N, F, z, W, H, U, j, q, Y, G, K, X;
                for (this._table = $("<table/>"), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"),
                    this._table.attr("cellpadding", "2"), e = this._study.metaInfo(), i = {}, o = 0; o < e.plots.length; ++o)
                    if (!(this._study.isSelfColorerPlot(o) || this._study.isTextColorerPlot(o) || this._study.isDataOffsetPlot(o) || this._study.isOHLCColorerPlot(o))) {
                        if (a = e.plots[o], e.styles) {
                            if (e.styles[a.id]) s = e.styles[a.id].isHidden;
                            else {
                                if (!this._study.isOHLCSeriesPlot(o)) continue;
                                if (r = e.plots[o].target, i[r]) continue;
                                s = e.ohlcPlots[r].isHidden, i[r] = r
                            }
                            if (s) continue
                        }
                        this._study.isLinePlot(o) || this._study.isBarColorerPlot(o) || this._study.isBgColorerPlot(o) ? this._prepareLayoutForPlot(o, a) : this._study.isPlotArrowsPlot(o) ? this._prepareLayoutForArrowsPlot(o, a) : this._study.isPlotCharsPlot(o) ? this._prepareLayoutForCharsPlot(o, a) : this._study.isPlotShapesPlot(o) ? this._prepareLayoutForShapesPlot(o, a) : this._study.isOHLCSeriesPlot(o) ? (l = { id: r, type: "ohlc" }, this._study.isOHLCBarsPlot(o) ? this._prepareLayoutForBarsPlot(o, l) : this._study.isOHLCCandlesPlot(o) && this._prepareLayoutForCandlesPlot(o, l)) : B.logError("Unknown plot type: " + a.type)
                    }
                if ((h = this._study.properties().bands) && h.childCount() > 0)
                    for (o = 0; o < h.childCount(); o++) c = h[o], c.isHidden && c.isHidden.value() || (d = $('<tr class="line"/>'), d.appendTo(this._table), f = $("<td/>"), f.appendTo(d), m = $("<input type='checkbox' class='visibility-switch'/>"), m.appendTo(f), g = $.t(c.name.value(), { context: "input" }), b = this.createLabeledCell(g, m).appendTo(d).addClass("propertypage-name-label"), S = $("<td/>"), S.appendTo(d), S.addClass("colorpicker-cell"), x = T(S), P = $("<td/>"), P.appendTo(d), k = L(), k.appendTo(P), I = $('<td colspan="4">').css({ whiteSpace: "nowrap" }), I.appendTo(d), A = C(), A.render().appendTo(I), D = $("<input class='property-page-bandwidth' type='text'/>"), D.appendTo(I), O = [p(c.value.value())], V = "Change band", R = new w(D, c.value, O, !1, this.model(), V), R.addFormatter(t), this.bindControl(R), this.bindControl(new _(m, c.visible, !0, this.model(), V)), this.bindControl(new v(x, c.color, !0, this.model(), V)), this.bindControl(new u(A, c.linestyle, parseInt, !0, this.model(), V)), this.bindControl(new y(k, c.linewidth, !0, this.model(), V)));
                if (this._study.properties().bandsBackground && (c = this._study.properties().bandsBackground, N = $.t("Background"), V = $.t("Change band background"), d = this._prepareFilledAreaBackground(c.fillBackground, c.backgroundColor, c.transparency, N, V), d.appendTo(this._table)), this._study.properties().areaBackground && (c = this._study.properties().areaBackground, N = $.t("Background"), V = $.t("Change area background"), d = this._prepareFilledAreaBackground(c.fillBackground, c.backgroundColor, c.transparency, N, V), d.appendTo(this._table)), void 0 !== (F = e.filledAreas))
                    for (o = 0; o < F.length; ++o) z = F[o], z.isHidden || (V = "Change " + N, c = this._study.properties().filledAreasStyle[z.id], N = z.title || $.t("Background"), z.palette ? (d = $('<tr class="line"/>'), f = $("<td/>"), f.appendTo(d), m = $("<input type='checkbox' class='visibility-switch'/>"), m.appendTo(f), this.bindControl(new _(m, c.visible, !0, this.model(), V + " visibility")), this.createLabeledCell(N, m).appendTo(d).addClass("propertypage-name-label"), d.appendTo(this._table), W = this._findPlotPalette(o, z), H = W.palette, U = W.paletteProps,
                        this._prepareLayoutForPalette(0, z, H, U, V)) : (d = this._prepareFilledAreaBackground(c.visible, c.color, c.transparency, N, V), d.appendTo(this._table)));
                for (j in e.graphics) { q = e.graphics[j]; for (Y in q) c = this._property.graphics[j][Y], n["_createRow_" + j].call(this, this._table, c) }
                G = this._table.find(".visibility-switch.plot-visibility-switch"), 1 === G.length && (f = G.parent(), f.css("display", "none"), b = this._table.find(".propertypage-plot-with-palette"), 1 === b.length ? b.css("display", "none") : (b = this._table.find(".propertypage-name-label"), b.css("padding-left", 0), b.find("label").attr("for", ""))), K = this._prepareStudyPropertiesLayout(), this._table = this._table.add(K), M.isScriptStrategy(e) && (X = this._prepareOrdersSwitches(), this._table = this._table.add(X)), this.loadData()
            }, n.prototype._prepareOrdersSwitches = function() {
                var t, e, i, o, n, s, r, a = $('<table class="property-page study-strategy-properties" cellspacing="0" cellpadding="2">'),
                    l = "chart-orders-switch_" + Date.now().toString(36),
                    h = $("<tr>").appendTo(a),
                    c = $('<input id="' + l + '" type="checkbox">').appendTo($("<td>").appendTo(h));
                return $('<label for="' + l + '">' + $.t("Trades on Chart") + "</label>").appendTo($("<td>").appendTo(h)), t = "chart-orders-labels-switch_" + Date.now().toString(36), e = $("<tr>").appendTo(a), i = $('<input id="' + t + '" type="checkbox">').appendTo($("<td>").appendTo(e)), $('<label for="' + t + '">' + $.t("Signal Labels") + "</label>").appendTo($("<td>").appendTo(e)), o = "chart-orders-qty-switch_" + Date.now().toString(36), n = $("<tr>").appendTo(a), s = $('<input id="' + o + '" type="checkbox">').appendTo($("<td>").appendTo(n)), $('<label for="' + o + '">' + $.t("Quantity") + "</label>").appendTo($("<td>").appendTo(n)), r = this._study.properties(), this.bindControl(new _(c, r.strategy.orders.visible, !0, this.model(), "Trades on chart visibility")), this.bindControl(new _(i, r.strategy.orders.showLabels, !0, this.model(), "Signal labels visibility")), this.bindControl(new m(i, r.strategy.orders.visible, !0, this.model(), "Signal labels visibility", !0)), this.bindControl(new _(s, r.strategy.orders.showQty, !0, this.model(), "Quantity visibility")), this.bindControl(new m(s, r.strategy.orders.visible, !0, this.model(), "Quantity visibility", !0)), a
            }, n.prototype._prepareLayoutForPlot = function(t, e) {
                var i, o, n, s, r, a, l, h, c, d, p, f, m = e.id,
                    g = this._study.properties().styles[m],
                    b = this._findPlotPalette(t, e),
                    w = b.palette,
                    S = b.paletteProps,
                    C = "Change " + m;
                w ? (i = $('<tr class="line"/>'), i.appendTo(this._table), o = $("<td/>"), o.appendTo(i), o.addClass("visibility-cell"), n = $("<input type='checkbox' class='visibility-switch plot-visibility-switch'/>"), n.appendTo(o), this.bindControl(new _(n, g.visible, !0, this.model(), C)), s = $.t(g.title.value(), { context: "input" }), this.createLabeledCell(s, n).appendTo(i).addClass("propertypage-name-label propertypage-plot-with-palette"), this._prepareLayoutForPalette(t, e, w, S, C)) : (i = $('<tr class="line"/>'), i.appendTo(this._table), o = $("<td/>"), o.appendTo(i), o.addClass("visibility-cell"), n = $("<input type='checkbox' class='visibility-switch plot-visibility-switch'/>"), n.appendTo(o), s = $.t(this._study.properties().styles[m].title.value(), { context: "input" }),
                    this.createLabeledCell(s, n).appendTo(i).addClass("propertypage-name-label"), r = $("<td/>"), r.appendTo(i), r.addClass("colorpicker-cell"), a = T(r), l = $("<td/>"), l.appendTo(i), h = L(), h.appendTo(l), c = $("<td>"), c.appendTo(i), d = A(), d.appendTo(c), p = $("<td>"), p.appendTo(i), f = $("<input type='checkbox'>"), f.appendTo(p), this.createLabeledCell("Price Line", f).appendTo(i), this.bindControl(new _(n, g.visible, !0, this.model(), C)), this.bindControl(new v(a, g.color, !0, this.model(), C, g.transparency)), this.bindControl(new y(h, g.linewidth, !0, this.model(), C, this._study.metaInfo().isTVScript)), this.bindControl(new u(d, g.plottype, parseInt, !0, this.model(), C)), this.bindControl(new _(f, g.trackPrice, !0, this.model(), "Change Price Line")))
            }, n.prototype._prepareLayoutForBarsPlot = function(t, e) {
                var i, o, n, s, r, a, l = e.id,
                    h = this._study.properties().ohlcPlots[l],
                    c = this._findPlotPalette(t, e),
                    d = c.palette,
                    p = c.paletteProps,
                    u = "Change " + l,
                    f = $('<tr class="line"/>');
                f.appendTo(this._table), i = $("<td/>"), i.appendTo(f), i.addClass("visibility-cell"), o = $("<input type='checkbox' class='visibility-switch'/>"), o.appendTo(i), this.bindControl(new _(o, h.visible, !0, this.model(), u)), n = h.title.value(), this.createLabeledCell(n, o).appendTo(f).addClass("propertypage-name-label"), d ? (s = !0, this._prepareLayoutForPalette(t, e, d, p, u, s)) : (r = $("<td/>"), r.appendTo(f), r.addClass("colorpicker-cell"), a = T(r), this.bindControl(new v(a, h.color, !0, this.model(), u)))
            }, n.prototype._prepareLayoutForCandlesPlot = function(t, e) {
                var i, o, n, s, r, a, l, h, c;
                this._prepareLayoutForBarsPlot(t, e), i = e.id, o = this._study.properties().ohlcPlots[i], n = "Change " + i, s = $('<tr class="line"/>'), s.appendTo(this._table), r = $("<td/>"), r.appendTo(s), r.addClass("visibility-cell"), a = $("<input type='checkbox' class='visibility-switch'/>"), a.appendTo(r), this.bindControl(new _(a, o.drawWick, !0, this.model(), n)), l = "Wick", this.createLabeledCell(l, a).appendTo(s), h = $("<td/>"), h.appendTo(s), h.addClass("colorpicker-cell"), c = T(h), this.bindControl(new v(c, o.wickColor, !0, this.model(), n))
            }, n.prototype._prepareLayoutForShapesPlot = function(t, e) {
                var i, o, n, s, r, a, l, h, c, d = e.id,
                    p = this._study.properties().styles[d],
                    f = this._findPlotPalette(t, e),
                    m = f.palette,
                    g = f.paletteProps,
                    y = "Change " + d,
                    b = $('<tr class="line"/>');
                b.appendTo(this._table), i = $("<td/>"), i.appendTo(b), i.addClass("visibility-cell"), o = $("<input type='checkbox' class='visibility-switch'/>"), o.appendTo(i), this.bindControl(new _(o, p.visible, !0, this.model(), y)), n = $.t(this._study.properties().styles[d].title.value(), { context: "input" }), this.createLabeledCell(n, o).appendTo(b).addClass("propertypage-name-label"), s = $("<td/>"), s.appendTo(b), r = P(), r.appendTo(s), this.bindControl(new u(r, p.plottype, null, !0, this.model(), y)), a = $("<td/>"), a.appendTo(b), l = x(), l.appendTo(a), this.bindControl(new u(l, p.location, null, !0, this.model(), y)), m ? this._prepareLayoutForPalette(t, e, m, g, y) : (b = $('<tr class="line"/>'), b.appendTo(this._table), $("<td/>").appendTo(b), $("<td/>").appendTo(b), h = $("<td/>"), h.appendTo(b), h.addClass("colorpicker-cell"), c = T(h), this.bindControl(new v(c, p.color, !0, this.model(), y, p.transparency)))
            },
            n.prototype._prepareLayoutForCharsPlot = function(t, e) {
                var i, o, n, s, r, a, l, h, c, d = e.id,
                    p = this._study.properties().styles[d],
                    f = this._findPlotPalette(t, e),
                    m = f.palette,
                    g = f.paletteProps,
                    y = "Change " + d,
                    b = $('<tr class="line"/>');
                b.appendTo(this._table), i = $("<td/>"), i.appendTo(b), i.addClass("visibility-cell"), o = $("<input type='checkbox' class='visibility-switch'/>"), o.appendTo(i), this.bindControl(new _(o, p.visible, !0, this.model(), y)), n = $.t(this._study.properties().styles[d].title.value(), { context: "input" }), this.createLabeledCell(n, o).appendTo(b).addClass("propertypage-name-label"), s = $("<td/>"), s.appendTo(b), r = $('<input type="text"/>'), r.appendTo(s), r.keyup(function() {
                    var t = $(this),
                        e = t.val();
                    e && (t.val(e.split("")[e.length - 1]), t.change())
                }), this.bindControl(new w(r, p.char, null, !1, this.model(), y)), a = $("<td/>"), a.appendTo(b), l = x(), l.appendTo(a), this.bindControl(new u(l, p.location, null, !0, this.model(), y)), m ? this._prepareLayoutForPalette(t, e, m, g, y) : (b = $('<tr class="line"/>'), b.appendTo(this._table), $("<td/>").appendTo(b), $("<td/>").appendTo(b), h = $("<td/>"), h.appendTo(b), h.addClass("colorpicker-cell"), c = T(h), this.bindControl(new v(c, p.color, !0, this.model(), y, p.transparency)))
            }, n.prototype._isStyleNeedsConnectPoints = function(t) { return [D.Cross, D.Circles].indexOf(t) >= 0 }, n.prototype._prepareLayoutForPalette = function(t, e, i, o, n, s) {
                var r, a, l, h, c, d, p, f, m, g, b, w, S, C, x, P = t,
                    k = e.id,
                    I = null,
                    E = k.startsWith("fill");
                I = s ? this._study.properties().ohlcPlots[k] : E ? this._study.properties().filledAreasStyle[k] : this._study.properties().styles[k], r = 0;
                for (a in i.colors) l = o.colors[a], h = $('<tr class="line"/>'), h.appendTo(this._table), $("<td/>").appendTo(h), c = $("<td/>"), c.appendTo(h), c.addClass("propertypage-name-label"), c.html($.t(l.name.value(), { context: "input" })), d = $("<td/>"), d.appendTo(h), d.addClass("colorpicker-cell"), p = T(d), this.bindControl(new v(p, l.color, !0, this.model(), n, I.transparency)), !E && this._study.isLinePlot(P) && (f = $("<td/>"), f.appendTo(h), m = L(), m.appendTo(f), this.bindControl(new y(m, l.width, !0, this.model(), n, this._study.metaInfo().isTVScript)), g = $("<td>"), g.appendTo(h), 0 === r && (b = A(), b.appendTo(g), this.bindControl(new u(b, I.plottype, parseInt, !0, this.model(), n)), w = $("<input type='checkbox'>"), S = $('<td colspan="4">').css({ whiteSpace: "nowrap" }), C = $("<span>").html($.t("Price Line")), x = $("<span>"), x.append(w), S.append(x).append(C).appendTo(h), this.bindControl(new _(w, I.trackPrice, !0, this.model(), "Change Price Line")))), r++
            }, n.prototype._prepareLayoutForArrowsPlot = function(t, e) {
                var i, o, n, s, r, a, l, h = e.id,
                    c = this._study.properties().styles[h],
                    d = "Change " + h,
                    p = $('<tr class="line"/>');
                p.appendTo(this._table), i = $("<td/>"), i.appendTo(p), i.addClass("visibility-cell"), o = $("<input type='checkbox' class='visibility-switch'/>"), o.appendTo(i), n = $.t(this._study.properties().styles[h].title.value(), { context: "input" }), this.createLabeledCell(n, o).appendTo(p).addClass("propertypage-name-label"), s = $("<td/>"), s.appendTo(p), s.addClass("colorpicker-cell"), r = T(s), a = $("<td/>"), a.appendTo(p), a.addClass("colorpicker-cell"), l = T(a), this.bindControl(new _(o, c.visible, !0, this.model(), d)),
                    this.bindControl(new v(r, c.colorup, !0, this.model(), d, c.transparency)), this.bindControl(new v(l, c.colordown, !0, this.model(), d, c.transparency))
            }, n.prototype._findPlotPalette = function(t, e) {
                var i, o = t,
                    n = e.id,
                    s = null,
                    r = null,
                    a = this._study.metaInfo().plots;
                if (this._study.isBarColorerPlot(o) || this._study.isBgColorerPlot(o)) s = this._study.metaInfo().palettes[e.palette], r = this._study.properties().palettes[e.palette];
                else
                    for (i = 0; i < a.length; i++)
                        if (a[i].target === n && (this._study.isSelfColorerPlot(i) || this._study.isOHLCColorerPlot(i))) { s = this._study.metaInfo().palettes[a[i].palette], r = this._study.properties().palettes[a[i].palette]; break } return { palette: s, paletteProps: r }
            }, n.prototype._prepareStudyPropertiesLayout = function() { var t, e, i = $('<table class="property-page study-properties" cellspacing="0" cellpadding="2">'); return this._study.metaInfo().is_price_study || (t = this.createPrecisionEditor(), e = $("<tr>"), e.appendTo(i), $("<td>" + $.t("Precision") + "</td>").appendTo(e), $("<td>").append(t).appendTo(e), this.bindControl(new u(t, this._study.properties().precision, null, !0, this.model(), "Change Precision"))), "Compare@tv-basicstudies" === this._study.metaInfo().id && (t = this.createSeriesMinTickEditor(), e = $("<tr>"), e.appendTo(i), $("<td>" + $.t("Override Min Tick") + "</td>").appendTo(e), $("<td>").append(t).appendTo(e), this.bindControl(new u(t, this._study.properties().minTick, null, !0, this.model(), "Change MinTick"))), this._putStudyDefaultStyles(i), i }, n.prototype._putStudyDefaultStyles = function(t, e) {
                var i, o, n, s, r, a, l = null,
                    h = this._study;
                return (!h.properties().linkedToSeries || !h.properties().linkedToSeries.value()) && ($.each(this._model.m_model.panes(), function(t, e) { $.each(e.dataSources(), function(t, i) { if (i === h) return l = e, !1 }) }), this._pane = l, this._pane && (-1 !== this._pane.leftPriceScale().dataSources().indexOf(this._study) ? i = "left" : -1 !== this._pane.rightPriceScale().dataSources().indexOf(this._study) ? i = "right" : this._pane.isOverlay(this._study) && (i = "none")), i && (o = this, n = { left: $.t("Scale Left"), right: $.t("Scale Right") }, o._pane.actionNoScaleIsEnabled(h) && (n.none = $.t("Screen (No Scale)")), s = this.createKeyCombo(n).val(i).change(function() {
                    switch (this.value) {
                        case "left":
                            o._model.move(o._study, o._pane, o._pane.leftPriceScale());
                            break;
                        case "right":
                            o._model.move(o._study, o._pane, o._pane.rightPriceScale());
                            break;
                        case "none":
                            o._model.move(o._study, o._pane, null)
                    }
                }), r = this.addRow(t), $("<td>" + $.t("Scale") + "</td>").appendTo(r), a = $("<td>").appendTo(r).append(s), e && e > 2 && a.attr("colspan", e - 1)), t)
            }, n.prototype.widget = function() { return this._table }, n.prototype._prepareFilledAreaBackground = function(t, e, i, o, n) {
                var s, r, a, l = $('<tr class="line"/>'),
                    h = $("<td/>");
                return h.appendTo(l), s = $("<input type='checkbox' class='visibility-switch'/>"), s.appendTo(h), this.createLabeledCell(o, s).appendTo(l).addClass("propertypage-name-label"), r = $("<td/>"), r.appendTo(l), r.addClass("colorpicker-cell"), a = T(r), this.bindControl(new _(s, t, !0, this.model(), n + " visibility")), this.bindControl(new v(a, e, !0, this.model(), n + " color", i)), l
            }, inherit(s, a), s.prototype.prepareLayout = function() {
                if (this._study.properties().linkedToSeries && this._study.properties().linkedToSeries.value()) return void(this._table = $());
                this._table = $()
            }, s.prototype.widget = function() { return this._table }, n._createRow_horizlines = function(t, e) {
                var i = this.addRow(t),
                    o = e.name.value(),
                    n = $("<input type='checkbox' class='visibility-switch'/>"),
                    s = this.createColorPicker(),
                    r = L(),
                    a = C();
                $("<td>").append(n).appendTo(i), this.createLabeledCell(o, n).appendTo(i), $("<td>").append(s).appendTo(i), $("<td>").append(r).appendTo(i), $("<td>").append(a.render()).appendTo(i), this.bindControl(new _(n, e.visible, !0, this.model(), "Change " + o + " visibility")), this.bindControl(new v(s, e.color, !0, this.model(), "Change " + o + " color")), this.bindControl(new u(a, e.style, parseInt, !0, this.model(), "Change " + o + " style")), this.bindControl(new y(r, e.width, !0, this.model(), "Change " + o + " width"))
            }, n._createRow_vertlines = function(t, e) {
                var i = this.addRow(t),
                    o = e.name.value(),
                    n = $("<input type='checkbox' class='visibility-switch'/>"),
                    s = this.createColorPicker(),
                    r = L(),
                    a = C();
                $("<td>").append(n).appendTo(i), this.createLabeledCell(o, n).appendTo(i), $("<td>").append(s).appendTo(i), $("<td>").append(r).appendTo(i), $("<td>").append(a.render()).appendTo(i), this.bindControl(new _(n, e.visible, !0, this.model(), "Change " + o + " visibility")), this.bindControl(new v(s, e.color, !0, this.model(), "Change " + o + " color")), this.bindControl(new u(a, e.style, parseInt, !0, this.model(), "Change " + o + " style")), this.bindControl(new y(r, e.width, !0, this.model(), "Change " + o + " width"))
            }, n._createRow_lines = function(t, e) {
                var i = this.addRow(t),
                    o = e.title.value(),
                    n = $("<input type='checkbox' class='visibility-switch'/>"),
                    s = this.createColorPicker(),
                    r = L(),
                    a = C();
                $("<td>").append(n).appendTo(i), this.createLabeledCell(o, n).appendTo(i), $("<td>").append(s).appendTo(i), $("<td>").append(r).appendTo(i), $("<td>").append(a.render()).appendTo(i), this.bindControl(new _(n, e.visible, !0, this.model(), "Change " + o + " visibility")), this.bindControl(new v(s, e.color, !0, this.model(), "Change " + o + " color")), this.bindControl(new u(a, e.style, parseInt, !0, this.model(), "Change " + o + " style")), this.bindControl(new y(r, e.width, !0, this.model(), "Change " + o + " width"))
            }, n._createRow_hlines = function(t, e) {
                var i, o, n, s = this.addRow(t),
                    r = e.name.value(),
                    a = $("<input type='checkbox' class='visibility-switch'/>"),
                    l = this.createColorPicker(),
                    h = L(),
                    c = C(),
                    d = $("<input type='checkbox'>");
                $("<td>").append(a).appendTo(s), this.createLabeledCell(r, a).appendTo(s), $("<td>").append(l).appendTo(s), $("<td>").append(h).appendTo(s), $("<td>").append(c.render()).appendTo(s), $("<td>").appendTo(s), $("<td>").append(d).appendTo(s), this.createLabeledCell("Show Price", d).appendTo(s), this.bindControl(new _(a, e.visible, !0, this.model(), "Change " + r + " visibility")), this.bindControl(new v(l, e.color, !0, this.model(), "Change " + r + " color")), this.bindControl(new u(c, e.style, parseInt, !0, this.model(), "Change " + r + " style")), this.bindControl(new y(h, e.width, !0, this.model(), "Change " + r + " width")), this.bindControl(new _(d, e.showPrice, !0, this.model(), "Change " + r + " show price")), e.enableText.value() && (s = this.addRow(t),
                    $('<td colspan="2">').appendTo(s), i = $("<input type='checkbox'>"), $('<td class="text-center">').append(i).appendTo(s), this.createLabeledCell("Show Text", i).appendTo(s), this.bindControl(new _(i, e.showText, !0, this.model(), "Change " + r + " show text")), o = TradingView.createTextPosEditor(), $("<td>").append(o.render()).appendTo(s), this.bindControl(new u(o, e.textPos, parseInt, !0, this.model(), "Change " + r + " text position")), n = this.createFontSizeEditor(), $('<td colspan="2">').append(n).appendTo(s), this.bindControl(new u(n, e.fontSize, parseInt, !0, this.model(), "Change " + r + " font size")))
            }, n._createRow_hhists = function(t, e) {
                var i, o, n, s, r, a, l = e.title.value(),
                    p = [],
                    f = [],
                    m = this.addRow(t),
                    g = k();
                $("<td>").append(g).appendTo(m), this.createLabeledCell(l, g).appendTo(m), this.bindControl(new _(g, e.visible, !0, this.model(), "Change " + l + " Visibility")), m = this.addRow(t), i = $("<input/>"), i.attr("type", "text"), i.addClass("ticker"), this.createLabeledCell($.t("Width (% of the Box)"), i).appendTo(m), $("<td>").append(i).appendTo(m), o = [d(40)], o.push(h(0)), o.push(c(100)), this.bindControl(new w(i, e.percentWidth, o, !1, this.model(), "Change Percent Width")), m = this.addLabeledRow(t, "Placement"), n = I(), $("<td>").append(n).appendTo(m), this.bindControl(new u(n, e.direction, null, !0, this.model(), "Change " + l + " Placement")), m = this.addRow(t), s = $("<input type='checkbox'>"), $("<td>").append(s).appendTo(m), this.createLabeledCell($.t("Show Values"), s).appendTo(m), this.bindControl(new _(s, e.showValues, !0, this.model(), "Change " + l + " Show Values")), m = this.addRow(t), r = this.createColorPicker(), this.createLabeledCell($.t("Text Color"), r).appendTo(m), $("<td>").append(r).appendTo(m), this.bindControl(new v(r, e.valuesColor, !0, this.model(), "Change " + l + " Text Color"));
                for (a in e.colors) isNumber(parseInt(a, 10)) && (m = this.addRow(t), p[a] = e.titles[a].value(), f[a] = this.createColorPicker(), $("<td>").append(p[a]).appendTo(m), $("<td>").append(f[a]).appendTo(m), this.bindControl(new v(f[a], e.colors[a], !0, this.model(), "Change " + p[a] + " color")))
            }, n._createRow_backgrounds = function(t, e) {
                var i = this.addRow(t),
                    o = $("<input type='checkbox' class='visibility-switch'/>"),
                    n = e.name.value(),
                    s = this.createColorPicker();
                $("<td>").append(o).appendTo(i), this.createLabeledCell(n, o).appendTo(i), $("<td>").append(s).appendTo(i), this.bindControl(new _(o, e.visible, !0, this.model(), "Change " + n + " visibility")), this.bindControl(new v(s, e.color, !0, this.model(), "Change " + n + " color", e.transparency))
            }, n._createRow_polygons = function(t, e) {
                var i = this.addRow(t),
                    o = e.name.value(),
                    n = this.createColorPicker();
                $("<td>").append(o).appendTo(i), $("<td>").append(n).appendTo(i), this.bindControl(new v(n, e.color, !0, this.model(), "Change " + o + " color"))
            }, n._createRow_trendchannels = function(t, e) {
                var i = this.addRow(t),
                    o = e.name.value(),
                    n = this.createColorPicker();
                $("<td>").append(o).appendTo(i), $("<td>").append(n).appendTo(i), this.bindControl(new v(n, e.color, !0, this.model(), "Change " + o + " color", e.transparency))
            }, n._createRow_textmarks = function(t, e) {
                var i = this.addLabeledRow(t),
                    o = e.name.value(),
                    n = this.createColorPicker(),
                    s = this.createColorPicker(),
                    r = this.createFontEditor(),
                    a = this.createFontSizeEditor(),
                    l = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),
                    h = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');
                $("<td>").append(o).appendTo(i), "rectangle" !== e.shape.value() && $("<td>").append(n).appendTo(i), $("<td>").append(s).appendTo(i), $("<td>").append(r).appendTo(i), $("<td>").append(a).appendTo(i), $("<td>").append(l).appendTo(i), $("<td>").append(h).appendTo(i), this.bindControl(new v(n, e.color, !0, this.model(), "Change " + o + " color", e.transparency)), this.bindControl(new v(s, e.fontColor, !0, this.model(), "Change " + o + " text color", e.transparency)), this.bindControl(new u(a, e.fontSize, parseInt, !0, this.model(), "Change " + o + " font size")), this.bindControl(new u(r, e.fontFamily, null, !0, this.model(), "Change " + o + " font")), this.bindControl(new _(l, e.fontBold, !0, this.model(), "Change Text Font Bold")), this.bindControl(new _(h, e.fontItalic, !0, this.model(), "Change Text Font Italic"))
            }, n._createRow_shapemarks = function(t, e) {
                var i = this.addRow(t),
                    o = $("<input type='checkbox' class='visibility-switch'/>"),
                    n = e.name.value(),
                    s = this.createColorPicker(),
                    r = $("<input/>");
                r.attr("type", "text"), r.addClass("ticker"), $("<td>").append(o).appendTo(i), this.createLabeledCell(n, o).appendTo(i), $("<td>").append(s).appendTo(i), this.createLabeledCell("Size", r).appendTo(i), $("<td>").append(r).appendTo(i), this.bindControl(new _(o, e.visible, !0, this.model(), "Change " + n + " visibility")), this.bindControl(new v(s, e.color, !0, this.model(), "Change " + n + " back color", e.transparency)), this.bindControl(new w(r, e.size, null, !1, this.model(), "Change size"))
            }, TradingView.StudyInputsPropertyPage = o, e.StudyInputsPropertyPage = o, e.StudyStylesPropertyPage = n, e.StudyDisplayPropertyPage = s
    }).call(e, i(3))
}, function(t, e, i) {
    "use strict";

    function o() { this._registeredSources = {}, this._sourcesToRow = {}, this._rowsToSources = {}, this._currentSymbol = "", this._actualCapacity = 0, this._actualWidth = 1, this._numericFormatter = new s, this._percentageFormatter = new n }
    var n = i(70).PercentageFormatter,
        s = i(26).NumericFormatter;
    o.prototype.levelsCount = function() { return 0 }, o.prototype.topByRow = function(t) { return t * o.ROW_HEIGHT }, o.prototype.rowHeight = function(t) { return o.ROW_HEIGHT }, o.prototype.canvas = function() {
        if (!this._canvas) {
            this._canvas = $("<canvas>"), this._cache = this._canvas.get(0).getContext("2d"), this._canvas.prop("width", 100).css("position", "absolute").css("top", 0).css("z-index", 1e3).css("left", 0);
            this._canvas.get(0).getContext("2d").font = "12px Verdana"
        }
        return this._canvas
    }, o.ROW_HEIGHT = 14, o.prototype.points = function(t) { return [t.points()[0], t.points()[1]] }, o.prototype.startPoint = function(t, e) { return e ? t.points()[0] : t.points()[1] }, o.prototype.priceRange = function(t, e) {
        var i = this.points(t),
            o = i[0],
            n = i[1];
        return e ? n.price - o.price : o.price - n.price
    }, o.prototype.sourceIsReady = function(t) { return t.points().length >= 2 }, o.prototype._calculateWidth = function(t) {
        var e, i, o, n, s, r, a, l, h, c, d, p, u, _, f, m, g, v, y, b, w, S, T;
        if (!this.sourceIsReady(t)) return null;
        if (e = this.canvas().get(0).getContext("2d"), e.font = "12px Verdana", i = !!t.properties().showPrices && t.properties().showPrices.value(), o = !!t.properties().coeffsAsPercents && t.properties().coeffsAsPercents.value(), n = t.properties().showCoeffs.value(), s = t.priceScale().formatter(), r = this.points(t), a = r[0], l = r[1], !a || !l) return null;
        if (h = !1, c = t.properties(), c.reverse && c.reverse.value() && (h = c.reverse.value()), d = this.priceRange(t, h), p = this.startPoint(t, h).price, t.priceScale().isPercent() && null === (u = t.ownerSource().firstValue())) return 0;
        for (_ = 0, f = [], m = 1; m <= this.levelsCount(); m++) g = "level" + m, v = c[g], y = v.coeff.value(), b = p + y * d, t.priceScale().isPercent() && (b = t.priceScale().priceRange().convertToPercent(b, u)), w = "", n && (w += o ? this._percentageFormatter.format(Math.round(1e4 * y) / 100) : this._numericFormatter.format(y)), i && (w += "(" + s.format(b) + ")"), S = e.measureText(w).width, T = { text: w, left: _, width: S + 4 }, f.push(T), _ += T.width;
        return { totalWidth: _, cells: f }
    }, o.prototype._effectiveState = function(t) {
        var e, i, o, n, s, r, a = {},
            l = t.properties();
        for (l.showPrices && (a.showPrices = l.showPrices.value()), l.coeffsAsPercents && (a.coeffsAsPercents = l.coeffsAsPercents.value()), a.showCoeffs = l.showCoeffs.value(), t.priceScale() && t.priceScale().formatter().state && (a.formatter = t.priceScale().formatter().state()), l.reverse && (a.reverse = l.reverse.value()), a.p1 = t.points()[0], a.p2 = t.points()[1], 3 === t.points().length && (a.p3 = t.points()[2]), a.items = [], e = 1; e <= this.levelsCount(); e++) i = "level" + e, o = l[i], n = o.coeff.value(), s = o.color.value(), r = { coeff: n, color: s }, a.items.push(r);
        return a
    }, o.prototype._findEmptyRow = function(t) { for (var e, i = 0; this._rowsToSources[i];) i++; return this._rowsToSources[i] = t, i >= this._actualCapacity && (this._actualCapacity++, e = this.canvas(), TradingView.resizeCanvas(e, this._actualWidth, o.ROW_HEIGHT * this._actualCapacity)), i }, o.prototype._repaintSource = function(t, e, i) {
        var n, s, r = o.ROW_HEIGHT * i.row,
            a = this.canvas().get(0).getContext("2d");
        for (a.clearRect(0, r, this._actualWidth, o.ROW_HEIGHT), a.textBaseline = "bottom", a.font = "12px Verdana", r += o.ROW_HEIGHT, n = 0; n < t.cells.length; n++) s = t.cells[n], a.fillStyle = e.items[n].color, a.fillText(s.text, s.left, r)
    }, o.prototype.removeSource = function(t) {
        var e, i;
        this._sourcesToRow[t] && (e = this._sourcesToRow[t].row, i = this.canvas().get(0).getContext("2d"), i.save(), i.clearRect(0, this.topByRow(e), this._actualWidth, o.ROW_HEIGHT), i.restore(), delete this._sourcesToRow[t], delete this._rowsToSources[e])
    }, o.prototype._effectiveStatesEquals = function(t, e) {
        var i, o = function(t, e) { return !(!t && !e) && (!(!t || e) || (!(t || !e) || (t.minMove !== e.minMove || (t.minMove2 !== e.minMove2 || (t.fractional !== e.fractional || t.fractionalLength !== e.fractionalLength))))) },
            n = function(t, e) { return !(!t && !e) && (!(!t || e) || (!(t || !e) || (t.index !== e.index || t.price !== e.price))) },
            s = function(t, e) { return t.coeff !== e.coeff || t.color !== e.color };
        if (t && !e) return !1;
        if (!t && e) return !1;
        if (t.showPrices !== e.showPrices) return !1;
        if (t.coeffsAsPercents !== e.coeffsAsPercents) return !1;
        if (t.showCoeffs !== e.showCoeffs) return !1;
        if (t.reverse !== e.reverse) return !1;
        if (o(t.formatter, e.formatter)) return !1;
        if (n(t.p1, e.p1)) return !1;
        if (n(t.p2, e.p2)) return !1;
        if (n(t.p3, e.p3)) return !1;
        if (t.items.length !== e.items.length) return !1;
        for (i = 0; i < t.items.length; i++)
            if (s(t.items[i], e.items[i])) return !1;
        return !0
    }, o.prototype.updateSource = function(t) { var e, i, n, s, r = t.properties().symbol.value(); return this._currentSymbol !== r && (this._currentSymbol = r, this._sourcesToRow = {}, this._rowsToSources = {}), this._sourcesToRow[t.id()] || (e = this._findEmptyRow(t.id()), this._sourcesToRow[t.id()] = { effectiveState: null, row: e }), i = this._sourcesToRow[t.id()].effectiveState, n = this._effectiveState(t), this._effectiveStatesEquals(i, n) || (s = this._calculateWidth(t), s ? (this._sourcesToRow[t.id()].effectiveState = n, s.totalWidth > this._actualWidth && (TradingView.resizeCanvas(this.canvas(), s.totalWidth, o.ROW_HEIGHT * this._actualCapacity), this._actualWidth = s.totalWidth), e = this._sourcesToRow[t.id()], this._repaintSource(s, n, e), this._sourcesToRow[t.id()].effectiveState = n, this._sourcesToRow[t.id()].preparedCells = s) : this._sourcesToRow[t.id()].effectiveState = null), this._sourcesToRow[t.id()] }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t) { this._data = t }

    function n(t, e) { h.call(this, t, e), this._rendererCache = {} }

    function s(t, e) { this._source = t, this._model = e, this._text = "", this._coordinate = 0, this._background = "black", this._color = "white", this._invaildated = !0 }

    function r(t, e) {
        this._constructor = "LineToolHorzLine";
        var i = e || new f("linetoolhorzline");
        this._priceAxisView = new s(this, t), l.call(this, t, new n(this, t), i)
    }
    var a = i(2),
        l = i(1).LineDataSource,
        h = i(9),
        c = i(66),
        d = i(67),
        p = i(16).TextRenderer,
        u = i(8),
        _ = i(6),
        f = i(7).DefaultProperty;
    o.prototype.draw = function(t) { var e, i; if (0 === this._data.points.length) return null;!1 !== this._data.visible && (e = this._data.points[0].y, i = t.canvas.width, t.lineCap = "square", t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, t.lineStyle = this._data.linestyle, CanvasEx.drawLine(t, 0, e, i, e)) }, o.prototype.hitTest = function(t) { return !1 === this._data.visible ? null : 0 === this._data.points.length ? null : Math.abs(t.y - this._data.points[0].y) <= 3 ? new u(this._data.hitTestResult) : null }, inherit(n, h), n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() { h.prototype.update.call(this) }, n.prototype.renderer = function() {
        var t, e, i, n, s, r, l, h, c, d, f;
        return this._invalidated && (this.updateImpl(), this._invalidated = !1), t = new _, e = {}, e.points = this._points, e.color = this._source.properties().linecolor.value(), e.linewidth = this._source.properties().linewidth.value(), e.linestyle = this._source.properties().linestyle.value(), e.hitTestResult = u.MOVEPOINT, i = this._source.properties(), t.append(new o(e)), this._source.properties().showLabel.value() && 1 === this._points.length && (n = i.vertLabelsAlign.value(), s = i.horzLabelsAlign.value(), r = this._points[0], l = 0, h = 0, "left" === s ? r.x = 3 : "right" === s ? (r.x = this._model.timeScale().width(), h = -5) : r.x = this._model.timeScale().width() / 2, "middle" === n ? l = -this._source.properties().fontsize.value() / 6 : "bottom" === n && (l = -4), c = {
            points: [r],
            text: i.text.value(),
            color: i.textcolor.value(),
            vertAlign: n,
            horzAlign: s,
            font: i.font.value(),
            offsetX: h,
            offsetY: l,
            bold: this._source.properties().bold.value(),
            italic: this._source.properties().italic.value(),
            fontsize: this._source.properties().fontsize.value()
        }, t.append(new p(c, this._rendererCache))), 1 === this._points.length && this.isAnchorsRequired() && (d = new a.Point(this._model.timeScale().width() / 2, this._points[0].y), d.data = 0, t.append(this.createLineAnchor({ points: [d] }))), TradingView.printing || !this._source.hasAlert.value() || this._model.readOnly() || 1 !== this._points.length || (f = new a.Point(this._model.timeScale().width() / 2, this._points[0].y), this._source.getAlertIsActive(function(i) { t.append(new TradingView.PaneRendererClockIcon({ point1: f, color: i ? e.color : defaults("chartproperties.alertsProperties.drawingIcon.color") })) })), t
    }, inherit(s, c), s.prototype.update = function() { this._invaildated = !0 }, s.prototype.updateImpl = function() {
        var t, e, i;
        if (0 !== this._source.points().length && this._source.priceScale() && !this._source.priceScale().isEmpty()) {
            if (t = this._source.properties().linecolor.value(), t !== this._background && (this._background = t, this._color = this.color()), e = this._source.points()[0].price, this._source.priceScale().isPercent()) {
                if (null === (i = this._source.ownerSource().firstValue())) return;
                e = this._source.priceScale().priceRange().convertToPercent(e, i)
            }
            this._floatCoordinate = this._source.priceScale().priceToCoordinate(e, !0), this._coordinate = Math.round(this._floatCoordinate), this._source.priceScale().formatter() && (this._text = this._source.priceScale().formatter().format(e))
        }
    }, s.prototype.renderer = function() { this._invaildated && (this.updateImpl(), this._invaildated = !1); var t = { text: this._text, coordinate: this._coordinate, color: this._color, background: this._background, visible: !0 }; return new d(t) }, s.prototype.coordinate = function() { return this._invalidated && (this._updateImpl(), this._invalidated = !1), c.prototype.coordinate.call(this) }, inherit(r, l), r.prototype.state = function(t) { var e = l.prototype.state.call(this, t); return e.points && 0 !== e.points.length && (e.points[0].offset = 0), e }, r.prototype.pointsCount = function() { return 1 }, r.prototype.title = function() { return "Horizontal Line" }, r.prototype.priceAxisViews = function(t, e) { return this.isActualSymbol() && e === this.priceScale() && this.properties().showPrice.value() && this._model.paneForSource(this) === t ? [this._priceAxisView] : null }, r.prototype.updateAllViews = function() { l.prototype.updateAllViews.call(this), this._priceAxisView.update() }, r.prototype.canHasAlert = function() { return !0 }, r.prototype._getAlertPlots = function() { return [this.points()[0].price] }, e.HorzLineRenderer = o, e.LineToolHorzLine = r
}, function(t, e, i) {
    "use strict";

    function o(t, e) { this._data = t, this._hittest = e }

    function n(t, e) { l.call(this, t, e), this._invalidated = !0 }

    function s(t, e) { c.call(this), this._source = t, this._model = e, this._invalidated = !0 }

    function r(t, e) {
        this._constructor = "LineToolVertLine";
        var i = e || new f("linetoolvertline");
        this._timeAxisView = new s(this, t), h.call(this, t, new n(this, t), i)
    }
    var a = i(2),
        l = i(9),
        h = i(1).LineDataSource,
        c = i(212),
        d = i(213),
        p = i(8),
        u = i(59).PaneRendererClockIcon,
        _ = i(6),
        f = i(7).DefaultProperty,
        m = i(121).DateTimeFormatter;
    o.prototype.draw = function(t) {
        var e, i;
        0 !== this._data.points.length && (this._data.linewidth <= 0 || (e = this._data.points[0].x, t.translate(1, 0), i = t.canvas.height, t.lineCap = "square", t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, t.lineStyle = this._data.linestyle, CanvasEx.drawLine(t, e, 0, e, i)))
    }, o.prototype.hitTest = function(t) { var e, i; return 0 === this._data.points.length ? null : (e = 3, i = this._hittest || new p(p.MOVEPOINT), Math.abs(t.x - this._data.points[0].x) <= e ? i : null) }, inherit(n, l), n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() { l.prototype.update.call(this), this._invalidated = !1 }, n.prototype.renderer = function() { var t, e, i; return this._invalidated && this.updateImpl(), t = {}, t.points = this._points, t.color = this._source.properties().linecolor.value(), t.linewidth = this._source.properties().linewidth.value(), t.linestyle = this._source.properties().linestyle.value(), e = new _, e.append(new o(t)), this.addAnchors(e), TradingView.printing || !this._source.hasAlert.value() || this._model.readOnly() || 1 !== t.points.length || (i = new a.Point(this._points[0].x, this._source.priceScale().height() / 2), this._source.getAlertIsActive(function(o) { e.append(new u({ point1: i, color: o ? t.color : defaults("chartproperties.alertsProperties.drawingIcon.color") })) })), e }, inherit(s, c), s.prototype.update = function() { this._invalidated = !0 }, s.prototype.updateImpl = function() {
        var t, e;
        this._model.timeScale().isEmpty() || 0 !== this._source.points().length && (this._text = "", this._background = this._source.properties().linecolor.value(), t = this._source.points()[0].index, this._coordinate = this._model.timeScale().indexToCoordinate(t), e = this._model.timeScale().indexToUserTime(t), e && (this._text = new m(this._model.mainSeries().isDWM()).format(e)), this._invalidated = !1)
    }, s.prototype.renderer = function() { this._invalidated && this.updateImpl(); var t = { text: this._text, coordinate: this._coordinate, color: this.color(), background: this._background }; return new d(t) }, inherit(r, h), r.prototype.pointsCount = function() { return 1 }, r.prototype.title = function() { return "Vertical Line" }, r.prototype.timeAxisViews = function() { return this.symbol() !== this._model.mainSeries().symbol() ? null : this.properties().showTime.value() ? [this._timeAxisView] : null }, r.prototype.updateAllViews = function() { h.prototype.updateAllViews.call(this), this._timeAxisView.update() }, r.prototype.canHasAlert = function() { return !0 }, r.prototype._getAlertPlots = function() {
        var t = this._points[0],
            e = { index: t.index, price: t.price + 1 };
        return [this._linePointsToAlertPlot([t, e], null, !0, !0)]
    }, e.VertLineRenderer = o, e.LineToolVertLine = r
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { this._cache = t, this._cacheRect = e, this._targetRect = i }
    var n = i(2),
        s = i(8);
    o.prototype.draw = function(t) {
        t.translate(.5, .5), t.drawImage(this._cache, this._cacheRect.left, this._cacheRect.top, this._cacheRect.width, this._cacheRect.height, this._targetRect.left, this._targetRect.top, this._targetRect.width, this._targetRect.height),
            t.translate(-.5, -.5)
    }, o.prototype.hitTest = function(t) {
        var e = new n.Point(this._targetRect.left, this._targetRect.top),
            i = e.add(new n.Point(this._targetRect.width, this._targetRect.height));
        return n.pointInRect(t, e, i) ? new s(s.REGULAR) : null
    }, t.exports = o
}, 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(2),
        s = i(1).LineDataSource,
        r = i(11).TrendLineRenderer,
        a = i(8),
        l = i(14);
    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), 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";
    Object.defineProperty(e, "__esModule", { value: !0 });
    var o = i(748);
    e.createConfirmDialog = o.createConfirmDialog
}, , , , , , , , function(t, e, i) {
    "use strict";
    var o = i(289),
        n = { instances: [], createMenu: function(t, e, i) { var n = new o(t, e, i); return this.instances.push(n), n }, hideAll: function() { for (var t in this.instances) this.instances[t].hide() } };
    t.exports = n
}, function(t, e, i) {
    (function(t, o, n) {
        "use strict";

        function s(e, i) {
            var s, r = e._undoModel._chartWidget,
                a = r.onWidget(),
                l = !1;
            l = a ? r._options && !r._options.hideIdeas : !!t.enabled("bars_marks") && TVSettings.getBool("BarsMarksContainer.visibile", !1), i ? i.merge({ visible: l, frozen: !1 }) : i = new o({ visible: l, frozen: !1 }), s = this, i.visible.listeners().subscribe(null, function(e) { a || r._containsData || !t.enabled("bars_marks") || TVSettings.setValue("BarsMarksContainer.visibile", !!e.value()), s._tooltip && s._tooltip.removeAll() }), p.call(this, e, null, i), this.onNeedRepaint = new n, this._requests = [], this._marks = {}, this._loadedRange = null, this._getDataTimeout = null, this._collectedRange = null, this._model.mainSeries().onSymbolIntervalChanged().subscribe(this, this.clearMarks),
                this._model.mainSeries().onSymbolResolved().subscribe(this, this.clearMarks), this._model.mainSeries().onTickmarksRangeChanged().subscribe(this, this.getData), this._initialize(), this.pinnedTooltips = {}, this._tooltip = new h(this._createTooltip.bind(this), this)
        }

        function r(t, e, i) { this.source = t, this.pane = e, this._rendererFactory = i }

        function a(t, e) { this._barWidth = t.barWidth, this._plates = t.plates, this._tooltip = t.tooltip, this._model = e }

        function l() { this._layout = [], this._currentId = void 0, this.tooltipHovered = !1 }

        function h(t, e) { this.tooltips = {}, this.tooltipFactory = t, this.source = e }

        function c(t, e) { this.renderer = t, this._tooltip = e, this.visible = !1 }
        var d = i(2),
            p = i(1).LineDataSource,
            u = i(8),
            _ = i(35).isNumber,
            f = i(12).getLogger("Chart.BarsMarksContainer");
        inherit(s, p), s.prototype._constructor = "Child class must override this member", s.prototype._initialize = function(t) { throw Error("Child class must override this member") }, s.prototype.onClicked = function() { throw Error("Child class must override this member") }, s.prototype._getData = function(t) { throw Error("Child class must override this member") }, s.prototype._createTooltip = function() { throw Error("Child class must override this member") }, s.prototype.updateDotData = function(t, e) { return e }, s.prototype.updatePlateData = function(t, e) {}, s.prototype._plateViewData = function(t) { return {} }, s.prototype.pinTooltip = function(t, e) { this.pinnedTooltips[t] = e }, s.prototype.timeScale = function() { return this._model.timeScale() }, s.prototype.getIntervalInTicks = function() {
            function t(t) { if ((t = parseInt(t)) != t) throw new TypeError("Unexpected interval"); return 60 * t }
            var e = t(1440),
                i = 7 * e,
                o = 31 * e,
                n = this._model.mainSeries().properties().interval.value();
            switch (n) {
                case "M":
                    return o;
                case "W":
                    return i;
                case "D":
                    return e;
                default:
                    return t(n)
            }
        }, s.prototype._maxDate = new Date(2037, 0, 1), s.prototype.getVisibleTickmarksRange = function() { var t, e; return this.timeScale().isEmpty() ? { start: 0, end: 0 } : (t = this.timeScale().visibleBars(), t.lastBar() > this.timeScale().points().firstTimePointIndex() && t.firstBar() < this.timeScale().points().lastTimePointIndex() ? (e = t.lastBar() < this.timeScale().points().lastTimePointIndex() ? this.timeScale().indexToTimePoint(t.lastBar()) : this._maxDate, t = { start: this.timeScale().indexToTimePoint(Math.max(t.firstBar(), this.timeScale().points().firstTimePointIndex())), end: e }, { start: t.start ? t.start.getTime() / 1e3 : void 0, end: t.end ? t.end.getTime() / 1e3 : void 0 }) : { start: 0, end: 0 }) }, s.prototype.getVisibleRangePlates = function() {
            var t = [],
                e = this.getVisibleTickmarksRange(),
                i = this.getIntervalInTicks();
            return $.each(this._marks, function(o, n) {
                var s = n.tickmark;
                s >= e.start && s <= e.end + i && t.push(n)
            }), t
        }, s.prototype.getPublishedPlates = function() {
            var t = {},
                e = this;
            return is_authenticated ? ($.each(this.getVisibleRangePlates(), function(i, o) { o.is_public && (e.pinnedTooltips[o.id] || o.user__id === user.id) && (t[o.id] = o) }), t) : t
        }, s.prototype._maxPlatesPerBar = 10, s.prototype.filterDisplayedPlates = function(t) {
            return t = t.reduce(function(t, e) { var i = this._getIndex(e.tickmark); return t[i] = t[i] || [], t[i].push(e), t }.bind(this), {}), t = Object.keys(t).reduce(function(e, i) {
                var o = t[i];
                return o = o.sort(function(t, e) { return e.views_count - t.views_count }), o = o.slice(0, this._maxPlatesPerBar), e.concat(o)
            }.bind(this), [])
        }, s.prototype._layout = function(t) {
            switch (t) {
                default:
                    case 0:
                    return "up";
                case 1:
                        return "down";
                case 2:
                        return "up";
                case 3:
                        case 4:
                        case 5:
                        case 6:
                        return "up"
            }
        }, s.prototype._theme = function(t) {
            switch (t) {
                default:
                    case 0:
                    return "neutral";
                case 1:
                        return "green";
                case 2:
                        return "red";
                case 3:
                        return "yellow";
                case 4:
                        return "blue";
                case 5:
                        return "green";
                case 6:
                        return "red"
            }
        }, s.prototype._offset = function(t, e) {
            var i;
            switch (t) {
                default:
                    case "up":
                    i = e[TradingView.HIGH_PLOT];
                break;
                case "down":
                        i = e[TradingView.LOW_PLOT]
            }
            return this.priceScale().isPercent() && (i = this.priceScale().priceRange().convertToPercent(i, this.ownerSource().firstValue())), this.priceScale().priceToCoordinate(i)
        }, s.prototype._getIndex = function(t) { return this.timeScale().timePointToIndex(t) }, s.prototype.getViewData = function() { return { barWidth: this.barWidth(), plates: this.getPlatesViewData(), tooltip: this._tooltip } }, s.prototype.barWidth = function() { return this.timeScale().barSpacing() }, s.prototype.getPlatesViewData = function() {
            var t, e, i, o, n, s;
            if (this._model.mainSeries().data().isEmpty()) return [];
            t = this.filterDisplayedPlates(this.getVisibleRangePlates()), e = this, i = {}, o = this._model.lastHittestData(), t = t.map(function(t) {
                var n, s, r, a, l, h, c = this._getIndex(t.tickmark),
                    d = this._getBar(c);
                return !!d && (n = this._layout(t.direction), s = this._theme(t.direction), r = o && o.id === t.id, a = this.timeScale().indexToCoordinate(c), l = this._offset(n, d), h = 0, c in i || (i[c] = { up: 0, down: 0 }), h = i[c][n]++, TradingView.merge({ id: t.id, x: a, y: l, order: h, direction: n, theme: s, hovered: r, pinned: !0 === e.pinnedTooltips[t.id], user__id: t.user__id, label: t.label, labelFontColor: t.labelFontColor || "#444", minSize: t.minSize || 0 }, this._plateViewData(t)))
            }.bind(this)), t = t.filter(function(t) { return !!t }), n = t.filter(function(t) { return !0 === t.hovered });
            for (s = 0; s < t.length; s++) null != n[0] && t[s].user__id === n[0].user__id && (t[s].highlightByAuthor = !0);
            return t.sort(function(t, e) { return t.hovered && !e.hovered ? 1 : 0 }), t
        }, s.prototype._getBar = function(t) { return this._model.mainSeries().data().valueAt(t) }, s.prototype.paneViews = function(t) { var e = this; return this._properties.visible.value() ? [new r(this, t, function(t) { return new a(t.getViewData(), e) })] : [] }, s.prototype.dataWindowView = function() { return null }, s.prototype.priceAxisViews = function() { return null }, s.prototype.statusView = function() { return null }, s.prototype.updateAllViews = function() {}, s.prototype.pointsCount = function() { return 0 }, s.prototype.properties = function() { return this._properties }, s.prototype._rangeDifference = function(t) { return t = $.extend({}, t), this._loadedRange && (t.start < this._loadedRange.start ? t.end = this._loadedRange.start : t.end > this._loadedRange.end && (t.start = this._loadedRange.end)), t }, s.prototype._rangeUnion = function(t, e) { return t = $.extend({}, t), e && (t.start = Math.min(e.start, t.start), t.end = Math.max(e.end, t.end)), t }, s.prototype._pushGetDataStack = function(t) {
            if (!_(t.start) || !_(t.end)) return void f.logError("Wrong tickmark range");
            this._getDataTimeout && clearTimeout(this._getDataTimeout),
                this._collectedRange = this._rangeUnion(t, this._collectedRange), this._getDataTimeout = setTimeout(function() { this._getData(this._collectedRange), this._getDataTimeout = this._collectedRange = null }.bind(this), 300)
        }, s.prototype.roundRange = function(t) { return { start: Math.round(t.start), end: Math.round(t.end) } }, s.prototype.refreshData = function() { this.getData(this._lastRange) }, s.prototype.getData = function(t) {
            if (!_(t.start) || !_(t.end)) return void f.logError("Wrong range");
            this._lastRange = t;
            var t = $.extend({}, t);
            t.end = this._maxDate / 1e3, this._pushGetDataStack(t)
        }, s.prototype._abortAllRequests = function() { this._requests.forEach(function(t) { t.abort() }), this._requests = [], this._getDataTimeout && clearTimeout(this._getDataTimeout), this._getDataTimeout = this._collectedRange = null }, s.prototype.clearMarks = function() { this._abortAllRequests(), this._marks = {}, this._loadedRange = null }, r.prototype.update = function() {}, r.prototype.renderer = function() { return this._rendererFactory(this.source) }, a.prototype.draw = function(t) {
            t.save();
            for (var e = 0; e < this._plates.length; e++)
                if (this._plates[e].highlightByAuthor) { this._highlightByAuthor = !0; break }
            this._plates.forEach(this._drawItem.bind(this, t)), this._tooltip.draw(this._plates.map(function(t) { return this._plateTransform(t) }.bind(this)), t), this._tooltip.endDraw(), t.restore()
        }, a.prototype._drawItem = function(t, e) {
            t.save(), this._highlightByAuthor && !e.highlightByAuthor && (t.globalAlpha = .4);
            var i = this._dotTransform(e);
            i.mine ? this._drawTriangle(t, i) : this._drawDot(t, i), t.restore()
        }, a.prototype._commonTransform = function(t) {
            var e = Math.max(1.4 * t.minSize, this._barWidth + 4),
                i = t.y + { up: -1, down: 1 }[t.direction] * (e * (t.order + .6) + .25 * e),
                o = TradingView.clone(t.overridedTheme || this.themes[t.theme]);
            return o.dotBorderWidth = t.hovered || t.highlightByAuthor ? 4 : 2, { id: t.id, theme: o, themeName: t.theme, x: Math.round(t.x + 1), y: Math.round(i), pinned: t.pinned, hovered: t.hovered }
        }, a.prototype._dotTransform = function(t) { var e = this._commonTransform(t); return e.radius = Math.max(t.minSize / 2, .4 * this._barWidth), e.label = t.label, e.labelFontColor = t.labelFontColor, e.labelFontSize = Math.ceil(Math.max(10, Math.min(e.radius, 20))), this._model.updateDotData(t, e) }, a.prototype._plateTransform = function(t) { var e = this._commonTransform(t); return this._model.updatePlateData(t, e) }, a.THEMES = ["green", "red", "neutral", "yellow", "blue"], a.prototype.themes = { green: { border: "#78C143", background: "#8DDD54" }, red: { border: "#CC4545", background: "#ED5A5A" }, neutral: { border: "#EAC300", background: "#FFD400" }, yellow: { border: "#EAC300", background: "#FFD400" }, blue: { border: "#047ACE", background: "#0496FF" } }, a.prototype._drawTriangle = function(t, e) {
            var i, o, n, s;
            t.strokeStyle = e.theme.border, t.fillStyle = e.theme.background, t.lineWidth = e.theme.dotBorderWidth, i = e, o = e.radius, n = Math.cos(Math.PI / 6) * o, s = Math.sin(Math.PI / 6) * o, t.translate(i.x, i.y), "up" === e.direction && t.rotate(Math.PI), e.public || (t.lineWidth /= 2), t.beginPath(), t.moveTo(0, -o), t.lineTo(n, s), t.lineTo(-n, s), t.lineTo(0, -o), t.closePath(), t.stroke(), e.public && t.fill()
        }, a.prototype._drawDot = function(t, e) {
            t.strokeStyle = e.theme.border, t.fillStyle = e.theme.background,
                t.lineWidth = e.theme.dotBorderWidth, t.beginPath(), t.arc(e.x, e.y, e.radius, 0, 2 * Math.PI, !0), t.closePath(), t.stroke(), t.fill(), e.label && e.radius > 6 && (t.textAlign = "center", t.textBaseline = "middle", t.font = "bold " + e.labelFontSize + "px Arial", t.fillStyle = e.labelFontColor, t.fillText(e.label, e.x, e.y))
        }, a.prototype.hitTest = function(t) {
            var e, i;
            for (i = this._plates.length - 1; i >= 0; --i)
                if (e = this._hitTestDot(this._plates[i], t)) return e;
            return null
        }, a.prototype._hitTestDot = function(t, e) {
            var i = this._dotTransform(t),
                o = new d.Point(i.x, i.y);
            return d.isInCircle(o, Math.max(i.radius, 8), e) ? new u(u.REGULAR, t) : null
        }, l.prototype._createLayout = function() { throw Error("Child class must override this member") }, l.prototype._updatePlate = function(t) { throw Error("Child class must override this member") }, l.prototype._getContainer = function(t) { return this._container && this._context === t || (this._context = t, this._container = $(t.canvas).parent()), this._container }, l.prototype._plateArrowSize = 14, l.prototype.showPlate = function(t, e) {
            var i, o, n, s, r, a, l, h;
            this._currentId === t.id && this._layout && 0 !== this._layout.length && null != this._layout[0].parentNode || (this._currentId = t.id, this._createLayout(), this._getContainer(e).append(this._layout), i = this, this._layout.hover(function() { i.tooltipHovered = !0, $(this).stop(!0).fadeTo(0, 1) }, function() { i.tooltipHovered = !1 })), o = Math.round(t.barWidth / 2), o > 15 && (o = 15), o < 10 && (o = 10), this._updatePlate(t), n = e.canvas.getBoundingClientRect(), s = t.x - this._layout.outerWidth() < this._plateArrowSize, r = n.width - t.x + Math.round(t.barWidth / 2 + o), s && (r -= this._layout.outerWidth() + 2 * this._plateArrowSize), a = n.height, l = 20, h = 10, this._layout.toggleClass("right", s), this._layout.css({ top: Math.min(Math.max(t.y, l), a - this._layout.outerHeight() - h), right: r, fontSize: o + "px", display: "block" })
        }, l.prototype._removeLayout = function() { this.tooltipHovered || (this._layout.stop(!0), this._layout.remove()) }, l.prototype._toggleLayout = function(t) { this._layout.toggle(t) }, l.prototype.hide = function(t) { this.tooltipHovered ? this._layout.stop(!0).fadeTo(0, 1) : this._layout.fadeOut(400, function() { $(this).remove(), t() }) }, l.prototype.setSource = function(t) { this.source = t }, h.prototype.findOrCreateTooltip = function(t) { var e = this.tooltips[t.id]; return null == e && (t.hovered || t.pinned) && (e = this._createTooltip(), this.tooltips[t.id] = e), e }, h.prototype.showPlate = function(t, e) {
            var i = this.findOrCreateTooltip(t);
            null != i && (i._drawPlate(t, e), i.plateData = t)
        }, h.prototype.draw = function(t, e) {
            this.hoveredId = null;
            for (var i = 0; i < t.length; i++) t[i].hovered && (this.hoveredId = t[i].id);
            t.forEach(function(t) { this.showPlate(t, e) }.bind(this))
        }, h.prototype.endDraw = function() { var t, e, i = this; for (t in this.tooltips) this.tooltips.hasOwnProperty(t) && (e = this.tooltips[t], e.toggleVisibility(), i.hoveredId && e.plateData.id !== i.hoveredId && !e.plateData.pinned && (e.remove(), delete this.tooltips[t])) }, h.prototype.removeAll = function() {
            var t, e;
            for (t in this.tooltips) this.tooltips.hasOwnProperty(t) && (e = this.tooltips[t], e.remove());
            this.tooltips = {}
        }, h.prototype.removeTooltip = function(t) { delete this.tooltips[t] }, h.prototype._createTooltip = function() {
            return new c(this, this.tooltipFactory())
        }, c.prototype._drawPlate = function(t, e) {
            var i = this;
            this.visible = !0, this._tooltip.setSource(this.renderer.source), this._tooltip.showPlate(t, e), t.hovered || t.pinned || this._tooltip.hide(function() { i.renderer.removeTooltip(t.id) })
        }, c.prototype.remove = function() { this._tooltip._removeLayout() }, c.prototype.toggleVisibility = function() { this._tooltip._toggleLayout(this.visible), this.visible = !1 }, e.BarsMarksContainer = s, e.BarsMarksContainerRenderer = a, e.BarMarkTooltip = l
    }).call(e, i(3), i(24), i(15))
}, 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(2),
        h = i(1).LineDataSource,
        c = i(16).TextPaneView,
        d = i(342),
        p = i(7).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), 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, 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(78),
        s = n.StudyLineDataSource,
        r = n.StudyLineDataSourcePaneView,
        a = i(31),
        l = a.prepareStudyProperties,
        h = i(1).LineDataSource,
        c = i(155),
        d = i(220).VolumeFormatter,
        p = i(25);
    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) })
        }
    }, 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) {
        var i = t.offset();
        e.localX = e.pageX - i.left, e.localY = e.pageY - i.top
    }

    function n(t, e, i, o) { new h(t, e, i, o) }
    var s, r, a, l, h;
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17), i(105), s = i(251), r = i(35), a = 2, l = !1, h = function() {
        function t(t, e, i, o) { this._clickCount = 0, this._clickTimeoutId = null, this._touchContextMenuTimeout = null, this._lastTouchPosition = { x: 0, y: 0 }, this._touchMoveStartPosition = null, this._cancelClick = !1, this._$target = t, this._handler = e, this._originalPreventDefault = i, this._preventDefault = !o && i, this._verticalTouchScroll = o, this._init() }
        return t.prototype._mouseEnterHandler = function(t) { this._$target.off("mousemove.chartgui"), this._$target.on("mousemove.chartgui", this._mouseMoveHandler.bind(this)), Modernizr.touch && this._mouseMoveHandler(t), this._processEvent(t, this._handler.mouseEnterEvent), this._preventDefaultIfNeeded(t) }, t.prototype._resetClickTimeout = function() { null !== this._clickTimeoutId && clearTimeout(this._clickTimeoutId), this._clickCount = 0, this._clickTimeoutId = null }, t.prototype._mouseMoveHandler = function(t) { l && !Modernizr.touch || (this._processEvent(t, this._handler.mouseMoveEvent), this._preventDefaultIfNeeded(t)) }, t.prototype._mouseMoveWithDownHandler = function(t) {
            var e, i, o, n, s, l;
            void 0 === t.button && (t.button = 0), e = !1, (Modernizr.touch || t.originalEvent.touches) && (this._fixMouseTouchEvent(t, t.originalEvent), t.clientX = t.pageX, t.clientY = t.pageY, this._verticalTouchScroll && (i = Math.abs(.5 * (t.pageX - this._lastTouchPosition.x)), o = Math.abs(t.pageY - this._lastTouchPosition.y), i <= o ? (e = !0, this._preventDefault = !1) : this._preventDefault = this._originalPreventDefault), this._lastTouchPosition.x = t.pageX, this._lastTouchPosition.y = t.pageY, n = r.ensure(this._touchMoveStartPosition), s = Math.abs(n.x - t.pageX), l = Math.abs(n.y - t.pageY), s + l > 5 && this._clearContextMenuTimeout()), t.button === a || e || this._processEvent(t, this._handler.pressedMouseMoveEvent), this._preventDefaultIfNeeded(t)
        }, t.prototype._mouseUpHandler = function(t) { void 0 === t.button && (t.button = 0), (Modernizr.touch || t.originalEvent.touches) && (t.pageX = this._lastTouchPosition.x, t.pageY = this._lastTouchPosition.y, t.localX = this._lastTouchPosition.x, t.localY = this._lastTouchPosition.y, this._clearContextMenuTimeout(), this._touchMoveStartPosition = null), l = !1, $(document.body).off("mousemove.chartgui"), $(document.body).off("mouseup.chartgui"), Modernizr.touch || t.originalEvent.touches ? ($(document.body).off("touchmove.chartgui"), $(document.body).off("touchend.chartgui"), this._mouseLeaveHandler(t)) : ($(document.body).off("mousemove.chartgui touchmove.chartgui"), $(document.body).off("mouseup.chartgui touchend.chartgui")), t.button !== a && (this._processEvent(t, this._handler.mouseUpEvent), ++this._clickCount, this._clickTimeoutId && this._clickCount > 1 ? (this._processEvent(t, this._handler.mouseDoubleClickEvent), this._resetClickTimeout()) : this._cancelClick || this._processEvent(t, this._handler.mouseClickEvent)), this._preventDefaultIfNeeded(t), Modernizr.touch && this._mouseLeaveHandler(t) }, t.prototype._clearContextMenuTimeout = function() {
            null !== this._touchContextMenuTimeout && (clearTimeout(this._touchContextMenuTimeout), this._touchContextMenuTimeout = null)
        }, t.prototype._mouseDownHandler = function(t) { if (void 0 === t.button && (t.button = 0), this._cancelClick = !1, (Modernizr.touch || t.originalEvent.touches) && (this._fixMouseTouchEvent(t, t.originalEvent), this._lastTouchPosition.x = t.pageX, this._lastTouchPosition.y = t.pageY, this._touchMoveStartPosition = { x: t.pageX, y: t.pageY }, this._mouseEnterHandler(t)), Modernizr.touch ? ($(document.body).off("touchmove.chartgui"), $(document.body).off("touchend.chartgui"), $(document.body).on("touchmove.chartgui", this._mouseMoveWithDownHandler.bind(this)), $(document.body).on("touchend.chartgui", this._mouseUpHandler.bind(this)), this._clearContextMenuTimeout(), this._touchContextMenuTimeout = setTimeout(this._contextMenuHandler.bind(this, t), 500)) : ($(document.body).off("mousemove.chartgui touchmove.chartgui"), $(document.body).off("mouseup.chartgui touchend.chartgui"), $(document.body).on("mousemove.chartgui touchmove.chartgui", this._mouseMoveWithDownHandler.bind(this)), $(document.body).on("mouseup.chartgui touchend.chartgui", this._mouseUpHandler.bind(this))), l = !0, t.button !== a && (this._processEvent(t, this._handler.mouseDownEvent), this._clickTimeoutId || (this._clickCount = 0, this._clickTimeoutId = setTimeout(this._resetClickTimeout.bind(this), 500))), this._preventDefaultIfNeeded(t), this._preventDefault) try { window.focus() } catch (t) {} }, t.prototype._init = function() {
            var t = this;
            this._$target.mouseenter(this._mouseEnterHandler.bind(this)), this._$target.on("touchcancel", this._clearContextMenuTimeout.bind(this)), this._$target.on("touchstartoutside mousedownoutside", function(e) { t._handler.mouseDownOutsideEvent && t._handler.mouseDownOutsideEvent(e, t._$target) }), this._$target.mouseleave(this._mouseLeaveHandler.bind(this)), this._$target.contextMenu && this._$target.contextMenu(this._contextMenuHandler.bind(this)), Modernizr.touch ? (this._$target.on("touchstart.chartgui", this._mouseDownHandler.bind(this)), this._initGestureEvents()) : this._$target.on("mousedown.chartgui touchstart.chartgui", this._mouseDownHandler.bind(this))
        }, t.prototype._mouseLeaveHandler = function(t) { this._$target.off("mousemove.chartgui touchmove.chartgui"), this._processEvent(t, this._handler.mouseLeaveEvent), this._preventDefaultIfNeeded(t) }, t.prototype._contextMenuHandler = function(t) { this._processEvent(t, this._handler.contextMenuEvent), this._preventDefaultIfNeeded(t), this._cancelClick = !0 }, t.prototype._processEvent = function(t, e) { e && (o(this._$target, t), e.call(this._handler, t, this._$target)) }, t.prototype._preventDefaultIfNeeded = function(t) { this._preventDefault && t.preventDefault() }, t.prototype._initGestureEvents = function() {
            var t = this,
                e = new s(this._$target.get(0));
            e.get("pinch").set({ enable: !0 }), e.on("pinchstart", function(e) { t._handler.gestureStartEvent && t._handler.gestureStartEvent(e, t._$target), t._clearContextMenuTimeout() }), e.on("pinchmove", function(e) { t._handler.gestureChangeEvent && t._handler.gestureChangeEvent(e, t._$target) }), e.on("pinchend pinchcancel", function(e) {
                t._handler.gestureEndEvent && t._handler.gestureEndEvent(e, t._$target)
            })
        }, t.prototype._fixMouseTouchEvent = function(t, e) {
            var i = e.touches[0].pageX,
                o = e.touches[0].pageY;
            t.pageX = i, t.pageY = o, t.localX = i, t.localY = o
        }, t
    }(), e.setMouseEventHandler = n
}, function(t, e, i) {
    "use strict";
    var o = i(35),
        n = i(12),
        s = n.getLogger("Chart.PriceRange"),
        r = function() {
            function t(t, e) {
                var i, o;
                null !== t && "object" == typeof t ? (i = t, this._minValue = i.m_minValue, this._maxValue = i.m_maxValue) : (o = t, this._minValue = o, void 0 !== e && (this._maxValue = e))
            }
            return t.prototype.equals = function(t) { return this._minValue === t._minValue && this._maxValue === t._maxValue }, t.prototype.clone = function() { return new t(this._minValue, this._maxValue) }, t.prototype.minValue = function() { return this._minValue }, t.prototype.setMinValue = function(t) { this._minValue = t }, t.prototype.maxValue = function() { return this._maxValue }, t.prototype.setMaxValue = function(t) { this._maxValue = t }, t.prototype.length = function() { return this._maxValue - this._minValue }, t.prototype.isEmpty = function() { return this._maxValue === this._minValue || this._maxValue !== this._maxValue || this._minValue !== this._minValue }, t.prototype.serialize = function() { return { m_maxValue: this._maxValue, m_minValue: this._minValue } }, t.prototype.state = function() { return { max: this._maxValue, min: this._minValue } }, t.prototype.merge = function(e) { return new t(Math.min(this.minValue(), e.minValue()), Math.max(this.maxValue(), e.maxValue())) }, t.prototype.apply = function(t, e) { this._minValue = Math.min(this._minValue, t), this._maxValue = Math.max(this._maxValue, e) }, t.prototype.set = function(t, e) { this._minValue = t, this._maxValue = e }, t.prototype.scaleAroundCenter = function(t) {
                var e, i, n, r;
                if (!o.isNumber(t)) return void s.logDebug("PriceRange.scaleAroundCenter: invalid coeff");
                0 !== (e = this._maxValue - this._minValue) && (i = .5 * (this._maxValue + this._minValue), n = this._maxValue - i, r = this._minValue - i, n *= t, r *= t, this._maxValue = i + n, this._minValue = i + r)
            }, t.prototype.shift = function(t) {
                if (!o.isNumber(t)) return void s.logDebug("PriceRange.shift: invalid coeff");
                this._maxValue += t, this._minValue += t
            }, t.prototype.convertToPercent = function(t, e) { return 100 * (t - e) / e }, t.prototype.convertFromPercent = function(t, e) { return t / 100 * e + e }, t.prototype.convertToPercents = function(e) { return new t(100 * (this._minValue - e) / e, 100 * (this._maxValue - e) / e) }, t.prototype.convertFromPercents = function(e) { return new t(this._minValue / 100 * e + e, this._maxValue / 100 * e + e) }, t
        }();
    t.exports = r
}, , , , , , function(t, e) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 }), e.LEFT_ARROW = 37, e.UP_ARROW = 38, e.RIGHT_ARROW = 39, e.DOWN_ARROW = 40, e.ENTER = 13, e.ESC = 27, e.SPACE = 32
}, , , function(t, e, i) {
    "use strict";
    t.exports = i(279)
}, function(t, e, i) {
    var o = i(35).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, i) {
    "use strict";

    function o(t, e) { this._data = t, this._cache = e }

    function n(t, e) { a.call(this, t, e), this._cache = {}, this._invalidated = !0 }

    function s(t, e) {
        this._constructor = "LineToolIcon";
        var i = e || new p("linetoolicon");
        i.addExclusion("angle"), i.addExclusion("scale"), l.call(this, t, new n(this, t), i), this.version = s.version
    }
    var r = i(2),
        a = i(9),
        l = i(1).LineDataSource,
        h = i(11).TrendLineRenderer,
        c = i(8),
        d = i(6),
        p = i(7).DefaultProperty;
    o.prototype.draw = function(t) {
        var e, i, o, n = String.fromCharCode(this._data.icon);
        t.font = this._data.size + "px FontAwesome", e = t.measureText(n).width, t.textBaseline = "middle", i = this._data.point, t.translate(i.x, i.y), t.rotate(this._data.angle - Math.PI / 2), t.scale(this._data.scale, 1), o = 65536 * this._data.icon + this._data.size, this._cache[o] = e, this._data.selected && (t.fillStyle = "rgba(80, 80, 80, 0.2)", t.fillRect(-this._cache[o] / 2, -this._data.size / 2, this._cache[o], this._data.size)), t.fillStyle = this._data.color, t.fillText(n, -this._cache[o] / 2, 0)
    }, o.prototype.hitTest = function(t) {
        var e = 65536 * this._data.icon + this._data.size,
            i = this._cache[e] * this._data.scale,
            o = r.Matrix.rotate(-this._data.angle),
            n = t.substract(this._data.point);
        return n = o.mult(n), Math.abs(n.y) <= i / 2 && Math.abs(n.x) <= this._data.size / 2 ? new c(c.MOVEPOINT) : null
    }, inherit(n, a), n.anchorLimit = 80, n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() { a.prototype.update.call(this), this._invalidated = !1 }, n.prototype.renderer = function() { var t, e, i, s, a, c, p, u, _, f, m, g, v, y, b, w, S, T; return this._invalidated && this.updateImpl(), t = new d, this._points.length < 1 ? t : (e = this._source.properties(), i = { point: this._points[0], color: e.color.value(), size: e.size.value(), icon: e.icon.value(), angle: e.angle.value(), scale: e.scale.value(), selected: this.isAnchorsRequired() }, s = this._model, a = this._source, t.append(new o(i, this._cache)), this.isAnchorsRequired() && (c = 65536 * i.icon + i.size, p = this._cache[c], u = i.size, _ = this._points[0], f = e.scale.value(), m = new r.Point(Math.max(n.anchorLimit, u) / 2, 0), g = new r.Point(0, Math.max(n.anchorLimit, f * p) / 2), v = r.Matrix.rotate(e.angle.value()), m = v.mult(m), g = v.mult(g), y = _.add(m), y.data = 0, b = _.substract(m), b.data = 1, w = _.add(g), w.data = 2, w.square = !0, S = _.substract(g), S.data = 3, S.square = !0, i = { points: [y, b], width: s.timeScale().width(), height: a.priceScale().height(), color: "#808080", linewidth: 1, linestyle: CanvasEx.LINESTYLE_DASHED, extendleft: !1, extendright: !1, leftend: l.LINEEND_NORMAL, rightend: l.LINEEND_NORMAL }, T = new h(i), T._hittest = null, t.append(T), t.append(this.createLineAnchor({ points: [y, b, w, S] }))), t) }, s._getAvailIcons = function() {
        var t, e, i = [];
        for (i = i.concat([61536, 61537, 61538, 61539]), i = i.concat([61725, 61726]), i = i.concat([61575, 61576, 61796, 61797]), i = i.concat([61779, 61780, 61781, 61782, 61783, 61784, 61785, 61786]), t = i.slice(0),
            e = 61440; e <= 61846; e++) - 1 === $.inArray(e, i) && (e % 16 == 15 && 61487 !== e || e >= 61620 && e <= 61630 || 61718 !== e && 61719 !== e && 61472 !== e && 61619 !== e && t.push(e));
        return t
    }, s.availIcons = s._getAvailIcons(), inherit(s, l), s.version = 1, s.prototype.pointsCount = function() { return 1 }, s.prototype.title = function() { return "Icon" }, s.prototype.startChanging = function(t, e) {
        var i, o;
        l.prototype.startChanging.call(this, t, e), i = this.properties(), o = 65536 * i.icon.value() + i.size.value(), this._startChangeWidth = this._paneViews[0]._cache[o], i.size.value() < n.anchorLimit ? this._sizeScale = i.size.value() / n.anchorLimit : this._sizeScale = 1, this._origScale = i.scale.value(), this._startChangeWidth * this._origScale < n.anchorLimit ? this._resizeRatio = this._startChangeWidth / n.anchorLimit : this._resizeRatio = 1
    }, s.prototype.endChanging = function() { l.prototype.endChanging.call(this), delete this._startChangeWidth, delete this._sizeScale, delete this._resizeRatio }, s.prototype.setPoint = function(t, e, i) {
        var o, s, r, a, l, h, c, d, p, u, _ = $.extend({}, e),
            f = this.priceScale();
        f.isPercent() && (o = this.ownerSource().firstValue(), _.price = f.priceRange().convertFromPercent(_.price, o)), i && i.shift && this._properties.snapTo45Degrees && this._snapPoint45Degree(_, this.points()[0]), s = this.pointToScreenPoint(this.points()[0])[1], r = this.pointToScreenPoint(_)[1], 0 === t || 1 === t ? (a = r.substract(s).normalized(), l = 2 * r.substract(s).length(), l *= this._sizeScale, this._properties.size.setValue(l), h = -a.x, c = Math.acos(h), Math.asin(a.y) > 0 && (c = 2 * Math.PI - c), 0 === t && (c += Math.PI), this._properties.angle.setValue(c)) : (d = this._startChangeWidth, p = r.substract(s).length(), this._origScale * d < n.anchorLimit ? (u = n.anchorLimit / 2, this._properties.scale.setValue(this._origScale * p / u)) : (u = d / 2, this._properties.scale.setValue(p / u)))
    }, t.exports = s
}, function(t, e, i) {
    "use strict";

    function o(t) { this._data = t }

    function n(t, e) { l.call(this, t, e), this._invalidated = !0 }

    function s(t, e) {
        this._constructor = "LineToolTriangle";
        var i = e || new d("linetooltriangle");
        a.call(this, t, new n(this, t), i)
    }
    var r = i(2),
        a = i(1).LineDataSource,
        l = i(9),
        h = i(8),
        c = i(6),
        d = i(7).DefaultProperty,
        p = i(14);
    o.prototype.draw = function(t) {
            var e, i, o;
            this._data.points.length < 2 || (t.lineCap = "butt", t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, t.lineStyle = this._data.linestyle, e = this._data.points[0], i = this._data.points[1], o = 2 === this._data.points.length ? i : this._data.points[2], t.beginPath(), t.moveTo(e.x, e.y), t.lineTo(i.x, i.y), t.lineTo(o.x, o.y), t.lineTo(e.x, e.y), this._data.fillBackground && (t.fillStyle = p.generateColor(this._data.backcolor, this._data.transparency), t.fill()), t.stroke())
        }, o.prototype.hitTest = function(t) { var e, i, o, n, s; return this._data.points.length < 2 ? null : (e = 3, i = this._data.points[0], o = this._data.points[1], n = r.distanceToSegment(i, o, t), n.distance <= e ? new h(h.MOVEPOINT) : this._data.points.length < 3 ? null : (s = this._data.points[2], n = r.distanceToSegment(o, s, t), n.distance <= e ? new h(h.MOVEPOINT) : (n = r.distanceToSegment(s, i, t), n.distance <= e ? new h(h.MOVEPOINT) : this._data.fillBackground && r.pointInTriangle(i, o, s, t) ? new h(h.MOVEPOINT_BACKGROUND) : null))) }, inherit(n, l), n.prototype.update = function() { this._invalidated = !0 },
        n.prototype.updateImpl = function() { l.prototype.update.call(this), this._invalidated = !1 }, n.prototype.renderer = function() { var t, e; return this._invalidated && this.updateImpl(), t = {}, t.points = this._points, t.color = this._source.properties().color.value(), t.linewidth = this._source.properties().linewidth.value(), t.backcolor = this._source.properties().backgroundColor.value(), t.fillBackground = this._source.properties().fillBackground.value(), t.transparency = this._source.properties().transparency.value(), this.isAnchorsRequired() ? (e = new c, e.append(new o(t)), this.addAnchors(e), e) : new o(t) }, inherit(s, a), s.prototype.pointsCount = function() { return 3 }, s.prototype.title = function() { return "Triangle" }, e.TriangleRenderer = o, e.LineToolTriangle = s
}, 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 }
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17);
    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";
    var o, n, s;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(122), n = i(162), s = function() {
        function t(t) { void 0 === t && (t = !1), this._dwm = t }
        return t.prototype.format = function(t) { var e = (new n.DateFormatter).format(t); return this._dwm || (e += " " + (new o.TimeFormatter).format(t)), e }, t.prototype.formatLocal = function(t) { var e = (new n.DateFormatter).formatLocal(t); return this._dwm || (e += " " + (new o.TimeFormatter).formatLocal(t)), e }, t
    }(), e.DateTimeFormatter = s
}, function(t, e, i) {
    "use strict";
    var o, n;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(27), n = function() {
        function t(t) { this._formatStr = t || "%h:%m:%s" }
        return t.prototype.format = function(t) { return o.customFormatters.timeFormatter ? o.customFormatters.timeFormatter.format(t) : this._formatStr.replace("%h", o.numberToStringWithLeadingZero(t.getUTCHours(), 2)).replace("%m", o.numberToStringWithLeadingZero(t.getUTCMinutes(), 2)).replace("%s", o.numberToStringWithLeadingZero(t.getUTCSeconds(), 2)) }, t.prototype.formatLocal = function(t) { return o.customFormatters.timeFormatter ? o.customFormatters.timeFormatter.formatLocal ? o.customFormatters.timeFormatter.formatLocal(t) : o.customFormatters.timeFormatter.format(t) : this._formatStr.replace("%h", o.numberToStringWithLeadingZero(t.getHours(), 2)).replace("%m", o.numberToStringWithLeadingZero(t.getMinutes(), 2)).replace("%s", o.numberToStringWithLeadingZero(t.getSeconds(), 2)) }, t
    }(), e.TimeFormatter = n
}, function(t, e, i) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 }), i(28);
    var o = function() {
        function t() {}
        return t.prototype.format = function(t) {
            var e, i, o, n, s = t < 0;
            return t = Math.abs(t), e = Math.floor(t / 86400), t -= 86400 * e, i = Math.floor(t / 3600), t -= 3600 * i, o = Math.floor(t / 60), t -= 60 * o, n = "", e && (n += e + $.t("d", { context: "dates" }) + " "), i && (n += i + $.t("h", { context: "dates" }) + " "), o && (n += o + $.t("m", {
                context: "dates"
            }) + " "), t && (n += t + $.t("s", { context: "dates" }) + " "), s && (n = "-" + n), n.trim()
        }, t
    }();
    e.TimeSpanFormatter = o
}, function(t, e) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 });
    var i = function() {
        function t(t, e) { void 0 === e && (e = !0), this._customFlags = {}, this._text = t, this._executeOnPush = e }
        return t.prototype.text = function() { return this._text }, t.prototype.executeOnPush = function() { return this._executeOnPush }, t.prototype.customFlag = function(t) { return this._customFlags[t] }, t.prototype.setCustomFlag = function(t, e) { this._customFlags[t] = e }, t
    }();
    e.UndoCommand = i
}, 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 void 0 !== 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) || "" === e.text || 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));
        t.$inner ? u.empty().append(t.$inner) : t.html ? u.html(t.text || "") : u.text(t.text || ""), s(t), n(t.colorTheme || "default"), p.addClass(t.addClass || ""), p.css("opacity", "1")
    }
    var c, d, p, u, _, f, m, g;
    Object.defineProperty(e, "__esModule", { value: !0 }), i(515), i(17), i(105), c = 500, d = 10,
        p = $("<div>").css("opacity", "0"), u = $('<div class="common-tooltip-body">').appendTo(p), _ = 0, f = 0, m = { default: "", white: "theme-white" }, g = Object.keys(m), e.updateTooltipText = r, e.hide = a, e.showOnElement = l, e.show = h, Modernizr.touch || $(document).on("mouseenter", ".apply-common-tooltip", function(t) {
            var e, i, o, n = t.originalEvent;
            if ("buttons" in n) { if (1 & n.buttons) return } else if (1 === t.which) return;
            e = $(this), i = function() { l(e) }, i(), o = function() { e.off("common-tooltip-update", i), e.off("mouseleave mousedown", o), $(document).off("scroll", o), a() }, e.on("common-tooltip-update", i), e.on("mouseleave mousedown", o), $(document).on("scroll", o)
        })
}, function(t, e, i) {
    "use strict";

    function o(t) { if (t = Math.abs(t), !a.isInteger(t) && t > 1 && (t = parseFloat(("" + t).replace(/^.+\./, "0."))), 0 < t && t < 1) { var e = ("" + t).length - 2; return Math.pow(10, e) } return 1 }

    function n(t, e) {
        var i, n, s, r, l, h;
        t.trigger("tvticker-beforechange"), i = t.data("TVTicker"), n = i && i.step, s = 0, s = i.parser ? i.parser(t.val()) : a.isInteger(n) ? parseInt(t.val(), 10) : parseFloat(t.val()), isNaN(s) && (s = 0), r = o(n), l = Math.max(r, o(s)), h = e(s, l), i.formatter && (h = i.formatter(h)), t.val(h), t.change()
    }

    function s(t) {
        var e = t.data("TVTicker"),
            i = e && e.step,
            o = e && e.max;
        n(t, function(t, e) { var n = (Math.round(t * e) + Math.round(i * e)) / e; return void 0 !== o && null !== o && o < n && (n = t), n })
    }

    function r(t) {
        var e = t.data("TVTicker"),
            i = e && e.step,
            o = e && e.min;
        n(t, function(t, e) { var n = (Math.round(t * e) - Math.round(i * e)) / e; return void 0 !== o && null !== o && n < o && (n = t), n })
    }
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17), i(359);
    var a = i(35);
    $.fn.TVTicker = function(t) {
        return void 0 === t && (t = {}), this.each(function() {
            var e, i = !1,
                o = $(this),
                n = o.data("TVTicker");
            n ? i = !0 : n = { step: +o.data("step") || 1 }, "step" in t && (n.step = +t.step || n.step), "min" in t && (n.min = t.min), "max" in t && (n.max = t.max), "formatter" in t && (n.formatter = t.formatter), "parser" in t && (n.parser = t.parser), o.data("TVTicker", n), i || (e = $('<div class="tv-ticker">').appendTo(o.parent()), $('<div class="icon up">').appendTo(e), $('<div class="icon down">').appendTo(e), o.next().find(".up, .down").on("mousedown", function(t) { t.preventDefault(), o.focus() }), o.next().find(".up").click(function() { o.is(":disabled") || s(o) }), o.next().find(".down").click(function() { o.is(":disabled") || r(o) }), o.keydown(function(t) { o.is(":disabled") || (38 === t.keyCode ? o.next().find(".up").addClass("active") : 40 === t.keyCode && o.next().find(".down").addClass("active")) }), o.keyup(function(t) { o.is(":disabled") || (38 === t.keyCode ? (s(o), o.next().find(".up").removeClass("active")) : 40 === t.keyCode && (r(o), o.next().find(".down").removeClass("active"))) }), o.mousewheel(function(t, e) { e > 0 ? o.next().find(".up").click() : o.next().find(".down").click() }))
        })
    }
}, function(t, e, i) {
    "use strict";

    function o(t, e) {
        var i, o = { className: "spinner", color: s.color.spinner, corners: 1, direction: 1, fps: 20, hwaccel: !1, left: "50%", length: 0, lines: 17, opacity: 0, radius: 20, rotate: 0, scale: 1, shadow: !1, speed: 1.5, top: "50%", trail: 60, width: 3, zIndex: 2e9 },
            a = t ? r[t] : null;
        return a && (o = $.extend(o, a)), i = $.extend({}, o, e), new n(i)
    }
    var n, s, r;
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17), n = i(362), s = i(54), r = {
        medium: { lines: 14, scale: .8 },
        micro: { lines: 12, scale: .2 },
        mini: { lines: 14, scale: .4 },
        xlarge: { lines: 16, scale: 1.6 }
    }, e.unifiedSpinner = o
}, function(t, e, i) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 }), i(117);
    ! 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) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path d="M5.182 6.596l-3.889-3.889-.707-.707 1.414-1.414.707.707 3.889 3.889 3.889-3.889.707-.707 1.414 1.414-.707.707-3.889 3.889 3.889 3.889.707.707-1.414 1.414-.707-.707-3.889-3.889-3.889 3.889-.707.707-1.414-1.414.707-.707 3.889-3.889z"/></svg>' }, , , , , , , , function(t, e) {}, function(t, e, i) {
    "use strict";

    function o() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; return (0, s.createDialog)(n({}, r, t)) }
    var n, s, r;
    Object.defineProperty(e, "__esModule", { value: !0 }), n = Object.assign || function(t) { var e, i, o; for (e = 1; e < arguments.length; e++) { i = arguments[e]; for (o in i) Object.prototype.hasOwnProperty.call(i, o) && (t[o] = i[o]) } return t }, e.createNoticeDialog = o, s = i(71), r = { width: 400, destroyOnClose: !0, title: $.t("Notification"), content: $.t("You are notified"), contentWrapTemplate: '<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text"><p></p></div></div>', actionsWrapTemplate: '<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">', actions: [{ name: "ok", type: "primary", text: $.t("Ok"), method: "close", key: [13, 32] }] }
}, function(t, e, i) {
    "use strict";
    var o, n, s, r, a;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(546), Object.defineProperty(e, "AutocompleteField", { enumerable: !0, get: function() { return o.AutocompleteField } }), n = i(547), Object.defineProperty(e, "CheckboxField", { enumerable: !0, get: function() { return n.CheckboxField } }), s = i(549), Object.defineProperty(e, "InputField", { enumerable: !0, get: function() { return s.InputField } }), r = i(548), Object.defineProperty(e, "InputFieldRegExp", { enumerable: !0, get: function() { return r.InputFieldRegExp } }), a = i(550), Object.defineProperty(e, "SaveRenameDialog", { enumerable: !0, get: function() { return a.SaveRenameDialog } })
}, function(t, e) {
    "use strict";

    function i(t) {
        for (var e = 0; e < r.length; e++)
            if (r[e].name === t) return e
    }

    function o(t, e) {
        var o = { name: t, func: e },
            n = i(o.name);
        n ? r[n] = o : r.push(o)
    }

    function n(t) { r.forEach(function(e, i) { e.name === t && r.splice(i, 1) }) }

    function s(t, e) {
        var o = { name: t, func: e },
            n = i(o.name);
        n && r.splice(n, 1), r.unshift(o)
    }
    Object.defineProperty(e, "__esModule", { value: !0 }), e.registerListener = o, e.removeListener = n, e.pushBackListener = s;
    var r = [];
    $(window).on("keypress", function(t) { for (var e = r.length - 1; e >= 0 && !0 !== r[e].func(t); e--); })
}, function(t, e, i) {
    "use strict";
    var o = i(56);
    JSServer.studyLibrary = [{ name: "Accumulation/Distribution", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#808000" } }, precision: 4, inputs: {} }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Accumulation/Distribution", shortDescription: "Accum/Dist", is_price_study: !1, inputs: [], id: "Accumulation/Distribution@tv-basicstudies-1", scriptIdPart: "", name: "Accumulation/Distribution" }, constructor: function() { this.f_0 = function(t, e, i, n) { return o.Std.or(o.Std.and(o.Std.eq(t, e), o.Std.eq(t, i)), o.Std.eq(e, i)) ? 0 : (2 * t - i - e) / (e - i) * n }, this.main = function(t, e) { var i, n, s; return this._context = t, this._input = e, i = this.f_0(o.Std.close(this._context), o.Std.high(this._context), o.Std.low(this._context), o.Std.volume(this._context)), n = o.Std.cum(i, this._context), s = n, [s] } } }, {
        name: "Accumulative Swing Index",
        metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#3C78D8" } }, precision: 4, inputs: { in_0: 10 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "ASI", histogramBase: 0, joinPoints: !1 } }, description: "Accumulative Swing Index", shortDescription: "ASI", is_price_study: !1, inputs: [{ id: "in_0", name: "Limit Move Value", defval: 10, type: "float", min: .1, max: 1e5 }], id: "Accumulative Swing Index@tv-basicstudies-1", scriptIdPart: "", name: "Accumulative Swing Index" },
        constructor: function() {
            this.f_0 = function(t, e) {
                var i = e.new_var(o.Std.open(e)),
                    n = e.new_var(o.Std.high(e)),
                    s = e.new_var(o.Std.low(e)),
                    r = e.new_var(o.Std.close(e)),
                    a = o.Std.abs(n - r.get(1)),
                    l = o.Std.abs(s - r.get(1)),
                    h = o.Std.abs(n - s),
                    c = o.Std.abs(r.get(1) - i.get(1)),
                    d = o.Std.max(a, l),
                    p = o.Std.iff(a >= o.Std.max(l, h), a - .5 * l + .25 * c, o.Std.iff(l >= o.Std.max(a, h), l - .5 * a + .25 * c, h + .25 * c));
                return o.Std.iff(0 === p, 0, (r - r.get(1) + .5 * (r - i) + .25 * (r.get(1) - i.get(1))) / p * d / t * 50)
            }, this.f_1 = function(t, e) { var i = this.f_0(t, e); return o.Std.cum(i, e) }, this.main = function(t, e) { var i, o; return this._context = t, this._input = e, i = this._input(0), o = this.f_1(i, this._context), [o] }
        }
    }, {
        name: "Advance/Decline",
        metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, inputs: { in_0: 10 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Advance/Decline", shortDescription: "AD", is_price_study: !1, inputs: [{ id: "in_0", name: "length", defval: 10, type: "integer", min: 1, max: 2e3 }], id: "Advance/Decline@tv-basicstudies-1", scriptIdPart: "", name: "Advance/Decline" },
        constructor: function() {
            this.f_0 = function(t, e) { return o.Std.gt(t, e) }, this.f_1 = function(t, e) { return o.Std.lt(t, e) }, this.f_2 = function(t, e) { return 0 === e ? t : t / e },
                this.main = function(t, e) { var i, n, s, r, a, l, h, c, d; return this._context = t, this._input = e, i = this._input(0), n = this.f_0(o.Std.close(this._context), o.Std.open(this._context)), s = this._context.new_var(n), r = o.Std.sum(s, i, this._context), a = this.f_1(o.Std.close(this._context), o.Std.open(this._context)), l = this._context.new_var(a), h = o.Std.sum(l, i, this._context), c = this.f_2(r, h), d = c, [d] }
        }
    }, { name: "Arnaud Legoux Moving Average", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#000080" } }, precision: 4, inputs: { in_0: 9, in_1: .85, in_2: 6 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Arnaud Legoux Moving Average", shortDescription: "ALMA", is_price_study: !0, inputs: [{ id: "in_0", name: "Window Size", defval: 9, type: "integer", min: 0, max: 5e3 }, { id: "in_1", name: "Offset", defval: .85, type: "float", min: -1e12, max: 1e12 }, { id: "in_2", name: "Sigma", defval: 6, type: "float", min: -1e12, max: 1e12 }], id: "Arnaud Legoux Moving Average@tv-basicstudies-1", scriptIdPart: "", name: "Arnaud Legoux Moving Average" }, constructor: function() { this.main = function(t, e) { var i, n, s, r, a, l; return this._context = t, this._input = e, i = o.Std.close(this._context), n = this._input(0), s = this._input(1), r = this._input(2), a = this._context.new_var(i), l = o.Std.alma(a, n, s, r), [l] } } }, { name: "Aroon", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF6A00" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0094FF" } }, precision: 4, inputs: { in_0: 14 } }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }], styles: { plot_0: { title: "Upper", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "Lower", histogramBase: 0, joinPoints: !1 } }, description: "Aroon", shortDescription: "Aroon", is_price_study: !1, inputs: [{ id: "in_0", name: "length", defval: 14, type: "integer", min: 1, max: 2e3 }], id: "Aroon@tv-basicstudies-1", scriptIdPart: "", name: "Aroon" }, constructor: function() { this.f_0 = function(t, e) { return 100 * (t + e) / e }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _; return this._context = t, this._input = e, i = this._input(0), n = o.Std.high(this._context), s = i + 1, r = this._context.new_var(n), a = o.Std.highestbars(r, s, this._context), l = this.f_0(a, i), h = o.Std.low(this._context), c = this._context.new_var(h), d = o.Std.lowestbars(c, s, this._context), p = this.f_0(d, i), u = l, _ = p, [u, _] } } }, {
        name: "Average Directional Index",
        metainfo: {
            _metainfoVersion: 41,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, inputs: { in_0: 14, in_1: 14 } },
            plots: [{ id: "plot_0", type: "line" }],
            styles: { plot_0: { title: "ADX", histogramBase: 0, joinPoints: !1, isHidden: !1 } },
            description: "Average Directional Index",
            shortDescription: "ADX",
            is_price_study: !1,
            inputs: [{ id: "in_0", name: "ADX Smoothing", defval: 14, type: "integer", min: -1e12, max: 1e12 }, {
                id: "in_1",
                name: "DI Length",
                defval: 14,
                type: "integer",
                min: -1e12,
                max: 1e12
            }],
            id: "average_directional_Index@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Average Directional Index"
        },
        constructor: function() {
            this.f_0 = function(t) {
                var e = this._context.new_var(o.Std.high(this._context)),
                    i = o.Std.change(e),
                    n = this._context.new_var(o.Std.low(this._context)),
                    s = -o.Std.change(n),
                    r = this._context.new_var(o.Std.tr(void 0, this._context)),
                    a = o.Std.rma(r, t, this._context),
                    l = this._context.new_var(o.Std.and(o.Std.gt(i, s), o.Std.gt(i, 0)) ? i : 0),
                    h = o.Std.fixnan(100 * o.Std.rma(l, t, this._context) / a, this._context),
                    c = this._context.new_var(o.Std.and(o.Std.gt(s, i), o.Std.gt(s, 0)) ? s : 0);
                return [h, o.Std.fixnan(100 * o.Std.rma(c, t, this._context) / a, this._context)]
            }, this.f_1 = function(t, e) {
                var i = this.f_0(t),
                    n = i[0],
                    s = i[1],
                    r = n + s,
                    a = this._context.new_var(o.Std.abs(n - s) / (o.Std.eq(r, 0) ? 1 : r));
                return [100 * o.Std.rma(a, e, this._context)]
            }, this.main = function(t, e) { return this._context = t, this._input = e, this.f_1(this._input(0), this._input(1)) }
        }
    }, { name: "Average True Range", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, inputs: { in_0: 14 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Average True Range", shortDescription: "ATR", is_price_study: !1, inputs: [{ id: "in_0", name: "length", defval: 14, type: "integer", min: 1, max: 2e3 }], id: "Average True Range@tv-basicstudies-1", scriptIdPart: "", name: "Average True Range" }, constructor: function() { this.main = function(t, e) { var i, n, s, r; return this._context = t, this._input = e, i = this._input(0), n = o.Std.tr(this._context), s = this._context.new_var(n), r = o.Std.rma(s, i, this._context), [r] } } }, { name: "Awesome Oscillator", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 1, trackPrice: !1, transparency: 35, visible: !0, color: "#000080" } }, precision: 4, palettes: { palette_0: { colors: { 0: { color: "#FF0000", width: 1, style: 0 }, 1: { color: "#008000", width: 1, style: 0 } } } }, inputs: {} }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", palette: "palette_0", target: "plot_0", type: "colorer" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Awesome Oscillator", shortDescription: "AO", is_price_study: !1, palettes: { palette_0: { colors: { 0: { name: "Color 0" }, 1: { name: "Color 1" } } } }, inputs: [], id: "Awesome Oscillator@tv-basicstudies-1", scriptIdPart: "", name: "Awesome Oscillator" }, constructor: function() { this.f_0 = function(t, e) { return t - e }, this.f_1 = function(t) { return o.Std.le(t, 0) ? 0 : 1 }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p; return this._context = t, this._input = e, i = o.Std.hl2(this._context), n = this._context.new_var(i), s = o.Std.sma(n, 5, this._context), r = this._context.new_var(i), a = o.Std.sma(r, 34, this._context), l = this.f_0(s, a), h = l, c = this._context.new_var(l), d = o.Std.change(c), p = this.f_1(d), [h, p] } } }, {
        name: "Balance of Power",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: {
                styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } },
                precision: 4,
                inputs: {}
            },
            plots: [{ id: "plot_0", type: "line" }],
            styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } },
            description: "Balance of Power",
            shortDescription: "Balance of Power",
            is_price_study: !1,
            inputs: [],
            id: "Balance of Power@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Balance of Power"
        },
        constructor: function() { this.f_0 = function(t, e, i, o) { return (t - e) / (i - o) }, this.main = function(t, e) { return this._context = t, this._input = e, [this.f_0(o.Std.close(this._context), o.Std.open(this._context), o.Std.high(this._context), o.Std.low(this._context))] } }
    }, { name: "Bollinger Bands", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" }, plot_2: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" } }, precision: 4, filledAreasStyle: { fill_0: { color: "#000080", transparency: 90, visible: !0 } }, inputs: { in_0: 20, in_1: 2 } }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }, { id: "plot_2", type: "line" }], styles: { plot_0: { title: "Median", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "Upper", histogramBase: 0, joinPoints: !1 }, plot_2: { title: "Lower", histogramBase: 0, joinPoints: !1 } }, description: "Bollinger Bands", shortDescription: "BB", is_price_study: !0, filledAreas: [{ id: "fill_0", objAId: "plot_1", objBId: "plot_2", type: "plot_plot", title: "Plots Background" }], inputs: [{ id: "in_0", name: "length", defval: 20, type: "integer", min: 1, max: 1e4 }, { id: "in_1", name: "mult", defval: 2, type: "float", min: .001, max: 50 }], id: "Bollinger Bands@tv-basicstudies-1", scriptIdPart: "", name: "Bollinger Bands" }, constructor: function() { this.f_0 = function(t, e) { return t * e }, this.f_1 = function(t, e) { return t + e }, this.f_2 = function(t, e) { return t - e }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _, f; return this._context = t, this._input = e, i = o.Std.close(this._context), n = this._input(0), s = this._input(1), r = this._context.new_var(i), a = o.Std.sma(r, n, this._context), l = this._context.new_var(i), h = o.Std.stdev(l, n, this._context), c = this.f_0(s, h), d = this.f_1(a, c), p = this.f_2(a, c), u = a, _ = d, f = p, [u, _, f] } } }, {
        name: "Bollinger Bands %B",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#008080" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 1 }, { color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 0 }], filledAreasStyle: { fill_0: { color: "#008080", transparency: 90, visible: !0 } }, inputs: { in_0: 20, in_1: 2 } },
            plots: [{ id: "plot_0", type: "line" }],
            styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } },
            description: "Bollinger Bands %B",
            shortDescription: "BB %B",
            is_price_study: !1,
            bands: [{ id: "hline_0", name: "UpperLimit" }, { id: "hline_1", name: "LowerLimit" }],
            filledAreas: [{
                id: "fill_0",
                objAId: "hline_0",
                objBId: "hline_1",
                type: "hline_hline",
                title: "Hlines Background"
            }],
            inputs: [{ id: "in_0", name: "length", defval: 20, type: "integer", min: 1, max: 1e4 }, { id: "in_1", name: "mult", defval: 2, type: "float", min: .001, max: 50 }],
            id: "Bollinger Bands %B@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Bollinger Bands %B"
        },
        constructor: function() { this.f_0 = function(t, e) { return t * e }, this.f_1 = function(t, e) { return t + e }, this.f_2 = function(t, e) { return t - e }, this.f_3 = function(t, e, i) { return (t - e) / (i - e) }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _; return this._context = t, this._input = e, i = o.Std.close(this._context), n = this._input(0), s = this._input(1), r = this._context.new_var(i), a = o.Std.sma(r, n, this._context), l = this._context.new_var(i), h = o.Std.stdev(l, n, this._context), c = this.f_0(s, h), d = this.f_1(a, c), p = this.f_2(a, c), u = this.f_3(i, p, d), _ = u, [_] } }
    }, { name: "Bollinger Bands Width", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" } }, precision: 4, inputs: { in_0: 20, in_1: 2 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Bollinger Bands Width", shortDescription: "BBW", is_price_study: !1, inputs: [{ id: "in_0", name: "length", defval: 20, type: "integer", min: 1, max: 1e4 }, { id: "in_1", name: "mult", defval: 2, type: "float", min: .001, max: 50 }], id: "Bollinger Bands Width@tv-basicstudies-1", scriptIdPart: "", name: "Bollinger Bands Width" }, constructor: function() { this.f_0 = function(t, e) { return t * e }, this.f_1 = function(t, e) { return t + e }, this.f_2 = function(t, e) { return t - e }, this.f_3 = function(t, e, i) { return (t - e) / i }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _; return this._context = t, this._input = e, i = o.Std.close(this._context), n = this._input(0), s = this._input(1), r = this._context.new_var(i), a = o.Std.sma(r, n, this._context), l = this._context.new_var(i), h = o.Std.stdev(l, n, this._context), c = this.f_0(s, h), d = this.f_1(a, c), p = this.f_2(a, c), u = this.f_3(d, p, a), _ = u, [_] } } }, {
        name: "Chaikin Money Flow",
        metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#008000" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 0 }], inputs: { in_0: 20 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Chaikin Money Flow", shortDescription: "CMF", is_price_study: !1, bands: [{ id: "hline_0", name: "Zero" }], inputs: [{ id: "in_0", name: "length", defval: 20, type: "integer", min: 1, max: 2e3 }], id: "Chaikin Money Flow@tv-basicstudies-1", scriptIdPart: "", name: "Chaikin Money Flow" },
        constructor: function() {
            this.f_0 = function(t, e, i, n) { return o.Std.or(o.Std.and(o.Std.eq(t, e), o.Std.eq(t, i)), o.Std.eq(e, i)) ? 0 : (2 * t - i - e) / (e - i) * n }, this.f_1 = function(t, e) { return t / e }, this.main = function(t, e) {
                var i, n, s, r, a, l, h, c, d;
                return this._context = t, this._input = e, i = this._input(0), n = this.f_0(o.Std.close(this._context), o.Std.high(this._context), o.Std.low(this._context), o.Std.volume(this._context)),
                    s = this._context.new_var(n), r = o.Std.sum(s, i, this._context), a = o.Std.volume(this._context), l = this._context.new_var(a), h = o.Std.sum(l, i, this._context), c = this.f_1(r, h), d = c, [d]
            }
        }
    }, { name: "Chaikin Oscillator", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 0 }], inputs: { in_0: 3, in_1: 10 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Chaikin Oscillator", shortDescription: "Chaikin Osc", is_price_study: !1, bands: [{ id: "hline_0", name: "Zero" }], inputs: [{ id: "in_0", name: "short", defval: 3, type: "integer", min: 1, max: 2e3 }, { id: "in_1", name: "long", defval: 10, type: "integer", min: 1, max: 2e3 }], id: "Chaikin Oscillator@tv-basicstudies-1", scriptIdPart: "", name: "Chaikin Oscillator" }, constructor: function() { this.f_0 = function(t, e) { return t - e }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d; return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = o.Std.accdist(this._context), r = this._context.new_var(s), a = o.Std.ema(r, i, this._context), l = this._context.new_var(s), h = o.Std.ema(l, n, this._context), c = this.f_0(a, h), d = c, [d] } } }, { name: "Chande Kroll Stop", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#008000" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, inputs: { in_0: 10, in_1: 1, in_2: 9 } }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }], styles: { plot_0: { title: "Long", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "Short", histogramBase: 0, joinPoints: !1 } }, description: "Chande Kroll Stop", shortDescription: "Chande Kroll Stop", is_price_study: !0, inputs: [{ id: "in_0", name: "p", defval: 10, type: "integer", min: 1, max: 4999 }, { id: "in_1", name: "x", defval: 1, type: "integer", min: 1, max: 1e12 }, { id: "in_2", name: "q", defval: 9, type: "integer", min: 1, max: 1e12 }], id: "Chande Kroll Stop@tv-basicstudies-1", scriptIdPart: "", name: "Chande Kroll Stop" }, constructor: function() { this.f_0 = function(t, e, i) { return t - e * i }, this.f_1 = function(t, e, i) { return t + e * i }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _, f, m, g, v, y; return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = this._input(2), r = o.Std.high(this._context), a = this._context.new_var(r), l = o.Std.highest(a, i, this._context), h = o.Std.atr(i, this._context), c = this.f_0(l, n, h), d = this._context.new_var(r), p = o.Std.lowest(d, i, this._context), u = this.f_1(p, n, h), _ = this._context.new_var(c), f = o.Std.highest(_, s, this._context), m = this._context.new_var(u), g = o.Std.lowest(m, s, this._context), v = g, y = f, [v, y] } } }, {
        name: "Chande Momentum Oscillator",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#008080" } }, precision: 4, inputs: { in_0: 9 } },
            plots: [{ id: "plot_0", type: "line" }],
            styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } },
            description: "Chande Momentum Oscillator",
            shortDescription: "ChandeMO",
            is_price_study: !1,
            inputs: [{ id: "in_0", name: "length", defval: 9, type: "integer", min: 1, max: 2e3 }],
            id: "Chande Momentum Oscillator@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Chande Momentum Oscillator"
        },
        constructor: function() { this.f_0 = function(t) { return o.Std.ge(t, 0) ? t : 0 }, this.f_1 = function(t) { return o.Std.ge(t, 0) ? 0 : -t }, this.f_2 = function(t, e) { return 100 * t / e }, this.f_3 = function(t, e) { return this.f_2(t - e, t + e) }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _; return this._context = t, this._input = e, i = this._input(0), n = o.Std.close(this._context), s = this._context.new_var(n), r = o.Std.change(s), a = this.f_0(r), l = this.f_1(r), h = this._context.new_var(a), c = o.Std.sum(h, i, this._context), d = this._context.new_var(l), p = o.Std.sum(d, i, this._context), u = this.f_3(c, p), _ = u, [_] } }
    }, {
        name: "Chop Zone",
        metainfo: { _metainfoVersion: 41, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 5, trackPrice: !1, transparency: 35, visible: !0, color: "#000080" } }, precision: 4, palettes: { palette_0: { colors: { 0: { color: "#34dddd", width: 1, style: 0 }, 1: { color: "#006400", width: 1, style: 0 }, 2: { color: "#98fb98", width: 1, style: 0 }, 3: { color: "#00FF00", width: 1, style: 0 }, 4: { color: "#8B0000", width: 1, style: 0 }, 5: { color: "#FF0000", width: 1, style: 0 }, 6: { color: "#FF7F00", width: 1, style: 0 }, 7: { color: "#ffc04c", width: 1, style: 0 }, 8: { color: "#FFFF00", width: 1, style: 0 } } } }, inputs: {} }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", palette: "palette_0", target: "plot_0", type: "colorer" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1, isHidden: !1 } }, description: "Chop Zone", shortDescription: "Chop Zone", is_price_study: !1, palettes: { palette_0: { colors: { 0: { name: "Color 0" }, 1: { name: "Color 1" }, 2: { name: "Color 2" }, 3: { name: "Color 3" }, 4: { name: "Color 4" }, 5: { name: "Color 5" }, 6: { name: "Color 6" }, 7: { name: "Color 7" }, 8: { name: "Color 8" } }, valToIndex: { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8 } } }, inputs: [], id: "chop_zone@tv-basicstudies-1", scriptIdPart: "", name: "Chop Zone" },
        constructor: function() {
            this.f_0 = function() {
                var t = o.Std.close(this._context),
                    e = o.Std.hlc3(this._context),
                    i = this._context.new_var(o.Std.high(this._context)),
                    n = o.Std.highest(i, 30, this._context),
                    s = o.Std.lowest(i, 30, this._context),
                    r = 25 / (n - s) * s,
                    a = this._context.new_var(t),
                    l = this._context.new_var(o.Std.ema(a, 34, this._context)),
                    h = (l.get(1) - l.get(0)) / e * r,
                    c = o.Std.sqrt(1 + h * h),
                    d = o.Std.round(180 * o.Std.acos(1 / c) / 3.141592653589793),
                    p = o.Std.iff(o.Std.gt(h, 0), -d, d),
                    u = o.Std.and(o.Std.gt(p, -2.14), o.Std.le(p, -.71)) ? 7 : 8,
                    _ = o.Std.and(o.Std.gt(p, -3.57), o.Std.le(p, -2.14)) ? 6 : u,
                    f = o.Std.and(o.Std.gt(p, -5), o.Std.le(p, -3.57)) ? 5 : _,
                    m = o.Std.le(p, -5) ? 4 : f,
                    g = o.Std.and(o.Std.lt(p, 2.14), o.Std.ge(p, .71)) ? 3 : m,
                    v = o.Std.and(o.Std.lt(p, 3.57), o.Std.ge(p, 2.14)) ? 2 : g,
                    y = o.Std.and(o.Std.lt(p, 5), o.Std.ge(p, 3.57)) ? 1 : v;
                return [1, o.Std.ge(p, 5) ? 0 : y]
            }, this.main = function(t, e) { return this._context = t, this._input = e, this.f_0() }
        }
    }, {
        name: "Choppiness Index",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 61.8 }, { color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 38.2 }], filledAreasStyle: { fill_0: { color: "#008000", transparency: 90, visible: !0 } }, inputs: { in_0: 14 } },
            plots: [{ id: "plot_0", type: "line" }],
            styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } },
            description: "Choppiness Index",
            shortDescription: "CHOP",
            is_price_study: !1,
            bands: [{ id: "hline_0", name: "UpperLimit" }, { id: "hline_1", name: "LowerLimit" }],
            filledAreas: [{ id: "fill_0", objAId: "hline_0", objBId: "hline_1", type: "hline_hline", title: "Hlines Background" }],
            inputs: [{ id: "in_0", name: "length", defval: 14, type: "integer", min: 1, max: 2e3 }],
            id: "Choppiness Index@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Choppiness Index"
        },
        constructor: function() { this.f_0 = function(t, e, i, n) { return 100 * o.Std.log10(t / (e - i)) / n }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _, f; return this._context = t, this._input = e, i = this._input(0), n = o.Std.atr(1, this._context), s = this._context.new_var(n), r = o.Std.sum(s, i, this._context), a = o.Std.high(this._context), l = this._context.new_var(a), h = o.Std.highest(l, i, this._context), c = o.Std.low(this._context), d = this._context.new_var(c), p = o.Std.lowest(d, i, this._context), u = o.Std.log10(i), _ = this.f_0(r, h, p, u), f = _, [f] } }
    }, { name: "Commodity Channel Index", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#808000" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 100 }, { color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: -100 }], filledAreasStyle: { fill_0: { color: "#808000", transparency: 90, visible: !0 } }, inputs: { in_0: 20 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Commodity Channel Index", shortDescription: "CCI", is_price_study: !1, bands: [{ id: "hline_0", name: "UpperLimit" }, { id: "hline_1", name: "LowerLimit" }], filledAreas: [{ id: "fill_0", objAId: "hline_0", objBId: "hline_1", type: "hline_hline", title: "Hlines Background" }], inputs: [{ id: "in_0", name: "length", defval: 20, type: "integer", min: 1, max: 2e3 }], id: "Commodity Channel Index@tv-basicstudies-1", scriptIdPart: "", name: "Commodity Channel Index" }, constructor: function() { this.f_0 = function(t, e, i) { return (t - e) / (.015 * i) }, this.main = function(t, e) { var i, n, s, r, a, l, h, c; return this._context = t, this._input = e, i = o.Std.hlc3(this._context), n = this._input(0), s = this._context.new_var(i), r = o.Std.sma(s, n, this._context), a = this._context.new_var(i), l = o.Std.dev(a, n, this._context), h = this.f_0(i, r, l), c = h, [c] } } }, {
        name: "Connors RSI",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: {
                styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#800080" } },
                precision: 4,
                bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 70 }, { color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 30 }],
                filledAreasStyle: { fill_0: { color: "#800080", transparency: 90, visible: !0 } },
                inputs: { in_0: 3, in_1: 2, in_2: 100 }
            },
            plots: [{ id: "plot_0", type: "line" }],
            styles: { plot_0: { title: "CRSI", histogramBase: 0, joinPoints: !1 } },
            description: "Connors RSI",
            shortDescription: "CRSI",
            is_price_study: !1,
            bands: [{ id: "hline_0", name: "UpperLimit" }, { id: "hline_1", name: "LowerLimit" }],
            filledAreas: [{ id: "fill_0", objAId: "hline_0", objBId: "hline_1", type: "hline_hline", title: "Hlines Background" }],
            inputs: [{ id: "in_0", name: "RSI Length", defval: 3, type: "integer", min: 1 }, { id: "in_1", name: "UpDown Length", defval: 2, type: "integer", min: 1 }, { id: "in_2", name: "ROC Length", defval: 100, type: "integer", min: 1 }],
            id: "Connors RSI@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Connors RSI"
        },
        constructor: function() {
            this.f_1 = function(t, e, i) { var n = i.new_var(o.Std.max(o.Std.change(t), 0)); return o.Std.rma(n, e, i) }, this.f_2 = function(t, e, i) { var n = i.new_var(-o.Std.min(o.Std.change(t), 0)); return o.Std.rma(n, e, i) }, this.f_3 = function() {
                var t = 0;
                return function(e) {
                    var i = e.get(0),
                        n = e.get(1);
                    return t = i === n ? 0 : i > n ? o.Std.nz(t) <= 0 ? 1 : o.Std.nz(t) + 1 : o.Std.nz(t) >= 0 ? -1 : o.Std.nz(t) - 1, this._context.new_var(t)
                }
            }(), this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u; return this._context = t, this._input = e, i = o.Std.close(this._context), n = this._context.new_var(i), s = this._input(0), r = this._input(1), a = this._input(2), l = o.Std.rsi(this.f_1(n, s, this._context), this.f_2(n, s, this._context)), h = this.f_3(n), c = o.Std.rsi(this.f_1(h, r, this._context), this.f_2(h, r, this._context)), d = this._context.new_var(o.Std.roc(n, 1)), p = o.Std.percentrank(d, a), u = o.Std.avg(l, c, p), [u] }
        }
    }, { name: "Coppock Curve", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#000080" } }, precision: 4, inputs: { in_0: 10, in_1: 14, in_2: 11 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Coppock Curve", shortDescription: "Coppock Curve", is_price_study: !1, inputs: [{ id: "in_0", name: "WMA Length", defval: 10, type: "integer", min: -1e12, max: 5e3 }, { id: "in_1", name: "Long RoC Length", defval: 14, type: "integer", min: 1, max: 4999 }, { id: "in_2", name: "Short RoC Length", defval: 11, type: "integer", min: 1, max: 4999 }], id: "Coppock Curve@tv-basicstudies-1", scriptIdPart: "", name: "Coppock Curve" }, constructor: function() { this.f_0 = function(t, e) { return t + e }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _; return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = this._input(2), r = o.Std.close(this._context), a = this._context.new_var(r), l = o.Std.roc(a, n), h = this._context.new_var(r), c = o.Std.roc(h, s), d = this.f_0(l, c), p = this._context.new_var(d), u = o.Std.wma(p, i, this._context), _ = u, [_] } } }, {
        name: "Correlation Coeff",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 4, trackPrice: !1, transparency: 40, visible: !0, color: "#800080" } }, precision: 4, inputs: { in_0: "AAPL", in_1: 20 } },
            plots: [{ id: "plot_0", type: "line" }],
            styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } },
            description: "Correlation Coefficient",
            shortDescription: "CC",
            is_price_study: !1,
            inputs: [{ id: "in_0", name: "sym", defval: "AAPL", type: "symbol" }, { id: "in_1", name: "length", defval: 20, type: "integer", min: 1, max: 2e3 }],
            id: "Correlation Coeff@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Correlation Coeff"
        },
        constructor: function() { this.init = function(t, e) { this._context = t, this._input = e, this._context.new_sym(this._input(0), o.Std.period(this._context), o.Std.period(this._context)) }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p; return this._context = t, this._input = e, i = this._context.new_var(this._context.symbol.time), this._input(0), o.Std.period(this._context), n = o.Std.close(this._context), s = this._input(1), this._context.select_sym(1), r = this._context.new_var(this._context.symbol.time), a = o.Std.close(this._context), l = this._context.new_var(a), this._context.select_sym(0), h = l.adopt(r, i, 0), c = this._context.new_var(n), d = this._context.new_var(h), p = o.Std.correlation(c, d, s, this._context), [p] } }
    }, {
        name: "Detrended Price Oscillator",
        metainfo: { _metainfoVersion: 42, isTVScript: !1, isTVScriptStub: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#808000" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 0 }], inputs: { in_0: 21, in_1: !1 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "DPO", histogramBase: 0, joinPoints: !1, isHidden: !1 } }, description: "Detrended Price Oscillator", shortDescription: "DPO", is_price_study: !1, is_hidden_study: !1, id: "detrended_price_oscillator@tv-basicstudies-1", bands: [{ id: "hline_0", name: "Zero", isHidden: !1 }], inputs: [{ id: "in_0", name: "Period", defval: 21, type: "integer", min: 1, max: 1e12 }, { id: "in_1", name: "isCentered", defval: !1, type: "bool" }], scriptIdPart: "", name: "Detrended Price Oscillator" },
        constructor: function() {
            this.f_0 = function() {
                var t = this._input(0),
                    e = this._input(1),
                    i = Math.floor(t / 2 + 1),
                    n = this._context.new_var(o.Std.close(this._context)),
                    s = this._context.new_var(o.Std.sma(n, t, this._context)),
                    r = this._context.new_var(o.Std.close(this._context)),
                    a = r.get(i) - s,
                    l = o.Std.close(this._context) - s.get(i),
                    h = e ? a : l,
                    c = -i;
                return [h, e ? c : 0]
            }, this.main = function(t, e) { this._context = t, this._input = e; var i = this.f_0(); return [{ value: i[0], offset: i[1] }] }
        }
    }, {
        name: "Directional Movement Index",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF7F00" }, plot_2: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, inputs: { in_0: 14, in_1: 14 } },
            plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }, { id: "plot_2", type: "line" }],
            styles: { plot_0: { title: "+DI", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "-DI", histogramBase: 0, joinPoints: !1 }, plot_2: { title: "ADX", histogramBase: 0, joinPoints: !1 } },
            description: "Directional Movement",
            shortDescription: "DMI",
            is_price_study: !1,
            inputs: [{
                id: "in_0",
                name: "DI Length",
                defval: 14,
                type: "integer",
                min: 1,
                max: 2e3
            }, { id: "in_1", name: "ADX Smoothing", defval: 14, type: "integer", min: 1, max: 50 }],
            id: "Directional Movement Index@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Directional Movement Index"
        },
        constructor: function() { this.f_0 = function(t) { return -t }, this.f_1 = function(t, e) { return o.Std.and(o.Std.gt(t, e), o.Std.gt(t, 0)) ? t : 0 }, this.f_2 = function(t, e) { return 100 * t / e }, this.f_3 = function(t, e) { return t + e }, this.f_4 = function(t, e, i) { return o.Std.abs(t - e) / (o.Std.eq(i, 0) ? 1 : i) }, this.f_5 = function(t) { return 100 * t }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _, f, m, g, v, y, b, w, S, T, C, x, P, L, k, I, A, E, M; return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = o.Std.high(this._context), r = this._context.new_var(s), a = o.Std.change(r), l = o.Std.low(this._context), h = this._context.new_var(l), c = o.Std.change(h), d = this.f_0(c), p = o.Std.tr(this._context), u = this._context.new_var(p), _ = o.Std.rma(u, i, this._context), f = this.f_1(a, d), m = this._context.new_var(f), g = o.Std.rma(m, i, this._context), v = this.f_2(g, _), y = o.Std.fixnan(v, this._context), b = this.f_1(d, a), w = this._context.new_var(b), S = o.Std.rma(w, i, this._context), T = this.f_2(S, _), C = o.Std.fixnan(T, this._context), x = this.f_3(y, C), P = this.f_4(y, C, x), L = this._context.new_var(P), k = o.Std.rma(L, n, this._context), I = this.f_5(k), A = y, E = C, M = I, [A, E, M] } }
    }, { name: "Donchian Channels", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" }, plot_2: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF7F00" } }, precision: 4, filledAreasStyle: { fill_0: { color: "#0000FF", transparency: 90, visible: !0 } }, inputs: { in_0: 20 } }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }, { id: "plot_2", type: "line" }], styles: { plot_0: { title: "Lower", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "Upper", histogramBase: 0, joinPoints: !1 }, plot_2: { title: "Basis", histogramBase: 0, joinPoints: !1 } }, description: "Donchian Channels", shortDescription: "DC", is_price_study: !0, filledAreas: [{ id: "fill_0", objAId: "plot_1", objBId: "plot_0", type: "plot_plot", title: "Plots Background" }], inputs: [{ id: "in_0", name: "length", defval: 20, type: "integer", min: 1, max: 2e3 }], id: "Donchian Channels@tv-basicstudies-1", scriptIdPart: "", name: "Donchian Channels" }, constructor: function() { this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u; return this._context = t, this._input = e, i = this._input(0), n = o.Std.low(this._context), s = this._context.new_var(n), r = o.Std.lowest(s, i, this._context), a = o.Std.high(this._context), l = this._context.new_var(a), h = o.Std.highest(l, i, this._context), c = o.Std.avg(h, r), d = r, p = h, u = c, [d, p, u] } } }, {
        name: "Double Exponential Moving Average",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#008000" } }, precision: 4, inputs: { in_0: 9 } },
            plots: [{ id: "plot_0", type: "line" }],
            styles: {
                plot_0: {
                    title: "Plot",
                    histogramBase: 0,
                    joinPoints: !1
                }
            },
            description: "Double EMA",
            shortDescription: "DEMA",
            is_price_study: !0,
            inputs: [{ id: "in_0", name: "length", defval: 9, type: "integer", min: 1, max: 1e4 }],
            id: "Double Exponential Moving Average@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Double Exponential Moving Average"
        },
        constructor: function() { this.f_0 = function(t, e) { return 2 * t - e }, this.main = function(t, e) { var i, n, s, r, a, l, h, c; return this._context = t, this._input = e, i = this._input(0), n = o.Std.close(this._context), s = this._context.new_var(n), r = o.Std.ema(s, i, this._context), a = this._context.new_var(r), l = o.Std.ema(a, i, this._context), h = this.f_0(r, l), c = h, [c] } }
    }, { name: "Ease of Movement", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#808000" } }, precision: 4, inputs: { in_0: 1e4, in_1: 14 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Ease Of Movement", shortDescription: "EOM", is_price_study: !1, inputs: [{ id: "in_0", name: "Divisor", defval: 1e4, type: "integer", min: 1, max: 1e9 }, { id: "in_1", name: "length", defval: 14, type: "integer", min: 1, max: 2e3 }], id: "Ease of Movement@tv-basicstudies-1", scriptIdPart: "", name: "Ease of Movement" }, constructor: function() { this.f_0 = function(t, e, i, o, n) { return t * e * (i - o) / n }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d; return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = o.Std.hl2(this._context), r = this._context.new_var(s), a = o.Std.change(r), l = this.f_0(i, a, o.Std.high(this._context), o.Std.low(this._context), o.Std.volume(this._context)), h = this._context.new_var(l), c = o.Std.sma(h, n, this._context), d = c, [d] } } }, { name: "Elders Force Index", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#800000" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 0 }], inputs: { in_0: 13 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Elder's Force Index", shortDescription: "EFI", is_price_study: !1, bands: [{ id: "hline_0", name: "Zero" }], inputs: [{ id: "in_0", name: "length", defval: 13, type: "integer", min: 1, max: 2e3 }], id: "Elders Force Index@tv-basicstudies-1", scriptIdPart: "", name: "Elders Force Index" }, constructor: function() { this.f_0 = function(t, e) { return t * e }, this.main = function(t, e) { var i, n, s, r, a, l, h, c; return this._context = t, this._input = e, i = this._input(0), n = o.Std.close(this._context), s = this._context.new_var(n), r = o.Std.change(s), a = this.f_0(r, o.Std.volume(this._context)), l = this._context.new_var(a), h = o.Std.ema(l, i, this._context), c = h, [c] } } }, {
        name: "EMA Cross",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: {
                styles: {
                    plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" },
                    plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#008000" },
                    plot_2: {
                        linestyle: 0,
                        linewidth: 4,
                        plottype: 3,
                        trackPrice: !1,
                        transparency: 35,
                        visible: !0,
                        color: "#000080"
                    }
                },
                precision: 4,
                inputs: { in_0: 9, in_1: 26 }
            },
            plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }, { id: "plot_2", type: "line" }],
            styles: { plot_0: { title: "Short", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "Long", histogramBase: 0, joinPoints: !1 }, plot_2: { title: "Crosses", histogramBase: 0, joinPoints: !1 } },
            description: "EMA Cross",
            shortDescription: "EMA Cross",
            is_price_study: !0,
            inputs: [{ id: "in_0", name: "Short", defval: 9, type: "integer", min: 1, max: 2e3 }, { id: "in_1", name: "Long", defval: 26, type: "integer", min: 1, max: 2e3 }],
            id: "EMA Cross@tv-basicstudies-1",
            scriptIdPart: "",
            name: "EMA Cross"
        },
        constructor: function() { this.f_0 = function(t, e) { return t ? e : o.Std.na() }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u; return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = o.Std.close(this._context), r = this._context.new_var(s), a = o.Std.ema(r, i, this._context), l = this._context.new_var(s), h = o.Std.ema(l, n, this._context), c = a, d = h, p = o.Std.cross(a, h, this._context), u = this.f_0(p, a), [c, d, u] } }
    }, { name: "Envelope", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF7F00" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" }, plot_2: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" } }, precision: 4, filledAreasStyle: { fill_0: { color: "#0000FF", transparency: 90, visible: !0 } }, inputs: { in_0: 20, in_1: 10, in_2: !1 } }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }, { id: "plot_2", type: "line" }], styles: { plot_0: { title: "Median", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "Upper", histogramBase: 0, joinPoints: !1 }, plot_2: { title: "Lower", histogramBase: 0, joinPoints: !1 } }, description: "Envelope", shortDescription: "Env", is_price_study: !0, filledAreas: [{ id: "fill_0", objAId: "plot_1", objBId: "plot_2", type: "plot_plot", title: "Plots Background" }], inputs: [{ id: "in_0", name: "Length", defval: 20, type: "integer", min: 1, max: 2e3 }, { id: "in_1", name: "percent", defval: 10, type: "float", min: -1e12, max: 1e12 }, { id: "in_2", name: "exponential", defval: !1, type: "bool" }], id: "Envelope@tv-basicstudies-1", scriptIdPart: "", name: "Envelope" }, constructor: function() { this.f_0 = function(t, e, i) { return t ? e : i }, this.f_1 = function(t, e) { return t * (1 + e) }, this.f_2 = function(t, e) { return t * (1 - e) }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _, f, m, g; return this._context = t, this._input = e, i = o.Std.close(this._context), n = this._input(0), s = this._input(1), r = this._input(2), a = this._context.new_var(i), l = o.Std.ema(a, n, this._context), h = this._context.new_var(i), c = o.Std.sma(h, n, this._context), d = this.f_0(r, l, c), p = s / 100, u = this.f_1(d, p), _ = this.f_2(d, p), f = d, m = u, g = _, [f, m, g] } } }, {
        name: "Fisher Transform",
        metainfo: {
            _metainfoVersion: 41,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: {
                styles: {
                    plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" },
                    plot_1: {
                        linestyle: 0,
                        linewidth: 1,
                        plottype: 0,
                        trackPrice: !1,
                        transparency: 35,
                        visible: !0,
                        color: "#FF7F00"
                    }
                },
                precision: 4,
                bands: [{ color: "#FF7F00", linestyle: 2, linewidth: 1, visible: !0, value: 1.5 }, { color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: .75 }, { color: "#FF7F00", linestyle: 2, linewidth: 1, visible: !0, value: 0 }, { color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: -.75 }, { color: "#FF7F00", linestyle: 2, linewidth: 1, visible: !0, value: -1.5 }],
                inputs: { in_0: 9 }
            },
            plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }],
            styles: { plot_0: { title: "Fisher", histogramBase: 0, joinPoints: !1, isHidden: !1 }, plot_1: { title: "Trigger", histogramBase: 0, joinPoints: !1, isHidden: !1 } },
            description: "Fisher Transform",
            shortDescription: "Fisher",
            is_price_study: !1,
            bands: [{ id: "hline_0", name: "Level", isHidden: !1 }, { id: "hline_1", name: "Level", isHidden: !1 }, { id: "hline_2", name: "Level", isHidden: !1 }, { id: "hline_3", name: "Level", isHidden: !1 }, { id: "hline_4", name: "Level", isHidden: !1 }],
            inputs: [{ id: "in_0", name: "Length", defval: 9, type: "integer", min: 1, max: 1e12 }],
            id: "fisher_transform@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Fisher Transform"
        },
        constructor: function() {
            this.f_0 = function(t) { var e = o.Std.lt(t, -.99) ? -.999 : t; return [o.Std.gt(t, .99) ? .999 : e] }, this.f_1 = function() {
                var t, e, i, n = this._input(0),
                    s = this._context.new_var(o.Std.hl2(this._context)),
                    r = o.Std.highest(s, n, this._context),
                    a = this._context.new_var(o.Std.hl2(this._context)),
                    l = o.Std.lowest(a, n, this._context),
                    h = this._context.new_var(),
                    c = this.f_0(.66 * ((o.Std.hl2(this._context) - l) / o.Std.max(r - l, .001) - .5) + .67 * o.Std.nz(h.get(1)));
                return h.set(c[0]), t = this._context.new_var(), t.set(.5 * o.Std.log((1 + h.get(0)) / o.Std.max(1 - h.get(0), .001)) + .5 * o.Std.nz(t.get(1))), e = t.get(1), i = t.get(0), [i, e]
            }, this.main = function(t, e) { return this._context = t, this._input = e, this.f_1() }
        }
    }, {
        name: "Historical Volatility",
        metainfo: { _metainfoVersion: 41, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" } }, precision: 4, inputs: { in_0: 10 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1, isHidden: !1 } }, description: "Historical Volatility", shortDescription: "HV", is_price_study: !1, inputs: [{ id: "in_0", name: "length", defval: 10, type: "integer", min: 1, max: 1e12 }], id: "historical_volatility@tv-basicstudies-1", scriptIdPart: "", name: "Historical Volatility" },
        constructor: function() {
            this.f_0 = function() {
                var t = this._input(0),
                    e = o.Std.or(o.Std.isintraday(this._context), o.Std.and(o.Std.isdaily(this._context), o.Std.eq(o.Std.interval(this._context), 1))) ? 1 : 7,
                    i = this._context.new_var(o.Std.close(this._context)),
                    n = this._context.new_var(o.Std.log(o.Std.close(this._context) / i.get(1)));
                return [100 * o.Std.stdev(n, t, this._context) * o.Std.sqrt(365 / e)]
            }, this.main = function(t, e) { return this._context = t, this._input = e, this.f_0() }
        }
    }, {
        name: "Hull MA",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#000080" } }, precision: 4, inputs: { in_0: 9 } },
            plots: [{ id: "plot_0", type: "line" }],
            styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } },
            description: "Hull Moving Average",
            shortDescription: "HMA",
            is_price_study: !0,
            inputs: [{ id: "in_0", name: "length", defval: 9, type: "integer", min: 1, max: 1e4 }],
            id: "Hull MA@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Hull MA"
        },
        constructor: function() { this.f_0 = function(t, e) { return 2 * t - e }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _, f; return this._context = t, this._input = e, i = o.Std.close(this._context), n = this._input(0), s = n / 2, r = this._context.new_var(i), a = o.Std.wma(r, s, this._context), l = this._context.new_var(i), h = o.Std.wma(l, n, this._context), c = this.f_0(a, h), d = o.Std.sqrt(n), p = o.Std.round(d), u = this._context.new_var(c), _ = o.Std.wma(u, p, this._context), f = _, [f] } }
    }, {
        name: "Ichimoku Cloud",
        metainfo: { _metainfoVersion: 42, isTVScript: !1, isTVScriptStub: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0496ff" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#991515" }, plot_2: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#459915" }, plot_3: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#008000" }, plot_4: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, palettes: { palette_0: { colors: { 0: { color: "#008000", width: 1, style: 0 }, 1: { color: "#FF0000", width: 1, style: 0 } } } }, filledAreasStyle: { fill_0: { color: "#000080", transparency: 90, visible: !0 } }, inputs: { in_0: 9, in_1: 26, in_2: 52, in_3: 26 } }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }, { id: "plot_2", type: "line" }, { id: "plot_3", type: "line" }, { id: "plot_4", type: "line" }, { id: "plot_5", palette: "palette_0", target: "fill_0", type: "colorer" }], styles: { plot_0: { title: "Conversion Line", histogramBase: 0, joinPoints: !1, isHidden: !1 }, plot_1: { title: "Base Line", histogramBase: 0, joinPoints: !1, isHidden: !1 }, plot_2: { title: "Lagging Span", histogramBase: 0, joinPoints: !1, isHidden: !1 }, plot_3: { title: "Lead 1", histogramBase: 0, joinPoints: !1, isHidden: !1 }, plot_4: { title: "Lead 2", histogramBase: 0, joinPoints: !1, isHidden: !1 } }, description: "Ichimoku Cloud", shortDescription: "Ichimoku", is_price_study: !0, is_hidden_study: !1, id: "Ichimoku Cloud@tv-basicstudies-1", palettes: { palette_0: { colors: { 0: { name: "Color 0" }, 1: { name: "Color 1" } }, valToIndex: { 0: 0, 1: 1 } } }, filledAreas: [{ id: "fill_0", objAId: "plot_3", objBId: "plot_4", type: "plot_plot", title: "Plots Background", isHidden: !1, palette: "palette_0" }], inputs: [{ id: "in_0", name: "Conversion Line Periods", defval: 9, type: "integer", min: 1, max: 1e12 }, { id: "in_1", name: "Base Line Periods", defval: 26, type: "integer", min: 1, max: 1e12 }, { id: "in_2", name: "Lagging Span 2 Periods", defval: 52, type: "integer", min: 1, max: 1e12 }, { id: "in_3", name: "Displacement", defval: 26, type: "integer", min: 1, max: 1e12 }], scriptIdPart: "", name: "Ichimoku Cloud" },
        constructor: function() {
            this.donchian = function(t) {
                    var e = this._context.new_var(o.Std.low(this._context)),
                        i = this._context.new_var(o.Std.high(this._context));
                    return o.Std.avg(o.Std.lowest(e, t, this._context), o.Std.highest(i, t, this._context))
                },
                this.f_1 = function() {
                    var t = this._input(0),
                        e = this._input(1),
                        i = this._input(2),
                        n = this._input(3),
                        s = this.donchian(t),
                        r = this.donchian(e),
                        a = o.Std.avg(s, r),
                        l = this.donchian(i);
                    return [s, r, o.Std.close(this._context), a, l, -n, n, n, o.Std.gt(a, l) ? 0 : 1]
                }, this.main = function(t, e) { this._context = t, this._input = e; var i = this.f_1(); return [i[0], i[1], { value: i[2], offset: i[5] }, { value: i[3], offset: i[6] }, { value: i[4], offset: i[7] }, i[8]] }
        }
    }, { name: "Keltner Channels", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" }, plot_2: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" } }, precision: 4, filledAreasStyle: { fill_0: { color: "#0000FF", transparency: 90, visible: !0 } }, inputs: { in_0: !0, in_1: 20, in_2: 1 } }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }, { id: "plot_2", type: "line" }], styles: { plot_0: { title: "Upper", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "Middle", histogramBase: 0, joinPoints: !1 }, plot_2: { title: "Lower", histogramBase: 0, joinPoints: !1 } }, description: "Keltner Channels", shortDescription: "KC", is_price_study: !0, filledAreas: [{ id: "fill_0", objAId: "plot_0", objBId: "plot_2", type: "plot_plot", title: "Plots Background" }], inputs: [{ id: "in_0", name: "useTrueRange", defval: !0, type: "bool" }, { id: "in_1", name: "length", defval: 20, type: "integer", min: 1, max: 2e3 }, { id: "in_2", name: "mult", defval: 1, type: "float", min: -1e12, max: 1e12 }], id: "Keltner Channels@tv-basicstudies-1", scriptIdPart: "", name: "Keltner Channels" }, constructor: function() { this.f_0 = function(t, e, i, o) { return t ? e : i - o }, this.f_1 = function(t, e, i) { return t + e * i }, this.f_2 = function(t, e, i) { return t - e * i }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _, f, m; return this._context = t, this._input = e, i = o.Std.close(this._context), n = this._input(0), s = this._input(1), r = this._input(2), a = this._context.new_var(i), l = o.Std.ema(a, s, this._context), h = this.f_0(n, o.Std.tr(this._context), o.Std.high(this._context), o.Std.low(this._context)), c = this._context.new_var(h), d = o.Std.ema(c, s, this._context), p = this.f_1(l, d, r), u = this.f_2(l, d, r), _ = p, f = l, m = u, [_, f, m] } } }, {
        name: "Klinger Oscillator",
        metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#000080" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#008000" } }, precision: 4, inputs: {} }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "Signal", histogramBase: 0, joinPoints: !1 } }, description: "Klinger Oscillator", shortDescription: "Klinger Oscillator", is_price_study: !1, inputs: [], id: "Klinger Oscillator@tv-basicstudies-1", scriptIdPart: "", name: "Klinger Oscillator" },
        constructor: function() {
            this.f_0 = function(t, e) { return o.Std.ge(t, 0) ? e : -e }, this.f_1 = function(t, e) { return t - e },
                this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _, f; return this._context = t, this._input = e, i = o.Std.hlc3(this._context), n = this._context.new_var(i), s = o.Std.change(n), r = this.f_0(s, o.Std.volume(this._context)), a = this._context.new_var(r), l = o.Std.ema(a, 34, this._context), h = this._context.new_var(r), c = o.Std.ema(h, 55, this._context), d = this.f_1(l, c), p = this._context.new_var(d), u = o.Std.ema(p, 13, this._context), _ = d, f = u, [_, f] }
        }
    }, { name: "Know Sure Thing", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#008000" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 0 }], inputs: { in_0: 10, in_1: 15, in_2: 20, in_3: 30, in_4: 10, in_5: 10, in_6: 10, in_7: 15, in_8: 9 } }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }], styles: { plot_0: { title: "KST", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "Signal", histogramBase: 0, joinPoints: !1 } }, description: "Know Sure Thing", shortDescription: "KST", is_price_study: !1, bands: [{ id: "hline_0", name: "Zero" }], inputs: [{ id: "in_0", name: "roclen1", defval: 10, type: "integer", min: 1, max: 2e3 }, { id: "in_1", name: "roclen2", defval: 15, type: "integer", min: 1, max: 2e3 }, { id: "in_2", name: "roclen3", defval: 20, type: "integer", min: 1, max: 2e3 }, { id: "in_3", name: "roclen4", defval: 30, type: "integer", min: 1, max: 2e3 }, { id: "in_4", name: "smalen1", defval: 10, type: "integer", min: 1, max: 2e3 }, { id: "in_5", name: "smalen2", defval: 10, type: "integer", min: 1, max: 2e3 }, { id: "in_6", name: "smalen3", defval: 10, type: "integer", min: 1, max: 2e3 }, { id: "in_7", name: "smalen4", defval: 15, type: "integer", min: 1, max: 2e3 }, { id: "in_8", name: "siglen", defval: 9, type: "integer", min: 1, max: 2e3 }], id: "Know Sure Thing@tv-basicstudies-1", scriptIdPart: "", name: "Know Sure Thing" }, constructor: function() { this.f_0 = function(t, e, i, o) { return t + 2 * e + 3 * i + 4 * o }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _, f, m, g, v, y, b, w, S, T, C, x, P, L, k, I, A, E, M, D, O, $, V, B, R, N, F, z; return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = this._input(2), r = this._input(3), a = this._input(4), l = this._input(5), h = this._input(6), c = this._input(7), d = this._input(8), p = o.Std.close(this._context), u = i, _ = this._context.new_var(p), f = o.Std.roc(_, u), m = a, g = this._context.new_var(f), v = o.Std.sma(g, m, this._context), y = n, b = this._context.new_var(p), w = o.Std.roc(b, y), S = l, T = this._context.new_var(w), C = o.Std.sma(T, S, this._context), x = s, P = this._context.new_var(p), L = o.Std.roc(P, x), k = h, I = this._context.new_var(L), A = o.Std.sma(I, k, this._context), E = r, M = this._context.new_var(p), D = o.Std.roc(M, E), O = c, $ = this._context.new_var(D), V = o.Std.sma($, O, this._context), B = this.f_0(v, C, A, V), R = this._context.new_var(B), N = o.Std.sma(R, d, this._context), F = B, z = N, [F, z] } } }, {
        name: "Least Squares Moving Average",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#000080" } }, precision: 4, inputs: { in_0: 25, in_1: 0 } },
            plots: [{ id: "plot_0", type: "line" }],
            styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } },
            description: "Least Squares Moving Average",
            shortDescription: "LSMA",
            is_price_study: !0,
            inputs: [{ id: "in_0", name: "Length", defval: 25, type: "integer", min: 1, max: 1e12 }, { id: "in_1", name: "Offset", defval: 0, type: "integer", min: -1e12, max: 1e12 }],
            id: "Least Squares Moving Average@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Least Squares Moving Average"
        },
        constructor: function() { this.main = function(t, e) { var i, n, s, r, a, l; return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = o.Std.close(this._context), r = this._context.new_var(s), a = o.Std.linreg(r, i, n), l = a, [l] } }
    }, { name: "Linear Regression Curve", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#000080" } }, precision: 4, inputs: { in_0: 9 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Linear Regression Curve", shortDescription: "LRC", is_price_study: !0, inputs: [{ id: "in_0", name: "Length", defval: 9, type: "integer", min: 1, max: 2e3 }], id: "Linear Regression Curve@tv-basicstudies-1", scriptIdPart: "", name: "Linear Regression Curve" }, constructor: function() { this.main = function(t, e) { var i, n, s, r, a; return this._context = t, this._input = e, i = o.Std.close(this._context), n = this._input(0), s = this._context.new_var(i), r = o.Std.linreg(s, n, 0), a = r, [a] } } }, { name: "MA Cross", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#008000" }, plot_2: { linestyle: 0, linewidth: 4, plottype: 3, trackPrice: !1, transparency: 35, visible: !0, color: "#000080" } }, precision: 4, inputs: { in_0: 9, in_1: 26 } }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }, { id: "plot_2", type: "line" }], styles: { plot_0: { title: "Short", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "Long", histogramBase: 0, joinPoints: !1 }, plot_2: { title: "Crosses", histogramBase: 0, joinPoints: !1 } }, description: "MA Cross", shortDescription: "MA Cross", is_price_study: !0, inputs: [{ id: "in_0", name: "Short", defval: 9, type: "integer", min: 1, max: 2e3 }, { id: "in_1", name: "Long", defval: 26, type: "integer", min: 1, max: 2e3 }], id: "MA Cross@tv-basicstudies-1", scriptIdPart: "", name: "MA Cross" }, constructor: function() { this.f_0 = function(t, e) { return t ? e : o.Std.na() }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u; return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = o.Std.close(this._context), r = this._context.new_var(s), a = o.Std.sma(r, i, this._context), l = this._context.new_var(s), h = o.Std.sma(l, n, this._context), c = a, d = h, p = o.Std.cross(a, h, this._context), u = this.f_0(p, a), [c, d, u] } } }, {
        name: "MA with EMA Cross",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: {
                styles: {
                    plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" },
                    plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#008000" },
                    plot_2: { linestyle: 0, linewidth: 4, plottype: 3, trackPrice: !1, transparency: 35, visible: !0, color: "#000080" }
                },
                precision: 4,
                inputs: { in_0: 10, in_1: 10 }
            },
            plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }, { id: "plot_2", type: "line" }],
            styles: { plot_0: { title: "MA", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "EMA", histogramBase: 0, joinPoints: !1 }, plot_2: { title: "Crosses", histogramBase: 0, joinPoints: !1 } },
            description: "MA with EMA Cross",
            shortDescription: "MA/EMA Cross",
            is_price_study: !0,
            inputs: [{ id: "in_0", name: "Length MA", defval: 10, type: "integer", min: 1, max: 2e3 }, { id: "in_1", name: "Length EMA", defval: 10, type: "integer", min: 1, max: 2e3 }],
            id: "MA with EMA Cross@tv-basicstudies-1",
            scriptIdPart: "",
            name: "MA with EMA Cross"
        },
        constructor: function() { this.f_0 = function(t, e) { return t ? e : o.Std.na() }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u; return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = o.Std.close(this._context), r = this._context.new_var(s), a = o.Std.sma(r, i, this._context), l = this._context.new_var(s), h = o.Std.ema(l, n, this._context), c = a, d = h, p = o.Std.cross(a, h, this._context), u = this.f_0(p, a), [c, d, u] } }
    }, { name: "Mass Index", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#000080" } }, precision: 4, inputs: { in_0: 10 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Mass Index", shortDescription: "Mass Index", is_price_study: !1, inputs: [{ id: "in_0", name: "length", defval: 10, type: "integer", min: 1, max: 2e3 }], id: "Mass Index@tv-basicstudies-1", scriptIdPart: "", name: "Mass Index" }, constructor: function() { this.f_0 = function(t, e) { return t - e }, this.f_1 = function(t, e) { return t / e }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p; return this._context = t, this._input = e, i = this._input(0), n = this.f_0(o.Std.high(this._context), o.Std.low(this._context)), s = this._context.new_var(n), r = o.Std.ema(s, 9, this._context), a = this._context.new_var(r), l = o.Std.ema(a, 9, this._context), h = this.f_1(r, l), c = this._context.new_var(h), d = o.Std.sum(c, i, this._context), p = d, [p] } } }, {
        name: "McGinley Dynamic",
        metainfo: { _metainfoVersion: 42, isTVScript: !1, isTVScriptStub: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#000080" } }, precision: 4, inputs: { in_0: 14 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1, isHidden: !1 } }, description: "McGinley Dynamic", shortDescription: "McGinley Dynamic", is_price_study: !0, is_hidden_study: !1, id: "mcginley_dynamic@tv-basicstudies-1", inputs: [{ id: "in_0", name: "length", defval: 14, type: "integer", min: 1, max: 1e12 }], scriptIdPart: "", name: "McGinley Dynamic" },
        constructor: function() {
            this.f_0 = function() {
                var t, e = this._input(0),
                    i = o.Std.close(this._context),
                    n = this._context.new_var(i),
                    s = o.Std.ema(n, e, this._context),
                    r = this._context.new_var(),
                    a = r.get(1) + (i - r.get(1)) / (e * o.Std.pow(i / r.get(1), 4));
                return r.set(o.Std.na(r.get(1)) ? s : a), t = r.get(0), [t]
            }, this.main = function(t, e) { return this._context = t, this._input = e, this.f_0() }
        }
    }, { name: "Momentum", metainfo: { _metainfoVersion: 30, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#808000" } }, precision: 4, inputs: { in_0: 10, in_1: "close" } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Mom", histogramBase: 0, joinPoints: !1, isHidden: !1 } }, description: "Momentum", shortDescription: "Mom", is_price_study: !1, inputs: [{ id: "in_0", name: "Length", defval: 10, type: "integer", min: 1, max: 2e3 }, { id: "in_1", name: "Source", defval: "close", type: "source", options: ["open", "high", "low", "close", "hl2", "hlc3", "ohlc4"] }], id: "Momentum@tv-basicstudies-1", scriptIdPart: "", name: "Momentum" }, constructor: function() { this.main = function(t, e) { var i, n, s, r, a; return this._context = t, this._input = e, i = this._input(0), n = o.Std[this._input(1)](this._context), s = this._context.new_var(n), r = s.get(i), a = r ? n - r : null, [a] } } }, { name: "Money Flow", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#459915" } }, precision: 4, bands: [{ color: "#c0c0c0", linestyle: 2, linewidth: 1, visible: !0, value: 80 }, { color: "#c0c0c0", linestyle: 2, linewidth: 1, visible: !0, value: 20 }], filledAreasStyle: { fill_0: { color: "#9915ff", transparency: 90, visible: !0 } }, inputs: { in_0: 14 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Money Flow", shortDescription: "MFI", is_price_study: !1, bands: [{ id: "hline_0", name: "UpperLimit" }, { id: "hline_1", name: "LowerLimit" }], filledAreas: [{ id: "fill_0", objAId: "hline_0", objBId: "hline_1", type: "hline_hline", title: "Hlines Background" }], inputs: [{ id: "in_0", name: "Length", defval: 14, type: "integer", min: 1, max: 2e3 }], id: "Money Flow@tv-basicstudies-1", scriptIdPart: "", name: "Money Flow" }, constructor: function() { this.f_0 = function(t, e, i) { return t * (o.Std.le(e, 0) ? 0 : i) }, this.f_1 = function(t, e, i) { return t * (o.Std.ge(e, 0) ? 0 : i) }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _; return this._context = t, this._input = e, i = this._input(0), n = o.Std.hlc3(this._context), s = this._context.new_var(n), r = o.Std.change(s), a = this.f_0(o.Std.volume(this._context), r, n), l = this._context.new_var(a), h = o.Std.sum(l, i, this._context), c = this.f_1(o.Std.volume(this._context), r, n), d = this._context.new_var(c), p = o.Std.sum(d, i, this._context), u = o.Std.rsi(h, p), _ = u, [_] } } }, {
        name: "Moving Average",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" } }, precision: 4, inputs: { in_0: 9, in_1: "close", in_2: 0 } },
            plots: [{ id: "plot_0", type: "line" }],
            styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } },
            description: "Moving Average",
            shortDescription: "MA",
            is_price_study: !0,
            inputs: [{ id: "in_0", name: "Length", defval: 9, type: "integer", min: 1, max: 1e4 }, {
                id: "in_1",
                name: "Source",
                defval: "close",
                type: "source",
                options: ["open", "high", "low", "close", "hl2", "hlc3", "ohlc4"]
            }, { id: "in_2", name: "Offset", defval: 0, type: "integer", min: -1e4, max: 1e4 }],
            id: "Moving Average@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Moving Average"
        },
        constructor: function() { this.main = function(t, e) { var i, n, s, r, a, l; return this._context = t, this._input = e, i = o.Std[this._input(1)](this._context), n = this._input(0), s = this._input(2), r = this._context.new_var(i), a = o.Std.sma(r, n, this._context), l = a, [{ value: l, offset: s }] } }
    }, { name: "Moving Average Channel", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#CC0000" } }, precision: 4, filledAreasStyle: { fill_0: { color: "#A2C4C9", transparency: 90, visible: !0 } }, inputs: { in_0: 20, in_1: 20, in_2: 0, in_3: 0 } }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }], styles: { plot_0: { title: "Upper", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "Lower", histogramBase: 0, joinPoints: !1 } }, filledAreas: [{ id: "fill_0", objAId: "plot_0", objBId: "plot_1", type: "plot_plot", title: "Plots Background" }], description: "Moving Average Channel", shortDescription: "MAC", is_price_study: !0, inputs: [{ id: "in_0", name: "Upper Length", defval: 20, type: "integer", min: 1, max: 1e4 }, { id: "in_1", name: "Lower Length", defval: 20, type: "integer", min: 1, max: 1e4 }, { id: "in_2", name: "Upper Offset", defval: 0, type: "integer", min: -1e4, max: 1e4 }, { id: "in_3", name: "Lower Offset", defval: 0, type: "integer", min: -1e4, max: 1e4 }], id: "Moving Average Channel@tv-basicstudies-1", scriptIdPart: "", name: "Moving Average Channel" }, constructor: function() { this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p; return this._context = t, this._input = e, i = o.Std.high(this._context), n = o.Std.low(this._context), s = this._input(0), r = this._input(1), a = this._input(2), l = this._input(3), h = this._context.new_var(i), c = this._context.new_var(n), d = o.Std.sma(h, s, this._context), p = o.Std.sma(c, r, this._context), [{ value: d, offset: a }, { value: p, offset: l }] } } }, {
        name: "Moving Average Convergence/Divergence",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 1, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" }, plot_2: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, inputs: { in_0: 12, in_1: 26, in_3: "close", in_2: 9 } },
            plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }, { id: "plot_2", type: "line" }],
            styles: { plot_0: { title: "Histogram", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "MACD", histogramBase: 0, joinPoints: !1 }, plot_2: { title: "Signal", histogramBase: 0, joinPoints: !1 } },
            description: "MACD",
            shortDescription: "MACD",
            is_price_study: !1,
            inputs: [{ id: "in_0", name: "fastLength", defval: 12, type: "integer", min: 1, max: 2e3 }, { id: "in_1", name: "slowLength", defval: 26, type: "integer", min: 1, max: 2e3 }, {
                id: "in_3",
                name: "Source",
                defval: "close",
                type: "source",
                options: ["open", "high", "low", "close", "hl2", "hlc3", "ohlc4"]
            }, { id: "in_2", name: "signalLength", defval: 9, type: "integer", min: 1, max: 50 }],
            id: "Moving Average Convergence/Divergence@tv-basicstudies-1",
            scriptIdPart: "",
            name: "MACD"
        },
        constructor: function() { this.f_0 = function(t, e) { return t - e }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _, f, m, g; return this._context = t, this._input = e, i = o.Std[this._input(2)](this._context), n = this._input(0), s = this._input(1), r = this._input(3), a = this._context.new_var(i), l = o.Std.ema(a, n, this._context), h = this._context.new_var(i), c = o.Std.ema(h, s, this._context), d = this.f_0(l, c), p = this._context.new_var(d), u = o.Std.sma(p, r, this._context), _ = this.f_0(d, u), f = _, m = d, g = u, [f, m, g] } }
    }, { name: "Moving Average Exponential", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" } }, precision: 4, inputs: { in_0: 9, in_1: "close", in_2: 0 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Moving Average Exponential", shortDescription: "EMA", is_price_study: !0, inputs: [{ id: "in_0", name: "Length", defval: 9, type: "integer", min: 1, max: 1e4 }, { id: "in_1", name: "Source", defval: "close", type: "source", options: ["open", "high", "low", "close", "hl2", "hlc3", "ohlc4"] }, { id: "in_2", name: "Offset", defval: 0, type: "integer", min: -1e4, max: 1e4 }], id: "Moving Average Exponential@tv-basicstudies-1", scriptIdPart: "", name: "Moving Average Exponential" }, constructor: function() { this.main = function(t, e) { var i, n, s, r, a, l; return this._context = t, this._input = e, i = o.Std[this._input(1)](this._context), n = this._input(0), s = this._input(2), r = this._context.new_var(i), a = o.Std.ema(r, n, this._context), l = a, [{ value: l, offset: s }] } } }, { name: "Moving Average Weighted", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" } }, precision: 4, inputs: { in_0: 9, in_1: "close", in_2: 0 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Moving Average Weighted", shortDescription: "WMA", is_price_study: !0, inputs: [{ id: "in_0", name: "Length", defval: 9, type: "integer", min: 1, max: 2e3 }, { id: "in_1", name: "Source", defval: "close", type: "source", options: ["open", "high", "low", "close", "hl2", "hlc3", "ohlc4"] }, { id: "in_2", name: "Offset", defval: 0, type: "integer", min: -1e4, max: 1e4 }], id: "Moving Average Weighted@tv-basicstudies-1", scriptIdPart: "", name: "Moving Average Weighted" }, constructor: function() { this.main = function(t, e) { var i, n, s, r, a, l; return this._context = t, this._input = e, i = o.Std[this._input(1)](this._context), n = this._input(0), s = this._input(2), r = this._context.new_var(i), a = o.Std.wma(r, n, this._context), l = a, [{ value: l, offset: s }] } } }, {
        name: "Net Volume",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: {
                styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" } },
                precision: 4,
                inputs: {}
            },
            plots: [{ id: "plot_0", type: "line" }],
            styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } },
            description: "Net Volume",
            shortDescription: "Net Volume",
            is_price_study: !1,
            inputs: [],
            id: "Net Volume@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Net Volume"
        },
        constructor: function() { this.f_0 = function(t, e, i) { return o.Std.gt(t, 0) ? e : o.Std.lt(i, 0) ? -e : 0 * e }, this.main = function(t, e) { var i, n, s, r, a; return this._context = t, this._input = e, i = o.Std.close(this._context), n = this._context.new_var(i), s = o.Std.change(n), r = this.f_0(s, o.Std.volume(this._context), s), a = r, [a] } }
    }, { name: "On Balance Volume", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" } }, precision: 4, inputs: {} }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "On Balance Volume", shortDescription: "OBV", is_price_study: !1, inputs: [], id: "On Balance Volume@tv-basicstudies-1", scriptIdPart: "", name: "On Balance Volume" }, constructor: function() { this.f_0 = function(t, e, i) { return o.Std.gt(t, 0) ? e : o.Std.lt(i, 0) ? -e : 0 * e }, this.main = function(t, e) { var i, n, s, r, a, l; return this._context = t, this._input = e, i = o.Std.close(this._context), n = this._context.new_var(i), s = o.Std.change(n), r = this.f_0(s, o.Std.volume(this._context), s), a = o.Std.cum(r, this._context), l = a, [l] } } }, { name: "Parabolic SAR", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 3, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" } }, precision: 4, inputs: { in_0: .02, in_1: .02, in_2: .2 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Parabolic SAR", shortDescription: "SAR", is_price_study: !0, inputs: [{ id: "in_0", name: "start", defval: .02, type: "float", min: -1e12, max: 1e12 }, { id: "in_1", name: "increment", defval: .02, type: "float", min: -1e12, max: 1e12 }, { id: "in_2", name: "maximum", defval: .2, type: "float", min: -1e12, max: 1e12 }], id: "Parabolic SAR@tv-basicstudies-1", scriptIdPart: "", name: "Parabolic SAR" }, constructor: function() { this.main = function(t, e) { var i, n, s, r, a; return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = this._input(2), r = o.Std.sar(i, n, s, this._context), a = r, [a] } } }, {
        name: "Price Channel",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0080" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0080" }, plot_2: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0496FF" } }, precision: 4, inputs: { in_0: 20, in_1: 0 } },
            plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }, { id: "plot_2", type: "line" }],
            styles: { plot_0: { title: "Highprice Line", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "Lowprice Line", histogramBase: 0, joinPoints: !1 }, plot_2: { title: "Centerprice Line", histogramBase: 0, joinPoints: !1 } },
            description: "Price Channel",
            shortDescription: "PC",
            is_price_study: !1,
            inputs: [{ id: "in_0", name: "Length", defval: 20, type: "integer", min: 1, max: 2e3 }, { id: "in_1", name: "Offset Length", defval: 0, type: "integer", min: 1, max: 2e3 }],
            id: "Price Channel@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Price Channel"
        },
        constructor: function() { this.main = function(t, e) { var i, n, s, r, a, l, h, c, d; return this._context = t, this._input = e, i = o.Std.high(this._context), n = this._context.new_var(i), s = o.Std.low(this._context), r = this._context.new_var(s), a = this._input(0), l = this._input(1), h = o.Std.highest(n, a, this._context), c = o.Std.lowest(r, a, this._context), d = o.Std.avg(h, c), [{ value: h, offset: l }, { value: c, offset: l }, { value: d, offset: l }] } }
    }, { name: "Price Oscillator", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" } }, precision: 4, inputs: { in_0: 10, in_1: 21 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Price Oscillator", shortDescription: "PPO", is_price_study: !1, inputs: [{ id: "in_0", name: "shortlen", defval: 10, type: "integer", min: 1, max: 2e3 }, { id: "in_1", name: "longlen", defval: 21, type: "integer", min: 1, max: 2e3 }], id: "Price Oscillator@tv-basicstudies-1", scriptIdPart: "", name: "Price Oscillator" }, constructor: function() { this.f_0 = function(t, e) { return (t - e) / e * 100 }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d; return this._context = t, this._input = e, i = o.Std.close(this._context), n = this._input(0), s = this._input(1), r = this._context.new_var(i), a = o.Std.sma(r, n, this._context), l = this._context.new_var(i), h = o.Std.sma(l, s, this._context), c = this.f_0(a, h), d = c, [d] } } }, { name: "Price Volume Trend", metainfo: { _metainfoVersion: 42, isTVScript: !1, isTVScriptStub: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" } }, precision: 4, inputs: {} }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "PVT", histogramBase: 0, joinPoints: !1, isHidden: !1 } }, description: "Price Volume Trend", shortDescription: "PVT", is_price_study: !1, is_hidden_study: !1, id: "price_volume_trend@tv-basicstudies-1", inputs: [], scriptIdPart: "", name: "Price Volume Trend" }, constructor: function() { this.f_0 = function() { var t = this._context.new_var(o.Std.close(this._context)); return [o.Std.cum(o.Std.change(t) / t.get(1) * o.Std.volume(this._context), this._context)] }, this.main = function(t, e) { return this._context = t, this._input = e, [this.f_0()[0]] } } }, {
        name: "Rate Of Change",
        metainfo: {
            _metainfoVersion: 41,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 0 }], inputs: { in_0: 9 } },
            plots: [{ id: "plot_0", type: "line" }],
            styles: { plot_0: { title: "ROC", histogramBase: 0, joinPoints: !1, isHidden: !1 } },
            description: "Rate Of Change",
            shortDescription: "ROC",
            is_price_study: !1,
            bands: [{ id: "hline_0", name: "Zero Line", isHidden: !1 }],
            inputs: [{
                id: "in_0",
                name: "length",
                defval: 9,
                type: "integer",
                min: 1,
                max: 1e12
            }],
            id: "rate_of_change@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Rate Of Change"
        },
        constructor: function() { this.main = function(t, e) { var i, n, s; return this._context = t, this._input = e, i = this._context.new_var(o.Std.close(this._context)), n = this._input(0), s = 100 * (i.get(0) - i.get(n)) / i.get(n), [s] } }
    }, { name: "Relative Strength Index", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#800080" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 70 }, { color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 30 }], filledAreasStyle: { fill_0: { color: "#800080", transparency: 90, visible: !0 } }, inputs: { in_0: 14 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Relative Strength Index", shortDescription: "RSI", is_price_study: !1, bands: [{ id: "hline_0", name: "UpperLimit" }, { id: "hline_1", name: "LowerLimit" }], filledAreas: [{ id: "fill_0", objAId: "hline_0", objBId: "hline_1", type: "hline_hline", title: "Hlines Background" }], inputs: [{ id: "in_0", name: "Length", defval: 14, type: "integer", min: 1, max: 2e3 }], id: "Relative Strength Index@tv-basicstudies-1", scriptIdPart: "", name: "Relative Strength Index" }, constructor: function() { this.f_0 = function(t) { return o.Std.max(t, 0) }, this.f_1 = function(t) { return -o.Std.min(t, 0) }, this.f_2 = function(t, e) { return o.Std.eq(t, 0) ? 100 : o.Std.eq(e, 0) ? 0 : 100 - 100 / (1 + e / t) }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _; return this._context = t, this._input = e, i = o.Std.close(this._context), n = this._input(0), s = this._context.new_var(i), r = o.Std.change(s), a = this.f_0(r), l = this._context.new_var(a), h = o.Std.rma(l, n, this._context), c = this.f_1(r), d = this._context.new_var(c), p = o.Std.rma(d, n, this._context), u = this.f_2(p, h), _ = u, [_] } } }, {
        name: "Relative Vigor Index",
        metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#008000" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, inputs: { in_0: 10 } }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }], styles: { plot_0: { title: "RVGI", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "Signal", histogramBase: 0, joinPoints: !1 } }, description: "Relative Vigor Index", shortDescription: "RVGI", is_price_study: !1, inputs: [{ id: "in_0", name: "Length", defval: 10, type: "integer", min: 1, max: 2e3 }], id: "Relative Vigor Index@tv-basicstudies-1", scriptIdPart: "", name: "Relative Vigor Index" },
        constructor: function() {
            this.f_0 = function(t, e) { return t - e }, this.f_1 = function(t, e) { return t / e }, this.main = function(t, e) {
                var i, n, s, r, a, l, h, c, d, p, u, _, f, m, g, v;
                return this._context = t, this._input = e, i = this._input(0), n = this.f_0(o.Std.close(this._context), o.Std.open(this._context)), s = this._context.new_var(n), r = o.Std.swma(s, this._context), a = this._context.new_var(r), l = o.Std.sum(a, i, this._context),
                    h = this.f_0(o.Std.high(this._context), o.Std.low(this._context)), c = this._context.new_var(h), d = o.Std.swma(c, this._context), p = this._context.new_var(d), u = o.Std.sum(p, i, this._context), _ = this.f_1(l, u), f = this._context.new_var(_), m = o.Std.swma(f, this._context), g = _, v = m, [g, v]
            }
        }
    }, { name: "Relative Volatility Index", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#000080" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 80 }, { color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 20 }], filledAreasStyle: { fill_0: { color: "#808000", transparency: 90, visible: !0 } }, inputs: { in_0: 10 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Relative Volatility Index", shortDescription: "RVI", is_price_study: !1, bands: [{ id: "hline_0", name: "UpperLimit" }, { id: "hline_1", name: "LowerLimit" }], filledAreas: [{ id: "fill_0", objAId: "hline_0", objBId: "hline_1", type: "hline_hline", title: "Hlines Background" }], inputs: [{ id: "in_0", name: "length", defval: 10, type: "integer", min: 1, max: 2e3 }], id: "Relative Volatility Index@tv-basicstudies-1", scriptIdPart: "", name: "Relative Volatility Index" }, constructor: function() { this.f_0 = function(t, e) { return o.Std.le(t, 0) ? 0 : e }, this.f_1 = function(t, e) { return o.Std.gt(t, 0) ? 0 : e }, this.f_2 = function(t, e) { return t / (t + e) * 100 }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _, f, m; return this._context = t, this._input = e, i = this._input(0), n = o.Std.close(this._context), s = this._context.new_var(n), r = o.Std.stdev(s, i, this._context), a = this._context.new_var(n), l = o.Std.change(a), h = this.f_0(l, r), c = this._context.new_var(h), d = o.Std.ema(c, 14, this._context), p = this.f_1(l, r), u = this._context.new_var(p), _ = o.Std.ema(u, 14, this._context), f = this.f_2(d, _), m = f, [m] } } }, {
        name: "SMI Ergodic Indicator/Oscillator",
        metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF7F00" }, plot_2: { linestyle: 0, linewidth: 1, plottype: 1, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, inputs: { in_0: 5, in_1: 20, in_2: 5 } }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }, { id: "plot_2", type: "line" }], styles: { plot_0: { title: "Indicator", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "Signal", histogramBase: 0, joinPoints: !1 }, plot_2: { title: "Oscillator", histogramBase: 0, joinPoints: !1 } }, description: "SMI Ergodic Indicator/Oscillator", shortDescription: "SMIIO", is_price_study: !1, inputs: [{ id: "in_0", name: "shortlen", defval: 5, type: "integer", min: 1, max: 2e3 }, { id: "in_1", name: "longlen", defval: 20, type: "integer", min: 1, max: 2e3 }, { id: "in_2", name: "siglen", defval: 5, type: "integer", min: 1, max: 2e3 }], id: "SMI Ergodic Indicator/Oscillator@tv-basicstudies-1", scriptIdPart: "", name: "SMI Ergodic Indicator/Oscillator" },
        constructor: function() {
            this.f_0 = function(t, e) { return t - e },
                this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _; return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = this._input(2), r = o.Std.close(this._context), a = this._context.new_var(r), l = o.Std.tsi(a, i, n, this._context), h = this._context.new_var(l), c = o.Std.ema(h, s, this._context), d = this.f_0(l, c), p = l, u = c, _ = d, [p, u, _] }
        }
    }, {
        name: "Smoothed Moving Average",
        metainfo: { _metainfoVersion: 41, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, inputs: { in_0: 7, in_1: "close" } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1, isHidden: !1 } }, description: "Smoothed Moving Average", shortDescription: "SMMA", is_price_study: !0, inputs: [{ id: "in_0", name: "Length", defval: 7, type: "integer", min: 1, max: 1e12 }, { id: "in_1", name: "Source", defval: "close", type: "source", options: ["open", "high", "low", "close", "hl2", "hlc3", "ohlc4"] }], id: "smoothed_moving_average@tv-basicstudies-1", scriptIdPart: "", name: "Smoothed Moving Average" },
        constructor: function() {
            this.f_0 = function() {
                var t, e = this._input(0),
                    i = o.Std[this._input(1)](this._context),
                    n = this._context.new_var(i),
                    s = o.Std.sma(n, e, this._context),
                    r = this._context.new_var(),
                    a = (r.get(1) * (e - 1) + i) / e;
                return r.set(o.Std.na(r.get(1)) ? s : a), t = r.get(0), [t]
            }, this.main = function(t, e) { return this._context = t, this._input = e, this.f_0() }
        }
    }, {
        name: "Stochastic",
        metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 80 }, { color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 20 }], filledAreasStyle: { fill_0: { color: "#800080", transparency: 75, visible: !0 } }, inputs: { in_0: 14, in_1: 1, in_2: 3 } }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }], styles: { plot_0: { title: "%K", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "%D", histogramBase: 0, joinPoints: !1 } }, description: "Stochastic", shortDescription: "Stoch", is_price_study: !1, bands: [{ id: "hline_0", name: "UpperLimit" }, { id: "hline_1", name: "LowerLimit" }], filledAreas: [{ id: "fill_0", objAId: "hline_0", objBId: "hline_1", type: "hline_hline", title: "Hlines Background" }], inputs: [{ id: "in_0", name: "length", defval: 14, type: "integer", min: 1, max: 1e4 }, { id: "in_1", name: "smoothK", defval: 1, type: "integer", min: 1, max: 1e4 }, { id: "in_2", name: "smoothD", defval: 3, type: "integer", min: 1, max: 1e4 }], id: "Stochastic@tv-basicstudies-1", scriptIdPart: "", name: "Stochastic" },
        constructor: function() {
            this.main = function(t, e) {
                var i, n, s, r, a, l, h, c, d, p, u, _, f, m, g, v;
                return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = this._input(2), r = o.Std.close(this._context), a = o.Std.high(this._context), l = o.Std.low(this._context), h = this._context.new_var(r), c = this._context.new_var(a), d = this._context.new_var(l), p = o.Std.stoch(h, c, d, i, this._context), u = this._context.new_var(p),
                    _ = o.Std.sma(u, n, this._context), f = this._context.new_var(_), m = o.Std.sma(f, s, this._context), g = _, v = m, [g, v]
            }
        }
    }, { name: "Stochastic RSI", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 80 }, { color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 20 }], filledAreasStyle: { fill_0: { color: "#800080", transparency: 80, visible: !0 } }, inputs: { in_0: 14, in_1: 14, in_2: 3, in_3: 3 } }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }], styles: { plot_0: { title: "%K", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "%D", histogramBase: 0, joinPoints: !1 } }, description: "Stochastic RSI", shortDescription: "Stoch RSI", is_price_study: !1, bands: [{ id: "hline_0", name: "UpperLimit" }, { id: "hline_1", name: "LowerLimit" }], filledAreas: [{ id: "fill_0", objAId: "hline_0", objBId: "hline_1", type: "hline_hline", title: "Hlines Background" }], inputs: [{ id: "in_0", name: "lengthRSI", defval: 14, type: "integer", min: 1, max: 1e4 }, { id: "in_1", name: "lengthStoch", defval: 14, type: "integer", min: 1, max: 1e4 }, { id: "in_2", name: "smoothK", defval: 3, type: "integer", min: 1, max: 1e4 }, { id: "in_3", name: "smoothD", defval: 3, type: "integer", min: 1, max: 1e4 }], id: "Stochastic RSI@tv-basicstudies-1", scriptIdPart: "", name: "Stochastic RSI" }, constructor: function() { this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _, f, m, g, v; return this._context = t, this._input = e, i = o.Std.close(this._context), n = this._input(0), s = this._input(1), r = this._input(2), a = this._input(3), l = o.Std.rsi(i, n), h = this._context.new_var(l), c = this._context.new_var(l), d = this._context.new_var(l), p = o.Std.stoch(h, c, d, s, this._context), u = this._context.new_var(p), _ = o.Std.sma(u, r, this._context), f = this._context.new_var(_), m = o.Std.sma(f, a, this._context), g = _, v = m, [g, v] } } }, {
        name: "TRIX",
        metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#800000" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 0 }], inputs: { in_0: 18 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "TRIX", histogramBase: 0, joinPoints: !1 } }, description: "TRIX", shortDescription: "TRIX", is_price_study: !1, bands: [{ id: "hline_0", name: "Zero" }], inputs: [{ id: "in_0", name: "length", defval: 18, type: "integer", min: 1, max: 2e3 }], id: "TRIX@tv-basicstudies-1", scriptIdPart: "", name: "TRIX" },
        constructor: function() {
            this.f_0 = function(t) { return o.Std.log(t) }, this.f_1 = function(t) { return 1e4 * t }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _; return this._context = t, this._input = e, i = this._input(0), n = this.f_0(o.Std.close(this._context)), s = this._context.new_var(n), r = o.Std.ema(s, i, this._context), a = this._context.new_var(r), l = o.Std.ema(a, i, this._context), h = this._context.new_var(l), c = o.Std.ema(h, i, this._context), d = this._context.new_var(c), p = o.Std.change(d), u = this.f_1(p), _ = u, [_] }
        }
    }, { name: "Triple EMA", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#008000" } }, precision: 4, inputs: { in_0: 9 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Triple EMA", shortDescription: "TEMA", is_price_study: !0, inputs: [{ id: "in_0", name: "length", defval: 9, type: "integer", min: 1, max: 1e4 }], id: "Triple EMA@tv-basicstudies-1", scriptIdPart: "", name: "Triple EMA" }, constructor: function() { this.f_0 = function(t, e, i) { return 3 * (t - e) + i }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p; return this._context = t, this._input = e, i = this._input(0), n = o.Std.close(this._context), s = this._context.new_var(n), r = o.Std.ema(s, i, this._context), a = this._context.new_var(r), l = o.Std.ema(a, i, this._context), h = this._context.new_var(l), c = o.Std.ema(h, i, this._context), d = this.f_0(r, l, c), p = d, [p] } } }, { name: "True Strength Indicator", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#000080" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 0 }], inputs: { in_0: 25, in_1: 13, in_2: 13 } }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "True Strength Indicator", shortDescription: "True Strength Indicator", is_price_study: !1, bands: [{ id: "hline_0", name: "Zero" }], inputs: [{ id: "in_0", name: "long", defval: 25, type: "integer", min: 1, max: 4999 }, { id: "in_1", name: "short", defval: 13, type: "integer", min: 1, max: 4999 }, { id: "in_2", name: "siglen", defval: 13, type: "integer", min: 1, max: 4999 }], id: "True Strength Indicator@tv-basicstudies-1", scriptIdPart: "", name: "True Strength Indicator" }, constructor: function() { this.main = function(t, e) { var i, n, s, r, a, l, h, c; return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = this._input(2), r = o.Std.close(this._context), a = this._context.new_var(r), l = o.Std.tsi(a, n, i, this._context), h = l, c = this._context.new_var(h), [h, o.Std.ema(c, s, this._context)] } } }, {
        name: "Ultimate Oscillator",
        metainfo: {
            _metainfoVersion: 41,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, inputs: { in_0: 7, in_1: 14, in_2: 28 } },
            plots: [{ id: "plot_0", type: "line" }],
            styles: { plot_0: { title: "UO", histogramBase: 0, joinPoints: !1, isHidden: !1 } },
            description: "Ultimate Oscillator",
            shortDescription: "UO",
            is_price_study: !1,
            inputs: [{ id: "in_0", name: "length7", defval: 7, type: "integer", min: 1, max: 1e12 }, { id: "in_1", name: "length14", defval: 14, type: "integer", min: 1, max: 1e12 }, { id: "in_2", name: "length28", defval: 28, type: "integer", min: 1, max: 1e12 }],
            id: "ultimate_oscillator@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Ultimate Oscillator"
        },
        constructor: function() {
            this.f_0 = function(t, e, i) {
                var n = this._context.new_var(t),
                    s = this._context.new_var(e);
                return [o.Std.sum(n, i, this._context) / o.Std.sum(s, i, this._context)]
            }, this.f_1 = function() {
                var t = this._input(0),
                    e = this._input(1),
                    i = this._input(2),
                    n = this._context.new_var(o.Std.close(this._context)),
                    s = o.Std.max(o.Std.high(this._context), n.get(1)),
                    r = this._context.new_var(o.Std.close(this._context)),
                    a = o.Std.min(o.Std.low(this._context), r.get(1)),
                    l = o.Std.close(this._context) - a,
                    h = s - a,
                    c = this.f_0(l, h, t),
                    d = this.f_0(l, h, e),
                    p = this.f_0(l, h, i);
                return [100 * (4 * c[0] + 2 * d[0] + p[0]) / 7]
            }, this.main = function(t, e) { return this._context = t, this._input = e, this.f_1() }
        }
    }, { name: "VWMA", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" } }, precision: 4, inputs: { in_0: 20 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "VWMA", shortDescription: "VWMA", is_price_study: !0, inputs: [{ id: "in_0", name: "len", defval: 20, type: "integer", min: 1, max: 1e4 }], id: "VWMA@tv-basicstudies-1", scriptIdPart: "", name: "VWMA" }, constructor: function() { this.main = function(t, e) { var i, n, s, r, a; return this._context = t, this._input = e, i = o.Std.close(this._context), n = this._input(0), s = this._context.new_var(i), r = o.Std.vwma(s, n, this._context), a = r, [a] } } }, { name: "Volume Oscillator", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#000080" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: 0 }], inputs: { in_0: 5, in_1: 10 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Volume Oscillator", shortDescription: "Volume Osc", is_price_study: !1, bands: [{ id: "hline_0", name: "Zero" }], inputs: [{ id: "in_0", name: "shortlen", defval: 5, type: "integer", min: 1, max: 4999 }, { id: "in_1", name: "longlen", defval: 10, type: "integer", min: 1, max: 4999 }], id: "Volume Oscillator@tv-basicstudies-1", scriptIdPart: "", name: "Volume Oscillator" }, constructor: function() { this.f_0 = function(t, e) { return 100 * (t - e) / e }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d; return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = o.Std.volume(this._context), r = this._context.new_var(s), a = o.Std.ema(r, i, this._context), l = this._context.new_var(s), h = o.Std.ema(l, n, this._context), c = this.f_0(a, h), d = c, [d] } } }, {
        name: "Vortex Indicator",
        metainfo: {
            _metainfoVersion: 42,
            isTVScript: !1,
            isTVScriptStub: !1,
            defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" } }, precision: 4, inputs: { in_0: 14 } },
            plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }],
            styles: { plot_0: { title: "VI +", histogramBase: 0, joinPoints: !1, isHidden: !1 }, plot_1: { title: "VI -", histogramBase: 0, joinPoints: !1, isHidden: !1 } },
            description: "Vortex Indicator",
            shortDescription: "VI",
            is_price_study: !1,
            is_hidden_study: !1,
            id: "vortex_indicator@tv-basicstudies-1",
            inputs: [{ id: "in_0", name: "Period", defval: 14, type: "integer", min: 2, max: 1e12 }],
            scriptIdPart: "",
            name: "Vortex Indicator"
        },
        constructor: function() {
            this.f_0 = function() {
                var t = this._input(0),
                    e = this._context.new_var(o.Std.low(this._context)),
                    i = this._context.new_var(o.Std.abs(o.Std.high(this._context) - e.get(1))),
                    n = o.Std.sum(i, t, this._context),
                    s = this._context.new_var(o.Std.high(this._context)),
                    r = this._context.new_var(o.Std.abs(o.Std.low(this._context) - s.get(1))),
                    a = o.Std.sum(r, t, this._context),
                    l = this._context.new_var(o.Std.atr(1, this._context)),
                    h = o.Std.sum(l, t, this._context);
                return [n / h, a / h]
            }, this.main = function(t, e) { return this._context = t, this._input = e, this.f_0() }
        }
    }, { name: "Willams %R", metainfo: { _metainfoVersion: 27, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#000080" } }, precision: 4, bands: [{ color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: -20 }, { color: "#808080", linestyle: 2, linewidth: 1, visible: !0, value: -80 }], filledAreasStyle: { fill_0: { color: "#000080", transparency: 90, visible: !0 } }, inputs: { in_0: 14 } }, plots: [{ id: "plot_0", type: "line" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Williams %R", shortDescription: "%R", is_price_study: !1, bands: [{ id: "hline_0", name: "UpperLimit" }, { id: "hline_1", name: "LowerLimit" }], filledAreas: [{ id: "fill_0", objAId: "hline_0", objBId: "hline_1", type: "hline_hline", title: "Hlines Background" }], inputs: [{ id: "in_0", name: "length", defval: 14, type: "integer", min: 1, max: 2e3 }], id: "Willams %R@tv-basicstudies-1", scriptIdPart: "", name: "Willams %R" }, constructor: function() { this.f_0 = function(t, e, i) { return 100 * (t - e) / (e - i) }, this.main = function(t, e) { var i, n, s, r, a, l, h, c, d; return this._context = t, this._input = e, i = this._input(0), n = o.Std.high(this._context), s = this._context.new_var(n), r = o.Std.highest(s, i, this._context), a = o.Std.low(this._context), l = this._context.new_var(a), h = o.Std.lowest(l, i, this._context), c = this.f_0(o.Std.close(this._context), r, h), d = c, [d] } } }, {
        name: "Williams Alligator",
        metainfo: {
            _metainfoVersion: 27,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            defaults: { styles: { plot_0: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#0000FF" }, plot_1: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#FF0000" }, plot_2: { linestyle: 0, linewidth: 1, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#008000" } }, precision: 4, inputs: { in_0: 21, in_1: 13, in_2: 8 } },
            plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", type: "line" }, { id: "plot_2", type: "line" }],
            styles: { plot_0: { title: "Jaw", histogramBase: 0, joinPoints: !1 }, plot_1: { title: "Teeth", histogramBase: 0, joinPoints: !1 }, plot_2: { title: "Lips", histogramBase: 0, joinPoints: !1 } },
            description: "Williams Alligator",
            shortDescription: "Alligator",
            is_price_study: !0,
            inputs: [{ id: "in_0", name: "jawLength", defval: 21, type: "integer", min: 1, max: 2e3 }, {
                id: "in_1",
                name: "teethLength",
                defval: 13,
                type: "integer",
                min: 1,
                max: 2e3
            }, { id: "in_2", name: "lipsLength", defval: 8, type: "integer", min: 1, max: 2e3 }],
            id: "Williams Alligator@tv-basicstudies-1",
            scriptIdPart: "",
            name: "Williams Alligator"
        },
        constructor: function() { this.main = function(t, e) { var i, n, s, r, a, l, h, c, d, p, u, _, f; return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = this._input(2), r = o.Std.hl2(this._context), a = this._context.new_var(r), l = o.Std.ema(a, i, this._context), h = this._context.new_var(r), c = o.Std.ema(h, n, this._context), d = this._context.new_var(r), p = o.Std.ema(d, s, this._context), u = l, _ = c, f = p, [{ value: u, offset: 8 }, { value: _, offset: 5 }, { value: f, offset: 3 }] } }
    }, {
        name: "Williams Fractals",
        metainfo: { _metainfoVersion: 42, isTVScript: !1, isTVScriptStub: !1, defaults: { styles: { plot_0: { plottype: "shape_triangle_down", visible: !0, location: "BelowBar", transparency: 0, color: "#800000" }, plot_1: { plottype: "shape_triangle_up", visible: !0, location: "AboveBar", transparency: 0, color: "#808000" } }, precision: 4, inputs: { in_0: 2 } }, plots: [{ id: "plot_0", type: "shapes" }, { id: "plot_1", type: "shapes" }], styles: { plot_0: { title: "Shapes", isHidden: !1 }, plot_1: { title: "Shapes", isHidden: !1 } }, description: "Williams Fractal", shortDescription: "Fractals", is_price_study: !0, is_hidden_study: !1, id: "Williams Fractals@tv-basicstudies-1", inputs: [{ id: "in_0", name: "Periods", defval: 2, type: "integer", min: 2, max: 1e12 }], scriptIdPart: "", name: "Williams Fractals", isCustomIndicator: !0 },
        constructor: function() {
            this.f_0 = function() {
                var t = this._input(0),
                    e = this._context.new_var(o.Std.high(this._context)),
                    i = o.Std.or(o.Std.and(o.Std.and(o.Std.lt(e.get(t + 2), e.get(t)), o.Std.lt(e.get(t + 1), e.get(t))), o.Std.and(o.Std.lt(e.get(t - 1), e.get(t)), o.Std.lt(e.get(t - 2), e.get(t)))), o.Std.or(o.Std.or(o.Std.and(o.Std.lt(e.get(t + 3), e.get(t)), o.Std.and(o.Std.and(o.Std.lt(e.get(t + 2), e.get(t)), o.Std.eq(e.get(t + 1), e.get(t))), o.Std.and(o.Std.lt(e.get(t - 1), e.get(t)), o.Std.lt(e.get(t - 2), e.get(t))))), o.Std.and(o.Std.and(o.Std.lt(e.get(t + 4), e.get(t)), o.Std.lt(e.get(t + 3), e.get(t))), o.Std.and(o.Std.and(o.Std.eq(e.get(t + 2), e.get(t)), o.Std.le(e.get(t + 1), e.get(t))), o.Std.and(o.Std.lt(e.get(t - 1), e.get(t)), o.Std.lt(e.get(t - 2), e.get(t)))))), o.Std.or(o.Std.and(o.Std.and(o.Std.lt(e.get(t + 5), e.get(t)), o.Std.and(o.Std.lt(e.get(t + 4), e.get(t)), o.Std.eq(e.get(t + 3), e.get(t)))), o.Std.and(o.Std.and(o.Std.eq(e.get(t + 2), e.get(t)), o.Std.le(e.get(t + 1), e.get(t))), o.Std.and(o.Std.lt(e.get(t - 1), e.get(t)), o.Std.lt(e.get(t - 2), e.get(t))))), o.Std.and(o.Std.and(o.Std.and(o.Std.lt(e.get(t + 6), e.get(t)), o.Std.lt(e.get(t + 5), e.get(t))), o.Std.and(o.Std.eq(e.get(t + 4), e.get(t)), o.Std.le(e.get(t + 3), e.get(t)))), o.Std.and(o.Std.and(o.Std.eq(e.get(t + 2), e.get(t)), o.Std.le(e.get(t + 1), e.get(t))), o.Std.and(o.Std.lt(e.get(t - 1), e.get(t)), o.Std.lt(e.get(t - 2), e.get(t)))))))),
                    n = this._context.new_var(o.Std.low(this._context));
                return [o.Std.or(o.Std.and(o.Std.and(o.Std.gt(n.get(t + 2), n.get(t)), o.Std.gt(n.get(t + 1), n.get(t))), o.Std.and(o.Std.gt(n.get(t - 1), n.get(t)), o.Std.gt(n.get(t - 2), n.get(t)))), o.Std.or(o.Std.or(o.Std.and(o.Std.gt(n.get(t + 3), n.get(t)), o.Std.and(o.Std.and(o.Std.gt(n.get(t + 2), n.get(t)), o.Std.eq(n.get(t + 1), n.get(t))), o.Std.and(o.Std.gt(n.get(t - 1), n.get(t)), o.Std.gt(n.get(t - 2), n.get(t))))), o.Std.and(o.Std.and(o.Std.gt(n.get(t + 4), n.get(t)), o.Std.gt(n.get(t + 3), n.get(t))), o.Std.and(o.Std.and(o.Std.eq(n.get(t + 2), n.get(t)), o.Std.ge(n.get(t + 1), n.get(t))), o.Std.and(o.Std.gt(n.get(t - 1), n.get(t)), o.Std.gt(n.get(t - 2), n.get(t)))))), o.Std.or(o.Std.and(o.Std.and(o.Std.gt(n.get(t + 5), n.get(t)), o.Std.and(o.Std.gt(n.get(t + 4), n.get(t)), o.Std.eq(n.get(t + 3), n.get(t)))), o.Std.and(o.Std.and(o.Std.eq(n.get(t + 2), n.get(t)), o.Std.ge(n.get(t + 1), n.get(t))), o.Std.and(o.Std.gt(n.get(t - 1), n.get(t)), o.Std.gt(n.get(t - 2), n.get(t))))), o.Std.and(o.Std.and(o.Std.and(o.Std.gt(n.get(t + 6), n.get(t)), o.Std.gt(n.get(t + 5), n.get(t))), o.Std.and(o.Std.eq(n.get(t + 4), n.get(t)), o.Std.ge(n.get(t + 3), n.get(t)))), o.Std.and(o.Std.and(o.Std.eq(n.get(t + 2), n.get(t)), o.Std.ge(n.get(t + 1), n.get(t))), o.Std.and(o.Std.gt(n.get(t - 1), n.get(t)), o.Std.gt(n.get(t - 2), n.get(t)))))))), i]
            }, this.main = function(t, e) { this._context = t, this._input = e; var i = this.f_0(); return [{ value: i[0], offset: -2 }, { value: i[1], offset: -2 }] }
        }
    }]
}, 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(50)(t))
}, function(t, e, i) {
    "use strict";
    var o = i(144),
        n = i(106).setMouseEventHandler,
        s = {};
    s.createLabel = function(t, e, i) { return o.create("label", $.extend(i, { html: e, for: t })) }, s.unbindContextMenu = function(t) { t.contextMenu(function(t) { return !1 }) }, s.offsetX = function(t, e) { return t.width() + e.pageX }, s.offsetY = function(t, e) { return t.height() + e.pageY }, s.isElementInViewport = function(t) { "function" == typeof jQuery && t instanceof jQuery && (t = t[0]); var e = t.getBoundingClientRect(); return e.top >= 0 && e.left >= 0 && e.bottom <= (window.innerHeight || document.documentElement.clientHeight) && e.right <= (window.innerWidth || document.documentElement.clientWidth) }, s.checkObjIsOutOfWindowX = function(t, e) { var i, o = $(window).width() - s.offsetX(t, e); return o < 0 ? (i = e.pageX + o, i > 0 ? i : 0) : e.pageX }, s.checkObjIsOutOfWindowY = function(t, e) {
        var i, o = $(window).height() - s.offsetY(t, e);
        return o < 0 ? (i = e.pageY + o, i > 0 ? i : 0) : e.pageY
    }, s.checkObjIsOutOfWindow = function(t, e) { return { left: s.checkObjIsOutOfWindowX(t, e), top: s.checkObjIsOutOfWindowY(t, e) } }, s.setAttr = function(t, e, i) { return t.attr ? t.attr(e, i) : t[e] = i, t }, s.removeAttr = function(t, e) { return t.removeAttr ? t.removeAttr(e) : t.removeAttribute(e), t }, s.notNull = function(t) { return -1 === $.inArray(t, [null, void 0, "false", "null", "undefined", 0]) }, s.hideControl = function(t) { return t.css({ position: "absolute", top: -1e3, left: -1e3 }) }, s.createPopup = function(t, e, i) { return new s.Popup(t, e, i).render() }, s.Popup = function(t, e, i) {
        if (void 0 !== t.selector ? this.jqDiv = t : t.nodeType ? this.jqDiv = $(t) : this.jqDiv = o.create("div", t), i) {
            var s = this;
            $.each(i, function(t, e) { s[t] = e })
        }
        n(this.jqDiv, this), this._callback = e
    }, s.Popup.prototype.render = function() { return this.jqDiv }, s.Popup.prototype.show = function() { this.jqDiv.show() }, s.Popup.prototype.hide = function() { this.jqDiv.hide() }, s.Popup.prototype.setVisible = function(t) { t ? this.show() : this.hide() }, s.Popup.prototype.isVisible = function() { return this.jqDiv.is(":visible") }, s.Popup.prototype.contextMenuEvent = function(t) { return !1 }, s.Popup.prototype.mouseDownOutsideEvent = function(t) {
        if (this.isVisible()) {
            if (this._callback && !this._callback()) return;
            this.hide()
        }
    }, t.exports = s
}, function(t, e) {
    "use strict";
    var i = {};
    i.renderAttributes = function(t) { var e, i = ""; for (e in t) t[e] && (i += " " + e + '="' + t[e] + '"'); return i }, i.create = function(t, e) { var i = $(document.createElement(t)); return e && (e.html && (i.html(e.html), delete e.html), i.attr(e)), i }, i.validAttributes = ["abbr", "accept-charset", "accept", "accesskey", "action", "align", "alink", "alt", "archive", "axis", "background", "bgcolor", "border", "cellpadding", "cellspacing", "char", "charoff", "charset", "checked", "cite", "class", "classid", "clear", "code", "codebase", "codetype", "color", "cols", "colspan", "compact", "content", "coords", "data", "datetime", "declare", "defer", "dir", "disabled", "enctype", "face", "for", "frame", "frameborder", "headers", "height", "href", "hreflang", "hspace", "http-equiv", "id", "ismap", "label", "lang", "language", "link", "longdesc", "marginheight", "marginwidth", "maxlength", "media", "method", "multiple", "name", "nohref", "noresize", "noshade", "nowrap", "object", "onblur", "onchange", "onclick", "ondblclick", "onfocus", "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onreset", "onselect", "onsubmit", "onunload", "profile", "prompt", "readonly", "rel", "rev", "rows", "rowspan", "rules", "scheme", "scope", "scrolling", "selected", "shape", "size", "span", "src", "standby", "start", "style", "summary", "tabindex", "target", "text", "title", "type", "usemap", "valign", "value", "valuetype", "version", "vlink", "vspace", "width"], i.validAttribute = function(t) { return -1 !== jQuery.inArray(t, i.validAttributes) }, i.cleanAttributes = function(t) { return jQuery.each(t, function(e, o) { i.validAttribute(e) || delete t[e] }), t }, t.exports = i
}, function(t, e, i) {
    (function(t) {
        "use strict";

        function i(e, i, o) {
            var n, s, r, a, l, h, c = this;
            if (this._options = $.extend({}, this._defaultOptions, o || {}), this._$wrapper = e, this._$content = i,
                this._scroll_speed = 40, this._shadow_offset = 10, this._header_height = this._options.headerHeight, this._scroll_margin_top = this._options.scrollMarginTop, this.scrolled = new t, this.scrolltoend = new t, this.scrolltostart = new t, this.visibilityCallbacks = [], n = navigator.platform.toLowerCase(), s = navigator.userAgent.toLowerCase(), r = s.indexOf("firefox") > -1, a = n.indexOf("android") > -1 || s.indexOf("android") > -1, this._touch = Modernizr.touch || navigator.msMaxTouchPoints || r && a, this._touch) return this._$content.css("position", "relative"), void this._$wrapper.css({ "overflow-y": "auto", "-webkit-overflow-scrolling": "touch", "-ms-overflow-style": "-ms-autohiding-scrollbar" }).scroll(this._onScroll.bind(this));
            this._$wrapper.css("overflow", "hidden"), this._$wrapper.on("mouseenter.sidebar-scroll", function() { c._bottomFixed || c._dragging || (c._options.alwaysVisible || c._$scrollBar.addClass("active"), c._onScroll()) }).on("mouseleave.sidebar-scroll", function() { c._bottomFixed || c._dragging || (c._options.alwaysVisible || c._$scrollBar.removeClass("active"), c._onScroll()) }).on("mousewheel.sidebar-scroll", function(t, e) { if (!t.isDefaultPrevented()) return c.scroll(e, "MozMousePixelScroll" === t.originalEvent.type ? 2 : null) }), !1 !== this._options.showTopShadow && (this._$shadowTop = $('<div class="sb-inner-shadow top i-invisible">').appendTo(this._$wrapper)), !1 !== this._options.showBottomShadow && (this._$shadowBottom = $('<div class="sb-inner-shadow">').appendTo(this._$wrapper)), this._$shadowTop && this._header_height && this._$shadowTop.css("top", this._header_height - this._shadow_offset), l = this._options.additionalClass ? " " + this._options.additionalClass : "", h = this._options.alwaysVisible ? " active-always" : "", this._$scrollBarWrapper = $('<div class="sb-scrollbar-wrap">').appendTo(this._$wrapper), this._$scrollBar = $('<div class="sb-scrollbar sb-scrollbar-body' + l + h + '"></div>').appendTo(this._$scrollBarWrapper), this._onScroll()
        }
        i.prototype.isTouch = function() { return this._touch }, i.prototype.getScrollBar = function() { return this._$scrollBar }, i.prototype._defaultOptions = { headerHeight: 0, additionalClass: "", alwaysVisible: !1, showBottomShadow: !0, scrollMarginTop: 1, bubbleScrollEvent: !1 }, i.prototype.initDraggable = function() { if (this._dragInitialized) return this; var t = this; return this._$scrollBar.draggable({ axis: "y", containment: this._$scrollBarWrapper, start: function() { t._dragging = !0 }, stop: function() { t._dragging = !1 }, drag: function(e, i) { t.updateScroll() } }), this._dragInitialized = !0, this }, i.prototype.updateScroll = function() { var t, e, i, o, n; return this._touch ? this : (t = 1, e = Math.ceil(this._$scrollBar.position().top - this._scroll_margin_top - this._header_height), i = this.getContainerHeightWithoutHeader(), o = this._$content.outerHeight(), n = o - i - t, i <= 0 ? this : (this._scroll_target_top = n <= 0 ? this._header_height : Math.min(-e * o / i + this._header_height, this._header_height), e + this._$scrollBar.height() + 2 >= i ? this.scrollToEnd() : (this._$content.css("top", this._scroll_target_top + "px"), this._onScroll()), this)) }, i.prototype.getContainerHeightWithoutHeader = function() { return this._$wrapper.outerHeight() - this._header_height },
            i.prototype.getContainerHeight = function() { return this._$wrapper.outerHeight() }, i.prototype.getContentHeight = function() { return this._$content.outerHeight() }, i.prototype.updateScrollBar = function() { var t, e, i, o, n, s, r, a, l; return this._touch ? this : (t = 1, e = this._$content.position().top, i = this.getContentHeight(), o = this.getContainerHeight(), n = this.getContainerHeightWithoutHeader(), s = t + this._header_height, r = n - 2 * t, a = (Math.abs(e) - this._header_height) * r / i, l = o * o / i, this.isContentShort() ? (this._$scrollBar.addClass("js-hidden"), this._$wrapper.removeClass("sb-scroll-active")) : (this._$scrollBar.removeClass("js-hidden").height(l).css("top", s + a), this._$wrapper.addClass("sb-scroll-active"), this.initDraggable()), this) }, i.prototype.scroll = function(t, e) { var i, o, n, s, r; return this._touch ? this : (i = this._$content.position().top, o = this._$content.outerHeight(), n = this.getContainerHeightWithoutHeader(), s = o - n - 1, r = e || this._scroll_speed, s <= 0 || (this._scroll_target_top = Math.max(-s + this._header_height, Math.min(this._header_height, i + t * r)), this.setContentTop(this._scroll_target_top), this._onScroll())) }, i.prototype.animateTo = function(t) { var e, i, o; return this._touch ? this : (e = this._$content.outerHeight(), i = this.getContainerHeightWithoutHeader(), (o = e - i - 1) <= 0 || (this._scroll_target_top = Math.max(-o + this._header_height, Math.min(this._header_height, -t)), void this._$content.animate({ top: this._scroll_target_top }, 500, function() { this._onScroll() }.bind(this)))) }, i.prototype.resize = function() {
                var t, e;
                if (!this._bottomFixed) {
                    if (t = this._$content.outerHeight(), e = this._$wrapper.outerHeight(), !this._options.vAlignBottom && t < e) return void(this.atStart() || this.scrollToStart());
                    this.atEnd() ? this.scrollToEnd() : "number" == typeof this._stickyBottom && this.setContentTop(Math.min(0, this._stickyBottom + this._$wrapper.outerHeight() - this._$content.outerHeight()))
                }
            }, i.prototype.resizeHeader = function(t) {
                var e = t - this._header_height;
                this._header_height = t, this._scroll_target_top += e, this._$shadowTop && this._$shadowTop.css("top", this._header_height - this._shadow_offset), this.resize()
            }, i.prototype.scrollTo = function(t, e) {
                var i, o, n, s, r, a;
                if (e = $.extend({ position: "visible", areaHeight: t instanceof $ ? t.height() : 0 }, e), t instanceof $ && (t = e.offsetTop || t.position().top), i = this._$content.position().top, o = this._$content.outerHeight(), n = this.getContainerHeightWithoutHeader(), o - n - 1 <= 0) return !0;
                if (s = -1 * (i - this._header_height), r = s + n, a = 0, "visible" === e.position) {
                    if (t > s && t + e.areaHeight < r) return !1;
                    a = t + e.areaHeight > r ? r - t - e.areaHeight : s - t
                } else "top" === e.position && (a = s - t);
                return this.scroll(a, 1), this._onScroll(), !1
            }, i.prototype.scrollToEnd = function() {
                var t = this._$content.position().top,
                    e = this._$content.outerHeight(),
                    i = this._$wrapper.outerHeight(),
                    o = e + t;
                return this.setContentTop(t + (i - o) + 1), this._onScroll(), this
            }, i.prototype.scrollToStart = function() { return this.setContentTop(this._header_height), this._onScroll(), this }, i.prototype.currentPosition = function() { return Math.round(this._$content.position().top) }, i.prototype.atStart = function() { return Math.round(this._$content.position().top) >= this._header_height },
            i.prototype.atEnd = function(t) { var e, i, o, n; return "number" == typeof t && isFinite(t) || (t = 0), e = 1, i = Math.round(this._$content.position().top), o = this._$content.outerHeight(), n = this._$wrapper.outerHeight(), o - Math.abs(i) - e <= n + t }, i.prototype._onScroll = function(t) { var e, i; return this._touch || this._$content.css("bottom", "auto"), this.scrolled.fire(), this._dragging && !0 !== t || this.updateScrollBar(), e = this.atStart(), i = this.atEnd(), this._$shadowTop && this._$shadowTop.toggleClass("i-invisible", !!e), this._$shadowBottom && this._$shadowBottom.toggleClass("i-invisible", !!i), this._onContentVisible(), !this._atStart && e ? (this._atStart = !0, this.scrolltostart.fire()) : this._atStart && !e && delete this._atStart, !this._atEnd && i ? (this._atEnd = !0, this.scrolltoend.fire()) : this._atEnd && !i && delete this._atEnd, this._options.vAlignBottom && (this._stickyBottom = this._$content.outerHeight() - Math.abs(this._$content.position().top) - this._$wrapper.outerHeight()), !(!this._atStart && !this._atEnd || ("function" == typeof this._options.bubbleScrollEvent ? !this._options.bubbleScrollEvent() : !this._options.bubbleScrollEvent)) }, i.prototype.checkContentVisibility = function() { this._onContentVisible() }, i.prototype.subscribeToContentVisible = function(t, e, i) { this.visibilityCallbacks.push({ id: t, $el: e, callback: i }) }, i.prototype.triggerVisibilityCallbacks = function(t) { this._onContentVisible(t) }, i.prototype._contentIsVisible = function(t) { return t.$el.position().top > -1 * this.currentPosition() }, i.prototype._onContentVisible = function(t) {
                var e, i, o;
                this.visibilityCallbacks.length && (e = t || this._contentIsVisible.bind(this), i = [], o = this.visibilityCallbacks.filter(function(t, o) { if (!$.contains(this._$content, t.$el[0])) return !1; var n = e(t); return n && i.push(o), !n }, this), i.forEach(function(e) { this.visibilityCallbacks[e].callback(!!t) }, this), delete this.visibilityCallbacks, this.visibilityCallbacks = o)
            }, i.prototype.save = function() { return this._saved = { top: this._$content.position().top, height: this._$content.outerHeight() }, this }, i.prototype.restore = function() {
                if (this._saved) {
                    if (this._saved.top === this._$content.position().top && this._saved.height === this._$content.outerHeight()) return delete this._saved, this;
                    this._options.vAlignBottom && (this._saved.top -= this._$content.outerHeight() - this._saved.height, this._saved.top > this._header_height && (this._saved.top = this._header_height)), this.setContentTop(this._saved.top), delete this._saved, this._onScroll(!0)
                }
                return this
            }, i.prototype.fixBottom = function() { var t, e; return this._bottomFixed ? this : (this._touch ? (t = this._$content.outerHeight(), e = this._$wrapper.scrollTop(), this._tempIntervalID = setInterval(function() { this._$wrapper.scrollTop(e + (this._$content.outerHeight() - t)) }.bind(this), 0)) : this._$content.css({ top: "auto", bottom: this._$wrapper.outerHeight() - this._$content.position().top - this._$content.outerHeight() }), this._bottomFixed = !0, this) }, i.prototype.releaseBottom = function() { return this._bottomFixed ? (this._touch ? clearInterval(this._tempIntervalID) : this._$content.css({ top: this._$content.position().top, bottom: "auto" }), delete this._bottomFixed, this._onScroll(), this) : this },
            i.prototype.setContentTop = function(t) { return this._touch ? this._options.vAlignBottom && this._$content.outerHeight() < this._$wrapper.outerHeight() ? (this._$wrapper.css("overflow-y", "visible"), this._$content.css({ position: "absolute", bottom: 0 })) : (this._$content.css({ position: "relative", bottom: "auto" }), this._$wrapper.css("overflow-y", "auto"), this._$wrapper.scrollTop(-t)) : this._$content.css("top", t), this }, i.prototype.isContentShort = function() { return this.getContentHeight() <= this.getContainerHeightWithoutHeader() }, i.prototype.destroy = function() { this._$scrollBarWrapper.remove(), this._$shadowBottom && this._$shadowBottom.remove(), this._$shadowTop && this._$shadowTop.remove(), this._$wrapper.attr("style", "").off("mouseenter.sidebar-scroll").off("mouseleave.sidebar-scroll").off("mousewheel.sidebar-scroll"), this._$content.attr("style", "") }, e.SidebarCustomScroll = i
    }).call(e, i(15))
}, function(t, e) {
    "use strict";

    function i(t, e) { this.m_title = t, this.m_value = e, this._visible = !0, this._color = void 0 }

    function o() { this._header = "", this._title = "", this._items = [] }
    i.prototype.title = function() { return this.m_title }, i.prototype.text = function() { return this.m_value }, i.prototype.visible = function() { return this._visible }, i.prototype.color = function() { return this._color }, i.prototype.setVisible = function(t) { this._visible = t }, i.prototype.setValue = function(t) { this.m_value = t }, i.prototype.setColor = function(t) { this._color = t }, i.prototype.value = function() { return this.m_value }, o.prototype.header = function() { return this._header }, o.prototype.title = function() { return this._title }, o.prototype.items = function() { return this._items }, o.prototype.update = function() {}, e.DataWindowItem = i, e.DataWindowView = 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(2),
        r = i(9),
        a = i(1).LineDataSource,
        l = i(90).VertLineRenderer,
        h = i(45).RectangleRenderer,
        c = i(11).TrendLineRenderer,
        d = i(47).Action,
        p = i(8),
        u = i(59).PaneRendererLine,
        _ = i(6),
        f = i(7).DefaultProperty,
        m = i(14);
    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)
    }, 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); 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)) {
            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, i, o) {
        var n, s, r, a, l, h = i.substract(t).length() + i.substract(e).length(),
            c = 3 / h;
        for (n = 0; n <= 1; n += c)
            if (s = t.scaled((1 - n) * (1 - n)), r = i.scaled(2 * n * (1 - n)), a = e.scaled(n * n), l = s.add(r).add(a), l.substract(o).length() < 5) return !0;
        return null
    }

    function n(t, e, i, o, n) {
        var s, r, a, l, h, c, d = i.substract(t).length() + o.substract(i).length() + e.substract(o).length(),
            p = 3 / d;
        for (s = 0; s <= 1; s += p)
            if (r = t.scaled((1 - s) * (1 - s) * (1 - s)), a = i.scaled(3 * (1 - s) * (1 - s) * s), l = o.scaled(3 * (1 - s) * s * s), h = e.scaled(s * s * s),
                c = r.add(a).add(l).add(h), c.substract(n).length() < 5) return !0
    }

    function s(t, e, i, o, n) { var s, r, a, l, h, c, d, p, u, _ = i.substract(t).length() + i.substract(e).length(); if (!_) return []; for (s = 3 / _, r = 500, a = [], l = 1; l <= r * s; l += s) h = t.scaled((1 - l) * (1 - l)), c = i.scaled(2 * l * (1 - l)), d = e.scaled(l * l), p = h.add(c).add(d), a.length > 0 && (u = a[a.length - 1], u.substract(p).length() < 2 && (s *= 2)), a.push(p); return a }

    function r(t) { this._data = t }

    function a(t, e) { _.call(this, t, e), this._invalidated = !0 }

    function l(t, e) {
        this._constructor = "LineToolBezierQuadro";
        var i;
        i = e || new v("linetoolbezierquadro"), u.call(this, t, new a(this, t), i)
    }

    function h(t) { this._data = t }

    function c(t, e) { _.call(this, t, e), this._invalidated = !0 }

    function d(t, e) {
        this._constructor = "LineToolBezierCubic";
        var i;
        i = e || new v("linetoolbeziercubic"), u.call(this, t, new c(this, t), i)
    }
    var p = i(2),
        u = i(1).LineDataSource,
        _ = i(9),
        f = i(11).TrendLineRenderer,
        m = i(8),
        g = i(6),
        v = i(7).DefaultProperty,
        y = i(14);
    r.prototype.draw = function(t) {
        var e, i, o, n, s, r, a, l = this._data.points[0],
            h = this._data.points[1];
        if (t.lineCap = "butt", t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, CanvasEx.setLineStyle(t, this._data.linestyle), 2 === this._data.points.length) t.beginPath(), t.moveTo(l.x, l.y), t.lineTo(h.x, h.y), t.stroke();
        else {
            if (e = this._data.points[2], i = h.substract(l), o = e.substract(i.scaled(.25)), n = e.add(i.scaled(.25)), this._data.fillBack && this._data.points.length > 2 && (t.fillStyle = y.generateColor(this._data.backcolor, this._data.transparency), t.beginPath(), t.moveTo(l.x, l.y), t.quadraticCurveTo(o.x, o.y, e.x, e.y), t.quadraticCurveTo(n.x, n.y, h.x, h.y), t.fill()), t.beginPath(), t.moveTo(l.x, l.y), this._data.extendLeftPoints.length > 0)
                for (s = this._data.extendLeftPoints[this._data.extendLeftPoints.length - 1], t.moveTo(s.x, s.y), r = this._data.extendLeftPoints.length - 2; r >= 0; r--) a = this._data.extendLeftPoints[r], t.lineTo(a.x, a.y);
            for (t.quadraticCurveTo(o.x, o.y, e.x, e.y), t.quadraticCurveTo(n.x, n.y, h.x, h.y), r = 0; r < this._data.extendRightPoints.length; r++) a = this._data.extendRightPoints[r], t.lineTo(a.x, a.y);
            t.stroke(), this._data.leftend === u.LINEEND_ARROW && f.prototype.drawArrow(o, l, t, t.lineWidth), this._data.rightend === u.LINEEND_ARROW && f.prototype.drawArrow(n, h, t, t.lineWidth)
        }
    }, r.prototype.hitTest = function(t) {
        var e, i, n, s, r, a, l, h;
        if (3 === this._data.points.length) {
            if (e = this._data.points[0], i = this._data.points[1], n = this._data.points[2], s = i.substract(e), r = n.substract(s.scaled(.25)), a = n.add(s.scaled(.25)), o(n, e, r, t) || o(n, i, a, t)) return new m(m.MOVEPOINT);
            for (l = 3, h = 1; h < this._data.extendLeftPoints.length; h++)
                if (e = this._data.extendLeftPoints[h - 1], i = this._data.extendLeftPoints[h], p.distanceToSegment(e, i, t).distance < l) return new m(m.MOVEPOINT);
            for (h = 1; h < this._data.extendRightPoints.length; h++)
                if (e = this._data.extendRightPoints[h - 1], i = this._data.extendRightPoints[h], p.distanceToSegment(e, i, t).distance < l) return new m(m.MOVEPOINT)
        }
        return null
    }, inherit(a, _), a.prototype.update = function() { _.prototype.update.call(this), this._invalidated = !0 }, a.prototype.updateImpl = function() {
        var t, e, i, o, n, r, a, l;
        this._extendLeftPoints = [], this._extendRightPoints = [],
            this._source.points().length < 3 || (t = this._source.pointToScreenPoint(this._source.points()[0])[1], e = this._source.pointToScreenPoint(this._source.points()[1])[1], i = this._source.pointToScreenPoint(this._source.points()[2])[1], o = e.substract(t), n = i.substract(o.scaled(.25)), r = i.add(o.scaled(.25)), a = this._model.timeScale().width(), l = this._source.priceScale().height(), this._source.properties().extendLeft.value() && (this._extendLeftPoints = s(i, t, n, a, l)), this._source.properties().extendRight.value() && (this._extendRightPoints = s(i, e, r, a, l)))
    }, a.prototype.renderer = function() { var t, e, i, o; return this._points.length < 2 ? new g : (this._invalidated && (this.updateImpl(), this._invalidated = !1), t = [].concat(this._points), this._source._controlPoint && t.push(this._source.pointToScreenPoint(this._source._controlPoint)[0]), e = {}, i = this._source.properties(), e.points = t, e.color = i.linecolor.value(), e.linewidth = i.linewidth.value(), e.linestyle = i.linestyle.value(), e.leftend = i.leftEnd.value(), e.rightend = i.rightEnd.value(), e.fillBack = i.fillBackground.value(), e.backcolor = i.backgroundColor.value(), e.transparency = i.transparency.value(), e.extendLeftPoints = this._extendLeftPoints, e.extendRightPoints = this._extendRightPoints, o = new g, o.append(new r(e)), this.addAnchors(o), o) }, inherit(l, u), l.prototype.pointsCount = function() { return 2 }, l.prototype.title = function() { return "Curve" }, l.prototype.controlPoint = function() {
        var t = this.pointToScreenPoint(this.points()[0])[0],
            e = this.pointToScreenPoint(this.points()[1])[0],
            i = e.substract(t).scaled(.5),
            o = i.transponed().scaled(.3),
            n = t.add(e).scaled(.5),
            s = n.add(o);
        return this.screenPointToPoint(s)
    }, l.prototype.setLastPoint = function(t, e) { u.prototype.setLastPoint.call(this, t, e), this._controlPoint = this.controlPoint() }, l.prototype.addPoint = function(t, e, i) { var o, n = u.prototype.addPoint.call(this, t, e, !0); return n && (o = this.controlPoint(), this._points.push(o), delete this._controlPoint, i || (this.normalizePoints(), this.createServerPoints()), this._createPointProperty(2)), n }, l.prototype.restorePoints = function(t, e, i) { u.prototype.restorePoints.call(this, t, e, i), this._createPointProperty(2) }, h.prototype.draw = function(t) {
        var e, i, o, n, s, r, a, l, h, c, d, p, _;
        if (t.lineCap = "butt", t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, CanvasEx.setLineStyle(t, this._data.linestyle), e = this._data.points[0], i = this._data.points[1], 2 === this._data.points.length) t.beginPath(), t.moveTo(e.x, e.y), t.lineTo(i.x, i.y), t.stroke(), this._data.leftend === u.LINEEND_ARROW && f.prototype.drawArrow(i, e, t, t.lineWidth), this._data.rightend === u.LINEEND_ARROW && f.prototype.drawArrow(e, i, t, t.lineWidth);
        else {
            if (o = this._data.points[2], n = this._data.points[3], s = n.substract(e), r = o.substract(s.scaled(.25)), a = o.add(s.scaled(.25)), l = i.substract(o), h = n.substract(l.scaled(.25)), c = n.add(l.scaled(.25)), this._data.fillBack && this._data.points.length > 2 && (t.fillStyle = y.generateColor(this._data.backcolor, this._data.transparency), t.beginPath(), t.moveTo(e.x, e.y), t.quadraticCurveTo(r.x, r.y, o.x, o.y), t.bezierCurveTo(a.x, a.y, h.x, h.y, n.x, n.y), t.quadraticCurveTo(c.x, c.y, i.x, i.y), t.fill()), t.beginPath(),
                this._data.extendLeftPoints.length > 0)
                for (d = this._data.extendLeftPoints[this._data.extendLeftPoints.length - 1], t.moveTo(d.x, d.y), p = this._data.extendLeftPoints.length - 2; p >= 0; p--) _ = this._data.extendLeftPoints[p], t.lineTo(_.x, _.y);
            for (t.moveTo(e.x, e.y), t.quadraticCurveTo(r.x, r.y, o.x, o.y), t.bezierCurveTo(a.x, a.y, h.x, h.y, n.x, n.y), t.quadraticCurveTo(c.x, c.y, i.x, i.y), p = 0; p < this._data.extendRightPoints.length; p++) _ = this._data.extendRightPoints[p], t.lineTo(_.x, _.y);
            t.stroke(), this._data.leftend === u.LINEEND_ARROW && f.prototype.drawArrow(r, e, t, t.lineWidth), this._data.rightend === u.LINEEND_ARROW && f.prototype.drawArrow(c, i, t, t.lineWidth)
        }
    }, h.prototype.hitTest = function(t) {
        var e, i, s, r, a, l, h, c, d, u, _, f;
        if (4 === this._data.points.length) {
            if (e = this._data.points[0], i = this._data.points[1], s = this._data.points[2], r = this._data.points[3], a = r.substract(e), l = s.substract(a.scaled(.25)), h = s.add(a.scaled(.25)), c = i.substract(s), d = r.substract(c.scaled(.25)), u = r.add(c.scaled(.25)), o(s, e, l, t) || n(s, r, h, d, t) || o(r, i, u, t)) return new m(m.MOVEPOINT);
            for (_ = 3, f = 1; f < this._data.extendLeftPoints.length; f++)
                if (e = this._data.extendLeftPoints[f - 1], i = this._data.extendLeftPoints[f], p.distanceToSegment(e, i, t).distance < _) return new m(m.MOVEPOINT);
            for (f = 1; f < this._data.extendRightPoints.length; f++)
                if (e = this._data.extendRightPoints[f - 1], i = this._data.extendRightPoints[f], p.distanceToSegment(e, i, t).distance < _) return new m(m.MOVEPOINT)
        }
        return null
    }, inherit(c, _), c.prototype.update = function() { _.prototype.update.call(this), this._invalidated = !0 }, c.prototype.updateImpl = function() {
        var t, e, i, o, n, r, a, l, h, c;
        this._extendLeftPoints = [], this._extendRightPoints = [], this._source.points().length < 4 || (t = this._source.pointToScreenPoint(this._source.points()[0])[1], e = this._source.pointToScreenPoint(this._source.points()[1])[1], i = this._source.pointToScreenPoint(this._source.points()[2])[1], o = this._source.pointToScreenPoint(this._source.points()[3])[1], n = o.substract(t), r = i.substract(n.scaled(.25)), a = e.substract(i), l = o.add(a.scaled(.25)), h = this._model.timeScale().width(), c = this._source.priceScale().height(), this._source.properties().extendLeft.value() && (this._extendLeftPoints = s(i, t, r, h, c)), this._source.properties().extendRight.value() && (this._extendRightPoints = s(o, e, l, h, c)))
    }, c.prototype.renderer = function() { var t, e, i, o; return this._points.length < 2 ? new g : (this._invalidated && (this.updateImpl(), this._invalidated = !1), t = [].concat(this._points), this._source._controlPoints && (t.push(this._source.pointToScreenPoint(this._source._controlPoints[0])[0]), t.push(this._source.pointToScreenPoint(this._source._controlPoints[1])[0])), e = {}, i = this._source.properties(), e.points = t, e.color = i.linecolor.value(), e.linewidth = i.linewidth.value(), e.linestyle = i.linestyle.value(), e.leftend = i.leftEnd.value(), e.rightend = i.rightEnd.value(), e.fillBack = i.fillBackground.value(), e.backcolor = i.backgroundColor.value(), e.transparency = i.transparency.value(), e.extendLeftPoints = this._extendLeftPoints, e.extendRightPoints = this._extendRightPoints, o = new g, o.append(new h(e)), this.addAnchors(o), o) }, inherit(d, u), d.prototype.pointsCount = function() {
        return 2
    }, d.prototype.title = function() { return "Double Curve" }, d.prototype.controlPoints = function() {
        var t = this.pointToScreenPoint(this.points()[0])[0],
            e = this.pointToScreenPoint(this.points()[1])[0],
            i = e.substract(t).scaled(.5),
            o = i.transponed().scaled(.3),
            n = t.add(e).scaled(.33),
            s = t.add(e).scaled(.67),
            r = n.add(o),
            a = s.substract(o);
        return [this.screenPointToPoint(r), this.screenPointToPoint(a)]
    }, d.prototype.setLastPoint = function(t, e) { u.prototype.setLastPoint.call(this, t, e), this._controlPoints = this.controlPoints() }, d.prototype.addPoint = function(t, e, i) { var o, n = u.prototype.addPoint.call(this, t, e, !0); return n && (o = this.controlPoints(), delete this._controlPoints, this._points.push(o[0]), this._points.push(o[1]), i || (this.normalizePoints(), this.createServerPoints()), this._createPointProperty(2), this._createPointProperty(3)), n }, d.prototype.restorePoints = function(t, e, i) { u.prototype.restorePoints.call(this, t, e, i), this._createPointProperty(2), this._createPointProperty(3) }, e.LineToolBezierQuadro = l, e.LineToolBezierCubic = d
}, function(t, e, i) {
    "use strict";

    function o() {}

    function n(t, e) { this._source = t, this._data = e }

    function s(t, e) { h.call(this, t, e), this._rendererSource = new o, this._invalidated = !0 }

    function r(t, e) {
        this._constructor = "LineToolNote";
        var i = e || new f("linetoolnote");
        c.call(this, t, new s(this, t), i), this.version = r.version
    }

    function a(t, e) {
        var i = e || new f("linetoolnoteabsolute");
        i.locked.value() || i.locked.setValue(!0), r.call(this, t, i)
    }
    var l = i(2),
        h = i(9),
        c = i(1).LineDataSource,
        d = i(16).TextRenderer,
        p = i(68).SelectionRenderer,
        u = i(8),
        _ = i(6),
        f = i(7).DefaultProperty,
        m = i(14);
    o.prototype.update = function(t) { this._data && (!this._data || t.markerColor === this._data.markerColor && t.width === this._data.width && t.height === this._data.height) || this._createSource(t.width, t.height, t.markerColor), this._data = t }, o.prototype._createSource = function(t, e, i) {
        var o, n;
        this._sourceCanvas = document.createElement("canvas"), this._sourceCanvas.width = t, this._sourceCanvas.height = e, this._translate = new l.Point(-t / 2, .5 - e), this._translate.x % 1 == 0 && (this._translate.x += .5), o = this._sourceCanvas.getContext("2d"), n = .6 * t, o.fillStyle = i, o.beginPath(), o.moveTo(t / 2, e), o.quadraticCurveTo(t, t / 1.15, t, t / 2), o.arc(t / 2, t / 2, t / 2, 0, Math.PI, !0), o.quadraticCurveTo(0, t / 1.15, t / 2, e), o.fill(), o.globalCompositeOperation = "destination-out", o.beginPath(), o.moveTo((t - n) / 2, t / 2), o.arc(t / 2, t / 2, n / 2, 0, 2 * Math.PI), o.fill()
    }, o.prototype.drawOn = function(t) {
        var e = new l.Point(Math.round(this._data.point.x), Math.round(this._data.point.y)).add(this._translate);
        t.drawImage(this._sourceCanvas, e.x, e.y)
    }, o.prototype.hasPoint = function(t) {
        var e = this._data.point.add(this._translate),
            i = new l.Point(this._data.point.x - this._translate.x, this._data.point.y);
        return l.pointInRect(t, e, i)
    }, n.prototype.draw = function(t) { this._source.drawOn(t), this._data.tooltipVisible && this.drawTooltipOn(t) }, n.prototype.drawTooltipOn = function(t) {
        var e, i, o, n, s, a, l, h, c, p, u, _, f, g, v;
        for (t.save(), e = (this._data.text + "").replace(/^\s+|\s+$/g, "").replace(/[\r\n]+/g, "\n"), t.font = (this._data.bold ? "bold " : "") + (this._data.italic ? "italic " : "") + this._data.fontSize + "px " + this._data.font,
            i = r.TOOLTIP_WIDTH - 2 * r.TOOLTIP_PADDING, o = d.prototype.wordWrap(e, i, t.font), n = this._data.point, s = r.TOOLTIP_LINESPACING, a = r.TOOLTIP_WIDTH, l = o.length * this._data.fontSize + 2 * r.TOOLTIP_PADDING, o.length > 1 && (l += (o.length - 1) * s), h = Math.round(n.x - a / 2), c = Math.round(n.y - this._data.height - l - 8), p = n.x < 20 || n.x + 20 > this._data.vpWidth, u = p ? null : "top", _ = p ? null : Math.round(n.x), c < 10 ? c = n.y + 13 : u = "bottom", h < 10 ? h += Math.abs(h - 10) : h + a + 10 > this._data.vpWidth && (h -= h + a + 10 - this._data.vpWidth), t.fillStyle = m.generateColor(this._data.backgroundColor, this._data.backgroundTransparency), t.strokeStyle = this._data.markerColor, t.lineWidth = 1, t.beginPath(), t.moveTo(h, c), p || "top" !== u || (t.lineTo(_ - 7, c), t.lineTo(_, c - 7), t.lineTo(_ + 7, c)), t.lineTo(h + a, c), t.lineTo(h + a, c + l), p || "bottom" !== u || (t.lineTo(_ + 7, c + l), t.lineTo(_, c + l + 7), t.lineTo(_ - 7, c + l)), t.lineTo(h, c + l), t.closePath(), t.fill(), t.stroke(), t.textBaseline = "middle", t.fillStyle = this._data.textColor, f = h + r.TOOLTIP_PADDING, g = c + r.TOOLTIP_PADDING + this._data.fontSize / 2, v = 0; v < o.length; v++) t.fillText(o[v].replace(/^\s+/, ""), f, g), g += this._data.fontSize + s;
        t.restore()
    }, n.prototype.hitTest = function(t) { if (this._source.hasPoint(t)) return new u(u.MOVEPOINT) }, inherit(s, h), s.prototype.update = function() { this._invalidated = !0 }, s.prototype.updateImpl = function() { h.prototype.update.call(this), this._invalidated = !1 }, s.prototype.isLabelVisible = function() { return this.isHoveredSource() || this.isSelectedSource() }, s.prototype.renderer = function() { var t, e, i, o, s, r, a; return this._invalidated && this.updateImpl(), t = new _, e = this._source.properties(), i = e.locked && e.locked.value(), o = i ? this._source.fixedPoints() : this._points, o.length < 1 ? t : (s = this.isLabelVisible(), r = s, a = $.extend(e.state(), { point: o[0], width: 24, height: 32, tooltipVisible: r, vpWidth: this._model.m_timeScale.m_width, vpHeight: this._source.m_priceScale.m_height }), this._rendererSource.update(a), t.append(new n(this._rendererSource, a)), s && t.append(new p({ points: o })), t) }, inherit(r, c), r.TOOLTIP_WIDTH = 300, r.TOOLTIP_PADDING = 10, r.TOOLTIP_LINESPACING = 5, r.version = 1, r.prototype.pointsCount = function() { return 1 }, r.prototype.title = function() { return $.t("Note") }, r.prototype.restoreTemplate = function(t) { delete t.locked, delete t.text, c.prototype.restoreTemplate.call(this, t) }, inherit(a, r), a.prototype.title = function() { return $.t("Anchored Note") }, r.prototype.state = function(t) { var e = c.prototype.state.call(this, t); return t && (e.state.fixedSize = !1), e }, e.LineToolNote = r, e.LineToolNoteAbsolute = a
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { this._data = t, this._hittestResult = e || new c(c.MOVEPOINT), this._backHittestResult = i || new c(c.MOVEPOINT_BACKGROUND) }

    function n(t, e) { l.call(this, t, e), this._invalidated = !0 }

    function s(t, e) {
        this._constructor = "LineToolParallelChannel";
        var i = e || new u("linetoolparallelchannel");
        h.call(this, t, new n(this, t), i)
    }
    var r = i(2),
        a = i(365).clipSegmentToViewport,
        l = i(9),
        h = i(1).LineDataSource,
        c = i(8),
        d = i(59).PaneRendererClockIcon,
        p = i(6),
        u = i(7).DefaultProperty,
        _ = i(14);
    o.prototype.extendPoints = function(t, e, i, o) {
        var n, s, a = new r.Point(0, 0),
            l = new r.Point(i, o);
        return this._data.extendleft && (n = t.substract(e),
            (s = r.intersectRayWithRect(t, t.add(n), a, l)) && (t = s)), this._data.extendright && (n = e.substract(t), (s = r.intersectRayWithRect(e, e.add(n), a, l)) && (e = s)), this._data.extendleft && !r.pointInRect(t, a, l) && r.pointInRect(e, a, l) && (s = r.intersectRayWithRect(e, t, a, l)) && (t = s), this._data.extendright && !r.pointInRect(e, a, l) && r.pointInRect(t, a, l) && (s = r.intersectRayWithRect(t, e, a, l)) && (e = s), [t, e]
    }, o.prototype.getColor = function() { return _.generateColor(this._data.backcolor, this._data.transparency) }, o.prototype.draw = function(t) {
        var e, i, o, n, s, l, h, c, d, p, u, _, f, m, g;
        if (!(this._data.points.length < 2) && (t.lineCap = "butt", t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, t.lineStyle = this._data.linestyle, e = this._data.points[0], i = this._data.points[1], o = this.extendPoints(e, i, this._data.width, this._data.height), n = a(o[0], o[1], this._data.width, this._data.height), n && !this._data.skipLines && CanvasEx.drawLine(t, n[0].x, n[0].y, n[1].x, n[1].y), 4 === this._data.points.length)) {
            if (s = this._data.points[2], l = this._data.points[3], !s || !l) return;
            if (h = this.extendPoints(s, l, this._data.width, this._data.height), n = a(h[0], h[1], this._data.width, this._data.height), !n || this._data.skipLines || this._data.skipTopLine || CanvasEx.drawLine(t, n[0].x, n[0].y, n[1].x, n[1].y), this._data.fillBackground) {
                if (c = Math.max(o[1].x, h[1].x), d = Math.max(o[1].y, h[1].y), p = Math.min(h[0].x, o[0].x), u = Math.min(h[0].y, o[0].y), !(isFinite(c) && isFinite(d) && isFinite(p) && isFinite(u))) return;
                t.fillStyle = this.getColor(), t.beginPath(), t.moveTo(o[0].x, o[0].y), t.lineTo(o[1].x, o[1].y), this._data.extendright && (_ = r.optionalCorner(o[1], h[1], this._data.width, this._data.height)) && t.lineTo(_.x, _.y), t.lineTo(h[1].x, h[1].y), t.lineTo(h[0].x, h[0].y), this._data.extendleft && (f = r.optionalCorner(h[0], o[0], this._data.width, this._data.height)) && t.lineTo(f.x, f.y), t.lineTo(o[0].x, o[0].y), t.fill()
            }
            this._data.showMidline && !this._data.skipLines && (t.strokeStyle = this._data.midcolor, t.lineWidth = this._data.midlinewidth, t.lineStyle = this._data.midlinestyle, m = this._data.points[0].add(this._data.points[2]).scaled(.5), g = this._data.points[1].add(this._data.points[3]).scaled(.5), h = this.extendPoints(m, g, this._data.width, this._data.height), (n = a(h[0], h[1], this._data.width, this._data.height)) && CanvasEx.drawLine(t, n[0].x, n[0].y, n[1].x, n[1].y))
        }
    }, o.prototype.hitTest = function(t) {
        var e, i, o, n, s, a, l, h, c, d, p, u, _, f, m, g, v;
        if (this._data.points.length < 2) return null;
        if (e = 3, i = this._data.floatPoints || this._data.points, o = i[0], n = i[1], s = i[2], a = i[3], l = this.extendPoints(o, n, this._data.width, this._data.height), h = r.distanceToSegment(l[0], l[1], t), h.distance <= e) return this._hittestResult;
        if (4 === this._data.points.length && !this._data.skipTopLine) { if (!s || !a) return null; if (l = this.extendPoints(s, a, this._data.width, this._data.height), h = r.distanceToSegment(l[0], l[1], t), h.distance <= e) return this._hittestResult; if (this._data.showMidline && !this._data.skipLines && (c = o.add(s).scaled(.5), d = n.add(a).scaled(.5), l = this.extendPoints(c, d, this._data.width, this._data.height), h = r.distanceToSegment(l[0], l[1], t), h.distance <= e)) return this._hittestResult }
        if (this._data.hittestOnBackground && this._data.fillBackground && 4 === this._data.points.length) { if (p = (n.y - o.y) / (n.x - o.x), u = o.y + p * (t.x - o.x), _ = s.y + p * (t.x - s.x), f = Math.max(u, _), m = Math.min(u, _), g = Math.min(o.x, n.x), v = Math.max(o.x, n.x), !this._data.extendleft && t.x < g) return null; if (!this._data.extendright && t.x > v) return null; if (t.y >= m && t.y <= f) return this._backHittestResult }
        return null
    }, inherit(n, l), n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() {
        var t, e, i, o, n, s, r, a, h, c, d;
        l.prototype.update.call(this), this._source.priceScale() && !this._source.priceScale().isEmpty() && 0 !== this._source.points().length && (this._source._priceOffset || this._source.calculatePriceDiff(), 3 === this._points.length && this._source._priceOffset && (t = this._points[0], e = this._points[1], i = this._source._priceOffset + this._source.points()[0].price, o = this._source._priceOffset + this._source.points()[1].price, this._p3 = t.clone(), this._p4 = e.clone(), n = this._source.priceScale(), n.isLog() ? (s = .5 * (i + o) - this._source._priceOffset, r = .5 * (i + o), a = this._source.priceScale().priceToCoordinate(s), h = this._source.priceScale().priceToCoordinate(r), c = h - a, this._p3.y += c, this._p4.y += c) : (n.isPercent() && (d = this._source.ownerSource().firstValue(), i = n.priceRange().convertToPercent(i, d), o = n.priceRange().convertToPercent(o, d)), this._p3.y = this._source.priceScale().priceToCoordinate(i), this._p4.y = this._source.priceScale().priceToCoordinate(o))))
    }, n.prototype.renderer = function() { var t, e, i, n, s, r; return this._invalidated && (this.updateImpl(), this._invalidated = !1), t = {}, t.points = [], this._points.length > 1 && (t.points.push(this._points[0]), t.points.push(this._points[1])), this._points.length > 2 && (t.points.push(this._p3), t.points.push(this._p4)), t.color = this._source.properties().linecolor.value(), t.width = this._model.timeScale().width(), t.height = this._source.priceScale().height(), e = this._source.properties(), t.linewidth = e.linewidth.value(), t.linestyle = e.linestyle.value(), t.extendleft = e.extendLeft.value(), t.extendright = e.extendRight.value(), t.fillBackground = e.fillBackground.value(), t.backcolor = e.backgroundColor.value(), t.transparency = e.transparency.value(), t.showMidline = e.showMidline.value(), t.midlinewidth = e.midlinewidth.value(), t.midlinestyle = e.midlinestyle.value(), t.midcolor = e.midlinecolor.value(), t.fillBackground = e.fillBackground.value(), t.hittestOnBackground = !0, i = new p, i.append(new o(t)), this.isAnchorsRequired() && (n = [], n.push(this._points[0]), this._points[1] && n.push(this._points[1]), this._p3 && (n.push(this._p3.add(this._p4).scaled(.5)), n[2].data = 2), s = 3 === this._points.length && !this._p3, this._model.lineBeingCreated() !== this._source || s || n.pop(), i.append(this.createLineAnchor({ points: n }))), !TradingView.printing && this._source.hasAlert.value() && !this._model.readOnly() && this._points.length >= 2 && (r = this._points, this._source.getAlertIsActive(function(t) { i.append(new d({ point1: r[0], point2: r[1], color: t ? e.linecolor.value() : defaults("chartproperties.alertsProperties.drawingIcon.color") })) })), i }, inherit(s, h), s.prototype.addPoint = function(t) {
        var e, i = h.prototype.addPoint.call(this, t);
        return i && (e = this.points()[0], this._points[2].index = e.index, this._points[2].price = e.price + this._priceOffset), i
    }, s.prototype.calculatePriceDiff = function() {
        var t, e, i, o, n, s, r, a, l, h, c, d, p, u, _, f, m, g, v;
        if (3 === this.points().length) {
            if (t = this.points()[0], e = this.points()[1], i = this.points()[2], t.index === e.index) return;
            if (null === (o = this.priceScale())) return;
            if (o.isLog()) {
                if (n = this._model.timeScale(), n.isEmpty()) return;
                s = n.indexToCoordinate(t.index), r = n.indexToCoordinate(e.index), a = o.priceToCoordinate(t.price), l = o.priceToCoordinate(e.price), h = n.indexToCoordinate(i.index), c = (l - a) / (r - s), d = a + c * (h - s), p = o.priceToCoordinate(i.price), u = p - d, _ = .5 * (a + l), f = o.coordinateToPrice(_), m = _ + u, g = o.coordinateToPrice(m), this._priceOffset = g - f
            } else c = (e.price - t.price) / (e.index - t.index), v = t.price + c * (i.index - t.index), this._priceOffset = i.price - v
        }
    }, s.prototype.setLastPoint = function(t, e) { e && e.shift && 2 === this.points().length && this._snapPoint45Degree(t, this.points()[0]), h.prototype.setLastPoint.call(this, t), this.calculatePriceDiff() }, s.prototype.restorePoints = function(t, e, i) { h.prototype.restorePoints.call(this, t, e, i), t && t.length >= 3 && (this._priceOffset = t[2].price - t[0].price) }, s.prototype.setPoint = function(t, e, i) {
        i && i.shift && t < 2 && this._snapPoint45Degree(e, this.points()[1 - t]), h.prototype.setPoint.call(this, t, e, i), 2 === t && this.calculatePriceDiff();
        var o = this.points()[0];
        this._points[2].index = o.index, this._points[2].price = o.price + this._priceOffset
    }, s.prototype.pointsCount = function() { return 3 }, s.prototype.title = function() { return "Parallel Channel" }, s.prototype.addPoint = function(t, e) { return e && e.shift && 2 === this.points().length && this._snapPoint45Degree(t, this.points()[0]), h.prototype.addPoint.call(this, t, e) }, s.prototype.fixAfterRestorePriceAxis = function() { this.priceScale().isLog() || delete this._priceOffset }, s.prototype.cloneData = function(t) { this._priceOffset = t._priceOffset }, s.prototype.restoreData = function(t) { t.priceOffset && (this._priceOffset = t.priceOffset) }, s.prototype.state = function(t) { var e = h.prototype.state.call(this, t); return e.priceOffset = this._priceOffset, e }, s.prototype.canHasAlert = function() { return !0 }, s.prototype._getAlertPlots = function() {
        function t(t, e) { return t.index <= e.index ? [t, e] : [e, t] }
        var e, i, o, n, s, r, a, l, h = [].concat(this._points).splice(0, 2);
        return h = h.concat([{ price: h[0].price + this._priceOffset, time: h[0].time, index: h[0].index }, { price: h[1].price + this._priceOffset, time: h[1].time, index: h[1].index }]), e = t(h[0], h[1]), i = t(h[2], h[3]), this._priceOffset < 0 ? (n = i, o = e) : (n = e, o = i), a = this.properties().extendLeft.value(), l = this.properties().extendRight.value(), h[0].index <= h[1].index ? (s = a, r = l) : (s = l, r = a), [this._linePointsToAlertPlot(o, "Upper", s, r), this._linePointsToAlertPlot(n, "Lower", s, r)]
    }, e.LineToolParallelChannel = s, e.ParallelChannelRenderer = o
}, function(t, e, i) {
    (function(t) {
        "use strict";

        function o(t, e) { h.call(this, t, e), this._rendererCache = {}, this._invalidated = !0, this._percentageFormatter = new b, this._numericFormatter = new w, this._pipFormatter = null }

        function n(t, e, i, o) {
            this._source = t, this._model = e, this._text = "", this._invalidated = !0, this._coordinate = 0, this._background = "black",
                this._pricePropName = i, this._colorPropName = o
        }

        function s(e, i) {
            var r, a, l, h, d, p, u, _, f, m, g = i || new y("linetoolriskreward");
            this._entryPriceAxisView = new n(this, e, "entryPrice", "linecolor"), this._stopPriceAxisView = new n(this, e, "stopPrice", "stopBackground"), this._profitPriceAxisView = new n(this, e, "targetPrice", "profitBackground"), c.call(this, e, new o(this, e), g), this._properties.addExclusion && (this._properties.addExclusion("stopLevel"), this._properties.addExclusion("profitLevel")), i.stopLevel || i.profitLevel || (r = e.timeScale().visibleBars(), a = r.firstBar(), l = r.lastBar(), h = e.mainSeries().priceRange(a, l), d = e.mainSeries().priceScale(), d.isLog() && (p = d.logicalToPrice(h.minValue()), u = d.logicalToPrice(h.maxValue()), h = new t(p, u)), d.isPercent() && (_ = e.mainSeries().firstValue(), p = d.priceRange().convertFromPercent(h.minValue(), _), u = d.priceRange().convertFromPercent(h.maxValue(), _), h = new t(p, u)), h && !h.isEmpty() && (f = Math.round(.2 * h.length() * e.mainSeries().base()), g.merge({ stopLevel: f, profitLevel: f }))), m = this, g.stopLevel.listeners().subscribe(this, this.recalculate), g.stopLevel.listeners().subscribe(null, function() { m.properties().stopPrice._listeners.fire(m.properties().stopPrice) }), g.profitLevel.listeners().subscribe(this, this.recalculate), g.profitLevel.listeners().subscribe(null, function() { m.properties().targetPrice._listeners.fire(m.properties().targetPrice) }), g.addChild("entryPrice", new s.PriceProperty(this, 0)), g.addChild("stopPrice", new s.StopPriceProperty(this)), g.addChild("targetPrice", new s.TargetPriceProperty(this)), g.addProperty("riskSize", 250), g.addProperty("qty", 0), g.addProperty("amountTarget", g.accountSize.value()), g.addProperty("amountStop", g.accountSize.value()), g.risk.subscribe(this, this._recalculateRiskSize), g.accountSize.subscribe(this, this._recalculateRiskSize), g.showRiskInPercents.subscribe(this, this._recalculateRisk), g.showRiskInPercents.subscribe(this, this._recalculateRiskSize), this.version = s.version
        }

        function r(t, e) {
            var i, o;
            this._constructor = "LineToolRiskRewardShort", i = e || new y("linetoolriskrewardshort"), s.call(this, t, i), o = this.properties(), o.entryPrice.subscribe(this, this._recalculateQty), o.stopPrice.subscribe(this, this._recalculateQty), o.riskSize.subscribe(this, this._recalculateQty), o.entryPrice.subscribe(this, this._recalculateAmount), o.profitLevel.subscribe(this, this._recalculateAmount), o.stopLevel.subscribe(this, this._recalculateAmount), o.accountSize.subscribe(this, this._recalculateAmount), o.riskSize.subscribe(this, this._recalculateAmount), o.qty.subscribe(this, this._recalculateAmount)
        }

        function a(t, e) {
            var i, o;
            this._constructor = "LineToolRiskRewardLong", i = e || new y("linetoolriskrewardlong"), s.call(this, t, i), o = this.properties(), o.entryPrice.subscribe(this, this._recalculateQty), o.stopPrice.subscribe(this, this._recalculateQty), o.riskSize.subscribe(this, this._recalculateQty), o.entryPrice.subscribe(this, this._recalculateAmount), o.profitLevel.subscribe(this, this._recalculateAmount), o.stopLevel.subscribe(this, this._recalculateAmount), o.accountSize.subscribe(this, this._recalculateAmount),
                o.riskSize.subscribe(this, this._recalculateAmount), o.qty.subscribe(this, this._recalculateAmount)
        }
        var l = i(2),
            h = i(9),
            c = i(1).LineDataSource,
            d = i(11).TrendLineRenderer,
            p = i(66),
            u = i(67),
            _ = i(16).TextRenderer,
            f = i(45).RectangleRenderer,
            m = i(42),
            g = i(8),
            v = i(6),
            y = i(7).DefaultProperty,
            b = i(70).PercentageFormatter,
            w = i(26).NumericFormatter,
            S = i(219).PipFormatter,
            T = i(14);
        inherit(o, h), o.prototype.i18nCache = { pnl: $.t("{0} P&L: {1}"), open: $.t("Open", { context: "line_tool_position" }), closed: $.t("Closed", { context: "line_tool_position" }), ratio: $.t("Risk/Reward Ratio: {0}"), stop: $.t("Stop: {0} ({1}) {2}, Amount: {3}"), target: $.t("Target: {0} ({1}) {2}, Amount: {3}"), qty: $.t("Qty: {0}") }, o.prototype._formatInTicks = function(t) { var e = this._model.mainSeries().base(); return Math.round(t * e) }, o.prototype.isLabelVisible = function() { return this.isHoveredSource() || this.isSelectedSource() }, o.prototype.update = function() { this._invalidated = !0 }, o.prototype._updateImpl = function() {
                var t, e, i, o, n, r, a;
                h.prototype.update.call(this), this._stopLevel = null, this._profitLevel = null, t = this._model.timeScale(), !(e = this._source.priceScale()) || e.isEmpty() || t.isEmpty() || 0 !== this._source.points().length && 0 !== this._points.length && this._model.mainSeries().bars().last() && (this._source.points().length < 2 || 0 !== this._model.mainSeries().bars().length && (this._isClosed = 4 === this._source.points().length, (i = this._source.lastBarData()) && (o = this._source.priceScale(), n = this._source.stopPrice(), r = this._source.profitPrice(), this._pl = this._source.points().length > 1 ? this._source.calculatePL(i.closePrice) : 0, o.isPercent() && (a = this._source.ownerSource().firstValue(), n = o.priceRange().convertToPercent(n, a), r = o.priceRange().convertToPercent(r, a), i.closePrice = o.priceRange().convertToPercent(i.closePrice, a)), this._entryLevel = this._points[s.INDEX_ENTRY].y, this._stopLevel = e.priceToCoordinate(n), this._profitLevel = e.priceToCoordinate(r), this._closeLevel = e.priceToCoordinate(i.closePrice), this._closeBar = this._source._model.timeScale().indexToCoordinate(i.index))))
            }, o.prototype.renderer = function() {
                var t, e, i, o, n, r, a, h, p, u, m, y, b, w, C, x, P, L, k, I, A, E, M, D, O, $, V, B, R, N, F, z, W, H, U, j, q, Y;
                return this._invalidated && (this._updateImpl(), this._invalidated = !1), t = new v, this._points.length < 2 || this._source.points().length < 2 ? t : (e = this, i = this._source.properties(), o = this._points[s.INDEX_ENTRY].x, n = this._points[s.INDEX_ACTUALENTRY] ? this._points[s.INDEX_ACTUALENTRY].x : this._points[s.INDEX_CLOSE].x, r = this._points[s.INDEX_ACTUALCLOSE] ? this._points[s.INDEX_ACTUALCLOSE].x : this._points[s.INDEX_CLOSE].x, a = this._points[s.INDEX_CLOSE].x, h = new l.Point(o, this._entryLevel), p = new l.Point(a, this._stopLevel), u = {}, u.points = [h, p], u.color = "white", u.linewidth = 0, u.backcolor = i.stopBackground.value(), u.fillBackground = !0, u.transparency = i.stopBackgroundTransparency.value(), t.append(new f(u, new g(g.MOVEPOINT), new g(g.MOVEPOINT))), this._pl < 0 && (h = new l.Point(n, this._entryLevel), p = new l.Point(r, this._closeLevel), u = {}, u.points = [h, p], u.color = "white", u.linewidth = 0, u.backcolor = i.stopBackground.value(), u.fillBackground = !0, m = .01 * i.stopBackgroundTransparency.value(),
                    y = 100 * (1 - m * m * m), b = 100 - y, u.transparency = b, t.append(new f(u, new g(g.MOVEPOINT), new g(g.MOVEPOINT)))), h = new l.Point(o, this._entryLevel), p = new l.Point(a, this._profitLevel), u = {}, u.points = [h, p], u.color = "white", u.linewidth = 0, u.backcolor = i.profitBackground.value(), u.fillBackground = !0, u.transparency = i.profitBackgroundTransparency.value(), t.append(new f(u, new g(g.MOVEPOINT), new g(g.MOVEPOINT))), this._pl > 0 && (h = new l.Point(n, this._entryLevel), p = new l.Point(r, this._closeLevel), u = {}, u.points = [h, p], u.color = "white", u.linewidth = 0, u.backcolor = i.profitBackground.value(), u.fillBackground = !0, m = .01 * i.profitBackgroundTransparency.value(), w = 100 * (1 - m * m * m), C = 100 - w, u.transparency = C, t.append(new f(u, new g(g.MOVEPOINT), new g(g.MOVEPOINT)))), x = function(i, o, n) {
                    var s = {};
                    s.points = [i, o], s.width = e._model.timeScale().width(), s.height = e._source.priceScale().height(), s.color = n || e._source.properties().linecolor.value(), s.linewidth = e._source.properties().linewidth.value(), s.linestyle = CanvasEx.LINESTYLE_SOLID, s.extendleft = !1, s.extendright = !1, s.leftend = c.LINEEND_NORMAL, s.rightend = c.LINEEND_NORMAL, t.append(new d(s))
                }, this._points[s.INDEX_ACTUALENTRY] && (h = this._points[s.INDEX_ACTUALENTRY], p = this._isClosed ? this._points[s.INDEX_ACTUALCLOSE] : new l.Point(this._closeBar, this._closeLevel), u = {}, u.points = [h, p], u.width = e._model.timeScale().width(), u.height = e._source.priceScale().height(), u.color = e._source.properties().linecolor.value(), u.linewidth = 1, u.linestyle = CanvasEx.LINESTYLE_DASHED, u.extendleft = !1, u.extendright = !1, u.leftend = c.LINEEND_NORMAL, u.rightend = c.LINEEND_ARROW, t.append(new d(u))), e = this, P = function(o, n, s, r, a, l) {
                    if (e.isLabelVisible() || TradingView.printing) {
                        var h = {};
                        h.points = [o], h.text = n, h.color = i.textcolor.value(), h.font = i.font.value(), h.offsetX = 3, h.offsetY = a, h.vertAlign = r, h.horzAlign = "center", h.backgroundRoundRect = 4, h.backgroundColor = T.resetTransparency(s), h.fontsize = i.fontsize.value(), h.backgroundHorzInflate = 4, h.backgroundVertInflate = 2, l && (h.borderColor = l), t.append(new _(h, e._rendererCache))
                    }
                }, L = this._source.entryPrice(), k = this._source.stopPrice(), I = this._source.profitPrice(), A = Math.abs(k - L), E = Math.round(1e4 * A / L) / 100, M = Math.abs(I - L), D = Math.round(1e4 * M / L) / 100, O = Math.abs(L - I) / Math.abs(L - k), h = new l.Point(o, this._points[s.INDEX_ENTRY].y), p = new l.Point(a, this._points[s.INDEX_ENTRY].y), x(h, p), $ = new l.Point((o + a) / 2, Math.round(this._points[0].y) + .5), V = "", B = "", R = this._numericFormatter.format(Math.round(100 * O) / 100), this._points[1] && void 0 !== this._pl && (B = this._source.priceScale().formatter().format(this._pl)), i.compact.value() ? (V += B ? B + " ~ " : "", V += i.qty.value() + "\n", V += R) : (N = this._isClosed ? this.i18nCache.closed : this.i18nCache.open, V += B ? this.i18nCache.pnl.format(N, B) + ", " : "", V += this.i18nCache.qty.format(i.qty.value()) + "\n", V += this.i18nCache.ratio.format(R) + " "), F = i.linecolor.value(), this._pl < 0 ? F = i.stopBackground.value() : this._pl > 0 && (F = i.profitBackground.value()), P($, V, F, "middle", 0, "white"), h = new l.Point(o, this._stopLevel), p = new l.Point(a, this._stopLevel), x(h, p, i.stopBackground.value()), z = this._model.mainSeries().symbolInfo(), !this._pipFormatter && z && (this._pipFormatter = new S(z.pricescale, z.minmov, z.type, z.minmove2)), $ = new l.Point((o + a) / 2, this._stopLevel), V = "", W = this._source.priceScale().formatter().format(A), H = this._percentageFormatter.format(E), V = i.compact.value() ? W + " (" + H + ") " + i.amountStop.value() : this.i18nCache.stop.format(this._source.priceScale().formatter().format(A), this._percentageFormatter.format(E), this._pipFormatter ? this._pipFormatter.format(A) : "", i.amountStop.value()), P($, V, i.stopBackground.value(), L < k ? "bottom" : "top", L < k ? -12 : -1), h = new l.Point(o, this._profitLevel), p = new l.Point(a, this._profitLevel), x(h, p, i.profitBackground.value()), $ = new l.Point((o + a) / 2, this._profitLevel), V = "", W = this._source.priceScale().formatter().format(M), H = this._percentageFormatter.format(D), V = i.compact.value() ? W + " (" + H + ") " + i.amountTarget.value() : this.i18nCache.target.format(this._source.priceScale().formatter().format(M), this._percentageFormatter.format(D), this._pipFormatter.format(M), i.amountTarget.value()), P($, V, i.profitBackground.value(), L < k ? "top" : "bottom", L < k ? -1 : -12), this.isAnchorsRequired() && (U = this._points[0].clone(), U.data = 0, j = new l.Point(o, this._stopLevel), j.data = 1, q = new l.Point(o, this._profitLevel), q.data = 2, Y = new l.Point(a, U.y), Y.data = 3, t.append(this.createLineAnchor({ points: [U, j, q, Y] }))), t)
            }, inherit(n, p), n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() {
                if (0 !== this._source.points().length && this._source.priceScale() && !this._source.priceScale().isEmpty()) {
                    var t = this._source.properties()[this._pricePropName].value();
                    this._background = this._source.properties()[this._colorPropName].value(), this._coordinate = this._source.priceScale().priceToCoordinate(t), this._text = this._source.priceScale() ? this._source.priceScale().formatter().format(t) : ""
                }
            }, n.prototype.renderer = function() { this._invalidated && (this.updateImpl(), this._invalidated = !1); var t = { text: this._text, coordinate: this._coordinate, color: this.color(), background: T.resetTransparency(this._background), visible: !0 }; return new u(t) }, inherit(s, c), s.prototype._roundValue = function(t) { return parseFloat(t.toFixed(2)) }, s.prototype._recalculateRisk = function() {
                var t = this.properties(),
                    e = t.showRiskInPercents.value(),
                    i = t.riskSize.value(),
                    o = t.accountSize.value(),
                    n = t.risk.value();
                n = e ? this._roundValue(i / o * 100) : this._roundValue(o / 100 * n), this._riskInChange = !0, t.risk.setValue(n), this._riskInChange = !1
            }, s.prototype._recalculateRiskSize = function(t) {
                var e, i, o, n;
                this._riskInChange || (e = this.properties(), i = e.risk.value(), o = e.showRiskInPercents.value(), n = e.accountSize.value(), o ? e.riskSize.setValue(i / 100 * n, t) : i > n ? (e.risk.setValue(n), e.riskSize.setValue(n, t)) : e.riskSize.setValue(i, t))
            }, s.version = 2, s.INDEX_ENTRY = 0, s.INDEX_CLOSE = 1, s.INDEX_ACTUALENTRY = 2, s.INDEX_ACTUALCLOSE = 3, s.prototype.i18nCache = { title: $.t("Risk/Reward") }, s.prototype.lastBarData = function() {
                var t, e, i, o, n, r = parseInt(this._model.mainSeries().bars().first()),
                    a = parseInt(this._model.mainSeries().bars().last());
                return isNaN(r) || isNaN(a) ? null : (t = this.points(), 4 === t.length ? (e = t[s.INDEX_ACTUALCLOSE], e.index < r ? null : {
                    closePrice: e.price,
                    index: Math.min(a, e.index)
                }) : (i = t[s.INDEX_CLOSE], i.index < r ? null : (o = Math.min(a, i.index), n = this._model.mainSeries().bars().valueAt(o), { closePrice: n[TradingView.CLOSE_PLOT], index: o })))
            }, s.prototype.migrateVersion = function(t, e, i) {
                var o, n, s, r;
                1 === t && this._points.length >= 1 && (o = [], o.push(this._points[0]), n = this._points[0], n = { price: n.price, index: n.index + 50 }, o.push(n), this._points[1] && o.push(this._points[1]), this._points[2] && o.push(this._points[2]), this._points = o, this._timePoint.length >= 1 && (s = [], n = this._timePoint[0], s.push(n), r = { price: n.price, time_t: n.time_t, offset: n.offset + 50 }, s.push(r), this._timePoint[1] && o.push(this._points[1]), this._timePoint[2] && o.push(this._points[2]), this._timePoint = s))
            }, s.prototype.checkAlert = function() { this.recalculate() }, s.prototype.priceAxisViews = function(t, e) { return this._isActualSymbol ? e !== this.priceScale() || this._model.paneForSource(this) !== t ? null : [this._entryPriceAxisView, this._stopPriceAxisView, this._profitPriceAxisView] : null }, s.prototype.updateAllViews = function() { this._isActualSymbol && this._properties.visible.value() && (m.hideAllDrawings().value() && this.userEditEnabled() || (c.prototype.updateAllViews.call(this), this._entryPriceAxisView.update(), this._stopPriceAxisView.update(), this._profitPriceAxisView.update())) }, s.prototype.setPoint = function(t, e) {
                var i, o = this.priceScale();
                switch (o.isPercent() && (i = this.ownerSource().firstValue(), e.price = o.priceRange().convertFromPercent(e.price, i)), t) {
                    case 0:
                        e.price = this._roundPrice(e.price), o.isPercent() && (e.price = o.priceRange().convertToPercent(e.price, i)), c.prototype.setPoint.call(this, t, e), this.recalculate();
                        break;
                    case 1:
                        this.properties().stopPrice.setValue(this.preparseStopPrice(e.price));
                        break;
                    case 2:
                        this.properties().targetPrice.setValue(this.preparseProfitPrice(e.price));
                        break;
                    case 3:
                        e.price = this._roundPrice(e.price), o.isPercent() && (e.price = o.priceRange().convertToPercent(e.price, i)), c.prototype.setPoint.call(this, 1, e), this.recalculate()
                }
            }, s.PriceProperty = function(t, e) { c.PointPriceProperty.call(this, t, e) }, inherit(s.PriceProperty, c.PointPriceProperty), s.PriceProperty.prototype.setValue = function(t) {
                var e = this._lineSource.points()[this._pointIndex];
                e.price = parseFloat(t), this._lineSource.setPoint(this._pointIndex, e), this._lineSource.recalculate(), this._lineSource._model.updateSource(this._lineSource), this._listeners.fire(this), this._lineSource.endChanging(), this._lineSource._syncMultichartState()
            }, s.StopPriceProperty = function(t) { s.PriceProperty.call(this, t, 1) }, inherit(s.StopPriceProperty, s.PriceProperty), s.StopPriceProperty.prototype.value = function() {
                var t = this._lineSource.stopPrice(),
                    e = this._lineSource.ownerSource().formatter(),
                    i = e.parse(e.format(t));
                return i.price ? i.price : i.value
            }, s.StopPriceProperty.prototype.setValue = function(t) {
                var e = Math.round(Math.abs(t - this._lineSource.entryPrice()) * this._lineSource._model.mainSeries().base());
                this._lineSource.properties().stopLevel.setValue(e), this._lineSource.properties().stopLevel.listeners().fire(this._lineSource.properties().stopLevel)
            }, s.TargetPriceProperty = function(t) { s.PriceProperty.call(this, t, 2) },
            inherit(s.TargetPriceProperty, s.PriceProperty), s.TargetPriceProperty.prototype.value = function() {
                var t = this._lineSource.profitPrice(),
                    e = this._lineSource.ownerSource().formatter(),
                    i = e.parse(e.format(t));
                return i.price ? i.price : i.value
            }, s.TargetPriceProperty.prototype.setValue = function(t) {
                var e = Math.round(Math.abs(t - this._lineSource.entryPrice()) * this._lineSource._model.mainSeries().base());
                this._lineSource.properties().profitLevel.setValue(e), this._lineSource.properties().profitLevel.listeners().fire(this._lineSource.properties().profitLevel)
            }, s.prototype.pointsCount = function() { return 1 }, s.prototype.title = function() { return this.i18nCache.title }, s.prototype.addPoint = function(t) { var e, i; return t.price = this._roundPrice(t.price), c.prototype.addPoint.call(this, t, null, !0), e = { price: t.price, index: t.index + 50 }, c.prototype._addPointIntenal.call(this, e, null, !0), i = this.calculateActualEntry(t, e), i && (c.prototype._addPointIntenal.call(this, i, null, !0), (e = this.findClosePoint(i, e)) && c.prototype._addPointIntenal.call(this, e, null, !0)), this._lastPoint = null, this.normalizePoints(), this.createServerPoints(), !0 }, s.prototype._roundPrice = function(t) { var e = this._model.mainSeries().base(); return Math.round(t * e) / e }, s.prototype.recalculate = function() {
                var t, e, i, o, n;
                this.properties().interval.value() === this._model.mainSeries().interval() && 0 !== this.points().length && (t = this.properties().targetPrice.value(), e = this.properties().stopPrice.value(), i = [this._points[0], this._points[1]], o = this.calculateActualEntry(this.points()[0], this.points()[1]), o && (i.push(o), (n = this.findClosePoint(o, this.points()[1])) && i.push(n)), this._points = i, t !== this.properties().targetPrice.value() && this.properties().targetPrice._listeners.fire(this.properties().targetPrice), e !== this.properties().stopPrice.value() && this.properties().stopPrice._listeners.fire(this.properties().stopPrice), this._recalculateRiskSize(!0))
            }, s.prototype.start = function() { c.prototype.start.call(this), this.recalculate() }, s.prototype.startMoving = function(t) { t.price = this._roundPrice(t.price), c.prototype.startMoving.call(this, t) }, s.prototype.move = function(t) { t.price = this._roundPrice(t.price), c.prototype.move.call(this, t), this.recalculate(), this._entryPriceAxisView.update() }, s.prototype.correctPoints = function(t) { return c.prototype.correctPoints.call(this, [t[0], t[1]]) }, s.prototype.entryPrice = function() { return this.points()[0].price }, s.prototype.findClosePoint = function(t, e) {
                var i, o, n, s = this._model.mainSeries().bars(),
                    r = parseInt(s.first(), 10),
                    a = Math.max(t.index, r),
                    l = parseInt(s.last(), 10);
                for (i = a; i <= Math.min(l, e.index); i++)
                    if (o = s.valueAt(i), null != (n = this.checkStopPrice(o))) return { index: i, price: n };
                return null
            }, s.prototype.calculateActualEntry = function(t, e) {
                var i, o, n = this._model.mainSeries().bars(),
                    s = parseInt(n.first(), 10),
                    r = Math.max(t.index, s),
                    a = t.price,
                    l = parseInt(n.last(), 10);
                for (i = r; i <= Math.min(l, e.index); i++)
                    if (o = n.valueAt(i), o[TradingView.HIGH_PLOT] >= a && o[TradingView.LOW_PLOT] <= a) return { index: i, price: a };
                return null
            }, s.prototype.axisPoints = function() {
                var t, e, i;
                if (!this._points[s.INDEX_ACTUALENTRY]) return [];
                if (t = this._points[s.INDEX_ACTUALENTRY], e = null, 4 === this._points.length) e = this._points[s.INDEX_ACTUALCLOSE];
                else {
                    if (!(i = this.lastBarData())) return [];
                    e = { index: i.index, price: i.closePrice }
                }
                return [t, e]
            }, inherit(r, s), r.prototype.i18nCache = { title: $.t("Risk/Reward short") }, r.prototype._recalculateQty = function() {
                var t = this.properties(),
                    e = t.entryPrice.value(),
                    i = t.stopPrice.value(),
                    o = t.riskSize.value(),
                    n = Math.floor(o / Math.abs(i - e));
                t.qty.setValue(n)
            }, r.prototype._recalculateAmount = function() {
                var t = this.properties(),
                    e = t.accountSize.value(),
                    i = t.entryPrice.value(),
                    o = t.qty.value(),
                    n = t.stopPrice.value(),
                    s = t.targetPrice.value(),
                    r = this._roundValue(e + (i - s) * o),
                    a = this._roundValue(e - (n - i) * o);
                t.amountTarget.setValue(r), t.amountStop.setValue(a)
            }, r.prototype.title = function() { return this.i18nCache.title }, r.prototype.stopPrice = function() { return this.entryPrice() + this.properties().stopLevel.value() / this._model.mainSeries().base() }, r.prototype.profitPrice = function() { return this.entryPrice() - this.properties().profitLevel.value() / this._model.mainSeries().base() }, r.prototype.calculatePL = function(t) { return this.entryPrice() - t }, r.prototype.preparseStopPrice = function(t) { t = this._roundPrice(t); var e = this.entryPrice() + 1 / this._model.mainSeries().base(); return Math.max(t, e) }, r.prototype.preparseProfitPrice = function(t) { t = this._roundPrice(t); var e = this.entryPrice() - 1 / this._model.mainSeries().base(); return Math.min(t, e) }, r.prototype.checkStopPrice = function(t) {
                var e = this.stopPrice(),
                    i = this.profitPrice();
                return t[TradingView.HIGH_PLOT] >= e ? this.stopPrice() : t[TradingView.LOW_PLOT] <= i ? this.profitPrice() : null
            }, a.prototype.i18nCache = { title: $.t("Risk/Reward long") }, inherit(a, s), a.prototype._recalculateQty = function() {
                var t = this.properties(),
                    e = t.entryPrice.value(),
                    i = t.stopPrice.value(),
                    o = t.riskSize.value(),
                    n = Math.floor(o / Math.abs(e - i));
                t.qty.setValue(n)
            }, a.prototype._recalculateAmount = function() {
                var t = this.properties(),
                    e = t.accountSize.value(),
                    i = t.entryPrice.value(),
                    o = t.qty.value(),
                    n = t.stopPrice.value(),
                    s = t.targetPrice.value(),
                    r = this._roundValue(e + (s - i) * o),
                    a = this._roundValue(e - (i - n) * o);
                t.amountTarget.setValue(r), t.amountStop.setValue(a)
            }, a.prototype.stopPrice = function() { return this.entryPrice() - this.properties().stopLevel.value() / this._model.mainSeries().base() }, a.prototype.profitPrice = function() { return this.entryPrice() + this.properties().profitLevel.value() / this._model.mainSeries().base() }, a.prototype.calculatePL = function(t) { return t - this.entryPrice() }, a.prototype.preparseStopPrice = function(t) { t = this._roundPrice(t); var e = this.entryPrice() - 1 / this._model.mainSeries().base(); return Math.min(t, e) }, a.prototype.preparseProfitPrice = function(t) { t = this._roundPrice(t); var e = this.entryPrice() + 1 / this._model.mainSeries().base(); return Math.max(t, e) }, a.prototype.checkStopPrice = function(t) {
                var e = this.stopPrice(),
                    i = this.profitPrice();
                return t[TradingView.LOW_PLOT] <= e ? this.stopPrice() : t[TradingView.HIGH_PLOT] >= i ? this.profitPrice() : null
            }, a.prototype.title = function() { return this.i18nCache.title }, e.LineToolRiskReward = s, e.LineToolRiskRewardLong = a, e.LineToolRiskRewardShort = r
    }).call(e, i(107))
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { this.customization = { forcePriceAxisLabel: !0, disableSelection: !0, disableErasing: !0 }, n.call(this, t, e, i) }
    var n = i(1).LineDataSource;
    inherit(o, n), o.POINTS_COUNT = 1, o.prototype.pointsCount = function() { return o.POINTS_COUNT }, o.prototype.hasContextMenu = function() { return !1 }, o.prototype.state = function() { return null }, o.prototype.startMoving = function() { n.prototype.startMoving.apply(this, arguments), this._cursorMoved = !1 }, o.prototype.endMoving = function() { n.prototype.endMoving.apply(this, arguments), this._cursorMoved = !1 }, o.prototype.correctPoints = function(t) { var e, i, o, n, s; for (this._currentMovingPoint && this._startMovingPoint ? this._currentMovingPoint.price - this._startMovingPoint.price && (this._cursorMoved = !0) : this._cursorMoved = !1, e = this.priceScale(), i = e.mainSource().base(), o = 1 / i, n = 0; n < t.length; n++) s = t[n], this._cursorMoved && (s.price = this._currentMovingPoint.price), s.price = o * Math.round(s.price / o), t[n] = s }, o.prototype.userEditEnabled = function() { return !0 }, o.prototype.canBeHidden = function() { return !1 }, o.prototype.isUserDeletable = function() { return !1 }, o.prototype.showInObjectTree = function() { return !1 }, t.exports = o
}, function(t, e, i) {
    "use strict";
    var o, n = i(37),
        s = n.rgba,
        r = n.rgbaToString,
        a = n.parseRgb,
        l = i(675),
        h = i(210),
        c = i(157),
        d = i(199),
        p = i(1).LineDataSource,
        u = i(78).StudyLineDataSource,
        _ = i(147),
        f = i(202),
        m = i(31),
        g = m.Study,
        v = m.prepareStudyPropsStateForLoadChart,
        y = m.prepareStudyPropertiesForLoadChart,
        b = m.createStudy,
        w = i(43),
        S = i(7).DefaultProperty,
        T = i(25),
        C = i(3),
        x = i(12).getLogger("Chart.Serialization"),
        P = i(150).LineToolParallelChannel,
        L = i(208),
        k = i(207),
        I = i(65).LineToolElliott,
        A = i(48).PriceDataSource,
        E = i(209),
        M = i(21),
        D = i(44).assert,
        O = i(14);
    l.version = 2, l.prototype.state = function(t, e) { var i, o, n, s = {}; for (s.panes = [], i = 0; i < this.panes().length; i++) s.panes.push(this.panes()[i].state(!0, t, !1, e)); return s.timeScale = this.m_timeScale.state(t), o = null, n = this.properties(), s.chartProperties = { paneProperties: n.paneProperties.state(), scalesProperties: n.scalesProperties.state(), publishedChartsTimelineProperties: o ? o.state(t) : void 0, chartEventsSourceProperties: n.chartEventsSourceProperties.state() }, n.chartEventsSourceProperties && (s.chartProperties.chartEventsSourceProperties = n.chartEventsSourceProperties.state()), s.version = l.version, s.timezone = this.timezone(), s }, l.prototype.chartPropertiesTransparencyMigrate = function(t) {
            var e, i, o;
            t.chartProperties.paneProperties.crossHairProperties && (o = t.chartProperties.paneProperties.crossHairProperties, O.isHexColor(o.color) && (i = o.transparency / 100, e = a(o.color), o.color = r(s(e, i)))), t.chartProperties.paneProperties.dataWindowProperties && (o = t.chartProperties.paneProperties.dataWindowProperties, O.isHexColor(o.color) && (i = o.transparency / 100, e = a(o.color), o.color = r(s(e, i))))
        }, l.prototype.resetDeferredStudies = function() { new o(this).reset() }, l.prototype._getExceedingChildStudies = function(t) {
            var e, i, o, n, s, r, a, l, h = [];
            for (e = 0; e < t.length; ++e) h = h.concat(t[e].sources || []);
            for (i = 0, o = 1, n = [], s = {}, r = 0, a = 1e6; h.length && --a;) l = h[r], (l.ownerSource && s[l.ownerSource] || !l.ownerSource) && (s[l.id] = l,
                h.splice(h.indexOf(l), 1), l.ownerSource && "Study" === l.type && l.state && l.state.isChildStudy && ++i > o && n.push(l)), r = (r + 1) % h.length;
            return n
        }, l.prototype.restoreState = function(t, e) {
            var i, n, s, r, a, l, h, c, d, u, _, f;
            if (new o(this).reset(), i = {}, !t.panes) return void x.logDebug("ChartModel.restoreState: invalid state");
            if (!Array.isArray(t.panes)) return void x.logDebug("ChartModel.restoreState: invalid state");
            if (t.panes.length < 1) return void x.logDebug("ChartModel.restoreState: invalid state");
            if (t.chartProperties && !t.chartProperties.timezone && (t.chartProperties.timezone = t.timezone), t.chartProperties && (n = TradingView.factoryDefaults("chartproperties").scalesProperties, TradingView.merge(n, t.chartProperties.scalesProperties), !("showLastValue" in n) || "showSeriesLastValue" in n || "showStudyLastValue" in n || (n.showSeriesLastValueProperty = n.showLastValue, n.showStudyLastValueProperty = n.showLastValue), "showSeriesLastValue" in n && (i.showSeriesLastValueProperty = !0), "showStudyLastValue" in n && (i.showStudyLastValueProperty = !0), t.chartProperties.paneProperties.vertGridProperties = t.chartProperties.paneProperties.vertGridProperties || TradingView.clone(t.chartProperties.paneProperties.gridProperties), t.chartProperties.paneProperties.horzGridProperties = t.chartProperties.paneProperties.horzGridProperties || TradingView.clone(t.chartProperties.paneProperties.gridProperties), this._properties.paneProperties.merge(t.chartProperties.paneProperties), this._properties.scalesProperties.merge(n), t.chartProperties.timezone && this._properties.timezone.setValue(t.chartProperties.timezone), t.chartProperties.chartEventsSourceProperties && this._properties.chartEventsSourceProperties && this._properties.chartEventsSourceProperties.merge(t.chartProperties.chartEventsSourceProperties), this.m_timeScale.restoreState(t.timeScale, e)), t.timeScale && this.m_timeScale.restoreState(t.timeScale, e), !this.readOnly() && (s = this._getExceedingChildStudies(t.panes), s.length)) {
                for (r = t.panes.length - 1; r >= 0; --r) {
                    for (a = t.panes[r], l = a.sources.length - 1; l >= 0; --l) h = a.sources[l], ~s.indexOf(h) && a.sources.splice(l, 1);
                    a.sources.length || t.panes.splice(r, 1)
                }
                setTimeout(function() { goProDialog({ feature: "studyOnStudy" }).open() }, 500)
            }
            for (c = t.panes, this.panes()[0].restoreState(c[0], e, t.version, i), r = 1; r < t.panes.length; r++) a = this.panes()[r] || this.createPane(), a.restoreState(t.panes[r], e, t.version, i);
            for (this._invalidateBarColorerCaches(), d = this.dataSources(), u = 0, r = 0; r < d.length; r++) _ = d[r], TradingView.isInherited(_.constructor, p) && (u++, _.calcIsActualSymbol());
            return this._version = t.version, this.timeScale().recalcLockedScale(), this.recalculateAllPanes(), this.invalidate(new M(M.FULL_UPDATE)), window.saver && window.is_authenticated && this.isJustClonedChart() && this.mainSeries().onSymbolResolved().subscribe(this, function() { window.saver.saveChartSilently() }, !0), f = TVLocalStorage.getItem("linetools_limit") || 1e3, window.is_authenticated && window.user && window.user.settings && (f = window.user.settings.linetools_limit || f), u > f ? { lines_limit_exceeded: !0, line_tools_count: u } : {}
        }, l.prototype.restoreAxisState = function(t) {
            var e, i;
            if (!t.panes) return void x.logDebug("ChartModel.restoreAxisState: invalid state");
            if (!Array.isArray(t.panes)) return void x.logDebug("ChartModel.restoreAxisState: invalid state");
            if (t.panes.length < 1) return void x.logDebug("ChartModel.restoreAxisState: invalid state");
            for (this.m_timeScale.restoreState(t.timeScale, !1, !0), e = 0; e < t.panes.length; e++) i = this.panes()[e], i.m_leftPriceScale.restoreState(t.panes[e].leftAxisState), i.m_rightPriceScale.restoreState(t.panes[e].rightAxisState);
            this.recalculateAllPanes(), this.invalidate(new M(M.FULL_UPDATE))
        }, E.prototype.state = function(t, e, i, o) {
            function n(t) { return i && !t.isSavedInStudyTemplates() || !t.state || !t.state() || !t.isSavedInChart(e) || o && t.isActualSymbol && !t.isActualSymbol() }
            var s, r, a = {};
            if (t)
                for (a.sources = [], s = 0; s < this.m_dataSources.length; s++) n(this.m_dataSources[s]) || a.sources.push(this.m_dataSources[s].state(e));
            for (a.leftAxisState = this.m_leftPriceScale.state(), a.leftAxisSources = [], s = 0; s < this.m_leftPriceScale.dataSources().length; s++) n(this.m_leftPriceScale.dataSources()[s]) || a.leftAxisSources.push(this.m_leftPriceScale.dataSources()[s].id());
            for (a.rightAxisState = this.m_rightPriceScale.state(), a.rightAxisSources = [], s = 0; s < this.m_rightPriceScale.dataSources().length; s++) n(this.m_rightPriceScale.dataSources()[s]) || a.rightAxisSources.push(this.m_rightPriceScale.dataSources()[s].id());
            for (a.overlayPriceScales = {}, s = 0; s < this.m_dataSources.length; s++) r = this.m_dataSources[s], this.isOverlay(r) && r.isSavedInChart(e) && (a.overlayPriceScales[r.id()] = r.priceScale().state());
            return a.stretchFactor = this._stretchFactor, this.m_mainDataSource && (a.mainSourceId = this.m_mainDataSource.id()), a
        }, E.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
        }, E.prototype.isESDStudy = function(t) { return "Script$TV_EARNINGS@tv-scripting" === t.id || "Script$TV_DIVIDENDS@tv-scripting" === t.id || "Script$TV_SPLITS@tv-scripting" === t.id || "ESD$TV_EARNINGS@tv-scripting" === t.id || "ESD$TV_DIVIDENDS@tv-scripting" === t.id || "ESD$TV_SPLITS@tv-scripting" === t.id }, E.prototype.restoreState = function(t, e, i, o) {
            var n, s, r, a, l, c, d, u, _, f, m, v, y, b, S;
            if (o = o || {}, !t.leftAxisState || !t.rightAxisState) throw Error("invalid state");
            if (!t.leftAxisSources || !t.rightAxisSources) throw Error("invalid state");
            if (t.stretchFactor && (this._stretchFactor = t.stretchFactor), n = {}, t.sources)
                for (s = -1 !== this.m_dataSources.indexOf(this._model.mainSeries()), this.clearSeries(), this.m_mainDataSource = null, s && this.m_dataSources.push(this._model.mainSeries()), r = this.getZOrderMinMax(), a = r.minZOrder, l = r.maxZOrder, c = 0; c < t.sources.length; c++) d = t.sources[c], u = d.type, Math.abs(d.zorder) > 1e200 ? (_ = a - 1, x.logWarn("Datasource zorder has bad value: " + d.zorder + " Resetting it to " + _), d.zorder = _) : this.isZOrderAvailable(d.zorder) || s && "MainSeries" === u && this._model.mainSeries().zorder() === d.zorder || (d.zorder = l + 1), f = d.id, n[f] = d.ownerSource,
                    u && ("MainSeries" === u ? this._restoreMainSeries(d, e, s, o) : u.toLowerCase().startsWith("study") ? this._restoreStudy(d, e, o) : TradingView.isInherited(TradingView[u], p) ? this._restoreLineTool(d, e) : TradingView[u] && TradingView[u].createFromState && this._restoreSpecialSource(d, e)), a = Math.min(a, d.zorder), l = Math.max(l, d.zorder);
            for (this.m_leftPriceScale.dataSources().splice(0, 1 / 0), this.m_leftPriceScale._hasSeries = !1, m = defaults("chartproperties").paneProperties.leftAxisProperties, TradingView.merge(m, t.leftAxisState), this.m_leftPriceScale.restoreState(m), c = 0; c < t.leftAxisSources.length; c++)(v = this.dataSourceForId(t.leftAxisSources[c])) && (void 0 !== m.m_showSymbolLabels && v instanceof w && this.model().properties().scalesProperties.showSymbolLabels.setValue(m.m_showSymbolLabels), v.setPriceScale(this.m_leftPriceScale), this.m_leftPriceScale.addDataSource(v));
            for (this.m_rightPriceScale.dataSources().splice(0, 1 / 0), this.m_rightPriceScale._hasSeries = !1, m = defaults("chartproperties").paneProperties.rightAxisProperties, TradingView.merge(m, t.rightAxisState), this.m_rightPriceScale.restoreState(m), c = 0; c < t.rightAxisSources.length; c++)(v = this.dataSourceForId(t.rightAxisSources[c])) && (void 0 !== m.m_showSymbolLabels && v instanceof w && this.model().properties().scalesProperties.showSymbolLabels.setValue(m.m_showSymbolLabels), v.setPriceScale(this.m_rightPriceScale), this.m_rightPriceScale.addDataSource(v));
            for (c = 0; c < this.m_dataSources.length; c++) v = this.m_dataSources[c], -1 === this.m_rightPriceScale.dataSources().indexOf(v) && -1 === this.m_leftPriceScale.dataSources().indexOf(v) ? (v._isOverlay = !0, y = new h(this._properties.overlayPropreties, this._model.properties().scalesProperties), y.setHeight(this.m_height), y.setTopMargin(this.m_rightPriceScale.topMargin()), y.setBottomMargin(this.m_rightPriceScale.bottomMargin()), y.addDataSource(v), t.overlayPriceScales && t.overlayPriceScales[v.id()] && (m = t.overlayPriceScales[v.id()], m.m_isAutoScale = !0, m.m_isLog = !1, m.m_isPercentage = !1, y.restoreState(m)), v.setPriceScale(y)) : v._isOverlay = !1;
            for (f in n)(b = n[f]) && (v = this.sourceById(f)) && this.sourceById(f).setOwnerSource(this.sourceById(b));
            if (t.mainSourceId && !this.m_mainDataSource && (this.m_mainDataSource = this.dataSourceForId(t.mainSourceId)), !this.m_mainDataSource)
                for (c = 0; c < this.m_dataSources.length; c++)
                    if (v = this.m_dataSources[c], TradingView.isInherited(v.constructor, A)) { this.m_mainDataSource = v; break }
            for (c = 0; c < this.m_dataSources.length; c++) v = this.m_dataSources[c], TradingView.isInherited(v.constructor, p) ? (v.ownerSource() || v.setOwnerSource(this.mainDataSource()), v.isFixed() && v.restoreFixedPoints(), 1 === i && v.priceScale().isPercent() && !v.isFixed() && v.correctPricesToPercents(), v.fixAfterRestorePriceAxis && v.fixAfterRestorePriceAxis()) : TradingView.isInherited(v.constructor, g) && (S = v.properties(), S.linkedToSeries && S.linkedToSeries.value() && (v.ownerSource() || v.setOwnerSource(this.model().mainSeries())));
            this._updateMargins(), this._cachedOrderedSoruces = null, this._cachedHitTestSources = null
        }, E.prototype._restoreMainSeries = function(t, e, i, o) {
            var n, s, r, a, l = t.id,
                h = t.state,
                c = t.zorder;
            h && ["candleStyle", "hollowCandleStyle", "haStyle"].forEach(function(t) { h[t] && (h[t].wickUpColor = h[t].wickUpColor || h[t].wickColor, h[t].wickDownColor = h[t].wickDownColor || h[t].wickColor) }), i || (n = this._model.paneForSource(this._model.mainSeries()), n.removeDataSource(this._model.mainSeries()), this.m_dataSources.push(this._model.mainSeries())), this.m_mainDataSource = this._model.mainSeries(), s = h && h.style ? h.style : void 0, r = s === w.STYLE_PNF && h.pnfStyle.lockScale, h && !h.lockScale && (h.lockScale = r), s === w.STYLE_PNF && "ATR" === this._model.mainSeries().properties().pnfStyle.inputs.style.value() ? this._model.mainSeries().properties().pnfStyle.inputs.style._value = "Traditional" : s === w.STYLE_RENKO && "ATR" === this._model.mainSeries().properties().renkoStyle.inputs.style.value() && (this._model.mainSeries().properties().renkoStyle.inputs.style._value = "Traditional"), h && !h.hasOwnProperty("showSessions") && (h.showSessions = !1), h && !h.extendedHours && (h.extendedHours = !1), h && e && (h.showCountdown = !1), h && (e && !("showSeriesLastValueProperty" in o) && "showLastValue" in h && this._model.properties().scalesProperties.showSeriesLastValue.setValue(h.showLastValue), delete h.showLastValue), this._model.mainSeries().properties().merge(h), this._model.mainSeries()._prevChartStyle = this._model.mainSeries().properties().style.value(), this._model.mainSeries().createPaneView(), this._model.mainSeries().setId(l), e && this._model.mainSeries().restoreData(t.bars, t.nsBars, t.symbolInfo, t.rtPrice, t.boxSize, t.reversalAmount), void 0 !== c && this._model.mainSeries().setZorder(c), this._model.mainSeries().properties().extendedHours.listeners().fire(this._model.mainSeries().properties().extendedHours), (a = this._model.mainSeries().symbolInfo()) && this._model.mainSeries().onSymbolResolved().fire(this._model.mainSeries().symbolInfo())
        }, E.prototype._restoreStudy = function(t, e, i) {
            var n, s, r, a, l, h, d, p, u, _;
            return e && void 0 === t.data && void 0 === t.nonSeriesData && void 0 === t.indexes ? void x.logError("Cannot restore (skipping) study without data " + t.id + ", " + t.metaInfo.id) : (n = t.id, s = t.state, r = t.zorder, a = t.ownerSource, l = TradingView.clone(t.metaInfo), $.extend(l, T.parseIdString(l.id)), !this.isESDStudy(l) || e ? (h = s, d = this._model.studyVersioning(), p = d.patchPropsStateAndMetaInfo(h, l, { oldShowStudyLastValueProperty: e && !i.showStudyLastValueProperty }), h = p.propsState, l = p.metaInfo, u = new c(this._model, t, l.shortDescription), u.setId(n), _ = this, d.updateMetaInfoAsync(l, e).done(function(i) {
                function s(o) {
                    var s, a = y(l, i, h, null, d, o),
                        p = b(_._model, a, o || _._model.mainSeries(), r);
                    p.setId(n), e && (s = d.patchStudyData(l, t.data, t.nonSeriesData, t.indexes), p.restoreData(s.data, s.nsData, s.indexes)), _._model.replaceStudyStub(u, p) || (u = p), c.add(n, p)
                }
                var r, c, p;
                u.setStatus(""), r = i || l, c = new o(_._model), p = a && t.state.isChildStudy, p ? c.get(a).done(s) : s()
            }).fail(function(t) { u.setStatus("error: " + t), u.setFailed(!0) }), u && this.m_dataSources.push(u), delete this._cachedOrderedSoruces, delete this._cachedHitTestSources, u && void 0 !== r && u.setZorder(r), u) : void 0)
        }, E.prototype._restoreLineTool = function(t, e, i) {
            var o, n, s, r, a, l, h, m, g, y, b, w, x, A, E, M, O, V, B, R, N, F, z;
            for (i = void 0 === i || i,
                I.migrateState(t), o = t.type, n = t.id, s = t.state, r = i ? t.zorder : this._newZOrderForLineTool(), a = TradingView[o], D(TradingView.isInherited(a, p), "invalid data source type:" + o + " (expected to be a Line Tool)"), l = t.points, h = !1, m = 0; m < l.length; m++)
                if (Math.abs(l[m].offset) > 1e4) { h = !0; break }
            if (!h) {
                if (g = null, y = TradingView.factoryDefaults("linetool"), TradingView.isInherited(a, u)) {
                    if (g = this._model.studyVersioning(), t = g.patchPointsBasedStudyState(t), TradingView.merge(y, s), x = t.metaInfo, $.extend(x, T.parseIdString(x.fullId)), !e && (A = x.productId, !pro.hasPackage(A))) return E = new c(this._model, t, x.shortDescription), E.setId(n), this.m_dataSources.push(E), void 0 !== r && E.setZorder(r), E.setStatus($.t("not authorized")), void E.setFailed(!0);
                    M = g.updateMetaInfo(x), O = M || x, y = v(O, x, y, null, g), e ? TradingView.merge(y, { fixedSize: !1 }) : TradingView.merge(y, { fixedSize: !0 }), w = new S("study_" + O.id, y, !0), b = d.create(o, this._model, w, O, this.mainDataSource())
                } else V = o.toLowerCase(), TradingView.merge(y, TradingView.factoryDefaults(V)), w = TradingView[o].prototype.createPropertiesObject(V, y), w.merge(s), e ? w.merge({ fixedSize: !1 }) : w.merge({ fixedSize: !0 }), b = new TradingView[o](this._model, w, !0);
                return b.setId(n), b.linkKey = t.linkKey, B = t.alertId, B && "function" == typeof b.setAlert && C.enabled("alerts") && !this._model.readOnly() && !this._model.isJustClonedChart() && b.setAlert(B, { noChartSave: !0 }), R = t.indexes ? t.indexes : [], R = R.slice(0, t.points.length), b.isFixed() ? b.restorePositionPercents(t.positionPercents) : b.restorePoints(t.points, R, e), b instanceof _ || b instanceof f || b instanceof L || b instanceof k || b instanceof P ? b.restoreData(t) : e && b.restoreData && (N = t, g && (N.graphics = g.patchPointsBasedStudyData(N.metaInfo, N.graphics)), b.restoreData(N)), F = null == t.version ? 1 : t.version, z = null == b.version ? 1 : b.version, F !== z && "function" == typeof b.migrateVersion && b.migrateVersion(F, z, { pane: this, model: this._model, properties: w }), this.m_dataSources.push(b), delete this._cachedOrderedSoruces, delete this._cachedHitTestSources, void 0 !== r && b.setZorder(r), b
            }
        }, E.prototype._restoreSpecialSource = function(t, e) {
            var i, o = TradingView[t.type];
            o && o.createFromState && (i = o.createFromState(t, e, this._model)) && (i.setId(t.id), this.m_dataSources.push(i), i.zorder && i.setZorder(i.zorder))
        }, l.prototype.studyTemplate = function(t) { var e, i, o, n, s = {}; for (s.panes = [], e = 0; e < this.panes().length; e++) i = !0, o = !1, n = !0, s.panes.push(this.panes()[e].state(i, o, n)); return t && (s.interval = this.mainSeries().interval()), s.version = l.version, s }, l.prototype.restoreStudyTemplate = function(t, e) { this._undoModel.studyLoadTemplate(this._undoModel, this.studyTemplate(), t, e) }, l.prototype.theme = function() { var t = {}; return t.chartProperties = { paneProperties: this.properties().paneProperties.state(), scalesProperties: this.properties().scalesProperties.state(), symbolWatermarkProperties: this.properties().symbolWatermarkProperties.state() }, t.mainSourceProperties = this.mainSeries().state().state, delete t.mainSourceProperties.symbol, delete t.mainSourceProperties.interval, delete t.chartProperties.paneProperties.topMargin, delete t.chartProperties.paneProperties.bottomMargin, t.version = l.version, t },
        l.prototype.restoreTheme = function(t) {
            var e, i, o = { hollowCandle: { related: "candle" } };
            for (e in o) t.mainSourceProperties[e + "Style"] || (i = t.mainSourceProperties[o[e].related + "Style"], t.mainSourceProperties[e + "Style"] = TradingView.clone(i));
            this._undoModel.chartLoadTheme(this, t)
        }, o = function() {
            function t(o) { var n = e.indexOf(o); return ~n ? i[n] : this instanceof t ? (this._source = o, this._studies = {}, this._deferreds = {}, e.push(o), void i.push(this)) : new t(o) }
            var e = [],
                i = [];
            return t.prototype.add = function(t, e) { this._deferreds[t] && (this._deferreds[t].resolve(e), delete this._deferreds[t]), this._studies[t] = e }, t.prototype.get = function(t) { return this._studies[t] ? $.Deferred().resolve(this._studies[t]) : (this._deferreds[t] || (this._deferreds[t] = $.Deferred()), this._deferreds[t].promise()) }, t.prototype.reset = function() { var t = e.indexOf(this._source);~t && (e.splice(t, 1), i.splice(t, 1)) }, t
        }(), t.exports = l
}, 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(146),
            r = s.DataWindowView,
            a = s.DataWindowItem,
            l = i(198);
        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(3))
}, function(t, e, i) {
    "use strict";

    function o(t) { this._graphics = o.emptyGraphics(), n(!!t, "Study metaInfo is absent!"), this._metaInfo = t }
    var n = i(44).assert,
        s = i(12).getLogger("Chart.StudyGraphics");
    o.emptyGraphics = function() { return { indexes: [] } }, o.prototype.isEmpty = function() { var t = Object.keys(this._graphics).length > 1; return 0 === this._graphics.indexes.length && !t }, o.prototype.graphics = function() { return this._graphics }, o.prototype.setGraphics = function(t) { this._graphics = t, this._postProcessGraphicsData() }, o.prototype.process = function(t) { if ("" !== t.d) return t.d.indexes_replace ? void this.replaceIndexes(t) : void(t.d.graphicsCmds && (this.processEraseCmds(t.d.graphicsCmds.erase), this.processCreateCmds(t.d.graphicsCmds.create, t.indexes))) }, o.prototype.replaceIndexes = function(t) { "" !== t.d && (n(!!t.d.indexes_replace), this._graphics.indexes = t.indexes) }, o.prototype.processEraseCmds = function(t) {
        var e, i, s, r, a;
        if (t)
            for (n(!!this._graphics, "_graphics object doesn't exist in the study!"), n(!!this._graphics.indexes, "_graphics.indexes array doesn't exist in the study!"), e = 0; e < t.length; ++e)
                if (i = t[e], "all" === i.action) this._graphics = o.emptyGraphics();
                else { if ("one" !== i.action) throw Error("Unknown graphics command " + i.action); for (s in this._graphics[i.type]) r = this._graphics[i.type][s], (a = o._findGraphicsObjIndexById(r.data, i.id)) >= 0 && r.data.splice(a, 1) }
    }, o._findGraphicsObjIndexById = function(t, e) {
        for (var i = 0; i < t.length; ++i)
            if (t[i].id === e) return i;
        return -1
    }, o.prototype.processCreateCmds = function(t, e) {
        var i, o, s, r, a, l;
        if (t) {
            n(!!e, "indexes are missing in the study nonseries response!"), n(!!this._graphics, "_graphics object doesn't exist in the study!"), n(!!this._graphics.indexes, "_graphics.indexes array doesn't exist in the study!");
            for (i in t) {
                n(i in this._metaInfo.graphics, "There is a '" + i + "' in study response, but it doesn't present in metaInfo!");
                for (o = 0; o < t[i].length; ++o) {
                    s = t[i][o], r = s.styleId, n(r in this._metaInfo.graphics[i]), this._graphics[i] || (this._graphics[i] = []), a = null;
                    for (l = 0; l < this._graphics[i].length; ++l)
                        if (this._graphics[i][l].styleId === r) { a = this._graphics[i][l]; break }
                    null === a && (a = { styleId: r, data: [] }, this._graphics[i].push(a)), a.data = a.data.concat(s.data)
                }
            }
            "nochange" === e || (n(Array.isArray(e)), this._graphics.indexes = e), this._postProcessGraphicsData()
        }
    }, o.prototype._postProcessGraphicsData = function() {
        var t, e, i;
        if (this._graphics)
            for (t in this._graphics.hhists) e = this._graphics.hhists[t], o._sortHHistItemsByPrice(e.data), i = this._graphics.indexes,
                e.dataObj = o._splitHHistItemsBySession(e.data, i)
    }, o._sortHHistItemsByPrice = function(t) { t.sort(function(t, e) { return t.priceLow - e.priceLow }) }, o._splitHHistItemsBySession = function(t, e) { var i, o, n, r = {}; for (i = 0; i < t.length; ++i) o = t[i], n = e[o.firstBarTime], void 0 !== n ? (n in r || (r[n] = []), r[n].push(o)) : s.logError("Cannot find index " + o.firstBarTime + " in study timescale indexes"); return r }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e) { n.call(this, e), this._study = t, this._inputValueReplacements = { NONE: "Default" } }
    var n = i(348);
    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) {
    (function(e) {
        "use strict";

        function o(t, i, o) {
            s.call(this, t), this._origState = i, this._title = o;
            var a = { visible: !0 };
            this._properties = new e(a), this._statusView = new n(this, t.properties()), this._status = $.t("compiling..."), this._statusView.setText(this._title + " " + this._status), this._formatter = new r(Math.pow(10, 2)), this._failed = !1
        }
        var n = i(156),
            s = i(48).PriceDataSource,
            r = i(27).PriceFormatter;
        inherit(o, s), o.prototype.properties = function() { return this._properties }, o.prototype.statusView = function() { return this._statusView }, o.prototype.state = function(t) { return this._origState }, o.prototype.setStatus = function(t) { this._status = t, this._statusView.setText(this._title + " " + this._status) }, o.prototype.formatter = function() { return this._formatter }, o.prototype.title = function() { return this._title }, o.prototype.setFailed = function(t) { this._failed = t }, o.prototype.start = function(t) {}, o.prototype.firstValue = function(t) { return null }, t.exports = o
    }).call(e, i(24))
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t) { this._data = t, this._textWidthCache = new l }

        function n(t, e, i, o, n) { this._model = t, this._source = e, this._plotIndex = i, this._getterName = o || "symbol", this._propertyName = n, this._cache = {}, this._invalidated = !0, this._rendererData = {} }
        var s = i(37),
            r = s.parseRgb,
            a = s.rgbToBlackWhiteString,
            l = i(159),
            h = i(6),
            c = i(163).makeFont,
            d = i(14);
        o.prototype.hitTest = function(t) { return null }, o.prototype.draw = function(t) {
                var e, i, o, n, s, r, a, l, h, c;
                this._data.visible && (this._textWidthCache.font !== this._data.font && (this._textWidthCache.reset(), this._textWidthCache.font = this._data.font), t.font = this._data.font, e = this._data.fontSize, i = Math.floor(e / 4.5), o = Math.ceil(e / 4.5), n = Math.ceil(e / 3), s = Math.ceil(this._textWidthCache.measureText(t, this._data.text)), r = Math.round(e / 10), a = e + i + o, l = s + 2 * n, h = this._data.x - .5, "right" === this._data.align && (h -= l), c = this._data.y - Math.floor(e / 2) - i - .5, t.fillStyle = d.resetTransparency(this._data.backColor), t.fillRect(h, c, l, a), t.fillStyle = this._data.color, t.textAlign = "left", t.fillText(this._data.text, h + n, c + i + e - r))
            }, n.prototype.isPropertyEnabled = function() { return this._model.properties().scalesProperties[this._propertyName].value() },
            n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() {
                var t, i, o, n, s, l, d, p = this._rendererData;
                if (p.visible = !1, p.text = "", this.isPropertyEnabled() && this._source.properties().visible.value() && (t = this._source.lastValueData(this._plotIndex, e.enabled("price_scale_always_last_bar_value")), !t.noData)) {
                    if (i = this._model.paneForSource(this._source), o = "right", i.leftPriceScale() === this._source.priceScale() && (o = "left"), n = this._model.properties(), s = !i.leftPriceScale().mainSource() || !i.rightPriceScale().mainSource(), s && n.scalesProperties.showLeftScale.value() && !n.scalesProperties.showRightScale.value() && (o = "left"), !s) { if ("left" === o && !n.scalesProperties.showLeftScale.value()) return new h; if ("right" === o && !n.scalesProperties.showRightScale.value()) return new h }
                    l = t.coordinate, d = this._source.m_data.m_series && this._source.m_data.m_series.properties().style.value() === TradingView.Series.STYLE_HEIKEN_ASHI, this._source.lastPriceLabelFixedCoordinate && !d && "showSymbolLabels" === !this._propertyName && (l = this._source.lastPriceLabelFixedCoordinate(this._plotIndex) || l), p.visible = !0, t.color !== p.backColor && (p.backColor = t.color, p.color = a(r(t.color))), p.text = this._source[this._getterName](this._plotIndex), p.align = o, p.x = "right" === o ? this._model.timeScale().width() : 0, p.y = l, p.fontSize = this._model.properties().scalesProperties.fontSize.value(), p.font = c(p.fontSize, "Arial", "")
                }
            }, n.prototype.renderer = function() { return this._invalidated && (this.updateImpl(), this._invalidated = !1), this._renderer || (this._renderer = new o(this._rendererData)), this._renderer }, t.exports = n
    }).call(e, i(3))
}, function(t, e) {
    "use strict";

    function i(t) { this._maxSize = t || 50, this.reset() }
    i.prototype.measureText = function(t, e) { var i, o, n = (e + "").replace(this._re, "0"); return this._cache[n] ? this._cache[n].width : (this._actualSize === this._maxSize && (i = this._tick2Labels[this._oldestTick], delete this._tick2Labels[this._oldestTick], delete this._cache[i], this._oldestTick++, this._actualSize--), 0 === (o = t.measureText(n).width) && e.length ? 0 : (this._cache[n] = { width: o, tick: this._usageTick }, this._tick2Labels[this._usageTick] = n, this._actualSize++, this._usageTick++, o)) }, i.prototype.reset = function() { this._actualSize = 0, this._cache = {}, this._usageTick = 1, this._oldestTick = 1, this._tick2Labels = {} }, i.prototype._re = /[2-9]/g, t.exports = i
}, function(t, e, i) {
    "use strict";
    i(117), t.exports = TradingView.templates = {
        dialogs: {},
        lists: {},
        onChartMessage: '<div class="onchart-message"><span class="onchart-message-close"></span><div class="onchart-message-top"><div class="onchart-message-copy"></div></div><div class="onchart-message-bottom"><div class="onchart-message-ear"></div></div></div>',
        miniWidgetWizardAddSymbol: '<tr class="tv-external-tools__symbol-item"><td class="tv-external-tools__symbol-item-cell">{{symbol}}</td><td class="tv-external-tools__symbol-item-cell{{#descriptionShortening}} apply-common-tooltip" title="{{description}}"{{/descriptionShortening}}">{{#descriptionShortening}}{{descriptionShortening}}{{/descriptionShortening}}{{^descriptionShortening}}{{description}}{{/descriptionShortening}}</td>{{#timeframeSelectAllow}}<td class="tv-external-tools__symbol-item-cell">{{timeframe}}</td>{{/timeframeSelectAllow}}<td class="tv-external-tools__remove-cell"><div class="tv-external-tools__remove-symbol"></div></td></tr>',
        textNotesWidgetLayout: '<div class="notes-block"><div class="textnotes-search-header"><div class="search-input-block">' + i(847) + '<div class="search-clean"></div><input type="text" class="search-input" placeholder="' + $.t("Search Note") + '" maxlength="1000" autocomplete="off"></div><div class="new-note-btn">' + i(835) + $.t("NEW") + '</div></div><div class="notes-wrapper"><div class="notes"></div></div></div><div class="notes-desc-block"><div class="notes-desc-wrapper"><div class="notes-desc-inner"><div class="remove-note-btn">' + i(892) + '</div><div class="title-wrap"><input type="text" maxlength="100" value="" class="title"></div><div class="date"><span class="created">' + $.t("Created ") + '<span class="created-val"></span>. </span><span class="modified">' + $.t("Last edited ") + '<span class="modified-val"></span></span></div><textarea></textarea></div></div></div>',
        textNotesWidgetItem: '<div class="note"><div class="note-header"><div {{#symbol}}title="' + $.t("Open {{symbol}} Text Note") + '"{{/symbol}} class="title {{#symbol}}title_with-badge{{/symbol}}">{{title}}</div>{{#symbol}}<div class="symbol-badge">' + i(838) + '<span class="symbol">{{symbol}}</span></div>{{/symbol}}</div><div class="note-desc">{{description}}</div><span class="favorite"></span></div>',
        tvDataTable: '<table class="tv-data-table {{className}}"><thead class="tv-data-table__thead"><tr class="tv-data-table__stroke">{{#columns}}<th class="tv-data-table__cell tv-data-table__cell--bold {{className}}"><span class="tv-data-table__cell-text{{^notSortable}} tv-data-table__sortable{{/notSortable}}{{#help}} apply-common-tooltip{{/help}}{{#htmlHelp}} common-tooltip-html{{/htmlHelp}}" {{#help}}title="{{help}}"{{/help}}>{{{label}}}</span></th>{{/columns}}</tr></thead>{{#bodies}}<tbody class="tv-data-table__tbody {{className}}">{{#strokes}}<tr class="tv-data-table__stroke">{{#cells}}<td class="tv-data-table__cell {{className}}"{{#colspan}}colspan="{{colspan}}"{{/colspan}}>{{#contain}}{{{contain}}}{{/contain}}</td>{{/cells}}</tr>{{/strokes}}</tbody>{{/bodies}}</table>',
        tvDataTableRow: '<tr class="tv-data-table__stroke">{{#columns}}<td class="tv-data-table__cell {{className}}">{{#contain}}{{{contain}}}{{/contain}}</td>{{/columns}}</tr>',
        tvDataTableCell: '<td class="tv-data-table__cell {{className}}">{{#contain}}{{{contain}}}{{/contain}}</td>',
        tvWidgetChartLikeButton: '<div data-id="{{chartId}}" class="tv-widget-chart-like-button {{typeClass}}"><span class="tv-widget-chart-like-button__icon-place">' + i(907) + '</span><span class="js-likes-counter"></span></div>'
    }
}, function(t, e, i) {
    "use strict";

    function o(t) {
        for (var i = 0; i < e.availableTimezones.length; i++)
            if (t === e.availableTimezones[i].id) return !0;
        return !1
    }
    var n, s, r;
    for (Object.defineProperty(e, "__esModule", { value: !0 }), i(28), n = i(375), e.availableTimezones = [{ id: "Etc/UTC", title: $.t("UTC") }, { id: "exchange", title: $.t("Exchange") }, { id: "Pacific/Honolulu", title: $.t("Honolulu") }, { id: "America/Vancouver", title: $.t("Vancouver") }, { id: "America/Los_Angeles", title: $.t("Los Angeles") }, { id: "America/Phoenix", title: $.t("Phoenix") }, { id: "America/El_Salvador", title: $.t("San Salvador") }, { id: "America/Mexico_City", title: $.t("Mexico City") }, { id: "America/Chicago", title: $.t("Chicago") }, { id: "America/Bogota", title: $.t("Bogota") }, { id: "America/Toronto", title: $.t("Toronto") }, { id: "America/New_York", title: $.t("New York") }, { id: "America/Caracas", title: $.t("Caracas") }, { id: "America/Argentina/Buenos_Aires", title: $.t("Buenos Aires") }, { id: "America/Sao_Paulo", title: $.t("Sao Paulo") }, { id: "Europe/London", title: $.t("London") }, { id: "Europe/Madrid", title: $.t("Madrid") }, { id: "Europe/Paris", title: $.t("Paris") }, { id: "Europe/Berlin", title: $.t("Berlin") }, { id: "Europe/Zurich", title: $.t("Zurich") }, { id: "Europe/Warsaw", title: $.t("Warsaw") }, { id: "Europe/Athens", title: $.t("Athens") }, { id: "Europe/Istanbul", title: $.t("Istanbul") }, { id: "Europe/Moscow", title: $.t("Moscow") }, { id: "Asia/Tehran", title: $.t("Tehran") }, { id: "Asia/Dubai", title: $.t("Dubai") }, { id: "Asia/Ashkhabad", title: $.t("Ashkhabad") }, { id: "Asia/Kolkata", title: $.t("Kolkata") }, { id: "Asia/Almaty", title: $.t("Almaty") }, { id: "Asia/Bangkok", title: $.t("Bangkok") }, { id: "Asia/Taipei", title: $.t("Taipei") }, { id: "Asia/Singapore", title: $.t("Singapore") }, { id: "Asia/Shanghai", title: $.t("Shanghai") }, { id: "Asia/Hong_Kong", title: $.t("Hong Kong") }, { id: "Asia/Seoul", title: $.t("Seoul") }, { id: "Asia/Tokyo", title: $.t("Tokyo") }, { id: "Australia/Brisbane", title: $.t("Brisbane") }, { id: "Australia/Adelaide", title: $.t("Adelaide") }, { id: "Australia/Sydney", title: $.t("Sydney") }, { id: "Pacific/Auckland", title: $.t("New Zealand") }, { id: "Pacific/Fakaofo", title: $.t("Tokelau") }, { id: "Pacific/Chatham", title: $.t("Chatham Islands") }], s = 0; s < e.availableTimezones.length; s++) - 1 === ["Etc/UTC", "exchange"].indexOf(e.availableTimezones[s].id) && (r = n.parseTzOffset(e.availableTimezones[s].id).string, e.availableTimezones[s].title = "(" + r + ") " + e.availableTimezones[s].title);
    e.timezoneIsAvailable = o, e.monthsShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], e.futuresRoots = [{ d: "E-Mini S&P 500", t: "ES" }, { d: "E-Mini Nasdaq 100", t: "NQ" }, { d: "Gold", t: "GC" }, { d: "Silver", t: "SI" }, { d: "Crude Oil WTI", t: "CL" }, { d: "Natural Gas", t: "NG" }, { d: "Australian Dollar", t: "6A" }, { d: "Australian Dollar (Floor)", t: "AD" }, { d: "Euro FX", t: "6E" }, { d: "Euro FX (Floor)", t: "EC" }, { d: "Corn", t: "ZC" }, { d: "Corn (Floor)", t: "C" }, { d: "Eurodollar", t: "GE" }, { d: "Eurodollar (Floor)", t: "ED" }]
}, function(t, e, i) {
    "use strict";
    var o, n;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(27), n = function() {
        function t() {}
        return t.prototype.format = function(t) { return o.customFormatters && o.customFormatters.dateFormatter ? o.customFormatters.dateFormatter.format(t) : o.numberToStringWithLeadingZero(t.getUTCFullYear(), 4) + "-" + o.numberToStringWithLeadingZero(t.getUTCMonth() + 1, 2) + "-" + o.numberToStringWithLeadingZero(t.getUTCDate(), 2) }, t.prototype.formatLocal = function(t) { return o.customFormatters.dateFormatter ? o.customFormatters.dateFormatter.formatLocal ? o.customFormatters.dateFormatter.formatLocal(t) : o.customFormatters.dateFormatter.format(t) : o.numberToStringWithLeadingZero(t.getFullYear(), 4) + "-" + o.numberToStringWithLeadingZero(t.getMonth() + 1, 2) + "-" + o.numberToStringWithLeadingZero(t.getDate(), 2) }, t
    }(), e.DateFormatter = n
}, function(t, e) {
    "use strict";

    function i(t, e, i) { return i && (i += " "), (i || "") + t + "px " + e }
    Object.defineProperty(e, "__esModule", { value: !0 }), e.makeFont = i
}, function(t, e, i) {
    "use strict";

    function o(t) { var e = ("" + t).match(/(.*)([DWM])/); return e ? e[1] + $.t(e[2], { context: "interval_short" }) : t }
    Object.defineProperty(e, "__esModule", { value: !0 }), i(28), e.translatedIntervalString = o
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.5 13.8"><path d="M7.3 0l2.2 4.5 5 .7-3.6 3.6.8 5-4.4-2.4-4.5 2.4.8-5L0 5.2l5-.7z"/></svg>' }, , , , , , , , , , , , , , , , , , , , , function(t, e, i) {
    "use strict";

    function o(t) {
        if (t) return function(e, i, o) {
            function n(e, i) { return i ? t[e](a, i) : t[e](a) }
            var s, r, a = $(this);
            return "get" === e ? (s = i, "function" == typeof t[s] ? n(s, o) : t[s]) : t[e] ? a.each(function() { return n(e, r) }) : a
        }
    }

    function n(t, e) {
        function i(t, e, i) { return void 0 === i ? t[e]() : t[e](i) }
        if (t && e) return t = "" + t,
            function(o, n, a) {
                var l, h, c;
                return "get" === o ? l = n : (h = n, "object" === (void 0 === o ? "undefined" : s(o)) && void 0 === n ? (h = o, o = "init") : "string" != typeof o && (o = "init")), "getInstance" === o ? $(this).eq(0).data(t) : "get" === o ? (c = $(this).eq(0).data(t), c ? "function" == typeof c[l] ? i(c, l, a) : c[l] : void console.warn("[Block Plugin] Trying to get prop or execute method of " + t + " but it has not been inited")) : $(this).each(function() {
                    var n = $(this),
                        s = n.data(t);
                    void 0 === s ? (s = void 0 === h ? e(n) : e(n, h), n.data(t, s)) : "init" === o && (console.warn("[ Block Plugin: " + t + " ] - Try to init but plugin is already inited. Trace:"), console.trace()), "init" !== o && ("function" == typeof s[o] ? i(s, o, h) : r.logError("[Block Plugin] " + t + " does not support command " + o))
                })
            }
    }
    var s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) { return typeof t } : function(t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t },
        r = i(12).getLogger("CommonUI.CreateTVBlockPlugin");
    t.exports.createTvBlockPlugin = o, t.exports.createTvBlockWithInstance = n
}, function(t, e, i) {
    (function(o) {
        "use strict";

        function n(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
        var s, r, a, l, h, c;
        Object.defineProperty(e, "__esModule", { value: !0 }), s = function() {
                function t(t, e) {
                    var i, o;
                    for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),
                        Object.defineProperty(t, o.key, o)
                }
                return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
            }(), r = i(186), i(249), a = i(12).getLogger("Ui.TvControlCheckbox"), l = { labelWrapper: '{{#hasLabel}}<label>{{#labelLeft}}<span class="tv-control-checkbox__label {{#labelAddClass}}{{labelAddClass}}{{/labelAddClass}}">{{labelLeft}}</span>{{/labelLeft}}{{> inputWrapper }}{{#labelRight}}<span class="tv-control-checkbox__label {{#labelAddClass}}{{labelAddClass}}{{/labelAddClass}}">{{labelRight}}</span>{{/labelRight}}</label>{{/hasLabel}}{{^hasLabel}}{{> inputWrapper }}{{/hasLabel}}', inputWrapper: '<{{ tag }} class="{{ customClass }}{{#disabled}} i-disabled{{/disabled}}">{{^hasCheckbox}}{{> checkbox }}{{/hasCheckbox}}{{> box }}{{> ripple }}</{{ tag }}>', checkbox: '<input{{#id}} id="{{ id }}"{{/id}} class="{{> checkboxClass }}" type="checkbox"{{#name}} name="{{ name }}"{{/name}}{{#checked}} checked{{/checked}}{{#disabled}} disabled{{/disabled}}>', checkboxClass: "{{ customClass }}__input", box: '<span class="{{ customClass }}__box {{#boxAddClass}}{{boxAddClass}}{{/boxAddClass}}">' + i(382) + "</span>", ripple: '<span class="{{ customClass }}__ripple js-ripple"></span>' }, h = "i-inited", c = function() {
                function t(e) {
                    var i, o = e.customClass,
                        s = void 0 === o ? "tv-control-checkbox" : o,
                        r = e.$checkbox,
                        l = e.tag,
                        c = e.id,
                        d = e.name,
                        p = e.checked,
                        u = e.disabled,
                        _ = e.labelLeft,
                        f = e.labelRight,
                        m = e.labelAddClass,
                        g = e.boxAddClass;
                    if (n(this, t), this.$el = null, void 0 === l && (l = _ || f ? "span" : "label"), i = r instanceof $ && !!r.length) {
                        if (!r.is("input[type=checkbox]")) return void a.logError("`$checkbox` need to be input[type=checkbox]");
                        if (r.hasClass(h)) return;
                        this._setInputId(r, c), this._setInputClass(r, s), this._setInputName(r, d), this._setInputChecked(r, p), this._setInputDisabled(r, u), p = !!r.prop("checked"), u = !!r.attr("disabled")
                    }
                    this.$el = this.render({ $checkbox: r, hasCheckbox: i, customClass: s, tag: l, id: c, name: d, checked: p, disabled: u, labelLeft: _, labelRight: f, hasLabel: _ || f, labelAddClass: m, boxAddClass: g }), this.$checkbox = i ? r : this.$el.find("input[type=checkbox]")
                }
                return s(t, [{ key: "_setInputId", value: function(t, e) { void 0 !== e && t.attr("id", e) } }, {
                    key: "_setInputClass",
                    value: function(t, e) {
                        var i = o.render(l.checkboxClass, { customClass: e });
                        t.addClass(i)
                    }
                }, { key: "_setInputName", value: function(t, e) { void 0 !== e && t.attr("name", e) } }, { key: "_setInputChecked", value: function(t, e) { void 0 !== e && t.prop("checked", !!e) } }, { key: "_setInputDisabled", value: function(t, e) { void 0 !== e && (e ? t.setAttribute("disabled", "disabled") : t.removeAttr("disabled")) } }, {
                    key: "render",
                    value: function(t) {
                        var e, i = t.$checkbox,
                            n = $(o.render(l.labelWrapper, t, l));
                        return t.hasCheckbox && (n.insertBefore(i), e = n.find("." + t.customClass).andSelf().filter("." + t.customClass).eq(0), e.prepend(i.detach()), i.addClass(h)), n
                    }
                }, { key: "checked", set: function(t) { this._setInputChecked(this.$checkbox, !!t) }, get: function() { return !!this.$checkbox.prop("checked") } }]), t
            }(), $.fn.tvControlCheckbox = (0, r.createTvBlockWithInstance)("tv-control-checkbox", function(t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; return new c(TradingView.mergeObj(e, { $checkbox: t })) }), e.default = c,
            t.exports = e.default
    }).call(e, i(30))
}, function(t, e, i) {
    (function(o, n) {
        "use strict";

        function s() {
            var t, e, i = l.width();
            for (c.width = i, c.height = l.height(), t = 0; t < d.length; t++)
                if (i <= c.breakpoints[d[t]]) { c.device !== d[t] && (e = c.device, c.device = d[t], c.trigger("changeDevice", d[t], e)); break }
            return c
        }
        var r, a, l, h, c, d;
        Object.defineProperty(e, "__esModule", { value: !0 }), r = i(753), a = $("body"), l = $(window), h = 0, c = {
            width: null,
            height: null,
            device: null,
            checkDevice: s,
            isMobileSafari: !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/) || !!navigator.userAgent.match("CriOS"),
            getScrollbarWidth: function() { var t = void 0; return function() { var e, i, o, n; return void 0 === t && (e = document.createElement("div"), e.style.visibility = "hidden", e.style.width = "100px", e.style.msOverflowStyle = "scrollbar", document.body.appendChild(e), i = e.offsetWidth, e.style.overflow = "scroll", o = document.createElement("div"), o.style.width = "100%", e.appendChild(o), n = o.offsetWidth, e.parentNode.removeChild(e), t = i - n), t } }(),
            hasScroll: function(t) { return t.get(0).scrollHeight > t.height() },
            breakpoints: r.breakpoints,
            widgetbarBreakpoint: 1064,
            setFixedBodyState: function(t) {
                var e, i, o;
                t && 1 == ++h ? ("hidden" !== $(document.body).css("overflow").toLowerCase() && document.body.scrollHeight > document.body.offsetHeight && ($(".widgetbar-wrap").css("right", c.getScrollbarWidth()), a.css("padding-right", parseInt(a.css("padding-right").replace("px", "")) + c.getScrollbarWidth() + "px").data("wasScroll", !0)), !TradingView.isMobile.any() && c.isMobileSafari ? a.addClass("i-no-scroll-safari") : a.css("top", -l.scrollTop()).addClass("i-no-scroll")) : !t && h > 0 && 0 == --h && (!TradingView.isMobile.any() && c.isMobileSafari ? a.removeClass("i-no-scroll-safari") : (e = -parseInt(a.css("top").replace("px", "")), a.removeClass("i-no-scroll").css("top", ""), l.scrollTop(e)), a.data("wasScroll") && (i = a.get(0), $(".widgetbar-wrap").css("right", 0), o = $(".widgetbar-wrap").width() || 0, i.scrollHeight <= i.clientHeight && (o -= c.getScrollbarWidth()), a.css("padding-right", (o < 0 ? 0 : o) + "px").data("wasScroll", void 0)))
            }
        }, d = Object.keys(c.breakpoints).sort(function(t, e) { return c.breakpoints[t] - c.breakpoints[e] }), o.extend(c, n), s(), $(s), l.on("resize", s), e.default = c, t.exports = e.default
    }).call(e, i(130), i(166))
}, function(t, e) {
    "use strict";
    t.exports = {
        text: { name: "LineToolText", supportsText: !0 },
        anchored_text: { name: "LineToolTextAbsolute", supportsText: !0 },
        note: { name: "LineToolNote", supportsText: !0 },
        anchored_note: { name: "LineToolNoteAbsolute", supportsText: !0 },
        callout: { name: "LineToolCallout", supportsText: !0 },
        balloon: { name: "LineToolBalloon", supportsText: !0 },
        arrow_up: { name: "LineToolArrowMarkUp", supportsText: !0 },
        arrow_down: { name: "LineToolArrowMarkDown", supportsText: !0 },
        arrow_left: { name: "LineToolArrowMarkLeft", supportsText: !0 },
        arrow_right: { name: "LineToolArrowMarkRight", supportsText: !0 },
        price_label: { name: "LineToolPriceLabel" },
        flag: { name: "LineToolFlagMark" },
        vertical_line: { name: "LineToolVertLine" },
        horizontal_line: { name: "LineToolHorzLine" },
        horizontal_ray: { name: "LineToolHorzRay" },
        trend_line: { name: "LineToolTrendLine" },
        trend_angle: { name: "LineToolTrendAngle" },
        arrow: { name: "LineToolArrow" },
        ray: { name: "LineToolRay" },
        extended: { name: "LineToolExtended" },
        parallel_channel: { name: "LineToolParallelChannel" },
        disjoint_angle: { name: "LineToolDisjointAngle" },
        flat_bottom: { name: "LineToolFlatBottom" },
        pitchfork: { name: "LineToolPitchfork" },
        schiff_pitchfork_modified: { name: "LineToolSchiffPitchfork" },
        schiff_pitchfork: { name: "LineToolSchiffPitchfork2" },
        inside_pitchfork: { name: "LineToolInsidePitchfork" },
        pitchfan: { name: "LineToolPitchfan" },
        gannbox: { name: "LineToolGannSquare" },
        gannbox_square: { name: "LineToolGannComplex" },
        gannbox_fan: { name: "LineToolGannFan" },
        fib_retracement: { name: "LineToolFibRetracement" },
        fib_trend_ext: { name: "LineToolTrendBasedFibExtension" },
        fib_speed_resist_fan: { name: "LineToolFibSpeedResistanceFan" },
        fib_timezone: { name: "LineToolFibTimeZone" },
        fib_trend_time: { name: "LineToolTrendBasedFibTime" },
        fib_circles: { name: "LineToolFibCircles" },
        fib_spiral: { name: "LineToolFibSpiral" },
        fib_speed_resist_arcs: { name: "LineToolFibSpeedResistanceArcs" },
        fib_wedge: { name: "LineToolFibWedge" },
        fib_channel: { name: "LineToolFibChannel" },
        xabcd_pattern: { name: "LineTool5PointsPattern" },
        cypher_pattern: { name: "LineToolCypherPattern" },
        abcd_pattern: { name: "LineToolABCD" },
        triangle_pattern: { name: "LineToolTrianglePattern" },
        "3divers_pattern": { name: "LineToolThreeDrivers" },
        head_and_shoulders: { name: "LineToolHeadAndShoulders" },
        elliott_impulse_wave: { name: "LineToolElliottImpulse" },
        elliott_triangle_wave: { name: "LineToolElliottTriangle" },
        elliott_triple_combo: { name: "LineToolElliottTripleCombo" },
        elliott_correction: { name: "LineToolElliottCorrection" },
        elliott_double_combo: { name: "LineToolElliottDoubleCombo" },
        cyclic_lines: { name: "LineToolCircleLines" },
        time_cycles: { name: "LineToolTimeCycles" },
        sine_line: { name: "LineToolSineLine" },
        long_position: { name: "LineToolRiskRewardLong" },
        short_position: { name: "LineToolRiskRewardShort" },
        forecast: { name: "LineToolPrediction" },
        date_range: { name: "LineToolDateRange" },
        price_range: { name: "LineToolPriceRange" },
        date_and_price_range: { name: "LineToolDateAndPriceRange" },
        bars_pattern: { name: "LineToolBarsPattern" },
        ghost_feed: { name: "LineToolGhostFeed" },
        projection: { name: "LineToolProjection" },
        rectangle: { name: "LineToolRectangle" },
        rotated_rectangle: { name: "LineToolRotatedRectangle" },
        ellipse: { name: "LineToolEllipse" },
        triangle: { name: "LineToolTriangle" },
        polyline: { name: "LineToolPolyline" },
        curve: { name: "LineToolBezierQuadro" },
        double_curve: { name: "LineToolBezierCubic" },
        arc: { name: "LineToolArc" },
        icon: { name: "LineToolIcon" }
    }
}, function(t, e, i) {
    "use strict";

    function o(t) { this._options = t || {}, this._setInput(), this._caption = $('<i class="interval-caption">').html("&nbsp;"), this._helpTooltipTrigger = $('<i class="help-tooltip-trigger apply-common-tooltip common-tooltip-below">').text("?").attr("title", $.t("Type the interval number for munute charts (i.e. 5 if it is going to be a five minute chart). Or number plus letter for H (Hourly), D (Daily), W (Weekly), M (Monthly) intervals (i.e. D or 2H)")), this._dialogTitle = $.t("Change Interval") }
    var n = i(72),
        s = i(77);
    o.prototype._setInput = function() {
        this._input = $('<input type="text" class="change-interval-input" autocomplete="off" maxlength="4">'),
            this._input.on("keypress", this._handleInput.bind(this)).on("input", function() { this._validate(), this._updateCaption() }.bind(this)).on("blur", function() { setTimeout(this._submit.bind(this), 0) }.bind(this))
    }, o.prototype._validate = function() {
        var t = this._input.val();
        this._parsed = s.parseIntervalValue(t), this._valid = !this._parsed.error, this._supported = !this._parsed.error && s.intervalIsSupported(t), !this._supported || this._parsed.unit && "H" !== this._parsed.unit || this._parsed.qty * ("H" === this._parsed.unit ? 60 : 1) > 1440 && (this._supported = !1)
    }, o.prototype._updateCaption = function() {
        var t, e, i;
        this._valid && this._supported ? (e = this._parsed.qty || 1, i = this._parsed.unit ? { H: "hour", D: "day", W: "week", M: "month", S: "second" }[this._parsed.unit] : "minute", t = e + " " + $.t(i, { count: e }), this._input.add(this._caption).removeClass("error")) : (t = this._parsed.error ? "&nbsp;" : $.t("Not applicable"), this._input.add(this._caption).addClass("error")), this._caption.html(t)
    }, o.prototype._handleInput = function(t) {
        if (13 === t.which) return void this._submit();
        t.ctrlKey || t.metaKey || !t.charCode || !t.which || t.which <= 32 || s.isIntervalChar(String.fromCharCode(t.charCode)) || t.preventDefault()
    }, o.prototype._submit = function() {
        var t, e;
        TVDialogs.isOpen(this._dialogTitle) && (this._valid && this._supported && (t = s.sanitizeIntervalValue(this._input.val()), e = n.interval.value(), t && e !== t && "function" == typeof this._options.callback && this._options.callback(t)), TVDialogs.destroy(this._dialogTitle))
    }, o.prototype._setInitialValue = function(t) {
        var e, i;
        t = t || this._options.initialValue, e = "", i = !1, t && "," !== t ? e = s.sanitizeIntervalValue(t) || "" : (t = n.interval.value(), e = t, i = !0), this._input.val(e), i && this._input.select()
    }, o.prototype.isValid = function() { return !!this._valid }, o.prototype.show = function(t) {
        var e = TVDialogs.createDialog(this._dialogTitle, { hideCloseCross: !0, addClass: "change-interval-dialog" }),
            i = e.find("._tv-dialog-content");
        return e.css("min-width", 0), i.css("min-width", 0).mousedown(function(t) { this._input.is(t.target) || t.preventDefault() }.bind(this)).append(this._input.add(this._caption).add(this._helpTooltipTrigger)), TVDialogs.applyHandlers(e), TVDialogs.positionDialog(e), this._setInitialValue(t), this._validate(), this._updateCaption(), e
    }, t.exports = o
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t) {
            var i, o, n, s, r, a, l, h, c, d, p, _, m, g, y, b, w, C, x, P, L, k = this;
            this._guid = H(), this._startSpinner(t.jqParent), S.init(), i = this, S.tool.subscribe(function(t) {
                    var e, o, n, s;
                    i._model && (e = t, i._model.model().setCurrentTool(e), TradingView.isMobile.any() && (o = i._paneWidgets[0], v.isLineTool(e) && "LineToolBrush" !== e ? (n = .5 * i._model.model().timeScale().width(), s = .5 * o._state.defaultPriceScale().height(), i._model.model().setCurrentPosition(n, s, o._state), o._updateTooltip(n, s)) : o._hideTooltip()), i._model && TradingView.isMobile.any() && i._model.model().crossHairSource().updateAllViews())
                }), o = function(t, e, i) {
                    var o, n = e.mainSeries().syncModel(),
                        s = t.mainSeries().syncModel(),
                        r = i;
                    return n && s && (o = t._createSyncPoint(n, s), r = o.sourceTimeToTargetTime(i)), t.timeScale().points().roughIndex(r, s && s.distance.bind(s))
                }, n = function(t, e, i) {
                    var o, n = e.mainSeries().syncModel(),
                        s = i.mainSeries().syncModel(),
                        r = n && s && i._createSyncPoint(n, s);
                    return r ? (o = e.timeScale(), t.map(function(t) {
                        var e = $.extend({}, t),
                            a = o.timePointToIndex(e.time_t),
                            l = t.timeStamp || o.points().roughTime(a + e.offset, n.projectTime.bind(n));
                        return e.time_t = r.sourceTimeToTargetTime(l), e.index = i.timeScale().points().roughIndex(e.time_t, s && s.distance.bind(s)), e.offset = 0, e
                    })) : t
                }, S.createdLineTool.subscribe(null, function(t) {
                    var e, i, n = k._model.model();
                    t.model !== n && k._model.model().mainSeries().symbol() === t.symbol && (e = n.paneForSource(k._model.model().mainSeries()), i = { index: o(n, t.model, t.point.timeStamp), price: t.point.price }, k._model.createLineTool(e, i, t.linetool, t.properties, t.linkKey))
                }), S.continuedLineTool.subscribe(null, function(t) {
                    var e, i, s, r = k._model.model();
                    t.model !== r && (e = { index: o(r, t.model, t.point.timeStamp), price: t.point.price }, (i = k._model.lineBeingCreated()) && k._model.model().coninueCreatingLine(e, t.envState, !!t.finalState) && t.finalState && (s = $.extend({}, t.finalState), s.points = n(t.finalState.points, t.model, r), i.restoreExternalPoints(s)))
                }), S.cancelledLineTool.subscribe(null, function(t) {
                    var e = k._model.model();
                    t.model !== e && k._model.model().cancelCreatingLine()
                }), S.startedMovingLineTool.subscribe(null, function(t) {
                    var e, i, n = k._model.model();
                    t.model !== n && k._model.model().mainSeries().symbol() === t.symbol && (e = n.dataSources().filter(function(e) { return e.linkKey === t.linkKey })[0]) && e.isActualSymbol() && (i = { index: o(n, t.model, t.point.timeStamp), price: t.point.price }, k._model.model().startMovingSource(e, i))
                }), S.movedLineTool.subscribe(null, function(t) {
                    var e, i = k._model.model();
                    t.model !== i && i.sourceBeingMoved() && i.sourceBeingMoved().linkKey === t.linkKey && (e = { index: o(i, t.model, t.point.timeStamp), price: t.point.price }, k._model.model().moveSource(e))
                }), S.finishedMovingLineTool.subscribe(null, function(t) {
                    var e, i, o = k._model.model();
                    t.model !== o && (e = o.sourceBeingMoved()) && (k._model.model().endMovingSource(!!t.finalState), t.finalState && (i = $.extend({}, t.finalState), i.points = n(t.finalState.points, t.model, o), e.restoreExternalPoints(i)))
                }), S.startedChangingLineTool.subscribe(null, function(t) {
                    var e, i, n = k._model.model();
                    t.model !== n && k._model.model().mainSeries().symbol() === t.symbol && (e = n.dataSources().filter(function(e) { return e.linkKey === t.linkKey })[0]) && e.isActualSymbol() && (i = { index: o(n, t.model, t.point.timeStamp), price: t.point.price }, k._model.model().startChangingLinetool(e, i, t.pointIndex, t.envState))
                }), S.changedLineTool.subscribe(null, function(t) {
                    var e, i = k._model.model();
                    t.model !== i && i.lineBeingEdited() && i.lineBeingEdited().linkKey === t.linkKey && (e = { index: o(i, t.model, t.point.timeStamp), price: t.point.price }, k._model.model().changeLinePoint(e, t.envState))
                }), S.finishedChangingLineTool.subscribe(null, function(t) {
                    var e, i, o = k._model.model();
                    t.model !== o && (e = o.dataSources().filter(function(e) { return e.linkKey === t.linkKey })[0], o.lineBeingEdited() && k._model.model().endChangingLinetool(!!t.finalState), e && e.isActualSymbol() && t.finalState && (i = $.extend({}, t.finalState), i.points = n(t.finalState.points, t.model, o), e.restoreExternalPoints(i)))
                }), S.removedLineTool.subscribe(null, function(t) {
                    var e, i = k._model.model();
                    t.model !== i && (e = i.dataSources().filter(function(e) { return e.linkKey === t.linkKey })[0]) && k._model.model().removeSource(e)
                }), S.finishedLineTool.subscribe(null, function(t) {
                    var e = k._model.model();
                    t.model !== e && e.dataSources().filter(function(e) { return e.linkKey === t.linkKey })[0] && k._model.model().finishLineTool()
                }), S.changedLineStyle.subscribe(null, function(t) {
                    var e, i = k._model.model();
                    t.model !== i && (e = i.dataSources().filter(function(e) { return e.linkKey === t.linkKey })[0]) && (e.properties().merge(t.state), e.propertiesChanged())
                }), S.restoredLineToolState.subscribe(null, function(t) {
                    var e, i, o = k._model.model();
                    t.model !== o && (e = o.dataSources().filter(function(e) { return e.linkKey === t.linkKey })[0]) && (i = $.extend({}, t.state), i.points = n(t.state.points, t.model, o), i.indexes = i.points.map(function(t) { return { index: t.index, price: t.price } }), o.restoreLineToolState(e, i))
                }), S.restoredLineTool.subscribe(null, function(t) {
                    var e = k._model.model();
                    t.model !== e && e.restoreSource(t.state.restorePane, t.state.paneIndex, t.state.paneState, t.state.sourceState, t.state.priceScaleName)
                }), S.copiedLineTool.subscribe(null, function(t) {
                    var e, i, o, s, r, a = k._model.model();
                    if (t.model !== a && k._model.model().mainSeries().symbol() === t.symbol) {
                        if (t.model.mainSeries().syncModel(), a.mainSeries().syncModel(), e = a.paneForSource(k._model.model().mainSeries()), i = n(t.points, t.model, a), o = i[0], s = a.createLineTool(e, o, t.linetool, null, t.linkKey), a.lineBeingCreated())
                            for (r = 1; r < i.length; r++) r !== i.length - 1 || "LineToolBrush" !== t.linetool && "LineToolGhostFeed" !== t.linetool || a.finishLineTool(!0), a.coninueCreatingLine(i[r], {}, r < i.length - 1, !0);
                        s.properties().interval.setValue(t.state.interval), s.properties().merge(t.state), s.restoreData && s.restoreData(t), s.propertiesChanged()
                    }
                }), this._options = t = t || {}, s = t.jqParent, r = t.sizeFunc, a = t.content, l = t.readOnly, h = t.containsData, c = t.onWidget, d = t.onCmeWidget, d && X.logWarn("[ChartWidget] 'onCmeWidget' option is depricated"), p = t.widgetCustomer, _ = t.timezone, m = t.withDateRanges, g = t.hideSymbolSearch, y = t.defSymbol, b = t.defInterval, w = t.defExtendedHours, C = t.defTimeframe, x = -1 !== $.inArray(t.defStyle, $.map($.grep(Object.keys(u), function(t) { return /^STYLE_\w+/.test(t) }), function(t) { return u[t] })), P = x ? t.defStyle : void 0, this._chartWidgetCollection = t.chartWidgetCollection || null, this._withDateRanges = (void 0 === m ? !l : !!m) && f.enabled("timeframes_toolbar"), this._jqParent = void 0 !== s ? s : $(document.body), this._setContent(a), this._readOnly = l, this._containsData = h, this._defSymbol = y, this._defInterval = b, this._defTimeframe = C, this._defStyle = P, this._onWidget = !!c, this._onWidget && (d ? this._widgetCustomer = "cme" : p && (this._widgetCustomer = p)), this.controlBarHeight = 22, this._sizeFunc = r || function() {
                    var t = k._jqParent.width(),
                        e = k._jqParent.height(),
                        i = k._jqParent[0];
                    return window.self !== window.top && i.offsetWidth < i.clientWidth && i.getBoundingClientRect().width < 100 && (t = Math.round(100 * i.getBoundingClientRect().width), e = Math.round(100 * i.getBoundingClientRect().height)), { x: 0, y: 0, w: t, h: e - (k._withDateRanges ? k.controlBarHeight : 0) }
                },
                this._hideSymbolSearch = g, this._jqMainDiv = null, this._rect = this._sizeFunc(), this._jqMainTable = null, this._paneWidgets = [], this._paneSeparators = [], this._timeAxisWidget = null, this._frameTime = 30, this._model = null, this._metaInfo = {}, L = this._contentSeriesProperties(), L && (y = L.symbol, b = L.interval), void 0 === T || T.isValid(b) || (b = void 0), this._properties = new M("chartproperties"), this._properties.mainSeriesProperties.merge(defaults("chartproperties.mainSeriesProperties")), this._properties.mainSeriesProperties.merge({ visible: !0, symbol: y || DEFAULT_SYMBOL, shortName: "", timeframe: "", onWidget: this._onWidget, interval: b || "D", style: P, extendedHours: w, lineStyle: { styleType: TradingView.factoryDefaults("chartproperties.mainSeriesProperties.lineStyle.styleType") } }), this._containsData && this._properties.mainSeriesProperties.merge({ showCountdown: !1 }), _ && V(_) && this._properties.timezone.setValue(_), this._tagsChanged = new e, this._modelCreated = new e, this._disconnected = new e, this._reconnectBailout = new e, this._connected = new e, this._redrawPanes = new e, this._onScroll = new e, this.chartWidgetInitialized = new e, this._studiesMetaData = [], this._studiesMigrations = [], this._chartSession = new R(ChartApiInstance), this.lhsPriceAxisWidthChanged = new e, this.rhsPriceAxisWidthChanged = new e, this._isActive = t.isActive
        }

        function n(t) { return { UTC: "Etc/UTC", EST: "America/New_York", CST: "America/Chicago", PST: "America/Los_Angeles" }[t] || "exchange" }

        function s(t) { return t.description_localized = $.t(t.description, { context: "study" }), t }
        var r = i(659),
            a = i(658),
            l = i(53).UndoHistory,
            h = i(682),
            c = i(194),
            d = i(669),
            p = (i(80), i(102).BarsMarksContainer),
            u = i(43),
            _ = i(298),
            f = i(3),
            m = i(31).Study,
            g = i(157),
            v = i(1).LineDataSource,
            y = i(47),
            b = y.Action,
            w = y.ActionSeparator,
            S = i(42),
            T = i(36).Interval,
            C = i(601),
            x = i(661),
            P = i(667),
            L = (i(345), i(21)),
            k = i(255).AddCompareDialog,
            I = i(72),
            A = i(190),
            E = i(77),
            M = (i(285), i(7).DefaultProperty),
            D = i(161),
            O = D.availableTimezones,
            V = D.timezoneIsAvailable,
            B = i(71).createDialog,
            R = i(282),
            N = (i(86), i(25)),
            F = i(127).unifiedSpinner,
            z = i(33).trackEvent,
            W = i(44).assert,
            H = i(60).guid,
            U = i(120),
            j = (U.addCanvasTo, U.Size),
            q = i(257),
            Y = i(93).createConfirmDialog,
            G = i(727).MarketStatusIndicator,
            K = i(726).DataModeIndicator,
            X = i(12).getLogger("ChartWidget", { color: "#606" });
        o.prototype.setTimezone = function(t) { t && V(t) ? this._properties.timezone.setValue(t) : console.warn("Incorrect timezone: " + JSON.stringify(t)) }, o.prototype.refreshMarks = function() { this.model().barsMarksSources().forEach(function(t) { t.refreshData() }) }, o.prototype.clearMarks = function() { this.model().barsMarksSources().forEach(function(t) { t.clearMarks() }) }, o._nextMetadataId = 1, o.prototype._setAlertsStudiesList = function(t) {
                this._alertsStudiesList = $.map($.grep(t, function(t) {
                    var e, i = t.plots || [];
                    for (e = 0; e < i.length; e++)
                        if ("line" === i[e].type) return !0;
                    return !1
                }), function(t) { return t.id })
            }, o.prototype.canCreateAlertForDataSource = function(t) { if (!f.enabled("alerts")) return !1 }, o._filterAuthorizedMetaInfo = function(t) { var e, i, o, n, s = []; for (e = 0; t && e < t.length; ++e) i = t[e], o = N.parseIdString(i.id), n = o.productId, pro.hasPackage(n) && s.push(i); return s }, o.prototype.privateMetaInfo = function(t) {
                if (t) {
                    return new t(N.CURRENT_METAINFO_FORMAT_VERSION).generateMetaInfo()
                }
                return []
            }, o.prototype._onScriptSources = function(t, e) {
                var i, o, n, s, r, a, l, h;
                for (X.logDebug("ChartWidget _onScriptSources called"), i = null, o = 0; o < e.length; ++o)
                    if (n = e[o], n.id.startsWith("Script@tv-scripting-")) { i = N.parseIdString(n.id).version; break }
                if (null != i) {
                    for (this.studyScriptingPkgVers = i, s = 0, r = 0, o = 0; o < t.length; ++o) { a = t[o], l = a && a.scriptName, s++; try { h = N.createMetaInfoStub(a, i), e.push(h) } catch (t) { X.logError("Could not process script (skipped): " + l + " (" + t.message + ")"), r++ } }
                    X.logDebug("User's Pine Scripts loaded " + s + ", skipped " + r)
                } else X.logError("Could not find tv-scripting package in metadata response");
                for (o = 0; o < e.length; o++) N.addOrReplaceStudyMetaInfo(this._studiesMetaData, e[o]);
                this._inited ? this.model().model().setStudiesMetaData(this._studiesMetaData, this._studiesMigrations) : (this._init(), this.chartWidgetInitialized.fire(), X.logDebug("ChartWidget _onScriptSources done"))
            }, o.prototype._init = function() {
                var t, e, o = this;
                this._containsData || this._content && this._content.timeScale && !this._content.timeScale.m_lastVisibleBar && (this._content.timeScale.m_rightOffset = this._properties.timeScale.rightOffset.value()), this.model() && this.model().mainSeries().clearData(), this.initColors(), this._makeDefaultGui(), t = function() {
                    var t, e;
                    o._checkObsoleteTimezone(), o._chartSession && o._chartSession.connected() && o._restartModel(), this._content && (this.initColors(), this._updateGui(), this.update()), t = o._model.mainSeries(), t.marketStatus.subscribe(function(e) { o.indicatorImage && o._updateDataAndMarketStatus(e, t.status(), t.quoteData.update_mode_seconds) }, { callWithLast: !0 }), this._resizeHandler = function(t) { this._rect = this._sizeFunc(), t && (this._rect.w += t, this._rect.h += t), this._updateAbsoluteRect(), this._adjustSize(), this._model && this._model.mainSeries().requestMoreData(), t || (this.paint(), this.resizeSeriesControlUI(), this.checkCompactMode(), this.resizeIndicator()) }.bind(this), this._resizeHandler(), this._jqMainDiv.appendTo(this._jqParent), this._spinner && (this._spinner.stop(), delete this._spinner), e = i(214), e.isFeatureEnabled("chrome_canvas_fix") && navigator.userAgent.match(/windows.+chrome/i) && $(window).on("visibilitychange", function(t, e) { e && (o._resizeHandler(1), setTimeout(function() { o._resizeHandler() }, 0)) }), $(window).keydown(function(t) { 27 === t.which && t.preventDefault() }), this._containsData || this._jqMainDiv.mousewheel(function(t, e, i, o) { var n, s, r, a, l; if ((TradingView.onWidget() || !parent || parent === window || !parent.IS_DEMO_PAGE) && this.model() && !this.noScroll && !this.model().timeScale().isEmpty()) return n = t.pageX - 5, s = this._paneWidgets[0].lhsPriceAxisWidget.size.w, r = this._timeAxisWidget.size.w, s && (n = Math.max(0, n - s)), n = Math.min(n, r), a = f.enabled("right_bar_stays_on_scroll") ? 1 : 2 * (n / r - .5), l = Math.min(1, Math.abs(o)), o > 0 ? this.model().zoomIn(a, l) : o < 0 && this.model().zoomOut(a, l), i && this.model().scrollChart(-80 * i), !1 }.bind(this)), this._initBarsMarksSources(), this.setAutoScaleOnSymbolChange(), this.readOnly() || this._hideSymbolSearch || E.registerDialogKeypressHandler(this),
                        this.model().timeScale().onScroll().subscribe(this, function() { this._onScroll.fire() }), this._inited = !0
                }.bind(this), e = this._makeDefaultModel(), void 0 === e ? t() : e.then(t)
            }, o.prototype._checkObsoleteTimezone = function() {
                var t = this._properties.timezone.value();
                V(t) || this._properties.timezone.setValue(n(t))
            }, o.prototype._initBarsMarksSources = function() {
                var t = this;
                this.withModel(this, function() { this.model().barsMarksSources().forEach(function(e) { e.onNeedRepaint.subscribe(t, t.paint) }) })
            }, o.prototype.initESDTimelineWidget = function() { new ESDTimelineWidget(this) }, o.prototype.applyAutoScaleOnNewSymbol = function() {
                (!this.model().mainSeries() instanceof u || !this.model().mainSeries().properties().lockScale.value()) && this.model().mainSeries().priceScale().setAutoScale(!0)
            }, o.prototype.setAutoScaleOnSymbolChange = function() { this.withModel(this, function() { this.model().mainSeries().properties().symbol.listeners().subscribe(this, function() { this.applyAutoScaleOnNewSymbol() }) }) }, o.prototype.initColors = function() { this._properties.paneProperties.background.listeners().subscribe(this, o.prototype.setBackgroundColor), this._properties.paneProperties.vertGridProperties.color.listeners().subscribe(this, o.prototype.redrawPanes), this._properties.paneProperties.horzGridProperties.color.listeners().subscribe(this, o.prototype.redrawPanes), this._properties.scalesProperties.lineColor.listeners().subscribe(this, o.prototype.setScaleLineColor), this._properties.scalesProperties.textColor.listeners().subscribe(this, o.prototype.setScaleTextColor) }, o.prototype.paneWidgets = function() { return this._paneWidgets }, o.prototype.paneByCanvas = function(t) {
                for (var e = 0; e < this._paneWidgets.length; e++)
                    if (this._paneWidgets[e].canvas === t || this._paneWidgets[e].top_canvas === t) return this._paneWidgets[e];
                return null
            }, o.prototype.paneByState = function(t) {
                for (var e = 0; e < this._paneWidgets.length; e++)
                    if (this._paneWidgets[e]._state === t) return this._paneWidgets[e];
                return null
            }, o.prototype.priceAxisByCanvas = function(t) {
                var e, i, o;
                for (e = 0; e < this._paneWidgets.length; e++)
                    if (i = this._paneWidgets[e], o = i.priceAxisByCanvas(t)) return o;
                return null
            }, o.prototype.timeAxisByCanvas = function(t) { return t === this._timeAxisWidget.canvas || t === this._timeAxisWidget.top_canvas ? this._timeAxisWidget : null }, o.prototype.properties = function() { return this._properties }, o.prototype.emulateCriticalError = function() { this._chartSession.removeSeries(-1, null) }, o.prototype.readOnly = function() { return this._readOnly }, o.prototype.onDisconnected = function() { return this._disconnected }, o.prototype.onReconnectBailout = function() { return this._reconnectBailout }, o.prototype.onConnected = function() { return this._connected }, o.prototype.onRedrawPanes = function() { return this._redrawPanes }, o.prototype.onScroll = function() { return this._onScroll }, o.prototype.modelCreated = function() { return this._modelCreated }, o.prototype.setResolution = function(t) {
                if (!this._model) return void this._properties.mainSeriesProperties.merge({ interval: t });
                var e = this._model.mainSeries().properties().interval;
                this._model.setScreenChartProperty(e, t, this, $.t("Change Resolution"))
            },
            o.prototype.getResolution = function() { return this._model ? this._model.mainSeries().properties().interval.value() : this._properties.mainSeriesProperties.interval.value() }, o.prototype._addSymbol = function(t, e) {
                var i = this.model(),
                    o = i.studiesMetaData(),
                    n = "study_Overlay@tv-basicstudies",
                    s = f.enabled("use_overrides_for_overlay") && TradingView.defaultProperties[n] && TradingView.defaultProperties[n].style,
                    r = s || (i.mainSeries().properties().style.value() === u.STYLE_CANDLES ? u.STYLE_BARS : u.STYLE_CANDLES),
                    a = { inputs: { symbol: t }, style: r },
                    l = o.filter(function(t) { return "Overlay@tv-basicstudies" === t.id })[0];
                i.insertStudy(l, a, e)
            }, o.prototype.addSymbol = function(t, e) { this._addSymbol.apply(this, arguments) }, o.prototype.updateActions = function() {
                function t() {
                    var t, e, i = studyTemplates.plainList("custom"),
                        o = studyTemplates.plainList("default");
                    l.applyStudyTemplate.subActions || (l.applyStudyTemplate.subActions = []), t = l.applyStudyTemplate.subActions, t.splice(0, t.length), e = new b({ text: studyTemplates._SAVE_AS_TITLE }), e.callbacks().subscribe(studyTemplates, studyTemplates.showSaveAsDialog), t.push(e, new w), i.length || o.length ? (i.length && ($.each(i, function(e, i) {
                        function o(t) { return function() { return studyTemplates.deleteStudyTemplate(t), this._parentMenu._parentMenuItem._parentMenu.destroy(), !1 } }
                        var n = new b({ text: i });
                        n.callbacks().subscribe(studyTemplates, function() { this.applyStudyTemplate(i) }), n.deleteButton = { action: o(n.text) }, t.push(n)
                    }), o.length && t.push(new w)), $.each(o, function(e, i) {
                        var o = new b({ text: i });
                        o.callbacks().subscribe(studyTemplates, function() { this.applyStudyTemplate(i) }), t.push(o)
                    })) : t.push(new b({ text: $.t("No study templates saved"), enabled: !1 }))
                }
                var e, i, o, n, s, r, a, l = this.actions(),
                    h = this._model.dataSources(),
                    c = !1,
                    d = !1;
                for (e = 0, i = h.length; e < i; e++) o = h[e], TradingView.isInherited(o.constructor, v) && o.isUserDeletable() && (c = !0), TradingView.isInherited(o.constructor, m) && o.removeByRemoveAllStudies() && (d = !0), TradingView.isInherited(o.constructor, g) && (d = !0);
                this._readOnly || (l.paneRemoveAllStudies && l.paneRemoveAllStudies.setEnabled(d), l.paneRemoveAllDrawingTools && l.paneRemoveAllDrawingTools.setEnabled(c), l.paneRemoveAllStudiesDrawingTools && l.paneRemoveAllStudiesDrawingTools.setEnabled(d || c)), window.studyTemplates && (t(), studyTemplates.refreshStudyTemplateList(t)), n = this, s = [], r = O, a = function(t) { return t.id === n.model().model().properties().timezone.value() }, r.forEach(function(t) {
                    if (!t.separator) {
                        var e = new b({ text: t.title, checkable: !0, checked: a(t) });
                        e.callbacks().subscribe(this, function() { n.model().setProperty(n.model().model().properties().timezone, t.id, "Changed Time Zone") }), s.push(e)
                    }
                }, this), l.applyTimeZone.subActions = s, l.addToWatchlist && (l.addToWatchlist.text = $.t("Add {0} To Watchlist").format(this.getSymbol(!0))), l.addToTextNotes && (l.addToTextNotes.text = $.t("Add Text Note For {0}").format(this.getSymbol(!0))), this.updateActionForIntradayOnly(l.sessionBreaks)
            }, o.prototype.actions = function() { return this._actions || this._setActions(), this._actions }, o.prototype._setActions = function() {
                var t, e, n, s, r, a, h, c, d, p, u, _, m, g, v, y, T, C, x, k, M, D, O, V, B, R, N, F, W, H, U, j, q, Y, G, K, X, Z, J, Q, tt, et, it, ot, nt, st, rt, at, lt, ht, ct, dt, pt, ut, _t = i(5).ActionBinder,
                    ft = this,
                    mt = [];
                if (!this._readOnly) {
                    for (mt = [new b({ text: $.t("Eraser"), callbackContext: "eraser" }), new w, new b({ text: $.t("Trend Line"), callbackContext: "LineToolTrendLine" }), new b({ text: $.t("Horizontal Line"), callbackContext: "LineToolHorzLine" }), new b({ text: $.t("Vertical Line"), callbackContext: "LineToolVertLine" }), new b({ text: $.t("Arrow"), callbackContext: "LineToolArrow" }), new b({ text: $.t("Ray"), callbackContext: "LineToolRay" }), new b({ text: $.t("Extended"), callbackContext: "LineToolExtended" }), new b({ text: $.t("Parallel Channel"), callbackContext: "LineToolParallelChannel" }), new w, new b({ text: $.t("Pitchfork"), callbackContext: "LineToolPitchfork" }), new b({ text: $.t("Schiff Pitchfork"), callbackContext: "LineToolSchiffPitchfork" }), new b({ text: $.t("Pitchfan"), callbackContext: "LineToolPitchfan" }), new b({ text: $.t("Gann Square"), callbackContext: "LineToolGannSquare" }), new b({ text: $.t("Gann Fan"), callbackContext: "LineToolGannFan" }), new b({ text: $.t("Fib Retracement"), callbackContext: "LineToolFibRetracement" }), new b({ text: $.t("Trend-Based Fib Extension"), callbackContext: "LineToolTrendBasedFibExtension" }), new b({ text: $.t("Fib Speed Resistance Fan"), callbackContext: "LineToolFibSpeedResistanceFan" }), new b({ text: $.t("Fib Time Zone"), callbackContext: "LineToolFibTimeZone" }), new b({ text: $.t("Circle Lines"), callbackContext: "LineToolCircleLines" }), new b({ text: $.t("Fib Circles"), callbackContext: "LineToolFibCircles" }), new b({ text: $.t("Fib Speed Resistance Arcs"), callbackContext: "LineToolFibSpeedResistanceArcs" }), new w, new b({ text: $.t("Rectangle"), callbackContext: "LineToolRectangle" }), new b({ text: $.t("Ellipse"), callbackContext: "LineToolEllipse" }), new b({ text: $.t("Triangle"), callbackContext: "LineToolTriangle" }), new b({ text: $.t("Polyline"), callbackContext: "LineToolPolyline" }), new b({ text: $.t("Arc"), callbackContext: "LineToolArc" }), new w, new b({ text: $.t("Text"), callbackContext: "LineToolText" }), new b({ text: $.t("Anchored Text"), callbackContext: "LineToolTextAbsolute" }), new b({ text: $.t("Balloon"), callbackContext: "LineToolBalloon" }), new b({ text: $.t("Price Label"), callbackContext: "LineToolPriceLabel" }), new w, new b({ text: $.t("Elliott Wave Subminuette"), callbackContext: "LineToolElliottSubminuette" }), new b({ text: $.t("Elliott Wave Minor"), callbackContext: "LineToolElliottMinor" }), new b({ text: $.t("Elliott Wave Circle"), callbackContext: "LineToolElliottCircle" }), new b({ text: $.t("Elliott Minor Retracement"), callbackContext: "LineToolElliottMinorRetr" }), new b({ text: $.t("Elliott Major Retracement"), callbackContext: "LineToolElliottMajorRetr" }), new w, new b({ text: $.t("Brush"), callbackContext: "LineToolBrush" }), new w, new b({ text: $.t("Forecast"), callbackContext: "LineToolPrediction" })], ft = this, n = function(t) { S.tool.setValue(t.callbackContext()) }, s = 0; s < mt.length; s++) mt[s].callbacks().subscribe(null, n);
                    t = new b({ text: $.t("Scales Properties...") }), e = new b({ text: $.t("Timezone/Sessions Properties...") })
                }
                new b({
                        text: $.t("Add Alert"),
                        shortcut: "Alt+A"
                    }), r = new b({ text: $.t("Reset Chart"), shortcut: "Alt+R" }), r.callbacks().subscribe(this, this.GUIResetScales), a = new b({ text: $.t("Undo"), shortcut: "ctrl+z" }), a.callbacks().subscribe(null, function() { z("GUI", "Undo"), l.undo() }), a.disable(), h = new b({ text: $.t("Redo"), shortcut: "ctrl+y" }), h.callbacks().subscribe(null, function() { z("GUI", "Redo"), l.redo() }), h.disable(), l.undoStack().onChange().subscribe(this, this.updateUndoRedo), l.redoStack().onChange().subscribe(this, this.updateUndoRedo), c = new b({ text: $.t("Color Theme") }), d = new b({ text: $.t("TimeZone") }), p = new b({ text: $.t("Change Symbol..."), shortcut: $.t("Any Symbol"), doNotBindShortcut: !0 }), TVSettings.setValue("symboledit.dialog_last_entry", ""), p.callbacks().subscribe(this, function() { E.showDialog({ callback: this.setSymbol.bind(this) }) }), u = new b({ text: $.t("Change Interval..."), shortcut: $.t("Any Number"), doNotBindShortcut: !0 }), u.callbacks().subscribe(this, function() { new A({ callback: function(t) { I.interval.setValue(t) } }).show() }), TradingView.onWidget() || (f.enabled("add_to_watchlist") && (_ = new b({ text: $.t("Add To Watchlist"), shortcut: "Alt+W" }), _.callbacks().subscribe(this, function() {
                        var t, e, i = widgetbar.setPage("base");
                        for (e = 0; e < i.widgets.length; e++)
                            if ("watchlist" === i.widgets[e].type) { t = i.widgets[e].widgetObject; break }
                        t && t.addHighlight(this.getSymbol())
                    })), m = new b({ text: $.t("Add To Text Notes"), shortcut: "Alt+N" }), m.callbacks().subscribe(this, function() {
                        var t = this;
                        runOrSignIn(function() { TradingView.bottomWidgetBar.toggleWidget("text_notes", !0), TradingView.bottomWidgetBar._widgets.text_notes.addNote(null, t.getSymbol(!0), t.getSymbol()) }, { source: "Add text note in chart context menu" })
                    })), g = new b({ text: $.t("Insert Study Template") }), v = new b({ shortcut: "Ctrl+Alt+Q", text: $.t("Reset Scale") }), v.callbacks().subscribe(null, function(t) { ft.model().resetTimeScale() }), y = new b({ text: $.t("Insert Drawing Tool"), subActions: mt }), T = new b({ text: $.t("Remove All Indicators") }), C = new b({ text: $.t("Remove All Drawing Tools") }), x = new b({ text: $.t("All Indicators And Drawing Tools") }), k = new b({ text: $.t("Insert Indicator..."), shortcut: "/" }), M = new b({ text: $.t("Script Editor...") }), D = new b({ text: $.t("Compare or Add Symbol...") }), O = new b({ text: $.t("Compare...") }), V = new b({ text: $.t("Objects Tree...") }), B = new b({ text: $.t("Properties..."), callback: function(t, e) { ft.showChartProperties() } }), R = new b({ text: $.t("Lock/Unlock") }), R.callbacks().subscribe(this, o.prototype.toggleLockSelectedObject), N = new b({ text: $.t("Hide") }), N.callbacks().subscribe(this, o.prototype.hideSelectedObject), f.enabled("property_pages") && (F = new b({ text: $.t("Format...") }), F.callbacks().subscribe(this, o.prototype.editSelectedObject)), W = new b({ text: $.t("Source Code...") }), W.callbacks().subscribe(this, this.openSelectedObjectSource), H = new b({ text: $.t("Left Axis"), checkable: !0 }), H.binder = new _t(H, this._properties.scalesProperties.showLeftScale, this.model(), $.t("Show Left Scale")), U = new b({ text: $.t("Right Axis"), checkable: !0 }), U.binder = new _t(U, this._properties.scalesProperties.showRightScale, this.model(), $.t("Show Right Scale")),
                    this._properties.scalesProperties.showLeftScale.listeners().subscribe(this, o.prototype._updateScalesActions), this._properties.scalesProperties.showRightScale.listeners().subscribe(this, o.prototype._updateScalesActions), j = new b({ text: $.t("Scale Price Chart Only"), checkable: !0 }), j.binder = new _t(j, this._properties.scalesProperties.scaleSeriesOnly, this.model(), $.t("Scale Price Chart Only")), q = this.model().model(), this._properties.scalesProperties.scaleSeriesOnly.listeners().subscribe(null, function() { q.recalculateAllPanes(), q.invalidate(new L(L.FULL_UPDATE)) }), Y = new b({ text: $.t("Drawings Toolbar"), checkable: !0 }), window.sideToolbar && (Y.binder = new _t(Y, window.sideToolbar.visible, this.model(), $.t("Drawings Toolbar"))), G = new b({ text: $.t("Favorite Drawings Toolbar"), checkable: !0 }), window.sideToolbar && window.sideToolbar.favoriteDrawingToolbar() && (K = window.sideToolbar.favoriteDrawingToolbar(), K.canBeShown().subscribe(function(t) { G.setEnabled(t) }, { callWithLast: !0 }), K.visibility().subscribe(function(t) { G.setChecked(t) }, { callWithLast: !0 }), G.callbacks().subscribe(null, function() { G.checked ? (K.show(), G.setChecked(K.isVisible())) : K.hide() })), X = new b({ text: $.t("Magnet Mode"), checkable: !0 }), X.binder = new _t(X, S.properties().magnet, this.model(), "Magnet"), Z = new b({ text: $.t("Stay In Drawing Mode"), checkable: !0 }), Z.binder = new _t(Z, S.properties().stayInDrawingMode, this.model(), $.t("Stay In Drawing Mode")), J = new b({ text: $.t("Sync drawings to all charts"), checkable: !0 }), J.binder = new _t(J, S.properties().drawOnAllCharts, this.model(), "SyncDrawings"), Q = new b({ text: $.t("Lock All Drawing Tools"), checkable: !0 }), Q.binder = new _t(Q, S.lockDrawings(), this.model(), $.t("Lock drawings"), function(t) { t || this.binder.setValue(!this.binder.value()), S.lockDrawings().setValue(this.binder.value()) }.bind(Q)), tt = new b({ text: $.t("Hide All Drawing Tools"), checkable: !0 }), tt.binder = new _t(tt, S.hideAllDrawings(), this.model(), $.t("Hide All Drawing Tools"), function(t) { t || this.binder.setValue(!this.binder.value()), S.hideAllDrawings().setValue(this.binder.value()) }.bind(tt)), et = new b({ text: $.t("Hide Marks On Bars"), checkable: !0 }), et.binder = new _t(et, S.hideMarksOnBars(), this.model(), $.t("Hide Marks On Bars"), function(t) { t || this.binder.setValue(!this.binder.value()), S.hideMarksOnBars().setValue(this.binder.value()) }.bind(et)), it = new b({ text: $.t("Extended Hours"), checkable: !0 }), it.binder = new _t(it, this.model().mainSeries().properties().extendedHours, this.model(), $.t("Change Extended Hours")), ot = new b({ text: $.t("Symbol Last Value"), checkable: !0, checked: !1 }), ot.binder = new _t(ot, this.properties().scalesProperties.showSeriesLastValue, this.model(), $.t("Show Symbol Last Value")), nt = new b({ text: $.t("Symbol Labels"), checkable: !0, checked: !1 }), nt.binding = new _t(nt, this.properties().scalesProperties.showSymbolLabels, this.model(), "Undo Show Symbol Labels"), st = new b({ text: $.t("Indicator Last Value"), checkable: !0, checked: !1 }), st.binder = new _t(st, this.properties().scalesProperties.showStudyLastValue, this.model(), $.t("Show Indicator Last Value")), rt = new b({
                        text: $.t("Indicator Labels"),
                        checkable: !0,
                        checked: !1
                    }), rt.binding = new _t(rt, this.properties().scalesProperties.showStudyPlotLabels, this.model(), "Undo Show Indicator Labels"), at = new b({ text: $.t("Countdown"), checkable: !0, checked: !1 }), at.binder = new _t(at, this.model().mainSeries().properties().showCountdown, this.model(), $.t("Show Countdown")), lt = new b({ text: $.t("Symbol Info..."), checkable: !1 }), lt.callbacks().subscribe(null, function() {
                        var t = ft.model().mainSeries().symbol(),
                            e = ft.model().mainSeries().symbolInfo();
                        P(t, { symbolInfo: e })
                    }), ft.onWidget() || (ht = new b({ text: $.t("Snapshot"), shortcut: "Alt+s" }), ht.callbacks().subscribe(null, function() { ft._chartWidgetCollection.takeScreenshot() }), ct = new b({ text: $.t("Switch to the next chart"), shortcut: "Tab" }), ct.callbacks().subscribe(null, function() { ft._chartWidgetCollection.switchChart() })), this._actions = { chartProperties: B, timeScaleReset: v, chartReset: r, compareOrAdd: D, compare: O, tmzProperties: e, paneObjectTree: V, insertIndicator: k, insertDrawingTool: y, applyColorTheme: c, applyStudyTemplate: g, symbolSearch: p, showSymbolInfoDialog: lt, changeInterval: u, seriesHide: N, studyHide: N, lineToggleLock: R, lineHide: N, showLeftAxis: H, showRightAxis: U, scaleSeriesOnly: j, drawingToolbarAction: Y, favoriteDrawingToolbar: G, magnetAction: X, stayInDrawingModeAction: Z, syncModeAction: J, lockDrawingsAction: Q, hideAllDrawingsAction: tt, hideAllMarks: et, applyTimeZone: d, extendedHours: it, showCountdown: at, showSeriesLastValue: ot, showSymbolLabelsAction: nt, showStudyLastValue: st, showStudyPlotNamesAction: rt, undo: a, redo: h, viewSourceCode: W, takeScreenshot: ht }, t && (this._actions.scalesProperties = t), e && (this._actions.tmzProperties = e), _ && (this._actions.addToWatchlist = _), !TradingView.onWidget() && f.enabled("text_notes") && (this._actions.addToTextNotes = m), f.enabled("charting_library_base") || (TradingView.onWidget() || (this._actions.gotoDate = gotoDateAction), this._actions.scriptEditor = M), this.createSessionBreaksActions(), this.readOnly() || (dt = new b({ text: $.t("Remove"), shortcut: "Del" }), dt.callbacks().subscribe(this, function() {
                            var t;
                            this._chartWidgetCollection && (t = this._chartWidgetCollection.activeChartWidget.value()), t || (t = this), t.removeSelectedSource()
                        }), pt = new b({ text: $.t("Stop syncing drawing") }), pt.callbacks().subscribe(this, function() {
                            var t;
                            this._chartWidgetCollection && (t = this._chartWidgetCollection.activeChartWidget.value()), t || (t = this), t.unlinkSelectedLine()
                        }), ut = new b({ text: $.t("Sync drawing to all charts") }), ut.callbacks().subscribe(this, function() {
                            var t;
                            this._chartWidgetCollection && (t = this._chartWidgetCollection.activeChartWidget.value()), t || (t = this), t.copyLineToOtherCharts()
                        }), this._actions.insertDrawingTool = y, this._actions.paneRemoveAllStudies = T, this._actions.paneRemoveAllDrawingTools = C, this._actions.paneRemoveAllStudiesDrawingTools = x, this._actions.seriesRemove = dt, this._actions.studyRemove = dt, this._actions.lineRemove = dt, this._actions.lineUnlink = pt, this._actions.lineCopyToCharts = ut, f.enabled("property_pages") && (this._actions.format = F), this._actions.lockDrawingsAction = Q, this._actions.hideAllDrawingsAction = tt, this._actions.hideAllMarks = et,
                        this._actions.paneRemoveAllStudies.callbacks().subscribe(this, o.prototype.removeAllStudies), this._actions.paneRemoveAllDrawingTools.callbacks().subscribe(this, o.prototype.removeAllDrawingTools), this._actions.paneRemoveAllStudiesDrawingTools.callbacks().subscribe(this, o.prototype.removeAllStudiesDrawingTools)), this._actions.paneObjectTree.callbacks().subscribe(this, o.prototype.showSourceProperties), this._actions.chartProperties.callbacks().subscribe(this, o.prototype.showChartProperties), this._actions.insertIndicator.callbacks().subscribe(this, o.prototype.showIndicators), this._actions.scriptEditor && this._actions.scriptEditor.callbacks().subscribe(this, o.prototype.showScriptEditor), this._actions.compareOrAdd.callbacks().subscribe(this, o.prototype.showCompareOrAdd), this._actions.compare.callbacks().subscribe(this, o.prototype.showCompareOrAdd), this._actions.scalesProperties && this._actions.scalesProperties.callbacks().subscribe(this, o.prototype.showScalesProperties), this._actions.tmzProperties && this._actions.tmzProperties.callbacks().subscribe(this, o.prototype.showTimezoneProperties), this._updateScalesActions()
            }, o.prototype.executeActionByName = function(t) {
                function e(t) {
                    var e, o;
                    for (e in i._actions)
                        if (o = i._actions[e], o.text.toLowerCase() === t.toLowerCase()) return o;
                    return null
                }
                var i = this,
                    o = e(t);
                if (!o) return void X.logWarn("Unknown action: " + t);
                o.callbacks().fire()
            }, o.prototype.executeActionById = function(t) {
                if (t in this._actions) {
                    var e = this._actions[t];
                    e.checkable && e.setChecked(!e.checked), this._actions[t].callbacks().fire(e)
                } else console.warn("Unknown action id: " + t)
            }, o.prototype.getCheckableActionState = function(t) {
                if (t in this._actions) {
                    var e = this._actions[t];
                    if (e.checkable) return e.checked;
                    console.warn("Action " + t + " has no state")
                } else console.warn("Unknown action id: " + t);
                return null
            }, o.prototype._updateScalesActions = function() {
                if (this._actions) {
                    for (var t = 0; t < this._paneWidgets.length; t++) this._paneWidgets[t].updateScalesVisibility();
                    this._timeAxisWidget.updatePriceScalesVisibility(), this._update(new L(L.FULL_UPDATE))
                }
            }, o.prototype.removeAllStudies = function() { this._model.removeAllStudies() }, o.prototype.removeAllDrawingTools = function() { this._model.removeAllDrawingTools() }, o.prototype.removeAllStudiesDrawingTools = function() { this._model.removeAllStudies(), this._model.removeAllDrawingTools() }, o.prototype.model = function() { return this._model }, o.prototype.defaultSymbol = function() { return this._defSymbol }, o.prototype.connect = function() { this._handler = function(t) { this._onData(t) }.bind(this), this._chartSession.connect(this._handler) }, o.prototype.finishInitWithoutConnect = function() { this._chartSession.disable(), this._init(), this.chartWidgetInitialized.fire() }, o.prototype.update = function() {
                if (this._model) {
                    for (var t = 0; t < this._paneWidgets.length; t++) this._paneWidgets[t].update();
                    this._timeAxisWidget.update()
                }
            }, o.prototype.paint = function(t) {
                t || (t = new L(L.FULL_UPDATE));
                for (var e = 0; e < this._paneWidgets.length; e++) this._paneWidgets[e].paint(t.invalidateForPane(e), !1);
                this._timeAxisWidget && this._timeAxisWidget.paint(t.fullInvalidation()),
                    this._redrawPanes.fire()
            }, o.prototype._makeDefaultGui = function() { this._makeChartWidget(), this._makeLoadingScreen(), this._makeMasterTable(), this._makeTimeAxisWidget(), this._adjustSize(), this._updateScalesActions(), $("*", this._jqMainTable).selectable(!1), this.update(), this.paint() }, o.prototype.widget = function() { return this._jqMainDiv }, o._linetoolWarningDialogShown = !1, o.prototype.restoreState = function(t, e) {
                var n, s;
                if (this._adjustSize(), n = this._model.restoreState(this._content, e), this._setActions(), n && n.lines_limit_exceeded && !this.readOnly()) {
                    if (o._linetoolWarningDialogShown) return;
                    s = B({ type: "modal", destroyOnClose: !0, width: 500, title: $.t("Warning"), content: $.t("This chart layout has more than 1000 drawings, which is a lot! This may negatively affect performance, storage and publishing. We recommend to remove some drawings to avoid potential performance issues."), actionsWrapTemplate: '<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--actions-adaptive tv-dialog__section--no-border">', actions: [{ name: "open-manage-drawings", type: "primary", text: $.t("Open Manage Drawings"), method: "close" }, { name: "not-now", type: "default", text: $.t("Not Now"), method: "close" }] }), s.on("action:open-manage-drawings", function() { i.e(0, function(t) { new(0, i(300).ObjectTreeDialog)({ chartWidget: this, activeTab: 1 }, this._model).show() }.bind(this)) }.bind(this)), o._linetoolWarningDialogShown = !0, s.on("afterClose", function() { o._linetoolWarningDialogShown = !1 }), s.open()
                }
            }, o.prototype.redrawPanes = function(t) {
                for (var e = 0; e < this._paneWidgets.length; e++) this._paneWidgets[e].paint();
                this._redrawPanes.fire()
            }, o.prototype.setBackgroundColor = function(t) {
                this.scaleBackgroundColor = t.value();
                for (var e = 0; e < this._paneWidgets.length; e++) this._paneWidgets[e].paint(), this._paneWidgets[e].setCursorForTool();
                this.update(), this.paint()
            }, o.prototype.setScaleLineColor = function(t) { this.scaleLineColor = t.value(), $.each(this._paneSeparators, function() { this.update() }), this.update(), this.paint() }, o.prototype.setScaleTextColor = function(t) { this.scaleTextColor = t.value(), this.update(), this.paint() }, o.prototype._update = function(t) {
                var e;
                if (this.performance && t.start(), t && t.fullInvalidation() !== L.FULL_UPDATE) {
                    if (t.fullInvalidation() === L.LIGHT_UPDATE) {
                        for (this._timeAxisWidget.update(), e = 0; e < this._paneWidgets.length; e++) this._paneWidgets[e].statusWidget().update();
                        this._dataWindowWidget && this._dataWindowWidget.update()
                    } else if (t.fullInvalidation() === L.UPDATE_CURSOR_ONLY) {
                        for (e = 0; e < this._paneWidgets.length; e++) this._paneWidgets[e].statusWidget().update();
                        this._dataWindowWidget && this._dataWindowWidget.update()
                    }
                } else {
                    for (this._model ? this._updateGui() : this._adjustSize(), this._timeAxisWidget.update(), e = 0; e < this._paneWidgets.length; e++) this._paneWidgets[e]._state = this._model.panes()[e], this._paneWidgets[e].statusWidget().updateLayout();
                    this._dataWindowWidget && this._dataWindowWidget.fullUpdate()
                }
                this.paint(t), this.performance && (t.end(), this.performance.newChartDraw(t))
            }, o.prototype._createVolumeIfNeeded = function() {
                var t = f.enabled("create_volume_indicator_by_default") && this._options.addVolume,
                    e = !this._content,
                    i = f.enabled("charting_library_base"),
                    o = f.enabled("create_volume_indicator_by_default_once"),
                    n = this._content && !this._content.loading;
                t && (e || i && n && !o) && this._model.mainSeries().onSymbolResolved().subscribe(this, function() {
                    var t = this;
                    setTimeout(function() {
                        var e, i, o, n, s = t._model.model().mainSeries().symbolInfo();
                        s && (e = !s.has_no_volume, !t.containsVolume() && e ? (i = TradingView.factoryDefaults("chartproperties.volumePaneSize"), o = { paneSize: i }, f.enabled("hide_volume_ma") && (o.styles = { vol_ma: { visible: !1 } }), t.insertStudy("Volume@tv-basicstudies", !1, f.enabled("volume_force_overlay"), void 0, o)) : !e && t.containsVolume() && (n = t.model().dataSources().filter(function(t) { return t instanceof m && "Volume" === t.metaInfo().shortId })[0], t._model.model().removeSource(n)))
                    }, 0)
                }, o)
            }, o.prototype._restartModel = function() { this._model.restart() }, o.prototype._makeDefaultModel = function() {
                function t() {
                    return h(l._chartSession, function(t) {
                        if (!(t instanceof L)) throw Error("Invalid mask");
                        l._invalidateMask ? l._invalidateMask.merge(t) : l._invalidateMask = t, l._draw_planned || (l._draw_planned = !0, requestAnimationFrame(e))
                    }, l._properties, l.readOnly(), n, l._studiesMetaData, l._studiesMigrations, l)
                }

                function e() { l._draw_planned = !1, l._inLoadingState || l._invalidateMask && (l._invalidateMask = l._update(l._invalidateMask)) }
                var i, n, s, r, a, l = this;
                if (this._content && this._content.timeScale.points && (i = this._content.timeScale.points.items[0], n = { startDate: i }), !this._studiesMetaData) throw Error("Cannot create chart model: studies metainfo is absent");
                if (f.enabled("lean_chart_load") ? this._model = this._model || t() : this._model = t(), this._createVolumeIfNeeded(), s = function() {
                        this._model.onTagsChanged().subscribe(this, o.prototype.onModelTagsChanged), this._updateGui(), this._modelCreated.fire(this._model), this._tagsChanged.fire();
                        var t = this._model.mainSeries();
                        this._defTimeframe && t.setDefaultTimeframe(this._defTimeframe), this._model.lineCancelled().subscribe(this, this.onLineCancelled), t.onSymbolNotPermitted().subscribe(null, function(e) { t.properties().symbol.setValue(e) }), t.properties().style.unsubscribe(this, this._onChartStyleChanged), t.properties().style.subscribe(this, this._onChartStyleChanged), this._options.handleSessionErrors && (t.chartTypeNotPermitted.subscribe(null, function() { t.properties().interval.setValue("D"), l._options.muteSessionErrors || isOpenedGoProDialog() || (trackGoProFeature("kagiRenko"), goProDialog({ feature: "kagiRenko" }).open()) }), t.intradaySpreadNotPermitted.subscribe(null, function() { t.properties().interval.setValue("D"), l._options.muteSessionErrors || isOpenedGoProDialog() || goProDialog({ feature: "intradaySpread" }).open() }), t.customIntervalNotPermitted.subscribe(null, function() { t.properties().interval.setValue("D"), l._options.muteSessionErrors || isOpenedGoProDialog() || goProDialog({ feature: "customIntervals" }).open() }), t.intradayExchangeNotPermitted.subscribe(null, function() {
                            if (t.properties().interval.setValue("D"), !l._options.muteSessionErrors && !isOpenedGoProDialog()) {
                                t.symbolInfo().listed_exchange;
                                goProDialog({ feature: "intradayExchange" }).open()
                            }
                        }), t.requestingIntradayWhenNotSupported.subscribe(null, function() { t.properties().interval.setValue("D"), l._options.muteSessionErrors || TVDialogs.showIntervalMismatchDialog() }), t.requestingResolutionWhenNotSupported.subscribe(null, function(e) { t.properties().interval.setValue(e) }), l._options.muteSessionErrors || t.onExtendedHoursNotPermitted().subscribe(null, function() { isOpenedGoProDialog() || (trackGoProFeature("extendedHours"), goProDialog({ feature: "extendedHours" }).open()) }))
                    }.bind(this), this._content) { if (this.restoreState(this._content, this._containsData), f.enabled("chart_content_overrides_by_defaults")) return this._defSymbol && (r = this.setSymbol(this._defSymbol), this.applyAutoScaleOnNewSymbol()), a = function() { return this._defInterval && this.setResolution(this._defInterval), void 0 !== this._defStyle && this.setSeriesStyle(this._model.mainSeries(), this._defStyle), s() }.bind(this), void 0 === r ? a() : r.then(a) } else this._setActions();
                return s()
            }, o.prototype._onChartStyleChanged = function() { z("Chart", "Chart Style " + this._model.mainSeries().getStyleShortName().toUpperCase()) }, o.prototype._updateGui = function() { this._model && (this._makePaneWidgetsAndSeparators(), this._makeTimeAxisWidget(), $("*", this._jqMainTable).selectable(!1), this._adjustSize()) }, o.prototype.setVisibleTimeRange = function(t, e, i) { this._chartSession.setVisibleTimeRange(this._model.mainSeries(), t, e, i) }, o.prototype._dateRangeResolutions = function() { return ChartApiInstance.availableTimeFrames(this._model.mainSeries().symbolInfo(), this._model.mainSeries().status()) || [] }, o.prototype._makeChartWidget = function() { this._jqMainDiv = $(document.createElement("div")), this._jqMainDiv.addClass("chart-widget"), this._updateAbsoluteRect(), this._withDateRanges && (!f.enabled("lean_chart_load") || !this._chartControlsBar) && (this._chartControlsBar = $(document.createElement("div")).attr("class", "chart-controls-bar").appendTo(this._jqParent), this._seriesControlWidget = new x({ parent: this._chartControlsBar, chartWidget: this })), (this._options.controlBar || f.enabled("control_bar")) && (this._controlBarNavigation = new C(this, this._jqMainDiv, !0)), this._containsData || this.createIndicatorImage() }, o.prototype.navigationButtonsController = function() { return this._navigationButtonsController || (this._navigationButtonsController = new _(this)), this._navigationButtonsController }, o.prototype._makeLoadingScreen = function() {
                if (f.enabled("lean_chart_load")) {
                    if (this.screen) return;
                    this.screen = new o.LoadingScreen(this, this._jqParent)
                } else this.screen = new o.LoadingScreen(this, this._jqMainDiv)
            }, o.prototype._setSymbol = function(t, e) {
                if (this._model) {
                    var i = this._model.mainSeries();
                    if (!e && i.symbolSameAsCurrent(t) && !f.enabled("same_data_requery")) return;
                    this._model.setSelectedSource(null), this._model.setScreenChartProperty(i.properties().symbol, t, this, "Change Symbol", f.enabled("same_data_requery"))
                } else this._properties.mainSeriesProperties.merge({ symbol: t })
            }, o.prototype.setSymbol = function(t, e) { return this._setSymbol.apply(this, arguments) },
            o.prototype.getSymbol = function(t) { var e; return e = this._model ? this._model.mainSeries().properties() : this._properties.mainSeriesProperties, e ? t && e.shortName && e.shortName.value() ? e.shortName.value() : e.symbol.value() : "" }, o.LoadingScreen = function(t, e) { this._cw = t, this.$element = $('<div class="chart-loading-screen">'), this.$shield = $('<div class="chart-loading-screen-shield">').appendTo(this.$element), this.$element.appendTo(e), this._showed = !1, this._cw.withModel(this, this._connectToModel) }, o.LoadingScreen.prototype._connectToModel = function() {
                this._cw.model().mainSeries().onDataLoaded().subscribe(this, function(t) {
                    switch (t.method) {
                        case "symbol_error":
                            t.params[1] !== u.PERMISSION_DENIED && this.hide();
                            break;
                        case "series_error":
                            f.enabled("hide_loading_screen_on_series_error") && this.hide();
                            break;
                        case "series_completed":
                            this.hide()
                    }
                })
            }, o.LoadingScreen.prototype.show = function() { return this._cw._inLoadingState = !0, this._showed || this._cw.isDetached || (this._showed = !0, this._show()), $.Deferred().resolve() }, o.LoadingScreen.prototype._show = function() {
                var t = this._cw.properties().paneProperties.background.value();
                this.$shield.css("background", t), this.$element.addClass("fade")
            }, o.LoadingScreen.prototype.hide = function() { delete this._cw._inLoadingState, this._showed && this._hide() }, o.LoadingScreen.prototype._hide = function() { this._showed = !1, this.$element.removeClass("fade") }, o.LoadingScreen.prototype.$canvas = null, o.LoadingScreen.prototype.context = null, o.prototype._makeMasterTable = function() { this._jqMainTable = $(document.createElement("table")), this._jqMainTable.appendTo(this._jqMainDiv), this._jqMainTable.addClass("chart-markup-table"), this._jqMainTable.attr("cellpading", "0"), this._jqMainTable.attr("cellspacing", "0") }, o.prototype.unsetActivePaneWidget = function() { this.activePaneWidget = !1 }, o.prototype.setActivePaneWidget = function(t) { this.activePaneWidget = t }, o.prototype.isMaximizedPane = function() { return !!this._maximizedPaneWidget }, o.prototype.toggleMaximizePane = function(t) {
                if (!(this._paneWidgets.length < 2)) {
                    this._maximizedPaneWidget ? (this._maximizedPaneWidget.state().setMaximized(!1), this._maximizedPaneWidget = null, this._paneSeparators.forEach(function(t) { t.show() })) : (this._maximizedPaneWidget = t, this._maximizedPaneWidget.state().setMaximized(!0), this._paneSeparators.forEach(function(t) { t.hide() }));
                    for (var e = this._paneWidgets.length; e--;) this._paneWidgets[e].updateControls();
                    this._adjustSize(), this.updateIndicatorImagePosition()
                }
            }, o.prototype._makePaneWidgetsAndSeparators = function() {
                var t, e, i, o, n = this._model.panes(),
                    s = n.length,
                    l = this._paneWidgets.length;
                for (t = s; t < l; t++) e = this._paneWidgets.pop(), e.jqRow.remove(), e.jqRow.find("*").remove(), e.destroy(), (i = this._paneSeparators.pop()) && i.jqRow.remove();
                for (t = l; t < s; t++) e = new r(this, n[t], this._onWidget, this._options.verticalTouchScroll), e.onMouseLeave = this.unsetActivePaneWidget.bind(this), e.onMouseEnter = this.setActivePaneWidget.bind(this), this._paneWidgets.push(e), t > 0 && (i = new a(this, t - 1, t), this._paneSeparators.push(i),
                    this._timeAxisWidget ? i.jqRow.insertBefore(this._timeAxisWidget.jqRow) : i.jqRow.appendTo(this._jqMainTable)), this._timeAxisWidget ? e.jqRow.insertBefore(this._timeAxisWidget.jqRow) : e.jqRow.appendTo(this._jqMainTable);
                for (t = 0; t < s; t++) o = n[t], e = this._paneWidgets[t], e.state() !== o && e.setState(o);
                for (t = s; t--;) this._paneWidgets[t].updateControls()
            }, o.prototype._makeTimeAxisWidget = function() { this._timeAxisWidget || (this._timeAxisWidget = new d(this, this._onWidget), this._timeAxisWidget.jqRow.appendTo(this._jqMainTable)) }, o.prototype.insertStudyOrShowDialog = function(t, e) {
                var i, o, n, s, r, a, l, h;
                this.isSymbolicStudy(t) ? (i = defaults("study_" + t.id).description, o = $('<input type="text" class="symbol-edit single" placeholder="' + $.t("Symbol") + '" maxlength="30" style="text-transform: none; font-weight: normal;" autocomplete="off">'), o.css({ float: "none", "box-sizing": "border-box", width: "100%" }), n = null, s = B({ title: i || $.t("Add Symbol"), width: 400, actions: [{ name: "apply", text: $.t("Apply"), type: "primary" }], content: o, isClickOutFn: function(t) { if (n && (t.target === n[0] || n[0].contains(t.target))) return !1 } }), r = function(i) {
                    var o = { inputs: { symbol: i } };
                    this.model().insertStudy(t, o, !1, e), s.close()
                }, a = E.bindToInput(o, { callback: r.bind(this), onPopupOpen: function(t) { t.css("z-index", s.zIndex), n = t }, onPopupClose: function() { n = null } }), s.on("action:apply", function() { a.acceptTypeIn() }), s.open()) : this.hasConfirmInputs(t) ? (i = defaults("study_" + t.id).description, q.show(this, t, { title: i, callback: function(i) { this.model().insertStudy(t, i, !1, e) }.bind(this) })) : m.isPointsBasedStudy(t.id) ? (l = m.lineToolNameForPointsBasedStudy(t.id), S.tool.setValue(l)) : (h = "Volume@tv-basicstudies" === t.id, this.insertStudy(t.id, !0, h, null, null, e))
            }, o.prototype.hasConfirmInputs = function(t) {
                var e, i, o = t.inputs;
                if (void 0 === o) return !1;
                for (e = 0; e < o.length; ++e)
                    if (i = o[e], void 0 !== i.confirm && i.confirm) return !0;
                return !1
            }, o.prototype.isSymbolicStudy = function(t) {
                switch (t.id) {
                    case "Overlay@tv-basicstudies":
                    case "CorrelationCoefficient@tv-basicstudies":
                        return !0;
                    default:
                        return !1
                }
            }, o.prototype.isPointsBasedStudy = function(t) { return m.isPointsBasedStudy(t.id) }, o.prototype.insertStudy = function(t, e, i, o, n, s) {
                var r, a = N.findStudyMetaInfo(this._studiesMetaData, t);
                a = TradingView.clone(a), W(!a.isTVScriptStubToCompile, "MetaInfo stub is unexpected here!"), r = o ? { inputs: o } : {}, n && (r = $.extend(r, n)), e ? this._model.insertStudy(a, r, i, s) : this._model.model().insertStudy(a, r, i, s)
            }, o.prototype.insertStudyStub = function(t) { return this.model().insertStudyStub(t) }, o.prototype.removeStudyStub = function(t) { return this.model().removeStudyStub(t) }, o.prototype._adjustSize = function() {
                var t, e, i, o, n, s, r, l = this,
                    h = 0,
                    d = 0,
                    p = 0;
                $.each(this._paneWidgets, function() { l._maximizedPaneWidget && l._maximizedPaneWidget !== this || (h = Math.max(this.lhsPriceAxisWidget.optimalWidth(), h), d = Math.max(this.rhsPriceAxisWidget.optimalWidth(), d), p += this.stretchFactor()) }), t = this._rect, e = t.w - h - d, i = this._paneSeparators.length, o = a.HEIGHT, n = this._timeAxisWidget.optimalHeight(), s = t.h - o * i - n, r = s / p, this._jqMainTable.width(t.w), this._jqMainTable.height(t.h), $.each(this._paneWidgets, function(t) {
                    l._model && (this._state = l._model.panes()[t]);
                    var i = l._maximizedPaneWidget ? l._maximizedPaneWidget === this ? s : 0 : Math.max(Math.round(this.stretchFactor() * r), 2);
                    this.setPriceAxisSize(c.LHS, new j(h, i)), this.setPriceAxisSize(c.RHS, new j(d, i)), this.setSize(new j(e, i)), l._model && this.state() && l._model.setPaneHeight(this.state(), i)
                }), this._timeAxisWidget.setSize(new j(e, n), new j(h, n), new j(d, n)), this._model && this._model.setWidth(e), this.maxLhsPriceAxisWidth !== h && (this.maxLhsPriceAxisWidth = h, this.lhsPriceAxisWidthChanged.fire(h)), this.maxRhsPriceAxisWidth !== d && (this.maxRhsPriceAxisWidth = d, this.rhsPriceAxisWidthChanged.fire(d))
            }, o.prototype._onData = function(t) {
                switch (t.method) {
                    case "connected":
                        this._onConnection();
                        break;
                    case "disconnected":
                        this._onDisconnect();
                        break;
                    case "reconnect_bailout":
                        this._reconnectBailout.fire();
                        break;
                    case "connection_error":
                        this._onConnectionError(t.params[0]);
                        break;
                    case "critical_error":
                        this._disconnected.fire(!0);
                        break;
                    default:
                        this._model.onData(t)
                }
            }, o.prototype._nextMetadataId = 1, o.prototype._onConnection = function() { this._online = !0, this._model ? (this._restartModel(), this._updateGui(), this.update(), this.paint(), this._connected.fire()) : this.requestMetadata() }, o.prototype._onDisconnect = function() { this._model && this._model.disconnect(), this._online = !1, this.update(), this.paint(), this._disconnected.fire() }, o.prototype.requestMetadata = function() {
                f.enabled("charting_library_base") && this._chartSession.requestMetadata("metadata_" + o._nextMetadataId, function(t) {
                    var e, i = t.params[1];
                    for (e = 0; e < i.length; ++e) N.addOrReplaceStudyMetaInfo(this._studiesMetaData, s(i[e]));
                    this._inited || (this._init(), this.chartWidgetInitialized.fire())
                }.bind(this)), o._nextMetadataId++
            }, o.prototype.studiesMetaData = function() { return this._model.studiesMetaData() }, o.prototype._onConnectionError = function(t) { this._disconnected.fire() }, o.prototype.getTimeScale = function() { return this._timeAxisWidget }, o.prototype.setSeriesStyle = function(t, e) { this._model.setProperty(t.properties().style, e) }, o.prototype.showSourceProperties = function(t) {
                var e = this;
                i.e(0, function(t) { new(0, i(300).ObjectTreeDialog)({ chartWidget: e }, e._model).show() })
            }, o.prototype.showEditObjectDialog = function(t, e, o, n) {
                return new Promise(function(s) {
                    ! function(r) {
                        var a = i(76),
                            l = new a(t, e, n);
                        l.show(o), s(l)
                    }()
                }, "editobjectdialog")
            }, o.prototype.showChartProperties = function(t) {
                if (!f.enabled("show_chart_property_page")) return Promise.resolve();
                t && t.text === $.t("Properties...") && TVSettings.setValue("properties_dialog.active_tab.chart", $.t("Style"));
                var e = this;
                return new Promise(function(t) { e.showEditObjectDialog(e._model.mainSeries(), e._model, { doNotCloseOnBgClick: !0 }).then(function(e) { t(e._dialog) }) })
            }, o.prototype.showScriptEditor = function() { TradingView.ScriptEditorWidget.open() }, o.prototype.showCompareOrAdd = function() { new k(this._chartWidgetCollection).show() }, o.prototype.showIndicators = function(t) { if (window.studyMarket) return window.studyMarket.isVisible() ? void window.studyMarket.hide() : (window.studyMarket.show(t), window.studyMarket) }, o.prototype.showScalesProperties = function(t) {
                this.showEditObjectDialog(this._model.mainSeries(), this._model, { selectScales: !0 })
            }, o.prototype.showTimezoneProperties = function() { this.showEditObjectDialog(this._model.mainSeries(), this._model, { selectTmz: !0 }) }, o.prototype.removeSelectedSource = function() {
                var t, e = this,
                    i = e._model.selectedSource();
                !i || i === e._model.mainSeries() || i === e._model.lineBeingCreated() || i instanceof p || (i.hasAlert.value() && i.isUserDeletable() ? (t = Y({ type: "modal", content: $.t("This drawing is used in alert. If you remove the drawing, the alert will be also removed. Do you want to remove the drawing anyway?") }), t.on("action:yes", function(t) { e._model.removeSelectedSource(), t.close() }), t.open()) : i instanceof m && i.hasChildren() ? showDeleteStudyTreeConfirm(e._model.removeSelectedSource.bind(e._model)).open() : e._model.removeSelectedSource())
            }, o.prototype.unlinkSelectedLine = function() {
                var t = this._model.selectedSource();
                t instanceof v && this._model.unlinkLine(t)
            }, o.prototype.copyLineToOtherCharts = function() {
                var t = this._model.selectedSource();
                t instanceof v && this._model.copyToOtherCharts(t)
            }, o.prototype.hideSelectedObject = function() {
                var t = this._model.selectedSource();
                t && this._model.setProperty(t.properties().visible, !1, "Hide " + t.title())
            }, o.prototype.toggleLockSelectedObject = function() {
                var t, e = this._model.selectedSource();
                e && (t = e.properties().frozen.value(), this._model.setProperty(e.properties().frozen, !t, (t ? $.t("Unlock") : $.t("Lock")) + " " + e.title()))
            }, o.prototype.editSelectedObject = function(t) {
                var e = this._model.selectedSource();
                e && this.showEditObjectDialog(e, this._model)
            }, o.prototype.openSelectedObjectSource = function(t) {
                var e, i = this._model.selectedSource();
                i && i.metaInfo && (e = i.metaInfo()) && e.scriptIdPart && e.pine && TradingView.ScriptEditorWidget
            }, o.prototype.resetPriceAxisOptimalWidth = function(t) { $.each(this._paneWidgets, function() { this.resetPriceAxisOptimalWidth(t) }), this._redrawPanes.fire() }, o.prototype.adjustPriceAxisWidth = function(t) { this.resetPriceAxisOptimalWidth(t), this._adjustSize() }, o.prototype.setPriceAxisVisible = function(t, e) { $.each(this._paneWidgets, function() { this.setPriceAxisVisible(t, e) }), this._timeAxisWidget.setStubVisible(t, e), this._adjustSize(), this._redrawPanes.fire() }, o.prototype.setTimeAxisVisible = function(t) { this._timeAxisWidget.setVisible(t), this._adjustSize() }, o.prototype.isTextTool = function(t) {
                switch (t) {
                    case "LineToolBalloon":
                    case "LineToolText":
                    case "LineToolTextAbsolute":
                    case "LineToolCallout":
                    case "LineToolNote":
                    case "LineToolNoteAbsolute":
                        return !0
                }
                return !1
            }, o.prototype.tags = function() { return this._model ? this._model.calculateDefaultTags() : [] }, o.prototype.state = function(t, e) { return this._model.state(t, e) }, o.prototype.asyncState = function(t) { return this._model.asyncState(t) }, o.prototype.metaInfo = function() { var t = this._metaInfo; return this._model && (t.systemTags = this._model.calculateDefaultTags()), t }, o.prototype.image = function() {
                var t, e, i, o, n, s, r, a, l = document.createElement("canvas"),
                    h = l.getContext("2d"),
                    c = 0,
                    d = this._timeAxisWidget.size.h,
                    p = this.properties().scalesProperties.lineColor.value();
                for (e = 0; e < this._paneWidgets.length; e++)(t = this._paneWidgets[e]) && t.state() && (t.state().recalculate(!0), 0 === e && (c = t.lhsPriceAxisWidget.size.w + t.size.w + t.rhsPriceAxisWidget.size.w), d += t.size.h);
                for (d += this._paneWidgets.length - 1, this._update(), i = 25, o = 5, l.width = c + 2 * o, l.height = d + i + 2 * o, h.fillStyle = "#F2F5F8", h.fillRect(0, 0, l.width, l.height), n = i + o, s = o, r = this.mainSeriesQuotesAndMetainfo(), r.ohlc && (a = "{0} O:{1} H:{2} L:{3} C:{4}".format(r.meta.symbol, r.ohlc[0], r.ohlc[1], r.ohlc[2], r.ohlc[3]), h.fillStyle = "#000", h.font = "12px Verdana, Arial", h.fillText(a, s, o + 15)), e = 0; e < this._paneWidgets.length; e++) t = this._paneWidgets[e], h.drawImage(t.lhsPriceAxisWidget.canvas, s, n), h.drawImage(t.canvas, s + t.lhsPriceAxisWidget.size.w, n), t.statusWidget().renderTo(h, s + 5, n + 5), h.drawImage(t.rhsPriceAxisWidget.canvas, s + t.lhsPriceAxisWidget.size.w + t.size.w, n), n += t.size.h, e < this._paneWidgets.length - 1 && (h.fillStyle = p, h.fillRect(s, n, c, 1), n++);
                return h.drawImage(this._timeAxisWidget.lhsCanvas, s, n), h.drawImage(this._timeAxisWidget.canvas, s + t.lhsPriceAxisWidget.size.w, n), h.drawImage(this._timeAxisWidget.rhsCanvas, s + t.lhsPriceAxisWidget.size.w + t.size.w, n), h.lineWidth = 1, h.strokeStyle = "#000", h.strokeRect(o + .5, i + o + .5, c - 1, d - 1), l
            }, o.prototype.images = function() {
                function t(t) { var e, o, n, s, r; for (t.paint(L.LIGHT_UPDATE, i._onWidget), e = t.image(i._onWidget), e.containsMainSeries = t.containsMainSeries(), e.studies = [], o = t.state().dataSources(), n = 0; n < o.length; n++) s = o[n], r = i.properties().paneProperties.legendProperties, s instanceof m ? s.properties().visible.value() && s.statusView() && r.showStudyTitles.value() && r.showLegend.value() && e.studies.push(s.statusView().text()) : s instanceof u && r.showLegend.value() && r.showSeriesTitle.value() && (e.mainSeriesText = s.statusView().text()); return e }
                var e, i, o, n, s, r, a;
                if (TradingView.printing = !0, e = this._model.selectedSource(), this._model.setSelectedSource(null), i = this, o = [], this.isMaximizedPane()) o.push(t(this._maximizedPaneWidget));
                else
                    for (n = 0; n < this._paneWidgets.length; n++) s = this._paneWidgets[n], o.push(t(s)), n < this._paneWidgets.length - 1 && o.push(this._paneSeparators[n].image());
                return this._timeAxisWidget.paint(L.LIGHT_UPDATE), r = this._timeAxisWidget.image(), TradingView.printing = !1, this._model.setSelectedSource(e), this._model.invalidate(new L(L.LIGHT_UPDATE)), a = this.mainSeriesQuotesAndMetainfo(), { panes: o, timeAxis: r, colors: { text: this.properties().scalesProperties.textColor.value(), bg: this.properties().paneProperties.background.value(), scales: this.properties().scalesProperties.lineColor.value() }, meta: a.meta, ohlc: a.ohlc, quotes: a.quotes }
            }, o.prototype.mainSeriesQuotesAndMetainfo = function() {
                var t, e, i, o, n, s, r, a = this._model.mainSeries();
                return a && (o = function(t) { return null == t ? "" : a.formatter().format(t) + "" }, n = function(t) { return null == t ? "" : t + "" }, t = { resolution: a.interval(), symbol: a.symbol() }, s = a.symbolInfo(), s && (t.symbol = s.full_name, t.description = s.description, t.exchange = s.exchange), r = a.bars().last(), r && (e = r.value.slice(1, 5).map(o)), a.quoteData && (i = { change: o(a.quoteData.change), changePercent: n(a.quoteData.change_percent), last: o(a.quoteData.last_price) })), {
                    meta: t,
                    ohlc: e,
                    quotes: i
                }
            }, o.prototype.onTagsChanged = function() { return this._tagsChanged }, o.prototype.onModelTagsChanged = function() { this._tagsChanged.fire() }, o.prototype.destroy = function() { $(window).unbind("resize", this._resizeHandler), this._model.model().destroy(), this.performance && this.performance.destroy(), this._chartSession.destroy() }, o.prototype.title = function() { return $.t("Chart Properties") }, o.prototype.symbolProperty = function() { return this._model.mainSeries().properties().shortName ? this._model.mainSeries().properties().shortName : this._model.mainSeries().properties().symbol }, o.prototype.loadContent = function(t, e) {
                var i, o, n, s, r, a;
                for (this.screen.show(), i = this, this.isMaximizedPane() && this.toggleMaximizePane(), o = i._model.model().dataSources(), n = 0; n < o.length; n++)(s = o[n]) !== i._model.mainSeries() && i._model.model().removeSource(s, !0);
                for (i._jqMainDiv && (i._jqMainDiv.remove(), i._jqMainDiv = null), i._timeAxisWidget = null, i._paneWidgets = [], i.activePaneWidget = !1, i._model.mainSeries().purgeSymbolInfo(), t.loading = !0, i._setContent(t), n = 0; n < t.panes.length; ++n)
                    for (a = 0; a < t.panes[n].sources.length; ++a)
                        if (t.panes[n].sources[a].state.symbol) { r = t.panes[n].sources[a].state; break }
                if (!r) throw Error("An error occured while determining main series ion the chart");
                i._properties.mainSeriesProperties.merge({ visible: !0, symbol: r.symbol, timeframe: "", onWidget: i._onWidget, interval: r.interval || "D", style: r.style }), i._init(), I.interval.setValue(r.interval), l.clearStack(), i.updateSeriesControlUI()
            }, o.prototype._setContent = function(t) {
                t && t.panes.forEach(function(t) {
                    t.sources = t.sources.filter(function(t) { return !!t && ("MainSeries" === t.type || (!t.points || !t.points.some(function(t) { return null === t.time_t || !isFinite(t.time_t) }) || (X.logNormal("Dropped invalid " + t.type + ". Reason: non-numeric point time"), !1))) });
                    var e = function(e) { return t.sources && t.sources.some(function(t) { return t.id === e }) };
                    t.leftAxisSources && (t.leftAxisSources = t.leftAxisSources.filter(e)), t.rightAxisSources && (t.rightAxisSources = t.rightAxisSources.filter(e))
                }), this._content = t
            }, o.prototype._contentSeriesProperties = function() {
                var t, e, i;
                if (this._content)
                    for (t = this._content.panes.length; t-- > 0;)
                        for (e = this._content.panes[t].sources, i = e.length; i-- > 0;)
                            if ("MainSeries" === e[i].type) return e[i].state
            }, o.prototype.updateSeriesControlUI = function() { this._seriesControlWidget && this._seriesControlWidget.updateUI() }, o.prototype.tickSeriesControlClock = function() { this._seriesControlWidget && this._seriesControlWidget.tickClock() }, o.prototype.resizeSeriesControlUI = function() { this._seriesControlWidget && this._seriesControlWidget.resizeUI() }, o.prototype.updateUndoRedo = function() { l.undoStack().isEmpty() ? this.actions().undo.setEnabled(!1) : this.actions().undo.setEnabled(!0), l.redoStack().isEmpty() ? this.actions().redo.setEnabled(!1) : this.actions().redo.setEnabled(!0) }, o.prototype.createSessionBreaksActions = function(t) {
                var e, o = i(5).ActionBinder,
                    n = this,
                    s = function() {
                        e = new b({ text: $.t("Session Breaks"), checkable: !0 }),
                            e.binder = new o(e, n.model().mainSeries().sessionsStudy().properties().graphics.vertlines.sessBreaks.visible, n.model(), "Session Breaks"), n._actions.sessionBreaks = e
                    };
                n.model().mainSeries().sessionsStudy() ? s() : n.model().mainSeries().onSessionsStudyCreated().subscribe(n, function() { s() })
            }, o.prototype.updateActionForIntradayOnly = function(t) {!t || !t instanceof b || t.setEnabled(!!this.model().mainSeries().isIntradayInterval()) }, o.prototype.withModel = function(t, e) { this.model() ? e.call(t) : this.modelCreated().subscribe(t, e, !0) }, o.prototype.containsVolume = function() { return this.model().dataSources().some(function(t) { return t instanceof m && "Volume" === t.metaInfo().shortId }) }, o.prototype.containsStudyByPredicate = function(t) { return !!this._model && this._model.dataSources().some(function(e) { if (!(e instanceof m)) return !1; var i = e.metaInfo(); return t(i) }) }, o.prototype.containsStudy = function(t) { return this.containsStudyByPredicate(function(e) { return e.id === t || e.fullId === t }) }, o.prototype.containsSessions = function() { return this.model().dataSources().some(function(t) { return t instanceof m && "Sessions" === t.metaInfo().shortId }) }, o.prototype.isSmall = function(t) { return this.constructor.isSmall(this._jqParent) }, o.isSmall = function(t) { return t.width() < 550 || t.height() < 300 }, o.prototype.onWidget = function() { return this._onWidget }, o.prototype.onCmeWidget = function() { return "cme" === this.widgetCustomer() }, o.prototype.widgetCustomer = function() { return this._widgetCustomer }, o.prototype.resize = function() { this._resizeHandler && this._jqMainDiv && this._resizeHandler() }, o.prototype.chartSession = function() { return this._chartSession }, o.prototype.maxLhsPriceAxisWidth = 0, o.prototype.maxRhsPriceAxisWidth = 0, o.prototype.GUIResetScales = function() { z("GUI", "Reset Scales"), this.model() && (this._containsData && this.model().chartModel().restoreAxisState(this._content), this.model().resetScales()) }, o.prototype.onLineCancelled = function() { S.resetToCursor() }, o.prototype.createIndicatorImage = function() {
                var t = this;
                this.indicatorImage = this._jqParent.find(".chart-status-picture"), 0 === this.indicatorImage.length ? this.indicatorImage = $('<span class="chart-status-picture"></span>').appendTo(this._jqParent) : this.indicatorImage.html(""), f.enabled("display_market_status") && (this.indicatorText = $('<span class="series-status-text apply-common-tooltip"><span class="js-market-status tv-market-status--series-status"></span></span>'), this.indicatorText.appendTo(this.indicatorImage), this.indicatorDot = new G({ el: this.indicatorText.find(".js-market-status")[0], classSuffix: "--for-chart" }), f.enabled("display_data_mode") && ($('<span class="js-data-mode tv-data-mode--series-status"></span>').appendTo(this.indicatorText), this.dataModeIndicator = new K({ el: this.indicatorText.find(".js-data-mode")[0], classSuffix: "--for-chart" }))), t.withModel(null, function() {
                    var e = t._model.mainSeries();
                    e.onStatusChanged().subscribe(null, t.updateIndicatorImage.bind(t)), e.marketStatus.subscribe(t.updateIndicatorImage.bind(t)), t.updateIndicatorImage(), t.checkCompactMode(), t._model.onRearrangePanes().subscribe(null, function() {
                        t.resetIndicatorSize(), t.resizeIndicator()
                    })
                }), t.rhsPriceAxisWidthChanged.subscribe(t, t.updateIndicatorImagePosition), t.updateIndicatorImagePosition()
            }, o.prototype.updateIndicatorImage = function() {
                var t, e, i, o = this,
                    n = this._model;
                n && (t = n.mainSeries(), e = t.status(), i = t.quoteData ? t.quoteData.update_mode_seconds : null, o._updateDataAndMarketStatus(t.marketStatus.value(), e, i))
            }, o.prototype.checkCompactMode = function() { this._jqMainDiv && this._jqMainDiv.toggleClass("i-compact", this._jqMainDiv.width() <= 400), this.indicatorImage && (this._indicatorWidth = this.indicatorImage.outerWidth()) }, o.prototype._statusDetails = function() { return this.__statusDetails || (this.__statusDetails = {}, this.__statusDetails[u.STATUS_SNAPSHOT] = { className: "snapshot", text: "", showBatsWarn: !1, priority: 1 }, this.__statusDetails[u.STATUS_LOADING] = this.__statusDetails[u.STATUS_RESOLVING] = { className: "loading", text: $.t("loading data"), priority: 100 }, this.__statusDetails[u.STATUS_INVALID_SYMBOL] = { className: "invalid", text: $.t("invalid symbol"), showBatsWarn: !1, priority: 50 }, this.__statusDetails[u.STATUS_NO_BARS] = { className: "invalid", text: $.t("instrument is not allowed"), showBatsWarn: !1, priority: 50 }, this.__statusDetails[u.STATUS_OFFLINE] = { className: "connecting", text: $.t("retrying"), priority: 1 }, this.__statusDetails[u.STATUS_EOD] = this.__statusDetails[u.STATUS_PULSE] = { className: "eod", text: $.t("eod"), priority: 1 }, this.__statusDetails[u.STATUS_DELAYED] = { className: "delayed", title: $.t("Quotes are delayed by 10 min and updated every 30 seconds"), text: $.t("eod delayed"), priority: 1 }, this.__statusDetails[u.STATUS_DELAYED_STREAMING] = { className: "delayed-streaming", text: $.t("delayed"), priority: 1 }, this.__statusDetails[u.STATUS_READY] = this.__statusDetails.defaults = { className: "open", text: $.t("open"), priority: -1 }, this.__statusDetails.pre_market = { text: $.t("pre-market"), className: "pre-market", priority: 0 }, this.__statusDetails.post_market = { text: $.t("post-market"), className: "post-market", priority: 0 }, this.__statusDetails.out_of_session = { text: $.t("closed"), className: "out-of-session", priority: 10 }, this.__statusDetails.market = this.__statusDetails.defaults), this.__statusDetails }, o.prototype._updateDataAndMarketStatus = function(t, e) {
                var i, o;
                if (void 0 !== this.indicatorText) {
                    switch (e) {
                        case u.STATUS_LOADING:
                        case u.STATUS_RESOLVING:
                            i = "loading", this.indicatorDot.setStatus("loading");
                            break;
                        case u.STATUS_INVALID_SYMBOL:
                            i = "invalid", this.indicatorDot.reset();
                            break;
                        case u.STATUS_NO_BARS:
                            i = "forbidden";
                            break;
                        case u.STATUS_DELAYED:
                            i = "delayed";
                            break;
                        case u.STATUS_DELAYED_STREAMING:
                            i = "delayed_streaming";
                            break;
                        case u.STATUS_EOD:
                        case u.STATUS_PULSE:
                            i = "endofday";
                            break;
                        case u.STATUS_OFFLINE:
                            i = "connecting";
                            break;
                        case u.STATUS_SNAPSHOT:
                            i = "snapshot";
                            break;
                        case u.STATUS_READY:
                            i = "realtime";
                            break;
                        default:
                            i = e, X.logWarn("unhandled data mode " + i)
                    }
                    f.enabled("display_data_mode") && this.dataModeIndicator.setMode(i), o = ["loading", "invalid"], !o.includes(i) && t ? this.indicatorDot.setStatus(t, !0) : "invalid" === i && this.indicatorDot.setStatus("invalid", !0), this.resizeIndicator()
                }
            }, o.prototype.resetIndicatorSize = function() {
                if (this._paneWidgets[0] && this._paneWidgets[0].legendWidget)
                    for (var t = 0; t < this._paneWidgets.length; t++) this._paneWidgets[t].legendWidget.firstTitle().css("padding-right", "")
            }, o.prototype.resizeIndicator = function() {
                var t, e, i;
                this._paneWidgets[0] && this._paneWidgets[0].legendWidget && this._indicatorWidth && this._paneWidgets[0].legendWidget.firstTitle().css("padding-right", this._indicatorWidth + 10), f.enabled("display_market_status") && f.enabled("display_data_mode") && this.indicatorDot && this.dataModeIndicator && (this.indicatorDot.isShortModeEnabled() && this.dataModeIndicator.isShortModeEnabled() ? (t = [this.indicatorDot.getTooltipText(), this.dataModeIndicator.getTooltipText()], t = t.filter(function(t) { return t }), e = t.join(", "), this.indicatorText.attr("title", e)) : this.indicatorText.attr("title", ""), this.indicatorText.trigger("common-tooltip-update")), this.indicatorImage && (this._indicatorWidth = this.indicatorImage.outerWidth()), i = this._rect.w, f.enabled("display_market_status") && this.indicatorDot && (i > 650 ? (this.indicatorDot.setTooltipEnabled(!1), this.indicatorDot.disableShortMode()) : i > 550 ? (this.indicatorDot.setTooltipEnabled(!1), this.indicatorDot.disableShortMode()) : (this.indicatorDot.setTooltipEnabled(!1), this.indicatorDot.enableShortMode())), f.enabled("display_data_mode") && this.dataModeIndicator && (i > 650 ? (this.dataModeIndicator.setTooltipEnabled(!1), this.dataModeIndicator.disableShortMode()) : i > 550 ? (this.dataModeIndicator.setTooltipEnabled(!0), this.dataModeIndicator.enableShortMode()) : (this.dataModeIndicator.setTooltipEnabled(!1), this.dataModeIndicator.enableShortMode()))
            }, o.prototype._resultingStatusRecord = function(t, e) { var i, o; return t ? (i = this._statusDetails()[t], o = this._statusDetails()[e], o || (o = this._statusDetails().defaults), o.priority > i.priority ? o : i) : this._statusDetails()[e] }, o.prototype.updateIndicatorImagePosition = function() {
                var t = this.indicatorImage;
                this.indicatorImage && t.css("marginRight", this.maxRhsPriceAxisWidth)
            }, o.prototype._startSpinner = function(t) {
                if (!this._spinner) {
                    var e = $(t).get(0);
                    e && (this._spinner = F("", { zIndex: "auto" }).spin(e))
                }
            }, o.prototype.isJustClonedChart = function() { return !!(this._options || {}).justCloned }, o.prototype.getLastPaneLeftBottom = function() {
                var t = this._paneWidgets[this._paneWidgets.length - 1].jqPane,
                    e = t.offset();
                return { left: e.left, bottom: $(document.body).height() - e.top - t.height() }
            }, o.prototype.setDataWindowWidget = function(t) { this._dataWindowWidget = t }, o.prototype.removeDataWindowWidget = function() { this._dataWindowWidget = null }, f.enabled("datasource_copypaste") && (o.prototype.onAppClipboardPaste = function(t, e) { X.logDebug("[[paste]]"), this._model && this._model.pasteSourceFromClip(t, e) }, o.prototype.onAppClipboardCopy = function(t) {
                if (t || (t = this._model.selectedSource()), t instanceof m && t.isChildStudy()) return void X.logDebug("Can not copy child study");
                X.logDebug("[[copy]]"), this._model && this._model.copySourceToClip(t)
            }, o.prototype.onAppClipboardCut = function(t) { X.logDebug("[[cut]]"), this._model && this._model.cutSourceToClip(t || this._model.selectedSource()) }), o.prototype.applyOverrides = function(t) {
                applyPropertiesOverrides(this.properties(), null, !1, t), this._model && (applyPropertiesOverrides(this._model.model().properties(), null, !1, t), applyPropertiesOverrides(this._model.mainSeries().properties(), null, !1, t, "mainSeriesProperties"))
            }, o.prototype.setActive = function(t) {
                var e, i = this.actions();
                for (e in i) i.hasOwnProperty(e) && this.actions()[e].setActive(t);
                this._isActive = t, this._paneWidgets.forEach(function(t) { t.update() })
            }, o.prototype.isActive = function() { return this._isActive }, o.prototype.trackTime = function() { return this._chartWidgetCollection.lock.trackTime }, o.prototype.id = function() { return this._guid }, o.prototype.createBranding = function() { this._modelCreated.subscribe(this, function() { this._model.model().createBrandingSource() }, !0) }, o.prototype._updateAbsoluteRect = function() { this._jqMainDiv.css("position", "absolute"), this._jqMainDiv.css("left", this._rect.x + "px"), this._jqMainDiv.css("top", this._rect.y + "px"), this._jqMainDiv.width(this._rect.w), this._jqMainDiv.height(this._rect.h) }, t.exports.ChartWidget = o
    }).call(e, i(15))
}, function(t, e) {
    "use strict";
    var i = function() {
        function t(t) {
            switch (t) {
                case "c67":
                case "m67":
                case "c45":
                    return "copy";
                case "c86":
                case "m86":
                case "s45":
                    return "paste";
                case "c88":
                case "m88":
                case "s46":
                    return "cut"
            }
        }

        function e(t) { var e = []; return t.shiftKey && e.push("s"), t.ctrlKey && e.push("c"), t.metaKey && e.push("m"), t.altKey && e.push("a"), e.push(t.keyCode), e.join("") }

        function i(t) { var e = $.Event(d + ":" + t); return $(window).trigger(e, { AppClipboard: _ }), e }

        function o(o) {
            var n, s, r;
            if ((document.activeElement === document.body || document.activeElement === document.documentElement) && (n = e(o), s = t(n))) {
                if ("keydown" === o.type) p[n] = !0;
                else if (p[n]) return;
                if (document.getSelection) { if (!document.getSelection().isCollapsed) return } else if (document.selection && "None" !== document.selection.type) return;
                o.isDefaultPrevented() || (r = i(s), r.isDefaultPrevented() && o.preventDefault())
            }
        }

        function n(t) { t = t.originalEvent || t, t.key === c && i("change") }

        function s() { u || ($(document).on("keypress keydown", o), $(window).on("storage", n), u = !0) }

        function r() { $(document).off("keypress keydown", o), $(window).off("storage", n), $(window).off(d + ":copy"), $(window).off(d + ":paste"), $(window).off(d + ":cut"), $(window).off(d + ":change"), u = !1 }

        function a() { try { return JSON.parse(TVLocalStorage.getItem(c)) } catch (t) { return null } }

        function l(t) {
            if (null == t) return h();
            var e = JSON.stringify(t);
            e !== TVLocalStorage.getItem(c) && (TVLocalStorage.setItem(c, e), i("change"))
        }

        function h() { TVLocalStorage.getItem(c) && (TVLocalStorage.removeItem(c), i("change")) }
        var c = "application-clipboard",
            d = "appclip",
            p = {},
            u = !1,
            _ = { init: s, set: l, get: a, clear: h, destroy: r };
        return _
    }();
    t.exports = i
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.FloatBinder,
        a = s.BooleanBinder,
        l = s.SliderBinder,
        h = s.ColorBinding,
        c = s.SimpleComboBinder,
        d = i(32).addColorPicker,
        p = i(19).createLineStyleEditor,
        u = i(13).createLineWidthEditor,
        _ = i(46).createTransparencyEditor;
    inherit(o, n), o.prototype.addLevelEditor = function(t, e) {
        var i, o, n, s, l, c = e || $("<tr>").appendTo(this._table),
            p = $("<td>");
        return p.appendTo(c),
            i = $("<input type='checkbox' class='visibility-switch'>"), i.appendTo(p), e && i.css("margin-left", "15px"), o = $("<td>"), o.appendTo(c), n = $("<input type='text'>"), n.appendTo(o), n.css("width", "70px"), this.bindControl(new r(n, t.coeff, !1, this.model(), "Change Pitchfork Line Coeff")), s = $("<td class='colorpicker-cell'>"), s.appendTo(c), l = d(s), this.bindControl(new a(i, t.visible, !0, this.model(), "Change Fib Retracement Line Visibility")), this.bindControl(new h(l, t.color, !0, this.model(), "Change Fib Retracement Line Color", 0)), c
    }, o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, r, f, m, g, v, y, b, w, S, T, C, x, P, L, k, I, A, E, M, D, O, V, B, R, N, F, z;
        for (this._div = $(document.createElement("div")).addClass("property-page"), t = this._linetool.properties().trendline, e = $("<table>").appendTo(this._div).css("padding-bottom", "3px"), t && (i = $("<tr>").appendTo(e), o = $("<input type='checkbox' class='visibility-switch'>"), $("<td>").append(o).appendTo(i), $("<td>").append($.t("Trend Line")).appendTo(i), this.bindControl(new a(o, t.visible, !0, this.model(), "Change Fib Retracement Line Visibility")), n = $("<td class='colorpicker-cell'>").appendTo(i), s = d(n), this.bindControl(new h(s, t.color, !0, this.model(), "Change Fib Retracement Line Color", 0)), r = $("<td>").appendTo(i), f = u(), f.appendTo(r), this.bindControl(new l(f, t.linewidth, parseInt, this.model(), "Change Fib Retracement Line Width")), m = $("<td>").appendTo(i), g = p(), g.render().appendTo(m), this.bindControl(new c(g, t.linestyle, parseInt, !0, this.model(), "Change Fib Retracement Line Style"))), v = this._linetool.properties().levelsStyle, y = $("<tr>").appendTo(e), $("<td>").appendTo(y), $("<td>" + $.t("Levels Line") + "</td>").appendTo(y), $("<td>").appendTo(y), r = $("<td>").appendTo(y), f = u(), f.appendTo(r), this.bindControl(new l(f, v.linewidth, parseInt, this.model(), "Change Fib Retracement Line Width")), m = $("<td>").appendTo(y), g = p(), g.render().appendTo(m), this.bindControl(new c(g, v.linestyle, parseInt, !0, this.model(), "Change Fib Retracement Line Style")), this._table = $(document.createElement("table")).appendTo(this._div), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), b = {}, w = 0; w < 24; w++) S = w % 8, y = b[S], T = "level" + (w + 1), b[S] = this.addLevelEditor(this._linetool.properties()[T], y);
        this.addOneColorPropertyWidget(this._table), C = $("<table cellpadding=0 cellspacing=0>").appendTo(this._div), x = $("<tr>").appendTo(C), this._linetool.properties().extendLines && (P = $("<input type='checkbox' class='visibility-switch'>"), L = $("<label>").append(P).append($.t("Extend Lines")), $("<td>").append(L).appendTo(x)), this._linetool.properties().extendLeft && (k = $("<input type='checkbox' class='visibility-switch'>"), L = $("<label>").append(k).append($.t("Extend Left")), $("<td>").append(L).appendTo(x)), this._linetool.properties().extendRight && (I = $("<input type='checkbox' class='visibility-switch'>"), L = $("<label>").append(I).append($.t("Extend Right")), $("<td>").append(L).appendTo(x)), this._linetool.properties().reverse && (A = $("<input type='checkbox' class='visibility-switch'>"), L = $("<label>").append(A).append($.t("Reverse")), $("<td>").append(L).appendTo(x)),
            E = $("<tr>").appendTo(C), M = $("<input type='checkbox' class='visibility-switch'>"), L = $("<label>").append(M).append($.t("Levels")), $("<td>").append(L).appendTo(E), D = $("<input type='checkbox' class='visibility-switch'>"), L = $("<label>").append(D).append($.t("Prices")), $("<td>").append(L).appendTo(E), O = $("<input type='checkbox' class='visibility-switch'>"), L = $("<label>").append(O).append($.t("Percents")), $("<td>").append(L).appendTo(E), V = $("<table cellspacing='0' cellpadding='0'>").appendTo(this._div), B = $("<select><option value='left'>" + $.t("left") + "</option><option value='center'>" + $.t("center") + "</option><option value='right'>" + $.t("right") + "</option></select>"), R = $("<select><option value='bottom'>" + $.t("top") + "</option><option value='middle'>" + $.t("middle") + "</option><option value='top'>" + $.t("bottom") + "</option></select>"), y = $("<tr>"), y.append("<td>" + $.t("Labels") + "</td>").append(B).append("<td>&nbsp</td>").append(R), y.appendTo(V), N = $("<table cellspacing='0' cellpadding='0'>").appendTo(this._div), y = $("<tr>").appendTo(N), F = $("<input type='checkbox' class='visibility-switch'>"), $("<td>").append(F).appendTo(y), this.createLabeledCell($.t("Background"), F).appendTo(y), z = _(), $("<td>").append(z).appendTo(y), this.bindControl(new a(D, this._linetool.properties().showPrices, !0, this.model(), "Change Gann Fan Prices Visibility")), this.bindControl(new a(M, this._linetool.properties().showCoeffs, !0, this.model(), "Change Gann Fan Levels Visibility")), this.bindControl(new a(F, this._linetool.properties().fillBackground, !0, this.model(), "Change Fib Retracement Background Visibility")), this.bindControl(new l(z, this._linetool.properties().transparency, !0, this.model(), "Change Fib Retracement Background Transparency")), this._linetool.properties().extendLines && this.bindControl(new a(P, this._linetool.properties().extendLines, !0, this.model(), "Change Fib Retracement Extend Lines")), this._linetool.properties().extendLeft && this.bindControl(new a(k, this._linetool.properties().extendLeft, !0, this.model(), "Change Fib Retracement Extend Lines")), this._linetool.properties().extendRight && this.bindControl(new a(I, this._linetool.properties().extendRight, !0, this.model(), "Change Fib Retracement Extend Lines")), this._linetool.properties().reverse && this.bindControl(new a(A, this._linetool.properties().reverse, !0, this.model(), "Change Fib Retracement Reverse")), this.bindControl(new c(B, this._linetool.properties().horzLabelsAlign, null, !0, this.model(), "Change Fib Labels Horizontal Alignment")), this.bindControl(new c(R, this._linetool.properties().vertLabelsAlign, null, !0, this.model(), "Change Fib Labels Vertical Alignment")), this.bindControl(new a(O, this._linetool.properties().coeffsAsPercents, !0, this.model(), "Change Fib Retracement Coeffs As Percents")), this.loadData()
    }, o.prototype.widget = function() { return this._div }, t.exports = o
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t, e, i) {
            this.pane = t, this._isLeft = o.isLeft(e), this._properties = t.chart().properties().scalesProperties, this._disableContextMenu = !!i, this.jqCell = $(document.createElement("td")),
                this.jqCell.addClass("chart-markup-table"), this.jqCell.addClass("price-axis"), this.jqCell.width(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 = f(this._dv, new m(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 = f(this._dv, new m(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._textWidthCache = new s, this.restoreDefaultCursor(), this.update(), g(this.jqCell, this, !0), this.dialog = this.pane.chart().dialog, this.contextMenu = null, this.actions = {}, this._isVisible = !0, this.priceScale().onMarksChanged.subscribe(this, this.onMarksChanged)
        }
        var n, s, r, a, l, h, c, d, p, u, _, f, m, g, v, y, b;
        i(494), n = i(1).LineDataSource, s = i(159), r = i(47), a = r.Action, l = r.ActionSeparator, h = i(101), c = i(604), d = i(21), p = i(120), u = p.resizeCanvas, _ = p.clearRect, f = p.addCanvasTo, m = p.Size, g = i(106).setMouseEventHandler, v = i(33).trackEvent, y = i(163).makeFont, b = i(12).getLogger("Chart.PriceAxisWidget"), o.prototype._BORDER_SIZE = 1, o.prototype._OFFSET_SIZE = 1, o.prototype._TICK_LENGTH = 3, o.LHS = 1, o.RHS = 2, o.isLeft = function(t) { return t === o.LHS || t !== o.RHS && (b.logDebug("PriceAxisWidget.isLeft: wrong side"), !1) }, o.prototype.backgroundColor = function() { return this.pane.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 y(this.fontSize(), "Arial", "") }, o.prototype.rendererOptions = function() { var t, e, i; return this._rendererOptions || (this._rendererOptions = { isLeft: this._isLeft, width: 0, height: 0, borderSize: this._BORDER_SIZE, offsetSize: this._OFFSET_SIZE, tickLength: this._TICK_LENGTH, fontSize: NaN, font: "", widthCache: new s, _tickmarksCache: new c(11, "Arial", "", "#000"), color: "" }), t = this._rendererOptions, e = !1, t.color !== this.textColor() && (t.color = this.textColor(), e = !0), t.fontSize !== this.fontSize() && (i = this.fontSize(), t.fontSize = i, t.font = this.baseFont(), t.paddingTop = Math.floor(i / 4.5), t.paddingBottom = Math.ceil(i / 4.5), t.paddingInner = Math.max(Math.ceil(i / 3 - t.tickLength / 2), 0), t.paddingOuter = Math.ceil(i / 3), t.baselineOffset = Math.round(i / 10), t.widthCache.reset(), e = !0), e && t._tickmarksCache.reset(t.fontSize, "Arial", "", t.color), this.size && (t.width = this.size.w, t.height = this.size.h), this._rendererOptions }, o.prototype.mouseDownEvent = function(t) { var i, o;!this.priceScale().isEmpty() && e.enabled("chart_zoom") && (i = this.pane.chart().model(), o = this.pane.state(), this._mousedown = !0, this.setCursor("ns-resize"), i.startScalePrice(o, this.priceScale(), t.localY)) }, o.prototype.pressedMouseMoveEvent = function(t) {
            var e = this.pane.chart().model(),
                i = this.pane.state(),
                o = this.priceScale();
            e.scalePriceTo(i, o, t.localY)
        }, o.prototype.mouseDownOutsideEvent = function(t) {
            var e = this.pane.chart().model(),
                i = this.pane.state(),
                o = this.priceScale();
            this._mousedown && (this._mousedown = !1, e.endScalePrice(i, o), this.restoreDefaultCursor())
        }, o.prototype.mouseUpEvent = function(t) {
            var e = this.pane.chart().model(),
                i = this.pane.state(),
                o = this.priceScale();
            this._mousedown = !1, e.endScalePrice(i, o), this.restoreDefaultCursor()
        }, o.prototype._initActions = function(t) {
            var e, n, s, r, l;
            this.pane.state() && (e = i(5).ActionBinder, n = this, this.actions.reset = new a({ text: $.t("Reset Scale"), shortcut: "Alt+R" }), this.actions.reset.callbacks().subscribe(this, o.prototype.reset), s = function(t) { this._undoModel.setLockScaleProperty(this._property, t.checked, n.priceScale().mainSource(), this._undoText) }, delete this.actions.setLockScale, this.priceScale().mainSource() instanceof TradingView.Series && (this.actions.setLockScale = new a({ text: $.t("Lock Scale"), checkable: !0, checked: this.priceScale().mainSource().properties().lockScale.value() }), this._lockScaleBinding = new e(this.actions.setLockScale, this.priceScale().mainSource().properties().lockScale, this.pane.chart().model(), "Lock Scale", s), this._lockScaleBinding.setValue(this.priceScale().mainSource().properties().lockScale.value())), r = function() { this._undoModel.setAutoScaleProperty(this._property, this.value(), n.priceScale(), this._undoText) }, this.actions.setAutoScale = new a({ text: $.t("Auto Scale"), checkable: !0, checked: !0 }), this._autoScaleBinding = new e(this.actions.setAutoScale, this.priceScale().properties().autoScale, this.pane.chart().model(), "Undo AutoScale", r), this._autoScaleBinding.setValue(this._autoScaleBinding.property().value()), this.actions.setPercentage = new a({ text: $.t("Percentage", { context: "scale_menu" }), checkable: !0, checked: !1 }), l = function() { this._undoModel.setPercentProperty(this._property, this.value(), n.priceScale(), this._undoText) }, this.actions.setPercentage.binding = new e(this.actions.setPercentage, this.priceScale().properties().percentage, this.pane.chart().model(), "Undo Percentage", l), this.actions.setLog = new a({ text: $.t("Log Scale", { context: "scale_menu" }), checkable: !0, checked: !1 }), this.actions.setLog.binding = new e(this.actions.setLog, this.priceScale().properties().log, this.pane.chart().model(), "Undo Log Scale"), this.actions.alignLabels = new a({ text: $.t("Precise Labels", { context: "scale_menu" }), checkable: !0, checked: !1 }), this.actions.alignLabels.binding = new e(this.actions.alignLabels, this.priceScale().properties().alignLabels, this.pane.chart().model(), "Precise Labels"), this._updateScalesActions())
        }, o.prototype._updateScalesActions = function() {
            var t = this.priceScale(),
                e = t.mainSource() instanceof TradingView.Series,
                i = t.mainSource().properties();
            this.actions.setPercentage.setEnabled(!(t.isLog() || e && i.lockScale.value() || e && i.style.value() === TradingView.Series.STYLE_PNF)), this.actions.setLog.setEnabled(!(t.isPercent() || e && i.lockScale.value() || e && i.style.value() === TradingView.Series.STYLE_PNF)),
                this.actions.setAutoScale.setChecked(t._properties.autoScale.value()), this.actions.setAutoScale.setEnabled(!t.properties().autoScaleDisabled.value())
        }, o.prototype.mouseClickEvent = function(t) {}, o.prototype.mouseDoubleClickEvent = function(t) { this.reset(), v("GUI", "Double click price scale") }, 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; return this._initActions(), t = this.pane.chart().actions(), i = [], i.push(this.actions.reset, new l, t.showLeftAxis, t.showRightAxis, new l, this.actions.setAutoScale), this.actions.setLockScale && i.push(this.actions.setLockScale), i.push(t.scaleSeriesOnly, new l, this.actions.setPercentage, this.actions.setLog, new l), e.enabled("fundamental_widget") || i.push(t.showSymbolLabelsAction, t.showSeriesLastValue), i.push(t.showStudyPlotNamesAction, t.showStudyLastValue), e.enabled("countdown") && i.push(t.showCountdown), i.push(this.actions.alignLabels), !TradingView.onWidget() && e.enabled("show_chart_property_page") && e.enabled("chart_property_page_scales") && t.scalesProperties && i.push(new l, t.scalesProperties), i }, o.prototype.backLabels = function(t) {
            var e, i, o, n, s, r = [],
                a = this.priceScale().orderedSources().slice(),
                l = this.pane,
                h = l.chart().model(),
                c = l.state(),
                d = [],
                p = h.sourceBeingMoved() || h.lineBeingEdited() || h.lineBeingCreated();
            if (p && d.push(p), h.selectedSource() && d.push(h.selectedSource()), h.hoveredSource() && d.push(h.hoveredSource()), this.priceScale() === c.defaultPriceScale())
                for (e = this.pane.state().dataSources(), i = 0; i < e.length; i++) c.isOverlay(e[i]) && a.push(e[i]);
            for (i = 0; i < a.length; ++i)
                if (o = a[i], (t || -1 === d.indexOf(o)) && (n = o.priceAxisViews(c, o.priceScale())))
                    for (s = 0; s < n.length; s++) r.push(n[s]);
            return r
        }, o.prototype.optimalWidth = function() {
            var t, e, i, o, n, s, r;
            if (!this.isVisible()) return 0;
            if (t = 0, e = this.rendererOptions(), this.pane.state())
                for (i = this.ctx, o = this.priceScale().marks(), i.setFont(this.baseFont()), o.length > 0 && (t = Math.max(e.widthCache.measureText(i, o[0].label), e.widthCache.measureText(i, o[o.length - 1].label))), n = this.backLabels(!0), s = n.length; s--;)(r = e.widthCache.measureText(i, n[s].text())) > t && (t = r);
            return Math.ceil(e.offsetSize + e.borderSize + e.tickLength + e.paddingInner + e.paddingOuter + t)
        }, o.prototype.setSize = function(t) { this.size && this.size.equals(t) || (this.size = t, u(this.canvas, t), u(this.top_canvas, t), this.jqCell.css({ width: t.w, "min-width": t.w, height: t.h })) }, o.prototype.update = function() {}, o.prototype._hightlightBackground = function(t, e, i) {
            var o, n, s, r, a, l, h = e[0].price,
                c = e[0].price;
            for (o = 1; o < e.length; o++) h = Math.min(h, e[o].price), c = Math.max(c, e[o].price);
            n = this.priceScale(), n.isPercent() && i && (s = i.firstValue(), h = n.priceRange().convertToPercent(h, s), c = n.priceRange().convertToPercent(c, s)), r = this.priceScale().priceToCoordinate(h), a = this.priceScale().priceToCoordinate(c), l = "rgba(109, 158, 235, 0.3)", _(t, 1, r, this.size.w - 1, a - r, l)
        }, o.prototype.drawBackground = function(t) {
            var e, i, o, s;
            if (_(t, 0, 0, this.size.w, this.size.h, this.backgroundColor()), e = this.pane.chart().model(), (i = e.model().selectedSource()) && i.priceScale() === this.priceScale() && i instanceof n) {
                if (o = i.axisPoints(), 0 === o.length) return;
                this._hightlightBackground(t, o, i.ownerSource())
            }
            s = e.model().crossHairSource(), s.startMeasurePoint() && this._hightlightBackground(t, s.measurePoints(), this.pane.state().mainDataSource())
        }, o.prototype.drawBorder = function(t) {
            var e, i, o;
            t.save(), t.fillStyle = this.lineColor(), e = this.size.h, this._isLeft ? (t.translate(-.5, -.5), i = this.size.w - this._BORDER_SIZE - 1, o = this.size.w - 1) : (t.translate(.5, -.5), i = 0, o = i + this._BORDER_SIZE), t.fillRect(i, 0, o - i, e), t.restore()
        }, o.prototype.drawTickMarks = function(t) {
            var e, i, o, n, s, r;
            if (t.save(), t.strokeStyle = this.lineColor(), e = this.priceScale().marks(), t.fillStyle = this.textColor(), t.setFont(this.baseFont()), i = this, t.translate(-.5, -.5), o = this.rendererOptions(), i._isLeft) { for (t.fillStyle = i.lineColor(), t.beginPath(), n = this.size.w - i._OFFSET_SIZE - i._BORDER_SIZE - i._TICK_LENGTH, s = e.length; s--;) t.rect(n, e[s].coord, i._TICK_LENGTH, 1); for (t.fill(), s = e.length; s--;) o._tickmarksCache.paintTo(t, e[s].label, n - o.paddingInner, e[s].coord, "right") } else { for (t.fillStyle = i.lineColor(), t.beginPath(), r = i._BORDER_SIZE + i._OFFSET_SIZE, s = e.length; s--;) t.rect(r, e[s].coord, i._TICK_LENGTH, 1); for (t.fill(), s = e.length; s--;) o._tickmarksCache.paintTo(t, e[s].label, r + i._TICK_LENGTH + o.paddingInner, e[s].coord, "left") }
            t.restore()
        }, o.prototype._alignLabels = function() {
            var t, e, i, o, n, s, r, a, l, h, c, d, p, u = this.size.h / 2,
                _ = [],
                f = this.priceScale().orderedSources().slice(),
                m = this.pane,
                g = m.state(),
                v = this.rendererOptions();
            if (this.priceScale() === g.defaultPriceScale())
                for (t = this.pane.state().dataSources(), e = 0; e < t.length; e++) g.isOverlay(t[e]) && f.push(t[e]);
            for (i = this.priceScale().mainSource(), e = 0; e < f.length; ++e)
                if (o = f[e], n = o.priceAxisViews(g, o.priceScale())) {
                    for (s = 0; s < n.length; s++) _.push(n[s]);
                    i === o && n.length > 0 && (u = n[0].floatCoordinate())
                }
            if (r = _.filter(function(t) { return t.floatCoordinate() <= u }), a = _.filter(function(t) { return t.floatCoordinate() > u }), r.sort(function(t, e) { return e.floatCoordinate() - t.floatCoordinate() }), r.length && a.length && a.push(r[0]), a.sort(function(t, e) { return t.floatCoordinate() - e.floatCoordinate() }), _.forEach(function(t) { t._fixedCoordinate = t.coordinate() }), l = this.priceScale().properties(), l.alignLabels && l.alignLabels.value()) { for (e = 1; e < r.length; e++) h = r[e], c = r[e - 1], d = c.renderer().height(v, !1), (h.coordinate() || c._fixedCoordinate) && h.coordinate() > c._fixedCoordinate - d && (p = c._fixedCoordinate - d, h._fixedCoordinate = p); for (s = 1; s < a.length; s++) h = a[s], c = a[s - 1], d = c.renderer().height(v, !0), (h.coordinate() || c._fixedCoordinate) && h.coordinate() < c._fixedCoordinate + d && (p = c._fixedCoordinate + d, h._fixedCoordinate = p) }
        }, o.prototype.drawBackLabels = function(t) {
            var e, i, o, n, s;
            for (t.save(), e = this.backLabels(), i = this.rendererOptions(), o = 0; o < e.length; o++) n = e[o], s = n.renderer(), n._fixedCoordinate && (s._data.coordinate = n._fixedCoordinate), s.draw(t, i);
            t.restore()
        }, o.prototype.drawCrossHairLabel = function(t) {
            var e, i, o, n, s, r, a, l = this.pane.chart().model().model(),
                h = [],
                c = l.sourceBeingMoved() || l.lineBeingEdited() || l.lineBeingCreated();
            for (c && h.push({ source: c, scale: c.priceScale() }), l.selectedSource() && h.push({ source: l.selectedSource(), scale: l.selectedSource().priceScale() }), l.hoveredSource() && h.push({ source: l.hoveredSource(), scale: l.hoveredSource().priceScale() }), h.push({ source: l.crossHairSource(), scale: this.priceScale() }), e = this.pane.state(), i = 0; i < h.length; i++)
                if (o = h[i], n = o.source.priceAxisViews(e, o.scale))
                    for (s = 0; s < n.length; s++) r = n[s], t.save(), a = r.renderer(), r._fixedCoordinate && (a._data.coordinate = r._fixedCoordinate), a.draw(t, this.rendererOptions()), t.restore()
        }, o.prototype.priceScale = function() {
            var t = this.pane.state(),
                e = [];
            return e = this._isLeft ? [t.leftPriceScale(), t.rightPriceScale()] : [t.rightPriceScale(), t.leftPriceScale()], null === e[0].mainSource() ? null === e[1].mainSource() ? e[0] : e[1] : e[0]
        }, o.prototype.isVisible = function() { return this._isVisible }, o.prototype.setVisible = function(t) {
            (t = !!t) !== this._isVisible && (t ? this.jqCell.css("display", "table-cell") : this.jqCell.css("display", "none"), this._isVisible = t)
        }, o.prototype.setAutoScale = function(t) {
            var e = this.pane.state,
                i = this.priceScale();
            this.pane.chart().model().setPriceAutoScale(e, i, t)
        }, o.prototype.reset = function() {
            var t = this.pane.state(),
                e = this.priceScale();
            this.pane.chart().model().resetPriceScale(t, e)
        }, o.prototype.paint = function(t) { this._isVisible && t && (t === d.UPDATE_CURSOR_ONLY ? (this.top_ctx.clearRect(-.5, -.5, this.size.w, this.size.h), this.drawCrossHairLabel(this.top_ctx)) : (this._alignLabels(), this.drawBackground(this.ctx), this.drawBorder(this.ctx), this.pane.state() && (this.drawTickMarks(this.ctx), this.drawBackLabels(this.ctx), this.top_ctx.clearRect(-.5, -.5, this.size.w, this.size.h), this.drawCrossHairLabel(this.top_ctx)))) }, o.prototype.restoreDefaultCursor = function() { this.setCursor("") }, o.prototype.setCursor = function(t) { var e = ""; "grabbing" !== t && "ns-resize" !== t || (e = "price-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 }, o.prototype.onMarksChanged = function() {
            var t, e = this.optimalWidth();
            this._prevOptimalWidth < e && (t = this, this.updateTimeout || (this.updateTimeout = setTimeout(function() { t.pane && t.pane.chart && t.pane.chart() && t.pane.chart().model().model().fullUpdate(), t.updateTimeout = null }, 100))), this._prevOptimalWidth = e
        }, t.exports = o
    }).call(e, i(3))
}, function(t, e, i) {
    (function(t) {
        "use strict";

        function o(t) {
            return t instanceof h ? t instanceof Q ? Ot : t instanceof pt ? null : t instanceof j ? null : t instanceof st ? null : t instanceof E ? Mt : t instanceof A ? null : t instanceof tt ? null : t instanceof lt ? null : t instanceof F ? null : t instanceof nt ? null : t instanceof ht ? At : t instanceof T ? null : t instanceof W ? null : t instanceof H ? null : t instanceof S ? Vt : t instanceof yt ? Lt : t instanceof U ? null : t instanceof w ? null : t instanceof O ? null : t instanceof ft ? Rt : kt : t instanceof vt ? t instanceof wt ? Pt : Ct : null
        }

        function n(e, i) { if (e instanceof l || e instanceof a.ChartWidget) return t.enabled("show_chart_property_page") ? xe : null; if (e instanceof vt) return e instanceof bt ? Tt : "Volume@tv-basicstudies" === e.metaInfo().id ? Wt : xt; if (e instanceof h) { if (e instanceof M) return zt; if (e instanceof E) return Et; if (e instanceof L) return fe; if (e instanceof k) return fe; if (e instanceof I) return me; if (e instanceof ht) return It; if (e instanceof ct) return It; if (e instanceof S) return $t; if (e instanceof z) return Ut; if (e instanceof $) return jt; if (e instanceof lt) return qt; if (e instanceof ot) return ye; if (e instanceof rt) return Ft; if (e instanceof dt || e instanceof j) return Yt; if (e instanceof pt) return Gt; if (e instanceof st) return Kt; if (e instanceof G) return Xt; if (e instanceof A) return Zt; if (e instanceof W) return we; if (e instanceof H) return Se; if (e instanceof D) return Jt; if (e instanceof it) return Qt; if (e instanceof U) return Te; if (e instanceof at) return te; if (e instanceof nt) return ee; if (e instanceof et) return ie; if (e instanceof tt) return oe; if (e instanceof V) return ne; if (e instanceof R) return se; if (e instanceof N) return re; if (e instanceof c) return d; if (e instanceof p) return u; if (e instanceof b) return ae; if (e instanceof q) return ce; if (e instanceof _) return f; if (e instanceof v) return Ce; if (e instanceof C) return le; if (e instanceof B) return he; if (e instanceof x) return de; if (e instanceof m) return g; if (e instanceof F) return pe; if (e instanceof P) return ue; if (e instanceof ut || e instanceof _t) return _e; if (e instanceof y) return St; if (e instanceof T) return Bt; if (e instanceof Q) return Dt; if (e instanceof X) return ge; if (e instanceof J) return ve; if (e instanceof K) return be; if (e instanceof Z) return ve; if (e instanceof Y) return ge; if (e instanceof yt) return xt; if (e instanceof gt || e instanceof mt) return Ht; if (e instanceof ft) return Nt } return null }

        function s(t) { var e = i(87).StudyDisplayPropertyPage; return t instanceof vt ? e : null }

        function r(t) { var e = i(650); if (t instanceof h) return e }
        var a = i(191),
            l = i(43),
            h = (i(334), i(353), i(1).LineDataSource),
            c = i(205),
            d = i(193),
            p = i(314),
            u = i(621),
            _ = i(315),
            f = i(623),
            m = i(332),
            g = i(642),
            v = i(338),
            y = i(65).LineToolElliott,
            b = i(204).LineToolFibCircles,
            w = i(152),
            S = (i(341),
                i(90).LineToolVertLine),
            T = i(147),
            C = i(339),
            x = i(318),
            P = i(309),
            L = i(311),
            k = i(331),
            I = i(310),
            A = i(150).LineToolParallelChannel,
            E = i(208),
            M = i(11).LineToolTrendLine,
            D = i(103).LineToolArrowMark,
            O = i(203).LineToolExecution,
            $ = i(326),
            V = i(322),
            B = i(316),
            R = i(320),
            N = i(321),
            F = i(206).LineToolFibWedge,
            z = i(52).LineToolPitchfork,
            W = i(312),
            H = i(319),
            U = i(118),
            j = i(333),
            q = i(317),
            Y = i(323),
            G = i(119).LineToolTriangle,
            K = i(340),
            X = i(200).LineTool5PointsPattern,
            Z = i(337),
            J = i(306),
            Q = i(151).LineToolRiskReward,
            tt = i(327),
            et = i(329),
            it = i(330),
            ot = i(149).LineToolNote,
            nt = i(201),
            st = i(307),
            rt = i(202),
            at = i(308),
            lt = i(16).LineToolText,
            ht = i(89).LineToolHorzLine,
            ct = i(324),
            dt = i(45).LineToolRectangle,
            pt = i(313),
            ut = i(336),
            _t = i(335),
            ft = i(207),
            mt = i(148).LineToolBezierQuadro,
            gt = i(148).LineToolBezierCubic,
            vt = i(31).Study,
            yt = i(78).StudyLineDataSource,
            bt = i(351).study_Overlay,
            wt = i(349),
            St = i(619),
            Tt = i(302),
            Ct = i(87).StudyInputsPropertyPage,
            xt = i(87).StudyStylesPropertyPage,
            Pt = i(599),
            Lt = i(663),
            kt = i(64),
            It = i(293).LineToolHorzLineStylesPropertyPage,
            At = i(293).LineToolHorzLineInputsPropertyPage,
            Et = i(296).LineToolTrendAngleStylesPropertyPage,
            Mt = i(296).LineToolTrendAngleInputsPropertyPage,
            Dt = i(294).LineToolRiskRewardStylesPropertyPage,
            Ot = i(294).LineToolRiskRewardInputsPropertyPage,
            $t = i(297).LineToolVertLineStylesPropertyPage,
            Vt = i(297).LineToolVertLineInputsPropertyPage,
            Bt = i(611).LineToolBarsPatternStylesPropertyPage,
            Rt = i(292).LineToolGhostFeedInputsPropertyPage,
            Nt = i(292).LineToolGhostFeedStylesPropertyPage,
            Ft = i(614),
            zt = i(647),
            Wt = i(672),
            Ht = i(612),
            Ut = i(638),
            jt = i(637),
            qt = i(645),
            Yt = i(644),
            Gt = i(620),
            Kt = i(608),
            Xt = i(649),
            Zt = i(636),
            Jt = i(609),
            Qt = i(641),
            te = i(610),
            ee = i(613),
            ie = i(640),
            oe = i(639),
            ne = i(633),
            se = i(631),
            re = i(632),
            ae = i(622),
            le = i(628),
            he = i(624),
            ce = i(625),
            de = i(626),
            pe = i(629),
            ue = i(615),
            _e = i(646),
            fe = i(617),
            me = i(616),
            ge = i(606),
            ve = i(607),
            ye = i(635),
            be = i(648),
            we = i(618),
            Se = i(630),
            Te = i(634),
            Ce = i(627),
            xe = i(596);
        e.createInputsPropertyPage = function(t, e) { var i = o(t); return i ? new i(t.properties(), e, t) : null }, e.createStudyStrategyPropertyPage = function(t, e) {
            var o = i(354),
                n = i(665);
            return t instanceof o ? new n(t.properties(), e, t) : null
        }, e.createStylesPropertyPage = function(t, e) { var i = n(t); return i ? new i(t.properties(), e, t) : null }, e.createDisplayPropertyPage = function(t, e) { var i = s(t); return i ? new i(t.properties(), e, t) : null }, e.createVisibilitiesPropertyPage = function(t, e) { var i = r(t); return i ? new i(t.properties(), e, t) : null }, e.hasInputsPropertyPage = function(t) { return !!o(t) }, e.hasStylesPropertyPage = function(t) { return !!n(t) }, e.hasDisplayPropertyPage = function(t) { return !!s(t) }
    }).call(e, i(3))
}, function(t, e) {
    "use strict";

    function i() { this.backColorers = [] }

    function o(t) { i.call(this), this._series = t }

    function n(t, e) { i.call(this), this._study = t, this._plotIndex = e }
    i.prototype.barStyle = function(t, e, i) { var o, n = {}; for (o = this.backColorers.length - 1; o >= 0; o--) this.backColorers[o].applyBarStyle(t, e, n, i); return this.applyBarStyle(t, e, n, i), n }, i.prototype.pushBackBarColorer = function(t) { this.backColorers.push(t) }, i.prototype.applyBarStyle = function(t, e, i) { throw Error("This function is supposed to be reimplemented in a subclass") }, inherit(o, i),
        o.prototype.applyBarStyle = function(t, e, i, o) {
            var n, s, r, a, l, h, c, d, p, u, _;
            switch (i || (i = {}), i.barColor = null, i.barBorderColor = null, i.barWickColor = null, i.isBarHollow = null, i.isBarUp = null, i.upColor = null, i.downColor = null, i.isTwoColorBar = null, n = this._series.properties(), n.style.value()) {
                case TradingView.Series.STYLE_LINE:
                    i.barColor = n.lineStyle.color.value();
                    break;
                case TradingView.Series.STYLE_AREA:
                    i.barColor = n.areaStyle.linecolor.value();
                    break;
                case TradingView.Series.STYLE_BARS:
                    s = n.barStyle.upColor.value(), r = n.barStyle.downColor.value(), a = s, l = r, h = this.findBar(t, !1, o), n.barStyle.barColorsOnPrevClose.value() ? (c = this.findPrevBar(t, !1, o), i.barColor = c[TradingView.CLOSE_PLOT] <= h[TradingView.CLOSE_PLOT] ? s : r, i.barBorderColor = c[TradingView.CLOSE_PLOT] <= h[TradingView.CLOSE_PLOT] ? a : l) : (i.barColor = h[TradingView.OPEN_PLOT] <= h[TradingView.CLOSE_PLOT] ? s : r, i.barBorderColor = h[TradingView.OPEN_PLOT] <= h[TradingView.CLOSE_PLOT] ? a : l);
                    break;
                case TradingView.Series.STYLE_CANDLES:
                    s = n.candleStyle.upColor.value(), r = n.candleStyle.downColor.value(), a = n.candleStyle.borderUpColor ? n.candleStyle.borderUpColor.value() : n.candleStyle.borderColor.value(), l = n.candleStyle.borderDownColor ? n.candleStyle.borderDownColor.value() : n.candleStyle.borderColor.value(), d = n.candleStyle.wickUpColor ? n.candleStyle.wickUpColor.value() : n.candleStyle.wickColor.value(), p = n.candleStyle.wickDownColor ? n.candleStyle.wickDownColor.value() : n.candleStyle.wickColor.value(), h = this.findBar(t, !1, o), n.candleStyle.barColorsOnPrevClose.value() ? (c = this.findPrevBar(t, !1, o), u = c[TradingView.CLOSE_PLOT] <= h[TradingView.CLOSE_PLOT]) : u = h[TradingView.OPEN_PLOT] <= h[TradingView.CLOSE_PLOT], i.barColor = u ? s : r, i.barBorderColor = u ? a : l, i.barWickColor = u ? d : p;
                    break;
                case TradingView.Series.STYLE_HOLLOW_CANDLES:
                    s = n.hollowCandleStyle.upColor.value(), r = n.hollowCandleStyle.downColor.value(), a = n.hollowCandleStyle.borderUpColor ? n.hollowCandleStyle.borderUpColor.value() : n.hollowCandleStyle.borderColor.value(), l = n.hollowCandleStyle.borderDownColor ? n.hollowCandleStyle.borderDownColor.value() : n.hollowCandleStyle.borderColor.value(), d = n.hollowCandleStyle.wickUpColor ? n.hollowCandleStyle.wickUpColor.value() : n.hollowCandleStyle.wickColor.value(), p = n.hollowCandleStyle.wickDownColor ? n.hollowCandleStyle.wickDownColor.value() : n.hollowCandleStyle.wickColor.value(), h = this.findBar(t, !1, o), c = this.findPrevBar(t, !1, o), c[TradingView.CLOSE_PLOT] <= h[TradingView.CLOSE_PLOT] ? (i.barColor = s, i.barBorderColor = a, i.barWickColor = d) : (i.barColor = r, i.barBorderColor = l, i.barWickColor = p), h[TradingView.OPEN_PLOT] <= h[TradingView.CLOSE_PLOT] ? i.isBarHollow = !0 : i.isBarHollow = !1;
                    break;
                case TradingView.Series.STYLE_HEIKEN_ASHI:
                    s = n.haStyle.upColor.value(), r = n.haStyle.downColor.value(), a = n.haStyle.borderUpColor.value(), l = n.haStyle.borderDownColor.value(), d = n.haStyle.wickUpColor.value(), p = n.haStyle.wickDownColor.value(), h = this.findBar(t, e, o), n.haStyle.barColorsOnPrevClose.value() ? (c = this.findPrevBar(t, e, o), u = c[TradingView.CLOSE_PLOT] <= h[TradingView.CLOSE_PLOT]) : u = h[TradingView.OPEN_PLOT] <= h[TradingView.CLOSE_PLOT], i.barColor = u ? s : r, i.barBorderColor = u ? a : l,
                        i.barWickColor = u ? d : p;
                    break;
                case TradingView.Series.STYLE_RENKO:
                    h = this.findBar(t, e, o), u = h[TradingView.OPEN_PLOT] <= h[TradingView.CLOSE_PLOT], s = e ? n.renkoStyle.upColorProjection.value() : n.renkoStyle.upColor.value(), r = e ? n.renkoStyle.downColorProjection.value() : n.renkoStyle.downColor.value(), a = e ? n.renkoStyle.borderUpColorProjection.value() : n.renkoStyle.borderUpColor.value(), l = e ? n.renkoStyle.borderDownColorProjection.value() : n.renkoStyle.borderDownColor.value(), i.barColor = u ? s : r, i.barBorderColor = u ? a : l, i.isBarUp = u;
                    break;
                case TradingView.Series.STYLE_PB:
                    h = this.findBar(t, e, o), u = h[TradingView.OPEN_PLOT] <= h[TradingView.CLOSE_PLOT], s = e ? n.pbStyle.upColorProjection.value() : n.pbStyle.upColor.value(), r = e ? n.pbStyle.downColorProjection.value() : n.pbStyle.downColor.value(), a = e ? n.pbStyle.borderUpColorProjection.value() : n.pbStyle.borderUpColor.value(), l = e ? n.pbStyle.borderDownColorProjection.value() : n.pbStyle.borderDownColor.value(), i.barColor = u ? s : r, i.barBorderColor = u ? a : l, i.isBarUp = u;
                    break;
                case TradingView.Series.STYLE_KAGI:
                    i.upColor = e ? n.kagiStyle.upColorProjection.value() : n.kagiStyle.upColor.value(), i.downColor = e ? n.kagiStyle.downColorProjection.value() : n.kagiStyle.downColor.value(), _ = null, h = this.findBar(t, e, o), h[TradingView.LOW_PLOT] < h[TradingView.ADT_PLOT] && h[TradingView.ADT_PLOT] < h[TradingView.HIGH_PLOT] ? (_ = h[TradingView.OPEN_PLOT] <= h[TradingView.CLOSE_PLOT], i.isTwoColorBar = !0) : (_ = h[TradingView.OPEN_PLOT] <= h[TradingView.CLOSE_PLOT] ? h[TradingView.OPEN_PLOT] === h[TradingView.ADT_PLOT] : h[TradingView.OPEN_PLOT] !== h[TradingView.ADT_PLOT], i.isTwoColorBar = !1), i.barColor = _ ? i.upColor : i.downColor, i.isBarUp = h[TradingView.OPEN_PLOT] <= h[TradingView.CLOSE_PLOT];
                    break;
                case TradingView.Series.STYLE_PNF:
                    h = this.findBar(t, e, o), u = h[TradingView.ADT_PLOT] > 0, s = e ? n.pnfStyle.upColorProjection.value() : n.pnfStyle.upColor.value(), r = e ? n.pnfStyle.downColorProjection.value() : n.pnfStyle.downColor.value(), i.isBarUp = u, i.barColor = u ? s : r
            }
            return i
        }, o.prototype.getSeriesBars = function(t) { return t ? this._series.nsBars() : this._series.bars() }, o.prototype._findBarFieldValue = function(t, e, i) { var o = this.getSeriesBars(i).valueAt(t); if (void 0 !== o) return o[e] }, o.prototype.findBar = function(t, e, i) { return i ? i.value : this.getSeriesBars(e).valueAt(t) || [] }, o.prototype.findPrevBar = function(t, e, i) { var o, n; return i && i.previousValue ? i.previousValue : (o = this._series.bars(), n = o._search(t, TradingView.SEARCH_EXACT), n > 0 ? this._series.bars()._valueAt(n - 1) : []) }, inherit(n, i), n.prototype.applyBarStyle = function(t, e, i) { var o, n, s, r, a, l, h, c, d, p, u, _, f; return i || (i = {}), e ? i : (o = this._study.properties(), o.visible.value() ? (n = this._study.metaInfo(), (s = this._study.data()) && 0 !== s.size() ? (r = n.plots[this._plotIndex], a = o.styles[r.id], a.visible && !a.visible.value() ? i : (l = this._study.offset(r.id), (h = s.valueAt(t - l)) ? null == (c = h[this._plotIndex + 1]) ? i : (c = Math.round(c), d = n.plots[this._plotIndex].palette, p = o.palettes, u = p[d], _ = n.palettes[d].valToIndex ? n.palettes[d].valToIndex[c] : c, f = u.colors[_].color.value(), i.barColor = f, i.upColor = f.color, i.downColor = f.color, i) : i)) : i) : i) }, e.SeriesBarColorer = o, e.StudyBarColorer = n
}, function(t, e, i) {
    "use strict";
    var o = i(21),
        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, 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) {
    "use strict";

    function i(t) { if (t) return "QUANDL" === t.exchange ? "Quandl.com" : ["BMFBOVESPA", "ASX", "BME", "NAG", "TSE", "TFX", "NZX", "BCBA", "TWSE", "EURONEXT", "TOCOM", "BMV", "SIX"].includes(t.exchange) ? "ICE Data services" : void 0 }
    t.exports = i
}, function(t, e, i) {
    "use strict";

    function o() {}
    var n = i(334),
        s = i(353),
        r = i(44).assert;
    o.isValid = function(t) { return !(!n[t] && !s[t]) }, o.create = function(t, e, i, a, l) {
        var h;
        return r(o.isValid(t), "Unknown line tool: " + t), h = n[t] || s[t],
            "LineToolVbPFixed" === t ? new h(e, i, a, l) : "LineToolRegressionTrend" === t ? new h(e, i, a) : ["LineStudyMtpAnalysis", "LineStudyMtpDecisionPoint", "LineStudyMtpRiskReward", "LineStudyMtpElliotWaveMain", "LineStudyMtpElliotWaveMajor", "LineStudyMtpElliotWaveMinor", "LineStudyMtpDownWave1OrA", "LineStudyMtpDownWave2OrB", "LineStudyMtpDownWave3", "LineStudyMtpDownWave4", "LineStudyMtpDownWave5", "LineStudyMtpDownWaveC", "LineStudyMtpUpWave1OrA", "LineStudyMtpUpWave2OrB", "LineStudyMtpUpWave3", "LineStudyMtpUpWave4", "LineStudyMtpUpWave5", "LineStudyMtpUpWaveC"].indexOf(t) >= 0 ? new h(e, i, a) : new h(e, i)
    }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e) { a.call(this, t, e), this._rendererCache = {}, this._numericFormatter = new f, this._invalidated = !0 }

    function n(t, e) {
        this._constructor = "LineTool5PointsPattern";
        var i = e || new u("linetool5pointspattern");
        l.call(this, t, new o(this, t), i)
    }

    function s(t, e) {
        this._constructor = "LineToolCypherPattern";
        var i = e || new u("linetoolcypherpattern");
        l.call(this, t, new r(this, t), i)
    }

    function r(t, e) { a.call(this, t, e), this._rendererCache = {}, this._numericFormatter = new f, this._invalidated = !0 }
    var a = i(9),
        l = i(1).LineDataSource,
        h = i(11).TrendLineRenderer,
        c = i(119).TriangleRenderer,
        d = i(16).TextRenderer,
        p = i(6),
        u = i(7).DefaultProperty,
        _ = i(121).DateTimeFormatter,
        f = i(26).NumericFormatter;
    inherit(o, a), o.prototype.renderer = function() {
        var t, e, i, o, n, s, r, a, u, _;
        return this._invalidated && (this.updateImpl(), this._invalidated = !1), this._points.length < 2 ? null : (t = this._source.properties(), e = new p, i = [this._points[0], this._points[1], this._points.length < 3 ? this._points[1] : this._points[2]], o = this, n = function(e, i) { return { points: [e], text: i, color: t.textcolor.value(), vertAlign: "middle", horzAlign: "center", font: t.font.value(), offsetX: 0, offsetY: 0, bold: t.bold && t.bold.value(), italic: t.italic && t.italic.value(), fontsize: t.fontsize.value(), backgroundColor: o._source.properties().color.value(), backgroundRoundRect: 4 } }, s = function(t, e) { return { points: [t, e], width: o._model.timeScale().width(), height: o._source.priceScale().height(), color: o._source.properties().color.value(), linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID, extendleft: !1, extendright: !1, leftend: l.LINEEND_NORMAL, rightend: l.LINEEND_NORMAL } }, r = {}, r.points = i, r.color = t.color.value(), r.linewidth = t.linewidth.value(), r.backcolor = t.backgroundColor.value(), r.fillBackground = t.fillBackground.value(), r.transparency = t.transparency.value(), e.append(new c(r)), this._points.length > 3 && (i = [this._points[2], this._points[3], 5 === this._points.length ? this._points[4] : this._points[3]], r = {}, r.points = i, r.color = t.color.value(), r.linewidth = t.linewidth.value(), r.backcolor = t.backgroundColor.value(), r.fillBackground = t.fillBackground.value(), r.transparency = t.transparency.value(), e.append(new c(r))), this._points.length >= 3 && (a = this._points[0].add(this._points[2]).scaled(.5), u = n(a, this._numericFormatter.format(this._ABRetracement)), e.append(new d(u, this._rendererCache))), this._points.length >= 4 && (a = this._points[1].add(this._points[3]).scaled(.5), _ = s(this._points[1], this._points[3]), e.append(new h(_)), u = n(a, this._numericFormatter.format(this._BCRetracement)),
            e.append(new d(u, this._rendererCache))), this._points.length >= 5 && (a = this._points[2].add(this._points[4]).scaled(.5), u = n(a, this._numericFormatter.format(this._CDRetracement)), e.append(new d(u, this._rendererCache)), _ = s(this._points[0], this._points[4]), e.append(new h(_)), a = this._points[0].add(this._points[4]).scaled(.5), u = n(a, this._numericFormatter.format(this._XDRetracement)), e.append(new d(u, this._rendererCache))), u = n(this._points[0], "X"), this._points[1].y > this._points[0].y ? (u.vertAlign = "bottom", u.offsetY = -10) : (u.vertAlign = "top", u.offsetY = 5), e.append(new d(u, this._rendererCache)), u = n(this._points[1], "A"), this._points[1].y < this._points[0].y ? (u.vertAlign = "bottom", u.offsetY = -10) : (u.vertAlign = "top", u.offsetY = 5), e.append(new d(u, this._rendererCache)), this._points.length > 2 && (u = n(this._points[2], "B"), this._points[2].y < this._points[1].y ? (u.vertAlign = "bottom", u.offsetY = -10) : (u.vertAlign = "top", u.offsetY = 5), e.append(new d(u, this._rendererCache))), this._points.length > 3 && (u = n(this._points[3], "C"), this._points[3].y < this._points[2].y ? (u.vertAlign = "bottom", u.offsetY = -10) : (u.vertAlign = "top", u.offsetY = 5), e.append(new d(u, this._rendererCache))), this._points.length > 4 && (u = n(this._points[4], "D"), this._points[4].y < this._points[3].y ? (u.vertAlign = "bottom", u.offsetY = -10) : (u.vertAlign = "top", u.offsetY = 5), e.append(new d(u, this._rendererCache))), this.addAnchors(e), e)
    }, o.prototype.update = function() { this._invalidated = !0 }, o.prototype.updateImpl = function() {
        var t, e, i, o, n;
        a.prototype.update.call(this), this._source.points().length >= 3 && (t = this._source.points()[0], e = this._source.points()[1], i = this._source.points()[2], this._ABRetracement = Math.round(1e3 * Math.abs((i.price - e.price) / (e.price - t.price))) / 1e3), this._source.points().length >= 4 && (o = this._source.points()[3], this._BCRetracement = Math.round(1e3 * Math.abs((o.price - i.price) / (i.price - e.price))) / 1e3), this._source.points().length >= 5 && (n = this._source.points()[4], this._CDRetracement = Math.round(1e3 * Math.abs((n.price - o.price) / (o.price - i.price))) / 1e3, this._XDRetracement = Math.round(1e3 * Math.abs((n.price - e.price) / (e.price - t.price))) / 1e3)
    }, inherit(n, l), n.prototype.pointsCount = function() { return 5 }, n.prototype.title = function() { return "XABCD Pattern" }, n.prototype._tooltipFieldsHash = { time0: { title: "Date 1", value: null }, price0: { title: "Price 1", value: null }, time1: { title: "Date 2", value: null }, price1: { title: "Price 2", value: null }, time2: { title: "Date 3", value: null }, price2: { title: "Price 3", value: null }, time3: { title: "Date 4", value: null }, price3: { title: "Price 4", value: null }, time4: { title: "Date 5", value: null }, price4: { title: "Price 5", value: null } }, n.prototype._updateTooltip = function() {
        var t, e, i, o, n, s = this._tooltipFieldsHash,
            r = this.points().m_values;
        r[0] && (e = this._model.timeScale().indexToUserTime(r[0].index), s.time0.value = e ? new _(this._model.mainSeries().isDWM()).format(e) : 0, s.price0.value = this._model.mainSeries()._formatter.format(r[0].price)), r[1] && (t = this._model.timeScale().indexToUserTime(r[1].index), s.time1.value = t ? new _(this._model.mainSeries().isDWM()).format(t) : 0, s.price1.value = this._model.mainSeries()._formatter.format(r[1].price)),
            r[2] && (i = this._model.timeScale().indexToUserTime(r[2].index), s.time2.value = i ? new _(this._model.mainSeries().isDWM()).format(i) : 0, s.price2.value = this._model.mainSeries()._formatter.format(r[2].price)), r[3] && (o = this._model.timeScale().indexToUserTime(r[3].index), s.time3.value = o ? new _(this._model.mainSeries().isDWM()).format(o) : 0, s.price3.value = this._model.mainSeries()._formatter.format(r[3].price)), r[4] && (n = this._model.timeScale().indexToUserTime(r[4].index), s.time4.value = t ? new _(this._model.mainSeries().isDWM()).format(n) : 0, s.price4.value = this._model.mainSeries()._formatter.format(r[4].price))
    }, n.prototype.tooltip = function() { return this._updateTooltip(), this._formatTooltip() }, inherit(s, n), inherit(r, o), r.prototype.update = function() { this._invalidated = !0 }, r.prototype.updateImpl = function() {
        var t, e, i, o, n;
        a.prototype.update.call(this), this._source.points().length >= 3 && (t = this._source.points()[0], e = this._source.points()[1], i = this._source.points()[2], this._ABRetracement = Math.round(1e3 * Math.abs((i.price - e.price) / (e.price - t.price))) / 1e3), this._source.points().length >= 4 && (o = this._source.points()[3], this._BCRetracement = Math.round(1e3 * Math.abs((o.price - t.price) / (e.price - t.price))) / 1e3), this._source.points().length >= 5 && (n = this._source.points()[4], this._CDRetracement = Math.round(1e3 * Math.abs((n.price - o.price) / (o.price - i.price))) / 1e3, this._XDRetracement = Math.round(1e3 * Math.abs((n.price - o.price) / (t.price - o.price))) / 1e3)
    }, e.LineTool5PointsPattern = n, e.LineToolCypherPattern = s
}, function(t, e, i) {
    "use strict";

    function o(t, e) { r.call(this, t, e), this._invalidated = !0, this._model = e, this._source = t }

    function n(t, e) {
        this._constructor = "LineToolBrush";
        var i = e || new d("linetoolbrush");
        a.call(this, t, new o(this, t), i), this._finished = !1
    }
    var s = i(2),
        r = i(9),
        a = i(1).LineDataSource,
        l = i(92),
        h = i(68).SelectionRenderer,
        c = i(6),
        d = i(7).DefaultProperty;
    inherit(o, r), o.prototype.update = function() { this._invalidated = !0 }, o.prototype._smoothArray = function(t, e) {
        var i, o, n, r, a, l = Array(t.length);
        for (i = 0; i < t.length; i++) {
            for (o = new s.Point(0, 0), n = 0; n < e; n++) r = Math.max(i - n, 0), a = Math.min(i + n, t.length - 1), o = o.add(t[r]), o = o.add(t[a]);
            l[i] = o.scaled(.5 / e)
        }
        return l.push(t[t.length - 1]), l
    }, o.prototype._updateInternal = function() {
        var t, e, i, o, n, s, a, l, h;
        if (r.prototype.update.call(this), t = Math.max(1, this._source.properties().smooth.value()), e = this._points, 0 !== e.length) {
            for (i = [e[0]], o = 1; o < e.length; o++) {
                for (n = e[o].substract(e[o - 1]), s = n.length(), a = Math.min(5, Math.floor(s / t)), l = n.normalized().scaled(s / a), h = 0; h < a - 1; h++) i.push(e[o - 1].add(l.scaled(h)));
                i.push(e[o])
            }
            this._points = this._smoothArray(i, t)
        }
    }, o.prototype.renderer = function() {
        var t, e, i, o;
        return this._invalidated && (this._updateInternal(), this._invalidated = !1), t = {}, e = this._source.properties(), t.points = this._points, t.color = e.linecolor.value(), t.linewidth = e.linewidth.value(), t.linestyle = e.linestyle.value(), t.skipClosePath = !0, t.leftend = this._source.properties().leftEnd.value(), t.rightend = this._source.properties().rightEnd.value(), e.fillBackground.value() && this._model.lineBeingCreated() !== this._source && (t.filled = !0, t.fillBackground = !0,
            t.backcolor = e.backgroundColor.value(), t.transparency = e.transparency.value()), this.isAnchorsRequired() && this._source.finished() ? (i = new c, i.append(new l(t)), t.points.length > 0 && (o = [t.points[0], t.points[t.points.length - 1]], i.append(new h({ points: o }))), i) : new l(t)
    }, inherit(n, a), n.prototype.pointsCount = function() { return -1 }, n.prototype.finished = function() { return this._finished }, n.prototype.finish = function() { this._finished = !0, this._lastPoint = null, this.normalizePoints(), this.createServerPoints() }, n.prototype.title = function() { return "Brush" }, n.prototype.percentDistance = function(t, e) { return Math.abs((e - t) / t) }, n.prototype.addPoint = function(t) { var e, i, o; return !!this._finished || (this._lastPoint = null, this._points.length > 0 && (e = this._points[this._points.length - 1], i = this.pointToScreenPoint(e)[1], o = this.pointToScreenPoint(t)[1], o.substract(i).length() < 2) ? this._finished : (a.prototype.addPoint.call(this, t), this._finished)) }, n.prototype.restorePoints = function(t, e, i) { a.prototype.restorePoints.call(this, t, e, i), this._finished = !0 }, t.exports = n
}, function(t, e, i) {
    "use strict";

    function o(t, e) { this._data = t, t.lines = this.wordWrap(t.text, t.wordWrapWidth), this._textSizeCache = e }

    function n(t, e) { a.call(this, t, e), this._textSizeCache = {}, this._invalidated = !0 }

    function s(t, e) {
        this._constructor = "LineToolCallout";
        var i = e || new p("linetoolcallout");
        l.call(this, t, new n(this, t), i), this._barOffset = 0, this._timeScale = t.timeScale()
    }
    var r = i(2),
        a = i(9),
        l = i(1).LineDataSource,
        h = i(48).DataSource,
        c = i(8),
        d = i(6),
        p = i(7).DefaultProperty,
        u = i(14);
    o.ROUND_RADIUS = 8, o.TEXT_MARGINS = 2,
        function() {
            function t() {
                var t = document.createElement("canvas");
                t.width = 0, t.height = 0, e = t.getContext("2d"), t = null
            }
            var e;
            o.prototype.wordWrap = function(i, o) {
                var n, s, r, a, l, h, c, d, p;
                if (e || t(), o = +o, i += "", n = i.split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/), n[n.length - 1] || n.pop(), !isFinite(o) || o <= 0) return n;
                for (e.font = this.fontStyle(), s = [], r = 0; r < n.length; r++)
                    if (a = n[r], (l = e.measureText(a).width) <= o) s.push(a);
                    else
                        for (h = a.split(/([-\)\]\},.!?:;])|(\s+)/); h.length;) {
                            if ((c = ~~(o / l * (h.length + 2) / 3)) <= 0 || e.measureText(h.slice(0, 3 * c - 1).join("")).width <= o)
                                for (; e.measureText(h.slice(0, 3 * (c + 1) - 1).join("")).width <= o;) c++;
                            else
                                for (; c > 0 && e.measureText(h.slice(0, 3 * --c - 1).join("")).width > o;);
                            if (c > 0) s.push(h.slice(0, 3 * c - 1).join("")), h.splice(0, 3 * c);
                            else {
                                if (d = h[0] + (h[1] || ""), p = 1 === p ? 1 : ~~(o / e.measureText(d) * d.length), e.measureText(d.substr(0, p)).width <= o)
                                    for (; e.measureText(d.substr(0, p + 1)).width <= o;) p++;
                                else
                                    for (; p > 1 && e.measureText(d.substr(0, --p)).width > o;);
                                p < 1 && (p = 1), s.push(d.substr(0, p)), h[0] = d.substr(p), h[1] = ""
                            }
                            if ((l = e.measureText(h.join("")).width) <= o) { s.push(h.join("")); break }
                        }
                return s
            }
        }(), o.prototype.hitTest = function(t) { var e, i, o, n, s; return this._data.points.length < 2 ? null : (e = this._data.points[0], i = this._data.points[1], o = 3, e.substract(t).length() < o ? new c(c.CHANGEPOINT, 0) : (n = i.x - this._textSizeCache.totalWidth / 2, s = i.y - this._textSizeCache.totalHeight / 2, t.x >= n && t.x <= n + this._textSizeCache.totalWidth && t.y >= s && t.y <= s + this._textSizeCache.totalHeight ? new c(c.MOVEPOINT) : null)) }, o.prototype.fontStyle = function() {
            return (this._data.bold ? "bold " : "") + (this._data.italic ? "italic " : "") + this._data.fontSize + "px " + this._data.font
        }, o.prototype.draw = function(t) {
            var e, i, n, s, r, a, l, h, c, d, p, _, f, m;
            if (!(this._data.points.length < 2)) {
                for (e = this._data.points[0].clone(), i = this._data.points[1].clone(), t.lineCap = "butt", t.strokeStyle = this._data.bordercolor, t.lineWidth = this._data.linewidth, t.textBaseline = "bottom", t.font = this.fontStyle(), n = this._data.fontSize * this._data.lines.length, s = this._data.wordWrapWidth || this._data.lines.reduce(function(e, i) { return Math.max(e, t.measureText(i).width) }, 0), this._textSizeCache.textHeight = n, this._textSizeCache.textHeight = s, r = o.ROUND_RADIUS, a = o.TEXT_MARGINS, l = s + 2 * a + 2 * r, h = n + 2 * a + 2 * r, this._textSizeCache.totalWidth = l, this._textSizeCache.totalHeight = h, c = i.x - l / 2, d = i.y - h / 2, p = 0, _ = s + 2 * a > 2 * r, f = n + 2 * a > 2 * r, e.x > c + l ? p = 20 : e.x > c && (p = 10), e.y > d + h ? p += 2 : e.y > d && (p += 1), t.save(), t.translate(c, d), e.x -= c, e.y -= d, i.x -= c, i.y -= d, t.beginPath(), t.moveTo(r, 0), 10 === p ? _ ? (t.lineTo(i.x - r, 0), t.lineTo(e.x, e.y), t.lineTo(i.x + r, 0), t.lineTo(l - r, 0)) : (t.lineTo(e.x, e.y), t.lineTo(l - r, 0)) : t.lineTo(l - r, 0), 20 === p ? (t.lineTo(e.x, e.y), t.lineTo(l, r)) : t.arcTo(l, 0, l, r, r), 21 === p ? f ? (t.lineTo(l, i.y - r), t.lineTo(e.x, e.y), t.lineTo(l, i.y + r), t.lineTo(l, h - r)) : (t.lineTo(e.x, e.y), t.lineTo(l, h - r)) : t.lineTo(l, h - r), 22 === p ? (t.lineTo(e.x, e.y), t.lineTo(l - r, h)) : t.arcTo(l, h, l - r, h, r), 12 === p ? _ ? (t.lineTo(i.x + r, h), t.lineTo(e.x, e.y), t.lineTo(i.x - r, h), t.lineTo(r, h)) : (t.lineTo(e.x, e.y), t.lineTo(r, h)) : t.lineTo(r, h), 2 === p ? (t.lineTo(e.x, e.y), t.lineTo(0, h - r)) : t.arcTo(0, h, 0, h - r, r), 1 === p ? f ? (t.lineTo(0, i.y + r), t.lineTo(e.x, e.y), t.lineTo(0, i.y - r), t.lineTo(0, r)) : (t.lineTo(e.x, e.y), t.lineTo(0, r)) : t.lineTo(0, r), 0 === p ? (t.lineTo(e.x, e.y), t.lineTo(r, 0)) : t.arcTo(0, 0, r, 0, r), t.stroke(), t.fillStyle = u.generateColor(this._data.backcolor, this._data.transparency), t.fill(), t.fillStyle = this._data.color, d = r + a + this._data.fontSize, c = r + a, m = 0; m < this._data.lines.length; m++) t.fillText(this._data.lines[m], c, d), d += this._data.fontSize;
                t.restore()
            }
        }, inherit(n, a), n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() { a.prototype.update.call(this), this._source._calculatePoint2() }, n.prototype.renderer = function() {
            var t, e, i, n, s, a, l, h;
            return this._invalidated && (this.updateImpl(), this._invalidated = !1), this._points[0] ? this._points.length < 2 ? void 0 : (t = this._source.properties(), e = {}, e.points = [], e.points.push(this._points[0]), i = this._points[1].clone(), i.x = this._points[0].x + this._source._barOffset * this._model.timeScale().barSpacing(), e.points.push(i), e.color = t.color.value(), e.linewidth = t.linewidth.value(), e.backcolor = t.backgroundColor.value(), e.transparency = t.transparency.value(), e.text = t.text.value(), e.font = t.font.value(), e.fontSize = t.fontsize.value(), e.bordercolor = t.bordercolor.value(), t.wordWrap && t.wordWrap.value() && (e.wordWrapWidth = t.wordWrapWidth.value()), e.bold = t.bold && t.bold.value(), e.italic = t.italic && t.italic.value(), n = new o(e, this._textSizeCache), this.isAnchorsRequired() ? (s = new d, s.append(n), a = e.points[1], l = [].concat(e.points), l.splice(l.length - 1, 1), s.append(this.createLineAnchor({ points: l })),
                e.wordWrapWidth && (h = new r.Point(a.x + (e.wordWrapWidth >> 1) + o.ROUND_RADIUS + o.TEXT_MARGINS, a.y), h.data = 1, s.append(this.createLineAnchor({ points: [h] }))), s) : n) : new d
        }, inherit(s, l), s.MIN_WIDTH = 100, s.prototype.pointsCount = function() { return 2 }, s.prototype.title = function() { return "Callout" }, s.prototype.correctPoints = function(t) {
            var e = this._currentMovingPoint.index - this._startMovingPoint.index,
                i = this._currentMovingPoint.price - this._startMovingPoint.price,
                o = t[1];
            o.index += e, o.price += i, t[1] = o
        }, s.prototype.addPoint = function(t) { var e = l.prototype.addPoint.call(this, t); return e && this._calculateBarOffset(), e }, s.prototype._calculateBarOffset = function() { this.points().length > 1 && (this._barOffset = this.points()[1].index - this.points()[0].index) }, s.prototype.setLastPoint = function(t) { l.prototype.setLastPoint.call(this, t), 2 === this.points().length && this._calculateBarOffset() }, s.prototype.setPoint = function(t, e) {
            var i, n, r, a, h;
            switch (t) {
                case 0:
                    l.prototype.setPoint.call(this, t, e), this._calculateBarOffset();
                    break;
                case 1:
                    if (i = this.properties(), !i.wordWrapWidth) return;
                    if (n = this._points, r = this._dragStartLeftEdgeIndex, a = Math.round((e.index - r) / 2), isFinite(r) && isFinite(a)) {
                        if (n[1] = { index: r + a, price: n[1].price }, this._calculateBarOffset(), this.normalizePoints(), h = this._timeScale.indexToCoordinate(r + 2 * a) - this._timeScale.indexToCoordinate(r) - o.ROUND_RADIUS - o.TEXT_MARGINS, !isFinite(h)) return;
                        i.wordWrapWidth.setValue(Math.max(s.MIN_WIDTH, h));
                        break
                    }
                    n[1] = e, this._calculateBarOffset(), this.normalizePoints()
            }
        }, s.prototype.startDragPoint = function(t, e) {
            var i = this.properties();
            1 === t && i.wordWrap && i.wordWrap.value() && (this._dragStartLeftEdgeIndex = 2 * this.points()[1].index - e.index)
        }, s.prototype.move = function(t) { l.prototype.move.call(this, t), this._calculateBarOffset() }, s.prototype.state = function(t) { var e = l.prototype.state.call(this, t); return e.barOffset = this._barOffset, e }, s.prototype.restoreData = function(t) { t.barOffset ? this._barOffset = t.barOffset : this._calculateBarOffset(), this._calculatePoint2() }, s.prototype.setPriceScale = function(t) { h.prototype.setPriceScale.call(this, t), t && t.priceRange() && this._calculatePoint2() }, s.prototype._calculatePoint2 = function() {
            var t, e;
            this._model.lineBeingEdited() !== this && this._model.sourceBeingMoved() !== this && (this._points.length < 2 || (t = this.points()[0], e = this.points()[1], this._points[1] = { price: e.price, index: t.index + this._barOffset }))
        }, t.exports = s
}, 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(2),
            h = i(9),
            c = i(1).LineDataSource,
            d = i(197),
            p = i(8),
            u = i(7).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(), !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() { 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), !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(3))
}, function(t, e, i) {
    "use strict";

    function o() { d.call(this) }

    function n(t, e, i) { this._data = t, this._hittest = e || new _(_.MOVEPOINT), this._backHittest = i || new _(_.MOVEPOINT_BACKGROUND) }

    function s(t, e) { l.call(this, t, e), this._rendererCache = {}, this._invalidated = !0, this._numericFormatter = new m }

    function r(t, e) {
        this._constructor = "LineToolFibCircles";
        var i = e || this.createPropertiesObject("linetoolfibcircles");
        h.call(this, t, new s(this, t), i), t._fibCirclesLabelsCache || (t._fibCirclesLabelsCache = new o)
    }
    var a = i(2),
        l = i(9),
        h = i(1).LineDataSource,
        c = i(23),
        d = i(88),
        p = i(11).TrendLineRenderer,
        u = i(91),
        _ = i(8),
        f = i(6),
        m = i(26).NumericFormatter,
        g = i(14);
    inherit(o, d), o.prototype.levelsCount = function() { return r.LevelsCount }, n.prototype.draw = function(t) {
        var e, i, o, n, s, r, a, l;
        t.lineCap = "butt", t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, t.lineStyle = this._data.linestyle, e = this._data.points[0], i = this._data.points[1], o = Math.abs(e.x - i.x), n = Math.abs(e.y - i.y), s = e.add(i).scaled(.5), o < 1 || n < 1 || (this._data.wholePoints && (a = this._data.wholePoints[0], l = this._data.wholePoints[1], r = Math.abs(a.x - l.x)), t.save(), t.translate(s.x, s.y), t.scale(1, n / o), t.beginPath(), t.arc(0, 0, o / 2, 0, 2 * Math.PI, !1), t.restore(), t.stroke(),
            this._data.fillBackground && (this._data.wholePoints && (t.translate(s.x, s.y), t.scale(1, n / o), t.arc(0, 0, r / 2, 0, 2 * Math.PI, !0)), t.fillStyle = g.generateColor(this._data.backcolor, this._data.transparency, !0), t.fill()))
    }, n.prototype.hitTest = function(t) { var e, i, o, n, s, r, l, h, c, d, p; return this._data.points.length < 2 ? null : (e = this._data.points[0], i = this._data.points[1], o = .5 * Math.abs(e.x - i.x), n = Math.abs(e.x - i.x), s = Math.abs(e.y - i.y), r = e.add(i).scaled(.5), l = t.substract(r), n < 1 || s < 1 ? null : (h = (i.y - e.y) / (i.x - e.x), l.y /= h, c = l.x * l.x + l.y * l.y, d = c - o * o, d = a.sign(d) * Math.sqrt(Math.abs(d / o)), p = 3, Math.abs(d) < p ? this._hittest : this._data.fillBackground && !this._data.noHitTestOnBackground && d < p ? this._backHittest : null)) }, inherit(s, l), s.prototype.update = function() { this._invalidated = !0 }, s.prototype._updateImpl = function() {
        var t, e, i, o, n, s, h, c, d, p, u, _;
        if (l.prototype.update.call(this), this._cacheState = this._model._fibCirclesLabelsCache.updateSource(this._source), !(this._source.points().length < 2) && this._source.priceScale() && !this._source.priceScale().isEmpty() && !this._model.timeScale().isEmpty())
            for (t = this._points[0], e = this._points[1], this._center = t.add(e).scaled(.5), i = Math.abs(e.x - t.x), o = Math.abs(e.y - t.y), this._levels = [], n = this._source.properties(), s = 1; s <= r.LevelsCount; s++) h = "level" + s, c = n[h], c.visible.value() && (d = c.coeff.value(), p = c.color.value(), u = [], u.push(new a.Point(this._center.x - .5 * i * d, this._center.y - .5 * o * d)), u.push(new a.Point(this._center.x + .5 * i * d, this._center.y + .5 * o * d)), _ = new a.Point(this._center.x, this._center.y + .5 * o * d), this._levels.push({ color: p, points: u, labelPoint: _, linewidth: c.linewidth.value(), linestyle: c.linestyle.value(), index: s }))
    }, s.prototype.renderer = function() {
        var t, e, i, o, s, r, a, l, c, d, m, g, v, y, b;
        if (this._invalidated && (this._updateImpl(), this._invalidated = !1), t = new f, this._points.length < 2) return t;
        for (e = this._source.properties(), i = e.fillBackground.value(), o = e.transparency.value(), s = this._model._fibCirclesLabelsCache, r = s.canvas().get(0), a = 0; a < this._levels.length; a++)
            if (l = this._levels[a], c = {}, c.points = l.points, c.color = l.color, c.linewidth = l.linewidth, c.backcolor = l.color, a > 0 && (c.wholePoints = this._levels[a - 1].points), c.fillBackground = i, c.transparency = o, d = new _(_.MOVEPOINT, null, l.index), t.append(new n(c, d)), e.showCoeffs.value()) {
                if (!(m = this._cacheState.preparedCells.cells[this._levels[a].index - 1])) continue;
                g = { left: m.left, top: s.topByRow(this._cacheState.row), width: m.width, height: s.rowHeight(this._cacheState.row) }, v = { left: Math.round(l.labelPoint.x - g.width), top: Math.round(l.labelPoint.y - g.height / 2), width: m.width, height: g.height }, y = new u(r, g, v), t.append(y)
            }
        return e.trendline.visible.value() && (b = { 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: h.LINEEND_NORMAL, rightend: h.LINEEND_NORMAL }, t.append(new p(b))), this.addAnchors(t), t
    }, inherit(r, h), r.LevelsCount = 11, r.prototype.pointsCount = function() { return 2 }, r.prototype.title = function() {
        return "Fib Circles"
    }, r.prototype.processErase = function(t, e) {
        var i = "level" + e,
            o = this.properties()[i].visible;
        t.setProperty(o, !1, "Erase level line")
    }, r.prototype.createPropertiesObject = function(t, e, i) { return new c(t, e, i, { range: [1, 11] }) }, e.EllipseRendererSimple = n, e.LineToolFibCircles = r
}, function(t, e, i) {
    "use strict";

    function o() { h.call(this) }

    function n(t, e) { d.call(this, t, e), this._rendererCache = {}, this._invalidated = !0 }

    function s(t, e) {
        this._constructor = "LineToolFibRetracement";
        var i = e || this.createPropertiesObject("linetoolfibretracement");
        c.call(this, t, new n(this, t), i), this.version = s.version, this._properties._stateVersion = 1, t._fibRetracementLabelsCache || (t._fibRetracementLabelsCache = new o)
    }
    var r = i(2),
        a = i(23),
        l = i(45).RectangleTransparencyRenderer,
        h = i(88),
        c = i(1).LineDataSource,
        d = i(9),
        p = i(11).TrendLineRenderer,
        u = i(91),
        _ = i(8),
        f = i(6);
    inherit(o, h), o.prototype.levelsCount = function() { return s.LevelsCount }, inherit(n, d), n.prototype.update = function() { this._invalidated = !0 }, n.prototype._updateImpl = function() {
        var t, e, i, o, n, r, a, l, h, c, p, u, _, f;
        if (d.prototype.update.call(this), this._cacheState = this._model._fibRetracementLabelsCache.updateSource(this._source), !(this._source.points().length < 2) && this._source.priceScale() && !this._source.priceScale().isEmpty() && !this._model.timeScale().isEmpty() && (t = this._source.points()[0], e = this._source.points()[1], i = !1, o = this._source.properties(), o.reverse && o.reverse.value() && (i = o.reverse.value()), this._levels = [], n = i ? e.price - t.price : t.price - e.price, r = i ? t.price : e.price, !this._source.priceScale().isPercent() || null !== (a = this._source.ownerSource().firstValue())))
            for (l = 1; l <= s.LevelsCount; l++) h = "level" + l, c = o[h], c.visible.value() && (p = c.coeff.value(), u = c.color.value(), _ = r + p * n, this._source.priceScale().isPercent() && (_ = this._source.priceScale().priceRange().convertToPercent(_, a)), f = this._source.priceScale().priceToCoordinate(_), this._levels.push({ color: u, y: f, linewidth: o.levelsStyle.linewidth.value(), linestyle: o.levelsStyle.linestyle.value(), index: l }))
    }, n.prototype.renderer = function() {
        var t, e, i, o, n, s, a, h, d, m, g, v, y, b, w, S, T, C, x, P, L, k;
        if (this._invalidated && (this._updateImpl(), this._invalidated = !1), t = new f, this._points.length < 2) return t;
        for (e = this._points[0], i = this._points[1], o = Math.min(e.x, i.x), n = Math.max(e.x, i.x), s = this._source.properties(), a = s.fillBackground.value(), h = s.transparency.value(), d = s.extendLines.value() ? this._model.timeScale().width() : n, m = this._model._fibRetracementLabelsCache, g = m.canvas().get(0), v = 0; v < this._levels.length; v++)
            if (v > 0 && a && (y = this._levels[v - 1], e = new r.Point(o, this._levels[v].y), i = new r.Point(d, y.y), b = {}, b.points = [e, i], b.color = this._levels[v].color, b.linewidth = 0, b.backcolor = this._levels[v].color, b.fillBackground = !0, b.transparency = h, t.append(new l(b))), e = new r.Point(o, this._levels[v].y), i = new r.Point(n, this._levels[v].y), w = {
                    points: [e, i],
                    width: this._model.timeScale().width(),
                    height: this._source.priceScale().height(),
                    color: this._levels[v].color,
                    linewidth: this._levels[v].linewidth,
                    linestyle: this._levels[v].linestyle,
                    extendleft: !1,
                    extendright: s.extendLines.value(),
                    leftend: c.LINEEND_NORMAL,
                    rightend: c.LINEEND_NORMAL
                }, S = new _(_.MOVEPOINT, null, this._levels[v].index), t.append(new p(w, S)), s.showCoeffs.value() || s.showPrices.value()) {
                if (!this._cacheState.preparedCells) continue;
                if (!(T = this._cacheState.preparedCells.cells[this._levels[v].index - 1])) continue;
                switch (s.horzLabelsAlign.value()) {
                    case "left":
                        C = e;
                        break;
                    case "center":
                        C = e.add(i).scaled(.5), C.x += T.width / 2, C.x = Math.round(C.x);
                        break;
                    case "right":
                        s.extendLines.value() ? C = new r.Point(d - 4, this._levels[v].y) : (C = new r.Point(d + 4, this._levels[v].y), C.x += T.width, C.x = Math.round(C.x))
                }
                x = { left: T.left, top: m.topByRow(this._cacheState.row), width: T.width, height: m.rowHeight(this._cacheState.row) }, P = { left: C.x - x.width, top: C.y, width: T.width, height: x.height }, L = s.vertLabelsAlign.value(), "middle" === L && (P.top -= P.height / 2), "bottom" === L && (P.top -= P.height), k = new u(g, x, P), t.append(k)
            }
        return s.trendline.visible.value() && (w = { points: [this._points[0], this._points[1]], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: s.trendline.color.value(), linewidth: s.trendline.linewidth.value(), linestyle: s.trendline.linestyle.value(), extendleft: !1, extendright: !1, leftend: c.LINEEND_NORMAL, rightend: c.LINEEND_NORMAL }, t.append(new p(w))), this.addAnchors(t), t
    }, inherit(s, c), s.version = 2, s.LevelsCount = 24, s.prototype.stop = function() { c.prototype.stop.call(this), this._model._fibRetracementLabelsCache.removeSource(this.id()) }, s.prototype.pointsCount = function() { return 2 }, s.prototype.title = function() { return "Fib Retracement" }, s.prototype.migrateVersion = function(t, e, i) { 1 === t && this.properties().extendLines.setValue(!0) }, s.prototype.processErase = function(t, e) {
        var i = "level" + e,
            o = this.properties()[i].visible;
        t.setProperty(o, !1, "Erase level line")
    }, s.prototype.createPropertiesObject = function(t, e, i) { return new a(t, e, i, { range: [1, 24], names: ["coeff", "color", "visible"] }) }, t.exports = s
}, function(t, e, i) {
    "use strict";

    function o() { d.call(this) }

    function n(t, e, i) { this._data = t, this._hittest = e || new _(_.MOVEPOINT), this._backHittest = i || new _(_.MOVEPOINT_BACKGROUND), this._rendererCache = {} }

    function s(t, e) { h.call(this, t, e), this._rendererCache = {}, this._levels = [], this._invalidated = !0 }

    function r(t, e) {
        this._constructor = "LineToolFibSpeedResistanceArcs";
        var i = e || this.createPropertiesObject("linetoolfibwedge");
        l.call(this, t, new s(this, t), i), t._fibWedgeLabelsCache || (t._fibWedgeLabelsCache = new o)
    }
    var a = i(2),
        l = i(1).LineDataSource,
        h = i(9),
        c = i(23),
        d = i(88),
        p = i(11).TrendLineRenderer,
        u = i(91),
        _ = i(8),
        f = i(6),
        m = i(14);
    inherit(o, d), o.prototype.levelsCount = function() { return r.LevelsCount }, n.prototype.draw = function(t) {
        if (t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, t.beginPath(), t.arc(this._data.center.x, this._data.center.y, this._data.radius, this._data.edge1, this._data.edge2, !0), t.stroke(), this._data.fillBackground) {
            if (t.arc(this._data.center.x, this._data.center.y, this._data.prevRadius, this._data.edge2, this._data.edge1, !1), this._data.gradient) {
                var e = t.createRadialGradient(this._data.center.x, this._data.center.y, this._data.prevRadius, this._data.center.x, this._data.center.y, this._data.radius);
                e.addColorStop(0, m.generateColor(this._data.color1, this._data.transparency)), e.addColorStop(1, m.generateColor(this._data.color2, this._data.transparency)), t.fillStyle = e
            } else t.fillStyle = m.generateColor(this._data.color, this._data.transparency, !0);
            t.fill()
        }
    }, n.prototype.hitTest = function(t) { var e, i, o, n, s, r, a, l, h, c = t.substract(this._data.center).length(); return Math.abs(c - this._data.radius) <= 4 && (e = t.substract(this._data.p1).length(), i = t.substract(this._data.p2).length(), o = Math.max(e, i), n = this._data.p1.substract(this._data.p2).length(), o <= n) ? this._hittest : this._data.fillBackground && c <= this._data.radius && (s = this._data.p1.substract(this._data.center).normalized(), r = this._data.p2.substract(this._data.center).normalized(), c = t.substract(this._data.center).normalized(), a = s.dotProduct(r), l = c.dotProduct(s), h = c.dotProduct(r), l >= a && h >= a) ? this._backHittest : null }, inherit(s, h), s.prototype.update = function() { this._invalidated = !0 }, s.prototype._updateImpl = function() {
        var t, e, i, o, n, s, r, l, c, d, p, u, _, f, m, g, v, y, b;
        if (h.prototype.update.call(this), this._cacheState = this._source.getCache().updateSource(this._source), this._levels = [], !(this._points.length < 3))
            for (t = this._points, e = t[0], i = t[1], o = t[2], n = i.substract(e).normalized(), s = o.substract(e).normalized(), r = new a.Point(1, 0), l = new a.Point(0, 1), c = Math.acos(n.dotProduct(r)), n.dotProduct(l) < 0 && (c = 2 * Math.PI - c), this._edge1 = c, d = Math.acos(s.dotProduct(r)), s.dotProduct(l) < 0 && (d = 2 * Math.PI - d), this._edge2 = d, c < d && (this._edge1 = Math.max(c, d), this._edge2 = Math.min(c, d) + 2 * Math.PI), Math.abs(c - d) > Math.PI && (this._edge1 = Math.min(c, d), this._edge2 = Math.max(c, d) - 2 * Math.PI), p = this._source.properties(), u = 1; u <= this._source.getCache().levelsCount(); u++) _ = "level" + u, f = p[_], f.visible.value() && (m = f.coeff.value(), g = f.color.value(), v = i.substract(e).length() * m, y = n.add(s).scaled(.5).normalized().scaled(v), b = e.add(y), this._levels.push({ coeff: m, color: g, radius: v, labelPoint: b, p1: e.add(n.scaled(v)), p2: e.add(s.scaled(v)), linewidth: f.linewidth.value(), linestyle: f.linestyle.value(), index: u }))
    }, s.prototype.renderer = function() {
        var t, e, i, o, s, r, a, h, c, d, m, g, v, y, b, w, S, T, C, x;
        if (this._invalidated && (this._updateImpl(), this._invalidated = !1), t = new f, this._points.length < 2) return t;
        if (e = this._source.properties(), i = this._points, o = i[0], s = i[1], r = { points: [o, s], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: e.trendline.color.value(), linewidth: e.trendline.visible.value() ? e.trendline.linewidth.value() : 0, linestyle: e.trendline.linestyle.value(), extendleft: !1, extendright: !1, leftend: l.LINEEND_NORMAL, rightend: l.LINEEND_NORMAL }, t.append(new p(r)), this._points.length < 3) return this.addAnchors(t), t;
        for (a = i[2], h = a.data, c = s.substract(o).length(), d = a.substract(o).normalized(), a = o.add(d.scaled(c)), a.data = h, r = { points: [o, a], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: e.trendline.color.value(), linewidth: e.trendline.visible.value() ? e.trendline.linewidth.value() : 0, linestyle: e.trendline.linestyle.value(), extendleft: !1, extendright: !1, leftend: l.LINEEND_NORMAL, rightend: l.LINEEND_NORMAL },
            t.append(new p(r)), m = this._model._fibWedgeLabelsCache, g = m.canvas().get(0), v = this._levels.length - 1; v >= 0; v--)
            if (y = this._levels[v], b = {}, b.center = this._points[0], b.radius = y.radius, b.prevRadius = v > 0 ? this._levels[v - 1].radius : 0, b.edge = this._edge, b.color = y.color, b.linewidth = y.linewidth, b.edge1 = this._edge1, b.edge2 = this._edge2, b.p1 = y.p1, b.p2 = y.p2, b.fillBackground = e.fillBackground.value(), b.transparency = e.transparency.value(), w = new _(_.MOVEPOINT, null, y.index), t.append(new n(b, w)), e.showCoeffs.value()) {
                if (!(S = this._cacheState.preparedCells.cells[this._levels[v].index - 1])) continue;
                T = { left: S.left, top: m.topByRow(this._cacheState.row), width: S.width, height: m.rowHeight(this._cacheState.row) }, C = { left: Math.round(y.labelPoint.x - T.width), top: Math.round(y.labelPoint.y - T.height / 2), width: S.width, height: T.height }, x = new u(g, T, C), t.append(x)
            }
        return this.isAnchorsRequired() && (i = [o, s], this._model.lineBeingCreated() !== this._source && i.push(a), t.append(this.createLineAnchor({ points: i }))), t
    }, inherit(r, l), r.LevelsCount = 11, r.prototype.getCache = function() { return this._model._fibWedgeLabelsCache || (this._model._fibWedgeLabelsCache = new o), this._model._fibWedgeLabelsCache }, r.prototype.pointsCount = function() { return 3 }, r.prototype.title = function() { return "Fib Wedge" }, r.prototype.setPoint = function(t, e) {
        var i, o, n, s, r, a, h;
        l.prototype.setPoint.call(this, t, e), this._recursiveGuard || (this._recursiveGuard = !0, 2 === t ? (i = this.pointToScreenPoint(this._points[0])[0], o = this.pointToScreenPoint(this._points[1])[0], n = this.pointToScreenPoint(this._points[2])[0], s = n.substract(i).length(), r = o.substract(i).normalized(), o = i.add(r.scaled(s)), a = this.screenPointToPoint(o), this._properties.points[1].price.setValue(a.price), this._properties.points[1].bar.setValue(a.index)) : (i = this.pointToScreenPoint(this._points[0])[0], o = this.pointToScreenPoint(this._points[1])[0], n = this.pointToScreenPoint(this._points[2])[0], h = o.substract(i).length(), r = n.substract(i).normalized(), n = i.add(r.scaled(h)), a = this.screenPointToPoint(n), this._properties.points[2].price.setValue(a.price), this._properties.points[2].bar.setValue(a.index)), this._recursiveGuard = !1)
    }, r.prototype.addPoint = function(t) { var e, i, o, n, s, r, a, h; return 2 === this._points.length && (e = this.pointToScreenPoint(this._points[0])[0], i = this.pointToScreenPoint(this._points[1])[0], this.priceScale().isPercent() && (o = this.ownerSource().firstValue(), t.price = this.priceScale().priceRange().convertFromPercent(t.price, o)), n = this.pointToScreenPoint(t)[0], s = i.substract(e).length(), r = n.substract(e).normalized(), n = e.add(r.scaled(s)), a = this.priceScale().coordinateToPrice(n.y), h = Math.round(this._model.timeScale().coordinateToIndex(n.x)), t = { index: h, price: a }), l.prototype.addPoint.call(this, t) }, r.prototype.processErase = function(t, e) {
        var i = "level" + e,
            o = this.properties()[i].visible;
        t.setProperty(o, !1, "Erase level line")
    }, r.prototype.createPropertiesObject = function(t, e, i) { return new c(t, e, i, { range: [1, 11] }) }, e.ArcWedgeRenderer = n, e.FibWedgePaneView = s, e.LineToolFibWedge = r
}, function(t, e, i) {
    "use strict";

    function o(t, e) { h.call(this, t, e), this._invalidated = !0 }

    function n(t, e, i) {
        this._source = t, this._index = e, this._bars = i || []
    }

    function s(t, e, i) { this._source = t, _.call(this, "linetoolghostfeed", e, i) }

    function r(t, e, i) {
        var n, a;
        this._constructor = "LineToolGhostFeed", e ? (n = e, n._source = this) : n = new s(this), i || (a = Math.round(t.mainSeries().data().calculateATR()), n.averageHL.setValue(a)), l.call(this, t, new o(this, t), n), this._segments = [], n.averageHL.listeners().subscribe(this, r.prototype.regenerate), n.variance.listeners().subscribe(this, r.prototype.regenerate), n.points || n.addProperty("points"), this._currentAverageHL = this._properties.averageHL.value(), this._currentVariance = this._properties.variance.value(), this._currentInterval = t.mainSeries().interval()
    }
    var a = i(2),
        l = i(1).LineDataSource,
        h = i(9),
        c = i(11).TrendLineRenderer,
        d = i(8),
        p = i(59).PaneRendererCandles,
        u = i(6),
        _ = i(7).DefaultProperty;
    inherit(o, h), o.prototype.update = function() { h.prototype.update.call(this), this._invalidated = !0 }, o.prototype.udpateImpl = function() {
            var t = this;
            this._segments = [], t._points.length < 2 || (this._segments = this._source.segments().map(function(e, i) { var o, n, s, r, l, h, c, d, p, u, _, f = t._source.points(); return i >= t._points.length - 1 ? null : (o = t._points[i].x, n = f[i].price, s = f[i + 1].price, r = f[i + 1].index - f[i].index, l = t._model.timeScale().barSpacing() * a.sign(r), h = (s - n) / (e.bars().length - 1), c = t._source.properties(), d = c.candleStyle.upColor.value(), p = c.candleStyle.downColor.value(), u = c.candleStyle.borderUpColor.value(), _ = c.candleStyle.borderDownColor.value(), { bars: e.bars().map(function(e, i) { var s = e.c >= e.o; return { time: o + i * l, open: t.priceToCoordinate(e.o + n + i * h), high: t.priceToCoordinate(e.h + n + i * h), low: t.priceToCoordinate(e.l + n + i * h), close: t.priceToCoordinate(e.c + n + i * h), color: s ? d : p, borderColor: s ? u : _, hollow: !1 } }) }) }).filter(function(t) { return !!t }))
        }, o.prototype.renderer = function() { var t, e, i, o, n, s, r, a, h, _, f, m, g; for (this._invalidated && (this.udpateImpl(), this._invalidated = !1), t = new u, e = 1; e < this._points.length; e++) i = this._points[e - 1], o = this._points[e], n = { points: [i, o], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: "#808080", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID, extendleft: !1, extendright: !1, leftend: l.LINEEND_NORMAL, rightend: l.LINEEND_NORMAL }, s = new d(d.MOVEPOINT, null), t.append(new c(n, s)); for (r = this._source.properties(), a = r.candleStyle.drawWick.value(), h = r.candleStyle.drawBorder.value(), _ = r.candleStyle.borderColor.value(), f = r.candleStyle.wickColor.value(), m = new u, m.setGlobalAlpha(1 - r.transparency.value() / 100), e = 0; e < this._segments.length; e++) g = { bars: this._segments[e].bars, barSpacing: this._model.timeScale().barSpacing(), drawWick: a, drawBorder: h, borderColor: _, wickColor: f, hittest: new d(d.MOVEPOINT, null) }, m.append(new p(g)); return t.append(m), this.addAnchors(t), t }, n.prototype.setBars = function(t) { this._bars = t || [] }, n.prototype.clone = function(t) { return new n(t, this._index, TradingView.clone(this._bars)) }, n.prototype.createBar = function() {
            var t, e, i, o, n, s = this._source.properties().averageHL.value(),
                r = this._source.properties().variance.value() / 100,
                a = this._source._model.mainSeries().base(),
                l = Math.random(),
                h = s * (1 - 2 * l) * r;
            return l = Math.random(),
                t = s * (1 + (.5 - l) * r), e = h - t / 2, i = e + t, o = e + Math.random() * t, n = e + Math.random() * t, { o: o / a, h: i / a, l: e / a, c: n / a }
        }, n.prototype.generate = function() {
            var t, e, i, o, n, s;
            if (this._bars = [], t = this._source.points(), e = t[this._index], i = t[this._index + 1], e && i && e.index !== i.index)
                for (this._avgHL = this._source.properties().averageHL.value(), this._variance = this._source.properties().variance.value() / 100, o = this._index ? e.index + 1 : e.index, n = a.sign(i.index - e.index), s = o; s !== i.index; s += n) this._bars.push(this.createBar())
        }, n.prototype.bars = function() { return this._bars }, n.prototype.setSize = function(t) {
            if (t < this._bars.length) this._bars.splice(t, this._bars.length - t);
            else
                for (; this._bars.length < t;) this._bars.push(this.createBar())
        }, inherit(s, _), s.prototype.restoreFactoryDefaults = function() {
            var t, e;
            _.prototype.restoreFactoryDefaults.call(this), t = this._source._model, e = Math.round(t.mainSeries().data().calculateATR()), this.averageHL.setValue(e)
        }, inherit(r, l), r.prototype.createPropertiesObject = function(t, e, i) { return new s(null, e, i) }, r.prototype.regenerate = function() { this._currentAverageHL = this._properties.averageHL.value(), this._currentVariance = this._properties.variance.value(), this._segments.forEach(function(t) { t.generate() }), this.updateAllViews(), this._model.updateSource(this) }, r.prototype.propertiesChanged = function() { l.prototype.propertiesChanged.call(this), this._currentAverageHL === this._properties.averageHL.value() && this._currentVariance === this._properties.variance.value() || this.regenerate() }, r.prototype.pointsCount = function() { return -1 }, r.prototype.title = function() { return "Ghost Feed" }, r.prototype.segmentBars = function(t) { return this._segments[t].bars() }, r.prototype.segments = function() { return this._segments }, r.prototype.generateBars = function(t) { this._segments.length <= t && this._segments.push(new n(this, t)), this._segments[t].generate() }, r.prototype.addPoint = function(t) { var e, i, o; if (this._points.length > 0 && (e = this._points[this._points.length - 1], e.index === t.index)) { for (this._lastPoint = null, this.normalizePoints(), this.createServerPoints(), i = 0; i < this._points.length; i++) this._createPointProperty(i); return !0 } return o = l.prototype.addPoint.call(this, t), this._finished && (this._lastPoint = null), this._points.length > 1 && this.generateBars(this._points.length - 2), o || this._finished }, r.prototype.finish = function() { this._finished = !0, this._lastPoint = null, this.normalizePoints(), this.createServerPoints() }, r.prototype.setPoint = function(t, e, i) {
            var o, n, s;
            l.prototype.setPoint.call(this, t, e, i), t > 0 && (o = this.points()[t - 1], n = e.index - o.index, this._segments[t - 1].setSize(Math.abs(n))), t < this.points().length - 1 && (s = this.points()[t + 1], n = s.index - e.index, this._segments[t].setSize(Math.abs(n)))
        }, r.prototype.state = function(t) { var e = l.prototype.state.call(this, t); return e.segments = this._segments.map(function(t) { return { bars: t.bars() } }), e }, r.prototype.restoreData = function(t) {
            var e = this;
            t.segments && (this._segments = t.segments.map(function(t, i) { return new n(e, i, [].concat(t.bars)) })), this._currentAverageHL = this._properties.averageHL.value(), this._currentVariance = this._properties.variance.value()
        },
        r.prototype.onData = function(t) {
            if (l.prototype.onData.call(this, t), 0 === this.properties().points._childs.length)
                for (var e = 0; e < this._points.length; e++) this._createPointProperty(e);
            this._currentInterval !== this._model.mainSeries().interval() && (this.regenerate(), this._currentInterval = this._model.mainSeries().interval())
        }, r.prototype.cloneData = function(t) {
            var e = this;
            this._segments = t._segments.map(function(t) { return t.clone(e) })
        }, t.exports = r
}, 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(2),
            a = i(9),
            l = i(1).LineDataSource,
            h = i(11),
            c = h.TrendLineStatsRenderer,
            d = h.LineToolTrendLine,
            p = i(16).TextRenderer,
            u = i(11).TrendLineRenderer,
            _ = i(6),
            f = i(7).DefaultProperty,
            m = i(70).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), 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))), !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(24))
}, 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 = [], 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(203).ExecutionsPositionController,
            r = i(1).LineDataSource,
            a = i(48).PriceDataSource,
            l = i(12).getLogger("Chart.Pane"),
            h = i(210);
        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 }, 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), 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) {
                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
            }, 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(24), i(15))
}, 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), 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(2),
            h = i(305),
            c = i(1).LineDataSource,
            d = i(48).PriceDataSource,
            p = i(43),
            u = i(27).PriceFormatter,
            _ = i(70).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, 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() { 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), 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(209),
                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) }, 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), 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 = Math.max(0, 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], 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(15), i(107))
}, 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(104);
    inherit(o, a), o.prototype.pointsCount = function() { return 1 }, o.prototype._studyInputs = function() { var t, e, i = this.points(); return i.length < this.pointsCount() ? null : (t = i[0].index, e = this._model.mainSeries().bars().valueAt(t), 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() { this._text = "", this._background = "#585858", this._coordinate = 0 }
    var n = i(37),
        s = n.parseRgb,
        r = n.rgbToBlackWhiteString;
    o.prototype.text = function() { return this._text }, o.prototype.background = function() { return this._background }, o.prototype.color = function() { return r(s(this._background)) }, o.prototype.coordinate = function() { return this._coordinate }, t.exports = o
}, function(t, e) {
    "use strict";

    function i(t) { this._data = t }
    i.prototype.draw = function(t, e) { var i, o, n, s, r, a, l, h, c, d, p, u, _, f, m, g;!1 !== this._data.visible && (t.font = e.font, i = e.paddingHorizontal, (o = e.widthCache.measureText(t, this._data.text)) <= 0 || (n = o + 2 * i, s = Math.floor(this._data.coordinate - n / 2) + .5, r = s, a = r + n, l = a, h = Math.round(this._data.coordinate + 1), c = h, d = .5, p = d + e.borderSize + e.tickLength + e.paddingTop + e.fontSize + e.paddingBottom, u = p, _ = d, f = _, m = f + e.borderSize + e.tickLength, g = p - e.baselineOffset - e.paddingBottom, t.fillStyle = this._data.background, t.lineWidth = 1, t.beginPath(), t.strokeStyle = this._data.color, t.moveTo(s, d), t.lineTo(r, p), t.lineTo(a, u), t.lineTo(l, _), t.fill(), t.beginPath(), t.moveTo(h, f), t.lineTo(c, m), t.stroke(), t.textAlign = "left", t.fillStyle = this._data.color, t.fillText(this._data.text, s + i, g))) }, t.exports = i
}, function(t, e, i) {
    "use strict";
    var o = i(216).TVLocalStorage;
    i(284), TradingView.FeatureToggle = { force_prefix: "forcefeaturetoggle.", enableFeature: function(t) { o.setItem(this.force_prefix + t, "true") }, disableFeature: function(t) { o.removeItem(this.force_prefix + t) } }, TradingView.isFeatureEnabled = function(t) {
        function e(e) { return o.setItem(n + e, Math.random() <= t[e]), o.getItem(n + e) }

        function i(t) { return -1 === ["black_friday", "black_friday_popup", "ios_app_info", "symbol_search_server_highlight", "address-autocomplete-google-key"].indexOf(t) && -1 === t.indexOf("-maintenance") }
        var n = "featuretoggle.";
        return function(s) { var r, a; return !(!r && "local" !== window.environment || !i(s)) || (!t[s] || -1 !== t[s]) && (!!("true" === o.getItem(TradingView.FeatureToggle.force_prefix + s) || window.is_authenticated && "undefined" != typeof user && user && user.settings && user.settings[TradingView.FeatureToggle.force_prefix + s]) || !!t[s] && (1 === t[s] || (a = o.getItem(n + s), void 0 === a || null === a ? e(s) : "true" === a))) }
    }(window.featureToggleState || {}), e.FeatureToggle = TradingView.FeatureToggle, e.isFeatureEnabled = TradingView.isFeatureEnabled
}, function(t, e, i) {
    "use strict";

    function o() {}
    var n = i(36).Interval,
        s = i(72);
    o.isAvailable = function(t) {
        var e, i = s.supportedResolutions.value(),
            o = !1;
        return o = void 0 === i || -1 !== i.indexOf(t), e = s.intraday.value(), e ? o : n.isDWM(t) && o
    }, t.exports = o
}, 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.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) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17), i(28), e.lineToolsInfo = {
        LineTool5PointsPattern: { icon: i(760), localizedName: $.t("XABCD Pattern") },
        LineToolABCD: { icon: i(761), localizedName: $.t("ABCD Pattern") },
        LineToolArc: { icon: i(762), localizedName: $.t("Arc") },
        LineToolArrow: { icon: i(763), localizedName: $.t("Arrow") },
        LineToolArrowMarkDown: { icon: i(764), localizedName: $.t("Arrow Mark Down") },
        LineToolArrowMarkLeft: { icon: i(765), localizedName: $.t("Arrow Mark Left") },
        LineToolArrowMarkRight: { icon: i(766), localizedName: $.t("Arrow Mark Right") },
        LineToolArrowMarkUp: { icon: i(767), localizedName: $.t("Arrow Mark Up") },
        LineToolBalloon: { icon: i(768), localizedName: $.t("Balloon") },
        LineToolBarsPattern: { icon: i(769), localizedName: $.t("Bars Pattern") },
        LineToolBezierCubic: { icon: i(770), localizedName: $.t("Double Curve") },
        LineToolBezierQuadro: { icon: i(771), localizedName: $.t("Curve") },
        LineToolBrush: { icon: i(772), localizedName: $.t("Brush") },
        LineToolCallout: { icon: i(773), localizedName: $.t("Callout") },
        LineToolCircleLines: { icon: i(774), localizedName: $.t("Cyclic Lines") },
        LineToolCypherPattern: { icon: i(775), localizedName: $.t("Cypher Pattern") },
        LineToolDateAndPriceRange: { icon: i(776), localizedName: $.t("Date and Price Range") },
        LineToolDateRange: { icon: i(777), localizedName: $.t("Date Range") },
        LineToolDisjointAngle: { icon: i(778), localizedName: $.t("Disjoint Angle") },
        LineToolElliottCorrection: { icon: i(779), localizedName: $.t("Elliott Correction Wave (ABC)") },
        LineToolElliottDoubleCombo: { icon: i(780), localizedName: $.t("Elliott Double Combo Wave (WXY)") },
        LineToolElliottImpulse: { icon: i(781), localizedName: $.t("Elliott Impulse Wave (12345)") },
        LineToolElliottTriangle: { icon: i(782), localizedName: $.t("Elliott Triangle Wave (ABCDE)") },
        LineToolElliottTripleCombo: { icon: i(783), localizedName: $.t("Elliott Triple Combo Wave (WXYXZ)") },
        LineToolEllipse: { icon: i(784), localizedName: $.t("Ellipse") },
        LineToolExtended: { icon: i(785), localizedName: $.t("Extended") },
        LineToolFibChannel: { icon: i(786), localizedName: $.t("Fib Channel") },
        LineToolFibCircles: { icon: i(787), localizedName: $.t("Fib Circles") },
        LineToolFibRetracement: { icon: i(788), localizedName: $.t("Fib Retracement") },
        LineToolFibSpeedResistanceArcs: { icon: i(789), localizedName: $.t("Fib Speed Resistance Arcs") },
        LineToolFibSpeedResistanceFan: { icon: i(790), localizedName: $.t("Fib Speed Resistance Fan") },
        LineToolFibSpiral: { icon: i(791), localizedName: $.t("Fib Spiral") },
        LineToolFibTimeZone: { icon: i(792), localizedName: $.t("Fib Time Zone") },
        LineToolFibWedge: { icon: i(793), localizedName: $.t("Fib Wedge") },
        LineToolFlagMark: { icon: i(794), localizedName: $.t("Flag Mark") },
        LineToolFlatBottom: { icon: i(795), localizedName: $.t("Flat Top/Bottom") },
        LineToolGannComplex: { icon: i(796), localizedName: $.t("Gann Square") },
        LineToolGannFan: { icon: i(797), localizedName: $.t("Gann Fan") },
        LineToolGannSquare: { icon: i(798), localizedName: $.t("Gann Box") },
        LineToolGhostFeed: { icon: i(799), localizedName: $.t("Ghost Feed") },
        LineToolHeadAndShoulders: { icon: i(800), localizedName: $.t("Head & Shoulders") },
        LineToolHorzLine: { icon: i(801), localizedName: $.t("Horizontal Line") },
        LineToolHorzRay: { icon: i(802), localizedName: $.t("Horizontal Ray") },
        LineToolInsidePitchfork: { icon: i(803), localizedName: $.t("Inside Pitchfork") },
        LineToolNote: { icon: i(804), localizedName: $.t("Note") },
        LineToolNoteAbsolute: { icon: i(805), localizedName: $.t("Anchored Note") },
        LineToolParallelChannel: { icon: i(806), localizedName: $.t("Parallel Channel") },
        LineToolPitchfan: { icon: i(807), localizedName: $.t("Pitchfan") },
        LineToolPitchfork: { icon: i(808), localizedName: $.t("Pitchfork") },
        LineToolPolyline: { icon: i(809), localizedName: $.t("Polyline") },
        LineToolPrediction: { icon: i(810), localizedName: $.t("Forecast") },
        LineToolPriceLabel: { icon: i(811), localizedName: $.t("Price Label") },
        LineToolPriceRange: { icon: i(812), localizedName: $.t("Price Range") },
        LineToolProjection: { icon: i(813), localizedName: $.t("Projection") },
        LineToolRay: { icon: i(814), localizedName: $.t("Ray") },
        LineToolRectangle: { icon: i(815), localizedName: $.t("Rectangle") },
        LineToolRegressionTrend: { icon: i(816), localizedName: $.t("Regression Trend") },
        LineToolRiskRewardLong: { icon: i(817), localizedName: $.t("Long Position") },
        LineToolRiskRewardShort: { icon: i(818), localizedName: $.t("Short Position") },
        LineToolRotatedRectangle: { icon: i(819), localizedName: $.t("Rotated Rectangle") },
        LineToolSchiffPitchfork: { icon: i(820), localizedName: $.t("Modified Schiff Pitchfork") },
        LineToolSchiffPitchfork2: { icon: i(821), localizedName: $.t("Schiff Pitchfork") },
        LineToolSineLine: { icon: i(822), localizedName: $.t("Sine Line") },
        LineToolText: { icon: i(823), localizedName: $.t("Text") },
        LineToolTextAbsolute: { icon: i(824), localizedName: $.t("Anchored Text") },
        LineToolThreeDrivers: { icon: i(825), localizedName: $.t("Three Drives Pattern") },
        LineToolTimeCycles: { icon: i(826), localizedName: $.t("Time Cycles") },
        LineToolTrendAngle: { icon: i(827), localizedName: $.t("Trend Angle") },
        LineToolTrendBasedFibExtension: { icon: i(828), localizedName: $.t("Trend-Based Fib Extension") },
        LineToolTrendBasedFibTime: { icon: i(829), localizedName: $.t("Trend-Based Fib Time") },
        LineToolTrendLine: {
            icon: i(830),
            localizedName: $.t("Trend Line")
        },
        LineToolTriangle: { icon: i(831), localizedName: $.t("Triangle") },
        LineToolTrianglePattern: { icon: i(832), localizedName: $.t("Triangle Pattern") },
        LineToolVertLine: { icon: i(833), localizedName: $.t("Vertical Line") },
        SyncDrawing: { icon: i(834), localizedName: $.t("Sync drawings to all charts") },
        arrow: { icon: i(837), localizedName: $.t("Arrow") },
        cursor: { icon: i(850), localizedName: $.t("Cross") },
        dot: { icon: i(851), localizedName: $.t("Dot") },
        drawginmode: { icon: i(853), localizedName: $.t("Stay in Drawing Mode") },
        eraser: { icon: i(854), localizedName: $.t("Eraser") },
        group: { icon: i(858), localizedName: $.t("Show Hidden Tools") },
        hideAllDrawings: { icon: i(861), localizedName: $.t("Hide All Drawing Tools") },
        lockAllDrawings: { icon: i(885), localizedName: $.t("Lock All Drawing Tools") },
        magnet: { icon: i(886), localizedName: $.t("Magnet Mode") },
        measure: { icon: i(887), localizedName: $.t("Measure (Shift + Click on the chart)") },
        removeAllDrawingTools: { icon: i(891), localizedName: $.t("Remove All Drawing Tools") },
        showObjectsTree: { icon: i(894), localizedName: $.t("Show Objects Tree") },
        zoom: { icon: i(902), localizedName: $.t("Zoom In") },
        "zoom-out": { icon: i(901), localizedName: $.t("Zoom Out") }
    }
}, function(t, e) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 }), e.layouts = { s: { title: "1 chart", count: 1, sizer: function(t, e, i, o) { return { width: e.width - o - o, height: e.height - o - o, top: o, left: o } } } }
}, function(t, e, i) {
    "use strict";
    var o, n, s;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(73), n = i(27), 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 void 0 === n && (n = NaN), t.prototype.format.call(this, e * this._pipPriceScale / n, i, o) }, e
    }(n.PriceFormatter), e.PipFormatter = s
}, function(t, e, i) {
    "use strict";
    var o, n, s;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(26), n = i(35), s = function() {
        function t(t) { this._numericFormatter = new o.NumericFormatter(t), this._fractionalValues = void 0 !== t && 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) { return this._numericFormatter.format(t).replace(/(\.[1-9]*)0+$/, function(t, e) { return e }) }, t
    }(), e.VolumeFormatter = s
}, function(t, e) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 }), e.MINUTE_SPAN = 20, e.HOUR_SPAN = 30, e.DAY_SPAN = 40, e.WEEK_SPAN = 50, e.MONTH_SPAN = 60, e.YEAR_SPAN = 70, e.DEFAULT_BAR_SPACING = 6, e.DEFAULT_RIGHT_OFFSET = 5
}, function(t, e) {
    "use strict";

    function i(t) { return t.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&") }
    Object.defineProperty(e, "__esModule", { value: !0 }), e.regExpEscape = i
}, function(t, e, i) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 });
    var o = i(543);
    e.TVDialogAbstract = o.TVDialogAbstract, e.closeAllDialogs = o.closeAllDialogs
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="-80 -25 140 140"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 12L-.7.7-41 43.2l.1.1-.1.1L-.7 85.9l10-10.6-29.7-31.2z"/></svg>' }, function(t, e, i) {
    var o;
    ! function(e) {
        "use strict";

        function n() {}

        function s(t, e) {
            for (var i = t.length; i--;)
                if (t[i].listener === e) return i;
            return -1
        }

        function r(t) { return function() { return this[t].apply(this, arguments) } }

        function a(t) { return "function" == typeof t || t instanceof RegExp || !(!t || "object" != typeof t) && a(t.listener) }
        var l = n.prototype,
            h = e.EventEmitter;
        l.getListeners = function(t) { var e, i, o = this._getEvents(); if (t instanceof RegExp) { e = {}; for (i in o) o.hasOwnProperty(i) && t.test(i) && (e[i] = o[i]) } else e = o[t] || (o[t] = []); return e }, l.flattenListeners = function(t) { var e, i = []; for (e = 0; e < t.length; e += 1) i.push(t[e].listener); return i }, l.getListenersAsObject = function(t) { var e, i = this.getListeners(t); return i instanceof Array && (e = {}, e[t] = i), e || i }, l.addListener = function(t, e) {
            var i, o, n;
            if (!a(e)) throw new TypeError("listener must be a function");
            i = this.getListenersAsObject(t), o = "object" == typeof e;
            for (n in i) i.hasOwnProperty(n) && -1 === s(i[n], e) && i[n].push(o ? e : { listener: e, once: !1 });
            return this
        }, l.on = r("addListener"), l.addOnceListener = function(t, e) { return this.addListener(t, { listener: e, once: !0 }) }, l.once = r("addOnceListener"), l.defineEvent = function(t) { return this.getListeners(t), this }, l.defineEvents = function(t) { for (var e = 0; e < t.length; e += 1) this.defineEvent(t[e]); return this }, l.removeListener = function(t, e) { var i, o, n = this.getListenersAsObject(t); for (o in n) n.hasOwnProperty(o) && -1 !== (i = s(n[o], e)) && n[o].splice(i, 1); return this }, l.off = r("removeListener"), l.addListeners = function(t, e) { return this.manipulateListeners(!1, t, e) }, l.removeListeners = function(t, e) { return this.manipulateListeners(!0, t, e) }, l.manipulateListeners = function(t, e, i) {
            var o, n, s = t ? this.removeListener : this.addListener,
                r = t ? this.removeListeners : this.addListeners;
            if ("object" != typeof e || e instanceof RegExp)
                for (o = i.length; o--;) s.call(this, e, i[o]);
            else
                for (o in e) e.hasOwnProperty(o) && (n = e[o]) && ("function" == typeof n ? s.call(this, o, n) : r.call(this, o, n));
            return this
        }, l.removeEvent = function(t) {
            var e, i = typeof t,
                o = this._getEvents();
            if ("string" === i) delete o[t];
            else if (t instanceof RegExp)
                for (e in o) o.hasOwnProperty(e) && t.test(e) && delete o[e];
            else delete this._events;
            return this
        }, l.removeAllListeners = r("removeEvent"), l.emitEvent = function(t, e) {
            var i, o, n, s, r = this.getListenersAsObject(t);
            for (s in r)
                if (r.hasOwnProperty(s))
                    for (i = r[s].slice(0), n = 0; n < i.length; n++) o = i[n], !0 === o.once && this.removeListener(t, o.listener), o.listener.apply(this, e || []) === this._getOnceReturnValue() && this.removeListener(t, o.listener);
            return this
        }, l.trigger = r("emitEvent"), l.emit = function(t) { var e = Array.prototype.slice.call(arguments, 1); return this.emitEvent(t, e) }, l.setOnceReturnValue = function(t) { return this._onceReturnValue = t, this }, l._getOnceReturnValue = function() { return !this.hasOwnProperty("_onceReturnValue") || this._onceReturnValue }, l._getEvents = function() { return this._events || (this._events = {}) }, n.noConflict = function() { return e.EventEmitter = h, n }, void 0 !== (o = function() { return n }.call(e, i, e, t)) && (t.exports = o)
    }(this || {})
}, , , , , , , , , , , , , , , , , , , , , , , , function(t, e) {}, function(t, e) {}, function(t, e, i) {
    var o;
    ! function(n, s, r, a) {
        "use strict";

        function l(t, e, i) { return setTimeout(u(t, i), e) }

        function h(t, e, i) { return !!Array.isArray(t) && (c(t, i[e], i), !0) }

        function c(t, e, i) {
            var o;
            if (t)
                if (t.forEach) t.forEach(e, i);
                else if (t.length !== a)
                for (o = 0; o < t.length;) e.call(i, t[o], o, t), o++;
            else
                for (o in t) t.hasOwnProperty(o) && e.call(i, t[o], o, t)
        }

        function d(t, e, i) {
            var o = "DEPRECATED METHOD: " + e + "\n" + i + " AT \n";
            return function() {
                var e = Error("get-stack-trace"),
                    i = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, "").replace(/^\s+at\s+/gm, "").replace(/^Object.<anonymous>\s*\(/gm, "{anonymous}()@") : "Unknown Stack Trace",
                    s = n.console && (n.console.warn || n.console.log);
                return s && s.call(n.console, o, i), t.apply(this, arguments)
            }
        }

        function p(t, e, i) {
            var o, n = e.prototype;
            o = t.prototype = Object.create(n), o.constructor = t, o._super = n, i && ft(o, i)
        }

        function u(t, e) { return function() { return t.apply(e, arguments) } }

        function _(t, e) { return typeof t == Te ? t.apply(e ? e[0] || a : a, e) : t }

        function f(t, e) { return t === a ? e : t }

        function m(t, e, i) { c(b(e), function(e) { t.addEventListener(e, i, !1) }) }

        function g(t, e, i) { c(b(e), function(e) { t.removeEventListener(e, i, !1) }) }

        function v(t, e) {
            for (; t;) {
                if (t == e) return !0;
                t = t.parentNode
            }
            return !1
        }

        function y(t, e) { return t.indexOf(e) > -1 }

        function b(t) { return t.trim().split(/\s+/g) }

        function w(t, e, i) {
            if (t.indexOf && !i) return t.indexOf(e);
            for (var o = 0; o < t.length;) {
                if (i && t[o][i] == e || !i && t[o] === e) return o;
                o++
            }
            return -1
        }

        function S(t) { return Array.prototype.slice.call(t, 0) }

        function T(t, e, i) { for (var o, n = [], s = [], r = 0; r < t.length;) o = e ? t[r][e] : t[r], w(s, o) < 0 && n.push(t[r]), s[r] = o, r++; return i && (n = e ? n.sort(function(t, i) { return t[e] > i[e] }) : n.sort()), n }

        function C(t, e) {
            for (var i, o, n = e[0].toUpperCase() + e.slice(1), s = 0; s < we.length;) {
                if (i = we[s], (o = i ? i + n : e) in t) return o;
                s++
            }
            return a
        }

        function x() { return vt++ }

        function P(t) { var e = t.ownerDocument || t; return e.defaultView || e.parentWindow || n }

        function L(t, e) {
            var i = this;
            this.manager = t, this.callback = e, this.element = t.element, this.target = t.options.inputTarget, this.domHandler = function(e) { _(t.options.enable, [t]) && i.handler(e) }, this.init()
        }

        function k(t) { var e = t.options.inputClass; return new(e || (wt ? W : St ? j : bt ? Y : z))(t, I) }

        function I(t, e, i) {
            var o = i.pointers.length,
                n = i.changedPointers.length,
                s = e & kt && o - n == 0,
                r = e & (At | Et) && o - n == 0;
            i.isFirst = !!s, i.isFinal = !!r, s && (t.session = {}), i.eventType = e, A(t, i), t.emit("hammer.input", i), t.recognize(i), t.session.prevInput = i
        }

        function A(t, e) {
            var i, o, n, s, r, a, l = t.session,
                h = e.pointers,
                c = h.length;
            l.firstInput || (l.firstInput = D(e)), c > 1 && !l.firstMultiple ? l.firstMultiple = D(e) : 1 === c && (l.firstMultiple = !1), i = l.firstInput, o = l.firstMultiple, n = o ? o.center : i.center, s = e.center = O(h), e.timeStamp = Pe(), e.deltaTime = e.timeStamp - i.timeStamp, e.angle = R(n, s), e.distance = B(n, s), E(l, e), e.offsetDirection = V(e.deltaX, e.deltaY), r = $(e.deltaTime, e.deltaX, e.deltaY), e.overallVelocityX = r.x, e.overallVelocityY = r.y, e.overallVelocity = xe(r.x) > xe(r.y) ? r.x : r.y, e.scale = o ? F(o.pointers, h) : 1, e.rotation = o ? N(o.pointers, h) : 0, e.maxPointers = l.prevInput ? e.pointers.length > l.prevInput.maxPointers ? e.pointers.length : l.prevInput.maxPointers : e.pointers.length, M(l, e), a = t.element, v(e.srcEvent.target, a) && (a = e.srcEvent.target), e.target = a
        }

        function E(t, e) {
            var i = e.center,
                o = t.offsetDelta || {},
                n = t.prevDelta || {},
                s = t.prevInput || {};
            e.eventType !== kt && s.eventType !== At || (n = t.prevDelta = { x: s.deltaX || 0, y: s.deltaY || 0 }, o = t.offsetDelta = { x: i.x, y: i.y }), e.deltaX = n.x + (i.x - o.x), e.deltaY = n.y + (i.y - o.y)
        }

        function M(t, e) {
            var i, o, n, s, r, l, h, c = t.lastInterval || e,
                d = e.timeStamp - c.timeStamp;
            e.eventType != Et && (d > Lt || c.velocity === a) ? (r = e.deltaX - c.deltaX, l = e.deltaY - c.deltaY, h = $(d, r, l), o = h.x, n = h.y, i = xe(h.x) > xe(h.y) ? h.x : h.y, s = V(r, l), t.lastInterval = e) : (i = c.velocity, o = c.velocityX, n = c.velocityY, s = c.direction), e.velocity = i, e.velocityX = o, e.velocityY = n, e.direction = s
        }

        function D(t) { for (var e = [], i = 0; i < t.pointers.length;) e[i] = { clientX: Ce(t.pointers[i].clientX), clientY: Ce(t.pointers[i].clientY) }, i++; return { timeStamp: Pe(), pointers: e, center: O(e), deltaX: t.deltaX, deltaY: t.deltaY } }

        function O(t) { var e, i, o, n = t.length; if (1 === n) return { x: Ce(t[0].clientX), y: Ce(t[0].clientY) }; for (e = 0, i = 0, o = 0; o < n;) e += t[o].clientX, i += t[o].clientY, o++; return { x: Ce(e / n), y: Ce(i / n) } }

        function $(t, e, i) { return { x: e / t || 0, y: i / t || 0 } }

        function V(t, e) { return t === e ? Mt : xe(t) >= xe(e) ? t < 0 ? Dt : Ot : e < 0 ? $t : Vt }

        function B(t, e, i) {
            i || (i = Ft);
            var o = e[i[0]] - t[i[0]],
                n = e[i[1]] - t[i[1]];
            return Math.sqrt(o * o + n * n)
        }

        function R(t, e, i) {
            i || (i = Ft);
            var o = e[i[0]] - t[i[0]],
                n = e[i[1]] - t[i[1]];
            return 180 * Math.atan2(n, o) / Math.PI
        }

        function N(t, e) { return R(e[1], e[0], zt) + R(t[1], t[0], zt) }

        function F(t, e) { return B(e[0], e[1], zt) / B(t[0], t[1], zt) }

        function z() { this.evEl = Ht, this.evWin = Ut, this.pressed = !1, L.apply(this, arguments) }

        function W() { this.evEl = Yt, this.evWin = Gt, L.apply(this, arguments), this.store = this.manager.session.pointerEvents = [] }

        function H() { this.evTarget = Xt, this.evWin = Zt, this.started = !1, L.apply(this, arguments) }

        function U(t, e) {
            var i = S(t.touches),
                o = S(t.changedTouches);
            return e & (At | Et) && (i = T(i.concat(o), "identifier", !0)), [i, o]
        }

        function j() { this.evTarget = Qt, this.targetIds = {}, L.apply(this, arguments) }

        function q(t, e) {
            var i, o, n, s, r, l = S(t.touches),
                h = this.targetIds;
            if (e & (kt | It) && 1 === l.length) return h[l[0].identifier] = !0, [l, l];
            if (n = S(t.changedTouches), s = [], r = this.target, o = l.filter(function(t) { return v(t.target, r) }), e === kt)
                for (i = 0; i < o.length;) h[o[i].identifier] = !0, i++;
            for (i = 0; i < n.length;) h[n[i].identifier] && s.push(n[i]), e & (At | Et) && delete h[n[i].identifier], i++;
            return s.length ? [T(o.concat(s), "identifier", !0), s] : a
        }

        function Y() {
            L.apply(this, arguments);
            var t = u(this.handler, this);
            this.touch = new j(this.manager, t), this.mouse = new z(this.manager, t), this.primaryTouch = null, this.lastTouches = []
        }

        function G(t, e) { t & kt ? (this.primaryTouch = e.changedPointers[0].identifier, K.call(this, e)) : t & (At | Et) && K.call(this, e) }

        function K(t) {
            var e, i, o, n = t.changedPointers[0];
            n.identifier === this.primaryTouch && (e = { x: n.clientX, y: n.clientY }, this.lastTouches.push(e), i = this.lastTouches, o = function() {
                var t = i.indexOf(e);
                t > -1 && i.splice(t, 1)
            }, setTimeout(o, te))
        }

        function X(t) {
            var e, i, o, n, s = t.srcEvent.clientX,
                r = t.srcEvent.clientY;
            for (e = 0; e < this.lastTouches.length; e++)
                if (i = this.lastTouches[e], o = Math.abs(s - i.x), n = Math.abs(r - i.y), o <= ee && n <= ee) return !0;
            return !1
        }

        function Z(t, e) { this.manager = t, this.set(e) }

        function J(t) { var e, i; return y(t, ae) ? ae : (e = y(t, le), i = y(t, he), e && i ? ae : e || i ? e ? le : he : y(t, re) ? re : se) }

        function Q() { var t, e; return !!oe && (t = {}, e = n.CSS && n.CSS.supports, ["auto", "manipulation", "pan-y", "pan-x", "pan-x pan-y", "none"].forEach(function(i) { t[i] = !e || n.CSS.supports("touch-action", i) }), t) }

        function tt(t) { this.options = ft({}, this.defaults, t || {}), this.id = x(), this.manager = null, this.options.enable = f(this.options.enable, !0), this.state = de, this.simultaneous = {}, this.requireFail = [] }

        function et(t) { return t & me ? "cancel" : t & _e ? "end" : t & ue ? "move" : t & pe ? "start" : "" }

        function it(t) { return t == Vt ? "down" : t == $t ? "up" : t == Dt ? "left" : t == Ot ? "right" : "" }

        function ot(t, e) { var i = e.manager; return i ? i.get(t) : t }

        function nt() { tt.apply(this, arguments) }

        function st() { nt.apply(this, arguments), this.pX = null, this.pY = null }

        function rt() { nt.apply(this, arguments) }

        function at() { tt.apply(this, arguments), this._timer = null, this._input = null }

        function lt() { nt.apply(this, arguments) }

        function ht() { nt.apply(this, arguments) }

        function ct() { tt.apply(this, arguments), this.pTime = !1, this.pCenter = !1, this._timer = null, this._input = null, this.count = 0 }

        function dt(t, e) { return e = e || {}, e.recognizers = f(e.recognizers, dt.defaults.preset), new pt(t, e) }

        function pt(t, e) {
            this.options = ft({}, dt.defaults, e || {}), this.options.inputTarget = this.options.inputTarget || t, this.handlers = {}, this.session = {}, this.recognizers = [], this.oldCssProps = {}, this.element = t, this.input = k(this), this.touchAction = new Z(this, this.options.touchAction), ut(this, !0), c(this.options.recognizers, function(t) {
                var e = this.add(new t[0](t[1]));
                t[2] && e.recognizeWith(t[2]), t[3] && e.requireFailure(t[3])
            }, this)
        }

        function ut(t, e) {
            var i, o = t.element;
            o.style && (c(t.options.cssProps, function(n, s) { i = C(o.style, s), e ? (t.oldCssProps[i] = o.style[i], o.style[i] = n) : o.style[i] = t.oldCssProps[i] || "" }), e || (t.oldCssProps = {}))
        }

        function _t(t, e) {
            var i = s.createEvent("Event");
            i.initEvent(t, !0, !0), i.gesture = e, e.target.dispatchEvent(i)
        }
        var ft, mt, gt, vt, yt, bt, wt, St, Tt, Ct, xt, Pt, Lt, kt, It, At, Et, Mt, Dt, Ot, $t, Vt, Bt, Rt, Nt, Ft, zt, Wt, Ht, Ut, jt, qt, Yt, Gt, Kt, Xt, Zt, Jt, Qt, te, ee, ie, oe, ne, se, re, ae, le, he, ce, de, pe, ue, _e, fe, me, ge, ve, ye, be, we = ["", "webkit", "Moz", "MS", "ms", "o"],
            Se = s.createElement("div"),
            Te = "function",
            Ce = Math.round,
            xe = Math.abs,
            Pe = Date.now;
        ft = "function" != typeof Object.assign ? function(t) {
                var e, i, o, n;
                if (t === a || null === t) throw new TypeError("Cannot convert undefined or null to object");
                for (e = Object(t), i = 1; i < arguments.length; i++)
                    if ((o = arguments[i]) !== a && null !== o)
                        for (n in o) o.hasOwnProperty(n) && (e[n] = o[n]);
                return e
            } : Object.assign, mt = d(function(t, e, i) { for (var o = Object.keys(e), n = 0; n < o.length;)(!i || i && t[o[n]] === a) && (t[o[n]] = e[o[n]]), n++; return t }, "extend", "Use `assign`."), gt = d(function(t, e) { return mt(t, e, !0) }, "merge", "Use `assign`."), vt = 1, yt = /mobile|tablet|ip(ad|hone|od)|android/i, bt = "ontouchstart" in n, wt = C(n, "PointerEvent") !== a, St = bt && yt.test(navigator.userAgent), Tt = "touch", Ct = "pen", xt = "mouse", Pt = "kinect", Lt = 25, kt = 1, It = 2, At = 4, Et = 8, Mt = 1, Dt = 2, Ot = 4, $t = 8, Vt = 16, Bt = Dt | Ot, Rt = $t | Vt, Nt = Bt | Rt, Ft = ["x", "y"], zt = ["clientX", "clientY"], L.prototype = { handler: function() {}, init: function() { this.evEl && m(this.element, this.evEl, this.domHandler), this.evTarget && m(this.target, this.evTarget, this.domHandler), this.evWin && m(P(this.element), this.evWin, this.domHandler) }, destroy: function() { this.evEl && g(this.element, this.evEl, this.domHandler), this.evTarget && g(this.target, this.evTarget, this.domHandler), this.evWin && g(P(this.element), this.evWin, this.domHandler) } }, Wt = { mousedown: kt, mousemove: It, mouseup: At }, Ht = "mousedown", Ut = "mousemove mouseup", p(z, L, {
                handler: function(t) {
                    var e = Wt[t.type];
                    e & kt && 0 === t.button && (this.pressed = !0), e & It && 1 !== t.which && (e = At), this.pressed && (e & At && (this.pressed = !1), this.callback(this.manager, e, { pointers: [t], changedPointers: [t], pointerType: xt, srcEvent: t }))
                }
            }), jt = { pointerdown: kt, pointermove: It, pointerup: At, pointercancel: Et, pointerout: Et }, qt = { 2: Tt, 3: Ct, 4: xt, 5: Pt }, Yt = "pointerdown", Gt = "pointermove pointerup pointercancel", n.MSPointerEvent && !n.PointerEvent && (Yt = "MSPointerDown", Gt = "MSPointerMove MSPointerUp MSPointerCancel"), p(W, L, {
                handler: function(t) {
                    var e = this.store,
                        i = !1,
                        o = t.type.toLowerCase().replace("ms", ""),
                        n = jt[o],
                        s = qt[t.pointerType] || t.pointerType,
                        r = s == Tt,
                        a = w(e, t.pointerId, "pointerId");
                    n & kt && (0 === t.button || r) ? a < 0 && (e.push(t), a = e.length - 1) : n & (At | Et) && (i = !0), a < 0 || (e[a] = t, this.callback(this.manager, n, { pointers: e, changedPointers: [t], pointerType: s, srcEvent: t }), i && e.splice(a, 1))
                }
            }), Kt = { touchstart: kt, touchmove: It, touchend: At, touchcancel: Et }, Xt = "touchstart", Zt = "touchstart touchmove touchend touchcancel", p(H, L, {
                handler: function(t) {
                    var e, i = Kt[t.type];
                    i === kt && (this.started = !0), this.started && (e = U.call(this, t, i), i & (At | Et) && e[0].length - e[1].length == 0 && (this.started = !1), this.callback(this.manager, i, { pointers: e[0], changedPointers: e[1], pointerType: Tt, srcEvent: t }))
                }
            }), Jt = { touchstart: kt, touchmove: It, touchend: At, touchcancel: Et }, Qt = "touchstart touchmove touchend touchcancel", p(j, L, {
                handler: function(t) {
                    var e = Jt[t.type],
                        i = q.call(this, t, e);
                    i && this.callback(this.manager, e, { pointers: i[0], changedPointers: i[1], pointerType: Tt, srcEvent: t })
                }
            }), te = 2500, ee = 25, p(Y, L, {
                handler: function(t, e, i) {
                    var o = i.pointerType == Tt,
                        n = i.pointerType == xt;
                    if (!(n && i.sourceCapabilities && i.sourceCapabilities.firesTouchEvents)) {
                        if (o) G.call(this, e, i);
                        else if (n && X.call(this, i)) return;
                        this.callback(t, e, i)
                    }
                },
                destroy: function() { this.touch.destroy(), this.mouse.destroy() }
            }), ie = C(Se.style, "touchAction"), oe = ie !== a, ne = "compute", se = "auto", re = "manipulation", ae = "none", le = "pan-x",
            he = "pan-y", ce = Q(), Z.prototype = {
                set: function(t) { t == ne && (t = this.compute()), oe && this.manager.element.style && ce[t] && (this.manager.element.style[ie] = t), this.actions = t.toLowerCase().trim() },
                update: function() { this.set(this.manager.options.touchAction) },
                compute: function() { var t = []; return c(this.manager.recognizers, function(e) { _(e.options.enable, [e]) && (t = t.concat(e.getTouchAction())) }), J(t.join(" ")) },
                preventDefaults: function(t) {
                    var e, i, o, n, s, r, l, h = t.srcEvent,
                        c = t.offsetDirection;
                    return this.manager.session.prevented ? void h.preventDefault() : (e = this.actions, i = y(e, ae) && !ce[ae], o = y(e, he) && !ce[he], n = y(e, le) && !ce[le], i && (s = 1 === t.pointers.length, r = t.distance < 2, l = t.deltaTime < 250, s && r && l) || n && o ? a : i || o && c & Bt || n && c & Rt ? this.preventSrc(h) : a)
                },
                preventSrc: function(t) { this.manager.session.prevented = !0, t.preventDefault() }
            }, de = 1, pe = 2, ue = 4, _e = 8, fe = _e, me = 16, ge = 32, tt.prototype = {
                defaults: {},
                set: function(t) { return ft(this.options, t), this.manager && this.manager.touchAction.update(), this },
                recognizeWith: function(t) { if (h(t, "recognizeWith", this)) return this; var e = this.simultaneous; return t = ot(t, this), e[t.id] || (e[t.id] = t, t.recognizeWith(this)), this },
                dropRecognizeWith: function(t) { return h(t, "dropRecognizeWith", this) ? this : (t = ot(t, this), delete this.simultaneous[t.id], this) },
                requireFailure: function(t) { if (h(t, "requireFailure", this)) return this; var e = this.requireFail; return t = ot(t, this), -1 === w(e, t) && (e.push(t), t.requireFailure(this)), this },
                dropRequireFailure: function(t) {
                    if (h(t, "dropRequireFailure", this)) return this;
                    t = ot(t, this);
                    var e = w(this.requireFail, t);
                    return e > -1 && this.requireFail.splice(e, 1), this
                },
                hasRequireFailures: function() { return this.requireFail.length > 0 },
                canRecognizeWith: function(t) { return !!this.simultaneous[t.id] },
                emit: function(t) {
                    function e(e) { i.manager.emit(e, t) }
                    var i = this,
                        o = this.state;
                    o < _e && e(i.options.event + et(o)), e(i.options.event), t.additionalEvent && e(t.additionalEvent), o >= _e && e(i.options.event + et(o))
                },
                tryEmit: function(t) {
                    if (this.canEmit()) return this.emit(t);
                    this.state = ge
                },
                canEmit: function() {
                    for (var t = 0; t < this.requireFail.length;) {
                        if (!(this.requireFail[t].state & (ge | de))) return !1;
                        t++
                    }
                    return !0
                },
                recognize: function(t) {
                    var e = ft({}, t);
                    if (!_(this.options.enable, [this, e])) return this.reset(), void(this.state = ge);
                    this.state & (fe | me | ge) && (this.state = de), this.state = this.process(e), this.state & (pe | ue | _e | me) && this.tryEmit(e)
                },
                process: function(t) {},
                getTouchAction: function() {},
                reset: function() {}
            }, p(nt, tt, {
                defaults: { pointers: 1 },
                attrTest: function(t) { var e = this.options.pointers; return 0 === e || t.pointers.length === e },
                process: function(t) {
                    var e = this.state,
                        i = t.eventType,
                        o = e & (pe | ue),
                        n = this.attrTest(t);
                    return o && (i & Et || !n) ? e | me : o || n ? i & At ? e | _e : e & pe ? e | ue : pe : ge
                }
            }), p(st, nt, {
                defaults: { event: "pan", threshold: 10, pointers: 1, direction: Nt },
                getTouchAction: function() {
                    var t = this.options.direction,
                        e = [];
                    return t & Bt && e.push(he), t & Rt && e.push(le), e
                },
                directionTest: function(t) {
                    var e = this.options,
                        i = !0,
                        o = t.distance,
                        n = t.direction,
                        s = t.deltaX,
                        r = t.deltaY;
                    return n & e.direction || (e.direction & Bt ? (n = 0 === s ? Mt : s < 0 ? Dt : Ot, i = s != this.pX, o = Math.abs(t.deltaX)) : (n = 0 === r ? Mt : r < 0 ? $t : Vt, i = r != this.pY,
                        o = Math.abs(t.deltaY))), t.direction = n, i && o > e.threshold && n & e.direction
                },
                attrTest: function(t) { return nt.prototype.attrTest.call(this, t) && (this.state & pe || !(this.state & pe) && this.directionTest(t)) },
                emit: function(t) {
                    this.pX = t.deltaX, this.pY = t.deltaY;
                    var e = it(t.direction);
                    e && (t.additionalEvent = this.options.event + e), this._super.emit.call(this, t)
                }
            }), p(rt, nt, {
                defaults: { event: "pinch", threshold: 0, pointers: 2 },
                getTouchAction: function() { return [ae] },
                attrTest: function(t) { return this._super.attrTest.call(this, t) && (Math.abs(t.scale - 1) > this.options.threshold || this.state & pe) },
                emit: function(t) {
                    if (1 !== t.scale) {
                        var e = t.scale < 1 ? "in" : "out";
                        t.additionalEvent = this.options.event + e
                    }
                    this._super.emit.call(this, t)
                }
            }), p(at, tt, {
                defaults: { event: "press", pointers: 1, time: 251, threshold: 9 },
                getTouchAction: function() { return [se] },
                process: function(t) {
                    var e = this.options,
                        i = t.pointers.length === e.pointers,
                        o = t.distance < e.threshold,
                        n = t.deltaTime > e.time;
                    if (this._input = t, !o || !i || t.eventType & (At | Et) && !n) this.reset();
                    else if (t.eventType & kt) this.reset(), this._timer = l(function() { this.state = fe, this.tryEmit() }, e.time, this);
                    else if (t.eventType & At) return fe;
                    return ge
                },
                reset: function() { clearTimeout(this._timer) },
                emit: function(t) { this.state === fe && (t && t.eventType & At ? this.manager.emit(this.options.event + "up", t) : (this._input.timeStamp = Pe(), this.manager.emit(this.options.event, this._input))) }
            }), p(lt, nt, { defaults: { event: "rotate", threshold: 0, pointers: 2 }, getTouchAction: function() { return [ae] }, attrTest: function(t) { return this._super.attrTest.call(this, t) && (Math.abs(t.rotation) > this.options.threshold || this.state & pe) } }), p(ht, nt, {
                defaults: { event: "swipe", threshold: 10, velocity: .3, direction: Bt | Rt, pointers: 1 },
                getTouchAction: function() { return st.prototype.getTouchAction.call(this) },
                attrTest: function(t) { var e, i = this.options.direction; return i & (Bt | Rt) ? e = t.overallVelocity : i & Bt ? e = t.overallVelocityX : i & Rt && (e = t.overallVelocityY), this._super.attrTest.call(this, t) && i & t.offsetDirection && t.distance > this.options.threshold && t.maxPointers == this.options.pointers && xe(e) > this.options.velocity && t.eventType & At },
                emit: function(t) {
                    var e = it(t.offsetDirection);
                    e && this.manager.emit(this.options.event + e, t), this.manager.emit(this.options.event, t)
                }
            }), p(ct, tt, {
                defaults: { event: "tap", pointers: 1, taps: 1, interval: 300, time: 250, threshold: 9, posThreshold: 10 },
                getTouchAction: function() { return [re] },
                process: function(t) {
                    var e, i, o = this.options,
                        n = t.pointers.length === o.pointers,
                        s = t.distance < o.threshold,
                        r = t.deltaTime < o.time;
                    if (this.reset(), t.eventType & kt && 0 === this.count) return this.failTimeout();
                    if (s && r && n) { if (t.eventType != At) return this.failTimeout(); if (e = !this.pTime || t.timeStamp - this.pTime < o.interval, i = !this.pCenter || B(this.pCenter, t.center) < o.posThreshold, this.pTime = t.timeStamp, this.pCenter = t.center, i && e ? this.count += 1 : this.count = 1, this._input = t, 0 === this.count % o.taps) return this.hasRequireFailures() ? (this._timer = l(function() { this.state = fe, this.tryEmit() }, o.interval, this), pe) : fe }
                    return ge
                },
                failTimeout: function() { return this._timer = l(function() { this.state = ge }, this.options.interval, this), ge },
                reset: function() { clearTimeout(this._timer) },
                emit: function() { this.state == fe && (this._input.tapCount = this.count, this.manager.emit(this.options.event, this._input)) }
            }), dt.VERSION = "2.0.7", dt.defaults = {
                domEvents: !1,
                touchAction: ne,
                enable: !0,
                inputTarget: null,
                inputClass: null,
                preset: [
                    [lt, { enable: !1 }],
                    [rt, { enable: !1 },
                        ["rotate"]
                    ],
                    [ht, { direction: Bt }],
                    [st, { direction: Bt },
                        ["swipe"]
                    ],
                    [ct],
                    [ct, { event: "doubletap", taps: 2 },
                        ["tap"]
                    ],
                    [at]
                ],
                cssProps: { userSelect: "none", touchSelect: "none", touchCallout: "none", contentZooming: "none", userDrag: "none", tapHighlightColor: "rgba(0,0,0,0)" }
            }, ve = 1, ye = 2, pt.prototype = {
                set: function(t) { return ft(this.options, t), t.touchAction && this.touchAction.update(), t.inputTarget && (this.input.destroy(), this.input.target = t.inputTarget, this.input.init()), this },
                stop: function(t) { this.session.stopped = t ? ye : ve },
                recognize: function(t) {
                    var e, i, o, n, s = this.session;
                    if (!s.stopped)
                        for (this.touchAction.preventDefaults(t), i = this.recognizers, o = s.curRecognizer, (!o || o && o.state & fe) && (o = s.curRecognizer = null), n = 0; n < i.length;) e = i[n], s.stopped === ye || o && e != o && !e.canRecognizeWith(o) ? e.reset() : e.recognize(t), !o && e.state & (pe | ue | _e) && (o = s.curRecognizer = e), n++
                },
                get: function(t) {
                    var e, i;
                    if (t instanceof tt) return t;
                    for (e = this.recognizers, i = 0; i < e.length; i++)
                        if (e[i].options.event == t) return e[i];
                    return null
                },
                add: function(t) { if (h(t, "add", this)) return this; var e = this.get(t.options.event); return e && this.remove(e), this.recognizers.push(t), t.manager = this, this.touchAction.update(), t },
                remove: function(t) { var e, i; return h(t, "remove", this) ? this : (t = this.get(t), t && (e = this.recognizers, -1 !== (i = w(e, t)) && (e.splice(i, 1), this.touchAction.update())), this) },
                on: function(t, e) { if (t !== a && e !== a) { var i = this.handlers; return c(b(t), function(t) { i[t] = i[t] || [], i[t].push(e) }), this } },
                off: function(t, e) { if (t !== a) { var i = this.handlers; return c(b(t), function(t) { e ? i[t] && i[t].splice(w(i[t], e), 1) : delete i[t] }), this } },
                emit: function(t, e) {
                    var i, o;
                    if (this.options.domEvents && _t(t, e), (i = this.handlers[t] && this.handlers[t].slice()) && i.length)
                        for (e.type = t, e.preventDefault = function() { e.srcEvent.preventDefault() }, o = 0; o < i.length;) i[o](e), o++
                },
                destroy: function() { this.element && ut(this, !1), this.handlers = {}, this.session = {}, this.input.destroy(), this.element = null }
            }, ft(dt, { INPUT_START: kt, INPUT_MOVE: It, INPUT_END: At, INPUT_CANCEL: Et, STATE_POSSIBLE: de, STATE_BEGAN: pe, STATE_CHANGED: ue, STATE_ENDED: _e, STATE_RECOGNIZED: fe, STATE_CANCELLED: me, STATE_FAILED: ge, DIRECTION_NONE: Mt, DIRECTION_LEFT: Dt, DIRECTION_RIGHT: Ot, DIRECTION_UP: $t, DIRECTION_DOWN: Vt, DIRECTION_HORIZONTAL: Bt, DIRECTION_VERTICAL: Rt, DIRECTION_ALL: Nt, Manager: pt, Input: L, TouchAction: Z, TouchInput: j, MouseInput: z, PointerEventInput: W, TouchMouseInput: Y, SingleTouchInput: H, Recognizer: tt, AttrRecognizer: nt, Tap: ct, Pan: st, Swipe: ht, Pinch: rt, Rotate: lt, Press: at, on: m, off: g, each: c, merge: gt, extend: mt, assign: ft, inherit: p, bindFn: u, prefixed: C }), be = a !== n ? n : "undefined" != typeof self ? self : {}, be.Hammer = dt, (o = function() { return dt }.call(e, i, e, t)) !== a && (t.exports = o)
    }(window, document)
}, function(t, e) {
    "use strict";

    function i(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
    var o;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = function() {
        function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
        return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
    }(), e.KeyboardListener = function() {
        function t() {
            var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "keydown";
            i(this, t), this._event = e
        }
        return o(t, [{ key: "regHandlers", value: function(t) { this._handlers = t } }, { key: "watchOn", value: function(t) { this._listener = this._regListener(), this._watchingEl = t, t.addEventListener(this._event, this._listener) } }, { key: "stopWatching", value: function() { this._watchingEl.removeEventListener(this._event, this._listener) } }, {
            key: "_regListener",
            value: function() {
                var t = this;
                return function(e) {
                    var i = e.which,
                        o = t._getHandler(i);
                    e.stopPropagation(), o(e)
                }
            }
        }, {
            key: "_getHandler",
            value: function(t) {
                var e = this._handlers[t],
                    i = function() {},
                    o = function(t) { t.preventDefault(), e(t) };
                return e ? o : i
            }
        }]), t
    }()
}, function(t, e) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 });
    var i = { SELECT: "select", AFTER_CLOSE_MENU: "afterCloseMenu", BEFORE_OPEN_MENU: "beforeOpenMenu" };
    e.events = i
}, function(t, e) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 });
    var i = { SELECT: "select" };
    e.events = i
}, function(t, e, i) {
    "use strict";

    function o(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
    var n, s, r, a, l;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.AddCompareDialog = void 0, n = function() {
        function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
        return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
    }(), s = i(534), r = i(532), a = i(263), i(497), l = null, e.AddCompareDialog = function() {
        function t(e) { o(this, t), this._chartWidgetCollection = e, this._$symbolSearchPopup = null, this._dialog = null, this._compareTab = new s.CompareTab(this._chartWidgetCollection, this), this._addSymbolTab = new r.AddSymbolTab(this._chartWidgetCollection, this) }
        return n(t, [{
            key: "show",
            value: function() {
                var t, e = this,
                    i = [];
                return i.push({ name: $.t("Compare"), page: this._compareTab.$tab.addClass("tv-compare-dialog__tab-page") }), i.push({ name: $.t("Add Symbol"), page: this._addSymbolTab.$tab.addClass("tv-compare-dialog__tab-page") }), t = (0, a.createTabbedDialog)({ tabs: i, width: 400, tabStateSaveKey: "CompareAddDialog.tab", destroyOnClose: !0, withScroll: !1, addClass: "tv-compare-dialog", tabsScrollBoxAddClass: "tv-compare-dialog__scroll-box", tabAddClass: "tv-compare-dialog__tab", isClickOutFn: function(t) { if (e._compareTab.isClickOnTab(t) || e._addSymbolTab.isClickOnTab(t)) return !1 } }), l && l.close(), this._dialog = t.dialog, this._dialog.open(), l = this._dialog, this._dialog
            }
        }, { key: "getZIndex", value: function() { return this._dialog.zIndex } }]), t
    }()
}, function(t, e, i) {
    "use strict";

    function o(t) { return t && t.__esModule ? t : { default: t } }

    function n(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }

    function s(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 r(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)
    }
    var a, l;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.AddSymbolCheckbox = void 0, a = i(187), l = o(a), e.AddSymbolCheckbox = function(t) {
        function e(t) { n(this, e), t.checked = TVSettings.getBool("showAddSymbolDialog.checkboxState", !0); var i = s(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t)); return i.$checkbox.change(function() { setTimeout(function() { TVSettings.setValue("showAddSymbolDialog.checkboxState", i.checked) }) }), i }
        return r(e, t), e
    }(l.default)
}, function(t, e, i) {
    "use strict";

    function o(t) { return t && t.__esModule ? t : { default: t } }

    function n(t, e) {
        var i, o, n, s, h, u, _, f, m, g, v, y = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
        for (y = $.extend({}, { title: $.t("Confirm Inputs"), callback: function(t) {} }, y), i = null, o = (0, r.createDialog)({ title: y.title, contentWrapTemplate: '<div class="tv-dialog__section tv-dialog__section--no-border"></div>', width: d, closeOnClickAtOtherDialogs: !0, destroyOnClose: !0, actionsWrapTemplate: '<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--actions-adaptive tv-dialog__section--no-border">', isClickOutFn: function(t) { var e = i.symbolSearchPopup(); if (e) return e[0] !== t.target && !e[0].contains(t.target) && void 0 }, actions: [{ name: "apply", type: "primary", text: $.t("Apply"), key: 13 }] }), p = o, n = (0, l.merge)({}, e.defaults.inputs), s = 0; s < e.inputs.length; ++s) h = e.inputs[s], h.confirm || delete n[h.id];
        u = new c.default({ inputs: n }), _ = { metaInfo: function() { return e } }, f = o.$content, o.open(), i = new a.StudyInputsPropertyPage(u, t.model(), _, !0, o.zIndex), m = i.widget(), f.append(m), Array.prototype.forEach.call(f.find("select"), function(t) {
            var e = $(t),
                i = "tv-select-container dialog";
            e.hasClass("tv-select-container-fontsize") && (i += " tv-select-container-fontsize"), e.selectbox({ speed: 100, classHolder: i })
        }), $('input[type="text"]', f).addClass("tv-text-input inset dialog"), $("input.ticker", f).TVTicker(), o.on("action:apply", function() {
            (0, y.callback)(u.state()), o.close()
        }), g = o.$content.innerWidth() - o.$content.width(), v = m.width() + g, v > d && o.$el.css("max-width", v), f.find("input,select").first().focus()
    }

    function s() { return p }
    var r, a, l, h, c, d, p;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.show = n, e.instance = s, r = i(71), a = i(87), l = i(35), h = i(24), c = o(h), i(126), d = 450, p = null
}, function(t, e, i) {
    "use strict";

    function o(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
    var n, s, r, a, l;
    Object.defineProperty(e, "__esModule", { value: !0 }), n = function() {
        function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
        return function(e, i, o) {
            return i && t(e.prototype, i),
                o && t(e, o), e
        }
    }(), s = i(41), r = ["alive", "owner", "body", "width", "height", "fullscreen", "detachable", "visible", "availWidth", "availHeight"], a = ["remove", "negotiateWidth", "negotiateHeight", "requestFullscreen", "exitFullscreen", "detach", "attach"], e.ResizerDetacherState = function() {
        function t(e) {
            var i, n, a, l, h, c, d, p;
            o(this, t), this._internals = {}, this._ownersStack = [], i = this._internals, n = this, a = !0, l = !1, h = void 0;
            try { for (c = r[Symbol.iterator](); !(a = (d = c.next()).done); a = !0) p = d.value, i[p] = new s, n[p] = i[p].readonly() } catch (t) { l = !0, h = t } finally { try {!a && c.return && c.return() } finally { if (l) throw h } }
            e && this.pushOwner(e)
        }
        return n(t, [{ key: "bridge", value: function() { return new l(this) } }, {
            key: "pushOwner",
            value: function(t) {
                var e, i, o, n, s, r, a;
                if (t.alive.value()) {
                    e = !0, i = !1, o = void 0;
                    try { for (n = this._ownersStack[Symbol.iterator](); !(e = (s = n.next()).done); e = !0) r = s.value, this._unsubscribeOwner(r) } catch (t) { i = !0, o = t } finally { try {!e && n.return && n.return() } finally { if (i) throw o } }
                    a = { owner: t }, this._ownersStack.push(a), this._subscribeOwner(a)
                }
            }
        }, {
            key: "detachToPopup",
            value: function(t) {
                var e = i(259).createPopup,
                    o = e(t);
                return !!o && (this.pushOwner(o.allocate()), !0)
            }
        }, {
            key: "_subscribeOwner",
            value: function(t) {
                var e, i, o, n, s, a, l, h, c = this,
                    d = t.owner;
                if (t.deathWatcher || (this._internals.alive.setValue(!0), t.deathWatcher = d.alive.spawn(), t.deathWatcher.subscribe(function(e) { e || c._deadHandler(t) })), !t.subscriptions) { t.subscriptions = [], e = function(t, e, i) { var o, n; return t[i] ? (o = t[i].spawn(), n = c._internals[i], o.subscribe(function(t) { return n.setValue(t) }, { callWithLast: !0 }), o) : null }, this._internals.visible.setValue(!1), i = !0, o = !1, n = void 0; try { for (s = r[Symbol.iterator](); !(i = (a = s.next()).done); i = !0) "alive" !== (l = a.value) && "owner" !== l && (h = e(d, this._internals, l), h ? t.subscriptions.push(h) : this._internals[l].deleteValue()) } catch (t) { o = !0, n = t } finally { try {!i && s.return && s.return() } finally { if (o) throw n } } }
                this._internals.owner.setValue(d)
            }
        }, {
            key: "_unsubscribeOwner",
            value: function(t, e) {
                var i, o, n, s, r, a;
                if (t.subscriptions) {
                    i = !0, o = !1, n = void 0;
                    try { for (s = t.subscriptions[Symbol.iterator](); !(i = (r = s.next()).done); i = !0) a = r.value, a.unsubscribe() } catch (t) { o = !0, n = t } finally { try {!i && s.return && s.return() } finally { if (o) throw n } }
                    t.subscriptions = null
                }
                e && t.deathWatcher && (t.deathWatcher.unsubscribe(), t.deathWatcher = null)
            }
        }, {
            key: "_deadHandler",
            value: function(t) {
                var e, i, o, n, s, a, l, h = 0;
                if (t && -1 === (h = this._ownersStack.indexOf(t))) throw Error("cannot sanitize owner that is not in stack");
                for (e = this._ownersStack.length - 1; e >= h; e--) this._unsubscribeOwner(this._ownersStack[e], !0);
                if (this._ownersStack.length = h, h > 0) this._subscribeOwner(this._ownersStack[h - 1]);
                else { i = !0, o = !1, n = void 0; try { for (s = r[Symbol.iterator](); !(i = (a = s.next()).done); i = !0) l = a.value, this._internals[l].deleteValue() } catch (t) { o = !0, n = t } finally { try {!i && s.return && s.return() } finally { if (o) throw n } } }
            }
        }, { key: "destroy", value: function() {} }]), t
    }(), l = function t(e) {
        var i, n, s, l, h, c, d;
        o(this, t), i = this, n = !0, s = !1, l = void 0;
        try { for (h = r[Symbol.iterator](); !(n = (c = h.next()).done); n = !0) "owner" !== (d = c.value) && (i[d] = e[d]) } catch (t) { s = !0, l = t } finally { try {!n && h.return && h.return() } finally { if (s) throw l } }
        a.forEach(function(t) {
            i[t] = function() {
                var i = e.owner.value();
                i && i[t] && i[t].apply(i, arguments)
            }
        })
    }, e.determineSize = function(t, e) {
        var i, o, n, s, r, a, l = 0,
            h = !0,
            c = !1,
            d = void 0;
        try { for (i = e[Symbol.iterator](); !(h = (o = i.next()).done) && (n = o.value, s = n.min, r = n.max, t < s || r < s || (a = Math.min(t, r), l = Math.max(l, a), t !== l)); h = !0); } catch (t) { c = !0, d = t } finally { try {!h && i.return && i.return() } finally { if (c) throw d } }
        return l
    }, e.processNegotiation = function(t) {
        var e, i, o, n, s = [],
            r = [].concat(t);
        for (e = 0; e < r.length; e++) i = r[e], o = void 0, n = void 0, isFinite(+i) ? o = n = +i : (o = +i.min, n = +i.max), (o < 0 || isNaN(o)) && (o = 0), isNaN(n) && (n = 1 / 0), o <= n && n > 0 && s.push({ min: o, max: n });
        return s.sort(function(t, e) { return t.min - e.min || t.max - e.max }), s
    }, e.negotiationsAreEqual = function(t, e) { if (t.length !== e.length) return !1; for (var i = t.length; i--;) { if (t[i].min !== e[i].min) return !1; if (t[i].max !== e[i].max) return !1 } }
}, function(t, e, i) {
    "use strict";

    function o(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
    var n, s, r, a, l, h, c, d, p;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.createPopup = e.screenMetrics = e.Root = void 0, n = function() {
        function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
        return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
    }(), i(491), s = i(258), r = i(537), a = i(538), l = i(41), h = e.Root = function() {
        function t(e) { o(this, t), this._width = new l, this._height = new l, this._window = e, this._window || (console && console.warn && console.warn("using default window"), this._window = window), this._initFullscreen() }
        return n(t, [{
            key: "allocate",
            value: function(t) {
                var e, i, o, n = this;
                return this.free(), e = this._window.document, i = $("<div>", e).addClass("js-rootresizer__contents").css({ position: "relative", width: "100%", height: "100%" }).prependTo(e.body), this._visibilityApi = new a.VisibilityApi(this._window.document), o = { alive: new l(!0), body: new l(i), width: new l, height: new l, availWidth: new l, availHeight: new l, visible: this._visibilityApi.isVisible, fullscreen: this._fullscreenApi.isFullscreen, remove: function() { o.alive.setValue(!1) }, attach: function() { o.alive.setValue(!1), n._window.close() }, requestFullscreen: function() { n._requestFullscreen() }, exitFullscreen: function() { n._exitFullscreen() } }, o.alive.subscribe(function(t) { t || o !== n._area || n.free() }), this._area = o, this._resizeHandler = function() {
                    var t = o.body.value(),
                        e = t[0].clientWidth,
                        i = t[0].clientHeight;
                    o.availHeight.setValue(i), o.availWidth.setValue(e), o.height.setValue(i), o.width.setValue(e)
                }, this._resizeHandler(), $(this._window).on("resize", this._resizeHandler), new s.ResizerDetacherState(o).bridge()
            }
        }, {
            key: "free",
            value: function() {
                if (this._resizeHandler && ($(this._window).off("resize", this._resizeHandler), this._resizeHandler = null), this._visibilityApi && (this._visibilityApi.destroy(), this._visibilityApi = null), this._area) {
                    var t = this._area;
                    this._area = null, t.alive.setValue(!1), t.body.value().remove()
                }
            }
        }, { key: "_requestFullscreen", value: function() { this._fullscreenApi.enter() } }, { key: "_exitFullscreen", value: function() { this._fullscreenApi.exit() } }, {
            key: "_initFullscreen",
            value: function() {
                var t = this,
                    e = this._window.document;
                this._fullscreenApi = new r.FullscreenApi(e), this._fullscreenApi.isFullscreen.subscribe(function(i) { i ? (t._$exitFullscreenButton = $("<div>", e).addClass("tv-exit-fullscreen-button").text($.t("Exit Full Screen (ESC)")).on("click", function(e) { e.preventDefault(), t._exitFullscreen() }).appendTo(e.body), t._onExitFullscreenEsc = function(e) { 27 === e.keyCode && (e.preventDefault(), t._exitFullscreen()) }, $(e).on("keyup", t._onExitFullscreenEsc)) : (t._$exitFullscreenButton && (t._$exitFullscreenButton.remove(), t._$exitFullscreenButton = null), t._onExitFullscreenEsc && ($(e).off("keyup", t._onExitFullscreenEsc), t._onExitFullscreenEsc = null)), t._resizeHandler && t._resizeHandler() })
            }
        }]), t
    }(), c = e.screenMetrics = function(t) {
        var e, i, o = $(t),
            n = o.offset(),
            s = { left: +n.left, top: +n.top, width: o.width(), height: o.height() },
            r = o.prop("ownerDocument");
        return r && (e = r.defaultView) ? (i = e.innerWidth / $(r.documentElement).width(), isFinite(i) && (s.left *= i, s.top *= i, s.width *= i, s.height *= i), s.left += e.screenLeft || e.screenX || 0, s.top += e.screenTop || e.screenY || 0, s) : s
    }, d = function(t, e) {
        $(t).find("style, link").each(function(t, i) {
            var o, n, s = i.tagName.toLowerCase();
            if ("link" !== s || "stylesheet" === i.getAttribute("rel")) {
                for (o = $("<" + s + ">", e), n = 0; n < i.attributes.length; n++) o.attr(i.attributes[n].nodeName, i.attributes[n].nodeValue);
                o.text(i.textContent), o.appendTo(e)
            }
        })
    }, e.createPopup = function() {
        var t, e, i, o, n, s, r, a = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
            l = "menubar=no,toolbar=no,location=no,personalbar=no,status=no",
            u = { width: a.width, height: a.height, top: a.top, left: a.left };
        if (a.useElementMetrics) { t = c(a.useElementMetrics); for (e in u) isFinite(u[e]) || (u[e] = t[e]) }
        for (i in u) null != u[i] && (l += "," + i + "=" + u[i]);
        if (o = void 0, o = null != a.name ? a.name : "_blank", !(n = window.open("", o, l)) || n.closed) return null;
        s = null;
        try { s = n.document, s.close() } catch (t) { return null }
        return s.open(), s.write('<!DOCTYPE html>\n<html>\n<head>\n\t<meta http-equiv="X-UA-Compatible" content="IE=Edge" />\n</head>\n<body>\n</body>\n</html>'), s.close(), s.body.innerHTML = "", null != a.title && (s.title = a.title + ""), a.useStyles && d(a.useStyles, s.head), $("<style>", s).text("html, body {min-width: 0 !important; max-width: none !important}").appendTo(s.head), r = new h(n), p(window, n, r), r
    }, p = function(t, e, i) {
        var o = function o() { t && (t.removeEventListener("unload", o, !1), t = null), e && (e.removeEventListener("unload", o, !1), e.close(), e = null), i && (i.free(), i = null) };
        t.addEventListener("unload", o, !1), e.addEventListener("unload", o, !1)
    }
}, function(t, e, i) {
    "use strict";

    function o(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }

    function n(t, e) {
        var i = new Date(t + e),
            o = Math.round(Math.abs(e) / 6e4),
            n = "UTC";
        return 0 !== o && (n += e > 0 ? "+" : "-", n += Math.floor(o / 60), o % 60 && (n += ":" + o % 60)), i.getUTCFullYear() + "-" + ("0" + (i.getUTCMonth() + 1)).slice(-2) + "-" + ("0" + i.getUTCDate()).slice(-2) + " " + ("0" + i.getUTCHours()).slice(-2) + ":" + ("0" + i.getUTCMinutes()).slice(-2) + " (" + n + ")"
    }

    function s(t) { return "string" == typeof t && 0 !== t.trim().length }

    function r(t) {
        var e, i, o, n, r;
        if (!t || 0 === t.length) return !0;
        for (e = 0; e < t.length; e++) {
            if (s(t[e]) || t[e].id || s(t[e].title)) return !1;
            if (t[e].lines)
                for (i = t[e].lines, o = i.length, n = 0; n < o; n++)
                    if (r = i[n], s(r) || s(r.line)) return !1
        }
        return !0
    }

    function a(t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; return t.hasOwnProperty("text") ? t.hasOwnProperty("color") && i ? e.append($("<span>", { style: "color: " + t.color }).text(t.text)) : e.text(t.text) : e.text(t) }

    function l(t, e) { Array.isArray(t) && 2 === t.length ? $("<dl>").append(a(t[0], $("<dt>")), a(t[1], $("<dd>"), !0)).appendTo(e) : t.hasOwnProperty("br") && t.br ? $("<br>").appendTo(e) : $("<dl>").append(a(t, $("<dt>"))).appendTo(e) }

    function h(t, e) {
        var i, o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "";
        if ("string" == typeof t) $("<h2>").text(t).appendTo(e);
        else if (t.hasOwnProperty("lines"))
            for (i = 0; i < t.lines.length; i++) t.lines[i].hasOwnProperty("line") && (0 === i ? t.lines[i].line.isEmpty || $("<h2>").text(t.lines[i].line).appendTo(e) : l(t.lines[i].line, e));
        else t.hasOwnProperty("title") && $("<h2>").text(t.title).appendTo(e), t.hasOwnProperty("actual") && $("<dl>").append($("<dt>").text($.t("Actual") + ": "), $("<dd>").text(t.actual || "—")).appendTo(e), t.hasOwnProperty("forecast") && $("<dl>").append($("<dt>").text($.t("Forecast") + ": "), $("<dd>").text(t.forecast || "—")).appendTo(e), t.hasOwnProperty("previous") && $("<dl>").append($("<dt>").text($.t("Previous") + ": "), $("<dd>").text(t.previous || "—")).appendTo(e), t.hasOwnProperty("timestamp") && $("<dl>").append($("<dt>").text($.t("Date") + ": "), $("<dd>").text(n(t.timestamp, o) || "—")).appendTo(e)
    }
    var c, d, p, u;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.Tooltip = void 0, c = function() {
        function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
        return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
    }(), i(512), d = -10, p = 300, u = 200, e.Tooltip = function() {
        function t() {
            var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
                i = e.isPowerdByFx,
                n = void 0 !== i && i,
                s = e.direction,
                r = void 0 === s ? "top" : s;
            o(this, t), this._isPowerdByFx = n, this._direction = r, this._tooltipShown = !1, this._tooltipX = void 0, this._tooltipY = void 0, this._tooltipItems = null, this._$tooltip = $("<div>").addClass("tv-chart-events-source__tooltip").css({ position: "absolute", width: "200px", "margin-bottom": "top" === this._direction ? d : 0, opacity: 0, "pointer-events": "none" }), this._$tooltipContent = $("<div>").addClass("tv-chart-events-source__tooltip__content").appendTo(this._$tooltip), this._isPowerdByFx && (this._$tooltipPoweredby = $("<div>").addClass("tv-chart-events-source__tooltip__poweredby").appendTo(this._$tooltip), this._$tooltipPoweredby.html(" " + $.t("powered by {0}").format('<img src="images/svg/daily-fx-logo-two-lines.svg" class="tv-chart-events-source__tooltip__poweredby__image">')))
        }
        return c(t, [{
            key: "show",
            value: function() {
                var t, e, i, o, n, s, a, l, c, u, _, f, m, g, v, y, b, w, S, T = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
                    C = T.items,
                    x = void 0 === C ? [] : C,
                    P = T.x,
                    L = void 0 === P ? 0 : P,
                    k = T.y,
                    I = void 0 === k ? 0 : k,
                    A = T.wrapElement,
                    E = void 0 === A ? null : A,
                    M = T.timeOffset,
                    D = void 0 === M ? "" : M,
                    O = T.leftBorderColor,
                    V = void 0 === O ? null : O;
                if (E && !r(x)) {
                    if (t = $(E).width(), e = $(E).height(), i = !1, o = !1, this._tooltipShown || (this._$tooltip.appendTo(E), this._tooltipShown = !0, i = !0, o = !0), L === this._tooltipX && I === this._tooltipY || (i = !0), i && (n = Math.max(Math.min(L - 100, t - 200), 0), this._$tooltip.css({ left: Math.round(n), bottom: Math.round(e - I + 10) })), this._tooltipItems || (o = !0), !o)
                        for (s = x.length; s--;)
                            if (this._tooltipItems[s] !== x[s]) { o = !0; break }
                    if (o) {
                        if (a = void 0, x.length <= 1) a = x;
                        else {
                            for (l = {}, c = x.length; c--;) u = x[c].importance, null == u && (u = -1), l[u] || (l[u] = []), l[u].push(x[c]);
                            if (_ = Object.keys(l).sort(function(t, e) { return t - e }), _.length <= 1) a = l[_[0]];
                            else
                                for (a = [], f = _.length; f--;)
                                    for (m = l[_[f]], g = m.length; g--;) a.push(m[g])
                        }
                        for (this._$tooltipContent.empty(), v = a.length; v--;) y = a[v], b = "", y.hasOwnProperty("importance") ? ("string" == typeof y.importance && ("earnings" === y.importance ? b = "--importance-earnings" : "splits" === y.importance ? b = "--importance-splits" : "dividends" === y.importance && (b = "--importance-dividends")), 0 === y.importance ? b = "--importance-normal" : y.importance > 0 && (b = "--importance-high")) : V || (b = "--importance-none"), w = "tv-chart-events-source__tooltip__item", b && (w += " " + w + b), S = $("<div>").attr("class", w), V && S.css("border-left-color", V), h(y, S, D), S.appendTo(this._$tooltipContent);
                        this._tooltipItems = x
                    }
                    "bottom" === this._direction && this._$tooltip.css({ bottom: Math.round(e - I - this._$tooltipContent.height() + 10) }), this._$tooltip.stop().animate({ "margin-bottom": "top" === this._direction ? 0 : d, opacity: 1 }, p)
                }
            }
        }, {
            key: "hide",
            value: function() {
                var t = this;
                this._tooltipShown && this._$tooltip.stop().animate({ "margin-bottom": "top" === this._direction ? d : 0, opacity: 0 }, u, function() { t._$tooltip.detach(), t._tooltipShown = !1 })
            }
        }, { key: "isOpened", value: function() { return this._tooltipShown } }]), t
    }()
}, function(t, e, i) {
    "use strict";

    function o(t) {
        var e, i;
        if (t && t.__esModule) return t;
        if (e = {}, null != t)
            for (i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
        return e.default = t, e
    }

    function n(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
    var s, r, a, l, h, c, d, p;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.DropdownView = void 0, s = function() {
        function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
        return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
    }(), i(517), r = i(186), a = i(54), l = o(a), h = i(145), c = i(113), d = o(c), p = e.DropdownView = function() {
        function t(e) {
            var i = this,
                o = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
            n(this, t), this.$el = e, this.$wrap = o.$wrap || e.find(".tv-dropdown-behavior__button"), this.$body = o.$body || e.find(".tv-dropdown-behavior__body"), this.notCloseWithCtrl = !!o.notCloseWithCtrl && o.notCloseWithCtrl, this.closeWithEsc = void 0 === o.closeWithEsc || o.closeWithEsc,
                this.closeWithEsc && this.$el.attr("tabIndex", 0), (e.data("scroll") || o.scroll) && (this.$scroll = this.$body.find(".tv-dropdown-behavior__scroll"), this.$inScroll = this.$scroll.find(".tv-dropdown-behavior__inscroll"), this.scroll = new h.SidebarCustomScroll(this.$scroll, this.$inScroll, { showTopShadow: !1, showBottomShadow: !1 }), this.$scrollBar = this.scroll.getScrollBar(), this.$scrollBar && this.$scrollBar.on("mousedown.tv-dropdown-view-scroll", function() { i.offClickOutside(), $(document).on("mouseup.tv-dropdown-view-scroll", function() { i.onClickOutside(), $(document).off("mouseup.tv-dropdown-view-scroll") }) })), (e.data("adaptBody") || o.adaptBody) && (this._adaptBody = !0), this.$wrap.add(e.find(".js-dropdown-toggle")).on("click", function(t) { $(t.currentTarget).hasClass("js-prevent-dropdown") || i.toggle() })
        }
        return s(t, [{ key: "toggle", value: function() { this.opened ? this.close(!0) : this.open() } }, {
            key: "open",
            value: function() {
                var t = this;
                this.animating || this.opened || this.disabled || (this.animating = !0, this.$el.trigger("beforeOpenMenu"), this.$body.removeClass("i-hidden"), this.$wrap.addClass("i-dropped"), this.$el.addClass("i-opened"), this._adaptBody && this.adaptBody(), this.updateDelays(), setTimeout(function() { t.$body.addClass("i-opened"), t.$el.trigger("updateScroll"), t.$el.trigger("afterOpenMenu"), t.onClickOutside(), t.animating = !1, t.opened = !0 }, 20), this.closeWithEsc && this.$el.on("keypress keyup", function(e) { e.keyCode === d.ESC && t.close(!0) }))
            }
        }, {
            key: "onClickOutside",
            value: function() {
                var t = this;
                setTimeout(function() { t.$body.on("clickoutside", function() { t.close(!0), t.offClickOutside() }) }, 1)
            }
        }, { key: "offClickOutside", value: function() { this.$body.off("clickoutside") } }, {
            key: "close",
            value: function() {
                var t = this,
                    e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
                this.animating || !this.opened || this.disabled || !e && this.notCloseWithCtrl && (window.event.ctrlKey || window.event.metaKey) || (this.animating = !0, this.$body.addClass("i-closing"), this.$wrap.removeClass("i-dropped"), this.$el.addClass("i-closing").trigger("beforeCloseMenu"), setTimeout(function() { t.$body.removeClass("i-opened i-closing").addClass("i-hidden"), t.$el.removeClass("i-opened i-closing").trigger("afterCloseMenu"), t.animating = !1, t.opened = !1 }, l.dur), this.closeWithEsc && this.$el.off("keypress keyup"))
            }
        }, { key: "isOpened", value: function() { return this.opened } }, { key: "updateScroll", value: function() { this.scroll && (this.scroll.updateScrollBar(), this.scroll.scrollToStart()) } }, {
            key: "updateDelays",
            value: function() {
                var t = this.$scroll || this.$body,
                    e = t.offset().top,
                    i = t.outerHeight(),
                    o = this.$body.find(".tv-dropdown-behavior__item").filter(function(t, o) {
                        var n = $(o),
                            s = n.offset().top;
                        return s + n.outerHeight() >= e && s < e + i
                    }),
                    n = this.$el.data("item-coeff") ? parseFloat(this.$el.data("item-coeff")) : 1;
                o.each(function(t, e) {
                    var i = l.easingFunc.easeInQuad(t / o.length) * (.045 * l.dur * n * o.length) + .375 * l.dur + "ms";
                    $(e).css({ "transition-delay": i, "-o-transition-delay": i, "-ms-transition-delay": i, "-moz-transition-delay": i, "-webkit-transition-delay": i })
                })
            }
        }, { key: "enable", value: function() { this.$wrap.removeClass("i-disabled"), this.disabled = !1 } }, {
            key: "disable",
            value: function() { this.$wrap.addClass("i-disabled"), this.disabled = !0 }
        }, {
            key: "adaptBody",
            value: function() {
                function t() { o.height("auto") }

                function e(t) {
                    var e = "tv-dropdown-behavior__body--from_top",
                        i = "tv-dropdown-behavior__body--from_top-right",
                        n = "tv-dropdown-behavior__body--from_bottom",
                        s = "tv-dropdown-behavior__body--from_bottom-right",
                        r = void 0,
                        a = void 0;
                    o.hasClass(e) && "bottom" === t ? (r = e, a = n) : o.hasClass(i) && "bottom" === t ? (r = i, a = s) : o.hasClass(n) && "top" === t ? (r = n, a = e) : o.hasClass(s) && "top" === t && (r = s, a = i), r !== a && o.removeClass(r).addClass(a)
                }
                var i = 15,
                    o = this.$body,
                    n = this.$wrap.get(0).getBoundingClientRect(),
                    s = window.innerHeight,
                    r = this.$inScroll.outerHeight(!0),
                    a = parseFloat(o.css("padding-top")),
                    l = parseFloat(o.css("padding-bottom")),
                    h = n.top + r + i <= s,
                    c = r + i <= n.bottom,
                    d = void 0;
                h ? (d = 0 - a, t(), e("top")) : c ? (d = -r + l, t(), e("bottom")) : (d = -n.top + i, s <= r && o.height(s - 2 * i)), o.css("top", d)
            }
        }]), t
    }(), $.fn.tvDropdown = (0, r.createTvBlockWithInstance)("tv-dropdown", function(t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; return new p(t, e) })
}, 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(138)
}, function(t, e, i) {
    (function(t) {
        "use strict";

        function o(e) {
            var i, o, h, c, d, p, u, _, f, m, g;
            if (e = $.extend({}, l, e), i = $(t.render(r, { tabs: e.tabs, customControls: e.customControls, customControlsAddClass: e.customControlsContainerAddClass }, { additionalHeaderContent: e.additionalHeaderContent })), o = $(a), h = o, e.contentAddClass && o.addClass(e.contentAddClass), !1 !== e.withScroll && (o = $('<div class="js-dialog__scroll-wrap tv-dialog__scroll-wrap">').append(h.addClass("tv-dialog__scroll-wrap-inner"))), c = $('<div class="tv-tabbed-dialog">').append(i).append(o), e.customControls && i.find(".js-custom-controls").append(e.customControls), !0 !== e.doNotCreatePages)
                for (d = 0; d < e.tabs.length; ++d) h.append($('<div class="tv-tabbed-dialog__tab-page">').append(e.tabs[d].page));
            return p = e.tabStateSaveKey, u = e.activeTab, _ = e.tabsScrollBoxAddClass, f = 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 = c, m = (0, s.createDialog)(e), g = new n.Tabs(i.find(".tv-tabs").get(0), h.get(0), { addLeftArrowsClass: "tv-tabbed-dialog__tabs-arrow-left", addRightArrowsClass: "tv-tabbed-dialog__tabs-arrow-right", addScrollBoxClass: _, tabClass: f, saveTab: p, activeTab: u }), m.on("afterOpen", function() { g.setActivePage(g.index(), !0, !0) }), { dialog: m, tabs: g }
        }
        var n, s, r, a, l;
        Object.defineProperty(e, "__esModule", { value: !0 }), e.createTabbedDialog = o, n = i(754), s = i(71), i(519),
            r = '<div class="tv-dialog__section tv-dialog__section--title tv-tabbed-dialog__header js-dialog__drag js-close-button-place"><div class="tv-tabs tv-tabbed-dialog__tabs js-dialog__drag">{{#tabs}}<div class="tv-tabs__tab">{{name}}</div>{{/tabs}}</div>{{#customControls}}<div class="js-custom-controls tv-tabbed-dialog__custom-controls {{#customControlsAddClass}}{{customControlsAddClass}}{{/customControlsAddClass}}"></div>{{/customControls}}<div class="tv-tabbed-dialog__bottom-border"></div></div>{{>additionalHeaderContent}}', a = '<div class="tv-tabbed-dialog__pages-container"></div>', l = { tabs: [] }
    }).call(e, i(30))
}, function(t, e) {
    "use strict";

    function i(t, e) { var i; return function() { clearTimeout(i), i = setTimeout(t.bind.apply(t, [this].concat(Array.prototype.slice.call(arguments))), e) } }
    Object.defineProperty(e, "__esModule", { value: !0 }), e.default = i, t.exports = e.default
}, , , , , , , , , , , , , , function(t, e, i) {
    "use strict";

    function o(t, e) { this.handler = t, this.customId = e, this.requestHook = null }

    function n() {}
    var s = i(35).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) {}, 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, e, i, o, n, s, r) {}, 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(34),
        n = i(35).parseJSONorNot,
        s = function() {
            var t, e, i, s, r = {};
            return r.initialize = function(o, n, r, a) { t = o, e = n, i = r, s = a }, r.updateUser = function(t) { e = t }, r.getCharts = function(o, r) { return $.ajax({ url: "{0}/{1}/charts?client={2}&user={3}".format(i, encodeURIComponent(s), encodeURIComponent(t), encodeURIComponent(e)), type: "GET", crossDomain: !0 }).done(function(t) { var e, i = n(t); "ok" !== i.status && console.warn("Charts list request failed: " + i.message), e = i.data.map(function(t) { return { id: t.id, name: t.name, image_url: t.id, modified_iso: t.timestamp, short_symbol: t.symbol, interval: t.resolution } }), o(e) }).fail(r) }, r.removeChart = function(o, r) { $.ajax({ url: "{0}/{1}/charts?client={2}&user={3}&chart={4}".format(i, encodeURIComponent(s), encodeURIComponent(t), encodeURIComponent(e), encodeURIComponent(o)), type: "DELETE", crossDomain: !0 }).done(function(t) { var e = n(t); "ok" !== e.status && console.warn("Chart delete request failed: " + e.message), r() }) }, r.saveChart = function(o, r, a, l, h, c, d) {
                var p = h.id.value(),
                    u = "{0}/{1}/charts?client={2}&user={3}".format(i, encodeURIComponent(s), encodeURIComponent(t), encodeURIComponent(e));
                void 0 !== p && (u += "&chart=" + encodeURIComponent(p)), $.ajax({ url: u, data: { name: o, content: JSON.stringify(l), symbol: r, resolution: a }, type: "POST", crossDomain: !0 }).done(function(t) {
                    var e = n(t);
                    if ("ok" !== e.status) return console.warn("Chart save request failed: " + e.message), void d();
                    c(e.id)
                }).fail(function() { d() })
            }, r.getChartContent = function(o, r, a) {
                $.ajax({ url: "{0}/{1}/charts?client={2}&user={3}&chart={4}".format(i, encodeURIComponent(s), encodeURIComponent(t), encodeURIComponent(e), encodeURIComponent(o.id)), type: "GET", crossDomain: !0 }).done(function(t) {
                    var e, i = n(t);
                    if ("ok" !== i.status) return void console.warn("Chart load request failed: " + i.message);
                    e = JSON.parse(i.data.content), e.uid = o.id, r(e)
                }).fail(function() { a && a() })
            }, r.loadChart = function(t) { r.getChartContent(t, function(t) { o.emit("chart_load_requested", t) }, function() { console.warn("Error loading chart") }) }, r.removeStudyTemplate = function(o, r) { $.ajax({ url: "{0}/{1}/study_templates?client={2}&user={3}&template={4}".format(i, encodeURIComponent(s), encodeURIComponent(t), encodeURIComponent(e), encodeURIComponent(o)), type: "DELETE", crossDomain: !0 }).done(function(t) { var e = n(t); "ok" !== e.status && console.warn("Chart delete request failed: " + e.message), r() }) }, r.getStudyTemplateContent = function(o, r) {
                $.ajax({
                    url: "{0}/{1}/study_templates?client={2}&user={3}&template={4}".format(i, encodeURIComponent(s), encodeURIComponent(t), encodeURIComponent(e), encodeURIComponent(o)),
                    type: "GET",
                    crossDomain: !0
                }).done(function(t) { r(n(t).data) })
            }, r.saveStudyTemplate = function(o, r) { $.ajax({ url: "{0}/{1}/study_templates?client={2}&user={3}".format(i, encodeURIComponent(s), encodeURIComponent(t), encodeURIComponent(e)), type: "POST", crossDomain: !0, data: { name: o.name, content: o.content } }).done(function(t) { var e = n(t); "ok" !== e.status && console.warn("Template save request failed: " + e.message), r({ error: "ok" === e.status ? "" : e.status }) }) }, r._templatesCache = null, r.getStudyTemplatesList = function(o) {
                if (r._templatesCache) return void o(r._templatesCache);
                r._templatesCache = [], $.ajax({ url: "{0}/{1}/study_templates?client={2}&user={3}".format(i, encodeURIComponent(s), encodeURIComponent(t), encodeURIComponent(e)), type: "GET", crossDomain: !0 }).done(function(t) {
                    var e, i;
                    if (null !== r._templatesCache) {
                        if (e = n(t), "ok" !== e.status) return void console.warn("Templates list request failed: " + e.message);
                        i = e.data.map(function(t) { return { is_default: !1, name: t.name } }), r._templatesCache = i, o(i)
                    }
                })
            }, r.invalidateStudyTemplatesList = function() { r._templatesCache = null }, r
        }();
    t.exports = s
}, function(t, e, i) {
    (function(e) {
        "use strict";
        var o = i(58),
            n = i(36).Interval,
            s = i(15),
            r = i(3),
            a = function(t, e) { this._server = t, this._session = e, this._timezone = null, this._timezoneId = "", this._isDWM = !1, this._resolution = null, this.seriesCompleted = new s, this._lastBarTimes = {} };
        a.prototype.lastBarTime = function(t) { return this._lastBarTimes[t] }, a.prototype._userTimezone = function() { return this._timezone }, a.prototype.setTimezone = function(t) { this._timezone = "exchange" === t ? "exchange" : e.get_timezone(t), this._timezoneId = t }, a.prototype.timezone = function() { return this._timezoneId }, a.prototype.setResolution = function(t) { this._isDWM = n.isDWM(t), this._resolution = t }, a.prototype.onRequestMetadata = function(t, e) { this._server.receiveLocalResponse({ method: "studies_metadata", params: [this._session, t, e] }) }, a.prototype.onSymbolResolved = function(t, e) { this._server.receiveLocalResponse({ method: "symbol_resolved", params: [this._session, t, e] }) }, a.prototype.onSymbolError = function(t, e) { this._server.receiveLocalResponse({ method: "symbol_error", params: [this._session, t, e] }) }, a.prototype.onStudyError = function(t, e) { this._server.receiveLocalResponse({ method: "study_error", params: [this._session, t, e] }) }, a.prototype.onSeriesLoading = function(t, e) { this._server.receiveLocalResponse({ method: "series_loading", params: [this._session, t, e] }) }, a.prototype.onSeriesCompleted = function(t, e, i) { this._server.receiveLocalResponse({ method: "series_completed", params: [this._session, t, i, e] }), this.seriesCompleted.fire(t) }, a.prototype.onSeriesError = function(t, e) { this._server.receiveLocalResponse({ method: "series_error", params: [this._session, t, e] }) }, a.prototype.onSeriesClearData = function(t, e) {
            var i = {};
            i[t] = { series: [], turnaround: e }, this._server.receiveLocalResponse({ method: "timescale_update", params: [this._session, i, { index: 0, zoffset: 0, changes: [], marks: [] }] })
        }, a.prototype.onStudyCompleted = function(t, e) {
            this._server.receiveLocalResponse({ method: "study_completed", params: [this._session, t, e] })
        }, a.prototype.onStudyLoading = function(t, e) { this._server.receiveLocalResponse({ method: "study_loading", params: [this._session, t, e] }) }, a.prototype._calcMarksTime = function(t, i, n, s, a) {
            var l, h, c, d, p, u = e.get_timezone(i),
                _ = this;
            if (this._isDWM && !r.enabled("disable_resolution_rebuild"))
                for (p = new o.Session, p.init(u, n), d = 0; d < t.length; d++) c = t[d], l = s(c), h = e.utc_to_cal(u, 1e3 * l), h = p.spec.correctTradingDay(h, u), e.set_hms(h, 0, 0, 0, 0), t[d] = a(c, parseInt(h.valueOf() / 1e3));
            else
                for (d = 0; d < t.length; d++) t[d] = a(t[d], _.timeInTimezone(s(t[d]), u))
        }, a.prototype.onTickmarksUpdated = function(t, e, i, o) {
            var s, r, a, l, h, c, d;
            if (n.isEqual(o, this._resolution)) {
                for (s = e.slice(0), this._calcMarksTime(s, i.timezone, i.session, function(t) { return t }, function(t, e) { return e }), r = [], a = [], h = 0; h < s.length; ++h) c = s[h], r.push([this._spanByTime(c, l), c, t + h]), a.push(c), l = c;
                d = { method: "tickmark_update", params: [this._session, { index: t, zoffset: 0, changes: a, marks: r }] }, this._server.receiveLocalResponse(d)
            }
        }, a.prototype.onTimescaleUpdate = function(t, e, i, o, n, s) {
            var r, a, l, h, c, d, p, u, _ = s && s.slice(0);
            for (this._lastBarTimes[t] = _ ? _ && _[_.length - 1] : i && i[i.length - 1].value[0], this._calcMarksTime(i, o.timezone, o.session, function(t) { return t.value[0] }, function(t, e) { return t.exTime = e, t }), _ && this._calcMarksTime(_, o.timezone, o.session, function(t) { return t }, function(t, e) { return { markTime: e, time: t } }), r = {}, r[t] = { series: i, turnaround: e }, a = [], l = [], c = i.map(function(t) { return { markTime: t.exTime, time: t.value[0] } }), _ && (c = c.concat(_)), d = 0; d < c.length; ++d) p = c[d].markTime, a.push([this._spanByTime(p, h), p, n + d]), l.push(c[d].time), h = p;
            u = { method: "timescale_update", params: [this._session, r, { index: n, zoffset: 0, changes: l, marks: a }] }, this._server.receiveLocalResponse(u)
        }, a.prototype.onSeriesTimeframeUpdate = function(t, e, i, o, n) {
            var s = { method: "series_timeframe", params: [this._session, t, e, i, o, n] };
            this._server.receiveLocalResponse(s)
        }, a.prototype.onPointsetDataUpdate = function(t, e, i, o) { this._onDataUpdate(t, e, i, void 0, o, 1) }, a.prototype.onDataUpdate = function(t, e, i, o, n) { this._onDataUpdate(t, e, i, o, n, 0) }, a.prototype._onDataUpdate = function(t, e, i, o, n, s) {
            var r, a = {},
                l = o ? JSON.stringify({ offsets: o }) : "";
            a[t] = { s: i, ns: { d: l, indexes: [] }, turnaround: e }, r = { method: "data_update", params: [this._session, a] }, this._server.receiveLocalResponse(r)
        }, a.prototype.onQuotesData = function(t) { this._server.receiveLocalResponse({ method: "quote_symbol_data", params: t }) }, a.prototype.onDepthData = function(t) { this._server.receiveLocalResponse({ method: "dd", params: t }) }, a.prototype.onDepthUpdate = function(t) { this._server.receiveLocalResponse({ method: "dpu", params: t }) }, a.prototype.onProjectionUpdate = function(t, e, i, o) {
            var n, s = i.data,
                r = s[s.length - 1],
                a = { data: { reversalAmount: i.reversalAmount, boxSize: i.boxSize, price: r ? r[4] : i.price, bars: s.map(function(t, e) { return { time: e, open: t[1], high: t[2], low: t[3], close: t[4], volume: t[5], factor: t[6], additionalPrice: t[6] } }) } },
                l = {};
            l[t] = { s: o || [], ns: { d: JSON.stringify(a), indexes: s.map(function(t, e) { return i.barsetSize + (t[0] || 0) }) }, turnaround: e }, n = {
                method: "data_update",
                params: [this._session, l]
            }, this._server.receiveLocalResponse(n)
        }, a.prototype.timeInTimezone = function(t, i) { return "exchange" === this._userTimezone() ? parseInt(e.utc_to_cal(i, 1e3 * t).valueOf() / 1e3) : parseInt(e.utc_to_cal(this._userTimezone(), 1e3 * t).valueOf() / 1e3) }, a.prototype._spanByTime = function(t, e) {
            function i(t) { return 60 * t * 60 * 1e3 }

            function o(t) { return 60 * t * 1e3 }

            function n(t) { return 1e3 * t }
            var s, r, a, l = [{ divisor: 1, span: 20 }, { divisor: n(1), span: 19 }, { divisor: o(5), span: 21 }, { divisor: o(30), span: 22 }, { divisor: i(1), span: 30 }, { divisor: i(3), span: 31 }, { divisor: i(6), span: 32 }, { divisor: i(12), span: 33 }];
            if (!e) return 20;
            if (s = new Date(1e3 * e), r = new Date(1e3 * t), r.getYear() !== s.getYear()) return 70;
            if (r.getUTCMonth() !== s.getUTCMonth()) return 60;
            if (r.getUTCDate() !== s.getUTCDate()) return 50;
            for (a = l.length - 1; a >= 0; --a)
                if (Math.floor(s / l[a].divisor) !== Math.floor(r / l[a].divisor)) return l[a].span
        }, TradingView.ChartapiMessagerInstances = [], t.exports = a
    }).call(e, i(57))
}, function(t, e, i) {
    (function(e) {
        "use strict";
        var o = i(81).PlotType,
            n = i(25),
            s = function() {
                function t(t) { e.enabled("charting_library_debug_mode") && console.warn("Overrides:" + t) }

                function s(t, e, i, o) { t.defaults.inputs[e] = o, t.inputs[i].defval = o }

                function r(t, e) { t.defaults.precision = e }

                function a(e, i, o, n) {
                    var s, r, a = o[1];
                    if ("color" === a) {
                        if (s = c(e, i), r = o.length > 2 ? parseInt(o[2]) : NaN, null == s && !isNaN(r) && r > 0) return void t("Plot `{1}` of `{0}` does not have color #{2}".format(e.description, o[0], r));
                        0 == r || isNaN(r) ? (e.defaults.styles[i].color = n, null != s && (s.colors[0].color = n)) : s.colors[r].color = n
                    } else { if (!e.defaults.styles[i].hasOwnProperty(a)) return void t("Plot `{1}` of `{0}` does not have property `{2}`".format(e.description, o[0], a)); "plottype" === a && (n = y[n]), e.defaults.styles[i][a] = n }
                }

                function l(e, i, o, n) { var s = o[1]; if (!e.defaults.bands[i].hasOwnProperty(s)) return void t("Band `{1}` of `{0}` does not have property `{2}`".format(e.description, o[0], s)); "plottype" === s && (n = y[n]), e.defaults.bands[i][s] = n }

                function h(e, i, o, n) {
                    var s = o[1];
                    if (!e.defaults.filledAreasStyle[i].hasOwnProperty(s)) return void t("Area `{1}` of `{0}` does not have property `{2}`".format(e.description, o[0], s));
                    e.defaults.filledAreasStyle[i][s] = n
                }

                function c(t, e) {
                    for (var i in t.plots)
                        if ("colorer" === t.plots[i].type && t.plots[i].target === e) return t.defaults.palettes[t.plots[i].palette];
                    return null
                }

                function d(t) {
                    var e, i, o = JSServer.studyLibrary;
                    for (e = 0; e < o.length; ++e)
                        if (i = o[e].metainfo, i.description.toLowerCase() === t.toLowerCase() || i.shortDescription.toLowerCase() === t.toLowerCase()) return i;
                    return null
                }

                function p(t, e) {
                    for (var i = 0; i < t.inputs.length; ++i)
                        if (t.inputs[i].name.toLowerCase() === e.toLowerCase()) return { id: t.inputs[i].id, index: i };
                    return null
                }

                function u(t, e) {
                    for (var i in t.styles)
                        if (t.styles[i].title.toLowerCase() === e.toLowerCase()) return i;
                    return null
                }

                function _(t, e) {
                    for (var i in t.filledAreas)
                        if (t.filledAreas[i].title.toLowerCase() === e.toLowerCase()) return t.filledAreas[i].id;
                    return null
                }

                function f(t, e) {
                    if (!t.bands) return null;
                    for (var i in t.bands)
                        if (t.bands[i].name.toLowerCase() === e.toLowerCase()) return i;
                    return null
                }
                var m, g, v = {
                        "volume.transparency": "!transparency",
                        "upper limit": "UpperLimit",
                        "lower limit": "LowerLimit"
                    },
                    y = {};
                if (Object.keys(o).forEach(function(t) { y[t.toLowerCase()] = o[t] }), m = {}, m.setMetainfoProperty = function(e, i, o) {
                        var n, c, d, m, g, y, b, w, S, T, C;
                        if (i = v[i] || i, n = i.split("."), c = n[0], 0 === c.indexOf("!")) return void(e[c.slice(1)] = o);
                        d = c.split(":"), c = d[0], c = v[c] || c, m = null, g = null, y = null, b = null, w = "options" === c, S = "precision" === c && e.defaults && e.defaults.precision, T = 2 === d.length ? d[1] : null, "plot" !== T && T || (m = u(e, c)), "band" !== T && T || (g = f(e, c)), "area" !== T && T || (y = _(e, c)), "input" !== T && T || (b = p(e, c)), C = !!m + !!g + !!b + !!w + !!y + !!S, 0 === C ? t("Study `{0}` has no plot or input `{1}`".format(e.description, c)) : C > 1 ? t("Study `{0}` ambiguous identifier `{1}`".format(e.description, c)) : m ? a(e, m, n, o) : b ? s(e, b.id, b.index, o) : g ? l(e, g, n, o) : y ? h(e, y, n, o) : S ? r(e, o) : e[n[1]] = o
                    }, m.setProperty = function(e, i) {
                        var o = e.split(".")[0],
                            n = d(o);
                        if (!n) return void t("Study `{0}` not found".format(o));
                        m.setMetainfoProperty(n, e.substring(o.length + 1), i)
                    }, m.applyDefaultsToFactoryDefaults = function(t) {
                        var e = {};
                        t.forEach(function(t) {
                            var i = t.split(".")[0],
                                o = d(i);
                            o && (e[o.id] = o)
                        }), Object.keys(e).forEach(function(t) {
                            var i = e[t];
                            n.createDefaultsForStudy(i)
                        })
                    }, i(141), "undefined" != typeof __initialMetainfoOverrides && __initialMetainfoOverrides)
                    for (g in __initialMetainfoOverrides) m.setProperty(g, __initialMetainfoOverrides[g]);
                return m
            }();
        t.exports = s
    }).call(e, i(3))
}, function(t, e, i) {
    "use strict";

    function o(t, e) { this._chartApi = t, this.generateSessionId(), this._sessionDisabled = !1, this._disableStatistics = !!e }
    var n = i(60);
    i(12).getLogger("ChartSession");
    o.prototype.destroy = function() { this._sessionDisabled || this.stopSession() }, o.prototype.generateSessionId = function() { this._sessionid = "cs_" + n.randomHash() }, o.prototype.serverTimeOffset = function() { return this._chartApi.serverTimeOffset() }, o.prototype.connected = function() { return this._chartApi.connected() && !this._sessionDisabled }, o.prototype.disconnected = function() {
            var t = this;
            this.restartSession(), Object.keys(this).forEach(function(e) { /^(s|st|symbol_)\d+$/.test(e) && delete t[e] })
        }, o.prototype.initSession = function() { return this._chartApi.createSession(this._sessionid, this) }, o.prototype.stopSession = function() { return this._chartApi.removeSession(this._sessionid) }, o.prototype.restartSession = function() { this.stopSession(), this.generateSessionId(), this.initSession() }, o.prototype.setHandler = function(t) { this._globalHandler = t }, o.prototype.sessionId = function() { return this._sessionid }, o.prototype.connect = function(t) { return this._globalHandler = t, this.initSession(), this._chartApi.connect() }, o.prototype.disconnect = function() { return this._chartApi.disconnect() }, o.prototype.switchTimezone = function(t) { return this._chartApi.switchTimezone(this._sessionid, t) }, o.prototype.resolveSymbol = function(t, e, i) { return this._chartApi.resolveSymbol(this._sessionid, t, e, i) }, o.prototype.createSeries = function(t, e, i, o, n, s) { return this._chartApi.createSeries(this._sessionid, t, e, i, o, n, s) }, o.prototype.removeSeries = function(t, e) { return this._chartApi.removeSeries(this._sessionid, t, e) },
        o.prototype.modifySeries = function(t, e, i, o, n) { return this._chartApi.modifySeries(this._sessionid, t, e, i, o, n) }, o.prototype.requestMoreData = function(t, e, i) { return this._chartApi.requestMoreData(this._sessionid, t, e, i) }, o.prototype.requestMetadata = function(t, e) { this._chartApi.requestMetadata(this._sessionid, t, e) }, o.prototype.isCanCreateStudy = function(t, e) { return this._chartApi.isCanCreateStudy(t, e) }, o.prototype.createStudy = function(t, e, i, o, n, s, r) { return this._chartApi.createStudy(this._sessionid, t, e, i, o, n, s, r) }, o.prototype.rebindStudy = function(t, e, i, o, n, s, r) { return this._chartApi.rebindStudy(this._sessionid, t, e, i, o, n, s, r) }, o.prototype.removeStudy = function(t, e, i) { return this._chartApi.removeStudy(this._sessionid, t, e, i) }, o.prototype.modifyStudy = function(t, e, i, o) { return this._chartApi.modifyStudy(this._sessionid, t, e, i, o) }, o.prototype.createPointset = function(t, e, i, o, n, s) { return this._chartApi.createPointset(this._sessionid, t, e, i, o, n, s) }, o.prototype.modifyPointset = function(t, e, i, o) { return this._chartApi.modifyPointset(this._sessionid, t, e, i, o) }, o.prototype.removePointset = function(t, e) { return this._chartApi.removePointset(this._sessionid, t, e) }, o.prototype.requestMoreTickmarks = function(t, e, i) { return this._chartApi.requestMoreTickmarks(this._sessionid, t, e, i) }, o.prototype.requestFirstBarTime = function(t, e, i) { return this._chartApi.requestFirstBarTime(this._sessionid, t, e, i) }, o.prototype.setVisibleTimeRange = function(t, e, i, o) { return this._chartApi.setVisibleTimeRange(t, this._sessionid, e, i, o) }, o.prototype.onMessage = function(t) {
            switch (t.method) {
                case "connected":
                    this._chartApi.chartCreateSession(this._sessionid, this._disableStatistics);
                    break;
                case "disconnected":
                    this.disconnected()
            }
            this._globalHandler && this._globalHandler(t)
        }, o.prototype.disable = function() { this._sessionDisabled = !0 }, o.prototype.chartApi = function() { return this._chartApi }, t.exports = o
}, function(t, e) {
    "use strict";
    t.exports = function(t, e) {
        var i = document.body,
            o = i[t];
        return o || (o = document.createElement("img"), o.src = e, i[t] = o), o
    }
}, 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() {
            var t, e, i = ["^widgetembed/?$", "^cmewidgetembed/?$", "^([0-9a-zA-Z-]+)/widgetembed/?$", "^([0-9a-zA-Z-]+)/widgetstatic/?$", "^([0-9a-zA-Z-]+)?/?miniwidgetembed/?$", "^([0-9a-zA-Z-]+)?/?mediumwidgetembed/?$", "^embed(-static)?/([0-9a-zA-Z]{8})/?$", "^widgetpopup/?$", "^extension/?$", "^chatwidgetembed/?$", "^ideaswidgetembed/?$", "^ideas-widget/?$", "^view-idea-widget/([0-9a-zA-Z]{8})/?$", "^user-info-widget/?$", "^user-info-widget-get/(.+?)?/?$", "^embed-quotes-provider/?$", "^idea-popup/?$", "^hotlistswidgetembed/?$", "^marketoverviewwidgetembed/?$", "^([0-9a-zA-Z-]+)/marketoverviewwidgetembed/?$", "^eventswidgetembed/?$", "^tickerswidgetembed/?$"],
                o = window.location.pathname.replace(/^\//, "");
            for (e = i.length - 1; e >= 0; e--)
                if (t = RegExp(i[e]), t.test(o)) return !0;
            return !1
        }, e.onOrder = function() { return "/order/" === window.location.pathname }
    }).call(e, i(3))
}, function(t, e, i) {
    (function(e) {
        "use strict";
        var o = i(161).futuresRoots,
            n = function() {
                function t(t, e) { var i = function() {}; return i.prototype = e.prototype, t.prototype = new i, t }

                function i(t) { return t.replace(/[\^\$\(\)\[\]\{\}\*\+\?\|\\]/g, "\\$&") }

                function n() {}

                function s(t) { this.value = t }

                function r() {}

                function a() {}

                function l() {}

                function h() {}

                function c() {}

                function d() {}

                function p() {}

                function u() {}

                function _(t) { this.value = t }

                function f(t) { this.value = t }

                function m(t) { this.value = t }

                function g() { _.apply(this, arguments) }

                function v() { f.apply(this, arguments) }

                function y(t, e) {
                    var i, o, n, r, a, l, h, c, d = [];
                    t: for (; i = z.exec(t);) {
                        for (o = W.length; o--;)
                            if (i[o + 1]) { W[o].ctor && (n = new W[o].ctor(i[o + 1]), n._offset = i.index, d.push(n)); continue t }
                        r = new m(i[0]), r._offset = i.index, d.push(r)
                    }
                    if (e && e.recover)
                        for (o = d.length; o--;) l = d[o], l instanceof f || l instanceof _ ? (void 0 !== a && (h = new _(""), c = d.splice(o, a - o + 1, h), h.value = c.map(function(t) { return t.value }).join("")), a = o) : l instanceof s || (a = void 0);
                    return d
                }

                function b(t) {
                    var i, o, n, h, c, d, p, u, g, v;
                    if (e.enabled("charting_library_base")) return { currentState: "var" };
                    for (i = "init", o = "var", n = "operator", h = i, c = { warnings: [], errors: [], isEmpty: !0 }, d = [], p = 0; p < t.length; p++)
                        if (!((u = t[p]) instanceof s))
                            if (delete c.isEmpty, u.isIncomplete && (g = { status: "incomplete", reason: "incomplete_token", offset: u._offset, token: u }, u.incompleteSuggest && (g.recover = { append: u.incompleteSuggest() }), c.warnings.push(g), p !== t.length - 1)) g.status = "error";
                            else if (u instanceof _ || u instanceof f) {
                        if (h === o) { c.errors.push({ status: "error", reason: "unexpected_token", offset: u._offset, token: u }); continue }
                        h = o
                    } else if (u instanceof l) {
                        if (h !== o) { c.errors.push({ status: "error", reason: "unexpected_token", offset: u._offset, token: u }); continue }
                        h = n
                    } else if (u instanceof r) {
                        if (h === o) { c.errors.push({ status: "error", reason: "unexpected_token", offset: u._offset, token: u }); continue }
                        d.push(u), h = i
                    } else if (u instanceof a) {
                        if (h !== o) { c.errors.push({ status: "error", reason: "unexpected_token", offset: u._offset, token: u }); continue }
                        v = d.pop(), v || c.errors.push({ status: "error", reason: "unbalanced_brace", offset: u._offset, token: u, recover: { prepend: new r } }), h = o
                    } else u instanceof m && c.errors.push({ status: "error", reason: "unparsed_entity", offset: u._offset, token: u });
                    for (c.braceBalance = d.length,
                        h !== o && c.warnings.push({ status: "incomplete" }), v = null; d.length;) u = d.pop(), g = { status: "incomplete", reason: "unbalanced_brace", offset: u._offset, token: u }, h === o && (g.recover = { append: new a }), c.warnings.push(g);
                    return c.currentState = h, 0 === c.warnings.length && delete c.warnings, 0 === c.errors.length && delete c.errors, c
                }

                function w(t) { var e, i = []; for (e = 0; e < t.length; e++) t[e] instanceof s || i.push(t[e]); return i }

                function S(t) { var e, i, o, n, s, h, c; for (t = w(t), e = [], i = [], n = 0; n < t.length; n++) s = t[n], s instanceof l ? i.length && i[i.length - 1].minPrecedence > s.precedence && (i[i.length - 1].minPrecedence = s.precedence) : s instanceof r ? i.push(o = { minPrecedence: 1 / 0, openBraceIndex: n }) : s instanceof a && (o = i.pop(), h = t[o.openBraceIndex - 1], (c = t[n + 1]) instanceof l && !(c.precedence <= o.minPrecedence) || !(!(h instanceof l) || h.precedence < o.minPrecedence || h.precedence === o.minPrecedence && h.commutative) || (e.unshift(o.openBraceIndex), e.push(n), i.length && i[i.length - 1].minPrecedence > o.minPrecedence && (i[i.length - 1].minPrecedence = o.minPrecedence))); for (n = e.length; n--;) t.splice(e[n], 1); return t }

                function T(t) { for (var e = 0; e < t.length; e++) t[e].parse && t[e].parse(); return t }

                function C(t) { var e = x(t); return S(e ? e : [new f("1"), new p, new r].concat(t).concat(new a)) }

                function x(t) {
                    var e, i, o, n = 0,
                        h = 1,
                        c = 2,
                        d = 3,
                        u = n,
                        _ = 0;
                    for (i = 0; i < t.length; i++)
                        if (!((o = t[i]) instanceof s)) switch (u) {
                            case n:
                                if (!(o instanceof f && 1 == +o.value)) return !1;
                                u = h;
                                break;
                            case h:
                                if (!(u === h && o instanceof p)) return !1;
                                u = c, e = i + 1;
                                break;
                            case c:
                                if (o instanceof r) u = d, _ = 1;
                                else if (o instanceof l) return !1;
                                break;
                            case d:
                                o instanceof r ? _++ : o instanceof a && --_ <= 0 && (u = c)
                        }
                    return t.slice(e)
                }

                function P(t) { return new _(t).ticker() }

                function L(t) { if ("string" != typeof t) throw new TypeError("expression must be a string"); return t = y(t), t.filter(function(t) { return t instanceof _ }).map(function(t) { return t.exchange() }).filter(function(t) { return t }) }

                function k(t) { return t = L(t), 1 !== t.length ? null : t[0] }

                function I(t, e) { return t = L(t), t.some(function(t) { return !!~e.indexOf((t || "").toUpperCase()) }) }

                function A(t) { return I(t, ["BATS"]) }

                function E(t) { return (t = k(t)) && -1 !== t.toUpperCase().indexOf("_EOD") }

                function M(t) { return I(t, ["CHXEUR"]) }

                function D(t) { return I(t, ["CHXJPY"]) }

                function O(t) { return I(t, ["MOEX_DLY", "LSE_DLY", "LSIN_DLY", "BSE_DLY", "NSE_DLY", "CME_DL", "CME_MINI_DL", "CBOT_DL", "CBOT_MINI_DL", "COMEX_DL", "COMEX_MINI_DL", "NYMEX_DL", "NYMEX_MINI_DL", "ASX_DLY", "BME_DLY", "NZX_DLY", "NAG_DLY", "BMFBOVESPA_DLY", "TSE_DLY", "TFX_DLY", "BCBA_DLY", "OTC_DLY", "FSE_DLY", "SSE_DLY", "BIST_DLY", "TOCOM_DLY", "SIX_DLY", "EURONEXT_DLY", "BMV_DLY", "TSX_DLY", "TSXV_DLY", "HKEX_DLY", "TWSE_DLY"]) }

                function $(t, e) { return !!(t = k(t)) && t.substr(0, e.length) === e }

                function V(t) { if ("string" != typeof t) throw new TypeError("expression must be a string"); var e = S(w(y(t))); return e.forEach(function(t) { t instanceof _ && t.exchange(null) }), R(e) }

                function B(t) { if ("string" != typeof t) throw new TypeError("expression must be a string"); return R(S(w(y(t)))) }

                function R(t) { return t.join("") }
                var N, F, z, W = [{ pattern: "(", ctor: r }, { pattern: ")", ctor: a }, { pattern: "+", ctor: h }, { pattern: "-", ctor: c }, { pattern: "*", ctor: d }, { pattern: "/", ctor: p }, {
                    pattern: "^",
                    ctor: u
                }, { pattern: /\d+(?:\.\d*|(?![a-zA-Z0-9_!:\.&]))|\.\d+/, ctor: f }, { pattern: /\./, ctor: v }, { pattern: e.enabled("charting_library_base") ? /[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF^][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!:\.&]*|'.+?'/ : /[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!|:\.&]*|'.+?'/, ctor: _ }, { pattern: /'[^']*/, ctor: g }, { pattern: /[\0-\x20\s]+/, ctor: s }];
                return n.prototype.toString = function() { return this.value }, t(s, n), t(r, n), r.prototype.value = "(", t(a, n), a.prototype.value = ")", t(l, n), t(h, l), h.prototype.value = "+", h.prototype.precedence = 0, h.prototype.commutative = !0, t(c, l), c.prototype.value = "-", c.prototype.precedence = 0, c.prototype.commutative = !1, t(d, l), d.prototype.value = "*", d.prototype.precedence = 1, d.prototype.commutative = !0, t(p, l), p.prototype.value = "/", p.prototype.precedence = 1, p.prototype.commutative = !1, t(u, l), u.prototype.value = "^", u.prototype.precedence = 2, u.prototype.commutative = !1, N = /^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i, F = /[\+\-\/\*]/, t(_, n), _.prototype.toString = function() { if (this.hasOwnProperty("_ticker")) { var t = F.test(this._ticker) ? "'" : ""; return t + (this._exchange ? this._exchange + ":" : "") + this._ticker + t } return this.value }, _.prototype.parse = function() {
                    var t = N.exec(this.value);
                    t[1] && (this._exchange = t[1]), this._ticker = t[2]
                }, _.prototype.parseAsFutures = function() {
                    var t, e, i;
                    if (o)
                        for (this.hasOwnProperty("_ticker") || this.parse(), t = function(t) { return o.some(function(e) { return e.t === t }) }, e = 2; e >= 1; --e)
                            if (i = this._ticker.slice(0, e), t(i)) { this._root = i, this._contract = this._ticker.slice(e); break }
                }, _.prototype.exchange = function(t) {
                    if (this.hasOwnProperty("_ticker") || this.parse(), !(arguments.length > 0)) return this._exchange;
                    null === t || void 0 === t ? delete this._exchange : this._exchange = t + ""
                }, _.prototype.ticker = function(t) {
                    if (this.hasOwnProperty("_ticker") || this.parse(), !(arguments.length > 0)) return this._ticker;
                    null === t || void 0 === t ? delete this._ticker : this._ticker = t + "", delete this._root, delete this._contract
                }, _.prototype.root = function(t) {
                    if (this.hasOwnProperty("_root") || this.parseAsFutures(), !(arguments.length > 0)) return this._root;
                    null === t || void 0 === t ? delete this._root : (this._root = t + "", this._root && (this._ticker = this._root + (this._contract || "")))
                }, _.prototype.contract = function(t) {
                    if (this.hasOwnProperty("_contract") || this.parseAsFutures(), !(arguments.length > 0)) return this._root;
                    null === t || void 0 === t ? delete this._contract : (this._contract = t + "", this._root && (this._ticker = this._root + this._contract))
                }, t(f, n), f.prototype.toString = function() { return this.hasOwnProperty("_normalizedValue") ? this._normalizedValue : this.value }, f.prototype.parse = function() { this._normalizedValue = this.value.replace(/^0+|\.0*$/g, "").replace(/(\.\d*?)0+$/, "$1").replace(/^(\.|$)/, "0$1") }, m.prototype.toString = function() { return this.value }, t(g, _), g.prototype.isIncomplete = !0, g.prototype.incompleteSuggest = function() { if ("'" !== this.value) return "'" }, t(v, f), v.prototype.isIncomplete = !0, z = RegExp(W.map(function(t) { return "(" + ("string" == typeof t.pattern ? i(t.pattern) : t.pattern.source) + ")" }).concat(".").join("|"), "g"), {
                    tokenize: y,
                    validate: b,
                    factorOutBraces: S,
                    normalizeTokens: T,
                    flip: C,
                    hasBatsSymbols: A,
                    hasEodSymbols: E,
                    hasChxeurSymbols: M,
                    hasChxjpySymbols: D,
                    hasFreeDelaySymbols: O,
                    getExchange: k,
                    isExchange: $,
                    SymbolToken: _,
                    IncompleteSymbolToken: g,
                    NumberToken: f,
                    BinaryOperatorToken: l,
                    OpenBraceToken: r,
                    CloseBraceToken: a,
                    ticker: P,
                    shortName: V,
                    normalize: B
                }
            }();
        t.exports = n
    }).call(e, i(3))
}, , 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) }, 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) {
    "use strict";
    t.exports = { INSERT_AT_END: 0, INSERT_AT_START: 1, INSERT_AT_POS: 2, WRAPPER_TAG: "div", WRAPPER_ATTRIBUTES: { class: "context-menu-wrapper" }, MENU_TAG: "table", ITEM_ROW_TAG: "tr", ICON_CELL_TAG: "td", TEXT_CELL_TAG: "td", RIGHT_CELL_TAG: "td", SUBMENU_CELL_TAG: "td" }
}, function(t, e, i) {
    "use strict";

    function o(t) {
        var e, i = [],
            n = t.m_items;
        for (e = 0; e < n.length; e++) n[e]._menu && (i.push(n[e]._menu), i = i.concat(o(n[e]._menu)));
        return i
    }

    function n(t, e, i) {
        var o, n;
        this.options = {}, this._parentMenuItem = i, $.extend(this.options, e), this.options.class && (this.options.attributes.class = this.options.class), this.jqMenu = null, this.m_wrapper = null, this.m_items = [];
        for (o in t) n = t[o], this.addItem(n)
    }
    var s = i(288),
        r = i(47).ActionPlaceholder,
        a = i(600),
        l = a.Item,
        h = a.ItemPlaceholder,
        c = i(143),
        d = i(144);
    n.prototype.addItem = function(t) { var e; return e = t instanceof r ? new h(t, this) : new l(t, this), this.m_items.push(e), e }, n.renderItem = function(t, e) { t.append(e.render(t)) }, n.prototype.closeOtherSubmenus = function(t) { for (var e = 0; e < this.m_items.length; ++e) this.m_items[e].highlight(!1), this.m_items[e]._menu && (this.m_items[e]._menu.destroy(), this.m_items[e]._menu = null) }, n.prototype.isShown = function() { return null !== this.jqMenu }, n.prototype.render = function() { var t, e, i, o = this.getAttributes(); if (this._parentMenuItem) { t = $("<table>"), this.jqMenu = t, t.attr("cellspacing", "0"), t.attr("cellpadding", "0"), t.addClass("context-menu"), t.addClass("submenu"); for (e in this.m_items) i = this.m_items[e], n.renderItem(t, i) } else { t = d.create(s.MENU_TAG, o), this.jqMenu = t; for (e in this.m_items) i = this.m_items[e], n.renderItem(t, i) } return this.jqMenu },
        n.prototype.getAttributes = function() {
            var t = {},
                e = ["context-menu"];
            return this.options.attributes && this.options.attributes.class && e.push(this.options.attributes.class), t.cellspacing = 0, t.cellpadding = 0, t.class = e.join(), t
        }, n.prototype.deploy = function(t, e) { var i = this.wrapper(); return this.jqMenu = i.append(this.render()), e ? ($(e).data("submenu", this.jqMenu), $(document.body).append(this.jqMenu), this.jqMenu.data("parent-menu", e), this.jqMenu.data("parent-item", t.currentTarget)) : $(document.body).append(this.jqMenu), c.unbindContextMenu(this.jqMenu), this._setCoords(t), this.jqMenu }, n.prototype.show = function(t, e) { this.deploy(t, e).show() }, n.prototype.hide = function() { this.isShown() && this.destroy() }, n.prototype.destroy = function() { $.each(this.m_items, function(t, e) { e._menu && e._menu.destroy() }), this.jqMenu && (this.jqMenu.remove(), this.jqMenu = null), this.m_wrapper.empty() }, n.prototype._setCoords = function(t) {
            var e, i, o, n, s, r = 5,
                a = this.jqMenu,
                l = $(this.jqMenu.data("parent-item")),
                h = { width: $(window).width(), height: Math.min($(window).height(), $("body").height()) },
                c = { top: $(document).scrollTop(), left: $(document).scrollLeft() };
            for (this.jqMenu.css({ maxWidth: h.width - 2 * r, maxHeight: h.height - 2 * r }), e = { width: a.outerWidth(), height: a.outerHeight() }, l.size() ? (o = l.offset(), i = { top: o.top - 1, left: o.left + l.outerWidth() }) : i = { top: t.pageY, left: t.pageX }, this.jqMenu.offset(i), n = {}, n.top = Math.min(i.top, h.height + c.top - e.height - r), i.left + e.width + r > h.width || this.options.reverse ? n.left = i.left + c.left - e.width : n.left = i.left, s = t.target; s && s !== document; s = s.parentNode)
                if ("fixed" === $(s).css("position")) { this.jqMenu.css("position", "fixed"); break }
            this.jqMenu.offset(n)
        }, n.prototype._wrapper = function() {
            var t = this,
                e = s.WRAPPER_ATTRIBUTES;
            return this._parentMenuItem ? this.m_wrapper = d.create(s.WRAPPER_TAG, e) : (this.m_wrapper = c.createPopup(e, void 0, {
                mouseDownOutsideEvent: function(e) {
                    var i = $();
                    $.each(o(t), function() { i = i.add(this.m_wrapper) }), $(e.target).parents().andSelf().is(i) || t.hide()
                }
            }), this.m_wrapper.addClass("topmenu")), this.m_wrapper
        }, n.prototype.wrapper = function(t) { return this.m_wrapper || this._wrapper() }, t.exports = n
}, function(t, e, i) {
    "use strict";
    var o = i(43);
    t.exports[o.STYLE_AREA] = i(836), t.exports[o.STYLE_BARS] = i(839), t.exports[o.STYLE_CANDLES] = i(846), t.exports[o.STYLE_HEIKEN_ASHI] = i(859), t.exports[o.STYLE_HOLLOW_CANDLES] = i(862), t.exports[o.STYLE_LINE] = i(881)
}, function(t, e, i) {
    (function(e, o) {
        "use strict";

        function n(t) {
            var n = i(603);
            this._options = $.extend({ interval: 1 }, t || {}), this._e = $("<div>").addClass("intervals-container favored-list-container"), this._quick = $("<div>").addClass("quick").appendTo(this._e), this._quicked = {}, this._main = $('<span class="apply-common-tooltip">').text(this.shortLabel(this._options.interval)).attr("title", this.fullLabel(this._options.interval)).appendTo(this._quick), this._main.data("interval", this._options.interval), e.enabled("header_interval_dialog_button") && this._setIntervalDialogButton(), this._mainSub = $("<span>").addClass("submenu").attr("title", $.t("Time Interval")).append($("<i>")).appendTo(this._e),
                t && "string" == typeof t.submenuBtnAddClass && this._mainSub.addClass(t.submenuBtnAddClass), this._quick.on("click", this._selectInterval.bind(this)), this._mainSub.on("click", this._selectMenu.bind(this)), this._menu = new n(this, this._mainSub, this._options), this.onResize = new o, r.intraday.subscribe(this._fullUpdate.bind(this)), r.supportedResolutions.subscribe(this._fullUpdate.bind(this)), t.interval && r.interval.setValue(t.interval), r.interval.subscribe(this.activateInterval.bind(this), { callWithLast: !0 }), l.on("intervalwidget-change", this._onChangeInAnotherTab.bind(this)), this._fullUpdate()
        }
        var s = i(36).Interval,
            r = i(72),
            a = i(164).translatedIntervalString,
            l = i(128).TVXWindowEvents;
        n.prototype.forceUpdate = function() { this._fullUpdate(!0) }, n.prototype._fullUpdate = function(t) { this._setupIntervals(t), this._setupQuicks(t), this.reactivateInterval(), this._resize() }, n.prototype._onChangeInAnotherTab = function() { this._fullUpdate(!0) }, n.prototype.isDefaultInterval = function(t) { return t in ChartApiInstance.defaultResolutions() }, n.getIntervals = function() { return TradingView.clone(ChartApiInstance.defaultResolutions()) }, n.prototype._setupIntervals = function() { this._intervals = n.getIntervals() }, n.sortIntervals = function(t) { Array.isArray(t) || (t = Object.keys(t)); var e = function(t) { var e = new s(t); return e.kind() !== s.MINUTES ? { S: 1 / 60, D: 1440, W: 10080, M: 43200 }[e.letter()] * e.multiplier() : e.multiplier() }; return t.sort(function(t, i) { return e(t) - e(i) }) }, n.prototype.getSortedIntervals = function() { return n.sortIntervals(this._intervals) }, n.prototype.setUpStarredItemsList = function(t) {
                var e, i = {};
                for (e = 0; e < t.length; ++e) i[t[e]] = !0;
                this._setupQuicks(!1, i)
            }, n.prototype._setupQuicks = function(t, i) { this._options.notShowQuicks && !i || (i = i || {}, e.enabled("star_some_intervals_by_default") && (i = { 1: !0, 30: !0, 60: !0 }), this._quicked = TVSettings.getJSON("IntervalWidget.quicks", i, t), this._quicked = this._removeCustomIntervalQuicks(this._quicked)), this._addQuicked(this._quicked) }, n.prototype._removeCustomIntervalQuicks = function(t) { var e = {}; return Object.keys(t).forEach(function(i) { this.isDefaultInterval(i) && (e[i] = t[i]) }, this), e }, n.prototype.element = function() { return this._e }, n.prototype.mainButton = function() { return this._main }, n.prototype._quicks = function() { return this._quick.find("span").slice(0, -1) }, n.prototype.postfix = function(t, e) {
                if (e) {
                    var i = " ";
                    switch (t) {
                        case "D":
                            i += $.t("day", { plural: "days", count: e });
                            break;
                        case "W":
                            i += $.t("week", { plural: "weeks", count: e });
                            break;
                        case "M":
                            i += $.t("month", { plural: "months", count: e });
                            break;
                        case "S":
                            i += $.t("second", { plural: "seconds", count: e });
                            break;
                        case "m":
                            i += $.t("minute", { plural: "minutes", count: e });
                            break;
                        case "h":
                            i += $.t("hour", { plural: "hours", count: e })
                    }
                    return i
                }
                switch (t) {
                    case "m":
                        return "";
                    case "h":
                        return $.t("h", { context: "interval_short" });
                    case "D":
                        return $.t("D", { context: "interval_short" });
                    case "W":
                        return $.t("W", { context: "interval_short" });
                    case "M":
                        return $.t("M", { context: "interval_short" });
                    default:
                        return t.toUpperCase()
                }
            }, n.prototype.readable = function(t, e, i) {
                function o(t) { return t >= 60 && !(t % 60) }
                var n, r;
                if (t = t, n = "m", e = e, r = new s(t), !r.isValid()) throw new TypeError("Wrong interval value: " + t);
                return r.kind() !== s.MINUTES && (n = r.letter()), t = r.multiplier(), r.kind() === s.MINUTES && o(t) && (t = ~~(t / 60), n = "h"), e = e ? t : null, "" + (t = i && 1 === t && r.isDWM() ? "" : t) + this.postfix(n, e)
            }, n.prototype.shortLabel = function(t) { return a(this.readable(t, !1)) }, n.prototype.fullLabel = function(t) { return this.readable(t, !0) }, n.prototype._addQuicked = function(t) {
                var e, o, s, r, a, l, h, c;
                for (t = n.sortIntervals(t), e = this._quicks(), o = $(), s = !1, e.size() > t.length && (e.slice(t.length).remove(), s = !0), r = i(215), a = 0; a < t.length; a++) l = t[a], h = e.eq(a), c = !1, h.size() ? h.data("interval") !== l && (c = !0) : (h = $('<span class="apply-common-tooltip">'), o = o.add(h), c = !0), c && (h.data("interval", l).attr("title", this.fullLabel(l)).text(this.shortLabel(l)), s = !0), h.toggleClass("selected", l === this.getInterval()).toggleClass("disabled", !r.isAvailable(l));
                this._main.before(o), s && this._resize()
            }, n.prototype._resize = function() { this.onResize.fire() }, n.prototype.addQuick = function(t) { this._quicked[t] = !0, this._addQuicked(this._quicked), this.saveSettings(), this.reactivateInterval() }, n.prototype._quickWithInterval = function(t) { var e = null; return this._quicks().each(function(i, o) { if (o = $(o), t === o.data("interval")) return e = o, !1 }), e }, n.prototype.inQuick = function(t) { return null != this._quickWithInterval(t) }, n.prototype.removeQuick = function(t) { this._quickWithInterval(t) && (this._quickWithInterval(t).remove(), this._resize(), delete this._quicked[t], this.saveSettings(), this.reactivateInterval()) }, n.prototype.toggleQuick = function(t) { var e = this.inQuick(t); return e ? this.removeQuick(t) : this.addQuick(t), !e }, n.prototype.hasQuicks = function() { return !!this._quicks().length }, n.prototype.deactivate = function(t) { this._quick.find("span").removeClass("selected") }, n.prototype.activateInterval = function(t) { this.deactivate(), this.inQuick(t) ? this._quickWithInterval(t).addClass("selected") : (this.hasQuicks() && this._main.addClass("selected"), this._main.data("interval") !== t && (this._main.text(this.shortLabel(t)), this._main.attr("title", this.fullLabel(t)), this._main.data("interval", t), this._resize())) }, n.prototype.reactivateInterval = function() { this.activateInterval(this.getInterval()) }, n.prototype.getInterval = function() { return r.interval.value() }, n.prototype.setInterval = function(t) { r.interval.setValue("" + t) }, n.prototype._selectInterval = function(t) {
                var e = $(t.target),
                    i = e.data("interval");
                this.hasQuicks() || this.getInterval() !== i ? e.hasClass("disabled") || this.setInterval(i) : this._selectMenu()
            }, n.prototype._selectMenu = function(t) { this._mainSub.hasClass("active") ? this._menu.close() : this._menu.open(this.getSortedIntervals()) }, n.prototype._setIntervalDialogButton = function() {
                var t = i(190);
                this._intervalDialogButton = $("<span>").addClass("submenu interval-dialog-button apply-common-tooltip").attr("title", $.t("Open Interval Dialog")).append($("<i>")).appendTo(this._e).click(function() {
                    var e = new t({ callback: function(t) { r.interval.setValue(t) } }).show(),
                        i = $(this);
                    i.addClass("active"), e.on("destroy", function() { i.removeClass("active") })
                })
            }, n.prototype.addInterval = function(t) {},
            n.prototype.removeInterval = function(t) {}, n.prototype.saveIntervals = function() {}, n.prototype.saveQuicked = function() { TVSettings.setJSON("IntervalWidget.quicks", this._quicked) }, n.prototype.saveSettings = function() { this.saveQuicked(), this.saveIntervals(), l.emit("intervalwidget-change") }, t.exports = n
    }).call(e, i(3), i(15))
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { l.call(this, t, e), this._linetool = i, this.prepareLayout() }

    function n(t, e, i) { s.call(this, t, e, i), this.prepareLayout() }
    var s = i(10),
        r = i(64),
        a = i(5),
        l = a.PropertyPage,
        h = a.SliderBinder,
        c = i(46).createTransparencyEditor;
    inherit(o, r), o.prototype.prepareLayout = function() {
        var t, e, o, n, s, a, l = i(76),
            h = $('<table class="property-page" cellspacing="0" cellpadding="0">'),
            c = $('<table class="property-page" cellspacing="0" cellpadding="0">').data({ "layout-tab": l.TAB_NAME_INPUTS, "layout-tab-priority": l.TAB_PRIORITY_INPUTS });
        this._table = h.add(c), r.prototype.prepareLayoutForTable.call(this, h), t = $("<tr>").appendTo(c), $("<td>").append($.t("Avg HL in minticks")).appendTo(t), e = $("<td>").appendTo(t), o = $("<input type='text'>").addClass("ticker").appendTo(e), t = $("<tr>").appendTo(c), $("<td>").append($.t("Variance")).appendTo(t), n = $("<td>").appendTo(t), s = $("<input type='text'>").addClass("ticker").appendTo(n), a = this._linetool.properties(), this.bindInteger(o, a.averageHL, $.t("Change Average HL value"), 1, 5e4), this.bindInteger(s, a.variance, $.t("Change Variance value"), 1, 100), this.loadData()
    }, o.prototype.widget = function() { return this._table }, inherit(n, s), n.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, r, a, l, d, p;
        this._widget = $("<div>"), t = $("<table cellspacing=4>").appendTo(this._widget), e = this.createColorPicker(), i = this.createColorPicker(), o = this.createColorPicker(), n = this.createColorPicker(), s = this.createColorPicker(), r = $("<input type='checkbox' class='visibility-switch'/>").data("hides", $(n).add(s)), a = $("<input type='checkbox' class='visibility-switch'/>").data("hides", $(o)), l = this.addLabeledRow(t, $.t("Candles")), $("<td>").prependTo(l), $("<td>").append(e).appendTo(l), $("<td>").append(i).appendTo(l), l = this.addLabeledRow(t, $.t("Borders"), r), $("<td>").append(r).prependTo(l), $("<td>").append(n).appendTo(l), $("<td>").append(s).appendTo(l), $("<td>").appendTo(l), l = this.addLabeledRow(t, $.t("Wick"), a), $("<td>").append(a).prependTo(l), $("<td>").append(o).appendTo(l), $("<td>").appendTo(l), t = $("<table>").appendTo(this._widget), l = $("<tr>").appendTo(t), $("<td colspan='2'>").append($.t("Transparency")).appendTo(l), d = c(), $("<td colspan='2'>").append(d).appendTo(l), p = this._linetool.properties(), this.bindColor(e, p.candleStyle.upColor, "Change Candle Up Color"), this.bindColor(i, p.candleStyle.downColor, "Change Candle Down Color"), this.bindBoolean(a, p.candleStyle.drawWick, "Change Candle Wick Visibility"), this.bindColor(o, p.candleStyle.wickColor, "Change Candle Wick Color"), this.bindBoolean(r, p.candleStyle.drawBorder, "Change Candle Border Visibility"), this.bindColor(n, p.candleStyle.borderUpColor, "Change Candle Up Border Color"), this.bindColor(s, p.candleStyle.borderDownColor, "Change Candle Down Border Color"),
            this.bindControl(new h(d, p.transparency, !0, this.model(), "Change Guest Feed Transparency"))
    }, n.prototype.widget = function() { return this._widget }, e.LineToolGhostFeedInputsPropertyPage = o, e.LineToolGhostFeedStylesPropertyPage = n
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { s.call(this, t, e, i), this.prepareLayout() }

    function n(t, e, i) { r.call(this, t, e, i) }
    var s = i(10),
        r = i(64),
        a = i(5),
        l = a.BooleanBinder,
        h = a.SimpleComboBinder,
        c = a.SimpleStringBinder,
        d = a.ColorBinding,
        p = a.SliderBinder,
        u = i(19).createLineStyleEditor,
        _ = i(13).createLineWidthEditor;
    inherit(o, s), o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, r, a, f, m, g, v, y, b;
        this._res = $("<div>"), this._table = $('<table class="property-page" cellspacing="0" cellpadding="2" style="width:100%"></table>').appendTo(this._res), t = _(), e = u(), i = this.createColorPicker(), o = this.addLabeledRow(this._table, "Line"), $("<td>").append(i).appendTo(o), $("<td>").append(t).appendTo(o), $('<td colspan="3">').append(e.render().css("display", "block")).appendTo(o), n = $("<input type='checkbox' class='visibility-switch'>"), o = $("<tr>").appendTo(this._table), $('<td colspan="3">').append($("<label>").append(n).append($.t("Show Price"))).prependTo(o), s = $("<input type='checkbox'>"), o = $("<tr>").appendTo(this._table), $('<td colspan="3">').append($("<label>").append(s).append($.t("Show Text"))).prependTo(o), o = this.addLabeledRow(this._table, "Text:"), r = this.createColorPicker(), a = this.createFontSizeEditor(), f = this.createFontEditor(), m = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'), g = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'), $("<td>").append(r).appendTo(o), $("<td>").append(f).appendTo(o), $("<td>").append(a).appendTo(o), $("<td>").append(m).appendTo(o), $("<td>").append(g).appendTo(o), o = $("<tr>").appendTo(this._table), $("<td colspan='2'>").append($.t("Text Alignment:")).appendTo(o), v = $("<select><option value='left'>" + $.t("left") + "</option><option value='center'>" + $.t("center") + "</option><option value='right'>" + $.t("right") + "</option></select>"), y = $("<select><option value='bottom'>" + $.t("top") + "</option><option value='middle'>" + $.t("middle") + "</option><option value='top'>" + $.t("bottom") + "</option></select>").data("selectbox-css", { display: "block" }), $("<td>").append(v).appendTo(o), $("<td colspan='3'>").append(y).appendTo(o), b = $("<textarea rows='7' cols='60'>").css("width", "100%"), o = $("<tr>").appendTo(this._table), $("<td colspan='7'>").append(b).appendTo(o), this.bindControl(new l(s, this._linetool.properties().showLabel, !0, this.model(), "Change Horz Line Text Visibility")), this.bindControl(new h(v, this._linetool.properties().horzLabelsAlign, null, !0, this.model(), "Change Horz Line Labels Alignment")), this.bindControl(new h(y, this._linetool.properties().vertLabelsAlign, null, !0, this.model(), "Change Horz Line Labels Alignment")), this.bindControl(new c(b, this._linetool.properties().text, null, !0, this.model(), "Change Text")),
            this.bindControl(new l(n, this._linetool.properties().showPrice, !0, this.model(), "Change Horz Line Price Visibility")), this.bindControl(new d(i, this._linetool.properties().linecolor, !0, this.model(), "Change Horz Line Color")), this.bindControl(new h(e, this._linetool.properties().linestyle, parseInt, !0, this.model(), "Change Horz Line Style")), this.bindControl(new p(t, this._linetool.properties().linewidth, !0, this.model(), "Change Horz Line Width")), this.bindControl(new h(a, this._linetool.properties().fontsize, parseInt, !0, this.model(), "Change Text Font Size")), this.bindControl(new h(f, this._linetool.properties().font, null, !0, this.model(), "Change Text Font")), this.bindControl(new d(r, this._linetool.properties().textcolor, !0, this.model(), "Change Text Color")), this.bindControl(new l(m, this._linetool.properties().bold, !0, this.model(), "Change Text Font Bold")), this.bindControl(new l(g, this._linetool.properties().italic, !0, this.model(), "Change Text Font Italic")), this.loadData()
    }, o.prototype.widget = function() { return this._res }, inherit(n, r), n.prototype.prepareLayout = function() {
        var t, e, i, o;
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">'), (t = this._linetool.points()[0]) && (e = this._linetool.properties().points[0], i = this.createPriceEditor(e.price), o = $("<tr>").appendTo(this._table), $("<td>" + $.t("Price") + "</td>").appendTo(o), $("<td>").append(i).appendTo(o), this.loadData())
    }, e.LineToolHorzLineStylesPropertyPage = o, e.LineToolHorzLineInputsPropertyPage = n
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { r.call(this, t, e, i), this.prepareLayout() }

    function n(t, e, i) { s.call(this, t, e, i), this.prepareLayout() }
    var s = i(10),
        r = i(64),
        a = i(5),
        l = a.LessTransformer,
        h = a.GreateTransformer,
        c = a.ToIntTransformer,
        d = a.ToFloatTransformer,
        p = a.SimpleStringBinder,
        u = a.ColorBinding,
        _ = a.SliderBinder,
        f = a.SimpleComboBinder,
        m = a.BooleanBinder,
        g = i(13).createLineWidthEditor,
        v = i(26).NumericFormatter;
    inherit(o, r), o.prototype.prepareLayout = function() {
        function t(t) { return (new v).format(t) }
        var e, i, o, n, s, r, a, u, _, f, m, g;
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">'), e = $("<tbody>").appendTo(this._table), i = this.addLabeledRow(e, $.t("Stop Level. Ticks:")), o = $('<input type="text">'), $("<td>").append(o).appendTo(i), o.addClass("ticker"), n = $('<input type="text" class="ticker">'), $("<td>" + $.t("Price:") + "</td>").appendTo(i), $("<td>").append(n).appendTo(i), s = this.addLabeledRow(e, $.t("Entry price:")), r = $('<input type="text" class="ticker">'), $('<td colspan="2">').append(r).appendTo(s), a = this.addLabeledRow(e, $.t("Profit Level. Ticks:")), u = $('<input type="text" class="ticker">'), $("<td>").append(u).appendTo(a), _ = $('<input type="text" class="ticker">'), $("<td>" + $.t("Price:") + "</td>").appendTo(a), $("<td>").append(_).appendTo(a), "LineToolRiskRewardLong" === this._linetool.getConstructor() && (i.detach().appendTo(e), a.detach().prependTo(e)), f = [c(this._linetool.properties().stopLevel.value()), h(0), l(1e9)], this.bindControl(new p(o, this._linetool.properties().stopLevel, f, !1, this.model(), "Change " + this._linetool + " stop level")),
            f = [c(this._linetool.properties().profitLevel.value()), h(0), l(1e9)], this.bindControl(new p(u, this._linetool.properties().profitLevel, f, !1, this.model(), "Change " + this._linetool + " profit level")), f = [d(this._linetool.properties().entryPrice.value())], m = new p(r, this._linetool.properties().entryPrice, f, !1, this.model(), "Change " + this._linetool + " entry price"), m.addFormatter(t), this.bindControl(m), g = this, f = [d(this._linetool.properties().stopPrice.value()), function(t) { return g._linetool.preparseStopPrice(t) }], m = new p(n, this._linetool.properties().stopPrice, f, !1, this.model(), "Change " + this._linetool + " stop price"), m.addFormatter(t), this.bindControl(m), f = [d(this._linetool.properties().targetPrice.value()), function(t) { return g._linetool.preparseProfitPrice(t) }], m = new p(_, this._linetool.properties().targetPrice, f, !1, this.model(), "Change " + this._linetool + " stop price"), m.addFormatter(t), this.bindControl(m)
    }, o.prototype.widget = function() { return this._table }, inherit(n, s), n.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, r, a, c, v, y, b, w, S, T, C, x;
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">'), t = $("<tbody>").appendTo(this._table), e = g(), i = this.createColorPicker(), o = this.addLabeledRow(t, $.t("Lines:")), $("<td>").append(i).appendTo(o), $("<td>").append(e).appendTo(o), o = this.addLabeledRow(t, $.t("Stop Color:")), n = this.createColorPicker(), $("<td>").append(n).appendTo(o), o = this.addLabeledRow(t, $.t("Target Color:")), s = this.createColorPicker(), $("<td>").append(s).appendTo(o), o = this.addLabeledRow(t, $.t("Text:")), r = this.createColorPicker(), a = this.createFontSizeEditor(), c = this.createFontEditor(), $("<td>").append(r).appendTo(o), $("<td>").append(c).appendTo(o), $("<td>").append(a).appendTo(o), o = $("<tr>").appendTo(t), v = $("<label>").text($.t("Compact")), y = $('<input type="checkbox">').prependTo(v), $("<td>").append(v).appendTo(o), o = this.addLabeledRow(t, $.t("Account Size")), b = $('<input type="text" class="ticker">'), $("<td>").append(b).appendTo(o), o = this.addLabeledRow(t, $.t("Risk")), w = $('<input type="text" class="ticker">'), $("<td>").append(w).appendTo(o), v = $("<label>").text($.t("%")), S = $('<input type="checkbox">').appendTo(v), $("<td>").append(v).appendTo(o), T = this._linetool.properties(), this.bindControl(new u(i, T.linecolor, !0, this.model(), "Change Risk/Reward line Color")), this.bindControl(new _(e, T.linewidth, !0, this.model(), "Change Risk/Reward line width")), this.bindControl(new u(n, T.stopBackground, !0, this.model(), "Change stop color", T.stopBackgroundTransparency)), this.bindControl(new u(s, T.profitBackground, !0, this.model(), "Change target color", T.profitBackgroundTransparency)), this.bindControl(new f(a, T.fontsize, parseInt, !0, this.model(), "Change Text Font Size")), this.bindControl(new f(c, T.font, null, !0, this.model(), "Change Text Font")), this.bindControl(new u(r, T.textcolor, !0, this.model(), "Change Text Color")), this.bindControl(new m(y, T.compact, !0, this.model(), "Compact mode")), C = [d(T.accountSize.value()), h(1), l(1e9)], this.bindControl(new p(b, T.accountSize, C, !1, this.model(), "Change " + this._linetool + " Account Size")),
            this.bindControl(new m(S, T.showRiskInPercents, !0, this.model(), "Price / %")), x = [d(T.risk.value()), h(1), function(t) { if (T.showRiskInPercents.value()) return t > 100 ? 100 : t; var e = T.accountSize.value(); return t > e ? e : t }], this.bindControl(new p(w, T.risk, x, !1, this.model(), "Change " + this._linetool + " Risk")), this.loadData()
    }, n.prototype.onResoreDefaults = function() { this._linetool.recalculate() }, n.prototype.widget = function() { return this._table }, e.LineToolRiskRewardInputsPropertyPage = o, e.LineToolRiskRewardStylesPropertyPage = n
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t, i, o) {
            var n = { saveAsText: $.t("Save As..."), applyDefaultText: $.t("Apply Defaults") };
            this._toolName = t, this._applyTemplate = i, this._options = $.extend(n, o || {}), this._list = [], e.enabled("charting_library_base") || (this.templatesDeferred = this.loadData())
        }
        var n = i(63).bindPopupMenu,
            s = i(139),
            r = s.SaveRenameDialog,
            a = s.InputField,
            l = i(93).createConfirmDialog,
            h = i(12).getLogger("Chart.LineToolTemplatesList");
        o._cache = {}, o.prototype.getData = function() { return this._list }, o.prototype.loadData = function() { var t = this; return this._toolName in o._cache ? (this._list = o._cache[this._toolName], $.Deferred().resolve()) : $.get("/drawing-templates/" + this._toolName + "/", function(e) { t._list = e, o._cache[t._toolName] = e }).error(function() { h.logWarn("Failed to load drawing template: " + t._toolName) }) }, o.prototype.templatesLoaded = function() { return this.templatesDeferred }, o.prototype.invalidateToolCache = function() { delete o._cache[this._toolName] }, o.prototype.createButton = function(t) {
                var e, i = this;
                return t = $.extend({}, t, i._options), e = $("<a></span></a>").addClass(t.buttonClass ? t.buttonClass : "_tv-button").html(t.buttonInner ? t.buttonInner : $.t("Template") + '<span class="icon-dropdown">'), n(e, null, { event: "button-popup", zIndex: t.popupZIndex, activeClass: t.popupActiveClass, direction: t.popupDirection }), e.bind("click", function(e) {
                    var o, n, s;
                    e.stopPropagation(), $(this).is("active") || (o = [], "function" == typeof t.getDataForSaveAs && (n = function(e) {
                        var o = JSON.stringify(t.getDataForSaveAs());
                        i.saveTemplate(e, o)
                    }, o.push({ title: t.saveAsText, action: i.showSaveDialog.bind(i, n), addClass: "special" })), "function" == typeof t.defaultsCallback && o.push({ title: t.applyDefaultText, action: t.defaultsCallback, addClass: "special" }), s = [], $.each(i._list, function(e, o) {
                        s.push({
                            title: o,
                            action: function() { i.loadTemplate.call(i, o, t.loadTemplateCallback) },
                            deleteAction: function() {
                                runOrSignIn(function() {
                                    var t = $.t("Do you really want to delete Drawing Template '{0}' ?").format(o),
                                        e = l({ type: "modal", content: t });
                                    e.on("action:yes", function(t) { i.removeTemplate.call(i, o), t.close() }), e.open()
                                }, { source: "Delete line tool template" })
                            }
                        })
                    }), s.length && (s.sort(function(t, e) { return t = t.title.toUpperCase(), e = e.title.toUpperCase(), t === e ? 0 : t > e ? 1 : -1 }), o.push({ separator: !0 }), o = o.concat(s)), $(this).trigger("button-popup", [o]))
                }), e
            }, o.prototype.loadTemplate = function(t, e) { var i = this; return $.get("/drawing-template/" + this._toolName + "/?templateName=" + encodeURIComponent(t), function(t) { i._applyTemplate(JSON.parse(t.content)), e && e() }).error(function(t) { h.logWarn(t.responseText) }) },
            o.prototype.removeTemplate = function(t) {
                if (t) {
                    var e = this;
                    $.post("/remove-drawing-template/", { name: t, tool: e._toolName }).error(function(t) { h.logWarn(t.responseText) }), e.invalidateToolCache(), e._list = $.grep(e._list, function(e) { return e !== t })
                }
            }, o.prototype.saveTemplate = function(t, e) {
                var i, o, n, s, r = this;
                t && e && (t = TradingView.clean(t), i = -1 !== $.inArray(t, r._list), o = function() {
                    var o = { name: t, tool: r._toolName, content: e },
                        n = function() { i || r._list.push(t) };
                    $.post("/save-drawing-template/", o, n).error(function(t) { h.logWarn(t.responseText) }), r.invalidateToolCache()
                }, i ? (n = $.t("Drawing Template '{0}' already exists. Do you really want to replace it?").format(t), s = l({ type: "modal", content: n }), s.on("action:yes", function(t) { o(), t.close() }), s.open()) : o())
            }, o.prototype.deleteAction = function(t) {
                var e = t,
                    i = this;
                runOrSignIn(function() {
                    var t = $.t(" Do you really want to delete Drawing Template '{0}' ?").format(e),
                        o = l({ type: "modal", content: t });
                    o.on("action:yes", function(t) { i.removeTemplate.call(i, e), t.close() }), o.open()
                }, { source: "Delete line tool template" })
            }, o.prototype.showSaveDialog = function(t) {
                var e = "text",
                    i = new r({ fields: [new a({ name: e, label: $.t("Template name") + ":", maxLength: 64, error: $.t("Please enter template name") })], title: $.t("Save Drawing Template As") });
                runOrSignIn(function() { i.show().then(function(i) { t(i[e]) }) }, { source: "Save line tool template", sourceMeta: "Chart" })
            }, t.exports = o
    }).call(e, i(3))
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { s.call(this, t, e, i), this.prepareLayout() }

    function n(t, e, i) { r.call(this, t, e, i) }
    var s = i(10),
        r = i(64),
        a = i(5),
        l = a.GreateTransformer,
        h = a.LessTransformer,
        c = a.ToFloatTransformer,
        d = a.ColorBinding,
        p = a.BooleanBinder,
        u = a.SimpleComboBinder,
        _ = a.SimpleStringBinder,
        f = a.SliderBinder,
        m = i(19).createLineStyleEditor,
        g = i(13).createLineWidthEditor,
        v = i(26).NumericFormatter;
    inherit(o, s), o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, r, a, l, h, c, _, v, y, b, w;
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">'), t = $("<tbody>").appendTo(this._table), e = g(), i = m(), o = this.createColorPicker(), n = this.addLabeledRow(t, $.t("Line")), $("<td>").append(o).appendTo(n), $("<td>").append(e).appendTo(n), $('<td colspan="3">').append(i.render()).appendTo(n), s = $("<tbody>").appendTo(this._table), n = this.addLabeledRow(s, $.t("Text")), r = this.createColorPicker(), a = this.createFontSizeEditor(), l = this.createFontEditor(), h = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'), c = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'), $("<td>").append(r).appendTo(n), $("<td>").append(l).appendTo(n), $("<td>").append(a).appendTo(n), $("<td>").append(h).appendTo(n), $("<td>").append(c).appendTo(n), _ = $('<input type="checkbox">'), v = $('<input type="checkbox">'), n = this.addLabeledRow(s, $.t("Extend Right End")), $('<td colspan="3">').appendTo(n).append(_), n = this.addLabeledRow(s, $.t("Extend Left End")), $('<td colspan="3">').appendTo(n).append(v), y = $('<input type="checkbox">'), b = $('<input type="checkbox">'), w = $('<input type="checkbox">'),
            n = this.addLabeledRow(s, $.t("Show Price Range")), $('<td colspan="3">').appendTo(n).append(y), n = this.addLabeledRow(s, $.t("Show Bars Range")), $('<td colspan="3">').appendTo(n).append(b), n = this.addLabeledRow(s, $.t("Always Show Stats")), $('<td colspan="3">').appendTo(n).append(w), this.bindControl(new p(y, this._linetool.properties().showPriceRange, !0, this.model(), "Change Trend Line Show Price Range")), this.bindControl(new p(b, this._linetool.properties().showBarsRange, !0, this.model(), "Change Trend Line Show Bars Range")), this.bindControl(new u(a, this._linetool.properties().fontsize, parseInt, !0, this.model(), "Change Text Font Size")), this.bindControl(new u(l, this._linetool.properties().font, null, !0, this.model(), "Change Text Font")), this.bindControl(new d(r, this._linetool.properties().textcolor, !0, this.model(), "Change Text Color")), this.bindControl(new p(h, this._linetool.properties().bold, !0, this.model(), "Change Text Font Bold")), this.bindControl(new p(c, this._linetool.properties().italic, !0, this.model(), "Change Text Font Italic")), this.bindControl(new d(o, this._linetool.properties().linecolor, !0, this.model(), "Change Trend Line Color")), this.bindControl(new u(i, this._linetool.properties().linestyle, parseInt, !0, this.model(), "Change Trend Line Style")), this.bindControl(new f(e, this._linetool.properties().linewidth, !0, this.model(), "Change Trend Line Width")), this.bindControl(new p(_, this._linetool.properties().extendRight, !0, this.model(), "Change Trend Angle Extending Right")), this.bindControl(new p(v, this._linetool.properties().extendLeft, !0, this.model(), "Change Trend Angle Extending Left")), this.bindControl(new p(w, this._linetool.properties().alwaysShowStats, !0, this.model(), "Change Trend Line Always Show Stats")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, inherit(n, r), n.prototype.prepareLayout = function() {
        var t, e, i, o, n, s;
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">'), t = this._linetool.points()[0], e = this._linetool.properties().points[0], t && e && (i = this._createPointRow(t, e, ""), this._table.append(i), i = $("<tr>").appendTo(this._table), $("<td>").append($.t("Angle")).appendTo(i), o = $("<input type='text'>"), $("<td>").append(o).appendTo(i), n = [c(e.price.value()), l(-360), h(360)], s = new _(o, this._linetool.properties().angle, n, !1, this.model(), "Change angle"), s.addFormatter(function(t) { return (new v).format(t) }), this.bindControl(s), this.loadData())
    }, n.prototype.widget = function() { return this._table }, e.LineToolTrendAngleStylesPropertyPage = o, e.LineToolTrendAngleInputsPropertyPage = n
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { s.call(this, t, e, i), this.prepareLayout() }

    function n(t, e, i) { r.call(this, t, e, i) }
    var s = i(10),
        r = i(64),
        a = i(5),
        l = a.BooleanBinder,
        h = a.SimpleComboBinder,
        c = a.SliderBinder,
        d = a.ColorBinding,
        p = i(19).createLineStyleEditor,
        u = i(13).createLineWidthEditor;
    inherit(o, s), o.prototype.prepareLayout = function() {
        var t, e, i, o, n;
        this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = u(), e = p(),
            i = this.createColorPicker(), o = this.addLabeledRow(this._table, "Line"), $("<td>").prependTo(o), $("<td>").append(i).appendTo(o), $("<td>").append(t).appendTo(o), $("<td>").append(e.render()).appendTo(o), n = $("<input type='checkbox' class='visibility-switch'>"), o = $("<tr>").appendTo(this._table), $("<td>").append(n).prependTo(o), this.createLabeledCell(2, "Show Time", n).appendTo(o), this.bindControl(new l(n, this._linetool.properties().showTime, !0, this.model(), "Change Vert Line Time Visibility")), this.bindControl(new d(i, this._linetool.properties().linecolor, !0, this.model(), "Change Vert Line Color")), this.bindControl(new h(e, this._linetool.properties().linestyle, parseInt, !0, this.model(), "Change Vert Line Style")), this.bindControl(new c(t, this._linetool.properties().linewidth, !0, this.model(), "Change Vert Line Width")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, inherit(n, r), n.prototype.prepareLayout = function() {
        var t, e, i, o;
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">'), (t = this._linetool.points()[0]) && (e = $('<input type="text" class="ticker">'), i = $("<tr>").appendTo(this._table), $("<td>" + $.t("Bar #") + "</td>").appendTo(i), $("<td>").append(e).appendTo(i), o = this._linetool.properties().points[0], this.bindBarIndex(o.bar, e, this.model(), "Change " + this._linetool + " point bar index"), this.loadData())
    }, e.LineToolVertLineStylesPropertyPage = o, e.LineToolVertLineInputsPropertyPage = n
}, 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(653);
        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(24))
}, , , function(t, e, i) {
    (function(e) {
        "use strict";

        function o() {}
        var n = i(5),
            s = n.PropertyPage,
            r = n.GreateTransformer,
            a = n.LessTransformer,
            l = n.ToIntTransformer,
            h = n.ToFloatTransformer,
            c = n.SimpleStringBinder,
            d = n.SimpleComboBinder,
            p = n.ColorBinding,
            u = n.BooleanBinder,
            _ = n.SliderBinder,
            f = i(13).createLineWidthEditor,
            m = i(736).createPriceSourceEditor,
            g = i(26).NumericFormatter;
        inherit(o, s), o.prototype.i18nCache = [window.t("Style"), window.t("Color bars based on previous close"), window.t("Candles"), window.t("Borders"), window.t("Wick"), window.t("HLC Bars"), window.t("Price Source"), window.t("Type"), window.t("Show real prices on price scale (instead of Heikin-Ashi price)"), window.t("Up bars"), window.t("Down bars"), window.t("Projection up bars"), window.t("Projection down bars"), window.t("Line"), window.t("Fill"), window.t("Up Color"), window.t("Down Color"), window.t("Traditional"), window.t("ATR Length"), window.t("Number Of Line"), window.t("Reversal Amount"), window.t("Box Size")], o.prototype.getInputTitle = function(t, e) { return e.inputInfo ? e.inputInfo[t].name.value() : t.toLowerCase().replace(/\b\w/g, function(t) { return t.toUpperCase() }) }, o.prototype.prepareLayoutImpl = function(t, e, i, o) {
            function n(e) { u.refreshStateControls(p, t.inputs, i.inputs) }

            function s(t) { return (new g).format(t) }
            var p, u, _, f, m, v, y, b, w, S, T, C, x, P, L, k, I;
            for (o = o || {}, p = {}, u = this, _ = 0; _ < t.inputs.length; _++) {
                if (f = t.inputs[_], m = f.id, v = this.getInputTitle(m, i), y = $("<tr/>"), y.appendTo(e), b = $("<td/>"), b.appendTo(y), b.addClass("propertypage-name-label"), b.text($.t(v)), w = $("<td" + (o.valueColspan ? ' colspan = "' + o.valueColspan + '"' : "") + "/>"), w.appendTo(y), S = null, f.options)
                    for (S = $("<select/>"), T = 0; T < f.options.length; T++) C = f.options[T], $("<option value='" + C + "'>" + $.t(C) + "</option>").appendTo(S);
                else S = $("<input/>"), "bool" === f.type ? S.attr("type", "checkbox") : S.attr("type", "text");
                S.appendTo(w), S.css("width", "100px"), x = "Change " + v, f.options ? this.bindControl(new d(S, i.inputs[m], null, !0, this.model(), x)) : "integer" === f.type ? (P = [l(f.defval)], f.min && P.push(r(f.min)), f.max && P.push(a(f.max)), this.bindControl(new c(S, i.inputs[m], P, !1, this.model(), x)), S.addClass("ticker")) : "float" === f.type ? (P = [h(f.defval)], f.min && ((("BarSetRenko@tv-prostudies" === t.id || "BarSetPnF@tv-prostudies" === t.id) && "boxSize" === f.id || "BarSetKagi@tv-prostudies" === t.id && "reversalAmount" === f.id) && (k = this._model.model().mainSeries().symbolInfo(), L = k.minmov / k.pricescale), P.push(r(L || f.min))), f.max && P.push(a(f.max)), I = new c(S, i.inputs[m], P, !1, this.model(), x), I.addFormatter(s), this.bindControl(I), S.addClass("ticker")) : "text" === f.type && this.bindControl(new c(S, this._property.inputs[m], null, !1, this.model(), x)), S.change(n), p[f.id] = y
            }
            this.refreshStateControls(p, t.inputs, i.inputs)
        }, o.prototype.getMetaInfo = function(t) {
            var e, i = this._model.m_model._studiesMetaData;
            for (e = 0; e < i.length; e++)
                if (i[e].id === t) return i[e];
            return null
        }, o.prototype._prepareSeriesStyleLayout = function(t, o, n, s) {
            var r, a, l, h, c, g, v, y, b, w, S, T, C, x, P, L, k, I, A, E, M, D, O, V, B, R, N, F, z, W, H, U, j, q, Y, G, K, X, Z, J, Q, tt, et, it, ot, nt, st, rt, at, lt, ht, ct, dt, pt, ut, _t, ft, mt, gt, vt, yt, bt, wt, St, Tt, Ct, xt, Pt, Lt = i(302),
                kt = $("<tbody>").appendTo(t),
                It = this._candlesColorerTbody = $("<tbody>").appendTo(o),
                At = this._barsColorerTbody = $("<tbody>").appendTo(o),
                Et = this._haColorerTbody = $("<tbody>").appendTo(o),
                Mt = this._candlesTbody = $("<tbody>").appendTo(n),
                Dt = this._hollowCandlesTbody = $("<tbody>").appendTo(n),
                Ot = this._haTbody = $("<tbody>").appendTo(n),
                $t = this._barsTbody = $("<tbody>").appendTo(n),
                Vt = this._lineTbody = $("<tbody>").appendTo(n),
                Bt = this._areaTbody = $("<tbody>").appendTo(n),
                Rt = this._renkoTbody = $("<tbody>").appendTo(n),
                Nt = this._pbTbody = $("<tbody>").appendTo(n),
                Ft = this._kagiTbody = $("<tbody>").appendTo(n),
                zt = this._pnfTbody = $("<tbody>").appendTo(n),
                Wt = this.addLabeledRow(kt, "Style"),
                Ht = $(document.createElement("td")).appendTo(Wt);
            Ht.addClass("property-wide-select"), r = $(document.createElement("select")), $("<option value=" + TradingView.Series.STYLE_BARS + ">" + $.t("Bars") + "</option>").appendTo(r), $("<option value=" + TradingView.Series.STYLE_CANDLES + ">" + $.t("Candles") + "</option>").appendTo(r), $("<option value=" + TradingView.Series.STYLE_HOLLOW_CANDLES + ">" + $.t("Hollow Candles") + "</option>").appendTo(r), this instanceof Lt || $("<option value=" + TradingView.Series.STYLE_HEIKEN_ASHI + ">" + $.t("Heikin Ashi") + "</option>").appendTo(r), $("<option value=" + TradingView.Series.STYLE_LINE + ">" + $.t("Line") + "</option>").appendTo(r), $("<option value=" + TradingView.Series.STYLE_AREA + ">" + $.t("Area") + "</option>").appendTo(r), r.css("width", "100px").appendTo(Ht), this.switchStyle(), a = function(t) { this._undoModel.setChartStyleProperty(this._property, t, this._undoText) }, this.bindControl(new d(r, s.style, parseInt, !0, this.model(), "Change Series Style", a)), s.style.listeners().subscribe(this, this.switchStyle), l = this.createColorPicker(), h = this.createColorPicker(), c = this.createColorPicker(), g = this.createColorPicker(), v = this.createColorPicker(), y = this.createColorPicker(), b = $("<input type='checkbox' class='visibility-switch'/>").data("hides", $(v).add(y)), w = $("<input type='checkbox' class='visibility-switch'/>").data("hides", $(c)), S = $("<input type='checkbox'/>"), T = this.addLabeledRow(It, "Color bars based on previous close", S), $("<td>").append(S).prependTo(T), T = this.addLabeledRow(Mt, "Candles"), $("<td>").prependTo(T), $("<td>").append(l).appendTo(T), $("<td>").append(h).appendTo(T), T = this.addLabeledRow(Mt, "Borders", b), $("<td>").append(b).prependTo(T), $("<td>").append(v).appendTo(T), $("<td>").append(y).appendTo(T), T = this.addLabeledRow(Mt, "Wick", w), $("<td>").append(w).prependTo(T), $("<td>").append(c).appendTo(T), $("<td>").append(g).appendTo(T), this.bindControl(new p(l, s.candleStyle.upColor, !0, this.model(), "Change Candle Up Color")), this.bindControl(new p(h, s.candleStyle.downColor, !0, this.model(), "Change Candle Down Color")), this.bindControl(new u(w, s.candleStyle.drawWick, !0, this.model(), "Change Candle Wick Visibility")), this.bindControl(new p(c, s.candleStyle.wickUpColor, !0, this.model(), "Change Candle Wick Up Color")),
                this.bindControl(new p(g, s.candleStyle.wickDownColor, !0, this.model(), "Change Candle Wick Down Color")), this.bindControl(new u(b, s.candleStyle.drawBorder, !0, this.model(), "Change Candle Border Visibility")), this.bindControl(new p(v, s.candleStyle.borderUpColor, !0, this.model(), "Change Candle Up Border Color")), this.bindControl(new p(y, s.candleStyle.borderDownColor, !0, this.model(), "Change Candle Down Border Color")), this.bindControl(new u(S, s.candleStyle.barColorsOnPrevClose, !0, this.model(), "Change Color Bars Based On Previous Close")), C = this.createColorPicker(), x = this.createColorPicker(), P = this.createColorPicker(), L = this.createColorPicker(), k = this.createColorPicker(), I = this.createColorPicker(), A = $("<input type='checkbox' class='visibility-switch'/>").data("hides", $(k).add(I)), E = $("<input type='checkbox' class='visibility-switch'/>").data("hides", $(P)), T = this.addLabeledRow(Dt, "Candles"), $("<td>").prependTo(T), $("<td>").append(C).appendTo(T), $("<td>").append(x).appendTo(T), T = this.addLabeledRow(Dt, "Borders", A), $("<td>").append(A).prependTo(T), $("<td>").append(k).appendTo(T), $("<td>").append(I).appendTo(T), T = this.addLabeledRow(Dt, "Wick", E), $("<td>").append(E).prependTo(T), $("<td>").append(P).appendTo(T), $("<td>").append(L).appendTo(T), this.bindControl(new p(C, s.hollowCandleStyle.upColor, !0, this.model(), "Change Hollow Candle Up Color")), this.bindControl(new p(x, s.hollowCandleStyle.downColor, !0, this.model(), "Change Hollow Candle Down Color")), this.bindControl(new u(E, s.hollowCandleStyle.drawWick, !0, this.model(), "Change Hollow Candle Wick Visibility")), this.bindControl(new p(P, s.hollowCandleStyle.wickUpColor, !0, this.model(), "Change Hollow Candle Wick Up Color")), this.bindControl(new p(L, s.hollowCandleStyle.wickDownColor, !0, this.model(), "Change Hollow Candle Down Wick Color")), this.bindControl(new u(A, s.hollowCandleStyle.drawBorder, !0, this.model(), "Change Hollow Candle Border Visibility")), this.bindControl(new p(k, s.hollowCandleStyle.borderUpColor, !0, this.model(), "Change Hollow Candle Up Border Color")), this.bindControl(new p(I, s.hollowCandleStyle.borderDownColor, !0, this.model(), "Change Hollow Candle Down Border Color")), M = $("<input type='checkbox'/>"), T = this.addLabeledRow(At, "Color bars based on previous close", M), $("<td>").append(M).prependTo(T), D = $("<input type='checkbox'/>"), T = this.addLabeledRow(At, "HLC Bars", D), $("<td>").append(D).prependTo(T), O = this.addColorPickerRow($t, "Up Color"), V = this.addColorPickerRow($t, "Down Color"), this.bindControl(new p(O, s.barStyle.upColor, !0, this.model(), "Change Bar Up Color")), this.bindControl(new p(V, s.barStyle.downColor, !0, this.model(), "Change Bar Down Color")), this.bindControl(new u(M, s.barStyle.barColorsOnPrevClose, !0, this.model(), "Change Color Bars Based On Previous Close")), this.bindControl(new u(D, s.barStyle.dontDrawOpen, !0, this.model(), "Change HLC Bars")), B = m(), T = this.addLabeledRow(Vt, "Price Source"), $('<td colspan="3">').append(B).appendTo(T), R = this.addLabeledRow(Vt, "Type"), N = $('<td colspan="3">').appendTo(R), N.addClass("property-wide-select"), F = $(document.createElement("select")),
                $("<option value=" + TradingView.Series.STYLE_LINE_TYPE_SIMPLE + ">" + $.t("Simple") + "</option>").appendTo(F), $("<option value=" + TradingView.Series.STYLE_LINE_TYPE_MARKERS + ">" + $.t("With Markers") + "</option>").appendTo(F), $("<option value=" + TradingView.Series.STYLE_LINE_TYPE_STEP + ">" + $.t("Step") + "</option>").appendTo(F), F.appendTo(N), T = this.addLabeledRow(Vt, "Line"), z = this.createColorPicker(), W = f(), $("<td>").append(z).appendTo(T), $("<td>").append(W).appendTo(T), this.bindControl(new d(B, s.lineStyle.priceSource, null, !0, this.model(), "Change Price Source")), this.bindControl(new d(F, s.lineStyle.styleType, parseInt, !0, this.model(), "Change Line Type")), this.bindControl(new p(z, s.lineStyle.color, !0, this.model(), "Change Line Color")), this.bindControl(new _(W, s.lineStyle.linewidth, !0, this.model(), "Change Line Width")), s.haStyle && (H = this.createColorPicker(), U = this.createColorPicker(), j = this.createColorPicker(), q = this.createColorPicker(), Y = this.createColorPicker(), G = this.createColorPicker(), K = $("<input type='checkbox' class='visibility-switch'/>").data("hides", $(Y).add(G)), X = $("<input type='checkbox' class='visibility-switch'/>").data("hides", $(j)), Z = $("<input type='checkbox'/>"), T = this.addLabeledRow(Et, $.t("Color bars based on previous close"), Z), $("<td>").append(Z).prependTo(T), T = this.addLabeledRow(Ot, $.t("Candles")), $("<td>").prependTo(T), $("<td>").append(H).appendTo(T), $("<td>").append(U).appendTo(T), T = this.addLabeledRow(Ot, $.t("Borders"), K), $("<td>").append(K).prependTo(T), $("<td>").append(Y).appendTo(T), $("<td>").append(G).appendTo(T), T = this.addLabeledRow(Ot, $.t("Wick"), X), $("<td>").append(X).prependTo(T), $("<td>").append(j).appendTo(T), $("<td>").append(q).appendTo(T), this.bindControl(new p(H, s.haStyle.upColor, !0, this.model(), "Change Heikin Ashi Up Color")), this.bindControl(new p(U, s.haStyle.downColor, !0, this.model(), "Change Heikin Ashi Down Color")), this.bindControl(new u(X, s.haStyle.drawWick, !0, this.model(), "Change Heikin Ashi Wick Visibility")), this.bindControl(new p(j, s.haStyle.wickUpColor, !0, this.model(), "Change Heikin Ashi Wick Up Color")), this.bindControl(new p(q, s.haStyle.wickDownColor, !0, this.model(), "Change Heikin Ashi Wick Down Color")), this.bindControl(new u(K, s.haStyle.drawBorder, !0, this.model(), "Change Heikin Ashi Border Visibility")), this.bindControl(new p(Y, s.haStyle.borderUpColor, !0, this.model(), "Change Heikin Ashi Up Border Color")), this.bindControl(new p(G, s.haStyle.borderDownColor, !0, this.model(), "Change Heikin Ashi Down Border Color")), this.bindControl(new u(Z, s.haStyle.barColorsOnPrevClose, !0, this.model(), "Change Color Bars Based On Previous Close"))), this instanceof Lt || !e.enabled("japanese_chart_styles") || ($("<option value=" + TradingView.Series.STYLE_RENKO + ">" + $.t("Renko") + "</option>").appendTo(r), $("<option value=" + TradingView.Series.STYLE_PB + ">" + $.t("Line Break") + "</option>").appendTo(r), $("<option value=" + TradingView.Series.STYLE_KAGI + ">" + $.t("Kagi") + "</option>").appendTo(r), $("<option value=" + TradingView.Series.STYLE_PNF + ">" + $.t("Point & Figure") + "</option>").appendTo(r), J = this.createColorPicker(),
                    Q = this.createColorPicker(), T = this.addLabeledRow(Rt, "Up bars"), $('<td class="some-colorpicker">').append(J).append(Q).appendTo(T), tt = this.createColorPicker(), et = this.createColorPicker(), T = this.addLabeledRow(Rt, "Down bars"), $('<td class="some-colorpicker">').append(tt).append(et).appendTo(T), it = this.createColorPicker(), ot = this.createColorPicker(), T = this.addLabeledRow(Rt, "Projection up bars"), $('<td class="some-colorpicker">').append(it).append(ot).appendTo(T), nt = this.createColorPicker(), st = this.createColorPicker(), T = this.addLabeledRow(Rt, "Projection down bars"), $('<td class="some-colorpicker">').append(nt).append(st).appendTo(T), this.prepareLayoutImpl(this.getMetaInfo("BarSetRenko@tv-prostudies"), Rt, s.renkoStyle), this.bindControl(new p(J, s.renkoStyle.upColor, !0, this.model(), "Change Bar Up Color")), this.bindControl(new p(tt, s.renkoStyle.downColor, !0, this.model(), "Change Bar Down Color")), this.bindControl(new p(it, s.renkoStyle.upColorProjection, !0, this.model(), "Change Projection Bar Up Color")), this.bindControl(new p(nt, s.renkoStyle.downColorProjection, !0, this.model(), "Change Projection Bar Down Color")), this.bindControl(new p(Q, s.renkoStyle.borderUpColor, !0, this.model(), "Change Border Bar Up Color")), this.bindControl(new p(et, s.renkoStyle.borderDownColor, !0, this.model(), "Change Border Bar Down Color")), this.bindControl(new p(ot, s.renkoStyle.borderUpColorProjection, !0, this.model(), "Change Projection Border Bar Up Color")), this.bindControl(new p(st, s.renkoStyle.borderDownColorProjection, !0, this.model(), "Change Projection Border Bar Down Color")), rt = this.createColorPicker(), at = this.createColorPicker(), T = this.addLabeledRow(Nt, "Up bars"), $('<td class="some-colorpicker">').append(rt).append(at).appendTo(T), lt = this.createColorPicker(), ht = this.createColorPicker(), T = this.addLabeledRow(Nt, "Down bars"), $('<td class="some-colorpicker">').append(lt).append(ht).appendTo(T), ct = this.createColorPicker(), dt = this.createColorPicker(), T = this.addLabeledRow(Nt, "Projection up bars"), $('<td class="some-colorpicker">').append(ct).append(dt).appendTo(T), pt = this.createColorPicker(), ut = this.createColorPicker(), T = this.addLabeledRow(Nt, "Projection down bars"), $('<td class="some-colorpicker">').append(pt).append(ut).appendTo(T), this.prepareLayoutImpl(this.getMetaInfo("BarSetPriceBreak@tv-prostudies"), Nt, s.pbStyle, { valueColspan: 2 }), this.bindControl(new p(rt, s.pbStyle.upColor, !0, this.model(), "Change Bar Up Color")), this.bindControl(new p(lt, s.pbStyle.downColor, !0, this.model(), "Change Bar Down Color")), this.bindControl(new p(ct, s.pbStyle.upColorProjection, !0, this.model(), "Change Projection Bar Up Color")), this.bindControl(new p(pt, s.pbStyle.downColorProjection, !0, this.model(), "Change Projection Bar Down Color")), this.bindControl(new p(at, s.pbStyle.borderUpColor, !0, this.model(), "Change Border Bar Up Color")), this.bindControl(new p(ht, s.pbStyle.borderDownColor, !0, this.model(), "Change Border Bar Down Color")), this.bindControl(new p(dt, s.pbStyle.borderUpColorProjection, !0, this.model(), "Change Projection Border Bar Up Color")),
                    this.bindControl(new p(ut, s.pbStyle.borderDownColorProjection, !0, this.model(), "Change Projection Border Bar Down Color")), _t = this.addColorPickerRow(Ft, "Up bars"), ft = this.addColorPickerRow(Ft, "Down bars"), mt = this.addColorPickerRow(Ft, "Projection up bars"), gt = this.addColorPickerRow(Ft, "Projection down bars"), this.prepareLayoutImpl(this.getMetaInfo("BarSetKagi@tv-prostudies"), Ft, s.kagiStyle), this.bindControl(new p(_t, s.kagiStyle.upColor, !0, this.model(), "Change Bar Up Color")), this.bindControl(new p(ft, s.kagiStyle.downColor, !0, this.model(), "Change Bar Down Color")), this.bindControl(new p(mt, s.kagiStyle.upColorProjection, !0, this.model(), "Change Projection Bar Up Color")), this.bindControl(new p(gt, s.kagiStyle.downColorProjection, !0, this.model(), "Change Projection Bar Down Color")), vt = this.addColorPickerRow(zt, "Up bars"), yt = this.addColorPickerRow(zt, "Down bars"), bt = this.addColorPickerRow(zt, "Projection up bars"), wt = this.addColorPickerRow(zt, "Projection down bars"), this.prepareLayoutImpl(this.getMetaInfo("BarSetPnF@tv-prostudies"), zt, s.pnfStyle), this.bindControl(new p(vt, s.pnfStyle.upColor, !0, this.model(), "Change Bar Up Color")), this.bindControl(new p(yt, s.pnfStyle.downColor, !0, this.model(), "Change Bar Down Color")), this.bindControl(new p(bt, s.pnfStyle.upColorProjection, !0, this.model(), "Change Projection Bar Up Color")), this.bindControl(new p(wt, s.pnfStyle.downColorProjection, !0, this.model(), "Change Projection Bar Down Color"))), St = m(), T = this.addLabeledRow(Bt, "Price Source"), $('<td colspan="3">').appendTo(T).append(St), Tt = this.createColorPicker(), Ct = f(), T = this.addLabeledRow(Bt, "Line"), $("<td>").appendTo(T).append(Tt), $('<td colspan="2">').appendTo(T).append(Ct), xt = this.createColorPicker(), Pt = this.createColorPicker(), T = this.addLabeledRow(Bt, "Fill"), $("<td>").appendTo(T).append(xt), $("<td>").appendTo(T).append(Pt), this.bindControl(new d(St, s.areaStyle.priceSource, null, !0, this.model(), "Change Price Source")), this.bindControl(new p(Tt, s.areaStyle.linecolor, !0, this.model(), "Change Line Color")), this.bindControl(new _(Ct, s.areaStyle.linewidth, !0, this.model(), "Change Line Width")), this.bindControl(new p(xt, s.areaStyle.color1, !0, this.model(), "Change Line Color", s.areaStyle.transparency)), this.bindControl(new p(Pt, s.areaStyle.color2, !0, this.model(), "Change Line Color", s.areaStyle.transparency))
        }, t.exports = o
    }).call(e, i(3))
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { r.call(this, t, e), this._study = i, this.prepareLayout() }
    var n = i(301),
        s = i(5),
        r = s.PropertyPage,
        a = s.BooleanBinder,
        l = s.SimpleComboBinder,
        h = i(87).StudyStylesPropertyPage;
    inherit(o, r), inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n = $('<table class="property-page" cellspacing="0" cellpadding="2">'),
            s = $('<table class="property-page" cellspacing="0" cellpadding="2">'),
            r = $('<table class="property-page" cellspacing="0" cellpadding="2">'),
            c = $('<table class="property-page" cellspacing="0" cellpadding="2">'),
            d = $('<table class="property-page" cellspacing="0" cellpadding="2">'),
            p = this._study.properties();
        this._prepareSeriesStyleLayout(n, s, r, p),
            this._table = n.add(s).add(r).add(c).add(d), t = $('<input type="checkbox">'), e = this.addLabeledRow(c, "Price Line", t), $("<td>").append(t).prependTo(e), this.bindControl(new a(t, p.showPriceLine, !0, this.model(), "Change Price Price Line")), i = this.createSeriesMinTickEditor(), o = $("<tr>"), o.appendTo(d), $("<td>" + $.t("Override Min Tick") + "</td>").appendTo(o), $("<td>").append(i).appendTo(o), this.bindControl(new l(i, p.minTick, null, !0, this.model(), "Change MinTick")), h.prototype._putStudyDefaultStyles.call(this, d)
    }, o.prototype.loadData = function() { this.superclass.prototype.loadData.call(this), this.switchStyle() }, o.prototype.switchStyle = function() {
        switch ($(this._barsTbody).add(this._barsColorerTbody).add(this._candlesTbody).add(this._candlesColorerTbody).add(this._hollowCandlesTbody).add(this._lineTbody).add(this._areaTbody).css("display", "none"), this._study.properties().style.value()) {
            case TradingView.Series.STYLE_BARS:
                this._barsTbody.css("display", "table-row-group"), this._barsColorerTbody.css("display", "table-row-group");
                break;
            case TradingView.Series.STYLE_CANDLES:
                this._candlesTbody.css("display", "table-row-group"), this._candlesColorerTbody.css("display", "table-row-group");
                break;
            case TradingView.Series.STYLE_HOLLOW_CANDLES:
                this._hollowCandlesTbody.css("display", "table-row-group");
                break;
            case TradingView.Series.STYLE_LINE:
                this._lineTbody.css("display", "table-row-group");
                break;
            case TradingView.Series.STYLE_AREA:
                this._areaTbody.css("display", "table-row-group")
        }
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e) {
    "use strict";

    function i(t, e, i, o, n) {
        var s, r, a, l, h;
        for (this._canvasesMap = {}, this._lines = t.split(/[^\S\r\n]*(?:\r\n|\r|\n)/), this._font = this._fontStyle(e, i, o, n), this._fontSize = n, s = $("<canvas>"), r = s.get(0).getContext("2d"), r.font = this._font, a = 0, l = 0; l < this._lines.length; l++) h = r.measureText(this._lines[l]).width, a = Math.max(a, h);
        this.textImageWidth = a + 1, this.textImageHeight = this._lines.length * n
    }
    i.prototype.paintTo = function(t, e, i, o, n, s) {
        var r = this._getTextImage(e),
            a = this._x(i, n, this.textImageWidth),
            l = this._y(o, s, this.textImageHeight);
        t.drawImage(r, a - .5, l - .5)
    }, i.prototype._getTextImage = function(t) { var e, i, o, n, s; if (this._canvasesMap[t]) return this._canvasesMap[t].get(0); for (e = $("<canvas>").attr("width", this.textImageWidth).attr("height", this.textImageHeight), i = e.get(0).getContext("2d"), i.textBaseline = "top", i.font = this._font, i.textAlign = "center", i.fillStyle = t, o = Math.round(this.textImageWidth / 2), n = 0, s = 0; s < this._lines.length; s++) i.fillText(this._lines[s], o, n), n += this._fontSize; return this._canvasesMap[t] = e, e.get(0) }, i.prototype._x = function(t, e, i) {
        var o = t;
        switch (e) {
            case "left":
                break;
            case "right":
                o -= i;
                break;
            case "center":
                o -= i / 2
        }
        return Math.round(o)
    }, i.prototype._y = function(t, e, i) {
        var o = t;
        switch (e) {
            case "top":
                break;
            case "bottom":
                o -= i;
                break;
            case "middle":
                o -= i / 2
        }
        return Math.round(o)
    }, i.prototype._fontStyle = function(t, e, i, o) { return (t ? "bold " : "") + (e ? "italic " : "") + o + "px " + i }, t.exports = i
}, function(t, e, i) {
    "use strict";

    function o(t, e) {
        return null === t || TradingView.isInteger(t) ? null === e || TradingView.isInteger(e) ? (this.m_firstBar = t,
            void(this.m_lastBar = e)) : void n.logDebug("BarsRange: incorrect lastBar") : void n.logDebug("BarsRange: incorrect firstBar")
    }
    var n = i(12).getLogger("Chart.BarsRange");
    o.prototype.isEmpty = function() { return null === this.m_firstBar || null === this.m_lastBar || void 0 === this.m_firstBar || void 0 === this.m_lastBar }, o.prototype.clone = function() { return new o(this.m_firstBar, this.m_lastBar) }, o.prototype.firstBar = function() { return this.m_firstBar }, o.prototype.lastBar = function() { return this.m_lastBar }, o.prototype.count = function() { return this.m_lastBar - this.m_firstBar + 1 }, o.prototype.resizeRight = function(t) {
        if (!TradingView.isInteger(t) || t < 0) return void n.logDebug("BarsRange: incorrect newWidth");
        this.m_firstBar = this.m_lastBar - t + 1
    }, o.prototype.shift = function(t) {
        if (!isNumber(t)) return void n.logDebug("BarsRange.shift: incorrect coeff");
        this.m_firstBar = Math.round(this.m_firstBar + t), this.m_lastBar = Math.round(this.m_lastBar + t)
    }, o.prototype.contains = function(t) { return this.m_firstBar <= t && this.m_lastBar >= t }, t.exports = o
}, 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) {
    "use strict";

    function o(t, e) { s.call(this, t, e), this._rendererCache = {}, this._numericFormatter = new p, this._invalidated = !0 }

    function n(t, e) {
        this._constructor = "LineToolABCD";
        var i = e || new c("linetoolabcd");
        r.call(this, t, new o(this, t), i)
    }
    var s = i(9),
        r = i(1).LineDataSource,
        a = i(11).TrendLineRenderer,
        l = i(16).TextRenderer,
        h = i(6),
        c = i(7).DefaultProperty,
        d = i(121).DateTimeFormatter,
        p = i(26).NumericFormatter,
        u = i(14);
    inherit(o, s), o.prototype.renderer = function() {
        var t, e, i, o, n, s, c, d, p;
        return this._invalidated && (this.updateImpl(), this._invalidated = !1), this._points.length < 2 ? null : (t = this._source.properties(), e = new h, i = this._points, o = this, n = function(e, i) { return { points: [e], text: i, color: t.textcolor.value(), vertAlign: "middle", horzAlign: "center", font: t.font.value(), offsetX: 0, offsetY: 0, bold: t.bold && t.bold.value(), italic: t.italic && t.italic.value(), fontsize: t.fontsize.value(), backgroundColor: o._source.properties().color.value(), backgroundRoundRect: 4 } }, s = function(e, i, n, s) { return { points: [e, i], width: o._model.timeScale().width(), height: o._source.priceScale().height(), color: u.generateColor(o._source.properties().color.value(), n), linewidth: s || t.linewidth.value(), linestyle: CanvasEx.LINESTYLE_SOLID, extendleft: !1, extendright: !1, leftend: r.LINEEND_NORMAL, rightend: r.LINEEND_NORMAL } }, c = s(i[0], i[1], 0), e.append(new a(c)), i.length >= 3 && (c = s(i[1], i[2], 0), e.append(new a(c))), 4 === i.length && (c = s(i[2], i[3], 0), e.append(new a(c))), d = n(this._points[0], "A"),
            this._points[1].y > this._points[0].y ? (d.vertAlign = "bottom", d.offsetY = -10) : (d.vertAlign = "top", d.offsetY = 5), e.append(new l(d, this._rendererCache)), d = n(this._points[1], "B"), this._points[1].y < this._points[0].y ? (d.vertAlign = "bottom", d.offsetY = -10) : (d.vertAlign = "top", d.offsetY = 5), e.append(new l(d, this._rendererCache)), this._points.length > 2 && (d = n(this._points[2], "C"), this._points[2].y < this._points[1].y ? (d.vertAlign = "bottom", d.offsetY = -10) : (d.vertAlign = "top", d.offsetY = 5), e.append(new l(d, this._rendererCache))), this._points.length > 3 && (d = n(this._points[3], "D"), this._points[3].y < this._points[2].y ? (d.vertAlign = "bottom", d.offsetY = -10) : (d.vertAlign = "top", d.offsetY = 5), e.append(new l(d, this._rendererCache))), this._points.length >= 3 && (p = this._points[0].add(this._points[2]).scaled(.5), c = s(this._points[0], this._points[2], 70, 1), e.append(new a(c)), d = n(p, this._numericFormatter.format(this._ABRetracement)), e.append(new l(d, this._rendererCache))), this._points.length >= 4 && (p = this._points[1].add(this._points[3]).scaled(.5), c = s(this._points[1], this._points[3], 70, 1), e.append(new a(c)), d = n(p, this._numericFormatter.format(this._CDRetracement)), e.append(new l(d, this._rendererCache))), this.addAnchors(e), e)
    }, o.prototype.update = function() { this._invalidated = !0 }, o.prototype.updateImpl = function() {
        var t, e, i, o;
        s.prototype.update.call(this), this._source.points().length >= 3 && (t = this._source.points()[0], e = this._source.points()[1], i = this._source.points()[2], this._ABRetracement = Math.round(1e3 * Math.abs((i.price - e.price) / (e.price - t.price))) / 1e3), 4 === this._source.points().length && (o = this._source.points()[3], this._CDRetracement = Math.round(1e3 * Math.abs((o.price - i.price) / (i.price - e.price))) / 1e3)
    }, inherit(n, r), n.prototype.pointsCount = function() { return 4 }, n.prototype.title = function() { return "ABCD Pattern" }, n.prototype._tooltipFieldsHash = { time0: { title: "Date 1", value: null }, price0: { title: "Price 1", value: null }, time1: { title: "Date 2", value: null }, price1: { title: "Price 2", value: null }, time2: { title: "Date 3", value: null }, price2: { title: "Price 3", value: null }, time3: { title: "Date 4", value: null }, price3: { title: "Price 4", value: null } }, n.prototype._updateTooltip = function() {
        var t, e, i, o, n = this._tooltipFieldsHash,
            s = this.points().m_values;
        s[0] && (t = this._model.timeScale().indexToUserTime(s[0].index), n.time0.value = t ? new d(this._model.mainSeries().isDWM()).format(t) : 0, n.price0.value = this._model.mainSeries()._formatter.format(s[0].price)), s[1] && (e = this._model.timeScale().indexToUserTime(s[1].index), n.time1.value = e ? new d(this._model.mainSeries().isDWM()).format(e) : 0, n.price1.value = this._model.mainSeries()._formatter.format(s[1].price)), s[2] && (i = this._model.timeScale().indexToUserTime(s[2].index), n.time2.value = i ? new d(this._model.mainSeries().isDWM()).format(i) : 0, n.price2.value = this._model.mainSeries()._formatter.format(s[2].price)), s[3] && (o = this._model.timeScale().indexToUserTime(s[3].index), n.time3.value = o ? new d(this._model.mainSeries().isDWM()).format(o) : 0, n.price3.value = this._model.mainSeries()._formatter.format(s[3].price))
    }, n.prototype.tooltip = function() {
        return this._updateTooltip(),
            this._formatTooltip()
    }, t.exports = n
}, function(t, e, i) {
    "use strict";

    function o(t) { this._data = t, this._data.angleFrom = 0, this._data.angleTo = Math.PI, this._data.clockwise = !1 }

    function n(t, e) { a.call(this, t, e), this._invalidated = !0 }

    function s(t, e) {
        this._constructor = "LineToolArc";
        var i = e || new d("linetoolarc");
        l.call(this, t, new n(this, t), i), this.version = s.version
    }
    var r = i(2),
        a = i(9),
        l = i(1).LineDataSource,
        h = i(8),
        c = i(6),
        d = i(7).DefaultProperty,
        p = i(14);
    o.prototype.draw = function(t) {
        var e, i, o, n, s, a, l, h, c, d, u, _, f, m;
        if (!(this._data.points.length < 2)) {
            if (e = this._data.points[0], i = this._data.points[1], this._data.points.length < 3) return t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, t.beginPath(), t.moveTo(e.x, e.y), t.lineTo(i.x, i.y), void t.stroke();
            if (o = this._data.points[2], (n = r.distanceToLine(e, i, o).distance) < 1) return t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, t.beginPath(), t.moveTo(e.x, e.y), t.lineTo(i.x, i.y), void t.stroke();
            s = i.substract(e), a = e.add(i).scaled(.5), l = new r.Point(-s.y, s.x), l = l.normalized(), o = a.add(l.scaled(n)), t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, h = s.length(), c = s.x / h, d = s.y / h, u = Math.acos(c), d < 0 && (u = -u), _ = this._data.points[2], f = r.Matrix.translate(-a.x, -a.y), _ = f.mult(_), f = r.Matrix.rotate(-u), _ = f.mult(_), f = r.Matrix.scale(1, h / (2 * n)), _ = f.mult(_), _.y < 0 ? this._data.clockwise = !0 : this._data.clockwise = !1, t.save(), t.beginPath(), t.translate(e.x, e.y), t.rotate(u), m = 1 - Math.sqrt(3) / 2, t.scale(1, n / (h * m)), this._data.clockwise ? t.arc(.5 * h, h * Math.sqrt(3) / 2, h, -2 * Math.PI / 3, -Math.PI / 3, !1) : t.arc(.5 * h, -h * Math.sqrt(3) / 2, h, Math.PI / 3, 2 * Math.PI / 3, !1), t.restore(), t.stroke(), this._data.fillBackground && (t.fillStyle = p.generateColor(this._data.backcolor, this._data.transparency), t.fill())
        }
    }, o.prototype.hitTest = function(t) { var e, i, o, n, s, a, l, c, d, p, u, _, f, m, g, v, y; return this._data.points.length < 3 ? null : (e = 5, i = this._data.points[0], o = this._data.points[1], n = this._data.points[2], (s = r.distanceToLine(i, o, n).distance) < 1 ? (s = r.distanceToLine(i, o, t).distance, s < e ? new h(h.MOVEPOINT) : null) : (a = o.substract(i), l = a.length(), c = i.add(o).scaled(.5), d = n.substract(c), d = d.normalized(), n = c.add(d.scaled(s)), p = a.x / l, u = a.y / l, _ = Math.acos(p), u < 0 && (_ = -_), f = r.Matrix.translate(-i.x, -i.y), t = f.mult(t), f = r.Matrix.rotate(-_), t = f.mult(t), d = f.mult(d), m = 1 - Math.sqrt(3) / 2, f = r.Matrix.scale(1, l * m / s), t = f.mult(t), d = f.mult(d), t.y * d.y < 0 ? null : (g = t.y < 0 ? new r.Point(.5 * l, l * Math.sqrt(3) / 2) : new r.Point(.5 * l, -l * Math.sqrt(3) / 2), v = t.substract(g), y = v.length(), Math.abs(y - l) <= e ? new h(h.MOVEPOINT) : null))) }, inherit(n, a), n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() { a.prototype.update.call(this), this._invalidated = !1 }, n.prototype.renderer = function() {
        var t, e, i, n, s, a, l, h, d, p, u, _, f, m, g, v, y, b, w, S;
        return this._invalidated && this.updateImpl(), t = {}, t.points = this._points, t.color = this._source.properties().color.value(), t.linewidth = this._source.properties().linewidth.value(), t.backcolor = this._source.properties().backgroundColor.value(), t.fillBackground = this._source.properties().fillBackground.value(),
            t.transparency = this._source.properties().transparency.value(), this.isAnchorsRequired() ? (e = new c, e.append(new o(t)), i = [], n = t.points[0], s = new r.Point(n.x, n.y), s.data = 0, i.push(s), 1 === t.points.length ? e : (a = t.points[1], l = new r.Point(a.x, a.y), l.data = 1, 2 === t.points.length ? (this.addAnchors(e), e) : (i.push(l), h = t.points[2], d = r.distanceToLine(n, a, h).distance, p = a.substract(n), u = n.add(a).scaled(.5), _ = new r.Point(-p.y, p.x), _ = _.normalized(), h = u.add(_.scaled(d)), f = u.add(_.scaled(-d)), m = p.length(), g = p.x / m, v = p.y / m, y = Math.acos(g), v < 0 && (y = -y), b = t.points[2], w = r.Matrix.translate(-u.x, -u.y), b = w.mult(b), w = r.Matrix.rotate(-y), b = w.mult(b), w = r.Matrix.scale(1, m / (2 * d)), b = w.mult(b), S = b.y >= 0 ? new r.Point(h.x, h.y) : new r.Point(f.x, f.y), S.data = 2, i.push(S), e.append(this.createLineAnchor({ points: i })), e))) : new o(t)
    }, inherit(s, l), s.prototype.startChanging = function(t, e) {
        var i, o, n, s, a, h, c;
        l.prototype.startChanging.call(this, t, e), 0 !== t && 1 !== t || (i = this.pointToScreenPoint(this._points[0])[0], o = this.pointToScreenPoint(this._points[1])[0], n = this.pointToScreenPoint(this._points[2])[0], this._dist = r.distanceToLine(i, o, n).distance, s = o.substract(i), a = new r.Point(-s.y, s.x), h = i.add(o).scaled(.5), c = n.substract(h), c.dotProduct(a) < 0 && (this._dist = -this._dist))
    }, s.prototype.pointsCount = function() { return 3 }, s.prototype.title = function() { return "Arc" }, s.prototype.setPoint = function(t, e) {
        var i, o, n, s, a, l, h, c, d, p, u, _, f, m = $.extend({}, e),
            g = this.pointToScreenPoint(this._points[0])[0],
            v = this.pointToScreenPoint(this._points[1])[0],
            y = this.pointToScreenPoint(this._points[2])[0],
            b = this.priceScale();
        switch (b.isPercent() && (i = this.ownerSource().firstValue(), m.price = b.priceRange().convertFromPercent(m.price, i)), t) {
            case 0:
                g = this.pointToScreenPoint(m)[0], o = v.substract(g), n = g.add(v).scaled(.5), s = new r.Point(-o.y, o.x), s = s.normalized(), y = n.add(s.scaled(this._dist)), y = this.screenPointToPoint(y), this._points[0] = m, this._points[2] = y;
                break;
            case 1:
                a = r.distanceToLine(g, v, y).distance, v = this.pointToScreenPoint(m)[0], o = v.substract(g), n = g.add(v).scaled(.5), s = new r.Point(-o.y, o.x), s = s.normalized(), y = n.add(s.scaled(this._dist)), y = this.screenPointToPoint(y), this._points[1] = m, this._points[2] = y;
                break;
            case 2:
                m = this.pointToScreenPoint(m)[0], a = r.distanceToLine(g, v, m).distance, o = v.substract(g), n = g.add(v).scaled(.5), s = new r.Point(-o.y, o.x), s = s.normalized(), y = n.add(s.scaled(a)), l = n.add(s.scaled(-a)), h = o.length(), c = o.x / h, d = o.y / h, p = Math.acos(c), d < 0 && (p = -p), u = r.Matrix.translate(-n.x, -n.y), m = u.mult(m), _ = u.mult(y), u = r.Matrix.rotate(-p), m = u.mult(m), _ = u.mult(_), u = r.Matrix.scale(1, h / (2 * a)), m = u.mult(m), _ = u.mult(_), f = m.y * _.y >= 0 ? new r.Point(y.x, y.y) : new r.Point(l.x, l.y), f = this.screenPointToPoint(f), this._points[2] = f
        }
        this.normalizePoints()
    }, s.version = 2, s.prototype.migrateVersion = function(t, e, i) {
        var o, n;
        1 === t && 2 === this._points.length && (o = (2 * this._points[0].price + 3 * this._points[1].price) / 5, this._points.append({ price: o, index: this._points[1].index })), 1 === t && 2 === this._timePoint.length && (o = (2 * this._timePoint[0].price + 3 * this._timePoint[1].price) / 5, n = { price: o, offset: this._timePoint[1].offset, time_t: this._timePoint[1].time_t },
            this._timePoint.append(n))
    }, t.exports = s
}, function(t, e, i) {
    "use strict";

    function o(t, e) { this._measureCache = e, this._data = t }

    function n(t, e) { a.call(this, t, e), this._rendererCache = {}, this._invalidated = !0 }

    function s(t, e) {
        this._constructor = "LineToolBalloon";
        var i = e || new p("linetoolballoon");
        l.call(this, t, new n(this, t), i)
    }
    var r = i(2),
        a = i(9),
        l = i(1).LineDataSource,
        h = i(68).SelectionRenderer,
        c = i(8),
        d = i(6),
        p = i(7).DefaultProperty,
        u = i(14);
    o.prototype.draw = function(t) {
        var e, i, o, n, s, r, a;
        0 !== this._data.points.length && (t.font = [this._data.fontWeight, this._data.fontSize + "px", this._data.fontFamily].join(" "), e = t.measureText(this._data.label), e.height = this._data.fontSize, i = 15, o = { left: i, top: (2 * i - e.height) / 2 }, n = e.width + 2 * o.left, s = 2 * i, r = this._data.points[0].x - (o.left + 20), a = this._data.points[0].y - (s + 9), this._measureCache && $.extend(this._measureCache, { innerWidth: n, innerHeight: s, padding: o }), t.translate(.5 + r, .5 + a), t.beginPath(), t.moveTo(i + 9, s), t.lineTo(i, s), t.arcTo(-1e3, 0, 1e3, 0, i), t.lineTo(n - i, 0), t.arcTo(1e3, s, -1e3, s, i), t.lineTo(i + 18, s), t.quadraticCurveTo(i + 18, s + 4, i + 20, s + 9), t.quadraticCurveTo(i + 12, s + 6, i + 9, s), t.fillStyle = u.generateColor(this._data.backgroundColor, this._data.transparency), t.fill(), t.strokeStyle = this._data.borderColor, t.lineWidth = 2, t.stroke(), t.closePath(), t.textBaseline = "top", t.fillStyle = this._data.color, t.fillText(this._data.label, o.left, o.top - 1))
    }, o.prototype.hitTest = function(t) { var e, i; return 0 !== this._data.points.length && this._measureCache.padding ? (e = this._data.points[0].x - (this._measureCache.padding.left + 20), i = this._data.points[0].y - (this._measureCache.innerHeight + 9), r.pointInRect(t, new r.Point(e, i), new r.Point(e + this._measureCache.innerWidth, i + this._measureCache.innerHeight)) ? new c(c.MOVEPOINT) : null) : null }, inherit(n, a), n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() { a.prototype.update.call(this), this._invalidated = !1 }, n.prototype.renderer = function() { var t, e; return this._invalidated && this.updateImpl(), t = {}, t.points = this._points, t.color = this._source.properties().color.value(), t.borderColor = this._source.properties().borderColor.value(), t.backgroundColor = this._source.properties().backgroundColor.value(), t.transparency = this._source.properties().transparency.value(), t.fontWeight = this._source.properties().fontWeight.value(), t.fontSize = this._source.properties().fontsize.value(), t.fontFamily = this._source.properties().font.value(), t.label = this._source.properties().text.value(), this.isAnchorsRequired() && 1 === t.points.length ? (e = new d, e.append(new o(t, this._rendererCache)), e.append(new h({ points: t.points })), e) : new o(t, this._rendererCache) }, inherit(s, l), s.prototype.pointsCount = function() { return 1 }, s.prototype.title = function() { return "Balloon" }, t.exports = s
}, 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(2),
        r = i(9),
        a = i(1).LineDataSource,
        l = i(90).VertLineRenderer,
        h = i(11).TrendLineRenderer,
        c = i(8),
        d = i(6),
        p = i(7).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) { 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(2),
        r = i(9),
        a = i(1).LineDataSource,
        l = i(16).TextRenderer,
        h = i(45).RectangleRenderer,
        c = i(11).TrendLineRenderer,
        d = i(6),
        p = i(7).DefaultProperty,
        u = i(70).PercentageFormatter,
        _ = i(123).TimeSpanFormatter,
        f = i(219).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, O, V, 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, 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()), O = .5 * (r.x + p.x), V = p.y, B = new s.Point(O, V), R = new l(i, this._rendererCache), N = R.measure(), F = { x: O + i.backgroundHorzInflate + N.textBgPadding - N.width / N.textBgPadding, y: r.y > p.y ? B.y - N.height - 2 * N.textBgPadding - D.y > 0 ? V - 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 : V + N.textBgPadding }, window.t1 = o._source.priceScale().height(), window.t2 = B.y + N.height + 2 * N.textBgPadding + D.y, R.setPoints([new s.Point(O, 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) {
    "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(2),
        r = i(1).LineDataSource,
        a = i(9),
        l = i(16).TextRenderer,
        h = i(45).RectangleRenderer,
        c = i(11).TrendLineRenderer,
        d = i(6),
        p = i(7).DefaultProperty,
        u = i(123).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, 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) { a.call(this, t, e), this._label = null, this._rendererCache = {}, this._invalidated = !0 }

    function n(t, e) {
        this._constructor = "LineToolDisjointAngle";
        var i = e || new p("linetooldisjointangle");
        l.call(this, t, new o(this, t), i), this.version = n.version
    }
    var s = i(11).TrendLineRenderer,
        r = i(52).ChannelRenderer,
        a = i(9),
        l = i(1).LineDataSource,
        h = i(16).TextRenderer,
        c = i(92),
        d = i(6),
        p = i(7).DefaultProperty;
    inherit(o, a), o.prototype.update = function() { this._invalidated = !0 }, o.prototype.updateImpl = function() {
        var t, e, i, o;
        a.prototype.update.call(this), this._label = null, this._source.points().length < 2 || this._source.priceScale() && (t = this._source.points()[0], e = this._source.points()[1], this._price1 = this._source.priceScale().formatter().format(t.price), this._price2 = this._source.priceScale().formatter().format(e.price), 3 === this._source.points().length && (i = this._source.points()[2], this._price3 = this._source.priceScale().formatter().format(i.price), o = e.price - t.price, this._price4 = this._source.priceScale().formatter().format(i.price + o)))
    }, o.prototype.renderer = function() {
        var t, e, i, o, n, a, l, p, u, _, f, m, g, v, y, b, w, S, T, C, x, P;
        return this._invalidated && (this.updateImpl(), this._invalidated = !1), t = new d, this._points.length < 2 ? t : (e = this._points[0], i = this._points[1], a = this._source.properties(), l = this._model, p = this._source, a = p.properties(), this._points.length >= 3 && (o = this._points[2], o.x = i.x, u = i.y - e.y, n = e.clone(), n.y = o.y + u, n.data = 3, a.fillBackground.value() && (_ = {}, f = l.timeScale().width(), m = a.extendLeft.value(), g = a.extendRight.value(), m || g ? !m && g ? (v = {}, v.width = f, v.p1 = e, v.p2 = i, v.p3 = n, v.p4 = o, v.color = a.backgroundColor.value(), v.transparency = a.transparency.value(), v.hittestOnBackground = TradingView.isMobile.any(), t.append(new r(v))) : m && !g ? (v = {}, v.width = f, v.p1 = i, v.p2 = e, v.p3 = o, v.p4 = n, v.color = a.backgroundColor.value(), v.transparency = a.transparency.value(), v.hittestOnBackground = TradingView.isMobile.any(), t.append(new r(v))) : (y = e.add(i).scaled(.5), b = n.add(o).scaled(.5), w = {}, w.width = f, w.p1 = y, w.p2 = i, w.p3 = b, w.p4 = o, w.color = a.backgroundColor.value(), w.transparency = a.transparency.value(), w.hittestOnBackground = TradingView.isMobile.any(), t.append(new r(w)), S = {}, S.width = f, S.p1 = y, S.p2 = e, S.p3 = b, S.p4 = n, S.color = a.backgroundColor.value(), S.transparency = a.transparency.value(), S.hittestOnBackground = TradingView.isMobile.any(), t.append(new r(S))) : (_.points = [e, i, o, n], _.color = "rgba(0,0,0,0)", _.linewidth = 0, _.linestyle = CanvasEx.LINESTYLE_SOLID, _.filled = !0, _.backcolor = a.backgroundColor.value(), _.fillBackground = !0, _.transparency = a.transparency.value(), t.append(new c(_))))), T = function(t, e) {
            return {
                points: [t, e],
                width: l.timeScale().width(),
                height: p.priceScale().height(),
                color: a.linecolor.value(),
                linewidth: a.linewidth.value(),
                linestyle: a.linestyle.value(),
                extendleft: a.extendLeft.value(),
                extendright: a.extendRight.value(),
                leftend: a.leftEnd.value(),
                rightend: a.rightEnd.value()
            }
        }, t.append(new s(T(e, i))), C = this, x = function(e, i, o, n) {
            var s;
            C._source.properties().showPrices.value() && (s = { points: [e], text: o, color: C._source.properties().textcolor.value(), horzAlign: e.x > i.x ? "left" : "right", vertAlign: "middle", font: C._source.properties().font.value(), offsetX: e.x > i.x ? -5 : 5, offsetY: -5, bold: C._source.properties().bold.value(), italic: C._source.properties().italic.value(), fontsize: C._source.properties().fontsize.value() }, t.append(new h(s, C._rendererCache)), s = { points: [i], text: n, color: C._source.properties().textcolor.value(), horzAlign: e.x < i.x ? "left" : "right", vertAlign: "middle", font: C._source.properties().font.value(), offsetX: e.x > i.x ? -5 : 5, offsetY: -5, bold: C._source.properties().bold.value(), italic: C._source.properties().italic.value(), fontsize: C._source.properties().fontsize.value() }, t.append(new h(s, C._rendererCache)))
        }, t.append(new s(T(e, i))), x(e, i, this._price1, this._price2), 2 === this._points.length ? (this.addAnchors(t), t) : (t.append(new s(T(n, o))), x(o, n, this._price3, this._price4), this.isAnchorsRequired() && (P = [e, i, o, n], this._model.lineBeingCreated() === this._source && P.pop(), t.append(this.createLineAnchor({ points: P }))), !TradingView.printing && this._source.hasAlert.value() && !this._model.readOnly() && e && i && this._source.getAlertIsActive(function(o) { t.append(new TradingView.PaneRendererClockIcon({ point1: e, point2: i, color: o ? a.linecolor.value() : defaults("chartproperties.alertsProperties.drawingIcon.color") })) }), t))
    }, inherit(n, l), n.version = 1, n.prototype.pointsCount = function() { return 3 }, n.prototype.title = function() { return "Disjoint Angle" }, n.prototype.addPoint = function(t, e) { return e && e.shift && 2 === this.points().length && this._snapPoint45Degree(t, this.points()[this.points().length - 2]), l.prototype.addPoint.call(this, t) }, n.prototype.setLastPoint = function(t, e) { return e && e.shift && 2 === this.points().length && this._snapPoint45Degree(t, this.points()[this.points().length - 2]), l.prototype.setLastPoint.call(this, t) }, n.prototype.setPoint = function(t, e, i) {
        var o, n, s, r, a, h = .5 * (this._points[1].price + this._points[2].price);
        i && i.shift && 1 === t && (o = 0, this._snapPoint45Degree(e, this.points()[o])), t < 3 && l.prototype.setPoint.call(this, t, e), 0 !== t && 2 !== t && (1 === t ? (n = this._points[1].price - h, this._points[2].price = this._points[1].price - 2 * n) : 3 === t && (s = this.priceScale(), r = e.price, s.isPercent() && (a = this.ownerSource().firstValue(), r = s.priceRange().convertFromPercent(r, a)), n = r - this._points[2].price, this._points[0].price = this._points[1].price - n, this._points[0].index = e.index))
    }, n.prototype.canHasAlert = function() { return !0 }, n.prototype._getAlertPlots = function() {
        var t, e, i, o, n, s, r, a, l, h = this._points[0],
            c = this._points[1],
            d = [];
        return h.index <= c.index ? (d.push(h), d.push(c)) : (d.push(c), d.push(h)), t = this._points[2], t.time = c.time, t.index = c.index, e = { price: t.price + (c.price - h.price), time: h.time, index: h.index }, i = [], t.index <= e.index ? (i.push(t), i.push(e)) : (i.push(e), i.push(t)), d[0].price > i[0].price ? (o = d,
            n = i) : i[0].price > d[0].price ? (o = i, n = d) : i[1].price > d[1].price ? (o = i, n = d) : (o = d, n = i), a = this.properties().extendLeft.value(), l = this.properties().extendRight.value(), h.index <= c.index ? (s = a, r = l) : (s = l, r = a), [this._linePointsToAlertPlot(o, "Upper", s, r), this._linePointsToAlertPlot(n, "Lower", s, r)]
    }, t.exports = n
}, function(t, e, i) {
    "use strict";

    function o(t) { this._data = t, this._data.angleFrom = 0, this._data.angleTo = 2 * Math.PI, this._data.clockwise = !1 }

    function n(t, e) { l.call(this, t, e), this._invalidated = !0 }

    function s(t, e) {
        this._constructor = "LineToolEllipse";
        var i = e || new d("linetoolellipse");
        a.call(this, t, new n(this, t), i), this.version = s.version
    }
    var r = i(2),
        a = i(1).LineDataSource,
        l = i(9),
        h = i(8),
        c = i(6),
        d = i(7).DefaultProperty,
        p = i(14);
    o.prototype.draw = function(t) {
        var e, i, o, n, s, a, l, h, c, d, u, _, f;
        if (!(this._data.points.length < 2)) {
            if (e = this._data.points[0], i = this._data.points[1], this._data.points.length < 3) return t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, t.beginPath(), t.moveTo(e.x, e.y), t.lineTo(i.x, i.y), void t.stroke();
            if (o = this._data.points[2], (n = r.distanceToLine(e, i, o).distance) < 1) return t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, t.beginPath(), t.moveTo(e.x, e.y), t.lineTo(i.x, i.y), void t.stroke();
            s = i.substract(e), a = e.add(i).scaled(.5), l = new r.Point(-s.y, s.x), l = l.normalized(), o = a.add(l.scaled(n)), t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, h = s.length(), c = s.x / h, d = s.y / h, u = Math.acos(c), d < 0 && (u = -u), _ = this._data.points[2], f = r.Matrix.translate(-a.x, -a.y), _ = f.mult(_), f = r.Matrix.rotate(-u), _ = f.mult(_), f = r.Matrix.scale(1, h / (2 * n)), _ = f.mult(_), _.y < 0 ? this._data.clockwise = !0 : this._data.clockwise = !1, t.save(), t.beginPath(), t.translate(a.x, a.y), t.rotate(u), t.scale(1, 2 * n / h), t.arc(0, 0, .5 * h, this._data.angleFrom, this._data.angleTo, this._data.clockwise), t.restore(), t.stroke(), this._data.fillBackground && (t.fillStyle = p.generateColor(this._data.backcolor, this._data.transparency), t.fill())
        }
    }, o.prototype._additionalPointTest = function(t, e) { return !0 }, o.prototype.hitTest = function(t) { var e, i, o, n, s, a, l, c, d, p, u, _, f, m, g; return this._data.points.length < 3 ? null : (e = this._data.points[0], i = this._data.points[1], o = this._data.points[2], n = r.distanceToLine(e, i, o).distance, s = i.substract(e), a = e.add(i).scaled(.5), l = new r.Point(-s.y, s.x), l = l.normalized(), o = a.add(l.scaled(n)), c = s.length(), d = s.x / c, p = s.y / c, u = Math.acos(d), p < 0 && (u = -u), _ = r.Matrix.translate(-a.x, -a.y), t = _.mult(t), f = _.mult(this._data.points[2]), _ = r.Matrix.rotate(-u), t = _.mult(t), f = _.mult(f), _ = r.Matrix.scale(1, c / (2 * n)), t = _.mult(t), f = _.mult(f), m = t.length(), g = 3, this._additionalPointTest(t, f) ? Math.abs(m - .5 * c) <= g ? new h(h.MOVEPOINT) : this._data.fillBackground && !this._data.noHitTestOnBackground && m <= .5 * c ? new h(h.MOVEPOINT_BACKGROUND) : null : null) }, inherit(n, l), n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() { l.prototype.update.call(this), this._invalidated = !1 }, n.prototype.renderer = function() {
        var t, e, i, n, s, a, l, h, d, p, u, _, f, m;
        return this._invalidated && this.updateImpl(), t = new c, this._points.length < 2 ? t : (e = {}, e.points = this._points,
            e.color = this._source.properties().color.value(), e.linewidth = this._source.properties().linewidth.value(), e.backcolor = this._source.properties().backgroundColor.value(), e.fillBackground = this._source.properties().fillBackground.value(), e.transparency = this._source.properties().transparency.value(), t.append(new o(e)), this.isAnchorsRequired() ? (i = e.points[0], n = e.points[1], 2 === this._points.length ? (this.addAnchors(t), t) : (s = e.points[2], a = r.distanceToLine(i, n, s).distance, l = n.substract(i), h = i.add(n).scaled(.5), d = new r.Point(-l.y, l.x), d = d.normalized(), s = h.add(d.scaled(a)), p = h.add(d.scaled(-a)), u = new r.Point(i.x, i.y), u.data = 0, _ = new r.Point(n.x, n.y), _.data = 1, f = new r.Point(s.x, s.y), f.data = 2, m = new r.Point(p.x, p.y), m.data = 3, t.append(this.createLineAnchor({ points: [u, _, f, m] })), t)) : t)
    }, inherit(s, a), s.prototype.startChanging = function(t, e) {
        var i, o, n;
        a.prototype.startChanging.call(this, t, e), 0 !== t && 1 !== t || (i = this.pointToScreenPoint(this._points[0])[0], o = this.pointToScreenPoint(this._points[1])[0], n = this.pointToScreenPoint(this._points[2])[0], this._dist = r.distanceToLine(i, o, n).distance || 0)
    }, s.prototype._preparePoint = function(t, e) { var i = this._preparePointInternal(t, e, !1); return e && e.shift && this._points[0].index === this._points[1].index && this._fixVerticalDiameterPoints(this._points[1], this._points[0], i), i }, s.prototype._preparePointInternal = function(t, e, i) {
        var o, n, s, l, h, c, d, p, u, _, f;
        if (this._convertPriceFromPercentIfNeeded(t), o = $.extend({}, t), e && e.shift) {
            if (n = this.points().length, !this._fakePointAdded && 3 === n && !i) return o;
            (this._fakePointAdded || 2 === n || i) && (this._snapPoint45Degree(t, this._points[0]), this._fakePointAdded ? this._points[1] = t : i || (this._fakePointAdded = !0, a.prototype._addPointIntenal.call(this, t)), s = this.pointToScreenPoint(this._points[0])[0], l = this.pointToScreenPoint(this._points[1])[0], h = l.x - s.x, c = l.y - s.y, d = Math.sqrt(h * h + c * c) / 2, p = l.substract(s), u = s.add(l).scaled(.5), _ = new r.Point(-p.y, p.x), _ = _.normalized(), f = u.add(_.scaled(d)), o = this.screenPointToPoint(f), (TradingView.isNaN(o.price) || TradingView.isNaN(o.index)) && (o = this.screenPointToPoint(u)))
        } else this._fakePointAdded && (this._points.splice(1, 1), this._fakePointAdded = !1);
        return o
    }, s.prototype._fixVerticalDiameterPoints = function(t, e, i) {
        var o = this.pointToScreenPoint(t)[0],
            n = this.pointToScreenPoint(e)[0],
            s = this._model.timeScale(),
            r = s.indexToCoordinate(t.index),
            a = s.indexToCoordinate(i.index),
            l = 2 * Math.abs(r - a);
        l *= e.price > t.price ? 1 : -1, t.price = this.screenPointToPoint({ x: o.x, y: n.y + l }).price
    }, s.prototype.addPoint = function(t, e, i) { var o = a.prototype.addPoint.call(this, t, e, i); return o && (this._fakePointAdded = !1), o }, s.prototype.setPoint = function(t, e, i) {
        var o, n, s, a, l = $.extend({}, e),
            h = this.pointToScreenPoint(this._points[0])[0],
            c = this.pointToScreenPoint(this._points[1])[0],
            d = this.pointToScreenPoint(this._points[2])[0];
        switch (this._convertPriceFromPercentIfNeeded(l), t) {
            case 0:
                if (i && i.shift) {
                    this._snapPoint45Degree(l, this._points[1]), this._points[0] = l, this._points[2] = this._preparePointInternal(this._points[2], i, !0),
                        this._points[0].index === this._points[1].index && this._fixVerticalDiameterPoints(this._points[0], this._points[1], this._points[2]);
                    break
                }
                h = this.pointToScreenPoint(l)[0], o = c.substract(h), n = h.add(c).scaled(.5), s = new r.Point(-o.y, o.x), s = s.normalized(), d = n.add(s.scaled(this._dist)), d = this.screenPointToPoint(d), this._points[0] = l, this._points[2] = d;
                break;
            case 1:
                if (i && i.shift) { this._snapPoint45Degree(l, this._points[0]), this._points[1] = l, this._points[2] = this._preparePointInternal(this._points[2], i, !0), this._points[0].index === this._points[1].index && this._fixVerticalDiameterPoints(this._points[1], this._points[0], this._points[2]); break }
                c = this.pointToScreenPoint(l)[0], o = c.substract(h), n = h.add(c).scaled(.5), s = new r.Point(-o.y, o.x), s = s.normalized(), d = n.add(s.scaled(this._dist)), d = this.screenPointToPoint(d), this._points[1] = l, this._points[2] = d;
                break;
            case 2:
            case 3:
                l = this.pointToScreenPoint(l)[0], a = r.distanceToLine(h, c, l).distance, o = c.substract(h), n = h.add(c).scaled(.5), s = new r.Point(-o.y, o.x), s = s.normalized(), d = n.add(s.scaled(a)), d = this.screenPointToPoint(d), this._points[2] = d
        }
        this.normalizePoints()
    }, s.prototype.pointsCount = function() { return 3 }, s.prototype.title = function() { return "Ellipse" }, s.version = 2, s.prototype.migrateVersion = function(t, e, i) {
        var o, n, s;
        1 === t && 2 === this._points.length && (o = this._points[0].price, n = .5 * (this._points[0].price + this._points[1].price), this._points[0] = { price: n, index: this._points[0].index }, this._points[1] = { price: n, index: this._points[1].index }, this._points.push({ price: o, index: this._points[0].index })), 1 === t && 2 === this._timePoint.length && (o = this._timePoint[0].price, n = .5 * (this._timePoint[0].price + this._timePoint[1].price), this._timePoint[0].price = n, this._timePoint[1].price = n, s = { price: o, offset: this._timePoint[0].offset, time_t: this._timePoint[0].time_t }, this._timePoint.push(s))
    }, t.exports = s
}, function(t, e, i) {
    "use strict";

    function o() { p.call(this) }

    function n(t, e, i) { l.call(this, t, e, i) }

    function s(t, e) { c.call(this, t, e), this._rendererCache = {}, this._invalidated = !0 }

    function r(t, e) {
        this._constructor = "LineToolFibChannel";
        var i = e || this.createPropertiesObject("linetoolfibchannel");
        h.call(this, t, new s(this, t), i), this.version = r.version, t._fibChannelLabelsCache || (t._fibChannelLabelsCache = new o)
    }
    var a = i(205),
        l = i(150).ParallelChannelRenderer,
        h = i(1).LineDataSource,
        c = i(9),
        d = i(23),
        p = i(88),
        u = i(11).TrendLineRenderer,
        _ = i(91),
        f = i(6),
        m = i(14);
    inherit(o, p), o.prototype.levelsCount = function() { return r.LevelsCount }, inherit(n, l), n.prototype.getColor = function() { return m.generateColor(this._data.backcolor, this._data.transparency, !0) }, inherit(s, c), s.prototype.update = function() { this._invalidated = !0 }, s.prototype._updateImpl = function() { c.prototype.update.call(this), this._cacheState = this._model._fibChannelLabelsCache.updateSource(this._source), this._floatPoints.length < 3 || this._source.points().length < 3 || (this.norm = this._floatPoints[2].substract(this._floatPoints[0])) }, s.prototype.renderer = function() {
        function t(t, o, n) {
            var s, r, a, h, p;
            switch (i.horzLabelsAlign.value()) {
                case "left":
                    s = t;
                    break;
                case "center":
                    s = t.add(o).scaled(.5), s.x += n.width / 2, s.x = Math.round(s.x);
                    break;
                case "right":
                    s = o.clone(), s.x += n.width, s.x = Math.round(s.x)
            }
            r = { left: n.left, top: l.topByRow(d._cacheState.row), width: n.width, height: l.rowHeight(d._cacheState.row) }, a = { left: Math.round(s.x - r.width), top: Math.round(s.y), width: n.width, height: r.height }, h = i.vertLabelsAlign.value(), "middle" === h && (a.top -= a.height / 2), "bottom" === h && (a.top -= a.height), p = new _(c, r, a), e.append(p)
        }
        var e, i, o, s, r, l, c, d, p, m, g, v, y, b, w, S, T, C, x, P, L, k;
        if (this._invalidated && (this._updateImpl(), this._invalidated = !1), e = new f, this._floatPoints.length < 2) return this.addAnchors(e), e;
        if (i = this._source.properties(), o = this._floatPoints[0], s = this._floatPoints[1], this._floatPoints.length < 3) return r = { points: [o, s], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: i.level1.color.value(), linewidth: i.levelsStyle.linewidth.value(), linestyle: i.levelsStyle.linestyle.value(), extendleft: i.extendLeft.value(), extendright: i.extendRight.value(), leftend: h.LINEEND_NORMAL, rightend: h.LINEEND_NORMAL }, e.append(new u(r)), this.addAnchors(e), e;
        for (l = this._model._fibChannelLabelsCache, c = l.canvas().get(0), d = this, p = 1; p < a.LevelsCount; p++)
            if (m = i["level" + p], m.visible.value()) {
                for (g = null, v = p + 1; v <= a.LevelsCount; v++)
                    if (y = i["level" + v], y.visible.value()) { g = y; break }
                if (!g) break;
                b = this.norm.scaled(m.coeff.value()), w = o.add(b), S = s.add(b), T = this.norm.scaled(g.coeff.value()), C = o.add(T), x = s.add(T), P = {}, P.points = [w, S, C, x], P.color = m.color.value(), P.width = this._model.timeScale().width(), P.height = this._source.priceScale().height(), P.linewidth = i.levelsStyle.linewidth.value(), P.linestyle = i.levelsStyle.linestyle.value(), P.extendleft = i.extendLeft.value(), P.extendright = i.extendRight.value(), P.backcolor = m.color.value(), P.transparency = i.transparency.value(), P.skipTopLine = !0, P.fillBackground = i.fillBackground.value(), P.hittestOnBackground = !0, e.append(new n(P)), (i.showCoeffs.value() || i.showPrices.value()) && (L = this._cacheState.preparedCells.cells[p - 1], t(w, S, L))
            }
        for (k = null, p = a.LevelsCount; p >= 1; p--)
            if (m = i["level" + p], m.visible.value()) { k = p; break }
        return null != k && (m = i["level" + k], m.visible.value() && (b = this.norm.scaled(m.coeff.value()), w = o.add(b), S = s.add(b), r = { points: [w, S], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: m.color.value(), linewidth: i.levelsStyle.linewidth.value(), linestyle: i.levelsStyle.linestyle.value(), extendleft: i.extendLeft.value(), extendright: i.extendRight.value(), leftend: h.LINEEND_NORMAL, rightend: h.LINEEND_NORMAL }, e.append(new u(r)), (i.showCoeffs.value() || i.showPrices.value()) && t(w, S, this._cacheState.preparedCells.cells[k - 1]))), this.addAnchors(e), e
    }, inherit(r, h), r.LevelsCount = 24, r.version = 2, r.prototype.migrateVersion = function(t, e, i) { i.properties.removeProperty("reverse") }, r.prototype.pointsCount = function() { return 3 }, r.prototype.title = function() { return "Fib Channel" }, r.prototype.processErase = function(t, e) {
        var i = "level" + e,
            o = this.properties()[i].visible;
        t.setProperty(o, !1, "Erase level line")
    }, r.prototype.createPropertiesObject = function(t, e, i) { return new d(t, e, i, { range: [1, 24], names: ["coeff", "color", "visible"] }) }, t.exports = r
}, function(t, e, i) {
    "use strict";

    function o() { d.call(this) }

    function n(t, e, i) { this._data = t, this._hittest = e || new _(_.MOVEPOINT), this._backHittest = i || new _(_.MOVEPOINT_BACKGROUND) }

    function s(t, e) { h.call(this, t, e), this._rendererCache = {}, this._invalidated = !0 }

    function r(t, e) {
        this._constructor = "LineToolFibSpeedResistanceArcs";
        var i = e || this.createPropertiesObject("linetoolfibspeedresistancearcs");
        l.call(this, t, new s(this, t), i), t._fibSpeedResistanceArcsLabelsCache || (t._fibSpeedResistanceArcsLabelsCache = new o)
    }
    var a = i(2),
        l = i(1).LineDataSource,
        h = i(9),
        c = i(23),
        d = i(88),
        p = i(11).TrendLineRenderer,
        u = i(91),
        _ = i(8),
        f = i(6),
        m = i(14);
    inherit(o, d), o.prototype.levelsCount = function() { return r.LevelsCount }, n.prototype.draw = function(t) { t.lineCap = "butt", t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, t.translate(this._data.center.x, this._data.center.y), t.beginPath(), this._data.fullCircles ? t.arc(0, 0, this._data.radius, 2 * Math.PI, 0, !1) : this._data.dir > 0 ? t.arc(0, 0, this._data.radius, 0, Math.PI, !1) : t.arc(0, 0, this._data.radius, Math.PI, 0, !1), t.stroke(), this._data.fillBackground && (this._data.radius2 && (this._data.fullCircles ? t.arc(0, 0, this._data.radius2, 2 * Math.PI, 0, !0) : this._data.dir > 0 ? t.arc(0, 0, this._data.radius2, Math.PI, 0, !0) : t.arc(0, 0, this._data.radius2, 0, Math.PI, !0)), t.fillStyle = m.generateColor(this._data.color, this._data.transparency, !0), t.fill()) }, n.prototype.hitTest = function(t) { var e, i, o; return a.sign(t.y - this._data.center.y) === this._data.dir || this._data.fullCircles ? (e = t.substract(this._data.center), i = e.length(), o = 3, Math.abs(i - this._data.radius) < o ? this._hittest : this._data.hittestOnBackground && Math.abs(i) <= this._data.radius + o ? this._backHittest : null) : null }, inherit(s, h), s.prototype.update = function() { this._invalidated = !0 }, s.prototype._updateImpl = function() {
        var t, e, i, o, n, s, l, c, d, p, u, _;
        if (h.prototype.update.call(this), this._cacheState = this._model._fibSpeedResistanceArcsLabelsCache.updateSource(this._source), !(this._floatPoints.length < 2) && this._source.priceScale() && !this._source.priceScale().isEmpty() && !this._model.timeScale().isEmpty())
            for (t = this._floatPoints[0], e = this._floatPoints[1], i = t.substract(e).length(), this._levels = [], o = this._source.properties(), n = 1; n <= r.LevelsCount; n++) s = "level" + n, l = o[s], l.visible.value() && (c = l.coeff.value(), d = l.color.value(), p = e.substract(t).length() * c, u = a.sign(e.y - t.y), _ = new a.Point(t.x, t.y + u * i * c), this._levels.push({ color: d, radius: p, dir: u, labelPoint: _, linewidth: l.linewidth.value(), linestyle: l.linestyle.value(), index: n }))
    }, s.prototype.renderer = function() {
        var t, e, i, o, s, r, a, h, c, d, m, g, v, y, b, w;
        if (this._invalidated && (this._updateImpl(), this._invalidated = !1), t = new f, this._floatPoints.length < 2) return t;
        for (e = this._floatPoints[0], i = this._source.properties(), o = i.fillBackground.value(), s = i.transparency.value(), r = this._model._fibSpeedResistanceArcsLabelsCache, a = r.canvas().get(0), h = 0; h < this._levels.length; h++)
            if (c = this._levels[h], d = {}, d.center = e, d.color = c.color, d.linewidth = c.linewidth, d.radius = c.radius, d.dir = c.dir, d.transparency = s, d.fillBackground = o, d.hittestOnBackground = !0, d.fullCircles = i.fullCircles.value(),
                h > 0 && (d.radius2 = this._levels[h - 1].radius), m = new _(_.MOVEPOINT, null, c.index), t.append(new n(d, m)), i.showCoeffs.value()) {
                if (!(g = this._cacheState.preparedCells.cells[this._levels[h].index - 1])) continue;
                v = { left: g.left, top: r.topByRow(this._cacheState.row), width: g.width, height: r.rowHeight(this._cacheState.row) }, y = { left: Math.round(c.labelPoint.x - v.width), top: Math.round(c.labelPoint.y - v.height / 2), width: g.width, height: v.height }, b = new u(a, v, y), t.append(b)
            }
        return i.trendline.visible.value() && (w = { points: [this._floatPoints[0], this._floatPoints[1]], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: i.trendline.color.value(), linewidth: i.trendline.linewidth.value(), linestyle: i.trendline.linestyle.value(), extendleft: !1, extendright: !1, leftend: l.LINEEND_NORMAL, rightend: l.LINEEND_NORMAL }, t.append(new p(w))), this.addAnchors(t), t
    }, inherit(r, l), r.LevelsCount = 11, r.prototype.pointsCount = function() { return 2 }, r.prototype.title = function() { return "Fib Speed Resistance Arcs" }, r.prototype.processErase = function(t, e) {
        var i = "level" + e,
            o = this.properties()[i].visible;
        t.setProperty(o, !1, "Erase level line")
    }, r.prototype.createPropertiesObject = function(t, e, i) { return new c(t, e, i, { range: [1, 11] }) }, t.exports = r
}, function(t, e, i) {
    "use strict";

    function o(t, e) { r.call(this, t, e), this._rendererCache = {}, this._numericFormatter = new _, this._invalidated = !0 }

    function n(t, e) {
        this._constructor = "LineToolFibSpeedResistanceFan";
        var i = e || this.createPropertiesObject("linetoolfibspeedresistancefan");
        a.call(this, t, new o(this, t), i)
    }
    var s = i(2),
        r = i(9),
        a = i(1).LineDataSource,
        l = i(23),
        h = i(52).ChannelRenderer,
        c = i(16).TextRenderer,
        d = i(11).TrendLineRenderer,
        p = i(8),
        u = i(6),
        _ = i(26).NumericFormatter;
    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, p, u, _; if (r.prototype.update.call(this), !(this._source.points().length < 2) && this._source.priceScale() && !this._source.priceScale().isEmpty() && !this._model.timeScale().isEmpty()) { for (t = this._source.points()[0], e = this._source.points()[1], this._hlevels = [], i = e.price - t.price, this._source.priceScale().isPercent() && (o = this._source.ownerSource().firstValue()), n = 1; n <= 7; n++) s = "hlevel" + n, a = this._source.properties()[s], a.visible.value() && (l = a.coeff.value(), h = a.color.value(), c = t.price + l * i, this._source.priceScale().isPercent() && (c = this._source.priceScale().priceRange().convertToPercent(c, o)), d = this._source.priceScale().priceToCoordinate(c, !0), this._hlevels.push({ coeff: l, color: h, y: d, index: n })); for (this._vlevels = [], p = e.index - t.index, n = 1; n <= 7; n++) s = "vlevel" + n, a = this._source.properties()[s], a.visible.value() && (l = a.coeff.value(), h = a.color.value(), u = Math.round(t.index + l * p), _ = this._model.timeScale().indexToCoordinate(u, !0), this._vlevels.push({ coeff: l, color: h, x: _, index: n })) } }, o.prototype.renderer = function() {
        var t, e, i, o, n, r, l, _, f, m, g, v, y, b, w, S, T, C, x, P, L, k, I, A;
        if (this._invalidated && (this.updateImpl(), this._invalidated = !1), t = new u, this._floatPoints.length < 2) return t;
        for (e = this._floatPoints[0], i = this._floatPoints[1], o = Math.min(e.x, i.x), n = Math.min(e.y, i.y), r = Math.max(e.x, i.x),
            l = Math.max(e.y, i.y), _ = this._source.properties(), f = _.grid.color.value(), m = _.grid.linewidth.value(), g = _.grid.linestyle.value(), v = 0; v < this._hlevels.length; v++) e = new s.Point(o, this._hlevels[v].y), i = new s.Point(r, this._hlevels[v].y), _.grid.visible.value() && (y = { points: [e, i], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: f, linewidth: m, linestyle: g, extendleft: !1, extendright: !1, leftend: a.LINEEND_NORMAL, rightend: a.LINEEND_NORMAL }, t.append(new d(y))), _.showLeftLabels.value() && (b = { points: [e], text: this._numericFormatter.format(this._hlevels[v].coeff), color: this._hlevels[v].color, vertAlign: "middle", horzAlign: "right", font: _.font.value(), offsetX: -5, offsetY: 0, fontsize: 12 }, t.append(new c(b, this._rendererCache))), _.showRightLabels.value() && (w = { points: [i], text: this._numericFormatter.format(this._hlevels[v].coeff), color: this._hlevels[v].color, vertAlign: "middle", horzAlign: "left", font: _.font.value(), offsetX: 5, offsetY: 0, fontsize: 12 }, t.append(new c(w, this._rendererCache)));
        for (v = 0; v < this._vlevels.length; v++) e = new s.Point(this._vlevels[v].x, n), i = new s.Point(this._vlevels[v].x, l), _.grid.visible.value() && (y = { points: [e, i], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: f, linewidth: m, linestyle: g, extendleft: !1, extendright: !1, leftend: a.LINEEND_NORMAL, rightend: a.LINEEND_NORMAL }, t.append(new d(y))), _.showTopLabels.value() && (S = { points: [e], text: this._numericFormatter.format(this._vlevels[v].coeff), color: this._vlevels[v].color, vertAlign: "bottom", horzAlign: "center", font: _.font.value(), offsetX: 0, offsetY: -5, fontsize: 12 }, t.append(new c(S, this._rendererCache))), _.showBottomLabels.value() && (T = { points: [i], text: this._numericFormatter.format(this._vlevels[v].coeff), color: this._vlevels[v].color, vertAlign: "top", horzAlign: "center", font: _.font.value(), offsetX: 0, offsetY: 5, fontsize: 12 }, t.append(new c(T, this._rendererCache)));
        for (C = _.fillBackground.value(), x = _.transparency.value(), e = this._floatPoints[0], i = this._floatPoints[1], v = 0; v < this._hlevels.length; v++) P = new s.Point(i.x, this._hlevels[v].y), v > 0 && C && (L = new s.Point(i.x, this._hlevels[v - 1].y), k = {}, k.width = this._model.timeScale().width(), k.p1 = e, k.p2 = P, k.p3 = e, k.p4 = L, k.color = this._hlevels[v].color, k.transparency = x, k.hittestOnBackground = !0, t.append(new h(k))), y = { points: [e, P], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: this._hlevels[v].color, linewidth: _.linewidth.value(), linestyle: _.linestyle.value(), extendleft: !1, extendright: !0, leftend: a.LINEEND_NORMAL, rightend: a.LINEEND_NORMAL }, I = new p(p.MOVEPOINT, null, { type: "h", index: this._hlevels[v].index }), t.append(new d(y, I));
        for (v = 0; v < this._vlevels.length; v++) A = new s.Point(this._vlevels[v].x, i.y), v > 0 && C && (L = new s.Point(this._vlevels[v - 1].x, i.y), k = {}, k.width = this._model.timeScale().width(), k.p1 = e, k.p2 = A, k.p3 = e, k.p4 = L, k.color = this._vlevels[v].color, k.transparency = x, k.hittestOnBackground = !0, t.append(new h(k))), y = {
            points: [e, A],
            width: this._model.timeScale().width(),
            height: this._source.priceScale().height(),
            color: this._vlevels[v].color,
            linewidth: _.linewidth.value(),
            linestyle: _.linestyle.value(),
            extendleft: !1,
            extendright: !0,
            leftend: a.LINEEND_NORMAL,
            rightend: a.LINEEND_NORMAL
        }, I = new p(p.MOVEPOINT, null, { type: "v", index: this._vlevels[v].index }), t.append(new d(y, I));
        return this.addAnchors(t), t
    }, inherit(n, a), n.prototype.pointsCount = function() { return 2 }, n.prototype.title = function() { return "Fib Speed Resistance Fan" }, n.prototype.processErase = function(t, e) {
        var i = "h" === e.type ? "hlevel" + e.index : "vlevel" + e.index,
            o = this.properties()[i].visible;
        t.setProperty(o, !1, "Erase level line")
    }, n.prototype.createPropertiesObject = function(t, e, i) { return new l(t, e, i, { range: [1, 7], prefixes: ["h", "v"], names: ["coeff", "color", "visible"] }) }, t.exports = n
}, function(t, e, i) {
    "use strict";

    function o(t) { this._data = t }

    function n(t, e) { a.call(this, t, e), this._invalidated = !0 }

    function s(t, e) {
        this._constructor = "LineToolFibSpiral";
        var i = e || new d("linetoolfibspiral");
        r.call(this, t, new n(this, t), i)
    }
    var r = i(1).LineDataSource,
        a = i(9),
        l = i(11).TrendLineRenderer,
        h = i(8),
        c = i(6),
        d = i(7).DefaultProperty;
    o.prototype._fibNumbers = function() { return [0, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] }, o.prototype._continiusFib = function(t) {
        var e, i, o = this._fibNumbers(),
            n = Math.floor(t),
            s = Math.ceil(t);
        return s >= o.length ? null : (e = t - n, e = Math.pow(e, 1.15), i = o[s] - o[n], o[n] + i * e)
    }, o.prototype.hitTest = function(t) {
        var e, i, o, n, s = this._data.points[0],
            r = this._data.points[1],
            a = r.substract(s),
            l = t.substract(s),
            c = a.normalized(),
            d = c.transponed(),
            p = l.normalized(),
            u = Math.acos(c.dotProduct(p)),
            _ = Math.asin(d.dotProduct(p));
        for (_ < 0 && (u = 2 * Math.PI - u), e = l.length(), i = 0; i < 4; i++)
            if (o = u / (.5 * Math.PI), n = this._continiusFib(o + 4 * i), null !== (n = n * a.length() / 5) && Math.abs(n - e) < 5) return new h(h.MOVEPOINT);
        return null
    }, o.prototype.draw = function(t) {
        var e, i, o, n, s, r, a, l, h, c, d, p;
        for (t.lineCap = "round", t.strokeStyle = this._data.color, e = this._data.points[0], i = this._data.points[1], t.translate(e.x, e.y), o = i.substract(e), n = o.length(), o = o.normalized(), s = Math.acos(o.x), Math.asin(o.y) < 0 && (s = 2 * Math.PI - s), t.rotate(s), t.scale(n / 5, n / 5), t.lineWidth = this._data.linewidth, CanvasEx.setLineStyle(t, this._data.linestyle), r = 50, a = Math.PI / (2 * r), t.moveTo(0, 0), l = 0; l < (this._fibNumbers().length - 1) * r; l++) h = l * a, c = this._continiusFib(l / r), d = Math.cos(h) * c, p = Math.sin(h) * c, t.lineTo(d, p);
        t.scale(5 / n, 5 / n), t.rotate(-s), t.stroke()
    }, inherit(n, a), n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() { a.prototype.update.call(this), this._invalidated = !1 }, n.prototype.renderer = function() {
        var t, e;
        return this._invalidated && this.updateImpl(), t = new c, this._floatPoints.length < 2 ? t : (e = {}, e.points = this._floatPoints, 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 = !1, e.extendright = !0, e.leftend = r.LINEEND_NORMAL, e.rightend = r.LINEEND_NORMAL, t.append(new l(e)), e = {}, e.points = this._floatPoints, 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(), t.append(new o(e)), this.isAnchorsRequired() && this.addAnchors(t), t)
    }, inherit(s, r), s.prototype.pointsCount = function() { return 2 }, s.prototype.title = function() { return "Fib Spiral" }, t.exports = s
}, 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(2),
        r = i(9),
        a = i(1).LineDataSource,
        l = i(90).VertLineRenderer,
        h = i(23),
        c = i(16).TextRenderer,
        d = i(45).RectangleTransparencyRenderer,
        p = i(11).TrendLineRenderer,
        u = i(8),
        _ = i(6);
    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], 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" }, 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) { s.call(this, t, e), this._label1 = null, this._label2 = null, this._rendererCache = {}, this._invalidated = !0 }

    function n(t, e) {
        this._constructor = "LineToolFlatBottom";
        var i = e || new p("linetoolflatbottom");
        r.call(this, t, new o(this, t), i), this.version = n.version
    }
    var s = i(9),
        r = i(1).LineDataSource,
        a = i(52).ChannelRenderer,
        l = i(11).TrendLineRenderer,
        h = i(16).TextRenderer,
        c = i(92),
        d = i(6),
        p = i(7).DefaultProperty;
    inherit(o, s), o.prototype.update = function() { this._invalidated = !0 }, o.prototype.updateImpl = function() {
        var t, e, i;
        s.prototype.update.call(this), this._label1 = null, this._label2 = null, this._source.points().length < 2 || this._source.priceScale() && (t = this._source.points()[0], e = this._source.points()[1], this._price1 = this._source.priceScale().formatter().format(t.price), this._price2 = this._source.priceScale().formatter().format(e.price), 3 === this._source.points().length && (i = this._source.points()[2], this._price3 = this._source.priceScale().formatter().format(i.price)))
    }, o.prototype.renderer = function() {
        var t, e, i, o, n, s, r, p, u, _, f, m, g, v, y, b, w, S, T, C, x;
        return this._invalidated && (this.updateImpl(), this._invalidated = !1), t = new d, this._points.length < 2 ? t : (e = this._points[0], i = this._points[1], s = this._source.properties(), r = this._model, p = this._source, 3 === this._points.length && (o = this._points[2], o.x = i.x, n = e.clone(), n.y = o.y, n.data = 3, s.fillBackground.value() && (u = {}, _ = r.timeScale().width(), f = s.extendLeft.value(), m = s.extendRight.value(), f || m ? !f && m ? (g = {}, g.width = _, g.p1 = e, g.p2 = i, g.p3 = n, g.p4 = o, g.color = s.backgroundColor.value(), g.transparency = s.transparency.value(), g.hittestOnBackground = TradingView.isMobile.any(), t.append(new a(g))) : f && !m ? (g = {}, g.width = _, g.p1 = i, g.p2 = e, g.p3 = o, g.p4 = n, g.color = s.backgroundColor.value(), g.transparency = s.transparency.value(),
            g.hittestOnBackground = TradingView.isMobile.any(), t.append(new a(g))) : (v = e.add(i).scaled(.5), y = n.add(o).scaled(.5), b = {}, b.width = _, b.p1 = v, b.p2 = i, b.p3 = y, b.p4 = o, b.color = s.backgroundColor.value(), b.transparency = s.transparency.value(), b.hittestOnBackground = TradingView.isMobile.any(), t.append(new a(b)), w = {}, w.width = _, w.p1 = v, w.p2 = e, w.p3 = y, w.p4 = n, w.color = s.backgroundColor.value(), w.transparency = s.transparency.value(), w.hittestOnBackground = TradingView.isMobile.any(), t.append(new a(w))) : (u.points = [e, i, o, n], u.color = "rgba(0,0,0,0)", u.linewidth = 0, u.linestyle = CanvasEx.LINESTYLE_SOLID, u.filled = !0, u.backcolor = s.backgroundColor.value(), u.fillBackground = !0, u.transparency = s.transparency.value(), t.append(new c(u))))), S = function(t, e) { return { points: [t, e], width: r.timeScale().width(), height: p.priceScale().height(), color: s.linecolor.value(), linewidth: s.linewidth.value(), linestyle: s.linestyle.value(), extendleft: s.extendLeft.value(), extendright: s.extendRight.value(), leftend: s.leftEnd.value(), rightend: s.rightEnd.value() } }, t.append(new l(S(e, i))), 2 === this._points.length ? (this.addAnchors(t), t) : (T = this, C = function(e, i, o, n) {
            var s;
            T._source.properties().showPrices.value() && (s = { points: [e], text: o, color: T._source.properties().textcolor.value(), horzAlign: e.x > i.x ? "left" : "right", vertAlign: "middle", font: T._source.properties().font.value(), offsetX: e.x > i.x ? -5 : 5, offsetY: -5, bold: T._source.properties().bold.value(), italic: T._source.properties().italic.value(), fontsize: T._source.properties().fontsize.value() }, t.append(new h(s, T._rendererCache)), s = { points: [i], text: n, color: T._source.properties().textcolor.value(), horzAlign: e.x < i.x ? "left" : "right", vertAlign: "middle", font: T._source.properties().font.value(), offsetX: e.x > i.x ? -5 : 5, offsetY: -5, bold: T._source.properties().bold.value(), italic: T._source.properties().italic.value(), fontsize: T._source.properties().fontsize.value() }, t.append(new h(s, T._rendererCache)))
        }, t.append(new l(S(e, i))), C(e, i, this._price1, this._price2), 2 === this._points.length ? t : (t.append(new l(S(n, o))), C(o, n, this._price3, this._price3), this.isAnchorsRequired() && (x = [e, i, o, n], this._model.lineBeingCreated() === this._source && x.pop(), t.append(this.createLineAnchor({ points: x }))), !TradingView.printing && this._source.hasAlert.value() && !this._model.readOnly() && e && i && this._source.getAlertIsActive(function(o) { t.append(new TradingView.PaneRendererClockIcon({ point1: e, point2: i, color: o ? s.linecolor.value() : defaults("chartproperties.alertsProperties.drawingIcon.color") })) }), t)))
    }, inherit(n, r), n.version = 1, n.prototype.pointsCount = function() { return 3 }, n.prototype.title = function() { return "Flat Bottom" }, n.prototype.addPoint = function(t, e) { return e && e.shift && 2 === this.points().length && this._snapPoint45Degree(t, this.points()[this.points().length - 2]), r.prototype.addPoint.call(this, t) }, n.prototype.setLastPoint = function(t, e) { return e && e.shift && 2 === this.points().length && this._snapPoint45Degree(t, this.points()[this.points().length - 2]), r.prototype.setLastPoint.call(this, t) }, n.prototype.setPoint = function(t, e, i) {
        if (i && i.shift && 1 === t) { this._snapPoint45Degree(e, this.points()[0]) }
        t < 3 ? r.prototype.setPoint.call(this, t, e) : this._points[0].index = e.index
    }, n.prototype.canHasAlert = function() { return !0 }, n.prototype._getAlertPlots = function() {
        var t, e, i, o, n, s, r, a, l, h = this._points[0],
            c = this._points[1],
            d = [];
        return h.index <= c.index ? (d.push(h), d.push(c)) : (d.push(c), d.push(h)), t = this._points[2], t.time = c.time, t.index = c.index, e = { price: t.price, time: h.time, index: h.index }, i = [], t.index <= e.index ? (i.push(t), i.push(e)) : (i.push(e), i.push(t)), d[0].price > i[0].price ? (o = d, n = i) : i[0].price > d[0].price ? (o = i, n = d) : i[1].price > d[1].price ? (o = i, n = d) : (o = d, n = i), a = this.properties().extendLeft.value(), l = this.properties().extendRight.value(), h.index <= c.index ? (s = a, r = l) : (s = l, r = a), [this._linePointsToAlertPlot(o, "Upper", s, r), this._linePointsToAlertPlot(n, "Lower", a, r)]
    }, t.exports = n
}, function(t, e, i) {
    "use strict";

    function o(t) { this._data = t }

    function n(t, e) { h.call(this, t, e), this._rendererCache = {}, this._invalidated = !0 }

    function s(t, e) {
        this._constructor = "LineToolGannComplex";
        var i = e || this.createPropertiesObject("linetoolganncomplex");
        l.call(this, t, new n(this, t), i), this._adjustScaleAction = this._makeAdjustScaleAction(function() { var t = this.points(); return 3 === t.length ? [t[0], t[2]] : [] }.bind(this))
    }

    function r(t, e, i) { c.call(this, t, e, i, { names: ["width", "color", "visible"] }) }
    var a = i(2),
        l = i(1).LineDataSource,
        h = i(9),
        c = i(23),
        d = i(11).TrendLineRenderer,
        p = i(35).isSameType,
        u = i(8),
        _ = i(6),
        f = i(14);
    o.prototype.draw = function(t) {
            var e, i, o, n, s, r;
            t.lineCap = "butt", t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, t.translate(this._data.center.x, this._data.center.y), e = this._data.edge.substract(this._data.center), i = e.y / e.x, o = this._data.point.substract(this._data.center), o.y /= i, n = o.length(), s = this._data.prevPoint.substract(this._data.center), s.y /= i, r = s.length(), t.scale(1, i), this._data.fillBack && (this._data.point.x < this._data.center.x && (n = -n, r = -r), t.beginPath(), t.moveTo(r, 0), t.lineTo(n, 0), t.arcTo(n, n, 0, n, Math.abs(n)), t.lineTo(0, r), t.arcTo(r, r, r, 0, Math.abs(r)), t.fillStyle = f.generateColor(this._data.color, this._data.transparency, !0), t.fill()), t.beginPath(), this._data.point.x > this._data.center.x ? t.arc(0, 0, Math.abs(n), 0, Math.PI / 2, !1) : t.arc(0, 0, Math.abs(n), -Math.PI / 2, -Math.PI, !0), t.scale(1, 1 / i), t.stroke()
        }, o.prototype.hitTest = function(t) {
            var e, i, o, n, s, r = t.substract(this._data.center),
                a = this._data.edge.substract(this._data.center),
                l = a.y / a.x;
            return r.y /= l, e = this._data.point.substract(this._data.center), e.y /= l, i = e.length(), o = r.length(), n = this._data.prevPoint.substract(this._data.center), n.y /= l, s = n.length(), Math.abs(o - i) < 5 && a.x * r.x >= 0 && a.y * r.y >= 0 ? new u(u.MOVEPOINT) : this._data.fillBack && o >= s && o <= i && a.x * r.x >= 0 && a.y * r.y >= 0 ? new u(u.MOVEPOINT_BACKGROUND) : null
        }, inherit(n, h), n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() { h.prototype.update.call(this), this._source._cornerPoint && this._points.push(this._source.pointToScreenPoint(this._source._cornerPoint)[0]) }, n.prototype.renderer = function() {
            var t, e, i, n, s, r, h, c, p, u, f, m, g, v, y, b, w, S, T, C, x, P, L;
            if (this._invalidated && (this.updateImpl(), this._invalidated = !1), t = this._source.properties(), e = new _,
                this._points.length < 2) return this.addAnchors(e), e;
            for (i = this._points[0], n = 3 === this._points.length ? this._points[2] : this._points[1], s = this._points[1], r = t.reverse && t.reverse.value(), h = r ? i.x - n.x : n.x - i.x, c = r ? i.y - n.y : n.y - i.y, p = r ? s : i, u = r ? new a.Point(s.x - (n.x - i.x), s.y - (n.y - i.y)) : n, g = 0; g < 6; g++) v = t.levels[g], v.visible.value() && (y = g / 5, f = p.x + y * h, b = { points: [new a.Point(f, p.y), new a.Point(f, u.y)], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: v.color.value(), linewidth: v.width.value(), linestyle: CanvasEx.LINESTYLE_SOLID, extendleft: !1, extendright: !1, leftend: l.LINEEND_NORMAL, rightend: l.LINEEND_NORMAL }, e.append(new d(b)), m = p.y + y * c, b = { points: [new a.Point(p.x, m), new a.Point(u.x, m)], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: v.color.value(), linewidth: v.width.value(), linestyle: CanvasEx.LINESTYLE_SOLID, extendleft: !1, extendright: !1, leftend: l.LINEEND_NORMAL, rightend: l.LINEEND_NORMAL }, e.append(new d(b)));
            for (g in t.fanlines._childs) w = t.fanlines[g], w.visible.value() && (S = w.x.value(), T = w.y.value(), S > T ? (f = u.x, y = T / S, m = p.y + y * c) : (m = u.y, y = S / T, f = p.x + y * h), b = { points: [r ? s : i, new a.Point(f, m)], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: w.color.value(), linewidth: w.width.value(), linestyle: CanvasEx.LINESTYLE_SOLID, extendleft: !1, extendright: !1, leftend: l.LINEEND_NORMAL, rightend: l.LINEEND_NORMAL }, e.append(new d(b)));
            C = r ? s : i;
            for (g in t.arcs._childs) x = t.arcs[g], x.visible.value() && (S = x.x.value() / 5, T = x.y.value() / 5, f = p.x + S * h, m = p.y + T * c, P = { center: p, point: new a.Point(f, m), edge: u, color: x.color.value(), linewidth: x.width.value(), fillBack: t.arcsBackground.fillBackground.value(), transparency: t.arcsBackground.transparency.value(), prevPoint: C }, e.append(new o(P)), C = P.point);
            return this.isAnchorsRequired() && (L = [i, s], this._model.lineBeingCreated() === this._source && L.pop(), e.append(this.createLineAnchor({ points: L }))), e
        }, inherit(s, l), s.prototype._recalcSecondPoint = function() {
            var t, e, i, o, n, s = this._model.mainSeries().properties().style.value(),
                r = this._model.mainSeries().interval();
            s === this._currentStyle && r === this._currentInterval || (t = this.pointToScreenPoint(this.points()[0])[0], e = this.pointToScreenPoint(this.points()[2])[0], i = e.substract(t), o = t.add(i.scaled(.2 / Math.sqrt(2))), n = this.screenPointToPoint(o), this._points[1] = n)
        }, s.prototype.pointsCount = function() { return 2 }, s.prototype.title = function() { return "Gann Square" }, s.prototype.axisPoints = function() { var t, e, i, o = l.prototype.axisPoints.call(this).slice(); return this.properties().reverse.value() && 3 === o.length && (t = o[0], e = o[1], i = o[2], o[2] = { index: e.index - (i.index - t.index), price: e.price - (i.price - t.price) }), o }, s.prototype._fixThirdPoint = function(t) {
            var e, i, o, n, s, r, l, h;
            this.points().length < 2 || (e = this.pointToScreenPoint(this.points()[0])[0], i = this.pointToScreenPoint(this.points()[1])[0], o = i.substract(e), t ? (n = e.add(o.scaled(5 * Math.sqrt(2))), this._cornerPoint = this.screenPointToPoint(n)) : (s = o.x < 0 ? -1 : 1, r = o.y < 0 ? -1 : 1, l = i.substract(e).length(), n = e.add(new a.Point(5 * l * s, 5 * l * r)), h = this.screenPointToPoint(n), this._cornerPoint = h))
        },
        s.prototype.setPoint = function(t, e, i) {
            var o, n, s = l.prototype.setPoint.call(this, t, e, i),
                r = i && i.shift;
            return this._fixThirdPoint(r), this._points[2] = this._cornerPoint, delete this._cornerPoint, o = this._model.mainSeries().properties().style.value(), n = this._model.mainSeries().interval(), this._currentStyle = o, this._currentInterval = n, s
        }, s.prototype.setLastPoint = function(t, e) {
            var i = l.prototype.setLastPoint.call(this, t, e),
                o = e && e.shift;
            return this._fixThirdPoint(o), i
        }, s.prototype.addPoint = function(t, e) {
            var i, o, n, s, r = $.extend({}, t),
                a = this._model.mainSeries().properties().style.value(),
                l = this._model.mainSeries().interval();
            return this._currentStyle = a, this._currentInterval = l, i = this.priceScale(), i.isPercent() && (o = this.ownerSource().firstValue(), r.price = i.priceRange().convertFromPercent(r.price, o)), n = e && e.shift, this._points.push(r), this._lastPoint = null, s = this._points.length === this.pointsCount(), s ? (this._fixThirdPoint(n), this._points.push(this._cornerPoint), delete this._cornerPoint, this.normalizePoints(), this.createServerPoints()) : this._lastPoint = r, s
        }, s.prototype.onData = function(t) { l.prototype.onData.call(this, t), this._recalcSecondPoint() }, s.prototype.contextMenuActions = function() { return [this._adjustScaleAction] }, s.prototype.updateContextMenuActions = function() { this._adjustScaleAction.setEnabled(!this.priceScale().isPercent()) }, inherit(r, c), r.prototype._iterateLevels = function(t, e) {
            var i, o, n;
            for (i in t.levels)
                if (t.levels[i] && p(t.levels[i], e.typecheck())) {
                    o = e.tpl();
                    for (n in this._map.names) o = e.fill(n, this._map.names[n], t.levels[i], o);
                    t.levels[i] = o
                }
            return t
        }, s.prototype.createPropertiesObject = function(t, e, i) { return new r(t, e, i) }, t.exports = s
}, 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 = "LineToolGannFan";
        var i = e || this.createPropertiesObject("linetoolgannfan");
        r.call(this, t, new o(this, t), i)
    }
    var s = i(2),
        r = i(1).LineDataSource,
        a = i(9),
        l = i(23),
        h = i(52).ChannelRenderer,
        c = i(16).TextRenderer,
        d = i(11).TrendLineRenderer,
        p = i(8),
        u = i(6);
    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, _;
        if (a.prototype.update.call(this), !(this._source.points().length < 2) && this._source.priceScale() && !this._source.priceScale().isEmpty() && !this._model.timeScale().isEmpty())
            for (t = this._floatPoints[0], e = this._floatPoints[1], this._fans = [], i = e.x - t.x, o = e.y - t.y, r = 1; r <= 9; r++) l = "level" + r, h = this._source.properties()[l], h.visible.value() && (c = h.coeff1.value(), d = h.coeff2.value(), p = c / d, u = h.color.value(), _ = c + "/" + d, c > d ? (n = e.x, s = t.y + o / p) : (n = t.x + i * p, s = e.y), this._fans.push({ label: _, color: u, x: n, y: s, linewidth: h.linewidth.value(), linestyle: h.linestyle.value(), index: r }))
    }, o.prototype.renderer = function() {
        var t, e, i, o, n, a, l, _, f, m, g, v;
        if (this._invalidated && (this.updateImpl(), this._invalidated = !1), t = new u, this._floatPoints.length < 2) return t;
        for (e = this._floatPoints[0], i = this._source.properties(), o = this._source.properties().fillBackground.value(), n = this._source.properties().transparency.value(),
            a = 0; a < this._fans.length; a++) l = new s.Point(this._fans[a].x, this._fans[a].y), o && (this._fans[a].index < 4 ? (_ = new s.Point(this._fans[a + 1].x, this._fans[a + 1].y), f = {}, f.width = this._model.timeScale().width(), f.p1 = e, f.p2 = l, f.p3 = e, f.p4 = _, f.color = this._fans[a].color, f.transparency = n, f.hittestOnBackground = !0, t.append(new h(f))) : this._fans[a].index > 4 && a > 0 && (_ = new s.Point(this._fans[a - 1].x, this._fans[a - 1].y), f = {}, f.width = this._model.timeScale().width(), f.p1 = e, f.p2 = l, f.p3 = e, f.p4 = _, f.color = this._fans[a].color, f.transparency = n, f.hittestOnBackground = !0, t.append(new h(f)))), m = { points: [e, l], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: this._fans[a].color, linewidth: this._fans[a].linewidth, linestyle: this._fans[a].linestyle, extendleft: !1, extendright: !0, leftend: r.LINEEND_NORMAL, rightend: r.LINEEND_NORMAL }, g = new p(p.MOVEPOINT, null, this._fans[a].index), t.append(new d(m, g)), i.showLabels.value() && (v = { points: [l], text: this._fans[a].label, color: this._fans[a].color, vertAlign: "middle", horzAlign: "left", font: i.font.value(), offsetX: 0, offsetY: -5, fontsize: 12 }, t.append(new c(v, this._rendererCache)));
        return this.addAnchors(t), t
    }, inherit(n, r), n.prototype.pointsCount = function() { return 2 }, n.prototype.title = function() { return "Gann Fan" }, 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 l(t, e, i, { range: [1, 9] }) }, t.exports = n
}, function(t, e, i) {
    "use strict";

    function o(t, e) { l.call(this, t, e), this._rendererCache = {}, this._numericFormatter = new f, this._invalidated = !0 }

    function n(t, e) {
        this._constructor = "LineToolGannSquare";
        var i = e || this.createPropertiesObject("linetoolgannsquare");
        h.call(this, t, new o(this, t), i), this._adjustScaleAction = this._makeAdjustScaleAction()
    }
    var s, r, a = i(2),
        l = i(9),
        h = i(1).LineDataSource,
        c = i(23),
        d = i(16).TextRenderer,
        p = i(45).RectangleTransparencyRenderer,
        u = i(11).TrendLineRenderer,
        _ = i(6),
        f = i(26).NumericFormatter;
    inherit(o, l), o.prototype.renderer = function() {
        function t(t, e, i) {
            var o, d, p, _, f, m, g, v, y, b = new a.Point(n, s),
                w = new a.Point(r, s),
                S = new a.Point(n, l),
                T = new a.Point(r, l),
                C = { width: k._model.timeScale().width(), height: k._source.priceScale().height(), color: c.fans.color.value(), linewidth: c.linewidth.value(), linestyle: c.linestyle.value(), extendleft: !1, extendright: !1, leftend: h.LINEEND_NORMAL, rightend: h.LINEEND_NORMAL };
            for (o = 0; o < e.length; ++o) d = i ? l : e[o], p = i ? s : e[o], _ = i ? e[o] : n, f = i ? e[o] : r, m = new a.Point(f, d), g = new a.Point(_, d), v = new a.Point(f, p), y = new a.Point(_, p), t.append(new u($.extend({}, C, { points: [S, v] }))), t.append(new u($.extend({}, C, { points: [T, y] }))), t.append(new u($.extend({}, C, { points: [b, m] }))), t.append(new u($.extend({}, C, { points: [w, g] })))
        }
        var e, i, o, n, s, r, l, c, f, m, g, v, y, b, w, S, T, C, x, P, L, k;
        if (this._invalidated && (this.updateImpl(), this._invalidated = !1), e = new _, this._points.length < 2) return this.addAnchors(e), e;
        for (i = this._points[0], o = this._points[1], n = Math.min(i.x, o.x), s = Math.min(i.y, o.y), r = Math.max(i.x, o.x), l = Math.max(i.y, o.y), c = this._source.properties(),
            f = this._source.properties().fillHorzBackground.value(), m = this._source.properties().horzTransparency.value(), g = this._source.properties().fillVertBackground.value(), v = this._source.properties().vertTransparency.value(), y = 0; y < this._hlevels.length; y++) y > 0 && f && (b = this._hlevels[y - 1], i = new a.Point(n, this._hlevels[y].y), o = new a.Point(r, b.y), w = {}, w.points = [i, o], w.color = this._hlevels[y].color, w.linewidth = 0, w.backcolor = this._hlevels[y].color, w.fillBackground = !0, w.transparency = m, e.append(new p(w))), i = new a.Point(n, this._hlevels[y].y), o = new a.Point(r, this._hlevels[y].y), S = { points: [i, o], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: this._hlevels[y].color, linewidth: c.linewidth.value(), linestyle: c.linestyle.value(), extendleft: !1, extendright: !1, leftend: h.LINEEND_NORMAL, rightend: h.LINEEND_NORMAL }, e.append(new u(S)), c.showLeftLabels.value() && (T = { points: [i], text: this._numericFormatter.format(this._hlevels[y].coeff), color: this._hlevels[y].color, vertAlign: "middle", horzAlign: "right", font: c.font.value(), offsetX: -5, offsetY: 0, fontsize: 12 }, e.append(new d(T, this._rendererCache))), c.showRightLabels.value() && (C = { points: [o], text: this._numericFormatter.format(this._hlevels[y].coeff), color: this._hlevels[y].color, vertAlign: "middle", horzAlign: "left", font: c.font.value(), offsetX: 5, offsetY: 0, fontsize: 12 }, e.append(new d(C, this._rendererCache)));
        for (y = 0; y < this._vlevels.length; y++) i = new a.Point(this._vlevels[y].x, s), o = new a.Point(this._vlevels[y].x, l), y > 0 && g && (b = this._vlevels[y - 1], x = new a.Point(b.x, s), w = {}, w.points = [x, o], w.color = this._vlevels[y].color, w.linewidth = 0, w.backcolor = this._vlevels[y].color, w.fillBackground = !0, w.transparency = v, e.append(new p(w))), S = { points: [i, o], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: this._vlevels[y].color, linewidth: c.linewidth.value(), linestyle: c.linestyle.value(), extendleft: !1, extendright: !1, leftend: h.LINEEND_NORMAL, rightend: h.LINEEND_NORMAL }, e.append(new u(S)), c.showTopLabels.value() && (P = { points: [i], text: this._numericFormatter.format(this._vlevels[y].coeff), color: this._vlevels[y].color, vertAlign: "bottom", horzAlign: "center", font: c.font.value(), offsetX: 0, offsetY: -5, fontsize: 12 }, e.append(new d(P, this._rendererCache))), c.showBottomLabels.value() && (L = { points: [o], text: this._numericFormatter.format(this._vlevels[y].coeff), color: this._vlevels[y].color, vertAlign: "top", horzAlign: "center", font: c.font.value(), offsetX: 0, offsetY: 5, fontsize: 12 }, e.append(new d(L, this._rendererCache)));
        return k = this, t(e, this._hfans, !0), t(e, this._vfans, !1), this.addAnchors(e), e
    }, o.prototype.update = function() { this._invalidated = !0 }, o.prototype.updateImpl = function() {
        var t, e, i, o, n, s, r, a, h, c, d, p, u, _, f, m, g, v;
        if (l.prototype.update.call(this), !(this._source.points().length < 2) && this._source.priceScale() && !this._source.priceScale().isEmpty() && !this._model.timeScale().isEmpty()) {
            for (t = this._source.points()[0], e = this._source.points()[1], i = this._source.properties(), o = i.reverse && i.reverse.value(), this._hlevels = [], n = o ? t.price - e.price : e.price - t.price, s = o ? e.price : t.price,
                this._source.priceScale().isPercent() && (r = this._source.ownerSource().firstValue()), a = 1; a <= 7; a++) h = "hlevel" + a, c = i[h], c.visible.value() && (d = c.coeff.value(), p = c.color.value(), u = s + d * n, this._source.priceScale().isPercent() && (u = this._source.priceScale().priceRange().convertToPercent(u, r)), _ = this._source.priceScale().priceToCoordinate(u), this._hlevels.push({ coeff: d, color: p, y: _ }));
            for (this._vlevels = [], f = o ? t.index - e.index : e.index - t.index, m = o ? e.index : t.index, a = 1; a <= 7; a++) h = "vlevel" + a, c = i[h], c.visible.value() && (d = c.coeff.value(), p = c.color.value(), g = Math.round(m + d * f), v = this._model.timeScale().indexToCoordinate(g), this._vlevels.push({ coeff: d, color: p, x: v }));
            if (this._hfans = [], this._vfans = [], i.fans.visible.value())
                for (a = 1; a <= 7; a++) g = Math.round(m + i["hlevel" + a].coeff.value() * f), u = s + i["vlevel" + a].coeff.value() * n, this._source.priceScale().isPercent() && (u = this._source.priceScale().priceRange().convertToPercent(u, r)), this._hfans.push(this._model.timeScale().indexToCoordinate(g)), this._vfans.push(this._source.priceScale().priceToCoordinate(u))
        }
    }, inherit(n, h), n.prototype.pointsCount = function() { return 2 }, n.prototype.title = function() { return "Gann Box" }, s = [4.5, 9, 11.25, 18, 22.5, 36, 45], r = function() { for (var t = [], e = 1e10, i = s.length - 1, o = 1, n = 0, r = 0; r < e;) r = s[n] * o, t.push(Math.round(r)), t.push(Math.ceil(-r)), n === i - 1 && (o *= 10), n = (n + 1) % i; return t.sort(function(t, e) { return t < e ? -1 : t > e ? 1 : 0 }), t }(), n.prototype._alignPriceOnPattern = function(t, e) { var i, o, n, r, a, l, h = Math.round(1e6 * (t.price - e.price)) / 1e6; if (0 === h) return e.price; for (i = s[0], o = s[s.length - 1], n = 1, r = Math.abs(h); r < i * n || o * n < r;) r < i * n ? n *= .1 : o * n < r && (n *= 10); for (a = o * n, l = s.length - 2; l >= 0 && !(s[l] * n < r); --l) a = s[l] * n; return t.price = e.price + (h >= 0 ? a : -a), t }, n.prototype._alignTimeOnPattern = function(t, e) { var i, o = t.index - e.index; if (0 === o) return 0; for (i = r.length - 2; i >= 0 && !(r[i] < o); --i); return i += o > 0 ? 1 : 0, t.index = e.index + r[i], t }, n.prototype._alignPointsFixedIncrement = function(t, e) { return this._alignTimeOnPattern(t, e), this._alignPriceOnPattern(t, e), t }, n.prototype._preparePoint = function(t, e) { return e && e.shift && 0 !== this._points.length && this._alignPointsFixedIncrement(t, this._points[0]), h.prototype._preparePoint.call(this, t, e) }, n.prototype.setPoint = function(t, e, i) {
        if (i && i.shift) {
            var o = 0 === t ? this._points[1] : this._points[0];
            this._alignPointsFixedIncrement(e, o)
        }
        h.prototype.setPoint.call(this, t, e, i)
    }, n.prototype.createPropertiesObject = function(t, e, i) { return new c(t, e, i, { range: [1, 7], prefixes: ["h", "v"], names: ["coeff", "color", "visible"] }) }, n.prototype.contextMenuActions = function() { return [this._adjustScaleAction] }, n.prototype.updateContextMenuActions = function() { this._adjustScaleAction.setEnabled(!this.priceScale().isPercent()) }, t.exports = n
}, function(t, e, i) {
    "use strict";

    function o(t, e) { r.call(this, t, e), this._rendererCache = {}, this._invalidated = !0 }

    function n(t, e) {
        this._constructor = "LineToolHeadAndShoulders";
        var i = e || new p("linetoolheadandshoulders");
        a.call(this, t, new o(this, t), i)
    }
    var s = i(2),
        r = i(9),
        a = i(1).LineDataSource,
        l = i(11).TrendLineRenderer,
        h = i(119).TriangleRenderer,
        c = i(16).TextRenderer,
        d = i(6),
        p = i(7).DefaultProperty,
        u = i(14);
    inherit(o, r),
        o.prototype.i18nCache = { leftShoulder: $.t("Left Shoulder"), rightShoulder: $.t("Right Shoulder"), head: $.t("Head") }, o.prototype.renderer = function() {
            var t, e, i, o, n, s, r, p, _, f, m, g, v, y, b;
            if (this._invalidated && (this.updateImpl(), this._invalidated = !1), this._points.length < 2) return null;
            for (t = this._source.properties(), e = new d, i = this, o = function(e, o) { return { points: [e], text: $.t(o), color: t.textcolor.value(), horzAlign: "center", font: t.font.value(), offsetX: 0, offsetY: 0, bold: t.bold && t.bold.value(), italic: t.italic && t.italic.value(), fontsize: t.fontsize.value(), backgroundColor: i._source.properties().color.value(), backgroundRoundRect: 4 } }, n = function(e, o, n, s) { return { points: [e, o], width: i._model.timeScale().width(), height: i._source.priceScale().height(), color: u.generateColor(i._source.properties().color.value(), n), linewidth: s || t.linewidth.value(), linestyle: CanvasEx.LINESTYLE_SOLID, extendleft: !1, extendright: !1, leftend: a.LINEEND_NORMAL, rightend: a.LINEEND_NORMAL } }, s = function(e, i, o) {
                    var n = [e, i, o],
                        s = {};
                    return s.points = n, s.color = t.color.value(), s.linewidth = 0, s.backcolor = t.backgroundColor.value(), s.fillBackground = t.fillBackground.value(), s.transparency = t.transparency.value(), s
                }, r = 1; r < this._points.length; r++) p = n(this._points[r - 1], this._points[r], 0), e.append(new l(p));
            return this._points.length >= 5 && (m = !1, g = !1, this._intersect1 ? _ = this._intersect1 : (_ = this._points[2], m = !0), this._intersect2 ? f = this._intersect2 : (f = this._points[4], g = !0), p = n(_, f, 0), p.extendleft = m, p.extendright = g, e.append(new l(p)), v = s(this._points[2], this._points[3], this._points[4]), e.append(new h(v))), this._intersect1 && (v = s(this._intersect1, this._points[1], this._points[2]), e.append(new h(v))), this._intersect2 && (v = s(this._points[4], this._points[5], this._intersect2), e.append(new h(v))), this._points.length >= 2 && (y = this._points[1], b = o(y, this.i18nCache.leftShoulder), this._points[1].y < this._points[0].y ? (b.vertAlign = "bottom", b.offsetY = -10) : (b.vertAlign = "top", b.offsetY = 5), e.append(new c(b, this._rendererCache))), this._points.length >= 4 && (y = this._points[3], b = o(y, this.i18nCache.head), this._points[3].y < this._points[2].y ? (b.vertAlign = "bottom", b.offsetY = -10) : (b.vertAlign = "top", b.offsetY = 5), e.append(new c(b, this._rendererCache))), this._points.length >= 6 && (y = this._points[5], b = o(y, this.i18nCache.rightShoulder), this._points[5].y < this._points[4].y ? (b.vertAlign = "bottom", b.offsetY = -10) : (b.vertAlign = "top", b.offsetY = 5), e.append(new c(b, this._rendererCache))), this.addAnchors(e), e
        }, o.prototype.update = function() { this._invalidated = !0 }, o.prototype.updateImpl = function() {
            var t, e, i, o, n, a, l, h;
            r.prototype.update.call(this), delete this._intersect1, delete this._intersect2, this._points.length >= 5 && (t = this._points[0], e = this._points[1], i = this._points[2], o = this._points[4], n = s.intersectSegments(i, o, t, e), null !== n && (a = o.substract(i), this._intersect1 = i.add(a.scaled(n))), 7 === this._points.length && (l = this._points[5], h = this._points[6], null !== (n = s.intersectSegments(i, o, l, h)) && (a = o.substract(i), this._intersect2 = i.add(a.scaled(n)))))
        }, inherit(n, a), n.prototype.pointsCount = function() { return 7 }, n.prototype.title = function() { return "Head & Shoulders" },
        t.exports = n
}, function(t, e, i) {
    "use strict";

    function o(t) { this._data = t }

    function n(t, e) { l.call(this, t, e), this._rendererCache = {}, this._invalidated = !0 }

    function s(t, e) { this._source = t, this._model = e, this._text = "", this._coordinate = 0, this._background = "black" }

    function r(t, e) {
        this._constructor = "LineToolHorzRay";
        var i = e || new _("linetoolhorzray");
        this._priceAxisView = new s(this, t), a.call(this, t, new n(this, t), i)
    }
    var a = i(1).LineDataSource,
        l = i(9),
        h = i(66),
        c = i(16).TextRenderer,
        d = i(67),
        p = i(8),
        u = i(6),
        _ = i(7).DefaultProperty;
    o.prototype.draw = function(t) {
        var e, i, o, n;
        if (0 === this._data.points.length) return null;
        e = t.canvas.width, i = this._data.points[0].y, o = Math.max(0, this._data.points[0].x), n = Math.max(e, this._data.points[0].x), t.lineCap = "square", t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, t.lineStyle = this._data.linestyle, CanvasEx.drawLine(t, o, i, n, i)
    }, o.prototype.hitTest = function(t) { return 0 === this._data.points.length ? null : t.x < this._data.points[0].x ? null : Math.abs(t.y - this._data.points[0].y) <= 3 ? new p(this._data.hitTestResult) : null }, inherit(n, l), n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() { l.prototype.update.call(this) }, n.prototype.renderer = function() { var t, e, i, n, s, r, a, l, h; return this._invalidated && (this.updateImpl(), this._invalidated = !1), t = new u, e = {}, e.points = this._points, e.color = this._source.properties().linecolor.value(), e.linewidth = this._source.properties().linewidth.value(), e.linestyle = this._source.properties().linestyle.value(), e.hitTestResult = p.MOVEPOINT, i = this._source.properties(), t.append(new o(e)), this._source.properties().showLabel.value() && 1 === this._points.length && (n = i.vertLabelsAlign.value(), s = i.horzLabelsAlign.value(), r = this._points[0].clone(), a = 0, l = 0, "right" === s ? (r.x = this._model.timeScale().width(), l = -5) : "center" === s && (r.x = (r.x + this._model.timeScale().width()) / 2), "middle" === n ? a = -this._source.properties().fontsize.value() / 6 : "bottom" === n && (a = -4), h = { points: [r], text: i.text.value(), color: i.textcolor.value(), vertAlign: n, horzAlign: s, font: i.font.value(), offsetX: l, offsetY: a, bold: this._source.properties().bold.value(), italic: this._source.properties().italic.value(), fontsize: this._source.properties().fontsize.value() }, t.append(new c(h, this._rendererCache))), this.addAnchors(t), TradingView.printing || !this._source.hasAlert.value() || this._model.readOnly() || 1 !== this._points.length || this._source.getAlertIsActive(function(i) { t.append(new TradingView.PaneRendererClockIcon({ point1: e.points[0], color: i ? e.color : defaults("chartproperties.alertsProperties.drawingIcon.color") })) }), t }, inherit(s, h), s.prototype.update = function() { this._invaildated = !0 }, s.prototype.updateImpl = function() { 0 !== this._source.points().length && this._source.priceScale() && !this._source.priceScale().isEmpty() && (this._background = this._source.properties().linecolor.value(), this._coordinate = this._source.priceScale().priceToCoordinate(this._source.points()[0].price), this._text = this._source.priceScale().formatter().format(this._source.points()[0].price)) }, s.prototype.renderer = function() {
        this._invaildated && (this.updateImpl(),
            this._invaildated = !1);
        var t = { text: this._text, coordinate: this._coordinate, color: this.color(), background: this._background, visible: !0 };
        return new d(t)
    }, inherit(r, a), r.prototype.pointsCount = function() { return 1 }, r.prototype.title = function() { return "Horizontal Ray" }, r.prototype.priceAxisViews = function(t, e) { return this.isActualSymbol() && e === this.priceScale() && this.properties().showPrice.value() && this._model.paneForSource(this) === t ? [this._priceAxisView] : null }, r.prototype.updateAllViews = function() { a.prototype.updateAllViews.call(this), this._priceAxisView.update() }, r.prototype.canHasAlert = function() { return !0 }, r.prototype._getAlertPlots = function() {
        var t = this._points[0],
            e = { index: t.index + 1, price: t.price };
        return [this._linePointsToAlertPlot([t, e], null, !1, !0)]
    }, t.exports = r
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t) { this._line = t, this._data = { bodyText: "order", quantityText: "0" }, this._editable = !0 }

        function n(t, e, i) { this._data = t, this._cache = e, this._adapter = i }

        function s(t, e) { h.call(this, t, e) }

        function r(t, e) { p.call(this, t, e), this._rendererCache = {} }

        function a(t, e) {
            this._adapter = new o(this), this._constructor = "LineToolOrder";
            var i = e || new _("linetoolorder");
            l.call(this, t, new r(this, t), i)
        }
        var l = i(152),
            h = i(1).LineToolPriceAxisView,
            c = i(197),
            d = i(1).LineDataSource,
            p = i(9),
            u = i(8),
            _ = i(7).DefaultProperty,
            f = i(371).splitThousands;
        o.prototype.setEditable = function(t) { return this._editable = t, this }, o.prototype.getPrice = function() { return this._line.points()[0].price }, o.prototype.setPrice = function(t) { var e = this._line.points()[0]; return e.price = t, this._line._points[0] = e, this._line.normalizePoints(), this._line.updateAllViewsAndRedraw(), this }, o.prototype.getText = function() { return this._data.bodyText }, o.prototype.setText = function(t) { return this._data.bodyText = t || "", this._line.updateAllViewsAndRedraw(), this }, o.prototype.setTooltip = function(t) { return null == t ? t = "" : t += "", this._line.properties().tooltip.setValue(t), this }, o.prototype.getTooltip = function() { return this._line.properties().tooltip.value() }, o.prototype.getQuantity = function() { return this._data.quantityText }, o.prototype.setQuantity = function(t) { return this._data.quantityText = t || "", this._line.updateAllViewsAndRedraw(), this }, o.prototype.getExtendLeft = function() { var t = this._line.properties().extendLeft.value(); return "inherit" === t ? this._line._model.properties().tradingProperties.extendLeft.value() : t }, o.prototype.setExtendLeft = function(t) { return this._line.properties().extendLeft.setValue(t), this }, o.prototype.getLineLength = function() { var t = this._line.properties().lineLength.value(); return "inherit" === t ? this._line._model.properties().tradingProperties.lineLength.value() : t }, o.prototype.setLineLength = function(t) { return this._line.properties().lineLength.setValue(Math.max(0, Math.min(t, 100))), this }, o.prototype.getLineColor = function() { return c.getColorFromProperties(this._line.properties().lineColor, this._line.properties().lineTransparency) }, o.prototype.setLineColor = function(t) { return c.setColorToProperties(t, this._line.properties().lineColor, this._line.properties().lineTransparency), this },
            o.prototype.getLineStyle = function() { var t = this._line.properties().lineStyle.value(); return "inherit" === t ? this._line._model.properties().tradingProperties.lineStyle.value() : t }, o.prototype.setLineStyle = function(t) { return this._line.properties().lineStyle.setValue(t), this }, o.prototype.getLineWidth = function() { var t = this._line.properties().lineWidth.value(); return "inherit" === t ? this._line._model.properties().tradingProperties.lineWidth.value() : t }, o.prototype.setLineWidth = function(t) { return this._line.properties().lineWidth.setValue(t), this }, o.prototype.getBodyBorderColor = function() { return c.getColorFromProperties(this._line.properties().bodyBorderColor, this._line.properties().bodyBorderTransparency) }, o.prototype.setBodyBorderColor = function(t) { return c.setColorToProperties(t, this._line.properties().bodyBorderColor, this._line.properties().bodyBorderTransparency), this }, o.prototype.getBodyBackgroundColor = function() { return c.getColorFromProperties(this._line.properties().bodyBackgroundColor, this._line.properties().bodyBackgroundTransparency) }, o.prototype.setBodyBackgroundColor = function(t) { return c.setColorToProperties(t, this._line.properties().bodyBackgroundColor, this._line.properties().bodyBackgroundTransparency), this }, o.prototype.getBodyTextColor = function() { return c.getColorFromProperties(this._line.properties().bodyTextColor, this._line.properties().bodyTextTransparency) }, o.prototype.setBodyTextColor = function(t) { return c.setColorToProperties(t, this._line.properties().bodyTextColor, this._line.properties().bodyTextTransparency), this }, o.prototype.getBodyFont = function() { return c.getFontFromProperties(this._line.properties().bodyFontFamily, this._line.properties().bodyFontSize, this._line.properties().bodyFontBold, this._line.properties().bodyFontItalic) }, o.prototype.setBodyFont = function(t) { return c.setFontToProperties(t, this._line.properties().bodyFontFamily, this._line.properties().bodyFontSize, this._line.properties().bodyFontBold, this._line.properties().bodyFontItalic), this }, o.prototype.getQuantityBorderColor = function() { return c.getColorFromProperties(this._line.properties().quantityBorderColor, this._line.properties().quantityBorderTransparency) }, o.prototype.setQuantityBorderColor = function(t) { return c.setColorToProperties(t, this._line.properties().quantityBorderColor, this._line.properties().quantityBorderTransparency), this }, o.prototype.getQuantityBackgroundColor = function() { return c.getColorFromProperties(this._line.properties().quantityBackgroundColor, this._line.properties().quantityBackgroundTransparency) }, o.prototype.setQuantityBackgroundColor = function(t) { return c.setColorToProperties(t, this._line.properties().quantityBackgroundColor, this._line.properties().quantityBackgroundTransparency), this }, o.prototype.getQuantityTextColor = function() { return c.getColorFromProperties(this._line.properties().quantityTextColor, this._line.properties().quantityTextTransparency) }, o.prototype.setQuantityTextColor = function(t) {
                return c.setColorToProperties(t, this._line.properties().quantityTextColor, this._line.properties().quantityTextTransparency), this
            }, o.prototype.getQuantityFont = function() { return c.getFontFromProperties(this._line.properties().quantityFontFamily, this._line.properties().quantityFontSize, this._line.properties().quantityFontBold, this._line.properties().quantityFontItalic) }, o.prototype.setQuantityFont = function(t) { return c.setFontToProperties(t, this._line.properties().quantityFontFamily, this._line.properties().quantityFontSize, this._line.properties().quantityFontBold, this._line.properties().quantityFontItalic), this }, o.prototype.getCancelButtonBorderColor = function() { return c.getColorFromProperties(this._line.properties().cancelButtonBorderColor, this._line.properties().cancelButtonBorderTransparency) }, o.prototype.setCancelButtonBorderColor = function(t) { return c.setColorToProperties(t, this._line.properties().cancelButtonBorderColor, this._line.properties().cancelButtonBorderTransparency), this }, o.prototype.getCancelButtonBackgroundColor = function() { return c.getColorFromProperties(this._line.properties().cancelButtonBackgroundColor, this._line.properties().cancelButtonBackgroundTransparency) }, o.prototype.setCancelButtonBackgroundColor = function(t) { return c.setColorToProperties(t, this._line.properties().cancelButtonBackgroundColor, this._line.properties().cancelButtonBackgroundTransparency), this }, o.prototype.getCancelButtonIconColor = function() { return c.getColorFromProperties(this._line.properties().cancelButtonIconColor, this._line.properties().cancelButtonIconTransparency) }, o.prototype.setCancelButtonIconColor = function(t) { return c.setColorToProperties(t, this._line.properties().cancelButtonIconColor, this._line.properties().cancelButtonIconTransparency), this }, o.prototype.block = function() { this._blocked = !0, this._line.updateAllViewsAndRedraw() }, o.prototype.unblock = function() { this._blocked = !1, this._line.updateAllViewsAndRedraw() }, o.prototype.isFunction = function(t) { return "function" == typeof t }, o.prototype.onCancel = function(t, e) { return e ? this.isFunction(e) && (this._onCancelData = t, this._onCancelCallback = e) : this.isFunction(t) && (this._onCancelCallback = t), this }, o.prototype.callOnCancel = function() { this.isFunction(this._onCancelCallback) && this._onCancelCallback.call(this, this._onCancelData) }, o.prototype.isOnCancelCallbackPresent = function() { return this.isFunction(this._onCancelCallback) }, o.prototype.onModify = function(t, e) { return e ? this.isFunction(e) && (this._onModifyData = t, this._onModifyCallback = e) : this.isFunction(t) && (this._onModifyCallback = t), this }, o.prototype.callOnModify = function() { this.isFunction(this._onModifyCallback) && this._onModifyCallback.call(this, this._onModifyData) }, o.prototype.onMove = function(t, e) { return e ? this.isFunction(e) && (this._onMoveData = t, this._onMoveCallback = e) : this.isFunction(t) && (this._onMoveCallback = t), this }, o.prototype.callOnMove = function() { this.isFunction(this._onMoveCallback) && this._onMoveCallback.call(this, this._onMoveData) }, o.prototype.onContextMenu = function(t, e) { return e ? this.isFunction(e) && (this._onContextMenuData = t, this._onContextMenuCallback = e) : this.isFunction(t) && (this._onContextMenuCallback = t), this }, o.prototype.callOnContextMenu = function() {
                if (this.isFunction(this._onContextMenuCallback)) return this._onContextMenuCallback.call(this, this._onContextMenuData)
            }, o.prototype.remove = function() { this._line._model.removeSource(this._line), delete this._line }, n.prototype._height = function() { return Math.max(20, 1 + Math.max(c.fontHeight(this._adapter.getBodyFont()), c.fontHeight(this._adapter.getQuantityFont()))) }, n.prototype._bodyWidth = function(t) { var e, i, o; return 0 === this._adapter.getText().length ? 0 : (t.save(), t.font = this._adapter.getBodyFont(), e = 10, i = 10, o = t.measureText(this._adapter.getText()).width, t.restore(), Math.round(e + i + o)) }, n.prototype._getQuantity = function() { return f(this._adapter.getQuantity(), " ") }, n.prototype._quantityWidth = function(t) { var e, i; return 0 === this._getQuantity().length ? 0 : (t.save(), t.font = this._adapter.getQuantityFont(), e = 10, i = t.measureText(this._getQuantity()).width, t.restore(), Math.round(Math.max(this._height(), e + i))) }, n.prototype._cancelButtonWidth = function() { return this._adapter.isOnCancelCallbackPresent() ? this._height() : 0 }, n.prototype._drawLines = function(t, e, i, o, n) { t.save(), t.strokeStyle = this._adapter.getLineColor(), t.lineStyle = this._adapter.getLineStyle(), t.lineWidth = this._adapter.getLineWidth(), CanvasEx.drawLine(t, i, o, n, o), this._adapter.getExtendLeft() && CanvasEx.drawLine(t, 0, o, e, o), t.restore() }, n.prototype._drawMovePoints = function(t, e, i) {
                var o, n, s, r, a, l, h, c;
                for (t.save(), t.strokeStyle = this._adapter.getBodyBorderColor(), t.fillStyle = this._adapter.getBodyBorderColor(), o = 2, n = 4, s = 5, r = e + n, a = r + o, l = Math.floor((this._height() - 2 * s) / 2) + 1, h = 0; h < l; ++h) c = i + s + 2 * h, CanvasEx.drawLine(t, r, c, a, c);
                t.restore()
            }, n.prototype._drawBody = function(t, e, i) {
                var o, n;
                t.strokeStyle = this._adapter.getBodyBorderColor(), t.fillStyle = this._adapter.getBodyBackgroundColor(), o = this._bodyWidth(t), n = this._height(), t.fillRect(e + .5, i + .5, o - 1, n - 1), t.strokeRect(e, i, o, n)
            }, n.prototype._drawBodyText = function(t, e, i) {
                var o, n, s;
                t.textAlign = "center", t.textBaseline = "middle", t.font = this._adapter.getBodyFont(), t.fillStyle = this._adapter.getBodyTextColor(), o = 5, n = e + this._bodyWidth(t) / 2, s = i + this._height() / 2, t.fillText(this._adapter.getText(), o + n - 2, s)
            }, n.prototype._drawQuantity = function(t, e, i, o) {
                var n, s;
                t.save(), t.strokeStyle = this._adapter.getQuantityBorderColor(), t.fillStyle = this._adapter.getQuantityBackgroundColor(), n = this._quantityWidth(t), s = this._height(), t.fillRect(e + .5, i + .5, n - 1, s - 1), o && t.clip && (t.beginPath(), t.rect(e + .5, i - .5, n + 1, s + 1), t.clip()), t.strokeRect(e, i, n, s), t.restore()
            }, n.prototype._drawQuantityText = function(t, e, i) {
                var o, n;
                t.save(), t.textAlign = "center", t.textBaseline = "middle", t.font = this._adapter.getQuantityFont(), t.fillStyle = this._adapter.getQuantityTextColor(), o = e + this._quantityWidth(t) / 2, n = i + this._height() / 2, t.fillText(this._getQuantity(), o, n), t.restore()
            }, n.prototype._drawCancelButton = function(t, e, i, o) {
                var n, s, r, a, l, h, c;
                t.strokeStyle = this._adapter.getCancelButtonBorderColor(), t.fillStyle = this._adapter.getCancelButtonBackgroundColor(), n = this._cancelButtonWidth(), s = this._height(), t.fillRect(e + .5, i + .5, n - 1, s - 1), this._adapter._blocked && (t.fillStyle = "rgba(140, 140, 140, 0.75)",
                    t.fillRect(e + .5, i + .5, n - 1, s - 1)), t.save(), o && t.clip && (t.beginPath(), t.rect(e + .5, i - .5, n + 1, s + 1), t.clip()), t.strokeRect(e, i, n, s), t.restore(), r = e + n, a = i + s, t.strokeStyle = this._adapter.getCancelButtonIconColor(), l = 8, h = (this._cancelButtonWidth() - l) / 2, c = (this._height() - l) / 2, CanvasEx.drawPoly(t, [{ x: e + h, y: i + c }, { x: r - h, y: a - c }], !0), CanvasEx.drawPoly(t, [{ x: r - h, y: i + c }, { x: e + h, y: a - c }], !0)
            }, n.prototype.draw = function(t) { var e, i, o, n, s, r, a, l, h, c, d;!this._data.points || this._data.points.length < 1 || (e = this._data.width, i = this._bodyWidth(t), o = this._quantityWidth(t), n = i + o + this._cancelButtonWidth(), s = e - n, r = Math.max(this._adapter.getLineLength() / 100 * e, 1), a = Math.round(e - Math.min(s, r)), l = a - n, h = Math.round(this._data.points[0].y), c = Math.round(h - (this._height() + 1) / 2), this._cache.bodyRight = l + i, this._cache.quantityRight = l + i + o, this._cache.top = c, this._cache.bottom = c + this._height(), this._cache.left = l, this._cache.right = a, this._drawLines(t, l, a, h, e), d = !1, 0 !== i && (this._drawBody(t, l, c), this._drawMovePoints(t, l, c), this._drawBodyText(t, l, c), d = !0), 0 !== o && (this._drawQuantity(t, l + i, c, d), this._drawQuantityText(t, l + i, c), d = !0), 0 !== this._cancelButtonWidth() && this._drawCancelButton(t, l + i + o, c, d)) }, n.prototype.hitTest = function(t) { return 0 === this._data.points.length ? null : t.y < this._cache.top || t.y > this._cache.bottom ? null : this._adapter._blocked && t.x >= this._cache.left && t.x < this._cache.right ? new u(u.CUSTOM, {}) : this._adapter._editable && t.x >= this._cache.left && t.x < this._cache.bodyRight ? 0 === this._adapter.getTooltip().length ? new u(u.MOVEPOINT) : new u(u.MOVEPOINT, { tooltip: { text: this._adapter.getTooltip(), rect: { x: this._cache.left, y: this._cache.top, w: this._cache.bodyRight - this._cache.left, h: this._cache.bottom - this._cache.top } } }) : this._adapter._editable && t.x >= this._cache.bodyRight && t.x < this._cache.quantityRight ? new u(u.CUSTOM, { mouseDownHandler: this._adapter.callOnModify.bind(this._adapter), tooltip: { text: $.t("Edit Order"), rect: { x: this._cache.bodyRight, y: this._cache.top, w: this._cache.quantityRight - this._cache.bodyRight, h: this._cache.bottom - this._cache.top } } }) : this._adapter._editable && t.x >= this._cache.quantityRight && t.x < this._cache.right ? new u(u.CUSTOM, { mouseDownHandler: this._adapter.callOnCancel.bind(this._adapter), tooltip: { text: $.t("Cancel Order"), rect: { x: this._cache.quantityRight, y: this._cache.top, w: this._cache.right - this._cache.quantityRight, h: this._cache.bottom - this._cache.top } } }) : null }, inherit(s, h), s.prototype._updateImpl = function() { h.prototype._updateImpl.call(this), this._background = this._linetool.properties().lineColor.value() }, inherit(r, p), r.prototype.renderer = function() { return new n({ points: this._points, width: this._model.timeScale().width() }, this._rendererCache, this._source._adapter) }, inherit(a, l), a.skipMagnetting = !0, a.prototype.setPoint = function(t, e, i) { this._points[t] = e, this.normalizePoints() }, a.prototype.addPoint = function(t, e) { return this._points.push(t), this._lastPoint = null, this.normalizePoints(), this.createServerPoints(), !0 }, a.prototype.title = function() { return "Order" }, a.prototype.endMoving = function(t) {
                var e = this._startMovingPoint && this._currentMovingPoint && this._startMovingPoint.price !== this._currentMovingPoint.price;
                l.prototype.endMoving.call(this), !t && e && this._adapter.callOnMove()
            }, a.prototype.createPriceAxisView = function(t) { return this._priceAxisView = new s(this, t), this._priceAxisView }, a.prototype.paneViews = function(t) { return TradingView.printing && !e.enabled("snapshot_trading_drawings") ? null : this._model.properties().tradingProperties.showOrders.value() ? d.prototype.paneViews.call(this, t) : null }, a.prototype.priceAxisViews = function(t, i) { return TradingView.printing && !e.enabled("snapshot_trading_drawings") ? null : this._model.properties().tradingProperties.showOrders.value() ? d.prototype.priceAxisViews.call(this, t, i) : null }, a.prototype.hasContextMenu = function() { return !0 }, a.prototype.contextMenuItems = function() { return this._adapter.callOnContextMenu() }, a.prototype.onlyYMoving = function() { return !0 }, t.exports = a
    }).call(e, i(3))
}, 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(9),
        r = i(1).LineDataSource,
        a = i(23),
        l = i(52).ChannelRenderer,
        h = i(11).TrendLineRenderer,
        c = i(8),
        d = i(6);
    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, 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, e) { r.call(this, t, e), this._invalidated = !0 }

    function n(t, e) {
        this._constructor = "LineToolPolyline";
        var i;
        e ? i = e : (i = new c("linetoolpolyline"), i.filled.setValue(!1)), a.call(this, t, new o(this, t), i), i.addExclusion("filled")
    }
    var s = i(2),
        r = i(9),
        a = i(1).LineDataSource,
        l = i(92),
        h = i(6),
        c = i(7).DefaultProperty;
    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; return this._invalidated && this.updateImpl(), t = {}, t.points = this._points, t.color = this._source.properties().linecolor.value(), t.linewidth = this._source.properties().linewidth.value(), t.linestyle = this._source.properties().linestyle.value(), t.filled = this._source.properties().filled.value(), t.backcolor = this._source.properties().backgroundColor.value(), t.fillBackground = this._source.properties().fillBackground.value(), t.transparency = this._source.properties().transparency.value(), this.isAnchorsRequired() ? (e = new h, e.append(new l(t)), this.addAnchors(e), e) : new l(t) }, inherit(n, a), n.prototype.pointsCount = function() { return -1 }, n.prototype.title = function() { return "Polyline" }, n.prototype.addPoint = function(t) {
        var e, i, o, n, r, l, h, c, d, p, u = this._model.timeScale().indexToCoordinate(t.index),
            _ = t.price,
            f = null;
        if (this.priceScale().isPercent() && (f = this.ownerSource().firstValue()), e = this.priceScale().priceToCoordinate(_), i = 5, this._points.length > 0) {
            if (o = this._points[this._points.length - 1], n = this._model.timeScale().indexToCoordinate(o.index), r = o.price, this.priceScale().isPercent() && (r = this.priceScale().priceRange().convertToPercent(r, f)), l = this.priceScale().priceToCoordinate(r), new s.Point(u, e).substract(new s.Point(n, l)).length() < i) return this._lastPoint = null, this.normalizePoints(), this.createServerPoints(), !0;
            if (h = this._points[0], c = this._model.timeScale().indexToCoordinate(h.index), d = h.price, this.priceScale().isPercent() && (d = this.priceScale().priceRange().convertToPercent(d, f)), p = this.priceScale().priceToCoordinate(d), new s.Point(u, e).substract(new s.Point(c, p)).length() < i) return this._properties.filled.setValue(!0), this._lastPoint = null, this.normalizePoints(), this.createServerPoints(), !0
        }
        return a.prototype.addPoint.call(this, t)
    }, n.prototype.setPoint = function(t, e) {
        var i, o, n, r, l, h;
        a.prototype.setPoint.call(this, t, e), this._model.timeScale().isEmpty() || this.priceScale().isEmpty() || t !== this._points.length - 1 && 0 !== t || (i = 5, o = this._model.timeScale().indexToCoordinate(e.index), n = this.priceScale().priceToCoordinate(e.price), r = t === this._points.length - 1 ? this._points[0] : this._points[this._points.length - 1], l = this._model.timeScale().indexToCoordinate(r.index), h = this.priceScale().priceToCoordinate(r.price), new s.Point(o, n).substract(new s.Point(l, h)).length() < i && this._properties.filled.setValue(!0))
    }, t.exports = n
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t) { this._line = t, this._data = { bodyText: "position", quantityText: "0" } }

        function n(t, e) { c.call(this, t, e) }

        function s(t, e) { h.call(this, t, e), this._rendererCache = {} }

        function r(t, e) {
            this._adapter = new o(this), this._constructor = "LineToolPosition";
            var i = e || new u("linetoolposition");
            a.call(this, t, new s(this, t), i)
        }
        var a = i(152),
            l = i(1).LineDataSource,
            h = i(9),
            c = i(1).LineToolPriceAxisView,
            d = i(197),
            p = i(8),
            u = i(7).DefaultProperty,
            _ = i(371).splitThousands;
        o.prototype.getPrice = function() { return this._line.points()[0].price }, o.prototype.setPrice = function(t) { var e = this._line.points()[0]; return e.price = t, this._line._points[0] = e, this._line.normalizePoints(), this._line.updateAllViewsAndRedraw(), this }, o.prototype.getText = function() { return this._data.bodyText }, o.prototype.setText = function(t) { return this._data.bodyText = t || "", this._line.updateAllViewsAndRedraw(), this }, o.prototype.setTooltip = function(t) { return null == t ? t = "" : t += "", this._line.properties().tooltip.setValue(t), this }, o.prototype.getTooltip = function() { return this._line.properties().tooltip.value() }, o.prototype.getQuantity = function() { return this._data.quantityText }, o.prototype.setQuantity = function(t) { return this._data.quantityText = t || "", this._line.updateAllViewsAndRedraw(), this }, o.prototype.getExtendLeft = function() { var t = this._line.properties().extendLeft.value(); return "inherit" === t ? this._line._model.properties().tradingProperties.extendLeft.value() : t }, o.prototype.setExtendLeft = function(t) { return this._line.properties().extendLeft.setValue(t), this }, o.prototype.getLineLength = function() {
                var t = this._line.properties().lineLength.value();
                return "inherit" === t ? this._line._model.properties().tradingProperties.lineLength.value() : t
            }, o.prototype.setLineLength = function(t) { return this._line.properties().lineLength.setValue(Math.max(0, Math.min(t, 100))), this }, o.prototype.getLineColor = function() { return d.getColorFromProperties(this._line.properties().lineColor, this._line.properties().lineTransparency) }, o.prototype.setLineColor = function(t) { return d.setColorToProperties(t, this._line.properties().lineColor, this._line.properties().lineTransparency), this }, o.prototype.getLineStyle = function() { var t = this._line.properties().lineStyle.value(); return "inherit" === t ? this._line._model.properties().tradingProperties.lineStyle.value() : t }, o.prototype.setLineStyle = function(t) { return this._line.properties().lineStyle.setValue(t), this }, o.prototype.getLineWidth = function() { var t = this._line.properties().lineWidth.value(); return "inherit" === t ? this._line._model.properties().tradingProperties.lineWidth.value() : t }, o.prototype.setLineWidth = function(t) { return this._line.properties().lineWidth.setValue(t), this }, o.prototype.getBodyBorderColor = function() { return d.getColorFromProperties(this._line.properties().bodyBorderColor, this._line.properties().bodyBorderTransparency) }, o.prototype.setBodyBorderColor = function(t) { return d.setColorToProperties(t, this._line.properties().bodyBorderColor, this._line.properties().bodyBorderTransparency), this }, o.prototype.getBodyBackgroundColor = function() { return d.getColorFromProperties(this._line.properties().bodyBackgroundColor, this._line.properties().bodyBackgroundTransparency) }, o.prototype.setBodyBackgroundColor = function(t) { return d.setColorToProperties(t, this._line.properties().bodyBackgroundColor, this._line.properties().bodyBackgroundTransparency), this }, o.prototype.getBodyTextColor = function() { return d.getColorFromProperties(this._line.properties().bodyTextColor, this._line.properties().bodyTextTransparency) }, o.prototype.setBodyTextColor = function(t) { return d.setColorToProperties(t, this._line.properties().bodyTextColor, this._line.properties().bodyTextTransparency), this }, o.prototype.getBodyFont = function() { return d.getFontFromProperties(this._line.properties().bodyFontFamily, this._line.properties().bodyFontSize, this._line.properties().bodyFontBold, this._line.properties().bodyFontItalic) }, o.prototype.setBodyFont = function(t) { return d.setFontToProperties(t, this._line.properties().bodyFontFamily, this._line.properties().bodyFontSize, this._line.properties().bodyFontBold, this._line.properties().bodyFontItalic), this }, o.prototype.getQuantityBorderColor = function() { return d.getColorFromProperties(this._line.properties().quantityBorderColor, this._line.properties().quantityBorderTransparency) }, o.prototype.setQuantityBorderColor = function(t) { return d.setColorToProperties(t, this._line.properties().quantityBorderColor, this._line.properties().quantityBorderTransparency), this }, o.prototype.getQuantityBackgroundColor = function() { return d.getColorFromProperties(this._line.properties().quantityBackgroundColor, this._line.properties().quantityBackgroundTransparency) },
            o.prototype.setQuantityBackgroundColor = function(t) { return d.setColorToProperties(t, this._line.properties().quantityBackgroundColor, this._line.properties().quantityBackgroundTransparency), this }, o.prototype.getQuantityTextColor = function() { return d.getColorFromProperties(this._line.properties().quantityTextColor, this._line.properties().quantityTextTransparency) }, o.prototype.setQuantityTextColor = function(t) { return d.setColorToProperties(t, this._line.properties().quantityTextColor, this._line.properties().quantityTextTransparency), this }, o.prototype.getQuantityFont = function() { return d.getFontFromProperties(this._line.properties().quantityFontFamily, this._line.properties().quantityFontSize, this._line.properties().quantityFontBold, this._line.properties().quantityFontItalic) }, o.prototype.setQuantityFont = function(t) { return d.setFontToProperties(t, this._line.properties().quantityFontFamily, this._line.properties().quantityFontSize, this._line.properties().quantityFontBold, this._line.properties().quantityFontItalic), this }, o.prototype.getReverseButtonBorderColor = function() { return d.getColorFromProperties(this._line.properties().reverseButtonBorderColor, this._line.properties().reverseButtonBorderTransparency) }, o.prototype.setReverseButtonBorderColor = function(t) { return d.setColorToProperties(t, this._line.properties().reverseButtonBorderColor, this._line.properties().reverseButtonBorderTransparency), this }, o.prototype.getReverseButtonBackgroundColor = function() { return d.getColorFromProperties(this._line.properties().reverseButtonBackgroundColor, this._line.properties().reverseButtonBackgroundTransparency) }, o.prototype.setReverseButtonBackgroundColor = function(t) { return d.setColorToProperties(t, this._line.properties().reverseButtonBackgroundColor, this._line.properties().reverseButtonBackgroundTransparency), this }, o.prototype.getReverseButtonIconColor = function() { return d.getColorFromProperties(this._line.properties().reverseButtonIconColor, this._line.properties().reverseButtonIconTransparency) }, o.prototype.setReverseButtonIconColor = function(t) { return d.setColorToProperties(t, this._line.properties().reverseButtonIconColor, this._line.properties().reverseButtonIconTransparency), this }, o.prototype.getCloseButtonBorderColor = function() { return d.getColorFromProperties(this._line.properties().closeButtonBorderColor, this._line.properties().closeButtonBorderTransparency) }, o.prototype.setCloseButtonBorderColor = function(t) { return d.setColorToProperties(t, this._line.properties().closeButtonBorderColor, this._line.properties().closeButtonBorderTransparency), this }, o.prototype.getCloseButtonBackgroundColor = function() { return d.getColorFromProperties(this._line.properties().closeButtonBackgroundColor, this._line.properties().closeButtonBackgroundTransparency) }, o.prototype.setCloseButtonBackgroundColor = function(t) { return d.setColorToProperties(t, this._line.properties().closeButtonBackgroundColor, this._line.properties().closeButtonBackgroundTransparency), this }, o.prototype.getCloseButtonIconColor = function() {
                return d.getColorFromProperties(this._line.properties().closeButtonIconColor, this._line.properties().closeButtonIconTransparency)
            }, o.prototype.setCloseButtonIconColor = function(t) { return d.setColorToProperties(t, this._line.properties().closeButtonIconColor, this._line.properties().closeButtonIconTransparency), this }, o.prototype.block = function() { this._blocked = !0, this._line.updateAllViewsAndRedraw() }, o.prototype.unblock = function() { this._blocked = !1, this._line.updateAllViewsAndRedraw() }, o.prototype.isFunction = function(t) { return "function" == typeof t }, o.prototype.onReverse = function(t, e) { return e ? this.isFunction(e) && (this._onReverseData = t, this._onReverseCallback = e) : this.isFunction(t) && (this._onReverseCallback = t), this }, o.prototype.callOnReverse = function() { this.isFunction(this._onReverseCallback) && this._onReverseCallback.call(this, this._onReverseData) }, o.prototype.isOnReverseCallbackPresent = function() { return this.isFunction(this._onReverseCallback) }, o.prototype.onClose = function(t, e) { return e ? this.isFunction(e) && (this._onCloseData = t, this._onCloseCallback = e) : this.isFunction(t) && (this._onCloseCallback = t), this }, o.prototype.callOnClose = function() { this.isFunction(this._onCloseCallback) && this._onCloseCallback.call(this, this._onCloseData) }, o.prototype.isOnCloseCallbackPresent = function() { return this.isFunction(this._onCloseCallback) }, o.prototype.onModify = function(t, e) { return e ? this.isFunction(e) && (this._onModifyData = t, this._onModifyCallback = e) : this.isFunction(t) && (this._onModifyCallback = t), this }, o.prototype.callOnModify = function() { this.isFunction(this._onModifyCallback) && this._onModifyCallback.call(this, this._onModifyData) }, o.prototype.onContextMenu = function(t, e) { return e ? this.isFunction(e) && (this._onContextMenuData = t, this._onContextMenuCallback = e) : this.isFunction(t) && (this._onContextMenuCallback = t), this }, o.prototype.callOnContextMenu = function() { if (this.isFunction(this._onContextMenuCallback)) return this._onContextMenuCallback.call(this, this._onContextMenuData) }, o.prototype.remove = function() { this._line._model.removeSource(this._line), delete this._line }, TradingView.PositionRenderer = function(t, e, i) { this._data = t, this._cache = e, this._adapter = i }, TradingView.PositionRenderer.prototype._height = function() { return Math.max(20, 1 + Math.max(d.fontHeight(this._adapter.getBodyFont()), d.fontHeight(this._adapter.getQuantityFont()))) }, TradingView.PositionRenderer.prototype._bodyWidth = function(t) { var e, i; return 0 === this._adapter.getText().length ? 0 : (t.save(), t.font = this._adapter.getBodyFont(), e = 10, i = t.measureText(this._adapter.getText()).width, t.restore(), Math.round(e + i)) }, TradingView.PositionRenderer.prototype._getQuantity = function() { return _(this._adapter.getQuantity(), " ") }, TradingView.PositionRenderer.prototype._quantityWidth = function(t) { var e, i; return 0 === this._getQuantity().length ? 0 : (t.save(), t.font = this._adapter.getQuantityFont(), e = 10, i = t.measureText(this._getQuantity()).width, t.restore(), Math.round(Math.max(this._height(), e + i))) }, TradingView.PositionRenderer.prototype._reverseButtonWidth = function() {
                return this._adapter.isOnReverseCallbackPresent() ? this._height() : 0
            }, TradingView.PositionRenderer.prototype._closeButtonWidth = function() { return this._adapter.isOnCloseCallbackPresent() ? this._height() : 0 }, TradingView.PositionRenderer.prototype._drawLines = function(t, e, i, o, n) { t.save(), t.strokeStyle = this._adapter.getLineColor(), t.lineStyle = this._adapter.getLineStyle(), t.lineWidth = this._adapter.getLineWidth(), CanvasEx.drawLine(t, i, o, n, o), this._adapter.getExtendLeft() && CanvasEx.drawLine(t, 0, o, e, o), t.restore() }, TradingView.PositionRenderer.prototype._drawBody = function(t, e, i) {
                var o, n;
                t.strokeStyle = this._adapter.getBodyBorderColor(), t.fillStyle = this._adapter.getBodyBackgroundColor(), o = this._bodyWidth(t), n = this._height(), t.fillRect(e + .5, i + .5, o - 1, n - 1), t.strokeRect(e, i, o, n)
            }, TradingView.PositionRenderer.prototype._drawBodyText = function(t, e, i) {
                var o, n;
                t.save(), t.textAlign = "center", t.textBaseline = "middle", t.font = this._adapter.getBodyFont(), t.fillStyle = this._adapter.getBodyTextColor(), o = e + this._bodyWidth(t) / 2, n = i + this._height() / 2, t.fillText(this._adapter.getText(), o, n), t.restore()
            }, TradingView.PositionRenderer.prototype._drawQuantity = function(t, e, i) {
                var o, n;
                t.strokeStyle = this._adapter.getQuantityBorderColor(), t.fillStyle = this._adapter.getQuantityBackgroundColor(), o = this._quantityWidth(t), n = this._height(), t.fillRect(e + .5, i + .5, o - 1, n - 1), t.strokeRect(e, i, o, n)
            }, TradingView.PositionRenderer.prototype._drawQuantityText = function(t, e, i) {
                var o, n;
                t.save(), t.textAlign = "center", t.textBaseline = "middle", t.font = this._adapter.getQuantityFont(), t.fillStyle = this._adapter.getQuantityTextColor(), o = e + this._quantityWidth(t) / 2, n = i + this._height() / 2, t.fillText(this._getQuantity(), o, n), t.restore()
            }, TradingView.PositionRenderer.prototype._drawReverseButton = function(t, e, i) {
                var o, n, s, r, a, l, h;
                t.save(), t.strokeStyle = this._adapter.getReverseButtonBorderColor(), t.fillStyle = this._adapter.getReverseButtonBackgroundColor(), o = this._reverseButtonWidth(), n = this._height(), t.fillRect(e + .5, i + .5, o - 1, n - 1), t.strokeRect(e, i, o, n), t.strokeStyle = this._adapter.getReverseButtonIconColor(), s = function(t, e) { CanvasEx.drawLine(t, 0, 0, 0, e), CanvasEx.drawLine(t, -1, 1, 1, 1), CanvasEx.drawLine(t, -2, 2, 2, 2) }, r = 6, a = 10, l = e + Math.round((this._reverseButtonWidth() - r) / 2), h = i + 5, t.save(), t.translate(l, h), s(t, a), t.translate(r, a), t.rotate(Math.PI), s(t, a), t.restore(), this._adapter._blocked && (t.fillStyle = "rgba(140, 140, 140, 0.75)", t.fillRect(e + .5, i + .5, o - 1, n - 1)), t.restore()
            }, TradingView.PositionRenderer.prototype._drawCloseButton = function(t, e, i) {
                var o, n, s, r, a, l, h;
                t.save(), t.strokeStyle = this._adapter.getCloseButtonBorderColor(), t.fillStyle = this._adapter.getCloseButtonBackgroundColor(), o = this._closeButtonWidth(), n = this._height(), t.fillRect(e + .5, i + .5, o - 1, n - 1), t.strokeRect(e, i, o, n), s = e + o, r = i + n, t.strokeStyle = this._adapter.getCloseButtonIconColor(), a = 8, l = (this._closeButtonWidth() - a) / 2, h = (this._height() - a) / 2, CanvasEx.drawPoly(t, [{ x: e + l, y: i + h }, { x: s - l, y: r - h }], !0), CanvasEx.drawPoly(t, [{ x: s - l, y: i + h }, { x: e + l, y: r - h }], !0), this._adapter._blocked && (t.fillStyle = "rgba(140, 140, 140, 0.75)", t.fillRect(e + .5, i + .5, o - 1, n - 1)),
                    t.restore()
            }, TradingView.PositionRenderer.prototype.draw = function(t) { var e, i, o, n, s, r, a, l, h, c, d;!this._data.points || this._data.points.length < 1 || (e = this._data.width, i = this._bodyWidth(t), o = this._quantityWidth(t), n = this._reverseButtonWidth(t), s = i + o + n + this._closeButtonWidth(), r = e - s, a = Math.max(this._adapter.getLineLength() / 100 * e, 1), l = Math.round(e - Math.min(r, a)), h = l - s, c = Math.round(this._data.points[0].y), d = Math.round(c - (this._height() + 1) / 2), this._cache.bodyRight = h + i, this._cache.quantityRight = this._cache.bodyRight + o, this._cache.reverseButtonRight = this._cache.quantityRight + n, this._cache.top = d, this._cache.bottom = d + this._height(), this._cache.left = h, this._cache.right = l, this._drawLines(t, h, l, c, e), 0 !== i && (this._drawBody(t, h, d), this._drawBodyText(t, h, d)), 0 !== o && (this._drawQuantity(t, this._cache.bodyRight, d), this._drawQuantityText(t, this._cache.bodyRight, d)), 0 !== n && this._drawReverseButton(t, this._cache.quantityRight, d), 0 !== this._closeButtonWidth() && this._drawCloseButton(t, this._cache.reverseButtonRight, d)) }, TradingView.PositionRenderer.prototype.hitTest = function(t) { return 0 === this._data.points.length ? null : t.y < this._cache.top || t.y > this._cache.bottom || t.x < this._cache.left || this._cache.right < t.x ? null : this._adapter._blocked ? new p(p.CUSTOM, {}) : t.x >= this._cache.bodyRight && t.x < this._cache.quantityRight && this._adapter._onModifyCallback ? new p(p.CUSTOM, { mouseDownHandler: this._adapter.callOnModify.bind(this._adapter), tooltip: { text: $.t("Edit Position"), rect: { x: this._cache.bodyRight, y: this._cache.top, w: this._cache.quantityRight - this._cache.bodyRight, h: this._cache.bottom - this._cache.top } } }) : t.x >= this._cache.quantityRight && t.x < this._cache.reverseButtonRight ? new p(p.CUSTOM, { mouseDownHandler: this._adapter.callOnReverse.bind(this._adapter), tooltip: { text: $.t("Reverse Position"), rect: { x: this._cache.quantityRight, y: this._cache.top, w: this._cache.reverseButtonRight - this._cache.quantityRight, h: this._cache.bottom - this._cache.top } } }) : t.x >= this._cache.reverseButtonRight && t.x < this._cache.right ? new p(p.CUSTOM, { mouseDownHandler: this._adapter.callOnClose.bind(this._adapter), tooltip: { text: $.t("Close Position"), rect: { x: this._cache.reverseButtonRight, y: this._cache.top, w: this._cache.right - this._cache.reverseButtonRight, h: this._cache.bottom - this._cache.top } } }) : new p(p.REGULAR, { mouseDownHandler: function() {} }) }, inherit(n, c), n.prototype._updateImpl = function() { c.prototype._updateImpl.call(this), this._background = this._linetool.properties().lineColor.value() }, inherit(s, h), s.prototype.renderer = function() { var t = { points: this._points, width: this._model.timeScale().width() }; return new TradingView.PositionRenderer(t, this._rendererCache, this._source._adapter) }, inherit(r, a), r.prototype.setPoint = function(t, e, i) { this._points[t] = e, this.normalizePoints() }, r.prototype.addPoint = function(t, e) { return this._points.push(t), this._lastPoint = null, this.normalizePoints(), this.createServerPoints(), !0 }, r.skipMagnetting = !0, r.prototype.title = function() { return "Position" }, r.prototype.createPriceAxisView = function(t) { return this._priceAxisView = new n(this, t), this._priceAxisView },
            r.prototype.paneViews = function(t) { return TradingView.printing && !e.enabled("snapshot_trading_drawings") ? null : this._model.properties().tradingProperties.showPositions.value() ? l.prototype.paneViews.call(this, t) : null }, r.prototype.priceAxisViews = function(t, i) { return TradingView.printing && !e.enabled("snapshot_trading_drawings") ? null : this._model.properties().tradingProperties.showPositions.value() ? l.prototype.priceAxisViews.call(this, t, i) : null }, r.prototype.hasContextMenu = function() { return !0 }, r.prototype.contextMenuItems = function() { return this._adapter.callOnContextMenu() }, t.exports = r
    }).call(e, i(3))
}, function(t, e, i) {
    "use strict";

    function o(t) { this._data = t, this._targetFontSize1 = 11, this._targetFontSize2 = 11, this._targetFontSize3 = 14, this._font = "Arial", this._sourceFontSize1 = 12, this._sourceFontSize2 = 10 }

    function n(t, e) { h.call(this, t, e), this._clockWhite = _("prediction-clock-white", TradingView.wrapUrl("images/prediction-clock-white.png")), this._clockBlack = _("prediction-clock-black", TradingView.wrapUrl("images/prediction-clock-black.png")), this._successIcon = _("prediction-success-white", TradingView.wrapUrl("images/prediction-success-white.png")), this._failureIcon = _("prediction-failure-white", TradingView.wrapUrl("images/prediction-failure-white.png")), this._percentageFormatter = new g, this._invalidated = !0 }

    function s(t, e) {
        this._constructor = "LineToolPrediction";
        var i = e || new m("linetoolprediction");
        i.merge({ status: s.ALERT_STATUS_WAITING }), c.call(this, t, new n(this, t), i)
    }
    var r = i(37),
        a = r.parseRgb,
        l = r.rgbToBlackWhiteString,
        h = i(9),
        c = i(1).LineDataSource,
        d = i(36).Interval,
        p = i(8),
        u = i(6),
        _ = i(283),
        f = i(2),
        m = i(7).DefaultProperty,
        g = i(70).PercentageFormatter,
        v = i(162).DateFormatter,
        y = i(122).TimeFormatter,
        b = i(123).TimeSpanFormatter,
        w = i(14);
    o.prototype.drawBalloon = function(t, e, i, o, n, s) {
            var r, a, l = 6,
                h = 5,
                c = 5,
                d = s || 20,
                p = 3;
            return t.beginPath(), "down" === n ? (r = new f.Point(e.x - d, e.y - l - c - o), t.moveTo(r.x + p, r.y), t.lineTo(r.x + i - p, r.y), t.arcTo(r.x + i, r.y, r.x + i, r.y + p, p), t.lineTo(r.x + i, r.y + o - p), t.arcTo(r.x + i, r.y + o, r.x + i - p, r.y + o, p), t.lineTo(r.x + d + h, r.y + o), t.lineTo(r.x + d, r.y + o + c), t.lineTo(r.x + d - h, r.y + o), t.lineTo(r.x + p, r.y + o), t.arcTo(r.x, r.y + o, r.x, r.y + o - p, p), t.lineTo(r.x, r.y + p), t.arcTo(r.x, r.y, r.x + p, r.y, p), r) : (a = new f.Point(e.x - d, e.y + l + c + o), t.moveTo(a.x + p, a.y), t.lineTo(a.x + i - p, a.y), t.arcTo(a.x + i, a.y, a.x + i, a.y - p, p), t.lineTo(a.x + i, a.y - o + p), t.arcTo(a.x + i, a.y - o, a.x + i - p, a.y - o, p), t.lineTo(a.x + d + h, a.y - o), t.lineTo(a.x + d, a.y - o - c), t.lineTo(a.x + d - h, a.y - o), t.lineTo(a.x + p, a.y - o), t.arcTo(a.x, a.y - o, a.x, a.y - o + p, p), t.lineTo(a.x, a.y - p), t.arcTo(a.x, a.y, a.x + p, a.y, p), new f.Point(a.x, a.y - o))
        }, o.prototype.drawTargetLabel = function(t) {
            var e, i, o, n, r, a, l, h, c, d, p, u, _, f, m, g, v, y, b, S, T, C, x = this._data.points[1];
            if (t.save(), t.translate(.5, .5), t.font = "normal " + this._targetFontSize3 + "px " + this._font, e = 1.5 * this._targetFontSize1 + 1.5 * this._targetFontSize2 + 3, i = t.measureText(this._data.targetLine1).width, o = t.measureText(this._data.targetLine2).width, t.font = "normal " + this._targetFontSize2 + "px " + this._font, n = t.measureText(this._data.targetLine3).width,
                r = t.measureText(this._data.targetLine4).width, a = Math.max(i + o, n + r + 10) + 20, l = "up" === this._data.direction ? "down" : "up", h = x.x + a - t.canvas.width + 5, h = Math.max(20, Math.min(a - 15, h)), c = this.drawBalloon(t, x, a, e, l, h), t.save(), t.fillStyle = w.generateColor(this._data.targetBackColor, this._data.transparency), t.fill(), t.restore(), t.save(), t.lineWidth = 2, t.strokeStyle = w.generateColor(this._data.targetStrokeColor, this._data.transparency), t.stroke(), t.restore(), d = 3, t.beginPath(), t.arc(x.x, x.y, d, 0, 2 * Math.PI, !1), t.fillStyle = this._data.centersColor, t.fill(), t.textAlign = "left", p = 6, u = 4, t.fillStyle = this._data.targetTextColor, t.font = "normal " + this._targetFontSize3 + "px " + this._font, t.fillText(this._data.targetLine1, c.x + p, c.y + this._targetFontSize1 + u), _ = 13, f = 5, t.fillText(this._data.targetLine2, c.x + p + i + f, c.y + this._targetFontSize1 + u), t.font = "normal " + this._targetFontSize2 + "px " + this._font, m = c.y + this._targetFontSize1 + 2 * u + this._targetFontSize2, t.fillText(this._data.targetLine3, c.x + p, m), t.drawImage(this._data.clockWhite, c.x + p + n + 6, m - this._targetFontSize2 + 3), t.fillText(this._data.targetLine4, c.x + p + n + _ + 5, m), !this._data.status) return void t.restore();
            switch (g = this._targetFontSize1 + 4, t.font = "bold " + this._targetFontSize1 + "px " + this._font, this._data.status) {
                case s.ALERT_STATUS_SUCCESS:
                    v = $.t("SUCCESS"), y = w.generateColor(this._data.successBackground, this._data.transparency), b = this._data.successTextColor, S = this._data.successIcon;
                    break;
                case s.ALERT_STATUS_FAILURE:
                    v = $.t("FAILURE"), y = w.generateColor(this._data.failureBackground, this._data.transparency), b = this._data.failureTextColor, S = this._data.failureIcon
            }
            T = t.measureText(v).width, C = Math.round((a - T) / 2), t.fillStyle = y, "up" === this._data.direction ? (t.roundRect(c.x - 1, c.y - g - 2, a + 2, g, 5), t.fill(), t.fillStyle = b, t.fillText(v, c.x + C, c.y - 5), t.drawImage(S, c.x + C - 13, c.y - 14)) : (t.roundRect(c.x - 1, c.y + e + 3, a + 2, g, 5), t.fill(), t.fillStyle = b, t.fillText(v, c.x + C, c.y + e + g - 1), t.drawImage(S, c.x + C - 13, c.y + e + 5)), t.restore()
        }, o.prototype.drawStartLabel = function(t) {
            var e, i, o, n, s, r, a, l, h;
            t.save(), t.translate(.5, .5), t.font = "normal " + this._sourceFontSize1 + "px " + this._font, e = 1.5 * this._sourceFontSize1 + 1.5 * this._sourceFontSize2, i = t.measureText(this._data.sourceLine1).width, t.font = "normal " + this._fontsize2 + "px " + this._font, o = t.measureText(this._data.sourceLine2).width, n = Math.max(i, o) - 5, s = this._data.points[0], r = this.drawBalloon(t, s, n, e, this._data.direction), t.fillStyle = w.generateColor(this._data.sourceBackColor, this._data.transparency), t.fill(), t.lineWidth = 2, t.strokeStyle = w.generateColor(this._data.sourceStrokeColor, this._data.transparency), t.stroke(), a = 3, t.beginPath(), t.arc(s.x, s.y, a, 0, 2 * Math.PI, !1), t.fillStyle = this._data.centersColor, t.fill(), t.textAlign = "left", l = 3, h = 2, t.fillStyle = this._data.sourceTextColor, t.font = "normal " + this._sourceFontSize1 + "px " + this._font, t.fillText(this._data.sourceLine1, r.x + l, r.y + this._sourceFontSize1 + h), t.font = "normal " + this._sourceFontSize2 + "px " + this._font, t.fillText(this._data.sourceLine2, r.x + l, r.y + this._sourceFontSize1 + 2 * h + this._sourceFontSize2), t.restore()
        }, o.prototype.draw = function(t) {
            var e, i, o, n, s, r, a, l, h, c, d, p, u, _;
            if (!(this._data.points.length < 2)) {
                if (t.lineCap = "butt", t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, t.lineStyle = this._data.linestyle, e = this._data.points[0], i = this._data.points[1], o = i.substract(e), Math.abs(o.x) < 1 || Math.abs(o.y) < 1 ? (t.beginPath(), t.moveTo(e.x, e.y), t.lineTo(i.x, i.y), t.stroke()) : (t.save(), t.beginPath(), t.translate(e.x, e.y), t.scale(1, o.y / o.x), t.moveTo(0, 0), t.arcTo(o.x, 0, o.x, o.x, Math.abs(o.x)), t.lineTo(o.x, o.x), t.restore(), t.stroke()), this.drawTargetLabel(t), this.drawStartLabel(t), n = Math.max(8, 4 * this._data.linewidth), t.fillStyle = this._data.color, s = o.y < 0 ? 1 : -1, Math.abs(o.x) < 1 || Math.abs(o.y) < 1) r = Math.atan(o.x / o.y);
                else {
                    if (a = Math.abs(o.x), l = Math.abs(o.y), h = 0, c = Math.PI / 2, d = (h + c) / 2, o.length() > n)
                        for (;;) {
                            if (p = a * Math.sin(d), u = l * (1 - Math.cos(d)), _ = Math.sqrt((p - a) * (p - a) + (u - l) * (u - l)), Math.abs(_ - n) < 1) break;
                            _ > n ? h = d : c = d, d = (h + c) / 2
                        }
                    r = Math.atan((a - p) / (l - u)), o.x * o.y < 0 && (r = -r)
                }
                t.save(), t.beginPath(), t.translate(i.x, i.y), t.rotate(-r), t.moveTo(0, 0), t.lineTo(-n / 2, s * n), t.lineTo(n / 2, s * n), t.lineTo(0, 0), t.restore(), t.fill()
            }
        }, o.prototype.targetLabelHitTest = function(t) {
            var e, i, o, n, s, r, a, l, h, c = this._data.points[1],
                d = 1.5 * this._targetFontSize1 + 1.5 * this._targetFontSize2,
                u = this._targetFontSize1 * this._data.targetLine1.length,
                _ = this._targetFontSize1 * this._data.targetLine2.length,
                f = this._targetFontSize2 * this._data.targetLine3.length,
                m = this._targetFontSize2 * this._data.targetLine4.length;
            return this._data.status && (d += 1.5 * this._targetFontSize1), e = Math.max(u + _, f + m) - 20, i = 20, o = 5, n = "up" === this._data.direction ? -1 : 1, s = c.x - i, r = c.y + o * n, a = c.y + (o + d) * n, l = Math.min(r, a), h = Math.max(r, a), t.x >= s && t.x <= s + e && t.y >= l && t.y <= h ? new p(p.MOVEPOINT) : null
        }, o.prototype.sourceLabelHitTest = function(t) {
            var e = 1.5 * this._sourceFontSize1 + 1.5 * this._sourceFontSize2,
                i = this._sourceFontSize1 * this._data.sourceLine1.length,
                o = this._sourceFontSize2 * this._data.sourceLine2.length,
                n = Math.max(i, o),
                s = this._data.points[0],
                r = 20,
                a = 5,
                l = "up" === this._data.direction ? 1 : -1,
                h = s.x - r,
                c = s.y + a * l,
                d = s.y + (a + e) * l,
                u = Math.min(c, d),
                _ = Math.max(c, d);
            return t.x >= h && t.x <= h + n && t.y >= u && t.y <= _ ? new p(p.MOVEPOINT) : null
        }, o.prototype.hitTest = function(t) { var e, i, o, n, s, r, a, l; return this._data.points.length < 2 ? null : (e = this._data.points[0], i = this._data.points[1], o = i.substract(e), o = i.substract(e), n = t.substract(e), s = Math.abs(o.x), r = Math.abs(o.y), a = f.sign(o.y) * (r - r * Math.sqrt(1 - n.x * n.x / (s * s))), l = 3, Math.abs(a - n.y) < l ? new p(p.MOVEPOINT) : this.targetLabelHitTest(t) || this.sourceLabelHitTest(t)) }, inherit(n, h), n.prototype.renderer = function() {
            var t, e;
            return this._invalidated && (this.updateImpl(), this._invalidated = !1), t = {}, t.points = this._points, t.color = this._source.properties().linecolor.value(), t.linewidth = this._source.properties().linewidth.value(), t.targetLine1 = this._targetLine1, t.targetLine2 = this._targetLine2, t.targetLine3 = this._targetLine3, t.targetLine4 = this._targetLine4, t.status = this._source.properties().status.value(), t.transparency = this._source.properties().transparency.value(), t.targetBackColor = this._source.properties().targetBackColor.value(), t.targetStrokeColor = this._source.properties().targetStrokeColor.value(),
                t.targetTextColor = this._source.properties().targetTextColor.value(), t.sourceBackColor = this._source.properties().sourceBackColor.value(), t.sourceStrokeColor = this._source.properties().sourceStrokeColor.value(), t.sourceTextColor = this._source.properties().sourceTextColor.value(), t.successBackground = this._source.properties().successBackground.value(), t.successTextColor = this._source.properties().successTextColor.value(), t.failureBackground = this._source.properties().failureBackground.value(), t.failureTextColor = this._source.properties().failureTextColor.value(), t.intermediateBackColor = this._source.properties().intermediateBackColor.value(), t.intermediateTextColor = this._source.properties().intermediateTextColor.value(), t.sourceLine1 = this._sourceLine1, t.sourceLine2 = this._sourceLine2, t.direction = this._direction, t.clockWhite = this._clockWhite, t.clockBlack = this._clockBlack, t.successIcon = this._successIcon, t.failureIcon = this._failureIcon, t.finished = this._finished, t.centersColor = l(a(this._model._properties.paneProperties.background.value())), this.isAnchorsRequired() ? (e = new u, e.append(new o(t)), this.addAnchors(e), e) : new o(t)
        }, n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() {
            var t, e, i, o, n, r, a, l, c, p, u, _;
            h.prototype.update.call(this), this._targetLine1 = "", this._targetLine2 = "", this._targetLine3 = "", this._targetLine4 = "", this._source.points().length < 2 || this._source.priceScale() && (t = this._source.points()[1], e = this._source.points()[0], this._targetLine3 = this._source.priceScale().formatter().format(t.price), i = t.price - e.price, o = i < 0 ? "-" : "+", this._targetLine1 = this._source.priceScale().formatter().format(Math.abs(i)), n = Math.abs(Math.round(i / e.price * 1e4) / 100), this._targetLine1 = o + this._targetLine1 + " (" + o + this._percentageFormatter.format(n) + ")", r = this._model.timeScale().indexToUserTime(e.index), a = this._model.timeScale().indexToUserTime(t.index), l = e.time && t.time, l && (r = TradingView.isString(e.time) ? new Date(Date.parse(e.time)) : e.time, a = TradingView.isString(t.time) ? new Date(Date.parse(t.time)) : t.time), c = this._model.mainSeries().isDWM(), p = d.kind(this._model.mainSeries().interval()) === d.SECONDS, a && r && (this._targetLine4 = (new v).format(a), c || (this._targetLine4 = this._targetLine4 + "  " + new y(p ? "%h:%m:%s" : "%h:%m").format(a)), u = (a.valueOf() - r.valueOf()) / 1e3, this._targetLine2 = $.t("in", { context: "dates" }) + " " + (new b).format(u)), this._sourceLine1 = this._source.priceScale().formatter().format(e.price), this._sourceLine2 = "", _ = this._model.timeScale().indexToUserTime(e.index), _ && (this._sourceLine2 = (new v).format(_), c || (this._sourceLine2 = this._sourceLine2 + " " + new y(p ? "%h:%m:%s" : "%h:%m").format(_))), this._direction = this._source.direction() === s.DIRECTION_UP ? "up" : "down", this._finished = this._model.lineBeingCreated() !== this._source && this._model.lineBeingEdited() !== this._source && this._model.sourceBeingMoved() !== this._source)
        }, s.ALERT_STATUS_WAITING = 0, s.ALERT_STATUS_SUCCESS = 1, s.ALERT_STATUS_FAILURE = 2, s.DIRECTION_UP = 1, s.DIRECTION_DOWN = 2, inherit(s, c), s.prototype.status = function() { return this._properties.status.value() },
        s.prototype.setStatus = function(t) { return this._properties.status.setValue(t) }, s.prototype.pointsCount = function() { return 2 }, s.prototype.title = function() { return "Forecast" }, s.prototype.restorePoints = function(t, e, i) { c.prototype.restorePoints.call(this, t, e, i), this.checkAlert() }, s.prototype.checkAlert = function() {
            var t, e, i, o, n;
            if (!(this._points.length < 2 || this._model.mainSeries().bars().isEmpty())) {
                if (t = this._points[1], this.status()) return void(t.index > this._model.timeScale().points().lastTimePointIndex() && this.setStatus(s.ALERT_STATUS_WAITING));
                e = this._model.timeScale().indexToTimePoint(t.index), e && (i = this._model.mainSeries().bars().valueAt(t.index), o = this.direction(), o === s.DIRECTION_UP && i[TradingView.HIGH_PLOT] >= t.price ? this.setStatus(s.ALERT_STATUS_SUCCESS) : o === s.DIRECTION_DOWN && i[TradingView.LOW_PLOT] <= t.price ? this.setStatus(s.ALERT_STATUS_SUCCESS) : (n = this._model.mainSeries().bars().last().value, i[TradingView.TIME_PLOT] !== n[TradingView.TIME_PLOT] && this.setStatus(s.ALERT_STATUS_FAILURE)))
            }
        }, s.prototype.addPoint = function(t) { var e = c.prototype.addPoint.call(this, t); return e && this.checkAlert(), e }, s.prototype.endChanging = function() { c.prototype.endChanging.call(this), this.setStatus(s.ALERT_STATUS_WAITING), this.checkAlert() }, s.prototype.onData = function(t) { c.prototype.onData.call(this, t), this.checkAlert() }, s.prototype.endMoving = function() { c.prototype.endMoving.call(this), this.setStatus(s.ALERT_STATUS_WAITING), this.checkAlert() }, s.prototype.direction = function() { var t, e; return this.points().length < 2 ? s.DIRECTION_UP : (t = this.points()[0], e = this.points()[1], e.price > t.price ? s.DIRECTION_UP : s.DIRECTION_DOWN) }, t.exports = s
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { this._data = t, this._measureCache = e, this._chartModel = i, this._points = t.points }

    function n(t, e, i) { r.call(this, t, e), this._image = d("price_label", TradingView.wrapUrl("images/price_label.png")), this._rendererCache = {}, this._invalidated = !0 }

    function s(t, e) {
        this._constructor = "LineToolPriceLabel";
        var i = e || new u("linetoolpricelabel");
        a.call(this, t, new n(this, t), i)
    }
    var r = i(9),
        a = i(1).LineDataSource,
        l = i(68).SelectionRenderer,
        h = i(8),
        c = i(6),
        d = i(283),
        p = i(2),
        u = i(7).DefaultProperty,
        _ = i(14);
    o.prototype.draw = function(t) {
        var e, i, o, n, s, r, a, l, h;
        0 !== this._points.length && (t.font = [this._data.fontWeight, this._data.fontSize + "px", this._data.fontFamily].join(" "), e = t.measureText(this._data.label), e.height = this._data.fontSize, i = 3, o = 15, n = -9, s = { left: 10, top: 5 }, r = e.width + 2 * s.left, a = e.height + 2 * s.top, l = this._points[0].x - n, h = this._points[0].y - (a + o), this._measureCache && $.extend(this._measureCache, { innerWidth: r, innerHeight: a, tailLeft: n, tailHeight: o }), t.translate(.5 + l, .5 + h), t.beginPath(), t.moveTo(12, a), t.lineTo(n, a + o), t.lineTo(n - 1, a + o - 1), t.lineTo(5, a), t.lineTo(i, a), t.arcTo(0, a, 0, 0, i), t.lineTo(0, i), t.arcTo(0, 0, r, 0, i), t.lineTo(r - i, 0), t.arcTo(r, 0, r, a, i), t.lineTo(r, a - i), t.arcTo(r, a, 0, a, i), t.lineTo(12, a), t.fillStyle = _.generateColor(this._data.backgroundColor, this._data.transparency), t.fill(), t.strokeStyle = this._data.borderColor, t.lineWidth = 2, t.stroke(), t.closePath(), t.textBaseline = "top", t.fillStyle = this._data.color,
            t.fillText(this._data.label, s.left, s.top - 1), t.translate(-.5, -.5), t.beginPath(), t.arc(n, a + o, 2.5, 0, 2 * Math.PI, !1), t.fillStyle = _.generateColor(this._data.borderColor, this._data.transparency), t.fill(), t.strokeStyle = this._chartModel.backgroundColor(), t.lineWidth = 1, t.stroke(), t.closePath())
    }, o.prototype.hitTest = function(t) { var e, i; return 0 === this._points.length ? null : (e = this._points[0].x - this._measureCache.tailLeft, i = this._points[0].y - (this._measureCache.innerHeight + this._measureCache.tailHeight), p.pointInRect(t, new p.Point(e, i), new p.Point(e + this._measureCache.innerWidth, i + this._measureCache.innerHeight)) ? new h(h.MOVEPOINT) : null) }, inherit(n, r), n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() {
        var t, e, i;
        if (r.prototype.update.call(this), this._source.points().length > 0) {
            if (t = this._source.points()[0].price, !(e = this._source.priceScale()) || e.isEmpty()) return;
            e.isPercent() && (i = this._source.ownerSource().firstValue(), t = e.priceRange().convertToPercent(t, i)), this._priceLabel = e.formatter().format(t)
        }
    }, n.prototype.renderer = function() { var t, e; return this._invalidated && (this.updateImpl(), this._invalidated = !1), t = {}, t.points = this._points, t.borderColor = this._source.properties().borderColor.value(), t.backgroundColor = this._source.properties().backgroundColor.value(), t.color = this._source.properties().color.value(), t.fontWeight = this._source.properties().fontWeight.value(), t.fontSize = this._source.properties().fontsize.value(), t.fontFamily = this._source.properties().font.value(), t.transparency = this._source.properties().transparency.value(), t.label = this._priceLabel, t.image = this._image, this.isAnchorsRequired() && 1 === t.points.length ? (e = new c, e.append(new o(t, this._rendererCache, this._model)), e.append(new l({ points: t.points })), e) : new o(t, this._rendererCache, this._model) }, inherit(s, a), s.prototype.pointsCount = function() { return 1 }, s.prototype.title = function() { return "Price Label" }, t.exports = 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 = "LineToolPriceRange";
        var i = e || new p("linetoolpricerange");
        a.call(this, t, new o(this, t), i)
    }
    var s = i(2),
        r = i(9),
        a = i(1).LineDataSource,
        l = i(16).TextRenderer,
        h = i(45).RectangleRenderer,
        c = i(11).TrendLineRenderer,
        d = i(6),
        p = i(7).DefaultProperty,
        u = i(70).PercentageFormatter,
        _ = i(219).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, 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";

    function o() { d.call(this) }

    function n(t, e) { h.call(this, t, e) }

    function s(t, e) {
        this._constructor = "LineToolProjection";
        var i = e || this.createPropertiesObject("linetoolprojection");
        p.call(this, t, new n(this, t), i)
    }
    var r = i(23),
        a = i(206),
        l = a.ArcWedgeRenderer,
        h = a.FibWedgePaneView,
        c = a.LineToolFibWedge,
        d = i(88),
        p = i(1).LineDataSource,
        u = i(11).TrendLineRenderer,
        _ = i(6);
    inherit(o, d), o.prototype.levelsCount = function() { return 1 }, inherit(n, h), n.prototype.update = function() { h.prototype.update.call(this) }, n.prototype._levelsCount = function() {
        return 1
    }, n.prototype.renderer = function() { var t, e, i, o, n, s, r, a, h, c, d, f; return this._invalidated && (this._updateImpl(), this._invalidated = !1), t = new _, this._points.length < 2 ? t : (e = this._source.properties(), i = this._points, o = i[0], n = i[1], s = { points: [o, n], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: e.trendline.color.value(), linewidth: e.linewidth.value(), linestyle: e.trendline.linestyle.value(), extendleft: !1, extendright: !1, leftend: p.LINEEND_NORMAL, rightend: p.LINEEND_NORMAL }, t.append(new u(s)), this._points.length < 3 ? (this.addAnchors(t), t) : (r = i[2], a = r.data, h = n.substract(o).length(), c = r.substract(o).normalized(), r = o.add(c.scaled(h)), r.data = a, s = { points: [o, r], width: this._model.timeScale().width(), height: this._source.priceScale().height(), color: e.trendline.color.value(), linewidth: e.linewidth.value(), linestyle: e.trendline.linestyle.value(), extendleft: !1, extendright: !1, leftend: p.LINEEND_NORMAL, rightend: p.LINEEND_NORMAL }, t.append(new u(s)), d = this._levels[0], f = {}, f.center = this._points[0], f.radius = d.radius, f.prevRadius = 0, f.edge = this._edge, f.color = e.trendline.color.value(), f.color1 = e.color1.value(), f.color2 = e.color2.value(), f.linewidth = e.linewidth.value(), f.edge1 = this._edge1, f.edge2 = this._edge2, f.p1 = d.p1, f.p2 = d.p2, f.fillBackground = e.fillBackground.value(), f.transparency = e.transparency.value(), f.gradient = !0, t.append(new l(f)), this.addAnchors(t), t)) }, inherit(s, c), s.prototype.title = function() { return "Projection" }, s.prototype.getCache = function() { return this._model._projectionLabelsCache || (this._model._projectionLabelsCache = new o), this._model._projectionLabelsCache }, s.prototype.createPropertiesObject = function(t, e, i) { return new r(t, e, i, { range: [1, 1] }) }, t.exports = s
}, function(t, e, i) {
    "use strict";

    function o(t, e) { a.call(this, t, e), this._invalidated = !0 }

    function n(t, e) {
        this._constructor = "LineToolRotatedRectangle";
        var i = e || new d("linetoolrotatedrectangle");
        r.call(this, t, new o(this, t), i)
    }
    var s = i(2),
        r = i(1).LineDataSource,
        a = i(9),
        l = i(11).TrendLineRenderer,
        h = i(92),
        c = i(6),
        d = i(7).DefaultProperty;
    inherit(o, a), o.prototype.update = function() { this._invalidated = !0 }, o.prototype.updateImpl = function() { a.prototype.update.call(this), this._distance = 0, 3 === this._points.length && (this._distance = s.distanceToLine(this._points[0], this._points[1], this._points[2]).distance) }, o.prototype.renderer = function() {
        var t, e, i, o, n, a, d, p, u, _, f, m, g;
        return this._invalidated && (this.updateImpl(), this._invalidated = !1), t = new c, e = this._source.properties(), i = this._points[0], o = this._points[1], 2 === this._points.length ? (u = {}, u.points = this._points, u.floatPoints = this._floatPoints, u.width = this._model.timeScale().width(), u.height = this._source.priceScale().height(), u.color = e.color.value(), u.linewidth = 1, u.linestyle = CanvasEx.LINESTYLE_SOLID, u.extendleft = !1, u.extendright = !1, u.leftend = r.LINEEND_NORMAL, u.rightend = r.LINEEND_NORMAL, t.append(new l(u))) : 3 === this._points.length && (_ = o.substract(i), f = new s.Point(_.y, -_.x).normalized().scaled(this._distance), m = f.scaled(-1), n = i.add(f), a = o.add(f), d = i.add(m), p = o.add(m), u = {}, u.points = [n, a, p, d], u.color = e.color.value(),
            u.linewidth = this._source.properties().linewidth.value(), u.linestyle = CanvasEx.LINESTYLE_SOLID, u.filled = !0, u.backcolor = e.backgroundColor.value(), u.fillBackground = e.fillBackground.value(), u.transparency = e.transparency.value(), t.append(new h(u))), this.isAnchorsRequired() && (g = [], g.push(i), this._points.length >= 2 && g.push(o), 3 === this._points.length && (n.data = 2, d.data = 2, a.data = 2, p.data = 2, g.push(n), g.push(d), g.push(a), g.push(p)), t.append(this.createLineAnchor({ points: g }))), t
    }, inherit(n, r), n.prototype.startChanging = function(t, e) {
        var i, o, n, a;
        r.prototype.startChanging.call(this, t, e), 0 !== t && 1 !== t || (i = this._paneViews[0], o = i._points[0], n = i._points[1], a = i._points[2], this._distance = s.distanceToLine(o, n, a).distance)
    }, n.prototype.setPoint = function(t, e, i) {
        var o, n, a, l, h, c, d;
        r.prototype.setPoint.call(this, t, e, i), 0 !== t && 1 !== t || (o = this._paneViews[0], o.update(), n = o._points[0], a = o._points[1], l = a.substract(n), h = new s.Point(l.y, -l.x).normalized().scaled(this._distance), c = n.add(h), d = this.screenPointToPoint(c), this._points[2] = d)
    }, n.prototype.endChanging = function() { delete this._distance }, n.prototype.pointsCount = function() { return 3 }, n.prototype.title = function() { return "Rotated Rectangle" }, t.exports = n
}, function(t, e, i) {
    "use strict";
    for (var o = {
            LineToolFibRetracement: i(205),
            LineToolFibChannel: i(314),
            LineToolFibSpeedResistanceArcs: i(315),
            LineToolProjection: i(332),
            LineToolTrendBasedFibExtension: i(338),
            LineToolElliott: i(65).LineToolElliott,
            LineToolFibCircles: i(204).LineToolFibCircles,
            LineToolTrading: i(152),
            LineToolVbPFixed: i(341),
            LineStudyMtp: i(104),
            LineToolVertLine: i(90).LineToolVertLine,
            LineToolBarsPattern: i(147),
            LineToolTrendBasedFibTime: i(339),
            LineToolFibTimeZone: i(318),
            LineToolCircleLines: i(309),
            LineToolDateRange: i(311),
            LineToolPriceRange: i(331),
            LineToolDateAndPriceRange: i(310),
            LineToolParallelChannel: i(150).LineToolParallelChannel,
            LineToolTrendAngle: i(208),
            LineToolTrendLine: i(11).LineToolTrendLine,
            LineToolArrowMark: i(103).LineToolArrowMark,
            LineToolExecution: i(203).LineToolExecution,
            LineToolPitchfan: i(326),
            LineToolGannSquare: i(322),
            LineToolFibSpeedResistanceFan: i(316),
            LineToolGannComplex: i(320),
            LineToolGannFan: i(321),
            LineToolFibWedge: i(206).LineToolFibWedge,
            LineToolPitchfork: i(52).LineToolPitchfork,
            LineToolDisjointAngle: i(312),
            LineToolFlatBottom: i(319),
            LineToolIcon: i(118),
            LineToolRotatedRectangle: i(333),
            LineToolFibSpiral: i(317),
            LineToolHeadAndShoulders: i(323),
            LineToolTriangle: i(119).LineToolTriangle,
            LineToolTrianglePattern: i(340),
            LineTool5PointsPattern: i(200).LineTool5PointsPattern,
            LineToolThreeDrivers: i(337),
            LineToolABCD: i(306),
            LineToolRiskReward: i(151).LineToolRiskReward,
            LineToolPolyline: i(327),
            LineToolPrediction: i(329),
            LineToolPriceLabel: i(330),
            LineToolNote: i(149).LineToolNote,
            LineToolNoteAbsolute: i(149).LineToolNoteAbsolute,
            LineToolBrush: i(201),
            LineToolArc: i(307),
            LineToolCallout: i(202),
            LineToolBalloon: i(308),
            LineToolText: i(16).LineToolText,
            LineToolHorzLine: i(89).LineToolHorzLine,
            LineToolHorzRay: i(324),
            LineToolRectangle: i(45).LineToolRectangle,
            LineToolEllipse: i(313),
            LineToolTimeCycles: i(336),
            LineToolSineLine: i(335),
            LineToolGhostFeed: i(207),
            LineToolBezierQuadro: i(148).LineToolBezierQuadro,
            LineToolBezierCubic: i(148).LineToolBezierCubic,
            LineToolArrow: i(687),
            LineToolRay: i(691),
            LineToolExtended: i(688),
            LineToolSchiffPitchfork: i(692),
            LineToolSchiffPitchfork2: i(693),
            LineToolInsidePitchfork: i(690),
            LineToolTextAbsolute: i(16).LineToolTextAbsolute,
            LineToolArrowMarkLeft: i(103).LineToolArrowMarkLeft,
            LineToolArrowMarkRight: i(103).LineToolArrowMarkRight,
            LineToolArrowMarkUp: i(103).LineToolArrowMarkUp,
            LineToolArrowMarkDown: i(103).LineToolArrowMarkDown,
            LineToolFlagMark: i(689),
            LineToolCypherPattern: i(200).LineToolCypherPattern,
            LineToolElliottImpulse: i(65).LineToolElliottImpulse,
            LineToolElliottTriangle: i(65).LineToolElliottTriangle,
            LineToolElliottTripleCombo: i(65).LineToolElliottTripleCombo,
            LineToolElliottCorrection: i(65).LineToolElliottCorrection,
            LineToolElliottDoubleCombo: i(65).LineToolElliottDoubleCombo,
            LineToolRiskRewardLong: i(151).LineToolRiskRewardLong,
            LineToolRiskRewardShort: i(151).LineToolRiskRewardShort,
            LineToolPosition: i(328),
            LineToolOrder: i(325)
        }, n = Object.keys(o), s = n.length; s--;) TradingView[n[s]] = o[n[s]];
    t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t) { this._data = t }

    function n(t, e) { l.call(this, t, e), this._invalidated = !0 }

    function s(t, e) {
        this._constructor = "LineToolSineLine";
        var i;
        i = e || new d("linetoolsineline"), a.call(this, t, new n(this, t), i)
    }
    var r = i(2),
        a = i(1).LineDataSource,
        l = i(9),
        h = i(8),
        c = i(6),
        d = i(7).DefaultProperty;
    o.prototype.draw = function(t) {
            var e, i, o;
            for (t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, CanvasEx.setLineStyle(t, this._data.linestyle), t.beginPath(), t.moveTo(this._data.point.x, this._data.point.y), e = 1; e <= 2 * this._data.width; e++) i = e * Math.PI / this._data.width, o = Math.sin(i - Math.PI / 2) * this._data.height / 2, t.lineTo(this._data.point.x + e, this._data.point.y + o + this._data.height / 2);
            t.stroke()
        }, o.prototype.hitTest = function(t) { var e, i, o, n; return t.x < this._data.point.x || t.x > this._data.point.x + 2 * this._data.width ? null : (e = t.x - this._data.point.x, i = e * Math.PI / this._data.width, o = Math.sin(i - Math.PI / 2) * this._data.height / 2, o = this._data.point.y + o + this._data.height / 2, n = 3, Math.abs(o - t.y) <= n ? new h(h.MOVEPOINT) : null) }, inherit(n, l), n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() { l.prototype.update.call(this), this._invalidated = !1 }, n.prototype.renderer = function() { var t, e, i, n, s, a, l, h, d, p, u, _, f, m, g, v, y, b, w, S; if (this._invalidated && this.updateImpl(), this._points.length < 2) return null; if (t = this._source.points(), e = t[0], i = t[1], n = Math.min(e.index, i.index), s = Math.max(e.index, i.index), a = 2 * (s - n), l = this._points[0], h = this._points[1], d = Math.abs(l.x - h.x), p = h.y - l.y, u = new c, _ = this._source.properties(), f = this._model.timeScale(), 0 === a) return null; for (m = f.indexToCoordinate(n), g = [], v = n; m > -d; v -= a) m = f.indexToCoordinate(v), g.push(m); for (m = m = f.indexToCoordinate(n + a), v = n + a; m < f.width(); v += a) m = f.indexToCoordinate(v), g.push(m); for (y = 0; y < g.length; y++) b = new r.Point(g[y], l.y), w = { point: b, width: d, height: p, color: _.linecolor.value(), linewidth: _.linewidth.value(), linestyle: _.linestyle.value() }, S = new o(w), u.append(S); return this.addAnchors(u), u }, inherit(s, a),
        s.prototype.pointsCount = function() { return 2 }, s.prototype.title = function() { return "Sine Line" }, t.exports = s
}, function(t, e, i) {
    "use strict";

    function o(t) { this._data = t }

    function n(t, e) { l.call(this, t, e), this._invalidated = !0 }

    function s(t, e) {
        this._constructor = "LineToolTimeCycles";
        var i;
        i = e || new d("linetooltimecycles"), a.call(this, t, new n(this, t), i)
    }
    var r = i(2),
        a = i(1).LineDataSource,
        l = i(9),
        h = i(8),
        c = i(6),
        d = i(7).DefaultProperty,
        p = i(14);
    o.prototype.draw = function(t) { t.strokeStyle = this._data.color, t.lineWidth = this._data.linewidth, CanvasEx.setLineStyle(t, this._data.linestyle), t.save(), t.translate(this._data.point.x + 1, this._data.point.y), t.scale(this._data.width, this._data.height), t.beginPath(), t.arc(.5, 0, .5, Math.PI, 0, !1), t.restore(), t.stroke(), this._data.fillBackground && (t.fillStyle = p.generateColor(this._data.backcolor, this._data.transparency), t.fill()) }, o.prototype.hitTest = function(t) { var e, i, o, n, s; return t.y > this._data.point.y ? null : t.x < this._data.point.x || t.x > this._data.point.x + this._data.width ? null : (e = new r.Point(this._data.point.x + this._data.width / 2, this._data.point.y), i = t.substract(e), o = this._data.height / this._data.width, i.y /= o, n = i.length(), s = 3, Math.abs(n - this._data.width / 2) < s ? new h(h.MOVEPOINT) : null) }, inherit(n, l), n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() { l.prototype.update.call(this), this._invalidated = !1 }, n.prototype.renderer = function() { var t, e, i, n, s, a, l, h, d, p, u, _, f, m, g, v, y, b, w; if (this._invalidated && this.updateImpl(), this._points.length < 2) return null; if (t = this._source.points(), e = t[0], i = t[1], n = Math.min(e.index, i.index), s = Math.max(e.index, i.index), a = s - n, l = this._points[0], h = this._points[1], d = Math.abs(l.x - h.x), p = new c, u = this._source.properties(), _ = this._model.timeScale(), 0 === a) return null; for (f = Math.min(l.x, h.x), m = [], g = n; f > -d; g -= a) f = _.indexToCoordinate(g), m.push(f); for (f = Math.max(l.x, h.x), g = s; f < _.width(); g += a) f = _.indexToCoordinate(g), m.push(f); for (v = 0; v < m.length; v++) y = new r.Point(m[v], l.y), b = { point: y, width: d, height: d, color: u.linecolor.value(), linewidth: u.linewidth.value(), linestyle: u.linestyle.value(), fillBackground: u.fillBackground.value(), backcolor: u.backgroundColor.value(), transparency: u.transparency.value() }, w = new o(b), p.append(w); return this.addAnchors(p), p }, inherit(s, a), s.prototype.pointsCount = function() { return 2 }, s.prototype.title = function() { return "Time Cycles" }, s.prototype.setPoint = function(t, e, i) {
        var o, n = $.extend({}, e),
            s = this._points[0],
            r = this._points[1],
            a = this.priceScale();
        a.isPercent() && (o = this.ownerSource().firstValue(), n.price = a.priceRange().convertFromPercent(n.price, o)), s.price = n.price, r.price = n.price, this._points[t] = n, this.normalizePoints()
    }, s.prototype.addPoint = function(t, e, i) { var o, n, s = a.prototype.addPoint.call(this, t, e, !0); return s && (o = this._points[0], n = this._points[1], n.price = o.price, i || (this.normalizePoints(), this.createServerPoints())), s }, t.exports = s
}, function(t, e, i) {
    "use strict";

    function o(t, e) { s.call(this, t, e), this._rendererCache = {}, this._numericFormatter = new d, this._invalidated = !0 }

    function n(t, e) {
        this._constructor = "LineToolThreeDrivers";
        var i = e || new c("linetoolthreedrivers");
        r.call(this, t, new o(this, t), i)
    }
    var s = i(9),
        r = i(1).LineDataSource,
        a = i(11).TrendLineRenderer,
        l = i(16).TextRenderer,
        h = i(6),
        c = i(7).DefaultProperty,
        d = i(26).NumericFormatter,
        p = i(14);
    inherit(o, s), o.prototype.renderer = function() { var t, e, i, o, n, s, c, d, u; if (this._invalidated && (this.updateImpl(), this._invalidated = !1), this._points.length < 2) return null; for (t = this._source.properties(), e = new h, i = this, o = function(e, o) { return { points: [e], text: o, color: t.textcolor.value(), vertAlign: "middle", horzAlign: "center", font: t.font.value(), offsetX: 0, offsetY: 0, bold: t.bold && t.bold.value(), italic: t.italic && t.italic.value(), fontsize: t.fontsize.value(), backgroundColor: i._source.properties().color.value(), backgroundRoundRect: 4 } }, n = function(e, o, n, s) { return { points: [e, o], width: i._model.timeScale().width(), height: i._source.priceScale().height(), color: p.generateColor(i._source.properties().color.value(), n), linewidth: s || t.linewidth.value(), linestyle: CanvasEx.LINESTYLE_SOLID, extendleft: !1, extendright: !1, leftend: r.LINEEND_NORMAL, rightend: r.LINEEND_NORMAL } }, s = 1; s < this._points.length; s++) c = n(this._points[s - 1], this._points[s], 0), e.append(new a(c)); return this._retrace1 && (c = n(this._points[1], this._points[3], 70, 1), e.append(new a(c)), d = this._points[1].add(this._points[3]).scaled(.5), u = o(d, this._numericFormatter.format(this._retrace1)), e.append(new l(u, this._rendererCache))), this._retrace2 && (c = n(this._points[3], this._points[5], 70, 1), e.append(new a(c)), d = this._points[5].add(this._points[3]).scaled(.5), u = o(d, this._numericFormatter.format(this._retrace2)), e.append(new l(u, this._rendererCache))), this.addAnchors(e), e }, o.prototype.update = function() { this._invalidated = !0 }, o.prototype.updateImpl = function() {
        var t, e, i, o, n;
        s.prototype.update.call(this), delete this._retrace1, delete this._retrace2, this._source.points().length >= 4 && (t = this._source.points()[1], e = this._source.points()[2], i = this._source.points()[3], this._retrace1 = Math.round(100 * Math.abs((i.price - e.price) / (e.price - t.price))) / 100), this._source.points().length >= 6 && (i = this._source.points()[3], o = this._source.points()[4], n = this._source.points()[5], this._retrace2 = Math.round(100 * Math.abs((n.price - o.price) / (o.price - i.price))) / 100)
    }, inherit(n, r), n.prototype.pointsCount = function() { return 7 }, n.prototype.title = function() { return "Three Drives Pattern" }, t.exports = n
}, function(t, e, i) {
    "use strict";

    function o() { d.call(this) }

    function n(t, e) { a.call(this, t, e), this._rendererCache = {} }

    function s(t, e) {
        this._constructor = "LineToolTrendBasedFibExtension";
        var i = e || new this.createPropertiesObject("linetooltrendbasedfibextension");
        l.call(this, t, new n(this, t), i), this.version = s.version, t._trendBasedFibExtensionLabelsCache || (t._trendBasedFibExtensionLabelsCache = new o)
    }
    var r = i(2),
        a = i(9),
        l = i(1).LineDataSource,
        h = i(23),
        c = i(45).RectangleTransparencyRenderer,
        d = i(88),
        p = i(11).TrendLineRenderer,
        u = i(91),
        _ = i(8),
        f = i(6);
    inherit(o, d), o.prototype.levelsCount = function() { return s.LevelsCount }, o.prototype.points = function(t) { return [t.points()[0], t.points()[1]] }, o.prototype.startPoint = function(t, e) { return t.points()[2] },
        o.prototype.priceRange = function(t, e) {
            var i = this.points(t),
                o = i[0],
                n = i[1];
            return e ? o.price - n.price : n.price - o.price
        }, o.prototype.sourceIsReady = function(t) { return t.points().length >= 3 }, inherit(n, a), n.prototype.update = function() { this._invalidated = !0 }, n.prototype._updateImpl = function() {
            var t, e, i, o, n, r, l, h, c, d, p, u, _, f;
            if (a.prototype.update.call(this), this._cacheState = this._model._trendBasedFibExtensionLabelsCache.updateSource(this._source), !(this._source.points().length < 3) && this._source.priceScale() && !this._source.priceScale().isEmpty() && !this._model.timeScale().isEmpty())
                for (t = this._source.points()[0], e = this._source.points()[1], i = this._source.points()[2], o = !1, n = this._source.properties(), n.reverse && n.reverse.value() && (o = n.reverse.value()), this._levels = [], r = o ? t.price - e.price : e.price - t.price, this._source.priceScale().isPercent() && (l = this._source.ownerSource().firstValue()), h = 1; h <= s.LevelsCount; h++) c = "level" + h, d = n[c], d.visible.value() && (p = d.coeff.value(), u = d.color.value(), _ = i.price + p * r, this._source.priceScale().isPercent() && (_ = this._source.priceScale().priceRange().convertToPercent(_, l)), f = this._source.priceScale().priceToCoordinate(_), this._levels.push({ color: u, y: f, linewidth: n.levelsStyle.linewidth.value(), linestyle: n.levelsStyle.linestyle.value(), index: h }))
        }, n.prototype.renderer = function() {
            var t, e, i, o, n, s, a, h, d, m, g, v, y, b, w, S, T, C, x, P, L, k, I;
            if (this._invalidated && (this._updateImpl(), this._invalidated = !1), t = new f, 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(), 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 (s = this._points[2], o.trendline.visible.value() && (n = { points: [i, s], 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))), a = Math.min(s.x, i.x), h = Math.max(s.x, i.x), d = o.fillBackground.value(), m = o.transparency.value(), g = o.extendLines.value() ? this._model.timeScale().width() : h, v = this._model._trendBasedFibExtensionLabelsCache, y = v.canvas().get(0), b = 0; b < this._levels.length; b++)
                if (b > 0 && d && (w = this._levels[b - 1], e = new r.Point(a, this._levels[b].y), i = new r.Point(g, w.y), S = {}, S.points = [e, i], S.color = this._levels[b].color, S.linewidth = 0, S.backcolor = this._levels[b].color, S.fillBackground = !0, S.transparency = m, t.append(new c(S))), e = new r.Point(a, this._levels[b].y), i = new r.Point(h, this._levels[b].y), n = {
                        points: [e, i],
                        width: this._model.timeScale().width(),
                        height: this._source.priceScale().height(),
                        color: this._levels[b].color,
                        linewidth: this._levels[b].linewidth,
                        linestyle: this._levels[b].linestyle,
                        extendleft: !1,
                        extendright: o.extendLines.value(),
                        leftend: l.LINEEND_NORMAL,
                        rightend: l.LINEEND_NORMAL
                    }, T = new _(_.MOVEPOINT, null, this._levels[b].index), t.append(new p(n, T)), o.showCoeffs.value() || o.showPrices.value()) {
                    if (!(C = this._cacheState.preparedCells.cells[this._levels[b].index - 1])) continue;
                    switch (o.horzLabelsAlign.value()) {
                        case "left":
                            x = e;
                            break;
                        case "center":
                            x = e.add(i).scaled(.5), x.x += C.width / 2, x.x = Math.round(x.x);
                            break;
                        case "right":
                            o.extendLines.value() ? x = new r.Point(g - 4, this._levels[b].y) : (x = new r.Point(g + 4, this._levels[b].y), x.x += C.width, x.x = Math.round(x.x))
                    }
                    P = { left: C.left, top: v.topByRow(this._cacheState.row), width: C.width, height: v.rowHeight(this._cacheState.row) }, L = { left: x.x - P.width, top: x.y, width: C.width, height: P.height }, k = o.vertLabelsAlign.value(), "middle" === k && (L.top -= L.height / 2), "bottom" === k && (L.top -= L.height), I = new u(y, P, L), t.append(I)
                }
            return this.addAnchors(t), t
        }, inherit(s, l), s.version = 2, s.LevelsCount = 24, s.prototype.stop = function() { l.prototype.stop.call(this), this._model._trendBasedFibExtensionLabelsCache.removeSource(this.id()) }, s.prototype.pointsCount = function() { return 3 }, s.prototype.title = function() { return "Trend-Based Fib Extension" }, s.prototype.migrateVersion = function(t, e, i) { 1 === t && this.properties().extendLines.setValue(!0) }, s.prototype.processErase = function(t, e) {
            var i = "level" + e,
                o = this.properties()[i].visible;
            t.setProperty(o, !1, "Erase level line")
        }, s.prototype.createPropertiesObject = function(t, e, i) { return new h(t, e, i, { range: [0, 8] }) }, TradingView.LineToolTrendBasedFibExtension = s, t.exports = s
}, 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(2),
        r = i(90).VertLineRenderer,
        a = i(9),
        l = i(1).LineDataSource,
        h = i(23),
        c = i(16).TextRenderer,
        d = i(45).RectangleTransparencyRenderer,
        p = i(11).TrendLineRenderer,
        u = i(8),
        _ = i(6);
    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(), 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._rendererCache = {}, this._invalidated = !0 }

    function n(t, e) {
        this._constructor = "LineToolTrianglePattern";
        var i = e || new u("linetooltrianglepattern");
        a.call(this, t, new o(this, t), i)
    }
    var s = i(2),
        r = i(9),
        a = i(1).LineDataSource,
        l = i(119).TriangleRenderer,
        h = i(11).TrendLineRenderer,
        c = i(16).TextRenderer,
        d = i(92),
        p = i(6),
        u = i(7).DefaultProperty;
    inherit(o, r), o.prototype.renderer = function() {
            var t, e, i, o, n, s, r, u, _;
            return this._invalidated && (this.updateImpl(), this._invalidated = !1), this._points.length < 2 ? null : (t = this._source.properties(), e = new p, i = this, o = function(e, o) {
                return {
                    points: [e],
                    text: o,
                    color: t.textcolor.value(),
                    vertAlign: "middle",
                    horzAlign: "center",
                    font: t.font.value(),
                    offsetX: 0,
                    offsetY: 0,
                    bold: t.bold && t.bold.value(),
                    italic: t.italic && t.italic.value(),
                    fontsize: t.fontsize.value(),
                    backgroundColor: i._source.properties().color.value(),
                    backgroundRoundRect: 4
                }
            }, n = function(e, o) { return { points: [e, o], width: i._model.timeScale().width(), height: i._source.priceScale().height(), color: i._source.properties().color.value(), linewidth: t.linewidth.value(), linestyle: CanvasEx.LINESTYLE_SOLID, extendleft: !1, extendright: !1, leftend: a.LINEEND_NORMAL, rightend: a.LINEEND_NORMAL } }, s = n(this._points[0], this._points[1]), e.append(new h(s)), this._points.length >= 3 && (s = n(this._points[1], this._points[2]), e.append(new h(s))), 4 === this._points.length && (s = n(this._points[2], this._points[3]), e.append(new h(s)), this._intersectPoint ? (r = [this._startPoint1, this._startPoint2, this._intersectPoint], u = {}, u.points = r, u.color = t.color.value(), u.linewidth = t.linewidth.value(), u.backcolor = t.backgroundColor.value(), u.fillBackground = t.fillBackground.value(), u.transparency = t.transparency.value(), e.append(new l(u))) : this._intersectPoint1 && this._intersectPoint2 && (r = [this._startPoint1, this._startPoint2, this._intersectPoint2, this._intersectPoint1], u = {}, u.filled = !0, u.fillBackground = !0, u.points = r, u.color = t.color.value(), u.linewidth = t.linewidth.value(), u.backcolor = t.backgroundColor.value(), u.transparency = t.transparency.value(), e.append(new d(u)))), _ = o(this._points[0], "A"), this._points[1].y > this._points[0].y ? (_.vertAlign = "bottom", _.offsetY = -10) : (_.vertAlign = "top", _.offsetY = 5), e.append(new c(_, this._rendererCache)), _ = o(this._points[1], "B"), this._points[1].y < this._points[0].y ? (_.vertAlign = "bottom", _.offsetY = -10) : (_.vertAlign = "top", _.offsetY = 5), e.append(new c(_, this._rendererCache)), this._points.length > 2 && (_ = o(this._points[2], "C"), this._points[2].y < this._points[1].y ? (_.vertAlign = "bottom", _.offsetY = -10) : (_.vertAlign = "top", _.offsetY = 5), e.append(new c(_, this._rendererCache))), this._points.length > 3 && (_ = o(this._points[3], "D"), this._points[3].y < this._points[2].y ? (_.vertAlign = "bottom", _.offsetY = -10) : (_.vertAlign = "top", _.offsetY = 5), e.append(new c(_, this._rendererCache))), this.addAnchors(e), e)
        }, o.prototype.update = function() { this._invalidated = !0 }, o.prototype.updateImpl = function() {
            var t, e, i, o, n, a, l, h, c, d, p, u;
            if (r.prototype.update.call(this), this._valid = !1, delete this._intersectPoint, delete this._intersectPoint1, delete this._intersectPoint2, 4 === this._points.length) {
                if (t = this._points[0], e = this._points[1], i = this._points[2], o = this._points[3], Math.abs(i.x - t.x) < 1 || Math.abs(o.x - e.x) < 1) return;
                if (n = Math.min(t.x, e.x), n = Math.min(n, i.x), n = Math.min(n, o.x), a = (i.y - t.y) / (i.x - t.x), l = t.y + (n - t.x) * a, h = (o.y - e.y) / (o.x - e.x), c = e.y + (n - e.x) * h, Math.abs(a - h) < 1e-6) return;
                this._startPoint1 = new s.Point(n, l), this._startPoint2 = new s.Point(n, c), d = (e.y - t.y + (t.x * a - e.x * h)) / (a - h), this._valid = !0, d < n && (p = Math.max(t.x, e.x), p = Math.max(p, i.x), p = Math.max(p, o.x), l = t.y + (p - t.x) * a, c = e.y + (p - e.x) * h, this._startPoint1 = new s.Point(p, l), this._startPoint2 = new s.Point(p, c)), u = t.y + (d - t.x) * a, this._intersectPoint = new s.Point(d, u)
            }
        }, inherit(n, a),
        n.prototype.pointsCount = function() { return 4 }, n.prototype.title = function() { return "Triangle Pattern" }, t.exports = n
}, function(t, e, i) {
    "use strict";

    function o(t, e, i, o) {
        var n, s, l, m, g, v, y, b, w, S, T, C, x, P, L, k = "VbPFixed@tv-volumebyprice",
            I = h.lineToolNameForPointsBasedStudy(k);
        if (i = i || f.findStudyMetaInfo(t.studiesMetaData(), k), n = t.studyVersioning(), s = e || c(i, null, null, n), this._metaInfo = i, this.m_data = new _, this._plotOffsets = {}, this._plotOffsetsMetaInfoOverride = {}, l = this, m = new a(l, t), g = new h.StudyPaneView_hhists(l, t), v = new h.StudyPaneView_horizlines(l, t), y = new h.StudyPaneView_polygons(l, t), b = [m, g, v, y], o = t.mainSeries(), i.plots.length > 0 && (w = new d(l, o, t, i.plots[0].id), b.push(w)), i.plots.length > 1 && (S = new d(l, o, t, i.plots[1].id), b.push(S)), i.plots.length > 2 && (T = new d(l, o, t, i.plots[2].id), b.push(T)), r.call(this, t, b, s, I), this._turnaroundCounter = 1, this._turnaround = "vbpfixed_" + this._turnaroundCounter, this._metaInfo = i, this._graphics = new p(i), this._plotFields = [], C = this.metaInfo().plots)
            for (x = 0, P = C.length; x < P; x++) L = C[x].id, this._plotFields.push(L);
        this.clearData(), this._formatter = new u
    }
    var n = i(78),
        s = i(1).LineDataSource,
        r = n.StudyLineDataSource,
        a = n.StudyLineDataSourcePaneView,
        l = i(31),
        h = l.Study,
        c = l.prepareStudyProperties,
        d = i(79).StudyPaneView,
        p = i(155),
        u = i(220).VolumeFormatter,
        _ = i(86),
        f = i(25);
    inherit(o, r), o.prototype.pointsCount = function() { return 2 }, o.prototype._requestStudy = function() {
            var t, e, i, o, n, s, r, a, l, c, d = this.points();
            if (!(d.length < 2)) {
                if (t = d[0], e = d[1], i = Math.min(t.index, e.index), o = Math.max(t.index, e.index), i === o) return void this.clearData();
                n = this._model.mainSeries().bars().valueAt(i), s = this._model.mainSeries().bars().valueAt(o), n && s && (r = 1e3 * n[TradingView.TIME_PLOT], a = 1e3 * s[TradingView.TIME_PLOT], l = [], void 0 !== this.properties().inputs.rowsLayout && l.push(this.properties().inputs.rowsLayout.value()), l.push(this.properties().inputs.rows.value()), l.push(this.properties().inputs.volume.value()), l.push(r), l.push(a), l.push(this.properties().inputs.vaVolume.value()), c = this, this._studyId ? (this._turnaround = "vbpfixed_" + ++this._turnaroundCounter, this._model.chartApi().modifyStudy(this._studyId, this._turnaround, l, function(t) { c.onData(t) })) : (this._studyId = h.makeNextStudyId(), this._model.chartApi().createStudy(this._studyId, this._turnaround, this._model.mainSeries()._seriesId, this._metaInfo.id + "-1!", l, function(t) { c.onData(t) })))
            }
        }, o.prototype.onData = function(t) {
            var e = this;
            if ("data_update" === t.method && t.params.customId === "pointset_" + this._currentPointsetId) s.prototype.onData.call(this, t), 2 === this._points.length && this._requestStudy();
            else if ("data_update" === t.method && t.params.customId === this._studyId) {
                if (!this._checkTurnaround(t.params.turnaround)) return;
                h.prototype._makeJSONForNSData.call(this, t).then(function(i) { t.params.nonseries.d = i, e._processPlotOffsets(t.params), e._mergeData(t.params.plots), "" !== t.params.nonseries.d && (e._graphics.process(t.params.nonseries), e._correctPoints(e._graphics.graphics())), t.params.nonseries.indexes.length > 0 && (e._indexes = t.params.nonseries.indexes), e.updateAllViews(), e._model.updateSource(e) })
            }
        },
        o.prototype._correctPoints = function(t) {
            var e, i, o, n, s, r;
            if (t && (void 0 === t.indexes || 0 !== t.indexes.length) && t.hhists) {
                for (e = t.hhists[0].data, i = null, o = null, n = 0; n < e.length; ++n) s = e[n].priceLow, r = e[n].priceHigh, (!i || s < i) && (i = s), (!o || r > o) && (o = r);
                this._points[0].price = o, this._points[1].price = i
            }
        }, o.prototype.calcIsActualSymbol = function() { this._isActualSymbol = !0, this.calcIsActualInterval() }, o.prototype.formatter = function() { return this._formatter }, o.prototype.isSelfColorerPlot = function(t) { return h.isSelfColorerPlot(this, t) }, o.prototype.offset = function(t) { return h.offset(this, t) }, o.prototype.data = function() { return this.m_data }, o.prototype._processPlotOffsets = function(t) { h.processPlotOffsets(this, t) }, o.prototype._mergeData = function(t) { this.m_data.merge(t) }, t.exports = o
}, 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(2),
        r = i(9),
        a = i(8),
        l = i(68).SelectionRenderer,
        h = i(6);
    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) {
    "use strict";
    e.optimalBarWidth = function(t) { return .3 * t }, e.selectionTolerance = function(t) { return 2 + .5 * t }, e.paneRendererCoordinateIsValid = function(t) { return null !== t && void 0 !== t && !TradingView.isNaN(t) }
}, function(t, e) {
    "use strict";
    t.exports = function(t, e) {
        var i, o = 10,
            n = t % o;
        for (n && (t = t - n + o), i = []; t <= e; t += o) i.push(t);
        return i
    }
}, function(t, e, i) {
    "use strict";

    function o(t, e) { this.m_bars = new n(["time", "open", "high", "low", "close", "adt", "style"]), this.m_nsBars = new n(["time", "open", "high", "low", "close", "adt", "style"]), this.m_series = t, this.m_model = e, this.lastProjectionPrice = void 0, this.boxSize = void 0, this.reversalAmount = void 0 }
    var n = i(86),
        s = i(12).getLogger("Chart.SeriesData");
    o.prototype.bars = function() {
        return this.m_bars
    }, o.prototype.nsBars = function() { return this.m_nsBars }, o.prototype.size = function() { return this.m_nsBars._end - this.m_nsBars._start + (this.m_bars._end - this.m_bars._start) }, o.prototype.each = function(t) { var e; for (e = this.m_bars._start; e < this.m_bars._end && !t(this.m_bars._indexAt(e), this.m_bars._valueAt(e)); ++e); for (e = this.m_nsBars._start; e < this.m_nsBars._end && !t(this.m_nsBars._indexAt(e), this.m_nsBars._valueAt(e)); ++e); }, o.prototype.clear = function() { this.m_bars = new n(["time", "open", "high", "low", "close", "adt", "style"]), this.m_nsBars = new n(["time", "open", "high", "low", "close", "adt", "style"]), this.lastProjectionPrice = void 0 }, o.prototype.first = function() { return this.m_bars.isEmpty() ? this.m_nsBars._items[0] : this.m_bars._items[0] }, o.prototype.isEmpty = function() { return this.m_bars.isEmpty() && this.m_nsBars.isEmpty() }, o.prototype.last = function() { return this.m_nsBars.isEmpty() ? this.m_bars._items[this.m_bars._end - 1] : this.m_nsBars._items[this.m_nsBars._end - 1] }, o.prototype.search = function(t, e) { return this.nsBars().isEmpty() ? this.bars().search(t, e) : this.bars().isEmpty() ? this.nsBars().search(t, e) : this.nsBars().firstTimeIndex() <= t ? this.nsBars().search(t, e) : this.bars().search(t, e) }, o.prototype.valueAt = function(t) { var e = this.search(t); if (e) return e.value }, o.prototype.firstBar = function() { var t, e, i; return this.m_model.timeScale().isEmpty() ? null : (t = this.m_model.timeScale().visibleBars(), e = t.firstBar(), i = this.search(e, TradingView.SEARCH_NEAREST_RIGHT), i ? i.value : null) }, o.prototype.firstValue = function() { var t = this.firstBar(); return t ? t[TradingView.CLOSE_PLOT] : null }, o.prototype.calculateATR = function() { var t, e, i, o = []; for (t = this.m_bars.lastIndex(); t >= this.m_bars.firstIndex(); t--) e = this.m_bars._valueAt(t), o.push(e[TradingView.HIGH_PLOT] - e[TradingView.LOW_PLOT]); return i = 0 === o.length ? 0 : o.reduce(function(t, e) { return t + e }, 0) / o.length, i *= this.m_series.base() }, o.prototype.timeToBarIndex = function(t, e) {
        var i, o;
        if (null === t) return s.logDebug("SeriesData.timeToBarIndex: time should be a number of seconds since 1970. But it is null"), 0;
        if (e === TradingView.SEARCH_FROM_RIGHT) {
            for (i = this.m_bars.lastIndex(); i >= this.m_bars.firstIndex(); i--)
                if (o = this.m_bars._valueAt(i), t >= o[TradingView.TIME_PLOT]) return i;
            for (i = this.m_nsBars.lastIndex(); i >= this.m_nsBars.firstIndex(); i--)
                if (o = this.m_nsBars._valueAt(i), t >= o[TradingView.TIME_PLOT]) return i;
            return this.m_bars.firstIndex()
        }
        if (e === TradingView.SEARCH_FROM_LEFT) {
            for (i = this.m_bars.firstIndex(); i <= this.m_bars.lastIndex(); i++)
                if (o = this.m_bars._valueAt(i), t <= o[TradingView.TIME_PLOT]) return i;
            for (i = this.m_nsBars.firstIndex(); i <= this.m_nsBars.lastIndex(); i++)
                if (o = this.m_nsBars._valueAt(i), t <= o[TradingView.TIME_PLOT]) return i;
            return this.m_bars.lastIndex()
        }
        return s.logDebug("SeriesData.timeToBarIndex: Incorrect options value"), 0
    }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e) { this.m_series = t, this.m_model = e, this.m_bars = [], this._invalidated = !0, this._isMarkersEnabled = S.enabled("source_selection_markers") }

    function n(t, e) { o.call(this, t, e) }

    function s(t, e) { o.call(this, t, e) }

    function r(t, e) { o.call(this, t, e) }

    function a(t, e) { o.call(this, t, e) }

    function l(t, e, i) { this.m_series = t, this.m_priceSource = e, this.m_model = i, this.m_items = [], this._barGetter = { open: function(t) { return t[TradingView.OPEN_PLOT] }, high: function(t) { return t[TradingView.HIGH_PLOT] }, low: function(t) { return t[TradingView.LOW_PLOT] }, close: function(t) { return t[TradingView.CLOSE_PLOT] }, hl2: function(t) { return (t[TradingView.HIGH_PLOT] + t[TradingView.LOW_PLOT]) / 2 }, hlc3: function(t) { return (t[TradingView.HIGH_PLOT] + t[TradingView.LOW_PLOT] + t[TradingView.CLOSE_PLOT]) / 3 }, ohlc4: function(t) { return (t[TradingView.OPEN_PLOT] + t[TradingView.HIGH_PLOT] + t[TradingView.LOW_PLOT] + t[TradingView.CLOSE_PLOT]) / 4 } }[this.m_priceSource] }

    function h(t, e, i) { l.call(this, t, e, i), this._invaidated = !0 }

    function c(t, e, i) { l.call(this, t, e, i), this._invaidated = !0 }
    var d = i(2),
        p = i(68).SelectionRenderer,
        u = i(8),
        _ = i(59),
        f = _.PaneRendererBars,
        m = _.PaneRendererLine,
        g = _.PaneRendererArea,
        v = _.PaneRendererCandles,
        y = i(6),
        b = i(344),
        w = i(14),
        S = i(3);
    o.prototype.update = function() { this._invalidated = !0 }, o.prototype._updateImpl = function() {
        var t, e, i, o, n, s, r, a, l, h, c, p, _, f, m, g = this;
        if (this.m_bars = [], !this.m_model.timeScale().isEmpty() && !this.m_series.priceScale().isEmpty() && (t = this.m_model.timeScale().visibleBars(), !t.isEmpty() && 0 !== this.m_series.bars().size())) {
            for (e = this.m_series.nearestIndex(t.firstBar(), TradingView.SEARCH_NEAREST_RIGHT), i = this.m_series.nearestIndex(t.lastBar(), TradingView.SEARCH_NEAREST_LEFT); e <= i && void 0 === this.m_series.bars().valueAt(e); e++);
            if (!(e > i) && (t = this.m_series.bars().range(e, i), n = this.m_series.priceScale(), s = n.properties().percentage.value(), r = this.m_series.barColorer(), a = {}, t.each(function(t, e) {
                    var i, n;
                    void 0 !== e[TradingView.OPEN_PLOT] && void 0 !== e[TradingView.HIGH_PLOT] && void 0 !== e[TradingView.LOW_PLOT] && void 0 !== e[TradingView.CLOSE_PLOT] && (void 0 === o && (o = e[TradingView.CLOSE_PLOT]), i = {}, i.time = Math.round(t), s ? (i.open = 100 * (e[TradingView.OPEN_PLOT] - o) / o, i.high = 100 * (e[TradingView.HIGH_PLOT] - o) / o, i.low = 100 * (e[TradingView.LOW_PLOT] - o) / o, i.close = 100 * (e[TradingView.CLOSE_PLOT] - o) / o) : (i.open = e[TradingView.OPEN_PLOT], i.high = e[TradingView.HIGH_PLOT], i.low = e[TradingView.LOW_PLOT], i.close = e[TradingView.CLOSE_PLOT]), a.value = e, n = e[TradingView.STYLE_PLOT] ? e[TradingView.STYLE_PLOT] : r.barStyle(t, !1, a), e[TradingView.STYLE_PLOT] = n, a.previousValue = e, i.color = n.barColor, i.borderColor = n.barBorderColor, i.wickColor = n.barWickColor, i.hollow = n.isBarHollow, g.m_bars.push(i))
                }, this), n.barPricesToCoordinates(this.m_bars), this.m_model.timeScale().barIndexesToCoordinates(this.m_bars), this.m_series === this.m_model.selectedSource()))
                for (l = b(e, i), this._selectionData = { points: [] }, this._selectionData.hittestResult = u.REGULAR, h = 0; h < l.length; h++) c = l[h], (p = this.m_series.bars().valueAt(c)) && (_ = .5 * (p[TradingView.OPEN_PLOT] + p[TradingView.CLOSE_PLOT]), n.properties().percentage.value() && (_ = 100 * (_ - o) / o), f = this.m_model.timeScale().indexToCoordinate(c), m = this.m_series.priceScale().priceToCoordinate(_), this._selectionData.points.push(new d.Point(f, m)))
        }
    }, o.prototype.items = function() { return this.m_bars }, o.prototype.dump = function() {
        var t = {};
        return t.bars = this.m_bars, t
    }, inherit(n, o), n.prototype.renderer = function() { var t, e; 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 y, e.append(new f(t)), this.m_series === this.m_model.selectedSource() && this._isMarkersEnabled && e.append(new p(this._selectionData)), e }, inherit(s, o), s.prototype.renderer = function() { var t, e; return this._invalidated && (this._updateImpl(), this._invalidated = !1), t = {}, t.bars = this.m_bars, t.barSpacing = this.m_model.timeScale().barSpacing(), t.drawWick = this.m_series.properties().candleStyle.drawWick.value(), t.drawBorder = this.m_series.properties().candleStyle.drawBorder.value(), t.borderColor = this.m_series.properties().candleStyle.borderColor.value(), t.wickColor = this.m_series.properties().candleStyle.wickColor.value(), e = new y, e.append(new v(t)), this.m_series === this.m_model.selectedSource() && this._isMarkersEnabled && e.append(new p(this._selectionData)), e }, inherit(r, o), r.prototype.renderer = function() { var t, e; return this._invalidated && (this._updateImpl(), this._invalidated = !1), t = {}, t.bars = this.m_bars, t.barSpacing = this.m_model.timeScale().barSpacing(), t.drawWick = this.m_series.properties().haStyle.drawWick.value(), t.drawBorder = this.m_series.properties().haStyle.drawBorder.value(), t.borderColor = this.m_series.properties().haStyle.borderColor.value(), t.wickColor = this.m_series.properties().haStyle.wickColor.value(), e = new y, e.append(new v(t)), this.m_series === this.m_model.selectedSource() && this._isMarkersEnabled && e.append(new p(this._selectionData)), e }, inherit(a, o), a.prototype.renderer = function() { var t, e; return this._invalidated && (this._updateImpl(), this._invalidated = !1), t = {}, t.bars = this.m_bars, t.barSpacing = this.m_model.timeScale().barSpacing(), t.drawWick = this.m_series.properties().hollowCandleStyle.drawWick.value(), t.drawBorder = this.m_series.properties().hollowCandleStyle.drawBorder.value(), t.borderColor = this.m_series.properties().hollowCandleStyle.borderColor.value(), t.wickColor = this.m_series.properties().hollowCandleStyle.wickColor.value(), e = new y, e.append(new v(t)), this.m_series === this.m_model.selectedSource() && this._isMarkersEnabled && e.append(new p(this._selectionData)), e }, l.prototype.update = function() {
        var t, e, i, o, n, s, r, a, l, h, c, p, _, f, m, g, v;
        if (this.m_items = [], !this.m_model.timeScale().isEmpty() && this.m_series.priceScale() && !this.m_series.priceScale().isEmpty() && (t = this.m_model.timeScale().visibleBars(), !t.isEmpty() && 0 !== this.m_series.bars().size())) {
            for (e = this.m_series.nearestIndex(t.firstBar(), TradingView.SEARCH_NEAREST_RIGHT), i = this.m_series.nearestIndex(t.lastBar(), TradingView.SEARCH_NEAREST_LEFT), t = this.m_series.bars().range(e, i), o = this, s = o.m_series.priceScale(), r = { color: this.m_series.properties().lineStyle.color.value() }, a = s.properties().percentage.value(), l = t._start; l < t._end; ++l) h = t._indexAt(l), c = t._valueAt(l), void 0 !== (p = this._barGetter(c)) && null !== p && (void 0 === n && (n = p), a && (p = 100 * (p - n) / n), _ = new d.Point(h, p), _.style = r, o.m_items.push(_));
            if (s.pointsArrayToCoordinates(o.m_items), o.m_model.timeScale().indexesToCoordinates(o.m_items), this.m_series === this.m_model.selectedSource())
                for (f = b(e, i), this._selectionData = { points: [] }, this._selectionData.hittestResult = u.REGULAR, l = 0; l < f.length; l++) h = f[l], m = this.m_series.data().valueAt(h), p = this._barGetter(m), s.properties().percentage.value() && (p = 100 * (p - n) / n), g = this.m_model.timeScale().indexToCoordinate(h), v = this.m_series.priceScale().priceToCoordinate(p), this._selectionData.points.push(new d.Point(g, v))
        }
    }, inherit(h, l), h.prototype.update = function() { this._invalidated = !0 }, h.prototype.renderer = function() { var t, e, i, o; return this._invalidated && (l.prototype.update.call(this), this._invalidated = !1), t = this.m_series.properties().lineStyle, e = { barSpacing: this.m_model.timeScale().barSpacing(), items: this.m_items, lineColor: t.color.value(), lineStyle: t.linestyle.value(), withMarkers: t.styleType.value() === TradingView.Series.STYLE_LINE_TYPE_MARKERS, withSteps: t.styleType.value() === TradingView.Series.STYLE_LINE_TYPE_STEP, lineWidth: t.linewidth.value(), simpleMode: !0 }, i = new m(e), this.m_series === this.m_model.selectedSource() ? (o = new y, o.append(i), this._isMarkersEnabled && o.append(new p(this._selectionData))) : o = i, o }, inherit(c, l), c.prototype.update = function() { this._invalidated = !0 }, c.prototype.renderer = function() { var t, e, i; return this._invalidated && (l.prototype.update.call(this), this._invalidated = !1), t = {}, t.simpleMode = !1, t.barSpacing = this.m_model.timeScale().barSpacing(), t.items = this.m_items, t.lineColor = this.m_series.properties().areaStyle.linecolor.value(), t.lineStyle = this.m_series.properties().areaStyle.linestyle.value(), t.lineWidth = this.m_series.properties().areaStyle.linewidth.value(), e = this.m_series.properties().areaStyle.transparency.value(), t.isSeries = !0, t.color1 = w.generateColor(this.m_series.properties().areaStyle.color1.value(), e), t.color2 = w.generateColor(this.m_series.properties().areaStyle.color2.value(), e), t.bottom = this.m_series.priceScale().height(), i = new y, i.append(new g(t)), this.m_series === this.m_model.selectedSource() && this._isMarkersEnabled && i.append(new p(this._selectionData)), i }, e.SeriesBarsPaneView = n, e.SeriesCandlesPaneView = s, e.SeriesHollowCandlesPaneView = a, e.SeriesLinePaneView = h, e.SeriesAreaPaneView = c, e.SeriesHeikenAshiPaneView = r
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t, e) { this._series = t, this._model = e, this._text = "", this._coordinate = 0, this._background = "black", this._color = "white", this._invalidated = !0, this._rendererData = { text: "", coordinate: null, color: "#FFF", background: "#000", visible: !1, secondLine: null } }
        var n = i(66),
            s = i(67),
            r = i(36).Interval;
        inherit(o, n), o.prototype.update = function() { this._invalidated = !0 }, o.prototype._updateImpl = function(t) {
            var i, o, n, s, r = this._rendererData;
            r.visible = !1, r.text = "", this._model.properties().scalesProperties.showSeriesLastValue.value() && (i = this._series.lastValueData(null, e.enabled("price_scale_always_last_bar_value")), !i.noData && i.text && (this._series.properties().style.value() === TradingView.Series.STYLE_HEIKEN_ASHI && this._series.properties().haStyle.showRealLastPrice.value() && (o = this._series.lastValueData(TradingView.CLOSE_PLOT, !1).index, n = this._series.lastValueData(TradingView.CLOSE_PLOT, !0).index, o === n) || (r.visible = !0, r.text = i.text, i.color !== this._background && (this._background = i.color, r.color = this.color(), r.background = this._background), r.coordinate = i.coordinate, this._floatCoordinate = i.floatCoordinate, this._coordinate = i.coordinate, r.secondLine = null, e.enabled("countdown") && this._series.properties().showCountdown.value() && (s = [TradingView.Series.STYLE_BARS, TradingView.Series.STYLE_CANDLES, TradingView.Series.STYLE_LINE, TradingView.Series.STYLE_AREA, TradingView.Series.STYLE_HOLLOW_CANDLES, TradingView.Series.STYLE_HEIKEN_ASHI], -1 !== s.indexOf(this._series.properties().style.value()) && (r.secondLine = this._countdownInfo())))))
        }, o.prototype.coordinate = function() { return this._invalidated && (this._updateImpl(), this._invalidated = !1), n.prototype.coordinate.call(this) }, o.prototype.renderer = function() { return this._invalidated && (this._updateImpl(), this._invalidated = !1), this._renderer || (this._renderer = new s(this._rendererData)), this._renderer }, o.prototype.dump = function() { return { text: this._rendererData.text, coordinate: this._rendererData.coordinate, color: this._rendererData.color, background: this._rendererData.background, visible: this._rendererData.visible } }, o.prototype.text = function() { return this._invalidated && (this._updateImpl(), this._invalidated = !1), this._rendererData.text }, o.prototype._countdownInfo = function() { var t, e, i, o, n, s, a, l, h, c, d = null; return this._series.isDWM() ? d : (t = 1e3 * this._series.data().bars().last().value[0], e = 1e3 * this._series.serverTimeOffset(), i = r.parse(this._series.interval()), o = i.kind() === r.SECONDS ? i.multiplier() : 60 * i.multiplier(), n = t.valueOf() + 1e3 * o, s = (new Date).valueOf() + e, a = Math.round((n - s) / 1e3), a > 0 && (a = Math.min(a, o), l = "", a >= 3600 && (l = Math.floor(a / 3600) + ":"), a %= 3600, h = ("0" + Math.floor(a / 60)).right(2), a %= 60, c = ("0" + Math.floor(a)).right(2), d = l + h + ":" + c), d) }, t.exports = o
    }).call(e, i(3))
}, function(t, e) {
    "use strict";

    function i(t) { this._props = t, this._text = "", this._size = "12px", this._bold = !1 }
    i.prototype.text = function() { return this._text }, i.prototype.setText = function(t) { this._text = t }, i.prototype.color = function() { return this._props ? this._props.scalesProperties.textColor.value() : "#444" }, i.prototype.bold = function() { return this._bold }, i.prototype.size = function() { return this._size }, t.exports = i
}, 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(154).DataVendorStudyDataWindowView,
        s = i(158),
        r = i(21),
        a = i(27).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) { this._studyId = t, this._maxToVers = s.ZERO, this._maxFromVers = s.ZERO, this._migrs = [] }
    var n = i(80),
        s = i(732).Version,
        r = i(12).getLogger("Chart.StudyMigration");
    o.prototype.addMigration = function(t, e, i) {
        var o = s.parse(t),
            n = s.parse(e);
        o.isGreater(this._maxFromVers) && (this._maxFromVers = o), n.isGreater(this._maxToVers) && (this._maxToVers = n), this._migrs.push({ fromVers: o, toVers: n, rules: i })
    }, o.prototype.updateInputs = function(t, e) {
        var i, o, n;
        if (!e) return e;
        for (i = TradingView.clone(e), o = t; o.isLess(this._maxToVers);) {
            if (n = this._findMigration(o), i = this._applyMigration(i, n), !o.isLess(n.toVers)) throw Error("Problems in study migration process... Possible infinite cycle has been detected and stopped.");
            o = n.toVers, r.logDebug("Applied migration rule to study: " + this._studyId + " from vers: " + n.fromVers + " to vers: " + n.toVers)
        }
        return i
    }, o.prototype._findMigration = function(t) {
        var e, i, o = -1,
            n = this._maxFromVers;
        for (e = 0; e < this._migrs.length; e++) i = this._migrs[e], i.fromVers.isLess(t) || i.fromVers.isLessOrEqual(n) && (n = i.fromVers, o = e);
        if (o < 0) throw Error("Could not find matching migration for study: " + this._studyId + " vers: " + t);
        return this._migrs[o]
    }, o.prototype._applyMigration = function(t, e) { var i, o, n, s = t; for (i = 0; i < e.rules.length; i++) o = e.rules[i], n = this._getApplyRuleFun(o.type), s = n(s, o); return s }, o.prototype._getApplyRuleFun = function(t) {
        if ("inputRemoved" === t) return o._applyInputRemovedRule;
        if ("inputChangedType" === t) return o._applyInputChangedTypeRule;
        throw Error("Unknown migration rule type: " + t)
    }, o._applyInputRemovedRule = function(t, e) {
        var i, o, s, r;
        if (!(e.inputId in t)) return t;
        if (!(i = n.findInputKeyById(t, e.inputId))) return t;
        delete t[i], delete t[e.inputId], o = {}, s = 0;
        for (r in t) isNumber(parseInt(r, 10)) ? (o[s] = t[r], s++) : o[r] = t[r];
        return o
    }, o._applyInputChangedTypeRule = function(t, e) { var i = n.getInputKeyById(t, e.inputId); if ("resetToDefVal" !== e.action) throw Error("Unknown action " + e.action + " for rule with type " + e.type); return t[e.inputId] = e.defVal, t[i].defval = e.defVal, t[i].type = e.inputType, t }, 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(2),
        l = i(43),
        h = i(31).Study,
        c = i(66),
        d = i(67),
        p = i(346),
        u = p.SeriesAreaPaneView,
        _ = p.SeriesLinePaneView,
        f = p.SeriesHollowCandlesPaneView,
        m = p.SeriesCandlesPaneView,
        g = p.SeriesBarsPaneView,
        v = i(156),
        y = i(146),
        b = y.DataWindowView,
        w = y.DataWindowItem,
        S = i(196).SeriesBarColorer,
        T = i(89).HorzLineRenderer,
        C = i(158),
        x = i(8),
        P = i(198),
        L = i(21),
        k = i(27).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._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;
            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 i ? (t = i.name, i.exchange && 0 !== i.exchange.length && (t += ", " + i.exchange)) : t = 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() { 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) { 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(159),
        s = i(66),
        r = i(67);
    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";
    for (var o = { StudyStrategy: i(354), StatusView: i(156), StudyLineDataSource: i(78).StudyLineDataSource, StudyLineDataSourcePaneView: i(78).StudyLineDataSourcePaneView, StudyVersioning: i(80), StudyMigration: i(350), study_Overlay: i(351).study_Overlay, study_Compare: i(349), study_ScriptWithDataOffset: i(705), StudyPaneView: i(79).StudyPaneView, StudyBackgroundPaneView: i(79).StudyBackgroundPaneView, StudyPlotShapesPaneView: i(79).StudyPlotShapesPaneView, StudyPlotCharsPaneView: i(79).StudyPlotCharsPaneView, StudyPlotArrowsPaneView: i(79).StudyPlotArrowsPaneView, StudyPlotCandlesPaneView: i(79).StudyPlotCandlesPaneView, StudyStrategyOrdersPaneView: i(355), StudyPriceAxisView: i(352), StudyDataWindowView: i(154).StudyDataWindowView, DataVendorStudyDataWindowView: i(154).DataVendorStudyDataWindowView, LineStudyMtpAnalysis: i(702), LineStudyMtpDecisionPoint: i(703), LineStudyMtpRiskReward: i(704), LineStudyMtpElliotWaveMain: i(211).LineStudyMtpElliotWaveMain, LineStudyMtpElliotWaveMajor: i(211).LineStudyMtpElliotWaveMajor, LineStudyMtpElliotWaveMinor: i(211).LineStudyMtpElliotWaveMinor, LineStudyMtpDownWave1OrA: i(49).LineStudyMtpDownWave1OrA, LineStudyMtpDownWave2OrB: i(49).LineStudyMtpDownWave2OrB, LineStudyMtpDownWave3: i(49).LineStudyMtpDownWave3, LineStudyMtpDownWave4: i(49).LineStudyMtpDownWave4, LineStudyMtpDownWave5: i(49).LineStudyMtpDownWave5, LineStudyMtpDownWaveC: i(49).LineStudyMtpDownWaveC, LineStudyMtpUpWave1OrA: i(49).LineStudyMtpUpWave1OrA, LineStudyMtpUpWave2OrB: i(49).LineStudyMtpUpWave2OrB, LineStudyMtpUpWave3: i(49).LineStudyMtpUpWave3, LineStudyMtpUpWave4: i(49).LineStudyMtpUpWave4, LineStudyMtpUpWave5: i(49).LineStudyMtpUpWave5, LineStudyMtpUpWaveC: i(49).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(31).Study,
            s = i(355);
        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(41))
}, 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(2),
        s = i(59).PaneRendererStudyStrategyOrders,
        r = i(6);
    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) { return t + "(" + new Date(1e3 * t).toUTCString() + ")" }

    function n(t) { var e, i, o, n; return t += "", e = t.slice(0), i = !1, o = e[e.length - 1], -1 === "DWM".indexOf(o) && "S" !== o && (i = !0, o = ""), n = parseInt(i ? e : e.length > 1 ? e.slice(0, e.length - 1) : 1), { resolution: o, interval: n } }
    var s, r = i(58),
        a = i(57),
        l = i(36).Interval,
        h = !1,
        c = null,
        d = 0,
        p = function(t, e) { this._session = new r.Session, this._session.init(t.timezone, t.session), this._symbolInfo = t, this._resolution = e, this._extrapolatedData = [], this._modelId = d++, this._valid = !!t.timezone && !!t.session, h && console.log('Created model "{0}", interval "{1}", session "{2}", tz "{3}"'.format(this._modelId, this._resolution, t.session, t.timezone)) };
    p.prototype.uniqueId = function() { return this._modelId }, p.prototype.isValid = function() { return this._valid }, p.prototype._barBuilder = function() {
        if (!this._builderCache) {
            var t = n(this._resolution);
            this._builderCache = r.newBarBuilder(t.resolution, t.interval, this._session, this._session)
        }
        return this._builderCache
    }, p.prototype.distance = function(t, e) { var i, n, s, a, l; return isNumber(t) && isNumber(e) && this.isValid() ? (i = this._extrapolatedData.length > 0 ? this._extrapolatedData[0] : null, n = i && this._extrapolatedData[this._extrapolatedData.length - 1], 1e3 * t !== i && (this._extrapolatedData = [1e3 * t], i = null, n = null), (null === i || 1e3 * e > n) && (s = 500, a = r.extrapolateBarsFrontToTime(this._barBuilder(), n || 1e3 * t, 1e3 * e, s), this._extrapolatedData = this._extrapolatedData.concat(a)), (n = this._extrapolatedData[this._extrapolatedData.length - 1]) < 1e3 * e ? { success: !1 } : (l = this._extrapolatedData.indexOf(1e3 * e), -1 !== l ? (h && console.log('Model "{0}" "{1}", distance between "{2}" and "{3}" is "{4}"'.format(this._modelId, this._resolution, o(t), o(e), l)), { success: !0, result: l }) : { success: !1 })) : { success: !1 } }, p.prototype.projectTime = function(t, e) { var i, n, s, a; return isNumber(t) && isNumber(e) && this.isValid() ? (i = this._extrapolatedData.length > 0 ? this._extrapolatedData[0] : null, n = i && this._extrapolatedData[this._extrapolatedData.length - 1], 1e3 * t !== i && (this._extrapolatedData = [1e3 * t], i = null, n = null), (null === i || e >= this._extrapolatedData.length) && (s = r.extrapolateBarsFrontByCount(this._barBuilder(), n || 1e3 * t, e - this._extrapolatedData.length + 1), this._extrapolatedData = this._extrapolatedData.concat(s)), e < this._extrapolatedData.length ? (a = this._extrapolatedData[e] / 1e3, h && console.log('Model "{0}" "{1}", proj.time from "{2}" offset "{3}" is "{4}"'.format(this._modelId, this._resolution, o(t), e, o(a))), a) : t) : t }, s = function(t, e) { this._source = t, this._target = e, this._isSessionTheSame = t._symbolInfo.timezone === e._symbolInfo.timezone && t._symbolInfo.session === e._symbolInfo.session, this._isResolutionTheSame = t._resolution === e._resolution, this._shouldCorrectTradingDay = l.isDWM(t._resolution) && !this._isSessionTheSame, this._cache = {}, null === c && (c = new r.Session, c.init("UTC", "24x7")) }, s.prototype._sourceTargetBuilder = function() {
        var t, e;
        return this._sourceTargetBuilderCache || (t = n(this._target._resolution), e = this._isSessionTheSame ? this._target._session : c,
            this._sourceTargetBuilderCache = r.newBarBuilder(t.resolution, t.interval, this._target._session, e)), this._sourceTargetBuilderCache
    }, s.prototype.sourceTimeToTargetTime = function(t) { var e, i, n, s, r, l; return this._isSessionTheSame && this._isResolutionTheSame ? t : isNumber(t) && this._source.isValid() && this._target.isValid() ? (e = this._cache[t], e || (i = 1e3 * t, this._shouldCorrectTradingDay && (n = a.utc_to_cal(this._source._session.timezone, i), n = this._source._session.spec.correctTradingDay(n, this._source._session.timezone), s = new Date(n), a.set_hms(s, 0, 0, 0, 0), i = s.valueOf()), r = this._sourceTargetBuilder(), r.moveTo(i), l = r.indexOfBar(i), e = r.startOfBar(Math.max(0, l)) / 1e3, this._cache[t] = e), h && console.log('Model "{0}" "{1}" sourceTime "{2}" => model "{3}" "{4}" targetTime "{5}"'.format(this._source.uniqueId(), this._source._resolution, o(t), this._target.uniqueId(), this._target._resolution, o(e))), e) : t }, t.exports.SyncPoint = s, t.exports.SyncModel = p
}, 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(50)(t))
}, 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 = [], 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) {
    (function(t, o, n) {
        "use strict";

        function s(e) { this._chartWidgetCollection = e, this._chartAboutToBeSavedDelegate = new t, this._chartSavedDelegate = new t }

        function r(t, e, i, o) {
            var s, r, a;
            o = o || {}, s = { wl: o.wl, images: JSON.stringify(t.images()), previews: o.previews, onWidget: o.onWidget }, r = t.activeChartWidget.value().widgetCustomer(), r && (s.customer = r), s.timezone = t.activeChartWidget.value()._properties.timezone.value(), window.urlParams && window.urlParams.locale && (s.language = urlParams.locale), a = n.enabled("charting_library_base") ? o.snapshotUrl || "https://www.tradingview.com/snapshot/" : "/snapshot/", $.post(a, s, function(t) { t ? e(t) : i() }).fail(function() { i() })
        }
        var a = i(116);
        s.prototype.chartAboutToBeSaved = function() { return this._chartAboutToBeSavedDelegate }, s.prototype.chartSaved = function() { return this._chartSavedDelegate }, s.prototype.whenReadyToSave = function(t) {
            var e, i, o = this._chartWidgetCollection,
                n = o.activeChartWidget.value(),
                s = n.model().mainSeries();
            s.symbolInfo() && !s.hasDelayedSymbolIntervalChange() ? t() : (e = null, i = null, e = function() { s.onSymbolError().unsubscribe(null, i, !0), t() }, i = function() { s.onSymbolResolved().unsubscribe(null, e, !0) }, s.onSymbolResolved().subscribe(null, e, !0), s.onSymbolError().subscribe(null, i, !0))
        }, s.prototype.saveToJSON = function() { return this._fillSavingInfo(!1, !0) }, s.prototype._fillAsyncInfo = function(t, e, i) {
            function o(e) { t.content = JSON.stringify($.extend(!0, s, e)), n.resolve(t) }
            var n, s = JSON.parse(t.content),
                r = this._chartWidgetCollection;
            return e || (i = !0), n = $.Deferred(), i ? r.asyncState(!!e).then(o) : r.activeChartWidget.value().asyncState(!!e).then(o), n.promise()
        }, s.prototype._fillSavingInfo = function(t, e, i) {
            var o, n, s, r, a, l, h, c, d, p, u, _, f, m;
            if (t || (e = !0), o = { publish_request_id: Math.random().toString(36).substring(2) }, n = this._chartWidgetCollection, s = n.activeChartWidget.value(), r = n.metaInfo, a = s.model().mainSeries(), l = a.properties(), h = a.symbolInfo(), !a || !r || !h) throw new ReferenceError("Missed required data");
            for (r.id.value() && (o.id = r.id.value()), o.name = r.name.value() || "", o.description = r.description.value() || "", o.resolution = a.properties().interval.value(), o.symbol_type = h.type || "", o.exchange = h.exchange || "", o.listed_exchange = h.listed_exchange || "", a.isSpread() ? (c = h.legs[0], d = h.base_name[0], d = d.split(":")[1], o.symbol = c, o.short_name = d, o.expression = h.full_name) : (p = h.ticker || l.symbol.value(), u = l.shortName.value(), o.symbol = p, o.short_name = u), _ = [], f = 0, m = h.legs.length; f < m; f++) _.push({ symbol: h.legs[f], pro_symbol: h.base_name[f] });
            return o.legs = JSON.stringify(_), o.content = e ? JSON.stringify(n.state(!!t, i)) : JSON.stringify(s.state(!!t, i)), t && (o.image = JSON.stringify(n.images({ onlyActiveChart: !e }))), o.is_realtime = t ? "0" : "1", o
        }, s.prototype.publishChart = function(t) {}, s.prototype.onPublish = function(t, e) {
            function i(i) {
                var n, s, r, l, h, c, d;
                a.publishInProgress = !1, n = i.responseText, "ok:" === n.substr(0, 3) ? (s = !1, e.savePrivacySetting && (s = !t.is_public, TVSettings.setValue("publishchart.private", s)), kmRecord("Chart", "{0} Published".format(void 0 === t.script_type ? "Chart" : "Script"), { is_private: s }), r = n.substr(3), l = JSON.parse(r), a._chartWidgetCollection.metaInfo.id.value() || a._chartWidgetCollection.metaInfo.id.setValue(l.id), e.closeForm && e.closeForm(), a._lastPublishUrl = l.publishUrl, a.hWnd && (h = l.publishUrl, e.ideaUrl && (h = o.render(e.ideaUrl, { idea: l.idea })), a.hWnd.location = h)) : (e.showError && ((413 === i.status || /^[\d\s]*request.+large/i.test(n.trim())) && (c = "support@tradingview.com", n = $.t("This chart layout has a lot of objects and can't be published! Please report to {0} for further&nbsp;details.").format('<a href="mailto:' + c + '">' + c + "</a>")), d = { html: !0 }, e.showError(n || $.t("Error occured while publishing"), d)), a.hWnd && (a.hWnd.close(), a.hWnd = null))
            }
            var n, s, r, a = this;
            a.publishInProgress || (n = a._fillSavingInfo(!0, e && e.publishAllLayout, !0), a._fillAsyncInfo(n, !0, e && e.publishAllLayout).then(function(e) {
                var o = t.scriptPublication;
                new Promise(function(e, i) { o ? ScriptLib.publishNew(o.scriptSource, o.scriptProtection).done(function(i) { delete t.scriptPublication, o.scriptProtection === TVScript.Access.ACCESS_CLOSED_NEEDS_AUTH && PinePerm.add(window.user.username, i.pineId), e(i.publishedstudyscript_id) }).fail(function() { i() }) : e() }).then(function(o) { o && (t.publishedstudyscript_id = o), $.ajax({ url: "/publishchart/", type: "post", dataType: "text", data: $.extend({}, e, t), complete: i }) })
            }), a.publishInProgress = !0, e.onWidget && !e.ideaUrl || "" !== t.name && "" !== t.description && t.description.length <= 4e3 && t.name.length <= 64 && ($.cookie("publish_request_id", n.publish_request_id, { path: "/" }), s = "/loading/", e.ideaUrl && (r = urlParams.createUrlParams({ ideaUrl: e.ideaUrl }), s = "/loading?" + r), a.hWnd = window.open(s, "_blank")))
        }, s._saveChart = function(t, e, i, o, n) {
            var s = i,
                r = o;
            return s = function(t) { e.id.value() || (e.id.setValue(t), e.uid.setValue(t)), "function" == typeof i && i() }, a.saveChart(t.name, t.short_name, t.resolution, t, e, s, r)
        }, s.prototype.saveChartSilently = function(t, e, i, o) {
            var n = this._chartWidgetCollection.metaInfo,
                r = this._fillSavingInfo(e);
            if (o = o || {}, o.chartName && (r.name = o.chartName),
                r.name && 0 !== r.name.length || !o.defaultChartName || (r.name = o.defaultChartName), !r.name) return void console.warn("Saving chart with empty name is not allowed");
            $(window).on("beforeunload.savechart", function() { return $.t("Your chart is being saved, please wait a moment before you leave this page.") }), this._chartAboutToBeSavedDelegate.fire(), s._saveChart(r, n, function() { this._chartWidgetCollection.metaInfo.name.setValue(r.name), this._chartSavedDelegate.fire(!0), t && t(n) }.bind(this), function() { this._chartSavedDelegate.fire(!1), i && i.apply(null, arguments) }.bind(this), o), $(window).off("beforeunload.savechart")
        }, e.ChartSaver = s, e.takeSnapshot = r
    }).call(e, i(15), i(30), i(3))
}, function(t, e, i) {
    var o, n;
    ! function(s, r) { "object" == typeof t && t.exports ? t.exports = r() : (o = r, void 0 !== (n = "function" == typeof o ? o.call(e, i, e, t) : o) && (t.exports = n)) }(0, function() {
        "use strict";

        function t(t, e) { var i, o = document.createElement(t || "div"); for (i in e) o[i] = e[i]; return o }

        function e(t) { for (var e = 1, i = arguments.length; e < i; e++) t.appendChild(arguments[e]); return t }

        function i(t, e, i, o) {
            var n = ["opacity", e, ~~(100 * t), i, o].join("-"),
                s = .01 + i / o * 100,
                r = Math.max(1 - (1 - t) / e * (100 - s), t),
                a = h.substring(0, h.indexOf("Animation")).toLowerCase(),
                l = a && "-" + a + "-" || "";
            return u[n] || (c.insertRule("@" + l + "keyframes " + n + "{0%{opacity:" + r + "}" + s + "%{opacity:" + t + "}" + (s + .01) + "%{opacity:1}" + (s + e) % 100 + "%{opacity:" + t + "}100%{opacity:" + r + "}}", c.cssRules.length), u[n] = 1), n
        }

        function o(t, e) {
            var i, o, n = t.style;
            if (e = e.charAt(0).toUpperCase() + e.slice(1), void 0 !== n[e]) return e;
            for (o = 0; o < p.length; o++)
                if (i = p[o] + e, void 0 !== n[i]) return i
        }

        function n(t, e) { for (var i in e) t.style[o(t, i) || i] = e[i]; return t }

        function s(t) { var e, i, o; for (e = 1; e < arguments.length; e++) { i = arguments[e]; for (o in i) void 0 === t[o] && (t[o] = i[o]) } return t }

        function r(t, e) { return "string" == typeof t ? t : t[e % t.length] }

        function a(t) { this.opts = s(t || {}, a.defaults, _) }

        function l() {
            function i(e, i) { return t("<" + e + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', i) }
            c.addRule(".spin-vml", "behavior:url(#default#VML)"), a.prototype.lines = function(t, o) {
                function s() { return n(i("group", { coordsize: c + " " + c, coordorigin: -h + " " + -h }), { width: c, height: c }) }

                function a(t, a, l) { e(p, e(n(s(), { rotation: 360 / o.lines * t + "deg", left: ~~a }), e(n(i("roundrect", { arcsize: o.corners }), { width: h, height: o.scale * o.width, left: o.scale * o.radius, top: -o.scale * o.width >> 1, filter: l }), i("fill", { color: r(o.color, t), opacity: o.opacity }), i("stroke", { opacity: 0 })))) }
                var l, h = o.scale * (o.length + o.width),
                    c = 2 * o.scale * h,
                    d = -(o.width + o.length) * o.scale * 2 + "px",
                    p = n(s(), { position: "absolute", top: d, left: d });
                if (o.shadow)
                    for (l = 1; l <= o.lines; l++) a(l, -2, "progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");
                for (l = 1; l <= o.lines; l++) a(l);
                return e(t, p)
            }, a.prototype.opacity = function(t, e, i, o) {
                var n = t.firstChild;
                o = o.shadow && o.lines || 0, n && e + o < n.childNodes.length && (n = n.childNodes[e + o], n = n && n.firstChild, (n = n && n.firstChild) && (n.opacity = i))
            }
        }
        var h, c, d, p = ["webkit", "Moz", "ms", "O"],
            u = {},
            _ = {
                lines: 12,
                length: 7,
                width: 5,
                radius: 10,
                scale: 1,
                corners: 1,
                color: "#000",
                opacity: .25,
                rotate: 0,
                direction: 1,
                speed: 1,
                trail: 100,
                fps: 20,
                zIndex: 2e9,
                className: "spinner",
                top: "50%",
                left: "50%",
                shadow: !1,
                hwaccel: !1,
                position: "absolute"
            };
        return a.defaults = {}, s(a.prototype, {
            spin: function(e) {
                var i, o, s, r, a, l, c, d, p, u;
                return this.stop(), i = this, o = i.opts, s = i.el = t(null, { className: o.className }), n(s, { position: o.position, width: 0, zIndex: o.zIndex, left: o.left, top: o.top }), e && e.insertBefore(s, e.firstChild || null), s.setAttribute("role", "progressbar"), i.lines(s, i.opts), h || (r = 0, a = (o.lines - 1) * (1 - o.direction) / 2, c = o.fps, d = c / o.speed, p = (1 - o.opacity) / (d * o.trail / 100), u = d / o.lines, function t() {
                    r++;
                    for (var e = 0; e < o.lines; e++) l = Math.max(1 - (r + (o.lines - e) * u) % d * p, o.opacity), i.opacity(s, e * o.direction + a, l, o);
                    i.timeout = i.el && setTimeout(t, ~~(1e3 / c))
                }()), i
            },
            stop: function() { var t = this.el; return t && (clearTimeout(this.timeout), t.parentNode && t.parentNode.removeChild(t), this.el = void 0), this },
            lines: function(o, s) {
                function a(e, i) { return n(t(), { position: "absolute", width: s.scale * (s.length + s.width) + "px", height: s.scale * s.width + "px", background: e, boxShadow: i, transformOrigin: "left", transform: "rotate(" + ~~(360 / s.lines * c + s.rotate) + "deg) translate(" + s.scale * s.radius + "px,0)", borderRadius: (s.corners * s.scale * s.width >> 1) + "px" }) }
                for (var l, c = 0, d = (s.lines - 1) * (1 - s.direction) / 2; c < s.lines; c++) l = n(t(), { position: "absolute", top: 1 + ~(s.scale * s.width / 2) + "px", transform: s.hwaccel ? "translate3d(0,0,0)" : "", opacity: s.opacity, animation: h && i(s.opacity, s.trail, d + c * s.direction, s.lines) + " " + 1 / s.speed + "s linear infinite" }), s.shadow && e(l, n(a("#000", "0 0 4px #000"), { top: "2px" })), e(o, e(l, a(r(s.color, c), "0 0 1px rgba(0,0,0,.1)")));
                return o
            },
            opacity: function(t, e, i) { e < t.childNodes.length && (t.childNodes[e].style.opacity = i) }
        }), "undefined" != typeof document && (c = function() { var i = t("style", { type: "text/css" }); return e(document.getElementsByTagName("head")[0], i), i.sheet || i.styleSheet }(), d = n(t("group"), { behavior: "url(#default#VML)" }), !o(d, "transform") && d.adj ? l() : h = o(d, "animation")), a
    })
}, function(t, e, i) {
    "use strict";
    var o, n, s, r;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(12), n = i(60), s = o.getLogger("GUI.Blocks.AbstractIndicator"), i(125), r = function() {
        function t() { this._classSuffix = "", this._quoteSessionPrefix = "abstract-indicator", this._shortMode = !1, this._showTooltip = !0, this._subscribed = !1 }
        return t.prototype.getValue = function() { return this._value }, t.prototype.getTooltipText = function() { return this.getLabel() }, t.prototype.getLabel = function() { return this._labelMap[this.getValue()] || "" }, t.prototype.getElement = function() { return this._el }, t.prototype.update = function(t, e) { this._updateValue(t, e), this._render() }, t.prototype.setTooltipEnabled = function(t) { void 0 === t && (t = !1), this._showTooltip !== t && (this._showTooltip = t, this._renderTooltip()) }, t.prototype.enableShortMode = function() {!0 !== this._shortMode && (this._shortMode = !0, this._render()) }, t.prototype.disableShortMode = function() {!1 !== this._shortMode && (this._shortMode = !1, this._render()) }, t.prototype.isShortModeEnabled = function() { return this._shortMode }, t.assignQuoteSession = function(e) { t._quoteSession = e }, t.prototype._init = function(e) {
            this._el = e.el ? e.el : document.createElement("span"), this._el.innerHTML = "", this._classMap = e.classMap,
                this._labelMap = e.labelMap, this._showTooltip = e.showTooltip, this._classSuffix = e.classSuffix, this._quoteSessionGUID = n.guid(), !0 === e.short && this.enableShortMode(), e.data && this._updateValue(e.data), e.quoteSession && t.assignQuoteSession(e.quoteSession), t._quoteSession && e.symbol && this._subscribe(e.symbol)
        }, t.prototype._clearClasses = function() {
            var t = this;
            Object.values(this._classMap).map(function(e) { t._el.classList.remove("" + e), t._el.classList.remove("" + e + t._classSuffix) })
        }, t.prototype._render = function() { this._renderClasses(), this._renderTooltip(), this._renderLabel() }, t.prototype._renderLabel = function() { this._el.textContent = this.getLabel() }, t.prototype._renderClasses = function() {
            this._clearClasses(), this._el.classList.add(this._componentClass), this._el.classList.add("" + this._componentClass + this._classSuffix);
            var t = this._classMap[this.getValue()];
            void 0 !== t ? (this._el.classList.add("" + t + this._classSuffix), this._el.classList.add(t)) : void 0 !== this.getValue() && s.logWarn("no className for status " + this.getValue())
        }, t.prototype._renderTooltip = function() { this._el.classList.add("apply-common-tooltip"), this._el.setAttribute("title", this._showTooltip ? this.getTooltipText() : ""), $(this._el).trigger("common-tooltip-update") }, t.prototype._updateValue = function(t, e) {
            var i = this._getValueFromData(t);
            (e || i !== this.getValue()) && (this._value = i)
        }, t.prototype._getQuoteSessionId = function() { return this._quoteSessionPrefix + "." + this._quoteSessionGUID }, t.prototype._subscribe = function(e, i) { i && i.target !== this._el || !this._subscribed && t._quoteSession && (t._quoteSession.subscribe(this._getQuoteSessionId(), e, this.update.bind(this)), this._el.removeEventListener("DOMNodeInserted", this._subscribe.bind(this, e)), this._el.addEventListener("DOMNodeRemoved", this._unsubscribe.bind(this, e), !1), this._subscribed = !0) }, t.prototype._unsubscribe = function(e, i) { i && i.target !== this._el || this._subscribed && t._quoteSession && (t._quoteSession.unsubscribe(this._getQuoteSessionId(), e), this._el.removeEventListener("DOMNodeRemoved", this._unsubscribe.bind(this, e)), this._el.addEventListener("DOMNodeInserted", this._subscribe.bind(this, e), !1), this._subscribed = !1) }, t
    }(), e.AbstractIndicator = r, window.AbstractIndicator = r
}, function(t, e) {
    "use strict";

    function i(t, e) { return t < e }

    function o(t, e, i, o, n) { var s, r, a; for (void 0 === o && (o = 0), void 0 === n && (n = t.length), s = n - o; 0 < s;) r = s >> 1, a = o + r, i(t[a], e) ? (o = a + 1, s -= r + 1) : s = r; return o }

    function n(t, e, n, s) { return void 0 === n && (n = 0), void 0 === s && (s = t.length), o(t, e, i, n, s) }

    function s(t, e, i, o, n) { var s, r, a; for (void 0 === o && (o = 0), void 0 === n && (n = t.length), s = n - o; 0 < s;) r = s >> 1, a = o + r, i(e, t[a]) ? s = r : (o = a + 1, s -= r + 1); return o }

    function r(t, e, o, n) { return void 0 === o && (o = 0), void 0 === n && (n = t.length), s(t, e, i, o, n) }
    Object.defineProperty(e, "__esModule", { value: !0 }), e.lowerbound = o, e.lowerbound_int = n, e.upperbound = s, e.upperbound_int = r
}, function(t, e, i) {
    "use strict";

    function o(t, e, i, o, n, s, r, a) {
        function l(t, e, i, o, n, s) { var r = 0; return t < i ? r |= 1 : t > n && (r |= 2), e < o ? r |= 4 : e > s && (r |= 8), r }
        for (var h, c, d, p = l(t, e, n, s, r, a), u = l(i, o, n, s, r, a), _ = !1, f = 0;;) {
            if (f > 1e3) throw Error("Cohen - Sutherland algorithm: infinity loop");
            if (f++, !(p | u)) { _ = !0; break }
            if (p & u) break;
            h = p || u, c = void 0, d = void 0, 8 & h ? (c = t + (i - t) * (a - e) / (o - e), d = a) : 4 & h ? (c = t + (i - t) * (s - e) / (o - e), d = s) : 2 & h ? (d = e + (o - e) * (r - t) / (i - t), c = r) : (d = e + (o - e) * (n - t) / (i - t), c = n), h === p ? (t = c, e = d, p = l(t, e, n, s, r, a)) : (i = c, o = d, u = l(i, o, n, s, r, a))
        }
        return _ ? [t, e, i, o] : null
    }

    function n(t, e, i, n) { var r = o(t.x, t.y, e.x, e.y, 0, 0, i, n); return null != r ? [new s.Point(r[0], r[1]), new s.Point(r[2], r[3])] : null }
    Object.defineProperty(e, "__esModule", { value: !0 });
    var s = i(2);
    e.clipSegmentToViewport = n
}, function(t, e, i) {
    "use strict";

    function o(t) { return "." + t.replace("+", "") }

    function n(t, e) {
        var i = o(t);
        a.unbind("keydown" + i).bind("keydown" + i, t, function(t) { $(t.target).is("input[type=password]") || e.apply(null, Array.prototype.slice.call(arguments)) }), r[t] = e
    }

    function s(t) { a.unbind("keydown" + o(t)), delete r[t] }
    var r, a;
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17), r = {}, a = $(document), e.bind = n, e.unbind = s
}, function(t, e, i) {
    "use strict";
    var o, n, s, r, a, l, h, c;
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17), i(28), o = i(69), n = i(128), s = i(63), r = i(357), a = i(15), l = i(165), h = i(129), c = function() {
        function t(t, e, i) { return void 0 === i && (i = {}), this._container = $('<div class="favored-list-container">'), this._quickContainer = $('<div class="quick">').appendTo(this._container), this._onChange = new a, this._onSelect = new a, this._onResize = new a, this._onOpen = new a, this._active = null, this._data = [], this._list = [], this._quicks = [], this._options = i = i, this._name = t, i.addClass && this._container.addClass(i.addClass), this._submenu = $('<span class="submenu">' + (this._options.submenuHtml || "") + "<i></i></span>").appendTo(this._container), i.tooltip && (this._submenu.attr("title", i.tooltip), i.addTooltipClass && this._submenu.addClass(i.addTooltipClass)), this._load(e), s.bindPopupMenu(this._container, null, { addClass: "narrow favored-list " + (i.popupAddClass || ""), direction: "down", event: "popup-menu", popupSpacing: i.popupSpacing, reverse: !0, svg: null == i.svg || i.svg }), this._submenu.on("click", this.openMenu.bind(this)), n.TVXWindowEvents.on(t + "-change", this._onChangeInAnotherTab.bind(this)), this }
        return t.prototype.element = function() { return this._container }, t.prototype.onChange = function() { return this._onChange }, t.prototype.onSelect = function() { return this._onSelect }, t.prototype.onResize = function() { return this._onResize }, t.prototype.onOpen = function() { return this._onOpen }, t.prototype.setValue = function(t) {
            var e = this._getItemByValue(t);
            this._setActive(e)
        }, t.prototype.value = function() { return this._active ? this._active.data.value : void 0 }, t.prototype.removeById = function(t) {
            var e = this,
                i = this._data.filter(function(e) { return !e.separator && e.id !== t });
            this._list.forEach(function(i) { i.data.id === t && e._toggleFavorite(i, !1) }), this.reload(i)
        }, t.prototype.reload = function(t) { this._quickContainer.empty(), this._load(t) }, t.prototype.openMenu = function() { this._submenu.parent().hasClass("active") || this._onOpen.fire(), this._submenu.trigger("popup-menu", [this._data]) }, t.prototype._onChangeInAnotherTab = function() { this.reload(this._data) }, t.prototype._load = function(t) {
            var e = this;
            this._options.showJustDefaultQuicks ? this._quicks = this._options.defaultFavorites || [] : this._options.notShowQuicks ? this._quicks = [] : this._quicks = o.getJSON(this._name + ".quicks", this._options.defaultFavorites || []), this._list = [], t.filter(function(t) { return !t.separator }).forEach(function(t, i) {
                var o, n = {
                    data: t,
                    drop: function() { n.data.drop && n.data.drop() },
                    favorite_button: null,
                    index: i,
                    isFavorite: function() { return e._quicks.indexOf(t.id) > -1 },
                    markFavorite: function() { n.toQuickButton && n.toQuickButton.attr("title", $.t("Remove from favorites")).addClass("quicked") },
                    svg: t.svg && $(t.svg).clone(),
                    toQuickButton: e._options.notShowQuicks ? null : $('<span class="to-quick">').append($(l).attr({ height: 16, width: 16 })),
                    toggleFavorite: function(t, i) {
                        var o = void 0 !== t ? t : !n.isFavorite();
                        o ? n.markFavorite() : n.unmarkFavorite(), e._toggleFavorite(n, o, i)
                    },
                    unmarkFavorite: function() { n.toQuickButton && n.toQuickButton.attr("title", $.t("Add to favorites")).removeClass("quicked") }
                };
                n.data.toQuickButtonStyle && n.toQuickButton && n.toQuickButton.css(n.data.toQuickButtonStyle), e._list.push(n), t.action = e._change.bind(e, n), t.active = e._options.notShowActive ? function() { return !1 } : function() { return !(!e._active || n !== e._active) }, t.buttons = [], e._options.notShowQuicks || t.buttons.push({ el: n.toQuickButton, handler: function(t) { n.toggleFavorite(), t.preventDefault(), t.stopPropagation() } }), n.data.drop && (o = $("<span>").addClass("delete").attr("title", $.t("Delete")).html(h), e._options.notShowQuicks && o.css("right", "7px"), t.buttons.push({ el: o, handler: function(t) { n.drop(), t.stopPropagation() } })), n.toggleFavorite(n.isFavorite(), !0)
            }), this._data = t, this._options.notShowActive || this._addActive(this._list[0]), this._onResize.fire()
        }, t.prototype._toggleFavorite = function(t, e, i) {
            if (!this._options.notShowQuicks || this._options.showJustDefaultQuicks) {
                if (e) {
                    t.favorite_button = this._createButton(t);
                    var o = this._lastFavoriteButton(t);
                    o ? t.favorite_button.insertAfter(o.favorite_button) : t.favorite_button.prependTo(this._quickContainer)
                } else i || this._removeButton(t);
                i || (e ? -1 === this._quicks.indexOf(t.data.id) && this._quicks.push(t.data.id) : this._quicks.indexOf(t.data.id) > -1 && this._quicks.splice(this._quicks.indexOf(t.data.id), 1), this._saveFavorite(), this._markActive(), this._onResize.fire())
            }
        }, t.prototype._lastFavoriteButton = function(t) {
            for (var e = t.index - 1; e >= 0; e--)
                if (this._list[e] && this._list[e].favorite_button) return this._list[e];
            return null
        }, t.prototype._saveFavorite = function() { this._options.notShowQuicks || (o.setJSON(this._name + ".quicks", this._quicks), n.TVXWindowEvents.emit(this._name + "-change")) }, t.prototype._createButton = function(t) {
            var e = this,
                i = t.data.favoriteButton,
                o = $("<span>").data("item", t);
            return i.addClass && o.addClass(i.addClass), i.title && o.prop("title", r.clean(i.title + "", !0)), t.svg && $(t.svg).clone().appendTo(o), o.on("click", function(i) { e._change(t), 0 === e._quicks.length && e.openMenu(), i.preventDefault() }), o
        }, t.prototype._removeButton = function(t) { t.favorite_button && (t.favorite_button.remove(), t.favorite_button = null) }, t.prototype._markActive = function(t) {
            var e, i, o = this;
            this._options.notShowActive || (e = null,
                this._active && (t = this._active, t.isFavorite() ? (i = this._quickContainer.find(".just_active"), this._btnToggleActiveView(i, !1)) : (e = this._addActive(t), 0 !== this._quicks.length && this._btnToggleActiveView(e, !0))), this._list.forEach(function(e) { t !== e || 0 === o._quicks.length ? o._btnToggleActiveView(e.favorite_button, !1) : e.favorite_button && o._btnToggleActiveView(t.favorite_button, !0) }), e && e.hasClass("selected") ? this._container.addClass("not-favored-active") : this._container.removeClass("not-favored-active"))
        }, t.prototype._btnToggleActiveView = function(t, e) { t && (e ? t.addClass("selected") : t.removeClass("selected")) }, t.prototype._addActive = function(t) { return this._quickContainer.find(".just_active").remove(), this._createButton(t).appendTo(this._quickContainer).addClass("just_active") }, t.prototype._setActive = function(t) { return this._active !== t && (this._active = t, this._markActive(), !0) }, t.prototype._change = function(t) { this._onSelect.fire(t.data.id), this._setActive(t) && this._onChange.fire(t.data.id) }, t.prototype._getItemByValue = function(t) {
            for (var e in this._list)
                if (this._list[e].data.id === t) return this._list[e];
            throw Error("undefined value " + t + " in FavoredList")
        }, t
    }(), e.FavoredList = c
}, function(t, e, i) {
    "use strict";
    var o, n, s, r, a, l, h, c, d;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(17), i(286), i(105), n = i(251), s = i(54), r = i(69), a = i(15), l = i(41), h = i(379), c = '<div class="tv-floating-toolbar i-closed i-hidden">' + (Modernizr.touch ? '<div class="tv-floating-toolbar__drag-ext js-drag"></div>' : "") + '<div class="tv-floating-toolbar__widget-wrapper"><div class="tv-floating-toolbar__drag js-drag">' + h + '</div><div class="tv-floating-toolbar__content js-content"></div></div></div>', i(500), d = function() {
        function t(e) { this._widget = document.createElement("div"), this._isVertical = !1, this._hiddingTimeoutId = null, this._visibility = new l(!1), this._windowResizeListener = this._onWindowResize.bind(this), this._reorderedDelegate = new a, t._toolbars.push(this), this._options = e, this._widget = o(c).get(0), this._content = this._widget.getElementsByClassName("js-content").item(0), this._setZIndex(t._startZIndex + t._toolbars.length - 1), this._options.addClass && (this._widget.className += " " + this._options.addClass), this._options.layout && "auto" !== this._options.layout && (this._isVertical = "vertical" === this._options.layout, this._updateLayoutType()) }
        return t.prototype.destroy = function() { this.hide(!0), t._toolbars.splice(t._toolbars.indexOf(this), 1), document.body.contains(this._widget) && document.body.removeChild(this._widget), this._widget.innerHTML = "" }, t.prototype.isVisible = function() { return this._visibility.value() }, t.prototype.visibility = function() { return this._visibility.readonly() }, t.prototype.isVertical = function() { return this._isVertical }, t.prototype.show = function() {
                var t = this;
                this.isVisible() || (document.body.contains(this._widget) || (this._init(), document.body.appendChild(this._widget)), this._setHiddingTimeout(null), window.addEventListener("resize", this._windowResizeListener), this.raise(), this._visibility.setValue(!0),
                    this._widget.classList.contains("i-hidden") ? (this._widget.classList.remove("i-hidden"), setTimeout(function() { t.isVisible() && t._widget.classList.remove("i-closed") })) : this._widget.classList.remove("i-closed"), this._onWindowResize())
            }, t.prototype.hide = function(t) {
                var e, i, o = this;
                void 0 === t && (t = !1), this.isVisible() && (e = this._widget.classList.contains("i-closed"), this._widget.classList.add("i-closed"), this._visibility.setValue(!1), t || e ? (this._setHiddingTimeout(null), this._widget.classList.add("i-hidden")) : (i = setTimeout(function() { o._setHiddingTimeout(null), o._widget.classList.add("i-hidden") }, this.hideDuration()), this._setHiddingTimeout(i)), window.removeEventListener("resize", this._windowResizeListener))
            }, t.prototype.raise = function() { t._toolbars.length + t._startZIndex !== this._zIndex() && (t._toolbars.splice(t._toolbars.indexOf(this), 1), t._toolbars.push(this), t._updateAllZIndexes()) }, t.prototype.hideDuration = function() { return .75 * s.dur }, t.prototype.addWidget = function(t, e) {
                var i, o, n;
                if (void 0 === e && (e = {}), i = this.widgetsCount(), void 0 === e.index && (e.index = i), e.index < 0 || e.index > i) throw Error("Index must be in [0, " + i + "]");
                o = document.createElement("div"), o.className = "tv-floating-toolbar__widget js-widget", o.appendChild(t), n = e.index === i ? null : this._content.childNodes.item(e.index), this._content.insertBefore(o, n), this._onWindowResize()
            }, t.prototype.removeWidget = function(t) {
                var e = this._findWrapperForWidget(t);
                e && (this._content.removeChild(e), this._onWindowResize())
            }, t.prototype.widgetsCount = function() { return this._content.childNodes.length }, t.prototype.showWidget = function(t) {
                var e = this._findWrapperForWidget(t);
                e && e.classList.remove("i-hidden")
            }, t.prototype.hideWidget = function(t) {
                var e = this._findWrapperForWidget(t);
                e && e.classList.add("i-hidden")
            }, t.prototype.removeWidgets = function() {
                for (; this._content.firstChild;) this._content.removeChild(this._content.firstChild);
                this._onWindowResize()
            }, t.prototype.onWidgetsReordered = function() { return this._reorderedDelegate }, t.prototype.onContextMenu = function(t) {
                var e, i = this;
                Modernizr.touch ? (e = new n(this._widget), e.get("press").set({ time: 500 }), e.on("press", function(e) { i._preventWidgetTouchEndEvent(), t(e.srcEvent) })) : this._widget.addEventListener("contextmenu", t)
            }, t.prototype._determineCurrentLayoutVertical = function(t) { var e = this._isVertical ? t.height : t.width; return window.innerWidth < e }, t.prototype._getWidget = function() { return this._widget }, t.prototype._findWrapperForWidget = function(t) {
                var e, i, o = this._content.getElementsByClassName("js-widget");
                for (e = 0; e < o.length; ++e)
                    if (i = o.item(e), i.contains(t)) return i;
                return null
            }, t.prototype._onVerticalChanged = function(t, e) {}, t.prototype._setHiddingTimeout = function(t) { null !== this._hiddingTimeoutId && clearTimeout(this._hiddingTimeoutId), this._hiddingTimeoutId = t }, t.prototype._preventWidgetTouchEndEvent = function() {
                var t = this,
                    e = function(i) { i.preventDefault(), t._widget.removeEventListener("touchend", e) };
                this._widget.addEventListener("touchend", e)
            }, t.prototype._updateLayoutType = function() { this._widget.classList.toggle("i-vertical", this._isVertical) },
            t.prototype._onWindowResize = function() { var t, e; "auto" === (this._options.layout || "auto") && (t = this._isVertical, e = this._getCorrectedWidgetRect(), this._isVertical = this._determineCurrentLayoutVertical(e), this._updateLayoutType(), t !== this._isVertical && this._onVerticalChanged(this._isVertical, t)), this._checkPosition() }, t.prototype._checkPosition = function() {
                var t = this._getCorrectedWidgetRect(),
                    e = { left: t.left, top: t.top };
                this._correctPosition(e), t.left === e.left && t.top === e.top || (this._widget.style.left = e.left + "px", this._widget.style.top = e.top + "px")
            }, t.prototype._correctPosition = function(t) {
                var e = this._getCorrectedWidgetRect();
                t.left + e.width > window.innerWidth && (t.left = Math.max(0, window.innerWidth - e.width)), t.top + e.height > window.innerHeight && (t.top = Math.max(0, window.innerHeight - e.height)), t.left = Math.max(0, t.left), t.top = Math.max(0, t.top)
            }, t.prototype._setZIndex = function(t) { this._widget.style.zIndex = t + "" }, t.prototype._zIndex = function() { return +this._widget.style.zIndex }, t.prototype._loadPosition = function() {
                var t = r.getJSON(this._options.positionSettingsKey, this._options.defaultPosition);
                this._widget.style.left = Math.round(t.left) + "px", this._widget.style.top = Math.round(t.top) + "px", this._onWindowResize()
            }, t.prototype._savePosition = function() {
                var t = this._widget.getBoundingClientRect();
                r.setJSON(this._options.positionSettingsKey, { left: t.left, top: t.top })
            }, t.prototype._init = function() { this._loadPosition(), o(this._widget).draggable({ containment: "window", drag: this._onDragEvent.bind(this), handle: ".js-drag", stop: this._savePosition.bind(this) }), this._options.allowSortable && this._initSortable(), this._widget.addEventListener(Modernizr.touch ? "touchstart" : "mousedown", this.raise.bind(this)) }, t.prototype._onDragEvent = function(t, e) { this._correctPosition(e.position) }, t.prototype._initSortable = function() {
                var t = this,
                    e = -1;
                o(this._content).sortable({
                    start: function(t, i) { e = i.item.index() },
                    stop: function(i, o) {
                        var n = o.item.index();
                        e !== n && t._reorderedDelegate.fire(e, n)
                    },
                    tolerance: "point"
                })
            }, t.prototype._getCorrectedWidgetRect = function() { var t, e, i, o, n = this._widget.getBoundingClientRect(); return this._widget.classList.contains("i-closed") ? (t = .925, e = 1 / t - 1, i = n.width * e, o = n.height * e, { bottom: n.bottom + o / 2, height: n.height + o, left: n.left - i / 2, right: n.right + i / 2, top: n.top - o / 2, width: n.width + i }) : n }, t._updateAllZIndexes = function() { t._toolbars.forEach(function(e, i) { e._setZIndex(t._startZIndex + i) }) }, t
    }(), d._startZIndex = 20, d._toolbars = [], e.FloatingToolbar = d
}, function(t, e, i) {
    "use strict";

    function o() {
        var t = $("<select />");
        return $('<option value="' + n.PlotType.Line + '">' + $.t("Line") + "</option>").appendTo(t), $('<option value="' + n.PlotType.Line_with_breaks + '">' + $.t("Line With Breaks") + "</option>").appendTo(t), $('<option value="' + n.PlotType.Histogram + '">' + $.t("Histogram") + "</option>").appendTo(t), $('<option value="' + n.PlotType.Cross + '">' + $.t("Cross", { context: "chart_type" }) + "</option>").appendTo(t), $('<option value="' + n.PlotType.Area + '">' + $.t("Area") + "</option>").appendTo(t), $('<option value="' + n.PlotType.Area_with_breaks + '">' + $.t("Area With Breaks") + "</option>").appendTo(t),
            $('<option value="' + n.PlotType.Columns + '">' + $.t("Columns") + "</option>").appendTo(t), $('<option value="' + n.PlotType.Circles + '">' + $.t("Circles") + "</option>").appendTo(t), t
    }
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17), i(28);
    var n = i(81);
    e.createPlotEditor = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { e.toggleClass("i-hidden", "" === t.val()), i.fire(t.val()) }

    function n(t) { var e, i, n, r = $(l); return t.addClass && r.addClass(t.addClass), t.withoutControls && r.addClass("tv-search-row--without-controls"), e = r.find(".js-input-control"), i = r.find(".js-reset-button"), t.placeholder && e.attr("placeholder", t.placeholder), i[0].addEventListener("click", function() { e.val("").trigger("input").focus() }), n = new s, e.on("input propertychange", o.bind(null, e, i, n)), o(e, i, n), { $control: r, $input: e, inputChangedDelegate: n } }
    var s, r, a, l;
    Object.defineProperty(e, "__esModule", { value: !0 }), s = i(15), r = i(904), a = i(908), i(511), l = '<div class="tv-search-row"><input class="tv-search-row__input js-input-control" type="text" name="q" value="" autocomplete="off"><span class="tv-search-row__input-reset i-hidden js-reset-button">' + r + '</span><span class="tv-search-row__search-icon">' + a + "</span></div>", e.createSearchControl = n
}, function(t, e) {
    "use strict";

    function i(t, e) { void 0 === e && (e = "&nbsp;"); var i = (t + "").split("."); return i[0].replace(/\B(?=(\d{3})+(?!\d))/g, e) + (i[1] ? "." + i[1] : "") }
    Object.defineProperty(e, "__esModule", { value: !0 }), e.splitThousands = i
}, function(t, e, i) {
    "use strict";
    var o, n, s;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(15), n = i(69),
        function(t) {
            function e(e) { return t.favorites.indexOf(e) }

            function i() { t.favorites = [], n.getJSON("chart.favoriteDrawings", []).forEach(function(e) { t.favorites.push(e.tool || e) }), t.favoritesSynced.fire() }

            function s() { n.setJSON("chart.favoriteDrawings", t.favorites) }
            t.favorites = [], t.favoritesSynced = new o, t.favoriteIndex = e, t.saveFavorites = s, i(), n.onSync.subscribe(null, i)
        }(s || (s = {})),
        function(t) {
            function e() { return s.favorites.slice() }

            function i() { return s.favorites.length }

            function n(t) { return t < 0 || t >= i() ? "" : s.favorites[t] }

            function r(e) { return !l(e) && (s.favorites.push(e), s.saveFavorites(), t.favoriteAdded.fire(e), !0) }

            function a(e) { var i = s.favoriteIndex(e); return -1 !== i && (s.favorites.splice(i, 1), s.saveFavorites(), t.favoriteRemoved.fire(e), !0) }

            function l(t) { return -1 !== s.favoriteIndex(t) }

            function h(e, o) { if (o < 0 || o >= i()) return !1; var n = s.favoriteIndex(e); return -1 !== n && o !== n && (s.favorites.splice(n, 1), s.favorites.splice(o, 0, e), s.saveFavorites(), t.favoriteMoved.fire(e, n, o), !0) }
            t.favoriteAdded = new o, t.favoriteRemoved = new o, t.favoriteMoved = new o, t.favoritesSynced = s.favoritesSynced, t.favorites = e, t.favoritesCount = i, t.favorite = n, t.addFavorite = r, t.removeFavorite = a, t.isFavorite = l, t.moveFavorite = h
        }(e.LinetoolsFavoritesStore || (e.LinetoolsFavoritesStore = {}))
}, function(t, e, i) {
    "use strict";
    var o, n, s;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(73), n = i(124), s = function(t) {
        function e(e) { var i = t.call(this, e, !1) || this; return i._subcommands = [], i }
        return o.__extends(e, t), e.prototype.addCommand = function(t) { this._subcommands.push(t) },
            e.prototype.isEmpty = function() { return 0 === this._subcommands.length }, e.prototype.redo = function() { for (var t = 0; t < this._subcommands.length; t++) this._subcommands[t].redo() }, e.prototype.undo = function() { for (var t = this._subcommands.length - 1; t >= 0; t--) this._subcommands[t].undo() }, e
    }(n.UndoCommand), e.UndoMacroCommand = s
}, function(t, e, i) {
    "use strict";
    var o, n, s, r, a;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(124), n = i(15), s = i(12), r = s.getLogger("Common.UndoStack"), a = function() {
        function t(t) { void 0 === t && (t = !0), this._commands = [], this._onChange = new n, this._logCommands = t }
        return t.prototype.onChange = function() { return this._onChange }, t.prototype.isEmpty = function() { return 0 === this._commands.length }, t.prototype.clear = function() { this._commands.length = 0, this._onChange.fire() }, t.prototype.push = function(t) {
            if (!(t instanceof o.UndoCommand)) throw new TypeError("argument must be an instance of UndoCommand");
            this._commands.push(t), this._onChange.fire()
        }, t.prototype.pop = function() { if (this.isEmpty()) return void r.logDebug("pop: undo stack is empty"); var t = this._commands.pop(); return this._onChange.fire(), t }, t.prototype.head = function() { if (!this.isEmpty()) return this._commands[this._commands.length - 1] }, t
    }(), e.UndoStack = a
}, function(t, e, i) {
    "use strict";

    function o(t) {
        var e, i = n.get_timezone(t).offset_utc(Date.now()),
            o = "",
            s = i / 1e3 / 60 / 60;
        return s % 1 && (o = ":" + s % 1 * 60), e = "", e = s > 0 ? "+" + (s - s % 1) + o : 0 === s ? "" : s - s % 1 + o + "", { offset: i, string: "UTC" + e }
    }
    Object.defineProperty(e, "__esModule", { value: !0 });
    var n = i(57);
    e.parseTzOffset = o
}, function(t, e) {
    "use strict";

    function i(t) { window.t = t }

    function o(t) { n.$ || (n.$ = {}), n.$.t = t }
    var n, s;
    Object.defineProperty(e, "__esModule", { value: !0 }), n = window, e.addTranslationFunctionToWindow = i, e.addTranslationFunctionToJQuery = o, s = function(t, e) { return t }, e.translationFunction = s
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M10.5 5.333h-.75V3.81C9.75 1.707 8.07 0 6 0 3.93 0 2.25 1.707 2.25 3.81v1.523H1.5c-.825 0-1.5.686-1.5 1.524v7.62C0 15.313.675 16 1.5 16h9c.825 0 1.5-.686 1.5-1.524V6.857c0-.838-.675-1.524-1.5-1.524zM6 12c-.825 0-1.5-.675-1.5-1.5S5.175 9 6 9s1.5.675 1.5 1.5S6.825 12 6 12zm2.325-6.75h-4.65v-1.5A2.326 2.326 0 0 1 6 1.425 2.326 2.326 0 0 1 8.325 3.75v1.5z"/></svg>' }, 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>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 12"><path fill-rule="evenodd" d="M0 0h2v2H0V0zm4 0h2v2H4V0zM0 5h2v2H0V5zm4 0h2v2H4V5zm-4 5h2v2H0v-2zm4 0h2v2H4v-2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 15" width="16" height="15"><path d="M8 12l-4.702 2.472.898-5.236L.392 5.528l5.257-.764L8 0l2.35 4.764 5.258.764-3.804 3.708.898 5.236z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 15" width="16" height="15"><path d="M8 0L5.656 4.75l-5.25.78 3.781 3.72-.875 5.22L8 12l4.688 2.47-.876-5.22 3.782-3.72-5.25-.78L8 0zm0 3.406l1.344 2.72 3.03.436-2.187 2.157.5 3.03L8 10.312 5.312 11.75l.5-3.03L3.626 6.56l3.03-.437L8 3.405z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 9" width="11px" height="9px"><path fill="none" fill-rule="evenodd" stroke-width="2" d="M1 3.22l3.415 3.496L10 1"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="-90 -55 140 140"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 12l-40.3-42.5-10 10.6 29.7 31.2L-41 43.4l10.7 11.3L10 12.2l-.1-.1z"/></svg>' }, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, , , , , , , function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, function(t, e) {}, , function(t, e) {}, function(t, e) {}, , function(t, e) {}, function(t, e) {}, function(t, e) {}, , , function(t, e, i) {
    "use strict";
    var o, n;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(113), Object.keys(o).forEach(function(t) { "default" !== t && "__esModule" !== t && Object.defineProperty(e, t, { enumerable: !0, get: function() { return o[t] } }) }), n = i(252), Object.defineProperty(e, "KeyboardListener", { enumerable: !0, get: function() { return n.KeyboardListener } })
}, function(t, e, i) {
    "use strict";
    var o, n;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(529), Object.defineProperty(e, "Autocomplete", { enumerable: !0, get: function() { return o.Autocomplete } }), Object.defineProperty(e, "ArraySource", { enumerable: !0, get: function() { return o.ArraySource } }), n = i(253), Object.defineProperty(e, "events", { enumerable: !0, get: function() { return n.events } })
}, function(t, e, i) {
    (function(t) {
        "use strict";

        function o(t) {
            var e, i;
            if (t && t.__esModule) return t;
            if (e = {}, null != t)
                for (i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
            return e.default = t, e
        }

        function n(t) { return t && t.__esModule ? t : { default: t } }

        function s(t, e, i) { return e in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t }

        function r(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
        var a, l, h, c, d, p, u, _, f, m;
        Object.defineProperty(e, "__esModule", { value: !0 }), e.ArraySource = e.Autocomplete = void 0, a = function() {
            function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
            return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
        }(), i(487), l = i(225), h = n(l), c = i(261), d = i(530), p = i(527), u = i(113), _ = o(u), f = i(253), m = i(723), e.Autocomplete = function() {
            function e(i) {
                var o = i.el,
                    n = i.source,
                    s = i.textField,
                    a = void 0 === s ? "text" : s,
                    l = i.maxLength;
                r(this, e), this._el = o, this._$el = $(o), this._source = n, this._tmpl = t.render(m, { maxLength: l }), this._textField = a, this._init()
            }
            return a(e, [{ key: "_init", value: function() { this.stream = new h.default, this._el.insertAdjacentHTML("afterBegin", this._tmpl), this._$el.on("beforeOpenMenu", this._onBeforeOpenMenu.bind(this)), this._$el.on("afterCloseMenu", this._onAfterCloseMenu.bind(this)), this.input = this._el.querySelector("input"), this.input.addEventListener("input", this._onInput.bind(this)), this._dropdown = new c.DropdownView(this._$el), this._source.getItems().then(this._initMenu.bind(this)), this._regHandlers() } }, {
                key: "_initMenu",
                value: function(t) {
                    var e = this;
                    this._menu = new d.Menu({ el: this._el.querySelector("tv-menu"), items: t, itemClass: "tv-autocomplete__dropdown-item", textField: this._textField }), this._menu.stream.addListener(d.events.SELECT, function(t) { t[e._textField] && (e.input.value = t[e._textField], e._dropdown.close(), e.stream.emitEvent(f.events.SELECT, [t])) })
                }
            }, {
                key: "_regHandlers",
                value: function() {
                    var t, e, i = this;
                    this._closeStateKeyboardListener = new p.KeyboardListener, this._closeStateKeyboardListener.regHandlers((t = {}, s(t, _.UP_ARROW, function() { i._dropdown.open() }), s(t, _.DOWN_ARROW, function() { i._dropdown.open() }), t)), this._openStateKeyboardListener = new p.KeyboardListener, this._openStateKeyboardListener.regHandlers((e = {}, s(e, _.UP_ARROW, function() { i._menu.prev() }), s(e, _.DOWN_ARROW, function() { i._menu.next() }), s(e, _.ENTER, function() { i._menu.select() }), s(e, _.ESC, function() { i._dropdown.close() }), e)), this._closeStateKeyboardListener.watchOn(this.input)
                }
            }, {
                key: "_onInput",
                value: function() {
                    var t = this;
                    this._source.find(this.input.value, this._textField).then(function(e) { e.length ? (t._menu.updateItems(e), t._dropdown.open()) : t._dropdown.close() })
                }
            }, { key: "_onAfterCloseMenu", value: function() { this._openStateKeyboardListener.stopWatching(), this._closeStateKeyboardListener.watchOn(this.input), this._menu.reset(), this.stream.emitEvent(f.events.AFTER_CLOSE_MENU) } }, { key: "_onBeforeOpenMenu", value: function() { this._closeStateKeyboardListener.stopWatching(), this._openStateKeyboardListener.watchOn(this.input), this.stream.emitEvent(f.events.BEFORE_OPEN_MENU) } }, { key: "value", get: function() { return this.input.value !== this._menu.value[this._textField] ? s({}, this._textField, this.input.value) : this._menu.value } }]), e
        }(), e.ArraySource = function() {
            function t(e) { r(this, t), this._array = e }
            return a(t, [{ key: "find", value: function(t, e) { var i = this._array.filter(function(i) { return i[e].toLowerCase().includes(t.toLowerCase()) }); return Promise.resolve(i) } }, { key: "getItems", value: function() { return Promise.resolve(this._array) } }]), t
        }()
    }).call(e, i(30))
}, function(t, e, i) {
    "use strict";
    var o, n;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(531), Object.defineProperty(e, "Menu", { enumerable: !0, get: function() { return o.Menu } }), n = i(254), Object.defineProperty(e, "events", { enumerable: !0, get: function() { return n.events } })
}, function(t, e, i) {
    (function(t) {
        "use strict";

        function o(t) { return t && t.__esModule ? t : { default: t } }

        function n(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
        var s, r, a, l, h, c, d, p;
        Object.defineProperty(e, "__esModule", { value: !0 }), e.Menu = void 0, s = function() {
            function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
            return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
        }(), i(490), r = i(225), a = o(r), l = i(254), h = "tv-menu-item", c = '<tv-menu-item {{#itemClass}}class="{{itemClass}}"{{/itemClass}} data-item="{{item}}">{{text}}</tv-menu-item>', d = "prev", p = "next", e.Menu = function() {
            function e(t) {
                var i = t.el,
                    o = t.items,
                    s = t.itemClass,
                    r = t.textField,
                    a = void 0 === r ? "text" : r;
                n(this, e), this._el = i, this._items = o, this._itemClass = s, this._textField = a, this._init()
            }
            return s(e, [{ key: "_init", value: function() { this._el.setAttribute("tabindex", "1"), this.stream = new a.default, this.updateItems(this._items), this._el.addEventListener("click", this._onClick.bind(this)) } }, { key: "updateItems", value: function(t) { t && this._renderItems(t), this._menuItems = this._el.querySelectorAll(h), this._selectedItem = this._el.querySelector(h + ".i-active"), this._setFocusOnItem(this._selectedItem) } }, { key: "next", value: function() { this._moveFocusTo(p) } }, { key: "prev", value: function() { this._moveFocusTo(d) } }, { key: "reset", value: function() { return this._selectedItem ? void this._setFocusOnItem(this._selectedItem) : this._focusedItem ? void this._blur() : void 0 } }, { key: "select", value: function() { this._selectedItem = this._focusedItem, this.stream.emitEvent(l.events.SELECT, [this.value]) } }, {
                key: "_moveFocusTo",
                value: function(t) {
                    var e = this._getFocusedItemIdx(),
                        i = this._menuItems.length - 1,
                        o = void 0;
                    switch (t) {
                        case p:
                            o = this._findActiveItem(t, ++e) || this._findActiveItem(t, 0);
                            break;
                        case d:
                            o = this._findActiveItem(t, --e) || this._findActiveItem(t, i)
                    }
                    this._setFocusOnItem(o)
                }
            }, { key: "_getFocusedItemIdx", value: function() { var t = this; return Array.prototype.findIndex.call(this._menuItems, function(e) { return Object.is(e, t._focusedItem) }) } }, {
                key: "_findActiveItem",
                value: function(t, e) {
                    for (var i = this._menuItems[e]; i && i.classList.contains("i-disabled");) switch (t) {
                        case "next":
                            i = this._menuItems[e++];
                            break;
                        case "prev":
                            i = this._menuItems[e--]
                    }
                    return i
                }
            }, { key: "_setFocusOnItem", value: function(t) { t && !t.classList.contains("i-disabled") && (this._blur(), this._focusedItem = t, this._focus()) } }, { key: "_focus", value: function() { this._focusedItem && this._focusedItem.classList.add("i-active") } }, { key: "_blur", value: function() { this._focusedItem && this._focusedItem.classList.remove("i-active") } }, {
                key: "_onClick",
                value: function(t) {
                    var e = !t.target.classList.contains("i-disabled");
                    t.target.tagName === h.toUpperCase() && e && (this._setFocusOnItem(t.target), this.select())
                }
            }, {
                key: "_renderItems",
                value: function(e) {
                    var i = this,
                        o = { items: e, itemClass: this._itemClass, text: function() { return this[i._textField] }, item: function() { return JSON.stringify(this) } },
                        n = "{{#items}}" + c + "{{/items}}",
                        s = t.render(n, o);
                    this._el.innerHTML = "", this._el.insertAdjacentHTML("afterBegin", s)
                }
            }, { key: "value", get: function() { var t = void 0; try { t = JSON.parse(this._selectedItem.dataset.item) } catch (e) { t = {} } return t } }]), e
        }()
    }).call(e, i(30))
}, function(t, e, i) {
    "use strict";

    function o(t) { return t && t.__esModule ? t : { default: t } }

    function n(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
    var s, r, a, l, h;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.AddSymbolTab = void 0, s = function() {
        function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
        return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
    }(), r = i(77), a = o(r), l = i(256), i(250), i(496), h = '\n\t<div class="tv-add-symbol-tab">\n\t\t<input type="text" class="tv-control-input js-add-symbol-tab-input" placeholder="' + $.t("Symbol") + '" autocomplete="off">\n\t\t<div class="tv-add-symbol-tab__add-symbol-overlay js-add-symbol-tab-checkbox"></div>\n\t</div>', e.AddSymbolTab = function() {
        function t(e, i) { n(this, t), this._chartWidgetCollection = e, this._dialog = i, this._$popup = null, this.init() }
        return s(t, [{
            key: "init",
            value: function() {
                var t = this;
                this.$tab = $(h), this._$input = this.$tab.find(".js-add-symbol-tab-input"), this._checkbox = new l.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), a.default.bindToInput(this._$input, {
                    callback: function(e) {
                        var i = t._chartWidgetCollection.activeChartWidget.value();
                        i && i.addSymbol(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.touch || this._$input.focus() } }, { key: "isClickOnTab", value: function(t) { return !!this._$popup && !(this._$popup[0] !== t.target && !this._$popup[0].contains(t.target)) } }]), t
    }()
}, function(t, e, i) {
    "use strict";

    function o(t) { return t && t.__esModule ? t : { default: t } }

    function n(t) {
        var e, i;
        if (t && t.__esModule) return t;
        if (e = {}, null != t)
            for (i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
        return e.default = t, e
    }

    function s(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }

    function r(t, e, i) { return e in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t }

    function a(t, e, i) {
        var o, n = 2 * H,
            s = document.createElement("canvas");
        return s.width = e * n, s.height = i * n, s.style.width = e + "px", s.style.height = i + "px", o = s.getContext("2d"), o.setTransform(n, 0, 0, n, 0, 0), o.drawImage(t, 0, 0, e, i), s
    }

    function l(t, e) { return function() { i.e(3, function() { q = i(535), t.call(e) }) } }
    var h, c, d, p, u, _, f, m, g, v, y, b, w, S, T, C, x, P, L, k, I, A, E, M, D, O, V, B, R, N, F, z, W, H, U, j, q, Y, G;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.Branding = void 0, h = function() {
            function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
            return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
        }(), d = i(3), p = n(d), u = i(2), _ = n(u), f = i(8), m = o(f), g = i(264), v = o(g), y = i(54), b = i(14), w = "tvLogoBlack", S = "tvLogoWhite", c = {}, r(c, w, i(912)), r(c, S, i(913)), T = c,
        C = "images/widget-embed-logo/", x = "site_branding", P = "widget_branding", L = "widget_referral_branding", k = "widget_custom_branding", I = "widget_custom_no_powered_branding", A = "fundamental_branding", E = "fundamental_custom_branding", M = "fundamental_custom_no_powered_branding", D = "library_branding", O = "library_custom_branding", V = "library_custom_no_powered_branding", B = .2, R = $(window), N = navigator.userAgent.toLowerCase().indexOf("firefox") > -1, F = function() {
            var t, e = window.navigator.userAgent,
                i = e.indexOf("MSIE ");
            return i > 0 ? parseInt(e.substring(i + 5, e.indexOf(".", i)), 10) : e.indexOf("Trident/") > 0 && (t = e.indexOf("rv:"), parseInt(e.substring(t + 3, e.indexOf(".", t)), 10))
        }(), z = window.urlParams || {}, W = window.initData || {}, H = window.hidpiCanvasRatio || 1, U = !0, j = null, q = null, Y = function() {
            function t(e) {
                var i = e.layout,
                    o = void 0 === i ? x : i,
                    n = e.symbol,
                    r = void 0 === n ? "" : n,
                    a = e.model,
                    h = e.onReadyCallback;
                s(this, t), this._model = a, this._logo = null, this._logoReady = !1, this._showLogo = !1, this._logoWidth = 28, this._logoHeight = 19, this.show = !0, this.width = 100, this.height = 20, this._layout = o, this._symbol = r, this._strokeColor = y.color.black255, this._fillСolor = y.color.brand, this._colorOldBlue = y.color.brandDown, this._colorOldGray = y.color.black30, this._strokeOpacity = .6, this._strokeWidth = 2, this._fontSize = 14, this._font = 'px "Trebuchet MS", Tahoma, Arial, sans-serif', this._txt = "TradingView", this._onReadyCallback = h, this._upscaleRatio = 2, this._strokeCanv = null, this._fillCanv = null, F && (this._init = l(this._init, this)), this._init()
            }
            return h(t, [{ key: "_init", value: function() { this._checkLayout(), this.show && (this._updateStrokeColor(), this._model.properties().paneProperties.background.subscribe(this, this._updateStrokeColor), this._model.onChartThemeLoaded().subscribe(this, this._updateStrokeColor)) } }, {
                key: "_updateStrokeColor",
                value: function() {
                    var t = (0, b.getLuminance)(this._model.properties().paneProperties.background.value());
                    this._strokeCanv = null, this._fillCanv = null, t > B ? (this._strokeColor = y.color.black255, this._strokeWidth = 2.5, this._loadLogo(S)) : (this._strokeColor = y.color.black0, this._strokeWidth = 3, this._loadLogo(w))
                }
            }, {
                key: "_loadLogo",
                value: function(t) {
                    var e = this;
                    this._showLogo && (this._logo = new Image, this._logo.src = F ? q.fallbackImages[t] : "data:image/svg+xml;charset=utf-8," + encodeURIComponent(T[t]), this._logo.addEventListener("load", function() { N && (e._logo = a(e._logo, e._logoWidth, e._logoHeight)), e._logoReady = !0, "function" == typeof e._onReadyCallback && e._onReadyCallback() }))
                }
            }, {
                key: "_checkLayout",
                value: function() {
                    switch (this._layout) {
                        case P:
                        case L:
                        case k:
                        case A:
                        case E:
                        case O:
                        case D:
                            this.show = !0;
                            break;
                        case x:
                        case I:
                        case M:
                        case V:
                            this.show = !1
                    }
                    switch (this._layout) {
                        case P:
                            this._txt = $.t("{0} chart by TradingView").format(this._symbol);
                            break;
                        case A:
                            this._txt = $.t("{0} financials by TradingView").format(this._symbol);
                            break;
                        case L:
                            this._txt = $.t("More features on tradingview.com");
                            break;
                        case k:
                        case E:
                            this._txt = $.t("powered by ");
                            break;
                        case D:
                            this._showLogo = !0, this._txt = $.t("charts by TradingView");
                            break;
                        case O:
                            this._txt = $.t("powered by TradingView")
                    }
                }
            }, {
                key: "_drawTextStroke",
                value: function(t) {
                    var e, i;
                    this._strokeCanv || (this._strokeCanv = document.createElement("canvas"), e = this._strokeCanv.getContext("2d"), i = Math.round(this._strokeWidth * this._upscaleRatio), e.font = this._fontSize * this._upscaleRatio + this._font, this._textWidth = e.measureText(this._txt).width, this._strokeCanv.width = (this._textWidth + 2 * i) * H, e.textBaseline = "top", e.textAlign = "start", e.font = this._fontSize * this._upscaleRatio + this._font, e.strokeStyle = this._strokeColor, e.lineWidth = this._strokeWidth * this._upscaleRatio * H, e.lineJoin = "round", e.strokeText(this._txt, i, i), N && (e.lineWidth = this._strokeWidth * this._upscaleRatio * H / 2, e.strokeText(this._txt, i + 1.5, i), e.strokeText(this._txt, i - 1.5, i))), t.save(), t.globalAlpha = this._strokeOpacity, t.scale(1 / H, 1 / H), t.drawImage(this._strokeCanv, 0, 0, this._strokeCanv.width, this._strokeCanv.height, 0, 0, this._strokeCanv.width / this._upscaleRatio, this._strokeCanv.height / this._upscaleRatio), t.restore()
                }
            }, {
                key: "_drawTextFill",
                value: function(t) {
                    var e, i;
                    this._fillCanv || (this._fillCanv = document.createElement("canvas"), e = this._fillCanv.getContext("2d"), i = Math.round(this._strokeWidth * this._upscaleRatio), this._fillCanv.width = (this._textWidth + 2 * i) * H, e.textBaseline = "top", e.textAlign = "start", e.font = this._fontSize * this._upscaleRatio + this._font, e.fillStyle = this._fillСolor, e.fillText(this._txt, i, i)), t.save(), t.scale(1 / H, 1 / H), t.drawImage(this._fillCanv, 0, 0, this._fillCanv.width, this._fillCanv.height, 0, 0, this._fillCanv.width / this._upscaleRatio, this._fillCanv.height / this._upscaleRatio), t.restore()
                }
            }, {
                key: "draw",
                value: function(t) {
                    var e, i;
                    this._layout === k || this._layout === E ? (e = '12px "Trebuchet MS", Tahoma, Arial, sans-serif', t.font = e, i = t.measureText(this._txt).width, this.width = i + t.measureText("TradingView").width, t.save(), t.globalAlpha = .7, t.fillStyle = this._colorOldGray, t.fillText(this._txt, 0, 12), t.fillStyle = this._colorOldBlue, t.fillText("TradingView", i, 12), t.restore()) : this._showLogo && this._logoReady ? (t.drawImage(this._logo, -2, N ? -2 : -.5, this._logoWidth, this._logoHeight), t.save(), t.translate(this._logoWidth, 0), this._drawTextStroke(t), this._drawTextFill(t), t.restore(), this.width = this._logoWidth + this._strokeCanv.width / this._upscaleRatio / H) : (t.save(), t.translate(0, N ? 4 : 0), this._drawTextStroke(t), this._drawTextFill(t), t.restore(), this.width = this._strokeCanv.width / this._upscaleRatio / H)
                }
            }]), t
        }(), G = function() {
            function t(e) {
                var i = e.layout,
                    o = void 0 === i ? x : i,
                    n = e.src,
                    r = e.onReadyCallback;
                s(this, t), this._img = new Image, this._ready = !1, this.show = !1, this.width = 0, this.height = 0, this._layout = o, this._src = n, this._onReadyCallback = r, F && (this._init = l(this._init, this)), this._init()
            }
            return h(t, [{
                key: "_init",
                value: function() {
                    var t, e, i = this;
                    this._checkLayout(), this.show && (t = this._src.match(/(\w+)\.svg/), F && t && 2 === t.length ? (e = t[1], this._img.src = q.fallbackImages[e], this._img.addEventListener("load", function() {
                        var t = q.logoSizes;
                        e in t ? (i.width = t[e].width, i.height = t[e].height) : (i.width = 135, i.height = 25), i._ready = !0, "function" == typeof i._onReadyCallback && i._onReadyCallback()
                    })) : (this._img.src = this._src, this._img.addEventListener("load", function() {
                        i.width = Math.round(i._img.width),
                            i.height = Math.round(i._img.height), N && (i._img = a(i._img, i.width, i.height)), i._ready = !0, "function" == typeof i._onReadyCallback && i._onReadyCallback()
                    })))
                }
            }, {
                key: "_checkLayout",
                value: function() {
                    switch (this._layout) {
                        case k:
                        case I:
                        case E:
                        case M:
                        case O:
                        case V:
                            this.show = !0;
                            break;
                        case x:
                        case P:
                        case L:
                        case A:
                        case D:
                            this.show = !1
                    }
                }
            }, { key: "draw", value: function(t) { this._ready && t.drawImage(this._img, 0, 0, this.width, this.height) } }]), t
        }(), e.Branding = function() {
            function t(e) {
                var i, o = this;
                s(this, t), this._model = e, this._mainSeries = this._model.mainSeries(), this._paneHeight = 0, this._left = 13, this._bottom = 12, this._layout = x, this._needToShow = !0, this._customLogoSrc = "", this._checkLayout(), this._layout !== k && this._layout !== E || (this._left = 8, this._bottom = 5), i = function() { U = !!o._needToShow && (o._layout !== x || R.innerWidth() >= 768) }, i(), R.on("resize", (0, v.default)(i, 200)), this._model.isSnapshot() ? this._init() : this._mainSeries.onSymbolResolved().subscribe(this, this._init)
            }
            return h(t, [{
                key: "_init",
                value: function() {
                    var t = this,
                        e = this._mainSeries.symbolInfo() || {};
                    this._poweredBy = new Y({ layout: this._layout, symbol: e.name, model: this._model, onReadyCallback: function() { return t._model.fullUpdate() } }), this._customLogo = new G({ layout: this._layout, src: this._customLogoSrc, onReadyCallback: function() { return t._model.fullUpdate() } })
                }
            }, {
                key: "_checkLayout",
                value: function() {
                    var t, e, i;
                    p.enabled("widget") ? (t = W.logo || {}, e = p.enabled("fundamental_widget"), this._needToShow = !(W.whitelabel || z.whitelabel || t.whitelabel), t.image ? (this._customLogoSrc = C + t.image, t.no_powered_by ? this._layout = e ? M : I : this._layout = e ? E : k) : z.referral_id || z.no_referral_id ? this._layout = L : this._layout = e ? A : P) : p.enabled("charting_library") || p.enabled("amp_terminal") || p.enabled("cqg_terminal") || p.enabled("trading_terminal") ? (i = JSON.parse(z.logo) || {}, i.image ? (this._customLogoSrc = i.image, this._needToShow = p.enabled("widget_logo"), p.enabled("link_to_tradingview") ? this._layout = O : this._layout = V) : (this._layout = D, this._needToShow = p.enabled("widget_logo"))) : this._layout = x
                }
            }, { key: "updateAllViews", value: function() {} }, { key: "priceScale", value: function() {} }, { key: "priceAxisViews", value: function() {} }, { key: "onClickOutside", value: function() {} }, { key: "hasContextMenu", value: function() { return !1 } }, { key: "hitTest", value: function(t) { var e = this; return !U || p.enabled("logo_without_link") ? null : this._poweredBy && this._layout !== x && this._layout !== I && this._layout !== M && _.pointInRect(t, new _.Point(this._left, this._paneHeight - this._poweredBy.height - this._bottom), new _.Point(this._left + this._poweredBy.width, this._paneHeight - this._bottom)) ? new m.default(m.default.CUSTOM, { mouseUpHandler: function() { window.open(e.tvUrl(), "_blank").opener = null } }) : null } }, {
                key: "tvUrl",
                value: function() {
                    var t, e = "https://www.tradingview.com/";
                    if (this._layout === D || this._layout === O) {
                        switch (t = void 0, !0) {
                            case p.enabled("charting_library"):
                                t = "library";
                                break;
                            case p.enabled("trading_terminal"):
                            case p.enabled("amp_terminal"):
                            case p.enabled("cqg_terminal"):
                                t = "trading-terminal"
                        }
                        return e += "/" === e[e.length - 1] ? "?" : "&",
                            e += "utm_source=" + window.location.origin + "&utm_medium=library" + (t ? "&utm_campaign=" + t : "")
                    }
                    return e
                }
            }, {
                key: "draw",
                value: function(t) {
                    if (U) {
                        var e = 0;
                        this._poweredBy && this._poweredBy.show && (e = this._poweredBy.height, t.save(), t.translate(this._left, this._paneHeight - this._bottom - this._poweredBy.height), this._poweredBy.draw(t), t.restore()), this._customLogo && this._customLogo.show && (t.save(), t.translate(this._left, this._paneHeight - this._bottom - e - this._customLogo.height), this._customLogo.draw(t), t.restore())
                    }
                }
            }, { key: "renderer", value: function() { return this._paneHeight = j.height(), { draw: this.draw.bind(this) } } }, { key: "paneViews", value: function(t) { var e = p.enabled("move_logo_to_main_pane"); return e && t.isMainPane() || !e && t.isLast() || t.isMaximized() ? (j = t, [{ renderer: this.renderer.bind(this) }]) : [] } }]), t
        }()
}, function(t, e, i) {
    (function(t, o) {
        "use strict";

        function n(t) { return t && t.__esModule ? t : { default: t } }

        function s(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
        var r, a, l, h, c, d, p;
        Object.defineProperty(e, "__esModule", { value: !0 }), e.CompareTab = void 0, r = function() {
            function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
            return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
        }(), a = i(77), l = n(a), h = i(33), i(250), i(249), i(498), c = '\n\t<div class="tv-compare-tab">\n\t\t<input type="text" class="tv-control-input js-compare-tab-input" placeholder="' + $.t("Company Comparison") + '" autocomplete="off">\n\t</div>', d = '<div class="tv-compare-tab__predefines js-compare-tab-predefines"></div>', p = '\n\t<div class="tv-compare-tab__predefine-cell">\n\t\t<label for="{{symbolId}}">\n\t\t\t<span class="tv-control-checkbox">\n\t\t\t\t<input class="tv-control-checkbox__input js-predefine-checkbox" type="checkbox" id="{{symbolId}}">\n\t\t\t<span class="tv-control-checkbox__box tv-compare-tab__checkbox-box">' + i(382) + '</span>\n\t\t\t<span class="tv-control-checkbox__ripple js-ripple"></span>\n\t\t\t</span>\n\t\t\t<span class="tv-control-checkbox__label tv-compare-tab__checkbox-label">{{label}}</span>\n\t\t</label>\n\t</div>', e.CompareTab = function() {
            function e(t, i) { s(this, e), this._chartWidgetCollection = t, this._dialog = i, this._$popup = null, this._predefines = {}, this._symbolAlias = {}, this.init() }
            return r(e, [{ key: "addCompareSymbol", value: function(t, e, i) { var o, n, s, r, a, l, c = this._chartWidgetCollection.activeChartWidget.value(); if (c && (o = c.model())) { for (n = o.mainSeries().interval(), s = o.studiesMetaData(), r = void 0, a = 0; a < s.length; a++) "Compare@tv-basicstudies" === s[a].id && (r = s[a]); return l = { exchange: i, inputs: { symbol: t, resolution: n } }, (0, h.trackEvent)("GUI", "Add Compare"), o.insertStudy(r, l) } } }, {
                key: "removeCompareSymbol",
                value: function(t) {
                    var e, i = this,
                        o = this._chartWidgetCollection.activeChartWidget.value();
                    o && (e = o.model()) && e.dataSources().forEach(function(o) {
                        if (o._metaInfo && "Compare@tv-basicstudies" === o._metaInfo.id) {
                            var n = o.properties().inputs.symbol.value();
                            (n === t || i._symbolAlias[n] && i._symbolAlias[n] === t) && e.removeSource(o)
                        }
                    })
                }
            }, {
                key: "init",
                value: function() {
                    var e, i, o, n = this,
                        s = this._chartWidgetCollection.activeChartWidget.value();
                    s && (e = s.model()) && (i = e.dataSources(), this.$tab = $(c), this._initSymbolSearch(), t.enabled("charting_library_base") || (this._createPredefinesList(), o = this.$tab.find(".js-compare-tab-predefines"), o.find(".js-predefine-checkbox").attr("checked", !1), Object.keys(this._predefines).forEach(function(t) {
                        var e = n._symbolToId(t),
                            s = o.find("#" + e);
                        i.forEach(function(e) {
                            if (e._metaInfo && "Compare@tv-basicstudies" === e._metaInfo.id) {
                                var i = e.properties().inputs.symbol.value();
                                (i === t || n._symbolAlias[i] && n._symbolAlias[i] === t) && s.attr("checked", !0)
                            }
                        })
                    })))
                }
            }, {
                key: "_initSymbolSearch",
                value: function() {
                    var t = this;
                    this._$input = this.$tab.find(".js-compare-tab-input"), l.default.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() { if ($(e).is(":checked")) { i.addCompareSymbol(t.data.symbol) || $(e).attr("checked", !1) } else i.removeCompareSymbol(t.data.symbol) })
                    }
                    var e = this,
                        i = this,
                        n = $(d);
                    Object.keys(this._predefines).forEach(function(i) {
                        var s = $(o.render(p, { symbolId: e._symbolToId(i), label: e._predefines[i] }));
                        s.find(".js-predefine-checkbox").change({ symbol: i }, t), s.appendTo(n)
                    }), n.appendTo(this.$tab)
                }
            }, { key: "_symbolToId", value: function(t) { return t.replace(/[^a-z0-9]/gi, "_") } }, { key: "focus", value: function() { Modernizr.touch || this._$input.focus() } }, { key: "isClickOnTab", value: function(t) { return !!this._$popup && !(this._$popup[0] !== t.target && !this._$popup[0].contains(t.target)) } }]), e
        }()
    }).call(e, i(3), i(30))
}, , function(t, e, i) {
    "use strict";

    function o(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
    var n, s, r, a;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.ChartPage = void 0, n = function() {
        function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
        return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
    }(), s = i(258), r = i(41), a = i(3), e.ChartPage = function() {
        function t(e, i) {
            var n = this;
            if (o(this, t), this._$body = $(e.body.value()), 0 === this._$body.size()) throw Error("bridge.body.value() must be an element or not empty jQuery object");
            this._availableAreas = ["left", "dompanel", "right", "top", "footer", "bottom", "center"], this._areas = {}, this._bridge = e, this._width = e.width, this._height = e.height, this._visible = e.visible, this._width.subscribe(function() { return n.recalculate() }), this._height.subscribe(function() { return n.recalculate() }), this._bridge.visible.subscribe(function() { return n._updateVisibility() }), this._bridge.fullscreen.subscribe(function() { return n._onParentFullscreenChange() }), this.recalculate()
        }
        return n(t, [{
            key: "_updateVisibility",
            value: function() {
                var t, e, i, o = !!this._bridge.visible.value();
                for (t = 0; t < this._availableAreas.length; t++) e = this._availableAreas[t],
                    (i = this._areas[e]) && (o && this._affectsLayout(e) ? i.visible.setValue(!0) : i.visible.setValue(!1))
            }
        }, { key: "_onParentFullscreenChange", value: function() { this._bridge.fullscreen.value() || (this._fullscreenArea = null, this._updateFullscreen()) } }, {
            key: "_updateFullscreen",
            value: function() {
                var t, e, i, o = !!this._fullscreenArea;
                for (t = 0; t < this._availableAreas.length; t++) e = this._availableAreas[t], (i = this._areas[e]) && (e !== this._fullscreenArea ? i.body.value().toggleClass("js-hidden", o) : i.fullscreen.setValue(o));
                this._updateVisibility(), this.recalculate()
            }
        }, { key: "_createDOM", value: function(t) { var e = $("<div>").addClass("layout__area--" + t).css("position", "absolute"); return "bottom" === t ? e.css("bottom", 0) : e.css("top", 0), "right" === t || "dompanel" === t ? e.css("right", 0) : e.css("left", 0), e } }, {
            key: "allocate",
            value: function(t) {
                var e, i, o = this,
                    n = t && t.areaName;
                if (-1 === this._availableAreas.indexOf(n)) throw Error("unknown options.areaName");
                return this.free(n), e = this._createDOM(n), i = {
                    canNegotiate: { width: "left" === n || "right" === n || "dompanel" === n, height: "top" === n || "bottom" === n || "footer" === n },
                    negotiations: { width: [], height: [] },
                    remove: function() { for (var t in o._areas) o._areas[t] === i && o.free(t) },
                    negotiateWidth: function(t) { i.canNegotiate.width && (t = (0, s.processNegotiation)(t), (0, s.negotiationsAreEqual)(i.negotiations.width, t) || (i.negotiations.width = t, o.recalculate())) },
                    negotiateHeight: function(t) { i.canNegotiate.height && (t = (0, s.processNegotiation)(t), (0, s.negotiationsAreEqual)(i.negotiations.height, t) || (i.negotiations.height = t, o.recalculate())) },
                    requestFullscreen: function() { o._fullscreenArea || ("right" !== n && "center" !== n || (o._fullscreenArea = n), "center" === n && o._bridge.requestFullscreen(), o._updateFullscreen()) },
                    exitFullscreen: function() { n === o._fullscreenArea && (o._fullscreenArea = null, "center" === n && o._bridge.exitFullscreen(), o._updateFullscreen()) },
                    detach: function(t) {
                        var e = t.title;
                        i.rdState.detachToPopup({ title: e, useElementMetrics: i.body.value(), useStyles: i.body.value().prop("ownerDocument") })
                    },
                    width: new r,
                    height: new r,
                    availWidth: new r,
                    availHeight: new r,
                    alive: new r(!0),
                    body: new r(e),
                    detachable: new r(!0),
                    visible: new r(!0),
                    fullscreen: new r(!0)
                }, i.rdState = new s.ResizerDetacherState(i), this._areas[n] = i, i.rdState.owner.subscribe(function(t) {
                    var e, s, r, a = i.body.value();
                    if (t !== i) a.empty().detach();
                    else {
                        for (e = null, s = o._availableAreas.indexOf(n); s--;)
                            if (r = o._availableAreas[s], o._affectsLayout(r)) { e = o._areas[r].body.value(); break }
                        e ? a.insertAfter(e) : a.appendTo(o._$body)
                    }
                    o.recalculate()
                }, { callWithLast: !0 }), i.rdState.bridge()
            }
        }, {
            key: "free",
            value: function(t) {
                var e = this._areas[t];
                e && (this._areas[t] = null, $(e.body.value()).remove(), e.alive.setValue(!1))
            }
        }, { key: "_affectsLayout", value: function(t) { var e, i = this._areas[t]; return !!i && (i.rdState.owner.value() === i && ((!this._fullscreenArea || this._fullscreenArea === t) && !((this._width.value() <= 567 || this._height.value() <= 450) && (e = ["center", "top"], a.enabled("keep_left_toolbar_visible_on_small_screens") && e.push("left"), !e.includes(t))))) } }, {
            key: "recalculate",
            value: function() {
                var t, e, i, o, n, r, a, l, h, c, d, p, u, _, f, m, g = {};
                for (this._recalcSingleRunToken = g, t = {
                        width: this._width.value(),
                        height: this._height.value()
                    }, e = 0; e < this._availableAreas.length; e++)
                    if (i = this._availableAreas[e], o = this._areas[i], this._affectsLayout(i)) {
                        for ("center" === i ? (n = 0, this._affectsLayout("left") && (n += this._areas.left.width.value()), r = 0, this._affectsLayout("top") && (r += this._areas.top.height.value()), o.body.value().css({ left: n, top: r })) : "top" !== i && "bottom" !== i && "footer" !== i || (a = 0, this._affectsLayout("left") && (a += this._areas.left.width.value()), o.body.value().css({ left: a })), l = void 0, l = o.canNegotiate.width && !o.canNegotiate.height ? ["height", "width"] : ["width", "height"], h = 0; h < 2; h++) {
                            if (c = l[h], d = void 0, p = t[c], this._fullscreenArea === i) d = p;
                            else {
                                if ("bottom" === i && "height" === c && (p -= 5), "right" !== i && "dompanel" !== i || "width" !== c || (p -= 300), "width" === c ? o.availWidth.setValue(p) : "height" === c && o.availHeight.setValue(p), g !== this._recalcSingleRunToken) return;
                                o.canNegotiate[c] ? (d = (0, s.determineSize)(p, o.negotiations[c]), t[c] -= d) : d = p
                            }
                            if (o.body.value().css(c, d), o[c].setValue(d), g !== this._recalcSingleRunToken) return
                        }
                        o.body.value().toggleClass("js-hidden", !1)
                    } else o && o.body.value().toggleClass("js-hidden", !0);
                this._affectsLayout("footer") && (u = this._areas.footer, _ = this._height.value() - u.height.value(), this._affectsLayout("bottom") && (_ -= this._areas.bottom.height.value()), u.body.value().css({ top: _ })), this._affectsLayout("dompanel") && (f = this._areas.dompanel, m = 0, this._affectsLayout("right") && (m += this._areas.right.width.value()), f.body.value().css({ right: m }))
            }
        }]), t
    }()
}, function(t, e, i) {
    "use strict";

    function o(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
    var n, s, r;
    Object.defineProperty(e, "__esModule", { value: !0 }), n = function() {
        function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
        return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
    }(), s = i(41), r = function(t, e) {
        var i, o, n = ["fullscreenElement", "webkitFullscreenElement", "mozFullscreenElement", "mozFullScreenElement", "msFullscreenElement"];
        for (i = 0; i < n.length; i++)
            if ((o = n[i]) in t) { e.setValue(!!t[o]); break }
    }, e.FullscreenApi = function() {
        function t(e) {
            var i, n, a = this;
            if (o(this, t), this._document = e, this.isFullscreen = new s, r(e, this.isFullscreen), e.addEventListener)
                for (i = ["fullscreenchange", "webkitfullscreenchange", "mozfullscreenchange", "MSFullscreenChange"], n = 0; n < i.length; n++) e.addEventListener(i[n], function(t) { r(e, a.isFullscreen) }, !1)
        }
        return n(t, [{
            key: "enter",
            value: function() {
                var t, e, i = this._document,
                    o = ["requestFullscreen", "mozRequestFullScreen", "webkitRequestFullscreen", "msRequestFullscreen"];
                for (t = 0; t < o.length; t++)
                    if (e = o[t], "function" == typeof i.documentElement[e]) { i.documentElement[e](); break }
                this.isFullscreen.setValue(!0)
            }
        }, {
            key: "exit",
            value: function() {
                var t, e, i = this._document,
                    o = ["exitFullscreen", "mozCancelFullScreen", "mozExitFullscreen", "webkitExitFullscreen", "msExitFullscreen"];
                for (t = 0; t < o.length; t++)
                    if (e = o[t], "function" == typeof i[e]) { i[e](); break }
                this.isFullscreen.setValue(!1)
            }
        }]), t
    }()
}, function(t, e, i) {
    "use strict";

    function o(t, e) {
        if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
    }
    var n;
    Object.defineProperty(e, "__esModule", { value: !0 }), n = i(41), e.VisibilityApi = function t(e) {
        var i, s, r, a, l, h, c, d = this;
        for (o(this, t), this.isVisible = new n(!0), i = null, s = void 0, r = null, a = ["", "moz", "ms", "webkit"], l = 0; l < a.length; l++) h = a[l], (c = h ? h + "Hidden" : "hidden") in e && (i = c, s = h + "visibilitychange");
        i && (r = function() { d.isVisible.setValue(!e[i]) }, r(), e.addEventListener && e.addEventListener(s, r, !1)), this.destroy = function() { r && (e.removeEventListener(s, r, !1), r = null) }
    }
}, function(t, e, i) {
    "use strict";

    function o(t) {
        var e, i;
        if (t && t.__esModule) return t;
        if (e = {}, null != t)
            for (i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
        return e.default = t, e
    }

    function n(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
    var s, r, a, l, h;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.ButtonLoader = void 0, s = function() {
        function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
        return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
    }(), r = i(186), a = i(54), l = o(a), $.fn.tvButtonLoader = (0, r.createTvBlockWithInstance)("tv-button-loader", function(t, e) { return new h(t, e) }), h = e.ButtonLoader = function() {
        function t(e, i) { n(this, t), this.$btn = $(e).addClass("tv-button--loader"), 0 === this.$btn.find(".tv-button__loader").length && this.$btn.html('<span class="tv-button__text">' + this.$btn.html() + '</span><span class="tv-button__loader"><span class="tv-button__loader-item"></span><span class="tv-button__loader-item"></span><span class="tv-button__loader-item"></span></span>'), this.loading = this.$btn.hasClass("i-loading") }
        return s(t, [{
            key: "_start",
            value: function() {
                var t = this;
                this.starting = !0, this.$btn.addClass("i-start-load"), this.$btn.trigger("tv-button-loader:start"), setTimeout(function() { t.loading = !0, t.starting = !1, t._startPromise = !1, t.$btn.addClass("i-loading"), t.$btn.removeClass("i-start-load"), t._stopPromise && t._stop() }, 2 * l.dur)
            }
        }, { key: "start", value: function() { this.starting || (this.stopping ? this._startPromise = !0 : this._start()) } }, {
            key: "_stop",
            value: function() {
                var t = this;
                this.stopping = !0, this.$btn.addClass("i-stop-load"), this.$btn.trigger("tv-button-loader:stop"), setTimeout(function() { t.loading = !1, t.stopping = !1, t._stopPromise = !1, t.$btn.removeClass("i-loading i-start-load i-stop-load"), t._startPromise && t._start() }, l.dur)
            }
        }, { key: "stop", value: function() { this.stopping || (this.starting ? this._stopPromise = !0 : this._stop()) } }, { key: "toggle", value: function() { this.loading ? this.stop() : this.start() } }, { key: "contentHtml", value: function(t) { return t ? (this.$btn.find(".tv-button__text").html(t), t) : this.$btn.find(".tv-button__text").html() } }, { key: "contentNojQuery", value: function() { return this.$btn.get(0) } }, { key: "disable", value: function() { this.stop(), this.$btn.addClass("i-disabled") } }, { key: "enable", value: function() { this.$btn.removeClass("i-disabled") } }]), t
    }()
}, function(t, e, i) {
    "use strict";

    function o(t, e, i, o) {
        var r = (0, n.createConfirmDialog)({
                type: "modal",
                content: $.t("Do you really want to delete Chart Layout '{0}' ?").format(t),
                addClass: "delete-chart-dialog"
            }),
            a = function() {
                var t = o;
                o = null, t && t()
            };
        r.on("action:yes", function() { o = null, s.removeChart(e, i), r.close() }), r.on("action:no", a), r.on("afterClose", a), r.open()
    }
    var n, s;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.deleteChart = o, n = i(93), s = i(116)
}, function(t, e, i) {
    "use strict";

    function o(t) { var e = 0;!0 === t && (ChartApiInstance.disconnect(), e = 500), setTimeout(ChartApiInstance.connect.bind(ChartApiInstance), e) }

    function n(t, e, i, n) { l || (l = (0, r.createDialog)({ width: n || 600, closeOnOutsideClick: !1, destroyOnClose: !0, type: "modal", contentWrapTemplate: '<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text tv-text--position-outside"></div></div>', actionsWrapTemplate: '<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--actions-adaptive tv-dialog__section--no-border">', title: t, content: e, actions: [{ name: "reconnect", type: "primary", text: $.t("Reconnect") }, { name: "report", type: "primary", text: $.t("Report a data issue") }] }).on("action:reconnect", function(t) { t.close(), o(i) }).on("action:report", function(t) { t.close(), runOrSignIn(function() {}, { source: "Report data issue from disconnect dialog" }) }).on("destroy", function() { l = null }).open()) }

    function s() {
        (0, a.trackEvent)("System", "Critical Error"), n($.t("Oops, something went wrong"), $.t("Please report the issue or click Reconnect."), !0, 500)
    }
    var r, a, l;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.showCriticalErrorMessage = s, r = i(71), a = i(33), l = null
}, 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) {
    (function(t, o, n) {
        "use strict";

        function s(t) { return t && t.__esModule ? t : { default: t } }

        function r(t) {
            var e, i;
            if (t && t.__esModule) return t;
            if (e = {}, null != t)
                for (i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
            return e.default = t, e
        }

        function a(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }

        function l() { m.forEach(function(t) { return t.close() }) }
        var h, c, d, p, u, _, f, m, g, v, y, b, w, S, T;
        Object.defineProperty(e, "__esModule", { value: !0 }), e.TVDialogAbstract = void 0, h = Object.assign || function(t) { var e, i, o; for (e = 1; e < arguments.length; e++) { i = arguments[e]; for (o in i) Object.prototype.hasOwnProperty.call(i, o) && (t[o] = i[o]) } return t }, c = function() {
            function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
            return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
        }(), e.closeAllDialogs = l, d = i(54), p = r(d), i(539), u = i(187), _ = s(u), i(522), i(514), f = 0, m = [], g = void 0, v = 110, y = $(document), b = {
            closeOnEsc: !0,
            closeButton: !0,
            focusFirstControl: !0,
            closeOnOutsideClick: !0,
            closeButtonAddClass: "",
            focusClass: "i-focused",
            template: '<div class="tv-dialog">',
            errorTemplate: '<div class="tv-dialog__error i-slided{{# errorMod }} tv-dialog__error--{{ errorMod }}{{/ errorMod }}">{{{ error }}}</div>',
            titleTemplate: '<div class="tv-dialog__section tv-dialog__section--title js-dialog__drag"><div class="js-title-text tv-dialog__title">{{{ title }}}</div></div>',
            contentWrapTemplate: '<div class="tv-dialog__section tv-dialog__section--no-border">',
            actionsWrapTemplate: '<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">',
            closeButtonTemplate: '<div class="tv-dialog__close js-dialog__close">' + i(129) + "</div>",
            helpButtonTemplate: '<a href="{{{ link }}}" target="_blank" class="tv-dialog__help apply-common-tooltip" title="{{{ title }}}"></a>',
            helpActionsMod: "tv-dialog__section--actions_with-help"
        }, w = { default: "tv-button tv-button--default", primary: "tv-button tv-button--primary", success: "tv-button tv-button--success", danger: "tv-button tv-button--danger", warning: "tv-button tv-button--warning", link: "tv-button tv-button--link", checkbox: "tv-control-checkbox tv-control-checkbox--in-actions", "default-ghost": "tv-button tv-button--default_ghost", "primary-ghost": "tv-button tv-button--primary_ghost", "success-ghost": "tv-button tv-button--success_ghost", "danger-ghost": "tv-button tv-button--danger_ghost", "warning-ghost": "tv-button tv-button--warning_ghost" }, S = { _default: '<div data-name="{{ name }}" class="js-dialog__action-click {{ class }}">{{ text }}</div>', "submit-success": '<button type="submit" class="tv-button tv-button--success">{{ text }}</button>' }, $(function() { b.$wrap = $(document.all && !document.querySelector ? "html" : "body") }), T = function() {
            function e() {
                var i, s, r, l, c = this,
                    d = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
                for (a(this, e), t.extend(this, o), this.id = f++, this.loadingActions = [], this.disabledActions = [], this.firstFocusControl = null, this.options = h({}, b, d), this.$el = $(n.render(this.options.template, { title: this.options.title, closeButton: this.options.closeButton })), this.$el.addClass("js-dialog"), this.el = this.$el[0], this.options.addClass && this.$el.addClass(this.options.addClass), this.options.width && this.$el.css({ width: "100%", "max-width": this.options.width }), this.options.title && (this.$title = $(n.render(this.options.titleTemplate, { title: this.options.title })).appendTo(this.$el)), this.$content = $(this.options.contentWrapTemplate).appendTo(this.$el), this.$contentIn = this.$content; this.$contentIn.length;) this.$contentIn = this.$contentIn.children();
                if (this.$contentIn = this.$contentIn.end(), this.options.content && this.renderContent(this.options.content), (this.options.actions || this.options.help) && (this.$content.hasClass("tv-dialog__section") && this.$content.addClass("tv-dialog__section--no-padding_bottom"), this.$actions = $(this.options.actionsWrapTemplate).appendTo(this.$el)), this.options.actions)
                    for (this.actions = {}, this.$el.on("click", ".js-dialog__action-click", function(t) { c.actionDispatcher($(t.currentTarget).data("name")) }), i = function(t) {
                            var e, i, o, s, r, a, l = c.options.actions[t];
                            l.type || (l.type = "default"), l.class || (l.class = w[l.type] ? w[l.type] : w.default), "checkbox" === l.type ? (e = new _.default({ labelRight: l.text, name: l.name, checked: l.checked }), c.actions[l.name] = e.$el.appendTo(c.$actions), c.actions[l.name].on("change", function(t) { setTimeout(function() { return TVSettings.setValue("publish.showIntroText", !e.checked) }, 0) })) : c.actions[l.name] = $(n.render(l.template ? l.template : S[l.type] || S._default, l, l)).appendTo(c.$actions), l.method && "function" == typeof c[l.method] && c.on("action:" + l.name, c[l.method].bind(c)), l.addClass && c.actions[l.name].addClass(l.addClass), l.key && (i = void 0, "string" == typeof l.key && l.key.split("+").length > 1 ? (o = [], s = l.key.split("+"), i = function(t) { o = [] }, r = function(t) { var e = "" + t.keyCode; - 1 !== s.indexOf(e) && o.indexOf(e) && o.push(e), c.focused && o.length === s.length && (o = [], c.actionDispatcher(l.name)) }, c.on("afterOpen", function() { y.on("keydown", r), y.on("keyup", i) }), c.on("beforeClose", function() { y.off("keydown", r), y.off("keyup", i) })) : (a = $.isArray(l.key) ? l.key : [l.key], i = function(t) { c.focused && -1 !== a.indexOf(t.keyCode) && c.actionDispatcher(l.name) }, c.on("afterOpen", function() { return y.on("keyup", i) }), c.on("beforeClose", function() { return y.off("keyup", i) })))
                        }, s = this.options.actions.length - 1; s >= 0; s--) i(s);
                this.options.help && $(n.render(this.options.helpButtonTemplate, this.options.help)).prependTo(this.$actions.addClass(this.options.helpActionsMod)), this.options.closeButton && (r = $(this.options.closeButtonTemplate), r.addClass(this.options.closeButtonAddClass || ""), l = this.$el, 1 === this.$el.find(".js-close-button-place").length && (l = this.$el.find(".js-close-button-place")), r.appendTo(l)), this.setZIndex(v + m.length), d.errorMod && (this.errorMod = d.errorMod), this.on("afterOpen", function() { c.options.focusFirstControl && !Modernizr.touch && (c.firstFocusControl || c.$el.find('input:not([type="hidden"]), textarea').first()).focus() }), this.$el.on("click", ".js-dialog__close", this.close.bind(this)), this.$el.on("mousedown touchstart", this.focus.bind(this)), m.push(this)
            }
            return c(e, [{ key: "renderContent", value: function(t) { return this.$contentIn.html("function" == typeof t ? t(this) : t), this } }, { key: "setZIndex", value: function(t) { return this.zIndex = t, this.trigger("change:zIndex", this), this } }, { key: "toTop", value: function() { for (var t = m.length - 1; t >= 0; t--) m[t].zIndex > this.zIndex && m[t].setZIndex(m[t].zIndex - 1); return this.setZIndex(v + m.length), this } }, { key: "isEventOut", value: function(t) { var e, i, o; return this.options.isClickOutFn && void 0 !== (e = this.options.isClickOutFn(t)) ? e : (i = !0, o = $(t.target), o.get(0) !== this.$el.get(0) && ($(">*", this.$el).each(function() { o.get(0) === $(this).get(0) && (i = !1), 0 === o.closest("HTML", $(this).get(0)).length && (i = !1) }), i)) } }, {
                key: "focus",
                value: function() {
                    var t = this;
                    g !== this && (g && g.unfocus(), this.focused = !0, g = this, this.$el.addClass(this.options.focusClass), this.trigger("focus", this), setTimeout(function() { y.on("mousedown.tv-dialog-unfocus-" + t.id, function(e) { t.isEventOut(e) && (t.unfocus(), y.off("mousedown.tv-dialog-unfocus-" + t.id)) }) }, 20))
                }
            }, {
                key: "unfocus",
                value: function() {
                    this.focused = !1, g === this && (g = void 0),
                        this.$el.removeClass(this.options.focusClass).find(":focus").blur(), this.trigger("unfocus", this)
                }
            }, { key: "isFocused", value: function() { return this.focused } }, { key: "setTitle", value: function(t) { var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; return this.$title.toggleClass("tv-dialog__section--one-line apply-overflow-tooltip", e), this.$title.html(t), this } }, { key: "setTitleText", value: function(t) { this.$title.find(".js-title-text").text(t) } }, { key: "actionDispatcher", value: function(t) { this.disabledActions.includes(t) || this.loadingActions.includes(t) || this.trigger("action:" + t, this) } }, { key: "toggleAction", value: function(e, i) { return !i && this.disabledActions.includes(e) ? this.disabledActions.push(e) : i && this.disabledActions.includes(e) && (this.disabledActions = t.without(this.disabledActions, e)), this.actions[e].toggleClass("i-disabled", !i), this } }, {
                key: "actionLoader",
                value: function(e) {
                    var i = this,
                        o = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "init";
                    return this.actions[e].tvButtonLoader(o), "init" === o && (this.actions[e].off("tv-button-loader:start.dialog-action").on("tv-button-loader:start.dialog-action", function() { i.loadingActions.push(e) }), this.actions[e].off("tv-button-loader:stop.dialog-action").on("tv-button-loader:stop.dialog-action", function() { i.loadingActions = t.without(i.loadingActions, e) })), this
                }
            }, {
                key: "error",
                value: function(t) {
                    var e = $(n.render(this.options.errorTemplate, { error: t, errorMod: this.errorMod })).appendTo(this.$el),
                        i = function() { e.addClass("i-slided"), setTimeout(function() { return e.remove() }, .75 * p.dur) };
                    return setTimeout(function() { return e.removeClass("i-slided") }, 20), y.one("touchstart mousedown keydown", i), this.trigger("error", this, e), this
                }
            }, {
                key: "destroy",
                value: function() {
                    m = t.without(m, this);
                    for (var e = 0; e < m.length; e++) m[e].setZIndex(v + e);
                    this.trigger("destroy", this)
                }
            }, { key: "isOpened", value: function() { return !!this.opened } }]), e
        }(), e.TVDialogAbstract = T, y.on("keyup.tv-dialog-esc", function(t) { g && g.options.closeOnEsc && !$(".tv-dropdown__body.i-opened").length && 27 === t.keyCode && g.close() })
    }).call(e, i(130), i(166), i(30))
}, function(t, e, i) {
    (function(t) {
        "use strict";

        function o(t) { return t && t.__esModule ? t : { default: t } }

        function n(t) {
            var e, i;
            if (t && t.__esModule) return t;
            if (e = {}, null != t)
                for (i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
            return e.default = t, e
        }

        function s(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }

        function r(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 a(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)
        }

        function l() { return 0 !== g.length }
        var h, c, d, p, u, _, f, m, g, v;
        Object.defineProperty(e, "__esModule", { value: !0 }), e.TVModal = void 0, h = Object.assign || function(t) {
            var e, i, o;
            for (e = 1; e < arguments.length; e++) { i = arguments[e]; for (o in i) Object.prototype.hasOwnProperty.call(i, o) && (t[o] = i[o]) }
            return t
        }, c = function() {
            function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
            return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
        }(), e.isOpenedModals = l, d = i(54), p = n(d), u = i(188), _ = o(u), f = i(223), m = i(127), g = [], v = { ajax: {}, closingDuration: p.dur / 2, overlayTemplate: '<div class="tv-dialog__overlay"></div>', containerTemplate: '<div class="tv-dialog__modal-wrap"><div class="tv-dialog__modal-container"><div class="tv-dialog__modal-body"></div></div></div>', ajaxErrorTemplate: '<div class="tv-dialog__error js-dialog__close">' + $.t("Error") + "</div>" }, e.TVModal = function(e) {
            function i() {
                var t, e, o, n, a = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
                return s(this, i), t = r(this, (i.__proto__ || Object.getPrototypeOf(i)).call(this, h({}, v, a))), t.$overlay = $(t.options.overlayTemplate), t.$modalWrap = $(t.options.containerTemplate), t.$body = t.$modalWrap.find(".tv-dialog__modal-body").append(t.$el), t.options.closeOnOutsideClick && t.$overlay.add(t.$modalWrap).click(function(e) { t.isEventOut(e) && t.close() }), t.on("change:zIndex", function() { t.$overlay.css("z-index", t.zIndex), t.$modalWrap.css("z-index", t.zIndex) }), t.on("destroy", function() {
                    var e = function() { t.$overlay.remove(), t.$modalWrap.remove() };
                    t.opened ? (t.close(), setTimeout(e, t.options.closingDuration)) : e()
                }), t.on("beforeOpen", function() { g.push(t) }), t.options.ajax.url && (e = t.options.ajax.beforeSend || $.noop, o = t.options.ajax.success || !1, n = t.options.ajax.error || $.noop, $.extend(t.options.ajax, { beforeSend: function() { t.trigger("beforeLoading", t), t.startSpinner(), e(t) }, success: function(e) { t.trigger("afterLoading", t), t.renderContent(o ? o(t, e) : e).showContent(), t.trigger("afterLoadingShow", t) }, error: function() { t.renderContent(t.options.ajaxErrorTemplate), n(t), t.trigger("errorLoading", t) } })), t.on("error", function(e, i) { t.$modalWrap[0].getBoundingClientRect().height < t.$content[0].getBoundingClientRect().height && i.addClass("i-fixed").css({ width: t.$el.width() }) }), t
            }
            return a(i, e), c(i, [{ key: "open", value: function() { var t, e = this; if (!this.opened) return this.opened = !0, _.default.setFixedBodyState(!0), t = function() { e.focus(), e.toTop(), $("body").append(e.$overlay.addClass("i-hidden i-closed").css("z-index", e.zIndex)).append(e.$modalWrap.addClass("i-hidden i-closed").css("z-index", e.zIndex)), e.trigger("beforeOpen", e), e.$overlay.removeClass("i-hidden"), setTimeout(function() { e.$overlay.removeClass("i-closed") }, 20), e.options.ajax.url ? e.ajaxRequest = $.ajax(e.options.ajax) : e.showContent() }, _.default.isMobileSafari ? setTimeout(function() { return t() }, 50) : t(), this } }, {
                key: "close",
                value: function() {
                    var e = this;
                    if (this.opened) return this.opened = !1, this.trigger("beforeClose", this), this.ajaxRequest && (this.ajaxRequest.abort(), delete this.ajaxRequest), this.hideContent(), this.$overlay.addClass("i-closed"), setTimeout(function() {
                        e.$modalWrap.addClass("i-hidden").detach(), e.$overlay.addClass("i-hidden").detach(),
                            g = t.without(g, e), _.default.setFixedBodyState(!1), e.trigger("afterClose", e), e.unfocus(), g.length > 0 && g[g.length - 1].focus(), e.options.destroyOnClose && e.destroy()
                    }, this.options.closingDuration), this
                }
            }, { key: "showContent", value: function() { var t = this; return this.$modalWrap.removeClass("i-hidden"), setTimeout(function() { t.$modalWrap.removeClass("i-closed") }, 20), setTimeout(function() { t.trigger("afterOpen", t), t.spinner && t.stopSpinner() }, .75 * p.dur + 20), this } }, { key: "hideContent", value: function() { if (this.$el) return this.$modalWrap.addClass("i-closed"), this.unfocus(), this } }, { key: "startSpinner", value: function() { return this.spinner = (0, m.unifiedSpinner)("xlarge", { color: p.color.black255, zIndex: !1 }), this.spinner.spin(this.$overlay[0]), this } }, { key: "stopSpinner", value: function() { if (this.spinner) return this.spinner.stop(), delete this.spinner, this } }]), i
        }(f.TVDialogAbstract)
    }).call(e, i(130))
}, function(t, e, i) {
    "use strict";

    function o(t) { return t && t.__esModule ? t : { default: t } }

    function n(t) {
        var e, i;
        if (t && t.__esModule) return t;
        if (e = {}, null != t)
            for (i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
        return e.default = t, e
    }

    function s(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }

    function r(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 a(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)
    }
    var l, h, c, d, p, u, _, f, m, g, v, y;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.TVPopup = void 0, l = Object.assign || function(t) { var e, i, o; for (e = 1; e < arguments.length; e++) { i = arguments[e]; for (o in i) Object.prototype.hasOwnProperty.call(i, o) && (t[o] = i[o]) } return t }, h = function() {
        function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
        return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
    }(), c = i(54), d = n(c), p = i(188), u = o(p), _ = i(223), f = i(145), m = $("body"), g = $(window), v = { closeOnClickAtOtherDialogs: !0, draggable: !0, scrollWrap: '<div class="tv-dialog__scroll-wrap">', scrollWrapInner: '<div class="tv-dialog__scroll-wrap-inner">', withScroll: !0 }, y = "js-dialog__scroll-wrap", e.TVPopup = function(t) {
        function e() {
            var t, i = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
            return s(this, e), t = r(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, l({}, v, i))), t.$scrollWrap = t.$content.hasClass(y) ? t.$content : t.$content.find("." + y), t.$scrollWrap.length ? t.$scrollWrapInner = t.$scrollWrap.children().first() : (t.$scrollWrap = t.$content.wrap($(t.options.scrollWrap)).parent(), t.$scrollWrapInner = t.$content.wrap($(t.options.scrollWrapInner)).parent()), t.$actions && t.$scrollWrap.addClass("i-with-actions"),
                t.options.withScroll && (t.scroll = new f.SidebarCustomScroll(t.$scrollWrap, t.$scrollWrapInner), t.scroll.scrolled.subscribe(null, function() { return t.trigger("scroll") })), t.$scrollWrap.css("overflow", ""), t.$el.addClass("tv-dialog--popup i-closed i-hidden"), t.options.width && t.$el.css({ width: "calc(100% - 20px)", "max-width": t.options.width }), t.$el.on("mousedown touchstart", t.toTop.bind(t)), t.options.closeOnOutsideClick && (t.on("beforeOpen", function() {
                    setTimeout(function() {
                        t.opened && $(document).on("click.tv-popup-" + t.id, function(e) {
                            var i = $(e.target).closest(".js-dialog");
                            (t.options.closeOnClickAtOtherDialogs || 0 === i.length) && t.isEventOut(e) && t.close()
                        })
                    }, 0)
                }), t.on("beforeClose", function() { return $(document).off("click.tv-popup-" + t.id) })), t.on("change:zIndex", function() { t.$el.css("z-index", t.zIndex) }), t.on("destroy", function() {
                    var e = function() { t.$el.remove() };
                    t.opened ? (t.close(), setTimeout(e, d.dur / 2)) : e()
                }), t
        }
        return a(e, t), h(e, [{ key: "open", value: function() { var t = this; return this.opened ? this : (this.opened = !0, this.trigger("beforeOpen", this), this.$el.appendTo(this.options.$wrap).removeClass("i-hidden").css(function() { var e, i, o, n, s; return t.calcHeight(), e = g.height(), i = g.width(), o = t.$el.height(), n = t.$el.width(), s = t.options.position, s || (s = { top: e / 2 - o / 2, left: i / 2 - n / 2 }), s.top > e - o && (s.top = e - o), s.left > i - n && (s.left = i - n), s }()), this.focus(), this.toTop(), setTimeout(function() { t.opened && (t.$el.removeClass("i-closed"), t.options.draggable && (t.$el.draggable({ handle: ".js-dialog__drag", cancel: "input, textarea, button, select, option, .js-dialog__no-drag, .js-dialog__close", containment: "window", cursor: "-webkit-grabbing" }), t.$el.find(".js-dialog__drag").addClass("tv-dialog__grab"))) }, 20), this.$el.one("transitionend", function() { t.opened && t.trigger("afterOpen", t) }), g.on("resize.tv-popup-" + this.id, function() { t.calcHeight(), t.fixPos() }), this) } }, { key: "close", value: function() { var t = this; if (this.opened) return this.trigger("beforeClose", this), this.$el.addClass("i-closed"), this.opened = !1, this.$el.one("transitionend", function() { t.opened || (t.$el.draggable("destroy").addClass("i-hidden").detach(), m.css("cursor", "auto"), t.trigger("afterClose", t), t.options.destroyOnClose && t.destroy()) }), g.off("resize.tv-popup-" + this.id), this } }, {
            key: "fixPos",
            value: function() {
                var t = this.$el[0].getBoundingClientRect(),
                    e = {};
                t.bottom > u.default.height - 10 && (e.top = u.default.height - 10 - t.height, e.top < 10 && (e.top = 10)), t.right > u.default.width - 10 && (e.left = u.default.width - 10 - t.width, e.left < 10 && (e.left = 10)), (e.top || e.left) && this.$el.css(e)
            }
        }, {
            key: "calcHeight",
            value: function() {
                var t, e, i = this.$el[0].getBoundingClientRect(),
                    o = this.$scrollWrapInner[0].getBoundingClientRect(),
                    n = this.$scrollWrap[0].getBoundingClientRect(),
                    s = this.options.height && this.options.height < u.default.height - 20 ? this.options.height : u.default.height - 20;
                this.$scrollWrap.css({ height: "" }).removeClass("i-scrollable"), t = this.$el[0].getBoundingClientRect(), (this.options.height || t.height > s) && (s -= i.height - n.height, s < 60 && (s = 60), this.$scrollWrap.css({ height: s })), this.options.withScroll && this.scroll.resize(), e = s < o.height,
                    e || this.$scrollWrapInner.css("top", 0), this.$scrollWrap.toggleClass("i-scrollable", e), this.$actions && this.$actions.toggleClass("tv-dialog__section--actions_with-border", e)
            }
        }, { key: "updateScroll", value: function() { this.scroll && (this.scroll.updateScroll(), this.scroll.updateScrollBar()) } }, { key: "scrollToStart", value: function() { this.scroll && this.scroll.scrollToStart() } }]), e
    }(_.TVDialogAbstract)
}, function(t, e, i) {
    "use strict";

    function o(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
    var n, s;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.AutocompleteField = void 0, n = function() {
        function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
        return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
    }(), s = i(528), e.AutocompleteField = function() {
        function t(e) {
            var i = e.label,
                n = e.name,
                r = e.maxLength,
                a = e.error,
                l = void 0 === a ? "" : a,
                h = e.source,
                c = e.valueField,
                d = e.textField;
            o(this, t), this._name = n, this._valueField = c, this._textField = d, this._error = l, this._$field = $('<label class="tv-rename-chart-dialog__field">\n\t\t\t\t<span class="tv-rename-chart-dialog__label">' + i + '</span>\n\t\t\t\t<tv-autocomplete name="' + n + '"><tv-autocomplete>\n\t\t\t</label>'), this._autocomplete = new s.Autocomplete({ el: this._$field.find("tv-autocomplete").get(0), source: new s.ArraySource(h), textField: this._textField, maxLength: r }), this._preventDialogEvents()
        }
        return n(t, [{ key: "appendTo", value: function(t) { t.append(this._$field) } }, { key: "focus", value: function() { this._autocomplete.input.focus() } }, { key: "select", value: function() { this._autocomplete.input.focus(), this._autocomplete.input.select() } }, {
            key: "_preventDialogEvents",
            value: function() {
                var t = this,
                    e = function(t) { return t.stopPropagation() };
                this._autocomplete.stream.addListener(s.events.BEFORE_OPEN_MENU, function() { t._$field.on("keypress keyup", e) }), this._autocomplete.stream.addListener(s.events.AFTER_CLOSE_MENU, function() { t._$field.off("keypress keyup", e) })
            }
        }, { key: "value", get: function() { return this._autocomplete.value[this._valueField] } }, { key: "name", get: function() { return this._name } }, { key: "valid", get: function() { return !!this._autocomplete.input.value } }, { key: "error", get: function() { return this._error } }]), t
    }()
}, function(t, e, i) {
    "use strict";

    function o(t) { return t && t.__esModule ? t : { default: t } }

    function n(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
    var s, r, a;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.CheckboxField = void 0, s = function() {
        function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
        return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
    }(), r = i(187), a = o(r), e.CheckboxField = function() {
        function t(e) {
            var i = e.label,
                o = e.name,
                s = e.error,
                r = void 0 === s ? "" : s,
                l = e.hint;
            n(this, t), this._name = o, this._error = r, this._checkboxView = new a.default({ labelRight: i, name: o }), this._checkboxView.$el.addClass("tv-rename-chart-dialog__field"),
                l && this._checkboxView.$el.append('<span class="tv-rename-chart-dialog__hint apply-common-tooltip" title=\'' + l + "'></span>")
        }
        return s(t, [{ key: "appendTo", value: function(t) { t.append(this._checkboxView.$el) } }, { key: "focus", value: function() {} }, { key: "select", value: function() {} }, { key: "value", set: function(t) { this._checkboxView.checked = t }, get: function() { return this._checkboxView.checked } }, { key: "name", get: function() { return this._name } }, { key: "valid", get: function() { return !0 } }, { key: "error", get: function() { return this._error } }]), t
    }()
}, function(t, e, i) {
    "use strict";

    function o(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }

    function n(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 s(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)
    }
    var r, a;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.InputFieldRegExp = void 0, r = function() {
        function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
        return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
    }(), a = i(139), e.InputFieldRegExp = function(t) {
        function e(t) { var i, s; return o(this, e), i = t.regExp, delete t.regExp, s = n(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t)), s._regExp = i, s }
        return s(e, t), r(e, [{ key: "valid", get: function() { return this._regExp.test(this._$input.val()) } }]), e
    }(a.InputField)
}, function(t, e) {
    "use strict";

    function i(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
    var o;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = function() {
        function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
        return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
    }(), e.InputField = function() {
        function t(e) {
            var o = e.label,
                n = e.name,
                s = e.maxLength,
                r = e.error,
                a = void 0 === r ? "" : r;
            i(this, t), this._name = n, this._$field = $('<label class="tv-rename-chart-dialog__field">\n\t\t\t\t<span class="tv-rename-chart-dialog__label">' + o + '</span>\n\t\t\t\t<input class="tv-control-input" type="text" name="' + n + '" maxlength="' + s + '"/>\n\t\t\t</label>'), this._$input = this._$field.find("input"), this._error = a
        }
        return o(t, [{ key: "appendTo", value: function(t) { t.append(this._$field) } }, { key: "focus", value: function() { return this._$input.focus() } }, { key: "select", value: function() { return this.focus().select() } }, { key: "value", set: function(t) { this._$input.val(t) }, get: function() { return this._$input.val() } }, { key: "name", get: function() { return this._name } }, { key: "valid", get: function() { return !!this._$input.val() } }, { key: "error", set: function(t) { this._error = t }, get: function() { return this._error } }]), t
    }()
}, function(t, e, i) {
    "use strict";

    function o(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }
    var n, s;
    Object.defineProperty(e, "__esModule", { value: !0 }), e.SaveRenameDialog = void 0, n = function() {
        function t(t, e) { var i, o; for (i = 0; i < e.length; i++) o = e[i], o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) }
        return function(e, i, o) { return i && t(e.prototype, i), o && t(e, o), e }
    }(), i(523), s = i(71), e.SaveRenameDialog = function() {
        function t() {
            var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
                i = e.fields,
                n = e.title,
                s = void 0 === n ? "" : n,
                r = e.destroyOnClose,
                a = void 0 === r || r,
                l = e.modal,
                h = void 0 !== l && l;
            o(this, t), this._$form = $("<div></div>"), this._fields = i, this._appendFieldsToForm(), this._title = s, this._destroyOnClose = a, this._modal = h
        }
        return n(t, [{ key: "setField", value: function(t, e) { this._fields.find(function(e) { return e.name === t }).value = e } }, {
            key: "show",
            value: function() {
                var t = this,
                    e = this._createDialog(),
                    i = new Promise(function(i) { e.on("action:submit", function(e) { return t._onSubmit(e, i) }) });
                return e.open(), this._fields[0].select(), i
            }
        }, {
            key: "_appendFieldsToForm",
            value: function() {
                var t = this;
                this._fields.forEach(function(e) { e.appendTo(t._$form) })
            }
        }, { key: "_createDialog", value: function() { return (0, s.createDialog)({ type: this._modal ? "modal" : "popup", title: this._title, content: this._$form, actionsWrapTemplate: '<div class="tv-dialog__section tv-dialog__section--actions i-align_right tv-dialog__section--no-border">', width: 470, destroyOnClose: this._destroyOnClose, actions: [{ name: "submit", type: "primary", text: $.t("Save"), key: 13, addClass: "js-submit-button" }, { name: "cancel", type: "default", text: $.t("Cancel"), method: "close", addClass: "js-cancel-button" }] }) } }, {
            key: "_onSubmit",
            value: function(t, e) {
                var i = this._validate();
                i ? (t.error(i.error), i.focus()) : (e(this._collectValues(), t), t.close())
            }
        }, { key: "_validate", value: function() { return this._fields.find(function(t) { return !t.valid }) } }, { key: "_collectValues", value: function() { return this._fields.reduce(function(t, e) { return t[e.name] = e.value, t }, {}) } }]), t
    }()
}, , 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) {
    "use strict";

    function i(t, e, i) {
        var o, n, s, r, a = null,
            l = 0;
        return i = i || {}, r = function() { l = !1 === i.leading ? 0 : Date.now(), a = null, s = t.apply(o, n), a || (o = n = null) },
            function() { var h, c = Date.now(); return l || !1 !== i.leading || (l = c), h = e - (c - l), o = this, n = arguments, h <= 0 || h > e ? (a && (clearTimeout(a), a = null), l = c, s = t.apply(o, n), a || (o = n = null)) : a || !1 === i.trailing || (a = setTimeout(r, h)), s }
    }
    Object.defineProperty(e, "__esModule", { value: !0 }), e.default = i, t.exports = e.default
}, function(t, e) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 }), e.default = function(t) { return t.reduce(function(t, e, i) { return ~t.indexOf(e) || t.push(e), t }, []) }, t.exports = e.default
}, , , , , , , , , , , 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;
                    throw new SyntaxError("JSON.parse")
                })
            }()
    }).call(window)
}, , , 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"] },
        property_pages: { subsets: ["show_chart_property_page", "chart_property_page"] },
        show_chart_property_page: {},
        chart_property_page: { subsets: ["chart_property_page_style", "chart_property_page_scales", "chart_property_page_background", "chart_property_page_timezone_sessions", "chart_property_page_events_alerts", "chart_property_page_trading", "chart_property_page_template_button"] },
        disable_userlink_popup: {},
        left_toolbar: {},
        keep_left_toolbar_visible_on_small_screens: {},
        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: {},
        logo_without_link: {},
        right_bar_stays_on_scroll: {},
        chart_content_overrides_by_defaults: {},
        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: {},
        display_data_mode: {},
        show_chart_warn_message: {},
        datasource_copypaste: {},
        line_tool_templates: {},
        expand_symbolsearch_items: {},
        symbol_search_three_columns_exchanges: {},
        symbol_search_flags: {},
        symbol_search_limited_exchanges: {},
        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: {},
        bars_marks: {},
        chart_scroll: {},
        chart_zoom: {},
        source_selection_markers: {},
        high_density_bars: {},
        open_account_manager: {},
        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_content_overrides_by_defaults", "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", "property_pages", "support_multicharts", "display_market_status", "display_data_mode", "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", "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", "bars_marks", "chart_scroll", "chart_zoom", "screener_alerts", "source_selection_markers"]
        },
        browser_extension: { subsets: ["disable_userlink_popup", "show_pro_features", "show_saved_watchlists", "display_market_status", "display_data_mode", "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", "display_data_mode", "show_chart_warn_message", "symbol_info", "linetoolpropertieswidget_template_button", "symbol_search_three_columns_exchanges", "symbol_search_flags", "symbol_search_limited_exchanges", "widgetbar_tabs", "compare_symbol", "timezone_menu", "main_series_scale_menu", "show_login_dialog", "plain_studymarket", "japanese_chart_styles", "bars_marks", "chart_scroll", "chart_zoom", "source_selection_markers", "property_pages"]
        },
        bovespa_widget: { subsets: ["widget", "header_settings", "chart_property_page_timezone_sessions", "linetoolpropertieswidget_template_button"] },
        charting_library_base: { subsets: ["14851", "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", "bars_marks", "chart_scroll", "chart_zoom", "source_selection_markers", "property_pages"] },
        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", "footer_screenshot", "add_to_watchlist", "open_account_manager"]
        },
        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) {
    "use strict";
    $.fn.lastCharSup = function() {
        function t(e) {
            var i, o;
            if (3 === e.nodeType && e.data.trim()) return e;
            if (e.childNodes)
                for (i = e.childNodes.length; i--;)
                    if (o = t(e.childNodes[i])) return o;
            return null
        }
        var e, i, o, n, s;
        for (e = 0; e < this.size(); e++)
            if (i = t(this.get(e)), o = i.data, i) {
                if (i.parentNode && i.parentNode.tagName && "sup" === i.parentNode.tagName.toLowerCase()) continue;
                n = /^([^]*)(\S)(\s*)$/.exec(o), n && (i.data = n[1], s = $(document.createElement("sup")).text(n[2]).insertAfter(i), n[3] && $(document.createTextNode(n[3])).insertAfter(s))
            }
        return this
    }, t.exports = $
}, function(t, e, i) {
    "use strict";
    var o = i(53).UndoHistory,
        n = i(58),
        s = i(56),
        r = i(580),
        a = i(280),
        l = i(278),
        h = l.ChartApiInterface,
        c = l.HandlerInfo,
        d = i(35).requireFullInterfaceImplementation,
        p = i(12).getLogger("Chart.ChartApiLocal");
    TradingView.STUDY_COUNT_LIMIT = 120, JSServer.ChartApi = function(t) {
        this._notificationHandlers = [], this._sessions = [], this.studyCounter = 0, this._connected = !1, this._enabled = !1, this._studyEngine = new r(t), this._callbacks = {}, this._symbolIdCache = {}, this._seriesIdCache = {}, this._recentSeriesId = {}, this._enableLogging = !1, this._enabledMoreBarsRequest = !0, this._serverTimeOffset = 0, this._autosaveTimeoutSeconds = 5;
        var e = this;
        this._studyEngine.on("configuration_received", function() { e._fireEvent("configuration_received") }), this._studyEngine.on("realtime_tick", function(t) {
            var i = { time: t.value[0] / 1e3, open: t.value[1], high: t.value[2], low: t.value[3], close: t.value[4], volume: t.value[5] };
            e._fireEvent("realtime_tick", i, !0)
        }), this._autosavePaused = void 0, this._setupAutoSave()
    }, JSServer.ChartApi.prototype._makeSymbolKey = function(t, e) { if (!t || !e) throw Error("incorrect identifiers"); return t + "_" + e }, JSServer.ChartApi.prototype._makeSeriesKey = function(t, e) { if (!t || !e) throw Error("incorrect identifiers"); return t + "_" + e }, JSServer.ChartApi.prototype.destroy = function() { this._studyEngine.destroy(), this._studyEngine = null }, JSServer.ChartApi.prototype.purgeCache = function(t) { this._symbolIdCache = {}, this._studyEngine.purgeCache(), this._studyEngine.purgeRangeExtensionData(), this._studyEngine.purgeDataCache() }, JSServer.ChartApi.prototype.setAdditionalBarsRequestEnabled = function(t) { this._enabledMoreBarsRequest = t }, JSServer.ChartApi.prototype.setTimeFramesList = function(t) {
        var e, i, o, n, r, a, l, h;
        for (this._timeframes = [], e = /(\d+)(\w+)/, i = 0; i < t.length; ++i) o = t[i], n = e.exec(o.text), r = n[2].toLowerCase(), a = parseInt(n[1]), l = "y" === r ? 12 * a + "m" : a + r,
            h = s.Symbol.parsePeriod(o.resolution), this._timeframes.push({ text: $.t(o.title) || a + $.t(r, { context: "dates", count: a }), description: o.description || "", value: l, targetResolution: o.resolution, requiresIntraday: h.isIntraday })
    }, JSServer.ChartApi.prototype._setupAutoSave = function() {
        var t = this,
            e = !1;
        o.undoStack().onChange().subscribe(this, function() { t._autosavePaused ? e = !0 : (setTimeout(t._fireEvent.bind(t, "onAutoSaveNeeded", void 0, !0), 0), t._autosavePaused = setTimeout(function() { e && t._fireEvent("onAutoSaveNeeded", void 0, !0), t._autosavePaused = void 0, e = !1 }, 1e3 * t._autosaveTimeoutSeconds)) })
    }, JSServer.ChartApi.prototype.setAutoSaveDelay = function(t) { this._autosaveTimeoutSeconds = +t }, JSServer.ChartApi.prototype.defaultWatchlistSymbols = function() { return this._watchlistSettings.default_symbols }, JSServer.ChartApi.prototype.availableTimeFrames = function(t, e) { return t ? this._timeframes.filter(function(e) { return !(e.requiresIntraday && !t.has_intraday) && !(t.supported_resolutions && t.supported_resolutions.indexOf(e.targetResolution) < 0) }) : [] }, JSServer.ChartApi.prototype.defaultResolutions = function() { return this._studyEngine.supportedResolutions() || { 1: 1, 3: 1, 5: 1, 15: 1, 30: 1, 45: 1, 60: 1, 120: 1, 180: 1, 240: 1, D: 1, W: 1, M: 1 } }, JSServer.ChartApi.prototype.supportedSymbolsTypes = function() { return this._studyEngine.supportedSymbolsTypes() }, JSServer.ChartApi.prototype.supportedExchangesList = function() { return this._studyEngine.supportedExchangesList() }, JSServer.ChartApi.prototype.futuresRegex = function() { return this._studyEngine.futuresRegex() }, JSServer.ChartApi.prototype.start = function() { this._enabled = !0, this._fireEvent("start_enabled") }, JSServer.ChartApi.prototype._logMessage = function(t) { this._enableLogging && console.log(t) }, JSServer.ChartApi.prototype.unsubscribe = function(t, e) {
        var i = this._callbacks[t];
        i && i.splice(i.indexOf(e), 1)
    }, JSServer.ChartApi.prototype.on = function(t, e) { return this._callbacks.hasOwnProperty(t) || (this._callbacks[t] = []), this._callbacks[t].push(e), this }, JSServer.ChartApi.prototype._fireEvent = function(t, e, i) {
        var o, n;
        if (this._callbacks.hasOwnProperty(t))
            for (o = this._callbacks[t].slice(0), i || (this._callbacks[t] = []), n = 0; n < o.length; ++n) o[n](e)
    }, JSServer.ChartApi.prototype.chartCreateSession = function(t, e) {}, JSServer.ChartApi.prototype.chartDeleteSession = function(t) {}, JSServer.ChartApi.prototype.createSession = function(t, e) { TradingView.ChartapiMessagerInstances[t] = new a(this, t), this._sessions[t] = e, this._notificationHandlers[t] = e, this.connected() && e.onMessage({ method: "connected", params: [] }) }, JSServer.ChartApi.prototype.removeSession = function(t) { delete this._sessions[t], delete this._notificationHandlers[t], this.chartDeleteSession(t), this._studyEngine.stopSources(t) }, JSServer.ChartApi.prototype.connected = function() { return this._connected }, JSServer.ChartApi.prototype._getHost = function(t) { return t }, JSServer.ChartApi.prototype._getPort = function(t) { return t }, JSServer.ChartApi.prototype.connect = function() {
        if (!this._enabled) { var t = this; return void this.on("start_enabled", function() { t.connect() }) }
        this.connected() || (this._connected = !0, this.sessionid = "dummy session id",
            this._notifySessions({ method: "connected", params: [] }))
    }, JSServer.ChartApi.prototype.disconnect = function() { throw Error("This method is not implemented") }, JSServer.ChartApi.prototype.switchTimezone = function(t, e) {
        if (TradingView.ChartapiMessagerInstances[t].timezone() !== e && (TradingView.ChartapiMessagerInstances[t].setTimezone(e), this._recentSeriesId[t])) {
            this._studyEngine.purgeEndOfDataFlags(t, this._recentSeriesId[t]);
            var i = this;
            this._doWhenSeriesSymbolIdIsReady(t, this._recentSeriesId[t], function(e) {
                var o = i._seriesIdCache[i._makeSeriesKey(t, i._recentSeriesId[t])].resolution;
                i._studyEngine.recreateSources(e.name, o, t, !0), i._doWhenSeriesDataReceived(t, function() {
                    var o = i._seriesIdCache[i._makeSeriesKey(t, i._recentSeriesId[t])].resolution,
                        n = TradingView.ChartapiMessagerInstances[t].lastBarTime(i._recentSeriesId[t]);
                    n && i._studyEngine.rebuildExtrapolatedData(t, e.name, o, e.info, 1e3 * n)
                })
            })
        }
    }, JSServer.ChartApi.prototype.receiveLocalResponse = function(t) { this._logMessage("< " + t.method), this._dispathNotification(t), this._fireEvent("message_" + t.method, void 0, !0) }, JSServer.ChartApi.prototype.getMarks = function(t, e, i, o, n) { this._studyEngine.getMarks(t, e, i, o, n) }, JSServer.ChartApi.prototype.getTimescaleMarks = function(t, e, i, o, n) { this._studyEngine.getTimescaleMarks(t, e, i, o, n) }, JSServer.ChartApi.prototype.resolveSymbol = function(t, e, i, o, n) {
        function s(e, o) { TradingView.ChartapiMessagerInstances[t].onSymbolError(e, o), TradingView.ChartapiMessagerInstances[t].onSeriesClearData(0, ""), r._symbolIdCache[r._makeSymbolKey(t, e)] = { name: i, status: "invalid_symbol" }, r._fireEvent(r._makeSymbolKey(t, e) + "_resolve_fail"), r._fireEvent("resolve_fail", { session: t, symbolId: e }, !0) }
        this._notificationHandlers[t][e] = new c(o, e), this._symbolIdCache[this._makeSymbolKey(t, e)] = null;
        var r = this;
        this._studyEngine.resolveSymbol(i, function(o) {
            if (o.errmsg) return void s(e, o.errmsg);
            r._symbolIdCache[r._makeSymbolKey(t, e)] = { name: i, info: o, status: "ok" }, r._fireEvent(r._makeSymbolKey(t, e) + "_resolved", o), r._fireEvent("symbol_resolved", { symbolInfo: o, symbolId: e, session: t }, !0), TradingView.ChartapiMessagerInstances[t].onSymbolResolved(e, o)
        }, function(t) { s(e, t) })
    }, JSServer.ChartApi.prototype._doWhenSymbolIdIsReady = function(t, e, i) {
        function o() { return { name: s._symbolIdCache[s._makeSymbolKey(t, e)].name, info: s._symbolIdCache[s._makeSymbolKey(t, e)].info } }

        function n() { r && (i(o()), r = !1, s.unsubscribe(s._makeSymbolKey(t, e) + "_resolved", n), s.unsubscribe(s._makeSymbolKey(t, e) + "_resolve_fail", n)) }
        var s = this,
            r = !0;
        this._symbolIdCache[this._makeSymbolKey(t, e)] ? n() : (this.on(this._makeSymbolKey(t, e) + "_resolved", n), this.on(this._makeSymbolKey(t, e) + "_resolve_fail", n))
    }, JSServer.ChartApi.prototype._doWhenSeriesDataReceived = function(t, e) { TradingView.ChartapiMessagerInstances[t].seriesCompleted.subscribe(null, e, !0) }, JSServer.ChartApi.prototype._doWhenSeriesSymbolIdIsReady = function(t, e, i, o) {
        function n() { var e = h._symbolIdCache[h._makeSymbolKey(t, c)]; return { name: e.name, info: e.info } }

        function s() { i(n()) }

        function r() { h.unsubscribe("symbol_resolved", l), h.unsubscribe("resolve_fail", a) }

        function a(e) {
            e.symbolId === c && e.session === t && (r(), o && o())
        }

        function l(e) { e.symbolId === c && e.session === t && (r(), s()) }
        var h = this,
            c = this._seriesIdCache[t + "_" + e].symbolId;
        this._symbolIdCache[this._makeSymbolKey(t, c)] ? s() : (this.on("symbol_resolved", l), this.on("resolve_fail", a))
    }, JSServer.ChartApi.prototype.createSeries = function(t, e, i, o, n, r, a) {
        i = i || "";
        var l = this;
        this._notificationHandlers[t][e] = new c(function(r) {
            if ("series_completed" === r.method) {
                var h = s.Symbol.parsePeriod(n);
                h.range && l._applyRange(t, o, e, i, h.range)
            }
            a(r)
        }, e), this._recentSeriesId[t] = e, TradingView.ChartapiMessagerInstances[t].setResolution(s.Symbol.parsePeriod(n).pureResolution), this._seriesIdCache[t + "_" + e] = { symbolId: o, resolution: n, turnaround: i }, this._studyEngine.updateSeriesTurnaround(t, e, i), this._doWhenSeriesSymbolIdIsReady(t, e, function(o) { l._studyEngine.seriesTurnaround(t, e) === i && l._studyEngine.createSeries(o.name, n, t, e, i) })
    }, JSServer.ChartApi.prototype.removeSeries = function(t, e, i) { this._notificationHandlers[t][e] = new c(i, e), this._studyEngine.removeSeries(t, e) }, JSServer.ChartApi.prototype.setVisibleTimeRange = function(t, e, i, o, n) {
        function s() {
            var s, a;
            r = t.data(), s = [r.timeToBarIndex(i, TradingView.SEARCH_FROM_LEFT), r.timeToBarIndex(o, TradingView.SEARCH_FROM_RIGHT)], r.valueAt(s[1])[0] < o && t.syncModel() && (a = t.syncModel().distance(r.valueAt(s[1])[0], o), a.success && (s[1] += a.result)), TradingView.ChartapiMessagerInstances[e].onSeriesTimeframeUpdate(l, h._seriesIdCache[e + "_" + l].turnaround, s[0], s[1], !0), t.requestMoreData(), n && n()
        }
        var r = t.data(),
            a = !!r.timeToBarIndex(i, TradingView.SEARCH_FROM_LEFT),
            l = this._recentSeriesId[e],
            h = this;
        a ? s() : (this._studyEngine.ensureExtendedTo(l, e, i), this._doWhenSeriesDataReceived(e, s))
    }, JSServer.ChartApi.prototype._exactBarsCountOfTimeFrame = function(t, e) {
        var i, o = chartWidget.model().mainSeries().bars(),
            s = chartWidget.model().mainSeries().symbolInfo().session,
            r = o._valueAt(o.size() - 1)[0],
            a = n.alignPeriodsBack(s, t.resolution, t.interval, 1, 1e3 * r),
            l = o.size();
        for (a /= 1e3, i = 0, i = 0; i < l && !(o._valueAt(i)[0] > a); ++i);
        return l - i
    }, JSServer.ChartApi.prototype._applyRange = function(t, e, i, o, n) {
        var s, r, a, l = chartWidget.model().mainSeries().bars().size();
        0 !== l && (s = this._exactBarsCountOfTimeFrame(n, this._symbolIdCache[this._makeSymbolKey(t, e)].info), r = Math.max(0, l - 1 - s), a = Math.max(r, l - 1), TradingView.ChartapiMessagerInstances[t].onSeriesTimeframeUpdate(i, o, r, a))
    }, JSServer.ChartApi.prototype.modifySeries = function(t, e, i, o, n, r, a) {
        var l, h;
        i = i || "", l = this._seriesIdCache[t + "_" + e] ? this._seriesIdCache[t + "_" + e].resolution : void 0, TradingView.ChartapiMessagerInstances[t].setResolution(s.Symbol.parsePeriod(n).pureResolution), h = this, this._notificationHandlers[t][e] = new c(function(a) { var c, d; "series_completed" === a.method && (c = s.Symbol.parsePeriod(l), d = s.Symbol.parsePeriod(n), d.range && c.range !== d.range && h._applyRange(t, o, e, i, d.range)), r(a) }, e), this._recentSeriesId[t] = e, this._studyEngine.updateSeriesTurnaround(t, e, i), a && (this._seriesIdCache[this._makeSeriesKey(t, a)] = null), this._seriesIdCache[this._makeSymbolKey(t, e)] = { symbolId: o, resolution: n, turnaround: i }, this._doWhenSeriesSymbolIdIsReady(t, e, function(i) {
            h._studyEngine.purgeEndOfDataFlags(t, e), h._studyEngine.purgeRangeExtensionData(t), h._studyEngine.recreateSources(i.name, n, t, !0)
        })
    }, JSServer.ChartApi.prototype.requestMoreData = function(t, e, i, o) {
        if (this._enabledMoreBarsRequest) {
            var n = this;
            setTimeout(function() { n._notificationHandlers[t][e] = new c(o, e), n._studyEngine.extendSeriesRange(e, t, i) })
        }
    }, JSServer.ChartApi.prototype.setStudiesAccessController = function(t) { this.studiesAccessController = t }, JSServer.ChartApi.prototype.setWatchlistSettings = function(t) { this._watchlistSettings = t }, JSServer.ChartApi.prototype.allStudiesMetadata = function() { return this._studyEngine.studiesMetadata() }, JSServer.ChartApi.prototype.requestMetadata = function(t, e, i) {
        this._notificationHandlers[t][e] = new c(i, e);
        var o = this.studiesAccessController.getEnabledTools();
        TradingView.ChartapiMessagerInstances[t].onRequestMetadata(e, o)
    }, JSServer.ChartApi.prototype.isCanCreateStudy = function() { return this.studyCounter < TradingView.STUDY_COUNT_LIMIT }, JSServer.ChartApi.prototype.createStudy = function(t, e, i, o, n, s, r) {
        var a, l, h;
        if (!this.isCanCreateStudy()) throw Error("Exceeded the limit of studies");
        a = this, i = i || "", this._notificationHandlers[t][e] = new c(r, e), l = this._seriesIdCache[this._makeSeriesKey(t, o)].symbolId, h = this._seriesIdCache[this._makeSeriesKey(t, o)].resolution, this._doWhenSymbolIdIsReady(t, l, function(o) { a._studyEngine.createStudy(o.name, h, t, e, i, n, s), a.studyCounter++ })
    }, JSServer.ChartApi.prototype.rebindStudy = function(t, e, i, o, n, s, r, a) { throw Error("Not implemented") }, JSServer.ChartApi.prototype.removeStudy = function(t, e) { this._notificationHandlers[t][e] = null, this._studyEngine.removeStudy(t, e), this.studyCounter-- }, JSServer.ChartApi.prototype.modifyStudy = function(t, e, i, o, n) {
        var s = this;
        setTimeout(function() { i = i || "", s._notificationHandlers[t][e] = new c(n, e), s._studyEngine.recomputeStudy(e, o, t, i) }, 0)
    }, JSServer.ChartApi.prototype.createPointset = function(t, e, i, o, n, s, r) {
        i = i || "", this._notificationHandlers[t][e] = new c(r, e);
        var a = this;
        this._doWhenSymbolIdIsReady(t, o, function(i) { a._studyEngine.createPointset(t, e, i.info.full_name, i.info, n, s) })
    }, JSServer.ChartApi.prototype.modifyPointset = function(t, e, i, o, n) { throw Error("This call is not implemented") }, JSServer.ChartApi.prototype.removePointset = function(t, e, i) { this._notificationHandlers[t][e] = null, this._studyEngine.removePointset(e) }, JSServer.ChartApi.prototype.requestMoreTickmarks = function(t, e, i, o) {
        this._notificationHandlers[t][e] = new c(o, e);
        var n = this;
        this._doWhenSeriesSymbolIdIsReady(t, e, function(o) {
            var s = n._seriesIdCache[n._makeSeriesKey(t, e)].resolution;
            n._studyEngine.onMoreTickmarksRequested(t, o.name, o.info, s, i)
        })
    }, JSServer.ChartApi.prototype.requestFirstBarTime = function(t, e, i, o) { this._notificationHandlers[t][e] = new c(o, e) }, JSServer.ChartApi.prototype._invokeHandler = function(t, e) { t && t(e) }, JSServer.ChartApi.prototype._sendRequest = function(t, e) { throw Error("This method is not implemented") }, JSServer.ChartApi.prototype._onMessage = function(t) { throw Error("This method is not implemented") }, JSServer.ChartApi.prototype._convertTimescaleResponse = function(t) {
        var e, i = t.marks;
        for (e = 0; e < i.length; ++e) i[e] = { span: i[e][0], time: i[e][1], index: i[e][2] };
        return t
    }, JSServer.ChartApi.prototype._dispathNotification = function(t) {
        var e, i, o, n, s, r, a, l, h, c, d = t.params.shift();
        if (this._notificationHandlers[d]) switch (t.method) {
            case "timescale_update":
                e = t.params[0], i = t.params[1], o = this._convertTimescaleResponse(i), o.clear = 0 === i.changes.length && 0 === i.marks.length, this._notificationHandlers[d].onMessage({ method: "timescale_update", params: o });
                for (n in e) s = {}, s.customId = n, s.plots = e[n].series, e[n].ns && (s.nonseries = e[n].ns), s.turnaround = e[n].turnaround, r = { method: "data_update", params: s }, this._invokeNotificationHandler(d, n, r);
                break;
            case "tickmark_update":
                o = this._convertTimescaleResponse(t.params[0]), o.changes = [], this._notificationHandlers[d].onMessage({ method: "timescale_update", params: o });
                break;
            case "data_update":
                for (n in t.params[0]) {
                    a = t.params[0][n], s = {}, s.customId = n, s.plots = a.series ? a.series : a.plots, s.turnaround = a.turnaround, "s" in a && "ns" in a && (s.plots = a.s, s.nonseries = a.ns);
                    for (l = 0; l < s.plots.length; l++)
                        for (h in s.plots[l].value) 1e100 === s.plots[l].value[h] && (s.plots[l].value[h] = void 0);
                    r = { method: "data_update", params: s }, this._invokeNotificationHandler(d, n, r)
                }
                break;
            case "index_update":
                for (n in t.params[0]) r = { method: "index_update", params: t.params[0][n] }, this._invokeNotificationHandler(d, n, r);
                break;
            case "critical_error":
                p.logNormal(new Date + " critical_error session:" + this.sessionid + " reason:" + t.params[0]), this._notificationHandlers[d].onMessage({ method: "critical_error", params: t.params });
                break;
            case "quote_symbol_data":
            case "quote_list_fields":
            case "depth_symbol_error":
            case "depth_symbol_success":
            case "dd":
            case "dpu":
            case "depth_bar_last_value":
                this._notificationHandlers[d].onMessage({ method: t.method, params: t.params });
                break;
            default:
                c = t.params[0], this._invokeNotificationHandler(d, c, t)
        }
    }, JSServer.ChartApi.prototype._invokeNotificationHandler = function(t, e, i) {
        if (void 0 !== e) {
            var o = this._notificationHandlers[t][e];
            void 0 !== o && o && this._invokeHandler(o.handler, i), "series_deleted" !== i.method && "study_deleted" !== i.method || delete this._notificationHandlers[t][e]
        }
    }, JSServer.ChartApi.prototype.searchSymbols = function(t, e, i, o, n, s, r) { 0 === t.length && 0 === e.length && 0 === i.length && r([]), this._studyEngine.searchSymbols(t, e, i, r) }, JSServer.ChartApi.prototype._notifySessions = function(t) {
        var e, i;
        for (e in this._sessions) {
            if (!this._sessions.hasOwnProperty(e)) return;
            i = this._sessions[e], "function" == typeof i.onMessage && i.onMessage(t)
        }
    }, JSServer.ChartApi.prototype.unpack = function(t) { throw Error("This method is not implemented") }, JSServer.ChartApi.prototype.reconnectTimeout = function(t) { throw Error("This method is not implemented") }, JSServer.ChartApi.prototype.quoteCreateSession = function(t) { return this._studyEngine.quoteCreateSession(t) }, JSServer.ChartApi.prototype.quoteDeleteSession = function(t) { return this._studyEngine.quoteDeleteSession(t) }, JSServer.ChartApi.prototype.quoteSetFields = function(t, e) { return this._studyEngine.quoteSetFields(t, e) }, JSServer.ChartApi.prototype.quoteAddSymbols = function(t, e) {
        return -1 !== e.indexOf(void 0) && (console.warn("Got undefined in quoteAddSymbols"), e = e.filter(function(t) { return !!t })), this._studyEngine.quoteAddSymbols(t, e)
    }, JSServer.ChartApi.prototype.quoteRemoveSymbols = function(t, e) { return this._studyEngine.quoteRemoveSymbols(t, e) }, JSServer.ChartApi.prototype.quoteFastSymbols = function(t, e) { return this._studyEngine.quoteFastSymbols(t, e) }, JSServer.ChartApi.prototype.quoteHibernateAll = function(t) { return this._studyEngine.quoteHibernateAll(t) }, JSServer.ChartApi.prototype.depthCreateSession = function(t) { return this._studyEngine.depthCreateSession(t) }, JSServer.ChartApi.prototype.depthDeleteSession = function(t) { return this._studyEngine.depthDeleteSession(t) }, JSServer.ChartApi.prototype.depthSetSymbol = function(t, e) { return this._studyEngine.depthSetSymbol(t, e) }, JSServer.ChartApi.prototype.depthClearSymbol = function(t) {}, JSServer.ChartApi.prototype.depthSetScale = function(t, e) {}, JSServer.ChartApi.prototype.createStudiesAccessController = function(t, e, i) { return new this.StudiesAccessController(this._studyEngine, t && JSON.parse(t) || { type: "black", tools: [] }) }, JSServer.ChartApi.prototype.StudiesAccessController = function(t, e) { this._studyEngine = t, this._studiesAccess = e }, JSServer.ChartApi.prototype.StudiesAccessController.prototype._findTool = function(t) {
        var e, i, o = null;
        for (e = 0; e < this._studiesAccess.tools.length; ++e)
            if (i = this._studiesAccess.tools[e], i.name === t || i === t) { o = i; break }
        return o
    }, JSServer.ChartApi.prototype.StudiesAccessController.prototype.getEnabledTools = function() { return this._studyEngine.studiesMetadata().filter(function(t) { var e = this._findTool(t.description); return "black" === this._studiesAccess.type ? !e || e.grayed : !!e }, this) }, JSServer.ChartApi.prototype.StudiesAccessController.prototype.isToolGrayed = function(t) { var e = this._findTool(t); return e && e.grayed }, JSServer.ChartApi.prototype.serverTimeOffset = function() { return this._studyEngine.serverTimeOffset() }, JSServer.ChartApi.prototype.alignTimePoint = function(t, e, i) { return this._studyEngine.alignTimePoint(t, e, i) }, JSServer.ChartApi.prototype.disconnectCount = function() { return 0 }, d(JSServer.ChartApi, "JSServer.ChartApi", h, "ChartApiInterface"), t.exports = JSServer.ChartApi
}, function(t, e, i) {
    "use strict";
    var o = function() {
        function t(t, e, i) { return t + "," + e + "," + i }

        function e(e, i, o) { delete n[t(e, i, o)] }

        function o(e, i, o) {
            function r(t) { return "undefined" != typeof TradingView && TradingView.ChartapiMessagerInstances ? n[t] = new a(TradingView.ChartapiMessagerInstances[e], l.pureResolution) : n[t] = new a(null, l.pureResolution), n[t] }
            var l = s.Symbol.parsePeriod(o),
                h = t(e, i, l.pureResolution);
            return n[h] ? n[h] : r(h)
        }
        var n = {},
            s = i(56),
            r = i(58),
            a = function(t, e, i) { this._chartApiMessager = t, this._lastRealBarTime = null, this._lastRealBarIndex = null, this._resolution = e, this._extrapolatedBarsCache = [], this._onReadyCallbacks = [], this._requestedAmountOfBars = 0, this._maxDepth = i || 100 };
        return a.prototype.ready = function() { return null !== this._lastRealBarIndex }, a.prototype.rebuild = function(t, e) {
            this._lastRealBarTime = t;
            var i = Math.max(this._extrapolatedBarsCache.length, this._requestedAmountOfBars);
            this._extrapolatedBarsCache = [], this.ensureExtrapolatedToBar(e, i)
        }, a.prototype.historyExtrapolator = function() { return void 0 === this._historyExtrapolator && (this._historyExtrapolator = new a(null, this._resolution, Math.max(this._maxDepth, 1e3))), this._historyExtrapolator }, a.prototype.getPointTimeUTC = function(t, e, i) { var o, n; return 0 === e ? t : !this.ready() || t < this._lastRealBarTime / 1e3 ? (this.historyExtrapolator().setLastBarTime(0, 1e3 * t), this.historyExtrapolator().getPointTimeUTC(t, e, i)) : (o = 0 === this._extrapolatedBarsCache.length || t === this._lastRealBarTime / 1e3, n = o ? -1 : this.indexOfBar(t, i) - this._lastRealBarIndex - 1, this.ensureExtrapolatedToBar(i, n + e + 1), this._extrapolatedBarsCache[n + e]) }, a.prototype.findDistanceInBars = function(t, e, i) { return t === e ? 0 : (this.historyExtrapolator().setLastBarTime(0, 1e3 * t), this.historyExtrapolator().indexOfBar(e, i)) }, a.prototype.indexOfBar = function(t, e) { this._ensureExtrapolatedToTime(e, 1e3 * t); var i = r.lower_bound(this._extrapolatedBarsCache, t, function(t, e) { return t > e ? 1 : t < e ? -1 : 0 }); return -1 === i ? i : this._lastRealBarIndex + i + 1 }, a.prototype._extrapolateData = function(t, e) {
            var i, o, n;
            if (!this._lastRealBarTime) throw Error("No real bars known, so cannot extrapolate anything");
            if (!(i = e(this._lastRealBarTime)) || 0 === i.length) return void(null !== this._lastRealBarIndex && null !== this._chartApiMessager && this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex + 1, this._extrapolatedBarsCache, t, this._resolution));
            for (o = 0; o < i.length; ++o) i[o] = i[o] / 1e3;
            for (i[0] === this._lastRealBarTime / 1e3 && (i = i.slice(1)), this._extrapolatedBarsCache = i, n = i.slice(0), n.sort(), o = 0; o < n.length - 1; ++o) n[o] === n[o + 1] && console.error("Duplicating extrapolated bars: duplicated " + new Date(1e3 * n[o]));
            null !== this._lastRealBarIndex && null !== this._chartApiMessager && this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex + 1, i, t, this._resolution)
        }, a.prototype.onTickmarksNeeded = function(t, e) {
            if (this.ready()) this.ensureExtrapolatedToBar(t, e);
            else {
                var i = this;
                this._onReadyCallbacks.push(function() { i.ensureExtrapolatedToBar(t, e) })
            }
        }, a.prototype.ensureExtrapolatedToBar = function(t, e) { var i = this; return this._requestedAmountOfBars = e, this._extrapolateData(t, function(o) { return i._extrapolatedBarsCache.length >= e || !i._shouldExtrapolateMore() ? null : r.extrapolateBarsFrontByCount(i.newBarBuilder(t), o, e) }) }, a.prototype._ensureExtrapolatedToTime = function(t, e) { var i = this; return this._extrapolateData(t, function(o) { var n, s; return o >= e || !i._shouldExtrapolateMore() ? null : (n = 2e3, s = r.extrapolateBarsFrontToTime(i.newBarBuilder(t), o, e, n), s[s.length - 1] < e && console.warn("Extrapolation error: not enough data created"), s) }) }, a.prototype.newBarBuilder = function(t) { var e = s.Symbol.newSession(t.timezone, t.session); return s.Symbol.newBarBuilder(this._resolution, e) }, a.prototype._shouldExtrapolateMore = function() { return this._extrapolatedBarsCache.length < this._maxDepth }, a.prototype.setLastBarTime = function(t, e) {
            (null === this._lastRealBarIndex || this._lastRealBarIndex === t && this._lastRealBarTime !== e) && (this._extrapolatedBarsCache = []),
            this._extrapolatedBarsCache && this._extrapolatedBarsCache.length && this._lastRealBarIndex !== t && (this._lastRealBarIndex > t ? this._extrapolatedBarsCache = [] : this._lastRealBarTime !== e && this._extrapolatedBarsCache.shift(t - this._lastRealBarIndex)), this._lastRealBarIndex = t, this._lastRealBarTime = e;
            for (var i = 0; i < this._onReadyCallbacks.length; ++i) this._onReadyCallbacks[i]();
            this._onReadyCallbacks = []
        }, { remove: e, storage: o }
    }();
    t.exports = o
}, function(t, e) {
    "use strict";
    var i = function() {
        function t(t) { return t.is_price_study }

        function e(t, e) {
            var i, o = e.slice(0).toLowerCase();
            if (t) {
                for (i = 0; i < t.length; ++i)
                    if (t[i].description.toLowerCase() === o || t[i].shortDescription.toLowerCase() === o) return t[i];
                throw Error("Can't find metainfo for `" + e + "`")
            }
            throw Error("There is no studies metainfo at all")
        }

        function i(t) { return t.inputs.map(function(t) { return { id: t.id, type: t.type, name: t.name } }) }

        function o(o, n) { var s, a, l, h, c, d, p, u, _; if (!Array.isArray(o)) return s = e(n.model().studiesMetaData(), o), { id: s.id, overlay: t(s) }; for (a = o.slice(0), l = a[0], s = e(n.model().studiesMetaData(), l), h = t(s), c = i(s), p = a.splice(1), u = 0; u < p.length; ++u) d || (d = {}), _ = r[c[u].type] || r.string, d[c[u].id] = _(p[u]); return { id: s.id, name: l, overlay: h, inputs: d } }

        function n(t, o, n) {
            function s(t) { return t.name.toLowerCase() === a }
            var r, a, l, h = e(n.model().studiesMetaData(), t),
                c = i(h),
                d = {};
            for (r in o) a = r.toLowerCase(), l = c.filter(s), 0 !== l.length ? (l = l[0], d[l.id] = o[r]) : console.warn("Uknown input `" + r + "` of `" + t + "`");
            return { id: h.id, name: t, inputs: d }
        }
        var s = {},
            r = { bool: function(t) { return !!t }, integer: function(t) { return parseInt(t) }, float: function(t) { return parseFloat(t) }, string: function(t) { return t } };
        return s.getStudyRecordFromArray = function(t, e) { return e = e || chartWidget, o(t, e) }, s.getStudyRecordFromObject = function(t, e, i) { return i = i || chartWidget, n(t, e, i) }, s
    }();
    t.exports = i
}, function(t, e, i) {
    "use strict";
    var o = i(3);
    window.onload = function() {
        function t() { var t = 0; return JSON.parse(urlParams.logo).image && (t = "C", o.enabled("link_to_tradingview") || (t = "D")), t }

        function e() { try { return /^(192|172|10)\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]/.test(location.hostname) || /^.*((?:\.local)|localhost)$/.test(location.hostname) } catch (t) { return !1 } }
        location.hostname.indexOf(".") >= 0 && !e() && setTimeout(function() {
            try {
                var e = t();
                window.ga && 0 !== e && ga("send", "event", "s", e)
            } catch (t) {}
        }, 3e4)
    }
}, function(t, e, i) {
    (function(e) {
        "use strict";
        var o = i(58),
            n = {},
            s = function(t, i, s) {
                function r() {
                    var t = {};
                    t.symbolname = _, t.status = "ok", t.values = {}, t.values.current_session = p, n[_] = p, TradingView.ChartapiMessagerInstances[f].onQuotesData([f].concat([t]))
                }

                function a(t, i, n) {
                    var s = e.get_timezone(i);
                    h = (new o.Session).init(s, t), c = n, m = setTimeout(l, 6e4), l(), r()
                }

                function l() {
                    var t, e;
                    if (h) {
                        if (c) return void(p = "out_of_session");
                        t = o.isTradingNow(new Date, h), e = t ? "market" : "out_of_session", e !== p && (p = e, r())
                    }
                }
                var h, c, d = {},
                    p = n[s] || "out_of_session",
                    u = !1,
                    _ = s,
                    f = i,
                    m = null;
                return t.resolveSymbol(s, function(t) { u || a(t.session, t.timezone, t.expired) }, function() {}), d.stop = function() { u = !0, m && clearTimeout(m) }, d.marketStatus = function() { return p }, d
            };
        t.exports = s
    }).call(e, i(57))
}, function(t, e, i) {
    (function(e) {
        "use strict";
        var o = i(730).HeikenAshi,
            n = i(36).Interval,
            s = function() {
                function t(t) { this.host = t, this.cache = {} }

                function s(t) { var e = t.indexOf(","); return -1 === e ? t : t.slice(0, e) }

                function r(t, e, i, o, n) { return n + t + e + i + (a(o) ? "_" : "") }

                function a(t) { return t.has_empty_bars || t.force_session_rebuild }

                function l(t) { if (0 !== t.indexOf("=")) return { symbol: t }; var e; try { e = JSON.parse(t.slice(1)) } catch (e) { return { symbol: t } } return e.type && (0 === e.type.indexOf("BarSetHeikenAshi@tv-basicstudies-") ? e.builder = new o : console.error("unknown builder type: " + e.type)), "string" != typeof e.symbol && (e.session = e.symbol.session || e.session, e.symbol = e.symbol.symbol), e }

                function h(e) { t.instance = new t(e), u.setupFeed(t.instance) }
                var c, d, p, u = i(56),
                    _ = i(58),
                    f = u.Symbol,
                    m = u.StudyEngine,
                    g = u.BarBuilder,
                    v = u.BarSet;
                return t.prototype.getCache = function(t) { return this.cache[t] }, t.prototype.putCache = function(t, e) { this.cache[t] = e }, t.prototype.subscribe = function(t, e, i, o, n, s, a, l) {
                        var h = r(t, e, i, s, a),
                            c = this.getCache(h);
                        return c || (c = this.createItem(t, e, i, s, l), this.putCache(h, c)), c.listeners.addListener(o, n), { key: h, listener: o }
                    }, t.prototype.unsubscribe = function(t) {
                        var e = this.getCache(t.key);
                        e && e.listeners.removeListener(t.listener)
                    }, t.prototype.removeUnused = function() {
                        var t, e, i, o, n, s = [];
                        for (t in this.cache) this.cache[t] && (e = this.cache[t], 0 === e.listeners.listenersCount() && s.push(t));
                        if (0 !== s.length) {
                            for (i = 0; i < s.length; i++) o = s[i], n = this.cache[o], this.cache[o] = null, n.stop();
                            this.removeUnused()
                        }
                    }, t.prototype.rebuildFrom = function(t, e, i) {
                        var o, n, s, r, a = f.parsePeriod(t),
                            l = f.parsePeriod(e);
                        if ("" !== a.resolution && !a.isSeconds) { if (i.has_weekly_and_monthly) return a.resolution; if (void 0 === i.has_daily || i.has_daily) return "D"; "" !== l.resolution && (l.resolution = "", l.interval = i.intraday_multipliers ? i.intraday_multipliers[0] : 1) }
                        if (a.isIntraday && void 0 !== i.has_intraday && !i.has_intraday) return "";
                        if (a.isSeconds && !i.has_seconds) return "";
                        if (o = "" !== a.resolution ? l.interval : "" === l.resolution ? Math.min(a.interval, l.interval) : a.interval, (n = a.isIntraday ? i.intraday_multipliers : i.seconds_multipliers) && -1 === n.indexOf(o)) {
                            for (s = n.length - 1; s >= 0; s--)
                                if (r = +n[s], o % r == 0) return r + (a.isSeconds ? "S" : "");
                            return ""
                        }
                        return o + (a.isSeconds ? "S" : "")
                    }, t.prototype.createItem = function(t, e, i, o, r) {
                        var h, u, _, f, m, v, y = new p,
                            b = l(t);
                        return b.builder ? new d(y, b.symbol, e, i, b.builder, o, r) : (h = s(e), u = this.rebuildFrom(h, s(i), o), _ = a(o), !n.isEqual(h, u) || _ ? (f = o.has_empty_bars, m = $.extend({}, o), _ && (m.has_empty_bars = !1, m.force_session_rebuild = !1), new d(y, b.symbol, e, u, new g(e, f), m, r)) : (v = b.session && "extended" !== b.session, new c(y, b.symbol, e, i, v, this.host, o, r)))
                    }, c = function(t, e, i, o, n, r, a, l) {
                        this.listeners = t, this.host = r;
                        var h = this;
                        this.host.resolve(e, function(t) {
                            n && t.regular_session && (t.session = t.regular_session);
                            var r = h.calculateFromTo(t, o || i, e, l);
                            h.subs = h.host.subscribe(t, s(i), r, function(t) { h.listeners.fire(t) }, function(t) { h.listeners.onError(t) })
                        }, function(t) { h.listeners.onError(t) })
                    }, c.prototype._createDWMAligner = function(t, i) {
                        var o = e.get_timezone(i.timezone),
                            n = new _.Session;
                        return n.init(o, i.session), f.newBarBuilder(t, n, n)
                    },
                    c.prototype.stop = function() { this.subs && this.host.unsubscribe(this.subs) }, c.prototype.calculateFromTo = function(t, i, o, n) {
                        var s, r, a, l, h, c, d, p, u = f.parsePeriod(i),
                            m = (new Date).valueOf(),
                            g = t.expired ? e.cal_to_utc(e.get_timezone(t.timezone), new Date(1e3 * t.expiration_date)) || m : m;
                        return "" === u.resolution ? (r = u.interval, a = "D") : "S" === u.resolution ? (r = 10 * u.interval, a = "") : (l = "D" === u.resolution ? 1 : "W" === u.resolution ? 5 : 30, r = 12 * l * u.interval, a = "M"), u.range ? (r = u.range.interval, a = u.range.resolution) : this.host.calculateHistoryDepth && (h = this.host.calculateHistoryDepth(i, a, r)) && (r = h.intervalBack || r, a = void 0 === h.resolutionBack ? a : h.resolutionBack), c = t.sessionString || t.session, s = _.alignPeriodsBack(c, a, r, 1, g), n && n.getRangeExtensionTime && (d = n.getRangeExtensionTime()) && (s = Math.min(1e3 * d, s)), n && n.getRangeExtensionCount && (p = n.getRangeExtensionCount()) > 0 && (s = _.alignPeriodsBack(c, u.resolution, u.interval, p, s)), { from: s, to: g + 6e4 }
                    }, d = function(t, e, i, o, n, s, r) {
                        if (this.listeners = t, this.isRecalculated = !1, "" === o) return console.error("unsupported resolution for rebuild: " + i), void this.listeners.onError("unsupported resolution for rebuild: " + i);
                        this.symbolInfo = s;
                        var a = this;
                        this.engine = new m({ tickerid: e, period: o, periodBase: i, body: n, symbolInfo: s, rangeExtension: r, recalc: function(t, e) { a._recalc(e) }, out: function(t, e) { a._out(t, e) }, nonseriesOut: function(t, e) { a._nonseriesOut(t, e) }, setNoMoreData: function() { a.barset && (a.barset.endOfData = !0) }, onErrorCallback: function(t) { a.listeners.onError(t) } })
                    }, d.prototype.stop = function() { this.engine ? this.engine.stop() : console.error("Internal library error 0x1") }, d.prototype._recalc = function(t) { this.isRecalculated && console.error("recalc called twice!"), this.barset || (this.barset = new v(this.symbolInfo)), t && (this.barset.nextTime = t.nextTime, this.barset.endOfData = t.endOfData), this.listeners.fire(this.barset), this.isRecalculated = !0 }, d.prototype._nonseriesOut = function(t, e) {
                        var i = Object.assign({}, e);
                        i.nonseries = !0, i.data = e.bars, delete i.bars, i.barsetSize = this.barset ? this.barset.count() : 0, i.lastBar = this.barset ? this.barset.bar(this.barset.count() - 1) : null, this.listeners.fire(i, !0)
                    }, d.prototype._out = function(t, e) {
                        var i, o, n, s, r, a, l, h = e[0];
                        if (!isNaN(h)) {
                            if (i = { time: h, open: e[1], high: e[2], low: e[3], close: e[4], volume: e[5], updatetime: e[6] }, o = e[7], this.barset || (this.barset = new v(t.info)), (n = e[8]) instanceof Array)
                                for (s = 0; s < n.length; s++) r = e[9], a = n[s], l = { time: a, open: r, high: r, low: r, close: r, volume: 0, updatetime: a }, this.barset.add(l, !0), this.isRecalculated && this.listeners.fire(this.barset);
                            this.barset.add(i, o), this.barset.isBarClosed = o, this.isRecalculated && this.listeners.fire(this.barset)
                        }
                    }, p = function() { this.listeners = [] }, p.prototype.listenersCount = function() { return this.listeners.reduce(function(t, e) { return t + (e ? 1 : 0) }, 0) }, p.prototype.addListener = function(t, e) { this.listeners.push({ dataListener: t, onErrorCallback: e }), this.barset && t(this.barset), this.errorMsg && e(this.errorMsg) }, p.prototype.removeListener = function(t) {
                        var e, i = this.listeners.filter(function(e) { return e.dataListener === t });
                        0 !== i.length && (e = this.listeners.indexOf(i[0]), delete this.listeners[e])
                    },
                    p.prototype.onError = function(t) { var e, i, o, n; for (this.errorMsg = t || "unspecified error", e = this.listeners, i = e.length, o = 0; o < i; o++)(n = e[o]) && n.onErrorCallback && n.onErrorCallback(t) }, p.prototype.fire = function(t, e) { var i, o, n, s; for (e || (this.barset = t), i = this.listeners, o = i.length, n = 0; n < o; n++)(s = i[n]) && s.dataListener(t) }, { setupFeed: h, parseSymbol: l, unsubscribeUnused: function() { t.instance.removeUnused() } }
            }();
        t.exports = s
    }).call(e, i(57))
}, function(t, e, i) {
    "use strict";
    var o = i(56);
    i(141), JSServer.studyLibrary = JSServer.studyLibrary.concat([{ name: "Compare", metainfo: { _metainfoVersion: 15, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !0, defaults: { styles: { compare: { linestyle: 0, linewidth: 2, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#800080" } }, precision: 4, inputs: { source: "close", symbol: "" } }, plots: [{ id: "compare", type: "line" }], styles: { compare: { title: "Plot", histogramBase: 0 } }, description: "Compare", shortDescription: "Compare", is_price_study: !0, inputs: [{ defval: "close", id: "source", name: "Source", options: ["open", "high", "low", "close", "hl2", "hlc3", "ohlc4"], type: "text" }, { id: "symbol", name: "Symbol", type: "symbol" }], id: "Compare@tv-basicstudies-1" }, constructor: function() { this.init = function(t, e) { this._context = t, this._context.new_sym(e(1), o.Std.period(this._context), o.Std.period(this._context)) }, this.main = function(t, e) { var i, n, s, r, a; return this._context = t, i = this._context.new_var(this._context.symbol.time), this._context.select_sym(1), n = this._context.new_var(this._context.symbol.time), s = o.Std[e(0)](this._context), r = this._context.new_var(s), this._context.select_sym(0), a = r.adopt(n, i, 0), [a] } } }, { name: "Overlay", metainfo: { _metainfoVersion: 15, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !0, defaults: { styles: {}, precision: 4, inputs: {} }, plots: [{ id: "open", type: "line" }, { id: "high", type: "line" }, { id: "low", type: "line" }, { id: "close", type: "line" }], styles: { open: {}, high: {}, low: {}, close: {} }, description: "Overlay", shortDescription: "Overlay", is_price_study: !1, inputs: [{ id: "symbol", name: "symbol", defval: "", type: "symbol", isHidden: !0 }], id: "Overlay@tv-basicstudies-1" }, constructor: function() { this.init = function(t, e) { this._context = t, this._context.new_sym(e(0), o.Std.period(this._context), o.Std.period(this._context)) }, this.main = function(t, e) { var i, n, s, r, a, l; return this._context = t, i = this._context.new_var(this._context.symbol.time), this._context.select_sym(1), n = this._context.new_var(this._context.symbol.time), s = this._context.new_var(o.Std.open(this._context)), r = this._context.new_var(o.Std.high(this._context)), a = this._context.new_var(o.Std.low(this._context)), l = this._context.new_var(o.Std.close(this._context)), this._context.select_sym(0), [s.adopt(n, i, 0), r.adopt(n, i, 0), a.adopt(n, i, 0), l.adopt(n, i, 0)] } } }, {
        name: "Volume",
        metainfo: {
            _metainfoVersion: 15,
            isTVScript: !1,
            isTVScriptStub: !1,
            is_hidden_study: !1,
            transparency: 65,
            defaults: {
                styles: { vol: { linestyle: 0, linewidth: 1, plottype: 5, trackPrice: !1, transparency: 65, visible: !0, color: "#000080" }, vol_ma: { linestyle: 0, linewidth: 1, plottype: 4, trackPrice: !1, transparency: 65, visible: !0, color: "#0496FF" } },
                precision: 0,
                palettes: {
                    volumePalette: {
                        colors: {
                            0: {
                                color: "#FF0000",
                                width: 1,
                                style: 0
                            },
                            1: { color: "#008000", width: 1, style: 0 }
                        }
                    }
                },
                inputs: { showMA: !1, maLength: 20 }
            },
            plots: [{ id: "vol", type: "line" }, { id: "volumePalette", palette: "volumePalette", target: "vol", type: "colorer" }, { id: "vol_ma", type: "line" }],
            styles: { vol: { title: "Volume", histogramBase: 0 }, vol_ma: { title: "Volume MA", histogramBase: 0 } },
            description: "Volume",
            shortDescription: "Volume",
            is_price_study: !1,
            palettes: { volumePalette: { colors: { 0: { name: "Color 0" }, 1: { name: "Color 1" } } } },
            inputs: [{ id: "showMA", name: "show MA", defval: !1, type: "bool" }, { id: "maLength", name: "MA Length", defval: 20, type: "integer", min: 1, max: 2e3 }],
            id: "Volume@tv-basicstudies-1"
        },
        constructor: function() { this.f_0 = function(t, e) { return o.Std.gt(t, e) ? 0 : 1 }, this.f_1 = function(t, e) { return t ? e : o.Std.na() }, this.main = function(t, e) { var i, n, s, r, a, l, h; return this._context = t, this._input = e, i = this._input(0), n = o.Std.volume(this._context), s = this.f_0(o.Std.open(this._context), o.Std.close(this._context)), r = o.Std.volume(this._context), a = this._context.new_var(r), l = o.Std.sma(a, this._input(1), this._context), h = this.f_1(i, l), [n, s, h] } }
    }, { name: "ZigZag", metainfo: { _metainfoVersion: 23, isTVScript: !1, isTVScriptStub: !1, is_hidden_study: !1, defaults: { styles: { plot_0: { linestyle: 0, linewidth: 2, plottype: 0, trackPrice: !1, transparency: 35, visible: !0, color: "#008000" } }, precision: 4, inputs: { in_0: 5, in_1: 10 } }, plots: [{ id: "plot_0", type: "line" }, { id: "plot_1", target: "plot_0", type: "dataoffset" }], styles: { plot_0: { title: "Plot", histogramBase: 0, joinPoints: !1 } }, description: "Zig Zag", shortDescription: "ZigZag", is_price_study: !0, classId: "ScriptWithDataOffset", inputs: [{ id: "in_0", name: "deviation", defval: 5, type: "integer", min: 1, max: 100 }, { id: "in_1", name: "depth", defval: 10, type: "integer", min: 2, max: 1e3 }], id: "ZigZag@tv-basicstudies-1" }, constructor: function() { this.main = function(t, e) { var i, n, s, r, a, l, h, c; return this._context = t, this._input = e, i = this._input(0), n = this._input(1), s = i / 100, r = n / 2, a = o.Std.zigzag(s, r, this._context), l = o.Std.zigzagbars(s, r, this._context), h = a, c = l, [h, c] } } }])
}, function(t, e, i) {
    (function(e) {
        "use strict";
        var o = i(58),
            n = i(36).Interval,
            s = function() {
                function t(t, e) { return t }

                function s(t, e) {
                    var i = m.get_timezone(t.timezone),
                        n = new o.Session;
                    return n.init(i, t.session), f.Symbol.newBarBuilder(e, n, n)
                }

                function r(e, i, o, n, s, r) {
                    var a, l, h, c, d = t(i, o);
                    for (u.hasOwnProperty(d) || (u[d] = []), a = [], l = 0; l < n.length; ++l) n[l][1] < 0 && (n[l][1] = 0), 0 !== n[l][1] ? (h = s.getPointTimeUTC(n[l][0], n[l][1], r), a.push(h)) : n[l][0] && a.push(n[l][0]);
                    c = { guid: e, points: a }, u[d].push(c)
                }

                function a(t) {
                    var e, i, o;
                    for (e in u)
                        for (i = u[e], o = 0; o < i.length; ++o)
                            if (i[o].guid === t) return void i.splice(o, 1)
                }

                function l(t, e, i, o, n) {
                    var s, r, a, l = [];
                    for (s = 0; s < t.points.length; ++s) {
                        if (r = t.points[s], null === (a = c(e, r, i, o, n))) return null;
                        l.push({ index: s, value: [a, r] })
                    }
                    return l
                }

                function h(e, i, o, n, s, r) {
                    var a, h, c, d, p = t(e, i);
                    if (u.hasOwnProperty(p))
                        for (a = u[p].length, h = 0; h < a; ++h) c = u[p][h], null !== (d = l(c, o, n, s, i)) && r(c.guid, d)
                }

                function c(t, e, i, n, r) {
                    var a, l;
                    return 1e3 * (e = s(n, r).alignTimeIfPossible(1e3 * e) / 1e3) < t[0].value[0] ? -p(n, r, e, t[0].value[0] / 1e3, i) : (a = o.lower_bound(t, 1e3 * e, function(t, e) {
                        return t.value[0] > e ? 1 : t.value[0] < e ? -1 : 0
                    })) >= 0 && e < t[t.length - 1].value[0] ? (t[a].value[0] / 1e3 !== e && 0 !== a && a--, t[a].index) : (l = i.indexOfBar(e, n), -1 === l ? null : l)
                }

                function d(t, e, i, o, s) {
                    function r(t, e) {
                        var i = new Date(1e3 * t),
                            o = new Date(1e3 * e),
                            n = 12 * (o.getFullYear() - i.getFullYear());
                        return n -= i.getMonth() + 1, n += o.getMonth(), n <= 0 ? 0 : n
                    }
                    var a, l, h, c, d, p, u, _, f, g, v, y, b, w, S;
                    if (e.kind() === n.MONTHS) a = r(o, s) / e.multiplier();
                    else if (e.kind() === n.WEEKS) l = Math.ceil((s - o) / 604800), a = Math.ceil(l / e.multiplier());
                    else {
                        if (h = m.utc_to_cal(i.timezone, +new Date(1e3 * o)), c = m.utc_to_cal(i.timezone, +new Date(1e3 * s)), (d = (s - o) / 86400) > 4 * (7 - i.spec.weekEndsCount())) u = d / 7, p = u * (7 - i.spec.weekEndsCount());
                        else {
                            for (_ = 0, f = {}, g = h; g.valueOf() <= c.valueOf(); g = m.add_days_considering_dst(i.timezone, g, 1)) v = m.get_day_of_week(g), void 0 === f[v] && (f[v] = i.spec.isWeekEnd(v)), f[v] && _++;
                            p = d - _
                        }
                        if (e.kind() === n.DAYS) a = Math.ceil(p / e.multiplier());
                        else {
                            if (y = e.kind() === n.HOURS ? 60 * e.multiplier() * 60 : e.kind() === n.SECONDS ? e.multiplier() : 60 * e.multiplier(), d < 1 && (b = i.spec.findSession(m.get_day_of_week(h), m.get_minutes_from_midnight(h)), w = i.spec.findSession(m.get_day_of_week(c), m.get_minutes_from_midnight(c)), b === w)) return Math.ceil((s - o) / y);
                            v = i.spec.entries[0]._dayOfWeek, S = 60 * i.spec.entries.reduce(function(t, e) { return t + (e._dayOfWeek === v ? e._length : 0) }, 0), a = Math.ceil(p * S / y)
                        }
                    }
                    return a
                }

                function p(t, e, i, r, a) {
                    var l, h, c = new n(e),
                        p = m.get_timezone(t.timezone),
                        u = new o.Session;
                    return u.init(p, t.session), l = s(t, e), i = l.alignTimeIfPossible(1e3 * i) / 1e3, r = l.alignTimeIfPossible(1e3 * r) / 1e3, i >= r ? 0 : (h = d(t, c, u, i, r), h >= 1e3 ? h : a.findDistanceInBars(i, r, t))
                }
                var u = {},
                    _ = "undefined" != typeof window ? window : e,
                    f = i(56),
                    m = _.PineJsCalendar ? _.PineJsCalendar : i(57);
                return { createPointset: r, removePointset: a, broadcastPointsetsUpdates: h, tests: { approxBarsInterval: d, indexOfTime: c } }
            }();
        t.exports = s
    }).call(e, function() { return this }())
}, function(t, e, i) {
    (function(e, o) {
        "use strict";

        function n(t, i) {
            var o = e.get_timezone(i.timezone),
                n = new p.Session;
            return n.init(o, i.session), l.Symbol.newBarBuilder(t, n, n)
        }
        var s, r, a = i(576),
            l = i(56),
            h = i(577),
            c = i(573),
            d = i(579),
            p = i(58),
            u = i(36).Interval,
            _ = i(34);
        i(141), i(280), s = i(728).DatafeedRequestsCachedProcessor, r = function(t) {
            function e(t, e) { return !o.enabled("disable_resolution_rebuild") && u.isDWM(t) ? n(t, e) : null }

            function i(t, e, i) {
                return function(o) {
                    var s, r;
                    o && o.count() && (s = n(e, t), r = 1e3 * p.getCurrentUTCTime(), s.moveTo(r), s.indexOfBar(r) >= 0 && o.setLastBarClosed(!1)), i(o)
                }
            }

            function r(t, e, o, n, s) { return p._cachedDatafeed.subscribe(t, e, o, i(t, e, n), s) }

            function a(t) { return p._cachedDatafeed.unsubscribe(t) }

            function l(t, e, i) { p.resolveSymbol(t, e, i) }
            var p = this;
            this._studiesCache = {}, this._metainfoCache = [], this._barsCoefficientsCache = {}, this._extrapolationManager = c, this._externalDatafeed = t, this._datafeedConfiguration = null, this._marketStatusWatchers = {}, this._resolveRequests = {}, this._callbacks = {}, this._serverTimeOffset = 0, p._logMessage("Datafeed settings received: {0}".format(JSON.stringify(window.configurationData))), p._datafeedConfiguration = p._adoptConfigurationData(window.configurationData), p._fireEvent("configuration_received"),
                p._externalDatafeed.getServerTime && p._externalDatafeed.getServerTime(function(t) { p._serverTimeOffset = t - (new Date).valueOf() / 1e3 }), this._pointsetsManager = d, this._rangeExtensionData = {}, this._quotesInfo = [], this._depthInfo = [], this._fullNameSymbolInfoMap = {}, this._endOfData = {}, this._computeStudyCounter = 0, this._createDWMAligner = e, this._cachedDatafeed = new s(t, e), this._extendedRange = function(t) { return p._rangeExtensionData[t] && p._rangeExtensionData[t].summary }, this._extendedTime = function(t) { return p._rangeExtensionData[t] && p._rangeExtensionData[t].time }, h.setupFeed({ resolve: l, subscribe: r, unsubscribe: a, calculateHistoryDepth: this._externalDatafeed.calculateHistoryDepth ? this._externalDatafeed.calculateHistoryDepth.bind(this._externalDatafeed) : void 0 })
        }, r.prototype._barsCoefficients = function(t, e) { if (0 !== t.indexOf("=")) return {}; var i = t + e; return this._barsCoefficientsCache[i] || (this._barsCoefficientsCache[i] = {}), this._barsCoefficientsCache[i] }, r.prototype.destroy = function() { this._externalDatafeed = null }, r.prototype.purgeCache = function() { this._endOfData = {}, this._resolveRequests = {} }, r.prototype.purgeDataCache = function() { this._cachedDatafeed.purgeCache() }, r.prototype._logMessage = function(t) { o.enabled("charting_library_debug_mode") && console.log(t) }, r.prototype._extendRange = function(t, e) { this._rangeExtensionData[t] || (this._rangeExtensionData[t] = {}), void 0 === this._rangeExtensionData[t].summary && (this._rangeExtensionData[t].summary = 0), this._rangeExtensionData[t].summary += e }, r.prototype.on = function(t, e) { return this._callbacks.hasOwnProperty(t) || (this._callbacks[t] = []), this._callbacks[t].push(e), this }, r.prototype._fireEvent = function(t, e, i) {
            var o, n;
            if (this._callbacks.hasOwnProperty(t)) {
                for (o = this._callbacks[t], n = 0; n < o.length; ++n) o[n](e);
                i || (this._callbacks[t] = [])
            }
        }, r.prototype._adoptConfigurationData = function(t) {
            var e, i, o, n = TradingView.merge({}, t),
                s = n.supported_resolutions;
            if (!s || 0 === s.length) return n.supported_resolutions = void 0, n;
            for (e = {}, i = 0; i < s.length; i++) {
                if (o = s[i], e.hasOwnProperty(o)) throw Error("Duplicating resolution `" + o + "`");
                e[o] = 1
            }
            return n.supported_resolutions = e, n
        }, r.prototype.supportedResolutions = function() { return this._datafeedConfiguration.supported_resolutions }, r.prototype.supportedSymbolsTypes = function() { return this._datafeedConfiguration.symbols_types || [] }, r.prototype.supportedExchangesList = function() { return this._datafeedConfiguration.exchanges || [] }, r.prototype.futuresRegex = function() { return this._datafeedConfiguration.futures_regex || /$a/ }, r.prototype._findStudyObject = function(t) {
            var e = t.split("@")[0],
                i = JSServer.studyLibrary.filter(function(i) { return i.metainfo.id === t || i.metainfo.shortDescription === e });
            if (0 === i.length) throw Error("Study `" + t + "` not found");
            return i[0]
        }, r.prototype.getMarks = function(t, e, i, o, n) {
            function s(t) {
                function e(e, i) { return isArray(t[e]) ? t[e][i] : t[e] }
                var i, o;
                if (isArray(t)) return t;
                for (i = [], o = 0; o < t.id.length; ++o) i.push({ id: e("id", o), time: e("time", o), color: e("color", o), text: e("text", o), label: e("label", o), labelFontColor: e("labelFontColor", o), minSize: e("minSize", o) });
                return i
            }
            var r, a = {
                red: 6,
                green: 5,
                blue: 4,
                yellow: 3
            };
            this._externalDatafeed.getMarks && this._datafeedConfiguration.supports_marks && (this._logMessage("Requesting bars marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(t.full_name, n, new Date(1e3 * e).toUTCString(), new Date(1e3 * i).toUTCString())), r = this, this._externalDatafeed.getMarks(t, e, i, function(e) {
                var i, l, h = s(e).map(function(t) { return t.time = parseInt(t.time), t });
                r._logMessage("Received bars marks: symbol {0}, resolution {1}, marks {2}".format(t.full_name, n, JSON.stringify(h))), i = r._createDWMAligner(n, t), l = h.map(function(t) { return t.tickmark = null !== i ? i.tradingDayToSessionStart(1e3 * t.time) / 1e3 : t.time, t.direction = a[t.color], t.onClicked = function() { _.emit("onMarkClick", t.id) }, t.label = !!t.label && t.label[0], t }), o(l)
            }, n))
        }, r.prototype.getTimescaleMarks = function(t, e, i, o, n) {
            if (this._externalDatafeed.getTimescaleMarks && this._datafeedConfiguration.supports_timescale_marks) {
                this._logMessage("Requesting timescale marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(t.full_name, n, new Date(1e3 * e).toUTCString(), new Date(1e3 * i).toUTCString()));
                var s = this;
                this._externalDatafeed.getTimescaleMarks(t, e, i, function(e) {
                    var i, r;
                    s._logMessage("Received timescale marks: symbol {0}, resolution {1}, marks {2}".format(t.full_name, n, JSON.stringify(e))), i = s._createDWMAligner(n, t), r = e.map(function(t) { return t.tickmark = null !== i ? i.tradingDayToSessionStart(1e3 * t.time) / 1e3 : t.time, t }), o(r)
                }, n)
            }
        }, r.prototype._computeStudy = function(t, e, i, o, n, s, r, a, h, c) {
            function d(t, e) {
                switch (t.type) {
                    case "projection":
                        return c(t, e);
                    default:
                        return console.warn("Unexpected non-series output type: " + t.type)
                }
            }

            function p(t, e, i) {
                var o, n, s, r, l = t.time,
                    h = "number" == typeof e ? [e] : e;
                for (o = 0; o < h.length; ++o) n = h[o], n && "object" == typeof n && (m["plot_" + o] = n.offset, n = n.value, g++), "number" == typeof n && isNaN(n) && (n = void 0), h[o] = n;
                s = f.length - 1, r = s < 0 || l > f[s].value[0], r ? f.push({ index: f.length, value: [l].concat(h) }) : f[s].value = [l].concat(h), u || a([f[f.length - 1]], r, f.length, m, i)
            }
            var u = !0,
                _ = this._computeStudyCounter++,
                f = [],
                m = {},
                g = 0,
                v = !1,
                y = this,
                b = function(a) {
                    var c;
                    if (l.Symbol.parsePeriod(o).isIntraday && !a.has_intraday) return void h("Unsupported resolution");
                    if (c = new l.StudyEngine({ tickerid: i, symbolInfo: a, period: o, body: e, sessionId: t, onErrorCallback: h, rangeExtension: { getRangeExtensionCount: y._extendedRange.bind(this, t), getRangeExtensionTime: y._extendedTime.bind(this, t) }, input: function(t) { return s[t] }, out: function(t, e) { p(t, e, a) }, nonseriesOut: function(t) { d(t, a) }, setNoMoreData: function() { v = !0 }, recalc: function(t, e) { u = !1, f.endOfData = v, r(f, g > 0 ? m : void 0, a, e) } }), !y._studiesCache[t] || !y._studiesCache[t][n]) throw Error("This should never happen");
                    y._studiesCache[t][n].engine = c
                },
                w = function(t) { h(t) },
                S = function() { return y._studiesCache[t] && y._studiesCache[t][n] && y._studiesCache[t][n].activeResolve === _ };
            y._studiesCache[t][n].activeResolve = _, this.resolveSymbol(i, function() { S() && b.apply(y, arguments) }, function() { S() && w.apply(y, arguments) })
        }, r.prototype._createStudy = function(t, e, i, o, n, s, a) {
            function l(t) {
                var e, i, s;
                if (Array.isArray(t)) return t;
                for (e = [], i = h._studiesCache[o][n].metainfo.inputs,
                    s = 0; s < i.length; s++) e[s] = t[i[s].id];
                return e
            }
            var h = this;
            a = l(a), TradingView.ChartapiMessagerInstances[o].onStudyLoading(n, s), h._computeStudy(o, i, t, e, n, a, function(i, r, a) { TradingView.ChartapiMessagerInstances[o].onDataUpdate(n, s, h._convertBarsTimeToUnix(i), r, a, h._extendedRange(t, e)), TradingView.ChartapiMessagerInstances[o].onStudyCompleted(n, s) }, function(i, r, a, l, c) { TradingView.ChartapiMessagerInstances[o].onDataUpdate(n, s, h._convertBarsTimeToUnix(i), l, c, h._extendedRange(t, e)) }, function(t) { TradingView.ChartapiMessagerInstances[o].onStudyError(n, t) }, r.prototype._updateProjectionData.bind(this, o, n, s))
        }, r.prototype.purgeEndOfDataFlags = function(t, e) { for (var i in this._studiesCache[t]) e && e !== i || (this._studiesCache[t][i].firstBarTime = null) }, r.prototype.stopSources = function(t) {
            var e, i;
            for (e in this._studiesCache[t])(i = this._studiesCache[t][e]) && (i.engine && i.engine.stop(), i.activeResolve = -1);
            h.unsubscribeUnused()
        }, r.prototype.recreateSources = function(t, e, i, o) {
            var n, s;
            this.stopSources(i);
            for (n in this._studiesCache[i])(s = this._studiesCache[i][n]) && (s.symbol = t, s.resolution = e, "series" === s.type && this.createSeries(t, e, i, n, s.turnaround, o));
            for (n in this._studiesCache[i])(s = this._studiesCache[i][n]) && "study" === s.type && this._createStudy(t, e, s.studyObject, i, n, s.turnaround, s.inputs)
        }, r.prototype.removeStudy = function(t, e) { this._studiesCache[t] && this._studiesCache[t][e] && this._studiesCache[t][e].engine && (this._studiesCache[t][e].engine.stop(), h.unsubscribeUnused()), this._studiesCache[t][e] = null }, r.prototype.removeSeries = function(t, e) { this.removeStudy(t, e) }, r.prototype.recomputeStudy = function(t, e, i, o) {
            var n = this._studiesCache[i][t];
            if (!n) throw Error("This should never happen");
            n.inputs = e, n.turnaround = o, n.engine && n.engine.stop(), this._createStudy(n.symbol, n.resolution, n.studyObject, i, t, o, e)
        }, r.prototype._convertBarsTimeToUnix = function(t) { var e, i, o = []; for (e = 0; e < t.length; ++e) i = { index: t[e].index, value: [].concat(t[e].value) }, i.value[0] /= 1e3, o.push(i); return o.endOfData = t.endOfData, o }, r.prototype.createStudy = function(t, e, i, o, n, s, r) {
            var a = this._findStudyObject(s),
                l = new a.constructor;
            this._studiesCache[i] = this._studiesCache[i] || {}, this._studiesCache[i][o] = { studyObject: l, symbol: t, resolution: e, guid: o, type: "study", inputs: r, metainfo: a.metainfo, turnaround: n }, this._createStudy(t, e, l, i, o, n, r)
        }, r.prototype.purgeRangeExtensionData = function(t) { t ? this._rangeExtensionData[t] = { summary: 0 } : this._rangeExtensionData = {} }, r.prototype.ensureExtendedTo = function(t, e, i) {
            var o, n = this._studiesCache[e][t];
            if (!n) throw Error("This should never happen");
            this.purgeRangeExtensionData(e), this._rangeExtensionData[e] || (this._rangeExtensionData[e] = {}), this._rangeExtensionData[e].time = i, o = this, setTimeout(function() { o.recreateSources(n.symbol, n.resolution, e, !0) }, 0)
        }, r.prototype.extendSeriesRange = function(t, e, i) {
            var o, n, s, r, a = this._studiesCache[e][t];
            if (!a) throw Error("This should never happen");
            if (this._isEndOfData(e, t, a.turnaround)) return o = a.engine.runner.host.symbolInfo.data_status, void setTimeout(function() {
                TradingView.ChartapiMessagerInstances[e].onSeriesCompleted(t, a.turnaround, o)
            }, 0);
            i += 10, n = this._barsCoefficients(a.symbol, a.resolution), s = n.barsCoefficient || 1, this._extendRange(e, i * s), n.barsCoefficient || (n.expectedBarsCount = this._extendedRange(e)), r = this, setTimeout(function() { r.recreateSources(a.symbol, a.resolution, e, !0) }, 0)
        }, r.prototype._updateProjectionData = function(t, e, i, o) {
            var n = o.barsetSize ? this._convertBarsTimeToUnix([{ index: o.barsetSize - 1, exTime: o.lastBar ? o.lastBar[0] / 1e3 : 0, value: o.lastBar }]) : null;
            TradingView.ChartapiMessagerInstances[t].onProjectionUpdate(e, i, o, n)
        }, r.prototype.updateSeriesTurnaround = function(t, e, i) { this._studiesCache[t] || (this._studiesCache[t] = {}), this._studiesCache[t][e] || (this._studiesCache[t][e] = {}), this._studiesCache[t][e].type = "series", this._studiesCache[t][e].turnaround = i }, r.prototype.seriesTurnaround = function(t, e) { return this._studiesCache[t] && this._studiesCache[t][e] && this._studiesCache[t][e].turnaround }, r.prototype.createSeries = function(t, e, i, n, s, r) {
            function a(t, o, n) { h._extrapolationManager.storage(i, t.full_name, e).setLastBarTime(o, n) }
            var h, c = t,
                d = new l.OHLCV;
            this._studiesCache[i] = this._studiesCache[i] || {}, this._studiesCache[i][n] = { symbol: t, resolution: e, studyObject: d, guid: n, type: "series", turnaround: s }, TradingView.ChartapiMessagerInstances[i].onSeriesLoading(n, s), h = this, this._computeStudy(i, d, c, e, n, [], function(o, l, c, d) {
                var p, u, _, f, m, g, v = h._studiesCache[i][n];
                if (!v) throw Error("This should never happen");
                if (p = h._convertBarsTimeToUnix(o), u = p.length > 0 ? 1e3 * p[0].value[0] : void 0, d.nextTime && (!u || d.nextTime < u / 1e3)) return void h.ensureExtendedTo(n, i, d.nextTime);
                0 !== p.length && (v.firstBarTime = u, _ = h._barsCoefficients(t, e), _.expectedBarsCount && _.barsCount && (_.barsCoefficient = Math.min(Math.max(_.barsCoefficient || 1, parseInt(_.expectedBarsCount / (p.length - _.barsCount) + .5)), 100)), _.barsCount = p.length, f = p[p.length - 1], a(c, p.length - 1, 1e3 * f.value[0]), h.rebuildExtrapolatedData(i, t.name, e, c, 1e3 * f.value[0]), r && TradingView.ChartapiMessagerInstances[i].onSeriesClearData(n, s), TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(n, s, p, c, 0), m = h._extrapolationManager.storage(i, c.full_name, e), Promise.resolve().then(function() { h._pointsetsManager.broadcastPointsetsUpdates(c.full_name, e, o, m, c, function(t, e) { TradingView.ChartapiMessagerInstances[i].onPointsetDataUpdate(t, s, e, c) }) })), g = 0 === p.length || d && d.endOfData, g && (h._logMessage("Series has no more data on server: {0}".format(c.full_name)), h._setEndOfData(i, n, s), 0 === p.length && TradingView.ChartapiMessagerInstances[i].onSeriesClearData(n, s)), TradingView.ChartapiMessagerInstances[i].onSeriesCompleted(n, s, c.data_status)
            }, function(t, o, r, l, c) {
                var d, p = h._convertBarsTimeToUnix(t),
                    u = p[p.length - 1];
                if (o) {
                    if (!h._studiesCache[i][n]) throw Error("This should never happen");
                    d = r - 1, h._logMessage("New bar arrived: symbol {0}, bar {1}".format(c.full_name, JSON.stringify(u))), TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(n, s, [u], c, d), a(c, d, 1e3 * u.value[0]), h.rebuildExtrapolatedData(i, c.full_name, e, c, 1e3 * u.value[0])
                } else h._logMessage("Last bar update: symbol {0}, bar {1}".format(c.full_name, JSON.stringify(u))),
                    TradingView.ChartapiMessagerInstances[i].onDataUpdate(n, s, p, void 0, c);
                h._fireEvent("realtime_tick", t[t.length - 1], !0)
            }, function(t) { h._logMessage("Series error: {0}".format(t)), TradingView.ChartapiMessagerInstances[i].onSeriesError(n, t), o.enabled("clear_bars_on_series_error") && TradingView.ChartapiMessagerInstances[i].onSeriesClearData(n, s) }, function(t, o) {
                var r, l, c, d, p, u, _ = t.projectionTime / 1e3,
                    f = -1;
                if ((t.data || []).forEach(function(t) { f = Math.max(f, t[0] || 0) }), f = Math.min(f, 100), r = t.barsetSize, _ && f >= 0 && r && t.lastBar) {
                    for (l = [], c = 0; c <= f; c++) l.push(_ + .001 * c);
                    d = t.lastBar.slice(0), d[0] = d[0] / 1e3, TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(n, s, [{ index: r - 1, value: d }], o, r - 1, l), p = r + f, u = 1e3 * Math.trunc(l[f]), a(o, p, u), h.rebuildExtrapolatedData(i, o.full_name, e, o, u)
                }
                h._updateProjectionData(i, n, s, t)
            })
        }, r.prototype.onMoreTickmarksRequested = function(t, e, i, o, n) { this._extrapolationManager.storage(t, i.full_name, o).onTickmarksNeeded(i, n) }, r.prototype.removePointset = function(t) { this._pointsetsManager.removePointset(t) }, r.prototype.rebuildExtrapolatedData = function(t, e, i, o, n) { this._extrapolationManager.storage(t, o.full_name, i).rebuild(n, o) }, r.prototype.createPointset = function(t, e, i, o, n, s) {
            var r = this._extrapolationManager.storage(t, o.full_name, n);
            this._pointsetsManager.createPointset(e, i, n, s, r, o)
        }, r.prototype.studiesMetadata = function() {
            return 0 === this._metainfoCache.length && (this._metainfoCache = JSServer.studyLibrary.map(function(t) { return t.metainfo }), this._metainfoCache.push({ palettes: {}, inputs: [{ defval: "close", id: "source", name: "Source", options: ["open", "high", "low", "close", "hl2", "hlc3", "ohlc4"], type: "text" }, { defval: "ATR", id: "style", name: "Style", options: ["ATR", "Traditional"], type: "text" }, { defval: 5, id: "boxSize", max: 1.7976931348623157e308, min: 1e-4, name: "BoxSize", type: "float", visible: "style==Traditional" }, { defval: 14, id: "atrLength", max: 100, min: 1, name: "AtrLength", type: "integer", visible: "style==ATR" }], plots: [{ id: "open", type: "line" }, { id: "high", type: "line" }, { id: "low", type: "line" }, { id: "close", type: "line" }, { id: "volume", type: "line" }], graphics: {}, defaults: { inputs: { atrLength: 14, boxSize: 5, source: "close", style: "ATR" }, precision: "4" }, _metainfoVersion: 28, description: "Unnamed Study", id: "BarSetRenko@tv-prostudies", is_hidden_study: !0, is_price_study: !1, shortDescription: "Unnamed Study", description_localized: "Unnamed Study", shortId: "BarSetRenko", packageId: "tv-prostudies", version: "13", fullId: "BarSetRenko@tv-prostudies-13", productId: "tv-prostudies", name: "BarSetRenko@tv-prostudies" }), this._metainfoCache.push({
                palettes: {},
                inputs: [{ defval: "close", id: "source", name: "Source", options: ["open", "high", "low", "close", "hl2", "hlc3", "ohlc4"], type: "text" }, { defval: 3, id: "lb", max: 100, min: 1, name: "Lb", type: "integer" }],
                plots: [{ id: "open", type: "line" }, { id: "high", type: "line" }, { id: "low", type: "line" }, { id: "close", type: "line" }, { id: "volume", type: "line" }],
                graphics: {},
                defaults: { inputs: { lb: 3, source: "close" }, precision: "4" },
                _metainfoVersion: 28,
                description: "Unnamed Study",
                id: "BarSetPriceBreak@tv-prostudies",
                is_hidden_study: !0,
                is_price_study: !1,
                shortDescription: "Unnamed Study",
                description_localized: "Unnamed Study",
                shortId: "BarSetPriceBreak",
                packageId: "tv-prostudies",
                version: "13",
                fullId: "BarSetPriceBreak@tv-prostudies-13",
                productId: "tv-prostudies",
                name: "BarSetPriceBreak@tv-prostudies"
            }), this._metainfoCache.push({ palettes: {}, inputs: [{ defval: "open", id: "source", name: "Source", options: ["open", "high", "low", "close", "hl2", "hlc3", "ohlc4"], type: "text" }, { defval: "Traditional", id: "style", name: "Style", options: ["ATR", "Traditional"], type: "text" }, { defval: 14, id: "atrLength", max: 100, min: 1, name: "AtrLength", type: "integer", visible: "style==ATR" }, { defval: 1, id: "reversalAmount", max: 1.7976931348623157e308, min: 1e-4, name: "ReversalAmount", type: "float", visible: "style==Traditional" }], plots: [{ id: "open", type: "line" }, { id: "high", type: "line" }, { id: "low", type: "line" }, { id: "close", type: "line" }, { id: "volume", type: "line" }, { id: "change_price", type: "line" }], graphics: {}, defaults: { inputs: { atrLength: 14, reversalAmount: 1, source: "open", style: "Traditional" }, precision: "4" }, _metainfoVersion: 28, description: "Unnamed Study", id: "BarSetKagi@tv-prostudies", is_hidden_study: !0, is_price_study: !1, shortDescription: "Unnamed Study", description_localized: "Unnamed Study", shortId: "BarSetKagi", packageId: "tv-prostudies", version: "13", fullId: "BarSetKagi@tv-prostudies-13", productId: "tv-prostudies", name: "BarSetKagi@tv-prostudies" }), this._metainfoCache.push({ palettes: {}, inputs: [{ defval: "HL", id: "sources", name: "Sources", options: ["HL", "Open", "High", "Low", "Close"], type: "text" }, { defval: "ATR", id: "style", name: "Style", options: ["ATR", "Traditional"], type: "text" }, { defval: 1, id: "boxSize", max: 1.7976931348623157e308, min: 1e-4, name: "BoxSize", type: "float", visible: "style==Traditional" }, { defval: 14, id: "atrLength", max: 100, min: 1, name: "AtrLength", type: "integer", visible: "style==ATR" }, { defval: 3, id: "reversalAmount", max: 100, min: 1, name: "ReversalAmount", type: "integer" }], plots: [{ id: "open", type: "line" }, { id: "high", type: "line" }, { id: "low", type: "line" }, { id: "close", type: "line" }, { id: "volume", type: "line" }, { id: "factor", type: "line" }], graphics: {}, defaults: { inputs: { atrLength: 14, boxSize: 1, reversalAmount: 3, sources: "HL", style: "ATR" }, precision: "4" }, _metainfoVersion: 28, description: "Unnamed Study", id: "BarSetPnF@tv-prostudies", is_hidden_study: !0, is_price_study: !1, shortDescription: "Unnamed Study", description_localized: "Unnamed Study", shortId: "BarSetPnF", packageId: "tv-prostudies", version: "13", fullId: "BarSetPnF@tv-prostudies-13", productId: "tv-prostudies", name: "BarSetPnF@tv-prostudies" }), this._metainfoCache.push({
                palettes: {},
                inputs: [{ defval: "HL", id: "sources", name: "Sources", options: ["HL", "Open", "High", "Low", "Close"], type: "text" }, { defval: "ATR", id: "style", name: "Style", options: ["ATR", "Traditional"], type: "text" }, { defval: 1, id: "boxSize", max: 1.7976931348623157e308, min: 1e-4, name: "BoxSize", type: "float", visible: "style==Traditional" }, { defval: 14, id: "atrLength", max: 100, min: 1, name: "AtrLength", type: "integer", visible: "style==ATR" }, { defval: 3, id: "reversalAmount", max: 100, min: 1, name: "ReversalAmount", type: "integer" }],
                plots: [{ id: "open", type: "line" }, { id: "high", type: "line" }, { id: "low", type: "line" }, { id: "close", type: "line" }, {
                    id: "volume",
                    type: "line"
                }, { id: "factor", type: "line" }],
                graphics: {},
                defaults: { inputs: { atrLength: 14, boxSize: 1, reversalAmount: 3, sources: "HL", style: "ATR" }, precision: "4" },
                _metainfoVersion: 28,
                description: "Unnamed Study",
                id: "BarSetPnF@tv-prostudies",
                is_hidden_study: !0,
                is_price_study: !1,
                shortDescription: "Unnamed Study",
                description_localized: "Unnamed Study",
                shortId: "BarSetPnF",
                packageId: "tv-prostudies",
                version: "13",
                fullId: "BarSetPnF@tv-prostudies-13",
                productId: "tv-prostudies",
                name: "BarSetPnF@tv-prostudies"
            })), this._metainfoCache
        }, r.prototype.searchSymbols = function(t, e, i, o) {
            function n(t) { s._logMessage("Symbol search response: {0}".format(JSON.stringify(t))), o(t) }
            this._logMessage("Symbol search requested: search string `{0}`, exchange: `{1}`, type `{2}`".format(t, e, i));
            var s = this;
            "function" == typeof this._externalDatafeed.searchSymbols ? this._externalDatafeed.searchSymbols(t, e, i, n) : this._externalDatafeed.searchSymbolsByName(t, e, i, n)
        }, r.prototype.validateSymbolInfo = function(t) {
            function e(t) { console.warn("SymbolInfo validation: " + t) }
            var i, o;
            if ((void 0 === t.minmov || t.minmov <= 0) && e("minmov must be positive"), (void 0 === t.pricescale || t.pricescale <= 0) && e("pricescale must be positive"), void 0 !== t.name && 0 !== t.name.length || e("name must be non-empty stirng"), void 0 !== t.session && 0 !== t.session.length || e("session must be non-empty stirng"), void 0 !== t.timezone && 0 !== t.timezone.length || e("timezone must be non-empty stirng"), void 0 !== t.intraday_multipliers)
                if (i = t.intraday_multipliers, Array.isArray(i))
                    for (o = 0; o < i.length; ++o) "string" != typeof i[o] && e('intraday_multipliers[{0}] = "{1}" must be string (now: {2})'.format(o + 1, i[o], typeof i[o]));
                else e("intraday_multipliers must be array")
        }, r.prototype.resolveSymbol = function(t, e, i) {
            var o, n = h.parseSymbol(t).symbol;
            this._resolveRequests[n] ? o = this._resolveRequests[n] : (o = this.resolveSymbolInternal(n), this._resolveRequests[n] = o), o.done(e).fail(i)
        }, r.prototype.resolveSymbolInternal = function(t) {
            var e, i = this,
                o = $.Deferred();
            return this._logMessage("Symbol resolve requested: `{0}` ".format(t)), e = !0, this._externalDatafeed.resolveSymbol(t, function(n) { e && console.warn("`resolveSymbol` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."), i._logMessage("Symbol resolved: `{0}`, SymbolInfo in server response {1}".format(t, JSON.stringify(n))), n.base_name || (n.base_name = [n.name]), n.legs || (n.legs = [n.name]), n.exchange || (n.exchange = n["exchange-listed"]), n.full_name || (n.full_name = n.symbol || (n.exchange ? n.exchange + ":" + n.name : n.name)), n.pro_name || (n.pro_name = n.full_name), n.data_status || (n.data_status = "streaming"), n.ticker || (n.ticker = n.symbol), !n.session && n["session-regular"] && (n.session = n["session-regular"]), !n.minmov && n.minmovement && (n.minmov = n.minmovement), i.validateSymbolInfo(n), i._logMessage("Symbol info after post-processing: `{0}`, SymbolInfo {1}".format(t, JSON.stringify(n))), i._fullNameSymbolInfoMap[n.full_name] = n, o.resolve(n) }, function(e) { i._logMessage("Symbol resolve failed: `{0}`, reason: `{1}`".format(t, e)), o.reject(e) }), e = !1, o.promise()
        }, r.prototype._createMarketStatusWatchers = function(t, e) {
            void 0 === this._marketStatusWatchers[t] && (this._marketStatusWatchers[t] = {});
            var i = this;
            e.forEach(function(e) { void 0 === i._marketStatusWatchers[t][e] && (i._marketStatusWatchers[t][e] = new a(i, t, e)) })
        }, r.prototype._removeMarketStatusWatchers = function(t) {
            var e = this;
            Object.keys(this._marketStatusWatchers[t] || {}).forEach(function(i) { e._marketStatusWatchers[t][i].stop() }), this._marketStatusWatchers[t] = {}
        }, r.prototype._stopQuotesSubscription = function(t) { this._quotesInfo[t].listenerGUID && (this._externalDatafeed.unsubscribeQuotes(this._quotesInfo[t].listenerGUID), this._quotesInfo[t].listenerGUID = void 0), this._removeMarketStatusWatchers(t) }, r.prototype._startQuotesSubscription = function(t) {
            function e(e, i) {
                var o = s._marketStatusWatchers[t][e.n];
                e.symbolname = e.n, e.status = e.s, e.values = e.v, e.values.change = e.v.ch, e.values.last_price = e.v.lp, e.values.change_percent = e.v.chp, e.values.current_session = e.v.cs || o && o.marketStatus(), e.values.pricescale = i.pricescale, e.values.minmov = i.minmov, e.values.minmove2 = i.minmove2 || 0, e.values.fractional = i.fractional || !1, o && e.v.cs && o.stop(), TradingView.ChartapiMessagerInstances[t].onQuotesData([t].concat([e]))
            }

            function i(t) { t.forEach(function(t) { void 0 !== n[t.n] ? null !== n[t.n] && e(t, n[t.n]) : s.resolveSymbol(t.n, function(i) { n[t.n] = i, e(t, i) }, function() { n[t.n] = null }) }) }
            var n = {},
                s = this,
                r = this._quotesInfo[t].symbols;
            0 !== r.length && (this._externalDatafeed.getQuotes && !o.enabled("charting_library") && this._externalDatafeed.getQuotes(r, function(e) { s._quotesInfo[t] && (i(e), s._quotesInfo[t].listenerGUID = t, s._externalDatafeed.subscribeQuotes(r, s._quotesInfo[t].fastSymbols, i, s._quotesInfo[t].listenerGUID)) }), this._createMarketStatusWatchers(t, r))
        }, r.prototype._restartQuotesSubscription = function(t) { this._stopQuotesSubscription(t), this._startQuotesSubscription(t) }, r.prototype.quoteCreateSession = function(t) { this._quotesInfo[t] = { symbols: [], fastSymbols: [], listenerGUID: void 0 } }, r.prototype.quoteDeleteSession = function(t) { this._stopQuotesSubscription(t), this._quotesInfo[t] = null }, r.prototype.quoteSetFields = function(t, e) {}, r.prototype.quoteAddSymbols = function(t, e) { this._quotesInfo[t].symbols = this._filteredSymbols(this._quotesInfo[t].symbols.concat(e)), this._restartQuotesSubscription(t) }, r.prototype.quoteRemoveSymbols = function(t, e) { this._quotesInfo[t].symbols = this._quotesInfo[t].symbols.filter(function(t) { return e.indexOf(t) < 0 }), this._restartQuotesSubscription(t) }, r.prototype.quoteFastSymbols = function(t, e) { this._quotesInfo[t].fastSymbols = this._filteredSymbols(e), this._restartQuotesSubscription(t) }, r.prototype.quoteHibernateAll = function(t) {}, r.prototype._stopDepthSubscription = function(t) { this._depthInfo[t].listenerGUID && (this._externalDatafeed.unsubscribeDepth(this._depthInfo[t].listenerGUID), this._depthInfo[t].listenerGUID = void 0) }, r.prototype._startDepthSubscription = function(t) {
            function e(t) { return t.map(function(t) { return { p: t.price, v: t.volume } }) }

            function i(t) { var i = {}; return i.s = s, i.bids = e(t.bids), i.asks = e(t.asks), i }

            function o(e) {
                e.snapshot ? TradingView.ChartapiMessagerInstances[t].onDepthData([t].concat([i(e)])) : TradingView.ChartapiMessagerInstances[t].onDepthUpdate([t].concat([i(e)]))
            }
            var n = this,
                s = this._depthInfo[t].symbol;
            s && this._fullNameSymbolInfoMap[s] && this._externalDatafeed.subscribeDepth && (n._depthInfo[t].listenerGUID = this._externalDatafeed.subscribeDepth(s, function(e) { n._depthInfo[t] && o(e) }))
        }, r.prototype._restartDepthSubscription = function(t) { this._stopDepthSubscription(t), this._startDepthSubscription(t) }, r.prototype.depthCreateSession = function(t) { this._depthInfo[t] = { symbol: null, listenerGUID: void 0 } }, r.prototype.depthDeleteSession = function(t) { this._depthInfo[t].symbol = null, this._stopDepthSubscription(t), delete this._depthInfo[t] }, r.prototype.depthSetSymbol = function(t, e) { this._depthInfo[t].symbol = e, this._restartDepthSubscription(t) }, r.prototype._filteredSymbols = function(t) { var e = []; return t.forEach(function(t) { t instanceof Object || e.indexOf(t) < 0 && e.push(t) }), e }, r.prototype._isEndOfData = function(t, e, i) { var o = t + "!" + e + "@" + i; return !!this._endOfData[o] }, r.prototype._setEndOfData = function(t, e, i) {
            var o = t + "!" + e + "@" + i;
            this._endOfData[o] = !0
        }, r.prototype.alignTimePoint = function(t, e, i) { return o.enabled("disable_resolution_rebuild") ? t : n(e, i).alignTimeIfPossible(1e3 * t) / 1e3 }, r.prototype.serverTimeOffset = function() { return this._serverTimeOffset }, r.prototype.getCurrentUTCTime = function() { return (new Date).valueOf() / 1e3 + this._serverTimeOffset }, t.exports = r
    }).call(e, i(57), i(3))
}, function(t, e, i) {
    "use strict";
    TradingView.PublishedChartsTimeline = function() {}, TradingView.LinearRegressionPaneView = function() {}, TradingView.study_PivotPointsStandard = function() {}, TradingView.study_PivotPointsHighLow = function() {}, TradingView.study_ZigZag = function() {}, TradingView.study_LinearRegression = function() {}, TradingView.study_ElliottWave = function() {}, TradingView.ESDStudyBase = function() {}, TradingView.Pro = function() { this.hasPackage = function() { return !1 } }, window.user = { is_pro: !1, settings: {} }, TradingView.Pro.prototype.getStudies = function() { return [] }, TradingView.Pro.prototype.getProduct = function() { return {} }, TradingView.Pro.prototype.getStudiesOrder = function() { return [] }, TradingView.LineToolRegressionTrend = function() {}, TradingView.templates = i(160), TradingView.templates.dialogs = { symbolSearch: '<div class="symbol-block"><div class="spread-actions"></div><div class="symbol-block-inputspacer"><input maxlength="' + TradingView.SYMBOL_SEARCH_MAX_LENGTH + '" /><div class="search-icon"></div></div></div><div class="filter"></div><div class="results"></div>' }, TradingView.AlertLabel = function() {}, TradingView.getDataVendorString = function() {}, window.Telemetry = { sendReport: function() {} }, TradingView.study_VbPVisible = function() {}, TradingView.study_VbPSessions = function() {}, TradingView.LineToolVbPFixed = function() {}, TradingView.study_ESD$TV_DIVIDENDS = function() {}, TradingView.study_ESD$TV_SPLITS = function() {}, TradingView.study_ESD$TV_EARNINGS = function() {}, TradingView.MockupRequestedCache = function(t) { t && t([]) }, TradingView.MockupRequestedCache.invalidate = function() {}, TradingView.StudyStrategy = function() {},
        TradingView.LinetoolTemplatesList = function() {}, window.PublishedScript = { suggest: function() { var t = $.Deferred(); return t.resolve(null), t } }
}, function(t, e, i) {
    (function(t) {
        "use strict";

        function e(t) { this._chartApi = t, this._sessionid = "qs_" + o(), this._sessionstarted = !1 }
        var o = i(60).randomHash;
        e.prototype.destroy = function() { this._sessionstarted && (this._chartApi.quoteDeleteSession(this._sessionid), this._sessionid = null, this._sessionstarted = !1) }, e.prototype.connected = function() { return this._chartApi.connected() }, e.prototype.connect = function(t) { this._globalHandler = t, this._chartApi.createSession(this._sessionid, this), this._chartApi.connect() }, e.prototype.disconnect = function() { this._chartApi.disconnect() }, e.prototype.quoteAddSymbols = function(t, e) { t = [].concat(t), e && e.forcePermission && (t = t.concat({ flags: ["force_permission"] })), this._chartApi.quoteAddSymbols(this._sessionid, t) }, e.prototype.quoteRemoveSymbols = function(t) { this._chartApi.quoteRemoveSymbols(this._sessionid, t) }, e.prototype.quoteFastSymbols = function(t) { this._chartApi.quoteFastSymbols(this._sessionid, t) }, e.prototype.quoteSetFields = function(t) { this._chartApi.quoteSetFields(this._sessionid, t) }, e.prototype.onMessage = function(t) {
            switch (t.method) {
                case "connected":
                    this._sessionstarted || (this._chartApi.quoteCreateSession(this._sessionid), this._sessionstarted = !0);
                    break;
                case "disconnected":
                    this._sessionstarted = !1
            }
            this._globalHandler(t)
        }, e.prototype.quoteHibernateAll = function(t) { this._chartApi.quoteHibernateAll(this._sessionid) }, TradingView.QuoteSession = e, void 0 !== t && t && t.exports && (t.exports = e)
    }).call(e, i(50)(t))
}, function(t, e, i) {
    (function(t, e) {
        "use strict";

        function o(e, i) { this.options = $.extend({ throttleTimeout: 125 }, i), this._connected = !1, this._symbol_data = {}, this._subscriptions = {}, this._delayed_subscriptions = [], this.onConnect = new t, this.onDisconnect = new t, this._quoteApi = new n(ChartApiInstance), this._type = e || "full", this.connect(), this._delayUpdateFastSymbols = r(this._updateFastSymbols, 250), this._throttledSymbolData = {}, this._formatterValuesCache = {}, this._waitingForFormatters = {}, this._snapshotValuesCache = {}, this._waitingForSnapshot = {}, this.fieldsSent = new $.Deferred }
        var n, s = i(27).PriceFormatter,
            r = i(264),
            a = i(553),
            l = i(554),
            h = i(60);
        n = i(582), o.prototype.destroy = function() { this._quoteApi.destroy(), this._quoteApi = null, this._connected = !1, this.onDisconnect.fire() }, o.prototype.type_fields = { minichart: ["lp", "open_time", "series_data", "description"], simple: ["ch", "chp", "lp", "fractional", "minmov", "minmove2", "original_name", "pricescale", "pro_name", "update_mode", "volume", "symbol_status", "description", "exchange", "short_name", "current_session", "type", "is_tradable"], "simple-detailed": ["ch", "chp", "lp", "fractional", "minmov", "minmove2", "original_name", "pricescale", "pro_name", "update_mode", "symbol_status", "description", "exchange", "short_name", "current_session", "type", "volume", "open_price", "high_price", "low_price", "market_cap_basic", "prev_close_price", "earnings_per_share_basic_ttm", "price_earnings_ttm", "beta_1_year"], full: [] }, o.prototype.connect = function(t) { this._quoteApi.connect(this.quoteHandler.bind(this)) },
            o.prototype.quoteHandler = function(t) {
                var e = t.method,
                    i = t.params;
                switch (e) {
                    case "connected":
                        this._connected || (this._connected = !0, this.onConnected());
                        break;
                    case "quote_list_fields":
                        break;
                    case "quote_symbol_data":
                        this._connected && this.onSymbolData(i[0]);
                        break;
                    case "disconnected":
                        this._connected && (this._connected = !1, this.onDisconnect.fire())
                }
            }, o.prototype.onConnected = function() {
                this.setFields();
                var t = Object.keys(this._symbol_data);
                t.length && this._quoteApi.quoteAddSymbols(t, { forcePermission: !0 }), this._delayed_subscriptions.forEach(function(t) { this.subscribe.apply(this, t) }, this), this._delayed_subscriptions = [], this.onConnect.fire()
            }, o.prototype.setFields = function() {
                var t = o.prototype.type_fields[this._type];
                t && t.length && this._quoteApi.quoteSetFields(t), this.fieldsSent.resolve()
            }, o.prototype.onSymbolData = function(t) {
                var e = t.symbolname,
                    i = this._throttledSymbolData[e];
                i || (i = this._throttledSymbolData[e] = { fnDispatch: a(this.dipatchSymbolData.bind(this), this.options.throttleTimeout) }), i.cache ? $.extend(!0, i.cache, t) : i.cache = t, i.fnDispatch(e)
            }, o.prototype._parseUpdateMode = function(t) {
                var e = t.update_mode;
                e && (e = e.match(/(delayed_streaming){1}(?:_([\d]+))?/)) && e[1] && (e[2] && (t.update_mode_seconds = +e[2]), t.update_mode = e[1])
            }, o.prototype.dipatchSymbolData = function(t) {
                var e, i, o = this._symbol_data[t],
                    n = this._throttledSymbolData[t].cache;
                if (delete this._throttledSymbolData[t].cache, this._symbol_data[t]) { $.extend(!0, o, n), o.values && this._parseUpdateMode(o.values); for (e in this._subscriptions) i = this._subscriptions[e], i[t] && i[t].forEach(function(t) { t(o, n) }) }
            }, o.prototype.subscribe = function(t, e, i) {
                var o, n;
                if (!this._connected) return void this._delayed_subscriptions.push(arguments);
                this._subscriptions[t] = this._subscriptions[t] || {}, o = this._subscriptions[t], e = [].concat(e), n = [], e.forEach(function(t) { this._symbol_data[t] ? o && o[t] || this._symbol_data[t].subscribers_count++ : (this._symbol_data[t] = { subscribers_count: 1 }, n.push(t)), o[t] = o[t] || [], o[t].push(i), o[t].fast = !0, this._symbol_data[t] && this._symbol_data[t].values && i(this._symbol_data[t], this._symbol_data[t]) }, this), n.length && (this._quoteApi.quoteAddSymbols(n, { forcePermission: !0 }), this._delayUpdateFastSymbols())
            }, o.prototype.unsubscribe = function(t, e, i) {
                var o, n = this._subscriptions[t];
                n && (n[e] && i ? (o = n[e].indexOf(i), ~o && n[e].splice(o, 1), n[e].length || delete n[e]) : delete n[e]), n && 0 === Object.keys(n).length && delete this._subscriptions[t], this._symbol_data.hasOwnProperty(e) && (n && !n[e] && this._symbol_data[e].subscribers_count--, this._symbol_data[e].subscribers_count || (delete this._symbol_data[e], this._quoteApi.quoteRemoveSymbols([e]), this._delayUpdateFastSymbols()))
            }, o.prototype.setFastSymbols = function(t, e) {
                var i, o;
                if (this._subscriptions[t]) { i = this._subscriptions[t]; for (o in i) i[o].fast = -1 !== e.indexOf(o) }
                this._delayUpdateFastSymbols()
            }, o.prototype._updateFastSymbols = function() {
                if (this._connected) {
                    var t = this._fastSymbols();
                    0 === t.length ? this._quoteApi.quoteHibernateAll() : this._quoteApi.quoteFastSymbols(t)
                }
            }, o.prototype._delayUpdateFastSymbols = o.prototype._updateFastSymbols, o.prototype._fastSymbols = function() {
                var t, e, i, o = [];
                for (t in this._subscriptions) { e = this._subscriptions[t]; for (i in e) e[i].fast && o.push(i) }
                return o = l(o)
            }, o.prototype.formatter = function(t) {
                function e(t) { return new s(t.pricescale, t.minmov, t.fractional, t.minmove2) }

                function i(t) { return t && null != t.pricescale && null != t.minmov }
                var o, n = this;
                return this._waitingForFormatters[t] ? this._waitingForFormatters[t] : (o = new Promise(function(o, s) {
                    if (n._formatterValuesCache[t]) o(e(n._formatterValuesCache[t]));
                    else {
                        var r = h.guid();
                        n.subscribe(r, [t], function(a) { a.error && (n._waitingForFormatters[t] = null, s(a.error)), i(a.values) && (n._waitingForFormatters[t] = null, n._formatterValuesCache[t] = a.values, o(e(a.values)), n.unsubscribe(r, t)) })
                    }
                }), this._waitingForFormatters[t] = o, o)
            }, o.prototype.snapshot = function(t) {
                var e, i = this;
                return this._waitingForSnapshot[t] ? this._waitingForSnapshot[t] : (e = new Promise(function(e, o) {
                    if (i._snapshotValuesCache[t]) e(i._snapshotValuesCache[t]);
                    else {
                        var n = h.guid();
                        i.subscribe(n, [t], function(s) {
                            s.error && (i._waitingForSnapshot[t] = null, o(s.error));
                            var r = s.values;
                            r && r.minmov && r.pricescale && r.description && (i._waitingForSnapshot[t] = null, i._snapshotValuesCache[t] = r, e(r), i.unsubscribe(n, t))
                        })
                    }
                }), this._waitingForSnapshot[t] = e, e)
            }, TradingView.QuoteSessionMultiplexer = o, void 0 !== e && e && e.exports && (e.exports = o)
    }).call(e, i(15), i(50)(t))
}, function(t, e) {
    "use strict";

    function i() { this._zoffset = 0, this._items = [], this._lastTimePointIndex = null }
    i.prototype.clear = function() { this._zoffset = 0, this._items = [], this._lastTimePointIndex = null }, i.prototype.items = function() { return this._items }, i.prototype.size = function() { return this._items.length }, i.prototype.firstTimePointIndex = function() { return this.offsetToIndex(0) }, i.prototype.lastTimePointIndex = function() { return null !== this._lastTimePointIndex && void 0 !== this._lastTimePointIndex ? this._lastTimePointIndex : (this._lastTimePointIndex = this.offsetToIndex(this.size() - 1), this._lastTimePointIndex) }, i.prototype.merge = function(t, e, i) {
            var o, n, s, r, a, l, h;
            if (0 === this._items.length) return this._items = i, this._zoffset = e, [{ change: "rebuild", index: 0 }];
            if ((o = t + this._zoffset) < 0) { for (n = Math.abs(o), this._items = Array(n).concat(this._items), this._zoffset = e, s = 0; s < i.length; ++s) this._items[t + s + e] = i[s]; return [{ change: "rebuild", index: 0 }] }
            for (r = [], s = o; s < this._items.length && s - o < i.length; ++s) this._items[s] = i[s - o], r.push({ change: "update", index: s - this._zoffset, value: i[s - o] });
            if ((a = o + i.length) > this._items.length)
                for (n = a - this._items.length, l = s; l < s + n; ++l) h = this._items.length, this._items.push(i[l - o]), r.push({ change: "append", index: h - this._zoffset, value: i[l - o] });
            return this._zoffset = e, this._lastTimePointIndex = null, r
        }, i.prototype.addTail = function(t, e) { for (var i = e ? 1 : 0; i < t.length; i++) this._items.push(t[i]), this._lastTimePointIndex++ }, i.prototype.valueAt = function(t) { var e = this.indexToOffset(t); if (void 0 !== e) return this._items[e] }, i.prototype.indexOf = function(t, e) {
            if (e && t > this._items[this._items.length - 1]) return this.offsetToIndex(this._items.length - 1);
            for (var i = 0; i < this._items.length && !(t < this._items[i]); ++i)
                if (!(t > this._items[i])) return this.offsetToIndex(i);
            return e ? this.offsetToIndex(i) : void 0
        },
        i.prototype.offsetToIndex = function(t) { if (0 <= t && t < this.size()) return t - this._zoffset }, i.prototype.indexToOffset = function(t) { var e = t + this._zoffset; if (0 <= e && e < this.size()) return e }, i.prototype.state = function() { var t = {}; return t.zoffset = this._zoffset, t.items = this._items, t }, i.prototype.restoreState = function(t) { t && (this._zoffset = t.zoffset, this._items = t.items, this._lastTimePointIndex = null) }, i.prototype.roughTime = function(t, e) { var i, o, n, s, r, a, l, h, c, d = this.valueAt(t); if (void 0 === d) { if (i = this._items, !i.length || i.length < 2) return; if (o = this.firstTimePointIndex(), n = this.lastTimePointIndex(), s = this.valueAt(o), r = this.valueAt(n), a = (r - s) / (n - o), t < o) return l = o - t, h = l * a, d = s - h; if (c = 500, t > n) return (l = t - n) < c && e ? e(r, l) : (h = l * a, d = r + h) } return d }, i.prototype.roughIndex = function(t, e) { var i, o, n, s, r, a, l, h, c, d = this._items; if (d.length && !(d.length < 2)) return i = this.firstTimePointIndex(), o = this.lastTimePointIndex(), n = this.valueAt(i), s = this.valueAt(o), t >= n && t <= s ? this.closestIndexLeft(t) : (r = (s - n) / (o - i), t < n ? (a = n - t, l = Math.round(a / r), i - l) : (h = 500, t > s ? (a = t - s, l = Math.trunc(a / r), l < h && e && (c = e(s, t), c.success && (l = c.result)), o + l) : void 0)) }, i.prototype.closestIndexLeft = function(t) {
            var e, i, o, n, s, r, a = this._items;
            if (a.length && t === t) {
                if (e = a.length - 1, i = a[e], t >= i) return e - this._zoffset;
                if (o = 0, n = a[o], !(t < n)) {
                    if (t === n) return o - this._zoffset;
                    for (; e > o + 1;)
                        if (s = o + e >> 1, (r = a[s]) > t) e = s;
                        else {
                            if (!(r < t)) return r === t ? s - this._zoffset : void 0;
                            o = s
                        }
                    return o - this._zoffset
                }
            }
        }, t.exports = i
}, function(t, e, i) {
    "use strict";
    var o, n;
    i(358), o = i(2), n = window.CanvasEx = i(142), 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), 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, i) {
    "use strict";

    function o(t) { return this.jqObj = null, this.data = t, this.init(), this._prepareValue(), this._prepareCallback(), this._prepareChildren(), this._applyAttributes(), this.jqObj }

    function n(t, e) { this.value = t, this.html = e || "", this.jqItem = this._render() }

    function s(t) { this._value = null, this.items = [], this.width = 0, this.jqWrapper = null, this.jqSwitcher = null, this.jqTitle = null, this.jqIcon = null, this.jqItems = null, this.callback = null, this._init(), this.addItems(t), this.joinParts() }
    var r = i(144);
    o.selectOptions = { type: "option", value: null, html: null }, o.optionsData = { radiogroup: { type: "radio", name: null, value: null, label: null }, select: o.selectOptions, "select-one": o.selectOptions, "select-multiple": o.selectOptions }, o.customTypes = ["radiogroup", "fontpicker", "colorpicker", "combobox"], o.prototype._tagIsInput = function(t) { return -1 !== jQuery.inArray(this.data.type, ["text", "radio", "checkbox", "hidden", "reset", "image", "file"]) }, o.prototype.init = function() { this._tagIsInput() ? this.jqObj = r.create("input", { name: this.data.name, type: this.data.type }) : this.jqObj = r.create(this.data.type, { name: this.data.name }) }, o.prototype._eventIsKeyUp = function() { return -1 !== jQuery.inArray(this.data.type, ["text", "textarea"]) }, o.prototype._eventIsClick = function() { return -1 !== jQuery.inArray(this.data.type, ["checkbox", "radio", "option"]) },
        o.prototype._eventIsChange = function() { return -1 !== jQuery.inArray(this.data.type, ["select", "select-one", "select-multiple", "radiogroup"]) }, o.prototype._prepareCallback = function() { this.data.callback && (this._eventIsKeyUp() ? this.jqObj.keyup(this.data.callback) : this._eventIsClick() ? this.jqObj.click(this.data.callback) : this._eventIsChange() && this.jqObj.bind("change", this.data.callback), delete this.data.callback) }, o.prototype._childTag = function() { return { select: "option", "select-one": "option", "select-multiple": "option", radiogroup: "radio" }[this.data.type] }, o.prototype._inheritedProperties = function() { var t = { type: this._childTag() }; return "radiogroup" === this.data.type && (t.name = this.data.name), t }, o.prototype._extendChildProps = function(t) { var e = jQuery.extend(this._inheritedProperties(), t); return this.data.value === t.value && (e.selected = !0), e }, o.prototype._prepareChildren = function() {
            if (this.data.options) {
                var t = this;
                jQuery.each(this.data.options, function(e, i) { t.jqObj.append(new o(t._extendChildProps(i))) })
            }
        }, o.prototype.isCustom = function() { return -1 !== jQuery.inArray(this.data.type, this.customTypes) }, o.prototype._isStoringValue = function() { return -1 !== jQuery.inArray(this.data.type, ["text", "textarea", "option", "radio", "checkbox"]) }, o.prototype._htmlAsValue = function() { return "textarea" === this.data.type }, o.prototype._valAsValue = function() { return jQuery.inArray(this.data.type, ["text", "checkbox", "radio", "option", "select", "select-one", "select-multiple"]) }, o.prototype._getControlValue = function() { return { checkbox: 1 }[this.data.type] || this.data.value }, o.prototype._setControlValue = function() { this._valAsValue() ? this.jqObj.val(this._getControlValue()) : this._htmlAsValue() && this.jqObj.html(this.data.value) }, o.prototype._getCheckedAttr = function() { return { option: "selected", radio: "checked", checkbox: "checked" }[this.data.type] }, o.prototype._setChecked = function() { this.data.selected && this.jqObj.attr(this._getCheckedAttr(), !0) }, o.prototype._setValue = function() { this._setControlValue(), o.isCheckable(this.data.type) && this._setChecked() }, o.prototype._prepareValue = function() { this._isStoringValue() && this._setValue() }, o.prototype._applyAttributes = function() { this.jqObj.attr(r.cleanAttributes(this.data)) }, o.value = function(t) { return o.controlCheckable(t) ? t.checked : t.value }, o.isCheckable = function(t) { return -1 !== jQuery.inArray(t, ["checkbox", "radio", "option"]) }, o.controlType = function(t) { var e, i; return "string" == typeof t ? t : (e = jQuery(t), i = null, e.attr("type") && (i = e.attr("type"), jQuery.inArray(i, ["textarea", "text", "select", "select-one", "select-multiple", "submit"])) ? i : e.attr("tagName")) }, o.controlCheckable = function(t) { return o.isCheckable(o.controlType(t)) }, o.controlToggleChecked = function(t, e) { return i(143).setAttr(t, "checked", e) }, o.controlSetValue = function(t, e) { return o.controlCheckable(t) ? o.controlToggleChecked(t, e) : i(143).setAttr(t, "value", e) }, o.currentOption = function(t) { return t.options[t.selectedIndex] }, o.currentOptionInnerHTML = function(t) { return o.currentOption(t).innerHTML }, n.prototype.eq = function(t) { return this.value === t }, n.prototype.width = function(t) { return this.jqItem.width() },
        n.prototype._render = function(t) { var e = $("<span/>").append($(this.html).clone()); return $('<div class="item"></div>').append(e) }, n.prototype.render = function(t) { return this.jqItem }, n.prototype.select = function(t) { t ? this.jqItem.addClass("selected") : this.jqItem.removeClass("selected") }, n.prototype.selectAndReturnIfValueMatch = function(t) { return this.eq(t) ? (this.select(!0), this) : (this.select(!1), null) }, s.prototype._init = function() { this._initWrapper(), this._initSwitcher(), this._initOptions() }, s.prototype._initTitle = function() { this.jqTitle = $('<span class="title" />') }, s.prototype._initIcon = function() { this.jqIcon = $('<span class="icon" />') }, s.prototype._initOptions = function() {
            var t = i(143);
            this.jqItems = t.createPopup({ class: "items" })
        }, s.prototype._initWrapper = function() { this.jqWrapper = $('<div class="custom-select" />'), this.jqWrapper.data({ disable: this.disable.bind(this), enable: this.enable.bind(this) }) }, s.prototype._initSwitcher = function() {
            var t = this;
            this._initTitle(), this._initIcon(), this.jqSwitcher = $('<div class="switcher" />'), this.jqSwitcher.append(this.jqTitle), this.jqSwitcher.append($(this.jqIcon).clone()), this.opened = !1, this.jqSwitcher.click(function(e) { t.toggleItems() }), t = this, $(document).click(function(e) { $(e.target).closest(t.jqSwitcher).length || (!t.jqSwitcher.is(e.target) && 0 === t.jqSwitcher.has(e.target).length || !t.jqItems.is(e.target) && 0 === !t.jqItems.has(e.target).length) && t.opened && (t.jqItems.hide(), t.opened = !1, t.jqSwitcher.removeClass("open"), e.stopPropagation()) })
        }, s.prototype.toggleItems = function() { this.disabled() || (this.opened ? (this.jqItems.hide(), this.jqSwitcher.removeClass("open"), this.opened = !1) : (this.jqItems.show(), this.jqSwitcher.addClass("open"), this.opened = !0)) }, s.prototype.setWidth = function() { this.jqWrapper.width(this.width) }, s.prototype.joinParts = function() { this.jqWrapper.append(this.jqSwitcher), this.jqWrapper.append(this.jqItems), this.jqWrapper.selectable(!1) }, s.prototype.render = function() { return this.jqWrapper }, s.prototype.selectItemByValue = function(t) {
            var e = null;
            return $(this.items).each(function(i, o) {
                var n = o.selectAndReturnIfValueMatch(t);
                n && (e = n)
            }), e
        }, s.prototype.setValue = function(t) {
            if (this._value !== t) {
                var e = this.selectItemByValue(t);
                this._value = t, this.jqTitle.html(e.html), this.change()
            }
        }, s.prototype.change = function(t) {
            if (t) return void(this.callback = t);
            this.callback && this.callback.call(this)
        }, s.prototype.value = function() { return this._value }, s.prototype.val = function(t) { return void 0 !== t ? void this.setValue(t) : this.value() }, s.prototype.addItems = function(t) {
            var e = this;
            $(t).each(function(t, i) { e.addItem(i.value, i.html) })
        }, s.prototype.addItem = function(t, e) {
            var i, o = this,
                s = new n(t, e);
            this.items.push(s), i = s.render(), i.click(function() { o.setValue(t), o.toggleItems() }), this.jqItems.append(i), null === this.value() && this.setValue(t)
        }, s.prototype.disable = function() { this._disabled = !0 }, s.prototype.enable = function() { this._disabled = !1 }, s.prototype.disabled = function() { return this._disabled }, e.Input = o, e.Combobox = s
}, function(t, e) {
    "use strict";

    function i(t, e) {
        this.array = [];
        for (var i in t) t[i].key = i, this.array.push(t[i]);
        this.rearrange(e)
    }
    i.prototype.rearrange = function(t) { if ("function" != typeof t) throw Error("sort param is not a function"); return this.array.sort(t) }, i.byValue = function(t) { return function(t, e) { return t - e } }, i.byField = function(t) { return function(e, i) { return e[t] > i[t] ? 1 : e[t] < i[t] ? -1 : e[t] === i[t] ? 0 : void 0 } }, i.byOrder = function(t) { return function(e, i) { return t.indexOf(e.key) - t.indexOf(i.key) } }, t.exports = i
}, function(t, e) {
    ! function() {
        var e = {
            "America/New_York": {
                time: [-2717668562, -1633298400, -1615154400, -1601848800, -1583704800, -1570399200, -1551650400, -1536530400, -1523224800, -1504476e3, -1491775200, -1473026400, -1459720800, -1441576800, -1428271200, -1410127200, -1396821600, -1378677600, -1365372e3, -1347228e3, -1333922400, -1315173600, -1301868e3, -1283724e3, -1270418400, -1252274400, -1238968800, -1220824800, -1207519200, -1189375200, -1176069600, -1157320800, -114462e4, -1125871200, -1112565600, -1094421600, -1081116e3, -1062972e3, -1049666400, -1031522400, -1018216800, -1000072800, -986767200, -968018400, -955317600, -936568800, -923263200, -905119200, -891813600, -880236e3, -76941e4, -765410400, -747266400, -733960800, -715816800, -702511200, -684367200, -671061600, -652917600, -639612e3, -620863200, -608162400, -589413600, -576108e3, -557964e3, -544658400, -526514400, -513208800, -495064800, -481759200, -463615200, -447285600, -431560800, -415836e3, -400111200, -384386400, -368661600, -352936800, -337212e3, -321487200, -305762400, -289432800, -273708e3, -257983200, -242258400, -226533600, -210808800, -195084e3, -179359200, -163634400, -147909600, -13158e4, -11646e4, -100130400, -84405600, -68680800, -52956e3, -37231200, -21506400, -5781600, 9943200, 25668e3, 41392800, 57722400, 73447200, 89172e3, 104896800, 120621600, 126669600, 152071200, 162352800, 183520800, 199245600, 215575200, 230695200, 247024800, 262749600, 278474400, 294199200, 309924e3, 325648800, 341373600, 357098400, 372823200, 388548e3, 404877600, 419997600, 436327200, 452052e3, 467776800, 483501600, 499226400, 514951200, 530676e3, 544586400, 562125600, 576036e3, 59418e4, 607485600, 625629600, 638935200, 657079200, 670989600, 688528800, 702439200, 719978400, 733888800, 752032800, 765338400, 783482400, 796788e3, 814932e3, 828842400, 846381600, 860292e3, 877831200, 891741600, 909280800, 923191200, 941335200, 954640800, 972784800, 986090400, 1004234400, 1018144800, 1035684e3, 1049594400, 1067133600, 1081044e3, 1099188e3, 1112493600, 1130637600, 1143943200, 1162087200, 1173578400, 1194141600, 1205028e3, 1225591200, 1236477600, 1257040800, 1268532e3, 1289095200, 1299981600, 1320544800, 1331431200, 1351994400, 1362880800, 1383444e3, 1394330400, 1414893600, 142578e4, 1446343200, 1457834400, 1478397600, 1489284e3, 1509847200, 1520733600, 1541296800, 1552183200, 1572746400, 1583632800, 1604196e3, 1615687200, 1636250400, 1647136800, 16677e5, 1678586400, 1699149600, 1710036e3, 1730599200, 1741485600, 1762048800, 1772935200, 1793498400, 1804989600, 1825552800, 1836439200, 1857002400, 1867888800, 1888452e3, 1899338400, 1919901600, 1930788e3],
                offset: [-17762, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3]
            },
            "America/Los_Angeles": {
                time: [-2717668378, -1633298400, -1615154400, -1601848800, -1583704800, -880236e3, -769420800, -765410400, -687995940, -662680800, -620866800, -608162400, -589417200, -576108e3, -557967600, -544658400, -526518e3, -513208800, -495068400, -481759200, -463618800, -450309600, -431564400, -418255200, -400114800, -386805600, -368665200, -355356e3, -337215600, -323906400, -305766e3, -292456800, -273711600, -261007200, -242262e3, -226533600, -210812400, -195084e3, -179362800, -163634400, -147913200, -13158e4, -116463600, -100130400, -84405600, -68680800, -52956e3, -37231200, -21506400, -5781600, 9943200, 25668e3, 41392800, 57722400, 73447200, 89172e3, 104896800, 120621600, 126669600, 152071200, 162352800, 183520800, 199245600, 215575200, 230695200, 247024800, 262749600, 278474400, 294199200, 309924e3, 325648800, 341373600, 357098400, 372823200, 388548e3, 404877600, 419997600, 436327200, 452052e3, 467776800, 483501600, 499226400, 514951200, 530676e3, 544586400, 562125600, 576036e3, 59418e4, 607485600, 625629600, 638935200, 657079200, 670989600, 688528800, 702439200, 719978400, 733888800, 752032800, 765338400, 783482400, 796788e3, 814932e3, 828842400, 846381600, 860292e3, 877831200, 891741600, 909280800, 923191200, 941335200, 954640800, 972784800, 986090400, 1004234400, 1018144800, 1035684e3, 1049594400, 1067133600, 1081044e3, 1099188e3, 1112493600, 1130637600, 1143943200, 1162087200, 1173578400, 1194141600, 1205028e3, 1225591200, 1236477600, 1257040800, 1268532e3, 1289095200, 1299981600, 1320544800, 1331431200, 1351994400, 1362880800, 1383444e3, 1394330400, 1414893600, 142578e4, 1446343200, 1457834400, 1478397600, 1489284e3, 1509847200, 1520733600, 1541296800, 1552183200, 1572746400, 1583632800, 1604196e3, 1615687200, 1636250400, 1647136800, 16677e5, 1678586400, 1699149600, 1710036e3, 1730599200, 1741485600, 1762048800, 1772935200, 1793498400, 1804989600, 1825552800, 1836439200, 1857002400, 1867888800, 1888452e3, 1899338400, 1919901600, 1930788e3],
                offset: [-28378, -28800, -25200, -28800, -25200, -28800, -25200, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800]
            },
            "America/Chicago": {
                time: [-2717668236, -1633298400, -1615154400, -1601848800, -1583704800, -1563746400, -1551650400, -1538949600, -1520200800, -1504476e3, -1491775200, -1473026400, -1459720800, -1441576800, -1428271200, -1410127200, -1396821600, -1378677600, -1365372e3, -1347228e3, -1333922400, -1315173600, -1301868e3, -1283724e3, -1270418400, -1252274400, -1238968800, -1220824800, -1207519200, -1189375200, -1176069600, -1157320800, -114462e4, -1125871200, -1112565600, -1094421600, -1081116e3, -1067810400, -1045432800, -1031522400, -1018216800, -1000072800, -986767200, -968018400, -955317600, -936568800, -923263200, -905119200, -891813600, -880236e3, -769413600, -765410400, -747266400, -733960800, -715816800, -702511200, -684367200, -671061600, -652917600, -639612e3, -620863200, -608162400, -589413600, -576108e3, -557964e3, -544658400, -526514400, -513208800, -495064800, -481759200, -463615200, -447285600, -431560800, -415836e3, -400111200, -384386400, -368661600, -352936800, -337212e3, -321487200, -305762400, -289432800, -273708e3, -257983200, -242258400, -226533600, -210808800, -195084e3, -179359200, -163634400, -147909600, -13158e4, -11646e4, -100130400, -84405600, -68680800, -52956e3, -37231200, -21506400, -5781600, 9943200, 25668e3, 41392800, 57722400, 73447200, 89172e3, 104896800, 120621600, 126669600, 152071200, 162352800, 183520800, 199245600, 215575200, 230695200, 247024800, 262749600, 278474400, 294199200, 309924e3, 325648800, 341373600, 357098400, 372823200, 388548e3, 404877600, 419997600, 436327200, 452052e3, 467776800, 483501600, 499226400, 514951200, 530676e3, 544586400, 562125600, 576036e3, 59418e4, 607485600, 625629600, 638935200, 657079200, 670989600, 688528800, 702439200, 719978400, 733888800, 752032800, 765338400, 783482400, 796788e3, 814932e3, 828842400, 846381600, 860292e3, 877831200, 891741600, 909280800, 923191200, 941335200, 954640800, 972784800, 986090400, 1004234400, 1018144800, 1035684e3, 1049594400, 1067133600, 1081044e3, 1099188e3, 1112493600, 1130637600, 1143943200, 1162087200, 1173578400, 1194141600, 1205028e3, 1225591200, 1236477600, 1257040800, 1268532e3, 1289095200, 1299981600, 1320544800, 1331431200, 1351994400, 1362880800, 1383444e3, 1394330400, 1414893600, 142578e4, 1446343200, 1457834400, 1478397600, 1489284e3, 1509847200, 1520733600, 1541296800, 1552183200, 1572746400, 1583632800, 1604196e3, 1615687200, 1636250400, 1647136800, 16677e5, 1678586400, 1699149600, 1710036e3, 1730599200, 1741485600, 1762048800, 1772935200, 1793498400, 1804989600, 1825552800, 1836439200, 1857002400, 1867888800, 1888452e3, 1899338400, 1919901600, 1930788e3],
                offset: [-21036, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600]
            },
            "America/Phoenix": { time: [-2717670498, -1633298400, -1615154400, -1601848800, -1583704800, -880236e3, -820540740, -812678340, -796867140, -84405600, -68680800, 1924966800], offset: [-26898, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200] },
            "America/Toronto": {
                time: [-2366755200, -1632088800, -1615154400, -1601771400, -1583712e3, -1567375200, -1554681600, -1534716e3, -1524088800, -1503266400, -149238e4, -1471816800, -1460930400, -1440972e3, -1428876e3, -1409522400, -1397426400, -1378072800, -1365976800, -1346623200, -1333922400, -1315173600, -1301868e3, -1283724e3, -1270418400, -1252274400, -1238968800, -1220824800, -1207519200, -1188770400, -1176069600, -1157320800, -1144015200, -1125871200, -1112565600, -1094421600, -1081116e3, -1062972e3, -1049666400, -1031522400, -1018216800, -1000072800, -986767200, -968018400, -955317600, -936568800, -880232400, -76941e4, -765410400, -747266400, -733960800, -715824e3, -702518400, -684374400, -671068800, -652924800, -634176e3, -620863200, -602719200, -589413600, -576108e3, -557964e3, -544658400, -526514400, -513208800, -495064800, -481759200, -463615200, -450309600, -431560800, -418255200, -400111200, -384386400, -368661600, -352936800, -337212e3, -321487200, -305762400, -289432800, -273708e3, -257983200, -242258400, -226533600, -210808800, -195084e3, -179359200, -163634400, -147909600, -13158e4, -11646e4, -100130400, -84405600, -68680800, -52956e3, -37231200, -21506400, -5781600, 9943200, 25668e3, 41392800, 57722400, 73447200, 89172e3, 104896800, 120621600, 136346400, 152071200, 167796e3, 183520800, 199245600, 215575200, 230695200, 247024800, 262749600, 278474400, 294199200, 309924e3, 325648800, 341373600, 357098400, 372823200, 388548e3, 404877600, 419997600, 436327200, 452052e3, 467776800, 483501600, 499226400, 514951200, 530676e3, 544586400, 562125600, 576036e3, 59418e4, 607485600, 625629600, 638935200, 657079200, 670989600, 688528800, 702439200, 719978400, 733888800, 752032800, 765338400, 783482400, 796788e3, 814932e3, 828842400, 846381600, 860292e3, 877831200, 891741600, 909280800, 923191200, 941335200, 954640800, 972784800, 986090400, 1004234400, 1018144800, 1035684e3, 1049594400, 1067133600, 1081044e3, 1099188e3, 1112493600, 1130637600, 1143943200, 1162087200, 1173578400, 1194141600, 1205028e3, 1225591200, 1236477600, 1257040800, 1268532e3, 1289095200, 1299981600, 1320544800, 1331431200, 1351994400, 1362880800, 1383444e3, 1394330400, 1414893600, 142578e4, 1446343200, 1457834400, 1478397600, 1489284e3, 1509847200, 1520733600, 1541296800, 1552183200, 1572746400, 1583632800, 1604196e3, 1615687200, 1636250400, 1647136800, 16677e5, 1678586400, 1699149600, 1710036e3, 1730599200, 1741485600, 1762048800, 1772935200, 1793498400, 1804989600, 1825552800, 1836439200, 1857002400, 1867888800, 1888452e3, 1899338400, 1919901600, 1930788e3],
                offset: [-19052, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -14400, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3, -14400, -18e3]
            },
            "America/Vancouver": {
                time: [-2713910400, -1632088800, -1615154400, -880236e3, -769420800, -765410400, -747266400, -732751200, -715816800, -702511200, -684367200, -671061600, -652917600, -639612e3, -620863200, -608162400, -589413600, -576108e3, -557964e3, -544658400, -526514400, -513208800, -495064800, -481759200, -463615200, -450309600, -431560800, -418255200, -400111200, -386805600, -368661600, -355356e3, -337212e3, -323906400, -305762400, -292456800, -273708e3, -261007200, -242258400, -226533600, -210808800, -195084e3, -179359200, -163634400, -147909600, -13158e4, -11646e4, -100130400, -84405600, -68680800, -52956e3, -37231200, -21506400, -5781600, 9943200, 25668e3, 41392800, 57722400, 73447200, 89172e3, 104896800, 120621600, 136346400, 152071200, 167796e3, 183520800, 199245600, 215575200, 230695200, 247024800, 262749600, 278474400, 294199200, 309924e3, 325648800, 341373600, 357098400, 372823200, 388548e3, 404877600, 419997600, 436327200, 452052e3, 467776800, 483501600, 499226400, 514951200, 530676e3, 544586400, 562125600, 576036e3, 59418e4, 607485600, 625629600, 638935200, 657079200, 670989600, 688528800, 702439200, 719978400, 733888800, 752032800, 765338400, 783482400, 796788e3, 814932e3, 828842400, 846381600, 860292e3, 877831200, 891741600, 909280800, 923191200, 941335200, 954640800, 972784800, 986090400, 1004234400, 1018144800, 1035684e3, 1049594400, 1067133600, 1081044e3, 1099188e3, 1112493600, 1130637600, 1143943200, 1162087200, 1173578400, 1194141600, 1205028e3, 1225591200, 1236477600, 1257040800, 1268532e3, 1289095200, 1299981600, 1320544800, 1331431200, 1351994400, 1362880800, 1383444e3, 1394330400, 1414893600, 142578e4, 1446343200, 1457834400, 1478397600, 1489284e3, 1509847200, 1520733600, 1541296800, 1552183200, 1572746400, 1583632800, 1604196e3, 1615687200, 1636250400, 1647136800, 16677e5, 1678586400, 1699149600, 1710036e3, 1730599200, 1741485600, 1762048800, 1772935200, 1793498400, 1804989600, 1825552800, 1836439200, 1857002400, 1867888800, 1888452e3, 1899338400, 1919901600, 1930788e3],
                offset: [-29548, -28800, -25200, -28800, -25200, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800, -25200, -28800]
            },
            "America/Argentina/Buenos_Aires": { time: [-2372112e3, -1567468800, -1233446400, -1222992e3, -1205971200, -1194048e3, -117288e4, -1162512e3, -1141344e3, -1130976e3, -1109808e3, -109944e4, -1078272e3, -1067817600, -1046649600, -1036281600, -1015113600, -1004745600, -983577600, -973209600, -952041600, -941587200, -931046400, -900892800, -890352e3, -83376e4, -82728e4, -752284800, -733795200, -197337600, -190857600, -184204800, -164505600, -152668800, -132969600, -121132800, -101433600, -86832e3, -71107200, -54777600, -39052800, -23328e3, -7603200, 128131200, 136598400, 596937600, 605059200, 624412800, 636508800, 656467200, 667958400, 687916800, 699408e3, 719366400, 731462400, 938908800, 952041600, 1198972800, 1205625600, 1224374400, 1237075200, 1924981200], offset: [-14028, -15408, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -14400, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -10800, -10800, -7200, -10800, -7200, -10800] },
            "America/El_Salvador": { time: [-1546300800, 546998400, 559699200, 578448e3, 591148800, 1924970400], offset: [-21408, -21600, -18e3, -21600, -18e3, -21600] },
            "America/Sao_Paulo": {
                time: [-1767225600, -1206968400, -1191369600, -1175385600, -1159833600, -633830400, -622076400, -602294400, -59184e4, -570758400, -560217600, -539136e3, -53136e4, -195436800, -184204800, -155174400, -150076800, -128908800, -121132800, -99964800, -89596800, -68428800, -57974400, 499737600, 511228800, 530582400, 540259200, 562118400, 571190400, 592963200, 602035200, 624412800, 634694400, 656467200, 666748800, 687916800, 697593600, 719971200, 728438400, 750816e3, 761702400, 782265600, 793152e3, 813715200, 823996800, 84456e4, 856051200, 876096e3, 888710400, 908064e3, 919555200, 938908800, 951609600, 970963200, 982454400, 1003017600, 1013904e3, 1036281600, 1045353600, 1066521600, 1076803200, 1099353600, 1108857600, 1129420800, 1140307200, 1162684800, 1172361600, 119232e4, 1203206400, 1224374400, 1234656e3, 1255824e3, 1266710400, 1287273600, 129816e4, 1318723200, 1330214400, 1350777600, 1361059200, 1382227200, 1392508800, 1413676800, 1424563200, 1445126400, 1456012800, 1476576e3, 1487462400, 1508025600, 1518912e3, 154008e4, 1550361600, 1571529600, 1581811200, 1602979200, 1613865600, 1634428800, 1645315200, 1665878400, 1677369600, 1697328e3, 1708214400, 1729382400, 1739664e3, 1760832e3, 1771718400, 1792281600, 1803168e3, 1823731200, 1834617600, 1855180800, 1866067200, 1887235200, 1897516800, 1918684800, 1928966400],
                offset: [-11188, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200, -10800, -7200]
            },
            "America/Bogota": { time: [-2707689600, -1739059200, 704851200, 733881600, 1924974e3], offset: [-17776, -17776, -18e3, -14400, -18e3] },
            "America/Caracas": { time: [-2524521600, -1826755200, -157766400, 1197169200, 1462069800, 1924977600], offset: [-16064, -16060, -16200, -14400, -16200, -14400] },
            "Europe/Moscow": {
                time: [-2840140800, -1688256e3, -165681e4, -1641340800, -1627956e3, -1618700400, -1596416400, -1593804521, -1589846400, -1542416400, -1539478800, -1525305600, -1522713600, -1491177600, -1247529600, 354931200, 370742400, 386467200, 402278400, 418003200, 433814400, 449625600, 465361200, 481082400, 496810800, 512532e3, 528260400, 543981600, 55971e4, 575431200, 591159600, 606880800, 622609200, 638330400, 654663600, 670384800, 686113200, 695786400, 701834400, 717562800, 733284e3, 749012400, 764733600, 780462e3, 796183200, 811911600, 828237600, 846385200, 859687200, 877834800, 891136800, 909284400, 922586400, 941338800, 954036e3, 972788400, 985485600, 1004238e3, 101754e4, 1035687600, 1048989600, 1067137200, 1080439200, 1099191600, 1111888800, 1130641200, 1143338400, 1162090800, 1174788e3, 1193540400, 1206842400, 122499e4, 1238292e3, 1256439600, 1269741600, 1288494e3, 1301191200, 1414288800, 1925002800],
                offset: [9017, 9017, 9079, 12679, 9079, 16279, 12679, 16279, 14400, 10800, 14400, 18e3, 14400, 10800, 7200, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 10800, 7200, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800]
            },
            "Europe/Athens": {
                time: [-2344636800, -1686095940, -1182988800, -1178150400, -906854400, -904867200, -85725e4, -844473600, -828230400, -812419200, -552355200, -541641600, 166492800, 186195600, 198036e3, 213764400, 228880800, 244090800, 260330400, 275457600, 291805200, 307418400, 323395200, 338947200, 354682800, 370411200, 386132400, 401860800, 417582e3, 433310400, 449031600, 465364800, 481086e3, 496814400, 512535600, 528264e3, 543985200, 559713600, 575434800, 591163200, 606884400, 622612800, 638334e3, 654667200, 670388400, 686116800, 701838e3, 717566400, 733287600, 749016e3, 764737200, 780465600, 796186800, 811915200, 828241200, 846388800, 859690800, 877838400, 891140400, 909288e3, 92259e4, 941342400, 954039600, 972792e3, 985489200, 1004241600, 1017543600, 1035691200, 1048993200, 1067140800, 1080442800, 1099195200, 1111892400, 1130644800, 1143342e3, 1162094400, 1174791600, 1193544e3, 1206846e3, 1224993600, 1238295600, 1256443200, 1269745200, 1288497600, 1301194800, 1319947200, 1332644400, 1351396800, 1364698800, 1382846400, 1396148400, 1414296e3, 1427598e3, 1445745600, 1459047600, 14778e5, 1490497200, 1509249600, 1521946800, 1540699200, 1554001200, 1572148800, 1585450800, 1603598400, 1616900400, 1635652800, 164835e4, 1667102400, 1679799600, 1698552e3, 1711854e3, 1730001600, 1743303600, 1761451200, 1774753200, 1792900800, 1806202800, 1824955200, 1837652400, 1856404800, 1869102e3, 1887854400, 1901156400, 1919304e3, 1932606e3],
                offset: [5692, 5692, 7200, 10800, 7200, 10800, 7200, 3600, 7200, 3600, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200]
            },
            "Europe/Berlin": { time: [-2422051200, -1693702800, -1680476400, -1663452e3, -1650142800, -1632002400, -1618693200, -938901600, -85725e4, -844552800, -828219600, -812498400, -79677e4, -781048800, -776556e3, -765925200, -761173200, -748476e3, -733266e3, -717627600, -714603600, -71037e4, -701902800, -684972e3, -670453200, -654127200, -639003600, 323834400, 338958e3, 354679200, 370407600, 386128800, 401857200, 417578400, 433306800, 449028e3, 465361200, 481082400, 496810800, 512532e3, 528260400, 543981600, 55971e4, 575431200, 591159600, 606880800, 622609200, 638330400, 654663600, 670384800, 686113200, 701834400, 717562800, 733284e3, 749012400, 764733600, 780462e3, 796183200, 811911600, 828237600, 846385200, 859687200, 877834800, 891136800, 909284400, 922586400, 941338800, 954036e3, 972788400, 985485600, 1004238e3, 101754e4, 1035687600, 1048989600, 1067137200, 1080439200, 1099191600, 1111888800, 1130641200, 1143338400, 1162090800, 1174788e3, 1193540400, 1206842400, 122499e4, 1238292e3, 1256439600, 1269741600, 1288494e3, 1301191200, 1319943600, 1332640800, 1351393200, 1364695200, 1382842800, 1396144800, 1414292400, 1427594400, 1445742e3, 1459044e3, 1477796400, 1490493600, 1509246e3, 1521943200, 1540695600, 1553997600, 1572145200, 1585447200, 1603594800, 1616896800, 1635649200, 1648346400, 1667098800, 1679796e3, 1698548400, 1711850400, 1729998e3, 17433e5, 1761447600, 1774749600, 1792897200, 1806199200, 1824951600, 1837648800, 1856401200, 1869098400, 1887850800, 1901152800, 1919300400, 1932602400], offset: [3208, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 10800, 7200, 3600, 7200, 3600, 7200, 10800, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600] },
            "Europe/London": {
                time: [-3852662400, -1691964e3, -1680469200, -1664143200, -1650142800, -1633903200, -1617483600, -1601848800, -1586034e3, -1570399200, -1552165200, -1538344800, -152253e4, -15075e5, -1490562e3, -1473631200, -1460926800, -1442786400, -1428872400, -1410732e3, -1396213200, -1379282400, -1364763600, -1348437600, -1333314e3, -1315778400, -1301259600, -1284328800, -126981e4, -1253484e3, -1238360400, -1221429600, -1206910800, -118998e4, -1175461200, -1159135200, -1143406800, -1126476e3, -1111957200, -1095631200, -1080507600, -1063576800, -1049058e3, -1032127200, -1017608400, -1001282400, -986158800, -969228e3, -950475600, -942012e3, -904514400, -896043600, -875484e3, -864594e3, -844034400, -832539600, -812584800, -798066e3, -781048800, -772059600, -764802e3, -748476e3, -733352400, -719445600, -717026400, -706741200, -699483600, -687996e3, -668034e3, -654732e3, -636584400, -622072800, -605739600, -590623200, -57429e4, -558568800, -542235600, -527119200, -512600400, -496274400, -481150800, -46422e4, -449701200, -432165600, -417646800, -401320800, -386197200, -369266400, -354747600, -337816800, -323298e3, -306972e3, -291848400, -276732e3, -257979600, -245282400, -22653e4, -213228e3, -195080400, -182383200, -163630800, -150933600, -132181200, -119484e3, -100731600, -88034400, -68677200, -59004e3, -37238400, 57726e3, 69818400, 89175600, 101268e3, 120625200, 132717600, 152074800, 164167200, 183524400, 196221600, 214974e3, 227671200, 246423600, 259120800, 278478e3, 290570400, 309927600, 32202e4, 341377200, 354675600, 372823200, 386125200, 404272800, 417574800, 435722400, 449024400, 467776800, 481078800, 499226400, 512528400, 530676e3, 543978e3, 562125600, 575427600, 593575200, 606877200, 625629600, 638326800, 657079200, 670381200, 688528800, 701830800, 719978400, 733280400, 751428e3, 76473e4, 782877600, 796179600, 814327200, 828234e3, 846381600, 859683600, 877831200, 891133200, 909280800, 922582800, 941335200, 954032400, 972784800, 985482e3, 1004234400, 1017536400, 1035684e3, 1048986e3, 1067133600, 1080435600, 1099188e3, 1111885200, 1130637600, 1143334800, 1162087200, 1174784400, 1193536800, 1206838800, 1224986400, 1238288400, 1256436e3, 1269738e3, 1288490400, 1301187600, 131994e4, 1332637200, 1351389600, 1364691600, 1382839200, 1396141200, 1414288800, 1427590800, 1445738400, 1459040400, 1477792800, 149049e4, 1509242400, 1521939600, 1540692e3, 1553994e3, 1572141600, 1585443600, 1603591200, 1616893200, 1635645600, 1648342800, 1667095200, 1679792400, 1698544800, 1711846800, 1729994400, 1743296400, 1761444e3, 1774746e3, 1792893600, 1806195600, 1824948e3, 1837645200, 1856397600, 1869094800, 1887847200, 1901149200, 1919296800, 1932598800],
                offset: [-75, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 0, 3600, 0, 3600, 7200, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0]
            },
            "Europe/Madrid": {
                time: [-2177452800, -1661734800, -1648425600, -1631926800, -1616889600, -1601254800, -1585353600, -1442451600, -1427673600, -1379293200, -1364774400, -1348448400, -1333324800, -1316394e3, -1301270400, -1284339600, -1269820800, -1029114e3, -1017619200, -1002848400, -986169600, -969238800, -954115200, -940208400, -873075600, -862531200, -842835600, -828230400, -811386e3, -796003200, -779936400, -765414e3, -748486800, -733881600, -652323600, -639183600, 135126e3, 150253200, 167180400, 181702800, 196815600, 212547600, 22887e4, 243997200, 260406e3, 276051600, 29178e4, 307508400, 323834400, 338958e3, 354679200, 370407600, 386128800, 401857200, 417578400, 433306800, 449028e3, 465361200, 481082400, 496810800, 512532e3, 528260400, 543981600, 55971e4, 575431200, 591159600, 606880800, 622609200, 638330400, 654663600, 670384800, 686113200, 701834400, 717562800, 733284e3, 749012400, 764733600, 780462e3, 796183200, 811911600, 828237600, 846385200, 859687200, 877834800, 891136800, 909284400, 922586400, 941338800, 954036e3, 972788400, 985485600, 1004238e3, 101754e4, 1035687600, 1048989600, 1067137200, 1080439200, 1099191600, 1111888800, 1130641200, 1143338400, 1162090800, 1174788e3, 1193540400, 1206842400, 122499e4, 1238292e3, 1256439600, 1269741600, 1288494e3, 1301191200, 1319943600, 1332640800, 1351393200, 1364695200, 1382842800, 1396144800, 1414292400, 1427594400, 1445742e3, 1459044e3, 1477796400, 1490493600, 1509246e3, 1521943200, 1540695600, 1553997600, 1572145200, 1585447200, 1603594800, 1616896800, 1635649200, 1648346400, 1667098800, 1679796e3, 1698548400, 1711850400, 1729998e3, 17433e5, 1761447600, 1774749600, 1792897200, 1806199200, 1824951600, 1837648800, 1856401200, 1869098400, 1887850800, 1901152800, 1919300400, 1932602400],
                offset: [-884, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600]
            },
            "Europe/Paris": {
                time: [-2486678340, -1855958340, -1689814800, -1680393600, -1665363600, -1648339200, -1635123600, -1616889600, -1604278800, -158544e4, -1574038800, -1552262400, -1539997200, -1520553600, -1507510800, -1490572800, -1470618e3, -1459123200, -1444006800, -1427673600, -1411952400, -1396224e3, -1379293200, -1364774400, -1348448400, -1333324800, -1316394e3, -1301270400, -1284339600, -1269820800, -1253494800, -1238371200, -1221440400, -1206921600, -1191200400, -1175472e3, -1160355600, -1143417600, -1127696400, -1111968e3, -1096851600, -1080518400, -1063587600, -1049068800, -1033347600, -1017619200, -1002502800, -986169600, -969238800, -950486400, -942012e3, -932432400, -85725e4, -844552800, -828219600, -812498400, -800064e3, -796258800, -781048800, -766616400, 196822800, 212547600, 228880800, 244004400, 260330400, 276058800, 29178e4, 307508400, 323834400, 338958e3, 354679200, 370407600, 386128800, 401857200, 417578400, 433306800, 449028e3, 465361200, 481082400, 496810800, 512532e3, 528260400, 543981600, 55971e4, 575431200, 591159600, 606880800, 622609200, 638330400, 654663600, 670384800, 686113200, 701834400, 717562800, 733284e3, 749012400, 764733600, 780462e3, 796183200, 811911600, 828237600, 846385200, 859687200, 877834800, 891136800, 909284400, 922586400, 941338800, 954036e3, 972788400, 985485600, 1004238e3, 101754e4, 1035687600, 1048989600, 1067137200, 1080439200, 1099191600, 1111888800, 1130641200, 1143338400, 1162090800, 1174788e3, 1193540400, 1206842400, 122499e4, 1238292e3, 1256439600, 1269741600, 1288494e3, 1301191200, 1319943600, 1332640800, 1351393200, 1364695200, 1382842800, 1396144800, 1414292400, 1427594400, 1445742e3, 1459044e3, 1477796400, 1490493600, 1509246e3, 1521943200, 1540695600, 1553997600, 1572145200, 1585447200, 1603594800, 1616896800, 1635649200, 1648346400, 1667098800, 1679796e3, 1698548400, 1711850400, 1729998e3, 17433e5, 1761447600, 1774749600, 1792897200, 1806199200, 1824951600, 1837648800, 1856401200, 1869098400, 1887850800, 1901152800, 1919300400, 1932602400],
                offset: [561, 561, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 0, 3600, 7200, 3600, 7200, 3600, 7200, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600]
            },
            "Europe/Warsaw": {
                time: [-2840140800, -1717027200, -1693702800, -1680476400, -1663452e3, -1650142800, -1632002400, -1618693200, -1600466400, -1587157200, -1501718400, -931730400, -85725e4, -844552800, -828219600, -812498400, -796600800, -778723200, -762652800, -748483200, -733266e3, -715212e3, -701902800, -684972e3, -670453200, -654127200, -639003600, -397090800, -386805600, -371084400, -355356e3, -334191600, -323301600, -307580400, -291852e3, -271292400, -260402400, -239842800, -228952800, -208393200, -197503200, -176338800, -166053600, 228877200, 244000800, 260326800, 276055200, 291776400, 307504800, 323830800, 338954400, 354675600, 370404e3, 386125200, 401853600, 417574800, 433303200, 449024400, 465357600, 481078800, 496807200, 512528400, 528256800, 543978e3, 559706400, 575431200, 591159600, 606880800, 622609200, 638330400, 654663600, 670384800, 686113200, 701834400, 717562800, 733284e3, 749012400, 764733600, 780462e3, 796183200, 811911600, 828237600, 846385200, 859687200, 877834800, 891136800, 909284400, 922586400, 941338800, 954036e3, 972788400, 985485600, 1004238e3, 101754e4, 1035687600, 1048989600, 1067137200, 1080439200, 1099191600, 1111888800, 1130641200, 1143338400, 1162090800, 1174788e3, 1193540400, 1206842400, 122499e4, 1238292e3, 1256439600, 1269741600, 1288494e3, 1301191200, 1319943600, 1332640800, 1351393200, 1364695200, 1382842800, 1396144800, 1414292400, 1427594400, 1445742e3, 1459044e3, 1477796400, 1490493600, 1509246e3, 1521943200, 1540695600, 1553997600, 1572145200, 1585447200, 1603594800, 1616896800, 1635649200, 1648346400, 1667098800, 1679796e3, 1698548400, 1711850400, 1729998e3, 17433e5, 1761447600, 1774749600, 1792897200, 1806199200, 1824951600, 1837648800, 1856401200, 1869098400, 1887850800, 1901152800, 1919300400, 1932602400],
                offset: [5040, 5040, 3600, 7200, 3600, 7200, 3600, 7200, 7200, 10800, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600]
            },
            "Europe/Istanbul": { time: [-2840140800, -1869868800, -1693699200, -168048e4, -1570406400, -1552176e3, -1538352e3, -1522540800, -1507507200, -1490572800, -1440201600, -1428019200, -1409702400, -1396483200, -931132800, -922752e3, -917827200, -892425600, -875836800, -857347200, -781056e3, -764726400, -744336e3, -733795200, -716428800, -701913600, -684979200, -670464e3, -654134400, -639014400, -621820800, -60696e4, -590025600, -575424e3, -235612800, -228268800, -177724800, -165715200, 10540800, 23846400, 41990400, 55296e3, 74044800, 87350400, 107917200, 12123e4, 133927200, 152686800, 165369600, 183513600, 202435200, 215568e3, 228873600, 245808e3, 260323200, 277257600, 308793600, 323838e3, 340243200, 354682800, 371692800, 386132400, 403142400, 428457600, 433900800, 482803200, 496713600, 512528400, 528256800, 543978e3, 559706400, 575427600, 591156e3, 606877200, 622605600, 638326800, 65466e4, 670381200, 686109600, 701830800, 717559200, 733280400, 749008800, 764125200, 780458400, 796179600, 811908e3, 828234e3, 846381600, 859683600, 877831200, 891133200, 909280800, 922582800, 941335200, 954032400, 972784800, 985482e3, 1004234400, 1017536400, 1035684e3, 1048986e3, 1067133600, 1080435600, 1099188e3, 1111885200, 1130637600, 1143334800, 1162087200, 1174791600, 1193544e3, 1206846e3, 1224993600, 1238295600, 1256443200, 1269745200, 1288497600, 1301281200, 1319947200, 1332644400, 1351396800, 1364698800, 1382846400, 1396234800, 1414296e3, 1427598e3, 1446955200, 1459047600, 1473206400, 1925002800], offset: [6952, 7016, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 14400, 10800, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 7200, 10800, 10800] },
            "Europe/Zurich": {
                time: [-3675196800, -2385244800, -904431600, -891122400, -872982e3, -859672800, 354679200, 370407600, 386128800, 401857200, 417578400, 433306800, 449028e3, 465361200, 481082400, 496810800, 512532e3, 528260400, 543981600, 55971e4, 575431200, 591159600, 606880800, 622609200, 638330400, 654663600, 670384800, 686113200, 701834400, 717562800, 733284e3, 749012400, 764733600, 780462e3, 796183200, 811911600, 828237600, 846385200, 859687200, 877834800, 891136800, 909284400, 922586400, 941338800, 954036e3, 972788400, 985485600, 1004238e3, 101754e4, 1035687600, 1048989600, 1067137200, 1080439200, 1099191600, 1111888800, 1130641200, 1143338400, 1162090800, 1174788e3, 1193540400, 1206842400, 122499e4, 1238292e3, 1256439600, 1269741600, 1288494e3, 1301191200, 1319943600, 1332640800, 1351393200, 1364695200, 1382842800, 1396144800, 1414292400, 1427594400, 1445742e3, 1459044e3, 1477796400, 1490493600, 1509246e3, 1521943200, 1540695600, 1553997600, 1572145200, 1585447200, 1603594800, 1616896800, 1635649200, 1648346400, 1667098800, 1679796e3, 1698548400, 1711850400, 1729998e3, 17433e5, 1761447600, 1774749600, 1792897200, 1806199200, 1824951600, 1837648800, 1856401200, 1869098400, 1887850800, 1901152800, 1919300400, 1932602400],
                offset: [2048, 1786, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600, 7200, 3600]
            },
            "Australia/Sydney": {
                time: [-2364076800, -1672531140, -1665352800, -883605600, -876088800, -860364e3, -844639200, -828309600, -813189600, 57722400, 68007600, 89172e3, 100062e3, 120621600, 131511600, 152071200, 162961200, 183520800, 195015600, 215575200, 226465200, 247024800, 257914800, 278474400, 289364400, 309924e3, 320814e3, 341373600, 352263600, 372823200, 386737200, 404877600, 415767600, 436327200, 447217200, 467776800, 478666800, 499226400, 511326e3, 530071200, 542775600, 562125600, 57483e4, 59418e4, 606279600, 625629600, 636519600, 657079200, 667969200, 688528800, 699418800, 719978400, 731473200, 752032800, 762922800, 783482400, 794372400, 814932e3, 828241200, 846381600, 859690800, 877831200, 891140400, 909280800, 92259e4, 941335200, 954039600, 967341600, 985489200, 1004234400, 1017543600, 1035684e3, 1048993200, 1067133600, 1080442800, 1099188e3, 1111892400, 1130637600, 1143946800, 1162087200, 1174791600, 1193536800, 1207450800, 1223172e3, 1238900400, 1254621600, 127035e4, 1286071200, 1301799600, 1317520800, 1333249200, 1349575200, 1365303600, 1381024800, 1396753200, 1412474400, 1428202800, 1443924e3, 1459652400, 1475373600, 1491102e3, 1506823200, 1522551600, 1538877600, 1554606e3, 1570327200, 1586055600, 1601776800, 1617505200, 1633226400, 1648954800, 1664676e3, 1680404400, 1696125600, 1712458800, 172818e4, 1743908400, 1759629600, 1775358e3, 1791079200, 1806807600, 1822528800, 1838257200, 1853978400, 1869706800, 1886032800, 1901761200, 1917482400, 1933210800],
                offset: [36292, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600]
            },
            "Australia/Brisbane": { time: [-2366755200, -1672531140, -1665352800, -883605600, -876088800, -860364e3, -844639200, -828309600, -813189600, 57722400, 68007600, 625629600, 636519600, 657079200, 667969200, 688528800, 699418800, 1925028e3], offset: [36728, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3] },
            "Australia/Adelaide": {
                time: [-2364076800, -2230156800, -1672531140, -1665352800, -883605600, -876088800, -860364e3, -844639200, -828309600, -813189600, 57722400, 68007600, 89172e3, 100062e3, 120621600, 131511600, 152071200, 162961200, 183520800, 195015600, 215575200, 226465200, 247024800, 257914800, 278474400, 289364400, 309924e3, 320814e3, 341373600, 352263600, 372823200, 384318e3, 404877600, 415767600, 436327200, 447217200, 467776800, 478666800, 499226400, 511326e3, 530071200, 542775600, 562125600, 57483e4, 59418e4, 606279600, 625629600, 637729200, 657079200, 667969200, 688528800, 701233200, 719978400, 731473200, 752032800, 764132400, 783482400, 796186800, 814932e3, 828241200, 846381600, 859690800, 877831200, 891140400, 909280800, 92259e4, 941335200, 954039600, 972784800, 985489200, 1004234400, 1017543600, 1035684e3, 1048993200, 1067133600, 1080442800, 1099188e3, 1111892400, 1130637600, 1143946800, 1162087200, 1174791600, 1193536800, 1207450800, 1223172e3, 1238900400, 1254621600, 127035e4, 1286071200, 1301799600, 1317520800, 1333249200, 1349575200, 1365303600, 1381024800, 1396753200, 1412474400, 1428202800, 1443924e3, 1459652400, 1475373600, 1491102e3, 1506823200, 1522551600, 1538877600, 1554606e3, 1570327200, 1586055600, 1601776800, 1617505200, 1633226400, 1648954800, 1664676e3, 1680404400, 1696125600, 1712458800, 172818e4, 1743908400, 1759629600, 1775358e3, 1791079200, 1806807600, 1822528800, 1838257200, 1853978400, 1869706800, 1886032800, 1901761200, 1917482400, 1933210800],
                offset: [33260, 32400, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800, 34200, 37800]
            },
            "Australia/ACT": { time: [-2364076800, -1672531140, -1665352800, -883605600, -876088800, -860364e3, -844639200, -828309600, -813189600, 57722400, 68007600, 89172e3, 100062e3, 120621600, 131511600, 152071200, 162961200, 183520800, 195015600, 215575200, 226465200, 247024800, 257914800, 278474400, 289364400, 309924e3, 320814e3, 341373600, 352263600, 372823200, 386737200, 404877600, 415767600, 436327200, 447217200, 467776800, 478666800, 499226400, 511326e3, 530071200, 542775600, 562125600, 57483e4, 59418e4, 606279600, 625629600, 636519600, 657079200, 667969200, 688528800, 699418800, 719978400, 731473200, 752032800, 762922800, 783482400, 794372400, 814932e3, 828241200, 846381600, 859690800, 877831200, 891140400, 909280800, 92259e4, 941335200, 954039600, 967341600, 985489200, 1004234400, 1017543600, 1035684e3, 1048993200, 1067133600, 1080442800, 1099188e3, 1111892400, 1130637600, 1143946800, 1162087200, 1174791600, 1193536800, 1207450800, 1223172e3, 1238900400, 1254621600, 127035e4, 1286071200, 1301799600, 1317520800, 1333249200, 1349575200, 1365303600, 1381024800, 1396753200, 1412474400, 1428202800, 1443924e3, 1459652400, 1475373600, 1491102e3, 1506823200, 1522551600, 1538877600, 1554606e3, 1570327200, 1586055600, 1601776800, 1617505200, 1633226400, 1648954800, 1664676e3, 1680404400, 1696125600, 1712458800, 172818e4, 1743908400, 1759629600, 1775358e3, 1791079200, 1806807600, 1822528800, 1838257200, 1853978400, 1869706800, 1886032800, 1901761200, 1917482400, 1933210800], offset: [36292, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600, 36e3, 39600] },
            "Asia/Almaty": {
                time: [-1441152e3, -1247529600, 354931200, 370742400, 386467200, 402278400, 418003200, 433814400, 449625600, 465361200, 481082400, 496810800, 512532e3, 528260400, 543981600, 55971e4, 575431200, 591159600, 606880800, 622609200, 638330400, 654663600, 670384800, 686113200, 695786400, 701834400, 717562800, 733284e3, 749012400, 764733600, 780462e3, 796183200, 811911600, 828237600, 846385200, 859687200, 877834800, 891136800, 909284400, 922586400, 941338800, 954036e3, 972788400, 985485600, 1004238e3, 101754e4, 1035687600, 1048989600, 1067137200, 1080439200, 1099191600, 1925013600],
                offset: [18468, 18e3, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 21600, 18e3, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600, 25200, 21600]
            },
            "Asia/Ashkhabad": { time: [-1441152e3, -1247529600, 354931200, 370742400, 386467200, 402278400, 418003200, 433814400, 449625600, 465361200, 481082400, 496810800, 512532e3, 528260400, 543981600, 55971e4, 575431200, 591159600, 606880800, 622609200, 638330400, 654663600, 670384800, 686113200, 695786400, 192501e4], offset: [14012, 14400, 18e3, 21600, 18e3, 21600, 18e3, 21600, 18e3, 21600, 18e3, 21600, 18e3, 21600, 18e3, 21600, 18e3, 21600, 18e3, 21600, 18e3, 21600, 18e3, 18e3, 14400, 18e3] },
            "Asia/Tokyo": { time: [-2587678861, -2335219200, -1017792e3, -683762400, -672357600, -654732e3, -640908e3, -620258400, -609458400, -588808800, -578008800, 1925024400], offset: [33539, 32400, 32400, 32400, 36e3, 32400, 36e3, 32400, 36e3, 32400, 36e3, 32400] },
            "Asia/Taipei": { time: [-2335219200, -1017792e3, -766191600, -745804800, -733795200, -716860800, -699580800, -683856e3, -670636800, -65232e4, -639100800, -620784e3, -607564800, -589248e3, -576028800, -562896e3, -541728e3, -528681600, -510192e3, -497145600, -478656e3, -465609600, -449798400, -433987200, -418176e3, -402451200, -38664e4, -370915200, -355104e3, -339379200, -323568e3, -302486400, -291945600, -270950400, -260409600, 134006400, 149817600, 165542400, 181353600, 299635200, 307584e3, 1925020800], offset: [29160, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800] },
            "Asia/Singapore": { time: [-2177452800, -2038176e3, -1167609600, -1073001600, -894153600, -879638400, -766972800, -138758400, 378691200, 1925020800], offset: [24925, 24925, 25200, 26400, 26400, 27e3, 32400, 27e3, 27e3, 28800] },
            "Asia/Shanghai": { time: [-2177452800, -933465600, -923097600, -908755200, -891561600, 515548800, 52704e4, 545184e3, 558489600, 576633600, 589939200, 608688e3, 621993600, 640137600, 653443200, 671587200, 684892800, 1925020800], offset: [29143, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800] },
            "Asia/Seoul": {
                time: [-1948752e3, -1830384e3, -1017792e3, -767318400, -498096e3, -462672e3, -451699200, -429753600, -418262400, -399513600, -387417600, -368064e3, -355968e3, -336614400, -324518400, -305164800, -293068800, -264902400, 547610400, 560919600, 57906e4, 592369200, 1925024400],
                offset: [30472, 30600, 32400, 32400, 32400, 30600, 34200, 30600, 34200, 30600, 34200, 30600, 34200, 30600, 34200, 30600, 34200, 30600, 32400, 36e3, 32400, 36e3, 32400]
            },
            "Asia/Tehran": { time: [-1704153600, -757382400, 247190400, 259286400, 277776e3, 283996800, 290822400, 306547200, 322444800, 338515200, 673228800, 685497600, 701222400, 71712e4, 732758400, 748656e3, 764294400, 780192e3, 795830400, 811728e3, 827366400, 843264e3, 858988800, 874886400, 890524800, 906422400, 922060800, 937958400, 953596800, 969494400, 985219200, 1001116800, 1016755200, 1032652800, 1048291200, 1064188800, 1079827200, 1095724800, 1111449600, 1127347200, 1206057600, 1221955200, 123768e4, 1253577600, 1269216e3, 1285113600, 1300752e3, 1316649600, 1332288e3, 1348185600, 1363910400, 1379808e3, 1395446400, 1411344e3, 1426982400, 144288e4, 1458518400, 1474416e3, 1490140800, 1506038400, 1521676800, 1537574400, 1553212800, 1569110400, 1584748800, 1600646400, 1616371200, 1632268800, 1647907200, 1663804800, 1679443200, 1695340800, 1710979200, 1726876800, 1742601600, 1758499200, 1774137600, 1790035200, 1805673600, 1821571200, 1837209600, 1853107200, 1868745600, 1884643200, 1900368e3, 1916265600, 1931904e3], offset: [12344, 12344, 12600, 14400, 18e3, 14400, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600, 16200, 12600] },
            "Asia/Dubai": { time: [-1577923200, 1925006400], offset: [13272, 14400] },
            "Asia/Kolkata": { time: [-2840140800, -891561600, -872035200, -862617600, -764121600, 1925011800], offset: [21208, 21200, 23400, 19800, 23400, 19800] },
            "Asia/Hong_Kong": { time: [-2056665600, -907360200, -891635400, -884217600, -766713600, -747952200, -728512200, -717021e3, -694470600, -683757e3, -668032200, -654726600, -636582600, -623277e3, -605133e3, -591827400, -573683400, -559773e3, -542320200, -528323400, -510179400, -498083400, -478729800, -466633800, -446675400, -435184200, -415225800, -403129800, -383776200, -371680200, -352326600, -340230600, -320877e3, -308781e3, -288822600, -277331400, -257373e3, -245881800, -225923400, -213827400, -194473800, -182377800, -163024200, -148509e3, -132784200, -117059400, -101334600, -85609800, -69280200, -53555400, -37830600, -22105800, -6381e3, 9343800, 25068600, 40793400, 56518200, 72243e3, 88572600, 104297400, 120022200, 126070200, 151471800, 167196600, 182921400, 198646200, 214371e3, 295414200, 309324600, 1925020800], offset: [27402, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800, 32400, 28800] },
            "Asia/Bangkok": {
                time: [-2840140800, -1570060800, 1925017200],
                offset: [24124, 24124, 25200]
            },
            "Pacific/Auckland": { time: [-3192393600, -1330293600, -1320012e3, -1300658400, -1287352800, -1269208800, -1255903200, -1237759200, -1224453600, -1206309600, -1192399200, -117486e4, -1160949600, -1143410400, -1125871200, -1112565600, -1094421600, -1081116e3, -1062972e3, -1049666400, -1031522400, -1018216800, -1000072800, -986767200, -968018400, -955317600, -936568800, -923263200, -757382400, 152676e3, 162356400, 183520800, 195015600, 215575200, 226465200, 247024800, 257914800, 278474400, 289364400, 309924e3, 320814e3, 341373600, 352263600, 372823200, 384318e3, 404877600, 415767600, 436327200, 447217200, 467776800, 478666800, 499226400, 510116400, 530676e3, 541566e3, 562125600, 573620400, 59418e4, 60507e4, 623815200, 637729200, 655264800, 669178800, 686714400, 700628400, 718164e3, 732682800, 749613600, 764132400, 781063200, 795582e3, 812512800, 827031600, 844567200, 858481200, 876016800, 889930800, 907466400, 921985200, 938916e3, 953434800, 970365600, 984884400, 100242e4, 1016334e3, 1033869600, 1047783600, 1065319200, 1079838e3, 1096768800, 1111287600, 1128218400, 1142737200, 1159668e3, 1174186800, 1191117600, 1207450800, 1222567200, 1238900400, 1254016800, 127035e4, 1285466400, 1301799600, 1316916e3, 1333249200, 1348970400, 1365303600, 138042e4, 1396753200, 1411869600, 1428202800, 1443319200, 1459652400, 1474768800, 1491102e3, 1506218400, 1522551600, 1538272800, 1554606e3, 1569722400, 1586055600, 1601172e3, 1617505200, 1632621600, 1648954800, 1664071200, 1680404400, 1695520800, 1712458800, 1727575200, 1743908400, 1759024800, 1775358e3, 1790474400, 1806807600, 1821924e3, 1838257200, 1853373600, 1869706800, 1885428e3, 1901761200, 1916877600, 1933210800], offset: [41944, 41400, 45e3, 41400, 43200, 41400, 43200, 41400, 43200, 41400, 43200, 41400, 43200, 41400, 43200, 41400, 43200, 41400, 43200, 41400, 43200, 41400, 43200, 41400, 43200, 41400, 43200, 41400, 43200, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800, 43200, 46800] },
            "Pacific/Chatham": {
                time: [-3192393600, -757382400, 152678700, 162359100, 183523500, 195018300, 215577900, 226467900, 247027500, 257917500, 278477100, 289367100, 309926700, 320816700, 341376300, 352266300, 372825900, 384320700, 404880300, 415770300, 436329900, 447219900, 467779500, 478669500, 499229100, 510119100, 530678700, 541568700, 562128300, 573623100, 594182700, 605072700, 623817900, 637731900, 655267500, 669181500, 686717100, 700631100, 718166700, 732685500, 749616300, 764135100, 781065900, 795584700, 812515500, 827034300, 844569900, 858483900, 876019500, 889933500, 907469100, 921987900, 938918700, 953437500, 970368300, 984887100, 1002422700, 1016336700, 1033872300, 1047786300, 1065321900, 1079840700, 1096771500, 1111290300, 1128221100, 1142739900, 1159670700, 1174189500, 1191120300, 1207453500, 1222569900, 1238903100, 1254019500, 1270352700, 1285469100, 1301802300, 1316918700, 1333251900, 1348973100, 1365306300, 1380422700, 1396755900, 1411872300, 1428205500, 1443321900, 1459655100, 1474771500, 1491104700, 1506221100, 1522554300, 1538275500, 1554608700, 1569725100, 1586058300, 1601174700, 1617507900, 1632624300, 1648957500, 1664073900, 1680407100, 1695523500, 1712461500, 1727577900, 1743911100, 1759027500, 1775360700, 1790477100, 1806810300, 1821926700, 1838259900, 1853376300, 1869709500, 1885430700, 1901763900, 1916880300, 1933213500],
                offset: [44028, 44100, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500, 45900, 49500]
            },
            "Pacific/Fakaofo": { time: [-2177452800, 1325203200, 1925038800], offset: [-41096, -39600, 46800] },
            "Pacific/Honolulu": { time: [-2334139200, -1157320800, -1155470400, -880236e3, -765410400, -712188e3, 1924956e3], offset: [-37886, -37800, -34200, -37800, -34200, -37800, -36e3] },
            "America/Mexico_City": {
                time: [-1514763396, -1343091600, -1234828800, -1220317200, -1207180800, -1191369600, -975283200, -963187200, -917136e3, -907372800, -821923200, -810086400, -627523200, -613008e3, 828842400, 846381600, 860292e3, 877831200, 891741600, 909280800, 923191200, 941335200, 954640800, 972784800, 989114400, 1001815200, 1018144800, 1035684e3, 1049594400, 1067133600, 1081044e3, 1099188e3, 1112493600, 1130637600, 1143943200, 1162087200, 1175392800, 1193536800, 1207447200, 1224986400, 1238896800, 1256436e3, 1270346400, 1288490400, 1301796e3, 131994e4, 1333245600, 1351389600, 13653e5, 1382839200, 1396749600, 1414288800, 1428199200, 1445738400, 1459648800, 1477792800, 1491098400, 1509242400, 1522548e3, 1540692e3, 1554602400, 1572141600, 1586052e3, 1603591200, 1617501600, 1635645600, 1648951200, 1667095200, 1680400800, 1698544800, 1712455200, 1729994400, 1743904800, 1761444e3, 1775354400, 1792893600, 1806804e3, 1824948e3, 1838253600, 1856397600, 1869703200, 1887847200, 1901757600, 1919296800, 1933207200],
                offset: [-23796, -25200, -21600, -25200, -21600, -25200, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600, -18e3, -21600]
            },
            "Africa/Johannesburg": { time: [-2458166400, -2109283200, -860968800, -845244e3, -829519200, -813794400, 1924999200], offset: [6720, 5400, 7200, 10800, 7200, 10800, 7200] },
            "Asia/Kathmandu": { time: [-1577923200, 504921600, 1925012700], offset: [20476, 19800, 20700] },
            "US/Mountain": {
                time: [-2717668796, -1633298400, -1615154400, -1601848800, -1583704800, -1570399200, -1551650400, -1538949600, -1534111200, -880236e3, -769417200, -765410400, -147909600, -13158e4, -11646e4, -100130400, -84405600, -68680800, -52956e3, -37231200, -21506400, -5781600, 9943200, 25668e3, 41392800, 57722400, 73447200, 89172e3, 104896800, 120621600, 126669600, 152071200, 162352800, 183520800, 199245600, 215575200, 230695200, 247024800, 262749600, 278474400, 294199200, 309924e3, 325648800, 341373600, 357098400, 372823200, 388548e3, 404877600, 419997600, 436327200, 452052e3, 467776800, 483501600, 499226400, 514951200, 530676e3, 544586400, 562125600, 576036e3, 59418e4, 607485600, 625629600, 638935200, 657079200, 670989600, 688528800, 702439200, 719978400, 733888800, 752032800, 765338400, 783482400, 796788e3, 814932e3, 828842400, 846381600, 860292e3, 877831200, 891741600, 909280800, 923191200, 941335200, 954640800, 972784800, 986090400, 1004234400, 1018144800, 1035684e3, 1049594400, 1067133600, 1081044e3, 1099188e3, 1112493600, 1130637600, 1143943200, 1162087200, 1173578400, 1194141600, 1205028e3, 1225591200, 1236477600, 1257040800, 1268532e3, 1289095200, 1299981600, 1320544800, 1331431200, 1351994400, 1362880800, 1383444e3, 1394330400, 1414893600, 142578e4, 1446343200, 1457834400, 1478397600, 1489284e3, 1509847200, 1520733600, 1541296800, 1552183200, 1572746400, 1583632800, 1604196e3, 1615687200, 1636250400, 1647136800, 16677e5, 1678586400, 1699149600, 1710036e3, 1730599200, 1741485600, 1762048800, 1772935200, 1793498400, 1804989600, 1825552800, 1836439200, 1857002400, 1867888800, 1888452e3, 1899338400, 1919901600, 1930788e3],
                offset: [-25196, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200, -21600, -25200]
            }
        };
        void 0 !== t && t.exports ? t.exports = e : window.TzData = e
    }()
}, 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.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, 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.selectable = function(e) {
            return this.each(function() {
                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(t, e, i) {
    (function(e) {
        "use strict";

        function o() {}
        var n = i(255).AddCompareDialog,
            s = i(34),
            r = i(140),
            a = i(12).getLogger("Chart.ChartHeaderWidget");
        TradingView.SYMBOL_SEARCH_MAX_LENGTH = 100, o.prototype._createBarsGroup = function(t) { var e = this.createGroup("bars-style", { single: !0 }); return t._style_list.element().appendTo(e), e }, o.prototype._createPropertiesGroup = function(t, o) { var n, s = this.createGroup("properties", { single: !0 }); return this._onWidget && !e.enabled("header_settings") || (n = $("<span>").addClass("button iconed properties apply-common-tooltip").append($(i(889)).attr({ width: 17, height: 17 })).appendTo(s), n.on(t, function(t) { t.pageX = n.offset().left, t.pageY = n.offset().top + n.height() + 15, TVSettings.getValue("properties_dialog.active_tab.chart") || TVSettings.setValue("properties_dialog.active_tab.chart", $.t("Style")), o.activeChartWidget.value().showChartProperties({ _lastEvent: t }).then(function(t) { n.addClass("active"), t.on("destroy", function() { n.removeClass("active") }) }) }), n.attr("title", $.t("Chart Properties"))), s }, o.prototype._createCompareGroup = function(t, e, o) {
            var s = this.createGroup("compare", { single: !0 }),
                r = $('<a class="button toggle-caption compare apply-common-tooltip">').append($(i(848))).append($('<span class="caption">' + $.t("Compare") + "</span>")).appendTo(s);
            return this._compareButton = r, this._compareButton.on(o, function(t) {
                var i, o;
                t.preventDefault(), i = new n(e), o = i.show(), r.addClass("active"), o.on("destroy", function() { r.removeClass("active") })
            }), this._compareButton.attr("title", $.t("Compare or Add Symbol")), s
        }, o.prototype._createIndicatorsGroup = function(t, o) {
            var n, a = this.createGroup("indicators", { single: !0, showInNarrowView: !0 });
            return this._indicatorsButton = $('<a class="button toggle-caption indicators' + (this._onWidget ? " no-last" : "") + ' apply-common-tooltip">').append($(i(863))).append($('<span class="caption">' + $.t("Indicators") + "</span>")).appendTo(a), n = "\n/", e.enabled("charting_library_base") || e.enabled("widget") ? this._indicatorsButton.attr("title", $.t("Indicators")) : this._indicatorsButton.attr("title", $.t("Indicators, Fundamentals, Economy and Add-ons") + n), this._indicatorsButton.on(t, function(t) { t.preventDefault(), window.studyMarket.isVisible() ? window.studyMarket.hide() : (window.studyMarket.show(), s.emit("indicators_dialog")) }), r.registerListener("IndicatorsHotkey", function(t) { if (47 === t.which && $(t.target).is("body") && !window.studyMarket.isVisible()) return window.studyMarket.show(), window.studyMarket.selectSearchPage(), t.preventDefault(), t.stopPropagation(), !0 }), window.studyMarket.visibilityChanged.subscribe(this, function(t) { this._indicatorsButton.toggleClass("active", t) }), !TradingView.onWidget() && e.enabled("study_templates") && studyTemplates.appendMenuButtonTo(a), a
        }, o.prototype.createGroup = function(t, e) { e = e || {}; var i = $("<div>").addClass("group"); return e.right && i.addClass("right"), e.single && i.addClass("space-single"), t && i.addClass("header-group-" + t), i }, o.prototype.bindToModel = function() {
            var t = this._chartWidget.model();
            this._model = t
        }, o.prototype.backButton = function() { return this._backButton }, o.prototype.saveLoadWidget = function() { return this._saveLoad || a.logWarn("No save-load widget created in footer") }, o.prototype.styleIconPosition = function(t) { return "-%1px 0".replace("%1", 19 * ~~t) }, o.styleIconPosition = o.prototype.styleIconPosition, t.exports = o
    }).call(e, i(3))
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t) {
            function o() { if (!t.favoriteChartTypes) return []; var e = { Bars: u.STYLE_BARS, Candles: u.STYLE_CANDLES, Line: u.STYLE_LINE, Area: u.STYLE_AREA, "Heiken Ashi": u.STYLE_HEIKEN_ASHI, "Hollow Candles": u.STYLE_HOLLOW_CANDLES }; return t.favoriteChartTypes.map(function(t) { return e[t] }) }
            var a, f, m, g, v, y, b, w, S, T, C, x, P, L, k, I, A, E, M, D;
            t = t || {}, a = this._chartWidgetCollection = t.chartWidgetCollection, f = this._chartWidget = a.activeChartWidget.value(), m = this._onWidget = f.onWidget(), g = this, v = Modernizr.touch ? "touchstart" : "click", this._onResizeRequested = !1, this._resizerBridge = t.resizerBridge, this._$root = $(t.resizerBridge.body.value()), this._$root.addClass("header-chart-panel").html('<div class="header-chart-panel-sizer"><div class="header-chart-panel-content"><div class="right"></div><div class="left"></div></div></div>'), this._$sizer = this._$root.find(".header-chart-panel-sizer"), this._$content = this._$root.find(".header-chart-panel-content"), this._$left = this._$root.find(".left"), this._$right = this._$root.find(".right"), this._itemsVisibility = t.itemsVisibility, a.readOnly() || (e.enabled("header_symbol_search") && (y = this.createGroup("symbol-search").appendTo(this._$left), b = $('<div class="symbol-edit-widget no-last"></div>').appendTo(y), w = $('<div class="symbol-edit-wrap">').appendTo(b), S = null, !e.enabled("charting_library_base") && d.canShowSpreadActions() && (T = $('<div class="symbol-edit-buttonswrap">').appendTo(w), S = $('<div class="spread-actions">').appendTo(T).on("mousedown", function(t) { t.preventDefault() })), C = $('<div class="symbol-edit-inputspacer">').appendTo(w), x = $('<input type="text" class="symbol-edit" maxlenght="' + TradingView.SYMBOL_SEARCH_MAX_LENGTH + '">').appendTo(C), d.bindToInput(x, { syncWithChartWidget: !0, spreadActions: S }), function() {
                var t = !1;
                x.on("focus", function() { t = !0, w.addClass("expanded") }), x.on("blur", function() { t = !1, setTimeout(function() { t || w.removeClass("expanded") }, 40) })
            }()), e.enabled("header_resolutions") && (y = this.createGroup("intervals", { single: !0, showInNarrowView: !0 }).appendTo(this._$left), P = { onWidget: m, submenuBtnAddClass: "apply-common-tooltip" }, t.interval_options && $.extend(P, t.interval_options), e.enabled("items_favoriting") || $.extend(P, { notShowQuicks: !0, popupSpacing: 1 }), TradingView.isOnFeaturePage && $.extend(P, { notShowQuicks: !0 }), this._interval = new l(P), loginStateChange.subscribe(this, function() { window.is_authenticated && this._interval.forceUpdate() }), e.enabled("charting_library_base") && ChartApiInstance.on("configuration_received", function() { g._interval.forceUpdate() }), this._interval.element().addClass("no-first").appendTo(y), this._interval.onResize.subscribe(this, this._onInternalResize), t.favoriteIntervals && this._interval.setUpStarredItemsList(t.favoriteIntervals)), e.enabled("header_chart_type") && (L = [{ id: u.STYLE_BARS, title: $.t("Bars") }, { id: u.STYLE_CANDLES, title: $.t("Candles") }, { id: u.STYLE_HOLLOW_CANDLES, title: $.t("Hollow Candles") }, { id: u.STYLE_HEIKEN_ASHI, title: $.t("Heikin Ashi") }, { id: u.STYLE_LINE, title: $.t("Line") }, { id: u.STYLE_AREA, title: $.t("Area") }], k = o() || [1, 4, 5, 6], TradingView.isOnFeaturePage && !e.enabled("charting_library_base") && (k = []), m ? k = [1, 3] : e.enabled("collapsible_header") && this._createMinimizeButton(t.headerChartPanel), this._style_list = new p("StyleWidget", L.map(function(t) { return { id: t.id, title: t.title, svg: $(_[t.id]).attr({ width: 26, height: 26 }), favoriteButton: { title: t.title, addClass: "apply-common-tooltip" } } }), { defaultFavorites: k, addClass: "chart-style-widget", popupAddClass: "chart-style-popup", notShowQuicks: !e.enabled("items_favoriting"), showJustDefaultQuicks: k && k.length && e.enabled("predefined_items_only_may_be_starred"), tooltip: $.t("Bar's Style"), addTooltipClass: "apply-common-tooltip" }), a.activeChartStyle.subscribe(function(t) { g._style_list.setValue(t) }, { callWithLast: !0 }), g._style_list.onChange().subscribe(this, function(t) { a.activeChartStyle.setValue(t) }), g._style_list.onResize().subscribe(this, this._onInternalResize)), window.studyMarket = new h(a, window.user, { onWidget: m, fundamentalsOnly: t.fundamentalsOnly }), this._createLayout(t, g, v), this._resizerBridge.width.subscribe(this._onInternalResize.bind(this))), !this._chartWidget.readOnly() && e.enabled("header_undo_redo") && (this._undoRedo = new n(this._$left, this._chartWidget)), e.enabled("header_screenshot") && (I = "Alt+S", A = this.createGroup("screenshot", { single: !0 }).appendTo(this._$right),
                E = $('<a class="button getimage"></a>').append($(i(896)).attr({ class: "icon" })).addClass("apply-common-tooltip").attr("title", $.t("Take instant snapshot of your chart. No more Paint or other editors to save screenshots – simply click the button and copy the link of the picture.") + "\n" + I).appendTo(A), A.click(function(t) {
                    if (!e.enabled("show_dialog_on_snapshot_ready")) {
                        if (E.hasClass("process")) return;
                        E.addClass("process"), c.subscribe("onScreenshotReady", function(t) { E.removeClass("process") }, null, !0)
                    }
                    f.actions().takeScreenshot.callbacks().fire(), t.preventDefault()
                })), e.enabled("header_saveload") && (M = e.enabled("header_saveload_to_the_right") ? this._$right : this._$left, y = this.createGroup("save-load", { single: !0, showInNarrowView: !0 }).appendTo(M), D = $("<div>").addClass("save-load-buttons").appendTo(y), this._saveLoad = new r(D, a, { popupDirection: "down", popupReverse: !0 }), this._saveLoad.onTitleSizeChanged.subscribe(this, this._onInternalResize), TradingView.isOnFeaturePage && this._saveLoad.hideTitle()), e.enabled("header_widget_dom_node") || $(".header-chart-panel").css("display", "none"), f.withModel(this, s.prototype.bindToModel), this._resizerBridge.availWidth.subscribe(this._onAvailSizeChange.bind(this)), this._resizerBridge.availHeight.subscribe(this._onAvailSizeChange.bind(this)), this._onAvailSizeChange(), this._onInternalResize()
        }
        var n = i(671),
            s = i(594),
            r = i(660),
            a = i(602),
            l = i(291),
            h = i(664),
            c = i(34),
            d = i(77),
            p = i(367).FavoredList,
            u = i(43),
            _ = i(290);
        inherit(o, s), o.prototype.saveLoadWidget = function() { return this._saveLoad }, o.prototype._onAvailSizeChange = function() { var t = this._resizerBridge.availWidth.value() <= 520 || this._resizerBridge.availHeight.value() <= 250;!!this._compactMode !== t && (this._compactMode = t, this._$root.toggleClass("header-chart-panel--compact", t), this._onInternalResize()) }, o.prototype.addButton = function(t, e) {
                (e ? this._$left : this._$right).append(t), this._onInternalResize()
            }, o.prototype._createUndoRedoGroup = function() { return this._undoRedo = new n(this._$left, this._chartWidget), this._undoRedo.undoElement().addClass("apply-common-tooltip"), this._undoRedo.redoElement().addClass("apply-common-tooltip"), this.createGroup("undo-redo", { single: !0 }).append(this._undoRedo.element()) }, o.prototype._createFullscreenGroup = function() { this._fullscreen = new a(this._chartWidgetCollection); var t = this.createGroup("fullscreen", { single: !0 }); return this._fullscreen.element().addClass("apply-common-tooltip").appendTo(t), t }, o.prototype._createLayout = function(t, i, o) {
                var n = [];
                e.enabled("header_chart_type") && n.push(this._createBarsGroup(i)), e.enabled("header_settings") && e.enabled("show_chart_property_page") && n.push(this._createPropertiesGroup(o, t.chartWidgetCollection)), e.enabled("header_indicators") && n.push(this._createIndicatorsGroup(o)), e.enabled("header_compare") && n.push(this._createCompareGroup(i, t.chartWidgetCollection, o)), e.enabled("header_undo_redo") && !this._chartWidget.readOnly() && n.push(this._createUndoRedoGroup()), e.enabled("header_fullscreen_button") && n.push(this._createFullscreenGroup()), n.forEach(function(t) { t.appendTo(this._$left) }, this)
            },
            o.prototype._onInternalResize = function() {
                if (this.hidden) return void this._resizerBridge.negotiateHeight(0);
                this._onResizeRequested || (this._onResizeRequested = !0, this._resizerBridge.visible.when(function() {
                    var t, i;
                    this._onResizeRequested = !1, e.enabled("caption_buttons_text_if_possible") && (t = this._$left, i = t.children(".group"), t.addClass("captions"), i.size() > 1 && i.last().offset().top > i.first().offset().top + 5 && t.removeClass("captions")), this._$content.find("svg").pixelSnap(), this._resizerBridge.negotiateHeight({ min: 0, max: this._$content.height() })
                }.bind(this)))
            }, o.prototype._setupCaptionButtons = function() { this._domeButton && this._domeButton.onResize.subscribe(this, this._onInternalResize), window.studyTemplates && studyTemplates.onFavoriteListResize.subscribe(this, this._onInternalResize) }, o.prototype._createMinimizeButton = function() {
                var t = this,
                    e = $("<span>", this._$root).addClass("tv-close-panel top").appendTo(this._$root).on("click", function(i) { i.isDefaultPrevented() || (t.hidden = !t.hidden, e.toggleClass("top", !t.hidden), e.toggleClass("bottom", t.hidden), i.preventDefault(), c.emit("toggle_header", !t.hidden), t._onInternalResize()) })
            }, t.exports = o
    }).call(e, i(3))
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t, e, i) {
            var o, n, s = e.m_model.properties();
            a.call(this, s, e), o = this._series = e.mainSeries(), this._chart = e.m_model, this._model = e, this._source = i, this._property = s, this._seriesProperty = o.properties(), this._scaleProperty = o.m_priceScale.properties(), this._mainAxisProperty = o.properties().priceAxisProperties, n = null, $.each(e.m_model.panes(), function(t, e) { $.each(e.dataSources(), function(t, i) { if (i === o) return n = e, !1 }) }), this._pane = n, this.prepareLayout(), this._themes = []
        }
        var n = i(301),
            s = (i(53).UndoHistory, i(76)),
            r = i(5),
            a = r.PropertyPage,
            l = r.GreateTransformer,
            h = r.LessTransformer,
            c = r.ToIntTransformer,
            d = r.SimpleStringBinder,
            p = r.BooleanBinder,
            u = r.SliderBinder,
            _ = r.ColorBinding,
            f = r.SimpleComboBinder,
            m = r.DisabledBinder,
            g = r.CheckboxWVBinding,
            v = i(43),
            y = i(21),
            b = i(32).addColorPicker,
            w = i(19).createLineStyleEditor,
            S = i(13).createLineWidthEditor,
            T = i(63).bindPopupMenu,
            C = i(7).DefaultProperty,
            x = i(161).availableTimezones,
            P = i(298),
            L = i(93).createConfirmDialog,
            k = i(12).getLogger("Chart.PropertyPage");
        inherit(o, a), inherit(o, n), o.prototype.setScalesOpenTab = function() { this.scalesTab && this.scalesTab.data("layout-tab-open", s.TAB_OPEN_OVERRIDE) }, o.prototype.setTmzOpenTab = function() { this.tmzSessTable && this.tmzSessTable.data("layout-tab-open", s.TAB_OPEN_OVERRIDE) }, o.prototype.prepareLayout = function() {
                var t, i, o, n, s, r, a, b, T, C, L, k, I, A, E, M, D, O, V, B, R, N, F, z, W, H, U, j, q, Y, G, K, X, Z, J, Q, tt, et, it, ot, nt, st, rt, at, lt, ht, ct, dt, pt, ut, _t, ft, mt, gt, vt, yt, bt, wt, St, Tt, Ct, xt, Pt, Lt, kt, It, At, Et, Mt, Dt, Ot, $t, Vt, Bt, Rt, Nt, Ft, zt, Wt, Ht, Ut, jt, qt, Yt, Gt, Kt, Xt, Zt, Jt, Qt, te, ee, ie, oe, ne, se, re, ae, le, he, ce, de, pe, ue, _e, fe, me, ge, ve, ye, be, we, Se, Te, Ce, xe, Pe, Le, ke, Ie, Ae = this;
                if (e.enabled("chart_property_page_style") && (t = $('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab", $.t("Style")), i = $('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab", $.t("Style")),
                        o = $('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab", $.t("Style")), this._prepareSeriesStyleLayout(t, i, o, this._seriesProperty), this._hasSeriesStyleLayout = !0, r = $('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab", $.t("Style")), E = $('<input type="checkbox">'), M = this.addLabeledRow(r, $.t("Price Line"), E), $("<td>").append(E).prependTo(M), this.bindControl(new p(E, this._seriesProperty.showPriceLine, !0, this.model(), "Change Price Price Line")), D = S(), $("<td>").append(D).appendTo(M), this.bindControl(new u(D, this._seriesProperty.priceLineWidth, !0, this.model(), "Change Price Line Width")), a = $('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab", $.t("Style")), O = this.createSeriesMinTickEditor(), V = $("<tr>"), V.appendTo(a), $("<td>" + $.t("Override Min Tick") + "</td>").appendTo(V), $("<td>").append(O).appendTo(V), this.bindControl(new f(O, this._seriesProperty.minTick, null, !0, this.model(), "Change MinTick")), b = $('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab", $.t("Style")), this._pane && (-1 !== this._pane.leftPriceScale().dataSources().indexOf(this._series) ? B = "left" : -1 !== this._pane.rightPriceScale().dataSources().indexOf(this._series) ? B = "right" : this._pane.isOverlay(this._series) && (B = "none")), B && (R = { left: $.t("Scale Left"), right: $.t("Scale Right") }, Ae._pane.actionNoScaleIsEnabled(Ae._series) && (R.none = $.t("Screen (No Scale)")), N = this.createKeyCombo(R).val(B).change(function() {
                            switch (this.value) {
                                case "left":
                                    Ae._model.move(Ae._series, Ae._pane, Ae._pane.leftPriceScale());
                                    break;
                                case "right":
                                    Ae._model.move(Ae._series, Ae._pane, Ae._pane.rightPriceScale());
                                    break;
                                case "none":
                                    Ae._model.move(Ae._series, Ae._pane, null)
                            }
                        }), F = this.addRow(b), $("<td>" + $.t("Scale") + "</td>").appendTo(F), $("<td>").appendTo(F).append(N))), e.enabled("chart_property_page_scales") && (z = $('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab", $.t("Scales")), W = $('<input type="checkbox">').change(function() { this.checked && setTimeout(function() { Ae._model.m_model.invalidate(new y(y.LIGHT_UPDATE)) }, 0) }), H = this.addLabeledRow(z, $.t("Auto Scale"), W), U = function(t) { this._undoModel.setAutoScaleProperty(this._property, t, Ae._series.priceScale(), this._undoText) }, $("<td>").append(W).prependTo(H), this.bindControl(new p(W, this._scaleProperty.autoScale, !0, this.model(), "Auto Scale", U)), this.bindControl(new m(W, this._scaleProperty.autoScaleDisabled, !0, this.model(), "Auto Scale")), j = $('<input type="checkbox">'), q = this.addLabeledRow(z, $.t("Percentage"), j), Y = function(t) { this._undoModel.setPercentProperty(this._property, t, Ae._series.priceScale(), this._undoText) }, $("<td>").append(j).prependTo(q), this.bindControl(new p(j, this._mainAxisProperty.percentage, !0, this.model(), "Scale Percentage", Y)), this.bindControl(new m(j, this._mainAxisProperty.percentageDisabled, !0, this.model(), "Scale Percentage")), G = $('<input type="checkbox">'), K = this.addLabeledRow(z, $.t("Log Scale"), G), X = function(t) { this._undoModel.setLogProperty(this._property, t, Ae._series.priceScale(), this._undoText) },
                        $("<td>").append(G).prependTo(K), this.bindControl(new p(G, this._mainAxisProperty.log, !0, this.model(), "Log Scale", X)), this.bindControl(new m(G, this._mainAxisProperty.logDisabled, !0, this.model(), "Log Scale")), Z = $('<input type="checkbox">').change(function() { this.checked && setTimeout(function() { Ae._model.m_model.invalidate(new y(y.LIGHT_UPDATE)) }, 0) }), J = this.addLabeledRow(z, $.t("Scale Series Only"), Z), $("<td>").append(Z).prependTo(J), this.bindControl(new p(Z, this._property.scalesProperties.scaleSeriesOnly, !0, this.model(), "Scale Series Only")), Q = $("<input type='checkbox'/>"), tt = this.addLabeledRow(z, $.t("Lock scale"), Q), et = function(t) { this._undoModel.setLockScaleProperty(this._property, t, Ae._series, this._undoText) }, it = function(t) { tt.toggle(t.value() === v.STYLE_PNF) }, $("<td>").append(Q).prependTo(tt), this.bindControl(new p(Q, this._seriesProperty.lockScale, !0, this.model(), "Change lock scale", et)), this._seriesProperty.style.listeners().subscribe(this, it), ot = $("<input type='checkbox'/>"), nt = this.addLabeledRow(z, $.t("Track time"), ot), $("<td>").append(ot).prependTo(nt), this.bindControl(new g(ot, this._model.trackTime(), null, "Change track time")), st = $('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab", $.t("Scales")), rt = $('<input type="text" class="ticker">'), at = this.addLabeledRow(st, $.t("Top Margin"), rt), $("<td>").appendTo(at).append(rt), $("<td>%</td>").appendTo(at), lt = [c(this._property.paneProperties.topMargin.value())], lt.push(h(25)), lt.push(l(0)), this.bindControl(new d(rt, this._property.paneProperties.topMargin, lt, !0, this.model(), "Top Margin")), ht = $('<input type="text" class="ticker">'), ct = this.addLabeledRow(st, $.t("Bottom Margin"), ht), $("<td>").appendTo(ct).append(ht), $("<td>%</td>").appendTo(ct), dt = [c(this._property.paneProperties.bottomMargin.value())], dt.push(h(25)), dt.push(l(0)), this.bindControl(new d(ht, this._property.paneProperties.bottomMargin, dt, !0, this.model(), "Bottom Margin")), pt = $('<input type="text" class="ticker">'), ut = this.addLabeledRow(st, $.t("Right Margin"), pt), $("<td>").appendTo(ut).append(pt), $("<td>" + $.t("bars", { context: "margin" }) + "</td>").appendTo(ut), _t = [c(this._property.timeScale.rightOffset.value())], _t.push(h(~~this._chart.m_timeScale.maxOffset())), _t.push(l(-200)), this.bindControl(new d(pt, this._property.timeScale.rightOffset, _t, !0, this.model(), "Right Margin")), ft = $('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab", $.t("Scales")), mt = $("<input type='checkbox' />"), gt = this.addLabeledRow(ft, $.t("Left Axis"), mt), $("<td>").append(mt).prependTo(gt), setTimeout(function() { this.bindControl(new p(mt, this._property.scalesProperties.showLeftScale, !0, this.model(), "Show Left Axis")) }.bind(this), 0), vt = $("<input type='checkbox' />"), yt = this.addLabeledRow(ft, $.t("Right Axis"), vt), $("<td>").append(vt).prependTo(yt), setTimeout(function() { this.bindControl(new p(vt, this._property.scalesProperties.showRightScale, !0, this.model(), "Show Right Axis")) }.bind(this), 0), e.enabled("countdown") && (bt = $("<input type='checkbox'>"),
                            wt = this.addLabeledRow(ft, $.t("Countdown"), bt), $("<td>").append(bt).prependTo(wt), this.bindControl(new p(bt, this._seriesProperty.showCountdown, !0, this.model(), "Change Show Countdown"))), St = $('<input type="checkbox">'), Tt = this.addLabeledRow(ft, $.t("Symbol Last Value"), St), $("<td>").append(St).prependTo(Tt), this.bindControl(new p(St, this._property.scalesProperties.showSeriesLastValue, !0, this.model(), "Change Symbol Last Value Visibility")), Ct = $('<input type="checkbox">'), xt = this.addLabeledRow(ft, $.t("Indicator Last Value"), Ct), $("<td>").append(Ct).prependTo(xt), this.bindControl(new p(Ct, this._property.scalesProperties.showStudyLastValue, !0, this.model(), "Change Indicator Last Value Visibility")), Pt = $('<input type="checkbox">'), Lt = this.addLabeledRow(ft, $.t("Symbol Labels"), Pt), $("<td>").append(Pt).prependTo(Lt), this.bindControl(new p(Pt, this._property.scalesProperties.showSymbolLabels, !0, this.model(), "Show Symbol Labels")), kt = $('<input type="checkbox">'), It = this.addLabeledRow(ft, $.t("Indicator Labels"), kt), $("<td>").append(kt).prependTo(It), this.bindControl(new p(kt, this._property.scalesProperties.showStudyPlotLabels, !0, this.model(), "Show Study Plots Labels")), At = $("<input type='checkbox' />"), Et = this.addLabeledRow(ft, $.t("Precise Labels"), At), $("<td>").append(At).prependTo(Et), this.bindControl(new p(At, this._scaleProperty.alignLabels, !0, this.model(), "Precise Labels")), Mt = $('<div class="property-page-column-2">').append(z).append(st), Dt = $('<div class="property-page-column-2">').append(ft), T = $("<div>").css("min-width", "420px").data("layout-tab", $.t("Scales")), T.append(Mt).append(Dt), this.scalesTab = T), e.enabled("chart_property_page_background") && (Ot = $('<table class="property-page" cellspacing="0" cellpadding="2">'), $t = this.createColorPicker({ hideTransparency: !0 }), Vt = this.addLabeledRow(Ot, $.t("Background")), $('<td colspan="2">').append($t).appendTo(Vt), this.bindControl(new _($t, this._property.paneProperties.background, !0, this.model(), "Change Chart Background Color")), Bt = this.addLabeledRow(Ot, $.t("Vert Grid Lines")), Rt = this.createColorPicker(), $("<td>").append(Rt).appendTo(Bt), this.bindControl(new _(Rt, this._property.paneProperties.vertGridProperties.color, !0, this.model(), "Change Vert Grid Lines Color")), Nt = w(), $('<td colspan="2">').append(Nt.render()).appendTo(Bt), this.bindControl(new f(Nt, this._property.paneProperties.vertGridProperties.style, parseInt, !0, this.model(), "Change Vert Grid Lines Style")), Ft = this.addLabeledRow(Ot, $.t("Horz Grid Lines")), zt = this.createColorPicker(), $("<td>").append(zt).appendTo(Ft), this.bindControl(new _(zt, this._property.paneProperties.horzGridProperties.color, !0, this.model(), "Change Horz Grid Lines Color")), Wt = w(), $('<td colspan="2">').append(Wt.render()).appendTo(Ft), this.bindControl(new f(Wt, this._property.paneProperties.horzGridProperties.style, parseInt, !0, this.model(), "Change Horz Grid Lines Style")), Ht = this.createColorPicker(), Ut = this.addLabeledRow(Ot, $.t("Scales Text")), $("<td>").append(Ht).appendTo(Ut),
                        this.bindControl(new _(Ht, this._property.scalesProperties.textColor, !0, this.model(), "Change Scales Text Color")), jt = this.createFontSizeEditor(), $("<td>").append(jt).appendTo(Ut), this.bindControl(new f(jt, this._property.scalesProperties.fontSize, parseInt, !0, this.model(), "Change Scales Font Size")), qt = this.createColorPicker(), Yt = this.addLabeledRow(Ot, $.t("Scales Lines")), $('<td colspan="2">').append(qt).appendTo(Yt), this.bindControl(new _(qt, this._property.scalesProperties.lineColor, !0, this.model(), "Change Scales Lines Color")), Gt = this.addLabeledRow(Ot, $.t("Watermark")), Kt = this.createColorPicker(), $("<td>").append(Kt).appendTo(Gt), this.bindControl(new _(Kt, this._property.symbolWatermarkProperties.color, !0, this.model(), "Change Symbol Watermark Color", this._property.symbolWatermarkProperties.transparency)), Xt = this.addLabeledRow(Ot, $.t("Crosshair")), Zt = this.createColorPicker(), $("<td>").append(Zt).appendTo(Xt), this.bindControl(new _(Zt, this._property.paneProperties.crossHairProperties.color, !0, this.model(), "Change Crosshair Color", this._property.paneProperties.crossHairProperties.transparency)), Jt = w(), $("<td>").append(Jt.render()).appendTo(Xt), this.bindControl(new f(Jt, this._property.paneProperties.crossHairProperties.style, parseInt, !0, this.model(), "Change Crosshair Style")), Qt = S(), $("<td>").append(Qt).appendTo(this.addRow(Ot).prepend("<td/><td/>")), this.bindControl(new u(Qt, this._property.paneProperties.crossHairProperties.width, !0, this.model(), "Change Crosshair Width")), te = $('<table class="property-page">'), ee = this.addLabeledRow(te, $.t("Navigation Buttons"), null, !0), ie = [], Object.keys(P.visibilityPropertyAvailableValues).forEach(function(t) { ie.push('<option value="', t, '">', P.visibilityPropertyAvailableValues[t], "</option>") }), oe = $("<select>" + ie.join("") + "</select>"), $("<td>").append(oe).appendTo(ee), this.bindControl(new f(oe, P.visibilityProperty, null, !0, this.model(), "Change Navigation Buttons Visibility")), ne = $('<table class="property-page" cellspacing="0" cellpadding="2">'), se = $('<input type="checkbox">'), re = this.addLabeledRow(ne, $.t("Symbol Description"), se), $("<td>").append(se).prependTo(re), this.bindControl(new p(se, this._property.paneProperties.legendProperties.showSeriesTitle, !0, this.model(), "Change Symbol Description Visibility")), ae = $('<input type="checkbox">'), le = this.addLabeledRow(ne, $.t("OHLC Values"), ae), $("<td>").append(ae).prependTo(le), this.bindControl(new p(ae, this._property.paneProperties.legendProperties.showSeriesOHLC, !0, this.model(), "Change OHLC Values Visibility")), he = $('<input type="checkbox">'), ce = this.addLabeledRow(ne, $.t("Indicator Titles"), he), $("<td>").append(he).prependTo(ce), this.bindControl(new p(he, this._property.paneProperties.legendProperties.showStudyTitles, !0, this.model(), "Change Indicator Titles Visibility")), de = $('<input type="checkbox">'), pe = this.addLabeledRow(ne, $.t("Indicator Arguments"), de), ue = function(t) { de.prop("disabled", !t.value()) }, $("<td>").append(de).prependTo(pe),
                        this.bindControl(new p(de, this._property.paneProperties.legendProperties.showStudyArguments, !0, this.model(), "Change Indicator Arguments Visibility")), this._property.paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this, ue), ue(this._property.paneProperties.legendProperties.showStudyTitles), _e = $('<input type="checkbox">'), fe = this.addLabeledRow(ne, $.t("Indicator Values"), _e), $("<td>").append(_e).prependTo(fe), this.bindControl(new p(_e, this._property.paneProperties.legendProperties.showStudyValues, !0, this.model(), "Change Indicator Values Visibility")), me = $('<div class="property-page-column-2">').append(Ot), ge = $('<div class="property-page-column-2">').append(ne), ve = $('<div class="property-page-column-1">').append(te), C = $("<div>").css("min-width", "520px").data("layout-tab", $.t("Background")), C.append(me).append(ge).append(ve)), e.enabled("chart_property_page_timezone_sessions")) {
                    for (k = $('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab", $.t("Timezone/Sessions")), this.tmzSessTable = k, ut = $("<tr>").appendTo(k), ye = $("<td>").appendTo(ut), be = $('<table cellspacing="0" cellpadding="0">').appendTo(ye), we = $("<tr>"), we.appendTo(be), Se = $("<td>"), Se.appendTo(we), Se.text($.t("Time Zone")), Te = $('<td colspan="2" class="tzeditor">'), Te.appendTo(we), Ce = "", xe = 0; xe < x.length; xe++) Ce += '<option value="' + x[xe].id + '">' + x[xe].title + "</option>";
                    Pe = $("<select>" + Ce + "</select>"), Pe.appendTo(Te), this.bindControl(new f(Pe, this._property.timezone, null, !0, this.model(), "Change Timezone")), e.enabled("charting_library_base") || (this._series.createSessStudy(), this.createSessTable(k))
                }
                Le = e.enabled("chart_property_page_events_alerts") && !e.enabled("charting_library_base"), Le && (ke = e.enabled("alerts") ? $.t("Events & Alerts") : $.t("Events"), A = $('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab", ke), this.createEventsTable(A)), Ie = e.enabled("trading_options") || e.enabled("chart_property_page_trading"), Ie && (I = this.createTradingTable()), n = $('<table class="property-page" cellspacing="0" cellpadding="2">'), s = $('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({ width: "100%" }).data("layout-separated", !0), L = $('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab", $.t("Drawings")), this._table = $().add(t).add(i).add(o).add(n).add(s).add(r).add(b).add(a).add(T).add(C).add(L).add(k).add(I).add(A), this.loadData()
            }, o.prototype.widget = function() { return this._table }, o.prototype.loadData = function() { this.superclass.prototype.loadData.call(this), this.switchStyle() }, o.prototype.loadTheme = function(t) {
                var e = this;
                $.get("/theme/?themeName=" + encodeURIComponent(t), function(t) { e.applyTheme(JSON.parse(t.content)) })
            }, o.prototype.applyTheme = function(t) {
                var e = this._seriesProperty.extendedHours.value();
                this._model.model().restoreTheme(t), this._seriesProperty.extendedHours.value() !== e && this._seriesProperty.extendedHours.listeners().fire(this._seriesProperty.extendedHours), this.loadData()
            }, o.prototype.createTemplateButton = function(t) {
                var i, o, n;
                return e.enabled("chart_property_page_template_button") ? (i = this, t || (t = {}), o = function() {
                    var e, o = [];
                    return o.push({ title: $.t("Save As..."), action: function() { runOrSignIn(function() { themesUtils.showThemeSaveDialog(i._model) }, { source: "Save theme in chart properties" }) }, addClass: "special" }), "function" == typeof t.defaultsCallback && o.push({ title: $.t("Apply Defaults"), action: t.defaultsCallback, addClass: "special" }), e = [], $.each(i._themes, function(t, o) {
                        e.push({
                            title: $.t(o),
                            action: function() { i.loadTheme(o) },
                            deleteAction: is_authenticated ? function() {
                                var t, e = this,
                                    n = $.t("Do you really want to delete Color Theme '{0}' ?").format(o);
                                n = TradingView.clean(n), t = L({ type: "modal", content: n }), t.on("action:yes", function(t) {
                                    e instanceof $ && e.remove(), $.post("/remove-theme/", { name: o }).error(function(t) { k.logError(t.responseText) }), themesUtils.themes.invalidate();
                                    for (var n = i._themes.length; n--;) i._themes[n] === o && i._themes.splice(n, 1);
                                    t.close()
                                }), t.open()
                            } : void 0
                        })
                    }), e.length && (e.sort(function(t, e) { return t = t.title.toUpperCase(), e = e.title.toUpperCase(), t === e ? 0 : t > e ? 1 : -1 }), o.push({ separator: !0 }), o = o.concat(e)), o
                }, n = $('<a href="#" class="_tv-button">' + $.t("Themes") + '<span class="icon-dropdown"></span></a>'), T(n, null, { direction: "up", event: "button-popup", notCloseOnButtons: !0 }), n.bind("click", function() {
                    var t = $(this);
                    t.is(".active") || themesUtils.themes.requestData(function(e) { i._themes = e, t.trigger("button-popup", [o(), !0]) })
                }), n) : $("<span />")
            }, o.prototype.switchStyle = function() {
                if (this._hasSeriesStyleLayout) switch ($(this._barsTbody).add(this._barsColorerTbody).add(this._renkoTbody).add(this._pbTbody).add(this._kagiTbody).add(this._pnfTbody).add(this._candlesTbody).add(this._candlesColorerTbody).add(this._hollowCandlesTbody).add(this._lineTbody).add(this._areaTbody).add(this._haTbody).add(this._haColorerTbody).css("display", "none"), this._seriesProperty.style.value()) {
                    case v.STYLE_BARS:
                        this._barsTbody.css("display", "table-row-group"), this._barsColorerTbody.css("display", "table-row-group");
                        break;
                    case v.STYLE_CANDLES:
                        this._candlesTbody.css("display", "table-row-group"), this._candlesColorerTbody.css("display", "table-row-group");
                        break;
                    case v.STYLE_HOLLOW_CANDLES:
                        this._hollowCandlesTbody.css("display", "table-row-group");
                        break;
                    case v.STYLE_LINE:
                        this._lineTbody.css("display", "table-row-group");
                        break;
                    case v.STYLE_AREA:
                        this._areaTbody.css("display", "table-row-group");
                        break;
                    case v.STYLE_RENKO:
                        this._renkoTbody.css("display", "table-row-group");
                        break;
                    case v.STYLE_PB:
                        this._pbTbody.css("display", "table-row-group");
                        break;
                    case v.STYLE_KAGI:
                        this._kagiTbody.css("display", "table-row-group");
                        break;
                    case v.STYLE_PNF:
                        this._pnfTbody.css("display", "table-row-group");
                        break;
                    case v.STYLE_HEIKEN_ASHI:
                        this._haTbody.css("display", "table-row-group"), this._haColorerTbody.css("display", "table-row-group")
                }
            }, o.prototype.onResoreDefaults = function() {
                var t, e = this._model.model().properties().paneProperties.topMargin,
                    i = this._model.model().properties().paneProperties.bottomMargin;
                e.listeners().fire(e), i.listeners().fire(i), t = this._model.model().properties().timezone, t.listeners().fire(t)
            },
            o.prototype.defaultProperties = function() {
                var t = this,
                    e = [t._seriesProperty.extendedHours, t._property.scalesProperties.showLeftScale, t._property.scalesProperties.showRightScale, t._property.timeScale.rightOffset].map(function(t) { return { property: t, previousValue: t.value() } });
                return setTimeout(function() {
                    e.forEach(function(t) { t.property.value() !== t.previousValue && t.property.listeners().fire(t.property) });
                    var i = new C("chartproperties.paneProperties.rightAxisProperties");
                    $.each(["autoScale", "percentage", "log"], function(e, o) {
                        var n = t._scaleProperty[o],
                            s = i[o].value();
                        s !== n.value() && n.setValue(s)
                    })
                }, 0), [this._property, this._seriesProperty]
            }, o.prototype.createEventsTable = function(t) {
                var i, o, n, s, r, a, l, h, c, d, g, v, y, T, C, x, P, L, k, I, A, E, M, D, O, V, B, R, N = $("<tr>").appendTo(t),
                    F = $('<input type="checkbox" />'),
                    z = this.addLabeledRow(N, $.t("Show Dividends on Chart"), F);
                $("<td>").append(F).prependTo(z), z.append("<td>"), this.bindControl(new p(F, this._seriesProperty.esdShowDividends, !0, this.model(), "Change Show or Hide Dividends")), i = $('<input type="checkbox" />'), z = this.addLabeledRow(N, $.t("Show Splits on Chart"), i), $("<td>").append(i).prependTo(z), z.append("<td>"), this.bindControl(new p(i, this._seriesProperty.esdShowSplits, !0, this.model(), "Change Show or Hide Splits")), o = $('<input type="checkbox" />'), z = this.addLabeledRow(N, $.t("Show Earnings on Chart"), o), $("<td>").append(o).prependTo(z), z.append("<td>"), this.bindControl(new p(o, this._seriesProperty.esdShowEarnings, !0, this.model(), "Change Show or Hide Earnings")), n = this.createTableInTable(t), s = $('<input type="checkbox" />'), r = w(), a = S(), z = this.addLabeledRow(n, $.t("Earnings breaks"), s), $("<td>").append(s).prependTo(z), l = b($("<td>").appendTo(z)), $("<td>").append(r.render()).appendTo(z), $("<td>").append(a).appendTo(z), z.addClass("offset-row"), z.append("<td>"), this.bindControl(new p(s, this._seriesProperty.esdShowBreaks, !0, this.model(), "Change Show or Hide Earnings")), this.bindControl(new _(l, this._seriesProperty.esdBreaksStyle.color, !0, this.model(), "Change earnings color")), this.bindControl(new f(r, this._seriesProperty.esdBreaksStyle.style, parseInt, !0, this.model(), "Change style")), this.bindControl(new u(a, this._seriesProperty.esdBreaksStyle.width, !0, this.model(), "Change width")), h = function(t) { s.prop("disabled", !t.value()) }, this._seriesProperty.esdShowEarnings.listeners().subscribe(this, h), e.enabled("chart_events") && (c = $('<input type="checkbox">'), d = $('<input type="checkbox">'), g = $('<input type="checkbox" />'), v = w(), y = S(), T = this.createColorPicker(), C = this._property.chartEventsSourceProperties, this.bindControl(new p(c, C.visible, !0, this.model(), "Change Show Economic Events on Chart")), this.bindControl(new p(d, C.futureOnly, !0, this.model(), "Change Show Only Future Events")), this.bindControl(new m(d, C.visible, !0, this.model(), "", !0)), this.bindControl(new m(g, C.visible, !0, this.model(), "", !0)), this.bindControl(new p(g, C.breaks.visible, !0, this.model(), "Change Show or Hide Events Breaks")), this.bindControl(new _(T, C.breaks.color, !0, this.model(), "Change Events Breaks Color")),
                    this.bindControl(new f(v, C.breaks.style, parseInt, !0, this.model(), "Change Events Breaks Style")), this.bindControl(new u(y, C.breaks.width, !0, this.model(), "Change Events Breaks Width")), x = $("<tr>").appendTo(t), z = this.addLabeledRow(x, $.t("Show Economic Events on Chart"), c), $("<td>").append(c).prependTo(z), P = this.createTableInTable(t), z = this.addLabeledRow(P, $.t("Show Only Future Events"), d), $("<td>").append(d).prependTo(z), z.addClass("offset-row"), L = this.createTableInTable(t), z = this.addLabeledRow(L, $.t("Events Breaks"), g), $("<td>").append(g).prependTo(z), $("<td>").append(T).appendTo(z), $("<td>").append(v.render()).appendTo(z), $("<td>").append(y).appendTo(z), z.addClass("offset-row")), e.enabled("alerts") && (k = $("<tr>").appendTo(t), I = $('<input type="checkbox" />'), z = this.addLabeledRow(k, $.t("Show Alert Labels"), I), $("<td>").append(I).prependTo(z), z.append("<td>"), A = this._property.alertsProperties.labels.visible, this.bindControl(new p(I, A, !0, this.model(), "Change Show or Hide Alert Labels", function(t) { this._model.beginUndoMacro("Show Alert Labels"), this._model.setProperty(A, t, "Show  Alert Labels"), this._model.endUndoMacro() }.bind(this))), E = this.createTableInTable(t), M = $('<input type="checkbox">'), D = S(), O = w(), V = O.render(), z = this.addLabeledRow(E, $.t("Extended Alert Line"), M), $("<td>").append(M).prependTo(z), B = b($("<td>").appendTo(z)), $("<td>").append(V).appendTo(z), $("<td>").append(D).appendTo(z), z.addClass("offset-row"), z.append("<td>"), this.bindControl(new p(M, this._property.alertsProperties.labels.line.visible, !0, this.model(), "Change Show or Hide Alert Labels Lines")), this.bindControl(new _(B, this._property.alertsProperties.labels.color, !0, this.model(), "Change Alerts Labels color")), this.bindControl(new f(O, this._property.alertsProperties.labels.line.style, parseInt, !0, this.model(), "Change style")), this.bindControl(new u(D, this._property.alertsProperties.labels.line.width, !0, this.model(), "Change width")), R = function(t) { M.prop("disabled", !t.value()), V.prop("disabled", !t.value()), D.prop("disabled", !t.value()) }, A.listeners().subscribe(this, R))
            }, o.prototype.createSessTable = function(t) {
                var e, i, o, n, s, r = this._series.sessionsStudy().properties(),
                    a = this.createTableInTable(t),
                    l = r.name.value(),
                    h = $("<input type='checkbox' />"),
                    c = this.addLabeledRow(a, $.t("Session Breaks"), h),
                    d = w(),
                    m = this.createColorPicker(),
                    g = S();
                return $("<td>").append(h).prependTo(c), $("<td>").append(m).appendTo(c), $("<td>").append(d.render()).appendTo(c), $("<td>").append(g).appendTo(c), this.bindControl(new p(h, r.graphics.vertlines.sessBreaks.visible, !0, this.model(), "Change " + l + " visibility")), this.bindControl(new _(m, r.graphics.vertlines.sessBreaks.color, !0, this.model(), "Change " + l + " color")), this.bindControl(new f(d, r.graphics.vertlines.sessBreaks.style, parseInt, !0, this.model(), "Change " + l + " style")), this.bindControl(new u(g, r.graphics.vertlines.sessBreaks.width, !0, this.model(), "Change " + l + " width")), a = this.createTableInTable(t), e = this._extendedHoursEditor = $('<input type="checkbox" />'), c = this.addLabeledRow(a, $.t("Extended Hours (Intraday Only)"), e),
                    $("<td>").append(e).prependTo(c), this.bindControl(new p(e, this._seriesProperty.extendedHours, !0, this.model(), "Change Extended Hours")), this._seriesProperty.sessVis = r.graphics.vertlines.sessBreaks.visible, a = this.createTableInTable(t), i = this._createStudySessRow(a, $.t("Extended Hours"), r.graphics.backgrounds.outOfSession), o = this._createStudySessRow(a, $.t("In Session"), r.graphics.backgrounds.inSession), n = function(t) { i.prop("disabled", !t.value()), o.prop("disabled", !t.value()) }, this._seriesProperty.extendedHours.listeners().subscribe(this, n), n(this._seriesProperty.extendedHours), s = this._series.isIntradayInterval(), h.prop("disabled", !s), a
            }, o.prototype._createStudySessRow = function(t, e, i) {
                var o, n = $("<input type='checkbox' />"),
                    s = this.addLabeledRow(t, e, n),
                    r = b($("<td>").appendTo(s));
                return this.bindControl(new p(n, i.visible, !0, this.model(), "Change " + e + " visibility")), this.bindControl(new _(r, i.color, !0, this.model(), e + " color", i.transparency)), o = $("<td>"), o.append(n).prependTo(s), s.addClass("offset-row"), n
            }, o.prototype.createTradingTable = function() {
                var t, e, i, o, n, s, r, a, _, m, g, v = $('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab", $.t("Trading")),
                    y = $("<tr>").appendTo(v),
                    b = $("<td>").appendTo(y),
                    T = $('<table cellspacing="0" cellpadding="0">').appendTo(b),
                    C = $('<input type="checkbox">');
                return y = this.addLabeledRow(T, $.t("Show Positions"), C), $("<td>").append(C).prependTo(y), this.bindControl(new p(C, this._property.tradingProperties.showPositions, !0, this.model(), "Change Positions Visibility")), t = $('<input type="checkbox">'), y = this.addLabeledRow(T, $.t("Show Orders"), t), $("<td>").append(t).prependTo(y), this.bindControl(new p(t, this._property.tradingProperties.showOrders, !0, this.model(), "Change Orders Visibility")), e = $('<input type="checkbox">'), i = this.addLabeledRow(T, $.t("Extend Lines Left"), e), $("<td>").append(e).prependTo(i), this.bindControl(new p(e, this._property.tradingProperties.extendLeft, !0, this.model(), "Extend Lines Left")), o = S(), this.bindControl(new u(o, this._property.tradingProperties.lineWidth, !0, this.model(), "Change Connecting Line Width")), n = w(), this.bindControl(new f(n, this._property.tradingProperties.lineStyle, parseInt, !0, this.model(), "Change Connecting Line Style")), s = $('<input type="text" class="ticker">'), r = [c(this._property.tradingProperties.lineLength.value()), h(100), l(0)], this.bindControl(new d(s, this._property.tradingProperties.lineLength, r, !0, this.model(), "Change Connecting Line Length")), a = $("<tbody>"), _ = this.addLabeledRow(T, $.t("Connecting Line"), a), $("<td>").prependTo(_), $("<td>").append(o).appendTo(_), $('<td colspan="3">').append(n.render()).appendTo(_), $('<td colspan="3">').append(s).appendTo(_), $("<td>%</td>").appendTo(_), m = $('<input type="checkbox">'), g = this.addLabeledRow(T, $.t("Show Executions"), m), $("<td>").append(m).prependTo(g), this.bindControl(new p(m, this._property.tradingProperties.showExecutions, !0, this.model(), "Change Executions Visibility")), v
            }, t.exports = o
    }).call(e, i(3))
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t) {
            var e, i, o = Object.keys(u),
                n = o.length;
            for (e = 0; e < n; ++e)
                if (i = o[e], u[i].name === t) return i;
            return null
        }

        function n(t) { return "LineToolRiskRewardLong" === t || "LineToolRiskRewardShort" === t }
        var s = i(574),
            r = i(281),
            a = i(25),
            l = i(7).DefaultProperty,
            h = i(118).availIcons,
            c = i(58),
            d = i(36).Interval,
            p = i(57),
            u = i(189),
            _ = i(262).createTooManyStudiesNotice,
            f = function(t) { this._chartWidget = t };
        f.prototype._makeSubscriptionFromDelegate = function(t) { var e = $.extend({}, t); return delete e.fire, e }, f.prototype.executeAction = function(t) { this._chartWidget.executeActionByName(t) }, f.prototype.executeActionById = function(t) { this._chartWidget.executeActionById(t) }, f.prototype.getCheckableActionState = function(t) { return this._chartWidget.getCheckableActionState(t) }, f.prototype.refreshMarks = function() { this._chartWidget.refreshMarks() }, f.prototype.clearMarks = function() { this._chartWidget.clearMarks() }, f.prototype.symbol = function() { return this._chartWidget.getSymbol() }, f.prototype.symbolExt = function() { var t = this._chartWidget.model().mainSeries().symbolInfo(); return t ? { symbol: t.name, full_name: t.full_name, exchange: t.exchange, description: t.description, type: t.type } : null }, f.prototype.resolution = function() { return this._chartWidget.model().mainSeries().properties().interval.value() }, f.prototype.setSymbol = function(t, i) {
                function o() { n._chartWidget.model().mainSeries().onDataLoaded().unsubscribe(null, o), i && i() }
                if (t !== this.symbol() || e.enabled("same_data_requery")) { var n = this; return this._chartWidget.model().mainSeries().onDataLoaded().subscribe(null, o), this._chartWidget.setSymbol(t) }
            }, f.prototype.resetData = function() { this._chartWidget.model().mainSeries().rerequestData() }, f.prototype.setResolution = function(t, e) {
                function i() { o._chartWidget.model().mainSeries().onDataLoaded().unsubscribe(null, i), e && e() }
                if ((t = t.toUpperCase()) !== this.resolution()) { var o = this; return this._chartWidget.model().mainSeries().onDataLoaded().subscribe(null, i), this._chartWidget.setResolution(t) }
            }, f.prototype.setEntityVisibility = function(t, e) {
                var i, o = this._chartWidget.model().model().dataSourceForId(t);
                o && (i = o.properties()) && i.visible && i.visible.setValue(e)
            }, f.prototype.getAllStudies = function() { return this._chartWidget.model().model().allStudies().map(function(t) { return { id: t._id, name: t._metaInfo.description } }) }, f.prototype.getAllShapes = function() { return this._chartWidget.model().model().allLineTools().map(function(t) { return { id: t._id, name: o(t.toolname) } }).filter(function(t) { return null !== t.name }) }, f.prototype.removeAllShapes = function() { this._chartWidget.removeAllDrawingTools() }, f.prototype.removeAllStudies = function() { this._chartWidget.removeAllStudies() }, f.prototype.removeEntity = function(t) {
                var e = this._chartWidget.model().chartModel().dataSourceForId(t);
                if (!e) return void console.warn("Can't find a source with id: " + t);
                this._chartWidget.model().chartModel().removeSource(e, !0)
            }, f.prototype.createStudyTemplate = function(t) { return this._chartWidget.model().model().studyTemplate(t.saveInterval) }, f.prototype.applyStudyTemplate = function(t) { this._chartWidget.model().model().restoreStudyTemplate(t, "" + 1e3 * Math.random()) },
            f.prototype.setVisibleRange = function(t, i) {
                var o, n, s, r;
                if (void 0 === t || !t.from || !t.to || isNaN(t.from) || isNaN(t.to)) return void console.warn("Wrong time range: " + JSON.stringify(t) + '. Expected an object with "from" and "to" numeric values.');
                o = this._chartWidget.model().model(), n = o.mainSeries(), s = [parseInt(t.from), parseInt(t.to)], r = d.isDWM(n.interval()) && !e.enabled("disable_resolution_rebuild") ? this._alignPoints(s) : s, t.from = r[0], t.to = r[1], this._chartWidget.setVisibleTimeRange(t.from, t.to, i)
            }, f.prototype.getVisibleRange = function() {
                var t = this._chartWidget.model().timeScale(),
                    e = t.visibleBars(),
                    i = { from: t.indexToUserTime(e.firstBar() < 0 ? 0 : e.firstBar()), to: t.indexToUserTime(e.lastBar()) };
                return { from: (+i.from || 0) / 1e3, to: (+i.to || 0) / 1e3 }
            }, f.prototype.getVisiblePriceRange = function() { return this._chartWidget.model().mainSeries() ? this._chartWidget.model().mainSeries().priceScale().priceRangeInPrice() : null }, f.prototype._createTradingPrimitive = function(t, e) {
                function i() { var t = o._chartWidget.model().timeScale().m_points.lastTimePointIndex(); return { index: t, price: o._chartWidget.model().mainSeries().data().valueAt(t)[4] } }
                var o = this,
                    n = this._chartWidget.model().model(),
                    s = n.paneForSource(this._chartWidget.model().model().mainSeries());
                return (e ? this._chartWidget.model().chartModel() : this._chartWidget.model()).createLineTool(s, i(), t)._adapter
            }, f.prototype.createOrderLine = function(t) { var t = t || {}; return this._createTradingPrimitive("LineToolOrder", t.disableUndo) }, f.prototype.createPositionLine = function(t) { var t = t || {}; return this._createTradingPrimitive("LineToolPosition", t.disableUndo) }, f.prototype.createExecutionShape = function(t) { var t = t || {}; return this._createTradingPrimitive("LineToolExecution", t.disableUndo) }, f.prototype.createVerticalLine = function(t, e) { this._chartWidget.createShape(t, $.extend(e, { shape: "vertical_line" })) }, f.prototype.createShape = function(t, e, i) { return this.createMultipointShape([t], e, i) }, f.prototype._alignPoints = function(t) {
                var e, i = this._chartWidget.model().model(),
                    o = i.mainSeries(),
                    n = o.symbolInfo(),
                    s = p.get_timezone(n.timezone);
                return i.timeScale().isEmpty() ? t : (e = (new c.Session).init(s, n.session), t.map(function(t) { return t ? c.alignExchangeTimeToSessionStartAndReturnUTC(e.timezone, e.spec, new Date(1e3 * t)) / 1e3 : t }))
            }, f.prototype.createMultipointShape = function(t, i, o) {
                function s(t, e, i, o) {
                    var n, s, r, a = T.closestIndexLeft(e) || 0,
                        l = { index: a },
                        h = T.valueAt(a);
                    return e > h && (n = S.syncModel().distance(h, e), n.success && (l.index = l.index + n.result)), i ? l.price = i : (s = ["open", "high", "low", "close"], r = o ? s.indexOf(o) + 1 : 1, r <= 0 && (r = 1), l.price = C.valueAt(a)[r]), l
                }
                var r, a, c, p, _, f, m, g, v, y, b = i.disableUndo ? this._chartWidget.model().model() : this._chartWidget.model(),
                    w = this._chartWidget.model().model(),
                    S = w.mainSeries(),
                    T = w.timeScale().points(),
                    C = S.data();
                if (!w.timeScale().isEmpty()) {
                    for (r = w.paneForSource(S), a = t.map(function(t) { return t.time }), c = d.isDWM(S.interval()) && !e.enabled("disable_resolution_rebuild") ? this._alignPoints(a) : a, _ = [], p = 0; p < t.length; p++) f = t[p], _.push(s(f.time, c[p], f.price, f.channel));
                    if (m = u[i.shape] || u.flag,
                        "LineToolPolyline" === m.name) _[0].price === _[_.length - 1].price && _[0].index === _[_.length - 1].index || _.push(_[0]);
                    else if ("LineToolIcon" === m.name) {
                        if (i.icon = i.icon || i.overrides && i.overrides.icon, !i.hasOwnProperty("icon")) throw Error("icon must be specified in options");
                        if (-1 === h.indexOf(i.icon)) throw Error("icon value must be valid");
                        i.overrides = i.overrides || {}, i.overrides.icon = i.icon
                    }
                    if (g = new l(m.name.toLowerCase()), i.overrides)
                        for (v in i.overrides) g[v] ? g[v].setValue(i.overrides[v]) : n(m.name) && -1 !== ["profitLevel", "stopLevel"].indexOf(v) && g.addProperty(v, i.overrides[v]);
                    if (m.supportsText && i.text && g.text.setValue(i.text), y = b.createLineTool(r, _[0], m.name, g), y.pointsCount() !== _.length && -1 !== y.pointsCount()) throw Error("Wrong points count for " + i.shape + ". Required " + y.pointsCount());
                    for (p = 1; p < _.length && this._chartWidget.model().lineBeingCreated(); p++) b.coninueCreatingLine(_[p], {}, p < _.length - 1);
                    return i.lock && y.setUserEditEnabled(!1), i.disableSelection && (y.customization.disableSelection = !0), i.disableSave && (y.customization.disableSave = !0), i.hasOwnProperty("showInObjectsTree") && (y.customization.showInObjectsTree = i.showInObjectsTree), i.zOrder && ("top" === i.zOrder ? b.bringToFront(y) : "bottom" === i.zOrder && b.sendToBack(y)), o && o(y.id()), y.id()
                }
            }, f.prototype.createStudy = function(t, e, i, o, n, l, h) {
                var c, d, p, u;
                if (h && h.checkLimit && !this._chartWidget.model().canCreateStudy()) return void _().open();
                if (t = t.toLowerCase(), c = a.findStudyMetaInfoByDescription(this._chartWidget.model().studiesMetaData(), t), c = $.extend({}, c), delete c.state, c || console.warn("Study `" + t + "` not found."), d = {}, l) {
                    l = l;
                    for (p in l) r.setMetainfoProperty(c, p, l[p]);
                    d.styles = c.defaults.styles, d.bands = c.defaults.bands, d.filledAreasStyle = c.defaults.filledAreasStyle
                }
                o && (d.inputs = s.getStudyRecordFromArray([t].concat(o), this._chartWidget).inputs), u = this._chartWidget.model().chartModel().insertStudy(c, d, e), i && u.setUserEditEnabled(!1), n && n(u.id())
            }, f.prototype.chartType = function() { return this._chartWidget.model().mainSeries().properties().style.value() }, f.prototype.setChartType = function(t) { this._chartWidget.model().mainSeries().properties().style.setValue(t) }, f.prototype.priceFormatter = function() { return this._chartWidget.model().mainSeries().priceScale().formatter() }, f.prototype.onDataLoaded = function() { return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onCompleted()) }, f.prototype.onSymbolChanged = function() { return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onSymbolResolved()) }, f.prototype.onIntervalChanged = function() { return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onIntervalChanged()) }, f.prototype.dataReady = function(t) { var e = !this._chartWidget.model() || !this._chartWidget.model().mainSeries() || this._chartWidget.model().mainSeries().data().isEmpty(); return t && (e ? this.onDataLoaded().subscribe(null, t, !0) : t()), !e }, f.prototype.crossHairMoved = function(t) { this._makeSubscriptionFromDelegate(this._chartWidget.model().chartModel().crossHairMoved()).subscribe(null, t) }, f.prototype.setTimezone = function(t) {
                this._chartWidget.setTimezone(t)
            }, t.exports = f
    }).call(e, i(3))
}, function(t, e, i) {
    (function(e, o) {
        "use strict";

        function n(t) {
            function i(t, e) {
                var i, o, n = [],
                    r = s[xt].count;
                for (i = 0; i < r; i++) n.push(bt[i].chartWidget.state(t, e));
                return o = { layout: xt, charts: n }, kt.value() && (o.symbolLock = 1), It.value() && (o.intervalLock = 1), At.value() && (o.trackTimeLock = 1), l.hideAllDrawings().value() && (o.hideAllDrawings = !0), o
            }

            function n(t) {
                var e, i = $.Deferred(),
                    o = [],
                    n = s[xt].count;
                for (e = 0; e < n; e++) o.push(bt[e].chartWidget.asyncState(t));
                return $.when.apply($, o).then(function() {
                    var t, e = { charts: [] };
                    for (t = 0; t < arguments.length; t++) e.charts.push(arguments[t]);
                    i.resolve(e)
                }), i
            }

            function f() {
                if (Ct && !ot)
                    for (var t = 0; t < Ct.count; t++) m(t);
                else m(Tt);
                lt.trigger("chart-rect-update", lt[0].getBoundingClientRect())
            }

            function m(t) {
                var e, i = bt[t];
                i && (e = ot ? s.s.sizer(0, { width: et.value(), height: it.value() }, mt, gt) : Ct.sizer(t, { width: et.value(), height: it.value() }, mt, gt), bt[t].wrap.css({ width: Math.max(e.width || 0, 0), height: Math.max(e.height || 0, 0), top: Math.max(e.top || 0, 0), left: Math.max(e.left || 0, 0) }), i.metrics && i.metrics.width === e.width && i.metrics.height === e.height || (i.metrics = e, i.chartWidget && i.chartWidget.resize()))
            }

            function g() { for (var t = 0; t < bt.length; t++) bt[t].chartWidget.resizeSeriesControlUI() }

            function v() { for (var t = 0; t < bt.length; t++) bt[t].chartWidget.tickSeriesControlClock() }

            function y(t) {
                var e, i, o, n;
                return t = Object.assign({ chartWidgetCollection: ft, isActive: 0 === bt.length }, t || {}), i = $(document.createElement("div")).addClass("chart-container").appendTo(lt).css({ position: "absolute", overflow: "hidden" }), i.on("mousedown touchstart", function() { vt.setValue(e) }), o = bt.length, n = { wrap: i }, bt.push(n), m(o), t.jqParent = i, n.chartWidget = e = new r.ChartWidget(t), ft.firstWidgetInitialized || e.chartWidgetInitialized.subscribe(null, function() {
                    try { c.sendEvent("chart_widget_initialized") } catch (t) {}
                    ft.firstWidgetInitialized = !0, g()
                }, !0), (1 === bt.length || u.enabled("show_logo_on_all_charts")) && e.createBranding(), t.containsData ? e.finishInitWithoutConnect() : e.connect(), w(), S(), ct.fire(e), e
            }

            function b(t, e) {
                var i, o, n, r;
                t in s || (t = "s"), i = s[t].count, d.emit("layout_about_to_be_changed", t), xt = t, ot = e, nt.setValue(ot), Ct = s[t];
                for (o = 0; o < i || o < bt.length; o++) n = e ? Tt === o : o < i, n ? (bt[o] ? (lt.append(bt[o].wrap), bt[o].chartWidget.isDetached = !1, (r = Pt.shift()) && (Lt = !0, bt[o].chartWidget.loadContent(r.content), Lt = !1)) : y($.extend({}, st, Pt.shift() || (vt.value() ? { content: vt.value().state() } : null) || {}, 0 === o || kt.value() ? {} : { defSymbol: null })), bt[o].wrap.toggleClass("multiple", i > 1), m(o)) : bt[o] && (bt[o].chartWidget.isDetached = !0, bt[o].wrap.detach());
                return w(), d.emit("layout_changed"), !0
            }

            function w() {
                var t, e = Math.min(Ct.count, bt.length) - 1;
                if (e < 0) return void vt.deleteValue();
                t = Tt, t < 0 && (t = 0), t > e && (t = e), vt.setValue(bt[t].chartWidget)
            }

            function S() { var t, e; for (t = bt.length; t--;) e = t === Tt, bt[t].wrap.toggleClass("active", e).toggleClass("inactive", !e) }

            function T() {
                return $.grep(bt, function(t) { return !t.chartWidget.isDetached }).sort(function(t, e) {
                    var i = t.metrics.top,
                        o = e.metrics.top,
                        n = t.metrics.left,
                        s = e.metrics.left;
                    return i === o ? n < s ? -1 : n > s ? 1 : 0 : i < o ? -1 : 1
                })
            }

            function C() { var t, e, i, o = ft.layout.value(); "s" !== o && (t = s[o].count, nt.value() || (wt = T()), e = St + 1, i = wt[e], !i || e > t ? (i = wt[0], St = 0) : St = e, vt.setValue(i.chartWidget), nt.value() && b(o, !0)) }

            function x(t) {
                var e, i, o, n;
                ut !== t && (ut && (ut.modelCreated().unsubscribe(null, P), (e = ut.model()) && (i = e.mainSeries().properties(), i.style.unsubscribe(null, L), o = e.model(), o.onSelectedSourceChanged().unsubscribe(null, k), ut = null)), t && (n = t.model(), n ? P(n) : t.modelCreated().subscribe(null, P), ut = t))
            }

            function P(t) {
                var e, i = t.mainSeries().properties();
                i.style.subscribe(null, L), L(i.style), e = t.model(), e.onSelectedSourceChanged().subscribe(null, k), k(t.selectedSource())
            }

            function L(t) { dt.setValue(t.value()) }

            function k(t) { pt.setValue(t) }

            function I(t) {
                var e, i, o, n;
                if (t !== kt.value()) {
                    if (a.beginUndoMacro("Symbol Lock"), t)
                        for (e = vt.value(), i = e.getSymbol(), o = 0; o < bt.length; o++)(n = bt[o].chartWidget) !== e && n.getSymbol() !== i && n.setSymbol(i);
                    a.setWatchedValue(kt, t, "Symbol Lock"), a.endUndoMacro()
                }
            }

            function A(t) {
                var e, i, o, n;
                if (t !== It.value()) {
                    if (a.beginUndoMacro("Interval Lock"), t)
                        for (e = vt.value(), i = e.getResolution(), o = 0; o < bt.length; o++)(n = bt[o].chartWidget) !== e && n.getResolution() !== i && n.setResolution(i);
                    a.setWatchedValue(It, t, "Resolution Lock"), a.endUndoMacro()
                }
            }

            function E(t) { At.value() !== t && a.setWatchedValue(At, t, "Track Time") }

            function M(t) { return tt.value() !== t && (a.pushUndoCommand(new _(ft, t)), !0) }

            function D(t) { kt.value() ? O(t) : vt.value().setSymbol(t) }

            function O(t) {
                var e, i, o = !1;
                for (e = 0; e < bt.length; e++) i = bt[e].chartWidget, (i.model().mainSeries().properties().symbol.value() !== t || u.enabled("same_data_requery")) && (o || (a.beginUndoMacro("Change Symbol"), o = !0), i.setSymbol(t));
                o && a.endUndoMacro()
            }

            function V(t) {
                var e, i, o;
                if (!Lt)
                    if (It.value()) {
                        for (e = !1, i = 0; i < bt.length; i++) o = bt[i].chartWidget, o.model().mainSeries().properties().interval.value() !== t && (e || (a.beginUndoMacro("Change Resolution"), e = !0), o.setResolution(t));
                        e && a.endUndoMacro()
                    } else vt.value().setResolution(t)
            }

            function B(t) { var e, i, o; if (t && t.onlyActiveChart || ot) return { layout: "s", hidpiRatio: window.hidpiCanvasRatio || 1, charts: [vt.value().images()] }; for (e = [], i = Ct.count, o = 0; o < bt.length && o < i; o++) e.push(bt[o].chartWidget.images()); return { layout: xt, hidpiRatio: window.hidpiCanvasRatio || 1, charts: e } }

            function R() { var t, e = []; for (t = 0; t < bt.length && t < Ct.count; t++) e = e.concat(bt[t].chartWidget.tags()); return e = $.unique(e), e = $.map(e, function(t) { return t.toLowerCase().replace(/\W+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "") }) }

            function N(t, e, i, o) {
                var n, s, r, a;
                if (i || Dt && !ot)
                    for (n = Ct.count, s = 0; s < bt.length && s < n; s++)(r = bt[s].chartWidget) !== e && (a = r.model()) && a.model().setExternalPosition(t, o)
            }

            function F(t, e) {
                var i, o, n, s;
                if (At.value()) {
                    for (i = Ct.count, a.beginUndoMacro("Sync Time"), o = 0; o < bt.length && o < i; o++)
                        if (n = bt[o].chartWidget, s = n.model()) {
                            if (s.model() === e) continue;
                            s.gotoTime(t, { centerIfVisible: !1, model: e })
                        }
                    a.endUndoMacro()
                }
            }

            function z() { return ht.resolve(), bt.forEach(function(t) { t.chartWidget.destroy() }) }

            function W() { return ht.promise() }

            function H() { return ct }

            function U() { at.id.setValue(void 0), at.uid.setValue(void 0), at.name.setValue(void 0) }

            function j() {
                var e = { snapshotUrl: t.snapshotUrl };
                (u.enabled("show_dialog_on_snapshot_ready") ? p.getImageOfChart : p.getImageOfChartSilently)(this, e, function(t) { d.emit("onScreenshotReady", t) })
            }

            function q() {
                for (var t = s[xt].count; t < bt.length; t++) bt[t].chartWidget.destroy();
                bt.splice(s[xt].count)
            }

            function Y(t) { for (var e = 0; e < bt.length; e++) bt[e].chartWidget.applyOverrides(t) }

            function G() { t.resizerBridge.requestFullscreen() }

            function K() { t.resizerBridge.exitFullscreen() }

            function X() { return lt }

            function Z(t) { return u.enabled("charting_library_base") ? t : "s" === t || u.enabled(productFeatures.MULTIPLE_CHARTS) && u.getConfig(productFeatures.MULTIPLE_CHARTS).layout.indexOf(t) >= 0 || st.containsData || yt ? t : "s" }

            function J(t) {
                if (Pt = [], t) {
                    t.charts || (t = { layout: "s", charts: [t] }), xt = Z(t.layout || "s");
                    for (var e = 0; e < t.charts.length; e++) Pt.push({ content: t.charts[e] });
                    t.symbolLock && kt.setValue(!0), t.intervalLock && It.setValue(!0), t.trackTimeLock && At.setValue(!0), t.hideAllDrawings && Et.setValue(!0)
                }
                tt.setValue(xt), b(xt, ot) && (l.hideAllDrawings().setValue(Et.value()), Pt.splice(0, Pt.length))
            }

            function Q() { 0 === --_t && d.emitOnce("onChartReady") }
            var tt, et, it, ot, nt, st, rt, at, lt, ht, ct, dt, pt, ut, _t, ft = this,
                mt = 2,
                gt = 0,
                vt = new e,
                yt = !1,
                bt = [],
                wt = [],
                St = 0,
                Tt = 0,
                Ct = null,
                xt = "s",
                Pt = [],
                Lt = !1,
                kt = new e(!1),
                It = new e(!1),
                At = new e(!1),
                Et = new e(!1),
                Mt = new e(TVSettings.getBool("chart.syncCrosshair", !0)),
                Dt = Mt.value();
            Mt.subscribe(function(t) { t = !!t, Dt = t, TVSettings.setValue("chart.syncCrosshair", t) }), tt = new e(xt), et = t.resizerBridge.width, it = t.resizerBridge.height, ot = !1, nt = new e(ot), t = t || {}, "padding" in t && (mt = t.padding), "edge" in t && (gt = t.edge), st = t.widgetOptions || {}, st.readOnly && (yt = !0), rt = t.metaInfo || {}, at = { id: new e(rt.id), name: new e(rt.name), description: new e(rt.description), username: new e(rt.username), uid: new e(rt.uid) }, lt = $(t.resizerBridge.body.value()).eq(0), ht = $.Deferred(), ct = new o, et.subscribe(f), it.subscribe(f), this.updateLayout = f, dt = new e, pt = new e, dt.subscribe(function(t) {
                var e, i, o = vt.value();
                o && (e = o.model()) && (i = e.mainSeries().properties().style, i.value() !== t && e.setChartStyleProperty(i, t, "Change Series Style"))
            }), ut = null, vt.subscribe(function(t) {
                var e, i;
                if (t) {
                    for (i = bt.length; i--;)
                        if (bt[i].chartWidget === t) { e = i; break }
                    if (!isFinite(e)) throw Error("Cannot make detached ChartWidget active");
                    if (Tt !== e) {
                        for (Tt = e, S(), wt.length && (St = wt.indexOf(bt[Tt])), i = bt.length; i--;) bt[i].chartWidget.setActive(!1);
                        t.setActive(!0)
                    }
                    x(t)
                }
            }, { callWithLast: !0 }), Object.assign(this, {
                createChartWidget: y,
                getAll: function() { return bt.map(function(t) { return t.chartWidget }) },
                destroy: z,
                layout: tt,
                maximizeCurrentChart: nt,
                activeChartWidget: vt,
                activeChartStyle: dt,
                selectedSource: pt.readonly(),
                metaInfo: at,
                state: i,
                asyncState: n,
                readOnly: function() { return yt },
                lock: { symbol: kt, setSymbolLockWithUndo: I, interval: It, setIntervalLockWithUndo: A, crosshair: Mt, trackTime: At, setTrackTimeWithUndo: E },
                setSymbol: D,
                setResolution: V,
                updateLayout: f,
                setChartLayoutWithUndo: M,
                resizeWidgetsUI: g,
                images: B,
                tags: R,
                syncCrosshair: N,
                syncScroll: F,
                setSymbolAll: O,
                clearChartMetaInfo: U,
                onfeatures: t.onfeatures,
                takeScreenshot: j,
                loadContent: J,
                purgeUnusedWidgets: q,
                applyOverrides: Y,
                switchChart: C,
                startFullscreen: G,
                exitFullscreen: K,
                destroyPromise: W,
                chartWidgetCreated: H,
                getContainer: X,
                onWidget: st.onWidget
            }), J(t.onfeatures ? void 0 : t.content), tt.subscribe(function(t) { S(), b(t, !1) && (wt = T(), St = wt.indexOf(bt[Tt])) }), tt.hook = function(t) { return t === this.value() ? t : Z(t) }, yt && (tt.writeLock = !0), nt.subscribe(function(t) { t !== ot && (wt = T(), b(xt, t)) }), setInterval(v, 1e3), $(window).on("resize", f), $(document).on("onUpdate", f), u.enabled("datasource_copypaste") && (h.init(), t.globalEvents && ($(window).on("appclip:paste", function(t) { vt.value().onAppClipboardPaste(), t.preventDefault() }), $(window).on("appclip:copy", function(t) { vt.value().onAppClipboardCopy(), t.preventDefault() }), $(window).on("appclip:cut", function(t) { vt.value().onAppClipboardCut(), t.preventDefault() }))), _t = 0, bt.forEach(function(t) {
                if (t) {
                    _t++;
                    var e = t.chartWidget;
                    e.withModel(null, function() {
                        if (e.model().mainSeries().bars().size() > 0) Q();
                        else {
                            var t = function() { Q(), e.model().mainSeries().onBarReceived().unsubscribe(null, t), e.model().mainSeries().onCompleted().unsubscribe(null, t) };
                            e.model().mainSeries().onBarReceived().subscribe(null, t), e.model().mainSeries().onCompleted().subscribe(null, t)
                        }
                    })
                }
            })
        }
        var s = i(218).layouts,
            r = i(191),
            a = i(53).UndoHistory,
            l = i(42),
            h = i(192),
            c = i(722),
            d = i(34),
            p = i(747),
            u = i(3),
            _ = i(741).SetChartLayoutCommand;
        t.exports = n
    }).call(e, i(41), i(15))
}, function(t, e, i) {
    "use strict";

    function o(t, e) { s.call(this, t, e), this.prepareLayout() }
    var n = i(5),
        s = n.PropertyPage,
        r = n.SimpleComboBinder;
    inherit(o, s), o.prototype.prepareLayout = function() {
        var t, e;
        this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = this.createKeyCombo({ open: $.t("Open"), high: $.t("High"), low: $.t("Low"), close: $.t("Close") }), e = this.addLabeledRow(this._table, $.t("Source", { context: "compare" })), $("<td>").appendTo(e).append(t), this.bindControl(new r(t, this._property.inputs.source, null, !0, this.model(), "Change Price Source")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t) { return null == t._parentMenu ? null : n(t._parentMenu) }

    function n(t) { return null == t._parentMenuItem ? t : o(t._parentMenuItem) }

    function s(t, e) { this.action = t, this._parentMenu = e }

    function r(t, e) { this.action = t, this._parentMenu = e }
    var a = i(288),
        l = i(144);
    s.prototype._createIconTag = function() { var t = this._iconTagAttributes(); return this.jqIcon = l.create(a.ICON_CELL_TAG, t), this.jqIcon.addClass("context-menu"), this.jqIcon }, s.prototype._createDeleteButton = function() {
        var t, e, i;
        if (!this.action.deleteButton) return null;
        t = this, e = this.action.deleteButton.action, i = l.create("span", { class: "context-menu-delete-button" }), e && i.click(function() { return e.call(t), !1 }), this.jqSubmenu.addClass("delete-spacer"), this.jqSubmenu.append(i)
    }, s.prototype._createTextTag = function() { var t = this._textTagAttributes(); return this.jqText = l.create(a.TEXT_CELL_TAG, t), this.jqIcon.addClass("context-menu"), this.jqText }, s.prototype._createRightTag = function() {
        var t = this._rightTagAttributes();
        return this.jqRight = l.create(a.RIGHT_CELL_TAG, t), this.jqIcon.addClass("context-menu"), this.jqRight
    }, s.prototype._createSubmenuTag = function() { var t = this._submenuTagAttributes(); return this.jqSubmenu = l.create(a.SUBMENU_CELL_TAG, t), this.jqIcon.addClass("context-menu"), this.jqSubmenu }, s.prototype._iconTagAttributes = function() {
        var t = {},
            e = [];
        return this.action && (this.action.icon ? (e.push("icon"), e.push(this.action.icon.replace(/\./, "_"))) : this.action.checkable ? (e.push("icon"), this.action.checked ? e.push("checked-icon") : e.push("unchecked-icon")) : e.push("spacer")), t.class = e.join(" "), t
    }, s.prototype._textTagAttributes = function() { return { class: "text", html: this.action ? this.action.text : "" } }, s.prototype.highlight = function(t) { t ? (this.jqRow.addClass("context-menu-hover"), this.jqIcon.addClass("context-menu-hover")) : (this.jqRow.removeClass("context-menu-hover"), this.jqIcon.removeClass("context-menu-hover")), this.action && this.action.hasSubActions() && (t ? this.jqSubmenu.addClass("expanded") : this.jqSubmenu.removeClass("expanded")) }, s.prototype._rightTagAttributes = function() {
        var t = {},
            e = ["right"];
        return this.action && this.action.shortcut && (e.push("shortcut"), t.class = e.join(" "), t.html = this.action.shortcut), t
    }, s.prototype._submenuTagAttributes = function() { var t = {}; return this.action && this.action.hasSubActions() ? t.class = "submenu-arrow" : t.class = "context-menu spacer", t }, s.prototype.render = function() { this._createRow(), this.jqRow.append(this._createIconTag()), this.jqRow.append(this._createTextTag()), this.jqRow.append(this._createRightTag()), this.jqRow.append(this._createSubmenuTag()), this._createDeleteButton(), this.appendCallback(); var t = this; return this.jqRow.mouseenter(function(e) { t.showSubmenu(e), t.highlight(!0), t._parentMenu && t._parentMenu._parentMenuItem && t._parentMenu._parentMenuItem.highlight(!0) }), this.jqRow.mouseleave(function() { t.highlight(!1) }), this.jqRow }, s.prototype._createRow = function() {
        var t, e, i = this._rowTagAttributes();
        this.jqRow = l.create(a.ITEM_ROW_TAG, i), this.jqRow.addClass("context-menu"), t = this, this.action && !this.action.hasSubActions() && (e = function(t) { t.destroy(), t._parentMenuItem && e(t._parentMenuItem._parentMenu) }, this.jqRow.click(function(i) { e(t._parentMenu) }))
    }, s.prototype.showSubmenu = function(t) {
        if (this._parentMenu.closeOtherSubmenus(this), !this.action || this.action.hasSubActions()) {
            if (!this._menu) {
                var e = i(101);
                this._menu = e.createMenu(this.action.subActions, null, this)
            }
            t.pageX = this._parentMenu.jqMenu.width() - 2, t.pageY = this.jqSubmenu.offset().top - this._parentMenu.jqMenu.offset().top - 1, this._menu.show(t, this._parentMenu.jqMenu)
        }
    }, s.prototype._rowTagAttributes = function() { var t = []; return this.action && (!1 === this.action.enabled && t.push("disabled"), !1 === this.action.visible && t.push("hidden"), this.action.font && t.push("font_" + this.action.font), this.action.hasSubActions() && t.push("has_submenu"), this.action.htmlclass && t.push(this.action.htmlclass)), { class: t.join(" ") } }, s.prototype.appendCallback = function() {
        var t = this;
        this.jqRow.click(function(e) { t.action.enabled && t.action.executeCallback(e) })
    }, s.prototype.getTopLevelMenu = function() {
        return o(this)
    }, r.prototype.render = function(t) { this._createRow(); var e = this; return this.action.deferred.then(function(o) { var n, s, r, a = i(289); for (n in o) s = o[n], r = e._parentMenu.addItem(s), a.renderItem(t, r) }).always(function() { e.jqRow.hide() }), this.jqRow }, r.prototype._createIconTag = function() { var t = this._iconTagAttributes(); return this.jqIcon = l.create(a.ICON_CELL_TAG, t), this.jqIcon.addClass("context-menu"), this.jqIcon }, r.prototype._createRow = function() {
        var t = this._rowTagAttributes();
        this.jqRow = l.create(a.ITEM_ROW_TAG, t), this.jqRow.append(this._createIconTag()), this.jqRow.addClass("context-menu")
    }, r.prototype._rowTagAttributes = function() { var t = []; return this.action && t.push("spinner"), { class: t.join(" ") } }, r.prototype.highlight = function(t) {}, r.prototype._iconTagAttributes = function() {
        var t = {},
            e = [];
        return e.push("spacer"), t.class = e.join(" "), t.colspan = "10", t
    }, e.Item = s, e.ItemPlaceholder = r
}, 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(21);
        o.visibilityProperty = new e, o.prototype.init = function() { this._widget = $('<div class="control-bar-wrapper">').appendTo(this._parent), $('<div class="control-bar">').append($(i(224)).attr("class", "move-left-button-control-bar")).append($(i(909)).attr("class", "zoom-out-right-button-control-bar").css("fill", "#8A8B8D")).append($(i(911)).attr("class", "turn-button-control-bar")).append($(i(910)).attr("class", "zoom-in-button-control-bar").css("fill", "#8A8B8D")).append($(i(383)).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(893)).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._buttons.moveLeft.on(i, this._moveByBar.bind(this, 1)), this._buttons.moveLeft.on(o, this._stopMoveByBar.bind(this, 1)), this._buttons.moveRight.on(i, this._moveByBar.bind(this, -1)), this._buttons.moveRight.on(o, this._stopMoveByBar.bind(this, -1)), this._buttons.turn.on("click", function() { e.GUIResetScales() }), this._buttons.zoomOut.on("click", function() { e.model() && e.model().zoomOut() }), this._buttons.zoomIn.on("click", function() { e.model() && e.model().zoomIn() }), t = {}, $("body").on("keydown", function(e) {
                if (!$(e.target).closest("input, textarea").length && !(e.metaKey || e.which in t)) switch (t[e.which] = !0, e.which) {
                    case 37:
                        e.ctrlKey || e.altKey ? this._move(1) : this._moveByBar(1), e.preventDefault();
                        break;
                    case 39:
                        e.ctrlKey || e.altKey ? this._move(-1) : this._moveByBar(-1), e.preventDefault()
                }
            }.bind(this)).on("keyup", function(e) {
                if (!$(e.target).closest("input, textarea").length) switch (delete t[e.which], e.which) {
                    case 37:
                    case 39:
                        "by_bar" === this._moveType ? this._stopMoveByBar() : this._stopMove()
                }
            }.bind(this))
        }, t.exports = o
    }).call(e, i(24))
}, function(t, e, i) {
    "use strict";

    function o(t) { this._e = $("<span>").addClass("button fullscreen iconed apply-common-tooltip").attr("title", $.t("Fullscreen mode")).append($(i(857)).attr({ width: 18, height: 18 })), this._e.click(function() { t.startFullscreen() }) }
    o.prototype.element = function() { return this._e }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { this._options = i || {}, this._w = t, this._opener = e, this._addMetric = 1, this._addOpened = !1 }
    var n = i(36).Interval,
        s = i(215),
        r = i(63).bindPopupMenu,
        a = i(3);
    i(126), o.prototype._interval = function(t) {
        var e = $(t.target);
        e.hasClass("disabled") || (this._w.setInterval(e.data("interval")), this.close())
    }, o.prototype._quickTitle = function(t) { return t ? $.t("Remove from favorites") : $.t("Add to favorites") }, o.prototype._onQuick = function(t) {
        var e = $(t.target).closest(".item"),
            i = this._w.toggleQuick(e.data("interval"));
        return e.find(".to-quick").toggleClass("quicked", i).attr("title", this._quickTitle(i)), !1
    }, o.prototype._onDelete = function(t) { var e = $(t.target).closest(".item"); return this._w.removeInterval(e.data("interval")), this._reopen(), !1 }, o.prototype._showControlButtons = function() { return !0 }, o.prototype._append = function(t, e) {
        var o = $("<span>").addClass("item").toggleClass("active", e === this._w.getInterval()).toggleClass("disabled", !s.isAvailable(e)).text(this._w.fullLabel(e)).data("interval", e);
        this._showControlButtons() && (this._w.isDefaultInterval(e) || o.prepend($("<span>").addClass("delete").attr("title", $.t("Remove custom interval")).html(i(129)).click(this._onDelete.bind(this))), this._w._options.notShowQuicks || o.prepend($("<span>").addClass("to-quick").toggleClass("quicked", this._w.inQuick(e)).append($(i(165)).attr({ width: 16, height: 16 })).attr("title", this._quickTitle(this._w.inQuick(e))).click(this._onQuick.bind(this)))), o.click(this._interval.bind(this)), t.append(o)
    }, o.prototype._appendAdd = function(t) {
        function e() {
            var t, e = parseInt(s.val());
            e < 1 && s.val(1), t = { 1: 1440, 60: 24, D: 364, W: 52, M: 12 }[this._addMetric], e > t && s.val(t)
        }
        var i, o = $("<span>").addClass("item-add"),
            n = $('<span class="item-add-wrap">').appendTo(o),
            s = $('<input type="text">').addClass("tv-text-input inset minutes").val(1).appendTo(n).TVTicker(),
            a = $("<span>").addClass("_tv-button mins").append($("<span>")).append($("<i>")).appendTo(n),
            l = $("<span>").addClass("_tv-button add").text($.t("Add")).appendTo(n),
            h = { 1: $.t("Minutes", { context: "interval" }), 60: $.t("Hours", { context: "interval" }), D: $.t("Days", { context: "interval" }), W: $.t("Weeks", { context: "interval" }), M: $.t("Months", { context: "interval" }) };
        a.find("span").text(h[this._addMetric || 1]),
            s.change(e.bind(this)), i = this, r(a, null, { direction: "up", event: "button-popup", addClass: "thin small-font metrics", popupSpacing: ~~this._w._options.popupSpacing, onRemove: function() { i._addOpened = !1 } }), a.click(function() { i._addOpened = !0, a.trigger("button-popup", [$.map(h, function(t, o) { return { title: t.toUpperCase(), active: o === i._addMetric, action: function() { return i._addMetric = o, a.find("span").text(t), e.call(i), !1 } } })]) }), l.click(function() {}), t.append($("<div>").addClass("separator")), t.append(o)
    }, o.prototype._addInterval = function(t) { this._w.addInterval(t), this._reopen({ highlight: t }) }, o.prototype._open = function(t, e) {
        var i, o, s, r, l;
        t.find(".item, .item-add, .separator").remove(), i = [], o = [], s = [], r = [], l = $("<span>").addClass("separator"), $.each(e, function(t, e) {
            var a = new n(e);
            a.isDWM() ? r.push(e) : a.kind() === n.HOURS ? s.push(e) : a.kind() === n.MINUTES ? o.push(e) : i.push(e)
        }), i.length && i.forEach(function(e) { this._append(t, e) }.bind(this)), o.length && (t.append(l.clone()), o.forEach(function(e) { this._append(t, e) }.bind(this))), s.length && (t.append(l.clone()), s.forEach(function(e) { this._append(t, e) }.bind(this))), r.length && (t.append(l.clone()), r.forEach(function(e) { this._append(t, e) }.bind(this))), a.enabled("custom_resolutions_box") && this._appendAdd(t)
    }, o.prototype._reopen = function(t) {
        if (this._open(this._menu, this._w.getSortedIntervals()), t && t.highlight) {
            var e = this._menu.find(".item").filter(function() { return $(this).data("interval") === t.highlight });
            e.length && e.highlight(2)
        }
    }, o.prototype.open = function(t) {
        var e, i = this,
            o = $("<div>").addClass("charts-popup-list intervals-list favored-list").toggleClass("touch", Modernizr.touch),
            n = this._w.mainButton().offset(),
            s = this._w.mainButton().outerHeight(),
            r = n.top + s + parseInt(i._options.popupSpacing || 0);
        o.appendTo(document.body), o.css({ top: r, left: n.left }).show(), this._menu = o, this._opener.addClass("active"), this._open(o, t), e = Math.min($("body").height(), $(window).height()) - s - r - 10, this._setMaxHeight(o, e), setTimeout(function() { o.on("mousedownoutside", function(t) { this.close(t) && o.unbind("mousedownoutside") }.bind(this)) }.bind(this), 0)
    }, o.prototype._setMaxHeight = function(t, e) { t.height() >= e && (t.css("max-height", e + "px"), t.width(t.width() + 18)) }, o.prototype.close = function(t) { return (!t || !$(t.target).parents("span.item-add, .charts-popup-list.metrics").length) && (!(t && $(t.target).hasClass("submenu") && $(t.target).parents(".intervals-container").length) && (this._menu.remove(), $(document.body).off(".interval-menu"), delete this._menu, this._opener.removeClass("active"), !0)) }, t.exports = o
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t, e, i, o) { this.reset(t, e, i, o) }
        var n = i(163).makeFont;
        o.prototype.maxCount = 50, o.prototype.reset = function(t, e, i, o) {
            for (var s = this._next; s && s !== this; s = s._next) s.canvas.width = 0, s._next = null, s._prev = null;
            this._next = this, this._prev = this, this._count = 0, this._fontSize = t, this._color = o, this._font = n(t, e, i), this._hash = {}
        }, o.prototype.paintTo = function(t, e, i, o, n) { var s = this.getLabelImage(e); "left" !== n && (i -= s.width), o -= Math.floor(s.height / 2), t.drawImage(s.canvas, i, o) }, o.prototype.getLabelImage = function(t) {
            var i, o, n, s, r;
            return Object.prototype.hasOwnProperty.call(this._hash, t) ? i = this._hash[t] : (this._count < this.maxCount ? (this._count++, i = { _next: this._next, _prev: this, text: t, width: 0, height: 0, canvas: document.createElement("canvas") }, o = i.canvas.getContext("2d"), o.font = this._font) : (i = this._prev, delete this._hash[i.text], i.text = t, o = i.canvas.getContext("2d")), n = Math.ceil(this._fontSize / 4), s = Math.round(this._fontSize / 10), r = o.measureText(t).width, i.height = this._fontSize + 2 * n, i.width = Math.max(1, r), 0 !== r ? this._hash[i.text] = i : e.enabled("charting_library_debug_mode") && console.log('Canvas 2d context measureText return zero width for "' + t + '" text'), i.canvas.height = i.height, i.canvas.width = i.width, o = i.canvas.getContext("2d"), o.font = this._font, o.fillStyle = this._color, o.fillText(t, 0, n + this._fontSize - s)), this._next !== i && (i._next._prev = i._prev, i._prev._next = i._next, i._prev = this, i._next = this._next, this._next._prev = i, this._next = i), i
        }, t.exports = o
    }).call(e, i(3))
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t, e, i) {
            this._model = e, this._paneWidget = t, this._chart = t._chart, this._mainDiv = i, this.$el = $(document.createElement("div")).addClass("pane-legend"), this._itemsBinding = [], 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.showStudyValues.listeners().subscribe(this, this.updateLayout);
            var o = this._chart.properties().scalesProperties.textColor;
            o.listeners().subscribe(this, function(t) { this.$el.css("color", t) }), this.$el.css("color", o.value()), this.updateLayout()
        }
        var n = i(31).Study,
            s = i(33).trackEvent,
            r = i(12).getLogger("Chart.LegendWidget"),
            a = i(14),
            l = i(106).setMouseEventHandler;
        o.prototype.contextMenuEvent = function(t, i) {
            if (!this._model.chartModel().readOnly() && e.enabled("legend_context_menu")) {
                var o = i.source;
                this._paneWidget.showContextMenuForSource(o, t)
            }
        }, o.prototype.updateLayout = function() {
            var t, o, n, s, r, a, h, c, d, p, u;
            if (this._itemsBinding.length = 0, this.$el.find(".apply-common-tooltip").trigger("mouseleave"), this.$el.empty(), (t = this._paneWidget.state()) && this._model) {
                for (o = { 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(), s = t.orderedSources().slice(), r = s.indexOf(n), r > -1 && (s.splice(r, 1), s.push(n)), a = s.length - 1; a >= 0; a--) h = s[a],
                    (c = h.statusView()) && (!(d = h === n) || o.showSeriesTitle || o.showSeriesOHLC || o.showStudyTitles || o.showStudyValues) && (d && e.enabled("fundamental_widget") || (o.showLegend || !d ? (d || o.showStudyTitles || o.showStudyValues) && o.showLegend && (p = $("<div>").addClass("pane-legend-line pane-legend-wrap").appendTo(this.$el), p.source = h, d ? (u = $('<a class="pane-legend-minbtn apply-common-tooltip apply" title="' + $.t("Hide") + '"></a>').append($(i(906)).attr({ class: "expand" })), p.addClass("main").append(u.on("click touchend", this.toggleTitles.bind(this)))) : p.addClass("study"), h.properties().visible.value() || p.addClass("disabled"), this._generateItemsForRow(p, c, o), l(p, this, !0)) : this.$el.find(".expand-line").length || (p = $("<div>").addClass("pane-legend-line pane-legend-wrap main expand-line").appendTo(this.$el), u = $('<a class="pane-legend-minbtn apply-common-tooltip apply" title="' + $.t("Show") + '"></a>').append($(i(905)).attr({ class: "expand closed" })), p.append(u.on("click touchend", this.toggleTitles.bind(this))), p.source = h, o = { showStudyTitles: !1, showSeriesTitle: !1, showSeriesOHLC: o.showSeriesOHLC, showStudyValues: !1 }, this._generateItemsForRow(p, c, o), l(p, this, !0), this.update())));
                this.update()
            }
        }, o.prototype._generateItemsForRow = function(t, o, s) {
            var a, l, h, c, d, p, u, _, f, m, g, v, y, b, w = t.source,
                S = this,
                T = w === this._model.mainSeries();
            if ((T && s.showSeriesTitle || !T && s.showStudyTitles) && (a = $("<span>"), a.addClass("pane-legend-line apply-overflow-tooltip"), e.enabled("legend_context_menu") && !this._chart.readOnly() || a.addClass("no-context-menu"), T && a.addClass("main"), w.properties().visible.value() || a.addClass("disabled"), a.css({ "font-weight": o.bold() ? "bold" : "normal", "font-size": o.size() }), a.click(function(e) { S.contextMenuEvent(e, t) }), a.appendTo(t), this._itemsBinding.push({ value: o, cell: a, source: t.source }), !this._chart.readOnly() && w.userEditEnabled() && e.enabled("edit_buttons_in_legend") && (l = $('<span class="pane-legend-icon-container">').appendTo(t), e.enabled("show_hide_button_in_legend") && $('<a class="pane-legend-icon apply-common-tooltip icon-hide" title="' + $.t("Show/Hide") + '">').append($(i(860)).attr({ width: 14, height: 14 })).appendTo(l).on("click touchend", this._generateItemsForRow._onShowhideClick.bind(this, w)), e.enabled("property_pages") && (!T || e.enabled("show_chart_property_page") && !this._chart.onWidget()) && e.enabled("format_button_in_legend") && $('<a class="pane-legend-icon apply-common-tooltip format" title="' + $.t("Format") + '">').append($(i(856)).attr({ width: 14, height: 14 })).appendTo(l).on("click touchend", this._generateItemsForRow._onFormatClick.bind(this, w)), w instanceof n && !this._chart.onWidget() && e.enabled("study_buttons_in_legend") && (h = w.metaInfo(), TradingView.isExistent(h.pine) && (c = $('<a class="pane-legend-icon apply-common-tooltip source" title="' + $.t("Show Source Code") + '">').append($(i(867)).attr({ width: 14, height: 14 })).appendTo(l).on("click touchend", this._generateItemsForRow._onViewSorceClick.bind(this, w)), TradingView.ScriptEditorWidget && (d = TradingView.ScriptEditorWidget.loadedScriptIdPart()) && h.scriptIdPart === d && c.addClass("active"),
                    ScriptLib.isAuthToGetPineSourceCode(h.scriptIdPart, h.pine.version).done(function(t) { t || c.addClass("js-hidden") }).fail(function(t) { r.logError("Failed isAuthToGetPineSourceCode, reason: " + t) }))), !T && e.enabled("delete_button_in_legend") && $('<a class="pane-legend-icon apply-common-tooltip delete" title="' + $.t("Delete") + '">').append($(i(378)).attr({ width: 14, height: 14 })).appendTo(l).on("click touchend", this._generateItemsForRow._onDeleteClick.bind(this, w)))), p = w.dataWindowView(), p = w.dataWindowView(), this.isDataWindowValuesVisible(p) && (T && s.showSeriesOHLC || !T && s.showStudyValues)) {
                for (u = [], _ = [], f = $('<div class="pane-legend-item-value-container">'), e.enabled("legend_context_menu") || f.addClass("no-context-menu"), m = 0; m < p.items().length; m++) g = $("<span class='pane-legend-item-value-wrap'>").appendTo(f), v = T ? $("<span class='pane-legend-item-value-title pane-legend-line'>").appendTo(g) : null, y = $("<span class='pane-legend-item-value pane-legend-line'>").appendTo(g), T && y.addClass("main"), w.properties().visible.value() || (y.addClass("disabled"), v && v.addClass("disabled")), u.push(y), v && _.push(v);
                b = $("<span class='pane-legend-item-additional pane-legend-line'>").appendTo(f.appendTo(t)), this._itemsBinding.push({ value: p, cell: u, titleCells: _.length ? _ : null, source: w, additional: b })
            }
        }, o.prototype.isDataWindowValuesVisible = function(t) { return this._chart.onWidget() ? !!t && !this._chart.isSmall() : !!t }, o.prototype._generateItemsForRow._onShowhideClick = function(t) { this._model.setProperty(t.properties().visible, !t.properties().visible.value(), "Show/Hide " + t.title()) }, o.prototype._generateItemsForRow._onFormatClick = function(t, e) { t.userEditEnabled() && (TVSettings.setValue("properties_dialog.active_tab.chart", $.t("Style")), this._chart.showEditObjectDialog(t, this._model)) }, o.prototype._generateItemsForRow._onDeleteClick = function(t) { t.isUserDeletable() && (t.hasChildren() ? showDeleteStudyTreeConfirm(this._model.removeSource.bind(this._model, t)).open() : this._model.removeSource(t)) }, o.prototype._generateItemsForRow._onAddChildSourceClick = function(t) {
            var e, i, o = this._chart.showIndicators(t);
            o && (e = function() { s("SOS", "Apply SOS", "Apply by Plus SOS") }, i = this._model.model().studyInserted(), i.subscribe(this, e), o.visibilityChanged.subscribe(this, function(t) { t || i.unsubscribe(this, e) }, !0))
        }, o.prototype._generateItemsForRow._onViewSorceClick = function(t) {
            var e = t.metaInfo();
            this._getPineSourceCode(e).done(function(t) { TradingView.ScriptEditorWidget && TradingView.ScriptEditorWidget.open(t) })
        }, o.prototype._getPineSourceCode = function(t) { return $.Deferred() }, o.prototype.setItemEnabled = function(t, e) {
            var i = !t.hasClass("disabled"),
                o = t.closest(".pane-legend-wrap");
            e && !i ? (t.removeClass("disabled"), o.removeClass("disabled")) : !e && i && (t.addClass("disabled"), o.addClass("disabled"))
        }, o.prototype.valueChanged = function(t, e, i) { return t[e] !== i && (t[e] = i, !0) }, o.prototype.firstTitle = function() { return this.$el.find(".pane-legend-line.pane-legend-wrap:first-child") }, o.prototype.updateTitle = function() {
            var t, i, o, n, s, r, a, l;
            for (o = this._itemsBinding.length; o--;) i = this._itemsBinding[o],
                Array.isArray(i.cell) || (i.last || (i.last = {}), n = i.last, s = i.source, t = s.properties().visible.value(), this.valueChanged(n, "sourceVisible", t) && this.setItemEnabled(i.cell, t), r = i.value.color(), a = s !== this._model.mainSeries() && s === this._model.selectedSource() ? "bold" : "normal", l = i.value.text(), e.enabled("fundamental_widget") && (l = this._model.mainSeries().symbolInfo().name + " " + l), (this.valueChanged(n, "color", r) || this.valueChanged(n, "fontWeight", a) || this.valueChanged(n, "text", l)) && i.cell.text(TradingView.clean(l, !0)).css({ color: r, "border-color": r, "font-weight": a }));
            this._chart.resizeIndicator()
        }, o.prototype.update = function(t) {
            var e, i, o, n, s, r, l, h, c, d;
            for (this.updateTitle(), h = this._itemsBinding.length; h--;)
                if (n = this._itemsBinding[h], e = n.cell, i = n.titleCells, o = n.source.properties().visible.value(), Array.isArray(e)) {
                    for (n.last || (n.last = {}, n.last.dwView || (n.last.dwView = {})), c = n.last, s = n.value.items(), d = this.valueChanged(c, "sourceVisible", o), r = 0; r < e.length; r++) l = s[r], c[r] || (c[r] = {}), d && this.setItemEnabled(e[r], o), this.valueChanged(c[r], "text", l.text()) && (e[r][0].textContent = l.text()), l.color() && this.valueChanged(c[r], "color", l.color()) && e[r].css("color", a.resetTransparency(l.color())), i && (this.valueChanged(c, "sourceVisible", o) && this.setItemEnabled(i[r], o), this.valueChanged(c[r], "title", l.title()) && (i[r][0].textContent = l.title()));
                    n.additional && n.value.additional && this.valueChanged(c, "additional", n.value.additional()) && n.additional.text(n.value.additional() || "")
                }
            this._chart.resizeIndicator()
        }, o.prototype.dataSourceAtPoint = function(t, e) { return null }, o.prototype.renderTo = function(t, e, i) {
            var o, n, s, r, a, l, h;
            for (t.save(), t.fillStyle = this._chart.properties().scalesProperties.textColor.value(), t.textBaseline = "middle", o = 0, n = 0; n < this._itemsBinding.length; ++n) s = this._itemsBinding[n], r = s.value, a = s.source === this._model.mainSeries(), l = a ? 12 : 8, h = a ? 25 : 17, Array.isArray(s.cell) || (t.font = r.size() + " Verdana, Arial", t.fillText(r.text(), e, i + o + l), o += h);
            t.restore()
        }, o.prototype.toggleTitles = function(t) { this._model.model().properties().paneProperties.legendProperties.showLegend.setValue(!this._chart.properties().paneProperties.legendProperties.showLegend.value()); for (var e = this._chart._paneWidgets.length - 1; e >= 0; e--) this._chart._paneWidgets[e].legendWidget.updateLayout() }, t.exports = o
    }).call(e, i(3))
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.BooleanBinder,
        a = s.ColorBinding,
        l = s.SliderBinder,
        h = s.SimpleComboBinder,
        c = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, d, p, u, _, f;
        this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = c(), e = this.createColorPicker(), i = this.createColorPicker(), o = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'), n = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'), s = this.createFontSizeEditor(), d = this.createFontEditor(),
            p = this.addLabeledRow(this._table, "Border"), p.prepend("<td>"), $("<td>").append(e).appendTo(p), $("<td>").append(t).appendTo(p), u = $('<input type="checkbox" class="visibility-switch">'), _ = this.createColorPicker(), d = this.createFontEditor(), p = this.addLabeledRow(this._table, "Background", u), $("<td>").append(u).prependTo(p), $("<td>").append(_).appendTo(p), this.bindControl(new r(u, this._linetool.properties().fillBackground, !0, this.model(), "Change Pattern Filling")), this.bindControl(new a(e, this._linetool.properties().color, !0, this.model(), "Change Pattern Line Color")), this.bindControl(new a(i, this._linetool.properties().textcolor, !0, this.model(), "Change Pattern Text Color")), this.bindControl(new a(_, this._linetool.properties().backgroundColor, !0, this.model(), "Change Pattern Background Color", this._linetool.properties().transparency)), this.bindControl(new l(t, this._linetool.properties().linewidth, !0, this.model(), "Change Pattern Border Width")), this.bindControl(new h(s, this._linetool.properties().fontsize, parseInt, !0, this.model(), "Change Text Font Size")), this.bindControl(new h(d, this._linetool.properties().font, null, !0, this.model(), "Change Text Font")), this.bindControl(new r(o, this._linetool.properties().bold, !0, this.model(), "Change Text Font Bold")), this.bindControl(new r(n, this._linetool.properties().italic, !0, this.model(), "Change Text Font Italic")), f = $('<table class="property-page" cellspacing="0" cellpadding="2"><tr>').append($(document.createElement("td")).attr({ width: 1 }).append(i)).append($(document.createElement("td")).attr({ width: 1 }).append(d)).append($(document.createElement("td")).attr({ width: 1 }).append(s)).append($(document.createElement("td")).css("vertical-align", "top").attr({ width: 1 }).append(o)).append($(document.createElement("td")).css("vertical-align", "top").append(n)).append($("</tr></table>")), p = this.addLabeledRow(this._table, ""), $('<td colspan="5">').append(f).appendTo(p), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.ColorBinding,
        a = s.SliderBinder,
        l = s.SimpleComboBinder,
        h = s.BooleanBinder,
        c = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, d, p, u;
        this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = c(), e = this.createColorPicker(), i = this.createColorPicker(), o = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'), n = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'), s = this.createFontSizeEditor(), d = this.createFontEditor(), p = this.addLabeledRow(this._table, "Border"), p.prepend("<td>"), $("<td>").append(e).appendTo(p), $("<td>").append(t).appendTo(p), d = this.createFontEditor(), this.bindControl(new r(e, this._linetool.properties().color, !0, this.model(), "Change Pattern Line Color")),
            this.bindControl(new r(i, this._linetool.properties().textcolor, !0, this.model(), "Change Pattern Text Color")), this.bindControl(new a(t, this._linetool.properties().linewidth, !0, this.model(), "Change Pattern Border Width")), this.bindControl(new l(s, this._linetool.properties().fontsize, parseInt, !0, this.model(), "Change Text Font Size")), this.bindControl(new l(d, this._linetool.properties().font, null, !0, this.model(), "Change Text Font")), this.bindControl(new h(o, this._linetool.properties().bold, !0, this.model(), "Change Text Font Bold")), this.bindControl(new h(n, this._linetool.properties().italic, !0, this.model(), "Change Text Font Italic")), u = $('<table class="property-page" cellspacing="0" cellpadding="2"><tr>').append($(document.createElement("td")).attr({ width: 1 }).append(i)).append($(document.createElement("td")).attr({ width: 1 }).append(d)).append($(document.createElement("td")).attr({ width: 1 }).append(s)).append($(document.createElement("td")).css("vertical-align", "top").attr({ width: 1 }).append(o)).append($(document.createElement("td")).css("vertical-align", "top").append(n)).append($("</tr></table>")), p = this.addLabeledRow(this._table, ""), $('<td colspan="5">').append(u).appendTo(p), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.BooleanBinder,
        a = s.ColorBinding,
        l = s.SliderBinder,
        h = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n;
        this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = h(), e = this.createColorPicker(), i = this.addLabeledRow(this._table, "Border"), i.prepend("<td>"), $("<td>").append(e).appendTo(i), $("<td>").append(t).appendTo(i), o = $('<input type="checkbox" class="visibility-switch">'), n = this.createColorPicker(), i = this.addLabeledRow(this._table, "Background", o), $("<td>").append(o).prependTo(i), $("<td>").append(n).appendTo(i), this.bindControl(new r(o, this._linetool.properties().fillBackground, !0, this.model(), "Change Arc Filling")), this.bindControl(new a(e, this._linetool.properties().color, !0, this.model(), "Change Arc Line Color")), this.bindControl(new a(n, this._linetool.properties().backgroundColor, !0, this.model(), "Change Arc Background Color", this._linetool.properties().transparency)), this.bindControl(new l(t, this._linetool.properties().linewidth, !0, this.model(), "Change Arc Border Width")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.SimpleStringBinder,
        a = s.ColorBinding,
        l = s.SimpleComboBinder;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n;
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">').css({ width: "100%" }), t = $("<input type='text'>").css({ width: "100%" }), e = $('<div class="property-page-fullwidth-wrapper">').append(t), i = this.createColorPicker(),
            o = this.createFontEditor(), n = $("<tr>").appendTo(this._table), $("<td>").css({ width: "0" }).html($.t("Text")).appendTo(n), $('<td colspan="2">').append(e).appendTo(n), n = this.addLabeledRow(this._table, "Text Font"), n.children().css({ whiteSpace: "nowrap" }), $("<td>").append(i).appendTo(n).css({ width: "0" }), $("<td>").append(o).appendTo(n), this.bindControl(new a(i, this._linetool.properties().color, !0, this.model(), "Change Arrow Mark Text Color")), this.bindControl(new r(t, this._linetool.properties().text, null, !0, this.model(), "Change Arrow Mark Text")), this.bindControl(new l(o, this._linetool.properties().font, null, !0, this.model(), "Change Arrow Mark Font")), this.loadData(), setTimeout(function() { t.select(), t.focus() }, 20)
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.SimpleComboBinder,
        a = s.ColorBinding,
        l = s.SimpleStringBinder;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, o, n, s, h, c, d, p = i(76),
            u = $('<table class="property-page" cellspacing="0" cellpadding="0">').css({ width: "100%" }).data("layout-tab-open", p.TAB_OPEN_OVERRIDE),
            _ = $('<table class="property-page" cellspacing="0" cellpadding="0">');
        this._table = u.add(_), t = $("<input type='text'>").css({ width: "100%" }), e = this.createColorPicker(), o = this.createFontSizeEditor(), n = this.createColorPicker(), s = this.createColorPicker(), h = $("<tr>").appendTo(u), c = $('<div class="property-page-fullwidth-wrapper">').append(t), $("<td>").append(c).appendTo(h), d = this.addLabeledRow(_, $.t("Text")), $("<td>").append(e).appendTo(d), $("<td>").append(o).appendTo(d), d = this.addLabeledRow(_, $.t("Background")), $("<td>").appendTo(d).append(n), d = this.addLabeledRow(_, $.t("Border")), $("<td>").appendTo(d).append(s), $("<td>"), this.bindControl(new l(t, this._linetool.properties().text, null, !0, this.model(), "Change Balloon Text")), this.bindControl(new a(e, this._linetool.properties().color, !0, this.model(), "Change Baloon Text Color")), this.bindControl(new r(o, this._linetool.properties().fontsize, parseInt, !0, this.model(), "Change Balloon Text Font Size")), this.bindControl(new a(n, this._linetool.properties().backgroundColor, !0, this.model(), "Change Balloon Background Color", this._linetool.properties().transparency)), this.bindControl(new a(s, this._linetool.properties().borderColor, !0, this.model(), "Change Balloon Border Color")), this.loadData(), setTimeout(function() { t.select(), t.focus() }, 0)
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { s.call(this, t, e, i), this.prepareLayout() }

    function n(t, e, i) { r.call(this, t, e, i) }
    var s = i(10),
        r = i(64),
        a = i(5),
        l = a.ToFloatTransformer,
        h = a.SimpleComboBinder,
        c = a.ColorBinding,
        d = a.BooleanBinder,
        p = a.SimpleStringBinder;
    inherit(o, s), o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s;
        this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = $("<tbody>").appendTo(this._table), e = this.createColorPicker(),
            i = this.addLabeledRow(t, "Color"), $("<td>").append(e).appendTo(i), o = $('<select><option value="0">' + $.t("HL Bars") + '</option><option value="2">' + $.t("OC Bars") + '</option><option value="1">' + $.t("Line - Close") + '</option><option value="3">' + $.t("Line - Open") + '</option><option value="4">' + $.t("Line - High") + '</option><option value="5">' + $.t("Line - Low") + '</option><option value="6">' + $.t("Line - HL/2") + "</option></select>"), i = this.addLabeledRow(t, "Mode"), $("<td>").append(o).appendTo(i), i = $("<tr>").appendTo(t), $("<td>" + $.t("Mirrored") + "</td>").appendTo(i), n = $("<input type='checkbox'>"), $("<td>").append(n).appendTo(i), i = $("<tr>").appendTo(t), $("<td>" + $.t("Flipped") + "</td>").appendTo(i), s = $("<input type='checkbox'>"), $("<td>").append(s).appendTo(i), this.bindControl(new d(n, this._linetool.properties().mirrored, !0, this.model(), "Change Bars Pattern Mirroring")), this.bindControl(new d(s, this._linetool.properties().flipped, !0, this.model(), "Change Bars Pattern Flipping")), this.bindControl(new c(e, this._linetool.properties().color, !0, this.model(), "Change Bars Pattern Color")), this.bindControl(new h(o, this._linetool.properties().mode, null, !0, this.model(), "Change Bars Pattern Mode")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, inherit(n, r), n.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, r, a, h;
        this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = $("<tr>"), t.appendTo(this._table), e = $("<td>"), e.html($.t("Price")), e.appendTo(t), i = $("<td>"), i.appendTo(t), o = $("<input type='text'>"), o.appendTo(i), n = $("<td>"), n.html($.t("Bar #")), n.appendTo(t), s = $("<td>"), s.appendTo(t), r = $("<input type='text'>"), r.appendTo(s), r.addClass("ticker"), a = this._linetool.properties().points[0], h = [l(a.price.value())], this.bindControl(new p(o, a.price, h, !1, this.model(), "Change " + this._linetool + " point price")), this.bindBarIndex(a.bar, r, this.model(), "Change " + this._linetool + " point bar index"), this.loadData()
    }, e.LineToolBarsPatternStylesPropertyPage = o, e.LineToolBarsPatternInputsPropertyPage = n
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.ColorBinding,
        a = s.SimpleComboBinder,
        l = s.SliderBinder,
        h = s.BooleanBinder,
        c = i(19).createLineStyleEditor,
        d = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, p, u, _, f, m, g, v, y, b, w;
        this._block = $("<div>").addClass("property-page"), t = $('<table cellspacing="0" cellpadding="2">').appendTo(this._block), e = $("<tbody>").appendTo(t), i = d(), o = c(), n = this.createColorPicker(), s = this.addLabeledRow(e, $.t("Line")), $("<td>").append(n).appendTo(s), $("<td>").append(i).appendTo(s), $('<td colspan="3">').append(o.render()).appendTo(s), p = $('<table cellspacing="0" cellpadding="2">').appendTo(this._block), s = this.addLabeledRow(p, $.t("Background"), u), u = $('<input type="checkbox" class="visibility-switch">'), _ = this.createColorPicker(), $("<td>").append(u).prependTo(s), $("<td>").append(_).appendTo(s),
            f = $('<table cellspacing="0" cellpadding="2">').appendTo(this._block), m = $("<select><option value='0'>" + $.t("Normal") + "</option><option value='1'>" + $.t("Arrow") + "</option></select>"), g = $("<select><option value='0'>" + $.t("Normal") + "</option><option value='1'>" + $.t("Arrow") + "</option></select>"), v = $("<label>" + $.t("Extend") + " </label>").css({ "margin-left": "8px" }), y = $('<input type="checkbox">').appendTo(v), b = $("<label>" + $.t("Extend") + " </label>").css({ "margin-left": "8px" }), w = $('<input type="checkbox">').appendTo(b), s = this.addLabeledRow(f, $.t("Left End")), $('<td colspan="3">').appendTo(s).append(m).append(v), s = this.addLabeledRow(f, $.t("Right End")), $('<td colspan="3">').appendTo(s).append(g).append(b), this.bindControl(new r(n, this._linetool.properties().linecolor, !0, this.model(), "Change Curve Line Color")), this.bindControl(new a(o, this._linetool.properties().linestyle, parseInt, !0, this.model(), "Change Curve Line Style")), this.bindControl(new l(i, this._linetool.properties().linewidth, !0, this.model(), "Change Curve Line Width")), this.bindControl(new h(u, this._linetool.properties().fillBackground, !0, this.model(), "Change Curve Filling")), this.bindControl(new r(_, this._linetool.properties().backgroundColor, !0, this.model(), "Change Curve Background Color", this._linetool.properties().transparency)), this.bindControl(new a(m, this._linetool.properties().leftEnd, parseInt, !0, this.model(), "Change Curve Line Left End")), this.bindControl(new a(g, this._linetool.properties().rightEnd, parseInt, !0, this.model(), "Change Curve Line Right End")), this.bindControl(new h(y, this._linetool.properties().extendLeft, !0, this.model(), "Change Curve Line Extending Left")), this.bindControl(new h(w, this._linetool.properties().extendRight, !0, this.model(), "Change Curve Line Extending Right")), this.loadData()
    }, o.prototype.widget = function() { return this._block }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.SliderBinder,
        a = s.BooleanBinder,
        l = s.ColorBinding,
        h = s.SimpleComboBinder,
        c = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, d, p;
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">'), t = c(), e = this.createColorPicker(), i = $('<input type="checkbox" class="visibility-switch">'), o = this.createColorPicker(), n = this.addLabeledRow(this._table, "Line"), $("<td>").prependTo(n), $("<td>").append(e).appendTo(n), $("<td>").append(t).appendTo(n), n = this.addLabeledRow(this._table, "Background", i), $("<td>").append(i).prependTo(n), $("<td>").append(o).appendTo(n), s = $("<tbody>").appendTo(this._table), d = $("<select><option value='0'>" + $.t("Normal") + "</option><option value='1'>" + $.t("Arrow") + "</option></select>"), p = $("<select><option value='0'>" + $.t("Normal") + "</option><option value='1'>" + $.t("Arrow") + "</option></select>"), n = this.addLabeledRow(s, $.t("Left End")), $("<td>").prependTo(n), $('<td colspan="3">').appendTo(n).append(d), n = this.addLabeledRow(s, $.t("Right End")), $("<td>").prependTo(n), $('<td colspan="3">').appendTo(n).append(p),
            this.bindControl(new l(e, this._linetool.properties().linecolor, !0, this.model(), "Change Brush Color")), this.bindControl(new r(t, this._linetool.properties().linewidth, !0, this.model(), "Change Brush Line Width")), this.bindControl(new a(i, this._linetool.properties().fillBackground, !0, this.model(), "Change Brush Filling")), this.bindControl(new l(o, this._linetool.properties().backgroundColor, !0, this.model(), "Change Brush Background Color", this._linetool.properties().transparency)), this.bindControl(new h(d, this._linetool.properties().leftEnd, parseInt, !0, this.model(), "Change Trend Line Left End")), this.bindControl(new h(p, this._linetool.properties().rightEnd, parseInt, !0, this.model(), "Change Trend Line Right End")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.BooleanBinder,
        a = s.ColorBinding,
        l = s.SimpleComboBinder,
        h = s.SliderBinder,
        c = s.SimpleStringBinder,
        d = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, o, n, s, p = this.createColorPicker(),
            u = this.createFontSizeEditor(),
            _ = this.createFontEditor(),
            f = this.createTextEditor(350, 200),
            m = this.createColorPicker(),
            g = d(),
            v = this.createColorPicker(),
            y = $('<input type="checkbox">'),
            b = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),
            w = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');
        this.bindControl(new a(p, this._linetool.properties().color, !0, this.model(), "Change Text Color")), this.bindControl(new l(u, this._linetool.properties().fontsize, parseInt, !0, this.model(), "Change Text Font Size")), this.bindControl(new l(_, this._linetool.properties().font, null, !0, this.model(), "Change Text Font")), this.bindControl(new c(f, this._linetool.properties().text, null, !0, this.model(), "Change Text")), this.bindControl(new a(m, this._linetool.properties().backgroundColor, !0, this.model(), "Change Text Background", this._linetool.properties().transparency)), this.bindControl(new a(v, this._linetool.properties().bordercolor, !0, this.model(), "Change Text Color")), this.bindControl(new h(g, this._linetool.properties().linewidth, !0, this.model(), "Change Border Width")), this.bindControl(new r(y, this._linetool.properties().wordWrap, !0, this.model(), "Change Text Wrap")), this.bindControl(new r(b, this._linetool.properties().bold, !0, this.model(), "Change Text Font Bold")), this.bindControl(new r(w, this._linetool.properties().italic, !0, this.model(), "Change Text Font Italic")), t = i(76), e = $('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab-open", t.TAB_OPEN_OVERRIDE), o = $('<table class="property-page" cellspacing="0" cellpadding="2">'), n = $('<table class="property-page" cellspacing="0" cellpadding="2">'), this._table = e.add(n).add(o), $(document.createElement("tr")).append($(document.createElement("td")).attr({ width: 1 }).append(p)).append($(document.createElement("td")).attr({ width: 1 }).append(_)).append($(document.createElement("td")).attr({
            width: 1
        }).append(u)).append($(document.createElement("td")).attr({ width: 1 }).append(b)).append($(document.createElement("td")).append(w)).appendTo(e), $(document.createElement("tr")).append($(document.createElement("td")).attr({ colspan: 5 }).append(f)).appendTo(e), s = this.addLabeledRow(o, "Text Wrap", y), $("<td>").append(y).prependTo(s), s = this.addLabeledRow(n, "Background"), $("<td>").append(m).appendTo(s), s = this.addLabeledRow(n, "Border"), $("<td>").append(v).appendTo(s), $("<td>").append(g).appendTo(s), this.loadData(), setTimeout(function() { f.select(), f.focus() }, 20)
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.SimpleComboBinder,
        a = s.ColorBinding,
        l = s.SliderBinder,
        h = i(19).createLineStyleEditor,
        c = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o;
        this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = c(), e = h(), i = this.createColorPicker(), o = this.addLabeledRow(this._table, "Lines"), $("<td>").append(i).appendTo(o), $("<td>").append(t).appendTo(o), $("<td>").append(e.render()).appendTo(o), this.bindControl(new a(i, this._linetool.properties().linecolor, !0, this.model(), "Change Circle Lines Color")), this.bindControl(new r(e, this._linetool.properties().linestyle, parseInt, !0, this.model(), "Change Circle Lines Style")), this.bindControl(new l(t, this._linetool.properties().linewidth, !0, this.model(), "Change Circle Lines Width")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.SimpleComboBinder,
        a = s.ColorBinding,
        l = s.BooleanBinder,
        h = s.SliderBinder,
        c = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, d, p, u, _, f, m, g, v;
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">'), t = $("<tbody>").appendTo(this._table), e = c(), i = this.createColorPicker(), o = this.addLabeledRow(t, $.t("Line")), $("<td>").prependTo(o), $("<td>").append(i).appendTo(o), $("<td>").append(e).appendTo(o), n = this.createColorPicker(), s = this.createColorPicker(), d = this.createFontSizeEditor(), p = this.createFontEditor(), u = this.createColorPicker(), _ = $('<input type="checkbox" class="visibility-switch">'), f = this.createColorPicker(), m = $('<input type="checkbox" class="visibility-switch">'), this.bindControl(new a(n, this._linetool.properties().textcolor, !0, this.model(), "Change Text Color")), this.bindControl(new r(d, this._linetool.properties().fontsize, parseInt, !0, this.model(), "Change Text Font Size")), this.bindControl(new r(p, this._linetool.properties().font, null, !0, this.model(), "Change Text Font")), this.bindControl(new a(u, this._linetool.properties().labelBackgroundColor, !0, this.model(), "Change Text Background", this._linetool.properties().labelBackgroundTransparency)),
            this.bindControl(new l(_, this._linetool.properties().fillLabelBackground, !0, this.model(), "Change Text Background Fill")), this.bindControl(new a(f, this._linetool.properties().backgroundColor, !0, this.model(), "Change Text Background", this._linetool.properties().backgroundTransparency)), this.bindControl(new l(m, this._linetool.properties().fillBackground, !0, this.model(), "Change Text Background Fill")), this.bindControl(new a(s, this._linetool.properties().borderColor, !0, this.model(), "Change Text Border Color")), g = this.addLabeledRow(t, $.t("Background"), m), $("<td>").append(m).prependTo(g), $("<td>").append(f).appendTo(g), v = this.addLabeledRow(t, $.t("Label")), $("<td>").prependTo(v), $("<td>").append(n).appendTo(v), $("<td>").append(p).appendTo(v), $("<td>").append(d).appendTo(v), g = this.addLabeledRow(t, $.t("Label Background"), _), $("<td>").append(_).prependTo(g), $("<td>").append(u).appendTo(g), this.bindControl(new a(i, this._linetool.properties().linecolor, !0, this.model(), "Change Date Range Color")), this.bindControl(new h(e, this._linetool.properties().linewidth, !0, this.model(), "Change Date Range Line Width")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.SimpleComboBinder,
        a = s.ColorBinding,
        l = s.BooleanBinder,
        h = s.SliderBinder,
        c = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, d, p, u, _, f, m, g, v;
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">'), t = $("<tbody>").appendTo(this._table), e = c(), i = this.createColorPicker(), o = this.addLabeledRow(t, $.t("Line")), $("<td>").prependTo(o), $("<td>").append(i).appendTo(o), $("<td>").append(e).appendTo(o), n = this.createColorPicker(), s = this.createColorPicker(), d = this.createFontSizeEditor(), p = this.createFontEditor(), u = this.createColorPicker(), _ = $('<input type="checkbox" class="visibility-switch">'), f = this.createColorPicker(), m = $('<input type="checkbox" class="visibility-switch">'), this.bindControl(new a(n, this._linetool.properties().textcolor, !0, this.model(), "Change Text Color")), this.bindControl(new r(d, this._linetool.properties().fontsize, parseInt, !0, this.model(), "Change Text Font Size")), this.bindControl(new r(p, this._linetool.properties().font, null, !0, this.model(), "Change Text Font")), this.bindControl(new a(u, this._linetool.properties().labelBackgroundColor, !0, this.model(), "Change Text Background", this._linetool.properties().labelBackgroundTransparency)), this.bindControl(new l(_, this._linetool.properties().fillLabelBackground, !0, this.model(), "Change Text Background Fill")), this.bindControl(new a(f, this._linetool.properties().backgroundColor, !0, this.model(), "Change Text Background", this._linetool.properties().backgroundTransparency)), this.bindControl(new l(m, this._linetool.properties().fillBackground, !0, this.model(), "Change Text Background Fill")), this.bindControl(new a(s, this._linetool.properties().borderColor, !0, this.model(), "Change Text Border Color")), g = this.addLabeledRow(t, $.t("Background"), m),
            $("<td>").append(m).prependTo(g), $("<td>").append(f).appendTo(g), v = this.addLabeledRow(t, $.t("Label")), $("<td>").prependTo(v), $("<td>").append(n).appendTo(v), $("<td>").append(p).appendTo(v), $("<td>").append(d).appendTo(v), g = this.addLabeledRow(t, $.t("Label Background"), _), $("<td>").append(_).prependTo(g), $("<td>").append(u).appendTo(g), this.bindControl(new a(i, this._linetool.properties().linecolor, !0, this.model(), "Change Date Range Color")), this.bindControl(new h(e, this._linetool.properties().linewidth, !0, this.model(), "Change Date Range Line Width")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.SimpleComboBinder,
        a = s.BooleanBinder,
        l = s.ColorBinding,
        h = s.SliderBinder,
        c = i(19).createLineStyleEditor,
        d = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, p, u, _, f, m, g, v, y, b, w, S, T, C, x, P, L, k, I;
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">'), t = $("<tbody>").appendTo(this._table), e = d(), i = c(), o = this.createColorPicker(), n = this.addLabeledRow(t, $.t("Line")), $("<td>").append(o).appendTo(n), $("<td>").append(e).appendTo(n), $('<td colspan="3">').append(i.render()).appendTo(n), n = this.addLabeledRow(t, $.t("Text")), s = this.createColorPicker(), p = this.createFontSizeEditor(), u = this.createFontEditor(), _ = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'), f = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'), $("<td>").append(s).appendTo(n), $("<td>").append(u).appendTo(n), $("<td>").append(p).appendTo(n), $("<td>").append(_).appendTo(n), $("<td>").append(f).appendTo(n), m = $("<tbody>").appendTo(this._table), g = $('<input type="checkbox" class="visibility-switch">'), v = this.createColorPicker(), n = this.addLabeledRow(m, $.t("Background"), g), y = $("<table>"), $('<td colspan="5">').append(y).appendTo(n), n = $("<tr>").appendTo(y), $("<td>").append(g).appendTo(n), $("<td>").append(v).appendTo(n), b = $("<tbody>").appendTo(this._table), w = $("<label>" + $.t("Extend") + " </label>").css({ "margin-left": "8px" }), S = $('<input type="checkbox">').appendTo(w), T = $("<label>" + $.t("Extend") + " </label>").css({ "margin-left": "8px" }), C = $('<input type="checkbox">').appendTo(T), x = $("<select><option value='0'>" + $.t("Normal") + "</option><option value='1'>" + $.t("Arrow") + "</option></select>"), P = $("<select><option value='0'>" + $.t("Normal") + "</option><option value='1'>" + $.t("Arrow") + "</option></select>"), n = this.addLabeledRow(b, $.t("Left End")), $('<td colspan="3">').appendTo(n).append(x).append(w), n = this.addLabeledRow(b, $.t("Right End")), $('<td colspan="3">').appendTo(n).append(P).append(T), L = $("<tbody>").appendTo(this._table), n = $("<tr>").appendTo(L), k = $("<input type='checkbox'>"), I = $("<label style='display:block'>").append(k).append($.t("Show Prices")), $("<td colspan='2'>").append(I).appendTo(n),
            this.bindControl(new r(p, this._linetool.properties().fontsize, parseInt, !0, this.model(), "Change Text Font Size")), this.bindControl(new r(u, this._linetool.properties().font, null, !0, this.model(), "Change Text Font")), this.bindControl(new l(s, this._linetool.properties().textcolor, !0, this.model(), "Change Text Color")), this.bindControl(new a(_, this._linetool.properties().bold, !0, this.model(), "Change Text Font Bold")), this.bindControl(new a(f, this._linetool.properties().italic, !0, this.model(), "Change Text Font Italic")), this.bindControl(new a(k, this._linetool.properties().showPrices, !0, this.model(), "Change Disjoint Angle Show Prices")), this.bindControl(new a(S, this._linetool.properties().extendLeft, !0, this.model(), "Change Disjoint Angle Extending Left")), this.bindControl(new a(C, this._linetool.properties().extendRight, !0, this.model(), "Change Disjoint Angle Extending Right")), this.bindControl(new l(o, this._linetool.properties().linecolor, !0, this.model(), "Change Disjoint Angle Color")), this.bindControl(new r(i, this._linetool.properties().linestyle, parseInt, !0, this.model(), "Change Disjoint Angle Style")), this.bindControl(new h(e, this._linetool.properties().linewidth, !0, this.model(), "Change Disjoint Angle Width")), this.bindControl(new r(x, this._linetool.properties().leftEnd, parseInt, !0, this.model(), "Change Disjoint Angle Left End")), this.bindControl(new r(P, this._linetool.properties().rightEnd, parseInt, !0, this.model(), "Change Disjoint Angle Right End")), this.bindControl(new a(g, this._linetool.properties().fillBackground, !0, this.model(), "Change Disjoint Angle Filling")), this.bindControl(new l(v, this._linetool.properties().backgroundColor, !0, this.model(), "Change Disjoint Angle Background Color", this._linetool.properties().transparency)), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { s.call(this, t, e, i), this.prepareLayout() }
    var n = i(65).LineToolElliott,
        s = i(10),
        r = i(5),
        a = r.SimpleComboBinder,
        l = r.ColorBinding,
        h = r.SliderBinder,
        c = r.BooleanBinder,
        d = i(13).createLineWidthEditor;
    inherit(o, s), o.prototype.prepareLayout = function() {
        var t, e, i, o, s, r;
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">'), t = n.degrees, e = this.createKeyCombo(t), e.width(300), i = this.createColorPicker(), o = $('<input type="checkbox" class="visibility-switch">'), s = this.addLabeledRow(this._table, "Degree"), $("<td>").prependTo(s), $("<td>").append(e).appendTo(s), s = this.addLabeledRow(this._table, "Line Width"), r = d(), $("<td>").prependTo(s), $("<td>").append(r).appendTo(s), s = this.addLabeledRow(this._table, "Color"), $("<td>").prependTo(s), $("<td>").append(i).appendTo(s), s = this.addLabeledRow(this._table, "Show Wave", o), $("<td>").append(o).prependTo(s), this.bindControl(new l(i, this._linetool.properties().color, !0, this.model(), "Change Elliott Label Color")), this.bindControl(new a(e, this._linetool.properties().degree, parseInt, !0, this.model(), "Change Elliott Wave Size")), this.bindControl(new c(o, this._linetool.properties().showWave, !0, this.model(), "Change Elliott Labels Background")),
            this.bindControl(new h(r, this._linetool.properties().linewidth, parseInt, this.model(), "Change Elliott Wave Line Width")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.BooleanBinder,
        a = s.ColorBinding,
        l = s.SliderBinder,
        h = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n;
        this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = h(), e = this.createColorPicker(), i = this.addLabeledRow(this._table, $.t("Border")), i.prepend("<td>"), $("<td>").append(e).appendTo(i), $("<td>").append(t).appendTo(i), o = $('<input type="checkbox" class="visibility-switch">'), n = this.createColorPicker(), i = this.addLabeledRow(this._table, $.t("Background"), o), $("<td>").append(o).prependTo(i), $("<td>").append(n).appendTo(i), this.bindControl(new r(o, this._linetool.properties().fillBackground, !0, this.model(), "Change Ellipse Filling")), this.bindControl(new a(e, this._linetool.properties().color, !0, this.model(), "Change Ellipse Line Color")), this.bindControl(new a(n, this._linetool.properties().backgroundColor, !0, this.model(), "Change Ellipse Background Color", this._linetool.properties().transparency)), this.bindControl(new l(t, this._linetool.properties().linewidth, !0, this.model(), "Change Ellipse Border Width")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i) }
    var n = i(193);
    inherit(o, n), t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.FloatBinder,
        a = s.SimpleComboBinder,
        l = s.BooleanBinder,
        h = s.ColorBinding,
        c = s.SliderBinder,
        d = i(32).addColorPicker,
        p = i(19).createLineStyleEditor,
        u = i(13).createLineWidthEditor,
        _ = i(46).createTransparencyEditor;
    inherit(o, n), o.prototype.addLevelEditor = function(t, e, i) {
        var o, n, s, _, f, m, g, v, y, b, w = $("<tr>");
        w.appendTo(this._table), o = $("<td>"), o.appendTo(w), n = $("<input type='checkbox' class='visibility-switch'>"), n.appendTo(o), t ? (s = $("<td>"), s.appendTo(w), _ = $("<input type='text'>"), _.appendTo(s), _.css("width", "70px"), this.bindControl(new r(_, e.coeff, !1, this.model(), "Change Pitchfork Line Coeff"))) : this.createLabeledCell("Trend Line", n).appendTo(w), f = $("<td class='colorpicker-cell'>"), f.appendTo(w), m = d(f), g = $("<td>"), g.appendTo(w), v = u(), v.appendTo(g), t || (y = $("<td>"), y.appendTo(w), b = p(), b.render().appendTo(y), this.bindControl(new a(b, e.linestyle, parseInt, !0, this.model(), "Change Fib Circle Style"))), this.bindControl(new l(n, e.visible, !0, this.model(), "Change Fib Circle Visibility")), this.bindControl(new h(m, e.color, !0, this.model(), "Change Fib Circle Line Color", 0)), this.bindControl(new c(v, e.linewidth, !0, this.model(), "Change Fib Circle Width"))
    }, o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, r;
        for (this._table = $(document.createElement("table")), this._table.addClass("property-page"),
            this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), this.addLevelEditor(null, this._linetool.properties().trendline, !1), t = 1; t <= 11; t++) e = "level" + t, this.addLevelEditor("Level " + t, this._linetool.properties()[e], !1);
        this.addOneColorPropertyWidget(this._table), i = $("<input type='checkbox' class='visibility-switch'>"), o = this.addLabeledRow(this._table, "Levels", i), $("<td>").append(i).prependTo(o), n = $("<input type='checkbox' class='visibility-switch'>"), o = this.addLabeledRow(this._table, "Coeffs As Percents", n), $("<td>").append(n).prependTo(o), this.bindControl(new l(i, this._linetool.properties().showCoeffs, !0, this.model(), "Change Fib Circle Levels Visibility")), o = $("<tr>"), o.appendTo(this._table), s = $("<input type='checkbox' class='visibility-switch'>"), $("<td>").append(s).appendTo(o), this.createLabeledCell("Background", s).appendTo(o), r = _(), $('<td colspan="3">').append(r).appendTo(o), this.bindControl(new l(s, this._linetool.properties().fillBackground, !0, this.model(), "Change Pitchfork Background Visibility")), this.bindControl(new c(r, this._linetool.properties().transparency, !0, this.model(), "Change Pitchfork Background Transparency")), this.bindControl(new l(n, this._linetool.properties().coeffsAsPercents, !0, this.model(), "Change Fib Retracement Coeffs As Percents")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.FloatBinder,
        a = s.SimpleComboBinder,
        l = s.BooleanBinder,
        h = s.ColorBinding,
        c = s.SliderBinder,
        d = i(32).addColorPicker,
        p = i(19).createLineStyleEditor,
        u = i(13).createLineWidthEditor,
        _ = i(46).createTransparencyEditor;
    inherit(o, n), o.prototype.addLevelEditor = function(t, e, i) {
        var o, n, s, _, f, m, g, v, y, b, w = $("<tr>");
        w.appendTo(this._table), o = $("<td>"), o.appendTo(w), n = $("<input type='checkbox' class='visibility-switch'>"), n.appendTo(o), t ? (s = $("<td>"), s.appendTo(w), _ = $("<input type='text'>"), _.appendTo(s), _.css("width", "70px"), this.bindControl(new r(_, e.coeff, !1, this.model(), "Change Pitchfork Line Coeff"))) : $("<td>" + $.t("Trend Line") + "</td>").appendTo(w), f = $("<td class='colorpicker-cell'>"), f.appendTo(w), m = d(f), g = $("<td>"), g.appendTo(w), v = u(), v.appendTo(g), t || (y = $("<td>"), y.appendTo(w), b = p(), b.render().appendTo(y), this.bindControl(new a(b, e.linestyle, parseInt, !0, this.model(), "Change Fib Speed Resistance Arcs Style"))), this.bindControl(new l(n, e.visible, !0, this.model(), "Change Fib Speed Resistance Arcs Visibility")), this.bindControl(new h(m, e.color, !0, this.model(), "Change Fib Speed Resistance Arcs Line Color", 0)), this.bindControl(new c(v, e.linewidth, !0, this.model(), "Change Fib Speed Resistance Arcs Width"))
    }, o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, r;
        for (this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), this.addLevelEditor(null, this._linetool.properties().trendline, !1), t = 1; t <= 11; t++) e = "level" + t, this.addLevelEditor("Level " + t, this._linetool.properties()[e], !1);
        this.addOneColorPropertyWidget(this._table), i = $("<input type='checkbox' class='visibility-switch'>"), o = this.addLabeledRow(this._table, $.t("Levels")), $("<td>").append(i).prependTo(o), this.bindControl(new l(i, this._linetool.properties().showCoeffs, !0, this.model(), "Change Fib Speed Resistance Arcs Levels Visibility")), n = $("<input type='checkbox' class='visibility-switch'>"), o = this.addLabeledRow(this._table, $.t("Full Circles")), $("<td>").append(n).prependTo(o), this.bindControl(new l(n, this._linetool.properties().fullCircles, !0, this.model(), "Change Fib Speed Resistance Arcs Full Cirlces Mode")), o = $("<tr>"), o.appendTo(this._table), s = $("<input type='checkbox' class='visibility-switch'>"), $("<td>").append(s).appendTo(o), $("<td>" + $.t("Background") + "</td>").appendTo(o), r = _(), $('<td colspan="3">').append(r).appendTo(o), this.bindControl(new l(s, this._linetool.properties().fillBackground, !0, this.model(), "Change Fib Arcs Background Visibility")), this.bindControl(new c(r, this._linetool.properties().transparency, !0, this.model(), "Change Fib Arcs Background Transparency")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.BooleanBinder,
        a = s.ColorBinding,
        l = s.FloatBinder,
        h = s.SimpleComboBinder,
        c = s.SliderBinder,
        d = i(32).addColorPicker,
        p = i(19).createLineStyleEditor,
        u = i(13).createLineWidthEditor,
        _ = i(46).createTransparencyEditor;
    inherit(o, n), o.prototype.addLevelEditor = function(t, e, i) {
        var o, n, s, h, c, p, u = $("<tr>");
        u.appendTo(t), o = $("<td>"), o.appendTo(u), n = $("<input type='checkbox' class='visibility-switch'>"), n.appendTo(o), s = $("<td>"), s.appendTo(u), h = $("<input type='text'>"), h.appendTo(s), h.css("width", "70px"), this.bindControl(new r(n, i.visible, !0, this.model(), "Change Gann Square Line Visibility")), this.bindControl(new l(h, i.coeff, !1, this.model(), "Change Pitchfork Line Coeff")), c = $("<td class='colorpicker-cell'>"), c.appendTo(u), p = d(c), this.bindControl(new a(p, i.color, !0, this.model(), "Change Gann Square Line Color", 0))
    }, o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, l, d, f, m, g, v, y, b, w, S, T, C, x, P, L, k, I;
        for (this._table = $(document.createElement("table")), this._table.addClass("property-page property-page-unpadded"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), this._table.css({ width: "100%" }), t = $("<tbody>").appendTo(this._table), e = $("<tr>"), e.appendTo(t), i = $('<td width="50%">'), i.appendTo(e), o = $('<td width="50%">'), o.appendTo(e), n = $('<table cellspacing="0" cellpadding="2">'), n.appendTo(i), n.addClass("property-page"), s = $('<table cellspacing="0" cellpadding="2">'), s.appendTo(o), s.addClass("property-page"), $("<tr><td align='center' colspan='4'>" + $.t("Price Levels") + "</td></tr>").appendTo(n), $("<tr><td align='center' colspan='4'>" + $.t("Time Levels") + "</td></tr>").appendTo(s), l = 1; l <= 7; l++) d = "hlevel" + l, this.addLevelEditor(n, "Level " + l, this._linetool.properties()[d]);
        for (l = 1; l <= 7; l++) d = "vlevel" + l, this.addLevelEditor(s, "Level " + l, this._linetool.properties()[d]);
        this.addOneColorPropertyWidget(n), o.css({ "vertical-align": "top" }), f = $("<input type='checkbox' class='visibility-switch'>"), m = $("<input type='checkbox' class='visibility-switch'>"), g = $("<input type='checkbox' class='visibility-switch'>"), v = $("<input type='checkbox' class='visibility-switch'>"), y = $('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({ width: "100%" }), b = $("<tr>").appendTo(y), w = $('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({ width: "50%" }).appendTo(b)), S = $('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({ width: "50%" }).appendTo(b)), T = this.addLabeledRow(w, $.t("Left Labels"), f), $("<td>").append(f).prependTo(T), T = this.addLabeledRow(S, $.t("Right Labels"), m), $("<td>").append(m).prependTo(T), T = this.addLabeledRow(w, $.t("Top Labels"), g), $("<td>").append(g).prependTo(T), T = this.addLabeledRow(S, $.t("Bottom Labels"), v), $("<td>").append(v).prependTo(T), this.bindControl(new r(f, this._linetool.properties().showLeftLabels, !0, this.model(), "Change Gann Square Left Labels Visibility")), this.bindControl(new r(m, this._linetool.properties().showRightLabels, !0, this.model(), "Change Gann Square Right Labels Visibility")), this.bindControl(new r(g, this._linetool.properties().showTopLabels, !0, this.model(), "Change Gann Square Top Labels Visibility")), this.bindControl(new r(v, this._linetool.properties().showBottomLabels, !0, this.model(), "Change Gann Square Bottom Labels Visibility")), C = $('<table class="property-page" cellspacing="0" cellpadding="2">'), x = u(), P = p(), L = this.createColorPicker(), k = $("<input type='checkbox' class='visibility-switch'>"), T = this.addLabeledRow(C, $.t("Grid"), k), $("<td>").append(k).prependTo(T), $("<td>").append(L).appendTo(T), $("<td>").append(x).appendTo(T), $("<td>").append(P.render()).appendTo(T), this.bindControl(new r(k, this._linetool.properties().grid.visible, !0, this.model(), "Change Fib Speed Resistance Fan Grid Visibility")), this.bindControl(new a(L, this._linetool.properties().grid.color, !0, this.model(), "Change Fib Speed Resistance Fan Grid Line Color", 0)), this.bindControl(new h(P, this._linetool.properties().grid.linestyle, parseInt, !0, this.model(), "Change Fib Speed Resistance Fan Grid Line Style")), this.bindControl(new c(x, this._linetool.properties().grid.linewidth, !0, this.model(), "Change Fib Speed Resistance Fan Grid Line Width")), this._table = this._table.add(y).add(C), T = $("<tr>"), T.appendTo(C), k = $("<input type='checkbox' class='visibility-switch'>"), $("<td>").append(k).appendTo(T), this.createLabeledCell("Background", k).appendTo(T), I = _(), $('<td colspan="3">').append(I).appendTo(T), this.bindControl(new r(k, this._linetool.properties().fillBackground, !0, this.model(), "Change Fib Speed/Resistance Fan Background Visibility")), this.bindControl(new c(I, this._linetool.properties().transparency, !0, this.model(), "Change Fib Speed/Resistance Fan Background Transparency")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) {
        n.call(this, t, e, i), this.prepareLayout()
    }
    var n = i(10),
        s = i(5),
        r = s.SimpleComboBinder,
        a = s.ColorBinding,
        l = s.SliderBinder,
        h = i(19).createLineStyleEditor,
        c = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n;
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">'), t = $("<tbody>").appendTo(this._table), e = c(), i = h(), o = this.createColorPicker(), n = this.addLabeledRow(t, "Line"), $("<td>").append(o).appendTo(n), $("<td>").append(e).appendTo(n), $('<td colspan="3">').append(i.render()).appendTo(n), this.bindControl(new a(o, this._linetool.properties().linecolor, !0, this.model(), "Change Fib Spiral Line Color")), this.bindControl(new r(i, this._linetool.properties().linestyle, parseInt, !0, this.model(), "Change Fib Spiral Line Style")), this.bindControl(new l(e, this._linetool.properties().linewidth, !0, this.model(), "Change Fib Spiral Line Width")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.FloatBinder,
        a = s.BooleanBinder,
        l = s.ColorBinding,
        h = s.SimpleComboBinder,
        c = s.SliderBinder,
        d = i(32).addColorPicker,
        p = i(19).createLineStyleEditor,
        u = i(13).createLineWidthEditor,
        _ = i(46).createTransparencyEditor;
    inherit(o, n), o.prototype.addLevelEditor = function(t, e, i) {
        var o, n, s, _, f, m, g, v, y, b, w = $("<tr>");
        w.appendTo(this._table), o = $("<td>"), o.appendTo(w), n = $("<input type='checkbox' class='visibility-switch'>"), n.appendTo(o), t ? (s = $("<td>"), s.appendTo(w), _ = $("<input type='text'>"), _.appendTo(s), _.css("width", "70px"), this.bindControl(new r(_, e.coeff, !1, this.model(), "Change Pitchfork Line Coeff"))) : this.createLabeledCell($.t("Trend Line"), n).appendTo(w), f = $("<td class='colorpicker-cell'>"), f.appendTo(w), m = d(f), g = $("<td>"), g.appendTo(w), v = u(), v.appendTo(g), y = $("<td>"), y.appendTo(w), b = p(), b.render().appendTo(y), this.bindControl(new a(n, e.visible, !0, this.model(), "Change Pitchfork Line Visibility")), this.bindControl(new l(m, e.color, !0, this.model(), "Change Pitchfork Line Color", 0)), this.bindControl(new h(b, e.linestyle, parseInt, !0, this.model(), "Change Pitchfork Line Style")), this.bindControl(new c(v, e.linewidth, parseInt, this.model(), "Change Pitchfork Line Width"))
    }, o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, r, l, d;
        for (this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = 1; t <= 11; t++) e = "level" + t, this.addLevelEditor("Level " + t, this._linetool.properties()[e], !1);
        this.addOneColorPropertyWidget(this._table), i = $("<input type='checkbox' class='visibility-switch'>"), o = this.addLabeledRow(this._table, $.t("Show Labels"), i), $("<td>").append(i).prependTo(o), n = $("<table cellspacing='0' cellpadding='0'>"), s = $("<select><option value='left'>" + $.t("left") + "</option><option value='center'>" + $.t("center") + "</option><option value='right'>" + $.t("right") + "</option></select>"),
            r = $("<select><option value='top'>" + $.t("top") + "</option><option value='middle'>" + $.t("middle") + "</option><option value='bottom'>" + $.t("bottom") + "</option></select>"), o = $("<tr>"), o.append("<td>" + $.t("Labels") + "</td>").append(s).append("<td>&nbsp</td>").append(r), o.appendTo(n), o = $("<tr>"), $("<td colspan='5'>").append(n).appendTo(o), o.appendTo(this._table), this.bindControl(new h(s, this._linetool.properties().horzLabelsAlign, null, !0, this.model(), "Change Fib Time Zone Labels Alignment")), this.bindControl(new h(r, this._linetool.properties().vertLabelsAlign, null, !0, this.model(), "Change Fib Time Zone Labels Alignment")), o = $("<tr>"), o.appendTo(this._table), l = $("<input type='checkbox' class='visibility-switch'>"), $("<td>").append(l).appendTo(o), this.createLabeledCell($.t("Background"), l).appendTo(o), d = _(), $('<td colspan="3">').append(d).appendTo(o), this.bindControl(new a(i, this._linetool.properties().showLabels, !0, this.model(), "Change Fib Time Zone Labels Visibility")), this.bindControl(new c(d, this._linetool.properties().transparency, !0, this.model(), "Change Fib Retracement Background Transparency")), this.bindControl(new a(l, this._linetool.properties().fillBackground, !0, this.model(), "Change Fib Retracement Background Visibility")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i) }
    var n = i(193);
    inherit(o, n), t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.FloatBinder,
        a = s.BooleanBinder,
        l = s.SliderBinder,
        h = s.SimpleComboBinder,
        c = s.ColorBinding,
        d = i(32).addColorPicker,
        p = i(19).createLineStyleEditor,
        u = i(13).createLineWidthEditor,
        _ = i(46).createTransparencyEditor;
    inherit(o, n), o.prototype.addLevelEditor = function(t, e, i) {
        var o, n, s, _, f, m, g, v, y, b, w = $("<tr>");
        w.appendTo(this._table), o = $("<td>"), o.appendTo(w), n = $("<input type='checkbox' class='visibility-switch'>"), n.appendTo(o), t ? (s = $("<td>"), s.appendTo(w), _ = $("<input type='text'>"), _.appendTo(s), _.css("width", "70px"), this.bindControl(new r(_, e.coeff, !1, this.model(), "Change Pitchfork Line Coeff"))) : this.createLabeledCell($.t("Trend Line"), n).appendTo(w), f = $("<td class='colorpicker-cell'>"), f.appendTo(w), m = d(f), g = $("<td>"), g.appendTo(w), v = u(), v.appendTo(g), y = $("<td>"), y.appendTo(w), b = p(), b.render().appendTo(y), this.bindControl(new a(n, e.visible, !0, this.model(), "Change Pitchfork Line Visibility")), this.bindControl(new c(m, e.color, !0, this.model(), "Change Pitchfork Line Color", 0)), this.bindControl(new h(b, e.linestyle, parseInt, !0, this.model(), "Change Pitchfork Line Style")), this.bindControl(new l(v, e.linewidth, parseInt, this.model(), "Change Pitchfork Line Width"))
    }, o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, r, c, d, p, u;
        for (this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), this.addLevelEditor(null, this._linetool.properties().trendline, !1), t = 1; t <= 11; t++) e = "level" + t,
            this.addLevelEditor($.t("Level {0}").format(t), this._linetool.properties()[e], !1);
        this.addOneColorPropertyWidget(this._table), i = $('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({ width: "100%" }), o = $("<tr>").appendTo(i), $('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({ width: "50%" }).appendTo(o)), $('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({ width: "50%" }).appendTo(o)), n = $("<input type='checkbox' class='visibility-switch'>"), s = this.addLabeledRow(this._table, $.t("Show Labels"), n), $("<td>").append(n).prependTo(s), r = $("<table cellspacing='0' cellpadding='0'>"), c = $("<select><option value='left'>" + $.t("left") + "</option><option value='center'>" + $.t("center") + "</option><option value='right'>" + $.t("right") + "</option></select>"), d = $("<select><option value='top'>" + $.t("top") + "</option><option value='middle'>" + $.t("middle") + "</option><option value='bottom'>" + $.t("bottom") + "</option></select>"), s = $("<tr>"), s.append("<td>" + $.t("Labels") + "</td>").append(c).append("<td>&nbsp</td>").append(d), s.appendTo(r), s = $("<tr>"), $("<td colspan='5'>").append(r).appendTo(s), s.appendTo(this._table), this.bindControl(new h(c, this._linetool.properties().horzLabelsAlign, null, !0, this.model(), "Change Trend-Based Fib Time Labels Alignment")), this.bindControl(new h(d, this._linetool.properties().vertLabelsAlign, null, !0, this.model(), "Change Trend-Based Fib Time Labels Alignment")), s = $("<tr>"), s.appendTo(this._table), p = $("<input type='checkbox' class='visibility-switch'>"), $("<td>").append(p).appendTo(s), this.createLabeledCell($.t("Background"), p).appendTo(s), u = _(), $('<td colspan="3">').append(u).appendTo(s), this.bindControl(new a(p, this._linetool.properties().fillBackground, !0, this.model(), "Change Fib Retracement Background Visibility")), this.bindControl(new l(u, this._linetool.properties().transparency, !0, this.model(), "Change Fib Retracement Background Transparency")), this.bindControl(new a(n, this._linetool.properties().showCoeffs, !0, this.model(), "Change Fib Retracement Extend Lines")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.FloatBinder,
        a = s.BooleanBinder,
        l = s.ColorBinding,
        h = s.SliderBinder,
        c = i(32).addColorPicker,
        d = i(13).createLineWidthEditor,
        p = i(46).createTransparencyEditor;
    inherit(o, n), o.prototype.addLevelEditor = function(t, e, i) {
        var o, n, s, p, u, _, f, m, g = $("<tr>");
        g.appendTo(this._table), o = $("<td>"), o.appendTo(g), n = $("<input type='checkbox' class='visibility-switch'>"), n.appendTo(o), t ? (s = $("<td>"), s.appendTo(g), p = $("<input type='text'>"), p.appendTo(s), p.css("width", "70px"), this.bindControl(new r(p, e.coeff, !1, this.model(), "Change Pitchfork Line Coeff"))) : this.createLabeledCell("Trend Line", n).appendTo(g), u = $("<td class='colorpicker-cell'>"), u.appendTo(g), _ = c(u), f = $("<td>"), f.appendTo(g), m = d(), m.appendTo(f), this.bindControl(new a(n, e.visible, !0, this.model(), "Change Fib Wedge Visibility")),
            this.bindControl(new l(_, e.color, !0, this.model(), "Change Fib Wedge Line Color", 0)), this.bindControl(new h(m, e.linewidth, !0, this.model(), "Change Fib Wedge Width"))
    }, o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s;
        for (this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), this.addLevelEditor(null, this._linetool.properties().trendline, !1), t = 1; t <= 11; t++) e = "level" + t, this.addLevelEditor("Level " + t, this._linetool.properties()[e], !1);
        this.addOneColorPropertyWidget(this._table), i = $("<input type='checkbox' class='visibility-switch'>"), o = this.addLabeledRow(this._table, "Levels", i), $("<td>").append(i).prependTo(o), this.bindControl(new a(i, this._linetool.properties().showCoeffs, !0, this.model(), "Change Fib Wedge Levels Visibility")), o = $("<tr>"), o.appendTo(this._table), n = $("<input type='checkbox' class='visibility-switch'>"), $("<td>").append(n).appendTo(o), this.createLabeledCell("Background", n).appendTo(o), s = p(), $('<td colspan="3">').append(s).appendTo(o), this.bindControl(new a(n, this._linetool.properties().fillBackground, !0, this.model(), "Change Wedge Background Visibility")), this.bindControl(new h(s, this._linetool.properties().transparency, !0, this.model(), "Change Wedge Background Transparency")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.SimpleComboBinder,
        a = s.ColorBinding,
        l = s.BooleanBinder,
        h = s.SliderBinder,
        c = i(19).createLineStyleEditor,
        d = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, p, u, _, f, m, g, v, y, b, w, S, T, C, x, P, L, k, I;
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">'), t = $("<tbody>").appendTo(this._table), e = d(), i = c(), o = this.createColorPicker(), n = this.addLabeledRow(t, $.t("Line")), $("<td>").append(o).appendTo(n), $("<td>").append(e).appendTo(n), $('<td colspan="3">').append(i.render()).appendTo(n), n = this.addLabeledRow(t, $.t("Text")), s = this.createColorPicker(), p = this.createFontSizeEditor(), u = this.createFontEditor(), _ = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'), f = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'), $("<td>").append(s).appendTo(n), $("<td>").append(u).appendTo(n), $("<td>").append(p).appendTo(n), $("<td>").append(_).appendTo(n), $("<td>").append(f).appendTo(n), m = $("<tbody>").appendTo(this._table), g = $('<input type="checkbox" class="visibility-switch">'), v = this.createColorPicker(), n = this.addLabeledRow(m, $.t("Background"), g), y = $("<table>"), $('<td colspan="5">').append(y).appendTo(n), n = $("<tr>").appendTo(y), $("<td>").append(g).appendTo(n), $("<td>").append(v).appendTo(n), b = $("<tbody>").appendTo(this._table), w = $("<label>" + $.t("Extend") + " </label>").css({ "margin-left": "8px" }), S = $('<input type="checkbox">').appendTo(w), T = $("<label>" + $.t("Extend") + " </label>").css({ "margin-left": "8px" }),
            C = $('<input type="checkbox">').appendTo(T), x = $("<select><option value='0'>" + $.t("Normal") + "</option><option value='1'>" + $.t("Arrow") + "</option></select>"), P = $("<select><option value='0'>" + $.t("Normal") + "</option><option value='1'>" + $.t("Arrow") + "</option></select>"), n = this.addLabeledRow(b, $.t("Left End")), $('<td colspan="3">').appendTo(n).append(x).append(w), n = this.addLabeledRow(b, $.t("Right End")), $('<td colspan="3">').appendTo(n).append(P).append(T), L = $("<tbody>").appendTo(this._table), n = $("<tr>").appendTo(L), k = $("<input type='checkbox'>"), I = $("<label style='display:block'>").append(k).append($.t("Show Prices")), $("<td colspan='2'>").append(I).appendTo(n), this.bindControl(new r(p, this._linetool.properties().fontsize, parseInt, !0, this.model(), "Change Text Font Size")), this.bindControl(new r(u, this._linetool.properties().font, null, !0, this.model(), "Change Text Font")), this.bindControl(new a(s, this._linetool.properties().textcolor, !0, this.model(), "Change Text Color")), this.bindControl(new l(_, this._linetool.properties().bold, !0, this.model(), "Change Text Font Bold")), this.bindControl(new l(f, this._linetool.properties().italic, !0, this.model(), "Change Text Font Italic")), this.bindControl(new l(k, this._linetool.properties().showPrices, !0, this.model(), "Change Disjoint Angle Show Prices")), this.bindControl(new l(S, this._linetool.properties().extendLeft, !0, this.model(), "Change Disjoint Angle Extending Left")), this.bindControl(new l(C, this._linetool.properties().extendRight, !0, this.model(), "Change Disjoint Angle Extending Right")), this.bindControl(new a(o, this._linetool.properties().linecolor, !0, this.model(), "Change Disjoint Angle Color")), this.bindControl(new r(i, this._linetool.properties().linestyle, parseInt, !0, this.model(), "Change Disjoint Angle Style")), this.bindControl(new h(e, this._linetool.properties().linewidth, !0, this.model(), "Change Disjoint Angle Width")), this.bindControl(new r(x, this._linetool.properties().leftEnd, parseInt, !0, this.model(), "Change Disjoint Angle Left End")), this.bindControl(new r(P, this._linetool.properties().rightEnd, parseInt, !0, this.model(), "Change Disjoint Angle Right End")), this.bindControl(new l(g, this._linetool.properties().fillBackground, !0, this.model(), "Change Disjoint Angle Filling")), this.bindControl(new a(v, this._linetool.properties().backgroundColor, !0, this.model(), "Change Disjoint Angle Background Color", this._linetool.properties().transparency)), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.BooleanBinder,
        a = s.SliderBinder,
        l = s.ColorBinding,
        h = i(32).addColorPicker,
        c = i(13).createLineWidthEditor,
        d = i(46).createTransparencyEditor;
    inherit(o, n), o.prototype.addOneColorPropertyWidget = function(t) {
        var e = this.createOneColorForAllLinesWidget(),
            i = $("<tr>");
        i.append($("<td>")).append($("<td>")).append(e.editor).append($("<td>").append(e.label)), i.appendTo(t)
    }, o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, p, u, _, f, m, g, v, y, b, w, S, T, C, x, P, L, k, I, A, E, M;
        this._table = $(document.createElement("table")), this._table.addClass("property-page property-page-unpadded"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), this._table.css({ width: "100%" }), t = $("<tr>"), t.appendTo(this._table), e = this._linetool.properties(), i = $("<table>"), $("<td valign='top'>").append(i).appendTo(t), o = $("<tr>"), $("<td colspan='3'>" + $.t("Levels") + "</td>").appendTo(o), o.appendTo(i);
        for (n in e.levels._childs) s = e.levels[n], p = $("<tr>"), p.appendTo(i), $("<td>" + n + "</td>").appendTo(p), u = $("<input type='checkbox' class='visibility-switch'>"), $("<td>").append(u).appendTo(p), _ = $("<td class='colorpicker-cell'>"), _.appendTo(p), f = h(_), m = $("<td>"), m.appendTo(p), g = c(), g.appendTo(m), this.bindControl(new r(u, s.visible, !0, this.model(), "Change Gann Line Visibility")), this.bindControl(new l(f, s.color, !0, this.model(), "Change Gann Line Color", 0)), this.bindControl(new a(g, s.width, !0, this.model(), "Change Gann Line Width"));
        v = $("<table>"), $("<td valign='top'>").append(v).appendTo(t), y = $("<tr>"), $("<td colspan='4'>" + $.t("Fans") + "</td>").appendTo(y), y.appendTo(v);
        for (n in e.fanlines._childs) b = e.fanlines[n], w = $("<tr>"), w.appendTo(v), u = $("<input type='checkbox' class='visibility-switch'>"), $("<td>").append(u).appendTo(w), S = b.x.value() + "x" + b.y.value(), $("<td>" + S + "</td>").appendTo(w), _ = $("<td class='colorpicker-cell'>"), _.appendTo(w), f = h(_), m = $("<td>"), m.appendTo(w), g = c(), g.appendTo(m), this.bindControl(new r(u, b.visible, !0, this.model(), "Change Gann Line Visibility")), this.bindControl(new l(f, b.color, !0, this.model(), "Change Gann Fan Color", 0)), this.bindControl(new a(g, b.width, !0, this.model(), "Change Gann Line Width"));
        T = $("<table>"), $("<td valign='top'>").append(T).appendTo(t), C = $("<tr>"), $("<td colspan='4'>" + $.t("Arcs") + "</td>").appendTo(C), C.appendTo(T);
        for (n in e.arcs._childs) x = e.arcs[n], P = $("<tr>"), P.appendTo(T), u = $("<input type='checkbox' class='visibility-switch'>"), $("<td>").append(u).appendTo(P), S = x.x.value() + "x" + x.y.value(), $("<td>" + S + "</td>").appendTo(P), _ = $("<td class='colorpicker-cell'>"), _.appendTo(P), f = h(_), m = $("<td>"), m.appendTo(P), g = c(), g.appendTo(m), this.bindControl(new r(u, x.visible, !0, this.model(), "Change Gann Line Visibility")), this.bindControl(new l(f, x.color, !0, this.model(), "Change Gann Arc Color", 0)), this.bindControl(new a(g, x.width, !0, this.model(), "Change Gann Line Width"));
        this.addOneColorPropertyWidget(T), L = $("<tbody>").appendTo(this._table), k = $('<input type="checkbox" class="visibility-switch">'), I = d(), A = $("<tr>").appendTo(L), E = $("<table>"), $('<td colspan="3">').append(E).appendTo(A), A = $("<tr>").appendTo(E), $("<td>").append(k).appendTo(A), $("<td>" + $.t("Background") + "</td>").appendTo(A), $("<td>").append(I).appendTo(A), this._linetool.properties().reverse && (M = $("<input type='checkbox' class='visibility-switch'>"), A = this.addLabeledRow(E, $.t("Reverse"), M, !0), $("<td>").append(M).prependTo(A), this.bindControl(new r(M, this._linetool.properties().reverse, !0, this.model(), "Change Gann Square Reverse"))),
            this.bindControl(new r(k, this._linetool.properties().arcsBackground.fillBackground, !0, this.model(), "Change Gann Square Filling")), this.bindControl(new a(I, this._linetool.properties().arcsBackground.transparency, !0, this.model(), "Change Gann Square Background Transparency"))
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.BooleanBinder,
        a = s.ColorBinding,
        l = s.SimpleComboBinder,
        h = s.SliderBinder,
        c = i(32).addColorPicker,
        d = i(19).createLineStyleEditor,
        p = i(13).createLineWidthEditor,
        u = i(46).createTransparencyEditor;
    inherit(o, n), o.prototype.addLevelEditor = function(t, e, i, o) {
        var n, s, u, _, f, m, g, v, y, b, w = $("<tr>");
        w.appendTo(this._tbody), n = "control-level-" + i + "-" + o, s = $("<td>"), s.appendTo(w), u = $("<input type='checkbox' class='visibility-switch' id='" + n + "'>"), u.appendTo(s), _ = this.createLabeledCell(t).appendTo(w), _.find("label").attr("for", n), f = $("<td class='colorpicker-cell'>"), f.appendTo(w), m = c(f), g = $("<td>"), g.appendTo(w), v = p(), v.appendTo(g), y = $("<td>"), y.appendTo(w), b = d(), b.render().appendTo(y), this.bindControl(new r(u, e.visible, !0, this.model(), "Change Gann Fan Line Visibility")), this.bindControl(new a(m, e.color, !0, this.model(), "Change Gann Fan Line Color", 0)), this.bindControl(new l(b, e.linestyle, parseInt, !0, this.model(), "Change Gann Fan Line Style")), this.bindControl(new h(v, e.linewidth, !0, this.model(), "Change Gann Fan Line Width"))
    }, o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, a, l, c, d, p = $('<table class="property-page" cellspacing="0" cellpadding="2">'),
            _ = $('<table class="property-page" cellspacing="0" cellpadding="2">');
        for (this._tbody = $("<tbody>").appendTo(p), t = 1; t <= 9; t++) e = "level" + t, i = this._linetool.properties()[e], o = i.coeff1.value(), n = i.coeff2.value(), s = "<sup>" + o + "</sup>&frasl;<sub>" + n + "</sub>", this.addLevelEditor(s, i, o, n);
        this.addOneColorPropertyWidget(this._tbody), a = $("<input type='checkbox' class='visibility-switch'>"), l = this.addLabeledRow(_, $.t("Labels"), a), $("<td>").append(a).prependTo(l), this.bindControl(new r(a, this._linetool.properties().showLabels, !0, this.model(), "Change Gann Fan Labels Visibility")), this._table = p.add(_), l = $("<tr>"), l.appendTo(this._table), c = $("<input type='checkbox' class='visibility-switch'>"), $("<td>").append(c).appendTo(l), this.createLabeledCell($.t("Background"), c).appendTo(l), d = u(), $('<td colspan="3">').append(d).appendTo(l), this.bindControl(new r(c, this._linetool.properties().fillBackground, !0, this.model(), "Change Pitchfan Background Visibility")), this.bindControl(new h(d, this._linetool.properties().transparency, !0, this.model(), "Change Pitchfan Background Transparency")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.BooleanBinder,
        a = s.FloatBinder,
        l = s.ColorBinding,
        h = s.SliderBinder,
        c = i(32).addColorPicker,
        d = i(46).createTransparencyEditor;
    inherit(o, n), o.prototype.addLevelEditor = function(t, e, i) {
        var o, n, s, h, d, p, u = $("<tr>");
        u.appendTo(t), o = $("<td>"), o.appendTo(u), n = $("<input type='checkbox' class='visibility-switch'>"), n.appendTo(o), s = $("<td>"), s.appendTo(u), h = $("<input type='text'>"), h.appendTo(s), h.css("width", "70px"), this.bindControl(new r(n, i.visible, !0, this.model(), "Change Gann Square Line Visibility")), this.bindControl(new a(h, i.coeff, !1, this.model(), "Change Pitchfork Line Coeff")), d = $("<td class='colorpicker-cell'>"), d.appendTo(u), p = c(d), this.bindControl(new l(p, i.color, !0, this.model(), "Change Gann Square Line Color", 0))
    }, o.prototype.addFannEditor = function(t) {
        var e, i, o = $("<tr>").appendTo(t),
            n = $("<input type='checkbox' class='visibility-switch'>");
        n.appendTo($("<td>").appendTo(o)), $("<td>" + $.t("Angles") + "</td>").appendTo(o), e = $("<td class='colorpicker-cell'>").appendTo(o), i = c(e), this.bindControl(new r(n, this._linetool.properties().fans.visible, !0, this.model(), "Change Gann Square Angles Visibility")), this.bindControl(new l(i, this._linetool.properties().fans.color, !0, this.model(), "Change Gann Square Angles Color", 0))
    }, o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, a, l, c, p, u, _, f, m, g, v, y, b, w, S;
        for (this._table = $(document.createElement("table")), this._table.addClass("property-page property-page-unpadded"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), this._table.css({ width: "100%" }), t = $("<tbody>").appendTo(this._table), e = $("<tr>"), e.appendTo(t), i = $('<td width="50%">'), i.appendTo(e), o = $('<td width="50%">'), o.appendTo(e), n = $('<table cellspacing="0" cellpadding="2">'), n.appendTo(i), n.addClass("property-page"), s = $('<table cellspacing="0" cellpadding="2">'), s.appendTo(o), s.addClass("property-page"), $("<tr><td align='center' colspan='4'>" + $.t("Price Levels") + "</td></tr>").appendTo(n), $("<tr><td align='center' colspan='4'>" + $.t("Time Levels") + "</td></tr>").appendTo(s), a = 1; a <= 7; a++) l = "hlevel" + a, this.addLevelEditor(n, $.t("Level {0}").format(a), this._linetool.properties()[l]);
        for (a = 1; a <= 7; a++) l = "vlevel" + a, this.addLevelEditor(s, $.t("Level {0}").format(a), this._linetool.properties()[l]);
        this.addFannEditor(n), this.addOneColorPropertyWidget(s), o.css({ "vertical-align": "top" }), i.css({ "vertical-align": "top" }), c = $("<input type='checkbox' class='visibility-switch'>"), p = $("<input type='checkbox' class='visibility-switch'>"), u = $("<input type='checkbox' class='visibility-switch'>"), _ = $("<input type='checkbox' class='visibility-switch'>"), f = $('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({ width: "100%" }), m = $("<tr>").appendTo(f), g = $('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({ width: "50%", "vertical-align": "top" }).appendTo(m)), v = $('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({ width: "50%", "vertical-align": "top" }).appendTo(m)), y = this.addLabeledRow(g, $.t("Left Labels"), c), $("<td>").append(c).prependTo(y), y = this.addLabeledRow(v, $.t("Right Labels"), p), $("<td>").append(p).prependTo(y), y = this.addLabeledRow(g, $.t("Top Labels"), u), $("<td>").append(u).prependTo(y),
            y = this.addLabeledRow(v, $.t("Bottom Labels"), _), $("<td>").append(_).prependTo(y), this.bindControl(new r(c, this._linetool.properties().showLeftLabels, !0, this.model(), "Change Gann Square Left Labels Visibility")), this.bindControl(new r(p, this._linetool.properties().showRightLabels, !0, this.model(), "Change Gann Square Right Labels Visibility")), this.bindControl(new r(u, this._linetool.properties().showTopLabels, !0, this.model(), "Change Gann Square Top Labels Visibility")), this.bindControl(new r(_, this._linetool.properties().showBottomLabels, !0, this.model(), "Change Gann Square Bottom Labels Visibility")), this._table = this._table.add(f), y = $("<tr>"), y.appendTo(g), b = $("<input type='checkbox' class='visibility-switch'>"), $("<td>").append(b).appendTo(y), w = d(), $("<td>").append(w).appendTo(y), this.bindControl(new r(b, this._linetool.properties().fillHorzBackground, !0, this.model(), "Change Gann Square Background Visibility")), this.bindControl(new h(w, this._linetool.properties().horzTransparency, !0, this.model(), "Change Gann Square Background Transparency")), y = $("<tr>"), y.appendTo(v), b = $("<input type='checkbox' class='visibility-switch'>"), $("<td>").append(b).appendTo(y), w = d(), $("<td>").append(w).appendTo(y), this.bindControl(new r(b, this._linetool.properties().fillVertBackground, !0, this.model(), "Change Gann Square Background Visibility")), this.bindControl(new h(w, this._linetool.properties().vertTransparency, !0, this.model(), "Change Gann Square Background Transparency")), this._linetool.properties().reverse && (S = $("<input type='checkbox' class='visibility-switch'>"), y = this.addLabeledRow(g, $.t("Reverse"), S), $("<td>").append(S).prependTo(y), this.bindControl(new r(S, this._linetool.properties().reverse, !0, this.model(), "Change Gann Box Reverse"))), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5).ColorBinding;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i;
        this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = this.createColorPicker(), e = this.addLabeledRow(this._table, "Color:"), $("<td>").append(t).appendTo(e), i = this._linetool.properties(), this._div = $("<div>").append(this._table), this.bindControl(new s(t, i.color, !0, this.model(), "Change Icon Color")), this.loadData()
    }, o.prototype.widget = function() { return this._div }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { s.call(this, t, e, i), this.prepareLayout() }
    var n = i(2),
        s = i(10),
        r = i(5),
        a = r.ColorBinding,
        l = r.SimpleComboBinder,
        h = r.SimpleStringBinder,
        c = r.BooleanBinder,
        d = i(72);
    inherit(o, s), o.prototype.prepareLayout = function() {
        var t, e, i, o, n = this.createColorPicker(),
            s = this.createFontSizeEditor(),
            r = this.createFontEditor(),
            d = this.createTextEditor(350, 200),
            p = this.createColorPicker(),
            u = this.createColorPicker(),
            _ = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),
            f = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');
        this.bindControl(new a(n, this._linetool.properties().textColor, !0, this.model(), "Change Text Color")), this.bindControl(new l(s, this._linetool.properties().fontSize, parseInt, !0, this.model(), "Change Text Font Size")), this.bindControl(new l(r, this._linetool.properties().font, null, !0, this.model(), "Change Text Font")), this.bindControl(new h(d, this._linetool.properties().text, null, !0, this.model(), "Change Text")), this.bindControl(new a(p, this._linetool.properties().markerColor, !0, this.model(), "Change Marker and Border Color")), this.bindControl(new a(u, this._linetool.properties().backgroundColor, !0, this.model(), "Change Background Color", this._linetool.properties().backgroundTransparency)), this.bindControl(new c(_, this._linetool.properties().bold, !0, this.model(), "Change Text Font Bold")), this.bindControl(new c(f, this._linetool.properties().italic, !0, this.model(), "Change Text Font Italic")), t = $('<table class="property-page" cellspacing="0" cellpadding="2">'), e = $('<table class="property-page" cellspacing="0" cellpadding="2">'), i = $('<table class="property-page" cellspacing="0" cellpadding="2">'), this._table = t.add(i).add(e), $(document.createElement("tr")).append($(document.createElement("td")).attr({ width: 1 }).append(n)).append($(document.createElement("td")).attr({ width: 1 }).append(r)).append($(document.createElement("td")).attr({ width: 1 }).append(s)).append($(document.createElement("td")).attr({ width: 1 }).append(_)).append($(document.createElement("td")).append(f)).appendTo(t), $(document.createElement("tr")).append($(document.createElement("td")).attr({ colspan: 5 }).append(d)).appendTo(t), o = this.addLabeledRow(i, $.t("Label")), $("<td>").attr("colspan", 2).append(p).appendTo(o), o = this.addLabeledRow(i, $.t("Background")), $("<td>").append(u).appendTo(o), this.loadData(), setTimeout(function() { d.select(), d.focus() }, 20)
    }, o.prototype.widget = function() { return this._table }, o.prototype.dialogPosition = function(t, e) {
        var o, s, r, a, l, h, c, p, u, _, f = i(149).LineToolNote;
        if (t && e) {
            for (o = 0, s = this._linetool._model.paneForSource(this._linetool), r = d.getChartWidget(); o < r.paneWidgets().length; o++)
                if (r.paneWidgets()[o]._state === s) { a = $(r.paneWidgets()[o].canvas).offset().left; break }
            return l = (this._linetool.paneViews() || [])[0], h = new n.Point(0, 0), l && (h = l._floatPoints[0] || this._linetool._fixedPoints[0] || h), c = (a || 0) + h.x, p = f.TOOLTIP_WIDTH, u = c - p / 2, _ = e.outerWidth(), t.left < u && t.left + _ + 10 > u ? (t.left -= t.left + _ + 10 - u, t) : t.left > u && t.left < u + p + 10 ? (t.left += u + p + 10 - t.left, t) : void 0
        }
    }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.BooleanBinder,
        a = s.ColorBinding,
        l = s.SimpleComboBinder,
        h = s.SliderBinder,
        c = i(19).createLineStyleEditor,
        d = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, p, u, _, f, m, g, v, y, b, w, S;
        this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = $("<tbody>").appendTo(this._table), e = d(), i = c(), o = this.createColorPicker(), n = $("<tr>").appendTo(t), $("<td></td><td>" + $.t("Channel") + "</td>").appendTo(n), $("<td>").append(o).appendTo(n), $("<td>").append(e).appendTo(n), $("<td>").append(i.render()).appendTo(n), n = $("<tr>").appendTo(t), s = $("<td>").appendTo(n), p = $("<input type='checkbox' class='visibility-switch'>"), p.appendTo(s), this.createLabeledCell("Middle", p).appendTo(n), u = d(), _ = c(), f = this.createColorPicker(), $("<td>").append(f).appendTo(n), $("<td>").append(u).appendTo(n), $("<td>").append(_.render()).appendTo(n), n = $("<tr>").appendTo(t), m = $("<td>").appendTo(n), g = $("<input type='checkbox' class='visibility-switch'>"), g.appendTo(m), this.createLabeledCell("Background", g).appendTo(n), v = this.createColorPicker(), $("<td>").append(v).appendTo(n), y = $("<tbody>").appendTo(this._table), b = this.addEditorRow(y, "Extend Left", $("<input type='checkbox'>"), 2), w = this.addEditorRow(y, "Extend Right", $("<input type='checkbox'>"), 2), S = this._linetool.properties(), this.bindControl(new r(g, S.fillBackground, !0, this.model(), "Change Parallel Channel Fill Background")), this.bindControl(new r(p, S.showMidline, !0, this.model(), "Change Parallel Channel Show Center Line")), this.bindControl(new r(b, S.extendLeft, !0, this.model(), "Change Parallel Channel Extending Left")), this.bindControl(new r(w, S.extendRight, !0, this.model(), "Change Parallel Channel Extending Right")), this.bindControl(new a(o, S.linecolor, !0, this.model(), "Change Parallel Channel Color")), this.bindControl(new l(i, S.linestyle, parseInt, !0, this.model(), "Change Parallel Channel Style")), this.bindControl(new h(e, S.linewidth, !0, this.model(), "Change Parallel Channel Width")), this.bindControl(new a(f, S.midlinecolor, !0, this.model(), "Change Parallel Channel Middle Color")), this.bindControl(new l(_, S.midlinestyle, parseInt, !0, this.model(), "Change Parallel Channel Middle Style")), this.bindControl(new h(u, S.midlinewidth, !0, this.model(), "Change Parallel Channel Middle Width")), this.bindControl(new a(v, S.backgroundColor, !0, this.model(), "Change Parallel Channel Back Color", S.transparency)), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.BooleanBinder,
        a = s.FloatBinder,
        l = s.ColorBinding,
        h = s.SimpleComboBinder,
        c = s.SliderBinder,
        d = i(32).addColorPicker,
        p = i(19).createLineStyleEditor,
        u = i(13).createLineWidthEditor,
        _ = i(46).createTransparencyEditor;
    inherit(o, n), o.prototype.addLevelEditor = function(t, e, i) {
        var o, n, s, _, f, m, g, v, y, b, w = $("<tr>");
        w.appendTo(this._table), t ? (o = $("<td>"), o.appendTo(w),
            n = $("<input type='checkbox' class='visibility-switch'>"), n.appendTo(o), s = $("<td>"), s.appendTo(w), _ = $("<input type='text'>"), _.appendTo(s), _.css("width", "70px"), this.bindControl(new r(n, e.visible, !0, this.model(), "Change Pitchfork Line Visibility")), this.bindControl(new a(_, e.coeff, !1, this.model(), "Change Pitchfork Line Coeff"))) : $("<td colspan='2'>" + $.t("Median") + "</td>").appendTo(w), f = $("<td class='colorpicker-cell'>"), f.appendTo(w), m = d(f), g = $("<td>"), g.appendTo(w), v = u(), v.appendTo(g), y = $("<td>"), y.appendTo(w), b = p(), b.render().appendTo(y), this.bindControl(new l(m, e.color, !0, this.model(), "Change Pitchfork Line Color"), 0), this.bindControl(new h(b, e.linestyle, parseInt, !0, this.model(), "Change Pitchfan Line Style")), this.bindControl(new c(v, e.linewidth, !0, this.model(), "Change Pitchfan Line Width"))
    }, o.prototype.prepareLayout = function() {
        var t, e, i, o, n;
        for (this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), this.addLevelEditor(null, this._linetool.properties().median, !1), t = 0; t <= 8; t++) e = "level" + t, this.addLevelEditor($.t("Level {0}").format(t + 1), this._linetool.properties()[e], !1);
        this.addOneColorPropertyWidget(this._table), i = $("<tr>"), i.appendTo(this._table), o = $("<input type='checkbox' class='visibility-switch'>"), $("<td>").append(o).appendTo(i), this.createLabeledCell($.t("Background"), o).appendTo(i), n = _(), $('<td colspan="3">').append(n).appendTo(i), this.bindControl(new r(o, this._linetool.properties().fillBackground, !0, this.model(), "Change Pitchfan Background Visibility")), this.bindControl(new c(n, this._linetool.properties().transparency, !0, this.model(), "Change Pitchfan Background Transparency")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.BooleanBinder,
        a = s.FloatBinder,
        l = s.ColorBinding,
        h = s.SimpleComboBinder,
        c = s.SliderBinder,
        d = i(32).addColorPicker,
        p = i(19).createLineStyleEditor,
        u = i(13).createLineWidthEditor,
        _ = i(46).createTransparencyEditor;
    inherit(o, n), o.prototype.onResoreDefaults = function() { this._linetool.properties().style.listeners().fire(this._linetool.properties().style) }, o.prototype.addLevelEditor = function(t, e, i) {
        var o, n, s, _, f, m, g, v, y, b, w = $("<tr>");
        w.appendTo(this._table), t ? (o = $("<td>"), o.appendTo(w), n = $("<input type='checkbox' class='visibility-switch'>"), n.appendTo(o), s = $("<td>"), s.appendTo(w), _ = $("<input type='text'>"), _.appendTo(s), _.css("width", "70px"), this.bindControl(new r(n, e.visible, !0, this.model(), "Change Pitchfork Line Visibility")), this.bindControl(new a(_, e.coeff, !1, this.model(), "Change Pitchfork Line Coeff"))) : ($("<td></td>").appendTo(w), $("<td>" + $.t("Median") + "</td>").appendTo(w)), f = $("<td class='colorpicker-cell'>"), f.appendTo(w), m = d(f), g = $("<td>"), g.appendTo(w), v = u(), v.appendTo(g), y = $("<td>"), y.appendTo(w), b = p(), b.render().appendTo(y), this.bindControl(new l(m, e.color, !0, this.model(), "Change Pitchfork Line Color", 0)),
            this.bindControl(new h(b, e.linestyle, parseInt, !0, this.model(), "Change Pitchfork Line Style")), this.bindControl(new c(v, e.linewidth, !0, this.model(), "Change Pitchfork Line Width"))
    }, o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s;
        for (this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), this.addLevelEditor(null, this._linetool.properties().median, !1), t = 0; t <= 8; t++) e = "level" + t, this.addLevelEditor($.t("Level {0}").format(t + 1), this._linetool.properties()[e], !1);
        this.addOneColorPropertyWidget(this._table), i = $("<tr>"), i.appendTo(this._table), o = $("<input type='checkbox' class='visibility-switch'>"), $("<td>").append(o).appendTo(i), this.createLabeledCell("Background", o).appendTo(i), n = _(), $('<td colspan="3">').append(n).appendTo(i), s = $("<select><option value='0'>" + $.t("Original") + "</option><option value='3'>" + $.t("Schiff") + "</option><option value='1'>" + $.t("Modified Schiff") + "</option><option value='2'>" + $.t("Inside") + "</option></select>"), i = $("<tr>"), i.appendTo(this._table), $("<td>" + $.t("Style") + "</td>").appendTo(i), $("<td>").append(s).appendTo(i), this.bindControl(new h(s, this._linetool.properties().style, parseInt, !0, this.model(), "Change Pitchfork Style")), this.bindControl(new r(o, this._linetool.properties().fillBackground, !0, this.model(), "Change Pitchfork Background Visibility")), this.bindControl(new c(n, this._linetool.properties().transparency, !0, this.model(), "Change Pitchfork Background Transparency")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.BooleanBinder,
        a = s.ColorBinding,
        l = s.SliderBinder,
        h = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n;
        this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = h(), e = this.createColorPicker(), i = this.addLabeledRow(this._table, "Border"), i.prepend("<td>"), $("<td>").append(e).appendTo(i), $("<td>").append(t).appendTo(i), o = $('<input type="checkbox" class="visibility-switch">'), n = this.createColorPicker(), i = this.addLabeledRow(this._table, "Background", o), $("<td>").append(o).prependTo(i), $("<td>").append(n).appendTo(i), this.bindControl(new r(o, this._linetool.properties().fillBackground, !0, this.model(), "Change Polyline Filling")), this.bindControl(new a(e, this._linetool.properties().linecolor, !0, this.model(), "Change Polyline Line Color")), this.bindControl(new a(n, this._linetool.properties().backgroundColor, !0, this.model(), "Change Polyline Background Color", this._linetool.properties().transparency)), this.bindControl(new l(t, this._linetool.properties().linewidth, !0, this.model(), "Change Polyline Border Width")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.ColorBinding,
        a = s.SliderBinder,
        l = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, h, c, d, p, u, _, f, m, g, v, y, b, w = $('<table class="property-page" cellspacing="0" cellpadding="2">'),
            S = $('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({ width: "100%" }),
            T = $('<table class="property-page" cellspacing="0" cellpadding="2">');
        this._table = w.add(S).add(T), t = this.createColorPicker(), e = l(), i = this.addLabeledRow(w, "Line"), $("<td>").append(t).appendTo(i), $("<td>").append(e).appendTo(i), o = $("<tr>").appendTo(S), n = $("<td>").appendTo(o).css({ "vertical-align": "top", width: "50%" }), s = $("<td>").appendTo(o).css({ "vertical-align": "top", width: "50%" }), h = $('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo(n), c = $('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo(s), d = this.addColorPickerRow(h, $.t("Source back color")), p = this.addColorPickerRow(h, $.t("Source text color")), u = this.addColorPickerRow(h, $.t("Source border color")), _ = this.addColorPickerRow(h, $.t("Success back color")), f = this.addColorPickerRow(h, $.t("Success text color")), m = this.addColorPickerRow(c, $.t("Target back color")), g = this.addColorPickerRow(c, $.t("Target text color")), v = this.addColorPickerRow(c, $.t("Target border color")), y = this.addColorPickerRow(c, $.t("Failure back color")), b = this.addColorPickerRow(c, $.t("Failure text color")), this.bindControl(new r(t, this._linetool.properties().linecolor, !0, this.model(), "Forecast Line Color")), this.bindControl(new a(e, this._linetool.properties().linewidth, !0, this.model(), "Forecast Line Width")), this.bindControl(new r(t, this._linetool.properties().linecolor, !0, this.model(), "Forecast Line Color")), this.bindControl(new a(e, this._linetool.properties().linewidth, !0, this.model(), "Forecast Line Width")), this.bindControl(new r(d, this._linetool.properties().sourceBackColor, !0, this.model(), "Forecast Source Background Color", this._linetool.properties().transparency)), this.bindControl(new r(u, this._linetool.properties().sourceStrokeColor, !0, this.model(), "Forecast Source Border Color")), this.bindControl(new r(p, this._linetool.properties().sourceTextColor, !0, this.model(), "Forecast Source Text Color")), this.bindControl(new r(m, this._linetool.properties().targetBackColor, !0, this.model(), "Forecast Target Background Color")), this.bindControl(new r(v, this._linetool.properties().targetStrokeColor, !0, this.model(), "Forecast Target Border Color")), this.bindControl(new r(g, this._linetool.properties().targetTextColor, !0, this.model(), "Forecast Target Text Color")), this.bindControl(new r(_, this._linetool.properties().successBackground, !0, this.model(), "Forecast Success Back Color")), this.bindControl(new r(f, this._linetool.properties().successTextColor, !0, this.model(), "Forecast Success Text Color")), this.bindControl(new r(y, this._linetool.properties().failureBackground, !0, this.model(), "Forecast Failure Back Color")),
            this.bindControl(new r(b, this._linetool.properties().failureTextColor, !0, this.model(), "Forecast Failure Text Color")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.SimpleComboBinder,
        a = s.ColorBinding;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n;
        this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = this.createColorPicker(), e = this.createFontSizeEditor(), i = this.createColorPicker(), o = this.createColorPicker(), n = this.addLabeledRow(this._table, $.t("Text")), $("<td>").append(t).appendTo(n), $("<td>").append(e).appendTo(n), n = this.addLabeledRow(this._table, $.t("Background")), $("<td>").append(i).appendTo(n), n = this.addLabeledRow(this._table, $.t("Border")), $("<td>").append(o).appendTo(n), this.bindControl(new a(t, this._linetool.properties().color, !0, this.model(), "Change Price Text Color")), this.bindControl(new r(e, this._linetool.properties().fontsize, parseInt, !0, this.model(), "Change Price Text Font Size")), this.bindControl(new a(i, this._linetool.properties().backgroundColor, !0, this.model(), "Change Background Color", this._linetool.properties().transparency)), this.bindControl(new a(o, this._linetool.properties().borderColor, !0, this.model(), "Change Border Color")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.SliderBinder,
        a = s.ColorBinding,
        l = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n;
        this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = this.createColorPicker(), e = this.createColorPicker(), i = this.addLabeledRow(this._table, "Background"), $("<td>").append(t).appendTo(i), $("<td>").append(e).appendTo(i), o = l(), n = this.createColorPicker(), i = this.addLabeledRow(this._table, "Border"), $("<td>").append(n).appendTo(i), $("<td>").appendTo(i), $("<td>").append(o).appendTo(i), this.bindControl(new a(n, this._linetool.properties().trendline.color, !0, this.model(), "Change Projection Line Color")), this.bindControl(new a(t, this._linetool.properties().color1, !0, this.model(), "Change Projection Background Color", this._linetool.properties().transparency)), this.bindControl(new a(e, this._linetool.properties().color2, !0, this.model(), "Change Projection Background Color", this._linetool.properties().transparency)), this.bindControl(new r(o, this._linetool.properties().linewidth, !0, this.model(), "Change Projection Border Width")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    (function(e, o) {
        "use strict";

        function n(t) {
            this._chartWidgetCollection = t, this._bindings = [], this._hasAlertWathcedValue = null, this._$templatesButton = null, this._currentProperties = null, this._toolbarWidgets = [],
                this._clearProeprtiesOnHideTimeoutId = null, this._init(), this.attachHandlers()
        }

        function s(t, e) { t.push({ id: e, widget: $('<div class="tv-linetool-properties-toolbar__text">' + e + "</div>")[0] }) }

        function r(t, e) { t.push({ id: e.value, widget: $(e.iconSvgCode)[0] }) }

        function a(t, e) { return $("<div>").addClass("tv-linetool-properties-toolbar__icon").addClass(e).append(t)[0] }

        function l(t) { return a(t, "tv-linetool-properties-toolbar__icon--line-props") }
        var h, c, d, p, u, _, f, m, g, v, y, b, w, S, T, C = i(5),
            x = C.PropertyPage,
            P = C.ColorBinding,
            L = i(102).BarsMarksContainer,
            k = i(1).LineDataSource,
            I = i(42),
            A = i(295),
            E = i(63).bindPopupMenu,
            M = i(7).DefaultProperty,
            D = i(734).GroupButtonFloatingToolbar,
            O = i(76);
        i(137), i(503), n.prototype.activeChartWidget = function() { return this._chartWidgetCollection.activeChartWidget.value() }, n.prototype.selectedSource = function() { return this._chartWidgetCollection.selectedSource.value() }, n.prototype._init = function() { this._floatingToolbar = new D({ addClass: "tv-linetool-properties-toolbar", defaultPosition: { top: window.headerChartPanel.outerHeight() + 15, left: window.innerWidth / 2 }, positionSettingsKey: "properties_toolbar.position" }), this._floatingToolbar.onWidgetStateChanged().subscribe(this, this._onPropertyChangedInToolbar), this._sourceActions = this._createSourceActions(), this._sourceActions.forEach(function(t) { this._floatingToolbar.addWidget(t.button) }, this) }, n.prototype._bindPopupMenuDirection = function() { return this._floatingToolbar.isVertical() ? "right" : "down" }, n.prototype._onPropertyChangedInToolbar = function(t, e) { this._currentProperties && this.activeChartWidget().model().setProperty(this._currentProperties[t], e) }, n.prototype._onPropertyChanged = function(t, e) { this._floatingToolbar.setGroupedWidgetState(t, e.value()) }, n.prototype._hideAllSourceActions = function() { this._sourceActions.forEach(function(t) { this._floatingToolbar.hideWidget(t.button) }, this), this._sourceActionsVisible = !1 }, n.prototype._updateSourceActionsVisibility = function(t) { this._sourceActionsVisible = !1, this._sourceActions.forEach(function(e) {!e.isVisibleForSource || e.isVisibleForSource(t) ? (this._floatingToolbar.showWidget(e.button), this._sourceActionsVisible = !0) : this._floatingToolbar.hideWidget(e.button) }, this) }, n.prototype.attachHandlers = function() { I.tool.subscribe(this.onToolChanged.bind(this), { callWithLast: !0 }), this._chartWidgetCollection.selectedSource.subscribe(this.onSourceChanged.bind(this)) }, n.prototype.onToolChanged = function(t, e) {
                if (t && -1 !== t.toLowerCase().indexOf("linetool")) {
                    var e = e instanceof M ? e : new M(t.toLowerCase());
                    this._hideAllSourceActions(), this.showPropertiesOf(t, e), this.showTemplatesOf({ tool: t, properties: e }), this._updateVisibility()
                } else this.selectedSource() ? this.onSourceChanged(this.selectedSource()) : this.hide()
            }, n.prototype.findSourceOnWidget = function(t) {
                var e, i, o, n;
                for (e = 0; e < this.activeChartWidget().model().panes().length; e++)
                    for (i = this.activeChartWidget().model().panes()[e], o = i.orderedSources(), n = 0; n < o.length; n++)
                        if (o[n] === t) return o[n]
            }, n.prototype.onSourceChanged = function(t) {
                if (this._hasAlertWathcedValue && (this._hasAlertWathcedValue.destroy(),
                        this._hasAlertWathcedValue = null), !t) return void this.hide();
                t instanceof k && !(t instanceof L) && this.findSourceOnWidget(t) ? (!t.userEditEnabled() || "LineToolBrush" !== t.toolname && this.activeChartWidget().model().lineBeingCreated() ? this._hideAllSourceActions() : (this._updateSourceActionsVisibility(t), t.canHasAlert() && (this._hasAlertWathcedValue = t.hasAlert.spawn(), this._hasAlertWathcedValue.subscribe(this._updateSourceActionsVisibility.bind(this, t)))), this.showPropertiesOf(t.getConstructor(), t.properties()), this.showTemplatesOf({ source: t }), this._setupToggleLockButton(t), this._updateVisibility()) : this.hide()
            }, n.prototype.showTemplatesOf = function(t) {
                var o, n, s, r, a;
                e.enabled("line_tool_templates") && (o = t.source, o ? (n = o.getConstructor(), s = o.properties()) : (n = t.tool, s = t.properties), this._$templatesButton && (this._floatingToolbar.removeWidget(this._$templatesButton[0]), this._$templatesButton = null), r = this, a = function(t) { o ? (o.restoreTemplate(t), r.activeChartWidget().model().model().updateSource(this._linetool), r.onSourceChanged(o)) : (s.merge(t), s.listeners().fire(this), s.saveDefaults(), r.onToolChanged(n, s)) }, TradingView.onWidget() && !window.is_authenticated || !e.enabled("linetoolpropertieswidget_template_button") || (this._templatesList = new A(n, a, { buttonInner: '<div class="tv-linetool-properties-toolbar__icon">' + i(897) + '</div><span class="tv-caret tv-caret--small tv-caret--colored tv-linetool-properties-toolbar__caret"></span>', buttonClass: "tv-linetool-properties-toolbar__button apply-common-tooltip", defaultsCallback: function() { s.restoreFactoryDefaults(), r.showPropertiesOf(n, s) }, saveAsText: $.t("Save Drawing Template As..."), applyDefaultText: $.t("Apply Default Drawing Template"), getDataForSaveAs: o ? function() { return o.template() } : null, popupActiveClass: "i-dropped", popupDirection: this._bindPopupMenuDirection.bind(this) }), this._$templatesButton = this._templatesList.createButton().attr("title", $.t("Templates")), this._floatingToolbar.addWidget(this._$templatesButton[0], { index: 0 })), this._templatesVisible = !0)
            }, n.prototype.templatesList = function() { return this._templatesList }, n.prototype._createButton = function(t) { var e, i, o; return t = t || {}, e = document.createElement("div"), e.setAttribute("title", t.title), e.className += "tv-linetool-properties-toolbar__button apply-common-tooltip", e.addEventListener("click", t.callback), t.svgIcon && (i = document.createElement("div"), i.classList.add("tv-linetool-properties-toolbar__icon"), i.appendChild(t.svgIcon), e.appendChild(i)), t.addCaret && (o = document.createElement("div"), o.className = "tv-caret tv-caret--small tv-caret--colored tv-linetool-properties-toolbar__caret", e.appendChild(o)), e }, n.prototype._createSettingsButton = function() { var t = this; return this._createButton({ title: $.t("Settings"), callback: function() { new O(t.selectedSource(), t.activeChartWidget().model()).show({ onWidget: t.activeChartWidget()._options.onWidget }) }, svgIcon: $(i(849))[0] }) }, n.prototype._createZOrderButton = function() {
                var t = this._createButton({
                    title: $.t("Visual Order"),
                    callback: function() {
                        t.classList.contains("i-dropped") || $(t).trigger("button-popup", [this._getZOrderActions()])
                    }.bind(this),
                    svgIcon: $(i(883))[0],
                    addCaret: !0
                });
                return E($(t), null, { direction: this._bindPopupMenuDirection.bind(this), event: "button-popup", reverse: !1, notCloseOnButtons: !0, activeClass: "i-dropped" }), t
            }, n.prototype._createCloneButton = function() { var t, o = $.t("Clone"); return e.enabled("datasource_copypaste") && (o += ", " + $.t("Copy")), e.enabled("support_multicharts") && (o += ", " + $.t("Sync")), t = this._createButton({ title: o, callback: function() { t.classList.contains("i-dropped") || $(t).trigger("button-popup", [this._getCloneActions()]) }.bind(this), svgIcon: $(i(882))[0], addCaret: !0 }), E($(t), null, { direction: this._bindPopupMenuDirection.bind(this), event: "button-popup", reverse: !1, notCloseOnButtons: !0, activeClass: "i-dropped" }), t }, n.prototype._createLockButton = function() { var t = this._createButton({ title: $.t("Lock"), callback: function() { this.activeChartWidget().toggleLockSelectedObject() }.bind(this), svgIcon: $(i(377))[0] }); return this._lockChangeListener = function(e) { t.classList.toggle("i-active", !!e.value()) }, t }, n.prototype._createHideButton = function() { return this._createButton({ title: $.t("Hide"), callback: function() { this.activeChartWidget().hideSelectedObject() }.bind(this), svgIcon: $(i(884))[0] }) }, n.prototype._createRemoveButton = function() { return this._createButton({ title: $.t("Remove"), callback: function() { this.activeChartWidget().removeSelectedSource() }.bind(this), svgIcon: $(i(898))[0] }) }, n.prototype._createSourceActions = function() { var t = []; return e.enabled("property_pages") && t.push({ button: this._createSettingsButton() }), t.push({ button: this._createZOrderButton() }, { button: this._createCloneButton(), isVisibleForSource: function(t) { var e = TradingView.className(t.constructor); return !this.activeChartWidget().model().model().isSingleInstanceLineTool(e) }.bind(this) }, { button: this._createLockButton() }, { button: this._createHideButton() }, { button: this._createRemoveButton() }), t }, n.prototype._getCloneActions = function() {
                var t = this.activeChartWidget().model(),
                    i = this.selectedSource(),
                    o = [];
                return i.properties().clonable.value() && o.push({ title: $.t("Clone"), action: function() { t.cloneLineTool(i) } }), e.enabled("datasource_copypaste") ? (o.push({ title: $.t("Copy"), shortcut: "Ctrl-C", action: function() { t.copySourceToClip(i) } }), e.enabled("support_multicharts") ? (i.linkKey ? o.push({ title: $.t("Stop syncing"), action: function() { t.unlinkLine(i) } }) : o.push({ title: $.t("Sync to all charts"), action: function() { t.copyToOtherCharts(i) } }), o) : o) : o
            }, n.prototype._getZOrderActions = function() {
                var t = [],
                    e = this.selectedSource(),
                    i = this.activeChartWidget().model(),
                    o = { title: $.t("Bring to Front"), action: function() { i.bringToFront(e) } },
                    n = { title: $.t("Send to Back"), action: function() { i.sendToBack(e) } },
                    s = { title: $.t("Bring Forward"), action: function() { i.changeZOrder(e, 1) } },
                    r = { title: $.t("Send Backward"), action: function() { i.changeZOrder(e, -1) } },
                    a = i.paneForSource(this.selectedSource()),
                    l = a.getZOrderMinMax();
                return e.zorder() === l.minZOrder && (n.disabled = !0, r.disabled = !0), e.zorder() === l.maxZOrder && (s.disabled = !0, o.disabled = !0),
                    t.push(o, n, s, r), t
            }, n.prototype._getPossibleProperty = function(t) {
                var e, i, o = [],
                    s = this._defaultToolProperties();
                for (e = 0; e < s.length; e++) i = s[e], i.name in t && o.push(i);
                return t.extendLeft || (o = o.map(function(t) { return "leftEnd" === t.name && (t.comboboxOptions = t.comboboxOptions.filter(function(t) { return t.value !== n.LINE_EXTEND })), t })), t.extendRight || (o = o.map(function(t) { return "rightEnd" === t.name && (t.comboboxOptions = t.comboboxOptions.filter(function(t) { return t.value !== n.LINE_EXTEND })), t })), o
            }, n.prototype.showPropertiesOf = function(t, e) {
                var i, o, n, a, l, h, c, d;
                if (this._toolExceptionCases || (this._toolExceptionCases = this._createToolExceptionCases()), i = this._toolExceptionCases[t] || this._getPossibleProperty(e), this._clearProperties(), this._propertiesVisible = !1, i.length) {
                    for (o = {}, n = i.length - 1; n >= 0; --n)
                        if (a = i[n], l = e[a.name], "function" != typeof(h = a.showIf) || h(l, e)) {
                            if (!l) continue;
                            if (this._propertiesVisible = !0, c = [], "combobox" !== a.inputType) { d = this.colorPropertyControl(l, a, e), this._floatingToolbar.addWidget(d[0], { index: this._$templatesButton ? 1 : 0 }), this._toolbarWidgets.push(d[0]); continue }
                            a.simple ? a.comboboxOptions.forEach(s.bind(null, c)) : a.comboboxOptions.forEach(r.bind(null, c)), a.propertyProxy && (l = a.propertyProxy(e, this.activeChartWidget().model())), o[a.name] = l, l.subscribe(this, this._onPropertyChanged.bind(this, a.name, l)), this._floatingToolbar.addGroupedWidget({ id: a.name, currentStateId: l.value(), stateWidgetAddClass: "tv-linetool-properties-toolbar__sub-widget", states: c, widgetAddClass: "tv-linetool-properties-toolbar__grouped-button", tooltip: a.title }, { index: this._$templatesButton ? 1 : 0 })
                        }
                    this._currentProperties = o
                }
            }, n.prototype._updateVisibility = function() { this._propertiesVisible || this._sourceActionsVisible || this._templatesVisible ? this._show() : this.hide() }, n.prototype._clearProperties = function() { this._currentProperties && (this._clearProeprtiesOnHideTimeoutId && (clearTimeout(this._clearProeprtiesOnHideTimeoutId), this._clearProeprtiesOnHideTimeoutId = null), Object.keys(this._currentProperties).forEach(function(t) { this._currentProperties[t].unsubscribeAll(this), this._floatingToolbar.removeGroupedWidget(t) }, this), this._currentProperties = null, this._toolbarWidgets.forEach(function(t) { this._floatingToolbar.removeWidget(t) }, this), this._toolbarWidgets = [], this.clearBindings()) }, n.prototype.hide = function() { this._floatingToolbar.hide(), this._clearProeprtiesOnHideTimeoutId = setTimeout(this._clearProperties.bind(this), this._floatingToolbar.hideDuration()) }, n.prototype._show = function() { this._floatingToolbar.show() }, n.prototype.refresh = function() { this.onSourceChanged(this.selectedSource()) }, n.prototype._setupToggleLockButton = function(t) { t !== this._selectedSourceBk && (this._selectedSourceBk && this._selectedSourceBk.properties().frozen && this._selectedSourceBk.properties().frozen.unsubscribe(this, this._lockChangeListener), t && t.properties().frozen && (t.properties().frozen.subscribe(this, this._lockChangeListener), this._lockChangeListener(t.properties().frozen)), this._selectedSourceBk = t) }, n.prototype.bindControl = function(t) { this._bindings.push(t) },
            n.prototype.clearBindings = function(t) {
                for (var e = this._bindings.length; e--;) this._bindings[e].destroy();
                this._bindings.length = 0
            }, n.prototype.colorPropertyControl = function(t, e, i) { var o, s, r = x.prototype.createColorPicker({ addClass: "tv-linetool-properties-toolbar__color-picker apply-common-tooltip", direction: this._bindPopupMenuDirection.bind(this) }); return r.attr("title", e.title), o = r.find("input"), s = $(e.iconSvgCode), s.on("click", function(t) { o.data("tvcolorpicker") || o.focus() }), $(document).on("click", function(t) { o.data("tvcolorpicker") ? o.addClass("i-active") : o.removeClass("i-active") }), o.after(s), this.bindControl(new P(r, t, !0, this.activeChartWidget().model(), null, n.getTransparency(e, i))), "string" == typeof e.addClass && r.addClass(e.addClass), r }, n.getTransparency = function(t, e) { if (t.transparency) return t.transparencyField ? e[t.transparencyField].value() : e.transparency.value() }, n.prototype.createLineEndPropertyProxy = function(t, e) {
                return function(i, s) {
                    var r, a;
                    return r = i[e] && i[e].value() ? n.LINE_EXTEND : i[t].value(), a = new o(r), a.subscribe(this, function(o) {
                        var n = o.value();
                        n < 2 ? (s.beginUndoMacro(""), i[t].setValue(n), i[e] && i[e].setValue(!1), s.endUndoMacro()) : (s.beginUndoMacro(""), i[t].setValue(k.LINEEND_NORMAL), i[e] && i[e].setValue(!0), s.endUndoMacro())
                    }), a
                }
            }, n.LINE_EXTEND = 42, h = l(i(877)), c = l(i(878)), d = l(i(879)), p = l(i(880)), u = l(i(870)), _ = l(i(869)), f = l(i(873)), m = l(i(871)), g = l(i(872)), v = l(i(876)), y = l(i(874)), b = l(i(875)), w = i(888), S = i(845), T = i(855), n.prototype._defaultToolProperties = function() { return [{ name: "color", inputType: "colorPicker", iconSvgCode: w, title: $.t("Color") }, { name: "linecolor", inputType: "colorPicker", iconSvgCode: w, title: $.t("Color") }, { name: "backgroundColor", inputType: "colorPicker", iconSvgCode: S, title: $.t("Background Color"), transparency: !0 }, { name: "linewidth", inputType: "combobox", comboboxOptions: [{ value: 1, iconSvgCode: h }, { value: 2, iconSvgCode: c }, { value: 3, iconSvgCode: d }, { value: 4, iconSvgCode: p }], title: $.t("Width") }, { name: "linestyle", title: $.t("Style"), inputType: "combobox", comboboxOptions: [{ value: 0, iconSvgCode: h }, { value: 1, iconSvgCode: u }, { value: 2, iconSvgCode: _ }] }, { name: "leftEnd", title: $.t("Left End"), inputType: "combobox", comboboxOptions: [{ value: k.LINEEND_NORMAL, iconSvgCode: f }, { value: k.LINEEND_ARROW, iconSvgCode: m }, { value: n.LINE_EXTEND, iconSvgCode: g }], propertyProxy: this.createLineEndPropertyProxy("leftEnd", "extendLeft") }, { name: "rightEnd", title: $.t("Right End"), inputType: "combobox", comboboxOptions: [{ value: k.LINEEND_NORMAL, iconSvgCode: v }, { value: k.LINEEND_ARROW, iconSvgCode: y }, { value: n.LINE_EXTEND, iconSvgCode: b }], propertyProxy: this.createLineEndPropertyProxy("rightEnd", "extendRight") }] }, n.prototype._riskPropertiesExceptionCases = function() {
                return [{ name: "textcolor", title: $.t("Text color"), inputType: "colorPicker", iconSvgCode: T }, { name: "profitBackground", title: $.t("Profit Background Color"), inputType: "colorPicker", iconSvgCode: S, transparency: !0, transparencyField: "profitBackgroundTransparency" }, {
                    name: "stopBackground",
                    title: $.t("Stop Background Color"),
                    inputType: "colorPicker",
                    iconSvgCode: S,
                    transparency: !0,
                    transparencyField: "stopBackgroundTransparency"
                }, { name: "linecolor", title: $.t("Border color"), inputType: "colorPicker", iconSvgCode: w }]
            }, n.prototype._elliottPropertiesExceptionCases = function() { return [{ name: "color", title: $.t("Color"), inputType: "colorPicker", iconSvgCode: w }] }, n.prototype._rangeExceptionCases = function() { return [{ name: "linecolor", inputType: "colorPicker", iconSvgCode: w, title: $.t("Color") }, { name: "backgroundColor", inputType: "colorPicker", iconSvgCode: S, title: $.t("Background Color"), transparency: !0, transparencyField: "backgroundTransparency" }, { name: "linewidth", inputType: "combobox", comboboxOptions: [{ value: 1, iconSvgCode: h }, { value: 2, iconSvgCode: c }, { value: 3, iconSvgCode: d }, { value: 4, iconSvgCode: p }], title: "Width" }] }, n.prototype._textPropertiesExceptionCases = function() { return [{ name: "color", title: $.t("Text color"), inputType: "colorPicker", iconSvgCode: T }, { name: "backgroundColor", title: $.t("Background Color"), inputType: "colorPicker", iconSvgCode: S, showIf: function(t, e) { return !e || !e.fillBackground || !!e.fillBackground.value() } }, { name: "borderColor", title: $.t("Border Color"), inputType: "colorPicker", iconSvgCode: w }, { name: "bordercolor", title: $.t("Border Color"), inputType: "colorPicker", iconSvgCode: w }, { name: "fontsize", title: $.t("Font Size"), inputType: "combobox", simple: !0, addClass: "simple fontsize-dropdown", comboboxOptions: [10, 11, 12, 14, 16, 20, 24, 28, 32, 40] }] }, n.prototype._notePropertiesExceptionCases = function() { return [{ name: "markerColor", title: $.t("Marker Color"), inputType: "colorPicker", iconSvgCode: w }, { name: "textColor", title: $.t("Text color"), inputType: "colorPicker", iconSvgCode: T }, { name: "fontSize", title: $.t("Font Size"), inputType: "combobox", simple: !0, addClass: "simple fontsize-dropdown", comboboxOptions: [10, 11, 12, 14, 16, 20, 24, 28, 32, 40] }] }, n.prototype._brushPropertiesExceptionCases = function() { return [{ name: "linecolor", inputType: "colorPicker", iconSvgCode: w, title: $.t("Color") }, { name: "backgroundColor", inputType: "colorPicker", iconSvgCode: S, transparency: !0, showIf: function(t, e) { return e.fillBackground.value() }, title: $.t("Background Color") }, { name: "linewidth", inputType: "combobox", comboboxOptions: [{ value: 1, iconSvgCode: h }, { value: 2, iconSvgCode: c }, { value: 3, iconSvgCode: d }, { value: 4, iconSvgCode: p }], title: $.t("Line Width") }, { name: "leftEnd", title: $.t("Left End"), inputType: "combobox", comboboxOptions: [{ value: k.LINEEND_NORMAL, iconSvgCode: f }, { value: k.LINEEND_ARROW, iconSvgCode: m }], propertyProxy: this.createLineEndPropertyProxy("leftEnd", "extendLeft") }, { name: "rightEnd", title: $.t("Right End"), inputType: "combobox", comboboxOptions: [{ value: k.LINEEND_NORMAL, iconSvgCode: v }, { value: k.LINEEND_ARROW, iconSvgCode: y }], propertyProxy: this.createLineEndPropertyProxy("rightEnd", "extendRight") }] }, n.prototype._oneColorForAllLines = function() { return [{ name: "collectibleColors", inputType: "colorPicker", iconSvgCode: w, title: $.t("One color for all lines") }] }, n.prototype._createToolExceptionCases = function() {
                return {
                    LineToolRegressionTrend: [],
                    LineToolGannSquare: n.prototype._oneColorForAllLines(),
                    LineToolFibTimeZone: n.prototype._oneColorForAllLines(),
                    LineToolBrush: n.prototype._brushPropertiesExceptionCases(),
                    LineToolPolyline: n.prototype._brushPropertiesExceptionCases(),
                    LineToolText: n.prototype._textPropertiesExceptionCases(),
                    LineToolTextAbsolute: n.prototype._textPropertiesExceptionCases(),
                    LineToolBalloon: n.prototype._textPropertiesExceptionCases(),
                    LineToolCallout: n.prototype._textPropertiesExceptionCases(),
                    LineToolPriceLabel: n.prototype._textPropertiesExceptionCases(),
                    LineToolArrowMarkLeft: [],
                    LineToolArrowMarkRight: [],
                    LineToolArrowMarkUp: [],
                    LineToolArrowMarkDown: [],
                    LineToolFlagMark: [],
                    LineToolThumbUp: [],
                    LineToolThumbDown: [],
                    LineToolElliottCircle: n.prototype._elliottPropertiesExceptionCases(),
                    LineToolElliottSubminuette: n.prototype._elliottPropertiesExceptionCases(),
                    LineToolElliottMinor: n.prototype._elliottPropertiesExceptionCases(),
                    LineToolElliottMinorRetr: n.prototype._elliottPropertiesExceptionCases(),
                    LineToolElliottMajorRetr: n.prototype._elliottPropertiesExceptionCases(),
                    LineToolDateRange: n.prototype._rangeExceptionCases(),
                    LineToolPriceRange: n.prototype._rangeExceptionCases(),
                    LineToolDateAndPriceRange: n.prototype._rangeExceptionCases(),
                    LineToolIcon: [{ name: "color", title: $.t("Color"), inputType: "colorPicker", iconSvgCode: S }],
                    LineToolNote: n.prototype._notePropertiesExceptionCases(),
                    LineToolNoteAbsolute: n.prototype._notePropertiesExceptionCases(),
                    LineToolThreeDrivers: [{ name: "color", title: $.t("Text color"), inputType: "colorPicker", iconSvgCode: w }],
                    LineToolRiskRewardLong: n.prototype._riskPropertiesExceptionCases(),
                    LineToolRiskRewardShort: n.prototype._riskPropertiesExceptionCases(),
                    LineToolBarsPattern: [{ name: "color", title: $.t("Color"), inputType: "colorPicker", iconSvgCode: S }],
                    LineToolProjection: [{ name: "color1", title: $.t("Background color 1"), inputType: "colorPicker", iconSvgCode: S, transparency: !0 }, { name: "color2", title: $.t("Background color 2"), inputType: "colorPicker", iconSvgCode: S, transparency: !0 }, { name: "linewidth", inputType: "combobox", comboboxOptions: [{ value: 1, iconSvgCode: h }, { value: 2, iconSvgCode: c }, { value: 3, iconSvgCode: d }, { value: 4, iconSvgCode: p }] }],
                    LineToolFibCircles: n.prototype._oneColorForAllLines(),
                    LineToolFibChannel: n.prototype._oneColorForAllLines(),
                    LineToolFibSpeedResistanceArcs: n.prototype._oneColorForAllLines(),
                    LineToolFibRetracement: n.prototype._oneColorForAllLines(),
                    LineToolFibSpeedResistanceFan: n.prototype._oneColorForAllLines(),
                    LineToolTrendBasedFibTime: n.prototype._oneColorForAllLines(),
                    LineToolFibWedge: n.prototype._oneColorForAllLines(),
                    LineToolGannComplex: n.prototype._oneColorForAllLines(),
                    LineToolGannFan: n.prototype._oneColorForAllLines(),
                    LineToolPitchfan: n.prototype._oneColorForAllLines(),
                    LineToolPitchfork: n.prototype._oneColorForAllLines(),
                    LineToolSchiffPitchfork2: n.prototype._oneColorForAllLines(),
                    LineToolSchiffPitchfork: n.prototype._oneColorForAllLines(),
                    LineToolInsidePitchfork: n.prototype._oneColorForAllLines(),
                    LineToolTrendBasedFibExtension: n.prototype._oneColorForAllLines()
                }
            }, t.exports = n
    }).call(e, i(3), i(24))
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.ColorBinding,
        a = s.BooleanBinder,
        l = s.SliderBinder,
        h = i(13).createLineWidthEditor;
    inherit(o, n),
        o.prototype.prepareLayout = function() {
            var t, e, i, o, n;
            this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = h(), e = this.createColorPicker(), i = this.addLabeledRow(this._table, "Border"), i.prepend("<td>"), $("<td>").append(e).appendTo(i), $("<td>").append(t).appendTo(i), o = $('<input type="checkbox" class="visibility-switch">'), n = this.createColorPicker(), i = this.addLabeledRow(this._table, "Background", o), $("<td>").append(o).prependTo(i), $("<td>").append(n).appendTo(i), this.bindControl(new a(o, this._linetool.properties().fillBackground, !0, this.model(), "Change Rectangle Filling")), this.bindControl(new r(e, this._linetool.properties().color, !0, this.model(), "Change Rectangle Line Color")), this.bindControl(new r(n, this._linetool.properties().backgroundColor, !0, this.model(), "Change Rectangle Background Color", this._linetool.properties().transparency)), this.bindControl(new l(t, this._linetool.properties().linewidth, !0, this.model(), "Change Rectangle Border Width")), this.loadData()
        }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e) { this._chartWidget = t, this._undoModel = e }

    function n(t, e, i) { s.call(this, t, e, i), this.prepareLayout() }
    var s = i(10),
        r = i(5),
        a = r.SimpleStringBinder,
        l = r.SimpleComboBinder,
        h = r.ColorBinding,
        c = r.BooleanBinder;
    o.prototype.attachSource = function(t, e) { this._source = t, this._edit = $("<textarea>"), this._edit.css("width", "300"), this._edit.css("height", "150"), this._edit.appendTo(this._chartWidget._jqMainDiv), this._edit.css("position", "absolute"), this._edit.css("left", e.x + "px"), this._edit.css("top", e.y + "px"), this._edit.val(t.properties().text.value()), this._edit.focus(); var i = this._edit; return i.select(), this._binding = new a(i, t.properties().text, null, !0, this._undoModel, "change line tool text"), this._edit.focusout(function() { t.properties().text.setValue(i.val()) }), this._edit.mousedown(function(t) { return !0 }), i }, inherit(n, s), n.prototype.prepareLayout = function() {
        var t, e, i, o, n = this.createColorPicker(),
            s = this.createColorPicker(),
            r = this.createFontSizeEditor(),
            d = this.createFontEditor(),
            p = this.createTextEditor(350, 200),
            u = this.createColorPicker(),
            _ = $('<input type="checkbox" class="visibility-switch">'),
            f = $('<input type="checkbox" class="visibility-switch">'),
            m = $('<input type="checkbox">'),
            g = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),
            v = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');
        this.bindControl(new h(n, this._linetool.properties().color, !0, this.model(), "Change Text Color")), this.bindControl(new l(r, this._linetool.properties().fontsize, parseInt, !0, this.model(), "Change Text Font Size")), this.bindControl(new l(d, this._linetool.properties().font, null, !0, this.model(), "Change Text Font")), this.bindControl(new a(p, this._linetool.properties().text, null, !0, this.model(), "Change Text")),
            this.bindControl(new h(u, this._linetool.properties().backgroundColor, !0, this.model(), "Change Text Background", this._linetool.properties().backgroundTransparency)), this.bindControl(new c(_, this._linetool.properties().fillBackground, !0, this.model(), "Change Text Background Fill")), this.bindControl(new c(f, this._linetool.properties().drawBorder, !0, this.model(), "Change Text Border")), this.bindControl(new h(s, this._linetool.properties().borderColor, !0, this.model(), "Change Text Border Color")), this.bindControl(new c(m, this._linetool.properties().wordWrap, !0, this.model(), "Change Text Wrap")), this.bindControl(new c(g, this._linetool.properties().bold, !0, this.model(), "Change Text Font Bold")), this.bindControl(new c(v, this._linetool.properties().italic, !0, this.model(), "Change Text Font Italic")), t = $('<table class="property-page" cellspacing="0" cellpadding="2">'), e = $('<table class="property-page" cellspacing="0" cellpadding="2">'), i = $('<table class="property-page" cellspacing="0" cellpadding="2">'), this._table = t.add(i).add(e), $(document.createElement("tr")).append($(document.createElement("td")).attr({ width: 1 }).append(n)).append($(document.createElement("td")).attr({ width: 1 }).append(d)).append($(document.createElement("td")).attr({ width: 1 }).append(r)).append($(document.createElement("td")).attr({ width: 1 }).append(g)).append($(document.createElement("td")).append(v)).appendTo(t), $(document.createElement("tr")).append($(document.createElement("td")).attr({ colspan: 5 }).append(p)).appendTo(t), o = this.addLabeledRow(e, $.t("Text Wrap"), m), $("<td>").append(m).prependTo(o), o = this.addLabeledRow(i, $.t("Background"), _), $("<td>").append(_).prependTo(o), $("<td>").append(u).appendTo(o), o = this.addLabeledRow(i, $.t("Border"), f), $("<td>").append(f).prependTo(o), $("<td>").append(s).appendTo(o), this.loadData(), setTimeout(function() { p.select(), p.focus() }, 20)
    }, n.prototype.widget = function() { return this._table }, n.prototype.dialogPosition = function(t, e) {
        var i, o, n, s, r, a, l, h = 5,
            c = 0,
            d = this._linetool,
            p = d._model.paneForSource(d),
            u = this._model._chartWidget;
        return $.each(u.paneWidgets(), function(t, e) { if (e._state === p) return c = $(e.canvas).offset().top, !1 }), t || (t = {}), o = t.left, n = t.top, s = (this._linetool.paneViews() || [])[0], s && (i = s._floatPoints[0]), i && (o = i.x, n = i.y + c), r = $(e).outerHeight(), a = $(window).height(), l = d.properties().fontsize.value(), n = n + r + l + h <= a ? n + l + h : n - r - h, { top: n, left: o }
    }, t.exports = n
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.SimpleComboBinder,
        a = s.ColorBinding,
        l = s.SliderBinder,
        h = s.BooleanBinder,
        c = i(19).createLineStyleEditor,
        d = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, p, u;
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">'), t = $("<tbody>").appendTo(this._table), e = d(), i = c(), o = this.createColorPicker(), n = this.addLabeledRow(t, $.t("Line")), $("<td>").append(o).appendTo(n), $("<td>").append(e).appendTo(n), $('<td colspan="3">').append(i.render()).appendTo(n), this._linetool.properties().fillBackground && ($("<td>").prependTo(n),
            s = $('<input type="checkbox" class="visibility-switch">'), p = this.createColorPicker(), u = $("<tbody>").appendTo(this._table), n = $("<tr>").appendTo(u), $("<td>").append(s).appendTo(n), $("<td>").append($.t("Background")).appendTo(n), $("<td>").append(p).appendTo(n)), this.bindControl(new a(o, this._linetool.properties().linecolor, !0, this.model(), "Change Time Cycles Color")), this.bindControl(new r(i, this._linetool.properties().linestyle, parseInt, !0, this.model(), "Change Time Cycles Line Style")), this.bindControl(new l(e, this._linetool.properties().linewidth, !0, this.model(), "Change Time Cycles Line Width")), s && (this.bindControl(new h(s, this._linetool.properties().fillBackground, !0, this.model(), "Change Time Cycles Filling")), this.bindControl(new a(p, this._linetool.properties().backgroundColor, !0, this.model(), "Change Time Cycles Background Color", this._linetool.properties().transparency)))
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.SimpleComboBinder,
        a = s.ColorBinding,
        l = s.BooleanBinder,
        h = s.SliderBinder,
        c = i(19).createLineStyleEditor,
        d = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, p, u, _, f, m, g, v, y, b, w, S, T, C;
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">'), t = $("<tbody>").appendTo(this._table), e = d(), i = c(), o = this.createColorPicker(), n = this.addLabeledRow(t, $.t("Line")), $("<td>").append(o).appendTo(n), $("<td>").append(e).appendTo(n), $('<td colspan="3">').append(i.render()).appendTo(n), s = $("<tbody>").appendTo(this._table), p = $("<label>" + $.t("Extend") + " </label>").css({ "margin-left": "8px" }), u = $('<input type="checkbox">').appendTo(p), _ = $("<label>" + $.t("Extend") + " </label>").css({ "margin-left": "8px" }), f = $('<input type="checkbox">').appendTo(_), m = $("<select><option value='0'>" + $.t("Normal") + "</option><option value='1'>" + $.t("Arrow") + "</option></select>"), g = $("<select><option value='0'>" + $.t("Normal") + "</option><option value='1'>" + $.t("Arrow") + "</option></select>"), n = this.addLabeledRow(s, $.t("Left End")), $('<td colspan="3">').appendTo(n).append(m).append(p), n = this.addLabeledRow(s, $.t("Right End")), $('<td colspan="3">').appendTo(n).append(g).append(_), n = this.addLabeledRow(s, $.t("Stats Text Color")), v = this.createColorPicker(), $("<td>").append(v).appendTo(n), this.bindControl(new a(v, this._linetool.properties().textcolor, !0, this.model(), "Change Text Color")), y = $('<input type="checkbox">'), b = $('<input type="checkbox">'), w = $('<input type="checkbox">'), S = $('<input type="checkbox">'), T = $('<input type="checkbox">'), C = $('<input type="checkbox">'), n = this.addLabeledRow(s, $.t("Show Price Range")), $('<td colspan="3">').appendTo(n).append(y), n = this.addLabeledRow(s, $.t("Show Bars Range")), $('<td colspan="3">').appendTo(n).append(b), n = this.addLabeledRow(s, $.t("Show Date/Time Range")), $('<td colspan="3">').appendTo(n).append(w), n = this.addLabeledRow(s, $.t("Show Distance")), $('<td colspan="3">').appendTo(n).append(S), n = this.addLabeledRow(s, $.t("Show Angle")),
            $('<td colspan="3">').appendTo(n).append(T), n = this.addLabeledRow(s, $.t("Always Show Stats")), $('<td colspan="3">').appendTo(n).append(C), this.bindControl(new l(u, this._linetool.properties().extendLeft, !0, this.model(), "Change Trend Line Extending Left")), this.bindControl(new l(f, this._linetool.properties().extendRight, !0, this.model(), "Change Trend Line Extending Right")), this.bindControl(new a(o, this._linetool.properties().linecolor, !0, this.model(), "Change Trend Line Color")), this.bindControl(new r(i, this._linetool.properties().linestyle, parseInt, !0, this.model(), "Change Trend Line Style")), this.bindControl(new h(e, this._linetool.properties().linewidth, !0, this.model(), "Change Trend Line Width")), this.bindControl(new r(m, this._linetool.properties().leftEnd, parseInt, !0, this.model(), "Change Trend Line Left End")), this.bindControl(new r(g, this._linetool.properties().rightEnd, parseInt, !0, this.model(), "Change Trend Line Right End")), this.bindControl(new l(y, this._linetool.properties().showPriceRange, !0, this.model(), "Change Trend Line Show Price Range")), this.bindControl(new l(b, this._linetool.properties().showBarsRange, !0, this.model(), "Change Trend Line Show Bars Range")), this.bindControl(new l(w, this._linetool.properties().showDateTimeRange, !0, this.model(), "Change Trend Line Show Date/Time Range")), this.bindControl(new l(S, this._linetool.properties().showDistance, !0, this.model(), "Change Trend Line Show Distance")), this.bindControl(new l(T, this._linetool.properties().showAngle, !0, this.model(), "Change Trend Line Show Angle")), this.bindControl(new l(C, this._linetool.properties().alwaysShowStats, !0, this.model(), "Change Trend Line Always Show Stats")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.BooleanBinder,
        a = s.ColorBinding,
        l = s.SliderBinder,
        h = s.SimpleComboBinder,
        c = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n, s, d, p, u, _, f;
        this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = c(), e = this.createColorPicker(), i = this.createColorPicker(), o = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'), n = $('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'), s = this.createFontSizeEditor(), d = this.createFontEditor(), p = this.addLabeledRow(this._table, "Border"), p.prepend("<td>"), $("<td>").append(e).appendTo(p), $("<td>").append(t).appendTo(p), u = $('<input type="checkbox" class="visibility-switch">'), _ = this.createColorPicker(), d = this.createFontEditor(), p = this.addLabeledRow(this._table, "Background", u), $("<td>").append(u).prependTo(p), $("<td>").append(_).appendTo(p), this.bindControl(new r(u, this._linetool.properties().fillBackground, !0, this.model(), "Change Pattern Filling")),
            this.bindControl(new a(e, this._linetool.properties().color, !0, this.model(), "Change Pattern Line Color")), this.bindControl(new a(i, this._linetool.properties().textcolor, !0, this.model(), "Change Pattern Text Color")), this.bindControl(new a(_, this._linetool.properties().backgroundColor, !0, this.model(), "Change Pattern Background Color", this._linetool.properties().transparency)), this.bindControl(new l(t, this._linetool.properties().linewidth, !0, this.model(), "Change Pattern Border Width")), this.bindControl(new h(s, this._linetool.properties().fontsize, parseInt, !0, this.model(), "Change Text Font Size")), this.bindControl(new h(d, this._linetool.properties().font, null, !0, this.model(), "Change Text Font")), this.bindControl(new r(o, this._linetool.properties().bold, !0, this.model(), "Change Text Font Bold")), this.bindControl(new r(n, this._linetool.properties().italic, !0, this.model(), "Change Text Font Italic")), f = $('<table class="property-page" cellspacing="0" cellpadding="2"><tr>').append($(document.createElement("td")).attr({ width: 1 }).append(i)).append($(document.createElement("td")).attr({ width: 1 }).append(d)).append($(document.createElement("td")).attr({ width: 1 }).append(s)).append($(document.createElement("td")).css("vertical-align", "top").attr({ width: 1 }).append(o)).append($(document.createElement("td")).css("vertical-align", "top").append(n)).append($("</tr></table>")), p = this.addLabeledRow(this._table, ""), $('<td colspan="5">').append(f).appendTo(p), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e, i), this.prepareLayout() }
    var n = i(10),
        s = i(5),
        r = s.BooleanBinder,
        a = s.ColorBinding,
        l = s.SliderBinder,
        h = i(13).createLineWidthEditor;
    inherit(o, n), o.prototype.prepareLayout = function() {
        var t, e, i, o, n;
        this._table = $(document.createElement("table")), this._table.addClass("property-page"), this._table.attr("cellspacing", "0"), this._table.attr("cellpadding", "2"), t = h(), e = this.createColorPicker(), i = this.addLabeledRow(this._table, $.t("Border")), i.prepend("<td>"), $("<td>").append(e).appendTo(i), $("<td>").append(t).appendTo(i), o = $('<input type="checkbox" class="visibility-switch">'), n = this.createColorPicker(), i = this.addLabeledRow(this._table, $.t("Background"), o), $("<td>").append(o).prependTo(i), $("<td>").append(n).appendTo(i), this.bindControl(new r(o, this._linetool.properties().fillBackground, !0, this.model(), "Change Triangle Filling")), this.bindControl(new a(e, this._linetool.properties().color, !0, this.model(), "Change Triangle Line Color")), this.bindControl(new a(n, this._linetool.properties().backgroundColor, !0, this.model(), "Change Triangle Background Color", this._linetool.properties().transparency)), this.bindControl(new l(t, this._linetool.properties().linewidth, !0, this.model(), "Change Triangle Border Width")), this.loadData()
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t, e, i) { s.call(this, t, e), this._linetool = i, this.prepareLayout() }
        var n = i(5),
            s = n.PropertyPage,
            r = n.BooleanBinder,
            a = n.RangeBinder;
        inherit(o, s), o.prototype.prepareLayout = function() {
            var t, i, o, n, s, l, h, c, d, p, u, _;
            this._block = $('<table class="property-page">'), t = this._linetool.properties().intervalsVisibilities, e.enabled("seconds_resolution") && (i = $("<tr>").appendTo(this._block), o = $("<label>").append($.t("Seconds")), n = $("<input type='checkbox'>").addClass("visibility-checker").prependTo(o), $("<td>").css("padding-right", "15px").append(o).appendTo(i), s = $("<input type='text'>").addClass("ticker-text"), $("<td>").append(s).appendTo(i), l = $("<div>").addClass("slider-range ui-slider-horizontal"), $("<td>").append(l).appendTo(i), h = $("<input type='text'>").addClass("ticker-text"), $("<td>").append(h).appendTo(i), this.bindControl(new r(n, t.seconds, !0, this.model(), "Change Line Tool Visibility On Seconds")), this.bindControl(new a(l, [t.secondsFrom, t.secondsTo], [1, 59], !1, this.model(), [s, h], [$.t("Change Seconds From"), $.t("Change Seconds To")], n))), i = $("<tr>").appendTo(this._block), o = $("<label>").append($.t("Minutes")), c = $("<input type='checkbox'>").addClass("visibility-checker").prependTo(o), $("<td>").css("padding-right", "15px").append(o).appendTo(i), s = $("<input type='text'>").addClass("ticker-text"), $("<td>").append(s).appendTo(i), l = $("<div>").addClass("slider-range ui-slider-horizontal"), $("<td>").append(l).appendTo(i), h = $("<input type='text'>").addClass("ticker-text"), $("<td>").append(h).appendTo(i), this.bindControl(new r(c, t.minutes, !0, this.model(), "Change Line Tool Visibility On Minutes")), this.bindControl(new a(l, [t.minutesFrom, t.minutesTo], [1, 59], !1, this.model(), [s, h], [$.t("Change Minutes From"), $.t("Change Minutes To")], c)), i = $("<tr>").appendTo(this._block), o = $("<label>").append($.t("Hours")), d = $("<input type='checkbox'>").addClass("visibility-checker").prependTo(o), $("<td>").append(o).appendTo(i), s = $("<input type='text'>").addClass("ticker-text"), $("<td>").append(s).appendTo(i), l = $("<div>").addClass("slider-range ui-slider-horizontal"), $("<td>").append(l).appendTo(i), h = $("<input type='text'>").addClass("ticker-text"), $("<td>").append(h).appendTo(i), this.bindControl(new r(d, t.hours, !0, this.model(), "Change Line Tool Visibility On Hours")), this.bindControl(new a(l, [t.hoursFrom, t.hoursTo], [1, 24], !1, this.model(), [s, h], [$.t("Change Minutes From"), $.t("Change Hours To")], d)), i = $("<tr>").appendTo(this._block), o = $("<label>").append($.t("Days")), p = $("<input type='checkbox'>").addClass("visibility-checker").prependTo(o), $("<td>").append(o).appendTo(i), s = $("<input type='text'>").addClass("ticker-text"), $("<td>").append(s).appendTo(i), l = $("<div>").addClass("slider-range ui-slider-horizontal"), $("<td>").append(l).appendTo(i), h = $("<input type='text'>").addClass("ticker-text"), $("<td>").append(h).appendTo(i), this.bindControl(new r(p, t.days, !0, this.model(), "Change Line Tool Visibility On Days")), this.bindControl(new a(l, [t.daysFrom, t.daysTo], [1, 366], !1, this.model(), [s, h], [$.t("Change Minutes From"), $.t("Change Days To")], p)), i = $("<tr>").css("height", "29px").appendTo(this._block), o = $("<label>").append($.t("Weeks")), u = $("<input type='checkbox'>").prependTo(o),
                $("<td>").append(o).appendTo(i), this.bindControl(new r(u, t.weeks, !0, this.model(), "Change Line Tool Visibility On Weeks")), i = $("<tr>").css("height", "29px").appendTo(this._block), o = $("<label>").append($.t("Months")), _ = $("<input type='checkbox'>").prependTo(o), $("<td>").append(o).appendTo(i), this.bindControl(new r(_, t.months, !0, this.model(), "Change Line Tool Visibility On Months")), this.loadData()
        }, o.prototype.widget = function() { return this._block }, t.exports = o
    }).call(e, i(3))
}, function(t, e, i) {
    (function(e, o, n) {
        "use strict";

        function s() { this.title = $.t("Load Chart Layout"), this._removeDialogShown = !1, this.options = {}, this.matchedItems = [], this.itemsData = [], this.qs = new s.QuickSearch(this.fieldsExtractor, this.searchResult.bind(this)), this.sortObj = new s.SortObject(this.modifiedCompare), this.nameSort = new s.SortObject(this.nameCompare), this.symbolSort = new s.SortObject(this.symbolCompare), this.toolsSort = new s.SortObject(this.toolsCompare), l.on("chart_loaded", s.onChartLoaded, this) }
        var r, a, l = i(34),
            h = i(71).createDialog,
            c = i(370).createSearchControl,
            d = i(222).regExpEscape;
        i(504), r = '<div class="js-table-row tv-load-chart-dialog-table__row tv-load-chart-dialog-table__row--item {{^withFavs}}tv-load-chart-dialog-table__row--item-without-favs{{/withFavs}} {{#isActive}}i-active{{/isActive}}">{{#withFavs}}<div class="tv-load-chart-dialog-table__favorite-icon-container {{#starred}}i-starred{{/starred}}" ><span class="js-empty-star tv-load-chart-dialog-table__star-icon tv-load-chart-dialog-table__star-icon--empty" title="' + $.t("Add to favorites") + '">' + i(381) + '</span><span class="js-filled-star tv-load-chart-dialog-table__star-icon tv-load-chart-dialog-table__star-icon--filled" title="' + $.t("Remove from favorites") + '">' + i(380) + '</span></div>{{/withFavs}}<div class="js-column-name tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--item tv-load-chart-dialog-table__column-name">{{title}}</div><div class="js-column-modified tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--item tv-load-chart-dialog-table__column-modified">{{modifiedDate}}</div><div class="js-column-symbol tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--item tv-load-chart-dialog-table__column-symbol">{{chartSymbol}}</div><div class="js-remove-button tv-load-chart-dialog-table__column-name-action tv-load-chart-dialog-table__remove-icon" title="' + $.t("Delete chart layout") + '">' + i(129) + "</div></div>",
            a = '<div class="tv-load-chart-dialog-table__row tv-load-chart-dialog-table__row--header"><div class="js-column-name tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--header tv-load-chart-dialog-table__column-name">' + $.t("Chart Layout Name") + '<span class="tv-caret tv-load-chart-dialog-table__caret"></span></div><div class="js-column-modified tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--header tv-load-chart-dialog-table__column-modified">' + $.t("Last Modified") + '<span class="tv-caret tv-load-chart-dialog-table__caret"></span></div><div class="js-column-symbol tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--header tv-load-chart-dialog-table__column-symbol">' + $.t("Active Symbol") + '<span class="tv-caret tv-load-chart-dialog-table__caret"></span></div></div>', s.onChartLoaded = function() { this.itemsData && this.itemsData.length > 0 && this._refreshChartsList() }, s.QuickSearch = function(t, e) { this.fieldsExtractor = t, this.callback = e, this.regExps = [] }, s.QuickSearch.prototype.onInput = function(t) { this.query = t, this.createRegexps(t), this.search() }, s.QuickSearch.prototype.createRegexps = function(t) { this.regExps = [], this.regExps.push(RegExp("(" + t.split("").map(function(t) { return d(t) }).join(")(.*?)(") + ")", "i")) }, s.QuickSearch.prototype.match = function(t) {
                var e, i, o, n;
                for (e = 0; e < this.regExps.length; e++)
                    for (i = this.regExps[e], i.lastIndex = 0, o = this.fieldsExtractor(t), n = 0; n < o.length; n++)
                        if (i.test(o[n])) return !0;
                return 0 === this.regExps.length
            }, s.QuickSearch.prototype.search = function() {
                var t, e, i = [];
                for (t = 0; t < this.items.length; t++) e = this.items[t], this.match(e) && i.push(e);
                this.callback(i, this.regExps)
            }, s.QuickSearch.prototype.setItems = function(t) { this.items = t }, s.SortObject = function(t, e) { this.isAscending = !1, this.sortingFunc = t, this.getPredicate = function() { return function(t, e) { var i = this.sortingFunc(t, e); return this.isAscending && (i *= -1), i }.bind(this) }, this.inverse = function() { this.isAscending = !this.isAscending }, this.setIsAscending = function(t) { return "boolean" == typeof t && (this.isAscending = t), this.isAscending }, this.reset = function() { this.isAscending = !1 } }, s.prototype.fieldsExtractor = function(t) { var e = s.symbolWrap(t); return [t.title, e] }, s.prototype.saveFavorite = function(t, e) { e ? this.favorites[t] = e : delete this.favorites[t] }, s.prototype.filterFavorites = function() {
                var t = {};
                this.itemsData.map(function(e) { this.favorites.hasOwnProperty(e.id) && (t[e.id] = !0) }.bind(this)), this.favorites = t
            }, s.prototype.getFavorite = function(t) { return this.favorites.hasOwnProperty(t) }, s.prototype._onFavoriteClicked = function(t, e, i) { this.saveFavorite(t.id, e), this.filterFavorites(), this.fillList(), t.favoriteAction(this.favorites), i.preventDefault() }, s.prototype._onItemClicked = function(t, e) { e.defaultPrevented || (e.preventDefault(), t.openAction()) }, s.prototype._onRemoveButtonClicked = function(t, e) {
                var i = this,
                    o = $.Deferred();
                this._removeDialogShown = !0, o.done(function() { i.removeItem(t) }).always(function() { setTimeout(function() { i._removeDialogShown = !1 }) }), t.deleteAction(o, t.title), e.preventDefault()
            }, s.prototype._createListItem = function(t) {
                var i = $(e.render(r, { isActive: t.active(), title: t.title, url: t.url, withFavs: o.enabled("items_favoriting"), starred: this.getFavorite(t.id), modifiedDate: n.unix(t.modified).format("L LT"), chartSymbol: "" === t.symbol ? "multiple charts" : t.symbol + ", " + t.interval }));
                return o.enabled("items_favoriting") && (i.find(".js-empty-star")[0].addEventListener("click", this._onFavoriteClicked.bind(this, t, !0)), i.find(".js-filled-star")[0].addEventListener("click", this._onFavoriteClicked.bind(this, t, !1))), i.find(".js-remove-button")[0].addEventListener("click", this._onRemoveButtonClicked.bind(this, t)), i[0].addEventListener("click", this._onItemClicked.bind(this, t)), i
            }, s.prototype.removeItem = function(t) {
                var e = this.itemsData.indexOf(t);
                e > -1 && this.itemsData.splice(e, 1), this.setChartsData(this.itemsData)
            }, s.prototype.modifiedCompare = function(t, e) {
                var i = t.modified,
                    o = e.modified;
                return n(o).diff(n(i))
            }, s.prototype.nameCompare = function(t, e) { return t.title.localeCompare(e.title) }, s.symbolWrap = function(t) { return "" === t.symbol ? "multiple charts" : t.symbol + " " + t.interval }, s.prototype.symbolCompare = function(t, e) { return s.symbolWrap(t).localeCompare(s.symbolWrap(e)) }, s.prototype.toolsCompare = function(t, e) {
                var i = t.toolsCount,
                    o = e.toolsCount;
                return i < o ? -1 : i === o ? 0 : 1
            }, s.prototype.sortClick = function(t) { this.setSort($(t.target).data("sort"), !0), this.fillList() }, s.prototype.setSort = function(t, e) {
                var i, o, n = { field: TVSettings.getValue("loadChartDialog.sort.field") || "modified", isAscending: TVSettings.getValue("loadChartDialog.sort.asc") || "0" },
                    s = t || n.field,
                    r = e ? "0" === n.isAscending ? "1" : "0" : n.isAscending;
                this.currentSortObj && !(i = s !== n.field) || (this.currentSortObj = "name" === s ? this.nameSort : "symbol" === s ? this.symbolSort : "tools" === s ? this.toolsSort : this.sortObj, i && TVSettings.setValue("loadChartDialog.sort.field", s)), this.currentSortObj.setIsAscending("1" === r), r !== n.isAscending && TVSettings.setValue("loadChartDialog.sort.asc", r), o = this, $.each(this.header.children(".tv-load-chart-dialog-table__column--header"), function() {
                    var t = $(this),
                        e = t.data("sort") === s;
                    t.removeClass("i-active i-dropped"), e && t.addClass("i-active " + (o.currentSortObj.isAscending ? "" : "i-dropped"))
                })
            }, s.prototype.sortList = function() {
                var t, e = [],
                    i = [];
                this.matchedItems.map(function(t) { this.favorites.hasOwnProperty(t.id) ? e.push(t) : i.push(t) }.bind(this)), void 0 !== this.currentSortObj && (t = this.currentSortObj.getPredicate(), i.sort(t), e.sort(t)), this.matchedItems = e.concat(i)
            }, s.prototype.fillList = function() {
                var t, e;
                for (this.sortList(), this.itemsList = this.itemsList.detach(), this.itemsList[0].innerHTML = "", t = this.matchedItems.length, e = 0; e < t; ++e) this.itemsList.append(this._createListItem(this.matchedItems[e]));
                this.itemsListContainer.toggleClass("i-empty", 0 === this.itemsData.length), this.highlightOccurrences(this.qs.regExps), this._dialog && (this._dialog.scrollToStart(), this._dialog.updateScroll()), this.itemsListContainer.prepend(this.itemsList)
            }, s.prototype.searchResult = function(t, e) { this.matchedItems = t, this.fillList() }, s.prototype.updateChartsData = function(t) { this.setChartsData(t) }, s.prototype.updateFavoritesData = function(t) {
                this.favorites = t, this.itemsList && this.qs.search()
            }, s.prototype._refreshChartsList = function() { this.qs.setItems(this.itemsData), this.qs.search() }, s.prototype.setChartsData = function(t) { this.itemsList && (this.itemsData = t, this.qs.setItems(t), this.qs.search()) }, s.prototype.layoutHeader = function() { var t = $(a); return t.find(".js-column-name").data("sort", "name"), t.find(".js-column-modified").data("sort", "modified"), t.find(".js-column-symbol").data("sort", "symbol"), t.appendTo(this.content), t }, s.prototype.resetSort = function() { this.sortObj.reset(), this.nameSort.reset(), this.symbolSort.reset(), this.toolsSort.reset(), this.currentSortObj = this.sortObj }, s.prototype.show = function(t, e) {
                var i = c({ placeholder: $.t("Search") }),
                    o = $("<div>");
                o.append(i.$control), o.append('<div class="tv-load-chart-dialog-table">'), this.content = $("<div>").appendTo(o.find(".tv-load-chart-dialog-table")), this.header = this.layoutHeader(), this.setSort(), this.itemsListContainer = $('<div class="tv-load-chart-dialog-table__items-list-container js-dialog__scroll-wrap">').appendTo(this.content), this.itemsList = $('<div class="tv-load-chart-dialog-table__items-list">').appendTo(this.itemsListContainer), $('<div class="tv-load-chart-dialog-table__empty-list-placeholder">').text($.t("There are no saved charts")).appendTo(this.itemsListContainer), this.header.children(".tv-load-chart-dialog-table__column--header").click($.proxy(this, "sortClick")), i.inputChangedDelegate.subscribe(this.qs, this.qs.onInput), this.favorites = e, this.setChartsData(t), this.qs.onInput(""), this._dialog && this._dialog.close(), this._dialog = h({ title: this.title, width: 600, height: 550, content: o, contentWrapTemplate: "<div>", destroyOnClose: !0, isClickOutFn: function() { return !this._removeDialogShown && void 0 }.bind(this) }), this._dialog.open()
            }, s.prototype.highlightOccurrences = function(t) {
                this.itemsList.children(".js-table-row").each(function() {
                    var e, i = $(this).find(".js-column-name"),
                        o = i.text();
                    o = s.highlightText(o, t), i.html(o), e = $(this).find(".js-column-symbol"), o = e.text(), o = s.highlightText(o, t), e.html(o)
                })
            }, s.highlightText = function(t, e) {
                var i, o, n, s, r, a;
                if (t = $("<div>").text(t).html(), 0 === e.length) return t;
                for (i = 0; i < e.length; i++) {
                    if (o = e[i], o.lastIndex = 0, n = "", s = "", (r = o.exec(t)) && r.length)
                        for (a = 1; a < r.length; a++) n += a % 2 ? '<span class="i-match">$' + a + "</span>" : "$" + a;
                    if ((s = t.replace(o, n)) && s !== t) return s
                }
            }, t.exports = s
    }).call(e, i(30), i(3), i(40))
}, , 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) {
    "use strict";

    function o(t, e, i) { this._model = e, this._paneWidget = t, this._chart = t._chart, this._mainDiv = i, this.jqDiv = $('<div class="pane-controls">').appendTo(i), this._chart.navigationButtonsController().addWidget({ widget: this.jqDiv, acceptableOffset: 0, checkingWidget: i }), this.update() }
    o.prototype.update = function() {
        var t, e, o, n, s, r, a, l;
        if (!this._chart.isActive()) return void this.jqDiv.css("display", "none");
        if (this.jqDiv.css("display", "block"), t = this, e = t._model, o = t._paneWidget.state(), n = e.panes().indexOf(o), this.jqDiv.toggleClass("toppane", 0 === n || this._chart.isMaximizedPane()), s = !1, !o.containsMainSeries() && !this._chart.isMaximizedPane()) {
            for (r = 0, a = o.dataSources(), l = a.length; l--;)
                if (a[l] instanceof TradingView.Study && ++r > 1) { s = !0; break }
            a = null
        }
        n > 0 && !this._chart.isMaximizedPane() ? (this._$upButton || (this._$upButton = $(document.createElement("a")).addClass("pane-legend-icon up").append($(i(868)).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(), n < this._model.panes().length - 1 && !this._chart.isMaximizedPane() ? (this._$downButton || (this._$downButton = $(document.createElement("a")).addClass("pane-legend-icon down").append($(i(864)).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(), s ? (this._$closeButton || (this._$closeButton = $(document.createElement("a")).addClass("pane-legend-icon delete").append($(i(378)).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(865)).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(866)).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()
    }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { this.chart = t, this.paneA = t.paneWidgets()[e], this.paneB = t.paneWidgets()[i], this.jqRow = $(document.createElement("tr")), this.jqRow.height(o.HEIGHT), this.jqCell = $(document.createElement("td")), this.jqCell.appendTo(this.jqRow), this.jqCell.addClass("pane-separator"), this.jqCell.attr("colspan", "3"), this.jqCell.css("background", this.chart.properties().scalesProperties.lineColor.value()), this.jqCell.click(function() {}), this.handle = $('<div class="handle">').appendTo(this.jqCell), s(this.handle, this) }
    var n, s;
    i(492), n = i(2), s = i(106).setMouseEventHandler, o.HEIGHT = 1, o.prototype.hide = function() { this.jqRow.addClass("js-hidden") }, o.prototype.show = function() { this.jqRow.removeClass("js-hidden") }, o.prototype.mouseDownEvent = function(t) {
        (0 === t.button || Modernizr.touch) && (this.startY = t.pageY, this.deltaY = 0, this.totalHeight = this.paneA.size.h + this.paneB.size.h, this.totalStretch = this.paneA.stretchFactor() + this.paneB.stretchFactor(), this.prevStretchA = this.paneA.stretchFactor(), this.minPaneHeight = 30, this.maxPaneHeight = this.totalHeight - this.minPaneHeight, this.pixelStretchFactor = this.totalStretch / this.totalHeight)
    }, o.prototype.pressedMouseMoveEvent = function(t) {
        var e, i, o, s;
        (0 === t.button || Modernizr.touch) && (t.preventDefault(), this.deltaY = t.pageY - this.startY, e = this.paneA.size.h, i = n.clamp(e + this.deltaY, this.minPaneHeight, this.maxPaneHeight), o = i * this.pixelStretchFactor, s = this.totalStretch - o, this.paneA.setStretchFactor(o), this.paneB.setStretchFactor(s), this.chart._adjustSize(), this.paneA.size.h !== e && (this.startY = t.pageY), this.chart.paint())
    }, o.prototype.mouseUpEvent = function(t) {
        (0 === t.button || Modernizr.touch) && (this.chart._model.addPaneStretchFactorUndoCommand(this.paneA._state, this.paneB._state, this.prevStretchA, this.paneA.stretchFactor()), this.startY = 0, this.deltaY = 0, this.totalHeight = 0, this.totalStretch = 0, this.minPaneHeight = 0, this.maxPaneHeight = 0, this.pixelStretchFactor = 0)
    }, o.prototype.update = function() { this.jqCell.css("background", this.chart.properties().scalesProperties.lineColor.value()) }, o.prototype.paint = function() {}, o.prototype.image = function() {
        var t = {},
            e = o.HEIGHT,
            i = this.paneA.lhsPriceAxisWidget.size.w,
            n = this.paneA.size.w,
            s = this.paneA.rhsPriceAxisWidget.size.w,
            r = $('<canvas width="' + i + '" height="' + e + '">')[0],
            a = r.getContext("2d");
        return a.fillStyle = this.chart.properties().scalesProperties.lineColor.value(), a.fillRect(0, 0, i, e), t.leftAxis = { content: r.toDataURL(), contentWidth: i, contentHeight: e }, r = $('<canvas width="' + n + '" height="' + e + '">')[0], a = r.getContext("2d"), a.fillStyle = this.chart.properties().scalesProperties.lineColor.value(), a.fillRect(0, 0, n, e), t.content = r.toDataURL(), t.contentWidth = n, t.contentHeight = e, r = $('<canvas width="' + s + '" height="' + e + '">')[0], a = r.getContext("2d"), a.fillStyle = this.chart.properties().scalesProperties.lineColor.value(), a.fillRect(0, 0, s, e), t.rightAxis = { content: r.toDataURL(), contentWidth: s, contentHeight: e }, t
    }, t.exports = o
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t, e, i, o) {
            this._chart = t, this.dialog = t.dialog, this._state = e, this.verticalTouchScroll = o, this._disableContextMenu = !!i, this.lhsPriceAxisWidget = new h(this, h.LHS), this.rhsPriceAxisWidget = new h(this, h.RHS), this.jqPane = $(document.createElement("td")), this.jqPane.addClass("chart-markup-table"), this.jqPane.addClass("pane"), 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.jqPane), this.canvas = A(this._dv, new E(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 = A(this._dv, new E(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._zoomSelector = $("<div>"), this._zoomSelector.addClass("zoom-selector"), this._zoomSelector.css("display", "none"), this._zoomSelector.appendTo(this._dv), this._tooltipSelector = $("<div>"), this._tooltipSelector.addClass("tooltip tooltip-selector tooltip-selector-hidden"), this._tooltipSelector.appendTo(this._dv), this.legendWidget = new l(this, this._chart.model(), this._chart._jqMainDiv), this.jqRow = $(document.createElement("tr")), this.lhsPriceAxisWidget.jqCell.appendTo(this.jqRow), this.jqPane.appendTo(this.jqRow), this.legendWidget.$el.appendTo(this._dv), this.rhsPriceAxisWidget.jqCell.appendTo(this.jqRow), this.setCursorForTool(), M($(this.top_canvas), this, !0, o), e && !this._chart.readOnly() && (this.paneControls = new C(this, this._chart.model(), this._dv)), this.updateScalesVisibility(), this.actions = [], this.readonlyActions = [], this._onKeyUpListener = this._onKeyUpListener.bind(this), this._lineCancelledCallback = this._lineCancelledCallback.bind(this), $(window).on("keyup.panewidget", this._onKeyUpListener), this._chart.withModel(this, this._lineCancelledCallback), this._overlays = {}, this._contextMenuX = 0, this._contextMenuY = 0, this._lockDrawingsProperty = S.lockDrawings(), this._chart.withModel(this, function() {
                var t = this._chart.model();
                t.onSimpleZoomIn().subscribe(this, this._updateCrosshairOnZoom), t.onSimpleZoomOut().subscribe(this, this._updateCrosshairOnZoom)
            })
        }
        var n, s, r, a, l, h, c, d, p, u, _, f, m, g, v, y, b, w, S, T, C, x, P, L, k, I, A, E, M, D, O, V;
        i(493), n = i(2), s = i(373).UndoMacroCommand, r = i(53).UndoHistory, a = i(31).Study, l = i(605), h = i(194), c = i(325), d = i(328), p = i(1).LineDataSource, u = i(201), _ = i(102).BarsMarksContainer, f = i(33).trackEvent, m = i(48).PriceDataSource, g = i(47), v = g.Action, y = g.ActionPlaceholder, b = g.ActionSeparator, w = i(101), S = i(42), T = i(8), C = i(657), x = i(21), P = i(34), L = i(120), k = L.resizeCanvas, I = L.clearRect, A = L.addCanvasTo, E = L.Size, M = i(106).setMouseEventHandler, D = i(192), O = i(125), V = i(12).getLogger("Chart.PaneWidget"), o.prototype.destroy = function() {
                $(window).off("keyup.panewidget", this._onKeyUpListener), this.legendWidget && (this.legendWidget.$el.remove(), delete this.legendWidget), this.paneControls && (this.paneControls.jqDiv.remove(),
                    delete this.paneControls), this._chart.withModel({ chart: this._chart, instance: this, callback: this._hideTooltip }, function() { this.chart.model().lineCancelled().unsubscribe(this.instance, this.callback) });
                for (var t in this) delete this[t]
            }, o.prototype.cancelZoom = function() { this._zoomSelector.css("display", "none"), delete this._firstZoomPoint }, o.prototype._onKeyUpListener = function(t) {
                if (27 === t.keyCode) {
                    this._chart.model().lineBeingCreated() && this._chart.model().cancelCreatingLine(), this._firstZoomPoint && this.cancelZoom();
                    this._chart.model().model().crossHairSource().clearMeasure(), this.setCursorForTool(), this._hideTooltip()
                }
            }, o.prototype._lineCancelledCallback = function() { try { this._chart.model().lineCancelled().subscribe(this, this._hideTooltip) } catch (t) {} }, o.prototype.backgroundColor = function() { return this._chart.properties().paneProperties.background.value() }, o.prototype.priceAxisByCanvas = function(t) { return t === this.lhsPriceAxisWidget.canvas || t === this.lhsPriceAxisWidget.top_canvas ? this.lhsPriceAxisWidget : t === this.rhsPriceAxisWidget.canvas || t === this.rhsPriceAxisWidget.top_canvas ? this.rhsPriceAxisWidget : null }, o.prototype.updateScalesVisibility = function() { this.lhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showLeftScale.value()), this.rhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showRightScale.value()) }, o.prototype.chart = function() { return this._chart }, o.prototype.state = function() { return this._state }, o.prototype.setState = function(t) { this._state = t }, o.prototype.stretchFactor = function() { return this._state ? this._state._stretchFactor : Pane.DEFAULT_STRETCH_FACTOR }, o.prototype.setStretchFactor = function(t) { this._state && (this._state._stretchFactor = t) }, o.prototype.mouseEnterEvent = function(t) {
                var e = this._chart.model();
                e && (e.crossHairSource().visible = !0, "function" == typeof this.onMouseEnter && this.onMouseEnter(this))
            }, o.prototype.isLineTool = function(t) { var e = TradingView[t]; return "function" == typeof e && e.prototype instanceof p }, o.prototype.hideInplaceEditor = function() { return !!this._inplaceEditor && (this._inplaceEditor.remove(), this._inplaceEditor = void 0, !0) }, o.prototype._processMouseMoveWhileZoom = function(t) {
                var e = Math.floor(this._chart.model().timeScale().coordinateToIndex(t.localX)),
                    i = this._chart.model().timeScale().indexToCoordinate(e) - .5 * this._chart.model().timeScale().barSpacing(),
                    o = t.localY,
                    n = Math.abs(i - this._firstZoomPoint.x),
                    s = Math.abs(o - this._firstZoomPoint.y);
                i < this._firstZoomPoint.x ? this._zoomSelector.css("left", i) : this._zoomSelector.css("left", this._firstZoomPoint.x), t.localY < this._firstZoomPoint.y ? this._zoomSelector.css("top", t.localY) : this._zoomSelector.css("top", this._firstZoomPoint.y), this._zoomSelector.width(n), this._zoomSelector.height(s)
            }, o.prototype._finishZoom = function(t) {
                var e = this._state.defaultPriceScale(),
                    i = e.coordinateToPrice(t.localY),
                    o = Math.round(this._chart.model().timeScale().coordinateToIndex(t.localX));
                o !== this._firstZoomPoint.index && this._chart.model().zoomToViewport(this._firstZoomPoint.index, o, this._firstZoomPoint.price, i, this.state()),
                    this._zoomSelector.css("display", "none"), this._firstZoomPoint = null, S.resetToCursor()
            }, o.EvironmentState = function(t) { t.shiftKey && (this.shift = !0), t.ctrlKey && (this.control = !0) }, o.prototype.checkMovepoint = function(t) { return t === T.MOVEPOINT || t === T.MOVEPOINT_BACKGROUND && TradingView.isMobile.any() }, o.prototype.mouseDownEvent = function(t) {
                var i, s, r, l, h, c, d, u, _, f, g, v, y, b;
                if (document.activeElement !== document.body && document.activeElement !== document.documentElement ? document.activeElement && document.activeElement.blur ? document.activeElement.blur() : document.body.focus() : document.getSelection ? document.getSelection().removeAllRanges() : document.selection && document.selection.clear(), P.emit("mouse_down", { clientX: t.clientX, clientY: t.clientY, pageX: t.pageX, pageY: t.pageY, screenX: t.screenX, screenY: t.screenY }), this._updateCommonTooltip(null), i = this._chart.model(), s = new o.EvironmentState(t), i.mainSeries().setGotoDateResult(), this.hideInplaceEditor(), TradingView.supportTouch() && (this._skipFirstMove = !0), r = this._state.defaultPriceScale(), !r.isEmpty() && !i.timeScale().isEmpty()) {
                    if (l = i.crossHairSource(), TradingView.supportTouch() && "LineToolBrush" !== S.tool.value() || i.setCurrentPosition(t.localX, t.localY, this._state), h = l.price, c = l.index, l.startMeasurePoint() && l.endMeasurePoint() && l.clearMeasure(), s.shift && S.toolIsCursor(S.tool.value()) && S.tool.setValue("measure"), "measure" === S.tool.value() && !l.startMeasurePoint()) return void l.startMeasuring({ price: h, index: c, x: t.localX, y: t.localY }, this._state);
                    if (l.startMeasurePoint() && !l.endMeasurePoint()) return l.finishMeasure({ price: h, index: c, x: t.localX, y: t.localY }), void S.resetToCursor();
                    if (this._firstZoomPoint) return void this._finishZoom(t);
                    if ("zoom" === S.tool.value() && e.enabled("chart_zoom")) return d = i.timeScale().indexToCoordinate(c) - .5 * i.timeScale().barSpacing(), this._firstZoomPoint = { price: h, index: c, x: d, y: t.localY }, this._zoomSelector.css("display", "block"), this._zoomSelector.css("left", d), this._zoomSelector.css("top", t.localY), this._zoomSelector.width(0), void this._zoomSelector.height(0);
                    if (this.isLineTool(S.tool.value()) || i.lineBeingCreated()) return void((!e.enabled("charting_library_base") || c >= 0) && this._mouseDownEventForLineTool(t, s, c, h));
                    if (u = this.dataSourceAtPoint(t.localX, t.localY), _ = u && u.source && u.source.customization ? u.source.customization : {}, u.hittest && u.hittest.result() === T.CUSTOM && (f = u.hittest.data().mouseDownHandler) && f(t), !this._chart.readOnly()) {
                        if (u && !_.disableSelection && (g = u.hittest && u.hittest.result() > T.MOVEPOINT_BACKGROUND, g = g || u.hittest && u.hittest.result() === T.MOVEPOINT_BACKGROUND && TradingView.isMobile.any(), g ? i.setSelectedSource(u.source, u.hittest && u.hittest.data()) : i.setSelectedSource(null)), u.source && "eraser" === S.tool.value() && !_.disableErasing && (TradingView.isInherited(u.source.constructor, p) || TradingView.isInherited(u.source.constructor, a))) return v = u.hittest.eraseMarker(), void(t.ctrlKey && void 0 !== v && u.source.processErase ? u.source.processErase(i, v) : i.removeSource(u.source));
                        if (y = u.source && TradingView.isInherited(u.source.constructor, p) && u.source.isLocked(), !(this._lockDrawingsProperty.value() || y)) { if (u.source && u.source.userEditEnabled && !u.source.userEditEnabled()) return; if (u.hittest && u.hittest.result() === T.CHANGEPOINT) return r = u.source.priceScale(), h = r.coordinateToPrice(t.localY), i.startChangingLinetool(u.source, { index: c, price: h }, u.hittest.data(), s), void this._updateTooltip(t.localX, t.localY); if (u.hittest && this.checkMovepoint(u.hittest.result())) return b = u.source.properties(), s.control && b.clonable && b.clonable.value() ? void(this._clonningAtMoveLineTool = u.source) : void(u.source.isFixed && u.source.isFixed() ? i.startMovingSource(u.source, new n.Point(t.localX, t.localY), u.hittest.data()) : (r = u.source.priceScale(), h = r.coordinateToPrice(t.localY), i.startMovingSource(u.source, { index: c, price: h }, u.hittest.data()))) }
                        if (u.source && TradingView.isInherited(u.source.constructor, m) && u.source.isDraggable()) return void(this._chart.draggingSource = u.source)
                    }
                    u.hittest && u.hittest.result() === T.REGULAR || (this._processing = !0)
                }
            }, o.prototype.drawRightThere = function(t) {
                var e, i;
                this.isLineTool(t) && (e = this._chart.model(), i = e.crossHairSource(), e.createLineTool(this._state, { index: i.index, price: i.price }, t))
            }, o.prototype._finishTool = function(t) {
                var e, i = this._chart.model(),
                    o = S.tool.value();
                S.resetToCursor(), this._hideTooltip(), i.setSelectedSource(t), this._chart.isTextTool(o) && (e = i.createUndoCheckpoint(), this._chart.showEditObjectDialog(t, i, null, e).then(function(t) { t.focusOnText() }))
            }, o.prototype._mouseDownEventForLineTool = function(t, e, i, o) {
                var s, r, a, l, h, c, d, p, _, f, m = this._chart.model(),
                    g = !1,
                    v = null,
                    y = t.localX,
                    b = t.localY,
                    w = this._chart.model().model().crossHairSource(),
                    T = S.tool.value();
                if (S.hideAllDrawings().setValue(!1), S.lockDrawings().setValue(!1), TradingView.supportTouch() && this.isLineTool(T) && "LineToolBrush" !== T && !m.lineBeingCreated() && (this._startTouchPoint = new n.Point(y, b), this._initCrossHairPosition = w.currentPoint(), this._skipFirstMove = !0), !m.lineBeingCreated() || m.lineBeingCreated() instanceof u) TradingView.supportTouch() && "LineToolBrush" !== T || (f = { index: i, price: o }, v = m.createLineTool(this._state, f, T), m.lineBeingCreated() || (g = !0));
                else if (TradingView.supportTouch()) { if (this._skipFirstMove = !0, !this._startTouchPoint) return this._startTouchPoint = new n.Point(y, b), s = m.lineBeingCreated().points(), r = s[s.length - 1], a = m.timeScale().indexToCoordinate(r.index), o = r.price, l = m.lineBeingCreated().priceScale(), l.isPercent() && (h = m.lineBeingCreated().ownerSource().firstValue(), o = l.priceRange().convertToPercent(o, h)), c = l.priceToCoordinate(o), void(this._lastDrawingPoint = new n.Point(a, c)) } else v = m.lineBeingCreated(), d = m.paneForSource(v), d !== this._state ? (p = this._dv.offset(), y = t.localX + p.left, b = t.localY + p.top, _ = this._chart.paneByState(d), p = _._dv.offset(), y -= p.left, b -= p.top, o = v.priceScale().coordinateToPrice(b), i = Math.round(m.timeScale().coordinateToIndex(y)), g = m.coninueCreatingLine({ index: i, price: o }, e)) : g = m.coninueCreatingLine({ index: i, price: o }, e);
                m.setSelectedSource(v), g ? this._finishTool(v) : TradingView.supportTouch() && "LineToolBrush" !== T || this._updateTooltip(t.localX, t.localY)
            }, o.prototype._equalsCursorCache = function(t, e) {
                return S.toolIsCursor(t.tool) ? t.tool === e.tool && t.theme === e.theme && t.crosshair === e.crosshair : t.tool === e.tool && t.theme === e.theme
            }, o.prototype._setCursorClassName = function(t) {
                var e = "";
                t && (e = "pane--cursor-" + t), this._currentCursorClassName !== e && (this._currentCursorClassName && this.jqPane.removeClass(this._currentCursorClassName), e && this.jqPane.addClass(e), this._currentCursorClassName = e, this.jqPane.css("cursor"))
            }, o.prototype.setCursorForTool = function(t, e) { var i, o = S.tool.value(); if (S.toolIsCursor(o)) { if (this._chart.draggingSource || this._isScrolling || this._chart.model() && this._chart.model().sourceBeingMoved()) return void this._setCursorClassName("grabbing"); if (t) return void this._setCursorClassName("pointer") } return "eraser" === o ? void this._setCursorClassName("eraser") : "zoom" === o ? void this._setCursorClassName("zoom-in") : "dot" === (i = S.cursorTool.value()) ? void this._setCursorClassName("dot") : "arrow" === i ? void this._setCursorClassName("default") : void this._setCursorClassName("") }, o.prototype.setDragToAnotherPaneCursor = function() { this._setCursorClassName("grabbing") }, o.prototype.gestureStartEvent = function(t) { this._prev_pinch_scale = 1, this._pinching = !0 }, o.prototype.gestureChangeEvent = function(t) {
                var e, i, o = t.center.x - 5,
                    n = this._chart.paneWidgets()[0].lhsPriceAxisWidget.size.w,
                    s = this._chart.model().timeScale().width();
                n && (o = Math.max(0, o - n)), o = Math.min(o, s), e = 2 * (o / s - .5), i = 5 * (t.scale - this._prev_pinch_scale), i > 0 ? this._chart.model().zoomIn(e, i) : i < 0 && this._chart.model().zoomOut(e, -i), this._prev_pinch_scale = t.scale
            }, o.prototype.gestureEndEvent = function(t) { this._pinching = !1 }, o.prototype._updateCommonTooltip = function(t) {
                var e, i, o, n = this._lastCommonTooltipData,
                    s = null;
                if (t && t.hittest && t.hittest.result() === T.CUSTOM && (e = t.hittest.data()) && (s = e.tooltip || null), null != n || null != s) return null == s ? (this._lastCommonTooltipData = null, void O.hide()) : void(n && s.text === n.text && s.rect.x === n.rect.x && s.rect.y === n.rect.y && s.rect.w === n.rect.w && s.rect.h === n.rect.h || (this._lastCommonTooltipData = s, i = TradingView.clone(s), o = this.jqPane.offset(), i.rect.x += o.left, i.rect.y += o.top, O.show(i)))
            }, o.prototype.mouseMoveEvent = function(t) {
                var e, i, n, s, r, a, l, h, c, d, p, u, _, f = this._chart.model();
                if (f) {
                    if (e = t.localX, i = t.localY, n = new o.EvironmentState(t), this._firstZoomPoint) return void this._processMouseMoveWhileZoom(t);
                    if (this._chart.readOnly() || this._editDialog && this._editDialog.isVisible() || (s = S.tool.value(), r = null, a = null, l = null, this._processing || !S.toolIsCursor(s) && "eraser" !== s || (r = this.dataSourceAtPoint(t.localX, t.localY), h = r && r.source, c = this._chart.model().crossHairSource(), h && ("LineToolOrder" === h.toolname || "LineToolPosition" === h.toolname || "AlertLabel" === h.toolname) ? c.visibleTrap = !1 : c.visibleTrap = !0, r.hittest && r.hittest.result() > T.MOVEPOINT_BACKGROUND ? (a = r.source, l = r.hittest.result(), !r.source || "eraser" === s && r.source.constructor === TradingView.Series ? f.setHoveredSource(null) : f.setHoveredSource(r.source, r.hittest.data())) : f.setHoveredSource(null)), this.setCursorForTool(a, l), this._updateCommonTooltip(r)), this._chart.readOnly() && (r = this.dataSourceAtPoint(t.localX, t.localY),
                            null !== r.source ? f.setHoveredSource(r.source, r.hittest.data()) : f.setHoveredSource(null, null)), this._chart.model().lineBeingCreated() && (d = this._chart.model().lineBeingCreated(), (p = this._chart.model().paneForSource(d)) !== this._state)) return u = this._dv.offset(), e += u.left, i += u.top, _ = this._chart.paneByState(p), u = _._dv.offset(), e -= u.left, i -= u.top, void f.setCurrentPosition(e, i, p);
                    s = S.tool.value(), TradingView.supportTouch() && this.isLineTool(s) || (f.setCurrentPosition(e, i, this._state, n), this._updateTooltip(e, i))
                }
            }, o.prototype.pressedMouseMoveEvent = function(t) {
                var i, s, r, a, l, h, c, d, _, f, m, g, v, y, b, w, T, C, x, P, L, k, I, A, E, M, D;
                if (!this._pinching) {
                    if (this._skipFirstMove ? (delete this._skipFirstMove, delete this._touchMove) : this._touchMove = !0, i = new o.EvironmentState(t), s = this._chart.model(), r = t.localX, a = t.localY, this._firstZoomPoint) return this._processMouseMoveWhileZoom(t), void(this._firstZoomPoint.draggingMode = !0);
                    if (l = S.tool.value(), TradingView.supportTouch() && this._startTouchPoint && this.isLineTool(l) && "LineToolBrush" !== l && !s.lineBeingCreated()) return h = this._initCrossHairPosition, c = new n.Point(r, a), d = c.substract(this._startTouchPoint), _ = h.add(d), this._chart.model().setCurrentPosition(_.x, _.y, this._state), void this._updateTooltip(_.x, _.y);
                    if (TradingView.supportTouch() && s.lineBeingCreated() && !(s.lineBeingCreated() instanceof u)) return void(this._startTouchPoint && (f = s.lineBeingCreated(), m = t.localX - this._startTouchPoint.x, g = t.localY - this._startTouchPoint.y, v = this._lastDrawingPoint.x + m, y = this._lastDrawingPoint.y + g, b = this._chart.model().paneForSource(f), s.setCurrentPosition(v, y, b), this._updateTooltip(v, y)));
                    if (s.setCurrentPosition(r, a, this._state, i), this._updateTooltip(r, a), w = S.tool.value(), (!this.isLineTool(w) || "LineToolBrush" === l) && (0 === t.button || Modernizr.touch)) {
                        if ("LineToolBrush" === w) { if (T = this._state.defaultPriceScale(), T.isEmpty()) return; if (!this._chart.model().lineBeingCreated()) return; return C = T.coordinateToPrice(t.localY), x = Math.round(this._chart.model().timeScale().coordinateToIndex(t.localX)), void((!e.enabled("charting_library_base") || x >= 0) && this._chart.model().coninueCreatingLine({ index: x, price: C })) }
                        if (this._chart.draggingSource && (P = t.target, L = this._chart.paneByCanvas(P), L && (L !== this ? L.setDragToAnotherPaneCursor() : L.setCursorForTool()), k = this._chart.priceAxisByCanvas(P), k && k.setCursor("grabbing"), (I = this._chart.timeAxisByCanvas(P)) && I.setCursor("grabbing")), s.timeScale().isEmpty()) return;
                        if (s.lineBeingEdited()) return x = Math.round(this._chart.model().timeScale().coordinateToIndex(r)), (!e.enabled("charting_library_base") || x >= 0) && s.changeLinePoint({ x: r, y: a }, i), this._updateTooltip(r, a), void this.setCursorForTool();
                        if (s.sourceBeingMoved()) {
                            if (T = s.sourceBeingMoved().priceScale(), T.isEmpty()) return;
                            if (x = this._chart.model().timeScale().coordinateToIndex(t.localX), C = T.coordinateToPrice(t.localY), A = s.sourceBeingMoved(), this.setCursorForTool(), e.enabled("charting_library_base") && !s.sourceBeingMoved().onlyYMoving() && (E = A.points(), 0 !== E.length && E.reduce(function(t, e) {
                                    return e.index < t.index ? e : t
                                }).index - ((A._currentMovingPoint || A._startMovingPoint).index - x) < 0)) return;
                            return TradingView.isInherited(A.constructor, p) && A.isFixed() ? void s.moveSource(new n.Point(r, a)) : void s.moveSource({ index: x, price: C }, i)
                        }
                        if (i.control && this._clonningAtMoveLineTool) return f = this._clonningAtMoveLineTool, M = this.cloneLineTool(f, !0), D = this._chart.model().model().dataSourceForId(M), this._chart.model().setSelectedSource(D), s.startMovingSource(D, { index: this._chart.model().timeScale().coordinateToIndex(t.localX), price: f.priceScale().coordinateToPrice(t.localY) }), void(this._clonningAtMoveLineTool = null);
                        T = this._state.defaultPriceScale(), !this._startScrollingPos && e.enabled("chart_scroll") && (this._startScrollingPos = { x: t.clientX, y: t.clientY }), this._startScrollingPos && (this._startScrollingPos.x === t.clientX && this._startScrollingPos.y === t.clientY || this._isScrolling || (s.beginUndoMacro("scroll").setCustomFlag("doesnt_affect_save", !0), T.isEmpty() || s.startScrollPrice(this._state, T, t.localY), s.startScrollTime(t.localX), this._isScrolling = !0, this.setCursorForTool())), this._isScrolling && (T.isEmpty() || s.scrollPriceTo(this._state, T, t.localY), s.scrollTimeTo(t.localX))
                    }
                }
            }, o.prototype._processMouseUpForCustomHandler = function(t) {
                var e, i = this.dataSourceAtPoint(t.localX, t.localY);
                i.hittest && i.hittest.result() === T.CUSTOM && (e = i.hittest.data().mouseUpHandler) && e(t)
            }, o.prototype.mouseUpEvent = function(t) {
                var e, i, o, n, a, l, h, c, d, p, _, f, m, g, v, y, b, w, T, C, L, k, I, A, E, M, D, O, $, V, B, R, N, F;
                if (this._processMouseUpForCustomHandler(t), this._clonningAtMoveLineTool = null, e = this, P.emit("mouse_up", { clientX: t.clientX, clientY: t.clientY, pageX: t.pageX, pageY: t.pageY, screenX: t.screenX, screenY: t.screenY }), i = this._chart.model(), o = this._touchMove, delete this._touchMove, n = S.tool.value(), TradingView.supportTouch() && !o && "LineToolBrush" !== n && this.isLineTool(n) && !i.lineBeingCreated()) return a = i.crossHairSource().currentPoint(), l = this._state.defaultPriceScale(), h = l.coordinateToPrice(a.y), c = Math.round(i.timeScale().coordinateToIndex(a.x)), d = { index: c, price: h }, p = i.createLineTool(this._state, d, n), i.setSelectedSource(p), i.lineBeingCreated() || this._finishTool(p), this._updateTooltip(a.x, a.y), void delete this._startTouchPoint;
                if (i.lineBeingCreated() && !(i.lineBeingCreated() instanceof u) && this._startTouchPoint) return _ = !1, delete this._startTouchPoint, o || (p = i.lineBeingCreated(), f = p.points()[p.points().length - 1], h = f.price, m = p.priceScale(), m.isPercent() && (g = i.lineBeingCreated().ownerSource().firstValue(), h = m.priceRange().convertToPercent(h, g)), _ = i.coninueCreatingLine({ index: f.index, price: h }, {}), delete this._lastDrawingPoint), void(_ && this._finishTool(p));
                if (this._firstZoomPoint && this._firstZoomPoint.draggingMode) return void this._finishZoom(t);
                if (0 === t.button || TradingView.supportTouch()) {
                    if (this._processing = !1, i = this._chart.model(), i.lineBeingEdited()) return i.endChangingLinetool(), void this._hideTooltip();
                    if ("LineToolBrush" === n) {
                        if (i.finishLineTool(), l = this._state.defaultPriceScale(), l.isEmpty()) return;
                        if (!this._chart.model().lineBeingCreated()) return;
                        return h = l.coordinateToPrice(t.localY),
                            c = Math.round(this._chart.model().timeScale().coordinateToIndex(t.localX)), void this._chart.model().coninueCreatingLine({ index: c, price: h })
                    }
                    if (v = i.sourceBeingMoved()) return i.endMovingSource(), this._hideTooltip(), this.setCursorForTool(v), void i.invalidate(new x(x.UPDATE_CURSOR_ONLY));
                    if (this._chart.readOnly() || (y = this.dataSourceAtPoint(t.localX, t.localY), b = this._chart.model().crossHairSource(), w = t.localX >= 0 && t.localX < this.size.w, y && y.source === b || !w || (T = e._chart.model().timeScale().coordinateToIndex(t.localX), e._chart.model().model().onSyncScrollNeeded(T))), C = this._isScrolling && r.undoStack().head() instanceof s, this._isScrolling && (l = this._state.defaultPriceScale(), i.endScrollPrice(this._state, l), e = this, L = function() { i.endScrollTime(), i.endUndoMacro(), e._startScrollingPos = void 0, e._isScrolling = !1, e.setCursorForTool() }, TradingView.supportTouch() ? (k = i.timeScale().m_scrollStartPoint, I = .05 * (t.localX - k), A = null, E = function(e) {
                            var o, n;
                            null === A && (A = e), o = .01 * Math.min(100, 3 * (e - A)), o = Math.sqrt(o), n = t.localX + I * o, i.scrollTimeTo(n), o >= 1 ? L() : requestAnimationFrame(E)
                        }, requestAnimationFrame(E)) : L()), this._chart.draggingSource)
                        for (M = t.target, D = this._chart.paneByCanvas(M), D && D !== this && (O = D._state.findSuitableScale(this._chart.draggingSource), C && (C = !1, r.undo()), this._chart.model().move(this._chart.draggingSource, D._state, O)), $ = this._chart.priceAxisByCanvas(M), $ && (D = $.pane, l = $._isLeft ? D._state.leftPriceScale() : D._state.rightPriceScale(), C && (C = !1, r.undo()), this._chart.model().move(this._chart.draggingSource, D._state, l)), V = this._chart.timeAxisByCanvas(M), V && (C && (C = !1, r.undo()), this._chart.model().move(this._chart.draggingSource, null, null)), this._chart.draggingSource = null, B = this._chart.getTimeScale(), B && B.restoreDefaultCursor(), y = this.dataSourceAtPoint(t.localX, t.localY), R = this._chart.paneWidgets(), N = 0; N < R.length; N++) F = R[N], F === this && y ? F.setCursorForTool(y.source, y.hittest || null) : F.setCursorForTool(), F.lhsPriceAxisWidget.restoreDefaultCursor(), F.rhsPriceAxisWidget.restoreDefaultCursor()
                }
                delete this._touchMove
            }, o.prototype.mouseLeaveEvent = function(t) {
                var e = this._chart.model();
                e && (TradingView.isMobile.any() || e.model().clearCurrentPosition(), e.setHoveredSource(null), this._updateCommonTooltip(null), "function" == typeof this.onMouseLeave && this.onMouseLeave(this))
            }, o.prototype.mouseClickEvent = function(t) {
                var e, i = this.dataSourceAtPoint(t.localX, t.localY),
                    o = this._chart.model(),
                    n = i.source;
                this._lastClickedSource !== n && (this._lastClickedSource && (this._lastClickedSource.onClickOutside(t), o.chartModel().updateSource(this._lastClickedSource)), this._lastClickedSource = n), i.hittest && i.hittest.result() === T.CUSTOM && (e = i.hittest.data().mouseClickHandler) && (e(t), o.chartModel().updateSource(n)), o.hoveredSource() instanceof _ && o.hoveredSource().onClicked()
            }, o.prototype.showEditDialogForSource = function(t) {
                if (!(this.chart().onWidget() || t.userEditEnabled && !t.userEditEnabled())) {
                    var e = this;
                    this._chart.showEditObjectDialog(t, this._chart.model()).then(function(t) { e._editDialog = t })
                }
            }, o.prototype.mouseDoubleClickEvent = function(t) {
                var e, i = !this._chart.readOnly() && !this.isLineTool(S.tool.value()) && this.dataSourceAtPoint(t.localX, t.localY),
                    o = i && i.hittest && i.source;
                o && i.hittest.result() <= T.MOVEPOINT_BACKGROUND && !TradingView.isMobile.any() && (o = null), o && o.customization && o.customization.disableSelection && (o = null), o && o._metaInfo && "Sessions@tv-basicstudies" === o._metaInfo.id && (o = this._chart.model().mainSeries()), o ? (e = !1, e ? TradingView.alertsDispatcher.openEditDialog(i.source.alert()) : this.showEditDialogForSource(o)) : this._chart.readOnly() || this.isLineTool(S.tool.value()) || this._chart.model().lineBeingCreated() || this._chart.model().selectedSource() || this._chart.toggleMaximizePane(this)
            }, o.prototype.showContextMenuForSource = function(t, e) { t.hasContextMenu() && (this._chart.model().setSelectedSource(t), t.constructor === TradingView.Series ? this._seriesContextMenu(t).show(e) : TradingView.isInherited(t.constructor, a) ? this._studyContextMenu(t).show(e) : TradingView.isInherited(t.constructor, c) || TradingView.isInherited(t.constructor, d) ? this._tradingDrawingsContextMenu(t).show(e) : TradingView.isInherited(t.constructor, p) && this._lineContextMenu(t).then(function(t) { t.show(e) })) }, o.prototype.contextMenuEvent = function(t, i) {
                var o, n, s, r;
                if (e.enabled("pane_context_menu")) {
                    if (this._chart.model().crossHairSource().startMeasurePoint()) return void this._chart.model().crossHairSource().clearMeasure();
                    if (!this._pinching && (this._firstZoomPoint && this.cancelZoom(), !this.hideInplaceEditor())) {
                        if (!S.toolIsCursor(S.tool.value())) { if (TradingView.isMobile.any()) return; return S.resetToCursor(!0), this.setCursorForTool(), this._hideTooltip(), void(this._chart.model().lineBeingCreated() && this._chart.model().cancelCreatingLine()) }
                        this.chart().readOnly() || this._disableContextMenu || (this._chart.model().mainSeries().createSessStudy(), this._chart.updateActions(), this._contextMenuX = t.localX, this._contextMenuY = t.localY, o = this.dataSourceAtPoint(t.localX, t.localY), n = o ? o.source : null, s = o && o.hittest ? o.hittest.result() : 0, r = s >= T.REGULAR || s >= T.MOVEPOINT_BACKGROUND && TradingView.isMobile.any(), null !== n && r ? this.showContextMenuForSource(n, t) : (this._contextMenu(t).then(function(e) { return e.show(t) }), this._chart.model().setSelectedSource(null)), this.paint())
                    }
                }
            }, o.prototype._contextMenu = function(t) {
                function e(t) { return null === t.text }
                var i = this;
                return Promise.all(this._initActions(t)).then(function(t) {
                    var o, n, s = i._customActions();
                    for (t = t.filter(function(t) { return null !== t }), s.remove.forEach(function(e) {
                            for (var i = 0; i < t.length; i++)
                                if (t[i].text === e) { t.splice(i, 1); break }
                        }), o = s.top.concat(t).concat(s.bottom), n = o.length - 1; n > 0; n--) e(o[n]) && e(o[n - 1]) && o.splice(n, 1);
                    return o.length && e(o[0]) && o.splice(0, 1), o.length && e(o[o.length - 1]) && o.splice(o.length - 1, 1), w.createMenu(o)
                })
            }, o.prototype.createRemoveMenu = function() {
                var t, e = this._chart.actions(),
                    i = new v({ text: $.t("Remove") });
                return i.subActions || (i.subActions = []), t = i.subActions, t.push(e.paneRemoveAllStudies, e.paneRemoveAllDrawingTools, e.paneRemoveAllStudiesDrawingTools), i
            }, o.prototype.createDrawingMenu = function() {
                var t, i = this._chart.actions(),
                    o = new v({ text: $.t("Drawing Tools") });
                return o.subActions || (o.subActions = []), t = o.subActions, t.push(i.drawingToolbarAction), e.enabled("items_favoriting") && t.push(i.favoriteDrawingToolbar), t.push(new b), t.push(i.magnetAction, i.stayInDrawingModeAction), e.enabled("support_multicharts") && t.push(i.syncModeAction), t.push(new b, i.lockDrawingsAction, i.hideAllDrawingsAction, i.paneRemoveAllDrawingTools), o
            }, o.prototype._initActions = function(t) {
                var i, o, n, s, r, a = this,
                    l = this._chart.actions(),
                    h = [];
                return e.enabled("datasource_copypaste") && (!(i = D.get()) || "study" !== i.type && "drawing" !== i.type || (o = new v({ text: $.t("Paste %s").replace("%s", $.t(i.title || i.type)), shortcut: "Ctrl-V" }), o.callbacks().subscribe(null, function() { a._chart.onAppClipboardPaste(a.state()) }), h.push(o))), l.gotoDate && h.push(l.gotoDate), h.length && h.push(new b), h.push(l.chartReset, l.symbolSearch, l.changeInterval), n = window.widgetbar && (!window.widgetbar._customization || window.widgetbar._customization.watchlist), n && l.addToWatchlist && h.push(l.addToWatchlist), e.enabled("text_notes") && h.push(l.addToTextNotes), e.enabled("symbol_info") && h.push(l.showSymbolInfoDialog), h.push(new b, this._createLockTimeAxisAction(t), new b, l.paneObjectTree, l.insertIndicator), e.enabled("charting_library_base") || h.push(l.applyStudyTemplate), e.enabled("compare_symbol") && h.push(l.compareOrAdd), h.push(this.createDrawingMenu()), e.enabled("charting_library_base") && h.push(l.hideAllMarks), h.push(this.createRemoveMenu(), new b), s = this._priceAxisMenu(), s && h.push(s), r = this._timeAxisMenu(), r && h.push(r), e.enabled("charting_library_base") || h.push(l.applyColorTheme), e.enabled("show_chart_property_page") && h.push(l.chartProperties), pro.hasPackage("mtp-mtpredictor") && this.state().containsMainSeries() && h.push(new b, this._createMTPredictorActions()), h
            }, o.prototype._customActions = function() {
                var t, i = { top: [], bottom: [], remove: [] },
                    o = this._chart.model(),
                    n = o.timeScale(),
                    s = this._state.defaultPriceScale();
                return e.enabled("custom_items_in_context_menu") ? (t = n.isEmpty() ? void 0 : n.indexToUserTime(n.coordinateToIndex(this._contextMenuX)), P.emit("onContextMenu", {
                    unixtime: t ? t / 1e3 : void 0,
                    price: s.isEmpty() ? void 0 : s.coordinateToPrice(this._contextMenuY),
                    callback: function(t) {
                        [].concat(t).forEach(function(t) {
                            if (t.text)
                                if (t.text.length > 1 && "-" === t.text[0]) i.remove.push(t.text.slice(1));
                                else { var e; "-" === t.text ? e = new b : (e = new v({ text: t.text }), e.callbacks().subscribe(null, t.click)), t.position && "top" === t.position ? i.top.push(e) : i.bottom.push(e) }
                        })
                    }
                }), i) : i
            }, o.prototype._timeAxisMenu = function() { if (this._chart.model().timeScale().isEmpty()) return null; var t = this._chart.getTimeScale(); return new v({ text: $.t("Time Scale"), subActions: t.getContextMenuActions() }) }, o.prototype.getDefaultPriceAxisWidget = function() { var t = this._state.defaultPriceScale(); return t.isEmpty() ? null : t === this._state.leftPriceScale ? this.leftPriceAxisWidget() : this.rightPriceAxisWidget() }, o.prototype._priceAxisMenu = function() { var t = this.getDefaultPriceAxisWidget(); return t ? new v({ text: $.t("Price Scale"), subActions: t.getContextMenuActions() }) : null }, o.prototype._seriesContextMenu = function(t) {
                var i, o, n, s, r, a = this._chart.actions(),
                    l = t.properties().visible.value(),
                    h = null;
                if (this._chart.readOnly()) i = [l ? a.seriesHide : this.createActionShow(t), new b, this.createActionShowCountdown(t), new b, this.createActionScaleLeft(t), this.createActionScaleRight(t), this.createActionNoScale(t)], e.enabled("countdown") || i.splice(3, 1), h = w.createMenu(i);
                else {
                    if (o = this._mergeContentMenuItems(t), n = [a.showSymbolInfoDialog, a.compare, l ? a.seriesHide : this.createActionShow(t), this.createVisualOrderAction(t), new b, this.createActionShowCountdown(t), new b], e.enabled("countdown") || n.splice(5, 2), e.enabled("compare_symbol") || n.splice(1, 1), e.enabled("symbol_info") || n.splice(0, 1), !this.chart().onWidget() && e.enabled("show_chart_property_page") && n.unshift(a.format), s = this.createActionLockScale(t), s && n.push(s, new b), o.length > 0) {
                        for (r = 0; r < o.length; r++) n.push(o[r]);
                        n.push(new b)
                    }
                    n.push(this.createActionScaleLeft(t), this.createActionScaleRight(t), this.createActionNoScale(t)), pro.hasPackage("mtp-mtpredictor") && n.push(new b, this._createMTPredictorActions()), h = w.createMenu(n)
                }
                return h
            }, o.prototype.toggleLockTimeAxis = function(t, e) { var i, o, n; "boolean" != typeof e && (e = !S.lockTimeAxis().value()), e && (i = this._chart.model().timeScale(), o = i.coordinateToIndex(t), n = i.points().roughTime(o), S.lockTimeAxisTime.setValue(n)), S.lockTimeAxis().setValue(e) }, o.prototype._createLockTimeAxisAction = function(t) {
                var e = new v({ text: $.t("Lock Cursor In Time"), checkable: !0 }),
                    i = S.lockTimeAxis().value();
                return e.setChecked(i), e.callbacks().subscribe(null, this.toggleLockTimeAxis.bind(this, t.localX, !i)), e
            }, o.prototype._createHVLineAction = function(t, e) {
                e = "vertical" === e && "vertical" || "horizontal";
                var i = new v({ text: "vertical" === e ? $.t("Create Vertical Line") : $.t("Create Horizontal Line") });
                return i.callbacks().subscribe(this, function() {
                    var i = this._chart.model().timeScale().coordinateToIndex(t.localX),
                        o = this._state.defaultPriceScale().coordinateToPrice(t.localY),
                        n = this._chart.model().createLineTool(this._state, { index: i, price: o }, "vertical" === e && "LineToolVertLine" || "LineToolHorzLine");
                    this._finishTool(n)
                }), i
            }, o.prototype._createMTPredictorActions = function() {
                var t = this,
                    e = function(e, i, o) {
                        var n = new v({ text: e });
                        return n.callbacks().subscribe(t, function() {
                            var t, e, n = this._chart.model(),
                                s = n.timeScale(),
                                r = this._state.defaultPriceScale();
                            s.isEmpty() || r.isEmpty() || (o ? (t = r.coordinateToPrice(this._contextMenuY), e = Math.round(s.coordinateToIndex(this._contextMenuX)), n.createLineTool(this._state, { index: e, price: t }, i)) : S.tool.setValue(i))
                        }), n
                    };
                return new v({
                    text: $.t("MTPredictor"),
                    subActions: [e($.t("Apply Manual Risk/Reward"), "LineStudyMtpRiskReward", !1), e($.t("Apply Manual Decision Point"), "LineStudyMtpDecisionPoint", !0), e($.t("Analyze Trade Setup"), "LineStudyMtpAnalysis", !0), new v({ text: $.t("Apply Elliot Wave"), subActions: [e($.t("Apply Elliot Wave Intermediate"), "LineStudyMtpElliotWaveMain", !0), e($.t("Apply Elliot Wave Major"), "LineStudyMtpElliotWaveMajor", !0), e($.t("Apply Elliot Wave Minor"), "LineStudyMtpElliotWaveMinor", !0)] }), new v({
                        text: $.t("Apply WPT Up Wave"),
                        subActions: [e($.t("Up Wave 1 or A"), "LineStudyMtpUpWave1OrA", !1), e($.t("Up Wave 2 or B"), "LineStudyMtpUpWave2OrB", !1), e($.t("Up Wave C"), "LineStudyMtpUpWaveC", !1), e($.t("Up Wave 3"), "LineStudyMtpUpWave3", !1), e($.t("Up Wave 4"), "LineStudyMtpUpWave4", !1), e($.t("Up Wave 5"), "LineStudyMtpUpWave5", !1)]
                    }), new v({ text: $.t("Apply WPT Down Wave"), subActions: [e($.t("Down Wave 1 or A"), "LineStudyMtpDownWave1OrA", !1), e($.t("Down Wave 2 or B"), "LineStudyMtpDownWave2OrB", !1), e($.t("Down Wave C"), "LineStudyMtpDownWaveC", !1), e($.t("Down Wave 3"), "LineStudyMtpDownWave3", !1), e($.t("Down Wave 4"), "LineStudyMtpDownWave4", !1), e($.t("Down Wave 5"), "LineStudyMtpDownWave5", !1)] })]
                })
            }, o.prototype.createEarningsShow = function(t) {
                var e = this._chart.model().mainSeries().properties().esdShowEarnings,
                    i = new v({ checkable: !0, text: $.t("Show Earnings"), enabled: !0, checked: e.value() });
                return i.callbacks().subscribe(this, function(t) { this._chart.model().setProperty(e, t.checked, "Show Earnings") }), i
            }, o.prototype.createDividendsShow = function(t) {
                var e = this._chart.model().mainSeries().properties().esdShowDividends,
                    i = new v({ checkable: !0, text: $.t("Show Dividends"), enabled: !0, checked: e.value() });
                return i.callbacks().subscribe(this, function(t) { this._chart.model().setProperty(e, t.checked, "Show Dividends") }), i
            }, o.prototype.createSplitsShow = function(t) {
                var e = this._chart.model().mainSeries().properties().esdShowSplits,
                    i = new v({ checkable: !0, text: $.t("Show Splits"), enabled: !0, checked: e.value() });
                return i.callbacks().subscribe(this, function(t) { this._chart.model().setProperty(e, t.checked, "Show Splits") }), i
            }, o.prototype._studyEsdContextMenu = function(t) { var e = []; return this._chart.readOnly() || e.push(this.createDividendsShow(t), this.createSplitsShow(t), this.createEarningsShow(t)), w.createMenu(e) }, o.prototype._studyContextMenu = function(t) {
                var i, o, n, s, r, a = this._chart.actions(),
                    l = t.properties().visible.value(),
                    h = [];
                return t.userEditEnabled() ? (i = this._chart, this._chart.readOnly() ? h = [l ? a.studyHide : this.createActionShow(t), new b, this.createActionScaleLeft(t), this.createActionScaleRight(t), this.createActionNoScale(t)] : (o = [], n = t.metaInfo(), n.pine && (o = [a.viewSourceCode], a.viewSourceCode.setEnabled(!0), ScriptLib.isAuthToGetPineSourceCode(n.scriptIdPart, n.pine.version).done(function(t) { t || a.viewSourceCode.setEnabled(!1) }).fail(function(t) { V.logError("Failed isAuthToGetPineSourceCode, reason: " + t) })), h = [], e.enabled("study_on_study") && t.canHaveChildren() && h.push(this.createActionAddChildStudy(t)), e.enabled("property_pages") && h.push(a.format), h = h.concat(o), h = h.concat([l ? a.studyHide : this.createActionShow(t), this.createVisualOrderAction(t), new b]), s = this._mergeContentMenuItems(t), !s.length || t.properties().linkedToSeries && t.properties().linkedToSeries.value() || (s.push(new b), h = h.concat(s)), h.push(this.createActionScaleLeft(t), this.createActionScaleRight(t), this.createActionNoScale(t), new b), e.enabled("datasource_copypaste") && !t.isChildStudy() && (r = new v({ text: $.t("Copy"), shortcut: "Ctrl-C" }), r.callbacks().subscribe(null, function() { i.onAppClipboardCopy(t) }), h.push(r)), h.push(a.studyRemove)),
                    w.createMenu(h)) : w.createMenu(h)
            }, o.prototype.createLineToolTemplateAction = function(t) {
                var e, i, o, n, s, r = t.properties(),
                    a = window.lineToolPropertiesToolbar.templatesList(),
                    l = new v({ text: $.t("Templates") });
                return l.subActions || (l.subActions = []), e = l.subActions, i = new v({ text: $.t("Save As...") }), i.callbacks().subscribe(this, function() {
                    a.showSaveDialog(function(e) {
                        var i = JSON.stringify(t.template());
                        a.saveTemplate(e, i)
                    })
                }), e.push(i), o = new v({ text: $.t("Apply Default") }), o.callbacks().subscribe(this, function() { r.restoreFactoryDefaults(), window.lineToolPropertiesToolbar.onSourceChanged(t) }), e.push(o), n = $.Deferred(), a.templatesLoaded().then(function() {
                    var t = a.getData(),
                        e = [];
                    0 !== t.length && e.push(new b), $.each(t, function(t, i) {
                        function o(t) { return function() { var e = this.getTopLevelMenu(); return e && e.hide(), a.deleteAction(t), !0 } }
                        var n = new v({ text: i });
                        n.callbacks().subscribe(this, function() { a.loadTemplate(i) }), n.deleteButton = { action: o(n.text) }, e.push(n)
                    }), n.resolve(e)
                }), s = new y(n), e.push(s), l
            }, o.prototype._lineContextMenu = function(t) {
                var e = [],
                    n = this._chart,
                    s = n.actions(),
                    r = this;
                return new Promise(function(a) {
                    ! function(l) {
                        (function(l) {
                            var h, c, d, p, u, _ = i(195).hasStylesPropertyPage;
                            if (n.readOnly()) e.push(s.lineHide);
                            else if (t.userEditEnabled() && (l.enabled("alerts") && !r.chart().onWidget() && t.hasAlert.value() && e.push(r._createEditAlertDrawingAction(t)), t.updateContextMenuActions(), e = e.concat(t.contextMenuActions()), l.enabled("property_pages") && _(t, n.model()) && e.push(s.format), e.push(s.paneObjectTree), l.enabled("charting_library_base") || e.push(r.createLineToolTemplateAction(t)), e.push(r.createVisualOrderAction(t), new b, s.lineHide, s.lineToggleLock), t.properties().clonable && t.properties().clonable.value() && (h = new v({ text: $.t("Clone"), callbackContext: { target: t }, shortcut: "Ctrl+Drag", doNotBindShortcut: !0 }), h.callbacks().subscribe(r, o.prototype.cloneLineTool.bind(r, t, !1)), e.push(h)), l.enabled("datasource_copypaste") && !t.properties().blockCopying && (c = new v({ text: $.t("Copy"), shortcut: "Ctrl-C" }), c.callbacks().subscribe(null, function() { n.onAppClipboardCopy(t) }), e.push(c)), l.enabled("support_multicharts") && (t.linkKey ? e.push(s.lineUnlink) : e.push(s.lineCopyToCharts)), e.push(s.lineRemove), t.additionalActions))
                                for (e.push(new b), d = t.additionalActions(n.model()), p = 0; p < d.length; p++) e.push(d[p]);
                            u = w.createMenu(e), a(u)
                        }).call(this, i(3))
                    }()
                })
            }, o.prototype._tradingDrawingsContextMenu = function(t) { return w.createMenu(t.contextMenuItems()) }, o.prototype._chartEventsContextMenu = function(t) { var i, o, n, s = []; return e.enabled("property_pages") && (i = this._chart, o = new v({ text: $.t("Format..."), enabled: !0 }), o.callbacks().subscribe(this, function(t) { TVSettings.setValue("properties_dialog.active_tab.chart", $.t("Events & Alerts")), i.showChartProperties() }), s.push(o)), n = new v({ text: $.t("Hide Events on Chart"), enabled: !0 }), n.callbacks().subscribe(this, function(e) { t.properties().visible.setValue(!1) }), s.push(n), w.createMenu(s) }, o.prototype._createAlertToggleHorzLineLabelAction = function(t) {
                var e = t.properties().line.visible,
                    i = new v({
                        checkable: !0,
                        text: $.t("Extend Alert Line"),
                        enabled: !0,
                        checked: e.value()
                    });
                return i.callbacks().subscribe(this, function(t) {
                    var i = t.checked,
                        o = i ? $.t("Show alert label line") : $.t("Hide alert label line");
                    this._chart.model().setProperty(e, i, o)
                }), i.setEnabled(t.globalProperties().line.visible.value()), i
            }, o.prototype._createShowGlobalAlertPropertiesLabelAction = function(t) {
                var e = this.chart(),
                    i = new v({ text: $.t("Visual settings...") });
                return i.callbacks().subscribe(this, function(t) { e.showChartProperties({ selectAlertEvent: !0 }) }), i
            }, o.prototype._createEditAlertDrawingAction = function(t) { if (t.hasAlert.value()) { var e = new v({ text: $.t("Edit {0} Alert...").format(t.title()) }); return e.callbacks().subscribe(null, function() { runOrSignIn(function() { t.editAlert() }, { source: "Alert edit from pane context menu" }) }), e } }, o.prototype.cloneLineTool = function(t, e) { return this._chart.model().cloneLineTool(t, e) }, o.prototype.setPriceAxisSize = function(t, e) { this._priceAxisWidget(t).setSize(e) }, o.prototype.setPriceAxisVisible = function(t, e) { this._priceAxisWidget(t).setVisible(e), this._cachedStatus = null }, o.prototype.resetPriceAxisOptimalWidth = function(t) { this._priceAxisWidget(t).resetOptimalWidth(), this._cachedStatus = null }, o.prototype.setSize = function(t) { this.size && this.size.equals(t) || (this.size = t, k(this.canvas, t), k(this.top_canvas, t), this.ctx = this.canvas.getContext("2d"), this.jqPane.width(t.w), this.jqPane.height(t.h), this._cachedStatus = null, this.jqRow.toggleClass("js-hidden", 0 === t.h)) }, o.prototype.dataSourceAtPoint = function(t, e) {
                var i, o, s, r, a, l, h, c, d, p, u, _, f, m, g, v = null,
                    y = null;
                if (!this._state) return null;
                for (i = this._state.hitTestSources(), o = i.length; 0 < o--;)
                    if (s = i[o], r = s.paneViews(this._state))
                        for (a = r.length; 0 < a--;)(l = r[a].renderer(e)) && l.hitTest && (h = l.hitTest(new n.Point(t, e))) && (c = y ? y.result() : 0, h.result() > c && (y = h, v = s));
                if (this.containsMainSeries()) {
                    for (d = this._chart.model().barsMarksSources(), o = 0; o < d.length; ++o)
                        for (s = d[o], r = s.paneViews(), a = 0; a < r.length; a++)
                            if (l = r[a].renderer(e), p = l.hitTest(new n.Point(t, e))) { y = p, v = s; break }
                    u = this._chart.model().activeStrategySource().value(), _ = u && u._strategyOrdersPaneView, _ && (f = _.renderer()) && (m = f.hitTest(new n.Point(t, e))) && (y = m, v = u)
                }
                return null === v && (v = this.legendWidget.dataSourceAtPoint(t, e)), g = this._chart.model().brandingSource(), g && (m = g.hitTest(new n.Point(t, e))) && (y = m, v = g), { source: v, hittest: y }
            }, o.prototype.update = function() { this.lhsPriceAxisWidget.update(), this.rhsPriceAxisWidget.update(), this.legendWidget.update(), this.paneControls && this.paneControls.update() }, o.prototype.updateControls = function() { this.paneControls && this.paneControls.update() }, o.prototype.drawBackground = function(t, e) { I(t, 0, 0, this.size.w, this.size.h, e) }, o.prototype.drawGrid = function(t) {
                var e, i, o = this._chart.model().gridSource(),
                    n = o.paneViews(this._state);
                for (e = 0; e < n.length; e++) t.save(), i = n[e].renderer(t.canvas.height), i && i.draw(t), t.restore()
            }, o.prototype.drawWatermark = function(t) {
                var e, i, o = this._chart.model().watermarkSource(),
                    n = o.paneViews(this._state);
                for (e = 0; e < n.length; e++) t.save(), i = n[e].renderer(t.canvas.height), i && i.draw(t), t.restore()
            }, o.prototype.drawBranding = function(t) {
                var e, i, o, n = this._chart.model().brandingSource();
                if (n)
                    for (e = n.paneViews(this._state), i = 0; i < e.length; i++)(o = e[i].renderer()) && (t.save(), o.draw(t), t.restore())
            }, o.prototype.drawCrossHair = function(t) {
                var e = this._chart.model().crossHairSource();
                e.visibleTrap && (!e.visible && S.lockTimeAxis().value() && (e.setLockedPosition(this._state), e.updateAllViews()), this._drawSource(e, t))
            }, o.prototype._drawSource = function(t, e) {
                var i, o, n = t.paneViews(this._state);
                if (n)
                    for (i = 0; i < n.length; i++)(o = n[i].renderer(e.canvas.height)) && (e.save(), o.draw(e), e.restore())
            }, o.prototype._drawSourceStrategyOrders = function(t, e) {
                var i, o = t._strategyOrdersPaneView;
                o && (i = o.renderer()) && (e.save(), i.draw(e), e.restore())
            }, o.prototype._drawSourceBackground = function(t, e) {
                var i, o, n = t.paneViews(this._state);
                if (n)
                    for (i = 0; i < n.length; i++)(o = n[i].renderer(e.canvas.height)) && o.drawBackground && (e.save(), o.drawBackground(e), e.restore())
            }, o.prototype.drawActiveLineTool = function(t) { var e, i, o = [this._chart.model().lineBeingCreated(), this._chart.model().sourceBeingMoved(), this._chart.model().lineBeingEdited()]; for (e = 0; e < o.length; e++)(i = o[e]) && this._chart.model().paneForSource(i) === this._state && this._drawSource(i, t) }, o.prototype.disableDrawOnTop = function(t) { return t && t.hasOwnProperty("_metaInfo") && "Volume@tv-basicstudies" === t._metaInfo.id }, o.prototype.drawSources = function(t) {
                var e, i, o, n, s = this._state.orderedSources(),
                    r = this._state.model(),
                    a = this._chart.model().selectedSource(),
                    l = this._chart.model().hoveredSource(),
                    h = r.crossHairSource(),
                    c = [this._chart.model().lineBeingCreated(), this._chart.model().sourceBeingMoved(), this._chart.model().lineBeingEdited()];
                for (this.disableDrawOnTop(a) && (a = void 0), this.disableDrawOnTop(l) && (l = void 0), e = this._chart.model().model().panes(), i = e.length - 1; i >= 0; i--) e[i].createDrawingsCaches();
                for (i = 0; i < s.length; i++) this._drawSourceBackground(s[i], t);
                for (i = 0; i < s.length; i++)(o = s[i]) !== h && o !== a && o !== l && -1 === c.indexOf(o) && this._drawSource(o, t);
                for (a && -1 === c.indexOf(a) && -1 !== s.indexOf(a) && this._drawSource(a, t), l && -1 === c.indexOf(l) && -1 !== s.indexOf(l) && this._drawSource(l, t), n = this._chart.model().activeStrategySource().value(), n && this.containsMainSeries() && this._drawSourceStrategyOrders(n, t), i = e.length - 1; i >= 0; i--) e[i].clearDrawingCaches()
            }, o.prototype.recalculatePriceScale = function() { var t, e, i, o = this._state; for (o.recalculatePriceScale(o.m_rightPriceScale), o.recalculatePriceScale(o.m_leftPriceScale), t = o.dataSources(), e = 0; e < t.length; ++e) i = t[e], o.isOverlay(i) && (i instanceof p || o.recalculatePriceScale(i.priceScale()), i.updateAllViews()) }, o.prototype.containsMainSeries = function() { return this._state.containsMainSeries() }, o.prototype.drawBarsMarks = function(t, e) {
                var i, o;
                this.containsMainSeries() && !e && (i = this._chart.model().barsMarksSources(), o = this, i.forEach(function(e) { o._drawSource(e, t) }))
            }, o.prototype._syncOverlays = function() {
                var t, e, i = this._state.orderedSources(),
                    o = {},
                    n = this;
                $.each(i, function() {
                    var t, e, i = this.paneViews(n._state);
                    if (i)
                        for (t = 0; t < i.length; t++) e = i[t], e.uid && (o[e.uid()] = e)
                });
                for (t in this._overlays) o[t] || (this._dv.remove(this._overlays[t]),
                    this._overlays[t] = void 0);
                for (t in o) this._overlays[t] || (e = o[t].overlay(), this._dv.append(e), this._overlays[t] = e)
            }, o.prototype.paint = function(t, e) {
                if (t && this._chart.model())
                    if (this.lhsPriceAxisWidget.paint(t), this.rhsPriceAxisWidget.paint(t), t === x.FULL_UPDATE && (this._cachedStatus = null), t === x.UPDATE_CURSOR_ONLY) this.top_ctx.clearRect(-.5, -.5, this.size.w, this.size.h), this.drawCrossHair(this.top_ctx), this.drawActiveLineTool(this.top_ctx);
                    else {
                        var i = this.ctx;
                        this.top_ctx.clearRect(-.5, -.5, this.size.w, this.size.h), this.drawBackground(i, this.backgroundColor()), this._state && (this.recalculatePriceScale(), this.drawGrid(i), this.drawWatermark(i), this.drawSources(i), this.drawBarsMarks(i, e), this.drawCrossHair(this.top_ctx), this.drawActiveLineTool(this.top_ctx), this.drawBranding(i))
                    }
            }, o.prototype.leftPriceAxisWidget = function() { return this.lhsPriceAxisWidget }, o.prototype.rightPriceAxisWidget = function() { return this.rhsPriceAxisWidget }, o.prototype._priceAxisWidget = function(t) { return h.isLeft(t) ? this.lhsPriceAxisWidget : this.rhsPriceAxisWidget }, o.prototype.statusWidget = function() { return this.legendWidget }, o.prototype.onScaleLeft = function(t) { var e = t.callbackContext(); - 1 === this._state.leftPriceScale().dataSources().indexOf(e) && this.chart().model().move(e, this._state, this._state.leftPriceScale()) }, o.prototype.onScaleRight = function(t) { var e = t.callbackContext(); - 1 === this._state.rightPriceScale().dataSources().indexOf(e) && this.chart().model().move(e, this._state, this._state.rightPriceScale()) }, o.prototype.onNoScale = function(t) {
                var e = t.callbackContext();
                this._state.isOverlay(e) || this.chart().model().move(e, this._state, null)
            }, o.prototype.onRiskReward = function(t) {}, o.prototype.createActionRiskReward = function(t) { var e = new v({ checkable: !1, text: $.t("Risk/Reward"), enabled: !0 }); return e.setCallbackContext(t), e.callbacks().subscribe(this, o.prototype.onRiskReward), e }, o.prototype.createActionScaleLeft = function(t) { var e = new v({ checkable: !0, text: $.t("Scale Left"), enabled: !0 }); return e.setCallbackContext(t), e.setChecked(-1 !== this._state.leftPriceScale().dataSources().indexOf(t)), e.callbacks().subscribe(this, o.prototype.onScaleLeft), e }, o.prototype.createActionScaleRight = function(t) { var e = new v({ checkable: !0, text: $.t("Scale Right"), enabled: !0 }); return e.setCallbackContext(t), e.setChecked(-1 !== this._state.rightPriceScale().dataSources().indexOf(t)), e.callbacks().subscribe(this, o.prototype.onScaleRight), e }, o.prototype.createActionNoScale = function(t) {
                var e = this._chart.model().paneForSource(t),
                    i = e.actionNoScaleIsEnabled(t),
                    n = new v({ checkable: !0, text: $.t("Screen (No Scale)"), enabled: i });
                return n.setCallbackContext(t), n.setChecked(this._state.isOverlay(t)), n.callbacks().subscribe(this, o.prototype.onNoScale), n
            }, o.prototype.createActionShowCountdown = function(t) {
                var e = i(5).ActionBinder,
                    o = new v({ checkable: !0, text: $.t("Show Countdown"), enabled: !0 }),
                    n = this._chart.model().mainSeries().properties();
                return o._binding = new e(o, n.showCountdown, this._chart.model(), o.text), o._binding.setValue(n.showCountdown.value()), o
            }, o.prototype.createActionLockScale = function(t) {
                var e, o, n = i(5).ActionBinder;
                return t instanceof TradingView.Series ? (e = new v({ checkable: t.properties().lockScale.value(), text: $.t("Lock Scale"), enabled: !0 }), o = function(e) { this._undoModel.setLockScaleProperty(this._property, e.checked, t, this._undoText) }, e._binding = new n(e, t.properties().lockScale, this._chart.model(), e.text, o), e) : null
            }, o.prototype.createActionMergeUp = function(t) { var e; return this._chart.model().paneForSource(t) === this._chart.model().panes()[0] ? null : (e = new v({ checkable: !1, text: $.t("Merge Up"), enabled: !0 }), e.setCallbackContext(t), e.callbacks().subscribe(this, o.prototype.onMergeUp), e) }, o.prototype.onMergeUp = function(t) {
                var e = t.callbackContext(),
                    i = this._chart.model().paneForSource(e),
                    o = this._chart.model().panes().indexOf(i),
                    n = this._chart.model().panes()[o - 1],
                    s = n.findSuitableScale(e);
                this._chart.model().move(e, n, s)
            }, o.prototype.createActionUnmergeUp = function(t) { var e; return this._chart.model().paneForSource(t).dataSources().filter(function(t) { return TradingView.isInherited(t.constructor, m) && t.showInObjectTree() }).length > 1 ? (e = new v({ checkable: !1, text: $.t("Unmerge Up"), enabled: !0 }), e.setCallbackContext(t), e.callbacks().subscribe(this, o.prototype.onUnmergeUp), e) : null }, o.prototype.onUnmergeUp = function(t) {
                var e = t.callbackContext(),
                    i = this._chart.model().paneForSource(e),
                    o = this._chart.model().panes().indexOf(i),
                    n = this._chart.model().createPane(o),
                    s = n.findSuitableScale(e);
                this._chart.model().move(e, n, s)
            }, o.prototype.createActionMergeDown = function(t) {
                var e, i = this._chart.model().paneForSource(t),
                    n = this._chart.model().panes();
                return i === n[n.length - 1] ? null : (e = new v({ checkable: !1, text: $.t("Merge Down"), enabled: !0 }), e.setCallbackContext(t), e.callbacks().subscribe(this, o.prototype.onMergeDown), e)
            }, o.prototype.onMergeDown = function(t) {
                var e = t.callbackContext(),
                    i = this._chart.model().paneForSource(e),
                    o = this._chart.model().panes().indexOf(i),
                    n = this._chart.model().panes()[o + 1],
                    s = n.findSuitableScale(e);
                this._chart.model().move(e, n, s)
            }, o.prototype.createActionUnmergeDown = function(t) { var e; return this._chart.model().paneForSource(t).dataSources().filter(function(t) { return TradingView.isInherited(t.constructor, m) && t.showInObjectTree() }).length > 1 ? (e = new v({ checkable: !1, text: $.t("Unmerge Down"), enabled: !0 }), e.setCallbackContext(t), e.callbacks().subscribe(this, o.prototype.onUnmergeDown), e) : null }, o.prototype.onUnmergeDown = function(t) {
                var e = t.callbackContext(),
                    i = this._chart.model().paneForSource(e),
                    o = this._chart.model().panes().indexOf(i),
                    n = this._chart.model().createPane(o + 1),
                    s = n.findSuitableScale(e);
                this._chart.model().move(e, n, s)
            }, o.prototype._mergeContentMenuItems = function(t) {
                var e = [],
                    i = this.createActionMergeUp(t);
                return i && e.push(i), i = this.createActionUnmergeUp(t), i && e.push(i), i = this.createActionMergeDown(t), i && e.push(i), i = this.createActionUnmergeDown(t), i && e.push(i), e
            }, o.prototype.createActionShow = function(t) {
                var e = i(5).ActionBinder,
                    o = new v({ checkable: !0, text: $.t("Show"), enabled: !0 });
                return o._binding = new e(o, t.properties().visible, this._chart.model(), o.text), o._binding.setValue(t.properties().visible.value()), o
            },
            o.prototype.createActionAddChildStudy = function(t) {
                var e = new v({ text: $.t("Apply Indicator on {0} ...").format(t.title(!0)), enabled: !0 });
                return e.callbacks().subscribe(this, function() {
                    var e, i, o = this._chart.showIndicators(t);
                    o && (e = function() { f("SOS", "Apply SOS", "Apply by RC menu") }, i = this._chart.model().model().studyInserted(), i.subscribe(this, e), o.visibilityChanged.subscribe(this, function(t) { t || i.unsubscribe(this, e) }, !0))
                }), e
            }, o.prototype.bringObjectForward = function(t) {
                var e = this._chart.model().selectedSource();
                e && this._chart.model().changeZOrder(e, 1)
            }, o.prototype.sendObjectToBack = function(t) {
                var e = this._chart.model().selectedSource();
                e && this._chart.model().sendToBack(e)
            }, o.prototype.bringObjectToFront = function(t) {
                var e = this._chart.model().selectedSource();
                e && this._chart.model().bringToFront(e)
            }, o.prototype.sendObjectBackward = function(t) {
                var e = this._chart.model().selectedSource();
                e && this._chart.model().changeZOrder(e, -1)
            }, o.prototype.createVisualOrderAction = function(t) { var e, i, n, s, r, a, l = new v({ text: $.t("Visual Order") }); return l.subActions || (l.subActions = []), e = new v({ text: $.t("Bring to Front") }), e.callbacks().subscribe(this, o.prototype.bringObjectToFront), l.subActions.push(e), i = new v({ text: $.t("Send to Back") }), i.callbacks().subscribe(this, o.prototype.sendObjectToBack), l.subActions.push(i), n = new v({ text: $.t("Bring Forward") }), n.callbacks().subscribe(this, o.prototype.bringObjectForward), l.subActions.push(n), s = new v({ text: $.t("Send Backward") }), s.callbacks().subscribe(this, o.prototype.sendObjectBackward), l.subActions.push(s), r = this._chart.model().paneForSource(t), a = r.getZOrderMinMax(), i.setEnabled(!0), n.setEnabled(!0), s.setEnabled(!0), e.setEnabled(!0), t.zorder() === a.minZOrder && (i.setEnabled(!1), s.setEnabled(!1)), t.zorder() === a.maxZOrder && (n.setEnabled(!1), e.setEnabled(!1)), l }, o.prototype.image = function() { var t = {}; return t.leftAxis = this.leftPriceAxisWidget().image(), t.rightAxis = this.rightPriceAxisWidget().image(), t.content = this.canvas.toDataURL(), t.contentWidth = this.size.w, t.contentHeight = this.size.h, t }, o.prototype._updateTooltip = function(t, e) {
                if (!this._rafSet) {
                    var i = this;
                    requestAnimationFrame(function() { i._updateTooltipImpl(t, e), i._rafSet = !1 }), this._rafSet = !0
                }
            }, o.prototype._updateTooltipImpl = function(t, e) {
                function i(i) {
                    function n() { return TradingView.isMobile.any() ? { left: t - o._tooltipSelector.outerWidth() - 16, top: e - o._tooltipSelector.outerHeight() - 16 } : { left: t + 16, top: e + 16 } }
                    TradingView[s].getTooltipText && (i = TradingView[s].getTooltipText(l) || i), o._tooltipSelector.html(i).removeClass("tooltip-selector-hidden").css(n())
                }
                var o, n, s, r, l, h;
                if (this._chart) {
                    for (o = this, n = this._chart.paneWidgets(), s = S.tool.value(), r = this._state.model(), l = r.lineBeingCreated(), h = n.length - 1; h >= 0; h--) n[h]._hideTooltip();
                    a.isStudyLineTool(s) && !TradingView.isMobile.any() ? i($.t("Click to set a point")) : TradingView.isMobile.any() && "LineToolBrush" !== s && o.isLineTool(s) && !o._chart.model().lineBeingCreated() ? i($.t("1. Slide your finger to select location for first anchor<br>2. Tap anywhere to place the first anchor")) : TradingView.isMobile.any() && "LineToolBrush" !== s && o.isLineTool(s) && i($.t("1. Slide your finger to select location for next anchor<br>2. Tap anywhere to place the next anchor"))
                }
            }, o.prototype._hideTooltip = function() { this._tooltipSelector.addClass("tooltip-selector-hidden") }, o.prototype._updateCrosshairOnZoom = function() {
                var t, e;
                S.lockTimeAxis().value() && (t = this._chart.model(), e = t.crossHairSource(), e.setPosition(e.index, e.price, this._state))
            }, t.exports = o
    }).call(e, i(3))
}, function(t, e, i) {
    (function(e, o) {
        "use strict";

        function n(t, o, a) {
            function l() { o.metaInfo.name.value() || _._readOnly ? _.setTitle(o.metaInfo.name.value()) : _.hideTitle() }
            var h, c, _;
            a = $.extend({ popupDirection: "up", popupReverse: !1 }, a || {}), this._options = a, this.onTitleSizeChanged = new e, this._container = t = $(t), this._chartWidgetCollection = o, this._readOnly = o.readOnly(), this._savedCharts = [], this._editEnabled = !0, this.loadChartDialog = new d, h = "\n.", this._load = $('<span class="load button first apply-common-tooltip"></span>').append($(i(852))).attr("title", $.t("Load Chart Layout") + h).click(this.signInOrLoadChart.bind(this)).appendTo(t), this._title = $('<span class="title apply-common-tooltip"></span>'), a.hideChartTitle && this._title.hide(), this._sep = $("<span>").addClass("separator"), this._optionsMenu = $('<span class="button with-arrow options last">').append($("<span>").addClass("arrow-icon")), p(this._optionsMenu, this._getSavedCharts.bind(this), { direction: a.popupDirection, reverse: a.popupReverse, notCloseOnButtons: !0, popupSpacing: a.popupSpacing }), this._readOnly ? (this._save = $(), this._copy = $('<span class="copy">' + $.t("Copy") + "</span>").appendTo(t).click(this.cloneChart.bind(this)), this._title.addClass("read-only"), this._titleReadOnly = $("<span>").addClass("read-only").appendTo(this._title), this._sep.appendTo(this._copy), this._optionsMenu.hide()) : (c = $.t("Save Chart Layout saves not just some particular chart, it saves all charts for all symbols and intervals which you are modifying while working with this Layout"), this._save = $('<span class="save button apply-common-tooltip"></span>').attr("title", c).append($(i(900))).appendTo(t).click(this.signInOrSaveChart.bind(this, null, null, null)), this._copy = $(), this._titleInput = $('<span type="text" maxlength="80">').appendTo(this._title), this._title.bind("click", this._renameChart.bind(this)), this._title.attr("title", $.t("Rename Chart Layout")), this._titleSize = $('<span class="sizer">').appendTo(this._title), this._sep.appendTo(this._save)), this._title.appendTo(t), this._optionsMenu.appendTo(t), this._savecopy = $().add(this._save).add(this._copy).mousedown(function(t) {
                    if (t.button) return !1;
                    this._save.addClass("active")
                }.bind(this)).mouseup(function() { this._save.removeClass("active") }.bind(this)), _ = this, o.metaInfo.name.subscribe(function() { l() }), l(),
                this._setChanges(!1), r.subscribe("chart_loaded", function() { this._setChanges(!1) }.bind(this)), loginStateChange.subscribe(this, this._refreshSavedChartsList), m.on("saved-charts-change", this._otherTabUpdated.bind(this)), m.on("saved-charts-change-favorites", this._favoritesUpdated.bind(this)), s.undoStack().onChange().subscribe(this, function() {
                    var t = s.undoStack().head();
                    t && t.customFlag("doesnt_affect_save") || (this._setChanges(!0), this.autosave())
                }), u.registerListener("LoadChartDialogHotkey", function(t) { return !t.ctrlKey && (!(46 !== t.which || !$(t.target).is("body")) && (this.loadMenu(), t.preventDefault(), t.stopPropagation(), !0)) }.bind(this)), this.favorites = TVSettings.getJSON(n.FAVORITES_KEY, {}), window.saver.chartSaved().subscribe(this, n.prototype._onChartSaved), window.saver.chartAboutToBeSaved().subscribe(this, n.prototype._onChartAboutToBeSaved)
        }
        var s = i(53).UndoHistory,
            r = i(34),
            a = i(116),
            l = i(139),
            h = l.SaveRenameDialog,
            c = l.InputField,
            d = i(651),
            p = i(63).bindPopupMenu,
            u = i(140),
            _ = i(33).trackEvent,
            f = i(540).deleteChart,
            m = i(128).TVXWindowEvents,
            g = i(12).getLogger("Chart.SaveLoadWidget");
        n.FAVORITES_KEY = "loadChartDialog.favorites", n.prototype._favoritesUpdated = function(t) { this.favorites = JSON.parse(t), this.loadChartDialog.updateFavoritesData(this.favorites) }, n.prototype._otherTabUpdated = function(t) { this._savedCharts = JSON.parse(t), this.loadChartDialog.updateChartsData(this._getLoadMenuCharts()) }, n.prototype._renameChart = function() {
            var t = this,
                e = "text",
                i = new h({ fields: [new c({ name: e, label: $.t("Enter a new chart layout name") + ":", error: $.t("Please enter chart layout name"), maxLength: 64 })], title: $.t("Rename Chart Layout") });
            t._editEnabled && (i.setField(e, this.getTitle()), i.show().then(function(i) { t.setTitle(i[e]), t.saveChart() }))
        }, n.prototype._setTitle = function(t) { this._titleInput.text(t), this._titleValue = t, this._savecopy.removeClass("last").addClass("titled"), t ? this._options.hideChartTitle || (this._optionsMenu.show(), this._title.show()) : (this._optionsMenu.hide(), this._title.hide(), this._savecopy.addClass("last").removeClass("titled")), this._setInputSize(), this._setChanges(!0) }, n.prototype._setReadOnlyTitle = function(t) { this._titleReadOnly.html(t).attr("title", t.replace(/<[^>]+>/g, "")), this._savecopy.removeClass("last").addClass("titled"), this._title.addClass("last"), this._options.hideChartTitle || this._title.show() }, n.prototype.setTitle = function(t) {
            if (this._readOnly) {
                var e = TradingView.clean(this._chartWidgetCollection.metaInfo.username.value());
                t = (t ? TradingView.clean(t) + ": " : "") + "view-only chart by " + '<a href="/u/%1/">%1</a>'.replace(/%1/g, e), this._setReadOnlyTitle(t)
            } else this._setTitle(t)
        }, n.prototype.hideTitle = function() { this._title.hide(), this._optionsMenu.hide(), this._titleInput.text(""), this._savecopy.removeClass("titled").addClass("last") }, n.prototype.getTitle = function() { return this._titleValue }, n.prototype._setInputSize = function() { this._titleSize.text(this._titleInput.text()), this._titleInput.width(this._titleSize.width()), this.onTitleSizeChanged.fire() }, n.prototype.cloneChart = function() {
            var t, e, i, n = this;
            o.enabled("save_old_chart_before_save_as") && this._chartWidgetCollection.metaInfo.id.value() && this._saveChart(), t = "text", e = new h({ fields: [new c({ name: t, label: $.t("Enter a new chart layout name") + ":", error: $.t("Please enter chart layout name"), maxLength: 64 })], title: $.t("Copy Chart Layout") }), i = n._chartWidgetCollection.metaInfo.name.value(), e.setField(t, i ? window.t("{0} copy").format(i) : ""), e.show().then(function(e) { o.enabled("saved_charts_count_restriction") && !user.is_pro && n._savedCharts.length >= 5 ? goProDialog({ feature: "savedChartsLimit" }).open() : o.enabled("saveload_storage_customization") ? (n._chartWidgetCollection.metaInfo.uid.setValue(void 0), n._chartWidgetCollection.metaInfo.id.setValue(void 0), n.setTitle(e[t]), n.saveChart()) : window.open("/chart/?clone=" + n._chartWidgetCollection.metaInfo.uid.value() + "&name=" + encodeURIComponent(e[t]), "_blank") })
        }, n.prototype._setChanges = function(t) { t = !!t, this._haveChanges = t, !t && this.getTitle() ? this._save.addClass("no-change") : this._save.removeClass("no-change") }, n.prototype._process = function(t) { t = !!t, t ? this._save.addClass("process") : this._save.removeClass("process") }, n.prototype._onChartAboutToBeSaved = function() { this._saving = !0, this._process(!0), this._editEnabled = !1 }, n.prototype._onChartSaved = function(t) { this._stopProcess(), t && this._setChanges(!1) }, n.prototype._stopProcess = function() { this._saving = !1, this._process(!1), this._editEnabled = !0 }, n.prototype._saveChart = function(t, e) { if (this._readOnly || this._saving) return void(e && e()); if (!this._haveChanges) return void(t && t()); try { window.saver.saveChartSilently(function() { "function" == typeof t && t.call(this) }, null, function() { "function" == typeof e && e.call(this) }) } catch (t) { this._stopProcess(), g.logError("Error while saving: " + t), e && e() } }, n.prototype._autosaveInterval = 6e4, n.prototype.autosave = function() { o.enabled("charts_auto_save") && (this._chartWidgetCollection.onfeatures || (this._autosaveTimer && (clearTimeout(this._autosaveTimer), this._autosaveTimer = 0), this._autosaveTimer = setTimeout(function() { this._chartWidgetCollection.metaInfo.id.value() && this._saveChart() }.bind(this), this._autosaveInterval))) }, n.prototype._goChartPage = function(t) { "/chart/" === location.pathname && (location.href = "/chart/" + t) }, n.prototype.saveChart = function(t, e, i) {
            var o, n, s;
            if (this._chartWidgetCollection.onfeatures) return void(e && e());
            o = this.getTitle(), o ? (this._chartWidgetCollection.metaInfo.name.setValue(o), t && t(), this._saveChart(function() { _("GUI", "Save Chart Layout"), this._goChartPage(this._chartWidgetCollection.metaInfo.uid.value()), e && e(), this._refreshSavedChartsList() }.bind(this), i)) : (n = "text", s = new h({ fields: [new c({ name: n, label: $.t("Chart layout name") + ":", maxLength: 64, error: $.t("Please enter chart layout name") })], title: $.t("Save New Chart Layout") }), s.show().then(function(o) { this.setTitle(o[n]), this.saveChart(t, e, i) }.bind(this)))
        }, n.prototype.signInOrSaveChart = function(t, e, i) { o.enabled("saveload_requires_authentication") ? runOrSignIn(this.saveChart.bind(this, t, e, i), { source: "Save chart", sourceMeta: "Chart" }) : this.saveChart(t, e, i) }, n.prototype.signInOrLoadChart = function() {
            o.enabled("saveload_requires_authentication") ? runOrSignIn(this.loadMenu.bind(this), { source: "Load chart", sourceMeta: "Chart" }) : this.loadMenu()
        }, n.prototype.signInOrRenameChart = function() { o.enabled("saveload_requires_authentication") ? runOrSignIn(this._renameChart.bind(this), { source: "Rename chart" }) : this._renameChart() }, n.prototype.signInOrSaveAs = function() { o.enabled("saveload_requires_authentication") ? runOrSignIn(this.cloneChart.bind(this), { source: "Clone chart" }) : this.cloneChart() }, n.prototype.saveChartByEnter = function(t) { 13 === t.keyCode && (this._titleInput.blur(), this.signInOrSaveChart()) }, n.prototype._refreshSavedChartsList = function(t) { o.enabled("saveload_requires_authentication") && !is_authenticated ? this._savedCharts = [] : a.getCharts(function(t) { this._savedCharts = t, m.emit("saved-charts-change", JSON.stringify(t)) }.bind(this)).then(function() { t && t() }) }, n.prototype._getSavedChartsList = function() { return this._savedCharts }, n.prototype._fastDelete = function(t, e) { this._savedCharts.splice(e, 1), t === this._chartWidgetCollection.metaInfo.id.value() && (o.enabled("saveload_storage_customization") ? (this._chartWidgetCollection.clearChartMetaInfo(), this.setTitle(void 0)) : location.href = "/chart/") }, n.prototype._getSavedCharts = function() { var t = []; return this.isSaved() && t.push({ title: this.getTitle(), disabled: !0, addClass: "save-load-chart-title" }), this._readOnly || (t.push({ title: $.t("Save Chart Layout"), action: this.signInOrSaveChart.bind(this, null, null, null) }), this.isSaved() && (t.push({ title: $.t("Save As..."), action: this.signInOrSaveAs.bind(this) }), t.push({ title: $.t("Rename..."), action: this.signInOrRenameChart.bind(this) }))), t }, n.prototype.isSaved = function() { return !!this.getTitle() }, n.prototype._getLoadMenuCharts = function() {
            var t = [],
                e = this,
                i = this._getSavedChartsList();
            return i.length && i.forEach(function(i, o) { t.push({ id: i.id, url: i.url, title: i.name, symbol: i.short_symbol, interval: i.interval, toolsCount: 0, modified: i.modified_iso, active: function() { return i.id === e._chartWidgetCollection.metaInfo.id.value() }, openAction: function() { a.loadChart(i) }, deleteAction: function(t, n) { f(n, i.image_url, function() { e._fastDelete(i.id, o), m.emit("saved-charts-change", JSON.stringify(e._savedCharts)), t.resolve() }, t.reject.bind(t)) }, favoriteAction: function(t) { e.favorites = t, TVSettings.setJSON(n.FAVORITES_KEY, t), m.emit("saved-charts-change-favorites", JSON.stringify(t)) } }) }), t
        }, n.prototype.loadMenu = function() {
            var t = this;
            this._load.addClass("process"), this._refreshSavedChartsList(function() { t._load.removeClass("process"), t.loadChartDialog.show(t._getLoadMenuCharts(), t.favorites) })
        }, t.exports = n
    }).call(e, i(15), i(3))
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t) {
            var i, o, r, a, h, c = this,
                d = this._chartWidget = t.chartWidget;
            this.$parent = t.parent, this._dateRangesPopupList = [], this._goToPopupBtn = [], this._iterativeHide = [], this._timeFormatter = new n, this._currentRange = window.urlParams && window.urlParams.range || "", this._$seriesControls = $(document.createElement("div")).attr("class", "chart-controls-bar-buttons chart-series-controls").appendTo(t.parent),
                this._$timezoneButton = $('<a class="apply-common-tooltip" title="' + $.t("Timezone") + '"><span class="chart-controls-clock"></span><span class="chart-controls-tz"></span></a>'), e.enabled("fundamental_widget") || this._$timezoneButton.appendTo(this._$seriesControls), !d.onWidget() && e.enabled("timezone_menu") ? l(c._$timezoneButton, function() { var t, e, i, o, n; if (d.updateActions(), t = [], !(e = d.actions()) || !e.applyTimeZone || !e.applyTimeZone.subActions) return t; for (i = e.applyTimeZone.subActions, o = 0; o < i.length; ++o) n = i[o], t.push({ action: n.enabled ? n.executeCallback.bind(n) : null, addClass: n.enabled ? "" : "special", disabled: !n.enabled, iconClass: n.checkable && n.checked ? "checked-icon" : "unchecked-icon", title: n.text }); return t }, { direction: "up", addClass: "context-menu" }) : this._$timezoneButton.addClass("disabled"), this._$timezoneClock = this._$timezoneButton.find(".chart-controls-clock"), this._$timezoneName = this._$timezoneButton.find(".chart-controls-tz"), d.onWidget() || e.enabled("charting_library_base") ? this._$extendedHoursButton = null : (this._$extendedHoursButton = $(document.createElement("a")).text($.t("ext")).attr("title", $.t("The Extended Trading Hours feature is available only for intraday charts")).addClass("apply-common-tooltip").appendTo(this._$seriesControls), this._iterativeHide.push(this._$extendedHoursButton)), this._$percButton = $(document.createElement("a")).text("%").attr("title", $.t("Toggle Percentage")).addClass("apply-common-tooltip").appendTo(this._$seriesControls), e.enabled("fundamental_widget") && (this._$percButton.css("display", "inline-block"), urlParams.percentage && this._$percButton.addClass("active")), this._iterativeHide.push(this._$percButton), this._$logButton = $(document.createElement("a")).text($.t("log")).attr("title", $.t("Toggle Log Scale")).addClass("apply-common-tooltip"), e.enabled("fundamental_widget") || this._$logButton.appendTo(this._$seriesControls), this._iterativeHide.push(this._$logButton), this._$autoScaleButton = $(document.createElement("a")).text($.t("auto", { context: "scale" })).attr("title", $.t("Toggle Auto Scale")).addClass("apply-common-tooltip"), e.enabled("fundamental_widget") || this._$autoScaleButton.appendTo(this._$seriesControls), this._iterativeHide.push(this._$autoScaleButton), i = null, e.enabled("main_series_scale_menu") && !e.enabled("fundamental_widget") && (i = $(document.createElement("a")).attr("title", $.t("Scales Properties")).addClass("apply-common-tooltip").appendTo(this._$seriesControls)), this._$fullscreenChartButton = $(document.createElement("a")).attr("title", $.t("Toggle Maximize Chart")).addClass("apply-common-tooltip").appendTo(this._$seriesControls), this._iterativeHide.push(this._$timezoneButton), o = "http://www.w3.org/2000/svg", r = $(document.createElementNS(o, "svg")).attr({ width: 12, height: 12 }).css({ fill: "currentColor", stroke: "none", margin: "1px" }), $(document.createElementNS(o, "desc")).text("SP").appendTo(r), $(document.createElementNS(o, "path")).attr({
                    d: "M 11.896733,5.4401 C 11.201602,5.2497118 10.287185,5.3844905 9.8529668,4.6739798 9.3680407,3.9899631 9.7713075,3.1150758 10.335646,2.6255445 10.81759,2.1397596 10.086625,1.2464141 9.5348331,1.5679918 9.0096065,2.0197899 8.3586515,2.5915907 7.6081884,2.2860159 6.8487054,2.0572252 6.6657258,1.2214292 6.6611579,0.52971682 6.6904416,-0.14270317 5.5547878,-0.19920111 5.3509206,0.33932112 5.3495604,1.0614071 5.216111,1.980668 4.4411277,2.2733721 3.718985,2.58432 3.0421913,2.0835985 2.5447076,1.6132218 2.019086,1.2075468 1.1733117,2.0525503 1.6258135,2.5522279 2.1291674,3.0522349 2.6067846,3.7947509 2.23627,4.5142319 1.9382627,5.2487851 1.0997484,5.3013165 0.42629601,5.3591295 -0.18586111,5.4121559 -0.1726988,6.614951 0.4382476,6.6606553 1.1701866,6.6354301 2.0901088,6.8653212 2.3114865,7.6677973 2.5690397,8.4182506 1.9757702,9.0009969 1.5707544,9.5375753 1.260194,10.111116 2.1887088,10.863746 2.6392394,10.30714 3.1282414,9.7691412 3.9518015,9.3917137 4.6315605,9.8249999 5.3287279,10.186762 5.2619381,11.018963 5.3869987,11.672161 5.5440075,12.215504 6.7794125,12.12358 6.6535582,11.446999 6.6654072,10.746236 6.9028479,9.8947057 7.6677558,9.6885901 8.4182253,9.4312024 9.000933,10.024446 9.5375381,10.429439 10.111007,10.739871 10.863873,9.8114259 10.307197,9.360908 9.7691358,8.8719351 9.3913098,8.0483184 9.8250144,7.3685614 10.18688,6.6714752 11.018948,6.7380091 11.672226,6.6131264 12.162952,6.4957229 11.998177,5.7860369 11.896733,5.4401 z M 5.999918,8.8061 C 4.4052236,8.8574703 3.0094365,7.3092614 3.2012542,5.7303585 3.3197775,4.2414555 4.7798203,3.0282413 6.2655218,3.2004993 7.7296227,3.3187202 8.9364572,4.7279379 8.805387,6.1941362 8.7186344,7.6148699 7.4347334,8.84471 5.999918,8.8061 z"
                }).appendTo(r), i && i.append(r), a = $(document.createElementNS(o, "svg")).attr({ width: 12, height: 12 }).css({ fill: "currentColor", stroke: "none", margin: "1px" }), a.get(0).setAttribute("viewBox", "0 0 24 24"), $(document.createElementNS(o, "desc")).text("FS").appendTo(a), $(document.createElementNS(o, "path")).attr({ d: "M0 0v9l3.5-3.5 4.5 4.5h2v-2l-4.5-4.5 3.5-3.5h-9zm15 0l3.5 3.5-4.5 4.5v2h2l4.5-4.5 3.5 3.5v-9h-9zm-7 14l-4.5 4.5-3.5-3.5v9h9l-3.5-3.5 4.5-4.5v-2h-2zm6 0v2l4.5 4.5-3.5 3.5h9v-9l-3.5 3.5-4.5-4.5h-2z" }).appendTo(a), this._$fullscreenChartButton.append(a), this._$percButton.on("click", function(t) {
                    var e, i, o, n;
                    t.preventDefault(), e = d.model(), i = e.mainSeries(), o = i.priceScale(), n = o.properties(), i.properties().lockScale.value() || (e.beginUndoMacro($.t("Toggle Percentage")), n.log.value() && e.setLogProperty(n.log, !1, o, $.t("Toggle Log Scale")), e.setPercentProperty(n.percentage, !n.percentage.value(), o, $.t("Toggle Percentage")), e.endUndoMacro())
                }), this._$logButton.on("click", function(t) {
                    var e, i, o, n;
                    t.preventDefault(), e = d.model(), i = e.mainSeries(), o = i.priceScale(), n = o.properties(), i.properties().lockScale.value() || (e.beginUndoMacro($.t("Toggle Log Scale")), n.percentage.value() && e.setPercentProperty(n.percentage, !1, o, $.t("Toggle Percentage")), e.setLogProperty(n.log, !n.log.value(), o, $.t("Toggle Log Scale")), e.endUndoMacro())
                }),
                this._$autoScaleButton.on("click", function(t) {
                    var e, i, o, n;
                    t.preventDefault(), e = d.model(), i = e.mainSeries(), o = i.priceScale(), n = o.properties(), e.beginUndoMacro($.t("Toggle Auto Scale")), n.autoScale.value() && n.percentage.value() && e.setPercentProperty(n.percentage, !1, o, $.t("Toggle Percentage")), e.setAutoScaleProperty(n.autoScale, !n.autoScale.value(), o, $.t("Toggle Auto Scale")), e.endUndoMacro()
                }), i && l(i, function() {
                    var t, e, i, o, n, r, a, l = d.paneWidgets();
                    for (t = 0; t < l.length; ++t)
                        if (e = l[t], e.containsMainSeries()) { if (i = [], !(o = e.getDefaultPriceAxisWidget())) return i; for (n = o.getContextMenuActions(), r = 0; r < n.length; ++r) a = n[r], a instanceof s ? i.push({ separator: !0 }) : i.push({ action: a.enabled ? a.executeCallback.bind(a) : null, addClass: a.enabled ? "" : "special", disabled: !a.enabled, iconClass: a.checkable && a.checked ? "checked-icon" : "unchecked-icon", title: a.text }); return i }
                    return []
                }, { direction: "up", addClass: "context-menu", reverse: !0 }), this._$extendedHoursButton && this._$extendedHoursButton.on("click", function(t) {
                    var e, i;
                    t.preventDefault(), e = d.model(), i = e.mainSeries().properties().extendedHours, e.setProperty(i, !i.value(), "Extended Hours")
                }), this._$dateRangesWrap = $(document.createElement("div")).addClass("chart-controls-bar-buttons date-range-wrapper").appendTo(t.parent), this._$dateRangesBtn = $(document.createElement("a")).addClass("date-range-btn").text($.t("Date Range")).appendTo(this._$dateRangesWrap), this._$dateRanges = $(document.createElement("div")).addClass("date-range-list").appendTo(this._$dateRangesWrap), d.withModel(null, function() {
                    var t = d.model(),
                        i = t.mainSeries(),
                        o = i.priceScale();
                    this.updateScaleButtons(), i.priceScaleChanged.subscribe(this, this.updateScaleButtons), o.properties().autoScale.subscribe(this, this.updateScaleButtons), this.updateDateRangeButtons(), i.onStatusChanged().subscribe(this, this.updateDateRangeButtons), e.enabled("update_timeframes_set_on_symbol_resolve") && i.onSymbolResolved().subscribe(this, this.updateDateRangeButtons), i.properties().lockScale.subscribe(this, this.updateDateRangeButtons), this.updateExtendedHoursButton(), i.properties().extendedHours.subscribe(this, this.updateExtendedHoursButton), i.properties().interval.subscribe(this, this.updateExtendedHoursButton), t.model().mainSeries().onSymbolResolved().subscribe(null, this.updateTimezonesButton.bind(this)), t.model().properties().timezone.subscribe(null, this.updateTimezonesButton.bind(this))
                }.bind(this)), this.updateFullscreenChartButton(), h = this._chartWidget._chartWidgetCollection, h && (h.layout.subscribe(this.updateFullscreenChartButton.bind(this)), h.maximizeCurrentChart.subscribe(this.updateFullscreenChartButton.bind(this)), this._$fullscreenChartButton.on("click", function() { h.activeChartWidget.setValue(d), h.maximizeCurrentChart.setValue(!h.maximizeCurrentChart.value()) }), this.checkTimezonesButton(h.activeChartWidget.value()), h.activeChartWidget.subscribe(this.checkTimezonesButton.bind(this))), d.onScroll().subscribe(this, this._resetCurrentRange), d.withModel(null, function() {
                    d.model().model().onResetScales().subscribe(c, c._resetCurrentRange),
                        d.model().mainSeries().onSymbolResolved().subscribe(c, c._resetCurrentRange), d.model().mainSeries().properties().extendedHours.subscribe(c, c._resetCurrentRange), d.model().mainSeries().onIntervalChanged().subscribe(null, function(t, e) { e && c._currentRange === e.timeframe || c._resetCurrentRange() })
                })
        }
        var n = i(122).TimeFormatter,
            s = i(47).ActionSeparator,
            r = i(375).parseTzOffset,
            a = i(63),
            l = a.bindPopupMenu,
            h = a.unbindPopupMenu;
        o.prototype._resetCurrentRange = function() { this._currentRange && (this._$dateRanges.find(".date-range-preset-btn").removeClass("active"), this._currentRange = null) }, o.prototype.updateScaleButtons = function() {
                var t = this._chartWidget.model().mainSeries(),
                    e = t.priceScale().properties(),
                    i = e.log.value(),
                    o = e.percentage.value(),
                    n = e.autoScale.value();
                this._$logButton.toggleClass("active", i), this._$percButton.toggleClass("active", o), this._$autoScaleButton.toggleClass("active", n)
            }, o.prototype.updateDateRangeButtons = function() {
                var t, e, i, o, n, s, r = this._chartWidget,
                    a = r.model().mainSeries().status();
                if (a !== TradingView.Series.STATUS_LOADING && a !== TradingView.Series.STATUS_RESOLVING) {
                    if (t = r._dateRangeResolutions(), e = function(t, e) { this._$dateRanges.find(".date-range-preset-btn").removeClass("active"), e.addClass("active"), this._currentRange = e.data("value"), r.model().loadRange(t) }, this._dateRangesPopupList = [], t.length)
                        for (this._$dateRanges.empty(), i = 0; i < t.length; i++) o = t[i], n = $(document.createElement("a")).text(o.text).attr("title", o.description || o.text).addClass("date-range-preset-btn apply-common-tooltip").data("value", o.value), o.value === this._currentRange && n.addClass("active"), s = e.bind(this, { val: o.value, res: o.targetResolution }, n), n.appendTo(this._$dateRanges).click(s), this._dateRangesPopupList.push({ title: o.description || o.text, action: s });
                    this.updateTimeframePopupMenu()
                }
            }, o.prototype.updateTimeframePopupMenu = function() { this._$dateRangesBtn.toggleClass("i-hidden", !(this._dateRangesPopupList.length || this._goToPopupBtn.length)), h(this._$dateRangesBtn), l(this._$dateRangesBtn, this._dateRangesPopupList.concat(this._goToPopupBtn), { direction: "up", addClass: "date-range-popupmenu" }), this.resizeUI() }, o.prototype.updateTimezonesButton = function() {
                var t, e, i;
                null !== this._chartWidget.model().mainSeries().symbolInfo() && (t = this._chartWidget.model().model().timezone(), "exchange" === t && (e = this._chartWidget.model().mainSeries().symbolInfo().timezone) && (t = e), i = r(t), this.tzOffset = i.offset, this._$timezoneName.text("(" + i.string + ")"), this.tickClock(), this.resizeUI())
            }, o.prototype.checkTimezonesButton = function(t) { this._$timezoneButton.toggleClass("i-invisible", t !== this._chartWidget), this.resizeUI() }, o.prototype.tickClock = function() { void 0 !== this.tzOffset && this._$timezoneClock.text(this._timeFormatter.format(new Date(Date.now() + this.tzOffset + 1e3 * ChartApiInstance.serverTimeOffset()))) }, o.prototype.updateExtendedHoursButton = function() { if (this._$extendedHoursButton) { this._chartWidget.model().mainSeries().properties().extendedHours.value() ? this._$extendedHoursButton.addClass("active") : this._$extendedHoursButton.removeClass("active"), this.resizeUI() } },
            o.prototype.updateFullscreenChartButton = function() {
                var t = this._chartWidget._chartWidgetCollection;
                if (!t || "s" === t.layout.value()) return void this._$fullscreenChartButton.addClass("i-hidden");
                this._$fullscreenChartButton.removeClass("i-hidden"), this._$fullscreenChartButton.toggleClass("active", t.maximizeCurrentChart.value()), this.resizeUI()
            }, o.prototype.updateUI = function() { this.updateScaleButtons(), this.resizeUI() }, o.prototype.resizeUI = function() {
                var t, e, i, o, n, s, r;
                if (this._$seriesControls && this._$dateRanges) {
                    for (this.$parent.addClass("i-measure"), t = this.$parent.width(), e = this._$dateRanges.width(), i = this._$dateRangesBtn.outerWidth(), o = 0, this._$seriesControls.find("a").each(function() {
                            var t = $(this);
                            t.hasClass("i-hidden") || (o += t.outerWidth())
                        }), n = o, s = 0; s < this._iterativeHide.length; s++) this._iterativeHide[s].hasClass("i-hidden") || (r = this._iterativeHide[s].outerWidth(), this._iterativeHide[s].toggleClass("i-compact", t - i < n), n -= r);
                    this._$dateRangesWrap.toggleClass("i-compact", e > t - o), this.$parent.removeClass("i-measure")
                }
            }, t.exports = o
    }).call(e, i(3))
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t) {
            function i() {
                var t = L.last();
                k.toolsGroupsHeight = t.offset().top + t.outerHeight()
            }
            var s, r, l, h, p, u, _, f, m, g, v, y, b, w, S, T, C, x, P, L, k = this;
            t = t || {}, this.options = t, a.init(), s = t.resizerBridge.body.value(), r = this._container = $("<div>", s).addClass("tv-side-toolbar").appendTo(s), this._heightWV = t.resizerBridge.height, this._chartWidgetCollection = t.chartWidgetCollection, this._container.on("contextmenu", function(t) { t.preventDefault() }), this._allToolGroups = [], this._toolsFilter = new o.ModernToolsFilter(t.drawingsAccess || { type: "black", tools: [] }), t.readOnly || (l = $("<div>").addClass("tools-group no-delimiter").appendTo(r), this._main = l, this.appendToolsGroup([{ tool: "cursor" }, { tool: "dot" }, { tool: "arrow" }, { tool: "eraser" }]), this.appendToolsGroup([{ tool: "LineToolTrendLine" }, { tool: "LineToolTrendAngle" }, { tool: "LineToolHorzLine", shortcut: { keys: "Alt+H", immediately: !0 } }, { tool: "LineToolHorzRay" }, { tool: "LineToolVertLine", shortcut: { keys: "Alt+V", immediately: !0 } }, { tool: "LineToolArrow" }, { tool: "LineToolRay" }, { tool: "LineToolExtended" }, { tool: "LineToolParallelChannel" }, { tool: "LineToolDisjointAngle" }, { tool: "LineToolFlatBottom" }]), this.appendToolsGroup([{ tool: "LineToolPitchfork" }, { tool: "LineToolSchiffPitchfork2" }, { tool: "LineToolSchiffPitchfork" }, { tool: "LineToolInsidePitchfork" }, { tool: "LineToolPitchfan" }, { tool: "LineToolGannSquare" }, { tool: "LineToolGannComplex" }, { tool: "LineToolGannFan" }, { tool: "LineToolFibRetracement" }, { tool: "LineToolTrendBasedFibExtension" }, { tool: "LineToolFibSpeedResistanceFan" }, { tool: "LineToolFibTimeZone" }, { tool: "LineToolTrendBasedFibTime" }, { tool: "LineToolFibCircles" }, { tool: "LineToolFibSpiral" }, { tool: "LineToolFibSpeedResistanceArcs" }, { tool: "LineToolFibWedge" }, { tool: "LineToolFibChannel" }]), this.appendToolsGroup([{ tool: "LineToolBrush" }, { tool: "LineToolRectangle" }, { tool: "LineToolRotatedRectangle" }, { tool: "LineToolEllipse" }, { tool: "LineToolTriangle" }, { tool: "LineToolPolyline" }, { tool: "LineToolBezierQuadro" }, { tool: "LineToolBezierCubic" }, { tool: "LineToolArc" }]),
                this.appendToolsGroup([{ tool: "LineToolText" }, { tool: "LineToolTextAbsolute" }, { tool: "LineToolNote" }, { tool: "LineToolNoteAbsolute" }, { tool: "LineToolCallout" }, { tool: "LineToolBalloon" }, { tool: "LineToolPriceLabel" }, { tool: "LineToolArrowMarkLeft" }, { tool: "LineToolArrowMarkRight" }, { tool: "LineToolArrowMarkUp" }, { tool: "LineToolArrowMarkDown" }, { tool: "LineToolFlagMark" }]), this.appendToolsGroup([{ tool: "LineTool5PointsPattern" }, { tool: "LineToolCypherPattern" }, { tool: "LineToolABCD" }, { tool: "LineToolTrianglePattern" }, { tool: "LineToolThreeDrivers" }, { tool: "LineToolHeadAndShoulders" }, { tool: "LineToolElliottImpulse" }, { tool: "LineToolElliottTriangle" }, { tool: "LineToolElliottTripleCombo" }, { tool: "LineToolElliottCorrection" }, { tool: "LineToolElliottDoubleCombo" }, { tool: "LineToolCircleLines" }, { tool: "LineToolTimeCycles" }, { tool: "LineToolSineLine" }]), this.appendToolsGroup([{ tool: "LineToolRiskRewardLong" }, { tool: "LineToolRiskRewardShort" }, { tool: "LineToolPrediction" }, { tool: "LineToolDateRange" }, { tool: "LineToolPriceRange" }, { tool: "LineToolDateAndPriceRange" }, { tool: "LineToolBarsPattern" }, { tool: "LineToolGhostFeed" }, { tool: "LineToolProjection" }]), this._toolsFilter.isToolEnabled("Font Icons") && (h = new this.Button(this.createIconActions(), { addClass: "font-awesome line-tool-icons-popup", buttonClass: "font-awesome" }, !0), this._icons = h, l.append(h.element()), this._allToolGroups.push(h)), p = $("<div>").addClass("tools-group").appendTo(r), u = new this.Button({ tool: "zoom", action: function() { a.tool.setValue("zoom") } }), p.append(u.element()), this._allToolGroups.push(u), k._chartWidgetCollection && (_ = new this.Button({
                    tool: "zoom-out",
                    action: function() {
                        var t, e = k._chartWidgetCollection;
                        e && (t = e.activeChartWidget.value().model()) && t.zoomFromViewport()
                    }
                }), p.append(_.element()), _.element().addClass("js-hidden"), function() {
                    function t() {
                        var i = k._chartWidgetCollection.activeChartWidget.value(),
                            o = i.model(),
                            n = !1;
                        o ? (e !== o && (e && e.zoomStack().onChange().unsubscribe(null, t), o.zoomStack().onChange().subscribe(null, t), e = o), n = !o.zoomStack().isEmpty()) : i.withModel(null, t), _.element().toggleClass("js-hidden", !n)
                    }
                    var e = null;
                    k._chartWidgetCollection.activeChartWidget.subscribe(t, { callWithLast: !0 })
                }()), f = new this.Button({ tool: "measure", action: function() { a.tool.setValue("measure") } }), p.append(f.element()), this._allToolGroups.push(f), m = $("<div>").addClass("tools-group").appendTo(r), g = !!a.properties().magnet.value(), v = new this.Button({ tool: "magnet", action: this.ToolbarActions.magnet.bind(this) }), this.magnet = v, m.append(v.element()), v.activate(g), a.properties().magnet.subscribe(this, function(t) { v.activate(t.value()) }), t.onWidget && !c.enabled("charting_library_base") || (g = !!a.properties().stayInDrawingMode.value(), y = new this.Button({ tool: "drawginmode", action: this.ToolbarActions.drawingmode.bind(this) }), this.drawingmode = y, m.append(y.element()), y.activate(g), a.properties().stayInDrawingMode.subscribe(this, function(t) { y.activate(t.value()) }), g = !!a.lockDrawings().value(), b = new this.Button({ tool: "lockAllDrawings", action: this.ToolbarActions.lockDrawings.bind(this) }), this.lockDrawings = b, m.append(b.element()), b.activate(g),
                    a.lockDrawings().subscribe(this, function(t) { b.activate(t.value()) }), g = !!a.hideAllDrawings().value(), w = new this.Button({ tool: "hideAllDrawings", action: this.ToolbarActions.hideAllDrawings.bind(this) }), this.hideAllDrawings = w, m.append(w.element()), w.activate(g), a.hideAllDrawings().subscribe(this, function(t) { w.activate(t.value()) }), c.enabled("support_multicharts") && (g = !!a.drawOnAllCharts().value(), S = new this.Button({ tool: "SyncDrawing", action: this.ToolbarActions.drawAllCharts.bind(this) }), this.drawOnAllCharts = S, m.append(S.element()), S.activate(g), a.drawOnAllCharts().subscribe(this, function(t) { S.activate(t.value()) })), T = $("<div>").addClass("tools-group").appendTo(r), this.removeAndObjectsTreeTools = T, C = new this.Button({ tool: "showObjectsTree", action: this.ToolbarActions.showObjectsTree.bind(this) }), this.showObjectsTree = C, T.append(C.element()), x = new this.Button({ tool: "removeAllDrawingTools", action: this.ToolbarActions.removeTools.bind(this) }), this.removeTools = x, T.append(x.element()), P = $("<div>").addClass("tools-group no-delimiter").appendTo(r), this.responsiveToolbar = new this.ResponsiveToolbar(this), P.append(this.responsiveToolbar.getButton().element())), t.onWidget || (this._favoriteDrawingToolbar = new n({ top: window.headerChartPanel.outerHeight() + 61, left: window.innerWidth / 2 }), this._favoriteDrawingToolbar.onButtonClicked().subscribe(null, function(t) { this._onLinetoolButtonClicked(t, !0) }.bind(this)))), t.readOnly || a.tool.subscribe(function(t) { this._syncView(t) }.bind(this), { callWithLast: !0 }), $(document).bind("keydown", "esc", function() { a.resetToCursor(!0) }), this._twoColumnLayout = !1, t.onWidget && !c.enabled("charting_library_base") || (L = r.find(".tools-group"), i(), this._heightWV.subscribe(this.updateToolsVisibility.bind(this), { callWithLast: !0 })), this.visible = new e, this.visible.subscribe(this, function(t) { this._fold(!t.value()), this.$panelClose && this.$panelClose.prop("title", this.getVisibilityChangeText(t.value())), TVSettings.setValue("ChartSideToolbarWidget.visible", t.value()) }), this.visible.setValue("boolean" == typeof t.forceVisible ? t.forceVisible : TVSettings.getBool("ChartSideToolbarWidget.visible", !0)), this.$panelClose = $('<a href="#" class="tv-close-panel left" title="' + this.getVisibilityChangeText(this.visible.value()) + '"></a>'), this.$panelClose.on("click", function(t) {
                var e, i = this.activeChartWidget().model();
                i && (e = this.visible.value(), this.$panelClose.prop("title", this.getVisibilityChangeText(!e)), i.setProperty(this.visible, !e, this.getVisibilityChangeText(e)), d.emit("toggle_sidebar", !e), t.preventDefault())
            }.bind(this)).appendTo(r)
        }
        var n = i(733).FavoriteDrawingToolbar,
            s = i(118),
            r = i(366),
            a = i(42),
            l = i(217).lineToolsInfo,
            h = i(372).LinetoolsFavoritesStore,
            c = i(3),
            d = i(34),
            p = i(63).bindPopupMenu,
            u = i(7).saveDefaultProperties;
        i(524), o.prototype.favoriteDrawingToolbar = function() { return this._favoriteDrawingToolbar }, o.prototype.updateToolsVisibility = function() {
                var t = this._heightWV.value() < this.toolsGroupsHeight + 10;
                t !== this._twoColumnLayout && (this.magnet.element().toggleClass("js-hidden", t), this.drawingmode.element().toggleClass("js-hidden", t),
                    this.lockDrawings.element().toggleClass("js-hidden", t), this.hideAllDrawings.element().toggleClass("js-hidden", t), this.drawOnAllCharts && this.drawOnAllCharts.element().toggleClass("js-hidden", t), this.showObjectsTree.element().toggleClass("js-hidden", t), this.removeTools.element().toggleClass("js-hidden", t), this.removeAndObjectsTreeTools.toggleClass("js-hidden", t), this.responsiveToolbar.getButton().element().toggleClass("js-hidden", !t), this._twoColumnLayout = t)
            }, o.prototype.appendToolsGroup = function(t) {
                var e, i = this.filterEnabledTools(this.extendTools(t));
                i.length > 0 && (e = new this.Button(i), this._main.append(e.element()), this._allToolGroups.push(e))
            }, o.prototype.filterEnabledTools = function(t) { return t.filter(function(t) { return this._toolsFilter.isToolEnabled(l[t.tool].localizedName) }, this) }, o.prototype.element = function() { return this._container }, o.prototype._syncView = function(t) {
                var e, i, o, n;
                if (this._allToolGroups)
                    for (e = this._allToolGroups.length; e--;)
                        if (i = this._allToolGroups[e], i.textAsIcon) i.activate("LineToolIcon" === t);
                        else {
                            for (o = !1, n = i.tools.length; n--;) i.tools[n].tool === t && (i.setCurrent(n), o = !0);
                            i.activate(o)
                        }
            }, o.prototype.activeChartWidget = function() { return this._chartWidgetCollection.activeChartWidget.value() }, o.prototype._onLinetoolButtonClicked = function(t, e) {
                if (a.tool.value() === t) return void(e && a.resetToCursor());
                TradingView.supportTouch() && this._chartWidgetCollection.selectedSource.value() && this.activeChartWidget().model().lineBeingCreated() && this.activeChartWidget().model().cancelCreatingLine(), a.tool.setValue(t)
            }, o.prototype.extendTools = function(t) {
                var e = this,
                    i = this._addToFavorite.bind(this),
                    o = e._removeFromFavorite.bind(this),
                    n = c.enabled("items_favoriting");
                return $.map(t, function(t) { var s = { tool: t.tool, addClass: e._toolsFilter.isToolGrayed(l[t.tool].localizedName) && " grayed", shortcut: t.shortcut, action: e._onLinetoolButtonClicked.bind(e, t.tool, !1), favOptions: { allowMakeFavorite: !e.options.onWidget && n, addToFavorite: i, removeFromFavorite: o } }; return s.favOptions.isFavorite = h.isFavorite(t.tool), t.shortcut && r.bind(t.shortcut.keys, function(i) { return i.preventDefault(), t.shortcut.immediately ? e.activeChartWidget().activePaneWidget && e.activeChartWidget().activePaneWidget.drawRightThere(t.tool) : s.action(), !1 }), s })
            }, o.prototype._addToFavorite = function(t) { t.favOptions.isFavorite = !0, h.addFavorite(t.tool) }, o.prototype._removeFromFavorite = function(t) { t.favOptions.isFavorite = !1, h.removeFavorite(t.tool) }, o.prototype.createIconActions = function(t) {
                var e = this,
                    i = s.availIcons,
                    o = TVSettings.getJSON("linetoolicon.recenticons");
                return o && (i = o.concat(["separator"]).concat(i)), $.map(i, function(t) {
                    return "separator" === t ? { separator: !0 } : {
                        tool: "LineToolIcon",
                        name: String.fromCharCode(t),
                        addClass: e._toolsFilter.isToolGrayed("Font Icons") && " grayed",
                        action: function() {
                            var i, o, n = defaults("linetoolicon");
                            n.icon = t, TradingView.saveDefaults("linetoolicon", n), a.tool.setValue("LineToolIcon"), e._icons.setTools(e.createIconActions()), i = TVSettings.getJSON("linetoolicon.recenticons") || [], o = 10, i = $.grep(i, function(e) { return e !== t }), i.unshift(t),
                                i.length > o && (i = i.slice(0, o)), TVSettings.setJSON("linetoolicon.recenticons", i)
                        }
                    }
                })
            }, o.prototype.changeTool = function(t) { t ? this._chartWidget.setCurrentTool(t) : this._chartWidget.setCurrentTool(this._chartWidget.currentCursorTool()) }, o.prototype._fold = function(t) { t = !!t, this._container.toggleClass("hidden", t), this.options.resizerBridge.negotiateWidth(t ? 0 : 52) }, o.prototype.getVisibilityChangeText = function(t) { return t ? $.t("Hide Drawings Toolbar") : $.t("Show Drawings Toolbar") }, o.prototype.Button = function(t, e, o) {
                t = Array.isArray(t) ? t : [t], this.isGroup = t.length > 1, this.textAsIcon = o, this.setTools(t), this._e = $("<span>").addClass("button").addClass("apply-common-tooltip common-tooltip-vertical"), this._main = $("<span>").addClass("main"), o && (this._main.addClass("text-as-icon"), this._main.text(this._firstNonGrayedTool().localizedName)), this.isGroup && (this._side = $("<span>").addClass("side").append($(i(895)).attr({ width: 3, height: 6 })), this._e.addClass("subgroup"));
                var n = o ? $.t("Icon") : this.tools[0].localizedName;
                this._e.append(this._main).attr("title", n).append(this._side), this.isGroup && (e = $.extend({ direction: "right", event: "button-popup", addClass: "drawings-popup-list favored-list", reverse: !1, popupSpacing: 4, svg: !o, listInner: !0, listTable: !0, wrapIcon: !0 }, e || {}), o || (e.addClass += " iconed"), "function" == typeof TradingView.setWidgetLogoOverlayVisibility && (this._e.on(e.event, function() { TradingView.setWidgetLogoOverlayVisibility(!1) }), e.onRemove = function() { TradingView.setWidgetLogoOverlayVisibility(!0) }), p(this._e, null, e)), this.activated = t.activated || !1, this.setCurrent(this.tools.indexOf(this._firstNonGrayedTool())), this.isGroup ? (Modernizr.touch ? (this._main.bind("touchstart", $.proxy(this, "_startclick")), this._main.bind("touchend", $.proxy(this, "_stopclick"))) : (this._main.mousedown($.proxy(this, "_startclick")), this._main.mouseup($.proxy(this, "_stopclick"))), this._side.click($.proxy(this, "_submenu")), this._e.click(function() { return !1 })) : this._e.click($.proxy(this, "action"))
            }, o.prototype.Button.prototype.toggle = function() {
                switch (this.element().css("display")) {
                    case "none":
                        this.element().css("display", "block");
                        break;
                    case "block":
                        this.element().css("display", "none")
                }
            }, o.prototype.Button.prototype._isToolGrayed = function(t) { return t.addClass && t.addClass.indexOf("grayed") > -1 }, o.prototype.Button.prototype._firstNonGrayedTool = function() {
                var t, e;
                for (t = 0; t < this.tools.length; ++t)
                    if (e = this.tools[t], !this._isToolGrayed(e) && !e.separator) return e;
                return this.tools[0]
            }, o.prototype.Button.prototype.element = function() { return this._e }, o.prototype.Button.prototype.setTools = function(t) {
                if (Array.isArray(t)) {
                    var e = this;
                    this.tools = $.map(t, $.proxy(function(t, i) { if (t.separator) return { separator: !0 }; var o = t.name || l[t.tool].localizedName; return { icon: e.textAsIcon ? t.name : t.tool, name: o, shortcut: t.shortcut, localizedName: o, tool: t.tool, addClass: t.addClass, action: "function" == typeof t.action ? t.action : e._defaultAction, favOptions: t.favOptions } }, this))
                }
            }, o.prototype.Button.prototype._setIcon = function(t) {
                var e = $(l[t].icon).attr({ width: 30, height: 30 });
                this._main.empty().append(e)
            },
            o.prototype.Button.prototype._setTextAsIcon = function(t) { this._main.text(t) }, o.prototype.Button.prototype.setIcon = function(t) { this.icon = t, this.textAsIcon ? this._setTextAsIcon(t) : this._setIcon(t) }, o.prototype.Button.prototype._getPopupMenuItems = function() {
                function t(t) { return t ? $.t("Remove from favorites") : $.t("Add to favorites") }
                var e = this;
                return $.map(this.tools, function(o, n) { var s, r; return o.separator ? o : (s = function() { e._isToolGrayed(o) ? d.emit("onGrayedObjectClicked", { type: "drawing", name: l[o.tool].localizedName }) : (e.setCurrent(n), o.action.call(e, o), $(document).trigger("click"), $(document).trigger("touch")) }, !e.textAsIcon && o.favOptions.allowMakeFavorite && (r = $('<span class="to-quick" title="' + t(o.favOptions.isFavorite) + '"></span>').append($(i(165)).attr({ width: 16, height: 16 })).toggleClass("quicked", !!o.favOptions.isFavorite)), { title: "" + o.localizedName, action: s, shortcut: o.shortcut, active: n === e.current, svg: !e.textAsIcon && $(l[o.icon].icon).attr({ width: 30, height: 30 }), addClass: o.addClass, buttons: e.textAsIcon || !o.favOptions.allowMakeFavorite ? void 0 : [{ el: r, handler: function(e) { o.favOptions.isFavorite ? (o.favOptions.removeFromFavorite(o), r.removeClass("quicked").attr("title", t(!1))) : (o.favOptions.addToFavorite(o), r.addClass("quicked").attr("title", t(!0))), e.stopPropagation(), e.preventDefault() } }] }) })
            }, o.prototype.Button.prototype._defaultAction = function() { this.activate() }, o.prototype.Button.prototype._startclick = function() { this._e.hasClass("active") ? ($(document).trigger("click"), this.action()) : this._delay = setTimeout($.proxy(function() { this._delay = null, this.openSubmenu() }, this), 200) }, o.prototype.Button.prototype._stopclick = function() { this._delay && (clearTimeout(this._delay), this._delay = null, this.action()) }, o.prototype.Button.prototype._submenu = function() {
                if (this._e.hasClass("active")) return void $(document).trigger("click");
                this.openSubmenu()
            }, o.prototype.Button.prototype.activate = function(t) { t = void 0 === t || !!t, this.activated = t, t ? this._e.addClass("selected") : this._e.removeClass("selected"), this.textAsIcon || this._setIcon(this.icon) }, o.prototype.Button.prototype.action = function() {
                var t = this.getCurrent();
                this._isToolGrayed(t) ? d.emit("onGrayedObjectClicked", { type: "drawing", name: l[t.tool].localizedName }) : t.action.call(this, t)
            }, o.prototype.Button.prototype.openSubmenu = function() { this._e.trigger("button-popup", [this._getPopupMenuItems()]) }, o.prototype.Button.prototype.setCurrent = function(t) {
                if (t >= 0 && t < this.tools.length) {
                    var e = this.tools[t];
                    this.setIcon(e.icon), this._isToolGrayed(e) ? this._e.find(".main").addClass(" grayed") : this._e.find(".main").removeClass(" grayed"), this.isGroup && !this.textAsIcon && this._e.attr("title", e.localizedName), this.current = t
                }
            }, o.prototype.Button.prototype.getCurrent = function() { return this.tools[this.current] }, o.prototype.Button.prototype.setCurrentTool = function(t, e) {
                var i, o = this;
                "LineToolIcon" === t ? (i = String.fromCharCode(defaults("linetoolicon").icon), $.each(this.tools, function(t, e) { if (e.icon === i) return o.setCurrent(t), o.activate(), !1 })) : $.each(this.tools, function(e, i) {
                    if (i.tool === t) return o.setCurrent(e),
                        o.activate(), !1
                })
            }, o.prototype.ResponsiveToolbar = function(t, e) { this.initButton(t, e), this.initPopupMenu() }, o.prototype.ResponsiveToolbar.prototype.initButton = function(t) {
                this.button = new o.prototype.Button({
                    tool: "group",
                    addClass: "block",
                    action: function() {
                        var e, i;
                        this.button.activate(!this.button.activated), e = [this.getMenuItem("Magnet Mode", t.ToolbarActions.magnet.bind(t), t.magnet.activated), this.getMenuItem("Stay in Drawing Mode", t.ToolbarActions.drawingmode.bind(t), t.drawingmode.activated), this.getMenuItem("Lock All Drawing Tools", t.ToolbarActions.lockDrawings.bind(t), t.lockDrawings.activated), this.getMenuItem("Hide All Drawing Tools", t.ToolbarActions.hideAllDrawings.bind(t), t.hideAllDrawings.activated), t.drawOnAllCharts && this.getMenuItem("Sync drawings to all charts", t.ToolbarActions.drawAllCharts.bind(t), t.drawOnAllCharts.activated), this.getSeparator(), this.getMenuItem("Show Objects Tree...", t.ToolbarActions.showObjectsTree.bind(t)), this.getMenuItem("Remove All Drawing Tools", t.ToolbarActions.removeTools.bind(t))], i = e.filter(function(t) { return void 0 !== t }), this.button.element().trigger("button-popup", [i])
                    }.bind(this)
                }), this.button.element().addClass("js-hidden")
            }, o.prototype.ResponsiveToolbar.prototype.getSeparator = function() { return { separator: !0 } }, o.prototype.ResponsiveToolbar.prototype.getMenuItem = function(t, e, i) { var o = null; return null != i && (o = { image: "url('images/dialogs/checkbox.png')", offset: i ? "0 -16px" : void 0 }), { title: $.t(t), action: e, icon: o } }, o.prototype.ResponsiveToolbar.prototype.initPopupMenu = function() { p(this.button.element(), null, { direction: "right", event: "button-popup", reverse: !0, notCloseOnButtons: !0, onRemove: function() { this.button.activate(!1) }.bind(this) }) }, o.prototype.ResponsiveToolbar.prototype.getButton = function() { return this.button }, o.prototype.ResponsiveToolbar.prototype.getButtonElement = function() { return this.button.element() }, o.prototype.ToolbarActions = { magnet: function(t) { this.magnet.activate(!this.magnet.activated), u(!0), a.properties().magnet.setValue(this.magnet.activated), u(!1) }, drawingmode: function() { this.drawingmode.activate(!this.drawingmode.activated), u(!0), a.properties().stayInDrawingMode.setValue(this.drawingmode.activated), u(!1) }, lockDrawings: function() { this.lockDrawings.activate(!this.lockDrawings.activated), a.lockDrawings().setValue(this.lockDrawings.activated) }, hideAllDrawings: function() { this.hideAllDrawings.activate(!this.hideAllDrawings.activated), a.hideAllDrawings().setValue(this.hideAllDrawings.activated) }, drawAllCharts: function() { this.drawOnAllCharts.activate(!this.drawOnAllCharts.activated), u(!0), a.drawOnAllCharts().setValue(this.drawOnAllCharts.activated), u(!1) }, showObjectsTree: function() { this.activeChartWidget().showSourceProperties() }, removeTools: function() { this._chartWidgetCollection.activeChartWidget.value().model().removeAllDrawingTools() } }, o.ModernToolsFilter = function(t) { this._toolsAccess = t }, o.ModernToolsFilter.prototype._findTool = function(t) {
                var e, i, o = null;
                for (e = 0; e < this._toolsAccess.tools.length; ++e)
                    if (i = this._toolsAccess.tools[e], i.name === t) { o = i; break }
                return o
            },
            o.ModernToolsFilter.prototype.isToolEnabled = function(t) { var e = this._findTool(t); return !(!e || !e.grayed) || ("black" === this._toolsAccess.type ? !e : !!e) }, o.ModernToolsFilter.prototype.isToolGrayed = function(t) { var e = this._findTool(t); return e && e.grayed }, t.exports = o
    }).call(e, i(24))
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { n.call(this, t, e), this._linetool = i, this.prepareLayout() }
    var n = i(5).PropertyPage,
        s = i(87).StudyInputsPropertyPage,
        r = i(64),
        a = i(25);
    inherit(o, r), o.prototype.prepareLayout = function() {
        var t, e, o, n, r, l, h, c, d = i(76),
            p = $('<table class="property-page" cellspacing="0" cellpadding="0">'),
            u = $('<table class="property-page" cellspacing="0" cellpadding="0">').data({ "layout-tab": d.TAB_NAME_INPUTS, "layout-tab-priority": d.TAB_PRIORITY_INPUTS });
        for (this._table = p.add(u), t = this._linetool.points(), e = 0; e < t.length; e++) o = $("<tr>"), o.appendTo(p), n = $("<td>"), n.html("Point " + (e + 1) + " Bar #"), n.appendTo(o), r = $("<td>"), r.appendTo(o), l = $("<input type='text'>"), l.appendTo(r), l.addClass("ticker"), h = this._linetool.properties().points[e], this.bindBarIndex(h.bar, l, this.model(), "Change " + this._linetool + " point bar index");
        c = a.findStudyMetaInfo(this._model.studiesMetaData(), this._linetool.studyId()), s.prototype.prepareLayoutImpl.call(this, c, u)
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, function(t, e, i) {
    (function(e, o, n) {
        "use strict";

        function s(t, i, o) { this.HIGHLIGHT_STUDY_NUM_FLICKS = 2, this._BASIC_STUDIES_PACKAGE_NAME = "tv-basicstudies", this._CUSTOM_STUDIES_PACKAGE_NAME = "Script$USER", this._PUBLISHED_STUDIES_PACKAGE_NAME = "Script$PUB", this._STANDARD_STUDIES_PACKAGE_NAME = "Script$STD", this._SCRIPTING_PACKAGE_NAME = "tv-scripting", this._FUNDAMENTAL_PACKAGE_NAME = "Script$EDGR", this._BASIC_STUDIES_PAGE_NAME = e.enabled("plain_studymarket") ? $.t("Technical Analysis") : $.t("Built-ins"), this._FUNDAMENTALS_PAGE_NAME = $.t("Fundamentals"), this._dialog = null, this._selectedStudy = null, this._keyDownListener = null, this._chartWidgetCollection = t, this._chart = t.activeChartWidget.value(), this._options = $.extend({}, this.DEFAULT_OPTIONS, o || {}), this.concretizeOptions(), this._user = i, this.setup() }
        var r, a, l, h = i(34),
            c = i(145).SidebarCustomScroll,
            d = i(25),
            p = i(71).createDialog,
            u = (i(93).createConfirmDialog, i(138).createNoticeDialog),
            _ = i(370).createSearchControl,
            f = i(54),
            m = i(69),
            g = i(188),
            v = i(77),
            y = i(256).AddSymbolCheckbox,
            b = i(140),
            w = i(113),
            S = i(44).assert,
            T = i(252).KeyboardListener,
            C = i(257),
            x = i(12).getLogger("Chart.StudyMarket");
        i(502), i(516), i(137),
            r = '<div class="tv-insert-indicator-dialog__body js-dialog__scroll-wrap"><div class="tv-insert-indicator-dialog__left-panel">{{^minimized}}<div id="js-search-placeholder"></div>{{/minimized}}<div class="tv-insert-indicator-dialog__left-panel-content-wrapper js-left-panel-wrapper"><div class="tv-insert-indicator-dialog__tabs-viewport js-tabs-viewport"><div class="tv-insert-indicator-dialog__tabs-container js-tabs-container"></div></div></div></div><div class="tv-insert-indicator-dialog__right-panel js-right-panel">{{#minimized}}{{#withSearch}}<div id="js-search-placeholder"></div>{{/withSearch}}{{/minimized}}<div class="tv-insert-indicator-dialog__pages js-pages"></div></div></div>', a = '<div class="tv-insert-indicator-dialog__tabs-group"><div class="tv-insert-indicator-dialog__tab tv-insert-indicator-dialog__tab--group-head js-tab js-tab-head">{{title}}<span class="tv-caret"></span></div><div class="tv-insert-indicator-dialog__tabs"></div></div>', l = '<div class="js-study-item tv-insert-study-item {{^withFavorites}}i-without-stars{{/withFavorites}}">{{#withFavorites}}<div class="tv-insert-study-item__favorite-icon js-favorite-icon"><span class="tv-insert-study-item__star tv-insert-study-item__star--filled">' + i(380) + '</span><span class="tv-insert-study-item__star tv-insert-study-item__star--empty">' + i(381) + '</span></div>{{/withFavorites}}<div class="tv-insert-study-item__title"><div class="tv-insert-study-item__title-text" title="{{titleTooltip}}">{{{title}}}</div></div></div>', s.prototype.setup = function() { this._initialized = !1, this._loadMore = null, this._$economyTabInput = null, this._$symbolSearchPopup = null, this._market = null, this._studies = null, this._packagesWithTabNames = {}, this._pages = {}, this._tabs = {}, this._subProductIds = {}, this.favsChanged = new o, this.visibilityChanged = new o, this._previousInviteOnlyStudiesIds = [], this.studiesReady = new $.Deferred, this.marketPagesReady = new $.Deferred, this._pubSearchCount = [0, 0, 0], this._pubSearchCanLoad = [!0, !0, !0], this._pubSearchEntries = [], this._pubSearchCache = [], this._pubSearchDfd = null, this._pubSearchPageShown = !1, this._w_market_tabs = null, this._w_technical_tabs = null }, s.prototype.init = function() {
                if (this._initialized) return void this.getStudyInfo();
                this.setupMarketInfo(), this.getStudyInfo(), this.setUser(this._user), this.prepareLayout(), this.attachHandlers(), this._initialized = !0
            }, s.prototype.DEFAULT_OPTIONS = { onWidget: !1, hideMarketPages: !1, selectBasicPage: !0, minimized: !1, searchKeywords: { earning: RegExp("EPS"), earnings: RegExp("EPS"), "trailing twelve months": RegExp("TTM") } }, s.prototype._PAGE_KEY = "studyMarket.page", s.prototype._ECONOMY_TAB = $.t("Economy & Symbols"), s.prototype._PUB_SEARCH_ENTRIES_ON_PAGE = 20, s.prototype.loadFavorites = function() {}, s.prototype.concretizeOptions = function() { e.enabled("study_market_minimized") && (this._options.hideMarketPages = !0, this._options.selectBasicPage = !0, this._options.minimized = !0), this._options.onWidget && (this._options.hideMarketPages = !0) }, s.prototype.setupMarketInfo = function() {}, s.prototype.getStudyInfo = function() {
                this._chart.withModel(this, function() {
                    this.setupStudyInfo()
                })
            }, s.prototype.setupStudyInfo = function() {
                var t = this._chartWidgetCollection.activeChartWidget.value().model().studiesMetaData(),
                    e = t.length;
                this._studies = {}, t = t.filter(function(t) { return !this.isHidedStudy(t) }, this), t.forEach(function(t) { var e, i = this.getStudyPackageName(t.id);!("Script$EOTPRO" === i || this._options.minimized && i !== this._BASIC_STUDIES_PACKAGE_NAME || this._options.onWidget && d.isScriptStrategy(t)) && (e = this.resolvePackageName(i), S(void 0 !== e, "Cannot resolve packageName " + i), this._studies[e] = this._studies[e] || [], this._studies[e].push(t)) }.bind(this), this), this._studies_length !== e && (this._studies_length = e, this.setUser(this._user)), this.studiesReady.resolve()
            }, s.prototype.resolvePackageName = function(t) { return t in this._subProductIds ? this._subProductIds[t] : t }, s.prototype.setUser = function(t) { window.is_authenticated ? this.setupUserData(t) : this.setAnonymous() }, s.prototype.setupUserData = function(t) { this._user = t, this.loadFavorites(), this.updateMarketPages() }, s.prototype.setAnonymous = function() { this.setupUserData(null), this.favsChanged.fire() }, s.prototype.isHidedStudy = function(t) { var e; return this._options.onWidget && (e = "IchimokuCloud@tv-basicstudies" === t.id), !!t.is_hidden_study && !e }, s._breakpointDevice = "phone-vertical", s.prototype._switchPagesContainer = function(t, e) { this._options.minimized || (t === s._breakpointDevice ? this._w_pages.detach().appendTo(this._widget.find(".js-left-panel-wrapper")) : e === s._breakpointDevice && this._w_pages.detach().appendTo(this._widget.find(".js-right-panel"))) }, s.prototype.prepareLayout = function() {
                var t, o = this;
                this._widget = $(n.render(r, { withSearch: e.enabled("study_dialog_search_control"), minimized: this._options.minimized })), this._w_tabs = this._widget.find(".js-tabs-container"), this._w_pages = this._widget.find(".js-pages"), this._loadMore = null, this.preparePages(), !this._options.selectBasicPage || this._options.fundamentalsOnly || g.device === s._breakpointDevice && !this._options.minimized ? this._options.fundamentalsOnly && (g.device !== s._breakpointDevice || this._options.minimized) ? this.selectPage(this._FUNDAMENTALS_PAGE_NAME) : g.device === s._breakpointDevice && this.selectPage("") : this.selectPage(this._BASIC_STUDIES_PAGE_NAME), this._scroll = new c(this._widget.find(".js-tabs-viewport"), this._w_tabs, { showBottomShadow: !1 }), this._w_pages.scroll(function() {
                    var t, e;
                    o._loadMore && (t = $.map(o._w_pages.children(":visible"), function(t) { return $(t).outerHeight(!0) }).reduce(function(t, e) { return t + e }, 0), e = o._widget.find(".js-right-panel").height(), t > e && t - o._w_pages.scrollTop() === e && o._loadMore())
                }), t = '<div class="tv-dialog__section tv-dialog__section--title js-dialog__drag tv-insert-indicator-dialog__title-container js-title-container"><div class="tv-insert-indicator-dialog__back-button js-back-button js-dialog__no-drag">' + i(224) + '</div><div class="js-title-text tv-dialog__title tv-insert-indicator-dialog__title-text">{{{ title }}}</div></div>', this._dialog = p({
                    title: " ",
                    titleTemplate: t,
                    contentWrapTemplate: this._widget,
                    addClass: "tv-insert-indicator-dialog " + (this._options.minimized ? "i-minimized" : ""),
                    width: this._options.minimized ? 490 : 842,
                    height: 580,
                    withScroll: !1,
                    focusFirstControl: !1,
                    closeOnClickAtOtherDialogs: !1,
                    isClickOutFn: function(t) { var e = C.instance(); if (e) return e.isEventOut(t); if (this._$symbolSearchPopup) return this._$symbolSearchPopup[0] !== t.target && !this._$symbolSearchPopup[0].contains(t.target) && void 0 }.bind(this)
                }), this._dialog.on("afterClose", this._onDialogClosed.bind(this)), this._dialog.$title.find(".js-back-button").on(Modernizr.touch ? "touchend" : "click", this.selectPage.bind(this, "")), g.on("changeDevice", function(t, e) { t === s._breakpointDevice && this.currentPage() && this.currentPage().hasClass("js-marketplace-page") && this.selectPage(""), t === s._breakpointDevice && (this._scroll.scrollToStart(), this._updateDialogTitleText()), this._switchPagesContainer(t, e) }.bind(this)), this._switchPagesContainer(g.device, ""), this._showHideBackButton(), this.hide()
            }, s.prototype._updateDialogTitleText = function() {
                var t, e, i;
                if (this._dialog) {
                    if (t = "" !== this._currentPageTitle, e = g.device !== s._breakpointDevice, !t || e || this._options.minimized) return void this._dialog.setTitleText(this._dialogTitleText);
                    i = this.currentPage(), this._dialog.setTitleText(i.data("fullTitle"))
                }
            }, s.prototype.currentPage = function() { return this._pages[this._currentPageTitle] }, s.prototype.preparePages = function() { this.addSearchPage(), e.enabled("items_favoriting") && this.addFavoritesPage(), this._options.fundamentalsOnly || this.prepareBasicPage(), this._options.fundamentalsOnly || this.addEconomyPage() }, s.prototype.addEconomyPage = function() {
                var t, e, i = this.addPage(this._ECONOMY_TAB, { withoutTopPadding: !0, noFlex: !0 }),
                    o = _({ withoutControls: !0, placeholder: $.t("Symbol"), addClass: "tv-insert-indicator-dialog__economy" });
                this._$economyTabInput = o.$input, t = new y({ labelRight: $.t("Overlay the main chart") }), this._symbolSearch = v.bindToInput(this._$economyTabInput, {
                    keepFocus: !0,
                    clearAfterAccept: !0,
                    callback: function(e) {
                        var i = this._chartWidgetCollection.activeChartWidget.value();
                        i && i.addSymbol(e, t.checked)
                    }.bind(this),
                    onPopupOpen: function(t) { this._$symbolSearchPopup = t, this._$symbolSearchPopup.css("z-index", this._dialog.zIndex) }.bind(this),
                    onPopupClose: function() { this._$symbolSearchPopup = null }.bind(this)
                }), i.append(o.$control), e = $('<div class="tv-insert-indicator-dialog__economy-content">'), e.append(t.$el), i.append(e)
            }, s.prototype.addFavoritesPage = function() { this.addPage("Favorites", { localizedTitle: $.t("Favorites") }), this.loadFavorites(), this.updateFavorites() }, s.prototype.addInvitesOnlyPage = function() { this.addPage("invitesOnly", { localizedTitle: $.t("Invite-Only Scripts") }) }, s.prototype.prepareBasicPage = function() {
                var t = this.addPage(this._BASIC_STUDIES_PAGE_NAME, { packageName: this._BASIC_STUDIES_PACKAGE_NAME, technical: !e.enabled("plain_studymarket") });
                this._basicPage = t, this.studiesReady.done(function() { this.resetBasicPage() }.bind(this))
            }, s.prototype._applyGlobalFilter = function(t) { return this._parentSource && (t = t.filter(d.canBeChild)), t }, s.prototype._applyStrategiesFilter = function(t) {
                var e = this._parentSource ? "not_strategies" : "none";
                return "not_strategies" !== e && "only_strategies" !== e || (t = t.filter(function(t) { var i = d.isScriptStrategy(t); return "not_strategies" === e ? !i : i })), t
            }, s.prototype.resetBasicPage = function() {
                var t, e, i = this.getPage(this._BASIC_STUDIES_PAGE_NAME);
                this._studies && (t = this._studies[this._BASIC_STUDIES_PACKAGE_NAME] || [], e = this._studies[this._STANDARD_STUDIES_PACKAGE_NAME] || [], t = t.concat(e), t = this._applyStrategiesFilter(t), t = this._applyGlobalFilter(t), this.preparePageStudies(i, t))
            }, s.prototype.resetAllPages = function() { this.resetBasicPage(), this.resetCustomScriptPage(), this.resetPublishedScriptPage(), this.resetInvitesOnlyPage() }, s.prototype.resetCustomScriptPage = function() {}, s.prototype.resetPublishedScriptPage = function() {}, s.prototype._createItemsList = function() { return $('<div class="tv-insert-indicator-dialog__items-list">') }, s.prototype._createSubGroupItem = function(t) { return $('<div class="tv-insert-study-item tv-insert-study-item--subgroup-header">').text(t) }, s.prototype._createItemsGroup = function(t, e, i) { var o, n = this._createItemsList(); return this.fillStudies(n, t, i), o = $('<div class="tv-insert-indicator-dialog__subgroup">'), e.length && o.append(this._createSubGroupItem(e)), o.append(n), o }, s.prototype.addSearchPage = function() {
                var t, e, i, o = _({ addClass: "tv-insert-indicator-dialog__search-control" });
                this._tabs.search = o.$control.data("title", "search"), this._pages.search = $('<div class="tv-insert-indicator-dialog__page tv-insert-indicator-dialog__page--search">').data("title", "search"), this._pages.search.data("fullTitle", $.t("Search")), t = null, this._search_value = null, this._search_input = o.$input, o.inputChangedDelegate.subscribe(null, function() { t && clearTimeout(t), t = setTimeout(function() { t = null, this.search(this._search_input.val()), this._w_pages.scrollTop(0) }.bind(this), 200) }.bind(this)), this._search_input.focus(function() { this.search(this._search_input.val()) }.bind(this)), e = this._widget.find("#js-search-placeholder"), e.length && e.parent()[0].replaceChild(this._tabs.search[0], e[0]), this._w_pages.prepend(this._pages.search), i = {}, i[w.ENTER] = this._onEnterKeyHandler.bind(this), i[w.UP_ARROW] = this._onUpKeyHandler.bind(this), i[w.DOWN_ARROW] = this._onDownKeyHandler.bind(this), this._keyDownListener = new T("keydown"), this._keyDownListener.regHandlers(i), this._keyDownListener.watchOn(this._search_input[0])
            }, s.prototype._onEnterKeyHandler = function() { null !== this._selectedStudy && this.insertThisStudy(this._selectedStudy) }, s.prototype._onUpKeyHandler = function() {
                if (null !== this._selectedStudy) {
                    var t = this._selectedStudy.prev(".js-study-item");
                    t && t.length && (this._selectedStudy.removeClass("tv-insert-study-item--selected"), t.addClass("tv-insert-study-item--selected"), this._selectedStudy = t, this._ensureSelectedItemIsVisible())
                }
            }, s.prototype._onDownKeyHandler = function() {
                if (null === this._selectedStudy) this._selectedStudy = this.currentPage().find(".js-study-item").first(), this._selectedStudy.addClass("tv-insert-study-item--selected");
                else {
                    var t = this._selectedStudy.next(".js-study-item");
                    t && t.length && (this._selectedStudy.removeClass("tv-insert-study-item--selected"),
                        t.addClass("tv-insert-study-item--selected"), this._selectedStudy = t, this._ensureSelectedItemIsVisible())
                }
            }, s.prototype._ensureSelectedItemIsVisible = function() {
                var t, e, i, o, n, s;
                null !== this._selectedStudy && (t = this._w_pages, e = this._selectedStudy[0].getBoundingClientRect(), i = t[0].getBoundingClientRect(), o = this.currentPage()[0].getBoundingClientRect().top, n = e.top - o, s = 3, e.top - i.top < 0 ? t.scrollTop(n - s) : e.bottom - i.bottom > 0 && t.scrollTop(n - i.height + e.height + s))
            }, s.prototype.search = function(t, i, o) {
                function n(t, e, i, o, n, s) { t.push(e), t[t.length - 1].matchPriority = o, n && (t[t.length - 1].matchIndex = i.match(s).index) }
                var s, r, a, l, h, c = this;
                (this._search_value !== t || i) && (s = this._pages.search, r = [], a = function(t) { return t.replace(/[!-\/[-^{-}]/g, "\\$&") }, "" !== t && (l = t.split("").map(function(t, e) { var i = a(t); return 0 !== e && (i = "[/\\s-]" + i), "(" + i + ")" }).join("(.*?)") + "(.*)", r.push({ fullMatch: RegExp("(" + a(t) + ")", "i"), re: RegExp("^" + l, "i"), reserveRe: RegExp(l, "i"), fuzzyHighlight: !0 }), t.toLowerCase() in this.DEFAULT_OPTIONS.searchKeywords && r.push({ fullMatch: this.DEFAULT_OPTIONS.searchKeywords[t.toLowerCase()], re: this.DEFAULT_OPTIONS.searchKeywords[t.toLowerCase()], fuzzyHighlight: !1 })), this._search_value = t, h = $.Deferred(), c._currentAsyncSearchDfd = h, e.enabled("plain_studymarket") ? h.resolve([]) : PublishedScript.suggest(t).done(function(t) {
                    var e = [];
                    t && t.results;
                    h.resolve(e)
                }).fail(function() { h.resolve([]) }), h.done(function(e) {
                    var i, o, a, l, d, p, u, _, f, m, g, v, y, b, w, S, T, C, x;
                    if (c._currentAsyncSearchDfd === h) {
                        for (i = Object.keys(c._studies), i.indexOf(c._PUBLISHED_STUDIES_PACKAGE_NAME) < 0 && i.push(c._PUBLISHED_STUDIES_PACKAGE_NAME), i.sort(), o = [c._BASIC_STUDIES_PACKAGE_NAME, c._STANDARD_STUDIES_PACKAGE_NAME, c._PUBLISHED_STUDIES_PACKAGE_NAME, c._CUSTOM_STUDIES_PACKAGE_NAME], a = o.length; a--;) l = o[a], -1 !== (d = i.indexOf(l)) && (i.splice(d, 1), i.unshift(l));
                        for (p = {}, u = 0, _ = 0; _ < i.length; _++) {
                            for (f = i[_], m = [], g = c._studies[f], f === c._PUBLISHED_STUDIES_PACKAGE_NAME && (g = e), a = 0; a < g.length; a++)
                                if (v = g[a], r.length)
                                    for (y = 0; y < r.length; y++) b = r[y].re, b.lastIndex = 0, w = r[y].fullMatch, S = v.shortDescription, S && S.toLowerCase() === t.toLowerCase() ? n(m, v, S, 3, !0, w) : S && w.test(S) ? n(m, v, S, 2, !0, w) : (S = v.description_localized || v.description || v.scriptName, w.test(S) ? n(m, v, S, 1, !0, w) : b.test(S) && n(m, v, S, 0, !0, b));
                                else m.push(v);
                            if (m = c._applyGlobalFilter(m), m.length) {
                                switch (T = f, f) {
                                    case c._BASIC_STUDIES_PACKAGE_NAME:
                                    case c._STANDARD_STUDIES_PACKAGE_NAME:
                                        T = c._BASIC_STUDIES_PAGE_NAME;
                                        break;
                                    case c._CUSTOM_STUDIES_PACKAGE_NAME:
                                        T = $.t("My Scripts");
                                        break;
                                    case c._PUBLISHED_STUDIES_PACKAGE_NAME:
                                        T = $.t("Public Library");
                                        break;
                                    default:
                                        f in c._packagesWithTabNames && (T = c._packagesWithTabNames[T])
                                }
                                T in p || (p[T] = []), p[T] = p[T].concat(m), u += m.length
                            }
                        }
                        for (s.html(""), C = Object.keys(p), a = 0; a < C.length; ++a) T = C[a], m = p[T], r.length && Array.prototype.sort.call(m, function(t, e) {
                                if (t.matchPriority < e.matchPriority) return 1;
                                if (t.matchPriority > e.matchPriority) return -1;
                                if (t.matchPriority === e.matchPriority) switch (t.matchIndex) {
                                    case void 0:
                                        return 0;
                                    default:
                                        return t.matchIndex > e.matchIndex ? 1 : t.matchIndex < e.matchIndex ? -1 : 0
                                }
                            }),
                            x = this._createItemsGroup(m, this._options.minimized ? "" : $.t(T), r), s.append(x), this._selectedStudy = null;
                        0 === u && s.append('<p class="tv-insert-indicator-dialog__not-found-message">' + $.t("No indicators matched your criteria.") + "</p>")
                    }
                }.bind(this))), o || this.selectPage("search")
            }, s.prototype.updateSearchPage = function() {
                var t = this._search_input.val();
                this.search(t, !0, !0)
            }, s.prototype.updateMarketPages = function() {}, s.prototype.preparePageStudies = function(t, e, i, o) {
                if (t) {
                    o || (e = this.sortStudies(e)), t.empty();
                    var n = this._createItemsList();
                    this.fillStudies(n, e, null), t.append(n)
                }
            }, s.prototype.addPage = function(t, e) { var i, o, n, s, r, a; return e = $.extend({}, e), i = e.localizedTitle || $.t(t), o = t.toLowerCase(), n = $('<div class="tv-insert-indicator-dialog__page">').data("title", o), s = $('<div class="tv-insert-indicator-dialog__tab js-tab"></div>').text(i).data("title", o).attr("title", i), r = e.technical ? $.t("Technical Analysis") + ": " : "", n.data("fullTitle", r + i), s.toggleClass("tv-insert-indicator-dialog__tab--beta", !!e.beta), e.packageName && (this._packagesWithTabNames[e.packageName] = t), this._pages[o] = n, this._tabs[o] = s, e.withoutTopPadding && n.addClass("tv-insert-indicator-dialog__page--without-top-padding"), e.noFlex && n.addClass("tv-insert-indicator-dialog__page--no-flex"), e.technical || e.market ? (a = e.technical ? this._getOrCreateTechnicalTab() : this._getOrCreateMarketTab(), a.find(".tv-insert-indicator-dialog__tabs").append(s), e.market && n.addClass("js-marketplace-page")) : this._w_market_tabs ? s.insertBefore(this._w_market_tabs) : this._w_tabs.append(s), this._w_pages.append(n), n.toggleClass("i-hidden", o !== this._currentPageTitle), n }, s.prototype._createGroupTab = function(t, e) { var i = $(n.render(a, { title: t })); return i.find(".js-tab-head").on("click", function() { this._expandCollapseTabs(i, e) }.bind(this)), this._expandCollapseTabs(i, e, m.getBool(e, !0), !0), i.data("settings-open-key", e), this._w_tabs.append(i), i }, s.prototype._getOrCreateMarketTab = function() { return this._w_market_tabs || (this._w_market_tabs = this._createGroupTab($.t("Marketplace Add-ons"), "studyMarket.marketTabIsOpen"), this._w_market_tabs.addClass("tv-insert-indicator-dialog__tabs-group--marketplace")), this._w_market_tabs }, s.prototype._getOrCreateTechnicalTab = function() { return this._w_technical_tabs || (this._w_technical_tabs = this._createGroupTab($.t("Technical Analysis"), "studyMarket.technicalTabIsOpen")), this._w_technical_tabs }, s.prototype._onDialogClosed = function() { null !== this._selectedStudy && this._selectedStudy.removeClass("tv-insert-study-item--selected"), this._selectedStudy = null, this.visibilityChanged.fire(!1), b.removeListener("StudyMarket") }, s.prototype.hide = function() { this._dialog.close() }, s.prototype.show = function(t) {
                var i, o;
                this.init(), i = !1, o = t instanceof TradingView.Study && t || null, o !== this._parentSource && (this._parentSource = o, this._dialogTitleText = this._parentSource ? $.t("Apply Indicator on {0}").format(this._parentSource.title(!0)) : $.t("Indicators"), i = !0), this._updateDialogTitleText(), this._widget.on("keyup.hideDialogStudy", function(t) {
                    t.which === w.ESC && (this._widget.unbind("keyup.hideDialogStudy"),
                        this.hide())
                }.bind(this)), this._clearInput(), this.loadFavorites(), i && this.resetAllPages(), this._scroll.scrollTo(0), this.visibilityChanged.fire(!0), this.focusAddSymbolInput(this._currentPageTitle), b.registerListener("StudyMarket", function(t) { return !t.ctrlKey && (47 !== t.which && (t.which && t.which === w.ENTER ? (t.target === this._search_input.get(0) && this._insertStudyByShortDescription(), !0) : !!t.charCode && (!(!t.which || t.which <= 32) && (!/^(input|textarea)$/i.test(t.target.tagName) && (t.preventDefault(), !!(TradingView.onWidget() || this._options.minimized && !e.enabled("study_dialog_search_control")) || (this._search_input.focus(), this._search_input[0].value = String.fromCharCode(t.charCode), !0)))))) }.bind(this)), this._dialog.open()
            }, s.prototype.isVisible = function() { return !!this._initialized && this._widget.is(":visible") }, s.prototype.getPage = function(t) { return t = t.toLowerCase(), this._pages[t] }, s.prototype.focusAddSymbolInput = function(t) { t === this._ECONOMY_TAB.toLowerCase() && this._$economyTabInput && this._$economyTabInput.focus() }, s.prototype._showHideBackButton = function() {
                if (this._dialog && !this._options.minimized) {
                    var t = "" !== this._currentPageTitle;
                    this._dialog.$el.find(".js-title-container").toggleClass("i-with-back-button", t)
                }
            }, s.prototype.selectPage = function(t) {
                var e, i, o, n, s, r;
                if (t = t.toLowerCase(), this.focusAddSymbolInput(t), this._currentPageTitle !== t)
                    if ("" === t || t in this._pages && t in this._tabs && ("favorites" !== t || this.hasVisibleFavorites())) {
                        for (e in this._pages)
                            if (i = t === e, o = this._pages[e], o.toggleClass("i-hidden", !i), this._tabs[e].toggleClass("i-active", i), i) {
                                if (o.trigger("show-page"), n = this._tabs[e].parents(".tv-insert-indicator-dialog__tabs-group"), 0 === n.length) continue;
                                s = n.find(".js-tab-head"), this._expandCollapseTabs(n, s.data("settings-open-key"), !0, !0)
                            }
                        this._currentPageTitle = t, this._w_pages.scrollTop(0), m.setValue(this._PAGE_KEY, t), this._selectedStudy = null, r = "" !== this._currentPageTitle, this._widget.find(".js-tabs-viewport").toggleClass("i-active", !r), this._w_pages.toggleClass("i-active", r), this._showHideBackButton(), r || this._search_input.blur(), this._updateDialogTitleText()
                    } else this.selectPage(this._BASIC_STUDIES_PAGE_NAME)
            }, s.prototype.attachHandlers = function() {
                var t = Modernizr.touch ? "touchend" : "click",
                    i = this;
                Modernizr.touch && this._w_pages.on("touchstart", ".js-study-item", function(t) { i._touchStart = $.extend({}, t.originalEvent.touches[0]) }), this._w_tabs.on("click", ".js-tab", this._onTabClicked.bind(this)), e.enabled("items_favoriting") && this._w_pages.on(t, ".js-favorite-icon", this.toggleItem.bind(this)), this._w_pages.on(t, ".js-study-item", function(t) {
                    var e;
                    i._touchStart && (e = i._w_pages.find(".tv-insert-study-item")[0].clientHeight, Math.abs(i._touchStart.screenY - t.originalEvent.changedTouches[0].screenY) > e) || i.insertThisStudy($(t.target).closest(".js-study-item"))
                }), this._w_pages.on("click", ".js-offer-screenshots", function(t) {
                    t.currentTarget.getAttribute("data-fancybox-inited") || (t.currentTarget.setAttribute("data-fancybox-inited", !0), $(this).find("a").fancybox({
                        type: "image",
                        live: !1,
                        afterShow: function() {
                            $(".fancybox-overlay").on("click", function(t) { t.stopPropagation() })
                        }
                    }), setTimeout(function() { $(t.target).click() }, 0)), t.preventDefault()
                })
            }, s.prototype._onTabClicked = function(t) {
                var e = $(t.currentTarget).data("title");
                e && "search" !== e && this.selectPage(e), t.stopPropagation()
            }, s.prototype._expandCollapseTabs = function(t, e, i, o) {
                var n, s = t.hasClass("i-dropped");
                if (void 0 === i) i = !t.hasClass("i-dropped");
                else if (s === i && !o) return;
                if (n = t.find(".tv-insert-indicator-dialog__tabs"), t.toggleClass("i-dropped", !!i), o) return void n.toggleClass("i-hidden", !i);
                n.removeClass("i-hidden"), n.velocity(i ? "slideDown" : "slideUp", { duration: f.dur / 2, complete: function() { m.setValue(e, i), this._scroll.updateScroll() }.bind(this) })
            }, s.prototype.toggleItem = function(t) { var e = $(t.target).closest(".js-study-item").data("study"); return this.toggleFavorite(e.id), this.toggleEverywhere(e.id), !1 }, s.prototype.toggleEverywhere = function(t) {
                var e = this,
                    i = this.isFavorite(t);
                this._w_pages.find(".js-study-item").filter(function(i, o) { var n = $(o).data("study"); return !!n && e.favsModel.favId(n.id) === e.favsModel.favId(t) }).find(".js-favorite-icon").toggleClass("i-starred", i).attr("title", this.favTitle(i))
            }, s.prototype.toggleFavorite = function(t) { this.favsModel.favorite(t) }, s.prototype.agreeOnFavorite = function(t) {}, s.prototype.isFavorite = function(t) {}, s.prototype._getInviteOnlyStudies = function() { return new Promise(function(t, e) { t([]) }) }, s.prototype.resetInvitesOnlyPage = function() {
                var t = this;
                t._tabs.invitesonly && (t._previousInviteOnlyStudiesIds && 0 !== t._previousInviteOnlyStudiesIds.length ? t._tabs.invitesonly.show() : t._tabs.invitesonly.hide()), t._getInviteOnlyStudies().then(function(e) { t._previousInviteOnlyStudies = e, t.preparePageStudies(t._pages.invitesonly, e), t._tabs.invitesonly && (e && 0 !== e.length ? t._tabs.invitesonly.show() : t._tabs.invitesonly.hide()) }, function() { t.preparePageStudies(t._pages.invitesonly, []), t._tabs.invitesonly && t._tabs.invitesonly.hide() })
            }, s.prototype.updateFavorites = function() {
                var t, e, i, o, n, r, a, l, h, c, p, u, _;
                if (this._w_pages) {
                    if (t = this, e = this.getVisibleFavorites(), i = function() { "favorites" === t._currentPageTitle && t.selectPage(g.device === s._breakpointDevice ? "" : t._BASIC_STUDIES_PAGE_NAME), t._w_pages.find(".js-favorite-icon").removeClass("i-starred"), t._tabs && t._tabs.favorites && t._tabs.favorites.hide() }, t._tabs.favorites && 0 === e.length) return void i();
                    for (o = $.Deferred(), n = [], r = [], a = 0; a < e.length; a++)
                        if (l = e[a], (h = this.getStudyPackageName(l)) !== t._PUBLISHED_STUDIES_PACKAGE_NAME) {
                            for (c = this._studies[h] || [], p = 0; p < c.length; p++)
                                if (u = t.favsModel.favId(d.cutFullId(c[p].id)), _ = t.favsModel.favId(l), u === _) { n.push(c[p]); break }
                        } else r.push(l);
                    r.length && !this._options.minimized || o.resolve(n), o.done(function(t) { 0 === t.length ? i() : this._tabs.favorites.show(), t = this._applyStrategiesFilter(t), this.preparePageStudies(this._pages.favorites, t), this._w_pages.find(".js-study-item").find(".js-favorite-icon").removeClass("i-starred"), e.forEach(this.toggleEverywhere, this) }.bind(this)), n && 0 !== n.length && this._tabs.favorites.show()
                }
            }, s.prototype.hasVisibleFavorites = function() {
                return !!this.getVisibleFavorites().length
            }, s.prototype.getVisibleFavorites = function() { return [] }, s.prototype.checkExcludePackageStudies = function(t) { return t.filter(function(t) { var e = this.getStudyPackageName(t); return e === this._PUBLISHED_STUDIES_PACKAGE_NAME || !!(this._studies && this._studies[e] && $.grep(this._studies[e], function(e) { return e.id.indexOf(t) >= 0 }).length > 0) && (e === this._BASIC_STUDIES_PACKAGE_NAME || e === this._STANDARD_STUDIES_PACKAGE_NAME || e === this._CUSTOM_STUDIES_PACKAGE_NAME || e === this._SCRIPTING_PACKAGE_NAME || e === this._FUNDAMENTAL_PACKAGE_NAME || pro.hasPackage(e) && e in this._studies) }, this) }, s.prototype.sortStudies = function(t) { return t.sort(function(t, e) { return t = t.scriptName || t.description_localized || t.description, e = e.scriptName || e.description_localized || e.description, t > e ? 1 : t < e ? -1 : 0 }) }, s.prototype.fillStudies = function(t, e, i) {
                var o;
                t.empty(), e.forEach(function(e) { e ? o = this.createStudyListItem(e, i) : (o = document.createElement("div"), o.className = "placeholder"), t.append(o) }, this)
            }, s.prototype.createStudyListItem = function(t, i) {
                var o, s, r, a, h, c, p, u, _, f, m, g, v, y, b, w, S, T, C, x, P, L, k, I, A, E, M, D = t.description_localized || $.t(t.scriptName || t.description || " ", { context: "study" }),
                    O = this.isFavorite(t.id),
                    V = [];
                if (i && D)
                    for (o = [], i instanceof RegExp ? o.push({ re: i, fuzzyHighlight: !1 }) : $.isArray(i) && (o = i), s = 0; s < o.length; s++)
                        if (r = o[s].fullMatch, a = o[s].reserveRe, h = o[s].re, r.lastIndex = 0, h.lastIndex = 0, c = r.exec(D), c ? o[s].fuzzyHighlight = !1 : (c = h.exec(D), !c && a && (c = a.exec(D)), o[s].fuzzyHighlight = !0), c)
                            if (o[s].fuzzyHighlight)
                                for (p = c.index, u = 1; u < c.length; u++) _ = c[u].length, u % 2 && (V[p] = !0), p += _;
                            else
                                for (f = 0; f < c[0].length; f++) V[c.index + f] = !0;
                return m = TradingView.clean(D, !0), g = m.replace(/./g, function(t, e) {
                        if ("<" === t ? t = "&lt;" : "&" === t ? t = "&amp;" : '"' === t && (t = "&quot;"), V[e]) {
                            if (" " === t || "-" === t || "/" === t) return V[e + 1] = !0, t;
                            t = '<span class="i-match">' + t + "</span>"
                        }
                        return t
                    }), v = !!t.pine, y = this.getStudyPackageName(t.id), b = v && y === this._PUBLISHED_STUDIES_PACKAGE_NAME, w = v && y === this._CUSTOM_STUDIES_PACKAGE_NAME, S = v && (y === this._STANDARD_STUDIES_PACKAGE_NAME || y === this._FUNDAMENTAL_PACKAGE_NAME), T = v && [TVScript.Access.ACCESS_CLOSED_NEEDS_AUTH, TVScript.Access.ACCESS_CLOSED_NO_AUTH].indexOf(t.pine.access) >= 0, C = v && TVScript.Access.ACCESS_CLOSED_NEEDS_AUTH === t.pine.access, x = v && C && void 0 !== t.pine.userHaveAccess, P = v && t.pine.userHaveAccess, L = !!t.TVScriptSourceCode, k = !1, I = v && !S && !T && (w || b || L || O && !k), A = { closed: $.t("Invite-only script. Contact the author for more information."), open: $.t("Invite-only script. You have been granted access.") }, E = $(n.render(l, { publishedOrUserScript: w || b, title: g, titleTooltip: TradingView.strip_tags(m), isStrategy: d.isScriptStrategy(t), isInviteOnly: C, showAccessIcon: x, accessIconClass: P ? "tv-insert-study-item__green-lock-icon" : "tv-insert-study-item__red-lock-icon", accessTooltip: P ? A.open : A.closed, author: t.author && t.author.username, likes: t.agreeCount ? t.agreeCount + " " + $.t("like", { plural: "likes", count: t.agreeCount }) : "", showMoreButton: !!t.imageUrl, deleteButton: !t.imageUrl && w, withFavorites: e.enabled("items_favoriting") && !this._options.minimized })),
                    I || E.find(".js-show-source-btn").removeClass("js-show-source-btn").addClass("i-empty"), E.data("study", t), void 0 !== t.isCustomIndicator && E.addClass("custom-indicator"), e.enabled("items_favoriting") && (M = E.find(".js-favorite-icon"), M.toggleClass("i-starred", !!O), M.attr("title", this.favTitle(!!O))), e.enabled("graying_disabled_tools_enabled") && ChartApiInstance.studiesAccessController.isToolGrayed(t.description) && E.addClass("i-grayed"), E
            }, s.prototype.favTitle = function(t) { return t ? $.t("Remove from favorites") : $.t("Add to favorites") }, s.prototype.insertThisStudy = function(t) { if (!t.hasClass("placeholder")) { var i = t.data("study"); return e.enabled("graying_disabled_tools_enabled") && ChartApiInstance.studiesAccessController.isToolGrayed(i.description) ? void h.emit("onGrayedObjectClicked", { type: "study", name: i.description }) : (t.highlight(this.HIGHLIGHT_STUDY_NUM_FLICKS), this.insertStudy(i), !1) } }, s.prototype.insertStudy = function(t) {
                var e, i, o = this._chartWidgetCollection.activeChartWidget.value();
                o && (e = o.insertStudyStub(t.description), i = d.replaceWithFullStudyMetaInfoAsync(o.model().studiesMetaData(), t), i.done(function(t) {
                    var i;
                    if (o.removeStudyStub(e.id())) {
                        if (this._parentSource && !d.canBeChild(t)) return i = u({ type: "modal", title: $.t("Oops!"), content: $.t("This indicator cannot be applied to another indicator") }), void i.open();
                        o.insertStudyOrShowDialog(t, this._parentSource), this._is_on_chart = !0
                    }
                }.bind(this)), i.fail(function(t) { x.logError("Error: " + t), e.setStatus(t) }))
            }, s.prototype.onLoginStateChange = function(t) { t || this.setUser(window.user), PublishedScript.cleanCache(), this.resetAllPages(), this.setup(), this.init() }, s.prototype.getStudyList = function(t) {
                function e(t) { i.push(t) }
                var i, o;
                if (!this.studiesReady.isResolved()) return [];
                i = [];
                for (o in this._studies)(o === this._BASIC_STUDIES_PACKAGE_NAME || pro.hasPackage(o)) && (this._studies[o].forEach(e), t && i.push({ separator: !0 }));
                return t && i.splice(i.length - 1, 1), i
            }, s.prototype.getStudyPackageName = function(t) { var e, i, o, n, s, r; if (t) return e = t.split("@"), (i = 1 === e.length) || (o = d.getPackageName(t)) === this._SCRIPTING_PACKAGE_NAME ? (n = e[0], i || /^(Strategy)?Script\$/.test(n) ? (s = n.indexOf("_"), -1 !== s ? (o = n.substring(0, s), r = o.indexOf("Script$") >= 0 ? o : "Script$" + o, pro.getSuperProduct(r) || r) : /USER;/.test(n) ? this._CUSTOM_STUDIES_PACKAGE_NAME : /PUB;/.test(n) ? this._PUBLISHED_STUDIES_PACKAGE_NAME : /STD;/.test(n) ? this._STANDARD_STUDIES_PACKAGE_NAME : n) : o) : o }, s.prototype.selectSearchPage = function() { this.selectPage("search"), this._clearInput() }, s.prototype._insertStudyByShortDescription = function() {
                var t, e, i, o = this._search_value;
                for (o = o.trim(), t = this._studies[this._BASIC_STUDIES_PACKAGE_NAME], e = 0; e < t.length; e++)
                    if (i = t[e], i.shortDescription && i.shortDescription.toUpperCase() === o.toUpperCase()) { this.insertStudy(i); break }
            }, s.prototype._clearInput = function() { this._search_input.val(""), "search" === this._currentPageTitle && this._search_input.val("").trigger("input").focus() }, s.prototype._getScriptType = function() { return 0 }, s.prototype._pubSearchEntryAlreadyLoaded = function(t) {
                var e = t.scriptIdPart.split(";")[1];
                return !(this._pubSearchCache.indexOf(e) < 0) || (this._pubSearchCache.push(e), !1)
            }, s.prototype._addPubSearchResult = function(t, e) { t.length && (t.forEach(function(t) { this._pubSearchEntryAlreadyLoaded(t) || (this._pubSearchEntries.push(t), this._pubSearchCount[t.scriptType]++) }, this), 0 === e && (this._pubSearchCount[0] += t.length), this._pubSearchEntries.sort(function(t, e) { return e.agreeCount - t.agreeCount })) }, s.prototype._getPublicLibraryRequestParams = function(t) {
                var e = this._pubSearchCount[t],
                    i = this._PUB_SEARCH_ENTRIES_ON_PAGE;
                return e < this._PUB_SEARCH_ENTRIES_ON_PAGE && (i = this._PUB_SEARCH_ENTRIES_ON_PAGE - e), { offset: e, count: i, type: t }
            }, t.exports = s
    }).call(e, i(3), i(15), i(30))
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { s.call(this, t, e), this._study = i, this.prepareLayout() }
    var n = i(5),
        s = n.PropertyPage,
        r = n.GreateTransformer,
        a = n.LessTransformer,
        l = n.ToIntTransformer,
        h = n.ToFloatTransformer,
        c = n.BooleanBinder,
        d = n.SimpleComboBinder,
        p = n.SimpleStringBinder,
        u = i(26).NumericFormatter,
        _ = i(44).assert;
    inherit(o, s), o.prototype._getStrategyInputs = function() { for (var t, e = 0, i = this._study.metaInfo(), o = {}; e < i.inputs.length; e++) t = i.inputs[e], "strategy_props" === t.groupId && (_(void 0 !== t.internalID, "Strategy input id=" + t.id + " doesn't have an internalID"), o[t.internalID] = i.inputs[e]); return TradingView.clone(o) }, o.prototype._setStdInput = function(t, e, i) {
        var o, n, s, _, f, m, g, v, y, b, w, S;
        if (t) {
            if (o = t.id, n = "study_input-" + o + "-" + Date.now().toString(36) + "-" + Math.random().toString(36), s = $("<tr>").appendTo(this._$table), _ = "Change " + e, f = $('<label for="' + n + '">' + $.t(e, { context: "input" }) + "</label>"), "bool" === t.type) g = $('<td colspan="3">').appendTo(s), m = $('<input id="' + n + '" type="checkbox">').appendTo(g), f.appendTo(g), !0 !== i && this.bindControl(new c(m, this._property.inputs[o], !0, this.model(), _));
            else if ($("<td>").addClass("propertypage-name-label").append(f).appendTo(s), v = $('<td colspan="2">').appendTo(s), t.options) { for (m = $('<select id="' + n + '">').appendTo(v), y = 0; y < t.options.length; y++) b = t.options[y], b instanceof jQuery ? b.appendTo(m) : $('<option value="' + b + '">' + b + "</option>").appendTo(m);!0 !== i && this.bindControl(new d(m, this._property.inputs[o], null, !0, this.model(), _)) } else m = $('<input id="' + n + '" type="text">').appendTo(v), !0 !== i && ("integer" !== t.type && "float" !== t.type || (w = ["integer" === t.type ? l(t.defval) : h(t.defval)], (0 === t.min || t.min) && w.push(r(t.min)), (0 === t.max || t.max) && w.push(a(t.max))), S = new p(m, this._property.inputs[o], w, !1, this.model(), _), "float" === t.type && S.addFormatter(function(t) { return (new u).format(t) }), this.bindControl(S)), m.addClass("ticker");
            return m
        }
    }, o.prototype._setPyramidingInputs = function(t) {
        var e = t.pyramiding,
            i = this._property.inputs[e.id],
            o = this._setStdInput({ id: "pyramiding_switch", type: "bool" }, $.t("Pyramiding"), !0),
            n = this._setStdInput(t.pyramiding, $.t("Allow up to")),
            s = n.closest("tr");
        _(void 0 === this._onAllowUpToChanged), this._onAllowUpToChanged = function(t) { t.value() > 0 ? (o.prop("checked", !0), n.removeAttr("disabled"), s.removeClass("disabled")) : (o.prop("checked", !1), n.attr("disabled", "disabled"), s.addClass("disabled")) }, i.subscribe(null, this._onAllowUpToChanged),
            o.change(function() {
                var t = !o.prop("checked");
                i.setValue(t ? 0 : e.defval), t ? n.attr("disabled", "disabled") : n.removeAttr("disabled"), s.toggleClass("disabled", t)
            }), i.value() > 0 ? o.prop("checked", !0) : (o.prop("checked", !1), n.attr("disabled", "disabled"), s.addClass("disabled")), s.children().last().removeAttr("colspan"), $("<td>").text($.t("orders", { context: "up to ... orders" })).appendTo(s)
    }, o.prototype._setQtyInputs = function(t) {
        function e(t) { return t = +t, isNaN(t) || t < 0 ? 0 : ("percent_of_equity" !== s.val() ? t = parseInt(t) : t > 100 && (t = 100), t) }
        var i, o, n, s, r, a, l = this,
            h = t.default_qty_value,
            c = $.extend({}, t.default_qty_type),
            d = this._property.inputs[h.id],
            u = this._setStdInput(h, $.t("Order size"), !0),
            _ = new p(u, d, e, !1, this.model(), "Change Order Size");
        this.bindControl(_), i = u.closest("td"), i.removeAttr("colspan"), o = this._study.reportData() && this._study.reportData().currency || "USD", n = $('<option value="cash_per_order">' + o + "</option>"), c.options = [$('<option value="fixed">' + $.t("Contracts") + "</option>"), n, $('<option value="percent_of_equity">' + $.t("% of equity") + "</option>")], s = this._setStdInput(c, "type"), r = s.closest("td"), a = r.closest("tr"), r.removeAttr("colspan"), r.detach().insertAfter(i), a.remove(), this._study.watchedData.subscribe(function() { l.__updateComboCurrency(n, s, "cash_per_order") })
    }, o.prototype.__updateComboCurrency = function(t, e, i, o) {
        var n, s = this._study.reportData() && this._study.reportData().currency || "USD";
        o && (s += o), t.text(s), n = e.closest("td"), n.find("a[href=#" + i + "]").text(s), t.prop("selected") && n.find(".sbSelector").text(s)
    }, o.prototype._setFillLimitsInputs = function(t) {
        var e = this._setStdInput(t.backtest_fill_limits_assumption, $.t("Verify Price for Limit Orders")),
            i = e.closest("td");
        i.removeAttr("colSpan"), $("<td>").text($.t("ticks", { context: "slippage ... ticks" })).insertAfter(i)
    }, o.prototype._setSlippageInputs = function(t) {
        var e, i;
        void 0 !== t.slippage && (e = this._setStdInput(t.slippage, $.t("Slippage")), i = e.closest("td"), i.removeAttr("colSpan"), $("<td>").text($.t("ticks", { context: "slippage ... ticks" })).insertAfter(i))
    }, o.prototype._setCommissionInputs = function(t) {
        function e(t) { return t = +t, isNaN(t) || t < 0 ? 0 : ("percent" !== u.val() ? t = parseFloat(t) : t > 100 && (t = 100), t) }
        var i, o, n, s, r, a, l, h, c, d, u, _, f;
        void 0 !== t.commission_value && void 0 !== t.commission_type && (i = this, o = t.commission_value, n = $.extend({}, t.commission_type), s = this._property.inputs[o.id], r = this._setStdInput(o, $.t("Commission"), !0), a = new p(r, s, e, !1, this.model(), "Change Commission value"), this.bindControl(a), l = r.closest("td"), l.removeAttr("colspan"), h = this._study.reportData() && this._study.reportData().currency || "USD", c = $('<option value="cash_per_order">' + h + $.t(" per order") + "</option>"), d = $('<option value="cash_per_contract">' + h + $.t(" per contract") + "</option>"), n.options = [$('<option value="percent">' + $.t("%") + "</option>"), c, d], u = this._setStdInput(n, "type"), _ = u.closest("td"), f = _.closest("tr"), _.removeAttr("colspan"), _.detach().insertAfter(l), f.remove(), this._study.watchedData.subscribe(function() {
            i.__updateComboCurrency(c, u, "cash_per_order", $.t(" per order")),
                i.__updateComboCurrency(d, u, "cash_per_contract", $.t(" per contract"))
        }))
    }, o.prototype.prepareLayout = function() {
        this._$table = $(document.createElement("table")).addClass("property-page strategy-properties").attr("cellspacing", "0").attr("cellpadding", "2");
        var t = this._getStrategyInputs();
        t.initial_capital.min = 1, this._setStdInput(t.initial_capital, $.t("Initial capital")), Array.isArray(t.currency.options) && "NONE" === t.currency.options[0] && (t.currency.options[0] = $('<option value="NONE">' + $.t("Default") + "</option>")), this._setStdInput(t.currency, $.t("Base currency")), $('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table), this._setPyramidingInputs(t), $('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table), this._setQtyInputs(t), $('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table), this._setStdInput(t.calc_on_order_fills, $.t("Recalculate After Order filled")), $('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table), this._setStdInput(t.calc_on_every_tick, $.t("Recalculate On Every Tick")), $('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table), this._setFillLimitsInputs(t), $('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table), this._setSlippageInputs(t), $('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table), this._setCommissionInputs(t), this.loadData()
    }, o.prototype.widget = function() { return this._$table }, o.prototype.loadData = function() {
        var t, e, i;
        s.prototype.loadData.call(this), t = this._getStrategyInputs(), e = t.pyramiding, i = this._property.inputs[e.id], i.setValue(i.value(), !0)
    }, o.prototype.destroy = function() {
        var t, e, i;
        s.prototype.destroy.call(this), t = this._getStrategyInputs(), e = t.pyramiding, i = this._property.inputs[e.id], i.unsubscribe(null, this._onAllowUpToChanged)
    }, t.exports = o
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function o(t, e) { d.invalidateStudyTemplatesList(), d.removeStudyTemplate(t, e) }

        function n(t) { this._options = t || {}, this._chartWidgetCollection = this._options.chartWidgetCollection, this._SAVE_AS_TITLE = $.t("Save Indicator Template As..."), this._list = [], this._$wrapper = null, this._favoredList = null, this._loaded = !1, this._onFirstLoad = new e, this.onFavoriteListResize = new e, loginStateChange.subscribe(this, this.onLoginStateChange) }
        var s = i(367).FavoredList,
            r = i(139),
            a = r.SaveRenameDialog,
            l = r.CheckboxField,
            h = r.AutocompleteField,
            c = i(93).createConfirmDialog,
            d = i(116),
            p = i(33).trackEvent;
        n.prototype.onLoginStateChange = function() { d.invalidateStudyTemplatesList(), this.refreshFavoriteDropdownMenu() }, n.prototype.appendMenuButtonTo = function(t) { t && (this._$wrapper = t, this._generateFavoriteList()) }, n.prototype.refreshStudyTemplateList = function(t) {
                var e = this;
                d.getStudyTemplatesList(function(i) { e._list = i || [], "function" == typeof t && t() })
            }, n.prototype._generateFavoriteList = function() {
                var t = this;
                this._favoredList = new s("StudyTemplates", t._listPreparedForFavorite(), {
                    addClass: "study-template-widget",
                    popupAddClass: "study-template-popup",
                    notShowActive: !0,
                    svg: !1,
                    popupSpacing: this._options.popupSpacing,
                    notShowQuicks: this._options.notShowQuicks,
                    tooltip: $.t("Study Templates"),
                    addTooltipClass: "apply-common-tooltip"
                }), t.refreshFavoriteDropdownMenu(), this._favoredList.element().appendTo(this._$wrapper), this._favoredList.onSelect().subscribe(t, function(t) { t !== this._SAVE_AS_TITLE && this.applyStudyTemplate(t) }), this._favoredList.onSelect().subscribe(t, function(t) { t === this._SAVE_AS_TITLE && this.showSaveAsDialog() }), this._favoredList.onResize().subscribe(t._chartWidgetCollection, t._chartWidgetCollection.updateLayout), this._favoredList.onResize().subscribe(this.onFavoriteListResize, this.onFavoriteListResize.fire), this._favoredList.onOpen().subscribe(t, function() { t.refreshFavoriteDropdownMenu() })
            }, n.prototype._listPreparedForFavorite = function(t) { var e, o, n, s, r; return t = t || this._list, e = this, o = this.plainList("default"), n = this.plainList("custom"), s = [{ id: e._SAVE_AS_TITLE, title: e._SAVE_AS_TITLE, addClass: "special", toQuickButtonStyle: { display: "none" } }, { separator: !0 }], r = function(t, o) { return $.map(t, function(t) { var n = { id: t, title: $.t(t), svg: $(i(165)).attr({ width: 13, height: 13 }), favoriteButton: { icon: {}, title: t, addClass: "apply-common-tooltip" } }; return o && (n.drop = function() { this.deleteStudyTemplate(t) }.bind(e)), n }) }, n.length && (s = s.concat(r(n, !0)).concat([{ separator: !0 }])), s = s.concat(r(o)) }, n.prototype.applyStudyTemplate = function(t) {
                function e(e) { p("GUI", "Load Study Template"), i.model().model().restoreStudyTemplate(JSON.parse(e.content), t), i.updateSeriesControlUI() }
                var i = this._chartWidgetCollection.activeChartWidget.value();
                TVSettings.setValue("defaultStudyTemplate", t), d.getStudyTemplateContent(t, e)
            }, n.prototype.showSaveAsDialog = function() {
                var t = this,
                    e = this._chartWidgetCollection.activeChartWidget.value(),
                    i = function(i, o) {
                        var n, s, r, a, l, h;
                        i = TradingView.clean(i), n = JSON.stringify(e.model().model().studyTemplate(o)), s = { name: i, content: n }, r = t.plainList().includes(i), a = function() {
                            var e = function(e) { e.error || (TVSettings.setValue("defaultStudyTemplate", i), d.invalidateStudyTemplatesList(), t.refreshFavoriteDropdownMenu()) };
                            d.saveStudyTemplate(s, e)
                        }, r ? (l = $.t("Study Template '{0}' already exists. Do you really want to replace it?").format(i), h = c({ type: "modal", content: l }), h.on("action:yes", function(t) { a(), t.close() }), h.open()) : a()
                    };
                runOrSignIn(function() {
                    var o = "text",
                        n = "bool";
                    t.refreshStudyTemplateList(function() { new a({ fields: [new h({ name: o, label: $.t("Template name") + ":", error: $.t("Please enter template name"), source: t.list(), valueField: "name", textField: "name", maxLength: 64 }), new l({ name: n, label: $.t("Save Interval"), hint: $.t('When selecting this checkbox the study template will set "__interval__" interval on a chart', { interval: e.model().model().mainSeries().interval() }) })], title: $.t("Save Indicator Template As") }).show().then(function(t) { i(t[o], t[n]) }) })
                }, { source: "Study templates save as", sourceMeta: "Chart" })
            }, n.prototype.refreshFavoriteDropdownMenu = function() {
                var t = this,
                    e = this._favoredList;
                e && t.refreshStudyTemplateList(function() { e.reload(t._listPreparedForFavorite()), e.element().hasClass("active") && (e.element().trigger("click"), e.openMenu()) })
            },
            n.prototype.deleteStudyTemplate = function(t) {
                var e = this,
                    i = $.t("Do you really want to delete Study Template '{0}' ?").format(t);
                runOrSignIn(function() {
                    var n = c({ type: "modal", content: i });
                    n.on("action:yes", function(i) { e._favoredList.removeById(t), i.actionLoader("yes", "start"), o(t, function() { setTimeout(function() { e.refreshFavoriteDropdownMenu(), i.actionLoader("yes", "stop"), i.close() }, 0) }) }), n.open()
                }, { source: "Study templates delete" })
            }, n.prototype.container = function() { return this._favoredList ? this._favoredList.element() : null }, n.prototype.list = function() { return this._list }, n.prototype.plainList = function(t) { return "default" === t ? $.map(jQuery.grep(this._list, function(t) { return !!t.is_default }), function(t) { return t.name }) : "custom" === t ? $.map(jQuery.grep(this._list, function(t) { return !t.is_default }), function(t) { return t.name }) : $.map(this._list, function(t) { return t.name }) }, t.exports = n
    }).call(e, i(15))
}, function(t, e, i) {
    (function(e, o, n) {
        "use strict";

        function s(t, i) {
            function o(t, o, s) {
                var r, a, l, h, c, d, p, u, _, f, m, g = [];
                if (s.openEveryDay) g = [0, 1, 2, 3, 4, 5, 6];
                else if (s.openOnDays)
                    for (r = s.openOnDays, a = 0; a < r.length; a++) g.push(parseInt(r[a]) - 1);
                else g = [1, 2, 3, 4, 5];
                for (l = function(t) { return 60 * parseInt(t[0], 10) + parseInt(t[1], 10) }, h = l(t), c = l(o), d = h && h >= c, d && 0 !== g[0] && g.unshift(0), p = "", u = [], _ = g[0] - 1, f = g.length, a = 0; a < f; a++) _ + 1 < g[a] || a + 1 === f ? (p += n + e.weekdaysMin(g[a]), u.push(p), p = "") : p || (p = e.weekdaysMin(g[a])), _ = g[a];
                return m = "{0}:{1}{2}{3}:{4}".format(t[0], t[1], n, o[0], o[1]), u.map(function(t) { return t + i + m })
            }
            var n, s, r, a, l;
            return i = i || " ", n = "-", t ? "24x7" === t ? o(["00", "00"], ["00", "00"], { openEveryDay: !0 }) : (s = /([0-2]\d)([0-5]\d)-([0-2]\d)([0-5]\d)(?:\:(\d+))?/, (r = s.exec(t)) ? (a = [r[1], r[2]], l = [r[3], r[4]], o(a, l, { openOnDays: r[5] })) : {}) : {}
        }

        function r(t, e) {
            var i, r, d, p, u, _, f, m, g, v, y, b, w, S, T;
            if (null == t && (t = a.symbol.value()), null != t) return t += "", i = e && e.symbolInfo, r = $.t("Symbol Info"), d = TVDialogs.createDialog(r, { width: 450 }), p = d.find("._tv-dialog-content"), u = $(document.createElement("div")).addClass("main").addClass("symbol-info-dialog").appendTo(p), _ = function(t) {
                    var e, i = l;
                    for (e = 0; e < i.length; e++)
                        if (i[e].id === t) return i[e].title;
                    return t
                }, f = function(t) { return s(t).join("<br/>") }, m = [{ title: $.t("Symbol Name"), propName: o.enabled("charting_library_base") ? "name" : "pro_name" }, { title: $.t("Symbol Description"), propName: "description" }, { title: $.t("Symbol Type"), propName: "type" }, { title: $.t("Point Value"), propName: "pointvalue" }, { title: $.t("Exchange"), propName: "exchange" }, { title: $.t("Listed Exchange"), propName: "listed_exchange" }, { title: $.t("Currency"), propName: "currency_code", formatter: function(t) { return t || "USD" }, defValue: "USD" }, { title: $.t("Price Scale"), propName: "pricescale" }, { title: $.t("Min Move"), propName: "minmov" }, { title: $.t("Min Move 2"), propName: "minmove2" }, { title: $.t("Sector"), propName: "sector" }, { title: $.t("Industry"), propName: "industry" }, { title: $.t("Timezone"), propName: "timezone", formatter: _, optional: !0 }, { title: $.t("Session"), propName: "session", formatter: f, optional: !0, setHtml: !0 }],
                g = '<table cellspacing=0>{{#fields}}<tr{{#optional}} class="js-optional"{{/optional}}><td class="symbol-info-column"><span class="js-symbol-info-title symbol-info-text">{{title}}</span></td><td class="symbol-info-value"><span class="js-symbol-info-value symbol-info-text">{{#defValue}}{{defValue}}{{/defValue}}{{^defValue}}-{{/defValue}}</span></td></tr>{{/fields}}</table>', v = $(n.render(g, { fields: m })).appendTo(u), v.find(".js-symbol-info-title").each(function(t, e) { m[t].$title = $(e) }), v.find(".js-symbol-info-value").each(function(t, e) { m[t].$element = $(e) }), y = function(t) { return t || "-" }, b = 0, w = function(t) {
                    var e, i, o, n;
                    for (e = 0; e < m.length; e++)(i = m[e].propName) in t && (o = t[i], "minmove2" === i && t.minmove2 > 0 && !t.fractional && t.pricescale ? (o = new h(t.pricescale / o).format(o / t.pricescale), m[e].$title.text($.t("Pip Size"))) : o = (m[e].formatter || y)(o), m[e].setHtml ? m[e].$element.html(o) : m[e].$element.text(o), m.splice(e, 1), e--);
                    (n = t.type && "economic" === t.type || t.listed_exchange && ["QUANDL", "BSE_EOD", "NSE_EOD", "LSE_EOD"].indexOf(t.listed_exchange) >= 0) && v.find(".js-optional").remove()
                }, i && w(i), b < m.length && window.quoteSessionMultiplexerInstance && (S = "symbolinfodialog." + c.guid(), quoteSessionMultiplexerInstance.full.subscribe(S, t, function(e, i) { w(i.values), quoteSessionMultiplexerInstance.full.unsubscribe(S, t) })), T = $(document.createElement("div")).addClass("dialog-buttons").appendTo(u), $(document.createElement("a")).addClass("_tv-button").addClass("cancel").text($.t("Close", { context: "input" })).appendTo(T).click(function() { TVDialogs.destroy(d.data("title")) }), TVDialogs.positionDialog(d), TVDialogs.applyHandlers(d), d
        }
        var a = i(72),
            l = i(161).availableTimezones,
            h = i(27).PriceFormatter,
            c = i(60);
        t.exports = r
    }).call(e, i(40), i(3), i(30))
}, function(t, e, i) {
    "use strict";
    var o = i(3);
    t.exports.displayedExchangesFilter = function(t) { return o.enabled("symbol_search_limited_exchanges") && (t = t.filter(function(t) { return !("bitcoin" === t.flag || t.hideInSymbolSearch) })), t }, t.exports.sortExchangesListByFlagIfNeeded = function(t) { return t }
}, 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(495), n = i(194), s = i(1).LineDataSource, r = i(159), a = i(47), l = a.ActionSeparator, h = i(101), c = i(21), d = i(120), p = d.resizeCanvas, u = d.clearRect, _ = d.addCanvasTo, f = d.Size, m = i(106).setMouseEventHandler, g = i(33).trackEvent, v = i(163).makeFont, y = i(221), 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") && t.tmzProperties && 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 }, 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(3))
}, function(t, e, i) {
    "use strict";

    function o(t, e, i, o) { this._chartWidgetCollection = t, this._chartSaverInstance = e, this._chartApiInstance = i, this._saveLoad = o, this._fakeListChangedDelegate = null }
    var n, s = i(72),
        r = i(597),
        a = i(218).layouts,
        l = i(34),
        h = i(101),
        c = i(223).closeAllDialogs,
        d = i(42),
        p = i(291),
        u = i(116),
        _ = i(12),
        f = i(138).createNoticeDialog,
        m = i(93).createConfirmDialog;
    o.prototype.subscribe = function(t, e) { l.subscribe(t, e) }, o.prototype.unsubscribe = function(t, e) { l.unsubscribe(t, e) }, o.prototype.onContextMenu = function(t) { l.subscribe("onContextMenu", function(e) { e.callback(t(e.unixtime, e.price)) }) }, o.prototype.onGrayedObjectClicked = function(t) { l.subscribe("onGrayedObjectClicked", t) }, o.prototype.activeChart = function() { return new r(this._chartWidgetCollection.activeChartWidget.value()) }, o.prototype.onActiveChartChanged = function() { return this._activeChangedChangedDelegate }, o.prototype.changeSymbol = function(t, e, i) { s.interval.setValue(e), s.symbol.setValue(t), i && this.activeChart().onDataLoaded().subscribe(null, i, !0) }, o.prototype.setLayout = function(t) { this._chartWidgetCollection.layout.setValue(t) }, o.prototype.layout = function() { return this._chartWidgetCollection.layout.value() }, o.prototype.chartsCount = function() { return a[this.layout()].count }, o.prototype.chart = function(t) { if (void 0 === t && (t = 0), t < 0 || t > this.chartsCount()) throw Error("Incorrect index: " + t); return new r(this._chartWidgetCollection.getAll()[t]) }, o.prototype.getSymbolInterval = function(t) { var e = { symbol: s.symbol.value(), interval: s.interval.value() }; return t && t(e), e }, o.prototype.getVisibleRange = function(t) { var e = this.activeChart().getVisibleRange(); return t && t(e), e }, o.prototype.saveChart = function(t) {
        var e = this;
        this._chartSaverInstance.whenReadyToSave(function() { var i = e._chartSaverInstance.saveToJSON(); return t && t(JSON.parse(i.content)) })
    }, o.prototype.loadChart = function(t) {
        this._chartApiInstance.purgeCache(), this._chartApiInstance._studyEngine.stopSources(), this._chartWidgetCollection.loadContent(t.json), this._chartWidgetCollection.purgeUnusedWidgets(), t.extendedData && (this._chartWidgetCollection.metaInfo.id.setValue(t.extendedData.uid),
            this._chartWidgetCollection.metaInfo.uid.setValue(t.extendedData.uid), this._chartWidgetCollection.metaInfo.name.setValue(t.extendedData.name)), s.symbol.setValue(this.activeChart().symbol()), l.emit("chart_loaded")
    }, o.prototype.getStudiesList = function() { return this._chartApiInstance.allStudiesMetadata().filter(function(t) { return !t.is_hidden_study }).map(function(t) { return t.name || t.description }) }, o.prototype.getSavedCharts = function(t) { u.getCharts(t) }, o.prototype.loadChartFromServer = function(t) { u.loadChart(t) }, o.prototype.saveChartToServer = function(t, e, i, o) { this._chartSaverInstance.saveChartSilently(t, i, e, o) }, o.prototype.removeChartFromServer = function(t, e) { u.removeChart(t, e) }, o.prototype.getIntervals = function() { return p.sortIntervals(p.getIntervals()) }, o.prototype.closePopupsAndDialogs = function() { document.querySelectorAll("._tv-dialog-title-close").forEach(function(t) { t.click() }), c(), h.hideAll() }, n = { cursor: "", dot: "", arrow_cursor: "arrow", eraser: "", measure: "", zoom: "", brush: "LineToolBrush" }, o.prototype.selectLineTool = function(t) {
        var e = i(189);
        if (e[t]) t = e[t].name;
        else {
            if (!n.hasOwnProperty(t)) return;
            t = n[t] || t
        }
        d.tool.value() !== t && (TradingView.supportTouch() && this._chartWidgetCollection.selectedSource.value() && this._chartWidgetCollection.activeChartWidget.value().model().lineBeingCreated() && this._chartWidgetCollection.activeChartWidget.value().model().cancelCreatingLine(), d.tool.setValue(t))
    }, o.prototype.selectedLineTool = function() {
        var t, e, o, s = i(189),
            r = Object.keys(s),
            a = d.tool.value();
        for (t = 0; t < r.length; ++t)
            if (s[r[t]].name === a) return r[t];
        for (r = Object.keys(n), t = 0; t < r.length; ++t) { if (e = r[t], (o = n[e]) && o === a) return r[t]; if (e === a) return e }
        return ""
    }, o.prototype.createStudyTemplate = function(t, e) { var i = this.activeChart().createStudyTemplate(t); return e && e(i), i }, o.prototype.mainSeriesPriceFormatter = function() { return this._chartWidgetCollection.activeChartWidget.value().model().mainSeries().priceScale().formatter() }, o.prototype.showNoticeDialog = function(t) {
        function e() { i && (i(), i = null) }
        var i, o;
        t = t || {}, i = t.callback, o = f({ title: t.title, content: t.body || "" }), o.on("action:ok", e), o.on("afterClose", e), o.open()
    }, o.prototype.showConfirmDialog = function(t) {
        function e(t) { i && (i(t), i = null) }
        var i, o;
        if (t = t || {}, !t.callback) throw Error("callback must be exist");
        i = t.callback, o = m({ title: t.title, content: t.body || "" }), o.on("action:yes", e.bind(null, !0)), o.on("action:no", e.bind(null, !1)), o.on("afterClose", e.bind(null, !1)), o.open()
    }, o.prototype.logs = function() { return { getLogHistory: _.getLogHistory, enable: _.loggingOn, disable: _.loggingOff } }, o.prototype.showLoadChartDialog = function() { this._saveLoad && this._saveLoad.signInOrLoadChart() }, o.prototype.showSaveAsChartDialog = function() { this._saveLoad && this._saveLoad.signInOrSaveAs() }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o() {
        this._$wrap = $(document.createElement("span")), this._undo = $('<span class="button undo disabled"></span>').append($(i(899))).attr("title", "").appendTo(this._$wrap), this._redo = $('<span class="button redo disabled"></span>').append($(i(890))).attr("title", "").appendTo(this._$wrap);
        var t = this;
        this._undo.click(function() { t.undo() }), this._redo.click(function() { t.redo() }), n.undoStack().onChange().subscribe(this, this.update), n.redoStack().onChange().subscribe(this, this.update)
    }
    var n = i(53).UndoHistory,
        s = i(33).trackEvent,
        r = i(125).updateTooltipText;
    o.prototype.update = function() {
        var t = n.undoStack(),
            e = n.redoStack();
        t.isEmpty() ? (this._undo.addClass("disabled"), this._undo.removeClass("apply-common-tooltip"), this._undo.attr("title", null)) : (this._undo.removeClass("disabled"), this._undo.addClass("apply-common-tooltip"), this._undo.attr("title", $.t("Undo {0}").format(t.head().text() || "") + "\nCtrl+Z"), r(this._undo)), e.isEmpty() ? (this._redo.addClass("disabled"), this._redo.removeClass("apply-common-tooltip"), this._redo.attr("title", null)) : (this._redo.removeClass("disabled"), this._redo.addClass("apply-common-tooltip"), this._redo.attr("title", $.t("Redo {0}").format(e.head().text() || "") + "\nCtrl+Y"), r(this._redo))
    }, o.prototype.undo = function() { this._undo.hasClass("disabled") || (s("GUI", "Undo"), n.undo()) }, o.prototype.redo = function() { this._redo.hasClass("disabled") || (s("GUI", "Redo"), n.redo()) }, o.prototype.element = function() { return this._$wrap }, o.prototype.undoElement = function() { return this._undo }, o.prototype.redoElement = function() { return this._redo }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e, i) { s.call(this, t, e), this._study = i, this.prepareLayout() }
    var n = i(5),
        s = n.PropertyPage,
        r = n.BooleanBinder,
        a = n.SimpleComboBinder,
        l = n.SliderBinder,
        h = n.ColorBinding,
        c = i(13).createLineWidthEditor,
        d = i(369).createPlotEditor;
    inherit(o, s), o.prototype.prepareLayout = function() {
        var t, e, o, n, s, p, u, _, f, m, g, v, y = this._study.properties();
        this._table = $('<table class="property-page" cellspacing="0" cellpadding="2">'), t = this.addLabeledRow(this._table, "Volume"), e = d(), $("<td>").append(e).appendTo(t), this.bindControl(new a(e, y.styles.vol.plottype, parseInt, !0, this.model(), "Change Volume Plot Style")), o = this._study.metaInfo().version <= 46 && "transparency" in y ? y.transparency : y.styles.vol.transparency, n = this.createColorPicker(), $("<td>").append(n).appendTo(t), this.bindControl(new h(n, y.palettes.volumePalette.colors[0].color, !0, this.model(), "Change Up Volume color", o)), s = this.createColorPicker(), $("<td>").append(s).appendTo(t), this.bindControl(new h(s, y.palettes.volumePalette.colors[1].color, !0, this.model(), "Change Down Volume color", o)), p = $("<input type='checkbox'>"), $("<td>").appendTo(t), $("<td>").append(p).appendTo(t), $("<td>" + $.t("Price Line") + "</td>").appendTo(t), this.bindControl(new r(p, y.styles.vol.trackPrice, !0, this.model(), "Change Price Line")), u = y.styles.vol_ma, _ = this.addLabeledRow(this._table, "Volume MA"), f = d(), $("<td>").append(f).appendTo(_), this.bindControl(new a(f, u.plottype, parseInt, !0, this.model(), "Change Volume MA Plot Style")), $("<td>").html("&nbsp;").appendTo(_), m = this.createColorPicker(), $("<td>").append(m).appendTo(_), this.bindControl(new h(m, u.color, !0, this.model(), "Change Volume MA color", u.transparency)), g = c(), $("<td>").append(g).appendTo(_), this.bindControl(new l(g, u.linewidth, !0, this.model(), "Change Volume MA Line Width")),
            p = $("<input type='checkbox'>"), $("<td>").append(p).appendTo(_), $("<td>" + $.t("Price Line") + "</td>").appendTo(_), this.bindControl(new r(p, u.trackPrice, !0, this.model(), "Change Price Line")), v = i(87).StudyStylesPropertyPage, v.prototype._putStudyDefaultStyles.call(this, this._table, 8)
    }, o.prototype.widget = function() { return this._table }, t.exports = o
}, 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 }
    }
    var a = i(8),
        l = i(343),
        h = i(25),
        c = i(44).assert,
        d = i(14),
        p = i(2);
    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), 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) {
    "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(2),
        l = i(89).HorzLineRenderer,
        h = i(8),
        c = i(25),
        d = i(44).assert,
        p = i(14);
    a = i(2), 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) {
    (function(e, o, n, s) {
        "use strict";

        function r(t, i, s, a, l, h, c, d, p) {
            var y, w, S, C;
            this._version = r.version, this._readOnly = a, this._undoModel = d, this._properties = s, this._isSnapshot = p, this.setStudiesMetaData(h, c), this.m_timeScale = new v(this), this.m_panes = [], this.m_gridSource = new m, this.m_crossHairSource = new u(this, O.properties()), this.m_width = 0, this._tagsChanged = new e, this._lineCancelled = new e, this._magnet = new g(O.properties().magnet, this.m_timeScale, s.paneProperties.magnetSensivity), y = new V("chartproperties.mainSeriesProperties"), y.addExclusion("lockScale"), y.addExclusion("minTick"), y.addExclusion("priceAxisProperties.percentage"), y.addExclusion("priceAxisProperties.log"), this.createPane(void 0, !1, { rightAxisProperties: y.priceAxisProperties.state(["autoScale"]) }), this.m_panes[0]._stretchFactor = 2 * _.DEFAULT_STRETCH_FACTOR, this.m_panes[0]._isMainPane = !0, this.m_selectedSource = null, this._selectedSourceChanged = new e, this._chartApi = t, this._invalidateHandler = i, this.m_hoveredSource = null, this._properties.listeners().subscribe(this, r.prototype.propertyChangeHandler), w = this, this._properties.timezone.listeners().subscribe(null, function() { w._chartApi && w._chartApi.connected() && w._chartApi.switchTimezone(w.timezone()) }), this._properties.timeScale.rightOffset.listeners().subscribe(null, function() { w.m_timeScale.setOffset(w._properties.timeScale.rightOffset.value()), w.recalculateAllPanes() }), y.merge(s.mainSeriesProperties.state()), this.m_mainSeries = new D(this, y, l), this.m_panes[0].addDataSource(this.m_mainSeries, this.m_panes[0].rightPriceScale()), this.m_mainSeries.onCompleted().subscribe(this, function() { w.clearCurrentPosition(), w._scrollingState && w.gotoTime() }), a || (y.addChild("priceAxisProperties", this.m_mainSeries.m_priceScale.properties()), y.lockScale.listeners().subscribe(this, function(t) {
                var e = t.value();
                e && (y.priceAxisProperties.percentage.setValue(!1), y.priceAxisProperties.logDisabled.setValue(!1)), y.priceAxisProperties.percentageDisabled.setValue(e), y.priceAxisProperties.logDisabled.setValue(e)
            }), this._properties.paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this, function(t) { t.value() || w._properties.paneProperties.legendProperties.showStudyArguments.setValue(!1) })), this._barsMarksSources = [], this._syncPointCache = {}, o.enabled("charting_library_base") && (S = new T(this), S.setOwnerSource(this.m_mainSeries), this._barsMarksSources.push(S), C = new b(this), C.setOwnerSource(this.m_mainSeries), this._barsMarksSources.push(C)), this.m_watermarkSource = new f(this.m_mainSeries), this._brandingSource = null, this.strategySources = [], this.strategySources.change = new e, this._activeStrategySource = new n(null), this._oldStartVisibleIndex = -1, this._oldEndVisibleIndex = -1, this._currentTool = "", O.hideAllDrawings().subscribe(this, r.prototype.visibilityChangeHandler), this._properties.scalesProperties.listeners().subscribe(this, r.prototype.fullUpdate), this._id = N.guid(), this._studyInserted = new e, this._chartThemeLoaded = new e, this._resetScales = new e
        }
        var a = i(37),
            l = a.parseRgb,
            h = a.rgbToBlackWhiteString,
            c = i(2),
            d = i(199),
            p = i(1).LineDataSource,
            u = i(678),
            _ = i(209),
            f = i(710),
            m = i(686),
            g = i(695),
            v = i(707),
            y = i(210),
            b = i(709),
            w = i(102).BarsMarksContainer,
            S = i(533).Branding,
            T = i(708),
            C = i(21),
            x = i(31),
            P = x.Study,
            L = x.createStudy,
            k = x.prepareStudyProperties,
            I = i(80),
            A = i(157),
            E = i(78).StudyLineDataSource,
            M = i(81).ScaleType,
            D = i(43),
            O = i(42),
            V = i(7).DefaultProperty,
            B = i(356).SyncPoint,
            R = i(33).trackEvent,
            N = i(60),
            F = i(12).getLogger("Chart.ChartModel");
        r.prototype.setStudiesMetaData = function(t, e) { this._studiesMetaData = t, this._studyVersioning = new I(this._studiesMetaData, e) }, r.prototype.isSnapshot = function() { return this._isSnapshot }, r.prototype.currentTool = function() { return this._currentTool }, r.prototype.setCurrentTool = function(t) { this._currentTool = t }, r.prototype.timezone = function() { return this._properties.timezone.value() }, r.prototype.version = function() { return this._version }, r.prototype.initConnection = function() { this._chartApi.switchTimezone(this.timezone()) }, r.prototype.dumpViews = function() { var t, e, i, o, n = {}; for (n.panes = [], t = 0; t < this.m_panes.length; t++) n.panes.push(this.m_panes[t].dumpViews()); for (n.dataWindow = [], e = this.dataSources(), t = 0; t < e.length; t++) i = e[t], (o = i.dataWindowView()) && n.dataWindow.push(o.dump()); return n }, r.prototype._paneInvalidationMask = function(t, e) {
                var i = new C,
                    o = this.m_panes.indexOf(t);
                return void 0 === e && (e = C.LIGHT_UPDATE), i.invalidatePane(o, e), i
            }, r.prototype.updatePane = function(t) {
                var e = this._paneInvalidationMask(t);
                this.invalidate(e)
            }, r.prototype.fullUpdate = function() { this.invalidate(new C(C.FULL_UPDATE)) }, r.prototype.updateSource = function(t) {
                var e = this.paneForSource(t),
                    i = this._paneInvalidationMask(e);
                this.invalidate(i)
            }, r.prototype.studiesMetaData = function() { return this._studiesMetaData }, r.prototype.studyVersioning = function() { return this._studyVersioning }, r.prototype.disconnect = function() { var t, e, i = this.dataSources(); for (e = 0; e < i.length; e++) t = i[e], t.disconnect && t.disconnect() }, r.prototype.restart = function() { var t, e, i; for (this.initConnection(), this.m_timeScale.reset(), this.m_mainSeries.restart(), t = this.dataSources(), e = 0; e < t.length; e++) i = t[e], i.restart && i !== this.m_mainSeries && i.restart() }, r.prototype.startNotStartedStudies = function() { var t, e; if (!this.m_mainSeries.isStarted()) throw Error("Cannot start studies: main series is not started"); for (t = this.dataSources(), e = 0; e < t.length; e++) t[e] instanceof P && !t[e].isStarted() && t[e].restart && t[e] !== this.m_mainSeries && t[e].restart() }, r.prototype.updateLineTools = function() { var t, e, i = this.dataSources(); for (t = 0; t < i.length; t++) TradingView.isInherited(i[t].constructor, p) && (e = i[t], e.tryCreateServerPoints(), e.checkAlert && e.checkAlert()) }, r.prototype.realignLineTools = function() { var t, e, i = this.dataSources(); for (t = 0; t < i.length; t++) TradingView.isInherited(i[t].constructor, p) && (e = i[t], e.calcIsActualSymbol()); for (t = 0; t < this.m_panes.length; t++) this.m_panes[t].invalidateSourcesCache() }, r.prototype.readOnly = function() { return this._readOnly }, r.prototype.properties = function() { return this._properties }, r.prototype.lineCancelled = function() { return this._lineCancelled },
            r.prototype.crossHairMoved = function() { return this.m_crossHairSource.moved() }, r.prototype.chartApi = function() { return this._chartApi }, r.prototype.propertyChangeHandler = function() { this.invalidate(new C(C.LIGHT_UPDATE)) }, r.prototype.visibilityChangeHandler = function() { this.setSelectedSource(), this.invalidate(new C(C.LIGHT_UPDATE)) }, r.prototype.updateAllPaneViews = function() { var t, e; for (t = 0; t < this.m_panes.length; t++) e = this.m_panes[t], e.updateAllViews() }, r.prototype.mainSeries = function() { return this.m_mainSeries }, r.prototype.timeScale = function() { return this.m_timeScale }, r.prototype.panes = function() { return this.m_panes }, r.prototype.gridSource = function() { return this.m_gridSource }, r.prototype.watermarkSource = function() { return this.m_watermarkSource }, r.prototype.brandingSource = function() { return this._brandingSource }, r.prototype.crossHairSource = function() { return this.m_crossHairSource }, r.prototype.barsMarksSources = function() { return this._barsMarksSources }, r.prototype.width = function() { return this.m_width }, r.prototype.setPaneHeight = function(t, e) { t.setHeight(e), this.recalculateAllPanes(), this.invalidate(new C(C.LIGHT_UPDATE)) }, r.prototype.setWidth = function(t) {
                var e, i;
                for (this.m_width = t, this.m_timeScale.setWidth(this.m_width), e = 0; e < this.m_panes.length; ++e) i = this.m_panes[e], i.setWidth(t);
                this.recalculateAllPanes()
            }, r.prototype.createPane = function(t, e, i) {
                var o, n;
                if (this._undoModel._chartWidget.isMaximizedPane() && this._undoModel._chartWidget.toggleMaximizePane(), o = this._properties.paneProperties, i && o.merge(i), n = new _(this.m_timeScale, o, this, e), "number" == typeof t && isFinite(t)) {
                    if (t < 0 || t > this.m_panes.length) return void F.logDebug("ChartModel.createPane: invalid index: " + t);
                    this.m_panes.splice(t, 0, n)
                } else this.m_panes.push(n);
                return n.onTagsChanged().subscribe(this, r.prototype.onPaneTagsChanged), n
            }, r.prototype.removePane = function(t) { this._undoModel._chartWidget.isMaximizedPane() && this._undoModel._chartWidget.toggleMaximizePane(), t.destroy(); var e = this.m_panes.indexOf(t); - 1 !== e && this.m_panes.splice(e, 1), this.invalidate(new C(C.FULL_UPDATE)) }, r.prototype.startScalePrice = function(t, e, i) { t.startScalePrice(e, i) }, r.prototype.scalePriceTo = function(t, e, i) { t.scalePriceTo(e, i), this.mainSeries().properties().lockScale.value() ? this.invalidate(new C(C.LIGHT_UPDATE)) : this.invalidate(this._paneInvalidationMask(t, C.LIGHT_UPDATE)) }, r.prototype.endScalePrice = function(t, e) { t.endScalePrice(e), this.invalidate(this._paneInvalidationMask(t, C.LIGHT_UPDATE)) }, r.prototype.startScrollPrice = function(t, e, i) { t.startScrollPrice(e, i) }, r.prototype.scrollPriceTo = function(t, e, i) { t.scrollPriceTo(e, i), this.invalidate(this._paneInvalidationMask(t, C.LIGHT_UPDATE)) }, r.prototype.endScrollPrice = function(t, e) { t.endScrollPrice(e), this.invalidate(this._paneInvalidationMask(t, C.LIGHT_UPDATE)) }, r.prototype.setPriceAutoScale = function(t, e, i) { t.setPriceAutoScale(e, i), this.invalidate(this._paneInvalidationMask(t, C.LIGHT_UPDATE)) }, r.prototype.restorePriceScaleState = function(t, e, i) { t.restorePriceScaleState(e, i), this.invalidate(this._paneInvalidationMask(t, C.LIGHT_UPDATE)) },
            r.prototype.resetPriceScale = function(t, e) { t.resetPriceScale(e), this.invalidate(this._paneInvalidationMask(t, C.LIGHT_UPDATE)) }, r.prototype.updateScales = function(t, e) { this._undoModel._chartWidget._updateScalesActions() }, r.prototype.startScaleTime = function(t) { this.m_timeScale.startScale(t) }, r.prototype.scaleTimeTo = function(t) { this.m_timeScale.scaleTo(t), this.recalculateAllPanes(), this.invalidate(new C(C.LIGHT_UPDATE)) }, r.prototype.endScaleTime = function() { this.m_timeScale.endScale(), this.invalidate(new C(C.LIGHT_UPDATE)), this.mainSeries().requestMoreData(), this.recalcVisibleRangeStudy(this.dataSources()) }, r.prototype.startScrollTime = function(t) { this.m_timeScale.startScroll(t), this._isTimeScrolling = !0 }, r.prototype.scrollTimeTo = function(t) { this.m_timeScale.scrollTo(t), this.recalculateAllPanes(), this.invalidate(new C(C.LIGHT_UPDATE)) }, r.prototype.endScrollTime = function() { this.m_timeScale.endScroll(), this.invalidate(new C(C.LIGHT_UPDATE)), this.mainSeries().requestMoreData(), this.recalcVisibleRangeStudy(this.dataSources()), this._isTimeScrolling = !1 }, r.prototype.recalcStudyBasedLineTools = function() { this.dataSources().forEach(function(t) { t instanceof E && t.recalcStudyIfNeeded && t.recalcStudyIfNeeded() }) }, r.prototype.recalcVisibleRangeStudy = function(t, e) {
                void 0 !== this._recalcVRTimerId && clearTimeout(this._recalcVRTimerId);
                var i = this;
                this._recalcVRTimerId = setTimeout(function() { i._recalcVisibleRangeStudy(t, e) }, 1e3)
            }, r.prototype._recalcVisibleRangeStudy = function(t, e) {
                var i, o, n, s, r, a, l, h, c, d, p, u, _, f, m;
                if (!this.timeScale().isEmpty() && (i = this.timeScale().visibleBars(), o = this.mainSeries().nearestData(i.firstBar(), TradingView.SEARCH_NEAREST_RIGHT), n = this.mainSeries().nearestData(i.lastBar(), TradingView.SEARCH_NEAREST_LEFT), s = o ? o.index : void 0, r = n ? n.index : void 0, a = s === this._oldStartVisibleIndex, l = r === this._oldEndVisibleIndex, !a || !l || e))
                    for (this._oldStartVisibleIndex = s, this._oldEndVisibleIndex = r, h = 0; h < t.length; h++)
                        if (t[h] instanceof P) {
                            for (c = t[h], d = c.metaInfo().inputs, p = null, u = null, _ = 0; _ < d.length; _++) "first_visible_bar_time" === d[_].id ? (f = o && o.value ? o.value[TradingView.TIME_PLOT] : 0, p = 1e3 * Math.floor(f)) : "last_visible_bar_time" === d[_].id && (f = n && n.value ? n.value[TradingView.TIME_PLOT] : 0, u = 1e3 * Math.floor(f));
                            m = c.properties().inputs, p && (u ? m.first_visible_bar_time.setValueSilently(p) : m.first_visible_bar_time.setValue(p, !0)), u && m.last_visible_bar_time.setValue(u, !0)
                        }
            }, r.prototype.onResetScales = function() { return this._resetScales }, r.prototype.resetTimeScale = function() { this.m_timeScale.restoreDefault(), this.recalculateAllPanes(), this.mainSeries().requestMoreData(), this.recalcVisibleRangeStudy(this.dataSources()), this.invalidate(new C(C.LIGHT_UPDATE)), this._resetScales.fire() }, r.prototype.restoreTimeScaleState = function(t) { this.m_timeScale.restoreState(t), this.recalculateAllPanes(), this.invalidate(new C(C.LIGHT_UPDATE)) }, r.prototype.restoreFactoryDefaults = function(t) { t.restoreFactoryDefaults(), this.recalcVisibleRangeStudy(this.dataSources(), !0), this.mainSeries().onChartStyleChanged() }, r.prototype.setSelectedSource = function(t, e) {
                if (!(this.m_selectedSource === t && this._lastHittestData === e || t && t.customization && t.customization.disableSelection)) {
                    this._lastHittestData = e;
                    var i = new C;
                    this.m_selectedSource && (this.m_selectedSource.updateAllViews(), TradingView.alertsDispatcher && this.m_selectedSource.hasAlert.value() && this.m_selectedSource.getAlert({ fromCache: !0 }).done(function(t) { t && t.set("selected", !1) })), this.m_selectedSource = t, this._selectedSourceChanged.fire(t), t && (t.updateAllViews(), TradingView.alertsDispatcher && t.hasAlert.value() && t.getAlert({ fromCache: !0 }).done(function(t) { t && t.set("selected", !0) })), i.force = !0, this.invalidate(new C(C.LIGHT_UPDATE)), this.setHoveredSource(t, e)
                }
            }, r.prototype.checkLineToolSelection = function() { this.m_selectedSource && this.m_selectedSource instanceof p && (this.m_selectedSource.calcIsActualSymbol(), this.m_selectedSource.isActualSymbol() || this.setSelectedSource(null)) }, r.prototype.onSelectedSourceChanged = function() { return this._selectedSourceChanged }, r.prototype.setHoveredSource = function(t, e) {
                if (this.m_hoveredSource !== t || this._lastHittestData !== e) {
                    this._lastHittestData = e;
                    var i = null;
                    this.m_hoveredSource && (this.m_hoveredSource.updateAllViews(), i || (i = new C), TradingView.alertsDispatcher && this.m_hoveredSource.hasAlert.value() && this.m_hoveredSource.getAlert({ fromCache: !0 }).done(function(t) { t && t.set("hovered", !1) }), i.merge(this._paneInvalidationMask(this.paneForSource(this.m_hoveredSource), C.LIGHT_UPDATE))), this.m_hoveredSource = t, t && (t.updateAllViews(), i || (i = new C), i.merge(this._paneInvalidationMask(this.paneForSource(t), C.LIGHT_UPDATE)), TradingView.alertsDispatcher && t.hasAlert.value() && t.getAlert({ fromCache: !0 }).done(function(t) { t && t.set("hovered", !0) })), i && this.invalidate(i)
                }
            }, r.prototype.selectedSource = function() { return this.m_selectedSource }, r.prototype.hoveredSource = function() { return this.m_hoveredSource }, r.prototype.lastHittestData = function() { return this._lastHittestData }, r.prototype.invalidate = function(t) { this._invalidateHandler && this._invalidateHandler(t) }, r.prototype.dataSources = function() {
                var t, e, i, o = [];
                for (o.push(this.m_crossHairSource), t = 0; t < this.m_panes.length; ++t)
                    for (e = this.m_panes[t].dataSources(), i = 0; i < e.length; i++) o.push(e[i]);
                return o
            }, r.prototype.dataSourceForId = function(t) {
                var e, i;
                for (i = 0; i < this.m_panes.length; ++i)
                    if (e = this.m_panes[i].dataSourceForId(t)) return e;
                return null
            }, r.prototype.children = function(t, e) { return this.dataSources().filter(function(i) { return !(!0 === e && i instanceof P && i.isChildStudy()) && i.ownerSource() === t }) }, r.prototype.setCurrentPosition = function(t, e, i, o) {
                var n, s, r, a, l, h, c, d, u, _, f, m, g, v = NaN,
                    y = Math.round(this.m_timeScale.coordinateToIndex(t));
                if (i && (n = i.defaultPriceScale(), n.isEmpty() || (v = n.coordinateToPrice(e))), (this._lineBeingCreated || p.isLineTool(this.currentTool())) && (v = this._magnet.align(v, y, i)), this._isTimeScrolling) return void this.m_crossHairSource.setPosition(this.m_crossHairSource.index, v, i);
                for (this.m_crossHairSource.setPosition(y, v, i), this.m_crossHairSource.dataWindowView().update(), s = this.m_panes, r = s.length; r--;)
                    for (a = s[r].dataSources(),
                        l = a.length; l--;)(h = a[l].dataWindowView()) && h.update();
                this._lineBeingCreated ? (this._lineBeingCreated.setLastPoint({ index: y, price: v }, o), this._lineBeingCreated.updateAllViews(), this.invalidate(new C(C.LIGHT_UPDATE))) : this.crossHairSource().startMeasurePoint() ? this.invalidate(new C(C.LIGHT_UPDATE)) : this.invalidate(new C(C.UPDATE_CURSOR_ONLY)), this._isSettingsExternalPosition || (c = this._undoModel._chartWidget, c._chartWidgetCollection && (d = this.mainSeries(), (u = d.syncModel()) && (_ = this.m_timeScale.points().roughTime(y, u.projectTime.bind(u)), f = { timeStamp: _ }, m = i.mainDataSource(), m instanceof D && (f.price = v, f.symbol = m.symbol()), f.syncModel = u, g = this._lineBeingCreated || this._linePointBeingEdited || this._sourceBeingMoved, g = g && O.drawOnAllCharts().value(), c._chartWidgetCollection.syncCrosshair(f, c, g, o))))
            }, r.prototype.clearCurrentPosition = function() {
                var t, e, i, o, n, s, r = this.crossHairSource();
                for (r.clearPosition(), r.dataWindowView().update(), t = this.m_panes, e = t.length; e--;)
                    for (i = t[e].dataSources(), o = i.length; o--;)(n = i[o].dataWindowView()) && n.update();
                this.invalidate(new C(C.UPDATE_CURSOR_ONLY)), s = this._undoModel._chartWidget, s._chartWidgetCollection && s._chartWidgetCollection.syncCrosshair(NaN, s)
            }, r.prototype.onSyncScrollNeeded = function(t) {
                var e, i, o, n = this._undoModel._chartWidget;
                n._chartWidgetCollection && (e = this.mainSeries(), (i = e.syncModel()) && (o = 1e3 * this.m_timeScale.points().roughTime(t, i.projectTime.bind(i)), n._chartWidgetCollection.syncScroll(o, this)))
            }, r.prototype.gotoTime = function(t, e) {
                function i() { return p.tickMarks().indexToTime(p.tickMarks().minIndex).valueOf() - t }

                function o(e) { var o, n, s, r, a; if (i() < 0) { for (o = p.tickMarks().nearestIndex(t), n = +u.bars().last(), o = Math.min(o, n), s = p.tickMarks().indexToTime(o).valueOf(); s < t && o < n;) o++, s = p.tickMarks().indexToTime(o).valueOf(); return r = p.visibleBars(), a = r.lastBar() - r.firstBar(), !e && r.contains(o) || (p.zoomToBarsRange(o - a / 2, o + a / 2), u.requestMoreData()), { index: o } } }
                var n, s, r, a, l, h, c, d, p = this.timeScale(),
                    u = this.mainSeries();
                if (e && e.model && (n = u.syncModel()) && (s = this._createSyncPoint(e.model.mainSeries().syncModel(), n), t = 1e3 * s.sourceTimeToTargetTime(t / 1e3)), e = e || { centerIfVisible: !0 }, t) this._scrollingState && this._scrollingState.deferred.reject(), r = $.Deferred(), this._scrollingState = { targetDate: t, deferred: r, centerIfVisible: e.centerIfVisible };
                else {
                    if (!this._scrollingState) return F.logError("scrollTo called without an argument"), $.Deferred().reject().promise();
                    t = this._scrollingState.targetDate, r = this._scrollingState.deferred
                }
                return a = o(this._scrollingState.centerIfVisible), a || (l = p.tickMarks().minIndex, h = p.visibleBars(), c = h.lastBar() - h.firstBar(), u.endOfData() ? (p.zoomToBarsRange(l - c / 2, l + c / 2), a = { index: l, eod: !0 }) : (d = this.timeScale().tickMarks().estimateLeft(t), u.requestMoreData(Math.ceil(d + c / 2)))), a && (this.fullUpdate(), this._scrollingState = null, r.resolve(a)), r.promise()
            }, r.prototype._createSyncPoint = function(t, e) { var i, o, n = this._syncPointCache[t.uniqueId()]; if (n) { if (i = n[e.uniqueId()]) return i } else this._syncPointCache[t.uniqueId()] = {}; return o = new B(t, e), this._syncPointCache[t.uniqueId()][e.uniqueId()] = o, o },
            r.prototype.setExternalPosition = function(t, e) {
                var i, o, n, s, r, a, l, h, c, d, p, u;
                if (!Number.isNaN(t) && isNumber(t.timeStamp) && (o = this.mainSeries(), (n = o.syncModel()) && (s = this._createSyncPoint(t.syncModel, n), r = s.sourceTimeToTargetTime(t.timeStamp), i = this.m_timeScale.points().roughIndex(r, n.distance.bind(n)))), this.mainSeries().symbol() === t.symbol) return this._isSettingsExternalPosition = !0, a = this.paneForSource(this.mainSeries()), l = this.m_timeScale.indexToCoordinate(i), h = this.mainSeries().priceScale().priceToCoordinate(t.price, !0), this.setCurrentPosition(l, h, a, e || {}), void delete this._isSettingsExternalPosition;
                for (isFinite(i) ? this.crossHairSource().setPosition(i, NaN, null) : (c = this.crossHairSource(), c.clearPosition(), c.dataWindowView().update()), d = this.dataSources(), p = d.length; p--;)(u = d[p].dataWindowView()) && u.update();
                this.invalidate(new C(C.UPDATE_CURSOR_ONLY))
            }, r.prototype.updateCrossHair = function() { this.m_crossHairSource.updateIndex() }, r.prototype.updateTimeScale = function(t, e, i, o, n) {
                var s, r, a;
                if (n)
                    for (this.m_timeScale.reset(), s = this.dataSources(), r = 0; r < s.length; r++) s[r].clearData && s[r].clearData();
                this.m_timeScale.update(t, e, i, o), a = "ChartModel.prototype.updateTimeScale(" + t + "," + e + "," + i.length + "," + o.length + "," + n + ")", a += "TimeScale: {first:" + this.m_timeScale.m_points.firstTimePointIndex() + ",last:" + this.m_timeScale.m_points.lastTimePointIndex() + "}", F.logDebug(a), this.recalculateAllPanes(), this.invalidate(new C(C.LIGHT_UPDATE))
            }, r.prototype.recalculatePane = function(t) { t && t.recalculate() }, r.prototype.paneForSource = function(t) {
                for (var e = this.m_panes.length - 1; e >= 0; e--)
                    if (-1 !== this.m_panes[e].dataSources().indexOf(t)) return this.m_panes[e];
                return t instanceof w ? this.paneForSource(this.m_mainSeries) : null
            }, r.prototype.recalculateAllPanes = function() {
                for (var t = 0; t < this.m_panes.length; ++t) this.m_panes[t].recalculate();
                this.timeScale().recalcLockedScale(), this.updateAllPaneViews()
            }, r.prototype._invalidateBarColorerCaches = function() { var t, e, i = this.dataSources(); for (t = 0; t < i.length; ++t)(e = i[t]) instanceof D && e.invalidateBarColorerCache() }, r.prototype.addStrategySource = function(t) {~this.strategySources.indexOf(t) || (this.strategySources.push(t), this.strategySources.change.fire()) }, r.prototype.removeStrategySource = function(t) { var e = this.strategySources.indexOf(t);~e && (this.strategySources.splice(e, 1), this.strategySources.change.fire()) }, r.prototype.setActiveStrategySource = function(t) {~this.strategySources.indexOf(t) && this._activeStrategySource.setValue(t) }, r.prototype.unsetActiveStrategySource = function() { this._activeStrategySource.setValue(null) }, r.prototype.activeStrategySource = function() { return this._activeStrategySource }, r.prototype.insertStudy = function(t, e, i, o) {
                var n, s, r, a, l, h = null;
                return -1 === ["Study_ESD$TV_SPLITS@tv-scripting", "Study_ESD$TV_DIVIDENDS@tv-scripting", "Study_ESD$TV_SPLITS@tv-scripting", "Volume@tv-basicstudies", "Sessions@tv-basicstudies"].indexOf(t.id) && R("studies", "Study_" + t.id), n = !1, i || t.is_price_study ? h = this.paneForSource(o || this.mainSeries()) : (h = this.createPane(void 0, !0), e && e.paneSize && h.setPaneSize(e.paneSize), n = !0),
                    "Compare@tv-basicstudies" === t.id && (R("compare", "symbol:" + e.inputs.symbol), this.m_mainSeries.priceScale().properties().log.setValue(!1), this.m_mainSeries.priceScale().properties().percentage.setValue(!0)), s = k(t, e, h, this.studyVersioning(), o), r = L(this, s, o || this.mainSeries(), t), r.start(), r.childStudyByRebind().subscribe(null, function() { R("SOS", "Apply SOS", "Rebind SOS") }), a = r.metaInfo().priceScale || M.Right, !n && o instanceof P && (l = o.isNoScale() ? null : o.priceScale()), l || (a === M.Right ? l = h.rightPriceScale() : a === M.Left ? l = h.leftPriceScale() : t.is_price_study ? l = null : (F.logWarn("Cannot add study " + r.metaInfo().id + " with 'No Scale' setting, because study is not a price study. Using right price scale."), l = h.rightPriceScale())), i ? h.addDataSource(r, null) : h.addDataSource(r, l), r.properties().linkedToSeries && r.properties().linkedToSeries.value() && r.setOwnerSource(this.mainSeries()), this.recalculatePane(h), this.invalidate(new C(C.FULL_UPDATE)), this._invalidateBarColorerCaches(), this.recalcVisibleRangeStudy(this.dataSources(), !0), this._studyInserted.fire(r), r
            }, r.prototype.studyInserted = function() { return this._studyInserted }, r.prototype.replaceStudyStub = function(t, e) { var i, o, n, s = this.paneForSource(t); return null !== s && (i = t.isNoScale() ? null : t.priceScale(), o = t.zorder(), n = t.ownerSource(), s.insertDataSource(e, i, o), e.setOwnerSource(n), this.panes().forEach(function(i) { i.dataSources().forEach(function(i) { i._ownerSource === t && i.setOwnerSource(e) }) }), this.removeSource(t), e.start(), this.recalculatePane(s), this.invalidate(new C(C.FULL_UPDATE)), !0) }, r.prototype.insertStudyStub = function(t) {
                var e = this.mainSeries(),
                    i = this.paneForSource(e),
                    o = new A(this, null, t);
                return i.addDataSource(o, null), this.recalculatePane(i), this.invalidate(new C(C.FULL_UPDATE)), o
            }, r.prototype.removeStudyStub = function(t) { var e = this.dataSourceForId(t); return void 0 === e ? (F.logNormal("StudyStub id=" + t + " is not found in chart model"), !1) : (this.removeSource(e), !0) }, r.prototype.detachSource = function(t, e) { var i = this.paneForSource(t); if (i) return i.removeDataSource(t), i.isEmpty() ? (this._lineBeingCreated && i === this._paneBeingCreatedLineOn && this.cancelCreatingLine(), this.removePane(i, e), !0) : (this.invalidate(new C(C.FULL_UPDATE)), !1) }, r.prototype.removeSource = function(t, e) {
                var i, o, n, s;
                if (t === this.m_selectedSource && this.setSelectedSource(null), t === this._sourceBeingMoved && (this._sourceBeingMoved = null, this._linePointBeingMoved = null), t.stop && t.stop(), i = this.detachSource(t, e), t.metaInfo && t.metaInfo() && "Compare@tv-basicstudies" === t.metaInfo().id) {
                    for (o = this.paneForSource(this.m_mainSeries), n = o.dataSources(), s = 0; s < n.length; s++)
                        if (n[s].metaInfo && "Compare@tv-basicstudies" === n[s].metaInfo().id) return;
                    this.m_mainSeries.priceScale().properties().percentage.setValue(!1)
                }
                return this.invalidate(new C(C.FULL_UPDATE)), this._invalidateBarColorerCaches(), t.linkKey && O.removeLineTool({ model: this, linkKey: t.linkKey }), t instanceof P && t.isChildStudy() && t.source().unsetChild(t), i
            }, r.prototype.move = function(t, e, i) {
                var o, n, s, r, a = this.children(t, !0),
                    l = this.paneForSource(t),
                    h = e ? e.priceScaleName(i) : "right";
                if (l === e) {
                    for (o = e.priceScaleByName(h), n = 0; n < a.length; n++) e.move(a[n], o);
                    e.move(t, o)
                } else {
                    for (s = e || this.createPane(), r = s.priceScaleByName(h), n = 0; n < a.length; n++) this.detachSource(a[n]);
                    for (n = 0; n < a.length; n++) s.addDataSource(a[n], r);
                    this.detachSource(t), s.addDataSource(t, r)
                }
                this.invalidate(new C(C.FULL_UPDATE))
            }, r.prototype.isSingleInstanceLineTool = function(t) { return "LineStudyMtpRiskReward" === t || "LineStudyMtpAnalysis" === t }, r.prototype._externalTimeStamp = function(t) { var e = this.mainSeries().syncModel(); return this.m_timeScale.points().roughTime(t, e && e.projectTime.bind(e)) }, r.prototype.createLineTool = function(t, e, i, o, n) { var s, r, a, l, h, p, u, _; return d.isValid(i) ? (this.isSingleInstanceLineTool(i) && this._undoModel.removeAllDrawingTools(i), "LineToolExecution" !== i && R("drawings", "Study_Drawing_" + i), s = d.create(i, this, o, null, t.mainDataSource()), r = !s.linkKey && !n, O.drawOnAllCharts().value() ? s.linkKey = n || N.randomHash() : s.linkKey = n, s.toolname = i, s.setOwnerSource(t.mainDataSource()), a = t.defaultPriceScale(), t.addDataSource(s, a), h = this.m_timeScale.indexToCoordinate(e.index), p = a.priceToCoordinate(e.price), s.isFixed() ? l = s.addFixedPoint(new c.Point(h, p)) : (u = s.constructor, u.skipMagnetting || (e.price = this._magnet.align(e.price, e.index, t)), l = s.addPoint(e)), l || (this._lineBeingCreated = s, this._paneBeingCreatedLineOn = t), r && s.enableCurrentIntervalVisibility(), this.invalidate(new C(C.FULL_UPDATE)), n || !O.drawOnAllCharts().value() || s.properties().singleChartOnly || (_ = this._externalTimeStamp(e.index), O.createLineTool({ point: { price: e.price, timeStamp: _ }, linetool: i, properties: s.properties(), symbol: this.mainSeries().symbol(), model: this, linkKey: s.linkKey })), s) : null }, r.prototype.lineBeingCreated = function() { return this._lineBeingCreated }, r.prototype.paneBeingCreatedLineOn = function() { return this._paneBeingCreatedLineOn }, r.prototype.coninueCreatingLine = function(t, e, i, o) { var n, s, r, a, l, h = this.paneForSource(this._lineBeingCreated); return t.price = this._magnet.align(t.price, t.index, h), n = this._lineBeingCreated.addPoint(t, e, i), s = this._lineBeingCreated, this._lineBeingCreated.updateAllViews(), r = new C(C.LIGHT_UPDATE), a = null, n && (a = { points: this._lineBeingCreated._timePoint, interval: this.mainSeries().interval() }, this._paneBeingCreatedLineOn = null, this._lineBeingCreated = null, r.force = !0), this.invalidate(r), o || !O.drawOnAllCharts().value() || s.properties().singleChartOnly || (l = this._externalTimeStamp(t.index), O.continueLineTool({ point: { price: t.price, timeStamp: l }, envState: e, finalState: a, model: this })), n }, r.prototype.cancelCreatingLine = function() {
                if (this._lineBeingCreated) {
                    var t = this._lineBeingCreated;
                    this.removeSource(this._lineBeingCreated), this._lineBeingCreated = null, this._lineCancelled.fire(), O.drawOnAllCharts().value() && !t.properties().singleChartOnly && O.cancelLineTool({ model: this })
                }
            }, r.prototype.startChangingLinetool = function(t, e, i, o) {
                var n, s, r;
                this._lineBeingEdited = t, this._linePointBeingEdited = i, this._lineBeingEdited.startChanging(i, e), n = this.paneForSource(t), e.price = this._magnet.align(e.price, e.index, n), this._lineBeingEdited.startDragPoint && this._lineBeingEdited.startDragPoint(i, e),
                    this._lineBeingEdited.setPoint(i, e, o), this._lineBeingEdited.updateAllViews(), s = this._paneInvalidationMask(n, C.LIGHT_UPDATE), s.force = !0, this.invalidate(s), t.linkKey && !t.properties().singleChartOnly && (r = this._externalTimeStamp(e.index), O.startChangingLineTool({ linkKey: t.linkKey, model: this, symbol: this.mainSeries().symbol(), point: { price: e.price, timeStamp: r }, pointIndex: i, envState: o }))
            }, r.prototype.lineBeingEdited = function() { return this._lineBeingEdited }, r.prototype.linePointBeingEdited = function() { return this._linePointBeingEdited }, r.prototype.changeLinePoint = function(t, e) {
                var i, o, n, s, r = this.paneForSource(this._lineBeingEdited);
                void 0 !== t.x && void 0 !== t.y ? (n = this._lineBeingEdited.priceScale(), i = n.coordinateToPrice(t.y), o = Math.round(this.timeScale().coordinateToIndex(t.x)), i = this._magnet.align(i, o, r), this._lineBeingEdited.setPoint(this._linePointBeingEdited, { price: i, index: o }, e)) : this._lineBeingEdited.setPoint(this._linePointBeingEdited, t, e), this._lineBeingEdited.updateAllViews(), this.invalidate(new C(C.LIGHT_UPDATE)), this._lineBeingEdited.linkKey && !this._lineBeingEdited.properties().singleChartOnly && (s = this._externalTimeStamp(o), O.changeLineTool({ linkKey: this._lineBeingEdited.linkKey, model: this, symbol: this.mainSeries().symbol(), point: { price: i, timeStamp: s }, envState: e }))
            }, r.prototype.endChangingLinetool = function(t) {
                var e, i, o = this._lineBeingEdited;
                this._lineBeingEdited.endChanging(!1, t), this._lineBeingEdited = null, this._linePointBeingEdited = null, e = new C(C.LIGHT_UPDATE), e.force = !0, this.invalidate(e), i = { points: o._timePoint, interval: this.mainSeries().interval() }, o.linkKey && !o.properties().singleChartOnly && O.finishChangingLineTool({ model: this, linkKey: o.linkKey, symbol: this.mainSeries().symbol(), finalState: i })
            }, r.prototype.startMovingSource = function(t, e, i) {
                var o, n, s;
                this._sourceBeingMoved = t, this._linePointBeingMoved = i, this._sourceBeingMoved.startMoving(e, i), o = this.paneForSource(this._sourceBeingMoved), n = this._paneInvalidationMask(o, C.LIGHT_UPDATE), n.force = !0, this.invalidate(n), t.linkKey && !t.properties().singleChartOnly && (s = this._externalTimeStamp(e.index), O.startMovingLineTool({ linkKey: t.linkKey, model: this, symbol: this.mainSeries().symbol(), point: { price: e.price, timeStamp: s } }))
            }, r.prototype.sourceBeingMoved = function() { return this._sourceBeingMoved }, r.prototype.moveSource = function(t) {
                if (this._sourceBeingMoved.move(t, this._linePointBeingMoved), this.invalidate(new C(C.LIGHT_UPDATE)), this._sourceBeingMoved.linkKey && !this._sourceBeingMoved.properties().singleChartOnly) {
                    var e = this._externalTimeStamp(t.index);
                    O.moveLineTool({ linkKey: this._sourceBeingMoved.linkKey, model: this, point: { price: t.price, timeStamp: e } })
                }
            }, r.prototype.endMovingSource = function(t) {
                var e, i, o = this._sourceBeingMoved,
                    n = this.paneForSource(this._sourceBeingMoved);
                this._sourceBeingMoved.endMoving(t), this._sourceBeingMoved = null, this._linePointBeingMoved = null, e = this._paneInvalidationMask(n, C.LIGHT_UPDATE), e.invalidateAll(C.LIGHT_UPDATE), e.force = !0, this.invalidate(e), o instanceof p && (i = { points: o._timePoint, interval: this.mainSeries().interval() },
                    o.linkKey && !o.properties().singleChartOnly && O.finishMovingLineTool({ linkKey: o.linkKey, model: this, finalState: i }))
            }, r.prototype.finishLineTool = function(t) {
                var e = this.lineBeingCreated();
                e && (e.finish && e.finish(), !t && O.drawOnAllCharts().value() && e.linkKey && !e.properties().singleChartOnly && O.finishLineTool({ linkKey: e.linkKey, model: this }))
            }, r.prototype.calculateDefaultTags = function() {
                var t, e, i = [],
                    o = this.dataSources();
                for (t = 0; t < o.length; t++) e = o[t], e.tags && (i = i.concat(e.tags()));
                return i
            }, r.prototype.changeZOrder = function(t, e) { this.paneForSource(t).changeZOrder(t, e), this.invalidate(new C(C.FULL_UPDATE)) }, r.prototype.sendToBack = function(t) { this.paneForSource(t).sendToBack(t), this.invalidate(new C(C.FULL_UPDATE)) }, r.prototype.bringToFront = function(t) { this.paneForSource(t).bringToFront(t), this.invalidate(new C(C.FULL_UPDATE)) }, r.prototype.onTagsChanged = function() { return this._tagsChanged }, r.prototype.onPaneTagsChanged = function() { this._tagsChanged.fire() }, r.prototype.setTimeViewport = function(t, e) { this.timeScale().zoomToBarsRange(t, e), this.recalculateAllPanes(), this.invalidate(new C(C.LIGHT_UPDATE)) }, r.prototype.zoomToViewport = function(t, e, i, o, n) {
                var r, a, l;
                this.setTimeViewport(t, e), r = Math.min(i, o), a = Math.max(i, o), l = n.defaultPriceScale(), l.setAutoScale(!1), l.isLog() && (r = l.priceToLogical(r), a = l.priceToLogical(a)), l.setPriceRange(new s(r, a)), this.recalculateAllPanes(), this.invalidate(this._paneInvalidationMask(n, C.LIGHT_UPDATE))
            }, r.prototype.clearAllStudies = function() { var t, e = this.dataSources(); for (t = 0; t < e.length; t++) e[t].clearData && e[t].clearData() }, r.prototype.allStudies = function() {
                var t, e, i, o, n, s, r = [],
                    a = this.m_panes,
                    l = a.length;
                for (t = 0; t < l; ++t)
                    for (e = a[t], i = e.dataSources(), o = i.length, n = 0; n < o; ++n)(s = i[n]) instanceof P && r.push(s);
                return r
            }, r.prototype.allLineTools = function() {
                var t, e, i, o, n, s, r = [],
                    a = this.m_panes,
                    l = a.length;
                for (t = 0; t < l; ++t)
                    for (e = a[t], i = e.dataSources(), o = i.length, n = 0; n < o; ++n) s = i[n], TradingView.isInherited(s.constructor, p) && r.push(s);
                return r
            }, r.prototype.backgroundColor = function() { return this._properties.paneProperties.background._value }, r.prototype.backgroundCounterColor = function() { return h(l(this.backgroundColor())) }, r.prototype.isDark = function() { return "white" === this.backgroundCounterColor() }, r.prototype.canZoomIn = function() { return this.m_timeScale.canZoomIn() && o.enabled("chart_zoom") }, r.prototype.canZoomOut = function() { return this.m_timeScale.canZoomOut() && o.enabled("chart_zoom") }, r.prototype.updateAllVolumeStudies = function() {
                var t, e, i, o, n, s, r = this.m_panes;
                for (t = r.length; t--;)
                    for (e = !1, i = r[t], o = i.dataSources(), n = o.length; n--;)(s = o[n]) instanceof P && "Volume" === s.metaInfo().shortId && (s.updateAllViews(), e || (this.updatePane(i), e = !0))
            }, r.prototype.alertsList = function() { return this._alertsList }, r.prototype._modelIntervals = [], r.prototype.setInterval = function(t, e) { var i = setInterval(t, e); return this._modelIntervals.push(i), i }, r.prototype.clearInterval = function(t) {
                clearInterval(t);
                var e = this._modelIntervals.indexOf(t);
                e > -1 && this._modelIntervals.splice(e, 1)
            }, r.prototype.clearIntervals = function() {
                for (var t = 0; t < this._modelIntervals.length; t++) clearInterval(this._modelIntervals[t]);
                this._modelIntervals = []
            }, r.prototype.destroy = function() { this.clearIntervals() }, r.prototype.countUserStudies = function(t) {
                var e, i, o, n, s, r, a = 0;
                for (t = t || {}, e = 0; e < this.m_panes.length; e++)
                    for (i = this.m_panes[e].dataSources(), o = 0; o < i.length; o++)
                        if ((n = i[o]) instanceof P && n.showInObjectTree()) {
                            if (s = n.metaInfo && n.metaInfo()) { if (r = s.id, t.dontCountVolume && "Volume@tv-basicstudies" === r) continue; if (t.dontCountCompare && "Compare@tv-basicstudies" === r) continue; if (t.dontCountOverlay && "Overlay@tv-basicstudies" === r) continue }
                            a++
                        }
                return a
            }, r.prototype.isJustClonedChart = function() { return this._undoModel.isJustClonedChart() }, r.prototype.copyToOtherCharts = function(t) {
                var e, i, o, n;
                t.linkKey = t.linkKey || N.randomHash(), e = this, i = t.state(), o = this.mainSeries(), (n = o.syncModel()) && (i.points = t._timePoint.map(function(t) { var i = e.timeScale().timePointToIndex(t.time_t) + t.offset; return { price: t.price, timeStamp: e._externalTimeStamp(i) } }), i.linetool = t.getType(), i.model = this, i.symbol = this.mainSeries().symbol(), O.copyLineTool(i))
            }, r.prototype.restoreSource = function(t, e, i, o, n) { var s, r, a, l, h, c, d, p; return s = t ? this.createPane(e) : this.panes()[e], a = o.type, r = a.toLowerCase().startsWith("study") ? s._restoreStudy(o) : s._restoreLineTool(o), l = r.ownerSource() ? r.ownerSource().priceScale() : s.priceScaleByName(n), l ? (r.setPriceScale(l), l.addDataSource(r)) : (l = new y(s._properties.overlayPropreties, this.properties().scalesProperties), l.setHeight(s.m_height), h = r.metaInfo && "Volume@tv-basicstudies" === r.metaInfo().id, c = h ? .75 : s.m_rightPriceScale.topMargin(), d = h ? 0 : s.m_rightPriceScale.bottomMargin(), l.setTopMargin(c), l.setBottomMargin(d), l.addDataSource(r), r.setPriceScale(l), r._isOverlay = !0), p = null, o.ownerSource && (p = s.dataSourceForId(o.ownerSource)), r.setOwnerSource(p), r.setPriceScale(l), r.start(), r.restore && r.restore(), t && s.restoreState(i), this.recalculateAllPanes(), this.mainSeries().invalidateBarColorerCache(), this.invalidate(new C(C.FULL_UPDATE, !0)), r.linkKey && O.restoreLineTool({ model: this, linkKey: r.linkKey, state: { restorePane: t, paneIndex: e, paneState: i, sourceState: o, priceScaleName: n } }), r }, r.prototype.restoreLineToolState = function(t, e) { t.restorePoints(e.points, e.indexes || []), t.properties().merge(e.state), t.restoreData && t.restoreData(e), t.createServerPoints(), this.invalidate(new C(C.FULL_UPDATE)), t.linkKey && O.restoreLineToolState({ model: this, linkKey: t.linkKey, state: e }) }, r.prototype.createBrandingSource = function() { this._brandingSource = new S(this) }, r.prototype.onChartThemeLoaded = function() { return this._chartThemeLoaded }, r.prototype.chartThemeLoaded = function() { this._chartThemeLoaded.fire() }, t.exports = r
    }).call(e, i(15), i(3), i(41), i(107))
}, function(t, e, i) {
    (function(t) {
        "use strict";

        function o(e, i, o, n, s, r, a, l) { this._chartWidget = l, this.m_model = new H(e, i, o, n, s, r, a, this, !!l._containsData), this.m_zoomStack = new ot, this._onRearrangePanes = new t, this._onSimpleZoomIn = new t, this._onSimpleZoomOut = new t }

        function n(t, e, i, o) { st.call(this, i), this._targetObj = t, this._newValue = e, this._model = o }

        function s(t, e, i, o, n) {
            st.call(this, o),
                this._property = t, this._priceScale = i, this._newValue = e, this._model = n
        }

        function r(t, e, i, o, n) { st.call(this, o), this._percentage = t, this._priceScale = i, this._newValue = e, this._model = n }

        function a(t, e, i, o, n) { st.call(this, o), this._log = t, this._priceScale = i, this._newValue = e, this._model = n }

        function l(t, e, i, o, n, s) { st.call(this, o), this._style = t, this._mainSeries = i, this._priceAxisProperties = i.properties().priceAxisProperties, this._newValue = e, this._model = n, this._chartWidget = s }

        function h(t, e, i, o, n) { st.call(this, o), this._property = t, this._mainSeries = i, this._priceAxisProperties = i.properties().priceAxisProperties, this._newValue = e, this._model = n }

        function c(t, e, i, o) { st.call(this, "scale price", !1), this.m_model = t, this.m_pane = e, this.m_priceScale = i, this.m_state = o, this.m_newPriceScaleState = null }

        function d(t, e, i) { st.call(this, i, !1), this.setCustomFlag("doesnt_affect_save", !0), this.m_model = t, this.m_state = e, this.m_newTimeScaleState = null }

        function p(t, e, i, o) { this._model = t, this._series = e, this._oldSymbol = e.symbol(), this._oldInterval = e.interval(), this._symbol = i, this._interval = o }

        function u(t, e, i, o, n) { st.call(this, "Insert " + e.id), this._model = t, this._studyMetaInfo = e, this._props = i, this._isOverlay = o, this._parentSource = n }

        function _(t, e) { st.call(this, "Remove Source"), this._model = t, this._sourceId = e.id() }

        function f(t, e) { st.call(this, "Remove Drawing(s)"), this._model = t, this._linetools = e, this._statesByPaneIndexes = {} }

        function m(t, e, i, o) { this._model = t, this._oldPane = this._model.paneForSource(e), st.call(this, this._oldPane === i ? "Change Price Scale" : "Move Source"), this._sourceId = e.id(), this._oldPaneIndex = t.panes().indexOf(this._oldPane), this._oldScaleName = this._oldPane.priceScaleName(e.priceScale()), this._pane = i, this._paneIndex = t.panes().indexOf(i), this._pane ? this._scaleName = this._pane.priceScaleName(o) : this._paneIndex = t.panes().length }

        function g(t, e, i) { st.call(this, "Create line " + i, !1), this._model = t, this._paneIndex = t.panes().indexOf(e), this._lineTool = i }

        function v(t, e, i, o) { st.call(this, "Change Drawing", !1), this._model = t, this._prevState = e.state(!0), this._nextState = this._prevState }

        function y(t, e, i, o) { st.call(this, "Move Drawing", !1), this._model = t, this._sourceId = e.id(), i instanceof N.Point ? this._origPoint = i.clone() : this._origPoint = TradingView.clone(i), this._pointIndex = o }

        function b(t, e, i) { st.call(this, "Change %1 Z order (%2)".format(e.title(), i > 0 ? "Forward" : "Backward")), this._model = t, this._sourceId = e.id(), this._shift = i }

        function w(t, e) { st.call(this, "Send " + e.title() + " to back"), this._model = t, this._sourceId = e.id() }

        function S(t, e) { st.call(this, "Bring " + e.title() + " to front"), this._model = t, this._sourceId = e.id() }

        function T(t, e, i) { st.call(this, "Remove pane"), this._model = t, this._index = e, this._pane = this._model.panes()[e], this._chart = i }

        function C(t, e, i, o) { st.call(this, "Rearrange panes"), this._model = t, this._index = e, this._direction = i, this._chart = o }

        function x(t, e, i, o, n, s) { st.call(this, "Zoom"), this._model = t, this._startBar = e, this._endBar = i, this._startPrice = o, this._endPrice = n, this._pane = s }

        function P(t, e, i) { st.call(this, "Zoom"), this._baseCmd = t, this._zoomStack = e, this._inOut = i }

        function L(t, e, i, o, n) {
            st.call(this, "", !1), this._model = t, this._paneA = e, this._paneB = i, this._prevStretchA = o, this._currStretchA = n
        }

        function k(t, e) { st.call(this, "Restore Defaults"), this._model = t, this._defaultProperty = e, this._state = e.state(e._exclusions), this._chartWidget = t._undoModel._chartWidget }

        function I(t, e) { st.call(this, "Apply Chart Theme"), this._model = t, this._newChartProps = TradingView.factoryDefaults("chartproperties"), ["candleStyle", "hollowCandleStyle", "haStyle"].forEach(function(t) { e.mainSourceProperties[t].wickUpColor = e.mainSourceProperties[t].wickUpColor || e.mainSourceProperties[t].wickColor, e.mainSourceProperties[t].wickDownColor = e.mainSourceProperties[t].wickDownColor || e.mainSourceProperties[t].wickColor }), e.chartProperties.paneProperties.vertGridProperties = e.chartProperties.paneProperties.vertGridProperties || e.chartProperties.paneProperties.gridProperties, e.chartProperties.paneProperties.horzGridProperties = e.chartProperties.paneProperties.horzGridProperties || e.chartProperties.paneProperties.gridProperties, e.chartProperties.paneProperties.legendProperties = this._model.properties().state().paneProperties.legendProperties, this._newChartProps = $.extend(!0, {}, this._newChartProps, e.chartProperties), delete this._newChartProps.scalesProperties.showLeftScale, delete this._newChartProps.scalesProperties.showRightScale, delete this._newChartProps.scalesProperties.scaleSeriesOnly, delete this._newChartProps.scalesProperties.showSeriesLastValue, delete this._newChartProps.scalesProperties.showStudyLastValue, delete this._newChartProps.scalesProperties.showSymbolLabels, delete this._newChartProps.scalesProperties.showStudyPlotLabels, this._newSeriesProps = e.mainSourceProperties, this._newChartProps.symbolWatermarkProperties || (this._newChartProps.symbolWatermarkProperties = defaults("chartproperties.symbolWatermarkProperties"), this._newChartProps.symbolWatermarkProperties.color = this._newChartProps.scalesProperties.textColor), this._oldChartProps = t.properties().state(), delete this._oldChartProps.paneProperties.topMargin, delete this._oldChartProps.paneProperties.bottomMargin, this._oldSeriesProps = t.properties().state().mainSeriesProperties }

        function A(t, e) { st.call(this, "Apply Drawing Template"), this._source = t, this._oldProps = t.properties().state(), this._newProps = e }

        function E(t, e, i, o) {
            var n;
            o = o || "", n = o + " Study template", st.call(this, n), this._model = t, this._oldProps = e, this._newProps = i
        }

        function M(t, e, i, o, n) { st.call(this, t), this._property = e, this._value = i, this._forceSetProperty = n, this._prevValue = e.value(), this._cw = o }

        function D(t, e) {
            var i, o, n, s, r, a = e.priceScale(),
                l = [];
            for (a.isPercent() && (i = e.firstValue()), o = 0; o < t.length; o++) n = { offset: t[o].offset, time_t: t[o].time_t }, s = t[o].price, a.isPercent() && (s = a.priceRange().convertToPercent(s, i)), r = a.priceToCoordinate(s), r -= 40, s = a.coordinateToPrice(r), a.isPercent() && (s = a.priceRange().convertFromPercent(s, i)), n.price = s, l.push(n);
            return l
        }

        function O(t, e, i) { st.call(this, "clone " + e.title()), this._model = t, this._originalSource = e, this._withoutShift = i }

        function V(t, e) {
            st.call(this, "Stop Sincing Drawing"), this._model = t, this._sourceId = e.id(),
                this._linkKey = e.linkKey
        }

        function B(t, e, i) { st.call(this, "Paste Drawing"), this._model = t, this._clipboardData = e, this._paneIndex = this._model.panes().indexOf(i || this._model.paneForSource(this._model.mainSeries())) }

        function R(t, e) { st.call(this, "Paste Indicator"), this._model = t, this._clipboardData = e }
        var N = i(2),
            F = i(199),
            z = i(1).LineDataSource,
            W = i(3),
            H = i(153),
            U = i(42),
            j = i(21),
            q = i(731).doAnimate,
            Y = i(225),
            G = i(7),
            K = G.saveDefaultProperties,
            X = i(192),
            Z = i(43),
            J = i(31),
            Q = J.Study,
            tt = i(157),
            et = i(60),
            it = i(262).createTooManyStudiesNotice,
            ot = i(374).UndoStack,
            nt = i(53).UndoHistory,
            st = i(124).UndoCommand,
            rt = i(12).getLogger("Chart.ChartUndoModel");
        inherit(o, Y), o.prototype.version = function() { return this.m_model._version }, o.prototype.onData = function(t) {
            switch (t.method) {
                case "timescale_update":
                    var e = t.params;
                    this.m_model.updateTimeScale(e.index, e.zoffset, e.changes, e.marks, e.clear)
            }
        }, o.prototype.paneForSource = function(t) { return this.m_model.paneForSource(t) }, o.prototype.createPane = function(t) { return this.m_model.createPane(t) }, o.prototype.dumpViews = function() { return this.m_model.dumpViews() }, o.prototype.readOnly = function() { return this.m_model.readOnly() }, o.prototype.restart = function() { this.m_model.restart() }, o.prototype.disconnect = function() { this.m_model.disconnect() }, o.prototype.studiesMetaData = function() { return this.m_model.studiesMetaData() }, o.prototype.studyVersioning = function() { return this.m_model.studyVersioning() }, o.prototype.chartModel = function() { return this.m_model }, o.prototype.pushUndoCommand = function(t) { nt.pushUndoCommand(t) }, o.prototype.startScalePrice = function(t, e, i) { this.pushUndoCommand(new c(this.m_model, t, e, e.state())), this.chartModel().startScalePrice(t, e, i) }, o.prototype.scalePriceTo = function(t, e, i) { this.chartModel().scalePriceTo(t, e, i) }, o.prototype.endScalePrice = function(t, e) { this.chartModel().endScalePrice(t, e) }, o.prototype.startScrollPrice = function(t, e, i) { e.isAutoScale() || (this._initialPriceScrollState = e.state(), this._initialPriceScrollPos = i, this.chartModel().startScrollPrice(t, e, i)) }, o.prototype.scrollPriceTo = function(t, e, i) { e.isAutoScale() || (this._initialPriceScrollPos && Math.abs(this._initialPriceScrollPos - i) > 20 && (this.pushUndoCommand(new c(this.m_model, t, e, this._initialPriceScrollState)), delete this._initialPriceScrollState, delete this._initialPriceScrollPos), this.chartModel().scrollPriceTo(t, e, i)) }, o.prototype.endScrollPrice = function(t, e) { e.isAutoScale() || (delete this._initialPriceScrollState, delete this._initialPriceScrollPos, this.chartModel().endScrollPrice(t, e)) }, o.prototype.setPriceAutoScale = function(t, e, i) { this.pushUndoCommand(new c(this.m_model, t, e, e.state())), this.chartModel().setPriceAutoScale(t, e, i) }, o.prototype.resetPriceScale = function(t, e) { this.pushUndoCommand(new c(this.m_model, t, e, e.state())), this.chartModel().resetPriceScale(t, e) }, o.prototype.startScaleTime = function(t) { this.pushUndoCommand(new d(this.m_model, this.m_model.timeScale().state(), "scale time")), this.chartModel().startScaleTime(t) }, o.prototype.scaleTimeTo = function(t) { this.chartModel().scaleTimeTo(t) }, o.prototype.endScaleTime = function() {
            this.chartModel().endScaleTime()
        }, o.prototype.startScrollTime = function(t) { this._initialTimeScrollState = this.m_model.timeScale().state(), this._initialTimeScrollPos = t, this.chartModel().startScrollTime(t) }, o.prototype.scrollTimeTo = function(t) { this._initialTimeScrollPos && Math.abs(t - this._initialTimeScrollPos) > 20 && (this.pushUndoCommand(new d(this.m_model, this._initialTimeScrollState, "scroll time")), delete this._initialTimeScrollPos, delete this._initialTimeScrollState), this.chartModel().scrollTimeTo(t) }, o.prototype.gotoTime = function(t, e) {
            var i, o, n = this.timeScale().visibleBars();
            if (!n) return $.Deferred().reject().promise();
            i = n.firstBar(), o = this.m_model.timeScale().state(), this.chartModel().gotoTime(t, e), i !== this.timeScale().visibleBars().firstBar() && this.pushUndoCommand(new d(this.m_model, o, "scroll time"))
        }, o.prototype.endScrollTime = function() { this.chartModel().endScrollTime(), delete this._initialTimeScrollPos, delete this._initialTimeScrollState }, o.prototype.resetTimeScale = function() { this.pushUndoCommand(new d(this.m_model, this.m_model.timeScale().state())), this.chartModel().resetTimeScale() }, o.prototype.canZoomIn = function() { return this.chartModel().canZoomIn() }, o.prototype.canZoomOut = function() { return this.chartModel().canZoomOut() }, o.prototype.setWidth = function(t) { this.m_model.setWidth(t) }, o.prototype.setPaneHeight = function(t, e) { this.m_model.setPaneHeight(t, e) }, o.prototype.gridSource = function() { return this.m_model.gridSource() }, o.prototype.watermarkSource = function() { return this.m_model.watermarkSource() }, o.prototype.brandingSource = function() { return this.m_model.brandingSource() }, o.prototype.addAlertsSource = function(t) { return this.m_model.addAlertsSource(t) }, o.prototype.alertsSources = function() { return this.m_model.alertsSources() }, o.prototype.barsMarksSources = function() { return this.m_model.barsMarksSources() }, o.prototype.crossHairSource = function() { return this.m_model.crossHairSource() }, o.prototype.model = function() { return this.m_model }, o.prototype.mainSeries = function() { return this.m_model.m_mainSeries }, o.prototype.panes = function() { return this.m_model.m_panes }, o.prototype.timeScale = function() { return this.m_model.timeScale() }, o.prototype.setSelectedSource = function(t, e) { this.m_model.setSelectedSource(t, e) }, o.prototype.setHoveredSource = function(t, e) { this.m_model.setHoveredSource(t, e) }, o.prototype.selectedSource = function() { return this.m_model.selectedSource() }, o.prototype.onSelectedSourceChanged = function() { return this.m_model.onSelectedSourceChanged() }, o.prototype.hoveredSource = function() { return this.m_model.hoveredSource() }, o.prototype.activeStrategySource = function() { return this.m_model.activeStrategySource() }, o.prototype.invalidate = function(t) { this.m_model.invalidate(t) }, o.prototype.setCurrentPosition = function(t, e, i, o) { this.m_model.setCurrentPosition(t, e, i, o) }, o.prototype.modifySeries = function(t, e, i) {
            var o = new p(this.m_model, t, e, i);
            this.pushUndoCommand(o)
        }, o.prototype.canCreateStudy = function(t) { return this.model().chartApi().chartApi().isCanCreateStudy(t) }, o.prototype.checkIfFeatureAvailable = function(t, e) {
            var i = this.canCreateStudy(),
                o = e && e instanceof Q;
            return !this.readOnly() && o && (i = this.canCreateStudy(!0)), !!i || void(o ? goProDialog({ feature: "studyOnStudy" }).open() : it().open())
        }, o.prototype._insertStudy = function(t, e, i, o) { var n = new u(this.m_model, t, e, i, o); return this.pushUndoCommand(n), n.insertedStudy() }, o.prototype.insertStudyWithoutCheck = function() { return this._insertStudy.apply(this, arguments) }, o.prototype.insertStudy = function(t, e, i, o) { if (this.checkIfFeatureAvailable(t, o)) return this._insertStudy(t, e, i, o) }, o.prototype.setProperty = function(t, e, i) {
            if (t && t.value() !== e) {
                var o = new n(t, e, i, this.m_model);
                this.pushUndoCommand(o), this.emitEvent("setProperty")
            }
        }, o.prototype.setPercentProperty = function(t, e, i, o) {
            if (t.value() !== e) {
                var n = new r(t, e, i, o, this.m_model);
                this.pushUndoCommand(n)
            }
        }, o.prototype.setLogProperty = function(t, e, i, o) {
            if (t.value() !== e) {
                var n = new a(t, e, i, o, this.m_model);
                this.pushUndoCommand(n)
            }
        }, o.prototype.setAutoScaleProperty = function(t, e, i, o) {
            if (t.value() !== e) {
                var n = new s(t, e, i, o, this.m_model);
                this.pushUndoCommand(n)
            }
        }, o.prototype.setChartStyleProperty = function(t, e, i) {
            if (t.value() !== e) {
                var o = new l(t, e, this.mainSeries(), i, this.m_model, this._chartWidget);
                this.pushUndoCommand(o), this.emitEvent("setChartStyleProperty")
            }
        }, o.prototype.setLockScaleProperty = function(t, e, i, o) {
            if (t.value() !== e) {
                var n = new h(t, e, i, o, this.m_model);
                this.pushUndoCommand(n)
            }
        }, o.prototype.setScreenChartProperty = function(t, e, i, o, n) {
            if (n || t.value() !== e) {
                var s = new M(o, t, e, i, n);
                this.pushUndoCommand(s)
            }
        }, o.prototype.beginUndoMacro = nt.beginUndoMacro, o.prototype.endUndoMacro = nt.endUndoMacro, o.prototype.createUndoCheckpoint = nt.createUndoCheckpoint, o.prototype.undoToCheckpoint = nt.undoToCheckpoint, o.prototype._getSourcesTree = function(t) {
            var e, i = [],
                o = this.m_model.children(t);
            for (e = 0; e < o.length; e++) i = i.concat(this._getSourcesTree(o[e]));
            return i.push(t), i
        }, o.prototype.removeSource = function(t, e) {
            var i, o, n;
            if (t.isUserDeletable()) {
                if (i = this._getSourcesTree(t), this.lineBeingCreated() === t) this.cancelCreatingLine();
                else {
                    for (this.beginUndoMacro("Remove source"), o = 0; o < i.length; ++o) n = new _(this.m_model, i[o]), this.pushUndoCommand(n);
                    this.endUndoMacro()
                }
                e || (1 === i.length ? this.emitEvent("removeSource", [i[0]]) : this.emitEvent("removeSources", [i]))
            }
        }, o.prototype.removeSelectedSource = function() {
            var t, e = this.m_model.selectedSource();
            e && e.isUserDeletable() && (this.setSelectedSource(null), t = new _(this.m_model, e), this.pushUndoCommand(t), this.emitEvent("removeSource", [e]))
        }, o.prototype.removeLineTools = function(t) {
            var e, i, o = this.lineBeingCreated();
            o && -1 !== (e = t.indexOf(o)) && (this.cancelCreatingLine(), t.splice(e, 1)), i = new f(this.m_model, t), this.pushUndoCommand(i), this.emitEvent("removeSources", [t])
        }, o.prototype.move = function(t, e, i) {
            var o = new m(this.m_model, t, e, i);
            this.pushUndoCommand(o), this.emitEvent("moveSource", [t])
        }, o.prototype.createLineTool = function(t, e, i, o, n) {
            var s, r;
            return "LineToolRegressionTrend" !== i || this.canCreateStudy() ? (this._createLineCommand = new g(this.m_model, t, i), s = this._createLineCommand.startCreatingLine(e, o, n), r = this._createLineCommand.line(),
                s && (this.pushUndoCommand(this._createLineCommand), delete this._createLineCommand), r) : void it().open()
        }, o.prototype.lineBeingCreated = function() { return this.m_model.lineBeingCreated() }, o.prototype.paneBeingCreatedLineOn = function() { return this.m_model.paneBeingCreatedLineOn() }, o.prototype.coninueCreatingLine = function(t, e, i) { var o = this._createLineCommand.continueCreatingLine(t, e, i); return o && (this.pushUndoCommand(this._createLineCommand), delete this._createLineCommand), o }, o.prototype.finishLineTool = function(t) { this.m_model.finishLineTool(t) }, o.prototype.cancelCreatingLine = function() { this.m_model.cancelCreatingLine() }, o.prototype.lineCancelled = function() { return this.m_model.lineCancelled() }, o.prototype.startChangingLinetool = function(t, e, i, o) { this._currentLineChangeCommand = new v(this.m_model, t, i, o), this.m_model.startChangingLinetool(t, e, i, o) }, o.prototype.lineBeingEdited = function() { return this.m_model.lineBeingEdited() }, o.prototype.changeLinePoint = function(t, e) { this._currentLineChangeCommand.setPoint(t, e), this.m_model.changeLinePoint(t, e) }, o.prototype.endChangingLinetool = function(t) { this.m_model.endChangingLinetool(t), this._currentLineChangeCommand.endChanging(), this.pushUndoCommand(this._currentLineChangeCommand), this._currentLineChangeCommand = null }, o.prototype.startMovingSource = function(t, e, i) { this._currentLineMoveCommand = new y(this.m_model, t, e, i), this.m_model.startMovingSource(t, e, i) }, o.prototype.sourceBeingMoved = function() { return this.m_model.sourceBeingMoved() }, o.prototype.moveSource = function(t) { this._currentLineMoveCommand.setPoint(t), this.m_model.moveSource(t) }, o.prototype.endMovingSource = function(t) { this.m_model.endMovingSource(t), this._currentLineMoveCommand._point && (this.pushUndoCommand(this._currentLineMoveCommand), this._currentLineChangeCommand = null) }, o.prototype.dataSources = function() { return this.m_model.dataSources() }, o.prototype.dataSourceForId = function(t) { return this.m_model.dataSourceForId(t) }, o.prototype.state = function(t, e) { return this.m_model.state(t, e) }, o.prototype.asyncState = function(t) { return this.m_model.asyncState(t) }, o.prototype.restoreState = function(t, e) { return this.m_model.restoreState(t, e) }, o.prototype.calculateDefaultTags = function() { return this.m_model.calculateDefaultTags() }, o.prototype.onTagsChanged = function() { return this.m_model.onTagsChanged() }, o.prototype.changeZOrder = function(t, e) {
            var i = new b(this.m_model, t, e);
            this.pushUndoCommand(i), this.emitEvent("changeZOrder", [t, e])
        }, o.prototype.sendToBack = function(t) {
            var e = new w(this.m_model, t);
            this.pushUndoCommand(e), this.emitEvent("changeZOrder", [t])
        }, o.prototype.bringToFront = function(t) {
            var e = new S(this.m_model, t);
            this.pushUndoCommand(e), this.emitEvent("changeZOrder", [t])
        }, o.prototype.removeAllStudies = function() {
            var t, e, i;
            for (this.beginUndoMacro("remove all studies"), t = this.m_model.dataSources(), e = 0; e < t.length; e++) i = t[e], (TradingView.isInherited(i.constructor, Q) && !i.isChildStudy() && i.removeByRemoveAllStudies() || TradingView.isInherited(i.constructor, tt)) && this.removeSource(i);
            this.endUndoMacro()
        }, o.prototype.removeAllDrawingTools = function(t) {
            var e, i, o;
            for (this.beginUndoMacro("remove all drawing tools"), this.lineBeingCreated() && this.cancelCreatingLine(), e = this.m_model.dataSources(), i = 0; i < e.length; i++) o = e[i], TradingView.isInherited(o.constructor, z) && o.isActualSymbol() && o.isUserDeletable() && (t && t !== o._constructor || this.removeSource(o));
            this.endUndoMacro()
        }, o.prototype.unlinkLine = function(t) {
            var e = new V(this.m_model, t);
            this.pushUndoCommand(e)
        }, o.prototype.copyToOtherCharts = function(t) { this.m_model.copyToOtherCharts(t) }, o.prototype.moveDown = function() {
            var t, e, i, o, n;
            try { this.beginUndoMacro("Move Down") } catch (t) { return }
            t = this, e = this.m_model.mainSeries(), i = this.m_model.paneForSource(e), o = i.priceScaleForSource(e), o.setAutoScale(!1), n = o.height(), q({ endValue: n / 5, onStep: function(e) { t.startScrollPrice(i, o, 0), t.scrollPriceTo(i, o, e), t.endScrollPrice(i, o) }, onComplete: function() { t.endUndoMacro() } })
        }, o.prototype.moveUp = function() {
            var t, e, i, o, n;
            try { this.beginUndoMacro("Move Up") } catch (t) { return }
            t = this, e = this.m_model.mainSeries(), i = this.m_model.paneForSource(e), o = i.priceScaleForSource(e), o.setAutoScale(!1), n = o.height(), q({ endValue: n / 5, onStep: function(e) { t.startScrollPrice(i, o, e), t.scrollPriceTo(i, o, 0), t.endScrollPrice(i, o) }, onComplete: function() { t.endUndoMacro() } })
        }, o.prototype.moveLeft = function() {
            var t, e;
            try { this.beginUndoMacro("Move Left") } catch (t) { return }
            t = this.m_model.timeScale().width(), e = this, q({ endValue: t / 5, onStep: function(t) { e.startScrollTime(t), e.scrollTimeTo(0), e.endScrollTime() }, onComplete: function() { e.endUndoMacro() } })
        }, o.prototype.moveRight = function() {
            var t, e;
            try { this.beginUndoMacro("Move Right") } catch (t) { return }
            t = this.m_model.timeScale().width(), e = this, q({ endValue: t / 5, onStep: function(t) { e.startScrollTime(0), e.scrollTimeTo(t), e.endScrollTime() }, onComplete: function() { e.endUndoMacro() } })
        }, o.prototype.scrollChart = function(t) { W.enabled("chart_scroll") && (this.startScrollTime(0), this.scrollTimeTo(t), this.endScrollTime()) }, o.prototype.scrollChartByBar = function(t) {
            if (W.enabled("chart_scroll")) {
                var e = t * this.m_model.timeScale().barSpacing();
                this.startScrollTime(0), this.scrollTimeTo(e), this.endScrollTime()
            }
        }, o.prototype.zoomIn = function(t, e) {
            var i, o, n = this.m_model.timeScale().width(),
                s = this;
            if (e = e || 1, this.canZoomIn())
                if (t) i = e * n / 10, o = i * ((t + 1) / 2), this.startScaleTime(i), this.scaleTimeTo(0), this.endScaleTime(), this.startScrollTime(0), this.scrollTimeTo(i - o), this.endScrollTime(), this._onSimpleZoomIn.fire();
                else {
                    try { this.beginUndoMacro("Zoom In") } catch (t) { return }
                    q({ endValue: n / 5, onStep: function(t) { s.startScaleTime(t), s.scaleTimeTo(0), s.endScaleTime() }, onComplete: function() { s.endUndoMacro(), s._onSimpleZoomIn.fire() } })
                }
        }, o.prototype.zoomOut = function(t, e) {
            var i = this.m_model.timeScale().width(),
                o = this;
            if (e = e || 1, this.canZoomOut())
                if (t) this.startScaleTime(0), this.scaleTimeTo(e * i / 10), this.endScaleTime(), this.startScrollTime(e * (i / 20 - i / 20 * t)), this.scrollTimeTo(0), this.endScrollTime(), this._onSimpleZoomOut.fire();
                else {
                    try { this.beginUndoMacro("Zoom Out") } catch (t) { return }
                    q({
                        endValue: i / 5,
                        onStep: function(t) { o.startScaleTime(0), o.scaleTimeTo(t), o.endScaleTime() },
                        onComplete: function() {
                            o.endUndoMacro(), o._onSimpleZoomOut.fire()
                        }
                    })
                }
        }, o.prototype.resetScales = function() {
            var t, e;
            for (this.beginUndoMacro("Reset scales"), this.resetTimeScale(), t = 0; t < this.panes().length; t++) e = this.panes()[t], this.resetPriceScale(e, e.leftPriceScale()), this.resetPriceScale(e, e.rightPriceScale());
            this.endUndoMacro(), this.m_model.recalculateAllPanes()
        }, o.prototype.zoomToViewport = function(t, e, i, o, n) {
            var s = new x(this.m_model, t, e, i, o, n),
                r = new P(s, this.m_zoomStack, !0);
            this.pushUndoCommand(r)
        }, o.prototype.zoomFromViewport = function() {
            var t = new P(this.m_zoomStack.head(), this.m_zoomStack, !1);
            this.pushUndoCommand(t)
        }, o.prototype.zoomStack = function() { return this.m_zoomStack }, o.prototype.addPaneStretchFactorUndoCommand = function(t, e, i, o) {
            var n = new L(this.m_model, t, e, i, o);
            this.pushUndoCommand(n)
        }, o.prototype.restoreFactoryDefaults = function(t) {
            var e = new k(this.m_model, t);
            this.pushUndoCommand(e)
        }, o.prototype.chartLoadTheme = function(t, e) {
            var i = new I(t, e);
            this.pushUndoCommand(i)
        }, o.prototype.drawingLoadTemplate = function(t, e) {
            var i = new A(t, e);
            this.pushUndoCommand(i)
        }, o.prototype.studyLoadTemplate = function(t, e, i, o) {
            var n = new E(t, e, i, o);
            this.pushUndoCommand(n)
        }, o.prototype.onRearrangePanes = function() { return this._onRearrangePanes }, o.prototype.onSimpleZoomIn = function() { return this._onSimpleZoomIn }, o.prototype.onSimpleZoomOut = function() { return this._onSimpleZoomOut }, o.prototype.loadRange = function(t) { t.res !== this.m_model.mainSeries().properties().interval.value() ? (this.m_model.mainSeries().setDefaultTimeframe(t.val), this.setProperty(this.m_model.mainSeries().properties().interval, t.res, "Change date range")) : this.m_model.mainSeries().loadDataTo(t.val) }, o.prototype.cloneLineTool = function(t, e) { var i = new O(this.m_model, t, e); return this.pushUndoCommand(i), this.emitEvent("cloneLineTool"), i.clonedLineToolId() }, o.prototype._preparePriceAxisProperties = function(t, e) {
            var i = t.lockScale.value(),
                o = t.style.value() === Z.STYLE_PNF;
            (o || i) && (e.log.setValue(!1), e.percentage.setValue(!1)), e.logDisabled.setValue(!(!o && !i)), e.percentageDisabled.setValue(!(!o && !i))
        }, o.prototype.alertsList = function() { return this.m_model.alertsList() }, o.prototype.alertsListChanged = function() { return this.m_model.alertsListChanged() }, o.prototype.insertStudyStub = function(t) { return this.m_model.insertStudyStub(t) }, o.prototype.removeStudyStub = function(t) { return this.m_model.removeStudyStub(t) }, o.prototype.isJustClonedChart = function() { return this._chartWidget.isJustClonedChart() }, o.prototype.copySourceToClip = function(t) {
            if (t && !t.properties().blockCopying) {
                var e = {};
                if (t instanceof z) e.type = "drawing", e.geometry = t.geometry();
                else {
                    if (!(t instanceof Q)) return !1;
                    e.type = "study"
                }
                return e.source = t.state && t.state(), (delete e.source.alertId, delete e.source.linkKey, e.source) ? (e.title = t.title && t.title(), e.modelId = this.m_model._id, X.set(e), !0) : !1
            }
        }, o.prototype.cutSourceToClip = function(t) {
            if (!this.copySourceToClip(t)) return !1;
            this.removeSource(t)
        }, o.prototype.pasteLineTool = function(t, e) {
            var i = new B(this.m_model, e, t);
            this.pushUndoCommand(i)
        }, o.prototype.pasteStudy = function(t) {
            var e = new R(this.m_model, t);
            this.pushUndoCommand(e)
        }, o.prototype.pasteSourceFromClip = function(t, e) { var i = X.get(); if (!i) return !1; "drawing" === i.type && this.pasteLineTool(t, i), "study" === i.type && this.pasteStudy(i) }, o.prototype.trackTime = function() { return this._chartWidget.trackTime() }, inherit(n, st), n.prototype.redo = function() { this._oldValue = this._targetObj.value(), K(!0), this._targetObj.setValue(this._newValue), K(!1), this._model && (this._model.recalculateAllPanes(), this._model.invalidate(new j(j.LIGHT_UPDATE))) }, n.prototype.undo = function() { K(!0), this._targetObj.setValue(this._oldValue), K(!1), this._oldValue = null, this._model && (this._model.recalculateAllPanes(), this._model.invalidate(new j(j.LIGHT_UPDATE))) }, inherit(s, st), s.prototype.redo = function() { this._oldValue = this._property.value(), this._oldLockScaleValue = this._priceScale.mainSource() instanceof Z ? this._priceScale.mainSource().properties().lockScale.value() : void 0, K(!0), this._property.setValue(this._newValue), this._oldLockScaleValue && this._newValue && this._priceScale.mainSource().properties().lockScale.setValue(!1), K(!1), this._model && (this._model.recalculateAllPanes(), this._model.invalidate(new j(j.LIGHT_UPDATE))) }, s.prototype.undo = function() { K(!0), this._property.setValue(this._oldValue), this._oldLockScaleValue && this._newValue && this._priceScale.mainSource().properties().lockScale.setValue(this._oldLockScaleValue), K(!1), this._oldValue = null, this._model && (this._model.recalculateAllPanes(), this._model.invalidate(new j(j.LIGHT_UPDATE))) }, inherit(r, st), r.prototype.redo = function() { this._oldValue = this._percentage.value(), this._oldAutoScaleValue = this._priceScale.properties().autoScale.value(), this._oldLogValue = this._priceScale.properties().log.value(), this._oldLogDisabled = this._priceScale.properties().logDisabled.value(), K(!0), this._percentage.setValue(this._newValue), this._priceScale.properties().autoScaleDisabled.setValue(this._newValue), this._priceScale.properties().log.setValue(!1), K(!1), this._model && (this._model.recalculateAllPanes(), this._model.invalidate(new j(j.LIGHT_UPDATE))) }, r.prototype.undo = function() {
            if (K(!0), this._percentage.setValue(this._oldValue), this._priceScale.properties().autoScale.setValue(this._oldAutoScaleValue), this._priceScale.properties().autoScaleDisabled.setValue(this._oldValue), this._priceScale.properties().log.setValue(this._oldLogValue), !(this._oldAutoScaleValue || this._priceScale.mainSource() instanceof Z && this._priceScale.mainSource().isLockScale())) {
                var t = this._model.timeScale().visibleBars();
                this._priceScale.setPriceRange(this._priceScale.priceRange().convertFromPercents(this._priceScale.mainSource().close(t.firstBar())))
            }
            K(!1), this._oldValue = null, this._model && (this._model.recalculateAllPanes(), this._model.invalidate(new j(j.LIGHT_UPDATE)))
        }, inherit(a, st), a.prototype.redo = function() {
            this._oldValue = this._log.value(), this._oldPercValue = this._priceScale.properties().percentage.value(), this._oldPercDisabled = this._priceScale.properties().percentageDisabled.value(), K(!0), this._log.setValue(this._newValue), this._priceScale.properties().percentage.setValue(!1),
                this._priceScale.properties().autoScaleDisabled.setValue(this._priceScale.properties().percentage.value()), K(!1), this._model && (this._model.recalculateAllPanes(), this._model.invalidate(new j(j.LIGHT_UPDATE)))
        }, a.prototype.undo = function() { K(!0), this._log.setValue(this._oldValue), this._priceScale.properties().percentage.setValue(this._oldPercValue), K(!1), this._oldValue = null, this._model && (this._model.recalculateAllPanes(), this._model.invalidate(new j(j.LIGHT_UPDATE))) }, inherit(l, st), l.prototype.redo = function() {
            var t = $.Deferred().resolve();
            this._mainSeries._properties.style === this._style && this._model.mainSeries().isNeedRestart(this._newValue) && (t = this._chartWidget.screen.show()), t.done(function() { this._oldValue = this._style.value(), this._oldAutoScale = this._priceAxisProperties.autoScale.value(), this._oldLogValue = this._priceAxisProperties.log.value(), this._oldLogDisabled = this._priceAxisProperties.logDisabled.value(), this._oldPercentageValue = this._priceAxisProperties.percentage.value(), this._oldPercentageDisabled = this._priceAxisProperties.percentageDisabled.value(), K(!0), this._style.setValue(this._newValue), this._chartWidget.model()._preparePriceAxisProperties(this._mainSeries.properties(), this._priceAxisProperties), K(!1), this._model && (this._model.recalculateAllPanes(), this._model.invalidate(new j(j.LIGHT_UPDATE))) }.bind(this))
        }, l.prototype.undo = function() {
            var t = $.Deferred().resolve();
            this._mainSeries._properties.style === this._style && this._model.mainSeries().isNeedRestart(this._newValue) && (t = this._chartWidget.screen.show()), t.done(function() { K(!0), this._style.setValue(this._oldValue), this._priceAxisProperties.log.setValue(this._oldLogValue), this._priceAxisProperties.logDisabled.setValue(this._oldLogDisabled), this._priceAxisProperties.percentage.setValue(this._oldPercentageValue), this._priceAxisProperties.percentageDisabled.setValue(this._oldPercentageDisabled), this._priceAxisProperties.autoScale.setValue(this._oldAutoScale), K(!1), this._oldValue = null, this._model && (this._model.recalculateAllPanes(), this._model.invalidate(new j(j.LIGHT_UPDATE))) }.bind(this))
        }, inherit(h, st), h.prototype.redo = function() {
            this._oldValue = this._property.value(), this._oldAutoScale = this._priceAxisProperties.autoScale.value(), this._oldPercentage = this._priceAxisProperties.percentage.value(), this._oldLog = this._priceAxisProperties.log.value(), K(!0), this._newValue && (this._priceAxisProperties.percentage.setValue(!1), this._priceAxisProperties.log.setValue(!1), this._priceAxisProperties.autoScale.setValue(!1));
            var t = this._mainSeries.properties().style.value();
            t !== Z.STYLE_RENKO && t !== Z.STYLE_KAGI && t !== Z.STYLE_PNF && t !== Z.STYLE_PB && this._mainSeries.fixBoxSize(), this._property.setValue(this._newValue), K(!1), this._model && (this._model.recalculateAllPanes(), this._model.invalidate(new j(j.LIGHT_UPDATE)))
        }, h.prototype.undo = function() {
            K(!0), this._priceAxisProperties.percentage.setValue(this._oldPercentage), this._priceAxisProperties.log.setValue(this._oldLog), this._priceAxisProperties.autoScale.setValue(this._oldAutoScale), this._property.setValue(this._oldValue), K(!1),
                this._oldValue = null, this._model && (this._model.recalculateAllPanes(), this._model.invalidate(new j(j.LIGHT_UPDATE)))
        }, inherit(c, st), c.prototype.undo = function() {
            if (null !== this.m_newPriceScaleState) return void rt.logDebug("PriceScaleChangeUndoCommand.undo: Command is already undone");
            this.m_newPriceScaleState = this.m_priceScale.state(), this.m_model.restorePriceScaleState(this.m_pane, this.m_priceScale, this.m_state), this.m_priceScale.recalcLockedScale(null)
        }, c.prototype.redo = function() {
            if (null === this.m_newPriceScaleState) return void rt.logDebug("PriceScaleChangeUndoCommand.redo: Command is not undone");
            this.m_model.restorePriceScaleState(this.m_pane, this.m_priceScale, this.m_newPriceScaleState), this.m_newPriceScaleState = null
        }, inherit(d, st), d.prototype.undo = function() {
            if (null !== this.m_newTimeScaleState) return void rt.logDebug("TimeScaleChangeUndoCommand.undo: Command is already undone");
            this.m_newTimeScaleState = this.m_model.timeScale().state(), this.m_model.restoreTimeScaleState(this.m_state), this.m_model.timeScale().recalcLockedScale()
        }, d.prototype.redo = function() {
            if (null === this.m_newTimeScaleState) return void rt.logDebug("TimeScaleChangeUndoCommand.redo: Command is not undone");
            this.m_model.restoreTimeScaleState(this.m_newTimeScaleState), this.m_newTimeScaleState = null
        }, inherit(p, st), p.prototype.redo = function() { this._model.modifySeries(this._series, this._symbol, this._interval) }, p.prototype.undo = function() { this._model.modifySeries(this._series, this._oldSymbol, this._oldInterval) }, inherit(u, st), u.prototype.redo = function() { var t = null; return this._studyState ? (t = this._model.restoreSource(this._restorePane, this._paneIndex, this._paneState, this._studyState, this._priceScaleName), this._studyId !== t.id() && rt.logError("Study was restored improperly - study ids does not match"), delete this._studyState) : (t = this._model.insertStudy(this._studyMetaInfo, this._props, this._isOverlay, this._parentSource), this._studyId = t.id()), t }, u.prototype.insertedStudy = function() { return this._model.dataSourceForId(this._studyId) }, u.prototype.undo = function() {
            var t, e = this.insertedStudy();
            this._studyState = e.state(), t = this._model.paneForSource(e), this._paneIndex = this._model.panes().indexOf(t), this._priceScaleName = t.priceScaleName(e.priceScale()), this._paneState = t.state(), this._restorePane = this._model.removeSource(e)
        }, inherit(_, st), _.prototype.redo = function() {
            var t, e = this._model.dataSourceForId(this._sourceId);
            this._sourceState = e.state(), t = this._model.paneForSource(e), this._paneIndex = this._model.panes().indexOf(t), this._priceScaleName = t.priceScaleName(e.priceScale()), this._paneState = t.state(), this._restorePane = this._model.removeSource(e)
        }, _.prototype.undo = function() {
            var t = this._model.restoreSource(this._restorePane, this._paneIndex, this._paneState, this._sourceState, this._priceScaleName);
            this._sourceId !== t.id() && rt.logError("Source was restored improperly - source ids does not match")
        }, inherit(f, st), f.prototype.redo = function() {
            var t, e, i;
            for (t = 0; t < this._linetools.length; t++) e = this._model.paneForSource(this._linetools[t]), i = this._model.panes().indexOf(e),
                this._statesByPaneIndexes[i] = this._statesByPaneIndexes[i] || [], this._statesByPaneIndexes[i].push({ state: this._linetools[t].state(), owner: this._linetools[t].ownerSource().id() }), e.removeDataSource(this._linetools[t]);
            delete this._linetools
        }, f.prototype.undo = function() {
            var t, e, i, o, n, s, r;
            this._linetools = [];
            for (t in this._statesByPaneIndexes)
                for (e = this._model.panes()[t], i = this._statesByPaneIndexes[t], o = 0; o < i.length; o++) n = i[o], s = this._model.dataSourceForId(n.owner), r = e._restoreLineTool(n.state), r.setOwnerSource(s), r.updateAllViews(), this._linetools.push(r);
            this._model.invalidate(new j(j.LIGHT_UPDATE))
        }, inherit(m, st), m.prototype.redo = function() {-1 === this._model.panes().indexOf(this._pane) && (this._pane = this._model.createPane(this._paneIndex)), this._model.move(this._model.dataSourceForId(this._sourceId), this._pane, this._pane.priceScaleByName(this._scaleName)) }, m.prototype.undo = function() {-1 === this._model.panes().indexOf(this._oldPane) && (this._oldPane = this._model.createPane(this._oldPaneIndex)), this._model.move(this._model.dataSourceForId(this._sourceId), this._oldPane, this._oldPane.priceScaleByName(this._oldScaleName)) }, inherit(g, st), g.prototype.startCreatingLine = function(t, e, i) { var o, n; return this._points = [{ point: t }], o = this._model.panes()[this._paneIndex], n = this._model.createLineTool(o, t, this._lineTool, e, i), this._lineId = n.id(), !this._model.lineBeingCreated() }, g.prototype.continueCreatingLine = function(t, e, i) { return this._points || rt.logError("continueCreatingLine is called before startCreatingLine"), this._points.push({ point: t, envState: e }), this._model.coninueCreatingLine(t, e, i) }, g.prototype.line = function() { return this._lineId ? this._model.dataSourceForId(this._lineId) : null }, g.prototype.undo = function() {
            var t = this.line();
            t && (this._lineState = t.state(), this._model.removeSource(t), delete this._lineId)
        }, g.prototype.redo = function() {
            this._lineState || rt.logError("This command was never undone - nothing to redo");
            var t = this._model.restoreSource(!1, this._paneIndex, null, this._lineState, null);
            this._lineId = t.id(), delete this._lineState
        }, inherit(v, st), v.prototype.setPoint = function(t) {
            var e = this._model.dataSourceForId(this._nextState.id);
            this._nextState = e.state(!0)
        }, v.prototype.endChanging = function() {
            var t = this._model.dataSourceForId(this._nextState.id);
            this._nextState = t.state(!0)
        }, v.prototype.undo = function() {
            var t = this._model.dataSourceForId(this._prevState.id),
                e = this._prevState;
            this._model.restoreLineToolState(t, e)
        }, v.prototype.redo = function() {
            var t = this._model.dataSourceForId(this._nextState.id),
                e = this._nextState;
            this._model.restoreLineToolState(t, e)
        }, inherit(y, st), y.prototype.setPoint = function(t) { t instanceof N.Point ? this._point = t.clone() : this._point = TradingView.clone(t) }, y.prototype.undo = function() {
            var t = this._model.dataSourceForId(this._sourceId);
            this._model.startMovingSource(t, this._point, this._pointIndex), this._model.moveSource(this._origPoint), this._model.endMovingSource()
        }, y.prototype.redo = function() {
            var t = this._model.dataSourceForId(this._sourceId);
            this._model.startMovingSource(t, this._origPoint, this._pointIndex),
                this._model.moveSource(this._point), this._model.endMovingSource()
        }, inherit(b, st), b.prototype.undo = function() {
            var t = this._model.dataSourceForId(this._sourceId);
            this._model.changeZOrder(t, -this._shift)
        }, b.prototype.redo = function() {
            var t = this._model.dataSourceForId(this._sourceId);
            this._model.changeZOrder(t, this._shift)
        }, inherit(w, st), w.prototype.undo = function() {
            var t = this._model.dataSourceForId(this._sourceId);
            this._model.bringToFront(t)
        }, w.prototype.redo = function() {
            var t = this._model.dataSourceForId(this._sourceId);
            this._model.sendToBack(t)
        }, inherit(S, st), S.prototype.undo = function() {
            var t = this._model.dataSourceForId(this._sourceId);
            this._model.sendToBack(t)
        };
        S.prototype.redo = function() {
            var t = this._model.dataSourceForId(this._sourceId);
            this._model.bringToFront(t)
        }, o.prototype.removePane = function(t, e) {
            var i = new T(this, e, t);
            this.pushUndoCommand(i)
        }, inherit(T, st), T.prototype.redo = function() { this._model.panes().splice(this._index, 1), this._chart._updateGui() }, T.prototype.undo = function() { this._model.panes().splice(this._index, 0, this._pane), this._chart._updateGui() }, o.prototype.rearrangePanes = function(t, e, i) {
            var o = new C(this, e, i, t);
            this.pushUndoCommand(o), this._onRearrangePanes.fire()
        }, inherit(C, st), C.prototype.redo = function() { var t = this._model.panes()[this._index]; "up" === this._direction && this._index > 0 && (this._model.panes().splice(this._index, 1), this._model.panes().splice(this._index - 1, 0, t)), "down" === this._direction && this._index < this._model.panes().length - 1 && (this._model.panes().splice(this._index, 1), this._model.panes().splice(this._index + 1, 0, t)), this._model.invalidate(new j(j.FULL_UPDATE)) }, C.prototype.undo = function() { var t; "up" === this._direction && (t = this._model.panes()[this._index - 1], this._model.panes().splice(this._index - 1, 1), this._model.panes().splice(this._index, 0, t)), "down" === this._direction && (t = this._model.panes()[this._index + 1], this._model.panes().splice(this._index + 1, 1), this._model.panes().splice(this._index, 0, t)), this._model.invalidate(new j(j.FULL_UPDATE)) }, inherit(x, st), x.prototype.redo = function() { this._timeScaleState = this._model.timeScale().state(), this._priceScaleState = this._pane.defaultPriceScale().state(), this._model.zoomToViewport(this._startBar, this._endBar, this._startPrice, this._endPrice, this._pane) }, x.prototype.undo = function() { this._model.timeScale().restoreState(this._timeScaleState), this._pane.defaultPriceScale().restoreState(this._priceScaleState), this._model.recalculateAllPanes(), this._model.invalidate(new j(j.LIGHT_UPDATE)) }, inherit(P, st), P.prototype.undo = function() {
            if (this._inOut) {
                if (this._baseCmd !== this._zoomStack.head()) return void rt.logDebug("zoom stack inconsistency");
                this._baseCmd.undo(), this._zoomStack.pop()
            } else this._baseCmd.redo(), this._zoomStack.push(this._baseCmd)
        }, P.prototype.redo = function() {
            if (this._inOut) this._baseCmd.redo(), this._zoomStack.push(this._baseCmd);
            else {
                if (this._baseCmd !== this._zoomStack.head()) return void rt.logDebug("zoom stack inconsistency");
                this._baseCmd.undo(), this._zoomStack.pop()
            }
        }, inherit(L, st), L.prototype.redo = function() {
            var t = this._paneA._stretchFactor + this._paneB._stretchFactor;
            this._paneA._stretchFactor = this._currStretchA, this._paneB._stretchFactor = t - this._currStretchA, this._model.invalidate(new j(j.FULL_UPDATE))
        }, L.prototype.undo = function() {
            var t = this._paneA._stretchFactor + this._paneB._stretchFactor;
            this._paneA._stretchFactor = this._prevStretchA, this._paneB._stretchFactor = t - this._prevStretchA, this._model.invalidate(new j(j.FULL_UPDATE))
        }, inherit(k, st), k.prototype.redo = function() { this._model.restoreFactoryDefaults(this._defaultProperty) }, k.prototype.undo = function() { this._defaultProperty.merge(this._state), this._defaultProperty.listeners().fire(this._defaultProperty), this._model.mainSeries().onChartStyleChanged() }, inherit(I, st), I.prototype._merge = function(t, e) {
            var i = this._model;
            K(!0), t && (i.properties().paneProperties.merge(t.paneProperties), i.properties().scalesProperties.merge(t.scalesProperties), i.properties().symbolWatermarkProperties.merge(t.symbolWatermarkProperties)), i.mainSeries().properties().merge(e), i.mainSeries().properties().saveDefaults(), i.mainSeries().createPaneView(), i.mainSeries().invalidateBarStylesCache(), i._version = e.version, i.recalculateAllPanes(), i.invalidate(new j(j.FULL_UPDATE)), i.properties().saveDefaults(), i.properties().listeners().fire(this._properties), i.properties().scalesProperties.textColor.listeners().fire(i.properties().scalesProperties.textColor), K(!1)
        }, I.prototype.undo = function() { this._merge(this._oldChartProps, this._oldSeriesProps), this._model.mainSeries().onChartStyleChanged(), this._model.updateScales(), this._model.chartThemeLoaded() }, I.prototype.redo = function() { this._merge(this._newChartProps, this._newSeriesProps), this._model.mainSeries().onChartStyleChanged(), this._model.updateScales(), this._model.chartThemeLoaded() }, inherit(A, st), A.prototype._merge = function(t) {
            var e = this._source;
            e.properties().merge(t), e.properties().saveDefaults(), e.propertiesChanged(), e.calcIsActualSymbol(), e.updateAllViews(), e._model.invalidate(new j(j.LIGHT_UPDATE))
        }, A.prototype.undo = function() { this._merge(this._oldProps) }, A.prototype.redo = function() { this._merge(this._newProps) }, inherit(E, st), E.prototype._merge = function(t) {
            var e, i, o, n, s, r, a, l, h, c, d, p, u = this._model.model(),
                _ = u.mainSeries();
            for (_.properties().lockScale.setValue(!1), t.interval && _.properties().interval.setValue(t.interval), e = [], i = u.panes(), o = i.length; o--;)
                for (n = i[o], s = n.containsMainSeries(), r = n.dataSources(), a = r.length; a--;) l = r[a], (!s || l instanceof Q) && (l.isRemovedByStudyTemplates() || e.push(l), u.removeSource(l));
            for (h = t.panes, function(t, e) { return t.dataSources().some(function(t) { return t.alert && t.alert().id === e.alert.id }) }, o = 0; o < h.length; o++) {
                for (c = !1, d = h[o], a = 0; a < d.sources.length; a++) l = d.sources[a], "MainSeries" === l.type && (delete l.state, c = !0);
                if (n = null, n = c ? i[o] : u.createPane(o), n.restoreState(h[o], !1, t.version), c)
                    for (p = 0; p < e.length; p++) e[p].restore && e[p].restore()
            }
            _.priceScale().setAutoScale(!0), u._version = t.version, u.startNotStartedStudies(), u.recalculateAllPanes(), u.invalidate(new j(j.FULL_UPDATE))
        }, E.prototype.undo = function() {
            this._merge(this._oldProps),
                this._model.model().mainSeries().onChartStyleChanged()
        }, E.prototype.redo = function() {
            var t, e, i;
            this._merge(this._newProps), t = this._model.model(), t.mainSeries().onChartStyleChanged(), e = this._model.model().mainSeries().properties(), i = this._model.model().mainSeries().properties().priceAxisProperties, this._model._preparePriceAxisProperties(e, i), t._recalcVisibleRangeStudy(t.dataSources(), !0)
        }, inherit(M, st), M.prototype.redo = function() { this._cw.screen.show().done(function() { this._property.setValue(this._value, this._forceSetProperty) }.bind(this)) }, M.prototype.undo = function() { this._cw.screen.show().done(function() { this._property.setValue(this._prevValue, this._forceSetProperty) }.bind(this)) }, inherit(O, st), O.prototype.redo = function() {
            var t, e, i, o, n, s, r, a, l, h, c;
            if (this._lineState) s = this._model.restoreSource(!1, this._paneIndex, null, this._lineState, null);
            else {
                for (t = this._originalSource, e = t.priceScale(), i = this._model.paneForSource(t), o = TradingView.className(t.constructor), n = t.properties().clone(), s = F.create(o, this._model, n, null, t.ownerSource()), s.setOwnerSource(t.ownerSource()), s.properties().visible._value = !0, s._fixedPoints = s._fixedPoints.concat(t._fixedPoints), r = 0; r < s._fixedPoints.length; r++) s._fixedPoints[r] = s._fixedPoints[r].add(new N.Point(20, 20));
                a = t._timePoint, l = this._withoutShift ? TradingView.clone(a) : D(a, t.ownerSource()), h = t._points, c = h, s.restorePoints(l, c), s.cloneData && s.cloneData(t), i.addDataSource(s, e), this._model.updateSource(s), s.checkAlert && s.checkAlert(), this._paneIndex = this._model.panes().indexOf(i), U.drawOnAllCharts().value() && this._model.copyToOtherCharts(s), this._lineState = s.state()
            }
        }, O.prototype.undo = function() {
            this._lineState || rt.logError("This command was never executed - nothing to undo");
            var t = this._model.dataSourceForId(this._lineState.id);
            this._model.removeSource(t)
        }, O.prototype.clonedLineToolId = function() { return this._lineState.id }, inherit(V, st), V.prototype.redo = function() { delete this._model.dataSourceForId(this._sourceId).linkKey }, V.prototype.undo = function() { this._model.dataSourceForId(this._sourceId).linkKey = this._linkKey }, inherit(B, st), B.prototype.redo = function() {
            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(15))
}, function(t, e, i) {
    (function(e) {
        "use strict";

        function i(t) { e.call(this, ""), this.subscribe(this, i.prototype.checkSelfColor), this.reloadProperties(t) }
        inherit(i, e), i.prototype.reloadProperties = function(t) {
            for (; this._childs.length > 0;) this.removeProperty(this._childs[0]);
            this._initValues = [];
            for (var e = 0; e < t.length; ++e) this._initValues.push(t[e].defaultValue), this.addChild(e, t[e].property);
            this.checkSelfColor()
        }, i.prototype.setValue = function(t, i) {
            if (this._value !== t || i) {
                var o = this;
                this._childs.forEach(function(e) { o[e].setValue(t || o._initValues[e]) }), e.prototype.setValue.call(this, t, i)
            }
        }, i.prototype.checkSelfColor = function() {
            var t, i = !0;
            for (t = 0; t < this._initValues.length; ++t)
                if (this[t].value() !== this[0].value()) { i = !1; break }
            e.prototype.setValue.call(this, i ? this[0].value() : "")
        }, t.exports = i
    }).call(e, i(24))
}, 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(2),
            l = i(1).LineDataSource,
            h = i(680),
            c = i(679),
            d = i(681),
            p = i(11).TrendLineRenderer,
            u = i(16).TextRenderer,
            _ = i(45).RectangleRenderer,
            f = i(48).DataSource,
            m = i(42),
            g = i(59),
            v = g.PaneRendererCrossHair,
            y = g.PaneRendererCrossHairLock,
            b = i(6),
            w = i(21),
            S = i(70).PercentageFormatter,
            T = i(123).TimeSpanFormatter,
            C = i(14);
        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;
            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.x = 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)
            }
            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), 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() {
            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(15))
}, 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(146),
        s = n.DataWindowView,
        r = n.DataWindowItem,
        a = i(27).PriceFormatter,
        l = i(162).DateFormatter,
        h = i(122).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) { this._crossHair = t, this._model = e, this._rendererData = { background: "#585858", color: "white", visible: !0 }, this._defaultFormatter = new r(100) }
    var n = i(67),
        s = i(66),
        r = i(27).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) { n.call(this), this._crosshair = t, this._model = e, this._rendererData = { visible: !1, background: "#585858", color: "white", text: "" } }
    var n = i(212),
        s = i(213),
        r = i(121).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) {
    "use strict";

    function o(t, e, o, s, r, a, l, h) {
        var c = i(676).ChartUndoModel,
            d = new c(t, e, o, s, r, a, l, h);
        return d.model().invalidate(new n(n.FULL_UPDATE)), d
    }
    var n = i(21),
        s = i(25);
    TradingView.MAMetaInfo = function() { return new s({ id: "MASimple", inputs: [{ id: "length", type: "integer", defval: 10 }, { id: "source", type: "text", defval: "close" }], plots: [{ id: "MovAvg", type: "line" }], properties: [{ id: "is_price_study", type: "bool", value: "true" }], palettes: {} }) }, TradingView.VolumeMetaInfo = function() { var t = { id: "Volume", inputs: [], plots: [{ id: "Volume", type: "histogram" }, { id: "Color", type: "colorer", palette: "volumePalette", target: "Volume" }], properties: [{ id: "is_price_study", type: "bool", value: "false" }], palettes: { volumePalette: { colors: { 0: { color: "#007F0E", width: 1, style: CanvasEx.LINESTYLE_SOLID, name: "Up Volume" }, 1: { color: "#872323", width: 1, style: CanvasEx.LINESTYLE_SOLID, name: "Down Volume" } } } } }; return new s(t) }, TradingView.DMMetaInfo = function() { return new s({ id: "DM", inputs: [{ id: "ADX smoothing", max: 50, min: 1, type: "integer", defval: 14 }, { id: "DI Length", max: 500, min: 1, type: "integer", defval: 14 }], plots: [{ id: "ADX", type: "line" }, { id: "DI_P", type: "line" }, { id: "DI_N", type: "line" }], properties: [{ id: "is_price_study", type: "bool", value: "false" }], palettes: {} }) }, TradingView.RSIMetaInfo = function() { return new s({ id: "RSI", inputs: [{ id: "length", type: "integer", defval: 14 }], plots: [{ id: "RelativeStrengthIndex", type: "line" }], properties: [{ id: "is_price_study", type: "bool", value: "false" }], palettes: {} }) }, t.exports = o
}, function(t, e, i) {
    (function(t) {
        "use strict";

        function o(t, e, i, o, n) {
            function s(t, i, o, n) {
                var r, a = i.split("."),
                    l = a[0];
                if (e && e[l] && (l = e[l]), !t.hasOwnProperty(l) && n && n === l) return r = a.splice(1).join("."), void s(t, r, o);
                if (!t.hasOwnProperty(l)) throw Error("illegal path");
                a.length > 1 ? (r = a.splice(1).join("."), s(t[l], r, o)) : t[l] && t[l].setValue ? t[l].setValue(o) : t[l] = o
            }
            if (void 0 !== o && o)
                for (var r in o) try { s(t, r, o[r], n) } catch (t) { void 0 !== i && i || v.logWarn("Path `" + r + "` does not exist.") }
        }

        function n(t, e, i, n) { "undefined" != typeof __defaultsOverrides && __defaultsOverrides && o(t, e, i, __defaultsOverrides, n) }

        function s() {
            var t = /^linetool.+/;
            Object.keys(TradingView.defaultProperties).forEach(function(e) { t.test(e) && n(TradingView.defaultProperties[e], null, !1, e) })
        }

        function r(t, e) { var i; /^study_.+/.test(t) && (i = f.parseIdString(t), y[i.id] = y[i.id] || {}, TradingView.merge(y[i.id], e)) }

        function a(t, e) {
            return e ? h(t, e) : l(t)
        }

        function l(t) { var e, i = b(t); return window._UNIT_TESTS || (e = TradingView.clone(TVSettings.getJSON(t, null))) && TradingView.merge(i, e), i }

        function h(t, e) { var i, o, n = b(t); return window._UNIT_TESTS || (i = TradingView.clone(TVSettings.getJSON(t, null)), t.startsWith("study_") && i && _.isVersionHead(i.version) && (o = e.updateStudyState(i, i), i = o), TradingView.merge(n, i)), n }
        var c = i(1).LineDataSource,
            d = i(43),
            p = i(147),
            u = i(52).LineToolPitchfork,
            _ = i(80),
            f = i(25),
            m = i(81).PlotType,
            g = i(221),
            v = i(12).getLogger("Chart.Defaults"),
            y = {},
            b = function(e) {
                var i, o, r, a, l, h, _, f, v, b = { a: function(t, e) { return { color: t, visible: e } }, b: function(t, e, i) { return { coeff: t, color: e, visible: i } }, c: function(t, e, i, o, n) { return { coeff: t, color: e, visible: i, linestyle: void 0 === o ? CanvasEx.LINESTYLE_SOLID : o, linewidth: void 0 === n ? 1 : n } }, d: function(t, e, i) { return { color: t, width: i, visible: e } }, e: function(t, e, i, o, n) { return { color: t, visible: e, width: i, x: o, y: n } }, f: function(t, e, i, o, n, s) { return { coeff1: t, coeff2: e, color: i, visible: o, linestyle: void 0 === n ? CanvasEx.LINESTYLE_SOLID : n, linewidth: void 0 === s ? 1 : s } } };
                if (void 0 === TradingView.defaultProperties) {
                    switch (window.locale) {
                        case "au":
                            i = "Australia/Sydney";
                            break;
                        case "br":
                            i = "America/Sao_Paulo";
                            break;
                        case "ca":
                            i = "America/Toronto";
                            break;
                        case "es":
                            i = "Europe/Madrid";
                            break;
                        case "fr":
                            i = "Europe/Paris";
                            break;
                        case "in":
                            i = "Asia/Kolkata";
                            break;
                        case "it":
                            i = "Europe/Berlin";
                            break;
                        case "ja":
                        case "kr":
                            i = "Asia/Tokyo";
                            break;
                        case "pl":
                            i = "Europe/Warsaw";
                            break;
                        case "ru":
                            i = "Europe/Moscow";
                            break;
                        case "tr":
                            i = "Europe/Athens";
                            break;
                        case "uk":
                            i = "Europe/London";
                            break;
                        default:
                            i = "Etc/UTC"
                    }
                    TradingView.defaultProperties = {
                        chartproperties: {
                            timezone: i,
                            timeScale: { barSpacing: g.DEFAULT_BAR_SPACING, rightOffset: g.DEFAULT_RIGHT_OFFSET },
                            dataWindowProperties: { background: "rgba( 255, 254, 206, 0.2)", border: "rgba( 96, 96, 144, 1)", font: "Verdana", fontBold: !1, fontItalic: !1, fontSize: 10, transparency: 80, visible: !0 },
                            paneProperties: { background: "rgba( 255, 255, 255, 1)", gridProperties: { color: "#E6E6E6", style: CanvasEx.LINESTYLE_SOLID }, vertGridProperties: { color: "rgba( 230, 230, 230, 1)", style: CanvasEx.LINESTYLE_SOLID }, horzGridProperties: { color: "rgba( 230, 230, 230, 1)", style: CanvasEx.LINESTYLE_SOLID }, crossHairProperties: { color: "rgba( 152, 152, 152, 1)", style: CanvasEx.LINESTYLE_DASHED, transparency: 0, width: 1 }, topMargin: 5, bottomMargin: 5, leftAxisProperties: { autoScale: !0, autoScaleDisabled: !1, percentage: !1, percentageDisabled: !1, log: !1, logDisabled: !1, alignLabels: !0 }, rightAxisProperties: { autoScale: !0, autoScaleDisabled: !1, percentage: !1, percentageDisabled: !1, log: !1, logDisabled: !1, alignLabels: !0 }, overlayPropreties: { autoScale: !0, autoScaleDisabled: !1, percentage: !1, percentageDisabled: !1, log: !1, logDisabled: !1, alignLabels: !0 }, legendProperties: { showStudyArguments: !0, showStudyTitles: !0, showStudyValues: !0, showSeriesTitle: !0, showSeriesOHLC: !0, showLegend: !0 } },
                            scalesProperties: { showLeftScale: !1, showRightScale: !0, backgroundColor: "rgba( 255, 255, 255, 1)", lineColor: "rgba( 85, 85, 85, 1)", textColor: "rgba( 85, 85, 85, 1)", fontSize: 11, scaleSeriesOnly: !1, showSeriesLastValue: !0, showStudyLastValue: !1, showSymbolLabels: !1, showStudyPlotLabels: !1 },
                            mainSeriesProperties: {
                                style: d.STYLE_CANDLES,
                                esdShowDividends: !0,
                                esdShowSplits: !0,
                                esdShowEarnings: !0,
                                esdShowBreaks: !1,
                                esdBreaksStyle: { color: "rgba( 226, 116, 91, 1)", style: CanvasEx.LINESTYLE_DASHED, width: 1 },
                                esdFlagSize: 2,
                                showCountdown: !0,
                                showInDataWindow: !0,
                                visible: !0,
                                silentIntervalChange: !1,
                                showPriceLine: !0,
                                priceLineWidth: 1,
                                lockScale: !1,
                                minTick: "default",
                                extendedHours: !1,
                                sessVis: !1,
                                statusViewStyle: { fontSize: 17, showExchange: !0, showInterval: !0, showSymbolAsDescription: !1 },
                                candleStyle: { upColor: "rgba( 107, 165, 131, 1)", downColor: "rgba( 215, 84, 66, 1)", drawWick: !0, drawBorder: !0, borderColor: "rgba( 55, 134, 88, 1)", borderUpColor: "rgba( 34, 84, 55, 1)", borderDownColor: "rgba( 91, 26, 19, 1)", wickColor: "rgba( 115, 115, 117, 1)", wickUpColor: "rgba( 115, 115, 117, 1)", wickDownColor: "rgba( 115, 115, 117, 1)", barColorsOnPrevClose: !1 },
                                hollowCandleStyle: { upColor: "rgba( 107, 165, 131, 1)", downColor: "rgba( 215, 84, 66, 1)", drawWick: !0, drawBorder: !0, borderColor: "rgba( 55, 134, 88, 1)", borderUpColor: "rgba( 34, 84, 55, 1)", borderDownColor: "rgba( 91, 26, 19, 1)", wickColor: "rgba( 115, 115, 117, 1)", wickUpColor: "rgba( 115, 115, 117, 1)", wickDownColor: "rgba( 115, 115, 117, 1)" },
                                haStyle: { upColor: "rgba( 107, 165, 131, 1)", downColor: "rgba( 215, 84, 66, 1)", drawWick: !0, drawBorder: !0, borderColor: "rgba( 55, 134, 88, 1)", borderUpColor: "rgba( 34, 84, 55, 1)", borderDownColor: "rgba( 91, 26, 19, 1)", wickColor: "rgba( 115, 115, 117, 1)", wickUpColor: "rgba( 115, 115, 117, 1)", wickDownColor: "rgba( 115, 115, 117, 1)", showRealLastPrice: !1, barColorsOnPrevClose: !1 },
                                barStyle: { upColor: "rgba( 107, 165, 131, 1)", downColor: "rgba( 215, 84, 66, 1)", barColorsOnPrevClose: !1, dontDrawOpen: !1 },
                                lineStyle: { color: "rgba( 60, 120, 216, 1)", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 1, priceSource: "close", styleType: d.STYLE_LINE_TYPE_SIMPLE },
                                areaStyle: { color1: "rgba( 96, 96, 144, 0.5)", color2: "rgba( 1, 246, 245, 0.5)", linecolor: "rgba( 0, 148, 255, 1)", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 1, priceSource: "close", transparency: 50 },
                                priceAxisProperties: { autoScale: !0, autoScaleDisabled: !1, percentage: !1, percentageDisabled: !1, log: !1, logDisabled: !1 },
                                renkoStyle: { upColor: "rgba( 107, 165, 131, 1)", downColor: "rgba( 215, 84, 66, 1)", borderUpColor: "rgba( 34, 84, 55, 1)", borderDownColor: "rgba( 91, 26, 19, 1)", upColorProjection: "rgba( 74, 214, 190, 1)", downColorProjection: "rgba( 214, 73, 207, 1)", borderUpColorProjection: "rgba( 34, 84, 55, 1)", borderDownColorProjection: "rgba( 91, 26, 19, 1)", inputs: { source: "close", boxSize: 3, style: "ATR", atrLength: 14 }, inputInfo: { source: { name: "Source" }, boxSize: { name: "Box size" }, style: { name: "Style" }, atrLength: { name: "ATR Length" } } },
                                pbStyle: { upColor: "rgba( 107, 165, 131, 1)", downColor: "rgba( 215, 84, 66, 1)", borderUpColor: "rgba( 34, 84, 55, 1)", borderDownColor: "rgba( 91, 26, 19, 1)", upColorProjection: "rgba( 74, 214, 190, 1)", downColorProjection: "rgba( 214, 73, 207, 1)", borderUpColorProjection: "rgba( 34, 84, 55, 1)", borderDownColorProjection: "rgba( 91, 26, 19, 1)", inputs: { source: "close", lb: 3 }, inputInfo: { source: { name: "Source" }, lb: { name: "Number of line" } } },
                                kagiStyle: {
                                    upColor: "rgba( 107, 165, 131, 1)",
                                    downColor: "rgba( 215, 84, 66, 1)",
                                    upColorProjection: "rgba( 74, 214, 190, 1)",
                                    downColorProjection: "rgba( 214, 73, 207, 1)",
                                    inputs: { source: "close", style: "ATR", atrLength: 14, reversalAmount: 1 },
                                    inputInfo: { source: { name: "Source" }, style: { name: "Style" }, atrLength: { name: "ATR Length" }, reversalAmount: { name: "Reversal amount" } }
                                },
                                pnfStyle: { upColor: "rgba( 107, 165, 131, 1)", downColor: "rgba( 215, 84, 66, 1)", upColorProjection: "rgba( 74, 214, 190, 1)", downColorProjection: "rgba( 214, 73, 207, 1)", inputs: { sources: "HL", reversalAmount: 3, boxSize: 1, style: "ATR", atrLength: 14 }, inputInfo: { sources: { name: "Source" }, boxSize: { name: "Box size" }, reversalAmount: { name: "Reversal amount" }, style: { name: "Style" }, atrLength: { name: "ATR Length" } } }
                            },
                            symbolWatermarkProperties: { color: "rgba( 85, 85, 85, 0)", transparency: 100 },
                            chartEventsSourceProperties: { visible: !0, futureOnly: !0, breaks: { color: "rgba(85, 85, 85, 1)", visible: !1, style: CanvasEx.LINESTYLE_DASHED, width: 1 } },
                            tradingProperties: { showPositions: !0, showOrders: !0, showExecutions: !0, extendLeft: !0, lineLength: 5, lineWidth: 1, lineStyle: CanvasEx.LINESTYLE_DASHED },
                            alertsProperties: { labels: { visible: !0, color: "rgba( 215, 84, 66, 1)", highlightColor: "rgba( 255, 255, 51, 1)", hoverColor: "rgba( 245, 227, 135, 1)", line: { visible: !0, style: CanvasEx.LINESTYLE_DASHED, width: 1 } }, fakeLabels: { visible: !0, color: "rgba( 119, 119, 119, 1)", line: { visible: !0, style: CanvasEx.LINESTYLE_DASHED, width: 1 } }, drawingIcon: { color: "rgba( 170, 170, 170, 1)" } },
                            editorFontsList: ["Verdana", "Courier New", "Times New Roman", "Arial"],
                            volumePaneSize: "large"
                        },
                        drawings: { magnet: !1, stayInDrawingMode: !1, drawOnAllCharts: !0, crossHairColor: "rgba( 183, 183, 183, 1)", crossHairStyle: CanvasEx.LINESTYLE_DASHED, crossHairWidth: 1 },
                        linetoolorder: { singleChartOnly: !0, extendLeft: "inherit", lineLength: "inherit", lineColor: "rgba( 255, 0, 0, 1)", lineTransparency: 0, lineStyle: "inherit", lineWidth: "inherit", bodyBorderColor: "rgba( 255, 0, 0, 0)", bodyBorderTransparency: 0, bodyBackgroundColor: "rgba( 255, 255, 255, 0.75)", bodyBackgroundTransparency: 25, bodyTextColor: "rgba( 255, 0, 0, 0)", bodyTextTransparency: 0, bodyFontFamily: "Verdana", bodyFontSize: 7, bodyFontBold: !0, bodyFontItalic: !1, quantityBorderColor: "rgba( 255, 0, 0, 0)", quantityBorderTransparency: 0, quantityBackgroundColor: "rgba( 255, 0, 0, 0.75)", quantityBackgroundTransparency: 25, quantityTextColor: "rgba( 255, 255, 255, 1)", quantityTextTransparency: 0, quantityFontFamily: "Verdana", quantityFontSize: 7, quantityFontBold: !0, quantityFontItalic: !1, cancelButtonBorderColor: "rgba( 255, 0, 0, 1)", cancelButtonBorderTransparency: 0, cancelButtonBackgroundColor: "rgba( 255, 255, 255, 0.75)", cancelButtonBackgroundTransparency: 25, cancelButtonIconColor: "rgba( 255, 0, 0, 1)", cancelButtonIconTransparency: 0, tooltip: "" },
                        linetoolposition: {
                            singleChartOnly: !0,
                            extendLeft: "inherit",
                            lineLength: "inherit",
                            lineColor: "rgba( 0, 113, 224, 1)",
                            lineTransparency: 0,
                            lineStyle: "inherit",
                            lineWidth: "inherit",
                            bodyBorderColor: "rgba( 0, 113, 224, 1)",
                            bodyBorderTransparency: 0,
                            bodyBackgroundColor: "rgba( 255, 255, 255, 0.75)",
                            bodyBackgroundTransparency: 25,
                            bodyTextColor: "rgba( 0, 113, 224, 1)",
                            bodyTextTransparency: 0,
                            bodyFontFamily: "Verdana",
                            bodyFontSize: 7,
                            bodyFontBold: !0,
                            bodyFontItalic: !1,
                            quantityBorderColor: "rgba( 0, 113, 224, 1)",
                            quantityBorderTransparency: 0,
                            quantityBackgroundColor: "rgba( 0, 113, 224, 0.75)",
                            quantityBackgroundTransparency: 25,
                            quantityTextColor: "rgba( 255, 255, 255, 1)",
                            quantityTextTransparency: 0,
                            quantityFontFamily: "Verdana",
                            quantityFontSize: 7,
                            quantityFontBold: !0,
                            quantityFontItalic: !1,
                            reverseButtonBorderColor: "rgba( 0, 113, 224, 1)",
                            reverseButtonBorderTransparency: 0,
                            reverseButtonBackgroundColor: "rgba( 255, 255, 255, 0.75)",
                            reverseButtonBackgroundTransparency: 25,
                            reverseButtonIconColor: "rgba( 0, 113, 224, 1)",
                            reverseButtonIconTransparency: 0,
                            closeButtonBorderColor: "rgba( 0, 113, 224, 1)",
                            closeButtonBorderTransparency: 0,
                            closeButtonBackgroundColor: "rgba( 255, 255, 255, 0.75)",
                            closeButtonBackgroundTransparency: 25,
                            closeButtonIconColor: "rgba( 0, 113, 224, 1)",
                            closeButtonIconTransparency: 0,
                            tooltip: ""
                        },
                        linetoolexecution: { singleChartOnly: !0, direction: "buy", arrowHeight: 8, arrowSpacing: 1, arrowColor: "rgba( 0, 0, 255, 1)", arrowTransparency: 0, text: "", textColor: "rgba( 0, 0, 0, 1)", textTransparency: 0, fontFamily: "Verdana", fontSize: 8, fontBold: !1, fontItalic: !1, tooltip: "" },
                        linetoolicon: { singleChartOnly: !0, clonable: !0, color: "rgba( 61, 133, 198, 1)", size: 40, icon: 9786, angle: .5 * Math.PI, scale: 1 },
                        linetoolbezierquadro: { clonable: !0, linecolor: "rgba( 21, 153, 128, 1)", linewidth: 1, fillBackground: !1, backgroundColor: "rgba( 21, 56, 153, 0.5)", transparency: 50, linestyle: CanvasEx.LINESTYLE_SOLID, extendLeft: !1, extendRight: !1, leftEnd: c.LINEEND_NORMAL, rightEnd: c.LINEEND_NORMAL },
                        linetoolbeziercubic: { clonable: !0, linecolor: "rgba( 21, 153, 128, 1)", linewidth: 1, fillBackground: !1, backgroundColor: "rgba( 21, 56, 153, 0.5)", transparency: 50, linestyle: CanvasEx.LINESTYLE_SOLID, extendLeft: !1, extendRight: !1, leftEnd: c.LINEEND_NORMAL, rightEnd: c.LINEEND_NORMAL },
                        linetooltrendline: { clonable: !0, linecolor: "rgba( 21, 153, 128, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID, extendLeft: !1, extendRight: !1, leftEnd: c.LINEEND_NORMAL, rightEnd: c.LINEEND_NORMAL, font: "Verdana", textcolor: "rgba( 21, 119, 96, 1)", fontsize: 12, bold: !1, italic: !1, snapTo45Degrees: !0, alwaysShowStats: !1, showPriceRange: !1, showBarsRange: !1, showDateTimeRange: !1, showDistance: !1, showAngle: !1 },
                        linetooltimecycles: { clonable: !0, linecolor: "rgba(21, 153, 128, 1)", linewidth: 1, fillBackground: !0, backgroundColor: "rgba(106, 168, 79, 0.5)", transparency: 50, linestyle: CanvasEx.LINESTYLE_SOLID },
                        linetoolsineline: { clonable: !0, linecolor: "rgba( 21, 153, 128, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID },
                        linetooltrendangle: { singleChartOnly: !0, clonable: !0, linecolor: "rgba( 21, 153, 128, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID, snapTo45Degrees: !0, font: "Verdana", textcolor: "rgba( 21, 119, 96, 1)", fontsize: 12, bold: !0, italic: !1, alwaysShowStats: !1, showPriceRange: !1, showBarsRange: !1, extendRight: !1, extendLeft: !1 },
                        linetooldisjointangle: {
                            clonable: !0,
                            linecolor: "rgba( 18, 159, 92, 1)",
                            linewidth: 2,
                            linestyle: CanvasEx.LINESTYLE_SOLID,
                            fillBackground: !0,
                            backgroundColor: "rgba( 106, 168, 79, 0.5)",
                            transparency: 50,
                            extendLeft: !1,
                            extendRight: !1,
                            leftEnd: c.LINEEND_NORMAL,
                            rightEnd: c.LINEEND_NORMAL,
                            font: "Verdana",
                            textcolor: "rgba( 18, 159, 92, 1)",
                            fontsize: 12,
                            bold: !1,
                            italic: !1,
                            showPrices: !1,
                            showPriceRange: !1,
                            showDateTimeRange: !1,
                            showBarsRange: !1
                        },
                        linetoolflatbottom: { clonable: !0, linecolor: "rgba( 73, 133, 231, 1)", linewidth: 2, linestyle: CanvasEx.LINESTYLE_SOLID, fillBackground: !0, backgroundColor: "rgba( 21, 56, 153, 0.5)", transparency: 50, extendLeft: !1, extendRight: !1, leftEnd: c.LINEEND_NORMAL, rightEnd: c.LINEEND_NORMAL, font: "Verdana", textcolor: "rgba( 73, 133, 231, 1)", fontsize: 12, bold: !1, italic: !1, showPrices: !1, showPriceRange: !1, showDateTimeRange: !1, showBarsRange: !1 },
                        linetoolfibspiral: { clonable: !0, linecolor: "rgba( 21, 153, 128, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID },
                        linetooldaterange: { clonable: !0, linecolor: "rgba( 88, 88, 88, 1)", linewidth: 1, font: "Verdana", textcolor: "rgba( 255, 255, 255, 1)", fontsize: 12, fillLabelBackground: !0, labelBackgroundColor: "rgba( 91, 133, 191, 0.9)", labelBackgroundTransparency: 30, fillBackground: !0, backgroundColor: "rgba( 186, 218, 255, 0.4)", backgroundTransparency: 60, drawBorder: !1, borderColor: "rgba( 102, 123, 139, 1)" },
                        linetoolpricerange: { clonable: !0, linecolor: "rgba( 88, 88, 88, 1)", linewidth: 1, font: "Verdana", textcolor: "rgba( 255, 255, 255, 1)", fontsize: 12, fillLabelBackground: !0, labelBackgroundColor: "rgba( 91, 133, 191, 0.9)", labelBackgroundTransparency: 30, fillBackground: !0, backgroundColor: "rgba( 186, 218, 255, 0.4)", backgroundTransparency: 60, drawBorder: !1, borderColor: "rgba( 102, 123, 139, 1)" },
                        linetooldateandpricerange: { clonable: !0, linecolor: "rgba( 88, 88, 88, 1)", linewidth: 1, font: "Verdana", textcolor: "rgba( 255, 255, 255, 1)", fontsize: 12, fillLabelBackground: !0, labelBackgroundColor: "rgba( 91, 133, 191, 0.9)", labelBackgroundTransparency: 30, fillBackground: !0, backgroundColor: "rgba( 186, 218, 255, 0.4)", backgroundTransparency: 60, drawBorder: !1, borderColor: "rgba( 102, 123, 139, 1)" },
                        linetoolriskrewardshort: { isShort: !0, clonable: !0, linecolor: "rgba( 88, 88, 88, 1)", linewidth: 1, font: "Verdana", textcolor: "rgba(255, 255, 255, 1)", fontsize: 12, fillLabelBackground: !0, labelBackgroundColor: "rgba( 88, 88, 88, 1)", labelBackgroundTransparency: 0, fillBackground: !0, stopBackground: "rgba( 255, 0, 0, 0.2)", profitBackground: "rgba( 0, 160, 0, 0.2)", stopBackgroundTransparency: 80, profitBackgroundTransparency: 80, drawBorder: !1, borderColor: "rgba( 102, 123, 139, 1)", compact: !1, showRiskInPercents: !0, accountSize: 1e3, risk: 25 },
                        linetoolriskrewardlong: { isShort: !1, clonable: !0, linecolor: "rgba( 88, 88, 88, 1)", linewidth: 1, font: "Verdana", textcolor: "rgba(255, 255, 255, 1)", fontsize: 12, fillLabelBackground: !0, labelBackgroundColor: "rgba( 88, 88, 88, 1)", labelBackgroundTransparency: 0, fillBackground: !0, stopBackground: "rgba( 255, 0, 0, 0.2)", profitBackground: "rgba( 0, 160, 0, 0.2)", stopBackgroundTransparency: 80, profitBackgroundTransparency: 80, drawBorder: !1, borderColor: "rgba( 102, 123, 139, 1)", compact: !1, showRiskInPercents: !0, accountSize: 1e3, risk: 25 },
                        linetoolarrow: {
                            clonable: !0,
                            linecolor: "rgba( 111, 136, 198, 1)",
                            linewidth: 2,
                            linestyle: CanvasEx.LINESTYLE_SOLID,
                            extendLeft: !1,
                            extendRight: !1,
                            leftEnd: c.LINEEND_NORMAL,
                            rightEnd: c.LINEEND_ARROW,
                            font: "Verdana",
                            textcolor: "rgba( 21, 119, 96, 1)",
                            fontsize: 12,
                            bold: !1,
                            italic: !1,
                            alwaysShowStats: !1,
                            showPriceRange: !1,
                            showBarsRange: !1,
                            showDateTimeRange: !1,
                            showDistance: !1,
                            showAngle: !1
                        },
                        linetoolray: { clonable: !0, linecolor: "rgba( 21, 153, 128, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID, extendLeft: !1, extendRight: !0, leftEnd: c.LINEEND_NORMAL, rightEnd: c.LINEEND_NORMAL, font: "Verdana", textcolor: "rgba( 21, 119, 96, 1)", fontsize: 12, bold: !1, italic: !1, alwaysShowStats: !1, showPriceRange: !1, showBarsRange: !1, showDateTimeRange: !1, showDistance: !1, showAngle: !1 },
                        linetoolextended: { clonable: !0, linecolor: "rgba( 21, 153, 128, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID, extendLeft: !0, extendRight: !0, leftEnd: c.LINEEND_NORMAL, rightEnd: c.LINEEND_NORMAL, font: "Verdana", textcolor: "rgba( 21, 119, 96, 1)", fontsize: 12, bold: !1, italic: !1, alwaysShowStats: !1, showPriceRange: !1, showBarsRange: !1, showDateTimeRange: !1, showDistance: !1, showAngle: !1 },
                        linetoolhorzline: { clonable: !0, linecolor: "rgba( 128, 204, 219, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID, showPrice: !0, showLabel: !1, text: "", font: "Verdana", textcolor: "rgba( 21, 119, 96, 1)", fontsize: 12, bold: !1, italic: !1, horzLabelsAlign: "center", vertLabelsAlign: "top" },
                        linetoolhorzray: { clonable: !0, linecolor: "rgba( 128, 204, 219, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID, showPrice: !0, showLabel: !1, text: "", font: "Verdana", textcolor: "rgba( 21, 119, 96, 1)", fontsize: 12, bold: !1, italic: !1, horzLabelsAlign: "center", vertLabelsAlign: "top" },
                        linetoolvertline: { clonable: !0, linecolor: "rgba( 128, 204, 219, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID, showTime: !0 },
                        linetoolcirclelines: { clonable: !0, trendline: { visible: !0, color: "rgba( 128, 128, 128, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_DASHED }, linecolor: "rgba( 128, 204, 219, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID },
                        linetoolfibtimezone: { horzLabelsAlign: "right", vertLabelsAlign: "bottom", clonable: !0, baselinecolor: "rgba( 128, 128, 128, 1)", linecolor: "rgba( 0, 85, 219, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID, showLabels: !0, font: "Verdana", fillBackground: !1, transparency: 80, trendline: { visible: !0, color: "rgba( 128, 128, 128, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_DASHED }, level1: b.c(0, "rgba( 128, 128, 128, 1)", !0), level2: b.c(1, "rgba( 0, 85, 219, 1)", !0), level3: b.c(2, "rgba( 0, 85, 219, 1)", !0), level4: b.c(3, "rgba( 0, 85, 219, 1)", !0), level5: b.c(5, "rgba( 0, 85, 219, 1)", !0), level6: b.c(8, "rgba( 0, 85, 219, 1)", !0), level7: b.c(13, "rgba( 0, 85, 219, 1)", !0), level8: b.c(21, "rgba( 0, 85, 219, 1)", !0), level9: b.c(34, "rgba( 0, 85, 219, 1)", !0), level10: b.c(55, "rgba( 0, 85, 219, 1)", !0), level11: b.c(89, "rgba( 0, 85, 219, 1)", !0), __collectibleLines: ["trendline", "level1", "level2", "level3", "level4", "level5", "level6", "level7", "level8", "level9", "level10", "level11"] },
                        linetooltext: {
                            clonable: !0,
                            color: "rgba( 102, 123, 139, 1)",
                            text: $.t("Text"),
                            font: "Verdana",
                            fontsize: 20,
                            fillBackground: !1,
                            backgroundColor: "rgba( 91, 133, 191, 0.9)",
                            backgroundTransparency: 70,
                            drawBorder: !1,
                            borderColor: "rgba( 102, 123, 139, 1)",
                            bold: !1,
                            italic: !1,
                            locked: !1,
                            fixedSize: !0,
                            wordWrap: !1,
                            wordWrapWidth: 400
                        },
                        linetooltextabsolute: { singleChartOnly: !0, clonable: !0, color: "rgba( 102, 123, 139, 1)", text: $.t("Text"), font: "Verdana", fontsize: 20, fillBackground: !1, backgroundColor: "rgba( 155, 190, 213, 0.3)", backgroundTransparency: 70, drawBorder: !1, borderColor: "rgba( 102, 123, 139, 1)", bold: !1, italic: !1, locked: !0, wordWrap: !1, wordWrapWidth: 400 },
                        linetoolballoon: { clonable: !0, color: "rgba( 102, 123, 139, 1)", backgroundColor: "rgba( 255, 254, 206, 0.7)", borderColor: "rgba( 140, 140, 140, 1)", fontWeight: "bold", fontsize: 12, font: "Arial", transparency: 30, text: $.t("Comment") },
                        linetoolbrush: { clonable: !0, linecolor: "rgba( 53, 53, 53, 1)", linewidth: 2, linestyle: CanvasEx.LINESTYLE_SOLID, smooth: 5, fillBackground: !1, backgroundColor: "rgba( 21, 56, 153, 0.5)", transparency: 50, leftEnd: c.LINEEND_NORMAL, rightEnd: c.LINEEND_NORMAL },
                        linetoolpolyline: { clonable: !0, linecolor: "rgba( 53, 53, 53, 1)", linewidth: 2, linestyle: CanvasEx.LINESTYLE_SOLID, fillBackground: !0, backgroundColor: "rgba( 21, 56, 153, 0.5)", transparency: 50, filled: !1 },
                        linetoolarrowmark: { clonable: !0, color: "rgba( 120, 120, 120, 1)", text: "", fontsize: 20, font: "Verdana" },
                        linetoolarrowmarkleft: { clonable: !0, color: "rgba( 120, 120, 120, 1)", text: "", fontsize: 20, font: "Verdana" },
                        linetoolarrowmarkup: { clonable: !0, color: "rgba( 120, 120, 120, 1)", text: "", fontsize: 20, font: "Verdana" },
                        linetoolarrowmarkright: { clonable: !0, color: "rgba( 120, 120, 120, 1)", text: "", fontsize: 20, font: "Verdana" },
                        linetoolarrowmarkdown: { clonable: !0, color: "rgba( 120, 120, 120, 1)", text: "", fontsize: 20, font: "Verdana" },
                        linetoolflagmark: { clonable: !0, color: "rgba( 255, 0, 0, 1)" },
                        linetoolnote: { clonable: !0, markerColor: "rgba( 46, 102, 255, 1)", textColor: "rgba( 0, 0, 0, 1)", backgroundColor: "rgba( 255, 255, 255, 1)", backgroundTransparency: 0, text: $.t("Text"), font: "Arial", fontSize: 12, bold: !1, italic: !1, locked: !1, fixedSize: !0 },
                        linetoolnoteabsolute: { singleChartOnly: !0, clonable: !0, markerColor: "rgba( 46, 102, 255, 1)", textColor: "rgba( 0, 0, 0, 1)", backgroundColor: "rgba( 255, 255, 255, 1)", backgroundTransparency: 0, text: $.t("Text"), font: "Arial", fontSize: 12, bold: !1, italic: !1, locked: !0, fixedSize: !0 },
                        linetoolthumbup: { clonable: !0, color: "rgba( 0, 128, 0, 1)" },
                        linetoolthumbdown: { clonable: !0, color: "rgba( 255, 0, 0, 1)" },
                        linetoolpricelabel: { clonable: !0, color: "rgba( 102, 123, 139, 1)", backgroundColor: "rgba( 255, 255, 255, 0.7)", borderColor: "rgba( 140, 140, 140, 1)", fontWeight: "bold", fontsize: 11, font: "Arial", transparency: 30 },
                        linetoolrectangle: { clonable: !0, color: "rgba( 21, 56, 153, 1)", fillBackground: !0, backgroundColor: "rgba( 21, 56, 153, 0.5)", linewidth: 1, snapTo45Degrees: !0, transparency: 50 },
                        linetoolrotatedrectangle: { clonable: !0, color: "rgba( 152, 0, 255, 1)", fillBackground: !0, backgroundColor: "rgba( 142, 124, 195, 0.5)", transparency: 50, linewidth: 1, snapTo45Degrees: !0 },
                        linetoolellipse: {
                            clonable: !0,
                            color: "rgba( 153, 153, 21, 1)",
                            fillBackground: !0,
                            backgroundColor: "rgba( 153, 153, 21, 0.5)",
                            transparency: 50,
                            linewidth: 1
                        },
                        linetoolarc: { clonable: !0, color: "rgba( 153, 153, 21, 1)", fillBackground: !0, backgroundColor: "rgba( 153, 153, 21, 0.5)", transparency: 50, linewidth: 1 },
                        linetoolprediction: { singleChartOnly: !0, linecolor: "rgba( 28, 115, 219, 1)", linewidth: 2, sourceBackColor: "rgba( 241, 241, 241, 1)", sourceTextColor: "rgba( 110, 110, 110, 1)", sourceStrokeColor: "rgba( 110, 110, 110, 1)", targetStrokeColor: "rgba( 47, 168, 255, 1)", targetBackColor: "rgba( 11, 111, 222, 1)", targetTextColor: "rgba( 255, 255, 255, 1)", successBackground: "rgba( 54, 160, 42, 0.9)", successTextColor: "rgba( 255, 255, 255, 1)", failureBackground: "rgba( 231, 69, 69, 0.5)", failureTextColor: "rgba( 255, 255, 255, 1)", intermediateBackColor: "rgba( 234, 210, 137, 1)", intermediateTextColor: "rgba( 109, 77, 34, 1)", transparency: 10, centersColor: "rgba( 32, 32, 32, 1)" },
                        linetooltriangle: { clonable: !0, color: "rgba( 153, 21, 21, 1)", fillBackground: !0, backgroundColor: "rgba( 153, 21, 21, 0.5)", transparency: 50, linewidth: 1 },
                        linetoolcallout: { clonable: !0, color: "rgba( 255, 255, 255, 1)", backgroundColor: "rgba( 153, 21, 21, 0.5)", transparency: 50, linewidth: 2, fontsize: 12, font: "Verdana", text: $.t("Text"), bordercolor: "rgba( 153, 21, 21, 1)", bold: !1, italic: !1, wordWrap: !1, wordWrapWidth: 400 },
                        linetoolparallelchannel: { clonable: !0, linecolor: "rgba( 119, 52, 153, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID, extendLeft: !1, extendRight: !1, fillBackground: !0, backgroundColor: "rgba( 180, 167, 214, 0.5)", transparency: 50, showMidline: !1, midlinecolor: "rgba( 119, 52, 153, 1)", midlinewidth: 1, midlinestyle: CanvasEx.LINESTYLE_DASHED },
                        linetoolelliottimpulse: { degree: 7, clonable: !0, showWave: !0, color: "rgba( 61, 133, 198, 1)", linewidth: 1 },
                        linetoolelliotttriangle: { degree: 7, clonable: !0, showWave: !0, color: "rgba( 255, 152, 0, 1)", linewidth: 1 },
                        linetoolelliotttriplecombo: { degree: 7, clonable: !0, showWave: !0, color: "rgba( 106, 168, 79, 1)", linewidth: 1 },
                        linetoolelliottcorrection: { degree: 7, clonable: !0, showWave: !0, color: "rgba( 61, 133, 198, 1)", linewidth: 1 },
                        linetoolelliottdoublecombo: { degree: 7, clonable: !0, showWave: !0, color: "rgba( 106, 168, 79, 1)", linewidth: 1 },
                        linetoolbarspattern: { singleChartOnly: !0, color: "rgba( 80, 145, 204, 1)", clonable: !0, mode: p.BARS_MODE, mirrored: !1, flipped: !1 },
                        linetoolghostfeed: { singleChartOnly: !0, clonable: !0, averageHL: 20, variance: 50, candleStyle: { upColor: "#6ba583", downColor: "#d75442", drawWick: !0, drawBorder: !0, borderColor: "#378658", borderUpColor: "#225437", borderDownColor: "#5b1a13", wickColor: "#737375" }, transparency: 50 },
                        study: { inputs: {}, styles: {}, palettes: {}, bands: {}, area: {}, graphics: {}, showInDataWindow: !0, visible: !0, showStudyArguments: !0, precision: "default" },
                        linetoolpitchfork: {
                            clonable: !0,
                            fillBackground: !0,
                            transparency: 80,
                            style: u.STYLE_ORIGINAL,
                            median: { visible: !0, color: "rgba( 165, 0, 0, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID },
                            level0: b.c(.25, "rgba( 160, 107, 0, 1)", !1),
                            level1: b.c(.382, "rgba( 105, 158, 0, 1)", !1),
                            level2: b.c(.5, "rgba( 0, 155, 0, 1)", !0),
                            level3: b.c(.618, "rgba( 0, 153, 101, 1)", !1),
                            level4: b.c(.75, "rgba( 0, 101, 153, 1)", !1),
                            level5: b.c(1, "rgba( 0, 0, 153, 1)", !0),
                            level6: b.c(1.5, "rgba( 102, 0, 153, 1)", !1),
                            level7: b.c(1.75, "rgba( 153, 0, 102, 1)", !1),
                            level8: b.c(2, "rgba( 165, 0, 0, 1)", !1),
                            __collectibleLines: ["median", "level0", "level1", "level2", "level3", "level4", "level5", "level6", "level7", "level8"]
                        },
                        linetoolpitchfan: { clonable: !0, fillBackground: !0, transparency: 80, median: { visible: !0, color: "rgba( 165, 0, 0, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID }, level0: b.c(.25, "rgba( 160, 107, 0, 1)", !1), level1: b.c(.382, "rgba( 105, 158, 0, 1)", !1), level2: b.c(.5, "rgba( 0, 155, 0, 1)", !0), level3: b.c(.618, "rgba( 0, 153, 101, 1)", !1), level4: b.c(.75, "rgba( 0, 101, 153, 1)", !1), level5: b.c(1, "rgba( 0, 0, 153, 1)", !0), level6: b.c(1.5, "rgba( 102, 0, 153, 1)", !1), level7: b.c(1.75, "rgba( 153, 0, 102, 1)", !1), level8: b.c(2, "rgba( 165, 0, 0, 1)", !1), __collectibleLines: ["median", "level0", "level1", "level2", "level3", "level4", "level5", "level6", "level7", "level8"] },
                        linetoolgannfan: { clonable: !0, showLabels: !0, font: "Verdana", fillBackground: !0, transparency: 80, level1: b.f(1, 8, "rgba( 160, 107, 0, 1)", !0), level2: b.f(1, 4, "rgba( 105, 158, 0, 1)", !0), level3: b.f(1, 3, "rgba( 0, 155, 0, 1)", !0), level4: b.f(1, 2, "rgba( 0, 153, 101, 1)", !0), level5: b.f(1, 1, "rgba( 128, 128, 128, 1)", !0), level6: b.f(2, 1, "rgba( 0, 101, 153, 1)", !0), level7: b.f(3, 1, "rgba( 0, 0, 153, 1)", !0), level8: b.f(4, 1, "rgba( 102, 0, 153, 1)", !0), level9: b.f(8, 1, "rgba( 165, 0, 0, 1)", !0), __collectibleLines: ["level1", "level2", "level3", "level4", "level5", "level6", "level7", "level8", "level9", "level10", "level11"] },
                        linetoolganncomplex: { clonable: !0, fillBackground: !1, arcsBackground: { fillBackground: !0, transparency: 80 }, reverse: !1, levels: [b.d("rgba( 128, 128, 128, 1)", !0, 1), b.d("rgba( 160, 107, 0, 1)", !0, 1), b.d("rgba( 105, 158, 0, 1)", !0, 1), b.d("rgba( 0, 155, 0, 1)", !0, 1), b.d("rgba( 0, 153, 101, 1)", !0, 1), b.d("rgba( 128, 128, 128, 1)", !0, 1)], fanlines: [b.e("rgba( 165, 0, 255, 1)", !1, 1, 8, 1), b.e("rgba( 165, 0, 0, 1)", !1, 1, 5, 1), b.e("rgba( 128, 128, 128, 1)", !1, 1, 4, 1), b.e("rgba( 160, 107, 0, 1)", !1, 1, 3, 1), b.e("rgba( 105, 158, 0, 1)", !0, 1, 2, 1), b.e("rgba( 0, 155, 0, 1)", !0, 1, 1, 1), b.e("rgba( 0, 153, 101, 1)", !0, 1, 1, 2), b.e("rgba( 0, 153, 101, 1)", !1, 1, 1, 3), b.e("rgba( 0, 0, 153, 1)", !1, 1, 1, 4), b.e("rgba( 102, 0, 153, 1)", !1, 1, 1, 5), b.e("rgba( 165, 0, 255, 1)", !1, 1, 1, 8)], arcs: [b.e("rgba( 160, 107, 0, 1)", !0, 1, 1, 0), b.e("rgba( 160, 107, 0, 1)", !0, 1, 1, 1), b.e("rgba( 160, 107, 0, 1)", !0, 1, 1.5, 0), b.e("rgba( 105, 158, 0, 1)", !0, 1, 2, 0), b.e("rgba( 105, 158, 0, 1)", !0, 1, 2, 1), b.e("rgba( 0, 155, 0, 1)", !0, 1, 3, 0), b.e("rgba( 0, 155, 0, 1)", !0, 1, 3, 1), b.e("rgba( 0, 153, 101, 1)", !0, 1, 4, 0), b.e("rgba( 0, 153, 101, 1)", !0, 1, 4, 1), b.e("rgba( 0, 0, 153, 1)", !0, 1, 5, 0), b.e("rgba( 0, 0, 153, 1)", !0, 1, 5, 1)], __collectibleLines: ["trendline", "levels.0", "levels.1", "levels.2", "levels.3", "levels.4", "levels.5", "fanlines.0", "fanlines.1", "fanlines.2", "fanlines.3", "fanlines.4", "fanlines.5", "fanlines.6", "fanlines.7", "fanlines.8", "fanlines.9", "fanlines.10", "arcs.0", "arcs.1", "arcs.2", "arcs.3", "arcs.4", "arcs.5", "arcs.6", "arcs.7", "arcs.8", "arcs.9", "arcs.10"] },
                        linetoolgannsquare: {
                            clonable: !0,
                            color: "rgba( 21, 56, 153, 0.8)",
                            linewidth: 1,
                            linestyle: CanvasEx.LINESTYLE_SOLID,
                            font: "Verdana",
                            showTopLabels: !0,
                            showBottomLabels: !0,
                            showLeftLabels: !0,
                            showRightLabels: !0,
                            fillHorzBackground: !0,
                            horzTransparency: 80,
                            fillVertBackground: !0,
                            vertTransparency: 80,
                            reverse: !1,
                            fans: b.a("rgba( 128, 128, 128, 1)", !1),
                            hlevel1: b.b(0, "rgba( 128, 128, 128, 1)", !0),
                            hlevel2: b.b(.25, "rgba( 160, 107, 0, 1)", !0),
                            hlevel3: b.b(.382, "rgba( 105, 158, 0, 1)", !0),
                            hlevel4: b.b(.5, "rgba( 0, 155, 0, 1)", !0),
                            hlevel5: b.b(.618, "rgba( 0, 153, 101, 1)", !0),
                            hlevel6: b.b(.75, "rgba( 0, 101, 153, 1)", !0),
                            hlevel7: b.b(1, "rgba( 128, 128, 128, 1)", !0),
                            vlevel1: b.b(0, "rgba( 128, 128, 128, 1)", !0),
                            vlevel2: b.b(.25, "rgba( 160, 107, 0, 1)", !0),
                            vlevel3: b.b(.382, "rgba( 105, 158, 0, 1)", !0),
                            vlevel4: b.b(.5, "rgba( 0, 155, 0, 1)", !0),
                            vlevel5: b.b(.618, "rgba( 0, 153, 101, 1)", !0),
                            vlevel6: b.b(.75, "rgba( 0, 101, 153, 1)", !0),
                            vlevel7: b.b(1, "rgba( 128, 128, 128, 1)", !0),
                            __collectibleLines: ["fans", "hlevel1", "hlevel2", "hlevel3", "hlevel4", "hlevel5", "hlevel6", "hlevel7", "vlevel1", "vlevel2", "vlevel3", "vlevel4", "vlevel5", "vlevel6", "vlevel7"]
                        },
                        linetoolfibspeedresistancefan: { clonable: !0, fillBackground: !0, transparency: 80, grid: { color: "rgba( 128, 128, 128, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID, visible: !0 }, linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID, font: "Verdana", showTopLabels: !0, showBottomLabels: !0, showLeftLabels: !0, showRightLabels: !0, snapTo45Degrees: !0, hlevel1: b.b(0, "rgba( 128, 128, 128, 1)", !0), hlevel2: b.b(.25, "rgba( 160, 107, 0, 1)", !0), hlevel3: b.b(.382, "rgba( 105, 158, 0, 1)", !0), hlevel4: b.b(.5, "rgba( 0, 155, 0, 1)", !0), hlevel5: b.b(.618, "rgba( 0, 153, 101, 1)", !0), hlevel6: b.b(.75, "rgba( 0, 101, 153, 1)", !0), hlevel7: b.b(1, "rgba( 128, 128, 128, 1)", !0), vlevel1: b.b(0, "rgba( 128, 128, 128, 1)", !0), vlevel2: b.b(.25, "rgba( 160, 107, 0, 1)", !0), vlevel3: b.b(.382, "rgba( 105, 158, 0, 1)", !0), vlevel4: b.b(.5, "rgba( 0, 155, 0, 1)", !0), vlevel5: b.b(.618, "rgba( 0, 153, 101, 1)", !0), vlevel6: b.b(.75, "rgba( 0, 101, 153, 1)", !0), vlevel7: b.b(1, "rgba( 128, 128, 128, 1)", !0), __collectibleLines: ["trendline", "hlevel1", "hlevel2", "hlevel3", "hlevel4", "hlevel5", "hlevel6", "hlevel7", "vlevel1", "vlevel2", "vlevel3", "vlevel4", "vlevel5", "vlevel6", "vlevel7"] },
                        linetoolfibretracement: {
                            clonable: !0,
                            showCoeffs: !0,
                            showPrices: !0,
                            font: "Verdana",
                            fillBackground: !0,
                            transparency: 80,
                            extendLines: !1,
                            horzLabelsAlign: "left",
                            vertLabelsAlign: "middle",
                            reverse: !1,
                            coeffsAsPercents: !1,
                            trendline: { visible: !0, color: "rgba( 128, 128, 128, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_DASHED },
                            levelsStyle: { linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID },
                            level1: b.b(0, "rgba( 128, 128, 128, 1)", !0),
                            level2: b.b(.236, "rgba( 204, 40, 40, 1)", !0),
                            level3: b.b(.382, "rgba( 149, 204, 40, 1)", !0),
                            level4: b.b(.5, "rgba( 40, 204, 40, 1)", !0),
                            level5: b.b(.618, "rgba( 40, 204, 149, 1)", !0),
                            level6: b.b(.786, "rgba( 40, 149, 204, 1)", !0),
                            level7: b.b(1, "rgba( 128, 128, 128, 1)", !0),
                            level8: b.b(1.618, "rgba( 40, 40, 204, 1)", !0),
                            level9: b.b(2.618, "rgba( 204, 40, 40, 1)", !0),
                            level10: b.b(3.618, "rgba( 149, 40, 204, 1)", !0),
                            level11: b.b(4.236, "rgba( 204, 40, 149, 1)", !0),
                            level12: b.b(1.272, "rgba( 149, 204, 40, 1)", !1),
                            level13: b.b(1.414, "rgba( 204, 40, 40, 1)", !1),
                            level16: b.b(2, "rgba( 40, 204, 149, 1)", !1),
                            level14: b.b(2.272, "rgba( 149, 204, 40, 1)", !1),
                            level15: b.b(2.414, "rgba( 40, 204, 40, 1)", !1),
                            level17: b.b(3, "rgba( 40, 149, 204, 1)", !1),
                            level18: b.b(3.272, "rgba( 128, 128, 128, 1)", !1),
                            level19: b.b(3.414, "rgba( 40, 40, 204, 1)", !1),
                            level20: b.b(4, "rgba( 204, 40, 40, 1)", !1),
                            level21: b.b(4.272, "rgba( 149, 40, 204, 1)", !1),
                            level22: b.b(4.414, "rgba( 204, 40, 149, 1)", !1),
                            level23: b.b(4.618, "rgba( 149, 204, 40, 1)", !1),
                            level24: b.b(4.764, "rgba( 40, 204, 149, 1)", !1),
                            __collectibleLines: ["trendline", "level1", "level2", "level3", "level4", "level5", "level6", "level7", "level8", "level9", "level10", "level11", "level12", "level13", "level14", "level15", "level16", "level17", "level18", "level19", "level20", "level21", "level22", "level23", "level24"]
                        },
                        linetoolfibchannel: { clonable: !0, showCoeffs: !0, showPrices: !0, font: "Verdana", fillBackground: !0, transparency: 80, extendLeft: !1, extendRight: !1, horzLabelsAlign: "left", vertLabelsAlign: "middle", coeffsAsPercents: !1, levelsStyle: { linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID }, level1: b.b(0, "rgba( 128, 128, 128, 1)", !0), level2: b.b(.236, "rgba( 204, 40, 40, 1)", !0), level3: b.b(.382, "rgba( 149, 204, 40, 1)", !0), level4: b.b(.5, "rgba( 40, 204, 40, 1)", !0), level5: b.b(.618, "rgba( 40, 204, 149, 1)", !0), level6: b.b(.786, "rgba( 40, 149, 204, 1)", !0), level7: b.b(1, "rgba( 128, 128, 128, 1)", !0), level8: b.b(1.618, "rgba( 40, 40, 204, 1)", !0), level9: b.b(2.618, "rgba( 204, 40, 40, 1)", !0), level10: b.b(3.618, "rgba( 149, 40, 204, 1)", !0), level11: b.b(4.236, "rgba( 204, 40, 149, 1)", !0), level12: b.b(1.272, "rgba( 149, 204, 40, 1)", !1), level13: b.b(1.414, "rgba( 204, 40, 40, 1)", !1), level16: b.b(2, "rgba( 40, 204, 149, 1)", !1), level14: b.b(2.272, "rgba( 149, 204, 40, 1)", !1), level15: b.b(2.414, "rgba( 40, 204, 40, 1)", !1), level17: b.b(3, "rgba( 40, 149, 204, 1)", !1), level18: b.b(3.272, "rgba( 128, 128, 128, 1)", !1), level19: b.b(3.414, "rgba( 40, 40, 204, 1)", !1), level20: b.b(4, "rgba( 204, 40, 40, 1)", !1), level21: b.b(4.272, "rgba( 149, 40, 204, 1)", !1), level22: b.b(4.414, "rgba( 204, 40, 149, 1)", !1), level23: b.b(4.618, "rgba( 149, 204, 40, 1)", !1), level24: b.b(4.764, "rgba( 40, 204, 149, 1)", !1), __collectibleLines: ["level1", "level2", "level3", "level4", "level5", "level6", "level7", "level8", "level9", "level10", "level11", "level12", "level13", "level14", "level15", "level16", "level17", "level18", "level19", "level20", "level21", "level22", "level23", "level24"] },
                        linetoolprojection: { clonable: !0, showCoeffs: !0, font: "Verdana", fillBackground: !0, transparency: 80, color1: "rgba( 0, 128, 0, 0.2)", color2: "rgba( 255, 0, 0, 0.2)", linewidth: 1, trendline: { visible: !0, color: "rgba( 128, 128, 128, 1)", linestyle: CanvasEx.LINESTYLE_SOLID }, level1: b.c(1, "rgba( 128, 128, 128, 1)", !0) },
                        linetool5pointspattern: { clonable: !0, color: "rgba( 204, 40, 149, 1)", textcolor: "rgba( 255, 255, 255, 1)", fillBackground: !0, backgroundColor: "rgba( 204, 40, 149, 0.5)", font: "Verdana", fontsize: 12, bold: !1, italic: !1, transparency: 50, linewidth: 1 },
                        linetoolcypherpattern: {
                            clonable: !0,
                            color: "#CC2895",
                            textcolor: "#FFFFFF",
                            fillBackground: !0,
                            backgroundColor: "#CC2895",
                            font: "Verdana",
                            fontsize: 12,
                            bold: !1,
                            italic: !1,
                            transparency: 50,
                            linewidth: 1
                        },
                        linetooltrianglepattern: { clonable: !0, color: "rgba( 149, 40, 255, 1)", textcolor: "rgba( 255, 255, 255, 1)", fillBackground: !0, backgroundColor: "rgba( 149, 40, 204, 0.5)", font: "Verdana", fontsize: 12, bold: !1, italic: !1, transparency: 50, linewidth: 1 },
                        linetoolabcd: { clonable: !0, color: "rgba( 0, 155, 0, 1)", textcolor: "rgba( 255, 255, 255, 1)", font: "Verdana", fontsize: 12, bold: !1, italic: !1, linewidth: 2 },
                        linetoolthreedrivers: { clonable: !0, color: "rgba( 149, 40, 255, 1)", textcolor: "rgba( 255, 255, 255, 1)", fillBackground: !0, backgroundColor: "rgba( 149, 40, 204, 0.5)", font: "Verdana", fontsize: 12, bold: !1, italic: !1, transparency: 50, linewidth: 2 },
                        linetoolheadandshoulders: { clonable: !0, color: "rgba( 69, 104, 47, 1)", textcolor: "rgba( 255, 255, 255, 1)", fillBackground: !0, backgroundColor: "rgba( 69, 168, 47, 0.5)", font: "Verdana", fontsize: 12, bold: !1, italic: !1, transparency: 50, linewidth: 2 },
                        linetoolfibwedge: { singleChartOnly: !0, clonable: !0, showCoeffs: !0, font: "Verdana", fillBackground: !0, transparency: 80, trendline: { visible: !0, color: "rgba( 128, 128, 128, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID }, level1: b.c(.236, "rgba( 204, 40, 40, 1)", !0), level2: b.c(.382, "rgba( 149, 204, 40, 1)", !0), level3: b.c(.5, "rgba( 40, 204, 40, 1)", !0), level4: b.c(.618, "rgba( 40, 204, 149, 1)", !0), level5: b.c(.786, "rgba( 40, 149, 204, 1)", !0), level6: b.c(1, "rgba( 128, 128, 128, 1)", !0), level7: b.c(1.618, "rgba( 40, 40, 204, 1)", !1), level8: b.c(2.618, "rgba( 204, 40, 40, 1)", !1), level9: b.c(3.618, "rgba( 149, 40, 204, 1)", !1), level10: b.c(4.236, "rgba( 204, 40, 149, 1)", !1), level11: b.c(4.618, "rgba( 204, 40, 149, 1)", !1), __collectibleLines: ["trendline", "level1", "level2", "level3", "level4", "level5", "level6", "level7", "level8", "level9", "level10", "level11"] },
                        linetoolfibcircles: { clonable: !0, showCoeffs: !0, font: "Verdana", fillBackground: !0, transparency: 80, snapTo45Degrees: !0, coeffsAsPercents: !1, trendline: { visible: !0, color: "rgba( 128, 128, 128, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_DASHED }, level1: b.c(.236, "rgba( 204, 40, 40, 1)", !0), level2: b.c(.382, "rgba( 149, 204, 40, 1)", !0), level3: b.c(.5, "rgba( 40, 204, 40, 1)", !0), level4: b.c(.618, "rgba( 40, 204, 149, 1)", !0), level5: b.c(.786, "rgba( 40, 149, 204, 1)", !0), level6: b.c(1, "rgba( 128, 128, 128, 1)", !0), level7: b.c(1.618, "rgba( 40, 40, 204, 1)", !0), level8: b.c(2.618, "rgba( 204, 40, 40, 1)", !0), level9: b.c(3.618, "rgba( 149, 40, 204, 1)", !0), level10: b.c(4.236, "rgba( 204, 40, 149, 1)", !0), level11: b.c(4.618, "rgba( 204, 40, 149, 1)", !0), __collectibleLines: ["trendline", "level1", "level2", "level3", "level4", "level5", "level6", "level7", "level8", "level9", "level10", "level11"] },
                        linetoolfibspeedresistancearcs: {
                            clonable: !0,
                            showCoeffs: !0,
                            font: "Verdana",
                            fillBackground: !0,
                            transparency: 80,
                            fullCircles: !1,
                            trendline: { visible: !0, color: "rgba( 128, 128, 128, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_DASHED },
                            level1: b.c(.236, "rgba( 204, 40, 40, 1)", !0),
                            level2: b.c(.382, "rgba( 149, 204, 40, 1)", !0),
                            level3: b.c(.5, "rgba( 40, 204, 40, 1)", !0),
                            level4: b.c(.618, "rgba( 40, 204, 149, 1)", !0),
                            level5: b.c(.786, "rgba( 40, 149, 204, 1)", !0),
                            level6: b.c(1, "rgba( 128, 128, 128, 1)", !0),
                            level7: b.c(1.618, "rgba( 40, 40, 204, 1)", !0),
                            level8: b.c(2.618, "rgba( 204, 40, 40, 1)", !0),
                            level9: b.c(3.618, "rgba( 149, 40, 204, 1)", !0),
                            level10: b.c(4.236, "rgba( 204, 40, 149, 1)", !0),
                            level11: b.c(4.618, "rgba( 204, 40, 149, 1)", !0),
                            __collectibleLines: ["trendline", "level1", "level2", "level3", "level4", "level5", "level6", "level7", "level8", "level9", "level10", "level11"]
                        },
                        linetooltrendbasedfibextension: { clonable: !0, showCoeffs: !0, showPrices: !0, font: "Verdana", fillBackground: !0, transparency: 80, extendLines: !1, horzLabelsAlign: "left", vertLabelsAlign: "middle", reverse: !1, coeffsAsPercents: !1, trendline: { visible: !0, color: "rgba( 128, 128, 128, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_DASHED }, levelsStyle: { linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID }, level1: b.b(0, "rgba( 128, 128, 128, 1)", !0), level2: b.b(.236, "rgba( 204, 40, 40, 1)", !0), level3: b.b(.382, "rgba( 149, 204, 40, 1)", !0), level4: b.b(.5, "rgba( 40, 204, 40, 1)", !0), level5: b.b(.618, "rgba( 40, 204, 149, 1)", !0), level6: b.b(.786, "rgba( 40, 149, 204, 1)", !0), level7: b.b(1, "rgba( 128, 128, 128, 1)", !0), level8: b.b(1.618, "rgba( 40, 40, 204, 1)", !0), level9: b.b(2.618, "rgba( 204, 40, 40, 1)", !0), level10: b.b(3.618, "rgba( 149, 40, 204, 1)", !0), level11: b.b(4.236, "rgba( 204, 40, 149, 1)", !0), level12: b.b(1.272, "rgba( 149, 204, 40, 1)", !1), level13: b.b(1.414, "rgba( 204, 40, 40, 1)", !1), level16: b.b(2, "rgba( 40, 204, 149, 1)", !1), level14: b.b(2.272, "rgba( 149, 204, 40, 1)", !1), level15: b.b(2.414, "rgba( 40, 204, 40, 1)", !1), level17: b.b(3, "rgba( 40, 149, 204, 1)", !1), level18: b.b(3.272, "rgba( 128, 128, 128, 1)", !1), level19: b.b(3.414, "rgba( 40, 40, 204, 1)", !1), level20: b.b(4, "rgba( 204, 40, 40, 1)", !1), level21: b.b(4.272, "rgba( 149, 40, 204, 1)", !1), level22: b.b(4.414, "rgba( 204, 40, 149, 1)", !1), level23: b.b(4.618, "rgba( 149, 204, 40, 1)", !1), level24: b.b(4.764, "rgba( 40, 204, 149, 1)", !1), __collectibleLines: ["trendline", "level1", "level2", "level3", "level4", "level5", "level6", "level7", "level8", "level9", "level10", "level11", "level12", "level13", "level14", "level15", "level16", "level17", "level18", "level19", "level20", "level21", "level22", "level23", "level24"] },
                        linetooltrendbasedfibtime: {
                            clonable: !0,
                            showCoeffs: !0,
                            font: "Verdana",
                            fillBackground: !0,
                            transparency: 80,
                            horzLabelsAlign: "right",
                            vertLabelsAlign: "bottom",
                            trendline: { visible: !0, color: "rgba( 128, 128, 128, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_DASHED },
                            level1: b.c(0, "rgba( 128, 128, 128, 1)", !0),
                            level2: b.c(.382, "rgba( 204, 40, 40, 1)", !0),
                            level3: b.c(.5, "rgba( 149, 204, 40, 1)", !1),
                            level4: b.c(.618, "rgba( 40, 204, 40, 1)", !0),
                            level5: b.c(1, "rgba( 40, 204, 149, 1)", !0),
                            level6: b.c(1.382, "rgba( 40, 149, 204, 1)", !0),
                            level7: b.c(1.618, "rgba( 128, 128, 128, 1)", !0),
                            level8: b.c(2, "rgba( 40, 40, 204, 1)", !0),
                            level9: b.c(2.382, "rgba( 204, 40, 40, 1)", !0),
                            level10: b.c(2.618, "rgba( 149, 40, 204, 1)", !0),
                            level11: b.c(3, "rgba( 204, 40, 149, 1)", !0),
                            __collectibleLines: ["trendline", "level1", "level2", "level3", "level4", "level5", "level6", "level7", "level8", "level9", "level10", "level11"]
                        },
                        linetoolschiffpitchfork: { clonable: !0, fillBackground: !0, transparency: 80, style: u.STYLE_SCHIFF, median: { visible: !0, color: "rgba( 165, 0, 0, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID }, level0: b.c(.25, "rgba( 160, 107, 0, 1)", !1), level1: b.c(.382, "rgba( 105, 158, 0, 1)", !1), level2: b.c(.5, "rgba( 0, 155, 0, 1)", !0), level3: b.c(.618, "rgba( 0, 153, 101, 1)", !1), level4: b.c(.75, "rgba( 0, 101, 153, 1)", !1), level5: b.c(1, "rgba( 0, 0, 153, 1)", !0), level6: b.c(1.5, "rgba( 102, 0, 153, 1)", !1), level7: b.c(1.75, "rgba( 153, 0, 102, 1)", !1), level8: b.c(2, "rgba( 165, 0, 0, 1)", !1), __collectibleLines: ["median", "level0", "level1", "level2", "level3", "level4", "level5", "level6", "level7", "level8"] },
                        linetoolschiffpitchfork2: { clonable: !0, fillBackground: !0, transparency: 80, style: u.STYLE_SCHIFF2, median: { visible: !0, color: "rgba( 165, 0, 0, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID }, level0: b.c(.25, "rgba( 160, 107, 0, 1)", !1), level1: b.c(.382, "rgba( 105, 158, 0, 1)", !1), level2: b.c(.5, "rgba( 0, 155, 0, 1)", !0), level3: b.c(.618, "rgba( 0, 153, 101, 1)", !1), level4: b.c(.75, "rgba( 0, 101, 153, 1)", !1), level5: b.c(1, "rgba( 0, 0, 153, 1)", !0), level6: b.c(1.5, "rgba( 102, 0, 153, 1)", !1), level7: b.c(1.75, "rgba( 153, 0, 102, 1)", !1), level8: b.c(2, "rgba( 165, 0, 0, 1)", !1), __collectibleLines: ["median", "level0", "level1", "level2", "level3", "level4", "level5", "level6", "level7", "level8"] },
                        linetoolinsidepitchfork: { clonable: !0, fillBackground: !0, transparency: 80, style: u.STYLE_INSIDE, median: { visible: !0, color: "rgba( 165, 0, 0, 1)", linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID }, level0: b.c(.25, "rgba( 160, 107, 0, 1)", !1), level1: b.c(.382, "rgba( 105, 158, 0, 1)", !1), level2: b.c(.5, "rgba( 0, 155, 0, 1)", !0), level3: b.c(.618, "rgba( 0, 153, 101, 1)", !1), level4: b.c(.75, "rgba( 0, 101, 153, 1)", !1), level5: b.c(1, "rgba( 0, 0, 153, 1)", !0), level6: b.c(1.5, "rgba( 102, 0, 153, 1)", !1), level7: b.c(1.75, "rgba( 153, 0, 102, 1)", !1), level8: b.c(2, "rgba( 165, 0, 0, 1)", !1), __collectibleLines: ["median", "level0", "level1", "level2", "level3", "level4", "level5", "level6", "level7", "level8"] },
                        linetool: { frozen: !1, visible: !0 },
                        linetoolvisibilities: { intervalsVisibilities: { seconds: !0, secondsFrom: 1, secondsTo: 59, minutes: !0, minutesFrom: 1, minutesTo: 59, hours: !0, hoursFrom: 1, hoursTo: 24, days: !0, daysFrom: 1, daysTo: 366, weeks: !0, months: !0 } }
                    }, n(TradingView.defaultProperties.chartproperties), s()
                }
                for (void 0 === TradingView.defaultProperties["study_MA@tv-basicstudies"] && (TradingView.defaultProperties["study_MA@tv-basicstudies"] = { description: "Moving Average", shortDescription: "MA", inputs: { length: 9, source: "close" }, styles: { MovAvg: { visible: !0, color: "rgba( 4, 150, 255, 1)", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 1, plottype: m.Line, histogramBase: 0, title: "MA" } } }), void 0 === TradingView.defaultProperties["study_ErrorOnUpdate@tv-basicstudies"] && (TradingView.defaultProperties["study_ErrorOnUpdate@tv-basicstudies"] = {
                        description: "Error On Update",
                        styles: {
                            ErrorOnUpdate: {
                                visible: !0,
                                color: "rgba( 255, 0, 0, 1)",
                                linestyle: CanvasEx.LINESTYLE_SOLID,
                                linewidth: 1,
                                plottype: m.Line,
                                histogramBase: 0
                            }
                        }
                    }), void 0 === TradingView.defaultProperties["study_ErrorOnCreate@tv-basicstudies"] && (TradingView.defaultProperties["study_ErrorOnCreate@tv-basicstudies"] = { description: "Error On Create", styles: { ErrorOnUpdate: { visible: !0, color: "rgba( 0, 255, 0, 1)", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 1, plottype: m.Line, histogramBase: 0 } } }), void 0 === TradingView.defaultProperties["study_ErrorOnNewBar@tv-basicstudies"] && (TradingView.defaultProperties["study_ErrorOnNewBar@tv-basicstudies"] = { description: "Error On New Bar", styles: { ErrorOnUpdate: { visible: !0, color: "rgba( 0, 0, 255, 1)", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 1, plottype: m.Line, histogramBase: 0 } } }), void 0 === TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"] && (TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"] = { font: "Arial", fontsize: 10, borderColor: "rgba( 83, 143, 31, 1)", backColor: "rgba( 240, 255, 204, 1)", textColor: "rgba( 0, 0, 0, 1)" }), void 0 === TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"] && (o = "rgba( 212, 121, 40, 1)", r = !0, a = 1, TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"] = { _hardCodedDefaultsVersion: 1, font: "Arial", fontsize: 11, levelsStyle: { showLabels: !0, visibility: { P: r, "S1/R1": r, "S2/R2": r, "S3/R3": r, "S4/R4": r, "S5/R5": r }, colors: { P: o, "S1/R1": o, "S2/R2": o, "S3/R3": o, "S4/R4": o, "S5/R5": o }, widths: { P: a, "S1/R1": a, "S2/R2": a, "S3/R3": a, "S4/R4": a, "S5/R5": a } } }), void 0 === TradingView.defaultProperties["study_ZigZag@tv-basicstudies"] && (TradingView.defaultProperties["study_ZigZag@tv-basicstudies"] = { color: "rgba( 86, 135, 29, 1)", linewidth: 2 }), void 0 === TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"] && (TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"] = { inputs: {}, level0: b.a("rgba( 255, 0, 0, 1)", !1), level1: b.a("rgba( 0, 128, 0, 1)", !1), level2: b.a("rgba( 0, 0, 255, 1)", !1), level3: b.a("rgba( 255, 0, 255, 1)", !1), level4: b.a("rgba( 0, 128, 255, 1)", !0), level5: b.a("rgba( 255, 0, 0, 1)", !0), level6: b.a("rgba( 0, 128, 0, 1)", !0), level7: b.a("rgba( 0, 0, 255, 1)", !0), level8: b.a("rgba( 255, 0, 255, 1)", !0) }), void 0 === TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"] && (TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"] = { styles: { upLine: { visible: !0, color: "rgba( 0, 0, 255, 0.3)", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 1 }, downLine: { visible: !0, color: "rgba( 0, 0, 255, 0.3)", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 1 }, baseLine: { visible: !0, color: "rgba( 255, 0, 0, 0.3)", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 1 }, extendLines: !0, showPearsons: !0, backgroundColor: "rgba( 153, 21, 21, 0.3)", transparency: 70 } }), void 0 === TradingView.defaultProperties["study_RegressionTrend@tv-basicstudies"] && (TradingView.defaultProperties["study_RegressionTrend@tv-basicstudies"] = {
                        linewidth: 1,
                        linestyle: CanvasEx.LINESTYLE_SOLID,
                        styles: {
                            upLine: { visible: !0, color: "rgba( 0, 0, 255, 0.3)", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 1 },
                            downLine: {
                                visible: !0,
                                color: "rgba( 0, 0, 255, 0.3)",
                                linestyle: CanvasEx.LINESTYLE_SOLID,
                                linewidth: 1
                            },
                            baseLine: { visible: !0, color: "rgba( 255, 0, 0, 0.3)", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 1 },
                            extendLines: !1,
                            showPearsons: !0,
                            transparency: 70
                        }
                    }), void 0 === TradingView.defaultProperties["study_Compare@tv-basicstudies"] && (TradingView.defaultProperties["study_Compare@tv-basicstudies"] = { minTick: "default" }), void 0 === TradingView.defaultProperties["study_Overlay@tv-basicstudies"] && (l = "study_Overlay@tv-basicstudies", TradingView.defaultProperties[l] = { style: d.STYLE_BARS, showPriceLine: !1, minTick: "default", candleStyle: { upColor: "rgba( 107, 165, 131, 1)", downColor: "rgba( 215, 84, 66, 1)", drawWick: !0, drawBorder: !0, borderColor: "rgba( 55, 134, 88, 1)", borderUpColor: "rgba( 34, 84, 55, 1)", borderDownColor: "rgba( 91, 26, 19, 1)", wickColor: "rgba( 115, 115, 117, 1)", wickUpColor: "rgba( 115, 115, 117, 1)", wickDownColor: "rgba( 115, 115, 117, 1)", barColorsOnPrevClose: !1 }, hollowCandleStyle: { upColor: "rgba( 107, 165, 131, 1)", downColor: "rgba( 215, 84, 66, 1)", drawWick: !0, drawBorder: !0, borderColor: "rgba( 55, 134, 88, 1)", borderUpColor: "rgba( 34, 84, 55, 1)", borderDownColor: "rgba( 91, 26, 19, 1)", wickColor: "rgba( 115, 115, 117, 1)", wickUpColor: "rgba( 115, 115, 117, 1)", wickDownColor: "rgba( 115, 115, 117, 1)", barColorsOnPrevClose: !1 }, barStyle: { upColor: "rgba( 107, 165, 131, 1)", downColor: "rgba( 215, 84, 66, 1)", barColorsOnPrevClose: !1, dontDrawOpen: !1 }, lineStyle: { color: "rgba( 3, 3, 247, 1)", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 1, priceSource: "close", styleType: d.STYLE_LINE_TYPE_SIMPLE }, areaStyle: { color1: "rgba( 96, 96, 144, 0.5)", color2: "rgba( 1, 246, 245, 0.5)", linecolor: "rgba( 0, 148, 255, 1)", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 1, priceSource: "close", transparency: 50 }, styles: { open: { visible: !0, color: "rgba( 255, 0, 0, 1)", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 1, plottype: m.Line, histogramBase: 0, title: "open" }, high: { visible: !0, color: "rgba( 255, 0, 0, 1)", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 1, plottype: m.Line, histogramBase: 0, title: "high" }, low: { visible: !0, color: "rgba( 255, 0, 0, 1)", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 1, plottype: m.Line, histogramBase: 0, title: "low" }, close: { visible: !0, color: "rgba( 255, 0, 0, 1)", linestyle: CanvasEx.LINESTYLE_SOLID, linewidth: 1, plottype: m.Line, histogramBase: 0, title: "close" } } }, t.enabled("use_overrides_for_overlay") && n(TradingView.defaultProperties[l], null, !1, l)), h = e.split("."), _ = TradingView.defaultProperties, f = 0; f < h.length; f++) _ && (_ = _[h[f]]);
                return v = _ ? TradingView.clone(_) : {}, y[e] && TradingView.merge(v, y[e]), v
            };
        a.create = function(t, e) {
                var i, o;
                e && (i = f.parseIdString(t), o = b(i.id), TradingView.defaultProperties[i.id] = $.extend(e, o))
            }, a.remove = function(t) { TradingView.defaultProperties[t] = void 0 }, TradingView.saveDefaults = function(t, e) { TVSettings.setJSON(t, e) }, TradingView.factoryDefaults = b, window.defaults = a, window.applyDefaultsOverrides = n, window.applyPropertiesOverrides = o, window.applyDefaultOverridesToLinetools = s, window.applyOverridesToStudies = r, e.factoryDefaults = b, e.applyDefaultsOverrides = n, e.applyPropertiesOverrides = o,
            e.applyDefaultOverridesToLinetools = s, e.defaults = a
    }).call(e, i(3))
}, function(t, e, i) {
    "use strict";

    function o(t, e) { this._lastClickedId = null, this._model = t, this._study = e, this._metaInfo = e.metaInfo(), this._lollipops = {}, this._textCache = {}, this.templatesCache = {}, this._invalidated = !0, this.templatesCache.hovered = this.createTemplate(this.hoveredStyle), this.templatesCache.default = this.createTemplate(this.defaultStyle) }

    function n(t) { this.data = t }

    function s(t) { this.data = t, this._hittest = new l(l.CUSTOM, t) }

    function r(t, e) { this._data = t, this._paneView = e, this.textRenderer = new r.TextRenderer(t.style.lollipop.importance) }
    var a = i(2),
        l = i(8),
        h = i(6),
        c = i(260).Tooltip;
    o.prototype.onClickOutside = function() { this._lastClickedId = null }, o.prototype.closeTooltips = function() { var t, e; for (t in this._lollipops) this._lollipops.hasOwnProperty(t) && (e = this._lollipops[t], e.visible && (e.tooltip.isOpened() && e.tooltip.hide(), e.visible = !1)) }, o.prototype.getLastClickedLollipopId = function() { return this._lastClickedId }, o.prototype._setStackStudies = function() { this._stackStudies = [] }, o.prototype._getY = function() {
        var t, e, i = 0,
            o = this._model.panes();
        for (t = o.length; t--;) e = o[t], e.containsMainSeries() && (i += e.height());
        return i
    }, o.prototype.update = function() { this._invalidated = !0 }, o.prototype.updateImpl = function() {
        var t, e, i, o, n, s, r, a, l, h, c, d;
        this._setStackStudies(), t = this, e = this._study.data(), i = this._model.timeScale(), o = i.visibleBars(), n = this._model.mainSeries().bars(), s = this._study.priceScale(), r = this._model.mainSeries(), a = r.firstBar(), s && !s.isEmpty() && !i.isEmpty() && a && e && (this.closeTooltips(), l = this._getY(), h = o.firstBar(), c = o.lastBar(), d = e.range(h, c), d.each(function(e, o) {
            var r, a = 0;
            for (r = 0; r < t._stackStudies.length; ++r) t._stackStudies[r].data().contains(e) && ++a;
            e > h && e < c && t.addLollipop(l, n, i, s, e, o, a)
        }), this.afterUpdate(l, n, i, s))
    }, o.prototype.addLollipop = function(t, e, i, o, n, s, r) {
        var l, h, d, p, u, _, f, m, g = s[0],
            v = this._model.mainSeries().symbolInfo();
        v && (l = v.name, h = null, d = this._study.metaInfo().id + "_" + g + "_" + l, p = this._model.lastHittestData(), u = p && p.id === d, u && (_ = e.valueAt(n)) && (f = _[TradingView.LOW_PLOT], o.isPercent() && (m = this._model.mainSeries().firstValue(), f = o.priceRange().convertToPercent(f, m)), h = o.priceToCoordinate(f)), this._lollipops[d] = $.extend({ id: d, visible: !0, basePoint: new a.Point(i.indexToCoordinate(n) + 1, t), hovered: u || d === this.getLastClickedLollipopId(), barY: h, stack: r, tooltip: this._lollipops.hasOwnProperty(d) ? this._lollipops[d].tooltip : new c }, this.extraData(s)))
    }, o.prototype.afterUpdate = function(t, e, i) {}, o.prototype.extraData = function(t) { throw Error("Not Implemented") }, o.prototype.createText = function(t, e) { throw Error("Not Implemented") }, o.prototype.showBarLine = function() { return !0 }, o.prototype.getStyle = function(t, e) { var i, o = t; return e.stack && (o += "_stack:" + e.stack), "hovered" === o ? this.hoveredStyle : "default" === o ? this.defaultStyle : (this._stylesCache || (this._stylesCache = {}), this._stylesCache[o] || (i = TradingView.clone("hovered" === t ? this.hoveredStyle : this.defaultStyle), e.stack && (i.lollipop.incHeight = 24 * e.stack), this._stylesCache[o] = i), this._stylesCache[o]) }, o.prototype.hasTooltip = function(t) {
        return !0
    }, o.prototype.renderer = function() {
        var t, e, i, o, l, c, d, p, u;
        this._invalidated && (this.updateImpl(), this._invalidated = !1), t = new h;
        for (e in this._lollipops) this._lollipops.hasOwnProperty(e) && (i = this._lollipops[e], o = 15, l = this.getStyle(i.hovered ? "hovered" : "default", i), i.visible && (c = $.extend({ tooltipPoint: new a.Point(i.basePoint.x, i.basePoint.y - l.lollipop.circleHeight - o - (l.lollipop.incHeight || 0)), style: l, createText: this.createText }, i), d = this.getTemplate(i.hovered ? "hovered" : "default", i), p = { circlePoint: new a.Point(i.basePoint.x, i.basePoint.y - l.lollipop.circleHeight - (l.lollipop.incHeight || 0)), style: l, template: d, basePoint: i.basePoint, id: i.id, mouseClickHandler: this._lollipopMouseClickHandler.bind(this, i.id) }, t.append(new s(p)), i.hovered && this.hasTooltip(i) && i.barY && this.showBarLine() && (u = { style: { lineStyle: l.barLine.lineStyle, strokeStyle: l.strokeStyle, lineWidth: l.lineWidth }, startPoint: new a.Point(i.basePoint.x, i.basePoint.y - l.lollipop.circleHeight), endPoint: new a.Point(i.basePoint.x, i.barY) }, t.append(new n(u))), t.append(new r(c, this))));
        return t
    }, o.prototype.getTemplate = function(t, e) { var i = t; return e.stack && (i += "_stack:" + e.stack), this.templatesCache[i] || (this.templatesCache[i] = this.createTemplate(this.getStyle(t, e))), this.templatesCache[i] }, o.prototype.createTemplate = function(t) {
        var e = document.createElement("canvas"),
            i = e.getContext("2d"),
            o = new a.Point(t.lollipop.width / 2, t.lollipop.height - t.lollipop.circleHeight - (t.lollipop.incHeight || 0));
        return this.drawCircle(i, t, o), this.drawLabel(i, t, o), e
    }, o.prototype.drawCircle = function(t, e, i) { t.strokeStyle = e.strokeStyle, t.fillStyle = e.lollipop.fillStyle, t.lineWidth = e.lollipop.lineWidth, CanvasEx.setLineStyle(t, CanvasEx.LINESTYLE_SOLID), t.beginPath(), t.arc(i.x, i.y, e.lollipop.radius, 0, 2 * Math.PI, !1), t.closePath(), t.stroke(), e.lollipop.fillCircle && t.fill() }, o.prototype.drawLabel = function(t, e, i) { t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = e.lollipop.text.strokeStyle, t.font = e.lollipop.text.font, t.fillText(e.lollipop.text.label, i.x, i.y) }, o.prototype._lollipopMouseClickHandler = function(t) { this._lastClickedId = this._lastClickedId === t ? null : t }, n.prototype.draw = function(t) { t.strokeStyle = this.data.style.strokeStyle, t.lineWidth = this.data.style.lineWidth, CanvasEx.setLineStyle(t, this.data.style.lineStyle), CanvasEx.drawLine(t, this.data.startPoint.x, this.data.startPoint.y, this.data.endPoint.x, this.data.endPoint.y) }, n.prototype.hitTest = function(t) { return null }, s.prototype.hitTest = function(t) { return a.isInCircle(this.data.circlePoint, this.data.style.lollipop.radius, t) ? this._hittest : null }, s.prototype.draw = function(t) {
        var e = this.data.template;
        t.drawImage(e, this.data.basePoint.x - (.5 + this.data.style.lollipop.width / 2 << 0) + .5, this.data.basePoint.y - this.data.style.lollipop.height + .5)
    }, r.prototype.draw = function(t) {
        this._data.createText(this._data, this.textRenderer), this._paneView.getLastClickedLollipopId() === this._data.id ? this._data.tooltip.show({
            items: [this.textRenderer],
            x: this._data.basePoint.x,
            y: this._data.basePoint.y - this._data.style.lollipop.circleHeight - 10 - 2 * this._data.style.lollipop.radius * (this._data.stack ? this._data.stack : 0),
            wrapElement: t.canvas.parentNode,
            leftBorderColor: this._data.color
        }) : this._data.tooltip.hide()
    }, r.prototype.hitTest = function(t) { return null }, r.TextRenderer = function(t) { this.lines = [], this.fontHeight = 12, this.font = this.fontHeight + "px Arial, sans-serif", this.lineSpacing = 8, this.fillStyle = "black", t && (this.importance = t) }, r.TextRenderer.prototype.draw = function(t, e) { var i, o, n = e.y; for (i = 0; i < this.lines.length; i++) o = this.lines[i], t.font = this.font, o.options.fontWeight && (t.font = o.options.fontWeight + " " + this.font), t.fillStyle = this.fillStyle, o.renderer(t, o.line, { x: e.x, y: n }), n += this.lineSpacing + this.fontHeight }, r.TextRenderer.prototype.measure = function() { return this.lines.length * (this.fontHeight + this.lineSpacing) - this.lineSpacing }, r.TextRenderer.prototype.basicRenderer = function(t, e, i) { t.fillText(e, i.x, i.y) }, r.TextRenderer.prototype.addMulticolorTextLine = function(t, e) { this.addTextLine(t, e, this.multicolorRenderer) }, r.TextRenderer.prototype.addTextLine = function(t, e, i) { i || (i = this.basicRenderer), e || (e = {}), this.lines.push({ line: t, renderer: i, options: e }) }, r.TextRenderer.prototype.multicolorRenderer = function(t, e, i) { var o, n, s = i.x; for (o = 0; o < e.length; ++o) n = e[o], t.fillStyle = n.color, t.fillText(n.text, s, i.y), s += t.measureText(n.text).width }, e.ESDPaneView = o
}, function(t, e, i) {
    "use strict";

    function o(t) { this._data = t }

    function n(t) { this._series = t, this._invalidated = !0 }
    var s = i(2),
        r = i(6),
        a = i(162).DateFormatter,
        l = i(122).TimeFormatter;
    o.prototype.hittest = function() {}, o.prototype.draw = function(t) {
            var e, i, o, n, s, r, a, l, h, c, d = 5,
                p = 12,
                u = 5,
                _ = 8,
                f = 13,
                m = 0;
            t.save(), t.setFont(f + "px Arial"), o = $.t("Last available bar"), this._data.eod ? m = t.measureText(o).width : (e = t.measureText(this._data.dateString || "").width, i = t.measureText(this._data.timeString || "").width, m = Math.max(e, i)), n = this._data.timeString ? 2 : 1, t.fillStyle = this._data.eod ? "#FF4040" : "#58A3CD", t.translate(this._data.point.x + .5, this._data.point.y + .5), s = Math.round(-m / 2) - _, r = -(f + d) * n - d - p - u, a = Math.round(s + m + 2 * _), l = -p - u, t.beginPath(), t.moveTo(s, r), t.lineTo(a, r), t.lineTo(a, l), t.lineTo(p, l), t.lineTo(0, l + p), t.lineTo(-p, l), t.lineTo(s, l), t.fill(), t.fillStyle = "#FFFFFF", t.textBaseline = "top", this._data.eod ? t.fillText(o, s + _, r + d) : (h = s + _ + (m - e) / 2, t.fillText(this._data.dateString, h, r + d), this._data.timeString && (c = s + _ + (m - i) / 2, t.fillText(this._data.timeString, c, r + 2 * d + f))), t.restore()
        }, n.prototype.update = function() { this._invalidated = !0 }, n.prototype.updateImpl = function() {
            var t, e, i, o, n, r;
            delete this._point, delete this._dateString, delete this._timeString, delete this._eod, void 0 !== (t = this._series.gotoDateResult()) && (e = t.index, (i = this._series.bars().valueAt(e)) && (o = this._series.priceScale().priceToCoordinate(i[TradingView.HIGH_PLOT]), n = this._series.model().timeScale().indexToCoordinate(e), this._point = new s.Point(n, o), t.eod ? this._eod = !0 : (r = this._series.model().timeScale().indexToUserTime(e), this._dateString = (new a).format(r), this._series.isDWM() || (this._timeString = (new l).format(r)))))
        },
        n.prototype.renderer = function() { return this._invalidated && (this.updateImpl(), this._invalidated = !1), this._point ? new o({ point: this._point, dateString: this._dateString, timeString: this._timeString, eod: this._eod }) : new r }, t.exports = n
}, 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 = {}; 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) {
        this._constructor = "LineToolArrow";
        var i = e || new s("linetoolarrow");
        n.call(this, t, i)
    }
    var n = i(11).LineToolTrendLine,
        s = i(7).DefaultProperty;
    inherit(o, n), o.prototype.title = function() { return "Arrow" }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e) {
        this._constructor = "LineToolExtended";
        var i = e || new s("linetoolextended");
        n.call(this, t, i)
    }
    var n = i(11).LineToolTrendLine,
        s = i(7).DefaultProperty;
    inherit(o, n), o.prototype.title = function() { return "Extended Line" }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e) {
        this._constructor = "LineToolFlagMark";
        var i = e || new a("linetoolflagmark");
        s.call(this, t, new r(this, t, this.image, 25, 25, -8, -21), i), this._paneViews[0].setAnchors(new n.Point(0, 0))
    }
    var n = i(2),
        s = i(1).LineDataSource,
        r = i(342),
        a = i(7).DefaultProperty;
    inherit(o, s), o.prototype.image = new Image,
        o.prototype.image.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAsElEQVR4AWMYWcDExOS/YUd4hWF7+H90bNAePpO2liDwJTxyi2htyVXLvlBOWlry2bAtVIumwWXQERFF4zgJ20iPiP8JDCpLeqSuJ6ZdoRJ0SMIRx7QbQtmItgSXnGFbRCzMEnIzK8ISWgL6WzJqibGxsYaFhYUC7SxBWMQPNMjazMxMjebBZWhoKAq00NHc3FyL5nFiaWkpDTTYz8jISI/mEW9qaqoExGFgS+gFRgEAaE0hWxrw50oAAAAASUVORK5CYII=", o.prototype.pointsCount = function() { return 1 }, o.prototype.title = function() { return "Flag Mark" }, o.prototype.version = 2, o.prototype.migrateVersion = function(t) { 1 === t && (this.version = 1, this._paneViews[0]._offsetX = 0, this._paneViews[0]._offsetY = 0, this._paneViews[0].setAnchors(new n.Point(9, 21))) }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e) {
        var i = e || this.createPropertiesObject("linetoolinsidepitchfork");
        s.call(this, t, i), this._constructor = "LineToolInsidePitchfork"
    }
    var n = i(23),
        s = i(52).LineToolPitchfork;
    inherit(o, s), o.prototype.title = function() { return $.t("Inside Pitchfork") }, o.prototype.createPropertiesObject = function(t, e, i) { return new n(t, e, i, { range: [0, 8] }) }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e) {
        this._constructor = "LineToolRay";
        var i = e || new s("linetoolray");
        n.call(this, t, i)
    }
    var n = i(11).LineToolTrendLine,
        s = i(7).DefaultProperty;
    inherit(o, n), o.prototype.title = function() { return "Ray" }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e) {
        var i = e || this.createPropertiesObject("linetoolschiffpitchfork");
        s.call(this, t, i), this._constructor = "LineToolSchiffPitchfork"
    }
    var n = i(23),
        s = i(52).LineToolPitchfork;
    inherit(o, s), o.prototype.title = function() { return $.t("Modified Schiff Pitchfork") }, o.prototype.createPropertiesObject = function(t, e, i) { return new n(t, e, i, { range: [0, 8] }) }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e) {
        var i = e || this.createPropertiesObject("linetoolschiffpitchfork2");
        s.call(this, t, i), this._constructor = "LineToolSchiffPitchfork2"
    }
    var n = i(23),
        s = i(52).LineToolPitchfork;
    inherit(o, s), o.prototype.title = function() { return $.t("Schiff Pitchfork") }, o.prototype.createPropertiesObject = function(t, e, i) { return new n(t, e, i, { range: [0, 8] }) }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o() {}
    var n = i(2);
    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, i) { this._magnetProperty = t, this._timeScale = e }
    var n = i(43);
    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) {
        "use strict";

        function o(t, e) { n.call(this, t, e) }
        var n = i(347);
        inherit(o, n), o.prototype.lastPrice = function() { return this._series.data().lastProjectionPrice }, o.prototype._updateImpl = function(t) {
            var i, o, n, s, r, a, l, h, c, d, p, u = this._rendererData;
            u.visible = !1, u.text = "", this._model.properties().scalesProperties.showSeriesLastValue.value() && (this._model.timeScale().isEmpty() || this._series.priceScale().isEmpty() || !this.lastPrice() || (t = this._model.timeScale().visibleBars(), t.isEmpty() || void 0 !== (i = this._series.data().search(t.lastBar(), TradingView.SEARCH_NEAREST_LEFT)) && (u.visible = !0, o = this._series.nearestIndex(t.firstBar(), TradingView.SEARCH_NEAREST_RIGHT), n = this._series.data().valueAt(o)[TradingView.CLOSE_PLOT], s = this.lastPrice(), this._series.priceScale().properties().percentage.value() && (s = 100 * (s - n) / n), u.text = this._series.priceScale().formatter().format(s), r = this._series.properties().style.value() === TradingView.Series.STYLE_HEIKEN_ASHI, r ? this._series.properties().haStyle.showRealLastPrice.value() ? (a = this._series.lastValueData(TradingView.CLOSE_PLOT, !0), a.noData || a.color === this._background || (this._background = a.color), e.enabled("countdown") && this._series.properties().showCountdown.value() ? u.secondLine = this._countdownInfo() : u.secondLine = null, l = this._series.lastValueData(TradingView.CLOSE_PLOT, !1).index, h = a.index, c = l === h, u.visible = c) : u.visible = !1 : (d = this._series.barColorer(), p = d.barStyle(i.index, !0), this._background = p.barColor), this._background !== u.background && (u.background = this._background, u.color = this.color()), u.coordinate = this._series.priceScale().priceToCoordinate(s))))
        }, t.exports = o
    }).call(e, i(3))
}, function(t, e) { t.exports = { STATUS_OFFLINE: 0, STATUS_RESOLVING: 1, STATUS_LOADING: 2, STATUS_READY: 3, STATUS_INVALID_SYMBOL: 4, STATUS_SNAPSHOT: 5, STATUS_EOD: 6, STATUS_PULSE: 7, STATUS_DELAYED: 8, STATUS_DELAYED_STREAMING: 9, STATUS_NO_BARS: 10 } }, function(t, e, i) {
    "use strict";

    function o(t, e) { c.call(this), this._series = t, this._model = e, this._items.push(new d($.t("O", { context: "in_legend" }), "")), this._items.push(new d($.t("H", { context: "in_legend" }), "")), this._items.push(new d($.t("L", { context: "in_legend" }), "")), this._items.push(new d($.t("C", { context: "in_legend" }), "")), this._invalidated = !0, this.update() }
    var n = i(37),
        s = n.parseRgb,
        r = n.distanceRgb,
        a = n.invertRgb,
        l = n.rgbToHexString,
        h = i(146),
        c = h.DataWindowView,
        d = h.DataWindowItem,
        p = i(164).translatedIntervalString;
    inherit(o, c), o.prototype.update = function() { this._invalidated = !0 }, o.prototype._updateImpl = function() {
        var t, e, i, o, n, h, c, d, u, _, f, m, g;
        if (this._series.symbolInfo() ? (this._header = [this._series.symbolInfo().name, p(this._series.interval()), this._series.symbolInfo().exchange].join(", "), this._title = this._series.symbolInfo().description) : this._header = this._series.symbol(), this._items[0].setValue($.t("n/a")), this._items[1].setValue($.t("n/a")), this._items[2].setValue($.t("n/a")), this._items[3].setValue($.t("n/a")), !this._model.timeScale().isEmpty() && 0 !== this._series.bars().size() && (t = this._series.data().size() - 1, e = this._model.crossHairSource().appliedIndex(), void 0 !== (i = isNumber(e) ? this._series.nearestIndex(e, TradingView.SEARCH_NEAREST_LEFT) : this._series.nearestIndex(t, TradingView.SEARCH_NEAREST_LEFT))))
            for (o = this._series.data().valueAt(i), n = this._series.formatter(), this._items[0].setValue(n.format(o[TradingView.OPEN_PLOT])), this._items[1].setValue(n.format(o[TradingView.HIGH_PLOT])), this._items[2].setValue(n.format(o[TradingView.LOW_PLOT])), this._items[3].setValue(n.format(o[TradingView.CLOSE_PLOT])), h = this._series.barColorer(), c = h.barStyle(i, !1), d = null != c.barBorderColor ? c.barBorderColor : c.barColor, u = this._series.model().paneForSource(this._series), _ = u._properties.background.value(), f = s(d), m = s(_), r(f, m) < 70 && (d = l(a(f))), g = 0; g < 4; g++) this._items[g].setColor(d)
    }, o.prototype.items = function() { return this._invalidated && (this._updateImpl(), this._invalidated = !1), this._items }, o.prototype.dump = function() { return { header: this._header, items: this._items } }, o.prototype.additional = function() { if (this._series.dataPoweredBy) return "(Data Provided by " + this._series.dataPoweredBy + ")" }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e) { n.call(this, e), this._series = t, this._series.onRestarted().subscribe(this, o.prototype.invalidate), this._series.onSymbolResolved().subscribe(this, o.prototype.invalidate), this._series.onCompleted().subscribe(this, o.prototype.invalidate), this._series.onBoxSizeChanged().subscribe(this, o.prototype.invalidate) }
    var n = i(348);
    inherit(o, n), o.prototype.invalidate = function() { delete this._text, this.update() }, o.prototype.getSeriesPrecision = function() { var t = 4; return this._series._symbolInfo && this._series._symbolInfo.pricescale && (t = Math.round(Math.log(this._series._symbolInfo.pricescale) / Math.log(10))), t }, o.prototype.round = function(t) {
        var e = this.getSeriesPrecision(),
            i = Math.round(t * Math.pow(10, e)) / Math.pow(10, e);
        return i || ""
    }, o.prototype.update = function() {
        if (!("_text" in this)) {
            var t = this._series.symbolInfo() || {};
            this._bold = !1, this._size = this._props.mainSeriesProperties.statusViewStyle.fontSize.value() + "px", this._text = this._series.constructor.generateTitleForGui({
                description: this._props.mainSeriesProperties.statusViewStyle.showSymbolAsDescription.value() ? t.name : t.description,
                exchange: this._props.mainSeriesProperties.statusViewStyle.showExchange.value() ? t.exchange : null,
                symbol: this._series.symbol(),
                interval: this._props.mainSeriesProperties.statusViewStyle.showInterval.value() ? this._series.interval() : null,
                style: this._series._properties.style.value(),
                inputs: this._series.getInputsProperties().state(),
                boxSize: this._series.data().boxSize,
                reversalAmount: this._series.data().reversalAmount,
                precision: this.getSeriesPrecision()
            })
        }
    }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t, e) { this._data = t, this._colors = this.getBackgroundColor(e) }

    function n(t, e, i) { this._series = t, this._lastBar = e, this._direction = i }
    i(282), i(12).getLogger("Chart.Snapshot");
    o.prototype.hitTest = function() { return null }, o.prototype.getBackgroundColor = function(t) { return [{ background: "rgba(255, 158, 171, 0.3)", line: "#7E202F" }, { background: "rgba(244, 255, 158, 0.3)", line: "#EBFF3F" }, { background: "rgba(195, 255, 160, 0.3)", line: "#308020" }][t + 1] }, o.prototype.draw = function(t) {
        t.fillStyle = this._colors.background, t.fillRect(Math.max(0, this._data.x), 0, this._data.width, this._data.height), t.strokeStyle = this._colors.line, t.beginPath(), t.lineWidth = 1;
        var e = Math.round(this._data.x);
        t.moveTo(e, 0), t.lineTo(e, this._data.height), t.stroke()
    }, n.prototype.update = function() { this._x = this._series.m_model.timeScale().indexToCoordinate(this._lastBar) + .5 * this._series.m_model.timeScale().barSpacing() + 1 }, n.prototype.renderer = function() {
        var t = { x: this._x, height: this._series.priceScale().height(), width: this._series.m_model.timeScale().width() },
            e = this._series.data().bars(),
            i = e.last().value[TradingView.CLOSE_PLOT] > e.valueAt(this._lastBar)[TradingView.CLOSE_PLOT] ? 1 : -1,
            n = 0;
        return 1 === this._direction ? n = i : 2 === this._direction && (n = -1 * i), new o(t, n)
    }, e.FutureBarsPaneView = n
}, 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(2),
        a = i(16).TextRenderer,
        l = i(89).HorzLineRenderer,
        h = i(11).TrendLineRenderer,
        c = i(66),
        d = i(67),
        p = i(92),
        u = TradingView.Study,
        _ = i(694),
        f = i(8),
        m = i(6),
        g = i(120).clearRect,
        v = i(14),
        y = i(12).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], 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], 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() { 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) {
            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(), t.restore())
        }, 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(), t.restore()
            }
        }, 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)), 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(), 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, 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, 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),
                D = null,
                O = null,
                $ = null,
                V = {},
                B = i(31).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 == O && (O = this._findActualRateLength(u.rate)),
                    null == D && (_ = Math.abs(n.indexToCoordinate(s[u.firstBarTime]) - n.indexToCoordinate(s[u.lastBarTime])), D = e.percentWidth.value() * _ / 100, D -= O, D = Math.max(D, 0)), f = !1, y = 0; y < O; y++)
                    if (0 !== u.rate[y]) {
                        if (void 0 === V[y] ? V[y] = u.rate[y] : V[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 * (D * u.rate[y - 1] / M + O), w.x2 = w.x1 + h * (D * 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), $ || ($ = .6 * (w.y2 - w.y1)), !f && e.showValues.value() && $ >= 7.5) {
                            for (f = !0, C = {}, x = this._study.formatter(), C.text = "", P = 0; P < O; P++) C.text = R(C.text, x.format(u.rate[P]), T), P !== O - 1 && (C.text = R(C.text, "x", T));
                            if (C.color = e.valuesColor.value(), C.font = "arial", C.fontsize = $, 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: $, horzAlign: d, vertAlign: "middle", points: [new r.Point(k, I)], offsetX: 0, offsetY: 0 }, P = 0; P < O; P++) A.text = R(A.text, x.format(V[P]), T), P !== O - 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) { n.call(this, t, e, i) }
    var n = i(104);
    inherit(o, n), o.prototype._mtpStudyId = function() { return "mtp_tsanalysis" },
        o.prototype.pointsCount = function() { return 1 }, o.prototype._studyInputs = function() { var t, e, i = this.points(); return i.length < this.pointsCount() ? null : (t = i[0].index, e = this._model.mainSeries().bars().valueAt(t), 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(104);
    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, e, i = this.points(); return i.length < this.pointsCount() ? null : (t = i[0].index, e = this._model.mainSeries().bars().valueAt(t), 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(104);
    inherit(o, n), o.prototype._mtpStudyId = function() { return "mtp_riskreward" }, 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, e, i, o, n, s, r = this.points(); return r.length < this.pointsCount() ? null : (t = r[0].index, e = r[1].index, i = r[2].index, o = this._model.mainSeries().bars().valueAt(t), n = this._model.mainSeries().bars().valueAt(e), s = this._model.mainSeries().bars().valueAt(i), o && n && s ? [1e3 * o[TradingView.TIME_PLOT], 1e3 * n[TradingView.TIME_PLOT], 1e3 * s[TradingView.TIME_PLOT], r[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, o) { n.call(this, t, e, i, o) }
    var n = i(31).Study,
        s = i(86),
        r = i(44).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);
        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) {
    (function(e) {
        "use strict";

        function i() { this._marksByIndex = {}, this._marksBySpan = [], this.changed = new e }
        i.prototype.reset = function() { this._marksByIndex = {}, this._marksBySpan = [], delete this.minIndex, delete this.maxIndex, delete this._cache, this.changed.fire() }, i.prototype.minIndex = void 0, i.prototype.maxIndex = void 0, i.prototype.merge = function(t) {
            var e, i, o, n, s, r = this._marksBySpan,
                a = {};
            for (e = 0; e < t.length; e++) {
                if (i = t[e], o = i.index, n = i.span, s = this._marksByIndex[i.index]) {
                    if (s.index === i.index && s.span === i.span) { s.time = i.time; continue }
                    this._removeTickmark(s)
                }
                this._marksByIndex[o] = i, this.minIndex <= o || (this.minIndex = o), this.maxIndex >= o || (this.maxIndex = o), r[n] || (r[n] = []), r[n].push(i), a[n] = !0
            }
            for (n = r.length; n--;) r[n] && (r[n].length || delete r[n], a[n] && r[n].sort(this._sortByIndexAsc));
            delete this._cache, this.changed.fire()
        }, i.prototype._removeTickmark = function(t) {
            var e, i, o = t.index;
            this._marksByIndex[o] === t && (delete this._marksByIndex[o], o <= this.minIndex && this.minIndex++, o >= this.maxIndex && this.maxIndex--, this.maxIndex < this.minIndex && (delete this.minIndex, delete this.maxIndex), e = this._marksBySpan[t.span], -1 !== (i = e.indexOf(t)) && e.splice(i, 1))
        }, i.prototype._sortByIndexAsc = function(t, e) { return t.index - e.index }, i.prototype.removeTail = function(t) {
            var e, i = {};
            this.maxIndex = 0;
            for (e in this._marksByIndex) this._marksByIndex[e].time < t && (i[e] = this._marksByIndex[e], this.maxIndex = Math.max(this.maxIndex, e));
            this._marksByIndex = i
        }, i.prototype.addTail = function(t) {
            for (var e = 0; e < t.length; e++) t[e].index = this.maxIndex + e + 1;
            this.merge(t)
        }, i.prototype.indexToTime = function(t) { var e = this._marksByIndex[t]; return e ? new Date(1e3 * e.time) : null }, i.prototype.density = function() {
            var t, e = this.maxIndex - this.minIndex;
            if (0 !== e) return t = this._marksByIndex[this.maxIndex].time - this._marksByIndex[this.minIndex].time, 1e3 * t / e
        }, i.prototype.estimateLeft = function(t) { var e, i = this.density(); if (i) return e = 1e3 * this._marksByIndex[this.minIndex].time - t, e / i }, i.prototype.nearestIndex = function(t) {
            for (var e, i = this.minIndex, o = this.maxIndex; o - i > 2;) {
                if (1e3 * this._marksByIndex[i].time === t) return i;
                if (1e3 * this._marksByIndex[o].time === t) return o;
                e = Math.round((i + o) / 2), 1e3 * this._marksByIndex[e].time > t ? o = e : i = e
            }
            return i
        }, i.prototype.build = function(t, e) {
            var i, o, n, s, r, a, l, h, c, d, p, u, _, f, m = Math.ceil(e / t);
            if (this._maxbar === m && this._cache) return this._cache;
            for (this._maxbar = m, i = [], o = this._marksBySpan.length; o--;)
                if (this._marksBySpan[o]) {
                    for (n = i, i = [], s = n.length, r = 0, a = this._marksBySpan[o], l = a.length, h = 1 / 0, c = -1 / 0, d = 0; d < l; d++) {
                        for (p = a[d], u = p.index; r < s;) {
                            if (_ = n[r], !((f = _.index) < u)) { h = f; break }
                            r++, i.push(_), c = f, h = 1 / 0
                        }
                        h - u >= m && u - c >= m && (i.push(p), c = u)
                    }
                    for (; r < s; r++) i.push(n[r])
                }
            return this._cache = i, this._cache
        }, i.prototype.state = function() { var t, e = []; for (t = this._marksBySpan.length; t--;) this._marksBySpan[t] && (e = e.concat(this._marksBySpan[t])); return e = e.map(function(t) { return [t.span, t.time, t.index] }), { marks: e, version: 2 } }, i.prototype.restoreState = function(t) {
            if (this._marksByIndex = {}, this._marksBySpan = [], delete this.maxIndex, delete this.minIndex, t && t.marks && t.marks.length)
                if (2 === t.version) {
                    var e = t.marks.map(function(t) { return { span: t[0], time: t[1], index: t[2] } });
                    this.merge(e)
                } else this.merge(t.marks)
        }, t.exports = i
    }).call(e, i(15))
}, 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(2),
            a = i(304),
            l = i(305),
            h = i(706),
            c = i(21),
            d = i(7).saveDefaultProperties,
            p = i(27).numberToStringWithLeadingZero,
            u = i(584),
            _ = i(221),
            f = i(12).getLogger("Chart.TimeScale"),
            m = i(3),
            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.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(); return e < _.MINUTE_SPAN && !i ? p(t.getUTCHours(), 2) + ":" + p(t.getUTCMinutes(), 2) + ":" + p(t.getUTCSeconds(), 2) : e < _.DAY_SPAN && !i ? p(t.getUTCHours(), 2) + ":" + p(t.getUTCMinutes(), 2) : e < _.WEEK_SPAN ? t.getUTCDate() : e < _.MONTH_SPAN ? t.getUTCDate() : e < _.YEAR_SPAN ? (g || (g = n()), g[t.getUTCMonth()]) : t.getUTCFullYear() }, s.prototype.normalizeBarIndex = function(t) {
            var e = 0,
                i = 0;
            return t < this.m_points.firstTimePointIndex() ? (e = this.m_points.valueAt(this.m_points.firstTimePointIndex()), i = t - this.m_points.firstTimePointIndex()) : t > this.m_points.lastTimePointIndex() ? (e = this.m_points.valueAt(this.m_points.lastTimePointIndex()), i = t - this.m_points.lastTimePointIndex()) : (e = this.m_points.valueAt(t), i = 0), { time_t: e, offset: i }
        }, s.prototype.denormalizeTimePoint = function(t) {
            var e = this.m_points.indexOf(t.time_t);
            if (void 0 !== e) return e + t.offset
        }, s.prototype.zoomToBarsRange = function(t, e) {
            if (!(e <= t)) {
                var i = this.m_points.lastTimePointIndex();
                i && (this.m_rightOffset = e - i), this.m_barSpacing = this.width() / (e - t + 1), this._visibleBarsCache = null
            }
        }, s.prototype.recalcLockedScale = function() {
            var t, e, i, n, s, r, a, l;
            this._model.m_mainSeries.properties().lockScale.value() && !this.isEmpty() && (t = this._model.m_mainSeries.priceScale(), e = this._model.m_mainSeries, i = e.data().boxSize, i || (e.fixBoxSize(), i = e.data().boxSize), i && (t.properties().percentage.value() && (n = e.data().search(e.getRealVisibleRange().m_firstBar).value[TradingView.CLOSE_PLOT], i = o.prototype.convertToPercent.call(null, n + i, n) - o.prototype.convertToPercent.call(null, n, n)), s = t.internalHeight() / (this.barSpacing() / i), (r = e.priceScale().priceRange()) && s === r.length() || (!r || r.isEmpty() ? (a = this.visibleBars(), r = e.priceRange(a.firstBar(), a.lastBar())) : (l = (s - r.length()) / 2, r.set(r.minValue() - l, r.maxValue() + l)), e.priceScale().setPriceRange(r))))
        }, s.prototype.correctBarSpacing = function() { this.isEmpty() || this.points().size() < this.width() / this.barSpacing() && (this.setOffset(_.DEFAULT_RIGHT_OFFSET), this.setBarSpacing(Math.min(this.width() / (this.points().size() + this.rightOffset()), v))) }, s.prototype.canZoomIn = function() { return this.m_barSpacing < v }, s.prototype.canZoomOut = function() { return this.m_barSpacing > y }, s.prototype.onScroll = function() { return this._onScroll }, t.exports = s
    }).call(e, i(15), i(107))
}, function(t, e, i) {
    "use strict";

    function o(t) {
        r.call(this, t);
        var e = this;
        l.hideMarksOnBars().subscribe(this, function() { e._properties.visible.setValue(!l.hideMarksOnBars().value()) })
    }

    function n(t) { a.call(this) }
    var s = i(102),
        r = s.BarsMarksContainer,
        a = s.BarMarkTooltip,
        l = i(42);
    inherit(o, r), o.prototype._initialize = function(t) { this._properties.visible.setValue(!0) }, o.prototype.userEditEnabled = function() { return !1 }, o.prototype._constructor = "UserDefinedBarsMarks", o.prototype._plateViewData = function(t) { var e = { text: t.text }; return "object" == typeof t.color && (e.theme = "user_defined_theme", e.overridedTheme = {}, e.overridedTheme.border = t.color.border, e.overridedTheme.background = t.color.background), e }, o.prototype.onClicked = function() {
        var t = this._model.lastHittestData().id;
        this._marks[t].onClicked()
    }, o.prototype.clearMarks = function() { r.prototype.clearMarks.call(this), this.onNeedRepaint.fire() }, o.prototype._getData = function(t) {
        var e, i, o, n = this._model.mainSeries().symbolInfo();
        n && (e = this.roundRange(this._rangeDifference(t)), i = this, o = this._model.mainSeries().properties().interval.value(), ChartApiInstance.getMarks(n, e.start, e.end, function(e) { e.forEach(function(t) { i._marks[t.id] = t }, i), i._loadedRange = i._rangeUnion(t, i._loadedRange), i.onNeedRepaint.fire() }, o))
    }, o.prototype._createTooltip = function() { return new n }, o.prototype.updatePlateData = function(t, e) { return e.barWidth = this.barWidth(), e.text = t.text, e.tooltipMargin = -1 * Math.max(t.minSize / 2, .4 * this.barWidth()), e }, o.prototype.hasContextMenu = function() { return !1 }, inherit(n, a), n.prototype._createLayout = function() {
        this._layout = $('<div class="bar-mark-tooltip"></div>'),
            this._layout_text = $('<div class="text"></div>').appendTo(this._layout)
    }, n.prototype._updatePlate = function(t) { this._currentId = t.id, this._layout.css("border-color", t.theme.border), this._layout.css("margin-top", t.tooltipMargin + "px"), this._layout_text.html(t.text), this._layout.append(this._layout_text) }, t.exports = o
}, function(t, e, i) {
    "use strict";

    function o(t) {
        a.call(this, t);
        var e = this;
        l.hideMarksOnBars().subscribe(this, function() { e._properties.visible.setValue(!l.hideMarksOnBars().value()) }), this._paneView = new n(this)
    }

    function n(t, e) { this.source = t, this._rendererFactory = e, this.stylesCache = {}, this.templatesCache = {}, this._lollipops = {}, this._createLollipops() }
    var s = i(2),
        r = i(684).ESDPaneView,
        a = i(102).BarsMarksContainer,
        l = i(42),
        h = i(34),
        c = i(260).Tooltip;
    inherit(o, a), o.prototype._initialize = function(t) { this._properties.visible.setValue(!0) }, o.prototype.userEditEnabled = function() { return !1 }, o.prototype._constructor = "UserDefinedTimescaleMarks", o.prototype._plateViewData = function(t) { return { text: t.text } }, o.prototype.onClicked = function() {
        var t = this._model.lastHittestData().id;
        h.emit("onTimescaleMarkClick", t)
    }, o.prototype.clearMarks = function() { a.prototype.clearMarks.call(this), this.onNeedRepaint.fire() }, o.prototype._getData = function(t) {
        var e, i, o, n = this._model.mainSeries().symbolInfo();
        n && (e = this.roundRange(this._rangeDifference(t)), i = this, o = this._model.mainSeries().properties().interval.value(), ChartApiInstance.getTimescaleMarks(n, e.start, e.end, function(e) { e.forEach(function(t) { i._marks[t.id] = t }, i), i._loadedRange = i._rangeUnion(t, i._loadedRange), i.onNeedRepaint.fire() }, o))
    }, o.prototype.updatePlateData = function(t, e) { return e.barWidth = this.barWidth(), e.text = t.text, e.tooltipMargin = -1 * Math.max(t.minSize / 2, .4 * this.barWidth()), e }, o.prototype.hasContextMenu = function() { return !1 }, o.prototype.paneViews = function(t) { return this._properties.visible.value() ? [this._paneView] : [] }, o.prototype.onClickOutside = function(t) { this._paneView.onClickOutside(t) }, inherit(n, r), n.prototype._createLollipops = function() {
        var t = this.source._model.timeScale(),
            e = r.prototype._getY.call(this.source),
            i = this.source._model.lastHittestData(),
            o = this;
        $.each(this.source._marks, function(n, r) {
            var a = r.id;
            o._lollipops[a] = { id: a, basePoint: new s.Point(t.indexToCoordinate(t.timePointToIndex(r.tickmark)) + 1, e), hovered: i && i.id === a || a === o.getLastClickedLollipopId(), barY: null, label: r.label, color: r.color, items: r.tooltip, tooltip: o._lollipops.hasOwnProperty(a) ? o._lollipops[a].tooltip : new c, visible: !0 }
        })
    }, n.prototype.update = function() { this._createLollipops() }, n.prototype.renderer = function() { return this.update(), r.prototype.renderer.call(this) }, n.prototype._generateTemplateStyle = function(t, e, i) {
        var o, n, s = t + e + i;
        return s in this.stylesCache || (o = { strokeStyle: e, lineWidth: 1, fillStyle: "white", barLine: { lineStyle: CanvasEx.LINESTYLE_DASHED }, lollipop: { width: 32, height: 96, circleHeight: 16, radius: 12, lineWidth: 1.5, fillStyle: "white", strokeStyle: "#E2745B", text: { label: i, strokeStyle: e, font: "normal 12px Verdana, Arial, sans-serif" } } }, n = { strokeStyle: e, lollipop: { fillStyle: e, fillCircle: !0, text: { strokeStyle: "white" } } },
            this.stylesCache[s] = "default" === t ? o : $.extend(!0, {}, o, n)), this.stylesCache[s]
    }, n.prototype.getTemplate = function(t, e) { var i = t + e.color + e.label; return i in this.templatesCache || (this.templatesCache[i] = this.createTemplate(this._generateTemplateStyle(t, e.color, e.label))), this.templatesCache[i] }, n.prototype.getStyle = function(t, e) { return this._generateTemplateStyle(t, e.color, e.label) }, n.prototype.createText = function(t, e) { "string" == typeof t.items ? e.addTextLine(t.items) : Array.isArray(t.items) && t.items.forEach(function(t) { e.addTextLine(t) }) }, n.prototype.hasTooltip = function(t) { return !!t.tooltip && t.tooltip.length }, t.exports = o
}, 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(14),
            s = i(164).translatedIntervalString;
        t.exports = o
    }).call(e, i(3))
}, function(t, e, i) {
    "use strict";

    function o(t) { return t.keys().map(t) }
    window.TradingView = window.TradingView || {}, window.requireAll = o, i(720), i(589), i(593), i(565), i(284), i(592), i(591), i(287), i(35), i(585), i(117), i(571), i(216), i(357), i(712), i(69), i(713), i(214), i(358), i(362)
}, 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 && !!user.is_trial).toggleClass("is-not-trial", !(is_authenticated && user && user.is_trial)).toggleClass("is-not-trial-available", !user.trial_availiable).toggleClass("is-trial-available", !!user.trial_availiable), TVSettings.sync(user.settings), $(".js-header__gopro-button").attr("href", is_authenticated ? "/gopro/" : ""), is_authenticated ? ($(".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() {}), 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__(128).TVXWindowEvents,
            trackEvent = __webpack_require__(33).trackEvent;
        __webpack_require__(743), $(document).ajaxSend(function(t, e, i) { "POST" !== i.type || i.crossDomain || e.setRequestHeader("X-CSRFToken", $.cookie("csrftoken")), i.crossDomain && !i.forceLanguageHeader || (window.locale ? e.setRequestHeader("X-Language", window.locale) : console.warn("window.locale 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) { e || (e = {}), e.verifiedPhoneRequired, (is_authenticated || Featuresets.enabled("charting_library_base")) && t() },
            TradingView.runOrGoPro = function(t, e, i) { Featuresets.enabled(e) && t() }, window.onLoginStateChange = onLoginStateChange, TradingView.isPro = function() { return is_authenticated && user.is_pro }, 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;
                    t.toggleClass("i-hidden", !e), "A" !== this.tagName && (t = t.find("a")), t.attr("href", e ? "/u/" + user.username + "/#billing" : "")
                })
            })
    }).call(exports, __webpack_require__(15), __webpack_require__(130), __webpack_require__(3))
}, function(t, e, i) {
    (function(t, e, o) {
        "use strict";
        var n, s, r, a = i(2),
            l = i(138).createNoticeDialog;
        i(126), n = null, s = function(t) { n || (n = l({ type: "modal", title: t.title, content: t.content }).open(), n.on("beforeClose", function() { n = null })) }, r = window.TVDialogs = {
            modalDialog: null,
            dialogs: [],
            messageInterval: null,
            messageDelay: 4e3,
            NOTIFICATION_ANIMATION_START_OFFSET: "-33px",
            _constrainDraggableOptionsIfNeeded: function(e) { return t.enabled("constraint_dialogs_movement") && (e.containment = ".chart-page"), e },
            validateHelpers: {
                isErrorListening: function(t) { t.on("keyup.error-checker", r.validateHelpers.isError(t.val(), t)) },
                isError: function(t, e) { return function() { e.val() !== t && (e.removeClass("error"), e.off("keyup.error-checker")) } },
                makeValidator: function(t, e, i, o, n) {
                    return function(s) {
                        var a, l, h;
                        if (t.removeClass("error"), $("._tv-dialog-field-error").hide(), "" !== s.errors)
                            if ("object" == typeof s.errors) {
                                for (a in s.errors) l = t.filter("input[name^=" + a + "]"), l.addClass("error").data("error", s.errors[a][0]), r.validateHelpers.isErrorListening(l);
                                h = t.filter(".error").first().focus(), r.showError(h.data("error"), n)
                            } else r.showError($.t("Error:") + s.errors, n);
                        else "function" == typeof o && o(s, i);
                        e.removeClass("process")
                    }
                }
            },
            applyMQMatcher: function(t) {
                var e, i;
                t || (t = r.modalDialog), e = function() { r.positionDialog() }, window.matchMedia && (i = ["(max-height: 645px)", "(max-width: 460px)"].map(function(t) { var i = matchMedia(t); return i.addListener(e), i }), t.on("destroy", function() { i.forEach(function(t) { t.removeListener(e) }) }))
            },
            showBrowserExtensionDialog: function(t) { var o, n; if (t) return o = { chrome: { logo: "images/svg/google-chrome-logo.svg", name: "Google Chrome", href: "https://chrome.google.com/webstore/detail/tradingview-free-quotes-a/ommjfbdmijjlbhlhnnnfkmbnkpnjpipj" } }, n = i(160), r.createModalDialog("Browser Extension", { noHeader: !0, width: "730px", content: e.render(n.dialogs.browserExtension, { browser: o[t] }) }), r.modalDialog.find(".install-extension, ._tv-dialog-title-close").click(function(t) { r.destroy() }), r.positionDialog(), r.modalDialog },
            showIntervalMismatchDialog: function(t) {
                var e, i, o, n, s, a, l = !1;
                l = l || !1, r.createModalDialog($.t("Interval is not applicable"), { addClass: "tv-interval-is-not-applicable-dialog" }), e = r.modalDialog, e.css({ zIndex: 1e3 }), e.find("._tv-dialog").css("width", "400px"), i = r.modalDialog.find("._tv-dialog-content"),
                    i.html('<div class="main"><div class="caption-big">' + $.t("<p>Only <b>D, W, M</b> intervals are supported for this symbol/exchange. You will be automatically switched to a D interval. Intraday intervals are not available because of exchange policies.</p>") + '</div><div class="main-properties"></div></div>'), o = i.find(".main-properties"), n = $('<div class="dialog-buttons"></div>').appendTo(o), t && (s = $('<label class="dialog-trail-checkbox"><input type="checkbox" /> ' + $.t("Do not show this message again") + "</label>").appendTo(n), a = s.find("input"), a.attr("checked", t.silentIntervalChange.value()), a.bind("click", function() { t.silentIntervalChange.setValue(this.checked) })), $('<a class="_tv-button ok">OK</a>').appendTo(n).bind("click", function() { r.destroy() }), r.positionDialog(), r.applyHandlers(!1, { doNotCloseOnBgClickIfShadowbox: l })
            },
            showGoProDialog: function() {},
            showFXCMdataOffer: function(t, o) {
                function n() {
                    h.html(e.render(p.fxcmOfferDialog.stage1, {})), h.find("._tv-dialog-title-close").on("click", function() { r.destroy() }), h.find(".js-go-alternative").on("click", function(t) { r.destroy(), t.preventDefault() });
                    var i = h.find(".js-type-selector");
                    ["real", "demo"].forEach(function(t) { i.find("a." + t).toggleClass("active", t === d).on("click", function(e) { e.preventDefault(), d = t, i.find("a").removeClass("active"), $(e.target).addClass("active") }) }), h.find("form").on("submit", function(e) { e.preventDefault(), h.find(".js-connect").addClass("process"), t({ password: $(this).find('input[name="password"]').val(), login: $(this).find('input[name="login"]').val(), mode: d }).then(function(t) { h.find(".js-connect").removeClass("process"), t ? (c = !0, s({ okStatus: !0 })) : s({ okStatus: !1 }) }).catch(function() { s({ okStatus: !1 }) }) }), a()
                }

                function s(t) { h.html(e.render(p.fxcmOfferDialog.stage2, t)), h.find("._tv-dialog-title-close").on("click", function() { r.destroy() }), h.find(".js-try-again").on("click", function(t) { t.preventDefault(), n() }), h.find(".js-ok").on("click", function(t) { t.preventDefault(), r.destroy() }), a() }

                function a() { r.applyMQMatcher(l), r.positionDialog(), r.applyHandlers(null, { doNotCloseOnBgClick: !0, doNotCloseOnEsc: !0 }) }
                var l, h, c = !1,
                    d = "demo",
                    p = i(160);
                window.runOrSignIn(function() { l = r.createModalDialog($.t("FXCM CFD data is available only to FXCM account holders"), { addClass: "cme-offer-dialog" }), h = r.modalDialog.find("._tv-dialog-content"), $(l).on("destroy", function() { o(c) }), n() })
            },
            showSignInDialog: function(t, e) {},
            goRegistrate: function(t) {},
            makeDraggable: function(t) { t.draggable({ handle: "._tv-dialog-title" }) },
            showAlertTextNotesDialog: function() { s({ title: $.t("Oops!"), content: '<div class="tv-text">' + $.t('Text Notes are available only on chart page. Please <a href="/chart/">open a chart</a> and then try again.') + "</div>" }) },
            showNotice: function(t, i, o) {
                var n, s, a, l, h, c;
                return "object" == typeof i && (o = i, i = ""), o = o || {}, n = o.doNotCloseOnBgClick || !1, s = o.html || "", a = o.width || "400px", l = {}, l.noClose = o.noClose || null, l.addClass = o.modalDialogClass || null, r.createModalDialog(t, l), h = o.centerCaption ? "caption-big-center" : "caption-big", r.modalDialog.find("._tv-dialog").css("width", a),
                    c = o.customButtonCaption ? o.customButtonCaption : $.t("OK"), r.modalDialog.find("._tv-dialog-content").html(e.render('<div class="main"><div class="{{captionClassName}} {{classSuffix}}">{{text}}' + s + '</div>{{^removeOkButton}}<div class="buttons"><input type="button" class="_tv-button ok" value="' + c + '"/></div>{{/removeOkButton}}</div>', { captionClassName: h, classSuffix: o.classSuffix || "", text: i, removeOkButton: o && o.removeOkButton })), r.modalDialog.find("._tv-button.ok").on("click", function() { r.destroy(), o.onOkButtonClick && o.onOkButtonClick() }), r.positionDialog(), r.applyHandlers(!1, { doNotCloseOnBgClickIfShadowbox: n, beforeDestroy: o.onClose }), r.modalDialog
            },
            showConfirm: function(t, i, o, n, s) { var a, l; return s = s || {}, s.dontAskSetting && TVSettings.getBool(s.dontAskSetting) ? void o() : (a = r.createModalDialog(t, s), r.modalDialog.find("._tv-dialog").css("width", s.customWidth ? s.customWidth : "400px"), r.modalDialog.find("._tv-dialog-content").html(e.render('<div class="main"><div class="caption-big">{{{text}}}</div>{{#dontAskSetting}}<input type="checkbox" id="confirm-dialog-checkbox" style="margin: 0; vertical-align: middle;"> <label for="confirm-dialog-checkbox" style="font-size: 11px;">' + $.t("Do not ask again") + '</label>{{/dontAskSetting}}</div><div class="_tv-dialogs-bottom _tv-dialog-center"><input class="_tv-button wide ok" type="button" value="' + $.t("YES") + '" style="margin-right: 10px;"/><input class="_tv-button wide cancel" type="button" value="' + $.t("NO") + '"/></div>', { text: i, dontAskSetting: !!s.dontAskSetting })), s.okButtonText && r.modalDialog.find(".ok").val(s.okButtonText), s.cancelButtonText && r.modalDialog.find(".cancel").val(s.cancelButtonText), l = r.modalDialog.find(".ok"), l.click(function() { s.dontAskSetting && $("#confirm-dialog-checkbox").is(":checked") && TVSettings.setValue(s.dontAskSetting, !0), o(), s.manualClose || r.destroy() }), r.modalDialog.find(".cancel").click(function() { n && n(), s.manualCloseOnCancel || r.destroy() }), r.positionDialog(), r.applyHandlers(a, { processEnterButton: l }), a) },
            showPrompt: function(t, i, o, n, s) {
                function a() {
                    var t, e = c.val();
                    if (h && (t = h(e))) return !0 === t && (t = $.t("Wrong value")), void r.showError(t, r.modalDialog);
                    r.destroy(), o && o(e)
                }
                var l, h, c;
                s = s || {}, l = s && s.defaultValue, h = s && s.validate, r.createModalDialog(t, s), r.modalDialog.find("._tv-dialog").css("width", "400px"), r.modalDialog.find("._tv-dialog-content").html(e.render('<div class="main"><form><div class="caption-big-center slim">{{text}}: <input type="text" name="prompt-value" class="prompt-value"/></div></form></div><div class="_tv-dialogs-bottom _tv-dialog-{{bottomAlign}}"><input class="_tv-button wide ok" type="button" value="' + $.t("OK") + '" style="margin-right: 10px;"/><input class="_tv-button wide cancel" type="button" value="' + $.t("Cancel") + '"/></div>', { text: i, bottomAlign: s.bottomAlign ? s.bottomAlign : "center" })), c = r.modalDialog.find('[name="prompt-value"]'), l && c.val(l), r.modalDialog.find("form").submit(function(t) { a(), t.preventDefault() }), r.modalDialog.find(".ok").click(function(t) { a(), t.preventDefault() }), r.modalDialog.find(".cancel").click(function() { r.destroy(), n && n() }),
                    r.positionDialog(), r.applyHandlers(), setTimeout(function() { c.focus().select() }, 0)
            },
            showCustomDialog: function(t) {
                function e(e) {
                    var i = t.action(r.modalDialog),
                        o = i && !i.error,
                        n = void 0 === i,
                        s = i && i.notClose;
                    !o && !n || s ? i.error && r.showError(i.error) : r.destroy(), e.preventDefault()
                }

                function i(e) { "function" == typeof t.onCancel ? t.onCancel() : r.destroy() }
                return r.createModalDialog(t.title || $.t("Dialog"), { addClass: t.addClass || "" }), r.modalDialog.find("._tv-dialog").css("width", t.width || "400px"), r.modalDialog.find("._tv-dialog-content").html('<div class="main">' + (t.html || $.t("Content")) + "</div>" + (t.noButtons ? "" : '<div class="_tv-dialogs-bottom _tv-dialog-center">' + (t.noButtonOk ? "" : '<input class="_tv-button wide ok" type="button" value="' + $.t("OK") + '" style="margin-right: 10px;"/>') + (t.noButtonCancel ? "" : '<input class="_tv-button wide cancel" type="button" value="' + $.t("Cancel") + '"/>') + "</div>")), t.okButtonText && r.modalDialog.find(".ok").val(t.okButtonText), t.cancelButtonText && r.modalDialog.find(".cancel").val(t.cancelButtonText), r.modalDialog.find(".ok").click(e), r.modalDialog.find("form").submit(e), r.modalDialog.find(".cancel").click(i), r.modalDialog.find("._tv-dialog-title-close").click(i), r.positionDialog(), r.applyHandlers(), r.modalDialog
            },
            createModalDialog: function(t, e) { var i, o; return e = e || {}, null !== r.modalDialog && r.destroy(), r.modalDialog = $('<div class="_tv-dialog-shadowbox"><div class="_tv-dialog _tv-dialog-modal' + (e.addClass ? " " + e.addClass : "") + '">' + (e.noHeader ? "" : '<div class="_tv-dialog-title">' + (e.noClose ? "" : '<a class="_tv-dialog-title-close"></a>') + '<span class="_tv-dialog-title-text">' + t + "</span></div>") + '<div class="_tv-dialog-error"><span class="message"></span></div><div class="_tv-dialog-message"><span class="message"></span></div><div class="_tv-dialog-content"></div></div></div>').appendTo($("body")).data("title", t), r._addMessageCloseButton(r.modalDialog.find("._tv-dialog-error")), r._addMessageCloseButton(r.modalDialog.find("._tv-dialog-message")), e.noShadowBox && r.modalDialog.addClass("transparent"), e.addClass && r.modalDialog.addClass(e.addClass), e.width && r.modalDialog.find("._tv-dialog").css({ width: e.width }), e.content && r.modalDialog.find("._tv-dialog-content").html(e.content), i = $(".fancybox-overlay"), i.length && (o = i.css("z-index"), $("._tv-dialog-shadowbox").css("z-index", o + 1)), e.draggable && r.modalDialog.draggable(r._constrainDraggableOptionsIfNeeded({ handle: r.modalDialog.find("._tv-dialog-title") })), e.zIndex && r.modalDialog.css("z-index", e.zIndex), r.modalDialog },
            _addMessageCloseButton: function(t) {
                var e = $(i(903)).attr({ class: "close", title: $.t("Close message") });
                t.append(e), $(e).on("click", function() { t.animate({ marginTop: r.NOTIFICATION_ANIMATION_START_OFFSET, opacity: 0 }, "fast", function() { t.hide() }) })
            },
            createDialog: function(t, i) {
                var o, n, s;
                return r.isOpen(t) ? (o = r.get(t), o.find("._tv-dialog-content").html(""), o.data("new", !1), o) : (i = i || {},
                    o = $(e.render('<div class="_tv-dialog _tv-dialog-nonmodal {{&addClass}}"><div class="_tv-dialog-title{{#hideTitle}} _tv-dialog-title-hidden{{/hideTitle}}{{#hideCloseCross}} _tv-dialog-title-no-close{{/hideCloseCross}}">{{^hideTitle}} {{&title}}{{/hideTitle}}{{^hideCloseCross}}<a class="_tv-dialog-title-close"></a>{{/hideCloseCross}}</div><div class="_tv-dialog-error"><span class="message"></span></div><div class="_tv-dialog-message"><span class="message"></span></div><div class="_tv-dialog-content"></div></div>', { addClass: i.addClass || "", hideTitle: i.hideTitle, hideCloseCross: i.hideCloseCross, title: t })).appendTo($("body")), r._addMessageCloseButton(o.find("._tv-dialog-error")), r._addMessageCloseButton(o.find("._tv-dialog-message")), i.width && o.css({ width: i.width }), i.content && o.find("._tv-dialog-content").html(i.content), n = 0, n = i.zIndex ? i.zIndex : r.dialogs && r.dialogs.length ? a.max($.map(r.dialogs, function(t) { return parseInt((t.dialog || t).css("z-index"), 10) })) + 1 : 110, o.css("z-index", n), o.data("new", !0), o.data("title", t), o.data("id", r.dialogs.length + 1), r.dialogs.push({ title: t, dialog: o, id: r.dialogs.length + 1 }), s = {
                        start: function(t, e) {
                            var i, o, n = e.helper.css("z-index"),
                                s = 0,
                                a = null;
                            for (i = 0; i < r.dialogs.length; i++)(o = r.dialogs[i].dialog.css("z-index")) > s && (s = o, a = r.dialogs[i].dialog);
                            e.helper.css("z-index", s), a.css("z-index", n)
                        }
                    }, i.dragHandle ? s.handle = i.dragHandle : i.hideTitle || (s.handle = "._tv-dialog-title"), i.dragOptions && $.extend(s, i.dragOptions), o.draggable(r._constrainDraggableOptionsIfNeeded(s)), o)
            },
            positionDialog: function(t, e, i) {
                function o() { n.css("margin-left", -Math.round(n.outerWidth() / 2) + "px"), n.css("margin-top", -Math.round(n.outerHeight() / 2) + "px") }
                var n, s, a, l, h, c, d, p;
                i = i || {}, e = e || i.position, t ? (s = t.width(), a = t.height(), l = $(window).width(), h = $(window).height(), e && e.top && e.left ? (d = i.forcePosition ? e.left : Math.max(2, Math.min(l - s - 4, e.left)) + "px", c = i.forcePosition ? e.top : Math.max(2, Math.min(h - a - 4, e.top)) + "px") : e && e.considerScroll ? (p = $(document), d = Math.round((l - s) / 2 + p.scrollLeft()) + "px", c = Math.round((h - a) / 2 + p.scrollTop()) + "px") : (d = Math.round((l - s) / 2) + "px", c = Math.round((h - a) / 2) + "px"), i.fadeIn ? t.css({ left: d, top: c }).hide().fadeIn("fast") : i.smooth ? t.animate({ left: d, top: c }) : t.css({ left: d, top: c })) : (t = r.modalDialog, n = t.find("._tv-dialog"), o(), n.resize(o))
            },
            applyHandlers: function(t, e) {
                var i, o, n = !t || t === this.modalDialog;
                e = e || {}, i = n ? function() { r.destroy() } : function() { r.destroy(t.data("title")) }, t = t || r.modalDialog.find("._tv-dialog"), e.beforeDestroy && t.on("destroy", e.beforeDestroy), t.find("._tv-dialog-title ._tv-dialog-title-close, .js-dialog-close").on("click", function(t) { e.closeHandler && "function" == typeof e.closeHandler ? e.closeHandler(t) : i() }), e.doNotCloseOnBgClick || setTimeout(function() {
                        t.on("mousedownoutside", function(o) {
                            var n = $(o.target).parents().andSelf();
                            e.doNotCloseOnBgClickIfShadowbox && n.is("._tv-dialog-shadowbox") || n.is(".colorpicker, .charts-popup-list, ._tv-dialog, .tvcolorpicker-popup, .symbol-edit-popup, .ui-datepicker, .clockpicker-popover, .pac-container") || (t.unbind("mousedownoutside"), i())
                        })
                    }, 0),
                    t.find('input[type="checkbox"]').change(function() {
                        var t = $(this);
                        t.next("._tv-dialog-checkbox-mask").toggleClass("disabled", t.prop("disabled")).toggleClass("_tv-dialog-checkbox-mask-active", t.is(":checked"))
                    }), o = t.find('input[type="text"]').focus(function() { $(this).addClass("_tv-dialog-content-textactive") }).blur(function() { $(this).removeClass("_tv-dialog-content-textactive") }).first(), Modernizr.touch || e.notFocusFirst || o.focus(), t.find('input[type="password"]').focus(function() { $(this).addClass("_tv-dialog-content-textactive") }).blur(function() { $(this).removeClass("_tv-dialog-content-textactive") }), t.find("textarea").focus(function() { $(this).addClass("_tv-dialog-content-textareaactive") }).blur(function() { $(this).removeClass("_tv-dialog-content-textareaactive") }), t.find("._tv-dialog-checkbox-mask").click(function() {
                        var t = $(this).prev();
                        t.prop("disabled") || (t.prop("checked", !t[0].checked), t.change())
                    }), e.doNotCloseOnEsc || $(window).bind("keyup.hideDialog", function(e) { if (27 === e.keyCode) return t ? r.destroy(t.data("title")) : r.destroy(), !1 }), e.processEnterButton && $(window).bind("keyup.confirmAndCloseDialog", function(t) { 13 === t.keyCode && "textarea" !== t.target.tagName.toLowerCase() && (e.processEnterButton.click(), $(window).unbind("keyup.confirmAndCloseDialog")) })
            },
            showError: function(t, e, i) { r.showMessage(t, e, $.extend(i || {}, { isError: !0 })) },
            showMessage: function(t, e, i) {
                var o, n, s;
                e || (e = $("._tv-dialog")), i = i || {}, o = i.isError && "_tv-dialog-error" || "_tv-dialog-message", n = e.find("." + o), s = n.find(".message"), i.html ? s.html("string" == typeof i.html ? i.html : t) : s.text(t), s.css("width", e.width()).toggleClass("selectable", !!i.selectable), n.toggleClass("with-close", !!i.withClose).css({ marginTop: r.NOTIFICATION_ANIMATION_START_OFFSET, opacity: "0" }).show().animate({ marginTop: 0, opacity: 1 }, "fast"), i.withClose || (i.hideWithoutAnimation ? n.on("touchstartoutside mousedownoutside keydownoutside", function t() { n.hide(), n.off("touchstartoutside mousedownoutside keydownoutside", t) }) : n.on("touchstartoutside mousedownoutside keydownoutside", function t() { n.animate({ marginTop: r.NOTIFICATION_ANIMATION_START_OFFSET, opacity: 0 }, "fast", function() { n.hide() }), n.off("touchstartoutside mousedownoutside keydownoutside", t) }))
            },
            isOpen: function(t) {
                for (var e = 0; e < r.dialogs.length; e++)
                    if (r.dialogs[e].title === t) return !0;
                return !1
            },
            get: function(t) {
                for (var e = 0; e < r.dialogs.length; e++)
                    if (r.dialogs[e].title === t) return r.dialogs[e].dialog
            },
            submit: function(t, e) {
                var i = e ? $(e) : $("._tv-dialog form").first(),
                    o = i.serialize(),
                    n = i.attr("action");
                $.post(n, o, function(e) { void 0 !== t && t(e) }, "json")
            },
            destroy: function(t, e) {
                if (void 0 !== r.chart && (r.chart.destroy(), delete r.chart), $(window).unbind("keyup.hideDialog"), $(window).unbind("keyup.confirmAndCloseDialog"), t && "string" == typeof t)
                    for (var i = 0; i < r.dialogs.length; i++) r.dialogs[i].title === t && (r.dialogs[i].dialog.find(".apply-common-tooltip").mouseout(), r.dialogs[i].dialog.trigger("destroy", e), $(document).unbind("mouseup.hideDialog" + r.dialogs[i].id), $("input", r.dialogs[i].dialog).blur(), r.dialogs[i].dialog.remove(),
                        r.dialogs.splice(i, 1));
                else r.modalDialog && (r.modalDialog.find(".apply-common-tooltip").mouseout(), r.modalDialog.find("._tv-dialog").trigger("destroy"), r.modalDialog.remove(), r.modalDialog = null)
            },
            changeTitle: function(t, e) { t && r.dialogs.forEach(function(i) { var o, n; if (i.title === t) return o = i.dialog, n = o.find("._tv-dialog-title"), i.title = e, o.data("title", e), n.html(n.html().replace(t, e)), n.find("a").on("click", function() { r.destroy(e) }), !0 }) },
            toggleTitleEl: function(t, e) { r.dialogs.filter(function(e) { return e.title === t }).map(function(t) { return t.dialog }).forEach(function(t) { var i = t.find("._tv-dialog-title"); "boolean" != typeof e && (e = i.hasClass("_tv-dialog-title-hidden")), i.toggleClass("_tv-dialog-title-hidden", !e) }) },
            calcHeight: function(t, e, i) { null == i && (i = 20), t += i; var o = parseInt($("body").height(), 10); return t > o && (e -= t - o, e = Math.max(0, e)), e },
            resizeContent: function(t, e, i) {
                var o, n;
                null == i && (i = 20), t += i, o = parseInt($("body").height(), 10), n = e.height(), t > o && (n -= t - o, n = Math.max(0, n), e.height(n))
            },
            resizeContentWidth: function(t, e, i) {
                var o, n;
                null == i && (i = 20), t += i, o = parseInt($(window).width(), 10), n = e.width(), t > o && (n -= t - o, n = Math.max(0, n), e.width(n))
            }
        }, r.ideaDialogs = { dialogs: [], add: function(t) { r.ideaDialogs.dialogs.push(t) }, remove: function(t) { r.ideaDialogs.dialogs = $.grep(r.ideaDialogs.dialogs, function(e) { return "" + e != "" + t }) }, clear: function() { r.ideaDialogs.dialogs.forEach(function(t) { r.destroy(t) }) }, getDraggableEmptyTitle: function() { return $(document.createElement("div")).css({ height: "30px", "margin-bottom": "-10px", position: "relative" }) } }, void 0 !== o && o && o.exports && (o.exports = r)
    }).call(e, i(3), i(30), i(50)(t))
}, , , , , , , function(t, e, i) {
    "use strict";
    var o = i(40);
    window.language && (o.locale(window.language, {
        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: "D MMM", l: "M/D/YYYY", LL: "D MMM YYYY", ll: "D MMM LT", LLL: "LT - LL", 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", { plural: "%d minutes", count: t }).replace("%d", t) }, mm: function(t) { return $.t("%d minute", { plural: "%d minutes", count: t }).replace("%d", t) }, h: $.t("an hour"), hh: function(t) { return $.t("%d hour", { plural: "%d hours", count: t }).replace("%d", t) }, d: $.t("a day"), dd: function(t) { return $.t("%d day", { plural: "%d days", count: t }).replace("%d", t) }, M: $.t("a month"), MM: function(t) { return $.t("%d month", { plural: "%d months", count: t }).replace("%d", t) }, y: $.t("a year"), yy: function(t) { return $.t("%d year", { plural: "%d years", count: t }).replace("%d", t) } },
        week: { dow: 1, doy: 4 }
    }), o.locale(window.language))
}, , function(t, e, i) {
    (function(t) {
        "use strict";
        var e = function() { this.type = "test_call", this.content = "" },
            i = {
                wrapValue: function(t) { return "" + t },
                sendEvent: function(t, i) {
                    var o = new e;
                    o.type = i || "event", o.content = t, window.external.notify(JSON.stringify(o))
                }
            };
        void 0 !== t && t && t.exports && (t.exports = i)
    }).call(e, i(50)(t))
}, function(t, e) { t.exports = '<div class="tv-dropdown-behavior tv-autocomplete__wrapper">\n\t<input class="tv-control-input tv-dropdown-behavior__button" type="text" {{#maxLength}}maxlength="{{ maxLength }}"{{/maxLength}}>\n\t<tv-menu class="tv-dropdown-behavior__body tv-autocomplete__dropdown i-hidden">\n\t</tv-menu>\n</div>\n' }, , , function(t, e, i) {
    "use strict";
    var o, n, s, r, a, l, h, c, d;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(73), i(28), i(117), i(488), n = i(363), s = { connecting: "tv-data-mode--connecting", delayed: "tv-data-mode--delayed", delayed_streaming: "tv-data-mode--delayed", endofday: "tv-data-mode--endofday", forbidden: "tv-data-mode--forbidden", realtime: "tv-data-mode--realtime", snapshot: "tv-data-mode--snapshot", loading: "tv-data-mode--loading" }, r = { connecting: $.t("Connecting"), delayed: $.t("Delayed"), delayed_streaming: $.t("Delayed"), endofday: $.t("EOD"), forbidden: $.t("Instrument is not allowed"), realtime: $.t("Realtime"), snapshot: $.t("Snapshot"), loading: "" }, a = { connecting: $.t("C", { context: "data_mode_connecting_letter" }), delayed: $.t("D", { context: "data_mode_delayed_letter" }), delayed_streaming: $.t("D", { context: "data_mode_delayed_streaming_letter" }), endofday: $.t("E", { context: "data_mode_end_of_day_letter" }), forbidden: $.t("F", { context: "data_mode_forbidden_letter" }), realtime: $.t("R", { context: "data_mode_realtime_letter" }), snapshot: $.t("S", { context: "data_mode_snapshot_letter" }), loading: "" }, l = 600, h = { streaming: "realtime" }, c = {
        classMap: s,
        classSuffix: "",
        data: { values: { update_mode: "connecting" } },
        labelMap: r,
        modeInterval: l,
        short: !1,
        shortLabelMap: a,
        showTooltip: !0
    }, d = function(t) {
        function e(e) { var i = t.call(this) || this; return i._quoteSessionPrefix = "data-mode-indicator", i._componentClass = "tv-data-mode", i._init(e), i }
        return o.__extends(e, t), e.prototype.getLabel = function() { return !0 === this._shortMode ? this._shortLabelMap[this._value] || "" : t.prototype.getLabel.call(this) }, e.prototype.setMode = function(t, e) { this.update({ values: { update_mode: t } }) }, e.prototype.hide = function() { this._el.classList.add("i-hidden") }, e.prototype.show = function() { this._el.classList.remove("i-hidden") }, e.prototype.getTooltipText = function() {
            var t = "",
                e = this.getValue();
            if ("" === e) return t;
            switch (e) {
                case "delayed":
                    t = $.t("Quotes are delayed by {0} min and updated every 30 seconds");
                    break;
                case "delayed_streaming":
                    t = $.t("Quotes are delayed by {0} min");
                    break;
                default:
                    t = this._labelMap[e] || t
            }
            return ["delayed", "delayed_streaming"].includes(e) && (t = t.format(Math.round(this._modeInterval / 60))), t
        }, e.prototype._init = function(e) {
            void 0 === e && (e = {});
            var i = Object.assign({}, c, e);
            this._modeInterval = i.modeInterval || l, this._shortLabelMap = i.shortLabelMap || a, t.prototype._init.call(this, i), this._render()
        }, e.prototype._getValueFromData = function(t) { var e; return e = void 0 !== t.values && void 0 !== t.values.update_mode ? t.values.update_mode : this.getValue(), h[e] || e }, e
    }(n.AbstractIndicator), e.DataModeIndicator = d
}, function(t, e, i) {
    "use strict";
    var o, n, s, r, a, l;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(73), i(28), i(489), n = i(363), s = { invalid: "tv-market-status--invalid", market: "tv-market-status--market", out_of_session: "tv-market-status--out-of-session", post_market: "tv-market-status--post-market", pre_market: "tv-market-status--pre-market", loading: "tv-market-status--loading" }, r = { invalid: $.t("Invalid Symbol"), market: $.t("Market Open"), out_of_session: $.t("Market Closed"), post_market: $.t("Post Market"), pre_market: $.t("Pre Market"), loading: $.t("Loading") }, a = { classMap: s, classSuffix: "", data: {}, extraTitle: "", labelMap: r, short: !1, showTooltip: !0 }, l = function(t) {
        function e(e) { var i = t.call(this) || this; return i._quoteSessionPrefix = "market-status-indicator", i._componentClass = "tv-market-status", i._extraTitle = "", i._init(e), i }
        return o.__extends(e, t), e.prototype.setStatus = function(t, e) {
                var i = { values: { current_session: t } };
                this.update(i, e)
            }, e.prototype.getTooltipText = function() { var e = t.prototype.getTooltipText.call(this); return "" === e ? e : ("" !== this._extraTitle && (e = e + ", " + this._extraTitle), e) }, e.prototype.setExtraTitle = function(t) { this._extraTitle = t }, e.prototype.reset = function() { this._clearClasses(), this._labelEl.textContent = "", this._extraTitle = "", this._el.setAttribute("title", ""), this._value = "" }, e.prototype.enableShortMode = function(e) { void 0 === e && (e = !0), void 0 !== this._labelEl && this._labelEl.classList.add("i-hidden"), t.prototype.enableShortMode.call(this) }, e.prototype.disableShortMode = function() { void 0 !== this._labelEl && this._labelEl.classList.remove("i-hidden"), t.prototype.disableShortMode.call(this) }, e.prototype._renderLabel = function() { this._labelEl.textContent = this.getLabel() },
            e.prototype._getValueFromData = function(t) { return void 0 !== t.values && void 0 !== t.values.current_session ? t.values.current_session : this.getValue() }, e.prototype._render = function() { this._renderLabelElement(), this._renderDotElement(), t.prototype._render.call(this) }, e.prototype._init = function(e) {
                var i = Object.assign({}, a, e);
                t.prototype._init.call(this, i), this.setExtraTitle(i.extraTitle), this._render()
            }, e.prototype._renderLabelElement = function() { void 0 === this._labelEl && (this._labelEl = document.createElement("span"), this._labelEl.classList.add(this._componentClass + "__label"), this._labelEl.classList.add(this._componentClass + "__label" + this._classSuffix), this._el.appendChild(this._labelEl)) }, e.prototype._renderDotElement = function() { void 0 === this._dotEl && (this._dotEl = document.createElement("span"), this._dotEl.classList.add(this._componentClass + "__dot"), this._dotEl.classList.add(this._componentClass + "__dot" + this._classSuffix), this._el.appendChild(this._dotEl)) }, e
    }(n.AbstractIndicator), e.MarketStatusIndicator = l
}, function(t, e, i) {
    "use strict";

    function o(t, e) { return t.ticker + "_" + e }

    function n(t) { return new Date(t).toISOString() }
    var s, r, a, l, h, c;
    Object.defineProperty(e, "__esModule", { value: !0 }), s = i(36), r = i(364), a = i(56), l = i(3), i(117), h = function() {
        function t(t, e, i, o) { this._cache = { bars: [] }, this._nextSubscriptionId = 0, this._pendingSubscribers = [], this._subscribers = [], this._requesting = !1, this._leftDate = null, this._gaps = [], this._needPurgeCache = !1, this._realtimeOn = !1, this._endOfData = !1, this._resetCacheTimeout = null, this._errorMessage = null, this._datafeed = t, this._symbolInfo = e, this._resolution = i, this._dwmAligner = o }
        return t.prototype.addSubscription = function(t, e, i) {
                var o = this,
                    n = this._getNextSubscriptionId(),
                    s = Math.floor(t.from / 1e3),
                    r = Math.floor(t.to / 1e3);
                return this._pendingSubscribers.push({ key: n, range: { from: s, to: r }, onHistoryCallback: e, onErrorCallback: i }), this._clearResetCacheTimeout(), setTimeout(function() { return o._processNextPendingSubscriber() }, 0), n
            }, t.prototype.removeSubscription = function(t) {
                var e, i = this,
                    o = this._pendingSubscribers.find(function(e) { return e.key === t });
                return o ? void this._pendingSubscribers.splice(this._pendingSubscribers.indexOf(o), 1) : (e = this._subscribers.find(function(e) { return e.key === t })) ? (this._subscribers.splice(this._subscribers.indexOf(e), 1), void(this._subscribers.length || (this._symbolInfo.expired || this._symbolInfo.expiration_date ? this._unsubscribeRealtime() : this._resetCacheTimeout = setTimeout(function() { i.purgeCache(), i._unsubscribeRealtime() })))) : void console.warn("Unknown subscription symbol={0}, resolution={1}, key={2}".format(this._symbolInfo.name, this._resolution, t))
            }, t.prototype.purgeCache = function() { this._logMessage("Reset cache"), this._needPurgeCache = !0, this._clearResetCacheTimeout() }, t.prototype._logMessage = function(t, e) {
                (l.enabled("charting_library_debug_mode") || e) && console.log("FEED [{0}|{1}]: {2}".format(this._symbolInfo.name, this._resolution, t))
            }, t.prototype._clearResetCacheTimeout = function() { null !== this._resetCacheTimeout && (clearTimeout(this._resetCacheTimeout), this._resetCacheTimeout = null) },
            t.prototype._purgeCache = function() { this._cache = { bars: [] }, this._gaps = [], this._errorMessage = null, this._needPurgeCache = !1, this._leftDate = null, this._endOfData = !1 }, t.prototype._processNextPendingSubscriber = function() {
                var t, e, i, o, r, a;
                if (this._pendingSubscribers.length && !this._requesting) {
                    if (this._needPurgeCache && this._purgeCache(), t = this._pendingSubscribers.pop(), this._logMessage("Processing bars request {0} from {1} to {2} ".format(t.key, n(1e3 * t.range.from), n(1e3 * t.range.to))), this._errorMessage) return this._logMessage("Return error:" + this._errorMessage), t.onErrorCallback(this._errorMessage), void this._processNextPendingSubscriber();
                    if ((!this._leftDate || t.range.from < this._leftDate) && (e = new s.Interval(this._resolution), i = (e.inMilliseconds() || 0) / 1e3, o = !this._leftDate, r = !o && !!this._cache.bars.length && this._cache.bars[0].time / 1e3 - t.range.from < i, (o || !r) && !this._endOfData)) return this._pendingSubscribers.push(t), void this._ensureRequestedTo(t.range.from);
                    a = this._moveSubscriberToRealtime(t), this._returnHistoryDataToSubscriber(t, a), this._subscribeRealtimeIfNeeded(), this._processNextPendingSubscriber()
                }
            }, t.prototype._moveSubscriberToRealtime = function(t) { var e = { key: t.key, onHistoryCallback: t.onHistoryCallback, barset: null }; return this._subscribers.push(e), e }, t.prototype._subscribeRealtimeIfNeeded = function() {!this._subscribers.length || this._realtimeOn || this._symbolInfo.expired || this._symbolInfo.expiration_date || this._subscribeRealtime() }, t.prototype._subscribeRealtime = function() {
                var t, e, i = this;
                this._symbolInfo.expired || this._realtimeOn || (t = function(t) {
                    i._dwmAligner && (t.time = i._dwmAligner.tradingDayToSessionStart(t.time)), i._putToCacheNewBar(t), i._subscribers.forEach(function(e) {
                        var i = e.barset;
                        if (null === i) throw Error("subscirber.barset is null");
                        i.add(t), e.onHistoryCallback(i)
                    })
                }, e = function() {
                    i._unsubscribeRealtime();
                    var t = i._leftDate;
                    i._purgeCache(), t && i._ensureRequestedTo(t)
                }, this._realtimeOn = !0, this._datafeed.subscribeBars(this._symbolInfo, this._resolution, t, o(this._symbolInfo, this._resolution), e), this._logMessage("Subscribed to realtime"))
            }, t.prototype._unsubscribeRealtime = function() {!this._symbolInfo.expired && this._realtimeOn && (this._datafeed.unsubscribeBars(o(this._symbolInfo, this._resolution)), this._logMessage("Unsubscribed from realtime"), this._realtimeOn = !1) }, t.prototype._returnHistoryDataToSubscriber = function(t, e) {
                var i, o, s = t.range,
                    r = l.enabled("cl_feed_return_all_data") ? this._createBarset(this._leftDate || s.from) : this._createBarset(s.from);
                r.count() > 0 ? this._logMessage("Bars to return for request {0}: total {1} bars in [{2} ... {3}] ".format(t.key, r.count(), n(r.bars[0].time), n(r.bars[r.count() - 1].time))) : this._logMessage("Request {0}. Nothing to return.".format(t.key)), e.barset = r, i = this._inGapNextTime(s.from), i ? (this._logMessage("Request {0} is in gap, nextTime = {1}".format(t.key, n(1e3 * i))), r.nextTime = i) : 0 === r.count() && (o = this._cache.bars.length && this._cache.bars[this._cache.bars.length - 1].time / 1e3) && s.from > o && (this._logMessage("Request {0} is in gap, nextTime = {1}".format(t.key, n(1e3 * o))), r.nextTime = o || void 0),
                    this._endOfData && null !== this._leftDate && t.range.from <= this._leftDate && (r.endOfData = !0), t.onHistoryCallback(r)
            }, t.prototype._createBarset = function(t) { var e = r.lowerbound(this._cache.bars, 1e3 * t, function(t, e) { return t.time < e }); return new a.BarSet(this._symbolInfo, this._cache.bars.slice(e)) }, t.prototype._ensureRequestedTo = function(e) {
                var i, o, s, r = this;
                if (this._leftDate && this._leftDate < e) return void this._processNextPendingSubscriber();
                i = !this._leftDate, this._requesting = !0, o = e, s = this._leftDate ? this._leftDate - 1 : this._symbolInfo.expiration_date || Math.floor(t._now() / 1e3), this._leftDate = e, this._logMessage("Requesting data: [{0} ... {1}] ".format(n(1e3 * o), n(1e3 * s))), this._datafeed.getBars(this._symbolInfo, this._resolution, o, s, function(t, e) { r._requesting = !1, r._processBars(t, e) }, function(t) { r._requesting = !1, r._errorMessage = t || null, r._processNextPendingSubscriber() }, i)
            }, t.prototype._processBars = function(t, e) { this._checkBars(t), this._alignBarsTime(t), t.length > 0 ? this._processFullBarset(t, e) : this._processEmptyBarset(e), this._processNextPendingSubscriber() }, t.prototype._processEmptyBarset = function(e) { this._logMessage("Receiving bars: barset is empty"), e && e.nextTime ? (this._logMessage("Next time received: `{0}`".format(n(1e3 * e.nextTime))), this._addGap(e.nextTime), this._leftDate = Math.min(this._leftDate || t._now() / 1e3, e.nextTime + 1)) : e && e.noData ? (this._logMessage("EOD received"), this._endOfData = !0, this._cache.bars.length && (this._leftDate = this._cache.bars[0].time / 1e3)) : this._logMessage("nextTime or noData should present in metainfo when empty barset is returned") }, t.prototype._processFullBarset = function(t, e) {
                var i = t[0].time,
                    o = t[t.length - 1].time;
                this._logMessage("Receiving bars: total {0} bars in [{1} ... {2}] ".format(t.length, n(i), n(o))), null !== this._leftDate && i < 1e3 * this._leftDate && !l.enabled("cl_feed_return_all_data") && this._logMessage("Returned more data than needed"), this._putToCache(t) ? null !== this._leftDate && this._cache.bars.length && this._leftDate > this._cache.bars[0].time / 1e3 && (this._leftDate = this._cache.bars[0].time / 1e3) : this._logMessage("Incremental update failed. Starting full update. Returned data should be in the requested range.", !0), e && e.nextTime ? console.warn("nextTime should be set when there is no data in the requested period only") : e && e.noData && console.warn("noData should be set when there is no data in the requested period and earlier only")
            }, t.prototype._addGap = function(e) {
                var i;
                this._gaps.find(function(t) { return t.from === e }) || (i = (this._cache.bars.length ? this._cache.bars[0].time : t._now()) / 1e3, this._gaps.push({ from: e, to: i }))
            }, t.prototype._inGapNextTime = function(t) { var e = this._gaps.find(function(e) { return e.from < t && e.to > t }); return e ? e.from : null }, t.prototype._getNextSubscriptionId = function() { return this._nextSubscriptionId++ }, t.prototype._checkBars = function(t, e) {
                var i, o;
                if (void 0 === e && (e = !1), l.enabled("charting_library_debug_mode"))
                    for (i = 1; i < t.length; i++) t[i].time <= t[i - 1].time && (o = "Wrong bars time: time {0} of bar {1} should be more than time {2} of bar {3}".format(t[i].time, i, t[i - 1].time, i - 1),
                        e && this._dwmAligner && (o += "\nCheck that you provide DWM bars without time part, i.e. 00:00 GMT"), console.error(o))
            }, t.prototype._putToCache = function(t) {
                if (0 === t.length) return !0;
                if (this._cache.bars.length === t.length && this._cache.bars[0].time === t[0].time && this._cache.bars[this._cache.bars.length - 1].time === t[t.length - 1].time) return this._logMessage("Time range of received data is the same as cached one. Skip the update."), !0;
                if (0 !== this._cache.bars.length && t[t.length - 1].time === this._cache.bars[0].time && this._cache.bars.splice(0, 1), 0 !== this._cache.bars.length && t[t.length - 1].time >= this._cache.bars[0].time) {
                    var e = this._cache.bars[this._cache.bars.length - 1].time === t[t.length - 1].time;
                    if (this._cache.bars = [], !e) return this._leftDate = null, !1;
                    this._logMessage("Received history up to now instead of incremental update. Return exactly what is requested.")
                }
                return Array.prototype.unshift.apply(this._cache.bars, t), this._checkBars(this._cache.bars, !0), !0
            }, t.prototype._putToCacheNewBar = function(t) {
                var e = this._cache.bars.length,
                    i = t.time,
                    o = 0 === e ? NaN : this._cache.bars[e - 1].time;
                0 === e || o < i ? this._cache.bars.push(t) : o === i ? this._cache.bars[e - 1] = t : console.error("putToCacheNewBar: time violation, previous bar time: " + n(o) + " should be less or equal to new time: " + n(i))
            }, t.prototype._alignBarsTime = function(t) {
                if (this._dwmAligner)
                    for (var e = 0; e < t.length; e++) t[e].time = this._dwmAligner.tradingDayToSessionStart(t[e].time)
            }, t._now = function() { return Date.now() + 6e4 }, t
    }(), c = function() {
        function t(t, e) { this._threads = {}, this._datafeed = t, this._dwmAlignerCreator = e }
        return t.prototype.purgeCache = function() { this._forEachThread(function(t, e) { return e.purgeCache() }) }, t.prototype.subscribe = function(t, e, i, n, s) { var r, a = o(t, e); return this._threads[a] || (this._threads[a] = this._createThread(t, e)), r = this._threads[a].addSubscription(i, n, s), a + '"' + r }, t.prototype.unsubscribe = function(t) {
            var e, i, o = t.split('"');
            if (2 !== o.length) return void console.warn("Wrong guid format");
            e = o[0], i = parseInt(o[1]), this._threads[e].removeSubscription(i)
        }, t.prototype._createThread = function(t, e) { return new h(this._datafeed, t, e, this._dwmAlignerCreator(e, t)) }, t.prototype._forEachThread = function(t) {
            var e = this;
            Object.keys(this._threads).forEach(function(i) { return t(i, e._threads[i]) })
        }, t
    }(), e.DatafeedRequestsCachedProcessor = c
}, 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 (Object.defineProperty(e, "__esModule", { value: !0 }), window.language) {
        if (!window._tv_languages) {
            var o = "localization/translations/" + window.language + ".json";
            window._tv_languages = {}, window._tv_languages[window.language] = i(o) || {}
        }
    } else window.language = "en"
}, function(t, e, i) {
    "use strict";
    var o, n;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(56), n = function() {
        function t() {}
        return t.prototype.main = function(t) {
            var e, i, n, s, r = t.new_var(o.Std.open(t)),
                a = t.new_var(o.Std.close(t)),
                l = r.get(1),
                h = a.get(1),
                c = o.Std.ohlc4(t),
                d = o.Std.na(r.get(1)) ? (o.Std.open(t) + o.Std.close(t)) / 2 : (l + h) / 2;
            return r.set(d), a.set(c), e = o.Std.max(o.Std.high(t), o.Std.max(d, c)),
                i = o.Std.min(o.Std.low(t), o.Std.min(d, c)), n = o.Std.volume(t), s = t.symbol, [s.time, d, e, i, c, n, s.updatetime, s.isBarClosed]
        }, t
    }(), e.HeikenAshi = n
}, function(t, e, i) {
    "use strict";

    function o(t, e, i, n) {
        var s, r, a;
        if (n = !n || n < 1e12 ? Date.now() : n, s = n - t, r = Math.min(i.endValue, i.endValue * i.easing(s / i.duration)), a = r - e, i.onStep(a, r), s >= i.duration) return void(i.onComplete && i.onComplete());
        requestAnimationFrame(o.bind(null, t, r, i))
    }

    function n(t) { t.duration = t.duration || 250, t.easing = t.easing || s.easingFunc.easeOutCubic, requestAnimationFrame(o.bind(null, Date.now(), 0, t)) }
    Object.defineProperty(e, "__esModule", { value: !0 });
    var s = i(54);
    e.doAnimate = n
}, function(t, e, i) {
    "use strict";
    var o, n;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(44), n = function() {
        function t(t, e) { this._major = t, this._minor = e }
        return t.prototype.major = function() { return this._major }, t.prototype.minor = function() { return this._minor }, t.prototype.isZero = function() { return 0 === this._major && 0 === this._minor }, t.prototype.toString = function() { return this._major + "." + this._minor }, t.prototype.compareTo = function(t) { return this._major < t._major ? -1 : this._major > t._major ? 1 : this._minor < t._minor ? -1 : this._minor > t._minor ? 1 : 0 }, t.prototype.isLess = function(t) { return this.compareTo(t) < 0 }, t.prototype.isLessOrEqual = function(t) { return this.compareTo(t) <= 0 }, t.prototype.isEqual = function(t) { return 0 === this.compareTo(t) }, t.prototype.isGreater = function(t) { return this.compareTo(t) > 0 }, t.prototype.isGreaterOrEqual = function(t) { return this.compareTo(t) >= 0 }, t.parse = function(e) { var i, n, s; if (e instanceof t) return new t(e.major(), e.minor()); if ("number" == typeof e) return o.assert(Math.floor(e) === e, "Version should not be a float number"), new t(e, 0); if ("string" == typeof e) { if (i = e.split("."), 1 === i.length) return n = parseInt(i[0], 10), o.assert(!isNaN(n), "Bad version string: " + e), new t(n, 0); if (2 === i.length) return n = parseInt(i[0], 10), o.assert(!isNaN(n), "Bad version string: " + e), s = parseInt(i[1], 10), o.assert(!isNaN(s), "Bad version string: " + e), new t(n, s); throw Error("Bad version string (one dot expected): " + e) } throw Error("Bad version: " + e) }, t
    }(), n.ZERO = new n(0, 0), e.Version = n
}, function(t, e, i) {
    (function(t) {
        "use strict";
        var o, n, s, r, a, l, h, c, d, p, u, _;
        Object.defineProperty(e, "__esModule", { value: !0 }), o = i(73), i(17), i(30), i(105), i(28), n = i(368), s = i(372), r = i(47), a = i(101), l = i(15), h = i(42), c = i(217), d = i(69), p = i(41), i(499), u = '<span class="tv-favorited-drawings-toolbar__widget {{#isActive}}i-active{{/isActive}} apply-common-tooltip" title="{{title}}">{{{icon}}}</span>', _ = function(e) {
            function i(t) { var i = e.call(this, { allowSortable: !Modernizr.touch, defaultPosition: t, positionSettingsKey: "chart.favoriteDrawingsPosition" }) || this; return i._linetoolsWidgets = {}, i._onButtonClicked = new l, i._canBeShownValue = new p(!1), i._attachHandlers(), i._loadVisibilityState(), i }
            return o.__extends(i, e), i.prototype.show = function() { this._canBeShownValue.value() && (d.setValue(i._visibilitySettingsKey, !0), this.isVisible() || this._renderAllLinetools(), e.prototype.show.call(this)) }, i.prototype.hide = function() { d.setValue(i._visibilitySettingsKey, !1), e.prototype.hide.call(this) },
                i.prototype.onButtonClicked = function() { return this._onButtonClicked }, i.prototype.canBeShown = function() { return this._canBeShownValue.readonly() }, i.prototype._onFavoriteAdded = function(t) { this._canBeShownValue.setValue(!0), this.addWidget(this._createLinetoolWidget(t)), this.show() }, i.prototype._onFavoriteRemoved = function(t) { this.removeWidget(this._linetoolsWidgets[t]), delete this._linetoolsWidgets[t], 0 === s.LinetoolsFavoritesStore.favoritesCount() && (this._canBeShownValue.setValue(!1), this.hide()) }, i.prototype._onFavoriteMoved = function() { this._renderAllLinetools() }, i.prototype._onSelectedLinetoolChanged = function(t) {
                    var e = this;
                    Object.keys(this._linetoolsWidgets).forEach(function(i) { e._linetoolsWidgets[i].classList.toggle("i-active", t === i) })
                }, i.prototype._createLinetoolWidget = function(e) {
                    var i = this,
                        o = $(t.render(u, { icon: c.lineToolsInfo[e].icon, isActive: e === h.tool.value(), title: c.lineToolsInfo[e].localizedName }))[0];
                    return o.addEventListener("click", function(t) { t.preventDefault(), i._onButtonClicked.fire(e) }), this._linetoolsWidgets[e] = o, o
                }, i.prototype._renderAllLinetools = function() {
                    var t = this;
                    this._linetoolsWidgets = {}, this.removeWidgets(), s.LinetoolsFavoritesStore.favorites().forEach(function(e) { t.addWidget(t._createLinetoolWidget(e)) })
                }, i.prototype._attachHandlers = function() {
                    var t = this;
                    s.LinetoolsFavoritesStore.favoriteAdded.subscribe(this, this._onFavoriteAdded), s.LinetoolsFavoritesStore.favoriteRemoved.subscribe(this, this._onFavoriteRemoved), s.LinetoolsFavoritesStore.favoriteMoved.subscribe(this, this._onFavoriteMoved), s.LinetoolsFavoritesStore.favoritesSynced.subscribe(null, function() { t._loadVisibilityState(), t._renderAllLinetools() }), this.onWidgetsReordered().subscribe(this, function(e, i) {
                        if (s.LinetoolsFavoritesStore.favoriteMoved.unsubscribe(t, t._onFavoriteMoved), !s.LinetoolsFavoritesStore.moveFavorite(s.LinetoolsFavoritesStore.favorite(e), i)) throw Error("Something went wrong");
                        s.LinetoolsFavoritesStore.favoriteMoved.subscribe(t, t._onFavoriteMoved)
                    }), this.onContextMenu(function(e) {
                        e.preventDefault();
                        var i = new r.Action({ text: $.t("Hide Favorite Drawings Toolbar") });
                        i.callbacks().subscribe(null, function() { t.hide() }), a.createMenu([i]).show(e)
                    }), h.tool.subscribe(this._onSelectedLinetoolChanged.bind(this))
                }, i.prototype._loadVisibilityState = function() {
                    var t, e = s.LinetoolsFavoritesStore.favoritesCount() > 0;
                    this._canBeShownValue.setValue(e), t = d.getBool(i._visibilitySettingsKey, !0), t && e ? this.show() : this.hide()
                }, i
        }(n.FloatingToolbar), _._visibilitySettingsKey = "ChartFavoriteDrawingToolbarWidget.visible", e.FavoriteDrawingToolbar = _
    }).call(e, i(30))
}, function(t, e, i) {
    "use strict";
    var o, n, s, r;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(73), n = i(368), s = i(15), i(137), i(501), r = function(t) {
        function e(i) { var o = t.call(this, e._prepareOptions(i)) || this; return o._onWidgetStateChangedDelegate = new s, o._statedWidgets = [], o._currentPopup = null, o._onWindowClickedListener = o._onWindowClicked.bind(o), o }
        return o.__extends(e, t), e.prototype.show = function() { t.prototype.show.call(this), document.addEventListener("mousedown", this._onWindowClickedListener) },
            e.prototype.hide = function() { t.prototype.hide.call(this), document.removeEventListener("mousedown", this._onWindowClickedListener) }, e.prototype.destroy = function() { this._closePopup(), t.prototype.destroy.call(this) }, e.prototype.addGroupedWidget = function(t, i) {
                var o, n, s;
                if (void 0 === i && (i = {}), t.states.length <= 0 || -1 === e._getStateIndexById(t, t.currentStateId)) throw Error("Argument is invalid (count: " + t.states.length + ", state: " + t.currentStateId + ")");
                o = document.createElement("div"), o.className = "tv-grouped-floating-toolbar__widget-wrapper apply-common-tooltip", t.widgetAddClass && o.classList.add(t.widgetAddClass), o.setAttribute("title", t.tooltip), n = { statedWidget: t, toolbarWidget: o }, s = this._onWidgetClicked.bind(this, n), n.clickListener = s, o.addEventListener("click", s), this._updateWidgetPreview(n), this.addWidget(o, i), this._statedWidgets.push(n)
            }, e.prototype.removeGroupedWidget = function(t) {
                var e, i, o = this._statedWidgets.length;
                for (e = 0; e < o; ++e)
                    if (i = this._statedWidgets[e], i.statedWidget.id === t) return this._isPopupCreatedForWidget(t) && this._closePopup(), i.toolbarWidget.removeEventListener("click", i.clickListener), this.removeWidget(i.toolbarWidget), this._statedWidgets.splice(e, 1), void this._updatePopupPosition();
                throw Error("Unknown groupdId(" + t + ")")
            }, e.prototype.setGroupedWidgetState = function(t, i) {
                var o, n;
                for (o = 0; o < this._statedWidgets.length; ++o)
                    if (n = this._statedWidgets[o], n.statedWidget.id === t) { if (-1 === e._getStateIndexById(n.statedWidget, i)) throw Error("Unknown stateId (" + i + ")"); return n.statedWidget.currentStateId = i, this._updateSubWidgetsState(n.statedWidget), void this._updateWidgetPreview(n) }
            }, e.prototype.onWidgetStateChanged = function() { return this._onWidgetStateChangedDelegate }, e.prototype._onVerticalChanged = function(t, e) { this._updatePopupPosition() }, e.prototype._onWidgetClicked = function(t, e) {
                var i = this._currentPopup && this._isPopupCreatedForWidget(t.statedWidget.id);
                this._closePopup(), i || this._createPopup(t)
            }, e.prototype._createPopup = function(t) {
                var e, i = this,
                    o = { createdFor: t.toolbarWidget, element: document.createElement("div"), stateWidgetId: t.statedWidget.id, widgets: [] };
                o.element.className += "tv-grouped-floating-toolbar__popup js-popup", e = t.statedWidget.states.length, t.statedWidget.states.forEach(function(n, s) {
                    var r = i._createSubWidget(t, n),
                        a = i._onSubWidgetClicked.bind(i, t, n.id);
                    r.addEventListener("click", a), o.widgets.push({ clickListener: a, stateWidget: n, widget: r }), r.classList.add("tv-grouped-floating-toolbar__sub-widget--slide-right-" + s), r.classList.add("tv-grouped-floating-toolbar__sub-widget--slide-left-" + (e - s + 1)), o.element.appendChild(r)
                }), this._currentPopup = o, this._updateSubWidgetsState(t.statedWidget), t.toolbarWidget.classList.add("i-dropped"), this._getWidget().appendChild(this._currentPopup.element), Promise.resolve().then(function() { i._currentPopup && i._currentPopup.element.classList.add("i-opened") }), this._updatePopupPosition()
            }, e.prototype._closePopup = function() {
                var t, e, i = this;
                this._statedWidgets.forEach(function(t) { t.toolbarWidget.classList.remove("i-dropped") }), this._currentPopup && (t = this._currentPopup.widgets,
                    e = this._currentPopup.element, this._currentPopup = null, t.forEach(function(t) { t.widget.removeEventListener("click", t.clickListener) }), e.classList.remove("i-opened"), e.addEventListener("transitionend", function(t) { t.target === e && i._getWidget().removeChild(e) }))
            }, e.prototype._updateWidgetPreview = function(t) {
                var i, o = e._getStateIndexById(t.statedWidget, t.statedWidget.currentStateId);
                if (-1 === o) throw Error("Unknown state id: " + t.statedWidget.currentStateId);
                i = t.statedWidget.states[o].widget.cloneNode(!0), t.toolbarWidget.firstChild ? t.toolbarWidget.replaceChild(i, t.toolbarWidget.firstChild) : (t.toolbarWidget.appendChild(i), t.toolbarWidget.appendChild(e._createCaret()))
            }, e.prototype._updateSubWidgetsState = function(t) { this._currentPopup && this._isPopupCreatedForWidget(t.id) && this._currentPopup.widgets.forEach(function(i) { i.widget.classList.toggle(e._activeSubWidgetClass, i.stateWidget.id === t.currentStateId) }) }, e.prototype._updatePopupPosition = function() {
                var t, e, i, o, n, s, r, a;
                if (this._currentPopup) {
                    if (t = this._currentPopup.createdFor, e = this._getWidget().getBoundingClientRect(), !(i = this._findWrapperForWidget(t)) || !this._currentPopup) throw Error("Toolbar has no wrapper for preview's widget or there is no popup");
                    o = i.getBoundingClientRect(), n = this._currentPopup.element.getBoundingClientRect(), s = this._currentPopup.element, this.isVertical() ? (s.classList.remove("tv-grouped-floating-toolbar__popup--at-top"), s.style.top = o.top - e.top - 1 + "px", s.style.left = "", e.left > window.innerWidth - e.right ? s.classList.add("tv-grouped-floating-toolbar__popup--at-left") : s.classList.remove("tv-grouped-floating-toolbar__popup--at-left")) : (s.classList.remove("tv-grouped-floating-toolbar__popup--at-left"), r = o.left + n.width, a = 0, a = r > window.innerWidth ? e.left + n.width <= window.innerWidth ? -1 : e.width - n.width - 1 : o.left - e.left - 1, s.style.left = a + "px", e.bottom + n.height > window.innerHeight ? s.classList.add("tv-grouped-floating-toolbar__popup--at-top") : (s.classList.remove("tv-grouped-floating-toolbar__popup--at-top"), s.style.top = ""))
                }
            }, e.prototype._isPopupCreatedForWidget = function(t) { return !(!this._currentPopup || this._currentPopup.stateWidgetId !== t) }, e.prototype._createSubWidget = function(t, e) { var i = document.createElement("div"); return i.className += "tv-grouped-floating-toolbar__sub-widget", t.statedWidget.stateWidgetAddClass && i.classList.add(t.statedWidget.stateWidgetAddClass), i.appendChild(e.widget), i }, e.prototype._onSubWidgetClicked = function(t, e) { this._closePopup(), t.statedWidget.currentStateId !== e && (this.setGroupedWidgetState(t.statedWidget.id, e), this._onWidgetStateChangedDelegate.fire(t.statedWidget.id, e)) }, e.prototype._onWindowClicked = function(t) {
                if (this.isVisible() && this._currentPopup && !e._isEventInElement(t, this._currentPopup.element)) {
                    for (var i = 0; i < this._statedWidgets.length; ++i)
                        if (e._isEventInElement(t, this._statedWidgets[i].toolbarWidget)) return;
                    this._closePopup()
                }
            }, e._getStateIndexById = function(t, e) {
                for (var i = 0; i < t.states.length; ++i)
                    if (t.states[i].id === e) return i;
                return -1
            }, e._createCaret = function() {
                var t = document.createElement("div");
                return t.className = "tv-caret tv-caret--small tv-caret--colored tv-grouped-floating-toolbar__caret", t
            }, e._prepareOptions = function(t) { var e = " tv-grouped-floating-toolbar"; return t.addClass ? t.addClass += e : t.addClass = e, t }, e._isEventInElement = function(t, e) { return t.target === e || e.contains(t.target) }, e
    }(n.FloatingToolbar), r._activeSubWidgetClass = "tv-grouped-floating-toolbar__sub-widget--current", e.GroupButtonFloatingToolbar = r
}, function(t, e, i) {
    "use strict";

    function o() { var t = $("<select />"); return $('<option value="' + n.HHISTDIR_LEFTTORIGHT + '">' + $.t("Left") + "</option>").appendTo(t), $('<option value="' + n.HHISTDIR_RIGHTTOLEFT + '">' + $.t("Right") + "</option>").appendTo(t), t }
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17), i(28);
    var n = i(142);
    e.createHHistDirectionEditor = o
}, function(t, e, i) {
    "use strict";

    function o() { var t = $("<select>"); return $('<option value="open">' + $.t("Open") + "</option>").appendTo(t), $('<option value="high">' + $.t("High") + "</option>").appendTo(t), $('<option value="low">' + $.t("Low") + "</option>").appendTo(t), $('<option value="close">' + $.t("Close") + "</option>").appendTo(t), $('<option value="hl2">' + $.t("(H + L)/2") + "</option>").appendTo(t), $('<option value="hlc3">' + $.t("(H + L + C)/3") + "</option>").appendTo(t), $('<option value="ohlc4">' + $.t("(O + H + L + C)/4") + "</option>").appendTo(t), t }
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17), i(28), e.createPriceSourceEditor = o
}, function(t, e, i) {
    "use strict";

    function o() { return $('<select><option value="' + n.MARKLOC_ABOVEBAR + '">' + $.t("Above Bar") + '</option><option value="' + n.MARKLOC_BELOWBAR + '">' + $.t("Below Bar") + '</option><option value="' + n.MARKLOC_TOP + '">' + $.t("Top") + '</option><option value="' + n.MARKLOC_BOTTOM + '">' + $.t("Bottom") + '</option><option value="' + n.MARKLOC_ABSOLUTE + '">' + $.t("Absolute") + "</option></select>") }
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17), i(28);
    var n = i(142);
    e.createShapeLocationEditor = o
}, function(t, e, i) {
    "use strict";

    function o() {
        var t = "<select>";
        return Object.keys(n.plotShapesData).forEach(function(e) {
            var i = n.plotShapesData[e];
            t += '<option value="' + i.id + '">' + i.guiName + "</option>"
        }), t += "</select>", $(t)
    }
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17);
    var n = i(81);
    e.createShapeStyleEditor = o
}, function(t, e, i) {
    "use strict";

    function o() { return $('<input type="checkbox" class="visibility-switch"/>') }
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17), e.createVisibilityEditor = o
}, function(t, e) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 }), e.types = { ECONOMIC: "economic", QUANDL: "quandl" }
}, function(t, e, i) {
    "use strict";
    var o, n, s, r;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(73), n = i(124), s = i(218), r = function(t) {
            function e(e, i) {
                var o = this,
                    n = "Change Chart Layout to " + s.layouts[i].title;
                return o = t.call(this, n) || this, o._chartWidgetCollection = e, o._newLayoutId = i, o._oldLayoutId = e.layout.value(), o
            }
            return o.__extends(e, t), e.prototype.redo = function() { this._chartWidgetCollection.layout.setValue(this._newLayoutId) }, e.prototype.undo = function() { this._chartWidgetCollection.layout.setValue(this._oldLayoutId) }, e
        }(n.UndoCommand),
        e.SetChartLayoutCommand = r
}, function(t, e, i) {
    "use strict";
    var o, n, s;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(73), n = i(124), s = function(t) {
        function e(e, i, o) { var n = t.call(this, o) || this; return n._wv = e, n._newValue = i, n._oldValue = e.value(), n }
        return o.__extends(e, t), e.prototype.redo = function() { this._wv.setValue(this._newValue) }, e.prototype.undo = function() { this._wv.setValue(this._oldValue) }, e
    }(n.UndoCommand), e.SetWatchedValueCommand = s
}, 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;
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17), n = i(125), 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(), i.off("mouseleave mousedown", t) }
            var e, i = $(this);
            i[0].offsetWidth + s >= i[0].scrollWidth || (e = "", e = i.is(".apply-overflow-tooltip--allow-text") ? i.text() : i.clone().children().remove().end().text().trim(), n.showOnElement(i[0], { text: e }), i.on("mouseleave mousedown", t))
        })
    })
}, function(t, e, i) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 });
    var o = i(745);
    e.Twitter = o.Twitter
}, function(t, e, i) {
    "use strict";
    var o;
    Object.defineProperty(e, "__esModule", { value: !0 }), o = i(746),
        function(t) {
            function e(t, e) { return "https://twitter.com/intent/tweet?&status=" + encodeURIComponent(i(t, o.getImageUrl(e))) }

            function i(t, e) { return TradingView.isCmeWidget ? e + " from cmegroup.com via @tradingview $" + t : "$" + t + " chart " + e + " via https://www.tradingview.com" }

            function n(t) {
                var i = 550,
                    o = 420,
                    n = open("about:blank", "snapshot_tweet", "scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=" + i + ",height=" + o + ",left=" + Math.round(screen.width / 2 - i / 2) + ",top=" + Math.round(screen.height / 2 - o / 2));
                return { onFailure: function() { n.close() }, onSuccess: function(i) { n.location.href = e(t, i) } }
            }
            t.getStatus = i, t.shareSnapshot = n
        }(e.Twitter || (e.Twitter = {}))
}, function(t, e) {
    "use strict";

    function i(t) { return window.location.protocol + "//" + window.location.host + "/x/" + t + "/" }
    Object.defineProperty(e, "__esModule", { value: !0 }), e.getImageUrl = i
}, function(t, e, i) {
    "use strict";

    function o(t, e, o) {
        function n(o) {
            var n, s = "";
            s = l.enabled("charting_library_base") ? (e.snapshotUrl ? "" : "https://www.tradingview.com/x/") + o : window.location.protocol + "//" + window.location.host + "/x/" + o + "/", _.attr({ href: s }), f.attr("data-clipboard-text", s), m.val(s), p.stop(), u.css({ visibility: "visible" }), setTimeout(function() {
                var t = m.get(0);
                t.focus && t.focus(), t.select && t.select()
            }), n = h.Twitter.getStatus(t.activeChartWidget.value().symbolProperty().value(), s), $('<a class="twitter-share-button _tv-dialog-social _tv-dialog-social-twitter"></a>').attr({ href: "https://twitter.com/share?count=none&text=" + encodeURIComponent(n) + "&url=%20", rel: "nofollow" }).appendTo(v), $('<script src="//platform.twitter.com/widgets.js"><\/script>').appendTo(v), i.e(2, function(t) {
                var e = i(389),
                    o = new e(f[0]);
                o.on("success", function() {
                    TradingView.trackEvent("GUI", "Copied Image Link"),
                        TVDialogs.showMessage($.t("Copied to clipboard"))
                }), o.on("error", function() { TVDialogs.showMessage($.t("Sorry, the Copy Link button doesn't work in your browser. Please select the link and copy it manually.")) })
            })
        }
        var c, d, p, u, _, f, m, g, v;
        void 0 === e && (e = {}), TVDialogs.createModalDialog($.t("Image URL"), { addClass: "_tv-dialog-min-width" }), c = TVDialogs.modalDialog, d = c.find("._tv-dialog-content"), p = r.unifiedSpinner("mini").spin(d.get(0)), u = $('<div class="main tv-text">').css({ visibility: "hidden" }).appendTo(d), _ = $("<a>").text($.t("Save image")).attr({ target: "_blank" }).css("text-decoration", "underline"), f = $('<span class="copy-clipboard-button _tv-button">' + $.t("Copy link") + "</span>"), m = $("<input>").attr({ readonly: !0, type: "text" }).bind("click focus", function() {
            var t = this;
            t.select && t.select()
        }), $("<p>").appendTo(u).append(_, " " + $.t("or copy url:")), g = $('<form class="copy-image-url">').append(f, m), $("<p>").css({ position: "relative" }).appendTo(u).append(g), v = $('<p class="_tv-dialog-socials">').appendTo(u), TVDialogs.positionDialog(), TVDialogs.applyHandlers(), a.trackEvent("GUI", "Get image button"), s.takeSnapshot(t, function(t) { o && o(t), n(t) }, function() { p.stop(), TVDialogs.showError($.t("URL cannot be received"), c) }, { onWidget: t.onWidget, snapshotUrl: e.snapshotUrl })
    }

    function n(t, e, i) { s.takeSnapshot(t, function(t) { i && i(t) }, function() { console.warn($.t("Error while trying to create snapshot.")) }, { snapshotUrl: e.snapshotUrl }) }
    var s, r, a, l, h;
    Object.defineProperty(e, "__esModule", { value: !0 }), i(17), i(28), s = i(361), r = i(127), a = i(33), l = i(3), h = i(744), e.getImageOfChart = o, e.getImageOfChartSilently = n
}, function(t, e, i) {
    "use strict";

    function o(t) { return n.createDialog(Object.assign({}, a, t)) }
    var n, s, r, a;
    Object.defineProperty(e, "__esModule", { value: !0 }), i(28), n = i(71), s = { key: 13, name: "yes", text: $.t("Yes"), type: "success" }, r = { method: "close", name: "no", text: $.t("No"), type: "default" }, a = { actions: [s, r], actionsWrapTemplate: '<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">', content: $.t("Are you sure?"), contentWrapTemplate: '<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text"><p></p></div></div>', destroyOnClose: !0, title: $.t("Confirmation"), width: 400 }, e.createConfirmDialog = o
}, function(t, e, i) {
    "use strict";

    function o(t) { var e = t.type || "popup"; return delete t.type, "modal" === e ? new n.TVModal(t) : new s.TVPopup(t) }
    var n, s;
    Object.defineProperty(e, "__esModule", { value: !0 }), n = i(750), s = i(751), e.createDialog = o
}, function(t, e, i) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 });
    var o = i(544);
    e.TVModal = o.TVModal, e.isOpenedModals = o.isOpenedModals
}, function(t, e, i) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 });
    var o = i(545);
    e.TVPopup = o.TVPopup
}, function(t, e) {
    "use strict";

    function i() {
        return "www.tradingview.com" === location.host || "dwq4do82y8xi7.cloudfront.net" === location.host || "s.tradingview.com" === location.host || "i18n.tradingview.com" === location.host || "new.tradingview.com" === location.host || location.host.match(/^[a-z]{2}\.tradingview\.com/) || location.host.match(/\w+-new\.tradingview.com/) || location.host.match(/proxy\d.tradingview.com/) || location.host.match(/prod-[^.]+.tradingview.com/) ? "battle" : -1 !== location.href.indexOf("tradingview.com") ? "staging" : location.host.match(/webcharts/) ? "staging_local" : (location.host.match(/^localhost(:\d+)?$/), "local")
    }

    function o() { return "local" === i() }

    function n() { return "battle" === i() }

    function s() { return !n() }
    Object.defineProperty(e, "__esModule", { value: !0 }), e.environment = i, e.isLocal = o, e.isProd = n, e.isDebug = s
}, function(t, e) {
    "use strict";
    Object.defineProperty(e, "__esModule", { value: !0 }), e.breakpoints = { desktop: 1 / 0, phone: 767, "phone-vertical": 479, tablet: 1019 }
}, function(t, e, i) {
    "use strict";
    var o, n, s, r, a, l, h, c, d, p;
    Object.defineProperty(e, "__esModule", { value: !0 }), i(520), i(384), i(105), o = i(54), n = i(755), s = i(15), r = i(224), a = i(383), l = i(69),
        function(t) { t[t.Left = 0] = "Left", t[t.Right = 1] = "Right" }(h || (h = {})), c = { 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" }, d = { leftArrow: r, rightArrow: a }, p = function() {
            function t(t, e, i) { void 0 === i && (i = {}), this._animating = !1, this._bindings = [], this._options = n.deepExtend({}, c, i), this.tabChanged = new s, 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._elArrowLeft = this._findOrCreateElement(this._options.lArrowClass || "", this._elTabs, "append", '<div class="' + (this._options.lArrowClass || "") + ' i-slided">' + d.leftArrow + "</div>"), this._elArrowRight = this._findOrCreateElement(this._options.rArrowClass || "", this._elTabs, "append", '<div class="' + (this._options.rArrowClass || "") + ' i-slided">' + d.rightArrow + "</div>"), this._options.noSlider || (this._elSlider = this._findOrCreateElement(this._options.sliderClass || "", this._elScrollBox, "append")), this._addClass(this._elArrowLeft, this._options.addLeftArrowsClass), this._addClass(this._elArrowRight, this._options.addRightArrowsClass), this._addClass(this._elScrollBox, this._options.addScrollBoxClass), this._addClass(this._elTabs, this._options.tabsContainerClass), this._addClass(this.getTabsArray(), this._options.tabClass), this._addClass(this._elTabs, this._options.loadedClass), "string" == typeof this._options.sliderMod && this._addClass(this._elSlider, this._options.sliderClass + "--" + this._options.sliderMod), this.checkScrollArrows(!0), this._initActivePage(), this._bindEvents() }
            return t.prototype.getTabsArray = function() {
                var t, e, i, o = this._elScrollBox.children;
                if (!this._options.sliderClass) return Array.prototype.slice.call(o);
                for (t = [], e = 0; e < o.length; e++) i = o[e], i.classList.contains(this._options.sliderClass) || t.push(i);
                return t
            }, t.prototype.getPagesArray = function() { return this._elPages ? Array.prototype.slice.call(this._elPages.children) : [] }, t.prototype.getElTabs = function() { return this._elTabs }, t.prototype.getElPages = function() { return this._elPages }, t.prototype.checkScrollArrows = function(t) {
                function e(t) { t.classList.remove("i-slided"), $.Velocity.animate(t, { translateX: "0%" }, { duration: o.dur / 2, easing: "easeOutCubic", queue: !1 }) }

                function i(e, i) {
                    if (t) return e.classList.add("i-slided"), void e.setAttribute("style", "");
                    var n = i === h.Left ? "-100%" : "100%";
                    $.Velocity.animate(e, { translateX: n }, { complete: function() { return e.classList.add("i-slided") }, duration: o.dur / 2, easing: "easeOutCubic", queue: !1 })
                }
                var n, s, r, a;
                void 0 === t && (t = !1), n = this._elScrollWrap.scrollLeft, s = this._getElWidth(this._elScrollWrap), r = 10, a = this._elScrollWrap.scrollWidth - s - 20, n >= r ? e(this._elArrowLeft) : (n <= r || this._elScrollWrap.scrollWidth <= s) && i(this._elArrowLeft, h.Left), n <= a ? e(this._elArrowRight) : (n >= a || this._elScrollWrap.scrollWidth <= s) && i(this._elArrowRight, h.Right)
            }, t.prototype.index = function() { var t = this.getElActiveTab(); return t ? this.getTabsArray().indexOf(t) : -1 }, t.prototype.getElActiveTab = function() { return this._getActiveElement(this.getTabsArray(), this._options.activeTabClass || "", this._options.inactiveTabClass) }, t.prototype.getElActivePage = function() { return this._getActiveElement(this.getPagesArray(), this._options.activePageClass || "", this._options.inactivePageClass) }, t.prototype.setActivePage = function(t, e, i) {
                function o(e, i, o) {
                    e.forEach(function(e, n) {
                        var s = t === n,
                            r = e.classList;
                        i && r.toggle(i, s), o && r.toggle(o, !s)
                    })
                }
                if (-1 !== t && (t !== this.index() || i)) {
                    var n = this.index();
                    o(this.getTabsArray(), this._options.activeTabClass, this._options.inactiveTabClass), o(this.getPagesArray(), this._options.activePageClass, this._options.inactivePageClass), this._options.noSlider || this.updateSlider(n, t, e), this._options.saveTab && l.setValue(this._options.saveTab, t), this.tabChanged.fire(t)
                }
            }, t.prototype.updateSlider = function(t, e, i) {
                var n, s, r, a, l, h, c = this;
                this._options.noSlider || (n = this.getTabsArray()[e], 0 === n.clientWidth || 0 === n.clientHeight || "none" === window.getComputedStyle(n).getPropertyValue("display") || (s = window.getComputedStyle(n), r = n.offsetLeft + parseInt(s.getPropertyValue("padding-left")), a = this._getElWidth(n), l = n.querySelector(".js-tabs__slider-pos"), l && (h = window.getComputedStyle(l), r += parseInt(h.getPropertyValue("padding-left")) + l.offsetLeft, a -= a - this._getElWidth(l)), i = i || -1 === t || document.all && !window.atob, i ? (this._elSlider.style.left = r + "px", this._elSlider.style.width = a + "px") : (this._animating = !0, $.Velocity.animate(this._elSlider, { left: r }, { duration: o.dur, easing: "easeOutCubic", queue: !1 }), $.Velocity.animate(this._elSlider, { width: a }, { complete: function() { c._animating = !1 }, duration: o.dur, easing: "easeOutCubic", queue: !1 }))))
            }, t.prototype.onTabClick = function(t) {
                var e = t.currentTarget || t.target,
                    i = this.getTabsArray().indexOf(e); - 1 === i || this._isTabDisabled(e) || this.setActivePage(i), document.activeElement.blur(), t.preventDefault()
            }, t.prototype.resizeSlider = function() {
                var t, e;
                this._options.noSlider || (t = this._elTabs.offsetWidth) !== this._prevWidth && (this._prevWidth = t, e = this.index(), this.updateSlider(e, e, !0))
            }, t.prototype.count = function() { return this.getTabsArray().length }, t.prototype.add = function(t, e) { this._elScrollBox.appendChild(t), this._elPages && e && this._elPages.appendChild(e), this._bindTabEvents(t), this.checkScrollArrows(!0) }, t.prototype.remove = function(t) {
                function e(t) { t.parentElement && t.parentElement.removeChild(t) }
                var i, o, n = this.tabAt(t);
                n && (this._unbindTabEvents(n), e(n)), i = this.pageAt(t), i && e(i), o = t - 1 >= 0 ? t - 1 : 0, this.setActivePage(o), this.checkScrollArrows(!0)
            }, t.prototype.indexOfTab = function(t) { return this.getTabsArray().indexOf(t) }, t.prototype.indexOfPage = function(t) { return this.getPagesArray().indexOf(t) }, t.prototype.pageAt = function(t) { return this.getPagesArray()[t] || null }, t.prototype.tabAt = function(t) { return this.getTabsArray()[t] || null }, t.prototype.deselect = function(t) { var e, i = this.getElActiveTab(); return this._options.activeTabClass && i && i.classList.remove(this._options.activeTabClass), e = this.getElActivePage(), this._options.activePageClass && e && e.classList.remove(this._options.activePageClass), this._elSlider && (this._elSlider.style.left = "", this._elSlider.style.width = ""), this }, t.prototype.stop = function() { this._unbindEvents({}) }, t.prototype._getElWidth = function(t) { if (0 === t.offsetWidth) return 0; var e = window.getComputedStyle(t); return t.offsetWidth - parseFloat(e.getPropertyValue("padding-left")) - parseFloat(e.getPropertyValue("padding-right")) - parseFloat(e.getPropertyValue("border-left-width")) - parseFloat(e.getPropertyValue("border-right-width")) }, t.prototype._findOrCreateElement = function(t, e, i, o) {
                var n, s, r, a = e.querySelector("." + t);
                if (!a)
                    if (n = document.createElement("div"), n.innerHTML = o || '<div class="' + t + '"></div>', a = n.firstElementChild, "append" === i) e.appendChild(a);
                    else {
                        if ("wrapInner" !== i) throw Error("Unknown insertMethod");
                        for (s = Array.prototype.slice.call(e.childNodes), r = 0; r < s.length; r++) a.appendChild(s[r]);
                        e.appendChild(a)
                    }
                return a
            }, t.prototype._addClass = function(t, e) {
                if ("string" == typeof e) {
                    Array.isArray(t) || (t = [t]);
                    var i = e.split(/\s+/);
                    t.forEach(function(t) { i.forEach(function(e) { t.classList.add(e) }) })
                }
            }, t.prototype._initActivePage = function() {
                var t, e = 0;
                this._options.saveTab && (e = l.getInt(this._options.saveTab, 0)), t = this.index(), -1 !== t && (e = t), void 0 !== this._options.activeTab && (e = this._options.activeTab), this.setActivePage(e, !0, !0)
            }, t.prototype._bindEvents = function() {
                var t, e = this;
                this.getTabsArray().forEach(this._bindTabEvents.bind(this)), this._bindOneEvent({ eventName: "scroll", listener: this.checkScrollArrows.bind(this, !1), target: this._elScrollWrap }), this._bindOneEvent({
                    eventName: "click",
                    listener: function(t) {
                        var i = e.getTabsArray(),
                            n = 0,
                            s = !1,
                            r = e._elScrollWrap.scrollLeft;
                        i.forEach(function(t) {
                                if (!s) {
                                    var e = t.offsetLeft + t.offsetWidth;
                                    e > r ? s = !0 : n = e
                                }
                            }),
                            $.Velocity.animate(e._elScrollWrap, "scroll", { axis: "x", container: $(e._elScrollWrap), duration: o.dur / 2, easing: "easeInOutCubic", offset: Math.floor(n - r - e._getElWidth(e._elArrowLeft)), queue: !1 })
                    },
                    target: this._elArrowLeft
                }), this._bindOneEvent({
                    eventName: "click",
                    listener: function(t) {
                        var i = e.getTabsArray(),
                            n = 0,
                            s = e._elScrollWrap.scrollLeft + e._getElWidth(e._elScrollWrap);
                        i.forEach(function(t) {
                            if (0 === n) {
                                var e = t.offsetLeft + t.offsetWidth;
                                e > s && (n = e)
                            }
                        }), $.Velocity.animate(e._elScrollWrap, "scroll", { axis: "x", container: $(e._elScrollWrap), duration: o.dur / 2, easing: "easeInOutCubic", offset: Math.ceil(n - s + e._getElWidth(e._elArrowRight)), queue: !1 })
                    },
                    target: this._elArrowRight
                }), t = Array.prototype.slice.call(this._elTabs.querySelectorAll(".js-tabs__slider-hover") || []), t.length && t.forEach(function(t) {
                    return e._bindOneEvent({
                        eventName: "mouseenter",
                        listener: function(t) {
                            if (!e._animating) {
                                var i = t.currentTarget;
                                i && e._options.activeTabClass && i.classList && i.classList.contains(e._options.activeTabClass) && e._hoverSlider(i)
                            }
                        },
                        target: t
                    })
                }), this._bindOneEvent({ eventName: "resize", listener: function() { e.checkScrollArrows(!0), e._options.noSlider || e.resizeSlider() }, target: window })
            }, t.prototype._bindTabEvents = function(t) {
                var e = this;
                this._bindOneEvent({ eventName: Modernizr.touch ? "touchend" : "click", listener: function(t) { "function" == typeof e._options.onTabClick ? e._options.onTabClick(t) : e.onTabClick(t) }, target: t })
            }, t.prototype._unbindTabEvents = function(t) { this._unbindEvents({ target: t }) }, t.prototype._bindOneEvent = function(t) { t.target.addEventListener(t.eventName, t.listener), this._bindings.push(t) }, t.prototype._unbindEvents = function(t) {
                var e = function(e) { return !(void 0 !== e.eventName && e.eventName !== t.eventName || void 0 !== e.target && e.target !== t.target || void 0 !== e.listener && e.listener !== t.listener) };
                this._bindings.filter(e).forEach(function(t) { return t.target.removeEventListener(t.eventName, t.listener) }), this._bindings = this._bindings.filter(function(t) { return !e(t) })
            }, t.prototype._getActiveElement = function(t, e, i) { var o = function(t, o, n) { return e ? t.classList.contains(e) : !!i && !t.classList.contains(i) }; return t.filter(o)[0] || null }, t.prototype._isTabDisabled = function(t) { return t.classList.contains("i-disabled") || this._options.tabDisabledClass && t.classList.contains(this._options.tabDisabledClass) || t.hasAttribute("disabled") }, t.prototype._hoverSlider = function(t) {
                var e, i = this,
                    n = this._getElWidth(t),
                    s = window.getComputedStyle(t),
                    r = t.offsetLeft + parseInt(s.getPropertyValue("padding-left")) + parseInt(s.getPropertyValue("margin-left")),
                    a = { duration: o.dur / 4, easing: "easeOutCubic", queue: !1 };
                $.Velocity.animate(this._elSlider, { left: r }, a), $.Velocity.animate(this._elSlider, { width: n }, a), e = function() { i.getElActiveTab() === t && i._unhoverSlider(t), t.removeEventListener("mousleave", e) }, t.addEventListener("mouseleave", e)
            }, t.prototype._unhoverSlider = function(t) {
                var e = window.getComputedStyle(t),
                    i = t.querySelector(".js-tabs__slider-pos"),
                    n = window.getComputedStyle(i),
                    s = t.offsetLeft + parseInt(e.getPropertyValue("padding-left")) + parseInt(e.getPropertyValue("margin-left")) + parseInt(n.getPropertyValue("padding-left")) + i.offsetLeft,
                    r = this._getElWidth(t),
                    a = r - (r - this._getElWidth(i)),
                    l = { duration: o.dur / 2, easing: "easeInSine", queue: !1 };
                $.Velocity.animate(this._elSlider, { left: s }, l), $.Velocity.animate(this._elSlider, { width: a }, l)
            }, t
        }(), e.Tabs = p
}, function(t, e) {
    "use strict";

    function i(t) {
        var e, n = [];
        for (e = 1; e < arguments.length; e++) n[e - 1] = arguments[e];
        return t && "object" == typeof t ? 0 === n.length ? t : (n.forEach(function(e) {
            void 0 !== e && null !== e && "object" == typeof e && Object.keys(e).forEach(function(n) {
                var s, r, a = t[n],
                    l = e[n];
                l === t || (s = Array.isArray(l), l && (o(l) || s) ? (r = void 0, r = s ? a && Array.isArray(a) ? a : [] : a && o(a) ? a : {}, t[n] = i(r, l)) : void 0 !== l && (t[n] = l))
            })
        }), t) : t
    }

    function o(t) { var e, i, o; return !(!t || "[object Object]" !== Object.prototype.toString.call(t)) && (!(e = Object.getPrototypeOf(t)) || (i = Object.hasOwnProperty.toString, "function" == typeof(o = e.hasOwnProperty("constructor") && e.constructor) && i.call(o) === i.call(Object))) }
    Object.defineProperty(e, "__esModule", { value: !0 }), e.deepExtend = i
}, function(t, e, i) {
    "use strict";
    var o, n;
    i(17), 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";
    Object.defineProperty(e, "__esModule", { value: !0 });
    var o = i(376);
    o.addTranslationFunctionToWindow(o.translationFunction), o.addTranslationFunctionToJQuery(o.translationFunction)
}, , , function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M25.3 19L22.5 8H24V4h-4v4h1.3l-4 4h-2.4L12 7.6V4H8v4h1.5L5.7 23H4v4h4v-3.4l6.8-7.6h2.798L23 19.9V23h4v-4zM9 7V5h2v2zM7.003 26H5v-2h2v2zM14 15.4L7.2 23h-.397L10.5 8.102l-.498-.098h1.1l2.898 4.4zm3-.4h-2v-2h2zm4-8V5h2v2zm-3.002 8.102v-2.4l3.698-3.697L24.2 19h-.8zM26 22h-2v-2h2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M21 3v1.975l-9 4.91V9H8v4h1.34L7.648 24H6v4h4v-1.975l9-4.91V22h4v-4h-1.34l1.692-11H25V3zm1 1h2v2h-2zm-1 2.115V7h1.34l-1.692 11h-1.12L12 12.145v-1.12zM9 10h2v2H9zm1.352 3h1.12L19 18.855v1.12l-9 4.91V24H8.66zM20 19h2v2h-2zM7 25h2v2H7z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M455.1 285.4C310.8 141.1 110.9 106.7 4.2 206l23.2 23.3c.2-.2.5-.4.8-.6l483.7 483.7c-.2.3-.4.5-.6.8l23.2 23.2c99.3-106.8 64.9-306.7-79.4-451zm76.2 400.1L55 209.2c98.3-58.6 256.8-19.5 376.3 100s158.7 278.1 100 376.3z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M21 5v3.302l-5.598 2.3 1.7 1.702L9.298 20H6v4h4v-3.298l7.7-7.7 1.5 1.5 2.3-5.4.102-.1L25 9V5zM9 23H7v-2h2zM24 8l-1.9-.002.1-.2-.202.1L22 6h2z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9" class="text"><path d="M16 27l10-13h-6V6h-8v8H6l10 13zm0-1.5L8 15h5V7h6v8h5l-8 10.5z"/><path d="M16 25.5L8 15h5V7h6v8h5z" opacity=".3"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9" class="text"><path d="M5 16l13 10v-6h8v-8h-8V6L5 16zm1.5 0L17 8v5h8v6h-8v5L6.5 16z"/><path d="M6.5 16L17 8v5h8v6h-8v5z" opacity=".3"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9" class="text"><path d="M26 16L13 6v6H5v8h8v6l13-10zm-1.5 0L14 24v-5H6v-6h8V8l10.5 8z"/><path d="M24.5 16L14 24v-5H6v-6h8V8z" opacity=".3"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9" class="text"><path d="M15 5L5 18h6v8h8v-8h6L15 5zm0 1.5L23 17h-5v8h-6v-8H7l8-10.5z"/><path d="M15 6.5L23 17h-5v8h-6v-8H7z" opacity=".3"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9" class="text"><path fill-opacity=".2" d="M139.9 488.7H134c-64.3-2.9-113.9-55.5-113.9-116.9 0-64.3 55.5-116.9 122.7-116.9h309.7c67.2 0 122.7 52.6 122.7 116.9s-55.5 116.9-122.7 116.9H224.6v93.5l-84.7-93.5z"/><path d="M452.5 269.5c58.4 0 108.1 46.7 108.1 102.3s-49.7 102.3-108.1 102.3H210v70.1l-55.5-61.4-8.8-8.8H134c-55.5-2.9-99.3-49.7-99.3-102.3 0-55.5 49.7-102.3 108.1-102.3h309.7m0-29.1H142.8c-76 0-137.3 58.4-137.3 131.5 0 70.1 58.4 125.6 128.6 131.5l105.2 116.9V503.3h213.3c76 0 137.3-58.4 137.3-131.5s-61.4-131.5-137.4-131.5z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M17 4v2h-1v11h1v6h1v-6h1V6h-1V4zm8 0v2h-1v11h1v6h1v-6h1V6h-1V4zM4 5v2H3v11h1v6h1v-6h1V7H5V5zm9 0v2h-1v11h1v6h1v-6h1V7h-1V5zM8 7v6H7v11h1v2h1v-2h1V13H9V7zm9 0h1v9h-1zm8 0h1v9h-1zM4 8h1v9H4zm9 0h1v9h-1zm8 0v3h-1v11h1v2h1v-2h1V11h-1V8zm0 4h1v9h-1zM8 14h1v9H8z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M23 3v4h1.447c-.458.96-3.4 6.5-10.447 6.5-4.187 0-6.633 2.41-7.938 4.758-1.304 2.35-1.558 4.687-1.558 4.687L5 23H3v4h4v-4H5.504c.018-.15.282-2.186 1.434-4.258C8.133 16.592 10.188 14.5 14 14.5c8.292 0 11.46-7.303 11.46-7.303L25 7h2V3h-4zm1 1h2v2h-2V4zM4 24h2v2H4v-2z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M23 3v1.5c-9.658 0-14.39 4.657-16.576 9.287C4.256 18.377 4.496 22.922 4.5 23H3v4h4v-4H5l.5-.027s-.237-4.39 1.826-8.76C9.39 9.843 13.658 5.5 23 5.5V7h4V3zm1 1h2v2h-2zM4 24h2v2H4z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M377.6 283.1s-136.2-10.2-183.8 170.2c-30.6 115.7-177 251.9-177 251.9l10.2 17s224.7-54.5 360.8-139.6c177-112.3 64.7-255.3 64.7-255.3l-74.9-44.2zm44.3-143L374.2 249l122.5 68.1 78.3-88.5-153.1-88.5z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9" class="text"><path fill-opacity=".2" d="M179.9 462.6h-42.1c-25.9 0-48.6-22.7-48.6-48.6V284.6c0-25.9 22.7-48.6 48.6-48.6h388.5c25.9 0 48.6 22.7 48.6 48.6v129.5c0 25.9-22.7 48.6-48.6 48.6H264L56.9 605.1l123-142.5z"/><path d="M526.3 252.2c19.4 0 32.4 12.9 32.4 32.4v129.5c0 19.4-12.9 32.4-32.4 32.4H257.6l-9.7 6.5-97.1 64.7 16.2-16.2 45.3-55h-74.5c-19.4 0-32.4-12.9-32.4-32.4V284.6c0-19.4 12.9-32.4 32.4-32.4h388.5m0-32.4H137.8c-35.6 0-64.7 29.1-64.7 64.7V414c0 35.6 29.1 64.7 64.7 64.7h6.5L1.8 640.7H31l233-161.9h259c35.6 0 64.7-29.1 64.7-64.7V284.6c3.3-35.6-25.8-64.8-61.4-64.8z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M7 4v22h1V4H7zm5 0v22h1V4h-1zm5 0v22h1V4h-1zm5 0v22h1V4h-1z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M25.3 19L22.5 8H24V4h-4v4h1.3l-4 4h-2.4L12 7.6V4H8v4h1.5L5.7 23H4v4h4v-3.4l6.8-7.6h2.798L23 19.9V23h4v-4zM9 7V5h2v2zM7.003 26H5v-2h2v2zM14 15.4L7.2 23h-.397L10.5 8.102l-.498-.098h1.1l2.898 4.4zm3-.4h-2v-2h2zm4-8V5h2v2zm-3.002 8.102v-2.4l3.698-3.697L24.2 19h-.8zM26 22h-2v-2h2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M10 4v1h9V4zm4.5 1l-3.387 5H14v5H5v-4H4v9h1v-4h9v9h-4v1h9v-1h-4v-9h4.5v3l5.5-3.5-5.5-3.5v3H15v-5h3.113zM25 15.5V20h1v-9h-1z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M4 10v11h1v-5h15v3l5-3.5-5-3.5v3H5v-5H4zm21 5.5V21h1V10h-1v5.5z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M22 3v2.047L9 10.352V10H5v4h4v-2.566l13-5.307V7h4V3zm1 1h2v2h-2zM6 11h2v2H6zm-1 6v4h4v-.783l13 5.2V28h4v-4h-4v.34l-13-5.2V17zm1 1h2v2H6zm17 7h2v2h-2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M10.943 9.127c-1.294 0-2.347 1.06-2.347 2.35s1.058 2.347 2.347 2.347c1.29 0 2.348-1.058 2.348-2.347 0-1.29-1.052-2.35-2.346-2.35zm14.805.707l-5.873 5.87.824.825 5.875-5.88-.828-.817zM8.125 13.357l-4.7 4.702.823.822 4.7-4.7-.823-.826zm5.637 0l-.823.825 2.346 2.347.822-.826-2.348-2.348zm4.23 2.82c-1.294 0-2.347 1.057-2.347 2.346 0 1.295 1.058 2.35 2.347 2.35 1.29 0 2.348-1.06 2.348-2.35.005-1.29-1.054-2.347-2.348-2.347z"/><path d="M6.593 11.064l-1-2.554h-3.22l-.988 2.554H.44L3.615 3H4.4l3.16 8.064h-.967zM5.303 7.67l-.935-2.49q-.18-.472-.373-1.158-.12.527-.347 1.16l-.944 2.487h2.598z"/><path d="M24.818 20.835q-1.323 0-2.092.884-.764.878-.764 2.41 0 1.577.736 2.44.742.857 2.11.857.84 0 1.917-.302v.818q-.835.313-2.06.313-1.775 0-2.74-1.076-.963-1.077-.963-3.06 0-1.242.462-2.175.467-.934 1.34-1.44.88-.505 2.065-.505 1.263 0 2.208.46l-.396.803q-.912-.428-1.824-.428z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M10.943 9.127c-1.294 0-2.347 1.06-2.347 2.35s1.058 2.347 2.347 2.347c1.29 0 2.348-1.058 2.348-2.347 0-1.29-1.052-2.35-2.346-2.35zm14.805.707l-5.873 5.87.824.825 5.875-5.88-.828-.817zM8.125 13.357l-4.7 4.702.823.822 4.7-4.7-.823-.826zm5.637 0l-.823.825 2.346 2.347.822-.826-2.348-2.348zm4.23 2.82c-1.294 0-2.347 1.057-2.347 2.346 0 1.295 1.058 2.35 2.347 2.35 1.29 0 2.348-1.06 2.348-2.35.005-1.29-1.054-2.347-2.348-2.347z"/><path d="M7.91 10.03h-.924l-1.62-5.377q-.116-.357-.26-.9-.142-.545-.147-.654-.122.724-.386 1.586l-1.57 5.345H2.08L-.056 2h.988l1.27 4.96q.263 1.044.384 1.89.148-1.005.44-1.967L4.463 2h.99l1.51 4.927q.263.852.445 1.923.103-.78.394-1.9L9.068 2h.988L7.91 10.03z"/><path d="M24.997 24l2.143-4.016h1.01L25.47 24.9v3.116h-.945v-3.07l-2.675-4.962h1.02L24.998 24z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M10.943 9.127c-1.294 0-2.347 1.06-2.347 2.35s1.058 2.347 2.347 2.347c1.29 0 2.348-1.058 2.348-2.347 0-1.29-1.052-2.35-2.346-2.35zm14.805.707l-5.873 5.87.824.825 5.875-5.88-.828-.817zM8.125 13.357l-4.7 4.702.823.822 4.7-4.7-.823-.826zm5.637 0l-.823.825 2.346 2.347.822-.826-2.348-2.348zm4.23 2.82c-1.294 0-2.347 1.057-2.347 2.346 0 1.295 1.058 2.35 2.347 2.35 1.29 0 2.348-1.06 2.348-2.35.005-1.29-1.054-2.347-2.348-2.347z"/><path d="M6 11.03h-.89V5.308q0-.714.044-1.35-.115.114-.258.24-.143.127-1.307 1.072l-.485-.628L5.23 3H6v8.03z"/><path d="M23.802 23.126q1.27 0 1.994.63.73.628.73 1.72 0 1.248-.796 1.956-.79.71-2.186.71-1.357 0-2.07-.435v-.88q.384.248.955.39.57.138 1.125.138.967 0 1.5-.456.538-.457.538-1.32 0-1.68-2.06-1.68-.522 0-1.395.16l-.473-.303.303-3.757h3.993v.84H22.75l-.204 2.412q.632-.126 1.258-.126z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M10.943 9.127c-1.294 0-2.347 1.06-2.347 2.35s1.058 2.347 2.347 2.347c1.29 0 2.348-1.058 2.348-2.347 0-1.29-1.052-2.35-2.346-2.35zm14.805.707l-5.873 5.87.824.825 5.875-5.88-.828-.817zM8.125 13.357l-4.7 4.702.823.822 4.7-4.7-.823-.826zm5.637 0l-.823.825 2.346 2.347.822-.826-2.348-2.348zm4.23 2.82c-1.294 0-2.347 1.057-2.347 2.346 0 1.295 1.058 2.35 2.347 2.35 1.29 0 2.348-1.06 2.348-2.35.005-1.29-1.054-2.347-2.348-2.347z"/><path d="M7.593 10.064l-1-2.554h-3.22l-.988 2.554H1.44L4.615 2H5.4l3.16 8.064h-.967zM6.303 6.67l-.935-2.49q-.18-.472-.373-1.158-.12.527-.347 1.16l-.944 2.487h2.598z"/><path d="M25.477 28.03H21V20h4.477v.83h-3.543v2.587h3.33v.824h-3.33v2.956h3.543v.835z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M10.943 9.127c-1.294 0-2.347 1.06-2.347 2.35s1.058 2.347 2.347 2.347c1.29 0 2.348-1.058 2.348-2.347 0-1.29-1.052-2.35-2.346-2.35zm14.805.707l-5.873 5.87.824.825 5.875-5.88-.828-.817zM8.125 13.357l-4.7 4.702.823.822 4.7-4.7-.823-.826zm5.637 0l-.823.825 2.346 2.347.822-.826-2.348-2.348zm4.23 2.82c-1.294 0-2.347 1.057-2.347 2.346 0 1.295 1.058 2.35 2.347 2.35 1.29 0 2.348-1.06 2.348-2.35.005-1.29-1.054-2.347-2.348-2.347z"/><path d="M8.91 9.03h-.924l-1.62-5.377q-.116-.357-.26-.9-.142-.545-.147-.654-.122.724-.386 1.586L4.004 9.03H3.08L.944 1h.988l1.27 4.96q.263 1.044.384 1.89.148-1.005.44-1.967L5.463 1h.99l1.51 4.927q.263.852.445 1.923.103-.78.394-1.9L10.068 1h.988L8.91 9.03z"/><path d="M27.52 28.03H22v-.73l4.263-6.46h-4.13V20H27.4v.73l-4.263 6.455h4.384v.846z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M13 5v1.557C10.26 6.84 7.792 7.69 5.887 8.95c-2.36 1.564-3.885 3.78-3.885 6.27 0 2.49 1.525 4.708 3.885 6.27 2.36 1.563 5.574 2.508 9.115 2.508 3.54 0 6.755-.945 9.115-2.508 2.36-1.562 3.885-3.78 3.885-6.27 0-2.49-1.525-4.706-3.885-6.27C22.21 7.69 19.743 6.84 17 6.558V5zm1 1h2v2h-2zm3 1.562c2.555.282 4.838 1.08 6.563 2.223C25.727 11.218 27 13.14 27 15.22c0 2.082-1.273 4-3.438 5.434-2.164 1.433-5.198 2.342-8.56 2.342s-6.398-.91-8.563-2.342C4.27 19.22 3 17.302 3 15.22c0-2.08 1.27-4 3.435-5.433 1.723-1.14 4.006-1.94 6.56-2.22V9h4z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M23.605 6.646l-4.34 4.34L16 11l-.014 3.307L13.293 17H10v3.293l-3.354 3.353.708.708L10.707 21H14v-3.293l2.67-2.67L20 15v-3.334l4.313-4.312zM17 12h2v2h-2zm-6 6h2v2h-2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M387.382 160.99L19.62 528.75 5.193 514.327l367.763-367.762zM399.6 195.6v67.3l-259 259H73.2v81.6h81.6v-67.3l259-259h67.3v-81.6h-81.5zM134.4 583.1H93.6v-40.8h40.8v40.8zm326.3-326.3h-40.8V216h40.8v40.8zm114.2 73.4L426.1 481.1h-53l175.4-175.4-14.3-14.3-367.1 367.2 14.3 14.3 175.4-175.4v53l-151 150.9 14.3 14.3L371 564.8h69.3v-67.3l150.9-150.9-16.3-16.4zm-155 212.1h-40.8v-40.8h40.8v40.8zm88.53-257.64L162.304 630.787 147.88 616.36l346.125-346.124z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M297.6 362.3c-32.2 0-58.6 26.4-58.6 58.6s26.4 58.6 58.6 58.6 58.6-26.4 58.6-58.6-26.3-58.6-58.6-58.6zm0 87.9c-17.6 0-29.3-14.7-29.3-29.3 0-17.6 14.7-29.3 29.3-29.3 17.6 0 29.3 14.7 29.3 29.3 0 17.6-11.7 29.3-29.3 29.3zm0-175.8c-79.1 0-146.5 64.5-146.5 146.5s64.5 146.5 146.5 146.5S444.2 503 444.2 420.9s-67.4-146.5-146.6-146.5zm0 263.8c-64.5 0-117.2-52.7-117.2-117.2s52.7-117.2 117.2-117.2S414.8 356.5 414.8 421s-52.7 117.2-117.2 117.2zm0-322.4c-114.3 0-205.1 90.8-205.1 205.1S183.3 626 297.6 626s205.1-90.8 205.1-205.1-90.8-205.1-205.1-205.1zm0 381c-96.7 0-175.8-79.1-175.8-175.8s79.1-175.8 175.8-175.8S473.4 324.3 473.4 421s-79.1 175.8-175.8 175.8zm0-468.9c-161.2 0-293 131.9-293 293s131.9 293 293 293 293-131.9 293-293-131.8-293-293-293zm0 556.8C151.1 684.7 33.9 567.5 33.9 421s117.2-263.7 263.7-263.7S561.3 274.5 561.3 421 444.2 684.7 297.6 684.7z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M4.3 642.1H591v-32.6H4.3v32.6zm0-195.6H591v-32.6H4.3v32.6zm0-228.1V251H591v-32.6H4.3z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M297.6 439.5c79 0 146.3-64.4 146.3-146.3h-29.3c0 64.4-52.7 117.1-117.1 117.1s-117.1-52.7-117.1-117.1h-29.3c.2 82 64.6 146.3 146.5 146.3zm0-87.7c32.2 0 58.5-26.3 58.5-58.5h-29.3c0 17.6-14.6 29.3-29.3 29.3s-29.3-14.6-29.3-29.3h-29.3c.2 32.1 26.5 58.5 58.7 58.5zm0 146.3c114.1 0 204.8-90.7 204.8-204.8h-29.3c0 96.6-79 175.6-175.6 175.6s-175.6-79-175.6-175.6H92.8c0 114.1 90.7 204.8 204.8 204.8zM561 293.2c0 146.3-117.1 263.4-263.4 263.4S34.3 439.5 34.3 293.2H5c0 161 131.7 292.6 292.6 292.6s292.6-131.7 292.6-292.6H561z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M14.04 3.303l-.788 1.838.92.4.787-1.84-.92-.39zM5 4.5V25h20.5v-1H21v-6.102l.182.424 1.838-.787-.393-.92-1.627.7v-7.61l2.854-2.852-.708-.708L20.293 9h-7.607l.7-1.627-.92-.393-.788 1.838.424.182H6V4.5H5zM6 10h13.293l-5 5h-4.178l.117-.273-.92-.395-.285.668H6v-5zm4.89.656l-.788 1.838.918.395.79-1.84-.92-.4zm9.11.05V24h-5v-3.027l.668-.286-.395-.92-.273.118v-4.178l5-5zm6.303 4.335l-1.838.79.394.92 1.83-.79-.4-.91zM6 16h2.6l-.075.172.92.392.242-.564h3.606l-6.31 6.31.1-.23-.92-.394-.163.378V16zm8 .707v3.605l-.564.243.392.92L14 21.4V24H7.936l.378-.162-.394-.92-.23.098 6.31-6.31zM7.738 18.01l-.79 1.838.92.394.788-1.84-.918-.392zm11.21.18l-1.837.79.4.918 1.84-.787-.39-.92zm-7.35 3.154l-1.84.787.394.92 1.838-.78-.392-.92z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M411.2 234c-83.058 0-152.1 69.043-152.1 152.1 0 17.915 3.948 35.028 11.01 50.504l-150.4 30.076c-12.193-30.528-18.91-63.825-18.91-98.68h-20c0 36.155 6.758 70.764 19.046 102.652l-95.88 19.174 5.06 25.3L110.48 494.84C157.367 589.342 254.892 654.5 367.3 654.5c126.89 0 232.2-102.785 232.2-232.2 0-103.637-84.663-188.3-188.3-188.3zm0 20c92.76 0 168.3 75.54 168.3 168.3 0 118.587-96.087 212.2-212.2 212.2-102.81 0-192.092-58.358-236.532-143.72l153.378-30.673c22.716 30.04 58.685 49.694 98.655 49.694 54.71 0 100.4-45.69 100.4-100.4 0-46.72-38.25-82.4-82.4-82.4v20c33.46 0 62.4 26.53 62.4 62.4 0 43.5-36.9 80.4-80.4 80.4-29.91 0-57.24-13.27-76.33-34.15l90.29-18.05-5.06-25.3-101.3 20.26c-7.21-14.045-11.3-29.85-11.3-46.45 0-71.94 60.16-132.1 132.1-132.1z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M7 4v22h1V4zm5 0v22h1V4zm10 0v22h1V4z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M566.4 639.5C530.1 399.6 337.6 207.1 97.7 170.8v-33.5H14V221h27.9v418.5H14v83.7h83.7v-27.9h418.5v27.9h83.7v-83.7h-33.5zM41.9 165.2h27.9v27.9H41.9v-27.9zm27.9 530.1H41.9v-27.9h27.9v27.9zm27.9-27.9v-27.9H69.8v-106c67 16.7 117.2 67 133.9 133.9h-106zm133.9 0c-16.7-80.9-80.9-145.1-161.8-161.8v-83.7c125.5 22.3 223.2 120 245.5 245.5h-83.7zm111.6 0C320.9 527.9 209.3 416.3 69.8 394v-83.7c186.9 22.3 334.8 170.2 359.9 357.1h-86.5zm173 0h-58.6C432.5 466.5 270.7 304.7 69.8 279.6V221h27.9v-19.5c226 36.3 404.5 214.8 438 438h-19.5v27.9zm55.8 27.9h-27.9v-27.9H572v27.9z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9" class="text"><path d="M303.306 426.633v-241.3h189.7l-93.1 120.7 96.5 120.6zM276.9 399.2c-3.4-3.4-6.9-3.4-13.8-3.4H111.4V154.4h148.3c3.4 0 13.8 10.3 17.2 17.2zm-17.2-262.1H94.2V413h169c13.8 0 31 31 31 31V164.7s-13.8-27.6-34.5-27.6zm-172.4 0H52.8v586.2h34.5zm443.606 30.933h-241.4v275.9h241.4l-110.4-138z"/><path d="M107.02 155.182v244.363h172.126V155.182H107.02zm194.423 26.754v251.5h206.91l-108.81-127.534L508.35 181.936H301.44z" opacity=".2"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M22 4v2.87L7 13.048V13H3v4h4v-2.87l15-6.177V8h4V4h-4zm1 1h2v2h-2V5zM4 14h2v2H4v-2zm-1 8v4h4v-1.5h15V26h4v-4h-4v1.5H7V22H3zm1 1h2v2H4v-2zm19 0h2v2h-2v-2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M4 4v22h22V4zm2.12 1H11v.285l-.303.832c-.85-.32-1.644-.564-2.36-.74C7.474 5.167 6.76 5.065 6.12 5zm6.048 0H18v5.38c-2.16-1.71-4.19-2.907-6-3.72V5.465zM19 5h5.293L19 10.293zm6 .707V11h-5.293zM5 5.91c.69.014 1.72.102 3.098.44.68.167 1.44.4 2.257.71L8.922 11H5zm7 1.856c1.574.743 3.314 1.785 5.172 3.234H12zm-1 .45V11H9.986zM5 12h3.56l-2.183 6H5zm4.623 0H11v6H7.44zM12 12h5.293L12 17.293zm7.848 0H25v5.832l-.465.168h-.97c-.76-2.048-1.93-4.177-3.717-6zm-.848.574c1.636 1.63 2.735 3.547 3.473 5.426H19zm-1 .133V18h-5.293zM5 19h1.014L5 21.785zm2.078 0h3.215L5.24 24.053zM12 19h6v1.377l-6 2.182zm7 0h2.785L19 20.014zm5.715 0H25v6h-.04c-.048-1.186-.233-3.292-.97-5.736zm-1.68.61c.682 2.29.868 4.265.92 5.39H19v-3.922zM11 19.708v3.215L5.947 24.76zm7 1.734V25h-6v-1.377zm-7 2.546V25H8.215z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M14.04 3.303l-.788 1.838.92.4.787-1.84-.92-.39zM5 4.5V25h20.5v-1H7.936l.378-.162-.394-.92-.23.098L23.855 6.854l-.708-.708L6.984 22.31l.098-.23-.92-.394-.162.378V4.5H5zm7.465 2.48l-.787 1.838.918.393.79-1.83-.92-.39zm-1.576 3.676l-.79 1.838.92.395.79-1.84-.92-.4zm-1.58 3.676l-.79 1.84.92.392.78-1.837-.92-.395zm16.99.71l-1.84.786.39.92 1.83-.79-.397-.917zm-3.68 1.573l-1.84.79.39.917 1.84-.787-.4-.92zM7.73 18.01l-.787 1.838.92.394.78-1.84-.918-.392zm11.213.18l-1.84.79.39.918 1.84-.787-.396-.92zm-3.68 1.578l-1.84.787.392.92 1.84-.788-.396-.92zm-3.678 1.576l-1.84.787.393.92 1.84-.78-.393-.92z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M5 5v20h20V5H5zm14 1h5v3h-5V6zm0 4h5v4h-5v-4zm-6-4h5v3h-5V6zm0 4h5v4h-5v-4zm5 5v5h-5v-5h5zM9 6h3v3H9V6zm0 4h3v4H9v-4zm3 5v5H9v-5h3zM6 6h2v3H6V6zm0 4h2v4H6v-4zm0 5h2v5H6v-5zm0 9v-3h2v3H6zm3 0v-3h3v3H9zm4 0v-3h5v3h-5zm11 0h-5v-3h5v3zm-5-4v-5h5v5h-5z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M17 5v2h-1v11h1v4h1v-4h1V7h-1V5zm8 3v2h-1v11h1v4h1v-4h1V10h-1V8zM4 11v2H3v11h1v2h1v-2h1V13H5v-2zm9-7v2h-1v11h1v3h1v-3h1V6h-1V4zM8 4v2H7v11h1v6h1v-6h1V6H9V4zm9 4h1v9h-1zm8 3h1v9h-1zm-4-3v3h-1v11h1v2h1v-2h1V11h-1V8zM8 7h1v9H8z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M13 0v4h1.06l-5.2 13h-.247l-3-6H7V7H3v4h.8l-1.958 8.242-1.91.262.136.992 1.526-.21L.236 26H0v4h4v-4H1.264l1.392-5.86L7 19.546V21h4v-2.002l7-.96V19h4v-1.512l4.043-.554L28.33 24H26v4h4v-4h-.617l-2.332-7.203 3.02-.414-.13-.992-3.19.44-1.9-5.83H26V6h-4v4h.99l-2.898 4.867L15.844 4H17V0zm1 1h2v2h-2zm.95 3.46L19.073 15H18v2.027l-7 .96V17H9.94zM23 7h2v2h-2zM4 8h2v2H4zm19.924 2.39l1.805 5.577-3.73.512V15h-.83zM4.72 11.452L7.495 17H7v1.535l-4.096.56zM21 16v2h-2v-2zm-11 2v2H8v-2zm17 7h2.18v2H27zM1.025 27H3v2H1v-1.893z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.999999 30.000001" width="30" height="30" enable-background="new 0 0 841.9 595.3"><path d="M3 17h4v-2h16v2h4v-4h-4v1H7v-1H3zm1-1v-2h2v2zm20 0v-2h2v2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.999999 30.000001" width="30" height="30" enable-background="new 0 0 841.9 595.3"><path d="M3 13v4h4v-2h21v-1H7v-1zm1 1h2v2H4z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M15.646 3.646L8.29 11.002l-.35.352.015 1.308L8.06 22v.006L18.294 22l8.06-7.646-.707-.708L18.293 21h-.586L15 18.293v-2.586l6.354-6.353-.708-.708L14.293 15h-2.586L8.89 12.184l-.003-.364 7.467-7.466zm-6.74 9.967L11 15.707v2.586l-2.02 2.02zM12 16h2v2h-2zm-.293 3h2.586l3 3H9z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9" class="text"><path fill-opacity=".2" fill-rule="evenodd" clip-rule="evenodd" d="M297.7 127.9c-127.1 0-230.1 101.6-230.1 227 0 118.4 104.2 240.4 173.8 314.7 26 27.8 56.3 44.2 56.3 44.2s32.5-16.7 60.4-45.3c69.5-71.3 169.6-183.5 169.6-313.7 0-125.2-103-226.9-230-226.9zm0 335c-57.8 0-104.6-46.8-104.6-104.6S240 253.7 297.7 253.7s104.6 46.8 104.6 104.6-46.8 104.6-104.6 104.6z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M297.7 232.8c-69.3 0-125.5 56.2-125.5 125.5s56.2 125.5 125.5 125.5 125.5-56.2 125.5-125.5-56.1-125.5-125.5-125.5zm0 230.1c-57.8 0-104.6-46.8-104.6-104.6S240 253.7 297.7 253.7s104.6 46.8 104.6 104.6-46.8 104.6-104.6 104.6zm0-335c-127.1 0-230.1 101.6-230.1 227 0 118.4 104.2 240.4 173.8 314.7 26 27.8 56.3 44.2 56.3 44.2s32.5-16.7 60.4-45.3c69.5-71.3 169.6-183.5 169.6-313.7 0-125.2-103-226.9-230-226.9zM352.6 651c-25.4 26.5-54.9 42-54.9 42s-27.5-15.3-51.2-41.1c-63.3-69.1-158-182.3-158-292.3 0-116.4 93.6-210.8 209.1-210.8s209.1 94.4 209.1 210.8c.1 121-90.9 225.2-154.1 291.4z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9" class="text"><path fill-opacity=".2" fill-rule="evenodd" clip-rule="evenodd" d="M184.1 270C86.7 270 7.7 349.2 7.7 447c0 92.3 79.9 187.4 133.2 245.4 19.9 21.6 43.1 34.5 43.1 34.5s24.9-13 46.3-35.3C283.7 636 360.5 548.5 360.5 447c0-97.8-79-177-176.4-177zm.1 277.5c-53.2 0-96.3-43.8-96.3-97.9 0-54.1 43.1-97.9 96.3-97.9s96.3 43.8 96.3 97.9c-.1 54-43.1 97.9-96.3 97.9z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M184.2 351.7c-53.2 0-96.3 43.8-96.3 97.9 0 54.1 43.1 97.9 96.3 97.9s96.3-43.8 96.3-97.9c-.1-54.1-43.1-97.9-96.3-97.9zm0 167.6c-40.1 0-72.7-32.5-72.7-72.7s32.5-72.7 72.7-72.7 72.7 32.5 72.7 72.7-32.6 72.7-72.7 72.7zm-.1-249.3C86.7 270 7.7 349.2 7.7 447c0 92.3 79.9 187.4 133.2 245.4 19.9 21.6 43.1 34.5 43.1 34.5s24.9-13 46.3-35.3C283.7 636 360.5 548.5 360.5 447c0-97.8-79-177-176.4-177zM225 674c-18.9 20.3-40.9 32.1-40.9 32.1s-20.5-11.7-38.1-31.4C99 622 28.5 535.6 28.5 451.7c0-88.9 69.7-160.9 155.7-160.9 85.9 0 155.6 72 155.6 160.9 0 92.2-67.8 171.8-114.8 222.3zm343.4-363.4h19.8c-7.1 47.4-54.7 84.1-113.1 84.1s-105.8-36.7-113-84.1h18.7c8.5 31.8 42.3 56.1 83.9 59.5V248.5h-60.4V228h60.4v-21.5c-12.4-4.2-21.5-15.5-21.5-29.2 0-17.2 14.2-31.2 31.7-31.2s31.7 14 31.7 31.2c0 13.9-9.4 25.3-22.2 29.3V228h59.7v20.5h-59.7v121.6c41.7-3.4 75.5-27.6 84-59.5zm-81.5-133.2c0-6.6-5.4-11.9-12.1-11.9s-12.1 5.3-12.1 11.9 5.4 11.9 12.1 11.9 12.1-5.4 12.1-11.9z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M17 4v3.293L7.293 17H4v4h4v-3.293L17.707 8H21V4zm1 1h2v2h-2zm7.646 4.646L19.293 16H16v3.293l-6.354 6.353.708.708 6.376-6.377L20 20l.014-3.307 6.34-6.34zM17 17h2v2h-2zM5 18h2v2H5z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M5 4v2H4v4h1v12H4v4h4v-1h12v1h4v-1h2v-1h-2v-2h-3.293l-2.816-2.816 9.3-3.72-.37-.93-9.69 3.878L14.71 16l9.646-9.646-.708-.708L14 15.293l-2.414-2.414 3.88-9.7-.93-.37-3.72 9.29L8 9.29V6H6V4zm0 3h2v2H5zm1 3h1.39l3.12 3.12L6.86 22H6zm5.184 3.89l2.11 2.11-4.925 4.924zM14 16.708l2.11 2.11-7.034 2.814zm2.88 2.88l3.12 3.12V24H8v-.86zM5 23h2v2H5zm16 0h2v2h-2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M15.646 3.646L7.293 12 11 15.707v2.586l-7.354 7.353.708.708L11.707 19h2.586L18 22.707l8.354-8.353-.708-.708L18 21.293l-3-3v-2.586l6.354-6.353-.708-.708L14.293 15h-2.586l-3-3 7.647-7.646zM12 16h2v2h-2z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M22 4v1H11.793L5 11.793V22H4v4h4v-1h8.207L20 20.707V17h5V8h1V4zm1 1h2v2h-2zM12.207 6H22v2h2v8h-5v4.293L15.793 24H8v-2H6v-9.793zM5 23h2v2H5z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M18 2v4h-2l3.44 4L23 6h-2V2h-3zm-6 7v2h-1v9h1v4h1v-4h1v-9h-1V9h-1zm-4 2v4H7v10h1v2h1v-2h1V15H9v-4H8zm4 1h1v7h-1v-7zm7.5 0a1.5 1.5 0 0 0-1.5 1.5 1.5 1.5 0 0 0 1.5 1.5 1.5 1.5 0 0 0 1.5-1.5 1.5 1.5 0 0 0-1.5-1.5zm-.006.996a.498.498 0 0 1 .498.498.498.498 0 0 1-.498.498.498.498 0 0 1-.498-.498.498.498 0 0 1 .498-.498zM8 15.72h1.19V24H8v-8.28z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9" class="text"><path d="M10.17 6.45c-1.145 0-2.077.928-2.077 2.078v6.225c0 .9.575 1.668 1.373 1.953L6.596 20H3v4h4l.057-2.825 6.635-4.35h12.23c1.146 0 2.078-.927 2.078-2.077v-6.22c0-1.15-.927-2.077-2.077-2.077zm.715 1.037h14.163c1.056 0 1.916.87 1.916 1.942v4.39c0 1.07-.86 1.94-1.916 1.94H13.66l-4.013 2.71-.383.02 1.238-2.775c-.83-.18-1.337-.964-1.337-1.9V9.43c0-1.073.663-1.943 1.72-1.943zM4 21h2v2H4z"/><path fill-opacity=".2" fill-rule="evenodd" clip-rule="evenodd" d="M25.06 7.523H10.894c-1.056 0-1.72.87-1.72 1.943v4.397c0 .937.51 1.72 1.337 1.9L9.28 18.54l.384-.026 4.014-2.71H25.06c1.055 0 1.915-.87 1.915-1.94v-4.4c0-1.072-.86-1.942-1.916-1.942z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M9 4v1h11V4H9zm5.5 1l-3.387 5H14v15H9v1h11v-1h-5V10h3.113L14.5 5z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M3 3v4h1v16H3v4h4v-1h16v1h4v-4h-2l.5-.008c-.155-9.757-4.81-14.485-9.402-16.646C11.553 4.206 7.095 4.496 7 4.502V3zm1 1h2v2H4zm3 1l.033.498s4.31-.285 8.64 1.752C20 9.286 24.346 13.556 24.5 23H23v2H7v-2H5V7h2zM4 24h2v2H4zm20 0h2v2h-2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M23.646 5.646L18.293 11H15v3.293L8.293 21H5v4h4v-3.293L15.707 15H19v-3.293l5.354-5.353zM16 12h2v2h-2zM6 22h2v2H6z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30"><path d="M4 4v4h2v16h16v2h4v-4h-2V6H8V4zm1 1h2v2H5zm3 2h15v15h-1v1H7V8h1zm15 16h2v2h-2z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M537.9 163.6l-14.7-26.4L54.4 400.9l14.7 26.4 468.8-263.7zM57.4 550.4L72 576.8 540.9 313l-14.7-26.4L57.4 550.4zm0 146.5L72 723.3l468.8-263.7-14.7-26.4L57.4 696.9z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60" width="30" height="30"><path d="M10 10v2h38v-2H10zm19 2l-6 6h5v14H10v2h18v6h-5l6 6 6-6h-5v-6h18v-2H30V18h5l-6-6zm0 34H10v2h38v-2H29z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60" width="30" height="30"><path d="M10 48v-2h38v2H10zm19-2l-6-6h5V26H10v-2h18v-6h-5l6-6 6 6h-5v6h18v2H30v14h5l-6 6zm0-34H10v-2h38v2H29z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30"><path d="M10 2v3.293L5.293 10H2v4h3.293L16 24.707V28h4v-3.293L24.707 20H28v-4h-3.293L14 5.293V2h-4zm1 1h2v2h-2V3zm-.293 3h2.586L24 16.707v2.586L19.293 24h-2.586L6 13.293v-2.586L10.707 6zM3 11h2v2H3v-2zm22 6h2v2h-2v-2zm-8 8h2v2h-2v-2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M17 2v10.994h2V7.2l2 5.794h2l2.004-5.8.002 4.89V13l2-.002v-.916L27 2h-2l-3 7.398L19 2h-2zm-1.354 1.646L7.293 12 11 15.707v2.586L8.293 21H4v1h14.707l7.647-7.646-.708-.708L18.293 21h-.586L15 18.293v-2.586l1-1-.707-.707-1 1h-2.586l-3-3 7.647-7.646-.708-.708zM12 16h2v2h-2v-2zm-.293 3h2.586l2 2H9.707l2-2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M15.646 3.646L7.293 12 11 15.707v2.586L8.293 21H4v1h14.707l7.647-7.646-.708-.708L18.293 21h-.586L15 18.293v-2.586l6.354-6.353-.708-.708L14.293 15h-2.586l-3-3 7.647-7.646zM12 16h2v2h-2zm-.293 3h2.586l2 2H9.707z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M10 2.5c-1.208 0-2.17.765-2.88 1.775-.706 1.01-1.215 2.3-1.6 3.58-.766 2.56-1.018 5.096-1.018 5.096L5 13H3v4h4v-4H5.504c.008-.076.254-2.453.975-4.855.36-1.22.85-2.43 1.46-3.295.6-.865 1.27-1.35 2.06-1.35.25 0 .59.218 1 .812.4.595.81 1.503 1.21 2.608.793 2.21 1.55 5.2 2.3 8.2.75 3 1.493 6.01 2.32 8.3.414 1.145.844 2.112 1.33 2.83.488.718 1.08 1.25 1.83 1.25 1.207 0 2.17-.765 2.88-1.775.705-1.01 1.214-2.3 1.6-3.58.765-2.56 1.017-5.096 1.017-5.096L25 17h2v-4h-4v4h1.496c-.008.076-.254 2.453-.975 4.855-.36 1.22-.85 2.43-1.46 3.295-.6.865-1.26 1.35-2.06 1.35-.25 0-.59-.218-1-.813-.4-.594-.81-1.502-1.21-2.607-.79-2.21-1.55-5.2-2.3-8.2-.75-3-1.49-6.01-2.32-8.3-.41-1.145-.84-2.112-1.33-2.83-.49-.718-1.08-1.25-1.83-1.25zM4 14h2v2H4v-2zm20 0h2v2h-2v-2z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M129.8 244.3L5 609.7h54.8l42.6-121.8h121.8l39.6 121.8h57.8L190.7 244.3h-60.9zm-18.2 213.1l51.8-155.3 51.8 155.3H111.6zm456.6 115.7c-3 0-9.1 0-9.1-3-3-6.1-3-9.1-3-18.3v-134c0-82.2-91.3-82.2-103.5-82.2-30.4 0-109.6 3-109.6 91.3h39.6c3-39.6 42.6-60.9 70-60.9 30.4 0 54.8 15.2 54.8 45.7 0 18.3-18.3 30.4-36.5 33.5 0 0-67 9.1-82.2 18.3-15.2 3-45.7 21.3-45.7 70 0 42.6 27.4 76.1 76.1 76.1 33.5 0 67-18.3 91.3-42.6 0 12.2 3 24.4 12.2 30.4 6.1 6.1 18.3 9.1 33.5 9.1 6.1 0 21.3-3 33.5-6.1V567c-9.2 3.1-18.3 6.1-21.4 6.1zm-60.9-63.9c0 42.6-36.5 70-76.1 70-30.4 0-48.7-9.1-48.7-51.8 0-21.3 33.5-39.6 42.6-39.6 24.4-3 54.8-6.1 85.2-15.2v36.5h-3z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path fill-rule="evenodd" clip-rule="evenodd" d="M567.7 358.1h20c-7.2 47.7-55.1 84.7-113.9 84.7s-106.7-37-113.9-84.7h18.9c8.6 32.1 42.6 56.5 84.5 59.9V295.6h-60.8v-20.7h60.8v-21.6c-12.5-4.2-21.7-15.6-21.7-29.4 0-17.3 14.3-31.4 31.9-31.4 17.6 0 31.9 14.1 31.9 31.4 0 14-9.5 25.5-22.4 29.5v21.5h60.1v20.7H483V418c42-3.4 76.1-27.8 84.7-59.9zm-82.1-134.2c0-6.6-5.4-12-12.1-12-6.7 0-12.1 5.3-12.1 12s5.4 12 12.1 12c6.6 0 12.1-5.4 12.1-12zm-85.5 295.4v92.6c0 5.5 4.2 13.1 6 15.2 1.8 2 4.3 3.1 7.6 3.1 2.4 0 2.2-.5 6.8-1.4v20.9c-7 1.6-10.9 2.4-16 2.4-10.8 0-18-3.4-23-7.7-4.9-4.2-9.2-5.9-10.1-15.5-19.1 20.2-37.9 22.5-65.6 22.5-36.5 0-59.5-22.7-59.5-54.8 0-60.9 75.4-59.9 56.1-57.7 0 0 68.5-5.2 68.5-22.8 0-20.7-11.9-32.3-42.5-32.3-14.3 0-24.9 3-31.8 8.9-6.9 5.9-11 6.7-12.1 18.8h-30c3.6-55.3 70.9-52.6 75.3-52 3.2-.2 23 .1 41.2 9.3 17 8.7 29.1 26.4 29.1 50.5zm-31.5 29.3c-21.8 11.8-38.4 11.5-61.2 17.4-6 1.5-30.9 5.3-30.9 28.2 0 30.4 14.7 37.1 37 37.1 30.5 0 55.1-18.3 55.1-50.5v-32.2zm-204.2 19.2H67.6l-29.1 84.3H1.7l96.4-272.2h41.2l92.9 272.2h-38.8l-29-84.3zM115.9 421L80.5 526.6h71L115.9 421z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M25 2v4h1.387l-2.602 7.145L21 12.005V10h-4v.37l-3-1.23V7h-4v.506L6 5.87V3H2v4h1.072l1.76 11H4v1.664l-2.416-.89-.346.94L4 20.73V22h3.45l2.55.937v1.995h3.828v-.584L18 25.88V28h4v-.646l2.002.736.346-.938L22 26.29V24h-1.102l3.473-9.535 2.44.998.38-.926-2.47-1.014L27.46 6H29V2zm1 1h2v2h-2zM3 4h2v2H3zm3 2.95l4 1.636V11h.287l-4.264 7h-.18L4.083 7H6zM11 8h2v2h-2zm3 2.223l3 1.226V14h.652l-5.502 7h-.318l-.11-10H14zM18 11h2v2h-2zm-7.266 1.19l.098 8.81H10v.873l-2-.736V18h-.805zM21 13.085l2.44.998-3.13 8.602L19.583 14H21zm-2.385 1.307l.8 9.607H18v.81l-4.172-1.54V21h-.406zM7 19v2H5v-2zm6 3v2h-2v-1.996zm6 3h2v2h-2z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M1 15.5v1s1.647.007 3.277.822C5.907 18.138 7.5 19.667 7.5 23H6v4h4v-4H8.508c.03-.186.287-1.697 1.176-3.252.946-1.656 2.51-3.248 5.316-3.248 2.267 0 3.876 1.59 4.955 3.27 1.01 1.57 1.456 3.032 1.516 3.23H20v4h4v-4h-1.5c0-3.333 1.592-4.862 3.223-5.678C27.353 16.507 29 16.5 29 16.5v-1s-1.853-.007-3.723.928c-1.488.744-2.984 2.162-3.54 4.552-.25-.544-.545-1.132-.942-1.75-1.17-1.82-3.062-3.73-5.795-3.73-3.194 0-5.13 1.908-6.184 3.752-.26.453-.468.905-.638 1.33-.62-2.158-2.05-3.45-3.455-4.154C2.853 15.493 1 15.5 1 15.5zM7 24h2v2H7zm14 0h2v2h-2z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30"><path d="M21 5v3.3L8.3 21H5v4h4v-1h16v-1h-7c0-3.5-1.5-5.5-3.3-7l7-7H25V5zm1 1h2v2h-2zm-8 10.7c1.75 1.3 3 3.55 3 6.3H9v-1.3zM6 22h2v2H6z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M25 17H6.05l-.03-3.68 16.187-7.386-.414-.91L5.016 12.68 5.05 17H5v1h.057v.004l.5-.004H25v-1zm0 3H5v1h20v-1zm0 3H5v1h20v-1z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M17 5v18.95l-3.68.03L5.934 7.792l-.91.414 7.656 16.777L17 24.95V25h1v-.057h.004l-.004-.5V5h-1zm3 0v20h1V5h-1zm3 0v20h1V5h-1z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30"><path d="M21 5v3.3L8.3 21H5v4h4v-3.3L21.7 9H25V5zm1 1h2v2h-2zM6 22h2v2H6z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M4 3v4h1.012L5 23H4v4h4v-3.373L22.78 7H26V3h-4v1H8V3zm1 1h2v2H5zm18 0h2v2h-2zM8 5h14v1.373L7.22 23H6l.012-16H8zM5 24h2v2H5z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M4.5 3.238V22H3v4h4v-2.05l5-2.24V22h4v-2.08l13.238-5.926L22 10.848V9h-4v.107L14 7.37V5h-4v.63zm1 1.526L10 6.72V9h1.44L5.5 20.883zM11 6h2v2h-2zm3 2.46l4 1.737V13h1.064l-4.755 4.078L12.51 9H14zM19 10h2v2h-2zm-7.184.482L13.488 18H12v2.615l-5 2.24V22h-.94zM22 11.937l4.76 2.07L16 18.823V18h-1.232l5.834-5H22zM13 19h2v2h-2zm-9 4h2v2H4z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.999999 30.000001" width="30" height="30" enable-background="new 0 0 841.9 595.3"><path d="M17 27v-4h-2V7h2V3h-4v4h1v16h-1v4zm-1-1h-2v-2h2zm0-20h-2V4h2z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30"><path d="M11.527 5.975c-1.345 0-2.692.508-3.713 1.53l-.283.282c-2.04 2.04-2.04 5.385 0 7.426l2.18 2.178c-.3-1.1-.26-2.29.17-3.36l-.58-.58c-1.09-1.09-1.09-2.8 0-3.89l.29-.28c1.1-1.09 2.8-1.09 3.89 0l2.76 2.76c1.09 1.1 1.09 2.8 0 3.89l-.28.28c-.313.32-.69.54-1.08.67l1.86 1.86c.353-.21.69-.45.994-.75l.28-.285c2.04-2.042 2.04-5.383 0-7.424l-2.76-2.76c-1.02-1.02-2.367-1.53-3.71-1.53zm1.733 5.285c-.337.208-.655.453-.946.744l-.283.283c-2.04 2.04-2.04 5.385 0 7.426l2.76 2.758c2.04 2.05 5.39 2.05 7.43 0l.29-.28c2.04-2.04 2.04-5.38 0-7.42l-2.18-2.18c.31 1.11.26 2.29-.17 3.37l.58.58c1.09 1.1 1.09 2.8 0 3.89l-.28.29c-1.09 1.093-2.793 1.093-3.89 0l-2.76-2.76c-1.09-1.092-1.09-2.796 0-3.89l.28-.284c.31-.304.67-.513 1.04-.65l-1.86-1.86zM18 13.492v.31l.03.028c-.007-.113-.01-.226-.03-.338z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28"><path fill="#ffffff" d="M18 10V0h-8v10H0v8h10v10h8V18h10v-8"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M453.8 360.2l-92.1 6L234 517.7l-86.2-86.1L5.2 514.7v118.9h585.3V268.1z" opacity=".3"/><path d="M234 508.8c-156 222.067-78 111.033 0 0zm309-276.3l-71.3 95.1h-101L236.9 488l-92.1-112.9-38.6 41.6-101 98.1 41.6 41.6 95.1-95.1L234 574.2 397.4 387h104l89.1-118.9z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="-200 -70 1000 1000"><path d="M486.2 398L109.1 120v468.6L246.3 520l106.6 201.9 99.1-49.6-103-205.7z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 14" width="25" height="14" style="position:relative;top:3px"><path d="M10.43 8.683L9.345 8.68c-.943-.005-1.712-.774-1.716-1.717-.003-.452.172-.877.49-1.195.32-.32.744-.493 1.196-.492l4.002.016c.83.004 2.22.18 2.225 1.316.002.522.427.943.95.942.52-.002.942-.427.94-.95-.007-1.932-1.62-3.188-4.107-3.198l-4.003-.016c-.96-.003-1.862.368-2.54 1.045-.677.68-1.048 1.58-1.044 2.54.003.99.41 1.887 1.06 2.54.652.65 1.55 1.056 2.54 1.06l1.086.004c.522.002.947-.42.948-.942.002-.52-.42-.946-.942-.947zm13.832-1.655c-.008-2.076-1.41-3.59-3.33-3.597l-1.357-.003c-.522-.002-.947.42-.948.942-.002.52.42.946.94.947l1.356.006c.996.003 1.445.863 1.448 1.714.004.453-.17.878-.49 1.196-.317.32-.742.493-1.195.492l-4.27-.017c-1.952-.008-1.955-.924-1.957-1.315-.002-.522-.426-.943-.948-.942-.523.003-.945.428-.943.95.004.896.296 1.63.834 2.17.66.66 1.69 1.023 3.01 1.028l4.27.017c.96.003 1.86-.368 2.54-1.046.675-.678 1.046-1.58 1.043-2.54z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M16 4v7h-3v2h3v7h2v-2h3v-2h-3V4h-2zM7 6v12H4v2h3v2h2V10h3V8H9V6H7z"/></svg>' }, , , , , , function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><path d="M0 0v38h38V0H0zm7 29h24v4H7v-4z" class="bg"/><path d="M24.06 17.94L15.123 9l-1.41 1.41 2.38 2.38-5.15 5.15a1.49 1.49 0 0 0 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12zM12.713 19l4.79-4.79L22.29 19h-9.58zM26.5 20.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5z" class="icon"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M16 3v3h-2v12h2v5h1v-5h2V6h-2V3h-1zM9 4v5H7v11h2v3h1v-3h2V9h-2V4H9zm-1 6h3v9H8v-9z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 973.125"><path d="M960 832L710.875 582.875C746.438 524.812 768 457.155 768 384 768 171.97 596 0 384 0 171.97 0 0 171.97 0 384c0 212 171.97 384 384 384 73.156 0 140.812-21.562 198.875-57L832 960c17.5 17.5 46.5 17.375 64 0l64-64c17.5-17.5 17.5-46.5 0-64zM384 640c-141.375 0-256-114.625-256-256s114.625-256 256-256 256 114.625 256 256-114.625 256-256 256z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 17" width="17" height="17"><path d="M8.5.36L6.45 2H1v1h2l-3 8a3.54 3.5 0 0 0 3.055 2.97 3.5 3.5 0 0 0 .004 0 3.54 3.5 0 0 0 .44.03 3.5 3.5 0 0 0 .35-.018A3.54 3.5 0 0 0 7 11L4 3h9l-3 8a3.54 3.5 0 0 0 3.502 3A3.54 3.5 0 0 0 17 11l-3-8h2V2h-5.45L8.5.36zm0 1.28l.45.36h-.9l.45-.36zm-5 2.694L6 11H1l2.5-6.666zm10 0L16 11h-5l2.5-6.666z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 16"><path d="M15.09 6.857s-.571 0-.724-.533c-.114-.457-.305-.876-.533-1.295-.229-.495.152-.876.152-.876l.571-.571c.229-.229.229-.61 0-.876l-.762-.762c-.229-.229-.61-.229-.876 0l-.571.571s-.381.381-.876.152c-.419-.229-.838-.419-1.295-.533-.533-.152-.533-.724-.533-.724v-.8a.602.602 0 0 0-.61-.61H7.966a.602.602 0 0 0-.61.61v.8s0 .571-.533.724c-.457.114-.876.305-1.295.533-.495.229-.876-.152-.876-.152l-.571-.571c-.229-.229-.61-.229-.876 0l-.762.762c-.229.229-.229.61 0 .876l.571.571s.381.381.152.876c-.229.419-.419.838-.533 1.295-.152.495-.724.533-.724.533h-.8a.602.602 0 0 0-.61.61v1.067c0 .343.267.61.61.61h.8s.571 0 .724.533c.114.457.305.876.533 1.295.229.495-.152.876-.152.876l-.571.571c-.229.229-.229.61 0 .876l.762.762c.229.229.61.229.876 0l.571-.571s.381-.381.876-.152c.419.229.838.419 1.295.533.495.152.533.724.533.724v.8c0 .343.267.61.61.61h1.067c.343 0 .61-.267.61-.61v-.8s0-.571.533-.724c.457-.114.876-.305 1.295-.533.495-.229.876.152.876.152l.571.571c.229.229.61.229.876 0l.762-.762c.229-.229.229-.61 0-.876l-.571-.571s-.381-.381-.152-.876c.229-.419.419-.838.533-1.295.152-.495.724-.533.724-.533h.8c.343 0 .61-.267.61-.61V7.467a.602.602 0 0 0-.61-.61h-.8zM8.5 11.555a3.541 3.541 0 0 1-3.556-3.556A3.541 3.541 0 0 1 8.5 4.443a3.541 3.541 0 0 1 3.556 3.556A3.561 3.561 0 0 1 8.5 11.555z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" enable-background="new 0 0 32 32"><path d="M16 15h1V8h-1v7zm2 1v1h7v-1h-7zm-2 9h1v-7h-1v7zm-8-8h7v-1H8v1z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="-750 -750 2095.3 2341.9" enable-background="new 0 0 595.3 841.9"><circle cx="297.6" cy="420.9" r="294.8"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 18" width="26" height="18"><path d="M12 0C8.4 0 5.4 2.8 5.1 6.3 2 6.1.1 9 0 11.1 0 13.9 2.2 16 4.7 16h4.9l-1-1H4.7C2.8 15 1 13.3 1 11.2 1 9 3 6.7 6 7.4 6 3 9 1 12 1s3.7 1.2 5.1 2.9c1.5.1 3.3.6 4.2 1.7 1 1.5 1.2 2.6 1.2 4.2 1.4.4 2.5 1.5 2.5 2.7-.2 1.6-1.3 2.5-2.6 2.5h-5l-1 1h5.9c2.8 0 3.7-1.9 3.7-3.5s-1-3-2.5-3.4c0-1.6-.5-2.9-1.4-4.1-.9-1.2-2.7-2-4.5-2.1C16.3 1.2 14.3 0 12 0zm-2 7v5H7l6 6 6-6h-3V7h-6zm1 1h4v5h1.6L13 16.6 9.4 13H11V8z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M19.2 6.6c-.4-.4-1-.4-1.4 0l-1.2 1.2 1.8 1.8 1.9-1.9-1.1-1.1zM6 22l2.8-2.7L7.5 18 6 22zm3.3-6.9c-.4.4-1.6 1.7-1.2 2.1l1.3 1.3 8.3-8.3-1.8-1.8-6.6 6.7z" opacity=".4"/><path fill-rule="evenodd" clip-rule="evenodd" d="M9 25l2.8-2.7-1.3-1.3L9 25zM22.2 9.6c-.4-.4-1-.4-1.4 0l-1.2 1.2 1.8 1.8 1.9-1.9-1.1-1.1zm-9.9 8.5c-.4.4-1.6 1.7-1.2 2.1l1.3 1.3 8.3-8.3-1.8-1.8-6.6 6.7z" opacity=".75"/><path fill-rule="evenodd" clip-rule="evenodd" d="M15.3 21.1c-.4.4-1.6 1.7-1.2 2.1l2.6 2.6c.4.4 1.7-.8 2.1-1.2l6.6-6.6-3.6-3.5-6.5 6.6zM12 28l4-1.5-2.5-2.5-1.5 4zm15.4-13.2l-2.1-2.1c-.4-.4-1-.4-1.4 0l-1.2 1.2 3.5 3.5 1.2-1.2c.3-.4.3-1 0-1.4z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M17.948 5.54L7.705 15.468s-.942 1.36-1.67 3.24c-1.255 3.03.314 4.6 1.15 5.226.626.418 4.705 1.045 6.376-.524l10.77-10.767.11-3.866-6.49-3.237zm5.333 7.004l-9.61 9.616c-1.77 1.777-5.43 1.36-6.16.836-.42-.315-1.462-1.987-.63-3.764.838-1.986 1.57-3.24 1.57-3.24l9.515-9.407 5.435 3.03-.107 2.93zm-.52-2.822l-9.2 9.095-5.22-3.034-.31.627 5.124 2.928c-.105.524-.626 1.986-1.252 3.03-1.043 1.57-2.61 1.672-2.61 1.672l.94.418s1.152.106 2.09-1.36c.94-1.465 1.57-3.345 1.57-3.345l9.824-9.617-.94-.414zm1.46-.942l-5.02 4.91v3.453l5.02-4.497zm-6.27-3.24l-4.81 4.702 6.17 3.45 5.02-4.81z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><path d="M0 0v38h38V0H0zm7 29h24v4H7v-4z" class="bg"/><path d="M23.094 25.5L22 22.17h-5.904l-1.17 3.33H12.5l6.446-16h.574l5.98 16h-2.405zM19.13 13.637l-2.46 6.95h4.712l-2.252-6.95z" class="icon"/></svg>' }, 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>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 586.09999 586.09996" width="586.1" height="586.1" enable-background="new 0 0 595.3 841.9"><path d="M172.6 367.9l-97.7 97.7L0 390.7v195.4h195.4l-74.9-74.9 97.7-97.7-45.6-45.6zM195.4 0H0v195.4l74.9-74.9 97.7 97.7 45.6-45.6-97.7-97.7L195.4 0zm195.3 0l74.9 74.9-97.7 97.7 45.6 45.6 97.7-97.7 74.9 74.9V0H390.7zm22.8 367.9l-45.6 45.6 97.7 97.7-74.9 74.9h195.4V390.7l-74.9 74.9-97.7-97.7z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M5.5 13A2.5 2.5 0 0 0 3 15.5 2.5 2.5 0 0 0 5.5 18 2.5 2.5 0 0 0 8 15.5 2.5 2.5 0 0 0 5.5 13zm9.5 0a2.5 2.5 0 0 0-2.5 2.5A2.5 2.5 0 0 0 15 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 15 13zm9.5 0a2.5 2.5 0 0 0-2.5 2.5 2.5 2.5 0 0 0 2.5 2.5 2.5 2.5 0 0 0 2.5-2.5 2.5 2.5 0 0 0-2.5-2.5z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M16 3v3h-2v12h2v5h1v-5h2V6h-2V3h-1zM9 4v5H7v11h2v3h1v-3h2V9h-2V4H9z"/></svg>' }, 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>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 14c.1 0 .3 0 .4.1l.7-.7c-.4-.2-.7-.3-1.1-.3-1.6 0-2.9 1.3-2.9 2.9 0 .4.1.8.2 1.1l.8-.8v-.4c0-1 .8-1.9 1.9-1.9zm-4.7 5.2C10.2 18 8.9 16.7 8.3 16c1.1-1.2 4.7-5 8.2-5 .9 0 1.9.3 2.8.7l.7-.7c-1.1-.6-2.3-.9-3.5-.9-4.6 0-9 5.4-9.2 5.6L7 16l.3.4c.1.1 1.6 2 3.8 3.6l.7-.8zm13.9-3.5c-.1-.1-1.5-1.8-3.4-3.2l2.8-2.8-.7-.7L9 24.3l.7.7 3.7-3.7c1 .4 2 .7 3 .7 4.9 0 9-5.4 9.2-5.6l.4-.4-.3-.3zm-7.2.5c-.1.9-.9 1.6-1.7 1.7l1.7-1.7zm-2 4.8c-.7 0-1.5-.2-2.2-.5l1.7-1.7c.2 0 .4.1.6.1 1.5 0 2.9-1.3 2.9-2.9 0-.2 0-.4-.1-.5l2.3-2.3c1.4 1.1 2.6 2.3 3.1 2.9-1.2 1.2-4.6 4.9-8.3 4.9z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M16 3v3h-2v12h2v5h1v-5h2V6h-2V3h-1zM9 4v5H7v11h2v3h1v-3h2V9h-2V4H9zm6 3h3v10h-3V7zm-7 3h3v9H8v-9z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 17" width="17" height="17"><path d="M16 0a1 1 0 0 0-1 1 1 1 0 0 0 .127.484L13.017 5A1 1 0 0 0 13 5a1 1 0 0 0-.258.035L10.965 3.26A1 1 0 0 0 11 3a1 1 0 0 0-1-1 1 1 0 0 0-1 1 1 1 0 0 0 .082.393L7.12 6.008a1 1 0 0 0-.12-.01 1 1 0 0 0-.44.104l-1.564-1.04A1 1 0 0 0 5 4.998a1 1 0 0 0-1-1 1 1 0 0 0-1 1 1 1 0 0 0 .002.066l-1.56 1.04A1 1 0 0 0 1 5.998a1 1 0 0 0-1 1 1 1 0 0 0 1 1 1 1 0 0 0 1-1 1 1 0 0 0-.002-.064l1.56-1.04A1 1 0 0 0 4 6a1 1 0 0 0 .44-.103l1.564 1.04A1 1 0 0 0 6 7a1 1 0 0 0 1 1 1 1 0 0 0 1-1 1 1 0 0 0-.082-.39l1.965-2.62A1 1 0 0 0 10 4a1 1 0 0 0 .258-.035l1.777 1.777A1 1 0 0 0 12 6a1 1 0 0 0 1 1 1 1 0 0 0 1-1 1 1 0 0 0-.127-.482L15.983 2A1 1 0 0 0 16 2a1 1 0 0 0 1-1 1 1 0 0 0-1-1zm-1 5v10h2V5h-2zM9 7v8h2V7H9zM3 9v6h2V9H3zm9 1v5h2v-5h-2zM0 11v4h2v-4H0zm6 0v4h2v-4H6z"/></svg>' }, 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>' }, 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>' }, 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>' }, 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-14zm4.833 2.042h1.084v1.083H2.433c-.143 0-.18.027-.24.09-.063.062-.135.19-.187.365-.103.353-.114-.147-.114.17 0 .84.01 1.425-.157 2-.127.44-.4.836-.76 1.25.36.413.633.81.76 1.248.167.575.157 1.16.157 2.002 0 .317.01-.185.114.168.052.176.124.305.186.368s.098.09.24.09h1.085v1.082H2.433c-.398 0-.768-.166-1.01-.41-.244-.245-.372-.54-.456-.826-.167-.57-.16-.155-.16-.472 0-.84-.01-1.34-.113-1.7-.09-.31-.328-.612-.7-1.008h-.81v-1.084h.81c.372-.397.61-.7.7-1.01.104-.358.114-.857.114-1.698 0-.317-.008.1.16-.472.083-.286.21-.583.454-.828.242-.244.613-.408 1.01-.408zm3.25 0h1.084c.398 0 .768.164 1.01.408.244.245.374.542.458.828.168.57.157.155.157.472 0 .84.01 1.34.114 1.7.09.31.328.61.7 1.008h.81v1.084h-.81c-.372.397-.61.7-.7 1.01-.104.358-.114.857-.114 1.698 0 .317.01-.1-.157.472-.084.286-.214.58-.457.826-.243.244-.613.41-1.01.41H5.682v-1.083h1.084c.143 0 .18-.026.24-.09.063-.062.138-.19.19-.367.103-.353.11.15.11-.168 0-.84-.01-1.427.158-2.002.127-.44.4-.835.76-1.248-.36-.414-.633-.81-.76-1.25-.167-.575-.157-1.16-.157-2 0-.317-.008.183-.112-.17-.05-.176-.126-.303-.188-.366s-.098-.09-.24-.09H5.682v-1.082z"/></svg>'
}, 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>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M1.5 2a.5.5 0 0 0 0 1H5V2zM7 2v1h3V2zm5 0v1h3V2zm5 0v1h3.5a.5.5 0 0 0 0-1z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M1.5 2a.5.5 0 0 0 0 1H3V2H1.5zM4 2v1h2V2H4zm3 0v1h2V2H7zm3 0v1h2V2h-2zm3 0v1h2V2h-2zm3 0v1h2V2h-2zm3 0v1h1.5a.5.5 0 0 0 0-1H19z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M0 2.5L8 0v5zm20 0a.5.5 0 1 1 1 0 .5.5 0 1 1-1 0z"/><path d="M20.5 3H7V2h13.5z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M0 2.5a.5.5 0 1 1 1 0 .5.5 0 1 1-1 0zm18 0a2 2 0 1 1 4 0 2 2 0 1 1-4 0zm-9 0a2 2 0 1 1 4 0 2 2 0 1 1-4 0z"/><path d="M19 3H.5V2H19z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M20 2.5a.5.5 0 1 1 1 0 .5.5 0 1 1-1 0zm-19 0a2 2 0 1 1 4 0 2 2 0 1 1-4 0z"/><path d="M20.5 3H3V2h17.5z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M22 2.5L14 5V0zM2 2.5a.5.5 0 1 1-1 0 .5.5 0 1 1 1 0z"/><path d="M1.5 2H15v1H1.5z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M22 2.5a.5.5 0 1 1-1 0 .5.5 0 1 1 1 0zM4 2.5a2 2 0 1 1-4 0 2 2 0 1 1 4 0zM13 2.5a2 2 0 1 1-4 0 2 2 0 1 1 4 0z"/><path d="M3 2h18.5v1H3z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M2 2.5a.5.5 0 1 1-1 0 .5.5 0 1 1 1 0zM21 2.5a2 2 0 1 1-4 0 2 2 0 1 1 4 0z"/><path d="M1.5 2H19v1H1.5z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M1.5 2a.5.5 0 0 0 0 1h19a.5.5 0 0 0 0-1h-19z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M2 2a1 1 0 0 0 0 2h18a1 1 0 0 0 0-2H2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M2 1a1.5 1.5 0 0 0 0 3h18a1.5 1.5 0 0 0 0-3H2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M2 1a2 2 0 0 0 0 4h18a2 2 0 0 0 0-4H2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M142.5 447.4c-102.74 102.74-83.44 83.44 0 0m399-186.2l-70.9 94.6H370.1l-136 159.6-91.6-112.3-38.5 41.4L6.5 542l41.4 41.4 94.6-94.6 91.6 112.3 162.6-186.2h103.5l88.7-118.2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 15"><path d="M1 0C.45 0 0 .45 0 1v11h1V1h9V0H1zm2.467 2C2.66 2 2 2.65 2 3.444v10.111c0 .794.66 1.444 1.467 1.444h8.067c.807 0 1.467-.65 1.467-1.444V3.444c0-.794-.66-1.444-1.467-1.444H3.467zM3 3h9v11H3V3z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M1.5 2H0v12c0 .825.675 1.5 1.5 1.5h12V14h-12V2zm13.056-2H4.445c-.794 0-1.444.65-1.444 1.444v10.111c0 .794.65 1.444 1.444 1.444h10.111c.794 0 1.444-.65 1.444-1.444V1.444C16 .65 15.35 0 14.556 0z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 12"><path d="M8.25 0C4.5 0 1.297 2.332 0 5.625c1.297 3.292 4.5 5.625 8.25 5.625s6.953-2.333 8.25-5.625C15.203 2.332 12 0 8.25 0zm0 9.375c-2.07 0-3.75-1.68-3.75-3.75 0-2.07 1.68-3.75 3.75-3.75 2.07 0 3.75 1.68 3.75 3.75 0 2.07-1.68 3.75-3.75 3.75zm0-6C7.005 3.375 6 4.38 6 5.625s1.005 2.25 2.25 2.25 2.25-1.005 2.25-2.25-1.005-2.25-2.25-2.25z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M20 13h-1v-1.5C19 9 17 7 14.5 7S10 9 10 11.5V13H9c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h11c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-8-.9c0-1.7 1.1-3.1 2.5-3.1s2.5 1.4 2.5 3.1v.9h-5v-.9z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M22 14c-.3-3.9-3.5-7-7.5-7S7.3 10.1 7 14v9h5v-9h.1c.2-1.1 1.2-2 2.4-2s2.2.9 2.4 2h.1v9h5v-9zm-11 8H8v-4h3v4zm10 0h-3v-4h3v4z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30"><path d="M15 6v2h-1v6h1v2h1v-2h1V8h-1V6zm5 1v2h-1v6h1v2h1v-2h1V9h-1V7zM4 8v16h23v-5H9V8zm1 1h3v2H6v1h2v2H6v1h2v2H6v1h2v1.293l-3 3zm3.707 11H11v2h1v-2h2v2h1v-2h2v2h1v-2h2v2h1v-2h2v2h1v-2h2v3H5.707z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><path d="M0 0v38h38V0H0zm7 29h24v4H7v-4z" class="bg"/><path d="M24.748 16l-3.75-3.748-9.998 10V26h3.75l9.998-10zm2.96-2.96a.996.996 0 0 0 0-1.408l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.96 1.96 3.75 3.75 1.96-1.96z" class="icon"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2.4 120.9 600 600" enable-background="new -2.4 120.9 600 600"><path d="M594 473.5V368.8h-76c-5.7-23.8-15.2-46.4-27.5-66.4l53.8-53.8-73.9-73.9-53.8 53.4c-20.6-12.8-42.7-21.8-66.4-27.5v-75.9H245.5v75.9c-23.8 5.7-46.4 15.2-66.4 27.5l-53.8-53.8-73.9 73.9 53.4 53.8C92 322.6 83 344.7 77.3 368.4h-76V473h75.9c5.7 23.8 15.2 46.4 27.5 66.4L51 593.3l73.9 73.9 53.8-53.4c20.6 12.8 42.7 21.8 66.4 27.5v75.9h104.6v-75.9c23.8-5.7 46.4-15.2 66.4-27.5l53.8 53.8 73.9-73.9-53.4-53.8c12.8-20.6 21.8-42.7 27.5-66.4H594zm-296.4 69.7c-67.3 0-122.3-54.6-122.3-122.3 0-67.3 54.6-122.3 122.3-122.3 67.3 0 122.3 54.6 122.3 122.3-.4 67.4-54.9 122.3-122.3 122.3z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15"><path d="M7.5 8.2v3.2L15 6.5 7.5 1.7V5S0 4.1 0 13.4c0-.1 1.7-5.2 7.5-5.2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M12 7v1H9v2h13V8h-3V7h-7zm-2 4v12h11V11H10z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 18" width="14" height="18"><path fill-rule="evenodd" d="M1 16c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V4H1v12zM14 1h-3.5l-1-1h-5l-1 1H0v2h14V1z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.8 13.4" enable-background="new 0 0 14.8 13.4"><path d="M8 6.7L1.7 0 .1 1.7l4.7 4.9-4.8 5 1.7 1.8L8 6.7zm6.8 0L8.4 0 6.8 1.7l4.7 4.9-4.8 5 1.7 1.8 6.4-6.7z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30"><path d="M18.827 8.17c-1.227.817-.993 1.49-.993 2.318 0 .703-.29 1.49-.62 1.778-.33.29-.8.965-.8.965l1.168 1.25s.823-.52 1.038-.72c.414-.37 1.407-.66 2.193-.66 1.737 0 2.387-.54 2.454-2.49.017-.5-.07-1.63-.07-1.63l-.795.02c-.458 2.406-1.457 2.53-2.28 1.79-.823-.74-1.13-1.193.386-2.774l-.48-.626-1.2.79zM6.46 7.716c-.29.455 1.2 3.847 1.984 4.468.91.785 1.903.496 2.896-.828.827-1.117.827-1.158.083-1.985-.414-.45-1.158-.82-1.696-.82s-1.034-.17-1.157-.38c-.332-.49-1.863-.86-2.11-.45zm3.983 5.846c0 .372 4.95 4.826 8.467 7.68 2.192 1.78 3.268 2.027 2.77.62-.454-1.24-7.983-10.328-8.81-10.576-.618 1.114-1.67 1.914-2.427 2.276zm-.468 5.778C7.74 21.367 7.74 21.367 8.57 22.194c.826.827.826.827 3.018-1.406 1.383-1.414 2.168-2.514 2.168-2.514l-1.272-1.21s-1.268 1.118-2.51 2.276z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3.0000003 6" width="3" height="6"><path d="M0 0c-.04 1.99 0 4.61 0 6l3-3z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 11.5"><path d="M7.5 4.8c-1.1 0-1.9.9-1.9 1.9s.9 1.9 1.9 1.9c1.1 0 1.9-.9 1.9-1.9s-.9-1.9-1.9-1.9zM13 1.9h-2.2c0-1-.9-1.9-2-1.9H6.1C5 0 4.2.9 4.2 1.9H1.9c-1 0-1.9.9-1.9 2v5.7c0 1.1.9 1.9 1.9 1.9H13c1.1 0 1.9-.9 1.9-1.9V3.9c.1-1.1-.8-2-1.9-2zm-5.5 8.3C5.6 10.2 4 8.6 4 6.7s1.5-3.4 3.4-3.4 3.4 1.5 3.4 3.4c.1 1.9-1.4 3.5-3.3 3.5z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M2 0a2 2 0 0 0-2 2v14h14a2 2 0 0 0 2-2H2zm2 0v2h3V0zm5 0v2h3V0zm5 0v2h2a2 2 0 0 0-2-2zm0 4v3h2V4zm0 5v3h2V9z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 13"><path d="M1 11.571C1 12.357 1.6 13 2.333 13h5.333c.733 0 1.333-.643 1.333-1.429V3h-8v8.571zM8.5 1L6.786 0H3.215L1.501 1h-1.5v1h10V1h-1.5z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15"><path d="M15 13.4C15 4.1 7.5 5 7.5 5V1.7L0 6.5l7.5 4.9V8.2c5.8 0 7.5 5.1 7.5 5.2z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 18" width="26" height="18"><path d="M12 0C8.4 0 5.4 2.8 5.1 6.3 2 6.1.1 9 0 11.1 0 13.9 2.2 16 4.7 16H9v-1H4.7C2.8 15 1 13.3 1 11.2 1 9 3 6.7 6 7.4 6 3 9 1 12 1s3.7 1.2 5.1 2.9c1.5.1 3.3.6 4.2 1.7 1 1.5 1.2 2.6 1.2 4.2 1.4.4 2.5 1.5 2.5 2.7-.2 1.6-1.3 2.5-2.6 2.5H17v1h5.3c2.8 0 3.7-1.9 3.7-3.5s-1-3-2.5-3.4c0-1.6-.5-2.9-1.4-4.1-.9-1.2-2.7-2-4.5-2.1C16.3 1.2 14.3 0 12 0zm1 6l-6 6h3v5h6v-5h3l-6-6z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M20.8 18.5c.7-1.2 1.2-2.5 1.2-4 0-4.1-3.4-7.5-7.5-7.5S7 10.4 7 14.5s3.4 7.5 7.5 7.5c1.5 0 2.9-.5 4.1-1.2l4.3 4.3 2.2-2.2-4.3-4.4zM14.5 20c-3 0-5.5-2.5-5.5-5.5S11.5 9 14.5 9s5.5 2.5 5.5 5.5-2.5 5.5-5.5 5.5zM11 15h7v-1h-7v1z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M13.95 9.95h-1v3h-3v1h3v3h1v-3h3v-1h-3v-3zm5.8 7.5c.7-1.2 1.2-2.5 1.2-4 0-4.1-3.4-7.5-7.5-7.5s-7.5 3.4-7.5 7.5 3.4 7.5 7.5 7.5c1.5 0 2.9-.5 4.1-1.2l4.3 4.3 2.2-2.2-4.3-4.4zm-6.3 1.5c-3 0-5.5-2.5-5.5-5.5s2.5-5.5 5.5-5.5 5.5 2.5 5.5 5.5-2.5 5.5-5.5 5.5z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 9" width="9px" height="9px"><path d="M2 1L1 2l2.5 2.5L1 7l1 1 2.5-2.5L7 8l1-1-2.5-2.5L8 2 7 1 4.5 3.5z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 95.939 95.939" width="95.939" height="95.939"><path d="M62.82 47.97l32.53-32.534a2 2 0 0 0 0-2.828L83.332.586a2 2 0 0 0-2.827 0L47.97 33.12 15.435.587c-.75-.75-2.078-.75-2.828 0L.587 12.607a2 2 0 0 0 0 2.83L33.12 47.97.588 80.504a2 2 0 0 0 0 2.828l12.02 12.02a1.997 1.997 0 0 0 2.83 0L47.97 62.818l32.535 32.535a2 2 0 0 0 2.827 0l12.02-12.02c.78-.783.78-2.05 0-2.83L62.82 47.97z"/></svg>' }, 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>' }, 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>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 670 745"><path d="M417.91 738.04c-118.64-22.82-190.57-47.072-218.92-73.807-22.734-21.44-24.27-32.633-24.27-176.81 0-88.1 1.86-140.31 5.373-150.86 11.138-33.44 36.66-57.735 133.93-127.5 67.296-48.267 90.59-69.93 140.55-130.72C509.177 11.903 521.965.078 539.24.046c16.013-.03 25.43 13.07 32.622 45.373 7.83 35.164-3.512 82.774-30.952 129.93-40.764 70.052-39.008 75.19 31.705 92.733 49.08 12.178 81.767 30 91.884 50.097 8.98 17.844 7.335 39.84-7.633 102.04-7.523 31.264-15.156 66.454-16.962 78.203-1.806 11.748-11.588 46.504-21.738 77.236s-18.454 58.25-18.454 61.152c0 8.677-33.212 71.96-44.153 84.13-22.217 24.715-68.287 30.435-137.65 17.093zm-345.68-25.9c-5.722-2.5-22.273-14.2-36.78-26.03-14.506-11.88-28.418-21.59-30.914-21.59-2.82 0-4.538-65.6-4.538-173.26 0-95.29 1.752-173.25 3.893-173.25 2.144 0 17.104-11.498 33.248-25.552 30.614-26.65 49.608-34.114 68.466-26.907 16.703 6.386 18.065 16.296 7.704 56.06-8.34 32-9.423 51.51-9.423 169.55 0 131.23.62 138.49 16.636 194.72 5.75 20.178-24.144 36.41-48.29 26.22z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18px" height="18px"><path fill-rule="evenodd" d="M12.5 11h-.79l-.28-.27A6.47 6.47 0 0 0 13 6.5 6.5 6.5 0 1 0 6.5 13c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L17.49 16l-4.99-5zm-6 0C4.01 11 2 8.99 2 6.5S4.01 2 6.5 2 11 4.01 11 6.5 8.99 11 6.5 11z"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120"><path fill-rule="evenodd" clip-rule="evenodd" d="M28 50h65v17H28z"/></svg>'
}, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140"><path fill-rule="evenodd" clip-rule="evenodd" d="M112 60H78V26H61v34H27v17h34v34h17V77h34z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="-58 -18 120 120"><path fill="#8A8B8D" fill-rule="evenodd" clip-rule="evenodd" d="M31 13C23.4 5.3 12.8.5 1.1.5c-23.3 0-42.3 19-42.3 42.5s18.9 42.5 42.3 42.5c13.8 0 26-6.6 33.7-16.9l-16.5-1.8C13.5 70.4 7.5 72.5 1 72.5c-16.2 0-29.3-13.2-29.3-29.4S-15.2 13.7 1 13.7c8.1 0 15.4 3.3 20.7 8.6l-10.9 11h32.5V.5L31 13z"/></svg>' }, function(t, e) { t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 19" width="28" height="19" id="ss"><defs><style>.tv-powered__logo { fill: #3BB3E4; } .tv-powered__logo--stroke { fill: #000; stroke: #000; opacity: 0.6; stroke-width: 3.5px; stroke-linecap: round; stroke-linejoin: round; }</style></defs><path d="M9.57 8.028c0-.79.642-1.433 1.433-1.433.792 0 1.433.642 1.433 1.433 0 .166-.03.325-.082.474l3.354 3.87c.164-.06.34-.095.525-.095.128 0 .252.017.37.048l5.043-5.47c-.91-1.078-2.247-1.783-3.75-1.856-1.058-1.452-2.77-2.396-4.703-2.396-3.033 0-5.523 2.323-5.79 5.286-.112-.01-.225-.015-.338-.015C4.82 7.875 3 9.695 3 11.94c0 .722.19 1.4.52 1.988L9.59 8.25c-.012-.073-.02-.147-.02-.222zm13.32 2.202c0-.52-.078-1.02-.22-1.495l-4.992 4.616c.04.138.064.283.064.434 0 .832-.675 1.507-1.507 1.507-.833 0-1.507-.674-1.507-1.506 0-.177.03-.345.087-.502L11.477 9.38c-.15.05-.307.08-.474.08-.142 0-.28-.02-.41-.06L4.03 14.645C4.777 15.48 5.86 16 7.066 16h14.992C23.683 16 25 14.68 25 13.055c0-1.337-.89-2.465-2.112-2.824" class="tv-powered__logo tv-powered__logo--stroke"/><path d="M9.57 8.028c0-.79.642-1.433 1.433-1.433.792 0 1.433.642 1.433 1.433 0 .166-.03.325-.082.474l3.354 3.87c.164-.06.34-.095.525-.095.128 0 .252.017.37.048l5.043-5.47c-.91-1.078-2.247-1.783-3.75-1.856-1.058-1.452-2.77-2.396-4.703-2.396-3.033 0-5.523 2.323-5.79 5.286-.112-.01-.225-.015-.338-.015C4.82 7.875 3 9.695 3 11.94c0 .722.19 1.4.52 1.988L9.59 8.25c-.012-.073-.02-.147-.02-.222zm13.32 2.202c0-.52-.078-1.02-.22-1.495l-4.992 4.616c.04.138.064.283.064.434 0 .832-.675 1.507-1.507 1.507-.833 0-1.507-.674-1.507-1.506 0-.177.03-.345.087-.502L11.477 9.38c-.15.05-.307.08-.474.08-.142 0-.28-.02-.41-.06L4.03 14.645C4.777 15.48 5.86 16 7.066 16h14.992C23.683 16 25 14.68 25 13.055c0-1.337-.89-2.465-2.112-2.824" class="tv-powered__logo"/></svg>' }, function(t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 19" width="28" height="19" id="ss"><defs><style>.tv-powered__logo { fill: #3BB3E4; } .tv-powered__logo--stroke { fill: #fff; stroke: #fff; opacity: 0.6; stroke-width: 3.5px; stroke-linecap: round; stroke-linejoin: round; }</style></defs><path d="M9.57 8.028c0-.79.642-1.433 1.433-1.433.792 0 1.433.642 1.433 1.433 0 .166-.03.325-.082.474l3.354 3.87c.164-.06.34-.095.525-.095.128 0 .252.017.37.048l5.043-5.47c-.91-1.078-2.247-1.783-3.75-1.856-1.058-1.452-2.77-2.396-4.703-2.396-3.033 0-5.523 2.323-5.79 5.286-.112-.01-.225-.015-.338-.015C4.82 7.875 3 9.695 3 11.94c0 .722.19 1.4.52 1.988L9.59 8.25c-.012-.073-.02-.147-.02-.222zm13.32 2.202c0-.52-.078-1.02-.22-1.495l-4.992 4.616c.04.138.064.283.064.434 0 .832-.675 1.507-1.507 1.507-.833 0-1.507-.674-1.507-1.506 0-.177.03-.345.087-.502L11.477 9.38c-.15.05-.307.08-.474.08-.142 0-.28-.02-.41-.06L4.03 14.645C4.777 15.48 5.86 16 7.066 16h14.992C23.683 16 25 14.68 25 13.055c0-1.337-.89-2.465-2.112-2.824" class="tv-powered__logo tv-powered__logo--stroke"/><path d="M9.57 8.028c0-.79.642-1.433 1.433-1.433.792 0 1.433.642 1.433 1.433 0 .166-.03.325-.082.474l3.354 3.87c.164-.06.34-.095.525-.095.128 0 .252.017.37.048l5.043-5.47c-.91-1.078-2.247-1.783-3.75-1.856-1.058-1.452-2.77-2.396-4.703-2.396-3.033 0-5.523 2.323-5.79 5.286-.112-.01-.225-.015-.338-.015C4.82 7.875 3 9.695 3 11.94c0 .722.19 1.4.52 1.988L9.59 8.25c-.012-.073-.02-.147-.02-.222zm13.32 2.202c0-.52-.078-1.02-.22-1.495l-4.992 4.616c.04.138.064.283.064.434 0 .832-.675 1.507-1.507 1.507-.833 0-1.507-.674-1.507-1.506 0-.177.03-.345.087-.502L11.477 9.38c-.15.05-.307.08-.474.08-.142 0-.28-.02-.41-.06L4.03 14.645C4.777 15.48 5.86 16 7.066 16h14.992C23.683 16 25 14.68 25 13.055c0-1.337-.89-2.465-2.112-2.824" class="tv-powered__logo"/></svg>'
}]);

