PageSourceSearch

https://anfin.vn/_next/static/chunks/pages/app/history-c709b1356376aa38.js

js anfin.vn collected 2026-09-24 10:11:25 UTC 39,313 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[602],{41098:function(e,n,t){"use strict";var i=t(64836);n.Z=void 0;var r=i(t(64938)),s=t(85893);n.Z=(0,r.default)((0,s.jsx)("path",{d:"M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m2 14H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"}),"Assignment")},19572:function(e,n,t){"use strict";var i=t(64836);n.Z=void 0;var r=i(t(64938)),s=t(85893);n.Z=(0,r.default)((0,s.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft")},63441:function(e,n,t){"use strict";var i=t(64836);n.Z=void 0;var r=i(t(64938)),s=t(85893);n.Z=(0,r.default)((0,s.jsx)("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}),"Download")},89572:function(e,n,t){"use strict";var i=t(64836);n.Z=void 0;var r=i(t(64938)),s=t(85893);n.Z=(0,r.default)((0,s.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error")},81216:function(e,n,t){"use strict";var i=t(64836);n.Z=void 0;var r=i(t(64938)),s=t(85893);n.Z=(0,r.default)((0,s.jsx)("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList")},26730:function(e,n,t){"use strict";var i=t(64836);n.Z=void 0;var r=i(t(64938)),s=t(85893);n.Z=(0,r.default)([(0,s.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),(0,s.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"Schedule")},27870:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/history",function(){return t(47148)}])},45540:function(e,n,t){"use strict";t.d(n,{Ti:function(){return f},Wx:function(){return p},YW:function(){return Z},bi:function(){return g}});var i=t(85893),r=t(78066),s=t(76172),o=t(48317),l=t(91290),a=t(90948),c=t(53252),d=t(15861),x=t(27110),h=t(2734),u=t(80822),j=t(93946);let g=(0,a.ZP)(c.Z)(e=>{let{theme:n}=e;return{textAlign:"center",borderBottom:"1px solid #E8EAEE",padding:n.spacing(2,1)}}),p=(0,a.ZP)(d.Z)({fontWeight:700,fontSize:14,color:"#6B83B9"}),f=(0,a.ZP)(c.Z)(e=>{let{theme:n}=e;return{textAlign:"center",borderBottom:"1px solid #E8EAEE",padding:n.spacing(2,1)}}),Z=e=>{let{count:n,page:t,handleChangePage:r,colSpan:s}=e;return(0,i.jsx)(x.Z,{colSpan:s,count:n,rowsPerPage:10,rowsPerPageOptions:[],page:t,onPageChange:(e,n)=>r(n),ActionsComponent:m})};function m(e){let n=(0,h.Z)(),{count:t,page:a,rowsPerPage:c,onPageChange:d}=e,x=e=>{d(e,0)},g=e=>{d(e,a-1)},p=e=>{d(e,a+1)},f=e=>{d(e,Math.max(0,Math.ceil(t/c)-1))};return(0,i.jsxs)(u.Z,{sx:{flexShrink:0},children:[(0,i.jsx)(j.Z,{onClick:x,disabled:0===a,"aria-label":"first page",children:"rtl"===n.direction?(0,i.jsx)(l.Z,{}):(0,i.jsx)(r.Z,{})}),(0,i.jsx)(j.Z,{onClick:g,disabled:0===a,"aria-label":"previous page",children:"rtl"===n.direction?(0,i.jsx)(o.Z,{}):(0,i.jsx)(s.Z,{})}),(0,i.jsx)(j.Z,{onClick:p,disabled:a>=Math.ceil(t/c)-1,"aria-label":"next page",children:"rtl"===n.direction?(0,i.jsx)(s.Z,{}):(0,i.jsx)(o.Z,{})}),(0,i.jsx)(j.Z,{onClick:f,disabled:a>=Math.ceil(t/c)-1,"aria-label":"last page",children:"rtl"===n.direction?(0,i.jsx)(r.Z,{}):(0,i.jsx)(l.Z,{})})]})}},26771:function(e,n,t){"use strict";t.d(n,{n:function(){return g}});var i=t(85893),r=t(73313),s=t(40044),o=t(15861);let l=e=>{let{category:n,onChangeCategory:t,options:l}=e;return(0,i.jsx)(r.Z,{value:n,onChange:t,sx:{backgroundColor:"#F5F7FB",display:{xs:"none",sm:"none",md:"block"},"& .MuiTabs-indicator":{display:"none"}},children:l.map(e=>(0,i.jsx)(s.Z,{value:e.option,label:(0,i.jsx)(o.Z,{fontWeight:e.option===n?700:400,fontSize:18,color:"#224696",sx:{textTransform:"none"},children:e.label})},e.label))})};var a=t(90948),c=t(591),d=t(47120);let x=(0,a.ZP)(c.Z)(e=>{let{theme:n}=e;return{margin:n.spacing(3,2),"& .MuiToggleButtonGroup-grouped":{border:0,"&.Mui-disabled":{border:0},"&.Mui-selected":{backgroundColor:"#224696","&:hover":{backgroundColor:"#224696"}},"&:not(:first-of-type)":{borderRadius:n.spacing(.5)},"&:first-of-type":{borderRadius:n.spacing(.5)}}}}),h=(0,a.ZP)(d.Z)(e=>{let{theme:n}=e;return{padding:n.spacing(1,2),marginRight:n.spacing(2),borderRadius:"4px","&:hover":{backgroundColor:"#224696","& .MuiTypography-root":{color:"#FFFFFF"}}}}),u=(0,a.ZP)(o.Z,{shouldForwardProp:e=>"isSelected"!==e})(e=>{let{isSelected:n}=e;return{textTransform:"none",fontSize:16,fontWeight:n?700:600,color:n?"#F
1FFFFF":"#6B6B6B"}}),j=e=>{let{category:n,onChangeCategory:t,options:r}=e;return(0,i.jsx)(x,{exclusive:!0,value:n,onChange:t,sx:{display:{xs:"block",sm:"block",md:"none"}},children:r.map((e,t)=>(0,i.jsx)(h,{value:e.option,"aria-label":e.label,children:(0,i.jsx)(u,{isSelected:e.option===n,children:e.label})},t))})},g=e=>{let{category:n,options:t,onChangeCategoryOnDesktop:r,onChangeCategoryOnMobile:s}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l,{category:n,onChangeCategory:r,options:t}),(0,i.jsx)(j,{category:n,onChangeCategory:s,options:t})]})}},69429:function(e,n,t){"use strict";t.d(n,{Z:function(){return C}});var i=t(85893),r=t(90948),s=t(80822),o=t(2734),l=t(15861),a=t(51233),c=t(5152),d=t.n(c),x=t(11163),h=t(67294),u=t(21816),j=t(56137),g=t(67030),p=t(76755),f=t(42496),Z=t(64458),m=t(72329),b=t(36470);let v=d()(()=>Promise.resolve().then(t.bind(t,36470)).then(e=>e.MainHeader),{loadableGenerated:{webpack:()=>[36470]}}),S=d()(()=>Promise.all([t.e(4564),t.e(7918),t.e(1535),t.e(6693),t.e(6720),t.e(7022)]).then(t.bind(t,67022)).then(e=>e.AppHeader),{loadableGenerated:{webpack:()=>[67022]}}),y=(0,r.ZP)(s.Z)({position:"absolute",width:"100%",height:"100%",background:"rgba(255, 255, 255, 0.4)",backdropFilter:"blur(15px)",zIndex:2,display:"flex",alignItems:"center",justifyContent:"center"}),F=(0,r.ZP)("main")(e=>{let{theme:n}=e;return{overflow:"auto",width:"100%",marginTop:"".concat(b.MAIN_DESKTOP_HEADER_HEIGHT,"px"),[n.breakpoints.down("md")]:{marginTop:"".concat(b.MAIN_DESKTOP_HEADER_HEIGHT,"px")}}});function C(e){let{children:n,sx:t,hasDownloadingApp:r=!1,hasFooter:c=!1,keepAppHeaderForGuest:d=!1}=e,{user:b}=(0,f.a)(),C=(0,o.Z)(),T=(0,x.useRouter)(),{modalLoginRegister:k}=(0,Z.Pb)(),w=T.pathname.startsWith("/app"),[A,D]=(0,h.useState)(!1),[z,P]=(0,h.useState)("login"),N=()=>{D(!0),P("login")},L=()=>{D(!0),P("register")};return(0,i.jsxs)(s.Z,{sx:{position:"relative"},children:[(0,i.jsx)(y,{sx:{display:k[g.Od.LOGINREGISTER]?"flex":"none"},children:A?(0,i.jsx)(u.vF,{tabName:z}):(0,i.jsxs)(s.Z,{sx:{textAlign:"center",fontWeight:"700"},children:["Bạn cần",(0,i.jsx)(l.Z,{sx:{color:"#2491DD",margin:"0px 5px",fontWeight:"bolder",":hover":{textDecoration:"underline"}},onClick:()=>N(),children:"đăng nhập"}),"hoặc",(0,i.jsx)(l.Z,{sx:{color:"#2491DD",margin:"0px 5px",fontWeight:"bolder",":hover":{textDecoration:"underline"}},onClick:()=>L(),children:"đăng k\xfd"}),(0,i.jsx)("br",{}),"t\xe0i khoản Anfin để sử dụng t\xednh năng n\xe0y."]})}),(0,i.jsxs)(a.Z,{sx:{minHeight:1,display:"flex",width:"100%",pl:{md:w?"".concat(j.y,"px"):0}},children:[b||d?(0,i.jsx)(S,{}):(0,i.jsx)(v,{}),(0,i.jsxs)(F,{sx:t,children:[(0,i.jsx)(s.Z,{sx:{p:{xs:C.spacing(0,2,1,2),sm:C.spacing(0,2,1,3)}},children:n}),(0,i.jsxs)("footer",{children:[r&&(0,i.jsx)(p.default,{}),c&&(0,i.jsx)(m.MainFooter,{})]})]})]})]})}},47148:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ng}});var i,r,s,o,l=t(85893),a=t(51233),c=t(67294),d=t(26771),x=t(65141),h=t(72882),u=t(7906),j=t(53184),g=t(53816),p=t(295),f=t(53252),Z=t(87462),m=t(63366),b=t(90512),v=t(94780),S=t(44063),y=t(28628),F=t(90948),C=t(1588),T=t(34867);function k(e){return(0,T.ZP)("MuiTableFooter",e)}(0,C.Z)("MuiTableFooter",["root"]);let w=["className","component"],A=e=>{let{classes:n}=e;return(0,v.Z)({root:["root"]},k,n)},D=(0,F.ZP)("tfoot",{name:"MuiTableFooter",slot:"Root",overridesResolver:(e,n)=>n.root})({display:"table-footer-group"}),z={variant:"footer"},P="tfoot",N=c.forwardRef(function(e,n){let t=(0,y.i)({props:e,name:"MuiTableFooter"}),{className:i,component:r=P}=t,s=(0,m.Z)(t,w),o=(0,Z.Z)({},t,{component:r}),a=A(o);return(0,l.jsx)(S.Z.Provider,{value:z,children:(0,l.jsx)(D,(0,Z.Z)({as:r,className:(0,b.Z)(a.root,i),ref:n,role:r===P?null:"rowgroup",ownerState:o},s))})});var L=t(88767),E=t(84970),B=t(51891),W=t(45540),I=t(15017),M=t(42496),R=t(77829),_=t(15861),Y=t(7826),H=t(4611),O=t(49635);let V=(0,F.ZP)(_.Z)({fontWeight:400,fontSize:14,color:"#191D2B"}),G=(0,F.ZP)(_.Z)({fontWeight:700,fontSize:14}),U=e=>{let{dividend:n}=e;return(0,l.jsxs)(g.Z,{children:[(0,l.jsx)(W.Ti,{children:(0,l.jsx)(V,{children:new Date(n.exDiv
1idendDate).toLocaleDateString("vi-VN")})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(V,{children:n.paymentDate?new Date(n.paymentDate).toLocaleDateString("vi-VN"):I.YN})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(V,{children:n.stockSymbol})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(G,{color:n.dividendType===Y.sd.CashDividend?"#27AE60":"#208EDB",children:Y.Uo[n.dividendType]})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(V,{children:(0,H.y1)(n)})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(V,{children:(0,O.uf)(n.sharesHeld,I.YN)})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(V,{children:(0,O.uf)(n.dividendShares,I.YN)})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(G,{color:(0,O.TS)(n),children:(0,H.wn)(n)})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(V,{children:n.tax?"".concat((0,O.uf)(100*n.tax,I.YN),"%"):I.YN})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(G,{children:(0,H.zf)(n)})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(V,{children:n.price?(0,O.uf)(n.price,I.YN):I.YN})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(V,{children:n.reservedFrom&&n.reservedTo?(0,l.jsxs)(l.Fragment,{children:[new Date(n.reservedFrom).toLocaleDateString("vi-VN"),(0,l.jsx)("br",{}),"- ",new Date(n.reservedTo).toLocaleDateString("vi-VN")]}):I.YN})})]})},X=()=>{let{user:e}=(0,M.a)(),[n,t]=(0,c.useState)(0),i=e=>{t(e)},[r,s]=(0,c.useState)([]),[o,a]=(0,c.useState)(0),{isLoading:d}=(0,L.useQuery)(["find-dividends",n,e],async()=>{let t=await (null==e?void 0:e.userFS.getIdToken())||"";return t?(await fetch("/api/stock-order/dividend?page=".concat(n+1,"&limit=").concat(I.Uc),{method:"GET",headers:(0,R.IZ)(t)})).json():Promise.resolve({})},{onSuccess:e=>{if(!e||!e.data||"string"==typeof e.data){s([]);return}a(e.data.total),s(e.data.dividends)}}),x=n>0?Math.max(0,(1+n)*I.Uc-r.length):0;return d?(0,l.jsx)(B.g,{sx:{my:3}}):o?(0,l.jsx)(h.Z,{children:(0,l.jsxs)(u.Z,{sx:{backgroundColor:"#FFFFFF"},children:[(0,l.jsx)(j.Z,{children:(0,l.jsxs)(g.Z,{children:[(0,l.jsx)(W.bi,{children:(0,l.jsxs)(W.Wx,{children:["Ng\xe0y GD ",(0,l.jsx)("br",{}),"kh\xf4ng hưởng quyền"]})}),(0,l.jsx)(W.bi,{children:(0,l.jsx)(W.Wx,{children:"Ng\xe0y cổ tức trả về"})}),(0,l.jsx)(W.bi,{children:(0,l.jsx)(W.Wx,{children:"M\xe3 CK"})}),(0,l.jsx)(W.bi,{children:(0,l.jsx)(W.Wx,{children:"Loại cổ tức"})}),(0,l.jsx)(W.bi,{children:(0,l.jsx)(W.Wx,{children:"Tỷ lệ cổ tức"})}),(0,l.jsx)(W.bi,{children:(0,l.jsx)(W.Wx,{children:"SLCP tại ng\xe0y chốt"})}),(0,l.jsx)(W.bi,{children:(0,l.jsx)(W.Wx,{children:"SLCP được chia"})}),(0,l.jsx)(W.bi,{children:(0,l.jsx)(W.Wx,{children:"Trạng th\xe1i"})}),(0,l.jsx)(W.bi,{children:(0,l.jsx)(W.Wx,{children:"Thuế TNCN"})}),(0,l.jsx)(W.bi,{children:(0,l.jsx)(W.Wx,{children:"Cổ tức thực nhận"})}),(0,l.jsx)(W.bi,{children:(0,l.jsx)(W.Wx,{children:"Gi\xe1 ph\xe1t h\xe0nh"})}),(0,l.jsx)(W.bi,{children:(0,l.jsxs)(W.Wx,{children:["Thời gian đăng k\xfd",(0,l.jsx)("br",{})," & đặt mua"]})})]})}),(0,l.jsxs)(p.Z,{children:[r.map((e,n)=>(0,l.jsx)(U,{dividend:e},n)),x>0&&(0,l.jsx)(g.Z,{style:{height:54*x},children:(0,l.jsx)(f.Z,{colSpan:12})})]}),(0,l.jsx)(N,{children:(0,l.jsx)(g.Z,{children:(0,l.jsx)(W.YW,{count:r.length,page:n,handleChangePage:i,colSpan:12})})})]})}):(0,l.jsx)(E.u,{msg:"Bạn chưa sở hữu cổ tức"})};var Q=t(26215),q=t(80822),K=t(18357),J=t(19572),$=t(50594),ee=t(54776),en=t(64666),et=t(42293),ei=t(10155),er=t(93946),es=t(6514),eo=t(67720);let el=(0,c.forwardRef)(function(e,n){return(0,l.jsx)(ee.Z,{direction:"up",ref:n,...e})}),ea=e=>{let{dividend:n,canOpen:t,onClose:i}=e;return(0,l.jsxs)(en.Z,{fullScreen:!0,open:t,onClose:i,TransitionComponent:el,children:[(0,l.jsx)(et.Z,{sx:{position:"relative"},children:(0,l.jsxs)(ei.Z,{children:[(0,l.jsx)(er.Z,{edge:"start",color:"inherit",onClick:i,"aria-label":"close",children:(0,l.jsx)(J.Z,{})}),(0,l.jsx)(a.Z,{flexGrow:1,direction:"row",justifyContent:"center",alignItems:"center",children:(0,l.jsx)(_.Z,{fontWeight:700,fontSize:16,children:"Chi tiết cổ tức"})}),(0,l.jsx)(er.Z,{edge:"end",color:"inherit",onClick:i,"aria-label":"close",children:(0,l.jsx)($.Z,{})})]})}),(0,l.jsxs)(a.Z,{justifyContent:"center",alignItems:"center",spacing:1,my:3,children:[(0,l.jsx)(_.Z,{fontWeight:700,fontSize:24,color:"#21273B",children:n.stockSymbol}),(0,l.jsx)(a.Z,{direction:"row",spacing:1,children:(0,l.jsx)(_.Z,{fontWeight:700,fontSize:14,color:(0,O.TS)(n),children:(0,H.wn)(n)})})]}),(0,l.jsx)(es.Z,{children:(0,l.jsxs)(q.Z,{mb:2,children:[(0,l.jsx)(_.Z,{fontWeight:700,fontSize:14,component:"div",children:"Th\xf4ng tin giao dịch"}),(0,l.jsxs)(a.Z,{divider:(0,l.jsx)(eo.Z,{orientation:"horizontal",flexItem:!0}),spacing:2,my:2,children:[(0,l.jsxs)(ec,{children:[(0,l.jsx)(ex,{children:"Loại cổ tức"}),(0,l.jsx)(eu,{children:Y.Uo[n.dividendType]})]}),(0,l.jsxs)(ec,{children:[(0,l.jsx)(ex,{children:"Ng\xe0y GD kh\xf4ng hưởng quyền"}
1),(0,l.jsx)(eu,{children:new Date(n.exDividendDate).toLocaleDateString("vi-VN")})]}),(0,l.jsxs)(ec,{children:[(0,l.jsx)(ex,{children:"Ng\xe0y cổ tức trả về"}),(0,l.jsx)(eu,{children:n.paymentDate?new Date(n.paymentDate).toLocaleDateString("vi-VN"):I.YN})]}),(0,l.jsxs)(ec,{children:[(0,l.jsx)(ex,{children:"Tỷ lệ cổ tức"}),(0,l.jsx)(eu,{children:(0,H.y1)(n)})]}),(0,l.jsxs)(ec,{children:[(0,l.jsx)(ex,{children:"SLCP tại ng\xe0y chốt"}),(0,l.jsx)(eu,{children:(0,O.uf)(n.sharesHeld,I.YN)})]}),(0,l.jsxs)(ec,{children:[(0,l.jsx)(ex,{children:"SLCP được chia"}),(0,l.jsx)(eu,{children:(0,O.uf)(n.dividendShares,I.YN)})]}),(0,l.jsxs)(ec,{children:[(0,l.jsx)(ex,{children:"Thuế TNCN"}),(0,l.jsx)(eu,{children:n.tax?"".concat((0,O.uf)(100*n.tax,I.YN),"%"):I.YN})]}),(0,l.jsxs)(ec,{children:[(0,l.jsx)(ex,{children:"Cổ tức thực nhận"}),(0,l.jsx)(eu,{children:(0,H.zf)(n)})]})]})]})})]})},ec=(0,F.ZP)(a.Z)({flexDirection:"row",justifyContent:"space-between",alignItems:"center"}),ed=(0,F.ZP)(a.Z)(e=>{let{theme:n}=e;return{borderRadius:"8px",boxShadow:"0px 4px 24px 6px rgba(0, 0, 0, 0.04);",backgroundColor:"#FFF",padding:n.spacing(2)}}),ex=(0,F.ZP)(_.Z)({fontWeight:400,fontSize:13}),eh=(0,F.ZP)(_.Z)({fontWeight:600,fontSize:13}),eu=(0,F.ZP)(_.Z)({fontWeight:600,fontSize:14}),ej=()=>{let{user:e}=(0,M.a)(),{ref:n,inView:t}=(0,K.YD)(),[i,r]=(0,c.useState)(!1),[s,o]=(0,c.useState)(null),d=e=>{o(e),r(!0)},{isLoading:x,data:h,isFetchingNextPage:u,hasNextPage:j,fetchNextPage:g}=(0,L.useInfiniteQuery)(["find-dividends-infinite"],async n=>{let{pageParam:t=0}=n,i=await (null==e?void 0:e.userFS.getIdToken());return i?(await fetch("/api/stock-order/dividend?page=".concat(t,"&limit=").concat(I.Uc),{method:"GET",headers:(0,R.IZ)(i)})).json():Promise.resolve({})},{keepPreviousData:!0,getPreviousPageParam:e=>e&&Object.keys(e).length?e.data&&"string"!=typeof e.data&&e.data.page>0?e.data.page-1:void 0:1,getNextPageParam:e=>{var n,t;return e&&Object.keys(e).length?e.data&&"string"!=typeof e.data&&(null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.dividends)!==null&&(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.dividends.length)>=I.Uc?e.data.page+1:void 0:1}});if((0,c.useEffect)(()=>{t&&!u&&j&&!x&&g()},[t,j,x,e]),x)return(0,l.jsx)(B.g,{sx:{my:3}});if(!h||!h.pages.length)return(0,l.jsx)(E.u,{msg:"Bạn chưa c\xf3 lịch sử đặt lện
1h"});let p=h.pages.reduce((e,n)=>(n.data&&"string"!=typeof n.data&&e.push(...n.data.dividends),e),[]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.Z,{px:2,spacing:2,children:p.map(e=>(0,l.jsxs)(ed,{spacing:.5,children:[(0,l.jsxs)(ec,{children:[(0,l.jsx)(_.Z,{fontWeight:700,fontSize:14,color:"#21273B",children:e.stockSymbol}),(0,l.jsxs)(a.Z,{direction:"row",justifyContent:"center",alignItems:"center",sx:{cursor:"pointer"},onClick:()=>d(e),children:[(0,l.jsx)(ex,{color:"#96A0B5",children:new Date(e.createdAt).toLocaleDateString("vi-VN")}),(0,l.jsx)(Q.Z,{fontSize:"small"})]})]}),(0,l.jsxs)(ec,{children:[(0,l.jsx)(eh,{color:e.dividendType===Y.sd.CashDividend?"#27AE60":"#208EDB",children:Y.Uo[e.dividendType]}),(0,l.jsx)(eh,{color:(0,O.TS)(e),children:(0,H.wn)(e)})]}),(0,l.jsxs)(ec,{children:[(0,l.jsx)(ex,{color:"#96A0B5",children:"Cổ tức thực nhận"}),(0,l.jsx)(ex,{children:(0,H.zf)(e)})]})]},e.id))}),(0,l.jsx)(q.Z,{ref:n,children:(u||x)&&(0,l.jsx)(B.g,{sx:{my:3}})}),s&&(0,l.jsx)(ea,{dividend:s,canOpen:i,onClose:()=>r(!1)})]})},eg=()=>{let e=(0,x.Z)();return e?(0,l.jsx)(X,{}):(0,l.jsx)(ej,{})};var ep=t(63441),ef=t(69417),eZ=t(12205),em=t(13078),eb=t(73046),ev=t(89903);let eS=e=>{let n=e.map(e=>[e.stockSymbol,new Date(e.createdAt).toLocaleString("vi-VN"),eZ.Xp[e.orderBuySell]||e.orderBuySell,e.quantity,e.quotedPrice,e.totalValue,eZ.mr[(0,ev.FQ)(e.orderType)]||e.orderType,eZ.Bm[e.status]||e.status,e.id]),t=[["M\xe3 CK","Ng\xe0y đặt","Mua/B\xe1n","Số lượng","Gi\xe1 đặt","Tổng gi\xe1 trị","Loại lệnh","Trạng th\xe1i","M\xe3 đặt lện
1h"],...n].map(e=>e.map(e=>'"'.concat(String(e).replace(/"/g,'""'),'"')).join(",")).join("\n"),i=new Blob(["\uFEFF".concat(t)],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(i),s=document.createElement("a");s.href=r,s.download="lich-su-giao-dich-".concat(Date.now(),".csv"),document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(r)},ey=()=>{let{user:e}=(0,M.a)(),n=(0,em.C)(),[t,i]=(0,c.useState)(!1),r=async()=>{i(!0);try{let t=await (null==e?void 0:e.userFS.getIdToken())||"",i=await fetch("/api/stock-order/list?page=1&limit=".concat(1e3),{method:"GET",headers:(0,R.IZ)(t)}),r=await i.json();if(!(null==r?void 0:r.data)||"string"==typeof r.data||!r.data.items.length){n.warning("Kh\xf4ng c\xf3 dữ liệu để xuất.");return}eS(r.data.items)}catch(e){n.error("Xuất dữ liệu thất bại. Vui l\xf2ng thử lại sau."),eb.k.error("export order history \n"+JSON.stringify(e))}finally{i(!1)}};return(0,l.jsxs)(a.Z,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[(0,l.jsxs)(q.Z,{sx:{display:"flex",flexDirection:"column"},children:[(0,l.jsx)(_.Z,{fontWeight:700,fontSize:12,color:"#0AA5FF",sx:{textTransform:"uppercase",letterSpacing:"0.04em"},children:"Hoạt động t\xe0i khoản"}),(0,l.jsx)(_.Z,{fontWeight:700,fontSize:26,sx:{mt:.5},children:"Lịch sử giao dịch"}),(0,l.jsx)(_.Z,{fontSize:14,color:"#697896",children:"Theo d\xf5i trạng th\xe1i v\xe0 chi tiết c\xe1c lệnh đ\xe3 đặt"})]}),(0,l.jsx)(ef.Z,{variant:"outlined",startIcon:(0,l.jsx)(ep.Z,{}),onClick:r,disabled:t,sx:{textTransform:"none",fontWeight:600,borderColor:"#D0D5DC",color:"#191D2B",borderRadius:"8px",display:"flex","&:hover":{backgroundColor:"#F0F2F5"}},children:t?"Đang xuất...":"Xuất dữ liệu"})]})};(i=s||(s={})).ORDER="ORDER",i.DIVIDEND="DIVIDEND";
1let eF=[{label:"Lịch sử đặt lệnh",option:s.ORDER},{label:"Cổ tức",option:s.DIVIDEND}],eC=[{label:"Lệnh đặt",option:s.ORDER},{label:"Cổ tức",option:s.DIVIDEND}],eT=e=>{let{category:n,onChangeCategory:t}=e;return(0,l.jsx)(a.Z,{direction:"row",spacing:3,sx:{borderBottom:"1px solid #E8EAEE"},children:eC.map(e=>{let i=e.option===n;return(0,l.jsx)(a.Z,{sx:{cursor:"pointer",pb:1.5,borderBottom:i?"2px solid #0AA5FF":"2px solid transparent"},onClick:()=>t(e.option),children:(0,l.jsx)(_.Z,{fontWeight:i?700:500,fontSize:15,color:i?"#0AA5FF":"#697896",children:e.label})},e.option)})})};var ek=t(7528),ew=t(31425);let eA=e=>e.status===eZ.iF.Pending,eD=(0,F.ZP)(ef.Z)({textTransform:"none",fontWeight:600,fontSize:13,color:"#FF5959",minWidth:"auto",padding:"2px 8px"}),ez=e=>{let{order:n,onCancelled:t}=e,{user:i}=(0,M.a)(),r=(0,em.C)(),[s,o]=(0,c.useState)(!1),a=(0,L.useMutation)(async()=>{let e=await (null==i?void 0:i.userFS.getIdToken())||"";return fetch("/api/stock-order/cancellation",{method:"PUT",headers:(0,R.IZ)(e),body:JSON.stringify({id:n.id})}).then(e=>e.json())},{onError:e=>{r.error("Huỷ lệnh thất bại. Vui l\xf2ng thử lại sau."),eb.k.error("cancelOrder \n"+JSON.stringify(e))},onSuccess:e=>{if(200!==e.code){r.error("string"==typeof e.data?e.data:"Huỷ lệnh thất bại.");return}o(!1),r.success("Huỷ lệnh th\xe0nh c\xf4ng."),t()}});return eA(n)?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eD,{onClick:()=>o(!0),children:"Huỷ lệnh"}),(0,l.jsxs)(en.Z,{open:s,onClose:()=>o(!1),children:[(0,l.jsxs)(es.Z,{sx:{pt:3,maxWidth:360},children:[(0,l.jsx)(_.Z,{fontWeight:700,fontSize:16,sx:{mb:1},children:"Huỷ lệnh chờ?"}),(0,l.jsxs)(_.Z,{fontSize:14,color:"#697896",children:["Bạn c\xf3 chắc muốn huỷ lệnh"," ",(0,l.jsx)(_.Z,{component:"span",fontWeight:700,color:"#191D2B",children:n.stockSymbol})," ","đang chờ khớp kh\xf4ng? H\xe0nh động n\xe0y kh\xf4ng thể ho\xe0n t\xe1c."]})]}),(0,l.jsxs)(ew.Z,{sx:{px:3,pb:2},children:[(0,l.jsx)(ef.Z,{onClick:()=>o(!1),sx:{textTransform:"none",color:"#697896"},children:"Đ\xf3ng"}),(0,l.jsx)(ef.Z,{variant:"contained",onClick:()=>a.mutate(),disabled:a.isLoading,sx:{textTransform:"none",backgroundColor:"#FF5959"},children:"Huỷ lệnh"})]})]})]}):null},eP=(0,F.ZP)(_.Z)({fontWeight:400,fontSize:14,color:"#191D2B"}),eN=(0,F.ZP)(q.Z,{shouldForwardProp:e=>"side"!==e})(e=>{let{side:n}=e;return{display:"inline-block",padding:"4px 14px",borderRadius:"999px",fontWeight:700,fontSize:13,backgroundColor:n===eZ.Xp.Buy?"#EBFAF1":"#FFEEF0",color:(0,O.po)(n)}}),eL=e=>{let{order:n,onCancelled:t}=e,i=eZ.Xp[n.orderBuySell],r=(0,O.z9)(n.status),s=new Date(n.createdAt);return(0,l.jsxs)(g.Z,{children:[(0,l.jsx)(W.Ti,{sx:{textAlign:"left"},children:(0,l.jsxs)(a.Z,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,l.jsx)(ek.Z,{symbol:n.stockSymbol,width:32,height:32}),(0,l.jsxs)(a.Z,{spacing:.25,children:[(0,l.jsx)(_.Z,{fontWeight:700,fontSize:14,lineHeight:1.3,children:n.stockSymbol}),(0,l.jsxs)(_.Z,{fontSize:12,color:"#96A0B5",lineHeight:1.3,children:[s.toLocaleDateString("vi-VN")," ",s.toLocaleTimeString("vi-VN",{hour:"2-digit",minute:"2-digit"})]})]})]})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(eN,{side:i,children:i})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(eP,{children:(0,O.uf)(n.quantity,I.YN)})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(eP,{children:(0,O.uf)(n.quotedPrice,I.YN)})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(_.Z,{fontSize:14,color:"#96A0B5",children:I.YN})}),(0,l.jsx)(W.Ti,{children:(0,l.jsxs)(eP,{children:[(0,O.uf)(n.totalValue,I.YN)," đ"]})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(eP,{children:eZ.mr[(0,ev.FQ)(n.orderType)]})}),(0,l.jsx)(W.Ti,{children:(0,l.jsxs)(a.Z,{direction:"row",alignItems:"center",justifyContent:"center",spacing:.75,children:[(0,l.jsx)(q.Z,{sx:{width:6,height:6,borderRadius:"50%",backgroundColor:r}}),(0,l.jsx)(_.Z,{fontWeight:600,fontSize:13,color:r,children:eZ.Bm[n.status]})]})}),(0,l.jsx)(W.Ti,{children:(0,l.jsx)(ez,{order:n,onCancelled:t})})]})},eE=(0,F.ZP)(a.Z,{shouldForwardProp:e=>"isSelected"!==e})(e=>{let{isSelected:n}=e;return{width:32,height:32,borderRadius:"8px",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:n?"#0AA5FF":"transparent"}}),eB=e=>{let{page:n,pageSize:t,total:i,onChangePage:r}=e,s=Math.max(1,Math.ceil(i/t)),o=Math.max(0,n-Math.floor(2.5)),c=Math.min(s,o+5);o=Math.max(0,c-5);let d=Array.from({length:c-o},(e,n)=>o+n);return(0,l.jsxs)(a.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{px:1,py:1.5},children:[(0,l.jsxs)(_.Z,{fontSize:13,color:"#96A0B5",children:["Hiển thị ",0===i?0:n*t+1,"–",Math.min(i,(n+1)*t)," trong ",i," giao dịch"]}),(0,l.jsxs)(a.Z,{direction:"row",spacing:.5,alignItems:"center",children:[(0,l.jsx)(er.Z,{size:"small",disabled:0===n,onClick:()=>r(n-1),"aria-label":"Trang trước",children:(0,l.jsx)(J.Z,{fontSize:"small"})}),d.map(e=>(0,l.jsx)(eE,{isSelected:e===n,onClick:()=>r(e),children:(0,l.jsx)(_.Z,{fontSize:13,fontWeight:e===n?700:500,color:e===n?"#FFF":"#697896",children:e+1})},e)),(0,l.jsx)(er.Z,{size:"small",disabled:n>=s-1,onClick:()=>r(n+1),"aria-label":"Trang sau",children:(0,l.jsx)(Q.Z,{fontSize:"small"})})]})]})};var eW=t(81216),eI=t(42761),eM=t(10315),eR=t(50135),e_=t(87109),eY=t(18972);(r=o||(o={})).LAST_7_DAYS="LAST_7_DAYS",r.LAST_30_DAYS="LAST_30_DAYS",r.LAST_3_MONTHS="LAST_3_MONTHS",r.ALL="ALL";let eH=[{label:"7 ng\xe0y gần nhất",value:o.LAST_7_DAYS},{label:"30 ng\xe0y gần nhất",value:o.LAST_30_DAYS},{label:"3 th\xe1ng gần nhất",value:o.LAST_3_MONTHS},{label:"Tất cả thời gian",value:o.ALL}],eO={[o.LAST_7_DAYS]:7,[o.LAST_30_DAYS]:30,[o.LAST_3_MONTHS]:90,[o.ALL]:null},eV={keyword:"",dateRange:o.ALL,status:"ALL",side:"ALL"},eG=(0,F.ZP)(eM.Z)({backgroundColor:"#FFF",borderRadius:"8px",fontSize:14,minWidth:160}),eU=e=>{let{filters:n,onChangeFilters:t,onReset:i,isFilterActive:r,resultCount:s}=e;return(0,l.jsxs)(a.Z,{direction:"row",spacing:1.5,alignItems:"center",flexWrap:"wrap",sx:{mb:2},children:[(0,l.jsx)(eR.Z,{size:"small",placeholder:"T\xecm m\xe3 CK hoặc m\xe3 đặt lện
1h",value:n.keyword,onChange:e=>t({keyword:e.target.value}),InputProps:{startAdornment:(0,l.jsx)(e_.Z,{position:"start",children:(0,l.jsx)(eI.Z,{fontSize:"small",sx:{color:"#96A0B5"}})})},sx:{backgroundColor:"#FFF",borderRadius:"8px",flexGrow:1,minWidth:220,maxWidth:280}}),(0,l.jsx)(eG,{size:"small",value:n.dateRange,onChange:e=>t({dateRange:e.target.value}),children:eH.map(e=>(0,l.jsx)(eY.Z,{value:e.value,children:e.label},e.value))}),(0,l.jsxs)(eG,{size:"small",value:n.status,onChange:e=>t({status:e.target.value}),children:[(0,l.jsx)(eY.Z,{value:"ALL",children:"Trạng th\xe1i"}),Object.keys(eZ.iF).map(e=>(0,l.jsx)(eY.Z,{value:eZ.iF[e],children:eZ.Bm[eZ.iF[e]]},e))]}),(0,l.jsxs)(eG,{size:"small",value:n.side,onChange:e=>t({side:e.target.value}),children:[(0,l.jsx)(eY.Z,{value:"ALL",children:"Mua / B\xe1n"}),(0,l.jsx)(eY.Z,{value:eZ.Xp.Buy,children:"Mua"}),(0,l.jsx)(eY.Z,{value:eZ.Xp.Sell,children:"B\xe1n"})]}),(0,l.jsxs)(a.Z,{direction:"row",spacing:.75,alignItems:"center",sx:{cursor:"pointer",px:1.5,py:"7px",borderRadius:"8px",backgroundColor:r?"#E8F5FF":"#FFF",border:"1px solid ".concat(r?"#0AA5FF":"#D0D5DC")},onClick:i,title:r?"Xo\xe1 bộ lọc":void 0,children:[(0,l.jsx)(eW.Z,{fontSize:"small",sx:{color:"#0AA5FF"}}),(0,l.jsx)(_.Z,{fontWeight:600,fontSize:14,color:"#0AA5FF",children:"Lọc"}),r&&(0,l.jsx)(q.Z,{sx:{width:6,height:6,borderRadius:"50%",backgroundColor:"#0AA5FF"}})]}),(0,l.jsx)(q.Z,{flexGrow:1}),(0,l.jsxs)(_.Z,{fontSize:13,color:"#96A0B5",sx:{whiteSpace:"nowrap"},children:[s," kết quả"]})]})};var eX=t(41098),eQ=t(44510),eq=t(60888),eK=t(26730);let eJ=e=>{let{icon:n,iconBg:t,iconColor:i,label:r,value:s,extra:o}=e;return(0,l.jsxs)(a.Z,{direction:"row",spacing:1.5,alignItems:"center",sx:{backgroundColor:"#FFF",border:"1px solid #E8EAEE",borderRadius:"12px",p:2,flex:1,minWidth:0,display:"flex",alignItems:"center",justifyContent:"flex-start"},children:[(0,l.jsx)(q.Z,{sx:{width:40,height:40,flexShrink:0,borderRadius:"10px",backgroundColor:t,color:i,display:"flex",alignItems:"center",justifyContent:"center"},children:n}),(0,l.jsxs)(q.Z,{sx:{minWidth:0},children:[(0,l.jsx)(_.Z,{fontSize:11,fontWeight:700,color:"#96A0B5",sx:{textTransform:"uppercase",letterSpacing:"0.03em"},children:r}),(0,l.jsxs)(a.Z,{direction:"row",alignItems:"baseline",spacing:.75,sx:{display:"flex",alignItems:"item"},children:[(0,l.jsx)(_.Z,{fontWeight:700,fontSize:22,color:"#191D2B",children:s}),o]})]})]})},e$=e=>e===eZ.iF.Filled||e===eZ.iF.PartiallyFilled,e0=e=>e===eZ.iF.Error,e1=e=>"".concat(e.toLocaleDateString("vi-VN")," \xb7 ").concat(e.toLocaleTimeString("vi-VN",{hour:"2-digit",minute:"2-digit"})),e2=e=>{let{orders:n,lastUpdatedAt:t}=e,i=n.length,r=n.filter(e=>e$(e.status)).length,s=n.filter(e=>e0(e.status)).length,o=i?(r/i*100).toFixed(1):"0";return(0,l.jsxs)(a.Z,{direction:"row",spacing:2,alignItems:"stretch",flexWrap:"wrap",sx:{mb:2},children:[(0,l.jsx)(eJ,{icon:(0,l.jsx)(eX.Z,{fontSize:"small"}),iconBg:"#E8F5FF",iconColor:"#0AA5FF",label:"Tổng số lệnh",value:i}),(0,l.jsx)(eJ,{icon:(0,l.jsx)(eq.Z,{fontSize:"small"}),iconBg:"#EBFAF1",iconColor:"#27AE60",label:"Đ\xe3 khớp",value:r,extra:(0,l.jsxs)(_.Z,{fontWeight:700,fontSize:13,color:"#27AE60",children:[o,"%"]})}),(0,l.jsx)(eJ,{icon:(0,l.jsx)(eK.Z,{fontSize:"small"}),iconBg:"#FFF4E5",iconColor:"#FF6B00",label:"Đang xử l\xfd",value:i-r-s}),(0,l.jsx)(eJ,{icon:(0,l.jsx)(eQ.Z,{fontSize:"small"}),iconBg:"#FFEEF0",iconColor:"#FF5959",label:"Đ\xe3 hủy",value:s,extra:t&&(0,l.jsxs)(a.Z,{sx:{ml:1.5},children:[(0,l.jsx)(_.Z,{fontSize:10,color:"#96A0B5",whiteSpace:"nowrap",children:"Cập nhật gần nhất"}),(0,l.jsx)(_.Z,{fontSize:11,fontWeight:600,whiteSpace:"nowrap",children:e1(t)})]})})]})},e4=(0,F.ZP)(p.Z)({"tr:hover":{backgroundColor:"rgb(174 174 174 / 8%)"}}),e6=new Set(["M\xe3 / Ng\xe0y đặt"]),e5=["M\xe3 / Ng\xe0y đặt","Lệnh","Số lượng","Gi\xe1 đặt","Gi\xe1 khớp","Tổng gi\xe1 trị","Loại lệnh","Trạng th\xe1i","Thao t\xe1c"],e3=()=>{let{user:e}=(0,M.a)(),n=(0,L.useQueryClient)(),[t,i]=(0,c.useState)(0),[r,s]=(0,c.useState)(eV),[o,a]=(0,c.useState)(null),{isLoading:d,data:x}=(0,L.useQuery)(["order-history",e],async()=>{let n=await (null==e?void 0:e.userFS.getIdToken())||"";return n?fetch("/api/stock-order/list?page=1&limit=".concat(500),{method:"GET",headers:(0,R.IZ)(n)}).then(e=>e.json()):Promise.resolve({})},{onSuccess:()=>a(new Date)}),p=(0,c.useMemo)(()=>(null==x?void 0:x.data)&&"string"!=typeof x.data?x.data.items:[],[x]),f=(0,c.useMemo)(()=>{let e=Date.now(),n=eO[r.dateRange],t=r.keyword.trim().toLowerCase();return p.filter(i=>{if(null!==n){let t=e-new Date(i.createdAt).getTime();if(t>864e5*n)return!1}if("ALL"!==r.status&&i.status!==r.status||"ALL"!==r.side&&i.orderBuySell!==r.side)return!1;if(t){let e=i.stockSymbol.toLowerCase().includes(t),n=i.id.toLowerCase().includes(t);if(!e&&!n)return!1}return!0})},[p,r]),Z=(0,c.useMemo)(()=>{let e=10*t;return f.slice(e,e+10)},[f,t]),m=e=>{s(n=>({...n,...e})),i(0)},b=()=>{s(eV),i(0)},v=r.keyword!==eV.keyword||r.dateRange!==eV.dateRange||r.status!==eV.status||r.side!==eV.side,S=()=>{n.invalidateQueries(["order-history"])};return d?(0,l.jsx)(B.g,{sx:{my:3}}):p.length?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(e2,{orders:p,lastUpdatedAt:o}),(0,l.jsx)(eU,{filters:r,onChangeFilters:m,onReset:b,isFilterActive:v,resultCount:f.length}),0===f.length?(0,l.jsx)(E.u,{msg:"Kh\xf4ng t\xecm thấy giao dịch ph\xf9 hợp với bộ lọc"}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(h.Z,{children:(0,l.jsxs)(u.Z,{sx:{backgroundColor:"#FFFFFF"},children:[(0,l.jsx)(j.Z,{children:(0,l.jsx)(g.Z,{children:e5.map(e=>(0,l.jsx)(W.bi,{sx:e6.has(e)?{textAlign:"left"}:void 0,children:(0,l.jsx)(W.Wx,{children:e})},e))})}),(0,l.jsx)(e4,{children:Z.map(e=>(0,l.jsx)(eL,{order:e,onCancelled:S}
1,e.id))})]})}),(0,l.jsx)(eB,{page:t,pageSize:10,total:f.length,onChangePage:i})]})]}):(0,l.jsx)(E.u,{msg:"Bạn chưa c\xf3 lịch sử đặt lệnh"})};var e7=t(89572);let e8=e=>{let{order:n}=e;return(0,l.jsxs)(q.Z,{mb:2,children:[(0,l.jsx)(_.Z,{fontWeight:700,fontSize:14,component:"div",children:"Chi tiết đặt lệnh"}),(0,l.jsxs)(a.Z,{divider:(0,l.jsx)(eo.Z,{orientation:"horizontal",flexItem:!0}),spacing:2,my:2,children:[(0,l.jsxs)(ni,{children:[(0,l.jsx)(ns,{children:"M\xe3 đặt lệnh"}),(0,l.jsx)(nl,{children:n.id})]}),(0,l.jsxs)(ni,{children:[(0,l.jsx)(ns,{children:"Loại"}),(0,l.jsxs)(nl,{color:(0,O.po)(eZ.Xp[n.orderBuySell]),children:[eZ.mr[(0,ev.FQ)(n.orderType)],"/",eZ.Xp[n.orderBuySell]]})]}),(0,l.jsxs)(ni,{children:[(0,l.jsx)(ns,{children:"Ng\xe0y giao dịch"}),(0,l.jsx)(nl,{children:new Date(n.createdAt).toLocaleString("vi-VN")})]}),(0,l.jsxs)(ni,{children:[(0,l.jsx)(ns,{children:"Khối lượng đặt"}),(0,l.jsx)(nl,{children:(0,O.uf)(n.quantity,I.YN)})]}),(0,l.jsxs)(ni,{children:[(0,l.jsx)(ns,{children:"Gi\xe1 dự kiến"}),(0,l.jsxs)(nl,{children:[(0,O.uf)(n.quotedPrice,I.YN)," đ"]})]})]}),(0,l.jsxs)(ni,{sx:{borderTop:"0.5px dashed #96A0B5",borderTopColor:"#96A0B5",py:2},children:[(0,l.jsx)(ns,{children:"Tổng tiền tạm t\xednh"}),(0,l.jsxs)(nl,{children:[(0,O.uf)(n.totalValue,I.YN)," đ"]})]})]})},e9=e=>{let{transactions:n}=e;return(0,l.jsxs)(q.Z,{children:[(0,l.jsx)(_.Z,{fontWeight:700,fontSize:14,children:"Chi tiết khớp lệnh"}),(0,l.jsx)(a.Z,{spacing:3,children:n.map(e=>(0,l.jsx)(ne,{transaction:e},e.id))})]})},ne=e=>{let{transaction:n}=e;return(0,l.jsxs)(q.Z,{children:[(0,l.jsxs)(a.Z,{divider:(0,l.jsx)(eo.Z,{orientation:"horizontal",flexItem:!0}),spacing:2,my:2,children:[(0,l.jsxs)(ni,{children:[(0,l.jsx)(ns,{children:"Ng\xe0y"}),(0,l.jsx)(nl,{children:new Date(n.createdAt).toLocaleDateString("vi-VN")})]}),(0,l.jsxs)(ni,{children:[(0,l.jsx)(ns,{children:"Gi\xe1 khớp"}),(0,l.jsxs)(nl,{children:[(0,O.uf)(n.executionPrice,I.YN)," đ"]})]}),(0,l.jsxs)(ni,{children:[(0,l.jsx)(ns,{children:"Khối lượng khớp"}),(0,l.jsx)(nl,{children:(0,O.uf)(n.quantity,I.YN)})]}),(0,l.jsxs)(ni,{children:[(0,l.jsx)(ns,{children:"Trạng th\xe1i"}),(0,l.jsx)(nl,{children:eZ.Bm[n.status]})]}),(0,l.jsxs)(ni,{children:[(0,l.jsx)(ns,{children:"Ph\xed giao dịch"}),(0,l.jsxs)(nl,{children:[(0,O.uf)(n.transactionFee,I.YN)," đ"]})]}),(0,l.jsxs)(ni,{children:[(0,l.jsx)(ns,{children:"Thuế"}),(0,l.jsxs)(nl,{children:[(0,O.uf)(n.taxFee,I.YN)," đ"]})]})]}),(0,l.jsxs)(ni,{sx:{borderTop:"0.5px dashed #96A0B5",borderTopColor:"#96A0B5",py:2},children:[(0,l.jsx)(ns,{children:"Tổng tiền"}),(0,l.jsxs)(nl,{children:[(0,O.uf)(n.totalValue,I.YN)," đ"]})]})]})},nn=(0,c.forwardRef)(function(e,n){return(0,l.jsx)(ee.Z,{direction:"up",ref:n,...e})}),nt=e=>{let{order:n,canOpen:t,onClose:i}=e,{user:r}=(0,M.a)(),{isLoading:s,data:o}=(0,L.useQuery)(["order-detail-dialog-".concat(n.id),n.id],async()=>{let e=await (null==r?void 0:r.userFS.getIdToken())||"";return e?fetch("/api/stock-order/".concat(n.id),{method:"GET",headers:(0,R.IZ)(e)}).then(e=>e.json()):Promise.resolve({})});return(0,l.jsxs)(en.Z,{fullScreen:!0,open:t,onClose:i,TransitionComponent:nn,children:[(0,l.jsx)(et.Z,{sx:{position:"relative"},children:(0,l.jsxs)(ei.Z,{children:[(0,l.jsx)(er.Z,{edge:"start",color:"inherit",onClick:i,"aria-label":"close",children:(0,l.jsx)(J.Z,{})}),(0,l.jsx)(a.Z,{flexGrow:1,direction:"row",justifyContent:"center",alignItems:"center",children:(0,l.jsx)(_.Z,{fontWeight:700,fontSize:16,children:"Chi tiết lệnh"})}),(0,l.jsx)(er.Z,{edge:"end",color:"inherit",onClick:i,"aria-label":"close",children:(0,l.jsx)($.Z,{})})]})}),(0,l.jsxs)(a.Z,{justifyContent:"center",alignItems:"center",spacing:1,my:3,children:[(0,l.jsx)(_.Z,{fontWeight:700,fontSize:24,color:"#21273B",children:n.stockSymbol}),(0,l.jsxs)(a.Z,{direction:"row",spacing:1,children:[(e=>{switch(e){case eZ.iF.Created:return(0,l.jsx)(l.Fragment,{});case eZ.iF.Pending:case eZ.iF.Processing:return(0,l.jsx)(eK.Z,{color:"warning"});case eZ.iF.Error:return(0,l.jsx)(e7.Z,{color:"error"});case eZ.iF.PartiallyFilled:case eZ.iF.Filled:return(0,l.jsx)(eq.Z,{color:"success"})}})(n.status),(0,l.jsx)(_.Z,{fontWeight:700,fontSize:14,color:(0,O.z9)(n.status),children:eZ.Bm[n.status]})]})]}),(0,l.jsxs)(es.Z,{children:[(0,l.jsx)(e8,{order:n}),!s&&o&&"string"!=typeof o.data&&o.data.transactions.length>0&&(0,l.jsx)(e9,{transactions:o.data.transactions})]})]})},ni=(0,F.ZP)(a.Z)({flexDirection:"row",justifyContent:"space-between",alignItems:"center"}),nr=(0,F.ZP)(a.Z)(e=>{let{theme:n}=e;return{borderRadius:"8px",boxShadow:"0px 4px 24px 6px rgba(0, 0, 0, 0.04);",backgroundColor:"#FFF",padding:n.spacing(2)}}),ns=(0,F.ZP)(_.Z)({fontWeight:400,fontSize:13}),no=(0,F.ZP)(_.Z)({fontWeight:600,fontSize:13}),nl=(0,F.ZP)(_.Z)({fontWeight:600,fontSize:14}),na=()=>{let{user:e}=(0,M.a)(),n=(0,L.useQueryClient)(),{ref:t,inView:i}=(0,K.YD)(),[r,s]=(0,c.useState)(!1),[o,d]=(0,c.useState)(null),x=e=>{d(e),s(!0)},h=()=>{n.invalidateQueries(["order-history-infinite"])},{isLoading:u,data:j,isFetchingNextPage:g,hasNextPage:p,fetchNextPage:f}=(0,L.useInfiniteQuery)(["order-history-infinite"],async n=>{let{pageParam:t=0}=n,i=await (null==e?void 0:e.userFS.getIdToken());return i?(await fetch("/api/stock-order/list?page=".concat(t,"&limit=").concat(I.Uc),{method:"GET",headers:(0,R.IZ)(i)})).json():Promise.resolve({})},{keepPreviousData:!0,getPreviousPageParam:e=>e&&Object.keys(e).length?e.data&&"string"!=typeof e.data&&e.data.page>0?e.data.page-1:void 0:1,getNextPageParam:e=>e&&Object.keys(e).length?e.data&&"string"!=typeof e.data&&e.data.items.length>=I.Uc?e.data.page+1:void 0:1});if((0,c.useEffect)(()=>{i&&!g&&p&&!u&&f()},[i,p,u,e]),u)return(0,l.jsx)(B.g,{sx:{my:3}});if(!j||!j.pages.length)return(0,l.jsx)(E.u,{msg:"Bạn chưa c\xf3 lịch sử đặt lện
1h"});let Z=j.pages.reduce((e,n)=>(n.data&&"string"!=typeof n.data&&e.push(...n.data.items),e),[]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.Z,{px:2,spacing:2,children:Z.map(e=>(0,l.jsxs)(nr,{spacing:.5,children:[(0,l.jsxs)(ni,{children:[(0,l.jsx)(_.Z,{fontWeight:700,fontSize:14,color:"#21273B",children:e.stockSymbol}),(0,l.jsxs)(a.Z,{direction:"row",justifyContent:"center",alignItems:"center",sx:{cursor:"pointer"},onClick:()=>x(e),children:[(0,l.jsx)(ns,{color:"#96A0B5",children:new Date(e.createdAt).toLocaleString("vi-VN")}),(0,l.jsx)(Q.Z,{fontSize:"small"})]})]}),(0,l.jsxs)(ni,{children:[(0,l.jsxs)(no,{color:(0,O.po)(eZ.Xp[e.orderBuySell]),children:[eZ.mr[(0,ev.FQ)(e.orderType)],"/",eZ.Xp[e.orderBuySell]]}),(0,l.jsx)(no,{color:(0,O.z9)(e.status),children:eZ.Bm[e.status]})]}),(0,l.jsxs)(ni,{children:[(0,l.jsx)(ns,{color:"#96A0B5",children:"KL đặt"}),(0,l.jsx)(ns,{children:(0,O.uf)(e.quantity,I.YN)})]}),(0,l.jsxs)(ni,{children:[(0,l.jsx)(ns,{color:"#96A0B5",children:"Gi\xe1 đặt"}),(0,l.jsx)(ns,{children:(0,O.uf)(e.quotedPrice,I.YN)})]}),(0,l.jsx)(a.Z,{direction:"row",justifyContent:"flex-end",children:(0,l.jsx)(ez,{order:e,onCancelled:h})})]},e.id))}),(0,l.jsx)(q.Z,{ref:t,children:(g||u)&&(0,l.jsx)(B.g,{sx:{my:3}})}),o&&(0,l.jsx)(nt,{order:o,canOpen:r,onClose:()=>s(!1)})]})},nc=()=>{let e=(0,x.Z)();return e?(0,l.jsx)(e3,{}):(0,l.jsx)(na,{})};var nd=t(67030),nx=t(69429),nh=t(64458),nu=t(92292);let nj=()=>{let e=(0,x.Z)(),[n,t]=(0,c.useState)(s.ORDER),{changeModalLoginRegister:i}=(0,nh.Pb)(),{user:r}=(0,M.a)();(0,c.useEffect)(()=>{i(nd.Od.LOGINREGISTER,!r)},[r]);let o=(e,n)=>{null!==n&&t(n)};return(0,l.jsxs)(nx.Z,{sx:{backgroundColor:"#F5F7FB",height:{xs:"calc(100vh - 56px)",sm:"calc(100vh - 65px)"}},children:[e?(0,l.jsxs)(a.Z,{spacing:3,sx:{pt:2,pb:3},children:[(0,l.jsx)(ey,{}),(0,l.jsx)(eT,{category:n,onChangeCategory:t})]}):(0,l.jsx)(d.n,{category:n,options:eF,onChangeCategoryOnDesktop:o,onChangeCategoryOnMobile:o}),n===s.ORDER&&(0,l.jsx)(nc,{}),n===s.DIVIDEND&&(0,l.jsx)(eg,{})]})};nj.getLayout=function(e){return(0,l.jsx)(nu.P,{children:e})};var ng=nj}},function(e){e.O(0,[9774,4885,6779,3601,9043,4564,6951,321,7918,277,1535,4932,4347,9089,6693,7316,5675,5191,8609,6720,4769,7358,2292,1816,2888,179],function(){return e(e.s=27870)}),_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.