File Manager

Path: /home/liffinac1/domains/fxinvestcapital.us/public_html/db_files/a_data/

Viewing File: 242.js

(window.webpackJsonp=window.webpackJsonp||[]).push([[242],{"/ELx":function(t,e,n){"use strict";(function(e,r){var i=n("txPx").getLogger("Alerts.Price.Abstract"),o=n("pPtI").getTranslatedResolution,a=n("8woN"),s=n("Ialn"),l=e.Model.extend({constructor:function(t,n){t=this._prepareToSet(t,!0),e.Model.call(this,t,n)},_prepareToSet:function(t,e){var n,r,i;if(t)for(n in t)t.hasOwnProperty(n)&&(r=t[n],"function"==typeof this[i="_prepareToSet_"+n]&&(t[n]=this[i](r,t,e)));return t},destroy:function(){this.stopListening(),this.trigger("destroy",this)},save:function(){i.logError("[Alerts] Use disaptcher to save")},shortSymbol:function(t){return a?a.shortName(t||this.get("symbol")||""):(i.logWarn("[Alerts] can't get short symbol"),t)},resolutionReadable:function(t){return(t=t||this.get("resolution"))?o(t):""},title:function(t){var e;return e=t?this.get("symbol"):this.shortSymbol(),this.get("crossInterval")||(e=s.isRtl()?e+" "+s.forceRTLStr(" ,"+this.resolutionReadable()):e+", "+this.resolutionReadable()),e},_formatDate:function(t){return r(t||new Date).format("MMM D LTS")}});t.exports=l}).call(this,n("q1z7"),n("ldgD"))},"23IT":function(t,e,n){"use strict";var r,i;function o(t){return"line"===t.type}function a(t){return"shapes"===t.type}function s(t){return"chars"===t.type}function l(t){return"arrows"===t.type}function u(t){return"dataoffset"===t.type}function c(t){return"ohlc_open"===t.type}function d(t){return"ohlc_high"===t.type}function p(t){return"ohlc_low"===t.type}function f(t){return"ohlc_close"===t.type}function h(t){return c(t)||d(t)||p(t)||f(t)}function y(t){return"colorer"===t.type}function g(t){return"bar_colorer"===t.type}function v(t){return"bg_colorer"===t.type}function _(t){return"text_colorer"===t.type}function S(t){return"ohlc_colorer"===t.type}function m(t){return"alertcondition"===t.type}function b(t){return"Plot"!==t}function A(t){return"ohlc_bars"===t.plottype}function D(t){return"ohlc_candles"===t.plottype}n.r(e),n.d(e,"LineStudyPlotStyle",(function(){return r})),n.d(e,"isLinePlot",(function(){return o})),n.d(e,"isShapesPlot",(function(){return a})),n.d(e,"isCharsPlot",(function(){return s})),n.d(e,"isArrowsPlot",(function(){return l})),n.d(e,"isDataOffsetPlot",(function(){return u})),n.d(e,"isOhlcOpenPlot",(function(){return c})),n.d(e,"isOhlcHighPlot",(function(){return d})),n.d(e,"isOhlcLowPlot",(function(){return p})),n.d(e,"isOhlcClosePlot",(function(){return f})),n.d(e,"isOhlcPlot",(function(){return h})),n.d(e,"isColorerPlot",(function(){return y})),n.d(e,"isBarColorerPlot",(function(){return g})),n.d(e,"isBgColorerPlot",(function(){return v})),n.d(e,"isTextColorerPlot",(function(){return _})),n.d(e,"isOhlcColorerPlot",(function(){return S})),n.d(e,"isAlertConditionPlot",(function(){return m})),n.d(e,"isPlotTitleDefined",(function(){return b})),n.d(e,"isOhlcPlotStyleBars",(function(){return A})),n.d(e,"isOhlcPlotStyleCandles",(function(){return D})),n.d(e,"PlotSymbolSize",(function(){return i})),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.LineWithBreaks=7]="LineWithBreaks",t[t.AreaWithBreaks=8]="AreaWithBreaks",t[t.StepLine=9]="StepLine"}(r||(r={})),function(t){t.Auto="auto",t.Tiny="tiny",t.Small="small",t.Normal="normal",t.Large="large",t.Huge="huge"}(i||(i={}))},"4pku":function(t,e,n){"use strict";(function(e){var r=n("/ELx"),i=n("C2JW").AlertExtra,o=n("OKab").FormattersSerializer,a=n("A0ZR").AlertFrequencyController,s=n("pPtI").getServerInterval,l=n("PJXJ").ensureDurationInSeconds,u=n("M3fW").getAlertConditionTokenMap,c=n("YG2F").getAlertDefaultDescription,d=n("fkD1").getAlertDefaultName,p=["crossInterval","autoDeactivation","description","sendEmail","expired","extra","showPopup","resolution","script","scriptDeps","sendSms","sendTrueSms","sendPush","playSound","soundDuration","soundFile","symbol","noExpiration","symbolInternal","webhookUrl","name"],f=p.concat(["id"]),h=r.extend({constructor:function(t,n){var o={};["autoDeactivation","frequency","extra","crossInterval"].forEach((function(e){t.hasOwnProperty(e)&&(o[e]=t[e],delete t[e])})),e.isEmpty(o)||(this.__delayedInitAttrs=o),t.version=t.version||i.VERSION,r.call(this,t,n),this.frequencyController=new a(this)},initialize:function(){var t=this;function e(e){t.set("crossInterval",!!e)}this.on("change:extra",(function(t,n,r){n&&(n.crossInterval.unsubscribe(e),n.crossInterval.subscribe(e),t.set("crossInterval",n.crossInterval.value()))})).on("change:crossInterval",(function(t,e,n){var r=t.get("extra");e?t.set("resolution","1"):r&&r.mainSeries()&&t.set("resolution",r.mainSeries().interval)})).on("destroy",(function(){TVSettings.remove(t.TVSettingsPropertiesKey(t.id))})),this.__delayedInitAttrs&&(this.set(this.__delayedInitAttrs),delete this.__delayedInitAttrs)},set:function(t,e,n){var i;return null==t?this:(n=n||{}).noPrepare?r.prototype.set.call(this,t,e,n):("object"==typeof t?(i=t,n=e):(i={})[t]=e,i=this._prepareToSet(i),r.prototype.set.call(this,i,n))},_prepareToSet_soundDuration:function(t){t=parseInt(t);return isNaN(t)&&(t=0),l(t)},_prepareToSet_expired:function(t){return t instanceof Date?t:new Date(1e3*t)},_prepareToSet_extra:function(t){var e=this.get("extra"),n=t&&!(t instanceof i);return e&&t?t=e.update(t):n?(t=new i(t),this.set("scriptDeps",t.getDependencies())):t||(t=null),t},_prepareToSet_symbolInternal:function(t){if(t)return t},isPrice:function(){return null!==(this.get("extra")?this.get("extra").price():null)},isDrawing:function(){return!(!this.get("extra")||!this.get("extra").drawing())},isMoving:function(){return this.get("extra")&&"moving"===(this.get("extra").conditionData()||{}).type},isOHLC:function(){var t=this.get("extra");if(t&&t.alertSeries())return"MainSeries"===t.alertSeries().type},isRangeBasedStyle:function(){var t=this.get("extra"),e=t&&t.getMainSeries();return!(!e||"MainSeries"!==e.type()||!e.isRangeBasedStyle())},isComplexSymbol:function(){var t=this.get("symbolInternal");return t!==this.get("symbol")&&t},isPine:function(){var t=this.get("extra"),e=t&&t.alertSeries();return e&&e.alerts},expiredUnix:function(){
return Math.round(this.get("expired").getTime()/1e3)},defaultDescription:function(){return c(u(this))},defaultName:function(){return d(u(this))},setDefaultDescription:function(){this.set("description",this.defaultDescription())},state:function(){return this.toJSON()},toJSON:function(){var t,e,n={};for(t in this.attributes)this.attributes.hasOwnProperty(t)&&(e=this.attributes[t],n[t]=e&&"function"==typeof e.toJSON?e.toJSON():e);return n.expired&&(n.expired=this.expiredUnix()),n},prepareToSend:function(){for(var t,e,n=this.toJSON(),r={},i=f.length-1;i>=0;i--)void 0!==(e=n[t=f[i]])&&(r[t]=e),"resolution"===t&&(r[t]=s(e));return r.playSound||(delete r.soundDuration,delete r.soundFile),r.name||delete r.name,r.extra&&(r.extra=JSON.stringify(r.extra)),r},getLocalClone:function(){var t=this.toJSON(),e=p.reduce((function(e,n){return t.hasOwnProperty(n)&&(e[n]=t[n]),e}),{});return new h(e)},saveState:function(){this._oldState=this.state()},restoreState:function(t,e){!(t=t||this._oldState||{}).extra||t.extra instanceof i||(t.extra=new i(t.extra),t.scriptDeps=t.extra.getDependencies()),this.set(t),e||delete this._oldState},getSavedState:function(){var t;return this._oldState&&(t=$.extend({},this._oldState)).extra&&(t.extra=new i(t.extra),t.scriptDeps=t.extra.getDependencies()),t},createTimeFormatted:function(){var t=this.get("createTime");return t?this._formatDate(1e3*t):null},fireTimeFormatted:function(){var t=this.get("fireTime");return t?this._formatDate(1e3*t):null},TVSettingsPropertiesKey:function(){return t=this.id,"chartproperties.alertsProperties."+(t=parseInt(t));var t},getFormatter:function(){var t=this.get("extra");if(t){var e=t.alertSeries();if(e.formatter)return o.deserialize(e.formatter)}return null}});t.exports.Alert=h}).call(this,n("F/us"))},A0ZR:function(t,e,n){"use strict";n.r(e),n.d(e,"AlertFrequencyController",(function(){return s}));var r=n("n5al"),i=n("txPx"),o=n("ogJP"),a=Object(i.getLogger)("Alerts.Price.FrequencyController"),s=function(){function t(t){var e=this;this._alert=t,t.on("change:autoDeactivation",(function(t,n){var r=t.get("frequency");if(!e._isFireRateValid({frequency:r,autoDeactivation:n})){var i=e._getValidFireRate({autoDeactivation:n});i?t.set("frequency",i.frequency):(a.logError("Set invalid autoDeactivation: "+n+". Available: "+JSON.stringify(e.getAvailable())),e._setAnyValidFireRate())}})),t.on("change:frequency",(function(t,n){e._putFrequencyToExtra();var r=t.get("autoDeactivation");if(!e._isFireRateValid({frequency:n,autoDeactivation:r})){var i=e._getValidFireRate({frequency:n});i?t.set("autoDeactivation",i.autoDeactivation):(a.logError("Set invalid frequency: "+n+". Available: "+JSON.stringify(e.getAvailable())),e._setAnyValidFireRate())}}))}return t.prototype.getAvailable=function(){var t,e=this,n=this._alert.get("extra");return(null===(t=null==n?void 0:n.alertSeries())||void 0===t?void 0:t.isTVScriptStrategy)||"alerts"===(null==n?void 0:n.conditionId())?[{autoDeactivation:!1,frequency:"60"}]:function(){var t
;return Boolean(e._alert.isDrawing()&&"LineToolVertLine"===(null===(t=null==n?void 0:n.drawing())||void 0===t?void 0:t.type))}()?[{autoDeactivation:!0,frequency:"on_first_fire"}]:e._alert.get("crossInterval")?[{autoDeactivation:!0,frequency:"on_first_fire"},{autoDeactivation:!1,frequency:"on_first_fire"}]:function(){var t,e;return[null===(t=null==n?void 0:n.alertSeries())||void 0===t?void 0:t.style,null===(e=null==n?void 0:n.mainSeries())||void 0===e?void 0:e.style].filter(o.isInteger).some(r.hasProjection)}()?[{autoDeactivation:!0,frequency:"on_bar_close"},{autoDeactivation:!1,frequency:"on_bar_close"}]:[{autoDeactivation:!0,frequency:"once"},{autoDeactivation:!1,frequency:"on_first_fire"},{autoDeactivation:!1,frequency:"on_bar_close"},{autoDeactivation:!1,frequency:"60"}]},t.prototype.switchFrequencies=function(){var t=this._alert,e=t.get("frequency"),n=t.get("autoDeactivation");if(!0===n){var r=this._getValidFireRate({autoDeactivation:!0});if(r)return void t.set({autoDeactivation:r.autoDeactivation,frequency:r.frequency})}if(!1===n&&"on_first_fire"===e){var i=this._getValidFireRate({frequency:"60"});if(i)return void t.set({autoDeactivation:i.autoDeactivation,frequency:"60"})}if(!1===n){var o=this._getValidFireRate({autoDeactivation:!1});if(o)return void t.set({autoDeactivation:o.autoDeactivation,frequency:o.frequency})}this._isFireRateValid({frequency:e,autoDeactivation:n})||this._setAnyValidFireRate()},t.prototype._putFrequencyToExtra=function(){var t=this._alert.get("extra");t&&t.frequency(this._alert.get("frequency"))},t.prototype._isFireRateValid=function(t){return this.getAvailable().some((function(e){return e.frequency===t.frequency&&e.autoDeactivation===t.autoDeactivation}))},t.prototype._getValidFireRate=function(t){var e=Object.entries(t)[0],n=e[0],r=e[1],i=this.getAvailable().find((function(t){return t[n]===r}));return void 0===i?null:i},t.prototype._setAnyValidFireRate=function(){var t=this.getAvailable()[0];this._alert.set({frequency:t.frequency,autoDeactivation:t.autoDeactivation}),this._putFrequencyToExtra()},t}()},AZff:function(t,e,n){"use strict";var r;n.r(e),n.d(e,"Constants",(function(){return r})),function(t){t.DrawingIconColor="rgba( 170, 170, 170, 1)",t[t.NameLengthLimit=300]="NameLengthLimit"}(r||(r={}))},C2JW:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r="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};e.AlertExtra=f;var i=n("YFKU"),o=n("txPx").getLogger("Alerts.Extra"),a=n("dOnf").deepCopy,s=n("23IT").isAlertConditionPlot,l=n("CLNU").cleanButAmpersand,u=n("dTSQ").regExpEscape;TradingView="object"===(void 0===t?"undefined":r(t))?t.TradingView:TradingView||{},"function"!=typeof TradingView.merge&&(TradingView.merge=function(t,e){for(var n in e)"object"===r(e[n])&&t.hasOwnProperty(n)?TradingView.merge(t[n],e[n]):t[n]=e[n];return t});var c=n("dn9U"),d=n("EQCO").alertBandFactory,p=n("hY0g")
;function f(t){this._data={},this.crossInterval=new p,this.update(t)}f.VERSION=21,f.prototype.update=function(t){return t=this._prepareExtraObject(t),f._isValidExtra(t)?(this._data=t||{},this._updateCrossInterval()):o.logError("Wrong alert extra"),this},f.prototype.addDatasourse=function(t,e){this._addDatasourseToJson(this._data,t,e)},f.prototype._addDatasourseToJson=function(t,e,n){(n||t.condition[e])&&(t.condition[e]={id:n.id,plotIndex:n.plotIndex},t.statesForAlert[n.id]=n,n.plotIndex&&delete t.statesForAlert[n.id].plotIndex)},f.prototype.getDependencies=function(){var t={};for(var e in this._data.statesForAlert)if(this._data.statesForAlert.hasOwnProperty(e)){var n=this._data.statesForAlert[e];("Study"===n.type||/^study_\w+/.test(n.type))&&null!=n.studyDependencies&&n.studyDependencies.forEach((function(e){t[e.id]=e}))}return Object.keys(t).map((function(e){return t[e]})).map((function(t){return t.study=t.study.replace(/(\d)$/,"$1!"),t}))},f.prototype.updateDataSourseStates=function(){var t=this,e=this.getAvailableBands().map((function(e){return t._data.condition[e]})).filter((function(t){return!!t})).map((function(t){return t.id}));Object.keys(t._data.statesForAlert).filter((function(t){return e.indexOf(t)<0})).forEach((function(e){delete t._data.statesForAlert[e]}))},f.prototype._prepareExtraObject=function(t){if("string"==typeof t?t=JSON.parse(t):t instanceof f&&(t=t.toJSON()),f._isValidExtra(t))return t;var e=function(e){var n=c.defaults(t.conditionId||"cross");this._addDatasourseToJson(e,"mainSeries",t.mainSeries),this._addDatasourseToJson(e,"alertSeries",t.alertSeries),"moving"===n.type?(e.condition.movValue=Number(t.value),e.condition.movPeriod=Number(t.period)):"comparison"===n.type&&n.isChannel?(this._addDatasourseToJson(e,"upperBand",t.upperBand),this._addDatasourseToJson(e,"lowerBand",t.lowerBand)):"comparison"!==n.type||n.isChannel?["pine_script","pine_alertcondition_plot","strategy"].includes(n.type)||o.logError("[Alerts] Unknown condition type: "+n.type):this._addDatasourseToJson(e,"band",t.band)}.bind(this),n={version:f.VERSION,condition:{id:t.conditionId,fireInfo:t.fireInfo},statesForAlert:{}};return e(n),n},f.prototype.isValid=function(){return f._isValidExtra(this._data)},f._isValidExtra=function(t){var e=!!("object"===(void 0===t?"undefined":r(t))&&null!==t&&t.version>=f.VERSION&&t.statesForAlert&&t.condition&&t.condition.id&&t.condition.alertSeries&&t.condition.fireInfo&&(t.condition.fireInfo.type||t.condition.fireInfo.frequency));if(!e)return e;var n=Object.keys(t.statesForAlert);e=(e=e&&n.indexOf(t.condition.alertSeries.id)>=0)&&(!t.condition.mainSeries||n.indexOf(t.condition.mainSeries.id)>=0);var i=c.defaults(t.condition.id)
;return i&&"comparison"===i.type&&!i.isChannel?e=(e=e&&!!t.condition.band)&&n.indexOf(t.condition.band.id)>=0:i&&"comparison"===i.type&&i.isChannel?e=(e=(e=(e=e&&!!t.condition.upperBand)&&!!t.condition.lowerBand)&&n.indexOf(t.condition.upperBand.id)>=0)&&n.indexOf(t.condition.lowerBand.id)>=0:i&&"moving"===i.type&&(e=(e=e&&!!t.condition.movPeriod)&&!!t.condition.movValue),e},f.prototype._prepareToJSON=function(){for(var t=this.bandsObject(),e=Object.keys(t),n=0;n<e.length;n++){var r=t[e[n]];TradingView.isExistent(r.value)&&(r.value=String(r.value))}},f.prototype.toJSON=function(){return this._prepareToJSON(),a(this._data)},f.prototype.toGenAlertJSON=function(t){var e=this._patchDescription(t),n=this.toJSON();return n.message=e,n},f.prototype.state=f.prototype.toJSON,f.prototype.conditionData=function(){var t=this._data&&this._data.condition&&this._data.condition.id;if(t)return c.getData(t,this)},f.prototype.bandsObject=function(t){return this._data.statesForAlert},f.prototype.bandsArray=function(t){var e=this;t=t||"object";return this.getAvailableBands().map((function(n){return e._getSomeBand(n,t)})).filter((function(t){return!!t}))},f.prototype.price=function(t){var e=this,n=e.conditionData();if(!n||"comparison"!==n.type)return null;function r(t,n){var r=e._getSomeBand(t,"object");r&&"Value"===r.type&&void 0!==n&&(r.value=parseFloat(n),e[t](r))}function i(t){var n=e._getSomeBand(t,"object");return n&&!isNaN(n.value)&&void 0!==n.value&&null!==n.value?parseFloat(n.value):null}if(void 0!==t&&(e.conditionData().isChannel?(r("upperBand",t.upperBand||t.upper),r("lowerBand",t.lowerBand||t.lower)):r("band",t.band||t),this._updateCrossInterval()),e.conditionData().isChannel){var o=i("upperBand"),a=i("lowerBand");return null===o||null===a?null:{upper:o,lower:a}}return i("band")},f.prototype.conditionId=function(t,e){if(void 0!==t){this._data.condition.id=t;var n=c.get(this)[t];if(n&&"pine_alertcondition_plot"===n.type){var r=this.alertSeries();r.plotIndex=n.plotIndex,this.alertSeries(r)}e||this._updateCrossInterval()}return this._data.condition.id};f.prototype._patchDescription=function(t){try{var e=["alertcondition","ohlc_open","ohlc_high","ohlc_low","ohlc_close","ohlc_colorer"],n=this.getAlertSeries().getPlots();if(n&&n.length>0){n.forEach((function(n,r){if(!e.includes(n.type)){var i=new RegExp('{{plot\\("'+u(l(n.title,!0))+'"\\)}}',"gm");t=t.replace(i,"{{plot_"+r+"}}")}}));for(var r=n.length;r<=20;r++)t=t.replace("{{plot_"+r+"}}","null")}}catch(i){o.logError("AlertExtra._patchDescription error: "+i)}return t},f.prototype.getAvailableConditionParams=function(t){return["movPeriod","movValue"]},f.prototype.getAvailableOptionalBands=function(t){return["band","lowerBand","upperBand"]},f.prototype.getAvailableBands=function(t){return["band","lowerBand","upperBand","alertSeries","mainSeries"]},f.prototype.getAvailableOptionalConditions=function(t){return this.getAvailableOptionalBands().concat(this.getAvailableOptionalBands())},f.prototype.clearOptionalConditions=function(t){var e=this
;this.getAvailableOptionalConditions().forEach((function(t){delete e._data.condition[t]})),this.updateDataSourseStates(),t||this._updateCrossInterval()},f.prototype.alertSeries=function(t,e){return void 0!==t&&(this.addDatasourse("alertSeries",t),this.updateDataSourseStates(),e||this._updateCrossInterval(),this.setValidConditionId()),this._getSomeBand("alertSeries","object")},f.prototype.getAlertSeries=function(t){return this._getSomeBand("alertSeries",t)},f.prototype.mainSeries=function(t,e){return void 0!==t&&(this.addDatasourse("mainSeries",t),this.updateDataSourseStates(),e||this._updateCrossInterval()),this._getSomeBand("mainSeries","object")},f.prototype.getMainSeries=function(t){return this._getSomeBand("mainSeries",t)},f.prototype._getSomeBand=function(t,e){var n,r=e||"model",i=this._data.condition[t];if(i)return n=TradingView.merge(this._data.statesForAlert[i.id],i),"object"===r?TradingView.merge({},n):d.create(n)},f.prototype.upperBand=function(t,e){return void 0!==t&&(this.addDatasourse("upperBand",t),delete this._data.condition.band,this.updateDataSourseStates(),e||this._updateCrossInterval()),this._getSomeBand("upperBand","object")},f.prototype.getUpperBand=function(t){return this._getSomeBand("upperBand",t)},f.prototype.lowerBand=function(t,e){return void 0!==t&&(this.addDatasourse("lowerBand",t),delete this._data.condition.band,this.updateDataSourseStates(),e||this._updateCrossInterval()),this._getSomeBand("lowerBand","object")},f.prototype.getLowerBand=function(t){return this._getSomeBand("lowerBand",t)},f.prototype.band=function(t,e){return void 0!==t&&(this.addDatasourse("band",t),delete this._data.condition.upperBand,delete this._data.condition.lowerBand,this.updateDataSourseStates(),e||this._updateCrossInterval()),this._getSomeBand("band","object")},f.prototype.getBand=function(t){return this._getSomeBand("band",t)},f.prototype.value=function(t,e){return void 0!==t&&(this._data.condition.movValue=Number(t),e||this._updateCrossInterval()),this._data.condition.movValue},f.prototype.movingValue=f.prototype.value,f.prototype.period=function(t,e){return void 0!==t&&(this._data.condition.movPeriod=Number(t),e||this._updateCrossInterval()),this._data.condition.movPeriod},f.prototype.movingPeriod=f.prototype.period,f.prototype._updateCrossInterval=function(){var t=this.getAlertSeries(),e=null!==this.price()&&t&&"MainSeries"===t.type()&&!t.isRangeBasedStyle()&&!t.isSpread();this.crossInterval.setValue(e)},f.prototype.frequency=function(t){return-1!==["once","on_first_fire","on_bar_close","60"].indexOf(t)&&(this._data.condition.fireInfo.frequency=t),this._data.condition.fireInfo.frequency},f.prototype.hasAlertCondition=function(){var t=this.alertSeries();return Boolean(t.plots&&t.plots.some(s)||t.alerts&&t.alerts.conditions)},f.prototype.hasAlertFunction=function(){return Boolean(this.alertSeries().hasAlertFunction)},f.prototype.prepareAlertConditions=function(){var t=this.alertSeries(),e={};if(!t)return e;var n=Boolean(t.isTVScriptStrategy),r=Boolean(t.hasAlertFunction);if(n&&r)return{strategy_and_alerts:{
type:"strategy_and_alerts",title:(0,i.t)("Order fills and alert() function calls")},strategy:{type:"strategy",title:(0,i.t)("Order fills only")},alerts:{type:"alerts",title:(0,i.t)("alert() function calls only")}};if(n)return{strategy:{title:null,type:"strategy"}};if(r&&Object.assign(e,{alerts:{type:"alerts",title:(0,i.t)("Any alert() function call")}}),t.plots)for(var o=0;o<t.plots.length;o++){var a=t.plots[o];if(s(a))e["alertplot_"+o]={title:a.title,message:a.text,type:"pine_alertcondition_plot",plotIndex:o}}if(t.alerts&&t.alerts.conditions)for(var l in t.alerts.conditions)e[l]=t.alerts.conditions[l],e[l].type="pine_script";return e},f.prototype.drawing=function(t){if(t&&t.canHasAlert()){var e=t.stateForAlert(),n=e.plots,r=!!this.conditionData().isChannel;if((1===n.length?!r:r)&&"comparison"===this.conditionData().type)if(1===n.length){var i={};(i=TradingView.merge(i,e)).plotIndex=0,this.band(i)}else{var a={},s={};(a=TradingView.merge(a,e)).plotIndex=0,this.upperBand(a),(s=TradingView.merge(s,e)).plotIndex=1,this.lowerBand(s)}else o.logError("[Alerts] Can't set drawing to alert with current condition")}for(var l=this.bandsArray(),u=0;u<l.length;u++){if(/^LineTool.*/i.test(l[u].type))return l[u]}return null},f.prototype.getStrategy=function(t){for(var e=this.bandsArray(),n=0;n<e.length;n++){if(e[n].isTVScriptStrategy)return e[n]}return null},f.prototype.setValidConditionId=function(){var t=this.conditionId(),e=c.get(this);e[t]||this.conditionId(Object.keys(e)[0])},f.prototype.verticalLine=function(){var t=this.drawing();return t&&1===t.plots.length&&t.plots[0].offset1&&t.plots[0].offset1===t.plots[0].offset2?t:null},TradingView.AlertExtra=f}).call(this,n("yLpj"))},IWHC:function(t,e,n){"use strict";var r;n.r(e),n.d(e,"AlertCategory",(function(){return r})),function(t){t.Price="price",t.Screener="screener"}(r||(r={}))},M3fW:function(t,e,n){"use strict";n.r(e),n.d(e,"AlertConditionTokenMapType",(function(){return r})),n.d(e,"getAlertConditionTokenMap",(function(){return u}));var r,i=n("mrSG"),o=(n("HbRj"),n("YFKU")),a=n("Eyy1");!function(t){t[t.MainSeries=0]="MainSeries",t[t.Study=1]="Study",t[t.PineScript=2]="PineScript",t[t.Strategy=3]="Strategy",t[t.PineScriptAlertFunction=4]="PineScriptAlertFunction"}(r||(r={}));var s=Object(o.t)("Upper Bound: {alertChannelUpperBoundaryTitle}, Lower Bound: {alertChannelLowerBoundaryTitle}"),l=function(t){return Object(o.t)("in {count} bar",{plural:"in {count} bars",count:t}).format({count:t.toString()})};function u(t){var e=Object(a.ensureNotNull)(t.get("extra")),n=e.getAlertSeries(),o=e.conditionData();if("alerts"===o.type)return{type:r.PineScriptAlertFunction,scriptTitle:n.title({short:!0}),isStrategy:"StudyStrategy"===n.type()};if("StudyStrategy"===n.type())return{type:r.Strategy,strategyTitle:n.title()};if(["pine_script","pine_alertcondition_plot"].includes(o.type))return{type:r.PineScript,conditionTitle:o.title,conditionMessage:o.message};var u=t.getFormatter();function c(t){var e=t.getPlots();return t.title({formatter:u,withPlotTitle:e&&e.length>1})}var d="";switch(o.type){
case"moving":var p=e.movingValue(),f=e.movingPeriod();d=o.percents?p+"% "+l(f):(u?u.format(p):p)+" "+l(f);break;case"comparison":if(o.isChannel){var h=c(e.getUpperBand()),y=c(e.getLowerBand());d="("+s.format({alertChannelUpperBoundaryTitle:h,alertChannelLowerBoundaryTitle:y})+")"}else d=c(e.getBand())}var g=e.getMainSeries(),v=g?g.title({withInterval:!t.get("crossInterval")}):t.shortSymbol(),_=o.descriptionTitle||o.title;return Object(i.a)({conditionTitle:_,conditionOptions:d},"MainSeries"===n.type()?{type:r.MainSeries,alertSeries:v}:{type:r.Study,alertSeries:n.title(),mainSeries:v})}},PJXJ:function(t,e,n){"use strict";function r(t){return void 0===t&&(t=0),t<1e3?t:t/1e3}n.r(e),n.d(e,"ensureDurationInSeconds",(function(){return r}))},YG2F:function(t,e,n){"use strict";n.r(e),n.d(e,"getAlertDefaultDescription",(function(){return s}));n("HbRj");var r=n("YFKU"),i=n("M3fW"),o=Object(r.t)("{alertSeries} {alertCondition} {alertConditionOptions} on {chartSeries}"),a=Object(r.t)("{strategyName}: order {{strategy.order.action}} @ {{strategy.order.contracts}} filled on {{ticker}}. New strategy position is {{strategy.position_size}}");function s(t){switch(t.type){case i.AlertConditionTokenMapType.MainSeries:return t.alertSeries+" "+t.conditionTitle+" "+t.conditionOptions;case i.AlertConditionTokenMapType.Study:return o.format({alertSeries:t.alertSeries,chartSeries:t.mainSeries,alertCondition:t.conditionTitle,alertConditionOptions:t.conditionOptions});case i.AlertConditionTokenMapType.PineScript:return t.conditionMessage;case i.AlertConditionTokenMapType.PineScriptAlertFunction:return"";case i.AlertConditionTokenMapType.Strategy:return a.format({strategyName:t.strategyTitle})}}},dn9U:function(t,e,n){"use strict";var r=function(){function t(t,e){return e.id||(e.id=t),e}for(var e,n={cross:{title:$.t("Crossing"),type:"comparison"},crosses_from_below:{title:$.t("Crossing Up"),type:"comparison"},crosses_from_above:{title:$.t("Crossing Down"),type:"comparison"},above:{title:$.t("Greater Than"),type:"comparison"},below:{title:$.t("Less Than"),type:"comparison"},enters_channel:{title:$.t("Entering Channel"),isChannel:!0,type:"comparison"},leaves_channel:{title:$.t("Exiting Channel"),isChannel:!0,type:"comparison"},inside_channel:{title:$.t("Inside Channel"),isChannel:!0,type:"comparison"},outside_channel:{title:$.t("Outside Channel"),isChannel:!0,type:"comparison"},moving_up:{title:$.t("Moving Up"),type:"moving"},moving_down:{title:$.t("Moving Down"),type:"moving"},moving_up_percents:{title:$.t("Moving Up %"),descriptionTitle:$.t("Moving Up"),type:"moving",percents:!0},moving_down_percents:{title:$.t("Moving Down %"),descriptionTitle:$.t("Moving Down"),type:"moving",percents:!0}},r=Object.keys(n),i=r.length-1;i>=0;i--)t(e=r[i],n[e]);function o(e){var r,i,o,a,s,l,u={};e&&e.getStrategy()?i=e.prepareAlertConditions():(o=e&&e.drawing(),i=!e||e.getAlertSeries().hasUsualPlots()?n:{},o?l="LineToolVertLine"===o.type?function(t){return"cross"===t.id}:1===o.plots.length?function(t){return!t.isChannel}:2===o.plots.length?function(t){
return!!t.isChannel}:function(t){return"comparsion"===t.type}:e&&(e.hasAlertCondition()||e.hasAlertFunction())&&(i=$.extend(!0,{},i,e.prepareAlertConditions()))),r=Object.keys(i);for(var c=0;c<r.length;c++)t(s=r[c],a=i[s]),l&&!l(a)||(u[s]=a);return u}return e=null,{get:o,getData:function(t,e){var r;return(r=e?o(e)[t]:n[t])&&!r.id&&(r.id=t),r},defaults:function(t){return void 0!==t?n[t]:n},ordered:function(t,e){var n,r=o(t),i=["cross","crosses_from_below","crosses_from_above","above","below","enters_channel","leaves_channel","inside_channel","outside_channel","moving_up","moving_down","moving_up_percents","moving_down_percents"],a=["strategy_and_alerts","strategy","alerts"],s=[],l=Object.keys(r);e=e||{};for(var u=[],c=l.length-1;c>=0;c--){var d=r[l[c]];a.includes(d.type)&&u.push(d)}u.sort((function(t,e){return a.indexOf(t.id)-a.indexOf(e.id)})),u.length>0&&s.push(u);var p=[];for(c=l.length-1;c>=0;c--){d=r[l[c]];["pine_script","pine_alertcondition_plot"].includes(d.type)&&p.push(d)}p.sort((function(t,e){return t.title.localeCompare(e.title)})),p.length>0&&s.push(p);var f=t&&t.alertSeries&&t.alertSeries();if(!(f&&f.plots&&0===f.plots.length)){var h=[];for(c=0;c<i.length;c++)n=i[c],r.hasOwnProperty(n)&&h.push(r[n]);h.length>0&&s.push(h)}return e.isGrouped?s:s.flat()}}}();TradingView.AlertConditions=r,t.exports=r},fkD1:function(t,e,n){"use strict";n.r(e),n.d(e,"getAlertDefaultName",(function(){return c})),n.d(e,"getAlertFunctionNameTailLength",(function(){return d})),n.d(e,"sliceAlertName",(function(){return p}));n("HbRj");var r=n("YFKU"),i=n("M3fW"),o=n("AZff"),a=Object(r.t)("{title}: Any alert() function call"),s=Object(r.t)("{title}: alert() function calls only"),l=o.Constants.NameLengthLimit-d(a),u=o.Constants.NameLengthLimit-d(s);function c(t){switch(t.type){case i.AlertConditionTokenMapType.MainSeries:case i.AlertConditionTokenMapType.Study:case i.AlertConditionTokenMapType.PineScript:case i.AlertConditionTokenMapType.Strategy:return"";case i.AlertConditionTokenMapType.PineScriptAlertFunction:var e=t.scriptTitle,n=void 0,r=void 0;return t.isStrategy?(n=s,r=e.length>u?p(e,u):e):(n=a,r=e.length>l?p(e,l):e),n.format({title:r})}}function d(t){return t.replace("{title}","").length}function p(t,e){return t.substr(0,e-"…".length)+"…"}}}]);