-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchunk-GCTVRZBD.js
1 lines (1 loc) · 26.9 KB
/
chunk-GCTVRZBD.js
1
import{e as ve}from"./chunk-ZM57XGTE.js";import{a as _e}from"./chunk-YA72FBKR.js";import{a as be,b as R}from"./chunk-IBGKW3YC.js";import{a as z}from"./chunk-LBZNYUHD.js";import{b as Ce,c as $,d as D,e as b,f as W,g as N}from"./chunk-DQ47BEOY.js";import{b as T,d as O}from"./chunk-A7YDWOAO.js";import{a as ye}from"./chunk-GNGLHN23.js";import{$ as H,Cb as F,Db as U,Eb as Y,Fb as r,Gb as I,Ha as A,Hb as u,Ib as E,Jb as de,M as ee,O as te,Ob as me,P as ie,Pb as s,Q as ne,Qb as j,Rb as d,Sa as re,Ua as a,Ub as M,Va as q,ba as P,bb as ae,cc as ue,gb as _,jc as pe,kc as he,l as X,mc as ge,nb as m,nc as xe,o as G,ob as le,oc as fe,p as Z,pb as L,qb as k,rb as oe,sb as ce,tb as i,ub as t,va as y,vb as x,w as J,wa as C,wb as se,xa as w,xb as f,ya as B,yb as p}from"./chunk-PPE7DTG5.js";var Se=["chartContainer"],we=["chart"],Te=(c,l)=>l.vendorCode.etm,qe=(c,l)=>[c,l];function Ie(c,l){if(c&1&&(i(0,"div",52)(1,"div",51),r(2,"Change:\xA0"),t(),r(3),s(4,"number"),s(5,"number"),t()),c&2){let e=p(3);m("ngClass",e.chartCrosshairData.change.direction===e.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(3),E(" ",d(4,3,e.chartCrosshairData.change.value,"1.2-2")," (",d(5,6,e.chartCrosshairData.change.percentage,"1.2-2"),"%) ")}}function De(c,l){if(c&1&&(i(0,"div",50)(1,"div",51),r(2,"Open:\xA0"),t(),r(3),s(4,"number"),t(),i(5,"div",50)(6,"div",51),r(7,"Close:\xA0"),t(),r(8),s(9,"number"),t(),i(10,"div",50)(11,"div",51),r(12,"Low:\xA0"),t(),r(13),s(14,"number"),t(),i(15,"div",50)(16,"div",51),r(17,"High:\xA0"),t(),r(18),s(19,"number"),t(),i(20,"div",50)(21,"div",51),r(22,"Volume:\xA0"),t(),r(23),s(24,"number"),t(),_(25,Ie,6,9,"div",52)),c&2){let e=p(2);a(3),u(" ",d(4,6,e.chartCrosshairData.open,"1.2-2")," "),a(5),u(" ",d(9,9,e.chartCrosshairData.close,"1.2-2")," "),a(5),u(" ",d(14,12,e.chartCrosshairData.low,"1.2-2")," "),a(5),u(" ",d(19,15,e.chartCrosshairData.high,"1.2-2")," "),a(5),u(" ",d(24,18,e.chartCrosshairData.volume,"1.0")," "),a(2),k(e.chartCrosshairData.change?25:-1)}}function Re(c,l){c&1&&(i(0,"div",21),w(),i(1,"svg",53),x(2,"path",54)(3,"path",55),t(),B(),i(4,"span",56),r(5,"Loading..."),t()())}function Pe(c,l){c&1&&(i(0,"div",22),w(),i(1,"svg",57),x(2,"path",58),t(),B(),i(3,"span"),r(4,"No Data"),t()())}function Be(c,l){c&1&&(i(0,"span",56),r(1,"Minimize"),t(),w(),i(2,"svg",59),x(3,"path",60),t())}function Me(c,l){c&1&&(i(0,"span",56),r(1,"Expand"),t(),w(),i(2,"svg",59),x(3,"path",61),t())}function Oe(c,l){if(c&1&&(i(0,"tr",69)(1,"th",70)(2,"div",71),r(3),t()(),i(4,"td",72)(5,"div",8),r(6),s(7,"number"),t(),i(8,"div",73),r(9),s(10,"number"),t()(),i(11,"td",74)(12,"div"),r(13),s(14,"number"),t(),i(15,"div"),r(16),s(17,"number"),t()()()),c&2){let e=l.$implicit,n=p(2),o=p();m("routerLink",me(19,qe,"/"+o.Routes.STOCKS,e.vendorCode.etm.primary)),a(3),u(" ",e.name," "),a(3),u(" ",d(7,7,e.quote==null||e.quote[n.exchange]==null?null:e.quote[n.exchange].price,"1.2-2")," "),a(3),u(" ",d(10,10,e.quote==null||e.quote[n.exchange]==null?null:e.quote[n.exchange].volume,"1.0-0")," "),a(2),m("ngClass",(e.quote==null||e.quote[n.exchange]==null||e.quote[n.exchange].change==null?null:e.quote[n.exchange].change.direction)===o.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(2),u(" ",d(14,13,e.quote==null||e.quote[n.exchange]==null||e.quote[n.exchange].change==null?null:e.quote[n.exchange].change.value,"1.2-2")," "),a(3),u(" (",d(17,16,e.quote==null||e.quote[n.exchange]==null||e.quote[n.exchange].change==null?null:e.quote[n.exchange].change.percentage,"1.2-2"),"%) ")}}function Ne(c,l){if(c&1&&(i(0,"div",49)(1,"table",62)(2,"colgroup"),x(3,"col",63)(4,"col",64)(5,"col",64),t(),i(6,"thead",65)(7,"tr")(8,"th",66)(9,"div",67),r(10,"Company"),t()(),i(11,"th",68)(12,"div"),r(13,"LTP (\u20B9)"),t(),i(14,"div"),r(15,"Volume"),t()(),i(16,"th",68)(17,"div"),r(18,"Day P/L (\u20B9)"),t(),i(19,"div"),r(20,"Day P/L (%)"),t()()()(),i(21,"tbody"),oe(22,Oe,18,22,"tr",69,Te),t()()()),c&2){let e=p();a(22),ce(e.constituents)}}function Ve(c,l){if(c&1){let e=se();i(0,"div",4)(1,"div",5)(2,"div",6),r(3),i(4,"span",7),r(5),s(6,"uppercase"),t()()(),i(7,"div",8)(8,"div",9),r(9),s(10,"number"),t(),i(11,"div",10),r(12),s(13,"number"),s(14,"number"),t()()(),i(15,"div",11,0)(17,"div",12)(18,"div",13)(19,"div",14),_(20,De,26,21),t(),i(21,"div",15)(22,"div",16)(23,"button",17),f("click",function(){y(e);let o=p();return C(o.setChartTimeRange(o.ChartTimeRange.ONE_DAY))}),r(24," 1D "),t(),i(25,"button",18),f("click",function(){y(e);let o=p();return C(o.setChartTimeRange(o.ChartTimeRange.ONE_WEEK))}),r(26," 1W "),t(),i(27,"button",18),f("click",function(){y(e);let o=p();return C(o.setChartTimeRange(o.ChartTimeRange.ONE_MONTH))}),r(28," 1M "),t(),i(29,"button",18),f("click",function(){y(e);let o=p();return C(o.setChartTimeRange(o.ChartTimeRange.THREE_MONTHS))}),r(30," 3M "),t(),i(31,"button",18),f("click",function(){y(e);let o=p();return C(o.setChartTimeRange(o.ChartTimeRange.SIX_MONTHS))}),r(32," 6M "),t(),i(33,"button",18),f("click",function(){y(e);let o=p();return C(o.setChartTimeRange(o.ChartTimeRange.ONE_YEAR))}),r(34," 1Y "),t(),i(35,"button",19),f("click",function(){y(e);let o=p();return C(o.setChartTimeRange(o.ChartTimeRange.FIVE_YEAR))}),r(36," 5Y "),t()()()(),i(37,"div",20,1),_(39,Re,6,0,"div",21)(40,Pe,5,0,"div",22),t(),i(41,"div",23)(42,"button",24),f("click",function(){y(e);let o=p();return C(o.toggleFullscreen())}),_(43,Be,4,0)(44,Me,4,0),t()()()(),i(45,"div",25)(46,"div",26)(47,"h5",27),r(48," Overview "),t(),i(49,"div",28)(50,"div",29)(51,"div",30)(52,"div",31),r(53," Open "),t(),r(54),s(55,"number"),t(),i(56,"div",30)(57,"div",31),r(58," Prev. Close "),t(),r(59),s(60,"number"),t()(),i(61,"div",32)(62,"div")(63,"div",31),r(64," Day Range "),t(),i(65,"div",33)(66,"div",30),r(67),s(68,"number"),t(),i(69,"div"),r(70),s(71,"number"),t()(),i(72,"div",34)(73,"div",35),r(74," L "),t(),x(75,"input",36),i(76,"div",37),r(77," H "),t()()(),i(78,"div")(79,"div",31),r(80," 52 Week Range "),t(),i(81,"div",33)(82,"div",30),r(83),s(84,"number"),t(),i(85,"div"),r(86),s(87,"number"),t()(),i(88,"div",34)(89,"div",35),r(90," L "),t(),x(91,"input",36),i(92,"div",37),r(93," H "),t()()()()()(),i(94,"div",38)(95,"h5",27),r(96," Advance/Decline "),t(),i(97,"div",39)(98,"div",40)(99,"span"),r(100),t(),i(101,"span"),r(102),t()(),i(103,"div",41),x(104,"div",42),t(),i(105,"div",40)(106,"span"),r(107),s(108,"number"),t(),i(109,"span"),r(110),s(111,"number"),t()()()(),i(112,"div",26)(113,"h5",27),r(114," Returns "),t(),i(115,"div",43)(116,"div",44)(117,"div",45)(118,"div",31),r(119," 1 Month "),t(),i(120,"div",46),r(121),s(122,"number"),t()(),i(123,"div",45)(124,"div",31),r(125," 3 Months "),t(),i(126,"div",46),r(127),s(128,"number"),t()(),i(129,"div",45)(130,"div",31),r(131," 6 Months "),t(),i(132,"div",46),r(133),s(134,"number"),t()()(),i(135,"div",44)(136,"div",45)(137,"div",31),r(138," 1 Year "),t(),i(139,"div",46),r(140),s(141,"number"),t()(),i(142,"div",45)(143,"div",31),r(144," 3 Years "),t(),i(145,"div",46),r(146),s(147,"number"),t()(),i(148,"div",45)(149,"div",31),r(150," 5 Years "),t(),i(151,"div",46),r(152),s(153,"number"),t()()()()()(),i(154,"div",47)(155,"h5",48),r(156," Constituent Stocks "),t(),_(157,Ne,24,0,"div",49),t()}if(c&2){let e=l,n=p();a(3),u(" ",e.name," "),a(2),I(j(6,62,e.exchange)),a(4),u(" ",d(10,64,e.quote==null?null:e.quote.value,"1.2-2")," "),a(2),m("ngClass",(e.quote==null||e.quote.change==null?null:e.quote.change.direction)===n.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(),de(" ",(e.quote==null||e.quote.change==null?null:e.quote.change.direction)===n.Direction.UP?"\u25B2":"\u25BC"," ",d(13,67,e.quote==null||e.quote.change==null?null:e.quote.change.value,"1.2-2")," (",d(14,70,e.quote==null||e.quote.change==null?null:e.quote.change.percentage,"1.2-2"),"%) "),a(3),L("md:px-4",!n.isChartInFullscreen),a(2),m("ngClass",n.isChartInFullscreen?"pe-4":"md:shadow md:rounded-lg md:border md:border-gray-200 md:dark:border-gray-700"),a(3),k(n.chartCrosshairData?20:-1),a(3),m("ngClass",n.activeChartTimeRange===n.ChartTimeRange.ONE_DAY?"bg-primary-700 text-white dark:bg-primary-600":"bg-white text-gray-900 dark:bg-gray-800 dark:text-white hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-700 dark:hover:text-primary-500 focus:text-primary-700 dark:focus:text-primary-500"),a(2),m("ngClass",n.activeChartTimeRange===n.ChartTimeRange.ONE_WEEK?"bg-primary-700 text-white dark:bg-primary-600":"bg-white text-gray-900 dark:bg-gray-800 dark:text-white hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-700 dark:hover:text-primary-500 focus:text-primary-700 dark:focus:text-primary-500"),a(2),m("ngClass",n.activeChartTimeRange===n.ChartTimeRange.ONE_MONTH?"bg-primary-700 text-white dark:bg-primary-600":"bg-white text-gray-900 dark:bg-gray-800 dark:text-white hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-700 dark:hover:text-primary-500 focus:text-primary-700 dark:focus:text-primary-500"),a(2),m("ngClass",n.activeChartTimeRange===n.ChartTimeRange.THREE_MONTHS?"bg-primary-700 text-white dark:bg-primary-600":"bg-white text-gray-900 dark:bg-gray-800 dark:text-white hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-700 dark:hover:text-primary-500 focus:text-primary-700 dark:focus:text-primary-500"),a(2),m("ngClass",n.activeChartTimeRange===n.ChartTimeRange.SIX_MONTHS?"bg-primary-700 text-white dark:bg-primary-600":"bg-white text-gray-900 dark:bg-gray-800 dark:text-white hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-700 dark:hover:text-primary-500 focus:text-primary-700 dark:focus:text-primary-500"),a(2),m("ngClass",n.activeChartTimeRange===n.ChartTimeRange.ONE_YEAR?"bg-primary-700 text-white dark:bg-primary-600":"bg-white text-gray-900 dark:bg-gray-800 dark:text-white hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-700 dark:hover:text-primary-500 focus:text-primary-700 dark:focus:text-primary-500"),a(2),m("ngClass",n.activeChartTimeRange===n.ChartTimeRange.FIVE_YEAR?"bg-primary-700 text-white dark:bg-primary-600":"bg-white text-gray-900 dark:bg-gray-800 dark:text-white hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-700 dark:hover:text-primary-500 focus:text-primary-700 dark:focus:text-primary-500"),a(2),m("ngClass",n.isChartInFullscreen?"flex-1":"w-full h-80"),a(2),k(n.isChartLoading?39:-1),a(),k(n.isChartNoData?40:-1),a(),m("ngClass",n.isChartInFullscreen?"block bottom-2 right-3":"block sm:hidden bottom-1 right-1"),a(2),k(n.isChartInFullscreen?43:44),a(11),u(" ",d(55,73,e.quote==null?null:e.quote.open,"1.2-2")," "),a(5),u(" ",d(60,76,e.quote==null?null:e.quote.close,"1.2-2")," "),a(8),I(d(68,79,e.quote==null?null:e.quote.low,"1.2-2")),a(3),I(d(71,82,e.quote==null?null:e.quote.high,"1.2-2")),a(5),m("min",e.quote==null?null:e.quote.low)("max",e.quote==null?null:e.quote.high)("value",e.quote==null?null:e.quote.value),a(8),u(" ",d(84,85,e.quote==null?null:e.quote.fiftyTwoWeekLow,"1.2-2")," "),a(3),I(d(87,88,e.quote==null?null:e.quote.fiftyTwoWeekHigh,"1.2-2")),a(5),m("min",e.quote==null?null:e.quote.fiftyTwoWeekLow)("max",e.quote==null?null:e.quote.fiftyTwoWeekHigh)("value",e.quote==null?null:e.quote.value),a(9),u("",e.quote==null||e.quote.advance==null?null:e.quote.advance.value," Advances"),a(2),u("",e.quote==null||e.quote.decline==null?null:e.quote.decline.value," Declines"),a(2),le("width",(e.quote==null||e.quote.advance==null?null:e.quote.advance.percentage)+"%"),L("rounded-r",!(!(e.quote==null||e.quote.decline==null)&&e.quote.decline.percentage)),a(3),u("",d(108,91,e.quote==null||e.quote.advance==null?null:e.quote.advance.percentage,"1.2-2"),"%"),a(3),u("",d(111,94,e.quote==null||e.quote.decline==null?null:e.quote.decline.percentage,"1.2-2"),"%"),a(7),m("ngClass",(e.performance==null||e.performance.monthly==null?null:e.performance.monthly.direction)===n.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(4),E(" ",(e.performance==null||e.performance.monthly==null?null:e.performance.monthly.direction)===n.Direction.UP?"\u25B2":"\u25BC"," ",d(122,97,e.performance==null||e.performance.monthly==null?null:e.performance.monthly.percentage,"1.2-2"),"% "),a(2),m("ngClass",(e.performance==null||e.performance.quarterly==null?null:e.performance.quarterly.direction)===n.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(4),E(" ",(e.performance==null||e.performance.quarterly==null?null:e.performance.quarterly.direction)===n.Direction.UP?"\u25B2":"\u25BC"," ",d(128,100,e.performance==null||e.performance.quarterly==null?null:e.performance.quarterly.percentage,"1.2-2"),"% "),a(2),m("ngClass",(e.performance==null||e.performance.halfYearly==null?null:e.performance.halfYearly.direction)===n.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(4),E(" ",(e.performance==null||e.performance.halfYearly==null?null:e.performance.halfYearly.direction)===n.Direction.UP?"\u25B2":"\u25BC"," ",d(134,103,e.performance==null||e.performance.halfYearly==null?null:e.performance.halfYearly.percentage,"1.2-2"),"% "),a(3),m("ngClass",(e.performance==null||e.performance.yearly==null||e.performance.yearly.one==null?null:e.performance.yearly.one.direction)===n.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(4),E(" ",(e.performance==null||e.performance.yearly==null||e.performance.yearly.one==null?null:e.performance.yearly.one.direction)===n.Direction.UP?"\u25B2":"\u25BC"," ",d(141,106,e.performance==null||e.performance.yearly==null||e.performance.yearly.one==null?null:e.performance.yearly.one.percentage,"1.2-2"),"% "),a(2),m("ngClass",(e.performance==null||e.performance.yearly==null||e.performance.yearly.three==null?null:e.performance.yearly.three.direction)===n.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(4),E(" ",(e.performance==null||e.performance.yearly==null||e.performance.yearly.three==null?null:e.performance.yearly.three.direction)===n.Direction.UP?"\u25B2":"\u25BC"," ",d(147,109,e.performance==null||e.performance.yearly==null||e.performance.yearly.three==null?null:e.performance.yearly.three.percentage,"1.2-2"),"% "),a(2),m("ngClass",(e.performance==null||e.performance.yearly==null||e.performance.yearly.five==null?null:e.performance.yearly.five.direction)===n.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(4),E(" ",(e.performance==null||e.performance.yearly==null||e.performance.yearly.five==null?null:e.performance.yearly.five.direction)===n.Direction.UP?"\u25B2":"\u25BC"," ",d(153,112,e.performance==null||e.performance.yearly==null||e.performance.yearly.five==null?null:e.performance.yearly.five.percentage,"1.2-2"),"% "),a(5),k(e.constituents&&e.constituents.length>0?157:-1)}}function He(c,l){c&1&&(i(0,"div",3),w(),i(1,"svg",53),x(2,"path",54)(3,"path",55),t(),B(),i(4,"span",56),r(5,"Loading..."),t()())}var g=function(c){return c.ONE_DAY="1D",c.ONE_WEEK="1W",c.ONE_MONTH="1M",c.THREE_MONTHS="3M",c.SIX_MONTHS="6M",c.ONE_YEAR="1Y",c.FIVE_YEAR="5Y",c}(g||{}),ke=class K{constructor(l,e,n,o){this.document=l,this.cdr=e,this.exchange=A(""),this.id=A(""),this.activeChartTimeRange=g.ONE_DAY,this.activeExchange=$.NSE,this.isChartLoading=!0,this.isChartInFullscreen=!1,this.isChartNoData=!1,this.Routes=ye.routes,this.Exchange=$,this.Direction=D,this.ChartTimeRange=g,this.showIntraDayChart$=new X(!0),this.isMarketOpen=!1,n.marketStatus$.pipe(R(this)).subscribe(({status:h})=>{this.isMarketOpen=h===Ce.OPEN}),this.index$=J([z(this.exchange),z(this.id)]).pipe(H(([h,V])=>n.getIndex(V,h,!0)),P(h=>{if(h&&!this.chart){let V=n.getIntraDayChart(h.id,W.INDEX),Ee=n.getHistoricalChart(h.id,W.INDEX).pipe(P(S=>{S.length>0&&(this.historicChartData=S.reduce((v,Q)=>(v.set(Q.time,Q),v),new Map))}));this.showIntraDayChart$.pipe(ie(),P(()=>{this.chart&&(this.chart.clearCrosshairPosition(),this.chart.applyOptions({timeScale:{visible:!1},rightPriceScale:{visible:!1}}),this.areaSeries&&this.areaSeries.setData([])),this.isChartLoading=!0}),H(S=>S?V.pipe(R(this)):Ee.pipe(ee(1)))).pipe(te(100)).subscribe(S=>{S.length>0?(this.isChartNoData=!1,this.initChart(S),this.areaSeries&&this.areaSeries.applyOptions({lineColor:h.quote?.change?.direction?h.quote.change.direction===D.UP?"#22c55e":"#ef4444":"#2962FF",topColor:h.quote?.change?.direction?h.quote.change.direction===D.UP?"rgba(34, 197, 94, 0.4)":"rgba(239, 68, 68, 0.4)":"rgba(41, 98, 255, 0.4)",bottomColor:h.quote?.change?.direction?h.quote.change.direction===D.UP?"rgba(34, 197, 94, 0.1)":"rgba(239, 68, 68, 0.1)":"rgba(41, 98, 255, 0.1)"}),o.resize$.pipe(R(this)).subscribe(()=>{this.chart&&this.chartRef&&(this.chart.resize(this.chartRef.nativeElement.offsetWidth,this.chartRef.nativeElement.offsetHeight),this.chart.timeScale().fitContent(),this.setChartTimeRange(this.activeChartTimeRange))}),o.settings$.pipe(R(this),ne("colorScheme")).subscribe(({colorScheme:v})=>{v&&this.chart&&this.chart.applyOptions({layout:{textColor:v===T.DARK?"#fff":"#111827"},timeScale:{visible:!0,borderColor:v===T.DARK?"#374151":"#E5E7EB"},rightPriceScale:{visible:!0,borderColor:v===T.DARK?"#374151":"#E5E7EB"},crosshair:{horzLine:{labelBackgroundColor:v===T.DARK?"#111827":"#f3f4f6"},vertLine:{labelBackgroundColor:v===T.DARK?"#111827":"#f3f4f6"}}})})):this.isChartNoData=!0,this.isChartLoading=!1,this.cdr.markForCheck()})}}))}setChartTimeRange(l){if(l){if(this.activeChartTimeRange=l,this.showIntraDayChart$.next(l===g.ONE_DAY),l!==g.ONE_DAY){let e=new Date,n;switch(l){case g.ONE_WEEK:n=b.getTimestampSince(e,10);break;case g.ONE_MONTH:n=b.getTimestampSince(e,30);break;case g.THREE_MONTHS:n=b.getTimestampSince(e,90);break;case g.SIX_MONTHS:n=b.getTimestampSince(e,180);break;case g.ONE_YEAR:n=b.getTimestampSince(e,365);break;case g.FIVE_YEAR:n=b.getTimestampSince(e,5*356);break;default:console.warn(`Invalid range: ${l}`)}this.chart&&n>0&&(this.chart.applyOptions({timeScale:{timeVisible:!1}}),this.areaSeries&&this.areaSeries.applyOptions({lastPriceAnimation:0}),this.areaSeries&&this.areaSeries.data().length>0&&this.chart.timeScale().setVisibleRange({from:b.epochToUtcTimestamp(n),to:b.epochToUtcTimestamp(e.getTime())}));return}this.chart&&(this.chart.applyOptions({timeScale:{timeVisible:!0}}),this.areaSeries&&this.areaSeries.applyOptions({lastPriceAnimation:this.isMarketOpen?1:0}),this.chart.timeScale().setVisibleLogicalRange({from:0,to:375}))}}onFullscreenChange(){this.document.fullscreenElement?this.isChartInFullscreen=!0:this.isChartInFullscreen=!1,this.chart&&this.chartRef&&(this.chart.resize(this.chartRef.nativeElement.offsetWidth,this.chartRef.nativeElement.offsetHeight),this.chart.timeScale().fitContent(),this.setChartTimeRange(this.activeChartTimeRange))}toggleFullscreen(){this.document.fullscreenElement?this.document.exitFullscreen():this.chartContainerRef&&this.chartContainerRef.nativeElement.requestFullscreen().then(()=>{screen.orientation.lock("landscape").catch(l=>{console.error(`An error occurred while trying to lock screen orientation to landscape: ${l.message} (${l.name})`)}),this.cdr.markForCheck()}).catch(l=>{console.error(`An error occurred while trying to switch into fullscreen mode: ${l.message} (${l.name})`)})}ngOnDestroy(){this.chart&&this.chart.unsubscribeCrosshairMove(this.chartCrosshairMoveEventHandler.bind(this))}initChart(l){if(this.chartRef?.nativeElement){let e=this.showIntraDayChart$.getValue();this.chart||(this.chart=_e(this.chartRef.nativeElement,{layout:{background:{color:"transparent"}},grid:{horzLines:{visible:!1},vertLines:{visible:!1}},handleScroll:!1,handleScale:!1,timeScale:{lockVisibleTimeRangeOnResize:!0,timeVisible:e,secondsVisible:!1}}),this.areaSeries=this.chart.addAreaSeries({lineWidth:1})),this.areaSeries||(this.areaSeries=this.chart.addAreaSeries({lineWidth:1,lastPriceAnimation:this.isMarketOpen&&e?1:0})),this.areaSeries.setData(l),this.setChartTimeRange(this.activeChartTimeRange),this.chart.subscribeCrosshairMove(this.chartCrosshairMoveEventHandler.bind(this))}}chartCrosshairMoveEventHandler({time:l}){l&&this.historicChartData&&this.historicChartData.size>0?this.chartCrosshairData=this.historicChartData.get(l.toLocaleString()):this.chartCrosshairData=void 0,this.cdr.markForCheck()}static{this.\u0275fac=function(e){return new(e||K)(q(ue),q(M),q(N),q(O))}}static{this.\u0275cmp=ae({type:K,selectors:[["app-indices"]],viewQuery:function(e,n){if(e&1&&(F(Se,5),F(we,5)),e&2){let o;U(o=Y())&&(n.chartContainerRef=o.first),U(o=Y())&&(n.chartRef=o.first)}},hostBindings:function(e,n){e&1&&f("fullscreenchange",function(){return n.onFullscreenChange()},!1,re)},inputs:{exchange:[1,"exchange"],id:[1,"id"]},decls:4,vars:3,consts:[["chartContainer",""],["chart",""],[1,"flex","h-full","flex-col"],["role","status",1,"flex","flex-1","items-center","justify-center"],[1,"space-y-2","p-4"],[1,"flex","space-x-4"],[1,"flex-1","text-2xl","font-semibold"],[1,"me-2","rounded","bg-gray-100","px-1.5","py-0.5","text-xs","font-medium","text-gray-800","dark:bg-gray-700","dark:text-gray-300"],[1,"text-gray-900","dark:text-white"],[1,"text-lg","font-semibold"],[1,"flex","items-center",3,"ngClass"],[1,"flex","flex-col"],[1,"relative","flex","flex-1","flex-col","bg-white","py-4","dark:bg-gray-800",3,"ngClass"],[1,"flex","max-w-full","px-4","pb-4"],[1,"flex","h-8","min-w-36","max-w-36","flex-col","pe-2","text-xs","text-gray-900","md:max-w-none","md:flex-row","md:space-x-3","md:pe-4","dark:text-white"],[1,"flex","flex-1","justify-end"],["role","group",1,"inline-flex","h-8","rounded-md","shadow-sm"],["type","button",1,"focus:ring-primary-700","dark:focus:ring-primary-500","inline-flex","h-8","w-8","items-center","justify-center","rounded-s-lg","border","border-r-0","border-gray-200","text-xs","focus:z-10","focus:ring-2","dark:border-gray-700",3,"click","ngClass"],["type","button",1,"focus:ring-primary-700","dark:focus:ring-primary-500","inline-flex","h-8","w-8","items-center","justify-center","border","border-r-0","border-gray-200","text-xs","focus:z-10","focus:ring-2","dark:border-gray-700",3,"click","ngClass"],["type","button",1,"focus:ring-primary-700","dark:focus:ring-primary-500","inline-flex","h-8","w-8","items-center","justify-center","rounded-e-lg","border","border-gray-200","text-xs","focus:z-10","focus:ring-2","dark:border-gray-700",3,"click","ngClass"],[3,"ngClass"],["role","status",1,"flex","h-full","flex-1","items-center","justify-center"],["role","status",1,"flex","h-full","flex-col","items-center","justify-center","text-gray-500","dark:text-gray-400"],[1,"absolute",3,"ngClass"],["type","button",1,"rounded-lg","p-2","text-gray-500","hover:bg-gray-100","hover:text-gray-900","dark:text-gray-400","dark:hover:bg-gray-700","dark:hover:text-white",3,"click"],[1,"grid","grid-cols-1","gap-4","p-4","sm:grid-cols-2","xl:grid-cols-3"],[1,"flex-1","rounded-lg","border","border-gray-200","bg-white","p-4","shadow","dark:border-gray-700","dark:bg-gray-800"],[1,"mb-4","text-xl","font-semibold","leading-none","text-gray-900","dark:text-white"],[1,"flex","space-x-10","text-sm","text-gray-900","dark:text-white"],[1,"flex","flex-col","space-y-4"],[1,"flex-1"],[1,"pb-1","text-xs","text-gray-500","dark:text-gray-400"],[1,"flex","flex-1","flex-col","space-y-4"],[1,"flex","text-xs"],[1,"flex","items-center"],[1,"text-xs","font-bold","text-red-600","dark:text-red-500"],["type","range","disabled","",1,"slider","mx-1","h-1","flex-1","appearance-none","rounded-lg","bg-gray-200","dark:bg-gray-700",3,"min","max","value"],[1,"text-xs","font-bold","text-green-500","dark:text-green-400"],[1,"flex","flex-col","rounded-lg","border","border-gray-200","bg-white","p-4","shadow","dark:border-gray-700","dark:bg-gray-800"],[1,"flex","flex-1","flex-col","justify-center"],[1,"flex","w-full","justify-between","text-sm","text-gray-900","dark:text-white"],[1,"my-3","h-2","w-full","rounded-full","bg-red-600","dark:bg-red-500"],[1,"h-2","rounded-l","bg-green-500","dark:bg-green-400"],[1,"flex","flex-col","space-y-4","text-sm"],[1,"flex","justify-between"],[1,"flex-1",3,"ngClass"],[1,"flex"],[1,"mb-4","sm:mx-4"],[1,"p-4","text-xl","font-semibold","leading-none","text-gray-900","sm:mx-0","dark:text-white"],[1,"relative","overflow-x-auto","shadow","sm:rounded-lg"],[1,"flex","md:flex-col"],[1,"text-gray-500","dark:text-gray-400"],[1,"flex","whitespace-nowrap","md:flex-col",3,"ngClass"],["aria-hidden","true","viewBox","0 0 100 101","fill","none","xmlns","http://www.w3.org/2000/svg",1,"h-8","w-8","animate-spin","fill-blue-600","text-gray-200","dark:text-gray-600"],["d","M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z","fill","currentColor"],["d","M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z","fill","currentFill"],[1,"sr-only"],["aria-hidden","true","xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 20 20",1,"mx-auto","mb-4","h-12","w-12"],["stroke","currentColor","stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"],["aria-hidden","true","xmlns","http://www.w3.org/2000/svg","width","24","height","24","fill","none","viewBox","0 0 24 24",1,"h-6","w-6"],["stroke","currentColor","stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M5 9h4m0 0V5m0 4L4 4m15 5h-4m0 0V5m0 4 5-5M5 15h4m0 0v4m0-4-5 5m15-5h-4m0 0v4m0-4 5 5"],["stroke","currentColor","stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M8 4H4m0 0v4m0-4 5 5m7-5h4m0 0v4m0-4-5 5M8 20H4m0 0v-4m0 4 5-5m7 5h4m0 0v-4m0 4-5-5"],[1,"w-screen","text-left","text-sm","text-gray-500","sm:w-full","rtl:text-right","dark:text-gray-400"],["width","100%"],["width","0%"],[1,"whitespace-nowrap","bg-gray-50","text-center","text-xs","uppercase","text-gray-700","dark:bg-gray-700","dark:text-gray-400"],["scope","col",1,"p-2","text-left","sm:p-4"],[1,"whitespace-nowrap"],["scope","col",1,"p-2","sm:p-4"],[1,"cursor-pointer","border-b","bg-white","dark:border-gray-700","dark:bg-gray-800",3,"routerLink"],["scope","row",1,"max-w-[1px]","p-2","font-normal","sm:p-4"],[1,"truncate","font-medium","text-gray-900","dark:text-white"],[1,"p-2","text-center","sm:p-4"],[1,"pt-1.5","text-xs"],[1,"p-2","text-center","sm:p-4",3,"ngClass"]],template:function(e,n){if(e&1&&(i(0,"div",2),_(1,Ve,158,115),s(2,"async"),_(3,He,6,0,"div",3),t()),e&2){let o;a(),k((o=j(2,1,n.index$))?1:3,o)}},dependencies:[fe,pe,he,ge,xe,ve],styles:[".slider[_ngcontent-%COMP%]::-moz-range-thumb{height:.625rem;width:.125rem;cursor:default;border-radius:0}.slider[_ngcontent-%COMP%]::-webkit-slider-thumb{height:.625rem;width:.125rem;cursor:default;border-radius:0}"],changeDetection:0})}};ke=G([be(),Z("design:paramtypes",[Document,M,N,O])],ke);export{ke as IndicesPage};