(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[10399,47365],{57761:(e,t,i)=>{"use strict";i.d(t,{OptionsDialogController:()=>o});var s=i(111393);let r;class o extends s.DialogRenderer{constructor(){super(...arguments),this._dialog=null,this._subscribe=e=>{this._setVisibility(e)}}show(e){this._load(e).then((e=>e.show()))}hide(){var e;null===(e=this._dialog)||void 0===e||e.hide()}static getInstance(){return r||(r=new o),r}_load(e){return Promise.all([i.e(18562),i.e(32662),i.e(5987),i.e(98996),i.e(43387),i.e(66458),i.e(5761),i.e(4343),i.e(4908),i.e(70621),i.e(62033),i.e(13633),i.e(69749),i.e(37132),i.e(36701),i.e(63276),i.e(70651),i.e(29647),i.e(81543),i.e(36748),i.e(22144),i.e(57103),i.e(2730),i.e(90385),i.e(59255),i.e(75953),i.e(3419),i.e(62526),i.e(79727),i.e(34315),i.e(64198)]).then(i.bind(i,499054)).then((t=>{var i,s;return null===(i=this._dialog)||void 0===i||i.hide(),null===(s=this._dialog)||void 0===s||s.visible().unsubscribe(this._subscribe),this._dialog=new t.OptionsDialogRenderer(e),this._dialog.visible().subscribe(this._subscribe),this._dialog}))}}},254526:(e,t,i)=>{"use strict";i.d(t,{SYMBOL_TYPE_BLACK_LIST:()=>s});const s=new Set(["spread","economic"])},250378:(e,t,i)=>{"use strict";i.d(t,{BadRequestErrorResponse:()=>r});var s=i(867023);class r extends s.ErrorResponse{constructor(e){super(e),this.name="BadRequestError",e.error?this.message=e.error:this.message="unknown error"}}},867023:(e,t,i)=>{"use strict";i.d(t,{ErrorResponse:()=>s});class s{constructor(e){this._status=e.status,this._statusText=e.statusText||""}getInfo(){return{name:this.name,status:this._status,statusText:this._statusText,message:this.message}}}},685503:(e,t,i)=>{"use strict";i.d(t,{HttpErrorResponse:()=>r});var s=i(867023);class r extends s.ErrorResponse{constructor(e){super(e),this.name="HttpErrorResponse",this._status>=200&&this._status<300?this.message=`Http failure during parsing for ${e.url||"(unknown url)"}`:this.message=`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`}}},159954:(e,t,i)=>{"use strict";i.d(t,{SymbolDoesNotExistErrorResponse:()=>r});var s=i(867023);class r extends s.ErrorResponse{constructor(e){super(e),this.name="SymbolDoesNotExistError",this.message=e.error||"symbol does not exist"}}},163482:(e,t,i)=>{"use strict";i.d(t,{TECHNICALS_QS_FIELDS:()=>s,TECHNICALS_SCREENER_COLUMNS:()=>a,requiredMAColumns:()=>l,requiredOscColumns:()=>o,requiredPivotsColumns:()=>n,requiredRecommendColumns:()=>r}) ;const s=["type","listed_exchange","pricescale","typespecs","pro_name","short_name"],r=["Recommend.Other","Recommend.All","Recommend.MA"],o=["RSI","Stoch.K","CCI20","ADX","AO","Mom","MACD.macd","Stoch.RSI.K","W.R","BBPower","UO"],l=["EMA10","SMA10","EMA20","SMA20","EMA30","SMA30","EMA50","SMA50","EMA100","SMA100","EMA200","SMA200","Ichimoku.BLine","VWMA","HullMA9"],n=["Pivot.M.Classic.S3","Pivot.M.Classic.S2","Pivot.M.Classic.S1","Pivot.M.Classic.Middle","Pivot.M.Classic.R1","Pivot.M.Classic.R2","Pivot.M.Classic.R3","Pivot.M.Fibonacci.S3","Pivot.M.Fibonacci.S2","Pivot.M.Fibonacci.S1","Pivot.M.Fibonacci.Middle","Pivot.M.Fibonacci.R1","Pivot.M.Fibonacci.R2","Pivot.M.Fibonacci.R3","Pivot.M.Camarilla.S3","Pivot.M.Camarilla.S2","Pivot.M.Camarilla.S1","Pivot.M.Camarilla.Middle","Pivot.M.Camarilla.R1","Pivot.M.Camarilla.R2","Pivot.M.Camarilla.R3","Pivot.M.Woodie.S3","Pivot.M.Woodie.S2","Pivot.M.Woodie.S1","Pivot.M.Woodie.Middle","Pivot.M.Woodie.R1","Pivot.M.Woodie.R2","Pivot.M.Woodie.R3","Pivot.M.Demark.S1","Pivot.M.Demark.Middle","Pivot.M.Demark.R1"],a=[...r,...o,...l,...n]},719885:(e,t,i)=>{"use strict";i.d(t,{TechnicalsDialogController:()=>h});var s=i(583912),r=i(111393),o=i(729030),l=i(254526),n=i(163482);let a;class h extends r.DialogRenderer{constructor(){super(...arguments),this._dialog=null,this._subscribe=e=>{this._setVisibility(e)}}async show(e){const t=(null==e?void 0:e.symbol)?e.symbol:s.linking.proSymbol.value();if(null==e?void 0:e.snapshot){const{snapshot:i}=e,s=await this._loadModule();this._getDialog(s,{...e,symbol:t,...i,exchange:i.listed_exchange}).show()}else{const s=async()=>{const{snapshoter:e}=await i.e(51030).then(i.bind(i,795394));return e().getSnapshot(t,new Set(n.TECHNICALS_QS_FIELDS))},[r,o]=await Promise.all([this._loadModule(),s()]);if("error"===o.status)return void this._getDialog(r,{...e,symbol:t}).show();this._getDialog(r,{...e,symbol:t,...o.values,exchange:o.values.listed_exchange}).show()}}async canBeShown(e){const t=e||s.linking.proSymbol.value();if(!t)return!1;const r=new Set([...n.TECHNICALS_QS_FIELDS,"description"]),a=await(async()=>{const{snapshoter:e}=await i.e(51030).then(i.bind(i,795394));return e().getSnapshot(t,r)})();if("error"===a.status)return!1;const{values:{type:h,listed_exchange:u,description:c}}=a;if(!l.SYMBOL_TYPE_BLACK_LIST.has(h))try{const e=await(0,o.getSymbolData)(null,t,["Recommend.All"]);return Boolean(e&&0!==Object.keys(e).length&&c&&u&&h)}catch(e){return!1}return!1}hide(){var e;null===(e=this._dialog)||void 0===e||e.hide()}static getInstance(){return a||(a=new h),a}_getDialog(e,t){var i,s;return null===(i=this._dialog)||void 0===i||i.hide(),null===(s=this._dialog)||void 0===s||s.visible().unsubscribe(this._subscribe),this._dialog=new e.TechnicalsDialogRenderer(t),this._dialog.visible().subscribe(this._subscribe),this._dialog}_loadModule(){ return Promise.all([i.e(18562),i.e(37729),i.e(32662),i.e(5987),i.e(98996),i.e(66458),i.e(5761),i.e(4343),i.e(28430),i.e(70428),i.e(70621),i.e(62033),i.e(13633),i.e(37132),i.e(14),i.e(36701),i.e(63276),i.e(70651),i.e(29647),i.e(81543),i.e(72100),i.e(48277),i.e(22144),i.e(57103),i.e(86307),i.e(37138),i.e(25749),i.e(33665),i.e(55075),i.e(90385),i.e(79727),i.e(63974),i.e(71138)]).then(i.bind(i,168218))}}},528474:(e,t,i)=>{"use strict";i.d(t,{blendColors:()=>r});var s=i(724377);const r=(e,t)=>(0,s.rgbaToString)((0,s.blendRgba)((0,s.parseRgba)(e),(0,s.parseRgba)(t)))},196726:(e,t,i)=>{"use strict";i.d(t,{preventDefault:()=>r,preventScrollByWheelClick:()=>l,wrapHandlerWithPreventEvent:()=>o});var s=i(638456);function r(e){e.cancelable&&e.preventDefault()}function o(e){return t=>{r(t),e()}}function l(e){s.isChrome&&e.addEventListener("mousedown",(e=>{if(1===e.button)return e.preventDefault(),!1}))}},675128:(e,t,i)=>{"use strict";function s(e){let t=null;return()=>(null===t&&(t=e()),t)}i.d(t,{lazyValue:()=>s})},589026:(e,t,i)=>{"use strict";i.d(t,{BondYieldCurveDialogController:()=>o});var s=i(111393);let r;class o extends s.DialogRenderer{constructor(){super(...arguments),this._dialog=null,this._subscribe=e=>{this._setVisibility(e)}}show(e){this._load(e).then((e=>e.show()))}hide(){var e;null===(e=this._dialog)||void 0===e||e.hide()}static getInstance(){return r||(r=new o),r}_load(e){return Promise.all([i.e(18562),i.e(60977),i.e(32662),i.e(5987),i.e(98996),i.e(43387),i.e(66458),i.e(5761),i.e(4343),i.e(4908),i.e(70621),i.e(62033),i.e(13633),i.e(61204),i.e(37132),i.e(36701),i.e(63276),i.e(70651),i.e(29647),i.e(81543),i.e(22144),i.e(57103),i.e(29146),i.e(90385),i.e(59255),i.e(62526),i.e(79727),i.e(15678)]).then(i.bind(i,288084)).then((t=>{var i,s;return null===(i=this._dialog)||void 0===i||i.hide(),null===(s=this._dialog)||void 0===s||s.visible().unsubscribe(this._subscribe),this._dialog=new t.BondYieldCurveDialogRenderer(e),this._dialog.visible().subscribe(this._subscribe),this._dialog}))}}},273058:(e,t,i)=>{"use strict";i.d(t,{EtfAnalysisDialogController:()=>o});var s=i(111393);let r;class o extends s.DialogRenderer{constructor(){super(...arguments),this._dialog=null,this._subscribe=e=>{this._setVisibility(e)}}show(e){this._load(e).then((e=>e.show()))}hide(){var e;null===(e=this._dialog)||void 0===e||e.hide()}static getInstance(){return r||(r=new o),r}_load(e){return Promise.all([i.e(18562),i.e(68716),i.e(19515),i.e(23025),i.e(58863),i.e(32662),i.e(5987),i.e(98996),i.e(43387),i.e(66458),i.e(5761),i.e(4343),i.e(4908),i.e(70621),i.e(62033),i.e(13633),i.e(37132),i.e(14),i.e(36827),i.e(37657),i.e(16600),i.e(36701),i.e(63276),i.e(70651),i.e(29647),i.e(81543),i.e(10637),i.e(22144),i.e(57254),i.e(67463),i.e(90365),i.e(3891),i.e(52499),i.e(57103),i.e(82578),i.e(98993),i.e(72833),i.e(85819),i.e(29861),i.e(96356),i.e(1273),i.e(84303),i.e(79487),i.e(82338),i.e(73044),i.e(92913),i.e(90385),i.e(65417),i.e(79727),i.e(29508),i.e(2022),i.e(36853),i.e(1238),i.e(53108),i.e(58534)]).then(i.bind(i,161365)).then((t=>{var i,s ;return null===(i=this._dialog)||void 0===i||i.hide(),null===(s=this._dialog)||void 0===s||s.visible().unsubscribe(this._subscribe),this._dialog=new t.EtfAnalysisDialogRenderer(e),this._dialog.visible().subscribe(this._subscribe),this._dialog}))}}},232650:(e,t,i)=>{"use strict";i.d(t,{openFinancialsWebview:()=>c});var s=i(195269),r=i(675128),o=i(671040),l=i(6613) ;const n=new Set(["number_of_employees","web_site_url","founded","ceo","market_cap_basic","dividends_yield","price_earnings_ttm","earnings_per_share_basic_ttm","currency_code","fundamental_currency_code","float_shares_outstanding","total_shares_outstanding","total_revenue_fy_h","total_revenue_fq_h","total_revenue_fh_h","net_income_fy_h","net_income_fq_h","net_income_fh_h","total_assets_fy_h","total_assets_fq_h","total_assets_fh_h","total_liabilities_fy_h","total_liabilities_fq_h","total_liabilities_fh_h","cash_f_operating_activities_fy_h","cash_f_operating_activities_fq_h","cash_f_operating_activities_fh_h","cash_f_investing_activities_fy_h","cash_f_investing_activities_fq_h","cash_f_investing_activities_fh_h","cash_f_financing_activities_fy_h","cash_f_financing_activities_fq_h","cash_f_financing_activities_fh_h","fiscal_period_fy_h","fiscal_period_fq_h","fiscal_period_fh_h","interest_income_fy_h","interest_income_fq_h","interest_income_fh_h","non_interest_income_fy_h","non_interest_income_fq_h","non_interest_income_fh_h","earnings_release_date_fq_h","earnings_release_date_fy_h","earnings_release_date_fh_h","earnings_release_next_date_fq","earnings_release_next_date_fy","earnings_release_next_date_fh","earnings_release_next_time","earnings_release_next_date","is_next_earnings_release_date_estimated","earnings_per_share_forecast_next_fq","earnings_per_share_forecast_next_fy","earnings_per_share_forecast_next_fh","earnings_per_share_forecast_fq_h","earnings_per_share_forecast_fy_h","earnings_per_share_forecast_fh_h","earnings_per_share_fq_h","earnings_per_share_fy_h","earnings_per_share_fh_h","earnings_fiscal_period_fq_h","earnings_fiscal_period_fy_h","earnings_fiscal_period_fh_h","next_earnings_fiscal_period_fq","next_earnings_fiscal_period_fy","next_earnings_fiscal_period_fh","revenue_fq_h","revenue_fy_h","revenue_fh_h","revenue_forecast_fq_h","revenue_forecast_fy_h","revenue_forecast_fh_h","revenue_forecast_next_fq","revenue_forecast_next_fy","revenue_forecast_next_fh","fundamental_currency_code","dividend_payout_ratio_ttm","dividends_yield_current","dividend_ex_date_upcoming","dividend_amount_upcoming","dividend_amount_recent","dividend_ex_date_recent","dividend_amount_h","total_revenue_fy","gross_profit_fy","ebitda_fy","ebit_fy","net_income_fy","fiscal_period_fy","fiscal_period_fy_h","fiscal_period_fq_h","fiscal_period_fh_h","total_debt_fy_h","total_debt_fq_h","total_debt_fh_h","free_cash_flow_fy_h","free_cash_flow_fq_h","free_cash_flow_fh_h","cash_n_equivalents_fy_h","cash_n_equivalents_fq_h","cash_n_equivalents_fh_h","loans_net_fy_h","loans_net_fq_h","loans_net_fh_h","total_deposits_fy_h","total_deposits_fq_h","total_deposits_fh_h","loan_loss_allowances_fy_h","loan_loss_allowances_fq_h","loan_loss_allowances_fh_h","insurance_reserves_fy_h","insurance_reserves_fq_h","insurance_reserves_fh_h","policy_claims_fy_h","policy_claims_fq_h","policy_claims_fh_h","premiums_earned_fy_h","premiums_earned_fq_h","premiums_earned_fh_h","common_equity_tier1_ratio_fy_h","common_equity_tier1_ratio_fq_h","common_equity_tier1_ratio_fh_h","tier1_capital_ratio_fy_h","tier1_capital_ratio_fq_h","tier1_capital_ratio_fh_h","total_capital_ratio_fy_h","total_capital_ratio_fq_h","total_capital_ratio_fh_h","fiscal_period_fy_h","fiscal_period_fq_h","fiscal_period_fh_h","reserve_to_total_capital_fy_h","reserve_to_total_capital_fq_h","reserve_to_total_capital_fh_h","unearned_premium_to_total_capital_fy_h","unearned_premium_to_total_capital_fq_h","unearned_premium_to_total_capital_fh_h","fundamental_currency_code","total_current_assets_fy","total_current_assets_fq","total_current_assets_fh","total_current_liabilities_fy","total_current_liabilities_fq","total_current_liabilities_fh","total_non_current_assets_fy","total_non_current_assets_fq","total_non_current_assets_fh","total_non_current_liabilities_fy","total_non_current_liabilities_fq","total_non_current_liabilities_fh","fiscal_period_fy","fiscal_period_fq","fiscal_period_fh","fundamental_currency_code","price_earnings_fq_h","price_earnings_fy_h","price_earnings_fh_h","price_sales_fq_h","price_sales_fy_h","price_sales_fh_h","fiscal_period_fy_h","fiscal_period_fq_h","fiscal_period_fh_h","market_cap_basic","diluted_net_income_ttm","total_revenue_ttm","price_earnings_current","price_sales_current","fundamental_currency_code","revenue_seg_by_business_h","revenue_seg_by_region_h","fiscal_period_fy","interest_income_fy","interest_income_fq","interest_income_fh","non_interest_income_fy","non_interest_income_fq","non_interest_income_fh","interest_expense_fy","interest_expense_fq","interest_expense_fh","loan_loss_provision_fy","loan_loss_provision_fq","loan_loss_provision_fh","non_interest_expense_fy","non_interest_expense_fq","non_interest_expense_fh","non_oper_income_fy","non_oper_income_fq","non_oper_income_fh","unusual_expense_inc_fy","unusual_expense_inc_fq","unusual_expense_inc_fh","pretax_income_fy","pretax_income_fq","pretax_income_fh","total_revenue_fy","total_revenue_fq","total_revenue_fh","gross_profit_fy","gross_profit_fq","gross_profit_fh","net_income_fy","net_income_fq","net_income_fh","cost_of_goods_fy","cost_of_goods_fq","cost_of_goods_fh","operating_expenses_fy","operating_expenses_fq","operating_expenses_fh","oper_income_fy","oper_income_fq","oper_income_fh","total_non_oper_income_fy","total_non_oper_income_fq","total_non_oper_income_fh","income_tax_fy","income_tax_fq","income_tax_fh","after_tax_other_income_fy","after_tax_other_income_fq","after_tax_other_income_fh","fiscal_period_fy","fiscal_period_fq","fiscal_period_fh","equity_in_earnings_fy","equity_in_earnings_fq","equity_in_earnings_fh","minority_interest_exp_fy","minority_interest_exp_fq","minority_interest_exp_fh","discontinued_operations_fy","discontinued_operations_fq","discontinued_operations_fh","fundamental_currency_code","fund_view_mode"]),a=(0, r.lazyValue)((()=>new o.QuoteSessionSnapshoter({name:"financials-webview-quotes",fields:[...n]})));let h;class u extends s.WebviewControllerBase{open(e){const t=this._createOpenRequest(s.WebviewPageName.Financials,e);a().getSnapshot(t.symbol(),n);t.execute().ChartQuoteSnapshotProvider={getQuoteSnapshot(){var e;const i=l.QUOTE_FIELDS_CACHE.get(t.symbol());return null!==(e=null==i?void 0:i.values)&&void 0!==e?e:{}}}}static getInstance(){return h||(h=new u),h}}function c(e){u.getInstance().open(e)}},497763:(e,t,i)=>{"use strict";i.d(t,{SERIES_COLORS:()=>r,getColorByIndex:()=>l,getItemByIndex:()=>o});var s=i(195294);const r=[s.colorsPalette["color-tv-blue-a200"],s.colorsPalette["color-sky-blue-300"],s.colorsPalette["color-banana-yellow-900"],s.colorsPalette["color-deep-blue-a100"],s.colorsPalette["color-banana-yellow-700"],s.colorsPalette["color-tv-blue-300"],s.colorsPalette["color-grapes-purple-a100"],s.colorsPalette["color-tv-blue-400"],s.colorsPalette["color-minty-green-300"],s.colorsPalette["color-berry-pink-300"],s.colorsPalette["color-tv-blue-a100"],s.colorsPalette["color-tan-orange-a200"],s.colorsPalette["color-iguana-green-400"],s.colorsPalette["color-ripe-red-400"],s.colorsPalette["color-sky-blue-300"],s.colorsPalette["color-banana-yellow-600"],s.colorsPalette["color-berry-pink-a200"],s.colorsPalette["color-tv-blue-200"],s.colorsPalette["color-banana-yellow-900"]];function o(e,t){const i=e[t%e.length];return i||e[0]}function l(e,t=r){return o(t,e)}},436901:(e,t,i)=>{"use strict";i.d(t,{DEFAULT_MAX_DATA_ARRAY_LENGTH:()=>s,FULL_MAX_DATA_ARRAY_LENGTH:()=>r});const s=5,r=7},610203:(e,t,i)=>{"use strict";i.d(t,{PeriodId:()=>s,convertFrequencyToPeriod:()=>_,generateTooltipValues:()=>w,getChartSeriesArray:()=>C,getDataFromQuotes:()=>S,getFinancialsDataFromQuotes:()=>M,getFinancialsSets:()=>m,getFormattedPeriodsEnds:()=>D,getHistoricPeriodsDataFromQuotes:()=>P,getPerformanceSet:()=>v,getPeriodData:()=>f,getPeriodDataFromFinancials:()=>I,getPeriodsDataFromQuotes:()=>T,getTooltipValuesGeneratorWithOptions:()=>x,isQuoteValuesNull:()=>L,pastPerformanceColors:()=>d});var s,r=i(650151),o=i(444372),l=i(157954),n=i(497763),a=i(530254),h=i(904310),u=i(436901),c=i(195294);!function(e){e.Year="FY",e.Quarter="FQ",e.HalfYear="FH"}(s||(s={}));const d=[c.colorsPalette["color-tv-blue-a200"],c.colorsPalette["color-sky-blue-300"]];function _(e){return e&&2===e?s.HalfYear:s.Quarter}function p(e){if(e)return["banking"===e?{title:o.t(null,void 0,i(1017)),fields:["interest_income","non_interest_income"]}:"total_revenue","net_income"]}function v(e,t){return{id:"income statements",title:o.t(null,void 0,i(663089)),chartType:"compare",marginTitle:o.t(null,void 0,i(861008)),fields:p(e),currency:t}}function m(e,t){return[{id:"income statements",title:o.t(null,void 0,i(506823)),chartType:"compare",marginTitle:o.t(null,void 0,i(861008)),fields:p(e),currency:t},{id:"balance sheet",title:o.t(null,void 0,i(730737)),chartType:"compare",marginTitle:o.t(null,void 0,i(981922)),fields:["total_assets","total_liabilities"],currency:t},{id:"cash flow", title:o.t(null,void 0,i(822755)),chartType:"lines",fields:["cash_f_operating_activities","cash_f_investing_activities","cash_f_financing_activities"],currency:t}]}function y(e){return e.hasOwnProperty("title")}function b(e){return y(e)?e.title:(0,r.ensureDefined)({total_revenue:o.t(null,void 0,i(259285)),net_income:o.t(null,void 0,i(485672)),total_assets:o.t(null,void 0,i(697554)),total_liabilities:o.t(null,void 0,i(475385)),cash_f_operating_activities:o.t(null,void 0,i(404621)),cash_f_investing_activities:o.t(null,void 0,i(418959)),cash_f_financing_activities:o.t(null,void 0,i(517831))}[e])}function g(e,t,i,s=u.DEFAULT_MAX_DATA_ARRAY_LENGTH){if(!y(e))return S(e,t,i,s);const r=e.fields.map((e=>S(e,t,i,s))),o=[];for(let e=0;et[e]));o.push(t.every((e=>null===e))?null:t.reduce(((e,t)=>e+(t||0)),0))}return o}function S(e,t,i,s=u.DEFAULT_MAX_DATA_ARRAY_LENGTH){const r=i[t];if(!r)return[];return r[e].slice(0,s).reverse()}function f(e,t,i=u.DEFAULT_MAX_DATA_ARRAY_LENGTH){const s=e[t];if(s)return s.slice(0,i).reverse()}function C(e,t,i,s=0,o){if(!e.fields)return[];switch(e.chartType){case"compare":const l=e.fields.map(((l,a)=>({type:"bar",name:b((0,r.ensureDefined)(l)),valueType:"numbers",values:g((0,r.ensureDefined)(l),t,(0,r.ensureDefined)(i)),defaultColor:(0,n.getColorByIndex)(a+s,o),showInLegend:!0,buildTooltip:x({unit:e.currency})}))),a=l[0].values.map(((e,t)=>{const i=l[1].values[t];return null===e||null===i?null:0===e?0:i/e*100}));return l.push({type:"line",name:(0,r.ensureDefined)(e.marginTitle),valueType:"percents",values:a,defaultColor:(0,n.getColorByIndex)(e.fields.length+s),showInLegend:!0,buildTooltip:w}),l;case"lines":return e.fields.map(((o,l)=>({type:"line",name:b((0,r.ensureDefined)(o)),valueType:"numbers",values:g((0,r.ensureDefined)(o),t,(0,r.ensureDefined)(i)),defaultColor:(0,n.getColorByIndex)(l+s),showInLegend:!0,buildTooltip:x({unit:e.currency})})));default:return[]}}function w(e,t,i,s){var o,l;const n=e.values[i];if(null===n)return null;const u=(0,a.format)(n,e.valueType);return[{title:null===(o=null==s?void 0:s.capitalizeFirstLetter)||void 0===o||o?(0,h.capitalizeFirstLetter)(e.name.toLowerCase()):e.name,color:null!==(l=null==s?void 0:s.color)&&void 0!==l?l:(0,r.ensureDefined)(e.defaultColor),value:u,unit:null==s?void 0:s.unit,endSlot:null==s?void 0:s.endSlot}]}function x(e){return(t,i,s)=>w(t,0,s,e)}function P(e){const{fiscal_period_fy_h:t,fiscal_period_fq_h:i,fiscal_period_fh_h:r}=e;if(t||i||r)return{[s.Year]:t,[s.Quarter]:i,[s.HalfYear]:r}}function T(e){const{fiscal_period_fy:t,fiscal_period_fq:i,fiscal_period_fh:r}=e;if(t||i||r)return{[s.Year]:t,[s.Quarter]:i,[s.HalfYear]:r}}function I(e){var t,i,r;if(!e)return;const o=null===(t=e[s.Year])||void 0===t?void 0:t.fiscal_period,l=null===(i=e[s.Quarter])||void 0===i?void 0:i.fiscal_period,n=null===(r=e[s.HalfYear])||void 0===r?void 0:r.fiscal_period;return o||l||n?{[s.Year]:o,[s.Quarter]:l,[s.HalfYear]:n}:void 0}function D(e,t,i){if(!e)return[];const r=function(e){ const{fiscal_period_end_fy_h:t,fiscal_period_end_fq_h:i,fiscal_period_end_fh_h:r}=e;if(t||i||r)return{[s.Year]:t,[s.Quarter]:i,[s.HalfYear]:r}}(e);if(!r)return;const o=new l.DateFormatter("MMM yyyy"),n=r[t];return n?n.slice(0,i).reverse().map((e=>{if(!e)return"";const t=new Date(1e3*e);return o.formatLocal(t)})):[]}function M(e){const{total_revenue_fy_h:t,total_revenue_fq_h:i,total_revenue_fh_h:r,net_income_fy_h:o,net_income_fq_h:l,net_income_fh_h:n,total_assets_fy_h:a,total_assets_fq_h:h,total_assets_fh_h:u,total_liabilities_fy_h:c,total_liabilities_fq_h:d,total_liabilities_fh_h:_,cash_f_operating_activities_fy_h:p,cash_f_operating_activities_fq_h:v,cash_f_operating_activities_fh_h:m,cash_f_investing_activities_fy_h:y,cash_f_investing_activities_fq_h:b,cash_f_investing_activities_fh_h:g,cash_f_financing_activities_fy_h:S,cash_f_financing_activities_fq_h:f,cash_f_financing_activities_fh_h:C,fiscal_period_fy_h:w,fiscal_period_fq_h:x,fiscal_period_fh_h:T,interest_income_fy_h:I,interest_income_fq_h:D,interest_income_fh_h:M,non_interest_income_fy_h:R,non_interest_income_fq_h:k,non_interest_income_fh_h:E,fund_view_mode:V}=e,A=P(e);if(A){const{[s.Year]:e,[s.Quarter]:P,[s.HalfYear]:B}=A,N=!e||"industrial"===V&&L(t),F=!P||"industrial"===V&&L(i),O=!B;return{[s.Year]:N?void 0:{total_revenue:t,net_income:o,total_assets:a,total_liabilities:c,cash_f_operating_activities:p,cash_f_investing_activities:y,cash_f_financing_activities:S,fiscal_period:w,interest_income:I,non_interest_income:R},[s.Quarter]:F?void 0:{total_revenue:i,net_income:l,total_assets:h,total_liabilities:d,cash_f_operating_activities:v,cash_f_investing_activities:b,cash_f_financing_activities:f,fiscal_period:x,interest_income:D,non_interest_income:k},[s.HalfYear]:O?void 0:{total_revenue:r,net_income:n,total_assets:u,total_liabilities:_,cash_f_operating_activities:m,cash_f_investing_activities:g,cash_f_financing_activities:C,fiscal_period:T,interest_income:M,non_interest_income:E}}}}function L(e){return!e||e.every((e=>null===e))}},713931:(e,t,i)=>{"use strict";i.d(t,{hideDetailsDialogs:()=>h});var s=i(57761),r=i(719885),o=i(988534),l=i(316478),n=i(273058),a=i(589026);function h(e){"forecast"!==e&&function(){const e=l.ForecastDialogController.getInstance();e.visible()&&e.hide()}(),"technicals"!==e&&function(){const e=r.TechnicalsDialogController.getInstance();e.visible()&&e.hide()}(),"financials"!==e&&function(){const e=o.FinancialsDialogController.getInstance();e.visible()&&e.hide()}(),"options"!==e&&function(){const e=s.OptionsDialogController.getInstance();e.visible()&&e.hide()}(),"etf-analysis"!==e&&function(){const e=n.EtfAnalysisDialogController.getInstance();e.visible()&&e.hide()}(),"bond-yield-curve"!==e&&function(){const e=a.BondYieldCurveDialogController.getInstance();e.visible()&&e.hide()}()}},988534:(e,t,i)=>{"use strict";i.d(t,{FinancialsDialogController:()=>o});var s=i(111393);let r;class o extends s.DialogRenderer{constructor(){super(...arguments),this._dialog=null,this._subscribe=e=>{this._setVisibility(e)}}show(e){this._load(e).then((e=>e.show()))} hide(){var e;null===(e=this._dialog)||void 0===e||e.hide()}static getInstance(){return r||(r=new o),r}_load(e){return Promise.all([i.e(18562),i.e(68716),i.e(13268),i.e(32662),i.e(5987),i.e(98996),i.e(43387),i.e(66458),i.e(5761),i.e(4343),i.e(28430),i.e(70428),i.e(44597),i.e(1413),i.e(4908),i.e(52078),i.e(70621),i.e(89508),i.e(62033),i.e(13633),i.e(69749),i.e(19216),i.e(37132),i.e(14),i.e(36827),i.e(37657),i.e(31149),i.e(85258),i.e(36701),i.e(79656),i.e(83483),i.e(45444),i.e(61576),i.e(63276),i.e(63751),i.e(70651),i.e(29647),i.e(87473),i.e(81543),i.e(10637),i.e(72100),i.e(71093),i.e(48277),i.e(66233),i.e(22144),i.e(77208),i.e(57254),i.e(31500),i.e(90365),i.e(3891),i.e(52499),i.e(57103),i.e(82578),i.e(98993),i.e(72833),i.e(20850),i.e(96356),i.e(1273),i.e(84303),i.e(24319),i.e(95939),i.e(15906),i.e(84028),i.e(73044),i.e(61567),i.e(90385),i.e(65417),i.e(79727),i.e(29508),i.e(2022),i.e(36853),i.e(16298),i.e(1238),i.e(8943),i.e(24878)]).then(i.bind(i,386388)).then((t=>{var i,s;return null===(i=this._dialog)||void 0===i||i.hide(),null===(s=this._dialog)||void 0===s||s.visible().unsubscribe(this._subscribe),this._dialog=new t.FinancialsDialogRenderer(e),this._dialog.visible().subscribe(this._subscribe),this._dialog}))}}},700134:(e,t,i)=>{"use strict";i.d(t,{showFinancialsDialog:()=>o});var s=i(988534),r=i(713931);function o(e){s.FinancialsDialogController.getInstance().show({...e,onOpen:()=>{(0,r.hideDetailsDialogs)("financials")}})}},316478:(e,t,i)=>{"use strict";i.d(t,{ForecastDialogController:()=>l});var s=i(111393),r=i(583912);let o;class l extends s.DialogRenderer{constructor(){super(...arguments),this._dialog=null,this._subscribe=e=>{this._setVisibility(e)}}show(e){this._load(e).then((e=>e.show()))}hide(){var e;null===(e=this._dialog)||void 0===e||e.hide()}async canBeShown(e){const t=e||r.linking.proSymbol.value(),s=new Set(["recommendation_mark","pro_name"]),o=await(async()=>{const{snapshoter:e}=await i.e(62495).then(i.bind(i,960669));return e().getSnapshot(t,s)})();return!("error"===o.status||!o.values.recommendation_mark)}static getInstance(){return o||(o=new l),o}_load(e){return Promise.all([i.e(18562),i.e(68716),i.e(25026),i.e(32662),i.e(5987),i.e(98996),i.e(66458),i.e(5761),i.e(4343),i.e(28430),i.e(70428),i.e(4908),i.e(70621),i.e(62033),i.e(13633),i.e(37132),i.e(14),i.e(36827),i.e(36701),i.e(69430),i.e(63276),i.e(70651),i.e(29647),i.e(81543),i.e(10637),i.e(42900),i.e(72100),i.e(48277),i.e(22144),i.e(57254),i.e(3891),i.e(52499),i.e(57103),i.e(86307),i.e(96356),i.e(1273),i.e(97539),i.e(84303),i.e(89448),i.e(25749),i.e(15906),i.e(56099),i.e(90385),i.e(65417),i.e(79727),i.e(29508),i.e(36853),i.e(1238),i.e(63974),i.e(85080)]).then(i.bind(i,450602)).then((t=>{var i,s;return null===(i=this._dialog)||void 0===i||i.hide(),null===(s=this._dialog)||void 0===s||s.visible().unsubscribe(this._subscribe),this._dialog=new t.ForecastDialogRenderer(e),this._dialog.visible().subscribe(this._subscribe),this._dialog}))}}},714215:e=>{e.exports={wrap:"wrap-tm3FiOQl",content:"content-tm3FiOQl",contentWithTab:"contentWithTab-tm3FiOQl", group:"group-tm3FiOQl",subtitle:"subtitle-tm3FiOQl",text:"text-tm3FiOQl",tabsWrapper:"tabsWrapper-tm3FiOQl",tabsContentWrapper:"tabsContentWrapper-tm3FiOQl",groupIcon:"groupIcon-tm3FiOQl",beforeMarketOpen:"beforeMarketOpen-tm3FiOQl",afterMarketClose:"afterMarketClose-tm3FiOQl",groupTitle:"groupTitle-tm3FiOQl",groupRow:"groupRow-tm3FiOQl",groupCell:"groupCell-tm3FiOQl",mob:"mob-tm3FiOQl",mini:"mini-tm3FiOQl",generalContent:"generalContent-tm3FiOQl"}},671040:(e,t,i)=>{"use strict";i.d(t,{QuoteSessionSnapshoter:()=>u});var s=i(433084),r=i(707957),o=i(266325),l=i(541558),n=i(6613),a=i(461909);const h=new Map([["change","ch"],["last_price","lp"],["change_percent","chp"]]);new Map([["ch","change"],["lp","last_price"],["chp","change_percent"]]);class u{constructor(e){if(this._onSymbolData=new r.Delegate,this._incomplete=new Set,this._connected=!1,this._batcher=null,this._handler=e=>{switch(e.method){case"connected":this._connected||(this._connected=!0,this._handleConnected());break;case"quote_symbol_data":this._connected&&this._handleSymbolData(e.params[0]);break;case"quote_completed":this._connected&&this._handleCompleteData(e.params[0]);break;case"disconnected":this._connected&&(this._connected=!1,this._batcher=null)}},0===e.fields.length)throw new Error('Support for empty "fields" array is not implemented');const{provider:t=s.QuoteSession}=e;this._fields=new Set(e.fields),this._session=new t(window.ChartApiInstance,["snapshoter",e.name,(0,l.randomHash)()].filter(Boolean).join("_")),this._session.connect(this._handler)}getSnapshotSync(e,t){const i=u.cache.get(e);return i&&this._isSnapshotReady(i,t)?i:null}getSnapshotsForAllSync(e,t){return e.map((e=>this.getSnapshotSync(e,t)))}getSnapshot(e,t,i){var s;const r=null!==(s=null==i?void 0:i.signal)&&void 0!==s?s:null;return new Promise(((i,s)=>{if(r&&r.aborted)throw(0,o.createAbortError)();const l=()=>{this._onSymbolData.unsubscribe(this,n),s((0,o.createAbortError)())},n=(s=e)=>{if(s!==e)return!1;const o=u.cache.get(e);return!(!o||!this._isSnapshotReady(o,t))&&(this._onSymbolData.unsubscribe(this,n),null==r||r.removeEventListener("abort",l),i(o),!0)};if(!n()&&(null==r||r.addEventListener("abort",l,{once:!0}),this._onSymbolData.subscribe(this,n),!this._incomplete.has(e))){if(this._incomplete.add(e),!this._connected)return;if(null===this._batcher){const t=this._batcher={symbols:new Set([e]),promise:Promise.resolve().then((()=>{this._batcher===t&&(this._session.quoteAddSymbols([...t.symbols]),this._batcher=null)}))}}else this._batcher.symbols.add(e)}}))}getSnapshotsForAll(e,t,i){return Promise.all(e.map((e=>this.getSnapshot(e,t,i))))}static relax(e){return e}static isSuccess(e){return"error"!==e.status}static hasAllFields(e,t){for(const i of Array.from(t))if(!e.hasOwnProperty(i))return!1;return!0}_isSnapshotReady(e,t){return"error"===e.status||this._hasAllFields(e,t)}_hasAllFields(e,t){return u.hasAllFields(e.values,Array.from(t))}_handleConnected(){if(this._fields.size>0){const e=[...this._fields].map((e=>{var t;return null!==(t=h.get(e))&&void 0!==t?t:e})) ;this._session.quoteSetFields(e)}this._incomplete.size>0&&this._session.quoteAddSymbols([...this._incomplete])}_handleCompleteData(e){var t;const i=null!==(t=u.cache.get(e))&&void 0!==t?t:{symbolname:e,status:"ok",values:{}};u.cache.update(i,this._fields,!0),this._session.quoteRemoveSymbols([e]),this._incomplete.delete(e),this._onSymbolData.fire(e)}_handleSymbolData(e){(0,a.normalizeUpdateMode)(e.values);const t=e.symbolname;u.cache.update(e,this._fields,!1),"error"===e.status?this._handleCompleteData(t):this._onSymbolData.fire(t)}}u.cache=n.QUOTE_FIELDS_CACHE},111393:(e,t,i)=>{"use strict";i.d(t,{DialogRenderer:()=>r});var s=i(401580);class r{constructor(){this._container=document.createElement("div"),this._visibility=new s.WatchedValue(!1)}visible(){return this._visibility.readonly()}_setVisibility(e){this._visibility.setValue(e)}}},226663:(e,t,i)=>{"use strict";i.d(t,{LollipopGroupIcons:()=>s,LollipopTooltipContentRow:()=>h});var s,r=i(50959),o=i(497754),l=i.n(o),n=i(83436),a=i(714215);function h(e){const{name:t,value:i,style:s,valueStyle:o,onValueClick:h,valueRightIcon:u,className:c}=e;return r.createElement("div",{className:l()(a.groupRow,c),style:s},t&&r.createElement("div",{className:a.groupCell},r.createElement("span",{className:a.text},t)),r.createElement("div",{className:a.groupCell},r.createElement("span",{className:a.text,style:o,onClick:h},i),u&&r.createElement(n.Icon,{icon:u.iconContent,className:l()(a.groupIcon,u.iconClass,"apply-common-tooltip"),title:u.tooltipText})))}!function(e){e[e.BeforeMarketOpen=a.beforeMarketOpen]="BeforeMarketOpen",e[e.AfterMarketClose=a.afterMarketClose]="AfterMarketClose"}(s||(s={}))},431912:(e,t,i)=>{"use strict";i.d(t,{MouseEventHandler:()=>v,defaultPreventedHandler:()=>_,ignoreClickOrTapOnDblClickOrDblTapHandlers:()=>p,isTouchMouseEvent:()=>d});var s=i(895171),r=i(650151),o=i(638456),l=i(389137),n=i(196726),a=i(86121);let h=2;const u=o.isSafari?"click":"auxclick",c={treatVertTouchDragAsPageScroll:!1,treatHorzTouchDragAsPageScroll:!1,ignoreClickAndTapOnDblClickOrDblTap:!1};function d(e){return"isTouch"in e&&"stylus"in e}function _(e){return t=>{t.preventDefault(),e(t)}}function p(e){let t=!1;return{clickOrTap:(...i)=>{t=!1,setTimeout((()=>!t&&e.clickOrTap(...i)),501)},doubleClickOrDoubleTap:(...i)=>{var s;t=!0,null===(s=e.doubleClickOrDoubleTap)||void 0===s||s.call(e,...i)}}}class v{constructor(e,t,i){if(this._clickCount=0,this._clickTimeoutId=null,this._clickPosition={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY},this._tapCount=0,this._tapTimeoutId=null,this._tapPosition={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY},this._longTapTimeoutId=null,this._longTapActive=!1,this._mouseMoveStartPosition=null,this._touchMoveStartPosition=null,this._touchMoveExceededManhattanDistance=!1,this._cancelClick=!1,this._cancelTap=!1,this._unsubscribeOutsideMouseEvents=null,this._unsubscribeOutsideTouchEvents=null,this._unsubscribeMobileSafariEvents=null,this._unsubscribeMousemove=null,this._unsubscribeRootMouseEvents=null,this._unsubscribeRootTouchEvents=null, this._pinchInfo=null,this._pinchPrevented=!1,this._preventTouchDragProcess=!1,this._mousePressed=!1,this._lastTouchEventTimeStamp=0,this._activeTouchId=null,this._acceptMouseLeave=!o.CheckMobile.iOS(),this._onFirefoxOutsideMouseUp=e=>{this._mouseUpHandler(e)},this._onMobileSafariDoubleClick=e=>{if(this._firesTouchEvents(e)){const t=this._makeCompatEvent(e);if(++this._tapCount,this._tapTimeoutId&&this._tapCount>1){const{manhattanDistance:i}=this._touchMouseMoveWithDownInfo(y(e),this._tapPosition);i<30&&!this._cancelTap&&this._processTouchEvent(t,this._handlers.doubleTapEvent),this._resetTapTimeout()}}else{const t=this._makeCompatEvent(e);if(++this._clickCount,this._clickTimeoutId&&this._clickCount>1){const{manhattanDistance:i}=this._touchMouseMoveWithDownInfo(y(e),this._clickPosition);i<5&&!this._cancelClick&&this._processMouseEvent(t,this._handlers.mouseDoubleClickEvent),this._resetClickTimeout()}}},this._target=e,this._options=(0,l.merge)((0,l.clone)(c),i||{}),this._options.ignoreClickAndTapOnDblClickOrDblTap){if(t.mouseClickEvent&&t.mouseDoubleClickEvent){const e=p({clickOrTap:t.mouseClickEvent.bind(t),doubleClickOrDoubleTap:t.mouseDoubleClickEvent.bind(t)});t.mouseClickEvent=e.clickOrTap,t.mouseDoubleClickEvent=e.doubleClickOrDoubleTap}if(t.tapEvent&&t.doubleTapEvent){const e=p({clickOrTap:t.tapEvent.bind(t),doubleClickOrDoubleTap:t.doubleTapEvent.bind(t)});t.tapEvent=e.clickOrTap,t.doubleTapEvent=e.doubleClickOrDoubleTap}}this._handlers=t,this._init()}destroy(){null!==this._unsubscribeOutsideMouseEvents&&(this._unsubscribeOutsideMouseEvents(),this._unsubscribeOutsideMouseEvents=null),null!==this._unsubscribeOutsideTouchEvents&&(this._unsubscribeOutsideTouchEvents(),this._unsubscribeOutsideTouchEvents=null),null!==this._unsubscribeMousemove&&(this._unsubscribeMousemove(),this._unsubscribeMousemove=null),null!==this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null),null!==this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null),null!==this._unsubscribeMobileSafariEvents&&(this._unsubscribeMobileSafariEvents(),this._unsubscribeMobileSafariEvents=null),this._clearLongTapTimeout(),this._resetClickTimeout()}_mouseEnterHandler(e){this._unsubscribeMousemove&&this._unsubscribeMousemove();const t=this._mouseMoveHandler.bind(this);if(this._unsubscribeMousemove=()=>{this._target.removeEventListener("mousemove",t)},this._target.addEventListener("mousemove",t),this._firesTouchEvents(e))return;const i=this._makeCompatEvent(e);this._processMouseEvent(i,this._handlers.mouseEnterEvent),this._acceptMouseLeave=!0}_resetClickTimeout(){null!==this._clickTimeoutId&&clearTimeout(this._clickTimeoutId),this._clickCount=0,this._clickTimeoutId=null,this._clickPosition={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY}}_resetTapTimeout(){null!==this._tapTimeoutId&&clearTimeout(this._tapTimeoutId),this._tapCount=0,this._tapTimeoutId=null,this._tapPosition={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY}}_mouseMoveHandler(e){ if(this._mousePressed||null!==this._touchMoveStartPosition)return;if(this._firesTouchEvents(e))return;const t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handlers.mouseMoveEvent),this._acceptMouseLeave=!0}_touchMoveHandler(e){const t=S(e.changedTouches,(0,r.ensureNotNull)(this._activeTouchId));if(null===t)return;if(this._lastTouchEventTimeStamp=g(e),null!==this._pinchInfo)return;if(this._preventTouchDragProcess)return;this._pinchPrevented=!0;const i=this._touchMouseMoveWithDownInfo(y(t),(0,r.ensureNotNull)(this._touchMoveStartPosition)),{xOffset:s,yOffset:o,manhattanDistance:l}=i;if(this._touchMoveExceededManhattanDistance||!(l<5)){if(!this._touchMoveExceededManhattanDistance){const e=.5*s,t=o>=e&&!this._options.treatVertTouchDragAsPageScroll,i=e>o&&!this._options.treatHorzTouchDragAsPageScroll;t||i||(this._preventTouchDragProcess=!0),this._touchMoveExceededManhattanDistance=!0,this._cancelTap=!0,this._clearLongTapTimeout(),this._resetTapTimeout()}if(!this._preventTouchDragProcess){const i=this._makeCompatEvent(e,t);this._processTouchEvent(i,this._handlers.touchMoveEvent),(0,n.preventDefault)(e)}}}_mouseMoveWithDownHandler(e){if(0!==e.button)return;const t=this._touchMouseMoveWithDownInfo(y(e),(0,r.ensureNotNull)(this._mouseMoveStartPosition)),{manhattanDistance:i}=t;if(i>=5&&(this._cancelClick=!0,this._resetClickTimeout()),this._cancelClick){const t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handlers.pressedMouseMoveEvent)}}_touchMouseMoveWithDownInfo(e,t){const i=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);return{xOffset:i,yOffset:s,manhattanDistance:i+s}}_touchEndHandler(e){let t=S(e.changedTouches,(0,r.ensureNotNull)(this._activeTouchId));if(null===t&&0===e.touches.length&&(t=e.changedTouches[0]),null===t)return;this._activeTouchId=null,this._lastTouchEventTimeStamp=g(e),this._clearLongTapTimeout(),this._touchMoveStartPosition=null,this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null);const i=this._makeCompatEvent(e,t);if(this._processTouchEvent(i,this._handlers.touchEndEvent),++this._tapCount,this._tapTimeoutId&&this._tapCount>1){const{manhattanDistance:e}=this._touchMouseMoveWithDownInfo(y(t),this._tapPosition);e<30&&!this._cancelTap&&this._processTouchEvent(i,this._handlers.doubleTapEvent),this._resetTapTimeout()}else this._cancelTap||(this._processTouchEvent(i,this._handlers.tapEvent),this._handlers.tapEvent&&(0,n.preventDefault)(e));0===this._tapCount&&(0,n.preventDefault)(e),0===e.touches.length&&this._longTapActive&&(this._longTapActive=!1,(0,n.preventDefault)(e))}_touchCancelHandler(e){this._touchEndHandler(e)}_mouseUpHandler(e){if(0!==e.button)return;const t=this._makeCompatEvent(e);if(this._mouseMoveStartPosition=null,this._mousePressed=!1,this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null),o.isFF){this._target.ownerDocument.documentElement.removeEventListener("mouseleave",this._onFirefoxOutsideMouseUp)} if(!this._firesTouchEvents(e))if(this._processMouseEvent(t,this._handlers.mouseUpEvent),++this._clickCount,this._clickTimeoutId&&this._clickCount>1){const{manhattanDistance:i}=this._touchMouseMoveWithDownInfo(y(e),this._clickPosition);i<5&&!this._cancelClick&&this._processMouseEvent(t,this._handlers.mouseDoubleClickEvent),this._resetClickTimeout()}else this._cancelClick||this._processMouseEvent(t,this._handlers.mouseClickEvent)}_clearLongTapTimeout(){null!==this._longTapTimeoutId&&(clearTimeout(this._longTapTimeoutId),this._longTapTimeoutId=null)}_touchStartHandler(e){if(null!==this._activeTouchId)return this._clearLongTapTimeout(),void this._resetTapTimeout();const t=e.changedTouches[0];this._activeTouchId=t.identifier,this._lastTouchEventTimeStamp=g(e);const i=this._target.ownerDocument.documentElement;this._cancelTap=!1,this._touchMoveExceededManhattanDistance=!1,this._preventTouchDragProcess=!1,this._touchMoveStartPosition=y(t),this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null);{const t=this._touchMoveHandler.bind(this),s=this._touchEndHandler.bind(this);this._unsubscribeRootTouchEvents=()=>{i.removeEventListener("touchmove",t),i.removeEventListener("touchend",s)},i.addEventListener("touchmove",t,{passive:!1}),i.addEventListener("touchend",s,{passive:!1}),this._clearLongTapTimeout(),this._longTapTimeoutId=setTimeout(this._longTapHandler.bind(this,e),240)}const s=this._makeCompatEvent(e,t);this._processTouchEvent(s,this._handlers.touchStartEvent),this._tapTimeoutId||(this._tapCount=0,this._tapTimeoutId=setTimeout(this._resetTapTimeout.bind(this),500),this._tapPosition=y(t))}_wheelClickHandler(e){if(1!==e.button)return;if(this._firesTouchEvents(e))return;const t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handlers.wheelClickEvent)}_mouseDownHandler(e){if(0!==e.button)return;const t=this._target.ownerDocument.documentElement;o.isFF&&t.addEventListener("mouseleave",this._onFirefoxOutsideMouseUp),this._cancelClick=!1,this._mouseMoveStartPosition=y(e),this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null);{const e=this._mouseMoveWithDownHandler.bind(this),i=this._mouseUpHandler.bind(this);this._unsubscribeRootMouseEvents=()=>{t.removeEventListener("mousemove",e),t.removeEventListener("mouseup",i)},t.addEventListener("mousemove",e),t.addEventListener("mouseup",i)}if(this._mousePressed=!0,this._firesTouchEvents(e))return;const i=this._makeCompatEvent(e);this._processMouseEvent(i,this._handlers.mouseDownEvent),this._clickTimeoutId||(this._clickCount=0,this._clickTimeoutId=setTimeout(this._resetClickTimeout.bind(this),500),this._clickPosition=y(e))}_init(){this._target.addEventListener("mouseenter",this._mouseEnterHandler.bind(this)),this._target.addEventListener("touchcancel",this._touchCancelHandler.bind(this));{const e=this._target.ownerDocument,t=e=>!e.target||!this._target.contains(e.target),i=e=>{if(!t(e))return;const i=e.changedTouches[0];this._lastTouchEventTimeStamp=g(e), this._processTouchEvent(this._makeCompatEvent(e,i),this._handlers.touchStartOutsideEvent)},s=e=>{t(e)&&!this._firesTouchEvents(e)&&this._processMouseEvent(this._makeCompatEvent(e),this._handlers.mouseDownOutsideEvent)};this._unsubscribeOutsideTouchEvents=()=>{e.removeEventListener("touchstart",i)},this._unsubscribeOutsideMouseEvents=()=>{e.removeEventListener("mousedown",s)},e.addEventListener("mousedown",s),e.addEventListener("touchstart",i,{passive:!0})}o.CheckMobile.iOS()&&(this._unsubscribeMobileSafariEvents=()=>{this._target.removeEventListener("dblclick",this._onMobileSafariDoubleClick)},this._target.addEventListener("dblclick",this._onMobileSafariDoubleClick)),this._target.addEventListener("mouseleave",this._mouseLeaveHandler.bind(this)),this._target.addEventListener("contextmenu",this._contextMenuHandler.bind(this)),this._target.addEventListener("touchstart",this._touchStartHandler.bind(this),{passive:!0}),(0,n.preventScrollByWheelClick)(this._target),this._target.addEventListener("mousedown",this._mouseDownHandler.bind(this)),this._target.addEventListener(u,this._wheelClickHandler.bind(this)),this._initPinch(),this._target.addEventListener("touchmove",(()=>{}),{passive:!1})}_initPinch(){void 0===this._handlers.pinchStartEvent&&void 0===this._handlers.pinchEvent&&void 0===this._handlers.pinchEndEvent||(this._target.addEventListener("touchstart",(e=>this._checkPinchState(e.touches)),{passive:!0}),this._target.addEventListener("touchmove",(e=>{if(null===this._pinchInfo)return;const t=S(e.touches,(0,r.ensureNotNull)(this._activeTouchId)),i=S(e.touches,this._pinchInfo.secondTouchId);if(t&&i&&void 0!==this._handlers.pinchEvent){const{startPinchDistance:s,startPinchMiddlePoint:r}=this._pinchInfo,o=b(t,i)/s,l=m(this._target);this._handlers.pinchEvent(r,{x:t.clientX-l.left,y:t.clientY-l.top},{x:i.clientX-l.left,y:i.clientY-l.top},o),(0,n.preventDefault)(e)}}),{passive:!1}),this._target.addEventListener("touchend",(e=>{this._checkPinchState(e.touches)})))}_checkPinchState(e){1===e.length&&(this._pinchPrevented=!1),2!==e.length||this._pinchPrevented||this._longTapActive?this._stopPinch():this._startPinch(e)}_startPinch(e){if(void 0!==this._handlers.pinchStartEvent&&null===this._pinchInfo){const t=m(this._target);let i,s;e[0].identifier===this._activeTouchId?(i=e[0],s=e[1]):(i=e[1],s=e[0]);const r={x:i.clientX-t.left,y:i.clientY-t.top},o={x:s.clientX-t.left,y:s.clientY-t.top},l={x:(r.x+o.x)/2,y:(r.y+o.y)/2};this._handlers.pinchStartEvent(l,r,o,{bothPointsOnTargetElement:this._target.contains(s.target)})&&(this._pinchInfo={startPinchDistance:b(i,s),startPinchMiddlePoint:l,secondTouchId:s.identifier})}this._clearLongTapTimeout()}_stopPinch(){var e,t;null!==this._pinchInfo&&(this._pinchInfo=null,null===(t=(e=this._handlers).pinchEndEvent)||void 0===t||t.call(e))}_mouseLeaveHandler(e){if(this._unsubscribeMousemove&&this._unsubscribeMousemove(),this._firesTouchEvents(e))return;if(!this._acceptMouseLeave)return;const t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handlers.mouseLeaveEvent), this._acceptMouseLeave=!o.CheckMobile.iOS()}_longTapHandler(e){const t=S(e.touches,(0,r.ensureNotNull)(this._activeTouchId));if(null===t)return;const i=this._makeCompatEvent(e,t);this._processTouchEvent(i,this._handlers.longTapEvent),this._processTouchEvent(i,this._handlers.touchContextMenuEvent),this._cancelTap=!0,this._longTapActive=!0}_contextMenuHandler(e){if((0,n.preventDefault)(e),null!==this._touchMoveStartPosition)return;if(this._firesTouchEvents(e))return;const t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handlers.contextMenuEvent),this._cancelClick=!0}_firesTouchEvents(e){return e.sourceCapabilities&&void 0!==e.sourceCapabilities.firesTouchEvents?e.sourceCapabilities.firesTouchEvents:g(e)0?h--:("mouseleave"!==e.srcType&&(0,a.setLastMouseOrTouchEventInfo)(e),t&&t.call(this._handlers,e))}_makeCompatEvent(e,t){const i=t||e,r=(0,s.default)((()=>this._target.getBoundingClientRect()||{left:0,top:0}));return{clientX:i.clientX,clientY:i.clientY,pageX:i.pageX,pageY:i.pageY,screenX:i.screenX,screenY:i.screenY,get localX(){return i.clientX-r().left},get localY(){return i.clientY-r().top},ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,isTouch:!e.type.startsWith("mouse")&&"contextmenu"!==e.type&&"click"!==e.type,stylus:"stylus"===(null==t?void 0:t.touchType),srcType:e.type,target:i.target,view:e.view,preventDefault:()=>{"touchstart"!==e.type&&(0,n.preventDefault)(e)}}}}function m(e){return e.getBoundingClientRect()||{left:0,top:0}}function y(e){return{x:e.pageX,y:e.pageY}}function b(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return Math.sqrt(i*i+s*s)}function g(e){return e.timeStamp||performance.now()}function S(e,t){for(let i=0;i{"use strict";i.d(t,{WebviewControllerBase:()=>o,WebviewPageName:()=>s});var s,r=i(583912);!function(e){e.Financials="financials",e.Forecast="forecast",e.Details="details",e.Technicals="technicals",e.EtfAnalysis="etf-analysis"}(s||(s={}));class o{_createOpenRequest(e,t=new URLSearchParams){var i;const s=null!==(i=t.get("symbol"))&&void 0!==i?i:r.linking.symbol.value();return t.set("symbol",s),{execute(){const i=new URL(`webview/${e}/`,location.origin);return i.search=t.toString(),window.open(i,"_blank")},symbol:()=>s}}}},548587:(e,t,i)=>{"use strict";i.d(t,{barFunctionByStyle:()=>r});var s=i(544421);function r(e,t){switch(e){case 12:return(0,s.barFunction)("low","low","close");case 2:case 18:case 20:case 14:case 15:case 3:case 10:case 13:return(0,s.barFunction)(null!=t?t:"close");default:return(0,s.barFunction)("close","open")}}},65455:(e,t,i)=>{"use strict";function s(e,t,i=0){t.setValue(e.value());const s={};return e.subscribe(s,(e=>{t.setValue(e.value())})),1===i&&t.subscribe(s,(t=>{e.setValue(t.value())})),()=>{e.unsubscribeAll(s), 1===i&&t.unsubscribeAll(s)}}i.d(t,{bindProperties:()=>s})},790524:(e,t,i)=>{"use strict";i.d(t,{isLineToolState:()=>l,isMainSeriesState:()=>r,isStudyLineToolState:()=>n,isStudyState:()=>o});var s=i(616117);function r(e){return"MainSeries"===e.type}function o(e){return Boolean(e.type)&&e.type.toLowerCase().startsWith("study")}function l(e){return Boolean(e.type)&&(0,s.isLineToolName)(e.type)}function n(e){return Boolean(e.type)&&(0,s.isStudyLineToolName)(e.type)}},177126:(e,t,i)=>{"use strict";i.d(t,{getDataVendorString:()=>r});var s=i(244842);function r(e){return null==e||s.enabled("bovespa_widget")?null:"QUANDL"===e.exchange?"Quandl.com":["BMFBOVESPA","BME","NAG","TSE","TFX","NZX","BCBA","TWSE","TASE","EURONEXT","TOCOM","BMV","SIX","SGX","GPW","SWB","BCS","WB","SZSE","BELEX","BAHRAIN","EGX","TADAWUL","BVL","LUXSE","DFM","BVC","NSENG","IDX","HSI","QSE","OSE"].includes(e.exchange)?"ICE Data Services":null}},958067:(e,t,i)=>{"use strict";i.d(t,{availableDateFormats:()=>y,dateFormatFunctions:()=>v,defaultDateFormat:()=>b,getDateFormatWithWeekday:()=>m});var s=i(444372),r=i(39654),o=i(702053);const l={1:()=>s.t(null,void 0,i(795425)),2:()=>s.t(null,void 0,i(835050)),3:()=>s.t(null,void 0,i(651369)),4:()=>s.t(null,void 0,i(442762)),5:()=>s.t(null,{context:"short"},i(227991)),6:()=>s.t(null,void 0,i(715224)),7:()=>s.t(null,void 0,i(6215)),8:()=>s.t(null,void 0,i(38465)),9:()=>s.t(null,void 0,i(757902)),10:()=>s.t(null,void 0,i(73546)),11:()=>s.t(null,void 0,i(671230)),12:()=>s.t(null,void 0,i(92203))},n=(e,t)=>(t?e.getMonth():e.getUTCMonth())+1,a=(e,t)=>t?e.getFullYear():e.getUTCFullYear(),h=e=>e.toLocaleDateString(window.language?(0,r.getIsoLanguageCodeFromLanguage)(window.language):void 0,{weekday:"short",timeZone:"UTC"}),u=(e,t)=>(0,o.numberToStringWithLeadingZero)(((e,t)=>t?e.getDate():e.getUTCDate())(e,t),2),c=(e,t)=>l[n(e,t)](),d=(e,t)=>(0,o.numberToStringWithLeadingZero)(n(e,t),2),_=(e,t)=>(0,o.numberToStringWithLeadingZero)(a(e,t)%100,2),p=(e,t)=>(0,o.numberToStringWithLeadingZero)(a(e,t),4),v={"dd MMM 'yy":(e,t)=>`${u(e,t)} ${c(e,t)} '${_(e,t)}`,"MMM 'yy":(e,t)=>`${c(e,t)} '${_(e,t)}`,"MMM dd, yyyy":(e,t)=>`${c(e,t)} ${u(e,t)}, ${p(e,t)}`,"MMM yyyy":(e,t)=>`${c(e,t)} ${p(e,t)}`,"MMM dd":(e,t)=>`${c(e,t)} ${u(e,t)}`,"dd MMM":(e,t)=>`${u(e,t)} ${c(e,t)}`,"yyyy-MM-dd":(e,t)=>`${p(e,t)}-${d(e,t)}-${u(e,t)}`,"yy-MM-dd":(e,t)=>`${_(e,t)}-${d(e,t)}-${u(e,t)}`,"yy/MM/dd":(e,t)=>`${_(e,t)}/${d(e,t)}/${u(e,t)}`,"yyyy/MM/dd":(e,t)=>`${p(e,t)}/${d(e,t)}/${u(e,t)}`,"dd-MM-yyyy":(e,t)=>`${u(e,t)}-${d(e,t)}-${p(e,t)}`,"dd-MM-yy":(e,t)=>`${u(e,t)}-${d(e,t)}-${_(e,t)}`,"dd/MM/yy":(e,t)=>`${u(e,t)}/${d(e,t)}/${_(e,t)}`,"dd/MM/yyyy":(e,t)=>`${u(e,t)}/${d(e,t)}/${p(e,t)}`,"MM/dd/yy":(e,t)=>`${d(e,t)}/${u(e,t)}/${_(e,t)}`,"MM/dd/yyyy":(e,t)=>`${d(e,t)}/${u(e,t)}/${p(e,t)}`};function m(e){return"ja"===window.language?(t,i)=>`${v[e](t,i)} (${h(t)})`:(t,i)=>`${h(t)} ${v[e](t,i)}`}const y=Object.keys(v),b=()=>-1!==["ja","ko","zh","zh_TW"].indexOf(window.language||"")?"yyyy-MM-dd":"dd MMM 'yy"},682103:(e,t,i)=>{"use strict" ;function s(e,t){const i=Math.floor(t/1e4)%1e4,s=Math.floor(t/100)%100-1,r=t%100;return e.format(new Date(Date.UTC(i,s,r)))}i.d(t,{formatYYYYMMDD:()=>s})},531094:(e,t,i)=>{"use strict";i.d(t,{getVolumeUnit:()=>r});var s=i(444372);function r(e){switch(e.volume_type){case"base":return e.base_currency||void 0;case"quote":return e.currency||void 0;case"tick":return s.t(null,void 0,i(130973))}}},995874:(e,t,i)=>{"use strict";i.d(t,{roundToThirdDigit:()=>r});var s=i(182436);function r(e,t){const i=new s.NumericFormatter(3),r=new s.NumericFormatter(2),o=Math.abs(Math.round(1e3*e)/1e3),l=o.toFixed(3).split(".")[1];return`${e<0?"−":""}${(t||"0"!==l[l.length-1]?i:r).format(o)}`}},334652:(e,t,i)=>{"use strict";i.d(t,{alwaysShowLastPriceAndLastDayChange:()=>s,lastDayChangeAvailable:()=>r});i(244842);const s=!1,r=!0},986837:(e,t,i)=>{"use strict";i.d(t,{LollipopPaneView:()=>d});var s=i(650151),r=i(86441),o=i(389137),l=i(142119),n=i(294162),a=i(758363),h=i(382778),u=i(315801),c=i(431912);class d{constructor(e,t,i){this._invalidated=!1,this._renderer=new l.CompositeRenderer,this._textWidthCache=new n.TextWidthCache,this._stylesCache=null,this._lollipops={},this._lollipopsCounter=0,this._lastClickedId=null,this.onPaneBgChange=()=>{this._recreateStyles(this._model)},this._lastClickedId=null,this._model=e,this._source=t,this._clickHandler=i,this._recreateStyles(e),e.backgroundColor().subscribe(this.onPaneBgChange),e.mainSeries().onSymbolIntervalChanged().subscribe(this,this._onSymbolOrIntervalChanged)}destroy(){this._model.backgroundColor().unsubscribe(this.onPaneBgChange),this._model.mainSeries().onSymbolIntervalChanged().unsubscribeAll(this)}processClickOutside(e,t){var i;if(null===this._lastClickedId||!t)return void this.clearLastClicked();let o=null;if((0,c.isTouchMouseEvent)(t))o=new r.Point(t.clientX,t.clientY);else if(function(e){return void 0!==e.touches}(t)){if(1!==t.touches.length)return;{const e=(0,s.ensureNotNull)(t.target).getBoundingClientRect(),i=t.touches[0];o=new r.Point(i.clientX-e.left,i.clientY-e.top)}}else o=new r.Point(t.offsetX,t.offsetY);const l=this._renderer.hitTest(o,e);null!==l&&(null===(i=l.data())||void 0===i?void 0:i.activeItem)===(0,s.ensureDefined)(this._lollipops[this._lastClickedId]).itemIndex||this.clearLastClicked()}clearLastClicked(){const e=null!==this._lastClickedId&&this._lollipops[this._lastClickedId]||null;null!==e&&(e.active=!1),this._lastClickedId=null}getLastClickedLollipopId(){return this._lastClickedId}update(){this._invalidated=!0}afterUpdate(e,t,i,s){}getStyle(e,t){let i=t;if(e.stack&&(i+="_stack:"+e.stack),"active"===i)return this._activeStyle;if("hovered"===i)return this._hoveredStyle;if("default"===i)return this._defaultStyle;if(this._stylesCache||(this._stylesCache={}),!this._stylesCache[i]){const s=(0,o.clone)("active"===t?this._activeStyle:"hovered"===t?this._hoveredStyle:this._defaultStyle);e.stack&&(s.lollipop.incHeight=25*e.stack),this._stylesCache[i]=s}return this._stylesCache[i]}hasTooltip(e){return!0}_getY(){let e=0;const t=this._model.panes();for(let i=t.length;i--;){ const s=t[i];s.containsMainSeries()&&(e+=s.height())}return e}_showBarLine(e){return this.hasTooltip(e)&&(e.hovered||e.active)}_createRenderers(e){const{mediaSize:t}=e;this._renderer.clear();for(const i in this._lollipops)if(this._lollipops.hasOwnProperty(i)){const o=(0,s.ensureDefined)(this._lollipops[i]);if(o.visible){const i=this._getLollipopStatus(o),s=this.getStyle(o,i),l={id:o.id,centerPoint:new r.Point(o.basePoint.x,o.basePoint.y-s.lollipop.bottom-s.lollipop.height/2-(s.lollipop.incHeight||0)),style:s,status:i},n={activeItem:o.itemIndex,hideCrosshairLinesOnHover:!0,clickHandler:this._lollipopMouseClickHandler.bind(this,e,l,t),tapHandler:this._lollipopMouseClickHandler.bind(this,e,l,t)};if(this._renderer.append(this._createRendererForLollipop(l,n)),this._showBarLine(o)){const{strokeStyle:e,lineStyle:t,lineWidth:i}=s.barLine,r={color:e,linestyle:t,linewidth:i,x:o.basePoint.x,top:0,bottom:o.basePoint.y-s.lollipop.bottom-s.lollipop.height},l=new a.VerticalLineRenderer;l.setData(r),this._renderer.insert(l,0)}}}}_recreateStyles(e){this._stylesCache=null}_createRendererForLollipop(e,t){return new h.LollipopRenderer(e,new u.HitTestResult(u.HitTarget.Custom,t),this._textWidthCache)}_onSymbolOrIntervalChanged(){this._lollipops={},this._lollipopsCounter=0,this._renderer.clear(),this.clearLastClicked()}_lollipopMouseClickHandler(e,t,i,o){o.preventDefault();const l=t.id;if(this._lastClickedId=this._lastClickedId===l?null:l,null===this._lastClickedId)return;const n={target:o.target,targetSize:i,point:new r.Point(t.centerPoint.x,t.centerPoint.y-t.style.lollipop.height/2-8),marginTop:15};this._clickHandler(e,n,(()=>{const e=(0,s.ensureDefined)(this._lollipops[l]);return this._createTooltipContent(e)}))}_getLollipopStatus(e){return e.active?"active":e.hovered?"hovered":"default"}}},382778:(e,t,i)=>{"use strict";i.d(t,{LollipopRenderer:()=>h});var s=i(934026),r=i(86441),o=i(458963),l=i(787123),n=i(199471),a=i(9640);class h{constructor(e,t,i){this._data=e,this._hittest=t,this._textWidthCache=i}draw(e,t){const{horizontalPixelRatio:i,verticalPixelRatio:s}=t,o=this._data.centerPoint,l=Math.round(o.x*i),n=Math.round(o.y*s),a=Math.max(1,Math.floor(i))%2/2,h=Math.max(1,Math.floor(s))%2/2,u=new r.Point(l+a,n-h);this._drawLollipop(e,u,t),this._drawLabel(e,u,t)}hitTest(e){const t=(0,a.interactionTolerance)().esd,i=this._data.centerPoint.y-this._data.style.lollipop.height/2-t,o=this._data.centerPoint.x-this._data.style.lollipop.width/2-t,l=(0,r.box)(new r.Point(o,i),new r.Point(o+this._data.style.lollipop.width+2*t,i+this._data.style.lollipop.height+2*t));return(0,s.pointInBox)(e,l)?this._hittest:null}_drawLollipop(e,t,i){const s=this._data.style,{horizontalPixelRatio:r}=i,o=this._fillRadius(r);s.lollipop.fillCircle&&s.lollipop.backgroundColor&&this._drawFilledCircle(e,t,o,s.lollipop.backgroundColor);const l=Math.round(s.lollipop.lineWidth*r),n=o-Math.round(1*r+l/2);this._drawBorderLine(e,t,l,n),s.lollipop.fillCircle&&s.lollipop.fillStyle&&this._drawFilledCircle(e,t,n,s.lollipop.fillStyle)}_drawLabel(e,t,i){ const s=this._data.style.lollipop.text,r=s.label;if(""===r)return;const{horizontalPixelRatio:o,verticalPixelRatio:l}=i;e.textAlign="center",e.textBaseline="middle",e.fillStyle=s.strokeStyle,e.font=s.font;const a=this._textWidthCache.yMidCorrection(e,r);e.translate(t.x,t.y+((s.deltaY||0)+a)*l),(0,n.drawScaled)(e,o,l,(()=>{e.fillText(r,0,0)}))}_fillRadius(e){const t=this._data.style,i=Math.max(1,Math.floor(e));let s=Math.round(t.lollipop.width*e);return s%2!=i%2&&(s+=1),s/2}_drawBorderLine(e,t,i,s){const r=this._data.style;e.strokeStyle=r.lollipop.strokeStyle,e.lineWidth=i,(0,l.setLineStyle)(e,o.LINESTYLE_SOLID),(0,l.createCircle)(e,t.x,t.y,s),e.stroke()}_drawFilledCircle(e,t,i,s){e.fillStyle=s,(0,l.createCircle)(e,t.x,t.y,i),e.fill()}}},541801:(e,t,i)=>{"use strict";i.d(t,{TrendLineRenderer:()=>_,drawArrow:()=>d});var s=i(650151),r=i(204652),o=i(855152),l=i(315801),n=i(787123),a=i(9640),h=i(199471),u=i(458963);function c(e,t,i,s,r){t.save(),t.fillStyle="#000000",t.beginPath(),t.arc(e.x*r,e.y*r,i*r,0,2*Math.PI,!1),t.fill(),s.strokeWidth&&(t.lineWidth=s.strokeWidth,t.stroke()),t.restore()}function d(e,t,i,s,r,o=!1){if(t.subtract(e).length()<1)return;const l=(0,a.getArrowPoints)(e,t,s,o,!0).slice(0,2);let n=null;const{horizontalPixelRatio:h,verticalPixelRatio:u}=r;for(let e=0;e1)&&i.moveTo(t.x*h,t.y*u),i.lineTo(s.x*h,s.y*u),n=s}}class _{constructor(){this._data=null,this._hittest=new l.HitTestResult(l.HitTarget.MovePoint)}setData(e){this._data=e}setHitTest(e){this._hittest=e}draw(e,t){const i=this._data;if(null===i)return;if("points"in i&&i.points.length<2)return;const{horizontalPixelRatio:s}=t;if(void 0!==i.excludeBoundaries){e.save();for(const s of i.excludeBoundaries)(0,h.addExclusionArea)(e,t,s)}const{linestyle:r,lineCap:o=(r===u.LINESTYLE_SOLID?"round":"butt")}=i;e.lineCap=o,e.lineJoin="round",e.strokeStyle=i.color,e.lineWidth=Math.max(1,Math.floor(i.linewidth*s)),(0,n.setLineStyle)(e,r);const l=i.points[0],a=i.points[1];let c=[];e.beginPath(),i.overlayLineEndings?c=[l.clone(),a.clone()]:this._drawEnds(e,[l,a],i.linewidth,t);const d=this._extendAndClipLineSegment(l,a,t);null!==d&&i.linewidth>0&&(0,n.addPixelPerfectLineToPath)(e,d[0].x,d[0].y,d[1].x,d[1].y,t),i.overlayLineEndings&&this._drawEnds(e,c,i.linewidth,t),e.stroke(),void 0!==i.excludeBoundaries&&e.restore()}hitTest(e,t){var i;const s=this._data;if(null===s)return null;if("points"in s&&s.points.length<2)return null;const o=(null!==(i=s.hitTestTolerance)&&void 0!==i?i:(0,a.interactionTolerance)().line)+s.linewidth/2,l=s.points[0],n=s.points[1],h=this._extendAndClipLineSegment(l,n,t);if(null!==h){if((0,r.distanceToSegment)(h[0],h[1],e).distance<=o)return this._hittest}return null}_extendAndClipLineSegment(e,t,i){const r=(0,s.ensureNotNull)(this._data);return(0,a.extendAndClipLineSegment)(e,t,i.mediaSize.width,i.mediaSize.height,r.extendleft,r.extendright)}_drawEnds(e,t,i,r){const l=t[0],n=t[1],a=(0,s.ensureNotNull)(this._data);switch(a.leftend){case o.LineEnd.Arrow:d(n,l,e,i,r);break ;case o.LineEnd.Circle:c(l,e,i,(0,s.ensureDefined)(a.endstyle),r.horizontalPixelRatio)}switch(a.rightend){case o.LineEnd.Arrow:d(l,n,e,i,r);break;case o.LineEnd.Circle:c(n,e,i,(0,s.ensureDefined)(a.endstyle),r.horizontalPixelRatio)}}}},758363:(e,t,i)=>{"use strict";i.d(t,{VerticalLineRenderer:()=>a});var s=i(315801),r=i(787123),o=i(9640),l=i(199471),n=i(43192);class a extends n.BitmapCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null,this._hitTest=new s.HitTestResult(s.HitTarget.MovePoint)}setData(e){this._data=e}setHitTest(e){this._hitTest=e}hitTest(e){if(null===this._data||null===this._hitTest)return null;const t=(0,o.interactionTolerance)().line,i=Math.abs(e.x-this._data.x)<=t+this._data.linewidth/2,s=void 0===this._data.top||this._data.top-e.y<=t,r=void 0===this._data.bottom||e.y-this._data.bottom<=t;return i&&s&&r?this._hitTest:null}_drawImpl(e){if(null===this._data||this._data.linewidth<=0)return;const{context:t,horizontalPixelRatio:i,verticalPixelRatio:s,mediaSize:o}=e;if(this._data.x<-this._data.linewidth/2||this._data.x>o.width+this._data.linewidth/2)return;t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=Math.max(1,Math.floor(this._data.linewidth*i)),void 0!==this._data.linestyle&&(0,r.setLineStyle)(t,this._data.linestyle);const n=void 0!==this._data.top?Math.max(this._data.top,0):0,a=void 0!==this._data.bottom?Math.min(this._data.bottom,o.height):o.height,h=Math.round(this._data.x*i),u=Math.floor(n*s),c=Math.ceil(a*s),d=this._data.excludeBoundaries;void 0!==d&&(0,l.addExclusionAreaByScope)(e,d),(0,r.drawVerticalLine)(t,h,u,c)}}},740086:(e,t,i)=>{"use strict";i.d(t,{fromIndexedTo100:()=>h,fromLog:()=>_,fromPercent:()=>l,getCurrentModePriceText:()=>m,getOppositeModePriceText:()=>y,logFormulaForPriceRange:()=>p,logFormulasAreSame:()=>v,toIndexedTo100:()=>u,toIndexedTo100Range:()=>c,toLog:()=>d,toPercent:()=>n,toPercentRange:()=>a});var s=i(291784),r=i(678515);const o={logicalOffset:4,coordOffset:1e-4};function l(e,t){return t<0&&(e=-e),e/100*t+t}function n(e,t){const i=100*(e-t)/(t||1);return t<0?-i:i}function a(e,t){const i=n(e.minValue(),t),r=n(e.maxValue(),t);return new s.PriceRange(i,r)}function h(e,t){return t<0&&(e=-e),(e-=100)/100*t+t}function u(e,t){const i=100*(e-t)/t+100;return t<0?-i:i}function c(e,t){const i=u(e.minValue(),t),r=u(e.maxValue(),t);return new s.PriceRange(i,r)}function d(e,t){const i=Math.min(10**305-t.coordOffset,Math.abs(e));if(i<1e-25)return 0;const s=(0,r.log10)(i+t.coordOffset)+t.logicalOffset;return e<0?-s:s}function _(e,t){const i=Math.abs(e);if(i<1e-15)return 0;const s=Math.pow(10,Math.min(i-t.logicalOffset,305))-t.coordOffset;return e<0?-s:s}function p(e){if(null===e)return o;const t=Math.abs(e.maxValue()-e.minValue());if(t>=1||t<1e-15)return o;const i=Math.ceil(Math.abs(Math.log10(t))),s=o.logicalOffset+i;return{logicalOffset:s,coordOffset:1/Math.pow(10,s)}}function v(e,t){return e.logicalOffset===t.logicalOffset&&e.coordOffset===t.coordOffset}function m(e,t){ return e.isPercentage()?t.formattedPricePercentage:e.isIndexedTo100()?t.formattedPriceIndexedTo100:t.formattedPriceAbsolute}function y(e,t){return e.isPercentage()||e.isIndexedTo100()?t.formattedPriceAbsolute:t.formattedPricePercentage}},356747:(e,t,i)=>{"use strict";i.r(t),i.d(t,{QuotesProvider:()=>l});var s=i(876332),r=i(707957),o=i(541558);class l{constructor(e="full",t){var i;this._quotes=null,this._quoteSessionSymbol=null,this._quoteSessionClientId="",this._pausedQuoteSessionSymbol=null,this._quotesUpdate=new r.Delegate,this._quoteSymbolChanged=new r.Delegate,this._multiplexerType=e,this._hibernated=t,null===(i=this._hibernated)||void 0===i||i.subscribe((e=>{e?this.pause():this.resume()}))}setQuotesSessionSymbol(e){this._quoteSessionSymbol!==e&&(this._pausedQuoteSessionSymbol=null,this._quoteSessionClientId||(this._quoteSessionClientId="series-"+(0,o.guid)()),this._unsubscribeQuoteSession(),this._quoteSessionSymbol=e,this._quoteSymbolChanged.fire(),e&&this._subscribeQuoteSession(e))}symbol(){return this._quoteSessionSymbol}quotesUpdate(){return this._quotesUpdate}quoteSymbolChanged(){return this._quoteSymbolChanged}quotes(){return this._quotes}async quotesSnapshot(e){return(0,s.getQuoteSessionInstance)("simple").snapshot(e)}isPaused(){return null!==this._pausedQuoteSessionSymbol}pause(){null===this._pausedQuoteSessionSymbol&&(this._pausedQuoteSessionSymbol=this._quoteSessionSymbol,this._unsubscribeQuoteSession())}resume(){null!==this._pausedQuoteSessionSymbol&&(this._subscribeQuoteSession(this._pausedQuoteSessionSymbol),this._pausedQuoteSessionSymbol=null)}destroy(){var e;this._unsubscribeQuoteSession(),null===(e=this._hibernated)||void 0===e||e.release()}_onUpdate(e,t){this._quotes=e&&e.values||null,t&&t.values&&this._quotesUpdate.fire(e,t)}_subscribeQuoteSession(e){this._quoteSessionSymbol=e,(0,s.getQuoteSessionInstance)(this._multiplexerType).subscribe(this._quoteSessionClientId,this._quoteSessionSymbol,this._onUpdate.bind(this))}_unsubscribeQuoteSession(){this._quoteSessionSymbol&&((0,s.getQuoteSessionInstance)(this._multiplexerType).unsubscribe(this._quoteSessionClientId,this._quoteSessionSymbol),this._quoteSessionSymbol=null,this._quotes=null)}}},711757:(e,t,i)=>{"use strict";i.d(t,{SeriesBarColorer:()=>p});var s=i(195294),r=i(650151),o=i(488530),l=i(534741),n=i(938471);const a=(0,s.getHexColorByName)("color-minty-green-500"),h=(0,s.getHexColorByName)("color-ripe-red-500");function u(e){return{barColor:e.upColor.value(),barBorderColor:e.borderUpColor?e.borderUpColor.value():e.borderColor.value()}}function c(e){return{barColor:e.downColor.value(),barBorderColor:e.borderDownColor?e.borderDownColor.value():e.borderColor.value()}}function d(e,t){return e.borderUpColorProjection&&e.borderUpColor?{barColor:t?e.upColorProjection.value():e.upColor.value(),barBorderColor:t?e.borderUpColorProjection.value():e.borderUpColor.value()}:{barColor:t?e.upColorProjection.value():e.upColor.value()}}function _(e,t){return e.borderDownColorProjection&&e.borderDownColor?{ barColor:t?e.downColorProjection.value():e.downColor.value(),barBorderColor:t?e.borderDownColorProjection.value():e.borderDownColor.value()}:{barColor:t?e.downColorProjection.value():e.downColor.value()}}class p extends n.AbstractBarColorer{constructor(e){super(),this._series=e}applyBarStyle(e,t,i,s){const r=i;r.barColor=void 0,r.barBorderColor=void 0,r.barWickColor=void 0,r.isBarHollow=void 0,r.isBarUp=void 0,r.upColor=void 0,r.downColor=void 0,r.isTwoColorBar=void 0,r.isMergedBar=void 0;const o=this._series.properties();switch(o.childs().style.value()){case 2:case 18:case 14:case 15:this._applyLineStyle(i,o);break;case 3:this._applyAreaStyle(i,o);break;case 16:this._applyHLCAreaStyle(e,t,i,s,o);break;case 0:this._applyBarStyle(e,i,s,o);break;case 17:case 1:case 19:this._applyCandleStyle(e,i,s,o);break;case 9:this._applyHollowCandleStyle(e,i,s,o);break;case 8:this._applyHAStyle(e,t,i,s,o);break;case 10:this._applyBaseLineStyle(e,t,i,s,o);break;case 12:this._applyHiLoStyle(t,i,o);break;case 13:this._applyColumnStyle(e,i,s,o);break;case 4:this._applyRenkoStyle(e,t,i,s,o);break;case 7:this._applyPBStyle(e,t,i,s,o);break;case 5:this._applyKagiStyle(e,t,i,s,o);break;case 6:this._applyPnfStyle(e,t,i,s,o);break;case 11:this._applyRangeStyle(e,t,i,s,o);break;case 20:this._applySVPStyle(e,i,s,o)}return i}static upColor(e,t){const i=e.childs(),s=i.style.value();switch(s){case 18:return{barColor:i.tpoStyle.childs().color.value()};case 20:return{barColor:i.svpStyle.childs().volumeProfile.childs().volumeColorUp.value()};case 2:return{barColor:i.lineStyle.childs().color.value()};case 14:return{barColor:i.lineWithMarkersStyle.childs().color.value()};case 15:return{barColor:i.steplineStyle.childs().color.value()};case 3:return{barColor:i.areaStyle.childs().linecolor.value()};case 16:return{barColor:i.hlcAreaStyle.childs().closeLineColor.value(),barBorderColor:a};case 0:return{barColor:i.barStyle.childs().upColor.value()};case 17:return u(i.volFootprintStyle.childs());case 19:return u(i.volCandlesStyle.childs());case 1:return u(i.candleStyle.childs());case 9:return u(i.hollowCandleStyle.childs());case 8:return u(i.haStyle.childs());case 10:return{barColor:i.baselineStyle.childs().topLineColor.value()};case 12:return{barColor:i.hiloStyle.childs().color.value(),barBorderColor:e.childs().hiloStyle.childs().borderColor.value()};case 13:return{barColor:i.columnStyle.childs().upColor.value()};case 4:return d(i.renkoStyle.childs(),t);case 7:return d(i.pbStyle.childs(),t);case 5:return d(i.kagiStyle.childs(),t);case 6:return d(i.pnfStyle.childs(),t);case 11:0;const s=i.rangeStyle.childs(),r=s.barStyle.value()===o.RangeBarStyle.Bars;return{barColor:t?s.upColorProjection.value():r?s.upColor.value():s.candlesUpColor.value(),barBorderColor:t?s.upColorProjection.value():r?s.upColor.value():s.candlesBorderUpColor.value()}}(0,r.ensureNever)(s)}static downColor(e,t){const i=e.childs(),s=i.style.value();switch(s){case 2:return{barColor:i.lineStyle.childs().color.value()};case 18:return{barColor:i.tpoStyle.childs().color.value()};case 20:return{ barColor:i.svpStyle.childs().volumeProfile.childs().volumeColorUp.value()};case 14:return{barColor:i.lineWithMarkersStyle.childs().color.value()};case 15:return{barColor:i.steplineStyle.childs().color.value()};case 3:return{barColor:i.areaStyle.childs().linecolor.value()};case 16:return{barColor:i.hlcAreaStyle.childs().closeLineColor.value(),barBorderColor:h};case 0:return{barColor:i.barStyle.childs().downColor.value()};case 17:return c(i.volFootprintStyle.childs());case 1:return c(i.candleStyle.childs());case 19:return c(i.volCandlesStyle.childs());case 9:return c(i.hollowCandleStyle.childs());case 8:return c(i.haStyle.childs());case 10:return{barColor:i.baselineStyle.childs().bottomLineColor.value()};case 12:return{barColor:i.hiloStyle.childs().color.value(),barBorderColor:e.childs().hiloStyle.childs().borderColor.value()};case 13:return{barColor:i.columnStyle.childs().downColor.value()};case 4:return _(i.renkoStyle.childs(),t);case 7:return _(i.pbStyle.childs(),t);case 5:return _(i.kagiStyle.childs(),t);case 6:return _(i.pnfStyle.childs(),t);case 11:0;const s=i.rangeStyle.childs(),r=s.barStyle.value()===o.RangeBarStyle.Bars;return{barColor:t?s.downColorProjection.value():r?s.downColor.value():s.candlesDownColor.value(),barBorderColor:t?s.downColorProjection.value():r?s.downColor.value():s.candlesBorderDownColor.value()}}(0,r.ensureNever)(s)}_applyLineStyle(e,t){e.barColor=p.upColor(t).barColor}_applyAreaStyle(e,t){e.barColor=p.upColor(t).barColor}_applyHLCAreaStyle(e,t,i,s,r){var o;const l=this._isUp(e,!1,s,(null===(o=this._series.data().first())||void 0===o?void 0:o.index)!==e)?p.upColor(r,t):p.downColor(r,t);i.barColor=l.barColor,i.barBorderColor=l.barBorderColor}_applyBarStyle(e,t,i,s){const r=this._isUp(e,!1,i,s.childs().barStyle.childs().barColorsOnPrevClose.value())?p.upColor(s):p.downColor(s);t.barColor=r.barColor,t.barBorderColor=r.barBorderColor}_applyCandleStyle(e,t,i,s){var r;const o=s.childs(),l=1===o.style.value()?o.candleStyle.childs():19===o.style.value()?o.volCandlesStyle.childs():o.volFootprintStyle.childs(),n=this._isUp(e,!1,i,l.barColorsOnPrevClose.value()&&(null===(r=this._series.data().first())||void 0===r?void 0:r.index)!==e),a=n?p.upColor(s):p.downColor(s);t.barColor=a.barColor,t.barBorderColor=a.barBorderColor,t.barWickColor=n?l.wickUpColor?l.wickUpColor.value():l.wickColor.value():l.wickDownColor?l.wickDownColor.value():l.wickColor.value()}_applyHollowCandleStyle(e,t,i,s){var r;const o=s.childs().hollowCandleStyle.childs(),l=this._isUp(e,!1,i,(null===(r=this._series.data().first())||void 0===r?void 0:r.index)!==e),n=l?p.upColor(s):p.downColor(s);t.barColor=n.barColor,t.barBorderColor=n.barBorderColor,t.barWickColor=l?o.wickUpColor?o.wickUpColor.value():o.wickColor.value():o.wickDownColor?o.wickDownColor.value():o.wickColor.value();const a=this._findBar(e,!1,i);t.isBarHollow=a[1]<=a[4]}_applyHAStyle(e,t,i,s,r){const o=r.childs().haStyle.childs(),l=this._isUp(e,t,s,o.barColorsOnPrevClose.value()),n=l?p.upColor(r):p.downColor(r);i.barColor=n.barColor,i.barBorderColor=n.barBorderColor, i.barWickColor=l?o.wickUpColor.value():o.wickDownColor.value()}_applyBaseLineStyle(e,t,i,s,o){const l=this._findBar(e,t,s),n=o.childs().baselineStyle.childs(),a=this._series.priceScale(),h=Math.round(a.height()*(Math.abs(100-n.baseLevelPercentage.value())/100)),u=(0,r.ensureNotNull)(this._series.firstValue()),c=a.coordinateToPrice(h,u);l[4]>c?i.barColor=p.upColor(o,t).barColor:i.barColor=p.downColor(o,t).barColor}_applyHiLoStyle(e,t,i){const s=p.upColor(i,e);t.barColor=s.barColor,t.barBorderColor=s.barBorderColor}_applyColumnStyle(e,t,i,s){const r=s.childs().columnStyle.childs(),o=this._isUp(e,!1,i,r.barColorsOnPrevClose.value())?p.upColor(s):p.downColor(s);t.color=o.barColor,t.barColor=t.color}_applyRenkoStyle(e,t,i,s,r){const o=r.childs().renkoStyle.childs(),l=this._isUp(e,t,s,!1),n=l?p.upColor(r,t):p.downColor(r,t);i.barColor=n.barColor,i.barBorderColor=n.barBorderColor,i.barWickColor=l?o.wickUpColor.value():o.wickDownColor.value(),i.isBarUp=l}_applyPBStyle(e,t,i,s,r){const o=this._isUp(e,t,s,!1),l=o?p.upColor(r,t):p.downColor(r,t);i.barColor=l.barColor,i.barBorderColor=l.barBorderColor,i.isBarUp=o}_applyKagiStyle(e,t,i,s,r){let o;i.upColor=p.upColor(r,t).barColor,i.downColor=p.downColor(r,t).barColor;const l=this._findBar(e,t,s);l[3]0,n=p.upColor(r,t),a=p.downColor(r,t);i.isBarUp=l,i.isMergedBar=2===Math.abs(o),i.upColor=n.barColor,i.downColor=a.barColor,i.barColor=l?n.barColor:a.barColor}_applyRangeStyle(e,t,i,s,r){const l=r.childs().rangeStyle.childs(),n=l.barStyle.value()===o.RangeBarStyle.Bars,a=this._isUp(e,!1,s,!1),h=a?p.upColor(r,t):p.downColor(r,t),u=a?t?l.upColorProjection.value():n?void 0:l.candlesWickUpColor.value():t?l.downColorProjection.value():n?void 0:l.candlesWickDownColor.value();i.barColor=h.barColor,i.barBorderColor=h.barBorderColor,i.wickColor=u,i.barWickColor=u}_applySVPStyle(e,t,i,s){const r=this._isUp(e,!1,i,!1)?p.upColor(s,!1):p.downColor(s,!1);t.barColor=r.barColor,t.barBorderColor=r.barBorderColor}_findBar(e,t,i){return i?i.value:this._getSeriesBars(t).valueAt(e)||[]}_findPrevBar(e,t,i){if(i&&i.previousValue)return i.previousValue;const s=this._series.bars().search(e-1,l.PlotRowSearchMode.NearestLeft,4);return null!==s?s.value:[]}_getSeriesBars(e){return e?this._series.nsBars():this._series.bars()}_isUp(e,t,i,s){const r=this._findBar(e,t,i);if(s){return this._findPrevBar(e,t,i)[4]<=r[4]}return r[1]<=r[4]}}},904891:(e,t,i)=>{"use strict";i.d(t,{SeriesAreaPaneView:()=>a});var s=i(246733),r=i(413225),o=i(142119),l=i(230058),n=i(143389);class a extends n.SeriesSingleLinePaneView{renderer(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);const e=this._source.priceScale();if(!e)return null;const t=this._source.properties().childs().areaStyle.childs(),i=t.transparency.value(),n={simpleMode:!1,barSpacing:this._model.timeScale().barSpacing(),items:this._items, lineColor:t.linecolor.value(),lineStyle:t.linestyle.value(),lineWidth:t.linewidth.value(),isSeries:!0,withMarkers:!1,bottom:e.height(),color1:(0,s.generateColor)(t.color1.value(),i),color2:(0,s.generateColor)(t.color2.value(),i),skipHoles:!0},a=new o.CompositeRenderer;return a.append(new r.PaneRendererArea(n)),this._model.selection().isSelected(this._source)&&this._isMarkersEnabled&&this._selectionData&&a.append(new l.SelectionRenderer(this._selectionData)),a}}},825278:(e,t,i)=>{"use strict";i.d(t,{SeriesBarsPaneView:()=>n});var s=i(142119),r=i(230058),o=i(891512),l=i(969419);class n extends o.SeriesBarCandlesPaneView{renderer(){this._invalidated&&(this._updateImpl(null),this._invalidated=!1);const e=this._source.properties().childs(),t={bars:this._bars,dontDrawOpen:e.barStyle.childs().dontDrawOpen.value(),thinBars:11===e.style.value()?e.rangeStyle.childs().thinBars.value():e.barStyle.childs().thinBars.value()},i=new s.CompositeRenderer;return i.append(new l.PaneRendererBars(t)),this._model.selection().isSelected(this._source)&&this._isMarkersEnabled&&this._selectionData&&i.append(new r.SelectionRenderer(this._selectionData)),i}_createItem(e,t,i){const s={center:NaN,open:NaN,high:NaN,low:NaN,close:NaN,color:i.barColor,left:NaN,right:NaN,timePointIndex:e};return(0,o.baseBarCandlesUpdater)(t,s)?s:null}}},255799:(e,t,i)=>{"use strict";i.d(t,{SeriesBaselinePaneView:()=>v});var s=i(246733),r=i(142119),o=i(86441),l=i(5531),n=i(204652),a=i(9640),h=i(674981),u=i(710455),c=i(315801);class d extends u.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e){if(null===this._data)return null;const{items:t,topLineWidth:i,bottomLineWidth:s}=this._data,r=(0,a.interactionTolerance)().series+(i+s)/4,l=(0,h.lowerbound)(t,e,((e,t)=>e.center<=t.x)),u=Math.max(1,l-1),d=Math.min(t.length-1,l+1);for(let i=u;i<=d;++i){const s=t[i-1],l=t[i],{distance:a}=(0,n.distanceToSegment)((0,o.point)(s.center,s.y),(0,o.point)(l.center,l.y),(0,o.point)(e.x,e.y));if(a<=r)return new c.HitTestResult(c.HitTarget.Regular)}return null}_drawImpl(e){if(null===this._data)return;const{items:t,baseLevelCoordinate:i,bottom:s,bottomFillColor1:r,bottomFillColor2:n,topFillColor1:h,topFillColor2:u,topLineColor:c,bottomLineColor:d,topLineWidth:_,bottomLineWidth:p}=this._data;if(!function(e){if(0===e.length)return!1;const t=e.findIndex((e=>(0,a.coordinateIsValid)(e.y)));if(-1===t)return!1;let i=e.length-1;for(;i>t&&!(0,a.coordinateIsValid)(e[i].y);)i--;return!(t>i)}(t))return;const v=e.context,{topItems:m,bottomItems:y}=function(e,t){const i=[],s=[];let r=null;for(let n=0;n=t&&s.push(h),r=h;else{if(null===r)continue;h=r}if((0,a.coordinateIsValid)(u.y)&&(h.y>t&&u.yt))if(Math.abs(h.center-u.center)<1){const e={center:h.center,y:t};i.push(e),s.push(e)}else{const e=(0,l.intersectLineSegments)((0,o.point)(h.center,h.y),(0,o.point)(u.center,u.y),(0,o.point)(h.center,t),(0,o.point)(u.center,t));if(null!==e){ const t={center:h.center+(u.center-h.center)*e,y:h.y+(u.y-h.y)*e};i.push(t),s.push(t)}}}return{topItems:i,bottomItems:s}}(t,i);v.lineCap="round",v.lineJoin="round",0!==m.length&&(v.beginPath(),v.moveTo(m[0].center,i),this._makeLine(v,m,!0,0),v.closePath(),v.fillStyle=this._makeLinearGradient(v,h,u,i-s,i),v.fill(),v.beginPath(),this._makeLine(v,m,!1,0),v.lineWidth=_,v.strokeStyle=c,v.stroke()),0!==y.length&&(v.beginPath(),v.moveTo(y[0].center,i),this._makeLine(v,y,!0,1),v.closePath(),v.fillStyle=this._makeLinearGradient(v,r,n,i,i+s),v.fill(),v.beginPath(),this._makeLine(v,y,!1,1),v.lineWidth=p,v.strokeStyle=d,v.stroke())}_makeLine(e,t,i,s){if(null===this._data)return;const r=t.findIndex((e=>(0,a.coordinateIsValid)(e.y)));if(-1===r)return;const{barSpacing:o,baseLevelCoordinate:l}=this._data,n=.25*o;let h;const u=t.length;for(let o=r;o=l&&u.y>=l){e.moveTo(u.center,u.y);continue}}else if(h&&h.y<=l&&u.y<=l){e.moveTo(u.center,u.y);continue}if(h&&(0,a.coordinateIsValid)(h.y))e.lineTo(u.center,u.y),i&&!(0,a.coordinateIsValid)(c.y)&&e.lineTo(u.center,l);else if(c&&(0,a.coordinateIsValid)(c.y))i?(o!==r&&e.lineTo(u.center,l),e.lineTo(u.center,u.y)):e.moveTo(u.center,u.y);else if(i){if(0===o)continue;o!==r&&e.lineTo(u.center-n,l),e.lineTo(u.center-n,u.y),e.lineTo(u.center+n,u.y),e.lineTo(u.center+n,l)}else e.moveTo(u.center-n,u.y),e.lineTo(u.center+n,u.y);h=u}}}_makeLinearGradient(e,t,i,s,r){const o=e.createLinearGradient(0,s,0,r);return o.addColorStop(0,t),o.addColorStop(1,i),o}}var _=i(230058),p=i(143389);class v extends p.SeriesSingleLinePaneView{constructor(){super(...arguments),this._renderer=new d,this._topFillColor1="",this._topFillColor2="",this._bottomFillColor1="",this._bottomFillColor2="",this._topLineColor="",this._bottomLineColor="",this._topLineWidth=0,this._bottomLineWidth=0,this._barSpacing=0,this._bottom=0,this._baseLevelCoordinate=0}renderer(){this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer.setData({items:this._items,topFillColor1:this._topFillColor1,topFillColor2:this._topFillColor2,bottomFillColor1:this._bottomFillColor1,bottomFillColor2:this._bottomFillColor2,topLineColor:this._topLineColor,bottomLineColor:this._bottomLineColor,topLineWidth:this._topLineWidth,bottomLineWidth:this._bottomLineWidth,barSpacing:this._barSpacing,baseLevelCoordinate:this._baseLevelCoordinate,bottom:this._bottom});const e=new r.CompositeRenderer;return e.append(this._renderer),this._model.selection().isSelected(this._source)&&this._isMarkersEnabled&&this._selectionData&&e.append(new _.SelectionRenderer(this._selectionData)),e}_updateImpl(){super._updateImpl();const e=this._source.priceScale();if(!e)return;const t=this._source.properties().childs().baselineStyle.childs(),i=t.transparency.value();this._topFillColor1=(0,s.generateColor)(t.topFillColor1.value(),i),this._topFillColor2=(0,s.generateColor)(t.topFillColor2.value(),i),this._bottomFillColor1=(0,s.generateColor)(t.bottomFillColor1.value(),i), this._bottomFillColor2=(0,s.generateColor)(t.bottomFillColor2.value(),i),this._topLineColor=t.topLineColor.value(),this._bottomLineColor=t.bottomLineColor.value(),this._topLineWidth=t.topLineWidth.value(),this._bottomLineWidth=t.bottomLineWidth.value(),this._barSpacing=this._model.timeScale().barSpacing(),this._bottom=e.height(),this._baseLevelCoordinate=Math.round(this._bottom*(Math.abs(100-t.baseLevelPercentage.value())/100))}}},147664:(e,t,i)=>{"use strict";i.d(t,{SeriesWaterlinePaneView:()=>n});var s=i(955831),r=i(147354),o=i(315801),l=i(458963);class n extends s.HorizontalLinePaneView{constructor(e){super(),this._getters=e;const t={cursorType:r.PaneCursorType.VerticalResize,activeItem:0,areaName:o.AreaName.SourceItemMove};this._lineRenderer.setHitTest(new o.HitTestResult(o.HitTarget.MovePoint,t)),this._lineRendererData.visible=!0,this._lineRendererData.linestyle=l.LINESTYLE_SPARSE_DOTTED}_updateImpl(){const{baseLevelPercentage:e,paneHeight:t,color:i}=this._getters,s=Math.abs(100-e());this._lineRendererData.y=Math.round(t()*(s/100)),this._lineRendererData.color=i()}}},245242:(e,t,i)=>{"use strict";i.d(t,{SeriesCandlesPaneView:()=>a});var s=i(142119),r=i(9640),o=i(230058),l=i(891512),n=i(956725);class a extends l.SeriesBarCandlesPaneView{constructor(e,t,i=1){super(e,t),this._scaleCoeff=1,this._scaleCoeff=i}renderer(){this._invalidated&&(this._updateImpl(null),this._invalidated=!1);const e=this._source.priceScale();if(!e)return null;const t=this._source.properties().childs(),i=1===t.style.value()?t.candleStyle.childs():19===t.style.value()?t.volCandlesStyle.childs():t.volFootprintStyle.childs(),l=this._model.timeScale().barSpacing(),a={bars:this._bars,barSpacing:l,bodyVisible:i.drawBody.value(),borderVisible:i.drawBorder.value(),borderColor:i.borderColor.value(),wickColor:i.wickColor.value(),barWidth:(0,r.optimalBarWidth)(l),wickVisible:i.drawWick.value(),isPriceScaleInverted:e.isInverted(),scaleCoeff:this._scaleCoeff},h=new s.CompositeRenderer;return h.append(new n.PaneRendererCandles(a)),this._model.selection().isSelected(this._source)&&this._isMarkersEnabled&&this._selectionData&&h.append(new o.SelectionRenderer(this._selectionData)),h}_createItem(e,t,i){const s={center:NaN,open:NaN,high:NaN,low:NaN,close:NaN,left:NaN,right:NaN,timePointIndex:e,color:i.barColor,borderColor:i.barBorderColor,wickColor:i.barWickColor,hollow:i.isBarHollow};return(0,l.baseBarCandlesUpdater)(t,s)?s:null}}},72731:(e,t,i)=>{"use strict";i.d(t,{SeriesColumnsPaneView:()=>_});var s=i(650151),r=i(86441),o=i(244842),l=i(203308),n=i(315801),a=i(142119),h=i(534741),u=i(63316),c=i(230058),d=i(793907);class _{constructor(e,t){this._items=[],this._invalidated=!0,this._isMarkersEnabled=(0,o.enabled)("source_selection_markers"),this._selectionData=null,this._histogramBase=0,this._source=e,this._model=t,this._selectionIndexer=new u.SelectionIndexes(t.timeScale())}update(){this._invalidated=!0}renderer(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);const e={barSpacing:this._model.timeScale().barSpacing(),items:this._items, lineColor:"",histogramBase:this._histogramBase},t=new a.CompositeRenderer;return t.append(new d.PaneRendererColumns(e)),this._model.selection().isSelected(this._source)&&this._isMarkersEnabled&&this._selectionData&&t.append(new c.SelectionRenderer(this._selectionData)),t}_updateImpl(){this._items=[];const e=this._model.timeScale(),t=this._source.priceScale();if(e.isEmpty()||!t||t.isEmpty())return;const i=e.visibleBarsStrictRange();if(null===i)return;if(0===this._source.bars().size())return;const o=this._source.nearestIndex(i.firstBar(),h.PlotRowSearchMode.NearestRight),a=this._source.nearestIndex(i.lastBar(),h.PlotRowSearchMode.NearestLeft);if(void 0===o||void 0===a)return;const u=this._source.bars().range(o,a),c=this._source.barColorer(),d={},_=this._source.barFunction(),p=u.reduce(((e,t,s)=>{const r=_(s);if(!(0,l.default)(r))return e;d.value=s;let o=this._source.precomputedBarStyle(s);return void 0===o&&(o=c.barStyle(t,!1,d),this._source.setPrecomputedBarStyle(s,o)),this._items.push({timePointIndex:t,left:NaN,center:NaN,right:NaN,y:r,style:o}),d.previousValue=s,i.contains(t)&&null!=e?e:r}),null);if(null!==p)if(t.pointsArrayToCoordinates(this._items,p),e.fillBarBorders(this._items),this._histogramBase=t.isInverted()?0:t.height(),this._model.selection().isSelected(this._source)){const i=this._selectionIndexer.indexes();this._selectionData={points:[],bgColors:[],visible:!0,barSpacing:e.barSpacing(),hittestResult:n.HitTarget.Regular};const o=(0,s.ensureNotNull)(this._model.paneForSource(this._source)).height();this._selectionData.hittestResult=n.HitTarget.Regular;for(let s=0;s{"use strict";i.d(t,{SeriesHiLoPaneView:()=>m});var s=i(448874),r=i(511131),o=i(674981),l=i(9640),n=i(315801),a=i(710455);class h extends a.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null,this._barWidth=null}setData(e){this._data=e,this._barWidth=Math.max(1,Math.round((0,l.optimalHiLoWidth)(e.barSpacing)))}hitTest(e){if(null===this._data||null===this._barWidth)return null;const t=this._data.bars,i=.5*this._data.barSpacing;if(0===t.length)return null;if(e.xt[t.length-1].center+i)return null;const s=t[(0,o.lowerbound)(t,e.x-i,((e,t)=>e.centers.center+i)return null;const r=(0,l.interactionTolerance)().series+this._barWidth/2,a=Math.min(s.high,s.low),h=Math.max(s.high,s.low),u=this._data.fontSize;return a-r-u<=e.y&&e.y<=a+r||h-r<=e.y&&e.y<=h+r+u?new n.HitTestResult(n.HitTarget.Regular):null}_drawImpl(e){if(null===this._data||null===this._barWidth)return;const{font:t,fontSize:i,labelColor:s,bars:o,inverted:l,labelsPadding:n}=this._data,a=e.context;a.textAlign="center",a.fillStyle=s,a.font=(0,r.makeFont)(i,t) ;for(let e=0;eMath.max(1,(0,o.lowerboundExt)((e=>e+1),null,(i=>{const s=(0,r.makeFont)(i,d.CHART_FONT_FAMILY);return(0,_.measureText)(e,s).width<=t}),7,36))),((e,t)=>`${e}/${t}`))}renderer(){const e=this._source.priceScale();if(!e||e.isEmpty())return null;const t=new u.CompositeRenderer,i=this._needLabels(),s=this._source.properties().childs().hiloStyle.childs(),r=this._model.timeScale().barSpacing();if(this._invalidated){const e=this._source.formatter();this._maxLengthLabel="",this._updateImpl({generateLabels:i,formatter:e}),this._invalidated=!1}if(this._candlesRenderer.setData({bars:this._bars,wickVisible:!1,bodyVisible:s.drawBody.value(),barSpacing:r,borderVisible:s.showBorders.value(),barWidth:(0,l.optimalHiLoWidth)(r),isPriceScaleInverted:e.isInverted()}),t.append(this._candlesRenderer),i){const i=this._calculateLabelFontSize();i&&i>=8&&(this._labelsRenderer.setData({bars:this._bars,barSpacing:r,font:d.CHART_FONT_FAMILY,fontSize:i,labelColor:s.labelColor.value(),inverted:e.isInverted(),labelsPadding:.4*i}),t.append(this._labelsRenderer))}return this._model.selection().isSelected(this._source)&&this._isMarkersEnabled&&this._selectionData&&t.append(new c.SelectionRenderer(this._selectionData)),t}topPixelMargin(){return this._margin()}bottomPixelMargin(){return this._margin()}_createItem(e,t,i,s){const r={center:NaN,left:NaN,right:NaN,open:NaN,high:NaN,low:NaN,close:NaN,color:i.barColor,borderColor:i.barBorderColor,hollow:!1,highLabel:"",lowLabel:"",timePointIndex:e};if(!(0,v.baseBarCandlesUpdater)(t,r))return null;if(r.open=r.high,r.close=r.low,s.generateLabels){const e=s.formatter.format(r.high),t=s.formatter.format(r.low);r.highLabel=e,r.lowLabel=t;const i=(e.length>t.length?e:t).replace(/\d/g,"0");i.length>this._maxLengthLabel.length&&(this._maxLengthLabel=i)}return r}_margin(){if(this._needLabels()){const e=this._calculateLabelFontSize();if(e&&e>=8)return 1.4*e}return 0}_calculateLabelFontSize(){return""===this._maxLengthLabel?null:this._calculateFontSize(this._maxLengthLabel,Math.floor(this._model.timeScale().barSpacing())-2)}_needLabels(){const e=this._source.properties().childs().hiloStyle.childs().showLabels.value(),t=this._model.timeScale().barSpacing();return e&&t>5}}},579950:(e,t,i)=>{"use strict";i.d(t,{SeriesHLCAreaPaneView:()=>m});var s=i(86441),r=i(650151),o=i(244842),l=i(57372),n=i(63316),a=i(230058),h=i(534741),u=i(9640),c=i(142119),d=i(315801),_=i(879617),p=i(632739);class v extends p.ObjectValuesCache{_newObject(){return{high:void 0,close:void 0, low:void 0}}_clearObject(e){e.high=void 0,e.close=void 0,e.low=void 0}}class m{constructor(e,t){this._isMarkersEnabled=(0,o.enabled)("source_selection_markers"),this._hlcAreaCache=new v,this._highPoints=new p.CachedContainer,this._closePoints=new p.CachedContainer,this._lowPoints=new p.CachedContainer,this._barsBorders=new p.CachedContainer,this._filledAreas=new l.CachedMap,this._renderer=new c.CompositeRenderer,this._invalidated=!0,this._source=e,this._model=t,this._selectionIndexer=new n.SelectionIndexes(t.timeScale())}update(){this._invalidated=!0}renderer(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer}_updateImpl(){var e,t,i,o,n,c,p,v,m;this._renderer.clear();const y=this._model.timeScale(),b=this._source.priceScale();if(y.isEmpty()||!b||b.isEmpty())return;const g=y.visibleBarsStrictRange();if(null===g)return;if(0===this._source.bars().size())return;const S=this._source.firstValue();if(null===S)return;const f=null!==(e=this._source.nearestIndex(g.firstBar()-1,h.PlotRowSearchMode.NearestLeft))&&void 0!==e?e:g.firstBar()-1,C=null!==(t=this._source.nearestIndex(g.lastBar()+1,h.PlotRowSearchMode.NearestRight))&&void 0!==t?t:g.lastBar()+1;this._hlcAreaCache.invalidateCache(),this._hlcAreaCache.setStartIndex(f),this._barsBorders.invalidateCache(),this._highPoints.invalidateCache(),this._lowPoints.invalidateCache(),this._closePoints.invalidateCache(),this._filledAreas.invalidateCache();let w,x,P;this._source.bars().range(f,C).each(((e,t)=>{if(this._hlcAreaCache.isValidIndex(e)){const i=this._hlcAreaCache.at(e);i.close=t[4],i.high=t[2],i.low=t[3]}return!1}));const T=new Map,I=f+this._hlcAreaCache.length();for(let e=f;e{"use strict";i.d(t,{SeriesHollowCandlesPaneView:()=>a});var s=i(142119),r=i(9640),o=i(230058),l=i(956725),n=i(245242);class a extends n.SeriesCandlesPaneView{renderer(){this._invalidated&&(this._updateImpl(null),this._invalidated=!1);const e=this._source.priceScale();if(!e)return null;const t=this._source.properties().childs().hollowCandleStyle.childs(),i=this._model.timeScale().barSpacing(),n={bars:this._bars,barSpacing:i,bodyVisible:t.drawBody.value(),borderVisible:t.drawBorder.value(),borderColor:t.borderColor.value(),wickColor:t.wickColor.value(),barWidth:(0,r.optimalBarWidth)(i),wickVisible:t.drawWick.value(),isPriceScaleInverted:e.isInverted()},a=new s.CompositeRenderer;return a.append(new l.PaneRendererCandles(n)),this._model.selection().isSelected(this._source)&&this._isMarkersEnabled&&this._selectionData&&a.append(new o.SelectionRenderer(this._selectionData)),a}}},936258:(e,t,i)=>{"use strict";i.d(t,{SeriesLinePaneView:()=>h});var s=i(315801),r=i(142119),o=i(879617),l=i(627172),n=i(230058),a=i(143389);class h extends a.SeriesSingleLinePaneView{renderer(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);const e=this._source.properties().childs(),t=e.style.value();let i,a=!1;2===t?i=e.lineStyle.childs():14===t?(i=e.lineWithMarkersStyle.childs(), a=!0):15===t?i=e.steplineStyle.childs():18===t&&(i=e.tpoStyle.childs());const h={barSpacing:this._model.timeScale().barSpacing(),items:this._items,lineColor:i.color.value(),lineStyle:i.linestyle.value(),withMarkers:a,lineWidth:i.linewidth.value(),simpleMode:!0,hitTestResult:s.HitTarget.Regular,skipHoles:!0};let u,c;if(u=15===t?new l.PaneRendererStepLine(h):new o.PaneRendererLine(h),this._model.selection().isSelected(this._source)&&this._isMarkersEnabled&&this._selectionData){const e=new r.CompositeRenderer;e.append(u),e.append(new n.SelectionRenderer(this._selectionData)),c=e}else c=u;return c}}},891512:(e,t,i)=>{"use strict";i.d(t,{SeriesBarCandlesPaneView:()=>u,baseBarCandlesUpdater:()=>h});var s=i(86441),r=i(244842),o=i(63316),l=i(534741),n=i(315801);function a(e){return null!=e}function h(e,t){const i=e[1],s=e[2],r=e[3],o=e[4];return!!(a(i)&&a(s)&&a(r)&&a(o))&&(t.open=i,t.high=s,t.low=r,t.close=o,!0)}class u{constructor(e,t){this._bars=[],this._invalidated=!0,this._isMarkersEnabled=(0,r.enabled)("source_selection_markers"),this._selectionData=null,this._source=e,this._model=t,this._selectionIndexer=new o.SelectionIndexes(t.timeScale())}items(){return this._bars}update(){this._invalidated=!0}_updateImpl(e){const t=this._model.timeScale(),i=this._source.priceScale();if(this._bars=[],t.isEmpty()||!i||i.isEmpty())return;const r=t.visibleBarsStrictRange();if(null===r)return;if(0===this._source.bars().size())return;let o=this._source.nearestIndex(r.firstBar(),l.PlotRowSearchMode.NearestRight);const a=this._source.nearestIndex(r.lastBar(),l.PlotRowSearchMode.NearestLeft);if(void 0===o||void 0===a)return;for(;o<=a;o++){if(null!==this._source.bars().valueAt(o))break}if(o>a)return;const h=this._source.bars().range(o,a),u=this._source.barColorer(),c={};if(h.each(((t,i)=>{c.value=i;let s=this._source.precomputedBarStyle(i);void 0===s&&(s=u.barStyle(t,!1,c),this._source.setPrecomputedBarStyle(i,s));const r=this._createItem(t,i,s,e);return!!r&&(c.previousValue=i,this._bars.push(r),!1)})),0===this._bars.length)return;const d=this._source.firstValue();if(null!==d)if(i.barPricesToCoordinates(this._bars,d),t.fillBarBorders(this._bars),this._model.selection().isSelected(this._source)){const e=this._selectionIndexer.indexes();this._selectionData={points:[],bgColors:[],visible:!0,hittestResult:n.HitTarget.Regular,barSpacing:t.barSpacing()};const r=this._model.paneForSource(this._source);if(!r)return;const o=r.height();for(let r=0;r{"use strict";i.d(t,{SeriesSingleLinePaneView:()=>c});var s=i(203308),r=i(86441),o=i(650151),l=i(244842),n=i(63316),a=i(534741),h=i(315801),u=i(674981);class c{constructor(e,t){this._items=[],this._invalidated=!0, this._isMarkersEnabled=(0,l.enabled)("source_selection_markers"),this._selectionData=null,this._source=e,this._model=t,this._selectionIndexer=new n.SelectionIndexes(t.timeScale())}update(){this._invalidated=!0}_updateImpl(){var e,t;this._items=[];const i=this._model.timeScale(),l=this._source.priceScale();if(i.isEmpty()||!l||l.isEmpty())return;const n=i.visibleBarsStrictRange();if(null===n)return;if(0===this._source.bars().size())return;const c=null!==(e=this._source.nearestIndex(n.firstBar()-1,a.PlotRowSearchMode.NearestLeft))&&void 0!==e?e:n.firstBar()-1,d=null!==(t=this._source.nearestIndex(n.lastBar()+1,a.PlotRowSearchMode.NearestRight))&&void 0!==t?t:n.lastBar()+1,_=this._source.barFunction();let p=null;const v=this._model.timeScale().barSpacing();if(v<.1&&this._source.supportsPressedChunks()){p=this._source.firstValue();const e=this._source.pressedChunks(v,(0,o.ensureNotNull)(this._source.priceSource())),t=(0,u.lowerbound)(e,c,((e,t)=>e.startTimee.endTime{this._items.push({timePointIndex:t.startTime,y:e,left:NaN,center:NaN,right:NaN})}))}}else{p=this._source.bars().range(c,d).reduce(((e,t,i)=>{const r=_(i);return(0,s.default)(r)?(this._items.push({timePointIndex:t,y:r,left:NaN,center:NaN,right:NaN}),n.contains(t)?null!=e?e:r:e):e}),null)}if(null!==p)if(l.pointsArrayToCoordinates(this._items,p),i.fillBarBorders(this._items),this._model.selection().isSelected(this._source)){const e=this._selectionIndexer.indexes();this._selectionData={points:[],bgColors:[],visible:!0,barSpacing:i.barSpacing(),hittestResult:h.HitTarget.Regular};const t=(0,o.ensureNotNull)(this._model.paneForSource(this._source)).height();this._selectionData.hittestResult=h.HitTarget.Regular;for(let s=0;s{"use strict";i.d(t,{SeriesValuesProvider:()=>T,calculateColor:()=>x,changesData:()=>P});var s=i(650151),r=i(150335),o=i(724377),l=i(444372),n=i(638456),a=i(246733),h=i(31341),u=i(534741),c=i(885482),d=i(948767),_=i(711757);function p(e,t){return 100*(t-e)/Math.abs(e||1)}var v=i(570226),m=i(616117),y=i(60897),b=i(334652);const g=b.lastDayChangeAvailable||b.alwaysShowLastPriceAndLastDayChange,S=n.CheckMobile.any(),f=(0,d.getPercentageFormatter)(),C=(0,d.getVolumeFormatter)(2),w=`${y.notAvailable} (${y.notAvailable}%)`;function x(e,t){const i=(0,o.parseRgb)(t),s=(0,o.parseRgb)(e);return(0,o.distanceRgb)(i,s)<70?(0,o.rgbToHexString)((0,o.invertRgb)(i)):t}function P(e,t,i,s,r){var o;let l,n;if(null!==t){const e=r[4],i=t.change||0;n={change:i,currentPrice:e,prevPrice:e-i,percentChange:t.change_percent||0}} const a=i[4],h=e.search(s-1,u.PlotRowSearchMode.NearestLeft,1),c=null!==(o=null==h?void 0:h.value[4])&&void 0!==o?o:null;return null!==c&&null!=a&&(l={change:a-c,currentPrice:a,prevPrice:c,percentChange:p(c,a)}),{barChange:l,lastDayChange:n}}class T{constructor(e,t){this._series=e,this._model=t,this._emptyValues=[{title:l.t(null,void 0,i(539280)),visible:!1,value:"",index:0,id:""},{title:l.t(null,void 0,i(330777)),visible:!1,value:"",index:1,id:""},{title:l.t(null,void 0,i(608136)),visible:!1,value:"",index:2,id:""},{title:l.t(null,void 0,i(931691)),visible:!1,value:"",index:3,id:""},{title:"",visible:!1,value:"",index:4,id:""},{title:"",visible:!1,value:"",index:5,id:""},{title:l.t(null,void 0,i(349329)),visible:!1,value:"",index:6,id:""},{title:l.t(null,{context:"study"},i(32819)),visible:!1,value:"",index:7,id:""},{title:l.t(null,void 0,i(37611)),visible:!1,value:"",index:8,id:""}]}getItems(){return this._emptyValues}getValues(e){var t,i,o,l,n,c;const d=this._showLastPriceAndChangeOnly(),_=this._emptyValues.map(((e,t)=>({...e,value:6===t||8===t?w:y.notAvailable,visible:5!==t&&4!==t&&!d})));if(this._model.timeScale().isEmpty()||0===this._series.bars().size()||this._series.priceScale().isEmpty())return _;const p=(0,s.ensureNotNull)(this._series.data().bars().last());(0,r.isNumber)(e)||(e=p.index);const m=this._series.nearestIndex(e,u.PlotRowSearchMode.NearestLeft);if(void 0===m)return _;const b=this._series.data().valueAt(m),S=this._model.backgroundTopColor().value();if(null===b)return _;const T=b[1],I=b[2],D=b[3],M=b[4],{barChange:L,lastDayChange:R}=P(this._series.data(),this._series.quotes(),b,m,p.value),k=(0,v.getPriceValueFormatterForSource)(this._series);if((0,v.shouldBeFormattedAsPercent)(this._series)||(0,v.shouldBeFormattedAsIndexedTo100)(this._series))_[6].value="",_[8].value="";else{const e=this._series.formatter(),s={signPositive:!0};if(void 0!==L){const{currentPrice:r,prevPrice:o,change:l,percentChange:n}=L,a=null!==(i=null===(t=e.formatChange)||void 0===t?void 0:t.call(e,r,o,s))&&void 0!==i?i:e.format(l,s);_[6].value=(0,h.forceLTRStr)(`${a} (${f.format(n,s)})`)}if(void 0!==R){const{currentPrice:t,prevPrice:i,change:r,percentChange:n}=R,a=null!==(l=null===(o=e.formatChange)||void 0===o?void 0:o.call(e,t,i,s))&&void 0!==l?l:e.format(r,s);_[8].value=(0,h.forceLTRStr)(`${a} (${f.format(n,s)})`)}}let E=null;if(d)_[5].value=null==M?y.notAvailable:k(M),_[5].visible=!0,E=this._getChangeColor(null==R?void 0:R.change),_[6].visible=void 0!==L,_[8].visible=void 0!==R||g;else{_[0].value=null==T?y.notAvailable:k(T),_[1].value=null==I?y.notAvailable:k(I),_[2].value=null==D?y.notAvailable:k(D),_[3].value=null==M?y.notAvailable:k(M),_[4].value=k(this._series.barFunction()(b));const e=b[5];(0,r.isNumber)(e)?_[7].value=C.format(e):_[7].visible=!1;const t=this._series.intervalObj().is1Tick();_[0].visible=!t,_[1].visible=!t,_[2].visible=!t,_[8].visible=void 0!==R||g,_[6].visible=void 0!==L;const i=this._series.barColorer().barStyle(m,!1);E=x(S,null!==(n=i.barBorderColor)&&void 0!==n?n:i.barColor)}E=(0, a.resetTransparency)(x(S,E));for(const e of _)e.color||(e.color=E);return _[8].visible&&(_[8].color=(0,a.resetTransparency)(x(S,this._getChangeColor(null===(c=R)||void 0===c?void 0:c.change)))),_}_mobileNonTrackingMode(){return S&&(null===this._model.crossHairSource().pane||(0,m.isLineToolName)(c.tool.value())||null!==this._model.lineBeingEdited())}_showLastPriceAndChangeOnly(){return b.alwaysShowLastPriceAndLastDayChange||this._mobileNonTrackingMode()}_getChangeColor(e){var t;const i=void 0===e||e>=0?_.SeriesBarColorer.upColor(this._series.properties()):_.SeriesBarColorer.downColor(this._series.properties());return null!==(t=i.barBorderColor)&&void 0!==t?t:i.barColor}}},334473:(e,t,i)=>{"use strict";i.d(t,{study_ESD$TV_DIVIDENDS:()=>ge,study_ESD$TV_EARNINGS:()=>fe,study_ESD$TV_SPLITS:()=>Se});var s=i(960769),r=i.n(s),o=i(650151),l=i(195294),n=i(444372),a=i(226663),h=i(31341),u=i(103221),c=i(389137),d=i(246733),_=i(511131),p=i(948767),v=i(422333),m=i(315801),y=i(458963),b=i(382778),g=i(787123);const S={fillPath:new Path2D("M8.961.92a3 3 0 0 1 3.078 0l7.5 4.48A3 3 0 0 1 21 7.975V20a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V7.975A3 3 0 0 1 1.461 5.4l7.5-4.48z"),strokePath:new Path2D("M9.867 2.742c.39-.23.875-.23 1.266 0l7.5 4.406c.382.225.617.635.617 1.078V20c0 .69-.56 1.25-1.25 1.25H3c-.69 0-1.25-.56-1.25-1.25V8.226c0-.443.235-.853.617-1.078l7.5-4.406z")},f={fillPath:new Path2D("M8.961 23.08a3 3 0 0 0 3.078 0l7.5-4.48A3 3 0 0 0 21 16.025V4a3 3 0 0 0-3-3H3a3 3 0 0 0-3 3v12.025A3 3 0 0 0 1.461 18.6l7.5 4.48z"),strokePath:new Path2D("M9.866 21.257c.391.23.877.23 1.268 0l7.5-4.414a1.25 1.25 0 0 0 .616-1.078V4c0-.69-.56-1.25-1.25-1.25H3c-.69 0-1.25.56-1.25 1.25v11.765c0 .443.234.853.616 1.078l7.5 4.414z")},C={fillPath:new Path2D("M3 0h15c1.662 0 3 1.338 3 3v15c0 1.662-1.338 3-3 3H3c-1.662 0-3-1.338-3-3V3c0-1.662 1.338-3 3-3z"),strokePath:new Path2D("M3 1.75h15c.693 0 1.25.557 1.25 1.25v15c0 .693-.557 1.25-1.25 1.25H3c-.692 0-1.25-.558-1.25-1.25V3c0-.692.558-1.25 1.25-1.25z")};function w(e,t,i,s,r){const{horizontalPixelRatio:o,verticalPixelRatio:l}=i;e.save(),e.translate(t.x-s.lollipop.width*o/2,t.y-s.lollipop.height*l/2),e.scale(o,l),s.lollipop.fillCircle&&s.lollipop.backgroundColor&&(e.fillStyle=s.lollipop.backgroundColor,e.fill(r.fillPath)),e.strokeStyle=s.lollipop.strokeStyle,e.lineWidth=Math.round(s.lollipop.lineWidth*o)/o,(0,g.setLineStyle)(e,y.LINESTYLE_SOLID),s.lollipop.fillCircle&&s.lollipop.fillStyle&&(e.fillStyle=s.lollipop.fillStyle,e.fill(r.strokePath)),e.stroke(r.strokePath),e.restore()}class x extends b.LollipopRenderer{_drawLollipop(e,t,i){const s=this._data.style;switch(s.type){case"Positive":!function(e,t,i,s){w(e,t,i,s,S)}(e,t,i,s);break;case"Negative":!function(e,t,i,s){w(e,t,i,s,f)}(e,t,i,s);break;default:!function(e,t,i,s){w(e,t,i,s,C)}(e,t,i,s)}}}var P=i(995874),T=i(22428),I=i(199687),D=i(385442),M=i(777566),L=i(261820),R=i(274469),k=i(788600),E=i(85290),V=i(315507) ;const A=n.t(null,void 0,i(376434)),B=n.t(null,void 0,i(783851)),N=n.t(null,void 0,i(802985)),F=n.t(null,void 0,i(396269)),O=n.t(null,void 0,i(180160)),H=n.t(null,void 0,i(68625)),W=n.t(null,void 0,i(94647)),z=n.t(null,void 0,i(634135)),q=n.t(null,void 0,i(400241)),U=n.t(null,void 0,i(233481)),$=n.t(null,void 0,i(676912)),Y=n.t(null,void 0,i(651924)),G=n.t(null,void 0,i(744441)),Q=n.t(null,void 0,i(993225)),j=n.t(null,void 0,i(259285)),X=n.t(null,void 0,i(945855)),Z=n.t(null,void 0,i(354079)),K={dark:(0,l.getHexColorByName)("color-cold-gray-900"),light:(0,l.getHexColorByName)("color-white")},J={positive:(0,l.getHexColorByName)("color-minty-green-600"),negative:(0,l.getHexColorByName)("color-ripe-red-600"),future:(0,l.getHexColorByName)("color-grapes-purple-a400"),unknown:(0,l.getHexColorByName)("color-cold-gray-350")},ee={positive:(0,l.getHexColorByName)("color-minty-green-500"),negative:(0,l.getHexColorByName)("color-ripe-red-500"),future:(0,l.getHexColorByName)("color-grapes-purple-a200"),unknown:(0,l.getHexColorByName)("color-cold-gray-700")};function te(e){return e?J:ee}const ie=(0,p.getPercentageFormatter)(),se=(0,p.getVolumeFormatter)();class re extends T.LollipopStudyPaneViewBase{}class oe extends re{constructor(e,t,i){super(e,t,i)}styles(e){return e?{positive:(0,l.getHexColorByName)("color-minty-green-600"),negative:(0,l.getHexColorByName)("color-ripe-red-600"),future:(0,l.getHexColorByName)("color-grapes-purple-a400"),unknown:(0,l.getHexColorByName)("color-cold-gray-350")}:{positive:(0,l.getHexColorByName)("color-minty-green-500"),negative:(0,l.getHexColorByName)("color-ripe-red-500"),future:(0,l.getHexColorByName)("color-grapes-purple-a200"),unknown:(0,l.getHexColorByName)("color-cold-gray-700")}}extraData(e){const t=e[8],i=14===t,s=e[1],r=e[2],o=e[3],l=e[4],n=i?null:e[5],a=null!=n&&null!=r?n-r:null,h=e[6],u=i?null:e[7];let c;return null!=t?t<20?c="Future":null!==a&&(c=a<0?"Negative":"Positive"):null!==a?c=a<0?"Negative":"Positive":l>Date.now()&&(c="Future"),{standardized:s,reported:n,estimate:r,revenueValue:u,revenueEstimate:h,period:o,date:l,type:c,timeType:null!=t?t:void 0}}afterUpdate(e,t,i,s){const r=this._source.getEstimate();if(r){const o=r.value.slice();o[4]*=1e3,this.addLollipop(e,t,i,s,r.index,o)}}getStyle(e){const t=this._getLollipopStatus(e);if(void 0===e.type)return super.getStyle(e,t);const i=t;let s=i;e.stack&&(s+="_stack:"+e.stack);let r=this._getStyleObject(e.type,s);if(null!==r)return r;if(this._stylesCache||(this._stylesCache={}),!this._stylesCache[s]){r=this._getStyleObject(e.type,i);const t=(0,c.clone)(r);t&&(e.stack&&(t.lollipop.incHeight=25*e.stack),this._stylesCache[s]=t)}return this._stylesCache[s]}_createTooltipContent(e){const t=e.standardized,i=null!=t,r=e.reported,l=null!=r,n=e.estimate,u=null!=n,c=l&&u?r-n:null;let d=e.revenueEstimate,_=!1;null!=d&&(_=!0,d*=1e6);let p=e.revenueValue,v=!1;null!=p&&(v=!0,p*=1e6);const m=v&&_?p-d:null,y=te(this._model.dark().value());let b,g,S,f,C;switch(e.type){case"Future":g=y.future,b=L;break;case"Negative":g=y.negative,b=M;break ;case"Positive":g=y.positive,b=D;break;default:g=y.unknown,b=L}switch(e.timeType){case 12:case 22:S=V,f=a.LollipopGroupIcons.AfterMarketClose,C=Z;break;case 11:case 21:S=E,f=a.LollipopGroupIcons.BeforeMarketOpen,C=X}const w=10===e.timeType||14===e.timeType,x={name:$,value:this._formatDate(e.date,w)};S&&(x.valueRightIcon={iconContent:S,iconClass:f,tooltipText:C});const T=[x];e.period&&T.push({name:G,value:s.unix(e.period).format("MMM 'YY")});const I={type:"common",title:v||_?A:B,subTitle:T,tooltipIcon:b,style:{color:g},content:[],anchor:this._getMoreFinancialsLink()},R={title:B,content:[]};if(i&&R.content.push({name:N,value:(0,P.roundToThirdDigit)(t)}),l&&R.content.push({name:F,value:(0,P.roundToThirdDigit)(r)}),u&&R.content.push({name:O,value:(0,P.roundToThirdDigit)(n)}),null!==c){const e=100*Math.abs(c/n);let t=(0,P.roundToThirdDigit)(c);isFinite(e)&&(t+=" ("+ie.format(e)+")"),R.content.push({name:H,value:(0,h.forceLTRStr)(t),style:{fontWeight:"bold",color:g}})}if((0,o.ensureDefined)(I.content).push(R),v||_){const e={title:j,content:[]};if(v&&e.content.push({name:F,value:se.format(p)}),_&&e.content.push({name:O,value:se.format(d)}),null!==m){const t=100*Math.abs(m/d);let i=se.format(m);isFinite(t)&&(i+=" ("+ie.format(t)+")"),e.content.push({name:H,value:(0,h.forceLTRStr)(i),style:{fontWeight:"bold",color:m>=0?y.positive:y.negative}})}(0,o.ensureDefined)(I.content).push(e)}return[I]}_showBarLine(e){return super._showBarLine(e)||this._model.mainSeries().properties().childs().esdShowBreaks.value()}_createRendererForLollipop(e,t){return new x(e,new m.HitTestResult(m.HitTarget.Custom,t),this._textWidthCache)}_recreateStyles(e){const t=e.dark().value(),i=te(t),s=i.unknown,r={barLine:{lineStyle:y.LINESTYLE_DASHED,lineWidth:1,strokeStyle:s},lollipop:{width:21,height:21,bottom:2,lineWidth:1.5,importance:"earnings",strokeStyle:s,backgroundColor:t?K.dark:K.light,fillCircle:!0,text:{label:"E",strokeStyle:s,font:(0,_.makeFont)(12,v.CHART_FONT_FAMILY,"bold")}}},o={lollipop:{fillStyle:(0,d.generateColor)(s,85)}},n={lollipop:{fillStyle:s,text:{strokeStyle:(0,l.getHexColorByName)("color-cold-gray-50")}}};this._defaultStyle=(0,u.deepCopy)(r),this._hoveredStyle=(0,c.merge)((0,u.deepCopy)(r),o),this._activeStyle=(0,c.merge)((0,u.deepCopy)(r),n);const a=(e,t)=>{const i=(0,u.deepCopy)(r);return i.barLine.strokeStyle=e,i.lollipop.strokeStyle=e,i.lollipop.text.strokeStyle=e,i.type=t,o.lollipop.fillStyle=(0,d.generateColor)(e,85),n.lollipop.fillStyle=e,{default:i,hovered:(0,c.merge)((0,u.deepCopy)(i),o),active:(0,c.merge)((0,u.deepCopy)(i),n)}};n.lollipop.text.strokeStyle=(0,l.getHexColorByName)("color-grapes-purple-50");const h=a(i.future,"Future");r.lollipop.height=23,r.lollipop.text.deltaY=1,n.lollipop.text.strokeStyle=(0,l.getHexColorByName)("color-minty-green-50");const p=a(i.positive,"Positive");r.lollipop.bottom=.5,r.lollipop.text.deltaY=-.5,n.lollipop.text.strokeStyle=(0,l.getHexColorByName)("color-ripe-red-50");const m=a(i.negative,"Negative");this._earningTypeStyles={Future:h,Positive:p,Negative:m},this._stylesCache=null} _getStyleObject(e,t){const i=this._earningTypeStyles[e];switch(t){case"default":return i.default;case"hovered":return i.hovered;case"active":return i.active}return null}}const le=(0,l.getHexColorByName)("color-tan-orange-600"),ne=(0,l.getHexColorByName)("color-tan-orange-500");function ae(e){return e?le:ne}class he extends re{extraData(e){const t=e[1];return{numerator:e[2],denominator:t,date:e[3]}}_createTooltipContent(e){let t=W;return(0,c.isNumber)(e.numerator)&&(0,c.isNumber)(e.denominator)&&(t+=": "+e.numerator+"/"+e.denominator),[{type:"common",title:t,subTitle:this._formatDate(e.date),tooltipIcon:R,style:{color:ae(this._model.dark().value())},anchor:this._getMoreFinancialsLink()}]}_recreateStyles(e){const t=e.dark().value(),i=ae(t),s={barLine:{lineStyle:y.LINESTYLE_DASHED,lineWidth:1,strokeStyle:i},lollipop:{width:23,height:23,bottom:1,lineWidth:1.5,importance:"splits",strokeStyle:i,backgroundColor:t?K.dark:K.light,fillCircle:!0,text:{label:"S",strokeStyle:i,font:(0,_.makeFont)(12,v.CHART_FONT_FAMILY,"bold")}}},r={lollipop:{fillStyle:(0,d.generateColor)(i,85)}},o={lollipop:{fillStyle:i,text:{strokeStyle:(0,l.getHexColorByName)("color-tan-orange-50")}}};this._defaultStyle=s,this._hoveredStyle=(0,c.merge)((0,u.deepCopy)(s),r),this._activeStyle=(0,c.merge)((0,u.deepCopy)(s),o),this._stylesCache=null}}const ue=(0,l.getHexColorByName)("color-tv-blue-600"),ce=(0,l.getHexColorByName)("color-tv-blue-500");function de(e){return e?ue:ce}class _e extends re{constructor(){super(...arguments),this._getMoreFinancialsLinkInitialTabId=I.PageId.Dividends}extraData(e){return{amountDividends:e[1],date:e[2],adjustedAmountDividends:e[3],paymentDate:e[4]}}_createTooltipContent(e){const{date:t,amountDividends:i,paymentDate:s,adjustedAmountDividends:r}=e,o=[{name:Y,value:this._formatDate(t)}];return(0,c.isNumber)(i)&&o.push({name:q,value:(0,P.roundToThirdDigit)(i)}),(0,c.isNumber)(r)&&o.push({name:U,value:(0,P.roundToThirdDigit)(r)}),(0,c.isNumber)(s)&&o.push({name:Q,value:this._formatDate(s)}),[{type:"common",title:z,subTitle:o,tooltipIcon:k,style:{color:de(this._model.dark().value())},anchor:this._getMoreFinancialsLink()}]}_recreateStyles(e){const t=e.dark().value(),i=de(t),s={barLine:{lineStyle:y.LINESTYLE_DASHED,lineWidth:1,strokeStyle:i},lollipop:{width:23,height:23,bottom:1,lineWidth:1.5,importance:"dividends",strokeStyle:i,backgroundColor:t?K.dark:K.light,fillCircle:!0,text:{label:"D",strokeStyle:i,font:(0,_.makeFont)(12,v.CHART_FONT_FAMILY,"bold")}}},r={lollipop:{fillStyle:(0,d.generateColor)(i,85)}},o={lollipop:{fillStyle:i,text:{strokeStyle:(0,l.getHexColorByName)("color-tv-blue-50")}}};this._defaultStyle=s,this._hoveredStyle=(0,c.merge)((0,u.deepCopy)(s),r),this._activeStyle=(0,c.merge)((0,u.deepCopy)(s),o),this._stylesCache=null}_getMoreFinancialsLinkText(){var e,t;return n.t(null,{replace:{symbol:null!==(t=null===(e=this._model.mainSeries().symbolInfo())||void 0===e?void 0:e.name)&&void 0!==t?t:""}},i(177743))}}var pe=i(888929),ve=i(251824) ;const me=pe.sortSourcesPreOrdered.Dividends,ye=pe.sortSourcesPreOrdered.Splits,be=pe.sortSourcesPreOrdered.Earnings;class ge extends ve.LollipopStudyBase{zorder(){return me}isValid(e){const t=e[2];return(0,c.isNumber)(t)}state(e,t){const i=super.state(e,t);return i.data.version=2,i}restoreData(e){var t;(null!==(t=e.version)&&void 0!==t?t:1)<2&&e.data.forEach((e=>{e.value[3]=null})),super.restoreData(e)}_createViews(){this._paneView=new _e(this._model,this,this._showTooltip.bind(this)),super._createViews()}_externalVisibilityProperty(){return this._model.mainSeries().properties().childs().esdShowDividends}}class Se extends ve.LollipopStudyBase{zorder(){return ye}isValid(e){const t=e[3];return(0,c.isNumber)(t)}_createViews(){this._paneView=new he(this._model,this,this._showTooltip.bind(this)),super._createViews()}_externalVisibilityProperty(){return this._model.mainSeries().properties().childs().esdShowSplits}}class fe extends ve.LollipopStudyBase{constructor(){super(...arguments),this._estimatePlotRow=null}zorder(){return be}isValid(e){const t=e[3],i=e[4];return(0,c.isNumber)(t)&&(0,c.isNumber)(i)}restoreData(e){super.restoreData(e);let t=null;if(e.estimate)t=this._restorePointset(e.estimate);else if(e.pointSets&&null==e.pointSetsVersion){const i=this._getSymbol();if(null!==i){const s=i.split(":")[1].toUpperCase();e.pointSets[i]?t=this._restorePointset(e.pointSets[i]):e.pointSets[s]&&(t=this._restorePointset(e.pointSets[s]))}}else if(e.pointSets&&"1"===e.pointSetsVersion){const i=this._getSymbol();if(null!==i){const s=i.split(":")[1].toUpperCase();e.pointSets[i]?t=e.pointSets[i].estimate:e.pointSets[s]&&(t=e.pointSets[s].estimate)}}else null!=e.estimatePlotRow&&"2"===e.pointSetsVersion&&(t=e.estimatePlotRow);this._estimatePlotRow=t}getEstimate(){return this._estimatePlotRow}_createViews(){this._paneView=new oe(this._model,this,this._showTooltip.bind(this)),super._createViews()}_externalVisibilityProperty(){return this._model.mainSeries().properties().childs().esdShowEarnings}_getSymbol(){var e,t;return null!==(t=null===(e=this._series.symbolInfo())||void 0===e?void 0:e.base_name[0].toLowerCase())&&void 0!==t?t:null}_restorePointset(e){return{index:e.index,value:[e.tickmark,void 0,e.estimate,(0,c.isNumber)(e.period)?e.period:r()(e.period).unix(),(0,c.isNumber)(e.date)?e.date:r()(e.date).unix()]}}}},736543:(e,t,i)=>{"use strict";i.d(t,{financialPeriodToShortString:()=>l,financialPeriodToString:()=>o});var s=i(650151),r=i(444372);function o(e){switch(e){case"FQ":return r.t(null,void 0,i(908831));case"FY":return r.t(null,void 0,i(34314));case"FH":return r.t(null,void 0,i(512421));case"TTM":return r.t(null,void 0,i(794236))}(0,s.ensureNever)(e)}function l(e){switch(e){case"FQ":return r.t(null,void 0,i(99374));case"FY":return r.t(null,void 0,i(776550));case"FH":return r.t(null,void 0,i(924468));case"TTM":return r.t(null,void 0,i(794236))}(0,s.ensureNever)(e)}},709081:(e,t,i)=>{"use strict";i.d(t,{Fundamental:()=>g});var s=i(444372),r=i(470452),o=i(736543),l=i(932167);class n extends l.StudyPriceAxisView{constructor(e,t){ super(e,t),this._fundamental=e}_updatePaneRendererData(e){e.text="",this._showPaneLabel()&&(e.text=this._fundamental.labelTitle(),e.visible=!0)}}var a=i(506387);class h extends a.StudyPriceLineAxisView{constructor(e,t){super(e,t),this._model=e.model()}_isVisible(){return this._model.properties().childs().scalesProperties.childs().showFundamentalLastValue.value()&&this._study.properties().childs().styles.childs()[this._plotname].childs().trackPrice.value()}}var u=i(509550),c=i(7288);const d=s.t(null,void 0,i(490411));class _ extends u.StudyStatusProvider{sourceStatusText(){const e=this._source.status();return e.type===c.StudyStatusType.Error&&(e.errorDescription.error.startsWith("resolve_error ")||e.errorDescription.error.startsWith("Symbol resolve error:"))?d:super.sourceStatusText()}}var p=i(368135),v=i(195447),m=i(534741),y=i(291784),b=i(982217);class g extends r.Study{constructor(e,t,i,s){super(e,t,i,s),this._linePlot=null;const r=s.plots.findIndex((e=>"line"===e.type));if(-1!==r){const e=s.plots[r],i=t.childs().styles.childs()[e.id];i.hasChild("plottype")&&(this._linePlot={plotIndex:r,plotType:i.childs().plottype})}}labelTitle(){return this.title(b.TitleDisplayTarget.StatusLine,!0)}hasStateForAlert(){return!1}titleInParts(e,t,i,s,r){return[this._title(e,!!t)]}statusProvider(e){return new _(this)}firstValue(){var e;const t=super.firstValue();if(null!==t||null===this._linePlot||this._linePlot.plotType.value()!==p.LineStudyPlotStyle.StepLine&&this._linePlot.plotType.value()!==p.LineStudyPlotStyle.StepLineWithDiamonds)return t;const i=this._model.timeScale().visibleBarsStrictRange();if(null===i)return null;if(!this.properties().childs().visible.value()||!this.isActualInterval())return this._ownFirstValue;const s=this.data().search(i.firstBar()-1,m.PlotRowSearchMode.NearestLeft,this._linePlot.plotIndex+1);return null===s?null:null!==(e=s.value[this._linePlot.plotIndex+1])&&void 0!==e?e:null}priceRange(e,t,i){if(i.forceOverlayOnly)return null;let s=super.priceRange(e,t,i);if(null===s){const e=this.firstValue();null!==e&&(s=this._postProcessPriceRange(new y.PriceRange(e,e),i))}return s}_createPriceAxisView(e){return new n(this,{plotIndex:e})}_createPriceLineAxisView(e){return new h(this,e)}_title(e,t){const r=this.metaInfo();let l;if(l=t?r.shortDescription:r.description,void 0!==r.financialPeriod){const e=t?(0,o.financialPeriodToShortString)(r.financialPeriod):(0,o.financialPeriodToString)(r.financialPeriod);l=`${s.t(l,{context:"study"},i(168716))} · ${e}`}const n=this._titleInputs(e,!0),a=Object.keys(n);return a.length>0&&(l=`${s.t(n[a[0]],{context:"study"},i(168716))} · ${l}`),l}_titleInputsOptions(e,t,i){return{...super._titleInputsOptions(e,t,i),skipOptionalEmptySymbolInputs:!0,allowedInputTypes:["symbol"]}}_fillPrecalculatedAutoscaleInfo(e,t,i){const s=super._fillPrecalculatedAutoscaleInfo(e,t,i);if(null!==this._linePlot&&(this._linePlot.plotType.value()===p.LineStudyPlotStyle.StepLine||this._linePlot.plotType.value()===p.LineStudyPlotStyle.StepLineWithDiamonds)){ const t=this.data().search(e,m.PlotRowSearchMode.NearestLeft);if(null!==t){const e=t.value[this._linePlot.plotIndex+1];s.baseValueMinMax=(0,v.mergeMinMax)(s.baseValueMinMax,{min:e,max:e})}}return s}}},580683:(e,t,i)=>{"use strict";function s(e,t,i){let s=e[`${t}#${i}`]||null;return null===s&&(s=e[t]||null),null===s&&Object.keys(e).forEach((i=>{null===s&&i.startsWith(`${t}#`)&&(s=e[i]||null)})),s}i.d(t,{getObsoleteIdeaSymbolInfo:()=>s})},867539:(e,t,i)=>{"use strict";i.d(t,{LinearRegressionStudy:()=>l});var s=i(650151),r=i(732149),o=i(772466);class l extends o.NonSeriesStudy{startIndex(){const e=this.customData();if(null==e||null==this._indexes)return null;const t=this._indexes[e.startIndex];return t!==r.INVALID_TIME_POINT_INDEX?t:null}endIndex(){const e=this.customData();if(null==e||null==this._indexes)return null;const t=this._indexes[e.endIndex];return t!==r.INVALID_TIME_POINT_INDEX?t:null}baseLine(){const e=this.customData();return null!=e?e.baseLine:null}downLine(){const e=this.customData();return null!=e?e.downLine:null}upLine(){const e=this.customData();return null!=e?e.upLine:null}pearsons(){const e=this.customData();return null!=e&&void 0!==e.pearsons?e.pearsons:null}isVisible(){if(!this.properties().childs().visible.value()||!this.isActualInterval())return!1;const e=(0,s.ensureDefined)(this.properties().childs().styles.childs());return 0!==e.upLine.childs().display.value()||0!==e.downLine.childs().display.value()||0!==e.baseLine.childs().display.value()}_createViews(){super._createViews(),Promise.all([i.e(35698),i.e(13207),i.e(20507)]).then(i.bind(i,554855)).then((({LinearRegressionPaneView:e})=>{this._setPaneViews([new e(this.model(),this)])}))}}},251824:(e,t,i)=>{"use strict";i.d(t,{LollipopStudyBase:()=>h});var s=i(650151),r=i(470452),o=i(732149),l=i(782086),n=i(555502),a=i(65455);class h extends r.Study{constructor(e,t,i,s){super(e,t,i,s),this._restartRequired=!1,this.setOwnerSource(e.mainSeries());const r=this._externalVisibilityProperty();null!==r&&(this._destroyPropertyBinder=(0,a.bindProperties)(r,this._properties.childs().visible))}destroy(){var e;this._paneView.destroy(),null===(e=this._destroyPropertyBinder)||void 0===e||e.call(this),super.destroy()}autoScaleInfo(){return{range:null}}lollipopsAtIndex(e){return!this.hideLollipops()&&this.data().contains(e)?1:0}hideLollipops(){return this._model.timeScale().barSpacing()/23<2/3&&this._model.mainSeries().intervalObj().inMilliseconds()>=432e6}async start(){const e=super.start();return this._model.mainSeries().dataEvents().symbolResolved().subscribe(this,this._initPlotStash),this._initPlotStash(),e}stop(){super.stop(),this._model.mainSeries().dataEvents().symbolResolved().unsubscribe(this,this._initPlotStash)}restoreData(e){e.data=e.data.filter((e=>e.index!==o.INVALID_TIME_POINT_INDEX&&this.isValid(e.value))),this._transformData(e.data),e.end=e.data.length,super.restoreData(e)}onClickOutside(e,t){this._paneView.processClickOutside(e,t)}preferNoScale(){return!0}showInObjectTree(){return!1}isSavedInStudyTemplates(){return!1}isRemovedByStudyTemplates(){ return!1}removeByRemoveAllStudies(){return!1}isDraggable(){return!1}copiable(){return!1}statusView(){return null}hasStateForAlert(){return!1}isSavedInChart(e){return Boolean(e)}isSpeciallyZOrderedSource(){return!0}isUserDeletable(){return!1}canHaveChildren(){return!1}isIncludedInAutoScale(){return!1}isCurrencySource(){return!1}isUnitSource(){return!1}_externalVisibilityProperty(){return null}_transformData(e){for(let t=e.length-1;t>=0;--t){const i=e[t],s=i.index!==o.INVALID_TIME_POINT_INDEX&&this.isValid(i.value);this._updatePlotStash(i,s)}}_createViews(){this._paneViews=[this._paneView],this._priceAxisViews=[],this._dataWindowView||(this._dataWindowView=new l.DataWindowView),this._legendView=null,this._statusView||(this._statusView=new n.StudyStatusView(this))}_seriesDataRangeToSave(e){return this._model.timeScale().visibleBarsStrictRange()}async _showTooltip(e,t,r){const o=this._model,l=this._model.timeScale(),n=[l.onScroll(),l.barSpacingChanged(),o.mainSeries().onSymbolIntervalChanged(),(0,s.ensureNotNull)(o.paneForSource(this)).onSizeChanged()],a=this._paneView.processClickOutside.bind(this._paneView,e),h=this._paneView.clearLastClicked.bind(this._paneView),u=r();if(null===u)return;const{showLollipopTooltip:c}=await Promise.all([i.e(5987),i.e(43387),i.e(5761),i.e(28430),i.e(70428),i.e(4908),i.e(89508),i.e(37132),i.e(14),i.e(36827),i.e(37657),i.e(16600),i.e(36701),i.e(47686),i.e(72100),i.e(48277),i.e(7879),i.e(39118),i.e(35367),i.e(45469),i.e(50442),i.e(82578),i.e(6190),i.e(97821),i.e(75703),i.e(54843),i.e(98295),i.e(90385),i.e(59255),i.e(29571),i.e(69226),i.e(89688),i.e(49039)]).then(i.bind(i,722832));c({items:u,position:t,customCloseSubscriptions:n,onClickOutside:a,onCustomClose:h,showScrollFades:!0})}_initPlotStash(){this._plotStash={}}_updatePlotStash(e,t){if(this._restartRequired||!this._plotStash)return;const i=e.value.slice(),s=i.shift(),r=String(s);t?this._plotStash[r]?String(this._plotStash[r])!==String(i)&&(this._restartRequired=!0):this._plotStash[r]=i:this._plotStash[r]&&(this._restartRequired=!0)}}},22428:(e,t,i)=>{"use strict";i.d(t,{LollipopStudyPaneViewBase:()=>p});var s=i(86441),r=i(650151),o=i(444372),l=i(224743),n=i(988124),a=i(854798),h=i(700134),u=i(232650),c=i(199687),d=i(986837),_=i(244842);class p extends d.LollipopPaneView{constructor(){super(...arguments),this._getMoreFinancialsLinkInitialTabId=c.PageId.Overview,this._symbolName=null}addLollipop(e,t,i,r,o,l,n){var a,h;if(null===this._symbolName&&(this._symbolName=null!==(h=null===(a=this._model.mainSeries().symbolInfo())||void 0===a?void 0:a.name)&&void 0!==h?h:null,null===this._symbolName))return;const u=`${this._source.metaInfo().id}_${this._lollipopId(l)}_${this._symbolName}`,c=this._lollipops[u],d=void 0!==c?c.itemIndex:this._lollipopsCounter++,_=this._model.lastHittestData(),p=u===this.getLastClickedLollipopId(),v=this._model.hoveredSource()===this._source&&null!==_&&_.activeItem===d;this._lollipops[u]={id:u,itemIndex:d,visible:!0,basePoint:new s.Point(i.indexToCoordinate(o),e),hovered:v,active:p,stack:n,...this.extraData(l)}} renderer(e){return this._invalidated&&(this._updateImpl(e),this._invalidated=!1),this._source.hideLollipops()?null:this._renderer}_lollipopId(e){return e[0].toString()}_updateImpl(e){const t=this._source.data(),i=this._model.timeScale(),s=i.visibleBarsStrictRange(),o=this._model.mainSeries().bars(),l=this._model.mainSeries(),n=l.priceScale(),a=l.firstBar();if(n.isEmpty()||i.isEmpty()||!a||!t||null===s)return;const h=this._model.mainPane();if(!h)return;if(this._source.hideLollipops())return void this.clearLastClicked();for(const e in this._lollipops)this._lollipops.hasOwnProperty(e)&&((0,r.ensureDefined)(this._lollipops[e]).visible=!1);const u=this._getY(),c=s.firstBar(),d=s.lastBar(),_=this._source.zorder(),p=h.lollipopDataSources().filter((e=>e!==this._source&&e.zorder()>_&&e.isVisible()));t.range(c,d).each(((e,t)=>{let s=0;for(const t of p)s+=t.lollipopsAtIndex(e);return this.addLollipop(u,o,i,n,e,t,s),!1})),this.afterUpdate(u,o,i,n),this._createRenderers(e)}_formatDate(e,t){var i;let s,r=!0;if(r=a.Version.parse(this._source.metaInfo().version).isLessOrEqual(new a.Version(137,0)),r){let t="Etc/UTC";this._model.mainSeries().isDWM()||(t=null!==(i=this._model.timezoneExceptExchange().value())&&void 0!==i?i:"");const r=(0,n.get_timezone)(t);s=(0,n.utc_to_cal)(r,e)}else s=new Date(e);return(t?"≈ ":"")+this._model.dateFormatter().format(s)}_getMoreFinancialsLink(){var e;if(!/\betf\b/i.test((null===(e=this._model.mainSeries().symbolInfo())||void 0===e?void 0:e.description)||""))return{text:this._getMoreFinancialsLinkText(),onClick:()=>{l.globalCloseDelegate.fire(),_.enabled("mobile_app_action_open_financials_webview")?(0,u.openFinancialsWebview)(new URLSearchParams):(0,h.showFinancialsDialog)({initialTabId:this._getMoreFinancialsLinkInitialTabId})}}}_getMoreFinancialsLinkText(){var e,t;return o.t(null,{replace:{symbol:null!==(t=null===(e=this._model.mainSeries().symbolInfo())||void 0===e?void 0:e.name)&&void 0!==t?t:""}},i(633282))}_onSymbolOrIntervalChanged(){super._onSymbolOrIntervalChanged(),this._symbolName=null}}},772466:(e,t,i)=>{"use strict";i.d(t,{NonSeriesStudy:()=>l,isNonSeriesStudy:()=>o});var s=i(650151),r=i(470452);function o(e){return e instanceof l}class l extends r.Study{clearData(){this._customData=null,this._indexes=null}restoreData(e,t,i){super.restoreData(e),this._customData=t,this._indexes=i}state(e){const t=super.state(e);return e&&(t.nonSeriesData=this._customData,t.indexes=this._indexes),t}customData(){return this._customData}_setPaneViews(e){this._paneViews=e,this.model().lightUpdate()}_onDataUpdated(e,t,i){null!==t&&(t.indexes_replace?((0,s.assert)("nochange"!==i),this._indexes=i):(this._customData=t.data,"nochange"!==i&&(this._indexes=i))),super._onDataUpdated(e,t,i)}}},677395:(e,t,i)=>{"use strict";i.d(t,{study_PivotPointsStandard:()=>R});var s=i(650151),r=i(772466),o=i(743068),l=i(199471);class n{constructor(e,t,i,s){this._priceAxisFontSize=11,this._prices=[],this._labelWidth=0,this._pixelRatioParams=e,this._recreateCanvasAndContext((0,o.size)({width:0,height:0})),this.reset({font:t, fontSize:i,backColors:s})}destroy(){delete this._canvas,delete this._cache}canvas(){return this._canvas}reset(e){this._renderParams=e,this._prices=[],this._cache.font=e.fontSize+"px "+e.font,this._labelWidth=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5","/"].reduce(((e,t)=>{const i=this._cache.measureText(t).width;return Math.max(i,e)}),0)}rowHeight(){return this._priceAxisFontSize+4}labelRectByIndex(e){return{left:0,top:Math.round(this._topByIndex(e)),width:Math.round(this._labelWidth+4),height:Math.round(this._renderParams.fontSize+8)}}setPrices(e){let t=!1;const i=(e,t)=>{const i=void 0===e,r=void 0===t;return(!i&&!r||i===r)&&(0,s.ensureDefined)(e).formatted===(0,s.ensureDefined)(t).formatted};if(e.length!==this._prices.length)t=!0;else for(let s=0;s{this._cache.translate(.5,.5),this._cache.font=this._renderParams.fontSize+"px "+this._renderParams.font,this._cache.textBaseline="middle";for(let e=0;e=o||h)){this._visiblePivots.add(l[e]),this._prices=[];for(let i=0;i=t.left&&e.x<=t.left+t.width&&e.y>=t.top&&e.y<=t.top+t.height)return new x.HitTestResult(x.HitTarget.Regular);return null}_drawImpl(e){const t=this._cacheProvider(e),{horizontalPixelRatio:i,verticalPixelRatio:s,context:r}=e;this._drawRects=[];const o=e=>{const o=t.labelRectByIndex(e),l={left:Math.round(this._point.x-o.width+n),top:Math.round(this._point.y-o.height/2),width:o.width,height:o.height};return r.drawImage(t.canvas(),Math.round(o.left*i),Math.round(o.top*s),o.width*i,o.height*s,Math.round(l.left*i),Math.round(l.top*s),l.width*i,l.height*s),this._drawRects.push(l),o.width},l=this._label.split("/");let n=0;for(let e=0;e0&&(n+=o(t+11)/2),n+=o(t)/2}}}function I(e){return"P"===e?e:"S"+e[1]+"/R"+e[1]}function D(e,t,i){const s=t;void 0===e[s]?e[s]={text:i,ids:[I(i)]}:(e[s].text+="/"+i,e[s].ids.push(I(i)))}class M{constructor(e,t){this._pivots=[],this._invalidated=!0,this._renderer=new C.CompositeRenderer, this._model=e,this._source=t,this._cacheProvider=this._source.getCache.bind(this._source)}update(e){this._invalidated=!0}renderer(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer}_updateImpl(){this._renderer.clear();const e=this._source.ownerSource();if(null===e)return;this._source.pricesView().prices(),this._pivots=[];const t=this._source.customData();if(!t||!t.pivots)return;const i=this._source.properties().childs();if(!i.visible.value())return;const r=t.pivots,o=this._source.indexes(),l=this._model.timeScale(),n=this._source.priceScale(),a=e.firstValue();if(!n||n.isEmpty()||l.isEmpty()||!r||!o||null===a)return;const h=(0,s.ensureNotNull)(l.visibleBarsStrictRange()),u=h.firstBar(),c=h.lastBar();for(let e=0;ec)continue;const h={},d=i.levelsStyle.childs().visibility.childs();d.P.value()&&D(h,r[e].p,"P"),d["S1/R1"].value()&&(D(h,r[e].s1,"S1"),D(h,r[e].r1,"R1")),d["S2/R2"].value()&&(D(h,r[e].s2,"S2"),D(h,r[e].r2,"R2")),d["S3/R3"].value()&&(D(h,r[e].s3,"S3"),D(h,r[e].r3,"R3")),d["S4/R4"].value()&&(D(h,r[e].s4,"S4"),D(h,r[e].r4,"R4")),d["S5/R5"].value()&&(D(h,r[e].s5,"S5"),D(h,r[e].r5,"R5"));const _=l.indexToCoordinate(t),p=l.indexToCoordinate(s);for(const t of Object.keys(h)){const i=parseFloat(t),s=n.priceToCoordinate(i,a);this._pivots.push({x1:_,x2:p,y:s,label:h[t].text,labelIds:h[t].ids,src:r[e]})}}const d=i.levelsStyle.childs().colors,_=i.levelsStyle.childs().widths,p=this._source.visiblePivots();for(let e=0;ethis.processHibernate()))}pricesView(){return this._pricesView}indexes(){return this._indexes}properties(){return this._properties}getCache(e){if(null===this._cache||null==this._cachedPixelRatioParams||(t=e,i=this._cachedPixelRatioParams,t.horizontalPixelRatio!==i.horizontalPixelRatio||t.verticalPixelRatio!==i.verticalPixelRatio)){this._cache&&this._cache.destroy();const t=this._getActualCacheParams(),i={horizontalPixelRatio:e.horizontalPixelRatio,verticalPixelRatio:e.verticalPixelRatio};this._cache=new n(i,t.font,t.fontSize,t.backColors),this._cache.setPrices((0,s.ensureNotNull)(this._pricesView).prices()),this._cachedPixelRatioParams=i,this._cache.reset(t)}var t,i;return this._cache}priceLabelText(e){ return this._metaInfo.shortDescription+":"+e.toUpperCase()}updateAllViews(e){super.updateAllViews(e),this._pricesView.update()}visiblePivots(){return this._pricesView.visiblePivots()}isVisible(){if(!this.properties().childs().visible.value()||!this.isActualInterval())return!1;const e=["P","S1/R1","S2/R2","S3/R3","S4/R4","S5/R5"],t=this.properties().childs().levelsStyle.childs().visibility;for(let i=0;it)continue;const r=[],a=this.properties().childs().levelsStyle.childs().visibility.childs();a.P.value()&&r.push(o[i].p),a["S1/R1"].value()&&r.push(o[i].s1,o[i].r1),a["S2/R2"].value()&&r.push(o[i].s2,o[i].r2),a["S3/R3"].value()&&r.push(o[i].s3,o[i].r3),a["S4/R4"].value()&&r.push(o[i].s4,o[i].r4),a["S5/R5"].value()&&r.push(o[i].s5,o[i].r5);for(let e=0;e{"use strict";i.d(t,{study_ESD$TV_ROLLDATES:()=>V});var s=i(251824),r=i(822914),o=i(195294),l=i(444372),n=i(1500),a=i(860037),h=i(22428),u=i(458963),c=i(511131),d=i(422333),_=i(246733),p=i(682103),v=i(528474);const m=[l.t(null,void 0,i(926910)),l.t(null,void 0,i(316467)),l.t(null,void 0,i(322852)),l.t(null,void 0,i(997637)),l.t(null,void 0,i(668327)),l.t(null,void 0,i(49385)),l.t(null,void 0,i(323230)),l.t(null,void 0,i(486797)),l.t(null,void 0,i(661132)),l.t(null,void 0,i(290784)),l.t(null,void 0,i(171194)),l.t(null,void 0,i(55669))] ;var y=i(315801),b=i(787123),g=i(382778);const S=new Path2D("m13 6.02.5-.52-.5-.52-3.33-3.5-1.09 1.04 2.13 2.23H6.23L2.13.95l-1.01 1.1 4.3 4 .22.2H10.71L8.58 8.48l1.09 1.04 3.34-3.5Zm-9.4.45-3 3 1.06 1.06 3-3L3.6 6.47Z");class f extends g.LollipopRenderer{_drawLollipop(e,t,i){const s=this._data.style;e.save(),e.translate(t.x,t.y),e.scale(i.horizontalPixelRatio,i.verticalPixelRatio),e.beginPath(),e.strokeStyle=s.outerBorderColor,e.lineWidth=1,e.arc(0,0,11,0,2*Math.PI),e.stroke(),e.fillStyle=s.backgroundColor,e.beginPath(),e.arc(0,0,10.5,0,2*Math.PI),e.fill(),e.translate(-6.5,-5.5),e.fillStyle=s.iconColor,e.fill(S),e.translate(6.5,5.5),s.borderColor&&(e.strokeStyle=s.borderColor,e.lineWidth=1.5,(0,b.setLineStyle)(e,u.LINESTYLE_SOLID),e.beginPath(),e.arc(0,0,9.75,0,2*Math.PI),e.stroke()),e.restore()}}var C=i(717090);const w=l.t(null,void 0,i(520516)),x=l.t(null,void 0,i(570323)),P=l.t(null,void 0,i(881240)),T=l.t(null,void 0,i(676912)),I={dark:{background:(0,o.getHexColorByName)("color-cold-gray-900"),foreground:(0,o.getHexColorByName)("color-deep-blue-a200"),linkColor:(0,o.getHexColorByName)("color-tv-blue-500")},light:{background:(0,o.getHexColorByName)("color-white"),foreground:(0,o.getHexColorByName)("color-deep-blue-a400"),linkColor:(0,o.getHexColorByName)("color-tv-blue-500")}},D={barLine:{lineStyle:u.LINESTYLE_DASHED,lineWidth:1,strokeStyle:""},lollipop:{width:21,height:21,bottom:2,lineWidth:1.5,strokeStyle:"",backgroundColor:"",fillCircle:!0,fillStyle:"",text:{label:"",strokeStyle:"",font:(0,c.makeFont)(12,d.CHART_FONT_FAMILY,"bold")}},iconColor:"",backgroundColor:"",outerBorderColor:""},M=["F","G","H","J","K","M","N","Q","U","V","X","Z"];function L(e,t){const i=Math.floor(t/100),s=t-100*i-1;return{name:`${e}${M[s]}${i}`,expirationDate:`${m[s]} ${i}`}}class R extends h.LollipopStudyPaneViewBase{extraData(e){const t=[];for(let i=0;i<4;++i){const s=3*i+1;if(!Boolean(e[s]))break;t.push({currentContractCode:e[s],nextContractCode:e[s+1],switchDate:e[s+2]})}return{items:t}}_createRendererForLollipop(e,t){return new f(e,new y.HitTestResult(y.HitTarget.Custom,t),this._textWidthCache)}_createTooltipContent(e){return e.items.map((e=>{const t=[{name:T,value:(0,p.formatYYYYMMDD)(this._model.dateFormatter(),e.switchDate)}],s=this._model.dark().value()?I.dark:I.light,r=this._model.mainSeries(),o=this._model.mainSeries().symbolInfo();if(null!==o&&void 0!==o.root){const i=o.listed_exchange,l={color:s.linkColor,cursor:"pointer"},n=L(o.root,e.currentContractCode);t.push({name:x,value:n.name,valueStyle:l,onValueClick:()=>this._model.undoModel().setSymbol(r,`${i}:${n.name}`)}),t.push({name:" ",value:n.expirationDate});const a=L(o.root,e.nextContractCode);t.push({name:P,value:a.name,valueStyle:l,onValueClick:()=>this._model.undoModel().setSymbol(r,`${i}:${a.name}`)}),t.push({name:" ",value:a.expirationDate})}return{type:"common",title:w,tooltipInformationButtonProps:{ariaLabel:l.t(null,void 0,i(29038)),icon:"question",onClick:()=>(0,a.showSupportDialog)({solutionId:n.solutionIds.SWITCHING_CONTINUOUS_FUTURES_CONTRACTS})},subTitle:t, tooltipIcon:C,style:{color:s.foreground}}}))}_lollipopId(e){return e[3].toString()}_showBarLine(e){return super._showBarLine(e)||this._model.mainSeries().properties().childs().showContinuousContractSwitchesBreaks.value()}_recreateStyles(e){const t=this._model.dark().value()?I.dark:I.light,i=t.foreground,s=t.background,o=(0,r.default)(D);o.iconColor=i,o.borderColor=i,o.backgroundColor=s,o.outerBorderColor=s,o.barLine.strokeStyle=i,this._defaultStyle=o;const l=(0,r.default)(o);l.backgroundColor=(0,v.blendColors)(s,(0,_.applyAlpha)(i,.15)),this._hoveredStyle=l;const n=(0,r.default)(o);n.backgroundColor=i,n.iconColor=s,n.borderColor=void 0,this._activeStyle=n,this._stylesCache=null}}var k=i(888929),E=i(389137);class V extends s.LollipopStudyBase{zorder(){return k.sortSourcesPreOrdered.RollDates}isValid(e){const t=e[4];return(0,E.isNumber)(t)}_createViews(){this._paneView=new R(this._model,this,this._showTooltip.bind(this)),super._createViews()}_externalVisibilityProperty(){return this._model.mainSeries().properties().childs().showContinuousContractSwitches}}},275028:(e,t,i)=>{"use strict";i.d(t,{ReplayStudyStrategy:()=>a,getReplayStrategyMetaInfo:()=>h});var s=i(980004),r=i(7288),o=i(268222),l=i(347710),n=i(883161);class a extends s.StudyStrategy{constructor(e,t,i,s,r){t.merge({strategy:{orders:{showLabels:!0,showQty:!0,visible:!0}}}),super(e,t,i,s,r,!0),this._notifyStudyTurnaroundCounter=0,this._notificationsInProgress=new Map,this._replayStudyProperties=null;const o=this.properties().childs().inputs,l=()=>{const e=this._recoveryState();"recoveryState"in o.childs()&&o.childs().recoveryState.setValue(JSON.stringify(e))};e.mainSeries().onIntervalChanged().subscribe(this,l),e.replayStudyStrategyProperties().then((e=>{this._isDestroyed||(this._replayStudyProperties=e,this._replayStudyProperties.subscribe(this,(()=>{this.properties().childs().inputs.mergeAndFire(e.state())})),this.properties().childs().inputs.mergeAndFire(e.state()))})),o.subscribe(this,((e,t)=>{"recoveryState"!==t&&l()}))}destroy(){var e;this._notificationsInProgress.forEach((e=>{e.reject("The study has been destroyed")})),this._model.mainSeries().onIntervalChanged().unsubscribeAll(this),null===(e=this._replayStudyProperties)||void 0===e||e.unsubscribeAll(this),super.destroy()}showInObjectTree(){return!1}statusView(){return null}async notifyStudy(e){await this._waitForComplete();const t="notify_"+ ++this._notifyStudyTurnaroundCounter,i=(0,o.createDeferredPromise)();return this._notificationsInProgress.set(t,i),this._sendNotifyCommand(t,e),i.promise}_onData(e){var t,i;if("notify_study_ok"===e.method){const i=e.params[1];null===(t=this._notificationsInProgress.get(i))||void 0===t||t.resolve(),this._notificationsInProgress.delete(i)}if("notify_study_error"===e.method){const t=e.params[1],s=e.params[2];null===(i=this._notificationsInProgress.get(t))||void 0===i||i.reject(s),this._notificationsInProgress.delete(t)}super._onData(e)}_waitForComplete(){return this.status().type===r.StudyStatusType.Completed?Promise.resolve():new Promise(((e,t)=>{const i=s=>{ s.type===r.StudyStatusType.Completed?(this.onStatusChanged().unsubscribe(null,i),e()):s.type===r.StudyStatusType.Error&&(this.onStatusChanged().unsubscribe(null,i),t(s.errorDescription))};this.onStatusChanged().subscribe(null,i)}))}_recoveryState(){var e;const{activeOrders:t,filledOrders:i}=null!==(e=this.reportData())&&void 0!==e?e:{};return{activeOrders:t,filledOrders:i}}}function h(){return(0,l.studyMetaInfoRepository)().findById({type:"java",studyId:n.replayStrategyStudyId})}},306682:(e,t,i)=>{"use strict";i.d(t,{StudyStub:()=>g});var s=i(316230),r=i(623551),o=i(572230),l=i(555502),n=i(974655),a=i(624444),h=i(707957),u=i(354950),c=i(414585),d=i(982217);class _ extends c.StudyStatusProviderBase{text(){return this._source.isActualInterval()?`${this._source.title(d.TitleDisplayTarget.StatusLine)} ${this.sourceStatusText()}`:this._source.title(d.TitleDisplayTarget.StatusLine)}}var p=i(7288),v=i(790524),m=i(347710);class y{getItems(){return[]}getValues(e){return[]}}const b=new h.Delegate;class g extends n.PriceDataSource{constructor(e,t,i,s,r=null){super(e),this._priceStep=.01,this._origState=null,this._descriptor=null,this._status={type:p.StudyStatusType.Undefined},this._statusChanged=new h.Delegate,this._descriptorChanged=new h.Delegate,this._formatter=new a.PriceFormatter({priceScale:100}),this._pineSourceCodeModel=null,(0,m.isStudyDescriptor)(t)?this._descriptor=t:this._origState=t,this._title=i,this._alwaysShowInLegend=s,this._studyMetaInfo=r;this._properties=new u.Property({visible:!0}),this._statusView=new l.StudyStatusView(this)}destroy(){var e,t,i;null===(t=null===(e=this._pineSourceCodeModel)||void 0===e?void 0:e.get())||void 0===t||t.destroy(),null===(i=this._pineSourceCodeModel)||void 0===i||i.destroy(),super.destroy()}barColorer(){return null}properties(){return this._properties}statusView(){return this._statusView}legendView(){return null}state(e){return this._origState}getDescriptor(){return null===this._descriptor?null:{descriptor:this._descriptor,title:this._title,isOverlay:Boolean(this._alwaysShowInLegend),id:this.id(),status:this._status}}updateDescriptor(e){(0,s.default)(this._descriptor,e)||(this._descriptor=e,this._descriptorChanged.fire())}onDescriptorChanged(){return this._descriptorChanged}metaInfo(){return this._studyMetaInfo}setStatus(e){const t=this.isDisplayedInLegend();if(this._status=e,this._statusChanged.fire(),this.isDisplayedInLegend()!==t){const e=this._model.paneForSource(this);if(e){const t=this._model.panes().indexOf(e),i=o.InvalidationMask.invalidateLegendWidgetLayout(t);this.model().invalidate(i)}}}formatter(){return this._formatter}name(){return this._title}title(){return this._title}titleInParts(){return[this._title]}isFailed(){return this._status.type===p.StudyStatusType.Error}isLoading(){return this._status.type===p.StudyStatusType.Loading}isDisplayedInLegend(){return this._alwaysShowInLegend||this.isFailed()}setFailed(e){this.setStatus({type:p.StudyStatusType.Error,errorDescription:{error:e}}),this._model.updateSource(this)}isSymbolInvalid(){return!1}isActualInterval(){ return!0}onIsActualIntervalChange(){return b}start(){}status(){return this._status}onStatusChanged(){return this._statusChanged}firstValue(){return null}currency(){return null}sessionId(){return this._model.mainSeries().sessionId()}sessionIdChanged(){return this._model.mainSeries().sessionIdChanged()}unit(){return null}symbolSource(){return this._model.mainSeries()}barsProvider(){return this._model.mainSeries()}legendValuesProvider(){return new y}statusProvider(e){return new _(this)}isRemovedByStudyTemplates(){return null!==this._origState&&(0,v.isStudyState)(this._origState)}pineSourceCodeModel(){return null!==this._descriptor&&"pine"===this._descriptor.type?(this._pineSourceCodeModel||(this._pineSourceCodeModel=new r.AsyncResourceWrapper(i.e(89199).then(i.bind(i,990960)).then((e=>this._isDestroyed?null:new e.PineStubSourceCodeModel(this))))),this._pineSourceCodeModel.promise()):Promise.resolve(null)}}},556983:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TpoPeriodicStudy:()=>h,createTpoPeriodicStudy:()=>u});var s=i(650151),r=i(339315),o=i(444331),l=i(470452),n=i(347710),a=i(856676);class h extends a.TpoStudyBase{splitMergeSupported(){return!0}_splitsAndMergesActionsKey(){const e=this._model.mainSeries(),t=e.proSymbol(),i=this.properties().childs().inputs.childs();return`${t};${this._chartStyleMode||(0,o.isTimeBasedStyle)(e.style())?"common":e.style()};${i.blockSize.value()};${i.periodsNum.value()};${i.period.value()}`}_splitsAndMergesInputsDeps(){return["blockSize","periodsNum","period"]}}async function u(e,t){const i=(0,s.ensureDefined)(r.SYMBOL_STRING_DATA[18]),o=await(0,n.studyMetaInfoRepository)().findById({type:"java",studyId:i.type}),a=(0,l.prepareStudyProperties)(o,{},null,(0,n.studyMetaInfoRepository)().studyVersioning(),[]);return new h(e,a,[],o,!0,t)}},857191:(e,t,i)=>{"use strict";i.d(t,{TpoSessionsStudy:()=>r});var s=i(856676);class r extends s.TpoStudyBase{splitMergeSupported(){return!1}}},856676:(e,t,i)=>{"use strict";i.d(t,{TpoStudyBase:()=>y,extendingInputIds:()=>p});var s=i(827147),r=i(650151),o=i(444372),l=i(201089),n=i(809796),a=i(142257),h=i(470452),u=i(354950),c=i(339315),d=i(66732),_=i(832696);const p=["extendPoorLow","extendPoorHigh","extendPOC","extendSingleprints"],v=(0,l.getLogger)("Chart.TpoStudyBase");class m extends a.UndoCommand{constructor(e,t,s){super(new n.TranslatedString("TPO Reset all splits and merges",o.t(null,void 0,i(543775)))),this._model=e,this._id=t,this._splitsAndMerges=s}redo(){this._study().setSplitsAndMerges({})}undo(){this._study().setSplitsAndMerges(this._splitsAndMerges)}_study(){return(0,r.ensureNotNull)(this._model.dataSourceForId(this._id))}}class y extends h.Study{constructor(e,t,i,s,r,o=m){p.forEach((e=>t.removeExcludedKey(`inputs.${e}`,1))),super(e,t,i,s),this._autoTickPerRowData=null,this._splitsAndMerges={},this._histogramIsTooLargeCounter=0,this._onSeriesCompletedChanged=e=>{e&&(this._seriesCompleted.unsubscribe(this._onSeriesCompletedChanged),this._tryCalculateTickPerRow())},this._seriesCompleted=(0, d.combine)((e=>c.seriesReadyStatuses.has(e.seriesStatus)),e.mainSeries().compositeStatusVW().weakReference()),this._chartStyleMode=!!r,this._resetAllSplitsUndoCommandCtor=o,t.childs().styles.hasChild("splitByBlocks")||t.childs().styles.addChild("splitByBlocks",new u.Property(!1));const l="graphics.tpoLevels.tpo";t.setThemedColors([{path:`${l}.tpoPoc.color`,colors:_.tpoThemedColors.poc},{path:`${l}.tpoPoorHigh.color`,colors:_.tpoThemedColors.poorHigh},{path:`${l}.tpoPoorLow.color`,colors:_.tpoThemedColors.poorLow},{path:`${l}.tpoSingleprints.color`,colors:_.tpoThemedColors.singleprints},{path:`${l}.tpoVah.color`,colors:_.tpoThemedColors.vah},{path:`${l}.tpoVal.color`,colors:_.tpoThemedColors.val}]);const n=e.mainSeries(),a=()=>{this._autoTickPerRowData=null,this._tryCalculateTickPerRow()},h=()=>{const e=this.properties().childs().inputs.childs();"Auto"===e.rowSize.value()&&e.ticksPerRow.setValue(NaN),this._autoTickPerRowData=null,this._seriesCompleted.unsubscribe(this._onSeriesCompletedChanged),this._seriesCompleted.subscribe(this._onSeriesCompletedChanged,{once:!0}),this._histogramIsTooLargeCounter=0};this.properties().childs().inputs.childs().rowSize.subscribe(this,a),this.properties().onRestoreFactoryDefaults().subscribe(this,a),n.symbolResolved().subscribe(this,h),n.properties().childs().symbol.subscribe(this,h),n.onIntervalChanged().subscribe(this,h),this._tryCalculateTickPerRow();const v=this._properties.childs().inputs.childs();if(this._properties.addExcludedKey("inputs.mergePoints",1),this.splitMergeSupported()){n.symbolResolved().subscribe(this,this._applySplitAndMerges),n.properties().childs().symbol.subscribe(this,this._applySplitAndMerges);const e=v.mergePoints;this._splitsAndMerges[this._splitsAndMergesActionsKey()]=e.value(),this._splitsAndMergesInputsDeps().forEach((e=>{var t;null===(t=v[e])||void 0===t||t.subscribe(this,this._applySplitAndMerges)})),e.subscribe(this,(()=>{const t=this._splitsAndMergesActionsKey(),i=e.value();"[]"===i?delete this._splitsAndMerges[t]:this._splitsAndMerges[t]=i}))}}destroy(){const e=this._model.mainSeries();this._seriesCompleted.unsubscribe(this._onSeriesCompletedChanged),this._seriesCompleted.destroy(),e.symbolResolved().unsubscribeAll(this),e.properties().childs().symbol.unsubscribeAll(this),e.onIntervalChanged().unsubscribeAll(this),this._properties.destroy(),super.destroy()}preferredZOrder(){return 0}stateCustomFields(){var e;return{autoTickPerRowData:null!==(e=this._autoTickPerRowData)&&void 0!==e?e:void 0,splitsAndMerges:this._splitsAndMerges}}restoreStateCustomFields(e){var t,i;this._autoTickPerRowData=null!==(t=e.autoTickPerRowData)&&void 0!==t?t:null,this.splitMergeSupported()&&(this._splitsAndMerges=null!==(i=e.splitsAndMerges)&&void 0!==i?i:{},this._applySplitAndMerges())}resetAllSplitsAndMerges(){const e=this._model.undoModel(),t=new this._resetAllSplitsUndoCommandCtor(this._model,this.id(),{...this._splitsAndMerges});e.undoHistory().pushUndoCommand(t)}setSplitsAndMerges(e){this._splitsAndMerges=e,this._applySplitAndMerges()}splitBlock(e){ this._appendMergeSplitAction(e,"split",new n.TranslatedString("TPO split block",o.t(null,void 0,i(134234))))}mergeProfile(e){this._appendMergeSplitAction(e,"merge",new n.TranslatedString("TPO merge block",o.t(null,void 0,i(205340))))}paneViews(e){return this._chartStyleMode?this._paneViews:super.paneViews(e)}priceScale(){return this._chartStyleMode?this._model.mainSeries().priceScale():super.priceScale()}_splitsAndMergesActionsKey(){return""}_splitsAndMergesInputsDeps(){return[]}_apiInputs(){const{rowSize:e,...t}=super._apiInputs();return t}_allInputsAreValid(){const e=this.properties().childs().inputs.childs().ticksPerRow.value();return!isNaN(e)&&super._allInputsAreValid()}_autoRowSizeModeEnabled(){return"Auto"===this.properties().childs().inputs.childs().rowSize.value()}_tryCalculateTickPerRow(){if(this._autoRowSizeModeEnabled()&&(e=this._autoTickPerRowData,t=this._currentAutoTickPerRowData(),null===e||e.symbol!==t.symbol||e.interval!==t.interval)){this._calculateTickPerRow()?this._autoTickPerRowData=this._currentAutoTickPerRowData():(this._seriesCompleted.unsubscribe(this._onSeriesCompletedChanged),this._seriesCompleted.subscribe(this._onSeriesCompletedChanged,{once:!0}))}var e,t}_calculateTickPerRow(){const e=this._model.mainSeries(),t=e.symbolInfo(),i=e.data().bars();if(!i.size()||!t)return!1;const s=this._model.timeScale().visibleBarsStrictRange();if(null===s)return!1;const o=i.rangeCountback(s.lastBar(),300),l=o.minMaxOnRangeCached((0,r.ensureNotNull)(o.firstIndex()),(0,r.ensureNotNull)(o.lastIndex()),[{name:"low",offset:0},{name:"high",offset:0}]);if(null===l)return!1;const n=t.minmov/t.pricescale,a=(l.max-l.min)/n,h=Math.max(a/80,a/1e3),u=Math.pow(1.4,this._histogramIsTooLargeCounter)*h+5*this._histogramIsTooLargeCounter,c=Math.floor(Math.log10(h)),d=5*Math.max(1,Math.pow(10,c-1)),_=Math.round(u/d)*d,p=Math.min(1e6,Math.max(1,_));return this.properties().childs().inputs.childs().ticksPerRow.setValue(p),v.logInfo(`Autocalculate TicksPerRow.\n\t\t\tsymbol: ${this._series.symbol()}\n\t\t\tinterval: ${this._series.interval()}\n\t\t\tminTick: ${n}\n\t\t\thigh: ${l.max}\n\t\t\tlow: ${l.min}\n\t\t\thistogramIsTooLargeCounter: ${this._histogramIsTooLargeCounter}\n\t\t\tresult: ${p}`),!0}_currentAutoTickPerRowData(){const e=this._model.mainSeries();return{symbol:e.getSymbolString(),interval:e.interval()}}_onStudyError(e){const t=(0,s.default)(e)?e:e.error;if(this._autoRowSizeModeEnabled()&&t.startsWith("Histogram is too large")){if(++this._histogramIsTooLargeCounter<10)return v.logInfo("Recaluclate ticksPerRow with multiplicator"),void this._calculateTickPerRow();v.logWarn("Recaluclating ticksPerRow limit has been exceeded")}super._onStudyError(e)}_onStudyCompleted(e){v.logInfo("Reset histogramIsTooLargeCounter because of complete message"),this._histogramIsTooLargeCounter=0,super._onStudyCompleted(e)}_appendMergeSplitAction(e,t,i){const s=this._properties.childs().inputs.childs().mergePoints.value(),r=""===s?[]:JSON.parse(s);r.push({action:t,time:e}), this._model.undoModel().setProperty(this._properties.childs().inputs.childs().mergePoints,JSON.stringify(r),i)}_applySplitAndMerges(){var e;const t=null!==(e=this._splitsAndMerges[this._splitsAndMergesActionsKey()])&&void 0!==e?e:"[]";this._properties.childs().inputs.childs().mergePoints.setValue(t)}}},832696:(e,t,i)=>{"use strict";i.d(t,{tpoThemedColors:()=>c});var s=i(195294),r=i(246733);const o=(0,s.getHexColorByName)("color-cold-gray-900"),l=(0,s.getHexColorByName)("color-cold-gray-200"),n=(0,s.getHexColorByName)("color-deep-blue-a700"),a=(0,s.getHexColorByName)("color-deep-blue-a200"),h=(0,s.getHexColorByName)("color-grapes-purple-a200"),u=(0,r.generateColor)(h,85),c={poc:[o,l],poorHigh:[n,a],poorLow:[n,a],singleprints:[u,u],vah:[o,l],val:[o,l]}},205838:(e,t,i)=>{"use strict";i.r(t),i.d(t,{VolumeFootprintStudy:()=>n,createVolumeFootprintStudy:()=>a});var s=i(650151),r=i(470452),o=i(347710),l=i(339315);class n extends r.Study{constructor(){super(...arguments),this._rowSize=.1}rowSize(){return this._rowSize}hasStateForAlert(){return!1}paneViews(){return this._paneViews}priceScale(){return this._model.mainSeries().priceScale()}firstValue(){return this._model.mainSeries().firstValue()}stateCustomFields(){return{rowSize:this._rowSize}}restoreStateCustomFields(e){var t;this._rowSize=null!==(t=e.rowSize)&&void 0!==t?t:this._rowSize}_onDataUpdated(e,t,i,s){var r;super._onDataUpdated(e,t,i,s),(null==t?void 0:t.indexes_replace)||(this._rowSize=null!==(r=(null==t?void 0:t.data).rowSize)&&void 0!==r?r:this._rowSize)}}async function a(e){const t=(0,s.ensureDefined)(l.SYMBOL_STRING_DATA[17]),i=await(0,o.studyMetaInfoRepository)().findById({type:"java",studyId:t.type}),a=(0,r.prepareStudyProperties)(i,{},null,(0,o.studyMetaInfoRepository)().studyVersioning(),[]);return new n(e,a,[],i)}},744966:(e,t,i)=>{"use strict";i.d(t,{SessionVolume2Study:()=>M});var s=i(650151),r=i(963894),o=i(444372),l=i(195447),n=i(827523),a=i(62745),h=i(153730),u=i(7288),c=i(114315),d=i(989709),_=i(484812);class p{constructor(e,t){this._rough=e,this._detailed=t}forEach(e,t){this._mostDetailedHorizLines().forEach((i=>{e.call(t,i,i,this)}))}has(e){let t=!1;return this._mostDetailedHorizLines().forEach((i=>{t=t||i===e})),t}get size(){return this._rough.size}[Symbol.iterator](){const e=this._mostDetailedHorizLines().entries();return{[Symbol.iterator](){return this},next(){const t=e.next();return!0===t.done?t:{value:t.value[1]}}}}entries(){throw new Error("Not implemented")}keys(){throw new Error("Not implemented")}values(){throw new Error("Not implemented")}_mostDetailedHorizLines(){const e=new Map;this._rough.forEach((t=>e.set(t.startIndex,t)));for(let t=this._detailed.length-1;t>=0;t--){this._detailed[t].forEach((t=>{e.has(t.startIndex)&&e.set(t.startIndex,t)}))}return e}}class v{constructor(e,t){this._mergedHorizLinesSet=e,this._roughIterator=t}[Symbol.iterator](){return this}next(){const e=this._roughIterator.next();if(!0===e.done)return e;const t=e.value[0];return{value:[t,(0,s.ensureDefined)(this._mergedHorizLinesSet.get(t))]}}}class m{ constructor(e,t){this._roughHorizLineSets=e,this._detailedHorizLineSets=t}forEach(e,t){this._roughHorizLineSets.forEach(((i,r)=>{e.call(t,(0,s.ensureDefined)(this.get(r)),r,this)}))}get(e){const t=this._roughHorizLineSets.get(e);if(void 0!==t)return new p(t,this._detailedHorizLineSets.map((t=>t.get(e))).filter((e=>void 0!==e)))}has(e){return this._roughHorizLineSets.has(e)}get size(){return this._roughHorizLineSets.size}[Symbol.iterator](){return new v(this,this._roughHorizLineSets.entries())}entries(){throw new Error("Not implemented")}keys(){throw new Error("Not implemented")}values(){throw new Error("Not implemented")}}class y{constructor(e,t){this._rough=e,this._detailed=t}forEach(e,t){this._rough.forEach(((i,s)=>{for(const i of this._detailed){const r=i.get(s);if(void 0!==r)return void e.call(t,r,s,this)}e.call(t,i,s,this)}))}get(e){for(const t of this._detailed){const i=t.get(e);if(void 0!==i)return i}return this._rough.get(e)}has(e){for(const t of this._detailed){if(t.has(e))return!0}return this._rough.has(e)}get size(){return this._rough.size}[Symbol.iterator](){throw new Error("Not implemented")}entries(){throw new Error("Not implemented")}keys(){throw new Error("Not implemented")}values(){throw new Error("Not implemented")}}class b{constructor(e,t){this._graphics=e,this._styleId=t}forEach(e,t){this._graphics.hhistsByTimePointIndex().forEach((i=>{i.forEach((i=>{if(i.styleId===this._styleId){const s={firstBarTime:i.firstBarTime,lastBarTime:i.lastBarTime,rate:i.rate,priceHigh:i.priceHigh,priceLow:i.priceLow};e.call(t,s,s,this)}}))}))}has(e){let t=!1;return this._graphics.hhistsByTimePointIndex().forEach((i=>{i.forEach((i=>{i.styleId===this._styleId&&i===e&&(t=!0)}))})),t}get size(){let e=0;return this._graphics.hhistsByTimePointIndex().forEach((t=>{t.forEach((t=>{t.styleId===this._styleId&&e++}))})),e}[Symbol.iterator](){const e=this._graphics.hhistsByTimePointIndex()[Symbol.iterator]();let t,i;return{[Symbol.iterator](){return this},next(){for(;;){if(void 0===t&&(i=void 0,t=e.next(),!t.done&&!t.value))return{done:!0,value:void 0};const s=t.value;i||(i=s[Symbol.iterator]());const r=i.next();if(!r.done)return{value:r.value};{const e=t;if(t=void 0,r.value)return{value:r.value,done:e.done}}}}}}entries(){throw new Error("Not implemented")}keys(){throw new Error("Not implemented")}values(){throw new Error("Not implemented")}}class g{constructor(e,t){this._graphicsInfo=e,this._graphics=t}forEach(e,t){if(void 0===this._graphicsInfo.hhists)return;const i=Object.keys(this._graphicsInfo.hhists);for(const r of i)e.call(t,(0,s.ensureDefined)(this.get(r)),r,this)}get(e){if(void 0!==this._graphicsInfo.hhists)return new b(this._graphics,e)}has(e){return void 0!==this._graphicsInfo.hhists&&e in this._graphicsInfo.hhists}get size(){return void 0===this._graphicsInfo.hhists?0:Object.keys(this._graphicsInfo.hhists).length}[Symbol.iterator](){var e,t;const i=Object.keys(null!==(t=null===(e=this._graphicsInfo)||void 0===e?void 0:e.hhists)&&void 0!==t?t:{})[Symbol.iterator]();return{[Symbol.iterator](){return this},next:()=>{ const e=i.next();return e.done?{done:!0,value:e.value?[e.value,(0,s.ensureDefined)(this.get(e.value))]:void 0}:{value:[e.value,(0,s.ensureDefined)(this.get(e.value))],done:e.done}}}}entries(){throw new Error("Not implemented")}keys(){throw new Error("Not implemented")}values(){throw new Error("Not implemented")}}class S{constructor(e,t,i){this._graphicsInfo=e,this._roughStudyGraphics=t,this._detailedStudyGraphics=i}horizlines(){return new m(this._roughStudyGraphics.horizlines(),this._detailedStudyGraphics.map((e=>e.horizlines())))}vertlines(){return this._roughStudyGraphics.vertlines()}lines(){return this._roughStudyGraphics.lines()}hlines(){return this._roughStudyGraphics.hlines()}textmarks(){return this._roughStudyGraphics.textmarks()}shapemarks(){return this._roughStudyGraphics.shapemarks()}backgrounds(){return this._roughStudyGraphics.backgrounds()}polygons(){return this._roughStudyGraphics.polygons()}trendchannels(){return this._roughStudyGraphics.trendchannels()}hhists(){return new g(this._graphicsInfo,this)}hhistsByTimePointIndex(){return new y(this._roughStudyGraphics.hhistsByTimePointIndex(),this._detailedStudyGraphics.map((e=>e.hhistsByTimePointIndex())))}dwglabels(){return this._roughStudyGraphics.dwglabels()}dwglines(){return this._roughStudyGraphics.dwglines()}dwgpolylines(){return this._roughStudyGraphics.dwgpolylines()}dwgboxes(){return this._roughStudyGraphics.dwgboxes()}dwgtables(){return this._roughStudyGraphics.dwgtables()}dwgtablecells(){return this._roughStudyGraphics.dwgtablecells()}dwglinefills(){return this._roughStudyGraphics.dwglinefills()}tpos(){return this._roughStudyGraphics.tpos()}tpoBlockSets(){return this._roughStudyGraphics.tpoBlockSets()}tpoLevels(){return this._roughStudyGraphics.tpoLevels()}tpoVolumeRows(){return this._roughStudyGraphics.tpoVolumeRows()}logs(){return this._roughStudyGraphics.logs()}performance(){return this._roughStudyGraphics.performance()}footprints(){return this._roughStudyGraphics.footprints()}footprintLevels(){return this._roughStudyGraphics.footprintLevels()}}var f=i(964824),C=i(347710);const w="tv-volumebyprice",x=(0,n.studyIdString)("VbPSessionsRough",w),P=(0,n.studyIdString)("VbPSessionsDetailed",w),T=(0,n.studyIdString)("VbPSessionsDetailedAlerts",w),I=Number.MAX_SAFE_INTEGER,D=o.t(null,void 0,i(421934));class M extends h.VolumeProfileWithPriceRangeStudy{constructor(e,t,i,s){super(e,t,i,s),this._isPackageAvailable=L(),this._alertsStudyMetaInfo=null,this._roughDataSource=null,this._detailedDataSource=null,this._detailedDataBuffer=new r.CircularBuffer(7),this._loadedGraphics=null,this._loadedPlots=null,this._mergedGraphics=(0,_.emptyStudyGraphics)(),this._mergedPlots=this._emptyPlotList(),this._isPackageAvailable||this._setStatus({type:u.StudyStatusType.Error,errorDescription:{error:D}})}destroy(){null!==this._detailedDataSource&&(this._detailedDataSource.dataUpdated().unsubscribe(this,this._onRoughOrDetailedDataUpdated),this._detailedDataSource.dataCleared().unsubscribe(this,this._onRoughOrDetailedDataCleared), this._detailedDataSource.studyStatusChanged().unsubscribe(this,this._onStudyStatusChanged),this._detailedDataSource.destroy(),this._detailedDataSource=null),null!==this._roughDataSource&&(this._roughDataSource.dataUpdated().unsubscribe(this,this._onRoughOrDetailedDataUpdated),this._roughDataSource.dataCleared().unsubscribe(this,this._onRoughOrDetailedDataCleared),this._roughDataSource.studyStatusChanged().unsubscribe(this,this._onStudyStatusChanged),this._roughDataSource.destroy(),this._roughDataSource=null),super.destroy()}data(){return this._loadedPlots||this._mergedPlots}graphics(){return this._loadedGraphics||this._mergedGraphics}clearData(){null!==this._roughDataSource&&this._roughDataSource.clearData(),null!==this._detailedDataSource&&this._detailedDataSource.clearData()}restoreData(e){this._invalidateLastNonEmptyPlotRowCache(),this._loadedPlots=this._emptyPlotList(),this._loadedPlots.restoreState(e),void 0!==e.graphics&&(this._loadedGraphics=(0,_.loadStudyGraphics)(e.graphics)),this._postProcessGraphics()}isFailed(){return!this._isPackageAvailable||null!==this._roughDataSource&&this._roughDataSource.studyStatus().type===u.StudyStatusType.Error||null!==this._detailedDataSource&&this._detailedDataSource.studyStatus().type===u.StudyStatusType.Error}isLoading(){return null!==this._roughDataSource&&this._roughDataSource.studyStatus().type===u.StudyStatusType.Loading||null!==this._detailedDataSource&&this._detailedDataSource.studyStatus().type===u.StudyStatusType.Loading}isStarted(){return null!==this._roughDataSource&&this._roughDataSource.isStarted()||null!==this._detailedDataSource&&this._detailedDataSource.isStarted()}sourceId(){throw new Error("Invalid operation")}idForAlert(){return super._collectDepsForAlert().idForAlert}canHaveChildren(){return!1}isChildStudy(){return!1}hasChildren(){return!1}getAllChildren(){return[]}isHibernated(){return!(this.isVisible()||null!==this._roughDataSource&&this._roughDataSource.isStarted()||null!==this._detailedDataSource&&this._detailedDataSource.isStarted())}_alertMetaInfo(){return this._alertsStudyMetaInfo}_stopStudyOnServer(){var e,t;this._chartApi&&this._chartApi.isConnected().value()&&((null===(e=this._roughDataSource)||void 0===e?void 0:e.isStarted())&&this._roughDataSource.stop(),(null===(t=this._detailedDataSource)||void 0===t?void 0:t.isStarted())&&this._detailedDataSource.stop())}async _startAfterSymbolsResolved(e,t){if(!this.isStarted()||this.isRestarting())if(this._restarting=!1,this._isPackageAvailable=L(),this._isPackageAvailable){if(this._allInputsAreValid()){if(this._inputs=this._apiInputs(),null===this._roughDataSource){const e=await(0,C.studyMetaInfoRepository)().findById({type:"java",studyId:x});this._roughDataSource=new c.ExtendedStudyDataSource(this.model().chartApi(),this.model().mainSeries(),"vbpsessionsrough_",e),this._roughDataSource.studyStatusChanged().subscribe(this,this._onStudyStatusChanged),this._roughDataSource.dataCleared().subscribe(this,this._onRoughOrDetailedDataCleared), this._roughDataSource.dataUpdated().subscribe(this,this._onRoughOrDetailedDataUpdated)}else this._roughDataSource.stop();if(this._roughDataSource.setInputs(R(this._roughDataSource.metaInfo().inputs,this._inputs)),null===this._detailedDataSource){const e=await(0,C.studyMetaInfoRepository)().findById({type:"java",studyId:P});this._detailedDataSource=new c.ExtendedStudyDataSource(this.model().chartApi(),this.model().mainSeries(),"vbpsessionsdetailed_",e),this._detailedDataSource.studyStatusChanged().subscribe(this,this._onStudyStatusChanged),this._detailedDataSource.dataCleared().subscribe(this,this._onRoughOrDetailedDataCleared),this._detailedDataSource.dataUpdated().subscribe(this,this._onRoughOrDetailedDataUpdated)}else this._detailedDataSource.stop();this._detailedDataSource.setInputs(k(this._inputs)),this._roughDataSource.start(),this._detailedDataSource.start(),this._createStudyGraphics(),this._subscribeToSessionId(),this._setStatus(this._statusValueFromDataSources()),this._onStart.fire(),null===this._alertsStudyMetaInfo&&(this._alertsStudyMetaInfo=await(0,C.studyMetaInfoRepository)().findById({type:"java",studyId:T}),this._updateAlertCreationAvailable())}}else this._setStatus({type:u.StudyStatusType.Error,errorDescription:{error:D}})}async _changeInputsImpl(e,t){if(null!==this._roughDataSource){if((0,a.areStudyInputsEqual)(this._roughDataSource.metaInfo().inputs,t,e)){if(null!==this._detailedDataSource){const t=k(e),i=(0,a.rangeDependentStudyInputsToTimeRange)(t);if(this._moreDetailedDataRequiredForTimeRange(i)){if(this._detailedDataSource.isActive()){const e=this._detailedDataSource.stopAndStealData();if(e.plots.size()>0||!(0,_.isStudyGraphicsEmpty)(e.graphics)){const t=(0,s.ensureNotNull)(this._detailedDataSource.inputs());e.plots=this._extractEffectiveDetailedPlotValues(e.plots,t),this._detailedDataBuffer.enqueue({lod:E(t),value:e})}}this._detailedDataSource.setInputs(t),this._detailedDataSource.start()}}}else this._inputs=e,this._roughDataSource.setInputs(R(this._roughDataSource.metaInfo().inputs,e)),this._detailedDataBuffer.clear(),null!==this._detailedDataSource&&this._detailedDataSource.setInputs(k(e));null!==this._detailedDataSource&&this._createStudyGraphics()}}_collectDepsForAlert(){const e=super._collectDepsForAlert();if(null===this._alertsStudyMetaInfo)throw new Error("Alerts study metainfo is not ready yet. Have you checked the alert availability using hasStateForAlert()?");return{...e,studyDependencies:e.studyDependencies.map((e=>{const t=e.study===V(this.metaInfo());return{id:e.id,inputs:t?(i=e.inputs,{...i,subscribeRealtime:!0}):e.inputs,study:t&&null!==this._alertsStudyMetaInfo?V(this._alertsStudyMetaInfo):e.study};var i}))}}_statusValueFromDataSources(){const e={type:u.StudyStatusType.Undefined};if(null===this._roughDataSource||null===this._detailedDataSource)return e;const t=this._roughDataSource.studyStatus(),i=this._detailedDataSource.studyStatus();if(t.type===u.StudyStatusType.Error)return t;if(i.type===u.StudyStatusType.Error)return i ;if(t.type===u.StudyStatusType.Loading||i.type===u.StudyStatusType.Loading){const e=t.type===u.StudyStatusType.Loading?t.startTime:1/0,s=i.type===u.StudyStatusType.Loading?i.startTime:1/0;return{type:u.StudyStatusType.Loading,startTime:Math.min(e,s)}}return t.type===u.StudyStatusType.Completed?{type:u.StudyStatusType.Completed}:e}_emptyPlotList(){return new l.PlotList((0,d.studyPlotFunctionMap)(this.metaInfo()),d.studyEmptyPlotValuePredicate)}_createStudyPlots(){const e=(0,s.ensureNotNull)(this._roughDataSource),t=(0,s.ensureNotNull)(this._detailedDataSource);this._mergedPlots.clear();const i=[];i.push({lod:I,value:e.plots()}),this._detailedDataBuffer.forEach((e=>{i.push({lod:e.lod,value:e.value.plots})}));const r=(0,s.ensureNotNull)(t.inputs());i.push({lod:E(r),value:this._extractEffectiveDetailedPlotValues(t.plots(),r)}),i.sort(((e,t)=>t.lod-e.lod));for(const e of i)e.value.each(((e,t)=>{for(const e of t)if(void 0===e)return!1;return this._mergedPlots.add(e,t),!1}));this._invalidateLastNonEmptyPlotRowCache()}_createStudyGraphics(){const e=(0,s.ensureNotNull)(this._roughDataSource),t=(0,s.ensureNotNull)(this._detailedDataSource),i=[];this._detailedDataBuffer.forEach((e=>{i.push({lod:e.lod,value:e.value.graphics})})),void 0!==this._inputs&&i.push({lod:E(this._inputs),value:t.graphics()}),i.sort(((e,t)=>e.lod-t.lod));const r=i.map((e=>e.value));this._mergedGraphics=new S(this.metaInfo().graphics,e.graphics(),r),this._postProcessGraphics()}_extractEffectiveDetailedPlotValues(e,t){const i=(0,a.rangeDependentStudyInputsToTimeRange)(t),r=this.model().timeScale().timePointToIndex(i.from),o=this.model().timeScale().timePointToIndex(i.to);return e.size()>0?e.range(r||(0,s.ensureNotNull)(e.firstIndex()),o||(0,s.ensureNotNull)(e.lastIndex())):this._emptyPlotList()}_moreDetailedDataRequiredForTimeRange(e){const{from:t,to:i}=e;let r=!1;return(0,s.ensureNotNull)(this._roughDataSource).graphics().hhistsByTimePointIndex().forEach(((e,s)=>{if(r)return;const o=this.model().timeScale().indexToTimePoint(s);if(null===o||o{if(e.lod<=l){e.value.graphics.hhistsByTimePointIndex().has(s)&&(n=!0)}})),n||(r=!0)})),r}_onStudyStatusChanged(){const e=this.status();this._setStatus(this._statusValueFromDataSources()),e.type!==this.status().type&&this._updateAlertCreationAvailable(),(0,s.ensureDefined)(this._statusView).update()}_onRoughOrDetailedDataCleared(){null!==this._roughDataSource&&null!==this._detailedDataSource&&(this._invalidateLastNonEmptyPlotRowCache(),this._detailedDataBuffer.clear(),this._createStudyPlots(),this._createStudyGraphics(),this.updateAllViews((0,f.sourceChangeEvent)({sourceId:this.id(),clearData:!0})),this.model().updateSource(this))}_onRoughOrDetailedDataUpdated(e){null!==this._roughDataSource&&null!==this._detailedDataSource&&(e.length>0&&this._createStudyPlots(),this.updateAllViews((0,f.sourceChangeEvent)(this.id())),this.model().updateSource(this))}}function L(){return void 0!==window.pro&&window.pro.hasPackage(w)}function R(e,t){const i={} ;for(const s of e)i[s.id]=t[s.id];return i}function k(e){const t=e.last_visible_bar_time-e.first_visible_bar_time;return{...e,first_visible_bar_time:e.first_visible_bar_time-t,last_visible_bar_time:e.last_visible_bar_time+t}}function E(e){const{from:t,to:i}=(0,a.rangeDependentStudyInputsToTimeRange)(e);return i-t}function V(e){return`${e.id}-${e.version}`}},410491:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SessionVolumeStudy:()=>a,createSessionVolumeStudy:()=>h});var s=i(650151),r=i(339315),o=i(470452),l=i(347710),n=i(153730);class a extends n.VolumeProfileWithPriceRangeStudy{constructor(e,t,i,s,r=!1){super(e,t,i,s),this._chartStyleMode=r}paneViews(e){return this._chartStyleMode?this._paneViews:super.paneViews(e)}priceScale(){return this._chartStyleMode?this._model.mainSeries().priceScale():super.priceScale()}hasStateForAlert(){return!this._chartStyleMode&&super.hasStateForAlert()}}async function h(e){const t=(0,s.ensureDefined)(r.SYMBOL_STRING_DATA[20]),i=await(0,l.studyMetaInfoRepository)().findById({type:"java",studyId:t.type}),n=(0,o.prepareStudyProperties)(i,{},null,(0,l.studyMetaInfoRepository)().studyVersioning(),[]);return new a(e,n,[],i,!0)}},153730:(e,t,i)=>{"use strict";i.d(t,{VbPVisibleWrapper:()=>_,VolumeProfileBaseStudy:()=>c,VolumeProfileWithPriceRangeStudy:()=>d});var s=i(650151),r=i(401580),o=i(291784),l=i(470452);var n=i(229765),a=i(246733);class h extends n.PriceAxisView{constructor(e,t){super(),this._source=e,this._styleId=t}_updateRendererData(e,t,i){var s;e.visible=!1;const r=this._source.priceScale(),o=this._source.properties().childs();if(!r||r.isEmpty()||!o.visible.value())return;const l=null===(s=this._source.properties().childs().graphics.childs().horizlines)||void 0===s?void 0:s.childs()[this._styleId].childs();if(!(l&&l.visible&&l.visible.value()&&this._isLabelVisibleAccordinglyToProperties()))return;const n=this._source.model().timeScale().logicalRange(),h=this._source.firstValue();if(null===h||null===n)return;const u={price:NaN,time:-1/0},c=this._source.graphics().horizlines().get(this._styleId);if(void 0===c)return;for(const e of c){if(void 0===e.level)continue;const t=n.contains(e.startIndex,!0);t===n.contains(e.endIndex,!0)&&0!==t||u.timenew h(this,e)))}_createStudyPlotPaneView(e){return new u.StudyPlotPaneView(this,this._series,this._model,e,this._needExtendToBarsEnding())}_apiInputs(){return{...super._apiInputs(),mapRightBoundaryToBarStartTime:!!this._needExtendToBarsEnding()||void 0}}_needExtendToBarsEnding(){var e;return void 0!==(null===(e=this.metaInfo().defaults.inputs)||void 0===e?void 0:e.mapRightBoundaryToBarStartTime)}}class d extends c{priceRange(e,t,i){if(i.targetPriceScale!==this.priceScale())return null;let r=!1;this.graphics().hhists().forEach(((e,t)=>{var i;r=r||(0,s.ensureDefined)(null===(i=this.properties().childs().graphics.childs().hhists)||void 0===i?void 0:i.childs()[t]).value()}));const l=function(e,t,i,s){let r=null;return e.forEach(((e,s)=>{e.forEach((e=>{e.firstBarTime<=i&&e.lastBarTime>=t&&(null===r?r={low:{l:e.priceLow,h:e.priceHigh},high:{h:e.priceHigh}}:(e.priceLow{"use strict";i.d(t,{VolumeStudy:()=>o});var s=i(470452),r=i(531094);class o extends s.Study{constructor(e,t,i,s){super(e,t,i,s)}base(){return 1}destroy(){super.destroy()}showOnTopOnHovering(){return!1}_titleInParts(e,t,i,s,r,o){const l=super._titleInParts(e,t,i,s,r),n=this._getVolumeUnit();return n&&!o&&(l[0]+=` · ${n}`),l}_skippedTitleInputs(){const e=super._skippedTitleInputs();0===this._getPlotDisplayValue("vol_ma")&&!e.includes("length")&&e.push("length");return e}_getVolumeUnit(){const e=this.symbolSource().symbolInfo();return e?(0,r.getVolumeUnit)({...e,currency:e.original_currency_code||e.currency_code}):void 0}}},943855:(e,t,i)=>{"use strict";i.d(t,{StudyCompare:()=>W});var s=i(650151),r=i(580683),o=i(261066),l=i(470452),n=i(444331),a=i(354950),h=i(919892),u=i(244842),c=i(909598),d=i(229765),_=i(740086),p=i(246733);const v=u.enabled("force_exchange_as_title");class m extends d.PriceAxisView{constructor(e,t){super(),this._studyCompare=e,this._data=t}_updateRendererData(e,t,i){e.visible=!1,t.visible=!1 ;const r=this._studyCompare.priceScale(),o=this._studyCompare.lastValueData(this._data.plotIndex,!1);if(o.noData||null===r||r.isEmpty())return;const l=this._studyCompare.model(),n=l.timeScale().visibleBarsStrictRange(),a=l.mainSeries().bars().lastIndex();if(null===n||null===a)return;if(a<=n.lastBar())i.background=(0,p.resetTransparency)(o.color),i.textColor=this.generateTextColor(i.background),i.borderColor=void 0,e.borderVisible=!1,t.borderVisible=!1;else{const r=l.backgroundColorAtYPercentFromTop(o.coordinate/(0,s.ensureNotNull)(l.paneForSource(this._studyCompare)).height());i.background=r,i.textColor=(0,p.resetTransparency)(o.color),i.borderColor=i.textColor,e.borderVisible=!0,t.borderVisible=!0}i.coordinate=o.coordinate,i.floatCoordinate=o.floatCoordinate;const h=l.properties().childs().scalesProperties.childs();h.showSeriesLastValue.value()&&(e.text=(0,_.getCurrentModePriceText)(r,o),h.seriesLastValueMode.value()!==c.PriceAxisLastValueMode.LastPriceAndPercentageValue?e.secondLine="":e.secondLine=(0,_.getOppositeModePriceText)(r,o),e.visible=!0),t.text="",h.showSymbolLabels.value()&&(t.text=this._paneText(),t.visible=t.text.length>0)}_paneText(){let e="";const t=this._studyCompare.symbolInfo();return v?e=(0,n.displayedSymbolExchange)(t):this._studyCompare.model().properties().childs().scalesProperties.childs().showSymbolLabels.value()&&(e=(0,n.displayedSymbolName)(t)),e}}var y=i(444372),b=i(513114),g=i(103055),S=i(885482),f=i(638456),C=i(616117),w=i(389137),x=i(982217);const P=f.CheckMobile.any();class T extends g.StudyValuesProvider{constructor(e,t){super(e,t),this._emptyValues[0].title=e.guiPlotName(x.TitleDisplayTarget.StatusLine,"")}getValues(e){return(0,w.isNumber)(e)||(this._showLastPriceAndChangeOnly()?e=this._study.data().lastIndex():(e=this._model.crossHairSource().appliedIndex(),(0,w.isNumber)(e)||(e=this._study.data().lastIndex()))),super.getValues(e)}_hideValues(){return!1}_showLastPriceAndChangeOnly(){return P&&(null===this._model.crossHairSource().pane||(0,C.isLineToolName)(S.tool.value())||null!==this._model.lineBeingEdited())}}class I extends b.StudyDataWindowView{constructor(e,t){super(e,t),this._studyCompare=e}_hideValues(){return!1}_createValuesProvider(e,t){return new T(e,t)}}var D=i(177126);class M extends I{constructor(e,t){super(e,t),this._additional=null,this._showSeriesOHLC=t.properties().childs().paneProperties.childs().legendProperties.childs().showSeriesOHLC,this._showSeriesOHLC.subscribe(this,this.update)}areValuesVisible(){return this._showSeriesOHLC.value()}destroy(){this._showSeriesOHLC.unsubscribeAll(this)}additional(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._additional}_updateImpl(){{const e=(0,D.getDataVendorString)(this._studyCompare.symbolInfo());this._additional=e?y.t(null,void 0,i(493345))+" "+e:null}super._updateImpl()}}var L=i(555502),R=i(551775),k=i(509550);class E extends k.StudyStatusProvider{getSplitTitle(){return this._source.titleInParts(x.TitleDisplayTarget.StatusLine,!0,void 0,!1,!1)}text(){ return this._source.isActualInterval()?this._source.isFailed()?`${this._source.title(x.TitleDisplayTarget.StatusLine,!0,void 0,!1,!1)}: ${this.sourceStatusText()}`:`${this._source.title(x.TitleDisplayTarget.StatusLine,!0,void 0,!1,!1)} ${this.sourceStatusText()}`:this._source.title(x.TitleDisplayTarget.StatusLine,!0,void 0,!1,!1)}}var V=i(502141),A=i(25e4),B=i(401580);const N=u.enabled("study_overlay_compare_legend_option"),F=u.enabled("force_exchange_as_title"),O=!u.enabled("hide_study_compare_legend_item"),H=u.enabled("hide_unresolved_symbols_in_legend");class W extends l.Study{constructor(e,t,i,s){super(e,function(e){return e.hasChild("currencyId")||e.addChild("currencyId",new a.Property(null)),e.hasChild("unitId")||e.addChild("unitId",new a.Property(null)),e.addExcludedKey("currencyId",1),e.addExcludedKey("unitId",1),e}(t),i,s),this._isActingAsSymbolSource=new B.WatchedValue(!0),this._realignToolsLastParams=null,this._lastResolvedSymbolSource="",this.properties().childs().minTick.subscribe(null,(()=>this._recreatePriceFormattingDependencies())),this.properties().childs().minTick.subscribe(null,(()=>this._model.fullUpdate())),this.properties().childs().currencyId.subscribe(this,this._onCurrencyChanged),this.properties().childs().unitId.subscribe(this,this._onUnitChanged),this._symbolResolvingActive=new B.WatchedValue(!1),this._symbolHibernated=new B.WatchedValue(!1),e.mainSeries().onIntervalChanged().subscribe(this,(()=>e.realignLineTools(this)))}destroy(){this._model.mainSeries().onIntervalChanged().unsubscribeAll(this),super.destroy()}properties(){return this._properties}isActingAsSymbolSource(){return this._isActingAsSymbolSource.readonly()}symbolParams(){return(0,V.symbolParams)(this)}compareSymbolParams(e){return(0,V.compareSymbolParams)(this,e,this._model.unitConversionEnabled())}setSymbolParams(e){this._setSymbolCurrencyUnitInternal(e)}symbol(){return this.properties().childs().inputs.childs().symbol.value()}symbolChanged(){return this.properties().childs().inputs.childs().symbol.listeners()}setSymbol(e){this.setSymbolParams({symbol:e})}symbolInfo(){if(!this._resolvedSymbols)return null;const e=this.symbol();if(!e)return null;let t;return t=this._model.isSnapshot()?this._resolvedSymbols.___snapshot||null:this._resolvedSymbols[this._getSymbolForResolve(e)]||null,this._model.isSnapshot()&&null===t&&(t=(0,r.getObsoleteIdeaSymbolInfo)(this._resolvedSymbols,e,this.currency()),null!==t&&(this._resolvedSymbols.___snapshot=t)),t}symbolResolved(){return this.symbolsResolved()}symbolResolvingActive(){return this._symbolResolvingActive}symbolHibernated(){return this._symbolHibernated}isVisible(){const e=super.isVisible();return this._symbolHibernated.setValue(!e),e}symbolSameAsCurrent(e){return(0,V.symbolSameAsCurrent)(e,this.symbolInfo())}symbolSameAsResolved(e){return(0,A.symbolSameAsResolved)(e,this._lastResolvedSymbolSource,this.symbol())}currency(){return this.properties().childs().currencyId.value()||null}setCurrency(e){this.setSymbolParams({currency:e})}isConvertedToOtherCurrency(){return(0, n.isConvertedToOtherCurrency)(this.symbolInfo())}unit(){return this.properties().childs().unitId.value()||null}setUnit(e){this.setSymbolParams({unit:e})}isConvertedToOtherUnit(){return(0,n.isConvertedToOtherUnit)(this.symbolInfo(),this._model.unitConversionEnabled())}style(){return 2}setStyle(e){}interval(){return this._model.mainSeries().interval()}setInterval(e){}symbolSource(){return this}valueAt(e,t){var i,s;return null!==(s=null===(i=this.data().search(e))||void 0===i?void 0:i.value[1])&&void 0!==s?s:null}state(e,t){var i;const r=super.state(e,t);this._model.unitConversionEnabled()||delete r.state.unitId;const o=this.symbol();return r.state.inputs.symbol=(0,n.symbolToSaveInState)(null!==(i=this.symbolInfo())&&void 0!==i?i:this._model.chartApi().lastSymbolResolveInfo(o),o),e&&((0,s.ensureDefined)(r.data).symbols={___snapshot:this.symbolInfo()||void 0}),r}symbolTitle(e,t,i){return this.title(e,!0,{},!1,t)}titleInParts(e,t,i,s,r){var o;const l=this._titleInParts(e,t,i,s,r);return[[l[0],...null!==(o=l[1])&&void 0!==o?o:[]].join(", ")]}tags(){const e=this.symbol();return e?[e]:[]}statusView(){return O?super.statusView():null}guiPlotName(e,t){return this.properties().childs().inputs.childs().symbol.value()}canOverrideMinTick(){return!0}canBeHiddenByGlobalFlag(){return!1}legendValuesProvider(){return new T(this,this.model())}statusProvider(e){return new E(this)}measureUnitId(){return(0,n.measureUnitId)(this.symbolInfo())}getSymbolString(e){return void 0===e&&(e=this._getSymbolForApi(this.symbol())),(0,h.encodeExtendedSymbolOrGetSimpleSymbolString)(this._getSymbolObject(e))}_createPriceAxisView(e){return new m(this,{plotIndex:"compare"})}_createViews(){this._legendView||(this._legendView=new M(this,this._model)),this._dataWindowView||(this._dataWindowView=new I(this,this._model)),this._statusView||(this._statusView=new L.StudyStatusView(this)),super._createViews()}_onUnitChanged(){"alwaysOff"!==(0,o.currencyUnitVisibilityProperty)().value()&&this._model.fullUpdate(),this._model.unitConversionEnabled()&&this.isStarted()&&this._tryChangeInputs(),this._unitChanged.fire()}_getSymbolObject(e){const t=super._getSymbolObject(e),i=this.currency();null!==i&&(t["currency-id"]=i);const s=this.unit();return this._model.unitConversionEnabled()&&null!==s&&(t["unit-id"]=s),t}_onSymbolResolvingStart(e,t){this._lastResolvedSymbolSource=t,super._onSymbolResolvingStart(e,t),this._symbolResolvingActive.setValue(!0)}_onSymbolError(){super._onSymbolError(),this._symbolResolvingActive.setValue(!1)}_onSymbolResolved(e,t,i){super._onSymbolResolved(e,t,i),this._recreatePriceFormattingDependencies();const s=t===this.symbol()?(0,n.extractSymbolNameFromSymbolInfo)(i,this.symbol()):null,r=(0,n.symbolCurrency)(i),o=(0,n.symbolUnit)(i,this._model.unitConversionEnabled());this._setSymbolCurrencyUnitInternal({symbol:null!=s?s:void 0,currency:r,unit:o},i),this._symbolResolvingActive.setValue(!1)}async _changeInputsImpl(e,t){await super._changeInputsImpl(e,t),this._realignLineToolsIfParamsChanged()}_createStudyOnServer(){ const e=super._createStudyOnServer();return this._realignLineToolsIfParamsChanged(),e}_tryCreateFormatter(){var e,t;t=null===(e=null===R.customFormatters||void 0===R.customFormatters?void 0:R.customFormatters.priceFormatterFactory)||void 0===e?void 0:e.call(R.customFormatters,this.symbolInfo(),this.properties().childs().minTick.value());return(0,n.createSeriesFormatter)(this.symbolInfo(),this.properties().childs().minTick.value())}_tryCreateDefaultFormatter(){return(0,n.createSeriesFormatter)(this.symbolInfo(),"default")}_titleInParts(e,t,i,s,r){const o=this.symbolInfo();return[this._getSymbolTitlePart(o),[this._getExchangeTitlePart(o,r),this._getPriceSourceTitlePart(o)].filter((e=>null!==e))]}_skipHistogramBaseOnAutoScale(){return!0}_getSymbolTitlePart(e){var t;if(null===e)return H?"":this.properties().childs().inputs.childs().symbol.value();const i=(0,n.getSymbolExchange)(e);if(F&&void 0!==i)return i;if(N)switch(this._model.mainSeries().symbolTextSourceProxyProperty().value()){case"description":return e.description;case"ticker-and-description":return`${e.name}, ${e.description}`;case"long-description":return null!==(t=e.long_description)&&void 0!==t?t:e.description}return e.name}_getExchangeTitlePart(e,t){return null===e||t?null:(0,n.getSymbolExchange)(e)}_getPriceSourceTitlePart(e){return null}_setSymbolCurrencyUnitInternal(e,t){const{symbol:i,currency:s,unit:r}=e,o=this.properties().childs(),l=o.inputs.childs().symbol.value(),a=o.currencyId.value(),h=o.unitId.value();if(void 0!==i&&o.inputs.childs().symbol.setValueSilently(i),void 0!==s&&o.currencyId.setValueSilently(s),void 0!==r&&o.unitId.setValueSilently(r),t)this._resolvedSymbolsByInput[this.symbol()]=t,this._resolvedSymbols[this._getSymbolForResolve(this.symbol())]=t,this._realignToolsLastParams=null;else{const e=this.symbolInfo();null!==e&&(o.currencyId.setValueSilently((0,n.symbolCurrency)(e)),o.unitId.setValueSilently((0,n.symbolUnit)(e,this._model.unitConversionEnabled())))}o.inputs.childs().symbol.value()!==l&&o.inputs.childs().symbol.listeners().fire(o.inputs.childs().symbol,""),o.currencyId.value()!==a&&o.currencyId.listeners().fire(o.currencyId,""),o.unitId.value()!==h&&o.unitId.listeners().fire(o.unitId,""),this._realignLineToolsIfParamsChanged()}_realignLineToolsIfParamsChanged(){let e=null===this._realignToolsLastParams;if(null!==this._realignToolsLastParams){const t=this.compareSymbolParams(this._realignToolsLastParams);e=t.symbolChanged||t.intervalChanged||t.currencyChanged||t.unitChanged}e&&(this._model.realignLineTools(this),this._realignToolsLastParams=this.symbolParams())}}},328484:(e,t,i)=>{"use strict";i.d(t,{StudyOverlayBase:()=>De});var s=i(650151),r=i(580683),o=i(638456),l=i(201089),n=i(470452),a=i(548587),h=i(261066),u=i(544421),c=i(444331),d=i(354950),_=i(919892),p=i(244842),v=i(356747),m=i(502141),y=i(25e4),b=i(276871),g=i(195447),S=i(534741),f=i(389137),C=i(291784),w=i(401580),x=i(551775),P=i(555502),T=i(147664),I=i(229765),D=i(909598),M=i(740086),L=i(246733);const R=p.enabled("force_exchange_as_title") ;class k extends I.PriceAxisView{constructor(e){super(),this._source=e}_updateRendererData(e,t,i){e.visible=!1,t.visible=!1;const r=this._source.lastValueData("close",!1);if(r.noData)return;const o=this._source.model(),l=this._source.priceScale();if(null===l)return;if(!o.isPriceScaleVisible(l))return;const n=o.timeScale().visibleBarsStrictRange(),a=o.mainSeries().bars().lastIndex();if(null===n||null===a)return;if(a<=n.lastBar())i.background=(0,L.resetTransparency)(r.color),i.textColor=this.generateTextColor(r.color),e.borderVisible=!1,t.borderVisible=!1;else{const l=o.backgroundColorAtYPercentFromTop(r.coordinate/(0,s.ensureNotNull)(o.paneForSource(this._source)).height());i.background=l,i.textColor=(0,L.resetTransparency)(r.color),i.borderColor=i.textColor,e.borderVisible=!0,t.borderVisible=!0}i.coordinate=r.coordinate,i.floatCoordinate=r.floatCoordinate;const h=this._source.model().properties().childs().scalesProperties.childs();h.showSeriesLastValue.value()&&(e.text=(0,M.getCurrentModePriceText)(l,r),h.seriesLastValueMode.value()!==D.PriceAxisLastValueMode.LastPriceAndPercentageValue?e.secondLine="":e.secondLine=(0,M.getOppositeModePriceText)(l,r),e.visible=!0),t.text="",h.showSymbolLabels.value()&&(t.text=this._paneText(),t.visible=t.text.length>0)}_paneText(){let e="";const t=this._source.symbolInfo();return R?e=(0,c.displayedSymbolExchange)(t):this._source.model().properties().childs().scalesProperties.childs().showSymbolLabels.value()&&(e=(0,c.displayedSymbolName)(t)),e}}var E=i(506387);class V extends E.PriceLineAxisView{constructor(e){super(),this._study=e}_value(){return this._study.lastValueData("",!0)}_priceLineColor(e){return e}_lineWidth(){return 1}_isVisible(){const e=this._study.model().properties().childs().scalesProperties.childs().showSeriesLastValue.value();return this._study.properties().childs().showPriceLine.value()&&e}}var A=i(458963),B=i(9524);class N{constructor(e){this._lineRenderer=new B.HorizontalLineRenderer,this._visible=!1,this._source=e}update(){if(this._visible=!1,!this._source.properties().childs().showPriceLine.value())return;const e=this._source.lastValueData("",!0);e.noData||(this._visible=!0,this._lineRenderer.setData({y:e.coordinate,color:e.color,linewidth:1,linestyle:A.LINESTYLE_DOTTED,visible:this._visible}))}renderer(){return this._visible?this._lineRenderer:null}}var F=i(782086),O=i(616117),H=i(885482),W=i(982217),z=i(150335),q=i(444372),U=i(31341),$=i(948767),Y=i(748844),G=i(334652),Q=i(711757),j=i(570226),X=i(60897);const Z=G.lastDayChangeAvailable||G.alwaysShowLastPriceAndLastDayChange,K=o.CheckMobile.any(),J=(0,$.getPercentageFormatter)(),ee=X.notAvailable,te=`${ee} (${ee}%)`;class ie{constructor(e,t){this._study=e,this._model=t,this._emptyValues=[{title:q.t(null,void 0,i(539280)),visible:!1,value:"",index:0,id:""},{title:q.t(null,void 0,i(330777)),visible:!1,value:"",index:1,id:""},{title:q.t(null,void 0,i(608136)),visible:!1,value:"",index:2,id:""},{title:q.t(null,void 0,i(931691)),visible:!1,value:"",index:3,id:""},{title:"",visible:!1,value:"",index:4,id:""},{ title:"",visible:!1,value:"",index:5,id:""},{title:q.t(null,void 0,i(349329)),visible:!1,value:"",index:6,id:""},{title:q.t(null,void 0,i(37611)),visible:!1,value:"",index:7,id:""}]}getItems(){return this._emptyValues}getValues(e){var t,i,s,r,o,l;const n=this._emptyValues.map((e=>({...e})));if(this._model.timeScale().isEmpty())return n;const a=this._study.data(),h=a.lastIndex();if(0===a.size()||null===h)return n;const u=a.search(h,S.PlotRowSearchMode.NearestLeft,1);if(null===u)return n;const c=this._showLastPriceAndChangeOnly();if((0,z.isNumber)(e)||(c?e=h:(e=this._model.crossHairSource().appliedIndex(),(0,z.isNumber)(e)||(e=h))),null===e||!(0,z.isNumber)(e))return n;const d=a.search(e,S.PlotRowSearchMode.NearestLeft,1),_=this._model.backgroundTopColor().value();if(null===d)return n;const p=d.index,v=d.value,m=v[1],y=v[2],b=v[3],g=v[4];n[0].value=ee,n[1].value=ee,n[2].value=ee,n[3].value=ee,n[7].value=te,n[6].value=te;for(const e of n)e.visible=!c;const f=n[4];f.visible=!1;const{barChange:C,lastDayChange:w}=(0,Y.changesData)(a,this._study.quotes(),d.value,d.index,u.value),x=(0,j.getPriceValueFormatterForSource)(this._study);if((0,j.shouldBeFormattedAsPercent)(this._study)||(0,j.shouldBeFormattedAsIndexedTo100)(this._study))n[7].value="",n[6].value="";else{const e=this._study.formatter(),o={signPositive:!0};if(void 0!==C){const{currentPrice:s,prevPrice:r,change:l}=C,a=null!==(i=null===(t=e.formatChange)||void 0===t?void 0:t.call(e,s,r,o))&&void 0!==i?i:e.format(l,o);n[6].value=(0,U.forceLTRStr)(`${a} (${J.format(C.percentChange,o)})`)}if(void 0!==w){const{currentPrice:t,prevPrice:i,change:l,percentChange:a}=w,h=null!==(r=null===(s=e.formatChange)||void 0===s?void 0:s.call(e,t,i,o))&&void 0!==r?r:e.format(l,o);n[7].value=(0,U.forceLTRStr)(`${h} (${J.format(a,o)})`)}}let P=null;if(c)n[5].value=null==g?ee:x(g),n[5].visible=!0,P=this._getChangeColor(null==w?void 0:w.change),n[6].visible=void 0!==C,n[7].visible=void 0!==w||Z;else{n[0].value=null==m?ee:x(m),n[1].value=null==y?ee:x(y),n[2].value=null==b?ee:x(b),n[3].value=null==g?ee:x(g),f.value=x(this._study.barFunction()(v)),n[5].visible=!1;const e=this._model.mainSeries().intervalObj().is1Tick();n[0].visible=!e,n[1].visible=!e,n[2].visible=!e,n[7].visible=void 0!==w||Z,n[6].visible=void 0!==C;const t=this._study.barColorer().barStyle(p,!1),i=null!==(o=t.barBorderColor)&&void 0!==o?o:t.barColor;P=(0,Y.calculateColor)(_,i)}P=(0,L.resetTransparency)((0,Y.calculateColor)(_,P));for(const e of n)e.color||(e.color=P);return n[7].visible&&(n[7].color=(0,L.resetTransparency)((0,Y.calculateColor)(_,this._getChangeColor(null===(l=w)||void 0===l?void 0:l.change)))),n}_mobileNonTrackingMode(){return K&&(null===this._model.crossHairSource().pane||(0,O.isLineToolName)(H.tool.value())||null!==this._model.lineBeingEdited())}_showLastPriceAndChangeOnly(){return G.alwaysShowLastPriceAndLastDayChange||this._mobileNonTrackingMode()}_getChangeColor(e){var t;const i=void 0===e||e>=0?Q.SeriesBarColorer.upColor(this._study.properties()):Q.SeriesBarColorer.downColor(this._study.properties()) ;return null!==(t=i.barBorderColor)&&void 0!==t?t:i.barColor}}const se=o.CheckMobile.any();class re extends F.DataWindowView{constructor(e,t){super(),this._invalidated=!0,this._study=e,this._model=t,this._valueProvider=this._createValuesProvider(e,t),this._items=this._valueProvider.getItems().map((e=>new F.DataWindowItem(e.id,e.title,""))),this.update()}items(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items}update(){this._invalidated=!0}study(){return this._study}_updateImpl(){var e,t;this._header=this._study.title(W.TitleDisplayTarget.DataWindow);let i;this._showLastPriceAndChangeOnly()?i=this._study.data().lastIndex():(i=this._model.crossHairSource().appliedIndex(),isNaN(i)&&(i=this._study.data().lastIndex(),p.enabled("use_last_visible_bar_value_in_legend")&&(i=null!==(t=null===(e=this._model.timeScale().visibleBarsStrictRange())||void 0===e?void 0:e.lastBar())&&void 0!==t?t:NaN)));const s=this._valueProvider.getValues(i);for(let e=0;ee||t),i.showBarChange.weakReference(),i.showSeriesOHLC.weakReference()),this._visibilityProperty.subscribe(this,this.update)}areValuesVisible(){return this._visibilityProperty.value()}additional(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._additional}destroy(){this._backgroundColorSpawn.destroy(),this._visibilityProperty.destroy()}_updateImpl(){ super._updateImpl();{const e=(0,ne.getDataVendorString)(this._studyOverlay.symbolInfo());this._additional=e?q.t(null,void 0,i(493345))+" "+e:null}}_createValuesProvider(e,t){return new oe(e,t)}}var he=i(742391),ue=i(825278),ce=i(245242),de=i(936258),_e=i(904891),pe=i(579950),ve=i(255799),me=i(41117),ye=i(72731),be=i(262550),ge=i(707621),Se=i(509550);class fe extends Se.StudyStatusProvider{getSplitTitle(){return this._source.titleInParts(W.TitleDisplayTarget.StatusLine,!0,void 0,!1,!1)}text(){return this._source.isActualInterval()?this._source.isFailed()?`${this._source.title(W.TitleDisplayTarget.StatusLine,!0,void 0,!1,!1)}: ${this.sourceStatusText()}`:`${this._source.title(W.TitleDisplayTarget.StatusLine,!0,void 0,!1,!1)} ${this.sourceStatusText()}`:this._source.title(W.TitleDisplayTarget.StatusLine,!0,void 0,!1,!1)}}const Ce=(o.CheckMobile.any(),!0),we=p.enabled("study_overlay_compare_legend_option"),xe=(p.enabled("secondary_series_extend_time_scale"),p.enabled("hide_unresolved_symbols_in_legend")),Pe=!p.enabled("hide_study_overlay_legend_item"),Te=(0,l.getLogger)("Chart.StudyOverlay");function Ie(e,t){return null==e[t]}class De extends n.Study{constructor(e,t,i,s){super(e,function(e){e.hasChild("currencyId")||e.addChild("currencyId",new d.Property(null)),e.hasChild("unitId")||e.addChild("unitId",new d.Property(null)),(0,ge.allChartStyles)().includes(e.childs().style.value())||e.childs().style.setValueSilently(2);const t=e.childs();if(t.lineStyle.hasChild("styleType")){const e=t.lineStyle.childs(),i=e.styleType.value();let s,r;0===i&&(r=14,s=t.lineWithMarkersStyle.childs()),1===i&&(r=15,s=t.steplineStyle.childs()),s&&(s.color.setValueSilently(e.color.value()),s.linestyle.setValueSilently(e.linestyle.value()),s.linewidth.setValueSilently(e.linewidth.value()),s.priceSource.setValueSilently(e.priceSource.value())),void 0!==r&&2===t.style.value()&&t.style.setValueSilently(r),t.lineStyle.removeProperty("styleType")}return e.addExcludedKey("currencyId",1),e.addExcludedKey("unitId",1),e}(t),i,s),this._seriesSource=null,this._symbolResolvingActive=new w.WatchedValue(!1),this._symbolHibernated=new w.WatchedValue(!1),this._styleToRecover=null,this._isActingAsSymbolSource=new w.WatchedValue(!0),this._realignToolsLastParams=null,this._precomputedBarStyles=new WeakMap,this._lastResolvedSymbolSource="",this._data=new g.PlotList((0,u.seriesPlotFunctionMap)(),Ie),this._quotesProvider=new v.QuotesProvider(void 0,e.collapsed().spawnOwnership()),Ce&&this._quotesProvider.quotesUpdate().subscribe(this,this._onQuotesUpdate);const r=this.properties().childs();r.currencyId.subscribe(this,this._onCurrencyChanged),r.unitId.subscribe(this,this._onUnitChanged),r.allowExtendTimeScale.subscribe(this,this._onAllowExtendTimeScaleChanged),this._onAllowExtendTimeScaleChanged(),this._model.mainSeries().properties().childs().dividendsAdjustment.subscribe(this,(()=>{this._tryChangeInputs()})),r.style.subscribe(this,this._onChartStyleChanged),r.lineStyle.childs().priceSource.subscribe(this,this._updateBarFunction), r.lineWithMarkersStyle.childs().priceSource.subscribe(this,this._updateBarFunction),r.steplineStyle.childs().priceSource.subscribe(this,this._updateBarFunction),r.areaStyle.childs().priceSource.subscribe(this,this._updateBarFunction),r.baselineStyle.childs().priceSource.subscribe(this,this._updateBarFunction),r.columnStyle.childs().priceSource.subscribe(this,this._updateBarFunction),this._updateBarFunction(),r.minTick.subscribe(this,this._onMinTickChanged),this._formatter=null,this._defaultFormatter=null,e.mainSeries().onIntervalChanged().subscribe(this,(()=>e.realignLineTools(this)))}destroy(){this._model.mainSeries().properties().childs().dividendsAdjustment.unsubscribeAll(this),this._model.mainSeries().onIntervalChanged().unsubscribeAll(this),this._quotesProvider.destroy(),super.destroy()}isActingAsSymbolSource(){return this._isActingAsSymbolSource.readonly()}precomputedBarStyle(e){return this._precomputedBarStyles.get(e)}setPrecomputedBarStyle(e,t){this._precomputedBarStyles.set(e,t)}properties(){return this._properties}barColorer(){return new Q.SeriesBarColorer({data:()=>this.data(),bars:()=>this.data(),nsBars:()=>new g.PlotList,priceScale:()=>(0,s.ensureNotNull)(this.priceScale()),properties:()=>this.properties(),firstValue:()=>this.firstValue()})}symbolParams(){return(0,m.symbolParams)(this)}compareSymbolParams(e){return(0,m.compareSymbolParams)(this,e,this._model.unitConversionEnabled())}setSymbolParams(e){this._setSymbolParamsInternal(e)}symbol(){return this.properties().childs().inputs.childs().symbol.value()}symbolChanged(){return this.properties().childs().inputs.childs().symbol.listeners()}setSymbol(e){this.setSymbolParams({symbol:e})}symbolInfo(){if(!this._resolvedSymbols)return null;const e=this._properties.childs().inputs.childs().symbol.value();if(!e)return null;let t;return t=this._model.isSnapshot()?this._resolvedSymbols.___snapshot||null:this._resolvedSymbols[this._getSymbolForResolve(e)]||null,this._model.isSnapshot()&&null===t&&(t=(0,r.getObsoleteIdeaSymbolInfo)(this._resolvedSymbols,e,this.currency()),null!==t&&(this._resolvedSymbols.___snapshot=t)),t}supportsPressedChunks(){return!1}pressedChunks(e,t){throw new Error("Pressed chunks are not supported")}data(){return null===this._seriesSource?super.data():this._seriesSource.data().bars()}symbolResolved(){return this.symbolsResolved()}symbolResolvingActive(){return this._symbolResolvingActive}symbolHibernated(){return this._symbolHibernated}isVisible(){const e=super.isVisible();return this._symbolHibernated.setValue(!e),e}symbolSameAsCurrent(e){return(0,m.symbolSameAsCurrent)(e,this.symbolInfo())}symbolSameAsResolved(e){return(0,y.symbolSameAsResolved)(e,this._lastResolvedSymbolSource,this.symbol())}priceSource(){const e=this.properties().childs();switch(e.style.value()){case 2:return e.lineStyle.childs().priceSource.value();case 14:return e.lineWithMarkersStyle.childs().priceSource.value();case 15:return e.steplineStyle.childs().priceSource.value();case 3:return e.areaStyle.childs().priceSource.value();case 10: return e.baselineStyle.childs().priceSource.value();case 13:return e.columnStyle.childs().priceSource.value()}return null}barFunction(){return this._barFunction}quotesProvider(){return this._quotesProvider}quotes(){return this._quotesProvider.quotes()}currency(){return this.properties().childs().currencyId.value()||null}setCurrency(e){this.setSymbolParams({currency:e})}isConvertedToOtherCurrency(){return(0,c.isConvertedToOtherCurrency)(this.symbolInfo())}unit(){return this.properties().childs().unitId.value()||null}setUnit(e){this.setSymbolParams({unit:e})}isConvertedToOtherUnit(){return(0,c.isConvertedToOtherUnit)(this.symbolInfo(),this._model.unitConversionEnabled())}style(){return this.properties().childs().style.value()}setStyle(e){this.setSymbolParams({style:e})}interval(){return this._model.mainSeries().interval()}setInterval(e){}valueAt(e,t){var i,s;return null!==(s=null===(i=this.data().search(e))||void 0===i?void 0:i.value[t])&&void 0!==s?s:null}symbolSource(){return this}barsProvider(){return this}state(e,t){var i;const r=super.state(e,t);this._model.unitConversionEnabled()||delete r.state.unitId;const o=this.symbol();return r.state.inputs.symbol=(0,c.symbolToSaveInState)(null!==(i=this.symbolInfo())&&void 0!==i?i:this._model.chartApi().lastSymbolResolveInfo(o),o),e&&((0,s.ensureDefined)(r.data).symbols={___snapshot:this.symbolInfo()||void 0}),r}symbolTitle(e,t,i){return this.title(e,!0,{},!1,t)}title(e,t,i,s,r){var o;const l=this._titleInParts(e,t,i,s,r);return[l[0],...null!==(o=l[1])&&void 0!==o?o:[]].join(` ${c.symbolTitleSeparator} `)}titleInParts(e,t,i,s,r){return[this.title(e,t,i,s,r)]}isStarted(){return null===this._seriesSource?super.isStarted():this._seriesSource.isStarted()}sourceId(){return null===this._seriesSource?super.sourceId():(0,s.ensureNotNull)(this._seriesSource.instanceId())}moveData(e){null===this._seriesSource?super.moveData(e):this._seriesSource.moveData(e)}firstValue(){const e=this._model.timeScale().visibleBarsStrictRange();if(null===e)return null;const t=e.firstBar();if(0===this.data().size())return this._ownFirstValue;const i=this.data().search(t,S.PlotRowSearchMode.NearestRight,1);return this._ownFirstValue=null!==i?this._barFunction(i.value,0):null,this._ownFirstValue}lastValueData(e,t,i){const s={noData:!0},r=this.priceScale();if(this._model.timeScale().isEmpty()||null===r||r.isEmpty()||this.data().isEmpty())return s;const o=this._model.timeScale().visibleBarsStrictRange();if(null===o)return s;const l=this.properties().childs();if(!l.visible.value())return s;const n=this.nearestIndex(o.lastBar(),S.PlotRowSearchMode.NearestLeft,1);if(void 0===n)return s;const a=this.firstValue();if(null===a)return s;const h=this._lastNonEmptyPlotRow(4),u=null!==h&&o.contains(h.index),c=null!==h?h.value:null,d=t||u?c:this.data().valueAt(n);if(null===d)return s;const _=this._barFunction(d,2);if(!(0,f.isNumber)(_))return s;const p=r.priceToCoordinate(_,a);let v;switch(l.style.value()){case 0:v=d[1]<=d[4]?l.barStyle.childs().upColor.value():l.barStyle.childs().downColor.value();break;case 1: v=d[1]<=d[4]?l.candleStyle.childs().upColor.value():l.candleStyle.childs().downColor.value();break;case 9:v=d[1]<=d[4]?l.hollowCandleStyle.childs().upColor.value():l.hollowCandleStyle.childs().downColor.value();break;case 13:v=d[1]<=d[4]?l.columnStyle.childs().upColor.value():l.columnStyle.childs().downColor.value();break;case 2:v=l.lineStyle.childs().color.value();break;case 14:v=l.lineWithMarkersStyle.childs().color.value();break;case 15:v=l.steplineStyle.childs().color.value();break;case 3:v=l.areaStyle.childs().linecolor.value();break;case 16:v=l.hlcAreaStyle.childs().closeLineColor.value();break;case 10:{const e=l.baselineStyle.childs();v=p(0,s.ensureNotNull)(this.priceScale()).height(),color:()=>e.baselineColor.value(),baseLevelPercentage:()=>e.baseLevelPercentage.value()});break}case 12:r=new be.SeriesHiLoPaneView(this,this._model)}r&&this._paneViews.push(r),null!==i&&this._paneViews.push(i),this._paneViews.push(new N(this)),this._dataWindowView||(this._dataWindowView=new re(this,this._model)),this._legendView||(this._legendView=new ae(this,this._model)),this._statusView||(this._statusView=new P.StudyStatusView(this)),this._priceAxisViews=[...this._priceAxisViewsBase],this._labelPaneViews.push(new he.PanePriceAxisView(e,this,this._model))}_createStudyOnServer(){let e;return null===this._seriesSource?e=super._createStudyOnServer():(this._modifyStudyOnServer((0,s.ensureDefined)(this._inputs)),e=!0),this._realignLineToolsIfParamsChanged(),e}_modifyStudyOnServer(e){null===this._seriesSource?super._modifyStudyOnServer(e,0):(this._seriesSource.modifySeries((0,_.decodeExtendedSymbol)(e.symbol),(0,b.getServerInterval)(this._series.properties().childs().interval.value())),this._seriesSource.isStarted()||this._seriesSource.start())}_stopStudyOnServer(){null===this._seriesSource?super._stopStudyOnServer():this._seriesSource.stop()}_titleInParts(e,t,i,s,r){const o=this.symbolInfo();return[this._getSymbolTitlePart(o),[this._getExchangeTitlePart(o,r),this._getPriceSourceTitlePart(o)].filter((e=>null!==e))]}_getSymbolTitlePart(e){var t;if(null===e)return xe?"":this.properties().childs().inputs.childs().symbol.value();if(we)switch(this._model.mainSeries().symbolTextSourceProxyProperty().value()){case"description":return e.description;case"ticker-and-description":return`${e.name}, ${e.description}`;case"long-description":return null!==(t=e.long_description)&&void 0!==t?t:e.description}return e.name}_getExchangeTitlePart(e,t){return null===e||t?null:(0,c.getSymbolExchange)(e)}_getPriceSourceTitlePart(e){return null}_onAllowExtendTimeScaleChanged(){}_setSymbolParamsInternal(e,t){const{symbol:i,currency:s,unit:r,style:o}=e,l=this.properties().childs(),n=l.inputs.childs().symbol.value(),a=l.currencyId.value(),h=l.unitId.value(),u=l.style.value();if(void 0!==i&&l.inputs.childs().symbol.setValueSilently(i),void 0!==s&&l.currencyId.setValueSilently(s),void 0!==r&&l.unitId.setValueSilently(r),void 0!==o&&l.style.setValueSilently(o),t)this._resolvedSymbolsByInput[this.symbol()]=t,this._resolvedSymbols[this._getSymbolForResolve(this.symbol())]=t,this._realignToolsLastParams=null;else{const e=this.symbolInfo();null!==e&&(l.currencyId.setValueSilently((0,c.symbolCurrency)(e)),l.unitId.setValueSilently((0,c.symbolUnit)(e,this._model.unitConversionEnabled())))} l.inputs.childs().symbol.value()!==n&&l.inputs.childs().symbol.listeners().fire(l.inputs.childs().symbol,""),l.currencyId.value()!==a&&l.currencyId.listeners().fire(l.currencyId,""),l.unitId.value()!==h&&l.unitId.listeners().fire(l.unitId,""),l.style.value()!==u&&l.style.listeners().fire(l.style,""),this._checkStyle(),this._realignLineToolsIfParamsChanged()}_updateBarFunction(){this._barFunction=(0,a.barFunctionByStyle)(this.style(),this.priceSource())}_onMinTickChanged(){this._recreatePriceFormattingDependencies(),this.updateAllViews({type:"global-change"}),this._model.fullUpdate()}_onChartStyleChanged(){var e;this._updateBarFunction(),(null===(e=this._styleToRecover)||void 0===e?void 0:e.originalStyle)!==this.style()&&(this._styleToRecover=null)}_checkStyle(){const e=this.style();(0,c.isCloseBasedSymbol)(this.symbolInfo())?(0,c.isSingleValueBasedStyle)(e)||(this.setStyle(2),this._styleToRecover={correctedStyle:this.style(),originalStyle:e}):null!==this._styleToRecover&&(this.setStyle(this._styleToRecover.originalStyle),this._styleToRecover=null)}_realignLineToolsIfParamsChanged(){let e=null===this._realignToolsLastParams;if(null!==this._realignToolsLastParams){const t=this.compareSymbolParams(this._realignToolsLastParams);e=t.symbolChanged||t.intervalChanged||t.currencyChanged||t.unitChanged}e&&(this._model.realignLineTools(this),this._realignToolsLastParams=this.symbolParams())}}},980004:(e,t,i)=>{"use strict";i.d(t,{StudyStrategy:()=>V});var s=i(316230),r=i(650151),o=i(401580),l=i(470452),n=i(195294),a=i(86441),h=i(724377),u=i(315801),c=i(510147),d=i(199471),_=i(678515);function p(e,t,i){return i?Math.sign(e)*(Math.round(Math.abs(e))+t):Math.round(e)+t}class v{constructor(e,t){this._data=e,this._textWidths=t}draw(e,t){const{horizontalPixelRatio:i,verticalPixelRatio:s}=t;void 0!==this._textWidths.renderingInfo&&(0,c.equalRenderingInfos)(this._textWidths.renderingInfo,t)||(this._textWidths.renderingInfo=t,this._textWidths.width.clear());const r=this._data;e.lineJoin="miter",e.miterLimit=Math.round(2*i),e.strokeStyle=r.bgColor,e.lineWidth=Math.max(2,(0,_.ceiledEven)(2*i));for(const i of r.items){e.beginPath();const o="lower"===i.pos;e.save();const l=Math.round(r.orderArrow.vMargin*s);e.translate(0,o?l:-l),this._drawOrderArrow(e,i.orderPoint,r.orderArrow,r.exitLineWidth,o,t),e.restore(),e.save(),this._drawPriceArrow(e,i.pricePoint,r.priceArrow,!o,t),e.restore(),e.closePath(),e.stroke(),e.fillStyle=r.exitLineWidth?r.exitColor:"buy"===i.type?r.buyColor:r.sellColor,e.fill()}const o=r.text;o.visible&&(0,d.drawScaled)(e,i,s,(()=>{e.font=o.fontSize+"px "+o.font,e.textAlign="center",e.textBaseline="top",e.fillStyle=r.labelColor,e.strokeStyle=r.bgColor,e.lineWidth=Math.min(2,Math.floor(2*i));for(const t of r.items){const i="lower"===t.pos;e.save();const s=i?1:-1,l=r.orderArrow;e.translate(0,(l.height+l.vMargin+r.exitLineWidth)*s);const n=i?o.vMargin:-o.fontSize-o.vMargin,a=s*(o.fontSize+o.lineSpacing);if(t.label&&(e.translate(0,n),e.strokeText(t.label,Math.ceil(t.orderPoint.x),t.orderPoint.y), e.fillText(t.label,Math.ceil(t.orderPoint.x),t.orderPoint.y),this._textWidths.width.has(t.label)||this._textWidths.width.set(t.label,e.measureText(t.label).width)),t.qty){const i=Boolean(t.label)?a:n;e.translate(0,i),e.strokeText(t.qty,Math.ceil(t.orderPoint.x),t.orderPoint.y),e.fillText(t.qty,Math.ceil(t.orderPoint.x),t.orderPoint.y),this._textWidths.width.has(t.qty)||this._textWidths.width.set(t.qty,e.measureText(t.qty).width)}e.restore()}}))}hitTest(e){const t=this._testOrderArrows(e),i=!t&&this._data.text&&this._testText(e);return t||i?new u.HitTestResult(u.HitTarget.Regular):null}_drawOrderArrow(e,t,i,s,r,o){let l,n;r?(e.rotate(Math.PI),l=-t.x,n=-t.y):(l=t.x,n=t.y),n-=i.height+s;const{horizontalPixelRatio:a,verticalPixelRatio:h}=o,u=Math.max(1,Math.floor(a)),c=u%2?.5:0,d=r?"floor":"ceil";l=p(l*a,c,r),n=Math.round((Math[d](n)+.5)*h),e.translate(l,n);const v=(0,_.ceiledEven)(i.width*a)/2+c,m=(0,_.ceiledEven)(i.tailWidth*a)/2+c,y=Math.round(i.tailHeight*h);if(e.moveTo(-m,0),e.lineTo(m,0),e.lineTo(m,y),e.lineTo(v,y),e.lineTo(0,Math.round(i.height*h)),s){const t=Math.floor(u/2);e.lineTo(v+t,Math.round(i.height*h)),e.lineTo(v+t,Math.round((i.height+s)*h)),e.lineTo(-v-t,Math.round((i.height+s)*h)),e.lineTo(-v-t,Math.round(i.height*h)),e.lineTo(0,Math.round(i.height*h))}e.lineTo(-v,y),e.lineTo(-m,y),e.lineTo(-m,0),e.lineTo(m,0)}_drawPriceArrow(e,t,i,s,r){let o,l;s?(e.rotate(Math.PI),o=-t.x,l=-t.y):(o=t.x,l=t.y);const{horizontalPixelRatio:n,verticalPixelRatio:a}=r,h=Math.max(1,Math.floor(n)),u=h%2?.5:0;o=p(o*n,u,s)-h,l=p(l*a,u,s);const c=(0,_.ceiledEven)(2*i.width*a)/2,d=-(Math.round(i.width*n)+u);e.translate(o,l),e.moveTo(0,0),e.lineTo(d,-c),e.lineTo(d,c),e.lineTo(0,0),e.lineTo(d,-c)}_testOrderArrows(e){const t=this._data,i=t.orderArrow.width/2;for(const s of t.items){const r=s.orderPoint;if(e.xr.x+i)continue;const o="lower"===s.pos;let l=t.orderArrow.height+t.exitLineWidth;o||(l=-l);const n=r.y+(o?t.orderArrow.vMargin:-t.orderArrow.vMargin),a=Math.min(n,n+l),h=Math.max(n,n+l);if(!(e.yh))return!0}return!1}_testText(e){const t=this._data,i=t.text;if(!i.visible)return!1;for(const s of t.items){const r=s.orderPoint,o="lower"===s.pos;let l=t.orderArrow.vMargin+t.orderArrow.height+t.exitLineWidth;o||(l=-l);const n=r.y+l,a=(s.label?1:0)+(s.qty?1:0);let h=i.vMargin+i.fontSize*a+i.lineSpacing*Math.max(0,a-1);o||(h=-h);const u=Math.min(n,n+h),c=Math.max(n,n+h);if(e.yc)continue;const d=s.label&&s.qty?o&&e.yn-i.fontSize?s.label:s.qty:s.label||s.qty,_=this._textWidths.width.get(d);if(!(void 0===_||e.xr.x+_/2))return!0}return!1}}var m=i(422333),y=i(534741),b=i(142119);const g={BuyColor:(0,n.getHexColorByName)("color-tv-blue-500"),SellColor:"#FF1744",ExitColor:"#D500F9",LabelDarkColor:"#B2B5BE",LabelLightColor:(0,n.getHexColorByName)("color-cold-gray-900")};function S(e){return!1===e.e?"exit":e.b?"entryBuy":"entrySell"}function f(e){return e.b?"buy":"sell"}function C(e,t){return t?!e.b:e.b}function w(e,t){return C(e,t)?"lower":"upper"}function x(e,t,i){let s=e[t].get(i) ;return void 0===s&&(s=0,e[t].set(i,s)),s}function P(e,t,i,s){const o=(0,r.ensureDefined)(e[t].get(i));e[t].set(i,o+s)}function T(e,t){return t&&(e.c||e.id||"Untitled")||""}function I(e,t){return t&&(e.b?"+":"-")+e.q||""}function D(e,t,i){return(0,r.ensureNotNull)(e.b?i.valueAt(t,3):i.valueAt(t,2))}function M(e,t){return("exit"===S(e)?2:0)+t.vMargin+t.height}class L{constructor(e,t,i){this._invalidated=!0,this._textWidths={width:new Map},this._study=e,this._series=t,this._model=i,this._orderArrow={vMargin:11,width:10,height:15,tailWidth:2,tailHeight:10},this._priceArrow={width:5},this._text={vMargin:7,font:m.CHART_FONT_FAMILY,fontSize:12,lineSpacing:2,visible:!0},this._items={entryBuy:[],entrySell:[],exit:[]},this._study.properties().childs().strategy.childs().orders.subscribe(this,this.update)}update(){this._invalidated=!0}clearItems(){this._items.entryBuy=[],this._items.entrySell=[],this._items.exit=[]}renderer(){const e=this._study.properties().childs();if(!e.visible.value()||!e.strategy.childs().orders.childs().visible.value())return null;if(this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items.entryBuy.length||this._items.entrySell.length||this._items.exit.length){const e=new b.CompositeRenderer;return this._items.entryBuy.length&&e.append(this._strategyOrdersRenderer(this._items.entryBuy,!1)),this._items.entrySell.length&&e.append(this._strategyOrdersRenderer(this._items.entrySell,!1)),this._items.exit.length&&e.append(this._strategyOrdersRenderer(this._items.exit,!0)),e}return null}_strategyOrdersRenderer(e,t){const i=this._model.backgroundColor().value(),s="black"===(0,h.rgbToBlackWhiteString)((0,h.parseRgb)(i),150);return new v({items:e,buyColor:g.BuyColor,sellColor:g.SellColor,exitColor:g.ExitColor,labelColor:s?g.LabelDarkColor:g.LabelLightColor,bgColor:i,orderArrow:this._orderArrow,exitLineWidth:t?2:0,priceArrow:this._priceArrow,text:this._text},this._textWidths)}_updateImpl(){this.clearItems();const e=this._study.ordersData();if(!e||!e.length)return;const t=this._model.timeScale(),i=this._series.priceScale(),s=t.visibleBarsStrictRange();if(t.isEmpty()||i.isEmpty()||null===s)return;const o=this._study.barsIndexes(),l=this._series.nearestIndex(s.firstBar(),y.PlotRowSearchMode.NearestRight),n=this._series.nearestIndex(s.lastBar(),y.PlotRowSearchMode.NearestLeft);if(void 0===l||void 0===n)return;const[h,u]=function(e,t,i,s){const r=[],o=[];for(let l=0;li||(r.push(e[l]),o.push(n))}return[r,o]}(e,l,n,o),[c,d]=this._labelAndQtyVisibility(h.length),_=c||d,p=this._textHeight(c,d),v=(0,r.ensureNotNull)(this._series.firstValue()),m=i.isInverted(),b={upper:new Map,lower:new Map};for(let e=0;et.width())return[!1,!1];const i=this._study.properties().childs().strategy.childs().orders.childs();return[i.showLabels.value(),i.showQty.value()]}_textHeight(e,t){return e||t?e&&t?2*this._text.fontSize+this._text.vMargin+this._text.lineSpacing:this._text.fontSize+this._text.vMargin:0}}var R=i(811630),k=i(707957);const E=["strategy_props"];class V extends l.Study{constructor(e,t,i,s,r,l){super(e,t,i,s),this.watchedData=new o.WatchedValue,this._reportData=null,this._reportChanged=new k.Delegate,this._barsIndexes=[],this._srcBarsIndexes=[],this._reportDataBuffer=null,this._activeState=!1,l||(t.childs().visible.subscribe(this,(()=>{this._processChangeVisibility()})),this._processChangeVisibility(r))}destroy(){this._properties.childs().visible.unsubscribeAll(this),this.model().removeStrategySource(this,0),super.destroy()}properties(){return this._properties}hasStateForAlert(){return R.alertsAvailable&&this._series.alertCreationAvailable().value()}canHasAlertOnLineTools(){return!1}inputsForAlertState(){const e=this.inputs();return(0,r.ensureNotNull)(this._metaInfo).inputs.forEach((t=>{const i=e[t.id];i&&t.internalID&&(i.internalID=t.internalID)})),e}reportData(){return this._reportData}ordersData(){var e,t;return null!==(t=null===(e=this._reportData)||void 0===e?void 0:e.filledOrders)&&void 0!==t?t:null}barsIndexes(){return this._barsIndexes}clearData(){super.clearData(),this._reportDataBuffer=null,this._reportData=null,this._strategyOrdersPaneView&&this._strategyOrdersPaneView.clearItems(),this._reportChanged.fire({activeOrdersChanged:!0,filledOrdersChanged:!0,positionChanged:!0})}reportChanged(){return this._reportChanged}strategyOrdersPaneView(){return this.isSourceHidden()?null:this._strategyOrdersPaneView}restoreData(e){super.restoreData(e);const t=e;this.model().addStrategySource(this,0),t.reportData&&t.barsIndexes&&(this._reportData=t.reportData,this._barsIndexes=t.barsIndexes,this.watchedData.setValue({method:"data_update",nonSeriesData:{indexes_replace:!1,data:{report:this._reportData}}})),t.activeState&&(this._activeState=!0)}activeState(){return this._activeState}updateAllViews(e){super.updateAllViews(e),this._strategyOrdersPaneView&&this._strategyOrdersPaneView.update()}state(e,t){const i=super.state(e,t);return e&&this._reportData&&this._barsIndexes&&(i.data||(i.data={}),i.data.reportData=this._reportData,i.data.barsIndexes=this._barsIndexes,i.data.activeState=this.model().activeStrategySource().value()===this),i}isHibernationAllowed(){return!1}_onData(e){e.method&&"data_update"!==e.method&&this.watchedData.setValue({method:e.method}),super._onData(e)}_onDataUpdated(e,t,i,o){var l,n,a,h,u,c;let d=t&&!t.indexes_replace&&t.data&&t.data.report;if(d){const e=!(0,s.default)(d.activeOrders,null===(l=this._reportData)||void 0===l?void 0:l.activeOrders),i=!(0,s.default)(d.filledOrders,null===(n=this._reportData)||void 0===n?void 0:n.filledOrders),o=!(0, s.default)(d.position,null===(a=this._reportData)||void 0===a?void 0:a.position);t&&!t.indexes_replace&&t.isUpdate&&this._reportDataBuffer&&(d={...this._reportDataBuffer,...d}),this._reportData={...this._reportDataBuffer,...d},this._reportDataBuffer=this._reportData,this.watchedData.setValue({method:"data_update",nonSeriesData:(0,r.ensureNotNull)(t)}),this._reportChanged.fire({activeOrdersChanged:e,filledOrdersChanged:i,positionChanged:o})}else this.watchedData.setValue({method:"data_update",nonSeriesData:{indexes_replace:!1,data:{report:this._reportDataBuffer}}});const _=!(!t||!t.indexes_replace);("nochange"!==i&&i.length>0||(null!==(c=null===(u=null===(h=this._reportData)||void 0===h?void 0:h.filledOrders)||void 0===u?void 0:u.length)&&void 0!==c?c:0)!==this._barsIndexes.length)&&(d||_)&&this._collateBarsIndexes(Array.isArray(i)?i:this._srcBarsIndexes),super._onDataUpdated(e,t,i,o)}_createViews(){super._createViews(),this._strategyOrdersPaneView=new L(this,this._series,this._model)}_titleInputs(e,t,i){return this.inputs({symbolsForDisplay:!0,skipHiddenInputs:!0,skipFakeInputs:!1,fakeInputsForDisplay:!0,asObject:!0,skippedGroups:E,noExchanges:t,displayMask:e})}_getTelemetryObjectName(){return"strategy"}_collateBarsIndexes(e){var t;this._srcBarsIndexes=e;const i=null===(t=this._reportData)||void 0===t?void 0:t.filledOrders;if(i&&i.length){this._barsIndexes.length=0;for(let t=0;t{"use strict";var s=i(650151).ensureNotNull,r=i(86441).Point,o=i(535698).TextRenderer,l=i(772466).NonSeriesStudy,n=i(541801).TrendLineRenderer,a=i(315801).HitTestResult,h=i(315801).HitTarget,u=i(142119).CompositeRenderer,c=i(246733),d=i(855152).LineEnd,_=i(422333).CHART_FONT_FAMILY;const{LINESTYLE_SOLID:p,LINESTYLE_DASHED:v}=i(458963);class m{constructor(e,t){this._model=e,this._source=t,this._waves=[],this._highlights=[],this._retracements=[],this._invalidated=!0,this._wavesTextRenderers=[],this._retracementsTextRenderers=[]}update(){this._invalidated=!0}updateImpl(){if(this._waves=[],this._highlights=[],this._retracements=[],this._source.customData()&&this._source.properties().visible.value()){var e=this._source.customData().waves,t=this._source._indexes,i=this._model.timeScale(),l=this._source.priceScale(),n=this._model.mainSeries(),a=n.firstBar();if(l&&!l.isEmpty()&&!i.isEmpty()&&a&&e){for(var h=i.visibleBarsStrictRange(),u=h.lastBar(),c=h.firstBar(),d=["m0StartIndex","startIndex","endIndex","m2EndIndex","m3EndIndex"],_=n.firstValue(),y=0;yu||b[b.length-1]this._waves.length;)this._wavesTextRenderers.pop();if(this._source===this._model.hoveredSource())if(D=this._model.lastHittestData()){b=D.wave.inds,x=-D.wave.dir;var L=D.backgroundColor?D.backgroundColor:D.color,R=D.wave.orig_prices,k=null;for(T=0;Tthis._retracements.length;)this._retracementsTextRenderers.pop()}}}renderer(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);for(var e=new u,t=this.CIRCLE_SIZE,i={},s=0;s{"use strict";var s=i(328484).StudyOverlayBase;t.study_Overlay=class extends s{async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(36914),i.e(9408),i.e(78555),i.e(30154),i.e(82375),i.e(47924),i.e(60607)]).then(i.bind(i,811173))).StudyOverlayDefinitionsViewModel}}},894718:(e,t,i)=>{"use strict";var s=i(772466).NonSeriesStudy,r=i(315801).HitTestResult,o=i(315801).HitTarget,l=i(142119).CompositeRenderer,n=i(710455).MediaCoordinatesPaneRenderer,a=i(422333);class h extends n{constructor(e,t){super(),this._data=e,this._textCache=t}_drawImpl(e){var t=e.context;t.textBaseline="bottom",t.font=(this._data.bold?"bold ":"normal ")+this._data.fontsize+"px "+this._data.font;var i=Math.round(t.measureText(this._data.text).width+4);this._textCache.width=i,t.translate(this._data.x+.5,this._data.y),t.strokeStyle=this._data.borderColor,t.fillStyle=this._data.backColor,t.beginPath(),t.moveTo(0,0),1===this._data.type?(t.lineTo(5,-5),t.lineTo(i/2,-5),t.lineTo(i/2,-5-this._data.fontsize),t.lineTo(-i/2,-5-this._data.fontsize),t.lineTo(-i/2,-5),t.lineTo(-5,-5),t.lineTo(0,0)):(t.lineTo(5,5),t.lineTo(i/2,5),t.lineTo(i/2,5+this._data.fontsize),t.lineTo(-i/2,5+this._data.fontsize),t.lineTo(-i/2,5),t.lineTo(-5,5),t.lineTo(0,0)),t.fill(),t.stroke(),t.fillStyle=this._data.textColor,t.textAlign="center",t.textBaseline="middle", 1===this._data.type?t.fillText(this._data.text,0,-5-this._data.fontsize/2):t.fillText(this._data.text,0,5+this._data.fontsize/2)}hitTest(e){var t=this._textCache.width,i=this._data.fontsize+15,s=this._data.x-t/2,l=this._data.y;return 1===this._data.type&&(l-=i),e.x>=s&&e.x<=s+t&&e.y>=l&&e.y<=l+i?new r(o.Regular):null}}class u{constructor(e,t){this._model=e,this._source=t,this._pivots=[],this._textCache={},this._invalidated=!0}update(){this._invalidated=!0}updateImpl(){if(this._pivots=[],this._source.customData()&&this._source.customData().pivots&&this._source.properties().visible.value()){var e=this._source.customData().pivots,t=this._source._indexes,i=this._model.timeScale(),s=this._source.priceScale(),r=this._model.mainSeries(),o=r.firstValue();if(s&&!s.isEmpty()&&!i.isEmpty()&&o)for(var l=i.visibleBarsStrictRange(),n=l.firstBar(),a=l.lastBar(),h=0;ha)){var c=e[h].type,d=r.bars().valueAt(u);if(null!==d){var _=1===c?d[TradingView.HIGH_PLOT]:d[TradingView.LOW_PLOT],p=Math.round(i.indexToCoordinate(u)),v=s.priceToCoordinate(_,o);1===c?v-=i.barSpacing()/6:v+=i.barSpacing()/6+1,v=Math.round(v),this._pivots.push({x:p,y:v,price:s.formatPrice(_,o),type:c})}}}}}_pixelMargins(){return this._source.properties().fontsize.value()+15}topPixelMargin(){return this._pixelMargins()}bottomPixelMargin(){return this._pixelMargins()}renderer(){if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),0!==this._pivots.length){for(var e=a.CHART_FONT_FAMILY,t=this._source.properties().fontsize.value(),i=this._source.properties().borderColor.value(),s=this._source.properties().backColor.value(),r=this._source.properties().textColor.value(),o=new l,n=0;n0?this._paneViews[0].topPixelMargin():0,bottomPixelMargin:this._paneViews.length>0?this._paneViews[0].bottomPixelMargin():0}}}},738949:(e,t,i)=>{"use strict";var s=i(650151).assert,r=i(389137).clone,o=i(470452).Study,l=i(195447).PlotList,n=i(989709).studyPlotFunctionMap,a=i(989709).studyEmptyPlotValuePredicate;class h{constructor(e,t,i){this._strategyPlotIndex=e,this._targetPlotIndex=t,this._startIndex=i}rebuildData(e){var t=this._targetPlotIndex+1,i=this._strategyPlotIndex+1,s=null,r=null;e.range(this._startIndex||e.firstIndex(),e.lastIndex()).each((function(o,l){var n=l[t],a=l[i]?Math.round(l[i]):null;if(l[t]=null,l[i]=null,!a||a>0)return!1;var h=o+a,u={pointIndex:h,value:n};if(r){if(r.pointIndex!==u.pointIndex){h>=0&&(e.valueAt(h)[t]=n);var c=!1 ;s&&(c=s.value<=r.value&&r.value<=n||s.value>=r.value&&r.value>=n),c?r.pointIndex>=0&&(e.valueAt(r.pointIndex)[t]=null):s=r,r=u}}else r=u;return!1}))}}t.study_ScriptWithDataOffset=class extends o{constructor(e,t,i,s){super(e,t,i,s),this._underlyingData=new l(n(s),a)}clearData(){super.clearData(),this._underlyingData.clear()}_mergeData(e){this._invalidateLastNonEmptyPlotRowCache();var t=this._underlyingData.firstIndex();this._underlyingData.merge(e),t!==this._underlyingData.firstIndex()&&(this._data=new l(n(this._metaInfo),a));var i=this._data.lastIndex();this._underlyingData.range(i,this._underlyingData.lastIndex()).each(function(e,t){return this._data.add(e,r(t)),!1}.bind(this)),this._plotsForStrategyProcessing().forEach((function(e){new h(e.strategyIndex,e.targetIndex,i).rebuildData(this._data)}),this)}_plotsForStrategyProcessing(){var e=[];return this._metaInfo.plots.forEach((function(t,i){if("dataoffset"===t.type){var r=this._metaInfo.plots.findIndex((function(e){return e.id===t.target}));s(r>=0,"target plot not found for strategy plot "+t.id);var o={strategyIndex:i,targetIndex:r};e.push(o)}}),this),e}}},576678:(e,t,i)=>{"use strict";var s=i(86441).Point,r=i(772466).NonSeriesStudy,o=i(541801).TrendLineRenderer,l=i(315801).HitTestResult,n=i(315801).HitTarget,a=i(142119).CompositeRenderer,h=i(855152).LineEnd;const{LINESTYLE_SOLID:u}=i(458963);class c{constructor(e,t){this._model=e,this._source=t,this._pivots=[],this._textCache={},this._invalidated=!0}update(){this._invalidated=!0}updateImpl(){if(this._pivots=[],this._source.customData()&&this._source.customData().zigzag&&this._source.properties().visible.value()){var e=this._source.customData().zigzag,t=this._source._indexes,i=this._model.timeScale(),s=this._source.priceScale(),r=this._model.mainSeries(),o=r.firstValue();if(s&&!s.isEmpty()&&!i.isEmpty()&&o)for(var l=0;l{"use strict";function s(e,t,i){return e===t||e===i}i.d(t,{symbolSameAsResolved:()=>s})},904310:(e,t,i)=>{"use strict";function s(e){return e.charAt(0).toUpperCase()+e.substring(1)}i.d(t,{capitalizeFirstLetter:()=>s})}, 315507:e=>{e.exports=''},85290:e=>{e.exports=''},788600:e=>{e.exports=''},261820:e=>{e.exports=''},777566:e=>{e.exports=''},385442:e=>{e.exports=''},717090:e=>{e.exports=''},274469:e=>{ e.exports=''}}]);