(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6977],{40299:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/investment-portfolio",function(){return n(57873)}])},82832:function(e,t,n){"use strict";n.d(t,{z:function(){return Diff}});var l=n(26925),r=n(27593),o=n(14522),i=n(20973),s=n(20355);function Diff(e){let{children:t,currency:n,options:a,ratio:u,percentageOptions:c,...d}=e;return(0,l.BX)(r.H_,{color:o.O[Math.sign(t)],...d,children:[(0,s.T4)(t,n,{sign:!0,...a}),null==u?null:" (".concat((0,i.T3)(u,{sign:!1,...c}),")")]})}},37547:function(e,t,n){"use strict";n.d(t,{G$:function(){return l},NF:function(){return o},qN:function(){return r}});let l="​",r="∨",o="∧"},18667:function(e,t,n){"use strict";n.d(t,{Zt:function(){return EnumParam},mz:function(){return TypedJsonParam}});var l=n(49594);let EnumParam=(e,t)=>({encode:e=>e,decode:n=>e.includes(n)?n:t}),TypedJsonParam=e=>({encode:e=>{if(null!=e)return JSON.stringify(e)},decode:t=>{if("string"!=typeof t)return null;try{let n=JSON.parse(t);if(!l.B4.Check(e,n))return null;return n}catch(e){return null}}})},43443:function(e,t,n){"use strict";n.d(t,{Z:function(){return withHasAccount}});var l=n(26925),r=n(52334),o=n(47109),i=n(77969),s=n(39270),a=n(27593),u=n(19098),c=n(31598),d=n(7259),h=n(72225),m=n(68403),f=n(2663),p=n(37462),g=n(83663),v=n(52796);let withHasAccount=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,l.tZ)(a.nt,{children:(0,l.tZ)(a.nt.Spinner,{})}),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return a=>{let{open:y}=(0,u.I)({exitOnUnmount:!1}),{data:b,error:Z}=(0,v.Pc)(),x=(0,i.z)(),{replace:C,back:k}=(0,s.Q)();return((0,d.m)("open",e=>{let{query:t,setQuery:n}=e;"true"===t&&((0,g.l)({callback:()=>{C("/")}}),n(void 0))}),(0,r.useEffect)(()=>{let e;if(!(null==Z||!(0,o.Pg)(Z)||(0,f.z3)(Z)))return y(t=>(e=t.close,(0,l.tZ)(c.Y,{...t,title:Z.message,onConfirm:()=>{let e=m.Eh.getQueryData(v.Pc.getKey());null!=e&&e.hasAccount||(window.history.length>2?k():C("/"))}}))),()=>{null==e||e()}},[k,Z,y,C,x]),(0,r.useEffect)(()=>{null!=b&&b.isChecked&&(b.isMember||C((0,p.G)(x.asPath)))},[C,x,b]),null!=b&&b.isChecked&&b.isMember)?b.hasAccount?(0,l.tZ)(e,{...a}):null!=n?(0,l.tZ)(n,{}):void(0,h.Y0)("/account-open"):t}}},83663:function(e,t,n){"use strict";n.d(t,{l:function(){return useRequiredOpenAccount}});var l=n(52334),r=n(23474),o=n(52796),i=n(10689);function useRequiredOpenAccount(e){let{callback:t,triggerRef:n,modalOptions:s}=e,{refetch:a}=(0,o.Pc)(),{initOpenAccount:u}=(0,r.P)(),c=(0,l.useCallback)(()=>new Promise(async e=>{let{data:t}=await a();if(null==t?void 0:t.hasAccount){e(!0);return}let n=await u();if(n){e(!0);return}e(!1)}),[u,a]),d=(0,i.Y)({callback:c,triggerRef:n,modalOptions:s});return(0,l.useCallback)(async function(){for(var e=arguments.length,n=Array(e),l=0;l<e;l++)n[l]=arguments[l];let r=await d();return!!r&&"function"==typeof t&&t(...n)},[t,d])}},57873:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ez}});var l=n(26925),r=n(44043),o=n.n(r),i=n(36196),s=n(43443),a=n(52334),u=n(63984),c=n(91617),d=n(16224),h=n(47794),m=n(84760),f=n(99510),p=n(25293),g=n(52796);let useSuspendedHiddenStock=()=>{let{data:e}=(0,g.Pc)();return(0,f.u)({queryKey:useSuspendedHiddenStock.getKey(),queryFn:p.PC,enabled:e.hasAccount})};useSuspendedHiddenStock.getKey=()=>["/api/v2/hidden-stocks"];var v=n(92190),y=n(72176),b=n(18667);let Z=(0,a.createContext)({productTab:"all",setProductTab:()=>{throw Error("<PortfolioFilterProvider>를 감싸주세요.")}}),PortfolioTabProvider=e=>{let{children:t}=e,[n,r]=(0,y.useQueryParam)("product",(0,b.Zt)(["all","kr","us","option","bond"],"all"),{updateType:"replaceIn"}),o=(0,a.useMemo)(()=>({productTab:n,setProductTab:r}),[n,r]);return(0,l.tZ)(Z.Provider,{value:o,children:t})};var x=n(27593),C=n(7376);let HiddenStockTitle=()=>{let{productTab:e}=(0,a.useContext)(Z),t=k[e];return(0,l.tZ)(x.h4,{typography:"p",title:(0,l.BX)(x.h4.Title,{children:[t,(0,l.tZ)(C.r,{description:"".concat(t," 편집은 토스 앱에서 할 수 있어요.")})]})})},k={all:"숨긴 투자",option:"숨긴 옵션",bond:"숨긴 채권",kr:"숨긴 주식",us:"숨긴 주식"};var P=n(49299),T=n(99932),S=n(72539),w=n(54851),A=n(81063),R=n(56326);let L={가나다:"alphabet",주당평균금액:"purchasePrice",평가금:"evaluatedAmount",현재가:"currentPrice",일간수익금:"dailyProfitLossAmount",일간수익률:"dailyProfitLossRate",수익금:"profitLossAmount",수익률:"profitLossRate",수량:"tradableQuantity",원금:"purchaseAmount",수수료:"commission",세금:"tax"};var _=n(52237),N=n(84858),E=n(75146),B=n(75892);let O=[L.가나다,L.주당평균금액,L.평가금,L.현재가,L.일간수익금,L.일간수익률,L.수익금,L.수익률,L.수량,L.원금,L.수수료,L.세금],H={[B.f.가나다_순]:{sort:L.가나다,order:"asc"},[B.f.일간_수익률_낮은_순]:{sort:L.일간수익률,order:"asc"},[B.f.일간_수익률_높은_순]:{sort:L.일간수익률,order:"desc"},[B.f.총_수익률_낮은_순]:{sort:L.수익률,order:"asc"},[B.f.총_수익률_높은_순]:{sort:L.수익률,order:"desc"},[B.f.평가_금액_낮은_순]:{sort:L.평가금,order:"asc"},[B.f.평가_금액_높은_순]:{sort:L.평가금,order:"desc"},[B.f.직접_설정하기]:{sort:null,order:null}},useSortingRule=e=>{let[t]=(0,E.G)({namespace:_.F.SHARED,key:_.X.SHARED.LAST_SELECTED_SHARE_HOLDINGS_SORTING_RULE}),n=null!=t?t:B.f.가나다_순,l=H[n],r=e?H[B.f.직접_설정하기]:H[B.f.가나다_순],[o,i]=(0,y.useQueryParams)({order:(0,b.Zt)([null,"asc","desc"],null),sort:(0,b.Zt)([null,...O],null)},{updateType:"replaceIn"}),s=(0,N.D)(t,{defaultValue:t}),u=s!==t&&void 0!==s;(0,a.useEffect)(()=>{u&&i({order:null,sort:null})},[i,u]);let c=o.sort?o:null!=l?l:r;return{sortingRule:c,setSortingRule:i}},z=(0,a.createContext)({sortingRule:{sort:null,order:null},setSortingRule:()=>{throw Error("<PortfolioFilterProvider>를 감싸주세요.")},includeExpense:!1}),PortfolioFilterProvider=e=>{let{children:t,hasSorted:n,includeExpense:r}=e,{sortingRule:o,setSortingRule:i}=useSortingRule(n),s=(0,a.useMemo)(()=>({sortingRule:o,setSortingRule:i,includeExpense:r}),[o,i,r]);return(0,l.tZ)(z.Provider,{value:s,children:t})},W={[L.가나다]:{label:"종목명",minWidth:240},[L.수익률]:{label:"총 수익률",minWidth:120},[L.수익금]:{label:"총 수익금",minWidth:164},[L.주당평균금액]:{label:"평균금액",minWidth:148},[L.현재가]:{label:"현재가",minWidth:148},[L.수량]:{label:"보유 수량",minWidth:164},[L.평가금]:{label:"평가금",minWidth:164},[L.원금]:{label:"원금",minWidth:164},[L.일간수익률]:{label:"일간 수익률",minWidth:120},[L.일간수익금]:{label:"일간 수익금",minWidth:164},[L.수수료]:{label:"수수료",minWidth:100},[L.세금]:{label:"세금",minWidth:100}},I={kr:"국내주식",us:"해외주식",option:"옵션",bond:"채권"},X=(0,a.createContext)({currency:"krw",productType:"kr"});X.displayName="AssetPerformanceContext";let useAssetPerformanceContext=()=>(0,a.useContext)(X),D=(0,a.forwardRef)((e,t)=>{let{disabled:n=!1,style:r}=e,{includeExpense:o,sortingRule:i,setSortingRule:s}=(0,a.useContext)(z),{productType:u}=useAssetPerformanceContext(),handleSortingRule=e=>s(getNextSortingRule(i,e));return(0,l.tZ)(x.iA.Head,{ref:t,style:r,children:(0,l.tZ)(x.iA.Row,{children:(0,R.si)(W,(e,t)=>({key:e,value:t})).filter(e=>{let{key:t}=e;return!!o||t!==L.수수료&&t!==L.세금}).map(e=>{let{key:t,value:{label:r,minWidth:o}}=e;if(t===L.가나다)return(0,l.tZ)(x.iA.HCell,{inactive:n,align:"start",onClick:()=>n?A.Z:handleSortingRule(L.가나다),...theadCellProps(i,L.가나다,u),style:{minWidth:o},"data-tossinvest-log":"Table.HCell","data-parent-name":"AssetTableThead",children:"종목명"},t);let s=t===L.주당평균금액?"1".concat(M[u]," 평균금액"):r;return(0,l.tZ)(x.iA.HCell,{inactive:n,align:"end",style:{minWidth:o},onClick:()=>n?A.Z:handleSortingRule(t),...theadCellProps(i,t,u),"data-tossinvest-log":"Table.HCell","data-parent-name":"AssetTableThead",children:s},t)})})})}),M={kr:"주",us:"주",option:"주",bond:"개"},getNextSortingRule=(e,t)=>e.sort!==t?{sort:t,order:"desc"}:"desc"===e.order?{sort:t,order:"asc"}:"asc"===e.order?{sort:t,order:null}:{sort:t,order:"desc"},getNextSortDirection=e=>"sortable"===e?"내림차순으로":"asc"===e?"정렬해제":"desc"===e?"오름차순으로":void 0,theadCellProps=(e,t,n)=>{let l=(null==e?void 0:e.sort)!==t?"sortable":(null==e?void 0:e.order)==null?"sortable":e.order;return{variants:l,"data-log-params":JSON.stringify({nextSortDirection:getNextSortDirection(l)})}},U=(0,a.forwardRef)((e,t)=>{let{productTab:n}=(0,a.useContext)(Z),r=(0,a.useMemo)(()=>({productType:"all"===n?"kr":n,currency:"krw"}),[n]);return(0,l.tZ)(X.Provider,{value:r,children:(0,l.tZ)(D,{ref:t,disabled:!0,style:{position:"absolute"}})})});var j=n(75337),q=n(10533),K=n(50412),V=n(43114),Q=n.n(V),F=n(49784),$=n(88908),G=n(11483),Y=n(35440);n(72884);var J="_17u8jld1",ee="_17u8jld0",et="_17u8jld2";let en=(0,a.createContext)(null),useAssetRowContext=()=>{let e=(0,a.useContext)(en);if(null==e)throw Error("<AssetRowContext>를 감싸주세요.");return e};var el=n(17145);n(545);var er="_3alhlk0",eo=n(70817);let Cell=e=>{let{align:t="end",children:n,style:r}=e;return(0,l.tZ)(x.iA.Cell,{align:t,style:r,children:n})};function BondName(){let{maturityDateTime:e,guid:t,logoImageUrl:n,displayName:r}=useAssetRowContext(),o=(0,el.z)({maturityDateTime:e});return(0,l.tZ)(Cell,{align:"start",style:{minWidth:W.alphabet.minWidth},children:(0,l.tZ)(Q(),{ref:(0,j.Ck)({clickedStockCode:t}),href:eo.Z.bondDetail({guid:t}),"data-tossinvest-log":"Link","data-parent-name":"BondName",children:(0,l.BX)(G.k,{gap:8,alignItems:"center",children:[(0,l.tZ)(F.s,{code:t,url:n}),(0,l.BX)(G.k,{direction:"column",children:[(0,l.tZ)(x.H_,{color:q.j$.grey800,typography:"small",fontWeight:"semibold",className:(0,S.Z)((0,$.S)({lines:3}),er),children:r}),(0,l.tZ)(x.H_,{color:q.j$.grey600,typography:"xsmall",children:o})]})]})})})}var ei=n(20355);let Commission=()=>{let{commission:e}=useAssetRowContext(),{currency:t}=useAssetPerformanceContext(),{includeExpense:n}=(0,a.useContext)(z);return!1===n?null:(0,l.tZ)(Cell,{style:{minWidth:W.commission.minWidth},children:(0,ei.T4)(e,t)})},CurrentPrice=()=>{let{currentPrice:e}=useAssetRowContext(),{currency:t}=useAssetPerformanceContext();return(0,l.tZ)(Cell,{style:{minWidth:W.currentPrice.minWidth},children:(0,ei.T4)(e,t)})};var es=n(14522);let DailyProfitLossAmount=()=>{let{currency:e}=useAssetPerformanceContext(),{dailyProfitLossAmount:t}=useAssetRowContext();return(0,l.tZ)(Cell,{style:{minWidth:W.dailyProfitLossAmount.minWidth},children:(0,l.tZ)("span",{style:{color:es.O[Math.sign(null!=t?t:0)]},children:(0,ei.T4)(t,e)})})};var ea=n(20973);let DailyProfitLossRate=()=>{let{dailyProfitLossRate:e}=useAssetRowContext();return(0,l.tZ)(Cell,{style:{minWidth:W.dailyProfitLossRate.minWidth},children:(0,l.tZ)("span",{style:{color:es.O[Math.sign(null!=e?e:0)]},children:(0,ea.T3)(e)})})},EvaluatedAmount=()=>{let{evaluatedAmount:e}=useAssetRowContext(),{currency:t}=useAssetPerformanceContext();return(0,l.tZ)(Cell,{style:{minWidth:W.evaluatedAmount.minWidth},children:(0,ei.T4)(e,t)})},ProfitLossAmount=()=>{let{profitLossAmount:e}=useAssetRowContext(),{currency:t}=useAssetPerformanceContext();return(0,l.tZ)(Cell,{style:{minWidth:W.profitLossAmount.minWidth},children:(0,l.tZ)("span",{style:{color:es.O[Math.sign(null!=e?e:0)]},children:(0,ei.T4)(e,t)})})},ProfitLossRate=()=>{let{profitLossRate:e}=useAssetRowContext();return(0,l.tZ)(Cell,{style:{minWidth:W.profitLossRate.minWidth},children:(0,l.tZ)("span",{style:{color:es.O[Math.sign(null!=e?e:0)]},children:(0,ea.T3)(e)})})},PurchaseAmount=()=>{let{purchaseAmount:e}=useAssetRowContext(),{currency:t}=useAssetPerformanceContext();return(0,l.tZ)(Cell,{style:{minWidth:W.purchaseAmount.minWidth},children:(0,ei.T4)(e,t)})},PurchasePrice=()=>{let{purchasePrice:e}=useAssetRowContext(),{currency:t}=useAssetPerformanceContext();return(0,l.tZ)(Cell,{style:{minWidth:W.purchasePrice.minWidth},children:(0,ei.T4)(e,t)})},TradableQuantity=()=>{let{tradableQuantity:e}=useAssetRowContext(),{productType:t}=useAssetPerformanceContext();return(0,l.tZ)(Cell,{style:{minWidth:W.tradableQuantity.minWidth},children:null==e?"-":"".concat((0,K.rV)(e)," ").concat(eu[t])})},eu={kr:"주",us:"주",option:"계약",bond:"개"};var ec=n(86143);let StockName=()=>{let{stockCode:e,stockName:t,logoImageUrl:n,optionType:r,maturityDateTime:o,notice:i}=useAssetRowContext(),s=(0,ec.f)(o);return(0,l.tZ)(Cell,{align:"start",style:{minWidth:W.alphabet.minWidth},children:(0,l.tZ)(Q(),{ref:(0,j.Ck)({clickedStockCode:e}),href:(0,Y.ig)({stockCode:e}),"data-tossinvest-log":"Link","data-parent-name":"StockName",children:(0,l.BX)(G.k,{gap:8,alignItems:"center",children:[(0,l.tZ)(F.s,{code:e,url:n,notice:null==i?void 0:i.splitMerge,optionType:r}),(0,l.BX)(G.k,{direction:"column",children:[(0,l.tZ)(x.H_,{color:q.j$.grey800,typography:"small",fontWeight:"semibold",className:(0,S.Z)((0,$.S)({lines:3}),er),children:t}),null==o?null:(0,l.tZ)(x.H_,{color:q.j$.grey600,typography:"xsmall",children:s})]})]})})})},Tax=()=>{let{tax:e}=useAssetRowContext(),{currency:t}=useAssetPerformanceContext(),{includeExpense:n}=(0,a.useContext)(z);return!1===n?null:(0,l.tZ)(Cell,{style:{minWidth:W.tax.minWidth},children:(0,ei.T4)(e,t)})},ed=(0,a.forwardRef)((e,t)=>{let{row:n,virtualRow:r,scrollMargin:o,totalLength:i}=e,s=r.index;return(0,l.tZ)(en.Provider,{value:n,children:(0,l.BX)(x.iA.Row,{ref:t,"data-index":s,className:J,withSeparator:(s+1)%5==0||s===i,style:{transform:"translateY(".concat(r.start-o,"px)")},children:[null!=n.guid?(0,l.tZ)(BondName,{}):(0,l.tZ)(StockName,{}),(0,l.tZ)(ProfitLossRate,{}),(0,l.tZ)(ProfitLossAmount,{}),(0,l.tZ)(PurchasePrice,{}),(0,l.tZ)(CurrentPrice,{}),(0,l.tZ)(TradableQuantity,{}),(0,l.tZ)(EvaluatedAmount,{}),(0,l.tZ)(PurchaseAmount,{}),(0,l.tZ)(DailyProfitLossRate,{}),(0,l.tZ)(DailyProfitLossAmount,{}),(0,l.tZ)(Commission,{}),(0,l.tZ)(Tax,{})]})})}),eh=(0,a.memo)(ed),AssetTableBody=e=>{let{data:t,virtualizer:n,theadRef:r,theadHeight:o}=e;return(0,l.BX)(l.HY,{children:[(0,l.tZ)(D,{ref:r}),(0,l.tZ)(x.iA.Body,{style:{position:"absolute",top:o,width:"100%"},children:n.getVirtualItems().map(e=>{let r=t[e.index];return(0,l.tZ)(eh,{ref:e=>n.measureElement(e),row:r,virtualRow:e,scrollMargin:n.options.scrollMargin,totalLength:t.length-1},"guid"in r?r.guid:r.stockCode)})})]})};var em=n(73630);let useStickyHeader=e=>{let{data:t,thead:n,scrollContainer:l,theadHeight:r,table:o}=e;(0,a.useEffect)(()=>{if(null==l||null==o||null==n)return;let e=!1,handleScrollEvent=t=>{e||(requestAnimationFrame(()=>{t(),e=!1}),e=!0)},i=0,onWindowScroll=e=>{n.scrollLeft=l.scrollLeft;let s=window.scrollX,a=i!==s;if(i=s,1===t.length)return;let{top:u,height:c,width:d,left:h}=l.getBoundingClientRect(),m=-c+em.I+r+e;if(u<m)n.style.cssText="\n            position: absolute;\n            top: ".concat(c-r-e,"px;\n            left: '';\n            overflow-x: '';\n            max-width: '';\n            z-index: '';\n          ");else if(u<em.I){if(a){if(window.scrollX>0){let{top:e}=o.getBoundingClientRect();n.style.cssText="\n              position: absolute;\n              top: ".concat(e>=0?"".concat(em.I-Math.abs(e),"px"):"".concat(em.I+Math.abs(e),"px"),";\n              left: '';\n              overflow-x: '';\n              max-width: '';\n              z-index: 1;\n            ")}}else n.style.cssText="\n              position: fixed;\n              top: ".concat(em.I,"px;\n              overflow-x: hidden;\n              max-width: ").concat(d,"px;\n              z-index: 1;\n              left: ").concat(h,"px;\n            ")}else n.style.cssText="\n            position: absolute;\n            top: 0;\n            left: '';\n            overflow-x: '';\n            max-width: '';\n            z-index: '';\n          "},onTableXScroll=()=>{let{top:e}=l.getBoundingClientRect(),{top:t}=o.getBoundingClientRect();e<em.I?n.style.cssText="\n            position: absolute;\n            top: ".concat(t>=0?"".concat(em.I-Math.abs(t),"px"):"".concat(em.I+Math.abs(t),"px"),";\n            left: '';\n            max-width: '';\n            overflow-x: '';\n            z-index: 1;\n        "):n.style.cssText="\n            z-index: '';\n            top: 0;\n            left: '';\n          "},handleWindowScroll=()=>{var e,t;let n=null!==(t=null===(e=l.querySelector("tbody tr:last-of-type"))||void 0===e?void 0:e.getBoundingClientRect().height)&&void 0!==t?t:0;handleScrollEvent(()=>onWindowScroll(n))},handleTableXScroll=()=>{handleScrollEvent(onTableXScroll)};return window.addEventListener("scroll",handleWindowScroll),window.addEventListener("resize",handleWindowScroll),l.addEventListener("scroll",handleTableXScroll),()=>{window.removeEventListener("scroll",handleWindowScroll),window.removeEventListener("resize",handleWindowScroll),l.removeEventListener("scroll",handleTableXScroll)}},[t.length,l,o,n,r])};var ef=n(37240);let formatTableItem=e=>{let{asset:t,currency:n}=e;if(null==t)return[];let l=generateCurrencyValueGetter(n);return t.items.map(e=>{let{tradableQuantity:t}=e;return null==t?{unlisting:!1,...e,tax:null,commission:null,tradableQuantity:null,profitLossRate:null,profitLossAmount:null,currentPrice:null,evaluatedAmount:null,dailyProfitLossAmount:null,dailyProfitLossRate:null,basePrice:null,purchasePrice:null,purchaseAmount:null}:e.delisting?{unlisting:!1,...e,tax:l(e.tax),commission:l(e.commission),purchaseAmount:null,currentPrice:null,basePrice:null,profitLossRate:null,profitLossAmount:null,purchasePrice:null,evaluatedAmount:null,dailyProfitLossAmount:null,dailyProfitLossRate:null}:{unlisting:!1,...e,purchaseAmount:l(e.purchaseAmount),commission:l(e.commission),tax:l(e.tax),currentPrice:l(e.currentPrice),basePrice:l(e.basePrice),profitLossRate:l(e.profitLossRate),profitLossAmount:l(e.profitLossAmount),purchasePrice:l(e.purchasePrice),evaluatedAmount:l(e.evaluatedAmount),dailyProfitLossAmount:l(e.dailyProfitLossAmount),dailyProfitLossRate:l(e.dailyProfitLossRate)}})},sortNumber=(e,t,n)=>{let l=checkIsUntradable(e),r=checkIsUntradable(t);if(l&&r)return 0;if(l)return 1;if(r)return -1;let o=n(e),i=n(t);return sortNullNumber(o,i)},sortRate=(e,t,n,l)=>{let r=checkIsUntradable(e),o=checkIsUntradable(t);if(r&&o)return 0;if(r)return 1;if(o)return -1;let i=n(e),s=n(t);if(0===i&&0===s){let n=l(e),r=l(t);return sortNullNumber(n,r)}return sortNullNumber(i,s)},sortNullNumber=(e,t)=>null==e&&null==t?0:null==e?-1:null==t?1:e-t,assetToTableItem=e=>{let{asset:t,currency:n,sortingRule:l}=e,r=formatTableItem({asset:t,currency:n}),{sort:o,order:i}=l,s=null==o,a=o===L.가나다;return a?r.sort((e,t)=>{let n="displayName"in e?e.displayName:e.stockName,l="displayName"in t?t.displayName:t.stockName;return"asc"===i?(0,ef.lu)(n,l):(0,ef.lu)(l,n)}):null!=o&&[L.수익률,L.일간수익률].includes(o)?r.sort((e,t)=>{let getValue=e=>e[o],getAmount=e=>o===L.수익률?e.profitLossAmount:e.dailyProfitLossAmount;return"asc"===i?sortRate(e,t,getValue,getAmount):sortRate(t,e,getValue,getAmount)}):null!=o&&r.sort((e,t)=>{let getValue=e=>e[o];return"asc"===i?sortNumber(e,t,getValue):sortNumber(t,e,getValue)}),s||a||r.sort(거래불가능주식을_가장_뒤로보내기),r},거래불가능주식을_가장_뒤로보내기=(e,t)=>{let n=checkIsUntradable(e),l=checkIsUntradable(t);return n&&l?0:n?1:l?-1:0},generateCurrencyValueGetter=e=>t=>t?t[e]:null;function checkIsUntradable(e){return"unlisting"in e&&e.unlisting||e.delisting}let AssetTableComponent=e=>{var t,n;let{data:r,inView:o}=e,{productType:i}=(0,a.useContext)(X),[s,{height:u}]=(0,w.Z)(),c=(0,a.useRef)(null),d=(0,T.H)(c,s),h=(0,a.useRef)(null),m=(0,a.useRef)(null),f=(0,a.useRef)(null),p=(0,P.hO)({count:r.length,scrollMargin:null!==(n=null===(t=f.current)||void 0===t?void 0:t.offsetTop)&&void 0!==n?n:0,initialOffset:0,overscan:10,estimateSize:()=>"option"===i?63:48,measureElement:-1===navigator.userAgent.indexOf("Firefox")?e=>null==e?void 0:e.getBoundingClientRect().height:void 0});useStickyHeader({data:r,thead:c.current,scrollContainer:m.current,theadHeight:u,table:h.current});let g=0===u?43:u,v=p.getTotalSize()+g+2;return(0,l.tZ)("div",{ref:f,className:ee,children:(0,l.tZ)(x.xr,{ref:m,type:"hover",orientation:"horizontal",style:{position:"relative",height:v},children:(0,l.tZ)(x.iA,{ref:h,fixedColumn:!0,fixedHeader:!0,scrollContainer:m.current,size:"middle",className:et,children:o?(0,l.tZ)(AssetTableBody,{theadHeight:g,virtualizer:p,data:r,theadRef:d}):(0,l.tZ)("tbody",{})})})})},AssetTable=e=>{let{asset:t,inView:n}=e,{currency:r}=(0,a.useContext)(X),{sortingRule:o}=(0,a.useContext)(z),i=assetToTableItem({asset:t,currency:r,sortingRule:o});return(0,l.tZ)(AssetTableComponent,{data:i,inView:n})},HiddenStockRow=e=>{let{stock:t,virtualRow:n,totalLength:r}=e,{includeExpense:o}=(0,a.useContext)(z),i=n.index;return(0,l.tZ)(x.iA.Row,{withSeparator:(i+1)%5==0||i===r,className:J,style:{transform:"translateY(".concat(48*n.index,"px)")},children:(0,R.si)(W,(e,t)=>({key:e,value:t})).filter(e=>{let{key:t}=e;return!!o||t!==L.수수료&&t!==L.세금}).map(e=>{let{key:n,value:{minWidth:r}}=e;if(n===L.가나다){var o;return(0,l.tZ)(x.iA.Cell,{align:"start",style:{minWidth:r},children:(0,l.tZ)(Q(),{ref:(0,j.Ck)({clickedStockCode:t.stockCode}),href:(0,Y.ig)({stockCode:t.stockCode}),"data-tossinvest-log":"Link","data-parent-name":"HiddenStockRow",children:(0,l.BX)(G.k,{gap:8,alignItems:"center",children:[(0,l.tZ)(F.s,{code:t.stockCode,url:t.logoImageUrl}),(0,l.tZ)(x.H_,{color:q.j$.grey800,typography:"small",fontWeight:"semibold",className:(0,$.S)({lines:1}),children:null!==(o=t.stockName)&&void 0!==o?o:"-"})]})})},n)}return(0,l.tZ)(x.iA.Cell,{align:"end",style:{minWidth:r},children:n!==L.수량?"-":renderQuantity(t.tradableQuantity,t.type)},n)})})},renderQuantity=(e,t)=>(0,l.BX)(x.H_,{color:q.j$.grey600,fontWeight:"medium",typography:"small",children:[(0,K.rV)(e)," ",ep[t]]}),ep={KR_STOCK:"주",US_STOCK:"주",US_OPTION:"계약",US_BOND:"개"};n(86902);let HiddenStockTable=e=>{var t,n;let{data:r}=e,o=(0,a.useRef)(null),[i,{height:s}]=(0,w.Z)(),u=(0,a.useRef)(null),c=(0,T.H)(u,i),d=(0,a.useRef)(null),h=(0,P.hO)({count:r.length,scrollMargin:null!==(n=null===(t=o.current)||void 0===t?void 0:t.offsetTop)&&void 0!==n?n:0,initialOffset:0,overscan:20,estimateSize:()=>48,measureElement:-1===navigator.userAgent.indexOf("Firefox")?e=>null==e?void 0:e.getBoundingClientRect().height:void 0});useStickyHeader({data:r,thead:u.current,scrollContainer:o.current,theadHeight:s,table:d.current});let m=0===s?43:s,f=h.getTotalSize()+m+2;return(0,l.tZ)("div",{className:ee,children:(0,l.tZ)(x.xr,{ref:o,type:"hover",orientation:"horizontal",style:{position:"relative",height:f},children:(0,l.BX)(x.iA,{ref:d,fixedColumn:!0,fixedHeader:!0,size:"middle",scrollContainer:o.current,className:(0,S.Z)("enppbq2",et),children:[(0,l.tZ)(U,{ref:c}),(0,l.tZ)(x.iA.Body,{style:{position:"absolute",top:s},children:h.getVirtualItems().map(e=>{let t=r[e.index];return(0,l.tZ)(HiddenStockRow,{stock:t,virtualRow:e,totalLength:r.length-1},t.stockCode)})})]})})})};n(9403);var eg="_67r69u0";let AssetPortfolioSkeleton=()=>(0,l.BX)("section",{className:eg,children:[(0,l.tZ)(x.h4,{typography:"p",title:(0,l.tZ)(x.h4.Title,{children:(0,l.tZ)(x.Od.Text,{size:"medium",width:"250px"})})}),(0,l.tZ)(x.Od.Table,{})]}),ev=(0,v.o)(()=>{var e;let{data:t}=useSuspendedHiddenStock(),{productTab:n}=(0,a.useContext)(Z),r=(0,m.EQ)(n).with("kr",()=>"KR_STOCK").with("us",()=>"US_STOCK").with("option",()=>"US_OPTION").with("bond",()=>"US_BOND").with("all",()=>null).exhaustive(),o=null!==(e=null==t?void 0:t.hiddenStocks.filter(e=>null==r||e.type===r))&&void 0!==e?e:[],{targetRef:i}=(0,c.q)(k[n],{params:{count:o.length},threshold:0});return null==t||0===o.length?null:(0,l.BX)("section",{ref:i,children:[(0,l.tZ)(HiddenStockTitle,{}),(0,l.tZ)(HiddenStockTable,{data:o})]})},{pendingFallback:(0,l.tZ)(AssetPortfolioSkeleton,{})});var ey=n(43288),eb=n(52712),eZ=n(58647);n(84877);var ex=n(57151);let IncludeOverviewExpense=()=>{let{includeExpense:e,setIncludeExpense:t}=(0,ex.Q)();return(0,l.BX)("label",{htmlFor:"include-tax",className:"_1hs76t40",children:[(0,l.tZ)(eb.R,{style:{marginRight:4},shape:{width:16},backgroundColor:"transparent",content:(0,l.tZ)(eZ.J,{name:e?"icon-check-mono-fill":"icon-check-circle-line-mono",color:e?q.j$.blue500:q.j$.grey200})}),(0,l.tZ)("input",{ref:(0,j.Ck)({content:"수수료세금포함".concat(e?"해제":"설정")}),className:"_1hs76t41",type:"checkbox",id:"include-tax",name:"include-tax",checked:e,onChange:e=>{null==t||t(e.target.checked)},"data-tossinvest-log":"input","data-parent-name":"IncludeOverviewExpense"}),(0,l.tZ)(x.H_,{typography:"small",fontWeight:"medium",color:e?q.j$.blue600:q.j$.grey800,children:"수수료・세금 포함"})]})};n(19486);var eC="czqebq1",ek=n(82832);n(26522);var eP="_165dai61",eT="_165dai60";let eS=(0,a.memo)(e=>{let{title:t,amount:n,rate:r,currency:o}=e;return(0,l.tZ)("div",{className:eT,children:(0,l.BX)("div",{className:eP,children:[(0,l.tZ)(x.H_,{color:q.j$.grey800,fontWeight:"semibold",typography:"p",children:t}),(0,l.tZ)(ek.z,{className:ey.j,typography:"p",fontWeight:"medium",currency:o,ratio:r,..."원금"===t?{color:void 0,options:{sign:!1}}:{},children:null!=n?n:0})]})})}),ProfitLossSkeleton=()=>(0,l.tZ)("div",{className:eT,children:(0,l.BX)("div",{className:eP,children:[(0,l.tZ)(x.Od.Text,{size:"small",width:"30px"}),(0,l.tZ)(x.Od.Text,{size:"small",width:"120px"})]})}),PerformanceSkeleton=()=>(0,l.BX)("div",{children:[(0,l.tZ)(x.h4,{typography:"h5_number",upper:(0,l.tZ)(x.h4.UpperText,{children:(0,l.tZ)(x.Od.Text,{size:"small",width:"50px"})}),title:(0,l.tZ)(x.h4.Title,{children:(0,l.tZ)(x.Od.Text,{size:"large",width:"200px"})}),right:(0,l.tZ)(x.h4.Subtitle,{children:(0,l.tZ)(x.Od.Text,{size:"small",width:"120px"})})}),(0,l.BX)(G.k,{gap:32,className:eC,children:[(0,l.tZ)(ProfitLossSkeleton,{}),(0,l.tZ)(ProfitLossSkeleton,{}),(0,l.tZ)(ProfitLossSkeleton,{})]})]}),ew=(0,a.memo)(e=>{let{data:t}=e,{productTab:n}=(0,a.useContext)(Z),[r,o]=(0,d.az)();if(null==t)return(0,l.tZ)(PerformanceSkeleton,{});let i=[t.kr.items,t.us.items,t.option.items].some(e=>e.length>0),s=getHasOnlyUSDAsset(t,i),u=s?r:"krw";return(0,l.BX)("div",{children:[(0,l.tZ)(x.h4,{typography:"h5_text",upper:"내 투자",title:(0,l.tZ)(x.h4.Title,{className:ey.j,children:(0,ei.T4)(t.evaluatedAmount[u],u)}),right:(0,l.BX)(G.k,{gap:16,alignItems:"center",style:{marginLeft:"8px"},children:[(0,l.tZ)(x.Dq,{ref:(0,j.Ck)({content:"krw"===r?"통화변경 달러":"통화변경 원"}),currency:r,disabled:"kr"===n,onClick:o,"data-tossinvest-log":"CurrencyToggleButton"}),(0,l.tZ)(x.h4.Subtitle,{style:{margin:"auto 0"},children:(0,l.tZ)(IncludeOverviewExpense,{})})]})}),i?(0,l.BX)(G.k,{gap:32,className:eC,children:[(0,l.tZ)(eS,{title:"원금",amount:t.principalAmount[u],currency:u}),(0,l.tZ)(eS,{title:"총 수익",amount:t.profitLossAmount[u],rate:t.profitLossRate[u],currency:u}),(0,l.tZ)(eS,{title:"일간 수익",amount:t.dailyProfitLossAmount[u],rate:t.dailyProfitLossRate[u],currency:u})]}):null]})}),getHasOnlyUSDAsset=(e,t)=>t&&e.kr.items.every(e=>e.delisting);var eA=n(37547);n(8751);var eR="gx25um0";let getTabs=e=>[{type:"all",label:"전체",count:e&&[e.kr,e.us,e.option,e.bond].reduce((e,t)=>e+t.items.length,0)},{type:"kr",label:"국내주식",count:null==e?void 0:e.kr.items.length},{type:"us",label:"해외주식",count:null==e?void 0:e.us.items.length},{type:"option",label:"옵션",count:null==e?void 0:e.option.items.length},{type:"bond",label:"채권",count:null==e?void 0:e.bond.items.length}],PortfolioTab=e=>{let{data:t}=e,{productTab:n,setProductTab:r}=(0,a.useContext)(Z);if(null==t)return(0,l.tZ)(PortfolioTabSkeleton,{});let o=getTabs(t);return(0,l.tZ)(G.k,{gap:4,className:eR,children:(0,l.tZ)(x.OK,{variant:"round","aria-label":"내 주식 분류",size:"medium",value:n,onValueChange:e=>r(e),"data-tossinvest-log":"Tab","data-parent-name":"PortfolioTab",children:(0,l.tZ)(x.OK.List,{"data-list-name":"PortfolioTab",children:o.filter(e=>{var t;return(null!==(t=null==e?void 0:e.count)&&void 0!==t?t:0)>0}).map(e=>{let{type:t,label:n,count:r}=e;return(0,l.tZ)(x.OK.Item,{ref:(0,j.Ck)({count:r}),"aria-controls":"".concat(t,"-tab"),value:t,id:t,"data-tossinvest-log":"Tab.Item","data-parent-name":"PortfolioTab",children:"".concat(n).concat(renderNullNumber(r))},t)})})})})},renderNullNumber=e=>null==e?eA.G$:"\xb7".concat((0,ea.uf)(e),"개"),PortfolioTabSkeleton=()=>(0,l.BX)(G.k,{gap:8,className:eR,children:[(0,l.tZ)(x.Od.Text,{size:"medium",width:"100px"}),(0,l.tZ)(x.Od.Text,{size:"medium",width:"100px"})]});var eL=n(79152),e_=n(16883),eN=n(42094);let eE=(0,a.memo)(e=>{let{asset:t}=e,{currency:n,productType:r}=useAssetPerformanceContext(),[o]=(0,E.G)({namespace:_.F.SHARED,key:_.X.SHARED.LAST_SELECTED_SHARE_HOLDINGS_SORTING_RULE,defaultValue:B.f.가나다_순}),i=o===B.f.일간_수익률_낮은_순||o===B.f.일간_수익률_높은_순,s=I[r],{evaluatedAmount:a,principalAmount:u}=t,c=i?t.dailyProfitLossAmount[n]:t.profitLossAmount[n],d=i?t.dailyProfitLossRate[n]:t.profitLossRate[n];return(0,l.tZ)("header",{children:(0,l.tZ)(x.h4,{typography:"p",title:(0,l.BX)(x.h4.Title,{className:ey.j,children:[s," \xb7 ",(0,ei.T4)(a[n],n)]}),right:0===u[n]?void 0:(0,l.tZ)(x.h4.Subtitle,{children:(0,l.BX)(x.H_,{color:es.O[Math.sign(null!=c?c:0)],typography:"small",className:ey.j,children:[i?"오늘 ":"",(0,ei.T4)(c,n,{currencySign:!0,sign:!0})," ",(0,l.BX)("span",{children:["(",(0,ea.T3)(null!=d?d:0,{sign:!1}),")"]})]})})})})}),eB=(0,a.memo)(e=>{let{asset:t,productType:n}=e,{targetRef:r}=(0,c.q)(I[n],{params:{count:t.items.length},threshold:0}),{ref:o,inView:i}=(0,eN.YD)({rootMargin:"40px 0px"}),[s]=(0,d.az)(),u=(0,a.useMemo)(()=>({currency:"kr"===n?"krw":s,productType:n}),[n,s]);return 0===t.items.length?null:(0,l.tZ)("section",{ref:e=>{o(e),r(e)},className:eg,children:(0,l.BX)(X.Provider,{value:u,children:[(0,l.tZ)(eE,{asset:t}),(0,l.tZ)(AssetTable,{asset:t,inView:i})]})})}),ShareHoldings=e=>{let{data:t}=e,{productTab:n}=(0,a.useContext)(Z),r=(0,e_.f)();return null==t?(0,l.tZ)(AssetPortfolioSkeleton,{}):(0,l.tZ)(eL.H,{value:null!=n?n:"all",caseBy:{all:(0,l.tZ)("div",{id:"".concat(n,"-tab"),"aria-describedby":n,role:"tabpanel",children:(0,l.tZ)(eL.H,{value:String(r),caseBy:{true:(0,l.BX)(l.HY,{children:[(0,l.tZ)(eB,{productType:"option",asset:t.option}),(0,l.tZ)(eB,{productType:"us",asset:t.us}),(0,l.tZ)(eB,{productType:"kr",asset:t.kr}),(0,l.tZ)(eB,{productType:"bond",asset:t.bond})]}),false:(0,l.BX)(l.HY,{children:[(0,l.tZ)(eB,{productType:"kr",asset:t.kr}),(0,l.tZ)(eB,{productType:"option",asset:t.option}),(0,l.tZ)(eB,{productType:"us",asset:t.us}),(0,l.tZ)(eB,{productType:"bond",asset:t.bond})]})}})}),kr:(0,l.tZ)("div",{id:"".concat(n,"-tab"),"aria-describedby":n,role:"tabpanel",children:(0,l.tZ)(eB,{productType:"kr",asset:t.kr})}),us:(0,l.tZ)("div",{id:"".concat(n,"-tab"),"aria-describedby":n,role:"tabpanel",children:(0,l.tZ)(eB,{productType:"us",asset:t.us})}),option:(0,l.tZ)("div",{id:"".concat(n,"-tab"),"aria-describedby":n,role:"tabpanel",children:(0,l.tZ)(eB,{productType:"option",asset:t.option})}),bond:(0,l.tZ)("div",{id:"".concat(n,"-tab"),"aria-describedby":n,role:"tabpanel",children:(0,l.tZ)(eB,{productType:"bond",asset:t.bond})})}})};var eO=n(84492);let InvestmentPortfolioSection=e=>{let{data:t}=e,{productTab:n}=(0,a.useContext)(Z),r=getTabs(t),o=r.find(e=>e.type===n),{targetRef:i}=(0,c.q)(o.label,{params:{count:o.count},dependencies:[n],threshold:0});return(0,l.BX)("section",{ref:i,children:[(0,l.tZ)(ew,{data:t}),(0,l.tZ)(h.K,{size:24}),(0,l.tZ)(PortfolioTab,{data:t}),(0,l.tZ)(h.K,{size:4}),(0,l.tZ)(ShareHoldings,{data:t}),(0,l.tZ)(ev,{})]})},InvestmentPortfolio=()=>{var e;let{includeExpense:t}=(0,ex.Q)(),n=(0,u.B)(),r=null===(e=n.data)||void 0===e?void 0:e.data,o=(0,a.useMemo)(()=>r&&(t?(0,eO.qb)(r):r),[r,t]),i=[null==r?void 0:r.kr.sorted,null==r?void 0:r.us.sorted,null==r?void 0:r.option.sorted].some(Boolean);return(0,l.tZ)(PortfolioFilterProvider,{hasSorted:i,includeExpense:t,children:(0,l.tZ)(d.hU,{children:(0,l.tZ)(PortfolioTabProvider,{children:(0,l.tZ)("section",{"data-section-name":"내투자",children:null==o?(0,l.tZ)(InvestmentPortfolioSkeleton,{}):(0,l.tZ)(InvestmentPortfolioSection,{data:o})})})})})},InvestmentPortfolioSkeleton=()=>(0,l.BX)(l.HY,{children:[(0,l.tZ)(PerformanceSkeleton,{}),(0,l.tZ)(h.K,{size:24}),(0,l.tZ)(PortfolioTabSkeleton,{}),(0,l.tZ)(h.K,{size:4}),(0,l.tZ)(AssetPortfolioSkeleton,{}),(0,l.tZ)(AssetPortfolioSkeleton,{})]});n(29039);let InvestmentPortfolioLayout=e=>{let{children:t}=e;return(0,l.tZ)("main",{className:"_1tgmam40",children:t})},eH=(0,s.Z)(()=>(0,l.BX)(l.HY,{children:[(0,l.tZ)(o(),{children:(0,l.tZ)("title",{children:"토스증권 | 내 투자"})}),(0,l.tZ)(InvestmentPortfolioLayout,{children:(0,l.tZ)(InvestmentPortfolio,{})})]}),(0,l.tZ)(InvestmentPortfolioLayout,{children:(0,l.tZ)(InvestmentPortfolioSkeleton,{})}));var ez=eH;eH.getLayout=e=>(0,l.tZ)(i.B,{footer:(0,l.tZ)(i.B.Footer,{}),sidebar:(0,l.tZ)(i.B.LNB,{}),children:e})},545:function(){},86902:function(){},84877:function(){},19486:function(){},26522:function(){},8751:function(){},72884:function(){},9403:function(){},29039:function(){},54851:function(e,t,n){"use strict";n.d(t,{Z:function(){return useMeasure}});var l=n(52334),r=n(79232),o=n.n(r);function useMeasure(e){var t;let{debounce:n,scroll:r,polyfill:i,offsetSize:s}=void 0===e?{debounce:0,scroll:!1,offsetSize:!1}:e,a=i||("undefined"==typeof window?class{}:window.ResizeObserver);if(!a)throw Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[u,c]=(0,l.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),d=(0,l.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:u}),h=n?"number"==typeof n?n:n.scroll:null,m=n?"number"==typeof n?n:n.resize:null,f=(0,l.useRef)(!1);(0,l.useEffect)(()=>(f.current=!0,()=>void(f.current=!1)));let[p,g,v]=(0,l.useMemo)(()=>{let callback=()=>{if(!d.current.element)return;let{left:e,top:t,width:n,height:l,bottom:r,right:o,x:i,y:a}=d.current.element.getBoundingClientRect(),u={left:e,top:t,width:n,height:l,bottom:r,right:o,x:i,y:a};d.current.element instanceof HTMLElement&&s&&(u.height=d.current.element.offsetHeight,u.width=d.current.element.offsetWidth),Object.freeze(u),f.current&&!areBoundsEqual(d.current.lastBounds,u)&&c(d.current.lastBounds=u)};return[callback,m?o()(callback,m):callback,h?o()(callback,h):callback]},[c,s,h,m]);function removeListeners(){d.current.scrollContainers&&(d.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",v,!0)),d.current.scrollContainers=null),d.current.resizeObserver&&(d.current.resizeObserver.disconnect(),d.current.resizeObserver=null)}function addListeners(){d.current.element&&(d.current.resizeObserver=new a(v),d.current.resizeObserver.observe(d.current.element),r&&d.current.scrollContainers&&d.current.scrollContainers.forEach(e=>e.addEventListener("scroll",v,{capture:!0,passive:!0})))}return t=!!r,(0,l.useEffect)(()=>{if(t)return window.addEventListener("scroll",v,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",v,!0)},[v,t]),(0,l.useEffect)(()=>(window.addEventListener("resize",g),()=>void window.removeEventListener("resize",g)),[g]),(0,l.useEffect)(()=>{removeListeners(),addListeners()},[r,v,g]),(0,l.useEffect)(()=>removeListeners,[]),[e=>{e&&e!==d.current.element&&(removeListeners(),d.current.element=e,d.current.scrollContainers=function findScrollContainers(e){let t=[];if(!e||e===document.body)return t;let{overflow:n,overflowX:l,overflowY:r}=window.getComputedStyle(e);return[n,l,r].some(e=>"auto"===e||"scroll"===e)&&t.push(e),[...t,...findScrollContainers(e.parentElement)]}(e),addListeners())},u,p]}let i=["x","y","top","bottom","left","right","width","height"],areBoundsEqual=(e,t)=>i.every(n=>e[n]===t[n])},79232:function(e){function debounce(e,t,n){function later(){var a=Date.now()-i;a<t&&a>=0?l=setTimeout(later,t-a):(l=null,n||(s=e.apply(o,r),o=r=null))}null==t&&(t=100);var l,r,o,i,s,debounced=function(){o=this,r=arguments,i=Date.now();var a=n&&!l;return l||(l=setTimeout(later,t)),a&&(s=e.apply(o,r),o=r=null),s};return debounced.clear=function(){l&&(clearTimeout(l),l=null)},debounced.flush=function(){l&&(s=e.apply(o,r),o=r=null,clearTimeout(l),l=null)},debounced}debounce.debounce=debounce,e.exports=debounce}},function(e){e.O(0,[112,2153,1578,9241,6493,2370,9875,6196,9774,2888,179],function(){return e(e.s=40299)}),_N_E=e.O()}]);