PageSourceSearch

https://fireant.vn/_next/static/chunks/pages/ma-chung-khoan/[symbol]-aee0ce756ff6bf61.js

js fireant.vn collected 2026-09-24 18:09:25 UTC 178,280 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[816,4102,9837],{50266:function(e,l,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/ma-chung-khoan/[symbol]",function(){return t(63926)}])},84165:function(e,l,t){"use strict";var s=t(85893),a=t(66284),i=t(67294),r=t(17294),n=t(30381),o=t.n(n),d=t(65959),c=t(12902),x=t(60588),u={backgroundColor:"transparent",tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(e){return"Ng\xe0y: ".concat(e[0].axisValue,"<br />Gi\xe1 trị mua r\xf2ng: ").concat(e[0].value.toFixed(2)," tỷ")}},grid:{top:10,bottom:0,left:14,right:10,containLabel:!0},visualMap:[{show:!1,pieces:[{gte:0,color:"rgb(38, 166, 154)"},{lt:0,color:"rgb(239, 83, 80)"}]}],xAxis:{type:"category",triggerEvent:!0,axisTick:{show:!1},data:{textStyle:{fontSize:10}}},yAxis:{type:"value",position:"right",axisLine:{show:!1},axisTick:{show:!1},show:!0,splitLine:{lineStyle:{type:"dashed"}}},series:[{data:[],barWidth:18,type:"bar"}]};let m=i.memo(e=>{let{symbol:l}=e,{resolvedTheme:t}=(0,d.F)(),[n,m]=i.useState(u),[h]=(0,r.useForeignerStats)(l),{historicalQuotes:f,requestHistoricalQuotes:g}=(0,x.HH)(l),[b,v]=i.useState([]);return i.useEffect(()=>{let e=o()().startOf("day").toDate(),l=o()().startOf("day").toDate();l.setMonth(l.getMonth()-1),g(l,e,0,10)},[l,g]),i.useEffect(()=>{if(f&&h&&f.length>0){let e=[...f];e=e.slice(0,10);let l=new Date(f[0].date);l.getFullYear()==h.date.getFullYear()&&l.getMonth()==h.date.getMonth()&&l.getDate()==h.date.getDate()&&(e=(0,c.ZP)(e,e=>{e[0].buyForeignQuantity=h.buyForeignQuantity,e[0].sellForeignQuantity=h.sellForeignQuantity,e[0].buyForeignValue=h.buyForeignValue,e[0].sellForeignValue=h.sellForeignValue,e[0].currentForeignRoom=h.currentForeignRoom})),v(e)}},[f,h]),i.useEffect(()=>{let e=b.map(e=>o()(e.date).format("DD/MM")).reverse(),l=b.map(e=>(e.buyForeignValue-e.sellForeignValue)/1e9).reverse(),t=(0,c.ZP)(n,t=>{t.xAxis.data=e,t.series[0].data=l});m(t)},[b]),(0,s.jsx)(a.default,{option:n,theme:t,style:{flex:1,width:"100%",height:"100%"}})});l.Z=m},35200:function(e,l,t){"use strict";var s=t(85893),a=t(66284),i=t(65959),r=t(67294),n={backgroundColor:"transparent",grid:{top:0,bottom:0,right:0,left:0},visualMap:[{show:!1,pieces:[{gte:0,color:"rgb(38, 166, 154)"},{lt:0,color:"rgb(239, 83, 80)"}]}],xAxis:{type:"category",show:!1},yAxis:{type:"value",show:!1},series:[{data:[],type:"bar"}]};let o=r.memo(e=>{let{data:l,style:t}=e,{resolvedTheme:o}=(0,i.F)(),[d,c]=r.useState(n);return r.useEffect(()=>{let e=Object.assign({},d);e.series=[...e.series],e.series[0]=Object.assign({},e.series[0]),e.series[0].data=l,c(e)},[l]),(0,s.jsx)(a.default,{option:d,theme:o,style:t})});l.Z=o},92975:function(e,l,t){"use strict";var s=t(85893),a=t(67294),i=t(17294),r=t(65959),n=t(5152),o=t.n(n);let d=o()(()=>Promise.all([t.e(770),t.e(6284)]).then(t.bind(t,66284)),{loadableGenerated:{webpack:()=>[66284]},ssr:!1});var c={backgroundColor:"transparent",animation:!1,grid:{top:3,bottom:3,left:3,right:3},visualMap:[{show:!1,pieces:[{gte:1,color:"rgb(38, 166, 154)"},{lt:1,gt:0,color:"rgb(239, 83, 80)"}]}],xAxis:{type:"category",data:[],show:!1},yAxis:{type:"value",scale:!0,show:!1},series:[{type:"line",smooth:!1,symbol:"none",data:[],markLine:{silent:!0,symbol:"none",data:[]},markPoint:{data:[]}}]};let x=a.memo(e=>{let{symbol:l,style:t}=e,{resolvedTheme:n}=(0,r.F)(),[o]=(0,i.useIntradayBars)(l,5),[x]=(0,i.usePrice)(l),[u,m]=a.useState(c),h=a.useRef(null),[f,g]=a.useState(!1);return a.useEffect(()=>{let e=h.current;if(!e)return;let l=()=>{let l=e.clientWidth>0&&e.clientHeight>0;g(e=>e!==l?l:e)};if(l(),"undefined"==typeof ResizeObserver)return;let t=new ResizeObserver(l);return t.observe(e),()=>t.disconnect()},[]),a.useEffect(()=>{if(o){let e=Object.assign({},u);e.xAxis=Object.assign({},e.xAxis),e.xAxis.data=o.map(e=>e.date),e.series=[...e.series],e.series[0]=Object.assign({},e.series[0]),e.series[0].data=o.map(e=>e.close),o.length>0&&(e.series[0].markPoint=Object.assign({},e.series[0].markPoint),e.series[0].markPoint.data=[{symbol:"circle",symbolSize:6,coord:[o.length-1,o[o.length-1].close],itemStyle:x?{color:o[o.length-1].close>=(null==x?void 0:x.basic)?"rgb(38, 166, 154)":"rgb(239, 83, 80)"}:void 0}]),x&&(e.visualMap=[...e.visualMap],e.visualMap[0]=Object.assign({},e.visualMap[0]),e.visualMap[0].pieces=[...e.visualMap[0].pieces],e.visualMap[0].pieces[0]=Object.assign({},e.visualMap[0].pieces[0]),e.visualMap[0].pieces[1]=Object.assign({},e.visualMap[0].pieces[1]),e.visualMap[0].pieces[0].gte=x.basic,e.visualMap[0].pieces[1].lt=x.basic,e.series[0].markLine=Object.assign({},e.series[0].markLine),e.series[0].markLine.data=[{symbol:"none",yAxis:x.basic,lineStyle:{type:"solid",color:"#ccaa00"},label:{show:!1}}]),m(e)}},[null==x?void 0:x.basic,o]),(0,s.jsx)("div",{ref:h,style:t,children:f&&(0,s.jsx)(d,{option:u,theme:n,style:{width:"100%",height:"100%"},notMerge:!0,lazyUpdate:!0,opts:{renderer:"canvas"}})})});l.Z=x},90175:function(e,l,t){"use strict";var s=t(85893),a=t(67294),i=t(66284),r=t(12902),n=t(65959),o=t(49460),d={backgroundColor:"transparent",title:{text:"",textStyle:{fontFamily:"sans-serif"}},legend:{textStyle:{fontFamily:"sans-serif"},bottom:0},tooltip:{trigger:"axis",textStyle:{fontFamily:"sans-serif"}},grid:{top:40,bottom:50,right:"3%",left:14,containLabel:!0},xAxis:{type:"category",data:[],nameTextStyle:{fontFamily:"sans-serif"}},yAxis:[{scale:!1,splitLine:{lineStyle:{type:"dashed",color:"rgba(100, 100, 100, 0.1)"}},name:"Tỷ VNĐ  ",nameTextStyle:{align:"right",fontFamily:"sans-serif"}},{show:!1}],series:[{type:"bar",name:"",data:[],tooltip:{valueFormatter:function(e){return new Intl.NumberFormat().format(e.toFixed(2))}}},{type:"bar",name:"",data:[],tooltip:{valueFormatter:function(e){return new Intl.NumberFormat().format(e.toFixed(2))}}},{type:"bar",name:"",data:[],tooltip:{valueFormatter:function(e){return new Intl.NumberFormat().format(e.toFixed(2))}}}]};let c=a.memo(e=>{let{title:l,category:t,data1:c,data2:x,data3:u,name1:m,name2:h,name3:f,style:g,data1Type:b,data2Type:v,data3Type:p,useSecondYAxis:j,displaySecondYAxis:y}=e,{resolvedTheme:N}=(0,n.F)(),[w,k]=a.useState(d),C=(0,o.ac)("(max-width : 768px)");return a.useEffect(()=>{let e=(0,r.ZP)(w,e=>{var s;e.title.text=l,e.xAxis.data=t,e.series[0].data=null!=c?c:[],e.series[0].type=null!=b?b:"bar",e.series[0].name=m,e.series[1].data=null!=x?x:[],e.series[1].type=null!=v?v:"bar",e.series[1].name=h,e.series[2].data=null!=u?u:[],e.series[2].type=null!=p?p:"line",e.series[2].name=f,e.tooltip={...null!==(s=e.tooltip)&&void 0!==s?s:{},show:!C},j&&"line"===p?(e.series[1].yAxisIndex=0,e.series[2].yAxisIndex=1,e.series[2].itemStyle={color:"#f2e900"},e.series[2].label={show:!0,textStyle:{fontSize:10},position:"top",formatter:e=>"".concat(e.value.toFixed(2)," %")}):(e.series[1].yAxisIndex=0,e.series[2].yAxisIndex=0),y||(e.yAxis[1].axisLabel={show:!1})});k(e)},[C,t,c,b,x,v,u,p,m,h,f,j]),(0,s.jsx)(i.default,{option:w,theme:N,style:{width:"100%",height:"100%",...g}})});l.Z=c},88908:function(e,l,t){"use strict";var s,a,i,r,n=t(77260);
1s="#ddd",a=function(){return{axisLine:{lineStyle:{color:s}},axisTick:{lineStyle:{color:s}},axisLabel:{textStyle:{color:s}},splitLine:{lineStyle:{type:"dashed",color:"#444"}},splitArea:{areaStyle:{color:s}}}},(r={backgroundColor:"#ff0000",color:i=["#dd6b66","#759aa0","#8dc1a9","#ea7e53","#eedd78","#73a373","#73b9bc","#7289ab","#91ca8c","#f49f42"],tooltip:{axisPointer:{label:{color:"#111"},lineStyle:{color:s},crossStyle:{color:s}}},legend:{textStyle:{color:s}},textStyle:{color:s,fontFamily:"sans-serif"},title:{textStyle:{color:s}},toolbox:{iconStyle:{normal:{borderColor:s}}},dataZoom:{textStyle:{color:s},fillerColor:"rgba(0, 0, 0, 0.2)",dataBackground:{lineStyle:{color:"white"},areaStyle:{color:"rgba(255, 255, 255, 0.3)"}}},timeline:{lineStyle:{color:s},itemStyle:{normal:{color:i[1]}},label:{normal:{textStyle:{color:s}}},controlStyle:{normal:{color:s,borderColor:s}}},timeAxis:a(),logAxis:a(),valueAxis:a(),categoryAxis:a(),line:{symbol:"circle"},graph:{color:i},gauge:{title:{textStyle:{color:s}}},candlestick:{itemStyle:{normal:{color:"#d75442",color0:"#6ba583",borderColor:"#d75442",borderColor0:"#6ba583"}}}}).categoryAxis.splitLine.show=!1,n.registerTheme("dark",r)},21552:function(e,l,t){"use strict";var s=t(85893),a=t(67294),i=t(41664),r=t.n(i),n=t(82701),o=t(6972);let d={primary:{bar:"bg-gradient-to-b from-sky-500 to-indigo-500",iconBg:"bg-sky-500/10 ring-1 ring-inset ring-sky-500/20",icon:"text-sky-500"},rose:{bar:"bg-gradient-to-b from-rose-500 to-pink-500",iconBg:"bg-rose-500/10 ring-1 ring-inset ring-rose-500/20",icon:"text-rose-500"},amber:{bar:"bg-gradient-to-b from-amber-400 to-orange-500",iconBg:"bg-amber-500/10 ring-1 ring-inset ring-amber-500/20",icon:"text-amber-500"},emerald:{bar:"bg-gradient-to-b from-emerald-400 to-teal-500",iconBg:"bg-emerald-500/10 ring-1 ring-inset ring-emerald-500/20",icon:"text-emerald-500"},violet:{bar:"bg-gradient-to-b from-violet-500 to-fuchsia-500",iconBg:"bg-violet-500/10 ring-1 ring-inset ring-violet-500/20",icon:"text-violet-500"},sky:{bar:"bg-gradient-to-b from-sky-400 to-cyan-500",iconBg:"bg-sky-500/10 ring-1 ring-inset ring-sky-500/20",icon:"text-sky-500"},indigo:{bar:"bg-gradient-to-b from-indigo-500 to-blue-500",iconBg:"bg-indigo-500/10 ring-1 ring-inset ring-indigo-500/20",icon:"text-indigo-500"}},c=a.memo(function(e){let{title:l,description:t,icon:a,tone:i="primary",badge:c,href:x,hrefTarget:u="_self",actionLabel:m="Xem th\xeam",onAction:h,rightSlot:f,className:g,size:b="md"}=e,v=d[i],p=(0,s.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:(0,o.cn)("h-6 w-1 rounded-full shrink-0",v.bar,"sm"===b&&"h-5")}),a&&(0,s.jsx)("span",{className:(0,o.cn)("flex h-9 w-9 items-center justify-center rounded-xl shrink-0",v.iconBg,"sm"===b&&"h-8 w-8"),children:(0,s.jsx)(a,{className:(0,o.cn)("h-4 w-4",v.icon)})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)("h2",{className:(0,o.cn)("truncate font-semibold tracking-tight text-foreground","md"===b?"text-lg md:text-xl":"text-base"),children:l}),c]}),t&&(0,s.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground line-clamp-1",children:t})]})]});return(0,s.jsxs)("div",{className:(0,o.cn)("flex items-center justify-between gap-3",g),children:[p,(0,s.jsx)("div",{className:"flex items-center gap-2 shrink-0",children:f||(x?(0,s.jsxs)(r(),{href:x,target:u,className:"group inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-xs font-medium text-sky-600 transition-colors hover:bg-sky-500/10 dark:text-sky-300",children:[m,(0,s.jsx)(n.Z,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-0.5"})]}):h?(0,s.jsxs)("button",{type:"button",onClick:h,className:"group inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-xs font-medium text-sky-600 transition-colors hover:bg-sky-500/10 dark:text-sky-300",children:[m,(0,s.jsx)(n.Z,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-0.5"})]}):null)})]})});l.Z=c},94379:function(e,l,t){"use strict";var s=t(85893),a=t(67294),i=t(89688),r=t(77199);let n=a.memo(e=>{let{posts:l,onViewMore:t}=e;return(0,a.useCallback)((e,l)=>(0,s.jsx)(i.Z,{post:l,large:!0},l.postID),[]),(0,a.useCallback)(()=>(0,s.jsx)("div",{className:"flex flex-row items-center justify-center",children:(0,s.jsx)(r.z,{variant:"outline",onClick:t,children:"Xem tiếp"})}),[]),(0,s.jsxs)(s.Fragment,{children:[l.map(e=>(0,s.jsx)(i.Z,{post:e,large:!0},e.postID)),(0,s.jsx)("div",{className:"flex flex-row items-center justify-center",children:(0,s.jsx)(r.z,{variant:"outline",onClick:t,children:"Xem tiếp"})})]})});l.Z=n},81811:function(e,l,t){"use strict";
1var s=t(85893),a=t(67294),i=t(23591),r=t(43329),n=t(10683),o=t(26246),d=t(11163),c=t(17294);let x=a.memo(e=>{let{symbols:l,columns:t,onRowRemove:x,sortKey:u,style:m,useWindowScroll:h=!0,headerStickyTop:f,sortColumn:g,sortDirection:b,onSortChange:v,sortableColumns:p}=e,j=(0,d.useRouter)(),y=(0,n.pCp)("quotes",0),N=(0,c.useSortedSymbols)(l,u),w=(0,a.useCallback)((e,l)=>(0,s.jsx)(i.Z,{symbol:l,columns:t,index:e,onRemove:x}),[l,t]),k=(0,a.useCallback)(e=>{y.current=e.startIndex},[]),C=a.useCallback(e=>{e.indexOf("|")>=0||j.push((0,n.BDV)(e))},[]);return(0,s.jsx)(o._n,{style:m,useWindowScroll:h,rangeChanged:k,initialTopMostItemIndex:y.current,data:N,components:{Table:e=>{let{style:l,...t}=e;return(0,s.jsx)("table",{...t,style:{...l,width:"100%"},className:"text-[90%] md:text-[90%]",cellPadding:4})},TableHead:a.forwardRef(function(e,l){let{style:t,...a}=e;return(0,s.jsx)("thead",{...a,ref:l,style:{...t,top:"var(--market-sticky-top, ".concat(null!=f?f:0,"px)")}})}),TableRow:e=>(0,s.jsx)("tr",{...e,onClick:()=>C(e.item),style:{height:e.item.indexOf("|")>=0?38:60},className:"cursor-pointer border-b border-border/40 transition-colors hover:bg-muted/40"})},fixedHeaderContent:()=>(0,s.jsx)("tr",{className:"border-b border-border/60 bg-muted",children:(0,s.jsx)(r.Z,{columns:t,sortColumn:g,sortDirection:b,onSortChange:v,sortableColumns:p})}),itemContent:w})});l.Z=x},24102:function(e,l,t){"use strict";t.r(l);var s=t(85893),a=t(67294),i=t(10683),r=t(87571),n=t(42192);let o=a.memo(e=>{let{symbol:l}=e,t=(0,a.useRef)(0),{symbolPosts:o,requestSymbolPosts:d,symbolPostsStatus:c}=(0,n.k2)(l,"NEWS");a.useEffect(()=>{t.current=0,d(0,i.L8A)},[d]);let x=a.useCallback(async()=>{t.current+=i.L8A,d(t.current,i.L8A)},[d]);return(0,s.jsx)(r.Z,{useWindowScroll:!0,hasNextPage:null==c||c&&!c.isFetching&&!c.noData,isNextPageLoading:null!=c&&c.isFetching,posts:o,loadNextPage:x})});l.default=o},5499:function(e,l,t){"use strict";var s=t(85893),a=t(66284),i=t(67294),r=t(17294),n=t(65959),o={backgroundColor:"transparent",tooltip:{trigger:"item",formatter:"{b} : {c} ({d}%)"},grid:{top:0,bottom:0,left:0,right:0},title:{show:!1},series:[{type:"pie",radius:"50%",center:["50%","50%"],color:["#009900","#990000","#ccaa00"],data:[],emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]};let d=i.memo(i.forwardRef((e,l)=>{let{symbol:t}=e,{resolvedTheme:d}=(0,n.F)(),[c,x]=i.useState(o),[u]=(0,r.useExchangeStats)(t);return i.useEffect(()=>{if(u){let e=Object.assign({},c);e.series=[...e.series],e.series[0]=Object.assign({},e.series[0]),e.series[0].data=[{value:u.advances,name:"Tăng (".concat(u.advances,")")},{value:u.declines,name:"Giảm (".concat(u.declines,")")},{value:u.unchange,name:"Kh\xf4ng đổi (".concat(u.unchange,")")}],x(e)}},[u]),(0,s.jsx)(a.default,{ref:l,option:c,theme:d,style:{width:"100%",height:300}})}));l.Z=d},36592:function(e,l,t){"use strict";var s=t(85893),a=t(66284),i=t(67294),r=t(17294);t(88908);var n=t(65959),o={backgroundColor:"transparent",xAxis:{type:"category",data:[]},yAxis:{type:"value",axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{type:"dashed"}},axisPointer:{snap:!0},axisLabel:{formatter:function(e,l){return"".concat(e," tỷ")}}},grid:{top:16,right:10,left:10,bottom:30,containLabel:!0},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(e){return"".concat(e[0].axisValue,": ").concat(e[0].value.toFixed(1)," tỷ")}},series:[{data:[],type:"bar",label:{show:!0,position:"top",formatter:e=>"".concat(e.value.toFixed(1)," tỷ")},barMinWidth:20,barMaxWidth:35}]};let d=i.memo(i.forwardRef((e,l)=>{let{symbol:t}=e,{resolvedTheme:d}=(0,n.F)(),[c,x]=i.useState(o),[u]=(0,r.useExchangeStats)(t);return i.useEffect(()=>{if(u){let e=Object.assign({},c);e.xAxis=Object.assign({},e.xAxis),e.xAxis.data=["Tăng","Giảm","Kh. đổi"],e.series=[...e.series],e.series[0]=Object.assign({},e.series[0]),e.series[0].data=[{value:u.advancesValue/1e9,itemStyle:{color:"#009900"}},{value:u.declinesValue/1e9,itemStyle:{color:"#990000"}},{value:u.unchangeValue/1e9,itemStyle:{color:"#ccaa00"}}],x(e)}},[u]),(0,s.jsx)(a.default,{ref:l,option:c,theme:d,style:{width:"100%",height:300}})}));l.Z=d},29837:function(e,l,t){"use strict";t.r(l);var s=t(85893),a=t(66284),i=t(65959),r=t(67294),n=t(16085),o=t(49460),d=t(63616);l.default=e=>{let{symbol:l}=e,{resolvedTheme:t}=(0,i.F)(),[c,x]=r.useState(),[u,m]=(0,r.useState)("T\xe0i sản v\xe0 Vốn chủ sở hữu"),[h,f]=r.useState("Y"),g=(0,o.ac)("(max-width : 768px)"),{financialDataQ:b,financialDataY:v}=(0,d.w)(l),p=e=>{let l=e.map(e=>"Y"===h?e.year.toString():"Q".concat(e.quarter,"/").concat(e.year)),t=e.map(e=>e.year),s=e.map(e=>e.quarter);
1return{namePeriods:l,listPeriods:{years:t,quarters:s}}},j=e=>{let l,t;if(!e||e&&0===e.length)return;let s=e[0].companyType,{namePeriods:a,listPeriods:i}=p(e);switch(s){case"General":l=[{id:"ShortTermInterestBearingDebt",name:"Nợ vay ngắn hạn",value:[],isCurrency:!0},{id:"LongTermInterestBearingDebt",name:"Nợ vay d\xe0i hạn",value:[],isCurrency:!0},{id:"StockHolderEquity",name:"Vốn chủ sở hữu",value:[],isCurrency:!0}];break;case"Bank":m("Cho vay v\xe0 huy động"),l=[{id:"CustomerLoan",name:"Cho vay kh\xe1ch h\xe0ng",value:[],isCurrency:!0},{id:"DepositOfCustomer",name:"Tiền gửi",value:[],isCurrency:!0},{id:"IssuingValuablePaper",name:"Giấy tờ c\xf3 gi\xe1",value:[],isCurrency:!0},{id:"LDR",name:"LDR",value:[],isCurrency:!1}];break;case"Securities":l=[{id:"ShorttermBorrowingAndFinancialLease",name:"Nợ vay ngắn hạn",value:[],isCurrency:!0},{id:"LongtermBorrowingAndFinancialLease",name:"Nợ vay d\xe0i hạn",value:[],isCurrency:!0},{id:"StockHolderEquity",name:"Vốn chủ sở hữu",value:[],isCurrency:!0}];break;case"Insurance":m("Dự ph\xf2ng nghiệp vụ v\xe0 Vốn chủ sở hữu"),l=[{id:"UnderwritingReserve",name:"Dự ph\xf2ng nghiệp vụ",value:[],isCurrency:!0},{id:"StockHolderEquity",name:"Vốn chủ sở hữu",value:[],isCurrency:!0}]}if(!l)return;let r=l;r.forEach(function(l){l.value=function(e,l,t,s){let a=t.years.map((a,i)=>{let r=t.quarters[i],n=e.find(e=>e.year===a&&e.quarter===r);if(n)return s?+n.financialValues[l]/1e9:+n.financialValues[l]});return a}(e,l.id,i,l.isCurrency)});let n=r[0].value.map((e,l)=>e+r[1].value[l]);switch(s){case"General":t=[{name:"Nợ vay",value:n},{name:"Vốn chủ sở hữu",value:r[2].value},{name:"Nợ vay/VCSH",value:n.map((e,l)=>e/r[2].value[l])}];break;case"Bank":t=[{name:"Cho vay kh\xe1c h\xe0ng",value:r[0].value},{name:"Tiền gửi v\xe0 Giấy tờ c\xf3 gi\xe1",value:r[1].value.map((e,l)=>e+r[2].value[l])},{name:"LDR",value:r[3].value}];break;case"Securities":t=[{name:"Nợ vay",value:n},{name:"Vốn chủ sở hữu",value:r[2].value},{name:"Nợ vay/VCSH",value:n.map((e,l)=>e/r[2].value[l])}];break;case"Insurance":var o,d;(t=[{name:"Dự ph\xf2ng nghiệp vụ",value:r[0].value},{name:"Vốn chủ sở hữu",value:r[1].value},{name:"Dự ph\xf2ng nghiệp vụ/VCSH",value:[]}])[2].value=null===(o=t[0])||void 0===o?void 0:null===(d=o.value)||void 0===d?void 0:d.map((e,l)=>{var s,a;return e/(null===(s=t[1])||void 0===s?void 0:null===(a=s.value)||void 0===a?void 0:a[l])})}if(!t)return;let c={backgroundColor:"transparent",tooltip:{trigger:"axis",axisPointer:{type:"cross",crossStyle:{color:"#999"}},textStyle:{fontFamily:"sans-serif"},show:!0},legend:{bottom:10,textStyle:{fontFamily:"sans-serif"}},grid:{top:40,bottom:60,right:14,left:14,containLabel:!0},xAxis:[{type:"category",data:a.reverse(),axisPointer:{type:"shadow"},nameTextStyle:{fontFamily:"sans-serif"}}],yAxis:[{type:"value",show:!0,axisLabel:{},name:"Tỷ VNĐ  ",nameTextStyle:{align:"right",fontFamily:"sans-serif"}},{type:"value",show:!1,axisLabel:{}}],series:[{name:t[0].name,type:"bar",tooltip:{valueFormatter:function(e){return new Intl.NumberFormat().format(e.toFixed(2))}},color:"#3fb1e3",data:t[0].value.reverse(),textStyle:{fontFamily:"sans-serif"}},{name:t[1].name,type:"bar",tooltip:{valueFormatter:function(e){return new Intl.NumberFormat().format(e.toFixed(2))},textStyle:{fontFamily:"sans-serif"}},color:"#6be6c1",data:t[1].value.reverse(),textStyle:{fontFamily:"sans-serif"}},{name:t[2].name,type:"line",yAxisIndex:1,label:{show:!0,textStyle:{fontSize:10,fontFamily:"sans-serif"},position:"top",formatter:function(e){return(100*e.value).toFixed(2)+" %"}},tooltip:{valueFormatter:function(e){return(100*e).toFixed(2)+" %"},textStyle:{fontFamily:"sans-serif"}},color:"#f2e900",data:t[2].value.reverse()}]};return c};return(0,r.useEffect)(()=>{var e;let l="Y"===h?v:b,t=j(l);if(!t){x(void 0);return}t.tooltip={...null!==(e=t.tooltip)&&void 0!==e?e:{},show:!g},x(t)},[g,h,JSON.stringify(b),JSON.stringify(v)]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"text-lg font-bold opacity-80 dark:opacity-100",children:u}),(0,s.jsx)(n.Z,{value:h,onChange:f})]}),c&&(0,s.jsx)(a.default,{option:c,theme:t,style:{width:"100%",height:280,minHeight:220}})]})}},16085:function(e,l,t){"use strict";var s=t(85893);t(67294);var a=t(77199);l.Z=e=>
1{let{value:l,onChange:t}=e;return(0,s.jsxs)("div",{className:"flex gap-0 items-center",children:[(0,s.jsx)(a.z,{size:"xs",className:"rounded-none",onClick:()=>t("Y"),variant:"Y"===l?"default":"outline",children:"Năm"}),(0,s.jsx)(a.z,{size:"xs",className:"rounded-none",variant:"Q"===l?"default":"outline",onClick:()=>t("Q"),children:"Qu\xfd"})]})}},63926:function(e,l,t){"use strict";t.r(l),t.d(l,{default:function(){return td}});var s=t(85893),a=t(67294),i=t(5152),r=t.n(i),n=t(30381),o=t.n(n),d=t(10683);let c=a.memo(e=>{var l,t,a,i,r;let{quote:n,symbolInfo:d,index:c,view:x,valueUnit:u,compact:m}=e;return(0,s.jsxs)("div",{className:"flex flex-row flex-1 gap-x-1.5 px-2 py-2 w-full text-xs tabular-nums leading-snug border-b border-border/40 sm:px-3",children:[(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-start items-center text-muted-foreground",children:o()(n.date).format("DD/MM/YYYY")}),"quote"==x&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end items-center tabular-nums",style:{color:n.priceClose>n.priceBasic?"#00aa00":n.priceClose<n.priceBasic?"#ee5442":"#ccaa00"},children:(n.priceClose-n.priceBasic).toFixed(null!==(l=d.fractionDigits)&&void 0!==l?l:2)}),"quote"==x&&(0,s.jsxs)("div",{className:"flex flex-row flex-1 justify-end items-center tabular-nums",style:{color:n.priceClose>n.priceBasic?"#00aa00":n.priceClose<n.priceBasic?"#ee5442":"#ccaa00"},children:[((n.priceClose-n.priceBasic)*100/n.priceBasic).toFixed(2),"%"]}),"quote"==x&&(0,s.jsx)("div",{className:"".concat(m?"hidden":"flex"," flex-row flex-1 justify-end items-center"),style:{color:n.priceOpen>n.priceBasic?"#00aa00":n.priceOpen<n.priceBasic?"#ee5442":"#ccaa00"},children:n.priceOpen.toFixed(null!==(t=d.fractionDigits)&&void 0!==t?t:2)}),"quote"==x&&(0,s.jsx)("div",{className:"".concat(m?"hidden":"flex"," flex-row flex-1 justify-end items-center"),style:{color:n.priceHigh>n.priceBasic?"#00aa00":n.priceHigh<n.priceBasic?"#ee5442":"#ccaa00"},children:n.priceHigh.toFixed(null!==(a=d.fractionDigits)&&void 0!==a?a:2)}),"quote"==x&&(0,s.jsx)("div",{className:"".concat(m?"hidden":"flex"," flex-row flex-1 justify-end items-center"),style:{color:n.priceLow>n.priceBasic?"#00aa00":n.priceLow<n.priceBasic?"#ee5442":"#ccaa00"},children:n.priceLow.toFixed(null!==(i=d.fractionDigits)&&void 0!==i?i:2)}),"quote"==x&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end items-center tabular-nums",style:{color:n.priceClose>n.priceBasic?"#00aa00":n.priceClose<n.priceBasic?"#ee5442":"#ccaa00"},children:n.priceClose.toFixed(null!==(r=d.fractionDigits)&&void 0!==r?r:2)}),"quote"==x&&(0,s.jsx)("div",{className:"".concat(m?"hidden":"flex"," flex-row flex-1 justify-end items-center"),style:{color:n.priceAverage>n.priceBasic?"#00aa00":n.priceAverage<n.priceBasic?"#ee5442":"#ccaa00"},children:n.priceAverage.toFixed(2)}),"foreign"==x&&"index"!=d.type&&"futures"!=d.type&&(0,s.jsx)("div",{className:"".concat(m?"hidden":"flex"," flex-row flex-1 justify-end items-center"),children:n.currentForeignRoom.toLocaleString()}),"foreign"==x&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end items-center",children:n.buyForeignQuantity.toLocaleString()}),"foreign"==x&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end items-center",children:n.sellForeignQuantity.toLocaleString()}),"foreign"==x&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end items-center tabular-nums",style:{color:n.buyForeignQuantity>n.sellForeignQuantity?"#00aa00":n.buyForeignQuantity<n.sellForeignQuantity?"#ee5442":void 0},children:(n.buyForeignQuantity-n.sellForeignQuantity).toLocaleString()}),"foreign"==x&&(0,s.jsx)("div",{className:"".concat(m?"hidden":"flex"," flex-row flex-1 justify-end items-center"),children:(n.buyForeignValue/u).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0})}),"foreign"==x&&(0,s.jsx)("div",{className:"".concat(m?"hidden":"flex"," flex-row flex-1 justify-end items-center"),children:(n.sellForeignValue/u).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0})}),"foreign"==x&&(0,s.jsx)("div",{className:"".concat(m?"hidden":"flex"," flex-row flex-1 justify-end items-center tabular-nums"),style:{color:n.buyForeignValue>n.sellForeignValue?"#00aa00":n.buyForeignValue<n.sellForeignValue?"#ee5442":void 0},children:((n.buyForeignValue-n.sellForeignValue)/u).toLocaleStr
1ing(void 0,{minimumFractionDigits:0,maximumFractionDigits:0})}),"supplyDemand"==x&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end items-center",children:n.buyCount.toLocaleString()}),"supplyDemand"==x&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end items-center",children:n.buyQuantity.toLocaleString()}),"supplyDemand"==x&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end items-center",children:n.sellCount.toLocaleString()}),"supplyDemand"==x&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end items-center",children:n.sellQuantity.toLocaleString()}),("quote"==x||"supplyDemand"==x)&&(0,s.jsx)("div",{className:"flex flex-row items-center justify-end flex-[1.5]",children:n.totalVolume.toLocaleString()}),("quote"==x||"supplyDemand"==x)&&(0,s.jsx)("div",{className:"".concat(m?"hidden":"flex"," flex-row items-center justify-end flex-[1.5]"),children:(n.totalValue/u).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0})})]})});var x=t(87473),u=t(26246),m=t(1219),h=t(43110),f=t(21552),g=t(6972),b=t(67369);let v={quote:820,foreign:720,supplyDemand:720};function p(e){let{hasNextPage:l,isNextPageLoading:t,quotes:i,symbolInfo:r,loadNextPage:n,valueUnit:o}=e,[p,j]=(0,d.a2S)("historicalQuotesTab","quote"),y=(0,d.pCp)("quotes",0),N=a.useRef(null),[w,k]=a.useState(0);a.useEffect(()=>{let e=N.current;if(!e)return;let l=()=>k(e.clientWidth);l();let t=new ResizeObserver(l);return t.observe(e),()=>t.disconnect()},[]);let C=0===w||w<v[p],S=(0,a.useCallback)((e,l)=>(0,s.jsx)(c,{symbolInfo:r,quote:l,index:e,view:p,valueUnit:o,compact:C}),[r,p,o,C]),F=(0,a.useCallback)(()=>t?(0,s.jsx)("div",{className:"flex flex-row justify-center items-center py-4",children:(0,s.jsx)(x.Z,{color:"#0ea5e9",loading:!0,size:28,"aria-label":"Đang tải","data-testid":"loader"})}):null,[t]),T=(0,a.useCallback)(e=>{y.current=e.startIndex},[]),L=(0,a.useCallback)(()=>{n()},[n]),D=(0,a.useCallback)(()=>{switch(o){case 1:return"1";case 1e3:return"1000";case 1e6:return"1 triệu";case 1e9:return"1 tỷ"}},[o]),P="text-xs font-medium uppercase tracking-wide text-muted-foreground";return(0,s.jsxs)(m.Zb,{ref:N,className:"overflow-visible p-0 shadow-sm",children:[(0,s.jsxs)("div",{className:"px-3 py-3 border-b border-border/60 bg-muted/15 sm:px-4",children:[(0,s.jsx)(f.Z,{title:"Dữ liệu lịch sử",description:"Gi\xe1, giao dịch nh\xe0 đầu tư nước ngo\xe0i v\xe0 cung–cầu",icon:b.Z,tone:"sky",size:"sm"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 mt-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)(h.mQ,{value:p,onValueChange:e=>j(e),className:"w-full sm:w-auto",children:(0,s.jsxs)(h.dr,{className:"grid grid-cols-2 p-1 w-full h-auto min-h-9 sm:flex sm:w-auto sm:grid-cols-none",children:[(0,s.jsx)(h.SP,{value:"quote",className:"text-xs sm:text-sm",children:"Gi\xe1 qu\xe1 khứ"}),(0,s.jsx)(h.SP,{value:"foreign",className:"text-xs sm:text-sm",children:"GD NĐTNN"}),(0,s.jsx)(h.SP,{value:"supplyDemand",className:"hidden col-span-2 text-xs sm:col-span-1 sm:text-sm md:flex",children:"Cung cầu"})]})}),(0,s.jsxs)("span",{className:"inline-flex shrink-0 rounded-full border border-border/60 bg-card px-2.5 py-1 text-xs text-muted-foreground shadow-sm",children:["K/L: 1 CP \xb7 Gi\xe1 trị: ",D()," VNĐ"]})]})]}),(0,s.jsxs)("div",{className:(0,g.cn)("sticky border-b border-border/60 bg-card text-card-foreground [isolation:isolate]"," shadow-[0_4px_12px_-4px_rgba(0,0,0,0.12)] dark:shadow-[0_4px_12px_-4px_rgba(0,0,0,0.35)]","z-40"),style:{top:"var(--symbol-sticky-top, 160px)"},children:["foreign"==p&&!C&&(0,s.jsxs)("div",{className:"flex w-full flex-row items-center gap-x-1.5 px-2 pt-1.5 sm:px-3",children:[(0,s.jsx)("div",{className:"flex-1"}),(0,s.jsx)("div",{className:"flex-1"}),(0,s.jsx)("div",{className:"flex flex-[3] flex-row justify-center",children:(0,s.jsx)("span",{className:P,children:"Khối lượng"})}),(0,s.jsx)("div",{className:"flex flex-[3] flex-row justify-center",children:(0,s.jsx)("span",{className:P,children:"Gi\xe1 trị"})})]}),(0,s.jsxs)("div",{className:"flex flex-row flex-1 items-center gap-x-1.5 px-2 py-2 sm:px-3",children:[(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-start ".concat(P),children:"Ng\xe0y"}),"quote"==p&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end ".concat(P),children:"+/-"}),"quote"==p&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end ".concat(P),children:"%"}),"quote"==p&&(0,s.jsx)("div",{className:"".concat(C?"hidden":"flex"," flex-row flex-1 justify-end ").concat(P),children:"Mở"}),"quote"==p&&(0,s.jsx)("div",{className:"".concat(C?"hidden":"flex"," flex-row flex-1 justify-end ").concat(P),children:"Cao"}),"quote"==p&&(0,s.jsx)("div",{className:"".concat(C?"hidden":"flex"," flex-row flex-1 justify-end ").concat(P),children:"Thấp"}),"quote"==p&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end ".concat(P),children:"Đ\xf3ng"}),"quote"==p&&(0,s.jsx)("div",{className:"".concat(C?"hidden":"flex"," flex-row flex-1 justify-end ").concat(P),children:"TB"}),"foreign"==p&&"index"!=r.type&&"futures"!=r.type&&(0,s.jsx)("div",{className:"".concat(C?"hidden":"flex"," flex-row flex-1 justify-end ").concat(P),children:"Room NN"}),"foreign"==p&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end ".concat(P),children:"Mua"}),"foreign"==p&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end ".concat(P),children:"B\xe1n"}),"foreign"==p&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end ".concat(P),children:"Mua-b\xe1n"}),"foreign"==p&&(0,s.jsx)("div",{className:"".concat(C?"hidden":"flex"," flex-row flex-1 justify-end ").concat(P),children:"Mua"}),"foreign"==p&&(0,s.jsx)("div",{className:"".concat(C?"hidden":"flex"," flex-row flex-1 justify-end ").concat(P),children:"B\xe1n"}),"foreign"==p&&(0,s.jsx)("div",{className:"".concat(C?"hidden":"flex"," flex-row flex-1 justify-end ").concat(P),children:"Mua-b\xe1n"}),"supplyDemand"==p&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end ".concat(P),children:"SL đặt mua"}),"supplyDemand"==p&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end ".concat(P),children:"KL đặt mua"}),"supplyDemand"==p&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end ".concat(P),children:"SL đặt b\xe1n"}),"supplyDemand"==p&&(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end ".concat(P),children:"KL đặt b\xe1n"}),("quote"==p||"supplyDemand"==p)&&(0,s.jsx)("div",{className:"flex flex-[1.5] flex-row justify-end ".concat(P),children:"Tổng KL"}),("quote"==p||"supplyDemand"==p)&&(0,s.jsx)("div",{className:"".concat(C?"hidden":"flex"," flex-[1.5] flex-row justify-end ").concat(P),children:"Tổng GT"})]})]}),(0,s.jsx)("div",{className:"flex-1 px-1 w-full sm:px-2",children:(0,s.jsx)(u.OO,{useWindowScroll:!0,itemContent:S,components:{Footer:F}
1,endReached:L,data:i,rangeChanged:T,initialTopMostItemIndex:y.current})})]})}var j=t(17294),y=t(12902),N=t(60588);let w=a.memo(e=>{let{symbol:l}=e,[t]=(0,j.usePrice)(l),i=(0,j.useSymbolInfo)(l),[r]=(0,j.useForeignerStats)(l),{historicalQuotes:n,requestHistoricalQuotes:c,historicalQuotesStatus:x}=(0,N.HH)(l),[u,m]=a.useState([]),h=(0,a.useRef)(0);a.useEffect(()=>{h.current=0,g()},[l]),a.useEffect(()=>{if(t&&n&&r&&n.length>0){let e=new Date(n[0].date);e.getFullYear()==t.date.getFullYear()&&e.getMonth()==t.date.getMonth()&&e.getDate()==t.date.getDate()&&m((0,y.ZP)(n,e=>{e[0].priceClose=t.last,e[0].priceOpen=t.open,e[0].priceBasic=t.basic,e[0].priceHigh=t.high,e[0].priceLow=t.low,e[0].totalVolume=t.totalVolume,e[0].totalValue=t.totalValue,e[0].buyForeignQuantity=r.buyForeignQuantity,e[0].sellForeignQuantity=r.sellForeignQuantity,e[0].buyForeignValue=r.buyForeignValue,e[0].sellForeignValue=r.sellForeignValue,e[0].currentForeignRoom=r.currentForeignRoom}))}},[n,t,r]);let f=a.useMemo(()=>{if(i)switch(i.type){case"index":case"futures":return 1e9}return 1e3},[i]),g=a.useCallback(()=>{let e=o()().startOf("day").toDate(),l=o()().startOf("day").toDate();l.setFullYear(l.getFullYear()-3),c(l,e,h.current,d.L8A),h.current+=d.L8A},[c]);return n&&i?(0,s.jsx)(p,{quotes:u.length>0?u:n,symbolInfo:i,hasNextPage:null==x||x&&!x.isFetching&&!x.noData,isNextPageLoading:null!=x&&x.isFetching,loadNextPage:g,valueUnit:f}):null});var k=t(24102),C=t(32034),S=t(65959),F=t(66284);t(88908);var T={backgroundColor:"transparent",title:{show:!1},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(e){return"Mức gi\xe1: ".concat(e[0].axisValue,"<br />Tổng KL: ").concat(e[0].value.toLocaleString())}},grid:{top:35,bottom:10,left:55},xAxis:{type:"value",position:"top",axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{type:"dashed"}},axisLabel:{formatter:function(e,l){return"".concat((e/1e3).toFixed(0),"K")}}},yAxis:{type:"category",axisLine:{show:!1},axisLabel:{show:!0},axisTick:{show:!1},splitLine:{show:!1},data:[]},series:[{name:"",barMinWidth:10,barMaxWidth:20,type:"bar",data:[]}]};let L=(e,l)=>{if(!e||!l||0==e.length)return[];let t=[];return e.forEach(e=>{let s;if(s=t.find(l=>l.price==e.price))s.volume+=e.volume;else{var a="#000000";l&&(a=l.ceiling&&e.price==l.ceiling?"#ff00ff":l.floor&&e.price==l.floor?"#00cccc":l.basic&&e.price>l.basic?"#00aa00":l.basic&&e.price<l.basic?"#ee0000":l.basic?"#aa9900":"#000000"),t.push({price:e.price,volume:e.volume,color:a})}}),t=t.sort((e,l)=>l.price-e.price)},D=a.memo(e=>{let{symbol:l}=e,{resolvedTheme:t}=(0,S.F)(),i=(0,j.useIntraday)(l),[r]=(0,j.usePrice)(l),[n,o]=a.useState(T);return a.useEffect(()=>{var e;let l=L(i,r),t=Object.assign({},n);t.yAxis=Object.assign({},t.yAxis),t.yAxis.data=l.map(l=>l.price.toFixed(null!==(e=null==r?void 0:r.fractionDigits)&&void 0!==e?e:2)),t.series=[...t.series],t.series[0]=Object.assign({},t.series[0]),t.series[0].data=l.map(e=>({value:e.volume,itemStyle:{color:e.color}})),o(t)},[r,i]),(0,s.jsx)(m.Zb,{className:"w-full",children:(0,s.jsx)(F.default,{option:n,theme:t,style:{width:"100%",height:520,maxHeight:"100%",minHeight:300}})})});var P=t(86010);let V=(e,l)=>-1==e?"ATO":-2==e?"ATC":e<=0?"":e.toFixed(l),M=(e,l)=>e.toLocaleString(),A=a.memo(e=>{let{symbol:l}=e,{theme:t}=(0,S.F)(),[i]=(0,j.usePrice)(l),[r,n]=(0,j.useOrderBook)(l),[o,d]=a.useState(0);a.useEffect(()=>{if(r&&(r.bids.length>0||r.asks.length>0)){d(Math.max(...r.bids.map(e=>e.quantity),...r.asks.map(e=>e.quantity)));return}d(0)},[r]);let c=a.useCallback(e=>0==e||0==o?0:"".concat(e/o*60,"%"),[o]),x=a.useCallback(e=>{if(i)return e<0?void 0:0==e?"rgba(204, 170, 0, 0.15)":i.ceiling&&e==i.ceiling?"rgba(255, 0, 255, 0.15)":i.floor&&e==i.floor?"rgba(0, 204, 204, 0.15)":i.basic&&e>i.basic?"rgba(0, 170, 0, 0.15)":i.basic&&e<i.basic?"rgba(238, 0, 0, 0.15)":e==i.basic?"rgba(204, 170, 0, 0.15)":void 0},[i]);return i&&r?(0,s.jsxs)("div",{className:"flex flex-col text-xs tabular-nums leading-snug",children:[(0,s.jsxs)("div",{className:"flex w-full flex-1 flex-row items-center gap-3 px-0 py-2",children:[(0,s.jsx)("div",{className:"flex flex-1 flex-row justify-end font-medium text-muted-foreground",children:"Đặt mua"}),(0,s.jsx)("div",{className:"flex flex-1 flex-row justify-start font-medium text-muted-foreground",children:"Đặt b\xe1n"})]}),r.bids.map((e,l)=>{if(e.quantity>0||r.asks[l].quantity>0){var a,o;return(0,s.jsxs)("div",{className:(0,P.Z)("flex w-full flex-1 flex-row items-center border-b border-border/40 py-2"),children:[(0,s.jsxs)("div",{className:"relative flex min-w-0 flex-1 flex-row",children:[(0,s.jsx)("div",{className:"relative flex min-w-0 flex-1 flex-row",children:e.quantity>0&&(0,s.jsxs)("span",{className:"rounded-sm px-1.5 py-1",style:{backgroundColor:(0,j.getValueBackgroun
1dColor)(e.quantity,n&&n.bids.length>l?n.bids[l].quantity:void 0,t)},children:["\xa0",M(e.quantity,e.price)]})}),(0,s.jsx)("div",{className:"relative flex flex-row justify-end pr-1 font-medium",children:e.quantity>0&&(0,s.jsxs)("span",{className:"rounded-sm px-1.5 py-1",style:{color:(0,j.getPriceColor)(e.price,i,n&&n.bids.length>l?n.bids[l].price:void 0),backgroundColor:(0,j.getPriceBackgroundColor)(e.price,n&&n.bids.length>l?n.bids[l].price:void 0,t)},children:["\xa0",V(e.price,null!==(a=i.fractionDigits)&&void 0!==a?a:2)]})}),(0,s.jsx)("div",{style:{position:"absolute",zIndex:0,top:0,bottom:0,right:2,width:c(e.quantity),backgroundColor:x(e.price)}})]}),(0,s.jsxs)("div",{className:"relative flex min-w-0 flex-1 flex-row",children:[(0,s.jsx)("div",{className:"relative flex flex-row justify-end pl-1 font-medium",children:r.asks[l].quantity>0&&(0,s.jsxs)("span",{className:"rounded-sm px-1.5 py-1",style:{color:(0,j.getPriceColor)(r.asks[l].price,i,n&&n.asks.length>l?n.asks[l].price:void 0),backgroundColor:(0,j.getPriceBackgroundColor)(r.asks[l].price,n&&n.asks.length>l?n.asks[l].price:void 0,t)},children:[V(r.asks[l].price,null!==(o=i.fractionDigits)&&void 0!==o?o:2),"\xa0"]})}),(0,s.jsx)("div",{className:"relative flex min-w-0 flex-1 flex-row justify-end",children:r.asks[l].quantity>0&&(0,s.jsxs)("span",{className:"rounded-sm px-1.5 py-1",style:{backgroundColor:(0,j.getValueBackgroun
1dColor)(r.asks[l].quantity,n&&n.asks.length>l?n.asks[l].quantity:void 0,t)},children:[M(r.asks[l].quantity,r.asks[l].price),"\xa0"]})}),(0,s.jsx)("div",{style:{position:"absolute",zIndex:0,top:0,bottom:0,left:2,width:c(r.asks[l].quantity),backgroundColor:x(r.asks[l].price)}})]})]},l.toString())}return null})]}):null}),Z=a.memo(e=>{let{symbol:l,hideActiveBuySell:t}=e,{resolvedTheme:i}=(0,S.F)(),r=(0,j.useIntraday)(l),[n,c]=(0,j.usePrice)(l),[x,h]=a.useState(0),[f,g]=a.useState(0);a.useEffect(()=>{if(r){let e=0,l=0;r.forEach(t=>{"B"==t.side?e+=t.volume:"S"==t.side?l+=t.volume:(e+=t.volume/2,l+=t.volume/2)}),h(Math.round(e)),g(Math.round(l))}},[r]);let b=a.useMemo(()=>r?[...r].sort((e,l)=>l.date.getTime()-e.date.getTime()):[],[r]),v=(0,a.useCallback)((e,l)=>{var a,i;return n?(0,s.jsx)("div",{className:(0,P.Z)("flex flex-row flex-1 border-b border-border/40 px-2 py-2 text-xs tabular-nums leading-snug text-foreground"),children:(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 flex-row",children:[(0,s.jsx)("div",{className:"flex flex-[2] flex-row text-muted-foreground",children:o()(l.date).format("HH:mm:ss")}),(0,s.jsx)("div",{className:"flex flex-[2] flex-row justify-end font-medium",style:{color:(0,j.getPriceColor)(l.price,n)},children:l.price.toFixed(null!==(a=n.fractionDigits)&&void 0!==a?a:2)}),(0,s.jsx)("div",{className:"flex flex-[2] flex-row justify-end font-medium",style:{color:(0,j.getPriceColor)(l.price,n)},children:(l.price-n.basic).toFixed(null!==(i=n.fractionDigits)&&void 0!==i?i:2)}),(0,s.jsx)("div",{className:"flex flex-[2] flex-row justify-end",children:l.volume.toLocaleString()}),!t&&(0,s.jsx)("div",{className:"flex w-9 shrink-0 flex-row justify-end font-medium",style:{color:(0,j.getSideColor)(l.side)},children:"B"==l.side?"M":"S"==l.side?"B":""})]})}):null},[n,t]);return r&&n?(0,s.jsxs)(m.Zb,{className:"flex w-full flex-1 flex-col pt-3 text-xs",children:[(0,s.jsx)(A,{symbol:l},"Orders"),(0,s.jsx)("div",{className:"mt-3 flex w-full flex-col justify-center",children:(0,s.jsxs)("div",{className:"flex flex-1 flex-row items-center px-2 py-2 text-muted-foreground",children:[(0,s.jsx)("div",{className:"flex flex-[2] flex-row font-medium",children:"Khớp"}),(0,s.jsx)("div",{className:"flex flex-[2] flex-row justify-end font-medium",children:"Gi\xe1"}),(0,s.jsx)("div",{className:"flex flex-[2] flex-row justify-end font-medium",children:"+/-"}),(0,s.jsx)("div",{className:"flex flex-[2] flex-row justify-end font-medium",children:"KL"}),!t&&(0,s.jsx)("div",{className:"flex w-9 shrink-0 flex-row justify-end font-medium",children:"M/B"})]})}),(0,s.jsx)("div",{className:"w-full h-[250px]",children:(0,s.jsx)(u.OO,{initialItemCount:Math.min(Math.floor(.9*d.L8A),r.length),itemContent:v,data:b})}),(0,s.jsxs)("div",{className:"flex w-full flex-col justify-center border-t border-border/60 tabular-nums leading-snug",children:[(0,s.jsxs)("div",{className:"flex flex-1 flex-row items-center border-b border-border/40 px-2 py-2",children:[(0,s.jsx)("div",{className:"flex flex-[4] flex-row text-muted-foreground",children:"Tổng KL khớp"}),(0,s.jsx)("div",{className:"flex flex-[2] flex-row justify-end",children:(0,s.jsx)("span",{className:"rounded px-2 py-1 font-medium",style:{backgroundColor:(0,j.getValueBackgroun
1dColor)(n.totalVolume,null==c?void 0:c.totalVolume,i)},children:n.totalVolume.toLocaleString()})}),(0,s.jsx)("div",{className:"flex w-9 shrink-0 flex-row justify-end"})]}),!t&&(0,s.jsxs)("div",{className:"flex flex-1 flex-row items-center border-b border-border/40 px-2 py-2",children:[(0,s.jsx)("div",{className:"flex flex-[4] flex-row text-muted-foreground",children:"KL MUA chủ động"}),(0,s.jsx)("div",{className:"flex flex-[2] flex-row justify-end",style:{color:void 0!=c&&n.totalVolume!=c.totalVolume?void 0:(0,j.getSideColor)("B")},children:(0,s.jsx)("span",{className:"rounded px-2 py-1 font-medium",style:{backgroundColor:(0,j.getValueBackgroundColor)(n.totalVolume,null==c?void 0:c.totalVolume,i)},children:x.toLocaleString()})}),(0,s.jsx)("div",{className:"flex w-9 shrink-0 flex-row justify-end font-medium",style:{color:(0,j.getSideColor)("B")},children:"M"})]}),!t&&(0,s.jsxs)("div",{className:"flex flex-1 flex-row items-center border-b border-border/40 px-2 py-2",children:[(0,s.jsx)("div",{className:"flex flex-[4] flex-row text-muted-foreground",children:"KL B\xc1N chủ động"}),(0,s.jsx)("div",{className:"flex flex-[2] flex-row justify-end",style:{color:void 0!=c&&n.totalVolume!=c.totalVolume?void 0:(0,j.getSideColor)("S")},children:(0,s.jsx)("span",{className:"rounded px-2 py-1 font-medium",style:{backgroundColor:(0,j.getValueBackgroun
1dColor)(n.totalVolume,null==c?void 0:c.totalVolume,i)},children:f.toLocaleString()})}),(0,s.jsx)("div",{className:"flex w-9 shrink-0 flex-row justify-end font-medium",style:{color:(0,j.getSideColor)("S")},children:"B"})]})]})]}):null}),E=r()(()=>Promise.resolve().then(t.bind(t,66284)),{loadableGenerated:{webpack:()=>[66284]},ssr:!1});var O={backgroundColor:"transparent",title:{show:!1},tooltip:{trigger:"axis",axisPointer:{type:"line"},formatter:function(e){return"Thời gian: ".concat(o()(e[0].value[0]).format("H:mm"),"<br />Gi\xe1: ").concat(e[0].value[1].toFixed(2))}},grid:{top:10,bottom:0,left:14,right:10,containLabel:!0},visualMap:[{show:!1,seriesIndex:0,pieces:[{gte:1,color:"#00aa00"},{lt:1,gt:0,color:"#ee5442"}]}],xAxis:{type:"time",axisLabel:{formatter:function(e,l){return"".concat(o()(e).format("H:mm"))}},data:[]},yAxis:[{type:"value",position:"right",scale:!0,axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{type:"dashed"}},axisPointer:{snap:!0}},{type:"value",position:"left",show:!1,scale:!1,axisLabel:{show:!1},axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{type:"dashed"}},axisPointer:{snap:!0}}],series:[{type:"line",smooth:!1,symbol:"none",data:[],markLine:{silent:!0,data:[]},markPoint:{data:[]}},{type:"bar",smooth:!1,xAxisIndex:0,yAxisIndex:1,data:[],itemStyle:{color:"#ccaa00"},markLine:{silent:!0,data:[]},markPoint:{data:[]}}]};let B=(e,l)=>{if(!e||0==e.length)return[];let t=new Date(e[0].date);t.setHours(0),t.setMinutes(0),t.setSeconds(0);let s=0,a=[];for(let i=0;i<e.length;i++)if(0==l)a.push({date:new Date(e[i].date),price:e[i].price,volume:e[i].volume});else{let r=new Date(e[i].date),n=Math.floor(o()(r).diff(t,"minutes")/l);n!=s?(s=n,a.push({date:new Date(t.getTime()+6e4*n),price:e[i].price,volume:e[i].volume})):a.length>0&&(a[a.length-1].price=e[i].price,a[a.length-1].volume+=e[i].volume)}return a},I=a.memo(e=>{let{symbol:l,hideValueAxis:t}=e,{resolvedTheme:i}=(0,S.F)(),r=(0,j.useIntraday)(l),[n]=(0,j.usePrice)(l),[o,d]=a.useState(O);return a.useEffect(()=>{if(r){let e=B(r,1),l=Object.assign({},o);l.xAxis=Object.assign({},l.xAxis),l.series=[...l.series],l.series[0]=Object.assign({},l.series[0]),l.series[0].data=e.map(e=>[e.date,e.price]),l.series[1]=Object.assign({},l.series[1]),l.series[1].data=e.map(e=>[e.date,e.volume]),t?(l.yAxis[0].show=!1,l.yAxis[0].axisLabel={show:!1}):(l.yAxis[0].show=!0,l.yAxis[0].axisLabel={show:!0}),e.length>0&&(l.series[0].markPoint=Object.assign({},l.series[0].markPoint),l.series[0].markPoint.data=[{symbol:"circle",symbolSize:10,
1coord:[e.length-1,e[e.length-1].price],itemStyle:n?{color:e[e.length-1].price>=(null==n?void 0:n.basic)?"rgb(38, 166, 154)":"rgb(239, 83, 80)"}:void 0}]),n&&(l.visualMap=[...l.visualMap],l.visualMap[0]=Object.assign({},l.visualMap[0]),l.visualMap[0].pieces=[...l.visualMap[0].pieces],l.visualMap[0].pieces[0]=Object.assign({},l.visualMap[0].pieces[0]),l.visualMap[0].pieces[1]=Object.assign({},l.visualMap[0].pieces[1]),l.visualMap[0].pieces[0].gte=n.basic,l.visualMap[0].pieces[1].lt=n.basic,l.series[0].markLine=Object.assign({},l.series[0].markLine),l.series[0].markLine.data=[{yAxis:n.basic,lineStyle:{color:"#ccaa00"},label:{normal:{position:"insideMiddleTop",formatter:""}}}]),d(l)}},[null==n?void 0:n.basic,r]),(0,s.jsx)(E,{option:o,theme:i,style:{width:"100%",height:"100%",overflow:"hidden"}})}),z=a.memo(e=>{var l,t,i,r,n,o,d;let{symbol:c,showChart:x}=e,{resolvedTheme:u}=(0,S.F)(),[h,f]=(0,j.usePrice)(c),{symbolFundamental:g,requestSymbolFundamental:b}=(0,N.uu)(c);return a.useEffect(()=>{b()},[b]),(0,s.jsxs)(m.Zb,{className:"h-full w-full flex-1 overflow-hidden border-0 bg-transparent shadow-none",children:[x&&(0,s.jsx)("div",{className:"w-full h-[180px] overflow-hidden mb-5",children:(0,s.jsx)(I,{symbol:c})}),(0,s.jsx)("table",{className:"w-full text-sm",cellPadding:10,children:(0,s.jsxs)("tbody",{children:[(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Tham chiếu"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!h&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(h.basic,h,null==f?void 0:f.basic),backgroundColor:(0,j.getPriceBackgroundColor)(h.basic,null==f?void 0:f.basic,u)},children:h.basic.toFixed(null!==(r=h.fractionDigits)&&void 0!==r?r:2)})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Mở cửa"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!h&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(h.open,h,null==f?void 0:f.open),backgroundColor:(0,j.getPriceBackgroundColor)(h.open,null==f?void 0:f.open,u)},children:h.open.toFixed(null!==(n=h.fractionDigits)&&void 0!==n?n:2)})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Thấp - Cao"}),(0,s.jsxs)("td",{className:"font-bold text-right",children:[!!h&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(h.low,h,null==f?void 0:f.low),backgroundColor:(0,j.getPriceBackgroundColor)(h.low,null==f?void 0:f.low,u)},children:h.low.toFixed(null!==(o=h.fractionDigits)&&void 0!==o?o:2)}),"\xa0-\xa0",!!h&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(h.high,h,null==f?void 0:f.high),backgroundColor:(0,j.getPriceBackgroundColor)(h.high,null==f?void 0:f.high,u)},children:h.high.toFixed(null!==(d=h.fractionDigits)&&void 0!==d?d:2)})]})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Khối lượng"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!h&&(0,s.jsx)("span",{style:{padding:2,backgroundColor:(0,j.getValueBackgroun
1dColor)(h.totalVolume,null==f?void 0:f.totalVolume,u)},children:h.totalVolume.toLocaleString()})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Gi\xe1 trị"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!h&&(0,s.jsxs)("span",{style:{padding:2,backgroundColor:(0,j.getValueBackgroundColor)(h.totalValue,null==f?void 0:f.totalValue,u)},children:[(h.totalValue/1e9).toLocaleString(void 0,{maximumFractionDigits:2})," ","tỷ"]})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"KLTB 10 ng\xe0y"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!g&&!!g.avgVolume10d&&(0,s.jsx)("div",{children:g.avgVolume10d.toLocaleString()})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Beta"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!g&&!!g.beta&&(0,s.jsx)("div",{children:g.beta.toFixed(2)})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Thị gi\xe1 vốn"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!g&&!!g.marketCap&&(0,s.jsxs)("div",{children:[(g.marketCap/1e9).toLocaleString(void 0,{maximumFractionDigits:1})," ","tỷ"]})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Số lượng CPLH"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!g&&(0,s.jsx)("div",{children:null===(l=g.sharesOutstanding)||void 0===l?void 0:l.toLocaleString()})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"P/E"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!g&&(0,s.jsx)("div",{children:null===(t=g.pe)||void 0===t?void 0:t.toFixed(2)})})]}),(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:"EPS"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!g&&(0,s.jsx)("div",{children:null===(i=g.eps)||void 0===i?void 0:i.toLocaleString(void 0,{maximumFractionDigits:0})})})]})]})})]})}),q=a.memo(e=>{let{symbol:l,showChart:t,initialTab:i,contentStyle:r}=e,[n,o]=a.useState(null!=i?i:"overview");return(0,s.jsxs)(m.Zb,{className:"flex h-full flex-1 flex-col p-3",children:[(0,s.jsx)(h.mQ,{value:n,onValueChange:e=>o(e),children:(0,s.jsxs)(h.dr,{className:"mb-3 h-9 w-full",children:[(0,s.jsx)(h.SP,{value:"overview",className:"flex-1 text-xs",children:"Tổng hợp"}),(0,s.jsx)(h.SP,{value:"trade",className:"flex-1 text-xs",children:"Sổ lệnh"}),(0,s.jsx)(h.SP,{value:"priceLevels",className:"flex-1 text-xs",children:"Mức gi\xe1"})]})}),(0,s.jsxs)("div",{className:"flex w-full flex-1",children:["overview"==n&&(0,s.jsx)(z,{showChart:t,symbol:l}),"trade"==n&&(0,s.jsx)(Z,{symbol:l}),"priceLevels"==n&&(0,s.jsx)(D,{symbol:l})]})]})}),_=a.memo(e=>{var l,t,i,r;let{symbol:n,showChart:o}=e,{resolvedTheme:d}=(0,S.F)(),[c,x]=(0,j.usePrice)(n),{cryptoInfo:u,requestCryptoInfo:h}=(0,N.YN)(n),f=(0,j.useSymbolInfo)(n),[g,b]=a.useState(!1),[v,p]=a.useState(null==u?void 0:u.description);a.useEffect(()=>{h()},[h]),a.useEffect(()=>{if(u){let e=u.description.length>350;b(e),p(e?u.description.substring(0,350)+"...":u.description)}},[u]);let y=a.useCallback(()=>{u&&(g?(b(!1),p(u.description)):(b(!0),p(u.description.substring(0,350)+"...")))},[g,u]);return(0,s.jsxs)(m.Zb,{className:"flex flex-col flex-1 w-full h-full p-0",children:[o&&(0,s.jsx)("div",{className:"h-[180px] w-full mb-5",children:(0,s.jsx)(I,{symbol:n})}),(0,s.jsxs)("table",{cellPadding:10,children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{className:"border-b border-border/60",children:(0,s.jsx)("th",{colSpan:2,children:(0,s.jsx)("p",{className:"font-normal",children:"* Dữ liệu giao dịch cung cấp bởi Binance"})})})}),(0,s.jsxs)("tbody",{children:[f&&(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Vốn h\xf3a ($)"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!c&&(0,s.jsx)("span",{style:{padding:2,backgroundColor:(0,j.getValueBackgroun
1dColor)(c.last*f.sharesOutstanding,x?x.last*f.sharesOutstanding:void 0,d)},children:(c.last*f.sharesOutstanding).toLocaleString(void 0,{maximumFractionDigits:0,minimumFractionDigits:0})})})]}),f&&(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Vốn h\xf3a pha lo\xe3ng hết ($)"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!c&&(0,s.jsx)("span",{style:{padding:2,backgroundColor:(0,j.getValueBackgroundColor)(c.last*f.totalShares,x?x.last*f.totalShares:void 0,d)},children:(c.last*f.totalShares).toLocaleString(void 0,{maximumFractionDigits:0,minimumFractionDigits:0})})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Tham chiếu"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!c&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(c.basic,c,null==x?void 0:x.basic),backgroundColor:(0,j.getPriceBackgroundColor)(c.basic,null==x?void 0:x.basic,d)},children:c.basic.toFixed(null!==(l=c.fractionDigits)&&void 0!==l?l:2)})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Mở cửa"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!c&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(c.open,c,null==x?void 0:x.open),backgroundColor:(0,j.getPriceBackgroundColor)(c.open,null==x?void 0:x.open,d)},children:c.open.toFixed(null!==(t=c.fractionDigits)&&void 0!==t?t:2)})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Thấp - Cao"}),(0,s.jsxs)("td",{className:"font-bold text-right",children:[!!c&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(c.low,c,null==x?void 0:x.low),backgroundColor:(0,j.getPriceBackgroundColor)(c.low,null==x?void 0:x.low,d)},children:c.low.toFixed(null!==(i=c.fractionDigits)&&void 0!==i?i:2)}),"\xa0-\xa0",!!c&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(c.high,c,null==x?void 0:x.high),backgroundColor:(0,j.getPriceBackgroundColor)(c.high,null==x?void 0:x.high,d)},children:c.high.toFixed(null!==(r=c.fractionDigits)&&void 0!==r?r:2)})]})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"KLGD 24h"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!c&&(0,s.jsx)("span",{style:{padding:2,backgroundColor:(0,j.getValueBackgroun
1dColor)(c.volume24h,null==x?void 0:x.volume24h,d)},children:c.volume24h.toLocaleString(void 0,{maximumFractionDigits:2,minimumFractionDigits:2})})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"GTGD 24h ($)"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!c&&(0,s.jsx)("span",{style:{padding:2,backgroundColor:(0,j.getValueBackgroundColor)(c.volume24h*c.last,x?x.volume24h*x.last:void 0,d)},children:(c.volume24h*c.last).toLocaleString(void 0,{maximumFractionDigits:0,minimumFractionDigits:0})})})]}),u&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:2,children:(0,s.jsxs)("p",{children:[v," ",g&&(0,s.jsx)("a",{onClick:y,className:"font-semibold cursor-pointer",children:g?"Th\xeam":"Thu gọn"})]})})})]})]})]})}),H=a.memo(e=>{let{symbol:l,showChart:t}=e;return(0,s.jsx)(m.Zb,{className:"flex flex-1 flex-col p-3",children:(0,s.jsx)(_,{showChart:t,symbol:l})})});var Y=t(5499),G=t(36592);let Q=a.memo(e=>{let{symbol:l}=e;return(0,s.jsxs)(m.Zb,{className:"w-full h-full p-2",children:[(0,s.jsx)("div",{className:"pt-10 text-lg font-semibold text-center",children:"Số lượng CP Tăng, Giảm, Kh\xf4ng đổi"}),(0,s.jsx)(Y.Z,{symbol:l}),(0,s.jsx)("div",{className:"text-lg font-semibold text-center",children:"Ph\xe2n bổ d\xf2ng tiền"}),(0,s.jsx)(G.Z,{symbol:l})]})});var R=t(84165);function K(e){let{label:l,children:t}=e;return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 border-b border-border/40 py-2.5 text-sm last:border-0",children:[(0,s.jsx)("span",{className:"shrink-0 text-muted-foreground",children:l}),(0,s.jsx)("span",{className:"min-w-0 text-right font-semibold tabular-nums",children:t})]})}function U(e){let{children:l}=e;return(0,s.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:l})}function W(e){let{active:l,onClick:t,children:a}=e;return(0,s.jsx)("button",{type:"button",onClick:t,className:(0,g.cn)("whitespace-nowrap rounded-md px-2 py-0.5 text-xs font-medium transition-colors",l?"bg-sky-500/15 text-sky-600 ring-1 ring-inset ring-sky-500/40 dark:text-sky-300":"text-muted-foreground hover:text-foreground"),children:a})}let X=a.memo(e=>{var l;let{symbol:t,showChart:i}=e,{resolvedTheme:r}=(0,S.F)(),[n,o]=(0,j.usePrice)(t),[d,c]=(0,j.useForeignerStats)(t),[x,u]=a.useState("0d"),m=null!==(l=null==n?void 0:n.fractionDigits)&&void 0!==l?l:2,h=(e,l)=>!!n&&(0,s.jsx)("span",{className:"rounded px-0.5",style:{color:(0,j.getPriceColor)(e,n,l),backgroundColor:(0,j.getPriceBackgroundColor)(e,l,r)},children:e.toFixed(m)}),f=(e,l,t,a)=>(0,s.jsx)("span",{className:"rounded px-0.5",style:{color:a,backgroundColor:(0,j.getValueBackgroun
1dColor)(l,t,r)},children:e}),g=e=>0!==e?(e/1e9).toFixed(2)+" tỷ":"0",b=d?d.buyForeignQuantity-d.sellForeignQuantity:0,v=d?d.buyForeignValue-d.sellForeignValue:0;return(0,s.jsxs)("div",{className:"flex w-full flex-1 flex-col",children:[i&&(0,s.jsx)("div",{className:"mb-4 h-[180px] w-full overflow-hidden",children:(0,s.jsx)(I,{symbol:t})}),(0,s.jsx)(U,{children:"Tổng quan"}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)(K,{label:"Tham chiếu",children:!!n&&h(n.basic,null==o?void 0:o.basic)}),(0,s.jsx)(K,{label:"Mở cửa",children:!!n&&h(n.open,null==o?void 0:o.open)}),(0,s.jsx)(K,{label:"Thấp - Cao",children:!!n&&(0,s.jsxs)(s.Fragment,{children:[h(n.low,null==o?void 0:o.low),(0,s.jsx)("span",{className:"text-muted-foreground",children:" - "}),h(n.high,null==o?void 0:o.high)]})}),(0,s.jsx)(K,{label:"KL khớp",children:!!n&&f(n.dealVolume.toLocaleString(),n.dealVolume,null==o?void 0:o.dealVolume)}),(0,s.jsx)(K,{label:"KL thỏa thuận",children:!!n&&f((n.totalVolume-n.dealVolume).toLocaleString(),n.totalVolume-n.dealVolume,o?o.totalVolume-o.dealVolume:void 0)}),(0,s.jsx)(K,{label:"Tổng KL",children:!!n&&f(n.totalVolume.toLocaleString(),n.totalVolume,null==o?void 0:o.totalVolume)}),(0,s.jsx)(K,{label:"Tổng gi\xe1 trị",children:!!n&&f((n.totalValue/1e9).toLocaleString(void 0,{maximumFractionDigits:2})+" tỷ",n.totalValue,null==o?void 0:o.totalValue)})]}),(0,s.jsxs)("div",{className:"mt-5 flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)(U,{children:"Giao dịch NĐTNN"}),(0,s.jsxs)("div",{className:"inline-flex items-center gap-0.5 rounded-lg border border-border/60 bg-muted/30 p-0.5 dark:bg-muted/15",children:[(0,s.jsx)(W,{active:"0d"===x,onClick:()=>u("0d"),children:"H\xf4m nay"}),(0,s.jsx)(W,{active:"10d"===x,onClick:()=>u("10d"),children:"10 phi\xean"})]})]}),"10d"===x?(0,s.jsx)("div",{className:"mt-2 h-[162px] w-full overflow-hidden",children:(0,s.jsx)(R.Z,{symbol:t})}):(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)(K,{label:"KL mua",children:!!d&&f(d.buyForeignQuantity.toLocaleString(),d.buyForeignQuantity,null==c?void 0:c.buyForeignQuantity,"#00aa00")}),(0,s.jsx)(K,{label:"KL b\xe1n",children:!!d&&f(d.sellForeignQuantity.toLocaleString(),d.sellForeignQuantity,null==c?void 0:c.sellForeignQuantity,"#ee5442")}),(0,s.jsx)(K,{label:"KL r\xf2ng",children:!!d&&f(b.toLocaleString(),b,c?c.buyForeignQuantity-c.sellForeignQuantity:void 0,(0,j.getValueColor)(b))}),(0,s.jsx)(K,{label:"GT mua",children:!!d&&f(g(d.buyForeignValue),d.buyForeignValue,null==c?void 0:c.buyForeignValue,"#00aa00")}),(0,s.jsx)(K,{label:"GT b\xe1n",children:!!d&&f(g(d.sellForeignValue),d.sellForeignValue,null==c?void 0:c.sellForeignValue,"#ee5442")}),(0,s.jsx)(K,{label:"GT r\xf2ng",children:!!d&&f(g(v),v,c?c.buyForeignValue-c.sellForeignValue:void 0,(0,j.getValueColor)(v))})]})]})});X.displayName="Statistics";let J=a.memo(e=>{let{symbol:l,showChart:t,initialTab:i}=e,[r,n]=a.useState(null!=i?i:"overview");return(0,s.jsxs)(m.Zb,{className:"flex h-full flex-1 flex-col p-3",children:[(0,s.jsx)(h.mQ,{value:r,onValueChange:e=>n(e),children:(0,s.jsxs)(h.dr,{className:"mb-3 h-9 w-full",children:[(0,s.jsx)(h.SP,{value:"overview",className:"flex-1 text-xs",children:"Tổng hợp"}),(0,s.jsx)(h.SP,{value:"moneyFlow",className:"flex-1 text-xs",children:"D\xf2ng tiền"})]})}),(0,s.jsxs)("div",{className:"flex w-full flex-1",children:["overview"==r&&(0,s.jsx)(X,{showChart:t,symbol:l}),"moneyFlow"==r&&(0,s.jsx)(Q,{symbol:l})]})]})}),$=a.memo(e=>{var l,t,a,i;let{symbol:r,showChart:n}=e,{resolvedTheme:o}=(0,S.F)(),[d,c]=(0,j.usePrice)(r);return(0,s.jsxs)(m.Zb,{className:"flex flex-col flex-1 w-full h-full p-0",children:[n&&(0,s.jsx)("div",{className:"h-[180px] w-full mb-5",children:(0,s.jsx)(I,{symbol:r})}),(0,s.jsx)("table",{cellPadding:10,children:(0,s.jsxs)("tbody",{children:[(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Tham chiếu"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!d&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(d.basic,d,null==c?void 0:c.basic),backgroundColor:(0,j.getPriceBackgroun
1dColor)(d.basic,null==c?void 0:c.basic,o)},children:d.basic.toFixed(null!==(l=d.fractionDigits)&&void 0!==l?l:2)})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Mở cửa"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!d&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(d.open,d,null==c?void 0:c.open),backgroundColor:(0,j.getPriceBackgroundColor)(d.open,null==c?void 0:c.open,o)},children:d.open.toFixed(null!==(t=d.fractionDigits)&&void 0!==t?t:2)})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Thấp - Cao"}),(0,s.jsxs)("td",{className:"font-bold text-right",children:[!!d&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(d.low,d,null==c?void 0:c.low),backgroundColor:(0,j.getPriceBackgroundColor)(d.low,null==c?void 0:c.low,o)},children:d.low.toFixed(null!==(a=d.fractionDigits)&&void 0!==a?a:2)}),"\xa0-\xa0",!!d&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(d.high,d,null==c?void 0:c.high),backgroundColor:(0,j.getPriceBackgroundColor)(d.high,null==c?void 0:c.high,o)},children:d.high.toFixed(null!==(i=d.fractionDigits)&&void 0!==i?i:2)})]})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Tổng KL"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!d&&(0,s.jsx)("span",{style:{padding:2,backgroundColor:(0,j.getValueBackgroun
1dColor)(d.totalVolume,null==c?void 0:c.totalVolume,o)},children:d.totalVolume.toLocaleString()})})]}),(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:"Tổng gi\xe1 trị"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!d&&(0,s.jsxs)("span",{style:{padding:2,backgroundColor:(0,j.getValueBackgroundColor)(d.totalValue,null==c?void 0:c.totalValue,o)},children:[(d.totalValue/1e9).toLocaleString(void 0,{maximumFractionDigits:2})," ","tỷ"]})})]})]})})]})}),ee=a.memo(e=>{let{symbol:l,showChart:t,initialTab:i}=e,[r,n]=a.useState(null!=i?i:"overview");return(0,s.jsxs)(m.Zb,{className:"flex h-full flex-1 flex-col p-3",children:[(0,s.jsx)(h.mQ,{value:r,onValueChange:e=>n(e),children:(0,s.jsxs)(h.dr,{className:"mb-3 h-9 w-full",children:[(0,s.jsx)(h.SP,{value:"overview",className:"flex-1 text-xs",children:"Tổng hợp"}),(0,s.jsx)(h.SP,{value:"trade",className:"flex-1 text-xs",children:"Sổ lệnh"}),(0,s.jsx)(h.SP,{value:"priceLevels",className:"flex-1 text-xs",children:"Mức gi\xe1"})]})}),(0,s.jsxs)("div",{className:"flex w-full flex-1",children:["overview"==r&&(0,s.jsx)($,{showChart:t,symbol:l}),"trade"==r&&(0,s.jsx)(Z,{symbol:l}),"priceLevels"==r&&(0,s.jsx)(D,{symbol:l})]})]})});var el=t(77199);let et=a.memo(e=>{var l,t,a,i;let{symbol:r,showChart:n}=e,{resolvedTheme:o}=(0,S.F)(),[d,c]=(0,j.usePrice)(r);return(0,s.jsxs)(m.Zb,{className:"flex flex-col flex-1 w-full h-full p-0",children:[n&&(0,s.jsx)("div",{style:{height:180,width:"100%",overflow:"hidden",marginBottom:10},children:(0,s.jsx)(I,{symbol:r})}),(0,s.jsx)("table",{cellPadding:10,children:(0,s.jsxs)("tbody",{children:[(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Tham chiếu"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!d&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(d.basic,d,null==c?void 0:c.basic),backgroundColor:(0,j.getPriceBackgroundColor)(d.basic,null==c?void 0:c.basic,o)},children:d.basic.toFixed(null!==(l=d.fractionDigits)&&void 0!==l?l:2)})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Mở cửa"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!d&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(d.open,d,null==c?void 0:c.open),backgroundColor:(0,j.getPriceBackgroundColor)(d.open,null==c?void 0:c.open,o)},children:d.open.toFixed(null!==(t=d.fractionDigits)&&void 0!==t?t:2)})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Thấp - Cao"}),(0,s.jsxs)("td",{className:"font-bold text-right",children:[!!d&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(d.low,d,null==c?void 0:c.low),backgroundColor:(0,j.getPriceBackgroundColor)(d.low,null==c?void 0:c.low,o)},children:d.low.toFixed(null!==(a=d.fractionDigits)&&void 0!==a?a:2)}),"\xa0-\xa0",!!d&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(d.high,d,null==c?void 0:c.high),backgroundColor:(0,j.getPriceBackgroundColor)(d.high,null==c?void 0:c.high,o)},children:d.high.toFixed(null!==(i=d.fractionDigits)&&void 0!==i?i:2)})]})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Tổng KL"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!d&&(0,s.jsx)("span",{style:{padding:2,backgroundColor:(0,j.getValueBackgroun
1dColor)(d.totalVolume,null==c?void 0:c.totalVolume,o)},children:d.totalVolume.toLocaleString()})})]}),(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:"Tổng gi\xe1 trị"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!d&&(0,s.jsxs)("span",{style:{padding:2,backgroundColor:(0,j.getValueBackgroundColor)(d.totalValue,null==c?void 0:c.totalValue,o)},children:[(d.totalValue/1e9).toLocaleString(void 0,{maximumFractionDigits:2})," ","tỷ"]})})]})]})})]})});var es=t(41664),ea=t.n(es);let ei=a.memo(e=>{var l,t,i,r;let{symbol:n}=e,{warrantInfo:c,requestWarrantInfo:x}=(0,N.Pw)(n);return a.useEffect(()=>{x()},[x]),(0,s.jsx)(m.Zb,{className:"flex flex-col flex-1 w-full h-full p-0",children:c&&(0,s.jsx)("table",{cellPadding:10,children:(0,s.jsxs)("tbody",{children:[(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"CK cơ sở"}),(0,s.jsx)("td",{className:"font-bold text-right",children:(0,s.jsx)(ea(),{href:(0,d.BDV)(c.basicSecuritiesSymbol),children:c.basicSecuritiesSymbol})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Tổ chức ph\xe1t h\xe0nh"}),(0,s.jsx)("td",{className:"font-bold text-right",children:(0,s.jsx)(ea(),{href:(0,d.BDV)(c.issuerSymbol),children:c.issuer})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Loại quyền"}),(0,s.jsx)("td",{className:"font-bold text-right",children:0==c.right?"Mua":1==c.right?"B\xe1n":""})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Kiểu thực hiện"}),(0,s.jsx)("td",{className:"font-bold text-right",children:0==c.optionType?"Ch\xe2u \xc2u":1==c.optionType?"Mỹ":""})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Phương thức thực hiện"}),(0,s.jsx)("td",{className:"font-bold text-right",children:0==c.modeOfExerciseOfRights?"Bằng tiền":1==c.modeOfExerciseOfRights?"Bằng cổ phiếu":""})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Thời hạn"}),(0,s.jsxs)("td",{className:"font-bold text-right",children:[c.duration," th\xe1ng"]})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Ng\xe0y ph\xe1t h\xe0nh"}),(0,s.jsx)("td",{className:"font-bold text-right",children:o()(c.issuedDay).format("DD/MM/yyyy")})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Ng\xe0y ni\xeam yết"}),(0,s.jsx)("td",{className:"font-bold text-right",children:o()(c.listedDay).format("DD/MM/yyyy")})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Ng\xe0y GD đầu ti\xean"}),(0,s.jsx)("td",{className:"font-bold text-right",children:o()(c.firstTradingDay).format("DD/MM/yyyy")})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Ng\xe0y GD cuối"}),(0,s.jsx)("td",{className:"font-bold text-right",children:o()(c.lastTradingDay).format("DD/MM/yyyy")})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Ng\xe0y đ\xe1o hạn"}),(0,s.jsx)("td",{className:"font-bold text-right",children:o()(c.duedDate).format("DD/MM/yyyy")})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Tỷ lệ chuyển đổi"}),(0,s.jsxs)("td",{className:"font-bold text-right",children:[c.exerciseRatio," : 1"]})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Gi\xe1 ph\xe1t h\xe0nh"}),(0,s.jsx)("td",{className:"font-bold text-right",children:null===(l=c.originalIssuedPrice)||void 0===l?void 0:l.toLocaleString()})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Gi\xe1 thực hiện"}),(0,s.jsx)("td",{className:"font-bold text-right",children:null===(t=c.exercisePrice)||void 0===t?void 0:t.toLocaleString()})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"KL ni\xeam yết"}),(0,s.jsx)("td",{className:"font-bold text-right",children:null===(i=c.listedShares)||void 0===i?void 0:i.toLocaleStr
1ing()})]}),(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:"KL lưu h\xe0nh"}),(0,s.jsx)("td",{className:"font-bold text-right",children:null===(r=c.outStandingShares)||void 0===r?void 0:r.toLocaleString()})]})]})})})}),er=a.memo(e=>{let{symbol:l,showChart:t,initialTab:i}=e,[r,n]=a.useState(null!=i?i:"overview");return(0,s.jsxs)(m.Zb,{className:"flex h-full flex-1 flex-col p-3",children:[(0,s.jsx)("div",{children:(0,s.jsxs)("div",{className:"flex flex-row w-full gap-2 pb-3",children:[(0,s.jsx)(el.z,{size:"sm",variant:"overview"==r?"default":"ghost",onClick:()=>n("overview"),children:"Tổng hợp"}),(0,s.jsx)(el.z,{size:"sm",variant:"trade"==r?"default":"ghost",onClick:()=>n("trade"),children:"Sổ lệnh"}),(0,s.jsx)(el.z,{size:"sm",variant:"priceLevels"==r?"default":"ghost",onClick:()=>n("priceLevels"),children:"Mức gi\xe1"}),(0,s.jsx)(el.z,{size:"sm",variant:"profile"==r?"default":"ghost",onClick:()=>n("profile"),children:"Chứng quyền"})]})}),(0,s.jsxs)("div",{className:"flex flex-1 w-full",children:["overview"==r&&(0,s.jsx)(et,{showChart:t,symbol:l}),"trade"==r&&(0,s.jsx)(Z,{symbol:l}),"priceLevels"==r&&(0,s.jsx)(D,{symbol:l}),"profile"==r&&(0,s.jsx)(ei,{symbol:l})]})]})}),en=a.memo(e=>{var l,t,a,i;let{symbol:r,showChart:n}=e,{resolvedTheme:o}=(0,S.F)(),[d,c]=(0,j.usePrice)(r);return(0,s.jsxs)(m.Zb,{className:"flex flex-col flex-1 w-full h-full p-0",children:[n&&(0,s.jsx)("div",{className:"h-[180px] w-full mb-5",children:(0,s.jsx)(I,{symbol:r})}),(0,s.jsx)("table",{cellPadding:10,children:(0,s.jsxs)("tbody",{children:[(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Tham chiếu"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!d&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(d.basic,d,null==c?void 0:c.basic),backgroundColor:(0,j.getPriceBackgroundColor)(d.basic,null==c?void 0:c.basic,o)},children:d.basic.toFixed(null!==(l=d.fractionDigits)&&void 0!==l?l:2)})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Mở cửa"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!d&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(d.open,d,null==c?void 0:c.open),backgroundColor:(0,j.getPriceBackgroundColor)(d.open,null==c?void 0:c.open,o)},children:d.open.toFixed(null!==(t=d.fractionDigits)&&void 0!==t?t:2)})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Thấp - Cao"}),(0,s.jsxs)("td",{className:"font-bold text-right",children:[!!d&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(d.low,d,null==c?void 0:c.low),backgroundColor:(0,j.getPriceBackgroundColor)(d.low,null==c?void 0:c.low,o)},children:d.low.toFixed(null!==(a=d.fractionDigits)&&void 0!==a?a:2)}),"\xa0-\xa0",!!d&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(d.high,d,null==c?void 0:c.high),backgroundColor:(0,j.getPriceBackgroundColor)(d.high,null==c?void 0:c.high,o)},children:d.high.toFixed(null!==(i=d.fractionDigits)&&void 0!==i?i:2)})]})]}),(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:"Khối lượng"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!d&&(0,s.jsx)("span",{style:{padding:2,backgroundColor:(0,j.getValueBackgroun
1dColor)(d.totalVolume,null==c?void 0:c.totalVolume,o)},children:d.totalVolume.toLocaleString()})})]})]})})]})}),eo=a.memo(e=>{var l;let{symbol:t}=e,{commodityContractInfo:i,requestCommodityContractInfo:r}=(0,N._l)(t);a.useEffect(()=>{r()},[r]);let n=a.useCallback(e=>{if(!e)return"";let l=e.substring(0,4),t=e.substring(5,9);return"Thứ 2-Thứ 6, từ "+l.substring(0,2)+":"+l.substring(2,4)+" đến "+t.substring(0,2)+":"+t.substring(2,4)+(t<l?" h\xf4m sau":"")},[]);return(0,s.jsx)(m.Zb,{className:"flex flex-col flex-1 w-full h-full p-0",children:(0,s.jsx)("table",{cellPadding:10,children:(0,s.jsxs)("tbody",{children:[(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"M\xe3 h\xe0ng h\xf3a"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!i&&(0,s.jsx)("div",{children:i.commoditySymbol})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"M\xe3 hợp đồng"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!i&&(0,s.jsx)("div",{children:i.symbol})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"T\xean hợp đồng"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!i&&(0,s.jsx)("div",{children:i.name})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Kỳ hạn"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!i&&(0,s.jsxs)("div",{children:[i.month,"/",i.year]})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Ng\xe0y th\xf4ng b\xe1o"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!i&&!!i.firstNoticeDate&&(0,s.jsx)("div",{children:o()(i.firstNoticeDate).format("yyyy-MM-DD")})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Ng\xe0y giao dịch cuối"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!i&&!!i.lastTradingDate&&(0,s.jsx)("div",{children:o()(i.lastTradingDate).format("yyyy-MM-DD")})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Giờ giao dịch"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!i&&(0,s.jsx)("div",{children:n(i.session)})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Bước gi\xe1"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!i&&(0,s.jsx)("div",{children:i.tickSize})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Đơn vị yết gi\xe1"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!i&&(0,s.jsx)("div",{children:i.contractUnit})})]}),(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:"Độ lớn hợp đồng"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!i&&(0,s.jsx)("div",{children:null===(l=i.contractVolume)||void 0===l?void 0:l.toLocaleString()})})]})]})})})}),ed=a.memo(e=>{let{symbol:l,showChart:t,initialTab:i}=e,[r,n]=a.useState(null!=i?i:"overview");return(0,s.jsxs)(m.Zb,{className:"flex h-full flex-1 flex-col p-3",children:[(0,s.jsx)(h.mQ,{value:r,onValueChange:e=>n(e),children:(0,s.jsxs)(h.dr,{className:"mb-3 h-9 w-full",children:[(0,s.jsx)(h.SP,{value:"overview",className:"flex-1 text-xs",children:"Tổng hợp"}),(0,s.jsx)(h.SP,{value:"trade",className:"flex-1 text-xs",children:"Sổ lệnh"}),(0,s.jsx)(h.SP,{value:"priceLevels",className:"flex-1 text-xs",children:"Mức gi\xe1"}),(0,s.jsx)(h.SP,{value:"profile",className:"flex-1 text-xs",children:"H\xe0ng h\xf3a"})]})}),(0,s.jsxs)("div",{className:"flex w-full flex-1",children:["overview"==r&&(0,s.jsx)(en,{showChart:t,symbol:l}),"trade"==r&&(0,s.jsx)(Z,{symbol:l}),"priceLevels"==r&&(0,s.jsx)(D,{symbol:l}),"profile"==r&&(0,s.jsx)(eo,{symbol:l})]})]})}),ec=a.memo(e=>{var l,t,a,i;let{symbol:r,showChart:n}=e,{resolvedTheme:o}=(0,S.F)(),[d,c]=(0,j.usePrice)(r);return(0,s.jsxs)(m.Zb,{className:"flex flex-col flex-1 w-full h-full p-0",children:[n&&(0,s.jsx)("div",{className:"h-[180px] w-full mb-5",children:(0,s.jsx)(I,{symbol:r})}
1),(0,s.jsx)("table",{cellPadding:10,children:(0,s.jsxs)("tbody",{children:[(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Tham chiếu"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!d&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(d.basic,d,null==c?void 0:c.basic),backgroundColor:(0,j.getPriceBackgroundColor)(d.basic,null==c?void 0:c.basic,o)},children:d.basic.toFixed(null!==(l=d.fractionDigits)&&void 0!==l?l:2)})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Mở cửa"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!d&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(d.open,d,null==c?void 0:c.open),backgroundColor:(0,j.getPriceBackgroundColor)(d.open,null==c?void 0:c.open,o)},children:d.open.toFixed(null!==(t=d.fractionDigits)&&void 0!==t?t:2)})})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Thấp - Cao"}),(0,s.jsxs)("td",{className:"font-bold text-right",children:[!!d&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(d.low,d,null==c?void 0:c.low),backgroundColor:(0,j.getPriceBackgroundColor)(d.low,null==c?void 0:c.low,o)},children:d.low.toFixed(null!==(a=d.fractionDigits)&&void 0!==a?a:2)}),"\xa0-\xa0",!!d&&(0,s.jsx)("span",{style:{padding:2,color:(0,j.getPriceColor)(d.high,d,null==c?void 0:c.high),backgroundColor:(0,j.getPriceBackgroundColor)(d.high,null==c?void 0:c.high,o)},children:d.high.toFixed(null!==(i=d.fractionDigits)&&void 0!==i?i:2)})]})]}),(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:"Tổng KL"}),(0,s.jsx)("td",{className:"font-bold text-right",children:!!d&&(0,s.jsx)("span",{style:{padding:2,backgroundColor:(0,j.getValueBackgroun
1dColor)(d.totalVolume,null==c?void 0:c.totalVolume,o)},children:d.totalVolume.toLocaleString()})})]})]})})]})}),ex=a.memo(e=>{let{symbol:l,showChart:t}=e;return(0,s.jsx)(m.Zb,{className:"flex flex-1 flex-col p-3",children:(0,s.jsx)(ec,{showChart:t,symbol:l})})});function eu(e){let{low:l,high:t,value:a,format:i}=e,r=t>l?Math.min(100,Math.max(0,(a-l)/(t-l)*100)):50;return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"relative h-1.5 w-full rounded-full bg-gradient-to-r from-rose-500/70 via-amber-400/70 to-emerald-500/70",children:(0,s.jsx)("span",{"aria-hidden":!0,className:"absolute top-1/2 h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-card bg-foreground shadow",style:{left:"".concat(r,"%")}})}),(0,s.jsxs)("div",{className:"mt-1.5 flex items-center justify-between text-xs tabular-nums text-muted-foreground",children:[(0,s.jsx)("span",{children:i(l)}),(0,s.jsx)("span",{children:i(t)})]})]})}function em(e){let{label:l,children:t}=e;return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 border-b border-border/40 py-2.5 text-sm last:border-0",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:l}),(0,s.jsx)("span",{className:"text-right font-semibold tabular-nums",children:t})]})}let eh=e=>e.toLocaleString(),ef=e=>0!==e?(e/1e9).toFixed(2)+" tỷ":"0";function eg(e){let{label:l,value:t,className:a,style:i}=e;return(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"text-[11px] text-muted-foreground",children:l}),(0,s.jsx)("div",{className:(0,g.cn)("truncate font-semibold tabular-nums",a),style:i,children:t})]})}let eb=a.memo(e=>{var l,t,i,r,n,o,d,c;let{symbol:x}=e,{resolvedTheme:u}=(0,S.F)(),[h]=(0,j.usePrice)(x),f=(0,j.useStatistics)(x),[g]=(0,j.useForeignerStats)(x),b=(0,j.useSymbolInfo)(x),{symbolFundamental:v,requestSymbolFundamental:p}=(0,N.uu)(x);a.useEffect(()=>{p()},[p]);let y=null!==(l=null==h?void 0:h.fractionDigits)&&void 0!==l?l:2,w=a.useCallback(e=>e.toFixed(y),[y]),k=a.useCallback(e=>!h||null==e||e<=0?null:(h.last-e)*100/e,[h]),C=e=>null==e?(0,s.jsx)("span",{className:"text-muted-foreground",children:"—"}):(0,s.jsxs)("span",{style:{color:(0,j.getValueColor)(e,u)},children:[e>0?"+":"",e.toFixed(2),"%"]}),F=k(null==f?void 0:f.price1w),T=k(null==f?void 0:f.price1m),L=k(null==f?void 0:f.price1y),D=!!v&&!!v.marketCap,P=null!==(t=null==f?void 0:f.lowPrice1y)&&void 0!==t?t:null,V=null!==(i=null==f?void 0:f.highPrice1y)&&void 0!==i?i:null,M=null!=P&&null!=V&&V>P,A=!!h&&!!h.low&&!!h.high&&h.high>=h.low,Z=!!g&&null!=g.currentForeignRoom&&g.currentForeignRoom>0,E=null!=F||null!=T||null!=L,O=null!==(r=null==b?void 0:b.type)&&void 0!==r?r:"",B=b?"WORLD"===b.exchange?(0,s.jsx)(ex,{symbol:x}):"crypto"===O?(0,s.jsx)(H,{symbol:x}):"index"===O?(0,s.jsx)(J,{symbol:x}):"futures"===O?(0,s.jsx)(ee,{symbol:x}):"warrant"===O?(0,s.jsx)(er,{symbol:x}):"commodity"===O?(0,s.jsx)(ed,{symbol:x}):(0,s.jsx)(q,{symbol:x}):null,I=(null==b?void 0:b.type)==="stock",z=null!==(n=null==g?void 0:g.buyForeignQuantity)&&void 0!==n?n:0,_=null!==(o=null==g?void 0:g.sellForeignQuantity)&&void 0!==o?o:0,Y=z-_,G=null!==(d=null==g?void 0:g.buyForeignValue)&&void 0!==d?d:0,Q=null!==(c=null==g?void 0:g.sellForeignValue)&&void 0!==c?c:0,K=G-Q;return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(D||M||A||E||Z)&&(0,s.jsxs)(m.Zb,{className:"p-4",children:[D&&(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Vốn h\xf3a thị trường"}),(0,s.jsxs)("div",{className:"mt-0.5 text-xl font-bold tracking-tight tabular-nums",children:[(v.marketCap/1e9).toLocaleString(void 0,{maximumFractionDigits:0})," ",(0,s.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"tỷ"})]})]}),M&&!!h&&(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("div",{className:"mb-2 text-xs text-muted-foreground",children:"V\xf9ng 52 tuần"}),(0,s.jsx)(eu,{low:P,high:V,value:h.last,format:w})]}),A&&(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("div",{className:"mb-2 text-xs text-muted-foreground",children:"V\xf9ng gi\xe1 h\xf4m nay"}),(0,s.jsx)(eu,{low:h.low,high:h.high,value:h.last,format:w})]}),(E||Z)&&(0,s.jsxs)("div",{className:"flex flex-col",children:[null!=F&&(0,s.jsx)(em,{label:"% 1 tuần",children:C(F)}),null!=T&&(0,s.jsx)(em,{label:"% 1 th\xe1ng",children:C(T)}),null!=L&&(0,s.jsx)(em,{label:"% 1 năm",children:C(L)}),Z&&(0,s.jsx)(em,{label:"Room ngoại c\xf2n lại",children:g.currentForeignRoom.toLocaleStr
1ing()})]})]}),B,I&&(0,s.jsxs)(m.Zb,{className:"p-4",children:[(0,s.jsx)("div",{className:"mb-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Giao dịch NĐTNN"}),g?(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-x-2 gap-y-3",children:[(0,s.jsx)(eg,{label:"KL mua",value:eh(z),className:"text-emerald-500"}),(0,s.jsx)(eg,{label:"KL b\xe1n",value:eh(_),className:"text-rose-500"}),(0,s.jsx)(eg,{label:"KL r\xf2ng",value:eh(Y),style:{color:(0,j.getValueColor)(Y,u)}}),(0,s.jsx)(eg,{label:"GT mua",value:ef(G),className:"text-emerald-500"}),(0,s.jsx)(eg,{label:"GT b\xe1n",value:ef(Q),className:"text-rose-500"}),(0,s.jsx)(eg,{label:"GT r\xf2ng",value:ef(K),style:{color:(0,j.getValueColor)(K,u)}})]}):(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:"Đang tải…"}),(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsx)("div",{className:"mb-1 text-center text-xs text-muted-foreground",children:"GT NN mua r\xf2ng 10 phi\xean (tỷ)"}),(0,s.jsx)("div",{className:"h-[160px] w-full",children:(0,s.jsx)(R.Z,{symbol:x})})]})]})]})});eb.displayName="SymbolStatsPanel";var ev=t(87571),ep=t(94379),ej=t(42192);let ey=a.memo(e=>{let{symbol:l,onViewMoreNews:t}=e,i=(0,a.useRef)(0),{symbolPosts:r,requestSymbolPosts:n,symbolPostsStatus:o}=(0,ej.k2)(l,"NEWS");a.useEffect(()=>{i.current=0,n(0,d.L8A)},[n]);let c=a.useCallback(()=>{i.current+=d.L8A,n(i.current,d.L8A)},[n]),x=a.useMemo(()=>r.slice(0,5),[r]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"max-md:hidden",children:(0,s.jsx)(ev.Z,{useWindowScroll:!0,hasNextPage:null==o||o&&!o.isFetching&&!o.noData,isNextPageLoading:null!=o&&o.isFetching,posts:r,loadNextPage:c})}),(0,s.jsx)("div",{className:"md:hidden",children:(0,s.jsx)(ep.Z,{posts:x,onViewMore:t})})]})});ey.displayName="OverviewNews";var eN=t(63715);let ew=a.memo(e=>{let{symbol:l,onChangeTab:t}=e,[i]=(0,d.a2S)(l+"_overviewTabMarkLine",void 0),r=a.useCallback(()=>{t("news")},[t]);return(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsx)(m.Zb,{className:"flex flex-col p-3 shadow-sm",children:(0,s.jsx)("div",{className:"h-[380px] md:h-[520px]",children:(0,s.jsx)(C.default,{symbol:l,markLine:i,buttonSize:"xs",showAppLink:!0},l)})}),(0,s.jsx)("div",{className:"xl:hidden",children:(0,s.jsx)(eb,{symbol:l})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(f.Z,{title:"Tin tức",description:"Tin tức li\xean quan ".concat(l),icon:eN.Z,tone:"primary",size:"sm",className:"mb-4"}),(0,s.jsx)(ey,{symbol:l,onViewMoreNews:r})]})]})}),ek=a.memo(e=>{let{symbol:l}=e,[t,i]=(0,d.a2S)(l+"_indicessSelectedTab","overview"),r=a.useCallback(e=>{i(e)},[]);return(0,s.jsx)("div",{className:"mt-2 flex flex-1 flex-col",children:(0,s.jsxs)(h.mQ,{defaultValue:"overview",value:t,onValueChange:r,children:[(0,s.jsxs)(h.dr,{className:"mb-4 flex h-auto w-fit max-w-full flex-wrap",children:[(0,s.jsx)(h.SP,{value:"overview",children:"Tổng quan"}),(0,s.jsx)(h.SP,{value:"news",children:"Tin tức"}),(0,s.jsx)(h.SP,{value:"historical",className:"md:block hidden",children:"Dữ liệu"})]}),(0,s.jsx)(h.nU,{value:"overview",children:(0,s.jsx)(ew,{symbol:l,onChangeTab:r})}),(0,s.jsx)(h.nU,{value:"news",children:(0,s.jsx)(k.default,{symbol:l})}),(0,s.jsx)(h.nU,{value:"historical",children:(0,s.jsx)(w,{symbol:l})})]})})});var eC=t(3922);let eS=a.memo(e=>{let{symbol:l,onChangeTab:t}=e,[i]=(0,d.a2S)(l+"_overviewTabMarkLine",void 0),r=a.useCallback(()=>{t("news")},[t]);return(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsx)(m.Zb,{className:"flex flex-col p-3 shadow-sm",children:(0,s.jsx)("div",{className:"h-[380px] md:h-[520px]",children:(0,s.jsx)(C.default,{symbol:l,markLine:i,buttonSize:"xs",showAppLink:!0},l)})}),(0,s.jsx)("div",{className:"xl:hidden",children:(0,s.jsx)(eb,{symbol:l})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(f.Z,{title:"Tin tức",description:"Tin tức li\xean quan ".concat(l),icon:eN.Z,tone:"primary",size:"sm",className:"mb-4"}),(0,s.jsx)(ey,{symbol:l,onViewMoreNews:r})]})]})});var eF=t(81811);let eT=a.memo(e=>{let{count:l,type:t,top:i,exchange:r,onTopChanged:n}=e,o=(0,j.useTopSymbols)(r,t,"","actives"===i?"active":i,l),[d,c]=a.useState(["symbol","name","chart","priceLast","priceChange","pricePercentChange","totalVolume"]),x=a.useCallback(e=>{n&&n(e)},[n]);return(0,s.jsxs)("div",{className:"flex flex-col flex-1 w-full h-full pt-2",children:[(0,s.jsx)("div",{className:"flex flex-row items-center justify-between",children:(0,s.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,s.jsx)(el.z,{size:"sm",variant:"actives"==i?"default":"ghost",onClick:()=>
1x("actives"),children:"T\xedch cực"}),(0,s.jsx)(el.z,{size:"sm",variant:"gainers"==i?"default":"ghost",onClick:()=>x("gainers"),children:"Tăng gi\xe1 (%)"}),(0,s.jsx)(el.z,{size:"sm",variant:"losers"==i?"default":"ghost",onClick:()=>x("losers"),children:"Giảm gi\xe1 (%)"})]})}),(0,s.jsx)("div",{className:"flex-1 mt-2",children:(0,s.jsx)(eF.Z,{symbols:o,columns:d,headerStickyTop:159})})]})}),eL=a.memo(e=>{let{symbol:l}=e,[t,i]=(0,d.a2S)("IndicesTopStocks","actives"),r=a.useMemo(()=>{let e="";switch(l){case"VNINDEX":e="HSX";break;case"HNXINDEX":e="HNX";break;case"UPINDEX":e="UPCOM"}return e},[l]);return(0,s.jsx)(eT,{exchange:r,top:t,onTopChanged:e=>{i(e)},type:"stock",count:100})}),eD=a.memo(e=>{let{symbol:l}=e,[t,i]=(0,d.a2S)(l+"_indicessSelectedTab","overview"),r=a.useCallback(e=>{i(e)},[]);return(0,s.jsx)("div",{className:"mt-2 flex flex-1 flex-col",children:(0,s.jsxs)(h.mQ,{defaultValue:"overview",value:t,onValueChange:r,children:[(0,s.jsxs)(h.dr,{className:"mb-4 flex h-auto w-fit max-w-full flex-wrap",children:[(0,s.jsx)(h.SP,{value:"overview",children:"Tổng quan"}),(0,s.jsx)(h.SP,{value:"news",children:"Tin tức"}),["VNINDEX","HNXINDEX","UPINDEX"].indexOf(l)>=0&&(0,s.jsx)(h.SP,{value:"stocks",children:"Top cổ phiếu"}),(0,s.jsx)(h.SP,{value:"historical",className:"md:block hidden",children:"Dữ liệu"})]}),(0,s.jsx)(h.nU,{value:"overview",children:(0,s.jsx)(eS,{symbol:l,onChangeTab:r})}),(0,s.jsx)(h.nU,{value:"news",children:(0,s.jsx)(k.default,{symbol:l})}),(0,s.jsx)(h.nU,{value:"stocks",children:(0,s.jsx)(eL,{symbol:l})}),(0,s.jsx)(h.nU,{value:"historical",children:(0,s.jsx)(w,{symbol:l})})]})})}),eP=a.memo(e=>{let{event:l,index:t}=e;return(0,s.jsxs)("div",{className:"flex flex-row items-center border-b border-border/40 px-2 py-2.5 text-sm transition-colors hover:bg-muted/30 sm:px-3",children:[(0,s.jsx)("div",{className:"flex flex-1 flex-row whitespace-nowrap tabular-nums text-xs text-muted-foreground",children:o()(l.recordDate).format("YYYY-MM-DD")}),(0,s.jsx)("div",{className:"line-clamp-2 flex-[3] px-1 text-left text-sm leading-snug text-foreground",children:l.title}),(0,s.jsx)("div",{className:"flex flex-1 flex-row justify-end whitespace-nowrap tabular-nums text-xs text-foreground",children:l.executionDate&&(0,s.jsx)("span",{children:o()(l.executionDate).format("YYYY-MM-DD")})})]})});var eV=t(14166);function eM(e){let{hasNextPage:l,isNextPageLoading:t,events:i,loadNextPage:r}=e,n=(0,d.pCp)("events",0),o=(0,a.useCallback)((e,l)=>(0,s.jsx)(eP,{event:l,index:e}),[]),c=(0,a.useCallback)(()=>t?(0,s.jsx)("div",{className:"flex flex-row justify-center items-center py-4",children:(0,s.jsx)(x.Z,{color:"#0ea5e9",loading:!0,size:28,"aria-label":"Đang tải","data-testid":"loader"})}):null,[t]),h=(0,a.useCallback)(e=>{n.current=e.startIndex},[]),g=(0,a.useCallback)(()=>{r()},[r]),b="text-xs font-medium uppercase tracking-wide text-muted-foreground";return(0,s.jsxs)(m.Zb,{className:"overflow-visible p-0 shadow-sm",children:[(0,s.jsx)("div",{className:"px-4 py-3 border-b border-border/60 bg-muted/15",children:(0,s.jsx)(f.Z,{title:"Lịch sự kiện & cổ tức",description:"Ng\xe0y ĐK CCQ, nội dung v\xe0 ng\xe0y thực hiện",icon:eV.Z,tone:"violet",size:"sm"})}),(0,s.jsx)("div",{className:"sticky z-40 border-b border-border/60 bg-card text-card-foreground shadow-[0_4px_12px_-4px_rgba(0,0,0,0.12)] [isolation:isolate] dark:shadow-[0_4px_12px_-4px_rgba(0,0,0,0.35)]",style:{top:"var(--symbol-sticky-top, 160px)"},children:(0,s.jsxs)("div",{className:"flex w-full flex-row items-center px-2 py-2.5 sm:px-3",children:[(0,s.jsx)("div",{className:"flex flex-row flex-1 px-1 ".concat(b),children:"GD KHQ"}),(0,s.jsx)("div",{className:"flex flex-row px-1 flex-[3] ".concat(b),children:"Sự kiện"}),(0,s.jsx)("div",{className:"flex flex-row flex-1 justify-end px-1 text-right ".concat(b),children:"Thực hiện"})]})}),(0,s.jsx)("div",{className:"px-1 sm:px-2",children:(0,s.jsx)(u.OO,{useWindowScroll:!0,initialItemCount:Math.min(Math.floor(.9*d.L8A),i.length),itemContent:o,components:{Footer:c}
1,endReached:g,data:i,rangeChanged:h,initialTopMostItemIndex:n.current})})]})}var eA={backgroundColor:"transparent",tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(e){return"Cổ tức bằng tiền: ".concat(e[0].value.toLocaleString(),"đ")}},grid:{top:"5%",left:"0%",right:"0%",bottom:"0%",containLabel:!0},xAxis:[{type:"category",data:[],axisTick:{alignWithLabel:!0}}],yAxis:[{type:"value",splitLine:{lineStyle:{type:"dashed",color:"rgba(100, 100, 100, 0.2)"}}}],series:[{name:"Cổ tức bằng tiền",type:"bar",barWidth:"60%",data:[]}]};let eZ=a.memo(e=>{let{dividends:l}=e,{resolvedTheme:t}=(0,S.F)(),[i,r]=a.useState(eA),n=a.useRef(null),o=a.useRef(null);return a.useEffect(()=>{let e=o.current;if(!e)return;let l=new ResizeObserver(()=>{var e,l,t;null===(e=n.current)||void 0===e||null===(l=e.getEchartsInstance)||void 0===l||null===(t=l.call(e))||void 0===t||t.resize()});return l.observe(e),()=>l.disconnect()},[]),a.useEffect(()=>{if(l){let e=Object.assign({},i);e.xAxis=Object.assign({},e.xAxis),e.xAxis.data=l.map(e=>e.year),e.series=[...e.series],e.series[0]=Object.assign({},e.series[0]),e.series[0].data=l.map(e=>e.cashDividend),r(e)}},[l]),(0,s.jsx)("div",{ref:o,className:"w-full overflow-hidden",children:(0,s.jsx)(F.default,{ref:n,option:i,theme:t,style:{width:"100%",height:280}})})});var eE={backgroundColor:"transparent",tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(e){return"Cổ tức bằng CP: ".concat(e[0].value.toLocaleString(),"%")}},grid:{top:"5%",left:"0%",right:"0%",bottom:"0%",containLabel:!0},xAxis:[{type:"category",data:[],axisTick:{alignWithLabel:!0}}],yAxis:[{type:"value",splitLine:{lineStyle:{type:"dashed",color:"rgba(100, 100, 100, 0.2)"}}}],series:[{name:"Cổ tức bằng CP",type:"bar",barWidth:"60%",data:[]}]};let eO=a.memo(e=>{let{dividends:l}=e,{resolvedTheme:t}=(0,S.F)(),[i,r]=a.useState(eE),n=a.useRef(null),o=a.useRef(null);return a.useEffect(()=>{let e=o.current;if(!e)return;let l=new ResizeObserver(()=>{var e,l,t;null===(e=n.current)||void 0===e||null===(l=e.getEchartsInstance)||void 0===l||null===(t=l.call(e))||void 0===t||t.resize()});return l.observe(e),()=>l.disconnect()},[]),a.useEffect(()=>{if(l){let e=Object.assign({},i);e.xAxis=Object.assign({},e.xAxis),e.xAxis.data=l.map(e=>e.year),e.series=[...e.series],e.series[0]=Object.assign({},e.series[0]),e.series[0].data=l.map(e=>e.stockDividend),r(e)}},[l]),(0,s.jsx)("div",{ref:o,className:"w-full overflow-hidden",children:(0,s.jsx)(F.default,{ref:n,option:i,theme:t,style:{width:"100%",height:280}})})});var eB=t(19858),eI=t(64154),ez=t(17727);let eq=a.memo(e=>{let{dividends:l}=e,t=a.useRef(null),[i,r]=a.useState(0);a.useEffect(()=>{let e=t.current;if(!e)return;let l=()=>r(e.clientWidth);l();let s=new ResizeObserver(l);return s.observe(e),()=>s.disconnect()},[]);let n=i>=560;return(0,s.jsx)("div",{className:"flex flex-col gap-5",children:(0,s.jsxs)(m.Zb,{ref:t,className:"overflow-visible p-0 shadow-sm",children:[(0,s.jsx)("div",{className:"border-b border-border/60 bg-muted/15 px-4 py-3",children:(0,s.jsx)(f.Z,{title:"Diễn biến cổ tức",description:"So s\xe1nh theo năm — tiền mặt v\xe0 cổ phiếu",icon:eB.Z,tone:"amber",size:"sm"})}),(0,s.jsxs)("div",{className:"grid gap-4 p-4",style:{gridTemplateColumns:n?"repeat(2, minmax(0, 1fr))":"minmax(0, 1fr)"},children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border/60 bg-muted/10 p-3",children:[(0,s.jsx)(f.Z,{title:"Cổ tức tiền mặt",description:"Đơn vị: đồng / cổ phiếu",icon:eI.Z,tone:"emerald",size:"sm",className:"mb-3"}),(0,s.jsx)(eZ,{dividends:l})]},"cash-".concat(n?2:1)),(0,s.jsxs)("div",{className:"rounded-xl border border-border/60 bg-muted/10 p-3",children:[(0,s.jsx)(f.Z,{title:"Cổ tức cổ phiếu",description:"Tỷ lệ phần trăm (%CP)",icon:ez.Z,tone:"rose",size:"sm",className:"mb-3"}),(0,s.jsx)(eO,{dividends:l})]},"stock-".concat(n?2:1))]})]})})}),e_=a.memo(e=>{let{symbol:l}=e,t=(0,a.useRef)(0),{companyEvents:i,requestCompanyEvents:r,companyEventsStatus:n}=(0,N.V8)(l),{stockDividends:o,requestStockDividends:c}=(0,N.W_)(l,4);(0,a.useEffect)(()=>{t.current=0,c(),r(0,1,null,null,0,d.L8A)},[r,c]);let x=(0,a.useCallback)(async()=>{t.current+=d.L8A,r(0,1,null,null,t.current,d.L8A)},[r]);return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-5",children:[o&&(0,s.jsx)(eq,{dividends:o}),i&&(0,s.jsx)(eM,{events:i,hasNextPage:null==n||n&&!n.isFetching&&!n.noData,isNextPageLoading:null!=n&&n.isFetching,loadNextPage:x})]})});var eH=t(68899),eY={backgroundColor:"transparent",grid:{top:0,bottom:0,right:0,left:0},xAxis:{type:"category",show:!1},yAxis:{type:"value",show:!1,min:"dataMin"},series:[{data:[],type:"line"}]};let eG=a.memo(e=>{let{data:l,style:t}=e,{resolvedTheme:i}=(0,S.F)(),[r,n]=a.useState(eY);return a.useEffect(()=>{let e=Object.assign({},r);e.series=[...e.series],e.series[0]=Object.assign({},e.series[0]),e.series[0].data=l,n(e)},[l]),(0,s.jsx)(F.default,{option:r,theme:i,style:t})}),eQ=a.memo(e=>{let{allIndicators:l,group:t,financialData:i}=e,[r,n]=(0,a.useState)([]),o=(e,l)=>{let t=eH.$G.find(e=>e.name==l.replace(" (%)",""));return t?"%"===t.unit?100*(+e.financialValues[t.key]||0):+e.financialValues[t.key]||0:null};if((0,a.useEffect)(()=>{let e=[];l.forEach(l=>{l.group==t.group&&e.push(l)});let s=e.map(e=>{var l;return{name:e.name,value:i.map(t=>({time:t.quarter<=0?"".concat(t.year):"Q".concat(t.quarter,"/").concat(t.year),value:null!==(l=o(t,e.name))&&void 0!==l?l:0})).reverse()}});n(s)},[l,t,JSON.stringify(i)]),!r.length)return null;let d=Math.min(Math.max((r.length+1)*52,120),560);return(0,s.jsxs)(m.Zb,{className:"overflow-hidden p-0 shadow-sm",children:[(0,s.jsx)("div",{className:"border-b border-border/60 bg-muted/15 px-4 py-2.5",children:(0,s.jsx)("h3",{className:"text-sm font-semibold leading-snug text-foreground",children:t.name})}),(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsx)(u._n,{style:{height:d},data:r,components:{Table:e=>{let{style:l,...t}=e;return(0,s.jsx)("table",{...t,className:"w-full text-sm border-collapse",style:{...l,width:"100%"}})},TableRow:e=>(0,s.jsx)("tr",{...e,className:"border-b transition-colors border-border/40 hover:bg-muted/25"})},fixedHeaderContent:()=>(0,s.jsxs)("tr",{className:"border-b backdrop-blur border-border/60 bg-card/95",children:[(0,s.jsx)("th",{className:"sticky left-0 z-20 w-40 min-w-[10rem] bg-card px-2 py-2 text-left text-xs font-medium uppercase tracking-wide text-muted-foreground shadow-[4px_0_12px_-8px_rgba(0,0,0,0.15)] dark:shadow-[4px_0_12px_-8px_rgba(0,0,0,0.4)]"}),(0,s.jsx)("th",{className:"px-1 py-2 w-24 bg-card"}),r[0].value.map(e=>(0,s.jsx)("th",{className:"px-2 py-2 text-xs font-medium tabular-nums text-right whitespace-nowrap text-muted-foreground",children:e.time},e.time))]}),itemContent:(e,l)=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("td",{className:"sticky left-0 z-10 w-40 min-w-[10rem] bg-card px-2 py-2 align-top font-medium leading-snug shadow-[4px_0_12px_-8px_rgba(0,0,0,0.12)] dark:bg-card dark:shadow-[4px_0_12px_-8px_rgba(0,0,0,0.35)]",children:(0,s.jsx)("div",{className:"max-w-[10rem] text-xs sm:text-sm",children:l.name})}),(0,s.jsx)("td",{className:"px-1 py-2 align-middle bg-transparent",children:(0,s.jsx)("div",{className:"hidden md:block",children:(0,s.jsx)(eG,{data:l.value.map(e=>e.value),style:{width:60,height:20}})})}),l.value.map(e=>(0,s.jsx)("td",{className:"px-2 py-2 text-xs tabular-nums text-right whitespace-nowrap text-foreground sm:text-sm",children:Intl.NumberFormat().format(+e.value.toFixed(2))},"".concat(l.name,"-").concat(e.time)))]})})})]})});var eR=t(16085),eK=t(46795);let eU=a.memo(e=>{let{symbol:l}=e,[t,i]=a.useState("Q"),{financialData:r,requestFinancialData:n}=(0,N.o_)(l,"Q",5),{financialData:o,requestFinancialData:d}=(0,N.o_)(l,"Y",5),{financialIndicators:c,requestFinancialIndicators:x}=(0,N.KG)(l),u=a.useMemo(()=>c.reduce((e,l)=>(e.some(e=>e.group===l.group)||e.push({group:l.group,name:l.groupName}),e),[]).sort((e,l)=>e.group-l.group),[c]);return(0,a.useEffect)(()=>{n(),d(),x()},[n,d,x]),(0,s.jsxs)("div",{className:"flex flex-1 flex-col gap-5",children:[(0,s.jsx)(m.Zb,{className:"border-0 bg-transparent p-0 shadow-none",children:(0,s.jsx)(f.Z,{title:"Chỉ ti\xeau t\xe0i ch\xednh",description:"Chỉ số theo qu\xfd hoặc năm — đồng bộ với bảng c\xe2n đối",icon:eK.Z,tone:"indigo",size:"sm",rightSlot:(0,s.jsx)(eR.Z,{value:t,onChange:i})})}),u.map(e=>(0,s.jsx)(eQ,{allIndicators:c,group:e,financialData:"Q"===t?null!=r?r:[]:null!=o?o:[]},e.group))]})});var eW=t(35200),eX=t(7314),eJ=t(31012),e$=t(98814),e0=t(64998),e1=t(5019);let e2=a.memo(e=>{var l;let{row:t,unit:a,hasChildren:i,show:r,expanded:n,visibleCount:o,onToggleExpand:d}=e;return r?(0,s.jsxs)("tr",{className:"border-b transition-colors border-border/40 hover:bg-muted/25",children:[(0,s.jsxs)("td",{className:"py-2 pl-2 text-sm",style:{paddingLeft:(1==t.level?5:20*t.level)+(i?0:24),fontWeight:t.level<=2?"600":"normal"},children:[i&&(0,s.jsx)(el.z,{size:"xs",variant:"ghost",onClick:()=>d(t),children:n?(0,s.jsx)(eX.Z,{size:12}):(0,s.jsx)(eJ.Z,{size:12})}),t.name]}),(0,s.jsx)("td",{className:"py-2 pr-1 align-middle whitespace-nowrap",children:(0,s.jsx)(eW.Z,{data:t.values.map(e=>null!==(l=e.value)&&void 0!==l?l:0),style:{width:26,height:16}})}
1),t.values.slice(Math.max(t.values.length-o,0)).map(e=>(0,s.jsx)("td",{className:"px-2 py-2 text-sm tabular-nums text-right text-foreground",style:{fontWeight:t.level<=2?"600":"normal"},children:null!=e.value?Math.round(e.value/a).toLocaleString():""},e.period))]}):null}),e4=a.memo(e=>{let{symbol:l}=e,[t,i]=(0,a.useState)(2),[r,n]=(0,a.useState)(1e6),[o,d]=(0,a.useState)(0),{financialReports:c,requestFinancialReports:u,financialReportsStatus:g}=(0,N.QR)(l),[b,v]=(0,a.useState)(new Map),[p,j]=(0,a.useState)(new Map),y=(0,a.useRef)(0),w=(0,a.useRef)(null),[k,C]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=w.current;if(!e)return;let l=()=>C(e.clientWidth);l();let t=new ResizeObserver(l);return t.observe(e),()=>t.disconnect()},[]);let S=0===k?3:Math.max(2,Math.min(5,Math.floor((k-250)/110)));(0,a.useEffect)(()=>{y.current=0;let e=new Date,l=e.getFullYear(),s=e.getMonth()+1;u(t,l,0==o?Math.ceil(s/3):0,0,6)},[o,t,u]),(0,a.useEffect)(()=>{if(c){let e=new Map;c.forEach(l=>{l.level<=2&&e.set(l.id,!0)}),j(e);let l=new Map;c.forEach(e=>{l.set(e.id,e)}),v(l);let t=0;c.length>0&&c[0].values.length>0&&(t=10*c[0].values[c[0].values.length-1].year+c[0].values[c[0].values.length-1].quarter),t>y.current&&(y.current=t)}},[c]);let F=(0,a.useCallback)(e=>{let l=new Map(p);l.has(e.id)?l.delete(e.id):l.set(e.id,!0),j(l)},[p]),T=(0,a.useCallback)(e=>{if(1==e.level)return!0;if(!p.has(e.parentID))return!1;let l=b.get(e.parentID);return!l||T(l)},[p,b]),L=(0,a.useCallback)(e=>{n(e.target.value)},[]),D=(0,a.useCallback)(e=>{d(e.target.value)},[]),P=(0,a.useCallback)(()=>!!c&&c.length>0&&c[0].values.length>S,[c,S]),V=(0,a.useCallback)(()=>{let e=0;return c.length>0&&c[0].values.length>0&&(e=10*c[0].values[c[0].values.length-1].year+c[0].values[c[0].values.length-1].quarter),e<y.current},[c]),M=(0,a.useCallback)(()=>{if(c&&c.length>0){let e=c[0].values[c[0].values.length-1].year,l=c[0].values[c[0].values.length-1].quarter;0==l?e-=1:1==l?(l=4,e-=1):l-=1,u(t,e,l,0,6)}},[t,u,c]),A=(0,a.useCallback)(()=>{if(c&&c.length>0){let e=c[0].values[c[0].values.length-1].year,l=c[0].values[c[0].values.length-1].quarter;0==l?e+=1:4==l?(l=1,e+=1):l+=1,u(t,e,l,0,6)}},[t,u,c]),Z="min-w-[7rem] rounded-xl border border-border/60 bg-background px-2 py-1.5 text-xs text-foreground shadow-sm focus:outline-none focus:ring-2 focus:ring-ring sm:text-sm";return(0,s.jsxs)(m.Zb,{ref:w,className:"overflow-visible p-0 shadow-sm",children:[(0,s.jsxs)("div",{className:"px-3 py-3 border-b border-border/60 bg-muted/15 sm:px-4",children:[(0,s.jsx)(f.Z,{title:"B\xe1o c\xe1o t\xe0i ch\xednh",description:"Chọn loại b\xe1o c\xe1o, kỳ v\xe0 đơn vị hiển thị",icon:e1.Z,tone:"emerald",size:"sm"}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(h.mQ,{value:String(t),onValueChange:e=>i(Number(e)),children:(0,s.jsxs)(h.dr,{className:"grid grid-cols-2 gap-1 p-1 w-full h-auto min-h-11 sm:flex sm:flex-wrap sm:justify-start",children:[(0,s.jsx)(h.SP,{value:"1",className:"text-xs sm:text-sm",children:"C\xe2n đối kế to\xe1n"}),(0,s.jsx)(h.SP,{value:"2",className:"text-xs sm:text-sm",children:"Kết quả kinh doanh"}),(0,s.jsx)(h.SP,{value:"3",className:"text-xs sm:text-sm",children:"LCTT trực tiếp"}),(0,s.jsx)(h.SP,{value:"4",className:"text-xs sm:text-sm",children:"LCTT gi\xe1n tiếp"})]})})})]}),(!g||(!c||0==c.length)&&g.isFetching)&&(0,s.jsx)("div",{className:"flex justify-center items-center py-10",children:(0,s.jsx)(x.Z,{color:"#0ea5e9",loading:!0,size:24,"aria-label":"Đang tải","data-testid":"loader"})}),c&&c.length>0&&(0,s.jsx)("div",{className:"pb-3 w-full min-w-0",children:(0,s.jsx)("div",{className:"max-md:-mx-3 max-md:px-3 max-md:overflow-x-auto md:overflow-visible md:px-0",children:(0,s.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,s.jsx)("thead",{className:"sticky z-40 border-b border-border/60 bg-card text-card-foreground shadow-[0_4px_12px_-4px_rgba(0,0,0,0.12)] [isolation:isolate] dark:shadow-[0_4px_12px_-4px_rgba(0,0,0,0.35)]",style:{top:"var(--symbol-sticky-top, 160px)"},children:(0,s.jsxs)("tr",{className:"border-b border-border/60",children:[(0,s.jsx)("th",{className:"min-w-[200px] px-2 py-3 text-left align-bottom",children:(0,s.jsxs)("div",{className:"flex flex-row flex-wrap gap-2 items-center",children:[(0,s.jsxs)("div",{className:"inline-flex gap-1 items-center shrink-0",children:[(0,s.jsx)(el.z,{type:"button",onClick:M,size:"xs",variant:"outline",disabled:!P(),"aria-label":"Kỳ trước",children:(0,s.jsx)(e$.Z,{size:14})}),(0,s.jsx)(el.z,{type:"button",onClick:A,disabled:!V(),size:"xs",variant:"outline","aria-label":"Kỳ sau",children:(0,s.jsx)(e0.Z,{size:14})})]}),(0,s.jsxs)("select",{onChange:D,value:o,className:Z,children:[(0,s.jsx)("option",{value:0,children:"Theo qu\xfd"}),(0,s.jsx)("option",{value:1,children:"Theo năm"})]}),(0,s.jsxs)("select",{onChange:L,value:r,className:Z,children:[(0,s.jsx)("option",{value:1e6,children:parseInt("1000000").toLocaleStr
1ing()}),(0,s.jsx)("option",{value:1e3,children:parseInt("1000").toLocaleString()}),(0,s.jsx)("option",{value:1,children:"1"})]}),null!=g&&g.isFetching&&(0,s.jsx)(x.Z,{color:"#0ea5e9",loading:!0,size:18,"aria-label":"Đang tải","data-testid":"loader"})]})}),(0,s.jsx)("th",{className:"w-10"}),c[0].values.slice(Math.max(c[0].values.length-S,0)).map(e=>(0,s.jsx)("th",{className:"px-2 py-3 text-xs font-semibold tabular-nums text-right text-muted-foreground",children:e.period},e.period))]})}),(0,s.jsx)("tbody",{children:c.map(e=>(0,s.jsx)(e2,{hasChildren:c.findIndex(l=>l.parentID==e.id)>=0,show:T(e),expanded:!!p.get(e.id),row:e,unit:r,visibleCount:S,onToggleExpand:F},e.id))})]})})})]})});var e5=t(49460),e3={backgroundColor:"transparent",tooltip:{trigger:"item",formatter:"{b} (%) : {d}",textStyle:{fontFamily:"sans-serif"}},grid:{top:0,bottom:80,left:0,right:0},title:{text:"Quyền sở hữu",textStyle:{fontFamily:"sans-serif"}},legend:{orient:"horizontal",bottom:10,left:"center",textStyle:{fontFamily:"sans-serif"}},color:["#3fb1e3","#6be6c1","#626c91","#a0a7e6","#c4ebad","#96dee8"],series:[{type:"pie",radius:["40%","70%"],center:["50%","45%"],data:[],emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},itemStyle:{normal:{label:{show:!1},labelLine:{show:!1}}}}]};let e6=a.memo(e=>{let{profile:l}=e,{resolvedTheme:t}=(0,S.F)(),[i,r]=a.useState(e3),n=(0,e5.ac)("(max-width : 768px)");return a.useEffect(()=>{if(l){var e;let t=Object.assign({},i);t.series=[...t.series],t.series[0]=Object.assign({},t.series[0]),t.series[0].data=[{value:l.foreignOwnership,name:"Nước ngo\xe0i"},{value:l.stateOwnership,name:"Nh\xe0 nước"},{value:l.otherOwnership,name:"Kh\xe1c"}],t.legend=Object.assign({},t.legend),t.legend.formatter=function(e){return e+" :  "+(100*t.series[0].data.find(l=>l.name==e).value).toFixed(2)+"%"},t.tooltip={...null!==(e=t.tooltip)&&void 0!==e?e:{},show:!n},r(t)}},[l,n]),(0,s.jsx)(F.default,{option:i,theme:t,style:{width:"100%",height:300,minHeight:300}})});var e9=e=>{let{symbol:l,financialData:t}=e,{resolvedTheme:i}=(0,S.F)(),[r,n]=a.useState(),o=(0,e5.ac)("(max-width : 768px)");return a.useEffect(()=>{var e;if(!(null==t?void 0:t.length)){n(void 0);return}let l=function(e){var l,s;let a,i;let r=e[0].companyType;switch(r){case"General":a=[{id:"MarketCapAtPeriodEnd",name:"Vốn h\xf3a thị trường",value:null},{id:"ShortTermInterestBearingDebt",name:"Nợ vay ngắn hạn",value:null},{id:"LongTermInterestBearingDebt",name:"Nợ vay d\xe0i hạn",value:null},{id:"Cash",name:"Tiền",value:null},{id:"CashEquivalent",name:"Tương đương tiền",value:null},{id:"ShortTermFinancialInvestment",name:"Đầu tư TC ngắn hạn",value:null}];break;case"Bank":a=[{id:"MarketCapAtPeriodEnd",name:"Vốn h\xf3a thị trường",value:null},{id:"TotalInterestBearingDebt",name:"Nợ vay",value:null},{id:"CashGoldJewelry",name:"Tiền & TĐ tiền",value:null},{id:"DepositAtStateBank",name:"Tiền gửi tại NHNN",value:null}];break;case"Securities":a=[{id:"MarketCapAtPeriodEnd",name:"Vốn h\xf3a thị trường",value:null}
1,{id:"ShorttermBorrowingAndFinancialLease",name:"Nợ vay ngắn hạn",value:null},{id:"LongtermBorrowingAndFinancialLease",name:"Nợ vay d\xe0i hạn",value:null},{id:"CashAndCashEquivalent",name:"Tiền & TĐ tiền",value:null}];break;case"Insurance":a=[{id:"MarketCapAtPeriodEnd",name:"Vốn h\xf3a thị trường",value:null},{id:"ShortTermBorrowingAndDebt",name:"Nợ vay ngắn hạn",value:null},{id:"LongTermBorrowingAndDebt",name:"Nợ vay d\xe0i hạn",value:null},{id:"UnderwritingReserve",name:"Dự ph\xf2ng nghiệp vụ",value:null},{id:"CashAndCashEquivalent",name:"Tiền & TĐ tiền",value:null},{id:"ShortTermSecuritiesInvestment",name:"Đầu tư chứng kho\xe1n ngắn hạn",value:null}]}let n=e[0].financialValues;if(!a)return;switch(a.forEach(function(e,l,t){t[l].value=n[t[l].id]/1e9}),r){case"General":(i=[{name:"Vốn h\xf3a thị trường",value:a[0].value},{name:"Nợ vay",value:a[1].value+a[2].value},{name:"Tiền & TĐ tiền",value:a[3].value+a[4].value+a[5].value},{name:"Gi\xe1 trị doanh nghiệp",value:0}])[3].value=i[0].value+i[1].value-i[2].value;break;case"Bank":(i=[{name:"Vốn h\xf3a thị trường",value:a[0].value},{name:"Nợ vay",value:a[1].value},{name:"Tiền & TĐ tiền",value:a[2].value+a[3].value},{name:"Gi\xe1 trị doanh nghiệp",value:0}])[3].value=i[0].value+i[1].value-i[2].value;break;case"Securities":(i=[{name:"Vốn h\xf3a thị trường",value:a[0].value},{name:"Nợ vay",value:a[1].value+a[2].value},{name:"Tiền & TĐ tiền",value:a[3].value},{name:"Gi\xe1 trị doanh nghiệp",value:0}])[3].value=i[0].value+i[1].value-i[2].value;break;case"Insurance":(i=[{name:"Vốn h\xf3a thị trường",value:a[0].value},{name:"Nợ vay",value:a[1].value+a[2].value+a[3].value},{name:"Tiền & TĐ tiền",value:a[4].value+a[5].value},{name:"Gi\xe1 trị doanh nghiệp",value:0}])[3].value=i[0].value+i[1].value-i[2].value}if(!i)return;let o={BlankField:["",i[3].value,""],MarketCap:[i[0].value,"",""],Debt:[i[1].value,"",""],CashAndCashEquivalent:["",i[2].value,""],EnterpriseValue:["","",i[3].value]},d={line1:[i[0].value+i[1].value,i[0].value+i[1].value,null],line2:[null,i[3].value,i[3].value]},c=i.map(e=>e.name),x={backgroundColor:"transparent",title:{text:"Gi\xe1 trị doanh nghiệp "+"Q".concat(null===(l=t[0])||void 0===l?void 0:l.quarter,"/").concat(null===(s=t[0])||void 0===s?void 0:s.year),textStyle:{fontFamily:"sans-serif"}},tooltip:{trigger:"axis",show:!0,formatter:function(e){var l="";return e.forEach(function(e,t){t>0&&t<5&&null!=e.value&&""!==e.value&&!isNaN(e.value)&&(l+=e.marker+" <b/>"+e.seriesName+"</b>: "+new Intl.NumberFormat().format(e.value.toFixed(2))+"<br/>")}),l},textStyle:{fontFamily:"sans-serif"}},legend:{data:c,bottom:10,left:"center",orient:"horizontal",textStyle:{fontFamily:"sans-serif"}},xAxis:{type:"category",splitLine:{show:!1},axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1}},yAxis:{type:"value",axisLabel:{show:!1},axisLine:{show:!1}},grid:{top:60,bottom:70,left:20,right:20},series:[{name:"Blank",type:"bar",stack:"Total",silent:!0,itemStyle:{borderColor:"transparent",color:"transparent"},barWidth:40,emphasis:{itemStyle:{borderColor:"transparent",color:"transparent"}},data:o.BlankField},{name:c[0],type:"bar",stack:"Total",data:o.MarketCap,itemStyle:{color:"#3fb1e3"},barWidth:40},{name:c[1],type:"bar",stack:"Total",data:o.Debt,itemStyle:{color:"#6be6c1"},barWidth:40},{name:c[2],type:"bar",stack:"Total",data:o.CashAndCashEquivalent,itemStyle:{color:"#626c91"},barWidth:40},{name:c[3],type:"bar",stack:"Total",data:o.EnterpriseValue,itemStyle:{color:"#a0a7e6"},barWidth:40},{type:"line",showSymbol:!1,data:d.line1,lineStyle:{type:"dashed",width:1,color:"#A3A3A3"}},{type:"line",showSymbol:!1,data:d.line2,lineStyle:{type:"dashed",width:1,color:"#A3A3A3"}}]};return x}(t);if(!l){n(void 0);return}l.tooltip={...null!==(e=l.tooltip)&&void 0!==e?e:{},show:!o},n(l)},[JSON.stringify(t),o]),r&&(0,s.jsx)(F.default,{option:r,theme:i,style:{width:"100%",height:300,minHeight:220}})},e8=t(90175),e7=t(63616),le=e=>{var l,t,i;let{symbol:r}=e,[n,o]=a.useState("Y"),{financialDataQ:d,financialDataY:c}=(0,e7.w)(r),x=(e,l)=>e?e.map(e=>Number(e.financialValues[l])/1e9):[],u="Q"===n?d:c;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"text-lg font-bold opacity-80 dark:opacity-100",children:"Hiệu suất"}),(0,s.jsx)(eR.Z,{value:n,onChange:o})]}),(0,s.jsx)(e8.Z,{title:"",name1:"Doanh thu thuần",name2:"Lợi nhuận r\xf2ng",name3:"Bi\xean lợi nhuận r\xf2ng",data1:null!==(l=x(u,"NetSale").reverse())&&void 0!==l?l:[],data2:null!==(t=x(u,"ParentCompanyShareholderProfitAfterTax").reverse())&&void 0!==t?t:[],data3:null!==(i=(u?u.map(e=>{var l;return 100*Number(null!==(l=e.financialValues.ROS)&&void 0!==l?l:0)}):[]).reverse())&&void 0!==i?i:[],data3Type:"line",category:(u&&u.length>0?u.map(e=>0===e.quarter?"".concat(e.year):"Q".concat(e.quarter,"/").concat(e.year)):[]).reverse(),style:{height:280},useSecondYAxis:!0,displaySecondYAxis:!1})]})},ll=t(34623),lt=t(29837),ls=t(59569);let la=["#3fb1e3","#6be6c1","#626c91","#a0a7e6","#c4ebad","#96dee8"];var li=e=>{let{symbol:l}=e,{resolvedTheme:t}=(0,S.F)(),[i,r]=a.useState(),n=(0,e5.ac)("(max-width : 768px)"),{financialDataQ:o,financialDataY:d}=(0,e7.w)(l),c=(e,l)=>{var t,s,a,i;let r,n,o;let d=null===(t=l[0])||void 0===t?void 0:t.year,c=null===(s=l[0])||void 0===s?void 0:s.quarter,x=null===(a=e[0])||void 0===a?void 0:a.year,u=null===(i=l[0])||void 0===i?void 0:i.financialValues,m=(null==u?void 0:u.NetSale_TTM)===null||(null==u?void 0:u.NetSale_TTM)===void 0||(null==u?void 0:u.ParentCompanyShareholderProfitAfterTax_TTM)===null||(null==u?void 0:u.ParentCompanyShareholderProfitAfterTax_TTM)===void 0;if(4===c||null!=d&&null!=x&&d<x||m?(o=null==(r=null==e?void 0:e[0])?void 0:r.year,n=[{id:"MarketCapAtPeriodEnd",name:"Vốn h\xf3a thị trường",value:0},{id:"NetSale",name:"Doanh thu thuần",value:0},{id:"ParentCompanyShareholderProfitAfterTax",name:"Lợi nhuận r\xf2ng",value:0}]):(r=null==l?void 0:l[0],o="Q".concat(null==r?void 0:r.quarter,"/").concat(null==r?void 0:r.year),n=[{id:"MarketCapAtPeriodEnd",name:"Vốn h\xf3a thị trường",value:0},{id:"NetSale_TTM",name:"Doanh thu thuần (TTM)",value:0},{id:"ParentCompanyShareholderProfitAfterTax_TTM",name:"Lợi nhuận r\xf2ng (TTM)",value:0}]),!r)return;let h=r;
1n.forEach(e=>{e.value=+h.financialValues[e.id]/1e9});let f=[[{value:n[0].value,name:n[0].name},{value:n[1].value,name:n[1].name}],[{value:n[0].value,name:n[0].name},{value:n[2].value,name:n[2].name}]],g=f[0][0].value,b="".concat(new Intl.NumberFormat().format(Number(g.toFixed(1)))," \n tỷ VNĐ"),v={backgroundColor:"transparent",title:{text:"Tổng qu\xe1t "+o,textStyle:{fontFamily:"sans-serif"}},tooltip:{trigger:"item",formatter:function(e){let l=new Intl.NumberFormat().format(e.value.toFixed(1));return"<b>".concat(e.name,"</b><br /> ").concat(l," tỷ VNĐ")},textStyle:{fontFamily:"sans-serif"},show:!0},legend:{orient:"horizontal",bottom:10,left:"center",textStyle:{fontFamily:"sans-serif"}},graphic:[{type:"group",left:"center",top:"center",children:[{type:"text",left:"center",top:"middle",style:{overflow:"break",text:b,fontSize:15,fontWeight:"bold",textAlign:"center",fill:"#94A3B8",fontFamily:"sans-serif"}}]}],series:[{name:"P/S",type:"pie",radius:["40%","60%"],center:["50%","45%"],avoidLabelOverlap:!1,label:{show:!1,position:"center"},labelLine:{show:!1},data:f[0],color:la,textStyle:{fontFamily:"sans-serif"}},{name:"P/E",type:"pie",radius:["50%","70%"],center:["50%","45%"],avoidLabelOverlap:!1,label:{show:!1,position:"center"},labelLine:{show:!1},data:f[1],color:la,textStyle:{fontFamily:"sans-serif"}}]};return v};return a.useEffect(()=>{var e;let l=c(d,o);if(!l){r(void 0);return}l.tooltip={...null!==(e=l.tooltip)&&void 0!==e?e:{},show:!n},r(l)},[JSON.stringify(o),JSON.stringify(d),n]),i&&(0,s.jsx)(F.default,{option:i,theme:t,style:{width:"100%",height:300,minHeight:220}})},lr={backgroundColor:"transparent",grid:{top:40},tooltip:{trigger:"axis",show:!0,formatter:function(e){return'\n      <div>\n        <div class="text-sm">'.concat(e[0].name,'</div>\n        <div class="text-sm">\n        <span class="inline-block w-2 h-2 mr-1" style="background-color:').concat(e[0].color,'"></span>\n       <span class="font-bold">P/E:</span>\n         ').concat(e[0].value,'</div>\n       \n         <div class="text-sm">\n        <span class="inline-block w-2 h-2 mr-1" style="background-color:').concat(e[1].color,'"></span>\n       <span class="font-bold">P/S:</span>\n         ').concat(e[1].value,"</div>\n      </div>\n      ")}},xAxis:{type:"category",data:[]},yAxis:[{type:"value",name:"P/E        "},{type:"value",name:"        P/S",splitLine:{show:!1}}],legend:{type:"scroll",orient:"horizontal",bottom:10},series:[{data:[],type:"line",yAxisIndex:0,name:"P/E"},{data:[],type:"line",yAxisIndex:1,name:"P/S"}]},ln=e=>{let{symbol:l}=e,{resolvedTheme:t}=(0,S.F)(),[i,r]=a.useState(lr),[n,o]=a.useState("Y"),d=(0,e5.ac)("(max-width : 768px)"),{financialDataQ:c,financialDataY:x}=(0,e7.w)(l);return a.useEffect(()=>{if(c.length>0||x.length>0){var e,l,t;let s="Y"===n?x:c,a="Y"===n?s.map(e=>e.year).reverse():s.map(e=>"Q".concat(e.quarter,"/").concat(e.year)).reverse(),o=s.map(l=>{var t;return null!==(e=null===(t=l.financialValues.PE)||void 0===t?void 0:t.toFixed(2))&&void 0!==e?e:"KXĐ"}).reverse(),u=s.map(e=>{var t;return null!==(l=null===(t=e.financialValues.PS)||void 0===t?void 0:t.toFixed(2))&&void 0!==l?l:"KXĐ"}).reverse(),m=Object.assign({},i);m.xAxis=Object.assign({},m.xAxis),m.xAxis.data=a,m.series=[...m.series],m.series[0]=Object.assign({},m.series[0]),m.series[0].data=o,m.series[1]=Object.assign({},m.series[1]),m.series[1].data=u,m.tooltip={...null!==(t=m.tooltip)&&void 0!==t?t:{},show:!d},r(m)}},[d,JSON.stringify(c),JSON.stringify(x),n]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"text-lg font-bold opacity-80 dark:opacity-100",children:"Chỉ số định gi\xe1"}),(0,s.jsx)(eR.Z,{value:n,onChange:o})]}),(0,s.jsx)(F.default,{option:i,theme:t,style:{width:"100%",height:300,minHeight:220}})]})},lo={backgroundColor:"transparent",legend:{type:"scroll",orient:"horizontal",bottom:0,textStyle:{fontFamily:"sans-serif"}},title:{text:"Tỷ suất cổ tức",textStyle:{fontFamily:"sans-serif"}},tooltip:{trigger:"axis",show:!0,textStyle:{fontFamily:"sans-serif"},formatter:function(e){return'\n      <div>\n        <div class="text-sm">'.concat(e[0].name,'</div>\n        <div class="text-sm">
1\n        <span class="inline-block w-2 h-2 mr-1" style="background-color:').concat(e[0].color,'"></span>\n       <span class="font-bold">Cổ phiếu lưu h\xe0nh (triệu CP):</span>\n         ').concat(e[0].value,'</div>\n       \n         <div class="text-sm">\n        <span class="inline-block w-2 h-2 mr-1" style="background-color:').concat(e[1].color,'"></span>\n       <span class="font-bold">Tỷ suất cổ tức (%):</span>\n         ').concat(e[1].value,"</div>\n      </div>\n      ")}},xAxis:{type:"category",data:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],nameTextStyle:{fontFamily:"sans-serif"}},yAxis:[{type:"value",name:"triệu CP       ",nameTextStyle:{fontFamily:"sans-serif"}},{type:"value",name:"        %",show:!1}],grid:{top:70,bottom:40,right:14,left:14,containLabel:!0},series:[{data:[],type:"bar",yAxisIndex:0,name:"Cổ phiếu lưu h\xe0nh",barWidth:40,textStyle:{fontFamily:"sans-serif"}},{data:[],type:"scatter",label:{show:!0,position:"top",formatter:function(e){return"".concat(e.value,"%")}},name:"Tỷ suất cổ tức",yAxisIndex:1,textStyle:{fontFamily:"sans-serif"}}]},ld=e=>{let{symbol:l}=e,{resolvedTheme:t}=(0,S.F)(),[i,r]=a.useState(lo),n=(0,e5.ac)("(max-width : 768px)"),{financialDataY:o}=(0,e7.w)(l);return a.useEffect(()=>{if(o.length>0){let e=o.map(e=>e.year).reverse(),l=o.map(e=>(+e.financialValues.ShareAtPeriodEnd/1e6).toFixed(1)).reverse(),t=o.map(e=>(100*+e.financialValues.DividendYield).toFixed(2)).reverse(),s=(0,y.ZP)(i,s=>{var a;s.xAxis.data=e,s.series=[...s.series],s.series[0].data=l,s.series[1].data=t,s.tooltip={...null!==(a=s.tooltip)&&void 0!==a?a:{},show:!n}});r(s)}},[JSON.stringify(o),n]),(0,s.jsx)(F.default,{option:i,theme:t,style:{width:"100%",height:300,minHeight:220}})},lc=t(87633),lx=t(4499),lu={backgroundColor:"transparent",title:{text:"Cổ tức",textStyle:{fontFamily:"sans-serif"}},tooltip:{trigger:"axis",show:!0,textStyle:{fontFamily:"sans-serif"},formatter:function(e){var l,t,s;return'\n      <div>\n        <div class="text-sm">'.concat(e[0].name,'</div>\n        <div class="text-sm">\n        <span class="inline-block w-2 h-2 mr-1" style="background-color:').concat(e[0].color,'"></span>\n       <span class="font-bold">Cổ tức bằng tiền (VNĐ):</span>\n         ').concat(null!==(t=e[0].value)&&void 0!==t?t:"KXĐ",'</div>\n       \n         <div class="text-sm">\n        <span class="inline-block w-2 h-2 mr-1" style="background-color:').concat(e[1].color,'"></span>\n       <span class="font-bold">Cổ tức bằng CP (%):</span>\n         ').concat(null!==(s=null===(l=e[1].value)||void 0===l?void 0:l.toFixed(2))&&void 0!==s?s:"KXĐ","</div>\n      </div>\n      ")}},xAxis:{type:"category",data:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],nameTextStyle:{fontFamily:"sans-serif"}},yAxis:[{type:"value",name:"Cổ tức bằng tiền",nameTextStyle:{fontFamily:"sans-serif"}},{type:"value",name:"Cổ tức bằng cổ phiếu",show:!1}],grid:{top:70,bottom:70},legend:{bottom:10,textStyle:{fontFamily:"sans-serif"}},series:[{data:[],type:"bar",yAxisIndex:0,name:"Cổ tức bằng tiền",barWidth:40,textStyle:{fontFamily:"sans-serif"}},{data:[],type:"scatter",label:{show:!0,position:"top",formatter:function(e){return"".concat(e.value.toFixed(2)," %")}},textStyle:{fontFamily:"sans-serif"},yAxisIndex:1,name:"Cổ tức bằng cổ phiếu"}]},lm=e=>{let{symbol:l}=e,{resolvedTheme:t}=(0,S.F)(),[i,r]=a.useState(lu),n=(0,e5.ac)("(max-width : 768px)"),{data:o}=(0,lc.a)({queryKey:["dividend",l],queryFn:async()=>{let e=await (0,lx.getStockDividends)(l,5);return e.data}});return a.useEffect(()=>{if(o){var e;let l=o.map(e=>e.year),t=o.map(e=>e.cashDividend),s=o.map(e=>e.stockDividend),a=Object.assign({},i);a.xAxis=Object.assign({},a.xAxis),a.xAxis.data=l,a.series=[...a.series],a.series[0]=Object.assign({},a.series[0]),a.series[0].data=t,a.series[1]=Object.assign({},a.series[1]),a.series[1].data=s,a.tooltip={...null!==(e=a.tooltip)&&void 0!==e?e:{},show:!n},r(a)}},[JSON.stringify(o),n]),(0,s.jsx)(F.default,{option:i,theme:t,style:{width:"100%",height:350,minHeight:220}})},lh=e=>{let{symbol:l}=e,{resolvedTheme:t}=(0,S.F)(),[i,r]=a.useState(),n=(0,e5.ac)("(max-width : 768px)"),[o,d]=a.use
1State("Y"),{financialDataQ:c,financialDataY:x}=(0,e7.w)(l),u=e=>{let l=e.map(e=>"Y"===o?e.year.toString():"Q".concat(e.quarter,"/").concat(e.year)),t=e.map(e=>e.year),s=e.map(e=>e.quarter);return{namePeriods:l,listPeriods:{years:t,quarters:s}}};return(0,a.useEffect)(()=>{var e;let l="Y"===o?x:c,t=function(e){let l;if(0===e.length||0===Object.keys(e[0].financialValues).length)return;let{namePeriods:t,listPeriods:s}=u(e);(l=[{id:"CashAndCashEquivalentAtTheBeginningOfPeriod",name:"Tiền v\xe0 TĐ tiền đầu kỳ",value:[],isCurrency:!0},{id:"CashflowFromOperatingActivity",name:"Lưu chuyển tiền từ HĐKD",value:[],isCurrency:!0},{id:"CashflowFromInvestingActivity",name:"Lưu chuyển tiền từ HĐĐT",value:[],isCurrency:!0},{id:"CashflowFromFinancingActivity",name:"Lưu chuyển tiền từ HĐTC",value:[],isCurrency:!0},{id:"CashAndCashEquivalentAtTheEndOfPeriod",name:"Tiền v\xe0 TĐ tiền cuối kỳ",value:[],isCurrency:!0}]).forEach(function(l){l.value=function(e,l,t,s){let a=t.years.map((a,i)=>{let r=t.quarters[i],n=e.find(e=>e.year===a&&e.quarter===r);if(n)return s?+n.financialValues[l]/1e9:+n.financialValues[l]});return a}(e,l.id,s,l.isCurrency)});let a=[{name:l[1].name,value:l[1].value},{name:l[2].name,value:l[2].value},{name:l[3].name,value:l[3].value},{name:"Lưu chuyển tiền thuần",value:l[1].value.map((e,t)=>e+l[2].value[t]+l[3].value[t])}],i={backgroundColor:"transparent",tooltip:{trigger:"axis",show:!0,axisPointer:{type:"cross",crossStyle:{color:"#999"}}},legend:{bottom:0},xAxis:[{type:"category",data:t.reverse(),axisPointer:{type:"shadow"}}],grid:{top:40,bottom:80,left:50,right:50},yAxis:[{type:"value",show:!0,name:"Tỷ VNĐ   ",nameLocation:"end",nameGap:15,nameTextStyle:{fontSize:10,align:"right"},axisLabel:{}},{type:"value",show:!1,axisLabel:{}}],series:[{name:a[0].name,type:"bar",tooltip:{valueFormatter:function(e){return new Intl.NumberFormat().format(e.toFixed(2))}},color:"#3fb1e3",data:a[0].value.reverse()},{name:a[1].name,type:"bar",tooltip:{valueFormatter:function(e){return new Intl.NumberFormat().format(e.toFixed(2))}},color:"#6be6c1",data:a[1].value.reverse()},{name:a[2].name,type:"bar",tooltip:{valueFormatter:function(e){return new Intl.NumberFormat().format(e.toFixed(2))}},color:"#626c91",data:a[2].value},{name:a[3].name,type:"line",tooltip:{valueFormatter:function(e){return new Intl.NumberFormat().format(e.toFixed(2))}},color:"#fcce10",data:a[3].value.reverse()}]};return i}(l);if(!t){r(void 0);return}t.tooltip={...null!==(e=t.tooltip)&&void 0!==e?e:{},show:!n},r(t)},[n,o,JSON.stringify(c),JSON.stringify(x)]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"text-lg font-bold opacity-80 dark:opacity-100",children:"D\xf2ng tiền"}),(0,s.jsx)(eR.Z,{value:o,onChange:d})]}),i&&(0,s.jsx)(F.default,{option:i,theme:t,style:{width:"100%",height:300,minHeight:220}})]})};let lf={valueColor:"#516b91",decreaseColor:"#d0648a",increaseColor:"#4ea397"};var lg=e=>{let{symbol:l}=e,{resolvedTheme:t}=(0,S.F)(),[i,r]=a.useState(),[n,o]=a.useState("Lưu chuyển tiền tệ "),d=(0,e5.ac)("(max-width : 768px)"),[c,x]=a.useState("Y"),{financialDataQ:u,financialDataY:m}=(0,e7.w)(l);return(0,a.useEffect)(()=>{var e;let l="Y"===c?m:u,t=function(e){if(0===e.length||0===Object.keys(e[0].financialValues).length)return;let l=e[0].quarter,t=e[0].year;0===l?o("Lưu chuyển tiền tệ ("+t+")"):o("Lưu chuyển tiền tệ (Q"+l+"/"+t+")");let s=[{id:"CashAndCashEquivalentAtTheBeginningOfPeriod",name:"Tiền v\xe0 TĐ tiền đầu kỳ",value:0},{id:"CashflowFromOperatingActivity",name:"Lưu chuyển tiền từ HĐKD",value:0},{id:"CashflowFromInvestingActivity",name:"Lưu chuyển tiền từ HĐĐT",value:0},{id:"CashflowFromFinancingActivity",name:"Lưu chuyển tiền từ HĐTC",value:0},{id:"CashAndCashEquivalentAtTheEndOfPeriod",name:"Tiền v\xe0 TĐ tiền cuối kỳ",value:0}],a=e[0].financialValues;s.forEach(e=>{e.value=+a[e.id]/1e9});let i=[{name:s[0].name,value:s[0].value,isNegative:!1,isEndField:!0},{name:s[1].name,value:s[1].value,isNegative:!1,isEndField:!1},{name:s[2].name,value:s[2].value,isNegative:!1,isEndField:!1},{name:s[3].name,value:s[3].value,isNegative:!1,isEndField:!1},{name:s[4].name,value:s[4].value,isNegative:!1,isEndField:!0}];
1i.forEach((e,l)=>{e.isNegative&&(e.value*=-1)});let r={name:[],ValuesField:[],EndsField:[],LineField:[],BlankField:[],NegLoss:[],NegGain:[],PosLoss:[],PosGain:[]};i.forEach((e,l)=>{r.name.push(e.name),0===l?(r.ValuesField.push(e.value),e.isEndField?r.EndsField.push(e.value):r.EndsField.push(0)):e.isEndField?(r.ValuesField.push(0),r.EndsField.push(e.value)):(r.ValuesField.push(e.value),r.EndsField.push(0))}),r.ValuesField.forEach((e,l)=>{0===l?r.LineField.push(e):r.LineField.push(r.LineField[l-1]+e)}),r.BlankField=r.ValuesField.map((e,l)=>{let t=r.LineField[l]<0&&r.LineField[l]-e<0,s=r.LineField[l]>0&&r.LineField[l]-e>0;return 0===e?0:t?r.LineField[l]-Math.min(0,e):s?r.LineField[l]-Math.max(0,e):0}),r.NegLoss=r.ValuesField.map((e,l)=>{let t=r.LineField[l]<0&&e<0&&0===r.EndsField[l];return 0===l&&!i[l].isEndField&&e<0?e:t?Math.max(r.LineField[l],e):0}),r.NegGain=r.ValuesField.map((e,l)=>{let t=r.LineField[l]-e<0&&e>0&&0===r.EndsField[l];return t?Math.max(r.LineField[l]-e,-e):0}),r.PosLoss=r.ValuesField.map((e,l)=>{let t=r.LineField[l]-e>0&&e<0&&0===r.EndsField[l];return t?Math.min(r.LineField[l]-e,-e):0}),r.PosGain=r.ValuesField.map((e,l)=>{let t=r.LineField[l]>0&&e>0&&0===r.EndsField[l];return 0===l&&!i[l].isEndField&&e>0?e:t?Math.min(r.LineField[l],e):0});let n={backgroundColor:"transparent",tooltip:{trigger:"axis",show:!0,axisPointer:{type:"line"},formatter:function(e){let l=e[0].dataIndex,t=0===r.EndsField[l]?r.ValuesField[l]:r.EndsField[l];return"<b/>"+e[0].axisValue+"</b><br/>"+(new Intl.NumberFormat().format(t.toFixed(2))+"<br/>")}},grid:{top:40,left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",data:r.name,axisLabel:{show:!0,fontSize:12,rotate:45,interval:0}},yAxis:{type:"value",name:"Tỷ VNĐ   ",nameLocation:"end",nameGap:15,nameTextStyle:{fontSize:12,align:"right"}},series:[{name:"Blank",type:"bar",stack:"Total",silent:!0,itemStyle:{borderColor:"transparent",color:"transparent"},emphasis:{itemStyle:{borderColor:"transparent",color:"transparent"}},data:r.BlankField},{name:"Ends",type:"bar",stack:"Total",color:lf.valueColor,data:r.EndsField},{name:"NegLoss",type:"bar",stack:"Total",color:lf.decreaseColor,data:r.NegLoss},{name:"NegGain",type:"bar",stack:"Total",color:lf.increaseColor,data:r.NegGain},{name:"PosLoss",type:"bar",stack:"Total",color:lf.decreaseColor,data:r.PosLoss},{name:"PosGain",type:"bar",stack:"Total",color:lf.increaseColor,data:r.PosGain}]},d=[];for(let e=0;e<r.LineField.length;e++){let l=Array(r.LineField.length).fill(null);l[e]=r.LineField[e],e+1<r.LineField.length&&(l[e+1]=r.LineField[e]),d.push(l)}let c=[];for(let e=0;e<r.LineField.length;e++)c.push({type:"line",showSymbol:!1,data:d[e],lineStyle:{type:"dashed",width:1,color:"#A3A3A3"}});return n.series.push(...c),n}(l);if(!t){r(void 0);return}t.tooltip={...null!==(e=t.tooltip)&&void 0!==e?e:{},show:!d},r(t)},[d,c,JSON.stringify(u),JSON.stringify(m)]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"text-lg font-bold opacity-80 dark:opacity-100",children:n}),(0,s.jsx)(eR.Z,{value:c,onChange:x})]}),i&&(0,s.jsx)(F.default,{option:i,theme:t,style:{width:"100%",height:300,minHeight:220}})]})},lb=e=>{let{symbol:l,page:t,onChangeTab:i}=e,{companyProfile:r,requestCompanyProfile:n}=(0,N.rW)(l),{financialDataQ:o}=(0,e7.w)(l);return(a.useEffect(()=>{n()},[n]),r)?(0,s.jsx)("div",{className:"flex flex-col gap-4 my-4",children:"financial"===t?(0,s.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center text-xl font-semibold gap-2",children:[(0,s.jsx)("img",{alt:"partners",src:"".concat(d.udk,"/web/images/partners.png"),className:"w-6"}),"Sở hữu"]}),(0,s.jsx)("div",{className:"text-sm italic text-zinc-600 dark:text-zinc-400 mt-2",children:"Nh\xf3m cổ đ\xf4ng quan trọng v\xe0 gi\xe1 trị doanh nghiệp"}),(0,s.jsxs)("div",{className:"grid md:grid-cols-2 grid-cols-1 gap-4 mt-4",children:[(0,s.jsx)(m.Zb,{className:"col-span-1 p-2",children:(0,s.jsx)(e6,{profile:r})}),(0,s.jsx)(m.Zb,{className:"col-span-1 p-2",children:(0,s.jsx)(e9,{financialData:o})})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center text-xl font-semibold gap-2",children:[(0,s.jsx)("img",{alt:"budget",src:"".concat(d.udk,"/web/images/growth.png"),className:"w-6"}),"Kết quả kinh doanh"]}),(0,s.jsx)("div",{className:"text-sm italic text-zinc-600 dark:text-zinc-400 mt-2",children:"Hiệu quả hoạt động v\xe0 bi\xean lợi nhuận gần đ\xe2y của c\xf4ng ty."}),(0,s.jsxs)("div",{className:"grid md:grid-cols-2 grid-cols-1 gap-4 mt-4",children:[(0,s.jsx)(m.Zb,{className:"col-span-1 p-2",children:(0,s.jsx)(le,{symbol:l})}),(0,s.jsx)(m.Zb,{className:"col-span-1 p-2",children:(0,s.jsx)(ll.default,{symbol:l})})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center text-xl font-semibold hover:text-sky-500 cursor-pointer gap-2",children:[(0,s.jsx)("img",{alt:"budget",src:"".concat(d.udk,"/web/images/budget.png"),className:"w-6"}),"Sức khoẻ t\xe0i ch\xednh"]}
1),(0,s.jsx)("div",{className:"text-sm italic text-zinc-600 dark:text-zinc-400 mt-2",children:"Hiện trạng t\xe0i ch\xednh v\xe0 khả năng thanh to\xe1n của c\xf4ng ty"}),(0,s.jsxs)("div",{className:"grid md:grid-cols-2 grid-cols-1 gap-4 mt-4",children:[(0,s.jsx)(m.Zb,{className:"col-span-1 p-2",children:(0,s.jsx)(lt.default,{symbol:l})}),(0,s.jsx)(m.Zb,{className:"col-span-1 p-2",children:(0,s.jsx)(ls.default,{symbol:l})})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center text-xl font-semibold hover:text-sky-500 cursor-pointer gap-2",children:[(0,s.jsx)("img",{alt:"budget",src:"".concat(d.udk,"/web/images/budget.png"),className:"w-6"}),"Lưu chuyển tiền tệ"]}),(0,s.jsx)("div",{className:"text-sm italic text-zinc-600 dark:text-zinc-400 mt-2",children:"D\xf2ng tiền v\xe0o ra của doanh nghiệp trong c\xe1c hoạt động kinh doanh, đầu tư, t\xe0i ch\xednh"}),(0,s.jsxs)("div",{className:"grid md:grid-cols-2 grid-cols-1 gap-4 mt-4",children:[(0,s.jsx)(m.Zb,{className:"col-span-1 p-2",children:(0,s.jsx)(lh,{symbol:l})}),(0,s.jsx)(m.Zb,{className:"col-span-1 p-2",children:(0,s.jsx)(lg,{symbol:l})})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center text-xl font-semibold gap-2",children:[(0,s.jsx)("img",{alt:"moneyBag",src:"".concat(d.udk,"/web/images/money-bag.png"),className:"w-6"}),"Định gi\xe1"]}),(0,s.jsx)("div",{className:"text-sm italic text-zinc-600 dark:text-zinc-400 mt-2",children:"C\xe1c chỉ số cơ bản để quyết định gi\xe1 trị hợp l\xfd của cổ phiếu"}),(0,s.jsxs)("div",{className:"grid md:grid-cols-2 grid-cols-1 gap-4 mt-4",children:[(0,s.jsx)(m.Zb,{className:"col-span-1 p-2",children:(0,s.jsx)(li,{symbol:l})}),(0,s.jsx)(m.Zb,{className:"col-span-1 p-2",children:(0,s.jsx)(ln,{symbol:l})})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center text-xl font-semibold hover:text-sky-500 cursor-pointer gap-2",children:[(0,s.jsx)("img",{alt:"contribution",src:"".concat(d.udk,"/web/images/contribution.png"),className:"w-6"}),"Cổ tức"]}),(0,s.jsx)("div",{className:"text-sm italic text-zinc-600 dark:text-zinc-400 mt-2",children:"Tỷ suất, lịch sử chi trả v\xe0 t\xednh ổn định của cổ tức"}),(0,s.jsxs)("div",{className:"grid md:grid-cols-2 grid-cols-1 gap-4 mt-4",children:[(0,s.jsx)(m.Zb,{className:"col-span-1 p-2",children:(0,s.jsx)(ld,{symbol:l})}),(0,s.jsx)(m.Zb,{className:"col-span-1 p-2",children:(0,s.jsx)(lm,{symbol:l})})]})]})]}):(0,s.jsxs)("div",{className:"mb-10",children:[(0,s.jsx)("div",{className:"flex items-center text-xl font-semibold cursor-pointer hover:text-sky-500 w-fit",onClick:()=>i&&i("financials"),children:"T\xe0i ch\xednh"}),(0,s.jsxs)("div",{className:"grid md:grid-cols-2 grid-cols-1 gap-4 mt-4",children:[(0,s.jsx)(m.Zb,{className:"col-span-1 p-2",children:(0,s.jsx)(le,{symbol:l})}),(0,s.jsx)(m.Zb,{className:"col-span-1 p-2",children:(0,s.jsx)(ll.default,{symbol:l})}),(0,s.jsx)(m.Zb,{className:"col-span-1 p-2",children:(0,s.jsx)(lt.default,{symbol:l})}),(0,s.jsx)(m.Zb,{className:"col-span-1 p-2",children:(0,s.jsx)(ls.default,{symbol:l})})]})]})}):(0,s.jsx)("div",{})};let lv=a.memo(e=>{let{symbol:l}=e;return(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsxs)(h.mQ,{defaultValue:"overview",className:"w-full",children:[(0,s.jsxs)(h.dr,{className:"mb-5 flex h-auto w-full max-w-full flex-wrap sm:w-fit",children:[(0,s.jsx)(h.SP,{value:"overview",children:"Tổng quan"}),(0,s.jsx)(h.SP,{value:"reports",className:"hidden md:inline-flex",children:"B\xe1o c\xe1o t\xe0i ch\xednh"}),(0,s.jsx)(h.SP,{value:"financialIndex",children:"Chỉ ti\xeau t\xe0i ch\xednh"})]}),(0,s.jsx)(h.nU,{value:"overview",className:"mt-0 outline-none",children:(0,s.jsx)(lb,{symbol:l,page:"financial"})}),(0,s.jsx)(h.nU,{value:"reports",className:"mt-0 outline-none",children:(0,s.jsx)(e4,{symbol:l})}),(0,s.jsx)(h.nU,{value:"financialIndex",className:"mt-0 outline-none",children:(0,s.jsx)(eU,{symbol:l})})]})})});var lp=t(50781),lj=t(75976),ly=t(11163);let lN=(0,a.memo)(e=>{let{holders:l,onViewTransactions:t,onGroupChanged:i,initialGroup:r}=e,n=(0,ly.useRouter)(),[c,x]=(0,a.useState)(null!=r?r:"all"),[u,g]=(0,a.useState)(l),b=a.useRef(null),[v,p]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=b.current;if(!e)return;let l=()=>p(e.clientWidth);l();let t=new ResizeObserver(l);return t.observe(e),()=>t.disconnect()},[]);let j=0===v||v<560;(0,a.useEffect)(()=>{"all"==c?g(l):"institution"==c?g(l.filter(e=>e.isOrganization)):"individual"==c&&g(l.filter(e=>!e.isOrganization))},[c,l]),(0,a.useEffect)(()=>{i&&i(c)},[c,i]);let y=a.useCallback(e=>{e.individualHolderID?n.push((0,d.d3o)(e.individualHolderID,e.name)):e.institutionHolderSymbol?n.push((0,d.BDV)(e.institutionHolderSymbol)):e.institutionHolderID&&n.push((0,d.BDV)(e.institutionHolderID.toString()))},[n]),N=a.useCallback(e=>{x(e)},[]);return(0,s.jsxs)(m.Zb,{ref:b,className:"overflow-hidden p-0 shadow-sm",children:[(0,s.jsxs)("div",{className:"border-b border-border/60 bg-muted/15 px-4 py-3",children:[(0,s.jsx)(f.Z,{title:"Cổ đ\xf4ng lớn",description:"Danh s\xe1ch sở hữu theo b\xe1o c\xe1o",icon:lp.Z,tone:"indigo",size:"sm"}),(0,s.jsxs)("div",{className:"mt-3 flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between",children:[(0,s.jsx)(h.mQ,{value:c,onValueChange:N,children:(0,s.jsxs)(h.dr,{className:"h-9 w-full min-w-0 sm:w-auto",children:[(0,s.jsx)(h.SP,{value:"all",className:"flex-1 text-xs sm:flex-none",children:"Tất cả"}),(0,s.jsx)(h.SP,{value:"individual",className:"flex-1 text-xs sm:flex-none",children:"C\xe1 nh\xe2n"}),(0,s.jsx)(h.SP,{value:"institution",className:"flex-1 text-xs sm:flex-none",children:"Tổ chức"})]})}),(0,s.jsxs)(el.z,{type:"button",size:"sm",variant:"outline",className:"shrink-0 gap-1.5",onClick:t,children:[(0,s.jsx)(lj.Z,{className:"h-4 w-4","aria-hidden":!0}),"Giao dịch"]})]})]}),(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border-b border-border/60 bg-muted/25 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:[(0,s.jsx)("th",{scope:"col",className:"w-12 px-2 py-2.5 text-left sm:w-[52px] sm:px-3",children:"\xa0"}),(0,s.jsx)("th",{scope:"col",className:"px-2 py-2.5 text-left sm:px-3",children:"T\xean"}),(0,s.jsx)("th",{scope:"col",className:"whitespace-nowrap px-2 py-2.5 text-right tabular-nums sm:px-3",children:"Số CP"}),(0,s.jsx)("th",{scope:"col",className:"".concat(j?"hidden":"table-cell"," whitespace-nowrap px-2 py-2.5 text-right tabular-nums sm:px-3"),children:"Tỷ lệ (%)"}),(0,s.jsx)("th",{scope:"col",className:"".concat(j?"hidden":"table-cell"," whitespace-nowrap px-2 py-2.5 text-right sm:px-3"),children:"Cập nhật"})]})}),(0,s.jsx)("tbody",{children:u.map(e=>(0,s.jsxs)("tr",{onClick:()=>y(e),className:"cursor-pointer border-b border-border/40 transition-colors last:border-0 hover:bg-muted/35",children:[(0,s.jsx)("td",{className:"align-middle px-2 py-2.5 sm:px-3",children:(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center overflow-hidden rounded-xl bg-muted/40 ring-1 ring-border/50",children:e.individualHolderID?(0,s.jsx)("img",{src:"".concat(d.udk,"/individuals/photo/").concat(e.individualHolderID,"?width=80&height=80"),width:40,height:40,alt:"",className:"h-10 w-10 object-cover"}):(0,s.jsx)("img",{src:"".concat(d.udk,"/web/images/institution.png"),width:40,height:40,alt:"",className:"h-10 w-10 object-contain p-1"})})}),(0,s.jsxs)("td",{className:"max-w-[min(40vw,220px)] align-middle px-2 py-2.5 sm:max-w-none sm:px-3",children:[(0,s.jsx)("div",{className:"font-semibold leading-snug text-foreground",children:e.name}),!!e.position&&(0,s.jsx)("div",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",children:e.position})]}),(0,s.jsxs)("td",{className:"whitespace-nowrap px-2 py-2.5 text-right tabular-nums sm:px-3",children:[(0,s.jsx)("div",{className:"font-medium",children:e.shares?e.shares.toLocaleStr
1ing():"—"}),(0,s.jsx)("div",{className:"".concat(j?"block":"hidden"," text-xs text-muted-foreground"),children:e.ownership?"".concat((100*e.ownership).toFixed(2),"%"):""})]}),(0,s.jsx)("td",{className:"".concat(j?"hidden":"table-cell"," whitespace-nowrap px-2 py-2.5 text-right tabular-nums text-foreground sm:px-3"),children:e.ownership?(100*e.ownership).toFixed(2):"—"}),(0,s.jsx)("td",{className:"".concat(j?"hidden":"table-cell"," whitespace-nowrap px-2 py-2.5 text-right text-xs text-muted-foreground sm:px-3"),children:(null==e?void 0:e.reported)?o()(e.reported).format("DD/MM/YYYY"):"—"})]},e.majorHolderID))})]})})]})});var lw={backgroundColor:"transparent",tooltip:{trigger:"item",formatter:"{b} : ({d}%)"},title:{show:!1},legend:{type:"scroll",orient:"horizontal",bottom:8},series:[{type:"pie",radius:"42%",center:["50%","44%"],data:[],label:{show:!1},labelLine:{show:!1},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]};let lk=a.memo(e=>{let{profile:l}=e,{resolvedTheme:t}=(0,S.F)(),[i,r]=a.useState(lw),[n,o]=a.useState(0),d=a.useRef(null),c=a.useRef(null);return a.useEffect(()=>{if(l){let e=Object.assign({},i);e.series=[...e.series],e.series[0]=Object.assign({},e.series[0]),e.series[0].data=[{value:l.foreignOwnership,name:"Nước ngo\xe0i"},{value:l.stateOwnership,name:"Nh\xe0 nước"},{value:l.otherOwnership,name:"Kh\xe1c"}],r(e)}},[l]),a.useEffect(()=>{let e=d.current;if(!e||"undefined"==typeof ResizeObserver)return;let l=()=>{var l,t,s;let a=e.clientWidth;a<=0||(o(a),null===(l=c.current)||void 0===l||null===(t=l.getEchartsInstance)||void 0===t||null===(s=t.call(l))||void 0===s||s.resize({width:a,height:220}))};l();let t=new ResizeObserver(l);return t.observe(e),()=>t.disconnect()},[]),(0,s.jsx)("div",{ref:d,className:"w-full",children:n>0&&(0,s.jsx)(F.default,{ref:c,option:i,theme:t,style:{width:n,height:220}})})}),lC="text-[10px] leading-snug sm:text-[11px]",lS="text-[10px] font-medium uppercase tracking-wide text-muted-foreground sm:text-[11px]",lF=a.memo(e=>{let{transaction:l,index:t}=e,i="",r="text-foreground";0==l.type?(i="MUA",r="text-emerald-600 dark:text-emerald-400"):1==l.type&&(i="B\xc1N",r="text-destructive");let n=a.useMemo(()=>l.individualHolderID?(0,d.d3o)(l.individualHolderID,l.name):l.institutionHolderSymbol?(0,d.BDV)(l.institutionHolderSymbol):l.institutionHolderID?(0,d.BDV)(l.institutionHolderID.toString()):"#",[l]);return(0,s.jsx)(ea(),{href:n,className:"block",children:(0,s.jsxs)("div",{className:"flex cursor-pointer flex-row flex-1 items-start border-b border-border/70 py-2.5 transition-colors hover:bg-muted/35",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-[2] flex-row items-center px-2",children:[(0,s.jsx)("div",{className:"mr-2 hidden md:flex",children:(0,s.jsxs)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-xl bg-muted/40 ring-1 ring-border/50",children:[!!l.individualHolderID&&(0,s.jsx)("img",{src:"".concat(d.udk,"/individuals/photo/").concat(l.individualHolderID,"?width=75&height=75"),width:40,height:40,alt:"",className:"h-10 w-10 object-cover"}),!l.individualHolderID&&(0,s.jsx)("img",{src:"".concat(d.udk,"/web/images/institution.png"),width:40,height:40,alt:"",className:"h-10 w-10 object-contain p-1"})]})}),(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col pr-2 pl-0 md:pl-0 md:pr-2",children:[(0,s.jsx)("div",{className:(0,g.cn)(lC,"line-clamp-2 font-semibold text-foreground"),children:l.name}),l.position?(0,s.jsx)("div",{className:(0,g.cn)(lC,"mt-0.5 line-clamp-1 text-muted-foreground"),children:l.position}):null]})]}),(0,s.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-0.5 px-2 text-center",children:[(0,s.jsxs)("div",{className:(0,g.cn)(lC,r),children:[l.executionVolume?"Đ\xc3 ":"ĐĂNG K\xdd ",i]}),(0,s.jsx)("div",{className:(0,g.cn)(lC,"tabular-nums text-muted-foreground md:hidden"),children:l.executionVolume&&l.executionDate?o()(l.executionDate).format("DD/MM/YYYY"):""})]}),(0,s.jsx)("div",{className:(0,g.cn)(lC,"hidden flex-1 flex-row items-center justify-end px-2 text-right tabular-nums text-muted-foreground md:flex"),children:l.executionVolume&&l.executionDate?o()(l.executionDate).format("DD/MM/YYYY"):""}),(0,s.jsx)("div",{className:(0,g.cn)(lC,"flex flex-1 flex-row items-center justify-end px-2 text-right tabular-nums font-medium",r),children:l.executionVolume?l.executionVolume.toLocaleStr
1ing():""}),(0,s.jsxs)("div",{className:(0,g.cn)(lC,"hidden flex-[2] flex-row items-center justify-end px-2 text-right tabular-nums text-muted-foreground md:flex"),children:[l.startDate?o()(l.startDate).format("DD/MM/YYYY")+" - ":"",l.endDate?o()(l.endDate).format("DD/MM/YYYY"):""]}),(0,s.jsx)("div",{className:(0,g.cn)(lC,"hidden flex-1 flex-row items-center justify-end px-2 text-right font-medium tabular-nums text-foreground md:flex"),children:l.registeredVolume?l.registeredVolume.toLocaleString():""})]})})});var lT=t(84031);let lL=a.memo(e=>{let{hasNextPage:l,isNextPageLoading:t,transactions:i,loadNextPage:r,onViewHolders:n}=e,o=(0,d.pCp)("users",0),c=a.useCallback((e,l)=>(0,s.jsx)(lF,{transaction:l,index:e}),[]),h=(0,a.useCallback)(()=>t?(0,s.jsx)("div",{className:"flex flex-row justify-center items-center py-6",children:(0,s.jsx)(x.Z,{color:"#0ea5e9",loading:!0,size:30,"aria-label":"Loading","data-testid":"loader"})}):null,[t]),b=(0,a.useCallback)(e=>{o.current=e.startIndex},[]),v=(0,a.useCallback)(()=>{r()},[r]);return(0,s.jsxs)(m.Zb,{className:"overflow-visible p-0 shadow-sm",children:[(0,s.jsxs)("div",{className:"px-3 py-3 border-b border-border/60 bg-muted/15 sm:px-4",children:[(0,s.jsxs)(el.z,{type:"button",variant:"outline",size:"sm",onClick:n,className:"mb-3 gap-1.5",children:[(0,s.jsx)(e$.Z,{className:"w-4 h-4","aria-hidden":!0}),"Cổ đ\xf4ng lớn"]}),(0,s.jsx)(f.Z,{title:"Giao dịch nội bộ",description:"Đăng k\xfd v\xe0 giao dịch theo b\xe1o c\xe1o",icon:lT.Z,tone:"sky",size:"sm"})]}),(0,s.jsxs)("div",{className:"px-2 w-full min-w-0 sm:px-3",children:[(0,s.jsx)("div",{className:(0,g.cn)("sticky border-b border-border/60 bg-card text-card-foreground [isolation:isolate]","shadow-[0_4px_12px_-4px_rgba(0,0,0,0.12)] dark:shadow-[0_4px_12px_-4px_rgba(0,0,0,0.35)]","z-40"),style:{top:"var(--symbol-sticky-top, 160px)"},children:(0,s.jsxs)("div",{className:"flex w-full flex-row items-center py-2.5",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-[2] flex-row items-center px-2",children:[(0,s.jsx)("div",{className:"hidden mr-2 w-10 h-10 shrink-0 md:flex","aria-hidden":!0}),(0,s.jsx)("div",{className:(0,g.cn)(lS,"flex-1 min-w-0 leading-none text-left"),children:"T\xean"})]}),(0,s.jsx)("div",{className:(0,g.cn)(lS,"flex flex-1 justify-center items-center px-2 leading-none text-center"),children:"Giao dịch"}),(0,s.jsx)("div",{className:(0,g.cn)(lS,"hidden flex-1 justify-end items-center px-2 leading-none text-right md:flex"),children:"Ng\xe0y TH"}),(0,s.jsx)("div",{className:(0,g.cn)(lS,"flex flex-1 justify-end items-center px-2 leading-none text-right"),children:"KL TH"}),(0,s.jsx)("div",{className:(0,g.cn)(lS,"hidden justify-end items-center px-2 leading-none text-right flex-[2] md:flex"),children:"Đăng k\xfd"}),(0,s.jsx)("div",{className:(0,g.cn)(lS,"hidden flex-1 justify-end items-center px-2 leading-none text-right md:flex"),children:"KL ĐK"})]})}),(0,s.jsx)(u.OO,{useWindowScroll:!0,initialItemCount:Math.min(Math.floor(.9*d.L8A),i.length),itemContent:c,components:{Footer:h},endReached:v,data:i,rangeChanged:b,initialTopMostItemIndex:o.current})]})]})});var lD=t(85518),lP=t(49525);let lV=a.memo(e=>{let{symbol:l}=e,{majorHolders:t,requestMajorHolders:i}=(0,N.Q5)(l),{companyProfile:r,requestCompanyProfile:n}=(0,N.rW)(l),{symbolFundamental:o,requestSymbolFundamental:c}=(0,N.uu)(l),{holderTransactions:x,requestMajorHolderTransactions:u,holderTransactionsStatus:h}=(0,N.ZH)(l),[g,b]=(0,d.a2S)("majorHoldersTab","holder"),[v,p]=(0,d.a2S)("initialHolderGroup","all"),j=(0,a.useRef)(0);a.useEffect(()=>{j.current=0,n(),c(),i(),u(null,null,0,d.L8A)},[n,u,i,c]);let y=a.useCallback(()=>{b("transaction")},[]),w=a.useCallback(()=>{b("holder")},[]),k=a.useCallback(()=>{j.current+=d.L8A,u(null,null,j.current,d.L8A)},[u]),C=a.useCallback(e=>{p(e)},[]),S=a.useMemo(()=>lD.tq?x?null==x?void 0:x.filter(e=>!!e.executionVolume):[]:null!=x?x:[],[x]),F=(0,a.useRef)(null),[T,L]=a.useState(0);a.useEffect(()=>{let e=F.current;if(!e)return;let l=()=>L(e.clientWidth);l();let t=new ResizeObserver(l);return t.observe(e),()=>t.disconnect()},[]);let D=a.useMemo(()=>[{label:"Ban l\xe3nh đạo",value:(null==o?void 0:o.insiderOwnership)?"".concat((100*o.insiderOwnership).toFixed(2),"%"):"—"},{label:"Tổ chức",value:(null==o?void 0:o.institutionOwnership)?"".concat((100*o.institutionOwnership).toFixed(2),"%"):"—"},{label:"Nước ngo\xe0i",value:(null==o?void 0:o.foreignOwnership)?"".concat((100*o.foreignOwnership).toFixed(2),"%"):"—"}],[o]);return(0,s.jsxs)("div",{ref:F,className:"flex flex-col gap-4",children:["holder"==g&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid gap-4",style:{gridTemplateColumns:T>=560&&r?"repeat(2, minmax(0, 1fr))":"minmax(0, 1fr)"},children:[r&&(0,s.jsxs)(m.Zb,{className:"overflow-hidden p-0 shadow-sm",children:[(0,s.jsx)("div",{className:"border-b border-border/60 bg-muted/15 px-4 py-3",children:(0,s.jsx)(f.Z,{title:"Cơ cấu sở hữu",description:"Ph\xe2n bổ theo nh\xf3m cổ đ\xf4ng",icon:ez.Z,tone:"emerald",size:"sm"})}),(0,s.jsx)("div",{className:"px-2 pb-2 pt-1",children:(0,s.jsx)(lk,{profile:r})})]}),(0,s.jsxs)(m.Zb,{className:"overflow-hidden p-0 shadow-sm",children:[(0,s.jsx)("div",{className:"border-b border-border/60 bg-muted/15 px-4 py-3",children:(0,s.jsx)(f.Z,{title:"Nh\xf3m cổ đ\xf4ng quan trọng",description:"Tỷ lệ sở hữu theo nh\xf3m",icon:lP.Z,tone:"sky",size:"sm"})}),(0,s.jsx)("ul",{className:"divide-y divide-border/40",children:D.map(e=>(0,s.jsxs)("li",{className:"flex items-center justify-between gap-3 px-4 py-3 text-sm transition-colors hover:bg-muted/30",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:e.label}),(0,s.jsx)("span",{className:"tabular-nums font-semibold text-foreground",children:e.value})]},e.label))})]})]}),!!t&&(0,s.jsx)(lN,{initialGroup:v,onGroupChanged:C,holders:t,onViewTransactions:y})]}),"transaction"==g&&!!S&&(0,s.jsx)(lL,{transactions:S,hasNextPage:null==h||h&&!h.isFetching&&!h.noData,isNextPageLoading:null!=h&&h.isFetching,loadNextPage:k,onViewHolders:w})]})}),lM=a.memo(e=>{let{symbol:l,onChangeTab:t}
1=e,i=(0,j.useSymbolInfo)(l),[r]=(0,d.a2S)("overviewTabMarkLine",void 0),n=a.useCallback(()=>{t("news")},[t]);return(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(null==i?void 0:i.isListing)&&(0,s.jsx)(m.Zb,{className:"flex flex-col p-3 shadow-sm",children:(0,s.jsx)("div",{className:"h-[380px] md:h-[520px]",children:(0,s.jsx)(C.default,{symbol:l,markLine:r,buttonSize:"xs",showAppLink:!0},l)})}),(0,s.jsx)("div",{className:"xl:hidden",children:(0,s.jsx)(eb,{symbol:l})}),(0,s.jsx)(lb,{symbol:l,page:"overview",onChangeTab:t}),(0,s.jsxs)("div",{children:[(0,s.jsx)(f.Z,{title:"Tin tức",description:"Tin tức li\xean quan ".concat(l),icon:eN.Z,tone:"primary",size:"sm",className:"mb-4"}),(0,s.jsx)(ey,{symbol:l,onViewMoreNews:n})]})]})}),lA=a.memo(e=>{let{officer:l}=e,t="".concat(d.udk,"/individuals/photo/").concat(l.individualID,"?width=100&height=100");return(0,s.jsx)(ea(),{href:(0,d.d3o)(l.individualID,l.name),className:"group block h-full",children:(0,s.jsxs)("div",{className:"flex h-full items-center gap-3 rounded-xl border border-border/60 bg-card/80 p-3 shadow-sm transition-all hover:border-sky-500/25 hover:bg-muted/30 hover:shadow-md",role:"presentation",children:[(0,s.jsx)("div",{className:"relative shrink-0",children:(0,s.jsx)("img",{src:t,alt:l.name,className:"h-12 w-12 rounded-full object-cover ring-2 ring-border/70 ring-offset-2 ring-offset-background"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"line-clamp-2 text-sm font-semibold text-foreground transition-colors group-hover:text-sky-600 dark:group-hover:text-sky-400",children:l.name}),!!l.position&&(0,s.jsx)("div",{className:"mt-0.5 line-clamp-2 text-xs leading-snug text-muted-foreground",children:l.position})]}),(0,s.jsx)(e0.Z,{className:"h-4 w-4 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100"})]})})});var lZ=t(53125);let lE=(0,a.memo)(e=>{let{officers:l,showHeader:t}=e,i=a.useRef(null),[r,n]=a.useState(0);return(a.useEffect(()=>{let e=i.current;if(!e)return;let l=()=>n(e.clientWidth);l();let t=new ResizeObserver(l);return t.observe(e),()=>t.disconnect()},[]),0===l.length)?null:(0,s.jsxs)(m.Zb,{ref:i,className:"overflow-hidden p-0",children:[t&&(0,s.jsx)("div",{className:"border-b border-border/60 bg-muted/20 px-4 py-3",children:(0,s.jsx)(f.Z,{title:"Ban l\xe3nh đạo",description:"Đội ngũ điều h\xe0nh v\xe0 quản trị",icon:lZ.Z,tone:"violet",size:"sm"})}),(0,s.jsx)("div",{className:"grid gap-2 p-3",style:{gridTemplateColumns:"repeat(".concat(r>=900?3:r>=500?2:1,", minmax(0, 1fr))")},children:l.map((e,l)=>(0,s.jsx)(lA,{officer:e},"".concat(e.individualID,"-").concat(l)))})]})}),lO=a.memo(e=>{var l,t,i;let{symbol:r}=e,n=(0,ly.useRouter)(),[c,x]=a.useState(!1),{companyProfile:u,requestCompanyProfile:m}=(0,N.rW)(r),{companyOfficers:h,requestCompanyOfficers:f}=(0,N.MU)(r),{subCompanies:g,linkedCompanies:b,requestSubCompanies:v}=(0,N.pt)(r),p=(0,j.useSymbolInfo)(r);a.useEffect(()=>{m(),f(),v()},[f,m,v]),a.useEffect(()=>{u&&null!=u.overview&&u.overview.length>600&&x(!0)},[u]);let y=a.useCallback(()=>{x(!c)},[c]),w=a.useCallback(e=>{e.isListed?n.push((0,d.BDV)(e.symbol)):n.push((0,d.BDV)(e.institutionID.toString()))},[]);return(0,s.jsx)("div",{className:"flex flex-col",children:(0,s.jsxs)("div",{children:[!!u&&!!u.overview&&(0,s.jsxs)("div",{className:"p-4 text-sm leading-relaxed rounded-2xl border shadow-sm border-border/60 bg-card",children:[c?u.overview.substring(0,600)+"... ":u.overview,c&&(0,s.jsx)("a",{onClick:y,children:"Th\xeam"}),!c&&u.overview.length>600&&(0,s.jsx)("a",{onClick:y,children:"R\xfat gọn"})]}),p&&(0,s.jsxs)("div",{className:"flex flex-row items-center pt-4",children:["Ng\xe0nh: \xa0",(0,s.jsx)(ea(),{className:"font-bold",href:"#",children:p.sector}),(0,s.jsx)(e0.Z,{size:16}),(0,s.jsx)(ea(),{className:"font-bold",href:"#",children:p.industry})]}),(0,s.jsx)("div",{className:"p-4 mt-4 rounded-2xl border shadow-sm border-border/60 bg-card",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row",children:[(0,s.jsx)("div",{className:"flex-1",children:(0,s.jsxs)("table",{className:"w-full",cellPadding:8,children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{className:"border-b border-border/60",children:(0,s.jsx)("th",{colSpan:2,className:"text-left md:text-center",children:"TH\xd4NG TIN CƠ BẢN"})})}),(0,s.jsxs)("tbody",{children:[(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"M\xe3 SIC"}),(0,s.jsx)("td",{className:"font-bold text-right",children:null!==(l=null==u?void 0:u.symbol)&&void 0!==l?l:"---"})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"M\xe3 ng\xe0nh ICB"}),(0,s.jsx)("td",{className:"font-bold text-right",children:null!==(t=null==u?void 0:u.icbCode)&&void 0!==t?t:"---"})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Năm th\xe0nh lập"}),(0,s.jsx)("td",{className:"font-bold text-right",children:(null==u?void 0:u.establishmentDate)?o()(null==u?void 0:u.establishmentDate).format("DD/MM/YYYY"):"---"})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Vốn điều lệ"}),(0,s.jsx)("td",{className:"font-bold text-right",children:(null==u?void 0:u.charterCapital)?"".concat(((null==u?void 0:u.charterCapital)/1e9).toFixed(1)," tỷ"):"---"})]}),(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:"Số lượng nh\xe2n sự"}),(0,s.jsx)("td",{className:"font-bold text-right",children:(null==u?void 0:u.employees)?null==u?void 0:u.employees.toLocaleStr
1ing():"---"})]})]})]})}),(0,s.jsx)("div",{className:"flex-1",children:(0,s.jsxs)("table",{className:"w-full",cellPadding:8,children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{className:"border-b border-border/60",children:(0,s.jsx)("th",{colSpan:2,className:"text-left md:text-center",children:"TH\xd4NG TIN NI\xcaM YẾT"})})}),(0,s.jsxs)("tbody",{children:[(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Ng\xe0y ni\xeam yết"}),(0,s.jsx)("td",{className:"font-bold text-right",children:(null==u?void 0:u.dateOfListing)?o()(null==u?void 0:u.dateOfListing).format("DD/MM/YYYY"):"---"})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Nơi ni\xeam yết"}),(0,s.jsx)("td",{className:"font-bold text-right",children:null!==(i=null==u?void 0:u.exchange)&&void 0!==i?i:"---"})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Gi\xe1 ch\xe0o s\xe0n (VNĐ)"}),(0,s.jsx)("td",{className:"font-bold text-right",children:(null==u?void 0:u.initialListingPrice)?null==u?void 0:u.initialListingPrice.toLocaleString():"---"})]}),(0,s.jsxs)("tr",{className:"border-b border-border/40",children:[(0,s.jsx)("td",{children:"Ng\xe0y ph\xe1t h\xe0nh cuối"}),(0,s.jsx)("td",{className:"font-bold text-right",children:(null==u?void 0:u.dateOfIssue)?o()(null==u?void 0:u.dateOfIssue).format("DD/MM/YYYY"):"---"})]}),(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:"KL đang ni\xeam yết"}),(0,s.jsx)("td",{className:"font-bold text-right",children:(null==u?void 0:u.listingVolume)?null==u?void 0:u.listingVolume.toLocaleString():"---"})]})]})]})})]})}),!!(null==h?void 0:h.length)&&(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(lE,{officers:h,showHeader:!0})}),g.length>0&&(0,s.jsx)("div",{className:"overflow-hidden p-4 mt-4 rounded-2xl border shadow-sm border-border/60 bg-card",children:(0,s.jsxs)("table",{className:"w-full",cellPadding:8,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border-b border-border/60",children:[(0,s.jsx)("th",{className:"text-left",children:"C\xd4NG TY CON"}),(0,s.jsx)("th",{className:"text-right whitespace-nowrap",children:"VỐN ĐIỀU LỆ"}),(0,s.jsx)("th",{className:"text-right whitespace-nowrap",children:"TỶ LỆ (%)"})]})}),(0,s.jsx)("tbody",{children:g.map(e=>(0,s.jsxs)("tr",{className:"border-b transition-colors cursor-pointer border-border/40 hover:bg-muted/40",onClick:l=>{l.preventDefault(),w(e)},children:[(0,s.jsx)("td",{className:"font-bold",children:(0,s.jsxs)(ea(),{href:(0,d.BDV)(e.isListed?e.symbol:e.institutionID.toString()),children:[e.companyName," ",e.isListed?"(".concat(e.symbol,":").concat(e.exchange,")"):null]})}),(0,s.jsx)("td",{className:"text-right whitespace-nowrap",children:(null==e?void 0:e.charterCapital)?"".concat(((null==e?void 0:e.charterCapital)/1e9).toFixed(1)," tỷ"):""}),(0,s.jsx)("td",{className:"text-right whitespace-nowrap",children:e.ownership?(100*e.ownership).toFixed(2):""})]},e.institutionID))})]})}),b.length>0&&(0,s.jsx)("div",{className:"overflow-hidden p-4 mt-4 rounded-2xl border shadow-sm border-border/60 bg-card",children:(0,s.jsxs)("table",{className:"w-full",cellPadding:8,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border-b border-border/60",children:[(0,s.jsx)("th",{className:"text-left",children:"C\xd4NG TY LI\xcaN KẾT"}),(0,s.jsx)("th",{className:"text-right whitespace-nowrap",children:"VỐN ĐIỀU LỆ"}),(0,s.jsx)("th",{className:"text-right whitespace-nowrap",children:"TỶ LỆ (%)"})]})}),(0,s.jsx)("tbody",{children:b.map(e=>(0,s.jsxs)("tr",{className:"border-b transition-colors cursor-pointer border-border/40 hover:bg-muted/40",onClick:l=>{l.preventDefault(),w(e)},children:[(0,s.jsx)("td",{className:"font-bold",children:(0,s.jsxs)(ea(),{href:(0,d._e2)(e.isListed?e.symbol:e.institutionID.toString()),children:[e.companyName," ",e.isListed?"(".concat(e.symbol,":").concat(e.exchange,")"):null]})}),(0,s.jsx)("td",{className:"text-right whitespace-nowrap",children:(null==e?void 0:e.charterCapital)?"".concat(((null==e?void 0:e.charterCapital)/1e9).toFixed(1)," tỷ"):""}),(0,s.jsx)("td",{className:"text-right whitespace-nowrap",children:e.ownership?(100*e.ownership).toFixed(2):""})]},e.institutionID))})]})})]})})});var lB=t(37645),lI=t(275),lz=t(16499);let lq=e=>{var l,t,a;let{symbol:i,className:r}=e,n=i.toUpperCase(),o=(0,lz.OZ)(n),d=(0,lz.ZG)(n);if(!o)return null;
1let c=null!==(l=o.hero.logoSrcLight)&&void 0!==l?l:o.hero.logoSrc;return(0,s.jsxs)(ea(),{href:(0,lI.Xc)(n),className:(0,g.cn)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl px-3 py-1.5 text-sm font-semibold shadow-sm ring-1 ring-black/5 transition-all",null!==(t=d.tabLinkClassName)&&void 0!==t?t:"".concat(d.contactAccentClassName," text-white hover:opacity-90"),r),children:[c?(0,s.jsx)("span",{className:(0,g.cn)("inline-flex h-6 shrink-0 items-center justify-center overflow-hidden rounded-md px-1.5 py-0.5",null!==(a=d.tabLogoSurfaceClassName)&&void 0!==a?a:"bg-white/95",d.tabLogoClassName),children:(0,s.jsx)("img",{src:c,alt:"","aria-hidden":!0,className:"h-4 w-auto max-w-[3.5rem] object-contain object-center"})}):null,(0,s.jsx)("span",{children:"Quan hệ cổ đ\xf4ng"})]})},l_=a.memo(e=>{let{symbol:l}=e,t=(0,j.useSymbolInfo)(l),i=(0,lB.Ay)(l),[r,n]=(0,d.a2S)(l+"_stocksSelectedTab","overview"),o=a.useCallback(e=>{n(e)},[]);return(0,s.jsx)("div",{className:"mt-2 flex flex-1 flex-col",children:(0,s.jsxs)(h.mQ,{defaultValue:"overview",value:r,onValueChange:o,children:[(0,s.jsxs)(h.dr,{className:"mb-4 flex h-auto w-fit max-w-full flex-wrap",children:[(0,s.jsx)(h.SP,{value:"overview",children:"Tổng quan"}),(0,s.jsx)(h.SP,{value:"news",children:"Tin tức"}),(0,s.jsx)(h.SP,{value:"profile",children:"Hồ sơ"}),(0,s.jsx)(h.SP,{value:"holders",children:"Cổ đ\xf4ng"}),(0,s.jsx)(h.SP,{value:"dividend",children:"Cổ tức"}),(0,s.jsx)(h.SP,{value:"financials",children:"T\xe0i ch\xednh"}),(null==t?void 0:t.isListing)&&(0,s.jsx)(h.SP,{value:"historical",children:"Dữ liệu"}),i&&(0,s.jsx)(lq,{symbol:l})]}),(0,s.jsx)(h.nU,{value:"overview",children:(0,s.jsx)(lM,{symbol:l,onChangeTab:o})}),(0,s.jsx)(h.nU,{value:"news",children:(0,s.jsx)(k.default,{symbol:l})}),(0,s.jsx)(h.nU,{value:"profile",children:(0,s.jsx)(lO,{symbol:l})}),(0,s.jsx)(h.nU,{value:"holders",children:(0,s.jsx)(lV,{symbol:l})}),(0,s.jsx)(h.nU,{value:"dividend",children:(0,s.jsx)(e_,{symbol:l})}),(0,s.jsx)(h.nU,{value:"financials",children:(0,s.jsx)(lv,{symbol:l})}),(0,s.jsx)(h.nU,{value:"historical",children:(0,s.jsx)(w,{symbol:l})})]})})}),lH=a.memo(e=>{let{symbol:l,onChangeTab:t}=e,[i]=(0,d.a2S)(l+"_overviewTabMarkLine",void 0),r=a.useCallback(()=>{t("news")},[t]);return(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsx)(m.Zb,{className:"flex h-fit flex-col p-2",children:(0,s.jsx)("div",{className:"h-[380px] md:h-[550px]",children:(0,s.jsx)(C.default,{symbol:l,markLine:i,buttonSize:"xs",showAppLink:!0},l)})}),(0,s.jsx)("div",{className:"xl:hidden",children:(0,s.jsx)(eb,{symbol:l})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(f.Z,{title:"Tin tức",description:"Tin tức li\xean quan ".concat(l),icon:eN.Z,tone:"primary",size:"sm",className:"mb-4"}),(0,s.jsx)(ey,{symbol:l,onViewMoreNews:r})]})]})}),lY=a.memo(e=>{let{symbol:l}=e,[t,i]=(0,d.a2S)(l+"_indicessSelectedTab","overview"),r=a.useCallback(e=>{i(e)},[]);return(0,s.jsx)("div",{className:"mt-2 flex flex-1 flex-col",children:(0,s.jsxs)(h.mQ,{defaultValue:"overview",value:t,onValueChange:r,children:[(0,s.jsxs)(h.dr,{className:"mb-4 flex h-auto w-fit max-w-full flex-wrap",children:[(0,s.jsx)(h.SP,{value:"overview",children:"Tổng quan"}),(0,s.jsx)(h.SP,{value:"news",children:"Tin tức"}),(0,s.jsx)(h.SP,{value:"historical",className:"md:block hidden",children:"Dữ liệu"})]}),(0,s.jsx)(h.nU,{value:"overview",children:(0,s.jsx)(lH,{symbol:l,onChangeTab:r})}),(0,s.jsx)(h.nU,{value:"news",children:(0,s.jsx)(k.default,{symbol:l})}),(0,s.jsx)(h.nU,{value:"historical",children:(0,s.jsx)(w,{symbol:l})})]})})}),lG=a.memo(e=>{let{symbol:l,onChangeTab:t}=e,[i]=(0,d.a2S)(l+"_overviewTabMarkLine",void 0),r=a.useCallback(()=>{t("news")},[t]);return(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsx)(m.Zb,{className:"flex flex-col p-3 shadow-sm",children:(0,s.jsx)("div",{className:"h-[380px] md:h-[520px]",children:(0,s.jsx)(C.default,{symbol:l,markLine:i,buttonSize:"xs",showAppLink:!0},l)})}),(0,s.jsx)("div",{className:"xl:hidden",children:(0,s.jsx)(eb,{symbol:l})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(f.Z,{title:"Tin tức",description:"Tin tức li\xean quan ".concat(l),icon:eN.Z,tone:"primary",size:"sm",className:"mb-4"}),(0,s.jsx)(ey,{symbol:l,onViewMoreNews:r})]})]})}),lQ=a.memo(e=>{let{symbol:l}=e,[t,i]=(0,d.a2S)(l+"_indicessSelectedTab","overview"),r=a.useCallback(e=>{i(e)},[]);return(0,s.jsx)("div",{className:"mt-2 flex flex-1 flex-col",children:(0,s.jsxs)(h.mQ,{defaultValue:"overview",value:t,onValueChange:r,children:[(0,s.jsxs)(h.dr,{className:"mb-4 flex h-auto w-fit max-w-full flex-wrap",children:[(0,s.jsx)(h.SP,{value:"overview",children:"Tổng quan"}),(0,s.jsx)(h.SP,{value:"news",children:"Tin tức"})]}),(0,s.jsx)(h.nU,{value:"overview",children:(0,s.jsx)(lG,{symbol:l,onChangeTab:r})}),(0,s.jsx)(h.nU,{value:"news",children:(0,s.jsx)(k.default,{symbol:l})})]})})}),lR=a.memo(e=>{let{symbol:l,onChangeTab:t}=e,[i]=(0,d.a2S)(l+"_overviewTabMarkLine",void 0),r=a.useCallback(()=>{t("news")},[t]);return(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsx)(m.Zb,{className:"flex flex-col p-3 shadow-sm",children:(0,s.jsx)("div",{className:"h-[380px] md:h-[520px]",children:(0,s.jsx)(C.default,{symbol:l,markLine:i,buttonSize:"xs",showAppLink:!0},l)})}),(0,s.jsx)("div",{className:"xl:hidden",children:(0,s.jsx)(eb,{symbol:l})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(f.Z,{title:"Tin tức",description:"Tin tức li\xean quan ".concat(l),icon:eN.Z,tone:"primary",size:"sm",className:"mb-4"}),(0,s.jsx)(ey,{symbol:l,onViewMoreNews:r})]})]})}),lK=a.memo(e=>{let{symbol:l}=e,[t,i]=(0,d.a2S)(l+"_indicessSelectedTab","overview"),r=a.useCallback(e=>{i(e)},[]);return(0,s.jsx)("div",{className:"mt-2 flex flex-1 flex-col",children:(0,s.jsxs)(h.mQ,{defaultValue:"overview",value:t,onValueChange:r,children:[(0,s.jsxs)(h.dr,{className:"mb-4 flex h-auto w-fit max-w-full flex-wrap",children:[(0,s.jsx)(h.SP,{value:"overview",children:"Tổng quan"}),(0,s.jsx)(h.SP,{value:"news",children:"Tin tức"})]}),(0,s.jsx)(h.nU,{value:"overview",children:(0,s.jsx)(lR,{symbol:l,onChangeTab:r})}),(0,s.jsx)(h.nU,{value:"news",children:(0,s.jsx)(k.default,{symbol:l})})]})})}),lU=a.memo(e=>{let{institutionID:l}=e,{companyProfile:t,requestCompanyProfile:i}=(0,N.rW)(l.toString());return(a.useEffect(()=>{i()},[i]),t)?(0,s.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,s.jsxs)("div",{className:"mb-10",children:[(0,s.jsx)("div",{className:"pb-2 mt-2 text-xl font-semibold line-clamp-1",children:t.companyName}),(0,s.jsx)("div",{className:"flex items-center text-lg",children:"Chưa ni\xeam yết"})]}),(0,s.jsx)("div",{className:"flex flex-col flex-1 w-full p-0 ",children:(0,s.jsx)(lO,{symbol:l.toString()})})]}):(0,s.jsx)(x.Z,{color:"#009900",loading:!0,size:20,"aria-label":"Loading","data-testid":"loader"})});function lW(e){let{className:l,...t}=e;return(0,s.jsx)("div",{className:(0,g.cn)("animate-pulse rounded-md bg-muted",l),...t})}var lX=t(14199),lJ=t(71646),l$=t(95440),l0=t(46309),l1=t(53103),l2=t(51267),l4=t(17328),l5=t(45077),l3=t(72175),l6=t(33683),l9=t(89455);let l8=e=>{if(!e)return"—";let l=e.substring(0,4),t=e.substring(5,9);return l.length<4||t.length<4?"—":"Thứ 2 - Thứ 6, "+l.substring(0,2)+":"+l.substring(2,4)+" - "+t.substring(0,2)+":"+t.substring(2,4)+(t<l?" (h\xf4m sau)":"")},l7=e=>e?o()(e).format("DD/MM/YYYY"):"—",te=e=>{let{icon:l,label:t,value:a}=e;return(0,s.jsxs)("div",{className:"flex items-start gap-3 rounded-xl border border-border/50 bg-muted/30 p-3",children:[(0,s.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,s.jsx)(l,{className:"h-[18px] w-[18px]"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:t}),(0,s.jsx)("div",{className:"mt-0.5 truncate text-sm font-semibold text-foreground",children:null==a||""===a?"—":a})]})]})},tl=a.memo(e=>{var l;let{symbol:t}
1=e,{commodityContractInfo:i,requestCommodityContractInfo:r}=(0,N._l)(t);return a.useEffect(()=>{r()},[r]),(0,s.jsxs)(m.Zb,{className:"p-0 shadow-sm",children:[(0,s.jsxs)(m.Ol,{className:"flex flex-row items-center gap-3 space-y-0 border-b border-border/50 p-4",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-primary/10 text-primary",children:(0,s.jsx)(lX.Z,{className:"h-5 w-5"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)(m.ll,{className:"text-base font-semibold",children:"Chi tiết hợp đồng"}),(null==i?void 0:i.name)&&(0,s.jsx)("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:i.name})]})]}),(0,s.jsx)(m.aY,{className:"p-4",children:i?(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-4",children:[(0,s.jsx)(te,{icon:lJ.Z,label:"M\xe3 h\xe0ng h\xf3a",value:i.commoditySymbol}),(0,s.jsx)(te,{icon:l$.Z,label:"M\xe3 hợp đồng",value:i.symbol}),(0,s.jsx)(te,{icon:l0.Z,label:"Sở giao dịch",value:i.exchange}),(0,s.jsx)(te,{icon:eV.Z,label:"Kỳ hạn",value:i.month&&i.year?"".concat(i.month,"/").concat(i.year):"—"}),(0,s.jsx)(te,{icon:l1.Z,label:"Bước gi\xe1",value:null!=i.tickSize?i.tickSize:"—"}),(0,s.jsx)(te,{icon:l2.Z,label:"Đơn vị yết gi\xe1",value:i.contractUnit}),(0,s.jsx)(te,{icon:l4.Z,label:"Độ lớn hợp đồng",value:null===(l=i.contractVolume)||void 0===l?void 0:l.toLocaleString("vi-VN")}),(0,s.jsx)(te,{icon:eI.Z,label:"Tiền tệ",value:i.currency}),(0,s.jsx)("div",{className:"col-span-2",children:(0,s.jsx)(te,{icon:l5.Z,label:"Giờ giao dịch (giờ VN)",value:l8(i.session)})}),(0,s.jsx)(te,{icon:l3.Z,label:"Ng\xe0y th\xf4ng b\xe1o đầu ti\xean",value:l7(i.firstNoticeDate)}),(0,s.jsx)(te,{icon:l6.Z,label:"Ng\xe0y giao dịch cuối",value:l7(i.lastTradingDate)}),(0,s.jsx)(te,{icon:l9.Z,label:"Ng\xe0y thanh to\xe1n",value:l7(i.settlementDate)})]}):(0,s.jsx)("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-4",children:Array.from({length:8}).map((e,l)=>(0,s.jsx)(lW,{className:"h-[60px] rounded-xl"},l))})})]})});tl.displayName="ContractDetails";let tt=a.memo(e=>{let{symbol:l,onChangeTab:t}=e,[i]=(0,d.a2S)(l+"_overviewTabMarkLine",void 0),r=a.useCallback(()=>{t("news")},[t]);return(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsx)(m.Zb,{className:"flex flex-col p-3 shadow-sm",children:(0,s.jsx)("div",{className:"h-[380px] md:h-[520px]",children:(0,s.jsx)(C.default,{symbol:l,markLine:i,buttonSize:"xs",showAppLink:!0},l)})}),(0,s.jsx)("div",{className:"xl:hidden",children:(0,s.jsx)(eb,{symbol:l})}),(0,s.jsx)(tl,{symbol:l}),(0,s.jsxs)("div",{children:[(0,s.jsx)(f.Z,{title:"Tin tức",description:"Tin tức li\xean quan ".concat(l),icon:eN.Z,tone:"primary",size:"sm",className:"mb-4"}),(0,s.jsx)(ey,{symbol:l,onViewMoreNews:r})]})]})}),ts=a.memo(e=>{let{symbol:l}=e,[t,i]=(0,d.a2S)(l+"_indicessSelectedTab","overview"),r=a.useCallback(e=>{i(e)},[]);return(0,s.jsx)("div",{className:"mt-2 flex flex-1 flex-col",children:(0,s.jsxs)(h.mQ,{defaultValue:"overview",value:t,onValueChange:r,children:[(0,s.jsxs)(h.dr,{className:"mb-4 flex h-auto w-fit max-w-full flex-wrap",children:[(0,s.jsx)(h.SP,{value:"overview",children:"Tổng quan"}),(0,s.jsx)(h.SP,{value:"news",children:"Tin tức"})]}),(0,s.jsx)(h.nU,{value:"overview",children:(0,s.jsx)(tt,{symbol:l,onChangeTab:r})}),(0,s.jsx)(h.nU,{value:"news",children:(0,s.jsx)(k.default,{symbol:l})})]})})});var ta=t(87901),ti=t(62630),tr=t(95968);let tn=r()(()=>Promise.all([t.e(255),t.e(2506),t.e(6941),t.e(4401),t.e(5973),t.e(291)]).then(t.bind(t,770)),{loadableGenerated:{webpack:()=>[770]},ssr:!1}),to=a.memo(e=>{let{symbol:l}=e,{symbolItem:t,requestSymbolItem:i}=(0,N.Dh)(l),{addRecentSymbol:r}=(0,N.pf)();(0,d.Apt)();let n=a.useRef(null),[o,c]=a.useState(160);return(a.useEffect(()=>{let e=n.current;if(!e)return;let l=()=>c(64+e.offsetHeight);l();let t=new ResizeObserver(l);return t.observe(e),()=>t.disconnect()},[t]),a.useEffect(()=>{l&&i()},[i,l]),a.useEffect(()=>{t&&t.isListing&&r(t.symbol)},[r,t]),isNaN(parseInt(l)))?(0,s.jsxs)("div",{className:"flex flex-col flex-1 max-md:pt-2 md:pt-3",style:{"--symbol-sticky-top":"".concat(o,"px")},children:[(0,s.jsx)(ti.Z,{title:t?"".concat(null==t?void 0:t.symbol," - ").concat(null==t?void 0:t.name):l,description:t?t.name:l}),t&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-[minmax(0,1fr)_340px] md:gap-0 xl:relative xl:left-1/2 xl:-ml-[50vw] xl:w-screen xl:grid-cols-[340px_minmax(0,1fr)_380px] xl:px-6",children:[(0,s.jsx)("aside",{className:"no-scrollbar no-scrollbar-within hidden xl:sticky xl:top-[72px] xl:flex xl:h-[calc(100vh-80px)] xl:flex-col xl:gap-3 xl:overflow-y-auto xl:pb-4 xl:pr-4",children:(0,s.jsx)(eb,{symbol:l})}),(0,s.jsxs)("main",{className:"min-w-0 md:border-r md:border-border/60 md:pr-4 xl:border-x xl:px-4",children:[(0,s.jsxs)("div",{ref:n,className:"sticky top-[64px] z-30 border-b border-border/60 bg-background/85 pb-2 pt-2 backdrop-blur supports-[backdrop-filter]:bg-background/65 md:-mr-4 md:pr-4 xl:-mx-4 xl:px-4",children:[(0,s.jsx)(eC.Z,{symbol:l}),(0,s.jsx)("div",{className:"mt-0.5 px-1 text-right text-[11px] text-muted-foreground",children:(0,s.jsx)(ta.Z,{symbol:l})})]}),(0,s.jsx)(tr.Ut,{adKey:"web_symbol_top_banner_1",className:"mb-4"}),"WORLD"==t.exchange?(0,s.jsx)(lK,{symbol:l}):"commodity"==t.type?(0,s.jsx)(ts,{symbol:l}):"stock"==t.type?(0,s.jsx)(l_,{symbol:l}):"index"==t.type?(0,s.jsx)(eD,{symbol:l}):"futures"==t.type?(0,s.jsx)(ek,{symbol:l}):"warrant"==t.type?(0,s.jsx)(lY,{symbol:l}):"crypto"==t.type?(0,s.jsx)(lQ,{symbol:l}):null]}),(0,s.jsx)("aside",{className:"no-scrollbar-within md:sticky md:top-[72px] md:h-[calc(100vh-80px)] md:pl-4",children:(0,s.jsx)("div",{className:"md:h-full",children:(0,s.jsx)(tn,{symbol:l})})})]})})]}):(0,s.jsx)(lU,{institutionID:parseInt(l)}
1)});var td=()=>{var e;let{query:l}=(0,ly.useRouter)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ti.Z,{title:l.symbol?l.symbol:"FireAnt",description:"Th\xf4ng tin chi tiết về m\xe3 chứng kho\xe1n ".concat(l.symbol)}),(0,s.jsx)(to,{symbol:null===(e=l.symbol)||void 0===e?void 0:e.toUpperCase()},l.symbol)]})}}},function(e){e.O(0,[2314,2970,770,9460,5906,6775,2034,4587,5194,5141,4623,9569,9774,2888,179],function(){return e(e.s=50266)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.