"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[44336],{909816:(t,e,s)=>{s(301416);var i=s(185842),o=s(88434),a=(s(780927),s(622691)),l=s(587347),n=s(323939),r=s(19261),h=s(559912),d=s(121005),g=s(971267),c=s(100829),m=(s(151080),s(120564),s(882396),s(914487)),w=s.n(m),b=(s(545720),s(49186),s(823291)),p=s(955482),u=s(627889),C=s(77357),_=s(319585),y=s(901643),v=s(435074),f=s(736791),k=s(957199),L=s(275925),S=s(126927),T=s(60554),F=s(511228),M=s(584104),j=s(899861),P=s(434612),D=s(860904),$=s(235292),N=s(253300),W=s(74140),B=s(168509),E=s(501434),q=s(476989),U=s(950808),x=s(135092),A=s(493892),H=(s(543870),s(959691),s(545720)),O=s(49186);const R=(0,C.getLogger)("WidgetWatchlist"),I=["symbolActiveColor","symbolShortNameColor","symbolDescriptionColor","symbolSeparatorColor","tabActiveColor","tabInactiveColor","tabSliderColor","changeUpColor","changeDownColor","changeNeutralColor","lastColor","lastGrowingFlashColor","lastFallingFlashColor"],G=["plotLineColor","plotLineColorGrowing","plotLineColorFalling","gridLineColor","scaleFontColor","belowLineFillColorGrowing","belowLineFillColorFalling","belowLineFillColorGrowingBottom","belowLineFillColorFallingBottom","lastPriceLineColor","lastPriceLineColorGrowing","lastPriceLineColorFalling"];class z{constructor(t,e){if(this._symbols=[],this._chart=null,this._symbol=null,this._started=!1,this._hasDataPromise=null,this._destroyFloatingTooltip=null,t&&t.length||(R.logError("`$el` is required"),(0,i.assert)(Boolean(t&&t.length),"`$el` is required")),this.$el=t,this.$chart=t.find(".js-chart").eq(0),this.$symbolsWrapper=t.find(".js-symbols-wrapper").eq(0),this.hasChart=!!this.$chart.length,this.settings=this.transferSettings(e),this.showDataMode=!(!1===this.settings.showDataMode),this.showMarketStatus=!(!1===this.settings.showMarketStatus),this.chartColorMap=this.settings.chartColorMap,this.widgetColorClassMap=this.settings.widgetColorClassMap,"hotlists"===this.settings.widgetName||this.settings.isEmbedWidget){this._symbols=this.$el.data("symbols");this.$el.find(".js-symbols-wrapper").find(".js-symbols-body").append(this._renderPage())}this.settings.isEmbedWidget&&this.adjustToAvailableSizes(),this.start()}destroy(){this._destroyFloatingTooltip?.()}transferSettings(t){const e=t.utmInfo?H.param(t.utmInfo):void 0;let s;if(t.largeChartUrl){s=t.largeChartUrl;s.match(/^https?:\/\//)||(s="http://"+s)}return{chartColorMap:Object.assign({},this.defaultChartColors,t.chartColorMap),customer:t.customer,dateRange:t.dateRange,dateRangeOptions:t.dateRangeOptions,disableLastFallingFlash:Boolean(t.disableLastFallingFlash),disableLastGrowingFlash:Boolean(t.disableLastGrowingFlash),hideAbsoluteChange:Boolean(t.hideAbsoluteChange),indexNameBold:t.indexNameBold,indexNonClickable:t.indexNonClickable,isEmbedWidget:t.isEmbedWidget,largeChartUrl:s,noLinks:t.noLinks,onlyDescription:t.onlyDescription,paintLastWithChangeColors:Boolean(t.paintLastWithChangeColors),showDataMode:t.showDataMode,showMarketStatus:t.showMarketStatus,showTitles:t.showTitles, tradingviewBaseUrl:t.tradingviewBaseUrl,utmStringified:e,valueBold:t.valueBold,valueTitleMarked:t.valueTitleMarked,widgetColorClassMap:Object.assign({},t.widgetColorClassMap),widgetName:t.widgetName,showSymbolLogo:t.showSymbolLogo,locale:t.locale,showFloatingTooltip:t.showFloatingTooltip,colorTheme:t.colorTheme,utmInfo:{utm_campaign:t.utmInfo?.utm_campaign,utm_medium:t.utmInfo?.utm_medium,utm_source:t.utmInfo?.utm_source}}}get $symbols(){return this.$el.find(".js-quote-ticker")}set symbols(t){let e,s;const i=this._symbols.map((t=>t.s)),o=t.map((t=>t.s)),a=(t,s)=>H(s).data("symbol")===e;if(i&&i.toString()!==o.toString()){const l={},n=[],r=[];for(let t=0;t{t in l?h.append(l[t]):(n.push(t),r.push(t),this._renderSymbol({s:t})),s&&s===t&&(this.symbol=s)})),this._symbols=t,this.$symbols.each(((t,e)=>{const s=H(e),i=s.data("symbol");-1!==n.indexOf(i)&&(s.addClass("tv-site-table__row--updated"),setTimeout((()=>s.removeClass("tv-site-table__row--updated")),2*u.dur)),-1!==r.indexOf(i)&&this._startSymbolRow(s)}))}}get defaultChartColors(){return{gridLineColor:(0,L.generateColor)(b.colorsPalette["color-widget-border"],100),scaleFontColor:(0,L.generateColor)(b.colorsPalette["color-text-secondary"]),plotLineColor:(0,L.generateColor)(b.colorsPalette["color-brand"]),plotLineColorGrowing:void 0,plotLineColorFalling:void 0,belowLineFillColorGrowing:(0,L.generateColor)(b.colorsPalette["color-tv-blue-500"],82),belowLineFillColorFalling:(0,L.generateColor)(b.colorsPalette["color-tv-blue-500"],82),belowLineFillColorGrowingBottom:(0,L.generateColor)(b.colorsPalette["color-tv-blue-500"],100),belowLineFillColorFallingBottom:(0,L.generateColor)(b.colorsPalette["color-tv-blue-500"],100),lastPriceLineColor:(0,L.generateColor)(b.colorsPalette["color-brand"],50),lastPriceLineColorGrowing:void 0,lastPriceLineColorFalling:void 0}}get pageTemplates(){return{page:"\n\t\t\t\t{{#showTitles}}\n\t\t\t\t\t{{>title}}\n\t\t\t\t{{/showTitles}}\n\t\t\t\t{{#symbols}}\n\t\t\t\t\t{{>symbol}}\n\t\t\t\t{{/symbols}}",symbol:`\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{{^noLinks}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t{{^onlyDescription}}{{ shortName }}{{/onlyDescription}}\n\t\t\t\t\t\t\t\t\t\t{{#onlyDescription}}\n\t\t\t\t\t\t\t\t\t\t\t{{#description}}{{ description }}{{/description}}\n\t\t\t\t\t\t\t\t\t\t{{/onlyDescription}}\n\t\t\t\t\t\t\t\t{{^noLinks}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{{/noLinks}}\n\t\t\t\t\t\t\t\t{{#noLinks}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{{/noLinks}}\n\t\t\t\t\t\t\t\t{{#showDataMode}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{{/showDataMode}}\n\t\t\t\t\t\t\t\t{{#showMarketStatus}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{{/showMarketStatus}}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{{^onlyDescription}}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{{#description}}{{ description }}{{/description}}{{^description}} {{/description}}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{{/onlyDescription}}\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{{#last}}{{ last }}{{/last}}{{^last}} {{/last}}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{{#change_pt}}{{ change_pt }}{{/change_pt}}{{^change_pt}} {{/change_pt}}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{{^hideAbsoluteChange}}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{{#change}}{{ change }}{{/change}}{{^change}} {{/change}}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{{/hideAbsoluteChange}}\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
`, title:'\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tIndex\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tValue{{#valueTitleMarked}}*{{/valueTitleMarked}}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tChange\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
'}}set symbol(t){if(this._symbol=t,this._chart&&this._chart.changeSymbol(t,this._getSeriesOptions()),this.hasChart){const e=w()("tv-site-table__row--highlighted tv-widget-watch-list__row--highlighted",this.widgetColorClassMap.symbolActiveColor);this.$symbols.removeClass(e).filter(((e,s)=>H(s).data("symbol")===t)).addClass(e)}else this.$symbols.filter(((e,s)=>H(s).data("symbol")===t))}get symbol(){return this._symbol||""}start(){this._started||(this.symbol||(this.symbol=this.$symbols.eq(0).data("symbol")),this.hasChart&&(this._bindSymbolClick(),this._startChart()),this._startSymbolRows(),this._started=!0)}stop(){this._started&&(this._unbindSymbolClick(),this._stopChart(),this._stopSymbolRows(),this._started=!1)}hasData(){if(null===this._hasDataPromise){const t=[];this.$symbols.each(((e,s)=>{const i=H(s).data("watchlist-widget__symbol-row");t.push(i.hasData())})),this._hasDataPromise=Promise.all(t).then((t=>t.some((t=>t))))}return this._hasDataPromise}adjustToAvailableSizes(){const t=(0,i.ensureNotNull)(document.querySelector(".js-watchlist-widget")),e=(0,i.ensureNotNull)(document.querySelector(".js-quote-ticker"));let s=(0,i.ensureNotNull)(t.parentElement).offsetHeight-t.offsetHeight,o=this.hasChart?this.$chart[0].offsetHeight:0,a=this.$symbolsWrapper[0].offsetHeight,l=this.$symbolsWrapper[0].scrollHeight-a;if(0===s&&0===l)return;const n=e.offsetHeight;let r=0;s>0&&l>0?r=Math.min(l,s/2):s<0&&(r=this.hasChart?Math.max(Math.floor(s/2),n-a):s),a+=r,l-=r,s-=r,this.hasChart&&(o+=s,s=0),this.hasChart&&l>0&&l{this.symbol=H(t.currentTarget).data("symbol")}))}_unbindSymbolClick(){this.$el.off("click",".js-quote-ticker")}_getSymbolDataToRender(t){let e,s;const i=(0,F.tokenize)(t.s);if((0,F.isSpread)(i)){e=(0,F.shortNameFromTokens)(i) ;const t=i.find((t=>"symbol"===t.type))?.value;s=t?.split(":")[0]||""}else[s,e]=t.s.split(":");const o=t.t||e,a=this.settings.largeChartUrl&&(0,S.makeTemplateSymbolUrl)(this.settings.largeChartUrl,{shortName:e,exchange:s})||"",l=(0,S.makeSymbolPageUrl)({shortName:e,exchange:s},this.settings.utmInfo),n=t.d;return{s:t.s,description:n,exchange:s,shortName:o,symbolUrl:l,showChart:this.hasChart,onlyDescription:this.settings.onlyDescription,isEmbedWidget:this.settings.isEmbedWidget,utmStringified:this.settings.utmStringified,largeChartUrl:a,tradingviewBaseUrl:this.settings.tradingviewBaseUrl,showDataMode:this.showDataMode,showMarketStatus:this.showMarketStatus,indexNameBold:this.settings.indexNameBold,valueBold:this.settings.valueBold,shortNameClass:this.widgetColorClassMap.symbolShortNameColor,descriptionClass:this.widgetColorClassMap.symbolDescriptionColor,symbolColumnClass:this.widgetColorClassMap.symbolSeparatorColor,lastClass:this.widgetColorClassMap.lastColor,lastDirection:this.settings.paintLastWithChangeColors,hideAbsoluteChange:this.settings.hideAbsoluteChange,noLinks:this.settings.noLinks}}_renderSymbol(t){return O.render(this.pageTemplates.symbol,this._getSymbolDataToRender(t))}_renderPage(){const t=[];return this._symbols.forEach((e=>t.push(this._getSymbolDataToRender(e)))),O.render(this.pageTemplates.page,{symbols:t,showTitles:this.settings.showTitles,showDataMode:this.showDataMode,showMarketStatus:this.showMarketStatus,valueTitleMarked:this.settings.valueTitleMarked},this.pageTemplates)}_renderTitle(){return O.render(this.pageTemplates.title,{valueTitleMarked:this.settings.valueTitleMarked})}_startChart(){if(this._chart)return void this._chart.enable();if(!this.symbol)return;const t=this.settings.showFloatingTooltip,e=this._getSeriesOptions();let s;if(t){const t="dark"===this.settings.colorTheme?b.colorsPalette["color-cold-gray-700"]:b.colorsPalette["color-cold-gray-200"];s={vertLine:{visible:!0,style:_.LineStyle.Solid,width:1,color:t},mode:_.CrosshairMode.Magnet}}const i=(0,T.getMiniTimeFrameOptions)().filter((t=>!this.settings.dateRangeOptions||this.settings.dateRangeOptions.includes((0,q.convertTimeFrameToStr)(t.value))));if(this._chart=new j.LightweightMiniChart({symbol:this.symbol},this.$chart.get(0),{timeframe:{visible:!0,container:this.$el.find(".js-timeframes").get(0),value:(0,q.convertStrToTimeFrame)(this.settings.dateRange),options:i,size:"xsmall"},chartOptions:{minWidth:this.$chart.width(),minHeight:this.$chart.height(),chart:{grid:{horzLines:{visible:!0,color:this.chartColorMap.gridLineColor,style:_.LineStyle.Dotted}},crosshair:s,layout:{textColor:this.chartColorMap.scaleFontColor,fontSize:12,attributionLogo:!1},localization:{locale:(0,A.getIsoLanguageCodeFromLanguage)(this.settings.locale)},rightPriceScale:{visible:!1}},series:e,loading:{spinner:{visible:!0}}}}),t){const t=this._chart;this._destroyFloatingTooltip=(0,N.createLightweightChartPriceTimeTooltip)({chart:t.widget(),coloredBorderVisible:!1,crosshairMoveDataGetter:e=>(0,W.getCrosshairMoveData)(t,e)})}}_stopChart(){ this._chart&&this._chart.disable()}_getSeriesOptions(){return{chartType:"area",lineColor:this.chartColorMap.plotLineColor,growingLineColor:this.chartColorMap.plotLineColorGrowing,fallingLineColor:this.chartColorMap.plotLineColorFalling,lineWidth:2,growingTopColor:this.chartColorMap.belowLineFillColorGrowing,fallingTopColor:this.chartColorMap.belowLineFillColorFalling,growingBottomColor:this.chartColorMap.belowLineFillColorGrowingBottom,fallingBottomColor:this.chartColorMap.belowLineFillColorFallingBottom,crosshairMarkerVisible:this.settings.showFloatingTooltip,crosshairMarkerRadius:3.5,crosshairMarkerBorderColor:"dark"===this.settings.colorTheme?b.colorsPalette["color-cold-gray-850"]:b.colorsPalette["color-white"],scaleMargins:{top:.01,bottom:.05}}}_startSymbolRows(){this.$symbols.each(((t,e)=>{this._startSymbolRow(H(e))}))}_startSymbolRow(t){const e=t.data("watchlist-widget__symbol-row");e?e.start():t.data("watchlist-widget__symbol-row",new V(t,{tradingviewBaseUrl:this.settings.tradingviewBaseUrl,largeChartUrl:this.settings.largeChartUrl,isEmbedWidget:this.settings.isEmbedWidget,directionUpClass:this.widgetColorClassMap.changeUpColor,directionDownClass:this.widgetColorClassMap.changeDownColor,directionNeutralClass:this.widgetColorClassMap.changeNeutralColor,lastGrowingClass:this.settings.disableLastGrowingFlash?null:this.widgetColorClassMap.lastGrowingFlashColor,lastFallingClass:this.settings.disableLastFallingFlash?null:this.widgetColorClassMap.lastFallingFlashColor,noLinks:this.settings.noLinks,showSymbolLogo:this.settings.showSymbolLogo,utmInfo:this.settings.utmInfo}))}_stopSymbolRows(){this.$symbols.each(((t,e)=>{this._stopSymbolRow(H(e))}))}_stopSymbolRow(t){const e=t.data("watchlist-widget__symbol-row");e&&e.stop()}}class V{constructor(t,e){this._hasData=new B.WatchedValue,this._setSymbolLinkCompleted=!1,t&&t.length||(R.logError("`$el` is required"),(0,i.assert)(Boolean(t&&t.length),"`$el` is required")),this.$el=t,this.symbol=t.data("symbol"),this.description=t.data("description"),this.start(),this._largeChartUrl=e.largeChartUrl||"",this._utmInfo=e.utmInfo||{},this._isEmbedWidget=!!e.isEmbedWidget,this._noLinks=e.noLinks,this._showSymbolLogo=e.showSymbolLogo;const s=(0,r.pickFields)(e,["directionUpClass","directionDownClass","directionNeutralClass","lastGrowingClass","lastFallingClass"]);this._directionUpClass=s.directionUpClass,this._directionDownClass=s.directionDownClass,this._directionNeutralClass=s.directionNeutralClass,this._lastGrowingClass=s.lastGrowingClass,this._lastFallingClass=s.lastFallingClass,this._setSymbolLogo=(0,v.getLogoUrlsHook)((t=>{const e=this.symbol.split(":")[1],s=(this.description||e||"")[0];(0,i.ensureNotNull)(this.$el[0].querySelector(".js-symbol-logo")).innerHTML=(0,y.getCircleLogoAnyHtml)({logoUrls:t,size:"medium",placeholderLetter:s})}))}start(){this._startQuoteTicker().then((()=>{this._startMarketStatus()})).catch((t=>R.logError(`${t.exchange} ${t.reason}`)))}stop(){this._stopQuoteTicker(),this._stopMarketStatus()}hasData(){ return void 0===this._hasData.value()?new Promise((t=>{this._hasData.subscribe(t,{once:!0})})):Promise.resolve(this._hasData.value())}_startMarketStatus(){if(this.$el.find(".js-market-status")[0]){const t=new D.MarketStatusIndicator({classSuffix:"--for-watch-list",el:this.$el.find(".js-market-status")[0],short:!0,symbol:this.symbol,onValueChange:e=>{"delisted"===e?t.setSessionStatusIcon(!0):t.setSessionStatusIcon(!1)}});t.start(),this.$el.data("market-status",t)}const t=this.$el.find(".js-data-mode")[0];if(t){const e=new $.DataModeIndicator({classSuffix:"--for-watch-list",el:t,short:!0,symbol:this.symbol});e.start(),this.$el.data("data-mode",e)}}_stopMarketStatus(){const t=this.$el.data("market-status"),e=this.$el.data("data-mode");t&&t.stop(),e&&e.stop()}_showSFWarning(){const t=this.$el.get(0);if(t.getElementsByClassName("js-exclamationed-symbol").length)return;const e=document.createElement("span");e.classList.add("tv-widget-watch-list__symbol-exclamation-mark","js-exclamationed-symbol","apply-common-tooltip"),e.setAttribute("title",(0,k.getWarningTextForFreeUsers)());const s=t.getElementsByClassName("js-symbol-link").item(0);s&&(s.appendChild(e),window.loginStateChange?.subscribe(null,(()=>{if(window.is_authenticated){const e=t.getElementsByClassName("js-exclamationed-symbol");for(;e.length>0;)(0,i.ensureNotNull)(e[0].parentNode).removeChild(e[0])}})))}_startQuoteTicker(){let t=this.$el.data("quote-ticker");if(t)return t.enable(),Promise.resolve(t);const e=this._showSFWarning.bind(this),s=(t,e,s)=>{this._setSymbolLinkCompleted||this._noLinks||this._setSymbolLink(t),this._showSymbolLogo&&this._setSymbolLogo(t,e,s)};return new Promise(((i,o)=>{(0,f.check)(this.symbol,!1).then((o=>{const a={dontDyePrice:!0,addDescriptionTitle:!1,signPositive:!0,changePercentInBrackets:!1,setStateHook:s,changeDirectionUpClass:this._directionUpClass||void 0,changeDirectionDownClass:this._directionDownClass||void 0,changeDirectionNeutralClass:this._directionNeutralClass||void 0,lastGrowingClass:this._lastGrowingClass||void 0,lastFallingClass:this._lastFallingClass||void 0,initedHook:()=>{this._hasData.setValue(!0)},noSuchSymbolHook:()=>{this._hasData.setValue(!1)},permissionDeniedHook:()=>{this._hasData.setValue(!1),e()}};t=new P.QuoteTicker(o,this.$el.get(0),a),this.$el.data("quote-ticker",t),i(t)})).catch((t=>{this._hasData.setValue(!1),e(),o(t)}))}))}_setSymbolLink(t){const e=t.short_name,s=t.exchange,i=t.pro_name,o=t.type;if(!(e&&s&&i&&o))return;const a=this.$el[0].getElementsByClassName("js-symbol-link")[0],l=this._largeChartUrl&&this._isEmbedWidget,n={shortName:e,exchange:s,proName:i,type:o};a.href=l?(0,S.makeTemplateSymbolUrl)(this._largeChartUrl,n):(0,S.makeSymbolPageUrl)(n,this._utmInfo),this._setSymbolLinkCompleted=!0}_stopQuoteTicker(){const t=this.$el.data("quote-ticker");t&&t.disable()}}var Q=s(32418);const J=Object.assign({},window.initData.widgetDefaults);J.whitelabel=Boolean(window.initData.widgetDefaults.whitelabel),J.noLinks=Boolean(window.initData.widgetDefaults.noLinks);const K=(0, a.parseUrlHashParams)(),Z=Object.assign({},J);"showChart"in K&&(Z.show_chart=K.showChart),Z.customer=window.TradingView.widgetCustomer,"showSymbolLogo"in K&&(Z.showSymbolLogo=Boolean(K.showSymbolLogo)),"showFloatingTooltip"in K&&(Z.showFloatingTooltip=Boolean(K.showFloatingTooltip)),Z.dateRange=(0,c.getActualTimeFrame)(K.dateRange||window.initData.widgetDefaults.dateRange),K.dateRangeOptions&&(Z.dateRangeOptions=K.dateRangeOptions.map(c.getActualTimeFrame));const X=window.locale||J.locale||"en";Z.locale=X;try{(0,Q.trackWidgetLoadMetaInfo)({widget_id:"market-overview",symbols:JSON.stringify(function(t){const e=[];for(const s of t)for(const t of s.symbols)t.s&&e.push(t.s);return e}(Z.tabs)),customer:Z.customer})}catch{}const Y=window.locale_domains[X]?window.locale_domains[X]:window.locale_domains.en;Z.tradingviewBaseUrl=Y?document.location.protocol+"//"+Y:"",Z.largeChartUrl=K.largeChartUrl;const tt=K.isTransparent;K.tabs&&(Z.tabs=K.tabs),Z.show_chart&&(Object.assign(Z,(0,r.pickFields)(K,G)),void 0===Z.belowLineFillColorFallingBottom&&Z.belowLineFillColorFalling&&(Z.belowLineFillColorFallingBottom=Z.belowLineFillColorFalling),void 0===Z.belowLineFillColorGrowingBottom&&Z.belowLineFillColorGrowing&&(Z.belowLineFillColorGrowingBottom=Z.belowLineFillColorGrowing)),Z.colorTheme=K.colorTheme,Object.assign(Z,(0,r.pickFields)(K,I)),K.tickerColorGrowing&&K.tickerColorFalling&&(Z.paintLastWithChangeColors=!0,Z.disableLastGrowingFlash=!0,Z.disableLastFallingFlash=!0,Z.changeUpColor=K.tickerColorGrowing,Z.changeDownColor=K.tickerColorFalling),Z.indexNameBold=ot("indexNameBold",K,Z),Z.valueBold=ot("valueBold",K,Z),Z.valueTitleMarked=ot("valueTitleMarked",K,Z),Z.paintLastWithChangeColors=ot("paintLastWithChangeColors",K,Z),Z.onlyDescription=ot("onlyDescription",K,Z),Z.hideAbsoluteChange=ot("hideAbsoluteChange",K,Z);const et=(0,n.filterUtmInfo)(K),st=(0,i.ensureNotNull)(document.querySelector("#widget-market-overview-container"));tt&&(st.style.backgroundColor="transparent"),(0,l.createEmbedWidgetWrapper)(st,"market-overview",et,{isWhiteLabel:Z.whitelabel,locale:X,customer:Z.customer}),st.classList.add("tv-site-widget"),st.classList.add("tv-site-widget--bg_none"),st.innerHTML='
\n\t\t
\n\t
\n\t
\n\t\t
\n\t
',Object.assign(Z,{utmInfo:et}),Z.onActivePageLoaded=t=>{t||(0,h.dispatchEventToParent)(d.IFrameEvents.Names.NoData,g.frameElementId,void 0)};const it=new class{constructor(t,e={}){this._stopPageTimeouts={},this._activePageLoadedPromise=null,this._destroyTabLabels=null,t||(R.logError("`el` is required"),(0,i.assert)(Boolean(t),"`el` is required")),this.$el=H(t),this.settings=this._prepareSettings(e),this._activePageLoadedPromise=null,this.tabsLabels=this.settings.tabs.map((t=>t.title||t.title_raw));const s=(0,r.pickFields)(this.settings,I);this.widgetColorClassMap=function(t){ const e=(0,M.randomHashN)(4);return t.reduce(((t,s)=>{const i=s.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`));return t[s]=`${i}--${e}`,t}),{})}(Object.keys(s)),t.appendChild(function(t,e,s){const i=(t,e)=>`.${t}, .${t}:hover, .${t}:active { color: ${e} }`,o={symbolActiveColor:(t,e)=>`.${t} { background: ${e} }`,symbolSeparatorColor:(t,e)=>`.${t}:after { background: ${e} }`,tabSliderColor:(t,e)=>`.${t} { background: ${e} }`},a=document.createElement("style"),l=[];for(const a of t){const t=s[a],n=e[a];if(!t||!n||null===(0,p.tryParseRgb)(n))continue;const r=o[a];l.push(r?r(t,n):i(t,n))}return a.textContent=l.join(" "),a}(I,s,this.widgetColorClassMap)),this.settings.isEmbedWidget||"hotlists"===this.widgetName?(1===this.settings.tabs.length&&this.$el.find(".js-widget-head").addClass("i-hidden"),this.renderContent().then((()=>{this._initPages(),this.setAutoUpdate()}),(t=>{console.log("WidgetWatchlist constructor error",t)}))):this._initPages()}setAutoUpdate(){}get widgetName(){return"marketoverview"}get settingsKey(){return"watchlist__summary.properties"}get userSettings(){return{}}get templates(){return{tab:'\n\t\t\t\t
{{ title }}\n\t\t\t\t
',tabContent:`\n\t\t\t\t
\n\t\t\t\t\t{{#showChart}}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t{{/showChart}}\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t{{^isEmbedWidget}}\n\t\t\t\t\t\t{{#quickLink}}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{{/quickLink}}\n\t\t\t\t\t{{/isEmbedWidget}}\n\t\t\t\t
`,tabContentSkin:'\n\t\t\t\t
\n\t\t\t\t
'}}renderContent(){const t=this.settings.tabs.map((t=>{const e=H(O.render(this.templates.tabContent,{showChart:this.settings.show_chart, isEmbedWidget:this.settings.isEmbedWidget,group:t.group,firstTab:t===this.settings.tabs[0],forceEndBorder:this.settings.force_end_border},this.templates));return e.data("symbols",t.symbols.map((t=>Object({s:t.s,d:t.d,t:t.t})))),this.$el.find(".js-pages").append(e),!0}));return new Promise((e=>{Promise.all(t).then(e)}))}saveToTVSettings(t){const e=window.locale;let s=(0,U.getJSON)(this.settingsKey);s||(s={}),s[e]=t,(0,U.setJSON)(this.settingsKey,s)}destroy(){this.$pagesContainer&&(this.$pagesContainer.children().each(((t,e)=>{this._stopPage(H(e))})),this._destroyTabLabels?.(),this.$pagesContainer.children().each(((t,e)=>{const s=H(e);this._getCachedWidgetPage(s)?.destroy()})))}resetCaches(){this.$pagesContainer&&this.$pagesContainer.children().each(((t,e)=>{const s=H(e);this._getCachedWidgetPage(s)&&this._cacheWidgetPage(s,this._createWidgetWatchlistPage(s))}))}adjustToAvailableSizes(){this.$pagesContainer.children().each(((t,e)=>{if(!e.classList.contains("i-hidden")){const t=this._getCachedWidgetPage(H(e));t?.adjustToAvailableSizes()}}))}_startPage(t){let e=this._getCachedWidgetPage(t);if(e?(this._deleteStopTimeout(t),e.start()):(e=this._createWidgetWatchlistPage(t),this._cacheWidgetPage(t,e)),"function"==typeof this.settings.onActivePageLoaded){const t=this._activePageLoadedPromise=e.hasData().then((e=>{t===this._activePageLoadedPromise&&this.settings.onActivePageLoaded&&this.settings.onActivePageLoaded(e)}))}}_getCachedWidgetPage(t){return t.data("watchlist-widget-page")}_initPages(){const t=this.$el.find(".js-tabs").eq(0),e=this.$el.find(".js-pages").eq(0),s=1===e.children().length;this.settings.fixedChartHeight&&(this._normalizeSymbolListHeight(),setTimeout((()=>this._adjustSymbolsListHeight()),0)),s?this._startPage(e.children().eq(0)):(this._initTabs(t,e),!this.settings.fixedChartHeight&&this.settings.adjust_widget_height&&e.find(".js-chart").length&&this._adjustChartHeight(e,this.settings.adjust_widget_height)),this.$pagesContainer=e}_getPagesArray(t){return t?Array.prototype.slice.call(t.children):[]}_prepareSettings(t){let e;const s=this.$el.data("widget-data");if(s)if(s.is_embed_widget)e=Object.assign({},s,t);else{const i=this.userSettings;(!1===s.hotlists_select_enabled||s.override_user_exchange)&&delete i.exchange,e=Object.assign({},s,t,i)}else this.$el.data("widget-data",t),e=t;return void 0!==e.is_embed_widget&&(e.isEmbedWidget=e.is_embed_widget),e.is_embed_widget=void 0,e}_initTabs(t,e){const s=this._getPagesArray(e.get(0));(0,x.createTabLabels)("watchlist-widget-tab-labels",this.tabsLabels,t.get(0),s,this._onActivePageChanged.bind(this)).then((t=>this._destroyTabLabels=t)),this._startPage(H((0,i.ensureNotNull)(this._getActivePage(s))))}_adjustChartHeight(t,e){const s=t.children(),o=document.querySelector(".js-quote-ticker"),a=document.querySelector(".js-chart");if(o&&a){const t=o.offsetHeight,l=a.offsetHeight;for(let o=0;o{if(t===s){if(this._startPage(H(e)),this.settings.isEmbedWidget){const t=this._getCachedWidgetPage(H(e));t?.adjustToAvailableSizes()}}else this._stopPage(H(e))}))}_getActivePage(t){for(const e of t)if(!e.classList.contains("i-hidden"))return e;return null}_cacheWidgetPage(t,e){t.data("watchlist-widget-page",e)}_setStopTimeout(t){ this._stopPageTimeouts[t.index()]=setTimeout(this._stopPage.bind(this,t))}_deleteStopTimeout(t){const e=this._stopPageTimeouts[t.index()];e&&(clearTimeout(e),delete this._stopPageTimeouts[t.index()])}}(st,Z);if(Z.isEmbedWidget&&!Z.fixedChartHeight&&!Z.adjust_widget_height){const t=(0,i.ensureNotNull)(document.querySelector(".js-embed-widget-body"));new ResizeObserver((0,o.default)((function(t){const e=t[0].contentRect;e.width>0&&e.height>0&&it.adjustToAvailableSizes()}),200)).observe(t)}function ot(t,e,s){return t in e?"false"!==e[t]:s[t]}}},t=>{t.O(0,[58667,97711,19389,15043,61171,71825,56287,21502,48194,12515,22422,92586,33330,28223,24317,84548,14048,99827,12933,70901,30095,82688,98927,90334,7123,84596,62877,98312,10532,69266],(()=>{return e=909816,t(t.s=e);var e}));t.O()}]);