PageSourceSearch

https://portfoliopilot.com/_next/static/chunks/5477-2f37f62afa04803a.js

js portfoliopilot.com collected 2026-09-25 20:22:46 UTC 928,864 bytes, 6 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._posthogReleaseId=e._posthogReleaseId||"01a0d8b1-02de-0000-9296-5e651620578e";var n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="32bb7347-21c9-5412-a286-ba4a8a0ab1f3")}catch(e){}}();"use strict";
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="32bb7347-21c9-5412-a286-ba4a8a0ab1f3")}catch(e){}}();
3(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5477],{350:(e,t,n)=>{n.d(t,{D:()=>i});var a=n(62346),r=n(33624),o=n(50202);let i=()=>{let{currentPortfolios:e=[],portfoliosList:t}=(0,o.RW)(),{data:n=[],isLoading:i}=(0,a.aV)(),l=r.kuo(r.gD_,r.TjK(e=>e.portfolioSummary,r.Bqz(r.TjK(e=>e.subAccounts,n)))),s=r.MoL((e,t)=>e.portfolioId===t.portfolioId,e,l),c=r.$zQ(e=>e.bankId||e.portfolioId.toString(),e),d=r.$zQ(r._w2("bankId"),n);for(let e of n)c[e.bankId]||(c[e.bankId]=[]);let u=r.TSs((e,t)=>{if(t.bankId){let n=d[t.bankId]||[],a=r.d5f(n);if(a)return{...e,[t.portfolioId]:a}}return e},{},e),m=r.sbv(n.map(e=>e.bankId)),p=r.sbv(e.map(e=>e.bankId||e.portfolioId.toString()).filter(e=>!m.includes(e))),y=[...m,...p].filter(e=>e in c).map(e=>[e,c[e]]),h=r.Bqz(r.TjK(e=>{let[,t]=e;return t},y)),f=r.EyX("portfolioId",t);return{isLoading:i,currentDetailedPortfolios:e,aggregatedCurrentPortfolios:c,bankIdMappedAccounts:d,portfolioIdMappedAccounts:u,connectedAccountPrioritizedPortfoliosGroup:y,flattenedPrioritizedPortfolios:r.pbD(e=>r.mKk(e.portfolioId,f),h),connectedCurrentPortfolios:l,notConnectedCurrentPortfolios:s,connectedInvestmentAccounts:n,showablePortfoliosList:t,showablePortfolioIds:f}}},488:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(57090),r=n(12115),o=n(33624),i=n(31272),l=n(35208);let s=e=>{if(o.gD_(e.currentPrice)&&e.showNAIfPriceNull)return(0,a.Y)(r.Fragment,{children:l.UZ});let t=e.showAbsoluteValue?Math.abs(e.quantity):e.quantity;return(0,a.Y)(r.Fragment,{children:(0,i.ck)(t)})}},904:(e,t,n)=>{n.d(t,{X:()=>a});var a=function(e){return e.add="Add",e.increment="Increment",e.reduce="Reduce",e}({})},985:(e,t,n)=>{n.d(t,{Ib:()=>c,Q7:()=>d,XT:()=>l,lp:()=>u,sq:()=>s});var a=n(57090),r=n(74547),o=n(89568),i=n(92672);n(12115);let l=r.XI,s=e=>(0,a.Y)(o.ID,{...e,"data-sentry-element":"InfoTooltip","data-sentry-component":"StyledPriceTooltip","data-sentry-source-file":"atoms.tsx"}),c=e=>(0,a.Y)(i.Ah,{...e,className:"flex-col min-w-[120px] gap-y-0.5",flexDirection:"column",alignItems:"flex-start",alignContent:"flex-start",justifyContent:"space-between","data-sentry-element":"FlexLayout","data-sentry-component":"SharesAmountTableColumnContainer","data-sentry-source-file":"atoms.tsx"}),d=e=>{let{children:t}=e;return(0,a.Y)("div",{className:"rounded-lg p-4 bg-neutral-50","data-sentry-component":"SecurityRowContainer","data-sentry-source-file":"atoms.tsx",children:t})},u=e=>(0,a.FD)(i.Ah,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",itemsSpacingHorizontal:12,"data-sentry-element":"FlexLayout","data-sentry-component":"SharesAmountCardFieldRow","data-sentry-source-file":"atoms.tsx",children:[(0,a.Y)("div",{className:"text-neutral-500 text-sm shrink-0",children:e.label}),(0,a.Y)("div",{className:"text-right",children:e.children})]})},1482:(e,t,n)=>{n.d(t,{A:()=>d,U:()=>c});var a=n(57090),r=n(12115),o=n(43948),i=n(17363);let{useDraftPortfolioPropertiesLaunchListener:l,emitDraftPortfolioPropertiesLaunch:s}=(0,o.createEvent)("DraftPortfolioPropertiesLaunch")(),c=()=>({launchDraftPortfolioProperties:e=>s({portfolio:e})}),d=()=>{let[e,t]=r.useState(null);return(l(e=>t(e.portfolio)),e)?(0,a.Y)(i.A,{portfolioDetails:{id:e.portfolioId,name:e.portfolioName,description:e.description,referencePortfolioId:e.referencePortfolioId},onClose:()=>t(null),"data-sentry-element":"DraftPortfolioFormDrawer","data-sentry-component":"GlobalDraftPortfolioPropertiesLauncher","data-sentry-source-file":"GlobalDraftPortfolioPropertiesLauncher.tsx"}):null}},2135:(e,t,n)=>{n.d(t,{A:()=>s,q:()=>o});var a=n(12115),r=n(92726),o=function(e){return e.HLRCollapseState="HLRCollapseState",e.ChunkReloadTimestamp="ChunkReloadTimestamp",e.RecsPreferencesReviewBannerDismissed="RecsPreferencesReviewBannerDismissed",e}({}),i=function(e){return e.SessionStorage="session-storage",e}(i||{});function l(e){try{let t=window.sessionStorage.getItem(e);return null===t?null:{value:JSON.parse(t)}}catch(e){return null}}let s=function(e){let{key:t,initialValue:n}=e,o=String(t),[i,s]=a.useState(()=>l(o)),c=i?i.value:n,d=a.useRef(c);a.useEffect(()=>{d.current=c},[c]),a.useEffect(()=>{let e=l(o);s(t=>Object.is(null==t?void 0:t.value,null==e?void 0:e.value)?t:e)},[o]);let u=a.useCallback(()=>{s(l(o))}
3,[o]);return(0,r.A)("storage",u),(0,r.A)("session-storage",u),[c,e=>{let t=e instanceof Function?e(d.current):e;d.current=t,s({value:t});try{window.sessionStorage.setItem(o,JSON.stringify(t)),window.dispatchEvent(new Event("session-storage"))}catch(e){}}]}},2275:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(57090);n(12115);var r=n(74547),o=n(4140),i=n(92672),l=n(36934),s=n(41784);let c=e=>{let{children:t}=e;return(0,a.Y)("div",{className:"flex flex-col gap-1 xs:items-center sm:items-start","data-sentry-component":"LoaderTextContainer","data-sentry-source-file":"AIImporterParserLoadingIndicator.tsx",children:t})},d=()=>(0,a.FD)(i.Ah,{flexDirection:"column",itemsSpacingVertical:16,textAlign:"center","data-sentry-element":"FlexLayout","data-sentry-component":"AIImporterParserLoadingIndicator","data-sentry-source-file":"AIImporterParserLoadingIndicator.tsx",children:[(0,a.Y)(r.y$,{size:"lg",text:(0,a.FD)(c,{children:["AI-powered financial wizardry...",(0,a.Y)(o.h,{children:"This usually takes 1 minute"})]}),"data-sentry-element":"Spinner","data-sentry-source-file":"AIImporterParserLoadingIndicator.tsx"}),(0,a.Y)(l.cO,{className:(0,s.cn)("text-neutral-500"),"data-sentry-element":"CaptionW400","data-sentry-source-file":"AIImporterParserLoadingIndicator.tsx",children:"Note: no real magic involved"})]})},2767:(e,t,n)=>{n.d(t,{Xr:()=>c,gM:()=>f,jh:()=>y,nk:()=>v,pZ:()=>h,ph:()=>d,qc:()=>p,r7:()=>g});var a=n(32189),r=n(33624),o=n(39715),i=n(16528),l=n(56683),s=n(22707);let c=e=>r.z7s(r.is(Number),e=>(0,o.GW)(e,{fractionDigits:2}))(e),d=e=>r.z7s(i.A,e=>(0,o.qU)(e)/100)(e),u=async(e,t)=>{if(r.gD_(e)||r.Ime(e))return t?Promise.reject(Error()):Promise.resolve();let n="string"==typeof e?parseFloat(e):e;return n<0?Promise.reject(Error("Advisor fee cannot be below 0%")):n>3?Promise.reject(Error("Advisor fee cannot exceed ".concat(3,"%"))):Promise.resolve()},m=async e=>0===e?Promise.reject("Are you sure it's 0%?"):Promise.resolve(),p=e=>[{required:e,message:"Advisor fee is required"},{validator:(e,t)=>m(t),warningOnly:!0},{validator:(t,n)=>u(n,e)}],y=(e,t)=>e?l.d.ExternallyManaged:t?l.d.InvestedFund:l.d.SelfDirected,h=e=>{let t={};return Object.entries(e).map(e=>{let[n,a]=e;if(r.mKk(s.Wb,n)){let e=r.lDo(s.Wb,n),o=e[0],i=e[1];if(t[o]={...t[o],[i]:i===s.hT?d(a):a,subAccountId:o},i===s.Pw){let e=a===l.d.ExternallyManaged,n=a===l.d.InvestedFund;t[o]={...t[o],isExternallyManaged:e,isInvestedFund:n}}}}),r.zug(t)},f=(e,t)=>e&&t.isActive&&null!=t.portfolioSummary&&null==t.portfolioSummary.replacementPortfolioId,g=(e,t)=>"".concat(e).concat(s.Wb).concat(t),v=e=>{let{id:t,nickName:n,subAccounts:o}=e,i=1===r.Bw9(o),l=r.d5f(o),d={id:t,nickName:n};return i&&(d[s.bi]=null==l?void 0:l.nickName),r.jJl(e=>{var t,n,r,o,i,l,u;d[g(e.id,s.bi)]=e.nickName,d[g(e.id,s.cL)]=(null==(t=e.portfolioSummary)?void 0:t.taxTreatment)||a.MG.Taxable,d[g(e.id,s.ZH)]=(null==(n=e.portfolioSummary)?void 0:n.isExternallyManaged)||!1,d[g(e.id,s.$q)]=(null==(r=e.portfolioSummary)?void 0:r.isInvestedFund)||!1,d[g(e.id,s.Pw)]=y((null==(o=e.portfolioSummary)?void 0:o.isExternallyManaged)||!1,(null==(i=e.portfolioSummary)?void 0:i.isInvestedFund)||!1),d[g(e.id,s.hT)]=c((null==(l=e.portfolioSummary)?void 0:l.advisorFee)||null),d[g(e.id,s.mB)]=(null==(u=e.portfolioSummary)?void 0:u.trackingTicker)||null,d[g(e.id,s.tf)]=void 0===e.isActive||e.isActive},o),d}},2786:(e,t,n)=>{n.d(t,{Lw:()=>s,Pc:()=>d,TQ:()=>i,Vu:()=>o,v$:()=>c});var a=n(43948),r=n(92721);let{useGettingStartedStepActionListener:o,emitGettingStartedStepAction:i}=(0,a.createEvent)("GettingStartedStepAction")();var l=function(e){return e.CtaClicked="getting_started_cta_clicked",e.AlreadyDoneClicked="getting_started_already_done_clicked",e.StepCompleted="getting_started_step_completed",e}(l||{});let s=(e,t)=>{(0,r.Dt)("getting_started_cta_clicked",{step_id:e,completes_step_on_click:t})},c=e=>{(0,r.Dt)("getting_started_already_done_clicked",{step_id:e})},d=e=>{(0,r.Dt)("getting_started_step_completed",{step_id:e})}},2807:(e,t,n)=>{n.d(t,{A:()=>Q});var a=n(57090),r=n(12115),o=n(33624),i=n(39504),l=n(65438),s=n(74547),c=n(54519),d=n(88963),u=n(62031),m=n.n(u),p=function(e){return e.Security="security",e.Help="help",e.FAQ="faq",e}({});class y{constructor(){this.performSearch=async e=>{let t=await this.apiCaller.get("/search",{q:e});return m()(t)},this.searchSecurities=async e=>{let t=await this.apiCaller.get("/search/securities",{q:e});return m()(t)},this.searchHelp=async e=>{let t=await this.apiCaller.get("/search/help",{q:e});return m()(t)},this.apiCaller=new d.Ay}}let h=new y;var f=n(73285),g=n(92332),v=n(17667),x=n(99026),A=n(67759),S=n(4603),b=n(36934),C=n(41784);let I=e=>{let{children:t,className:n,onPointerDown:r,onTouchStart:o}=e;return(0,a.Y)("div",{className:"flex flex-col min-w-full bg-white z-10 overflow-hidden h-full max-h-[70vh] ".concat(n||""),onPointerDown:r,onTouchStart:o,"data-sentry-component":"SearchResultsContainer","data-sentry-source-file":"atoms.tsx",children:t})},w=e=>{let{children:t,className:n}=e;return(0,a.Y)("div",{className:"flex-1 overflow-y-auto py-2 ".concat(n||""),"data-sentry-component":"SearchResultsScrollableContent","data-sentry-source-file":"atoms.tsx",children:t})},P=e=>{let{children:t,className:n}=e;return(0,a.Y)("div",{className:"shrink-0 border-t border-divider bg-white ".concat(n||""),"data-sentry-component":"PinnedActionContainer","data-sentry-source-file":"atoms.tsx",children:t})},k=e=>{let{children:t,className:n,onClick:r}=e;return(0,a.Y)("div",{className:"px-4 py-3 cursor-pointer flex items-center gap-3 hover:bg-neutral-300 flex-nowrap ".concat(n||""),onClick:r,"data-sentry-component":"SearchResultItem","data-sentry-source-file":"atoms.tsx",children:t})},F=e=>(0,a.Y)(b.bU,{...e,className:(0,C.cn)("text-body",e.className),"data-sentry-element":"Body1W400","data-sentry-component":"SearchResultText","data-sentry-source-file":"atoms.tsx"}),T=e=>(0,a.Y)(b.km,{...e,className:(0,C.cn)("text-subtle","flex-1 text-right",e.className),"data-sentry-element":"Body2W400","data-sentry-component":"SearchResultTextSecondary","data-sentry-source-file":"atoms.tsx"}),E=e=>(0,a.Y)(b.se,{...e,className:(0,C.cn)("px-4 pt-2 pb-1 text-neutral-400 uppercase text-xs",e.className),"data-sentry-element":"H6W600","data-sentry-component":"GroupHeader","data-sentry-source-file":"atoms.tsx"}),Y=e=>(0,a.Y)(b.bU,{...e,className:(0,C.cn)("text-body","!text-primary-700 flex-1",e.className),"data-sentry-element":"Body1W400","data-sentry-component":"SearchResultTextPrimary","data-sentry-source-file":"atoms.tsx"});var D=n(81671);let R=e=>{let{result:t,onClick:n,query:r}=e;return(0,a.FD)(k,{onClick:()=>{(0,A.trackSearch)({event:S.SearchEvent.ResultClicked,query:r,resultType:t.type,resultData:t}),n()},"data-sentry-element":"SearchResultItem","data-sentry-component":"SecurityResultItem","data-sentry-source-file":"SecurityResultItem.tsx",children:[(0,a.Y)(s.In,{icon:D.$.Trending3,className:"text-primary-600 w-4 h-4","data-sentry-element":"Icon","data-sentry-source-file":"SecurityResultItem.tsx"}),(0,a.FD)(s.Ah,{flex:1,justifyContent:"space-between",itemsSpacingHorizontal:16,flexWrap:"nowrap","data-sentry-element":"FlexLayout","data-sentry-source-file":"SecurityResultItem.tsx",children:[(0,a.Y)(F,{className:"font-medium","data-sentry-element":"SearchResultText","data-sentry-source-file":"SecurityResultItem.tsx",children:t.ticker}),(0,a.Y)(T,{"data-sentry-element":"SearchResultTextSecondary","data-sentry-source-file":"SecurityResultItem.tsx",children:t.title})]})]})},N=e=>{let{result:t,onClick:n,query:r}=e;return(0,a.FD)(k,{onClick:()=>{(0,A.trackSearch)({event:S.SearchEvent.ResultClicked,query:r,resultType:t.type,resultData:t}),n()},"data-sentry-element":"SearchResultItem","data-sentry-component":"HelpResultItem","data-sentry-source-file":"HelpResultItem.tsx",children:[(0,a.Y)(s.In,{icon:D.$.Newspaper2,className:"text-primary-600 w-4 h-4","data-sentry-element":"Icon","data-sentry-source-file":"HelpResultItem.tsx"}),(0,a.Y)("div",{className:"flex-1",children:(0,a.Y)(F,{className:"font-medium","data-sentry-element":"SearchResultText","data-sentry-source-file":"HelpResultItem.tsx",children:t.title})}),(0,a.Y)(s.In,{icon:D.$.ArrowRight,className:"text-body w-4 h-4","data-sentry-element":"Icon","data-sentry-source-file":"HelpResultItem.tsx"})]})},M=e=>{let{result:t,onClick:n,query:r}=e;return(0,a.FD)(k,{onClick:()=>{(0,A.trackSearch)({event:S.SearchEvent.ResultClicked,query:r,resultType:t.type,resultData:t}),n()},"data-sentry-element":"SearchResultItem","data-sentry-component":"FAQResultItem","data-sentry-source-file":"FAQResultItem.tsx",children:[(0,a.Y)(s.In,{icon:D.$.Newspaper2,className:"text-primary-600 w-4 h-4","data-sentry-element":"Icon","data-sentry-source-file":"FAQResultItem.tsx"}),(0,a.Y)("div",{className:"flex-1",children:(0,a.Y)(F,{className:"font-medium","data-sentry-element":"SearchResultText","data-sentry-source-file":"FAQResultItem.tsx",children:t.title})}),(0,a.Y)(s.In,{icon:D.$.ArrowRight,className:"text-body w-4 h-4","data-sentry-element":"Icon","data-sentry-source-file":"FAQResultItem.tsx"})]})};var L=n(48033);let _=e=>{let t=(0,L.wH)(),n=e.isValidQuery?'Ask AI Assistant about "'.concat(e.query,'"'):"Ask the AI Assistant anything";return(0,a.FD)(k,{onClick:()=>{(0,A.trackSearch)({event:S.SearchEvent.AIAssistantClicked,query:e.query}
3),t.openPanel({page:"other",prefillMessage:e.query,autoSend:e.isValidQuery}),e.onClose()},"data-sentry-element":"SearchResultItem","data-sentry-component":"AIAssistantResultItem","data-sentry-source-file":"AIAssistantResultItem.tsx",children:[(0,a.Y)(s.In,{icon:D.$.SparklesThree,className:"text-primary-700 w-4 h-4","data-sentry-element":"Icon","data-sentry-source-file":"AIAssistantResultItem.tsx"}),(0,a.Y)(Y,{"data-sentry-element":"SearchResultTextPrimary","data-sentry-source-file":"AIAssistantResultItem.tsx",children:n}),(0,a.Y)(s.In,{icon:D.$.ArrowRight,className:"text-primary-700 w-4 h-4","data-sentry-element":"Icon","data-sentry-source-file":"AIAssistantResultItem.tsx"})]})},O=e=>{let{query:t}=e,n=(0,f.w)(),r=async()=>{(0,A.trackSearch)({event:S.SearchEvent.SeeMoreSecuritiesClicked,query:t}),await n.push(c.Ay.securityExplorer),e.onClose()};return(0,a.FD)(k,{onClick:r,"data-sentry-element":"SearchResultItem","data-sentry-component":"SeeMoreSecuritiesItem","data-sentry-source-file":"SeeMoreSecuritiesItem.tsx",children:[(0,a.Y)(s.In,{icon:D.$.CompassRound,className:"text-primary-700 w-4 h-4","data-sentry-element":"Icon","data-sentry-source-file":"SeeMoreSecuritiesItem.tsx"}),(0,a.FD)(Y,{"data-sentry-element":"SearchResultTextPrimary","data-sentry-source-file":"SeeMoreSecuritiesItem.tsx",children:["See more ",t," related securities"]}),(0,a.Y)(s.In,{icon:D.$.ArrowRight,className:"text-primary-700 w-4 h-4","data-sentry-element":"Icon","data-sentry-source-file":"SeeMoreSecuritiesItem.tsx"})]})},W=()=>(0,a.Y)(k,{"data-sentry-element":"SearchResultItem","data-sentry-component":"LoadingMoreResultsItem","data-sentry-source-file":"LoadingMoreResultsItem.tsx",children:(0,a.FD)(F,{className:"text-neutral-500 flex items-center gap-2","data-sentry-element":"SearchResultText","data-sentry-source-file":"LoadingMoreResultsItem.tsx",children:[(0,a.Y)(s.In,{icon:D.$.LoadingCircle,className:"animate-spin",size:16,"data-sentry-element":"Icon","data-sentry-source-file":"LoadingMoreResultsItem.tsx"}),"Looking for more results..."]})}),B=()=>(0,a.FD)(k,{"data-sentry-element":"SearchResultItem","data-sentry-component":"SearchingItem","data-sentry-source-file":"SearchingItem.tsx",children:[(0,a.Y)(s.y$,{className:"text-neutral-500",size:"sm",placement:"inline","data-sentry-element":"Spinner","data-sentry-source-file":"SearchingItem.tsx"}),(0,a.Y)(F,{className:"text-neutral-500","data-sentry-element":"SearchResultText","data-sentry-source-file":"SearchingItem.tsx",children:"Searching"})]});var U=n(12859),z=n(50202),V=n(13340),j=n(11325);let H=e=>{let{firstSecurityResult:t,query:n}=e,{activePortfolioId:r}=(0,z.RW)(),{selectedData:o}=(0,U.R)(r,t.ticker);return(0,a.FD)(k,{onClick:()=>{(0,A.trackSearch)({event:S.SearchEvent.AddToDraftClicked,query:n,ticker:t.ticker}),e.onClick()},"data-sentry-element":"SearchResultItem","data-sentry-component":"AddToDraftResultItem","data-sentry-source-file":"AddToDraftResultItem.tsx",children:[(0,a.Y)(s.In,{icon:D.$.CirclePlus,className:"text-primary-700 w-4 h-4","data-sentry-element":"Icon","data-sentry-source-file":"AddToDraftResultItem.tsx"}),(0,a.FD)(Y,{"data-sentry-element":"SearchResultTextPrimary","data-sentry-source-file":"AddToDraftResultItem.tsx",children:["Add ",t.ticker," to draft portfolio"," ",o?(0,a.FD)(b.cO,{className:"text-body",children:["Currently"," ",(0,a.Y)("b",{children:(0,a.Y)(j.eF,{amount:o.amount,sourceCurrency:V.mF})})," ","in portfolio"]}):null]}),(0,a.Y)(s.In,{icon:D.$.ArrowRight,className:"text-primary-700 w-4 h-4","data-sentry-element":"Icon","data-sentry-source-file":"AddToDraftResultItem.tsx"})]})};var q=n(6038),G=n(91905);let K=["pointerdown","click","pointercancel","touchcancel"],Q=e=>{let{inputColor:t}=e,n=(0,f.w)(),{authenticated:d}=(0,i.X6)(),{value:u,setValue:m}=(0,l.A)(!1),{query:y,results:b,isLoading:C,isLoadingSecurities:k,isLoadingHelp:F,hasResults:T,search:Y,isValidQuery:L}=(()=>{let[e,t]=r.useState(""),n=(0,f.w)(),a=(0,v.A)(e=>h.searchSecurities(e),{onErrorMessage:e=>e}),o=(0,v.A)(e=>h.searchHelp(e),{onErrorMessage:e=>e});r.useEffect(()=>{t(""),a.reset(),o.reset()},[n.asPath]),r.useEffect(()=>{let t=a.data,n=o.data;!a.isLoading&&!o.isLoading&&t&&n&&(0,A.trackSearch)({event:S.SearchEvent.ResultsReceived,query:e.trim(),securitiesResults:t,helpResults:n})},[a.isLoading,o.isLoading]);let i=(0,r.useMemo)(()=>(0,x.sg)(e=>{if(!e.trim()){a.reset(),o.reset();return}a.mutate(e),o.mutate(e)},300),[]),l=g.A(e.trim()),s=a.isLoading||o.isLoading,c=a.isLoading,d=o.isLoading,u=a.error||o.error,m=Array.isArray(a.data)?a.data:[],p=Array.isArray(o.data)?o.data:[],y=[...m,...p],b=y.length>0;return{results:y,isLoading:s,isLoadingSecurities:c,isLoadingHelp:d,hasResults:b,hasSecuritiesResults:m.length>0,hasHelpResults:p.length>0,error:u,query:e,isValidQuery:l,search:e=>{t(e),i(e)}}})(),U=r.useRef(null),V=r.useRef(!1),[j,Q]=r.useState(void 0),$=()=>{V.current=!0};r.useEffect(()=>{U.current&&Q(U.current.offsetWidth)},[]),r.useEffect(()=>{if(!u)return;let e=()=>{V.current=!1},t=()=>{"hidden"===document.visibilityState&&e()},n=t=>{("Tab"===t.key||"Escape"===t.key)&&e()},a=t=>{"mouse"===t.pointerType&&e()};
3return K.forEach(t=>{window.addEventListener(t,e,!0)}),window.addEventListener("pointerup",a,!0),window.addEventListener("blur",e),window.addEventListener("pagehide",e),document.addEventListener("visibilitychange",t),document.addEventListener("keydown",n,!0),()=>{e(),K.forEach(t=>{window.removeEventListener(t,e,!0)}),window.removeEventListener("pointerup",a,!0),window.removeEventListener("blur",e),window.removeEventListener("pagehide",e),document.removeEventListener("visibilitychange",t),document.removeEventListener("keydown",n,!0)}},[u]);let{activePortfolio:X,isActivePortfolioDraft:J}=(0,z.RW)(),{launchPortfolioTableDrawer:Z}=(0,q.n)(),{launchCopyPortfolioAction:ee}=(0,G.h8)(),et=(e=>{let t=o.$zQ(e=>e.type,e);return{...{[p.Security]:[],[p.Help]:[],[p.FAQ]:[]},...t}})(b),en=et.security,ea=en.length>5,er=ea?en.slice(0,5):en,eo=o.d5f(er),ei=C&&!T,el=()=>{var t;V.current=!1,Y(""),m(!1),null==(t=e.onDismiss)||t.call(e)};if(!d)return null;let es=async e=>{switch(e.type){case p.Security:await n.push((0,c.RZ)(e.ticker));break;case p.Help:case p.FAQ:(0,x.V3)(e.url)}el()},ec=e=>{switch(e.type){case p.Security:return(0,a.Y)(R,{result:e,query:y,onClick:()=>es(e)},e.id);case p.Help:return(0,a.Y)(N,{result:e,query:y,onClick:()=>es(e)},e.id);case p.FAQ:return(0,a.Y)(M,{result:e,query:y,onClick:()=>es(e)},e.id)}};return(0,a.Y)(r.Fragment,{children:(0,a.Y)(s.ms,{overlayStyle:{width:j,maxHeight:"70vh",overflow:"hidden",borderRadius:"8px",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",marginTop:"4px"},overlay:(0,a.FD)(I,{onPointerDown:$,onTouchStart:$,children:[(0,a.Y)(w,{children:ei?(0,a.Y)(B,{}):(0,a.FD)(r.Fragment,{children:[er.length>0&&(0,a.FD)(r.Fragment,{children:[(0,a.Y)(E,{children:"Security"}),o.TjK(ec,er),eo&&(0,a.Y)(H,{firstSecurityResult:eo,query:y,onClick:()=>{el(),J?Z(X,null==eo?void 0:eo.ticker):ee({portfolio:X,draftCreationOrigin:G.$C.WithinExistingFlow,onDraftPortfolioCreated:e=>Z(e,null==eo?void 0:eo.ticker)})}}),ea&&(0,a.Y)(O,{query:y,onClose:el})]}),(et.faq.length>0||et.help.length>0)&&(0,a.FD)(r.Fragment,{children:[(0,a.Y)(E,{children:"Help center"}),o.TjK(ec,et.faq),o.TjK(ec,et.help)]}),T&&(k||F)&&(0,a.Y)(W,{})]})}),(0,a.Y)(P,{children:(0,a.Y)(_,{query:y,isValidQuery:L,onClose:el})})]}),trigger:[],placement:"bottomLeft",destroyPopupOnHide:!0,open:u,onOpenChange:e=>{e||el()},"data-sentry-element":"Dropdown","data-sentry-source-file":"SearchBarRenderer.tsx",children:(0,a.Y)("div",{ref:U,className:"w-full min-w-0 max-w-[320px]",children:(0,a.Y)(s.pd,{value:y,radius:"full",placeholder:"Find investments, help & more...",onChange:e=>{Y(e),m(e.trim().length>0)},onBlur:()=>{V.current||el()},prefix:(0,a.Y)(s.In,{icon:D.$.MagnifyingGlass,className:"text-neutral-400",size:16}),classNames:{inputWrapper:"pr-[6px] shadow-none"},onFocus:()=>{var t;V.current=!1,null==(t=e.onFocus)||t.call(e)},color:t,isClearable:!0,autoComplete:"off","data-sentry-element":"Input","data-sentry-source-file":"SearchBarRenderer.tsx"})})})})}},2899:(e,t,n)=>{n.d(t,{$x:()=>u,JJ:()=>d,Rp:()=>c,Z5:()=>s});var a=n(12115),r=n(83910),o=n(95633),i=n(65438),l=n(76778);let s=(e,t)=>{let{value:n,setFalse:o,setTrue:l}=(0,i.A)(!1),{isPopShownToUser:s,setIsPopShownToUser:c}=((e,t)=>{let[n,o]=(0,r.Ay)(e,!1,t);return{isPopShownToUser:n,setIsPopShownToUser:a.useCallback(e=>{o(e)},[e])}})(e,t);return a.useEffect(()=>{n&&c(!0)},[n,c]),{popupVisible:n,isPopShownToUser:s,openPopup:l,closePopup:o}},c=()=>{let{value:e,setValue:t,isLoading:n}=(0,o.d)(o.b.ScheduleOnboardingCallLastShownAt,0);return{lastShownAt:e,setLastShownAt:t,isLoading:n}},d=()=>{let{value:e,setValue:t,isLoading:n}=(0,o.d)(o.b.ScheduleOnboardingCallClickedThrough,!1);return{clickedThrough:e,setClickedThrough:t,isLoading:n}},u=(e,t)=>{let{value:n,setFalse:r,setTrue:s}=(0,i.A)(!1),{isPopShownToUser:c,setIsPopShownToUser:d,isLoading:u}=((e,t)=>{let{value:n,setValue:a,isLoading:r}=(0,o.d)(e,!1,t);return{isPopShownToUser:n,setIsPopShownToUser:(0,l.K)(e=>{a(e)}),isLoading:r}})(e,t);return a.useEffect(()=>{n&&d(!0)},[n,d]),{popupVisible:n,isPopShownToUser:c,isLoading:u,openPopup:s,closePopup:r}}}
3,3023:(e,t,n)=>{n.d(t,{V:()=>l});var a=n(81691),r=n(61972),o=n(12115),i=n(76778);let l=(e,t)=>{let n=(0,a.vV)(),l=(0,i.K)(t),[s]=(0,o.useState)(()=>r.d.getInstance());(0,o.useEffect)(()=>{let t=null==n?void 0:n.userDict;if(t&&t.id&&t.socketAppKey&&t.socketCluster)return s.initialize({userId:t.id,socketAppKey:t.socketAppKey,socketCluster:t.socketCluster}),s.subscribe(e,l),()=>{s.unsubscribe(e,l)}},[e,n,s,l])}},3850:(e,t,n)=>{n.d(t,{d:()=>i});var a=n(57090);n(12115);var r=n(41784),o=n(57871);let i=e=>(0,a.Y)(o.Zp,{id:e.id,title:e.title,description:e.description,extra:e.extra,stackHeader:e.stackHeader,loading:e.loading,bordered:!!e.outlined,fullWidth:!0,className:(0,r.cn)(!e.outlined&&"border-0 p-0 rounded-none bg-transparent overflow-visible gap-4",e.className),"data-sentry-element":"Card","data-sentry-component":"PageSection","data-sentry-source-file":"PageSection.tsx",children:e.children})},4122:(e,t,n)=>{n.d(t,{q:()=>d});var a=n(12115),r=n(33624),o=n(54674),i=n(65438),l=n(38484),s=n(82949);let c=async(e,t)=>{let[n,a]=await Promise.all([(0,l.bC)(e.ticker),(0,l.R4)(e.ticker)]),r=(0,s.z3)(a);return{initialValues:{investmentDetails:e,systemSecurityTickerDetails:n,proxyDetails:a,networthDetail:t},managementMode:r}},d=()=>{let{value:e,setTrue:t,setFalse:n}=(0,i.A)(!1),[d,u]=a.useState(null);(0,l.lT)(),(0,l.A$)(),(0,l.X_)(),(0,l.Lu)();let m=e=>{u({...e}),t()};return{workflowVisible:e,workflowParams:d,launchNewCustomSecuritySetupWorkflow:async e=>{let t=r.VxE(e,{ticker:(0,s.Lb)(e.ticker),investment:r.vUk(e.ticker,e.investment),amount:r.vUk(0,e.amount)}
3),{initialValues:n,managementMode:a}=await c(t,null);m({initialValues:n,managementMode:a,formMode:o.v0.Create,formFieldsCustomControl:null})},launchSecurityInvestmentAndProxySetupWorkflow:async e=>{let{initialValues:t,managementMode:n}=await c(e,null);m({managementMode:n,initialValues:t,formMode:o.v0.Edit,formFieldsCustomControl:{freezeTicker:!1,freezeSeriesName:!1,freezeInvestmentAmount:!0,hideInvestmentAmount:!0}})},launchSecurityProxyExclusiveSetupWorkflow:async e=>{let t=r.VxE(e,{amount:0}),{initialValues:n,managementMode:a}=await c(t,t.networthDetail);m({initialValues:n,managementMode:a,formMode:o.v0.Edit,formFieldsCustomControl:{freezeTicker:!0,freezeInvestmentAmount:!0,hideInvestmentAmount:!0,freezeSeriesName:!1}})},exitWorkflow:()=>{u(null),n()}}}},4140:(e,t,n)=>{n.d(t,{K:()=>s,h:()=>c});var a=n(84400),r=n(62570),o=n(23462),i=n(36934);function l(){let e=(0,a._)(["\n          & {\n            width: 100%;\n          }\n        "]);return l=function(){return e},e}let s=(0,r.A)("div",{target:"e8mhgkd0"})("display:",e=>"vertical"===e.displayMode?"block":"flex",";flex-direction:row;column-gap:16px;align-items:center;justify-content:center;",e=>e.fillWidth?(0,o.AH)(l()):"","  & > button.ant-btn{margin-bottom:",e=>"vertical"===e.displayMode?"8px":"none",";}"),c=(0,r.A)(i.st,{target:"e8mhgkd1"})("color:inherit;width:auto;")},4307:(e,t,n)=>{n.d(t,{i:()=>o});var a=n(85543),r=n(62346);let o=()=>{let{data:e}=(0,r.Iu)(),t=null!=e?e:[];return{privateEquity:(0,a.Kh)((0,a.Im)(t)),realEstate:(0,a.Kh)((0,a.EY)(t))}}},4887:(e,t,n)=>{n.d(t,{h:()=>k,A:()=>F});var a=n(57090),r=n(12115),o=n(74547),i=n(95825),l=n(78046),s=n(8921),c=n(87778),d=n(99750),u=n(56490),m=n(35209),p=n(75075),y=n(85780),h=n(76660),f=n(33624),g=n(62212),v=n(19788),x=n(17667),A=n(49877),S=n(53374);let b=e=>v.A.updateInvestmentAccount(f.UpN(["id","nickName"],e));var C=n(11);let I=e=>{let{cashPortfolio:t,index:n,isOnlyOneSubAccountExists:r}=e,{isBelow576:i}=(0,d.uF)();return(0,a.FD)(o.Ah,{display:"block",itemsSpacingVertical:16,marginBottom:24,"data-sentry-element":"FlexLayout","data-sentry-component":"SubAccountFormFields","data-sentry-source-file":"CashAccountSetupForm.tsx",children:[(0,a.Y)(c.cN,{hidden:!0,name:[t.name,"cashPortfolioId"],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"CashAccountSetupForm.tsx",children:(0,a.Y)(m.A,{"data-sentry-element":"Input","data-sentry-source-file":"CashAccountSetupForm.tsx"})}),(0,a.Y)(c.cN,{hidden:!0,name:[t.name,"connectedAccountId"],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"CashAccountSetupForm.tsx",children:(0,a.Y)(m.A,{"data-sentry-element":"Input","data-sentry-source-file":"CashAccountSetupForm.tsx"})}),(0,a.FD)(o.Ah,{alignItems:"flex-start",justifyContent:"flex-start",itemsSpacingHorizontal:16,"data-sentry-element":"FlexLayout","data-sentry-source-file":"CashAccountSetupForm.tsx",children:[(0,a.Y)(c.cN,{style:{flexBasis:i?"100%":"50%",marginBottom:12},label:"Subaccount ".concat(n),name:[t.name,y.v7],rules:[{required:!0,message:"Please input the account nickname!"},C.uu],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"CashAccountSetupForm.tsx",children:(0,a.Y)(m.A,{inForm:!0,placeholder:"E.g. Chase Savings",maxLength:C.xN,"data-sentry-element":"Input","data-sentry-source-file":"CashAccountSetupForm.tsx"})}),!r&&(0,a.Y)(c.cN,{label:"Active",name:[t.name,y.tf],valuePropName:"checked",rules:[{type:"boolean",required:!0}],style:{width:80},children:(0,a.Y)(o.dO,{})}),(0,a.Y)(c.cN,{style:{flex:1},label:"APY",name:[t.name,y.yH],rules:[{required:!0,validator:h.j}],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"CashAccountSetupForm.tsx",children:(0,a.Y)(o.tv,{"data-sentry-element":"PercentageInput","data-sentry-source-file":"CashAccountSetupForm.tsx"})})]}),(0,a.FD)(o.Ah,{display:i?"block":void 0,itemsSpacingHorizontal:i?void 0:16,alignItems:"stretch","data-sentry-element":"FlexLayout","data-sentry-source-file":"CashAccountSetupForm.tsx",children:[(0,a.Y)(c.cN,{style:{flex:1},label:(0,a.Y)(u.A,{label:"Cash type",title:y.Fl}),name:[t.name,y.uH],rules:[{required:!0,message:"Please select the cash type!"}],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"CashAccountSetupForm.tsx",children:(0,a.Y)(o._P,{placeholder:"Select cash type",options:y.EA,"data-sentry-element":"AntdSelect","data-sentry-source-file":"CashAccountSetupForm.tsx"})}),(0,a.Y)(c.cN,{style:{flex:1},label:"Account type",name:[t.name,y.kv],rules:[{required:!0,message:"Please select the account type!"}],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"CashAccountSetupForm.tsx",children:(0,a.Y)(o._P,{placeholder:"Select account type",options:y._C,"data-sentry-element":"AntdSelect","data-sentry-source-file":"CashAccountSetupForm.tsx"})})]})]})},w=e=>{let{cashAccount:t,isOperationAbortable:n,defaultApyRates:i}=e,[d]=(0,l.mN)(),u=(()=>{let e=(0,g.j)();return(0,x.A)(b,{onSuccess:async(t,n)=>{try{await Promise.all(f.TjK(A.X3,n.subAccountsWithCashPortfolio)),(0,s.Ds)(s._n.Success,"Account updated successfully")}catch(e){console.error("Error updating sub accounts",n)}await (0,S.E)(e)}})})(),m=async()=>{await e.onClose(),d.resetFields()},v=async e=>{await u.mutateAsync(e,{onSuccess:async()=>{await m(),(0,s.Ds)(s._n.Success,"Saved account details")}})},w=1===t.subAccountsWithCashPortfolio.length;return(0,a.Y)(c.Nt,{form:d,name:"accountMutationParams",layout:"vertical",initialValues:{id:t.id,nickName:t.nickName,subAccountsWithCashPortfolio:t.subAccountsWithCashPortfolio.map(e=>{if(null!==e.cashPortfolio)return{...e.cashPortfolio,isActive:e.isActive,connectedAccountId:e.id};{let t=p.z.OtherCashAccount;return{cashPortfolioId:void 0,userId:0,name:e.nickName||"Account ".concat(e.id),apy:(0,h.C)(t,i),cashValue:0,isInvestable:!1,accountType:t,createdOn:"",updatedOn:"",isActive:e.isActive,connectedAccountId:e.id}}})},onFinish:v,onValuesChange:e=>{e.subAccountsWithCashPortfolio&&e.subAccountsWithCashPortfolio.forEac
3h((e,t)=>{if(e&&e[y.kv]){let n=e[y.kv],a=(0,h.C)(n,i);d.setFieldValue(["subAccountsWithCashPortfolio",t,y.yH],a)}})},"data-sentry-element":"StyledForm","data-sentry-component":"CashAccountSetupForm","data-sentry-source-file":"CashAccountSetupForm.tsx",children:(0,a.FD)(c.MG,{"data-sentry-element":"FormContainer","data-sentry-source-file":"CashAccountSetupForm.tsx",children:[(0,a.Y)(c.cN,{hidden:!0,name:"id",style:{width:"100%"},"data-sentry-element":"StyledFormItem","data-sentry-source-file":"CashAccountSetupForm.tsx",children:(0,a.Y)(c.GI,{value:t.id,inForm:!0,"data-sentry-element":"FormInput","data-sentry-source-file":"CashAccountSetupForm.tsx"})}),(0,a.Y)(c.cN,{name:"nickName",label:"Account nickname",rules:[{required:!0,whitespace:!0,message:"Nickname",type:"string"},C.uu],style:{width:"100%"},"data-sentry-element":"StyledFormItem","data-sentry-source-file":"CashAccountSetupForm.tsx",children:(0,a.Y)(c.GI,{inForm:!0,maxLength:C.xN,"data-sentry-element":"FormInput","data-sentry-source-file":"CashAccountSetupForm.tsx"})}),(0,a.Y)(c.BA,{"data-sentry-element":"SubAccountsHeading","data-sentry-source-file":"CashAccountSetupForm.tsx",children:"Subaccounts information"}),(0,a.Y)(l.xA,{name:"subAccountsWithCashPortfolio","data-sentry-element":"FromList","data-sentry-source-file":"CashAccountSetupForm.tsx",children:e=>(0,a.Y)(r.Fragment,{children:e.map((e,t)=>(0,a.Y)(I,{index:t+1,cashPortfolio:e,isOnlyOneSubAccountExists:w},e.key))})}),(0,a.FD)(c.$I,{itemsSpacingHorizontal:8,"data-sentry-element":"ActionsContainer","data-sentry-source-file":"CashAccountSetupForm.tsx",children:[n?(0,a.Y)(c.cN,{shouldUpdate:!0,children:()=>(0,a.Y)(o.$n,{onClick:m,children:"Cancel"})}):null,(0,a.Y)(c.cN,{shouldUpdate:!0,"data-sentry-element":"StyledFormItem","data-sentry-source-file":"CashAccountSetupForm.tsx",children:()=>(0,a.Y)(o.$n,{variant:"filled",htmlType:"submit",loading:u.isLoading,children:"Save"})})]})]})})};var P=n(513),k=function(e){return e.Modal="modal",e.Drawer="drawer",e}({});let F=e=>{let{cashAccount:t,isOperationAbortable:n}=e,{data:r,isLoading:l}=(0,A.gy)(),s=t.nickName,d=n?"Edit ".concat(s," account information"):"".concat(s," account information"),u=(0,a.FD)(o.Ah,{flexDirection:"column",itemsSpacingVertical:16,children:[(0,a.Y)(P._R,{}),(0,a.Y)(P._R,{}),(0,a.Y)(P._R,{}),(0,a.Y)(P._R,{})]}),m=l||!r?u:(0,a.Y)(w,{...e,defaultApyRates:r});switch(e.openAs){case"modal":return(0,a.Y)(o.aF,{disableSubmitOnEnter:!0,size:i.rI.Md,title:d,open:!0,centered:!0,destroyOnClose:!0,closable:e.isOperationAbortable,maskClosable:e.isOperationAbortable,onCancel:e.onClose,footer:null,children:m});case"drawer":return(0,a.Y)(c.wf,{width:600,title:d,open:!0,footer:null,destroyOnClose:!0,closable:e.isOperationAbortable,maskClosable:e.isOperationAbortable,onClose:e.onClose,children:m})}}},5036:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(57090);n(12115);var r=n(74547),o=n(12859),i=n(50202),l=n(11325),s=n(13340),c=n(36934),d=n(6038),u=n(91905);let m=e=>{let{ticker:t,buttonProps:n,heldText:m,text:p="Add ".concat(e.ticker," to draft")}=e,{activePortfolioId:y,activePortfolio:h,isActivePortfolioDraft:f}=(0,i.RW)(),{selectedData:g}=(0,o.R)(y,t),{launchPortfolioTableDrawer:v}=(0,d.n)(),{launchCopyPortfolioAction:x}=(0,u.h8)(),A=g&&m?m:p,S=async e=>{await v(e,t)};return(0,a.FD)(r.Ah,{flexDirection:"column",itemsSpacingVertical:4,"data-sentry-element":"FlexLayout","data-sentry-component":"AddToDraft","data-sentry-source-file":"AddToDraft.tsx",children:[f?(0,a.Y)(r.$n,{variant:"filled",onClick:()=>S(h),fullWidth:!0,...n,children:A}):(0,a.Y)(r.$n,{variant:"filled",onClick:()=>{x({portfolio:h,draftCreationOrigin:u.$C.WithinExistingFlow,onDraftPortfolioCreated:e=>S(e)})},fullWidth:!0,...n,children:A}),g?(0,a.FD)(c.cO,{className:"text-body",children:["Currently"," ",(0,a.Y)("b",{children:(0,a.Y)(l.eF,{amount:g.amount,sourceCurrency:s.mF})})," ","in portfolio"]}):null]})}},5949:(e,t,n)=>{n.d(t,{O:()=>p,p:()=>m});var a=n(71680),r=n(66220),o=n(36608),i=n(65460),l=n(33624),s=n(7802),c=n(19565);let d=e=>[s.$5.SnapTrade,"linkToken",e.institutionId,e.broker,l.vUk("",e.reconnectingBankId)],u=e=>o.A.getSnapTradeLinkToken(r.stringifyUrl({url:window.location.href}),e.broker,l.vUk(null,e.reconnectingBankId),(0,i.on)(e.institutionId)),m=(e,t)=>
3(0,c.p)(e,d(t),()=>u(t)),p=()=>{let e=(0,a.j)();return(0,a.n)({mutationFn:t=>(0,c.B)(e,d(t),()=>u(t))})}},6019:(e,t,n)=>{n.d(t,{A:()=>p});var a=n(57090),r=n(12115),o=n(33624),i=n(11325),l=n(13340),s=n(35208),c=n(62570),d=n(60801),u=n(99026);let m=(0,c.A)("span",{target:"e1g454py0"})("white-space:nowrap;"),p=e=>{let{isAssumed:t,assumedAmounts:n,amount:c,isLoading:p,amountFormatterProps:y={amountFormatter:i.EB.HumanizedCompactAmount}}=e;if(p)return(0,a.Y)(d.A,{});if(t&&n){let[e,t]=n,s=e<0&&t<0,[c,d]=o.Uln(o.D_O,o.TjK(s?Math.abs:o.D_O,n));if((0,u.Xe)(c,d,.01))return(0,a.Y)(m,{children:(0,a.Y)(i.eF,{amount:c,sourceCurrency:l.mF,...y})});let p=o.jp7(y,{customFormatOptions:{hideDecimals:!0}}),h=(0,a.FD)(r.Fragment,{children:[(0,a.Y)(i.eF,{amount:c,sourceCurrency:l.mF,...p})," - ",(0,a.Y)(i.eF,{amount:d,sourceCurrency:l.mF,...p})]});return s?(0,a.FD)(m,{children:["(",h,")"]}):(0,a.Y)(m,{children:h})}return o.gD_(c)?(0,a.Y)(m,{children:s.UZ}):(0,a.Y)(m,{"data-sentry-element":"AmountContainer","data-sentry-component":"AssumedRangeAmounts","data-sentry-source-file":"AssumedRangeAmount.tsx",children:(0,a.Y)(i.eF,{amount:c,sourceCurrency:l.mF,...y,"data-sentry-element":"CurrencyAmount","data-sentry-source-file":"AssumedRangeAmount.tsx"})})}},6038:(e,t,n)=>{n.d(t,{A:()=>m,n:()=>u});var a=n(57090),r=n(12115),o=n(43948),i=n(99026),l=n(35394),s=n(32189);let{useGlobalPortfolioTableDrawerLaunchListener:c,emitGlobalPortfolioTableDrawerLaunch:d}=(0,o.createEvent)("GlobalPortfolioTableDrawerLaunch")(),u=e=>{let t=async(e,t)=>{d({portfolio:e,mode:s.jy.EditPortfolio,defaultUpsertTicker:t}),await (0,i.yy)(1e3)},n=async()=>{e?await t(e):console.error("No portfolio provided to launchPortfolioTableDrawer")};return{launchPortfolioTableDrawer:t,launchDraftPortfolioEditDrawer:n}},m=()=>{let[e,t]=(0,r.useState)(null);return(c(t),e)?(0,a.Y)(l.A,{activePortfolio:e.portfolio,okText:"Save changes",cancelText:"Cancel",onClose:()=>{t(null)},...e}):null}},6319:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(32189),r=n(544),o=n(33624),i=n(12115);let l=e=>{let t=(0,i.useMemo)(()=>(0,r.I)(e),[e]),n=(0,i.useMemo)(()=>(0,r.ns)(e,a.N$.Current),[e]),l=(0,i.useMemo)(()=>(0,r.ns)(e,a.N$.Draft),[e]),s=(0,i.useMemo)(()=>(0,r.ns)(e,a.N$.Group),[e]),c=(0,i.useMemo)(()=>o.d5f(l),[l]);return(0,i.useMemo)(()=>({mainPortfolio:t,currentPortfolios:n,draftPortfolios:l,groupPortfolios:s,firstAvailableDraftPortfolio:c}),[t,n,l,s,c])}},6390:(e,t,n)=>{n.d(t,{Cy:()=>d,Fw:()=>u,Nu:()=>c,aY:()=>l});var a=n(81527),r=n(45424);let o=["PersonalizedRecommendations","RunInputs"],i=e=>[...o,e],l=e=>{var t;return null!=(t=r.q.getQueryData(i(e)))?t:null},s=new Map,c=e=>{var t;let n=(null!=(t=s.get(e))?t:0)+1;return s.set(e,n),n},d=(e,t,n)=>{s.get(e)===t&&r.q.setQueryData(i(e),n)},u=e=>{let t=i(e),{data:n}=(0,a.I)(t,()=>{var e;return null!=(e=r.q.getQueryData(t))?e:null},{staleTime:1/0,cacheTime:12e5});return null!=n?n:null}},6465:(e,t,n)=>{n.d(t,{NF:()=>p,gL:()=>g,nB:()=>f,u6:()=>u});var a=n(71680),r=n(33624),o=n(17667),i=n(36608),l=n(19565),s=n(59334),c=n(4603),d=n(7802),u=function(e){return e.NewConnection="NewConnection",e.Reconnection="Reconnection",e}({});let m=async e=>{let t="Reconnection"===e.connectionMode?e.reconnectingAccountId:void 0;return i.A.exchangePlaidToken({publicToken:e.plaidPublicToken,reconnectingAccountId:t})},p=e=>{let t=(0,s.L)(c.PortfoliosSyncMode.Manual);return(0,o.A)(async n=>{let a=await m(n),r={accountProvider:d.$5.Plaid,investmentAccountId:a.id};return e?t.mutate(r):await t.mutateAsync(r),a})},y=e=>[d.$5.Plaid,"linkToken",e.institutionId,r.gD_(e.reconnectingAccountId)?"":String(e.reconnectingAccountId)],h=e=>i.A.getPlaidToken(e.institutionId,e.reconnectingAccountId),f=(e,t)=>(0,l.p)(e,y(t),()=>h(t)),g=()=>{let e=(0,a.j)();return(0,a.n)({mutationFn:t=>(0,l.B)(e,y(t),()=>h(t))})}},6497:(e,t,n)=>{n.d(t,{$:()=>o});var a=n(57090);n(12115);var r=n(70432);let o=e=>(0,a.Y)(r.A,{...e,openInNewTab:!0,"data-sentry-element":"Link","data-sentry-component":"PublicGPLink","data-sentry-source-file":"PublicSiteLinks.tsx"})},6558:(e,t,n)=>{n.d(t,{HM:()=>v,Hf:()=>m,Us:()=>p,XT:()=>y,gJ:()=>h,lB:()=>f,mK:()=>A,ph:()=>x,rI:()=>g});var a=n(57090),r=n(12115),o=n(33624),i=n(17143),l=n(78046),s=n(544),c=n(11325),d=n(13340),u=n(21533);
3let m=(e,t,n)=>{let a=(0,i.iU)(n);(0,l.IX)(e,t,a)},p=(e,t,n)=>{let a=(0,i.$S)(n);return(0,l.IX)(e,t,a),a},y=(e,t)=>(0,s.yI)(t)?Promise.reject(Error("Cash Ticker is not allowed")):Promise.resolve(),h=(e,t)=>o.mKk(" ",t)?Promise.reject(Error("Ticker cannot contain spaces")):Promise.resolve(),f=function(){let{required:e=!0,minAmount:t=Number.MIN_SAFE_INTEGER}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[{required:e,type:"number",min:t,message:(0,a.FD)(r.Fragment,{children:["Must be higher than ",(0,a.Y)(c.eF,{amount:t,sourceCurrency:d.mF})]})},{validator:(0,u.de)(u.wx)}]},g=function(){let{required:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{required:e,type:"number"}},v=(e,t)=>o.I6j(o.wqE("ticker",(0,i.$S)(e)),t),x=e=>{if(!e)return 2;let t=e.toString(),n=t.indexOf("."),a=-1===n?t.length+1:n+1;return o.T9B(2,a)},A=e=>{if(!e||e>=1)return 2;let t=e.toString().split(".")[1]||"",n=-1;for(let e=0;e<t.length;e++)if("0"!==t[e]){n=e;break}return -1===n?2:n+2}},6976:(e,t,n)=>{n.d(t,{Up:()=>T,mq:()=>M,y6:()=>N,nP:()=>R,Vi:()=>L,mL:()=>W,sS:()=>_,G4:()=>O});var a=n(33624),r=n(22462),o=n(17667),i=n(62212),l=n(42166),s=n(10320),c=n(84455),d=n(9082),u=n(70890),m=n(39504),p=n(85543),y=n(62219);let h=e=>void 0===e?null:Array.isArray(e)?a.TjK(h,e):y.A(e)?a.tTi(h,e):e;var f=n(83731),g=n(58888),v=n(8921),x=n(1120),A=n.n(x),S=n(78190),b=n(97780),C=n(31695),I=n(75128),w=n(60154),P=n(60192),k=n(99026),F=n(48569);let T=async e=>await Promise.all(a.TjK(l.A.saveInvestorPreferences,e)),E=async e=>s.A.upsertNetWorth(h(e)),Y=async e=>s.A.addNewRealEstateDetail(e),D=async e=>s.A.deleteNetWorthItem(e),R=()=>{let e=(0,i.j)(),t=(0,m.X6)(),{launchUpsertGroup:n}=(0,P.k)(),{openGroupsPage:r}=(0,C.E)();return(0,o.A)(T,{onSuccess:async(o,i)=>{e.invalidateQueries(c.XI.Preferences),e.invalidateQueries(d.N.userPreferences),a.jJl(t=>e.resetQueries(t),a.zug(I.ub));let l=a.TjK(a._w2("questionId"),i);if(a.bzn(a.mKk(a.__,l))(w.Mq)&&t.isInvestorPreferencesComplete&&(0,u.wN)(e),a.mKk(c.od.Residency,l)){(0,f.wb)(e);let t=(0,F.Ji)(i);if(a.aIS(t,S.XM.USA))try{A().dataLayer({dataLayer:{event:"Account Created, US",category:"User Registration",action:"Create Account",label:"US User"},dataLayerName:b.Vi})}catch(e){console.error("Error in TagManager.dataLayer",e)}}if(a.mKk(c.od.PortfolioManagementApproach,l)){let t=a.I6j(a.wqE("questionId",c.od.PortfolioManagementApproach),i);if(await (0,g.gy)(e),await (0,u.su)(e),await (0,u.Mu)(e),t&&t.response===c.SO.AssetGroups){(0,v.Ds)(v._n.Success,"Asset Groups setup completed"),await r();let e=await (0,g.ZE)(),t=a.d5f(e);t&&(await (0,k.yy)(5e3),n(t))}}},onErrorMessage:e=>e})},N=()=>{let e=(0,i.j)();return(0,o.A)(async e=>{let{realEstateDetail:t,mortgageDetail:n}=e,a=null;if((0,p.Y8)(t))a=t.netWorthItemId,await E([t]);else if((0,p.Lh)(t)){let{netWorthItemId:e}=await Y(t);a=e}if(r.A(a)){var o,i;let e={...n,additionalDetail:{netWorthItemId:a,interestRate:null!=(i=null==n||null==(o=n.additionalDetail)?void 0:o.interestRate)?i:null}};await E([e])}},{onSuccess:()=>{(0,u.DK)(e)}})},M=()=>{let e=(0,i.j)();return(0,o.A)(async e=>{let{mortgageDetail:t,...n}=e,{netWorthItemId:a}=n;if(t){let{netWorthItemId:e}=t;await D(e)}await D(a)},{onSuccess:()=>{(0,u.DK)(e)}})},L=()=>{let e=(0,i.j)();return(0,o.A)(async e=>{await E(e)},{onSuccess:()=>{(0,u.DK)(e)}})},_=()=>{let e=L();return(0,o.A)(async t=>{await e.mutateAsync([t])},{onSuccessMessage:()=>"Saved successfully"})},O=()=>{let e=L();return(0,o.A)(async t=>{await e.mutateAsync([t])},{onSuccessMessage:()=>"Saved successfully"})},W=()=>{let e=(0,i.j)();return(0,o.A)(async e=>{await D(e.netWorthItemId)},{onSuccess:()=>{(0,u.DK)(e)},onSuccessMessage:()=>"Deleted successfully"})}},7172:(e,t,n)=>{n.d(t,{b:()=>d,u:()=>u});var a=n(12115),r=n(33624),o=n(27866),i=n.n(o);let l=(e,t)=>r.AeT(r.i_z([e]),t),s=r.is(Number),c=r.is(String),d={sortText:e=>(t,n)=>{let a=l(e,t),r=l(e,n);return c(a)&&c(r)?a.localeCompare(r):!c(r)&&c(a)?1:Number.MIN_SAFE_INTEGER},sortNumber:e=>(t,n)=>{let a=l(e,t),r=l(e,n);return s(a)&&s(r)?a-r:!s(r)&&s(a)?1:Number.MIN_SAFE_INTEGER},sortDate:e=>(t,n)=>{let a=l(e,t),r=l(e,n);return a||r?a?r?i()(a).isValid()&&i()(r).isValid()?i()(a).unix()-i()(r).unix():i()(a).isValid()?1:Number.MIN_SAFE_INTEGER:1:-1:Number.MIN_SAFE_INTEGER}}
3,u=(e,t,n)=>(a.useEffect(()=>{var t;let a=null==(t=document.getElementById(e))?void 0:t.querySelector(".ant-table-body");if(a){let e={top:a.scrollHeight,behavior:"smooth"},t=r.VxE(e,n||{});a.scrollTo(t)}},[e,t,n]),e)},7257:(e,t,n)=>{n.d(t,{Ck:()=>g,Cw:()=>p,Fi:()=>u,Rj:()=>v,Tj:()=>d,Ur:()=>y,a:()=>m,cN:()=>h,jP:()=>x,k8:()=>A,lw:()=>S,qO:()=>f});var a=n(33624),r=n(92283),o=n(19682),i=n(51305),l=n(544),s=n(17143),c=n(84978);let d=(e,t,n)=>e.map(e=>{let a=(0,l.Ip)(e),i=(0,s.cp)(e.ticker,t),c=i&&r.A(e.currentPrice)?a?n/(100*e.currentPrice):n/e.currentPrice:e.quantity;return{...e,amount:i?n:e.amount,quantity:c,isFixedAmount:i?o.A(e.currentPrice):e.isFixedAmount}}),u=(e,t,n)=>e.map(e=>{let a=(0,l.Ip)(e),o=(0,s.cp)(e.ticker,t),i=o&&r.A(e.currentPrice)?a?n*e.currentPrice*100:n*e.currentPrice:e.amount;return{...e,quantity:o?n:e.quantity,amount:i,isFixedAmount:!o&&e.isFixedAmount}}),m=(e,t)=>a.I6j(e=>(0,s.cp)(e.ticker,t),e),p=(e,t)=>a.$xo(t,"seriesName")(a.I6j(e=>(0,s.cp)(e.ticker,t))(e));var y=function(e){return e.Amount="amount",e.Quantity="quantity",e}({});let h=(e,t,n,a)=>("amount"===a?d:u)(e,t,n),f=e=>{let t=e.isFixedAmount?e.amount:e.quantity;return r.A(t)&&i.A(t,0)},g=(e,t,n)=>{let r,o=n?((e,t,n)=>a.TjK(e=>(0,s.cp)(e.ticker,n)?{...e,displayTicker:t.ticker,...t,ticker:t.ticker}:e,e))(e,t,n):e,i=t.isFixedAmount?"amount":"quantity",c=t.isFixedAmount?t.amount:t.quantity;if(a.gD_(c))return console.error("Invalid updated value for investment item",t),o;let d=o;if(r=t.ticker,a.bzn(e=>(0,s.cp)(e.ticker,r))(o))d=((e,t,n)=>{let r=(0,s.$S)(t);return a.TjK(e=>({...e,displayName:r===(0,s.$S)(e.ticker)?n:e.investment}),e)})(o,t.ticker,t.investment);else{let e={...t,displayName:t.investment,weight:t.weight||0};d=a.BCw(e,o)}let u=h(d,t.ticker,c,i);return(0,l.V)(u)},v=(e,t)=>(0,l.V)(a.kuo(e=>(0,s.cp)(e.ticker,t),e)),x=e=>(0,l.V)(e),A=(e,t,n)=>{let r=a.TSs((e,t)=>e+t.amount,0,e);return(0,l.yI)(n.ticker)?(0,l.V)(t):n.assetType===c.PW.MoneyMarket?(0,l.qR)(r,t):(0,l.Uc)(r,t)},S=e=>a.hS4(e=>(0,s.$S)(e.ticker),e)},7426:(e,t,n)=>{n.d(t,{qI:()=>u,uC:()=>c,Ui:()=>m,y6:()=>p,P6:()=>y});var a=n(71754);let r=[1,3,5],o=(e,t)=>Number.parseInt(e.slice(t,t+2),16),i=e=>r.map(t=>o(e,t)),l=(e,t)=>"rgba(".concat(o(e,1),", ").concat(o(e,3),", ").concat(o(e,5),", ").concat(t,")"),s={inactive:{enabled:!1}},c={hover:{enabled:!1},inactive:{enabled:!1}},d=e=>({enabled:!1,symbol:"circle",states:{hover:{enabled:!0,radius:5,radiusPlus:0,lineWidth:2.5,lineWidthPlus:0,fillColor:a.gB.white,lineColor:e}}}),u=0,m=e=>({type:"arearange",id:e.id,name:e.name,data:e.data,color:a.RR.fillFrom,fillColor:(e=>{let[t,n]=(e=>{let t=Number((Math.max(...e.flatMap(i).map(e=>255-e))/255).toFixed(4));return 0===t?e.map(e=>l(e,0)):e.map(e=>((e,t)=>{let n=n=>Math.round((o(e,n)-255*(1-t))/t);return"rgba(".concat(n(1),", ").concat(n(3),", ").concat(n(5),", ").concat(t,")")})(e,t))})([e.fillFrom,e.fillTo]);return{linearGradient:{x1:0,y1:0,x2:1,y2:0},stops:[[0,t],[1,n]]}})({fillFrom:a.RR.fillFrom,fillTo:a.RR.fillTo}),lineWidth:0,zIndex:0,showInLegend:!1,marker:{enabled:!1},states:c,boostThreshold:u}),p=e=>({type:"line",id:e.id,name:e.name,data:e.data,color:a.RR.line,dashStyle:"Dash",lineWidth:2,zIndex:4,marker:d(a.RR.line),states:s,boostThreshold:u}),y=e=>({type:"area",id:e.id,name:e.name,data:e.data,color:e.color,lineWidth:3,threshold:null,fillColor:(e=>({linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,l(e.color,e.intenseOpacity)],[e.fadeExtent,l(e.fadeTo,0)]]}))({color:e.color,intenseOpacity:a.NS.intenseOpacity,fadeExtent:a.NS.fadeExtent,fadeTo:a.NS.fadeTo}),zIndex:3,marker:d(e.color),states:s,boostThreshold:u})},7712:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(12115),r=n(15927),o=n(76778);let i=e=>{let{fragmentIdentifier:t}=(0,r.a)(),n=a.useRef(new Map),i=a.useRef(new Map),l=a.useRef(new Set),s=(0,o.K)(()=>{if(!t||l.current.has(t))return;let a=n.current.get(t);a&&(a.scrollIntoView(e),l.current.add(t))}),c=(0,o.K)(e=>{let t=i.current.get(e);if(t)return t;let a=t=>{t?(n.current.set(e,t),s()):n.current.delete(e)};return i.current.set(e,a),a});return a.useEffect(()=>{s()},[t,s]),c}},7800:(e,t,n)=>{n.d(t,{L:()=>m});var a=n(12115),r=n(33624),o=n(6976),i=n(8921),l=n(74547),s=n(31260),c=n(85543),d=n(62346),u=n(55602);let m=(e,t)=>
3{let{launchDeferredPortfolioManagementPrompt:n}=(0,u.M)(),{preferredCurrency:m}=(0,s.yf)(),[p,y]=a.useState(e),[h]=(0,l.mN)(),f=(0,o.mq)(),g=(0,o.y6)(),{data:v=[]}=(0,d.Iu)(),x=async()=>{await h.validateFields();let e=h.getFieldsValue(!0),a={realEstateDetail:{...null==p?void 0:p.realEstateDetail,...e.realEstateDetail},mortgageDetail:{...null==p?void 0:p.mortgageDetail,...e.mortgageDetail}},o=(0,c.SG)(v),i=r.Ime(o)&&(0,c.Lh)(a.realEstateDetail);a&&await g.mutateAsync(a,{onSuccess:async()=>{await (null==t?void 0:t()),i&&n(!0)}})};return{form:h,comprehensiveRealEstateUpsertMutation:g,upsertableComprehensiveRealEstateItem:p,setUpsertableComprehensiveRealEstateItem:y,handleRealEstateValuesChange:()=>{let e=h.getFieldsValue(!0),t=(0,c.vZ)(e.realEstateDetail,{defaultCurrency:m}),{additionalDetail:n}=e.realEstateDetail||{},a=n.rentalProperty?n.monthlyRentalIncome:null;h.setFieldsValue({realEstateDetail:{...e.realEstateDetail,currency:t,additionalDetail:{...n,monthlyRentalIncome:a}},mortgageDetail:{...e.mortgageDetail,currency:t}})},handleRealEstateDetailsSubmit:x,handleDeleteRealEstateDetails:async e=>{await f.mutateAsync(e,{onSuccess:()=>{(0,i.Ds)(i._n.Success,"Real Estate details has been successfully deleted")}})}}}},7895:(e,t,n)=>{n.d(t,{Ad:()=>c,Px:()=>d,gH:()=>u});var a=n(12115),r=n(62212),o=n(90772),i=n(4603),l=n(39510),s=n(26214);let c=18e4,d=6e4,u=e=>{var t;let{queryKey:n,isWaitingForSocket:d,diagnosticLabel:u,onRetrigger:m,onPoll:p}=e,y=null!=(t=e.initialPollMs)?t:c,h=(0,r.j)(),[f,g]=a.useState(!1),[v,x]=a.useState(0),A=JSON.stringify(n),S=(0,l.RS)(s.mr.SnapshotPollingDisabled),b=a.useRef(m),C=a.useRef(p),I=a.useRef(f);a.useEffect(()=>{b.current=m,C.current=p,I.current=f});let w=a.useRef(!1),P=a.useRef(!1);return a.useEffect(()=>{if(!d)return;let e=window.setTimeout(()=>{console.warn("[".concat(u,"] socket wait timeout — surfacing error so user can Retry"),{queryKey:n,timeoutMs:9e5}),(0,o.sx)(i.TelemetryEvent.SnapshotComputeTimeout,{namespace:u,timeoutMs:9e5}),g(!0)},9e5);return()=>window.clearTimeout(e)},[d,A,u,v]),a.useEffect(()=>{g(!1)},[d,A]),a.useEffect(()=>{P.current&&!d&&w.current&&(0,o.sx)(i.TelemetryEvent.SnapshotComputePollRecovered,{namespace:u}),P.current=d,d||(w.current=!1)},[d,u]),a.useEffect(()=>{if(!d||S)return;let e=!1,t=null,a=y,r=()=>{e||(console.info("[".concat(u,"] socket-wait poll — re-querying for settled snapshot"),{queryKey:n,intervalMs:a}),w.current=!0,C.current?C.current():h.invalidateQueries(n),a=Math.min(2*a,9e5),t=window.setTimeout(r,a))};return t=window.setTimeout(r,a),()=>{e=!0,null!==t&&window.clearTimeout(t)}},[d,A,u,S,v,y]),{hasTimedOut:f,retrigger:a.useCallback(()=>{if((0,o.sx)(i.TelemetryEvent.SnapshotComputeRetryClicked,{namespace:u,hadTimedOut:I.current}),g(!1),x(e=>e+1),b.current)return void b.current();h.setQueryData(n,null),h.invalidateQueries(n)},[A,u])}}},8106:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(50202),r=n(12115),o=n(33624),i=n(79768);let l=()=>{let{portfoliosList:e}=(0,a.RW)(),t=(0,i.rA)();return{refreshUserPortfolios:r.useCallback(async()=>{await Promise.all(o.TjK(e=>t({portfolioId:e.portfolioId,portfolioType:e.portfolioType}),e))},[e,t])}}},8305:(e,t,n)=>{n.d(t,{$1:()=>m,FY:()=>v,JT:()=>f,L2:()=>u,Q_:()=>y,VV:()=>g,pT:()=>p,tH:()=>h});var a=n(57090),r=n(12115),o=n(73590),i=n.n(o),l=n(32189),s=n(59268),c=n(6497),d=n(54519);let u={[l.x5.RiskMatch]:"How closely your current risk matches your risk preference",[l.x5.SharpeRatio]:"How much reward you get for the risk you are taking with your portfolio.",[l.x5.DownsideProtection]:"Minimizing portfolio loss in extreme economic conditions."},m={[l.x5.RiskMatch]:{[l.Qr.Poor]:"Your portfolio risk differs significantly from your preference",[l.Qr.NeedsWork]:"Your portfolio risk differs from your preference",[l.Qr.Good]:"Your portfolio risk is almost at your preference",[l.Qr.Great]:"Your portfolio risk matches your preference well"},[l.x5.SharpeRatio]:{[l.Qr.Poor]:"You can be earning higher returns at your current level of risk",[l.Qr.NeedsWork]:"There’s room to improve returns without taking more risk",[l.Qr.Good]:"You’re getting reasonable returns for your risk",[l.Qr.Great]:"You're earning exceptional returns for your level of risk"},[l.x5.DownsideProtection]:{[l.Qr.Poor]:"Your portfolio could be more resilient without reducing risk",[l.Qr.NeedsWork]:"Your portfolio could be more resilient without reducing risk",[l.Qr.Good]:"Your portfolio is resilient across a range of economic outcomes",[l.Qr.Great]:"Your portfolio is highly resilient for your chosen risk level"}},p={[l.x5.RiskMatch]:{title:"Risk Match",description:(0,a.Y)("div",{children:u[l.x5.RiskMatch]})},[l.x5.SharpeRatio]:{title:"Risk-adjusted Return",description:(0,a.Y)("div",{children:u[l.x5.SharpeRatio]})},[l.x5.DownsideProtection]:{title:"Downside Protection",description:(0,a.Y)("div",{children:u[l.x5.DownsideProtection]})}},y=e=>{let t=e?" since ".concat(i()(e,"YYYY-MM-DD").format("MMM YYYY")):"";return"Average yearly return of your current holdings".concat(t,". Based on price history; past results are not a guarantee.")},h="Projected annual return for your current holdings over the next 12 months. An estimate, not a guarantee.",f={"Cash investable":'Cash investable is the sum of all Cash and Cash equivalent (e.g. Money market funds) in self-directed investing accounts, plus any amount in cash accounts explicitly marked as "Investable"',"Expected returns":(0,a.FD)(r.Fragment,{children:["The expected total annual return of your portfolio over the next 12 months, including price appreciation and income (dividends and interest), net of estimated fees. Based on PortfolioPilot's forward-looking forecasts using a combination of advanced financial models."," ",(0,a.Y)(c.$,{href:d.Ay.methods,children:"Learn more about our methodology"})]}),"Dividend & fixed income":"Estimated annual income from your portfolio, including dividends from stocks and interest from bonds, money market funds, and other fixed income investments."},g=(0,a.FD)(r.Fragment,{children:["The Sharpe Ratio measures the performance of an investment or portfolio in excess of the risk free rate, adjusted for its risk. A negative Sharpe Ratio means you aren't being well-compensated for the risk you are taking. For passive investors a Sharpe Ratio of 0.5 is very good, though active investors may be able to attain higher performance. ",(0,a.Y)(s.Y,{})]}),v="The annual dividend payment as a percentage of the security's price"},8441:(e,t,n)=>{n.d(t,{E:()=>p,P:()=>m});var a=n(33624),r=n(16528),o=n(41491),i=n(12115),l=n(83910),s=n(33815),c=n(7802),d=n(50127),u=n(50202);let m=()=>{let{isDemoMode:e,demoPortfolio:t}=(0,o._)(),{userProvidedCurrentPortfolios:n}=(0,u.RW)(),{isMainPortfolioPossiblyIncomplete:c,isStatusLoaded:d}=(0,s.F)(),{isDemoRemovalPromptSuppressed:m,suppressDemoRemovalPrompt:p}=(()=>{let[e,t]=(0,l.Ay)(l.Hh.SuppressRemoveDemoPortfolioPrompt,!1);return{isDemoRemovalPromptSuppressed:a.aIS(!0,e),suppressDemoRemovalPrompt:i.useCallback(()=>{t(!0)},[])}})(),y=r.A(n);return{showPrompt:!!(d&&!c&&e&&y&&!m),suppressDemoRemovalPrompt:p,demoPortfolio:t}},p=()=>{let{isDemoMode:e}=(0,o._)(),[t]=(0,i.useState)(()=>e),{launchDemoPortfolioRemovalHandler:n}=(0,d.B)();return{isDemoModeBeforeImport:t,runPossibilityFlow:e=>{let r=a.aIS(e,c.in.FlaggedImportWithDemoAcceptance);t&&!r&&n()}}}}
3,8662:(e,t,n)=>{n.d(t,{T:()=>i,W:()=>o});var a=n(84245),r=n(99026);let o=e=>(0,r.TN)(e.getQueryData(a.nm)),i=(e,t)=>(0,r.TN)(e.getQueryData((0,a.pR)(t)))},8675:(e,t,n)=>{n.d(t,{$y:()=>p,_j:()=>d,nQ:()=>c,nb:()=>u,nu:()=>s,wE:()=>l,y0:()=>m});var a=n(57090);n(12115);var r=n(92672),o=n(36934),i=n(41784);let l=e=>{let{children:t,className:n}=e;return(0,a.Y)("div",{className:(0,i.cn)("p-[20px_10px] rounded-lg bg-white mb-5","[&_.portfolioCashHoldings-CashContainer]:font-medium [&_.portfolioCashHoldings-CashContainer]:text-base [&_.portfolioCashHoldings-CashContainer]:leading-6 [&_.portfolioCashHoldings-CashContainer]:text-neutral-500","[&_.portfolio-details-cash]:pb-0",n),"data-sentry-component":"PortfolioDetailsContainer","data-sentry-source-file":"atoms.tsx",children:t})},s=e=>{let{className:t,...n}=e;return(0,a.Y)(r.Ah,{className:(0,i.cn)("p-5 sm:p-[20px_10px] rounded-lg bg-white mb-5",t),...n,"data-sentry-element":"FlexLayout","data-sentry-component":"OtherNetWorthContainer","data-sentry-source-file":"atoms.tsx"})},c=e=>{let{children:t,className:n}=e;return(0,a.Y)("div",{className:(0,i.cn)("font-medium text-xl",n),"data-sentry-component":"PortfolioDetailsTitle","data-sentry-source-file":"atoms.tsx",children:t})},d=e=>{let{children:t,className:n}=e;return(0,a.Y)("div",{className:(0,i.cn)(o.gI.body2W400,"text-body",n),"data-sentry-component":"StatItemLabel","data-sentry-source-file":"atoms.tsx",children:t})},u=e=>{let{className:t,...n}=e;return(0,a.Y)(r.Ah,{className:(0,i.cn)(o.gI.h4W700,"text-body",t),justifyContent:"flex-start",alignItems:"center",...n,"data-sentry-element":"FlexLayout","data-sentry-component":"StatItemValue","data-sentry-source-file":"atoms.tsx"})},m=e=>{let{children:t,className:n}=e;return(0,a.Y)("div",{className:(0,i.cn)("flex w-full justify-between items-center pb-6",n),"data-sentry-component":"DetailsHeader","data-sentry-source-file":"atoms.tsx",children:t})}
3,p=e=>{let{children:t,className:n}=e;return(0,a.Y)("div",{className:(0,i.cn)("flex items-center font-normal text-sm gap-x-2",n),"data-sentry-component":"AggregatedSwitchContainer","data-sentry-source-file":"atoms.tsx",children:t})}},8830:(e,t,n)=>{n.d(t,{X:()=>a,m:()=>r});var a=function(e){return e.CopyPaste="CopyPaste",e}({}),r=function(e){return e.AddSecuritiesAllAtOnce="Add securities all at once",e.SecuritiesImport="Securities import",e}({})},8978:(e,t,n)=>{n.d(t,{DL:()=>o,He:()=>i,c:()=>r});var a=n(87449);let r=[a.Oi.Companies,a.Oi.Cryptocurrencies,a.Oi.ETFOrMutualFund,a.Oi.ETFs,a.Oi.MutualFunds,a.Oi.OtherSecurities,a.Oi.Reit];var o=function(e){return e.Performance="Performance",e.Forecast="Forecast",e.FundInfo="Fund info",e.Profile="Profile",e.MacroSensitivity="Macro sensitivity",e.Valuation="Valuation",e.Events="Events",e.RelatedSecurities="Related securities",e.News="News",e}({}),i=function(e){return e.ExpectedReturns="12-month exp. returns",e.Beta="Beta",e.Risk="Risk",e.SharpeRatio="Sharpe Ratio",e}({})},9009:(e,t,n)=>{n.d(t,{H:()=>l,n:()=>i});var a=n(57090),r=n(12115);let o=r.createContext(null),i=e=>{let{children:t}=e,n=r.useRef(new Map),i=r.useCallback((e,t)=>{n.current.set(e,t)},[]),l=r.useCallback(e=>{n.current.delete(e)},[]),s=r.useCallback(()=>n.current.size>0,[]),c=r.useCallback(()=>0===n.current.size||confirm(n.current.values().next().value),[]),d=r.useMemo(()=>({registerGuard:i,unregisterGuard:l,checkNavigation:c,hasActiveGuards:s}),[i,l,c,s]);return(0,a.Y)(o.Provider,{value:d,"data-sentry-element":"unknown","data-sentry-component":"NavigationGuardProvider","data-sentry-source-file":"NavigationGuardContext.tsx",children:t})},l=()=>r.useContext(o)},9318:(e,t,n)=>{n.d(t,{A:()=>v,U:()=>g});var a=n(57090),r=n(12115),o=n(50202),i=n(81255),l=n(8921),s=n(75433),c=n(25373),d=n(31133),u=n(74547),m=n(43948),p=n(84245),y=n(544),h=n(81671);let{useNext1000DollarsRecommendationsComputedListener:f,emitNext1000DollarsRecommendationsComputed:g}=(0,m.createEvent)("Next1000DollarsRecommendationsComputed")(),v=()=>{let{activePortfolioId:e,portfoliosList:t}=(0,o.RW)(),n=(0,d.h)(),{isUserOnNext1000DollarsRecommendationsPage:m}=(0,i.A)(),g=r.useRef(null);return f(r=>{if(r.portfolioId!==e||m)return;let o=(0,y.Fk)(t,r.portfolioId),i=null==o?void 0:o.portfolioName,d=(0,a.Y)(u.$n,{size:"sm",variant:"outlined",color:"success",onClick:async()=>{await (0,c.ST)(n.current,s.gk.WhereToInvestNext1000),g.current&&(0,l.yk)(g.current)},children:"View"});g.current=(0,l.Ds)(l._n.Success,"Next $1000 recommendations ready for '".concat(i,"'"),{duration:p.gz.cacheTime,action:d,icon:(0,a.Y)(u.In,{icon:h.$.Sparkle2,size:24})})}),null}},9925:(e,t,n)=>{n.d(t,{D:()=>l});var a=n(62212),r=n(17667),o=n(80067),i=n(70890);let l=()=>{let e=(0,a.j)();return(0,r.A)(async e=>{let{portfolioId:t}=await (0,o._x)({portfolioName:e.portfolioName,portfolioDescription:e.portfolioDescription,sourcePortfolioId:e.sourcePortfolioId,creationScenario:e.creationScenario});return{clonedDraftPortfolioId:t}},{onSuccess:async(t,n)=>{var a;await (0,i.SZ)(e),await (null==(a=n.onSuccessCallback)?void 0:a.call(n,t))},onErrorMessage:e=>e})}},9932:(e,t,n)=>{n.d(t,{J:()=>r,w:()=>a});let a=Object.freeze({__snapshotFailure:!0}),r=e=>e===a},9974:(e,t,n)=>{n.d(t,{$Y:()=>a,KH:()=>r,So:()=>o,sp:()=>i});let a=0,r=e=>null!=e&&e>a,o=e=>{if(!e||"string"!=typeof e)return a;let t=Number(e);return Number.isInteger(t)&&r(t)?t:a},i=e=>r(e)?e.toString():void 0},10090:(e,t,n)=>{n.d(t,{B:()=>s});var a=n(12115),r=n(33815),o=n(81255),i=n(68658);let l={showWarning:!1,metadata:null},s=()=>{let{isUserInOnboarding:e}=(0,o.A)(),{getMainPortfolioFreshIncompleteStatus:t,incompletePortfolioWarningSnapshot:n,launchWarning:s,closeWarning:c}=(()=>{let{getMainPortfolioFreshIncompleteStatus:e}=(0,r.F)(),{incompletePortfolioWarningSnapshot:t,launchWarning:n,closeWarning:o}=(()=>{let[e,t]=a.useState(l);return{incompletePortfolioWarningSnapshot:e,launchWarning:e=>{t({showWarning:!0,metadata:e})},closeWarning:()=>{t(l)},resetWarning:()=>{t(l)}}})();return{getMainPortfolioFreshIncompleteStatus:e,incompletePortfolioWarningSnapshot:t,launchWarning:n,closeWarning:o}})(),d=(0,i.S)(e);return{getSuppressedWarningMetadata:async()=>d.current?null:await t(),incompletePortfolioWarningSnapshot:n,launchWarning:s,closeWarning:c}}}
3,10098:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(57090),r=n(12115),o=n(74547),i=n(36934),l=n(84978),s=n(88179);let c=[{value:l.hJ.UpdateWithMarket,label:"Update with market"},{value:l.hJ.KeepAsEntered,label:"Keep as entered"}],d={[l.hJ.UpdateWithMarket]:"Moves with a comparable market index between your updates",[l.hJ.KeepAsEntered]:"Stays as entered until you change it"},u=e=>{var t;let n=null!=(t=e.value)?t:l.hJ.UpdateWithMarket;return(0,a.FD)(r.Fragment,{children:[(0,a.Y)(o.tU,{size:"sm",selectedKey:n,onSelectionChange:t=>{var n;null==(n=e.onChange)||n.call(e,t)},"aria-label":"Value updates","data-sentry-element":"Tabs","data-sentry-source-file":"NetworthValueUpdateModeField.tsx",children:c.map(e=>(0,a.Y)(o.oz,{title:e.label},e.value))}),(0,a.Y)(i.km,{className:"text-neutral-500 mt-1 block","data-sentry-element":"Body2W400","data-sentry-source-file":"NetworthValueUpdateModeField.tsx",children:d[n]})]})},m=e=>(0,a.Y)(s.JF,{name:e.name,label:(0,a.Y)(i.km,{className:"text-neutral-500",children:"Value updates"}),"data-sentry-element":"FormItem","data-sentry-component":"NetworthValueUpdateModeField","data-sentry-source-file":"NetworthValueUpdateModeField.tsx",children:(0,a.Y)(u,{"data-sentry-element":"NetworthValueUpdateModeSwitch","data-sentry-source-file":"NetworthValueUpdateModeField.tsx"})})},10102:(e,t,n)=>{n.d(t,{t:()=>l});var a=n(12115),r=n(33624),o=n(38484),i=n(14530);let l=()=>{let{data:e=[]}=(0,o.lT)(),{data:t=[]}=(0,o.A$)(),{data:n=[]}=(0,o.X_)(),{data:l=[]}=(0,o.Lu)(),{data:s=[]}=(0,o.a9)(),c=a.useMemo(()=>(0,i.WJ)(l),[l]),d=a.useMemo(()=>(0,i.WJ)(e),[e]),u=a.useMemo(()=>(0,i.WJ)(t),[t]),m=a.useMemo(()=>r.TjK(e=>{let{commonName:t,countryCode:n}=e;return{label:t,value:n}},n),[n]),p=a.useMemo(()=>r.TjK(e=>{let{commonName:t,countryCode:n}=e;return{label:t,value:n}},s),[s]);return{securityAssetClasses:e,securitySectors:t,securityCountries:n,countriesAlphaThree:s,securityAssetClassesOptions:d,securitySectorsOptions:u,securityCountriesOptions:m,countriesAlphaThreeOptions:p,securityBondTypesOptions:c}}},10320:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(88963),r=n(62031),o=n.n(r),i=n(13125),l=n.n(i);class s{constructor(){this.getNetworthDetails=async()=>{let e=await this.apiCaller.get("/net_worth/get_net_worth_details");return o()(e,{deep:!0})},this.upsertNetWorth=async e=>await this.apiCaller.post("/net_worth/upsert_net_worth",l()(e,{deep:!0})),this.addNewRealEstateDetail=async e=>{let t=await this.apiCaller.post("/net_worth/add_real_estate_net_worth",l()(e));return o()(t,{deep:!0})},this.searchPropertyAddress=async e=>{let t=await this.apiCaller.post("/net_worth/search_property_address",{query:e});return o()(t,{deep:!0}).suggestions},this.lookupPropertyValue=async e=>{let t=await this.apiCaller.post("/net_worth/property_value_lookup",l()({providerPropertyId:e}));return o()(t,{deep:!0})},this.syncNetWorthOfAsaUsers=async()=>await this.apiCaller.post("/net_worth/sync_net_worth_of_asa_users",{}),this.deleteNetWorthItem=async e=>await this.apiCaller.post("/net_worth/delete_net_worth",l()({netWorthItemId:e})),this.apiCaller=new a.Ay}}let c=new s},10349:(e,t,n)=>{n.d(t,{A:()=>M});var a=n(57090),r=n(12115),o=n(90521),i=n(8921),l=n(80067),s=n(99026),c=n(98870),d=n(9009),u=n(95825),m=n(40248),p=n(48045),y=n(28649);let h=e=>(0,a.Y)(u.Ay,{title:y.qW,centered:!0,open:!0,destroyOnClose:!0,closable:!1,maskClosable:!1,keyboard:!0,onCancel:e.onIgnore,size:u.rI.Sm,footer:(0,a.FD)(u.jl,{children:[(0,a.Y)(m.A,{onClick:e.onReturn,variant:"outlined",children:"Back"}),(0,a.Y)(m.A,{onClick:e.onProceedWithPortfolio,variant:"outlined",children:"Continue anyway"}),(0,a.Y)(p.U,{initiatorRenderer:(e,t)=>(0,a.Y)(m.A,{onClick:e,variant:"filled",loading:t,children:"Use Demo portfolio instead"}),onAccepted:e.onDemoPortfolioAccepted,onRejected:e.onDemoPortfolioRejected})]}),"data-sentry-element":"Modal","data-sentry-component":"IncompleteManualPortfolioWarning","data-sentry-source-file":"IncompleteManualPortfolioWarning.tsx",children:(0,a.Y)(y.n6,{warningData:e.warningData,nextStep:y.Ln,"data-sentry-element":"WarningDescription","data-sentry-source-file":"IncompleteManualPortfolioWarning.tsx"})});var f=n(66909),g=n(68076),v=n(62212),x=n(70890),A=n(32189),S=n(4603);let b={portfolioName:"",taxTreatment:A.MG.Taxable,isExternallyManaged:!1,portfolioDescription:"Manual Input Portfolio",portfolioType:A.N$.Current,source:A.g6.Manual,creationScenario:S.PortfolioCreationScenario.Manual};var C=n(24771),I=n(17170),w=n(17123),P=function(e){return e.SetCreatedPortfolioId="SET_CREATED_PORTFOLIO_ID",e.SetCreatedPortfolio="SET_CREATED_PORTFOLIO",e.OpenManageInvestmentsDrawer="OPEN_MANAGE_INVESTMENTS_DRAWER",e.CloseManageInvestmentsDrawer="CLOSE_MANAGE_INVESTMENTS_DRAWER",e.CloseIncompletePortfolioWarning="CLOSE_INCOMPLETE_PORTFOLIO_WARNING",e.SuccessfulInvestmentsCapture="SUCCESSFUL_INVESTMENTS_CAPTURE",e.SwitchToPortfolioEditor="SWITCH_TO_PORTFOLIO_EDITOR",e.Reset="RESET",e}({});
3let k={createdPortfolioId:null,createdPortfolio:null,showEditInvestmentsDrawer:!1,showIncompletePortfolioWarning:!1},F=(e,t)=>{switch(t.type){case"SET_CREATED_PORTFOLIO_ID":return{...e,...k,createdPortfolioId:t.payload};case"SET_CREATED_PORTFOLIO":return{...e,createdPortfolio:t.payload};case"OPEN_MANAGE_INVESTMENTS_DRAWER":case"SWITCH_TO_PORTFOLIO_EDITOR":return{...e,showEditInvestmentsDrawer:!0};case"CLOSE_MANAGE_INVESTMENTS_DRAWER":case"SUCCESSFUL_INVESTMENTS_CAPTURE":return{...e,showEditInvestmentsDrawer:!1};case"RESET":return e.form.resetFields(),{...e,...k};default:throw Error("Unhandled action type")}};var T=n(10090),E=n(74278),Y=n(67759),D=n(6915),R=function(e){return e.GarbageCollectAbandoned="garbageCollectAbandoned",e.Finalize="finalize",e}({}),N=function(e){return e.IncompleteWarning="incompleteWarning",e.Success="success",e}({});let M=e=>{let{form:t,createdPortfolio:u,createdPortfolioId:m,showEditInvestmentsDrawer:p,dispatch:y,closeManageInvestmentsDrawer:A}=(()=>{let{form:e}=(0,w.mu)(),[t,n]=r.useReducer(F,{form:e,...k});return{...t,dispatch:n,closeManageInvestmentsDrawer:()=>n({type:"CLOSE_MANAGE_INVESTMENTS_DRAWER"})}})(),{isGuestSession:M}=(0,D.Cs)();!function(e){let t="Do you want to save before leaving the page?",a=r.useId(),o=(0,d.H)();r.useEffect(()=>{if(o)return e?o.registerGuard(a,t):o.unregisterGuard(a),()=>{o.unregisterGuard(a)}},[e,a,o]),r.useEffect(()=>{if(e){let e,a=e=>(e.preventDefault(),e.returnValue=t,t),r=()=>{confirm(t)||window.history.pushState(null,"",window.location.href)};return window.history.pushState(null,"",window.location.href),window.addEventListener("beforeunload",a),window.addEventListener("popstate",r),Promise.resolve().then(n.bind(n,68458)).then(n=>{let{default:a,Router:r}=n;if(a.router){let n=a.router,o=r.prototype.change;n.change=function(){for(var e=arguments.length,a=Array(e),r=0;r<e;r++)a[r]=arguments[r];return confirm(t)?o.apply(n,a):Promise.resolve(!1)},e=()=>{a.router&&delete a.router.change}}}).catch(()=>{}),()=>{window.removeEventListener("beforeunload",a),window.removeEventListener("popstate",r),null==e||e()}}window.onbeforeunload=c.A},[e])}(!!m);let L=(0,o.dR)(),_=(0,o.GT)(),O=(0,v.j)(),{getSuppressedWarningMetadata:W,incompletePortfolioWarningSnapshot:B,launchWarning:U,closeWarning:z}=(0,T.B)(),V=B.showWarning,j=async e=>{let t=await (0,l.hL)(e);return y({type:P.SetCreatedPortfolio,payload:t}),t},H=()=>{var t;y({type:P.Reset}),null==(t=e.onWorkflowEnded)||t.call(e)},q=async e=>{await j(e),y({type:P.OpenManageInvestmentsDrawer}),await (0,s.yy)(3e3)},G=()=>{(0,Y.trackManualPortfolioCreated)({event:S.ManualPortfolioEvent.InvestmentsUploaded}),(0,i.Ds)(i._n.Success,"Portfolio saved"),m&&e.onCloseAfterSuccess(m),H()},K=async(e,t)=>{A(),await _.mutateAsync({portfolioId:e,suppressNotification:null==t?void 0:t.suppressNotification})},Q=e=>{M||(console.error(e.errorReason),(0,i.Ds)(i._n.Error,e.notificationErrorMessage)),H()},$=async e=>{A();let t=await (0,l.S_)(e);return t&&await Promise.all([(0,x.A9)(O),(0,x.yU)(O,e)]),t},X=async(e,t)=>{try{if((t.isPortfolioInvestmentsChanged?"finalize":"garbageCollectAbandoned")===R.GarbageCollectAbandoned&&await $(e)){(0,i.Ds)(i._n.Info,"No investments added, try again"),H();return}await j(e);let n=await W();((null==n?void 0:n.isIncomplete)?"incompleteWarning":"success")===N.IncompleteWarning?(A(),U(n.metadata)):G()}catch(e){Q({errorReason:"Error occurred while finalizing manual portfolio entry, ".concat(e),notificationErrorMessage:"Internal error occurred"})}},J=async()=>{let{createdPortfolioId:e}=await L.mutateAsync(b);y({type:P.SetCreatedPortfolioId,payload:e}),await q(e)},Z=async()=>{try{await J(),(0,Y.trackManualPortfolioCreated)({event:S.ManualPortfolioEvent.SlideoverOpened})}catch(t){let e=(0,f.u)(t);Q({errorReason:"Manual Entry Portfolio creation failed: ".concat(e),notificationErrorMessage:"Internal error occurred"})}},ee={form:t,showEditConfirmationIfPropertiesChanged:!1,shareAmountTableFor:E.n.ManualPortfolioAdd};return(0,a.FD)(r.Fragment,{children:[e.render(Z),(0,a.Y)(I.X.Provider,{value:ee,"data-sentry-element":"unknown","data-sentry-source-file":"ManualPortfolioInputLauncher.tsx",children:p&&(()=>{if(!u)return A(),Q({errorReason:"Manual Entry Portfolio flow is aborted due to non-availability of portfolio",notificationErrorMessage:"Failure in o
3pening Manual Portfolio"}),null;{let e="".concat(u.portfolioId);return(0,a.Y)(C.A,{form:t,visible:!V,activePortfolio:u,title:"Manually enter account securities",onClose:async e=>await X(u.portfolioId,e),handleFlowError:Q},e)}})()}),V&&(()=>{let e=async()=>{m&&await (0,x.yU)(O,m),z(),y({type:P.SwitchToPortfolioEditor})},t=async()=>{m?(await K(m),z(),H()):Q({errorReason:"Demo portfolio creation during manual portfolio flow is aborted due to non-availability of portfolio",notificationErrorMessage:"Failed to remove manually uploaded portfolio"})};if(m){if(V&&B.metadata)return(0,a.Y)(h,{warningData:{type:g.h.ManualInput,metadata:B.metadata},onReturn:e,onIgnore:e,onProceedWithPortfolio:()=>{z(),G()},onDemoPortfolioAccepted:t,onDemoPortfolioRejected:e})}else Q({errorReason:"Manual Entry Portfolio incomplete data flow is aborted due to non-availability of portfolio",notificationErrorMessage:"Failed to create Manual Portfolio"});return null})()]})}},10388:(e,t,n)=>{n.d(t,{J9:()=>g,aG:()=>y,ie:()=>h,j2:()=>A,on:()=>p,wv:()=>x});var a=n(57090),r=n(12115),o=n(33624),i=n(54519),l=n(38738),s=n(98804),c=n(84455),d=n(78190),u=n(18069),m=n(39715);let p={Preferences:["EstatePlanning","Preferences"]},y=Object.freeze({[l.PR.LastWillAndTestament]:{title:"Last will and testament",description:"Ensure you have a legally binding will in place.",articles:[{heading:"Understanding the Legal Requirements for a Valid Will",url:i.Ay.resources.estatePlanning.understandingTheLegalRequirementsForAValidWill},{heading:"Common Mistakes to Avoid When Writing Your Will",url:i.Ay.resources.estatePlanning.commonMistakesToAvoidWhenWritingYourWill},{heading:"How to Write a Last Will and Testament",url:i.Ay.resources.estatePlanning.howToWriteALastWillAndTestament}],template:{title:"Will preparation workbook",description:"Your decisions, organized before you write the will",publisher:"Planning AHEAD, UW-Madison Extension",url:i.Ay.estatePlanningTools.templates.willPreparationWorkbook},tools:[{name:"FreeWill",description:"Make a legally valid will online",priceLabel:"Free",priceTone:l.XW.Free,url:i.Ay.estatePlanningTools.tools.freeWill},{name:"Trust & Will",description:"Guided, state-specific will with unlimited updates",priceLabel:"$100–$300",priceTone:l.XW.Paid,url:i.Ay.estatePlanningTools.tools.trustAndWill},{name:"LegalZoom",description:"DIY will, attorney help optional",priceLabel:"$100–$300",priceTone:l.XW.Paid,url:i.Ay.estatePlanningTools.tools.legalZoomWill}]},[l.PR.DesignatedBeneficiaries]:{title:"Designated beneficiaries",description:"Update beneficiary designations on accounts like life insurance, retirement plans, and bank accounts.",articles:[{heading:"How to Handle Conflicts Between Beneficiaries",url:i.Ay.resources.estatePlanning.howToHandleConflictsBetweenBeneficiaries},{heading:"How to Designate and Update Beneficiaries",url:i.Ay.resources.estatePlanning.howToDesignateAndUpdateBeneficiaries},{heading:"What Is a Contingent Beneficiary in Estate Planning?",url:i.Ay.resources.estatePlanning.whatIsAContingentBeneficiaryInEstatePlanning}],template:{title:"Beneficiary audit worksheet",description:"Every account and its current beneficiary, in one table",publisher:"Rutgers Cooperative Extension",url:i.Ay.estatePlanningTools.templates.beneficiaryAuditWorksheet},tools:[{name:"Everplans",description:"Guided organizer for beneficiary and account info",priceLabel:"$0–$100 a year",priceTone:l.XW.Paid,url:i.Ay.estatePlanningTools.tools.everplans},{name:"Trustworthy",description:"Secure home for IDs, insurance, and legal docs",priceLabel:"$0–$40 a month",priceTone:l.XW.Paid,url:i.Ay.estatePlanningTools.tools.trustworthy}]},[l.PR.AdvanceHealthcareDirective]:{title:"Living will (advance health care directive)",description:"Document your wishes for medical treatment in case you become incapacitated.",articles:[{heading:"Living Will vs. Advance Healthcare Directive: Understanding the Differences",url:i.Ay.resources.estatePlanning.livingWillVsAdvanceHealthcareDirective},{heading:"Advance Healthcare Directive: Key Steps You Need to Know",url:i.Ay.resources.estatePlanning.creatingAnAdvanceHealthcareDirectiveWhatYouNeedToKnow},{heading:"How to Share Your Healthcare Wishes with Family & Doctors",url:i.Ay.resources.estatePlanning.howToCommunicateYourHealthcareWishesToFamilyAndDoctors}],template:{title:"Your state's advance directive form",description:"The official form your state recognizes",publisher:"CaringInfo, free forms for every state",url:i.Ay.estatePlanningTools.templates.stateAdvanceDirectiveForms},tools:[{name:"Five Wishes",description:"A widely used advance directive",priceLabel:"Under $10",priceTone:l.XW.Paid,url:i.Ay.estatePlanningTools.tools.fiveWishes},{name:"MyDirectives",description:"A care plan your doctors can access",priceLabel:"Free",priceTone:l.XW.Free,url:i.Ay.estatePlanningTools.tools.myDirectives},{name:"PREPARE for Your Care",description:"Step-by-step planning from UCSF",priceLabel:"Free",priceTone:l.XW.Free,url:i.Ay.estatePlanningTools.tools.prepareForYourCare}]},[l.PR.DigitalAssetsPlan]:{title:"Digital assets plan",description:"Make provisions for your digital assets, such as online accounts and digital files.",articles:[{heading:"How to Create a Digital Estate Plan",url:i.Ay.resources.estatePlanning.howToCreateADigitalEstatePlan},{heading:"Managing Your Online Accounts After Death",url:i.Ay.resources.estatePlanning.managingYourOnlineAccountsAfterDeath},{heading:"Estate Planning for Digital Assets",url:i.Ay.resources.estatePlanning.estatePlanningForDigitalAssets}],template:{title:"Digital assets inventory",description:"Every account, device, and file in one list",publisher:"Rutgers Cooperative Extension",url:i.Ay.estatePlanningTools.templates.digitalAssetsInventory},tools:[{name:"1Password",description:"Password manager with a family Emergency Kit",priceLabel:"$3–$6 a month",priceTone:l.XW.Paid,url:i.Ay.estatePlanningTools.tools.onePassword},{name:"Google Inactive Account Manager",description:"Decide who receives your Google data",priceLabel:"Free",priceTone:l.XW.Free,url:i.Ay.estatePlanningTools.tools.googleInactiveAccountManager},{name:"Apple Digital Legacy",description:"Name a Legacy Contact for your iCloud",priceLabel:"Free",priceTone:l.XW.Free,url:i.Ay.estatePlanningTools.tools.appleDigitalLegacy}]},[l.PR.SelectedGuardianForMinorChildren]:{title:"Guardian for minor children",description:"Decide who will care for your children if you can't.",articles:[{heading:"Cho
3osing a Guardian for Your Children",url:i.Ay.resources.estatePlanning.choosingAGuardianForYourChildren},{heading:"What to Consider When Selecting a Guardian",url:i.Ay.resources.estatePlanning.whatToConsiderWhenSelectingAGuardian},{heading:"How to Discuss Guardianship with Potential Guardians",url:i.Ay.resources.estatePlanning.howToDiscussGuardianshipWithPotentialGuardians}],template:{title:"Temporary guardianship form",description:"State-specific form for short-term care",publisher:"eForms, all 50 states",url:i.Ay.estatePlanningTools.templates.temporaryGuardianshipForm},tools:[{name:"FreeWill",description:"Name a guardian in a free online will",priceLabel:"Free",priceTone:l.XW.Free,url:i.Ay.estatePlanningTools.tools.freeWill},{name:"Fabric by Gerber Life",description:"5-minute will built for parents",priceLabel:"Free",priceTone:l.XW.Free,url:i.Ay.estatePlanningTools.tools.fabricByGerberLife},{name:"Trust & Will",description:"Appoint guardians in a guided will",priceLabel:"$100–$300",priceTone:l.XW.Paid,url:i.Ay.estatePlanningTools.tools.trustAndWill}]},[l.PR.LifeInsurance]:{title:"Life insurance",description:(0,a.Y)(r.Fragment,{children:"Ensure you have adequate coverage and updated beneficiaries to protect your family's financial future."}),articles:[{heading:"When Should You Get Life Insurance",url:"https://portfoliopilot.com/resources/posts/when-should-you-get-life-insurance"},{heading:"The Unbiased Guide to Getting Life Insurance",url:"https://portfoliopilot.com/resources/posts/the-unbiased-guide-to-getting-life-insurance"},{heading:(0,a.Y)(r.Fragment,{children:"What They Don't Tell You About Life Insurance"}),url:"https://portfoliopilot.com/resources/posts/what-they-dont-tell-you-about-life-insurance"}],template:{title:"Coverage needs worksheet",description:"How much coverage your family would need",publisher:"Synovus Bank",url:i.Ay.estatePlanningTools.templates.coverageNeedsWorksheet},tools:[{name:"Policygenius",description:"Compare term quotes across carriers",priceLabel:"Free quotes",priceTone:l.XW.Free,url:i.Ay.estatePlanningTools.tools.policygenius},{name:"Ladder",description:"Term life you can apply for online",priceLabel:"Free quotes",priceTone:l.XW.Free,url:i.Ay.estatePlanningTools.tools.ladder},{name:"Ethos",description:"No-exam term life for most applicants",priceLabel:"Free quotes",priceTone:l.XW.Free,url:i.Ay.estatePlanningTools.tools.ethos}]},[l.PR.LivingTrust]:{title:"Living trust",description:"Consider setting up a trust to manage your assets.",articles:[{heading:"Understanding Living Trusts: Benefits and Setup",url:i.Ay.resources.estatePlanning.understandingLivingTrustsBenefitsAndSetup},{heading:"Living Trust or Will: Which Is Right for You?",url:i.Ay.resources.estatePlanning.livingTrustOrWillWhichIsRightForYou},{heading:(0,a.Y)(r.Fragment,{children:"Revocable vs. Irrevocable Trusts: What's the Difference?"}),url:i.Ay.resources.estatePlanning.revocableVsIrrevocableTrustsWhatsTheDifference}],template:{title:"Trust planning workbook",description:"What goes in the trust and who manages it",publisher:"Utah State University Extension",url:i.Ay.estatePlanningTools.templates.trustPlanningWorkbook},tools:[{name:"Trust & Will",description:"Guided revocable living trust",priceLabel:"$400–$700",priceTone:l.XW.Paid,url:i.Ay.estatePlanningTools.tools.trustAndWill},{name:"LegalZoom",description:"Trust, pour-over will, and POA in one package",priceLabel:"$300–$600",priceTone:l.XW.Paid,url:i.Ay.estatePlanningTools.tools.legalZoomLivingTrust},{name:"GoodTrust",description:"All-in-one estate plan with digital vault",priceLabel:"$100–$300",priceTone:l.XW.Paid,url:i.Ay.estatePlanningTools.tools.goodTrust}]},[l.PR.EstateTaxImplications]:{title:"Estate tax plan",description:"Understand and plan for potential estate taxes.",articles:[{heading:"Strategies for Reducing Your Estate Tax Liability",url:i.Ay.resources.estatePlanning.strategiesForReducingYourEstateTaxLiability},{heading:"Inheritance Tax in California: What You Need to Know",url:i.Ay.resources.estatePlanning.inheritanceTaxInCaliforniaWhatYouNeedToKnow},{heading:"What Is an Estate?",url:i.Ay.resources.estatePlanning.whatIsAnEstate}
3],template:{title:"Estate inventory worksheet",description:"Everything you own and owe, sized for estate tax",publisher:"T. Rowe Price",url:i.Ay.estatePlanningTools.templates.estateInventoryWorksheet},tools:[{name:"ProjectionLab",description:"Model estate tax, gifting, and charitable giving",priceLabel:"$0–$150 a year",priceTone:l.XW.Paid,url:i.Ay.estatePlanningTools.tools.projectionLab},{name:"Harness",description:"Get matched with a vetted tax advisor",priceLabel:"Free match",priceTone:l.XW.Free,url:i.Ay.estatePlanningTools.tools.harness},{name:"Daffy",description:"Donor-advised fund to gift assets from your estate",priceLabel:"$3–$40 a month",priceTone:l.XW.Paid,url:i.Ay.estatePlanningTools.tools.daffy}]}}),h=(e,t)=>{switch(e){case c.od.EstimatedNetWorth:return"Estimated net worth";case c.od.CurrentAge:return"Current age";case c.od.TaxFilingStatus:return"Marital status";case s.WR.Children:return"Number of dependents";case c.od.Residency:return"Country of residence";case s.WR.State:return"".concat((0,u.VC)(null!=t?t:void 0)," of residence")}},f=[c.od.EstimatedNetWorth,c.od.CurrentAge,c.od.TaxFilingStatus,s.WR.Children,c.od.Residency,s.WR.State],g=e=>o.kuo(t=>t===s.WR.State&&e===d.XM.Other,f),v={[l.PR.LivingTrust]:3e6,[l.PR.EstateTaxImplications]:3e6},x=e=>null!=e&&(0,m.qU)(String(e))>0,A=(e,t)=>{switch(e){case l.PR.SelectedGuardianForMinorChildren:case l.PR.LifeInsurance:return t.isUserWithDependents;case l.PR.LivingTrust:case l.PR.EstateTaxImplications:return(0,m.qU)(t.estimatedNetworth)>=v[e];default:return!0}}},10691:(e,t,n)=>{n.d(t,{Ao:()=>p,En:()=>u,K6:()=>m,MG:()=>i,WZ:()=>d,gR:()=>l,q:()=>c,wh:()=>s});var a=n(62570),r=n(74547),o=n(78046);let i=(0,a.A)("div",{target:"e1d8jzbo0"})("padding:0 0 16px 0;"),l=(0,a.A)("div",{target:"e1d8jzbo1"})(),s=(0,a.A)("div",{target:"e1d8jzbo2"})("font-style:normal;font-weight:normal;font-size:16px;line-height:20px;color:",e=>e.theme.colors.neutral600,";"),c=(0,a.A)(o.lV,{target:"e1d8jzbo3"})("display:flex;flex-direction:row;justify-content:flex-start;align-items:flex-start;",(0,r.BK)({flexWrap:["wrap","wrap","wrap","nowrap"]}),"  & >:not(:last-child){margin-bottom:8px;margin-right:8px;}"),d=(0,a.A)(o.eI,{target:"e1d8jzbo4"})("width:196px;max-width:196px;"),u=(0,a.A)("div",{target:"e1d8jzbo5"})("font-style:normal;font-weight:normal;font-size:14px;line-height:20px;color:",e=>e.theme.colors.neutral900,";padding-top:16px;"),m=(0,a.A)("span",{target:"e1d8jzbo6"})("font-weight:400;font-size:12px;line-height:16px;white-space:nowrap;color:",e=>e.theme.colors.neutral500,";"),p=(0,a.A)(r.Sc,{target:"e1d8jzbo7"})("display:inline-flex;align-items:center;flex-shrink:1;max-width:296px;")},11074:(e,t,n)=>{n.d(t,{l:()=>ey});var a=n(57090),r=n(12115),o=n(3850),i=n(74547),l=n(36934),s=n(41784),c=n(55972),d=n(99750);let u=()=>{let{isBelow576:e,isBelow768:t}=(0,d.uF)();return{compactMode:e,compactSettings:t}};var m=n(70432),p=n(54519);let y=e=>(0,a.Y)(c.S,{...e,className:(0,s.cn)(l.gI.body1W400,"text-neutral-500"),style:{lineHeight:"24px",marginBottom:"0 !important"},"data-sentry-element":"WpParagraph","data-sentry-component":"DescriptionParagraph","data-sentry-source-file":"Header.tsx"}),h=()=>{let{compactMode:e}=u();return(0,a.FD)(r.Fragment,{children:[(0,a.FD)(y,{"data-sentry-element":"DescriptionParagraph","data-sentry-source-file":"Header.tsx",children:["Estate planning helps make sure your assets and wishes are taken care of after you're gone."," ",(0,a.Y)(i.ID,{title:"The estate planning checklists and articles recommended on this webpage are provided by Global Predictions, an SEC-registered investment adviser, for informational purposes only. The recommendations are generated based on the information you provide regarding your net worth, age, location, children, and marital status. These recommendations may not necessarily reflect your complete financial or personal situation and are not meant to be a substitute for personalized advice from a qualified estate planning professional. Other important factors, such as health, specific family dynamics, and unique financial circumstances, may not be considered in these recommendations. We encourage you to consult with an attorney, tax advisor, or other trusted professional before making any decisions related to estate planning.",overlayInnerStyle:{width:e?"320px":"456px"},"data-sentry-element":"InfoTooltip","data-sentry-source-file":"Header.tsx"})]}),(0,a.FD)(l.cO,{className:"text-subtle","data-sentry-element":"CaptionW400","data-sentry-source-file":"Header.tsx",children:["Informational only, not legal advice. Talk to an attorney or tax advisor before acting. Templates and third-party tools are independent services. We do not endorse them, we receive no referral fees or compensation from them, and we are not responsible for their services. Do your own research before relying on one. Third-party fees are estimated, may vary, and are not charged by PortfolioPilot."," ",(0,a.Y)(m.A,{href:p.Ay.tutorialEstatePlanningChecklist,openInNewTab:!0,"data-sentry-element":"Link","data-sentry-source-file":"Header.tsx",children:"Read the full guide"})]})]})};var f=n(33624),g=n(38738),v=n(10388),x=n(62570),A=n(23462),S=n(92672);let b=(0,x.A)("div",{target:"e1g5qv8j0"})("display:flex;padding:18px;align-items:center;border-radius:12px;background:",e=>e.theme.colors.neutral100,";"),C=(0,x.A)("div",{target:"e1g5qv8j1"})("display:grid;grid-template-columns:repeat(3,1fr);justify-items:stretch;border:1px solid var(--wp-card-border);border-radius:8px;gap:0;@media (min-width:1200px){grid-template-columns:repeat(6,1fr);}"),I=(0,x.A)("div",{target:"e1g5qv8j2"})("padding:8px;border-right:1px solid ",e=>e.theme.colors.neutral200,";border-bottom:1px solid ",e=>e.theme.colors.neutral200,";background:",e=>e.theme.colors.white,";"),w=(0,x.A)(i._P,{target:"e1g5qv8j3"})(e=>e.compact?"":(0,A.AH)("border:none !important;> div.ant-select-selector{&,&:hover,&:focus{border:none !important;padding:0 !important;}.ant-select-selection-item{font-size:16px;font-style:normal;font-weight:500;line-height:24px;color:",e.theme.colors.neutral800,";}}.ant-select-arrow{> span{font-size:16px;font-weight:400;color:",e.theme.colors.neutral500,";}}")),P=(0,x.A)("div",{target:"e1g5qv8j4"})("display:flex;align-items:stretch;gap:16px;",(0,S.m9)({flexDirection:["column","column","row"]})),k=(0,x.A)("div",{target:"e1g5qv8j5"})("display:flex;flex:1 1 0;min-width:0;flex-direction:column;gap:4px;"),F=(0,x.A)("div",{target:"e1g5qv8j6"})("display:flex;flex:3 1 0;min-width:0;flex-direction:column;gap:4px;"),T=(0,x.A)("div",{target:"e1g5qv8j7"})("display:flex;align-items:stretch;gap:12px;height:100%;",(0,S.m9)({flexDirection:["column","column","row"]})),E=(0,x.A)("a",{target:"e1g5qv8j8"})("display:flex;flex:1 1 0;min-width:0;flex-direction:column;gap:4px;padding:12px;border:1px solid var(--wp-card-border);border-radius:8px;background:var(--wp-card-background);&:hover{background:var(--color-neutral-50);}"),Y=(0,x.A)("div",{target:"e1g5qv8j9"})("display:flex;justify-content:flex-start;padding-top:4px;",(0,S.m9)({marginTop:["0","0","auto"]})),D=(0,x.A)("a",{target:"e1g5qv8j10"})("display:flex;align-items:flex-start;justify-content:flex-start;gap:6px;padding:2px 0;width:fit-content;max-width:100%;text-decoration:none;&:hover{text-decoration:none;color:var(--wp-accent);}"),R=(0,x.A)(E,{target:"e1g5qv8j11"})("border-color:var(--color-blue-200);background:var(--color-blue-50);&:hover{background:var(--color-blue-100);}");var N=n(81671);let M=e=>(0,a.Y)(i.Ah,{display:"block",marginTop:8,"data-testid":"articles-panel","data-sentry-element":"FlexLayout","data-sentry-component":"ChecklistItemArticlesPanel","data-sentry-source-file":"ChecklistItemArticlesPanel.tsx",children:f.TjK(e=>(0,a.FD)(D,{href:e.url,target:"_blank",rel:"noopener noreferrer",children:[(0,a.Y)(l.km,{className:"text-body",children:e.heading}),(0,a.Y)(i.In,{icon:N.$.SquareArrowTopRight,size:14,className:"text-subtle shrink-0"})]},e.url),e.articles)}),L=e=>(0,a.Y)(i.$n,{variant:"ghost",color:"accent",className:"h-auto px-0",onClick:e.onToggle,"aria-expanded":e.expanded,suffix:(0,a.Y)(i.In,{icon:e.expanded?N.$.ChevronTopSmall:N.$.ChevronDownSmall,size:14}),"data-sentry-element":"Button","data-sentry-component":"ChecklistItemSectionDisclosure","data-sentry-source-file":"ChecklistItemSectionDisclosure.tsx",children:e.label});var _=n(95825),O=n(99026),W=n(65438),B=n(76402),U=n(47178);let z=e=>(0,a.FD)(R,{href:e.template.url,target:"_blank",rel:"noopener noreferrer",onClick:t=>{(0,U.Lt)(t)&&(t.preventDefault(),e.onLeaveConfirmationRequest({name:e.template.title,url:e.template.url}))},"data-sentry-element":"TemplateCard","data-sentry-component":"ChecklistItemTemplateCard","data-sentry-source-file":"ChecklistItemTemplateCard.tsx",children:[(0,a.FD)(i.Ah,{flexWrap:"nowrap",itemsSpacingHorizontal:8,justifyContent:"space-between",alignItems:"flex-start","data-sentry-element":"FlexLayout","data-sentry-source-file":"ChecklistItemTemplateCard.tsx",children:[(0,a.FD)(i.Ah,{flexWrap:"nowrap",itemsSpacingHorizontal:6,justifyContent:"flex-start",alignItems:"center","data-sentry-element":"FlexLayout","data-sentry-source-file":"ChecklistItemTemplateCard.tsx",children:[(0,a.Y)(i.In,{icon:N.$.FileText,size:16,className:"text-body shrink-0","data-sentry-element":"Icon","data-sentry-source-file":"ChecklistItemTemplateCard.tsx"}),(0,a.Y)(l.s9,{className:"text-body","data-sentry-element":"Body2W600","data-sentry-source-file":"ChecklistItemTemplateCard.tsx",children:e.template.title})]}),(0,a.Y)(i.In,{icon:N.$.SquareArrowTopRight,size:14,className:"text-subtle shrink-0","data-sentry-element":"Icon","data-sentry-source-file":"ChecklistItemTemplateCard.tsx"})]}),(0,a.Y)(l.km,{className:"text-body","data-sentry-element":"Body2W400","data-sentry-source-file":"ChecklistItemTemplateCard.tsx",children:e.template.description}),(0,a.Y)(l.cO,{className:"text-subtle","data-sentry-element":"CaptionW400","data-sentry-source-file":"ChecklistItemTemplateCard.tsx",children:e.template.publisher}),(0,a.Y)(Y,{"data-testid":"template-and-tools-price-row","data-sentry-element":"TemplateAndToolsCardPriceRow","data-sentry-source-file":"ChecklistItemTemplateCard.tsx",children:(0,a.Y)(B.vu,{type:B.pb.Success,variant:B.Qj.Soft,size:B.Sb.Sm,"data-sentry-element":"Chip","data-sentry-source-file":"ChecklistItemTemplateCard.tsx",children:"Free"})})]}),V=e=>(0,a.FD)(E,{href:e.tool.url,target:"_blank",rel:"noopener noreferrer",onClick:t=>{(0,U.Lt)(t)&&(t.preventDefault(),e.onLeaveConfirmationRequest({name:e.tool.name,url:e.tool.url}))},"data-sentry-element":"TemplateAndToolsCard","data-sentry-component":"ChecklistItemToolCard","data-sentry-source-file":"ChecklistItemToolCard.tsx",children:[(0,a.FD)(i.Ah,{flexWrap:"nowrap",itemsSpacingHorizontal:8,justifyContent:"space-between",alignItems:"flex-start","data-sentry-element":"FlexLayout","data-sentry-source-file":"ChecklistItemToolCard.tsx",children:[(0,a.Y)(l.s9,{className:"text-body","data-sentry-element":"Body2W600","data-sentry-source-file":"ChecklistItemToolCard.tsx",children:e.tool.name}),(0,a.Y)(i.In,{icon:N.$.SquareArrowTopRight,size:14,className:"text-subtle shrink-0","data-sentry-element":"Icon","data-sentry-source-file":"ChecklistItemToolCard.tsx"})]}),(0,a.Y)(l.km,{className:"text-body","data-sentry-element":"Body2W400","data-sentry-source-file":"ChecklistItemToolCard.tsx",children:e.tool.description}),(0,a.Y)(Y,{"data-testid":"template-and-tools-price-row","data-sentry-element":"TemplateAndToolsCardPriceRow","data-sentry-source-file":"ChecklistItemToolCard.tsx",children:(0,a.Y)(B.vu,{type:e.tool.priceTone===g.XW.Free?B.pb.Success:B.pb.Neutral,variant:B.Qj.Soft,size:B.Sb.Sm,"data-sentry-element":"Chip","data-sentry-source-file":"ChecklistItemToolCard.tsx",children:e.tool.priceLabel})})]}),j=e=>{let[t,n]=r.useState(null),{value:o,setTrue:s,setFalse:c}=(0,W.A)(!1),d=e=>{n(e),s()};return(0,a.FD)(r.Fragment,{children:[(0,a.FD)(i.Ah,{display:"block",itemsSpacingVertical:8,marginTop:8,"data-testid":"template-and-tools-panel","data-sentry-element":"FlexLayout","data-sentry-source-file":"ChecklistItemTemplateAndToolsPanel.tsx",children:[(0,a.FD)(P,{"data-sentry-element":"TemplateAndToolsLayout","data-sentry-source-file":"ChecklistItemTemplateAndToolsPanel.tsx",children:[(0,a.FD)(k,{"data-sentry-element":"TemplateGroup","data-sentry-source-file":"ChecklistItemTemplateAndToolsPanel.tsx",children:[(0,a.Y)(l.cO,{className:"text-subtle","data-sentry-element":"CaptionW400","data-sentry-source-file":"ChecklistItemTemplateAndToolsPanel.tsx",children:"Template"}),(0,a.Y)(z,{template:e.template,onLeaveConfirmationRequest:d,"data-sentry-element":"ChecklistItemTemplateCard","data-sentry-source-file":"ChecklistItemTemplateAndToolsPanel.tsx"})]}),(0,a.FD)(F,{"data-sentry-element":"ToolsGroup","data-sentry-source-file":"ChecklistItemTemplateAndToolsPanel.tsx",children:[(0,a.Y)(l.cO,{className:"text-subtle","data-sentry-element":"CaptionW400","data-sentry-source-file":"ChecklistItemTemplateAndToolsPanel.tsx",children:"Independent tools"}),(0,a.Y)(T,{"data-sentry-element":"TemplateAndToolsCardsRow","data-sentry-source-file":"ChecklistItemTemplateAndToolsPanel.tsx",children:f.TjK(e=>(0,a.Y)(V,{tool:e,onLeaveConfirmationRequest:d},e.url),e.tools)})]})]}),(0,a.Y)(l.cO,{className:"text-subtle","data-sentry-element":"CaptionW400","data-sentry-source-file":"ChecklistItemTemplateAndToolsPanel.tsx",children:"We are not compensated for these referrals. They are offered simply as a helpful way to get prepared. Prices shown are third-party fees, separate from your PortfolioPilot subscription."})]}),(0,a.Y)(_.Ay,{open:o,title:"Leave PortfolioPilot?",size:_.rI.Sm,destroyOnClose:!0,onCancel:c,onOk:()=>{t&&(0,O.V3)(t.url),c()},okText:"Continue","data-sentry-element":"Modal","data-sentry-source-file":"ChecklistItemTemplateAndToolsPanel.tsx",children:(0,a.FD)(l.bU,{className:"text-body","data-sentry-element":"Body1W400","data-sentry-source-file":"ChecklistItemTemplateAndToolsPanel.tsx",children:["This opens ",null==t?void 0:t.name,", an independent website. We are not affiliated with this company or agency and are not responsible for its content or services."]})})]})},H=e=>{let{checklistId:t}=e,n={size:32,className:"text-icon"};return(0,a.Y)(b,{"data-sentry-element":"ChecklistItemIconFrame","data-sentry-component":"ChecklistItemIcon","data-sentry-source-file":"ChecklistItemIcon.tsx",children:(()=>{switch(t){case g.PR.LastWillAndTestament:return(0,a.Y)(i.In,{icon:N.$.FileText,...n});case g.PR.DesignatedBeneficiaries:return(0,a.Y)(i.In,{icon:N.$.PeopleGroup2,...n});case g.PR.AdvanceHealthcareDirective:return(0,a.Y)(i.In,{icon:N.$.Heart,...n});case g.PR.DigitalAssetsPlan:return(0,a.Y)(i.In,{icon:N.$.Server1,...n});case g.PR.SelectedGuardianForMinorChildren:return(0,a.Y)(i.In,{icon:N.$.RockingHorse,...n});case g.PR.LivingTrust:return(0,a.Y)(i.In,{icon:N.$.ShieldUser,...n});case g.PR.EstateTaxImplications:return(0,a.Y)(i.In,{icon:N.$.CurrencyDollar,...n});case g.PR.LifeInsurance:return(0,a.Y)(i.In,{icon:N.$.Shield,...n});default:return null}})()})},q=e=>{let{compactMode:t}=u(),n=v.aG[e.checklistId],r=async t=>{await e.onCompleteChange(e.checklistId,t)},o=e.openSection===g.Qi.TemplateAndTools,s=e.openSection===g.Qi.Articles,c=t?l.se:l.RF;return(0,a.FD)(i.Ah,{flexDirection:"row",justifyContent:"flex-start",alignItems:null===e.openSection?"center":"flex-start",flexWrap:"nowrap",itemsSpacingHorizontal:12,"data-sentry-element":"FlexLayout","data-sentry-component":"EstatePlanningChecklistItemPanel","data-sentry-source-file":"EstatePlanningChecklistItemPanel.tsx",children:[(0,a.Y)(i.Sc,{checked:e.completed,onValueChange:r,loading:e.isUpdateInProgress,"aria-label":"Mark ".concat(n.title," as complete"),"data-sentry-element":"Checkbox","data-sentry-source-file":"EstatePlanningChecklistItemPanel.tsx"}),t?null:(0,a.Y)(H,{checklistId:e.checklistId}),(0,a.FD)(i.Ah,{display:"block","data-sentry-element":"FlexLayout","data-sentry-source-file":"EstatePlanningChecklistItemPanel.tsx",children:[(0,a.Y)(c,{className:"text-body","data-sentry-element":"Title","data-sentry-source-file":"EstatePlanningChecklistItemPanel.tsx",children:n.title}),(0,a.Y)(l.bU,{className:"text-neutral-500","data-sentry-element":"Body1W400","data-sentry-source-file":"EstatePlanningChecklistItemPanel.tsx",children:n.description}),(0,a.FD)(i.Ah,{flexWrap:"nowrap",itemsSpacingHorizontal:16,justif
3yContent:"flex-start",alignItems:"center","data-sentry-element":"FlexLayout","data-sentry-source-file":"EstatePlanningChecklistItemPanel.tsx",children:[(0,a.Y)(L,{label:"Template & tools",expanded:o,onToggle:()=>e.onSectionToggle(e.checklistId,g.Qi.TemplateAndTools),"data-sentry-element":"ChecklistItemSectionDisclosure","data-sentry-source-file":"EstatePlanningChecklistItemPanel.tsx"}),(0,a.Y)(L,{label:"Articles",expanded:s,onToggle:()=>e.onSectionToggle(e.checklistId,g.Qi.Articles),"data-sentry-element":"ChecklistItemSectionDisclosure","data-sentry-source-file":"EstatePlanningChecklistItemPanel.tsx"})]}),o?(0,a.Y)(j,{template:n.template,tools:n.tools}):null,s?(0,a.Y)(M,{articles:n.articles}):null]})]})},G=e=>0===e.progress.total?null:(0,a.FD)(i.Ah,{flexWrap:"nowrap",itemsSpacingHorizontal:12,justifyContent:"flex-start",alignItems:"center","data-sentry-element":"FlexLayout","data-sentry-component":"EstatePlanningChecklistProgress","data-sentry-source-file":"EstatePlanningChecklistProgress.tsx",children:[(0,a.FD)(l.Z4,{className:"text-neutral-500 tabular-nums whitespace-nowrap","data-sentry-element":"CaptionW500","data-sentry-source-file":"EstatePlanningChecklistProgress.tsx",children:[e.progress.completed," of ",e.progress.total," complete"]}),(0,a.Y)(i.ke,{value:e.progress.completed,maxValue:e.progress.total,"aria-label":"".concat(e.progress.completed," of ").concat(e.progress.total," checklist items complete"),classNames:{track:"bg-neutral-100",indicator:"min-w-2"},"data-sentry-element":"Progress","data-sentry-source-file":"EstatePlanningChecklistProgress.tsx"})]});var K=n(93130);let Q=e=>{let{preferences:t}=e,{updateChecklistPreference:n,isChecklistItemUpdateInProgress:o,isChecklistItemCompleted:l}=(0,K.IJ)(t),{getItemVisibility:s}=(0,K.V2)(),[c,d]=r.useState(null),u=async(e,t)=>{await n(e,t)},m=(e,t)=>{d(n=>(null==n?void 0:n.checklistId)===e&&n.section===t?null:{checklistId:e,section:t})},p=(0,U.HX)(f.zug(g.PR),s,l);return(0,a.FD)(i.Ah,{display:"block",itemsSpacingVertical:24,"data-sentry-element":"FlexLayout","data-sentry-component":"EstatePlanningChecklistPanel","data-sentry-source-file":"EstatePlanningChecklistPanel.tsx",children:[(0,a.Y)(G,{progress:p,"data-sentry-element":"EstatePlanningChecklistProgress","data-sentry-source-file":"EstatePlanningChecklistPanel.tsx"}),f.TjK(e=>s(e)?(0,a.Y)(q,{checklistId:e,isUpdateInProgress:o(e),completed:l(e),openSection:(null==c?void 0:c.checklistId)===e?c.section:null,onSectionToggle:m,onCompleteChange:u},e):null,f.zug(g.PR))]})},$={[g.Ff.CompleteChecklistReminder]:"Remind me to complete the checklist",[g.Ff.NotifyForYearlyReview]:"Notify me to review every year"},X=e=>{let{preferences:t,lastUpdatedAt:n}=e,{updateChecklistPreference:r,isChecklistItemUpdateInProgress:o,isChecklistItemCompleted:s}=(0,K.IJ)(t),c=async(e,t)=>{await r(e,t)};return(0,a.Y)("div",{className:"@container","data-sentry-component":"EstatePlanningChecklistReminders","data-sentry-source-file":"EstatePlanningChecklistReminders.tsx",children:(0,a.FD)("div",{"data-testid":"estate-planning-reminders-row",className:"flex flex-col items-start gap-2 @[810px]:flex-row @[810px]:items-center @[810px]:gap-6",children:[f.TjK(e=>(0,a.Y)(i.Sc,{checked:s(e),onChange:(t,n)=>c(e,n.target.checked),loading:o(e),children:(0,a.Y)(l.lc,{className:"text-body",children:$[e]})},e),f.HPH($)),n?(0,a.Y)("div",{className:"pl-8 text-base leading-6 @[810px]:pl-0",children:(0,a.FD)(l.km,{as:"span",className:"text-neutral-500",children:["Last updated ",(0,O.nx)(n)]})}):null]})})};var J=n(98804),Z=n(18069),ee=n(46165);let et=e=>{let{preferenceId:t,preference:n,options:o,onSubmit:s,isUpdateInProgress:c,compact:d,label:u,placeholder:m}=e,[p,y]=r.useState(()=>(e=>(null==e?void 0:e.response)?String(e.response):void 0)(n)),h=async e=>{y(e),s({...n,questionId:t,response:e})};return(0,a.FD)(i.Ah,{flexDirection:"column",occupyParentWidth:!0,itemsSpacingVertical:4*!!d,justifyContent:"space-between",alignItems:"flex-start","data-sentry-element":"FlexLayout","data-sentry-component":"SettingPreferenceItem","data-sentry-source-file":"EstatePlanningSettings.tsx",children:[(0,a.Y)(l.km,{className:d?"text-body":"text-neutral-500","data-sentry-element":"Body2W400","data-sentry-source-file":"EstatePlanningSettings.tsx",children:u}),(0,a.Y)(w,{value:p,options:o,allowClear:!1,showSearch:!1,onSelect:h,loading:c,style:{width:"100%"},compact:d,placeholder:m,"data-sentry-element":"SettingSelect","data-sentry-source-file":"EstatePlanningSettings.tsx"})]})},en=()=>{let{settingPreferencesMap:e,updateSettings:t,isSettingsUpdateInProgress:n,getPreferenceOptions:o,isEstatePlanningPreferencesLoading:l}=(0,K.TD)(),{compactSettings:s}=u(),{userResidency:c}=(0,ee.R2)(),{value:d,setTrue:m,setFalse:p}=(0,W.A)(!1),y=async e=>{await t(e)},h=(0,v.J9)(c),g=t=>(0,a.Y)(et,{preferenceId:t,preference:e[t],options:o(t),isUpdateInProgress:n(t),onSubmit:y,compact:s,label:(0,v.ie)(t,c),placeholder:t===J.WR.State?"Select ".concat((0,Z.JJ)(null!=c?c:void 0)):void 0,"data-sentry-element":"SettingPreferenceItem","data-sentry-component":"renderSettingPreferenceItem","data-sentry-source-file":"EstatePlanningSettings.tsx"},"".concat(t,"-").concat(l));return s?(0,a.FD)(r.Fragment,{children:[(0,a.Y)(i.$n,{variant:"outlined",prefix:(0,a.Y)(i.In,{icon:N.$.SettingsSliderThree,size:16}
3),onClick:m,fullWidth:s,children:"Edit your basic info"}),(0,a.Y)(i.aF,{title:"Your basic info",open:d,onCancel:p,footer:null,disableSubmitOnEnter:!0,children:(0,a.Y)(i.Ah,{display:"block",occupyParentWidth:!0,itemsSpacingVertical:16,margin:"16px 0",children:f.TjK(g,h)})})]}):(0,a.Y)(C,{"data-sentry-element":"SettingsContainer","data-sentry-component":"EstatePlanningSettings","data-sentry-source-file":"EstatePlanningSettings.tsx",children:f.TjK(e=>(0,a.Y)(I,{children:g(e)},e),h)})};var ea=n(513),er=n(16658);let eo=f.zug(g.Ff).length,ei="skeleton skeleton--shimmer text-transparent select-none",el=()=>{var e;let{userResidency:t}=(0,ee.R2)(),{estimatedNetworth:n}=(0,ee.w)(),{isPreferencesInitialLoading:a}=(0,ee.w9)(),{data:r,isLoading:o}=(0,er.sr)(),i=f.I6j(e=>e.questionId===J.WR.Children,null!=(e=null==r?void 0:r.preferences)?e:[]),l=(0,v.wv)(null==i?void 0:i.response);return{userResidency:t,visibleChecklistItemIds:f.pbD(e=>(0,v.j2)(e,{isUserWithDependents:l,estimatedNetworth:n}),f.zug(g.PR)),isLoading:a||o}},es=()=>(0,a.FD)(i.Ah,{itemsSpacingHorizontal:24,itemsSpacingVertical:8,justifyContent:"flex-start",alignItems:"center",occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-component":"RemindersSkeleton","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx",children:[f.HnJ(e=>(0,a.FD)(i.Ah,{flexWrap:"nowrap",itemsSpacingHorizontal:8,alignItems:"center",children:[(0,a.Y)(ea.EA,{className:"h-5 w-5 rounded"}),(0,a.Y)(ea.EA,{className:"h-4 w-32 rounded"})]},e),eo),(0,a.Y)(ea.EA,{className:"h-4 w-28 rounded","data-sentry-element":"Skeleton","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx"})]}),ec=e=>e.compact?(0,a.Y)(ea.EA,{className:"h-9 w-full rounded-md"}):(0,a.Y)(C,{children:f.TjK(t=>(0,a.Y)(I,{"data-testid":"estate-planning-settings-item-skeleton",children:(0,a.FD)(i.Ah,{flexDirection:"column",occupyParentWidth:!0,justifyContent:"space-between",alignItems:"flex-start",children:[(0,a.Y)(l.km,{className:ei,children:(0,v.ie)(t,e.residency)}),(0,a.Y)(w,{options:[],allowClear:!1,showSearch:!1,disabled:!0,style:{width:"100%"},compact:!1})]})},t),(0,v.J9)(e.residency))}),ed=()=>(0,a.FD)(i.Ah,{flexWrap:"nowrap",itemsSpacingHorizontal:12,justifyContent:"flex-start",alignItems:"center","data-sentry-element":"FlexLayout","data-sentry-component":"ChecklistProgressSkeleton","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx",children:[(0,a.Y)(ea.EA,{className:"h-4 w-28 shrink-0 rounded","data-sentry-element":"Skeleton","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx"}),(0,a.Y)(ea.EA,{className:"h-2 flex-1 rounded-full","data-sentry-element":"Skeleton","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx"})]}),eu=e=>{let t=v.aG[e.checklistItemId],n=e.compact?l.se:l.RF;return(0,a.FD)(i.Ah,{flexDirection:"row",justifyContent:"flex-start",alignItems:"center",flexWrap:"nowrap",itemsSpacingHorizontal:12,"data-testid":"estate-planning-checklist-item-skeleton","data-sentry-element":"FlexLayout","data-sentry-component":"ChecklistItemRowSkeleton","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx",children:[(0,a.Y)(ea.EA,{className:"h-5 w-5 rounded","data-sentry-element":"Skeleton","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx"}),e.compact?null:(0,a.Y)(b,{children:(0,a.Y)(ea.EA,{className:"h-8 w-8 rounded"})}),(0,a.FD)(i.Ah,{display:"block",occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx",children:[(0,a.Y)(n,{className:ei,"data-sentry-element":"Title","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx",children:t.title}),(0,a.Y)(l.bU,{className:ei,"data-sentry-element":"Body1W400","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx",children:t.description}),(0,a.FD)(i.Ah,{flexWrap:"nowrap",itemsSpacingHorizontal:16,justifyContent:"flex-start",alignItems:"center","data-sentry-element":"FlexLayout","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx",children:[(0,a.Y)(i.$n,{variant:"ghost",color:"accent",className:"h-auto px-0",disabled:!0,suffix:(0,a.Y)(i.In,{icon:N.$.ChevronDownSmall,size:14}),"data-sentry-element":"Button","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx",children:(0,a.Y)("span",{className:ei,children:"Template & tools"})}),(0,a.Y)(i.$n,{variant:"ghost",color:"accent",className:"h-auto px-0",disabled:!0,suffix:(0,a.Y)(i.In,{icon:N.$.ChevronDownSmall,size:14}),"data-sentry-element":"Button","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx",children:(0,a.Y)("span",{className:ei,children:"Articles"})})]})]})]})},em=()=>{let{compactMode:e,compactSettings:t}=u(),{userResidency:n,visibleChecklistItemIds:r}=el();return(0,a.FD)(i.Ah,{display:"block",itemsSpacingVertical:32,"aria-hidden":!0,"data-testid":"estate-planning-content-skeleton","data-sentry-element":"FlexLayout","data-sentry-component":"EstatePlanningContentSkeleton","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx",children:[(0,a.Y)(es,{"data-sentry-element":"RemindersSkeleton","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx"}),(0,a.Y)(ec,{compact:t,residency:n,"data-sentry-element":"SettingsSkeleton","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx"}),(0,a.FD)(i.Ah,{display:"block",itemsSpacingVertical:24,"data-sentry-element":"FlexLayout","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx",children:[(0,a.Y)(ed,{"data-sentry-element":"ChecklistProgressSkeleton","data-sentry-source-file":"EstatePlanningContentSkeleton.tsx"}),f.TjK(t=>(0,a.Y)(eu,{checklistItemId:t,compact:e},t),r)]})]})};var ep=n(28811);let ey=()=>{let{estatePlanningChecklistPreferences:e,estatePlanningChecklistReminderPreferences:t,lastUpdatedAt:n,isLoading:s}=(0,K.Hf)(),{isLoading:c}=el();return(0,a.Y)(o.d,{title:(0,a.Y)(h,{}),"data-sentry-element":"PageSection","data-sentry-component":"EstatePlanner","data-sentry-source-file":"EstatePlanner.tsx",children:(0,a.FD)(i.Ah,{display:"block",itemsSpacingVertical:32,marginBottom:16,"data-sentry-element":"FlexLayout","data-sentry-source-file":"EstatePlanner.tsx",children:[s||c?(0,a.Y)(em,{}):(0,a.FD)(r.Fragment,{children:[(0,a.Y)(X,{preferences:t,lastUpdatedAt:n}),(0,a.Y)(en,{}),(0,a.Y)(Q,{preferences:e})]}),(0,a.FD)(i.Ah,{display:"block",itemsSpacingVertical:8,"data-testid":"estate-planning-third-party-disclosure","data-sentry-element":"FlexLayout","data-sentry-source-file":"EstatePlanner.tsx",children:[(0,a.Y)(ep.Ay,{"data-sentry-element":"Divider","data-sentry-source-file":"EstatePlanner.tsx"}),(0,a.Y)(l.cO,{className:"text-subtle","data-sentry-element":"CaptionW400","data-sentry-source-file":"EstatePlanner.tsx",children:"Certain tools, resources, information, or links made available through the platform may be provided by independent third parties, including private companies and federal, state, or local government agencies. We are not affiliated with, endorsed by, or acting on behalf of any such third party or government agency, including the Social Security Administration. Third-party resources are provided for informational purposes only, and we do not control, end
3orse, or guarantee their content, availability, or accuracy."})]})]})})}},11444:(e,t,n)=>{n.d(t,{B$:()=>m,CA:()=>f,II:()=>g,Jr:()=>h,MG:()=>d,Rc:()=>x,YB:()=>c,ZB:()=>A,_G:()=>s,jQ:()=>v,qM:()=>u});var a=n(33624),r=n(39715),o=n(98868),i=n(36559),l=n(99026);let s=255,c=(e,t)=>a.I6j(a.wqE("id",t),e),d=(e,t)=>a.I6j(a.wqE("portfolioSummaryId",t),e),u=e=>{let{existingPortfolioIds:t,destinationPortfolioIndex:n,portfolioId:r}=e;return a.Yry(n,r,a.FFB([r],t))},m=(e,t,n)=>{let{portfolioGroups:r,sourceGroupId:o,destinationGroupId:i,portfolioId:l,destinationPortfolioIndex:s}=e,d=c(r,o),m=c(r,i);if(d&&m){let e=((e,t,n)=>{let r=a.sbv(e);return a.TjK(e=>({...e,groupedPortfolioIds:t===e.id?r:e.groupedPortfolioIds}),n)})(u({destinationPortfolioIndex:s,portfolioId:l,existingPortfolioIds:m.groupedPortfolioIds}),i,a.TjK(e=>({...e,groupedPortfolioIds:a.FFB([l],e.groupedPortfolioIds)}),r));t.setQueryData(n,e)}},p=(e,t)=>"".concat(e).concat("_").concat(t),y=e=>(0,r.qU)(a.HVh(a.lDo("_",e))),h=e=>p("groupPortfolio",e),f=e=>y(e),g=e=>{let{portfolioId:t,groupId:n}=e,a=h(n),r=p("individualPortfolio",t);return"".concat(a).concat("_").concat(r)},v=e=>y(e),x=e=>{let{volatility:t}=i.ti[e],n=e===o.R$.NoRisk?"".concat(t):"".concat(t,"%");return"".concat(i.wZ[e]," (").concat(n,")")},A=a.TjK(e=>({value:e,label:x(e)}),(0,l.w5)(o.R$))},11780:(e,t,n)=>{n.d(t,{O:()=>H});var a=n(57090),r=n(12115),o=n(11965),i=n(49575),l=n(74547),s=n(36934),c=n(33624),d=n(84978),u=n(85794),m=n(67297),p=n(35208);let y=e=>{let{value:t}=e,n=c.TjK(e=>({label:m.jN[e].optionLabel,value:e}),d.X_);return(0,a.Y)(u.rA,{value:t,optionLabelProp:"label",dropdownStyle:{zIndex:p.Bf.select},onChange:t=>{var n;null==(n=e.onChange)||n.call(e,t)},options:n,"data-sentry-element":"PrivateEquityTypeSelect","data-sentry-component":"PrivateEquityInputType","data-sentry-source-file":"PrivateEquityInputType.tsx"})},h=e=>{let{value:t}=e;return(0,a.Y)(u.AL,{inForm:!0,value:t,onChange:e.onChange,placeholder:e.placeholder,"data-sentry-element":"PrivateEquityNameInput","data-sentry-component":"PrivateEquityLabelInput","data-sentry-source-file":"PrivateEquityLabelInput.tsx"})};var f=n(85543),g=n(88179),v=n(21533),x=n(13340),A=n(63114),S=n(46165),b=n(78190),C=n(85180),I=n(4338),w=n(81892),P=n(12667),k=n(25471),F=n(10102),T=n(91217),E=n(65438),Y=n(41784),D=n(48298),R=n(81671);let N=["country","assetClass","sectorOrBondType","oneYearExpectedReturn","risk"],M="[&_.ant-select-selection-item]:!text-neutral-400",L="[&_input]:!text-neutral-400",_=e=>{let{securitySectorsOptions:t,securityCountriesOptions:n,securityAssetClassesOptions:o,securityBondTypesOptions:i}=(0,F.t)(),c="Bond type"===e.sectorLabel?i:t,d=r.useRef(!1),u=r.useRef(!1),[m,p]=r.useState(new Set);r.useEffect(()=>{if(!e.form.getFieldValue("netWorthItemId"))return;let t=e.form.getFieldValue("additionalDetail")||{},n=new Set;for(let e of N)null!=t[e]&&n.add(e);n.size>0&&(p(n),n.has("oneYearExpectedReturn")&&(d.current=!0),n.has("risk")&&(u.current=!0))},[]);let y=e=>!m.has(e),h=r.useCallback((t,n,a)=>{t&&n&&D.Ay.getClassificationDefaults({country:t,assetClass:n,sector:a}).then(t=>{t&&(d.current||(e.form.setFieldValue(["additionalDetail","oneYearExpectedReturn"],t.expectedReturn),p(e=>{let t=new Set(e);return t.delete("oneYearExpectedReturn"),t})),u.current||(e.form.setFieldValue(["additionalDetail","risk"],t.expectedRisk),p(e=>{let t=new Set(e);return t.delete("risk"),t})))})},[e.form]),f=(t,n)=>{e.form.setFieldValue(["additionalDetail",t],n),p(e=>new Set(e).add(t));let a=e.form.getFieldValue("additionalDetail")||{},r="country"===t?n:a.country;h(r,"assetClass"===t?n:a.assetClass,"sectorOrBondType"===t?n:a.sectorOrBondType)};return(0,a.FD)(r.Fragment,{children:[(0,a.Y)("div",{className:(0,Y.cn)(y("country")&&M),children:(0,a.Y)(g.JF,{name:["additionalDetail","country"],label:(0,a.Y)(s.km,{className:"text-neutral-500",children:"Country"}),"data-sentry-element":"FormItem","data-sentry-source-file":"PESecurityAssumptions.tsx",children:(0,a.Y)(P.y,{options:n,showSearch:!0,filterOption:!0,optionFilterProp:"label",onChange:e=>f("country",e),"data-sentry-element":"Select","data-sentry-source-file":"PESecurityAssumptions.tsx"})})}),(0,a.Y)("div",{className:(0,Y.cn)(y("assetClass")&&M),children:(0,a.Y)(g.JF,{name:["additionalDetail","assetClass"],label:(0,a.Y)(s.km,{className:"text-neutral-500",children:"Asset Class"}),"data-sentry-element":"FormItem","data-sentry-source-file":"PESecurityAssumptions.tsx",children:(0,a.Y)(P.y,{options:o,onChange:e=>f("assetClass",e),"data-sentry-element":"Select","data-sentry-source-file":"PESecurityAssumptions.tsx"})})}),(0,a.Y)("div",{className:(0,Y.cn)(y("sectorOrBondType")&&M),children:(0,a.Y)(g.JF,{name:["additionalDetail","sectorOrBondType"],label:(0,a.Y)(s.km,{className:"text-neutral-500",children:e.sectorLabel||"Sector"}),"data-sentry-element":"FormItem","data-sentry-source-file":"PESecurityAssumptions.tsx",children:(0,a.Y)(P.y,{options:c,onChange:e=>f("sectorOrBondType",e),"data-sentry-element":"Select","data-sentry-source-file":"PESecurityAssumptions.tsx"})})}),(0,a.Y)("div",{onMouseDown:()=>{d.current=!0,p(e=>new Set(e).add("oneYearExpectedReturn"))},className:(0,Y.cn)(y("oneYearExpectedReturn")&&L),children:(0,a.Y)(g.JF,{label:(0,a.FD)(s.km,{className:"text-neutral-500",children:["Annual expected return",(0,a.Y)(k.H,{title:"Your estimate of performance over the next 12 months"})]}),name:["additionalDetail","oneYearExpectedReturn"],rules:[{validator:async(e,t)=>t>
3T.CP||t<T.kp?Promise.reject("Must be in the range -50% to 50%"):Promise.resolve()}],"data-sentry-element":"FormItem","data-sentry-source-file":"PESecurityAssumptions.tsx",children:(0,a.Y)(l.tv,{inForm:!0,"data-sentry-element":"PercentageInput","data-sentry-source-file":"PESecurityAssumptions.tsx"})})}),(0,a.Y)("div",{onMouseDown:()=>{u.current=!0,p(e=>new Set(e).add("risk"))},className:(0,Y.cn)(y("risk")&&L),children:(0,a.Y)(g.JF,{label:(0,a.FD)(s.km,{className:"text-neutral-500",children:["Risk (annualized volatility)",(0,a.Y)(k.H,{title:"Your estimate of the annualized standard deviation of returns over the next 12 months"})]}),name:["additionalDetail","risk"],rules:[{validator:async(e,t)=>t>T.ZK||t<T.R5?Promise.reject("Must be in the range 0% to 100%"):Promise.resolve()}],"data-sentry-element":"FormItem","data-sentry-source-file":"PESecurityAssumptions.tsx",children:(0,a.Y)(l.tv,{inForm:!0,"data-sentry-element":"PercentageInput","data-sentry-source-file":"PESecurityAssumptions.tsx"})})})]})},O=e=>{let{value:t,toggle:n}=(0,E.A)(!1);return(0,a.Y)(l.nD,{selectionMode:"single",variant:"light",keepContentMounted:!0,isCompact:!0,hideIndicator:!0,onSelectionChange:n,style:{padding:0},"data-sentry-element":"Accordion","data-sentry-component":"PESecurityAssumptionsAccordion","data-sentry-source-file":"PESecurityAssumptions.tsx",children:(0,a.Y)(l.As,{classNames:{title:"text-primary",content:"px-0"},title:(0,a.FD)(l.Ah,{flexWrap:"nowrap",justifyContent:"flex-start",alignItems:"center",itemsSpacingHorizontal:2,children:[(0,a.Y)(l.In,{icon:t?R.$.ChevronTopSmall:R.$.ChevronDownSmall,size:16}),(0,a.Y)(s.s9,{children:"Additional details (optional)"})]}),"data-sentry-element":"AccordionItem","data-sentry-source-file":"PESecurityAssumptions.tsx",children:(0,a.FD)(l.Ah,{flexDirection:"column",justifyContent:"flex-start",alignItems:"stretch",itemsSpacingVertical:4,occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"PESecurityAssumptions.tsx",children:[(0,a.Y)(s.st,{"data-sentry-element":"HelperMessage","data-sentry-source-file":"PESecurityAssumptions.tsx",children:"Auto-filled with defaults based on investment type. Change any value to override."}),(0,a.Y)(_,{sectorLabel:e.sectorLabel,form:e.form,"data-sentry-element":"PESecurityAssumptions","data-sentry-source-file":"PESecurityAssumptions.tsx"})]})})})},W=e=>{let[t,n]=r.useState(e.capitalCalls||[]);r.useEffect(()=>{n(e.capitalCalls||[])},[e.capitalCalls]);let o=t=>{n(t),e.onChange(t)},i=(e,n,a)=>{o(t.map((t,r)=>r===e?{...t,[n]:a}:t))};return(0,a.FD)(l.Ah,{flexDirection:"column",flexWrap:"nowrap",itemsSpacingVertical:12,alignItems:"stretch",className:"pb-4","data-sentry-element":"FlexLayout","data-sentry-component":"CapitalCallSchedule","data-sentry-source-file":"CapitalCallSchedule.tsx",children:[(0,a.Y)(s.km,{className:"text-body","data-sentry-element":"Body2W400","data-sentry-source-file":"CapitalCallSchedule.tsx",children:"Expected Capital Calls"}),t.length>0&&(0,a.Y)(l.Ah,{flexDirection:"column",flexWrap:"nowrap",itemsSpacingVertical:8,alignItems:"stretch",children:t.map((n,r)=>(0,a.FD)(l.Ah,{alignItems:"center",itemsSpacingHorizontal:8,children:[(0,a.FD)(l.Ah,{flexDirection:"column",flexWrap:"nowrap",itemsSpacingVertical:4,flex:1,alignItems:"stretch",className:"min-w-0",children:[(0,a.Y)(s.km,{className:"text-neutral-500",children:"Amount"}),(0,a.Y)(l.YI,{value:n.amount,onChange:e=>i(r,"amount","number"==typeof e?e:0),humanizeNumber:!0,addonBefore:x.IK[e.currency],placeholder:"e.g. 50,000",className:"[&_.input-group]:min-w-0"})]}),(0,a.FD)(l.Ah,{flexDirection:"column",itemsSpacingVertical:4,width:"96px",alignItems:"stretch",children:[(0,a.Y)(s.km,{className:"text-neutral-500",children:"Year"}),(0,a.Y)(l.YI,{value:n.year,onChange:e=>i(r,"year","number"==typeof e?e:new Date().getFullYear()),placeholder:"e.g. 2027",fractionDigits:0,className:"w-full"})]}),(0,a.Y)(l.$n,{variant:"ghost",color:"neutral",onClick:()=>{o(t.filter((e,t)=>t!==r))},className:"mt-6",prefix:(0,a.Y)(l.In,{icon:R.$.TrashCan,size:16,className:"text-red-500"})})]},r))}),(0,a.Y)(l.$n,{variant:"outlined",onClick:()=>{o([...t,{amount:0,year:new Date().getFullYear()+1}])},prefix:(0,a.Y)(l.In,{icon:R.$.PlusMedium}),"data-sentry-element":"Button","data-sentry-source-file":"CapitalCallSchedule.tsx",children:"Add Capital Call"})]})},B=(0,C.A)({Component:e=>{var t;return(0,a.FD)(r.Fragment,{children:[(0,a.FD)(l.Ah,{itemsSpacingHorizontal:8,alignItems:"center",justifyContent:"space-between",flexWrap:"nowrap","data-sentry-element":"FlexLayout","data-sentry-source-file":"PrivateEquityDetailFields.tsx",children:[(0,a.Y)(s.lc,{"data-sentry-element":"Body1W600","data-sentry-source-file":"PrivateEquityDetailFields.tsx",children:"PE details"}),(0,a.Y)(w.G,{canShowMembershipModal:!0,"data-sentry-element":"ProFeatureTag","data-sentry-source-file":"PrivateEquityDetailFields.tsx"})]}),(0,a.Y)("div",{className:"mb-2"}),e.fieldVisibility.expectedYearlyIncome&&(0,a.Y)(g.JF,{name:["additionalDetail","expectedYearlyIncome"],label:(0,a.Y)(s.km,{className:"text-neutral-500",children:"Expected yearly income (% of current value)"}),children:(0,a.Y)(l.tv,{inForm:!0})}),e.fieldVisibility.amountInvested&&(0,a.Y)(g.JF,{name:["additionalDetail","amountInvested"],label:(0,a.Y)(s.km,{className:"text-neutral-500",children:"Total amount invested"}),children:(0,a.Y)(u.d,{humanizeNumber:!0,addonBefore:x.IK[e.currency]})}),e.fieldVisibility.investmentYear&&(0,a.Y)(g.JF,{name:["additionalDetail","investmentYear"],label:(0,a.Y)(s.km,{className:"text-neutral-500",children:"Investment year"}),rules:[{validator:async(e,t)=>null!=t&&(t<1900||t>2500)?Promise.reject("Year must be between 1900 and 2500"):Promise.resolve()}],children:(0,a.Y)(l.YI,{placeholder:"e.g. 2023",fractionDigits:0})}),e.fieldVisibility.distributionTimeline&&(0,a.Y)(g.JF,{name:["additionalDetail","distributionTimeline"],label:(0,a.FD)(s.km,{className:"text-neutral-500",children:["Estimated distribution timeline (years from investment)",(0,a.Y)(k.H,{title:e.investmentType?m._F[e.investmentType]:""})]}),rules:[{validator:async(e,t)=>null!=t&&(t<0||t>
320)?Promise.reject("Must be between 0 and 20 years"):Promise.resolve()}],children:(0,a.Y)(l.YI,{placeholder:"".concat(f.fQ," (default)"),fractionDigits:1})}),e.fieldVisibility.expectedIpoYear&&(0,a.Y)(g.JF,{name:["additionalDetail","expectedIpoYear"],label:(0,a.FD)(s.km,{className:"text-neutral-500",children:["Expected exit year (e.g. IPO)",(0,a.Y)(k.H,{title:"Expected year of IPO or exit event. This determines when the distribution occurs in retirement planning simulations."})]}),rules:[{validator:async(e,t)=>null!=t&&(t<2020||t>2060)?Promise.reject("Year must be between 2020 and 2060"):Promise.resolve()}],children:(0,a.Y)(l.YI,{placeholder:"".concat(f.F3," (default)"),fractionDigits:0})}),e.fieldVisibility.managementFee&&(0,a.Y)(g.JF,{name:["additionalDetail","managementFee"],label:(0,a.Y)(s.km,{className:"text-neutral-500",children:"Management fee (%)"}),children:(0,a.Y)(l.tv,{inForm:!0})}),e.fieldVisibility.carry&&(0,a.Y)(g.JF,{name:["additionalDetail","carry"],label:(0,a.Y)(s.km,{className:"text-neutral-500",children:"Carry (%)"}),children:(0,a.Y)(l.tv,{inForm:!0})}),e.fieldVisibility.percentageVested&&(0,a.Y)(g.JF,{name:["additionalDetail","percentageVested"],label:(0,a.Y)(s.km,{className:"text-neutral-500",children:"Percentage vested (%)"}),rules:[{validator:async(e,t)=>null!=t&&Number.isFinite(t)&&(t<0||t>1)?Promise.reject("Percentage vested must be between 0 and 100"):Promise.resolve()}],children:(0,a.Y)(l.tv,{inForm:!0})}),e.fieldVisibility.strikePrice&&(0,a.Y)(g.JF,{name:["additionalDetail","strikePrice"],label:(0,a.Y)(s.km,{className:"text-neutral-500",children:"Strike price"}),children:(0,a.Y)(u.d,{humanizeNumber:!0,addonBefore:x.IK[e.currency]})}),e.fieldVisibility.numberOfShares&&(0,a.Y)(g.JF,{name:["additionalDetail","numberOfShares"],label:(0,a.Y)(s.km,{className:"text-neutral-500",children:"Number of shares"}),children:(0,a.Y)(l.YI,{placeholder:"e.g. 1000",fractionDigits:0})}),e.fieldVisibility.ownershipStake&&(0,a.Y)(g.JF,{name:["additionalDetail","ownershipStake"],label:(0,a.Y)(s.km,{className:"text-neutral-500",children:"Ownership stake (%)"}),children:(0,a.Y)(l.tv,{inForm:!0})}),e.fieldVisibility.capitalCalls&&(0,a.FD)(r.Fragment,{children:[(0,a.Y)(g.JF,{name:["additionalDetail","capitalCalls"],noStyle:!0,children:(0,a.Y)("input",{type:"hidden"})}),(0,a.Y)(W,{capitalCalls:e.capitalCalls,onChange:t=>{e.form.setFieldValue(["additionalDetail","capitalCalls"],t)},currency:e.currency})]}),(0,a.Y)("div",{className:"mt-4",children:(0,a.Y)(O,{sectorLabel:null==(t=e.labels)?void 0:t.sectorFieldLabel,form:e.form,"data-sentry-element":"PESecurityAssumptionsAccordion","data-sentry-source-file":"PrivateEquityDetailFields.tsx"},e.investmentType)})]})},featureName:I.JP.PrivateEquityDetails,disabledBackgroundImage:"pe_details_blurred",cta:null,containerStyle:{height:314}});var U=n(10098);let z=e=>{var t;let n=(0,l.r3)("investmentType",e.form),o=(0,l.r3)("currency",e.form)||x.Sj.USD,i=(0,l.r3)(["additionalDetail","capitalCalls"],e.form)||[],c=r.useRef(e.privateEquityItem.investmentType),{userResidency:d}=(0,S.R2)(),p=d===b.XM.CAD;r.useEffect(()=>{if(!n||n===c.current)return;c.current=n;let t=m.bJ[n];t?(e.form.setFieldValue(["additionalDetail","country"],t.country),e.form.setFieldValue(["additionalDetail","assetClass"],t.assetClass),e.form.setFieldValue(["additionalDetail","sectorOrBondType"],t.sectorOrBondType),e.form.setFieldValue(["additionalDetail","oneYearExpectedReturn"],t.oneYearExpectedReturn),e.form.setFieldValue(["additionalDetail","risk"],t.risk)):(e.form.setFieldValue(["additionalDetail","country"],null),e.form.setFieldValue(["additionalDetail","assetClass"],null),e.form.setFieldValue(["additionalDetail","sectorOrBondType"],null),e.form.setFieldValue(["additionalDetail","oneYearExpectedReturn"],null),e.form.setFieldValue(["additionalDetail","risk"],null));let a=m.UE[n];(null==a?void 0:a.distributionTimeline)&&e.form.setFieldValue(["additionalDetail","distributionTimeline"],f.fQ),(null==a?void 0:a.expectedIpoYear)&&e.form.setFieldValue(["additionalDetail","expectedIpoYear"],f.F3),(null==a?void 0:a.managementFee)&&e.form.setFieldValue(["additionalDetail","managementFee"],.02),(null==a?void 0:a.carry)&&e.form.setFieldValue(["additionalDetail","carry"],.2)},[n,e.form]);let C=n?m.jN[n]:void 0,I=n?m.UE[n]:m.gp,w=(null==C?void 0:C.nameFieldLabel)||"
3Name";return(0,a.FD)(l.lV,{form:e.form,initialValues:e.privateEquityItem,layout:"vertical","data-sentry-element":"Form","data-sentry-component":"PrivateEquityNetworthForm","data-sentry-source-file":"PrivateEquityNetworthForm.tsx",children:[(0,a.Y)(g.JF,{name:"investmentType",required:!0,label:(0,a.Y)(s.km,{className:"text-neutral-500",children:"Type of equity"}),"data-sentry-element":"FormItem","data-sentry-source-file":"PrivateEquityNetworthForm.tsx",children:(0,a.Y)(y,{"data-sentry-element":"PrivateEquityInputType","data-sentry-source-file":"PrivateEquityNetworthForm.tsx"})}),(0,a.Y)(g.JF,{required:!0,name:["additionalDetail","name"],rules:[{required:!0,message:"Enter ".concat(w),type:"string",whitespace:!0}],label:(0,a.Y)(s.km,{className:"text-neutral-500",children:w}),"data-sentry-element":"FormItem","data-sentry-source-file":"PrivateEquityNetworthForm.tsx",children:(0,a.Y)(h,{placeholder:w,"data-sentry-element":"PrivateEquityLabelInput","data-sentry-source-file":"PrivateEquityNetworthForm.tsx"})}),I.customTypeName&&(0,a.Y)(g.JF,{name:["additionalDetail","customTypeName"],label:(0,a.Y)(s.km,{className:"text-neutral-500",children:"Custom type name"}),children:(0,a.Y)(h,{placeholder:"Enter custom type name"})}),(0,a.FD)(l.Ah,{flexWrap:"nowrap",justifyContent:"flex-start",alignItems:"end",itemsSpacingHorizontal:12,"data-sentry-element":"FlexLayout","data-sentry-source-file":"PrivateEquityNetworthForm.tsx",children:[(0,a.Y)(g.JF,{name:"investmentValue",label:(0,a.Y)(s.km,{className:"text-neutral-500",children:null==(t=m.C6[n])?void 0:t.headerLabel}),className:"flex-1",rules:(0,v.HU)("Enter the current value"),"data-sentry-element":"FormItem","data-sentry-source-file":"PrivateEquityNetworthForm.tsx",children:(0,a.Y)(u.d,{humanizeNumber:!0,addonBefore:x.IK[o],"data-sentry-element":"StyledNetworthInput","data-sentry-source-file":"PrivateEquityNetworthForm.tsx"})}),p&&(0,a.Y)(g.JF,{name:["currency"],required:!0,children:(0,a.Y)(A.A,{})})]}),(0,a.Y)(U.A,{name:"valueUpdateMode","data-sentry-element":"NetworthValueUpdateModeField","data-sentry-source-file":"PrivateEquityNetworthForm.tsx"}),n&&Object.entries(I).some(e=>{let[t,n]=e;return!m.X5.includes(t)&&!0===n})&&(0,a.Y)("div",{className:"mt-4",children:(0,a.Y)(B,{fieldVisibility:I,investmentType:n,currency:o,labels:C,capitalCalls:i,form:e.form})})]})};var V=n(74166),j=n(95825);let H=e=>{let{upsertablePEOtherAssetsItem:t,form:n,handlePEOtherAssetsDetailsSubmit:l}=(0,i.k)(e.initialPrivateEquityItem,e.onSuccessfulUpsert),[s,c]=r.useState(!1);if(!t)return null;let d=async()=>{c(!0);try{await l(),e.onClose()}finally{c(!1)}},{title:u,submitLabel:m}=(0,f.wB)(t);return(0,a.Y)(o.S,{"data-sentry-element":"GuestAssetTextInputsGate","data-sentry-component":"PrivateEquityNetworthFormPopup","data-sentry-source-file":"PrivateEquityNetworthFormPopup.tsx",children:(0,a.Y)(V.z,{title:u,size:j.rI.Sm,onOk:d,okText:m,okButtonProps:{loading:s},onCancel:()=>{e.onClose()},cancelText:"Cancel","data-sentry-element":"InputPopup","data-sentry-source-file":"PrivateEquityNetworthFormPopup.tsx",children:(0,a.Y)(z,{privateEquityItem:t,form:n,"data-sentry-element":"PrivateEquityNetworthForm","data-sentry-source-file":"PrivateEquityNetworthFormPopup.tsx"})})})}},11965:(e,t,n)=>{n.d(t,{S:()=>d});var a=n(57090),r=n(12115),o=n(6915),i=n(89069),l=n(39510),s=n(26214);let c=e=>{let{disableAssetTextInputs:t,isResolved:n}=(()=>{let{flagValue:e}=(0,l.$L)(s.mr.Test432GuestDisableAssetTextInputs,s.SA.Control),{areFlagsResolved:t}=(0,l.$I)(s.mr.Test432GuestDisableAssetTextInputs);return{isResolved:t,disableAssetTextInputs:t&&e===s.SA.Variant1}})();return(0,a.Y)(i.b.Provider,{value:!n||t,"data-sentry-element":"unknown","data-sentry-component":"GuestAssetTextInputsProvider","data-sentry-source-file":"GuestAssetTextInputsGate.tsx",children:e.children})},d=e=>{let{isGuestSession:t}=(0,o.Cs)();return t?(0,a.Y)(c,{"data-sentry-element":"GuestAssetTextInputsProvider","data-sentry-component":"GuestAssetTextInputsGate","data-sentry-source-file":"GuestAssetTextInputsGate.tsx",children:e.children}):(0,a.Y)(r.Fragment,{children:e.children})}},12584:(e,t,n)=>{n.d(t,{k:()=>s});var a=n(12115),r=n(92909),o=n(65443),i=n(41686),l=n(76778);let s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:800,n=a.useRef(!1),s=a.useRef(null),c=(0,o.u)(t),d=(0,l.K)(()=>{null!==s.current&&(window.cancelIdleCallback(s.current),s.current=null)}),u=(0,l.K)(()=>{try{var t;if(!(null==e||null==(t=e.current)?void 0:t.chart))return;let n=()=>{var t,n;s.current=null,null==(n=e.current)||null==(t=n.chart)||t.reflow()};"requestIdleCallback"in window?(d(),s.current=window.requestIdleCallback(n,{timeout:100})):(0,i.E0)(n)}catch(e){console.error("Failed to resize the plot to parent width",e)}});a.useEffect(()=>((0,r.B1)(r.Du.ToggleSideBar,u),(0,r.B1)(r.Du.ToggleAIAssistantPanel,u),()=>{(0,r.al)(r.Du.ToggleSideBar,u),(0,r.al)(r.Du.ToggleAIAssistantPanel,u),d()}),[u,d]),a.useEffect(()=>{n.current?u():n.current=!0},[c,u])}}
3,12667:(e,t,n)=>{n.d(t,{y:()=>i});var a=n(57090);n(12115);var r=n(74547),o=n(89069);let i=e=>{let t=(0,o.h)();return(0,a.Y)(r._P,{...e,disabled:e.disabled||t,"data-sentry-element":"AntdSelect","data-sentry-component":"GatedSelect","data-sentry-source-file":"GatedSelect.tsx"})}},12859:(e,t,n)=>{n.d(t,{R:()=>o});var a=n(62346),r=n(544);let o=(e,t)=>(0,a.z_)(e,e=>(0,r.xU)(t,e))},12866:(e,t,n)=>{n.d(t,{F7:()=>r,a1:()=>o,Ry:()=>l,pn:()=>c,UX:()=>s});var a=n(90590);let r=Symbol("scenario-simulation-failure"),o=e=>e===r,i=new Map,l=(e,t)=>{var n;if(!e)return;let r=null!=(n=i.get(e))?n:new Map;r.set((0,a.Od)(t),t),i.set(e,r)},s=e=>{let t=i.get(e);return void 0===t?[]:(i.delete(e),Array.from(t.values()))},c=(e,t)=>e?null!=t?{kind:"result",result:t}:{kind:"waiting"}:{kind:"failure"}},13173:(e,t,n)=>{n.d(t,{W:()=>a.A,m:()=>r.A});var a=n(23699),r=n(48675)},13360:(e,t,n)=>{n.d(t,{Js:()=>u,NP:()=>p,Xp:()=>h,bA:()=>v,cc:()=>m,eU:()=>f,o6:()=>g,s:()=>y});var a=n(84400),r=n(57090);n(12115);var o=n(62570),i=n(74547),l=n(23462),s=n(36934),c=n(81671);function d(){let e=(0,a._)(["\n          & button,\n          & > span > button {\n            justify-content: flex-start;\n            padding: 0;\n            text-align: left;\n          }\n        "]);return d=function(){return e},e}let u=e=>{let{size:t="sm",...n}=e;return(0,r.Y)(i.$n,{size:t,...n,"data-sentry-element":"Button","data-sentry-component":"PortfolioActionButton","data-sentry-source-file":"atoms.tsx"})},m=e=>{let{size:t="sm",...n}=e;return(0,r.Y)(i.$n,{size:t,...n,"data-sentry-element":"Button","data-sentry-component":"DeletePortfolioButton","data-sentry-source-file":"atoms.tsx"})},p=e=>{let{disabled:t,...n}=e;return(0,r.Y)(i.In,{icon:c.$.TrashCan,className:"".concat(t?"text-[#d9d9d9]":"text-danger"),...n,"data-sentry-element":"Icon","data-sentry-component":"DeletePortfolioIcon","data-sentry-source-file":"atoms.tsx"})},y=e=>{let{disabled:t,...n}=e;return(0,r.Y)(i.In,{icon:c.$.Pencil,className:"".concat(t?"text-[#d9d9d9]":"text-primary"),...n,"data-sentry-element":"Icon","data-sentry-component":"EditPortfolioIcon","data-sentry-source-file":"atoms.tsx"})},h=e=>{let{disabled:t,...n}=e;return(0,r.Y)(i.In,{icon:c.$.EyeOpen,className:"".concat(t?"text-[#d9d9d9]":"text-primary"),...n,"data-sentry-element":"Icon","data-sentry-component":"ViewPortfolioIcon","data-sentry-source-file":"atoms.tsx"})},f=(0,o.A)("div",{target:"epgiist0"})("width:",e=>e.isMenuItem?"100%":"initial",";",e=>e.isMenuItem?(0,l.AH)(d()):""),g=(0,o.A)(s.ZB,{target:"epgiist1"})("display:inline-flex;align-items:center;align-content:center;justify-content:space-between;gap:8px;width:100%;"),v=(0,o.A)(i.Dr,{target:"epgiist2"})("> span{flex:unset;}")},13641:(e,t,n)=>{n.d(t,{N:()=>eI});var a=n(57090),r=n(12115),o=n(33624),i=n(98870),l=n(22462),s=n(51305),c=n(67891),d=n(67818),u=n(12919),m=n(99750),p=n(78046),y=n(62570),h=n(92672),f=n(50343),g=n(40248),v=n(74547);let x=(0,y.A)(p.lV,{target:"epecbks0"})("display:flex;flex-direction:column;flex-wrap:wrap;justify-content:flex-start;align-items:flex-start;",(0,h.MF)(16)),A=(0,y.A)(f.JF,{target:"epecbks1"})(".ant-form-item-control-input-content{height:40px;}"),S=(0,y.A)(f.JF,{target:"epecbks2"})((0,h.BK)({minWidth:["128px"]})),b=(0,y.A)(f.JF,{target:"epecbks3"})(),C=(0,y.A)("div",{target:"epecbks4"})("width:100%;display:grid;row-gap:16px;",(0,h.BK)({gridTemplateColumns:["1fr","3fr 1fr"]}),"  >:first-of-type{",(0,h.BK)({order:[2,"initial"],marginRight:["0","16px"]}),"}>:nth-of-type(2){",(0,h.BK)({order:[1,"initial"]}),"}>:nth-of-type(3){",(0,h.BK)({width:["100%","48%"],gridColumn:["1 / 4","1 / 3"]}),"}>:nth-of-type(4){",(0,h.BK)({order:[3,"initial"]}),"}"),I=(0,y.A)(f.JF,{target:"epecbks5"})("width:100%;.ant-form-item-control-input-content{height:40px;}"),w=(0,y.A)("div",{target:"epecbks6"})("width:100%;display:grid;",(0,h.BK)({gap:["16px","24px"]})," ",e=>e.fullWidthItems?(0,h.BK)({gridTemplateColumns:["1fr"]}):(0,h.BK)({gridTemplateColumns:["1fr","1fr 1fr"]})),P=(0,y.A)(h.Ah,{target:"epecbks7"})("padding:8px 16px;align-items:center;flex:1 0 0;align-self:stretch;",(0,h.MF)(16),";",(0,h.KY)(16),";border-radius:var(--card-border-radius,8px);background:",e=>e.theme.colors.neutral50,";"),k=(0,y.A)(v._P,{target:"epecbks8"})("width:100%;min-width:160px;"),F=(0,y.A)(g.A,{target:"epecbks9"})("margin-top:24px;",(0,h.BK)({width:["100%","48%"]}));var T=n(36934),E=n(48779),Y=n(54674),D=n(14530),R=n(50908),N=n(6558),M=n(56490),L=n(8305),_=n(95825);let O=e=>(0,a.Y)(_.Ay,{title:"Add more info?",open:e.isOpen,centered:!0,destroyOnClose:!0,closable:!0,maskClosable:!0,keyboard:!0,onCancel:e.onAddressWarning,size:_.rI.Sm,footer:(0,a.FD)(_.jl,{children:[(0,a.Y)(g.A,{onClick:e.onIgnoreWarning,children:"Continue anyway"}),(0,a.Y)(g.A,{variant:"filled",onClick:e.onAddressWarning,children:"Add more details"})]}),"data-sentry-element":"Modal","data-sentry-component":"ReducedSystemAccuracyPopup","data-sentry-source-file":"ReducedSystemAccuracyPopup.tsx",children:"Filling in more details about the security will help produce a more accurate analysis. You could also use a proxy security to fill in details automatically."});var W=n(65438);let B=e=>{let{value:t,setTrue:n,setFalse:o}=(0,W.A)(!1),i=async()=>{await e.onConfirm(),o()};return(0,a.FD)(r.Fragment,{children:[e.renderCTA(()=>{n()}),(0,a.Y)(_.Ay,{disableSubmitOnEnter:!0,title:"Security reset",open:t,centered:!0,destroyOnClose:!0,closable:!0,maskClosable:!0,keyboard:!0,onOk:i,okText:"Reset security",okButtonProps:{color:"danger"},onCancel:()=>{o(),e.onCancel()},cancelText:"Cancel",size:_.rI.Sm,"data-sentry-element":"Modal","data-sentry-source-file":"ResetSecurityConfirmation.tsx",children:"Modified parameters of the security will be reset to their system values"})]})};var U=n(8921);let z=e=>{let{color:t="#BE185D"}=e;return(0,a.Y)("svg",{width:"26",height:"24",viewBox:"0 0 26 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-sentry-element":"svg","data-sentry-component":"WarningIcon","data-sentry-source-file":"WarningIcon.tsx",children:(0,a.Y)("path",{d:"M2.96 23.3388H23.04C25.0933 23.3388 26.3733 21.1121 25.3467 19.3388L15.3067 1.99211C14.28 0.218776 11.72 0.218776 10.6933 1.99211L0.653332 19.3388C-0.373334 21.1121 0.906665 23.3388 2.96 23.3388ZM13 14.0054C12.2667 14.0054 11.6667 13.4054 11.6667 12.6721V10.0054C11.6667 9.27211 12.2667 8.67211 13 8.67211C13.7333 8.67211 14.3333 9.27211 14.3333 10.0054V12.6721C14.3333 13.4054 13.7333 14.0054 13 14.0054ZM14.3333 19.3388H11.6667V16.6721H14.3333V19.3388Z",fill:t,"data-sentry-element":"path","data-sentry-source-file":"WarningIcon.tsx"})})};var V=n(58155);let j=e=>{let{children:t,isSystemTrackedSecurity:n}=e,{theme:o}=(0,V.OM)(),i=n?(0,a.Y)(r.Fragment,{children:"You can choose a proxy security to use instead of the current market assumptions."}):(0,a.Y)(r.Fragment,{children:"You can choose a proxy security to track until we map the original properly. We'll replace the proxy with the original properties once security is mapped."});return(0,a.FD)(P,{"data-sentry-element":"SecurityProxyNoticeContainer","data-sentry-component":"SecurityProxyFeatureNotice","data-sentry-source-file":"SecurityProxyFeatureNotice.tsx",children:[n?null:(0,a.Y)(z,{color:o.colors.amber500}),(0,a.FD)(h.Ah,{flexDirection:"column",alignItems:"flex-start",flex:"1 0 0",itemsSpacingHorizontal:8,itemsSpacingVertical:8,"data-sentry-element":"FlexLayout","data-sentry-source-file":"SecurityProxyFeatureNotice.tsx",children:[(0,a.Y)(T.lc,{className:"text-body","data-sentry-element":"Body1W600","data-sentry-source-file":"SecurityProxyFeatureNotice.tsx",children:n?"Something wrong?":"Untracked security"}),(0,a.Y)(T.km,{className:"text-neutral-500","data-sentry-element":"Body2W400","data-sentry-source-file":"SecurityProxyFeatureNotice.tsx",children:i}),t]})]})};var H=n(35208),q=n(10102);let G=e=>{let{securityAssetClassesOptions:t,securitySectorsOptions:n,securityCountriesOptions:i,securityBondTypesOptions:l}=(0,q.t)(),s=e.isBondTypeClassification?"Type of bond":"Sector",c=e.isBondTypeClassification?l:n,d={dropdownStyle:{zIndex:H.Bf.select},getPopupContainer:e=>e.parentNode||document.body,disabled:e.disabled,allowClear:!0,showSearch:!0};return(0,a.FD)(r.Fragment,{children:[(0,a.Y)(f.JF,{name:Y.lf.assetClass,label:"Asset class",messageVariables:{name:"Asset class"},hasFeedback:!1,rules:[{required:e.isPrimaryProxyStatsMandatory,whitespace:e.isPrimaryProxyStatsMandatory},()=>({validator:(t,n)=>e.isPrimaryProxyStatsMandatory&&(0,D.T8)(n)?Promise.reject(Error("Please select known asset class")):Promise.resolve()})],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"SecurityClassificationFormItems.tsx",children:(0,a.Y)(k,{...d,options:t,"data-sentry-element":"SecurityManagementFormSelect","data-sentry-source-file":"SecurityClassificationFormItems.tsx"})}),(0,a.Y)(f.JF,{name:Y.lf.country,label:"Country",messageVariables:{name:"Country"},hasFeedback:!1,"data-sentry-element":"StyledFormItem","data-sentry-source-file":"SecurityClassificationFormItems.tsx",children:(0,a.Y)(k,{...d,options:i,filterOption:!0,optionFilterProp:"label","data-sentry-element":"SecurityManagementFormSelect","data-sentry-source-file":"SecurityClassificationFormItems.tsx"})}),(0,a.Y)(f.JF,{name:Y.lf.sector,label:s,messageVariables:{name:s},hasFeedback:!1,dependencies:[Y.lf.assetClass],rules:[{required:e.isBondTypeClassification&&!e.disabled,whitespace:e.isBondTypeClassification&&!e.disabled,message:"Type of bond is required"},()=>({validator(t,n){if(e.disabled)return Promise.resolve();let a=o.TjK(e=>e.value,c);return n&&!o.mKk(n,a)?Promise.reject(Error(e.isBondTypeClassification?"Please select a valid type of bond":"Please select a valid sector")):Promise.resolve()}})],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"SecurityClassificationFormItems.tsx",children:(0,a.Y)(k,{...d,options:c,"data-sentry-element":"SecurityManagementFormSelect","data-sentry-source-file":"SecurityClassificationFormItems.tsx"})})]})};var K=n(39655),Q=n(38484),$=n(513);let X=e=>{let{isStatsLoading:t,children:n}=e;return(0,a.Y)(w,{fullWidthItems:!!e.fullWidthItems,"data-sentry-element":"SecurityStatsFieldsContainer","data-sentry-component":"SecurityStatsFieldsWrapper","data-sentry-source-file":"SecurityStatsFieldsWrapper.tsx",children:t?(0,a.Y)(r.Fragment,{children:o.uxO((0,a.FD)(h.Ah,{flexDirection:"row",itemsSpacingVertical:8,children:[(0,a.Y)($._R,{}),(0,a.Y)($._R,{})]}),e.skeletonFieldSetCount)}):n})};var J=n(43057),Z=n(82949),ee=n(35209),et=n(17143);let en=(e,t)=>{let n=t?(0,Z.M_)(e):e;return(0,et.$S)(n)},ea=e=>{let[t,n]=r.useState(()=>en(o.vUk("",e.value),e.isCustomTickerMode));return(0,a.Y)(ee.A,{inForm:!0,value:t,isDisabled:e.disabled,onChange:t=>{var a;
3n(en(t,e.isCustomTickerMode)),null==(a=e.onChange)||a.call(e,((e,t)=>{let n=t?(0,Z.Lb)(e):e;return(0,et.$S)(n)})(t,e.isCustomTickerMode))},"data-sentry-element":"Input","data-sentry-component":"CustomizedTickerFormInput","data-sentry-source-file":"CustomizedTickerFormInput.tsx"})};var er=n(98483),eo=n(39633);let ei=(e,t,n)=>{var a,r,i;let l=(0,D.GX)(),s=o.vUk(l,n),c=o.vUk(l,t),d=null!=(r=null!=(a=null==n?void 0:n.seriesNameOverride)?a:null==t?void 0:t.seriesName)?r:null,u=null!=(i=null==t?void 0:t.currentPrice)?i:null,m=s.proxyTicker?{...l,proxyTicker:s.proxyTicker}:{proxyTicker:null,assetClass:s.assetClass||c.assetClass,country:s.country||c.country,sector:s.sector||c.sector,dividendYield:s.dividendYield||c.dividendYield,expectedReturn:s.expectedReturn||c.expectedReturn,expectedRisk:s.expectedRisk||c.expectedRisk};return(0,D.LL)({...m,seriesName:d,currentPrice:u,ticker:e})};var el=n(31260),es=n(97765),ec=n(42463),ed=n(31585);let eu={freezeTicker:!1,freezeSeriesName:!1,freezeInvestmentAmount:!1,hideInvestmentAmount:!1};var em=n(44561),ep=n(31695),ey=n(61443),eh=n(78561),ef=n(544);let eg=e=>{let{contextPortfolio:t,ticker:n,onEditHoldingClickProcessed:r,onEditTransactionClickProcessed:o}=e,{isInvestmentsEditable:i,isNonEditableCurrentPortfolio:l,portfolioTableActionClickHandler:s}=(0,ey.i)(t),{openTransactionsPage:c}=(0,ep.E)(),{launchConnectedPortfolioEdit:d}=(0,eh.h)(),u=!(0,ef.uF)(t);return(0,a.FD)(h.Ah,{display:"block",itemsSpacingVertical:16,"data-sentry-element":"FlexLayout","data-sentry-component":"EditSecurityHolding","data-sentry-source-file":"EditSecurityHolding.tsx",children:[i||l?(0,a.FD)(h.Ah,{display:"block",itemsSpacingVertical:12,children:[(0,a.Y)(T.bU,{className:"text-body",children:"Holding information (# of shares / amount)"}),(0,a.FD)(v.$n,{className:"whitespace-normal break-words text-left",fullWidth:!0,onClick:()=>{l?d(t,n):s(),r()},children:["Edit holding info for ",n]})]}):null,u?(0,a.FD)(h.Ah,{display:"block",itemsSpacingVertical:12,children:[(0,a.Y)(T.bU,{className:"text-body",children:"Transaction information (for unrealized gains and tax impact)"}),(0,a.FD)(v.$n,{className:"whitespace-normal break-words text-left",fullWidth:!0,onClick:()=>{c({searchTicker:n}),o()},children:["Edit transactions for ",n]})]}):null]})};var ev=n(62346),ex=n(50202),eA=n(11325),eS=n(13340);let eb=e=>{let{data:t=[]}=(0,ev.uv)(e.portfolio.portfolioId),{isInvestmentsEditable:n,isNonEditableCurrentPortfolio:r,portfolioTableActionClickHandler:i}=(0,ey.i)(e.portfolio),{openTransactionsPage:l}=(0,ep.E)(),{launchConnectedPortfolioEdit:s}=(0,eh.h)(),c=o.I6j(t=>(0,et.cp)(t.ticker,e.ticker),t);if(!c)return null;let d=!(0,ef.uF)(e.portfolio);return(0,a.FD)(h.Ah,{display:"block",itemsSpacingVertical:8,"data-sentry-element":"FlexLayout","data-sentry-component":"EditSecurityHoldingForPortfolio","data-sentry-source-file":"EditSecurityHoldingMultiPortfolio.tsx",children:[(0,a.Y)(T.s9,{className:"text-neutral-500","data-sentry-element":"Body2W600","data-sentry-source-file":"EditSecurityHoldingMultiPortfolio.tsx",children:e.portfolio.portfolioName}),(0,a.FD)(h.Ah,{itemsSpacingHorizontal:16,itemsSpacingVertical:12,flexWrap:"wrap",equalWidthItems:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"EditSecurityHoldingMultiPortfolio.tsx",children:[d?(0,a.Y)(v.$n,{fullWidth:!0,onClick:()=>{l({searchTicker:e.ticker,portfolioIds:[e.portfolio.portfolioId]}),e.onEditTransactionClickProcessed()},children:"Edit transactions"}):null,n||r?(0,a.FD)(v.$n,{fullWidth:!0,onClick:()=>{r?s(e.portfolio,e.ticker):i(),e.onEditHoldingClickProcessed()},children:["Edit holding (",(0,a.Y)(eA.eF,{amount:c.amount,sourceCurrency:eS.mF,currencyFormatter:eA.EB.HumanizedCompactAmount}),")"]}):null]})]})},eC=e=>{let{currentPortfolios:t}=(0,ex.RW)();return(0,a.Y)(h.Ah,{display:"block",itemsSpacingVertical:16,"data-sentry-element":"FlexLayout","data-sentry-component":"EditSecurityHoldingMultiPortfolio","data-sentry-source-file":"EditSecurityHoldingMultiPortfolio.tsx",children:o.TjK(t=>(0,a.Y)(eb,{portfolio:t,ticker:e.ticker,onEditHoldingClickProcessed:e.onEditHoldingClickProcessed,onEditTransactionClickProcessed:e.onEditTransactionClickProcessed},t.portfolioId),t)}
3)},eI=e=>{var t;let{contextPortfolio:n,managementMode:y,formMode:h,initialValues:g,formFieldsCustomControl:w,onInvestmentDetailsSubmitted:P=i.A,onProxyMappingUpserted:k=i.A,onProxyMappingRemoved:_=i.A,onClose:z,onExternalSecurityActionInitiated:V=i.A}=e,[q]=(0,p.mN)(),{isBelow576:$}=(0,m.uF)(),{networthDetail:ee}=g,{managementMode:en,setManagementMode:ep,isCreateMode:ey,isEditMode:eh,isProxyManagementMode:ef,isCustomManagementMode:ev,preferredCurrency:ex,preferredCurrencySymbol:eA}=((e,t)=>{let{preferredCurrency:n}=(0,el.yf)(),{preferredCurrencySymbol:a}=(0,es._)(),[o,i]=r.useState(e),{isCreateMode:l,isEditMode:s,isProxyManagementMode:c,isCustomManagementMode:d}=(0,D.Yd)(o,t);return{managementMode:o,setManagementMode:i,isCreateMode:l,isEditMode:s,isProxyManagementMode:c,isCustomManagementMode:d,preferredCurrency:n,preferredCurrencySymbol:a}})(y,h),eS=(0,p.r3)(Y.lf.ticker,q),eb=(0,p.r3)(Y.lf.proxyTicker,q),eI=(0,p.r3)(Y.lf.assetClass,q),{proxyTickerInput:ew,setProxyTickerInput:eP,filterProxyOption:ek,proxyTickerOptions:eF,isProxyTickerOptionsLoading:eT,proxySecurityStats:eE,isProxySecurityStatsLoading:eY,isProxySecurityStatsQueryIdle:eD,isProxySecurityStatsLoaded:eR}=(()=>{let{inputTicker:e,setInputTicker:t,inputTickerOptions:n,isTickerOptionsLoading:a,filterOption:o}=(0,K.A)(),{data:i,isLoading:l,isIdle:s,isSuccess:c}=(0,Q.w6)(e,{cachePrefix:"ProxyOptionStats",enableQuery:!0});return{proxyTickerInput:e,setProxyTickerInput:t,filterProxyOption:o,proxyTickerOptions:n,isProxyTickerOptionsLoading:a,proxySecurityStats:(0,r.useMemo)(()=>i?(0,D.ch)(i):void 0,[i]),isProxySecurityStatsLoading:l,isProxySecurityStatsQueryIdle:s,isProxySecurityStatsLoaded:c}})(),eN=((e,t,n,a,r,i)=>{let{isProxyManagementMode:l,isCustomManagementMode:s}=(0,D.Yd)(e,t),d=o.VxE(o.o8B(eu),o.vUk({},n)),u=!a||(0,Z.Od)(a),m=d.freezeTicker,p=d.freezeSeriesName,y=d.freezeInvestmentAmount,h=d.hideInvestmentAmount,{proxyTickerInput:f,proxyTickerOptions:g,isProxySecurityStatsLoaded:v}=r,x=!l||c.A(f)&&ec.A(g);return{isTickerReadOnly:m,isSeriesNameReadOnly:p,isInvestmentAmountReadOnly:y,isInvestmentAmountHidden:h,isCustomSecurityProxyFlow:u,isSecurityStatsFieldsReadOnly:l,isProxySecurityOptionAvailable:(l||s)&&!i,isPrimaryProxyStatsMandatory:!l,isSecurityStatsFieldsVisible:x,isAsyncFormDataSeeded:!l||v}})(en,h,w,eS,{proxyTickerInput:ew,proxyTickerOptions:eF,isProxySecurityStatsLoaded:eR},!!ee),eM=!eN.isTickerReadOnly,eL=n&&eN.isTickerReadOnly,{isFetching:e_,isLoaded:eO,isStale:eW,tickerSecurityProxyDetails:eB,isTickerSystemTracked:eU}=((e,t)=>{let{enableSync:n}=t,a=er.A(e)?e:"",i=(0,Z.M_)(a),l=(0,Z.Lb)(a),[s]=(0,eo.A)(i,1e3),[c]=(0,eo.A)(l,1e3),{data:d,isFetching:u,isSuccess:m}=(0,Q.w6)(s,{cachePrefix:"DynamicTickerProxySync",enableQuery:n}),{data:p,isFetching:y,isSuccess:h}=(0,Q.Vn)(s,{cachePrefix:"DynamicTickerProxySync",enableQuery:n}),{data:f,isFetching:g,isSuccess:v}=(0,Q.Vn)(c,{cachePrefix:"DynamicTickerProxySync",enableQuery:n}),x=m&&h&&v,A=o.AU6(o.Uo6(o.aIS(s,i),o.aIS(c,l))),S=!!x&&(null==d?void 0:d.isTickerTracked),b=(0,r.useMemo)(()=>{if(x)if(S)return ei(s,d,p);else return ei(c,null,f);return null},[f,s,c,x,S,d,p]);return{isFetching:u||y||g,isLoaded:x,isStale:A,tickerSecurityProxyDetails:b,isTickerSystemTracked:S}})(eS,{enableSync:eM}),ez=o.WPk(()=>eM,()=>e_||eW)(),eV=(0,Q.tt)(),ej=(0,Q.mn)(),[eH]=r.useState(()=>(0,D.MO)(g,ex)),eq=eH.proxyTicker,eG=eH.ticker,eK=r.useRef(!1),eQ=!!(null==(t=g.systemSecurityTickerDetails)?void 0:t.isTickerTracked),e$=o.aIS(eG,eS),eX=(0,p.r3)(Y.lf.useProxyTickerSelected,q),eJ=(()=>
3{let e=l.A(g.proxyDetails);return eh&&e$&&e})(),eZ=s.A(eG,eS),e0=eM?eU:eQ,[e1,e2]=r.useState(!1),e4=(0,m.tb)(["100vw","608px"]),e5=(0,m.tb)([!1,!0]),e6=()=>{q.submit()},{isWarningVisible:e3,showWarning:e8,onIgnoreWarning:e7,onAddressWarning:e9}=(e=>{let{onIgnore:t,onAddress:n}=e,{value:a,setTrue:r,setFalse:o}=(0,W.A)(!1);return{isWarningVisible:a,showWarning:r,closeWarning:o,onIgnoreWarning:()=>{t(),o()},onAddressWarning:()=>{n(),o()}}})({onIgnore:e6,onAddress:i.A});!eK.current&&(eK.current=!0,eq&&ef&&q.setFieldsValue({[Y.lf.useProxyTickerSelected]:!0,[Y.lf.proxyTicker]:eq})),r.useEffect(()=>{eP(null!=eb?eb:"")},[eP,eb]),r.useEffect(()=>{if(eM&&eO&&!eW&&eB){let{ticker:e,proxyTicker:t,seriesName:n,currentPrice:a,...r}=eB;q.setFieldsValue({[Y.lf.ticker]:e}),q.setFieldsValue({[Y.lf.currentPrice]:a}),n&&q.setFieldsValue({[Y.lf.investment]:n});let o=c.A(t)&&t;if(o)ep(d.x.Proxy),q.setFieldsValue({[Y.lf.useProxyTickerSelected]:!0,[Y.lf.proxyTicker]:t});else if(!o&&(ep(d.x.Custom),q.setFieldsValue({[Y.lf.useProxyTickerSelected]:!1,[Y.lf.proxyTicker]:E.Dh}),r)){let e=(0,D.g2)(r);q.setFieldsValue({...e})}}},[eM,eB,eO,eW,q,ep]),r.useEffect(()=>{ef&&eR&&eE&&q.setFieldsValue((0,D.LL)((0,D.g2)(eE)))},[q,ef,eR,eE]);let te=()=>{q.resetFields(),z()},tt=()=>{te()},tn=()=>{V(),te()},ta=async()=>{let e=q.getFieldsValue(),t=(0,D.YB)(e,ex),n=(0,D.Dd)(t),a=await (0,D.sj)(t,en),r={...n,investment:o.vUk("",a.seriesName)},i=(0,D.Tf)({...r,...a});return{upsertableInvestmentItem:r,proxyMappedSecurityData:a,metadata:{isSecurityProxyFieldsOverridden:i,isTickerOnlyUpdate:eZ&&!i,isComprehensiveDetailsMissing:!(0,D.ng)(t),managementMode:en}}},tr=async()=>{try{await q.validateFields()}catch(e){return}let{upsertableInvestmentItem:e,metadata:{isSecurityProxyFieldsOverridden:t,isTickerOnlyUpdate:n,isComprehensiveDetailsMissing:a}}=await ta();if(n){let n=q.getFieldsValue(),r={...e,investment:o.vUk("",n.investment)};await P(r,eG,{isSecurityProxied:t,isComprehensiveDetailsMissing:a}),te();return}if(t){if(ev&&a)return void e8()}else throw Error("Override security characteristics to proceed");e6()},to=async()=>{e2(!0);try{let{proxyMappedSecurityData:e,upsertableInvestmentItem:t,metadata:{isSecurityProxyFieldsOverridden:n,isComprehensiveDetailsMissing:a}}=await ta();await P(t,eG,{isSecurityProxied:n,isComprehensiveDetailsMissing:a}),await eV.mutateAsync({...e,networthDetail:ee?(0,R.r)(ee,{name:e.seriesName,oneYearExpectedReturn:e.expectedReturn,sector:e.sector,risk:e.expectedRisk,country:e.country,assetClass:e.assetClass}):null},{onSuccess:()=>{k(e.ticker),te(),(0,U.Ds)(U._n.Success,ey?"The security was created":"The security was updated")}})}finally{e2(!1)}},ti=async()=>{eJ&&eG&&await ej.mutateAsync({investmentTicker:eG,networthDetail:ee},{onSuccess:()=>{_(eG),(0,U.Ds)(U._n.Success,"Security reset to defaults"),te()}})};return(0,a.FD)(r.Fragment,{children:[(0,a.Y)(u._s,{open:!0,title:ey?"Add custom security":eh?"Edit security":void 0,width:e4,destroyOnClose:!0,onClose:tt,closable:!0,keyboard:!0,maskClosable:e5,footer:(0,a.FD)(u.tb,{children:[(0,a.Y)(v.$n,{onClick:tt,children:"Cancel"}),(0,a.Y)(v.$n,{variant:"filled",htmlType:"submit",loading:e1,disabled:!eN.isAsyncFormDataSeeded||ez,onClick:tr,showErrorNotification:!0,children:"Save"})]}),"data-sentry-element":"Drawer","data-sentry-source-file":"SecurityWorkflowManager.tsx",children:(0,a.FD)(v.Ah,{display:"block",itemsSpacingVertical:24,"data-sentry-element":"FlexLayout","data-sentry-source-file":"SecurityWorkflowManager.tsx",children:[(0,a.FD)(x,{form:q,name:"securityManagementForm",colon:!1,preserve:!0,requiredMark:!0,initialValues:eH,onValuesChange:(e,t)=>
3{if(Y.lf.useProxyTickerSelected in e&&(e.useProxyTickerSelected?ep(d.x.Proxy):(q.setFieldsValue({[Y.lf.proxyTicker]:E.Dh}),ep(d.x.Custom))),Y.lf.sector in e&&eN.isPrimaryProxyStatsMandatory){let n=e[Y.lf.sector],a=n&&!(0,D.T8)(n),r=t[Y.lf.assetClass],o=!r||(0,D.T8)(r);a&&o&&q.setFieldsValue({[Y.lf.assetClass]:em.q$})}else if(Y.lf.assetClass in e){let t=e[Y.lf.assetClass];(0,D.t)(t)&&q.setFieldsValue({[Y.lf.sector]:null})}},onFinish:to,"data-sentry-element":"StyledForm","data-sentry-source-file":"SecurityWorkflowManager.tsx",children:[(0,a.FD)(C,{"data-sentry-element":"InvestmentBasicDetailsContainer","data-sentry-source-file":"SecurityWorkflowManager.tsx",children:[(0,a.Y)(A,{name:Y.lf.investment,label:"Name",messageVariables:{name:"Name"},hasFeedback:!1,rules:[{required:!0,whitespace:!0}],"data-sentry-element":"SeriesNameFormItem","data-sentry-source-file":"SecurityWorkflowManager.tsx",children:(0,a.Y)(v.pd,{isDisabled:eN.isSeriesNameReadOnly,inForm:!0,"data-sentry-element":"Input","data-sentry-source-file":"SecurityWorkflowManager.tsx"})}),(0,a.Y)(S,{name:Y.lf.ticker,label:"Ticker",messageVariables:{name:"Ticker"},hasFeedback:!1,rules:(e=>{let t={type:"string",required:!0},n=[{...t,whitespace:!0},{validator:N.XT},{validator:N.gJ},e.isCustomSecurityProxyFlow?{validator:D.WI}:{}];return e.isTickerReadOnly?[t]:o.kuo(ed.A,n)})(eN),"data-sentry-element":"TickerFormItem","data-sentry-source-file":"SecurityWorkflowManager.tsx",children:(0,a.Y)(ea,{disabled:eN.isTickerReadOnly,isCustomTickerMode:eN.isCustomSecurityProxyFlow,"data-sentry-element":"CustomizedTickerFormInput","data-sentry-source-file":"SecurityWorkflowManager.tsx"})}),(0,a.Y)(f.JF,{hidden:!0,name:Y.lf.currentPrice,"data-sentry-element":"StyledFormItem","data-sentry-source-file":"SecurityWorkflowManager.tsx",children:(0,a.Y)("input",{})}),(0,a.Y)(b,{name:Y.lf.amount,label:"Amount (Market Value)",messageVariables:{name:"Amount"},hasFeedback:!1,hidden:eN.isInvestmentAmountHidden,rules:eN.isInvestmentAmountHidden?[]:(0,N.lB)(),preserve:!0,"data-sentry-element":"AmountFormItem","data-sentry-source-file":"SecurityWorkflowManager.tsx",children:(0,a.Y)(f.J$,{size:"lg",humanizeNumber:!0,addonBefore:eA,disabled:eN.isInvestmentAmountReadOnly,"data-sentry-element":"AmountInput","data-sentry-source-file":"SecurityWorkflowManager.tsx"})})]}),eN.isProxySecurityOptionAvailable?(0,a.FD)(X,{isStatsLoading:ez,skeletonFieldSetCount:1,fullWidthItems:!0,children:[(0,a.Y)(j,{isSystemTrackedSecurity:!!e0,children:(0,a.Y)(T.km,{className:"text-neutral-500",children:(0,a.Y)(f.JF,{name:Y.lf.useProxyTickerSelected,valuePropName:"checked",noStyle:!0,rules:[{type:"boolean"}],children:(0,a.Y)(v.Sc,{children:"Use proxy security instead"})})})}),eX?(0,a.Y)(J.Ay,{theme:{components:{Select:{zIndexPopup:10*H.Bf.drawer}}},children:(0,a.Y)(I,{name:Y.lf.proxyTicker,label:(0,a.Y)(M.A,{label:"Proxy name or ticker",overlayStyle:{maxWidth:$?"80vw":"560px"},overlayInnerStyle:{overflow:"auto",maxHeight:"300px"},title:"This proxy's exposure profile and capital markets assumptions will be used by the system. When choosing a proxy, you could start by searching for similarly named securities or look through security prospectuses. Good proxies are typically of the same asset class and share similar economic exposures (e.g., same country and sector composition; similar market caps and trading volumes for underlying securities). Great proxies typically have similar correlations, volatilities, and return profiles. If looking to proxy a fund, consider management strategy (e.g., active vs. passive), expense ratio, and any benchmark index tracked as well."}),messageVariables:{name:"Proxy ticker"},hasFeedback:!1,rules:[{validator:N.gJ},{required:eX},e=>{let{getFieldValue:t}=e;return{validator:(e,n)=>eX&&n&&(0,et.cp)(t(Y.lf.ticker),n)?Promise.reject(Error("A ticker cannot be its own proxy. Please select a different proxy ticker.")):Promise.resolve()}}],children:(0,a.Y)(f.Iv,{allowsCustomValue:!0,items:eF,isLoading:eT,notFoundContent:(()=>{if(eD);else if(eT)return"Loading";else if(ew)return"No matching security found";return null})(),placeholder:"Search",filterOption:ek})})}):null]}):null,eN.isSecurityStatsFieldsVisible?(0,a.FD)(X,{isStatsLoading:eY||ez,skeletonFieldSetCount:5,children:[(0,a.Y)(f.JF,{name:Y.lf.expectedReturn,label:(0,a.Y)(M.A,{label:"1-year expected returns",title:"Your estimate of performance over the next 12 months"}),messageVariables:{name:"Expected returns"},hasFeedback:!1,rules:[{type:"number",min:-50,max:50,message:"Must be in the range -50% to 50%"}],children:(0,a.Y)(v.YI,{addonAfter:"%",disabled:eN.isSecurityStatsFieldsReadOnly})}),(0,a.Y)(f.JF,{name:Y.lf.expectedRisk,label:(0,a.Y)(M.A,{label:"Risk (annualized volatility)",title:"Your estimate of the annualized standard deviation of returns over the next 12 months"}),messageVariables:{name:"Risk"},hasFeedback:!1,rules:[{type:"number",min:0,max:100,message:"Must be in the range 0 to 100"}],children:(0,a.Y)(v.YI,{addonAfter:"%",disabled:eN.isSecurityStatsFieldsReadOnly})}),(0,a.Y)(f.JF,{label:(0,a.Y)(M.A,{label:"Dividend yield",title:L.FY}),name:Y.lf.dividendYield,rules:[{type:"number",min:0,max:100,message:"Must be in the range 0 to 100"}],children:(0,a.Y)(v.YI,{addonAfter:"%",fractionDigits:2,disabled:eN.isSecurityStatsFieldsReadOnly})}),(0,a.Y)(G,{disabled:eN.isSecurityStatsFieldsReadOnly,isPrimaryProxyStatsMandatory:eN.isPrimaryProxyStatsMandatory,isBondTypeClassification:(0,D.t)(eI)})]}):null,eJ?(0,a.Y)(B,{renderCTA:e=>(0,a.Y)(F,{variant:"outlined",color:"danger",onClick:e,children:"Reset this security to original"}),onConfirm:ti,onCancel:()=>{i.A()}}):null]}),eL?(0,a.Y)(eg,{contextPortfolio:n,ticker:eS,onEditHoldingClickProcessed:tn,onEditTransactionClickProcessed:tn}):null,!n&&eN.isTickerReadOnly?(0,a.Y)(eC,{ticker:eS,onEditHoldingClickProcessed:tn,onEditTransactionClickProcessed:tn}):null]})}),(0,a.Y)(O,{isOpen:e3,onIgnoreWarning:e7,onAddressWarning:e9,"data-sentry-element":"ReducedSystemAccuracyPopup","data-sentry-source-file":"SecurityWorkflowManager.tsx"})]})}},13897:(e,t,n)=>{n.d(t,{S:()=>i});var a=n(81527),r=n(84245),o=n(67883);let i=e=>(0,a.I)(r.Dh.investmentValue(e),()=>(0,o.xB)(e))},13977:(e,t,n)=>{n.d(t,{Ei:()=>s,zX:()=>c});
3var a=n(62031),r=n.n(a),o=n(78190),i=n(33624),l=n(46165);let s=e=>{try{let t=r()(JSON.parse(String(e))),n=!!(null==t?void 0:t.statementId),a=!!(null==t?void 0:t.parsingId);return{parsedResult:t,hasStatementId:n,hasParsingId:a,isParsingSucceeded:!!(t&&n&&a)}}catch(e){return{parsedResult:null,hasStatementId:!1,hasParsingId:!1,isParsingSucceeded:!1}}},c=()=>{let{userResidency:e,isResidencyLoading:t}=(0,l.R2)();return{isEligible:!i.aIS(e,o.XM.Other),isResidencyLoading:t}}},14219:(e,t,n)=>{n.d(t,{v:()=>S});var a=n(62212),r=n(19788),o=n(75075),i=n(10320),l=n(17667),s=n(95935),c=n(53374),d=n(64022),u=n(31260),m=n(67759),p=n(4603),y=n(79073),h=n(73672),f=n(7802),g=n(90521);let v=async e=>await r.A.updateAllAccounts({accountProvider:e,invalidate:!1}),x=async()=>{await i.A.syncNetWorthOfAsaUsers()},A=async()=>{await o.A.syncBalances({invalidate:!1})},S=e=>{let t=(0,a.j)(),{isAsaUser:n}=(0,u.yf)(),r=(0,h.ug)(),o=(0,g.rE)();return(0,l.A)(async()=>{n&&await x(),await Promise.all([v(f.$5.SnapTrade),v(f.$5.Plaid),v(f.$5.Yodlee),v(f.$5.Asa),A()]),await o.mutateAsync({})},{onMutate:()=>((0,m.trackAllAccountsSyncProcess)({event:p.AllAccountsSyncEvent.Started,mode:e}),{journeyHandle:(0,y.U7)(y.L_.AccountSync)}),onSuccess:async(n,a,o)=>{var i;await (0,s.d)(t),await (0,c.E)(t),r.mutateAsync({}),(0,y.jc)(null!=(i=null==o?void 0:o.journeyHandle)?i:null,p.TelemetryEvent.AccountSyncResult,{success:!0,mode:e}),(0,m.trackAllAccountsSyncProcess)({event:p.AllAccountsSyncEvent.Succeeded,mode:e})},onError:(t,n,a)=>{var r;(0,y.jc)(null!=(r=null==a?void 0:a.journeyHandle)?r:null,p.TelemetryEvent.AccountSyncResult,{success:!1,mode:e}),(0,m.trackAllAccountsSyncProcess)({event:p.AllAccountsSyncEvent.Failed,mode:e,reason:(0,d.Ly)(t)})},onErrorMessage:t=>e===p.PortfoliosSyncMode.Automatic?null:(0,d.rM)(t)})}},14365:(e,t,n)=>{n.d(t,{_:()=>en,G:()=>ea}
3);var a=n(57090),r=n(23462),o=n(12115),i=n(33624),l=n(98870),s=n(99801),c=n(43057),d=n(35208),u=n(95825),m=n(15617),p=n(92672),y=n(70890),h=n(62212),f=n(36934),g=n(62570),v=n(93344),x=n(28811),A=n(74547);let S=(0,g.A)(p.Ah,{target:"e1hwst0e0"})("border-radius:8px;border:1px solid ",e=>e.theme.colors.neutral300,";background:",e=>e.theme.colors.white,";padding:12px 16px;"),b=(0,g.A)(p.Ah,{target:"e1hwst0e1"})("cursor:pointer;"),C=(0,g.A)(p.Ah,{target:"e1hwst0e2"})(),I=(0,g.A)(v.A,{target:"e1hwst0e3"})("width:40px;height:40px;"),w=(0,g.A)("div",{target:"e1hwst0e4"})("margin-left:auto;"),P=(0,g.A)(x.Ay,{target:"e1hwst0e5"})("margin:12px 0;padding:0;"),k=(0,g.A)(A.$n,{target:"e1hwst0e6"})("&.ant-btn{margin:0;}}");var F=n(67297),T=n(84978),E=n(67759),Y=n(62346),D=n(36271),R=n(85543),N=n(49641),M=n(21285),L=n(11780),_=n(31260),O=n(4307);let W=e=>{let{isLoading:t}=(0,Y.Iu)(),{newOtherAssetItem:n,newRealEstateItem:r,newRealEstateMortgageItem:i,newPrivateEquityItem:l}=(()=>{let{preferredCurrency:e}=(0,_.yf)(),{privateEquity:t,realEstate:n}=(0,O.i)(),[a,r]=o.useMemo(()=>[(0,R.Yv)(e,n),(0,R.in)(e,-1)],[e,n]);return{newOtherAssetItem:o.useMemo(()=>(0,R.sW)(e),[e]),newRealEstateItem:a,newRealEstateMortgageItem:r,newPrivateEquityItem:o.useMemo(()=>(0,R.oI)(e,t),[e,t])}})();return e.open?t?(0,a.Y)(D.y,{placement:"centered"}):e.networthAssetType===T.q8.TotalRealEstateHoldings?(0,a.Y)(M.O,{comprehensiveRealEstateItem:{realEstateDetail:r,mortgageDetail:i},onSuccessfulUpsert:e.onClose,onClose:e.onClose}):e.networthAssetType===T.q8.TotalPrivateEquity?(0,a.Y)(L.O,{initialPrivateEquityItem:l,onSuccessfulUpsert:e.onClose,onClose:e.onClose}):e.networthAssetType===T.q8.TotalOtherAssets?(0,a.Y)(N.A,{initialOtherAssetItem:n,onSuccessfulUpsert:e.onClose,onClose:e.onClose}):null:null};var B=n(56471),U=n(48283),z=n(99750),V=n(83897),j=n(81691),H=n(81671);let q=()=>{let{launchCashPortfolioInput:e}=(0,B.T)(),{launchGlobalCashPortfolioConnection:t}=(0,U.o)(),{isBelow576:n}=(0,z.uF)(),r=(0,j.vV)().userDict.plaidEnabled,i=async()=>{await e()},l=async()=>{await t()};return(0,a.FD)(p.Ah,{display:"block",itemsSpacingVertical:24,occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-component":"CashPortfoliosImporter","data-sentry-source-file":"CashPortfoliosImporter.tsx",children:[(0,a.FD)(p.Vs,{itemsSpacingHorizontal:16,itemsSpacingVertical:16,flipAt:"sm",alignItems:"stretch",textAlign:"center",justifyContent:"center",alignContent:"flex-start","data-sentry-element":"FlexFlipOnScreenSize","data-sentry-source-file":"CashPortfoliosImporter.tsx",children:[r?(0,a.FD)(o.Fragment,{children:[(0,a.Y)(k,{variant:"outlined",onClick:l,prefix:(0,a.Y)(A.In,{icon:H.$.Bank2,size:20}),fullWidth:n,children:"Connect a bank account"}),(0,a.Y)(p.Ah,{children:(0,a.Y)(f.lc,{className:"text-body",children:"OR"})})]}):null,(0,a.Y)(k,{variant:"outlined",onClick:i,prefix:(0,a.Y)(A.In,{icon:H.$.Pencil,size:20}),fullWidth:n,"data-sentry-element":"ManualCashPortfolioImporter","data-sentry-source-file":"CashPortfoliosImporter.tsx",children:"Manually enter cash"})]}),r?(0,a.Y)(V.A,{padding:"24px 0 0 0"}):null]})};var G=n(37138),K=n(13977);let Q=()=>{let{isEligible:e,isResidencyLoading:t}=(0,K.zX)();return t||!e?null:(0,a.Y)(G.A,{render:e=>(0,a.Y)(A.$n,{prefix:(0,a.Y)(A.In,{icon:H.$.ArrowOutOfBox}),onClick:e,variant:"outlined",fullWidth:!0,children:"Upload anything"}),"data-sentry-element":"UploadAnythingRenderer","data-sentry-component":"UploadAnythingPickerEntry","data-sentry-source-file":"UploadAnythingPickerEntry.tsx"})};var $=n(4603),X=n(55602),J=n(89417),Z=n(81491),ee=n(74977);let et=e=>{let{exclusiveAssetType:t=null}=e,[n,r]=o.useState(!1),{launchDeferredPortfolioManagementPrompt:g}=(0,X.M)(),[v,x]=o.useState(t);t&&t!==v&&x(t);let k=v===T.q8.TotalSecurities,Y=v===T.q8.TotalCash,D=!!t&&!k&&!Y,R=(0,h.j)(),N=(0,Z.$s)(),M=o.useRef(null);o.useEffect(()=>{var e;null!==N&&(null==(e=M.current)||e.scrollIntoView({block:"nearest"}))},[N]),o.useEffect(()=>e.open?(0,J.uv)():void 0,[e.open]);let L=k||Y?1064:u.rI.Md;if((e=>{let{importerOpened:t,assetType:n,source:a,disableTracking:r}=e;o.useEffect(()=>
3{!r&&t&&n&&(0,E.trackNetworthAssetImporterOpened)({assetType:n,source:a})},[t,n,a,r])})({importerOpened:e.open&&!!v,assetType:v,source:$.AssetImportSource.AddAnAsset,disableTracking:!!t}),D&&e.open)return(0,a.Y)(W,{networthAssetType:t,open:!0,onClose:()=>{(0,y.IX)(R),e.onClose()}});let _=()=>{x(null)},O=async e=>{x(e)};return(0,a.Y)(c.Ay,{theme:{components:{Select:{zIndexPopup:d.Bf.select}}},"data-sentry-element":"ConfigProvider","data-sentry-component":"_NetworthAssetImporter","data-sentry-source-file":"NetworthAssetImporter.tsx",children:(0,a.Y)(u.Ay,{disableSubmitOnEnter:!0,title:(0,a.Y)(p.Ah,{justifyContent:"flex-start",alignItems:"center",itemsSpacingHorizontal:8,flexWrap:"nowrap",children:(()=>{let e=e=>(0,a.FD)(o.Fragment,{children:[!t&&(0,a.Y)(A.$n,{onClick:_,variant:"ghost",color:"neutral",isIconOnly:!0,size:"sm",children:(0,a.Y)(A.In,{icon:H.$.ArrowLeft,size:20,className:"text-inherit"})}),e]});switch(v){case T.q8.TotalSecurities:return e("Add an account");case T.q8.TotalCash:return e("Add cash");default:return"Add a net worth asset"}})()}),open:e.open,destroyOnClose:!0,keyboard:!1,maskClosable:!0,closable:!0,onCancel:()=>{(0,Z.Xz)(),n&&g(),(0,y.IX)(R),e.onClose()},widthOverride:L,footer:null,"data-sentry-element":"Modal","data-sentry-source-file":"NetworthA
3ssetImporter.tsx",children:(0,a.FD)(p.Ah,{flexDirection:"column",alignItems:"flex-start",justifyContent:"stretch",itemsSpacingVertical:16,occupyParentWidth:!0,occupyParentHeight:!0,padding:"8px 0 0 0","data-sentry-element":"FlexLayout","data-sentry-source-file":"NetworthAssetImporter.tsx",children:[Y?(0,a.Y)(q,{onClose:_}):null,k&&null!==N?(0,a.Y)("div",{className:"w-full",role:"status","data-connection-announcement":"true",ref:M,children:(0,a.Y)(ee.F,{status:"success",variant:"outlined",title:(0,Z.yd)(N),closable:!0,onClose:Z.Xz})}):null,k&&(0,a.Y)(m.j,{onManualPortfolioUploadSuccess:()=>{r(!0)},onBrokerageAccountImportSuccess:()=>{r(!0)},onBrokerageAccountFlowExit:l.A,showManualEntryOption:k,isAddAccountModal:!0}),k||Y?null:(0,a.FD)(p.Ah,{flexDirection:"column",justifyContent:"stretch",alignItems:"flex-start",itemsSpacingVertical:8,occupyParentWidth:!0,children:[(0,a.Y)(S,{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",occupyParentWidth:!0,flexWrap:"nowrap",children:s.A((e,t,n)=>(0,a.FD)(o.Fragment,{children:[(0,a.FD)(b,{display:"inline-flex",flexDirection:"row",flexWrap:"nowrap",justifyContent:"flex-start",alignItems:"center",alignSelf:"stretch",itemsSpacingHorizontal:16,occupyParentWidth:!0,onClick:()=>O(e.assetType),children:[(0,a.Y)(I,{icon:e.icon}),(0,a.FD)(C,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",flexWrap:"nowrap",flex:"1 1 0",children:[(0,a.Y)(f.bU,{className:"text-body",children:e.label}),(0,a.Y)(f.km,{className:"text-neutral-500",children:e.description})]}),(0,a.Y)(w,{children:(0,a.Y)(A.In,{icon:H.$.ChevronRight,size:20,className:"text-icon"})})]},e.assetType),t+1>=i.Bw9(n)?null:(0,a.Y)(P,{})]},e.assetType),F.a8)}),(0,a.Y)(Q,{})]}
3),t?null:(0,a.Y)(W,{networthAssetType:v,open:!!v,onClose:()=>{x(null)}})]})})})},en=e=>(0,r.n)(et,{...e,key:String(e.open),"data-sentry-element":"_NetworthAssetImporter","data-sentry-component":"NetworthAssetImporter","data-sentry-source-file":"NetworthAssetImporter.tsx"}),ea=e=>(0,a.Y)(en,{...e,exclusiveAssetType:T.q8.TotalSecurities,"data-sentry-element":"NetworthAssetImporter","data-sentry-component":"SecuritiesNetworthAssetImporter","data-sentry-source-file":"NetworthAssetImporter.tsx"})},14530:(e,t,n)=>{n.d(t,{Dd:()=>C,GX:()=>w,LL:()=>F,MO:()=>T,T8:()=>L,Tf:()=>D,WI:()=>M,WJ:()=>v,YB:()=>R,Yd:()=>g,ch:()=>P,g2:()=>E,ng:()=>Y,sj:()=>N,t:()=>k});var a=n(33624),r=n(42252),o=n(16528),i=n(22462),l=n(39715),s=n(99026),c=n(54674),d=n(17143),u=n(67818),m=n(82949),p=n(44561),y=n(38484),h=n(39040);let f=e=>({isProxyManagementMode:e===u.x.Proxy,isCustomManagementMode:e===u.x.Custom}),g=(e,t)=>{let n=t===c.v0.Create;return{isCreateMode:n,isEditMode:t===c.v0.Edit,...f(e)}},v=e=>a.TjK(e=>({label:e,value:e}),e),x=(e,t)=>"number"==typeof e?(0,l.qU)((0,s.DP)(e,t)):null,A=e=>x(e,1),S=e=>x(e,1),b=e=>x(e,2),C=e=>({...a.UpN([c.lf.ticker,c.lf.amount,c.lf.investment,c.lf.currentPrice],e),isFixedAmount:!0}),I=()=>({expectedReturn:null,expectedRisk:null,dividendYield:null,assetClass:null,country:null,sector:null}),w=()=>({...I(),proxyTicker:null}),P=e=>a.UpN(["expectedReturn","expectedRisk","dividendYield","assetClass","country","sector"],e),k=e=>a.aIS(e,h.Hj.FixedIncome),F=e=>k(e.assetClass)&&e.sector&&!a.mKk(e.sector,p.P0)?{...e,sector:null}:e,T=(e,t)=>{var n;
3let o=e.systemSecurityTickerDetails,i=e.proxyDetails,l=e.investmentDetails,s=(()=>{let e=I(),t=o||e;return i?i.proxyTicker?{...e,proxyTicker:i.proxyTicker,ticker:l.ticker}:{ticker:l.ticker,proxyTicker:i.proxyTicker,assetClass:i.assetClass||t.assetClass,country:i.country||t.country,sector:i.sector||t.sector,expectedReturn:i.expectedReturn||t.expectedReturn,expectedRisk:i.expectedRisk||t.expectedRisk,dividendYield:i.dividendYield||t.dividendYield}:{...t,proxyTicker:null,ticker:l.ticker}})(),u={...l,...s,investment:null!=(n=l.investment)?n:l.ticker},m=a._w2(c.lf.amount,u),p=a._w2(c.lf.expectedReturn,u),y=a._w2(c.lf.expectedRisk,u),h=a._w2(c.lf.dividendYield,u),f=r.A(m)?{[c.lf.amount]:(0,d.iU)((0,d.$Y)(t,m))}:{},g=r.A(p)?{[c.lf.expectedReturn]:A(p)}:{},v=r.A(y)?{[c.lf.expectedRisk]:S(y)}:{},x=r.A(h)?{[c.lf.dividendYield]:b(h)}:{};return F({...u,...f,...g,...v,...x})},E=e=>{let t=a.wnP({[c.lf.expectedReturn]:a.FsL(a._w2(c.lf.expectedReturn),A),[c.lf.expectedRisk]:a.FsL(a._w2(c.lf.expectedRisk),S),[c.lf.dividendYield]:a.FsL(a._w2(c.lf.dividendYield),b)});return a.VxE(e,t(e))},Y=e=>{let t=a.xkk([c.lf.assetClass],e);return a.Q7R(o.A)(t)},D=e=>{let t=a.xkk(c.Lb,e);return a.bzn(o.A)(t)},R=(e,t)=>{let n=a.wnP({[c.lf.ticker]:a.FsL(a._w2(c.lf.ticker),d.$S),[c.lf.amount]:a.FsL(a._w2(c.lf.amount),e=>(0,d.k5)(t,(0,d.iU)(e))),[c.lf.expectedReturn]:a.Tkb(a.WPk(a.S_H(Number,c.lf.expectedReturn),i.A),a.FsL(a._w2(c.lf.expectedReturn),a.Qrk(a.__,100)),a.Gkd(null)),[c.lf.expectedRisk]:a.Tkb(a.WPk(a.S_H(Number,c.lf.expectedRisk),i.A),a.FsL(a._w2(c.lf.expectedRisk),a.Qrk(a.__,100)),a.Gkd(null)),[c.lf.dividendYield]:a.Tkb(a.WPk(a.S_H(Number,c.lf.dividendYield),i.A),a.FsL(a._w2(c.lf.dividendYield),a.Qrk(a.__,100)),a.Gkd(null))});return a.VxE(e,n(e))},N=async(e,t)=>{let n=a.UpN(["proxyTicker","expectedReturn","expectedRisk","dividendYield","assetClass","country","sector"],e),r=w(),{isProxyManagementMode:o}=f(t),i=await (0,y.bC)(e.ticker),l=(e,t)=>t===e?null:t,c=(e,t,n)=>{if("number"==typeof t)if("number"==typeof e)return(0,s.Zj)(t,e,n)?null:t;else return t;return null},d=(()=>{let t=e.investment===i.seriesName?null:e.investment;if(o)return{...r,proxyTicker:n.proxyTicker,seriesName:t};{let e=l(i.assetClass,n.assetClass),a=l(i.country,n.country),r=l(i.sector,n.sector),o=c(i.expectedReturn,n.expectedReturn,.001);return{proxyTicker:null,seriesName:t,assetClass:e,country:a,sector:r,expectedReturn:o,expectedRisk:c(i.expectedRisk,n.expectedRisk,.001),dividendYield:c(i.dividendYield,n.dividendYield,.001)}}})();return{ticker:e.ticker,...d}},M=(e,t)=>(0,m.Od)(t)?(0,m.JX)(t)?Promise.reject(Error("Custom security ticker cannot be empty")):(0,m.M_)(t).length>40?Promise.reject(Error("Custom security ticker cannot be longer than 40 characters")):Promise.resolve():Promise.reject(Error("".concat(p.hE," prefix is mandatory for custom securities"))),L=a.aIS(p.hv)},15039:(e,t,n)=>{n.d(t,{B:()=>l,N:()=>i});var a=n(57090);n(12115);var r=n(33624),o=n(56371);let i=(e,t)=>r.mKk(t,e),l=e=>{let{columnKey:t,locked:n,children:r}=e;return(0,a.Y)(o.o,{attributeKey:t,locked:n,"data-sentry-element":"ProtectedAttributeRenderer","data-sentry-component":"SecurityAttributeProtectedDisplay","data-sentry-source-file":"SecurityAttributeProtectedDisplay.tsx",children:r})}},15540:(e,t,n)=>{n.d(t,{A:()=>v});var a=n(57090),r=n(12115),o=n(74547),i=n(34645),l=n(22462),s=n(55074),c=n(92672),d=n(95825),u=n(2275),m=n(44659),p=n(45436),y=n(26877),h=n(67759),f=n(4603),g=n(78518);let v=e=>{let{handleImportSuccess:t,handleInitiateNewUpload:n,handlePortfolioSaveComplete:v,handleImportFlowCancel:x,showParsedPortfolioEditor:A,parsedInvestmentItems:S,normalizedUserUploadedData:b}=(0,i.gX)(e),{textPortfolioInput:C,handleTextPortfolioInputChange:I,handleAIDataImport:w,portfolioParserStatus:P,isLocalTextCheckPassed:k}=(0,i.__)({onImporterClose:x,onSuccess:t});r.useEffect(()=>{(0,h.trackAIImport)({event:f.AIImportEvent.ImporterOpened})},[]);let F="error"===P,T=!1===k||F?"error":void 0;return(0,a.FD)(c.Ah,{display:"block",itemsSpacingVertical:16,"data-sentry-element":"FlexLayout","data-sentry-component":"AITextImporter","data-sentry-source-file":"AITextImporter.tsx",children:[(0,a.Y)(y.So,{"data-sentry-element":"PortfolioInputParserDescription","data-sentry-source-file":"AITextImporter.tsx"}),(0,a.FD)(y.$S,{"data-sentry-element":"PortfolioTextInputContainer","data-sentry-source-file":"AITextImporter.tsx",children:[(0,a.Y)(y.fr,{"data-sentry-element":"PortfolioInputLabel","data-sentry-source-file":"AITextImporter.tsx"}),(0,a.Y)(p.A,{isLocalTextCheckPassed:k,"data-sentry-element":"LocalTextCheckFailedError","data-sentry-source-file":"AITextImporter.tsx"}),F?(0,a.Y)(m.A,{}):null,(0,a.Y)(o.fs,{autoFocus:!0,value:C,placeholder:g.U,minRows:10,maxRows:15,fullWidth:!0,onChange:t=>{var n;I(t),null==(n=e.onPortfolioTextInputChange)||n.call(e,t)},isInvalid:!!T,"data-sentry-element":"TextArea","data-sentry-source-file":"AITextImporter.tsx"})]}),e.customSubmitCTA?e.customSubmitCTA({onSubmit:w,submitLabel:"Add",disabled:!k}):(0,a.Y)(c.Ah,{justifyContent:"flex-end",width:"100%",children:(0,a.Y)(o.$n,{onClick:w,variant:"filled",disabled:!k,children:"Add"})}),A&&l.A(S)&&l.A(b)?(0,a.Y)(s.A,{uploadedData:b,portfolioInvestmentItems:S,onPortfolioSaveComplete:v,onInitiateNewUpload:n,onCancel:x}):null,"loading"===P?(0,a.Y)(d.Ay,{disableSubmitOnEnter:!0,open:!0,title:"Instant portfolio upload",closable:!1,keyboard:!1,children:(0,a.Y)(u.A,{})}):null]})}},15617:(e,t,n)=>{n.d(t,{j:()=>ew});var a=n(57090),r=n(12115),o=n(7802),i=n(78190),l=n(33624),s=n(92657),c=n(92672),d=n(99750),u=n(83562),m=n(58451),p=n(17667),y=n(19788),h=n(18457);let f=async e=>{try{let t=await Promise.race([y.A.checkInstitutionHealth(e).catch(()=>null),new Promise(e=>setTimeout(()=>e(null),5e3))]);if(t&&!t.isHealthy){let t=await (0,h.f)([e.id]);return l.vUk(e,t)}return e}catch(t){return console.log("Error checking institution health",t),e}};var g=n(9519),v=n(36271),x=n(58155),A=n(65460),S=n(62212),b=n(6465),C=n(5949),I=n(57295);let w=e=>{let{logo:t,defaultLogo:n="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMzJweCIgaGVpZ2h0PSIzMnB4IiB2aWV3Qm94PSIwIDAgMzIgMzIiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDQ2LjIgKDQ0NDk2KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5pY29uL2Jhbms8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz48L2RlZnM+CiAgICA8ZyBpZD0iRGFzaGJvYXJkIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iQTAwNzotRkwtMy4wLVM6LUNvbXBvbmVudHMtLS1JY29ucyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTQwLjAwMDAwMCwgLTIyNi4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9Imljb24vYmFuayIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNDAuMDAwMDAwLCAyMjYuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICA8cmVjdCBpZD0iMzJ4MzIiIHg9IjAiIHk9IjAiIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPHBhdGggZD0iTTI2LjUsMjMgTDI0LDIzIEwyNCwxNi4wNjY2NjY3IEMyNCwxNS40ODk3OTU5IDI0LjcsMTUgMjUuMjUsMTUgQzI1LjgsMTUgMjYuNSwxNS40ODk3OTU5IDI2LjUsMTYuMDY2NjY2NyBMMjYuNSwyMyBaIE0yMC41LDIzIEwxOCwyMyB
3MMTgsMTQuMDUyNjMxNiBDMTgsMTMuNDgxMjgzNCAxOC43LDEzIDE5LjI1LDEzIEMxOS44LDEzIDIwLjUsMTMuNDgxMjgzNCAyMC41LDE0LjA1MjYzMTYgTDIwLjUsMjMgWiBNMTQuNSwyMyBMMTIsMjMgTDEyLDE0LjA1MjYzMTYgQzEyLDEzLjQ4MTI4MzQgMTIuNywxMyAxMy4yNSwxMyBDMTMuOCwxMyAxNC41LDEzLjQ4MTI4MzQgMTQuNSwxNC4wNTI2MzE2IEwxNC41LDIzIFogTTguNSwyMyBMNiwyMyBMNiwxNi4wNjY2NjY3IEM2LDE1LjQ4OTc5NTkgNi43LDE1IDcuMjUsMTUgQzcuOCwxNSA4LjUsMTUuNDg5Nzk1OSA4LjUsMTYuMDY2NjY2NyBMOC41LDIzIFogTTI2LjUxMjAxOTcsMjcuNSBMNS40OTM4Njg1NiwyNy41IEM0LjU0NDI4MTEyLDI3LjUgMy45OTcyMDQzNSwyNi45NjY0MzA3IDQuMDAwMDEwNzQsMjYuMjUgQzQuMDAyODE3MTQsMjUuNTMzNTY5MyA0LjU0NDI4MTEyLDI1IDUuNDkzODY4NTYsMjUgTDI2LjUxMjAxOTcsMjUgQzI3LjQyNTA3NTIsMjUgMjcuOTg2NTM3OCwyNS4zOTMzMTA1IDI3Ljk5OTc3NjYsMjYuMjUgQzI4LjAxMzAxNTUsMjcuMTA2Njg5NSAyNy40MzUwMTk2LDI3LjUgMjYuOTg0NTMxNywyNy41IEwyNi41MTIwMTk3LDI3LjUgWiBNMS40ODkzODYwNywzMS41IEMwLjU0MDEyMjAwOCwzMS41IDAuMDE1NTUzMTA1OSwzMS4wNTUxNzU4IDAuMDAwMzA2MTM3NDI2LDMwLjI1IEMtMC4wMTQ5NDA4MzExLDI5LjQ0NDgyNDIgMC41NDAxMjIwMDgsMjkgMS40ODkzODYwNywyOSBMMzAuOTY2NTMzMywyOSBDMzEuNDE2MTg0NywyOSAzMi4wMDQ2MDc5LDI5LjQwNTc2MTcgMzEuOTk5OTcyOCwzMC4yNSBDMzEuOTk1MzM3NywzMS4wOTQyMzgzIDMxLjQxNjE4NDcsMzEuNSAzMC45NjY1MzMzLDMxLjUgTDEuNDg5Mzg2MDcsMzEuNSBaIE0xNi4wMTkxNDE3LDMuMDEyMzEwMjUgTDEuOTQ1MTE1NTUsMTUuNTYyNzA2MyBDMS4xNDc5Nzk3NywxNi4xOTcxNzYxIDAuODY1MjQyNDg4LDE2LjA1Nzg1NSAwLjQzNzE4NDE3NywxNS41NjI3MDYzIEMwLjAwOTEyNTg2NjU2LDE1LjA2NzU1NzUgLTAuMjgyNjA0NzcsMTQuNzA1NzQzNCAwLjQzNzE4NDE3NywxNC4wNTY2NTg3IEMwLjM0NTM2NzcxNiwxMy44NzY3MiAxNS4wMjk3MjIxLDAuNDUyNzA5OTI3IDE1LjAxMzg1NDEsMC41MDIyMzEwNDYgQzE1LjI3NjYyMTQsMC4yOTEzNTI5MDEgMTUuNTE4MzIwNiwtMC4wMDkxODQyMDg3IDE2LjAxOTE0MTcsMC4wMDAyMTUyMDUzNjEgQzE2LjUxOTk2MjgsMC4wMDk2MTQ2MTk0MiAxNi43ODEyNiwwLjI3OTIwNjkwNSAxNy4wMjQ0MjkzLDAuNTAyMjMxMDQ2IEMxNi45OTA5ODg2LDAuNDAyNDMyNzM2IDMxLjY3NTM0MywxMy44NzY3MiAzMS42MDEwOTkyLDE0LjA1NjY1ODcgQzMyLjIwODkxNzYsMTQuNjYwNjA3OCAzMi4wNTEyMDE5LDE1LjEzNTgxNjIgMzEuNjAxMDk5MiwxNS41NjI3MDYzIEMzMS4xNDY1NDA1LDE2LjE0Mjc0NDIgMzAuNzE1MTQ4OCwxNi4xNDkzNDk1IDMwLjA5MzE2NzksMTUuNTYyNzA2MyBMMTYuMDE5MTQxNywzLjAxMjMxMDI1IFoiIGlkPSJDb21iaW5lZC1TaGFwZSIgZmlsbD0iIzBDNzZCRSI+PC9wYXRoPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",
3institutionName:o}=e,{theme:i}=(0,x.OM)(),s=(0,d.tb)(["32px"]),c=(0,d.tb)(["32px"]),[m,p]=r.useState(!1),[y,h]=r.useState(!1),f=e.height||s,g=e.width||c,v={...e,height:f,width:g,alt:o,title:o},S=l.vUk(t,(0,A.dx)(o));if(l.gD_(S))return(0,a.Y)(u.sI,{src:n,...v});if(S.includes("http")){let e="Ellevest"===o?i.colors.black:void 0;return(0,a.FD)(r.Fragment,{children:[!m&&!y&&(0,a.Y)(u.sI,{src:n,...v}),y&&(0,a.Y)(u.sI,{src:n,...v}),(0,a.Y)(u.sI,{src:S,...v,backgroundColor:e,onLoad:()=>p(!0),onError:()=>h(!0),style:{display:m?"block":"none"}})]})}let b=S.startsWith("data:image")?S:"data:image/png;base64, ".concat(S);return(0,a.Y)(u.sI,{src:b,...v,"data-sentry-element":"InstitutionImage","data-sentry-component":"InstitutionLogo","data-sentry-source-file":"Institution.tsx"})},P=e=>{let{institution:t,selectedInstitution:n}=e,{id:r,name:i,logo:l}=t,s=!!n&&n.id==r,{isMobilePortrait:y}=(0,d.Qs)(),h=(0,p.A)(f),x=(0,S.j)(),A=async()=>{((e,t)=>{switch(t.accountProvider){case o.$5.Plaid:return(0,b.nB)(e,{institutionId:t.id,reconnectingAccountId:void 0});case o.$5.SnapTrade:return(0,C.p)(e,{institutionId:t.id,broker:t.id,reconnectingAccountId:void 0,reconnectingBankId:void 0});case o.$5.Yodlee:return(0,I.n)(e,{reconnectingAccountId:void 0});case o.$5.Asa:return}})(x,t),await h.mutateAsync(t,{onSuccess:e.onClick})};return(0,a.Y)(u.AT,{selected:s,onClick:A,xs:y?void 0:24,sm:24,md:7,lg:5,xl:5,isMobilePortrait:y,compactMode:!!e.compactMode,"data-sentry-element":"InstitutionContainer","data-sentry-component":"Institution","data-sentry-source-file":"Institution.tsx",children:(0,a.Y)(g.A,{spinning:h.isLoading,indicator:(0,a.Y)(v.y,{iconOnly:!0,size:"sm"}),"data-sentry-element":"Spin","data-sentry-source-file":"Institution.tsx",children:(0,a.FD)(u.XD,{flexDirection:"row",alignItems:"center",occupyParentWidth:!0,justifyContent:y||e.compactMode?"center":"flex-start","data-sentry-element":"SpinnerContainer","data-sentry-source-file":"Institution.tsx",children:[(0,a.Y)(w,{logo:l,institutionName:i,"data-sentry-element":"InstitutionLogo","data-sentry-source-file":"Institution.tsx"}),(0,a.Y)(m.A,{hideInMobile:!1,hideOnlyInMobilePortrait:!0,"data-sentry-element":"WpResponsiveContainer","data-sentry-source-file":"Institution.tsx",children:e.compactMode?null:(0,a.Y)(c.Ah,{marginLeft:8,children:i})})]})})})};var k=n(89658),F=n(89568),T=n(99026),E=n(62570);let Y=(0,E.A)("div",{target:"ewsbuz70"})("color:",e=>e.theme.colors.neutral500,";font-size:16px;line-height:24px;font-weight:400;"),D=(0,E.A)("div",{target:"ewsbuz71"})("font-size:16px;line-height:20px;");var R=n(40248),N=n(74547),M=n(81671);let L=e=>{let{isOverflowed:t,containerRef:n}=(()=>{let[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let e=()=>{let e=n.current;e&&t(e.clientWidth<e.scrollWidth)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),{isOverflowed:e,containerRef:n}})(),{logo:o,name:i,accountProvider:l,institutionUrl:s}=e.institute,d=(0,k.K)(l),m=!e.labelInValue,p=(0,T.L5)(s||"");return(0,a.Y)(F.Ay,{title:t?i:null,"data-sentry-element":"Tooltip","data-sentry-component":"Label","data-sentry-source-file":"InstitutesSelect.tsx",children:(0,a.FD)(c.Ah,{justifyContent:"space-between",flexWrap:"nowrap",occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"InstitutesSelect.tsx",children:[(0,a.FD)(c.Ah,{flexWrap:"nowrap",itemsSpacingHorizontal:8,alignItems:e.labelInValue?"center":"flex-start",justifyContent:"flex-start",maxWidth:"70%","data-sentry-element":"FlexLayout","data-sentry-source-file":"InstitutesSelect.tsx",children:[(0,a.Y)(w,{logo:o,width:"24px",height:"24px",institutionName:i,"data-sentry-element":"InstitutionLogo","data-sentry-source-file":"InstitutesSelect.tsx"}),(0,a.FD)(c.Ah,{flexDirection:"column",flexWrap:"nowrap",justifyContent:"flex-start",alignItems:"space-between",occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"InstitutesSelect.tsx",children:[(0,a.Y)(u.mH,{ref:n,wrapText:!0,"data-sentry-element":"InstituteNameContainer","data-sentry-source-file":"InstitutesSelect.tsx",children:i}
3),m?(0,a.Y)(u.Yd,{wrapText:!1,children:p}):null]})]}),(0,a.FD)(u.po,{"data-sentry-element":"InstitutionAccountProviderLabel","data-sentry-source-file":"InstitutesSelect.tsx",children:["via ",d]})]})})},_=e=>{let t=(0,d.tb)(["center","left"]);return(0,a.FD)(c.Ah,{flexDirection:"column",justifyContent:t,alignItems:"center",flexWrap:"nowrap",itemsSpacingVertical:8,occupyParentWidth:!0,padding:"12px",textAlign:t,"data-sentry-element":"FlexLayout","data-sentry-component":"NoBrokerageMatchFound","data-sentry-source-file":"InstitutesSelect.tsx",children:[(0,a.Y)(Y,{"data-sentry-element":"NoBrokeragesFoundText","data-sentry-source-file":"InstitutesSelect.tsx",children:"No matches found"}),(0,a.Y)(R.A,{variant:"outlined",onClick:e.onOtherImportOptionsClick,fullWidth:!0,suffix:(0,a.Y)(N.In,{icon:M.$.ArrowRight,size:16}),"data-sentry-element":"Button","data-sentry-source-file":"InstitutesSelect.tsx",children:(0,a.Y)(D,{"data-sentry-element":"OtherImportOptionsText","data-sentry-source-file":"InstitutesSelect.tsx",children:"Other ways to import"})})]})},O=e=>{let{selectedInstitution:t,isSearchingInstitutions:n,isNoMatchFound:r,optionInstitutions:o,handleSearch:i,handleSelectChange:c,handleSearchInstitutionInputKeyDown:u,searchPlaceholder:m,onOtherImportOptionsClick:p}=e,y=(0,d.tb)(r?["100%","max-content"]:["100%"]);return(0,a.Y)(s.R6,{size:"large",showSearch:!0,labelInValue:!0,value:t?{value:t.id,label:(0,a.Y)(L,{institute:t,labelInValue:!0})}:void 0,style:{width:"100%"},dropdownStyle:{width:y},placeholder:m,defaultActiveFirstOption:!1,suffixIcon:(0,a.Y)(N.In,{icon:M.$.MagnifyingGlass,size:20}),filterOption:!1,onSearch:i,onChange:c,notFoundContent:n?(0,a.Y)(s.$p,{children:(0,a.Y)(s.Bt,{margin:"0"})}):r?(0,a.Y)(_,{onOtherImportOptionsClick:p}):null,getPopupContainer:e=>null==e?void 0:e.parentElement,onInputKeyDown:u,options:l.TjK(e=>({value:e.id,label:(0,a.Y)(L,{institute:e})}),l.hS4(l._w2("id"),o)),"data-sentry-element":"InstitutionSelect","data-sentry-component":"InstitutesSelect","data-sentry-source-file":"InstitutesSelect.tsx"})};var W=n(36934),B=n(13340);let U="PUBLIC",z=["FIDELITY","SCHWAB",U,"ins_116530","COINBASE","ETRADE","ins_115616","ROBINHOOD","ins_115605"],V=["QUESTRADE","WEALTHSIMPLETRADE","COINBASE","ins_116530","11616","ROBINHOOD","TD-DIRECT-INVESTING","ins_132416","9611"],j=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=(e=>{switch(e){case B.Sj.CAD:return V;case B.Sj.USD:default:return z}})(t),r=n?l.kuo(e=>e.id===U,e):e;return l.Uln(e=>((e,t)=>{let n=l.qhd(e,t);return -1!==n?n:t.length+1e3})(e.id,a),r)},H=e=>e.isActive&&!e.providerRemoved;var q=n(81255),G=n(31260),K=n(62346);let Q=e=>{let{isMobilePortrait:t}=(0,d.Qs)(),{preferredCurrency:n}=(0,G.yf)(),{isUserInOnboarding:r}=(0,q.A)(),{data:o=[]}=(0,K.aV)(),{institutions:i,selectedInstitution:u,handleInstituteSelect:m,isGettingTopInstitutesLoading:p,header:y="Brokerages popular among users",hideInstitutions:h=!1}=e,f=((e,t)=>{let n=l.pbD(H,t),a=new Set(l.TjK(e=>e.masterBrokerageId,n));return l.kuo(e=>a.has(e.masterBrokerageId),e)})(j(i,n,r),o),g=l.saZ(8,f);return h?null:(0,a.FD)(c.Ah,{flexDirection:"column",justifyContent:"stretch",alignItems:"flex-start",itemsSpacingVertical:8,occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-component":"PopularInstitutes","data-sentry-source-file":"PopularInstitutes.tsx",children:[(0,a.Y)(W.lc,{className:"text-body","data-sentry-element":"Body1W600","data-sentry-source-file":"PopularInstitutes.tsx",children:y}),(0,a.Y)(s.nb,{style:{width:"100%"},isMobilePortrait:t,justify:t?"space-around":"start",gutter:t?[0,2]:[0,8],"data-sentry-element":"InstitutionsContainer","data-sentry-source-file":"PopularInstitutes.tsx",children:p?(0,a.Y)(N.y$,{placement:"centered"}):l.TjK(t=>(0,a.Y)(P,{selectedInstitution:u,onClick:m,institution:t,compactMode:e.compactMode},t.id),g)})]})};var $=n(26214),X=n(39510);let J=e=>{let{showPopularInstitutesFirst:t}=(()=>{let{flagValue:e}=(0,X.$L)($.mr.Test384PopularInstitutesAboveSearch,$.Ko.Control);return{showPopularInstitutesFirst:e===$.Ko.Variant1}})();return(0,a.FD)(r.Fragment,{children:[t?e.popularInstitutesSection:e.searchSection,t?e.searchSection:e.popularInstitutesSection]})};var Z=n(39633),ee=n(8921),et=n(4603),en=n(67759),ea=n(65438),er=n(8441),eo=n(13977),ei=n(95825),el=n(62728),es=n(77729),ec=n(15540),ed=n(56690),eu=n(73285),em=n(25373),ep=function(e){return e.UploadStatement="upload-statement",e.CopyPaste="copy-paste",e.SendEmail="send-email",e.EnterManually="enter-manually",e}(ep||{});let ey=[{flow:"upload-statement",title:"Upload statement",description:"Upload a file or even a screenshot",icon:M.$.CloudUpload,chipLabel:"Fastest for most"},{flow:"copy-paste",title:"Copy / paste",description:"Enter details in plain text: AI will structure it for you",icon:M.$.Clipboard},{flow:"send-email",title:"Send via email",description:"Email files directly to PortfolioPilot",icon:M.$.Email1},{flow:"enter-manually",title:"Enter manually",description:"Add securities one-by-one",icon:M.$.PencilLine}],eh=e=>{let[t,n]=r.useState(null),{launchManualPortfolioInput:o}=(0,ed.u)(),i=(0,eu.w)(),l=e.showStatementUpload?ey:ey.filter(e=>"upload-statement"!==e.flow),s=()=>{n(null)},c=()=>{s(),e.onClose()},d=()=>{s(),e.onImportSuccess()},u=async()=>{c(),await o({onSuccess:()=>e.onImportSuccess()})},m=async()=>{await (0,em.nf)(i),c()},p="upload-statement"===t,y="copy-paste"===t;return(0,a.Y)(N.aF,{disableSubmitOnEnter:!0,open:e.open,title:p?"Upload statement":y?"Copy and paste holdings":"Import securities",onCancel:c,footer:null,destroyOnClose:!0,size:ei.rI.Sm,"data-sentry-element":"Modal","data-sentry-component":"ImportSecuritiesModal","data-sentry-source-file":"ImportSecuritiesModal.tsx",children:t?p?(0,a.Y)(es.Q,{showSimpleInstructions:!1,onPortfolioImported:d}):y?(0,a.Y)(ec.A,{onSuccess:d,onWorkflowEnded:s}):null:(0,a.FD)(N.Ah,{flexDirection:"column",itemsSpacingVertical:16,children:[(0,a.Y)(W.km,{className:"text-neutral-500",children:"Pick whichever option is easiest for you:"}),(0,a.Y)(N.Ah,{flexDirection:"column",itemsSpacingVertical:12,children:l.map(e=>
3(0,a.Y)(el.A,{title:e.title,description:e.description,icon:e.icon,iconSize:el.L.Small,highlighted:"upload-statement"===e.flow,chipLabel:e.chipLabel,onClick:()=>(e=>{switch(e){case"enter-manually":u();return;case"send-email":m();return;default:n(e)}})(e.flow)},e.flow))}),(0,a.Y)(N.Ah,{justifyContent:"flex-start",width:"100%",children:(0,a.Y)(N.$n,{variant:"outlined",color:"neutral",onClick:c,children:"Back"})})]})})};var ef=n(83897),eg=n(45004);let ev="Find your bank, brokerage, or wallet (12,000+ supported)",ex=()=>{let{showAdviceHeader:e}=(()=>{let{flagValue:e}=(0,X.$L)($.mr.Test439ConnectModalAdviceHeader,$.LH.Control);return{showAdviceHeader:e===$.LH.Variant1}})();return(0,a.Y)(r.Fragment,{children:e?"The more you connect, the better your advice":ev})},eA=e=>e.isAddAccountModal?(0,a.Y)(ex,{}):(0,a.Y)(r.Fragment,{children:ev});var eS=n(61435),eb=n(67908);let eC=()=>{let{showReadOnlyReassuranceLine:e}=(()=>{let{flagValue:e}=(0,X.$L)($.mr.Test447ConnectModalReadOnlyReassurance,$.Lo.Control),{areFlagsResolved:t}=(0,X.$I)($.mr.Test447ConnectModalReadOnlyReassurance);return{showReadOnlyReassuranceLine:t&&e===$.Lo.Variant1}})();return e?(0,a.FD)("div",{className:"flex w-full items-start gap-2","data-sentry-component":"ConnectReadOnlyReassuranceLine","data-sentry-source-file":"ConnectReadOnlyReassurance.tsx",children:[(0,a.Y)(eS.I,{icon:M.$.EyeOpen,size:20,className:"shrink-0 text-neutral-500","data-sentry-element":"Icon","data-sentry-source-file":"ConnectReadOnlyReassurance.tsx"}),(0,a.Y)(W.km,{className:"font-medium text-neutral-500 leading-5","data-sentry-element":"Body2W400","data-sentry-source-file":"ConnectReadOnlyReassurance.tsx",children:"Read-only access: we can never move your money"})]}):null},eI=()=>(0,a.Y)(eb.o,{"data-sentry-element":"GuestUserHidden","data-sentry-component":"ConnectReadOnlyReassurance","data-sentry-source-file":"ConnectReadOnlyReassurance.tsx",children:(0,a.Y)(eC,{"data-sentry-element":"ConnectReadOnlyReassuranceLine","data-sentry-source-file":"ConnectReadOnlyReassurance.tsx"})}),ew=e=>{let[t,n]=r.useState(null),{runPossibilityFlow:s}=(0,er.E)(),{isEligible:u}=(0,eo.zX)(),{launchGlobalBrokeragePortal:m}=(0,eg.J)(),{value:p,setTrue:y,setFalse:f}=(0,ea.A)(!1),g=()=>{n(null)},v=t=>{e.onBrokerageAccountImportSuccess(t),g(),s(t.setupFinalOutcome)},x=()=>{e.onBrokerageAccountFlowExit(),g()},{institutions:A,optionInstitutions:S,handleSearch:b,handleInstituteSelect:C,handleSelectChange:I,handleSearchInstitutionInputKeyDown:w,isGettingTopInstitutesLoading:P,isSearchingInstitutions:k,isNoMatchFound:F}=(e=>{let[t,n]=r.useState(""),[a,o]=(0,Z.A)(t,300),{data:i=[],isLoading:s,error:c}=(0,h.vR)(),{data:d=[],isFetching:u,isSuccess:m}=(0,h.de)(a),p=l.Ime(d),y=l.aIS(t,a);r.useEffect(()=>{c&&(0,ee.Ds)(ee._n.Error,"Institution details unavailable",{description:"Institution information could not be retrieved."})},[c]);let f=t=>{e.onInstituteSelect(t)};return{debouncedQueryInput:a,institutions:i,optionInstitutions:d,handleSearch:async e=>{n(e)},handleInstituteSelect:f,handleSelectChange:e=>{let{value:t}=e,n=l.I6j(e=>e.id===t,d);n&&f(n)},handleSearchInstitutionInputKeyDown:e=>{l.aIS("Enter",e.key)&&!y&&(e.preventDefault(),e.stopPropagation(),o(t))},isGettingTopInstitutesLoading:s,isSearchingInstitutions:u,isNoMatchFound:y&&m&&p}})({onInstituteSelect:async e=>{n(e),(e=>(0,en.trackExternalAccountConnection)({event:et.ExternalAccountConnectionEvent.InstitutionSelected,institutionId:e.id,institutionName:e.name,accountProvider:e.accountProvider,message:et.ExternalAccountConnectionEventMessage.InstitutionSelected},null,null))(e),await m({institution:e,mode:i.W8.Initial,onAccountSetupSuccess:v,onAccountConnectionFlowExit:x})}}),{isMobilePortrait:T}=(0,d.Qs)(),{showLoginExpectationLine:E}=(()=>{let{flagValue:e}=(0,X.$L)($.mr.Test383ConnectLoginExpectationLine,$.Sg.Control);return{showLoginExpectationLine:e===$.Sg.Variant1}})(),Y=(0,a.FD)(c.Ah,{flexDirection:"column",justifyContent:"stretch",alignItems:"flex-start",itemsSpacingVertical:8,occupyParentWidth:!0,children:[(0,a.Y)(W.lc,{className:"text-body",style:{fontSize:"1.4rem"},children:(0,a.Y)(eA,{isAddAccountModal:e.isAddAccountModal})}),E?(0,a.Y)("div",{className:"w-full bg-neutral-100 rounded-lg px-3 py-2.5",children:(0,a.Y)(W.s9,{className:"text-neutral-700",children:"Next, you'll sign in with your brokerage to connect your account."})}):null,(0,a.Y)(O,{searchPlaceholder:"Search 12,000+ institutions",selectedInstitution:t,isNoMatchFound:F,optionInstitutions:S,handleSearch:b,handleSearchInstitutionInputKeyDown:w,handleSelectChange:I,isSearchingInstitutions:k,onOtherImportOptionsClick:y}
3),(0,a.Y)(eI,{})]});return(0,a.FD)(r.Fragment,{children:[(0,a.FD)(c.Ah,{flexDirection:"column",justifyContent:"stretch",alignItems:"flex-start",itemsSpacingVertical:16,occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"SecuritiesImporter.tsx",children:[(0,a.Y)(J,{searchSection:Y,popularInstitutesSection:(0,a.Y)(Q,{institutions:A,selectedInstitution:t,handleInstituteSelect:C,isGettingTopInstitutesLoading:P,compactMode:T,header:"Connect with popular institutions "}),"data-sentry-element":"ConnectInstitutesSections","data-sentry-source-file":"SecuritiesImporter.tsx"}),e.showManualEntryOption?(0,a.FD)(c.Ah,{flexDirection:"column",justifyContent:"center",alignItems:"center",itemsSpacingVertical:16,occupyParentWidth:!0,padding:"0 0 8px 0",children:[(0,a.Y)(W.lc,{className:"text-body",children:"or"}),(0,a.Y)(N.$n,{onClick:y,variant:"outlined",fullWidth:T,prefix:(0,a.Y)(N.In,{icon:M.$.Clipboard}),children:"Other ways to import securities"})]}):null]}),(0,a.Y)(eh,{open:p,showStatementUpload:u,onClose:f,onImportSuccess:()=>{f(),e.onManualPortfolioUploadSuccess(),g(),s(o.in.UnflaggedCompleteImport)},"data-sentry-element":"ImportSecuritiesModal","data-sentry-source-file":"SecuritiesImporter.tsx"}),(0,a.Y)(ef.A,{padding:"24px 0 0 0","data-sentry-element":"ConnectionPartnersInformation","data-sentry-source-file":"SecuritiesImporter.tsx"})]})}},15751:(e,t,n)=>{n.d(t,{H:()=>A,S:()=>b});var a=n(33624),r=n(22462),o=n(12115),i=n(62346),l=n(32189),s=n(17143),c=n(7257),d=n(65438),u=n(8921),m=n(44134),p=n(79768),y=n(4122),h=n(34645),f=n(8830),g=n(99026),v=n(65879),x=n(95392);let A=e=>{let{investmentItems:t,initialProxyMappedTickers:n}=e,{proxyMappedTickers:r,addProxyMappedTicker:i,removeProxyMappedTicker:l}=(e=>{let[t,n]=o.useState(e);return{proxyMappedTickers:t,addProxyMappedTicker:e=>{n(t=>a.sbv(a.BCw(e,t)))},removeProxyMappedTicker:e=>{n(t=>a.FFB([e],t))}}})(n),[d,u]=o.useState(()=>{let e=a.pbD(a._w2("isTickerTrackedInitially"),t);return a.TjK(e=>({ticker:e.ticker,seriesName:e.investment,assetType:e.assetType}),e)});return{proxyMappedTickers:r,addProxyMappedTicker:i,removeProxyMappedTicker:l,addSelectedSecuritySuggestion:e=>{let t=a.I6j(t=>(0,s.cp)(t.ticker,e.ticker),d),n=a.VxE(a.vUk({},t),e);u(e=>(0,c.lw)(a.Hs9(n,e)))},getSeriesNameResetInvestmentItem:e=>{let n=(0,c.a)(t,e);if(!n)return null;{let t=a.I6j(t=>(0,s.cp)(t.ticker,e),d);return a.VxE(n,{investment:a.vUk(n.investment,null==t?void 0:t.seriesName)})}}}},S=(e,t)=>{let n=a.TjK(a.FsL(a.UpN(["ticker","amount"]),e=>({...e,amount:(0,g.Yw)(e.amount,2)})));return a.aIS(n(e),n(t))},b=e=>{let{onPortfolioChanged:t,activePortfolio:n,mode:g}=e,{portfolioId:b,portfolioType:C}=n,{data:I=[],isFetching:w,isLoading:P,isError:k,error:F,isRefetching:T}=(0,i.NB)(b),{value:E,toggle:Y}=(0,d.A)(!1),[D,R]=(0,o.useState)(I),[N,M]=(0,o.useState)(null);(0,o.useEffect)(()=>{R(I)},[I]);let L=(e,t)=>a.aIS(C,l.N$.Draft)&&r.A(t)?(0,c.k8)(D,e,t):(0,c.jP)(e),_=(e,t)=>{let n=L(e,t);S(D,n)||R(n)},O=(e,t)=>{let n=a.o8B(D),r=(0,s.$S)(e.ticker),o=(0,c.a)(n,r),i=e.investment?e.investment:a.vUk(r,null==o?void 0:o.investment),l=a.VxE(a.vUk({},o),{...e,ticker:e.ticker,amount:e.amount,investment:i,weight:0});return(0,c.Ck)(n,l,t)},W=async(e,t)=>{_(O(e,t),e)},B=async e=>{M(null),W(e),Y()},U=(e,t,n)=>{let a=(0,c.cN)(D,e,t,n),r=(0,c.a)(a,e);if(!r)return void console.error("Investment item not found for ticker:",e);_(a,r)};(0,x.A)(k,F,"Investments not fetched",{description:"Investment details could not be loaded."});let z=(0,o.useMemo)(()=>N&&(0,c.qO)(N)?L(O(N),N):D,[D,N]),V=!S(D,I),j=!S(I,z);(0,o.useEffect)(()=>{t(V)},[V,D]);let H=(0,m.O)(),q=(0,h.Wc)(),{workflowVisible:G,workflowParams:K,launchSecurityInvestmentAndProxySetupWorkflow:Q,exitWorkflow:$}=(0,y.q)(),{proxyMappedTickers:X,addProxyMappedTicker:J,removeProxyMappedTicker:Z,addSelectedSecuritySuggestion:ee,getSeriesNameResetInvestmentItem:et}=A({investmentItems:D,initialProxyMappedTickers:[]}),en=a.mKk(e.mode,[l.jy.ApplyRecommendation]),ea=async e=>{await Q(e)};e.savePortfolioActionRef.current=async t=>(V&&t.shouldPersistChanges&&await H.mutateAsync({investmentsPayload:D,portfolioId:b,portfolioType:C},{onSuccess:()=>
3{g!==l.jy.NewPortfolio&&(0,u.Ds)(u._n.Success,"Portfolio investments updated"),(()=>{var t;null==(t=e.onPortfolioChangePersisted)||t.call(e)})()}}),V);let er=async(e,t)=>{let n=a.UpN(["ticker","amount","investment","isFixedAmount","quantity","currentPrice"],t);await W(n)},eo=(0,p.rA)(),ei=e=>{J(e),eo({portfolioId:b,portfolioType:C})},el=async(e,t,n)=>{n.isSecurityProxied&&ei(e.ticker),await W(e,t)},es=async e=>{await q.mutateAsync({portfolioDictList:D,source:f.X.CopyPaste,data:e},{onSuccess:e=>{_(e)}})},{isCashEditable:ec}=(0,v.S)(b);return{isPortfolioCashEditable:ec,portfolioInvestmentItems:D,isTableDataReadOnly:en,securityManagementWorkflowParams:K,securityManagementWorkflowVisible:G,bulkPortfolioUploadMutation:H,isPortfolioItemsFetching:w,isPortfolioItemsLoading:P,isPortfolioItemsLoadError:k,portfolioItemsFetchError:F,isRefetchingInvestmentItems:T,hasPortfolioItemsChanged:V,proxyMappedTickers:X,amountFieldSynchronizerKey:E,setInvestments:_,handleInvestmentUpsert:W,handleRemoveInvestment:e=>{let t=a.o8B(D);_((0,c.Rj)(t,e),{ticker:e,amount:0,isFixedAmount:!0,investment:"",currentPrice:0,quantity:0})},handleInvestmentItemAmountUpdate:(e,t)=>{U(e,t,c.Ur.Amount)},handleInvestmentSharesUpdate:(e,t)=>{U(e,t,c.Ur.Quantity)},handleInvestmentFormUpsert:B,handleProxyMappingUpserted:ei,handleProxyMappingReset:e=>{Z(e);let t=et(e);t&&W(t),eo({portfolioId:b,portfolioType:C})},handleProxyWorkflowInvestmentSubmit:el,handleCustomizeInvestmentItem:ea,handleInvestmentAmountInputBlur:er,handleSuggestedSecuritySelected:e=>{ee(e)},exitSecurityManagementWorkflow:$,handleAddAllAtOnce:es,setInvestmentFormUpsertValues:M,hasOnFlyInvestmentItemsChanged:j,onFlyInvestmentItems:z}}},15927:(e,t,n)=>{n.d(t,{a:()=>o});var a=n(73285),r=n(66220);let o=()=>{let e=(0,a.w)(),{fragmentIdentifier:t}=r.parseUrl(e.asPath,{parseFragmentIdentifier:!0}),n=window.location.hash?(e=>{try{return decodeURIComponent(e)}catch(t){return e}})(window.location.hash.slice(1)):void 0;return{fragmentIdentifier:null!=t?t:n}}},16180:(e,t,n)=>{n.d(t,{NN:()=>i,jH:()=>r,uP:()=>o});var a=n(33624);let r=(e,t)=>({recommendation:e,preliminaryBuyTrade:{ticker:t.ticker,amount:t.amount,displayTicker:t.ticker,displayName:t.seriesName},recommendedSellTrade:{ticker:e.ticker,amount:a.zed(t.amount),displayTicker:e.displayTicker,displayName:e.seriesName}}),o=e=>{let{preliminarySuggestedChanges:t,suggestedSecurityActionItem:n}=e;return{preliminaryBuyTrade:t[0],recommendedSellTrade:n}},i=e=>{let t=[e.preliminaryBuyTrade];return{comprehensiveRecommendationSuggestedChanges:{preliminarySuggestedChanges:t,suggestedSecurityActionItem:e.recommendedSellTrade,subsequentSuggestedChanges:[]}}}},16462:(e,t,n)=>{n.d(t,{A:()=>c,Ay:()=>h,G3:()=>p,Kk:()=>s,Kl:()=>d,Oe:()=>m,QT:()=>u});var a=n(88963),r=n(13125),o=n.n(r),i=n(62031),l=n.n(i),s=function(e){return e.NoStatus="no_status",e.Accepted="accepted",e.Denied="denied",e}({}),c=function(e){return e.TaxOptimization="tax_optimization",e.EstatePlanning="estate_planning",e.ScenarioModeling="scenario_modeling",e.IncorrectSetup="incorrect_setup",e.IncorrectRisk="incorrect_risk",e.IdleCash="idle_cash",e.FeeOptimization="fee_optimization",e.EducationDownsideProtection="education_downside_protection",e.EducationCommonInvestingMistakes="education_common_investing_mistakes",e.PortfolioOptimization="portfolio_optimization",e.InvestingRecommendation="investing_recommendation",e.RollingOver401kToIra="rollover_401k_to_ira",e.EducationTaxLossHarvesting="education_tax_loss_harvesting",e.EducationAssetGroups="education_asset_groups",e.EducationMonthly="education_monthly",e.AssetGroupsRiskManage="asset_groups_risk_manage",e.CreateDraftPortfolio="create_draft_portfolio",e.NextTopRecommendation="next_top_recommendation",e}({}),d=function(e){return e.NotRelevant="Not relevant to me",e.TechnicalIssue="Technical issue",e.Snooze="Snooze for later",e.Other="Other",e}({}),u=function(e){return e.WILL_AND_TESTAMENT="will_and_testament",e.DESIGNATED_BENEFICIARIES="designated_beneficiaries",e.ADVANCE_HEALTHCARE_DIRECTIVE="advance_healthcare_directive",e.DIGITAL_ASSETS_PLAN="digital_assets_plan",e.SELECTED_GUARDIAN_FOR_MINOR_CHILDREN="selected_guardian_for_minor_children",e.LIFE_INSURANCE="life_insurance",e.LIVING_TRUST="living_trust",e.ESTATE_TAX_IMPLICATIONS="estate_tax_implications",e.REMINDER_TO_COMPLETE_THE_CHECKLIST="reminder_to_complete_the_checklist",e.NOTIFY_TO_REVIEW_EVERY_YEAR="notify_to_review_every_year",e}({}),m=function(e){return e.PortfolioScoreBump="portfolio_score_bump",e.SetMonthlyTLH="set_monthly_tlh",e.ZeroManagementFee="zero_management_fee",e.IncreaseRetirementContribution="increase_retirement_c
3ontribution",e.RetireTwoYearsLater="retire_two_years_later",e.RothConversionLadder="roth_conversion_ladder",e.DelaySocialSecurityTo70="delay_social_security_to_70",e.MaxOutYearlyRothContribution="max_out_yearly_roth_contribution",e.GuardrailsWithdrawalStrategy="guardrails_withdrawal_strategy",e}({}),p=function(e){return e.IncreasedAssetsAtRetirement="increased_assets_at_retirement",e.IncreasedRetirementSuccessProbability="increased_retirement_success_probability",e.IncreasedAssetsAtLifeExpectancy="increased_assets_at_life_expectancy",e}({});class y{constructor(){this.updateRecommendationStatus=async e=>{await this.apiCaller.post("/recommendations/update_status",o()(e))},this.getCurrentRecommendations=async()=>{let e=await this.apiCaller.get("/recommendations/current");return l()(e,{deep:!0})},this.autoCompleteRecommendation=async e=>{let t=await this.apiCaller.post("/hlr/autocomplete",o()(e));return l()(t,{deep:!0})},this.resyncHLRs=async()=>{await this.apiCaller.post("/hlr/resync",{})},this.checkHLRsExist=async()=>{let e=await this.apiCaller.get("/hlr/exists");return l()(e,{deep:!0})},this.apiCaller=new a.Ay}}let h=new y},16636:(e,t,n)=>{n.d(t,{KC:()=>x,KZ:()=>v,Lb:()=>u,mE:()=>m});var a=n(33624),r=n(31585),o=n(98868),i=n(84455),l=n(39715),s=n(99026),c=n(78190),d=n(98804);let u=.043,m=.01,p=e=>t=>(0,l.qU)(t,e),y=()=>e=>r.A(e)?void 0:(0,l.qU)(e),h=e=>t=>r.A(t)?e:t,f=()=>e=>r.A(e)?void 0:e,g=e=>t=>r.A(t)?e:(0,s.D8)(t),v=[{dataclassField:"currentAge",preferenceId:i.od.CurrentAge,normalize:p(40),defaultValue:40},{dataclassField:"countryOfResidence",preferenceId:i.od.Residency,normalize:h(c.XM.USA),defaultValue:c.XM.USA},{dataclassField:"riskPreference",preferenceId:i.od.RiskProfile,normalize:h(o.R$.ModeratelyConservative),defaultValue:o.R$.ModeratelyConservative},{dataclassField:"taxFilingStatus",preferenceId:i.od.TaxFilingStatus,normalize:h(i.Xx.Single),defaultValue:i.Xx.Single},{dataclassField:"yearlyTaxableIncome",preferenceId:i.od.EstimatedTotalIncome,normalize:p(0),defaultValue:0},{dataclassField:"retirementAge",preferenceId:d.WR.RetirementAge,normalize:p(67),defaultValue:67},{dataclassField:"lifeExpectancy",preferenceId:d.WR.LifeExpectancy,normalize:p(95),defaultValue:95},{dataclassField:"state",preferenceId:d.WR.State,normalize:h(""),defaultValue:""},{dataclassField:"startingTaxFreeAssets",preferenceId:d.WR.StartingTaxFreeAssets,normalize:p(0),defaultValue:0},{dataclassField:"startingTaxAdvantageAssets",preferenceId:d.WR.StartingTaxAdvantageAssets,normalize:p(0),defaultValue:0},{dataclassField:"inheritedTaxAdvantagedShare",preferenceId:d.WR.InheritedTaxAdvantagedShare,normalize:p(0),defaultValue:0},{dataclassField:"startingTaxedAssets",preferenceId:d.WR.StartingTaxedAssets,normalize:p(0),defaultValue:0},{dataclassField:"retirementRiskPreference",preferenceId:d.WR.RetirementRiskPreference,normalize:h(o.R$.ModeratelyConservative),defaultValue:o.R$.ModeratelyConservative},{dataclassField:"monthlyRetirementContribution",preferenceId:d.WR.MonthlyRetirementContribution,normalize:p(0),defaultValue:0},{dataclassField:"monthlyTaxedInvestmentContribution",preferenceId:d.WR.MonthlyTaxedInvestmentContribution,normalize:p(0),defaultValue:0},{dataclassField:"monthlyRetirementBudget",preferenceId:d.WR.MonthlyRetirementBudget,normalize:p(1e3),defaultValue:1e3},{dataclassField:"socialSecurityBenefits",preferenceId:d.WR.SocialSecurityBenefits,normalize:p(0),defaultValue:0},{dataclassField:"socialSecurityBenefitsStartAge",preferenceId:d.WR.SocialSecurityBenefitsStartAge,normalize:p(67),defaultValue:67},{dataclassField:"otherRetirementIncome",preferenceId:d.WR.OtherRetirementIncome,normalize:p(0),defaultValue:0},{dataclassField:"portfolioScore",preferenceId:d.WR.PortfolioScore,normalize:p(0),defaultValue:0},{dataclassField:"inflationRateYoy",preferenceId:d.WR.InflationRateYoY,normalize:p(.02),defaultValue:.02},{dataclassField:"salaryIncreaseYoy",preferenceId:d.WR.SalaryIncreaseYoY,normalize:p(.02),defaultValue:.02},{dataclassField:"lumpsumPayoutOnRetirement",preferenceId:d.WR.LumpsumPayoutOnRetirement,normalize:p(1e5),defaultValue:1e5},{dataclassField:"portfolioRebalanceFrequency",preferenceId:d.WR.PortfolioRebalanceFrequency,normalize:h(d.YU.Yearly),defaultValue:d.YU.Yearly},{dataclassField:"portfolioManagementFee",preferenceId:d.WR.PortfolioManagementFee,normalize:p(0),defaultValue:0},{dataclassField:"legacyAmountToChildren",preferenceId:d.WR.LegacyAmountToChildren,normalize:p(0),defaultValue:0},{dataclassField:"taxLossHarvesting",preferenceId:d.WR.TaxLossHarvesting,normalize:h(d.Yr.Yearly),defaultValue:d.Yr.Yearly},{dataclassField:"maxOutYearlyRothContribution",preferenceId:d.WR.MaxOutYearlyRothContribution,normalize:g(!1),defaultValue:!1}
3,{dataclassField:"realEstateGrowthRate",preferenceId:d.WR.RealEstateGrowthRate,normalize:p(u),defaultValue:u},{dataclassField:"realEstateCostMode",preferenceId:d.WR.RealEstateCostMode,normalize:h(d.ph.Random),defaultValue:d.ph.Random},{dataclassField:"realEstateUpkeepRate",preferenceId:d.WR.RealEstateUpkeepRate,normalize:p(m),defaultValue:m},{dataclassField:"startingCash",preferenceId:d.WR.StartingCash,normalize:y(),defaultValue:void 0},{dataclassField:"startingRealEstate",preferenceId:d.WR.StartingRealEstate,normalize:y(),defaultValue:void 0},{dataclassField:"startingPrivateEquity",preferenceId:d.WR.StartingPrivateEquity,normalize:y(),defaultValue:void 0},{dataclassField:"modelRmds",preferenceId:d.WR.ModelRmds,normalize:g(!0),defaultValue:!0},{dataclassField:"distributionStrategy",preferenceId:d.WR.DistributionStrategy,normalize:h(d.wO.TaxableFirst),defaultValue:d.wO.TaxableFirst},{dataclassField:"preRmdDistributionSchedule",preferenceId:d.WR.PreRmdDistributionSchedule,normalize:f(),defaultValue:d.wO.TaxableFirst},{dataclassField:"postRmdDistributionSchedule",preferenceId:d.WR.PostRmdDistributionSchedule,normalize:f(),defaultValue:d.wO.TaxableFirst},{dataclassField:"spendingRule",preferenceId:d.WR.SpendingRule,normalize:f(),defaultValue:d.hB.Fixed},{dataclassField:"withdrawalOrder",preferenceId:d.WR.WithdrawalOrder,normalize:f(),defaultValue:d.iv.TaxableFirst},{dataclassField:"includeSpouse",preferenceId:d.WR.IncludeSpouse,normalize:e=>r.A(e)?void 0:(0,s.D8)(e),defaultValue:!1},{dataclassField:"spouseAge",preferenceId:d.WR.SpouseAge,normalize:y(),defaultValue:40},{dataclassField:"spouseRetirementAge",preferenceId:d.WR.SpouseRetirementAge,normalize:y(),defaultValue:67},{dataclassField:"spouseLifeExpectancy",preferenceId:d.WR.SpouseLifeExpectancy,normalize:y(),defaultValue:95},{dataclassField:"spouseSocialSecurityBenefits",preferenceId:d.WR.SpouseSocialSecurityBenefits,normalize:y(),defaultValue:0},{dataclassField:"spouseSocialSecurityBenefitsStartAge",preferenceId:d.WR.SpouseSocialSecurityBenefitsStartAge,normalize:y(),defaultValue:67},{dataclassField:"spouseIncomeAsHouseholdPercentage",preferenceId:d.WR.SpouseIncomeAsHouseholdPercentage,normalize:y(),defaultValue:.4}],x=a.TSs((e,t)=>a.Ufq(t.dataclassField,t,e),{},v);a.TSs((e,t)=>a.Ufq(t.preferenceId,t,e),{},v)},16658:(e,t,n)=>{n.d(t,{Jz:()=>C,sr:()=>b});var a=n(10833),r=n(33624),o=n(55805),i=n(73070),l=n(17667),s=n(73672),c=n(16462),d=n(6976),u=n(28056),m=n(84455),p=n(13340),y=n(86216),h=n(39715);let f=e=>r.mKk(e,r.zug(m.od)),g=e=>e?r.vUk(p.mF,p.Sj[e]):p.mF;var v=n(84245),x=n(50202),A=n(2786),S=n(83314);let b=e=>(0,a.I)({queryKey:[...i.ub.Preferences,null!=e?e:"base"],queryFn:()=>(0,o.FY)(e),...v.gz,enabled:!0}),C=e=>{let t=(0,a.j)(),n=(0,s.ug)(),{activePortfolioId:b}=(0,x.RW)();return(0,l.A)(async n=>{let a="function"==typeof e?e():e,l=a;if(void 0===l){let{scenarioId:e}=await o.gO.getBaseScenarioId();l=e}let s=void 0===a?[...i.ub.Preferences,"base"]:[...i.ub.Preferences,l],c=t.getQueryData(s),v=(null==c?void 0:c.preferences)||[],x=((e,t)=>{let n=r.pbD(u.gq,e),a=r.pbD(u.gq,t),o=r.wQP(e=>e.questionId,n);return r.pbD(e=>{let t=o[e.questionId];return!t||!r.aIS(t.response,e.response)},a)})(v,n),A=void 0!==a?[]:((e,t)=>{let n=e.filter(e=>f(e.questionId));return t.filter(e=>f(e.questionId)).reduce((e,t)=>{let a=n.find(e=>e.questionId===t.questionId);return t.questionId===m.od.EstimatedTotalIncome?((e,t)=>{if(!t)return!1;let n=g(t.detailedResponse);return Math.round(100*y.A.convert(n,p.mF,(0,h.qU)(String(t.response))))===Math.round(100*(0,h.qU)(String(e.response)))})(t,a)?e:r.BCw(((e,t)=>{let n=g(null==t?void 0:t.detailedResponse),a=y.A.convert(p.mF,n,(0,h.qU)(String(e.response)));return{...e,response:String(a),detailedResponse:n}})(t,a),e):a&&a.response===t.response?e:r.BCw(t,e)},[])})(v,n);await (0,o.UO)(l,x),await (0,d.Up)(A)},{onErrorMessage:()=>"Your retirement settings were not saved. Please try again.",onSuccess:async()=>{(0,A.TQ)({event:S.AY.RetirementUpdated}),await t.invalidateQueries(i.ub.Preferences),t.invalidateQueries((0,v.Q7)(b)),n.mutate({recommendationType:c.A.ScenarioModeling,autocompleteWithoutChecking:!0})}})}},16732:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(57090);n(12115);var r=n(31209),o=n(41784),i=n(18206),l=n(83011),s=n(91688),c=n.n(s);let d=e=>{let{scoreImpact:t,haveColorFormatting:n=!0,className:s}=e,d=(0,l.R4)(t);return(0,a.FD)(i.uZ,{className:(0,o.cn)("whitespace-nowrap",s),isPositive:r.A(d),haveColorFormatting:n,"data-sentry-element":"RecommendationStrengthContainer","data-sentry-component":"ScoreImpact","data-sentry-source-file":"ScoreImpact.tsx",children:[(0,l.ln)(d)," ",c()("point",d)]})}}
3,16933:(e,t,n)=>{n.d(t,{B:()=>l,Q:()=>o});var a=n(85267),r=n(33624);let o=(e,t)=>r.bzn(t=>t.includes("*")?RegExp("^"+t.replace("*",".*")+"$").test(e):e===t,t),i=r.aIS(a.BM.PROCESSING_COMPLETE),l=e=>{let t=r.pbD(e=>i(e.status),e),n=r.kuo(e=>i(e.status),e);return{isAllFilesUploaded:r.Q7R(e=>i(e.status),e),uploadedFiles:t,failedFiles:n}}},17123:(e,t,n)=>{n.d(t,{mu:()=>p,nk:()=>u,ru:()=>m});var a=n(12115),r=n(33624),o=n(49586),i=n(2767),l=n(78046),s=n(39715),c=n(56683),d=n(32189);let u=e=>{switch(e.type){case o.l.NewPortfolio:return{portfolioName:"",taxTreatment:d.MG.Taxable,isExternallyManaged:!1,isInvestedFund:!1,advisorFee:null,trackingTicker:null,managementStyle:c.d.SelfDirected};case o.l.EditPortfolio:{let{existingProperties:t}=e,n=(0,i.jh)(t.isExternallyManaged,t.isInvestedFund);return{...e.existingProperties,managementStyle:n,advisorFee:r.gD_(e.existingProperties.advisorFee)?null:(0,s.qU)((0,i.Xr)(e.existingProperties.advisorFee),0)}}}},m=e=>{let t=e.getFieldsValue(),{managementStyle:n}=t,a=n===c.d.ExternallyManaged,r=n===c.d.InvestedFund;return{...t,isExternallyManaged:a,isInvestedFund:r,advisorFee:(0,i.ph)(t.advisorFee),trackingTicker:r?t.trackingTicker:null}},p=()=>{let[e,t]=a.useState(!1),[n]=(0,l.mN)();return{form:n,isFormSubmitting:e,cancelHandler:()=>{n.resetFields()},submitClickHandler:()=>{n.submit()},onSubmittedListener:()=>{t(!0)},submitFinishedHandler:()=>{t(!1)}}}},17170:(e,t,n)=>{n.d(t,{X:()=>r,t:()=>o});var a=n(12115);let r=a.createContext(void 0);r.displayName="ManualPortfolioInputProviderContext";let o=()=>{let e=a.useContext(r);if(!e)throw Error("useManualPortfolioInputContext must be used within a ManualPortfolioInputProvider");return e}},17348:(e,t,n)=>{e.exports=n.p+"static/media/ob_unified_tracking.e16ce159d52eaaa7.svg"},17363:(e,t,n)=>{n.d(t,{A:()=>k});var a=n(57090),r=n(12115),o=n(33624),i=n(62570),l=n(12919),s=n(40248),c=n(90521),d=n(99750),u=n(35209),m=n(95777),p=n(36934),y=n(36271),h=n(92672),f=n(89568),g=n(59149),v=n(27115),x=n(74743);let A=e=>{var t;let{riskProfile:n,isLoading:o,isError:i}=(0,v.c)(null!=(t=e.referencePortfolioId)?t:void 0),l=null!==e.referencePortfolioId,s=l&&o,c=l&&i,d=!l||s||c?"":g.wZ[n];return(0,a.FD)(r.Fragment,{children:[(0,a.FD)(h.Ah,{flexDirection:"row",justifyContent:"flex-start",alignItems:"center",itemsSpacingHorizontal:4,"data-sentry-element":"FlexLayout","data-sentry-source-file":"ReferenceRiskPreferenceField.tsx",children:[(0,a.Y)(p.km,{className:"text-body","data-sentry-element":"Body2W400","data-sentry-source-file":"ReferenceRiskPreferenceField.tsx",children:"Risk preference"}),(0,a.Y)(f.ID,{title:x.$,className:"text-neutral-500","data-sentry-element":"InfoTooltip","data-sentry-source-file":"ReferenceRiskPreferenceField.tsx"})]}),(0,a.Y)("div",{className:"mb-6",children:(0,a.Y)(u.A,{value:d,inForm:!1,disabled:!0,placeholder:s?"Loading…":void 0,endContent:s?(0,a.Y)(y.y,{iconOnly:!0,size:"sm"}):void 0,isInvalid:c,errorMessage:c?"Couldn't load risk preference.":void 0,"data-sentry-element":"Input","data-sentry-source-file":"ReferenceRiskPreferenceField.tsx"})})]})};var S=n(41784),b=n(78046),C=n(11);let I=(0,i.A)("div",{target:"eaoi4cg0"})(),w=(0,i.A)(e=>(0,a.Y)(p.km,{...e,className:(0,S.cn)("text-body",e.className),"data-sentry-element":"Body2W400","data-sentry-component":"Body2W400BoundNeutral800","data-sentry-source-file":"DraftPortfolioFormDrawer.tsx"}),{target:"eaoi4cg1"})(e=>e.required&&b.Ob),P=(0,i.A)("div",{target:"eaoi4cg2"})("margin-bottom:24px;"),k=e=>{let{portfolioDetails:t,onClose:n}=e,i=(0,c.Tw)(),p=(0,d.tb)(["100%","100%","576px"]),{id:y,name:h="",description:f="",referencePortfolioId:g=null}=t,[v,x]=r.useState(h),[S,b]=r.useState(f),[k,F]=r.useState(g),T=v.length>C.xN,E=o.Ime(v)||o.gD_(k)||T,Y=async()=>{if(k)return i.mutateAsync({portfolioId:y,portfolioName:v,portfolioDescription:S,referencePortfolioId:k});console.error("Reference portfolio is not found during Draft properties submit",{portfolioDetails:t})},D=async()=>{await Y(),n()};return(0,a.Y)(l._s,{open:!0,title:"Edit draft portfolio properties",width:p,destroyOnClose:!0,onClose:n,footer:(0,a.FD)(l.tb,{children:[(0,a.Y)(s.A,{onClick:n,children:"Cancel"}),(0,a.Y)(s.A,{variant:"filled",htmlType:"submit",onClick:D,disabled:E,children:"Save"})]}),"data-sentry-element":"Drawer","data-sentry-component":"DraftPortfolioFormDrawer","data-sentry-source-file":"DraftPortfolioFormDrawer.tsx",children:(0,a.FD)(I,{"data-sentry-element":"PortfolioFormContainer","data-sentry-source-file":"DraftPortfolioFormDrawer.tsx",children:[(0,a.Y)(w,{required:!0,"data-sentry-element":"PortfolioFormLabel","data-sentry-source-file":"DraftPortfolioFormDrawer.tsx",children:"Name"}),(0,a.Y)(P,{"data-sentry-element":"PortfolioFormInputContainer","data-sentry-source-file":"DraftPortfolioFormDrawer.tsx",children:(0,a.Y)(u.A,{value:v,onCh
3ange:x,inForm:!1,required:!0,maxLength:C.xN,isInvalid:T,errorMessage:T?C.uu.message:void 0,"data-sentry-element":"Input","data-sentry-source-file":"DraftPortfolioFormDrawer.tsx"})}),(0,a.Y)(w,{"data-sentry-element":"PortfolioFormLabel","data-sentry-source-file":"DraftPortfolioFormDrawer.tsx",children:"Description"}),(0,a.Y)(P,{"data-sentry-element":"PortfolioFormInputContainer","data-sentry-source-file":"DraftPortfolioFormDrawer.tsx",children:(0,a.Y)(u.A,{value:S,onChange:b,inForm:!1,"data-sentry-element":"Input","data-sentry-source-file":"DraftPortfolioFormDrawer.tsx"})}),(0,a.Y)(w,{required:!0,"data-sentry-element":"PortfolioFormLabel","data-sentry-source-file":"DraftPortfolioFormDrawer.tsx",children:"Reference portfolio"}),(0,a.Y)(P,{"data-sentry-element":"PortfolioFormInputContainer","data-sentry-source-file":"DraftPortfolioFormDrawer.tsx",children:(0,a.Y)(m.u,{onChange:e=>{F(e)},selectedPortfolioId:k,"data-sentry-element":"DraftReferencePortfolioSelector","data-sentry-source-file":"DraftPortfolioFormDrawer.tsx"})}),(0,a.Y)(A,{referencePortfolioId:k,"data-sentry-element":"ReferenceRiskPreferenceField","data-sentry-source-file":"DraftPortfolioFormDrawer.tsx"})]})})}},17440:(e,t,n)=>{n.d(t,{BB:()=>r,Th:()=>a,vm:()=>o});var a=function(e){return e.US="US",e.CA="CA",e}({}),r=function(e){return e.Large="Large",e.Mid="Mid",e.Small="Small",e}({}),o=function(e){return e.HealthCare="Health Care",e.Materials="Materials",e.Financials="Financials",e.Industrials="Industrials",e.InformationTechnology="Information Technology",e.RealEstate="Real Estate",e.Energy="Energy",e.Utilities="Utilities",e.CommunicationServices="Communication Services",e.ConsumerStaples="Consumer Staples",e.ConsumerDiscretionary="Consumer Discretionary",e}({})},17445:(e,t,n)=>{n.d(t,{WZ:()=>d,dq:()=>c,jP:()=>l,zI:()=>s});var a=n(57090);n(12115);var r=n(62570),o=n(74547),i=n(16732);let l=o.XI,s=(0,r.A)("span",{target:"ed8gy6a1"})("font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:",e=>e.theme.colors.neutral800,";"),c=e=>(0,a.Y)(o.$n,{...e,variant:"ghost",color:"neutral","data-sentry-element":"Button","data-sentry-component":"ViewInvestmentLink","data-sentry-source-file":"atoms.tsx"}),d=(0,r.A)(i.A,{target:"ed8gy6a2"})("font-size:16px;font-style:normal;font-weight:600;line-height:24px;")},17481:(e,t,n)=>{n.d(t,{h:()=>z,A:()=>V});var a=n(57090),r=n(12115),o=n(74547),i=n(95825),l=n(12919),s=n(40248),c=n(78046),d=n(37699),u=n(62346),m=n(33624),p=n(62212),y=n(19788),h=n(17667),f=n(95935);let g=e=>y.A.updateInvestmentAccount(m.UpN(["id","nickName"],e)),v=e=>y.A.updateSubAccount(e);var x=n(32189),A=n(90799),S=n(44619),b=n(8921),C=n(2767),I=n(56683),w=n(87778),P=n(11325),k=n(13340),F=n(43608);let T=e=>{let{data:t}=(0,F.y)(e.portfolioId,{useErrorBoundary:!1});return(0,a.FD)(r.Fragment,{children:[(0,a.Y)("span",{children:e.accountName}),t?(0,a.Y)(w.I0,{children:(0,a.Y)(P.eF,{amount:t.amount,sourceCurrency:k.mF,currencyFormatter:P.EB.HumanizedLiteralAmount})}):null]})},E=e=>{var t;let n=null==(t=e.subAccount.portfolioSummary)?void 0:t.portfolioId,r=e.subAccount.accountName||"Account ".concat(e.index," name");return m.gD_(n)?(0,a.Y)("span",{children:r}):(0,a.Y)(T,{portfolioId:n,accountName:r,"data-sentry-element":"SubAccountFieldLabelWithBalance","data-sentry-component":"SubAccountFieldLabel","data-sentry-source-file":"SubAccountFieldLabel.tsx"})};var Y=n(99801),D=n(92672),R=n(56490),N=n(22707),M=n(63666),L=n(95655),_=n(11),O=n(81671);let W=()=>(0,a.FD)("div",{"data-sentry-component":"AdvisorFeeTooltipContent","data-sentry-source-file":"InvestmentAccountSetupForm.tsx",children:[(0,a.Y)("div",{children:"Common annual fees for externally managed accounts:"}),(0,a.FD)("div",{className:"mt-2 flex flex-col gap-1",children:[(0,a.Y)("span",{children:"Financial advisor: around 0.8 - 1.5%"}),(0,a.Y)("span",{children:"Robo-advisor: around 0.25 - 0.5%"})]}),(0,a.Y)("div",{className:"mt-2",children:"For direct indexing: around 0.2 - 0.5%"})]}),B=e=>{var t,n;let{form:i,subAccount:l,index:d,isOnlyOneSubAccountExists:u}=e,[m,p]=r.useState(null),y=(null==(t=l.portfolioSummary)?void 0:t.replacementPortfolioId)!=null,h=(0,c.r3)((0,C.r7)(l.id,N.Pw),i),f=(0,c.r3)((0,C.r7)(l.id,N.cL),i),g=h!==I.d.SelfDirected,v=h===I.d.InvestedFund,b=l.nickName||(null==(n=l.portfolioSummary)?void 0:n.portfolioName)||"";r.useEffect(()=>{f&&b&&p((0,S.Bi)(b,f))},[f,b]);let P=(0,C.gM)(e.isOperationAbortable,l);return(0,a.FD)(w.TA,{"data-sentry-element":"SubAccountContainer","data-sentry-component":"SubAccountFormFields","data-sentry-source-file":"InvestmentAccountSetupForm.tsx",children:[(0,a.FD)(D.Ah,{display:"block",flexWrap:"nowrap",justifyContent:"space-between",alignItems:"flex-start",itemsSpacingVertical:8,occupyParentWidth:!0,style:y?{opacity:.5,pointerEvents:"none"}:void 0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"InvestmentAccountSetupForm.tsx",children:[(0,a.FD)(D.Ah,{alignItems:"flex-start",justifyContent:"flex-start",itemsSpacingHorizontal:16,flexWrap:"nowrap",flex:"1 1 auto",width:"100%","data-sentry-element":"FlexLayout","data-sentry-source-file":"InvestmentAccountSetupForm.tsx",children:[(0,a.Y)(w.cN,{name:(0,C.r7)(l.id,N.bi),label:(0,a.Y)(E,{subAccount:l,index:d}
3),hidden:u,style:{flex:"1 1 200px",width:"200px"},rules:[{required:!0,message:"Enter account nickname",whitespace:!0,type:"string"},_.pg],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"InvestmentAccountSetupForm.tsx",children:(0,a.Y)(w.GI,{inForm:!0,maxLength:_.xN,"data-sentry-element":"FormInput","data-sentry-source-file":"InvestmentAccountSetupForm.tsx"})}),!u&&(0,a.FD)("div",{children:[(0,a.Y)(w.JU,{children:"Active"}),(0,a.Y)(w.cN,{name:(0,C.r7)(l.id,N.tf),valuePropName:"checked",label:"Active",noStyle:!0,rules:[{type:"boolean"}],children:(0,a.Y)(o.dO,{})})]})]}),(0,a.FD)(D.Ah,{alignItems:"flex-start",justifyContent:"flex-start",itemsSpacingHorizontal:16,itemsSpacingVertical:8,flex:"1 1 auto",width:"100%","data-sentry-element":"FlexLayout","data-sentry-source-file":"InvestmentAccountSetupForm.tsx",children:[(0,a.Y)("div",{children:(0,a.Y)(w.cN,{name:(0,C.r7)(l.id,N.cL),label:(0,a.Y)(R.A,{label:"Tax treatment",title:"Determines how we calculate taxes on this account's gains and withdrawals.",overlayStyle:{maxWidth:280}}),rules:[{required:!0,message:"Select a tax treatment"}],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"InvestmentAccountSetupForm.tsx",children:(0,a.Y)(A.b,{value:f||x.MG.Taxable,onChange:e=>{i.setFieldValue((0,C.r7)(l.id,N.cL),e),p((0,S.Bi)(b,e))},warningMessage:m,"data-sentry-element":"TaxTreatmentSelector","data-sentry-source-file":"InvestmentAccountSetupForm.tsx"})})}),u&&(0,a.Y)(w.cN,{hidden:!0,name:(0,C.r7)(l.id,N.tf),valuePropName:"checked",initialValue:!0,children:(0,a.Y)(o.dO,{checked:!0})}),(0,a.FD)(D.Ah,{display:"block",justifyContent:"flex-start",alignItems:"stretch",itemsSpacingVertical:8,flex:"1 1 200px","data-sentry-element":"FlexLayout","data-sentry-source-file":"InvestmentAccountSetupForm.tsx",children:[(0,a.Y)(w.cN,{name:(0,C.r7)(l.id,N.Pw),rules:[{required:!0,message:"Select an account type"}],label:"Account type",style:{width:"100%"},"data-sentry-element":"StyledFormItem","data-sentry-source-file":"InvestmentAccountSetupForm.tsx",children:(0,a.Y)(w.BN,{placeholder:"Select account type",options:N._C,"data-sentry-element":"AccountTypeStyledSelect","data-sentry-source-file":"InvestmentAccountSetupForm.tsx"})}),g?(0,a.Y)(w.cN,{name:(0,C.r7)(l.id,N.hT),label:(0,a.Y)(R.A,{label:"Advisor's fee",title:(0,a.Y)(W,{}),overlayStyle:{maxWidth:280}}),rules:(0,C.qc)(g),style:{width:"100%"},extra:(0,a.Y)(w.uM,{}),children:(0,a.Y)(o.YI,{addonAfter:"%"})}):null,v?(0,a.Y)(w.cN,{name:(0,C.r7)(l.id,N.mB),label:(0,a.Y)(R.A,{label:"Index to track",title:"Search for the ticker symbol of the index or ETF this account is tracking (e.g., SPY, VOO, VTI)",overlayStyle:{maxWidth:280}}),style:{width:"100%"},children:(0,a.Y)(L.A,{})}):null]})]})]}),P?(0,a.Y)(w.cV,{children:(0,a.FD)(s.A,{fullWidth:!0,variant:"outlined",prefix:(0,a.Y)(o.In,{icon:O.$.Maintenance,className:"w-4 h-4"}),onClick:()=>{e.onFixAccount(l)},children:["Fix ",b||"account"]})}):null]})},U=e=>{let{connectedInvestmentAccount:t,form:n,isOperationAbortable:o}=e,{launchFixAccount:i}=(0,M.w)(),{data:l=[]}=(0,u.aV)(),s=(e=>{let t=(0,p.j)();return(0,h.A)(g,{onSuccess:async(n,a)=>{try{await Promise.all(m.TjK(v,a.subAccountsParams))}catch(t){console.error("Error updating sub accounts",e,a)}await (0,f.d)(t)}})})(l),c=async()=>{await e.onClose(),n.resetFields()},d=async e=>{await i({portfolioSummary:e.portfolioSummary,connectedAccount:t}),await c()},y=async t=>{e.onSubmittingChange(!0);try{await s.mutateAsync({...t,subAccountsParams:(0,C.pZ)(t)}),await c(),(0,b.Ds)(b._n.Success,"Saved account details")}finally{e.onSubmittingChange(!1)}},{subAccounts:x,bankName:A}=t,S=1===m.Bw9(x),P=m.d5f(x);return(0,a.Y)(w.Nt,{form:n,name:"accountMutationParams",layout:"vertical",initialValues:(0,C.nk)(t),onValuesChange:e=>{m.XCB((e,t)=>{let[a]=m.lDo(N.Wb,t),r=Number(a),o=(0,C.r7)(r,N.Pw),i=n.getFieldValue(o),l=i===I.d.SelfDirected,s=i!==I.d.InvestedFund;l&&n.setFieldValue((0,C.r7)(r,N.hT),void 0),s&&n.setFieldValue((0,C.r7)(r,N.mB),void 0),S&&t===N.bi&&P&&n.setFieldValue((0,C.r7)(P.id,N.bi),e)},e)},onFinish:y,"data-sentry-element":"StyledForm","data-sentry-component":"InvestmentAccountSetupForm","data-sentry-source-file":"InvestmentAccountSetupForm.tsx",children:(0,a.FD)(w.MG,{"data-sentry-element":"FormContainer","data-sentry-source-file":"InvestmentAccountSetupForm.tsx",children:[(0,a.Y)(w.cN,{hidden:!0,name:"id",style:{width:"100%"},"data-sentry-element":"StyledFormItem","data-sentry-source-file":"InvestmentAccountSetupForm.tsx",children:(0,a.Y)(w.GI,{value:t.id,inForm:!0,"data-sentry-element":"FormInput","data-sentry-source-file":"InvestmentAccountSetupForm.tsx"})}),(0,a.Y)(w.cN,{name:"nickName",label:"".concat(A," account nickname"),rules:[{required:!0,whitespace:!0,message:"Enter account nickname",type:"string"},_.pg],style:{width:"100%"},"data-sentry-element":"StyledFormItem","data-sentry-source-file":"InvestmentAccountSetupForm.tsx",children:(0,a.Y)(w.GI,{inForm:!0,maxLength:_.xN,"data-sentry-element":"FormInput","data-sentry-source-file":"InvestmentAccountSetupForm.tsx"})}),S?(0,a.Y)(D.Ah,{display:"block",marginTop:16,children:(0,a.Y)(B,{index:1,form:n,subAccount:x[0],isOnlyOneSubAccountExists:S,isOperationAbortable:o,onFixAccount:d},x[0].id)}):(0,a.FD)(r.Fragment,{children:[(0,a.Y)(w.BA,{children:"Subaccounts information"}),Y.A((e,t)=>(0,a.Y)(B,{index:t+1,form:n,subAccount:e,isOnlyOneSubAccountExists:S,isOperationAbortable:o,onFixAccount:d},e.id),x)]})]})})};var z=function(e){return e.Modal="modal",e.Drawer="drawer",e}({});let V=e=>{let{investmentAccountId:t,isOperationAbortable:n}=e,{data:m=[]}=(0,u.aV)(),p=(0,d.ZS)(t,m),[y]=(0,c.mN)(),[h,f]=r.useState(!1);if(!p)return console.error("No connected investment account found for id: ".concat(t)),e.onCancel(),null;let{subAccounts:g}=p,v=1===g.length?g[0].nickName:p.nickName,x=n?"Edit ".concat(v," account information"):"".concat(v," account information"),A=(0,a.FD)(r.Fragment,{children:[n?(0,a.Y)(s.A,{onClick:()=>{y.resetFields(),e.onClose()},children:"Cancel"}):null,(0,a.Y)(s.A,{variant:"filled",loading:h,onClick:()=>y.submit(),children:"Save"})]}),S={...e,connectedInvestmentAccount:p,form:y,onSubmittingChange:f};
3switch(e.openAs){case"modal":return(0,a.Y)(o.aF,{disableSubmitOnEnter:!0,size:i.rI.Sm,title:x,open:!0,centered:!0,destroyOnClose:!0,closable:n,maskClosable:e.isOperationAbortable,onCancel:e.onClose,footer:(0,a.Y)(i.jl,{children:A}),children:(0,a.Y)(U,{...S})});case"drawer":return(0,a.Y)(w.wf,{width:500,title:x,open:!0,footer:(0,a.Y)(l.tb,{children:A}),destroyOnClose:!0,closable:n,maskClosable:e.isOperationAbortable,onClose:e.onClose,children:(0,a.Y)(U,{...S})})}}},18061:(e,t,n)=>{n.d(t,{T:()=>i});var a=n(12115),r=n(24092),o=n(62212);function i(){let e=(0,o.j)(),t=(0,a.useRef)(e);return(0,r.E)(()=>{t.current=e}),t}},18069:(e,t,n)=>{n.d(t,{B_:()=>f,JJ:()=>y,O6:()=>v,VC:()=>h,YU:()=>p,ZE:()=>x});var a=n(57090),r=n(12115),o=n(33624),i=n(78190),l=n(43057),s=n(74547),c=n(35208),d=n(83542),u=n(62509);let m={[i.XM.USA]:"United States",[i.XM.CAD]:"Canada",[i.XM.Other]:"Other"},p=e=>{switch(e){case i.XM.USA:return o.TjK(o._w2("name"),new d.O().states);case i.XM.CAD:return o.TjK(o._w2("name"),u.A);default:return[]}},y=e=>e===i.XM.CAD?"province":"state",h=e=>(e=>e.charAt(0).toUpperCase()+e.slice(1))(y(e)),f=()=>{let e=o.zug(i.XM);return o.TjK(e=>({label:m[e],value:e}),e)},g=e=>{let t=r.useMemo(()=>f(),[]);return(0,a.Y)(l.Ay,{theme:{components:{Select:{zIndexPopup:10*c.Bf.modal}}},"data-sentry-element":"ConfigProvider","data-sentry-component":"ResidencySelector","data-sentry-source-file":"ResidencySelector.tsx",children:(0,a.Y)(s._P,{options:t,value:e.value||void 0,onChange:e.onChange,onBlur:e.onBlur,style:{width:"100%"},popupMatchSelectWidth:!0,labelInValue:!1,optionLabelProp:"label",disabled:e.disabled,"data-sentry-element":"AntdSelect","data-sentry-source-file":"ResidencySelector.tsx"})})},v=e=>(0,a.Y)(g,{value:e.value||i.XM.USA,onChange:t=>{var n;null==(n=e.onChange)||n.call(e,t)},disabled:e.disabled,onBlur:e.onBlur,"data-sentry-element":"ResidencySelector","data-sentry-component":"ResidencySelectorFormInput","data-sentry-source-file":"ResidencySelector.tsx"}),x=e=>{var t;let n=p(e.residency),r=o.TjK(e=>({label:e,value:e}),n),i="Select ".concat(y(e.residency));return(0,a.Y)(l.Ay,{theme:{components:{Select:{zIndexPopup:10*c.Bf.modal}}},"data-sentry-element":"ConfigProvider","data-sentry-component":"ResidencyStateSelectorFormInput","data-sentry-source-file":"ResidencySelector.tsx",children:(0,a.Y)(s._P,{allowClear:!0,showSearch:!0,optionFilterProp:"label",placeholder:i,options:r,value:e.value||void 0,onChange:t=>(t=>{var n;null==(n=e.onChange)||n.call(e,t)})(t),onBlur:e.onBlur,style:{width:"100%"},popupMatchSelectWidth:!0,labelInValue:!1,optionLabelProp:"label",disabled:null!=(t=e.disabled)?t:0===r.length,"data-sentry-element":"AntdSelect","data-sentry-source-file":"ResidencySelector.tsx"})})}},18162:(e,t,n)=>{n.d(t,{VG:()=>m,eD:()=>d,eG:()=>p,gM:()=>u,l2:()=>y,pD:()=>h});var a=n(12115),r=n(73285),o=n(33624),i=n(99026),l=n(41686),s=n(54741);let c=null,d=e=>{c=e},u=()=>{let e=document.getElementById(s.ce)||document.getElementById(s.GJ);return e?{top:e.scrollTop,left:e.scrollLeft}:(console.error("Unable to get current scroll position: Main content container node reference not found"),{top:0,left:0})},m=e=>{let t={...e,behavior:o.vUk("auto",null==e?void 0:e.behavior)};if(c)return void c.scrollTo(t);let n=document.getElementById(s.ce)||document.getElementById(s.GJ);n?n.scrollTo(t):window.scrollTo(t)},p=e=>{m({...e,top:0,left:0})},y=e=>(0,l.E0)(()=>p(e)),h=()=>{let e=(0,r.w)(),[t,n]=a.useState((0,i.Uc)(e.asPath));a.useEffect(()=>{let a=e=>{let a=(0,i.Uc)(e);n(a);let r=o.aIS(t,a),l=e.includes("#");r||l||y()};if(e.events)return e.events.on("routeChangeComplete",a),()=>{e.events.off("routeChangeComplete",a)};a(window.location.pathname+window.location.search+window.location.hash)},[t,e,e.asPath])}},18206:(e,t,n)=>{n.d(t,{Bg:()=>p,Bn:()=>N,C2:()=>x,C7:()=>P,Ce:()=>A,Gm:()=>f,Hw:()=>M,K:()=>h,Mn:()=>w,Ox:()=>v,Qw:()=>Y,Vs:()=>E,dK:()=>R,gj:()=>F,iz:()=>S,jk:()=>L,m_:()=>T,nP:()=>C,q8:()=>I,tQ:()=>b,uZ:()=>D,uo:()=>k,yN:()=>y});var a=n(57090),r=n(12115),o=n(62570),i=n(74547),l=n(92672),s=n(77348),c=n(36934),d=n(41784),u=n(72781),m=n(81671);let p=(0,o.A)(l.Vs,{target:"e1urvcwm0"})("justify-content:flex-start;@supports (gap:16px){gap:16px;}@supports not (gap:16px){& > div{",(0,l.BK)({marginBottom:["16px"]}),"}@media (min-width:576px) and (max-width:1199px){& > div:nth-of-type(odd){margin-right:16px;}}@media (min-width:1200px){& > div:nth-of-type(1),& >
3 div:nth-of-type(2){margin-right:16px;}}}"),y=(0,o.A)("div",{target:"e1urvcwm1"})("display:flex;flex-direction:column;flex-grow:1;",(0,l.m9)({flexBasis:["100%","100%","calc(50% - 8px)","calc(33% - 12px)","calc(33% - 12px)","calc(33% - 12px)"],maxWidth:["100%","100%","50%","33%","33%","33%"]})),h=e=>{let{isWarning:t,children:n,className:r,classNames:o,...l}=e;return(0,a.Y)(i.Zp,{...l,className:"flex flex-col justify-between box-border h-full w-full ".concat(r||""),classNames:{...o,base:(0,d.cn)("bg-white",(0,u.f)(t),null==o?void 0:o.base),body:(0,d.cn)(null==o?void 0:o.body),footer:(0,d.cn)("min-h-fit border-none w-full flex flex-nowrap items-stretch",null==o?void 0:o.footer)},"data-sentry-element":"Card","data-sentry-component":"RecommendationCard","data-sentry-source-file":"atoms.tsx",children:n})},f=e=>{let{className:t,...n}=e;return(0,a.Y)("div",{className:(0,d.cn)("w-full",t),...n,"data-sentry-component":"PortfolioRecommendationsContainer","data-sentry-source-file":"atoms.tsx"})},g=(0,o.A)(i.Zp,{target:"e1urvcwm2"})((0,l.BK)({minHeight:["200px","320px"]})),v=e=>{let{className:t,style:n,classNames:r,...o}=e;return(0,a.Y)(g,{className:(0,d.cn)("w-full flex justify-center items-center mt-4",t),classNames:{...r,body:(0,d.cn)("w-full",null==r?void 0:r.body)},style:n,...o,"data-sentry-element":"CardWrapperStyled","data-sentry-component":"CardWrapper","data-sentry-source-file":"atoms.tsx"})},x=r.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,a.Y)("div",{ref:t,className:(0,d.cn)("w-full",n),...r})});x.displayName="RecommendationsListingWrapper";let A=e=>(0,a.Y)(c.bU,{...e,className:(0,d.cn)("text-body",e.className),"data-sentry-element":"Body1W400","data-sentry-component":"StyledRecommendationHeader","data-sentry-source-file":"atoms.tsx"}),S=e=>{let{className:t,...n}=e;return(0,a.Y)(s.A,{className:t,...n,"data-sentry-element":"RecommendationActionButton","data-sentry-component":"RecommendationTickerActionButton","data-sentry-source-file":"atoms.tsx"})},b=e=>{let{className:t,...n}=e;return(0,a.Y)(i.$n,{className:(0,d.cn)("[&_svg]:text-xs",t),...n,"data-sentry-element":"Button","data-sentry-component":"RecommendationExplainFurtherButton","data-sentry-source-file":"atoms.tsx"})},C=e=>{let{className:t,...n}=e;return(0,a.Y)(i.$n,{className:t,...n,"data-sentry-element":"Button","data-sentry-component":"RecommendedSecurityExploreButton","data-sentry-source-file":"atoms.tsx"})},I=e=>{let{className:t,...n}=e;return(0,a.Y)(i.$n,{fullWidth:!0,className:(0,d.cn)("h-12",t),...n,"data-sentry-element":"Button","data-sentry-component":"ShowMoreRecommendationsBar","data-sentry-source-file":"atoms.tsx"})},w=(0,o.A)("div",{target:"e1urvcwm3"})("display:flex;> *{margin-top:8px;margin-bottom:8px;}",(0,l.BK)({flexDirection:["column","column","column","row"],justifyContent:["center","center","center","space-between"],alignItems:["center","center","center","center"]})),P=e=>{let{className:t,...n}=e;return(0,a.Y)("div",{className:(0,d.cn)("min-w-[96px] max-w-[140px] h-7","font-semibold text-sm leading-5 text-white","rounded-full","flex justify-center items-center","bg-neutral-600",t),...n,"data-sentry-component":"StyledRecommendationBadge","data-sentry-source-file":"atoms.tsx"})},k=e=>{let{className:t,...n}=e;return(0,a.Y)("div",{className:(0,d.cn)("min-w-[140px] max-w-[160px] h-7","font-semibold text-sm leading-5 text-white","rounded-full","flex justify-center items-center","bg-neutral-600",t),...n,"data-sentry-component":"StyledRecommendationRankingBadge","data-sentry-source-file":"atoms.tsx"})},F=e=>{let{className:t,...n}=e;return(0,a.Y)(k,{className:(0,d.cn)("max-w-none whitespace-nowrap px-4",t),...n,"data-sentry-element":"StyledRecommendationRankingBadge","data-sentry-component":"StyledRecommendationTopPickBadge","data-sentry-source-file":"atoms.tsx"})},T=e=>{let{className:t,...n}=e;return(0,a.Y)(i.$n,{variant:"ghost",color:"neutral",size:"sm",isIconOnly:!0,"aria-label":"Ignore",...n,className:(0,d.cn)("h-7 w-7 min-w-7 shrink-0 text-neutral-500",t),"data-sentry-element":"Button","data-sentry-component":"DismissRecommendationButton","data-sentry-source-file":"atoms.tsx",children:(0,a.Y)(i.In,{icon:m.$.CrossMedium,size:16,"data-sentry-element":"Icon","data-sentry-source-file":"atoms.tsx"})})},E=e=>{let{className:t,...n}=e;return(0,a.Y)("div",{className:(0,d.cn)("flex items-center gap-2 bg-white border border-[color:var(--wp-card-border)] rounded p-2",t),...n,"data-sentry-component":"RecommendationStrengthBaseContainer","data-sentry-source-file":"atoms.tsx"})},Y=e=>{let{className:t,...n}=e;return(0,a.Y)(c.s9,{className:(0,d.cn)("text-neutral-500",t),...n,"data-sentry-element":"Body2W600","data-sentry-component":"RecommendationStrengthLabelContainer","data-sentry-source-file":"atoms.tsx"})},D=e=>{let{isPositive:t,haveColorFormatting:n,className:r,...o}=e;return(0,a.Y)(c.NX,{className:(0,d.cn)(n&&(t?"text-success-600":"text-danger-600"),r),...o,"data-sentry-element":"H4W700","data-sentry-component":"RecommendationStrengthContainer","data-sentry-source-file":"atoms.tsx"})},R=(0,o.A)(l.Ah,{target:"e1urvcwm4"})("width:100%;> *{width:100%;}");(0,o.A)(i.fI,{target:"e1urvcwm5"})((0,l.BK)({minHeight:["0px","0px","0px","0px","64px","48px"]}));let N=(0,o.A)("div",{target:"e1urvcwm6"})("position:relative;width:100%;",(0,l.m9)({height:["124px","104px","104px","104px","104px","104px"]})),M=(0,o.A)("span",{target:"e1urvcwm7"})((0,l.m9)({display:["none","inline","inline","inline","inline","inline"]})),L=(0,o.A)("span",{target:"e1urvcwm8"})((0,l.m9)({display:["inline","none","none","none","none","none"]}))},18281:(e,t,n)=>{n.d(t,{SN:()=>a,ue:()=>r});var a=function(e){return e.Transactions="transactions",e.Brokerage="brokerage",e.Anything="anything",e}({}),r=function(e){return e.CreateNew="create_new",e.UpdateHoldings="update_holdings",e.AddTransactions="add_transactions",e}({})},18290:(e,t,n)=>{n.d(t,{$:()=>b});var a=n(84400),r=n(57090),o=n(12115),i=n(47650),l=n(92672),s=n(62570),c=n(99750),d=n(23462),u=n(55699),m=n(47825);function p(){let e=(0,a._)(["\n        & > *:last-child {\n          // The box-sizing ensures the padding and border of the element do not increase its width.\n          // This helps in making the layout more predictable and aligns it within its container.\n          box-sizing: border-box;\n\n          // The padding is adjusted to give the last child more spacing on the right side in larger views.\n          // This visually separates it from other elements, emphasizing it as the primary action.\n          ","\n        }\n      "]);return p=function(){return e},e}function y(){let e=(0,a._)(["\n          & > *:only-child {\n            // When there's only one child in mobile views, it takes up the full width for better touch accessibility.\n            // !important needed to override HeroUI v3's .button w-fit which constrains width to content.\n            width: 100% !important;\n          }\n        "]);return y=function(){return e},e}function h(){let e=(0,a._)(["\n          & > *:last-child {\n            // In mobile views, if the last child is emphasized, it grows to fill remaining space.\n            // flex shorthand (grow:1, shrink:1, basis:0%) overrides HeroUI v3's w-fit\n            // while still sharing the row with siblings (e.g., back button).\
3n            flex: 1 !important;\n          }\n        "]);return h=function(){return e},e}let f=(e,t)=>(0,d.AH)(e?(0,d.AH)(p(),(0,l.BK)({padding:["0","0 64px","0 64px","0 96px"]})):"",";@media (max-width:",l.fi.md,"px){",t?(0,d.AH)(y()):"",";",e?(0,d.AH)(h()):"",";}"),g=(0,s.A)(l.Ah,{target:"e1mpta290"})(e=>e.isInline?(0,d.AH)("position:static;"):(0,d.AH)("position:fixed;bottom:0;left:0;"),"  width:100%;max-width:100%;box-sizing:border-box;",e=>e.isVariant1?(0,l.BK)({padding:["10px 16px","10px 32px"]}):(0,l.BK)({padding:["16px 16px","16px 32px"]}),"  background-color:",e=>e.theme.colors.white,";box-shadow:0px 1px 0px 0px ",e=>e.theme.colors.neutral300," inset;",e=>e.hasTopRow?"":f(e.emphasizeLastAction,e.stretchSingleChildOnMobile)),v=(0,s.A)(l.Ah,{target:"e1mpta291"})("width:100%;",e=>f(e.emphasizeLastAction,e.stretchSingleChildOnMobile)),x=e=>{var t,n,a;let{isBelow768:i}=(0,c.uF)(),l=null!=(t=e.justifyContent)?t:i?"space-between":"flex-end",s=null==(n=e.emphasizeLastAction)||n,d=null==(a=e.stretchSingleChildOnMobile)||a,u=!!e.topRowContent;return(0,r.Y)(g,{ref:e.containerRef,isInline:e.isInline,flexDirection:u?"column":"row",itemsSpacingHorizontal:u?void 0:16,itemsSpacingVertical:u?8:16,justifyContent:u?"flex-start":l,alignItems:u?"stretch":"center",emphasizeLastAction:s,stretchSingleChildOnMobile:d,isVariant1:!1,hasTopRow:u,className:e.className,"data-sentry-element":"NavigationContainer","data-sentry-component":"NavigationBar","data-sentry-source-file":"OnboardingNavigationWrapper.tsx",children:u?(0,r.FD)(o.Fragment,{children:[e.topRowContent,(0,r.Y)(v,{flexDirection:"row",itemsSpacingHorizontal:16,itemsSpacingVertical:16,justifyContent:l,alignItems:"center",emphasizeLastAction:s,stretchSingleChildOnMobile:d,children:e.children})]}):e.children})},A=e=>{let t=o.useRef(null);return(0,u.n)(t),(0,r.Y)(x,{...e,isInline:!1,containerRef:t,"data-sentry-element":"NavigationBar","data-sentry-component":"FixedOnboardingNav","data-sentry-source-file":"OnboardingNavigationWrapper.tsx"})},S=e=>{let t=(0,r.Y)(x,{...e,isInline:!0});return e.footerContainer?(0,i.createPortal)(t,e.footerContainer):t},b=e=>{let{mode:t,footerContainer:n}=(0,m.WU)();return t===m.Y9.Inline?(0,r.Y)(S,{...e,footerContainer:n}):(0,r.Y)(A,{...e,"data-sentry-element":"FixedOnboardingNav","data-sentry-component":"OnboardingNavigationWrapper","data-sentry-source-file":"OnboardingNavigationWrapper.tsx"})}},19052:(e,t,n)=>{n.d(t,{B6:()=>l,br:()=>s});var a=n(33624),r=n(544),o=n(17143),i=n(47120);let l=e=>e>100&&{pageSize:100},s=e=>{let{portfolioDetailItems:t,unknownSecurities:n,unknownAssetClassOrUnknownSecurities:l,missingDividendDataTickers:s,filterToMissingDividendData:c,excludeBrokerageCash:d,excludeReservedItems:u,fixEnabled:m,fixMode:p}=e,y=t,h=a.EyX("ticker",n),f=a.EyX("ticker",l);return y=u?(0,r.kz)(y):y,y=d?(0,r.fr)(y):y,y=m?a.pbD(e=>(0,o.AT)(e.ticker,h),y):p===i.C.UnknownSecuritiesAndAssetClass?a.pbD(e=>(0,o.AT)(e.ticker,f),y):c?a.pbD(e=>(0,o.AT)(e.ticker,s),y):y}},19273:(e,t,n)=>{var a=n(33841);"object"==typeof a&&a.setOptions({lang:{numericSymbols:["k","M","B","T","P","E"],rangeSelectorZoom:""}})},19304:(e,t,n)=>{n.d(t,{Y:()=>p,a:()=>h});var a=n(57090),r=n(12115),o=n(22942),i=n.n(o),l=n(33624);let s=e=>e,c=e=>{let{caseSensitive:t,sanitize:n=s,searchWords:a,textToHighlight:r}=e;try{r=n(r);let e=l.pbD(Boolean,a);return l.cy0(e=>{try{let a;e=n(e);let o=[],i=t?r:r.toLowerCase(),l=t?e:e.toLowerCase(),s=0;for(;-1!==(a=i.indexOf(l,s));){let e=a,t=a+l.length,n=e>0?r[e-1]:"",i=t<r.length?r[t]:"",c=0===e||/\W/.test(n),d=t===r.length||/\W/.test(i);c&&d&&o.push({highlight:!1,start:e,end:t}),s=a+1}return o}catch(t){return console.error("TextHighlighter findChunks error:",t,{searchWord:e,textToHighlight:r}),[]}},e)}catch(e){return console.error("TextHighlighter findWholeWordChunks error:",e,{caseSensitive:t,searchWords:a,textToHighlight:r}),[]}};var d=function(e){return e.WholeWord="WholeWord",e.Substring="Substring",e}({});let u=e=>{let{textContent:t,highlights:n,renderHighlight:r,caseSensitive:o=!1,autoEscape:l=!1,sanitize:d=s,className:u,matchType:m}=e,p=(()=>{switch(m){case"Substring":return;case"WholeWord":return c}})();return(0,a.Y)(i(),{textToHighlight:t,searchWords:n,caseSensitive:o,highlightTag:r,autoEscape:l,className:u,sanitize:d,findC
3hunks:p,"data-sentry-element":"ReactHighlighter","data-sentry-component":"TextHighlighter","data-sentry-source-file":"TextHighlighter.tsx"})};var m=n(98007);let p=e=>{let{children:t}=e;return(0,a.Y)("span",{className:"text-primary hover:underline focus:text-primary","data-sentry-component":"HighlightedTicker","data-sentry-source-file":"TickerHighlighter.tsx",children:t})},y=e=>(0,a.Y)(p,{"data-sentry-element":"HighlightedTicker","data-sentry-component":"defaultHighlightedTickerRenderer","data-sentry-source-file":"TickerHighlighter.tsx",children:e}),h=e=>{let{textContent:t,tickers:n,caseSensitive:o=!0,autoEscape:i=!1,renderTicker:l=y,customTickerClickHandler:s,...c}=e,{launchInvestmentExploration:p}=(0,m.w)();return(0,a.Y)(r.Fragment,{children:(0,a.Y)(u,{...c,textContent:t,highlights:n,matchType:d.WholeWord,caseSensitive:o,autoEscape:i,renderHighlight:e=>{let{children:t}=e;return(0,a.Y)("span",{"data-interactive-mention":!0,style:{cursor:"pointer"},onClick:()=>(e=>{s?s(e):p({ticker:e,netWorthDetail:null})})(t),children:l(t)})},"data-sentry-element":"TextHighlighter","data-sentry-source-file":"TickerHighlighter.tsx"})})}},19483:(e,t,n)=>{n.d(t,{L:()=>s,f:()=>c});var a=n(99026),r=n(22462),o=n(33624),i=n(4603),l=n(7802);let s=()=>setTimeout(()=>{(0,a.fY)()},800),c=(e,t,n)=>{let a={OPEN:{message:"Plaid opened"},SEARCH_INSTITUTION:{message:"Search institution",data:t.institution_search_query},INSTITUTION_NOT_FOUND:{message:"institution was not found (plaid server error)",data:t.institution_search_query},TRANSITION_VIEW:{message:"Transitioned to "+t.view_name+" Screen",data:t.view_name},SELECT_INSTITUTION:{message:"Bank Selected",data:t.institution_name},SELECT_DEGRADED_INSTITUTION:{message:"Selected degraded institution (DEGRADED health status)",data:t.institution_name,institution_id:t.institution_id},SELECT_DOWN_INSTITUTION:{message:"Selected down institution (DOWN health status)",data:t.institution_name,institution_id:t.institution_id},SUBMIT_CREDENTIALS:{message:"Submitted account credentials",data:t.institution_name,institution_id:t.institution_id},SUBMIT_MFA:{message:"Submitted MFA",data:t.institution_name,institution_id:t.institution_id},HANDOFF:{message:"Integration successful",data:t.institution_name},ERROR:{message:"Error occurred",data:t.institution_name,institution_id:t.institution_id,error_code:t.error_code,error_message:t.error_message},EXIT:{message:"Exited connection flow",data:t.institution_name,institution_id:t.institution_id,error_code:t.error_code,error_message:t.error_message,exit_status:t.exit_status}}[e],s=t.institution_id,c=r.A(t.error_code);o.AU6(o.mKk(e,["OPEN","ERROR","EXIT","HANDOFF"]))&&n({event:c?i.ExternalAccountConnectionEvent.ConnectionErroredOut:i.ExternalAccountConnectionEvent.ConnectionInProgress,institutionId:s,institutionName:t.institution_name,accountProvider:l.$5.Plaid,message:r.A(a)?a:e,eventMetadata:t},null,null),n(r.A(a)?{event:i.ExternalAccountConnectionEvent.PlaidUIEvent,institutionId:s,institutionName:t.institution_name,accountProvider:l.$5.Plaid,message:a,eventMetadata:t}:{event:i.ExternalAccountConnectionEvent.PlaidUIUnhandledEvent,institutionId:s,institutionName:t.institution_name,accountProvider:l.$5.Plaid,message:a,eventMetadata:t},null,null)}},19565:(e,t,n)=>{n.d(t,{B:()=>o,p:()=>r});let a={staleTime:1e4,cacheTime:1e4,retry:!1},r=(e,t,n)=>{e.prefetchQuery(t,n,a)},o=async(e,t,n)=>{try{return await e.fetchQuery(t,n,a)}finally{e.removeQueries(t)}}},19647:(e,t,n)=>{n.d(t,{O:()=>a,a:()=>r});let{useSyncTransactionsListener:a,emitSyncTransactions:r}=(0,n(43948).createEvent)("SyncTransactions")()},20155:(e,t,n)=>{n.d(t,{l:()=>i});var a=n(12115),r=n(56318),o=n(76778);let i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{initialLoadingState:t=!0,onLoaded:n}=e,[i,l]=a.useState(t),[s,c]=a.useState(null),[d,u]=a.useState(!1),[m,p]=a.useState(null),y=(0,o.K)(e=>{null==n||n(e)}),h=(0,o.K)(()=>{l(!0),c(null),r.A.getMessages().then(e=>{var t;y(null!=(t=e.messages)?t:[])}).catch(e=>{c(e instanceof Error?e:Error("Failed to load conversation history"))}).finally(()=>{l(!1)})});return{loadHistory:h,retryLoadHistory:h,clearHistory:(0,o.K)(async()=>{u(!0),p(null);try{return(await r.A.clearConversation()).success}catch(e){return p(e instanceof Error?e:Error("Failed to clear conversation history")),!1}finally{u(!1)}}),isHistoryLoading:i,historyLoadError:s,isHistoryClearing:d,historyClearError:m}}},20291:(e,t,n)=>{n.d(t,{I:()=>a,w:()=>r});var a=function(e){return e.UnitedStates="United States",e.Canada="Canada",e}({}),r=function(e){return e.ShortTermTax="short_term",e.LongTermTax="long_term",e.GenericTax="generic",e}({})},21285:(e,t,n)=>{n.d(t,{O:()=>ee});var a=n(57090),r=n(12115),o=n(89069),i=n(11965),l=n(31585),s=n(84978),c=n(92672),d=n(85794),u=n(85543),m=n(33624),p=n(83542),y=n(62509);let h=e=>{let{value:t}=e,n=(0,u.Df)(t,"propertyLocation"),o=(0,r.useMemo)(()=>{switch(n){case s._H.Canada:return m.TjK(m._w2("name"),y.A);case s._H.UnitedStates:return m.TjK(m._w2("name"),new p.O().states);default:return[]}},[n]);return(0,a.Y)(d.Ge,{"data-sentry-element":"RealEstateSelectContainer","data-sentry-component":"RealEstateStateProvince","data-sentry-source-file":"RealEstateStateProvince.tsx",children:(0,a.Y)(d.Fy,{placeholder:n===s._H.Canada?"Select province":"Select state",value:(0,u.Df)(t,"state"),onChange:n=>{var a;
3null==(a=e.onChange)||a.call(e,{...t,state:n,code:null})},options:m.TjK(e=>({value:e,label:e}),o),"data-sentry-element":"RealEstateSelect","data-sentry-source-file":"RealEstateStateProvince.tsx"})})};var f=n(10102);let g=e=>{let{value:t}=e,{countriesAlphaThreeOptions:n}=(0,f.t)();return(0,a.Y)(d.Ge,{"data-sentry-element":"RealEstateSelectContainer","data-sentry-component":"RealEstatePropertyLocation","data-sentry-source-file":"RealEstatePropertyLocation.tsx",children:(0,a.Y)(d.Fy,{showSearch:!0,value:(0,u.Df)(t,"propertyLocation"),onChange:n=>{var a;let r=(0,u.Df)(t,"nickname"),o=(0,u.Df)(t,"streetAddress"),i=null!=r&&r===o,l=(0,u.Df)(t,"entryMode"),c={...t,...s.id,propertyLocation:n,state:null,code:null,streetAddress:null,nickname:i?null:r,entryMode:n===s._H.UnitedStates?l:s.AB.Manual};null==(a=e.onChange)||a.call(e,c)},options:n,placeholder:"Select country",filterOption:!0,optionFilterProp:"label","data-sentry-element":"RealEstateSelect","data-sentry-source-file":"RealEstatePropertyLocation.tsx"})})},v=e=>{let{value:t}=e,n=(0,u.Df)(t,"code");return(0,a.Y)(d.Zh,{inForm:!0,value:n,onChange:n=>{var a;let r={...t,code:String(n)};
3null==(a=e.onChange)||a.call(e,r)},"data-sentry-element":"RealEstatePincodeInput","data-sentry-component":"RealEstatePinCode","data-sentry-source-file":"RealEstatePinCode.tsx"})};var x=n(67297),A=n(35208);let S=e=>{let{value:t}=e,n=(0,u.Df)(t,"propertyType");return(0,a.Y)(d.aG,{placeholder:"Select type",value:n,optionLabelProp:"label",dropdownStyle:{zIndex:A.Bf.select},onChange:n=>{var a;let r={...t,propertyType:n};null==(a=e.onChange)||a.call(e,r)},options:m.TjK(e=>({label:x.A6[e],value:e}),Object.values(s.Ut)),"data-sentry-element":"RealEstatePropertyTypeSelect","data-sentry-component":"RealEstatePropertyType","data-sentry-source-file":"RealEstatePropertyType.tsx"})};var b=n(74547),C=n(36934),I=n(78046);let w=e=>{let{value:t}=e,n=(0,u.Df)(t,"nickname");return(0,a.Y)(d.FB,{inForm:!0,value:n,onChange:n=>{var a;let r={...t,nickname:String(n)};null==(a=e.onChange)||a.call(e,r)},placeholder:"e.g. 48 Newton St, Beach House","data-sentry-element":"RealEstateNicknameInput","data-sentry-component":"RealEstateNickname","data-sentry-source-file":"RealEstateNickname.tsx"})},P=e=>{let{value:t}=e,n=!!(0,u.Df)(t,"rentalProperty");return(0,a.Y)(d.Qe,{inForm:!0,checked:n,onChange:n=>{var a;let r={...t,rentalProperty:n};
3null==(a=e.onChange)||a.call(e,r)},"data-sentry-element":"RealEstateRentalPropertySwitch","data-sentry-component":"RealEstateRentalPropertyFlag","data-sentry-source-file":"RealEstateRentalPropertyFlag.tsx"})};var k=n(21533),F=n(13340),T=n(88179);let E=[{value:s.AB.Live,label:"Live value"},{value:s.AB.Manual,label:"Manual entry"}],Y=e=>(0,a.Y)(b.tU,{size:"sm",selectedKey:e.value,onSelectionChange:t=>{e.onChange(t)},isDisabled:e.isDisabled,"aria-label":"Property value entry mode","data-sentry-element":"Tabs","data-sentry-component":"RealEstateEntryModeSwitch","data-sentry-source-file":"RealEstateEntryModeSwitch.tsx",children:E.map(e=>(0,a.Y)(b.oz,{title:e.label},e.value))});var D=n(92332),R=n(39633),N=n(81527),M=n(22462),L=n(10320);let _=e=>{var t;let[n,i]=r.useState((null==(t=e.value)?void 0:t.streetAddress)||""),[l]=(0,R.A)(n,300),c=(0,o.h)(),{data:d=[],isLoading:u}=(e=>(0,N.I)(["propertyAddressSearch",e],()=>L.A.searchPropertyAddress(e),{enabled:m.Bqr(e).length>=3}))(l),y=r.useMemo(()=>d.map(e=>({label:e.formattedAddress,value:e.providerPropertyId,textValue:e.formattedAddress})),[d]),h=D.A(l)&&l.trim().length>=3&&!u&&m.Ime(d);return(0,a.Y)(b.j9,{inForm:!0,value:n,onChange:t=>{var n;i(t),e.value&&t!==e.value.streetAddress&&(null==(n=e.onChange)||n.call(e,{...e.value,...s.id,nickname:t,streetAddress:t}))},onSelect:t=>{var n;let a=d.find(e=>e.providerPropertyId===t);a&&e.value&&(i(a.formattedAddress),null==(n=e.onChange)||n.call(e,{...e.value,...s.id,nickname:a.formattedAddress,propertyLocation:s._H.UnitedStates,state:(e=>{let t=new p.O().states.find(t=>t.abbreviation===e.toUpperCase());return t?t.name:null})(a.state),code:a.zipCode,streetAddress:a.formattedAddress,providerPropertyId:a.providerPropertyId}))},onPanelVisibleChange:e.onSuggestionListVisibleChange,items:y,isLoading:u,isDisabled:c,placeholder:"Start typing your address...",allowsCustomValue:!0,allowsEmptyCollection:!0,filterOption:()=>!0,notFoundContent:h?(0,a.Y)("div",{className:"p-2 text-sm text-neutral-500",children:"No matching address found"}):null,"data-sentry-element":"AutoComplete","data-sentry-component":"RealEstateAddressLookup","data-sentry-source-file":"RealEstateAddressLookup.tsx"})};var O=n(70432),W=n(11325);let B="tabular-nums text-neutral-900",U="text-neutral-600",z=e=>{let{data:t,isLoading:n,isError:o}=(e=>(0,N.I)(["propertyValuation",e||""],()=>L.A.lookupPropertyValue(e||""),{enabled:M.A(e)&&D.A(e)}))(e.providerPropertyId),i=e.onValuationResolved;if(r.useEffect(()=>{if(t)return void i(t.status,t.valuation);o&&i(s.Ph.ProviderError,null)},[t,o,i]),!e.providerPropertyId)return null;if(n)return(0,a.Y)(c.Ah,{display:"block",className:"rounded-lg bg-blue-50 p-4","data-testid":"valuation-card-loading",children:(0,a.Y)(C.km,{className:"text-neutral-500",children:"Looking up this property's value..."})});let l=null==t?void 0:t.valuation;if(!l)return null;let d=(e=>{if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"})})(l.updatedOn),u=((e,t)=>{let n=M.A(t)?"".concat(t.toLocaleString()," sq ft"):null;return M.A(e)&&M.A(n)?"".concat(e," (").concat(n,")"):null!=e?e:n})(M.A(l.propertyType)?x.A6[l.propertyType]:null,l.livingSquareFeet);return(0,a.FD)(c.Ah,{display:"block",className:l.isRoughEstimate?"rounded-lg border border-amber-200 bg-amber-50 p-4":"rounded-lg border border-blue-200 bg-blue-50 p-4","data-testid":"valuation-card","data-sentry-element":"FlexLayout","data-sentry-component":"RealEstateValuationCard","data-sentry-source-file":"RealEstateValuationCard.tsx",children:[(0,a.Y)(C.Z4,{className:"uppercase tracking-wide text-neutral-500","data-sentry-element":"CaptionW500","data-sentry-source-file":"RealEstateValuationCard.tsx",children:l.isRoughEstimate?"Estimated market value range":"Estimated market value"}),l.isRoughEstimate?(0,a.FD)(r.Fragment,{children:[(0,a.FD)(C.NX,{className:B,"data-testid":"valuation-range",children:[(0,a.Y)(W.eF,{amount:l.valueLow,sourceCurrency:e.currency,currencyFormatter:W.EB.HumanizedCompactAmount})," to ",(0,a.Y)(W.eF,{amount:l.valueHigh,sourceCurrency:e.currency,currencyFormatter:W.EB.HumanizedCompactAmount})]}),(0,a.FD)(C.km,{className:U,"data-testid":"valuation-value",children:["Midpoint ",(0,a.Y)(W.eF,{amount:l.value,sourceCurrency:e.currency,currencyFormatter:W.EB.HumanizedComprehe
3nsiveAmount,customFormatOptions:{hideDecimals:!0}})]}),(0,a.FD)(C.km,{className:"mt-2 text-neutral-700","data-testid":"valuation-rough-estimate-prompt",children:["Rough estimate. Use it as is, or ",(0,a.Y)(O.A,{color:"accent",onClick:e.onUseManualEntry,children:"enter valuation yourself"}),"."]})]}):(0,a.FD)(r.Fragment,{children:[(0,a.Y)(C.NX,{className:B,"data-testid":"valuation-value",children:(0,a.Y)(W.eF,{amount:l.value,sourceCurrency:e.currency,currencyFormatter:W.EB.HumanizedComprehensiveAmount,customFormatOptions:{hideDecimals:!0}})}),(0,a.FD)(C.km,{className:U,"data-testid":"valuation-range",children:[(0,a.Y)(W.eF,{amount:l.valueLow,sourceCurrency:e.currency,currencyFormatter:W.EB.HumanizedCompactAmount})," to ",(0,a.Y)(W.eF,{amount:l.valueHigh,sourceCurrency:e.currency,currencyFormatter:W.EB.HumanizedCompactAmount})]})]}),M.A(u)?(0,a.Y)(C.km,{className:"text-neutral-700",children:u}):null,M.A(d)?(0,a.FD)(C.cO,{className:"text-neutral-500",children:["Valuation as of ",d]}):null]})};var V=n(10098),j=n(39715),H=n(76778),q=n(65438);let G=["onChange","onSubmit"],K=e=>{var t,n;let{realEstateDetail:o,mortgageDetail:i,form:u,onValuesChange:m}=e,p=(0,b.r3)("realEstateDetail",u)||o,y=(0,b.r3)("mortgageDetail",u)||i,f=(e=>{var t;let n=null==(t=e.additionalDetail)?void 0:t.propertyLocation;return n===s._H.Canada?{state:"Province",zipCode:"Postal code",showStateAndCode:!0}
3:n===s._H.UnitedStates?{state:"State",zipCode:"Zip code",showStateAndCode:!0}:{state:"",zipCode:"",showStateAndCode:!1}})(p),A=!!(null==(t=p.additionalDetail)?void 0:t.rentalProperty),E=p.additionalDetail,D=(null==E?void 0:E.entryMode)||s.AB.Manual,R=(null==E?void 0:E.propertyLocation)===s._H.UnitedStates,N=R&&D===s.AB.Live,M=f.showStateAndCode&&!N,[L,O]=r.useState(null),{value:W,setValue:B}=(0,q.A)(!1),{value:U,setTrue:K}=(0,q.A)(!1),Q=e=>({validateTrigger:U?G:"onSubmit",validator:async(t,n)=>{K();let a=e(n);if(a)throw Error(a)}}),$=r.useRef((null==E?void 0:E.providerPropertyId)||null),X=r.useRef((null==E?void 0:E.providerPropertyId)||null),J=!!X.current&&(null==E?void 0:E.providerPropertyId)===X.current;r.useEffect(()=>{let e=(null==E?void 0:E.providerPropertyId)||null;e!==$.current&&($.current=e,u.setFieldValue(["realEstateDetail","investmentValue"],0),e&&u.setFields([{name:["realEstateDetail","additionalDetail"],errors:[]}]))},[null==E?void 0:E.providerPropertyId,u]);let Z=e=>{let t;O(null),E&&(t={...E,entryMode:e},u.setFieldValue(["realEstateDetail","additionalDetail"],t))},ee=(0,H.K)((e,t)=>{var n;let a=u.getFieldValue(["realEstateDetail","additionalDetail"]);if(e!==s.Ph.Ok||!t){if(O(e),a.providerPropertyId&&a.providerPropertyId===X.current)return;u.setFieldValue(["realEstateDetail","additionalDetail"],{...a,entryMode:s.AB.Manual,providerPropertyId:null});return}O(null),u.setFieldValue(["realEstateDetail","investmentValue"],t.value),u.setFieldValue(["realEstateDetail","additionalDetail"],{...a,propertyType:null!=(n=t.propertyType)?n:a.propertyType})});return(0,a.FD)(I.lV,{form:u,layout:"vertical",initialValues:{realEstateDetail:o,mortgageDetail:i},scrollToFirstError:!0,onValuesChange:m,preserve:!0,"data-sentry-element":"Form","data-sentry-component":"RealEstateNetworthForm","data-sentry-source-file":"RealEstateNetworthForm.tsx",children:[R&&(0,a.Y)(c.Ah,{display:"block",className:"mb-4",children:(0,a.Y)(Y,{value:D,onChange:Z})}),L&&(0,a.Y)(c.Ah,{display:"block",className:"mb-3",children:(0,a.Y)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3",children:(0,a.Y)(C.km,{className:"text-neutral-700",children:J?"We couldn't refresh this property's value right now, so we're still showing the value we have on file.":L===s.Ph.LowConfidence?"We don't have a confident estimate for this address. Enter the value yourself below.":L===s.Ph.ProviderError?"We couldn't load this property's value right now. Enter the value yourself below.":"We couldn't find an estimate for this address. Enter the value yourself below."})})}),N&&(0,a.FD)(r.Fragment,{children:[(0,a.Y)(c.Ah,{display:"block",children:(0,a.Y)(T.JF,{name:["realEstateDetail","additionalDetail"],rules:[{required:!0,message:"Please pick your address from the suggestions",validator:async(e,t)=>{if(l.A(null==t?void 0:t.providerPropertyId))throw Error("Please pick your address from the suggestions")}}],label:(0,a.Y)(C.km,{className:"text-neutral-500",children:"Property address"}),extra:"We'll keep this property's value up to date.",help:W?"":void 0,children:(0,a.Y)(_,{onSuggestionListVisibleChange:B})})}),(0,a.Y)(c.Ah,{display:"block",className:"mb-3",children:(0,a.Y)(z,{providerPropertyId:(null==E?void 0:E.providerPropertyId)||null,currency:p.currency,onValuationResolved:ee,onUseManualEntry:()=>Z(s.AB.Manual)})})]}),!N&&(0,a.Y)(c.Ah,{display:"block",children:(0,a.Y)(T.JF,{name:["realEstateDetail","additionalDetail"],rules:[{required:!0,message:"Please enter nickname",validator:async(e,t)=>{if(l.A(t.nickname))throw Error("Please enter nickname")}}],label:(0,a.Y)(C.km,{className:"text-neutral-500",children:"Property nickname"}),children:(0,a.Y)(w,{})})}),(0,a.FD)(c.Ah,{flexWrap:"nowrap",justifyContent:"space-between",itemsSpacingHorizontal:12,equalWidthItems:!0,display:N?"none":"flex","data-sentry-element":"FlexLayout","data-sentry-source-file":"RealEstateNetworthForm.tsx",children:[(0,a.Y)(T.JF,{name:["realEstateDetail","additionalDetail"],label:(0,a.Y)(C.km,{className:"text-neutral-500",children:"Country"}),required:!0,"data-sentry-element":"FormItem","data-sentry-source-file":"RealEstateNetworthForm.tsx",children:(0,a.Y)(g,{"data-sentry-element":"RealEstatePropertyLocation","data-sentry-source-file":"RealEstateNetworthForm.tsx"})}),(0,a.Y)(T.JF,{name:["realEstateDetail","additionalDetail"],label:(0,a.Y)(C.km,{className:"text-neutral-500",children:f.state}),required:!0,hidden:!f.showStateAndCode,rules:[Q(e=>M&&l.A(null==e?void 0:e.state)?"Please select a ".concat(f.state.toLowerCase()):null)],"data-sentry-element":"FormItem","data-sentry-source-file":"RealEstateNetworthForm.tsx",children:(0,a.Y)(h,{"data-sentry-element":"RealEstateStateProvince","data-sentry-source-file":"RealEstateNetworthForm.tsx"})})]}),(0,a.FD)(c.Ah,{flexWrap:"nowrap",justifyContent:"space-between",itemsSpacingHorizontal:8,display:N?"none":"flex","data-sentry-element":"FlexLayout","data-sentry-source-file":"RealEstateNetworthForm.tsx",children:[(0,a.Y)(c.Ah,{display:f.showStateAndCode?"block":"none",width:"49%","data-sentry-element":"FlexLayout","data-sentry-source-file":"RealEstateNetworthForm.tsx",children:(0,a.Y)(T.JF,{name:["realEstateDetail","additionalDetail"],label:(0,a.Y)(C.km,{className:"text-neutral-500",children:f.zipCode}),required:!0,hidden:!f.showStateAndCode,rules:[Q(e=>M&&l.A(null==e?void 0:e.code)?"Please enter a ".concat(f.zipCode.toLowerCase()):null)],"data-sentry-element":"FormItem","data-sentry-source-file":"RealEstateNetworthForm.tsx",children:(0,a.Y)(v,{"data-sentry-element":"RealEstatePinCode","data-sentry-source-file":"RealEstateNetworthForm.tsx"})})}),(0,a.Y)(c.Ah,{display:"block",width:f.showStateAndCode?"49%":"100%","data-sentry-element":"FlexLayout","data-sentry-source-file":"RealEstateNetworthForm.tsx",children:(0,a.Y)(T.JF,{name:["realEstateDetail","additionalDetail"],label:(0,a.Y)(C.km,{className:"text-neutral-500",children:"Property type"}),required:!0,rules:[Q(e=>!N&&l.A(null==e?void 0:e.propertyType)?"Please select a property type":null)],"data-sentry-element":"FormItem","data-sentry-source-file":"RealEstateNetworthForm.tsx",children:(0,a.Y)(S,{"data-sentry-element":"RealEstatePropertyType","data-sentry-source-file":"RealEstateNetworthForm.tsx"})})})]}),(0,a.FD)(c.Ah,{flexWrap:"nowrap",alignItems:"flex-start",itemsSpacingHorizontal:8,"data-sentry-element":"FlexLayout","data-sentry-source-file":"RealEstateNetworthForm.tsx",children:[(0,a.Y)(T.JF,{name:["realEstateDetail","investmentValue"],required:!0,hidden:N,label:(0,a.Y)(C.km,{className:"text-neutral-500",children:null==(n=x.C6[s.q8.RealEstate])?void 0:n.headerLabel}),className:"flex-1 min-w-0",rules:[{required:!N,message:"Please enter an estimated property value"},{validator:N?(0,k.de)(k.wx):(0,k.Un)(k.wx)},{validator:async(e,t)=>{if(N&&!((0,j.qU)(t)>0))throw Error("Waiting for this property’s value")}}],"data-sentry-element":"FormItem","data-sentry-source-file":"RealEstateNetworthForm.tsx",children:(0,a.Y)(d.d,{humanizeNumber:!0,addonBefore:F.IK[p.currency],"data-sentry-element":"StyledNetworthInput","data-sentry-source-file":"RealEstateNetworthForm.tsx"})}),(0,a.Y)(T.JF,{name:["realEstateDetail","currency"],required:!0,hidden:!0,className:"display-none","data-sentry-element":"FormItem","data-sentry-source-file":"RealEstateNetworthForm.tsx"}),(0,a.Y)(T.JF,{style:{margin:0},shouldUpdate:!0,className:"flex-1 min-w-0","data-sentry-element":"FormItem","data-sentry-source-file":"RealEstateNetworthForm.tsx",children:()=>{var e;return(0,a.Y)(T.JF,{name:["mortgageDetail","investmentValue"],shouldUpdate:!0,rules:[{required:!0},{validator:async(e,t)=>{if(t>p.investmentValue)throw Error("Mortgage exceeds gross value.")},warningOnly:!0},{validator:(0,k.de)(k.wx)}],label:(0,a.Y)(C.km,{className:"text-neutral-500",children:null==(e=x.C6[s.q8.RealEstateMortgage])?void 0:e.headerLabel}),children:(0,a.Y)(d.d,{inForm:!0,humanizeNumber:!0,addonBefore:F.IK[y.currency]})})}}),(0,a.Y)(T.JF,{name:["mortgageDetail","currency"],required:!0,hidden:!0,className:"display-none","data-sentry-element":"FormItem","data-sentry-source-file":"RealEstateNetworthForm.tsx"})]}),!N&&(0,a.Y)(V.A,{name:["realEstateDetail","valueUpdateMode"]}),(0,a.Y)(T.JF,{name:["mortgageDetail","additionalDetail","interestRate"],label:(0,a.Y)(C.km,{className:"text-neutral-500",children:"Mortgage interest rate"}),rules:[{validator:async(e,t)=>100*(0,j.qU)(t)>100?Promise.reject("Interest rate can't exceed 100%"):Promise.resolve()}],"data-sentry-element":"FormItem","data-sentry-source-file":"RealEstateNetworthForm.tsx",children:(0,a.Y)(b.tv,{inForm:!0,"data-sentry-element":"PercentageInput","data-sentry-source-file":"RealEstateNetworthForm.tsx"})}),(0,a.FD)(c.Ah,{flexWrap:"nowrap",justifyContent:"space-between",alignItems:"start",itemsSpacingHorizontal:8,"data-sentry-element":"FlexLayout","data-sentry-source-file":"RealEstateNetworthForm.tsx",children:[(0,a.Y)(c.Ah,{display:"block","data-sentry-element":"FlexLayout","data-sentry-source-file":"RealEstateNetworthForm.tsx",children:(0,a.Y)(T.JF,{style:{marginBottom:0},name:["realEstateDetail","additionalDetail"],label:(0,a.Y)(C.km,{className:"text-neutral-500",children:"Rental property"}),"data-sentry-element":"FormItem","data-sentry-source-file":"RealEstateNetworthForm.tsx",children:(0,a.Y)(P,{"data-sentry-element":"RealEstateRentalPropertyFlag","data-sentry-source-file":"RealEstateNetworthForm.tsx"})})}),A&&(0,a.Y)(c.Ah,{display:"block",className:"flex-1 min-w-0",children:(0,a.Y)(T.JF,{style:{marginBottom:0},name:["realEstateDetail","additionalDetail","monthlyRentalIncome"],label:(0,a.Y)(C.km,{className:"text-neutral-500",children:"Monthly rental income"}),rules:[{validator:(0,k.de)(k.wx)}],children:(0,a.Y)(d.d,{humanizeNumber:!0,addonBefore:F.IK[p.currency]})})})]})]})};var Q=n(74166),$=n(95825),X=n(7800),J=n(88105);let Z=e=>{let t=(0,o.h)();return(0,a.Y)(Q.z,{title:e.title,size:$.rI.Sm,onOk:e.onOk,okText:e.submitLabel,okButtonProps:{loading:e.isSubmitting,disabled:t||!e.hasUnsavedChanges},onCancel:e.onCancel,cancelText:"Cancel","data-sentry-element":"InputPopup","data-sentry-component":"RealEstateNetworthFormPopupContent","data-sentry-source-file":"RealEstateNetworthFormPopup.tsx",children:e.children})},ee=e=>{let{form:t,upsertableComprehensiveRealEstateItem:n,handleRealEstateValuesChange:o,handleRealEstateDetailsSubmit:l}=(0,X.L)(e.comprehensiveRealEstateItem,e.onSuccessfulUpsert),[c,d]=r.useState(!1),{value:m,setTrue:p}
3=(0,q.A)(!1),{launchUnsavedChangesModal:y}=(0,J.y)(),h=(0,b.r3)(["realEstateDetail","additionalDetail"],t);if(!n)return null;let f=n.realEstateDetail,g=f.additionalDetail,v=h||g,x=!(0,u.Lh)(f)&&(null==v?void 0:v.entryMode)!==(null==g?void 0:g.entryMode)&&((null==v?void 0:v.entryMode)===s.AB.Manual||!!(null==v?void 0:v.providerPropertyId)),A=m||x,S=async()=>{d(!0);try{await l(),e.onClose()}finally{d(!1)}},C=async()=>{try{await t.validateFields()}catch(e){return}await S()},{title:I,submitLabel:w}=(0,u.wB)(n.realEstateDetail);return(0,a.Y)(i.S,{"data-sentry-element":"GuestAssetTextInputsGate","data-sentry-component":"RealEstateNetworthFormPopup","data-sentry-source-file":"RealEstateNetworthFormPopup.tsx",children:(0,a.Y)(Z,{title:I,submitLabel:w,isSubmitting:c,hasUnsavedChanges:A,onOk:S,onCancel:()=>{if(!A)return void e.onClose();y({onDiscard:e.onClose,onSave:C})},"data-sentry-element":"RealEstateNetworthFormPopupContent","data-sentry-source-file":"RealEstateNetworthFormPopup.tsx",children:(0,a.Y)(K,{form:t,onValuesChange:()=>{p(),o()},realEstateDetail:n.realEstateDetail,mortgageDetail:n.mortgageDetail,"data-sentry-element":"RealEstateNetworthForm","data-sentry-source-file":"RealEstateNetworthFormPopup.tsx"})})})}},21440:(e,t,n)=>{n.d(t,{F_:()=>m,Rq:()=>c,Xp:()=>u,a3:()=>d,cm:()=>s,uA:()=>p});var a=n(57090);n(12115);var r=n(62570),o=n(74547),i=n(36934),l=n(41784);let s=(0,r.A)("div",{target:"e6ungv80"})("display:inline-flex;justify-content:flex-start;align-items:center;"),c=(0,r.A)(i.ZB,{target:"e6ungv81"})(),d=(0,r.A)("div",{target:"e6ungv82"})("cursor:pointer;width:100%;display:flex;align-items:center;flex-wrap:wrap;color:",e=>e.$color,";font-style:normal;font-weight:600;font-size:14px;line-height:1.4;border-radius:8px;background-color:",e=>e.theme.colors.white,";padding:4px 8px;min-width:100px;height:32px;box-sizing:border-box;text-align:center;border:2px solid ",e=>e.theme.colors.neutral200,";"),u=(0,r.A)("div",{target:"e6ungv83"})("padding-bottom:24px;"),m=(0,r.A)(e=>(0,a.Y)(i.lc,{...e,className:(0,l.cn)("text-body",e.className),"data-sentry-element":"Body1W600","data-sentry-component":"Body1W600BoundNeutral800","data-sentry-source-file":"atoms.tsx"}),{target:"e6ungv84"})("display:flex;align-items:center;"),p=o.XI},21533:(e,t,n)=>{n.d(t,{HU:()=>l,LS:()=>o,Un:()=>i,de:()=>r,wx:()=>a});let a=0xe8d4a50fff,r=e=>(t,n)=>null==n?Promise.resolve():Number.isFinite(n)?Math.abs(n)>e?Promise.reject(Error("Amount cannot exceed ".concat(e.toLocaleString("en-US")))):Promise.resolve():Promise.reject(Error("Please enter a valid amount")),o=e=>(t,n)=>null==n?Promise.resolve():Number.isFinite(n)?n<0?Promise.reject(Error("Amount cannot be negative")):n>e?Promise.reject(Error("Amount cannot exceed ".concat(e.toLocaleString("en-US")))):Promise.resolve():Promise.reject(Error("Please enter a valid amount")),i=e=>(t,n)=>null==n?Promise.resolve():Number.isFinite(n)?n<=0?Promise.reject(Error("Amount must be greater than 0")):n>e?Promise.reject(Error("Amount cannot exceed ".concat(e.toLocaleString("en-US")))):Promise.resolve():Promise.reject(Error("Please enter a valid amount")),l=e=>[{required:!0,message:e},{validator:i(a)}]},21534:(e,t,n)=>{n.d(t,{D_:()=>i.A,WP:()=>a.A,aI:()=>o.A,cB:()=>r.A});var a=n(23699),r=n(73045),o=n(17531),i=n(87590)},22246:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(57090),r=n(12115),o=n(62346),i=n(31272),l=n(11325),s=n(13340),c=n(35208);let d=e=>{let{data:t,isFetching:n}=(0,o.vp)(e,!0),d="Total amount",u="Expected returns",m="Dividend & fixed income",p="Cash investable",y=t?{label:d,value:(0,a.Y)(l.eF,{amount:t.totalAmount,sourceCurrency:s.mF,customFormatOptions:{hideDecimals:!0}})}:{label:d,value:c.UZ},h=t?{label:u,value:(0,i.ad)(t.totalReturn,{formatToPercent:!0})}:{label:u,value:c.UZ},f=t?{label:m,value:(0,a.FD)(r.Fragment,{children:[(0,a.Y)(l.eF,{amount:t.dividendReturn,sourceCurrency:s.mF,customFormatOptions:{hideDecimals:!0}}),"/yr"]})}:{label:m,value:c.UZ},g=t?{label:p,value:(0,a.Y)(l.eF,{amount:t.cashInvestable,sourceCurrency:s.mF,customFormatOptions:{hideDecimals:!0}})}:{label:p,value:c.UZ};return{stats:[y,g,h,f],totalAmountStat:y,expectedReturnStat:h,dividendReturnStat:f,cashInvestedStat:g,isPerformanceMetricsLoading:n}}},22707:(e,t,n)=>{n.d(t,{$q:()=>c,Pw:()=>u,Wb:()=>o,ZH:()=>s,_C:()=>r,bi:()=>i,cL:()=>l,hT:()=>d,mB:()=>p,tf:()=>m});var a=n(56683);
3let r=[{label:"Self-directed (you control trades)",value:a.d.SelfDirected},{label:"Externally managed (e.g. financial advisor, Robo-Advisor)",value:a.d.ExternallyManaged},{label:"Direct indexing",value:a.d.InvestedFund}],o=":",i="nickName",l="taxTreatment",s="isExternallyManaged",c="isInvestedFund",d="advisorFee",u="managementStyle",m="isActive",p="trackingTicker"},22977:(e,t,n)=>{n.d(t,{A$:()=>p,AP:()=>d,_t:()=>u,dO:()=>m,wR:()=>f,z2:()=>c});var a=n(33624),r=n(58155),o=n(71754),i=n(53898),l=n(66866),s=n(67390);let c=5,d={credits:{enabled:!1},exporting:{enabled:!1},chart:{animation:!1,reflow:!1,style:{fontFamily:r.w4.fontFamily}},plotOptions:{series:{animation:!1,lineWidth:2,states:{hover:{lineWidthPlus:0}}},scatter:{lineWidth:0},heatmap:{lineWidth:0},treemap:{lineWidth:0}}},u=[{type:"day",count:30,text:"30d"},{type:"day",count:90,text:"90d"},{type:"month",count:6,text:"6m"},{type:"year",count:1,text:"1y"},{type:"year",count:2,text:"2y"},{type:"year",count:5,text:"5y"},{type:"ytd",text:"YTD"},{type:"all",text:"All"}],m="MM-DD-YYYY",p={Forecast:"Forecast",High:"High",Low:"Low"},y=[l.T.Range,l.T.RangeDraft],h={title:{text:""},chart:{spacingLeft:0,spacingRight:0,spacingBottom:0},rangeSelector:{selected:3,buttons:u,inputEnabled:!1,buttonPosition:{align:"left"}},yAxis:{opposite:!1,showLastLabel:!0,labels:{x:-4,y:3,style:{fontVariantNumeric:"tabular-nums"}}},scrollbar:{enabled:!1},navigator:{enabled:!1},legend:{enabled:!0,useHTML:!0,symbolWidth:0,symbolPadding:0,labelFormatter:function(){let e=this.color;return'<span style="display:inline-flex;align-items:center;gap:6px;font-size:14px;font-weight:500;color:'.concat(o.gB.neutral500,';"><span style="width:12px;height:12px;border-radius:50%;background:').concat(e,';display:inline-block;"></span>').concat(this.name,"</span>")}},xAxis:{type:"datetime",ordinal:!1,tickLength:5,labels:{y:18},crosshair:(0,s.CK)()},plotOptions:{series:{showInNavigator:!0,label:{connectorAllowed:!0},dataGrouping:{enabled:!1}},arearange:{showInNavigator:!0,label:{connectorAllowed:!0},boostThreshold:0,lineWidth:1}},tooltip:(0,s.xM)({formatter:(0,s.vK)({formatValue:i.Gj,maskedSeriesNames:y})}),responsive:{rules:[{condition:{maxWidth:500},chartOptions:{chart:{spacingLeft:0},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"}}}]}},f=a.jp7(d,h)},23895:(e,t,n)=>{e.exports=n.p+"static/media/ob_estate_planning_alert.e0be6fb164c27352.svg"},24081:(e,t,n)=>{e.exports=n.p+"static/media/ob_personalized_recommendations.73c88f25bf0bf758.svg"},24510:(e,t,n)=>{n.d(t,{q:()=>o});var a=n(73285),r=n(76778);let o=e=>{let t=(0,a.w)();return(0,r.K)(n=>{(e=>!e.defaultPrevented&&0===e.button&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey)(n)&&(n.preventDefault(),t.push(e))})}},24771:(e,t,n)=>{n.d(t,{A:()=>ee});var a=n(57090),r=n(12115),o=n(33624),i=n(74547),l=n(12919),s=n(37899),c=n(62212),d=n(70890),u=n(49586),m=n(90521),p=n(62346),y=n(92672),h=n(26189),f=n(65438),g=n(88105),v=n(68099),x=n(17170),A=n(78046),S=n(17123),b=n(32189),C=n(15751),I=n(34645),w=n(95825),P=n(2275),k=n(44659),F=n(45436),T=n(26877),E=n(17667),Y=n(8830),D=n(67759),R=n(4603),N=n(78518);let M=e=>{let{textPortfolioInput:t,isLocalTextCheckPassed:n,validateTextInput:o,setTextPortfolioInput:l}=(0,I.Hk)(),s=(0,E.A)(async()=>{t&&await e.handleAddAssets(t)}),{status:c}=s,d=async()=>{t&&o(t)&&(await s.mutateAsync(),e.onCancel())};r.useEffect(()=>{(0,D.trackAIImport)({event:R.AIImportEvent.ImporterOpened})},[]);let u="error"===c,m=!1===n||u?"error":void 0;return(0,a.Y)(w.Ay,{disableSubmitOnEnter:!0,title:Y.m.AddSecuritiesAllAtOnce,open:!0,maskClosable:!0,onCancel:e.onCancel,footer:(0,a.FD)(y.Ah,{justifyContent:"flex-end",width:"100%",itemsSpacingHorizontal:8,children:[(0,a.Y)(i.$n,{onClick:e.onCancel,children:"Cancel"}),(0,a.Y)(i.$n,{onClick:d,variant:"filled",showErrorNotification:!1,children:"Add securities"})]}),"data-sentry-element":"Modal","data-sentry-component":"AddAllAtOnceAIImporterModal","data-sentry-source-file":"AddAllAtOnceAIImporterModal.tsx",children:(0,a.FD)(y.Ah,{display:"block",itemsSpacingVertical:16,"data-sentry-element":"FlexLayout","data-sentry-source-file":"AddAllAtOnceAIImporterModal.tsx",children:[(0,a.Y)(T.So,{"data-sentry-element":"PortfolioInputParserDescription","data-sentry-source-file":"AddAllAtOnceAIImporterModal.tsx"}),(0,a.FD)(T.$S,{"data-sentry-element":"PortfolioTextInputContainer","data-sentry-source-file":"AddAllAtOnceAIImporterModal.tsx",children:[(0,a.Y)(T.fr,{"data-sentry-element":"PortfolioInputLabel","data-sentry-source-file":"AddAllAtOnceAIImporterModal.tsx"}),(0,a.Y)(F.A,{isLocalTextCheckPassed:n,"data-sentry-element":"LocalTextCheckFailedError","data-sentry-source-file":"AddAllAtOnceAIImporterModal.tsx"}),u?(0,a.Y)(k.A,{}):null,(0,a.Y)(i.fs,{autoFocus:!0,value:t,placeholder:N.U,minRows:10,maxRows:15,onChange:e=>{l(e)},isInvalid:!!m,fullWidth:!0,className:"p-1","data-sentry-element":"TextArea","data-sentry-source-file":"AddAllAtOnceAIImporterModal.tsx"})]}),"loading"===c&&(0,a.Y)(w.Ay,{disableSubmitOnEnter:!0,open:!0,title:"Instant portfolio upload",closable:!1,keyboard:!1,children:(0,a.Y)(P.A,{})})]})})};var L=n(79279),_=n(47489),O=n(99026),W=n(544),B=n(49332);let U=e=>{let{existingInvestmentItems:t,defaultUpsertTicker:n,alwaysVisible:o=!1,enableVirtualization:l=!0,triggerOnce:s=!1}=e,{isCompactView:c}=(0,B.b)(),d=async t=>{e.updateSecurity({id:e.id,updates:t})},u=!!n&&(0,W.yI)(n),m=(0,a.Y)(r.Fragment,{children:(0,a.Y)(_.A,{id:e.id,defaultUpsertTicker:n,existingInvestmentItems:t,onProxyWorkflowInvestmentSubmit:e.handleProxyWorkflowInvestmentSubmit,onSuggestedSecuritySelected:e.handleSuggestedSecuritySelected,onFormChange:d,onSubmit:O.TA,includeSharesInputCount:!0,compactMobileView:!0,onRemoveInvestment:()=>e.deleteSecurity(e.id),onTickerSelectionBlur:e.addEmptySecurity,showPriceInCompactMode:!c,isBrokerageCash:u,inputColor:"white"},e.id)});return(0,a.Y)(i.pu,{enabled:l,alwaysVisible:o,triggerOnce:s,fallbackHeight:120,"data-sentry-element":"VirtualizedItem","data-sentry-component":"SecurityRow","data-sentry-source-file":"SecurityRow.tsx",children:m})};var z=n(40262),V=n(92332),j=n(16142),H=n(74278);let q={securities:[],emptyRow:{id:(0,j.A)()}},G=(e,t)=>{switch(t.type){case H.j.ADD:return{...e,securities:[...e.securities,t.security],emptyRow:{id:(0,j.A)()}};case H.j.UPDATE:return{...e,securities:e.securities.map(e=>e.id===t.id?{...e,...t.updates}:e)};case H.j.DELETE:return{...e,securities:e.securities.filter(e=>e.id!==t.id)};case H.j.RESET:return{...e,securities:t.securities};default:return e}};var K=n(36934),Q=n(41784),$=n(985);let X=e=>{let{portfolioInvestmentItems:t,handleSuggestedSecuritySelected:n,handleProxyWorkflowInvestmentSubmit:l,handleRemoveInvestment:s,handleInvestmentUpsert:c,handleOpenAddAllAtOnceAIImporterModal:d}=e,[u,m]=r.useReducer(G,q),{isCompactView:p}=(0,B.b)(),{securities:h,emptyRow:f}=u;r.useLayoutEffect(()=>{V.A((0,z.pR)(t,u.securities))&&m({type:H.j.RESET,securities:o.TjK(e=>({...e,id:(0,j.A)()}),(0,z.pI)({investmentItems:t,includeCash:!0,sortInvestments:!1}))})},[t]);let g=async e=>{var t;let{id:n,updates:a,justTicker:r=!1}=e,o=(0,z.CG)(n,h);if((0,W.yI)(null!=(t=null==o?void 0:o.ticker)?t:"")&&!(0,W.yI)(a.ticker))return;let i=n===f.id,l=0===a.amount,d=!!(a.currentPrice&&!a.quantity),u=(null==o?void 0:o.ticker)!==a.ticker,p=(0,W.yI)(a.ticker),y=(0,z.S_)(o,a);if(!p&&!r&&(d||l)){u&&(null==o?void 0:o.ticker)&&s(o.ticker);return}if(i)return void m({type:H.j.ADD,security:{...f,...a}});y||(m({type:H.j.UPDATE,id:n,updates:a}),await c(a))},v=e=>{m({type:H.j.DELETE,id:e});let t=(0,z.CG)(e,h);t&&s(t.ticker)},x=e=>{e.ticker&&g({id:f.id,updates:e,justTicker:!0})},A=h.length>10,S=(0,z.sY)(h.length,p),b=[...h,f];return(0,a.FD)("div",{className:"space-y-3 w-full","data-sentry-component":"AccountSecuritiesForm","data-sentry-source-file":"AccountSecuritiesForm.tsx",children:[(0,a.FD)(y.Ah,{justifyContent:"space-between",alignItems:"flex-start",flexWrap:"nowrap",itemsSpacingHorizontal:16,"data-sentry-element":"FlexLayout","data-sentry-source-file":"AccountSecuritiesForm.tsx",children:[(0,a.FD)("div",{className:"flex-1 min-w-0",children:[(0,a.Y)(K.lc,{className:(0,Q.cn)("text-body"),"data-sentry-element":"Body1W600","data-sentry-source-file":"AccountSecuritiesForm.tsx",children:"Account assets"}),(0,a.Y)(K.cO,{className:(0,Q.cn)("text-neutral-500"),"data-sentry-element":"CaptionW400","data-sentry-source-file":"AccountSecuritiesForm.tsx",children:"You can adjust cost basis in Transactions later."})]}),!p&&(0,a.Y)(i.$n,{onClick:d,size:"md",variant:"outlined",children:"Add securities all at once"})]}),(0,a.Y)("div",{className:"space-y-2",children:b.map(e=>{let r=e.id===f.id;
3return(0,a.Y)($.Q7,{children:(0,a.Y)(U,{id:e.id,updateSecurity:g,existingInvestmentItems:t,defaultUpsertTicker:e.ticker,handleProxyWorkflowInvestmentSubmit:l,handleSuggestedSecuritySelected:n,deleteSecurity:v,addEmptySecurity:r?x:void 0,alwaysVisible:r,enableVirtualization:!r&&A,triggerOnce:S},e.id)},e.id)})})]})},J=e=>(0,a.FD)("div",{className:"space-y-3 w-full","data-testid":"manual-portfolio-table-skeleton","data-sentry-component":"ManualPortfolioInputTableSkeleton","data-sentry-source-file":"ManualPortfolioInputTable.tsx",children:[(0,a.FD)(y.Ah,{justifyContent:"space-between",alignItems:"flex-start",flexWrap:"nowrap",itemsSpacingHorizontal:16,"data-sentry-element":"FlexLayout","data-sentry-source-file":"ManualPortfolioInputTable.tsx",children:[(0,a.FD)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,a.Y)(i.EA,{className:"h-5 w-32 rounded-md","data-sentry-element":"Skeleton","data-sentry-source-file":"ManualPortfolioInputTable.tsx"}),(0,a.Y)(i.EA,{className:"h-4 w-56 max-w-full rounded-md","data-sentry-element":"Skeleton","data-sentry-source-file":"ManualPortfolioInputTable.tsx"})]}),!e.isCompactView&&(0,a.Y)(i.EA,{className:"h-10 w-44 rounded-md"})]}),(0,a.Y)("div",{className:"space-y-2",children:o.HnJ(e=>(0,a.Y)("div",{className:"rounded-lg p-4 bg-neutral-50",children:(0,a.Y)(i.EA,{className:"h-6 w-full rounded-md"})},e),4)})]}),Z=e=>{let{addAnAsset:t}=e,{portfolioInvestmentItems:n=[],isPortfolioItemsFetching:r,isPortfolioItemsLoading:l,isRefetchingInvestmentItems:s,securityManagementWorkflowVisible:c,securityManagementWorkflowParams:d,proxyMappedTickers:u,handleRemoveInvestment:m,handleInvestmentItemAmountUpdate:p,handleInvestmentSharesUpdate:h,handleInvestmentFormUpsert:g,handleCustomizeInvestmentItem:v,handleSuggestedSecuritySelected:A,handleProxyWorkflowInvestmentSubmit:S,handleProxyMappingUpserted:I,handleProxyMappingReset:w,exitSecurityManagementWorkflow:P,handleAddAllAtOnce:k}=(0,C.S)({...e,onPortfolioChanged:()=>{e.onHasEnteredSecuritiesChanged(o.Bw9(n)>1)},mode:b.jy.NewPortfolio}),{shareAmountTableFor:F}=(0,x.t)(),{isCompactView:T}=(0,B.b)(),{value:E,setTrue:Y,setFalse:D}=(0,f.A)();return l?(0,a.Y)(J,{isCompactView:T}):(0,a.FD)(y.Ah,{flexDirection:"column",itemsSpacingVertical:28,alignContent:"flex-start",alignItems:"stretch","data-sentry-element":"FlexLayout","data-sentry-component":"ManualPortfolioInputTable","data-sentry-source-file":"ManualPortfolioInputTable.tsx",children:[(0,a.Y)(L.R.Provider,{value:{shareAmountTableFor:F,proxyMappedTickers:u,securityManagementWorkflowVisible:c,securityManagementWorkflowParams:d,isPortfolioItemsLoading:l,freezeTable:l||r||t||s,handleInvestmentItemAmountUpdate:p,handleInvestmentSharesUpdate:h,handleRemoveInvestment:m,handleCustomizeInvestmentItem:v,handleProxyWorkflowInvestmentSubmit:S,handleProxyMappingUpserted:I,handleProxyMappingReset:w,exitSecurityManagementWorkflow:P},"data-sentry-element":"unknown","data-sentry-source-file":"ManualPortfolioInputTable.tsx",children:(0,a.Y)(X,{portfolioInvestmentItems:n,handleSuggestedSecuritySelected:A,handleProxyWorkflowInvestmentSubmit:S,handleRemoveInvestment:m,handleInvestmentUpsert:g,handleOpenAddAllAtOnceAIImporterModal:Y,"data-sentry-element":"AccountSecuritiesForm","data-sentry-source-file":"ManualPortfolioInputTable.tsx"})}),E&&(0,a.Y)(M,{onCancel:D,handleAddAssets:k}),T&&(0,a.Y)(y.Ah,{display:"block",itemsSpacingVertical:12,children:(0,a.Y)(i.$n,{onClick:Y,size:"md",variant:"outlined",fullWidth:!0,children:"Add securities all at once"})})]})},ee=e=>{let{activePortfolio:t,form:n}=e,b=(0,c.j)(),{isFetching:C}=(0,p.OM)(t.portfolioId),{showEditConfirmationIfPropertiesChanged:I}
3=(0,x.t)(),w=(0,m.eY)(),{launchUnsavedChangesModal:P}=(0,g.y)(),{launchNoSecuritiesConfirmationModal:k}=(0,v.R)(),{value:F,setValue:T}=(0,f.A)(),[E,Y]=r.useState(e.visible),{value:N,setValue:M}=(0,f.A)(!1),L=r.useRef(async e=>!1),_=!C,O=async()=>{await (0,d.k)(b,t.portfolioId)},W=async()=>{await e.onClose({isPortfolioInvestmentsChanged:!1,isPortfolioPropertiesChanged:!1}),Y(!1)},B=async e=>{await w.mutateAsync({portfolioId:t.portfolioId,portfolioName:e.portfolioName,taxTreatment:e.taxTreatment,isExternallyManaged:e.isExternallyManaged,isInvestedFund:e.isInvestedFund,advisorFee:e.advisorFee,trackingTicker:e.trackingTicker,portfolioDescription:"Manual Input Portfolio"})},U=()=>{let e=(0,S.ru)(n),a={...t,...o.cJW(["managementStyle"],e),advisorFee:o.gD_(e.advisorFee)?t.advisorFee:e.advisorFee},r=!o.aIS(a,t);return{currentPortfolioAccountDetails:a,isPortfolioPropertiesChanged:r}},z=async()=>{try{await n.validateFields()}catch(e){(0,A.$w)(n);return}let{currentPortfolioAccountDetails:t,isPortfolioPropertiesChanged:a}=U();try{let[n]=await Promise.all([L.current({shouldPersistChanges:!0}),a?B(t):Promise.resolve()]);await e.onClose({isPortfolioInvestmentsChanged:n,isPortfolioPropertiesChanged:a}),Y(!1)}catch(e){throw(0,D.trackManualPortfolioCreated)({event:R.ManualPortfolioEvent.InvestmentsUploadFailed,errorType:e instanceof Error?e.message:String(e)}),e}},V=async()=>{N?await z():k({onContinueWithCashOnly:z})},j=async()=>{let e=await L.current({shouldPersistChanges:!1}),{isPortfolioPropertiesChanged:t}=U();e||t&&I?P({onDiscard:W,onSave:z}):await W()};return E?(0,a.Y)(l._s,{width:900,title:(()=>{let n=t.portfolioName;return e.title?e.title:n})(),open:!0,onClose:j,destroyOnClose:!0,closable:_,maskClosable:_,footer:(0,a.FD)(l.tb,{className:"sm:[&>*:first-child]:mr-auto",children:[N?(0,a.Y)("div",{className:"text-center sm:text-left",children:(0,a.Y)(s.A,{})}):(0,a.Y)("div",{}),(0,a.Y)(i.$n,{onClick:V,variant:"filled",showErrorNotification:!1,disabled:F,children:"Save"})]}),children:(0,a.FD)(y.Ah,{display:"block",itemsSpacingVertical:16,children:[(0,a.Y)(h.W,{form:n,accountDetailsConfig:{type:u.l.EditPortfolio,existingProperties:t}}),(0,a.Y)(i.cG,{}),(0,a.Y)(Z,{addAnAsset:F,handleAddAnAsset:T,savePortfolioActionRef:L,activePortfolio:t,onPortfolioChangePersisted:()=>{O()},onHasEnteredSecuritiesChanged:e=>{M(e)}})]})}):null}},24780:(e,t,n)=>{n.d(t,{A:()=>P});var a=n(57090),r=n(12115),o=n(37294),i=n(58155),l=n(41785),s=n(92672),c=n(67030),d=n(74547),u=n(81671);let m={[c.hi.Opportunity]:{icon:(0,a.Y)(d.In,{icon:u.$.StarFilled,size:24,color:"var(--wp-tier-gold)"}),content:"This insight provides an interesting trading opportunity"},[c.hi.Update]:{icon:(0,a.Y)(d.In,{icon:u.$.FileTextFilled,size:24,color:"#0D9488"}),content:"This insight is a periodic update on economic and market conditions"},[c.hi.Warning]:{icon:(0,a.Y)(d.In,{icon:u.$.ExclamationTriangleFilled,size:24,color:"#BE185D"}),content:"This insight provides a warning about economic changes impacting the market"},[c.hi.Interesting]:{icon:(0,a.Y)(d.In,{icon:u.$.DiamondFilled,size:24,color:"#0284C7"}),content:"This insight is an interesting-to-know change in the economy"},[c.hi.Urgent]:{icon:(0,a.Y)(d.In,{icon:u.$.LightningFilled,size:24,color:"var(--color-fuchsia-700)"}),content:"This insight has time-sensitive information that will likely impact markets in a big way"}};var p=n(99750);let y=e=>{let{importanceType:t}=e,{isMobile:n}=(0,p.Qs)(),{theme:r}=(0,i.OM)(),c=m[t];if(c){let i=(0,a.FD)(l.$f,{children:[(0,a.Y)(l.MH,{children:t}),(0,a.Y)("p",{children:c.content})]});return(0,a.Y)(o.A,{title:null,content:i,placement:n?"bottomLeft":"bottom",color:r.colors.neutral900,overlayInnerStyle:{borderRadius:8},children:(0,a.Y)(s.Ah,{className:e.className,cursor:"pointer",children:c.icon})})}return null};var h=n(62570),f=n(39715),g=n(39504),v=n(70432),x=n(73285),A=n(54519);let S=(0,h.A)(s.Ah,{target:"e27ovpr0"})("font-weight:700;font-size:16px;border-radius:8px;padding:2px 6px;min-width:36px;min-height:36px;border:1px solid ",e=>e.theme.colors.neutral500,";color:",e=>e.theme.colors.neutral500,";cursor:pointer;&:hover{color:",e=>e.theme.colors.neutral700,";border:1px solid ",e=>e.theme.colors.neutral700,";}"),b=(0,h.A)("div",{target:"e27ovpr1"})("font-size:12px;"),C=(0,h.A)("span",{target:"e27ovpr2"})("font-weight:600;"),I=e=>"".concat((0,f.Ze)(10*e,{fractionDigits:1}),"/10"),w=e=>{let{interestScoreNormalized:t,timelinessScore:n,magnitudeScore:s,relevanceScore:c}=e,{theme:d}=(0,i.OM)(),{authenticated:u}=(0,g.X6)(),{isMobile:m}=(0,p.Qs)(),y=(0,x.w)(),h=(0,a.FD)(l.$f,{children:[(0,a.Y)(l.MH,{children:"Interest Score"}),(0,a.FD)(b,{children:["Timeliness: ",(0,a.Y)(C,{children:I(n)})]}),(0,a.FD)(b,{children:["Magnitude: ",(0,a.Y)(C,{children:I(s)})]}),(0,a.FD)(b,{children:["Relevance: ",(0,a.Y)(C,{children:I(c)})]}),u?null:(0,a.Y)(b,{children:(0,a.FD)(r.Fragment,{children:["Portfolio impact:"," ",(0,a.Y)(C,{children:(0,a.Y)(v.A,{color:"accent",onClick:()=>y.push(A.FK),children:"sign up"})})]})})]});return(0,a.Y)(o.A,{title:null,content:h,placement:m?"bottomLeft":"bottom",color:d.colors.neutral900,overlayInnerStyle:{borderRadius:8},"data-sentry-element":"Popover","data-sentry-component":"InsightScore","data-sentry-source-file":"InsightScore.tsx",children:(0,a.Y)(S,{"data-sentry-element":"ScoreButton","data-sentry-source-file":"InsightScore.tsx",children:t})})},P=e=>(0,a.FD)(l.nT,{"data-sentry-element":"ImportanceAndScoreContainer","data-sentry-component":"InsightImportanceAndScore","data-sentry-source-file":"InsightImportanceAndScore.tsx",children:[e.insightImportanceType?(0,a.Y)(y,{importanceType:e.insightImportanceType}):null,(0,a.Y)(w,{...e,"data-sentry-element":"InsightScore","data-sentry-source-file":"InsightImportanceAndScore.tsx"})]})},25447:(e,t,n)=>{n.d(t,{Te:()=>l,aY:()=>i,yl:()=>o});var a=n(62570),r=n(40831);let o=(0,a.A)("div",{target:"eh61vjw0"})("font-style:normal;font-weight:400;font-size:14px;line-height:20px;color:",e=>e.theme.colors.neutral900,";"),i=(0,a.A)(r.Ay,{target:"eh61vjw1"})("padding:0;"),l=(0,a.A)("div",{target:"eh61vjw2"})(".ant-select-item-option-grouped{padding-inline-start:12px;}")},25471:(e,t,n)=>{n.d(t,{H:()=>o});var a=n(62570),r=n(89568);let o=(0,a.A)(r.ID,{target:"eqe4b7e0"})()},25559:(e,t,n)=>{n.d(t,{GZ:()=>f,Gu:()=>m,S_:()=>A,mM:()=>v,qH:()=>w,r2:()=>p,rM:()=>C,v5:()=>y,vR:()=>u,z6:()=>h});var a=n(33624),r=n(24700),o=n.n(r),i=n(99026),l=n(20291),s=n(17143),c=n(31272);let d=e=>
3(0,i.YZ)(o()(o()(e).format("0.00")).value()),u=(e,t)=>(0,c.pv)(e,{formatToPercent:!0,fractionDigits:+!!a.aIS(t,l.I.Canada)}),m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.w.GenericTax;return a.aIS(e,l.I.Canada)?l.w.GenericTax:a.aIS(e,l.I.UnitedStates)?l.w.ShortTermTax:t},p=(e,t)=>d((0,s.$Y)(e,t)),y=(e,t)=>d((0,s.k5)(e,t)),h=(e,t)=>a.TSs((e,n)=>n.taxType===t?e+a.vUk(0,n.tax):e,0,e),f=e=>Math.max(0,e),g=e=>0!==a.vUk(0,e.tax)||a.bzn(e=>0!==e,e.assumedTax||[0,0]),v=(e,t)=>({tax:h(e,t),gain:a.TSs((e,n)=>n.taxType===t&&!n.isAssumed&&g(n)?e+a.vUk(0,n.realizedGainOrLoss):e,0,e)}),x=(e,t)=>f(e.tax)*(Math.max(0,e.gain+t)/e.gain),A=(e,t)=>e.gain>0&&t.gain<0?[x(e,t.gain),0]:t.gain>0&&e.gain<0?[0,x(t,e.gain)]:[f(e.tax),f(t.tax)],S=(e,t,n)=>a.TSs((e,n)=>{let[r,o]=e,[i,l]=a.diJ(a.ReH,t(n)||[0,0]);return[r+i,o+l]},[n,n],e),b=e=>a.diJ(a.ReH,e),C=(e,t)=>{let[n,a]=S(e,e=>e.assumedTax,t);return[f(n),f(a)]},I=(e,t)=>{let[n,r]=S(e,e=>e.assumedTax,t.tax),[o,i]=S(a.pbD(g,e),e=>e.assumedRealizedGainOrLoss,t.gain);return[{tax:n,gain:o},{tax:r,gain:i}]},w=(e,t,n,a)=>{let[r,o]=I(e,n),[i,l]=I(t,a),[s,c]=A(r,i),[d,u]=A(o,l);return[b([s,d]),b([c,u])]}},26189:(e,t,n)=>{n.d(t,{W:()=>C});var a=n(57090),r=n(12115),o=n(88179),i=n(2767),l=n(87778),s=n(74547),c=n(56490),d=n(78046),u=n(92672),m=n(56683);let p=(0,n(62570).A)("div",{target:"et3h6np0"})("display:flex;justify-content:flex-start;",(0,u.BK)({flexDirection:["column","column","row"]}),"  align-items:stretch;column-gap:16px;width:100%;");var y=n(17123),h=n(22707),f=n(35209),g=n(49332),v=n(95655),x=n(32189),A=n(90799),S=n(44619),b=n(11);let C=e=>{let{form:t,accountDetailsConfig:n,nameInputLabel:C="Account nickname"}=e,I=(0,d.r3)("managementStyle",t),w=(0,d.r3)("taxTreatment",t),P=(0,d.r3)("portfolioName",t),[k,F]=r.useState(null),T=I!==m.d.SelfDirected,E=I===m.d.InvestedFund,{isCompactView:Y}=(0,g.b)();r.useEffect(()=>{let e=(0,y.nk)(n);t.setFieldsValue(e)},[]),r.useEffect(()=>{w&&P&&F((0,S.Bi)(P,w))},[w,P]);let D=T?(0,a.Y)(o.JF,{name:"advisorFee",label:"Advisor's fee",itemHelpMarginBottom:"0px",rules:(0,i.qc)(T),extra:(0,a.Y)(u.Ah,{justifyContent:"flex-start",children:(0,a.Y)(l.uM,{})}),children:(0,a.Y)(s.YI,{addonAfter:"%"})}):null,R=E?(0,a.Y)(o.JF,{name:"trackingTicker",label:(0,a.Y)(c.A,{label:"Index to track",title:"Search for the ticker symbol of the index or ETF this account is tracking (e.g., SPY, VOO, VTI)",overlayStyle:{maxWidth:280}}),children:(0,a.Y)(v.A,{})}):null;return(0,a.FD)(d.lV,{form:t,name:"accountProperties",layout:"vertical",onValuesChange:e=>{if(t.validateFields(),"managementStyle"in e){let n=e.managementStyle;n!==m.d.InvestedFund&&t.setFieldValue("trackingTicker",null),n===m.d.SelfDirected&&t.setFieldValue("advisorFee",null)}},preserve:!1,scrollToFirstError:!0,"data-sentry-element":"Form","data-sentry-component":"ManualPortfolioInputPropertiesForm","data-sentry-source-file":"ManualPortfolioInputPropertiesForm.tsx",children:[(0,a.FD)(p,{"data-sentry-element":"ManualPortfolioPropertiesFormContainer","data-sentry-source-file":"ManualPortfolioInputPropertiesForm.tsx",children:[(0,a.FD)("div",{style:{flex:1,minWidth:0},children:[(0,a.Y)(o.JF,{name:"portfolioName",label:C,preserve:!1,rules:[{required:!0,message:"Add a nickname so you can find this account",type:"string",whitespace:!0},b.uu],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"ManualPortfolioInputPropertiesForm.tsx",children:(0,a.Y)(f.A,{placeholder:"E.g. Fidelity 401(k)",inForm:!0,maxLength:b.xN,"data-sentry-element":"FormInput","data-sentry-source-file":"ManualPortfolioInputPropertiesForm.tsx"})}),!Y&&D]}),(0,a.Y)("div",{style:{flex:1,minWidth:0},children:(0,a.Y)(o.JF,{name:"managementStyle",label:"Account type",rules:[{required:!0,message:"Choose an account type"}],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"ManualPortfolioInputPropertiesForm.tsx",children:(0,a.Y)(l.BN,{placeholder:"Select account type",options:h._C,placement:"bottomRight","data-sentry-element":"AccountTypeStyledSelect","data-sentry-source-file":"ManualPortfolioInputPropertiesForm.tsx"})})}),(0,a.Y)("div",{style:{flex:1,minWidth:0},children:(0,a.Y)(o.JF,{name:"taxTreatment",label:"Tax treatment",rules:[{required:!0,message:"Choose a tax treatment"}],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"ManualPortfolioInputPropertiesForm.tsx",children:(0,a.Y)(A.b,{value:w||x.MG.Taxable,onChange:e=>{t.setFieldValue("taxTreatment",e),P&&F((0,S.Bi)(P,e))},warningMessage:k,"data-sentry-element":"TaxTreatmentSelector","data-sentry-source-file":"ManualPortfolioInputPropertiesForm.tsx"})})})]}),Y&&D,R]})}},26258:(e,t,n)=>{n.d(t,{$J:()=>u,NO:()=>d,YX:()=>c,dC:()=>m,r2:()=>i});var a=n(33624),r=n(32189),o=n(48298);let i=e=>t=>a.VxE(a.o8B(t),{recommendationKey:e.key,recommendationType:e.recommendationType}),l=e=>a.VxE(a.o8B(e),{recommendationList:a.TjK(t=>a.VxE(a.o8B(t),{suggestedChanges:a.TjK(i(e),t.suggestedChanges||[])}),e.recommendationList||[])}),s=e=>a.FsL(l)(e),c=e=>a.VxE(a.o8B(e),{recommendations:a.TjK(s,e.recommendations||[])}),d=async(e,t)=>
3o.Ay.getPortfolioBuyAfterSellRecommendations(e,t),u=async e=>o.Ay.getPortfolioSellAfterBuyRecommendations(e),m=e=>e===r.hT.Buy||e===r.hT.SellBuy},26549:(e,t,n)=>{n.d(t,{AP:()=>v,Gu:()=>k,H4:()=>g,MI:()=>x,Mt:()=>y,Qc:()=>P,Ut:()=>h,kj:()=>A,pA:()=>S,zr:()=>f});var a=n(92491),r=n.n(a),o=n(33624),i=n(17143),l=n(16462),s=n(32189),c=n(13340),d=n(86216),u=n(27866),m=n.n(u);let p={[l.QT.WILL_AND_TESTAMENT]:"Last will and testament",[l.QT.DESIGNATED_BENEFICIARIES]:"Designated beneficiaries",[l.QT.ADVANCE_HEALTHCARE_DIRECTIVE]:"Living will (advance health care directive)",[l.QT.DIGITAL_ASSETS_PLAN]:"Digital assets plan",[l.QT.SELECTED_GUARDIAN_FOR_MINOR_CHILDREN]:"Guardianship for minor children",[l.QT.LIFE_INSURANCE]:"Life insurance",[l.QT.LIVING_TRUST]:"Living trust",[l.QT.ESTATE_TAX_IMPLICATIONS]:"Estate tax plan",[l.QT.REMINDER_TO_COMPLETE_THE_CHECKLIST]:"Checklist reminder",[l.QT.NOTIFY_TO_REVIEW_EVERY_YEAR]:"Annual review reminder"},y=e=>p[e]?p[e]:r().sentence(e),h=e=>e.status===l.Kk.Accepted||(e.status!==l.Kk.Denied||e.statusReason===l.Kl.Snooze)&&null,f=()=>m()().format("MMMM"),g=3,v=e=>e<=0?230:Math.max(10*Math.round(.0012*e/10),230),x=e=>{let t=e.recommendation.recommendation.recommendationList,n=o.TjK(o._w2("suggestedChanges"),t),a=o.Bqz(n),r=o.TjK(o._w2("ticker"),a);return(0,i.Hm)(r)},A=e=>o.mKk(s._W.Optimizer,e.recommendationType),S=e=>"scenarioKind"in e,b=(e,t)=>{if(!Number.isFinite(e))return null;let n=Math.abs(d.A.convert(c.mF,t,e)),a=n>=10?Number(n.toPrecision(2)):Math.round(n);if(0===a)return null;let r=a>=1e6?"".concat(parseFloat((a/1e6).toFixed(1)),"M"):a>=1e3?"".concat(parseFloat((a/1e3).toFixed(1)),"K"):"".concat(a);return"".concat(c.IK[t]).concat(r)},C=(e,t)=>"".concat(c.IK[t]).concat(Math.round(d.A.convert(c.mF,t,e))),I={[l.Oe.PortfolioScoreBump]:e=>"+".concat(Math.round(e),"pts Portfolio Score"),[l.Oe.SetMonthlyTLH]:()=>"Monthly Tax-loss Harvesting",[l.Oe.ZeroManagementFee]:()=>"Removing all management fees",[l.Oe.IncreaseRetirementContribution]:(e,t)=>"+".concat(C(e,t),"/mo retirement contribution"),[l.Oe.RetireTwoYearsLater]:()=>"Retiring 2 years later",[l.Oe.RothConversionLadder]:()=>"Maxing out Roth conversions before your required withdrawals begin",[l.Oe.DelaySocialSecurityTo70]:()=>"Delaying Social Security to 70",[l.Oe.MaxOutYearlyRothContribution]:()=>"Maxing out yearly Roth contributions",[l.Oe.GuardrailsWithdrawalStrategy]:()=>"Guardrails withdrawal strategy"},w={[l.Oe.PortfolioScoreBump]:e=>"+".concat(Math.round(e),"pts Portfolio Score"),[l.Oe.SetMonthlyTLH]:()=>"Monthly tax harvesting",[l.Oe.ZeroManagementFee]:()=>"Zero management fees",[l.Oe.IncreaseRetirementContribution]:(e,t)=>"+".concat(C(e,t),"/mo to retirement"),[l.Oe.RetireTwoYearsLater]:()=>"Retiring 2 years later",[l.Oe.RothConversionLadder]:()=>"Roth conversion ladder",[l.Oe.DelaySocialSecurityTo70]:()=>"Social Security at 70",[l.Oe.MaxOutYearlyRothContribution]:()=>"Maxing out Roth",[l.Oe.GuardrailsWithdrawalStrategy]:()=>"Guardrails withdrawals"},P=(e,t)=>{let n=w[e.scenarioKind](e.changeAmount,t);if(e.impactType===l.G3.IncreasedRetirementSuccessProbability)return"".concat(n,": +").concat(Math.round(100*e.successProbabilityDiff),"% success");let a=b((e=>e.impactType===l.G3.IncreasedAssetsAtRetirement?e.assetsAtRetirementDiff:e.assetsAtLifeExpectancyDiff)(e),t);return null===a?"".concat(n," grows your assets"):"".concat(n," adds +").concat(a)},k=(e,t)=>{let n=I[e.scenarioKind](e.changeAmount,t);switch(e.impactType){case l.G3.IncreasedAssetsAtRetirement:{let a=b(e.assetsAtRetirementDiff,t);return null===a?"".concat(n," grows your assets at retirement"):"".concat(n," adds +").concat(a," at retirement")}case l.G3.IncreasedRetirementSuccessProbability:return"".concat(n," leads to +").concat(Math.round(100*e.successProbabilityDiff),"% retirement success");case l.G3.IncreasedAssetsAtLifeExpectancy:{let a=b(e.assetsAtLifeExpectancyDiff,t);return null===a?"".concat(n," grows your assets over your lifetime"):"".concat(n," adds +").concat(a," over your lifetime")}}}},26873:(e,t,n)=>{n.d(t,{Is:()=>F,NG:()=>f,yh:()=>k,zk:()=>h});var a=n(57090),r=n(12115),o=n(98500),i=n.n(o),l=n(41784),s=n(24510),c=n(61435),d=n(81671),u=n(56490),m=n(36934),p=n(8675),y=n(85013),h=function(e){return e.Default="default",e.Link="link",e.Loss="loss",e}({}),f=function(e){return e[e.Two=2]="Two",e[e.Three=3]="Three",e[e.Four=4]="Four",e}({});let g=(0,l.cn)(y.sr,y.JY,"-mx-2 -my-1 rounded-md px-2 py-1 transition-colors hover:bg-primary-50 active:bg-primary-100 motion-reduce:transition-none"),v=(0,l.cn)(y.HE,"inline-flex max-w-full flex-wrap items-center gap-1"),x=(0,l.cn)(v,"appearance-none border-0 bg-transparent p-0 text-left"),A="inline-flex max-w-full flex-wrap items-center gap-1",S=(0,l.cn)(A,"text-primary-600"),b=(0,l.cn)(A,"text-financial-negative"),C="grid gap-x-4 gap-y-4 grid-cols-1 @min-[336px]:grid-cols-2",I={2:C,3:(0,l.cn)(C,"@min-[512px]:gri
3d-cols-3"),4:(0,l.cn)(C,"@min-[688px]:grid-cols-4")},w=e=>{var t,n;let o=(0,s.q)(null!=(t=e.href)?t:""),l=(0,a.FD)(r.Fragment,{children:[(0,a.FD)("span",{className:S,children:[(0,a.Y)("span",{className:"[overflow-wrap:anywhere]",children:e.value}),(0,a.Y)(c.I,{icon:null!=(n=e.icon)?n:d.$.ArrowRight,size:16})]}),(0,a.Y)("span",{className:"sr-only",children:e.linkSuffix})]});return void 0!==e.href?(0,a.Y)(i(),{href:e.href,onClick:o,className:v,children:l}):(0,a.Y)("button",{type:"button",onClick:e.onClick,className:x,"data-sentry-component":"TitledNumberLinkTarget","data-sentry-source-file":"TitledNumber.tsx",children:l})},P=e=>(0,a.FD)("span",{className:b,"data-sentry-component":"TitledNumberLossValue","data-sentry-source-file":"TitledNumber.tsx",children:[e.icon?(0,a.Y)(c.I,{icon:e.icon,size:16}):null,(0,a.Y)("span",{className:"[overflow-wrap:anywhere]",children:e.value})]}),k=e=>{let t="link"===e.variant;return(0,a.FD)("div",{"data-testid":"titled-number",className:(0,l.cn)("flex min-w-0 flex-col gap-1",t&&g,e.className),"data-sentry-component":"TitledNumber","data-sentry-source-file":"TitledNumber.tsx",children:[(0,a.Y)(p._j,{"data-sentry-element":"StatItemLabel","data-sentry-source-file":"TitledNumber.tsx",children:(0,a.Y)(u.A,{label:e.label,title:e.tooltip,"data-sentry-element":"TextWithTooltip","data-sentry-source-file":"TitledNumber.tsx"})}),(0,a.Y)(p.nb,{"data-sentry-element":"StatItemValue","data-sentry-source-file":"TitledNumber.tsx",children:(e=>"link"===e.variant?(0,a.Y)(w,{...e}):"loss"===e.variant?(0,a.Y)(P,{...e}):e.value)(e)}),e.sublabel?(0,a.Y)(m.cO,{className:"text-neutral-500",children:e.sublabel}):null]})},F=e=>(0,a.Y)("div",{className:"@container w-full","data-sentry-component":"TitledNumberRow","data-sentry-source-file":"TitledNumber.tsx",children:(0,a.Y)("div",{className:(0,l.cn)(I[e.columns],e.className),children:e.children})})},26877:(e,t,n)=>{n.d(t,{fr:()=>A,So:()=>x,$S:()=>S});var a=n(57090),r=n(12115),o=n(36934),i=n(41784),l=n(92672),s=n(58211),c=n(62570),d=n(58155),u=n(74547),m=n(65438),p=n(81671);let y=(0,c.A)("ul",{target:"e60k1mq0"})("margin:0;padding-inline-start:20px;"),h=()=>{let{value:e,toggle:t}=(0,m.A)(!1),n=(0,a.Y)(u.Ah,{marginLeft:"8",children:(0,a.Y)(u.In,{icon:e?p.$.ChevronTop:p.$.ChevronBottom})});return(0,a.FD)(u.Ah,{display:"block",itemsSpacingVertical:8,"data-sentry-element":"FlexLayout","data-sentry-component":"AIImportFormatInstruction","data-sentry-source-file":"AIImportFormatInstruction.tsx",children:[(0,a.FD)(u.$n,{onClick:t,"data-sentry-element":"Button","data-sentry-source-file":"AIImportFormatInstruction.tsx",children:["Format instruction ",n]}),e?(0,a.FD)(u.Ah,{display:"block",itemsSpacingVertical:4,children:[(0,a.Y)("div",{children:"You must include:"}),(0,a.FD)(y,{children:[(0,a.FD)("li",{children:[(0,a.Y)("b",{children:"Ticker/company"})," names"]}),(0,a.Y)("li",{children:(0,a.Y)("b",{children:"Current market value (add $) or number of shares (add #)"})})]})]}):null]})};var f=n(89568),g=n(57871);let v=(0,c.A)(l.Ah,{target:"e1vdnw0f0"})("padding:8px;border-radius:40px;background:",e=>e.theme.colors.blue50,";"),x=()=>{let{theme:e}=(0,d.OM)();return(0,a.FD)(r.Fragment,{children:[(0,a.Y)(g.Zp,{"data-sentry-element":"Card","data-sentry-source-file":"atoms.tsx",children:(0,a.FD)(l.Ah,{itemsSpacingHorizontal:16,flexWrap:"nowrap","data-sentry-element":"FlexLayout","data-sentry-source-file":"atoms.tsx",children:[(0,a.Y)(v,{"data-sentry-element":"StartIconContainer","data-sentry-source-file":"atoms.tsx",children:(0,a.Y)(s.A,{width:24,height:24,color:e.colors.blue700,"data-sentry-element":"Stars","data-sentry-source-file":"atoms.tsx"})}),(0,a.FD)(o.km,{className:(0,i.cn)("text-neutral-500"),"data-sentry-element":"Body2W400","data-sentry-source-file":"atoms.tsx",children:[(0,a.Y)("b",{children:"Copy/paste"})," your securities directly from your brokerage account. Our ",(0,a.Y)("b",{children:"AI"})," can handle most formats - even ",(0,a.Y)("b",{children:"your words"}),"."]})]})}),(0,a.Y)(h,{"data-sentry-element":"AIImportFormatInstruction","data-sentry-source-file":"atoms.tsx"})]})},A=()=>(0,a.FD)(l.Ah,{width:"100%",justifyContent:"space-between","data-sentry-element":"FlexLayout","data-sentry-component":"PortfolioInputLabel","data-sentry-source-file":"atoms.tsx",children:[(0,a.Y)(o.km,{className:(0,i.cn)("text-neutral-500"),"data-sentry-element":"Body2W400","data-sentry-source-file":"atoms.tsx",children:"List your securities"}),(0,a.Y)(o.lc,{className:(0,i.cn)("text-neutral-500"),"data-sentry-element":"Body1W600","data-sentry-source-file":"atoms.tsx",children:(0,a.Y)(f.Ay,{title:(0,a.FD)(l.Ah,{display:"block",padding:"4px",marginRight:16,children:["For example:",(0,a.Y)("div",{children:"Apple $3214"}),(0,a.Y)("div",{children:"CRM $84154"}),(0,a.Y)("div",{children:"TSLA #200"}),(0,a.Y)("div",{children:"Cash $900"})]}),"data-sentry-element":"Tooltip","data-sentry-source-file":"atoms.tsx",children:(0,a.FD)(l.Ah,{itemsSpacingHorizontal:4,"data-sentry-element":"FlexLayout","data-sentry-source-file":"atoms.tsx",children:[(0,a.Y)(f.xN,{"data-sentry-element":"OutlinedInfoTooltipIcon","data-sentry-source-file":"atoms.tsx"})," See example"]})})})]}),S=e=>(0,a.Y)(l.Ah,{flexDirection:"column",occupyParentWidth:!0,marginTop:8,itemsSpacingVertical:2,flexWrap:"nowrap","data-sentry-element":"FlexLayout","data-sentry-component":"PortfolioTextInputContainer","data-sentry-source-file":"atoms.tsx",children:e.children})},27115:(e,t,n)=>{n.d(t,{V:()=>c,c:()=>s});var a=n(33624),r=n(98868),o=n(46165),i=n(59149),l=n(62346);let s=e=>{let{investorRiskProfile:t}=(0,o.gm)(),n=a.vUk(r.R$.ModeratelyAggressive,t),{data:i,isLoading:s,isError:c}=(0,l.wj)(e);return{riskProfile:a.vUk(n,null==i?void 0:i.riskPreference),isLoading:s,isError:c}},c=e=>{let{isMatchingRiskProfile:t,isPortfolioRiskPreferenceLoading:n,portfolioRiskProfile:l}=((e,t)=>{let{isPreferencesSyncing:n}=(0,o.w9)(),{riskProfile:r,isLoading:i}=s(e),l=a.Bqz([t]);return{isMatchingRiskProfile:a.mKk(r,l),isPortfolioRiskPreferenceLoading:n||i,portfolioRiskProfile:r}})(e,i.H5),c=l?l===r.R$.NoRisk?"No risk preference":"".concat(i.wZ[l]," risk preference"):"...",d=l===r.R$.Extreme,u=l===r.R$.NoRisk;return{isRiskMatchApplicable:!1===t,isPortfolioRiskPreferenceLoading:n,portfolioRiskProfile:l,riskPreferenceLabel:c,isExtremeRiskProfile:d,isNoRiskProfile:u}}},27234:(e,t,n)=>{n.d(t,{f:()=>x,i:()=>A});var a=n(57090),r=n(12115),o=n(33624),i=n(22462),l=n(99147),s=n(34537),c=n(44561),d=n(92672),u=n(74547),m=n(36934),p=n(19304),y=n(544),h=n(98007),f=n(67297),g=n(84978),v=n(34857);let x=e=>{let t=(e=>i.A(null==e?void 0:e.displayName))(e),n=t?e.displayName:(0,s.e7)({ticker:e.ticker,securityName:e.securityName}),r=t?e.displayName:e.securityName;return(0,a.Y)(l.j7,{title:r,"data-sentry-element":"InvestmentLabelContainer","data-sentry-component":"InvestmentLabelRenderer","data-sentry-source-file":"SecurityLabel.tsx",children:(0,a.Y)(l.uV,{lines:2,"data-sentry-element":"InvestmentLabel","data-sentry-source-file":"SecurityLabel.tsx",children:n})})},A=e=>{let{investmentItem:t,textWrapperProps:n={},extraLabelSuffix:i="",compactMode:x}=e,A=(0,y._p)(t.ticker),S=t.displayName,b=t.ticker,C=o.vUk(b,t.displayTicker),{ticker:I,assetType:w}=t,{launchInvestmentExploration:P}=(0,h.w)(),k=()=>{P({ticker:t.ticker,netWorthDetail:t.networthDetail})},F=(0,y.gN)(I,w),{isSecurityProxied:T,isUntrackedSecurity:E,isUntrackedWithEmptySeriesName:Y,isPotentiallyUnknownSecurity:D,isInternalSecurity:R}=e.forceProxiedSecurityMode?(0,s.zo)():(0,s.Ot)(t),N=!R&&(E||D),M=Y?C:R||x?S:(0,s.e7)({ticker:C,securityName:S}),L=N?{fontWeight:"500"}:{},_=Y?(0,a.Y)(u.N_,{color:"accent",noUnderline:!0,weight:N?"semibold":void 0,children:c.IP}):T?c.Lm:"",O=(0,a.FD)(r.Fragment,{children:[M,_?" ":null,_,i]}),W=o.VxE({lines:2},n),B=(0,a.Y)(l.uV,{...W,children:O});if(F){var U;let e=A?(0,a.Y)("span",{children:O}):(0,a.Y)(u.N_,{color:"accent",noUnderline:!0,onClick:k,children:O});return(0,a.FD)(d.Ah,{display:"block",itemsSpacingVertical:2,onClick:A?void 0:k,children:[e,(0,a.Y)(m.cO,{className:"text-neutral-500",style:L,children:null!=(U=(e=>{var t;if(!e)return null;let{investmentType:n}=e;if((0,v.iV)(n))return f.jN[n].typeLabel;let a=g.Kl.find(e=>e.value===n);return null!=(t=null==a?void 0:a.label)?t:null})(t.networthDetail))?U:C})]})}return x?(0,a.FD)(d.Ah,{display:"block",itemsSpacingVertical:2,children:[(0,a.Y)(p.a,{customTickerClickHandler:k,tickers:[C],textContent:C}),(0,a.Y)(m.cO,{className:"text-neutral-500",style:L,children:B})]}):(0,a.Y)(l.j7,{title:M,style:L,"data-sentry-element":"InvestmentLabelContainer","data-sentry-component":"ProxyContextualSecurityLabel","data-sentry-source-file":"SecurityLabel.tsx",children:B})}},27742:(e,t,n)=>{n.d(t,{A:()=>x});var a=n(57090);n(12115);var r=n(67891),o=n(95825),i=n(11),l=n(61435),s=n(92672),c=n(36934),d=n(71456),u=n(72408),m=n(89703),p=n(46842),y=n(62796),h=n(81671);let f=()=>(0,a.FD)(s.Ah,{justifyContent:"flex-start",flexWrap:"nowrap",itemsSpacingHorizontal:4,"data-sentry-element":"FlexLayout","data-sentry-component":"DraftSetupModalTitle","data-sentry-source-file":"DraftPortfolioSetupModal.tsx",children:[(0,a.Y)(l.I,{icon:h.$.SquareBehindSquare2,className:"text-primary","data-sentry-element":"Icon","data-sentry-source-file":"DraftPortfolioSetupModal.tsx"}),y.D]}),g=()=>(0,a.Y)(c.km,{className:"text-neutral-500","data-sentry-element":"Body2W400","data-sentry-component":"DraftSetupModalSubHeader","data-sentry-source-file":"DraftPortfolioSetupModal.tsx",children:y.v}),v=e=>{let t=!e.isSubmitting,n=!r.A(e.draftName)||e.draftName.length>i.xN,l=(0,u.t)();return(0,a.Y)(m.nA,{title:(0,a.Y)(f,{}),centered:!0,open:e.open,destroyOnClose:!0,closable:t,maskClosable:t,keyboard:t,onCancel:e.onCancel,onOk:e.onOk,okText:l,okButtonProps:{disabled:n},cancelButtonProps:{disabled:e.isSubmitting},size:o.rI.Md,"data-sentry-element":"RecommendationNewDraftPopup","data-sentry-component":"OpenDraftPortfolioSetupModal","data-sentry-source-file":"DraftPortfolioSetupModal.tsx",children:(0,a.FD)(p.Bw,{"data-sentry-element":"PortfolioActionPopupContentContainer","data-sentry-source-file":"DraftPortfolioSetupModal.tsx",children:[(0,a.Y)(g,{"data-sentry-element":"DraftSetupModalSubHeader","data-sentry-source-file":"DraftPortfolioSetupModal.tsx"}),e.scorePreview?(0,a.Y)(p.Pv,{currentScore:e.scorePreview.current,afterImpactScore:e.scorePreview.after}):null,(0,a.Y)(m.MG,{"data-sentry-element":"FormContainer","data-sentry-source-file":"DraftPortfolioSetupModal.tsx",children:(0,a.Y)(m.A0,{"data-sentry-element":"InputContainer","data-sentry-source-file":"DraftPortfolioSetupModal.tsx",children:(0,a.Y)(d.A,{onPortfolioNameChange:e.onDraftNameChange,inputDraftPortfolioName:e.draftName,referencePortfolioId:e.referencePortfolioId,"data-sentry-element":"CopyPortfolioNameInputForm","data-sentry-source-file":"DraftPortfolioSetupModal.tsx"})})}),(0,a.Y)(p.FH,{"data-sentry-element":"DraftPortfolioBenefitsSection","data-sentry-source-file":"DraftPortfolioSetupModal.tsx"})]})})},x=e=>e.open?(0,a.Y)(v,{...e,"data-sentry-element":"OpenDraftPortfolioSetupModal","data-sentry-component":"DraftPortfolioSetupModal","data-sentry-source-file":"DraftPortfolioSetupModal.tsx"}):null},28056:(e,t,n)=>{n.d(t,{A0:()=>h,dA:()=>v,gq:()=>f,ru:()=>x});var a=n(33624),r=n(31585),o=n(22462),i=n(16528),l=n(98804),s=n(75128),c=n(16636),d=n(84455),u=n(39715),m=n(13340),p=n(86216),y=n(55711);let h=e=>a.mKk(e,a.zug(l.WR)),f=e=>
3h(e.questionId),g=a.VxE({preRetirementReturnRate:e=>r.A(e)?void 0:(0,u.qU)(e),retirementReturnRate:e=>r.A(e)?void 0:(0,u.qU)(e)},a.tTi(e=>e?e.normalize:e=>e,c.KC)),v=e=>{let t,n=(t=a.TSs((e,t)=>{let{questionId:n,response:o}=t;if(n in s.eb){let i=o;return n===d.od.EstimatedTotalIncome&&(i=((e,t)=>{let n,o=(0,u.qU)(String(e));try{n=r.A(t)?m.mF:a.vUk(m.mF,m.Sj[t])}catch(e){console.error("Invalid currency value in estimated total income response",e),n=m.mF}return String(p.A.convert(n,m.mF,o))})(String(o),t.detailedResponse)),a.Ufq(s.eb[n],i,e)}return e},a.TjK(()=>"",s.C2),e),a.tTi((e,t)=>{let n=g[t];return n?n(e):e},t));return r.A(n.distributionStrategy)&&(n.distributionStrategy=n.preRmdDistributionSchedule||l.wO.TaxableFirst),n},x=e=>{let t=[];return a.jJl(e=>{let[n,r]=e,l=s.it[n],c=o.A(l),d=i.A(r),u=c&&h(l)&&(e=>h(e)&&!a.mKk(e,s.$M))(l),m=c&&(0,y.uc)(l);(u||m)&&d&&t.push({questionId:l,response:String(a.vUk("",r))})},a.xcu(e)),t}},28649:(e,t,n)=>{n.d(t,{Ln:()=>d,Q7:()=>c,Uc:()=>u,a9:()=>s,n6:()=>m,qW:()=>l});var a=n(57090),r=n(12115),o=n(11325),i=n(13340);let l="Good start, this is a small slice",s="Connect the rest when you are ready.",c="".concat(s," Until then you can keep the demo portfolio alongside to see the product at full strength."),d="Add the rest of your holdings when you are ready, or switch to the demo portfolio to see the product at full strength.",u=e=>{let t=1===e.investmentsCount?"security":"securities",n=(0,a.Y)(o.eF,{amount:e.investedAmount,sourceCurrency:i.mF});if(0===e.investmentsCount)return(0,a.FD)(r.Fragment,{children:[n," of cash"]});let l=5e3>Math.abs(e.investedAmount),s=e.investmentsCount<5;return l&&s?(0,a.FD)(r.Fragment,{children:[n," across ",e.investmentsCount," ",t]}):s?(0,a.FD)(r.Fragment,{children:[e.investmentsCount," ",t]}):n},m=e=>{let t=u({investedAmount:e.warningData.metadata.investedAmount,investmentsCount:e.warningData.metadata.investmentsCount});return(0,a.FD)(r.Fragment,{children:["Right now we can see ",t,", which is a small slice of a portfolio. Insights on a slice this small will be rough. ",e.nextStep]})}},28890:(e,t,n)=>{e.exports=n.p+"static/media/ob_ai_insights.94e9686956b4c4b4.svg"},28938:(e,t,n)=>{n.d(t,{W:()=>a.A,Z:()=>r.A});var a=n(23699),r=n(93296)},29290:(e,t,n)=>{n.d(t,{A:()=>F,_:()=>k});var a=n(57090),r=n(12115),o=n(99026),i=n(43948),l=n(65438),s=n(79968),c=n(74547),d=n(95825),u=n(36934),m=n(41784),p=n(59623),y=n(99996),h=n(18281),f=n(95777);let g={[h.ue.CreateNew]:"Upload a statement or CSV file to create a new portfolio.",[h.ue.UpdateHoldings]:"Upload updated data to replace all current holdings in the selected portfolio.",[h.ue.AddTransactions]:"Upload a transaction statement to add transaction history to the selected portfolio."},v=e=>{if(e.intent)return(0,a.Y)(u.bU,{className:(0,m.cn)("text-neutral-500"),children:g[e.intent]});switch(e.dataDomain){case h.SN.Transactions:return(0,a.Y)(u.bU,{className:(0,m.cn)("text-neutral-500"),children:"Uploading your transaction statement(s) will add them to the selected portfolio. Please ensure that the uploaded statements contain data only related to the selected portfolio"});case h.SN.Anything:return(0,a.Y)(u.bU,{className:(0,m.cn)("text-neutral-500"),children:"Upload any documents, statements, or financial spreadsheets you'd like us to add to your account. If you're adding transactions to a specific portfolio, please select it below. Otherwise, you can skip."});default:return null}};var x=n(81671);let A=[{intent:h.ue.CreateNew,icon:x.$.CirclePlus,title:"Create a new portfolio",description:"Upload a statement or CSV to create a new portfolio from your file data"},{intent:h.ue.UpdateHoldings,icon:x.$.ArrowRotateClockwise,title:"Update an existing portfolio",description:"Replace current holdings with the uploaded data"},{intent:h.ue.AddTransactions,icon:x.$.ListAdd,title:"Add transactions",description:"Add transaction history to an existing portfolio"}],S=e=>(0,a.Y)(c.Ah,{display:"block",itemsSpacingVertical:10,"data-sentry-element":"FlexLayout","data-sentry-component":"UploadIntentSelector","data-sentry-source-file":"UploadIntentSelector.tsx",children:A.map(t=>(0,a.FD)("div",{className:"flex items-center gap-4 p-4 border border-[color:var(--wp-card-border)] rounded-lg cursor-pointer transition-colors hover:border-blue-500 hover:bg-neutral-50",onClick:()=>e.onSelectIntent(t.intent),children:[(0,a.Y)(c.In,{icon:t.icon,size:24,className:"text-primary-600 min-w-[24px]"}),(0,a.FD)(c.Ah,{display:"block",itemsSpacingVertical:2,children:[(0,a.Y)(u.RF,{className:(0,m.cn)("text-body"),children:t.title}
3),(0,a.Y)(u.km,{className:(0,m.cn)("text-neutral-500"),children:t.description})]})]},t.intent))}),b={[h.ue.CreateNew]:"Create a new portfolio",[h.ue.UpdateHoldings]:"Update portfolio holdings",[h.ue.AddTransactions]:"Add transactions"},C=e=>{if("success"===e.remoteUploadStatus)return(0,a.Y)(r.Fragment,{children:"Upload successful"});if(e.intent)return(0,a.Y)(r.Fragment,{children:b[e.intent]});switch(e.dataDomain){case h.SN.Transactions:return(0,a.Y)(r.Fragment,{children:"Upload transactions statement(s)"});case h.SN.Anything:default:return(0,a.Y)(r.Fragment,{children:"Upload anything"})}},I=e=>{let{value:t,setValue:n}=(0,l.A)(!0),[o,i]=(0,r.useState)(),[g,A]=(0,r.useState)(null),b=g===h.ue.AddTransactions?h.SN.Transactions:e.dataDomain,{uploaderInstanceRef:I,uploaderConfig:w,afterUploaderOpened:P,disableSubmit:k,onSubmit:F,exitUploader:T,isRemoteUploadSuccess:E,showPortfolioSelector:Y,remoteUploadStatus:D}=(0,y.N)({dataDomain:b,portfolioId:o}),R=e.dataDomain===h.SN.Anything&&!g,N=!R&&g!==h.ue.CreateNew&&Y,M=g===h.ue.UpdateHoldings&&!o||k,L=()=>{n(!1),T(),e.onClose()},_=async()=>{await F()},O=R?"intent":E?"success":"uploader";return(0,a.Y)(c.aF,{disableSubmitOnEnter:!0,title:(0,a.Y)(C,{dataDomain:e.dataDomain,remoteUploadStatus:D,intent:g}),open:t,onCancel:L,footer:R?null:(0,a.FD)(d.jl,{"data-sentry-element":"ModalFooter","data-sentry-component":"renderFooter","data-sentry-source-file":"StatementsUploader.tsx",children:[g&&!E&&(0,a.Y)(c.$n,{variant:"ghost",onClick:()=>{A(null),i(void 0)},prefix:(0,a.Y)(c.In,{icon:x.$.ArrowLeft,size:14}),children:"Back"}),!E&&(0,a.Y)(c.$n,{onClick:L,children:"Cancel"}),(0,a.Y)(c.$n,{variant:"filled",disabled:M,onClick:E?L:_,"data-sentry-element":"Button","data-sentry-source-file":"StatementsUploader.tsx",children:E?"Close":"Upload"})]}),hideCloseButton:E,afterOpenChange:e=>{e&&P()},keyboard:R,maskClosable:R,"data-sentry-element":"Modal","data-sentry-component":"StatementsUploader","data-sentry-source-file":"StatementsUploader.tsx",children:(0,a.Y)(p.P.div,{initial:{opacity:0}
3,animate:{opacity:1},transition:{duration:.4,ease:"easeInOut"},"data-sentry-element":"unknown","data-sentry-source-file":"StatementsUploader.tsx",children:R?(0,a.Y)(S,{onSelectIntent:A}):E?(0,a.FD)(c.Ah,{display:"block",itemsSpacingVertical:16,children:[(0,a.FD)(c.Ah,{itemsSpacingHorizontal:12,flexWrap:"nowrap",justifyContent:"flex-start",children:[(0,a.Y)(c.In,{icon:x.$.Email1,size:24,className:"text-neutral-400 min-w-[24px]"}),(0,a.Y)(u.lc,{className:(0,m.cn)("text-body"),children:"Your file is being processed and we'll send you an email when it's ready."})]}),(0,a.Y)(u.cO,{className:(0,m.cn)("text-neutral-500"),children:"Most of the time this takes less than 30 min (parsed automatically), sometimes it takes 72 hours (kicked to a manual queue)."})]}):(0,a.FD)(c.Ah,{display:"block",itemsSpacingVertical:8,flexWrap:"nowrap",children:[(0,a.Y)(v,{dataDomain:b,intent:null!=g?g:void 0}),N&&(0,a.Y)(f.B,{selectedPortfolioId:null!=o?o:null,onChange:e=>i(e),optional:!1}),(0,a.Y)(s.d,{uploaderRef:I,config:w})]})},O)})},{useGlobalStatementsUploaderLaunchEventListener:w,emitGlobalStatementsUploaderLaunchEvent:P}=(0,i.createEvent)("GlobalStatementsUploaderLaunchEvent")(),k=()=>({launchStatementsUploader:async e=>{P({...e,onClose:e.onClose||o.lQ})}}),F=()=>{let[e,t]=r.useState(null),n=r.useRef(o.lQ);return w(e=>{let{onClose:a,...r}=e;t(r),n.current=a||o.lQ}),e?(0,a.Y)(I,{...e,onClose:()=>{t(null),n.current(),n.current=o.lQ},"data-sentry-element":"StatementsUploader","data-sentry-component":"GlobalStatementsUploaderLauncher","data-sentry-source-file":"GlobalStatementsUploaderLauncher.tsx"},e.dataDomain):null}},29743:(e,t,n)=>{n.d(t,{DR:()=>l,Lj:()=>s,Nb:()=>a,dU:()=>r,dX:()=>o});let a={TRACK:"track",PLAN:"plan",IMPROVE:"improve",EXPLORE:"explore",OTHER:"other"},r={MAIN:"main",NETWORTH:"networth",INCOME:"income",SETTINGS:"settings",GROUPS:"groups",DRAFTS:"drafts",TRANSACTIONS:"transactions",PREFERENCES:"preferences",EMAIL_ALERTS:"email-alerts",ACCOUNT_SETTINGS:"account-settings",SUBSCRIPTION:"subscription",BILLING:"billing",SHARED_ACCESS:"shared-access",RETIREMENT:"retirement",ESTATE:"estate",PORTFOLIO_SCORE:"portfolio-score",RISK_MATCH:"risk-match",RISK_ADJUSTED_RETURNS:"risk-adjusted-returns",DOWNSIDE_PROTECTION:"downside-protection",RECOMMENDATIONS:"recommendations",RECOMMENDATION_DETAILS:"recommendation-details",DETAILS:"details",COMPARISON:"comparison",PORTFOLIO:"portfolio",TAXES:"taxes",FEES:"fees",SIMULATIONS:"simulations",STOCK_SCREENER:"stock-screener",FUND_SCREENER:"fund-screener",SECURITY_EXPLORER:"security-explorer",MACRO_EXPLORER:"macro-explorer",MARKET_OVERVIEW:"market-overview",INSIGHTS:"insights",AI_EQUITY_RESEARCH:"ai-equity-research",PORTFOLIO_FEED:"portfolio-feed",ANOMALIES:"anomalies",SCREENER:"screener",CRYPTO_SCREENER:"crypto-screener",INSIGHT:"insight"},o={TRACK_MAIN:"track:main",TRACK_NETWORTH:"track:networth",TRACK_SETTINGS:"track:settings",TRACK_GROUPS:"track:groups",TRACK_DRAFTS:"track:drafts",TRACK_TRANSACTIONS:"track:transactions",TRACK_PREFERENCES:"track:preferences",TRACK_EMAIL_ALERTS:"track:email-alerts",TRACK_ACCOUNT_SETTINGS:"track:account-settings",TRACK_SUBSCRIPTION:"track:subscription",TRACK_BILLING:"track:billing",TRACK_SHARED_ACCESS:"track:shared-access",TRACK_DETAILS:"track:details",TRACK_INCOME:"track:income",PLAN_RETIREMENT:"plan:retirement",PLAN_ESTATE:"plan:estate",IMPROVE_MAIN:"improve:main",IMPROVE_RISK_MATCH:"improve:risk-match",IMPROVE_RISK_ADJUSTED_RETURNS:"improve:risk-adjusted-returns",IMPROVE_DOWNSIDE_PROTECTION:"improve:downside-protection",IMPROVE_RECOMMENDATIONS:"improve:recommendations",IMPROVE_RECOMMENDATION_DETAILS:"improve:recommendation-details",IMPROVE_COMPARISON:"improve:comparison",IMPROVE_TAXES:"improve:taxes",IMPROVE_FEES:"improve:fees",IMPROVE_SIMULATIONS:"improve:simulations",IMPROVE_PORTFOLIO:"improve:portfolio",EXPLORE_MAIN:"explore:main",EXPLORE_STOCK_SCREENER:"explore:stock-screener",EXPLORE_FUND_SCREENER:"explore:fund-screener",EXPLORE_SECURITY_EXPLORER:"explore:security-explorer",EXPLORE_MACRO_EXPLORER:"explore:macro-explorer",EXPLORE_MARKET_OVERVIEW:"explore:market-
3overview",EXPLORE_INSIGHTS:"explore:insights",EXPLORE_AI_EQUITY_RESEARCH:"explore:ai-equity-research",EXPLORE_PORTFOLIO_FEED:"explore:portfolio-feed",EXPLORE_ANOMALIES:"explore:anomalies",EXPLORE_SCREENER:"explore:screener",EXPLORE_CRYPTO_SCREENER:"explore:crypto-screener",EXPLORE_INSIGHT:"explore:insight"},i={[o.TRACK_MAIN]:{title:"Track",description:"Monitor your net worth across all accounts, get portfolio-specific insights, and get a look-through analysis by sector, country, holding, and asset class."},[o.TRACK_NETWORTH]:{title:"Net worth",description:"Add your entire net worth, including brokerages, retirement accounts, debts, cash, private equity, real estate, and more."},[o.TRACK_SETTINGS]:{title:"Settings",description:"Update your user & investment profiles, recommendation preferences, account settings, email alerts, and subscriptions & billing info."},[o.TRACK_GROUPS]:{title:"Account Groups",description:"Organize your accounts into groups for better portfolio management and analysis."},[o.TRACK_DRAFTS]:{title:"Portfolio Drafts",description:"Review and manage your saved draft portfolios with recommended changes."},[o.TRACK_TRANSACTIONS]:{title:"Transactions",description:"View and manage transactions across all your linked accounts."},[o.TRACK_PREFERENCES]:{title:"Investment Preferences",description:"Set your investment preferences, risk tolerance, and portfolio goals."},[o.TRACK_EMAIL_ALERTS]:{title:"Email Alerts",description:"Configure email notifications for portfolio updates, market alerts, and recommendations."},[o.TRACK_ACCOUNT_SETTINGS]:{title:"Account Settings",description:"Manage your account details, security settings, and personal information."},[o.TRACK_SUBSCRIPTION]:{title:"Subscription",description:"View and manage your PortfolioPilot subscription plan and features."},[o.TRACK_BILLING]:{title:"Billing & Promotions",description:"Manage your billing information, payment methods, and promotional codes."},[o.TRACK_SHARED_ACCESS]:{title:"Shared access",description:"Invite others to view or manage your account, accept invitations, and switch between accessible accounts."},[o.TRACK_DETAILS]:{title:"Portfolio Details",description:"View detailed breakdown of your portfolio holdings, allocations, and individual security metrics - aggregated or account-by-account."},[o.TRACK_INCOME]:{title:"Dividend & income",description:"See every income source in your net worth: dividends, bond interest, cash interest, rental income, pension and annuity payouts, and private equity distributions, with expected payments by month."},[o.PLAN_RETIREMENT]:{title:"Retirement Planning",description:"Plan your retirement with projections, life events, and custom scenarios to feel more confident about your future."},[o.PLAN_ESTATE]:{title:"Estate Planning",description:"A dynamic checklist including guardianship, beneficiaries, living will, and more."},[o.IMPROVE_MAIN]:{title:"Improve",description:"Get a detailed asse
3ssment, run simulations, and recommendations across your investments, taxes, and fees - focus on what you can improve today."},[o.IMPROVE_RISK_MATCH]:{title:"Risk Match",description:"See how well your portfolio risk aligns with your stated risk preference."},[o.IMPROVE_RISK_ADJUSTED_RETURNS]:{title:"Risk-Adjusted Returns",description:"Focus on portfolio efficiency to get the highest returns for the risk you are taking."},[o.IMPROVE_DOWNSIDE_PROTECTION]:{title:"Downside Protection",description:"Evaluate how protected your portfolio is against market downturns and various macro risk factors."},[o.IMPROVE_RECOMMENDATIONS]:{title:"Recommendations",description:"Get personalized investment recommendations to improve your portfolio based on markets and your preferences - a menu to help you find your next improvement."},[o.IMPROVE_RECOMMENDATION_DETAILS]:{title:"Recommendation Details",description:"View detailed information about a specific recommendation including score impact, tax implications, and security analysis."},[o.IMPROVE_COMPARISON]:{title:"Portfolio Comparison",description:"Compare your current portfolio side-by-side with market indexes draft portfolios to evaluate potential changes."},[o.IMPROVE_TAXES]:{title:"Tax Optimization",description:"Identify tax-loss harvesting opportunities and get replacement suggestions to minimize your tax burden."},[o.IMPROVE_FEES]:{title:"Fee Saver",description:"See fund and advisor fees transparently, with optimization recommendations that could help you save every year."},[o.IMPROVE_SIMULATIONS]:{title:"Simulations",description:"Run what-if scenarios to see how changes would impact your portfolio over time (historical and future-looking)."},[o.IMPROVE_PORTFOLIO]:{title:"Portfolio Overview",description:"Get a comprehensive overview of your portfolio with key metrics, score breakdown, and quick access to improvements."},[o.EXPLORE_MAIN]:{title:"Explore",description:"Explore the global economy, news, market updates, portfolio insights, and use smart tools to find your next investment."},[o.EXPLORE_STOCK_SCREENER]:{title:"Stock Screener",description:"Use the smart filter to find stocks based on any criteria you desire."},[o.EXPLORE_FUND_SCREENER]:{title:"Fund Screener",description:"Search and compare ETFs and mutual funds by performance, fees, macro exposure, and more."},[o.EXPLORE_SECURITY_EXPLORER]:{title:"Security Explorer",description:"Deep dive into 60,000+ individual securities with detailed analysis, charts, fundamentals, news, and metrics."},[o.EXPLORE_MACRO_EXPLORER]:{title:"Macro Explorer",description:"Explore 10,000+ macroeconomic indicators, forecasts, and their impact on markets."},[o.EXPLORE_MARKET_OVERVIEW]:{title:"Market Overview",description:"Get a snapshot of global market and macro indicators, with 12-month forecasts."},[o.EXPLORE_INSIGHTS]:{title:"Macro Insights",description:"Weekly summary, model updates, and interesting macro/security anomalies"},[o.EXPLORE_AI_EQUITY_RESEARCH]:{title:"AI Equity Research",description:"Use our advanced AI search to find baskets of stocks to research, with comparison to a benchmark."},[o.EXPLORE_PORTFOLIO_FEED]:{title:"Portfolio Insights",description:"Stay updated with news, dividends, earnings and events relevant to your portfolio."},[o.EXPLORE_ANOMALIES]:{title:"Anomalies",description:"Automatically discovered market anomalies across 60,000+ securities."},[o.EXPLORE_SCREENER]:{title:"Unified Screener",description:"Search and filter stocks, funds, and crypto in one unified screener interface."},[o.EXPLORE_CRYPTO_SCREENER]:{title:"Crypto Screener",description:"Search and filter cryptocurrencies by market cap, performance, and other metrics."},[o.EXPLORE_INSIGHT]:{title:"Insight Detail",description:"Deep dive into a specific market insight with analysis and implications."}};function l(e,t){return t?"".concat(e,":").concat(t):"".concat(e,":main")}function s(e,t){let n=l(e,t);if(i[n])return i[n];let a="".concat(e,":main");return i[a]?i[a]:i[o.TRACK_MAIN]}},29994:(e,t,n)=>{n.d(t,{W:()=>a.A,lt:()=>r.A});var a=n(23699),r=n(14428)}
3,31133:(e,t,n)=>{n.d(t,{h:()=>i});var a=n(12115),r=n(73285),o=n(24092);let i=()=>{let e=(0,r.w)(),t=a.useRef(e);return(0,o.E)(()=>{t.current=e}),t}},31624:(e,t,n)=>{n.d(t,{z:()=>a});var a=function(e){return e.Legacy="legacy",e.Trend="trend",e}({})},31695:(e,t,n)=>{n.d(t,{E:()=>o});var a=n(73285),r=n(25373);let o=()=>{let e=(0,a.w)();return{openNetworthPage:(t,n)=>(0,r.H5)(e,t,n),openGroupsPage:()=>(0,r.nH)(e),openDraftsPage:()=>(0,r.jV)(e),openTransactionsPage:t=>(0,r._3)(e,t)}}},32204:(e,t,n)=>{n.d(t,{F:()=>c,IQ:()=>s,Ii:()=>u,b9:()=>m,nX:()=>p});var a=n(33624),r=n(83439),o=n(73590),i=n.n(o),l=n(22977);let s=e=>Number.isFinite(e)?e:null,c=e=>s(i()(e,l.dO).valueOf()),d=(e,t,n)=>{let r=Math.min(e.length,t.length,n.length);return a.HnJ(a=>({x:s(e[a]),low:s(t[a]),high:s(n[a])}),r).filter(e=>null!==e.x&&null!==e.low&&null!==e.high)},u=e=>e.map(e=>[e.x,e.low,e.high]),m=(e,t)=>{if(!r.A(t))return null;let n=a.HVh(d(e,t,t));return void 0===n?null:n},p=e=>{let t;return((e,t)=>null===t||0===e.length||e[0].x<=t.x?[...e]:[t,...e])(((e,t)=>{if(0===e.length)return[];let n=e[0].x,r=e[e.length-1].x,o=new Set(e.map(e=>e.x)),i=a.sbv(t.filter(e=>null!==e&&e>n&&e<r&&!o.has(e)));return a.Uln(e=>e.x,[...e,...i.map(e=>({x:e,low:null,high:null}))])})((t=Array.from(new Map(d(e.dateTimes,e.lows,e.highs).map(e=>e.low>e.high?{x:e.x,low:e.high,high:e.low}:e).map(e=>[e.x,e])).values()),a.Uln(e=>e.x,t)),e.dateTimes),m(e.dateTimes,e.historyValues))}},33223:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(81527),r=n(12115),o=n(18061);let i=function(e,t,n){let i=(0,o.T)(),{enabled:l,resetOnDisabled:s,...c}=n,d=(0,a.I)(e,t,{...c,enabled:l});return(0,r.useEffect)(()=>{!l&&s&&i.current.resetQueries(e)},[l,s,e,i]),d}},33421:(e,t,n)=>{e.exports=n.p+"static/media/ob_feel_more_confident.6559d7f1cc3dc367.svg"},33815:(e,t,n)=>{n.d(t,{F:()=>s});var a=n(62212),r=n(84245),o=n(80067),i=n(50202),l=n(51164);let s=()=>{let{data:e,isSuccess:t}=(()=>{let{mainPortfolio:e}=(0,i.RW)();return(0,l.z)(e.portfolioId,r.c5,o.sB,{...r.gz,useErrorBoundary:!1})})(),n=(0,a.j)(),s=async()=>{let t;try{t=await (0,o.sB)()}catch(n){t=e}return n.setQueryData(r.c5,t),t},c=async()=>{let e=await s();if(e){let t={investedAmount:e.securitiesAmount,investmentsCount:e.securitiesCount};return{isIncomplete:e.isPossiblyIncomplete,metadata:t}}},d=e?{investedAmount:e.securitiesAmount,investmentsCount:e.securitiesCount}:null;return{getMainPortfolioFreshIncompleteStatus:c,isMainPortfolioPossiblyIncomplete:e?e.isPossiblyIncomplete:null,incompleteMetadata:d,isStatusLoaded:t}}},34537:(e,t,n)=>{n.d(t,{Ot:()=>c,e7:()=>u,zo:()=>d});var a=n(33624),r=n(22462),o=n(44561),i=n(544),l=n(82949);let s=a.ZzX(a.jpb,a.Bqr),c=e=>{let t=a.G4b([a.Zwk(a.zyy("isTickerTrackedInitially")),a.Zwk(a.zyy("proxyTicker"))])(e),n=e.displayName||"",l=e.ticker||"",c=t&&((e,t)=>{let n=a.Ime(e),r=a.mKk(s(o.oQ),s(e)),i=a.aIS(s(e),s(t));return n||r||i})(n,l);if(t)return{isSecurityProxied:null,isUntrackedSecurity:null,isUntrackedWithEmptySeriesName:null,isPotentiallyUnknownSecurity:c,isInternalSecurity:null};{let t=!!e.isTickerTrackedInitially,s=!(0,i.yI)(l)&&r.A(e.proxyTicker),d=!t&&!s,u=a.Uo6(d,a.or(a.aIS(n,o.oQ),a.Ime(n)));return{isSecurityProxied:s,isUntrackedSecurity:d,isUntrackedWithEmptySeriesName:u,isInternalSecurity:(0,i.Gx)(l),isPotentiallyUnknownSecurity:c}}},d=()=>({isSecurityProxied:!0,isUntrackedSecurity:!1,isUntrackedWithEmptySeriesName:!1,isPotentiallyUnknownSecurity:!1,isInternalSecurity:!1}),u=e=>{let{ticker:t,securityName:n}=e;return(0,i.YZ)({ticker:(0,l.M_)(t),securityName:n})}},34584:(e,t,n)=>{n.d(t,{V:()=>a});var a=function(e){return e.CopyOfHoldings="CopyOfHoldings",e.Empty="Empty",e}({})},34645:(e,t,n)=>{n.d(t,{gX:()=>L,__:()=>M,Wc:()=>R,I6:()=>D,Hk:()=>N});var a=n(12115),r=n(33624),o=n(31585),i=n(48298),l=n(17667),s=n(8830),c=n(66909),d=n(21123),u=n(97569),m=n(73590),p=n.n(m);let y=async e=>{let{importSource:t,normalizedPortfolioData:n,parsedInvestmentItems:a}=e;try{let e=await (0,u.d)();if(e){let r="- [".concat(e.userDict.id,"]"),o=[p()().unix().toString()];d.wd("AI Portfolio content processed ".concat(r),{tags:{importSource:t},level:"info",fingerprint:o,extra:{importSource:t,normalizedPortfolioData:n,parsedInvestmentItems:a}})}else d.wd("User information is not available to perform AI content processed tracking")}catch(e){d.Cp(e)}},h=async e=>{let{reason:t,importSource:n,payload:a}=e;try{let e=await (0,u.d)();if(e){let r="- [".concat(e.userDict.id,"]"),o=[p()().unix().toString()];d.wd("AI Portfolio parsing failed ".concat(r),{tags:{importSource:n},level:"error",fingerprint:o,extra:{reason:t,importSource:n,payload:a}})}else d.wd("User information is not available to perform AI parsing failure tracking")}catch(e){d.Cp(e)}},f=e=>{let t=e.match(/\b[a-zA-Z]+(?:\d+)?\b|\b\d+(?:\.\d+)?(?:[a-zA-Z]+)?\b/g)||[],n=0,a=0;
3t.forEach(e=>{/\d/.test(e)&&/[a-zA-Z]/.test(e)?(n++,a++):/\d/.test(e)?a++:/[a-zA-Z]/.test(e)&&n++});let r=a>=3;return n>=3&&r};var g=n(65438),v=n(37722),x=n(39504),A=n(62031),S=n.n(A),b=n(13125),C=n.n(b),I=n(88963);class w{constructor(){this.aiPortfolioParse=async e=>{let t=await this.apiCaller.post("/public/ai_portfolio_import",C()(e));return S()(t,{deep:!0})},this.getOneMinAssessment=async(e,t)=>{let n=await this.apiCaller.post("/public/one_min_assessment",C()({portfolio:e,riskMatch:t},{deep:!0}));return S()(n,{deep:!0})},this.apiCaller=new I.Ay}}let P=new w;var k=n(67759),F=n(4603);let T=e=>r.G4b([o.A,r.FsL(String,r.jpb,r.aIS("null"))])(e),E=(e,t)=>r.Tkb(T,t,r.D_O)(e),Y=e=>{let t=0,n=()=>"Unknown".concat(++t);return r.TjK(e=>{let t=E(e.ticker,n),a=E(e.investment,r.Gkd("Unknown")),o=E(e.displayTicker,r.Gkd(t));return r.VxE(e,{investment:a,ticker:t,displayTicker:o})},e)},D=()=>{let{authenticated:e}=(0,x.X6)(),t=async t=>e?i.Ay.aiPortfolioParse(t):P.aiPortfolioParse(t),n=async e=>Y(await t(e));return(0,l.A)(async e=>((0,k.trackAIImport)({event:F.AIImportEvent.DataUploaded}),n(e)),{onSuccess:(e,t)=>{y({parsedInvestmentItems:e,importSource:t.source,normalizedPortfolioData:t.data,parsingFeedback:t.parsingFeedback})},onError:(e,t)=>{h({reason:(0,c.u)(e),importSource:t.source,payload:t})}})},R=()=>{let e=async e=>Y(await i.Ay.aiPortfolioAddAllAtOnce(e));return(0,l.A)(async t=>((0,k.trackAIImport)({event:F.AIImportEvent.DataUploaded}),e(t)))},N=()=>{let[e,t]=a.useState(),[n,r]=a.useState(null);return{textPortfolioInput:e,setTextPortfolioInput:t,isLocalTextCheckPassed:n,setLocalTextCheckPassed:e=>{r(f(e))},validateTextInput:e=>{let t=f(e);return r(t),t}}},M=e=>{let[t,n]=a.useState(null),{textPortfolioInput:r,setTextPortfolioInput:o,isLocalTextCheckPassed:i,setLocalTextCheckPassed:l}=N(),c=D(),{status:d}=c,u=c.error,m=async()=>{if(t&&"string"==typeof r)return await c.mutateAsync(t,{onSuccess:t=>{e.onSuccess({parsedInvestmentItems:t,normalizedUploadData:r})}})};return{aiImporterPayload:t,textPortfolioInput:r,isLocalTextCheckPassed:i,portfolioParserStatus:d,error:u,aiPortfolioParserMutation:c,handleTextPortfolioInputChange:e=>{o(e),l(e),n({source:s.X.CopyPaste,data:e})},handleAIDataImport:m,handleCloseImporter:async()=>{e.onImporterClose()},handleResetAIImporterMutation:()=>{c.reset()}}},L=e=>{let{value:t,setTrue:n,setFalse:a}=(0,g.A)(),[{showEditor:r,parsedInvestmentItems:o,normalizedUserUploadedData:i},l]=(0,v.m5)(),s=()=>{l({type:"closeEditor"})};return{showImportModal:t,showParsedPortfolioEditor:r,parsedInvestmentItems:o,normalizedUserUploadedData:i,handleLaunchUploaderClick:()=>{n()},handleImportSuccess:e=>{let{parsedInvestmentItems:t,normalizedUploadData:n}=e;a(),l({type:"launchEditor",payload:{parsedInvestmentItems:t,normalizedUserUploadedData:n}})},handleImportFlowCancel:()=>{var t;s(),a(),null==(t=e.onWorkflowEnded)||t.call(e)},handlePortfolioSaveComplete:t=>{var n,r;let{setupFinalOutcome:o,portfolioId:i}=t;s(),a(),null==(n=e.onSuccess)||n.call(e,{setupFinalOutcome:o,portfolioId:i}),null==(r=e.onWorkflowEnded)||r.call(e)},handleInitiateNewUpload:()=>{s(),n()}}}},34763:(e,t,n)=>{n.d(t,{C:()=>r,_:()=>a});let{useGlobalAlternativeMainChildrenListener:a,emitGlobalAlternativeMainChildren:r}=(0,n(43948).createEvent)("GlobalAlternativeMainChildren")()},35270:(e,t,n)=>{n.d(t,{f0:()=>D,X7:()=>N,jO:()=>B,IL:()=>W,wS:()=>_,je:()=>L,Gr:()=>O,Ce:()=>U,y4:()=>V});var a=n(57090),r=n(12115),o=n(33624),i=n(98483),l=n(22462),s=n(34763),c=n(39054),d=n(73285),u=n(74547),m=n(60927),p=n(11074),y=n(39504),h=n(46749),f=n(35222),g=n(99267),v=n(74481),x=n(47364),A=n(54958),S=n(2807),b=n(92672),C=n(41784),I=n(36934),w=n(81671);let P=e=>{let{hasBeenFocused:t,className:n,...r}=e;return(0,a.Y)(b.Ah,{...r,className:(0,C.cn)("w-full p-4",t&&"bg-white w-full z-50 px-4 py-2 shadow rounded-none",n),"data-sentry-element":"FlexLayout","data-sentry-component":"SearchPageContainer","data-sentry-source-file":"GlobalSearchPage.tsx"})},k=e=>(0,a.Y)(I.bU,{...e,className:(0,C.cn)("text-neutral-500","text-center"),"data-sentry-element":"Body1W400","data-sentry-component":"SearchSubtitle","data-sentry-source-file":"GlobalSearchPage.tsx"});var F=n(54519),T=n(99026),E=n(97663),Y=n(29743);let D=e=>e?e===c.fW.Preferences?{page:Y.Nb.TRACK,pageName:"Track",subSection:Y.dU.PREFERENCES}:e===c.fW.EmailAlerts?{page:Y.Nb.TRACK,pageName:"Track",subSection:Y.dU.EMAIL_ALERTS}:e===c.fW.PersonalSettings?{page:Y.Nb.TRACK,pageName:"Track",subSection:Y.dU.ACCOUNT_SETTINGS}:e===c.fW.Subscription?{page:Y.Nb.TRACK,pageName:"Track",subSection:Y.dU.SUBSCRIPTION}:e===c.fW.Billing?{page:Y.Nb.TRACK,pageName:"Track",subSection:Y.dU.BILLING}:e===c.fW.SharedAccess?{page:Y.Nb.TRACK,pageName:"Track",subSection:Y.dU.SHARED_ACCESS}:e===A.JA?{page:Y.Nb.PLAN,pageName:"Plan",subSection:Y.dU.ESTATE}:e===A.k0?{page:Y.Nb.OTHER,pageName:"PortfolioPilot",subSection:null}:null:null,R={[v.Q.UserProfile]:Y.dU.PREFERENCES,[v.Q.InvestmentProfile]:Y.dU.PREFERENCES,[v.Q.Recommendations]:Y.dU.PREFERENCES,[v.Q.Planning]:Y.dU.PREFERENCES,[v.Q.EmailAlerts]:Y.dU.EMAIL_ALERTS,[v.Q.AccountSettings]:Y.dU.ACCOUNT_SETTINGS,[v.Q.Subscription]:Y.dU.SUBSCRIPTION,[v.Q.Billing]:Y.dU.BILLING,[v.Q.SharedAccess]:Y.dU.SHARED_ACCESS},N=e=>{var t;return e?{page:Y.Nb.TRACK,pageName:"Track",subSection:null!=(t=R[e])?t:Y.dU.PREFERENCES}:null},M=async(e,t,n)=>{let a=null==n?void 0:n[f.YO];(0,g.E)({tab:e,hash:(e=>"string"==typeof e&&""!==e?e:void 0)(t),openRecommendationContext:(null==n?void 0:n[f.PO])!==void 0,groupId:void 0===a?void 0:Number(a)})},L=async(e,t)=>{let n=(null==t?void 0:t.openRecommendationContext)?{[f.PO]:"1",...void 0!==t.groupId?{[f.YO]:String(t.groupId)}:{}}:void 0;await M(c.fW.Preferences,e,n)},_=async e=>{await M(c.fW.PersonalSettings,e)},O=async()=>{await M(c.fW.Subscription)},W=async()=>{await M(c.fW.Billing)},B=()=>{(0,s.C)({view:A.k0})},U=async()=>{(0,s.C)({view:A.JA})},z={[A.JA]:(0,a.Y)(()=>(0,a.Y)(u.J3,{"data-sentry-element":"MainContainer","data-sentry-component":"GlobalEstatePlannerPage","data-sentry-source-file":"GlobalEstatePlannerPage.tsx",children:(0,a.Y)(m.A,{"data-sentry-element":"PageMainContentLayout","data-sentry-source-file":"GlobalEstatePlannerPage.tsx",children:(0,a.Y)(p.l,{"data-sentry-element":"EstatePlanner","data-sentry-source-file":"GlobalEstatePlannerPage.tsx"})})}),{}),[A.k0]:(0,a.Y)(()=>{let[e,t]=r.useState(!1);return(0,a.FD)(P,{itemsSpacingVertical:16,flexDirection:"column",justifyContent:"center",alignItems:"center",height:"inherit",flex:e?void 0:1,hasBeenFocused:e,"data-sentry-element":"SearchPageContainer","data-sentry-component":"GlobalSearchPage","data-sentry-source-file":"GlobalSearchPage.tsx",children:[!e&&(0,a.FD)(r.Fragment,{children:[(0,a.Y)(u.In,{icon:w.$.MagnifyingGlass,className:"text-neutral-400",size:40}
3),(0,a.FD)(k,{children:["Start typing to find securities, guides,",(0,a.Y)("br",{className:"sm:hidden"})," or ask the AI Assistant"]})]}),(0,a.Y)(S.A,{inputColor:e?void 0:"white",onFocus:()=>{t(!0)},"data-sentry-element":"SearchBarRenderer","data-sentry-source-file":"GlobalSearchPage.tsx"})]})},{})},V=()=>{let{setSearchParams:e}=(0,x.o)(["view"],{removeEmptyValues:!0}),t=(0,d.w)(),{authenticated:n}=(0,y.X6)(),{isUserInsideCoreApp:a}=(0,h.A)(),{isRedirectingLegacyNetworthView:s}=(()=>{var e;let t=(0,d.w)(),n=((e,t,n)=>{if(!e)return null;let a=((e,t)=>i.A(e.view)?e.view:Object.values(F.s_).some(e=>e===t)?e.tab:void 0)(e,n);if(!i.A(a)||!Object.values(E.d).some(e=>e===a))return null;let r=o.cJW(["view","tab"],e),l=(null!=t?t:"").replace(/^#/,"");return{pathname:F.s_[a],query:o.Ime(r)?void 0:r,hash:l||void 0}})(t.query,(t.asPath,window.location.hash),(0,T.Uc)(null!=(e=t.asPath)?e:"")),a=n?JSON.stringify(n):null;return r.useEffect(()=>{n&&t.replace(n)},[a,t.asPath]),{isRedirectingLegacyNetworthView:null!==n}})(),{view:c}=t.query,u=i.A(c)?z[c]:null,m=o.Q7R(o.aIS(!0),[n,a,l.A(u),l.A(c),!s]),p=o.aIS(c,A.k0),f=async()=>{await e({view:null},{replaceHistory:!1})};return{showGlobalAlternativeChildren:m,globalAlternativeChildren:u,view:c,suppressNavigator:p,setAlternativeViewSearchParams:e,closeGlobalAlternativeChildren:f}}},35334:(e,t,n)=>{n.d(t,{c:()=>o});var a=n(39504),r=n(4932);let o=()=>{let e=(0,a.X6)();return{isOnboardingCompleted:(0,r.F1)(e)}}},35394:(e,t,n)=>{n.d(t,{A:()=>ep});var a=n(57090),r=n(12115),o=n(12919),i=n(32189),l=n(74547),s=n(57283),c=n(51305),d=n(33624),u=n(78046),m=n(31260),p=n(65438),y=n(25559),h=n(904),f=n(10691),g=n(61299),v=n(97765),x=n(89568),A=n(50343);let S={investmentAmount:"investmentAmount",directSellProceedsToMoneyMarket:"directSellProceedsToMoneyMarket"},b=e=>{let{preferredCurrency:t}=(0,m.yf)(),{preferredCurrencySymbol:n}=(0,v._)(),[o]=(0,u.mN)(),{value:i,setValue:b}=(0,p.A)(!1),C=(0,u.r3)(S.directSellProceedsToMoneyMarket,o),I=s.A((0,y.r2)(t,e.suggestedAmount)),w=s.A((0,y.r2)(t,d.vUk(e.suggestedAmount,e.modifiedAmount))),P=s.A((0,y.r2)(t,e.existingAmount)),k=c.A(0,e.suggestedAmount),F=d.aIS(h.X.reduce,e.mode),T=F?P:Number.MAX_SAFE_INTEGER,{inputHeader:E,actionButtonText:Y}=((e,t,n)=>{switch(e){case h.X.add:return{inputHeader:"How much of ".concat(t," (").concat(n,") do you want in your portfolio?"),actionButtonText:"Add"};case h.X.increment:return{inputHeader:"How much of ".concat(t," (").concat(n,") do you want to add on top of current investment value in your portfolio?"),actionButtonText:"Add"};case h.X.reduce:return{inputHeader:"How much of ".concat(t," (").concat(n,") do you want to remove from your Draft Portfolio?"),actionButtonText:"Reduce"}}})(e.mode,e.securityLabel,e.ticker),D=()=>{o.submit()},R=(0,u.JO)(o)||i,N=async n=>{let{investmentAmount:a,directSellProceedsToMoneyMarket:r}=n,i=(e=>{let{userEnteredAmount:t,amountUpdateMode:n}=e;switch(n){case h.X.add:case h.X.increment:return t;case h.X.reduce:return -1*t}})({userEnteredAmount:a,amountUpdateMode:e.mode});try{let n=(0,y.v5)(t,i);b(!0),await e.onInvestmentUpdate(n,{directSellProceedsToMoneyMarket:r})}finally{b(!1),o.resetFields()}};return(0,a.FD)(f.gR,{"data-sentry-element":"UpdateInvestmentAmountContainer","data-sentry-component":"RecommendedInvestmentUpdateForm","data-sentry-source-file":"recommendedInvestmentUpdateForm.tsx",children:[(0,a.Y)(f.wh,{"data-sentry-element":"InputHeaderLabel","data-sentry-source-file":"recommendedInvestmentUpdateForm.tsx",children:E}),(0,a.FD)(f.En,{"data-sentry-element":"AmountLabelContainer","data-sentry-source-file":"recommendedInvestmentUpdateForm.tsx",children:["Amount of ",e.ticker]}),(0,a.Y)(f.MG,{className:"!pb-0","data-sentry-element":"FormContainer","data-sentry-source-file":"recommendedInvestmentUpdateForm.tsx",children:(0,a.FD)(f.q,{form:o,name:"updateInvestmentForm",initialValues:{[S.investmentAmount]:w,[S.directSellProceedsToMoneyMarket]:F},onFinish:N,"data-sentry-element":"StyledForm","data-sentry-source-file":"recommendedInvestmentUpdateForm.tsx",children:[(0,a.Y)(f.WZ,{name:S.investmentAmount,label:null,required:!0,messageVariables:{name:"Investment amount"},rules:[{required:!0,message:"Investment amount is required"},{type:"number",min:+!F,max:T,message:F?"Investment amount must be between 0 and ".concat(T,"."):"Investment amount must be at least 1."}],extra:k?(0,a.Y)(g.A,{optimalAmount:I,sourceCurrency:t,targetCurrency:t}):null,"data-sentry-element":"AmountInputFormItem","data-sentry-source-file":"recommendedInvestmentUpdateForm.tsx",children:(0,a.Y)(A.J$,{size:"lg",humanizeNumber:!0,addonBefore:n,"data-sentry-element":"AmountInput","data-sentry-source-file":"recommendedInvestmentUpdateForm.tsx"})}),F?(0,a.FD)(r.Fragment,{children:[(0,a.Y)(u.eI,{shouldUpdate:!0,children:(0,a.Y)(x.Ay,{title:C?(0,a.FD)(r.Fragment,{children:["Sell the position and invest the proceeds in a ",(0,a.Y)("b",{children:"money market fund"})," with very low risk and better-than-cash returns"]}):(0,a.FD)(r.Fragment,{children:["Sell the position and credit the proceeds as ",(0,a.Y)("b",{children:"cash"})]}),placement:"topLeft",children:(0,a.Y)(l.$n,{variant:"filled",disabled:R,onClick:D,loading:i,children:Y})})}),(0,a.Y)(u.eI,{name:S.directSellProceedsToMoneyMarket,valuePropName:"checked",noStyle:!0,rules:[{type:"boolean"}],children:(0,a.Y)(f.Ao,{disabled:i,children:"Keep cash in interest-earning money market fund"})})]}):(0,a.Y)(l.$n,{variant:"filled",disabled:R,onClick:D,loading:i,children:Y})]})})]})};
3var C=n(47489),I=n(99147),w=n(84400),P=n(13340),k=n(21440),F=n(11325),T=n(92672),E=n(39715);let Y=e=>{let t=(0,E.GW)(Math.abs(e),{fractionDigits:1});return e<0?"(".concat(t,"% using leverage)"):"(".concat(t,"%)")};var D=n(62570),R=n(36934),N=n(23462),M=n(544),L=n(99026),_=n(95825),O=n(35208),W=n(85505),B=n(21533),U=n(27234);let z=e=>{let[t,n]=r.useState(!1),{preferredCurrencySymbol:o}=(0,v._)(),[i]=(0,u.mN)(),s=Number.MIN_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER,m=async t=>{let{amount:a}=t;try{n(!0),await e.onSubmit({ticker:O.Rm,amount:a,quantity:a,currentPrice:null,isFixedAmount:!0})}finally{n(!1)}e.onClose()};return(0,a.FD)(_.Ay,{title:"Edit cash",centered:!0,open:!0,destroyOnClose:!0,closable:!1,maskClosable:!1,keyboard:!1,size:_.rI.Sm,onCancel:e.onClose,okText:"Save",okButtonProps:{disabled:(0,u.JO)(i),loading:t,htmlType:"submit"},onOk:()=>{i.submit()},cancelButtonProps:{children:"Discard"},"data-sentry-element":"Modal","data-sentry-component":"PortfolioCashEditorModal","data-sentry-source-file":"PortfolioCashEditor.tsx",children:[(0,a.Y)(u.lV,{form:i,layout:"vertical",name:"portfolioCashEditor",onFinish:m,colon:!1,requiredMark:!1,initialValues:{amount:e.initialCashAmount},"data-sentry-element":"Form","data-sentry-source-file":"PortfolioCashEditor.tsx",children:(0,a.Y)(u.eI,{name:"amount",label:"Brokerage cash",required:!0,messageVariables:{name:"Amount"},rules:[{type:"number",min:s,max:c},{validator:(0,B.de)(B.wx)}],shouldUpdate:!0,"data-sentry-element":"FormItem","data-sentry-source-file":"PortfolioCashEditor.tsx",children:(0,a.Y)(W.A,{size:"lg",humanizeNumber:!0,addonBefore:o,"data-sentry-element":"CurrencyInput","data-sentry-source-file":"PortfolioCashEditor.tsx"})})}),d.TjK(e=>(0,a.FD)(l.Ah,{width:"100%",alignItems:"flex-start",justifyContent:"flex-start",itemsSpacingHorizontal:16,children:[(0,a.Y)(U.i,{investmentItem:e,compactMode:!0},e.ticker),":"," ",(0,a.Y)(F.eF,{amount:e.amount,sourceCurrency:P.mF,currencyFormatter:F.EB.HumanizedLiteralAmount})]},e.ticker),e.cashPortfolioInvestableItems)]})},V=e=>{let{value:t,setTrue:n,setFalse:o}=(0,p.A)(!1);return(0,a.FD)(r.Fragment,{children:[e.render(()=>{n()}),t?(0,a.Y)(z,{...e,onClose:()=>{o(),e.onClose()}}):null]})};var j=n(81671);function H(){let e=(0,w._)(["\n    padding: 0px;\n    .portfolioCashHoldings-CashContainer {\n      font-size: 0.875rem;\n      font-weight: 400;\n      line-height: 1.5;\n      color: rgb(115 115 115);\n    }\n  "]);return H=function(){return e},e}let q=(0,D.A)(e=>{let{cashLabel:t="Cash",cashAmount:n,cashInvestableFraction:o,isCashPercentVisible:i=!1,isLeveragedAlertEnabled:s=!1,className:c,extraAction:d,isLoading:u}=e;return(0,a.FD)(k.Xp,{className:c,"data-sentry-element":"CashHoldingsContainer","data-sentry-component":"PortfolioCashHoldings","data-sentry-source-file":"index.tsx",children:[(0,a.FD)(k.F_,{className:"portfolioCashHoldings-CashContainer","data-sentry-element":"CashContainer","data-sentry-source-file":"index.tsx",children:[(0,a.FD)(T.Ah,{"data-sentry-element":"FlexLayout","data-sentry-source-file":"index.tsx",children:[t,":"," ",(0,a.Y)(F.eF,{showLoader:u,amount:n,sourceCurrency:P.mF,currencyFormatter:F.EB.HumanizedLiteralAmount,"data-sentry-element":"CurrencyAmount","data-sentry-source-file":"index.tsx"}),i&&(0,a.FD)(r.Fragment,{children:["\xa0",Y(o)]})]}),d&&(0,a.Y)("div",{children:d})]}),s&&o<0&&(0,a.Y)(l.Fc,{status:"warning",variant:"light",title:"You're investing with borrowed money (leverage). Sell some holdings to reduce it, unless that's on purpose."})]})},{target:"e10pnis10"})(()=>[(0,N.AH)(H())]),G=(0,D.A)(R.st,{target:"e10pnis11"})("padding-top:8px;"),K=e=>{let{isLoading:t,cashInvestableAmount:n,aggregateMoneyMarketAmount:r,cashInvestableFraction:o}=e,i=P.mF,s=F.EB.HumanizedLiteralAmount;return(0,a.FD)(l.Ah,{display:"block","data-sentry-element":"FlexLayout","data-sentry-component":"PortfolioCashInvestableSummary","data-sentry-source-file":"PortfolioTableCashHoldings.tsx",children:[(0,a.FD)(R.lc,{className:"text-body","data-sentry-element":"Body1W600","data-sentry-source-file":"PortfolioTableCashHoldings.tsx",children:["Total cash investable:"," ",(0,a.Y)(F.eF,{showLoader:t,amount:n,sourceCurrency:i,currencyFormatter:s,"data-sentry-element":"CurrencyAmount","data-sentry-source-file":"PortfolioTableCashHoldings.tsx"}),"\xa0",Y(o)]}
3),(0,a.FD)(G,{"data-sentry-element":"MoneyMarketFundsMessage","data-sentry-source-file":"PortfolioTableCashHoldings.tsx",children:["Money market funds:"," ",(0,a.Y)(F.eF,{showLoader:t,amount:r,sourceCurrency:i,currencyFormatter:s,"data-sentry-element":"CurrencyAmount","data-sentry-source-file":"PortfolioTableCashHoldings.tsx"})]})]})},Q=e=>{let{isLoading:t,portfolioInvestmentItems:n,cashFraction:r,isLeveragedAlertEnabled:o,isCashInvestableEditable:s,includeMoneyMarketAsCashInvestable:c}=e,{aggregateMoneyMarketAmount:u,cashInvestableAmount:m,portfolioCashAndCashPortfolioInvestableCashAmount:p,cashPortfolioItemAmount:y,cashInvestableFraction:h}=(e=>{let t=d.I6j(M.t,e),n=d.vUk(0,null==t?void 0:t.amount),a=d.vUk(0,null==t?void 0:t.weight),r=(0,M.Jv)(e),o=d.czq(d.EyX("amount",r)),i=d.czq(d.EyX("weight",r)),l=d.pbD(M.IA,e),s=d.czq(d.EyX("amount",l)),c=d.czq(d.EyX("weight",l));return{cashPortfolioItem:t,cashPortfolioItemAmount:n,cashPortfolioItemFraction:a,moneyMarketPortfolioItems:l,aggregateMoneyMarketAmount:s,cashInvestableAmount:n+s+o,cashInvestableFraction:a+i+c,portfolioCashAndCashPortfolioInvestableCashAmount:n+o}})(n);return(0,a.FD)(l.Ah,{flexDirection:"column",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",marginBottom:8,"data-sentry-element":"FlexLayout","data-sentry-component":"PortfolioTableCashHoldings","data-sentry-source-file":"PortfolioTableCashHoldings.tsx",children:[c?(0,a.Y)(K,{isLoading:t,cashInvestableAmount:m,cashInvestableFraction:h,aggregateMoneyMarketAmount:u}):null,(0,a.Y)(q,{cashLabel:i.yC.CashInvestable,cashAmount:p,cashInvestableAmount:m,cashInvestableFraction:h,cashFraction:r,isLeveragedAlertEnabled:o,isLoading:t,extraAction:s?(0,a.Y)(V,{cashPortfolioInvestableItems:(0,M.Jv)(n),initialCashAmount:y,render:e=>(0,a.Y)(l.$n,{onClick:e,size:"sm",isIconOnly:!0,variant:"ghost",color:"neutral",children:(0,a.Y)(l.In,{icon:j.$.Pencil,size:16})}),onSubmit:e.onEditCashInvestableAmount,onClose:L.lQ}):null,"data-sentry-element":"StyledPortfolioCashHoldings","data-sentry-source-file":"PortfolioTableCashHoldings.tsx"})]})};var $=n(17143),X=n(48779),J=n(31272),Z=n(40262);let ee=l.XI,et=e=>{let{sortInvestments:t,includeCash:n,investmentItems:r,hideMoneyMarketLineItems:o=!1}=e,i=(0,Z.pI)({investmentItems:r,includeCash:n,sortInvestments:t,hideMoneyMarketLineItems:o}),s=d.vUk(!1,e.readonly),c=!s&&!!e.onCustomizeInvestmentItem,u=!s,m=async t=>{await e.onRemoveInvestmentItem(t),await (0,L.yy)(2e3)},p=async t=>{var n;await (null==(n=e.onCustomizeInvestmentItem)?void 0:n.call(e,t))},y=async(t,n)=>{var a;await (null==(a=e.onInvestmentAmountInputBlur)?void 0:a.call(e,t,n))},h=[{title:(0,a.Y)(I.W$,{children:"Securities"}),dataIndex:"investment",key:"investment",render:(t,n)=>(0,a.Y)("div",{style:{minWidth:120},children:(0,a.Y)(U.i,{compactMode:!0,investmentItem:n,forceProxiedSecurityMode:(0,$.AT)(n.ticker,e.proxyMappedTickers)})}),fixed:"left"},{title:(0,a.Y)(I.W$,{children:"Market value"}),dataIndex:"amount",key:"amount",render:(t,n)=>{if(s)return(0,a.Y)(F.eF,{amount:t,sourceCurrency:P.mF,currencyFormatter:F.EB.HumanizedLiteralAmount});{let r=e.investmentAmountInputKeyGetter(n),o=s||!!e.disableAmountInput;return(0,a.Y)(I.cy,{children:(0,a.Y)(I.c8,{value:t,min:(0,M.t)(n)?void 0:X.Jo,onChange:t=>{let a=Number(t),r=Number.isNaN(a)?0:a;e.onInvestmentItemAmountUpdate(n.ticker,r)},onBlur:e=>y(e,n),disabled:o,addonBefore:e.currencySymbol},r)})}},width:176,align:"right"},{title:(0,a.Y)(I.W$,{children:"Weight"}),dataIndex:"weight",key:"weight",render:e=>(0,J.ZN)(e,{formatToPercent:!0}),width:88,align:"right"},{hide:!c,title:null,align:"center",dataIndex:"customizeInvestment",key:"customizeInvestment",render:(e,t)=>(0,M.t)(t)?null:(0,a.Y)(I.du,{onClick:async()=>p(t),disabled:s,disabledTooltip:{title:"Edit in draft mode"}}),width:48},{hide:!u,title:null,align:"center",dataIndex:"remove",key:"remove",render:(e,t)=>(0,M.t)(t)?null:(0,a.Y)(I.YT,{variant:"ghost",color:"danger",isIconOnly:!0,onClick:()=>m(t.ticker),disabled:s,disabledTooltip:{title:"Edit in draft mode"},children:(0,a.Y)(l.In,{icon:j.$.TrashCan,size:16})}),width:48}];return(0,a.Y)(ee,{dataSource:i,rowKey:e=>e.ticker,pagination:!1,columns:h,isStriped:!1,"data-sentry-element":"StyledPortfolioListingTable","data-sentry-component":"PortfolioInvestmentsTable","data-sentry-source-file":"PortfolioInvestmentsTable.tsx"})};var en=n(15751),ea=n(13641),er=n(62346),eo=n(25447),ei=n(87351),el=n(39633);let es=e=>{let{portfolioId:t,changedPortfolio:n}=e,o=(0,er.eD)(),{data:i,isLoading:s}=o,[c]=(0,el.A)(n,500);return(r.useEffect(()=>{o.mutateAsync({portfolioId:t,changedPortfolio:c})},[c,t]),s)?(0,a.Y)(l.y$,{text:"Calculating Portfolio Score, expected returns and divi
3dend impact"}):i?(0,a.FD)(r.Fragment,{children:[(0,a.Y)(eo.aY,{currentScoreConfig:{score:i.originalScore,portfolioLabel:"Current"},impactedScoreConfig:{score:i.changedScore,portfolioLabel:"Edited"},portfolioId:t,"data-sentry-element":"OptimizerChangeScoreImpact","data-sentry-source-file":"PortfolioOnFlyComparison.tsx"}),(0,a.Y)(ei.A,{expReturns:{optimizedValue:i.changedReturn,previousValue:i.originalReturn},dividendReturns:{optimizedValue:i.changedDividendAmount,previousValue:i.originalDividendAmount},"data-sentry-element":"ReturnsChanged","data-sentry-source-file":"PortfolioOnFlyComparison.tsx"})]}):null};var ec=n(43608);let ed=e=>{var t;let{activePortfolio:n,defaultUpsertTicker:o}=e,{preferredCurrencySymbol:s}=(0,v._)(),{data:c,isLoading:d}=(0,ec.y)(n.portfolioId),u=(0,M.uF)(n),{isPortfolioCashEditable:m,portfolioInvestmentItems:p=[],isPortfolioItemsFetching:y,isPortfolioItemsLoading:h,isPortfolioItemsLoadError:f,isRefetchingInvestmentItems:g,amountFieldSynchronizerKey:x,isTableDataReadOnly:A,securityManagementWorkflowVisible:S,securityManagementWorkflowParams:w,bulkPortfolioUploadMutation:P,handleRemoveInvestment:k,handleInvestmentItemAmountUpdate:F,handleInvestmentFormUpsert:E,handleInvestmentAmountInputBlur:Y,handleCustomizeInvestmentItem:D,proxyMappedTickers:N,handleSuggestedSecuritySelected:L,handleProxyWorkflowInvestmentSubmit:_,handleProxyMappingUpserted:O,handleProxyMappingReset:W,handleInvestmentUpsert:B,exitSecurityManagementWorkflow:U,hasOnFlyInvestmentItemsChanged:z,onFlyInvestmentItems:V,setInvestmentFormUpsertValues:j}=(0,en.S)(e);return P.isLoading?(0,a.FD)(T.Ah,{itemsSpacingHorizontal:8,children:[(0,a.Y)(R.RF,{className:"text-body",children:"Saving your changes"}),(0,a.Y)(l.y$,{})]}):h?(0,a.Y)(l.y$,{}):(0,a.FD)(r.Fragment,{children:[(0,a.FD)(T.Ah,{flexDirection:"column",flexWrap:"nowrap",justifyContent:"flex-start",alignItems:"stretch",itemsSpacingVertical:24,occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"PortfolioInvestmentsListing.tsx",children:[(0,a.Y)(I.n_,{"data-sentry-element":"PortfolioTableActionsContainer","data-sentry-source-file":"PortfolioInvestmentsListing.tsx",children:(()=>{let{investmentUpdateProps:t}=e;switch(e.mode){case i.jy.NewPortfolio:case i.jy.EditPortfolio:return(0,a.Y)(C.A,{includeSharesInputCount:!1,existingInvestmentItems:p,onSuggestedSecuritySelected:L,onProxyWorkflowInvestmentSubmit:_,onSubmit:E,disableForm:y||f,defaultUpsertTicker:o,onFormChange:j});case i.jy.ApplyRecommendation:if(t){let{investmentDetails:e,onInvestmentUpdate:n}=t,{securityLabel:r,suggestedAmount:o,existingAmount:i,modifiedAmount:l,mode:s,ticker:c}=e;return(0,a.Y)(b,{securityLabel:r,ticker:c,existingAmount:i,suggestedAmount:o,modifiedAmount:l,onInvestmentUpdate:n,mode:s})}}return null})()}),z?(0,a.Y)(es,{portfolioId:n.portfolioId,changedPortfolio:V}):null,(0,a.FD)("div",{children:[(0,a.Y)(Q,{isCashInvestableEditable:m&&!A,onEditCashInvestableAmount:B,isLoading:y||d,portfolioInvestmentItems:p,cashFraction:null!=(t=null==c?void 0:c.cashPercentage)?t:0,isLeveragedAlertEnabled:u,includeMoneyMarketAsCashInvestable:u,"data-sentry-element":"PortfolioTableCashHoldings","data-sentry-source-file":"PortfolioInvestmentsListing.tsx"}),(0,a.Y)(et,{hideMoneyMarketLineItems:u,includeCash:!1,sortInvestments:!0,investmentItems:p,proxyMappedTickers:N,currencySymbol:s,onRemoveInvestmentItem:k,onInvestmentAmountInputBlur:Y,investmentAmountInputKeyGetter:e=>"".concat(e.ticker).concat(g).concat(x),onInvestmentItemAmountUpdate:F,onCustomizeInvestmentItem:D,readonly:A,"data-sentry-element":"PortfolioInvestmentsTable","data-sentry-source-file":"PortfolioInvestmentsListing.tsx"})]})]}),S&&w?(0,a.Y)(ea.N,{contextPortfolio:n,...w,onInvestmentDetailsSubmitted:_,onProxyMappingUpserted:O,onProxyMappingRemoved:W,onClose:U}):null]})};var eu=n(88105),em=n(1482);let ep=e=>{let{activePortfolio:t,mode:n,defaultUpsertTicker:s}=e,c=r.useRef(async()=>!1),{launchUnsavedChangesModal:d}=(0,eu.y)(),{launchDraftPortfolioProperties:u}=(0,em.U)(),[m,p]=r.useState(!1),{isFetching:y}=(0,er.OM)(t.portfolioId),h=(0,M.uF)(t),f=n===i.jy.EditPortfolio,g=!!e.okText,v=e.okText?e.okText:void 0,x=e.cancelText?e.cancelText:"Close",A=async()=>{var t;p(!1),null==(t=e.onClose)||t.call(e,{isPortfolioChanged:!1})},S=async()=>{var t;f&&await c.current({shouldPersistChanges:!0}),null==(t=e.onClose)||t.call(e,{isPortfolioChanged:m})},b=async()=>{let e=await c.current({shouldPersistChanges:!1});f&&e?d({onDiscard:A,onSave:S}):await A()},C={visible:h,actionLabel:"Edit portfolio properties",disabled:m,disabledTooltipTitle:"Save or cancel changes to edit properties",onClick:async()=>{u(t),await A()}},I=(0,a.FD)(o.tb,{children:[C.visible?(0,a.Y)(l.$n,{onClick:C.onClick,variant:"outlined",disabled:C.disabled,disabledTooltip:{title:C.disabledTooltipTitle},children:C.actionLabel}):null,(0,a.Y)(l.$n,{onClick:b,children:x}),g?(0,a.Y)(l.$n,{onClick:S,variant:"filled",disabled:y,children:v}):null]});return(0,a.Y)(o._s,{width:700,title:(()=>
3{if(e.title)return e.title;let n=t.portfolioName;return e.mode===i.jy.EditPortfolio?"".concat(n," (Edit mode)"):n})(),open:!0,onClose:b,destroyOnClose:!0,closable:!0,maskClosable:!0,footer:I,"data-sentry-element":"Drawer","data-sentry-component":"PortfolioTableDrawer","data-sentry-source-file":"PortfolioTableDrawer.tsx",children:(0,a.Y)(ed,{savePortfolioActionRef:c,activePortfolio:t,onPortfolioChanged:p,onPortfolioChangePersisted:()=>{p(!0)},mode:n,investmentUpdateProps:e.investmentUpdateProps,defaultUpsertTicker:s,"data-sentry-element":"PortfolioInvestmentsListing","data-sentry-source-file":"PortfolioTableDrawer.tsx"})})}},35820:(e,t,n)=>{n.d(t,{Kz:()=>p,Ne:()=>l,Q$:()=>i,X$:()=>m,fw:()=>d,lT:()=>s,lX:()=>o,mV:()=>y,rc:()=>c,uy:()=>u});var a=n(33624),r=n(17440);let o=[{value:r.Th.US,label:"United States",selectedLabel:"US"},{value:r.Th.CA,label:"Canada",selectedLabel:"CA"}],i=[{value:r.BB.Large,label:"Large",selectedLabel:"Large"},{value:r.BB.Mid,label:"Mid",selectedLabel:"Mid"},{value:r.BB.Small,label:"Small",selectedLabel:"Small"}],l=a.FsL(a.HPH,a.Uln(a.D_O),a.TjK(e=>({value:r.vm[e],label:r.vm[e],selectedLabel:r.vm[e]})))(r.vm);var s=function(e){return e.SeriesName="Security name",e.Ticker="Ticker",e.ExpectedReturns="Expected return",e.Beta="Beta",e.PERatio="P/E Ratio",e.SharpeRatio="Sharpe Ratio",e.Volatility="Volatility",e.InflationExposure="Inflation exposure",e.GrowthExposure="Growth exposure",e.LiquidityExposure="Liquidity exposure",e.CommodityExposure="Commodity exposure",e.AddToDraft="Add to draft",e}({});let c=[{compactMode:!0,hideCellLabels:!0,maxSelectable:2,defaultSelectedColumns:["Expected return","Add to draft"]},{compactMode:!0,hideCellLabels:!0,maxSelectable:3,defaultSelectedColumns:["Expected return","Beta","Add to draft"]},{compactMode:!0,hideCellLabels:!0,maxSelectable:4,defaultSelectedColumns:["Expected return","Beta","P/E Ratio","Add to draft"]},{compactMode:!0,hideCellLabels:!0,maxSelectable:5,defaultSelectedColumns:["Expected return","Beta","P/E Ratio","Sharpe Ratio","Add to draft"]},{compactMode:!0,hideCellLabels:!0,maxSelectable:6,defaultSelectedColumns:["Expected return","Beta","P/E Ratio","Sharpe Ratio","Volatility","Add to draft"]},{compactMode:!0,hideCellLabels:!0,defaultSelectedColumns:["Expected return","Beta","P/E Ratio","Sharpe Ratio","Volatility","Inflation exposure","Commodity exposure","Liquidity exposure","Growth exposure","Add to draft"],maxSelectable:10}],d=a.EyX("value",l),u=a.EyX("value",i),m=a.EyX("value",o),p=!1,y=["Expected return","Sharpe Ratio"]},35974:(e,t,n)=>{n.d(t,{g:()=>l,h:()=>c});var a=n(43948),r=n(41686),o=n(67759),i=n(4603);let{useDemoModeExitListener:l,emitDemoModeExit:s}=(0,a.createEvent)("DemoModeExit")(),c=e=>(0,r.E0)(()=>{(0,o.trackDemoMode)({event:i.DemoModeEvent.Exited,reason:e.reason}),s(e)})},36214:(e,t,n)=>{n.d(t,{XN:()=>c,hh:()=>d,vv:()=>s,yi:()=>l});var a=n(73590),r=n.n(a);let o=e=>Number.isFinite(e)?e:null,i=[1,2,5],l=e=>({gridLineColor:e.gridLineColor,gridLineWidth:e.gridLineWidth,gridLineDashStyle:"Solid",startOnTick:!0,endOnTick:!0,tickPositioner:function(){let e=this.getExtremes();return(e=>{let t=o(e.dataMin),n=o(e.dataMax);if(null===t||null===n||n<=t)return;let a=(e=>{let t=e/8,n=Math.pow(10,Math.floor(Math.log10(t)));return i.reduce((e,a)=>a*n<=t?a*n:e,n)})(n-t);return[Math.floor(t/a)*a,Math.ceil(n/a)*a]})({dataMin:e.dataMin,dataMax:e.dataMax})},labels:{enabled:e.hasLabels,style:{color:e.labelColor,fontSize:e.labelFontSize},formatter:e.labelFormatter}}),s="trend-today",c=e=>{let t={className:e.className,width:e.width,color:e.color},n=o(e.historyStart),a=o(e.todaySeparator);return[...null===n?[]:[{value:n,...t}],...null===a?[]:[{value:a,...t,id:s}]]},d=e=>({gridLineWidth:0,tickPositioner:function(){return(e=>{let t=o(e.axisMin),n=o(e.axisMax);if(null===t||null===n)return[];let a=o(e.todaySeparator);return null===a||a<=t||a>n?[t]:[t,a]})({axisMin:this.min,axisMax:this.max,todaySeparator:e.todaySeparator})},labels:{style:{color:e.labelColor,fontSize:e.labelFontSize},formatter:function(){var t={value:this.value,todaySeparator:e.todaySeparator};let n=o(t.value);return null===n?"":n===t.todaySeparator?"Today":r()(n).format("YYYY")}},plotLines:c({historyStart:e.historyStart,todaySeparator:e.todaySeparator,color:e.plotLineColor,width:e.plotLineWidth,className:e.plotLineClassName})})},36559:(e,t,n)=>{n.d(t,{H5:()=>i,ti:()=>o,wZ:()=>r});var a=n(98868);let r={[a.R$.Conservative]:"Conservative",[a.R$.ModeratelyConservative]:"Moderately conservative",[a.R$.ModeratelyAggressive]:"Moderately aggressive",[a.R$.Aggressive]:"Aggressive",[a.R$.VeryAggressive]:"Very aggressive",[a.R$.Extreme]:"Extreme",[a.R$.NoRisk]:"No risk"},o={[a.R$.Conservative]:{volatility:4,downturns:10},[a.R$.ModeratelyConservative]:{volatility:8,downturns:20},[a.R$.ModeratelyAggressive]:{volatility:12,downturns:30}
3,[a.R$.Aggressive]:{volatility:16,downturns:40},[a.R$.VeryAggressive]:{volatility:20,downturns:50},[a.R$.Extreme]:{volatility:">20",downturns:60},[a.R$.NoRisk]:{volatility:"N/A",downturns:"N/A"}},i=[a.R$.Extreme,a.R$.NoRisk]},36608:(e,t,n)=>{n.d(t,{A:()=>u});var a=n(88963),r=n(62031),o=n.n(r),i=n(13125),l=n.n(i),s=n(7802);let c=(e,t)=>{let n="object"!=typeof e||null===e||Array.isArray(e)?{}:o()(e);if("string"!=typeof n.linkToken||0===n.linkToken.length)throw Error("create_link_token returned no link_token for ".concat(t));return{linkToken:n.linkToken,providerAccountId:"string"==typeof n.providerAccountId?n.providerAccountId:null}};class d{constructor(){this.getPlaidToken=async(e,t)=>c(await this.apiCaller.post("/create_link_token",l()({reconnectConnectionId:t,broker:e})),s.$5.Plaid).linkToken,this.getSnapTradeLinkToken=async(e,t,n,a)=>{let r=l()({accountProvider:s.$5.SnapTrade,redirectUrl:e,reconnectConnectionId:n,enableTrading:a,broker:t});return c(await this.apiCaller.post("/create_link_token",r),s.$5.SnapTrade).linkToken},this.getYodleeLinkToken=async e=>{let t=l()({accountProvider:s.$5.Yodlee,reconnectConnectionId:e}),n=c(await this.apiCaller.post("/create_link_token",t),s.$5.Yodlee);return{token:n.linkToken,providerAccountId:n.providerAccountId}},this.exchangePlaidToken=async e=>{let{publicToken:t,reconnectingAccountId:n}=e,a=await this.apiCaller.post("/exchange_public_token",{public_token:t,account_provider:s.$5.Plaid,id:n});return o()(a)},this.exchangeYodleeToken=async e=>{let{providerId:t,reconnectingAccountId:n,providerAccountId:a}=e,r=await this.apiCaller.post("/exchange_public_token",l()({providerId:t,account_provider:s.$5.Yodlee,providerAccountId:a,id:n}));return o()(r)},this.apiCaller=new a.Ay}}let u=new d},37138:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(57090),r=n(12115),o=n(29290),i=n(18281);let l=e=>{let{render:t}=e,{launchStatementsUploader:n}=(0,o._)();return(0,a.Y)(r.Fragment,{children:t(()=>{n({dataDomain:i.SN.Anything})})})}},37699:(e,t,n)=>{n.d(t,{qe:()=>c,ZS:()=>i,F5:()=>d,Ho:()=>u,Bj:()=>m,jP:()=>s,VE:()=>l});var a=n(33624),r=n(84245),o=n(99026);let i=(e,t)=>a.I6j(t=>t.id===e,t),l=e=>!!(null==e?void 0:e.isActive),s=e=>a.kuo(l,e),c=e=>a.pbD(l,e),d=(e,t)=>i(t,(0,o.TN)(e.getQueryData(r.u$))),u=(e,t)=>a.hL5((e,t)=>a.bzn(e=>{var n;return(null==(n=e.portfolioSummary)?void 0:n.portfolioId)===t.portfolioId},e.subAccounts),e,t),m=(e,t)=>a.iv2(e,u(e,t))},37722:(e,t,n)=>{n.d(t,{m5:()=>i});var a=n(12115);let r={showEditor:!1,parsedInvestmentItems:null,normalizedUserUploadedData:null},o=(e,t)=>{switch(t.type){case"launchEditor":return{...e,showEditor:!0,parsedInvestmentItems:t.payload.parsedInvestmentItems,normalizedUserUploadedData:t.payload.normalizedUserUploadedData};case"closeEditor":return{...r};default:throw Error("Unhandled Action Type for Portfolio Editor Reducer")}},i=()=>a.useReducer(o,r)},37899:(e,t,n)=>{n.d(t,{A:()=>d,o:()=>c});var a=n(57090),r=n(12115),o=n(51604),i=n(74547),l=n(73314),s=n(41686);let c=e=>{let{className:t="",children:n="Report security issue",ticker:c}=e,{launchIssueReport:d}=(0,o.$)(),[u,m]=r.useState(!1),p=async()=>{u||(m(!0),(0,s.E0)(async()=>{await d({ticker:c,issueType:l.s.SECURITY_ISSUE,onOpened:()=>m(!1)})}))};return(0,a.Y)(i.N_,{color:"accent",className:t,onClick:p,loading:u,isDisabled:u,"data-sentry-element":"Link","data-sentry-component":"ReportSecurityIssueLink","data-sentry-source-file":"ReportDataIssueLink.tsx",children:n})},d=e=>{let{className:t="",children:n="Report an issue"}=e,{launchIssueReport:c}=(0,o.$)(),[d,u]=r.useState(!1),m=async()=>{d||(u(!0),(0,s.E0)(async()=>{await c({issueType:l.s.DATA_ISSUE,onOpened:()=>u(!1)})}))};return(0,a.Y)(i.N_,{color:"accent",className:t,onClick:m,loading:d,isDisabled:d,"data-sentry-element":"Link","data-sentry-component":"ReportDataIssueLink","data-sentry-source-file":"ReportDataIssueLink.tsx",children:n})}},38240:(e,t,n)=>{n.d(t,{e:()=>a.A});var a=n(80435)},38484:(e,t,n)=>{n.d(t,{A$:()=>x,Lu:()=>S,R4:()=>w,Vn:()=>P,X_:()=>h,a9:()=>g,bC:()=>b,dR:()=>C,lT:()=>p,mn:()=>E,tt:()=>F,w6:()=>I});var a=n(67891),r=n(81527),o=n(35208),i=n(48298),l=n(17667),s=n(6976),c=n(45424),d=n(50908);let u={assetClasses:["SecurityManagement","assetClasses"],countries:["SecurityManagement","countries"],countriesAlphaThree:["SecurityManagement","countriesAlphaThree"],sectors:["SecurityManagement","sectors"],bondTypes:["SecurityManagement","bondTypes"],securityTickerDetails:e=>["SecurityManagement","securityTickerDetails",{securityTicker:e}
3],investmentSecurityProxyDetails:e=>["SecurityManagement","investmentSecurityProxyDetails",{investmentTicker:e}]},m=async()=>i.Ay.getSecurityManagementAssetClasses(),p=()=>(0,r.I)(u.assetClasses,m,{...o.Lo}),y=async()=>i.Ay.getSecurityManagementCountries(),h=()=>(0,r.I)(u.countries,y,{...o.Lo}),f=async()=>i.Ay.getCountriesAlphaThree(),g=()=>(0,r.I)(u.countriesAlphaThree,f,{...o.Lo}),v=async()=>i.Ay.getSecurityManagementSectors(),x=()=>(0,r.I)(u.sectors,v,{...o.Lo}),A=async()=>i.Ay.getSecurityManagementBondTypes(),S=()=>(0,r.I)(u.bondTypes,A,{...o.Lo}),b=async(e,t)=>i.Ay.getSecurityTickerStats(e,t),C=()=>{let e=async e=>{let t=["Ticker Details",e.ticker],n=c.q.getQueryData(t);return n||(await c.q.prefetchQuery(t,()=>b(e.ticker,e.date),o.Lo),c.q.getQueryData(t))};return(0,l.A)(e)},I=(e,t)=>{let{cachePrefix:n,enableQuery:o}=t,i="".concat(n,":").concat(e);return(0,r.I)(u.securityTickerDetails(i),()=>b(e),{enabled:o&&a.A(e)})},w=async e=>i.Ay.getComprehensiveSecurityProxyDetails(e),P=(e,t)=>{let{cachePrefix:n,enableQuery:o}=t,i="".concat(n,":").concat(e);return(0,r.I)(u.investmentSecurityProxyDetails(i),()=>w(e),{enabled:o&&a.A(e)}
3)},k=async e=>i.Ay.saveSecurityProxyMapping(e),F=()=>{let e=(0,s.Vi)();return(0,l.A)(async t=>{let{networthDetail:n}=t;n?await e.mutateAsync([n]):await k(t)},{onErrorMessage:()=>"We could not save this security. Please try again."})},T=async e=>i.Ay.resetSecurityProxyMapping(e),E=()=>{let e=(0,s.Vi)();return(0,l.A)(async t=>{let{investmentTicker:n,networthDetail:a}=t;return a?void await e.mutateAsync([(e=>(0,d.r)(e,{name:e.additionalDetail.name,assetClass:null,sector:null,oneYearExpectedReturn:null,country:null,risk:null}))(a)]):T(n)},{onErrorMessage:()=>"We could not reset this security. Please try again."})}},38738:(e,t,n)=>{n.d(t,{Ff:()=>r,PR:()=>a,Qi:()=>i,XW:()=>o});var a=function(e){return e.LastWillAndTestament="will_and_testament",e.DesignatedBeneficiaries="designated_beneficiaries",e.AdvanceHealthcareDirective="advance_healthcare_directive",e.LifeInsurance="life_insurance",e.DigitalAssetsPlan="digital_assets_plan",e.SelectedGuardianForMinorChildren="selected_guardian_for_minor_children",e.LivingTrust="living_trust",e.EstateTaxImplications="estate_tax_implications",e}({}),r=function(e){return e.CompleteChecklistReminder="reminder_to_complete_the_checklist",e.NotifyForYearlyReview="notify_to_review_every_year",e}({}),o=function(e){return e.Free="free",e.Paid="paid",e}({}),i=function(e){return e.TemplateAndTools="template_and_tools",e.Articles="articles",e}({})},39040:(e,t,n)=>{n.d(t,{Hj:()=>a,I$:()=>o,vZ:()=>r});var a=function(e){return e.Equities="Equities",e.FixedIncome="Fixed Income",e.Commodities="Commodities",e.RealEstate="Real Estate",e.Cryptocurrencies="Cryptocurrencies",e.CashAndEquivalents="Cash & Equivalents",e.Currencies="Currencies",e.Unknown="Unknown",e}({}),r=function(e){return e.USLargeCapEquities="US Large Cap Equities",e.USMidCapEquities="US Mid Cap Equities",e.USSmallCapEquities="US Small Cap Equities",e.DevelopedTotalMarketEquities="Developed Total Market Equities (Ex-US)",e.EmergingTotalMarketEquities="Emerging Total Market Equities",e.PrivateEquity="Private Equity",e.USGovernmentBonds="US Government Bonds",e.USMunicipalBonds="US Municipal Bonds",e.USCorporateBonds="US Corporate Bonds",e.GovernmentMortgageBackedSecurities="Government Mortgage-Backed Securities",e.CommercialMortgageBackedSecurities="Commercial Mortgage-Backed Securities",e.AssetBackedSecurities="Asset-Backed Securities",e.FixedIncomeDerivatives="Fixed Income Derivatives",e.DevelopedTotalMarketBonds="Developed Total Market Bonds",e.EmergingTotalMarketBonds="Emerging Total Market Bonds",e.GlobalInflationLinkedBonds="Global Inflation-linked Bonds",e.Gold="Gold",e.OtherCommodities="Other Commodities",e.RealEstate="Real Estate",e.Cryptocurrencies="Cryptocurrencies",e.CashAndEquivalents="Cash & Equivalents",e.OtherCurrencies="Other Currencies",e.Unknown="Unknown",e.OtherAssets="Other Assets",e}({}),o=function(e){return e.Government="Government",e.Corporate="Corporate",e.Municipal="Municipal",e}({})},39633:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(12115);function r(e,t){let[n,r]=a.useState(e);return a.useEffect(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),[n,r]}},39653:(e,t,n)=>{n.d(t,{Y:()=>u,n:()=>d});var a=n(33624),r=n(84245),o=n(99026);let i=async(e,t)=>Promise.allSettled(a.TjK(e,t)),l=async(e,t)=>Promise.allSettled(a.TjK(async t=>{let{base:n,dependencies:a}=t,r=await i(e,n);return i(e,a),r},t)),s=async(e,t)=>{let n=async()=>await i(e,t.pageSpecificDirectDependencies),r=async()=>await l(e,t.pageSpecificDependenciesWithDependants),o=await Promise.allSettled([n(),r()]),s=async()=>await i(e,t.pageNonSpecificDependencies),c=async()=>await l(e,t.pageNonSpecificDependenciesWithDependants),d=await Promise.allSettled([s(),c()]);return a.Bqz([o,d])},c=async function(e,t,n){let{includeDependencies:o}=n,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",c=(0,r.lU)(t,l),d=await i(e,c.preBase),u=await i(e,c.base),m=o?await s(e,c):[];return a.Bqz([d,u,m])},d=(e,t,n)=>{let{includeDependencies:a}=n;return c(t=>e.cancelQueries(t),t,{includeDependencies:a})},u=async(e,t,n,r)=>{let{includeDependencies:i}=n;return c(async t=>{await e.cancelQueries(t,{exact:!0});let n=e.getQueryCache(),r=a.TjK(e=>e.queryKey,n.getAll()),i=a.pbD(e=>(0,o.I)(e,t),r)||[t],l=a.TjK(async t=>e.invalidateQueries(t,{refetchActive:!0,refetchInactive:!1},{cancelRefetch:!0}),i);await Promise.allSettled(l)}
3,t,{includeDependencies:i},r)}},39655:(e,t,n)=>{n.d(t,{A:()=>p});var a=n(12115),r=n(92332),o=n(33624),i=n(48779),l=n(39633),s=n(62346),c=n(544),d=n(17143),u=n(6558),m=n(38484);let p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.Dh,[t,n]=a.useState(e),p=a.useRef([]),y=(0,d.$S)(t),[h]=(0,l.A)(t,300),f=(0,d.$S)(h),{data:g=[],isLoading:v,isIdle:x}=(0,s.Lp)(h),A=(0,s.qE)(),S=(0,m.dR)(),b=a.useCallback(e=>{n(e)},[]);a.useEffect(()=>{p.current=o.hS4(e=>(0,d.$S)(e.ticker),[...p.current,...g])},[g]);let C=(0,c.yI)(y),I=o.Ime(y),w=(0,u.HM)(t,p.current),P=async e=>{let t=(0,u.HM)(e,p.current);if(!t&&r.A(e)){let n=await A.mutateAsync(e);p.current=o.xWs(p.current,n||[]),t=(0,u.HM)(e,p.current)}return t},k=async e=>{var t;let n=(0,d.$S)(e);return(null==(t=S.data)?void 0:t.ticker)===n?S.data:await S.mutateAsync({ticker:n})};return{inputTicker:t,debouncedInputTicker:h,normalizedInputTicker:y,normalizedDebouncedInputTicker:f,setInputTicker:b,isInputTickerCash:C,isInputTickerEmpty:I,inputTickerOptions:g,suggestedSecurityItems:g,isTickerOptionsLoading:v,isTickerSearchIdle:x,inputTickerDetails:w,portfolioSecuritySuggestionsMutation:A,findMatchedOptionOrFetchSuggestions:P,filterOption:(e,t)=>{let n=g.find(t=>t.value===e);return!!(null==n?void 0:n.label.toLowerCase().includes(t.toLowerCase()))},tickerDetailsMutation:S,findTickerDetails:k}}},39793:(e,t,n)=>{n.d(t,{M:()=>s,x:()=>c});var a=n(33624),r=n(32189),o=n(544),i=n(50202),l=n(12115);let s=e=>{let t=a.aIS(r.N$.Main,e.portfolioType),n=a.aIS(r.N$.Group,e.portfolioType);return{isPortfolioMain:t,isPortfolioGroup:n,isPortfolioCurrent:a.aIS(r.N$.Current,e.portfolioType),isPortfolioDraft:a.aIS(r.N$.Draft,e.portfolioType)}},c=e=>{let{portfoliosList:t}=(0,i.RW)(),n=(0,l.useMemo)(()=>(0,o.Fk)(t,e),[t,e]);if(!n)throw Error("Portfolio with id ".concat(e," not found"));return s(n)}},40262:(e,t,n)=>{n.d(t,{CG:()=>c,SI:()=>d,S_:()=>s,pI:()=>i,pR:()=>l,sY:()=>u});var a=n(33624),r=n(544),o=n(17143);let i=e=>{let{investmentItems:t,includeCash:n,sortInvestments:i,hideMoneyMarketLineItems:l=!1}=e,s=n?(0,r.kz)(t):(0,r.qr)(t);l&&(s=a.kuo(r.IA,s));let c=[a.jk0(e=>+!(0,r.t)(e)),a.jk0(e=>+!(0,r.IA)(e))];return i&&c.push(a.jk0(e=>(0,o.$S)(e.ticker))),a.Va7(c)(s)},l=(e,t)=>{let n=a.EyX("ticker",e),r=a.EyX("ticker",t);return(0,o.Ae)(n,r)},s=(e,t)=>{var n;return(0,o.cp)(null!=(n=null==e?void 0:e.ticker)?n:"",t.ticker)&&(null==e?void 0:e.amount)===t.amount},c=(e,t)=>a.I6j(a.wqE("id",e),t),d=e=>{let t=(0,r.t)(e);return{showSecurityActions:!t,showQuantity:!t,showPrice:!t,showMarketValue:!0,showWeight:!t}},u=(e,t)=>e<(t?15:40)},40759:(e,t,n)=>{n.d(t,{A:()=>f,D:()=>h});var a=n(57090),r=n(12115),o=n(99026),i=n(43948),l=n(74547),s=n(37899),c=n(82759),d=n(41784),u=n(82748);let m=e=>{let{className:t,...n}=e;return(0,a.Y)(l._s,{className:(0,d.cn)("[&_.ant-drawer-body]:pt-0 [&_.ant-drawer-body]:pb-0 [&_.ant-drawer-body]:pl-0",t),...n,"data-sentry-element":"Drawer","data-sentry-component":"StyledDrawer","data-sentry-source-file":"GlobalPortfolioDetailsLauncher.tsx"})},{useGlobalPortfolioDetailsLaunchEventListener:p,emitGlobalPortfolioDetailsLaunchEvent:y}=(0,i.createEvent)("GlobalPortfolioDetailsLaunchEvent")(),h=e=>{let t=(e,t)=>{y({portfolio:e,onCloseCallback:t})};return{launchPortfolioDetails:()=>{e?t(e):console.error("No portfolio provided to launchPortfolioDetails")},launchPortfolioDetailsWithPortfolio:t}},f=()=>{let[e,t]=r.useState(null),n=r.useRef(o.lQ);p(e=>{let{portfolio:a,onCloseCallback:r}=e;t(a),n.current=r||o.lQ});let i=()=>{t(null),n.current()},d=(null==e?void 0:e.replacementPortfolioId)!=null;return e?(0,a.FD)(m,{open:!0,width:860,onClose:i,title:e.portfolioName,"data-sentry-element":"StyledDrawer","data-sentry-component":"GlobalPortfolioDetailsLauncher","data-sentry-source-file":"GlobalPortfolioDetailsLauncher.tsx",children:[(0,a.Y)("div",{style:d?{opacity:.5,pointerEvents:"none"}:void 0,children:(0,a.Y)(c.default,{portfolio:e,showUpdateNetWorthButton:!0,showExportButton:!1,hidePortfolioName:!0,showEditTransactions:!0,onEditTransactions:i,compactTableConfigArray:u.M,"data-sentry-element":"PortfolioDetails","data-sentry-source-file":"GlobalPortfolioDetailsLauncher.tsx"},e.portfolioId)}),(0,a.Y)(l.Ah,{width:"100%","data-sentry-element":"FlexLayout","data-sentry-source-file":"GlobalPortfolioDetailsLauncher.tsx",children:(0,a.Y)(s.A,{"data-sentry-element":"ReportDataIssueLink","data-sentry-source-file":"GlobalPortfolioDetailsLauncher.tsx"})})]}):null}},40831:(e,t,n)=>{n.d(t,{jH:()=>z,JJ:()=>U,Ay:()=>V});var a=n(57090);n(12115);var r=n(32189),o=n(74547),i=n(85335),l=n(62570),s=n(36934),c=n(41784),d=n(33624),u=n(99026),m=n(35208),p=n(24700),y=n.n(p),h=function(e){return e.Left="left",e.Right="right",e}({});let f=e=>(0,u.Yw)(e,m.y1.permittedScoreFractionDigits),g=d.qE8(m.y1.impactScaleRangeMin,m.y1.impactScaleRangeMax),v=e=>g(d.lwT(m.y1.scoreToScaleUnit,e)),x=e=>d.ROM(e,m.y1.maxSubScore)?y()(m.y1.maxSubScore).format("0"):y()(e).format("0.00");var A=n(81671);let S=(0,l.A)("div",{target:"e1vtaz4b0"})("display:flex;flex-direction:row;justify-content:flex-start;align-items:center;width:100%;"),b=(0,l.A)("div",{target:"e1vtaz4b1"})("width:100%;height:",32,"px;position:relative;"),C=()=>(0,a.Y)("div",{className:"absolute inset-x-0 bg-neutral-900 opacity-10",style:{to
3p:20,height:1},"data-sentry-component":"SubScoreTrackLine","data-sentry-source-file":"subScoreAtoms.tsx"}),I=e=>(0,a.Y)("div",{className:"absolute inset-y-0",style:{left:"4ch",right:"4ch"},"data-sentry-component":"SubScoreMarkerTrack","data-sentry-source-file":"subScoreAtoms.tsx",children:e.children}),w=e=>(0,a.Y)(s.s9,{as:"span",className:(0,c.cn)("absolute whitespace-nowrap",{"text-right":"right"===e.align,"text-left":"left"===e.align,"text-center":"center"===e.align}),style:{...e.style,color:e.color,bottom:"50%",lineHeight:"".concat(20,"px")},"data-sentry-element":"Body2W600","data-sentry-component":"SubScoreValue","data-sentry-source-file":"subScoreAtoms.tsx",children:e.children}),P=(0,l.A)(o.In,{target:"e1vtaz4b2"})("path{stroke-width:",4.8,";}"),k=e=>{let t=e.direction===h.Right;return(0,a.FD)("div",{className:"absolute text-neutral-900",style:{left:e.endsAtScaleTop?void 0:"".concat(e.startPercent,"%"),right:e.endsAtScaleTop?0:void 0,width:"max(".concat(e.lengthPercent,"%, ").concat(24,"px)"),height:10,top:20,transform:"translateY(-50%)"},"data-sentry-component":"SubScoreArrow","data-sentry-source-file":"subScoreAtoms.tsx",children:[(0,a.Y)("div",{className:"absolute inset-x-0 top-1/2 -translate-y-1/2 bg-current",style:{height:2}}
3),(0,a.Y)(P,{icon:t?A.$.ArrowRight:A.$.ArrowLeft,size:10,className:(0,c.cn)("absolute top-0",t?"right-0":"left-0"),"data-sentry-element":"SubScoreArrowHead","data-sentry-source-file":"subScoreAtoms.tsx"}),e.children]})},F=e=>(0,a.FD)("div",{className:"absolute text-neutral-900",style:{left:"".concat(e.offsetPercent,"%"),width:24,height:24,top:20,transform:"translate(-50%, -50%)"},"data-sentry-component":"SubScorePoint","data-sentry-source-file":"subScoreAtoms.tsx",children:[(0,a.Y)("div",{className:"absolute inset-0 m-auto h-1 w-1 rounded-full bg-current"}),e.children]}),T=(0,l.A)("div",{target:"e1vtaz4b3"})("font-weight:600;font-size:12px;line-height:16px;color:",e=>e.theme.colors.black,";flex-basis:12rem;align-self:flex-end;min-width:140px:align-items:center;");var E=n(8305),Y=n(544),D=n(88986);let R=e=>(0,D.b)((0,Y.qU)(e).band),N=e=>{let{currentScore:t,afterImpactScore:n,currentScoreScale:r,isConsiderableScoreImprovement:o,isConsiderableScoreDecrement:i}=(e=>{let{currentScore:t,afterImpactScore:n}=e,a=(e=>{let{currentScore:t,afterImpactScore:n}=e;return(0,u.Yw)(d.ReH(f(n),f(t)),m.y1.permittedScoreFractionDigits)})({currentScore:t,afterImpactScore:n});return{currentScore:f(t),afterImpactScore:f(n),currentScoreScale:v(t),isConsiderableScoreImprovement:d.ROM(a,m.y1.considerableImprovementThreshold),isConsiderableScoreDecrement:(e=>d.lt(e,0))(a)}})({currentScore:e.currentScoreVal,afterImpactScore:e.afterImpactScoreVal});return(0,a.FD)(b,{"data-sentry-element":"SubScoreIndicatorContainer","data-sentry-component":"SubScoreImpactIndicator","data-sentry-source-file":"SubScoreImpactIndicator.tsx",children:[(0,a.Y)(C,{"data-sentry-element":"SubScoreTrackLine","data-sentry-source-file":"SubScoreImpactIndicator.tsx"}),(0,a.Y)(I,{"data-sentry-element":"SubScoreMarkerTrack","data-sentry-source-file":"SubScoreImpactIndicator.tsx",children:o||i?(()=>{let e=(e=>{let{currentScore:t,afterImpactScore:n}=e,a=v(t),r=v(n),o=r<a,i=d.T9B(m.y1.minArrowLengthScorePoints*m.y1.scoreToScaleUnit,Math.abs(r-a)),l=g(Math.min(a,r,m.y1.impactScaleRangeMax-i));return{startPercent:l,lengthPercent:i,lowerScore:o?n:t,higherScore:o?t:n,direction:o?"left":"right",endsAtScaleTop:l+i>=m.y1.impactScaleRangeMax}})({currentScore:t,afterImpactScore:n}),r=e.direction===h.Right?{lower:1,higher:3}:{lower:3,higher:1};return(0,a.FD)(k,{startPercent:e.startPercent,lengthPercent:e.lengthPercent,direction:e.direction,endsAtScaleTop:e.endsAtScaleTop,"data-sentry-element":"SubScoreArrow","data-sentry-component":"renderScoreImpactArrow","data-sentry-source-file":"SubScoreImpactIndicator.tsx",children:[(0,a.Y)(w,{align:"right",color:R(e.lowerScore),style:{right:"calc(100% - ".concat(r.lower,"px)")},"data-sentry-element":"SubScoreValue","data-sentry-source-file":"SubScoreImpactIndicator.tsx",children:x(e.lowerScore)}),(0,a.Y)(w,{align:"left",color:R(e.higherScore),style:{left:"calc(100% - ".concat(r.higher,"px)")},"data-sentry-element":"SubScoreValue","data-sentry-source-file":"SubScoreImpactIndicator.tsx",children:x(e.higherScore)})]})})():(0,a.Y)(F,{offsetPercent:r,"data-sentry-element":"SubScorePoint","data-sentry-component":"renderScorePoint","data-sentry-source-file":"SubScoreImpactIndicator.tsx",children:(0,a.Y)(w,{align:"center",color:R(t),style:{left:"50%",transform:"translateX(-50%)"},"data-sentry-element":"SubScoreValue","data-sentry-source-file":"SubScoreImpactIndicator.tsx",children:x(t)})})})]})},M=e=>{let{current:t,afterImpact:n,scoreType:r}=e,o=E.pT[r].title;return(0,a.FD)(S,{"data-sentry-element":"SubScoreImpactContainer","data-sentry-component":"SubScoreImpact","data-sentry-source-file":"SubScoreImpact.tsx",children:[(0,a.Y)(T,{"data-sentry-element":"SubScoreLabel","data-sentry-source-file":"SubScoreImpact.tsx",children:o}),(0,a.Y)(N,{currentScoreVal:t,afterImpactScoreVal:n,"data-sentry-element":"SubScoreImpactIndicator","data-sentry-source-file":"SubScoreImpact.tsx"})]})};var L=n(27115),_=n(59149),O=n(98868);let W=e=>{let{currentRiskVal:t,updatedRiskVal:n,portfolioId:r}=e,{riskProfile:i}=(0,L.c)(r),l=_.wZ[i],c=_.ti[i].volatility,d=i===O.R$.NoRisk?c:"".concat(c,"%"),m="".concat((0,u.DP)(t,1),"%"),p="".concat((0,u.DP)(n,1),"%");return(0,a.Y)(o.ID,{placement:"right",iconStyle:{verticalAlign:"-0.125em"},title:(0,a.FD)("div",{children:[(0,a.Y)(s.se,{className:"font-medium",children:"Risk Match Details"}),(0,a.FD)("div",{children:["Risk preference: ",d," (",l,")"]}),(0,a.FD)("div",{children:["Current portfolio risk: ",m]}
3),(0,a.FD)("div",{children:["Updated portfolio risk: ",p]})]}),"data-sentry-element":"InfoTooltip","data-sentry-component":"RiskMatchTooltip","data-sentry-source-file":"RiskMatchTooltip.tsx"})},B=e=>{let{currentRiskMatchSubcomponents:t,afterImpactRiskMatchSubcomponents:n,portfolioId:r,current:o,afterImpact:i}=e;return(0,a.FD)(S,{"data-sentry-element":"SubScoreImpactContainer","data-sentry-component":"RiskMatchSubScoreImpact","data-sentry-source-file":"RiskMatchSubScoreImpact.tsx",children:[(0,a.FD)(T,{"data-sentry-element":"SubScoreLabel","data-sentry-source-file":"RiskMatchSubScoreImpact.tsx",children:["Risk Match","\xa0",(0,a.Y)(W,{portfolioId:r,currentRiskVal:t.portfolioRisk,updatedRiskVal:n.portfolioRisk,"data-sentry-element":"RiskMatchTooltip","data-sentry-source-file":"RiskMatchSubScoreImpact.tsx"})]}),(0,a.Y)(N,{currentScoreVal:o,afterImpactScoreVal:i,"data-sentry-element":"SubScoreImpactIndicator","data-sentry-source-file":"RiskMatchSubScoreImpact.tsx"})]})},U=()=>(0,a.Y)(i.p,{"data-sentry-element":"ArrowContainer","data-sentry-component":"PortfolioMainScoreImpactArrow","data-sentry-source-file":"PortfolioChangeScoreImpact.tsx",children:(0,a.Y)(o.In,{icon:A.$.ArrowRight,className:"text-icon stroke-[50px] text-xl","data-sentry-element":"Icon","data-sentry-source-file":"PortfolioChangeScoreImpact.tsx"})}),z=e=>{let{score:t,portfolioLabel:n}=e;return(0,a.FD)(i.Cs,{"data-sentry-element":"MainScoreSectionContainer","data-sentry-component":"MainScoreSection","data-sentry-source-file":"PortfolioChangeScoreImpact.tsx",children:[(0,a.Y)(i.hx,{"data-sentry-element":"PortfolioLabel","data-sentry-source-file":"PortfolioChangeScoreImpact.tsx",children:n}),(0,a.Y)(i.lL,{portfolioScore:t,"data-sentry-element":"ColoredPortfolioScore","data-sentry-source-file":"PortfolioChangeScoreImpact.tsx"})]})},V=e=>{let{className:t,hideRiskMatch:n,hideMainScoreRow:o,portfolioId:l}=e,{isPortfolioRiskPreferenceLoading:s,isRiskMatchApplicable:c}=(0,L.V)(e.portfolioId),{score:d,portfolioLabel:u}=e.currentScoreConfig,{score:m,portfolioLabel:p}=e.impactedScoreConfig,{riskMatchScore:y,sharpeRatioScore:h,downsideProtectionScore:f,riskMatchSubcomponents:g}=d,{riskMatchScore:v,sharpeRatioScore:x,downsideProtectionScore:A,riskMatchSubcomponents:S}=m;return(0,a.FD)("div",{className:t,"data-sentry-component":"PortfolioChangeScoreImpact","data-sentry-source-file":"PortfolioChangeScoreImpact.tsx",children:[!o&&(0,a.Y)(i.m$,{children:(0,a.FD)(i.IF,{children:[(0,a.Y)(z,{score:d.score,portfolioLabel:u}),(0,a.Y)(U,{}),(0,a.Y)(z,{score:m.score,portfolioLabel:p})]})}),(0,a.FD)(i.jw,{itemsSpacingVertical:16,"data-sentry-element":"SubScoresImpactContainer","data-sentry-source-file":"PortfolioChangeScoreImpact.tsx",children:[s||!c||n?null:(0,a.Y)(B,{current:y,afterImpact:v,portfolioId:l,scoreType:r.x5.RiskMatch,currentRiskMatchSubcomponents:g,afterImpactRiskMatchSubcomponents:S}),(0,a.Y)(M,{current:h,afterImpact:x,scoreType:r.x5.SharpeRatio,"data-sentry-element":"SubScoreImpact","data-sentry-source-file":"PortfolioChangeScoreImpact.tsx"}),(0,a.Y)(M,{current:f,afterImpact:A,scoreType:r.x5.DownsideProtection,"data-sentry-element":"SubScoreImpact","data-sentry-source-file":"PortfolioChangeScoreImpact.tsx"})]}),e.children]})}},41491:(e,t,n)=>{n.d(t,{_:()=>o});var a=n(46749),r=n(71827);let o=()=>{let{demoCurrentPortfolio:e}=(0,r.Y)(),{isUserInsideCoreApp:t}=(0,a.A)(),n=!!e;return{isDemoMode:n,demoPortfolio:e,showDemoModeBanner:t&&n}}},41785:(e,t,n)=>{n.d(t,{$f:()=>l,Dq:()=>d,MH:()=>s,e1:()=>i,nT:()=>c});var a=n(62570),r=n(28811),o=n(92672);let i=(0,a.A)(r.Ay,{target:"ex9g7yv0"})("border:1px dashed ",e=>e.theme.colors.neutral300,";margin:0;"),l=(0,a.A)("div",{target:"ex9g7yv1"})("background-color:",e=>e.theme.colors.neutral900,";color:white;border-radius:4px;max-width:240px;font-weight:400;font-size:12px;> p{margin:0;}"),s=(0,a.A)("div",{target:"ex9g7yv2"})("color:white;font-size:14px;font-weight:600;margin-bottom:2px;"),c=(0,a.A)("div",{target:"ex9g7yv3"})("display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;& >:not(:last-child){margin-right:16px;}"),d=(0,a.A)("div",{target:"ex9g7yv4"})("display:flex;flex-direction:column;flex-wrap:nowrap;max-width:750px;align-items:stretch;justify-content:center;",(0,o.BK)({width:["100%","100%","100%","80%","70%","60%"]}))}
3,41802:(e,t,n)=>{e.exports=n.p+"static/media/ob_increase_downside_protection.cc5288402a3661dd.svg"},42010:(e,t,n)=>{n.d(t,{K9:()=>d,Pc:()=>s,Uy:()=>y,WT:()=>l,X9:()=>m,b:()=>p,eK:()=>u,f3:()=>c});var a=n(57090);n(12115);var r=n(40248),o=n(92672),i=n(41784);let l=e=>(0,a.Y)("div",{...e,"data-sentry-component":"RetryAnotherAccountContainer","data-sentry-source-file":"atoms.tsx"}),s=e=>(0,a.Y)(r.A,{...e,className:(0,i.cn)("mt-4 inline-flex justify-center items-center gap-1",e.className),"data-sentry-element":"Button","data-sentry-component":"AbandonModalButton","data-sentry-source-file":"atoms.tsx",children:(0,a.Y)("span",{className:"whitespace-pre-wrap",children:e.children})}),c=e=>(0,a.Y)("div",{...e,className:(0,i.cn)("font-normal text-base text-body",e.className),"data-sentry-component":"TroubleshootingDescription","data-sentry-source-file":"atoms.tsx"}),d=e=>(0,a.Y)("ul",{...e,className:(0,i.cn)("my-2 px-5",e.className),"data-sentry-component":"UnorderedListInstructions","data-sentry-source-file":"atoms.tsx"}),u=e=>(0,a.Y)("li",{...e,"data-sentry-component":"ListInstructionItem","data-sentry-source-file":"atoms.tsx"}),m=e=>(0,a.Y)("div",{...e,className:(0,i.cn)("[&_svg]:!size-4 [&_svg]:!mx-0",e.className),"data-sentry-component":"AbandonModalButtonIconContainer","data-sentry-source-file":"atoms.tsx"}),p=e=>(0,a.Y)(o.Ah,{flexDirection:"column",width:"100%",itemsSpacingVertical:16,alignItems:"stretch",occupyParentWidth:!0,className:e.className,"data-sentry-element":"FlexLayout","data-sentry-component":"InstructionsContainer","data-sentry-source-file":"atoms.tsx",children:e.children}),y=e=>(0,a.Y)(o.Ah,{flexDirection:"column",width:"100%",itemsSpacingVertical:4,alignItems:"stretch",alignContent:"stretch",occupyParentWidth:!0,className:e.className,"data-sentry-element":"FlexLayout","data-sentry-component":"InstructionContainer","data-sentry-source-file":"atoms.tsx",children:e.children})},42036:(e,t,n)=>{n.d(t,{Gl:()=>m,Ay:()=>h,n0:()=>p});var a=n(50202),r=n(33624),o=n(21123),i=n(544),l=n(67759),s=n(8662),c=n(62212),d=n(43948),u=n(8921),m=function(e){return e.Auto="Auto",e.Manual="Manual",e}({});let{useActivePortfolioSwitchEventListener:p,emitActivePortfolioSwitchEvent:y}=(0,d.createEvent)("ActivePortfolioSwitchEvent")(),h=()=>{let{activePortfolioId:e,_setActivePortfolioId:t}=(0,a.RW)(),n=(0,c.j)();return{switchActivePortfolio:(a,c,d)=>{t(a),y({activePortfolioId:a,previousActivePortfolioId:e,mode:c});let m=(0,s.W)(n);((e,t,n)=>{if(r.aIS(t,n))return;let a=(0,i.Fk)(e,t),s=(0,i.Fk)(e,n);if(r.gD_(s))return o.wd("Selected Portfolio details is not available during Portfolio switch tracking");let c=e=>({id:e.portfolioId,type:e.portfolioType,name:e.portfolioName}),d=a?c(a):null,u=c(s);(0,l.trackActivePortfolioSwitched)({switchedPortfolio:u,previousActivePortfolio:d})})(m,e,a);let p=e===a;if("Auto"===c&&!p){let e=(0,i.Fk)(m,a),t=null!=d?d:e?"Switched to ".concat(e.portfolioName):null;t&&(0,u.Ds)(u._n.Info,t)}}}}},42597:(e,t,n)=>{n.d(t,{F:()=>o,f:()=>i});var a=n(57090);n(12115);var r=n(37294),o=function(e){return e.hover="hover",e.click="click",e.focus="focus",e.contextMenu="contextMenu",e}({});let i=e=>{var t;let n=e.trigger;return(0,a.Y)(r.A,{...e,trigger:n,overlayClassName:e.className,color:null!=(t=e.color)?t:"var(--wp-popover-background)","data-sentry-element":"AntdPopover","data-sentry-component":"WPPopover","data-sentry-source-file":"WPPopover.tsx"})}},43608:(e,t,n)=>{n.d(t,{y:()=>c});var a=n(33624),r=n(81527),o=n(84245),i=n(80067),l=n(35208),s=n(46165);let c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{useErrorBoundary:!0},n=e||l.RI,{investorRiskProfile:c}=(0,s.gm)(),d=a.is(Number,e)&&e!==l.RI&&!!c;return(0,r.I)((0,o.Ld)(n),()=>(0,i.hL)(n),{...o.gz,useErrorBoundary:t.useErrorBoundary,enabled:d})}},43847:(e,t,n)=>{n.d(t,{Cs:()=>I,Kz:()=>C,L1:()=>F,NU:()=>x,Pd:()=>k,Vz:()=>P,Wx:()=>D,Yj:()=>A,bf:()=>T,fM:()=>b,ko:()=>Y,lZ:()=>R,xI:()=>N});var a=n(92283),r=n(83439),o=n(22462),i=n(33624),l=n(73590),s=n.n(l),c=n(71754),d=n(67030),u=n(39715),m=n(90997),p=n(22977),y=n(32204),h=n(66866),f=n(11325),g=n(13340),v=n(31260);let x=()=>{let e;try{e=(0,v.yf)().preferredCurrency}catch(t){e=g.mF}return e},A=e=>{let{format:t,text:n,hideDecimals:a,preferredCurrency:r,axisRange:o}=e;switch(t){case"Percent":return"".concat(n,"%");case"Number":return"".concat(n);case"Currency":return(0,f.iS)({amount:(0,u.qU)(n),sourceCurrency:g.mF,preferredCurrency:r,currencyFormatter:f.EB.HumanizedLiteralAmount,customFormatOptions:{hideDecimals:void 0!==o?o>=2:a}});default:return t}},S=(0,m.s)({legend:{layout:"horizontal",align:"center",verticalAlign:"top",enabled:!0,itemMarginBottom:10,itemStyle:{fontSize:"14px",fontWeight:"500",color:c.gB.neutral500}},exporting:{allowHTML:!0,buttons:{contextButton:{x:0}}},title:{text:""},subtitle:{text:""}}
3),b=e=>i.jp7(S,e),C=e=>e===d.lH.Highlight?[...c.VC]:[...c.Lb],I=(e,t)=>{switch(t){case"Percent":return a.A(e)?Number((0,u.GW)(e,{fractionDigits:2})):e;case"Number":case"Currency":return e;default:return t}},w={Value:c.uB.value,Consensus:c.uB.consensus,"Latest Value":c.uB.latestValue,"Upper Bound":c.uB.upperBound,"Lower Bound":c.uB.lowerBound,History:c.uB.history,[p.A$.Forecast]:c.uB.forecast,"Market Expectation":c.uB.marketExpectation,[p.A$.High]:c.uB.percentile75,[p.A$.Low]:c.uB.percentile25},P=(e,t)=>{let n=i.vUk(null,w[e]);return"Value"===e&&i.mKk("Upper Bound",t)&&i.mKk("Lower Bound",t)&&(n=c.uB.valueWithBounds),{color:n,dashStyle:i.vUk(null,{"Upper Bound":"ShortDash","Lower Bound":"ShortDash"}[e]),lineWidth:i.vUk(2,{"Upper Bound":1,"Lower Bound":1}[e])}},k=(e,t)=>{if(!r.A(t))return null;let n=t.map((t,n)=>Number.isFinite(t)?e[n]:null).filter(e=>Number.isFinite(e));return 0===n.length?null:{start:Math.min(...n),end:Math.max(...n)}},F=e=>({color:i.vUk(null,w[e])}),T=(e,t,n)=>r.A(t)?(0,y.b9)(e,i.TjK(e=>I(e,n),t)):null,E=(e,t)=>{let n=(0,y.IQ)(e),a=(0,y.IQ)(t);return null===n||null===a||n<=a?{low:n,high:a}:{low:a,high:n}},Y=(e,t)=>{if(!t)return e;let[n,a]=t,o=e[n],i=e[a];return r.A(i)&&r.A(o)?{...e,[a]:i.map((e,t)=>E(e,o[t]).low),[n]:o.map((e,t)=>E(i[t],e).high)}:e},D=(e,t,n)=>{if(!t)return[];let[a,o]=t,l=e[a],s=e[o];if(!r.A(e.date_vals)||!r.A(s)||!r.A(l))return[];let c=i.TjK(y.F,e.date_vals),d=e[h.T.History];return(0,y.Ii)((0,y.nX)({dateTimes:c,lows:i.TjK(e=>I(e,n),s),highs:i.TjK(e=>I(e,n),l),historyValues:r.A(d)?i.TjK(e=>I(e,n),d):null}))},R=async(e,t)=>{if("undefined"==typeof document)return"";let{Canvg:a}=await Promise.all([n.e(1652),n.e(492)]).then(n.bind(n,78766)),r=document.createElement("canvas"),o=r.getContext("2d"),i=a.fromString(o,e);return await i.render(),r.toDataURL(t).replace("data:".concat(t,";base64,"),"")},N=e=>{let t=i.o8B(e);return t=(e=>{if(r.A(e.date_vals)){let t=((e,t)=>{let n=s()();return i.pbD(e=>("string"==typeof e?s()(e,t):s()(e)).isBefore(n),e)})(e.date_vals,p.dO),n=t;if(r.A(e.History)){let a=i.Klq(o.A,e.History);-1!==a&&(n=t.slice(0,a+1))}return i.Ufq("date_vals",n,i.o8B(e))}return i.o8B(e)})(t),i.jJl(e=>{r.A(t[e])&&(t[e]=Array(t[e].length).fill(null))},i.zug(p.A$)),t}},44134:(e,t,n)=>{n.d(t,{O:()=>p});var a=n(62212),r=n(17667),o=n(32189),i=n(48298),l=n(79768),s=n(50202),c=n(70890),d=n(544),u=n(35974),m=n(93382);let p=()=>{let e=(0,a.j)(),{mainPortfolio:t,portfoliosList:n}=(0,s.RW)(),p=(0,l.rA)();return(0,r.A)(async e=>{var t;let a=null==(t=(0,d.Fk)(n,e.portfolioId))?void 0:t.source;return await i.Ay.addBulkCurrentPortfolio(e.portfolioId,e.investmentsPayload),{uploadedPortfolioId:e.portfolioId,initialPortfolioSource:a}},{onSuccess:(n,a)=>{(0,c.A9)(e),p({portfolioId:a.portfolioId,portfolioType:a.portfolioType}),(0,c.UH)(e),a.portfolioType===o.N$.Current&&((0,c.DK)(e),p({portfolioId:t.portfolioId,portfolioType:t.portfolioType})),n.initialPortfolioSource===o.GB.Demo&&(0,u.h)({demoPortfolioId:a.portfolioId,reason:m.$.PortfolioInvestmentsEdited})}})}},44561:(e,t,n)=>{n.d(t,{IP:()=>o,Lm:()=>i,P0:()=>d,hE:()=>r,hv:()=>s,oQ:()=>l,q$:()=>c});var a=n(39040);let r="CUSTOM.",o="(unknown)",i="*",l="Unknown",s="Unknown",c=a.Hj.Equities,d=Object.values(a.I$)},44619:(e,t,n)=>{n.d(t,{Bi:()=>x,ED:()=>u,JN:()=>y,OL:()=>d,aR:()=>m,rl:()=>p});var a=n(32189);let r=["ROTH"],o=["HSA","HEALTH SAVINGS","TFSA","529","ESA","COVERDELL"],i=["401K","401 K","401-K","401(K)","401 (K)","IRA","RRSP","RESP","403B","403 B","403-B","403(B)","403 (B)","457","SEP","PENSION","DEFINED BENEFIT","TSP","ROLLOVER","PCRA","SDBA","BROKERAGELINK","CONTRIBUTORY","KEOGH","THRIFT SAVINGS","DEFERRED COMP","DEFERRED COMPENSATION","PROFIT SHARING"],l=["RETIREMENT PLAN","RETIREMENT ACCOUNT","RETIREMENT SAVINGS","SAVINGS AND INVESTMENT PLAN"],s=["NON-RETIREMENT","NON RETIREMENT","TAXABLE"],c=["NON-TAXABLE","NON TAXABLE"];function d(e){switch(e){case a.MG.Taxable:return"Taxable";case a.MG.TaxAdvantaged:return"Tax-Advantaged";case a.MG.TaxFree:return"Tax-Free"}}var u=function(e){return e.Taxable="taxable",e.Sheltered="sheltered",e}({});function m(e){switch(e){case a.MG.Taxable:return"taxable";case a.MG.TaxAdvantaged:case a.MG.TaxFree:return"sheltered"}}function p(e,t){return"".concat("taxable"===e?"taxable":"tax-sheltered"," ").concat(1===t?"account":"accounts")}function y(e){switch(e){case a.MG.Taxable:return"Regular brokerage accounts where dividends and capital gains are taxed annually.";
3case a.MG.TaxAdvantaged:return"Traditional IRA, 401k, SEP-IRA, etc. Contributions may be tax-deductible, withdrawals are taxed as income.";case a.MG.TaxFree:return"Roth IRA, Roth 401k, HSA, etc. Contributions are after-tax, but growth and withdrawals are tax-free."}}function h(e){return/[A-Z0-9]/.test(e)}function f(e,t){return/[0-9]/.test(t)?/[0-9]/.test(e):/[A-Z]/.test(e)}function g(e,t){for(let n=e.indexOf(t);-1!==n;n=e.indexOf(t,n+1)){let a=e.charAt(n-1),r=e.charAt(n+t.length),o=!h(a)&&!f(r,t.charAt(t.length-1)),i=!f(a,t.charAt(0))&&!h(r);if(o||i)return n}return -1}function v(e,t){return t.some(t=>-1!==g(e,t))}function x(e,t){let n=function(e){let t=e.toUpperCase();if(v(t,r))return a.MG.TaxFree;let n=!!v(t,i)||!function(e){let t=e;for(let e of c)for(let n=g(t,e);-1!==n;n=g(t,e))t="".concat(t.slice(0,n)," ").concat(t.slice(n+e.length));return v(t,s)}(t)&&v(t,l);return v(t,o)?n?a.MG.TaxAdvantaged:a.MG.TaxFree:n?a.MG.TaxAdvantaged:null}(e);return null===n||n===t?null:'Based on the name, this account appears to be "'.concat(d(n),'". Are you sure you want to set it as "').concat(d(t),'"?')}},44659:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(57090);n(12115);var r=n(55972);let o=()=>(0,a.Y)(r.S,{"data-sentry-element":"WpParagraph","data-sentry-component":"AIImporterParserErrorSection","data-sentry-source-file":"AIImporterParserErrorSection.tsx",children:(0,a.Y)(r.V,{type:"danger","data-sentry-element":"WpText","data-sentry-source-file":"AIImporterParserErrorSection.tsx",children:"Failed to parse portfolio. Please retry if the portfolio data is complete."})})}
3,45004:(e,t,n)=>{n.d(t,{A:()=>tw,J:()=>tI});var a=n(57090),r=n(12115),o=n(43948),i=n(33624),l=n(8921),s=n(21123),c=n(6465),d=n(18356),u=n(20830),m=n(19483),p=n(98483),y=n(65438),h=n(22462),f=n(51305),g=n(74547),v=n(95825),x=n(78046),A=n(42010);let S=e=>{let{color:t}=e;return(0,a.Y)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-sentry-element":"svg","data-sentry-component":"DislikeIcon","data-sentry-source-file":"DislikeIcon.tsx",children:(0,a.Y)("path",{d:"M7.84919 12.965L11.6346 9.17271C11.8879 8.91943 12.0317 8.57032 12.0317 8.20752V1.36906C12.0317 0.616077 11.4156 0 10.6626 0H4.50868C3.96106 0 3.46819 0.328575 3.25599 0.828282L1.02442 6.03756C0.442569 7.39293 1.43514 8.8989 2.90688 8.8989H6.77448L6.12417 12.034C6.05572 12.3763 6.1584 12.7254 6.40483 12.9719C6.8087 13.3689 7.45216 13.3689 7.84919 12.965ZM14.7766 0C14.0237 0 13.4076 0.616077 13.4076 1.36906V6.84531C13.4076 7.59829 14.0237 8.21437 14.7766 8.21437C15.5296 8.21437 16.1457 7.59829 16.1457 6.84531V1.36906C16.1457 0.616077 15.5296 0 14.7766 0Z",fill:t,"data-sentry-element":"path","data-sentry-source-file":"DislikeIcon.tsx"})})},b=e=>{let{color:t}=e;return(0,a.Y)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-sentry-element":"svg","data-sentry-component":"TechnicalProblemIcon","data-sentry-source-file":"TechnicalProblemIcon.tsx",children:(0,a.Y)("path",{d:"M0 7.99978C0 9.96423 0.808889 11.7331 2.09778 13.0131L0.755555 14.3553C0.48 14.6309 0.675556 15.1109 1.07556 15.1109H4.88889C5.13778 15.1109 5.33333 14.9153 5.33333 14.6664V10.8531C5.33333 10.4531 4.85333 10.2576 4.57778 10.542L3.34222 11.7776C2.38222 10.7998 1.77778 9.47534 1.77778 7.99978C1.77778 5.87534 3.02222 4.03534 4.82667 3.18201C5.12889 3.03978 5.33333 2.76423 5.33333 2.43534V2.26645C5.33333 1.66201 4.70222 1.27978 4.16 1.53756C1.70667 2.65756 0 5.12867 0 7.99978ZM7.11111 12.4442H8.88889V10.6664H7.11111V12.4442ZM14.9244 0.888672H11.1111C10.8622 0.888672 10.6667 1.08423 10.6667 1.33312V5.14645C10.6667 5.54645 11.1467 5.74201 11.4222 5.45756L12.6578 4.22201C13.6178 5.19978 14.2222 6.52423 14.2222 7.99978C14.2222 10.1242 12.9778 11.9642 11.1733 12.8176C10.8711 12.9598 10.6667 13.2353 10.6667 13.5642V13.7242C10.6667 14.3287 11.2978 14.7109 11.84 14.4531C14.2933 13.342 16 10.8709 16 7.99978C16 6.03534 15.1911 4.26645 13.9022 2.98645L15.2444 1.64423C15.52 1.36867 15.3244 0.888672 14.9244 0.888672ZM8 8.88867C8.48889 8.88867 8.88889 8.48867 8.88889 7.99978V4.44423C8.88889 3.95534 8.48889 3.55534 8 3.55534C7.51111 3.55534 7.11111 3.95534 7.11111 4.44423V7.99978C7.11111 8.48867 7.51111 8.88867 8 8.88867Z",fill:t,"data-sentry-element":"path","data-sentry-source-file":"TechnicalProblemIcon.tsx"})})};
3var C=n(7802),I=n(81255),w=n(73314),P=n(67759),k=n(88179);let F=()=>(0,a.Y)(k.JF,{name:"userInputMessage",label:"Anything you can add? We read these and try to fix what broke.","data-sentry-element":"StyledFormItem","data-sentry-component":"AbandonmentModalTextInput","data-sentry-source-file":"AbandonmentModalTextInput.tsx",children:(0,a.Y)(g.fs,{placeholder:"e.g. 'Error message - server is unavailable', 'No MFA token received', etc",minRows:3,"data-sentry-element":"TextArea","data-sentry-source-file":"AbandonmentModalTextInput.tsx"})});var T=n(74618);let E=e=>(0,a.Y)(T.StyledForm,{form:e.form,name:"login",layout:"vertical",onFinish:e.handleSubmit,"data-sentry-element":"StyledForm","data-sentry-component":"AbandonmentModalFeedback","data-sentry-source-file":"AbandonmentModalFeedback.tsx",children:(0,a.Y)(F,{"data-sentry-element":"AbandonmentModalTextInput","data-sentry-source-file":"AbandonmentModalFeedback.tsx"})});var Y=n(4603),D=n(5285),R=n(58155),N=n(81671);let M={[C.Gb.IAmExploring]:C._z.AbortConnectionFlow,[C.Gb.IDontTrustTheSystem]:C._z.RetryWithNonProviderImporter,[C.Gb.IExperiencedATechnicalProblem]:C._z.RetryWithAlternateProvider,[C.Gb.Other]:C._z.RetryWithAlternateProvider},L={[C.Gb.IAmExploring]:{event:Y.ExternalAccountConnectionEvent.AbandonFlowExitedWithExploreResponse,message:Y.ExternalAccountConnectionEventMessage.AbandonFlowExitedWithExploreResponse},[C.Gb.IDontTrustTheSystem]:{event:Y.ExternalAccountConnectionEvent.AbandonFlowExitedWithTrustResponse,message:Y.ExternalAccountConnectionEventMessage.AbandonFlowExitedWithTrustResponse},[C.Gb.IExperiencedATechnicalProblem]:null,[C.Gb.Other]:null},_=e=>i.mKk(e,[C.Gb.IExperiencedATechnicalProblem,C.Gb.Other]),O=e=>{let{currentInstitution:t}=e6(),{isUserInOnboarding:n}=(0,I.A)(),o=(0,D.A)(),{theme:l}=(0,R.OM)(),[s,c]=r.useState(null),{value:d,setTrue:u}=(0,y.A)(!1),[m]=(0,x.mN)(),p=null==t?void 0:t.name,k=i.vUk(null,null==t?void 0:t.accountProvider),F=h.A(s),T=function(a,r,o,i,l){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e.errorMetadata;if(k&&p){let e={event:a,institutionName:p,accountProvider:k,institutionId:t.id,message:r,abandonmentReason:l},c=i?{errorMetadata:{...s,abandonmentReason:l},category:i,isUserInOnboarding:n}:null;(0,P.trackExternalAccountConnection)(e,o,c)}};r.useEffect(()=>{T(Y.ExternalAccountConnectionEvent.AbandonFlowStarted,Y.ExternalAccountConnectionEventMessage.AbandonFlowStarted,null,null,null)},[]);let O=t=>{let{exitFlow:n}=t;e.onClose({exitFlow:n})},W=s?M[s]:C._z.AbortConnectionFlow,B=()=>{T(Y.ExternalAccountConnectionEvent.AbandonFlowExitedWithSkippedElaboration,Y.ExternalAccountConnectionEventMessage.AbandonFlowExitedWithSkippedElaboration,null,s,s),O({exitFlow:W})},U=e=>F&&f.A(e,s),z=e=>U(e)?{className:"text-current",color:"currentColor"}:{className:"text-primary",color:l.colors.blue600},V=[{reason:C.Gb.IExperiencedATechnicalProblem,label:(0,a.Y)(r.Fragment,{children:"Experienced a technical problem"}),icon:(()=>{let e=z(C.Gb.IExperiencedATechnicalProblem);return(0,a.Y)(A.X9,{children:(0,a.Y)(b,{color:e.color})})})()},{reason:C.Gb.IDontTrustTheSystem,label:(0,a.Y)(r.Fragment,{children:"Don't want to share credentials"}),icon:(()=>{let e=z(C.Gb.IDontTrustTheSystem);return(0,a.Y)(A.X9,{children:(0,a.Y)(S,{color:e.color})})})()},{reason:C.Gb.IAmExploring,label:(0,a.Y)(r.Fragment,{children:"Just exploring"}),icon:(()=>{let e=z(C.Gb.IAmExploring);return(0,a.Y)(A.X9,{children:(0,a.Y)(g.In,{icon:N.$.CompassRound,size:16,className:e.className,color:e.color})})})()},{reason:C.Gb.Other,label:(0,a.Y)(r.Fragment,{children:"Other"}),icon:(()=>{let e=z(C.Gb.Other);return(0,a.Y)(A.X9,{children:(0,a.Y)(g.In,{icon:N.$.DotGrid1x3Horizontal,size:16,className:e.className,color:e.color})})})()}],j=d?s:null;return(0,a.FD)(g.aF,{disableSubmitOnEnter:!0,open:!0,maskClosable:!1,closable:!1,keyboard:d,onCancel:d?B:void 0,title:"Troubleshooting",size:v.rI.Sm,footer:j?(0,a.FD)(v.jl,{children:[(0,a.Y)(g.$n,{onClick:B,children:"Skip"}),(0,a.Y)(g.$n,{variant:"filled",onClick:()=>{m.submit()},children:"Send"})]}):null,"data-sentry-element":"Modal","data-sentry-component":"AbandonmentModal","data-sentry-source-file":"AbandonmentModal.tsx",children:[(0,a.Y)(A.f3,{"data-sentry-element":"TroubleshootingDescription","data-sentry-source-file":"AbandonmentModal.tsx",children:"Looks like you faced a problem. What went wrong? "}),i.TjK(e=>(0,a.Y)(A.Pc,{prefix:e.icon,variant:s===e.reason?"filled":void 0,fullWidth:!0,onClick:()=>(e=>{c(e);let t=L[e];t&&T(t.event,t.message,null,null,e),_(e)?u():O({exitFlow:M[e]})})(e.reason),disabled:U(e.reason),"data-sentry-element":"AbandonModalButton","data-sentry-component":"renderButton","data-sentry-source-file":"AbandonmentModal.tsx",children:e.label},e.reason),V),(0,a.FD)("div",{className:"mt-4 flex items-start gap-2",children:[(0,a.Y)(g.In,{icon:N.$.Lock,size:16,className:"mt-0.5 shrink-0 text-neutral-500","data-sentry-element":"Icon","data-sentry-source-file":"AbandonmentModal.tsx"}),(0,a.Y)("span",{className:"text-sm text-neutral-500",children:"Your login info is encrypted, never stored by us, and connections are read-only."})]}),j?(0,a.Y)(E,{abandonmentReason:j,form:m,handleSubmit:n=>{if(T(Y.ExternalAccountConnectionEvent.AbandonFlowExitedWithResponse,Y.ExternalAccountConnectionEventMessage.AbandonFlowExitedWithResponse,null,s||null,s,"object"==typeof e.errorMetadata?{...e.errorMetadata,...n}:{error:e.errorMetadata,...n}),n.userInputMessage&&_(s)){let e=s===C.Gb.IExperiencedATechnicalProblem;o.mutateAsync({issueType:e?w.s.ACCOUNT_CONNECTION_TECHNICAL_ERROR:w.s.ACCOUNT_CONNECTION_DATA_ISSUE,description:e?"Technical problem with ".concat(p):"Account connection issue with ".concat(p),context:{institutionName:p,accountProvider:k,institutionId:t.id,userInputMessage:n.userInputMessage}})}O({exitFlow:W})}}):null]})};var W=n(5949),B=n(57295),U=n(62212),z=n(36934),V=n(4140),j=n(10349),H=n(13360);let q=e=>{let{buttonText:t="Enter or copy/paste holdings"}=e,n="vertical"===e.displayMode;
3return(0,a.Y)(V.K,{displayMode:e.displayMode,className:e.className,fillWidth:e.fillWidth,"data-sentry-element":"ManualPortfolioImportButtonsContainer","data-sentry-component":"ManualPortfolioImporter","data-sentry-source-file":"index.tsx",children:(0,a.Y)(j.A,{render:r=>(0,a.Y)(g.$n,{variant:"outlined",onClick:async()=>{await r()},fullWidth:n,prefix:e.showIcon?(0,a.Y)(H.s,{}):null,children:t}),onCloseAfterSuccess:e.onImporterSuccess,"data-sentry-element":"ManualPortfolioInputLauncher","data-sentry-source-file":"index.tsx"})})};var G=n(18457),K=n(54519),Q=n(89658),$=n(57944);let X="Nothing was imported and your credentials were not saved.",J=e=>{let{showPrivateModeUnavailabilityMessage:t}=e,n=(0,Q.K)(e.accountProvider);return t?(0,a.Y)(A.Uy,{children:(0,a.FD)(A.f3,{children:[n," connection unavailable in incognito (private) mode. Try regular browser session"]})}):null},Z=e=>{let t=r.useRef(!1),{failedInstitutionIds:n,currentInstitution:o,activeProvider:l}=e6(),{data:s,isLoading:c,isSuccess:d,isError:u}=(0,G.eI)(n),m=d||u,p=i.aIS(e.accountProvider,C.$5.SnapTrade),y=m&&!s,h=s?"".concat(X," ").concat(s.name," is also available through another connection partner. Trying that is usually the fastest fix."):X;r.useEffect(()=>{!t.current&&m&&((0,P.trackExternalAccountConnection)({event:Y.ExternalAccountConnectionEvent.RetryFlowStarted,accountProvider:l,institutionName:o.name,message:Y.ExternalAccountConnectionEventMessage.RetryFlowStarted,eventMetadata:{retryInstitution:s}},null,null),t.current=!0)},[l,o.name,m,s]);let f=()=>{e.onCancel({isInvestmentAccountConnected:!1,isManualPortfolioImported:!0})};return(0,a.Y)(g.aF,{disableSubmitOnEnter:!0,open:!0,title:"".concat(o.name," did not finish connecting"),subtitle:h,size:v.rI.Sm,closable:!0,onCancel:()=>{e.onCancel({isInvestmentAccountConnected:!1,isManualPortfolioImported:!1})},maskClosable:!1,footer:(0,a.FD)(v.jl,{children:[(0,a.Y)(z.km,{children:(0,a.Y)(g.N_,{href:K.Ix.tutorialConnectionIssues,openInNewTab:!0,color:"accent",children:"Common connection problems"})}),(0,a.Y)(g.$n,{variant:"outlined",htmlType:"submit",onClick:()=>{e.onTryAgain(o)},children:"Or just try again"})]}),"data-sentry-element":"Modal","data-sentry-component":"OAuthAlternateProviderModal","data-sentry-source-file":"OAuthAlternateProviderModal.tsx",children:(0,a.FD)(A.b,{"data-sentry-element":"InstructionsContainer","data-sentry-source-file":"OAuthAlternateProviderModal.tsx",children:[(0,a.Y)(J,{institute:o,accountProvider:e.accountProvider,showPrivateModeUnavailabilityMessage:p,"data-sentry-element":"BrokerageLoginInstructions","data-sentry-source-file":"OAuthAlternateProviderModal.tsx"}),c?(0,a.Y)(A.WT,{children:(0,a.Y)(g.y$,{size:"sm"})}):null,s?(0,a.Y)(A.WT,{children:(0,a.FD)(g.$n,{variant:"filled",fullWidth:!0,onClick:()=>e.onTryAgain(s),children:["Try ",s.name," via another provider"]})}):null,(0,a.Y)($.t,{render:e=>(0,a.Y)(g.$n,{variant:y?"filled":"outlined",onClick:e,fullWidth:!0,children:"Upload a statement"}),onPortfolioImported:f,"data-sentry-element":"BrokerageStatementsLiveImporter","data-sentry-source-file":"OAuthAlternateProviderModal.tsx"}),(0,a.Y)(q,{displayMode:"vertical",fillWidth:!0,buttonText:"Enter holdings manually",onImporterSuccess:f,"data-sentry-element":"ManualPortfolioImporter","data-sentry-source-file":"OAuthAlternateProviderModal.tsx"})]})})};var ee=n(78190),et=n(63505),en=n(17481),ea=n(92491),er=n.n(ea),eo=n(36608),ei=n(17667),el=n(59334),es=function(e){return e.Success="SUCCESS",e.Failed="FAILED",e.ActionAbandoned="ACTION_ABANDONED",e.MigrationInProgress="MIGRATION_IN_PROGRESS",e}({});let ec="global-predictions-yodlee",ed={configName:"global_predictions"},eu="Yodlee reported a completed add with no account we could exchange";var em=n(81691),ep=n(92672),ey=n(62570),eh=n(87778);let ef=e=>{let{currentInstitution:t}=e6();return(0,a.FD)(ep.Ah,{itemsSpacingVertical:16,flexDirection:"column",alignItems:"flex-start","data-sentry-element":"FlexLayout","data-sentry-component":"YodleeInit","data-sentry-source-file":"YodleeInit.tsx",children:[(0,a.Y)(z.RF,{className:"text-body","data-sentry-element":"H5W600","data-sentry-source-file":"YodleeInit.tsx",children:"Connection"}),(0,a.FD)("div",{children:["You'll be connected to ",t.name," through our trusted partner, Yodlee"]}),(0,a.Y)(g.$n,{onClick:e.onClick,variant:"filled",fullWidth:!0,"data-sentry-element":"Button","data-sentry-source-file":"YodleeInit.tsx",children:"Continue"})]})};var eg=n(7659),ev=function(e){return e.ConnectingInstitution="connectingInstitution",e.OpeningSecureConnection="openingSecureConnection",e}({});let ex=(e,t)=>{switch(e){case"connectingInstitution":return"Connecting to ".concat(t,"...");case"openingSecureConnection":return"Opening a secure connection through our partner..."}},eA=e=>(0,a.Y)(eh.Nc,{disableSubmitOnEnter:!0,open:!0,footer:null,closable:!1,maskClosable:!1,keyboard:!1,destroyOnClose:!0,"data-sentry-element":"StyledAccountProviderConnectStatusModal","data-sentry-component":"ConnectionStatusModal","data-sentry-source-file":"ConnectionStatusModal.tsx",children:(0,a.Y)(eh.Cy,{"data-sentry-element":"StyledConnectProviderContainer","data-sentry-source-file":"ConnectionStatusModal.tsx",children:(0,a.FD)(ep.Ah,{itemsSpacingHorizontal:8,marginTop:8,"data-sentry-element":"FlexLayout","data-sentry-source-file":"ConnectionStatusModal.tsx",children:[(0,a.Y)(z.RF,{
3className:"text-body","data-sentry-element":"H5W600","data-sentry-source-file":"ConnectionStatusModal.tsx",children:ex(e.phase,e.institutionName)}),(0,a.Y)(g.y$,{"data-sentry-element":"Spinner","data-sentry-source-file":"ConnectionStatusModal.tsx"})]})})}),eS=(0,ey.A)(eh.Nc,{target:"es28l870"})(),eb=(0,ey.A)(eh.Cy,{target:"es28l871"})(),eC=()=>{let{hasYodleeContentLoaded:e,hasFastLinkFailedToLoad:t,openYodleeLink:n,handleExitDuringFastLinkLoad:o,currentInstitution:c}=(()=>{let{value:e,setTrue:t}=(0,y.A)(!1),{value:n,setValue:a}=(0,y.A)(!1),o=(0,em.vV)(),c=(0,r.useRef)((()=>{let e=new Set,t=new Set;return{claim:t=>{let n=String(t);return!e.has(n)&&(e.add(n),!0)},confirm:e=>{t.add(String(e))},release:n=>{let a=String(n);e.delete(a),t.delete(a)},hasExchangedAny:()=>t.size>0}})()),{handleUserAbandon:d,handleConnectionError:u,closeAccountProviderConnectStatusModal:m,handleSuccessfulAccountConnect:p,yodleeLinkedPortfolioUpsertMutation:h,connectingAccountId:f,currentInstitution:g,createYodleeLinkTokenMutation:v}=e6(),x=v.data,A=v.isError,S=v.error;(0,r.useEffect)(()=>()=>{var e;null==(e=window.fastlink)||e.close()},[]),(0,r.useEffect)(()=>{A&&(m(),u((null==S?void 0:S.message)||"Failed to generate link token"))},[A]);let b=async e=>{let t={...e,reconnectingAccountId:f};await h.mutateAsync(t,{onSuccess:async t=>{await p(t.id,e)},onError:e=>{(0,l.Ds)(l._n.Error,"Brokerage connection failed",{description:"The token exchange did not complete."}),s.Cp(e)}})},C=async e=>{if(c.current.claim(e.providerAccountId))try{await b(e),c.current.confirm(e.providerAccountId)}catch(t){throw c.current.release(e.providerAccountId),t}},I=async e=>{let t=(e=>{if(null===e||"object"!=typeof e)return null;let t=e.sites;if(Array.isArray(t)){let e=t[0];return null!==e&&"object"==typeof e?e:null}return e})(e);if(!(e=>(null==e?void 0:e.status)===es.Success)(t)){c.current.hasExchangedAny()||(s.wd(eu,{level:"error",extra:{payload:e}}),m(),u(eu));return}m(),await C(t)},w=async e=>{m();let t=i._w2("status",e),n=i.vUk([],i._w2("sites",e)),a=i.d5f(n),r=i.gD_(a)?e:{...e,...a};i.gD_(t)&&a&&(t=i._w2("status",a)),i.aIS(t,"USER_CLOSE_ACTION")?d(r):t===es.Success?await C(a):u(r)},P=e=>{(e=>i.zyy("providerId",e)||i.zyy("requestId",e))(e)||(console.error("Unable to open Yodlee connection pop-up",e),u(e))},k=()=>{i.gD_(x)||i.gD_(o)||((e,n,r)=>{let o=((e,t)=>e?{providerAccountId:e,flow:"edit",...ed}:{providerId:t,flow:"add",...ed})(n,g.id);try{var i;a(!1),null==(i=window.fastlink)||i.open({fastLinkURL:r,params:o,accessToken:"Bearer ".concat(e),onEvent:t,onSuccess:I,onClose:w,onError:P,forceIframe:!0},ec)}catch(e){a(!0)}})(x.token,x.providerAccountId,i._w2("userDict",o).yodleeFastlinkUrl)};return(0,r.useEffect)(()=>{k()},[x,o]),{hasYodleeContentLoaded:e,openYodleeLink:k,hasFastLinkFailedToLoad:n,handleExitDuringFastLinkLoad:()=>{d("User abandoned yodlee modal with close click")},currentInstitution:g}})(),{value:d,setValue:u}=(0,y.A)(!0),m=(0,r.useRef)(null),p=!e&&!t,h=d&&!t&&!p,f=!h&&d;return(0,eg.A)(()=>{let{current:e}=m;e&&u(""===e.innerHTML.trim())},f?1e3:null),(0,a.FD)(eS,{disableSubmitOnEnter:!0,open:!0,footer:null,closable:d,destroyOnClose:!0,onCancel:o,maskClosable:!1,title:h?"Complete account connection flow in new window":null,"data-sentry-element":"StyledYodleeModal","data-sentry-component":"YodleeModal","data-sentry-source-file":"Yodlee.tsx",children:[p?(0,a.FD)(ep.Ah,{itemsSpacingHorizontal:8,children:[(0,a.Y)(z.RF,{className:"text-body",children:ex(ev.OpeningSecureConnection,c.name)}),(0,a.Y)(g.y$,{})]}):null,t?(0,a.Y)(ef,{onClick:n}):null,(0,a.Y)(eb,{id:ec,ref:m,"data-sentry-element":"StyledContainer","data-sentry-source-file":"Yodlee.tsx"})]})},eI=()=>{let{currentInstitution:e,setAutoConnectProviderStatus:t}=e6();return r.useEffect(()=>{t(C.B9.Requested)},[t]),(0,a.Y)(eA,{phase:ev.ConnectingInstitution,institutionName:e.name,"data-sentry-element":"ConnectionStatusModal","data-sentry-component":"Connecting","data-sentry-source-file":"Connecting.tsx"})},ew=()=>{let{activeProvider:e,stringifiedContextUniqueKey:t}=e6();return i.aIS(e,C.$5.Yodlee)?(0,a.Y)(eC,{}):(0,a.Y)(eI,{"data-sentry-element":"Connecting","data-sentry-component":"AccountProviderConnectStatusModal","data-sentry-source-file":"AccountProviderConnectStatusModal.tsx"},t)};var eP=n(68076),ek=n(97691),eF=n(88963),eT=n(62031),eE=n.n(eT),eY=n(13125),eD=n.n(eY);class eR{constructor(){this.exchangePublicToken=async e=>{let t=eD()({publicToken:e.brokerageAuthorizationId,accountProvider:C.$5.SnapTrade,enableTrading:e.enableTrading}),n=await this.apiCaller.post("/exchange_public_token",t);return eE()(n)},this.apiCaller=new eF.Ay}}let eN=new eR;var eM=n(99026);let eL=e=>((e=>{let t=(0,r.useRef)(e);t.current=e,(0,r.useEffect)(()=>{let e=e=>{e.preventDefault(),t.current()};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}},[])})(e.callback||eM.lQ),null),e_=Object.freeze({showAccountProviderConnectStatusModal:"Provider Connect Status",showTroubleshootingModal:"Troubleshooting",showAbandonModal:"Abandonment",showNonProviderImportModal:"Non Provider Import",showEmptyAccountModal:"Empty Account",showAccountSyncingModal:"Account Syncing",showAccountReviewPopup:"Account Review",showAccountSetupPopup:"Account Setup",showIncompletePortfolioWarning:"Incomplete Portfolio Warning"}),eO=e=>{let{activeProvider:t,currentInstitution:n,flowStageStates:r}=e,o=i.vUk(null,i.I6j(e=>r[e],i.HPH(e_)));return o?(0,a.Y)(eL,{callback:()=>{let e=o?e_[o]:null;(0,P.trackExternalAccountConnection)({event:Y.ExternalAccountConnectionEvent.ConnectionFlowMidExitAlertShown,accountProvider:t,institutionName:n.name,institutionId:n.id,message:Y.ExternalAccountConnectionEventMessage.ConnectionFlowMidExitAlertShown,eventMetadata:{flowStage:e}},null,null)}}):null};var eW=n(10090),eB=n(62346),eU=n(37699);let ez=e=>{let{data:t=[]}=(0,eB.aV)(),n=(0,eU.ZS)(e.investmentAccountId,t);return n?(0,a.FD)(g.aF,{disableSubmitOnEnter:!0,title:"".concat(n.nickName," reconnection failed"),open:!0,size:v.rI.Sm,maskClosable:!1,keyboard:!1,closable:!0,okText:"Try again",onOk:()=>{e.onTryAgain()},onCancel:()=>{e.onCancel()},"data-sentry-element":"Modal","data-sentry-component":"ReconnectTroubleshootingModal","data-sentry-source-file":"ReconnectTroubleshootingModal.tsx",children:[(0,a.Y)(z.bU,{
3className:"text-body","data-sentry-element":"Body1W400","data-sentry-source-file":"ReconnectTroubleshootingModal.tsx",children:"We weren't able to reconnect this account. That can happen sometimes. Please try again, and if it still doesn't work:"}),(0,a.FD)(A.K9,{"data-sentry-element":"UnorderedListInstructions","data-sentry-source-file":"ReconnectTroubleshootingModal.tsx",children:[(0,a.Y)(A.eK,{"data-sentry-element":"ListInstructionItem","data-sentry-source-file":"ReconnectTroubleshootingModal.tsx",children:(0,a.Y)(z.bU,{className:"text-body","data-sentry-element":"Body1W400","data-sentry-source-file":"ReconnectTroubleshootingModal.tsx",children:"Try to sync a few hours later."})}),(0,a.Y)(A.eK,{"data-sentry-element":"ListInstructionItem","data-sentry-source-file":"ReconnectTroubleshootingModal.tsx",children:(0,a.Y)(z.bU,{className:"text-body","data-sentry-element":"Body1W400","data-sentry-source-file":"ReconnectTroubleshootingModal.tsx",children:"Remove the account and re-connect with the brokerage."})})]})]}):null};var eV=n(33904),ej=n(73672);let eH=e=>{let t=()=>{e.onClose({isPortfolioImported:!0})};return(0,a.Y)(g.aF,{disableSubmitOnEnter:!0,open:!0,title:"Add holdings without connecting",size:v.rI.Sm,closable:!0,onCancel:()=>{e.onClose({isPortfolioImported:!1})},maskClosable:!1,footer:null,"data-sentry-element":"Modal","data-sentry-component":"NonProviderImportModal","data-sentry-source-file":"NonProviderImportModal.tsx",children:(0,a.FD)(A.b,{"data-sentry-element":"InstructionsContainer","data-sentry-source-file":"NonProviderImportModal.tsx",children:[(0,a.Y)(A.f3,{"data-sentry-element":"TroubleshootingDescription","data-sentry-source-file":"NonProviderImportModal.tsx",children:"Prefer not to use your login? That's ok."}),(0,a.Y)(g.Fc,{status:"info",variant:"outlined",title:"Bank-level encryption",description:(0,a.FD)(r.Fragment,{children:["We encrypt everything you import.",(0,a.Y)("span",{className:"block",children:(0,a.Y)(g.N_,{color:"accent",weight:"semibold",onClick:()=>{(0,eM.V3)(K.L0.security)},children:"Learn about our security"})})]}),"data-sentry-element":"Alert","data-sentry-source-file":"NonProviderImportModal.tsx"}),(0,a.FD)(ep.Ah,{flexDirection:"column",itemsSpacingVertical:8,alignItems:"stretch",occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"NonProviderImportModal.tsx",children:[(0,a.Y)($.t,{render:e=>(0,a.Y)(g.$n,{variant:"filled",onClick:e,fullWidth:!0,prefix:(0,a.Y)(g.In,{icon:N.$.ArrowOutOfBox}),children:"Upload statement"}),onPortfolioImported:t,"data-sentry-element":"BrokerageStatementsLiveImporter","data-sentry-source-file":"NonProviderImportModal.tsx"}),(0,a.Y)(q,{displayMode:"vertical",fillWidth:!0,onImporterSuccess:t,"data-sentry-element":"ManualPortfolioImporter","data-sentry-source-file":"NonProviderImportModal.tsx"})]}),(0,a.Y)(g.N_,{color:"accent",onClick:e.onBackToConnecting,className:"self-center","data-sentry-element":"Link","data-sentry-source-file":"NonProviderImportModal.tsx",children:"Back to connecting an account"})]})})},eq=()=>{let{currentInstitution:e}=e6();return(0,a.Y)(eA,{phase:ev.ConnectingInstitution,institutionName:e.name,"data-sentry-element":"ConnectionStatusModal","data-sentry-component":"ConnectingProvider","data-sentry-source-file":"AccountLinking.tsx"})},eG=()=>{let{createPlaidLinkTokenMutation:e,initiatePlaidConnection:t}=e6();return(r.useEffect(()=>{t()},[]),e.isLoading)?(0,a.Y)(eq,{}):null},eK=()=>{let{createSnapTradeLinkTokenMutation:e,initiateSnapTradeConnection:t}=e6();return(r.useEffect(()=>{t()},[]),e.isLoading)?(0,a.Y)(eq,{}):null},eQ=()=>{let{createYodleeLinkTokenMutation:e,initiateYodleeConnection:t}=e6();return(r.useEffect(()=>{t()},[]),e.isLoading)?(0,a.Y)(eq,{}):null},e$=()=>{let{activeProvider:e}=e6();switch(e){case C.$5.Plaid:return(0,a.Y)(eG,{});case C.$5.SnapTrade:return(0,a.Y)(eK,{});case C.$5.Yodlee:return(0,a.Y)(eQ,{});default:return null}};var eX=n(84245),eJ=n(84461),eZ=n(89417),e0=n(81491),e1=n(6915),e2=function(e){return e.UserAbort="UserAbort",e.ErrorAbort="ErrorAbort",e}(e2||{});let e4=r.createContext(void 0);e4.displayName="BrokerageProviderContext";let e5=e=>{let[t,n]=r.useState(e.institution),[s,d]=r.useState(e.reconnectingInvestmentAccount),[u,m]=r.useState(null),h=(0,eV.ob)([]),[f,g]=r.useState(null),[v,x]=r.useState(null),[A,S]=r.useState(null),{value:b,setTrue:w,setFalse:k}=(0,y.A)(!1),{value:F,setTrue:T,setFalse:E}=(0,y.A)(!1),{value:D,setTrue:R,setFalse:N}
3=(0,y.A)(!1),{launchReattachPreview:M}=(0,et.Gy)(),{launchSecuritiesNetworthAssetImporter:L}=(0,eJ.c)();(0,et.UZ)(e=>{let{newInvestmentAccountId:t}=e;x(t),R()});let{value:_,setTrue:z,setFalse:V}=(0,y.A)(!1),{value:j,setTrue:H,setFalse:q}=(0,y.A)(!1),{isUserInOnboarding:G}=(0,I.A)(),K=u===ee.W8.Reconnect,Q=!G&&!K,$=(0,c.NF)(Q),X=(e=>{let t=(0,el.L)(Y.PortfoliosSyncMode.Manual);return(0,ei.A)(async n=>{let a=await eN.exchangePublicToken(n),r={accountProvider:C.$5.SnapTrade,investmentAccountId:a.id};return e?t.mutate(r):await t.mutateAsync(r),a})})(Q),J=(e=>{let t=(0,el.L)(Y.PortfoliosSyncMode.Manual);return(0,ei.A)(async n=>{let a=await eo.A.exchangeYodleeToken(n),r={accountProvider:C.$5.Yodlee,investmentAccountId:a.id};return e?t.mutate(r):await t.mutateAsync(r),a})})(Q),ea=(0,c.gL)(),es=(0,W.O)(),ec=(0,B.k)(),ed=(0,ej.vA)(),eu=(0,U.j)(),{isGuestSession:em}=(0,e1.Cs)(),{useReconnectRetryListener:ep,emitReconnectRetry:ey}=(0,o.createEvent)("ReconnectRetry")(),{getSuppressedWarningMetadata:eh,incompletePortfolioWarningSnapshot:ef,launchWarning:eg,closeWarning:ev}=(0,eW.B)(),ex=t.id,eA=t.name,eS=t.accountProvider,eb=Array.from(h.values()),eC=i.aIS(A,C.B9.Requested),eI=i.aIS(A,C.B9.Processing),eF=er().sentence(i.vUk("",eS)),eT=ef.showWarning,eE=e=>{(0,P.trackExternalAccountConnection)({event:Y.ExternalAccountConnectionEvent.Success,accountProvider:eS,institutionName:eA,message:Y.ExternalAccountConnectionEventMessage.Success,eventMetadata:{...e},isReconnect:K},null,null),console.log("".concat(eF," connection success"))},eY=()=>h.clear(),eD=()=>h.add(ex),eR=(t,n)=>{g(null),eY(),(n.isInvestmentAccountConnected||n.isManualPortfolioImported)&&ed.mutate(),e.onAccountSetupFlowExit(t,n)},eM=t=>{let{setupFinalOutcome:n}=t;x(null),e.onAccountSetupSuccess({setupFinalOutcome:n}),eR(n,{isInvestmentAccountConnected:!0,isManualPortfolioImported:!1})},eL=()=>{eR(C.sA.LinkTokenError,{isInvestmentAccountConnected:!1,isManualPortfolioImported:!1})},e_=()=>{T()};((e,t,n)=>{let a=r.useRef(null);r.useEffect(()=>{e&&a.current!==t&&(a.current=t,n())},[e,t])})(F,t,()=>{(0,P.trackExternalAccountConnection)({event:Y.ExternalAccountConnectionEvent.ConnectionFlowStarted,institutionName:eA,accountProvider:eS,message:Y.ExternalAccountConnectionEventMessage.ConnectionFlowStarted,isReconnect:K},null,null)});let eB=()=>{S(null),E()},eq=e=>{eB();let{abortType:t,metadata:n}=e,a="UserAbort"===t,r="ErrorAbort"===t;(()=>{if(a)(0,P.trackExternalAccountConnection)({event:Y.ExternalAccountConnectionEvent.FlowExited,accountProvider:eS,institutionName:eA,message:Y.ExternalAccountConnectionEventMessage.FlowExited,eventMetadata:{exitMetadata:n},isReconnect:K},null,null);else r&&(e=>{let t=(e=>p.A(e)?{errorMessage:e}:e instanceof Error?{errorMessage:e.message}:{...e})(e);(0,P.trackExternalAccountConnection)({event:Y.ExternalAccountConnectionEvent.ConnectionErroredOut,accountProvider:eS,institutionName:eA,institutionId:ex,message:Y.ExternalAccountConnectionEventMessage.ConnectionErroredOut,eventMetadata:t,isReconnect:K},null,{category:Y.ExternalAccountConnectionEventMessage.ConnectionErroredOut,errorMetadata:{...t,abandonmentReason:Y.ExternalAccountConnectionEventMessage.ConnectionErroredOut},isUserInOnboarding:G})})(n)})(),K?r?z():eR(C.sA.ReconnectAbandoned,{isInvestmentAccountConnected:!1,isManualPortfolioImported:!1}):a?(g(n),w()):(g(n),z())},eG=e=>{switch(k(),eB(),eD(),e.exitFlow){case C._z.RetryWithAlternateProvider:z();break;case C._z.RetryWithNonProviderImporter:H();break;case C._z.AbortConnectionFlow:default:eR(C.sA.ConnectionAbandoned,{isInvestmentAccountConnected:!1,isManualPortfolioImported:!1})}},eK=async()=>{(0,eZ.R3)()||await L()},eQ=async(e,t)=>{var n;V(),eY(),K&&await eu.refetchQueries(eX.u$);let a=s?(0,eU.F5)(eu,s.id):void 0,r=!!(null!=(n=null==a?void 0:a.providerRemoved)?n:null==s?void 0:s.providerRemoved);if(K&&r&&e!==(null==s?void 0:s.id)&&s)eE(t),x(e),M({archivedInvestmentAccountId:s.id,newInvestmentAccountId:e}),eM({setupFinalOutcome:C.in.UnflaggedCompleteImport});else G||K?(eE(t),x(e),R()):(eE(t),x(e),await eu.refetchQueries(eX.u$),await eK(),(e=>{var t;let n=(0,eU.F5)(eu,e);(0,e0.Sv)((null==n||null==(t=n.bankName)?void 0:t.toString())||eA)})(e),eM({setupFinalOutcome:C.in.UnflaggedCompleteImport}))},e2={currentInstitutionId:ex,connectingAccountId:v,activeProvider:eS},e5="".concat(ex).concat(v).concat(eS),e6=async()=>{ey(e2),V()},e3=e=>{V(),eD(),e&&(n(e),S(C.B9.Requested))},e8=async()=>
3{if(v){let e=await eh();N(),e&&e.isIncomplete?eg(e.metadata):eM({setupFinalOutcome:C.in.UnflaggedCompleteImport})}else console.error("Connected account id is unavailable to analyse incomplete portfolio status"),N(),eM({setupFinalOutcome:C.in.UnflaggedCompleteImport})},e7=()=>{ev(),eM({setupFinalOutcome:C.in.ImportFlaggingIgnored})},e9=async()=>{await e8()},te=async()=>{await e8()},tt=()=>{V(),eR(C.sA.ReconnectAbandoned,{isInvestmentAccountConnected:!1,isManualPortfolioImported:!1})},tn=e=>{V(),eR(C.sA.AlternateProviderAborted,e)},ta=e=>{let{isPortfolioImported:t}=e;q(),eR(C.sA.ConnectionAbandoned,{isInvestmentAccountConnected:!1,isManualPortfolioImported:t})},tr=()=>{q(),z()},to=()=>{em||(0,l.Ds)(l._n.Error,"Failed to connect",{description:"Please try again later."}),eL()},ti=()=>{S(C.B9.LinkTokenReady)},tl=async()=>{await ea.mutateAsync({institutionId:t.id,reconnectingAccountId:null==s?void 0:s.id},{onError:to,onSuccess:ti})},ts=async()=>{var e;await es.mutateAsync({institutionId:t.id,broker:(null==s||null==(e=s.bankName)?void 0:e.toString())||t.id,reconnectingAccountId:null==s?void 0:s.id,reconnectingBankId:null==s?void 0:s.bankId},{onError:to,onSuccess:ti})},tc=async()=>{await ec.mutateAsync({reconnectingAccountId:null==s?void 0:s.id},{onError:to,onSuccess:ti})};return r.useEffect(()=>{i.mKk(A,[C.B9.LinkTokenReady,C.B9.Requested,C.B9.Processing])?e_(
3):i.aIS(A,C.B9.Processed)&&eB()},[A]),(0,a.FD)(e4.Provider,{value:{currentInstitution:t,reconnectingInvestmentAccount:s,setReconnectingInvestmentAccount:d,plaidLinkedPortfolioUpsertMutation:$,snapTradeLinkedPortfolioUpsertMutation:X,yodleeLinkedPortfolioUpsertMutation:J,createPlaidLinkTokenMutation:ea,createSnapTradeLinkTokenMutation:es,createYodleeLinkTokenMutation:ec,activeProvider:eS,failedInstitutionIds:eb,connectingAccountId:v,setConnectingAccountId:x,openAccountProviderConnectStatusModal:e_,closeAccountProviderConnectStatusModal:eB,handleSuccessfulAccountConnect:eQ,handleUserAbandon:e=>{eq({abortType:"UserAbort",metadata:e})},openNonProviderImportModal:H,handleConnectionError:e=>{eB(),eD(),eq({abortType:"ErrorAbort",metadata:e})},handleLinkTokenError:eL,useReconnectRetryListener:ep,setCurrentInstitution:n,setBrokerageConnectionMode:m,brokerageConnectionMode:u,contextUniqueKey:e2,stringifiedContextUniqueKey:e5,setAutoConnectProviderStatus:S,isAutoConnectProviderRequested:eC,isAutoConnectProviderProcessing:eI,initiatePlaidConnection:tl,initiateSnapTradeConnection:ts,initiateYodleeConnection:tc},"data-sentry-element":"unknown","data-sentry-component":"BrokerageProvider","data-sentry-source-file":"brokeragesContext.tsx",children:[e.children,(0,a.Y)(e$,{"data-sentry-element":"AccountLinking","data-sentry-source-file":"brokeragesContext.tsx"}),(()=>{if(b)return(0,a.Y)(O,{errorMetadata:f,onClose:eG});if(j)return(0,a.Y)(eH,{onClose:ta,onBackToConnecting:tr});if(_)if(K&&v)return(0,a.Y)(ez,{investmentAccountId:v,onTryAgain:e6,onCancel:tt});else return(0,a.Y)(Z,{accountProvider:eS,onCancel:tn,onTryAgain:e3});if(v&&D)return(0,a.Y)(en.A,{investmentAccountId:v,openAs:en.h.Modal,isOperationAbortable:!1,onClose:te,onCancel:e9})})(),F&&eS?(0,a.Y)(ew,{}):null,eT?(0,a.Y)(ek.L,{warningData:{metadata:ef.metadata,type:eP.h.ConnectedAccount},open:eT,onIgnore:e7,onAddAnotherAccount:e7,onKeepDemoPortfolio:()=>{ev(),eM({setupFinalOutcome:C.in.FlaggedImportWithDemoAcceptance})}}):null,(0,a.Y)(eO,{activeProvider:eS,currentInstitution:t,flowStageStates:{showAccountProviderConnectStatusModal:F,showTroubleshootingModal:_,showAbandonModal:b,showNonProviderImportModal:j,showEmptyAccountModal:!1,showAccountSyncingModal:!1,showAccountReviewPopup:!1,showAccountSetupPopup:D,showIncompletePortfolioWarning:eT},"data-sentry-element":"ConnectionFlowUnloadPrompt","data-sentry-source-file":"brokeragesContext.tsx"})]})},e6=()=>{let e=r.useContext(e4);if(void 0===e)throw Error("useBrokerageProviders must be used within a BrokerageProvider");return e};var e3=n(43401);let e8=e=>i.aIS(e,C.B9.Processing)?C.B9.Processed:e,e7=e=>{let{isAutoConnectProviderRequested:t,isAutoConnectProviderProcessing:n,setAutoConnectProviderStatus:a,handleConnectionError:o}=e6(),l=r.useRef(null),s={token:e.token,onSuccess:(t,n)=>{e.onSuccess(t,n)},onEvent:(e,t)=>{i.aIS(e,d.PlaidLinkStableEvent.OPEN)&&a(e8),(0,m.f)(e,t,P.trackExternalAccountConnection)},onExit:(t,n)=>{if(u.A(t))try{let a={...t,...n};e.onError(a)}catch(e){console.error("Plaid onExit Handler Failed",e)}else console.log("Plaid onExit called without error object",t,n),e.onAbandon(n);(0,m.L)()}},{open:c,ready:p}=(0,d.usePlaidLink)(s),y=i.Uo6(p,i.AU6(e.exchangingPublicToken));return(0,e3.Z)(()=>{o(Error("Plaid Link did not open"))},n?2e4:null),r.useLayoutEffect(()=>{l.current=()=>{a(C.B9.Processing),c()}}),r.useEffect(()=>{e.controlledOpen&&c()},[e.controlledOpen]),r.useEffect(()=>{t&&l.current&&y&&l.current()},[t,y]),null},e9=e=>{let[t,n]=r.useState(!1),{value:o,setTrue:d,setFalse:u}=(0,y.A)(!1),{handleUserAbandon:p,plaidLinkedPortfolioUpsertMutation:h,useReconnectRetryListener:f,handleConnectionError:g,handleSuccessfulAccountConnect:v,contextUniqueKey:x,createPlaidLinkTokenMutation:A}=e6(),{name:S}=e.institution,b=async e=>{let t=e.metadata,a=e.publicToken;if(a&&t){n(!0);let r=(()=>{switch(e.connectionMode){case c.u6.NewConnection:return{plaidPublicToken:a,connectionMode:e.connectionMode};case c.u6.Reconnection:return{plaidPublicToken:a,connectionMode:e.connectionMode,reconnectingAccountId:e.reconnectingAccountId}}})();await h.mutateAsync(r,{onSuccess:async e=>{await v(e.id,t)},onError:e=>{(0,l.Ds)(l._n.Error,"Brokerage connection failed",{description:"The token exchange did n
3ot complete."}),s.Cp(e)},onSettled:()=>{n(!1)}})}(0,m.L)()},C=async(t,n)=>{u(),e.reconnectingInvestmentAccount?await b({connectionMode:c.u6.Reconnection,reconnectingAccountId:e.reconnectingInvestmentAccount.id,metadata:n,publicToken:t}):await b({connectionMode:c.u6.NewConnection,publicToken:t,metadata:n})};f(e=>{i.aIS(e,x)&&d()}),r.useEffect(()=>()=>{(0,m.L)()},[]);let I=A.data;return I?(0,a.Y)(e7,{onAbandon:e=>{u(),p(e)},currentInstitutionName:S,onError:e=>{u(),g(e)},exchangingPublicToken:t,token:I,onSuccess:C,controlledOpen:o}):null};var te=n(40248),tt=n(92283),tn=n(93407),ta=n(35208),tr=n(47650),to=n(61435),ti=n(74977),tl=n(76778);let ts=ta.Bf.modal+1,tc=e=>{let t=(0,tl.K)(e.onClose);if(r.useEffect(()=>{let e=e=>{"Escape"===e.key&&t()};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),"undefined"==typeof document)return null;let n=(0,tr.createPortal)((0,a.Y)("button",{type:"button","aria-label":"Close SnapTrade connection",onClick:e.onClose,className:"fixed top-4 right-4 flex items-center justify-center w-9 h-9 rounded-full bg-white shadow-md text-body hover:bg-neutral-100",style:{zIndex:ts},children:(0,a.Y)(to.I,{icon:N.$.CrossMedium,size:20})}),document.body);return(0,a.FD)(r.Fragment,{children:[e.showTimeoutAffordance?null:n,(0,a.Y)(v.Ay,{open:e.showTimeoutAffordance,title:"".concat(e.institutionName," is not loading"),onCancel:e.onClose,zIndex:ts,size:v.rI.Sm,centered:!0,maskClosable:!1,keyboard:!1,footer:(0,a.FD)(v.jl,{children:[(0,a.Y)(te.A,{variant:"outlined",color:"neutral",onClick:e.onImportWithoutConnecting,children:"Upload a statement or enter manually"}),(0,a.Y)(te.A,{variant:"filled",onClick:e.onRetry,children:"Try again"})]}),"data-sentry-element":"Modal","data-sentry-source-file":"SnapTradePortalHostControls.tsx",children:(0,a.FD)(ep.Ah,{flexDirection:"column",itemsSpacingVertical:16,"data-sentry-element":"FlexLayout","data-sentry-source-file":"SnapTradePortalHostControls.tsx",children:[(0,a.Y)(z.bU,{className:"text-body","data-sentry-element":"Body1W400","data-sentry-source-file":"SnapTradePortalHostControls.tsx",children:"The connection window has not opened. This is usually an ad blocker, a VPN, or a browser extension blocking our provider."}),(0,a.Y)(ti.F,{status:"info",variant:"light",title:"Nothing has been sent to ".concat(e.institutionName," and no credentials were entered."),"data-sentry-element":"Alert","data-sentry-source-file":"SnapTradePortalHostControls.tsx"})]})})]})};var td=n(24092);let tu=["https://app.snaptrade.com","https://app.staging.snaptrade.com","https://app.local.snaptrade.com","https://connect.snaptrade.com"],tm=()=>{let e=document.getElementById("snaptrade-react-connection-portal");return e instanceof HTMLIFrameElement?e:null},tp=e=>{let{hasTimedOut:t}=(e=>{let{value:t,setTrue:n,setFalse:a}=(0,y.A)(!1),{value:r,setTrue:o,setFalse:i}=(0,y.A)(!1),{value:l,setTrue:s,setFalse:c}=(0,y.A)(!1);(0,td.E)(()=>{if(!e)return;a(),i(),c();let t=()=>{o(),c()},r=e=>{(e=>!!e.data&&tu.includes(e.origin))(e)&&(n(),c())},l=new Set,s=e=>{l.has(e)||(l.add(e),e.addEventListener("load",t))},d=tm();d&&s(d);let u=new MutationObserver(()=>{let e=tm();e&&s(e)});return u.observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("message",r,!1),()=>{window.removeEventListener("message",r,!1),l.forEach(e=>e.removeEventListener("load",t)),u.disconnect()}},[e]);let d=e&&!t&&!r&&!l;return(0,e3.Z)(s,d?12e3:null),{hasReceivedMessage:t,hasLoaded:r,hasTimedOut:l}})(e.isOpen);return(0,a.FD)(r.Fragment,{children:[(0,a.Y)(tn.a,{...e,contentLabel:"Connect Account via SnapTrade",style:{overlay:{zIndex:ta.Bf.modal}},"data-sentry-element":"SnapTradeReact","data-sentry-source-file":"SnaptradePortalWrapper.tsx"}),e.isOpen?(0,a.Y)(tc,{showTimeoutAffordance:t,institutionName:e.institutionName,onClose:e.onExit,onRetry:e.onRetry,onImportWithoutConnecting:e.onImportWithoutConnecting}):null]})};var ty=n(65460);let th=e=>{let{portalProps:t,reconnectInvestmentAccount:n}=e,o=null==n?void 0:n.id,s=tt.A(o),c=r.useRef(null),{currentInstitution:d,handleUserAbandon:u,openNonProviderImportModal:m,snapTradeLinkedPortfolioUpsertMutation:p,handleConnectionError:y,handleSuccessfulAccountConnect:h}=e6(),f=i.vUk(d.id,null==n?void 0:n.institutionId),g=(0,U.j)(),v=()=>{t.onClose()},x=async e=>{await h(e,null)},A=()=>{console.error("Error reconnecting SnapTrade linked investment account",{investmentAccountIdParam:o}),(0,l.Ds)(l._n.Error,"Investment account not found",{description:"The selected account could not be located."})},S=async e=>{let t=(0,eU.F5)(g,e);t?await h(t.id,null):A()},b=async e=>{c.current=null,v(),await p.mutateAsync({brokerageAuthorizationId:e,enableTrading:(0,ty.on)(f)},{onSuccess:async e=>{let t=e.id;if(s){var a;let e=i.aIS(t,o),r=tt.A(o)?(0,eU.F5)(g,o):void 0,l=!!(null!=(a=null==r?void 0:r.providerRemoved)?a:null==n?void 0:n.providerRemoved);e?await S(t):l?await x(t):(console.error("Investment account id mismatch during SnapTrade account reconnection flow",{syncedInvestmentAccountId:t,reconnectInvestmentAccountId:o}),A())}else await x(t)},onError:e=>{y(e)}})};return t.showConnectionPortal?(0,a.Y)(r.Fragment,{children:(0,a.Y)(tp,{loginLink:t.loginLink,isOpen:t.showConnectionPortal,closeOnOverlayClick:!1,institutionName:d.name,close:v,onSuccess:b,onError:e=>{c.current=e},onExit:()=>{let e;v(),c.current&&(e=c.current,!i.mKk(e.statusCode,[401,403]))?y(c.current):u(c.current)},onRetry:t.onRetry,onImportWithoutConnecting:()=>{v(),m()}})}):null},tf=e=>{let{institution:t,connectedInvestmentAccount:n}=e,o=t.name,l=!!n,{data:s=eB.IJ,isLoading:c}=(0,eB.aV)(),{useReconnectRetryListener:d,contextUniqueKey:u,setAutoConnectProviderStatus:m,isAutoConnectProviderRequested:p,createSnapTradeLinkTokenMutation:h,initiateSnapTradeConnection:f,currentInstitution:x}=e6(),{value:A,setTrue:S,setFalse:b}
3=(0,y.A)(!1),{value:I,setTrue:w,setFalse:P}=(0,y.A)(!1),[k,F]=r.useState(!c&&(0,Q.s)(s,o)&&!l),T=h.data,E=h.isSuccess&&T,Y=()=>{w()};d(e=>{i.aIS(e,u)&&f().then(()=>{Y()})});let D=()=>{b()},R=async()=>{m(C.B9.Processing),await f(),Y(),m(C.B9.Processed)};return(r.useEffect(()=>{(async()=>{p&&(k?(S(),m(C.B9.Processed)):await R())})()},[p,k]),h.isError)?(console.error("Failed to fetch link token"),null):(0,a.Y)(r.Fragment,{children:A?(0,a.FD)(g.aF,{disableSubmitOnEnter:!0,title:"You already have a ".concat(o," connection"),open:A,onCancel:D,footer:(0,a.FD)(v.jl,{children:[x.institutionUrl?(0,a.FD)(te.A,{onClick:()=>{x.institutionUrl&&(0,eM.V3)(x.institutionUrl)},children:["Log out of ",o]}):(0,a.Y)(te.A,{onClick:D,children:"Cancel"}),(0,a.Y)(te.A,{variant:"filled",onClick:()=>{b(),F(!1),m(C.B9.LinkTokenReady)},children:"Continue"})]}),children:["To add a different account at ",o,", log out of ",o," first, then continue.",(0,a.Y)("br",{}),(0,a.Y)("br",{}),"If you meant to repair the existing connection, reconnect it instead.",(0,a.Y)("br",{}),(0,a.Y)("br",{}),"Note: We currently don't support managed accounts at ",o," via"," ",(0,Q.K)(t.accountProvider),"."]}):E?(0,a.Y)(th,{portalProps:{loginLink:T,showConnectionPortal:I,onClose:()=>{P()},onRetry:()=>{P(),R().catch(eM.lQ)}},reconnectInvestmentAccount:i.vUk(null,n)}):null})},tg=()=>{let{openAccountProviderConnectStatusModal:e,isAutoConnectProviderRequested:t,useReconnectRetryListener:n,contextUniqueKey:a}=e6(),o=r.useRef(null);return n(t=>{i.aIS(t,a)&&e()}),r.useLayoutEffect(()=>{o.current=()=>{e()}}),r.useEffect(()=>{t&&o.current&&o.current()},[t]),null};var tv=n(97077);let tx=e=>{let{brokerageConnectionMode:t,currentInstitution:n}=e6(),{value:o,setFalse:i}=(0,y.A)(!0),l=(0,eU.VE)(e.reconnectingInvestmentAccount);return t!==ee.W8.Reconnect||l?null:(0,a.Y)(r.Fragment,{children:o?(0,a.Y)(g.aF,{disableSubmitOnEnter:!0,title:"Let's fix ".concat(n.name," account sync issue."),open:!0,onCancel:i,footer:(0,a.Y)(ep.Ah,{justifyContent:"flex-end",children:(0,a.Y)(tv.R,{title:"Sync net worth"})}),children:(0,a.Y)(z.se,{className:"text-neutral-500",children:'Please visit the ASA Vault app and make sure your accounts are properly connected. After you make the necessary changes, tap "Sync net worth" below to refresh your accounts.'})}):null})},tA=e=>{let{mode:t,reconnectingInvestmentAccount:n}=e,{activeProvider:o,setCurrentInstitution:l,setBrokerageConnectionMode:s,setConnectingAccountId:c,currentInstitution:d}=e6();if(r.useEffect(()=>{e.institution&&l(e.institution)},[e.institution,l]),r.useEffect(()=>{c(i.vUk(null,null==n?void 0:n.id))},[n,c]),r.useEffect(()=>{s(t)},[t,s]),d){let t=i.VxE(e,{institution:d});switch(o){case C.$5.Plaid:return(0,a.Y)(e9,{...t});case C.$5.SnapTrade:return(0,a.Y)(tf,{institution:d,connectedInvestmentAccount:n});case C.$5.Yodlee:return(0,a.Y)(tg,{});case C.$5.Asa:return(0,a.Y)(tx,{reconnectingInvestmentAccount:n})}}return null},tS=e=>(0,a.Y)(e5,{institution:e.institution,reconnectingInvestmentAccount:e.reconnectingInvestmentAccount,onAccountSetupSuccess:e.onAccountSetupSuccess,onAccountSetupFlowExit:e.onAccountConnectionFlowExit,"data-sentry-element":"BrokerageProvider","data-sentry-component":"Portal","data-sentry-source-file":"Portal.tsx",children:(0,a.Y)(tA,{...e,"data-sentry-element":"AccountProvidersPortal","data-sentry-source-file":"Portal.tsx"})}),{useGlobalBrokeragePortalLaunchEventListener:tb,emitGlobalBrokeragePortalLaunchEvent:tC}=(0,o.createEvent)("GlobalBrokeragePortalLaunchEvent")(),tI=()=>({launchGlobalBrokeragePortal:async e=>{tC(e)}}),tw=()=>{(0,eB.aV)();let[e,t]=r.useState(null),n=r.useRef(eM.lQ),o=r.useRef(eM.lQ);tb(async e=>{let{onAccountSetupSuccess:a,onAccountConnectionFlowExit:r,...i}=e;n.current=a||eM.lQ,o.current=r||eM.lQ,t(i)});let i=()=>{t(null),n.current=eM.lQ,o.current=eM.lQ},l=async e=>{await n.current(e),i()},s=async(e,t)=>{await o.current(e,t),i()};return e?(0,a.Y)(tS,{institution:e.institution,reconnectingInvestmentAccount:e.reconnectingInvestmentAccount,mode:e.mode,onAccountSetupSuccess:l,onAccountConnectionFlowExit:s,"data-sentry-element":"Portal","data-sentry-component":"GlobalBrokeragePortal","data-sentry-source-file":"GlobalBrokeragePortal.t
3sx"}):null}},45239:(e,t,n)=>{n.d(t,{Fs:()=>s.A,NW:()=>d.A,WP:()=>a.A,aI:()=>o.A,dI:()=>c.A,dP:()=>l.A,eQ:()=>i.A,mL:()=>r.A});var a=n(23699),r=n(48675),o=n(17531),i=n(80435),l=n(14128),s=n(32135),c=n(98884),d=n(52180)},45436:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(57090);n(12115);var r=n(55972);let o=e=>{let{isLocalTextCheckPassed:t}=e;return!1===t?(0,a.Y)(r.V,{type:"danger","data-sentry-element":"WpText","data-sentry-component":"LocalTextCheckFailedError","data-sentry-source-file":"LocalTextCheckFailedError.tsx",children:"Must have at least 3 tickers with amounts or quantities, formatted with spaces between them."}):null}},45640:(e,t,n)=>{n.r(t),n.d(t,{default:()=>A});var a=n(57090),r=n(12115),o=n(33841),i=n(92615),l=n.n(i),s=n(12584);n(19273);var c=n(43847),d=n(90165),u=n(31624),m=n(22912),p=n(40906),y=n.n(p),h=n(14185),f=n.n(h),g=n(99750),v=n(55605),x=n(75463);"object"==typeof m&&(y()(m),y()(o),f()(m),f()(o));let A=e=>{let{data:t,colorMode:n,yLabel:i,xLabel:m,yFormat:p,xFormat:y,showLegend:h,fillBetween:f,defaultXEnd:A,defaultXStart:S,forcedChartStartDate:b,insightId:C,accessibilityDescription:I,chartLanguage:w=u.z.Legacy,seriesHighlight:P=null}=e,k=r.useRef(null),{isBelow768:F}=(0,g.uF)(),T=(0,c.NU)(),E=(e,t)=>{var n;let a=null==(n=k.current)?void 0:n.chart;a?(0,v.do)(a,e,t):console.error("Chart instance is unavailable during range selector click")},Y=r.useMemo(()=>(0,v.LI)({data:t,colorMode:n,yLabel:i,xLabel:m,yFormat:p,xFormat:y,showLegend:h,fillBetween:f,defaultXEnd:A,defaultXStart:S,forcedChartStartDate:b,accessibilityDescription:I,isBelow768:F,preferredCurrency:T,rangeSelectorClickHandler:E,chartLanguage:w,seriesHighlight:P}),[t,h,p,f,F,T,b,S,n,i,A,m,y,I,w,P]);return(0,s.k)(k),(0,d.B)(k,w===u.z.Trend?null:t.y_range),(0,a.FD)(r.Fragment,{children:[(0,a.Y)(l(),{ref:k,highcharts:o,options:Y,constructorType:"stockChart","data-sentry-element":"HighchartsReact","data-sentry-source-file":"LineChart.tsx"}),C?(0,a.Y)(x.A,{insightId:C,highCharts:o,chartComponentRef:k}):null]})}},45676:(e,t,n)=>{n.d(t,{A:()=>D});var a=n(57090),r=n(12115),o=n(33624),i=n(99885),l=n(544),s=n(89703),c=n(71456),d=n(95825),u=n(46842),m=n(61435),p=n(92672),y=n(11),h=n(72408),f=n(62796),g=n(36934);let v=()=>(0,a.Y)(g.km,{className:"text-neutral-500","data-sentry-element":"Body2W400","data-sentry-component":"CopyDraftModalSubHeader","data-sentry-source-file":"CopyDraftModalSubHeader.tsx",children:f.v});var x=n(65879),A=n(34584),S=n(62212),b=n(32189),C=n(9925),I=n(90521),w=n(42036),P=n(8662),k=n(4603),F=n(67759),T=n(62833);let E=e=>(0,a.FD)(p.Ah,{flexDirection:"column",alignItems:"flex-start",itemsSpacingVertical:4,occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-component":"DraftStartModeToggle","data-sentry-source-file":"DraftStartModeToggle.tsx",children:[(0,a.Y)(g.km,{className:"text-body","data-sentry-element":"Body2W400","data-sentry-source-file":"DraftStartModeToggle.tsx",children:"Start with"}),(0,a.FD)(T.tU,{selectedKey:e.value,onSelectionChange:t=>e.onChange(t===A.V.Empty?A.V.Empty:A.V.CopyOfHoldings),"aria-label":"Start with","data-sentry-element":"Tabs","data-sentry-source-file":"DraftStartModeToggle.tsx",children:[(0,a.Y)(T.oz,{title:"Copy of holdings",disabled:e.isCopyOfHoldingsDisabled,"data-sentry-element":"Tab","data-sentry-source-file":"DraftStartModeToggle.tsx"},A.V.CopyOfHoldings),(0,a.Y)(T.oz,{title:"Empty","data-sentry-element":"Tab","data-sentry-source-file":"DraftStartModeToggle.tsx"},A.V.Empty)]})]});var Y=n(81671);let D=e=>{var t;let{activePortfolio:n}=e,g=(0,h.t)(),T=null!=(t=e.title)?t:f.D,{textInput:D,trimmedTextInput:R,setTextInput:N}=(0,i.n)(),M=(e=>{var t,n;let{isClonable:a}=(0,x.S)(e.activePortfolioId),[o,i]=r.useState(null!=(n=null==(t=e.emptyStart)?void 0:t.initialMode)?n:A.V.CopyOfHoldings),l=a?o:A.V.Empty;return{mode:l,isEmptyStart:void 0!==e.emptyStart&&l===A.V.Empty,isCopyOfHoldingsDisabled:!a,setMode:i}})({activePortfolioId:n.portfolioId,emptyStart:e.emptyStart}),[L,_]=r.useState((0,l.pr)(n)),{submit:O,isSubmitting:W}=(e=>{let t=(0,S.j)(),n=(0,C.D)(),a=(0,I.I4)(),{switchActivePortfolio:o}=(0,w.Ay)(),[i,s]=r.useState(!1),c=n=>{var a;let r=(0,P.W)(t),o=(0,l.Fk)(r,n);o&&(null==(a=e.onDraftPortfolioCreated)||a.call(e,o))},d=async()=>
3{if(!e.referencePortfolioId)return;let{createdPortfolioId:t}=await a.mutateAsync({portfolioName:e.portfolioName,portfolioDescription:"",referencePortfolioId:e.referencePortfolioId,creationScenario:k.PortfolioCreationScenario.Manual});c(t)},u=async()=>{let{portfolioId:t,portfolioType:a}=e.activePortfolio;switch(a){case b.N$.Main:case b.N$.Group:case b.N$.Current:await n.mutateAsync({sourcePortfolioId:t,portfolioName:e.portfolioName,portfolioDescription:"",creationScenario:k.PortfolioCreationScenario.Cloning},{onSuccess:e=>{(0,F.trackDraftPortfolioCreated)({scenario:k.PortfolioCreationScenario.Cloning,clonedPortfolioType:a}),o(e.clonedDraftPortfolioId,w.Gl.Auto,"Copied and switched to new Draft Portfolio"),c(e.clonedDraftPortfolioId)}})}};return{submit:async()=>{try{s(!0),e.isEmptyStart?await d():await u()}finally{s(!1)}},isSubmitting:i}})({activePortfolio:n,portfolioName:R,isEmptyStart:M.isEmptyStart,referencePortfolioId:L,onDraftPortfolioCreated:e.onDraftPortfolioCreated}),B=async()=>{await O(),e.onClose()},U=o.Ime(D)||D.length>y.xN||M.isEmptyStart&&o.gD_(L),z=!W;return(0,a.Y)(d.Ay,{title:(0,a.FD)(p.Ah,{justifyContent:"flex-start",flexWrap:"nowrap",itemsSpacingHorizontal:4,children:[(0,a.Y)(m.I,{icon:Y.$.SquareBehindSquare2,className:"text-primary"}),T]}),centered:!0,open:!0,destroyOnClose:!0,closable:!1,maskClosable:z,keyboard:z,onCancel:e.onClose,onOk:B,okText:g,size:d.rI.Sm,okButtonProps:{disabled:U},cancelButtonProps:{disabled:W},"data-sentry-element":"Modal","data-sentry-component":"CopyPortfolioActionContainer","data-sentry-source-file":"CopyPortfolioModal.tsx",children:(0,a.FD)(u.Bw,{"data-sentry-element":"PortfolioActionPopupContentContainer","data-sentry-source-file":"CopyPortfolioModal.tsx",children:[(0,a.Y)(v,{"data-sentry-element":"CopyDraftModalSubHeader","data-sentry-source-file":"CopyPortfolioModal.tsx"}),(0,a.Y)(s.MG,{"data-sentry-element":"FormContainer","data-sentry-source-file":"CopyPortfolioModal.tsx",children:(0,a.Y)(c.A,{onPortfolioNameChange:N,inputDraftPortfolioName:D,referencePortfolioId:n.portfolioId,startModeToggle:e.emptyStart?(0,a.Y)(E,{value:M.mode,onChange:M.setMode,isCopyOfHoldingsDisabled:M.isCopyOfHoldingsDisabled}):null,emptyStartReference:M.isEmptyStart?{selectedPortfolioId:L,onChange:_}:void 0,"data-sentry-element":"CopyPortfolioNameInputForm","data-sentry-source-file":"CopyPortfolioModal.tsx"})}),(0,a.Y)(u.FH,{"data-sentry-element":"DraftPortfolioBenefitsSection","data-sentry-source-file":"CopyPortfolioModal.tsx"})]})})}},45915:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(88963),r=n(62031),o=n.n(r),i=n(13125),l=n.n(i),s=n(12866);class c{constructor(){this.getScenarioPreferences=async e=>{let t=void 0!==e?"/scenario_modeling/get_scenario_preferences?scenario_id=".concat(encodeURIComponent(e)):"/scenario_modeling/get_scenario_preferences",n=await this.apiCaller.get(t);return o()(n,{deep:!0})},this.getScenarioRiskPreferenceReturns=async e=>{let t=new URLSearchParams({portfolio_score:String(e.portfolioScore),portfolio_rebalance_frequency:e.portfolioRebalanceFrequency,tax_loss_harvesting:e.taxLossHarvesting}),n="/scenario_modeling/get_retirement_scenario_risk_preference_returns?".concat(t.toString());return await this.apiCaller.get(n)},this.upsertScenarioPreference=async e=>{let t=await this.apiCaller.post("/scenario_modeling/upsert_scenario_preference",l()(e,{deep:!0}));return o()(t,{deep:!0})},this.generateScenarios=async(e,t)=>{var n;let a=await this.apiCaller.post("/scenario_modeling/generate_scenarios",l()(e)),r=o()(a,{deep:!0});if("completed"===r.status&&(null==(n=r.payload)?void 0:n.result))return r.payload.result;if(!r.variantKey)throw Error("Scenario simulation enqueue response missing variant key");return void 0!==t&&(0,s.Ry)(r.variantKey,t),null},this.downloadBreakdown=async e=>await this.apiCaller.post("/scenario_modeling/download_breakdown",l()(e),!1),this.apiCaller=new a.Ay}}let d=new c}
3,46749:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(81255),r=n(35334),o=n(33624);let i=()=>{let{isUserInEconomyExploration:e,isUserInPortfolioManagement:t,isUserInPortfolioTracking:n,isUserInPlanning:i}=(0,a.A)(),{isOnboardingCompleted:l}=(0,r.c)();return{isUserInsideCoreApp:o.Uo6(l,e||t||n||i)}}},46842:(e,t,n)=>{n.d(t,{Bw:()=>y,FH:()=>m,Pv:()=>p});var a=n(57090);n(12115);var r=n(33624),o=n(85335),i=n(40831),l=n(36934),s=n(92672),c=n(74547),d=n(81671);let u=[{icon:d.$.SparklesThree,title:"Apply recommendations and run simulations"},{icon:d.$.Trending3,title:"Review back-tests and score changes"},{icon:d.$.LayoutColumn,title:"Compare changes side-by-side"}],m=()=>(0,a.Y)(s.Ah,{display:"block",itemsSpacingVertical:8,className:"bg-neutral-50 p-4 rounded-lg","data-sentry-element":"FlexLayout","data-sentry-component":"DraftPortfolioBenefitsSection","data-sentry-source-file":"molecules.tsx",children:r.TjK(e=>(0,a.FD)(s.Ah,{flexDirection:"row",flexWrap:"nowrap",justifyContent:"flex-start",itemsSpacingHorizontal:8,children:[(0,a.Y)(c.In,{icon:e.icon,className:"text-primary",size:16}),(0,a.Y)(l.km,{className:"text-neutral-500",children:e.title})]},e.title),u)}),p=e=>(0,a.Y)(o.m$,{"data-sentry-element":"ImpactContainer","data-sentry-component":"DraftPortfolioScoreBenefit","data-sentry-source-file":"molecules.tsx",children:(0,a.FD)(o.IF,{"data-sentry-element":"MainScoreImpactRow","data-sentry-source-file":"molecules.tsx",children:[(0,a.Y)(i.jH,{score:e.currentScore,portfolioLabel:"Current","data-sentry-element":"MainScoreSection","data-sentry-source-file":"molecules.tsx"}),(0,a.Y)(i.JJ,{"data-sentry-element":"PortfolioMainScoreImpactArrow","data-sentry-source-file":"molecules.tsx"}),(0,a.Y)(i.jH,{score:e.afterImpactScore,portfolioLabel:"New Draft","data-sentry-element":"MainScoreSection","data-sentry-source-file":"molecules.tsx"})]})}),y=e=>(0,a.Y)(s.Ah,{flexDirection:"column",alignContent:"stretch",alignItems:"stretch",itemsSpacingVertical:16,occupyParentWidth:!0,...e,"data-sentry-element":"FlexLayout","data-sentry-component":"PortfolioActionPopupContentContainer","data-sentry-source-file":"molecules.tsx",children:e.children})},47120:(e,t,n)=>{n.d(t,{C:()=>a,h:()=>r});var a=function(e){return e.OnlyUnknownSecurities="OnlyUnknownSecurities",e.UnknownSecuritiesAndAssetClass="UnknownSecuritiesAndAssetClass",e.MissingDividendData="MissingDividendData",e}({}),r=function(e){return e.DisplayName="Display name",e.Ticker="Ticker",e.MarketValue="Market value",e.Quantity="Quantity",e.AverageCostBasis="Average cost basis",e.TaxAtSale="Tax at sale",e.UnrealizedGainLoss="Unrealized gain/loss",e.Weight="Weight",e.ExpectedReturn="Exp. return",e.MarketBeta="Market beta",e.Risk="Risk",e.SharpeRatio="Sharpe Ratio",e.Dividend="Dividend",e.CustomizeInvestment="Customize investment",e.View="View",e}({})},47178:(e,t,n)=>{n.d(t,{EG:()=>y,H2:()=>A,HX:()=>S,Ix:()=>x,Lt:()=>c,QE:()=>h,Xm:()=>v,aY:()=>p,es:()=>m,fD:()=>g,on:()=>f});var a=n(33624),r=n(38738),o=n(7440),i=n.n(o),l=n(98804),s=n(84455);let c=e=>!e.defaultPrevented&&0===e.button&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey,d=e=>a.mKk(e,a.zug(r.PR)),u=e=>a.mKk(e,a.zug(r.Ff)),m=e=>a.pbD(a.G4b([e=>d(e.questionId),e=>u(e.questionId)]),e),p=e=>a.pbD(e=>d(e.questionId),e),y=e=>a.pbD(e=>u(e.questionId),e),h=e=>a.wQP(a._w2("questionId"),e),f=e=>a.aIS(1,Number(e.response)),g=e=>({...e,response:String(+!!e.response)}),v=e=>{let t=a.TjK(e=>i()(e.updatedOn),e),n=a.diJ((e,t)=>t.valueOf()-e.valueOf(),t),r=a.d5f(n);return r?r.toISOString():null},x=e=>{let t=a.pbD(e=>a.mKk(e.questionId,[l.WR.Children,l.WR.State]),e),n=a.pbD(e=>a.mKk(e.questionId,[s.od.CurrentAge,s.od.EstimatedNetWorth,s.od.Residency,s.od.TaxFilingStatus]),e);return a.xWs(t,n)},A=(e,t)=>a.I6j(e=>e.questionId===t,e)||null,S=(e,t,n)=>{let r=a.pbD(e=>!!t(e),e);return{completed:a.Bw9(a.pbD(e=>!!n(e),r)),total:a.Bw9(r)}}},47489:(e,t,n)=>{n.d(t,{A:()=>O});var a=n(57090),r=n(12115),o=n(16528),i=n(31585),l=n(19682),s=n(92283),c=n(33624),d=n(31260),u=n(78046),m=n(48779),p=n(17143),y=n(50343),h=n(6558),f=n(39655),g=n(97765),v=n(7257),x=n(4122),A=n(13641),S=n(92672),b=n(36934);let C=e=>{let{showNoMatchText:t}=e;return(0,a.FD)(S.Ah,{flexDirection:"column",itemsSpacingVertical:16,boxSizing:"border-box",padding:"16px","data-sentry-element":"FlexLayout","data-sentry-component":"AddCustomSecurity","data-sentry-source-file":"AddCustomSecurity.tsx",children:[t?(0,a.Y)(b.bU,{
3className:"text-body",children:"No matching security found"}):null,(0,a.Y)(y.b7,{onClick:e.onCustomSecurityAdd,"data-sentry-element":"SubmitButton","data-sentry-source-file":"AddCustomSecurity.tsx",children:"Add custom security"})]})};var I=n(74547),w=n(85505),P=n(99750),k=n(99026),F=n(76778);let T=function(e){let t=(0,r.useRef)(Promise.resolve()),n=(0,F.K)(e);return(0,r.useCallback)(function(){for(var e=arguments.length,a=Array(e),r=0;r<e;r++)a[r]=arguments[r];return t.current=t.current.then(()=>n(...a)),t.current},[])};var E=n(84978),Y=n(81671);let D=e=>o.A(e.value)&&o.A(e.seriesName),R=e=>({value:null==e?void 0:e.replace(/^CUR:/i,"")}),N=Object.freeze({ticker:m.Dh,amount:m.Qy,quantity:m.jK,assetType:m.zO}),M={ticker:"ticker",amount:"amount",quantity:"quantity",currentPrice:"currentPrice",isFixedAmount:"isFixedAmount",assetType:"assetType",investment:"investment"};var L=function(e){return e.Add="Add",e.Update="Update",e}(L||{});let _=(e,t,n,a)=>{let r=(0,p.$S)(e.ticker),o=(0,p.iU)(e.amount),i=(0,p.k5)(n,o),l=(0,v.Cw)(a,r);return{...e,isFixedAmount:t,ticker:r,amount:i,investment:l}},O=e=>{var t;let{includeSharesInputCount:n,defaultUpsertTicker:o,compactMobileView:v,id:S,showPriceInCompactMode:b,isBrokerageCash:F,inputColor:L}=e,[O,W]=r.useState("Add"),[B,U]=r.useState(!1),{isBelow576:z}=(0,P.uF)(),[V]=(0,u.mN)(),j=(0,u.r3)(M.isFixedAmount,V),H=(0,u.r3)(M.currentPrice,V),q=(0,u.r3)(M.ticker,V),G=(0,u.r3)(M.investment,V),K=(0,u.r3)(M.assetType,V)===E.PW.Options,{preferredCurrency:Q}=(0,d.yf)(),{preferredCurrencySymbol:$}=(0,g._)(),{setInputTicker:X,isTickerOptionsLoading:J,inputTickerDetails:Z,findMatchedOptionOrFetchSuggestions:ee,findTickerDetails:et,filterOption:en,suggestedSecurityItems:ea,tickerDetailsMutation:er}=(0,f.A)(),{workflowVisible:eo,workflowParams:ei,launchNewCustomSecuritySetupWorkflow:el,exitWorkflow:es}=(0,x.q)(),ec=!!e.disableForm||i.A(q),ed=(()=>{if(e.submitButtonLabel)return e.submitButtonLabel;switch(O){case"Add":return"Add";case"Update":return"Update"}})(),eu=async(t,n)=>{if(n&&D(n)){let t=await et(n.value);e.onSuggestedSecuritySelected({ticker:n.value,seriesName:n.seriesName,assetType:t.assetType})}},em=()=>{X(q)},ep=async()=>{var t;if(Z&&D(Z)){let t=await et(Z.value);e.onSuggestedSecuritySelected({ticker:Z.value,seriesName:Z.seriesName,assetType:t.assetType})}let n=_(V.getFieldsValue(),!!j,Q,ea);null==(t=e.onTickerSelectionBlur)||t.call(e,n)},ey=e=>{(0,h.Hf)(V,M.amount,e)},eh=e=>{(0,u.IX)(V,M.isFixedAmount,e)},ef=e=>{(0,u.IX)(V,M.quantity,e)},eg=async function(t){var n,a,r,o,i;let s,c=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(V.getFieldValue(M.ticker)!==t&&c)return;(0,u.IX)(V,M.ticker,t);let d=null!=t?t:"",y=V.getFieldsValue(),h=(0,p.Jm)(e.existingInvestmentItems,d);if(h){W("Update");let e=(0,p.$Y)(Q,h.amount),t=null!=h.currentPrice?h.quantity:void 0;s={...y,amount:e,price:h.currentPrice,assetType:h.assetType,isFixedAmount:h.isFixedAmount,investment:h.investment,quantity:t}}else{let e=await ee(d),t=await et(d),n=t.currentPrice,r=l.A(n),o=null!=(a=null==e?void 0:e.seriesName)?a:void 0;W("Add"),s={...y,amount:m.Qy,price:n,assetType:t.assetType,isFixedAmount:r,quantity:m.jK,investment:o}}ey(s.amount),r=s.price,(0,u.IX)(V,M.currentPrice,r),o=s.assetType,(0,u.IX)(V,M.assetType,o),eh(s.isFixedAmount),ef(s.quantity),i=s.investment,(0,u.IX)(V,M.investment,i);let f=_(s,s.isFixedAmount,Q,ea);null==(n=e.onFormChange)||n.call(e,f)},ev=T(eg),ex=r.useRef((0,k.sg)(ev,500)).current,eA=(t,n)=>{let a=c.mKk(M.ticker,c.HPH(t)),r=c.mKk(M.amount,c.HPH(t)),o=c.mKk(M.quantity,c.HPH(t)),{ticker:i,quantity:d,currentPrice:u,amount:m}=n;if(a?(X(i),ex(i,!0)):r?(ey(m),n.quantity=s.A(u)?m/u:void 0,K&&(n.quantity=n.quantity?n.quantity/100:void 0),ef(n.quantity),n.isFixedAmount=l.A(u),eh(n.isFixedAmount)):o&&s.A(d)&&s.A(u)&&(n.quantity=d,ef(n.quantity),n.isFixedAmount=!1,eh(n.isFixedAmount),n.currentPrice=(0,p.$Y)(Q,u),n.amount=d*n.currentPrice,K&&(n.amount=100*n.amount),ey(n.amount)),!a){var y;let t=_(n,r||!!j,Q,ea);null==(y=e.onFormChange)||y.call(e,t)}},eS=()=>{W("Add")},eb=async()=>{await el({ticker:q,investment:q,amount:m.Qy}),X(""),eg("")},eC=async(t,n,a)=>{await e.onProxyWorkflowInvestmentSubmit(t,n,a),V.resetFields(),eS()},eI=async t=>{U(!0);let n=_(t,!!j,Q,ea);try{await e.onSubmit(n),V.resetFields(),eS()}finally{U(!1)}},ew=q?(0,a.Y)(C,{onCustomSecurityAdd:eb,showNoMatchText:c.Ime(ea)}):null,eP=c.gD_(H),ek=i.A(q),eF=n&&!F,eT=S?"upsertInvestmentForm-".concat(S):"upsertInvestmentForm",eE=(0,p.w4)({ticker:q,existingInvestmentItems:e.existingInvestmentItems,resolvedDetail
3sTicker:null==(t=er.data)?void 0:t.ticker,isTickerDetailsLoading:er.isLoading}),eY=(0,a.Y)("span",{title:G||void 0,children:G||"Enter security"});return((0,r.useLayoutEffect)(()=>{o&&i.A(q)&&(0,p.$S)(o)!==(0,p.$S)(q)&&eg(o)},[o]),v)?(0,a.FD)(r.Fragment,{children:[(0,a.Y)(y.MG,{children:(0,a.FD)(y.q9,{includeSharesInputCount:n,compactMobileView:!0,form:V,name:eT,onFinish:eI,colon:!1,requiredMark:!1,initialValues:N,onValuesChange:eA,children:[(0,a.Y)(y.Ru,{name:M.ticker,label:eY,required:!0,hideAsterisk:!0,messageVariables:{name:"Investment"},hasFeedback:!1,rules:[{validator:h.XT},{validator:h.gJ}],...e.isBrokerageCash&&{getValueProps:R},children:(0,a.Y)(y.Iv,{isClearable:!1,inForm:!0,isLoading:J,allowsEmptyCollection:!0,items:ea,notFoundContent:ew,placeholder:"E.g. Apple Inc / AAPL",onSelect:eu,onFocus:em,onBlur:ep,allowsCustomValue:!0,filterOption:en,hideSelectorButton:!0,color:L,...e.isBrokerageCash&&{isDisabled:!0}})}),eE&&(0,a.FD)(I.Ah,{flexWrap:"nowrap",justifyContent:"flex-start",alignItems:"flex-end",itemsSpacingHorizontal:16,width:"100%",style:z?void 0:{minWidth:0},children:[(0,a.Y)(y.JF,{style:{flex:"1 1 0%",minWidth:0},label:"Quantity",name:M.quantity,messageVariables:{name:"Shares"},hidden:!eF,rules:[(0,h.rI)({required:!eP})],hasFeedback:!1,shouldUpdate:!0,children:(0,a.Y)(I.YI,{size:"sm",disabled:eP,placeholder:"Quantity",fractionDigits:(0,h.ph)(H),color:L})}),(0,a.Y)(y.JF,{style:{flexShrink:0,width:"120px"},label:"Price",hidden:!b||!eF,shouldUpdate:!0,name:M.currentPrice,messageVariables:{name:"Price"},hasFeedback:!1,children:(0,a.Y)(w.A,{size:"sm",humanizeNumber:!0,disabled:!0,addonBefore:$,color:L})}),(0,a.Y)(y.JF,{style:{flex:"1 1 0%",minWidth:0},label:"Market value",name:M.amount,messageVariables:{name:"Amount"},rules:(0,h.lB)(),hasFeedback:!1,shouldUpdate:!0,children:(0,a.Y)(y.J$,{size:"sm",humanizeNumber:!0,disabled:ek,addonBefore:$,color:L})}),F?null:(0,a.FD)(I.$n,{onClick:e.onRemoveInvestment,disabled:c.Ime(q),variant:"ghost",color:"neutral",isIconOnly:!0,children:[(0,a.Y)(I.In,{icon:Y.$.TrashCan,className:"text-neutral-500"}),(0,a.Y)("span",{className:"sr-only",children:"Remove holding"})]})]}),(0,a.Y)(y.JF,{hidden:!0,name:M.isFixedAmount,children:(0,a.Y)("input",{})}),(0,a.Y)(y.JF,{hidden:!0,name:M.assetType,children:(0,a.Y)("input",{})}),(0,a.Y)(y.JF,{hidden:!0,name:M.investment,children:(0,a.Y)("input",{})})]})}),eo&&ei?(0,a.Y)(A.N,{...ei,onInvestmentDetailsSubmitted:eC,onClose:es}):null]}):(0,a.FD)(r.Fragment,{children:[(0,a.Y)(y.MG,{"data-sentry-element":"FormContainer","data-sentry-source-file":"index.tsx",children:(0,a.FD)(y.q9,{includeSharesInputCount:n,compactMobileView:!1,form:V,name:eT,onFinish:eI,colon:!1,requiredMark:!1,initialValues:N,onValuesChange:eA,"data-sentry-element":"InvestmentForm","data-sentry-source-file":"index.tsx",children:[(0,a.Y)(y.Ru,{name:M.ticker,label:eY,required:!0,hideAsterisk:!0,messageVariables:{name:"Investment"},hasFeedback:!1,rules:[{validator:h.XT},{validator:h.gJ}],...e.isBrokerageCash&&{getValueProps:R},"data-sentry-element":"InvestmentFormItem","data-sentry-source-file":"index.tsx",children:(0,a.Y)(y.Iv,{isClearable:!1,inForm:!0,allowsEmptyCollection:!0,items:ea,notFoundContent:ew,placeholder:"E.g. Apple Inc / AAPL",onSelect:eu,onBlur:ep,onFocus:em,allowsCustomValue:!0,filterOption:en,isLoading:J,hideSelectorButton:!0,color:L,...e.isBrokerageCash&&{isDisabled:!0},"data-sentry-element":"TickerAutoSuggestionInput","data-sentry-source-file":"index.tsx"})}),eE&&(0,a.FD)(r.Fragment,{children:[eF?(0,a.FD)(I.Ah,{flexWrap:"nowrap",itemsSpacingHorizontal:16,equalWidthItems:!0,alignItems:"baseline",width:"100%",margin:z?"4px 0":void 0,flex:"1 1 50%",children:[(0,a.Y)(y.JF,{name:M.quantity,label:"Quantity",messageVariables:{name:"Shares"},rules:[(0,h.rI)({required:!eP})],hasFeedback:!1,shouldUpdate:!0,children:(0,a.Y)(I.YI,{size:"lg",disabled:eP,fractionDigits:(0,h.ph)(H),color:L})}),(0,a.Y)(y.JF,{name:M.currentPrice,label:"Price",messageVariables:{name:"Price"},hasFeedback:!1,shouldUpdate:!1,children:(0,a.Y)(w.A,{humanizeNumber:!0,disabled:!0,addonBefore:$,color:L})})]}):null,(0,a.Y)(y.IV,{name:M.amount,label:"Market value",messageVariables:{name:"Amount"},rules:(0,h.lB)(),hasFeedback:!1,shouldUpdate:!0,children:(0,a.Y)(y.J$,{humanizeNumber:!0,disabled:ek,addonBefore:$,color:L})}),(0,a.Y)(y.KY,{shouldUpdate:!0,children:()=>(0,a.Y)(y.b7,{variant:"filled",htmlType:"submit",disabled:ec||(0,u.JO)(V),loading:B,fullWidth:!0,children:ed})})]}),(0,a.Y)(y.JF,{hidden:!0,name:M.isFixedAmount,"data-sentry-element":"StyledFormItem","data-sentry-source-file":"index.tsx",children:(0,a.Y)("input",{})}),(0,a.Y)(y.JF,{hidden:!0,name:M.assetType,"data-sentry-element":"StyledFormItem","data-sentry-source-file":"index.tsx",children:(0,a.Y)("input",{})})]})}),eo&&ei?(0,a.Y)(A.N,{...ei,onInvestmentDetailsSubmitted:eC,onClose:es}):null]})}},47640:(e,t,n)=>{n.d(t,{Ay:()=>A,pb:()=>x});var a=n(57090),r=n(12115),o=n(33624),i=n(35208),l=n(31272),s=n(61435),c=n(76402),d=n(41784),u=n(81671),m=function(e){return e.Positive="positive",e.Neutral="neutral",e.Negative="negative",e}(m||{});let p={positive:"text-financial-positive",neutral:"text-financial-neutral",negative:"text-financial-negative"},y={positive:c.pb.FinancialPositive,neutral:c.pb.FinancialNeutral,negative:c.pb.FinancialNegative},h={positive:u.$.ArrowUp,neutral:u.$.ArrowRight,negative:u.$.ArrowDown},f=e=>(0,a.Y)("span",{className:e.className,"data-sentry-component":"ExpectedReturnsValue","data-sentry-source-file":"ExpectedReturnsIndicator.tsx",children:e.children}),g=e=>{let t=e.justifyContent&&({start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"})[e.justifyContent]||"justify-end";return(0,a.Y)("span",{className:(0,d.cn)("flex flex-nowrap items-center gap-x-2",p[e.direction],t,e.className),"data-sentry-component":"ExpectedReturnsContainer","data-sentry-source-file":"ExpectedReturnsIndicator.tsx",children:e.children})},v=e=>(0,a.Y)(c.vu,{type:y[e.direction],size:c.Sb.Md,iconOnly:!0,"data-sentry-element":"Chip","data-sentry-component":"ReturnsArrowChip","data-sentry-source-file":"ExpectedReturnsIndicator.tsx",children:(0,a.Y)(s.I,{icon:h[e.direction],size:14,"data-sentry-element":"Icon","data-sentry-source-file":"ExpectedReturnsIndicator.tsx"})}),x=e=>{let t=e.isPositive?"positive":"negative",n=e.isPositive?"+X%":"-X%";return(0,a.FD)(g,{direction:t,className:"gap-y-1","data-sentry-element":"ExpectedReturnsContainer","data-sentry-component":"SampleExpectedReturnsIndicator","data-sentry-source-file":"ExpectedReturnsIndicator.tsx",children:[(0,a.Y)(v,{direction:t,"data-sentry-element":"ReturnsArrowChip","data-sentry-source-file":"ExpectedReturnsIndicator.tsx"}),(0,a.Y)(f,{"data-sentry-element":"ExpectedReturnsValue","data-sentry-source-file":"ExpectedReturnsIndicator.tsx",children:n})]})},A=e=>{if(o.gD_(e.expectedReturn))return(0,a.Y)(r.Fragment,{children:i.UZ});let t=(e=>0===e?"neutral":e>0?"positive":"negative")(e.expectedReturn);return(0,a.FD)(g,{direction:t,className:e.className,justifyContent:e.justifyContent,"data-sentry-element":"ExpectedReturnsContainer","data-sentry-component":"ExpectedReturnsIndicator","data-sentry-source-file":"ExpectedReturnsIndicator.tsx",children:[e.hideIndicator?null:(0,a.Y)(v,{direction:t}),(0,a.Y)(f,{"data-sentry-element":"ExpectedReturnsValue","data-sentry-source-file":"ExpectedReturnsIndicator.tsx",children:(0,l.ad)(e.expectedReturn,{formatToPercent:!0,fractionDigits:e.fractionDigits})})]})}},47825:(e,t,n)=>{n.d(t,{WU:()=>l,Y9:()=>o,ow:()=>s});var a=n(57090),r=n(12115),o=function(e){return e.Fixed="fixed",e.Inline="inline",e}({});let i=r.createContext({mode:"fixed",footerContainer:null}),l=()=>r.useContext(i),s=e=>{let t=r.useMemo(()=>({mode:e.mode,footerContainer:e.footerContainer}),[e.mode,e.footerContainer]);return(0,a.Y)(i.Provider,{value:t,"data-sentry-element":"unknown","data-sentry-component":"OnboardingNavLayoutProvider","data-sentry-source-file":"OnboardingNavLayoutContext.tsx",children:e.children})}}
3,48033:(e,t,n)=>{n.d(t,{GC:()=>v,a7:()=>x,wH:()=>g});var a=n(57090),r=n(12115),o=n(98687),i=n(76778),l=n(92909),s=n(73285),c=n(99026),d=n(54958),u=n(47364),m=n(64533),p=n(99750),y=n(69986);let h={panelState:o.c.Closed,isProcessing:!1,hasUnreadResponse:!1,currentContext:null},f=r.createContext(null),g=()=>{let e=r.useContext(f);if(!e)throw Error("useAssistant must be used within AssistantProvider");return e},v=()=>r.useContext(f),x=e=>{let t=(0,s.w)(),[n,g]=r.useState(h),[v,x]=r.useState(!1),A=r.useRef((0,c.Uc)(t.asPath)),{setSearchParams:S}=(0,u.o)(["view"],{removeEmptyValues:!0}),{isBelow:b}=(0,p.gz)(y.u4);(0,m.W4)();let{isComplete:C,accumulatedMessage:I,toolResults:w}=(0,m.B3)(),P=(0,i.K)(e=>{g(t=>({...t,panelState:o.c.Open,currentContext:null!=e?e:null,hasUnreadResponse:!1})),b&&y.KB.getState().setSidebarCollapsed(!0),(0,l.Ic)(l.Du.ToggleAIAssistantPanel)}),k=(0,i.K)(()=>{x(!1),g(e=>({...e,panelState:o.c.Closed})),(0,l.Ic)(l.Du.ToggleAIAssistantPanel)}),F=(0,i.K)(()=>{x(!0),(0,l.Ic)(l.Du.ToggleAIAssistantPanel)}),T=(0,i.K)(()=>{x(!1),(0,l.Ic)(l.Du.ToggleAIAssistantPanel)}),E=(0,i.K)(()=>{g(e=>({...e,isProcessing:!0}))}),Y=(0,i.K)(()=>{g(e=>({...e,isProcessing:!1}))}),D=(0,i.K)(()=>{g(e=>({...e,isProcessing:!1,hasUnreadResponse:e.panelState===o.c.Closed}))}),R=(0,i.K)(()=>{g(e=>({...e,currentContext:null}))});r.useEffect(()=>{R(),x(!1),g(e=>e.isProcessing?{...e,isProcessing:!1}:e),m.B3.getState().stopStreaming()},[t.asPath,R]),r.useEffect(()=>{let e=(0,c.Uc)(t.asPath),a=A.current!==e;A.current=e,a&&n.panelState===o.c.Open&&k()},[t.asPath,n.panelState,k]),r.useEffect(()=>{(0,m.qj)({isComplete:C,accumulatedMessage:I,toolResults:w})&&D()},[C,I,w,D]),r.useEffect(()=>{t.query.view===d.yc&&(P(),S({view:null}))},[t.query.view]);let N=r.useMemo(()=>({...n,isMaximized:v,openPanel:P,closePanel:k,maximizePanel:F,minimizePanel:T,setAssistantBusy:E,setAssistantIdle:Y,markResponseComplete:D}),[n,v,P,k,F,T,E,Y,D]);return(0,a.Y)(f.Provider,{value:N,"data-sentry-element":"unknown","data-sentry-component":"AssistantProvider","data-sentry-source-file":"AssistantContext.tsx",children:e.children})}},48045:(e,t,n)=>{n.d(t,{U:()=>M});var a=n(57090),r=n(12115),o=n(55669),i=n(8921),l=n(65438),s=n(33624),c=n(7172),d=n(74547),u=n(11325),m=n(13340),p=n(62570);let y=(0,p.A)("div",{target:"ean0o0t0"})("font-style:normal;font-weight:400;font-size:16px;line-height:24px;color:",e=>e.theme.colors.neutral500,";"),h=(0,p.A)("div",{target:"ean0o0t1"})("width:100%;border-radius:8px;overflow:hidden;"),f=(0,p.A)("span",{target:"ean0o0t2"})("display:flex;align-items:center;justify-content:center;width:100%;min-height:96px;padding:24px 0;"),g=d.XI,v=(0,p.A)("span",{target:"ean0o0t3"})("font-weight:500;line-height:20px;color:",e=>e.theme.colors.neutral600,";",(0,d.BK)({fontSize:["14px","14px","16px"]})),x=(0,p.A)(d.aF,{target:"ean0o0t4"})(e=>!e.centered&&"top: 0;");var A=n(544),S=n(27234),b=n(99750),C=n(95825),I=n(7659),w=n(98870),P=n(92672),k=n(36271),F=n(67759),T=n(4603),E=n(18290),Y=n(32638);let D=e=>{var t;let n=(0,A.R_)(null!=(t=e.initialHoldings)?t:[]),o=s.Bw9(n),[i,l]=r.useState(0),p=s.saZ(i,n),D=s.Bw9(p),R=s.Uo6(s.gt(D,0),s.aIS(D,o)),N=(0,c.u)("demo-portfolio-setup-table",D),{isMobile:M,isMobilePortrait:L}=(0,b.Qs)(),_={investment:"70%",amount:"30%"},O=[{title:(0,a.Y)(v,{children:"Securities"}),dataIndex:"displayName",key:"displayName",render:(e,t)=>(0,a.Y)(S.i,{investmentItem:t,compactMode:!0}),width:_.investment},{title:(0,a.Y)(v,{children:"Amount"}),dataIndex:"amount",key:"amount",render:e=>(0,a.Y)(u.eF,{amount:e,sourceCurrency:m.mF,currencyFormatter:u.EB.HumanizedLiteralAmount,customFormatOptions:{hideDecimals:!0}}),width:_.amount,sorter:c.b.sortNumber("amount"),defaultSortOrder:"descend",align:"right"}];(0,I.A)(()=>{l(s.bEw)},s.lt(i,o)?150:null),r.useEffect(()=>{(0,F.trackDemoMode)({event:T.DemoModeEvent.Prepared})},[]);let W=(0,a.FD)(P.Ah,{occupyParentWidth:!0,flexDirection:"column",justifyContent:"stretch",alignItems:"flex-start",itemsSpacingVertical:16,children:[(0,a.Y)(y,{children:"We're creating a sample portfolio to help you get started."}),(0,a.Y)(h,{children:(0,a.Y)(g,{isStriped:!0,removeWrapper:!0,id:N,loading:!1,dataSource:p,rowKey:e=>e.ticker,pagination:!1,columns:O,emptyContent:(0,a.Y)(f,{"data-testid":"demo-portfolio-loading",children:(0,a.Y)(k.y,{placement:"inline",size:"sm"})}),className:"px-0 pb-0"})}),!e.inlineView&&(0,a.Y)(y,{children:"You can add real accounts later."})]});return e.inlineView?(0,a.FD)(r.Fragment,{children:[(0,a.Y)(P.Ah,{width:"100%",flexDirection:"column",padding:"24px 16px",marginTop:"16px",style:{backgroundColor:"white",borderRadius:"12px"},children:W}),(0,a.FD)(E.$,{children:[e.onBack?(0,a.Y)(Y.T,{onClick:e.onBack}
3):(0,a.Y)("div",{}),(0,a.Y)(Y.O,{variant:"filled",onClick:e.onProceed,disabled:!R,fullWidth:L,children:"Continue with demo portfolio"})]})]}):(0,a.Y)(x,{disableSubmitOnEnter:!0,title:"Setting up your demo portfolio",centered:!M,open:!0,destroyOnClose:!0,closable:!1,keyboard:!1,maskClosable:!1,onCancel:w.A,size:C.rI.Sm,afterOpenChange:t=>{if(t){var n;null==(n=e.onSetupOpened)||n.call(e)}},footer:(0,a.FD)(C.jl,{children:[!e.hideRejectAction&&(0,a.Y)(d.$n,{onClick:e.onReject,children:e.rejectActionLabel?e.rejectActionLabel:"Add my own securities"}),(0,a.Y)(d.$n,{variant:"filled",onClick:e.onProceed,disabled:!R,children:"Continue with demo portfolio"})]}),"data-sentry-element":"DemoPortfolioSetupPopup","data-sentry-component":"DemoPortfolioSetup","data-sentry-source-file":"DemoPortfolioSetup.tsx",children:W})};var R=n(93382),N=n(41686);let M=e=>{var t,n;let{value:s,setFalse:c,setTrue:d}=(0,l.A)(!1),u=(0,o.j)(),m=(0,o.f)(R.$.DemoPortfolioSetupRejected),p=async()=>{var t;await (0,N.li)(),await (null==(t=e.onSetupOpened)?void 0:t.call(e))},y=async()=>{await u.mutateAsync(null,{onSuccess:async()=>{var t;await (null==(t=e.onCreated)?void 0:t.call(e)),d()}})},h=async()=>{(0,i.Ds)(i._n.Success,"Demo portfolio added"),await e.onAccepted(),c(),(0,F.trackDemoMode)({event:T.DemoModeEvent.PortfolioAdded})},f=async()=>{await m.mutateAsync(null,{onSuccess:async()=>{await e.onRejected(),c()}})};return(0,a.FD)(r.Fragment,{children:[e.initiatorRenderer(y,u.isLoading),s?(0,a.Y)(D,{onProceed:h,onReject:f,onSetupOpened:p,hideRejectAction:e.hideRejectAction,rejectActionLabel:e.rejectActionLabel,inlineView:e.inlineView,initialHoldings:null!=(n=null==(t=u.data)?void 0:t.holdings)?n:[]}):null]})}},48283:(e,t,n)=>{n.d(t,{A:()=>Q,o:()=>K});var a=n(57090),r=n(12115),o=n(33624),i=n(49877),l=n(18356),s=n(67759),c=n(19483);let d=e=>{let{token:t}=e,n={onSuccess:e.onSuccess,onExit:e.onExit,onEvent:(e,t)=>{(0,c.f)(e,t,s.trackExternalCashAccountConnection)},token:t},{open:a,ready:o}=(0,l.usePlaidLink)(n);return(0,r.useLayoutEffect)(()=>{o&&a()},[o]),null};var u=n(99026),m=n(43948),p=n(65438),y=n(36934),h=n(95825),f=n(92672),g=n(41784),v=n(62570),x=n(74547);let A=(0,v.A)("div",{target:"e1e2dqxl1"})("border:1px solid ",e=>e.theme.colors.neutral300,";",(0,x.BK)({padding:["4px","6px","6px","8px","8px","8px"]}),"  border-radius:4px;font-weight:400;font-size:16px;color:",e=>e.theme.colors.neutral800,";"),S=(0,v.A)("div",{target:"e1e2dqxl2"})("font-style:normal;font-weight:600;font-size:16px;color:",e=>e.theme.colors.neutral800,";"),b=(0,v.A)(x.Ah,{target:"e1e2dqxl3"})("max-height:calc(var(--vh,1vh) * 80);");var C=n(40248),I=n(11325),w=n(13340);let P=e=>{let{name:t,cashValue:n}=e.portfolioSummary;return(0,a.FD)(f.Ah,{display:"block",itemsSpacingVertical:8,"data-sentry-element":"FlexLayout","data-sentry-component":"CashPortfolioReview","data-sentry-source-file":"CashPortfolioReview.tsx",children:[(0,a.Y)(S,{"data-sentry-element":"PortfolioReviewName","data-sentry-source-file":"CashPortfolioReview.tsx",children:t}),(0,a.FD)(A,{"data-sentry-element":"CashPortfolioReviewTotalValue","data-sentry-source-file":"CashPortfolioReview.tsx",children:["Total cash:"," ",(0,a.Y)(I.eF,{amount:n,sourceCurrency:w.mF,currencyFormatter:I.EB.HumanizedLiteralAmount,"data-sentry-element":"CurrencyAmount","data-sentry-source-file":"CashPortfolioReview.tsx"})]})]})},k=e=>{let{subAccountsWithCashPortfolio:t}=e.cashAccount;return(0,a.FD)(h.Ay,{disableSubmitOnEnter:!0,open:!0,title:"Account cash preview",closable:!1,footer:(0,a.FD)(h.jl,{children:[(0,a.Y)(C.A,{variant:"ghost",color:"danger",onClick:e.onSomethingWrong,children:"Something wrong?"},"Something wrong"),(0,a.Y)(C.A,{variant:"filled",onClick:e.onEverythingCorrectClick,children:"Everything correct"},"Everything correct")]}),"data-sentry-element":"Modal","data-sentry-component":"CashConnectedAccountReview","data-sentry-source-file":"CashConnectedAccountReview.tsx",children:[(0,a.Y)(f.Ah,{justifyContent:"flex-start",marginBottom:16,"data-sentry-element":"FlexLayout","data-sentry-source-file":"CashConnectedAccountReview.tsx",children:(0,a.Y)(y.bU,{className:(0,g.cn)("text-body"),"data-sentry-element":"Body1W400","data-sentry-source-file":"CashConnectedAccountReview.tsx",children:"Check that these cash balances look correct."})}),(0,a.Y)(b,{display:"block",itemsSpacingVertical:16,"data-sentry-element":"StyledPortfolioReviewTablesContainer","data-sentry-source-file":"CashConnectedAccountReview.tsx",children:o.TjK(e=>
3e.isActive&&e.cashPortfolio&&(0,a.Y)(P,{portfolioSummary:e.cashPortfolio},e.cashPortfolio.cashPortfolioId),t)})]})};var F=n(8056);let T=e=>{let{type:t}=e;return(0,a.Y)(h.Ay,{title:null,open:!0,centered:!0,destroyOnClose:!0,closable:!1,maskClosable:!1,keyboard:!1,footer:null,size:h.rI.Sm,"data-sentry-element":"Modal","data-sentry-component":"AccountSyncHappeningModal","data-sentry-source-file":"AccountSyncHappeningModal.tsx",children:(0,a.FD)(f.Ah,{display:"block",itemsSpacingVertical:24,"data-sentry-element":"FlexLayout","data-sentry-source-file":"AccountSyncHappeningModal.tsx",children:[(0,a.FD)(f.Ah,{display:"block",itemsSpacingVertical:4,"data-sentry-element":"FlexLayout","data-sentry-source-file":"AccountSyncHappeningModal.tsx",children:[(0,a.Y)(y.RF,{className:"text-body","data-sentry-element":"H5W600","data-sentry-source-file":"AccountSyncHappeningModal.tsx",children:"cash"===t?"Importing your cash accounts":"Importing your accounts"}),(0,a.FD)(y.km,{className:"text-neutral-500","data-sentry-element":"Body2W400","data-sentry-source-file":"AccountSyncHappeningModal.tsx",children:["Usually takes about ",45," seconds."]})]}),(0,a.Y)("div",{className:"w-full",children:(0,a.Y)(F.A,{size:"md",delay:45e3,onFinish:u.lQ,maxVisualProgress:90,"data-sentry-element":"ProgressBar","data-sentry-source-file":"AccountSyncHappeningModal.tsx"})})]})})};var E=n(4887),Y=n(67891),D=n(89658),R=n(88179),N=n(78046),M=n(42010),L=n(96548),_=n(56471),O=n(4603),W=n(5285),B=n(73314),U=function(e){return e.CONTINUE_WITH_ACCOUNT_DESPITE_ISSUES="continue_with_account_despite_issues",e.EDIT_RECEIVED_CASH_AMOUNTS="edit_received_cash_amounts",e.DELETE_ACCOUNT_AND_ENTER_FROM_SCRATCH="delete_account_and_enter_from_scratch",e}(U||{});let z=e=>{let{cashAccount:t,providerSuccessMetadata:n}=e,{accountProvider:r}=t,[o]=(0,N.mN)(),l=(0,N.r3)("userInputMessage",o),c=(0,i.N9)(),{launchCashPortfolioInput:d}=(0,_.T)(),u=(0,W.A)(),m=(0,D.K)(r),p=Y.A(l),f=async e=>{var a,o,i,c;let d=p?l:"Cash import issue and chose to '".concat(e,"'.");await u.mutateAsync({issueType:B.s.CASH_CONNECTION_DATA_ISSUE,description:d,context:{accountProvider:r,institutionName:null==n||null==(a=n.institution)?void 0:a.name,institutionId:null==n||null==(o=n.institution)?void 0:o.institution_id,cashAccountId:t.id,url:window.location.href,userInputMessage:l||"No user feedback provided",actionTaken:e}}),p&&(0,s.trackExternalCashAccountConnection)({message:l,event:O.ExternalAccountConnectionEvent.UserReviewedImportError,institutionName:null==n||null==(i=n.institution)?void 0:i.name,accountProvider:r,institutionId:null==n||null==(c=n.institution)?void 0:c.institution_id},null,null)},v=async()=>{await f("continue_with_account_despite_issues"),e.onCancel()},A=async()=>{await f("delete_account_and_enter_from_scratch"),await c.mutateAsync({investmentAccountId:t.id,disconnectOption:L.A.DeletePortfolio}),await d(),e.onCancel()},S=async()=>{await f("edit_received_cash_amounts"),e.onEditReceivedAssetsClick()};return(0,a.Y)(x.aF,{disableSubmitOnEnter:!0,size:h.rI.Md,open:!0,title:"Oh no, an import problem?",maskClosable:!1,keyboard:!1,closable:!1,cancelButtonProps:{showErrorNotification:!1},cancelText:"Close",onCancel:v,"data-sentry-element":"Modal","data-sentry-component":"UserReviewedCashAccountErrorModal","data-sentry-source-file":"UserReviewedCashAccountErrorModal.tsx",children:(0,a.FD)(M.b,{"data-sentry-element":"InstructionsContainer","data-sentry-source-file":"UserReviewedCashAccountErrorModal.tsx",children:[(0,a.FD)(M.Uy,{"data-sentry-element":"InstructionContainer","data-sentry-source-file":"UserReviewedCashAccountErrorModal.tsx",children:[(0,a.FD)(y.bU,{className:(0,g.cn)("text-body"),"data-sentry-element":"Body1W400","data-sentry-source-file":"UserReviewedCashAccountErrorModal.tsx",children:["Please describe the problem in detail to help us resolve the issue with ",m,":"]}),(0,a.Y)(R.q,{form:o,name:"login",layout:"vertical",style:{padding:0},"data-sentry-element":"StyledForm","data-sentry-source-file":"UserReviewedCashAccountErrorModal.tsx",children:(0,a.Y)(R.JF,{name:"userInputMessage",rules:[{required:!0,whitespace:!0,message:"Please describe the issue with the import so that we can fix it."}],style:{marginBottom:0},"data-sentry-element":"StyledFormItem","data-sentry-source-file":"UserReviewedCashAccountErrorModal.tsx",children:(0,a.Y)(x.fs,{placeholder:"Please describe the issue with the import so that we can fix it.",minRows:3,"data-sentry-element":"TextArea","data-sentry-source-file":"UserReviewedCashAccountErrorModal.tsx"})})})]}),(0,a.FD)(M.Uy,{"data-sentry-element":"InstructionContainer","data-sentry-source-file":"UserReviewedCashAccountErrorModal.tsx",children:[(0,a.Y)(y.bU,{className:(0,g.cn)("text-body"),"data-sentry-element":"Body1W400","data-sentry-source-file":"UserReviewedCashAccountErrorModal.tsx",children:"If most of your cash is imported correctly:"}),(0,a.Y)(x.$n,{variant:"outlined",onClick:S,fullWidth:!0,"data-sentry-element":"Button","data-sentry-source-file":"UserReviewedCashAccountErrorModal.tsx",children:"Edit received cash"})]}),(0,a.FD)(M.Uy,{"data-sentry-element":"InstructionContainer","data-sentry-source-file":"UserReviewedCashAccountErrorModal.tsx",children:[(0,a.Y)(y.bU,{className:(0,g.cn)("text-body"),"data-sentry-element":"Body1W400","data-sentry-source-file":"UserReviewedCashAccountErrorModal.tsx",children:"If most of your cash is imported wrong:"}),(0,a.Y)(x.$n,{variant:"outlined",onClick:A,fullWidth:!0,"data-sentry-element":"Button","data-sentry-source-file":"UserReviewedCashAccountErrorModal.tsx",children:"Enter cash from scratch"})]})]})})},V=e=>{let{cashAccount:t,successMetaData:n}=e,r=(0,i.N9)(),o=r.isLoading,{launchCashPortfolioInput:l}=(0,_.T)(),c=async()=>{var a,o;(0,s.trackExternalCashAccountConnection)({event:O.ExternalAccountConnectionEvent.ImportedAssetsEdited,institutionName:null==(a=n.institution)?void 0:a.name,institutionId:null==(o=n.institution)?void 0:o.institution_id,accountProvider:t.accountProvider,message:O.ExternalAccountConnectionEventMessage.ImportedAssetsEdited},null,null);let i=await r.mutateAsync({investmentAccountId:t.id,disconnectOption:L.A.KeepAsSingleManualPortfolio});i&&(await l(i),e.onCanceled())};return(0,a.Y)(x.aF,{disableSubmitOnEnter:!0,title:"Manually edit ".concat(t.nickName," cash"),open:!0,maskClosable:!1,keyboard:!1,closable:!1,okText:"Disconnect & edit",okButtonProps:{showErrorNotification:!1,disabled:o},onOk:c,cancelButtonProps:{children:"Close",disabled:o},onCancel:e.onCanceled,"data-sentry-element":"Modal","data-sentry-component":"ManuallyEditReceivedAssetsInfoPrompt","data-sentry-source-file":"ManuallyEditReceivedAssetsInfoPrompt.tsx",children:(0,a.Y)(y.bU,{className:(0,g.cn)("text-body"),"data-sentry-element":"Body1W400","data-sentry-source-file":"ManuallyEditReceivedAssetsInfoPrompt.tsx",children:"Are you sure you want to disconnect the account and turn it into manually entry so you can edit the cash?"})})};var j=n(7802),H=n(73672);let{useGlobalCashPortfolioConnectionLaunchEventListener:q,emitGlobalCashPortfolioConnectionLaunchEvent:G}=(0,m.createEvent)("GlobalCashPortfolioConnectionLaunchEvent")(),K=()=>({launchGlobalCashPortfolioConnection:async(e,t,n)=>{G({bankId:e,reconnectingBankAccount:t,onCloseCallback:n}),await (0,u.yy)(3e3)}}),Q=()=>{let[e,t]=r.useState(void 0),[n,l]=r.useState(null),[c,m]=r.useState(null),y=(0,i.BI)(),h=(0,i.al)(),f=(0,H.vA)(),g=h.isLoading,{value:v,setTrue:x,setFalse:A}=(0,p.A)(!1),{value:S,setTrue:b,setFalse:C}
3=(0,p.A)(!1),{value:I,setTrue:w,setFalse:P}=(0,p.A)(!1),{value:F,setTrue:Y,setFalse:D}=(0,p.A)(!1);q(e=>{let{reconnectingBankAccount:n,bankId:a}=e;t(n),y.mutate({reconnectConnectionId:null==n?void 0:n.id,bankId:a},{onSuccess:async()=>{await (0,u.yy)(3e3),(0,s.trackExternalCashAccountConnection)({event:O.ExternalAccountConnectionEvent.ConnectionFlowStarted,accountProvider:j.$5.Plaid,message:O.ExternalAccountConnectionEventMessage.ConnectionFlowStarted},null,null)}})});let R=()=>{n&&f.mutate(),y.reset(),t(void 0),l(null),m(null),A(),C()},N=async(t,n)=>{var a,r;(0,s.trackExternalCashAccountConnection)({message:O.ExternalAccountConnectionEventMessage.Success,event:O.ExternalAccountConnectionEvent.Success,institutionName:null==(a=n.institution)?void 0:a.name,accountProvider:j.$5.Plaid,institutionId:null==(r=n.institution)?void 0:r.institution_id},null,null),y.reset(),m(n),h.mutate({publicToken:t,reconnectingAccountId:null==e?void 0:e.id},{onSuccess:e=>{l(e),x()}})};return g?(0,a.Y)(T,{type:"cash"}):n?v?(0,a.Y)(k,{cashAccount:n,onSomethingWrong:()=>{var e,t;(0,s.trackExternalCashAccountConnection)({message:O.ExternalAccountConnectionEventMessage.AccountPreviewedWithIssues,event:O.ExternalAccountConnectionEvent.AccountPreviewedWithIssues,institutionName:null==c||null==(e=c.institution)?void 0:e.name,accountProvider:j.$5.Plaid,institutionId:null==c||null==(t=c.institution)?void 0:t.institution_id},null,null),A(),w()},onEverythingCorrectClick:()=>{var e,t;(0,s.trackExternalCashAccountConnection)({message:O.ExternalAccountConnectionEventMessage.AccountPreviewedWithNoIssues,event:O.ExternalAccountConnectionEvent.AccountPreviewedWithNoIssues,institutionName:null==c||null==(e=c.institution)?void 0:e.name,accountProvider:j.$5.Plaid,institutionId:null==c||null==(t=c.institution)?void 0:t.institution_id},null,null),A(),b()}}):S?(0,a.Y)(E.A,{openAs:E.h.Modal,cashAccount:n,onClose:R,isOperationAbortable:!1}):I?(0,a.Y)(z,{providerSuccessMetadata:c,cashAccount:n,onCancel:()=>{P(),R()},onEditReceivedAssetsClick:()=>{var e;(0,s.trackExternalCashAccountConnection)({event:O.ExternalAccountConnectionEvent.ImportedAssetsEditPromptOpened,institutionName:null==c||null==(e=c.institution)?void 0:e.name,accountProvider:j.$5.Plaid,message:O.ExternalAccountConnectionEventMessage.ImportedAssetsEditPromptOpened},null,null),P(),Y()}}):F&&c?(0,a.Y)(V,{cashAccount:n,onCanceled:()=>{var e;(0,s.trackExternalCashAccountConnection)({event:O.ExternalAccountConnectionEvent.ImportedAssetsEditPromptAborted,institutionName:null==c||null==(e=c.institution)?void 0:e.name,accountProvider:j.$5.Plaid,message:O.ExternalAccountConnectionEventMessage.ImportedAssetsEditPromptAborted},null,null),D(),R()},successMetaData:c}):null:(0,a.Y)(r.Fragment,{children:y.data?(0,a.Y)(d,{token:y.data,onSuccess:N,onExit:(e,t)=>{if(o.gD_(e)){var n,a;(0,s.trackExternalCashAccountConnection)({event:O.ExternalAccountConnectionEvent.FlowExited,accountProvider:j.$5.Plaid,institutionName:null==(n=t.institution)?void 0:n.name,institutionId:null==(a=t.institution)?void 0:a.institution_id,message:O.ExternalAccountConnectionEventMessage.FlowExited,eventMetadata:{exitMetadata:t}},null,null)}R()}}):null})}},48298:(e,t,n)=>{n.d(t,{Ay:()=>h,IA:()=>p,a4:()=>d,fr:()=>m,s6:()=>u});var a=n(33624),r=n(88963),o=n(27687),i=n(62031),l=n.n(i),s=n(13125),c=n.n(s),d=function(e){return e.Ticker="ticker",e.Sector="sector",e.Country="country",e.TickerSector="ticker-sector",e.SectorCountry="sector-country",e.MacroMarket="macro-market",e.MacroRadar="macro-radar",e.DailyUpdate="daily-update",e.CompanyNews="news",e.GeneralNews="general-news",e}({}),u=function(e){return e.Security="security",e.Exposure="exposure",e.External="external",e.N
3one="none",e}({}),m=function(e){return e.EvaluatePortfolio="evaluate_portfolio",e.FindCandidates="find_candidates",e.ScoreCandidates="score_candidates",e.ExpandUniverse="expand_universe",e.EvaluatePairTrades="evaluate_pair_trades",e.ScorePairTrades="score_pair_trades",e.ExpandPairUniverse="expand_pair_universe",e.SmartFilter="smart_filter",e.Group="group",e.PrepareAi="prepare_ai",e.LaunchAi="launch_ai",e.AwaitAi="await_ai",e.Assemble="assemble",e.PostProcess="post_process",e.Finalizing="finalizing",e}({}),p=function(e){return e.DailyUpdate="daily_update",e.ExDailyUpdate="ex_daily_update",e.All="all",e}({});class y{constructor(){this.getAllPortfolios=async()=>{let e=await this.apiCaller.get("/portfolio/api/get_all_portfolios");return l()(e,{deep:!0})},this.getUserPortfolio=async e=>{let t=await this.apiCaller.get("/portfolio/get_user_portfolio_by_portfolio_id",{portfolio_id:e});return l()(t,{deep:!0})},this.getCorrelationMatrixForUserPortfolio=async e=>await this.apiCaller.get("/portfolio/correlation_matrix",{portfolio_id:e}),this.getExposuresForUserPortfolio=async(e,t)=>{let n=await this.apiCaller.get("/portfolio/exposure",c()({portfolioId:e,exposureType:t}));return l()(n)},this.getAllocationsForUserPortfolio=async e=>{let t=await this.apiCaller.get("/portfolio/allocations",c()({portfolioId:e}));return l()(t,{deep:!0,stopPaths:["allocations","top_contributors"]})},this.triggerPortfolioPersonalizedRecommendationsComputation=async e=>{let t=await this.apiCaller.get("/v1/portfolio/recommendations",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getPortfolioBuyAfterSellRecommendations=async(e,t)=>{let n=await this.apiCaller.get("/v1/portfolio/buy_after_sell_recommendations",c()({...t,portfolioId:e}));return l()(n,{deep:!0})},this.getPortfolioSellAfterBuyRecommendations=async e=>{let t=await this.apiCaller.get("/v1/portfolio/sell_after_buy_recommendations",c()(e));return l()(t,{deep:!0})},this.getPersonalizedRecommendationsIgnoredPreference=async()=>{let e=await this.apiCaller.get("/portfolio/recommendations_ignored_preference");return a.TjK(l(),e)},this.getSampleRecommendations=async()=>{let e=await this.apiCaller.get("/portfolio/api/sample_recommendations"),{recommendations:t}=l()(e,{deep:!0});return t},this.upsertPersonalizedRecommendationsIgnoredTickers=e=>this.apiCaller.post("/portfolio/upsert_recommendations_ignored_tickers",{tickers:e}),this.getPortfolioOverhaulRecommendations=async e=>{let t=await this.apiCaller.get("/v1/portfolio/overhaul_recommendations",c()({portfolioId:e}));return l()(t,{deep:!0})},this.triggerPortfolioOverhaulRecommendationsComputation=async e=>{let t=await this.apiCaller.get("/v1/portfolio/overhaul_recommendations",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getPortfolioOverhaulPreview=async(e,t)=>{let n=await this.apiCaller.get("/v1/portfolio/overhaul_recommendations",c()({portfolioId:e,numRounds:t}));return l()(n,{deep:!0})},this.getPortfolioExpectedPerformanceMetrics=async e=>{let t=await this.apiCaller.get("/v1/portfolio/expected_performance_stats",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getPortfolioExpectedPerformanceChart=async e=>{let t=await this.apiCaller.get("/v1/portfolio/expected_performance_chart",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getPortfolioScoreMetrics=async e=>{let t=await this.apiCaller.get("/portfolio/api/get_portfolio_score",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getPortfolioScorePercentileRank=async e=>{let t=await this.apiCaller.get("/portfolio/api/get_score_percentile_rank",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getPortfolioPreSeedExpReturns=async e=>{let t=await this.apiCaller.get("/portfolio/pre_seed_exp_returns",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getPortfolioPreSeedExposure=async e=>{let t=await this.apiCaller.get("/portfolio/pre_seed_exposure",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getPortfolioTickers=async e=>{let t=await this.apiCaller.get("/portfolio/pre_seed_ticker_series_data",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getPortfolioPreSeedBetas=async e=>{let t=await this.apiCaller.get("/portfolio/pre_seed_betas",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getPortfolioDetailedSummary=async e=>{let t=await this.apiCaller.get("/portfolio/api/get_single_portfolio_info_detailed",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getMainPortfolioIncompleteStatus=async()=>{let e=await this.apiCaller.get("/portfolio/api/get_main_portfolio_incomplete_status");return l()(e,{deep:!0})},this.getPortfolioDetailedSummaryList=async e=>{let t=await this.apiCaller.get("/portfolio/api/get_all_portfolios_detailed",c()({portfolioType:e}));return l()(t,{deep:!0})},this.getUserPortfolioScoreChange=async()=>{let e=await this.apiCaller.get("/portfolio/api/score_change_over_last_month");return l()(e,{deep:!0})},this.getUserNetWorthChange=async(e,t)=>{let n=await this.apiCaller.get("/portfolio/api/get_user_net_worth_change",c()({fromDate:e,portfolioId:t}));return l()(n,{deep:!0})},this.getNext1000DollarsInvestmentForUserPortfolio=async e=>{let t=await this.apiCaller.get("/portfolio/get_next_1000_dollar_recommendations",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getNextRecommendationsDollarAmount=async e=>{let t=await this.apiCaller.get("/portfolio/get_next_recommendations_dollar_amount",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getWhereToSellRecommendations=async(e,t)=>{let n=c()({portfolioId:e});t&&t.length>0&&(n.tax_treatments=t.join(","));let a=await this.apiCaller.get("/portfolio/where_to_sell_recommendations",n);return l()(a,{deep:!0})},this.getWhereToSellDollarAmount=async e=>{let t=await this.apiCaller.get("/portfolio/where_to_sell_dollar_amount",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getIsUserRetired=async()=>{let e=await this.apiCaller.get("/portfolio/is_user_retired");return l()(e,{deep:!0})},this.persistPersonalizedRecommendationAction=async e=>await this.apiCaller.post("/portfolio/record_recommendation_action",c()(e)),this.copyDraftPortfolio=async e=>{let t=await this.apiCaller.post("/portfolio/copy_draft_portfolio",c()(e));return l()(t,{deep:!0})},this.resetDraftPortfolio=async e=>await this.apiCaller.post("/portfolio/reset_draft_portfolio",c()(e)),this.deleteAllUserPortfolioItems=async e=>await this.apiCaller.get("/portfolio/delete_all_user_portfolio_items",c()({portfolioId:e})),this.addBulkCurrentPortfolio=async(e,t)=>await this.apiCaller.post("/portfolio/add_bulk_current_portfolio",c()({portfolioId:e,portfolioItems:t})),this.deleteDraftPortfolios=async()=>await this.apiCaller.post("/portfolio/api/delete_all_drafts",{}),this.getOrderExecutionList=async e=>{let{targetPortfolioId:t,sourcePortfolioId:n}=e,a=await this.apiCaller.get("/portfolio/get_order_execution_list",c()({sourcePortfolioId:n,targetPortfolioId:t}));return l()(a,{deep:!0})},this.sendOrderExecutionListEmail=async e=>{let{targetPortfolioId:t,sourcePortfolioId:n}=e,a=await this.apiCaller.post("/portfolio/send_order_execution_list",c()({sourcePortfolioId:n,targetPortfolioId:t}));return l()(a,{deep:!0})},this.getComparisonMetric=async e=>{let t=await this.apiCaller.post("/portfolio/generate_comparison_metric",c()(e));return l()(t,{deep:!0})},this.getOptimizedOrderExecutionList=async e=>{let{portfolioId:t,optimizedInvestmentItems:n}=e,a=await this.apiCaller.post("/portfolio/get_optimized_order_execution_list",c()({portfolioId:t,optimizedInvestmentItems:n}));return l()(a,{deep:!0})},this.getExploreInvestmentDetails=async e=>{a.Ime(e)&&console.error("Explore popup being called without ticker");let t=await this.apiCaller.get("/portfolio/adding_explore_details",c()({ticker:e}));return l()(t,{deep:!0,exclude:[o.tN],stopPaths:["chart_data.data"]})},this.applyRecommendations=async e=>await this.apiCaller.post("/portfolio/api/apply_recommendations",c()(e)),this.get
3SecuritySuggestions=async e=>{let t=await this.apiCaller.get("/portfolio/securities_suggestion",c()({tickerOrSeriesName:e}));return l()(t,{deep:!0})},this.getPortfolioDetails=async e=>{let t=await this.apiCaller.get("/portfolio/api/get_portfolio_details",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getPortfolioTaxDetails=async e=>{let t=await this.apiCaller.get("/portfolio/api/get_portfolio_tax_details",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getOtherNetWorthPortfolioDetails=async()=>{let e=await this.apiCaller.get("/portfolio/api/get_other_networth_portfolio_details");return l()(e,{deep:!0})},this.getPortfolioRiskProfile=async e=>{let t=await this.apiCaller.get("/portfolio/get_risk_preference",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getOptimizedPortfolio=async e=>{let t=await this.apiCaller.post("/portfolio/api/optimize_portfolio",c()(e));return l()(t,{deep:!0})},this.getRecommendationsCount=async()=>{let e=await this.apiCaller.get("/portfolio/api/get_recommendations_count");return l()(e)},this.getTopRecommendationsComparison=async e=>{let t=await this.apiCaller.get("/v1/portfolio/api/get_top_recommendations_comparison",c()({portfolioId:e}));return l()(t,{deep:!0})},this.createPortfolio=async e=>{let t=await this.apiCaller.post("/portfolio/api/create_portfolio",c()(e));return l()(t,{deep:!0})},this.createDraftPortfolio=async e=>{let t=await this.apiCaller.post("/portfolio/api/create_draft_portfolio",c()(e));return l()(t,{deep:!0})},this.aiPortfolioParse=async e=>{let t=await this.apiCaller.post("/reports/ai_portfolio_import",c()(e));return l()(t,{deep:!0})},this.updatePortfolioDetails=async e=>{let t=await this.apiCaller.post("/portfolio/api/update_portfolio_detail",c()(e));return l()(t,{deep:!0})},this.deletePortfolio=async e=>{let t=await this.apiCaller.post("/portfolio/delete_user_portfolio_summary",c()({portfolioId:e}));return l()(t,{deep:!0})},this.deleteManualPortfolioIfEmpty=async e=>{let t=await this.apiCaller.post("/portfolio/delete_manual_portfolio_if_empty",c()({portfolioId:e}));return l()(t,{deep:!0})},this.createDemoPortfolio=async()=>{let e=await this.apiCaller.post("/portfolio/api/create_demo_portfolio",{});return l()(e,{deep:!0})},this.getScoreImpact=async e=>{let t=await this.apiCaller.post("/portfolio/api/get_score_impact",c()(e));return l()(t,{deep:!0})},this.getRecommendationDollarBenefit=async e=>{let t=await this.apiCaller.post("/portfolio/api/ab_recommendation_dollar_benefit",c()(e));return l()(t,{deep:!0})},this.getRecommendationAlternatives=async(e,t)=>{var n;let a=await this.apiCaller.post("/portfolio/api/recommendation_alternatives",c()({portfolioId:e,sourceRecommendation:t}));return(null!=(n=l()(a,{deep:!0}).alternatives)?n:[]).map(e=>({...e,recommendationText:e.recommendation}))},this.getRecommendationTileNumbers=async()=>{let e=await this.apiCaller.get("/portfolio/api/recommendation_tile_numbers");return l()(e,{deep:!0})},this.getDownsideProtectionAnalysis=async e=>{let t=await this.apiCaller.get("/portfolio/api/get_portfolio_downside_statuses",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getDownsideFactorDetail=async(e,t)=>{let n=await this.apiCaller.get("/portfolio/api/get_portfolio_downside_factor_detail",c()({portfolioId:e,factor:t}));return l()(n,{deep:!0})},this.getSharpeRatioAnalysis=async e=>{let t=await this.apiCaller.get("/portfolio/api/get_portfolio_sharpe_ratio_analysis",c()({portfolioId:e}));return l()(t,{stopPaths:["sharpe_ratio_contribution_dict"],deep:!0})},this.getRiskMatchAnalysis=async e=>{let t=await this.apiCaller.get("/portfolio/api/get_portfolio_risk_match_analysis",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getRiskReturnFrontier=async e=>{let t=await this.apiCaller.get("/portfolio/api/get_risk_return_frontier",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getCumulativeReturns=async(e,t)=>{let n=await this.apiCaller.get("/portfolio/get_portfolio_item_cumulative_returns",c()({portfolioId:e,fromDate:t}));return l()(n,{deep:!0})},this.getTotalInvestmentsAmount=async e=>{let t=await this.apiCaller.get("/portfolio/api/get_portfolio_total_amount",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getCurrentFees=async e=>{let t=await this.apiCaller.get("/fees_optimizer/api/get_current_fees",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getAggregatedAdvisorFees=async()=>{let e=await this.apiCaller.get("/fees_optimizer/api/get_aggregated_advisor_fees");return l()(e,{deep:!0})},this.getOptimizedFees=async e=>{let t=await this.apiCaller.get("/fees_optimizer/api/get_optimized_fees",c()({portfolioId:e}));return l()(t,{deep:!0})},this.getFeeOptimizerTotalSavings=async e=>{let t=await this.apiCaller.get("/fees_optimizer/api/get_fee_optimizer_savings",c()({feesSaved:e}));return l()(t,{deep:!0})},this.postFeesChangeInformation=async(e,t)=>{let n=await this.apiCaller.post("/fees_optimizer/api/get_fee_optimizer_change_information",c()({portfolioId:e,changeList:t}));return l()(n,{deep:!0})}
3,this.getSecurityManagementAssetClasses=async()=>{let e=await this.apiCaller.get("/portfolio/get_asset_classes");return l()(e)},this.getSecurityManagementCountries=async()=>{let e=await this.apiCaller.get("/portfolio/get_countries");return a.TjK(e=>{let[t,n]=e;return{commonName:t,countryCode:n}})(a.xcu(e))},this.getCountriesAlphaThree=async()=>{let e=await this.apiCaller.get("/portfolio/get_countries_alpha_three");return a.TjK(e=>{let[t,n]=e;return{commonName:t,countryCode:n}})(a.xcu(e))},this.getSecurityManagementSectors=async()=>{let e=await this.apiCaller.get("/portfolio/get_sectors");return l()(e)},this.getSecurityManagementBondTypes=async()=>{let e=await this.apiCaller.get("/portfolio/get_bond_types");return l()(e)},this.getClassificationDefaults=async e=>{let t=await this.apiCaller.get("/portfolio/get_classification_defaults",c()(e));return t?l()(t):null},this.saveSecurityProxyMapping=async e=>{let t=await this.apiCaller.post("/portfolio/save_proxy_ticker",c()(e));return l()(t,{deep:!0})},this.resetSecurityProxyMapping=async e=>{let t=await this.apiCaller.post("/portfolio/reset_proxy_ticker",c()({ticker:e}));return l()(t,{deep:!0})},this.getSecurityTickerStats=async(e,t)=>{let n=await this.apiCaller.get("/portfolio/api/get_ticker_details",c()({ticker:e,date:t}));return l()(n,{deep:!0})},this.getComprehensiveSecurityProxyDetails=async e=>{let t=await this.apiCaller.get("/portfolio/get_proxy_ticker",c()({ticker:e}));return l()(t,{deep:!0})},this.getPortfolioTextInsights=async(e,t)=>{let n=await this.apiCaller.get("/portfolio/get_portfolio_text_insights",c()({portfolioId:e,filter:t}));return l()(n,{deep:!0})},this.aiPortfolioAddAllAtOnce=async e=>{let t=await this.apiCaller.post("/reports/ai_portfolio_add_all_at_once",c()(e));return l()(t,{deep:!0})},this.getPortfolioDetailsCsv=e=>"".concat(this.apiCaller.url).concat("/portfolio/api/get_portfolio_details_csv","?portfolio_id=").concat(e),this.getNetWorthDetailsReportUrl=e=>"".concat(this.apiCaller.url).concat("/portfolio/reports/net_worth_details.xlsx","?as_of=").concat(e),this.getRecommendationJustification=async(e,t)=>{var n;return null!=(n=(await this.apiCaller.post("/v1/portfolio/recommendation_justification",c()({portfolioId:e,recommendation:t}))).bullets)?n:[]},this.createPortfolioReplacement=async(e,t)=>{let n=await this.apiCaller.post("/portfolio_replacement/create",c()({originalPortfolioId:e,replacementPortfolioId:t}));return l()(n)},this.createPortfolioStandin=async e=>{let t=await this.apiCaller.post("/portfolio_replacement/create_standin",c()({originalPortfolioId:e}));return l()(t)},this.invalidatePortfolios=async()=>{let e=await this.apiCaller.post("/portfolio/invalidate_portfolios",{});return l()(e)},this.apiCaller=new r.Ay}}let h=new y},48779:(e,t,n)=>{n.d(t,{Dh:()=>a,Jo:()=>l,Qy:()=>r,jK:()=>o,zO:()=>i});let a="",r=0,o=void 0,i=void 0,l=.1},49332:(e,t,n)=>{n.d(t,{b:()=>r});var a=n(99750);let r=()=>{let{isBelow768:e}=(0,a.uF)();return{isCompactView:e}}},49575:(e,t,n)=>{n.d(t,{k:()=>i});var a=n(12115),r=n(6976),o=n(74547);let i=(e,t)=>{let[n,i]=a.useState(e),[l]=(0,o.mN)(),s=(0,r.mL)(),c=(0,r.sS)(),d=async()=>{await l.validateFields();let a=l.getFieldsValue(!0),r={...n,...a};r&&await c.mutateAsync(r,{onSuccess:async()=>{i(e),await t()}})};return{form:l,privateEquityUpsertMutation:c,upsertablePEOtherAssetsItem:n,setUpsertablePEOtherAssetsItem:i,handleEditPEOtherAssetsItem:e=>{i(e)},handlePEOtherAssetsDetailsSubmit:d,handleDeletePEOtherAssetsDetails:async e=>{await s.mutateAsync(e)}}}},49586:(e,t,n)=>{n.d(t,{l:()=>a});var a=function(e){return e.NewPortfolio="NewPortfolio",e.EditPortfolio="EditPortfolio",e}({})},49641:(e,t,n)=>{n.d(t,{A:()=>en});var a=n(57090),r=n(12115),o=n(33624),i=n(62212),l=n(73285),s=n(99026),c=n(8921),d=n(25373),u=n(29053),m=n(73070),p=n(80900),y=n(49858),h=n(89928),f=n(98804);let g=async(e,t)=>{try{let n=await e.fetchQuery([...m.ub.Preferences,"base"],()=>(0,p.FY)());if(0>=(e=>{let t=e.find(e=>e.questionId===f.WR.OtherRetirementIncome&&(0,y.LB)(e));return t?(0,s.YZ)(t.response):0})(n.preferences))return;(0,c.Ds)(c._n.Info,"Check your other retirement income",{description:"It may already include this pension. If so, lower it so the pension is not counted twice.",action:{label:"Review",onClick:()=>void(0,d.IE)(t,{tab:u.ji.Retirement,settingsTab:h.bd.MoneyInOut})}})}catch(e){}};var v=n(12667),x=n(11965),A=n(84978),S=n(74166),b=n(95825),C=n(74547),I=n(36934),w=n(85543),P=n(34857),k=n(49575),F=n(25471),T=n(10102),E=n(88179),Y=n(91217),D=n(65438),R=n(81671);let N=()=>{let{securitySectorsOptions:e,securityCountriesOptions:t,securityAssetClassesOptions:n}=(0,T.t)();return(0,a.FD)(r.Fragment,{children:[(0,a.Y)(E.JF,{label:(0,a.FD)(I.km,{className:"text-neutral-500",children:["1 year expected return",(0,a.Y)(F.H,{title:"Your estimate of performance over the next 12 months"})]}),name:["additionalDetail","oneYearExpectedReturn"],rules:[{validator:async(e,t)=>t>Y.CP||t<Y.kp?Promise.reject("Enter a value between -50% and 50%"):Promise.resolve()}],"data-sentry-element":"FormItem","data-sentry-source-file":"SecurityAssumptions.tsx",children:(0,a.Y)(C.tv,{inForm:!0,"data-sentry-element":"PercentageInput","data-sentry-source-file":"SecurityAssumptions.tsx"})}),(0,a.Y)(E.JF,{label:(0,a.FD)(I.km,{className:"text-neutral-500",children:["Risk (annualized volatility)",(0,a.Y)(F.H,{title:"Your estimate of the annualized standard deviation of returns over the next 12 months"})]}),name:["additionalDetail","risk"],rules:[{validator:async(e,t)=>t>Y.ZK||t<Y.R5?Promise.reject("Enter a value between 0% and 100%"):Promise.resolve()}],"data-sentry-element":"FormItem","data-sentry-source-file":"SecurityAssumptions.tsx",children:(0,a.Y)(C.tv,{inForm:!0,"data-sentry-element":"PercentageInput","data-sentry-source-file":"SecurityAssumptions.tsx"})}),(0,a.Y)(E.JF,{name:["additionalDetail","country"],label:(0,a.Y)(I.km,{className:"text-neutral-500",children:"Country"}),"data-sentry-element":"FormItem","data-sentry-source-file":"SecurityAssumptions.tsx",children:(0,a.Y)(v.y,{options:t,showSearch:!0,filterOption:!0,optionFilterProp:"label","data-sentry-element":"Select","data-sentry-source-file":"SecurityAssumptions.tsx"})}),(0,a.Y)(E.JF,{name:["additionalDetail","assetClass"],label:(0,a.Y)(I.km,{className:"text-neutral-500",children:"Asset class"}),"data-sentry-element":"FormItem","data-sentry-source-file":"SecurityAssumptions.tsx",children:(0,a.Y)(v.y,{options:n,"data-sentry-element":"Select","data-sentry-source-file":"SecurityAssumptions.tsx"})}),(0,a.Y)(E.JF,{name:["additionalDetail","sector"],label:(0,a.Y)(I.km,{className:"text-neutral-500",children:"Sector"}),"data-sentry-element":"FormItem","data-sentry-source-file":"SecurityAssumptions.tsx",children:(0,a.Y)(v.y,{options:e,"data-sentry-element":"Select","data-sentry-source-file":"SecurityAssumptions.tsx"})})]})},M=()=>{let{value:e,toggle:t}=(0,D.A)(!1);return(0,a.Y)(C.nD,{selectionMode:"single",variant:"light",keepContentMounted:!0,isCompact:!0,hideIndicator:!0,onSelectionChange:t,style:{padding:0},"data-sentry-element":"Accordion","data-sentry-component":"SecurityAssumptionsAccordion","data-sentry-source-file":"SecurityAssumptions.tsx",children:(0,a.Y)(C.As,{classNames:{title:"text-primary",content:"px-0"},title:(0,a.FD)(C.Ah,{flexWrap:"nowrap",justifyContent:"flex-start",alignItems:"center",itemsSpacingHorizontal:2,children:[(0,a.Y)(C.In,{icon:e?R.$.ChevronTopSmall:R.$.ChevronDownSmall,size:16}),(0,a.Y)(I.s9,{children:"Additional details (optional)"})]}),"data-sentry-element":"AccordionItem","data-sentry-source-file":"SecurityAssumptions.tsx",children:(0,a.FD)(C.Ah,{flexDirection:"column",justifyContent:"flex-start",alignItems:"stretch",itemsSpacingVertical:16,occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"SecurityAssumptions.tsx",children:[(0,a.Y)(I.st,{"data-sentry-element":"HelperMessage","data-sentry-source-file":"SecurityAssumptions.tsx",children:"Our AI will make smart assumptions about any details you don't provide. Fill in what you know. Even partial information helps."}),(0,a.Y)(N,{"data-sentry-element":"SecurityAssumptions","data-sentry-source-file":"SecurityAssumptions.tsx"})]})})})};var L=n(67297),_=n(85794),O=n(21533),W=n(13340),B=n(63114);let U=[{value:A.v0.Monthly,label:"Monthly payments"},{value:A.v0.LumpSum,label:"Lump sum"}],z=e=>(0,a.Y)(C.tU,{size:"sm",selectedKey:e.value,onSelectionChange:t=>{e.onChange(t)}
3,"aria-label":"How the pension or annuity is paid","data-sentry-element":"Tabs","data-sentry-component":"PaidAsSwitch","data-sentry-source-file":"PaidAsSwitch.tsx",children:U.map(e=>(0,a.Y)(C.oz,{title:e.label},e.value))});var V=n(46165);let j=n(75128).C2.retirementAge,H=["additionalDetail","startAge"],q=[{value:A.rT.Life,label:"For life"},{value:A.rT.Age,label:"At age"}],G=[{value:A.eN.NoSurvivor,label:"None"},{value:A.eN.Half,label:"50%"},{value:A.eN.ThreeQuarters,label:"75%"},{value:A.eN.Full,label:"100%"}],K=[{value:A.Ae.Ordinary,label:"Taxed as income"},{value:A.Ae.TaxFree,label:"Tax-free"}],Q=[{type:"number",min:30,max:120,message:"Enter an age between ".concat(30," and ").concat(120)}],$=e=>{let{value:t,toggle:n}=(0,D.A)(!1);return(0,a.Y)(C.nD,{selectionMode:"single",variant:"light",keepContentMounted:!0,isCompact:!0,hideIndicator:!0,onSelectionChange:n,style:{padding:0},"data-sentry-element":"Accordion","data-sentry-component":"PensionAnnuityAdditionalDetails","data-sentry-source-file":"PensionAnnuityFields.tsx",children:(0,a.Y)(C.As,{classNames:{title:"text-primary",content:"px-0"},title:(0,a.FD)(C.Ah,{flexWrap:"nowrap",justifyContent:"flex-start",alignItems:"center",itemsSpacingHorizontal:2,children:[(0,a.Y)(C.In,{icon:t?R.$.ChevronTopSmall:R.$.ChevronDownSmall,size:16}),(0,a.Y)(I.s9,{children:"Additional details (optional)"})]}),"data-sentry-element":"AccordionItem","data-sentry-source-file":"PensionAnnuityFields.tsx",children:(0,a.FD)(C.Ah,{flexDirection:"column",justifyContent:"flex-start",alignItems:"stretch",itemsSpacingVertical:16,occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"PensionAnnuityFields.tsx",children:[(0,a.Y)(I.st,{"data-sentry-element":"HelperMessage","data-sentry-source-file":"PensionAnnuityFields.tsx",children:"Fill in what you know. We estimate anything you leave blank."}),(0,a.Y)(E.JF,{name:["additionalDetail","inflationAdjusted"],valuePropName:"checked","data-sentry-element":"FormItem","data-sentry-source-file":"PensionAnnuityFields.tsx",children:(0,a.Y)(C.Sc,{"data-sentry-element":"Checkbox","data-sentry-source-file":"PensionAnnuityFields.tsx",children:"Payout adjusts for inflation each year"})}),(0,a.FD)(C.Ah,{flexWrap:"nowrap",justifyContent:"flex-start",alignItems:"start",itemsSpacingHorizontal:12,"data-sentry-element":"FlexLayout","data-sentry-source-file":"PensionAnnuityFields.tsx",children:[(0,a.Y)(E.JF,{name:["additionalDetail","survivorShare"],label:(0,a.Y)(I.km,{className:"text-neutral-500",children:"Continues to spouse"}),className:"flex-1","data-sentry-element":"FormItem","data-sentry-source-file":"PensionAnnuityFields.tsx",children:(0,a.Y)(v.y,{options:G,"data-sentry-element":"Select","data-sentry-source-file":"PensionAnnuityFields.tsx"})}),(0,a.Y)(E.JF,{name:["additionalDetail","taxTreatment"],label:(0,a.Y)(I.km,{className:"text-neutral-500",children:"Tax treatment"}),className:"flex-1","data-sentry-element":"FormItem","data-sentry-source-file":"PensionAnnuityFields.tsx",children:(0,a.Y)(v.y,{options:K,"data-sentry-element":"Select","data-sentry-source-file":"PensionAnnuityFields.tsx"})})]}),(0,a.Y)(E.JF,{name:["additionalDetail","netPresentValue"],label:(0,a.Y)(I.km,{className:"text-neutral-500",children:"Current value"}),rules:[{validator:(0,O.de)(O.wx)}],extra:(0,a.Y)(I.QP,{children:"Only if your statement shows one (a cash-balance or annuity contract value). Otherwise we estimate it from the payouts."}),"data-sentry-element":"FormItem","data-sentry-source-file":"PensionAnnuityFields.tsx",children:(0,a.Y)(_.d,{humanizeNumber:!0,addonBefore:W.IK[e.currency],min:0,"data-sentry-element":"StyledNetworthInput","data-sentry-source-file":"PensionAnnuityFields.tsx"})})]})})})},X=e=>{let t=e.investmentType===A.q8.Pension,n=(0,C.r3)(["additionalDetail","endMode"],e.form);return(0,a.FD)(r.Fragment,{children:[(0,a.Y)(E.JF,{name:["additionalDetail","monthlyPayout"],label:(0,a.Y)(I.km,{className:"text-neutral-500",children:t?"Monthly payout in retirement":"Monthly payout"}),rules:(0,O.HU)("Enter monthly payout"),extra:(0,a.Y)(I.QP,{children:t?"Assumed to rise with inflation each year, as most public pensions do. Change under Additional details.":"Assumed to stay level. If yours has a cost-of-living rider, change it under Additional details."}),"data-sentry-element":"FormItem","data-sentry-source-file":"PensionAnnuityFields.tsx",children:(0,a.Y)(_.d,{humanizeNumber:!0,addonBefore:W.IK[e.currency],min:0,"data-sentry-element":"StyledNetworthInput","data-sentry-source-file":"PensionAnnuityFields.tsx"})}),(0,a.FD)(C.Ah,{flexWrap:"wrap",justifyContent:"flex-start",alignItems:"start",itemsSpacingHorizontal:12,"data-sentry-element":"FlexLayout","data-sentry-source-file":"PensionAnnuityFields.tsx",children:[(0,a.Y)(E.JF,{name:["additionalDetail","startAge"],label:(0,a.Y)(I.km,{className:"text-neutral-500",children:"Starts at age"}),rules:[{required:!0,message:"Enter a start age"},...Q],className:"flex-1","data-sentry-element":"FormItem","data-sentry-source-file":"PensionAnnuityFields.tsx",children:(0,a.Y)(C.YI,{fractionDigits:0,min:30,max:120,"data-sentry-element":"InputNumber","data-sentry-source-file":"PensionAnnuityFields.tsx"})}),(0,a.Y)(E.JF,{name:["additionalDetail","endMode"],label:(0,a.Y)(I.km,{className:"text-neutral-500",children:"Ends"}),className:"flex-1","data-sentry-element":"FormItem","data-sentry-source-file":"PensionAnnuityFields.tsx",children:(0,a.Y)(v.y,{options:q,"data-sentry-element":"Select","data-sentry-source-file":"PensionAnnuityFields.tsx"})}),n===A.rT.Age&&(0,a.Y)(E.JF,{name:["additionalDetail","endAge"],dependencies:[["additionalDetail","startAge"]],label:(0,a.Y)(I.km,{className:"text-neutral-500",children:"End age"}),rules:[{required:!0,message:"Enter an end age"},...Q,e=>{let{getFieldValue:t}=e;return{validator(e,n){var a;let r=(a=t(["additionalDetail","startAge"]),"number"==typeof n&&"number"==typeof a&&Number.isFinite(n)&&Number.isFinite(a)&&n<=a?"End age must be greater than the start age (".concat(a,")."):null);return r?Promise.reject(Error(r)):Promise.resolve()}}}],className:"flex-1",children:(0,a.Y)(C.YI,{fractionDigits:0,min:30,max:120})})]}),(0,a.Y)(I.QP,{"data-sentry-element":"FormFieldHelperMessage","data-sentry-source-file":"PensionAnnuityFields.tsx",children:"Enter your current age if payouts have already started."})]})},J=e=>(0,a.FD)(r.Fragment,{children:[(0,a.Y)(E.JF,{name:["additionalDetail","lumpSumAmount"],label:(0,a.Y)(I.km,{className:"text-neutral-500",children:"Lump sum amount"}),rules:(0,O.HU)("Enter a lump sum amount"),extra:(0,a.Y)(I.QP,{children:"The lump-sum offer on your statement, or your cash-balance account balance. Paid once, instead of monthly payments."}),"data-sentry-element":"FormItem","data-sentry-source-file":"PensionAnnuityFields.tsx",children:(0,a.Y)(_.d,{humanizeNumber:!0,addonBefore:W.IK[e.currency],min:0,"data-sentry-element":"StyledNetworthInput","data-sentry-source-file":"PensionAnnuityFields.tsx"})}),(0,a.Y)(E.JF,{name:["additionalDetail","startAge"],label:(0,a.Y)(I.km,{className:"text-neutral-500",children:"Paid at age"}),rules:[{required:!0,message:"Enter the age it is paid at"},...Q],"data-sentry-element":"FormItem","data-sentry-source-file":"PensionAnnuityFields.tsx",children:(0,a.Y)(C.YI,{fractionDigits:0,min:30,max:120,"data-sentry-element":"InputNumber","data-sentry-source-file":"PensionAnnuityFields.tsx"})})]}),Z=e=>{var t;let[n,o]=r.useState(()=>{var t;return null!=(t=e.form.getFieldValue(["additionalDetail","paidAs"]))?t:A.v0.Monthly}),{retirementAge:i}=(0,V.pX)(),l=null!=i?i:j,s=(0,C.r3)(H,e.form),c=r.useRef(null);r.useEffect(()=>{let t=e.form.getFieldValue(H);null!=t&&t!==c.current||t===l||e.form.isFieldTouched(H)||(c.current=l,e.form.setFieldValue(H,l))},[l,s]);let d=r.useRef(null!=(t=e.form.getFieldValue("investmentType"))?t
3:e.investmentType);return r.useEffect(()=>{void 0!==e.investmentType&&e.investmentType!==d.current&&(d.current=e.investmentType,e.form.setFieldValue(["additionalDetail","inflationAdjusted"],(0,A.QF)(e.investmentType)))},[e.investmentType]),(0,a.FD)(r.Fragment,{children:[(0,a.Y)(E.JF,{label:(0,a.Y)(I.km,{className:"text-neutral-500",children:"Paid as"}),"data-sentry-element":"FormItem","data-sentry-source-file":"PensionAnnuityFields.tsx",children:(0,a.Y)(z,{value:n,onChange:t=>{o(t),e.form.setFieldValue(["additionalDetail","paidAs"],t)},"data-sentry-element":"PaidAsSwitch","data-sentry-source-file":"PensionAnnuityFields.tsx"})}),n===A.v0.LumpSum?(0,a.Y)(J,{...e}):(0,a.Y)(X,{...e}),(0,a.Y)($,{...e,"data-sentry-element":"PensionAnnuityAdditionalDetails","data-sentry-source-file":"PensionAnnuityFields.tsx"})]})};var ee=n(6976),et=n(78190);let en=e=>{var t,n;let{upsertablePEOtherAssetsItem:s,form:c,handlePEOtherAssetsDetailsSubmit:d}=(0,k.k)(e.initialOtherAssetItem,e.onSuccessfulUpsert),u=(0,ee.G4)(),m=(0,i.j)(),p=(0,l.w)(),[y,h]=r.useState(!1),f=(0,C.r3)("investmentType",c),F=(0,C.r3)("additionalDetail",c),T=(0,C.r3)("currency",c),{userResidency:Y}=(0,V.R2)(),{retirementAge:D}=(0,V.pX)(),R=Y===et.XM.CAD,N=(0,P.An)(f),U=r.useRef(e.initialOtherAssetItem.investmentType),z=r.useRef((0,P.An)(e.initialOtherAssetItem.investmentType)),j=r.useRef((0,P.An)(e.initialOtherAssetItem.investmentType));r.useEffect(()=>{if(!f||f===U.current)return;let e=U.current;if(U.current=f,c.setFieldValue("additionalDetail",(0,w.Kb)(f,e,c.getFieldValue("additionalDetail"),D)),j.current&&!N){j.current=!1;let e=(0,w.sW)(T);c.setFieldsValue({investmentValue:e.investmentValue,currentInvestmentValue:e.currentInvestmentValue})}},[f]);let{title:H,submitLabel:q}=(0,w.wB)({...s,investmentType:null!=f?f:s.investmentType,additionalDetail:null!=F?F:s.additionalDetail}),G=async()=>{var t;await c.validateFields();let n=c.getFieldsValue(!0),a=n.additionalDetail,r=null!=(t=null==a?void 0:a.netPresentValue)?t:0;await u.mutateAsync({...s,...n,investmentValue:r,currentInvestmentValue:r}),await e.onSuccessfulUpsert(),(o.gD_(s.netWorthItemId)||!z.current)&&g(m,p)},K=async()=>{h(!0);try{await (N?G():d()),e.onClose()}finally{h(!1)}};return(0,a.Y)(x.S,{"data-sentry-element":"GuestAssetTextInputsGate","data-sentry-component":"OtherAssetsNetworthForm","data-sentry-source-file":"OtherAssetsNetworthForm.tsx",children:(0,a.Y)(S.z,{title:H,size:b.rI.Sm,onOk:K,okText:q,okButtonProps:{loading:y},onCancel:()=>{e.onClose()},cancelText:"Cancel","data-sentry-element":"InputPopup","data-sentry-source-file":"OtherAssetsNetworthForm.tsx",children:(0,a.FD)(C.lV,{form:c,initialValues:s,layout:"vertical","data-sentry-element":"Form","data-sentry-source-file":"OtherAssetsNetworthForm.tsx",children:[(0,a.Y)(E.JF,{name:"investmentType",label:(0,a.Y)(I.km,{className:"text-neutral-500",children:"Type of asset"}),"data-sentry-element":"FormItem","data-sentry-source-file":"OtherAssetsNetworthForm.tsx",children:(0,a.Y)(v.y,{options:[...null!=(n=e.assetTypeOptions)?n:A.Kl],"data-sentry-element":"Select","data-sentry-source-file":"OtherAssetsNetworthForm.tsx"})}),(0,a.Y)(E.JF,{name:["additionalDetail","name"],label:(0,a.Y)(I.km,{className:"text-neutral-500",children:"Asset name"}),rules:[{required:!0,message:"Enter an asset name",type:"string",whitespace:!0}],"data-sentry-element":"FormItem","data-sentry-source-file":"OtherAssetsNetworthForm.tsx",children:(0,a.Y)(C.pd,{inForm:!0,placeholder:"Enter an asset name","data-sentry-element":"Input","data-sentry-source-file":"OtherAssetsNetworthForm.tsx"})}),N?(0,a.FD)(r.Fragment,{children:[R&&(0,a.Y)(E.JF,{name:["currency"],required:!0,children:(0,a.Y)(B.A,{})}),(0,a.Y)(Z,{form:c,investmentType:f,currency:T})]}):(0,a.FD)(r.Fragment,{children:[(0,a.FD)(C.Ah,{flexWrap:"nowrap",justifyContent:"flex-start",alignItems:"end",itemsSpacingHorizontal:12,children:[(0,a.Y)(E.JF,{name:["additionalDetail","originalInvestmentAmount"],label:(0,a.Y)(I.km,{className:"text-neutral-500",children:"Original investment amount"}),className:"flex-1",rules:(0,O.HU)("Enter the original investment amount"),children:(0,a.Y)(_.d,{humanizeNumber:!0,addonBefore:W.IK[T]})}),R&&(0,a.Y)(E.JF,{name:["currency"],required:!0,children:(0,a.Y)(B.A,{})})]}),(0,a.FD)(C.Ah,{flexWrap:"nowrap",justifyContent:"flex-start",alignItems:"end",itemsSpacingHorizontal:12,children:[(0,a.Y)(E.JF,{name:"investmentValue",label:(0,a.Y)(I.km,{className:"text-neutral-500",children:null==(t=L.C6[f])?void 0:t.headerLabel}),className:"flex-1",rules:(0,O.HU)("Enter the current value"),children:(0,a.Y)(_.d,{humanizeNumber:!0,addonBefore:W.IK[T]})}),R&&(0,a.Y)(E.JF,{name:["currency"],required:!0,children:(0,a.Y)(B.A,{})})]}),(0,a.Y)(C.cG,{}),(0,a.Y)(M,{})]})]})})})}},49857:(e,t,n)=>{n.d(t,{A:()=>u});var a=n(57090);n(12115);var r=n(70432),o=n(92672),i=n(62570),l=n(24780),s=n(85731);let c=(0,i.A)("div",{target:"eie84mf0"})("color:",e=>e.theme.colors.neutral900,";line-height:1.3em;",(0,o.BK)({fontSize:["16px","17px","18px"],fontWeight:[500,600]}),";"),d=(0,i.A)("div",{target:"eie84mf1"})("font-weight:400;",(0,o.BK)({fontSize:["16px"]}),"  color:",e=>e.theme.colors.neutral500,";"),u=e=>{let{title:t,subTitle:n,commonInsightBlockContent:i}=e,{setMacroExplorerQueryParams:u}=(0,s.x)(),{region:m,conceptType:p,isMacro:y}=i||{},h=async()=>{await u({country:m,conceptType:p})},f=m&&p&&y?(0,a.Y)(r.A,{color:"accent",onClick:h,children:"See Details"}):null;return(0,a.FD)(o.Ah,{flexDirection:"column",itemsSpacingVertical:6,marginBottom:20,alignItems:"start",justifyContent:"flex-start","data-sentry-element":"FlexLayout","data-sentry-component":"ChartHeading","data-sentry-source-file":"ChartHeading.tsx",children:[(0,a.FD)(o.Ah,{justifyContent:"space-between",occupyParentWidth:!0,itemsSpacingHorizontal:8,alignItems:"flex-start",flexWrap:"nowrap","data-sentry-element":"FlexLayout","data-sentry-source-file":"ChartHeading.tsx",children:[(0,a.Y)(c,{"data-sentry-element":"Heading","data-sentry-source-file":"ChartHeading.tsx",children:t}),i?(0,a.Y)(l.A,{...i}):null]}),(0,a.FD)(d,{"data-sentry-element":"Subheading","data-sentry-source-file":"ChartHeading.tsx",children:[n," ",f]})]})}},49858:(e,t,n)=>{n.d(t,{LB:()=>c,QO:()=>u,RG:()=>p,TN:()=>d,pE:()=>m,xz:()=>y});var a=n(33624),r=n(16528),o=n(92332),i=n(28056),l=n(98804),s=n(97139);let c=e=>(0,i.A0)(e.questionId)&&r.A(e.response)&&e.id!==l.si,d=e=>e.filter(c).map(e=>e.questionId),u=(e,t)=>
3!!a.mKk(String(e),t.cachedAnsweredIds)||(e===s.PO.PensionItems?t.hasPensionItems:e!==s.PO.BigExpenses&&e!==s.PO.BigInflows&&a.mKk(e,t.userSetPreferenceIds)),m=(e,t)=>!a.mKk(e,t.activeQuestionIds)||u(e,t),p=(e,t)=>0===t?100:Math.round(100*e/t),y=(e,t)=>{let n=a.vUk((e=>o.A(e.cachedAnsweredIds)?e.activeQuestionIds:a.kuo(t=>u(t,e),e.activeQuestionIds))(e),t),r=a.Bw9(n),i=a.Bw9(a.pbD(t=>m(t,e),n));return{questionSetIds:n,completedCount:i,totalCount:r,percent:p(i,r),isComplete:i===r,hasStarted:o.A(e.cachedAnsweredIds)}}},49877:(e,t,n)=>{n.d(t,{$c:()=>h,BI:()=>v,I:()=>S,N9:()=>b,Nx:()=>p,Op:()=>A,X3:()=>m,al:()=>x,b0:()=>g,gy:()=>I});var a=n(33624),r=n(75075),o=n(17667),i=n(10833),l=n(70890),s=n(84245),c=n(53374),d=n(73672);let u=e=>[...s.pu,{cashPortfolioId:e}],m=async e=>r.A.upsertCashPortfolio(e),p=()=>{let e=(0,i.j)(),t=(0,d.vA)();return(0,o.A)(m,{onSuccess:async(n,r)=>{let{cashPortfolioId:o}=n,{cashPortfolioId:i}=r;await e.invalidateQueries(u(o)),(0,c.E)(e),(0,l.DK)(e),a.gD_(i)&&t.mutate()},onSuccessMessage:()=>"Saved successfully"})},y=async e=>r.A.getCashPortfolioById(e),h=e=>(0,i.I)(u(e),()=>y(e),s.gz),f=async e=>r.A.deleteCashPortfolio(e),g=()=>{let e=(0,i.j)();return(0,o.A)(f,{onSuccess:async()=>{await (0,l.DK)(e),await (0,c.E)(e)},onSuccessMessage:()=>"Deleted successfully"})},v=()=>(0,o.A)(r.A.createCashOnlyLinkToken,{onErrorMessage:()=>"We could not start the connection. Please try again, or contact support if it keeps happening."}),x=()=>{let e=(0,i.j)();return(0,o.A)(r.A.exchangePublicToken,{onSuccess:async()=>{await (0,c.E)(e)},onSuccessMessage:()=>"Saved successfully",onErrorMessage:()=>"We could not finish connecting your account. Please try again, or contact support if it keeps happening."})},A=()=>(0,i.I)(s.yI,()=>r.A.getCashConnectedAccounts(),s.gz),S=()=>(0,i.I)(s.Zw,()=>r.A.getCashPortfolios(),s.gz),b=()=>{let e=(0,i.j)();return(0,o.A)(r.A.disconnectCashAccount,{onSuccess:async()=>{await (0,l.DK)(e),await (0,c.E)(e)},onSuccessMessage:()=>"Disconnected successfully"})},C=["DefaultApyRates"],I=()=>(0,i.I)(C,()=>r.A.getDefaultApyRates(),{staleTime:1/0,cacheTime:1/0})},50127:(e,t,n)=>{n.d(t,{A:()=>f,B:()=>h});var a=n(57090),r=n(12115),o=n(43948),i=n(95825),l=n(40248),s=n(8921),c=n(8441),d=n(55669),u=n(93382);let m=e=>{let{showPrompt:t,suppressDemoRemovalPrompt:n,demoPortfolio:r}=(0,c.P)(),o=(0,d.f)(u.$.RemoveDemoPromptAccepted),m=()=>{n(),e.onComplete()},p=async()=>{r?await o.mutateAsync(null,{onSuccess:()=>{(0,s.Ds)(s._n.Success,"Demo portfolio was removed"),e.onComplete()}}):console.error("Demo portfolio is unavailable when user attempted to remove it")};return(0,a.Y)(i.Ay,{disableSubmitOnEnter:!0,title:"Remove Demo portfolio",centered:!0,open:t,destroyOnClose:!0,closable:!0,maskClosable:!1,keyboard:!0,onCancel:m,size:i.rI.Sm,footer:(0,a.FD)(i.jl,{children:[(0,a.Y)(l.A,{onClick:m,variant:"outlined",children:"Leave it"}),(0,a.Y)(l.A,{onClick:p,variant:"filled",color:"danger",children:"Remove"})]}),"data-sentry-element":"Modal","data-sentry-component":"DemoPortfolioRemovalHandler","data-sentry-source-file":"DemoPortfolioRemovalHandler.tsx",children:"Now that you've added a real portfolio, you can get rid of your Demo portfolio."})},{useDemoPortfolioRemovalHandlerEventListener:p,emitDemoPortfolioRemovalHandlerEvent:y}=(0,o.createEvent)("DemoPortfolioRemovalHandlerEvent")(),h=()=>({launchDemoPortfolioRemovalHandler:()=>{y()}}),f=()=>{let[e,t]=r.useState(!1);return(p(async()=>{t(!0)}),e)?(0,a.Y)(m,{onComplete:()=>{t(!1)},"data-sentry-element":"DemoPortfolioRemovalHandler","data-sentry-component":"GlobalDemoPortfolioRemovalHandler","data-sentry-source-file":"GlobalDemoPortfolioRemovalHandler.tsx"}):null}},50202:(e,t,n)=>{n.d(t,{RW:()=>S,bY:()=>v,lo:()=>A});var a=n(57090),r=n(12115),o=n(33624),i=n(48298),l=n(32189),s=n(81527),c=n(84245),d=n(544),u=n(6319),m=n(58888),p=n(95392),y=n(35208),h=n(67522);let f=[],g=()=>i.Ay.getAllPortfolios(),v=()=>(0,s.I)(c.nm,g,{...y.Lo,useErrorBoundary:!0}),x=r.createContext(void 0);x.displayName="PortfoliosListContext";let A=e=>{let{children:t,loadingFallback:n}=e,{data:i=f,isError:s,error:c,isSuccess:y}=v(),{data:g=[],isSuccess:A}=(0,m.Aj)(),{mainPortfolio:S,currentPortfolios:b,draftPortfolios:C,firstAvailableDraftPortfolio:I,groupPortfolios:w}=(0,u.A)(i),P=o.Uo6(y,A),{activePortfolioId:k,setActivePortfolioId:F}=(0,h.G)(),T=null==S?void 0:S.portfolioId,E=r.useMemo(()=>k?(0,d.Fk)(i,k):null,[k,i]),Y=r.useMemo(()=>{var e;return o.vUk(T,null==(e=o.I6j(o.wqE("isDefault",!0),g))?void 0:e.portfolioSummaryId)},[g,T]),D=r.useMemo(()=>(0,d.p2)(i),[i]),R=o.Ime(D),N=S&&b;if((0,p.A)(s,c,"Portfolio list not loaded",{description:"Portfolio data could not be retrieved."}),P&&k&&N&&E){let e=o.aIS(l.N$.Main,E.portfolioType),n=o.aIS(l.N$.Group,E.portfolioType),r=o.or(e,n),s=o.aIS(l.N$.Draft,E.portfolioType),c=o.aIS(l.N$.Current,E.portfolioType),d=S.portfolioId;return(0,a.Y)(x.Provider,{value:{groups:g,portfoliosList:i,activePortfolioId:k,_setActivePortfolioId:F,mainPortfolio:S,netWorthPortfolioId:d,currentPortfolios:b,groupPortfolios:w,firstAvailableDraftPortfolio:I,activePortfolio:E,draftPortfolios:C,isActivePortfolioMain:e,isActivePortfolioDraft:s,isActivePortfolioCurrent:c,isUserPortfoliosEmpty:R,isActivePortfolioGroup:n,isActivePortfolioMainOrGroup:r,userProvidedCurrentPortfolios:D,defaultGroupPortfolioId:Y},children:t})}return(0,a.Y)(r.Fragment,{children:n})},S=()=>{let e=r.useContext(x);if(void 0===e)throw Error("usePortfoliosList must be used within a PortfoliosListProvider");return e}}
3,50343:(e,t,n)=>{n.d(t,{IV:()=>m,Iv:()=>h,J$:()=>y,JF:()=>d,KY:()=>p,MG:()=>i,Ru:()=>u,b7:()=>l,q:()=>s,q9:()=>c});var a=n(62570),r=n(74547),o=n(78046);let i=(0,a.A)("div",{target:"e1m97aam0"})("width:100%;"),l=(0,a.A)(r.$n,{target:"e1m97aam1"})(),s=(0,a.A)(o.lV,{target:"e1m97aam2"})("display:flex;flex-direction:column;flex-wrap:wrap;align-content:center;align-items:stretch;gap:16px;"),c=(0,a.A)(o.lV,{target:"e1m97aam3"})("grid-template-columns:1fr 2fr;align-items:center;justify-content:center;gap:16px 20px;row-gap:8px;",e=>e.includeSharesInputCount?(0,r.BK)({display:["flex","grid","grid","grid","grid"],justifyContent:["flex-start"],flexWrap:["wrap","wrap","nowrap","nowrap","nowrap"]}):(0,r.BK)({display:["flex"],alignItems:["flex-end"],justifyContent:["flex-start"],flexWrap:["wrap","wrap","nowrap","nowrap","nowrap"]}),"  .ant-spin-nested-loading{flex:",e=>e.includeSharesInputCount?"1 1 70%":"1",";}.ant-spin-container{column-gap:16px;row-gap:8px;display:flex;align-items:flex-end;",(0,r.BK)({flexWrap:["wrap","wrap","nowrap","nowrap","nowrap"]}),"    > *{",(0,r.BK)({flexShrink:[0,0,1]}),"}}"),d=(0,a.A)(o.eI,{target:"e1m97aam4"})("margin-bottom:0 !important;.ant-col{position:unset;min-height:unset;}.ant-form-item-row{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;}.ant-form-item-label{& > label{font-style:normal;font-weight:400;font-size:14px;line-height:14px !important;height:14px;color:",e=>e.theme.colors.neutral800,";}& > label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before{color:",e=>e.theme.colors.neutral800," !important;}padding:0 !important;}.ant-form-item-control{width:100%;}"),u=(0,a.A)(d,{target:"e1m97aam5"})("flex-grow:1;min-width:240px;.ant-form-item-label{max-width:100%;overflow:hidden;}.ant-form-item-label > label{height:auto;line-height:20px !important;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;}"),m=(0,a.A)(d,{target:"e1m97aam6"})("min-width:140px;flex:1;"),p=(0,a.A)(d,{target:"e1m97aam7"})("flex:1;.ant-form-item-control{justify-content:center;align-items:center;}"),y=(0,a.A)(r.YI,{target:"e1m97aam8"})(),h=(0,a.A)(r.j9,{target:"e1m97aam9"})("[data-slot='base']{opacity:1 !important;}")},50908:(e,t,n)=>{n.d(t,{r:()=>r});var a=n(34857);let r=(e,t)=>{let{sector:n,...r}=t;return(0,a.iV)(e.investmentType)?{...e,additionalDetail:{...e.additionalDetail,...r,sectorOrBondType:n}}:{...e,additionalDetail:{...e.additionalDetail,...r,sector:n}}}},51164:(e,t,n)=>{n.d(t,{z:()=>i});var a=n(33624),r=n(81527),o=n(43608);let i=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=(0,o.y)(e),{isFetching:s,isLoading:c,isError:d,...u}=(0,r.I)(t,n,{...i,enabled:a.Q7R(Boolean,[!1!==i.enabled,!l.isFetching,!l.isError,l.isSuccess])}),m=s||l.isFetching,p=c||l.isLoading,y=d||l.isError;return{...u,isFetching:m,isLoading:p,isError:y}}},51436:(e,t,n)=>{n.d(t,{e:()=>u,u:()=>m});var a=n(88963),r=n(62031),o=n.n(r),i=n(13125),l=n.n(i);class s{constructor(){this.getEstatePlanningPreferences=async()=>{let e=await this.apiCaller.get("/estate_planning/get_estate_planning_preferences");return o()(e,{deep:!0})},this.upsertEstatePlanningPreference=async e=>{let t=await this.apiCaller.post("/estate_planning/upsert_estate_planning_preference",l()(e));return o()(t,{deep:!0})},this.apiCaller=new a.Ay}}let c=new s;var d=n(47178);let u=async()=>c.getEstatePlanningPreferences(),m=async e=>{let t="string"!=typeof e.response?(0,d.fD)(e):e;return c.upsertEstatePlanningPreference(t)}}
3,51604:(e,t,n)=>{n.d(t,{A:()=>f,$:()=>h});var a=n(57090),r=n(12115),o=n(99026),i=n(43948),l=n(74547),s=n(95825),c=n(73314),d=n(5285);let u=e=>{let{issueType:t,onClose:n,context:o}=e,[i,u]=r.useState(""),m=t===c.s.RECOMMENDATIONS_FEEDBACK,p=(0,d.A)(m?{successMessage:"Thanks for the feedback!"}:{}),y=i.trim(),h=p.isLoading,f=0===y.length,g=async()=>{await p.mutateAsync({issueType:t,description:y,context:o}),n()},v=r.useMemo(()=>t===c.s.RECOMMENDATIONS_FEEDBACK?"Give feedback":t===c.s.SECURITY_ISSUE&&o.ticker?"Report data issue with ".concat(o.ticker):"Report an issue",[o,t]);return(0,a.Y)(l.aF,{disableSubmitOnEnter:!0,title:v,open:!0,onCancel:n,closable:!h,maskClosable:!h,keyboard:!h,size:s.rI.Sm,onOk:g,okText:m?"Send feedback":"Submit issue",cancelText:"Cancel",centered:!0,okButtonProps:{disabled:h||f,loading:h},"data-sentry-element":"Modal","data-sentry-component":"IssueReportModal","data-sentry-source-file":"IssueReportModal.tsx",children:(0,a.Y)(l.fs,{label:m?"Your feedback":"What seems incorrect?",labelPlacement:"outside",onChange:u,placeholder:m?"Tell us what you think about your recommendations...":"Describe the data issue you're experiencing...",minRows:4,className:"w-full",isRequired:!0,"data-sentry-element":"TextArea","data-sentry-source-file":"IssueReportModal.tsx"})})};var m=n(50202);let{useGlobalDataIssueReportLaunchEventListener:p,emitGlobalDataIssueReportLaunchEvent:y}=(0,i.createEvent)("GlobalDataIssueReportLaunchEvent")(),h=()=>({launchIssueReport:async e=>{y({...e,onOpened:()=>{e.onOpened&&e.onOpened()}})}}),f=()=>{let{activePortfolioId:e}=(0,m.RW)(),[t,n]=r.useState(null),[i,l]=r.useState(c.s.DATA_ISSUE),s=r.useRef(o.lQ);return(p(t=>{let{afterClose:a=o.lQ,onOpened:r,ticker:i,issueType:c,context:d}=t;l(c),n({...i&&{ticker:i},url:window.location.href,portfolioId:e,...d}),null==r||r(),s.current=a}),t)?(0,a.Y)(u,{onClose:()=>{n(null),l(c.s.DATA_ISSUE),s.current(),s.current=o.lQ},context:t,issueType:i,"data-sentry-element":"DataIssueReportModal","data-sentry-component":"GlobalIssueReportLauncher","data-sentry-source-file":"GlobalIssueReportLauncher.tsx"}):null}},51852:(e,t,n)=>{n.d(t,{Ay:()=>u,bI:()=>d,e7:()=>s,ro:()=>c});var a=n(12115),r=n(33904),o=n(92672),i=n(54741);let l=()=>{let[e,{width:t}]=(0,r.W_)();return{ref:e,width:null!=t?t:0}},s=(e,t)=>{var n,a;let r=t[t.length-1];for(let a=o.xU.length-1;a>=0;a--)if(e>=o.xU[a])return null!=(n=t[a])?n:r;return null!=(a=t[0])?a:r},c=e=>{let{ref:t,width:n}=l();return{ref:t,compactMode:n>0&&n<e,width:n}},d=()=>{let[e,t]=a.useState(0);return a.useEffect(()=>{let e=document.getElementById(i.ce);if(null===e||"undefined"==typeof ResizeObserver){var n;t(null!=(n=null==e?void 0:e.clientWidth)?n:0);return}let a=new ResizeObserver(e=>t(e[0].contentRect.width));return a.observe(e),()=>a.disconnect()},[]),e},u=l},52568:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(88963),r=n(62031),o=n.n(r),i=n(13125),l=n.n(i);class s{get(e){return this.apiCaller.get("/cache/get",{key:e}).then(e=>o()(e,{deep:!0}))}set(e,t,n){return this.apiCaller.post("/cache/set",l()({key:e,value:t,ttl:n})).then(e=>o()(e))}getAllKeys(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.apiCaller.get("/cache/get_all",{include_expired:e}).then(e=>o()(e))}constructor(){this.apiCaller=new a.Ay}}let c=new s},52967:(e,t,n)=>{n.d(t,{F$:()=>y,Uu:()=>m,fu:()=>p,u4:()=>h});var a=n(12115),r=n(81527),o=n(55805),i=n(12866),l=n(7895),s=n(73070),c=n(84245),d=n(65782),u=n(91571);let m=e=>{let{modelingParams:t,scenarioParams:n,isPrecalculated:a}=e,r={...t,otherParams:n};return{queryKey:[...s.ub.SimulationResult,a?"Precalculated":"UserScenario",r],payload:r}};var p=function(e){return e.Active="active",e.Base="base",e}({});let y=(e,t,n,a,r)=>{let o=null===t,s=(0,i.a1)(t),c=null==t||s?void 0:t,{hasTimedOut:d,retrigger:u}=(0,l.gH)({queryKey:e,isWaitingForSocket:o,diagnosticLabel:r,initialPollMs:8e3});return{data:c,isFetching:n||o&&!d,isError:a||s||d,refetch:u}},h=(e,t)=>{var n;let{eventSource:i}=t,{scenarioId:l,isInWhatIfScenario:s}=(0,u.jF)(),{data:p}=(0,u.O7)(),h="base"===i?p:l,{data:f=[],isLoading:g}=(0,d.nM)(h),{queryKey:v,payload:x}=m({modelingParams:e,scenarioParams:f,isPrecalculated:null!=(n=t.isPrecalculatedScenario)&&n}),A=(0,r.I)({queryKey:v,queryFn:e=>(0,o.vX)(x,e.queryKey),enabled:void 0!==h&&!g&&("active"===i||s),...c.gz}
3),S=y(v,A.data,A.isFetching,A.isError,"scenario_simulation"),b=S.data,C=a.useRef(null);return a.useEffect(()=>{var e;b&&C.current!==b&&(C.current=b,null==(e=t.onSuccess)||e.call(t))},[b]),S}},53374:(e,t,n)=>{n.d(t,{A:()=>s,E:()=>l});var a=n(17667),r=n(75075),o=n(62212),i=n(84245);let l=async e=>{await e.invalidateQueries(i.yI),await e.invalidateQueries(i.Zw),await e.invalidateQueries(i.pu,{exact:!1})},s=()=>{let e=(0,o.j)();return(0,a.A)(()=>r.A.syncBalances({}),{onSuccess:async()=>{await l(e)},onSuccessMessage:()=>"Synced bank accounts"})}},53898:(e,t,n)=>{n.d(t,{Gj:()=>l,K$:()=>s,Y7:()=>u,eC:()=>d});var a=n(33624),r=n(24700),o=n.n(r),i=n(22977);let l=e=>o()(e).format("0.00a"),s=e=>{let t={...e.height?{height:e.height}:{},...e.events?{events:e.events}:{}};return a.Ime(t)?{}:{chart:t}},c=new WeakSet,d=e=>({...e,render:function(t){var n,a;null==e||null==(n=e.render)||n.call(this,t),a=this,"undefined"==typeof document||!document.fonts||c.has(a)||(c.add(a),document.fonts.ready.then(()=>{a.series&&(a.renderer.cache={},a.renderer.cacheKeys=[],a.axes.forEach(e=>{e.isDirty=!0}),a.isDirtyBox=!0,a.redraw())}))}}),u=e=>{var t;let n=a.vUk([],null===i.wR||void 0===i.wR||null==(t=i.wR.rangeSelector)?void 0:t.buttons);return e?a.kuo(e=>"ytd"===e.type,n):n}},54089:(e,t,n)=>{n.d(t,{A:()=>x});var a=n(57090),r=n(12115),o=n(33624),i=n(36934),l=n(92672),s=n(74547),c=n(71055),d=n(70432),u=n(54519),m=n(4338);let p=e=>{let t=r.useMemo(()=>(function(e){switch(e){case m.JP.PersonalizedRecommendations:return"Get personalized investing recommendations, tax optimization, fee visualization, and our AI Assistant.";case m.JP.FeeOptimization:return"Get tax-efficient sell recommendations to help you rebalance while taking out money.";case m.JP.PrivateEquityDetails:return"Add details to model distributions, fees, and liquidity/cash-flow analysis.";case m.JP.FeeVisualization:return"See all your fees, get personalized investing recommendations, tax optimization, and our AI Assistant.";case m.JP.Taxes:return"Get continuous tax optimization suggestions, investing advice, fee visualization, and our AI Assistant.";case m.JP.AiAssistant100:case m.JP.AiAssistant5:return"Get all your questions answered, get investing recommendations, tax optimization suggestions, and double-check your fees.";case m.JP.AiEquitySearch:return"Do deeper investing research with AI Equity Research & AI Assistant, and save money on the fees you pay.";case m.JP.OptimizationEmailAlerts:return(0,a.Y)("span",{children:"Don't miss portfolio improvement opportunities."});case m.JP.AdvancedOptimizationEmailAlerts:return(0,a.Y)("span",{children:"Don't miss advanced portfolio improvement opportunities."});case m.JP.LiquidityStressTest:return"Try your portfolio against liquidity stress test.";case m.JP.SharedAccess:return"Let others view or manage your PortfolioPilot account.";case m.JP.EmailDocumentImport:return"Use email to update information about your portfolio.";case m.JP.WhereToSellNext:return"Get tax-efficient sell recommendations to help you rebalance while taking out money."}})(e.name),[e.name]);return(0,a.FD)(r.Fragment,{children:[t,(0,a.Y)("br",{}),(0,a.Y)(d.A,{color:"accent",href:(0,u.YG)(),openInNewTab:!0,"data-sentry-element":"Link","data-sentry-source-file":"FeatureNotAccessibleModalSubTitle.tsx",children:"View subscription plans"})]})},y=e=>{let{defaultPlan:t,name:n}=e;return t.isTrialEligible?(0,a.FD)(r.Fragment,{children:["Unlock all ",t.name," features",(0,a.Y)("br",{}),"(cancel anytime)"]}):(0,a.FD)(r.Fragment,{children:["Unlock ",n]})};var h=n(55955),f=n(87764),g=n(65438),v=n(14845);let x=e=>{let{accessConfig:{name:t,description:n,minAccessSubscription:d},render:u}=e,{value:m,toggle:x}=(0,g.A)(!1),{activeSubscription:A,activePlan:S,isActivePlanFree:b,getPlanConfigFromMinimumSubscription:C,getTrialDays:I,isUserHasToFinishPayment:w}=(0,f.A)(),P=C(d),k=(0,h.qr)(),{buttonText:F}=(()=>{let e=I(P);return w?{buttonText:"Finish incomplete payment"}:!b&&(null==S?void 0:S.level)<P.level?{buttonText:"Switch to ".concat(P.name).concat(P.isTrialEligible?" trial":"")}
3:P.isTrialEligible?{buttonText:"Unlock with ".concat(e,"-day free trial")}:{buttonText:"Unlock premium features"}})(),T=async()=>{!w&&(null==A?void 0:A.hasPaymentMethods)||await k.mutateAsync(P.subscriptionPlan),w||x()},E=o.gD_(u)?(0,a.Y)(l.Ah,{children:(0,a.Y)(s.$n,{variant:"filled",onClick:T,children:F})}):u({onClick:T,children:(0,a.Y)(r.Fragment,{children:F}),loading:k.isLoading});return(0,a.FD)(r.Fragment,{children:[n?(0,a.Y)(i.lc,{className:"text-neutral-500",children:(0,a.Y)(l.Ah,{textAlign:"center",maxWidth:"600px",children:n})}):null,E,m?(0,a.Y)(c.A,{defaultPlan:P,onClose:x,description:(0,a.Y)(p,{name:t}),title:(0,a.Y)(y,{defaultPlan:P,name:t}),paymentSubscription:k.data,mode:v.S.FeatureAccess}):null]})}},54227:(e,t,n)=>{n.d(t,{HF:()=>u,V0:()=>p,oK:()=>m});var a=n(10833),r=n(17667),o=n(48298),i=n(84245),l=n(65694);let s=async()=>o.Ay.getPersonalizedRecommendationsIgnoredPreference(),c=async e=>o.Ay.upsertPersonalizedRecommendationsIgnoredTickers(e),d=[...i.I7,"IgnoredPreference"],u=()=>(0,a.I)(d,s),m=()=>{let e=(0,a.j)();return async()=>{await e.invalidateQueries(d)}},p=()=>{let e=m(),t=(0,l.Q5)();return(0,r.A)(c,{onSuccess:()=>{t(),e()}})}},54523:(e,t,n)=>{n.d(t,{A:()=>x});var a=n(57090),r=n(12115),o=n(33624),i=n(74547),l=n(35209),s=n(98868),c=n(58888),d=n(8921),u=n(92672),m=n(95825),p=n(46165),y=n(88669),h=n(35270),f=n(7191),g=n(81671),v=n(87813);let x=e=>{var t;let{portfolioGroup:n}=e,{investorRiskProfile:x}=(0,p.gm)(),A=(0,c.dz)(),[S,b]=r.useState(null!=(t=null==n?void 0:n.name)?t:""),[C,I]=r.useState(()=>n?n.targetRisk:o.vUk(s.R$.ModeratelyAggressive,x)),w=!!n,P=async()=>{await A.mutateAsync({id:null==n?void 0:n.id,name:S,targetRisk:C},{onSuccess:t=>{(0,d.Ds)(d._n.Success,w?"Group properties updated":"Successfully created group"),e.onSuccess(t)}})};return(0,a.Y)(i.aF,{open:!0,title:w?"Group Properties":"Create Group",onCancel:e.onCancel,size:m.rI.Xs,footer:(0,a.FD)(m.jl,{children:[(0,a.Y)(i.$n,{onClick:e.onCancel,children:"Cancel"}),(0,a.Y)(i.$n,{onClick:P,variant:"filled",disabled:!S,children:"Save"})]}),"data-sentry-element":"Modal","data-sentry-component":"UpsertGroup","data-sentry-source-file":"UpsertGroup.tsx",children:(0,a.FD)(u.Ah,{display:"block",itemsSpacingVertical:16,marginTop:4,"data-sentry-element":"FlexLayout","data-sentry-source-file":"UpsertGroup.tsx",children:[(0,a.FD)("div",{children:[(0,a.Y)("div",{children:"Name"}),(0,a.Y)(l.A,{value:S,onChange:b,required:!0,maxLength:255,"data-sentry-element":"Input","data-sentry-source-file":"UpsertGroup.tsx"})]}),(0,a.FD)("div",{children:[(0,a.Y)("div",{children:"Risk preference"}),(0,a.Y)(y.I,{value:C,onChange:I,"data-sentry-element":"RiskProfileSelector","data-sentry-source-file":"UpsertGroup.tsx"})]}),n?(0,a.FD)(i.N_,{onClick:()=>{e.onCancel(),(0,h.je)(f.nM.RecommendationContext,{openRecommendationContext:!0,groupId:null==n?void 0:n.id})},children:[n.recommendationContext?v.ZO:v.DP,(0,a.Y)(i.In,{icon:g.$.ArrowRight,size:16,className:"ml-1 inline-block align-middle"})]}):null]})})}},54674:(e,t,n)=>{n.d(t,{Lb:()=>o,lf:()=>r,v0:()=>a});var a=function(e){return e.Create="Create",e.Edit="Edit",e}({});let r=Object.freeze({investment:"investment",currentPrice:"currentPrice",ticker:"ticker",amount:"amount",proxyTicker:"proxyTicker",expectedReturn:"expectedReturn",expectedRisk:"expectedRisk",dividendYield:"dividendYield",assetClass:"assetClass",country:"country",sector:"sector",useProxyTickerSelected:"useProxyTickerSelected"}),o=[r.expectedReturn,r.expectedRisk,r.dividendYield,r.assetClass,r.country,r.sector,r.proxyTicker,r.investment]},54958:(e,t,n)=>{n.d(t,{JA:()=>r,k0:()=>o,yc:()=>a});let a="aiAssistant",r="EstatePlanning",o="search"},55074:(e,t,n)=>{n.d(t,{A:()=>ex});var a=n(57090),r=n(12115),o=n(33624),i=n(99750),l=n(62570),s=n(12919),c=n(8830),d=n(7257),u=n(47489),m=n(40248),p=n(36934),y=n(41784),h=n(88179),f=n(74547),g=n(78046);let v=(0,l.A)(f.Ah,{target:"e1nk26n00"})("&,& > *{width:100%;}"),x=(0,l.A)("div",{target:"e1nk26n01"})("font-style:normal;font-weight:600;font-size:16px;line-height:24px;color:",e=>e.theme.colors.black,";width:100%;"),A="feedback",S=e=>{let[t,n]=r.useState(!1),[i]=(0,g.mN)(),l=(0,g.r3)(A,i),s=async t=>{try{n(!0),await e.onFeedbackSubmit(t),i.resetFields()}catch(e){}finally{n(!1)}};return(0,a.FD)(v,{flexDirection:"column",itemsSpacingVertical:4,alignItems:"flex-start","data-sentry-element":"ParsingFeedbackSection","data-sentry-component":"ParsingFeedback","data-sentry-source-file":"ParsingFeedback.tsx",children:[(0,a.Y)(x,{"data-sentry-element":"ParsingFeedbackTitle","data-sentry-source-file":"ParsingFeedback.tsx",children:"Parsing Feedback"}),(0,a.Y)(p.km,{className:(0,y.cn)("text-neutral-500"),"data-sentry-element":"Body2W400","data-sentry-source-file":"ParsingFeedback.tsx",children:"You can give instructions to AI to parse data differently"}),(0,a.FD)(h.q,{form:i,name:"parsingFeedback",layout:"vertical",onFinish:s,"data-sentry-element":"StyledForm","data-sentry-source-file":"ParsingFeedback.tsx",children:[(0,a.Y)(h.JF,{name:A,rules:[{required:!0,whitespace:!0}],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"ParsingFeedback.tsx",children:(0,a.Y)(f.fs,{placeholder:"Example: current amount is in the market value column and everything is in Canadian dollars",minRows:3,disabled:t,"data-sentry-element":"TextArea","data-sentry-source-file":"ParsingFeedback.tsx"})}),(0,a.Y)(h.JF,{"data-sentry-element":"StyledFormItem","data-sentry-source-file":"ParsingFeedback.tsx",children:(0,a.Y)(f.$n,{variant:"filled",htmlType:"submit",fullWidth:!0,loading:t,disabled:o.Ime(o.Bqr(o.vUk("",l))),"data-sentry-element":"Button","data-sentry-source-file":"ParsingFeedback.tsx",children:"Rerun using provided feedback"})})]})]})};var b=n(34645),C=n(8921),I=n(17667),w=n(32189),P=n(4603),k=n(90521),F=n(44134),T=n(68076),E=n(97691),Y=n(92672),D=n(4122),R=n(15751),N=n(10090),M=n(7802),L=n(49586),_=n(26189),O=n(17123),W=n(985),B=n(40262),U=n(99147),z=n(27234),V=n(17143),j=n(79279);let H=e=>{let{portfolioInvestmentItem:t}=e,{proxyMappedTickers:n}=(0,j.I)();return(0,a.Y)(z.i,{compactMode:!0,investmentItem:t,forceProxiedSecurityMode:(0,V.AT)(t.ticker,n),"data-sentry-element":"ProxyContextualSecurityLabel","data-sentry-component":"SharesAmountTableSecurityColumn","data-sentry-source-file":"SharesAmountTableSecurityColumn.tsx"})};var q=n(544),G=n(99026),K=n(38249),Q=n(35208),$=n(6558);let X=e=>{let{portfolioInvestmentItem:t}=e,{handleInvestmentSharesUpdate:n}=(0,j.I)();if((0,q.t)(t))return null;if(o.gD_(t.currentPrice))return(0,a.Y)(Y.Ah,{children:Q.UZ});let{quantity:r,currentPrice:i}=t,l=(0,$.ph)(i);return(0,a.Y)(W.Ib,{"data-sentry-element":"SharesAmountTableColumnContainer","data-sentry-component":"SharesAmountTableSharesColumn","data-sentry-source-file":"SharesAmountTableSharesColumn.tsx",children:(0,a.Y)(K.A,{value:r,fractionDigits:l,onChange:e=>{let a=(0,G.YZ)(e);n(t.ticker,a)},placeholder:"shares",humanizeNumber:!0,"data-sentry-element":"InputNumber","data-sentry-source-file":"SharesAmountTableSharesColumn.tsx"})})};var J=n(11325),Z=n(13340);let ee=e=>{let{portfolioInvestmentItem:t}=e;return(0,q.t)(t)?null:o.gD_(t.currentPrice)?(0,a.Y)(Y.Ah,{children:Q.UZ}):(0,a.Y)(W.Ib,{"data-sentry-element":"SharesAmountTableColumnContainer","data-sentry-component":"SharesAmountTablePriceColumn","data-sentry-source-file":"SharesAmountTablePriceColumn.tsx",children:(0,a.Y)(Y.Ah,{width:"100%",height:"40px","data-sentry-element":"FlexLayout","data-sentry-source-file":"SharesAmountTablePriceColumn.tsx",children:(0,a.Y)(J.eF,{amount:t.currentPrice,sourceCurrency:Z.mF,"data-sentry-element":"CurrencyAmount","data-sentry-source-file":"SharesAmountTablePriceColumn.tsx"})})})};var et=n(48779);let en=e=>{let{portfolioInvestmentItem:t}=e,{amount:n}=t,{handleInvestmentItemAmountUpdate:r}=(0,j.I)();return(0,a.Y)(W.Ib,{"data-sentry-element":"SharesAmountTableColumnContainer","data-sentry-component":"SharesAmountTableMarketValueColumn","data-sentry-source-file":"SharesAmountTableMarketValueColumn.tsx",children:(0,a.Y)(U.c8,{value:n,min:(0,q.t)(t)?void 0:et.Jo,onChange:e=>{let n=Number(e),a=Number.isNaN(n)?0:n;r(t.ticker,a)},"data-sentry-element":"StyledAmountInput","data-sentry-source-file":"SharesAmountTableMarketValueColumn.tsx"})})};var ea=n(31272);let er=e=>(0,a.Y)("div",{style:{textAlign:"center"},"data-sentry-component":"SharesAmountTableWeightColumn","data-sentry-source-file":"SharesAmountTableWeightColumn.tsx",children:(0,ea.ZN)(e.portfolioInvestmentItem.weight,{formatToPercent:!0})});var eo=n(81671);let ei=e=>{let{portfolioInvestmentItem:t}=e,{handleRemoveInvestment:n}=(0,j.I)();return(0,q.t)(t)?null:(0,a.FD)(U.YT,{onClick:()=>n(t.ticker),isIconOnly:!0,variant:"ghost",color:"danger","data-sentry-element":"RemoveInvestmentButton","data-sentry-component":"ShareAmountTableRemoveColumn","data-sentry-source-file":"ShareAmountTableRemoveColumn.tsx",children:[(0,a.Y)(f.In,{icon:eo.$.TrashCan,size:16,"data-sentry-element":"Icon","data-sentry-source-file":"ShareAmountTableRemoveColumn.tsx"}),(0,a.Y)("span",{className:"sr-only",children:"Remove holding"})]})},el=e=>{let{portfolioInvestmentItem:t}=e,{handleCustomizeInvestmentItem:n}=(0,j.I)();return(0,q.t)(t)?null:(0,a.Y)(U.du,{onClick:()=>n(t),"data-sentry-element":"CustomizeInvestmentButton","data-sentry-component":"SharesAmountTableCustomizeInvestmentColumn","data-sentry-source-file":"SharesAmountTableCustomizeInvestmentColumn.tsx"})},es=[{title:(0,a.Y)(U.W$,{children:"Securities"}),dataIndex:"ticker",key:"ticker",render:(e,t)=>(0,a.Y)(W.Ib,{display:"block",children:(0,a.Y)(H,{portfolioInvestmentItem:t})}),fixed:"left"},{title:(0,a.Y)(U.W$,{children:"Quantity"}),dataIndex:"quantity",key:"shares",render:(e,t)=>(0,a.Y)(X,{portfolioInvestmentItem:t}),align:"center",width:120},{title:(0,a.FD)(U.W$,{children:["Price"," ",(0,a.Y)(W.sq,{title:"The price of the security is based on the closing price of the last trading day",style:{height:14,width:14}})]}),dataIndex:"currentPrice",key:"currentPrice",render:(e,t)=>(0,a.Y)(ee,{portfolioInvestmentItem:t}),align:"center",width:120},{title:(0,a.Y)(U.W$,{children:"Market value"}
3),dataIndex:"amount",key:"amount",align:"center",render:(e,t)=>(0,a.Y)(en,{portfolioInvestmentItem:t})},{title:(0,a.Y)(U.W$,{children:"Weight"}),dataIndex:"weight",key:"weight",render:(e,t)=>(0,a.Y)(er,{portfolioInvestmentItem:t}),width:88,align:"center"},{title:null,align:"center",dataIndex:"customizeInvestment",key:"customizeInvestment",render:(e,t)=>(0,a.Y)(el,{portfolioInvestmentItem:t}),width:48},{title:null,align:"center",dataIndex:"remove",key:"remove",render:(e,t)=>(0,a.Y)(ei,{portfolioInvestmentItem:t}),width:48}];var ec=n(13641);let ed=e=>{let t=(0,B.SI)(e.portfolioInvestmentItem);return(0,a.Y)(W.Q7,{"data-sentry-element":"SecurityRowContainer","data-sentry-component":"SharesAmountCard","data-sentry-source-file":"SharesAmountCard.tsx",children:(0,a.FD)(Y.Ah,{flexDirection:"column",alignItems:"stretch",width:"100%",itemsSpacingVertical:10,flexWrap:"nowrap","data-sentry-element":"FlexLayout","data-sentry-source-file":"SharesAmountCard.tsx",children:[(0,a.FD)(Y.Ah,{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",width:"100%",itemsSpacingHorizontal:8,"data-sentry-element":"FlexLayout","data-sentry-source-file":"SharesAmountCard.tsx",children:[(0,a.Y)(H,{portfolioInvestmentItem:e.portfolioInvestmentItem,"data-sentry-element":"SharesAmountTableSecurityColumn","data-sentry-source-file":"SharesAmountCard.tsx"}),t.showSecurityActions?(0,a.FD)(Y.Ah,{flexDirection:"row",alignItems:"center",itemsSpacingHorizontal:4,flexWrap:"nowrap",children:[(0,a.Y)(el,{portfolioInvestmentItem:e.portfolioInvestmentItem}),(0,a.Y)(ei,{portfolioInvestmentItem:e.portfolioInvestmentItem})]}):null]}),t.showQuantity?(0,a.Y)(W.lp,{label:"Quantity",children:(0,a.Y)(X,{portfolioInvestmentItem:e.portfolioInvestmentItem})}):null,t.showPrice?(0,a.Y)(W.lp,{label:"Price",children:(0,a.Y)(ee,{portfolioInvestmentItem:e.portfolioInvestmentItem})}):null,t.showMarketValue?(0,a.Y)(W.lp,{label:"Market value",children:(0,a.Y)(en,{portfolioInvestmentItem:e.portfolioInvestmentItem})}):null,t.showWeight?(0,a.Y)(W.lp,{label:"Weight",children:(0,a.Y)(er,{portfolioInvestmentItem:e.portfolioInvestmentItem})}):null]})})},eu=e=>{let t=!!e.disabled||!!e.loading;return(0,a.Y)("div",{className:(0,y.cn)("w-full",t&&"pointer-events-none opacity-60"),"aria-disabled":t,"data-sentry-component":"SharesAmountCardList","data-sentry-source-file":"SharesAmountCardList.tsx",children:(0,a.FD)(Y.Ah,{flexDirection:"column",alignItems:"stretch",width:"100%",itemsSpacingVertical:12,flexWrap:"nowrap","data-sentry-element":"FlexLayout","data-sentry-source-file":"SharesAmountCardList.tsx",children:[e.portfolioInvestmentItems.map(e=>(0,a.Y)(ed,{portfolioInvestmentItem:e},e.ticker)),e.footer]})})};var em=n(49332);let ep=e=>{let{footer:t,portfolioInvestmentItems:n}=e,o=(0,B.pI)({investmentItems:n,includeCash:!0,sortInvestments:!1}),{freezeTable:i,isPortfolioItemsLoading:l,securityManagementWorkflowVisible:s,securityManagementWorkflowParams:c,exitSecurityManagementWorkflow:d,handleProxyWorkflowInvestmentSubmit:u,handleProxyMappingUpserted:m,handleProxyMappingReset:h}=(0,j.I)(),{isCompactView:f}=(0,em.b)();return(0,a.FD)(r.Fragment,{children:[(0,a.Y)(p.lc,{className:(0,y.cn)("text-body"),"data-sentry-element":"Body1W600","data-sentry-source-file":"SharesAmountTable.tsx",children:"Securities"}),f?(0,a.Y)(eu,{portfolioInvestmentItems:o,footer:t,loading:l,disabled:i}):(0,a.Y)("div",{className:"overflow-x-auto",children:(0,a.Y)(W.XT,{removeWrapper:!0,isHeaderSticky:!0,isStriped:!1,loading:l,isCompact:!0,dataSource:o,rowKey:e=>e.ticker,pagination:!1,columns:es,bottomContent:t,rowClickable:!0,disabled:i})}),s&&c?(0,a.Y)(ec.N,{...c,onInvestmentDetailsSubmitted:u,onProxyMappingUpserted:m,onProxyMappingRemoved:h,onClose:d}):null]})};var ey=n(74278),eh=n(88105),ef=n(67759),eg=n(18281);let ev=(0,l.A)(s._s,{target:"ebwkbq50"})(".ant-drawer-body{overflow-x:hidden;}"),ex=e=>{var t;let n=r.useMemo(()=>(0,d.jP)(e.portfolioInvestmentItems),[e.portfolioInvestmentItems]),[l,p]=r.useState(n),{form:y}=(0,O.mu)(),{launchUnsavedChangesModal:h}=(0,eh.y)(),f=r.useRef(n),v=r.useRef((0,O.nk)({type:L.l.NewPortfolio})),x=r.useCallback(()=>({...(0,O.nk)({type:L.l.NewPortfolio}),...y.getFieldsValue(!0)}),[y]),{getSuppressedWarningMetadata:A,incompletePortfolioWarningSnapshot:W,launchWarning:B,closeWarning:U}=(0,N.B)(),z=(0,b.I6)(),V=(()=>{let e=(0,k.dR)(),t=(0,k.eY)(),n=(0,F.O)(),a=w.N$.Current;return(0,I.A)(async r=>{let{portfolioAccountDetails:o,investmentsPayload:i}=r,{createdPortfolioId:l}=await e.mutateAsync({...o,portfolioType:a,source:w.g6.Manual,portfolioDescription:"Portfolio created with manual CSV upload",creationScenario:P.PortfolioCreationScenario.Manual});return o.trackingTicker&&await t.mutateAsync({portfolioId:l,portfolioName:o.portfolioName,portfolioDescription:"Portfolio created with manual CSV upload",advisorFee:o.advisorFee,trackingTicker:o.trackingTicker}),n.mutateAsync({investmentsPayload:i,portfolioId:l,portfolioType:a})},{onErrorMessage:e=>e})})(),H=(0,i.tb)(["100vw","95vw","95vw","960px"]),{workflowVisible:q,workflowParams:G,launchSecurityInvestmentAndProxySetupWorkflow:K,exitWorkflow:Q}=(0,D.q)(),{proxyMappedTickers:$,addProxyMappedTicker:X,removeProxyMappedTicker:J,addSelectedSecuritySuggestion:Z,getSeriesNameResetInvestmentItem:ee}=(0,R.H)({investmentItems:l,initialProxyMappedTickers:[]}),et=r.useRef(0),en=z.isLoading,ea=V.isLoading,er=o.Ime(l);r.useEffect(()=>{p(n),f.current=n,v.current=x()},[x,n]);let eo=r.useCallback(()=>{let e=x(),t=!o.aIS(f.current,l),n=!o.aIS(v.current,e);return t||n},[x,l]),ei=e=>{p((0,d.jP)(e))},el=async(e,t)=>{ei((0,d.Ck)(l,e,t))},es=async e=>{await K(e)},ec=async t=>{let n=c.X.CopyPaste,a=t.feedback,r=e.uploadedData;await z.mutateAsync({source:n,data:r,parsingFeedback:a},{onSuccess:e=>{ei(e),(0,C.Ds)(C._n.Success,"Portfolio re-parsed with given feedback")},onError:()=>{(0,C.Ds)(C._n.Error,"Portfolio parsing failed",{description:"AI processing could not parse the portfolio with the provided feedback."})}})},ed=t=>{let{setupFinalOutcome:n}=t;e.onPortfolioSaveComplete({setupFinalOutcome:n,portfolioId:et.current})},eu=()=>{U(),ed({setupFinalOutcome:M.in.ImportFlaggingIgnored})},em=async t=>{let n=e.statementId;void 0!==n&&(0,ef.trackStatementsImport)({dataDomain:eg.SN.Brokerage,event:P.StatementsImportEvent.DataSavingInitiated,statementId:n}),await V.mutateAsync({portfolioAccountDetails:t,investmentsPayload:l},{onSuccess:async e=>{et.current=e.uploadedPortfolioId,(0,ef.trackManualPortfolioCreated)({event:P.ManualPortfolioEvent.InvestmentsUploaded}),void 0!==n&&(0,ef.trackStatementsImport)({dataDomain:eg.SN.Brokerage,event:P.StatementsImportEvent.DataSavingSucceeded,statementId:n,portfolioCount:1}),(0,C.Ds)(C._n.Success,"Portfolio uploaded successfully");try{let e=await A();e&&e.isIncomplete?B(e.metadata):ed({setupFinalOutcome:M.in.UnflaggedCompleteImport})}catch(e){console.error("Portfolio summary fetch failed during AI portfolio upload",e),ed({setupFinalOutcome:M.in.UnflaggedCompleteImport})}},onError:e=>{(0,ef.trackManualPortfolioCreated)({event:P.ManualPortfolioEvent.InvestmentsUploadFailed,errorType:e instanceof Error?e.message:String(e)}),void 0!==n&&(0,ef.trackStatementsImport)({dataDomain:eg.SN.Brokerage,event:P.StatementsImportEvent.DataSavingFailed,statementId:n,errorMessage:e instanceof Error?e.message:String(e)})}})},ex=async()=>{try{await y.validateFields()}catch(e){(0,g.$w)(y);return}let e=(0,O.ru)(y);await em(e)},eA=e=>{X(e)},eS=async(e,t,n)=>{n.isSecurityProxied&&eA(e.ticker),await el(e,t)};return(0,a.FD)(r.Fragment,{children:[(0,a.Y)(ev,{width:H,title:(0,a.Y)(r.Fragment,{children:"Easy portfolio upload (Parsed data)"}),open:!0,destroyOnClose:!0,closable:!1,maskClosable:!1,keyboard:!1,footer:(0,a.FD)(s.tb,{children:[(0,a.Y)(m.A,{onClick:()=>
3{if(eo())return void h({onDiscard:e.onCancel,onSave:ex});e.onCancel()},disabled:en||ea,children:"Cancel"}),(0,a.Y)(m.A,{variant:"filled",onClick:ex,disabled:en||er,children:"Save Portfolio"})]}),"data-sentry-element":"StyledPortfolioEditor","data-sentry-source-file":"ParsedPortfolioEditor.tsx",children:(0,a.FD)(Y.Ah,{flexDirection:"column",flexWrap:"nowrap",justifyContent:"flex-start",alignItems:"stretch",itemsSpacingVertical:16,occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"ParsedPortfolioEditor.tsx",children:[(0,a.FD)("div",{children:[(0,a.Y)(_.W,{form:y,accountDetailsConfig:{type:L.l.NewPortfolio},"data-sentry-element":"ManualPortfolioInputPropertiesForm","data-sentry-source-file":"ParsedPortfolioEditor.tsx"}),(0,a.Y)(j.R.Provider,{value:{shareAmountTableFor:ey.n.ManualPortfolioAdd,proxyMappedTickers:$,securityManagementWorkflowVisible:q,securityManagementWorkflowParams:G,isPortfolioItemsLoading:en,freezeTable:en||ea,handleInvestmentItemAmountUpdate:(e,t)=>{ei((0,d.Tj)(l,e,t))},handleInvestmentSharesUpdate:(e,t)=>{ei((0,d.Fi)(l,e,t))},handleRemoveInvestment:e=>{ei((0,d.Rj)(l,e))},handleCustomizeInvestmentItem:es,handleProxyWorkflowInvestmentSubmit:eS,handleProxyMappingReset:e=>{J(e);let t=ee(e);t&&el(t)},handleProxyMappingUpserted:eA,exitSecurityManagementWorkflow:Q},"data-sentry-element":"unknown","data-sentry-source-file":"ParsedPortfolioEditor.tsx",children:(0,a.Y)(ep,{portfolioInvestmentItems:l,footer:(0,a.Y)(u.A,{existingInvestmentItems:l,onSuggestedSecuritySelected:e=>{Z(e)},onProxyWorkflowInvestmentSubmit:eS,onSubmit:el,disableForm:en||ea,includeSharesInputCount:!0}),"data-sentry-element":"SharesAmountTable","data-sentry-source-file":"ParsedPortfolioEditor.tsx"})})]}),(0,a.Y)(m.A,{onClick:e.onInitiateNewUpload,fullWidth:!0,disabled:en||ea,"data-sentry-element":"Button","data-sentry-source-file":"ParsedPortfolioEditor.tsx",children:null!=(t=e.initiateNewUploadLabel)?t:"Forget and parse another dataset"}),e.initiateNewUploadExtra?(0,a.Y)(Y.Ah,{justifyContent:"center",occupyParentWidth:!0,children:(0,a.Y)("div",{children:e.initiateNewUploadExtra})}):null,e.hideParsingFeedback?null:(0,a.Y)(S,{onFeedbackSubmit:ec})]})}),W.showWarning?(0,a.Y)(E.L,{warningData:{metadata:W.metadata,type:T.h.CSVUpload},open:W.showWarning,onIgnore:eu,onAddAnotherAccount:eu,onKeepDemoPortfolio:()=>{U(),ed({setupFinalOutcome:M.in.FlaggedImportWithDemoAcceptance})}}):null]})}},55312:(e,t,n)=>{n.d(t,{$:()=>a});var a=function(e){return e.Ignore="ignore",e}({})},55602:(e,t,n)=>{n.d(t,{t:()=>P,M:()=>k});var a=n(57090);n(12115);var r=n(33624),o=n(92672),i=n(95825),l=n(40248),s=n(41784);let c=e=>{let{label:t,description:n,icon:r,className:i,...c}=e,d=(null==c?void 0:c.variant)==="filled",u=(null==c?void 0:c.variant)==="outlined";return n?(0,a.Y)(l.A,{...c,className:(0,s.cn)("!h-auto px-2 py-3",u&&"bg-blue-100 border-none",i),"data-sentry-element":"Button","data-sentry-component":"InfoIconButton","data-sentry-source-file":"InfoIconButton.tsx",children:(0,a.FD)(o.Ah,{flexDirection:"column",alignItems:"flex-start",itemsSpacingVertical:2,occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"InfoIconButton.tsx",children:[(0,a.FD)(o.Ah,{flexDirection:"row",justifyContent:"center",itemsSpacingHorizontal:8,occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"InfoIconButton.tsx",children:[r,(0,a.Y)("span",{className:(0,s.cn)("text-base font-medium leading-5",d?"text-white":"text-primary"),children:t})]}),(0,a.Y)("div",{className:(0,s.cn)("text-xs font-normal leading-4 opacity-50 w-full whitespace-break-spaces",d?"text-white":"text-primary"),children:n})]})}):(0,a.Y)(l.A,{...c,prefix:r,className:i,children:t})};var d=n(36934);let u=(0,n(62570).A)(i.Ay,{target:"e1j7mogk0"})(".ant-modal-header{margin-right:0px;}");var m=n(84455);let p=()=>(0,a.Y)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none","data-sentry-element":"svg","data-sentry-component":"WorkIcon","data-sentry-source-file":"PortfolioManagementIcons.tsx",children:(0,a.Y)("path",{d:"M18.3333 4.95829H14.6666V3.12496C14.6666 2.10746 13.8508 1.29163 12.8333 1.29163H9.16658C8.14908 1.29163 7.33325 2.10746 7.33325 3.12496V4.95829H3.66659C2.64909 4.95829 1.84242 5.77413 1.84242 6.79163L1.83325 16.875C1.83325 17.8925 2.64909 18.7083 3.66659 18.7083H18.3333C19.3508 18.7083 20.1666 17.8925 20.1666 16.875V6.79163C20.1666 5.77413 19.3508 4.95829 18.3333 4.95829ZM12.8333 4.95829H9.16658V3.12496H12.8333V4.95829Z",fill:"white","data-sentry-element":"path","data-sentry-source-file":"PortfolioManagementIcons.tsx"})}),y=()=>(0,a.Y)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","data-sentry-element":"svg","data-sentry-component":"FolderIcon","data-sentry-source-file":"PortfolioManagementIcons.tsx",children:(0,a.Y)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 5.6H16.9C17.78 5.6 18.5 6.32 18.5 7.2V15.2C18.5 16.08 17.78 16.8 16.9 16.8H4.1C3.22 16.8 2.5 16.08 2.5 15.2L2.508 5.6C2.508 4.72 3.22 4 4.1 4H8.9L10.5 5.6ZM4.1 7.2V15.2H16.9V7.2H4.1ZM5.5 18.1L5.5 18.0999H7.1V18.1H19.9V10.1H19.8999V8.50002H19.9C20.78 8.50002 21.5 9.22002 21.5 10.1V18.1C21.5 18.98 20.78 19.7 19.9 19.7H7.1C6.22 19.7 5.5 18.98 5.5 18.1Z",fill:"white","data-sentry-element":"path","data-sentry-source-file":"PortfolioManagementIcons.tsx"})}),h=e=>
3(0,a.Y)(u,{disableSubmitOnEnter:!0,title:"Choose management approach",centered:!0,open:!0,destroyOnClose:!1,maskClosable:!1,keyboard:!1,closable:!1,size:i.rI.Sm,footer:null,"data-sentry-element":"StyledPromptModal","data-sentry-component":"PromptModal","data-sentry-source-file":"PromptModal.tsx",children:(0,a.FD)(o.Ah,{flexDirection:"column",alignItems:"flex-start",alignSelf:"stretch",itemsSpacingVertical:16,occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"PromptModal.tsx",children:[(0,a.Y)(d.bU,{className:"text-body","data-sentry-element":"Body1W400","data-sentry-source-file":"PromptModal.tsx",children:"You’ve connected multiple accounts. Do you want to manage them separately or as a single Net Worth Portfolio?"}),(0,a.Y)(c,{variant:"filled",onClick:()=>e.onManagementApproachSelect(m.SO.AggregatedPortfolio),fullWidth:!0,label:"I’ll use Net Worth Portfolio",description:"One view and one set of recommendations for everything you own",icon:(0,a.Y)(p,{}),"data-sentry-element":"InfoIconButton","data-sentry-source-file":"PromptModal.tsx"}),(0,a.Y)(c,{variant:"filled",onClick:()=>e.onManagementApproachSelect(m.SO.AssetGroups),fullWidth:!0,label:"I’ll create asset groups",description:"Independent groups with their own goals and preferences",icon:(0,a.Y)(y,{}),"data-sentry-element":"InfoIconButton","data-sentry-source-file":"PromptModal.tsx"}),(0,a.Y)(d.st,{style:{textAlign:"center"},"data-sentry-element":"HelperMessage","data-sentry-source-file":"PromptModal.tsx",children:"You can always change this in Settings"})]})});var f=n(50202),g=n(2899),v=n(83910),x=n(6976),A=n(46165),S=n(92487),b=n(43948),C=n(41686);let{usePortfolioManagementPromptLaunchEventListener:I,emitPortfolioManagementPromptLaunchEvent:w}=(0,b.createEvent)("PortfolioManagementPromptLaunchEvent")(),P=()=>{let e=(0,x.nP)(),{data:t}=(0,A.Kv)(),{isPromptRequired:n,isDefaultManagementPreference:o,popupVisible:i,openPopup:l,closePopup:s}=(()=>{let{userProvidedCurrentPortfolios:e}=(0,f.RW)(),{isDefaultManagementPreference:t}=(0,S.y)(),{popupVisible:n,isPopShownToUser:a,openPopup:o,closePopup:i}=(0,g.Z5)(v.Hh.PortfolioManagementPromptShown),l=r.Bw9(e)>1;return{isPromptRequired:!a&&l&&t,isDefaultManagementPreference:t,popupVisible:n,openPopup:o,closePopup:i}})();I(e=>{let{forceOpen:t}=e;o&&(n||t)&&l()});let c=async n=>{let a=null==t?void 0:t.response;(null!=a?a:m.SO.AggregatedPortfolio)!==n&&await e.mutateAsync([{questionId:m.od.PortfolioManagementApproach,response:n}]),s()};return i?(0,a.Y)(h,{onManagementApproachSelect:c}):null},k=()=>{let e=e=>{w({forceOpen:e})};return{launchPortfolioManagementPrompt:e,launchDeferredPortfolioManagementPrompt:t=>{(0,C.E0)(()=>e(t))}}}},55605:(e,t,n)=>{n.d(t,{LI:()=>R,uF:()=>_,pY:()=>N,xp:()=>Y,do:()=>M});var a=n(33624),r=n(83439),o=n(99801),i=n(42463),l=n(92283),s=n(67030),c=n(43847),d=n(31624),u=n(73590),m=n.n(u),p=n(53898),y=n(66866),h=n(71754),f=n(36214);let g=e=>Number.isFinite(e[0])&&Number.isFinite(e[1])?{x:e[0],y:e[1]}:null,v={up:h.f1.up,down:h.f1.down,flat:h.f1.flat};var x=n(32204),A=n(7426),S=n(67390),b=n(70810),C=n(22977);let I={history:"trend-history",forecast:"trend-forecast",cone:"trend-cone"},w={history:"highlight-history",window:"highlight-window"},P="forecast-divider",k={day:"days",month:"months",year:"years"},F=(e,t,n,o)=>{let i=e[n];return r.A(i)?a.yU6(t,i.map(e=>(0,x.IQ)((0,c.Cs)(e,o)))):[]},T=function(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:d.z.Legacy,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;return a.TjK(s=>{if(null!==l&&s===l.series.windowSeriesName){let n=F(e,t,s,r);return{...(0,A.P6)({id:w.window,name:s,data:n,color:v[(e=>{let t=a.Uln(e=>e.x,e.points.map(g).filter(t=>{let n;return null!==t&&(n=t.x,(!Number.isFinite(e.windowMin)||n>=e.windowMin)&&(!Number.isFinite(e.windowMax)||n<=e.windowMax))}));if(t.length<2)return"flat";let n=t[0].y,r=t[t.length-1].y;return 0===n||Math.abs(r-n)/Math.abs(n)<5e-4?"flat":r>n?"up":"down"})({points:n,windowMin:l.window.start,windowMax:l.window.end})]}),showInLegend:!!o}}if(null!==l&&s===l.series.historySeriesName)return{...(0,A.P6)({id:w.history,name:s,data:F(e,t,s,r),color:h.uB.value}),showInLegend:!!o};if(i===d.z.Trend&&s===y.T.History)return(0,A.P6)({id:I.history,name:s,data:F(e,t,s,r),color:h.f1.history});if(i===d.z.Trend&&s===y.T.Forecast)return(0,A.y6)({id:I.forecast,name:s,data:F(e,t,s,r)});let u=a._w2(s,e),m=a.TjK(e=>(0,c.Cs)(e,r),u);return{name:s,data:a.yU6(t,m),zIndex:4,showInLegend:!!o,...(0,c.Vz)(s,n)}},n)},E=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.z.Legacy;return a.gD_(t)?[]:r===d.z.Trend?[(0,A.Ui)({id:I.cone,name:y.T.Range,data:(0,c.Wx)(e,t,n
3)})]:[{name:y.T.Range,showInLegend:!1,type:"arearange",data:(0,c.Wx)(e,t,n),color:h.pS.range,zIndex:0,marker:{enabled:!1}}]},Y=(e,t)=>o.A((e,n)=>"all"===e.type?e:a.jp7(e,{events:{click:function(){return t(this,n),!1}}}),e),D=e=>t=>(0,c.Yj)({format:e.yFormat,text:e.yFormat===s.De.Currency?t:(0,p.Gj)(t),hideDecimals:!1,preferredCurrency:e.preferredCurrency}),R=e=>{var t,n,r,o,i,l;let s,{data:u,colorMode:p,yLabel:g,xLabel:v,yFormat:x,xFormat:A,showLegend:I,fillBetween:w,defaultXEnd:k,defaultXStart:R,forcedChartStartDate:N,accessibilityDescription:M,isBelow768:L,preferredCurrency:_,rangeSelectorClickHandler:O,chartLanguage:W,seriesHighlight:B}=e,U=W===d.z.Trend,z=(0,c.ko)(u,w),{date_vals:V}=z,j=I||a.HPH(a.cJW(["date_vals","y_range"],z)),H=U?a.FFB(null!=w?w:[],j):j,q=(s=C.dO,a.TjK(e=>m()(e,s).valueOf(),V)),G=N||R,K=G?m()(G,"YYYY-MM-DD").valueOf():void 0,Q=k?m()(k,"YYYY-MM-DD").valueOf():void 0,$=a.gD_(k)&&a.gD_(R),X=U?F(z,q,y.T.History,x):[],J=null!==B&&a.mKk(B.windowSeriesName,H)?(0,c.Pd)(q,z[B.windowSeriesName]):null,Z=null!==B&&null!==J?{series:B,window:J}:null,ee=[...T(z,q,H,x,I,W,Z),...E(z,w,x,W)],et=((e,t,n,a)=>{let r={boost:{enabled:!1},chart:{zoomType:"x",spacingRight:8},xAxis:{tickLength:5,labels:{y:18},crosshair:(0,S.CK)()},yAxis:{labels:{x:-4,y:3}},rangeSelector:{dropdown:t?"always":"never",inputEnabled:!1,...!t&&{x:-40}},scrollbar:{enabled:!1},navigator:{enabled:!1},plotOptions:{series:{label:{connectorAllowed:!1},pointStart:2010,dataGrouping:{enabled:!1}}},tooltip:(0,S.xM)({formatter:(0,S.vK)({formatValue:D({yFormat:e,preferredCurrency:n}),maskedSeriesNames:a})}),responsive:{rules:[{condition:{maxWidth:500},chartOptions:{legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"}}}]}};return(0,c.fM)(r)})(x,L,_,null!==w&&a.Q7R(e=>a.mKk(e,H),w)?[y.T.Range]:[]),en=e=>{var t,n,a,r;let o=Math.abs((null!=(a=null==(t=e.axis)?void 0:t.max)?a:0)-(null!=(r=null==(n=e.axis)?void 0:n.min)?r:0));return(0,c.Yj)({format:x,text:e.value,hideDecimals:!0,axisRange:o,preferredCurrency:_})},ea={colors:(0,c.Kz)(p),rangeSelector:{selected:$?C.z2:void 0,buttons:Y(C._t,O)},yAxis:{opposite:!1,labels:{formatter:en}},xAxis:{type:"datetime",ordinal:!1,min:K,max:Q,...null!==Z&&{plotLines:(0,f.XN)({historyStart:Z.window.start,todaySeparator:null,color:h.UA.todayLine,width:1,className:P})}},series:ee,lang:{accessibility:{chartContainerLabel:M}},accessibility:{description:M}},er=U?(e=>{let t=(0,S.Hm)();return{chart:{events:{load:function(){t(this)}}},legend:{enabled:!1},tooltip:(0,S.xM)({formatter:(0,S.BZ)({formatValue:e.formatValue,todaySeparator:e.todaySeparator,lastHistoryValue:e.lastHistoryValue})}),xAxis:{...(0,f.hh)({todaySeparator:e.todaySeparator,historyStart:e.historyStart,labelColor:h.UA.label,labelFontSize:"".concat(h.r8.labelFontSize,"px"),plotLineColor:h.UA.todayLine,plotLineWidth:1,plotLineClassName:P}),title:{text:void 0},crosshair:(0,S.CK)()},yAxis:{...(0,f.yi)({gridLineColor:h.UA.gridline,gridLineWidth:h.r8.gridlineWidth,hasLabels:!0,labelColor:h.UA.label,labelFontSize:"".concat(h.r8.labelFontSize,"px"),labelFormatter:e.yAxisLabelFormatter}),showLastLabel:!0,title:{text:void 0}}}})({yAxisLabelFormatter:en,todaySeparator:null!=(o=null==(t=(0,c.bf)(q,z[y.T.History],x))?void 0:t.x)?o:null,historyStart:null!=(i=null==(n=(0,b.vX)(X))?void 0:n.x)?i:null,lastHistoryValue:null!=(l=null==(r=(0,b.PA)(X))?void 0:r.y)?l:null,formatValue:D({yFormat:x,preferredCurrency:_})}):(e=>({xAxis:{title:{text:e.xLabel},labels:{format:"{text}".concat((0,c.Yj)({format:e.xFormat,text:"",hideDecimals:!1,preferredCurrency:e.preferredCurrency}))}},yAxis:{title:{text:e.yLabel}}}))({xLabel:v,yLabel:g,xFormat:A,preferredCurrency:_});return a.jp7(et,a.jp7(ea,er))},N=(e,t)=>{if(i.A(t)){var n;let a=Math.min(...t),r=Math.max(...t);e.yAxis[0].update({min:a,max:r,startOnTick:!1,showLastLabel:!0,endOnTick:!1}),(null==e||null==(n=e.yAxis[0])?void 0:n.tickPositions)&&(e.yAxis[0].tickPositions.unshift(a),e.yAxis[0].tickPositions.push(r)),e.yAxis[0].update({tickPositions:e.yAxis[0].tickPositions})}},M=(e,t,n)=>{if(t.type){let{lowerBoundTimestamp:r,upperBoundTimestamp:o}=((e,t,n)=>{if("all"===t){let{dataMin:t,dataMax:n}=e.xAxis[0].getExtremes();return{lowerBoundTimestamp:l.A(t)?t:m()().valueOf(),upperBoundTimestamp:l.A(n)?n:void 0}}let a=((e,t)=>{switch(e){case"day":return m()().subtract(t,"days").startOf("day").valueOf();case"month":return m()().subtract(t,"months").startOf("day").valueOf();case"year":return m()().subtract(t,"years").startOf("day").valueOf();case"ytd":return m()().startOf("year").valueOf();default:throw Error("Unsupported range type: ".concat(e))}})(t,n),r=((e,t,n,a)=>
3{if("all"===t){let{dataMax:t}=e.xAxis[0].getExtremes();return l.A(t)?t:void 0}let r=((e,t,n)=>{let a=m()().valueOf();if("ytd"===e)return Math.max(a-n,0);if(e in k&&l.A(t)){let r=k[e];return Math.max(Math.min(m()(n).add(t,r).valueOf(),a)-n,0)}return Math.max(a-n,0)})(t,n,a);if(0===r){let{dataMax:t}=e.xAxis[0].getExtremes();return l.A(t)?t:void 0}let o=a+r+.2*r,{dataMax:i}=e.xAxis[0].getExtremes();return l.A(i)?Math.min(o,i):o})(e,t,n,a),o=l.A(r)&&r<a?void 0:r;return{lowerBoundTimestamp:a,upperBoundTimestamp:o}})(e,t.type,t.count),i=e.rangeSelector,s=null!=i&&l.A(n);if(s){var a;i.frozenStates=!0,null==(a=i.setSelected)||a.call(i,n)}e.xAxis[0].update({ordinal:!1},!1),e.xAxis[0].setExtremes(r,o,!0,!0),s&&(i.frozenStates=!1)}else console.error("Range selector button type is undefined")},L="YYYY-MM-DD",_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,{defaultXStart:n,data:r}=e,o=a.HVh(r.date_vals),i=m()(o,C.dO).subtract(t,"months"),l=n?m()(n,L):i;return i.isSameOrAfter(l)?i.format(L):n}},55606:(e,t,n)=>{n.d(t,{A:()=>g,I:()=>f});var a=n(57090),r=n(12115),o=n(8921),i=n(24771),l=n(17170),s=n(65438),
3c=n(17123),d=n(99026),u=n(74278);let m=e=>{let{form:t}=(0,c.mu)(),{portfolio:n}=e,{value:m,setFalse:p,setTrue:y}=(0,s.A)(!1),h=()=>{p(),e.onClose()},f=async e=>{(e.isPortfolioInvestmentsChanged||e.isPortfolioPropertiesChanged)&&(0,o.Ds)(o._n.Success,"Portfolio saved"),h()},g=async()=>{y()},v={launchAIImporter:d.lQ,form:t,allAssetsAtOnceEnabled:!1,showEditConfirmationIfPropertiesChanged:!0,shareAmountTableFor:u.n.ManualPortfolioEdit};return(0,a.FD)(r.Fragment,{children:[e.render(g),m?(0,a.Y)(l.X.Provider,{value:v,children:(0,a.Y)(i.A,{form:t,visible:!0,activePortfolio:n,title:"Edit ".concat(n.portfolioName),onClose:f,handleFlowError:e=>{console.error(e.errorReason),(0,o.Ds)(o._n.Error,e.notificationErrorMessage),h()}},n.portfolioId)}):null]})};var p=n(41686);let{useManualPortfolioEditLaunchEventListener:y,emitManualPortfolioEditLaunchEvent:h}=(0,n(43948).createEvent)("ManualPortfolioEditLaunchEvent")(),f=e=>{let t=async(e,t)=>{h({portfolio:e,onCloseCallback:t}),await (0,d.yy)(100)};return{launchManualPortfolioEdit:async()=>{e?await t(e):console.error("No portfolio provided to launchManualPortfolioEdit")},launchManualPortfolioEditWithPortfolio:t}},g=()=>{let[e,t]=r.useState(null),n=r.useRef(d.lQ),o=r.useRef(d.lQ);return y(e=>{let{portfolio:a,onCloseCallback:r}=e;t(a),o.current=r||d.lQ,(0,p.E0)(()=>{n.current()})}),e?(0,a.Y)(m,{portfolio:e,render:e=>(n.current=e,(0,a.Y)(r.Fragment,{})),onClose:()=>{t(null),o.current()},"data-sentry-element":"ManualPortfolioEditLauncher","data-sentry-component":"GlobalManualPortfolioEditLauncher","data-sentry-source-file":"GlobalManualPortfolioEditLauncher.tsx"}):null}},55669:(e,t,n)=>{n.d(t,{f:()=>f,j:()=>h});var a=n(62212),r=n(48298),o=n(17667),i=n(70890),l=n(50202),s=n(79768),c=n(71827),d=n(90521),u=n(35974),m=n(58888);let p=async e=>{await e.syncPortfolioGroups(e.queryClient),await e.syncPortfoliosLists(e.queryClient),await e.refreshPortfolioData({portfolioId:e.mainPortfolio.portfolioId,portfolioType:e.mainPortfolio.portfolioType}),await e.syncGroupPortfolios()},y=()=>r.Ay.createDemoPortfolio(),h=()=>{let e=(0,a.j)(),{mainPortfolio:t}=(0,l.RW)(),n=(0,s.rA)(),{syncGroupPortfolios:r}=(0,m.t0)();return(0,o.A)(y,{onSuccess:async()=>{await p({queryClient:e,mainPortfolio:t,syncPortfolioGroups:m.gy,syncPortfoliosLists:i.A9,refreshPortfolioData:n,syncGroupPortfolios:r})},onErrorMessage:e=>e})},f=e=>{let{demoCurrentPortfolio:t}=(0,c.Y)(),n=(0,d.GT)();return(0,o.A)(async()=>{let e=null==t?void 0:t.portfolioId;return e&&await n.mutateAsync({portfolioId:e}),{demoPortfolioId:e}},{onSuccess:t=>{(null==t?void 0:t.demoPortfolioId)&&(0,u.h)({demoPortfolioId:t.demoPortfolioId,reason:e})},onErrorMessage:e=>e})}},55699:(e,t,n)=>{n.d(t,{n:()=>l,s:()=>s});var a=n(12115),r=n(13343),o=n(16685);let i=(0,r.A)((0,o.lt)((e,t)=>({navBarHeight:null,setNavBarHeight:n=>{t().navBarHeight!==n&&e({navBarHeight:n})},resetNavBarHeight:()=>e({navBarHeight:null})}),{name:"OnboardingNavigationStore"})),l=e=>{let{setNavBarHeight:t,resetNavBarHeight:n}=i();a.useEffect(()=>{let n=()=>{e.current&&t(e.current.clientHeight)};n(),window.addEventListener("resize",n);let a="undefined"==typeof ResizeObserver?null:new ResizeObserver(n);return a&&e.current&&a.observe(e.current),()=>{window.removeEventListener("resize",n),null==a||a.disconnect()}},[e,t]),a.useEffect(()=>()=>n(),[n])},s=()=>{let{navBarHeight:e}=i();return{navBarHeight:e}}},55805:(e,t,n)=>{n.d(t,{Af:()=>a.Af,FY:()=>a.FY,GF:()=>a.GF,UO:()=>a.UO,YN:()=>a.YN,gO:()=>a.gO,vX:()=>a.vX});var a=n(80900)},56318:(e,t,n)=>{n.d(t,{A:()=>d,X:()=>s});var a=n(88963),r=n(13125),o=n.n(r),i=n(62031),l=n.n(i),s=function(e){return e.USER="user",e.ASSISTANT="assistant",e}({});class c{constructor(){var e=this;this.triggerAIAssessmentComputation=async e=>{let t=o()({portfolioId:e}),n=await this.apiCaller.get("/reports/get_ai_report_by_portfolio_id",t);return l()(n,{deep:!0})},this.getAiResponse=async(e,t)=>{let n=o()(e,{deep:!0}),r=t?new a.Ay(void 0,t):this.apiCaller,i=await r.post("/ai_assistant/get_ai_response",n);return l()(i,{deep:!0})},this.getMessages=async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,a={limit:String(n)};t&&(a.before=t);let r=await e.apiCaller.get("/ai_assistant/messages",a);return l()(r,{deep:!0})},this.clearConversation=async()=>{let e=await this.apiCaller.delete("/ai_assistant/conversation");return l()(e,{deep:!0})},this.apiCaller=new a.Ay}}let d=new c},56371:(e,t,n)=>{n.d(t,{Q:()=>x,o:()=>A});var a=n(57090),r=n(12115),o=n(74547),i=n(36934),l=n(40248),s=n(73285),c=n(54519),d=function(e){return e.Href="Href",e.Router="Router",e}({});let u=e=>{let{label:t="Sign up",redirectStrategy:n="Href",link:r=c.FK}=e,o=(0,s.w)(),i=async()=>{"Router"===n?await o.push(r):window.location.href=r};return(0,a.Y)(l.A,{variant:"filled",onClick:i,href:r,"data-sentry-element":"Button","data-sentry-component":"SignupCTAButton","data-sentry-source-file":"SignupCTAButton.tsx",children:t})};var m=n(42597),p=n(47640),y=n(35820),h=n(8978);let f=e=>{let{attributeKey:t}=e;switch(t){case y.lT.ExpectedReturns:case h.He.ExpectedReturns:return(0,a.Y)(p.pb,{isPositive:!0});case y.lT.SharpeRatio:case h.He.SharpeRatio:return(0,a.Y)(i.lc,{
3className:"text-neutral-500",children:"+X.X"});default:return null}};f.displayName="LockedHeaderNode";let g=r.memo(f);var v=n(81671);let x=()=>(0,a.Y)(o.In,{icon:v.$.Lock,className:"text-primary flex-shrink-0 w-5 h-5 md:w-6 md:h-6","data-sentry-element":"Icon","data-sentry-component":"AttributeLockedIcon","data-sentry-source-file":"ProtectedAttributeRenderer.tsx"}),A=e=>{let{attributeKey:t,children:n,locked:l,lockedHeaderNode:s,lockedNode:c}=e;return l?(0,a.Y)(m.f,{content:(0,a.FD)(o.Ah,{flexDirection:"column",alignItems:"center",itemsSpacingVertical:12,children:[null!=s?s:(0,a.Y)(g,{attributeKey:t}),(0,a.Y)(i.lc,{className:"text-body",children:"Unlock by signing up"}),(0,a.FD)(i.km,{className:"text-body",children:["See ",t," and other important metrics for free."]}),(0,a.Y)(u,{label:"Sign up for free",redirectStrategy:d.Router})]}),overlayStyle:{maxWidth:"224px",textAlign:"center"},overlayInnerStyle:{padding:"16px",boxShadow:"0 -2px 8px -2px rgba(0, 0, 0, 0.12), 0 8px 24px -4px rgba(0, 0, 0, 0.18), 0 2px 6px -1px rgba(0, 0, 0, 0.08)"},"data-sentry-element":"WPPopover","data-sentry-component":"ProtectedAttributeRenderer","data-sentry-source-file":"ProtectedAttributeRenderer.tsx",children:null!=c?c:(0,a.Y)("span",{className:"flex items-center justify-center",children:(0,a.Y)(x,{})})}):(0,a.Y)(r.Fragment,{children:n})}},56471:(e,t,n)=>{n.d(t,{A:()=>W,T:()=>O});var a=n(57090),r=n(12115),o=n(33624),i=n(43948),l=n(99026),s=n(12667),c=n(89069),d=n(11965),u=n(43057),m=n(65226),p=n(74547),y=n(97765),h=n(75075),f=n(12919),g=n(85780),v=n(21533),x=n(78046),A=n(49877),S=n(35208),b=n(88179),C=n(89568),I=n(62570),w=n(36934),P=n(99750),k=n(76660),F=n(85505),T=n(88105),E=n(41784);let Y=(0,I.A)(C.ID,{target:"e1pnbwr60"})(),D=e=>{let t=(0,c.h)();return(0,a.Y)(p.$n,{onClick:e.onSave,variant:"filled",showErrorNotification:!1,disabled:t,"data-sentry-element":"Button","data-sentry-component":"CashFormSaveButton","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx",children:"Save"})},R=e=>{let{cashPortfolio:t,apyRates:n}=e,{isBelow576:i}=(0,P.uF)(),{preferredCurrencySymbol:l}=(0,y._)(),[c]=(0,x.mN)(),C=(0,A.Nx)(),{launchUnsavedChangesModal:I}=(0,T.y)(),R=r.useMemo(()=>{let{isInvestable:e,apy:a}=t||{},r=o.X4r(h.z.CheckingAccount,[g.kv],t),i=t?a:(0,k.C)(r,n);return{cashPortfolioId:o.X4r(void 0,[g.PW],t),name:o.X4r("",[g.v7],t),apy:i,cashValue:o.X4r(void 0,[g.dF],t),isInvestable:null!=e&&e,accountType:r}},[t,n]),N=r.useRef(R);r.useEffect(()=>{N.current=R,c.setFieldsValue(R)},[c,R]);let M=async()=>{try{await c.validateFields()}catch(e){return}let t=c.getFieldsValue();await C.mutateAsync(t),e.onClose()};return(0,a.Y)(p._s,{title:"Manually enter cash",width:600,open:!0,onClose:()=>{let t=c.isFieldsTouched(),n=c.getFieldsValue(!0);if(!t||o.aIS(N.current,n))return void e.onClose();I({onDiscard:e.onClose,onSave:()=>void M()})},destroyOnClose:!0,footer:(0,a.Y)(f.tb,{children:(0,a.Y)(d.S,{children:(0,a.Y)(D,{onSave:M})})}),"data-sentry-element":"Drawer","data-sentry-component":"CashPortfolioPropertiesForm","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx",children:(0,a.Y)(u.Ay,{theme:{components:{Select:{zIndexPopup:10*S.Bf.modal}}},"data-sentry-element":"ConfigProvider","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx",children:(0,a.Y)(d.S,{"data-sentry-element":"GuestAssetTextInputsGate","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx",children:(0,a.FD)(m.A,{form:c,name:"accountForm",layout:"vertical",initialValues:R,scrollToFirstError:!0,onValuesChange:e=>{if(o.mKk(g.kv,o.HPH(e))&&e.accountType){let t=(0,k.C)(e.accountType,n);c.setFieldValue(g.yH,t)}},"data-sentry-element":"Form","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx",children:[(0,a.Y)(b.JF,{hidden:!0,name:g.PW,style:{width:"100%"},"data-sentry-element":"StyledFormItem","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx",children:(0,a.Y)(p.pd,{inForm:!0,"data-sentry-element":"Input","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx"})}),(0,a.FD)(p.Ah,{itemsSpacingHorizontal:16,alignItems:"stretch",justifyContent:"flex-start","data-sentry-element":"FlexLayout","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx",children:[(0,a.Y)(b.JF,{style:{flexBasis:"60%"},label:"Account nickname",name:g.v7,rules:[{required:!0,message:"Please input the account nickname!"}],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx",children:(0,a.Y)(p.pd,{placeholder:"E.g. Chase Savings",inForm:!0,"data-sentry-element":"Input","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx"})}),(0,a.Y)(b.JF,{style:{flex:1},label:"APY",name:g.yH,rules:[{required:!0,validator:k.j}],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx",children:(0,a.Y)(p.tv,{inForm:!0,"data-sentry-element":"PercentageInput","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx"})})]}),(0,a.FD)(p.Ah,{display:i?"block":void 0,itemsSpacingHorizontal:i?void 0:16,alignItems:"stretch","data-sentry-element":"FlexLayout","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx",children:[(0,a.Y)(b.JF,{style:{flex:1},hideAsterisk:!0,label:(0,a.FD)(p.Ah,{itemsSpacingHorizontal:4,height:"20px",children:["Cash type*",(0,a.Y)(Y,{title:g.Fl})]}),name:g.uH,rules:[{required:!0,message:"Please select the cash type!"}],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx",children:(0,a.Y)(s.y,{placeholder:"Select cash type",options:g.EA,"data-sentry-element":"Select","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx"})}),(0,a.Y)(b.JF,{style:{flex:1},label:"Account type",name:g.kv,rules:[{required:!0,message:"Please select the account type!"}],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx",children:(0,a.Y)(s.y,{placeholder:"Select account type",options:g._C,"data-sentry-element":"Select","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx"})})]}),(0,a.Y)(b.JF,{label:(0,a.Y)(w.se,{className:(0,E.cn)("text-body"),children:"Cash amount"}),name:g.dF,rules:[{required:!0,message:"Please input the cash amount!"},{type:"number",min:.01,message:"Cash amount must be greater than 0!"},{validator:(0,v.de)(g.J$)}],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx",children:(0,a.Y)(F.A,{humanizeNumber:!0,addonBefore:l,maxValue:g.J$,"data-sentry-element":"CurrencyInput","data-sentry-source-file":"CashPortfolioPropertiesForm.tsx"})})]})})})})};var N=n(65438),M=n(513);let{useCashPortfolioInputLaunchEventListener:L,emitCashPortfolioInputLaunchEvent:_}=(0,i.createEvent)("CashPortfolioInputLaunchEvent")(),O=()=>({launchCashPortfolioInput:async(e,t)=>{_({cashPortfolio:e,onCloseCallback:t}),await (0,l.yy)(1e3)}}),W=()=>{let{value:e,setFalse:t,setTrue:n}=(0,N.A)(),[i,s]=r.useState(void 0),{data:c,isLoading:d}=(0,A.gy)(),u=r.useRef(l.lQ);L(async e=>{let{cashPortfolio:t,onCloseCallback:a}=e;s(t),u.current=a||l.lQ,n()});let m=()=>{s(void 0),t(),u.current()};return e?d||o.gD_(c)?(0,a.Y)(p._s,{title:"Manually enter cash",width:600,open:!0,onClose:m,destroyOnClose:!0,footer:(0,a.Y)(f.tb,{children:(0,a.Y)(p.$n,{variant:"filled",disabled:!0,children:"Save"})}),children:(0,a.FD)(p.Ah,{flexDirection:"column",itemsSpacingVertical:16,children:[(0,a.Y)(M._R,{}),(0,a.Y)(M._R,{}),(0,a.Y)(M._R,{}),(0,a.Y)(M._R,{})]})}):(0,a.Y)(R,{cashPortfolio:i,apyRates:c,onClose:m,"data-sentry-element":"CashPortfolioPropertiesForm","data-sentry-component":"GlobalCashPortfolioInputLauncher","data-sentry-source-file":"GlobalManualCashPortfolioInputLauncher.tsx"}):null}},56490:(e,t,n)=>{n.d(t,{A:()=>
3o});var a=n(57090);n(12115);var r=n(89568);let o=e=>{var t;if(null==e.title)return(0,a.Y)("span",{className:e.className,children:e.label});let n=null!=(t=e.minCharsWithIcon)?t:10,[o,i]=function(e,t){if(e.length<=t)return["",e];let n=e.length-t;for(;n>0&&" "!==e[n-1];)n--;return 0===n?["",e]:[e.slice(0,n),e.slice(n)]}(e.label,n);return(0,a.FD)("span",{className:e.className,"data-sentry-component":"TextWithTooltip","data-sentry-source-file":"TextWithTooltip.tsx",children:[o?(0,a.Y)("span",{children:"".concat(o.trimEnd(),"\xa0")}):null,(0,a.FD)("span",{style:{whiteSpace:"nowrap"},children:[i,"\xa0",(0,a.Y)(r.ID,{title:e.title,iconStyle:e.iconStyle,placement:e.placement,overlayStyle:e.overlayStyle,overlayInnerStyle:e.overlayInnerStyle,"data-sentry-element":"InfoTooltip","data-sentry-source-file":"TextWithTooltip.tsx"})]})]})}},56683:(e,t,n)=>{n.d(t,{d:()=>a});var a=function(e){return e.SelfDirected="self_directed",e.ExternallyManaged="externally_managed",e.InvestedFund="invested_fund",e}({})},56690:(e,t,n)=>{n.d(t,{A:()=>u,u:()=>d});var a=n(57090),r=n(12115),o=n(43948),i=n(10349),l=n(99026);let{useManualPortfolioInputLaunchEventListener:s,emitManualPortfolioInputLaunchEvent:c}=(0,o.createEvent)("ManualPortfolioInputLaunchEvent")(),d=()=>({launchManualPortfolioInput:async e=>{c(e),await (0,l.yy)(1e3)}}),u=()=>{let e=r.useRef(()=>(0,l.yy)(300)),t=r.useRef(l.lQ),n=r.useRef(void 0);s(async t=>{n.current=t.onSuccess,await e.current()});let o=()=>{t.current(),t.current=l.lQ,n.current=void 0};return(0,a.Y)(i.A,{render:t=>(e.current=t,(0,a.Y)(r.Fragment,{})),onCloseAfterSuccess:e=>{var t;null==(t=n.current)||t.call(n,e),o()},onWorkflowEnded:o,"data-sentry-element":"ManualPortfolioInputLauncher","data-sentry-component":"GlobalManualPortfolioInputLauncher","data-sentry-source-file":"GlobalManualPortfolioInputLauncher.tsx"})}},57149:(e,t,n)=>{n.d(t,{a:()=>l});var a=n(3023),r=n(59225),o=n(69350),i=n(76778);let l=e=>{let t=(0,i.K)(async t=>{try{var n;let a=null!=t?t:{},i=e.notificationToFetchArgs?e.notificationToFetchArgs(a):{portfolioId:"number"==typeof a.portfolio_id?a.portfolio_id:void 0,variantKey:"string"==typeof a.variant_key?a.variant_key:void 0},l=await (0,o.b8)({namespace:e.namespace,portfolioId:i.portfolioId,variantKey:i.variantKey});if(null===l)return;let s=null!=(n=l.payload)?n:null;await e.onSnapshot({snapshot:l,payload:s,isSuccess:l.status===r.A.Success})}catch(n){console.error("[".concat(e.namespace,"] socket handler failed"),n,t)}});(0,a.V)(e.socketEvent,t)}},57295:(e,t,n)=>{n.d(t,{k:()=>u,n:()=>d});var a=n(71680),r=n(33624),o=n(36608),i=n(7802),l=n(19565);let s=e=>[i.$5.Yodlee,"linkToken",r.gD_(e.reconnectingAccountId)?"":String(e.reconnectingAccountId)],c=e=>o.A.getYodleeLinkToken(e.reconnectingAccountId),d=(e,t)=>(0,l.p)(e,s(t),()=>c(t)),u=()=>{let e=(0,a.j)();return(0,a.n)({mutationFn:t=>(0,l.B)(e,s(t),()=>c(t))})}},57944:(e,t,n)=>{n.d(t,{t:()=>d});var a=n(57090),r=n(12115),o=n(79968),i=n(74547),l=n(55074),s=n(75640),c=n(76145);let d=e=>{let{importerProps:{isUploaderOpen:t,launchUploader:n,afterUploaderOpened:d,exitImporter:u,uploaderInstanceRef:m,uploaderConfig:p,isFilesEmpty:y,submitUploader:h,retryParsing:f,remoteUploadStatusSnapshot:{isRemoteUploadInProgress:g,isRemoteUploadFailed:v},statementParserStatusSnapshot:{isStatementsParsingInProgress:x,isStatementsParsingFailed:A}},portfolioEditorProps:{parsedInvestmentItems:S,normalizedUserUploadedData:b,shouldShowParsedPortfolioEditor:C,handlePortfolioSaveComplete:I,handleInitiateNewUpload:w,handlePortfolioImportCancel:P,statementId:k}}=(0,s.b)(),{isParsedPortfolioEditorOpen:F,importerActionLoading:T,importerActionLabel:E,importerActionDisabled:Y,importerSubmitAction:D,initiateReparsingLabel:R}=(0,s.v)({shouldShowParsedPortfolioEditor:C,editorParsedInvestmentItems:S,isRemoteUploadInProgress:g,isStatementsParsingInProgress:x,isRemoteUploadFailed:v,isStatementsParsingFailed:A,isFilesEmpty:y,retryParsing:f,submitUploader:h}),N=async()=>{T||Y||await D()};return(0,a.FD)(r.Fragment,{children:[e.render(n),(0,a.Y)(i.aF,{disableSubmitOnEnter:!0,title:"Upload brokerage statement",open:t,onOk:N,okText:E,okButtonProps:{disabled:Y,loading:T},onCancel:()=>{u()},afterOpenChange:e=>{e&&d()},keyboard:!1,maskClosable:!1,"data-sentry-element":"Modal","data-sentry-source-file":"BrokerageStatementsLiveImporter.tsx",children:(0,a.FD)(i.Ah,{display:"block",itemsSpacingVertical:8,flexWrap:"nowrap","data-sentry-element":"FlexLayout","data-sentry-source-file":"BrokerageStatementsLiveImporter.tsx",children:[(0,a.Y)(c.Ih,{"data-sentry-element":"StatementFormatInstructions","data-sentry-source-file":"BrokerageStatementsLiveImporter.tsx"}
3),(0,a.Y)(o.d,{uploaderRef:m,config:p,"data-sentry-element":"Uploader","data-sentry-source-file":"BrokerageStatementsLiveImporter.tsx"}),x?(0,a.Y)(c.eI,{}):null]})}),F&&S?(0,a.Y)(l.A,{uploadedData:null!=b?b:JSON.stringify(S),portfolioInvestmentItems:S,onPortfolioSaveComplete:t=>{let{setupFinalOutcome:n,portfolioId:a}=t;I({setupFinalOutcome:n,portfolioId:a}),e.onPortfolioImported({setupFinalOutcome:n,portfolioId:a})},onInitiateNewUpload:w,initiateNewUploadLabel:R,initiateNewUploadExtra:(0,a.Y)(c.VL,{}),onCancel:P,hideParsingFeedback:!0,statementId:k}):null]})}},58211:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(57090);n(12115);let r=e=>{let{width:t="30",height:n="36",viewBox:r="0 0 30 36",color:o="#CBD5E1"}=e;return(0,a.Y)("svg",{width:t,height:n,viewBox:r,fill:"none",xmlns:"http://www.w3.org/2000/svg","data-sentry-element":"svg","data-sentry-component":"Stars","data-sentry-source-file":"Stars.tsx",children:(0,a.Y)("path",{d:"M25.3765 11.2291L26.5301 8.31247L29.0853 6.99581C29.6548 6.69581 29.6548 5.77914 29.0853 5.47914L26.5301 4.16247L25.3765 1.22914C25.1137 0.579138 24.3106 0.579138 24.0478 1.22914L22.8943 4.14581L20.3244 5.46247C19.755 5.76247 19.755 6.67914 20.3244 6.97914L22.8797 8.29581L24.0332 11.2291C24.296 11.8791 25.1137 11.8791 25.3765 11.2291ZM13.7538 13.7291L11.4321 7.89581C10.9211 6.59581 9.28569 6.59581 8.77464 7.89581L6.453 13.7291L1.34247 16.3791C0.203552 16.9791 0.203552 18.8291 1.34247 19.4125L6.453 22.0625L8.77464 27.8958C9.30029 29.1958 10.9211 29.1958 11.4321 27.8958L13.7538 22.0625L18.8643 19.4125C20.0032 18.8125 20.0032 16.9625 18.8643 16.3791L13.7538 13.7291ZM24.0332 24.5625L22.8797 27.4791L20.3244 28.7958C19.755 29.0958 19.755 30.0125 20.3244 30.3125L22.8797 31.6291L24.0332 34.5625C24.296 35.2125 25.0991 35.2125 25.3619 34.5625L26.5155 31.6458L29.0853 30.3291C29.6548 30.0291 29.6548 29.1125 29.0853 28.8125L26.5301 27.4958L25.3765 24.5625C25.1137 23.9125 24.296 23.9125 24.0332 24.5625Z",fill:o,"data-sentry-element":"path","data-sentry-source-file":"Stars.tsx"})})}},58451:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(57090),r=n(12115),o=n(33624),i=n(99750);let l=r.memo(e=>{let{hideInMobile:t,hideOnlyInMobilePortrait:n,hideInTabletPortraitOrMobile:l,hideInTablet:s,children:c,hiddenReplacementNode:d=null}=e,{isMobile:u,isMobilePortrait:m,isTabletPortraitOrMobile:p,isTablet:y}=(0,i.Qs)(),h=o.G4b([()=>!!(t&&u),()=>!!(n&&m),()=>!!(s&&y),()=>!!(l&&p)]);return(0,a.Y)(r.Fragment,{children:h()?d:c})})},58613:(e,t,n)=>{n.d(t,{Ay:()=>g,Tv:()=>y,Up:()=>p,oo:()=>f});var a=n(33624),r=n(16528),o=n(31260),i=n(50202),l=n(16462),s=n(76699),c=n(81255),d=n(59109),u=n(35208),m=n(65694);let p=e=>a.mKk(e.recommendationType,[l.A.InvestingRecommendation,l.A.NextTopRecommendation]),y=e=>e.status===l.Kk.Denied,h=()=>{var e;let{defaultGroupPortfolioId:t,activePortfolioId:n}=(0,i.RW)(),{isFunctionalityRestrictedPortfolio:c}=(0,d.I)(t||u.RI),{highLevelRecommendationsEnabled:p}=(0,o.yf)(),y=p&&!c,{data:h,isLoading:f}=(0,s.Q6)(y),g=null!=(e=null==h?void 0:h.exists)&&e,{isRecommendationsInitialLoading:v}=(0,m.Ay)({portfolioId:t||u.RI}),{data:x,isLoading:A}=(0,s.Ay)(y&&(g||!v)),S=(null==x?void 0:x.topRecommendations)||[],b=(null==x?void 0:x.bonusRecommendation)||void 0,C=n===t,I=a.pbD(a.wqE("status",l.Kk.NoStatus),S),w=a.xWs(S,b?[b]:[]),P=a.pbD(a.wqE("status",l.Kk.NoStatus),w),k=r.A(P),F=r.A(I),T=!!(null==x?void 0:x.computationInProgress),E=T&&S.length>0,Y=f||A||!g&&v||!!(null==x?void 0:x.computePublished)||T&&0===S.length;return{topRecommendations:S,bonusRecommendation:b,topActiveRecommendations:I,showingRecommendations:w,isLoading:Y,enabled:y,activeRecommendations:P,hasActiveTopRecommendations:F,hasActiveRecommendations:k,highLevelRecommendationsPortfolioId:t,isHighLevelRecommendationsPortfolioActive:C,showLoadingMoreIndicator:E}},f=()=>{let{enabled:e,isHighLevelRecommendationsPortfolioActive:t,highLevelRecommendationsPortfolioId:n}=h(),{isPortfolioEmpty:r,isComputing:o}=(0,d.I)(n||u.RI),{isActivePortfolioDraft:l}=(0,i.RW)(),{isUserInTrackPage:s}=(0,c.A)();return{isVisibilityEligible:a.Uo6(e,a.bzn(a.D_O,[t,s,!l])),visibilityDependencies:{isHighLevelRecommendationsEnabled:e,isHighLevelRecommendationsPortfolioActive:t,isUserInTrackPage:s,isActivePortfolioDraft:l},showEmptyPortfolioCard:!o&&r}},g=h}
3,58888:(e,t,n)=>{n.d(t,{ZE:()=>k,gy:()=>P,Lh:()=>Y,wt:()=>R,t0:()=>T,wj:()=>N,D1:()=>D,Aj:()=>F,uf:()=>L,LH:()=>M,dz:()=>E});var a=n(33624),r=n(31585),o=n(17667),i=n(88963),l=n(13125),s=n.n(l),c=n(62031),d=n.n(c);class u{constructor(){this.upsertPortfolioGroup=async e=>{let t=await this.apiCaller.post("/portfolio_groups/api/upsert_portfolio_group",s()(e));return d()(t)},this.getPortfolioGroups=async()=>{let e=await this.apiCaller.get("/portfolio_groups/api/get_portfolio_groups");return d()(e)},this.deleteGroup=async e=>{await this.apiCaller.post("/portfolio_groups/api/delete_portfolio_group",{id:e})},this.makeDefaultGroup=async e=>{await this.apiCaller.post("/portfolio_groups/api/set_as_default_portfolio_group",{id:e})},this.updateGroupedPortfolios=async e=>{let t=await this.apiCaller.post("/portfolio_groups/api/update_grouped_portfolios",s()(e));return d()(t)},this.getPortfolioGroupByPortfolioId=async e=>{let t=await this.apiCaller.get("/portfolio_groups/api/get_portfolio_group_by_portfolio_id",s()({portfolioId:e}));return d()(t)},this.resetPortfolioGroups=async()=>{await this.apiCaller.post("/portfolio_groups/api/reset_portfolio_groups",{})},this.apiCaller=new i.Ay}}let m=new u;var p=n(10833),y=n(84245),h=n(70890),f=n(32189),g=n(8921),v=n(11444),x=n(79768),A=n(50202),S=n(84455),b=n(6976),C=n(73672),I=n(42036),w=n(45424);let P=async e=>{await Promise.allSettled([e.invalidateQueries(y.dp),(0,h.SZ)(e)])},k=async()=>{let e=w.q.getQueryData(y.dp);return r.A(e)&&(e=await m.getPortfolioGroups()),e||[]},F=()=>(0,p.I)(y.dp,()=>m.getPortfolioGroups(),{...y.gz}),T=()=>{let e=(0,x.rA)(),{groupPortfolios:t}=(0,A.RW)(),{data:n=[]}=F();return{syncGroupPortfolios:async()=>{let r=a.TjK(e=>e.portfolioId,t),o=a.TjK(e=>e.portfolioSummaryId,n),i=a.sbv(a.Bqz([r,o]));await Promise.allSettled(a.TjK(t=>e({portfolioId:t,portfolioType:f.N$.Group}),i))}}},E=()=>{let e=(0,p.j)(),{syncGroupPortfolios:t}=T();return(0,o.A)(e=>m.upsertPortfolioGroup(e),{onSuccess:async()=>{await P(e),t()}})},Y=()=>{let e=(0,p.j)();return(0,o.A)(e=>m.deleteGroup(e),{onSuccess:async()=>{await P(e)}})},D=()=>{let e=(0,p.j)(),{switchActivePortfolio:t}=(0,I.Ay)();return(0,o.A)(e=>m.makeDefaultGroup(e.id),{onSuccess:async(n,a)=>{t(a.portfolioSummaryId,I.Gl.Auto),await P(e),(0,C.gz)(e,{reset:!0})}})},R=()=>{let e=(0,p.j)(),{syncGroupPortfolios:t}=T(),n=(0,C.vA)();return(0,o.A)(async e=>{let{portfolioGroups:t,sourceGroupId:n,destinationGroupId:a,portfolioId:r,destinationPortfolioIndex:o}=e,i=(0,v.YB)(t,n),l=(0,v.YB)(t,a);if(i&&l){let e=(0,v.qM)({existingPortfolioIds:l.groupedPortfolioIds,destinationPortfolioIndex:o,portfolioId:r});await m.updateGroupedPortfolios({id:a,portfolioIds:e})}},{onMutate:t=>{(0,v.B$)(t,e,y.dp)},onSuccess:async(a,r)=>{await P(e),t();let{portfolioGroups:o,sourceGroupId:i,destinationGroupId:l}=r,s=(0,v.YB)(o,i),c=(0,v.YB)(o,l);((null==s?void 0:s.isDefault)||(null==c?void 0:c.isDefault))&&n.mutate()},onError:(t,n)=>{e.setQueryData(y.dp,n.portfolioGroups),P(e),(0,g.Ds)(g._n.Error,"Failed to move portfolio between groups. Please try again.")}})},N=()=>{let e=D(),{mainPortfolio:t}=(0,A.RW)();return(0,o.A)(async()=>{let n=await m.getPortfolioGroupByPortfolioId(t.portfolioId);n&&await e.mutateAsync(n)})},M=()=>{let e=(0,b.nP)();return(0,o.A)(async()=>{await e.mutateAsync([{questionId:S.od.PortfolioManagementApproach,response:S.SO.AssetGroups}])})},L=()=>{let e=(0,p.j)(),{syncGroupPortfolios:t}=T(),{switchActivePortfolio:n}=(0,I.Ay)();return(0,o.A)(async()=>{await m.resetPortfolioGroups()},{onSuccess:async()=>{await P(e);let a=(await m.getPortfolioGroups()).find(e=>e.isDefault);a&&n(a.portfolioSummaryId,I.Gl.Auto),t(),(0,C.gz)(e,{reset:!0})}})}},59109:(e,t,n)=>{n.d(t,{I:()=>c});var a=n(33624),r=n(38038),o=n(64862),i=n(71873),l=n(43608),s=n(544);let c=e=>{let{isPortfolioEmpty:t,isComputing:n}=(0,o.V)(e),{isPortfolioUnderTracked:c,isComputing:d}=(0,i.s)(e),{isPortfolioOverLeveraged:u,isComputing:m}=(e=>{let{data:t,isLoading:n}=(0,l.y)(e);return{isPortfolioOverLeveraged:a.gD_(t)?null:(0,s.GN)(t),isComputing:n}})(e),{isPortfolioValueNegative:p,isComputing:y}=(e=>{let{data:t,isLoading:n}=(0,l.y)(e);return{isPortfolioValueNegative:a.gD_(t)?null:(0,s.JN)(t),isComputing:n}})(e),h=[t,c,u,p],f=a.bzn(r.A,[n,d,m,y]);return{isPortfolioEmpty:t,isPortfolioUnderTracked:c,isPortfolioOverLeveraged:u,isPortfolioValueNegative:p,isFunctionalityRestrictedPortfolio:a.Q7R(a.is(Boolean),h)?a.bzn(r.A,h):null,isComputing:f}}}
3,59149:(e,t,n)=>{n.d(t,{H5:()=>l.H5,eM:()=>s,ti:()=>l.ti,wZ:()=>l.wZ});var a=n(57090),r=n(98868),o=n(12115),i=n(69126),l=n(36559);let s=[{key:"plannedYearsToWithdrawingMoney",question:(0,a.FD)(o.Fragment,{children:["In how many years do you plan to ",(0,a.Y)("b",{children:"begin withdrawing money"})," from your investment accounts (e.g. retirement, mortgage down payment)?"]}),questionIcon:(0,a.Y)(i.Ay,{icon:(0,i.sW)("risk_cash"),iconWidth:"32px",iconHeight:"32px"}),options:[{label:"plannedYearsToWithdrawingMoney",choices:[{displayText:"1 – 2 years",value:r.UP.OneToTwoYears},{displayText:"2 – 5 years",value:r.UP.TwoToFive},{displayText:"5 – 15 years",value:r.UP.FiveToFifteen},{displayText:"15+ years",value:r.UP.FifteenOrMore}]}]},{key:"lowerReturnsAcceptance",question:(0,a.FD)(o.Fragment,{children:["Generally, you ",(0,a.Y)("b",{children:"prefer an investment with little or no ups and downs"})," in value, and you are willing to accept the lower returns these investments may make."]}),questionIcon:(0,a.Y)(i.Ay,{icon:(0,i.sW)("expected_returns"),iconWidth:"32px",iconHeight:"24px"}),options:[{label:"lowerReturnsAcceptance",choices:[{displayText:"Strongly disagree",value:r.oF.StronglyDisagree},{displayText:"Disagree",value:r.oF.Disagree},{displayText:"Agree",value:r.oF.Agree},{displayText:"Strongly agree",value:r.oF.StronglyAgree}]}]},{key:"volatility",question:(0,a.FD)(o.Fragment,{children:["If you ",(0,a.Y)("b",{children:"had to invest your entire net worth"})," in one of the options for the next 5 years, which would you choose?"]}),questionIcon:(0,a.Y)(i.Ay,{icon:(0,i.sW)("net_worth"),iconWidth:"28px",iconHeight:"24px"}),options:[{label:"volatility",labelDisplayText:"Charts show the highest one-year loss and the highest one-year gain on three different hypothetical investments of $100,000.",cardsPerRow:3,choices:[{displayText:"Low volatility",value:r.Mb.Least,customIcon:(0,a.Y)(i.Ay,{icon:(0,i.sW)("low_volatility"),iconWidth:"112px",iconHeight:"136px"})},{displayText:"Medium volatility",value:r.Mb.Medium,customIcon:(0,a.Y)(i.Ay,{icon:(0,i.sW)("moderate_volatility"),iconWidth:"112px",iconHeight:"136px"})},{displayText:"High volatility",value:r.Mb.Most,customIcon:(0,a.Y)(i.Ay,{icon:(0,i.sW)("most_volatility"),iconWidth:"112px",iconHeight:"136px"})}]}]},{key:"comfortability",question:(0,a.FD)(o.Fragment,{children:["How comfortable would you feel using the following if you thought they could"," ",(0,a.Y)("b",{children:"lead to better risk-adjusted returns"}),"?"]}),questionIcon:(0,a.Y)(i.Ay,{icon:(0,i.sW)("weight_scale"),iconWidth:"24px",iconHeight:"24px"}),options:[{label:"leverageComfortability",labelDisplayText:"Leverage",choices:[{displayText:"Very uncomfortable",value:r.Xh.VeryUncomfortable},{displayText:"Uncomfortable",value:r.Xh.Uncomfortable},{displayText:"Comfortable",value:r.Xh.Comfortable},{displayText:"Very comfortable",value:r.Xh.VeryComfortable}]},{label:"stockOptionsComfortability",labelDisplayText:"Stock options",choices:[{displayText:"Very uncomfortable",value:r.Xh.VeryUncomfortable},{displayText:"Uncomfortable",value:r.Xh.Uncomfortable},{displayText:"Comfortable",value:r.Xh.Comfortable},{displayText:"Very comfortable",value:r.Xh.VeryComfortable}]},{label:"cryptocurrenciesComfortability",labelDisplayText:"Cryptocurrencies",choices:[{displayText:"Very uncomfortable",value:r.Xh.VeryUncomfortable},{displayText:"Uncomfortable",value:r.Xh.Uncomfortable},{displayText:"Comfortable",value:r.Xh.Comfortable},{displayText:"Very comfortable",value:r.Xh.VeryComfortable}]}]},{key:"experience",question:(0,a.Y)(o.Fragment,{children:"How experienced are you as an investor?"}),questionIcon:(0,a.Y)(i.Ay,{icon:(0,i.sW)("person"),iconWidth:"24px",iconHeight:"24px"}),options:[{label:"experience",choices:[{displayText:"Beginner",value:r.J7.Beginner,icon:(0,i.sW)("trend")},{displayText:"Moderate",value:r.J7.Moderate,icon:(0,i.sW)("expected_returns")},{displayText:"Expert",value:r.J7.Expert,icon:(0,i.sW)("search_trend")}]}]}]},59198:(e,t,n)=>{n.d(t,{A:()=>j});var a=n(57090),r=n(12115),o=n(33624),i=n(17143),l=n(544),s=n(35208),c=n(99750),d=n(11325),u=n(13340),m=n(31272),p=n(17445),y=n(98007),h=n(31260),f=n(4122),g=n(13641),v=n(27234),x=n(8106),A=n(47640),S=n(47120
3),b=n(82748),C=n(83910),I=n(7172),w=n(6019);let P=e=>{let{taxDetail:t}=e;if(!t)return(0,a.Y)(r.Fragment,{children:s.UZ});let{ticker:n,unrealizedGainOrLoss:o,isAssumed:i,assumedUnrealizedGainOrLoss:c}=t;return(0,l.zu)(n)||(0,l.yI)(n)?(0,a.Y)(r.Fragment,{children:s.UZ}):(0,a.Y)(w.A,{isAssumed:i,amount:o,assumedAmounts:c,amountFormatterProps:{customFormatOptions:{hideDecimals:!0}},"data-sentry-element":"AssumedRangeAmounts","data-sentry-component":"PortfolioDetailItemUnrealizedGains","data-sentry-source-file":"PortfolioDetailItemUnrealizedGains.tsx"})};var k=n(74547),F=n(9519),T=n(36271),E=n(85180),Y=n(4338),D=n(56371),R=n(54089),N=n(87764),M=n(73496);let L=(0,E.A)({Component:e=>{let{taxDetail:t}=e;if(!t)return(0,a.Y)(r.Fragment,{children:s.UZ});let{taxOnSaleLabel:n,taxOnSaleAmount:o,assumedTaxOnSaleAmount:i,isAssumed:l}=t;return(0,a.Y)(k.m_,{title:l?null:n,placement:"top","data-sentry-element":"Tooltip","data-sentry-component":"DetailsTaxOnSaleColumn","data-sentry-source-file":"DetailsTaxOnSaleColumn.tsx",children:(0,a.Y)(w.A,{isAssumed:l,amount:o,assumedAmounts:i,"data-sentry-element":"AssumedRangeAmounts","data-sentry-source-file":"DetailsTaxOnSaleColumn.tsx"})})},featureName:Y.JP.Taxes,hideFeatureNotAccessible:!0,customFeatureNotAccessible:(0,a.Y)(()=>{let{isUserHavingGoldAccess:e}=(0,N.A)(),{featureAccessConfig:t}=(0,M.R)(Y.JP.Taxes);return!t||e?null:(0,a.Y)(R.A,{accessConfig:{...t,description:null},render:e=>{let{onClick:t,loading:n}=e;return(0,a.Y)(k.Ah,{flexDirection:"column",itemsSpacingVertical:4,fontSize:10,children:(0,a.Y)(F.A,{spinning:n,indicator:(0,a.Y)(T.y,{iconOnly:!0,size:"sm"}),children:(0,a.Y)(k.$n,{onClick:t,variant:"ghost",color:"neutral",size:"md",isIconOnly:!0,children:(0,a.Y)(D.Q,{})})})})},"data-sentry-element":"FeatureNotAccessibleActionVariants","data-sentry-component":"DetailsTaxOnSaleColumnFeatureAccessAction","data-sentry-source-file":"DetailsTaxOnSaleColumn.tsx"})},{}),disabledBackgroundImage:"",disabledBackgroundImageMobile:"",cta:null});var _=n(83262),O=n(99147),W=n(60801),B=n(488);let U=e=>{let{taxDetail:t}=e;if(!t)return(0,a.Y)(r.Fragment,{children:s.UZ});let{avgCostBasis:n,assumedAvgCostBasis:o,isAssumed:i}=t;return(0,a.Y)(w.A,{isAssumed:i,amount:n,assumedAmounts:o,"data-sentry-element":"AssumedRangeAmounts","data-sentry-component":"AverageCostBasisColumn","data-sentry-source-file":"AverageCostBasisColumn.tsx"})};var z=n(19052);let V=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b.k,n=(0,C._V)("portfolio-details"),a=(0,c.tb)(t),r=o.vUk([],a.defaultSelectedColumns),i=o.yoy(-1,S.h.CustomizeInvestment,r),l=e?i:r;return{compactTableConfig:{...a,defaultSelectedColumns:l,persistenceKey:n}}},j=e=>{let{portfolio:t,data:n,taxDetails:b,isTaxDetailsLoading:C,hideColumns:w,emptyText:k,showCustomizeSecurityOption:F,isLoadingInBackground:T,detailsTableInFixMode:E=!1,compactTableConfigArray:Y}=e,{isMobilePortrait:D,isMobile:R}=(0,c.Qs)(),{hideTaxFeature:N}
3=(0,h.yf)(),{launchInvestmentExploration:M}=(0,y.w)(),{workflowVisible:j,workflowParams:H,launchSecurityProxyExclusiveSetupWorkflow:q,exitWorkflow:G}=(0,f.q)(),{refreshUserPortfolios:K}=(0,x.Z)(),{compactTableConfig:Q}=V(E,Y),$=r.useMemo(()=>{let e=(0,i.vL)(b);return o.TjK(t=>({...t,taxDetail:e[(0,i.$S)(t.ticker)]}),n)},[n,b]),X=async e=>{await M({ticker:e.ticker,netWorthDetail:e.networthDetail})},J=async e=>{await q({ticker:e.ticker,investment:e.investment,networthDetail:e.networthDetail})},Z=(e,t)=>{let{taxDetail:n=null}=e;return C?(0,a.Y)(W.A,{}):t(n)},ee=o.kuo(e=>!!w&&o.mKk(e.dataIndex,w),[{title:"Investments",dataIndex:"displayName",key:S.h.DisplayName,render:(e,t)=>(0,a.Y)(v.i,{investmentItem:t,compactMode:!0}),width:(0,c.tb)(["20%","20%","20%","20%","30%","35%"]),sorter:I.b.sortText("ticker"),alwaysVisible:!0,fixed:D?"left":void 0},{title:"Market value",dataIndex:"amount",key:S.h.MarketValue,render:e=>(0,a.Y)(d.eF,{amount:e,sourceCurrency:u.mF,currencyFormatter:d.EB.HumanizedCompactAmount}),width:(0,c.tb)(["14%","7%"]),sorter:I.b.sortNumber("amount")},{title:"Quantity",dataIndex:"quantity",key:S.h.Quantity,render:(e,t)=>(0,l.Gx)(t.ticker)?s.UZ:(0,a.Y)(B.A,{quantity:e,currentPrice:t.currentPrice,showNAIfPriceNull:!0}),width:"8%",sorter:I.b.sortNumber("quantity")},{title:"Average cost basis",dataIndex:"avgCostBasis",key:S.h.AverageCostBasis,render:(e,t)=>Z(t,e=>(0,a.Y)(U,{taxDetail:e})),width:"8%",sorter:(e,t)=>{let n=e.taxDetail,a=t.taxDetail;if(n&&a){var r,o;return(null!=(r=n.avgCostBasis)?r:0)-(null!=(o=a.avgCostBasis)?o:0)}return n?-1:+!!a}},{title:"Weight",dataIndex:"weight",key:S.h.Weight,render:e=>(0,m.ZN)(e,{formatToPercent:!0}),width:(0,c.tb)(["13%","7%"]),sorter:I.b.sortNumber("weight")},{title:"Exp. return",dataIndex:"expectedReturn",key:S.h.ExpectedReturn,render:e=>(0,a.Y)(A.Ay,{expectedReturn:e,justifyContent:"start"}),width:(0,c.tb)(["15%","12%"]),sorter:I.b.sortNumber("expectedReturn")},{title:"Market beta",dataIndex:"marketBeta",key:S.h.MarketBeta,render:e=>(0,m.Hh)(e),width:"10%",sorter:I.b.sortNumber("marketBeta")},{title:"Risk",dataIndex:"expectedRisk",key:S.h.Risk,render:e=>(0,m.Sy)(e,{formatToPercent:!0}),width:"10%",sorter:I.b.sortNumber("expectedRisk")},{title:"Sharpe Ratio",dataIndex:"expectedSharpeRatio",key:S.h.SharpeRatio,render:e=>(0,m.zA)(e),width:"8%",sorter:I.b.sortNumber("expectedSharpeRatio")},{title:"Dividend",dataIndex:"dividend",key:S.h.Dividend,render:e=>(0,a.Y)(d.eF,{amount:e,sourceCurrency:u.mF,currencyFormatter:d.EB.HumanizedCompactAmount}),width:"8%",sorter:I.b.sortNumber("dividend"),hide:!Q.compactMode},{title:"Tax at sale",hide:N,dataIndex:"taxOnSale",key:S.h.TaxAtSale,render:(e,t)=>Z(t,e=>(0,a.Y)(L,{taxDetail:e})),width:(0,c.tb)(["14%"]),sorter:(e,t)=>{var n,a;let r=e.taxDetail,o=t.taxDetail;return(null!=(n=null==r?void 0:r.taxOnSaleAmount)?n:0)-(null!=(a=null==o?void 0:o.taxOnSaleAmount)?a:0)},onCellClick:e=>{e.stopPropagation()}},{title:"Unrealized gain/loss",dataIndex:"unrealizedGainOrLoss",key:S.h.UnrealizedGainLoss,render:(e,t)=>Z(t,e=>(0,a.Y)(P,{taxDetail:e})),sorter:(e,t)=>{var n,a;let r=e.taxDetail,o=t.taxDetail;return(null!=(n=null==r?void 0:r.unrealizedGainOrLoss)?n:0)-(null!=(a=null==o?void 0:o.unrealizedGainOrLoss)?a:0)},width:(0,c.tb)(["14%","10%"])},{hide:!E&&(!F||R),title:null,dataIndex:"customizeInvestment",key:S.h.CustomizeInvestment,render:(e,t)=>(0,a.Y)(O.du,{onClick:async()=>{await J(t)}}),width:(0,c.tb)(["8%","7%"])},{hide:R,title:null,dataIndex:"view",key:S.h.View,render:(e,t)=>(0,l._p)(t.ticker)?null:(0,a.Y)(p.dq,{onClick:()=>X(t),children:"View"}),width:"4%"}]);return(0,a.FD)(r.Fragment,{children:[(0,a.Y)(_.A,{dataSource:$,rowKey:e=>"".concat(e.ticker),pagination:(0,z.B6)($.length),columns:ee,onRowClick:X,isStriped:!0,rowClickable:e=>!(0,l._p)(e.ticker),loading:T,compactModeConfig:Q,emptyContent:k,isHeaderSticky:!0,removeWrapper:!0,"data-sentry-element":"CustomTable","data-sentry-source-file":"DetailsTable.tsx"}),j&&H?(0,a.Y)(g.N,{contextPortfolio:t,...H,onProxyMappingUpserted:K,onProxyMappingRemoved:K,onClose:G}):null]})}},59268:(e,t,n)=>{n.d(t,{Y:()=>i});var a=n(57090);n(12115);var r=n(54519),o=n(6497);let i=e=>(0,a.Y)(o.$,{href:r.Ay.disclosures,"data-sentry-element":"PublicGPLink","data-sentry-component":"GPDisclosuresLink","data-sentry-source-file":"GPDisclosuresLink.tsx",children:e.children?e.children:"Disclosures"})},59334:(e,t,n)=>{n.d(t,{L:()=>y,u:()=>h});var a=n(62212),r=n(19788),o=n(17667),i=n(95935),l=n(64022),s=n(67759),c=n(4603),d=n(73672),u=n(90521),m=n(7802);let p=async e=>await r.A.updateAllAccounts(e),y=e=>{let t=(0,a.j)(),n=(0,d.ug)();return(0,o.A)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return await p(e)},{onMutate:()=>{(0,s.trackPortfoliosSyncProcess)({event:c.PortfoliosSyncEvent.Started,mode:e})},onSuccess:async()=>{await (0,i.d)(t),n.mutateAsync({}),(0,s.trackPortfoliosSyncProcess)({event:c.PortfoliosSyncEvent.Succeeded,mode:e})},onError:t=>{(0,s.trackPortfoliosSyncProcess)({event:c.PortfoliosSyncEvent.Failed,mode:e,reason:(0,l.Ly)(t)})},onErrorMessage:e=>(0,l.rM)(e)})},h=e=>{let t=(0,a.j)(),n=(0,d.ug)(),r=(0,u.rE)();return(0,o.A)(async()=>{await Promise.all([p({accountProvider:m.$5.SnapTrade,invalidate:!1}),p({accountProvider:m.$5.Plaid,invalidate:!1}
3),p({accountProvider:m.$5.Yodlee,invalidate:!1}),p({accountProvider:m.$5.Asa,invalidate:!1})]),await r.mutateAsync({})},{onMutate:()=>{(0,s.trackPortfoliosSyncProcess)({event:c.PortfoliosSyncEvent.Started,mode:e})},onSuccess:async()=>{await (0,i.d)(t),n.mutateAsync({}),(0,s.trackPortfoliosSyncProcess)({event:c.PortfoliosSyncEvent.Succeeded,mode:e})},onError:t=>{(0,s.trackPortfoliosSyncProcess)({event:c.PortfoliosSyncEvent.Failed,mode:e,reason:(0,l.Ly)(t)})},onErrorMessage:e=>(0,l.rM)(e)})}},59574:(e,t,n)=>{n.d(t,{V:()=>i});var a=n(33624),r=n(13343),o=n(16685);let i=(0,r.A)((0,o.lt)(e=>({contextForwardState:{contextReceivedPortfolioId:null},setContextForwardState:t=>e(e=>({contextForwardState:a.jp7(e.contextForwardState,t)})),resetContextForwardState:()=>e({contextForwardState:{contextReceivedPortfolioId:null}})}),{name:"OverhaulRecommendationsContextForwardStore"}))},60192:(e,t,n)=>{n.d(t,{A:()=>u,k:()=>m});var a=n(57090),r=n(12115),o=n(54523),i=n(43948),l=n(98870),s=n(95505);let{useUpsertGroupLaunchEventListener:c,emitUpsertGroupLaunchEvent:d}=(0,i.createEvent)("UpsertGroupLaunchEvent")(),u=()=>{let[e,t]=(0,r.useState)(null),n=r.useRef(l.A);c(e=>{let{onCloseCallback:a}=e;t(e.portfolioGroup),n.current=a||l.A});let i=()=>{t(null),n.current(),n.current=l.A};return e?(0,a.Y)(o.A,{portfolioGroup:e,onCancel:i,onSuccess:i,"data-sentry-element":"UpsertGroup","data-sentry-component":"GlobalUpsertGroupLauncher","data-sentry-source-file":"GlobalUpsertGroupLauncher.tsx"}):null},m=()=>{let{getPortfolioGroupByPortfolioId:e}=(0,s.A)();return{launchUpsertGroup:e=>{d({portfolioGroup:e})},launchUpsertByPortfolioId:t=>{let n=e(t);n&&d({portfolioGroup:n})}}}},60808:(e,t,n)=>{n.d(t,{CB:()=>m,G6:()=>g,T1:()=>h,XA:()=>f,bd:()=>p,ci:()=>u,q1:()=>d,yD:()=>y,yn:()=>v});var a=n(32189),r=n(33624),o=n(42463),i=n(8662),l=n(544),s=n(73156);let c=(e,t)=>Math.ceil(e*t),d=(e,t)=>{if(!t)return 0;switch(t.deltaMode){case s.s.Absolute:return t.deltaValueSuggested;case s.s.Fraction:return c(e,t.deltaValueSuggested)}},u=(e,t)=>{if(!t)return 0;switch(t.deltaMode){case s.s.Absolute:return r.vUk(t.deltaValueSuggested,t.deltaValueModified);case s.s.Fraction:return c(e,r.vUk(t.deltaValueSuggested,t.deltaValueModified))}},m=(e,t,n,a)=>{var o;if(r.AU6(a))return"";let s=(0,i.T)(e,t);return -1>r.vUk(0,null==(o=(0,l.l5)(s))?void 0:o.amount)?"; your portfolio is now leveraged":" and your overall cash balance was ".concat("add"===n?"decreased":"reduce"===n?"increased":"adjusted"," by the same amount")},p=e=>{let{preliminarySuggestedChanges:t,suggestedSecurityActionItem:n,subsequentSuggestedChanges:a}=e;return[...t,...n?[n]:[],...a]},y=e=>{let{preliminarySuggestedChanges:t,subsequentSuggestedChanges:n}=e;return o.A([...t,...n])},h=e=>e.amount<0,f=e=>e.amount>0,g=e=>r.pbD(h,e),v=e=>{if(e.buySell!==a.hT.SellBuy&&e.buySell!==a.hT.BuySell)return{sellTicker:null,buyTicker:null};let t=p({preliminarySuggestedChanges:e.preliminarySuggestedChanges,suggestedSecurityActionItem:e.suggestedSecurityActionItem,subsequentSuggestedChanges:e.subsequentSuggestedChanges}),n=r.pbD(h,t),o=r.pbD(f,t);return{sellTicker:n.length>0?n[0].displayTicker||n[0].ticker:null,buyTicker:o.length>0?o[0].displayTicker||o[0].ticker:null}}},61299:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(57090);n(12115);var r=n(11325),o=n(10691);let i=e=>(0,a.FD)(o.K6,{"data-sentry-element":"OptimalAmountContainer","data-sentry-component":"CalculatedOptimalAmountHelper","data-sentry-source-file":"CalculatedOptimalAmountHelper.tsx",children:["Calculated optimal amount:"," ",(0,a.Y)("b",{children:(0,a.Y)(r.eF,{amount:e.optimalAmount,sourceCurrency:e.sourceCurrency,targetCurrency:e.targetCurrency,"data-sentry-element":"CurrencyAmount","data-sentry-source-file":"CalculatedOptimalAmountHelper.tsx"})})]})},61422:(e,t,n)=>{n.d(t,{A:()=>eo});var a=n(57090),r=n(33624),o=n(12115),i=n(62570),l=n(31272),s=n(70432),c=n(92672);let d=(0,i.A)("div",{target:"e139e4ok0"})("font-style:normal;font-weight:500;font-size:16px;line-height:24px;color:",e=>e.theme.colors.neutral900,";"),u=e=>(0,a.Y)(c.Ah,{flexDirection:"row",justifyContent:"flex-start",flexWrap:"wrap",alignItems:"flex-start",alignContent:"flex-start",itemsSpacingVertical:16,marginTop:8,occupyParentWidth:!0,...e,"data-sentry-element":"FlexLayout","data-sentry-component":"OverviewRow","data-sentry-source-file":"atoms.tsx",children:e.children}),m=e=>(0,a.Y)(c.Ah,{...e,flex:"1 0 33%",maxWidth:"33%","data-sentry-element":"FlexLayout","data-sentry-component":"OverviewRowContentBlock","data-sentry-source-file":"atoms.tsx",children:e.children}),p=(0,i.A)(c.Ah,{target:"e139e4ok1"})("div:first-of-type{font-weight:700;font-size:20px;line-height:1.2;letter-spacing:-0.4px;color:",e=>e.theme.colors.neutral800,";}div:last-child{font-weight:normal;font-size:14px;line-height:1.4;color:",e=>e.theme.colors.neutral900,";}"),y=e=>(0,a.Y)(p,{flexDirection:"column",justifyContent:"center",flexWrap:"nowrap",alignItems:"center",alignContent:"center",textAlign:"center",equalWidthItems:!0,...e,"data-sentry-element":"StyledBlockContentContainer","data-sentry-component":"BlockContent","data-sentry-source-file":"atoms.tsx",children:e.children}),h=e=>(0,a.Y)(c.Ah,{flexDirection:"column",flexWrap:"nowrap",justifyContent:"flex-start",alignItems:"stretch",occupyParentWidth:!0,equalWidthItems:!0,...e,"data-sentry-element":"FlexLayout","data-sentry-component":"OverviewSecondarySectionContainer","data-sentry-source-file":"atoms.tsx",children:e.children}),f=(0,i.A)("div",{target:"e139e4ok2"})("font-style:normal;font-weight:500;font-size:16px;line-height:24px;display:flex;align-items:flex-start;color:",e=>e.theme.colors.neutral900,";");var g=n(74547),v=n(35208),x=n(56490),A=n(54519),S=n(94119),b=n(31624),C=n(27234),I=n(67883),w=n(22462),P=n(34537),k=n(544);let F=e=>{let{ticker:t,displayTicker:n,investment:a,proxyTicker:o,isTickerTrackedInitially:i,assetType:l}=(0,I.Fn)(e),s=r.vUk("",t),c={ticker:s,displayTicker:r.vUk(s,n),displayName:a,isTickerTrackedInitially:i,proxyTicker:o,assetType:l,networthDetail:null},{isSecurityProxied:d,isUntrackedSecurity:u,isUntrackedWithEmptySeriesName:m,isPotentiallyUnknownSecurity:p,isInternalSecurity:y}=(0,P.Ot)(c),h=w.A(o)&&w.A(o.proxyTicker),f=!h&&w.A(o),g=f&&w.A(null==o?void 0:o.expectedReturn),v=f&&w.A(null==o?void 0:o.expectedRisk),x=h&&!y,A=(0,k.vQ)(e.assetType),S=(0,k.nv)(e.assetType),b=x&&o?o.proxyTicker:n;return{investmentItem:c,isSecurityProxied:d,isUntrackedSecurity:u,isUntrackedWithEmptySeriesName:m,isPotentiallyUnknownSecurity:p,isInternalSecurity:y,isTickerProxyMapped:h,isNonInternalProxiedSecurity:x,isCustomizedSecurity:f,isExpectedReturnsCustomModified:g,isRiskCustomModified:v,isRealEstateTicker:A,isPrivateEquityTicker:S,overviewTicker:b}};var T=n(36934),E=n(41784),Y=n(84978),D=n(67297),R=n(61435),N=n(81671);let M=e=>(0,a.FD)("span",{className:"whitespace-nowrap","data-sentry-component":"SecurityProfileTitleLink","data-sentry-source-file":"SecurityProfileTitleLink.tsx",children:["⁠",(0,a.FD)(s.A,{href:(0,A.RZ)(e.ticker),openInNewTab:!0,noUnderline:!0,className:"ml-2","data-sentry-element":"Link","data-sentry-source-file":"SecurityProfileTitleLink.tsx",children:[(0,a.Y)(R.I,{icon:N.$.SquareArrowTopRight,size:20,className:"inline-block align-middle","data-sentry-element":"Icon","data-sentry-source-file":"SecurityProfileTitleLink.tsx"}),(0,a.FD)("span",{className:"sr-only",children:["View ",e.ticker," full profile"]})]})]}),L=e=>{let{investmentItem:t,isNonInternalProxiedSecurity:n,isRealEstateTicker:r,overviewTicker:o}=F(e.data),{netWorthDetail:i}=e,l=(()=>
3{if(n)return"This security is proxied by ".concat(o);if(r)return"Real estate assumptions are modeled using region-specific historical real estate performance, combined with leverage from your mortgage.";if(i)switch(i.investmentType){case Y.q8.PrivateEquityCompanyEquity:case Y.q8.PrivateEquityStartupInvestment:case Y.q8.PrivateVentureFund:case Y.q8.PrivateEquityPrivateCredit:case Y.q8.PrivateEquityRealAsset:case Y.q8.PrivateEquityOperatingBusiness:case Y.q8.PrivateEquityCustom:{let e=D.jN[i.investmentType].typeLabel;return"".concat(e," are modeled using leveraged return and risk tied to a sector-specific equities index (default to tech sector if not selected)")}case Y.q8.OtherAssetLoan:return"Loan assumptions are modeled using current government interest rates";case Y.q8.OtherAssetAutomotive:return"Automotive assumptions are based on 0% interest cash";case Y.q8.OtherAssetsPhysicalMetals:case Y.q8.OtherAssetsPreciousGemstones:{let e=i.investmentType===Y.q8.OtherAssetsPhysicalMetals?"Physical metals":"Precious gemstones";return"".concat(e," are modeled using leveraged return and risk tied to a precious metals index")}case Y.q8.OtherAssetNFTs:return"NFT assumptions are modeled using leveraged return and risk tied to a cryptocurrencies index";case Y.q8.OtherAssetJewelry:return"Jewelry assumptions are modeled using a precious metals index"}return null})(),s=e.data.assetType===Y.PW.Options,c=(0,k.gN)(t.ticker,t.assetType),d=e.fullProfileTicker&&!c?(0,a.Y)(M,{ticker:e.fullProfileTicker}):null;return s?(0,a.FD)("div",{className:"text-center",children:[(0,a.Y)(C.i,{investmentItem:{...t,networthDetail:i},textWrapperProps:{lines:3,className:(0,E.cn)(T.gI.h3W700,"text-heading")},extraLabelSuffix:d}),e.data.optionExpiryDate?(0,a.FD)(T.cO,{className:(0,E.cn)("text-neutral-500","text-center"),children:["Exp. ",e.data.optionExpiryDate]}):null]}):(0,a.FD)("div",{className:"text-center","data-sentry-component":"ExplorationContentSecurityLabel","data-sentry-source-file":"ExplorationContentSecurityLabel.tsx",children:[(0,a.Y)(C.i,{investmentItem:{...t,networthDetail:i},textWrapperProps:{lines:3,className:(0,E.cn)(T.gI.h3W700,"text-heading")},extraLabelSuffix:d,"data-sentry-element":"ProxyContextualSecurityLabel","data-sentry-source-file":"ExplorationContentSecurityLabel.tsx"}),(0,a.Y)(T.cO,{className:(0,E.cn)("text-neutral-500","text-center"),"data-sentry-element":"CaptionW400","data-sentry-source-file":"ExplorationContentSecurityLabel.tsx",children:l})]})};var _=n(16528),O=n(4122),W=n(62212),B=n(84245),U=n(13641),z=n(8106),V=n(40248);let j=e=>{let{data:t,netWorthDetail:n,onExternalSecurityActionInitiated:r,editSecurityOverrideAction:i}=e,{workflowVisible:l,workflowParams:s,launchSecurityProxyExclusiveSetupWorkflow:c,exitWorkflow:d}=(0,O.q)(),{refreshUserPortfolios:u}=(0,z.Z)(),m=(0,W.j)(),{ticker:p,investment:y}=(0,I.Fn)(t),h=p&&_.A(p),f=async()=>{if(i){await i(),r();return}h&&await c({ticker:p,investment:y,networthDetail:n})},g=()=>{h&&(u(),m.invalidateQueries(B.Dh.investmentValue(p)))};return(0,a.FD)(o.Fragment,{children:[h?(0,a.Y)(V.A,{onClick:f,children:"Edit security"}):null,l&&s?(0,a.Y)(U.N,{...s,onProxyMappingUpserted:g,onProxyMappingRemoved:g,onClose:d,onExternalSecurityActionInitiated:()=>{r(),d()}}):null]})};var H=n(42597),q=n(89568);let G=(0,i.A)(H.f,{target:"e17acl0s0"})(".ant-popover-inner,.ant-popover-inner-content{*{color:",e=>e.theme.colors.white,";}}"),K=e=>(0,a.Y)(G,{...e,color:"#000000D9","data-sentry-element":"StyledPopover","data-sentry-component":"GPDisclaimerPopover","data-sentry-source-file":"GPDisclaimerPopover.tsx",children:e.children?e.children:(0,a.Y)("span",{role:"button",tabIndex:0,"aria-label":"More information",style:{cursor:"pointer"},children:(0,a.Y)(q.xN,{})})});var Q=n(59268),$=n(8305),X=n(39504),J=n(35820),Z=n(15039),ee=n(87449);let et=e=>{let{data:t}=e,{displayTicker:n,proxyDetails:r,fundInfo:i,seriesType:s,securityInfo:c}=t,{authenticated:p}=(0,X.X6)(),{isNonInternalProxiedSecurity:h,isExpectedReturnsCustomModified:g,isRiskCustomModified:v}=F(t),x=h&&r?r.proxyTicker:n,A=p?[]:J.mV,S=null==c?void 0:c.description,b=t.assetType===Y.PW.Options,C=s===ee.Oi.ETFOrMutualFund,I=e=>(0,Z.N)(A,e),w=g?"(modified)":t.isPartiallyTaxEquivalentReturn?"(partly tax-equivalent)":t.isTaxEquivalentReturn?"(tax-equivalent)":null,P=(0,l.pv)(t.taxRateUsed,{formatToPercent:!0,fractionDigits:1}),k=(0,l.$P)(t.taxFreeYield),D=(0,l.pv)(t.taxableShare,{formatToPercent:!0,fractionDigits:0}),R=(0,l.pv)(t.taxEquivalentReturn,{formatToPercent:!0,fractionDigits:1}),N=t.isPartiallyTaxEquivalentReturn?(0,a.FD)(o.Fragment,{children:["Tax-sheltered fund: its ",k," yield is worth about ",R," before tax at your ",P," marginal rate. ",D," of this holding is in taxable accounts, and PortfolioPilot applies that tax-equivalent return to that share here and everywhere in the app so it compares fairly with taxable funds. ",(0,a.Y)(Q.Y,{})]}):t.isTaxEquivalentReturn?(0,a.FD)(o.Fragment,{children:["Tax-sheltered fund: its ",k," yield is worth about ",R," before tax at your ",P," marginal rate. PortfolioPilot uses this tax-equivalent return here and everywhere in the app so it compares fairly with taxable funds. ",(0,a.Y)(Q.Y,{})]}):(0,a.FD)(o.Fragment,{children:["12-month forecasted returns derived from the underlying Global Predictions models. See Technology, Methods, or FAQs for more detail. ",(0,a.Y)(Q.Y,{"data-sentry-element":"GPDisclosuresLink","data-sentry-source-file":"ExplorationOverview.tsx"})]}),M=t.isPartiallyTaxEquivalentReturn?(0,a.FD)(o.Fragment,{children:["Tax-sheltered fund: ",D," of this holding is in taxable accounts, so expected returns are shown partly tax-equivalent at your ",P," marginal rate, here and everywhere in PortfolioPilot."]}):t.isTaxEquivalentReturn?(0,a.FD)(o.Fragment,{children:["Tax-sheltered fund: expected returns are shown as tax-equivalent at your ",P," marginal rate, here and everywhere in PortfolioPilot."]}):null;return(0,a.FD)(d,{"data-sentry-element":"ExplorationContentOverviewContainer","data-sentry-component":"ExplorationOverview","data-sentry-source-file":"ExplorationOverview.tsx",children:[(0,a.Y)(f,{"data-sentry-element":"ExplorationContentSubTitle","data-sentry-source-file":"ExplorationOverview.tsx",children:"Overview"}),S&&(0,a.Y)(T.km,{className:(0,E.cn)("text-body","py-3"),children:S}),(0,a.FD)(u,{"data-sentry-element":"OverviewRow","data-sentry-source-file":"ExplorationOverview.tsx",children:[C?(0,a.Y)(m,{children:(0,a.FD)(y,{children:[(0,a.Y)("div",{children:(0,l.pv)(null==i?void 0:i.expenseRatio,{formatToPercent:!0,fractionDigits:2})}),(0,a.Y)("div",{children:"Expense ratio"})]})}):x&&!b?(0,a.Y)(m,{children:(0,a.FD)(y,{children:[(0,a.Y)("div",{children:x}),(0,a.Y)("div",{children:"Ticker"})]})}):null,(0,a.Y)(m,{"data-sentry-element":"OverviewRowContentBlock","data-sentry-source-file":"ExplorationOverview.tsx",children:(0,a.FD)(y,{fontWeight:g?"bold":void 0,"data-sentry-element":"BlockContent","data-sentry-source-file":"ExplorationOverview.tsx",children:[(0,a.FD)("div",{children:[(0,a.FD)(Z.B,{columnKey:J.lT.ExpectedReturns,locked:I(J.lT.ExpectedReturns),"data-sentry-element":"SecurityAttributeProtectedDisplay","data-sentry-source-file":"ExplorationOverview.tsx",children:[(0,l.ad)(t.roi,{formatToPercent:!0})," "]}),(0,a.Y)(K,{content:N,overlayInnerStyle:{maxWidth:"196px"},"data-sentry-element":"GPDisclaimerPopover","data-sentry-source-file":"ExplorationOverview.tsx"})]}),(0,a.Y)("div",{children:"Exp. returns"}
3),w?(0,a.Y)(T.xp,{className:(0,E.cn)("text-neutral-500"),children:w}):null]})}),t.beta?(0,a.Y)(m,{children:(0,a.FD)(y,{children:[(0,a.FD)("div",{className:"inline-flex items-center gap-1",children:[(0,a.Y)(Z.B,{columnKey:J.lT.Beta,locked:I(J.lT.Beta),children:(0,l.Hh)(t.beta)}),(0,a.Y)(q.ID,{title:"The systemic risk of the security compared to the market as a whole (1 = strong co-movement, 0 = no co-movement)"})]}),(0,a.Y)("div",{children:"Beta"})]})}):null,(0,a.Y)(m,{"data-sentry-element":"OverviewRowContentBlock","data-sentry-source-file":"ExplorationOverview.tsx",children:(0,a.FD)(y,{fontWeight:v?"bold":void 0,"data-sentry-element":"BlockContent","data-sentry-source-file":"ExplorationOverview.tsx",children:[(0,a.FD)("div",{className:"inline-flex items-center gap-1",children:[(0,a.Y)(Z.B,{columnKey:J.lT.Volatility,locked:I(J.lT.Volatility),"data-sentry-element":"SecurityAttributeProtectedDisplay","data-sentry-source-file":"ExplorationOverview.tsx",children:(0,l.Sy)(t.risk,{formatToPercent:!0})}),(0,a.Y)(q.ID,{title:"1 standard deviation volatility of the security","data-sentry-element":"InfoTooltip","data-sentry-source-file":"ExplorationOverview.tsx"})]}),(0,a.Y)("div",{children:"Risk"}),v?(0,a.Y)(T.xp,{className:(0,E.cn)("text-neutral-500"),children:"(modified)"}):null]})}),"Financial Markets"===t.category?(0,a.Y)(m,{children:(0,a.FD)(y,{children:[(0,a.FD)("div",{className:"inline-flex items-center gap-1",children:[(0,a.Y)(Z.B,{columnKey:J.lT.SharpeRatio,locked:I(J.lT.SharpeRatio),children:(0,l.zA)(t.sharpeRatio)}),(0,a.Y)(q.ID,{title:$.VV})]}),(0,a.Y)("div",{children:"Sharpe Ratio"})]})}):null,(0,a.Y)(m,{"data-sentry-element":"OverviewRowContentBlock","data-sentry-source-file":"ExplorationOverview.tsx",children:(0,a.FD)(y,{"data-sentry-element":"BlockContent","data-sentry-source-file":"ExplorationOverview.tsx",children:[(0,a.FD)("div",{className:"inline-flex items-center gap-1",children:[(0,l.$P)(t.dividendYield),(0,a.Y)(q.ID,{title:$.FY,"data-sentry-element":"InfoTooltip","data-sentry-source-file":"ExplorationOverview.tsx"})]}),(0,a.Y)("div",{children:"Dividend yield"})]})})]}),M?(0,a.Y)(T.km,{className:(0,E.cn)("text-body","pt-3"),children:M}):null]})};var en=n(37899);let ea=(0,i.A)(g.Ah,{target:"edywcq00"})();var er=function(e){return e.Drivers="Drivers",e.RelatedSecurities="RelatedSecurities",e}(er||{});let eo=e=>{var t,n;let{data:i,netWorthDetail:c,onExternalSecurityActionInitiated:d,editSecurityOverrideAction:u,hideEdit:m=!1,hideHeaders:p=!1}=e,{authenticated:y}=(0,X.X6)();return(0,a.FD)(ea,{display:"block",itemsSpacingVertical:16,equalWidthItems:!0,boxSizing:"border-box","data-sentry-element":"Container","data-sentry-component":"InvestmentExplorationContent","data-sentry-source-file":"Content.tsx",children:[p?null:(0,a.Y)(L,{data:i,netWorthDetail:c,fullProfileTicker:e.fullProfileTicker}),(0,a.Y)(et,{data:i,"data-sentry-element":"ExplorationOverview","data-sentry-source-file":"Content.tsx"}),e.renderOverviewFooter?e.renderOverviewFooter():null,i.assetType===Y.PW.Options?(0,a.Y)(T.cO,{className:(0,E.cn)("text-neutral-500","text-center"),children:"We use the Black-Scholes model to estimate the fair market value and potential downside based on volatility, time, and price."}):null,y&&!m?(0,a.Y)(g.Ah,{justifyContent:"center",alignItems:"center",children:(0,a.Y)(j,{editSecurityOverrideAction:u,data:i,netWorthDetail:c,onExternalSecurityActionInitiated:d})}):null,r.AU6(r.gD_(i.chartData))?(0,a.FD)(h,{children:[(0,a.Y)(f,{children:(0,a.Y)(x.A,{label:"Performance",title:"Price is indexed to 1.0 on today's date. Differences from the index value represent total returns (including dividends), so a value of 1.1 one year into the future represents a +10% expected total return one year hence, and a value of 1.1 one year into the past means the asset value has fallen -10% between then and now."})}),(0,a.Y)(S.A,{...i.chartData,hideHeading:!0,stripForecastsData:!y,chartLanguage:b.z.Trend})]}):null,(null==(t=i.drivers)?void 0:t.length)?(0,a.FD)(h,{children:[(0,a.Y)(f,{children:(0,a.Y)(x.A,{label:"Macro drivers",title:"Most influential macroeconomic drivers for the security"})}),(0,a.Y)(g.XI,{dataSource:r.vUk([],i.drivers),rowKey:e=>e.driver,pagination:!1,columns:(e=>[{title:(0,a.Y)(o.Fragment,{children:"Investment"}),dataIndex:"driver",key:"driver",render:(e,t)=>(0,a.FD)(o.Fragment,{children:[e||v.UZ," ",t.ticker&&"(".concat(t.ticker,")")]}),width:"60%"},{title:(0,a.Y)(o.Fragment,{children:"Drivers"===e?"Change":"RelatedSecurities"===e?"Returns":null}),dataIndex:"roi",key:"roi",render:e=>(0,a.Y)(o.Fragment,{children:(0,l.ad)(e,{formatToPercent:!1})}),width:"20%"},{title:(0,a.Y)(o.Fragment,{children:"Risk"}),dataIndex:"risk",key:"risk",render:e=>(0,a.Y)(o.Fragment,{children:(0,l.Sy)(e,{formatToPercent:!1})}),width:"20%"}])("Drivers")})]}):null,(null==(n=i.relatedSecurities)?void 0:n.length)?(0,a.FD)(h,{children:[(0,a.Y)(f,{children:"Related securities"}),(0,a.Y)("div",{children:r.TjK(e=>(0,a.Y)(s.A,{openInNewTab:!0,href:(0,A.RZ)(e),children:e},e),i.relatedSecurities)})]}):null,(0,a.Y)(g.Ah,{justifyContent:"center",alignItems:"center",className:"mt-6","data-sentry-element":"FlexLayout","data-sentry-source-file":"Content.tsx",children:(0,a.FD)(en.o,{ticker:i.tickerValue||"","data-sentry-element":"ReportSecurityIssueLink","data-sentry-source-file":"Content.tsx",children:["Report issue with ",i.displayTicker||i.tickerValue||"this security"]})})]})}}
3,61443:(e,t,n)=>{n.d(t,{i:()=>c});var a=n(39793),r=n(55606),o=n(65879),i=n(40759),l=n(6038),s=n(31695);let c=e=>{let{isPortfolioMain:t,isPortfolioGroup:n,isPortfolioCurrent:c,isPortfolioDraft:d}=(0,a.M)(e),{launchManualPortfolioEdit:u}=(0,r.I)(e),{launchPortfolioDetails:m}=(0,i.D)(e),{launchDraftPortfolioEditDrawer:p}=(0,l.n)(e),{isInvestmentsEditable:y}=(0,o.S)(e.portfolioId),{openNetworthPage:h,openGroupsPage:f}=(0,s.E)(),g=!y&&c,v=async()=>{t?await h():g?m():n?await f():d?await p():y?await u():console.error("PortfolioTableActionContainer: Unhandled portfolio type",{portfolio:e})};return{isPortfolioCurrent:c,isPortfolioMain:t,isPortfolioGroup:n,isInvestmentsEditable:y,isNonEditableCurrentPortfolio:g,portfolioTableActionClickHandler:v}}},61805:(e,t,n)=>{n.d(t,{K:()=>l});var a=n(64755),r=n(33624),o=n(73496),i=n(4338);let l=e=>{let{portfolioId:t}=e,{isFeatureAccessible:n}=(0,o.R)(i.JP.PersonalizedRecommendations),{isPortfolioRecommendationsDisabled:l,disabledReason:s}=(0,a.K)(t),c=r.gD_(l),d=!n||l,u=r.aIS(d,!1);return{isPortfolioRecommendationsDisabled:d,isPortfolioRecommendationsEnabled:u,isDisabledFlagLoading:c,disabledReason:s}}},61972:(e,t,n)=>{n.d(t,{d:()=>c});var a=n(9620),r=n.n(a),o=n(33624);let i={};var l=n(99026);let s=(e,t)=>{(0,l.KV)()||console.log("[SocketManager]: ".concat(e),t||"")};class c{static getInstance(){return c.instance||(c.instance=new c),c.instance}initialize(e){this.pusher||(this.pusher=new(r())(e.socketAppKey,{cluster:e.socketCluster}),this.channel=this.pusher.subscribe("updates".concat(e.userId)),this.pusher.connection.bind("state_change",e=>{this.connectionState=e.current,s("Connection state: ".concat(e.previous," → ").concat(e.current)),"connected"===e.current&&(this.hasEverConnected&&"connected"!==e.previous&&this.fireReconnectListeners(),this.hasEverConnected=!0)}))}getConnectionState(){return this.connectionState}onReconnect(e){return this.reconnectListeners.add(e),()=>{this.reconnectListeners.delete(e)}}fireReconnectListeners(){s("Reconnect detected — firing ".concat(this.reconnectListeners.size," listener(s)")),this.reconnectListeners.forEach(e=>{try{e()}catch(e){console.error("[SocketManager]: reconnect listener threw",e)}})}_resetConnectionStateForTests(){this.connectionState="initialized",this.hasEverConnected=!1,this.reconnectListeners.clear(),this.seenEvents.clear()}acceptEvent(e,t){let n=this.seenEvents.get(e);if(void 0===n&&(n=new Set,this.seenEvents.set(e,n),this.seenEvents.size>512)){let e=this.seenEvents.keys().next().value;void 0!==e&&this.seenEvents.delete(e)}if(n.has(t))return!1;if(n.add(t),n.size>256){let e=n.values().next().value;void 0!==e&&n.delete(e)}return!0}computeSlotKey(e,t){if(null===t||"object"!=typeof t)return"".concat(e,"||");let n=t.portfolio_id,a="number"==typeof n||"string"==typeof n?String(n):"",r="string"==typeof t.variant_key?t.variant_key:"";return"".concat(e,"|").concat(a,"|").concat(r)}subscribe(e,t){if(!this.channel)return void console.error("[SocketManager]: Not initialized to subscribe to event: ",{event:e});this.listeners[e]||(s('Binding event handler for "'.concat(e,'" to channel "').concat(this.channel.name,'"')),this.listeners[e]=[],this.channel.bind(e,t=>{if(t&&"object"==typeof t&&"is_chunked_socket_message"in t&&!0===t.is_chunked_socket_message){if(t.original_message_type===e){let n=(e=>{let{original_message_type:t,chunk_group_id:n,chunk_index:a,total_chunks:r}=e;if((()=>{let e=Date.now();for(let t of Object.keys(i)){let n=i[t];e-n.createdAt>3e4&&(console.warn("[socketChunkHandler] Cleaning up stale chunk group: ".concat(t),{messageType:n.messageType,receivedCount:n.receivedCount,totalChunks:n.totalChunks,ageMs:e-n.createdAt}),delete i[t])}})(),!n)return console.error("[socketChunkHandler] Missing chunk_group_id in chunked message:",{messageType:t,chunkIndex:a,totalChunks:r}),null;i[n]||(i[n]={chunks:Array(r).fill(null),receivedCount:0,totalChunks:r,messageType:t,createdAt:Date.now()});let l=i[n];if(l.totalChunks!==r)return console.error("[socketChunkHandler] Chunk total_chunks mismatch:",{chunkGroupId:n,expectedTotalChunks:l.totalChunks,receivedTotalChunks:r}),null;o.gD_(l.chunks[a])?(l.chunks[a]=e,l.receivedCount++,console.log("[socketChunkHandler] Received chunk ".concat(a+1,"/").concat(r," for ").concat(t," (group: ").concat(n.slice(0,8),"...)"))):console.log("[socketChunkHandler] Duplicate chunk ".concat(a+1,"/").concat(r," received for ").concat(t," (group: ").concat(n.slice(0,8),"...)"));let s=l.chunks.some(e=>null===e);if(l.receivedCount===l.totalChunks&&!s)try{var c;let e=l.chunks.sort((e,t)=>
3e.chunk_index-t.chunk_index);if(e.some((e,t)=>e.chunk_index!==t))throw Error("Invalid chunk indices detected. Expected sequential indices 0-".concat(r-1,", got: ").concat(e.map(e=>e.chunk_index).join(",")));let a="";for(let t of e)a+=t.data;if(!a||a.length%2!=0)throw Error("Invalid hex data length: ".concat(a.length));let o=new Uint8Array((null==(c=a.match(/.{1,2}/g))?void 0:c.map(e=>parseInt(e,16)))||[]);if(0===o.length)throw Error("Failed to convert hex data to binary");let s=new TextDecoder("utf-8").decode(o);if(!s||""===s.trim())throw Error("Decoded JSON string is empty");let d=JSON.parse(s);return console.log("[socketChunkHandler] Successfully reconstructed message for ".concat(t," (group: ").concat(n.slice(0,8),"...)")),delete i[n],d}catch(e){console.error("[socketChunkHandler] Error processing chunked message:",{error:e instanceof Error?e.message:String(e),messageType:t,chunkGroupId:n,totalChunks:r,receivedCount:l.receivedCount,chunkIndices:l.chunks.map(e=>null==e?void 0:e.chunk_index),combinedDataLength:l.chunks.reduce((e,t)=>{var n;return e+((null==t||null==(n=t.data)?void 0:n.length)||0)},0)}),delete i[n]}return null})(t);n&&this.dispatchIfNotDuplicate(e,n)&&s("Processed chunked data for event: ".concat(e),{completeMessage:n})}}else this.dispatchIfNotDuplicate(e,t)&&s("Listeners called for event: ".concat(e),{listenersCount:this.listeners[e].length})})),this.listeners[e].push(t)}dispatchIfNotDuplicate(e,t){let n=this.extractEventToken(t);if(null!==n){let a=this.computeSlotKey(e,t);if(!this.acceptEvent(a,n))return s("Skipping duplicate for event: ".concat(e)),!1}return this.listeners[e].forEach(e=>e(t)),!0}extractEventToken(e){if(null===e||"object"!=typeof e)return null;let t=e.event_id,n=e.notification_id;return"number"==typeof t&&Number.isFinite(t)&&"number"==typeof n&&Number.isFinite(n)?"".concat(t,":").concat(n):null}unsubscribe(e,t){this.channel&&this.listeners[e]&&(this.listeners[e]=this.listeners[e].filter(e=>e!==t),s("Unsubscribed callback from event: ".concat(e),{listenersCount:this.listeners[e].length}),0===this.listeners[e].length&&(this.channel.unbind(e),delete this.listeners[e],s("Unbound event: ".concat(e))))}clearListeners(e){this.channel&&this.listeners[e]&&(this.channel.unbind(e),delete this.listeners[e])}static reset(){if(c.instance){if(c.instance.channel)for(let e in c.instance.listeners)c.instance.channel.unbind(e);c.instance.listeners={},c.instance.pusher=null,c.instance.channel=null,c.instance.connectionState="initialized",c.instance.hasEverConnected=!1,c.instance.reconnectListeners.clear(),c.instance.seenEvents.clear(),c.instance=null}}constructor(){this.pusher=null,this.channel=null,this.listeners={},this.connectionState="initialized",this.hasEverConnected=!1,this.reconnectListeners=new Set,this.seenEvents=new Map}}c.instance=null},62346:(e,t,n)=>{n.d(t,{IJ:()=>q,aV:()=>G,Ly:()=>R,OM:()=>Q,_F:()=>Z,fE:()=>ee,nK:()=>B,Ii:()=>J,eD:()=>et,wM:()=>$,uv:()=>_,CB:()=>M,vp:()=>D,CR:()=>X,z_:()=>E,wj:()=>W,dI:()=>L,qE:()=>F,Lp:()=>k,L:()=>O,h3:()=>V,$c:()=>U,zl:()=>K,U:()=>en,Un:()=>N,Iu:()=>Y,NB:()=>T,mo:()=>H,_n:()=>j});var a=n(33624),r=n(92332),o=n(16528),i=n(92283),l=n(12115),s=n(33573),c=n(4603),d=n(79073),u=function(e){return e.Start="start",e.CompleteSuccess="completeSuccess",e.Clear="clear",e.None="none",e}({}),m=n(84245),p=n(80067),y=n(72347),h=n(51164),f=n(48298),g=n(7895),v=n(9932),x=n(17667),A=n(33223),S=n(99026),b=n(35208),C=n(50202),I=n(31260),w=n(61805),P=n(544);let k=e=>(0,s.useQuery)((0,m.BA)(e),()=>(0,p.q1)(e),{enabled:r.A(e),...m.gz}),F=()=>{let e=(0,s.useQueryClient)(),t=async t=>{let n=e.getQueryData((0,m.BA)(t));return o.A(n)?n:await (0,p.q1)(t)};return(0,x.A)(t)},T=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{enableQuery:!0};return(0,h.z)(e,(0,m.pR)(e),()=>(0,p.kP)(e),{enabled:t.enableQuery,...m.gz})},E=(e,t)=>{let{data:n=[],isLoading:a,isFetching:r}=T(e);return{selectedData:t(n),isInitialLoading:a,isFetching:r}},Y=()=>{let{mainPortfolio:e}=(0,C.RW)();return(0,h.z)(e.portfolioId,m.db,p.Ll,{...m.gz})},D=(e,t)=>(0,h.z)(e,(0,m.TF)(e),()=>(0,p.Cr)(e),{...m.gz,enabled:t}),R=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{enableQuery:!0};return(0,h.z)(e,(0,m.o7)(e),()=>(0,p.AP)(e),{enabled:t.enableQuery,...m.gz})},N=(e,t)=>(0,A.A)((0,m.Nd)(e),()=>(0,p.fI)(e),{...m.gz,enabled:t,refetchOnWindowFocus:!1,retry:1}),M=(e,t)=>(0,y.x)(e,(0,m.gw)(e),()=>(0,p.jK)(e),{...m.gz,enabled:t}),L=e=>(0,y.x)(e,(0,m.zz)(e),()=>(0,p.Qx)(e),m.gz),_=e=>(0,h.z)(e,(0,m.rv)(e),()=>(0,p.Px)(e),{useErrorBoundary:!0,...m.gz}),O=e=>{let{hideTaxFeature:t}=(0,I.yf)();return(0,h.z)(e,(0,m.Vj)(e),()=>(0,p.Nl)(e),{enabled:!t,...m.gz})},W=e=>{let t=a.vUk(-1,e);return(0,h.z)(t,(0,m.TU)(t),()=>(0,p.bS)(t),{...m.gz,enabled:i.A(e)})},B=()=>{let{mainPortfolio:e}=(0,C.RW)();return(0,s.useQuery)((0,m.gg)(e.portfolioId),p.Oe,{useErrorBoundary:!0,...m.gz,select:e=>e.filter(e=>!(0,P.t)(e))})},U=e=>{let t=f.IA.DailyUpdate;return(0,h.z)(e,(0,m.Jt)(e),()=>(0,p.pr)(e,t),b.Lo)},z=async(e,t)=>{var n;let a=await f.Ay.getPortfolioTextInsights(e,f.IA.ExDailyUpdate);if("completed"===a.status&&(null==(n=a.payload)?void 0:n.insights))return a.payload.insights;let r=null==t?void 0:t();return(0,v.J)(r)?r:null},V=e=>{let t=f.IA.ExDailyUpdate,n=(0,s.useQueryClient)(),a=[...(0,m.Jt)(e),{filter:t}],r=(0,y.x)(e,a,()=>z(e,()=>n.getQueryData(a)),b.Lo),o=r.data,i=(0,v.J)(o),p=null===o,{hasTimedOut:h,retrigger:x}=(0,g.gH)({queryKey:a,isWaitingForSocket:p,diagnosticLabel:"PortfolioTextInsights",initialPollMs:g.Px}
3),A=h||i,S=Array.isArray(o)?o:[];return((e,t,n,a)=>{let r=l.useRef(null),o=l.useRef(e);l.useEffect(()=>{o.current!==e&&(r.current=null,o.current=e);let i=(e=>e.hasError?e.hasActiveHandle?"clear":"none":e.isWaitingForSocket?e.hasActiveHandle?"none":"start":e.hasActiveHandle?e.hasSettledWithData?"completeSuccess":"clear":"none")({hasActiveHandle:null!==r.current,isWaitingForSocket:t,hasSettledWithData:n,hasError:a});i===u.Start?r.current=(0,d.U7)(d.L_.PortfolioInteractive):i===u.CompleteSuccess?((0,d.jc)(r.current,c.TelemetryEvent.PortfolioInteractive,{success:!0}),r.current=null):i===u.Clear&&(r.current=null)},[e,t,n,a])})(e,p,Array.isArray(o),A),{...r,data:S,isFetching:r.isFetching||p&&!A,hasTextInsightsError:A,hasFailureTerminal:i,hasSocketWaitTimedOut:h,retryTextInsights:x}},j=(e,t)=>{var n;let{isPortfolioRecommendationsEnabled:a}=(0,w.K)({portfolioId:e});return(0,y.x)(e,[...(0,m.oi)(e),null!=(n=null==t?void 0:t.join(","))?n:"all"],()=>(0,p.HT)(e,t),{...m.gz,enabled:a})},H=e=>{let{isPortfolioRecommendationsEnabled:t}=(0,w.K)({portfolioId:e});return(0,h.z)(e,(0,m.Iy)(e),()=>(0,p.H7)(e),{...m.gz,enabled:t})},q=[],G=()=>(0,s.useQuery)(m.u$,p.qF,m.gz),K=e=>(0,s.useQuery)(m.DY,p.EC,{enabled:a.aIS(!!(null==e?void 0:e.disabled),!1)}),Q=e=>{let t=(0,s.useIsFetching)((0,m.Ld)(e));return{isFetching:a.gt(t,0)}},$=(e,t)=>{let n=(0,S.nx)(t);return(0,h.z)(e,(0,m.Om)(e,n),()=>(0,p.J8)(e,n),{...m.gz})},X=(e,t)=>(0,h.z)(e,(0,m.NQ)(e,t),()=>(0,p.ic)(e,t)),J=e=>(0,h.z)(e,(0,m.cM)(e),()=>(0,p.Gq)(e),m.gz),Z=e=>{let{isPortfolioRecommendationsDisabled:t,isPortfolioRecommendationsEnabled:n,isDisabledFlagLoading:a,disabledReason:r}=(0,w.K)({portfolioId:e});return{isPortfolioRecommendationsDisabled:t,isDisabledFlagLoading:a,disabledReason:r,nextInvestmentQueryResult:(0,h.z)(e,(0,m.J_)(e),()=>(0,p.uK)(e),{...m.gz,enabled:n})}},ee=e=>{let{isPortfolioRecommendationsEnabled:t}=(0,w.K)({portfolioId:e});return(0,h.z)(e,(0,m.GX)(e),()=>(0,p.Oo)(e),{...m.gz,enabled:t})},et=()=>(0,x.A)(f.Ay.getComparisonMetric),en=()=>(0,A.A)(m.hh,p.ji,{...m.gz})},62525:(e,t,n)=>{n.d(t,{HT:()=>l,es:()=>i,iS:()=>d,nE:()=>u,wN:()=>m,wc:()=>o,xS:()=>s});var a=n(13340),r=n(84978);let o="Do you have a pension or annuity coming in retirement?",i="We add it to your net worth and count every payout in your plan.",l="These are already in your net worth and counted in your plan.";var s=function(e){return e.No="no",e.AddNow="add_now",e.ThatsAll="thats_all",e.AddAnother="add_another",e}({});let c=(e,t)=>"".concat(a.IK[t]).concat(Math.round(e).toLocaleString("en-US")),d=(e,t)=>{var n,a;let o=null==e?void 0:e.startAge;if((null==e?void 0:e.paidAs)===r.v0.LumpSum)return"".concat(c(null!=(n=e.lumpSumAmount)?n:0,t)," lump sum").concat(null==o?"":" at ".concat(o));let i=(null==e?void 0:e.endMode)===r.rT.Age&&null!==e.endAge&&void 0!==e.endAge?" to ".concat(e.endAge):", for life";return"".concat(c(null!=(a=null==e?void 0:e.monthlyPayout)?a:0,t)," / mo").concat(null==o?"":" from age ".concat(o)).concat(i)},u=e=>{var t;return(null==(t=e.additionalDetail)?void 0:t.name)||"Pension"},m=e=>e.includes("add_now")||e.includes("add_another")},62728:(e,t,n)=>{n.d(t,{A:()=>c,L:()=>s});var a=n(57090);n(12115);var r=n(74547),o=n(36934),i=n(76402),l=n(41784),s=function(e){return e[e.Small=24]="Small",e[e.Large=32]="Large",e}({});let c=e=>{let t=Number(e.iconSize);return(0,a.Y)(r.$n,{fullWidth:!0,variant:"outlined",className:(0,l.cn)("!h-auto min-h-[60px] justify-start px-4 py-2.5",e.highlighted?"!border-blue-600":"!border-divider [--button-fg:var(--color-neutral-800)]"),onClick:e.onClick,"data-sentry-element":"Button","data-sentry-component":"ImportMethodCard","data-sentry-source-file":"ImportMethodCard.tsx",children:(0,a.FD)(r.Ah,{justifyContent:"space-between",alignItems:"center",width:"100%",flexWrap:"nowrap",itemsSpacingHorizontal:16,"data-sentry-element":"FlexLayout","data-sentry-source-file":"ImportMethodCard.tsx",children:[(0,a.FD)(r.Ah,{itemsSpacingHorizontal:16,alignItems:"center",justifyContent:"flex-start",flexWrap:"nowrap","data-sentry-element":"FlexLayout","data-sentry-source-file":"ImportMethodCard.tsx",children:[(0,a.Y)(r.In,{icon:e.icon,className:"shrink-0 text-blue-600",style:{width:t,height:t,minWidth:t,minHeight:t},"data-sentry-element":"Icon","data-sentry-source-file":"ImportMethodCard.tsx"}),(0,a.FD)(r.Ah,{flexDirection:"column",alignItems:"flex-start",itemsSpacingVertical:2,"data-sentry-element":"FlexLayout","data-sentry-source-file":"ImportMethodCard.tsx",children:[(0,a.Y)(o.s9,{className:(0,l.cn)("text-body","text-left"),"data-sentry-element":"Body2W600","data-sentry-source-file":"ImportMethodCard.tsx",children:e.title}),(0,a.Y)(o.km,{className:(0,l.cn)("text-neutral-400","text-left"),"data-sentry-element":"Body2W400","data-sentry-source-file":"ImportMethodCard.tsx",children:e.description})]})]}
3),e.chipLabel?(0,a.Y)(i.vu,{type:i.pb.Accent,variant:i.Qj.Soft,size:i.Sb.Sm,className:"shrink-0",children:e.chipLabel}):null]})})}},62796:(e,t,n)=>{n.d(t,{D:()=>a,v:()=>r});let a="Try changes risk-free in a draft portfolio",r="We'll set up a draft copy of your portfolio so you can model changes and compare before you commit anything."},62830:(e,t,n)=>{n.d(t,{H:()=>c});var a=n(12115),r=n(83910),o=n(76778),i=n(26214),l=n(39510);let s={dismissCount:0,visitCount:0,lastDismissDate:null,isEnabled:!0,cooldownUntil:null},c=()=>{let e=(0,l.RS)(i.mr.ProactiveHelp),[t,n]=(0,r.Ay)(r.Hh.ProactiveHelpSettings,s),c=t.isEnabled,d=a.useMemo(()=>{if(!e||!c)return!1;if(t.cooldownUntil){let e=new Date(t.cooldownUntil);if(new Date<e)return!1}return!(t.dismissCount>=5)},[e,c,t]),u=(0,o.K)(()=>{n(e=>{let t=e.dismissCount+1,n=new Date().toISOString(),a=e.cooldownUntil;if(t>=5){let e=new Date;e.setMonth(e.getMonth()+2),a=e.toISOString()}return{...e,dismissCount:t,lastDismissDate:n,cooldownUntil:a}})}),m=(0,o.K)(e=>{n(t=>({...t,isEnabled:e}))}),p=(0,o.K)(()=>{n(e=>({...e,dismissCount:0,cooldownUntil:null}))});return{settings:t,isProactiveHelpEnabled:c,isFeatureFlagEnabled:e,setProactiveHelpEnabled:m,canShowMascot:d,recordDismissal:u,recordVisit:(0,o.K)(()=>{n(e=>({...e,visitCount:e.visitCount+1}))}),resetDismissals:p}}},63114:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(57090),r=n(85794);n(12115);var o=n(33624),i=n(13340),l=n(35208);let{Option:s}=n(85224).A,c=e=>{let{value:t}=e;return(0,a.Y)(r.G0,{value:t,onSelect:e.onChange,dropdownStyle:{zIndex:l.Bf.select},dropdownMatchSelectWidth:!1,optionLabelProp:"label",dropdownAlign:{offset:[-90,4]},"data-sentry-element":"StyledNetworthCurrencySelect","data-sentry-component":"NetworthCurrencySelect","data-sentry-source-file":"NetworthCurrencySelect.tsx",children:o.TjK(e=>{let t=i.Sj[e],n="".concat(i.gn[e]," (").concat(t,")");return(0,a.Y)(s,{value:t,label:t,children:(0,a.Y)("span",{children:n})},t)},o.HPH(i.Sj))})}},63338:(e,t,n)=>{n.d(t,{D0:()=>o,ZR:()=>r,mp:()=>l,uh:()=>i});var a=n(71754);let r="rounded-[4px] border border-transparent font-sans shadow-[0px_8px_16px_0px_rgba(0,0,0,0.1)]",o="background:".concat(a._C.surface),i={backgroundColor:"transparent",borderWidth:0,shadow:!1,padding:0,shape:"square"},l=e=>'<div class="'.concat(r," ").concat(e.paddingClass,'" style="').concat(o,'">').concat(e.innerHtml,"</div>")},63505:(e,t,n)=>{n.d(t,{Ay:()=>w,UZ:()=>A,Gy:()=>I});var a=n(57090),r=n(12115),o=n(43948),i=n(62212),l=n(74547),s=n(95825),c=n(84970),d=n(36934),u=n(19788),m=n(13340),p=n(11325),y=n(31260),h=n(44619);let f=" \xb7 ",g=e=>{let t=(0,h.OL)(e.accountType);return 0===e.holdingsCount?t:[e.formatAmount(e.totalValue),(e=>"".concat(e," ").concat(1===e?"holding":"holdings"))(e.holdingsCount),t].join(f)},{useGlobalReattachPreviewLaunchEventListener:v,emitGlobalReattachPreviewLaunchEvent:x}=(0,o.createEvent)("GlobalReattachPreviewLaunchEvent")(),{useGlobalReattachCompleteEventListener:A,emitGlobalReattachCompleteEvent:S}=(0,o.createEvent)("GlobalReattachCompleteEvent")();var b=function(e){return e.Remove="remove",e.Keep="keep",e}(b||{});let C=e=>null!==e.portfolioId&&e.source!==u.v.Unmatched&&e.autoSelected,I=()=>({launchReattachPreview:e=>{x(e)}}),w=()=>{let e=(0,i.j)(),{preferredCurrency:t}=(0,y.yf)(),[n,o]=r.useState(null),[h,x]=r.useState([]),[A,b]=r.useState([]),[I,w]=r.useState({}),[P,k]=r.useState({}),[F,T]=r.useState(!1),E=()=>{o(null),x([]),b([]),w({}),k({}),T(!1)};v(async e=>{try{let t=await u.A.reattachPreview({archivedInvestmentAccountId:e.archivedInvestmentAccountId,newInvestmentAccountId:e.newInvestmentAccountId}),n={};t.matches.forEach(e=>{n[e.incomingAccountId]=C(e)?e.portfolioId:0}),x(t.matches),b(t.archivedPortfolios),w(n),o(e)}catch(e){console.error("Reattach preview failed to load; leaving archived connection intact",e),E()}});let Y=async(t,a)=>{if(null===n)return;let r=n.newInvestmentAccountId;T(!0);try{await u.A.reattachApply({archivedInvestmentAccountId:n.archivedInvestmentAccountId,newInvestmentAccountId:r,confirmed:t,leftoverRemovals:a}),await e.invalidateQueries(),E(),S({newInvestmentAccountId:r})}finally{T(!1)}},D=e=>new Set(Object.values(e).filter(e=>0!==e)),R=e=>{let t=D(e);return A.filter(e=>!t.has(e.portfolioId))};if(null===n)return null;let N=D(I),M=R(I),L=e=>(0,p.iS)({amount:e,sourceCurrency:m.mF,preferredCurrency:t,currencyFormatter:p.EB.HumanizedCompactAmount}),_=A.map(e=>({portfolioId:e.portfolioId,label:(e=>"".concat(e.accountName).concat(f).concat(g(e)))({accountName:e.accountName,totalValue:e.totalValue,holdingsCount:e.holdingsCount,accountType:e.accountType,formatAmou
3nt:L})}));return(0,a.Y)(l.aF,{disableSubmitOnEnter:!0,open:!0,onCancel:E,size:s.rI.Md,title:"Double check if everything is correct",footer:(0,a.FD)(s.jl,{children:[(0,a.Y)(l.$n,{variant:"outlined",onClick:()=>Y([],[]),disabled:F,children:"Save as new connection"}),(0,a.Y)(l.$n,{variant:"filled",onClick:()=>Y(Object.entries(I).filter(e=>{let[,t]=e;return 0!==t}).map(e=>{let[t,n]=e;return{incomingAccountId:t,portfolioId:n}}),R(I).filter(e=>{var t;return(null!=(t=P[e.portfolioId])?t:"remove")==="remove"}).map(e=>e.portfolioId)),loading:F,children:"Confirm"})]}),maskClosable:!1,closable:!0,"data-sentry-element":"Modal","data-sentry-component":"GlobalReattachPreviewLauncher","data-sentry-source-file":"GlobalReattachPreviewLauncher.tsx",children:(0,a.FD)("div",{className:"space-y-3",children:[(0,a.Y)(d.km,{className:"text-heading","data-sentry-element":"Body2W400","data-sentry-source-file":"GlobalReattachPreviewLauncher.tsx",children:"Map each reconnected account to one of your existing sub-accounts to keep its settings, or add it as a new sub-account. We've pre-selected the ones we're confident about, and you can adjust any of them below."}),0===h.length?(0,a.Y)(d.km,{className:"text-neutral-500",children:"The reconnection didn't return any accounts."}):h.map(e=>{var t;let n,r=null!=(t=I[e.incomingAccountId])?t:0,o=[{value:0,label:"Add as a new sub-account"},..._.map(e=>({value:e.portfolioId,label:e.label,disabled:e.portfolioId!==r&&N.has(e.portfolioId)}))];return(0,a.FD)("div",{className:"space-y-1 rounded-lg border border-[color:var(--wp-card-border)] p-3",children:[(0,a.Y)(d.lc,{className:"text-heading",children:e.incomingAccountName||"Account"}),(0,a.Y)(d.km,{className:"text-neutral-500",children:g({totalValue:e.incomingTotalValue,holdingsCount:e.incomingHoldingsCount,accountType:e.incomingAccountType,formatAmount:L})}),(0,a.Y)(c.A,{"aria-label":"Map ".concat(e.incomingAccountName||"account"),items:o,value:r,onChange:(n=e.incomingAccountId,e=>{w(t=>({...t,[n]:Number(e)}))}),selectionMode:"single",fullWidth:!0}),C(e)&&(0,a.FD)(d.km,{className:"text-neutral-500",children:["Suggested: ",e.matchedPortfolioName]})]},e.incomingAccountId)}),M.length>0&&(0,a.FD)("div",{className:"space-y-2 pt-2",children:[(0,a.Y)(d.lc,{className:"text-heading",children:"Not in this connection anymore"}),(0,a.Y)(d.km,{className:"text-neutral-500",children:"These sub-accounts weren't part of the reconnection. Remove them, or keep them as manual sub-accounts. Kept sub-accounts stay in your net worth but no longer sync."}),M.map(e=>{var t;let n=null!=(t=P[e.portfolioId])?t:"remove";return(0,a.FD)("div",{className:"space-y-1 rounded-lg border border-[color:var(--wp-card-border)] p-3",children:[(0,a.Y)(d.lc,{className:"text-heading",children:e.accountName}),(0,a.Y)(d.km,{className:"text-neutral-500",children:g({totalValue:e.totalValue,holdingsCount:e.holdingsCount,accountType:e.accountType,formatAmount:L})}),(0,a.Y)(c.A,{"aria-label":"Choose what happens to ".concat(e.accountName),items:[{value:"remove",label:"Remove"},{value:"keep",label:"Keep as a manual sub-account"}],value:n,onChange:t=>k(n=>({...n,[e.portfolioId]:t})),selectionMode:"single",fullWidth:!0})]},e.portfolioId)})]})]})})}},63666:(e,t,n)=>{n.d(t,{A:()=>ec,w:()=>es});var a=n(57090),r=n(12115),o=n(43948),i=n(88963),l=n(13125),s=n.n(l),c=n(62031),d=n.n(c);class u{constructor(){this.detectOptionsForPortfolio=async e=>{let t=await this.apiCaller.post("/options_quantity_resolution/detect",s()(e,{deep:!0}));return d()(t,{deep:!0})},this.resolveOptionQuantity=async e=>{await this.apiCaller.post("/options_quantity_resolution/resolve",s()(e,{deep:!0}))},this.resolveMultipleOptions=async e=>{await this.apiCaller.post("/options_quantity_resolution/resolve_multiple",s()(e,{deep:!0}))},this.getResolutionSuggestion=async(e,t)=>{let n=await this.apiCaller.get("/options_quantity_resolution/suggestion",s()({accountProvider:e,bankName:t}));return d()(n,{deep:!0})},this.apiCaller=new i.Ay}}let m=new u;var p=n(74547),y=n(95825),h=n(62570),f=n(36934),g=n(41784),v=n(11325),x=n(13340),A=n(82187),S=n(81671);let b=(0,h.A)(p.Ah,{target:"er86ytl0"})("background-color:",e=>e.isResolved?e.theme.colors.green50:e.theme.colors.neutral50,";border:1px solid ",e=>e.isResolved?e.theme.colors.green300:e.theme.colors.neutral200,";border-radius:8px;padding:12px;transition:all 0.15s ease;",(0,p.BK)({flexDirection:["column","row"],alignItems:["stretch","center"]}
3)),C=(0,h.A)(p.Ah,{target:"er86ytl1"})("display:block;flex:1;min-width:0;",(0,p.BK)({marginBottom:["12px","0"],marginRight:["0","12px"]})),I=(0,h.A)(p.Ah,{target:"er86ytl2"})((0,p.BK)({width:["100%","auto"],justifyContent:["space-between","flex-end"]})),w=(0,h.A)("div",{target:"er86ytl3"})("font-size:13px;font-weight:500;color:",e=>e.theme.colors.neutral800,";"),P=(0,h.A)("span",{target:"er86ytl4"})("font-size:11px;color:",e=>e.theme.colors.neutral500,";font-family:monospace;"),k=(0,h.A)("button",{target:"er86ytl5"})("display:flex;flex-direction:column;align-items:center;justify-content:center;padding:8px 16px;min-width:90px;border-radius:6px;border:2px solid ",e=>e.isSelected?e.theme.colors.blue500:e.theme.colors.neutral200,";background-color:",e=>e.isSelected?e.theme.colors.blue50:"white",";cursor:pointer;transition:all 0.15s ease;flex:1;&:hover{border-color:",e=>e.theme.colors.blue400,";background-color:",e=>e.theme.colors.blue50,";}"),F=(0,h.A)("span",{target:"er86ytl6"})("font-size:15px;font-weight:600;color:",e=>e.isSelected?e.theme.colors.blue700:e.theme.colors.neutral800,";"),T=(0,h.A)("span",{target:"er86ytl7"})("font-size:10px;color:",e=>e.theme.colors.neutral500,";margin-top:2px;"),E=(0,h.A)("span",{target:"er86ytl8"})("font-size:11px;color:",e=>e.theme.colors.neutral400,";padding:0 4px;"),Y=(0,h.A)(p.Ah,{target:"er86ytl9"})((0,p.BK)({flexDirection:["column","row"],alignItems:["stretch","center"],justifyContent:["center","flex-end"]})),D=(0,h.A)(e=>{let{className:t,...n}=e;return(0,a.Y)(f.km,{className:(0,g.cn)("text-body",t),...n,"data-sentry-element":"Body2W400","data-sentry-component":"Body2W400Neutral800","data-sentry-source-file":"OptionsQuantityResolver.tsx"})},{target:"er86ytl10"})("font-size:12px;color:#6b7280;",(0,p.BK)({marginRight:["0","auto"],marginBottom:["12px","0"],textAlign:["center","left"]})),R=(0,h.A)(p.Ah,{target:"er86ytl11"})((0,p.BK)({flexDirection:["row"],justifyContent:["center","flex-end"],width:["100%","auto"]})),N=e=>{let{options:t,onResolve:n,onSkip:o,isLoading:i=!1}=e,[l,s]=r.useState(()=>{let e={};return t.forEach(t=>{e[t.ticker]=null}),e}),c=(e,t)=>{let n="CONTRACTS"===t?e.choiceAsContracts:e.choiceAsShares;s(a=>({...a,[e.ticker]:{ticker:e.ticker,seriesName:e.seriesName,originalQuantity:e.originalQuantity,resolvedQuantity:n,resolutionType:t,price:e.price}}))},d=Object.values(l).every(e=>null!==e);return 0===t.length?null:(0,a.FD)(p.Ah,{display:"block",itemsSpacingVertical:12,marginBottom:16,"data-sentry-element":"FlexLayout","data-sentry-component":"OptionsQuantityResolver","data-sentry-source-file":"OptionsQuantityResolver.tsx",children:[(0,a.Y)(A.l,{status:"warning",variant:"light",title:"How many contracts is this?",description:"Some brokerages report contracts and some report the underlying shares. Picking the wrong one changes the value by 100x.","data-sentry-element":"Banner","data-sentry-source-file":"OptionsQuantityResolver.tsx"}),(0,a.Y)(p.Ah,{display:"block",itemsSpacingVertical:8,"data-sentry-element":"FlexLayout","data-sentry-source-file":"OptionsQuantityResolver.tsx",children:t.map(e=>{let t=l[e.ticker],n=null!==t;return(0,a.FD)(b,{isResolved:n,children:[(0,a.FD)(C,{children:[(0,a.Y)(w,{children:e.seriesName||"Option"}),(0,a.Y)(P,{children:e.ticker})]}),(0,a.FD)(I,{flexDirection:"row",alignItems:"center",itemsSpacingHorizontal:4,children:[(0,a.FD)(k,{type:"button",isSelected:(null==t?void 0:t.resolutionType)==="SHARES",onClick:()=>c(e,"SHARES"),children:[(0,a.Y)(F,{isSelected:(null==t?void 0:t.resolutionType)==="SHARES",children:(0,a.Y)(v.eF,{amount:e.choiceAsSharesAmount,sourceCurrency:x.mF,currencyFormatter:v.EB.HumanizedLiteralAmount})}),(0,a.FD)(T,{children:[e.choiceAsShares.toLocaleString()," qty"]})]}),(0,a.Y)(E,{children:"or"}),(0,a.FD)(k,{type:"button",isSelected:(null==t?void 0:t.resolutionType)==="CONTRACTS",onClick:()=>c(e,"CONTRACTS"),children:[(0,a.Y)(F,{isSelected:(null==t?void 0:t.resolutionType)==="CONTRACTS",children:(0,a.Y)(v.eF,{amount:e.choiceAsContractsAmount,sourceCurrency:x.mF,currencyFormatter:v.EB.HumanizedLiteralAmount})}
3),(0,a.FD)(T,{children:[e.choiceAsContracts.toLocaleString()," qty"]})]}),n&&(0,a.Y)(p.In,{icon:S.$.Checkmark1,size:18,style:{color:"#16a34a",marginLeft:8,flexShrink:0}})]})]},e.ticker)})}),(0,a.FD)(Y,{"data-sentry-element":"FooterActionsContainer","data-sentry-source-file":"OptionsQuantityResolver.tsx",children:[(0,a.Y)(D,{"data-sentry-element":"FooterText","data-sentry-source-file":"OptionsQuantityResolver.tsx",children:!d&&"Select a value for each option"}),(0,a.FD)(R,{itemsSpacingHorizontal:8,"data-sentry-element":"FooterButtonsContainer","data-sentry-source-file":"OptionsQuantityResolver.tsx",children:[(0,a.Y)(p.$n,{size:"sm",variant:"ghost",color:"neutral",onClick:o,disabled:i,"data-sentry-element":"Button","data-sentry-source-file":"OptionsQuantityResolver.tsx",children:"Skip"}),(0,a.Y)(p.$n,{size:"sm",variant:"filled",onClick:()=>{n(Object.values(l).filter(e=>null!==e).map(e=>({ticker:e.ticker,seriesName:e.seriesName,originalQuantity:e.originalQuantity,resolvedQuantity:e.resolvedQuantity,resolutionType:e.resolutionType,price:e.price})))},disabled:!d||i,loading:i,"data-sentry-element":"Button","data-sentry-source-file":"OptionsQuantityResolver.tsx",children:"Confirm"})]})]})]})};var M=n(62212),L=n(17667),_=n(84245),O=n(79768),W=n(50202);let B=e=>{let{isResolving:t,resolveOptions:n}=(e=>{let{portfolioSummary:t,investmentAccountId:n,accountProvider:a,bankName:o,autoDetect:i}=e,l=t.portfolioId,s=(0,M.j)(),{mainPortfolio:c}=(0,W.RW)(),d=(0,O.rA)(),[u,p]=r.useState([]),[y,h]=r.useState(!1);r.useEffect(()=>{i&&(h(!0),m.detectOptionsForPortfolio({portfolioId:l}).then(e=>p(e.options)).catch(e=>{console.error("Failed to detect options:",e),p([])}).finally(()=>h(!1)))},[i,l]);let f=(0,L.A)(async e=>{await m.resolveMultipleOptions({portfolioId:l,investmentAccountId:n,accountProvider:a,bankName:o,resolutions:e})},{onSuccessMessage:()=>"Options updated",onSuccess:async()=>{p([]),s.invalidateQueries((0,_.xz)(l)),await d({portfolioId:c.portfolioId,portfolioType:c.portfolioType})}}),g=async e=>{await f.mutateAsync(e)};return{optionsNeedingResolution:u,isDetecting:y,isResolving:f.isLoading,hasOptionsToResolve:u.length>0,resolveOptions:g,skipResolution:()=>{p([])}}})({portfolioSummary:e.portfolioSummary,investmentAccountId:e.connectedAccount.id,accountProvider:e.connectedAccount.accountProvider,bankName:e.connectedAccount.bankName,autoDetect:!1}),o=async t=>{await n(t),e.onClose()};return(0,a.Y)(p.aF,{disableSubmitOnEnter:!0,title:"Confirm your options",open:!0,onCancel:e.onClose,closable:!t,maskClosable:!t,keyboard:!t,size:y.rI.Md,footer:null,centered:!0,"data-sentry-element":"Modal","data-sentry-component":"OptionsResolutionModal","data-sentry-source-file":"OptionsResolutionModal.tsx",children:(0,a.Y)(N,{options:e.preDetectedOptions,onResolve:o,onSkip:e.onClose,isLoading:t,"data-sentry-element":"OptionsQuantityResolver","data-sentry-source-file":"OptionsResolutionModal.tsx"})})};var U=n(73314),z=n(5285);let V=e=>{let[t,n]=r.useState(""),o=(0,z.A)({notify:!1}),i=o.isLoading,l=async()=>{await o.mutateAsync({issueType:U.s.ACCOUNT_CONNECTION_DATA_ISSUE,description:t.trim(),context:{portfolioId:e.portfolioSummary.portfolioId,portfolioName:e.portfolioSummary.portfolioName,bankId:e.connectedAccount.bankId,bankName:e.connectedAccount.bankName,accountProvider:e.connectedAccount.accountProvider,investmentAccountId:e.connectedAccount.id}}),e.onSubmit()};return(0,a.Y)(p.aF,{disableSubmitOnEnter:!0,title:"Portfolio data issue",open:!0,onCancel:e.onClose,closable:!i,maskClosable:!i,keyboard:!i,size:y.rI.Sm,footer:null,centered:!0,"data-sentry-element":"Modal","data-sentry-component":"PortfolioIssueReportModal","data-sentry-source-file":"PortfolioIssueReportModal.tsx",children:(0,a.FD)(p.Ah,{display:"block",itemsSpacingVertical:16,"data-sentry-element":"FlexLayout","data-sentry-source-file":"PortfolioIssueReportModal.tsx",children:[(0,a.Y)(f.bU,{className:"text-body","data-sentry-element":"Body1W400","data-sentry-source-file":"PortfolioIssueReportModal.tsx",children:"Tell us what looks incorrect. Our team will investigate and follow up. More detail helps us resolve the issue faster."}),(0,a.FD)(p.Ah,{display:"block",itemsSpacingVertical:8,"data-sentry-element":"FlexLayout","data-sentry-source-file":"PortfolioIssueReportModal.tsx",children:[(0,a.Y)(f.km,{className:"text-subtle","data-sentry-element":"Body2W400","data-sentry-source-file":"PortfolioIssueReportModal.tsx",children:"Describe the issue"}),(0,a.Y)(p.fs,{onChange:n,placeholder:"e.g. My Apple position shows double the actual size. The correct amount is 12,500 shares, not 25,000",minRows:5,className:"w-full","data-sentry-element":"TextArea","data-sentry-source-file":"PortfolioIssueReportModal.tsx"}),t.trim().length>0&&t.trim().length<50?(0,a.FD)(f.km,{className:"text-subtle",children:[50-t.trim().length," more characters needed"]}):null]}),(0,a.Y)(p.Ah,{justifyContent:"flex-end","data-sentry-element":"FlexLayout","data-sentry-source-file":"PortfolioIssueReportModal.tsx",children:(0,a.Y)(p.$n,{variant:"filled",onClick:l,disabled:i||t.trim().length<50,loading:i,"data-sentry-element":"Button","data-sentry-source-file":"PortfolioIssueReportModal.tsx",children:"Submit for manual review"})})]})})};var j=n(78561),H=n(57944),q=n(8921),G=n(48298),K=n(19788),Q=n(32189),$=n(95935),X=n(58888),J=n(55606);let Z=(0,h.A)("div",{target:"ec4edtc0"})("display:flex;align-items:center;gap:8px;padding:12px 16px;border-radius:8px;background:",e=>e.theme.colors.green50,";border:1px solid ",e=>e.theme.colors.green100,";color:",e=>e.theme.colors.green700,";font-size:14px;font-weight:500;"),ee=(0,h.A)("div",{target:"ec4edtc1"})("display:flex;align-items:flex-start;gap:16px;padding:8px 0;border-bottom:1px solid ",e=>e.theme.colors.neutral100,";&:last-child{border-bottom:none;}"),et=(0,h.A)("div",{target:"ec4edtc2"})("flex-shrink:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;color:",e=>e.theme.colors.neutral900,";"),en=(0,h.A)("div",{target:"ec4edtc3"})("flex:1;min-width:0;"),ea=(0,h.A)("div",{target:"ec4edtc4"})("flex-shrink:0;align-self:center;width:100px;"),er=e=>{let{launchConnectedPortfolioEdit:t}=(0,j.h)(),n=(()=>{let e=(0,M.j)(),{mainPortfolio:t}
3=(0,W.RW)(),n=(0,O.rA)(),{launchManualPortfolioEditWithPortfolio:a}=(0,J.I)();return(0,L.A)(async e=>G.Ay.createPortfolioStandin(e.originalPortfolioId),{onSuccess:async(r,o)=>{await (0,X.gy)(e),await e.invalidateQueries(_.u$),n(t);let i={...o.originalPortfolioSummary,portfolioId:r.portfolioId,portfolioName:"".concat(o.originalPortfolioSummary.portfolioName," (stand-in)"),source:Q.GB.Manual};await a(i)}})})(),o=(()=>{let e=(0,M.j)(),{mainPortfolio:t}=(0,W.RW)(),n=(0,O.rA)();return(0,L.A)(async e=>G.Ay.createPortfolioReplacement(e.originalPortfolioId,e.replacementPortfolioId),{onSuccess:async()=>{await (0,X.gy)(e),await e.invalidateQueries(_.u$),n(t)}})})(),i=(()=>{let e=(0,M.j)();return(0,L.A)(async e=>K.A.updateSubAccount(e),{onSuccess:async()=>{await (0,$.d)(e)}})})(),l=r.useRef(null),s=e.connectedAccount.subAccounts.find(t=>{var n;return(null==(n=t.portfolioSummary)?void 0:n.portfolioId)===e.portfolioSummary.portfolioId}),c=async()=>{e.onClose(),await n.mutateAsync({originalPortfolioId:e.portfolioSummary.portfolioId,originalPortfolioSummary:e.portfolioSummary}),e.onActionComplete()},d=async()=>{if(!s)return void(0,q.Ds)(q._n.Error,"Could not find the subaccount to hide");await i.mutateAsync({subAccountId:s.id,nickName:s.nickName,taxTreatment:e.portfolioSummary.taxTreatment,isExternallyManaged:e.portfolioSummary.isExternallyManaged,isInvestedFund:e.portfolioSummary.isInvestedFund,advisorFee:e.portfolioSummary.advisorFee,trackingTicker:e.portfolioSummary.trackingTicker,isActive:!1}),(0,q.Ds)(q._n.Success,"Portfolio hidden while we investigate"),e.onClose(),e.onActionComplete()};return(0,a.FD)(r.Fragment,{children:[(0,a.Y)(H.t,{render:e=>(l.current=e,(0,a.Y)(r.Fragment,{})),onPortfolioImported:async t=>{let{portfolioId:n}=t;n&&await o.mutateAsync({originalPortfolioId:e.portfolioSummary.portfolioId,replacementPortfolioId:n}),e.onActionComplete()},"data-sentry-element":"BrokerageStatementsLiveImporter","data-sentry-source-file":"TemporaryReplacementModal.tsx"}),(0,a.Y)(p.aF,{disableSubmitOnEnter:!0,title:"Keep working while we fix this",open:!0,onCancel:e.onClose,size:y.rI.Md,maskClosable:!1,footer:(0,a.Y)(p.Ah,{justifyContent:"flex-start",padding:16,children:(0,a.Y)(p.$n,{onClick:e.onBack,children:"Back"})}),centered:!0,"data-sentry-element":"Modal","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:(0,a.FD)(p.Ah,{display:"block",itemsSpacingVertical:16,"data-sentry-element":"FlexLayout","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:[(0,a.FD)(Z,{"data-sentry-element":"SuccessAlert","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:[(0,a.Y)(p.In,{icon:S.$.CircleCheck,size:20,"data-sentry-element":"Icon","data-sentry-source-file":"TemporaryReplacementModal.tsx"}),"Issue submitted. We'll notify you when it's resolved."]}),(0,a.Y)(f.km,{className:"text-subtle","data-sentry-element":"Body2W400","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:"Pick how you want to handle this portfolio while we fix the data issue. We'll switch back automatically once it's resolved, or you can remove the stand-in yourself anytime."}),(0,a.FD)(p.Ah,{display:"block","data-sentry-element":"FlexLayout","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:[(0,a.FD)(ee,{"data-sentry-element":"ReplacementOption","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:[(0,a.Y)(et,{"data-sentry-element":"OptionIcon","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:(0,a.Y)(p.In,{icon:S.$.CloudUpload,size:24,"data-sentry-element":"Icon","data-sentry-source-file":"TemporaryReplacementModal.tsx"})}),(0,a.FD)(en,{"data-sentry-element":"OptionContent","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:[(0,a.Y)(f.lc,{className:"text-body","data-sentry-element":"Body1W600","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:"Use a statement as a stand-in"}),(0,a.Y)(f.km,{className:"text-subtle","data-sentry-element":"Body2W400","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:"Upload a recent brokerage statement. We'll use it everywhere this portfolio appears (recommendations, groups, drafts) until the original is fixed."})]}),(0,a.Y)(ea,{"data-sentry-element":"OptionAction","data-sentry-source-file":"TemporaryReplacementMod
3al.tsx",children:(0,a.Y)(p.$n,{variant:"filled",fullWidth:!0,onClick:()=>{var e;null==(e=l.current)||e.call(l)},"data-sentry-element":"Button","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:"Upload"})})]}),(0,a.FD)(ee,{"data-sentry-element":"ReplacementOption","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:[(0,a.Y)(et,{"data-sentry-element":"OptionIcon","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:(0,a.Y)(p.In,{icon:S.$.PencilLine,size:24,"data-sentry-element":"Icon","data-sentry-source-file":"TemporaryReplacementModal.tsx"})}),(0,a.FD)(en,{"data-sentry-element":"OptionContent","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:[(0,a.Y)(f.lc,{className:"text-body","data-sentry-element":"Body1W600","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:"Adjust the current holdings"}),(0,a.Y)(f.km,{className:"text-subtle","data-sentry-element":"Body2W400","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:'Change quantities or values on holdings we already have. To add or remove holdings, use "Build a stand-in by hand" instead.'})]}),(0,a.Y)(ea,{"data-sentry-element":"OptionAction","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:(0,a.Y)(p.$n,{variant:"filled",fullWidth:!0,onClick:()=>{e.onClose(),t(e.portfolioSummary),e.onActionComplete()},"data-sentry-element":"Button","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:"Adjust"})})]}),(0,a.FD)(ee,{"data-sentry-element":"ReplacementOption","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:[(0,a.Y)(et,{"data-sentry-element":"OptionIcon","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:(0,a.Y)(p.In,{icon:S.$.InputForm,size:24,"data-sentry-element":"Icon","data-sentry-source-file":"TemporaryReplacementModal.tsx"})}),(0,a.FD)(en,{"data-sentry-element":"OptionContent","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:[(0,a.Y)(f.lc,{className:"text-body","data-sentry-element":"Body1W600","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:"Build a stand-in by hand"}),(0,a.Y)(f.km,{className:"text-subtle","data-sentry-element":"Body2W400","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:"Start with a copy of your current holdings, then add, remove, or edit anything. Used in place of the original until it's fixed."})]}),(0,a.Y)(ea,{"data-sentry-element":"OptionAction","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:(0,a.Y)(p.$n,{variant:"filled",fullWidth:!0,onClick:c,"data-sentry-element":"Button","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:"Build"})})]}),(0,a.FD)(ee,{"data-sentry-element":"ReplacementOption","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:[(0,a.Y)(et,{"data-sentry-element":"OptionIcon","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:(0,a.Y)(p.In,{icon:S.$.EyeSlash,size:24,"data-sentry-element":"Icon","data-sentry-source-file":"TemporaryReplacementModal.tsx"})}),(0,a.FD)(en,{"data-sentry-element":"OptionContent","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:[(0,a.Y)(f.lc,{className:"text-body","data-sentry-element":"Body1W600","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:"Hide this portfolio"}),(0,a.Y)(f.km,{className:"text-subtle","data-sentry-element":"Body2W400","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:"Exclude it from totals, recommendations, and groups until the connection is restored."})]}),(0,a.Y)(ea,{"data-sentry-element":"OptionAction","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:(0,a.Y)(p.$n,{variant:"filled",fullWidth:!0,onClick:d,"data-sentry-element":"Button","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:"Hide"})})]})]}),(0,a.FD)(p.Ah,{display:"block",itemsSpacingVertical:4,"data-sentry-element":"FlexLayout","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:[(0,a.Y)(f.s9,{className:"text-body","data-sentry-element":"Body2W600","data-sentry-source-file":"TemporaryReplacementMod
3al.tsx",children:"While we investigate: keep the connection"}),(0,a.FD)(f.cO,{className:"text-neutral-500","data-sentry-element":"CaptionW400","data-sentry-source-file":"TemporaryReplacementModal.tsx",children:["Keep the original portfolio connected so we can detect when it's fixed. Most issues resolve within"," ",(0,a.Y)("strong",{style:{color:"#0F172A"},children:"72 hours"}),", but you can delete the stand-in yourself the moment your original looks right."]})]})]})})]})};var eo=function(e){return e.OptionsResolution="optionsResolution",e.ProblemDescription="problemDescription",e.TemporaryReplacement="temporaryReplacement",e}(eo||{});let{useFixAccountLaunchEventListener:ei,emitFixAccountLaunchEvent:el}=(0,o.createEvent)("FixAccountLaunchEvent")(),es=()=>({launchFixAccount:async e=>{let{options:t}=await m.detectOptionsForPortfolio({portfolioId:e.portfolioSummary.portfolioId});el({portfolioSummary:e.portfolioSummary,connectedAccount:e.connectedAccount,preDetectedOptions:t})}}),ec=()=>{let[e,t]=r.useState(null),[n,o]=r.useState(null);ei(e=>{o(e),t(e.preDetectedOptions.length>0?"optionsResolution":"problemDescription")});let i=()=>{t(null),o(null)};return n?"optionsResolution"===e?(0,a.Y)(B,{portfolioSummary:n.portfolioSummary,connectedAccount:n.connectedAccount,preDetectedOptions:n.preDetectedOptions,onClose:i}):"problemDescription"===e?(0,a.Y)(V,{portfolioSummary:n.portfolioSummary,connectedAccount:n.connectedAccount,onSubmit:()=>{t("temporaryReplacement")},onClose:i}):"temporaryReplacement"===e?(0,a.Y)(er,{portfolioSummary:n.portfolioSummary,connectedAccount:n.connectedAccount,onBack:()=>{t("problemDescription")},onClose:i,onActionComplete:i}):null:null}},63683:(e,t,n)=>{n.d(t,{g:()=>r.A,m:()=>a.A});var a=n(48675),r=n(30813)},64533:(e,t,n)=>{n.d(t,{qj:()=>m,W4:()=>p,B3:()=>u});var a=n(13343),r=n(16685),o=n(12115),i=n(62031),l=n.n(i),s=n(80017),c=n(3023);n(90454),n(20155);let d={currentChunk:"",accumulatedMessage:"",isStreaming:!1,isComplete:!1,status:"",statusMessage:"",toolResults:[],isStopped:!1,followUpSuggestions:null,activeGenerationId:null},u=(0,a.A)((0,r.lt)((e,t)=>{let n=null,a=new Set,r=()=>{null!==n&&(clearTimeout(n),n=null)};return{...d,startStreaming:t=>{r(),a=new Set,e(()=>({...d,activeGenerationId:t}))},stopStreaming:()=>{r(),a=new Set,e(()=>({...d,isStopped:!0}))},resetStreaming:()=>{r(),a=new Set,e(()=>({...d}))},handleSocketEvent:o=>{let i=t();if(!i.isStopped&&(!i.activeGenerationId||!o.generationId||o.generationId===i.activeGenerationId)){if(o.messageChunk&&!((e,t,n)=>t?a.has(t):e.length>=10&&n.endsWith(e))(o.messageChunk,o.chunkId,i.accumulatedMessage)){let t=o.messageChunk;o.chunkId&&(a=new Set(a).add(o.chunkId)),e(e=>({currentChunk:t,accumulatedMessage:e.accumulatedMessage+t,isStreaming:!0,isComplete:!1}))}if(o.status){let t=o.status;e(()=>({status:t,statusMessage:o.statusMessage||""}))}if(o.toolResult&&o.toolType){let t=o.toolResult,n={type:o.toolType,data:t,displayType:o.toolDisplayType};e(e=>({toolResults:[...e.toolResults,n]}))}o.followUpSuggestions&&e(()=>{var e;return{followUpSuggestions:null!=(e=o.followUpSuggestions)?e:null}}),o.isComplete?(r(),e(()=>({isStreaming:!1,isComplete:!0}))):t().isStreaming&&(r(),n=setTimeout(()=>{n=null,t().isStreaming&&!t().isComplete&&(console.warn("[AiStreaming] Timed out waiting for streaming events — finalizing with partial text"),e(()=>({isStreaming:!1,isComplete:!0})))},12e4))}}}},{name:"AiStreamingStore"}));function m(e){return e.isComplete&&(e.accumulatedMessage.length>0||e.toolResults.length>0)}let p=()=>{(e=>{let t=o.useRef(e);o.useLayoutEffect(()=>{t.current=e}),(0,c.V)(s.y.AiAssistant,e=>{let n=l()(e,{deep:!0});t.current(n)})})(u(e=>e.handleSocketEvent))}},64755:(e,t,n)=>{n.d(t,{K:()=>i,u:()=>o});var a=n(33624),r=n(59109),o=function(e){return e.UserPreferences="UserPreferences",e.UnderTrackedPortfolio="UnderTrackedPortfolio",e.EmptyPortfolio="EmptyPortfolio",e.OverLeveragedPortfolio="OverLeveragedPortfolio",e.NegativeValuePortfolio="NegativeValuePortfolio",e}({});let i=e=>{let{isFunctionalityRestrictedPortfolio:t,isPortfolioEmpty:n,isPortfolioOverLeveraged:o,isPortfolioValueNegative:i,isComputing:l}=(0,r.I)(e),s=a.aIS(t,!1);return{isPortfolioRecommendationsDisabled:l?null:a.mKk(!0,[t,n,o,i]),disabledReason:n?"EmptyPortfolio":o?"OverLeveragedPortfolio":i?"NegativeValuePortfolio":null,showIntermediateAnalysis:s,showIncreaseReturns:s,isComputing:l}}}
3,64862:(e,t,n)=>{n.d(t,{V:()=>i});var a=n(33624),r=n(544),o=n(43608);let i=e=>{let{data:t,isLoading:n}=(0,o.y)(e);return{isPortfolioEmpty:a.gD_(t)?null:(0,r.SM)(t),isComputing:n}}},65460:(e,t,n)=>{n.d(t,{dx:()=>o,on:()=>i,vl:()=>l});var a=n(33624);let r={"Charles Schwab":"https://yodlee-1.hs.llnwd.net/v1/LOGO/LOGO_13696_1_2.SVG",RBC:"iVBORw0KGgoAAAANSUhEUgAAAJgAAACYCAMAAAAvHNATAAAAb1BMVEVHcEwAX6sAXqsAXaoOZa4AZK8AYK0AXqsAXqoAXar/0wD///8AWbD/1wAAWKcUZZ7vzAq0sDI6d4TJuiR/l1XdwxYpb5CcpUJPgXVnjGbe6vQ6gr0ldbaewd/G2+xOjsRtos6zz+aIs9hemMl7q9Pw/iS2AAAACnRSTlMARWj//hQnk9+4zc+VdQAADJRJREFUeNrNXAl7ojoUrYIbDQQIgaBWrfr/f+PLClmARKRvzMw30xYrx7uce+4N8PX15tps17vd4XDY7/dRRP+hX+52q+3m6x8uCulA0Qyv/WG33v4bUKOYNHT/M7hVCKge3Op/stUrqBS2P7fbZn2IZq3DevOnxoreWH9mtvdg/Rm07SFaYB2WhrZZBBaHtmisreNosRWvl6OtfbTo2i9DbJtdtPjabT7PXEsZbRf90dp9SDIum56OG0G//qU7bTeCiFRNIVbzD93phFeLkzRNE7ZS/O8CzQovABuBSSy8UKAtEPaFjmspYC+nwMYJ+1bgyjHGOQcGptYLKbB5C1cEMYssRCBdhAGsphaJ/gaZiwswMGlBE5NaivDwn1oF+BtkLq2Cinoyr0EHcnKlDfiTDBige0BTMkWa9ZYEFopsqDxyi/0ZsDA+GyzbPCkVRcBSrRolSVWXddn/LfMZwEKQrYZ/s2YcUQO7ZBZpSgQ/8L/sCzwHWLR6PSElFsqvLCu1M4KSEJSkLXB4ZQYwb2qO6RzATYZ0hqIJQf27EDBfAozrQlDmDAbSsTaYctZCwKbDbDXxi6AuKKsis7CTIrGB5TOBTYXZaIDVkMuxsmoqWznWtfU9o4tqDrCJMNuNeREToLJx8AUggmLVZZG4cfeuM1ejcZ+Wk2ciDaKag6+Ei5BynvIec+ZYo4YoT0wsWCSpSfzF3C5gZA4wYjBK+pMWQKklNgo4VzYOTg828SyDAcJw5UVVNaJReUmM2WsTTq2gtJIMDOkOCLRKtWwPsB2zCNUVRD9XWQO7ViWEcm2Oi7Zm4Mp3WrtteC2iFtGhgCZvHWBFLqIrQUVT5C1c0GTb0ZfSE9emBbGj1JhYq9oW8SRIcLGgyXZTSWdYrEpzg+xLThEV9SHBki7Qcj3wdpIN9Bij7GERO284cdGgjsjeAWaZbEJVUC1YATNLzUpeY0FkSffvW8AMk20meKqxuzHqMCNNuezgqJKibfG7wAwuW08Ao8SfQyvaMTSZjRdL1BDKFuhtYOsArhCus9QCVVySUQ15IflVAzZzdnAICn0hSTG0bJjisj8JPyEs26qq2rIHBurSXRF4JfwnB6285piSlA+kmpIbiSKvSVXgXNTxLisBbIZazqL0W23n1Tvyg7M3NBiDI2NEShdiw5/U1D2IvqTF6XA33NQ+ZPsQpS9NpuYWnTdzSRGDZ0egROlom557oa0CR+a8c7MS0TkzBZnn3KEUWCMB59YfSSt5BUGIL31bDKIcIosiDF/lqGlJzUR/W3TnR6S2VikRp7iCfl9u/XlSDCADsIOGicwD3iZh6bGKT9O0P1wTKTJG0JuXaz8wOU+0lBiAVS7TUOUG+9F4jDeEoieipk52UuvQXRnAZjicvJwmWBqtgUDzL/XiACuAVrAFhzbZFO+CQqxHluTEeTeRnxQ0hVIXiRvcGuuz/KaCgBWTaWD7sBDjep4IF1Uuzcn8TBvl2KLWikJUt3w7palociDRPyCbGQeDzBdigFSRhqyxM53SbUcYwnRd2aE2rFDf2eWY8yEfAnp6z3VIiKEEasjsFOB0ovGG5kXaluQ2z+IasLFLkpdeJjv4oqsbCpdYRBCZQNZ0Qd/nrFEe8pbXM8/Y5eCPfcquKkylVh1yZ9WdWx3rYo9ZkZBed/OfYugtlxtfiBX9p1MnS5HjCHoAC4ktXE0dn4qixEqn3LQoumJBfIV8409KpJkdQImM9pbAnggVkJMad7UISPoBmGbiVMpau0rSb8DOydbP+8hgHKjIobDKQMXOJkiNIhO0R4sSYomo5vFIFX8MfcjWfrZAZlMElTvMhpwKbgpM+Jrak/3HLEdrmSQGKObxgJvVP6hae9mCsbUeUapI2zkAGgTM7VYWR1QxyaIIhFPpakKGoTsfW/AGtwFudZJlSPtxI+hWUQcHwYpPyeagdc03ffiwitu79vGFF1htjy5pLe43jdxgkYcRYc0JAyHGoKo6yL7AN9j2AxNMYEqx3l2G0QxkqEC0HbDx9FxrDkAGgHm1BaMgc3oJWO5jQ/A4dCstQuOgol0cIW1bIQWX4/VE2T5E9PBtJOP0fH4hJeGQ0QrZvYv5rVyMMHhMiM1rHL0LjG8jmcKaOhNpDYltNKCSkYLpxgvc8jJD2fxjeuK8/wpRiVyn6PKVZgTSelpH2lJncl/S38R6Fik9zZ09vUsRAkxGe669E2Ut2V/KWDYbMkBpGImP1FcfmPfASm9ehglrMRTQXVYWSgrJbDPrOv0oWADTTo87VzJNNs3+QcHfjSt0l0FbWYt2rZ8RseACJK16zc92XSPGtTRNsWdYFQxMaUGnhxbFz6nrEDNgkDC24GRBKZ+6HQuu4HSGp4GFXromBZYrxTRkWhSCIoeAFDjJ8070J+b0Bb3L/HY7ZButR6ZFIai4xeqcCH7tLNZVp8WAdcrBYVQlH/UoBER4CpVajKWY72ky52KPWjy8cnUkFYLJIKNqUkiRChBpCxrtQyCFhV8EMV2Tdq9dtqmayxSb0prLGyRldyMOibStoS4xOyysNJBpYOvoJWSlso0prRnVF1KKGXUVGENllTh8FF5Pz+620WvIlNdSS1ozP9HASod7YlGSeNMmr3DxzNy33vZtZLzCjQYNRmWaXzZK2EVGUbMqAGFJ2qbIfaVy8/W1n43MlNYF4t9UI2O5mnZy3SiZtSrQNx9++eJgTVonfRkCdaXlh1sI2ybPUU/7Hp14mHU1tS6tNXcCY8hXOUMhTJ3HSazF3hnBLmzS6TAtK8FiZOJOGZWvbYlWCqEkr3H0zAjWYbPhgTYgRaAWMnFg+MMvbrOzDtb9UW9buQ0ddbrORP2w38kvcQ3osFE4Ll8jvp97yT4V9Uh0t9yfLrI2HSzSbOyTJ/4rRnah4/QBk2F9h2SwT9J/Kjboakphfc3ybllu5wCrG5Vs1dDgkmvnBvR7hqRqEJZ6DFcwJMRmBZld2J3sZ87EkTCS2jNMpvr3oe23N+8LYQ3JQMtDG+8C5ealzz0ztyBgk2sVvYmMzWZtG3CTFdZCKFf7clM2W319LeFLgQy5+08pG2Hzy2PFVbL8p2UlFMhEV7lf7h4fdskncSfZQ8qGbY2Ns5zhyXl56TjOlvBUCA03aICpgClxsQ26vCEUWeGeCo+dnerEYlpZBFwQElzYnXAGzSgwMiUT12GX0AQjqxonL5Mxf9XJxAh2s/AtbpC4GTEGDLZRQOiHhH9mrsGDwDpGW3c4+B5RNFUst6/cFRifzuaKox7B+TR2rNZRxafH7fl8Pq7nKItCDeYzWXz/NtbxeLmf5Ntn5x/r4OXnKs7d2SWLH7/H7gWX5znYYD7GyCxkbP3EAloW/TrHLifNKll0O1q/moVwRYjJsli89e1K1+NHfPOrDp6Epfixuzh2PPfnjgXwy/1xvd74796yYIN5SfbC3/wswvcszv6Q7y9QH0V4x+KV96z7TBcBW0Y/C4tzFmywiUuaxduLQJIeyq7CZCawWLffpfvVX8uC2e0yGsubFy4CHwIWnb81KFGkA7OOZTfDuOIVIaQfcNn8ADDDRhaw2LCYeOUliKP3M+4YCQcm3SxjLHvw755ZCLDVjHuvrRg7GTGmA1Oxfh78QAFN2ys3s9gnUMx1coDF54fAZR76Poc4cjPn9h8JTNBF/GMygjz78XKUX9xjdSg2s2SWIyedKYE9NX599kctYj/+3iQ7ZOdgYLt5t5hldkH80UlSuJKW6Of9R/DrUZC7Kgp+XIeZN+UpYNI2l9jQPjrzRycBjSMLtpj/ftnVJLBrLNLfqnYGeai6ykwaDGw188bPPiuV6U7ZGDBF9py7JEgfXcy/JbWnC1mkj26MxabaECx3GTDwPFzDCdADk6ftRM8osIsm5C5vBf4UMo1gpac0GpuwmPoY12wBXEOpqTO/CrNrNgLsqQHPfmX4Z/MTcgqZUZJiW6UOZqUM+LMkGC0ms3gmrgFkZq08KTYb4LF
3MKmml66W++D4+Ytm+xbffeCYu97ESlrp4mk2FAHZi6ypFfwe6Q0arBW0ZHk/aL/WVYMaTVQ5GW2rLl1+DZ49Om3TXYiqTtUBrol6P+zE+s4CpdkT+4Gg1lk+z28iiq9ZWfl9u8Wv85SLTTHbmjur9I74/CaF10pfRpmuN+O3+8/Nzv2md+Oxn9xiPx7GHFvqkgn2h/maZb/yhwv6Npx1tP/SBQp/7CKYPfmjV5z7m63MfjLb0o+Si5R4l98EP3/vcxxV+8AMeP/iRmB/8ENEPfuzqJz+oVvn0Ex/tq5z6iQ9D7k039Pjo9fuPj/4PAyjNBZdVn4wAAAAASUVORK5CYII=","TD Ameritrade":"iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAIAAAAiOjnJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjYyMjA4MkY3QkZDMzExRTFCNzA4QUYxREExN0YwQ0VGIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjYyMjA4MkY4QkZDMzExRTFCNzA4QUYxREExN0YwQ0VGIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NjIyMDgyRjVCRkMzMTFFMUI3MDhBRjFEQTE3RjBDRUYiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NjIyMDgyRjZCRkMzMTFFMUI3MDhBRjFEQTE3RjBDRUYiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6IeUlfAAARk0lEQVR42uydeZBcx13H+/eOmdnZY1a7Olb3ZXlxnIrPUqwUMnY5h3EIRljGFSgwgUDAiV0pSjhFxaEKEyrxPwSqgKBSApVSKMeJIQISOXYpkeXYlstGluJLNta50q60lzQ7uzvne91093szOyviAk2/Xc3s+341Gq1G9pt3fN7v9+1f9+smtncTg6CoZeEUQAALAlgQwIIggAUBLAhgQRDAggAWBLAgKEI57/1PYl52gFrnXImW2tvmBQsnESckKrAW3qkTQP3KnCgnRpeB4ba5MuYdoR5CqxACWBDAgiCABQEsCGBBEMCCABYEsCAIYEEACwJYEASwIIAFASwIAlgQwIIAFgQBLAhgQQALggAWBLAggAVBAAsCWBDAgqD5BgszPsyb6P/6tIkmCXEaP0oiITjjZbA1VxQJ/QeR/ov8Qc/8Jt8s+S7qkBI6QIjqf9EUfDUOlhDCZU4mmSGANVdcCY/xEq/4gpf9knxj3Fcfe74iybKF5TKySV5ESZRQvzVlTTHzYONgMb+wobP/P2/6RrvT7jMPeEUsCQqJsl/O85InKtPe9KQ/OVbKDpVHzhaGTxcGBwtnzhSHR8vjws+p6+gkGDkqvImmuBCOyT3lWu7q9IqUlQAG868pL3++PHYif+rV7BvPZw8dyr5+vnhOxTg7ySh5xfOhAVgyFwpW4WWANQ/hq5rdZtJch5O+yllzVXrNRxffKv86VDz/YvbID4f3PTV6YLhwVuVKJ03MEqzmxqiaLZscLLQKr0B7kN4LuxWpvu19d8rX2eL57w8/888DTxzOHhZkMbuNyXcZA8S8OnvUsRYGdlyBo5lZlep7cO3v/HTL9564+Rubu69n3hTzi/JCa+s1f/kRYC2IRKl+EVEAjgSMtzvp31h+1/4tT37t/V9enuwRlQsSPgtgQZcVsQSzFDSiSpguP8hX2k59fv3v79/y/btX3s0qk1zweWu8A6wFQRaxoJRKITik66ohQ/3t65688R+/fM0jjpBoFdm81CQAVhxalMIh+4ubHnz8pn/osdPSdYkwaRLAggysfZWj7X2//MTNu3qSi6Sd1/FNACzIIF4FdOk/P7z4F797065ep1vw6Tl18gBr4Rt7NVog7MRWv+7o3fL16x5z5aXnleYEq64wMmfw6/K+qLv9jO/d5oomlxQNZn+ka1MKCiHMrhJR+GNoqu7tu+svr/kS80u171P8NQdY6nAtRinLnVMXWG3oREAFNV0vAV3yN5o1EkZ3Q6sPRYQXXbHK1Q8Pb/j0fSt/jXlZ/RXEom4oOiaXqci8d6cH2p02wfgcXTXORIKcFcmlFlmGAJ8vjU55BZtsNcSErvzYEgqDlB6ZYLskrLSd6nDSM3Fmpn8w0i/Vfktu/KvXPPLSxJHT02eZ3RZ+FuUX7d0060gv56InLGex06WT95yBxUtr29Y9dcvuRU6X/BZqNMTKA9t+6NMvjB103A51yxK/8vFL6AykwUo6SQlWu5XoTGRWJFdclV71ga7+mzPXrWpb4ZIdrbeYudZE3z77b7995AFmdzBmR0uw0/hZIavi8yHvfDXJzI2BkQ1jOx2EbzJyhOJ86eJwaZj5U/rkWk3guERoRdTRBaDrHzjXZ9TNJBbfknn/ryz76La+O1emlkYGM1UNHWP3rfzV3UN7nhl+hpxMtLHRIBUGsZNSc332E2pYjml0kWE1QQlmJdUOh/UbUS3lCONqoQhzl2nrQu9DGKFoojL59MiP5eurJ77+mdWf/Oz6+3v05Z/VNxhktf/3zhNRvcFzyXlk4+f2jz1fYV7ti2NSbpir5Wkp5ID0GHIjqmQWU7Yt4iMVzLKZ08mc9sHC0J8fffTWF7c/M/5C0IQLsqhQQ6zkvWH0zVt7N9/d9zHmTVOk1iCudSzSwYr7wpsU3pR8yTPb4MvPC+FT1F4gDC1B1rZSzO19c+KNbS9/aufpf5H/aFUpMG6EqJ3+3NpPuXab4F4zeKwWl3RtvLi5Z/PDG/6grE6oaDjIqObVsb//We5NIS9/dF6zarJppgbndOV5+YHX/rQkvIfW3V/9KkOy1Fa29tz8S70f2jfyExUgAZZp3vG9q9pW3bPsTvNtfevMd474XjhcJbIdrB9GHNSzOLMSnIkdb3xpZWrZPX13BvEqdFmN4ks6/v3uqnv3jexHKozCb5EoC998QxXh+0K346yId3A2AEIX36TxSlaYeOiNR96dPk1mVNVbu48s3rq2fR3jJUbRlEvRV9iCt4SdHsqf+cLbX+FCGAbJmmFfmuz9yJLbmF/W40+Dqj/AiiFbbseeoR88PfqsabNZdUXyAM1PLL2d2YmwdEKEiBXLNi1zJBB/feqbFbOmnI54li5fsK2LNq9Or1FzJujqngBYcYxYUnbb/tHnDowfNPNXFOAltSiRub37JtXVUWsSAKwYskXk+Lz87cE9dbiJRh5IrSvcb128RRFBvnmTAGC1ajZUAcVOPzV+YLA4HLglNdrYLMxc33Vth7NI+DykFGDFL2AJVdYie6Qw9OOxF4N0JoyLaFe3b1gjbZaozNQhAFbMTJZQYz2kied8/8WXZhKa2ePOXU66v30jY5XqdFwAK1ZZUBmsat+RlXjl4qGslws+N58c64bOfgkr6em2AFbcwlW1HKDCln1s+sxAfij8B+ONX9vVzyiFcgPCl1uq5F7LHWW1wXtm2tSxMeGkmersgseKe2L0X5s8Gv5oHLOWJnpXJXvlNgmtwlhnRSnbeSt/XHNlkXHQ6rTTfalljHuGIxcB1gKQfbowVI7o6dO03daX6tOj7+Gx4m7lrbHi+LnSSJgZjbU6vUI/34FUGHeXZU9XciPlsVn5sTFIta9a6fYpMIgDrLiTleelC+WJKlWNB63AVi1N9pi7NYC1EMDyeXlETQbJIhl0v8jtJHJQbgBXajj8aPlCJH5Nvne7XepZTpQbIKmLpVyVDoNUGFQcnE5HPdkLjxX7kCV/B92Fxu1CocFqd1XEgseCLJr0JqPaWIfVhlQIhXWCIs9H4bGU2px0Qpl3gAXzzkShkvcj6IQmzQQ5Cix4rLiHK6bn+4qAq8CeJSy3w2lDuQFSqjBfGHfwVdHUsyfCY0G6V6focT+izc1aGBhgxTgXyl8WkWU+RZeoS4pIhVBks+AGK/Go9TOZgHkHVsywTn5JBAxmfYfHgoRI2k5US8aF08sjFUKSrJSTsi3j2WnDaQSlecfDFFAwr4cfxUM62rxXRDnnFQAWpKbmTtgJ80ZhMGyGC+YxbogGwFoIXMlXm9Nm7rGCakPBL/qijNENkFLSSkdVtsjzYtn3DdkAWAtDPON2RRL7pKa9fFnN6wewYl9rkERk3I4oCg0KrWl/2pOpEHUstAqlee
3+eiVgmq2aGg1ErMmIhFSJiMWYvcXuqVJmtNsXYxcqUJzy0ChGxmG07vW53VNubqOQY99EqRMTiaSvZE6TCKFZJHS2P6R5opMK4twh5u9O1JNHDmPE8fDqNni2N6rlzYd5jH7Iyie6lySU1MgwN27niiDRtWPIEXHmrU8vTdhsLS+dGkabAC8OFc/rpaqTCmFt34V2dXlttHpoGrZyfHy6PMsvC0OS4xytJUn/HxhApY+8+XrpwTk0D4aJAGnfrTk7q+q73Bc5dMNP5jo/nB4reJLNs4kZsOLgyLZoBKVjLXnjLk0s2pNeEHxpv952pY3plCktgUpD4uSq9VgDpZV1F5Rc6r+7TTcJI1qPW8+RGsHwKwGpJVyVq1074W3pudMhmURQbKrzyeu4dlcdUuMII0lgadv0nt6zU7YtuqX1qqFPFwYH8ACNX1xpg3uOYDHX9UpQ2dWy8pfuGgCsKJ6dtHIh3Jk+OlcaZ5ej16RCx4uixNEC8/PGlt7U76drHdPlPMIs6O/VS9lUhikQWM11gFWC1qMdS0clL2B2/3vdxs03xGodciIPZlxlz9fLjhElB4kqWn7+td8sHu68zyX2kV+oN/v9j+VOHsm8zO6U/FFjFPoa5UOjVuezPr/+9WnvQoBUgghHJz44fnCjpzpyw3QmPFTuPJcPV5MeW3nbHkq2GrUEKniUk4ozvHT0QTOgnomhjAqyWYSlw2vrNS7uZv+jfkSA3eFrVKGTp36fygz8df5HZybqebHisWLiqILjo61WZ+rNND31QVRmEaYWcwqGBPxzbd6E0wqxEVHsMsFoFLU5SkiNv/J5V276w/o9rkcxkzgY9cx953P/O4A8YOeY9OQCr9XKhkMHFy9665I5dH3jMtWwhOA9mshKGqZDtHz/48oVDzEpFuMMAK7pLb2Z537vSrVyU4CVWHt++atu/3rhzkdsdWG6LMcN5rIKK6s6B3Z7cvvksSHXCsJlImv9UXerbMmOTgq1Q1T6riCQDU3kik+zd0b/j4Y1/JA27CMfHNAaUHmujjJWl06v1/MWX/2N4H7PbKZLFygFWlM5aX2aFhcmgACFq8UcVxH2PsTITpZSz+N61v/knGz5zfdc1odnSBYKG9zVo71mKWkua/8eO76x405ab4cQi9FgAK4KAVfKnmDehu0d4w88ghP3HltwMMcvtcrve13Hd7Us+dO+yu27IXFvXMjQcgCz0NO48uBN+NHpg7/DTzGnnLNJ4BbCicKlia+/WtJtJqYmERGNOWmcn6nQ6ehOZ1cnlGzvWbWrfsL5tdara/tedwqQDDlVjW8NZW27AktvJermH3/4Kl1uzHGni9KBUgNU0ssl5tH/H/DQNwunXDbvxKBy68FfH/u71iSPMyTR8P6BVuGBancZ+kILSFdtz/umvHd/J7M5otw+wYtuAVW9Hp45/9vUv+ir9zRUAACtuZNFQceS3Dj84VBy07PTcfQ/AipeGy2OfPPzA4eyr5HTyaNuBAGvBS4RvtapU+FzPQGFo2yt/+NzIc8zpElGbKoAVA66EEMHoveChVl13fTX31ideuf/g+AuUyMzgB7Cgy2lAhpVUvSaO8uu7zjzx4Zfuey33FnMzcx2rAqGOtSC5ErXxf29PnXj03b95/Oz3mOWS3RFlrw3AimPbj9hIeXzXwON/e/KfRguDzO2U11qQYGKe9qAVwIriHqt2gujBcsHwAGGRoOY/+DAI1R+E/iEsnwuqPmUzcyynCkO7zz75rcEnj0++w+w2mf70x3zeqGoNsARRiJZofHw3qfl+wkeIVT+vShW8ev9GMF9ZFLePoFlHV3uOnoX8sOCe0EMTqNqzUzd+JleZ+smFg3vO/2jvyH4VpaykbP0RI3ElDqcFwLJm3KbxA0nqyvDqyJHatD9NEbcoHDBT3ZvwGfc6fsJxebP2Nu8XTuTP/Cz31v7xF5698F8np05yUWCWjlJhdBZX5ACbHyxuWVan224OgE1OFTAd+QRLkt1EB0qzD5EuzYglXir6pQlvaqQ0drIwcHTq2JuTJ/57+t3T06ezlax60tBOqhcliKtEaXHOyYpmcqMFCBa5OS//zTPfTTttKldc1kmqzyyCDarJgC1tTtRSDsxxj+XP7B76dyF4cxwpBdZJ/i5US
3hVWLvHyhDc94eWmvVy2PDlWuTBSHhstZbP+tFeZUiSpA3SYLY+l3ZLO3Ko9uyXCMTBqfBhdodtk76a6e0Q0IVnqDKrl83yjoK5YSpLlCEEzY+bkNtWiMc0BVj0BAetU59+Vs7IZ6Ze6PaxmvV4tkwr1w3SUCM9742Dpm3hmlp9gJKbF7NTsBlcTtVlm9ujnIySa+bK1SB2LqqO8hcEWqva3+pRn3SjfJqw7UKsg1NJgCfpf5raxYpgQ4aaqJYamKDX8PHzEJYgJgDV3OTGS01u3CRItEBJItGLQaqkuHdH0G2yJo54XYXQDBLAggAUBLAgCWBDAggAWBAEsCGBBAAuCABYEsCCABUEACwJYEMCCIIAFASwIYEEQwIIAFgSwIAhgQQALAlgQBLAggAUBLAiKAixqhcmpoVbRzGwzQuBsQHMA1oLW3MVi3I6xBguXH+YdAlgQBLAggAUBLAgCWBDAggAWBAEsCGBBAAuCLtH/CDAAZCT4D0CXXHsAAAAASUVORK5CYII=","E*TRADE":"iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAABWVBMVEX///90WMZmM8zt7e2YywDD21/u7u7r6+t0WcV0V8fC2luXzwBgJNBxUMZdIM6+2U/x8u90Vcnw7/LXzPHl8MDLv+XY5LPC21hjLsytnOPb8Kjs98Omlt3i7ridgeDR5p1uTsmb0wDq7OXv6/qSfNTCtuL9//jt9dP3++jP44ecgN+XxwClieVtSa9iKcyk1BKx1km5p+Dd58LG5H7e2umMc9PJ4W2rm9ro9bnk6Mve1/LZ5qqGbNLV5ZWijd7j3fP4+uzm69zl4+nc1+eMctTp5Pi6rt3NwO3SzOPBsu7d8oySjZy5zWSEeKmwvnR5Y7ikqoSXlZWKf6S1xG5+bLKosn10Wr6bnJGOh6OgoopsSc1/a7S4yWaHmlVvVqSSuRR6cYaCi2toOLmKokt2aZJ+g3WPrTNzYJx8e32FlF+LqEJxWKGDWdhuT6l0RdNrP7WOaNuu2DdWAM1aWLj6AAAOk0lEQVR4nOVd6X8ayRGdETAChqNpHYO1soWRzOF1QAgZW6cl+ZC82Vx7OBsnm/uO47Xy/3/IHIA45uh63SPG3vpUX6hfP6qm36vqHtA0x1KGYaQ+UU9LyDp+VAhTyUVoqEHIeBwIbVuW9vYfbzL5KHzQrnOFq3JdD+yylMeWnxT12rZklFSKN8v58lPO1azK8dSUlsHW9KKu53akS8vI2GYNDmyM0qty4ylCuL9j47Otdsjk4vEjy4GYKY9LNRkIe7Wc7tmxJMJ6OeOZZR0pQnjzSC5Dnh1rJVvRs0OExQdMJh4/sTIjswYteFVT68M/PNxBd8YJdCwnFa9VzkxY+aSeQqJMeVpoisUKNDsBUC/2ZOJ9kZ9EaJfquuz6ZBEeZov6jNmMAcdrTqXQTaNbqotCyLZPa7P4bDvFVzTIzyLM5MsnjcVoGoMZvWLOB2Cu9gzUIPwzaw6gW6qrjgC4fU1zeFzM+gC07TFD4tlmzafQS+N4V0VWivEh46c1vwR6T+IaOZ7rbfimcFiqt8z4rBeMz65THUJ4NrfNzJbqrSFkV/M76JRVXiMI24EpHO6q50hbhWiaC98ddLpOOSHe0Jtnitk0lk9SnLRSSNMYxivfHXQmiZuM+LWl+CAC4LBUY9Y0Brs6Di/QURKfM1pB8fXwGvUsD5QqDeFFyA46ZbkdIsJlEYAuxpM4ET6oVITw6Xq2tsJI6zgSRJjJW9YegjBSH3gUL5ZAN4lZQzCy64UyxVwa+y3xyOKaRmAHnbLiJRNXHrztr2aCrLw1sasq0jSXRdECHdVp8UKYtfgBIYWuiZeqIONzsR10ynKbTBjhIE/LoZPGvlKEWoDGDkVoM4Ygwj1qCm3LCyMU0zQr9By6jCFG9nR8dg5b0ZEpmobtiG+jY6sdiimPp6JMMWHWhqi60YTKyDCe03ZSL4nHQqzVCGgLwxE2uGLGZ5tAEotr2nJkZH6CALyrXtNwAt2PrRIdmZ8j20xGvaZZ1l4FDS3CEPZYVGTeB1JYbsagaVIpegq90WJ45Mi20C+FfR7HnIatIYxxGhVZoC2cTyGhhaJMMdhj+pPojBZDI98FUmidECY2JIRXCGO8CI3cAKgwU64Lr1lc03i0f4rQ/kpY5OABYkgKn1JGGaKaxvO2kSTqE4/9bGSEKTL54Hjyc5onxBZKd7qoXnC3HzFA9LXyHu1wmIZwGShTvXIRFA9hisyAeMBPQ2jgjOEXD2KKA+FNhqppXA9jjJf+8VYRsm/zmM+eDpHNZof5xkN6ivKZ6ErHnjgfeh7EGGtGai4eFx4gTpi1QSlQKuN7HsQYWZ95Rr2MdE2ElaIItR6dMfTiq7kROEeYAri4gJw9AQhzlYtZmj5AUji4hbMnW7tdAoxRfDITBW0L6QnRyGlPacfIZrM99ThwaIDYpq4URXhYA7r90+kLbxmQKW4HobYDPIq1q4kROM4UMEJRTeN5CGPox+MrfSleRwSp1aCvdOQSNI3rMaDH0IuXN1FOkJ5iHbw3TOZDx7uoAPI0N47SQraZgegIWJrxHY+9Ahij0htFIZ4Weils3ipCw8AYw/0shwaIbWCTQTWN4xkriDw99Z56nxuIkQDLLdL6pDSN57EdAGHxyvnoKsIUJ3xW9sWpaRwzngveO5mC+Nj+JHbUVAcKVILxHY9t0hkj54wWkQGizRS3j9C4AE5qclnSvZIbg64lSmga14MYo/j6C4Qp9hZyR1jTssihKf3WxfBSAn19MprG81aAOi3+lF6l5XP4UcIZ3/Og0eKX1CTaTLEwhMhhVOVnxCTmy3V0fTKaZkj7p4ACr/2cRhfWEUfXJ6VpPI8D3X7uF6QkOpcS4PXdGFYAttcDGKP2S0oSnUsJ+PrkEWo6sNnoBIT5gdz65BECPUa2+CvxOvWurylACGiaofciVsZwBohy65PSNI5nXAE9RuUr0SSWG5LrU/AuN3R94e3XYkm0jqQKVJ7x3QjIaLHyjVAS83m5R1ANwpTWQ0Y234r0weVVFQhlNM3QQ0aLbwSS6DKFDNkr0DTuF8UeAD1G7dfREMsH0l/+2ORKgR2TAeq5YuTZTL4t0dmrY3wXIdRjfBdxRJp3biAmBKGB3XP/XThCawMbcivXNI5n7KtnjLw1+awvUNMMPeQw6m1oo2ity69KjabxPOgw6k3Ik5gfKFiVKsZ3DBktZmu/CU5i+SBhv8DDGXAYlcsF5tBmiiFCznFvpGmY4b0MaTDGYM+4Ap7ESuBo0TpX8b2P9pg7lUrRsYpjsIfcPLUbxYA6zVtlFfaZC9RGmMtlbfMKB/aAF/iywaNFYPbvUwkjhMjXr8jCGeNTQEgcLX6ECJ3RopKCDEGYgt67U2Y5PU6Ed533o7A3C9UZZbQIIHQYf8EIdfph1MeGsPgVcpeWgHDBz6FD+18D58KiCD1Ns1iEeuW3cT2JiWALx2rfxkT7iUEY2ih+EgiFRosfN0K9GAvAZGgazyrfxZLEZGga13JvI0aLMMIkML5rlW/i2GyShDCeRjEhmsaz3Jt4ECZC03gWR49xwxbZBJj+Rn2jaE1MohZv+tsvrbxiG83a7nWWkmClz9OqzdzwED6qLhqcY9Uf7itHmPbeGmYPE4Gw9L16gOktT9PcSwLC6u9jSKGN0GX8RCAs/SEGgElCWPhjHCn0ECbjOeyo30g9hK6mebR4tij8yYwF4YgtFo6w+ud4ACYHYekvnzjC6n9j2WYmEC56p4mHKcYIF7+Xdv4aVwoTommqMTGFhzAJjF/4W2wpTAbC6lJs+BKiaUrfx8QUHsLFa5rqT+Kr0WTwYenvMaYwCQg7/4gzhUlAGMNwxg/h4naawj9jTeFI07woFUqOFRzDPQBgCFOYSuzE1TTG1draimNrjuEeUAmFfwVtM91121YdW5fxzrl3g5Z5PzDKHEO9s03601z9IXAfNdc5997gdu7D4p7CW9D7QJWW/h38BHWV3KBV9d6Tg/CYXqSd/4RtM22pN7iVvvfkeOywBKQwtC00z6RXpe69J/tJfgekMGKAOJBelcq3gh7QUxjZFprgT1/FgtAg4xMZIF4n570ndoe+kQoMEM11iV+lUfveE0eYQmCA2JVa1dhTwIfAEavQANE8kSxQVW8FPVPOFCO730gGwg8AUwgOEPtJ0DRsBUhhQbAtNNFf2lOqaej4CAPEXfpPIyvXND2AKQgDxIX/LzfGFIQBYnfhCIEhD2mAaJJ/Zl6xpnmJMAVpgHgf+/VgVZqGIUxBHCCS/tvJz5PhQ2MN6CkKxNNC81zqnWc5xmfv6SmkDxB3F4gQYYoqEZ+dROJf56jUNMCwPHiAGGzXMrQvo2nYKTJARIbcpL+wUqdp2HOE7Fe6AML7Mo+SBEKAKaoftFUAoSnzWzwwQqinKL3UtF0EIvkf1RVoGvYWIPuH9idbyJFonvovTwo0zSXSFnL7s9t9BGLztjWNoQFHTZ2e
3+9k6sp1e3zbjIwPEpSXvs3wDQJgW/3tcNQiho6bLURSEMbq3q2mQo6bqu3EUhDHSbYz2QU0DHTVdGaN9jiOMkT5DVjoyagEAR03VFzf/FcQPkO0U/L1dCCHEFBeT/4aEMIbZvD2EdHxLnTtT/2iFMIa5K4OQoBRSGsYUU1H4Fh1hOr06v5boNQOaZh+p0ddsJgrEGHx2Lc4Pl6nXNA+BtvDt3P8friObzdZNt8+0RrtrmtdHETMOgPGho6aVuXgQY5j1cRTeTHfvNvfa5q5yhAhTfPD5l85zmDE8dWtvPK3mHj83MxEIqZoGagv32Xw83keS2BpGsflGOzKv79+vH7ksok7TIJcSOqe+8RoAQme06EXpDra30rxprjbc+3nKNA3UU3QC4iE9hjn8X6SGrVOP0rvdvo21HzrjoCE0LpCeohcUD2QM97Ppvo1wPd/VGhFTHBpChhw1vQ/8b/VVRLttefSQ6fIt02iazVUnrco0zRWyzawZgfEQxujWXVJsmf2DtqG1V7vXPHTNJE0DDhAD4xnQVKrvrplvmINWo773efo8YvUEPmTAUZM7QAyOjDGG99nmddo004N6+KkGifHZezrAzqPQyA1kKmXxlBel1Tyoc4WqjQFHTUsFHh4ZmkrtjbeW6Mt9BE1jXCBHTa+jIiOMcR1K8bimAY6alt7bX2doZI70GOZT0TWPTYQPt5Ft5pJFRYZ6jK7gmmkIjwGyfxcdGZtKEf6DXBQhdtR0KBAZ7TFUz2mQo6bqQ5HIKajHyCg/e4IGiPtMRC1BUylzTyAySdMgR02bPp29X8PCIcYQfLxEGf8OwBRVYS0BTaXuKkXI/wdcDXrFRBHCjCGEUEzTHL6jPofVdyyC7Cc8gDF2W0KRhTUNY5cdWqGWVsQiex6RMczuqrDc1ITKyPVOS4RSrR4HdvZ+XoOURNJrCgSE2ssP4qVa2jcoCDUKY2TOKJEpCDXtwXvBBqpzOjfGD/fEGeOaeJFviFBQHzBjsyT0OHaWibde+LogwC3OaZHJZ0/bLwQex9Jr4XhjT4QxzH5DfKX42dNVdKm+p8QbetFTKXP3gH7TFLltYrBeBHN4TEFEGMkY3XXkcht2n4ZdPAorVWeACCAMnUqZZptDFxTB+zQGexbCHKXn1HieFzaVshmCftFE4j6N82MDD5YCSrXzCLxaHcgYZnePwy+va+S0j0s1iDkKHIpnd/sBd6VMqX9CxBEaBts+9inVQg+Nl/JjDNNhCDSeLELbW/FhDol4Poyx25RZ3w1CQX3g470uTJeqcwMRjzfLGOaR7PrommbGY4zfm2QOuy2UiVefTmIbXJXqd7mfTbTHpSupeHzrBqJptWRWpckw/px3WR2Waudh5JA73BszhtmVf31UIUJtedgel7Yl4417jC0u87aTtKaZ99hzR+R07kjHc6dS5uCcq1iVjKbx8RzmWE5Jxzswzes96SgqNM28xzZ7xM7ez+P9I0UFqoTxpz0mNuSO8Dj+BlDsCI2U0rWpRHizAX563v8BFPYI9ilSB/kAAAAASUVORK5CYII="},o=e=>{let t=a.HPH(r),n=a.I6j(t=>a.mKk(t,e),t);return n?r[n]:null},i=e=>"WEBULL"===e,l=e=>"PUBLIC"===e},65694:(e,t,n)=>{n.d(t,{Ay:()=>x,K$:()=>g,Q5:()=>v});var a=n(12115),r=n(33624),o=n(10833),i=n(84245),l=n(83011),s=n(62346),c=n(48298),d=n(55312),u=n(61805),m=n(26258),p=n(45424),y=n(6390),h=n(7895);let f=Object.freeze({recommendations:[]}),g=e=>[...(0,i.Fl)(e)],v=()=>{let e=(0,o.j)();return async()=>{await e.invalidateQueries(i.I7,{exact:!1}),await e.resetQueries(i.PN,{exact:!1})}},x=e=>{let{portfolioId:t}=e,n=(0,o.j)(),{isPortfolioRecommendationsDisabled:v,isPortfolioRecommendationsEnabled:x,isDisabledFlagLoading:A,disabledReason:S}=(0,u.K)({portfolioId:t}),{data:b,isFetching:C,isLoading:I,isSuccess:w,isError:P,refetch:k,status:F,error:T,hasFailureTerminal:E,hasSocketWaitTimedOut:Y}=((e,t)=>{let{isLoading:n,isFetching:r,data:l,triggerQueryKey:s}=((e,t)=>{let n=a.useMemo(()=>[...(0,i.uj)(e)],[e]);return{...(0,o.I)(n,async()=>{var t,n,a,r,o,i;let l,s=g(e);p.q.resetQueries(s);let d=(0,y.Nu)(e),u=(0,y.aY)(e);(0,y.Cy)(e,d,null);try{l=await c.Ay.triggerPortfolioPersonalizedRecommendationsComputation(e)}catch(t){throw(0,y.Cy)(e,d,u),t}if((0,y.Cy)(e,d,null!=(a=l.runInputs)?a:null),console.info("[PersonalizedRecs] trigger response",{portfolioId:e,status:l.status,taskId:l.taskId,message:l.message,syncRecsCount:null!=(r=null==(n=l.payload)||null==(t=n.recommendations)?void 0:t.length)?r:null}),"completed"===l.status){let e=(0,m.YX)({recommendations:null!=(i=null==(o=l.payload)?void 0:o.recommendations)?i:[]});p.q.setQueryData(s,e)}return l},{enabled:t,staleTime:1/0,cacheTime:1/0}),triggerQueryKey:n}})(e,t.enableQuery),d=(0,o.j)(),u=g(e),{data:f}=(0,o.I)(u,()=>d.getQueryData(u),{staleTime:i.gz.staleTime,cacheTime:i.gz.cacheTime}),v=null===f,x=void 0===f&&!!l,{hasTimedOut:A,retrigger:S}=(0,h.gH)({queryKey:s,isWaitingForSocket:x,diagnosticLabel:"PersonalizedRecs",onRetrigger:()=>{p.q.resetQueries(s,{exact:!0})},onPoll:()=>{p.q.refetchQueries(s,{exact:!0})},initialPollMs:h.Px}),b=r||x&&!A,C=n||x&&!A,I=!!l&&!!f&&!v,w=v||A,P=w?Error("Recommendations failed to load. Please try again."):null,k=I?"success":w?"error":C?"loading":"idle";return a.useEffect(()=>{w&&console.error("[PersonalizedRecs] error state reached",{portfolioId:e,reason:v?"FAILURE_SOCKET_SENTINEL":"SOCKET_WAIT_TIMEOUT",hasTriggerResponse:!!l})},[w,v]),{data:f,isWaitingForSocket:x,refetch:a.useCallback(async()=>{S()},[S]),isFetching:b,isError:w,isLoading:C,isSuccess:I,error:P,status:k,hasFailureTerminal:v,hasSocketWaitTimedOut:A}})(t,{enableQuery:x}),D=null!=b?b:f,{data:R,isFetching:N,isLoading:M,isSuccess:L}=(0,s.zl)({disabled:A||x}),{isFetchingRecommendations:_,recommendationsCount:O,isLoading:W,isSuccess:B}=A?{isFetchingRecommendations:!0,recommendationsCount:0,isLoading:!0,isSuccess:!1}:x?{isFetchingRecommendations:C,recommendationsCount:r.kuo(l.ay,D.recommendations).length,isLoading:I,isSuccess:w}:{isFetchingRecommendations:N,recommendationsCount:(null==R?void 0:R.count)||0,isLoading:M,isSuccess:L},U=A||_;return{personalizedRecommendationsData:U||v?f:D,personalizedRecommendationsQueryStatus:F,applyIgnoreToCachedRecommendation:e=>((e,a)=>{let o=D.recommendations,i=(()=>
3{if(a===d.$.Ignore)return(0,l.S3)(o,e)})(),s=r.VxE(D,{recommendations:i});n.setQueryData(g(t),s)})(e,d.$.Ignore),refetchPersonalizedRecommendations:k,isFetchingRecommendations:U,isRecommendationsInitialLoading:W,isRecommendationsLoaded:B,isRecommendationsFeatureDisabled:!!v,isRecommendationsQueryError:P,personalizedRecommendationsQueryError:T,disabledReason:S,recommendationsCount:O,hasFailureTerminal:E,hasSocketWaitTimedOut:Y}}},65767:(e,t,n)=>{n.d(t,{u:()=>o});var a=n(62848),r=n(6915);let o=()=>{let{statementEmail:e}=(0,a.i3)(),{isGuestSession:t}=(0,r.Cs)();return{statementEmail:t?(e=>{let t=e.indexOf("@");if(-1===t)return e;let n=e.substring(t);return"".concat("statements+xxx").concat(n)})(e):e,isMasked:t}}},65782:(e,t,n)=>{n.d(t,{Bx:()=>m,Cd:()=>h,iK:()=>p,nM:()=>d,pN:()=>y,vV:()=>u});var a=n(10833),r=n(55805),o=n(73070),i=n(17667),l=n(84245),s=n(50202),c=n(9974);let d=e=>(0,a.I)([...o.DI.AllParams,e],()=>r.gO.getAllScenarioParams(e),{...l.gz,enabled:(0,c.KH)(e)}),u=(e,t)=>{var n;let a=d(t);return{...a,data:null==(n=a.data)?void 0:n.filter(t=>t.category===e)}},m=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(0,a.j)(),{activePortfolioId:n}=(0,s.RW)();return async()=>{e?await t.invalidateQueries(o.DI.AllParams):t.invalidateQueries(o.DI.AllParams),t.invalidateQueries((0,l.Q7)(n))}},p=()=>{let e=m(!0);return(0,i.A)(e=>r.gO.insertScenarioParam(e),{onSuccess:e})},y=()=>{let e=m();return(0,i.A)(e=>r.gO.updateScenarioParam(e),{onSuccess:e})},h=()=>{let e=m();return(0,i.A)(e=>r.gO.deleteScenarioParam(e),{onSuccess:e})}},65879:(e,t,n)=>{n.d(t,{F:()=>s,S:()=>c});var a=n(33624),r=n(32189),o=n(50202),i=n(544),l=n(35208);let s=e=>{let{portfoliosList:t,portfolioId:n}=e,o=(0,i.Fk)(t,n);if(o){let{portfolioType:e,source:t}=o,n=a.aIS(e,r.N$.Main),i=a.aIS(e,r.N$.Group),l=a.aIS(e,r.N$.Current),s=a.aIS(e,r.N$.Draft),c=a.aIS(t,r.GB.Demo),d=a.aIS(t,r.GB.Manual),u=!!c||!!d;return{isInvestmentsEditable:s||l&&u,isIdentifiersEditable:s||l&&u,isCashEditable:l&&u||s,isTradesComparable:!0,isClonable:n||l||i,isOptimizable:n||s||l||i,isResettable:s,isRecommendationsApplicable:s,isDeletable:s||l,isDemoSource:c}}return{isInvestmentsEditable:!1,isIdentifiersEditable:!1,isCashEditable:!1,isTradesComparable:!1,isClonable:!1,isOptimizable:!1,isResettable:!1,isRecommendationsApplicable:!1,isDeletable:!1,isDemoSource:!1}},c=e=>{let{portfoliosList:t,currentPortfolios:n}=(0,o.RW)();return s({portfoliosList:t,currentPortfolios:n,portfolioId:e||l.RI})}},66638:(e,t,n)=>{e.exports=n.p+"static/media/realEstate.c195a870adae6928.svg"},66866:(e,t,n)=>{n.d(t,{T:()=>a});var a=function(e){return e.Forecast="Forecast",e.History="History",e.Range="Range",e.Percentile75th="75th Percentile",e.Percentile25th="25th Percentile",e.ForecastDraft="Forecast (Draft)",e.HistoryDraft="History (Draft)",e.RangeDraft="Range (Draft)",e.Percentile75thDraft="75th Percentile (Draft)",e.Percentile25thDraft="25th Percentile (Draft)",e}({})},67297:(e,t,n)=>{n.d(t,{A6:()=>y,C6:()=>l,UE:()=>u,X5:()=>d,_F:()=>m,a8:()=>i,bJ:()=>p,gp:()=>c,jN:()=>s});var a=n(57090),r=n(12115),o=n(84978);let i=[{label:"Securities",description:"Brokerage accounts for stocks, mutual funds, bonds, ETFs, options, crypto, and more",icon:n(76608),assetType:o.q8.TotalSecurities},{label:"Real estate",description:"Your home, investment properties, and land",icon:n(66638),assetType:o.q8.TotalRealEstateHoldings},{label:"Private equity",description:"Private equity funds, angel investments, options from pre-IPO companies, etc.",icon:n(76608),assetType:o.q8.TotalPrivateEquity},{label:"Cash",description:"Savings, checking, loan, credit card, etc.",icon:n(81847),assetType:o.q8.TotalCash},{label:"Other assets",description:"Automotive, pension, annuity, loan, jewelry, art, custom, etc.",icon:n(76608),assetType:o.q8.TotalOtherAssets}],l={[o.q8.TotalRealEstateHoldings]:{headerLabel:"Real Estate"},[o.q8.RealEstate]:{headerLabel:"Estimated property value",description:"Enter the approximate total (gross) property value of the real estate you own"},[o.q8.RealEstateMortgage]:{headerLabel:"Outstanding mortgage",description:"Enter the outstanding mortgage/loan on the real estate you own"},[o.q8.TotalPrivateEquity]:{headerLabel:"Add Private Equity",description:"Enter the total amount invested with private equity firms, angel investments and estimated current market value of options from pre-IPO companies"},[o.q8.PrivateEquityCompanyEquity]:{headerLabel:"Estimated current value"},[o.q8.PrivateEquityStartupInvestment]:{headerLabel:"Estimated current value"},[o.q8.PrivateVentureFund]:{headerLabel:"Estimated current value"},[o.q8.PrivateEquityPrivateCredit]:{headerLabel:"Estimated current value"},[o.q8.PrivateEquityRealAsset]:{headerLabel:"Estimated current value"},[o.q8.PrivateEquityOperatingBusiness]:{headerLabel:"Estimated current value"},[o.q8.PrivateEquityCustom]:{headerLabel:"Estimated current value"}
3,[o.q8.OtherAssetAutomotive]:{headerLabel:"Approximate current value"},[o.q8.OtherAssetJewelry]:{headerLabel:"Approximate current value"},[o.q8.OtherAssetArt]:{headerLabel:"Approximate current value"},[o.q8.OtherAssetCollectibles]:{headerLabel:"Approximate current value"},[o.q8.OtherAssetNFTs]:{headerLabel:"Approximate current value"},[o.q8.OtherAssetsPhysicalMetals]:{headerLabel:"Approximate current value"},[o.q8.OtherAssetsPreciousGemstones]:{headerLabel:"Approximate current value"},[o.q8.OtherAssetsSportsMemorabilia]:{headerLabel:"Approximate current value"},[o.q8.OtherAssetsWinesSpirits]:{headerLabel:"Approximate current value"},[o.q8.OtherAssetCustom]:{headerLabel:"Approximate current value"},[o.q8.OtherAssetLoan]:{headerLabel:"Remaining loan amount"},[o.q8.Pension]:{headerLabel:"Net present value"},[o.q8.Annuity]:{headerLabel:"Net present value"},[o.q8.CashNonInvestable]:{headerLabel:(0,a.FD)(r.Fragment,{children:["All cash that you don't want to invest",(0,a.Y)("br",{}),"(savings, emergency fund, etc)"]})},[o.q8.CashInvestable]:{headerLabel:(0,a.FD)(r.Fragment,{children:["All cash you feel comfortable investing",(0,a.Y)("br",{}),"(held outside of brokerage accounts)"]})},[o.q8.TotalSecurities]:{headerLabel:"Add Securities",description:"Enter Securities Net Value"}},s={[o.q8.PrivateEquityCompanyEquity]:{typeLabel:"Company equity",optionLabel:"Company equity (employee / founder)",nameFieldLabel:"Company name",sectorFieldLabel:"Sector"},[o.q8.PrivateEquityStartupInvestment]:{typeLabel:"Startup investment",optionLabel:"Startup investment (angel / SAFE / note)",nameFieldLabel:"Investment name",sectorFieldLabel:"Sector"},[o.q8.PrivateVentureFund]:{typeLabel:"Venture / PE fund",optionLabel:"Venture / PE fund (LP)",nameFieldLabel:"Fund name",sectorFieldLabel:"Sector"},[o.q8.PrivateEquityPrivateCredit]:{typeLabel:"Private Credit",optionLabel:"Private Credit / Private Debt",nameFieldLabel:"Investment name",sectorFieldLabel:"Bond type"},[o.q8.PrivateEquityRealAsset]:{typeLabel:"Real Asset",optionLabel:"Real Asset (e.g. real estate, infra)",nameFieldLabel:"Asset name",sectorFieldLabel:"Asset type"},[o.q8.PrivateEquityOperatingBusiness]:{typeLabel:"Operating Business",optionLabel:"Operating Business",nameFieldLabel:"Business name",sectorFieldLabel:"Sector"},[o.q8.PrivateEquityCustom]:{typeLabel:"Other / custom",optionLabel:"Other / custom",nameFieldLabel:"Investment name",sectorFieldLabel:"Sector"}},c={expectedYearlyIncome:!1,amountInvested:!1,investmentYear:!1,distributionTimeline:!1,expectedIpoYear:!1,managementFee:!1,carry:!1,percentageVested:!1,strikePrice:!1,numberOfShares:!1,ownershipStake:!1,customTypeName:!1,capitalCalls:!1},d=["customTypeName"],u={[o.q8.PrivateEquityCompanyEquity]:{expectedYearlyIncome:!1,amountInvested:!1,investmentYear:!1,distributionTimeline:!1,expectedIpoYear:!0,managementFee:!1,carry:!1,percentageVested:!0,strikePrice:!0,numberOfShares:!0,ownershipStake:!1,customTypeName:!1,capitalCalls:!1},[o.q8.PrivateEquityStartupInvestment]:{expectedYearlyIncome:!1,amountInvested:!0,investmentYear:!0,distributionTimeline:!1,expectedIpoYear:!0,managementFee:!1,carry:!1,percentageVested:!1,strikePrice:!1,numberOfShares:!1,ownershipStake:!1,customTypeName:!1,capitalCalls:!1},[o.q8.PrivateVentureFund]:{expectedYearlyIncome:!1,amountInvested:!0,investmentYear:!0,distributionTimeline:!0,expectedIpoYear:!1,managementFee:!0,carry:!0,percentageVested:!1,strikePrice:!1,numberOfShares:!1,ownershipStake:!1,customTypeName:!1,capitalCalls:!0},[o.q8.PrivateEquityPrivateCredit]:{expectedYearlyIncome:!0,amountInvested:!0,investmentYear:!0,distributionTimeline:!0,expectedIpoYear:!1,managementFee:!0,carry:!0,percentageVested:!1,strikePrice:!1,numberOfShares:!1,ownershipStake:!1,customTypeName:!1,capitalCalls:!1},[o.q8.PrivateEquityRealAsset]:{expectedYearlyIncome:!0,amountInvested:!0,investmentYear:!0,distributionTimeline:!0,expectedIpoYear:!1,managementFee:!0,carry:!0,percentageVested:!1,strikePrice:!1,numberOfShares:!1,ownershipStake:!1,customTypeName:!1,capitalCalls:!1},[o.q8.PrivateEquityOperatingBusiness]:{expectedYearlyIncome:!0,amountInvested:!1,investmentYear:!1,distributionTimeline:!1,expectedIpoYear:!1,managementFee:!1,carry:!1,percentageVested:!1,strikePrice:!1,numberOfShares:!1,ownershipStake:!0,customTypeName:!1,capitalCalls:!1},[o.q8.PrivateEquityCustom]:{expectedYearlyIncome:!0,amountInvested:!0,investmentYear:!1,distributionTimeline:!1,expectedIpoYear:!1,managementFee:!0,carry:!0,percentageVested:!1,strikePrice:!1,numberOfShares:!1,ownershipStake:!1,customTypeName:!0,capitalCalls:!1}},m={[o.q8.PrivateVentureFund]:"Expected time from investment to final distribution. VC/PE funds typically have a 10-year lifecycle with distributions concentrated in later years. This is modeled with built-in randomness in Retirement Planning.",[o.q8.PrivateEquityPrivateCredit]:"Expected time from investment to principal repayment. Private credit investments typically have scheduled maturities with periodic interest payments. This is modeled with built-in randomness in Retirement Planning.",[o.q8.PrivateEquityRealAsset]:"Expected time from investment to asset liquidation. Real asset funds typically distribute proceeds upon sale of underlying assets. This is modeled with built-in randomness in Retirement Planning."},p={[o.q8.PrivateEquityCompanyEquity]:{country:"US",assetClass:"Private Equity",sectorOrBondType:null,oneYearExpectedReturn:.12,risk:.3},[o.q8.PrivateEquityStartupInvestment]:{country:"US",assetClass:"Private Equity",sectorOrBondType:null,oneYearExpectedReturn:.2,risk:.4},[o.q8.PrivateVentureFund]:{country:"US",assetClass:"Private Equity",sectorOrBondType:null,oneYearExpectedReturn:.15,risk:.35},[o.q8.PrivateEquityPrivateCredit]:{country:"US",assetClass:"Fixed Income",sectorOrBondType:null,oneYearExpectedReturn:.08,risk:.12},[o.q8.PrivateEquityRealAsset]:{country:"US",assetClass:"Real Estate",sectorOrBondType:null,oneYearExpectedReturn:.1,risk:.2},[o.q8.PrivateEquityOperatingBusiness]:{country:"US",assetClass:"Private Equity",sectorOrBondType:null,oneYearExpectedReturn:.12,risk:.25}},y={[o.Ut.Condo]:"Condo",[o.Ut.Townhome]:"Townhome",[o.Ut.Apartment]:"Apartment",[o.Ut.House]:"House",[o.Ut.MultiFamily]:"Multi-family",[o.Ut.Commercial]:"Commercial",[o.Ut.Other]:"Other"}},67390:(e,t,n)=>{n.d(t,{BZ:()=>F,CK:()=>E,Hm:()=>Y,vK:()=>T,xM:()=>y});var a=n(22912),r=n(80375),o=n(73590),i=n.n(o),l=n(33624),s=n(71754),c=n(41784),d=n(36934),u=n(66866),m=n(36214),p=n(63338);let y=e=>({shared:!0,split:!1,useHTML:!0,...p.uh,formatter:e.formatter}
3),h=e=>i()(e).format("MMMM D, YYYY"),f=/ \([^)]*\)$/,g=[u.T.History,u.T.Forecast,u.T.Percentile75th,u.T.Percentile25th,u.T.Range],v=e=>null!==e&&Number.isFinite(e),x=e=>{var t,n,a;let r=null!=(n=null==(t=f.exec(e.seriesName))?void 0:t[0])?n:"",o=e.seriesName.slice(0,e.seriesName.length-r.length),i=null!=(a=g.find(e=>e===o))?a:null;return{point:e,base:i,family:null===i?"":r}},A=(e,t)=>{var n;return null==(n=e.find(e=>e.base===t))?void 0:n.point},S=e=>{let t=e.formatValue(e.low),n=e.formatValue(e.high);return t===n?[]:[{kind:"range",label:e.label,low:t,high:n}]},b=e=>null!==e.todaySeparator&&e.x>=e.todaySeparator,C=e=>null===e.delta?"":' <span style="font-size:'.concat(e.fontSize,";font-weight:500;color:").concat(e.delta>=0?s._C.deltaPositive:s._C.deltaNegative,'">').concat((0,r.Z)((e=>"".concat(e>=0?"+":"-").concat(Math.abs(100*e).toFixed(1),"%"))(e.delta)),"</span>");var I=function(e){return e.GroupStart="group-start",e.GroupMember="group-member",e}(I||{});let w=e=>"value"===e.kind,P=e=>{let t=1===e.entries.filter(w).length;return(0,p.mp)({paddingClass:"p-2",innerHtml:(e=>e.map((t,n)=>{var a;return((e,t)=>'<div class="'.concat((0,c.cn)(t.typography,"whitespace-nowrap",null!==e&&"group-start"===t.role?"mt-3":""),'"').concat(""===t.style?"":' style="'.concat(t.style,'"'),">").concat(t.html,"</div>"))(null!=(a=e[n-1])?a:null,t)}).join(""))([...(e=>[...e.isForecast?[{role:"group-start",typography:d.gI.body2W700,style:"color:".concat(s._C.text),html:"Forecast"}]:[],{role:"group-start",typography:d.gI.captionW500,style:"color:".concat(s._C.secondaryText),html:(0,r.Z)(e.dateText)}])(e),...e.entries.flatMap(e=>(e=>{switch(e.entry.kind){case"value":return[e.isSoleValue?(e=>({role:"group-member",typography:d.gI.h4W700,style:"",html:'<span style="color:'.concat((0,r.Z)(e.color),'">').concat((0,r.Z)(e.value),"</span>").concat(C({delta:e.delta,fontSize:"14px"}))}))(e.entry):(e=>({role:"group-start",typography:d.gI.captionW500,style:"",html:'<span style="color:'.concat(s._C.secondaryText,'">').concat((0,r.Z)(e.label),'</span> <span style="font-weight:700;color:').concat((0,r.Z)(e.color),'">').concat((0,r.Z)(e.value),"</span>").concat(C({delta:e.delta,fontSize:"12px"}))}))(e.entry)];case"range":return(e=>[{role:"group-start",typography:d.gI.captionW500,style:"color:".concat(s._C.secondaryText),html:(0,r.Z)(e.label)},{role:"group-member",typography:d.gI.body2W700,style:"color:".concat(s._C.text),html:"".concat((0,r.Z)(e.low),"–").concat((0,r.Z)(e.high))}])(e.entry);case"row":return[(e=>({role:"group-start",typography:d.gI.captionW500,style:"",html:'<span style="color:'.concat(s._C.secondaryText,'">').concat((0,r.Z)(e.label),'</span> <span style="color:').concat(s._C.text,'">').concat((0,r.Z)(e.value),"</span>")}))(e.entry)]}})({entry:e,isSoleValue:t}))])})},k=e=>{var t,n;return{seriesName:e.series.name,seriesColor:"string"==typeof e.color?e.color:null,y:"number"==typeof e.y&&Number.isFinite(e.y)?e.y:null,low:null!=(t=e.point.options.low)?t:null,high:null!=(n=e.point.options.high)?n:null}},F=e=>function(){var t;return P((e=>{let t=e.points.map(x),n=b({x:e.x,todaySeparator:e.todaySeparator});return{isForecast:n,dateText:h(e.x),entries:l.sbv(t.map(e=>e.family)).flatMap(a=>(e=>{var t;let n,a=A(e.points,u.T.Forecast),r=e.isForecast?void 0:A(e.points,u.T.History),o=void 0!==a&&v(a.y)?[{kind:"value",label:a.seriesName,value:e.formatValue(a.y),color:s._C.text,delta:null!==(n={value:a.y,baseline:e.lastHistoryValue}).baseline&&0!==n.baseline&&Number.isFinite(n.baseline)?(n.value-n.baseline)/Math.abs(n.baseline):null}]:[],i=void 0!==r&&v(r.y)?[{kind:"value",label:r.seriesName,value:e.formatValue(r.y),color:null!=(t=r.seriesColor)?t:s._C.text,delta:null}]:[],l=e.points.flatMap(t=>null===t.base&&v(t.point.y)?[{kind:"row",label:t.point.seriesName,value:e.formatValue(t.point.y)}]:[]);return[...o,...(e=>{let t="".concat(u.T.Range).concat(e.family),n=A(e.points,u.T.Percentile75th),a=A(e.points,u.T.Percentile25th),r=A(e.points,u.T.Range);if(void 0!==n&&void 0!==a&&v(n.y)&&v(a.y))return S({label:"".concat(t," (25-75th pctl)"),low:Math.min(a.y,n.y),high:Math.max(a.y,n.y),formatValue:e.formatValue});return void 0!==r&&v(r.low)&&v(r.high)?S({label:t,low:r.low,high:r.high,formatValue:e.formatValue}):[n,a].flatMap(t=>void 0!==t&&v(t.y)?[{kind:"row",label:t.seriesName,value:e.formatValue(t.y)}]:[])})({family:e.family,points:e.points,formatValue:e.formatValue}),...i,...l]})({family:a,points:t.filter(e=>e.family===a),isForecast:n,lastHistoryValue:e.lastHistoryValue,formatValue:e.formatValue}))}})({x:Number(this.x),points:(null!=(t=this.points)?t:[]).map(k),todaySeparator:e.todaySeparator,lastHistoryValue:e.lastHistoryValue,formatValue:e.formatValue}))},T=e=>function(){var t;let n;return P({isForecast:!1,dateText:h((n={x:Number(this.x),points:(null!=(t=this.points)?t:[]).map(k),maskedSeriesNames:e.maskedSeriesNames,formatValue:e.formatValue}
3).x),entries:n.points.filter(e=>!n.maskedSeriesNames.includes(e.seriesName)).flatMap(e=>(e=>{var t;let{point:n,formatValue:a}=e;return v(n.low)&&v(n.high)?[{kind:"range",label:n.seriesName,low:a(Math.min(n.low,n.high)),high:a(Math.max(n.low,n.high))}]:v(n.y)?[{kind:"value",label:n.seriesName,value:a(n.y),color:null!=(t=n.seriesColor)?t:s._C.text,delta:null}]:[]})({point:e,formatValue:n.formatValue}))})},E=()=>({color:s.Kc.color,width:s.Kc.historyWidth,snap:!0,zIndex:2}),Y=()=>e=>{let t=e.xAxis[0];void 0!==t&&a.addEvent(t,"afterDrawCrosshair",function(e){var t,n,a;let r=this.cross;if(void 0===e.point||void 0===r||"object"!=typeof this.crosshair)return;let o=b({x:e.point.x,todaySeparator:null!=(a=null==(t=(null!=(n=this.options.plotLines)?n:[]).find(e=>e.id===m.vv))?void 0:t.value)?a:null})?s.Kc.forecastWidth:s.Kc.historyWidth;this.crosshair.width!==o&&(this.crosshair.width=o,r.attr({"stroke-width":o}))})}},67522:(e,t,n)=>{n.d(t,{G:()=>c});var a=n(13343),r=n(16685),o=n(30414),i=n(76778);let l="WP.ActivePortfolioId",s=(0,a.A)((0,r.lt)(e=>({activePortfolioId:null,isInitialized:!1,setActivePortfolioId:t=>e(()=>({activePortfolioId:t})),markAsInitialized:()=>e(()=>({isInitialized:!0}))}),{name:"ActivePortfolioStore"})),c=()=>{let{activePortfolioId:e,setActivePortfolioId:t,isInitialized:n,markAsInitialized:a}=s(),{getPersistedPortfolioId:r,setPersistedPortfolioId:c}={getPersistedPortfolioId:()=>{try{return o.D.get(l,null)}catch(e){return null}},setPersistedPortfolioId:e=>{try{o.D.put(l,e,300)}catch(e){}}},d=r();return{activePortfolioId:e,setActivePortfolioId:(0,i.K)(e=>{t(e),e&&c(e)}),isInitialized:n,markAsInitialized:a,persistedActivePortfolioId:d}}},67818:(e,t,n)=>{n.d(t,{x:()=>a});var a=function(e){return e.System="System",e.Custom="Custom",e.Proxy="Proxy",e}({})},67883:(e,t,n)=>{n.d(t,{Fn:()=>i,xB:()=>r,yK:()=>o});var a=n(48298);let r=async e=>a.Ay.getExploreInvestmentDetails(e),o=e=>{var t;
3let n=null==(t=e.proxyDetails)?void 0:t.proxyTicker;return n||(e.isInvestmentTickerTracked?e.tickerValue:null)},i=e=>{let{tickerValue:t,investmentValue:n,isInvestmentTickerTracked:a,proxyDetails:r,displayTicker:o,assetType:i}=e;return{ticker:t,displayTicker:o,investment:n,isTickerTrackedInitially:a,proxyTicker:r,assetType:i}}},67908:(e,t,n)=>{n.d(t,{o:()=>l,s:()=>s});var a=n(57090),r=n(12115),o=n(6915),i=n(76778);let l=e=>{let{children:t,fallback:n=null}=e,{isGuestSession:l,openGuestUnlockModal:s}=(0,o.Cs)(),c=(0,i.K)(()=>{s()});return l?"function"==typeof n?(0,a.Y)(r.Fragment,{children:n({onClick:c})},"guest-user-hidden-fallback"):(0,a.Y)(r.Fragment,{children:n},"guest-user-hidden-fallback"):(0,a.Y)(r.Fragment,{children:t},"guest-user-hidden-children")},s=e=>{let{children:t}=e,{isGuestSession:n}=(0,o.Cs)();return n?(0,a.Y)(r.Fragment,{children:t}):null}},68076:(e,t,n)=>{n.d(t,{h:()=>a});var a=function(e){return e.ManualInput="ManualInput",e.CSVUpload="CSVUpload",e.ConnectedAccount="ConnectedAccount",e}({})},68099:(e,t,n)=>{n.d(t,{A:()=>y,R:()=>p});var a=n(57090),r=n(12115),o=n(43948),i=n(99026),l=n(74547),s=n(36934),c=n(95825);let d=e=>(0,a.Y)(l.aF,{open:!0,title:"Add securities for better insights",onCancel:e.onClose,footer:(0,a.FD)(c.jl,{children:[(0,a.Y)(l.$n,{onClick:e.onContinueWithCashOnly,children:"Continue with cash only"}),(0,a.Y)(l.$n,{onClick:e.onAddSecurities,variant:"filled",showErrorNotification:!1,children:"Add securities"})]}),"data-sentry-element":"Modal","data-sentry-component":"NoSecuritiesConfirmationModal","data-sentry-source-file":"NoSecuritiesConfirmationModal.tsx",children:(0,a.Y)(s.bU,{className:"text-body","data-sentry-element":"Body1W400","data-sentry-source-file":"NoSecuritiesConfirmationModal.tsx",children:"This account currently has only cash. Adding securities will significantly improve insights and recommendations."})}),{useNoSecuritiesConfirmationModalLaunchEventListener:u,emitNoSecuritiesConfirmationModalLaunchEvent:m}=(0,o.createEvent)("NoSecuritiesConfirmationModalLaunchEvent")(),p=()=>({launchNoSecuritiesConfirmationModal:e=>{m(e)}}),y=()=>{let[e,t]=r.useState(null),n=r.useRef(i.lQ);u(e=>{t(e),n.current=e.onClose||i.lQ});let o=()=>{t(null),n.current(),n.current=i.lQ},l=async()=>{e&&await e.onContinueWithCashOnly(),o()};return e?(0,a.Y)(d,{onContinueWithCashOnly:l,onAddSecurities:()=>{if(e){var t;null==(t=e.onAddSecurities)||t.call(e)}o()},onClose:o,"data-sentry-element":"NoSecuritiesConfirmationModal","data-sentry-component":"GlobalNoSecuritiesConfirmationModalLauncher","data-sentry-source-file":"GlobalNoSecuritiesConfirmationModalLauncher.tsx"}):null}},68658:(e,t,n)=>{n.d(t,{S:()=>r});var a=n(12115);let r=e=>{let t=(0,a.useRef)(e);return t.current=e,t}},69350:(e,t,n)=>{n.d(t,{b8:()=>s,B9:()=>c,bE:()=>d});var a=n(12115),r=n(93719),o=n(59225),i=n(61972),l=n(76778);let s=async e=>{let t=await (0,r.U)({namespace:e.namespace,portfolioId:e.portfolioId,variantKey:""===e.variantKey?void 0:e.variantKey});return"ok"===t.kind?t.data:null},c=async e=>{let t=await s(e);return null===t?{payload:null,status:null}:t.status===o.A.Success?{payload:t.payload,status:t.status}:{payload:null,status:t.status}},d=(e,t)=>{let n=(0,a.useRef)(e);n.current=e;let r=(0,a.useRef)(t);r.current=t,(e=>{let t=(0,l.K)(e),[n]=(0,a.useState)(()=>i.d.getInstance());(0,a.useEffect)(()=>n.onReconnect(t),[n,t])})(()=>{r.current&&n.current()}),(0,a.useEffect)(()=>{if("undefined"==typeof document)return;let e=()=>{"visible"===document.visibilityState&&r.current&&n.current()};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[])}},69986:(e,t,n)=>{n.d(t,{KB:()=>l,u4:()=>i,we:()=>s});var a=n(92672),r=n(13343),o=n(16685);let i=a.fi.xl,l=(0,r.A)((0,o.lt)(e=>({sidebarCollapsed:(0,a.Fr)(),panelControlToggleCount:0,setSidebarCollapsed:t=>e(()=>({sidebarCollapsed:t})),toggleSidebar:()=>e(e=>({sidebarCollapsed:!e.sidebarCollapsed})),toggleSidebarFromPanelControl:()=>e(e=>({sidebarCollapsed:!e.sidebarCollapsed,panelControlToggleCount:e.panelControlToggleCount+1}))}),{name:"AppSidebarStore"})),s=()=>{let{sidebarCollapsed:e,toggleSidebar:t,toggleSidebarFromPanelControl:n}=l();return{sidebarCollapsed:e,toggleSidebar:t,toggleSidebarFromPanelControl:n}}},70810:(e,t,n)=>{n.d(t,{PA:()=>i,vP:()=>r,vU:()=>s,vX:()=>l});var a=n(33624);let r=e=>{let t=e.anchorX-e.gap-e.labelWidth,n=e.anchorY-e.labelHeight/2;if(t>=e.plotLeft)return{x:t,y:n,placement:"beside"};let a=((e,t,n,a)=>{let r=Math.max(t,t+n-a);return Math.min(Math.max(e,t),r)})(e.anchorX-e.labelWidth/2,e.plotLeft,e.plotWidth,e.labelWidth),r=e.anchorY-e.gap-e.labelHeight;return r>=e.plotTop?{x:a,y:r,placement:"above"}:{x:a,y:e.anchorY+e.gap,placement:"beneath"}},o=e=>void 0!==e&&Number.isFinite(e[0])&&Number.isFinite(e[1])?{x:e[0],y:e[1]}:null,i=e=>o(a.UkB(e=>null!==o(e),e)),l=e=>o(a.I6j(e=>null!==o(e),e)),s=e=>{let{axisMin:t,axisMax:n}=e;return!!Number.isFinite(t)&&!!Number.isFinite(n)&&e.anchorX>=t&&e.anchorX<=n}},70890:(e,t,n)=>{n.d(t,{xx:()=>C,IX:()=>I,su:()=>y,DK:()=>x,Tt:()=>m,Mu:()=>p,wN:()=>A,yU:()=>c,UH:()=>f,k:()=>u,SZ:()=>h,A9:()=>g});var a=n(33624),r=n(84245),o=n(544),i=n(8662);let l=async(e,t)=>
3{await e.cancelQueries(t),await e.invalidateQueries(t)};var s=n(75128);let c=async(e,t)=>{let n=(0,r.pR)(t);await l(e,n)},d=async(e,t)=>{let n=(0,r.mg)(t);await l(e,n)},u=async(e,t)=>{let n=((e,t)=>{let n=(0,i.W)(e);if((0,o.qP)(n,t)){let e=(0,o.I)(n);if(e)return[e.portfolioId,t]}return[t]})(e,t),s=async t=>{let n=(0,r.Ld)(t);await l(e,n)};await Promise.allSettled(a.TjK(s,n))},m=async(e,t)=>{await Promise.allSettled([c(e,t),u(e,t),d(e,t)])},p=async e=>{await l(e,r.iO)},y=async e=>{await l(e,r.YU)},h=async e=>{await l(e,r.nm)},f=async e=>{await l(e,r.aw)},g=async e=>await Promise.allSettled([h(e),y(e),p(e)]),v=async e=>{await l(e,r.rF)},x=async e=>{await l(e,r.db)},A=async e=>{await e.invalidateQueries(r.gy),await e.invalidateQueries(r.GO),await e.invalidateQueries(r.Ni),await e.invalidateQueries(r.Yu)},S=async e=>{await l(e,r.DY)},b=async e=>{await l(e,r.c5)},C=async e=>{await l(e,s.ub.Preferences),await l(e,s.ub.SimulationResult)},I=async e=>{(async()=>Promise.allSettled([b(e),S(e),v(e),C(e)]))(),await x(e)}},71456:(e,t,n)=>{n.d(t,{A:()=>w});var a=n(57090),r=n(12115),o=n(62212),i=n(95777),l=n(99026),s=n(8662),c=n(36934),d=n(46842),u=n(92672),m=n(89568),p=n(56888),y=n(74743),h=n(11),f=n(544),g=n(89703),v=n(41686);let x=e=>{let t=(e=>{let t=r.useRef(null),n=r.useRef(!1);return r.useEffect(()=>{!n.current&&e.canSeed&&(e.currentName.trim()||(n.current=!0,e.onNameChange(e.seededName),(0,v.E0)(()=>{var e,n;null==(e=t.current)||e.focus(),null==(n=t.current)||n.select()})))},[e.canSeed]),t})({currentName:e.inputDraftPortfolioName,seededName:e.seededName,canSeed:e.canSeed,onNameChange:e.onPortfolioNameChange});return e.hideInput?null:(0,a.FD)(u.Ah,{flexDirection:"column",alignItems:"flex-start",itemsSpacingVertical:4,occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-component":"DraftNameInput","data-sentry-source-file":"DraftNameInput.tsx",children:[(0,a.Y)(c.km,{className:"text-body","data-sentry-element":"Body2W400","data-sentry-source-file":"DraftNameInput.tsx",children:"Draft name"}),(0,a.Y)(g.W_,{inputRef:t,placeholder:"Enter a name for your draft",onChange:e.onPortfolioNameChange,value:e.inputDraftPortfolioName,autoFocus:!0,"data-sentry-element":"PortfolioNameInput","data-sentry-source-file":"DraftNameInput.tsx"})]})};var A=n(26214),S=n(39510);let b=e=>{let{isNameFieldRemoved:t,isResolved:n}=(()=>{let{flagValue:e}=(0,S.$L)(A.mr.Test397FirstDraftRemoveNameField,A.yS.Control),{areFlagsResolved:t}=(0,S.$I)();return{isNameFieldRemoved:e===A.yS.Variant1,isResolved:t}})();return(0,a.Y)(x,{seededName:e.controlSeededName,canSeed:n,hideInput:n&&t,inputDraftPortfolioName:e.inputDraftPortfolioName,onPortfolioNameChange:e.onPortfolioNameChange,"data-sentry-element":"DraftNameInput","data-sentry-component":"FirstDraftNameFieldRemoval","data-sentry-source-file":"FirstDraftNameFieldRemoval.tsx"})},C=e=>{let{isBenefitFramedFirstDraftName:t,isResolved:n}=(()=>{let{flagValue:e}=(0,S.$L)(A.mr.Test381FirstDraftBenefitName,A.WE.Control),{areFlagsResolved:t}=(0,S.$I)();return{isBenefitFramedFirstDraftName:e===A.WE.Variant1,isResolved:t}})();return n?t?(0,a.Y)(x,{seededName:"My improved portfolio",canSeed:!0,inputDraftPortfolioName:e.inputDraftPortfolioName,onPortfolioNameChange:e.onPortfolioNameChange}):(0,a.Y)(b,{controlSeededName:e.controlSeededName,inputDraftPortfolioName:e.inputDraftPortfolioName,onPortfolioNameChange:e.onPortfolioNameChange,"data-sentry-element":"FirstDraftNameFieldRemoval","data-sentry-component":"FirstDraftNameInput","data-sentry-source-file":"FirstDraftNameInput.tsx"}):(0,a.Y)(x,{seededName:e.controlSeededName,canSeed:!1,inputDraftPortfolioName:e.inputDraftPortfolioName,onPortfolioNameChange:e.onPortfolioNameChange})},I=e=>{let{isDraftNameFieldHidden:t,isResolved:n}=(()=>{let{flagValue:e}=(0,S.$L)(A.mr.Test382HideDraftNameField,A.u6.Control),{areFlagsResolved:t}=(0,S.$I)();return{isDraftNameFieldHidden:e===A.u6.Variant1,isResolved:t}})();return n?t?(0,a.Y)(x,{seededName:e.controlSeededName,canSeed:!0,hideInput:!0,inputDraftPortfolioName:e.inputDraftPortfolioName,onPortfolioNameChange:e.onPortfolioNameChange}):e.isFirstDraft?(0,a.Y)(C,{controlSeededName:e.controlSeededName,inputDraftPortfolioName:e.inputDraftPortfolioName,onPortfolioNameChange:e.onPortfolioNameChange}):(0,a.Y)(x,{seededName:e.controlSeededName,canSeed:!0,inputDraftPortfolioName:e.inputDraftPortfolioName,onPortfolioNameChange:e.onPortfolioNameChange,"data-sentry-element":"DraftNameInput","data-sentry-component":"SeededDraftNameField","data-sentry-source-file":"CopyPortfolioNameInputForm.tsx"}):null},w=e=>{var t,n;let g=(0,o.j)(),[v]=r.useState(()=>{let t=(0,s.W)(g);return{controlSeededName:((e,t)=>{let n=(0,f.Fk)(e,t);return n&&(0,f.uF)(n)?n.portfolioName:((e,t)=>{let n=new Set(t);if(!n.has(e))return e;let a=2;for(;;){let t=" (".concat(a,")"),r=Math.max(0,h.xN-t.length),o="".concat(e.slice(0,r).trimEnd()).concat(t);if(!n.has(o))return o;a+=1}}
3)((0,f.eC)({portfolioName:null==n?void 0:n.portfolioName}),e.filter(f.uF).map(e=>e.portfolioName))})(t,e.referencePortfolioId),isFirstDraft:!t.some(f.uF)}});return(0,a.FD)(d.Bw,{"data-sentry-element":"PortfolioActionPopupContentContainer","data-sentry-component":"CopyPortfolioNameInputForm","data-sentry-source-file":"CopyPortfolioNameInputForm.tsx",children:[(0,a.Y)(I,{controlSeededName:v.controlSeededName,isFirstDraft:v.isFirstDraft,inputDraftPortfolioName:e.inputDraftPortfolioName,onPortfolioNameChange:e.onPortfolioNameChange,"data-sentry-element":"SeededDraftNameField","data-sentry-source-file":"CopyPortfolioNameInputForm.tsx"}),e.startModeToggle,(0,a.FD)(u.Ah,{flexDirection:"column",alignItems:"flex-start",itemsSpacingVertical:4,occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"CopyPortfolioNameInputForm.tsx",children:[(0,a.FD)(u.Ah,{flexDirection:"row",alignItems:"center",itemsSpacingHorizontal:4,"data-sentry-element":"FlexLayout","data-sentry-source-file":"CopyPortfolioNameInputForm.tsx",children:[(0,a.Y)(c.km,{className:"text-body","data-sentry-element":"Body2W400","data-sentry-source-file":"CopyPortfolioNameInputForm.tsx",children:"Based on"}),(0,a.Y)(m.ID,{title:y.$,className:"text-neutral-500","data-sentry-element":"InfoTooltip","data-sentry-source-file":"CopyPortfolioNameInputForm.tsx"})]}),(0,a.Y)(i.u,{selectedPortfolioId:e.emptyStartReference?e.emptyStartReference.selectedPortfolioId:e.referencePortfolioId,onChange:null!=(n=null==(t=e.emptyStartReference)?void 0:t.onChange)?n:l.lQ,disabled:!e.emptyStartReference,"data-sentry-element":"DraftReferencePortfolioSelector","data-sentry-source-file":"CopyPortfolioNameInputForm.tsx"}),e.emptyStartReference?(0,a.Y)(p.N,{children:"The reference powers comparisons, score changes, the order list, and how much cash to add (even when you start empty)."}):null]})]})}},71754:(e,t,n)=>{n.d(t,{$g:()=>F,EC:()=>u,Kc:()=>P,Lb:()=>p,NS:()=>I,Nk:()=>T,O9:()=>d,P7:()=>C,RR:()=>x,UA:()=>S,Uu:()=>l,VC:()=>m,_C:()=>w,ae:()=>g,dc:()=>c,f1:()=>A,gB:()=>s,hb:()=>v,pS:()=>h,r8:()=>b,uB:()=>y,yk:()=>f});var a=n(78170),r=n(39040);let o=e=>Number.parseFloat(e),i=e=>{let t=t=>Number.parseInt(e.slice(t,t+2),16);return"rgba(".concat(t(1),", ").concat(t(3),", ").concat(t(5),", ").concat(Number((t(7)/255).toFixed(2)),")")},l=["#1467C7","#06B6D4","#F59E0B","#84CC16","#9333EA","#FACC15","#DB2777","#4F46E5","#16A34A","#DC2626","#10B981","#C026D3","#0EA5E9","#F97316","#E11D48","#14B8A6","#7C3AED","#1E40AF","#67E8F9","#B45309","#BEF264","#6B21A8","#FEF08A","#9D174D","#818CF8","#166534","#F87171","#047857","#E879F9","#0369A1","#FDBA74","#9F1239","#5EEAD4","#5B21B6","#60A5FA","#0E7490","#FCD34D","#4D7C0F","#C084FC","#CA8A04","#F472B6","#3730A3","#4ADE80","#991B1B","#6EE7B7","#86198F","#7DD3FC","#C2410C","#FDA4AF","#0F766E","#A78BFA","#CFFAFE","#78350F","#ECFCCB","#C7D2FE","#FECACA","#064E3B","#F5D0FE","#0C4A6E","#CCFBF1","#BFDBFE","#164E63","#FEF3C7","#365314","#E9D5FF","#854D0E","#FBCFE8","#BBF7D0","#D1FAE5","#E0F2FE","#7C2D12","#FFE4E6","#134E4A","#DDD6FE"],s={neutral100:a.$m.neutral["100"],neutral300:a.$m.neutral["300"],neutral400:a.$m.neutral["400"],neutral500:a.$m.neutral["500"],neutral600:a.$m.neutral["600"],neutral700:a.$m.neutral["700"],neutral800:a.$m.neutral["800"],neutral900:a.$m.neutral["900"],white:a.$m.white},c={cash:"#94A3B8",taxed:"#3B82F6",taxFree:"#10B981",taxAdv:"#8B5CF6",privateEquity:"#F59E0B",realEstate:"#EF4444"},d={[r.Hj.Equities]:["#1E40AF","#1467C7","#3B82F6","#60A5FA","#BFDBFE","#DBEAFE"],[r.Hj.FixedIncome]:["#701A75","#A21CAF","#D946EF","#E051E1","#E75CD3","#ED67C4","#F472B6","#E879F9","#F0ABFC","#FAE8FF"],[r.Hj.Commodities]:["#D97706","#FBBF24","#FCD34D"],[r.Hj.RealEstate]:["#94A3B8","#CBD5E1"],[r.Hj.Currencies]:["#025049","#0D9488","#14B8A6","#5EEAD4","#83F6C8"],[r.Hj.Cryptocurrencies]:["#0D9488","#14B8A6","#2DD4BF","#5EEAD4"],[r.Hj.CashAndEquivalents]:["#025049","#134E4A","#0F766E"],[r.Hj.Unknown]:["#334155","#475569","#64748B"],"Other assets":["#e84b34","#EF4444","#F87171"]},u={minColor:"#FFFFFF",maxColor:"#7cb5ec",seriesDataLabelColor:"#000000"},m=[a.bW.series.accent,a.$m.neutral["300"],a.$m.neutral["400"],a.$m.neutral["600"],a.$m.neutral["800"]],p=["#06B6D4","#F59E0B","#A855F7","#84CC16","#DB2777","#DB2777","#14B8A6","#854D0E","#0369A1","#4D7C0F","#4338CA","#A21CAF"],y={value:"#C2CDDB",valueWithBounds:"#565559",consensus:"#EAB308",latestValue:"#1467C7",upperBound:"#059669",lowerBound:"#DB2777",history:"#334155",forecast:"#1467C7",marketExpectation:"#EAB308",percentile75:"#B577FA",percentile25:"#B577FA"},h={history:a.$m.indigo["500"],forecast:a.$m.indigo["500"],percentile75:a.$m.indigo["400"],percentile25:a.$m.indigo["400"],range:a.$m.indigo["100"]},f={line:"#c420c7",range:"#DDD6FE"},g={neutral:"#F1F5F9",green:["#ECFDF5","#D1FAE5","#A7F3D0","#6EE7B7","#34D399","#10B981","#059669","#047857","#065F46","#064E3B"],red:["#FFF1F2","#FFE4E6","#FECDD3","#FDA4AF","#FB7185","#F43F5E","#E11D48","#BE123C","#9F1239","#881337"]},v={portfolio:"#C2410C",balanced:"#0F766E",sp500:"#4338CA"},x={line:a.bW.forecast["cone-line"],fillFrom:a.bW.forecast["cone-fill-from"],fillTo:a.bW.forecast["cone-fill-to"]},A={history:a.bW.series.accent,up:a.bW.series["trend-up"],down:a.bW.series["trend-down"],flat:a.bW.series.accent},S={gridline:a.bW.chrome.gridline,todayLine:a.bW.chrome["today-line"],label:a.bW.chrome["axis-label"]},b={gridlineWidth:o(a.bW.chrome["gridline-width"]),labelFontSize:o(a.bW.chrome["axis-label-size"])},C={color:s.neutral900,fontSize:o(a.bW.chrome["data-label-size"]),fontWeight:a.bW.chrome["data-label-weight"]},I={fadeTo:a.bW.fill.faint,intenseOpacity:a.bW.fill["intense-opacity"],fadeExtent:a.bW.fill["fade-extent"]},w={surface:a.bW.chrome["popover-surface"],border:i(a.bW.chrome["popover-border"]),text:a.$m.neutral["900"],secondaryText:a.$m.neutral["500"],deltaPositive:a.ys.positive,deltaNegative:a.ys.negative},P={color:i(a.bW.chrome.crosshair),historyWidth:o(a.bW.chrome["crosshair-history-width"]),forecastWidth:o(a.bW.chrome["crosshair-forecast-width"])},k=["1","2","3","4","5","6","7","8","9","10"];k.map(e=>a.bW.heatmap.up[e]),a.bW.heatmap.neutral,k.map(e=>a.bW.heatmap.down[e]);let F={expectedOutcome:a.bW.series.accent,baseScenario:a.bW.projection.base,modifiedScenario:a.bW.projection.custom,poorOutcome:a.bW.projection.poor,tooltipBorder:a.SP.default,tooltipEventText:a.SP["text-large"],mutedText:"#A3A3A3",tooltipText:"#565559",tooltipDivider:"#E5E7EB",legendLabel:"#64748B"},T=a.$m.blue["500"]},71827:(e,t,n)=>{n.d(t,{Y:()=>o});var a=n(50202),r=n(544);let o=()=>{let{currentPortfolios:e}=(0,a.RW)();return{demoCurrentPortfolio:(0,r.vK)(e)}}},71873:(e,t,n)=>{n.d(t,{s:()=>o});var a=n(544),r=n(43608);let o=e=>{let{data:t,isLoading:n}=(0,r.y)(e);return{isPortfolioUnderTracked:t?(0,a.FP)(t):null,isPortfolioWithUntrackedInvestments:t?(0,a.mO)(t):null,unTrackedPercentage:null==t?void 0:t.untrackedPercentage,isComputing:n}}},72347:(e,t,n)=>{n.d(t,{x:()=>p});var a=n(33624),r=n(47807),o=n(10833),i=n(59109),l=n(12115),s=n(76778),c=n(13343),d=n(16685);let u=(0,c.A)((0,d.lt)((e,t)=>({resetOngoingRestrictedQueries:new Set,flagResetOngoingQuery:t=>e(e=>({resetOngoingRestrictedQueries:new Set(e.resetOngoingRestrictedQueries).add(t)})),isResetOngoing:e=>t().resetOngoingRestrictedQueries.has(e),unflagResetOngoingQuery:t=>e(e=>{let n=new Set(e.resetOngoingRestrictedQueries);return n.delete(t),{resetOngoingRestrictedQueries:n}})}),{name:"RestrictedQueryResetTrackingStore"})),m=async(e,t)=>{let n={exact:!0};await e.resetQueries(t,n),await e.refetchQueries(t,n,{throwOnError:!1,cancelRefetch:!0})},p=(e,t,n,c)=>{let d=a.VxE({enabled:!0},a.vUk({},c)),{isCheckingFunctionalityRestriction:p,isFunctionalityRestrictedPortfolio:y,isFunctionalityRestrictedPortfolioPrevious:h}=(e=>
3{let{isComputing:t,isFunctionalityRestrictedPortfolio:n}=(0,i.I)(e),[a,r]=(0,l.useState)(e),[o,s]=(0,l.useState)(null);return a!==e&&(s(null),r(e)),(0,l.useEffect)(()=>{a===e&&s(n)},[n,e,a]),{isCheckingFunctionalityRestriction:t,isFunctionalityRestrictedPortfolio:n,isFunctionalityRestrictedPortfolioPrevious:o}})(e),{isQueryInitialMount:f,restrictedQueryIdempotentResetter:g}=(e=>{let t=(0,o.j)(),{flagResetOngoingQuery:n,unflagResetOngoingQuery:a,isResetOngoing:r}=u(),i=t.getQueryCache().find(e,{exact:!0}),l=i&&i.queryHash,c=i&&i.getObserversCount();return{isQueryInitialMount:void 0===c||0===c,restrictedQueryIdempotentResetter:(0,s.K)(async()=>{if(l){if(!r(l))try{n(l),await m(t,e)}finally{a(l)}}})}})(t);(0,l.useEffect)(()=>{let e=a.aIS(h,!1),t=a.aIS(y,!0),n=f&&t;(e&&t||n)&&g()},[e,f,y,h,g]);let v=r.A(d.enabled),x=p||v,A={enabled:!x&&a.aIS(y,!1)&&a.aIS(d.enabled,!0)},S=a.VxE(a.cJW(a.HPH(A),d),A),b=(0,o.I)(t,n,S),C=a.aIS(b.isFetched,!1),I={isLoading:b.isLoading||x&&C,isFetching:b.isFetching||x};return a.VxE(b,I)}},72408:(e,t,n)=>{n.d(t,{t:()=>o});var a=n(26214),r=n(39510);let o=()=>{let{flagValue:e}=(0,r.$L)(a.mr.Test333DraftModalCtaWording,a.cy.Control);return e===a.cy.Variant1?"Start testing":"Create draft"}},72781:(e,t,n)=>{n.d(t,{f:()=>r});var a=n(41784);let r=e=>(0,a.cn)("outline outline-1 -outline-offset-1 outline-transparent transition-colors",e?"hover:outline-neutral-600":"hover:outline-primary")},73435:(e,t,n)=>{n.d(t,{A:()=>p});var a=n(33624),r=n(22462),o=n(35208),i=n(84245),l=n(80067);let s=a.wnP({portfolioScore:a._w2("score"),portfolioSubScores:e=>({downsideProtectionScore:e.downsideProtectionScore,riskMatchScore:e.riskMatchScore,sharpeRatioScore:e.sharpeRatioScore})}),c=e=>s(e);var d=n(72347);let u=a.vUk(null),m=e=>u(e),p=e=>{let{data:t,isSuccess:n,isError:a,error:s,isFetching:u,isLoading:p}=(e=>(0,d.x)(e,(0,i.e4)(e),()=>(0,l.sE)(e),{...i.gz,enabled:r.A(e),select:c}))(e),y=m(null==t?void 0:t.portfolioScore),h={sharpeRatioScore:m(null==t?void 0:t.portfolioSubScores.sharpeRatioScore),downsideProtectionScore:m(null==t?void 0:t.portfolioSubScores.downsideProtectionScore),riskMatchScore:m(null==t?void 0:t.portfolioSubScores.riskMatchScore)},f=!!("number"==typeof h.riskMatchScore&&h.riskMatchScore<o.$j),g="number"==typeof h.riskMatchScore&&h.riskMatchScore===o.wY;return{portfolioScore:y,portfolioSubScores:h,isFetching:u,isInitialLoading:p,isSuccess:n,isError:a,error:s,isRiskMatchScoreWorse:f,isRiskMatchScoreMaxedOut:g}}},73467:(e,t,n)=>{n.d(t,{h:()=>y,I:()=>p});var a=n(12115),r=n(33624),o=n(16528),i=n(92332),l=n(17143),s=n(62346),c=n(544),d=n(71873),u=n(84978);let m=e=>{let t=(0,s.NB)(e),n=r.Va7([r.XnJ(r._w2("weight"))],t.data||[]),a=r.EyX("ticker",n);return{...t,visiblePortfolioItems:n,visiblePortfolioItemsTickers:a}},p=e=>{let{visiblePortfolioItems:t,isFetching:n,isSuccess:a}=m(e),{isComputing:l,isPortfolioWithUntrackedInvestments:s,isPortfolioUnderTracked:p}=(0,d.s)(e),y=r.pbD(c.MZ,t),h=l||n,f=r.kuo(e=>e.assetType===u.PW.Other,y),g=r.Va7([r.XnJ(r._w2("weight"))],f),v=r.kuo(e=>e.weight<.01,g);return{isComputed:a||!h,isLoading:h,isBannerEligible:(s||p)&&o.A(v),unknownSecurities:f,hasUnknownSecurities:i.A(g)}},y=e=>{let{unknownSecurities:t,isLoading:n,isComputed:o}=p(e),{visiblePortfolioItemsTickers:c}=m(e),{unknownAssetClassPortfolioItems:d,isLoading:u,isComputed:y}=(e=>{let{data:t,isFetching:n}=(0,s.Ii)(e),{data:a=[],isFetching:o,isSuccess:c}=(0,s.NB)(e),d=(null==t?void 0:t.unknownAsPrimaryAssetClassTickers)||[],u=r.pbD(e=>(0,l.AT)(e.ticker,d),a),m=r.Va7([r.XnJ(r._w2("weight"))],u),p=n||o;return{isComputed:!p&&c,isLoading:p,unknownAssetClassPortfolioItems:m,hasUnknownSecurities:i.A(u)}})(e),h=a.useMemo(()=>{let e=r.TjK(e=>e.ticker,d),n=[...d],a=r.pbD(t=>!(0,l.AT)(t.ticker,e),t);return n=r.xWs(n,a),r.Va7([r.XnJ(r._w2("weight"))],n)},[d,t]),f=r.pbD(e=>(0,l.AT)(e.ticker,c),h),g=i.A(f);return{isLoading:n||u,isComputed:o&&y,unknownAssetClassOrUnknownSecurities:f,hasUnknownAssetClassOrUnknownSecurities:g}}},73496:(e,t,n)=>{n.d(t,{R:()=>l});var a=n(33624),r=n(28283),o=n(87764),i=n(12115);let l=e=>{let{featuresAccessible:t=[]}=(0,o.A)(),n=(0,r.L6)(e,t),l=a.gD_(n),s=(null==n?void 0:n.hasAccess)===!0||l;return(0,i.useEffect)(()=>{l&&console.error("Feature access config for ".concat(e," is missing"))},[e,l]),{isFeatureAccessible:s,featureAccessConfig:n}}}
3,73672:(e,t,n)=>{n.d(t,{RV:()=>F,dF:()=>k,gz:()=>P,iA:()=>D,tf:()=>Y,ug:()=>T,vA:()=>E});var a=n(62212),r=n(33624),o=n(73590),i=n.n(o),l=n(16462),s=n(17667),c=n(67759),d=n(4603),u=n(76699),m=n(58613),p=n(2135),y=n(99750),h=n(84245),f=n(12115),g=n(83910),v=n(3023),x=n(80017),A=n(45424),S=n(65694),b=n(54227),C=n(51436),I=n(10388),w=n(26549);let P=async function(e){let{reset:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t?await e.resetQueries(u.QF):await e.invalidateQueries(u.QF),e.invalidateQueries(h.cd)},k=()=>{let{isBelow576:e}=(0,y.uF)(),[t,n]=(0,p.A)({key:p.q.HLRCollapseState,initialValue:e});return{collapsed:t,toggleCollapse:()=>n(!t),expand:()=>n(!1)}},F=()=>{let e=(0,a.j)(),{activeRecommendations:t,showingRecommendations:n,bonusRecommendation:o}=(0,m.Ay)(),{toggleCollapse:i}=k(),u=(0,S.Q5)(),p=(0,b.oK)();return(0,s.A)(async e=>{let{recommendation:a,payload:s}=e,u=r.wqE("id",s.recommendationId),m=r.I6j(u,t),p=r.I6j(u,n),y=r.kuo(u,n),h=p?r.xWs(y,[r.VxE(p,s)]):y,f=r.TjK(e=>({...e,isBonus:!!(o&&e.id===o.id)}),h),g=s.status===l.Kk.Accepted?d.HighLevelRecommendationActionType.Accepted:d.HighLevelRecommendationActionType.Denied;(0,c.trackHighLevelRecommendations)({action:g,highLevelRecommendations:f,updatedHighLevelRecommendation:{...r.VxE(a,s),isBonus:!!(o&&s.recommendationId===o.id)},userInputMessage:e.userInputMessage});let v=await l.Ay.updateRecommendationStatus(s);return m&&1===r.Bw9(t)&&((0,c.trackHighLevelRecommendations)({action:d.HighLevelRecommendationActionType.Completed,highLevelRecommendations:f}),i()),v},{onSuccess:async(t,n)=>{await P(e),u(),p();let{recommendation:a,payload:r}=n;if(a.recommendationType===l.A.EstatePlanning){let t=(0,w.Ut)(r);if(null!==t){let{questionId:n}=a.recommendation;await (0,C.u)({questionId:n,response:t,updatedOn:new Date().toISOString()}
3),e.invalidateQueries(I.on.Preferences)}}}})},T=()=>{let e=(0,a.j)();return(0,s.A)(async e=>await l.Ay.autoCompleteRecommendation(e),{onSuccess:async t=>{t.autocompletedRecommendationsCount>0&&await P(e)}})},E=()=>(0,s.A)(async()=>{await l.Ay.resyncHLRs()}),Y=()=>{let{topRecommendations:e}=(0,m.Ay)(),{collapsed:t}=k(),[n,a]=(0,g.Ay)(g.Hh.HLRLastSeenTimestamp,0),o=(()=>{var t;let n=null==(t=r.d5f(e))?void 0:t.updatedOn;return n?i()(n).valueOf():0})(),[l,s]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{t||a(o),s(o>n)},[o,t]),{shouldShowReadyTag:l}},D=()=>{let e=async e=>{if(null==e?void 0:e.error_code)return void A.q.setQueryData(u.QF,e=>e?{...e,computePublished:!1,computationInProgress:!1}:e);await P(A.q,{reset:!0}),await A.q.invalidateQueries(u.d_)};(0,v.V)(x.y.HLRsComputed,e)}},73751:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(57090);n(12115);var r=n(99750),o=n(61443),i=n(74547),l=n(91469),s=n(350),c=n(81671);let d=e=>{let{portfolio:t}=e,{isBelow576:n}=(0,r.uF)(),{isNonEditableCurrentPortfolio:d,isPortfolioCurrent:u,portfolioTableActionClickHandler:m}=(0,o.i)(t),{portfolioIdMappedAccounts:p}=(0,s.D)(),y=p[t.portfolioId],{launchAccountEditDrawer:h}=(0,l.S)(y),f=async()=>{d?await h():await m()};return(0,a.Y)(i.$n,{variant:"outlined",prefix:(0,a.Y)(i.In,{icon:c.$.Pencil}),fullWidth:n,onClick:f,"data-sentry-element":"Button","data-sentry-component":"UpdateNetworthButton","data-sentry-source-file":"UpdateNetworthButton.tsx",children:u?"Edit account":"Update net worth"})}},74166:(e,t,n)=>{n.d(t,{z:()=>l});var a=n(57090);n(12115);var r=n(89069),o=n(33624),i=n(85794);let l=e=>{var t;let n=(0,r.h)();return(0,a.Y)(i.K7,{title:e.title,centered:!0,open:!0,destroyOnClose:!0,maskClosable:!0,closable:!0,keyboard:!0,onCancel:e.onCancel,cancelText:o.vUk("Cancel",e.cancelText),onOk:e.onOk,okText:e.okText,okButtonProps:{...e.okButtonProps,disabled:(null==(t=e.okButtonProps)?void 0:t.disabled)||n},size:e.size,"data-sentry-element":"_StyledNetworthAssetPopup","data-sentry-component":"InputPopup","data-sentry-source-file":"InputPopup.tsx",children:e.children})}},74278:(e,t,n)=>{n.d(t,{j:()=>r,n:()=>a});var a=function(e){return e.ManualPortfolioAdd="ManualPortfolioAdd",e.ManualPortfolioEdit="ManualPortfolioEdit",e}({}),r=function(e){return e.ADD="ADD",e.UPDATE="UPDATE",e.DELETE="DELETE",e.RESET="RESET",e}({})},74618:(e,t,n)=>{n.r(t),n.d(t,{StyledForm:()=>eC,StyledFormItem:()=>eb,default:()=>eP,useUserProfileUpdateMutation:()=>ew});var a=n(57090),r=n(12115),o=n(62570),i=n(17667),l=n(62212),s=n(4338),c=n(40248),d=n(61435),u=n(78046),m=n(8921),p=n(36271),y=n(44764),h=n(92672),f=n(83910),g=n(95825),v=n(55895),x=n(78190),A=function(e){return e.Initial="Initial",e.ReasonSelected="Reason Selected",e.ConfirmImmediate="Confirm Immediate Deletion",e.Deleting="Deleting",e.RequestSubmitted="Account Delete Requested",e}({}),S=function(e){return e.Placeholder="Placeholder reason",e.SecurityConcerns="Security concerns",e.SomethingNotWorking="Something is not working",e.ProductAdvantagesUnclear="Product advantages are unclear",e.Other="Other",e}({});let b=(0,o.A)(v.Ay,{target:"e1523vyz0"})("line-height:20px;"),C=(0,o.A)(v.Ay.Group,{target:"e1523vyz1"})("display:flex;flex-direction:column;font-size:14px;font-weight:400;gap:10px;"),I=(0,o.A)("div",{target:"e1523vyz2"})("font-size:16px;font-weight:400;margin-bottom:10px;"),w=(0,o.A)(g.Ay,{target:"e1523vyz3"})("max-width:",e=>{switch(e.selectedOption){case S.SecurityConcerns:case S.SomethingNotWorking:case S.ProductAdvantagesUnclear:case S.Other:return e.step===A.ReasonSelected?"480px":"400px";default:return"400px"}},";"),P=(0,o.A)("li",{target:"e1523vyz4"})("font-weight:600;"),k=(0,o.A)("ul",{target:"e1523vyz5"})("margin-top:0;margin-left:20px;padding-left:0;"),F=(0,o.A)("div",{target:"e1523vyz6"})("font-size:14px;padding-bottom:4px;");var T=n(54519),E=n(74547);let Y={[S.SecurityConcerns]:{text:()=>(0,a.FD)("div",{"data-sentry-component":"SecurityConcernsText","data-sentry-source-file":"constants.tsx",children:[(0,a.FD)(I,{"data-sentry-element":"MainText","data-sentry-source-file":"constants.tsx",children:["Data protection is extremely important to us.",(0,a.Y)("br",{}),"PortfolioPilot is built using bank-level security:",(0,a.FD)(k,{"data-sentry-element":"SyledList","data-sentry-source-file":"constants.tsx",children:[(0,a.Y)(P,{"data-sentry-element":"StyledListItem","data-sentry-source-file":"constants.tsx",children:"256-bit encryption"}),(0,a.Y)(P,{"data-sentry-element":"StyledListItem","data-sentry-source-file":"constants.tsx",children:"Read-only access to your data"}),(0,a.Y)(P,{"data-sentry-element":"StyledListItem","data-sentry-source-file":"constants.tsx",children:"Don't store banking credentials"}),(0,a.Y)(P,{"data-sentry-element":"StyledListItem","data-sentry-source-file":"constants.tsx",children:"Can't initiate any transactions"})]})]}),(0,a.FD)(I,{"data-sentry-element":"MainText","data-sentry-source-file":"constants.tsx",children:[(0,a.FD)(E.N_,{weight:"semibold",href:T.Ay.security,openInNewTab:!0,"data-sentry-element":"Link","data-sentry-source-file":"constants.tsx",children:["Read more"," "]})," ","about our bank-level security."]}),(0,a.Y)(F,{"data-sentry-element":"InputBoxTitle","data-sentry-source-file":"constants.tsx",children:"What are your concerns?"})]}),buttonText:"Continue anyway"},[S.SomethingNotWorking]:{text:()=>(0,a.FD)("div",{"data-sentry-component":"SomethingNotWorkingText","data-sentry-source-file":"constants.tsx",children:[(0,a.FD)(I,{"data-sentry-element":"MainText","data-sentry-source-file":"constants.tsx",children:["Sorry for the inconvenience. We are working hard to make PortfolioPilot better every day. In our"," ",(0,a.Y)(E.N_,{weight:"semibold",href:T.Ay.tutorialsHome,openInNewTab:!0,"data-sentry-element":"Link","data-sentry-source-file":"constants.tsx",children:"tutorials"})," ","you can find solutions for the most common issues."]}),(0,a.Y)(F,{"data-sentry-element":"InputBoxTitle","data-sentry-source-file":"constants.tsx",children:"Enter the problem you faced to help us fix it"})]}),buttonText:"Continue"},[S.ProductAdvantagesUnclear]:{text:()=>(0,a.FD)("div",{"data-sentry-component":"ProductAdvantagesUnclearText","data-sentry-source-file":"constants.tsx",children:[(0,a.FD)(I,{"data-sentry-element":"MainText","data-sentry-source-file":"constants.tsx",children:["PortfolioPilot gives you free net worth tracking, plus personalized financial advice and other AI investing insights, built by experts.",(0,a.FD)(k,{"data-sentry-element":"SyledList","data-sentry-source-file":"constants.tsx",children:["Did you check out these features?",(0,a.Y)(P,{"data-sentry-element":"StyledListItem","data-sentry-source-file":"constants.tsx",children:(0,a.Y)(E.N_,{color:"accent",weight:"semibold",href:T.Ay.tutorialManagingPortfolio,openInNewTab:!0,"data-sentry-element":"Link","data-sentry-source-file":"constants.tsx",children:"Full net worth tracking"})}),(0,a.Y)(P,{"data-sentry-element":"StyledListItem","data-sentry-source-file":"constants.tsx",children:(0,a.Y)(E.N_,{color:"accent",weight:"semibold",href:T.Ay.tutorialPopularFeatures,openInNewTab:!0,"data-sentry-element":"Link","data-sentry-source-file":"constants.tsx",children:"Personalized recommendations"})}),(0,a.Y)(P,{"data-sentry-element":"StyledListItem","data-sentry-source-file":"constants.tsx",children:(0,a.Y)(E.N_,{color:"accent",weight:"semibold",href:T.Ay.tutorialsHome,openInNewTab:!0,"data-sentry-element":"Link","data-sentry-source-file":"constants.tsx",children:"AI portfolio assessment"})})]})]}),(0,a.Y)(F,{"data-sentry-element":"InputBoxTitle","data-sentry-source-file":"constants.tsx",children:"Can you give us some feedback to improve the experience for others?"})]}),buttonText:"Continue anyway"},[S.Other]:{text:()=>(0,a.FD)("div",{"data-sentry-component":"OtherText","data-sentry-source-file":"constants.tsx",children:[(0,a.FD)(I,{"data-sentry-element":"MainText","data-sentry-source-file":"constants.tsx",children:["Sorry for the inconvenience. We are working hard to make PortfolioPilot better. In our"," ",(0,a.Y)(E.N_,{weight:"semibold",href:T.Ay.tutorialsHome,openInNewTab:!0,"data-sentry-element":"Link","data-sentry-source-file":"constants.tsx",children:"tutorials"})," ","you can find solutions for the most common issues."]}),(0,a.Y)(F,{"data-sentry-element":"InputBoxTitle","data-sentry-source-file":"constants.tsx",children:"Enter the problem you faced to help us fix it"})]}),buttonText:"Continue"},[S.Placeholder]:{text:()=>(0,a.Y)("div",{"data-sentry-component":"EmptyText","data-sentry-source-file":"constants.tsx"}),buttonText:"Continue"}},D=[S.SecurityConcerns,S.SomethingNotWorking,S.ProductAdvantagesUnclear,S.Other];var R=n(33624);let{TextArea:N}=n(13).A,M=e=>{let{step:t,additionalUserInput:n,selectedOption:o}=e;switch(t){case A.Initial:return(0,a.FD)(r.Fragment,{children:[(0,a.Y)(I,{children:"Why are you deleting your account?"}),(0,a.Y)(C,{onChange:t=>{let{value:n}=t.target;e.onOptionChange(n)},value:o,children:D.map(e=>(0,a.Y)(b,{value:e,children:e},e))})]});case A.ReasonSelected:{var i;let t=null==(i=Y[o])?void 0:i.text;return(0,a.FD)(r.Fragment,{children:[(0,a.Y)(t,{}),(0,a.Y)(N,{onChange:t=>{let{value:n}=t.target;e.onAdditionalInputChange(n)},placeholder:"Any comments will help, thank you.",value:n,rows:5})]})}
3case A.RequestSubmitted:return(0,a.Y)("p",{children:"Thank you for the extra information. This requires a human touch, we'll reach out to you in the next 24 hours to complete the process."});case A.ConfirmImmediate:return(0,a.FD)(r.Fragment,{children:[(0,a.Y)(I,{children:(0,a.Y)("strong",{children:"Your account will be deleted immediately."})}),(0,a.Y)(I,{children:"This action cannot be undone. All your data including portfolios, preferences, and account information will be permanently removed."}),(0,a.Y)(I,{children:"Are you sure you want to proceed?"})]});case A.Deleting:return(0,a.FD)(r.Fragment,{children:[(0,a.Y)(I,{children:"Deleting your account..."}),(0,a.Y)(E.y$,{})]});default:return null}},L=e=>{let t=e.step===A.Initial&&e.selectedOption===S.Placeholder,n=e.step===A.ReasonSelected&&R.Ime(R.Bqr(e.additionalUserInput));switch(e.step){case A.RequestSubmitted:return(0,a.Y)(c.A,{onClick:e.handleSubmit,children:"Close"},"close");case A.Deleting:return null;case A.ConfirmImmediate:return(0,a.FD)(g.jl,{children:[(0,a.Y)(c.A,{onClick:e.handleCancel,children:"Cancel"}),(0,a.Y)(c.A,{variant:"filled",color:"danger",onClick:e.handleSubmit,children:"Delete My Account"})]});default:return(0,a.FD)(g.jl,{children:[(0,a.Y)(c.A,{onClick:e.handleCancel,children:"Cancel"}),(0,a.Y)(c.A,{variant:"filled",color:"accent",onClick:e.handleSubmit,disabledTooltip:t?{title:"Please select a reason"}:n?{title:"Please input some text"}:void 0,disabled:t||n,children:e.actionLabel})]})}},_={[A.ConfirmImmediate]:"Delete your account",[A.Deleting]:"Deleting your account"};var O=n(67759),W=n(4603);let B=()=>(0,f.Ay)(f.Hh.AccountDeletionSubmitted,!1),U=e=>{var t,n;let[o,i]=(0,r.useState)(A.Initial),[l,c]=(0,r.useState)(S.Placeholder),[d,u]=(0,r.useState)(""),{data:m}=(0,y.n)(),[,p]=B(),h=(e=>e===x.XM.CAD||e===x.XM.Other)(null!=(n=null==m?void 0:m.residency)?n:null),f=o==A.ReasonSelected?null==(t=Y[l])?void 0:t.buttonText:"Continue",v=async()=>{switch(o){case A.Initial:i(A.ReasonSelected),(0,O.trackAccountDeletion)({event:W.AccountDeletionEvent.ReasonSelected,option:l});break;case A.ReasonSelected:h?i(A.ConfirmImmediate):(i(A.RequestSubmitted),(0,O.trackAccountDeletion)({event:W.AccountDeletionEvent.RequestSubmitted,option:l,feedback:d}),await s.Ay.deleteAccount({reason:l,additionalFeedback:d}),p(!0));break;case A.ConfirmImmediate:i(A.Deleting),(0,O.trackAccountDeletion)({event:W.AccountDeletionEvent.RequestSubmitted,option:l,feedback:d});try{(await s.Ay.deleteAccount({reason:l,additionalFeedback:d})).deleted&&(window.location.href="/")}catch(e){i(A.ConfirmImmediate)}break;default:e.onClose()}},b=()=>{o!=A.RequestSubmitted&&((0,O.trackAccountDeletion)({event:W.AccountDeletionEvent.Canceled}),i(A.Initial),c(S.Placeholder),u("")),e.onClose()};return r.useEffect(()=>{(0,O.trackAccountDeletion)({event:W.AccountDeletionEvent.Opened})},[]),(0,a.Y)(w,{disableSubmitOnEnter:!0,title:(e=>{var t;return null!=(t=_[e])?t:"Don't lose out on great insights"})(o),open:e.visible,size:g.rI.Sm,onCancel:b,footer:(0,a.Y)(L,{step:o,selectedOption:l,handleCancel:b,handleSubmit:v,actionLabel:f,additionalUserInput:d,isImmediateDeletion:h}),selectedOption:l,step:o,"data-sentry-element":"StyledModal","data-sentry-component":"AccountDeletion","data-sentry-source-file":"AccountDeletion.tsx",children:(0,a.Y)(M,{step:o,selectedOption:l,onOptionChange:e=>{c(e)},additionalUserInput:d,onAdditionalInputChange:e=>{u(e)},"data-sentry-element":"ContentRenderer","data-sentry-source-file":"AccountDeletion.tsx"})})};var z=n(87764),V=n(95392),j=n(35209),H=n(3850),q=n(56490),G=n(74977),K=n(36934),Q=n(65438),$=n(89263),X=n(41784);let J=e=>(0,a.Y)(K.bU,{...e,className:(0,X.cn)("text-body",e.className),"data-sentry-element":"Body1W400","data-sentry-component":"Paragraph","data-sentry-source-file":"atoms.tsx"});var Z=n(43401),ee=n(81671);let et=e=>{var t;let[n,o]=r.useState(0),[i,l]=r.useState(""),{value:s,setTrue:c,setFalse:d}=(0,Q.A)(!1),{data:u,isLoading:p}=(0,$.V2)(),y=(0,$.Gr)(),h=(null==(t=y.data)?void 0:t.success)===!1,f=void 0!==u&&!u.success,{uri:v="",secret:x}=u||{},A=async()=>{await y.mutateAsync(i,{onSuccess:t=>{t.success&&((0,m.Ds)(m._n.Info,"Two-factor authentication enabled"),e.onCancel())},onSettled:()=>{l("")}})};if((0,r.useEffect)(()=>{6===i.length&&A()},[i.length]),(0,Z.Z)(d,s?2e3:null),f)return(0,a.Y)(E.aF,{disableSubmitOnEnter:!0,open:!0,maskClosable:!1,onCancel:e.onCancel,t
3itle:"Setup two-factor authentication",footer:(0,a.Y)(g.jl,{children:(0,a.Y)(E.$n,{onClick:e.onCancel,variant:"filled",children:"Close"})}),children:(0,a.Y)(J,{children:"Two-factor authentication is already enabled on this account, so a new setup code was not issued."})});let S=(0,a.Y)(g.jl,{children:0===n?(0,a.Y)(E.$n,{onClick:()=>o(1),variant:"filled",children:"Next"}):(0,a.Y)(E.$n,{variant:"filled",onClick:A,loading:p,disabled:6!==i.length,children:"Verify and enable"})});return(0,a.Y)(E.aF,{disableSubmitOnEnter:!0,open:!0,maskClosable:!1,onCancel:e.onCancel,title:"Setup two-factor authentication",footer:S,"data-sentry-element":"Modal","data-sentry-component":"SetupModal","data-sentry-source-file":"SetupModal.tsx",children:0===n?(0,a.FD)(E.Ah,{display:"block",flexDirection:"column",itemsSpacingVertical:16,children:[(0,a.Y)(J,{children:"1. Install an authenticator app on your phone"}),(0,a.Y)(J,{children:"2. Scan this QR code with your authenticator app"}),(0,a.FD)(E.EA,{isLoaded:!p,children:[(0,a.Y)("div",{className:"py-6",children:(0,a.Y)(E.c_,{value:v})}),(0,a.FD)(E.Ah,{flexWrap:"nowrap",itemsSpacingHorizontal:12,children:[(0,a.Y)(E.pd,{isDisabled:!0,className:"font-mono text-sm text-body break-words",value:x}),(0,a.Y)(E.$n,{isIconOnly:!0,onClick:()=>{x&&(navigator.clipboard.writeText(x),c())},children:(0,a.Y)(E.In,{icon:s?ee.$.Checkmark1:ee.$.Clipboard,size:16})})]}),(0,a.Y)(K.cO,{className:"text-body italic mt-2",children:"This code is your unique secret key. If you can't scan the QR code, you can manually enter this code into your authenticator app."})]})]}):(0,a.FD)(E.Ah,{flexDirection:"column",itemsSpacingVertical:16,children:[(0,a.Y)(J,{children:"Enter the 6-digit code from your authenticator app"}),(0,a.Y)(E.wE,{verificationCode:i,setVerificationCode:l,disabled:p,length:6,isInvalid:h,errorMessage:"Invalid code, try again"})]})})};var en=n(76372),ea=n(81237),er=function(e){return e.AuthenticatorCode="authenticator_code",e.Password="password",e}({});let eo=e=>{let[t,n]=r.useState(er.AuthenticatorCode),[o,i]=r.useState(""),[l,s]=r.useState(""),[c,d]=r.useState(null),{data:u}=(0,$.aM)(),m=(0,$.XD)(),p=t===er.Password,y={factor:t,verificationCode:o,password:l},h=async()=>{d(null);try{let n=await m.mutateAsync((e=>"password"===e.factor?{code:null,password:e.password}:{code:e.verificationCode,password:null})(y)),a=(e=>{if(e.response.success)return null;let t="password"===e.factor;return e.response.reason===ea.X.StepUpUnavailable?"We could not check that code right now. Please try again shortly, or contact support if it keeps happening.":e.response.reason===ea.X.CredentialRequired?t?"Enter your account password to continue.":"Enter the code from your authenticator app to continue.":t?"That password is not correct. Please try again.":"That code is not correct. Please try again."})({response:n,factor:t});if(null===a)return void e.onCancel();d(a)}catch(e){d("We could not disable two-factor authentication. Please wait a moment and try again.")}};return(0,a.Y)(E.aF,{disableSubmitOnEnter:!0,open:!0,onCancel:e.onCancel,title:"Disable two-factor authentication",okText:"Disable",cancelButtonProps:{variant:"ghost",color:"neutral"},onOk:h,okButtonProps:{color:"danger",disabled:!(e=>"password"===e.factor?e.password.length>0:6===e.verificationCode.length)(y)},"data-sentry-element":"Modal","data-sentry-component":"DisableModal","data-sentry-source-file":"DisableModal.tsx",children:(0,a.FD)(E.Ah,{flexDirection:"column",itemsSpacingVertical:16,"data-sentry-element":"FlexLayout","data-sentry-source-file":"DisableModal.tsx",children:[(0,a.Y)(J,{"data-sentry-element":"Paragraph","data-sentry-source-file":"DisableModal.tsx",children:"Are you sure you want to disable two-factor authentication? This will make your account less secure."}),p?(0,a.FD)(r.Fragment,{children:[(0,a.Y)(J,{children:"Enter your account password to confirm."}),(0,a.Y)(en.A,{value:l,onChange:s,autoComplete:"current-password","aria-label":"Account password",isInvalid:null!==c,errorMessage:c})]}):(0,a.FD)(r.Fragment,{children:[(0,a.Y)(J,{children:"Enter the 6-digit code from your authenticator app to confirm."}),(0,a.Y)(E.wE,{verificationCode:o,setVerificationCode:i,length:6,isInvalid:null!==c,errorMessage:null!=c?c:void 0})]}),(null==u?void 0:u.passwordStepUpAvailable)?(0,a.Y)(E.$n,{variant:"ghost",color:"neutral",size:"sm",onClick:()=>{d(null),n(p?er.AuthenticatorCode:er.Password)},children:p?"Use your authenticator app instead":"Use your account password instead"}):null]})})};var ei=n(89093),el=n(99312),es=n.n(el),ec=n(67908),ed=n(65767);let eu=()=>{let{value:e,setTrue:t,setFalse:n}=(0,Q.A)(!1),{value:r,setTrue:o,setFalse:i}=(0,Q.A)(!1),{data:l,isLoading:s}=(0,$.aM)(),{statementEmail:c}=(0,ed.u)(),d=!!(null==l?void 0:l.enabled);return(0,a.FD)(E.EA,{isLoaded:!s,"data-sentry-element":"Skeleton","data-sentry-component":"TwoFactorSection","data-sentry-source-file":"TwoFactorSection.tsx",children:[(0,a.FD)(E.Ah,{equalWidthItems:!0,flexDirection:"column",itemsSpacingVertical:20,marginTop:"16px",childrenTakeFullWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"TwoFactorSection.tsx",children:[(0,a.Y)(G.F,{status:"default",variant:"light",title:"Two-factor authentication".concat(d?" - enabled":""),description:d?"Your account is protected with an authenticator app":"Add an extra layer of security to your account",action:d?(0,a.Y)(E.$n,{size:"sm",onClick:o,children:"Disable"}):(0,a.Y)(ec.o,{fallback:e=>{let{onClick:t}=e;return(0,a.Y)(E.$n,{variant:"filled",color:"neutral",size:"sm",onClick:t,children:"Enable"})},children:(0,a.Y)(E.$n,{variant:"filled",color:"neutral",size:"sm",onClick:t,children:"Enable"})}),"data-sentry-element":"Alert","data-sentry-source-file":"TwoFactorSection.tsx"}),(0,a.FD)("div",{children:[(0,a.Y)(K.lc,{className:"text-body","data-sentry-element":"Body1W600","data-sentry-source-file":"TwoFactorSection.tsx",children:"Data encryption"}),(0,a.FD)(E.Ah,{justifyContent:"flex-start",flexWrap:"nowrap",alignItems:"center",itemsSpacingHorizontal:8,marginTop:6,"data-sentry-element":"FlexLayout","data-sentry-source-file":"TwoFactorSection.tsx",children:[(0,a.Y)(E.In,{icon:ee.$.Lock,className:"text-neutral-500 flex-shrink-0",size:16,"data-sentry-element":"Icon","data-sentry-source-file":"TwoFactorSection.tsx"}),(0,a.Y)(K.bU,{className:"text-body","data-sentry-element":"Body1W400","data-sentry-source-file":"TwoFactorSection.tsx",children:"256-bit (bank-level security)"})]})]}),(0,a.FD)(E.Ah,{display:"block",alignItems:"flex-start",occupyParentWidth:!0,itemsSpacingVertical:8,marginBottom:32,"data-sentry-element":"FlexLayout","data-sentry-source-file":"TwoFactorSection.tsx",children:[(0,a.Y)(E.Ah,{justifyContent:"flex-start",marginBottom:"4px","data-sentry-element":"FlexLayout","data-sentry-source-file":"TwoFactorSection.tsx",children:(0,a.Y)(K.lc,{className:"text-body","data-sentry-element":"Body1W600","data-sentry-source-file":"TwoFactorSection.tsx",children:(0,a.Y)(q.A,{label:"Secure email",title:"This email can be used to send personal financial information to PortfolioPilot (e.g. brokerage statements, transactions, holdings data, etc). All data sent (directly or as attachment) will be updated in your account within ".concat(ei.Wk,". Do not share this email with anyone else."),"data-sentry-element":"TextWithTooltip","data-sentry-source-file":"TwoFactorSection.tsx"})})}),(0,a.FD)(E.Ah,{flexDirection:"row",alignItems:"center",flexWrap:"nowrap",occupyParentWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"TwoFactorSection.tsx",children:[(0,a.Y)("div",{className:"flex-1 min-w-0",children:(0,a.Y)(K.bU,{className:"text-body break-all","data-sentry-element":"Body1W400","data-sentry-source-file":"TwoFactorSection.tsx",children:c})}),(0,a.Y)(ec.o,{"data-sentry-element":"GuestUserHidden","data-sentry-source-file":"TwoFactorSection.tsx",children:(0,a.Y)(es(),{text:c,onCopy:()=>{(0,m.Ds)(m._n.Info,"Copied personal secure email to clipboard")},"data-sentry-element":"CopyToClipboard","data-sentry-source-file":"TwoFactorSection.tsx",children:(0,a.Y)(E.$n,{isIconOnly:!0,variant:"ghost",color:"neutral","aria-label":"Copy email address","data-sentry-element":"Button","data-sentry-source-file":"TwoFactorSection.tsx",children:(0,a.Y)(E.In,{icon:ee.$.Clipboard,
3className:"text-neutral-500",size:20,"data-sentry-element":"Icon","data-sentry-source-file":"TwoFactorSection.tsx"})})})})]})]})]}),e?(0,a.Y)(et,{onCancel:n}):null,r?(0,a.Y)(eo,{onCancel:i}):null]})};var em=n(6915),ep=n(7712),ey=n(39054),eh=n(62830);let ef=r.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,a.Y)("div",{ref:t,className:(0,X.cn)("flex items-center justify-between gap-x-4 rounded-lg border border-[color:var(--wp-card-border)] bg-white px-4 py-3",n),...r})});ef.displayName="ToggleContainer";let eg=r.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,a.Y)("div",{ref:t,className:(0,X.cn)("flex-1",n),...r})});eg.displayName="LabelContainer";let ev=r.forwardRef((e,t)=>{let{isOn:n,className:r,...o}=e;return(0,a.Y)("button",{ref:t,className:(0,X.cn)("relative h-6 w-11 flex-shrink-0 cursor-pointer rounded-xl border-none [transition:background-color_0.2s]",n?"bg-blue-600":"bg-neutral-300","after:absolute after:top-0.5 after:h-5 after:w-5 after:rounded-full after:bg-white after:shadow-[0_1px_3px_rgba(0,0,0,0.2)] after:content-[''] after:[transition:left_0.2s]",n?"after:left-[22px]":"after:left-0.5",r),...o})});ev.displayName="ToggleSwitch";let ex=()=>{let{isProactiveHelpEnabled:e,setProactiveHelpEnabled:t}=(0,eh.H)();return(0,a.FD)(ef,{"data-sentry-element":"ToggleContainer","data-sentry-component":"ProactiveHelpToggle","data-sentry-source-file":"ProactiveHelpToggle.tsx",children:[(0,a.FD)(eg,{"data-sentry-element":"LabelContainer","data-sentry-source-file":"ProactiveHelpToggle.tsx",children:[(0,a.Y)(K.lc,{className:"text-body","data-sentry-element":"Body1W600","data-sentry-source-file":"ProactiveHelpToggle.tsx",children:"Offer proactive AI guidance / nudges"}),(0,a.Y)(K.cO,{className:(0,X.cn)("text-neutral-500","mt-0.5"),"data-sentry-element":"CaptionW400","data-sentry-source-file":"ProactiveHelpToggle.tsx",children:"Show suggestions when you pause or seem stuck"})]}),(0,a.Y)(ev,{isOn:e,onClick:()=>{t(!e)},role:"switch","aria-checked":e,"aria-label":"Toggle proactive help","data-sentry-element":"ToggleSwitch","data-sentry-source-file":"ProactiveHelpToggle.tsx"})]})};var eA=n(39510),eS=n(26214);let eb=(0,o.A)(u.eI,{target:"e1p4cch40"})(".ant-form-item-label{font-style:normal;font-weight:normal;font-size:14px;label.ant-form-item-required{",(0,h.BK)({fontSize:["14px"]}),"}line-height:20px;color:",e=>e.theme.colors.neutral900,";}.ant-checkbox-wrapper{display:flex;align-items:center;font-weight:600;}.ant-form-item-label > label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before{display:none;}"),eC=(0,o.A)(u.lV,{target:"e1p4cch41"})("padding-top:20px;"),eI=async e=>s.Ay.updateUserDetails(e),ew=()=>{let e=(0,l.j)();return(0,i.A)(eI,{onSuccess:()=>e.invalidateQueries(y.B.UserDetails)})},eP=()=>{let e=(0,ep.A)({behavior:"smooth",block:"start"}),{data:t,isLoading:n,isError:o,error:i}=(0,y.n)(),l=ew(),{isUserPlanFreeOrGoingToBeFree:s,isUserNotAtAllInPayingPlan:f,isUserHasNoPlans:g}=(0,z.A)(),v=g||s||f,[x]=B(),[A]=(0,u.mN)(),{isGuestSession:S}=(0,em.Cs)(),[b,C]=(0,r.useState)(!1),I=async e=>{if(!S)return l.mutateAsync(e,{onSuccess:()=>{(0,m.Ds)(m._n.Success,"Profile updated")}})};if(r.useEffect(()=>{l.isSuccess&&A.resetFields()},[A,l.isSuccess]),(0,V.A)(o,i,"Error while fetching user details"),n)return(0,a.Y)(p.y,{placement:"page"});if(o)return null;let w={...t,dataEncryption:"256-bit (bank-level security)"};return t?(0,a.FD)(h.Ah,{maxWidth:"480px",width:"100%",flexDirection:"column",itemsSpacingVertical:32,"data-sentry-element":"FlexLayout","data-sentry-component":"UserProfileSettings","data-sentry-source-file":"userProfileSettings.tsx",children:[(0,a.Y)("div",{className:"w-full",id:ey.Gl.UserDetails,ref:e(ey.Gl.UserDetails),children:(0,a.FD)(H.d,{title:"Personal information","data-sentry-element":"PageSection","data-sentry-source-file":"userProfileSettings.tsx",children:[(0,a.FD)(eC,{form:A,name:"userProfile",layout:"vertical",initialValues:w,onFinish:I,"data-sentry-element":"StyledForm","data-sentry-source-file":"userProfileSettings.tsx",children:[(0,a.Y)(eb,{name:"firstName",label:"First name",rules:[{required:!0,message:"Please enter first name",type:"string",whitespace:!0}],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"userProfileSettings.tsx",children:(0,a.Y)(j.A,{isReadOnly:S,"data-sentry-element":"FormInput","data-sentry-source-file":"userProfileSettings.tsx"})}),(0,a.Y)(eb,{name:"lastName",label:"Last name",rules:[{required:!0,message:"Please enter last name",type:"string",whitespace:!0}],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"userProfileSettings.tsx",children:(0,a.Y)(j.A,{isReadOnly:S,"data-sentry-element":"FormInput","data-sentry-source-file":"userProfileSettings.tsx"})}),(0,a.Y)(ec.o,{"data-sentry-element":"GuestUserHidden","data-sentry-source-file":"userProfileSettings.tsx",children:(0,a.Y)(eb,{name:"email",hideAsterisk:!0,label:(0,a.Y)(q.A,{label:"Email*",title:" To change your email, please contact [email protected] with both your current and new email addresses to verify ownership.",overlayInnerStyle:{width:300}}),rules:[{required:!0,type:"email"}],"data-sentry-element":"StyledFormItem","data-sentry-source-file":"userProfileSettings.tsx",children:(0,a.Y)(j.A,{isReadOnly:!0,"data-sentry-element":"FormInput","data-sentry-source-file":"userProfileSettings.tsx"})})}),(0,a.Y)(eb,{shouldUpdate:!0,"data-sentry-element":"StyledFormItem","data-sentry-source-file":"userProfileSettings.tsx",children:()=>(0,a.Y)(c.A,{variant:"filled",htmlType:"submit",disabled:S||(0,u.Pf)(A,u.AZ.Any),loading:l.isLoading,children:l.isLoading?"Saving":"Save"})})]}),(0,a.Y)(G.F,{status:"default",variant:"light",title:"To reset your password",description:(0,a.FD)(r.Fragment,{children:["Log out and click ",(0,a.Y)("b",{children:"“Forgot password”"})," on the login screen. We'll email you a reset link."]}),"data-sentry-element":"Alert","data-sentry-source-file":"userProfileSettings.tsx"})]})}),(0,a.Y)("div",{className:"w-full",id:ey.Gl.TwoFactorAuth,ref:e(ey.Gl.TwoFactorAuth),children:(0,a.Y)(H.d,{title:(0,a.FD)("div",{className:"flex items-center gap-2",children:[(0,a.Y)(d.I,{icon:ee.$.ShieldCheck,size:20}),"Security"]}),"data-sentry-element":"PageSection","data-sentry-source-file":"userProfileSettings.tsx",children:(0,a.FD)(h.Ah,{flexDirection:"column",itemsSpacingVertical:24,occupyParentWidth:!0,childrenTakeFullWidth:!0,"data-sentry-element":"FlexLayout","data-sentry-source-file":"userProfileSettings.tsx",children:[(0,a.Y)(eu,{"data-sentry-element":"TwoFactorSection","data-sentry-source-file":"userProfileSettings.tsx"}),(0,a.Y)(U,{visible:b,onClose:()=>
3C(!1),"data-sentry-element":"AccountDeletion","data-sentry-source-file":"userProfileSettings.tsx"}),(0,a.Y)(eA.Xg,{flag:eS.mr.ProactiveHelp,match:!0,"data-sentry-element":"PostHogFeature","data-sentry-source-file":"userProfileSettings.tsx",children:(0,a.Y)(ex,{"data-sentry-element":"ProactiveHelpToggle","data-sentry-source-file":"userProfileSettings.tsx"})}),(0,a.Y)(ec.o,{"data-sentry-element":"GuestUserHidden","data-sentry-source-file":"userProfileSettings.tsx",children:(0,a.Y)("div",{id:ey.Gl.DeleteAccount,ref:e(ey.Gl.DeleteAccount),children:(0,a.Y)(c.A,{variant:"ghost",color:"danger",onClick:()=>{C(!0)},disabled:x||!v,disabledTooltip:v?void 0:{title:"Please downgrade to a free plan before deleting account"},"data-sentry-element":"Button","data-sentry-source-file":"userProfileSettings.tsx",children:x?"Processing request":"Delete account"})})})]})})})]}):null}},74743:(e,t,n)=>{n.d(t,{$:()=>a,V:()=>r});let a="Each draft portfolio has a reference (your Net Worth Portfolio, an Asset Group, or individual account). The reference is used to compare side-by-side, share risk preferences and custom instructions, and produce an order execution list.",r="Create a draft version of your portfolio to test changes and explore ideas before making final decisions"},75075:(e,t,n)=>{n.d(t,{A:()=>d,z:()=>s});var a=n(88963),r=n(13125),o=n.n(r),i=n(62031),l=n.n(i),s=function(e){return e.CheckingAccount="Checking account",e.SavingAccount="Saving account",e.MoneyMarketAccount="Money market account",e.LoanAccount="Loan account",e.MortgageAccount="Mortgage account",e.CreditCardAccount="Credit card account",e.OtherCashAccount="Other cash account",e}({});class c{constructor(){this.upsertCashPortfolio=async e=>{let t=await this.apiCaller.post("/cash_portfolio/upsert_cash_portfolio",o()(e));return l()(t)},this.createCashOnlyLinkToken=async e=>{let t=await this.apiCaller.post("/cash_portfolio/create_cash_only_link_token",o()(e));return l()(t).linkToken},this.exchangePublicToken=async e=>{let{publicToken:t,reconnectingAccountId:n}=e,a=await this.apiCaller.post("/cash_portfolio/exchange_public_token",o()({publicToken:t,reconnectingAccountId:n}));return l()(a,{deep:!0})},this.getCashPortfolioById=async e=>{let t=await this.apiCaller.get("/cash_portfolio/get_cash_portfolio_by_id",o()({cashPortfolioId:e}));return l()(t)},this.deleteCashPortfolio=async e=>await this.apiCaller.post("/cash_portfolio/delete_cash_portfolio",o()({cashPortfolioId:e})),this.getCashConnectedAccounts=async()=>{let e=await this.apiCaller.get("/cash_portfolio/get_cash_connected_accounts");return l()(e,{deep:!0})},this.getCashPortfolios=async()=>{let e=await this.apiCaller.get("/cash_portfolio/get_cash_portfolios");return l()(e)},this.syncBalances=async e=>await this.apiCaller.post("/cash_portfolio/sync_balances",o()(e)),this.disconnectCashAccount=async e=>{let t=await this.apiCaller.post("/cash_portfolio/disconnect",o()(e));return t?l()(t):null},this.getDefaultApyRates=async()=>{let e=await this.apiCaller.get("/cash_portfolio/get_default_apy_rates");return l()(e)},this.apiCaller=new a.Ay}}let d=new c},75128:(e,t,n)=>{n.d(t,{$M:()=>d,C2:()=>p,DI:()=>c.DI,dm:()=>y,eb:()=>u,it:()=>m,ub:()=>c.ub});var a=n(33624),r=n(98868),o=n(78190),i=n(98804),l=n(84455),s=n(16636),c=n(73070);let d=[i.WR.StartingTaxFreeAssets,i.WR.StartingTaxAdvantageAssets,i.WR.InheritedTaxAdvantagedShare,i.WR.StartingTaxedAssets,i.WR.PortfolioScore],u=a.TSs((e,t)=>a.Ufq(t.preferenceId,t.dataclassField,e),{},s.KZ),m=a.TSs((e,t)=>a.Ufq(t.dataclassField,t.preferenceId,e),{},s.KZ),p={currentAge:40,retirementAge:67,lifeExpectancy:95,startingTaxFreeAssets:0,startingTaxAdvantageAssets:0,inheritedTaxAdvantagedShare:0,startingTaxedAssets:0,riskPreference:r.R$.ModeratelyConservative,preRetirementReturnRate:void 0,retirementRiskPreference:r.R$.ModeratelyConservative,retirementReturnRate:void 0,yearlyTaxableIncome:0,countryOfResidence:o.XM.USA,state:"",taxFilingStatus:l.Xx.Single,monthlyRetirementContribution:0,monthlyTaxedInvestmentContribution:0,monthlyRetirementBudget:1e3,socialSecurityBenefits:0,socialSecurityBenefitsStartAge:67,otherRetirementIncome:0,portfolioScore:0,inflationRateYoy:.02,salaryIncreaseYoy:.02,lumpsumPayoutOnRetirement:1e5,portfolioRebalanceFrequency:i.YU.Yearly,portfolioManagementFee:0,legacyAmountToChildren:0,taxLossHarvesting:i.Yr.Yearly,maxOutYearlyRothContribution:!1,realEstateGrowthRate:s.Lb,realEstateCostMode:i.ph.Random,realEstateUpkeepRate:s.mE,startingCash:void 0,startingRealEstate:void 0,startingPrivateEquity:void 0,modelRmds:!0,distributionStrategy:i.wO.TaxableFirst,preRmdDistributionSchedule:i.wO.TaxableFirst,postRmdDistributionSchedule:i.wO.TaxableFirst,spendingRule:i.hB.Fixed,withdrawalOrder:i.iv.TaxableFirst,includeSpouse:!1,spouseAge:40,spouseRetirementAge:67,spouseLifeExpectancy:95,spouseSocialSecurityBenefits:0,spouseSocialSecurityBenefitsStartAge:67,spouseIncomeAsHouseholdPercentage:.4},y={monthlyRetirementContribution:{min:0,max:5e3},monthlyTaxedInvestmentContribution:{min:0,max:5e3},monthlyRetirementBudget:{min:1e3,max:3e4}}},75463:(e,t,n)=>{n.d(t,{A:()=>r}),n(12115);var a=n(90165);let r=e=>{let{chartComponentRef:t,insightId:n,highCharts:r}=e;return(0,a.l)(t,n,r),null}},75640:(e,t,n)=>{n.d(t,{b:()=>b,v:()=>C});var a=n(65438),r=n(18281),o=n(99996),i=n(13977),l=n(37722),s=n(8921),c=n(88963),d=n(62031),u=n.n(d),m=n(13125),p=n.n(m);class y{constructor(){this.getParsedStatementData=async e=>{let{statementId:t,parsingId:n}=e,a=await this.apiCaller.get("/statements/get_parsed_results",p()({statementId:t,parsingId:n}));return u()(a)},this.triggerParsedStatementDataAsync=async e=>{let{statementId:t,parsingId:n}=e,a=await this.apiCaller.post("/statements/get_parsed_results_async",p()({statementId:t,parsingId:n}));return u()(a)},this.apiCaller=new c.Ay}}let h=new y;var f=n(67759),g=n(4603),v=n(12115),x=n(80017),A=n(59225),S=n(57149);let b=()=>{let{shouldShowParsedPortfolioEditor:e,editorParsedInvestmentItems:t,normalizedUserUploadedData:n,launchParsedPortfolioEditor:c,closeParsedPortfolioEditor:d}=(()=>{let[{showEditor:e,parsedInvestmentItems:t,normalizedUserUploadedData:n},a]=(0,l.m5)();return{shouldShowParsedPortfolioEditor:e,editorParsedInvestmentItems:t,normalizedUserUploadedData:n,launchParsedPortfolioEditor:(e,t)=>
3{a({type:"launchEditor",payload:{parsedInvestmentItems:e,normalizedUserUploadedData:t}})},closeParsedPortfolioEditor:()=>{a({type:"closeEditor"})}}})(),{uploaderInstanceRef:u,uploaderConfig:m,isUploaderOpen:p,launchUploader:y,afterUploaderOpened:b,exitImporter:C,isFilesEmpty:I,submitUploader:w,retryParsing:P,remoteUploadStatusSnapshot:k,statementParserStatusSnapshot:F,statementParserPayload:T}=(e=>{var t;let{onStatementsParsed:n}=e,{value:l,setValue:c}=(0,a.A)(!1),[d,u]=(0,v.useState)("idle"),[m,p]=(0,v.useState)(null),[y,f]=(0,v.useState)(null),g=(0,v.useRef)(null),b="error"===d,C=b&&!!(null==y?void 0:y.statementId),I=(0,v.useCallback)(()=>{u("idle"),p(null),f(null),g.current=null},[]),w=(0,v.useCallback)(e=>{n(e)},[n]),P=(0,v.useCallback)(e=>{let{error:t,statementId:n,parsingId:a}=e,r="Brokerage statement unreadable";(0,s.Ds)(s._n.Error,r,{description:"The uploaded statement could not be parsed."}),console.error(r,{statementId:n,parsingId:a,error:t})},[]);t=(0,v.useCallback)(e=>{let t=g.current;t&&e.statementId===t.statementId&&e.parsingId===t.parsingId&&(g.current=null,e.success?(u("success"),p(e.portfolioItems),w(e.portfolioItems)):(u("error"),P({error:Error(e.errorMessage||"Parsing failed"),statementId:e.statementId,parsingId:e.parsingId})))},[w,P]),(0,S.a)({socketEvent:x.y.StatementParsed,namespace:A.N.StatementParsed,onSnapshot:e=>{var n,a,r;let{snapshot:o,payload:i,isSuccess:l}=e;t({statementId:null!=(n=null==i?void 0:i.statementId)?n:0,parsingId:null!=(a=null==i?void 0:i.parsingId)?a:o.variantKey,success:l,portfolioItems:null!=(r=null==i?void 0:i.portfolioItems)?r:[],errorMessage:o.errorMessage})}});let k=(0,v.useCallback)(async(e,t)=>{u("loading"),f({statementId:e,parsingId:t}),g.current={statementId:e,parsingId:t};try{await h.triggerParsedStatementDataAsync({statementId:e,parsingId:t})}catch(n){u("error"),g.current=null,P({error:n,statementId:e,parsingId:t})}},[P]),F=(0,v.useCallback)(e=>{let{parsedResult:t,isParsingSucceeded:n}=(0,i.Ei)(e);if(n&&t&&t.statementId&&t.parsingId){let{statementId:e,parsingId:n}=t;k(e,n)}else(0,s.Ds)(s._n.Error,"Brokerage statement parsing failed"),console.error("Brokerage statement parser succeeded but invalid result returned",{rawParsedResult:e,parsedResult:t})},[k]),T=(0,v.useCallback)(()=>{(null==y?void 0:y.statementId)&&(null==y?void 0:y.parsingId)?k(y.statementId,y.parsingId):console.error("No data found to retry parsing",y)},[y,k]),{uploaderInstanceRef:E,uploaderConfig:Y,afterUploaderOpened:D,isFilesEmpty:R,exitUploader:N,onSubmit:M,remoteUploadStatus:L,resetUploaderInstance:_}=(0,o.N)({dataDomain:r.SN.Brokerage,onUploadResponseSuccess:F,onUploadResponseError:()=>{}});return{isUploaderOpen:l,launchUploader:()=>{c(!0)},afterUploaderOpened:D,exitImporter:()=>{c(!1),N(),I()},uploaderInstanceRef:E,uploaderConfig:Y,isFilesEmpty:R,submitUploader:async()=>{await M()},retryParsing:T,parsedInvestmentItems:m,remoteUploadStatusSnapshot:{remoteUploadStatus:L,isRemoteUploadInProgress:"loading"===L,isRemoteUploadFailed:"error"===L,isRemoteUploadSucceeded:"success"===L},statementParserStatusSnapshot:{isStatementsParsed:"success"===d,isStatementsParsingInProgress:"loading"===d,isStatementsParsingFailed:!!b,isFailedParserRetryable:C},statementParserPayload:y,resetUploaderInstance:_,resetStatementsParser:I}})({onStatementsParsed:e=>{c(e,JSON.stringify(e))}});return{importerProps:{isUploaderOpen:p,launchUploader:y,afterUploaderOpened:b,exitImporter:C,uploaderInstanceRef:u,uploaderConfig:m,isFilesEmpty:I,submitUploader:w,retryParsing:P,remoteUploadStatusSnapshot:k,statementParserStatusSnapshot:F},portfolioEditorProps:{parsedInvestmentItems:t,shouldShowParsedPortfolioEditor:e,launchParsedPortfolioEditor:c,normalizedUserUploadedData:n,handlePortfolioImportCancel:()=>{(0,f.trackStatementsImport)({dataDomain:r.SN.Brokerage,event:g.StatementsImportEvent.ParsedDataIgnored,parsedResult:T}),d(),C()},handlePortfolioSaveComplete:()=>{d(),C()},handleInitiateNewUpload:()=>{d(),P()},statementId:null==T?void 0:T.statementId}}},C=e=>{let{shouldShowParsedPortfolioEditor:t,editorParsedInvestmentItems:n,isRemoteUploadInProgress:a,isStatementsParsingInProgress:r,isRemoteUploadFailed:o,isStatementsParsingFailed:i,isFilesEmpty:l,retryParsing:s,submitUploader:c}=e,[d,u]=(0,v.useState)(!1),m=t&&n,p=(()=>
3{if(a)return"Uploading";if(o)return"Retry upload";if(r)return"Processing";if(i)return"Retry parsing";if(m)return"Opening editor";return"Upload"})(),y=l||!!m||a||r;return(0,v.useEffect)(()=>{u(a||r)},[a,r]),{isParsedPortfolioEditorOpen:m,importerActionLoading:d,importerActionLabel:p,importerActionDisabled:y,importerSubmitAction:o||l||!i?c:s,initiateReparsingLabel:"Not right? Re-process uploaded doc"}}},75973:(e,t,n)=>{e.exports=n.p+"static/media/ob_increase_risk_adjusted_returns.518a87e4edfcb266.svg"},76145:(e,t,n)=>{n.d(t,{Ab:()=>h,Ih:()=>c,VL:()=>u,eI:()=>d});var a=n(57090),r=n(12115),o=n(36934),i=n(74547),l=n(59949),s=n(41784);let c=()=>(0,a.Y)(o.bU,{className:(0,s.cn)("text-neutral-500"),"data-sentry-element":"Body1W400","data-sentry-component":"StatementFormatInstructions","data-sentry-source-file":"molecules.tsx",children:"Make sure that the holdings of your account (ticker, quantity, market value) are part of the uploaded document. Acceptable file formats include csv, spreadsheet, pdf, and most image files (including a screenshot)."}),d=()=>{let[e,t]=r.useState(0);return r.useEffect(()=>{let e=Date.now(),n=setInterval(()=>{t((Date.now()-e)/1e3)},250);return()=>clearInterval(n)},[]),(0,a.FD)("div",{className:"flex flex-col gap-y-2","data-sentry-component":"ProcessingStatementProgress","data-sentry-source-file":"molecules.tsx",children:[(0,a.Y)(o.bU,{className:(0,s.cn)("text-neutral-500"),"data-sentry-element":"Body1W400","data-sentry-source-file":"molecules.tsx",children:"Processing statement…"}),(0,a.Y)(l.A,{value:99*(1-Math.exp(-e/120)),size:"sm","data-sentry-element":"Progress","data-sentry-source-file":"molecules.tsx"}),(0,a.Y)(o.km,{className:(0,s.cn)("text-neutral-500"),"data-sentry-element":"Body2W400","data-sentry-source-file":"molecules.tsx",children:(e=>e>=480?"Taking longer than usual, still working. Keep this tab open.":e>=180?"Large portfolios take up to 8 minutes. Keep this tab open.":"Most statements finish in 1-2 minutes. Keep this tab open.")(e)})]})},u=()=>(0,a.Y)(o.st,{"data-sentry-element":"HelperMessage","data-sentry-component":"ReparsingHelperText","data-sentry-source-file":"molecules.tsx",children:"(10% higher chance it imports properly on second attempt)"}),m=e=>(0,a.Y)(i.Ah,{...e,style:{marginBottom:"32px",...e.style},"data-sentry-element":"FlexLayout","data-sentry-component":"InstructionsContainer","data-sentry-source-file":"molecules.tsx"}),p=e=>{let{style:t,...n}=e;return(0,a.Y)("div",{...n,style:{border:"1px solid var(--colors-neutral200)",borderRadius:"12px",padding:"16px",...t},"data-sentry-component":"InstructionsCard","data-sentry-source-file":"molecules.tsx"})},y=e=>{let{style:t,...n}=e;return(0,a.Y)("ol",{...n,style:{marginTop:"16px",display:"flex",flexDirection:"column",gap:"12px",...t},"data-sentry-component":"InstructionsList","data-sentry-source-file":"molecules.tsx"})},h=()=>(0,a.Y)(m,{flexDirection:"column","data-sentry-element":"InstructionsContainer","data-sentry-component":"ScreenshotInstructions","data-sentry-source-file":"molecules.tsx",children:(0,a.FD)(p,{"data-sentry-element":"InstructionsCard","data-sentry-source-file":"molecules.tsx",children:[(0,a.Y)(o.lc,{className:(0,s.cn)("text-body"),"data-sentry-element":"Body1W600","data-sentry-source-file":"molecules.tsx",children:"How to take a screenshot"}),(0,a.FD)(y,{"data-sentry-element":"InstructionsList","data-sentry-source-file":"molecules.tsx",children:[(0,a.Y)(o.km,{className:(0,s.cn)("text-neutral-500"),"data-sentry-element":"Body2W400","data-sentry-source-file":"molecules.tsx",children:"1. Log into your investment account"}),(0,a.Y)(o.km,{className:(0,s.cn)("text-neutral-500"),"data-sentry-element":"Body2W400","data-sentry-source-file":"molecules.tsx",children:"2. Navigate to your portfolio overview"}),(0,a.Y)(o.km,{className:(0,s.cn)("text-neutral-500"),"data-sentry-element":"Body2W400","data-sentry-source-file":"molecules.tsx",children:"3. Take a screenshot showing your balance and holdings"})]})]})})},76608:(e,t,n)=>{e.exports=n.p+"static/media/securities.3643d866f3993870.svg"},76660:(e,t,n)=>{n.d(t,{C:()=>o,j:()=>r});var a=n(75075);let r=(e,t)=>null==t||t<0||t>
3.1?Promise.reject(Error("Must be between 0-10%")):Promise.resolve(),o=(e,t)=>e&&t?e===a.z.MoneyMarketAccount?t.treasuryRate:e===a.z.CheckingAccount||e===a.z.SavingAccount?t.defaultCheckingSavingsApy:0:0},76699:(e,t,n)=>{n.d(t,{Ay:()=>c,Q6:()=>s,QF:()=>i,d_:()=>l});var a=n(81527),r=n(16462),o=n(35208);let i=["HighLevelRecommendations"],l=["HLRsExist"],s=e=>(0,a.I)(l,r.Ay.checkHLRsExist,{...o.Lo,enabled:e}),c=e=>(0,a.I)(i,r.Ay.getCurrentRecommendations,{...o.Lo,enabled:e})},77348:(e,t,n)=>{n.d(t,{A:()=>T});var a=n(57090),r=n(12115),o=n(50202),i=n(40248),l=n(32189),s=n(544),c=n(73435),d=n(8662),u=n(9925),m=n(62212),p=n(42036),y=n(4603),h=n(67759),f=n(99885),g=n(18162),v=n(41686),x=n(27742);let A=e=>{let{activePortfolio:t}=(0,o.RW)(),{portfolioId:n,portfolioType:i}=t,{portfolioScore:l}=(0,c.A)(n),A=(0,u.D)(),{switchActivePortfolio:S}=(0,p.Ay)(),b=(0,m.j)(),[C,I]=r.useState(!1),{textInput:w,trimmedTextInput:P,setTextInput:k}=(0,f.n)(),F=async()=>{try{I(!0);let t=async t=>{let n=(0,d.W)(b),a=(0,s.Fk)(n,t.clonedDraftPortfolioId);(0,v.E0)(()=>{(0,h.trackDraftPortfolioCreated)({scenario:y.PortfolioCreationScenario.RecommendationApplied,sourcePortfolioType:i})}),a&&(await e.onSubmit({draftPortfolio:a,sourcePortfolioType:i}),S(a.portfolioId,p.Gl.Auto,"Copied and switched to new Draft Portfolio"),(0,g.eG)({behavior:"smooth"}))};await A.mutateAsync({sourcePortfolioId:n,portfolioName:P,portfolioDescription:"",creationScenario:y.PortfolioCreationScenario.RecommendationApplied,onSuccessCallback:t})}finally{I(!1),e.onComplete()}},T=null!=l&&null!=e.scoreBenefit?{current:l,after:l+e.scoreBenefit}:void 0;return(0,a.Y)(x.A,{open:e.open,draftName:w,onDraftNameChange:k,referencePortfolioId:n,onOk:F,onCancel:e.onCancel,scorePreview:T,isSubmitting:C,"data-sentry-element":"DraftPortfolioSetupModal","data-sentry-component":"RecommendationDraftPortfolioPopup","data-sentry-source-file":"index.tsx"})};var S=n(99026),b=n(93042),C=n(59574),I=n(65438),w=n(16180),P=n(33624),k=n(60808),F=n(8921);let T=e=>{let t,{activePortfolio:n}=(0,o.RW)(),{comprehensiveRecommendationSuggestedChanges:c}=e,{isPortfolioItemsLoading:d,handleAddInvestmentAction:u,handleReduceInvestmentAction:m,initiateDiversificationAction:p,initiateIncreaseReturnsAction:y,handlePortfolioLiquidationAction:f,initiateNext1000DollarsAction:g,initiateSellAfterBuyRecommendationAction:v,initiateBuyAfterSellRecommendationAction:x,initiateLowestPerformerAction:T}=(0,b.M)(),{setContextForwardState:E}=(0,C.V)(),{value:Y,setTrue:D,setFalse:R}=(0,I.A)(!1),N=()=>{R()},M=async(t,n)=>{switch(t){case"noop":return(0,S.lQ)();case"sellAfterBuy":{if(!c)return;let{preliminaryBuyTrade:t,recommendedSellTrade:n}=(0,w.uP)(c);return await v({...e.onActionCallBackArgs,preliminaryBuyTrade:t,recommendedSellTrade:n})}case"buyAfterSell":{let{preliminarySuggestedChanges:t,subsequentSuggestedChanges:n,suggestedSecurityActionItem:a}=c;if(!a)return;return await x({...e.onActionCallBackArgs,preliminarySuggestedChanges:t,subsequentSuggestedChanges:n,suggestedSecurityActionItem:a})}case"addition":{let{suggestedSecurityActionItem:t}=c,{suggestedRecommendation:n}=e.onActionCallBackArgs;return await u(n,t)}case"reduction":{let{suggestedSecurityActionItem:t}=c,{suggestedRecommendation:n}=e.onActionCallBackArgs;return await m(n,t)}case"next1000Dollars":{let t=e.onActionCallBackArgs;return(0,h.trackNext1000DollarsRecommendationAction)(l.eu.DetailsViewed),await g(t.suggestedRecommendation,t)}case"overhaulPortfolio":E({contextReceivedPortfolioId:n.portfolioId});break;case"remove":{let t=e.onActionCallBackArgs;return await T(t.portfolioLowestPerformerItem,t)}case"increaseReturns":{let t=e.onActionCallBackArgs;return await y(t.suggestedInvestmentItem,t)}case"increaseDiversification":{let t=e.onActionCallBackArgs;return await p(t.suggestedInvestmentItem,t)}case"liquidatePortfolio":return f()}},L=async t=>{let{draftPortfolio:n,sourcePortfolioType:a}=t,r=(e=>{if(!(0,s.iw)(e.sourcePortfolioType))return"noop";if(e.hasCallbackArgs&&e.hasComprehensiveChanges){if(e.isSellAfterBuyShape)return"sellAfterBuy";if(e.comprehensiveChanges&&(0,k.yD)({preliminarySuggestedChanges:P.X4r([],["preliminarySuggestedChanges"],e.comprehensiveChanges),subsequentSuggestedChanges:P.X4r([],["subsequentSuggestedChanges"],e.comprehensiveChanges)}))return"buyAfterSell"}switch(e.action){case l.om.Addition:return"addition";case l.om.Reduction:return"reduction";case l.om.Next1000Dollars:return"next1000Dollars";case l.om.OverhaulPortfolio:return"overhaulPortfolio";case l.om.Remove:return"remove";case l.om.IncreaseReturns:return"increaseReturns";case l.om.IncreaseDiversification:return"increaseDiversification";case l.om.LiquidatePortfolio:return"liquidatePortfolio";default:return"unknown"}})({action:e.action,sourcePortfolioType:a,hasCallbackArgs:!!e.onActionCallBackArgs,hasComprehe
3nsiveChanges:!!c,isSellAfterBuyShape:(e=>"object"==typeof e&&null!==e&&P.zyy("preliminaryBuyTrade",e)&&P.zyy("recommendedSellTrade",e))(e.onActionCallBackArgs),comprehensiveChanges:c});if(!(e=>"noop"!==e&&"unknown"!==e)(r))return(0,F.Ds)(F._n.Error,"We couldn't apply this recommendation to your draft. Please try again."),(0,S.lQ)();try{await M(r,n)}catch(e){throw(0,F.Ds)(F._n.Error,"We couldn't apply this recommendation to your draft. Please try again."),e}},_=async t=>{if("passThrough"==((0,s.uF)(n)?"passThrough":"openDraftPopup")){var a;await (null==(a=e.onClick)?void 0:a.call(e,t))}else D()};return(0,a.FD)(r.Fragment,{children:[(0,a.Y)(i.A,{...e,onClick:_,loading:(t=e.loading,d?void 0:t),"data-sentry-element":"Button","data-sentry-source-file":"RecommendationActionButton.tsx"}),(0,a.Y)(A,{scoreBenefit:e.scoreBenefit,open:Y,onCancel:()=>{N()},onSubmit:L,onComplete:N,"data-sentry-element":"RecommendationDraftPortfolioPopup","data-sentry-source-file":"RecommendationActionButton.tsx"},"".concat(Y))]})}},77729:(e,t,n)=>{n.d(t,{Q:()=>u});var a=n(57090),r=n(12115),o=n(79968),i=n(74547),l=n(55074),s=n(75640),c=n(76145),d=n(36934);let u=e=>{let{onPortfolioImported:t,renderSubmit:n,showSimpleInstructions:u}=e,{importerProps:{uploaderInstanceRef:m,uploaderConfig:p,afterUploaderOpened:y,isFilesEmpty:h,submitUploader:f,exitImporter:g,retryParsing:v,remoteUploadStatusSnapshot:{isRemoteUploadInProgress:x,isRemoteUploadFailed:A},statementParserStatusSnapshot:{isStatementsParsingInProgress:S,isStatementsParsingFailed:b}},portfolioEditorProps:{parsedInvestmentItems:C,normalizedUserUploadedData:I,shouldShowParsedPortfolioEditor:w,handlePortfolioSaveComplete:P,handleInitiateNewUpload:k,handlePortfolioImportCancel:F,statementId:T}}=(0,s.b)(),{isParsedPortfolioEditorOpen:E,importerActionLoading:Y,importerActionLabel:D,importerActionDisabled:R,importerSubmitAction:N,initiateReparsingLabel:M}=(0,s.v)({shouldShowParsedPortfolioEditor:w,editorParsedInvestmentItems:C,isRemoteUploadInProgress:x,isStatementsParsingInProgress:S,isRemoteUploadFailed:A,isStatementsParsingFailed:b,isFilesEmpty:h,retryParsing:v,submitUploader:f});r.useEffect(()=>(y(),()=>{g()}),[]);let L=async()=>{Y||R||await N()};return(0,a.FD)(r.Fragment,{children:[(0,a.FD)(i.Ah,{display:"block",itemsSpacingVertical:12,flexWrap:"nowrap","data-sentry-element":"FlexLayout","data-sentry-source-file":"PortfolioStatementLiveImporter.tsx",children:[u?(0,a.Y)(r.Fragment,{children:(0,a.Y)(c.Ab,{})}):(0,a.FD)(r.Fragment,{children:[(0,a.Y)(d.se,{className:"text-body",children:"Upload your brokerage statement or screenshot"}),(0,a.Y)(c.Ih,{})]}),(0,a.Y)(o.d,{uploaderRef:m,config:p,showSimpleInstructions:u,"data-sentry-element":"Uploader","data-sentry-source-file":"PortfolioStatementLiveImporter.tsx"}),S?(0,a.Y)(c.eI,{}):null,(0,a.Y)(i.Ah,{justifyContent:"flex-end",marginTop:24,"data-sentry-element":"FlexLayout","data-sentry-source-file":"PortfolioStatementLiveImporter.tsx",children:n?n({onSubmit:L,submitLabel:D,disabled:R,loading:Y}):(0,a.Y)(i.$n,{variant:"filled",onClick:L,disabled:R,loading:Y,"data-sentry-element":"Button","data-sentry-component":"renderSubmitCTA","data-sentry-source-file":"PortfolioStatementLiveImporter.tsx",children:D})})]}),E&&C?(0,a.Y)(l.A,{uploadedData:null!=I?I:JSON.stringify(C),portfolioInvestmentItems:C,onPortfolioSaveComplete:e=>{let{setupFinalOutcome:n,portfolioId:a}=e;P({setupFinalOutcome:n,portfolioId:a}),t({setupFinalOutcome:n,portfolioId:a})},onInitiateNewUpload:k,initiateNewUploadLabel:M,initiateNewUploadExtra:(0,a.Y)(c.VL,{}),onCancel:F,hideParsingFeedback:!0,statementId:T}):null]})}},78518:(e,t,n)=>{n.d(t,{U:()=>a});let a="For example:\nApple $3214\nCRM $84154\nVOO $23500\nTSLA #200\nCash $900"},78561:(e,t,n)=>{n.d(t,{A:()=>et,h:()=>ee});var a=n(57090),r=n(12115),o=n(42463),i=n(33624),l=n(62346),s=n(74547),c=n(36934),d=n(12919);let u=r.createContext(void 0);u.displayName="ConnectedPortfolioTableContext";let m=()=>{let e=r.useContext(u);if(!e)throw Error("useShareAmountTableContext must be used within a Context");return e};var p=n(99147),y=n(985),h=n(27234);let f=e=>{let{item:t}=e;return(0,a.Y)(h.i,{compactMode:!0,investmentItem:t,forceProxiedSecurityMode:!1,"data-sentry-element":"ProxyContextualSecurityLabel","data-sentry-component":"ConnectedPortfolioTableSecurityColumn","data-sentry-source-file":"ConnectedPortfolioTableSecurityColumn.tsx"})};var g=n(544),v=n(48779),x=n(11325),A=n(13340);let S=e=>{let{portfolioInvestmentItem:t}=e,{amount:n}=t,{handleInvestmentItemAmountUpdate:r}=m();return t.isEdited?(0,a.Y)(p.c8,{value:n,min:(0,g.t)(t)?void 0:v.Jo,onChange:e=>{let n=Number(e),a=Number.isNaN(n)?0:n;r(t.ticker,a)}}):(0,a.Y)(x.eF,{amount:n,sourceCurrency:A.mF,"data-sentry-element":"CurrencyAmount","data-sentry-component":"ConnectedPortfolioTableMarketValueColumn","data-sentry-source-file":"ConnectedPortfolioTableMarketValueColumn.tsx"})};var b=n(81671);let C=e=>{let{portfolioInvestmentItem:t}
3=e,{handleResetInvestmentItem:n,isInvestmentPositionOverridden:r}=m(),o=r(t.ticker);return(0,a.Y)(s.ID,{title:"Remove override and refresh position to initial synced value","data-sentry-element":"InfoTooltip","data-sentry-component":"ResetColumn","data-sentry-source-file":"ResetColumn.tsx",children:(0,a.Y)(p.YT,{onClick:()=>{o&&n(t.ticker)},isIconOnly:!0,variant:"ghost",color:"neutral",disabled:!o,"data-sentry-element":"RemoveInvestmentButton","data-sentry-source-file":"ResetColumn.tsx",children:(0,a.Y)(s.In,{icon:b.$.ArrowRotateCounterClockwise,size:16,"data-sentry-element":"Icon","data-sentry-source-file":"ResetColumn.tsx"})})})};var I=n(35208);let w=e=>{let{portfolioInvestmentItem:t}=e;return(0,g.t)(t)?null:i.gD_(t.currentPrice)?(0,a.Y)(s.Ah,{children:I.UZ}):(0,a.Y)(s.Ah,{height:"40px","data-sentry-element":"FlexLayout","data-sentry-component":"ConnectedPortfolioTablePriceColumn","data-sentry-source-file":"ConnectedPortfolioTablePriceColumn.tsx",children:(0,a.Y)(x.eF,{amount:t.currentPrice,sourceCurrency:A.mF,"data-sentry-element":"CurrencyAmount","data-sentry-source-file":"ConnectedPortfolioTablePriceColumn.tsx"})})};var P=n(99026),k=n(38249),F=n(92672),T=n(6558),E=n(31272);let Y=e=>{let{portfolioInvestmentItem:t}=e,{handleInvestmentSharesUpdate:n}=m();if((0,g.t)(t))return null;if(i.gD_(t.currentPrice))return(0,a.Y)(F.Ah,{children:I.UZ});let{quantity:o,currentPrice:l,isEdited:s}=t,c=(0,T.ph)(l);return s?(0,a.Y)(k.A,{value:o,fractionDigits:c,onChange:e=>{let a=(0,P.YZ)(e);n(t.ticker,a)},placeholder:"shares"}):(0,a.Y)(r.Fragment,{children:(0,E.Z9)(o,c)})},D=e=>{let{portfolioInvestmentItem:t}=e,{handleEditInvestmentItem:n}=m();return(0,a.Y)(p.YT,{onClick:()=>n(t.ticker),isIconOnly:!0,variant:"ghost",color:"neutral","data-sentry-element":"RemoveInvestmentButton","data-sentry-component":"EditColumn","data-sentry-source-file":"EditColumn.tsx",children:(0,a.Y)(s.In,{icon:b.$.Pencil,size:16,"data-sentry-element":"Icon","data-sentry-source-file":"EditColumn.tsx"})})},R=[{title:(0,a.Y)(p.W$,{children:"Securities"}),dataIndex:"ticker",key:"ticker",render:(e,t)=>(0,a.Y)(f,{item:t}),fixed:"left",width:160},{title:(0,a.Y)(p.W$,{children:"Quantity"}),dataIndex:"quantity",key:"shares",render:(e,t)=>(0,a.Y)(Y,{portfolioInvestmentItem:t}),align:"right",width:120},{title:(0,a.FD)(p.W$,{children:["Price"," ",(0,a.Y)(y.sq,{title:"The price of the security is based on the closing price of the last trading day",style:{height:14,width:14}})]}),dataIndex:"currentPrice",key:"currentPrice",render:(e,t)=>(0,a.Y)(w,{portfolioInvestmentItem:t}),align:"center",width:120},{title:(0,a.Y)(p.W$,{children:"Market value"}),dataIndex:"amount",key:"amount",align:"right",render:(e,t)=>(0,a.Y)(S,{portfolioInvestmentItem:t}),width:144},{title:null,align:"center",dataIndex:"edit",key:"edit",render:(e,t)=>(0,a.Y)(D,{portfolioInvestmentItem:t}),width:48},{title:null,align:"center",dataIndex:"remove",key:"reset",render:(e,t)=>(0,a.Y)(C,{portfolioInvestmentItem:t}),width:48}];var N=n(17667),M=n(88963),L=n(13125),_=n.n(L),O=n(62031),W=n.n(O);class B{constructor(){this.getPortfolioEdits=async e=>{let t=await this.apiCaller.get("/user_portfolio_edits/portfolio/edits",_()({portfolioId:e}));return W()(t,{deep:!0})},this.createPortfolioEdit=async e=>{await this.apiCaller.post("/user_portfolio_edits/portfolio/create",_()(e))},this.deletePortfolioEdit=async e=>{await this.apiCaller.post("/user_portfolio_edits/portfolio/delete",_()(e))},this.apiCaller=new M.Ay}}let U=new B;var z=n(81527),V=n(84245),j=n(19682),H=n(92283),q=n(17143);let G=(e,t)=>({...e,amount:t,quantity:t,isFixedAmount:!0});var K=n(88105);let Q=s.XI,$=[],X=e=>{let{portfolio:t,initialEditableTicker:n}=e,{data:m=$,isFetching:p}=(0,l.NB)(t.portfolioId),{data:y=[]}=(e=>(0,z.I)((0,V.xz)(e),()=>U.getPortfolioEdits(e)))(t.portfolioId),h=(0,N.A)(async e=>{await Promise.allSettled(e.map(U.deletePortfolioEdit))},{onSuccessMessage:()=>"Deleted overrides successfully"}),f=(0,N.A)(async e=>{await Promise.allSettled(e.map(U.createPortfolioEdit))},{onSuccessMessage:()=>"Saved overrides successfully"}),[v,x]=r.useState(m),A=r.useMemo(()=>i.Va7([i.XnJ(g.t),i.jk0(e=>(0,q.$S)(e.ticker))],v),[v]),S=r.useMemo(()=>i.pbD(e=>!!(null==e?void 0:e.isEdited),v),[v]),b=o.A(S);r.useEffect(()=>{x(m)},[m]);
3let{launchUnsavedChangesModal:C}=(0,K.y)(),I=async e=>{await h.mutateAsync([{portfolioId:t.portfolioId,ticker:e,isFixedAmount:!1}])},w=async()=>{let n=i.TjK(e=>({ticker:e.ticker,quantity:e.quantity,amount:e.amount,portfolioId:t.portfolioId,isFixedAmount:e.isFixedAmount}),S);await f.mutateAsync(n,{onSuccess:()=>{e.onClose()}})},P=()=>{b?C({onDiscard:e.onClose,onSave:w}):e.onClose()};return(0,a.Y)(s._s,{open:!0,width:840,title:"Override connected account holdings",onClose:P,footer:(0,a.FD)(d.tb,{children:[(0,a.Y)(s.$n,{onClick:P,children:"Cancel"}),(0,a.Y)(s.$n,{variant:"filled",onClick:w,disabled:!b,children:"Save"})]}),"data-sentry-element":"Drawer","data-sentry-component":"ConnectedPortfolioEditTable","data-sentry-source-file":"ConnectedPortfolioEditTable.tsx",children:(0,a.Y)(u.Provider,{value:{isInvestmentPositionOverridden:e=>i.bzn(t=>(0,q.cp)(t.ticker,e),y),handleInvestmentItemAmountUpdate:(e,t)=>{x(((e,t,n)=>i.TjK(n=>{if(!(0,q.cp)(n.ticker,e))return n;if((0,g.t)(n))return G(n,t);let a=(0,g.Ip)(n);return{...n,amount:t,isFixedAmount:j.A(n.currentPrice),quantity:H.A(n.currentPrice)?t/(n.currentPrice*(a?100:1)):n.quantity}},n))(e,t,v))},handleInvestmentSharesUpdate:(e,t)=>{x(((e,t,n)=>i.TjK(n=>{if(!(0,q.cp)(n.ticker,e))return n;if((0,g.t)(n))return G(n,t);let a=(0,g.Ip)(n);return{...n,quantity:t,amount:H.A(n.currentPrice)?t*n.currentPrice*(a?100:1):n.amount,isFixedAmount:!1}},n))(e,t,v))},handleResetInvestmentItem:I,handleEditInvestmentItem:e=>{x(i.TjK(t=>(0,q.cp)(t.ticker,e)?{...t,isEdited:!0}:t,v))}},"data-sentry-element":"unknown","data-sentry-source-file":"ConnectedPortfolioEditTable.tsx",children:(0,a.Y)(Q,{name:(0,a.Y)(c.se,{className:"text-body",children:t.portfolioName}),isStriped:!1,loading:p,isCompact:!0,dataSource:A,rowKey:e=>e.ticker,pagination:!1,columns:R,disabled:p,highlightRowKey:n,"data-sentry-element":"ConnectedPortfolioTable","data-sentry-source-file":"ConnectedPortfolioEditTable.tsx"})})})},{useConnectedPortfolioEditLaunchEventListener:J,emitConnectedPortfolioEditLaunchEvent:Z}=(0,n(43948).createEvent)("ConnectedPortfolioEditLaunchEvent")(),ee=()=>({launchConnectedPortfolioEdit:(e,t)=>{Z({portfolio:e,initialEditableTicker:t})}}),et=()=>{let[e,t]=(0,r.useState)(null),[n,o]=(0,r.useState)(void 0),i=(0,r.useRef)(P.lQ);return(J(e=>{let{portfolio:n,onCloseCallback:a,initialEditableTicker:r}=e;t(n),o(r),i.current=a||P.lQ}),e)?(0,a.Y)(X,{portfolio:e,onClose:()=>{t(null),o(void 0),i.current()},initialEditableTicker:n,"data-sentry-element":"ConnectedPortfolioEditTable","data-sentry-component":"GlobalConnectedPortfolioEditLauncher","data-sentry-source-file":"GlobalConnectedPortfolioEditLauncher.tsx"}):null}},79073:(e,t,n)=>{n.d(t,{L_:()=>r,U7:()=>o,jc:()=>i});var a=n(90772),r=function(e){return e.PortfolioInteractive="portfolio-interactive",e.AccountSync="account-sync",e.Scenario="scenario",e}({});let o=e=>({journey:e,startedAt:performance.now()}),i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return;let r=Math.round(performance.now()-e.startedAt);(0,a.sx)(t,{durationMs:r,...n})}},79279:(e,t,n)=>{n.d(t,{I:()=>o,R:()=>r});var a=n(12115);let r=a.createContext(void 0);r.displayName="ShareAmountTableContext";let o=()=>{let e=a.useContext(r);if(!e)throw Error("useShareAmountTableContext must be used within a ShareAmountTableContext");return e}},79768:(e,t,n)=>{n.d(t,{$7:()=>x,Rm:()=>g,rA:()=>v});var a=n(12115),r=n(33624),o=n(13343),i=n(16685),l=n(39653),s=n(32189),c=n(8662),d=n(544),u=n(70890),m=n(18061),p=n(99026),y=n(73285),h=function(e){return e.InActive="inActive",e.InProgress="inProgress",e.Completed="completed",e}(h||{});let f=(0,o.A)((0,i.lt)(e=>({portfoliosInvalidationStatus:{},setPortfolioInvalidationStatus:(t,n)=>e(e=>({portfoliosInvalidationStatus:{...e.portfoliosInvalidationStatus,[t]:n}}))}),{name:"AppDataInvalidationStore"})),g=e=>({isPortfolioInvalidationInitiated:r.aIS("inProgress",f(t=>t.portfoliosInvalidationStatus[e]))}),v=()=>{let e=(0,m.T)(),t=f(e=>e.setPortfolioInvalidationStatus),n=(0,y.w)(),o=(0,p.Uc)(n.asPath);return a.useCallback(async n=>{let a=e.current,i=n.portfolioId,s=(0,c.W)(a),m=r.EyX("portfolioId",s),p=r.mKk(i,m),y=(0,d.Ge)(s,i);
3r.AU6(p)||(t(i,"inProgress"),await (0,l.Y)(a,i,{includeDependencies:!0},o),y&&await (0,u.IX)(a),t(i,"completed"),setTimeout(()=>{t(i,"inActive")},0))},[o,e,t])},x=()=>{let e=(0,m.T)(),t=(0,c.W)(e.current),n=v(),o=a.useRef(n),i=(0,d.I)(t),{isPortfolioInvalidationInitiated:l}=g(r.vUk(-1,null==i?void 0:i.portfolioId));a.useEffect(()=>{o.current=n}),a.useEffect(()=>{if(l){let t=(0,c.W)(e.current),n=(0,d.ns)(t,s.N$.Group);r.jJl(e=>o.current({portfolioId:e.portfolioId,portfolioType:e.portfolioType}),n)}},[l,e,o])}},79968:(e,t,n)=>{n.d(t,{d:()=>f});var a=n(57090),r=n(12115),o=n(33624),i=n(91688),l=n.n(i),s=n(81527);n(30437);var c=n(85267);n(95071);var d=n(16933),u=n(27687),m=n(36271),p=n(35208),y=n(99750);let h=!1,f=e=>{let{showSimpleInstructions:t,uploaderRef:i,config:{acceptedFileTypes:f=[],remoteServer:g,statementType:v,portfolioId:x,onFilesListChanged:A,allowProcess:S=!0,allowMultiple:b=!0,...C}}=e,[I,w]=r.useState([]),{isPluginsReady:P}=(()=>{let{data:e,isLoading:t,error:a,refetch:r}=(0,s.I)(["FilePondPlugins"],async()=>{if(h)return!0;let[e,t,a]=await Promise.all([n.e(7611).then(n.t.bind(n,47611,23)),n.e(3687).then(n.t.bind(n,83687,23)),n.e(1435).then(n.t.bind(n,91435,23))]);return(0,c.F3)(e.default,t.default,a.default),h=!0,!0},{enabled:!0,...p.Lo,retry:3,retryDelay:e=>Math.min(1e3*2**e,3e4),onError:e=>{console.error("Error loading FilePond plugins",e)}});return{isPluginsReady:e,isLoading:t,error:a,refetch:r}})(),{isBelow576:k}=(0,y.uF)();if(!P)return(0,a.Y)("div",{className:"flex justify-center items-center h-full w-full py-2",children:(0,a.Y)(m.y,{placement:"centered",size:"sm",text:"Setting up uploader"})});let F=l()("file",b?2:1),T=t?"Select screenshot":k?'Tap to <span class="filepond--label-action">upload</span> '.concat(F):"Drag & drop ".concat(F,' or <span class="filepond--label-action">browse</span> ').concat(F);return(0,a.Y)(c.a,{ref:i,files:I,onupdatefiles:e=>{w(o.TjK(e=>e.file,e)),A(e)},allowMultiple:b,allowBrowse:!0,allowDrop:!0,allowPaste:!0,allowProcess:S,allowRemove:!0,allowRevert:!0,maxParallelUploads:2,name:"files",dropOnPage:!0,dropValidation:!1,allowFileSizeValidation:!0,maxFileSize:"20MB",maxTotalFileSize:"20MB",allowFileTypeValidation:!0,acceptedFileTypes:f,fileValidateTypeDetectType:(e,t)=>new Promise((e,n)=>{t&&(0,d.Q)(t,f)?e(t):n(t)}),server:{url:(0,u.mW)(window.location.origin),process:{url:g.url,method:"POST",withCredentials:!0,headers:{},timeout:o.vUk(3e5,g.timeoutMs),onload:e=>{var t;return null==(t=g.onUploadResponseReceived)||t.call(g,{response:e,isError:!1}),e},onerror:e=>{var t;return null==(t=g.onUploadResponseReceived)||t.call(g,{response:e,isError:!0}),e},ondata:e=>(e.append("statement_type",v),x&&e.append("portfolio_id",x.toString()),e)},load:null,fetch:null,revert:null,restore:null},instantUpload:!1,chunkUploads:!1,labelIdle:T,credits:!1,...C,"data-sentry-element":"FilePond","data-sentry-component":"Uploader","data-sentry-source-file":"Uploader.tsx"})}},80017:(e,t,n)=>{n.d(t,{y:()=>a});var a=function(e){return e.InvalidatePortfolio="invalidate_portfolio",e.ConnectedAccounts="connected_accounts",e.AiAssistant="ai_assistant",e.AfterEmailVerify="after_email_verify",e.InvalidateGroups="invalidate_groups",e.HLRsResynced="hlrs_resynced",e.HLRsComputed="hlrs_computed",e.OverhaulResult="overhaul_result",e.OverhaulProgress="overhaul_progress",e.RecommendationsComputed="recommendations_computed",e.PersonalizedRecommendationsProgress="personalized_recommendations_progress",e.PortfolioReportComputed="portfolio_report_computed",e.StatementProcessed="statement_processed",e.StatementParsed="statement_parsed",e.OptimizePortfolioComputed="optimize_portfolio_computed",e.TaxLossHarvestingComputed="tax_loss_harvesting_computed",e.NotificationsComputed="notifications_computed",e.PortfolioTextInsightsComputed="portfolio_text_insights_computed",e.ScenarioSimulationComputed="scenario_simulation_computed",e.PlanOptimizerComputed="plan_optimizer_computed",e.PlanOptimizerProgress="plan_optimizer_progress",e.QualifiedTrialStarted="qualified_trial_started",e.FirstSyncCompleted="first_sync_completed",e}({})},80067:(e,t,n)=>{n.d(t,{S_:()=>x,bU:()=>$,qF:()=>q,RQ:()=>Q,AP:()=>S,sB:()=>F,uK:()=>j,Oo:()=>H,xM:()=>X,Oe:()=>U,Gq:()=>Z,J8:()=>R,hL:()=>P,Px:()=>O,jK:()=>C,Cr:()=>A,ic:()=>J,Nl:()=>W,EC:()=>G,bS:()=>B,sE:()=>I,Qx:()=>w,pr:()=>k,BU:()=>N,ji:()=>ee,q1:()=>_,fI:()=>b,Ll:()=>L,kP:()=>M,H7:()=>V,HT:()=>z,_x:()=>T,$$:()=>K,Dk:()=>v,id:()=>Y,BD:()=>E,pE:()=>D});var a=n(48298),r=n(10320),o=n(88963),i=n(62031),l=n.n(i),s=n(13125),c=n.n(s);class d{constructor(){this.getIncomeSummary=async e=>{let t=await this.apiCaller.get("/income/summary",c()({portfolioId:e}));if(!1===t.ok)throw Error(t.reason);return l()(t,{deep:!0})},this.apiCaller=new o.Ay}}let u=new d;var m=n(93959),p=n(33624),y=n(99801),h=n(67759),f=n(544),g=n(9318);let v=async e=>a.Ay.deletePortfolio(e),x=async e=>(await a.Ay.deleteManualPortfolioIfEmpty(e)).deleted,A=async e=>a.Ay.getPortfolioExpectedPerformanceMetrics(e),S=async e=>u.getIncomeSummary(e),b=async e=>a.Ay.getTopRecommendationsComparison(e),C=async e=>a.Ay.getPortfolioExpectedPerformanceChart(e),I=async e=>a.Ay.getPortfolioScoreMetrics(e),w=async e=>a.Ay.getPortfolioScorePercentileRank(e),P=async e=>{try{await Promise.all([a.Ay.getPortfolioPreSeedExpReturns(e),a.Ay.getPortfolioPreSeedExposure(e),a.Ay.getPortfolioTickers(e),a.Ay.getPortfolioPreSeedBetas(e)])}catch(e){console.error("Error fetching pre-seed data:",e)}return await a.Ay.getPortfolioDetailedSummary(e)},k=async(e,t)=>a.Ay.getPortfolioTextInsights(e,t),F=async()=>a.Ay.getMainPortfolioIncompleteStatus(),T=async e=>a.Ay.copyDraftPortfolio(e),E=async e=>a.Ay.createPortfolio(e),Y=async e=>a.Ay.createDraftPortfolio(e),D=async e=>a.Ay.updatePortfolioDetails(e),R=async(e,t)=>((0,h.trackPortfolioReturnsHeatmapAPIFrontendHit)(),a.Ay.getCumulativeReturns(e,t)),N=async e=>a.Ay.getTotalInvestmentsAmount(e),M=async e=>(await a.Ay.getUserPortfolio(e)).updatedPortfolio,L=async()=>
3r.A.getNetworthDetails(),_=async e=>{let t=await a.Ay.getSecuritySuggestions(e);return p.TjK(e=>({label:(0,f.YZ)({ticker:e.ticker,securityName:e.seriesName,formatter:f.cJ.TickerSecurityNamePiped}),value:e.ticker,...e}),t)},O=async e=>a.Ay.getPortfolioDetails(e),W=async e=>a.Ay.getPortfolioTaxDetails(e),B=async e=>a.Ay.getPortfolioRiskProfile(e),U=async()=>a.Ay.getOtherNetWorthPortfolioDetails(),z=async(e,t)=>a.Ay.getWhereToSellRecommendations(e,t),V=async e=>a.Ay.getWhereToSellDollarAmount(e),j=async e=>{let t=await a.Ay.getNext1000DollarsInvestmentForUserPortfolio(e);return(0,g.U)({portfolioId:e}),t},H=async e=>a.Ay.getNextRecommendationsDollarAmount(e),q=async()=>m.A.getConnectedAccounts(),G=()=>a.Ay.getRecommendationsCount(),K=()=>a.Ay.deleteDraftPortfolios(),Q=async e=>a.Ay.getCurrentFees(e),$=async()=>a.Ay.getAggregatedAdvisorFees(),X=async e=>{let t=await a.Ay.getOptimizedFees(e);return{...t,feeOptimizerItems:y.A((e,t)=>({...e,index:t}),t.feeOptimizerItems)}},J=async(e,t)=>a.Ay.getExposuresForUserPortfolio(e,t),Z=async e=>a.Ay.getAllocationsForUserPortfolio(e),ee=async()=>a.Ay.getSampleRecommendations()},80375:(e,t,n)=>{n.d(t,{Z:()=>r});let a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},r=e=>e.replace(/[&<>"']/g,e=>a[e])},80900:(e,t,n)=>{n.d(t,{Af:()=>h,FY:()=>u,GF:()=>y,UO:()=>m,YN:()=>v,gO:()=>f,sy:()=>g,vX:()=>p});var a=n(62031),r=n.n(a),o=n(13125),i=n.n(o),l=n(88963),s=n(45915),c=n(4603),d=n(79073);let u=async e=>await s.A.getScenarioPreferences(e),m=async(e,t)=>{await Promise.all(t.map(t=>s.A.upsertScenarioPreference({...t,scenarioId:e})))},p=async(e,t)=>{let n=(0,d.U7)(d.L_.Scenario);try{let a=await s.A.generateScenarios(e,t);return null!==a&&(0,d.jc)(n,c.TelemetryEvent.ScenarioResult,{success:!0}),a}catch(e){throw(0,d.jc)(n,c.TelemetryEvent.ScenarioResult,{success:!1}),e}},y=async e=>await s.A.getScenarioRiskPreferenceReturns(e),h=async e=>await s.A.downloadBreakdown(e),f={apiCaller:new l.Ay,async getBaseScenarioId(){let e=await this.apiCaller.get("/scenario_modeling/get_base_scenario_id");return r()(e)},async getAllScenarioParams(e){let t=await this.apiCaller.get("/scenario_modeling/get_all_scenario_params?scenario_id=".concat(encodeURIComponent(e)));return r()(t)},async insertScenarioParam(e){let t=await this.apiCaller.post("/scenario_modeling/insert_scenario_param",i()(e));return r()(t)},async updateScenarioParam(e){return await this.apiCaller.post("/scenario_modeling/update_scenario_param",i()(e))},async deleteScenarioParam(e){return await this.apiCaller.post("/scenario_modeling/delete_scenario_param",i()(e))}},g={apiCaller:new l.Ay,async triggerOptimizer(e,t){let n=await this.apiCaller.post("/scenario_modeling/optimize_plan",i()({optimizerKind:e,currentScenarioId:t}));return r()(n,{deep:!0})},async applyOptimizedPlan(e,t,n){return this.postApply("/scenario_modeling/apply_optimized_plan",e,t,n)},async saveOptimizedPlanAsWhatIf(e,t,n){return this.postApply("/scenario_modeling/save_optimized_plan_as_what_if",e,t,n)},async postApply(e,t,n,a){let o=await this.apiCaller.post(e,i()({optimizerKind:t,variantKey:n,currentScenarioId:a}));return r()(o,{deep:!0})}},v={apiCaller:new l.Ay,async getAllSavedScenarios(){let e=await this.apiCaller.get("/scenario_modeling/get_saved_scenarios");return r()(e,{deep:!0})},async getSavedScenario(e){let t=await this.apiCaller.get("/scenario_modeling/get_saved_scenario/".concat(e));return r()(t,{deep:!0})},async createSavedScenario(e){let t=await this.apiCaller.post("/scenario_modeling/create_saved_scenario",i()(e));return r()(t)},async updateSavedScenario(e){return await this.apiCaller.post("/scenario_modeling/update_saved_scenario",i()(e))},async deleteSavedScenario(e){return await this.apiCaller.post("/scenario_modeling/delete_saved_scenario",{scenario_id:e})},async duplicateSavedScenario(e,t){let n=await this.apiCaller.post("/scenario_modeling/duplicate_saved_scenario",{scenario_id:e,new_name:t});return r()(n)},async createDraftScenario(e){let t=await this.apiCaller.post("/scenario_modeling/create_draft_scenario",{source_scenario_id:e});return r()(t)},async commitDraftScenario(e){return await this.apiCaller.post("/scenario_modeling/commit_draft_scenario",i()(e))}}},81237:(e,t,n)=>{n.d(t,{A:()=>s,X:()=>i});
3var a=n(62031),r=n.n(a),o=n(88963),i=function(e){return e.Disabled="disabled",e.NotEnabled="not_enabled",e.CredentialRequired="credential_required",e.InvalidCredential="invalid_credential",e.StepUpUnavailable="step_up_unavailable",e}({});class l{constructor(){this.getMfaSetup=async()=>await this.apiCaller.get("/mfa/setup"),this.verifyAndEnableMfa=async e=>await this.apiCaller.post("/mfa/verify",{code:e}),this.getMfaStatus=async()=>{let e=await this.apiCaller.get("/mfa/status");return r()(e)},this.disableMfa=async e=>await this.apiCaller.post("/mfa/disable",{code:e.code,password:e.password}),this.apiCaller=new o.Ay}}let s=new l},81491:(e,t,n)=>{n.d(t,{$s:()=>m,Sv:()=>s,Xz:()=>c,yd:()=>r});var a=n(12115);let r=e=>"".concat(e," connected. Holdings are importing in the background."),o=null,i=new Set,l=()=>i.forEach(e=>e(o)),s=e=>{o=e,l()},c=()=>{null!==o&&(o=null,l())},d=()=>o,u=e=>(i.add(e),()=>{i.delete(e)}),m=()=>a.useSyncExternalStore(u,d,()=>null)},82748:(e,t,n)=>{n.d(t,{M:()=>r,k:()=>o});var a=n(47120);let r=[{compactMode:!0,defaultSelectedColumns:[a.h.MarketValue,a.h.Quantity],maxSelectable:2},{compactMode:!0,defaultSelectedColumns:[a.h.MarketValue,a.h.Quantity,a.h.Weight],maxSelectable:3},{compactMode:!0,defaultSelectedColumns:[a.h.MarketValue,a.h.Quantity,a.h.AverageCostBasis,a.h.Weight],maxSelectable:4},{compactMode:!0,defaultSelectedColumns:[a.h.MarketValue,a.h.Quantity,a.h.AverageCostBasis,a.h.Weight],maxSelectable:4},{compactMode:!0,defaultSelectedColumns:[a.h.MarketValue,a.h.Quantity,a.h.AverageCostBasis,a.h.Weight,a.h.Dividend],maxSelectable:5}],o=[{compactMode:!0,defaultSelectedColumns:[a.h.MarketValue,a.h.ExpectedReturn],maxSelectable:2},{compactMode:!0,defaultSelectedColumns:[a.h.MarketValue,a.h.Weight,a.h.ExpectedReturn],maxSelectable:3},{compactMode:!0,defaultSelectedColumns:[a.h.MarketValue,a.h.Weight,a.h.ExpectedReturn,a.h.MarketBeta],maxSelectable:4},{compactMode:!0,defaultSelectedColumns:[a.h.MarketValue,a.h.Weight,a.h.MarketBeta,a.h.ExpectedReturn],maxSelectable:4},{compactMode:!0,defaultSelectedColumns:[a.h.MarketValue,a.h.Weight,a.h.ExpectedReturn,a.h.Dividend,a.h.MarketBeta],maxSelectable:5},{compactMode:!0,defaultSelectedColumns:[a.h.MarketValue,a.h.Weight,a.h.ExpectedReturn,a.h.Dividend,a.h.MarketBeta,a.h.SharpeRatio,a.h.View,a.h.CustomizeInvestment,a.h.Risk],maxSelectable:11}]},82759:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Q});var a=n(57090);n(12115);var r=n(33624),o=n(8675),i=n(62346),l=n(59198),s=n(74547),c=n(92672),d=n(99750),u=n(73751),m=n(92332),p=n(22246),y=n(95221),h=n(8305),f=n(26873);let g=e=>(0,a.Y)(f.Is,{columns:f.NG.Four,className:"mb-4","data-sentry-element":"TitledNumberRow","data-sentry-component":"PortfolioPerformanceStatsView","data-sentry-source-file":"PortfolioPerformanceStats.tsx",children:e.stats.map(e=>(0,a.Y)(f.yh,{label:e.label,value:e.value,tooltip:h.JT[e.label]},e.label))}),v=e=>{let{stats:t,isPerformanceMetricsLoading:n}=(0,p.A)(e.portfolioId);return n?(0,a.Y)(y.A,{active:!0,paragraph:{rows:2,width:"100%"},title:!1}):m.A(t)?(0,a.Y)(g,{stats:t}):null};var x=n(50202),A=n(544),S=n(48298),b=n(99026),C=n(67759),I=n(9271),w=n(61435),P=n(81671),k=n(41784),F=function(e){return e.Csv="csv",e.FullReport="full-report",e}({});let T=[{id:"csv",label:"Spreadsheet (CSV)"},{id:"full-report",label:"Full report (Excel)"}],E=async(e,t)=>{e(),await (0,b.yy)(2e3),(0,b.V3)(t)},Y=e=>{let{portfoliosList:t}=(0,x.RW)(),{isMobile:n}=(0,d.Qs)(),r=(0,A.Fk)(t,e.portfolioId);if(!r)return console.error("Portfolio not found"),null;let o=()=>E(()=>(0,C.trackPortfolioExportClicked)(r),S.Ay.getPortfolioDetailsCsv(e.portfolioId));return e.netWorthReportAvailable?(0,a.Y)(I.A,{label:"Export",variant:"outlined",items:T,onAction:e=>{switch(e){case F.Csv:o();return;case F.FullReport:E(()=>(0,C.trackNetWorthReportExportClicked)(r),S.Ay.getNetWorthDetailsReportUrl((0,b.j$)()));return}},prefix:(0,a.Y)(w.I,{icon:P.$.CloudDownload,size:16}),className:(0,k.cn)(n&&"w-full justify-center"),"data-sentry-element":"DropdownButton","data-sentry-component":"ExportPortfolio","data-sentry-source-file":"ExportPortfolio.tsx"}):(0,a.Y)(e.ViewRenderer,{onClick:o})};
3var D=n(95392),R=n(47120),N=n(19052),M=n(66096),L=n(82187),_=n(40248),O=n(73467);let W=e=>{let{portfolioId:t,fixEnabled:n,onFixCTAClick:o,onFixDoneClick:i}=e,{isLoading:l,isBannerEligible:s,unknownSecurities:c}=(0,O.I)(t),d=r.Bw9(c);if(l||!s||!d)return null;let u=M.pluralize(d,"security","securities"),m=r.fj_(", ",r.TjK(e=>'"'.concat(e,'"'),r.EyX("displayTicker",r.saZ(2,c)))),p="Press the edit icon to add more information to unknown tickers like ".concat(m," below"),y="Fix the ".concat(d," unknown ").concat(u," like ").concat(m," below to get more accurate recommendations.");return n?(0,a.Y)(L.l,{status:"info",variant:"light",title:p,primaryAction:(0,a.Y)(_.A,{variant:"filled",color:"info",onClick:i,children:"Done"})}):(0,a.Y)(L.l,{status:"warning",variant:"light",title:y,primaryAction:(0,a.Y)(_.A,{variant:"filled",color:"warning",onClick:o,children:"Fix"})})},B=e=>{let{portfolioId:t,onFixDoneClick:n}=e,{unknownAssetClassOrUnknownSecurities:o,isLoading:i}=(0,O.h)(t);if(i)return null;let l=r.fj_(", ",r.TjK(e=>'"'.concat(e,'"'),r.EyX("displayTicker",r.saZ(2,o))));return(0,a.Y)(L.l,{status:"info",variant:"light",title:"\n    Press the edit icon to add more information to unknown or missing exposure tickers like ".concat(l," below"),primaryAction:(0,a.Y)(_.A,{variant:"filled",color:"info",onClick:n,children:"Done"}),"data-sentry-element":"Banner","data-sentry-component":"PortfolioUnknownSecuritiesAndAssetClassBanner","data-sentry-source-file":"PortfolioUnknownSecuritiesWarningBanner.tsx"})},U=e=>{let{missingDividendDataTickers:t,onFixDoneClick:n}=e;if(r.Ime(t))return null;let o=r.fj_(", ",r.TjK(e=>'"'.concat(e,'"'),r.saZ(2,t)));return(0,a.Y)(L.l,{status:"info",variant:"light",title:"Press the edit icon to add dividend or income information to holdings like ".concat(o," below"),primaryAction:(0,a.Y)(_.A,{variant:"filled",color:"info",onClick:n,children:"Done"}),"data-sentry-element":"Banner","data-sentry-component":"PortfolioMissingDividendDataBanner","data-sentry-source-file":"PortfolioUnknownSecuritiesWarningBanner.tsx"})},z=e=>e.fixMode===R.C.MissingDividendData?(0,a.Y)(U,{missingDividendDataTickers:e.missingDividendDataTickers,onFixDoneClick:e.onMissingDividendDataDoneClick}):e.fixMode===R.C.UnknownSecuritiesAndAssetClass?(0,a.Y)(B,{portfolioId:e.portfolioId,onFixDoneClick:e.onFixAssetClassDoneClick}):(0,a.Y)(W,{portfolioId:e.portfolioId,fixEnabled:e.fixEnabled,onFixCTAClick:e.onFixSecuritiesCTAClick,onFixDoneClick:e.onFixSecuritiesDoneClick,"data-sentry-element":"PortfolioUnknownSecuritiesWarningBanner","data-sentry-component":"DetailsFixModeBanner","data-sentry-source-file":"DetailsFixModeBanner.tsx"});var V=n(22462);let j=[];var H=n(60192),q=n(31695),G=n(47364);let K=[],Q=e=>{let{showUpdateNetWorthButton:t,showUpdateGroupButton:n,showExportButton:m=!0,netWorthReportAvailable:p=!1,hidePortfolioName:y=!1,showEditTransactions:h=!1,onEditTransactions:f,portfolio:g}=e,{portfolioId:x}=e.portfolio,{openGroupsPage:A,openTransactionsPage:S}=(0,q.E)(),{fixEnabled:b,setFixEnabled:C,fixMode:I,setFixMode:w}=(()=>{let{searchParams:e,setSearchParams:t}=(0,G.o)(["fixEnabled","fixMode"]),n="true"===e.fixEnabled;return{fixEnabled:n,setFixEnabled:e=>{t({fixEnabled:e.toString()})},fixMode:e.fixMode||R.C.OnlyUnknownSecurities,setFixMode:e=>{t({fixMode:e})}}})(),{data:k=K,isFetching:F,isError:T,error:E}=(0,i.uv)(x),{data:M=[],isFetching:L,isError:_,error:W}=(0,i.L)(x),{unknownSecurities:B,isComputed:U}=(0,O.I)(x),{unknownAssetClassOrUnknownSecurities:Q,isComputed:$}=(0,O.h)(x),X=I===R.C.MissingDividendData,{missingDividendDataTickers:J,isComputed:Z}=((e,t)=>{let{data:n,isFetching:a,isSuccess:r}=(0,i.Ly)(e,{enableQuery:t});return{missingDividendDataTickers:V.A(n)?n.coverage.noDataTickers:j,isLoading:a,isComputed:r}})(x,X),{launchUpsertByPortfolioId:ee}=(0,H.k)(),{isMobile:et}=(0,d.Qs)();(0,D.A)(T,E,"Error in loading Portfolio Details."),(0,D.A)(_,W,"Error in loading Portfolio Tax Details."),b&&U&&r.Ime(B)&&C(!1);let en=r.vUk([],k),ea=(0,N.br)({portfolioDetailItems:en,unknownSecurities:B,unknownAssetClassOrUnknownSecurities:Q,missingDividendDataTickers:J,filterToMissingDividendData:X&&Z,excludeReservedItems:!!e.excludeReservedItems,excludeBrokerageCash:!1,fixEnabled:b,fixMode:I}),er=()=>{w(R.C.OnlyUnknownSecurities)},eo=()=>{w(R.C.OnlyUnknownSecurities)};I===R.C.UnknownSecuritiesAndAssetClass&&$&&r.Ime(Q)&&er(),X&&Z&&r.Ime(J)&&eo();let ei=async()=>{ee(x),await A()},el=async()=>{await S({portfolioIds:[x]}),f&&f()},es=b||I===R.C.UnknownSecuritiesAndAssetClass||X;return(0,a.FD)(o.wE,{"data-sentry-element":"PortfolioDetailsContainer","data-sentry-component":"PortfolioDetails","data-sentry-source-file":"PortfolioDetails.tsx",children:[(0,a.FD)(c.Ah,{justifyContent:y?"flex-end":"space-between",alignItems:et?"flex-start":"center",alignContent:"flex-start",marginBottom:16,flexDirection:et?"column":"row",itemsSpacingVertical:8,"data-sentry-element":"FlexLayout","data-sentry-source-file":"PortfolioDetails.tsx",children:[y?null:(0,a.Y)(o.nQ,{children:g.portfolioName}),(0,a.FD)(c.Ah,{itemsSpacingHorizontal:8,itemsSpacingVertical:8,flexDirection:et?"column":"row",occupyParentWidth:et,alignItems:"stretch","data-sentry-element":"FlexLayout","data-sentry-source-file":"PortfolioDetails.tsx",children:[t?(0,a.Y)(u.A,{portfolio:g}):null,n?(0,a.Y)(s.$n,{onClick:ei,variant:"outlined",fullWidth:et,prefix:(0,a.Y)(s.In,{icon:P.$.Pencil}),children:"Update Group"}):null,h?(0,a.Y)(s.$n,{onClick:el,variant:"outlined",fullWidth:et,prefix:(0,a.Y)(s.In,{icon:P.$.Pencil}),children:"Edit transactions"}):null,m?(0,a.Y)(Y,{portfolioId:x,netWorthReportAvailable:p,ViewRenderer:e=>{let{onClick:t}=e;return(0,a.Y)(s.$n,{fullWidth:et,onClick:t,children:"Export as spreadsheet"})}}):null]})]}),(0,a.Y)(v,{portfolioId:x,"data-sentry-element":"PortfolioPerformanceStats","data-sentry-source-file":"PortfolioDetails.tsx"}),(0,a.Y)("div",{className:"[&:not(:empty)]:mb-4",children:(0,a.Y)(z,{portfolioId:x,fixMode:I,fixEnabled:b,missingDividendDataTickers:J,onFixSecuritiesCTAClick:()=>{C(!0)},onFixSecuritiesDoneClick:()=>{C(!1)},onFixAssetClassDoneClick:er,onMissingDividendDataDoneClick:eo,"data-sentry-element":"DetailsFixMo
3deBanner","data-sentry-source-file":"PortfolioDetails.tsx"})}),(0,a.Y)(l.A,{portfolio:g,data:ea,emptyText:"Your portfolio is empty. Tap the Edit icon to add investments to your portfolio",isLoadingInBackground:F,taxDetails:M,isTaxDetailsLoading:L,showCustomizeSecurityOption:!0,detailsTableInFixMode:es,compactTableConfigArray:e.compactTableConfigArray,"data-sentry-element":"DetailsTable","data-sentry-source-file":"PortfolioDetails.tsx"})]})}},82949:(e,t,n)=>{n.d(t,{JX:()=>h,Lb:()=>p,M_:()=>y,Od:()=>m,z3:()=>u});var a=n(67818),r=n(33624),o=n(62219),i=n(67891),l=n(16528),s=n(22462),c=n(31585),d=n(44561);let u=e=>{if(r.gD_(e));else{if((e=>o.A(e)&&i.A(e.proxyTicker))(e))return a.x.Proxy;(e=>s.A(e)&&c.A(e.proxyTicker)&&(e=>{let t=r.cJW(["proxyTicker"],e);return o.A(e)&&r.bzn(l.A,r.zug(t))})(e))(e)}return a.x.Custom},m=e=>r.w1_(d.hE,e),p=r.Tkb(m,r.D_O,r.xWs(d.hE)),y=e=>r.HCR(d.hE,"",e),h=e=>r.Ime(y(e))},83314:(e,t,n)=>{n.d(t,{AY:()=>o,DN:()=>l,Vi:()=>s,Xq:()=>a,i_:()=>r});var a=function(e){return e.PortfolioAssessment="portfolio_assessment",e.PortfolioScore="portfolio_score",e.RetirementReadiness="retirement_readiness",e.VideoWalkthroughs="video_walkthroughs",e.TopActions="top_actions",e.ImportAccount="import_account",e}({}),r=function(e){return e.AssessmentSeen="assessment_seen",e.AccountConnected="account_connected",e}({}),o=function(e){return e.PortfolioAssessmentOpened="portfolio_assessment_opened",e.PortfolioScoreViewed="portfolio_score_viewed",e.RetirementUpdated="retirement_updated",e.WalkthroughViewed="walkthrough_viewed",e.TopActionsViewed="top_actions_viewed",e.AccountImportOpened="account_import_opened",e}({});let i="{month}",l=[{id:"portfolio_assessment",title:"Check your portfolio assessment",description:"Get an auto-generated report that pinpoints your portfolio's problem areas and suggests improvements.",ctaLabel:"See portfolio assessment",completion:{onCtaClick:!1,autoCompleteSignal:"assessment_seen",event:"portfolio_assessment_opened"}},{id:"portfolio_score",title:"Check Portfolio Score",description:"Portfolio Score scans your portfolio from three angles and turns it into one easy-to-track grade.",ctaLabel:"See score",completion:{onCtaClick:!0,event:"portfolio_score_viewed"}},{id:"retirement_readiness",title:"Update retirement readiness",description:"Test multiple futures in minutes. Change earnings, life milestones, and more to see whether your retirement plan stays on track.",ctaLabel:"Plan retirement",completion:{onCtaClick:!1,event:"retirement_updated"}},{id:"video_walkthroughs",title:"Watch video walkthroughs",description:"Get the most out of PortfolioPilot with our video walkthroughs: step-by-step guides, feature overviews, and expert tips on our YouTube channel.",ctaLabel:"Check it out",completion:{onCtaClick:!0,event:"walkthrough_viewed"}},{id:"top_actions",title:"Check your top actions for ".concat(i),description:"We've picked your 3 highest-impact suggestions for the month.",ctaLabel:"View suggestions",completion:{onCtaClick:!0,event:"top_actions_viewed"}},{id:"import_account",title:"Import one account",description:"Import an account to get recommendations based on your real finances. Link account, upload a statement, copy/paste, or enter manually.",ctaLabel:"Add account",completion:{onCtaClick:!1,autoCompleteSignal:"account_connected",event:"account_import_opened"}}],s=(e,t)=>e.title.replace(i,t)},83562:(e,t,n)=>{n.d(t,{AT:()=>u,SI:()=>A,XD:()=>m,Yd:()=>g,dK:()=>x,mH:()=>h,po:()=>v,sI:()=>p});var a=n(57090);n(12115);var r=n(62570),o=n(74547),i=n(92672),l=n(36934),s=n(41784),c=n(23462),d=n(81671);let u=(0,r.A)(o.fv,{target:"e4qr89v0"})("cursor:pointer;display:flex;flex-direction:row;align-items:center;border:",e=>e.selected?"0.75px solid ".concat(e.theme.colors.blue600):"0.75px solid ".concat(e.theme.colors.neutral200),";box-sizing:border-box;border-radius:var(--card-border-radius,8px);min-width:24%;justify-content:",e=>e.isMobilePortrait||e.compactMode?"center":"flex-start",";",(0,i.BK)({padding:["4px"],marginRight:["0","8px","8px"]}),";"),m=(0,r.A)(i.Ah,{target:"e4qr89v1"})("cursor:pointer;width:100%;"),p=(0,r.A)("img",{target:"e4qr89v2"})("background-color:",e=>e.backgroundColor,";width:",e=>e.width?e.width:(0,i.BK)({width:["24px"]}),";height:",e=>e.height?e.height:(0,i.BK)({height:["24px"]}),";left:16px;top:12px;border-radius:40px;"),y=e=>(0,c.AH)("white-space:",e?"pre-wrap":"nowrap",";overflow:hidden;text-overflow:ellipsis;line-height:normal;"),h=(0,r.A)("div",{target:"e4qr89v3"})(e=>y(e.wrapText),";"),f=e=>{let{className:t,...n}=e;return(0,a.Y)(l.km,{className:(0,s.cn)("text-neutral-500",t),...n,"data-sentry-element":"Body2W400","data-sentry-component":"Body2W400Neutral500","data-sentry-source-file":"atoms.tsx"})},g=(0,r.A)(f,{target:"e4qr89v4"})(e=>y(e.wrapText),";"),v=(0,r.A)(f,{target:"e4qr89v5"})("text-align:right;",(0,i.BK)({fontSize:["12px","14px"],lineHeight:["16px"]}),";"),x=e=>{let{className:t}=e;return(0,a.Y)(o.In,{icon:d.$.CirclePlus,className:"cursor-pointer ".concat(t),"data-sentry-element":"Icon","data-sentry-component":"AddAccountsIcon","data-sentry-source-file":"atoms.tsx"})},A=e=>(0,a.Y)(o.$n,{...e,"data-sentry-element":"Button","data-sentry-component":"AddAssetButton","data-sentry-source-file":"atoms.tsx"})},83897:(e,t,n)=>{n.d(t,{A:()=>h});var a=n(57090);n(12115);var r=n(35208),o=n(92657);let i=()=>(0,a.Y)("svg",{width:"24",height:"14",viewBox:"0 0 24 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-sentry-element":"svg","data-sentry-component":"DoubleTickIcon","data-sentry-source-file":"DoubleTickIcon.tsx",children:(0,a.Y)("path",{d:"M17.6291 1.70492L16.2191 0.294922L9.87906 6.63492L11.2891 8.04492L17.6291 1.70492ZM21.8691 0.294922L11.2891 10.8749L7.10906 6.70492L5.69906 8.11492L11.2891 13.7049L23.2891 1.70492L21.8691 0.294922ZM0.0390625 8.11492L5.62906 13.7049L7.03906 12.2949L1.45906 6.70492L0.0390625 8.11492Z",fill:"var(--color-blue-700)","data-sentry-element":"path","data-sentry-source-file":"DoubleTickIcon.tsx"})});var l=n(70432),s=n(54519),c=n(92672),d=n(68446);let u=n.p+"static/media/plaid.ba8b68761b08554a.svg",m=n.p+"static/media/snaptrade.9c1e8465ce9d877d.svg",p=n.p+"static/media/yodlee.c19e76b4446e2cf7.svg",y=n.p+"static/media/lock.7d35562146781791.svg",h=e=>(0,a.FD)(c.Vs,{flipAt:"md",itemsSpacingHorizontal:24,itemsSpacingVertical:24,occupyParentWidth:!0,equalWidthItems:!0,boxSizing:"border-box",justifyContent:"space-between",alignItems:"stretch",alignSelf:"stretch",padding:e.padding,"data-sentry-element":"FlexFlipOnScreenSize","data-sentry-component":"ConnectionPartnersInformation","data-sentry-source-file":"ConnectionPartnersInformation.tsx",children:[(0,a.FD)(o.iQ,{"data-sentry-element":"FooterItemContainer","data-sentry-source-file":"ConnectionPartnersInformation.tsx",children:[(0,a.FD)(o.Ce,{"data-sentry-element":"PartnerContainer","data-sentry-source-file":"ConnectionPartnersInformation.tsx",children:[(0,a.Y)(o.Cf,{src:(0,d.s)(u),"data-sentry-element":"PartnerImage","data-sentry-source-file":"ConnectionPartnersInformation.tsx"}),(0,a.Y)(o.Cf,{src:(0,d.s)(m),"data-sentry-element":"PartnerImage","data-sentry-source-file":"ConnectionPartnersInformation.tsx"}),(0,a.Y)(o.Cf,{src:(0,d.s)(p),"data-sentry-element":"PartnerImage","data-sentry-source-file":"ConnectionPartnersInformation.tsx"})]}),(0,a.Y)(o.wj,{"data-sentry-element":"FooterDescription","data-sentry-source-file":"ConnectionPartnersInformation.tsx",children:(0,a.FD)("span",{children:["We partnered with industry leaders"," ",(0,a.Y)(o.gH,{href:r.yM,target:"blank","data-sentry-element":"InlineLink","data-sentry-source-file":"ConnectionPartnersInformation.tsx",children:"Plaid"}),", ",(0,a.Y)(o.gH,{href:r.op,target:"blank","data-sentry-element":"InlineLink","data-sentry-source-file":"ConnectionPartnersInformation.tsx",children:"SnapTrade"})," ","and"," ",(0,a.Y)(o.gH,{href:r.co,target:"blank","data-sentry-element":"InlineLink","data-sentry-source-file":"ConnectionPartnersInformation.tsx",children:"Yodlee"})," ","to connect you to your financial institutions."]})})]}),(0,a.FD)(o.iQ,{"data-sentry-element":"FooterItemContainer","data-sentry-source-file":"ConnectionPartnersInformation.tsx",children:[(0,a.Y)(o.In,{icon:y,"data-sentry-element":"Icon","data-sentry-source-file":"ConnectionPartnersInformation.tsx"}),(0,a.Y)(o.W_,{"data-sentry-element":"FooterHead","data-sentry-source-file":"ConnectionPartnersInformation.tsx",children:"Bank-level security"}),(0,a.FD)(o.wj,{"data-sentry-element":"FooterDescription","data-sentry-source-file":"ConnectionPartnersInformation.tsx",children:["We use 256-bit encryption across our entire system."," ",(0,a.Y)(l.A,{href:s.Ay.security,openInNewTab:!0,"data-sentry-element":"Link","data-sentry-source-file":"ConnectionPartnersInformation.tsx",children:"Read more"})," ","about our bank-level security."]})]}),(0,a.FD)(o.iQ,{"data-sentry-element":"FooterItemContainer","data-sentry-source-file":"ConnectionPartnersInformation.tsx",children:[(0,a.Y)(i,{"data-sentry-element":"DoubleTickIcon","data-sentry-source-file":"ConnectionPartnersInformation.tsx"}),(0,a.Y)(o.W_,{"data-sentry-element":"FooterHead","data-sentry-source-file":"ConnectionPartnersInformation.tsx",children:"Used by millions"}),(0,a.Y)(o.wj,{"data-sentry-element":"FooterDescription","data-sentry-source-file":"ConnectionPartnersInformation.tsx",children:"Our partners support 
312,000+ financial institutions and have connected to 200+ million accounts."})]})]})},84461:(e,t,n)=>{n.d(t,{A:()=>m,c:()=>u});var a=n(57090),r=n(12115),o=n(99026),i=n(43948),l=n(14365),s=n(84978);let{useGlobalNetworthAssetsImporterLaunchEventListener:c,emitGlobalNetworthAssetsImporterLaunchEvent:d}=(0,i.createEvent)("GlobalNetworthAssetsImporterLaunchEvent")(),u=()=>({launchNetworthAssetsImporter:async e=>{d({onClose:e||o.lQ})},launchSecuritiesNetworthAssetImporter:async e=>{d({onClose:e||o.lQ,exclusiveAssetType:s.q8.TotalSecurities})},launchCashNetworthAssetImporter:async e=>{d({onClose:e||o.lQ,exclusiveAssetType:s.q8.TotalCash})},launchNetworthAssetImporterForType:async(e,t)=>{d({onClose:t||o.lQ,exclusiveAssetType:e})}}),m=()=>{let[e,t]=r.useState(null),n=r.useRef(o.lQ);return c(e=>{let{onClose:a,...r}=e;t(r),n.current=a||o.lQ}),e?(0,a.Y)(l._,{...e,open:!0,onClose:()=>{t(null),n.current()},"data-sentry-element":"NetworthAssetImporter","data-sentry-component":"GlobalNetworthAssetsImporterLauncher","data-sentry-source-file":"GlobalNetworthAssetsImporterLauncher.tsx"}):null}},85013:(e,t,n)=>{n.d(t,{HE:()=>r,JY:()=>o,sr:()=>a});let a="relative [&_[role=button]]:relative [&_[role=button]]:z-[1]",r="focus:outline-none after:absolute after:inset-0 after:content-['']",o="has-[a:focus-visible]:ring-2 has-[a:focus-visible]:ring-[var(--wp-focus-ring)] has-[a:focus-visible]:ring-offset-2 has-[button:focus-visible]:ring-2 has-[button:focus-visible]:ring-[var(--wp-focus-ring)] has-[button:focus-visible]:ring-offset-2"},85180:(e,t,n)=>{n.d(t,{A:()=>x});var a=n(57090),r=n(12115),o=n(62570),i=n(74547),l=n(68446);let s=(0,o.A)("div",{target:"e1p2wbsj0"})("background-image:",e=>"url('".concat((0,l.s)(e.img),"')"),";height:460px;width:100%;border:var(--wp-border-width) solid var(--wp-card-border);border-radius:var(--wp-radius-default);background-repeat:no-repeat;background-size:100% 100%;background-position:center;display:flex;justify-content:center;flex-direction:column;"),c=(0,o.A)(i.Ah,{target:"e1p2wbsj1"})("display:flex;justify-content:center;align-items:center;flex-direction:column;width:100%;height:100%;flex-wrap:nowrap;");var d=n(69126),u=n(36934),m=n(92672),p=n(87764),y=n(28283),h=n(99750),f=n(54089);let g=e=>{let{accessConfig:t,disabledBackgroundImage:n,disabledBackgroundImageMobile:r,containerStyle:o,containerStyleMobile:i,cta:l,onlyShowBlurredImage:g}=e,{name:v,minAccessSubscription:x}=t,{getPlanConfigFromMinimumSubscription:A}=(0,p.A)(),S=A(x),b=(0,h.tb)([r,r,n]),C=b?(0,d.sW)(b):null,{isBelow576:I}=(0,h.uF)(),w=I?{...o,...i}:o;return(0,a.Y)(m.Ah,{width:"100%","data-sentry-element":"FlexLayout","data-sentry-component":"FeatureNotAccessible","data-sentry-source-file":"FeatureNotAccessible.tsx",children:(0,a.Y)(s,{img:C,style:w,"data-sentry-element":"MemberSubscriptionInviteContainer","data-sentry-source-file":"FeatureNotAccessible.tsx",children:!0===g?null:(0,a.FD)(c,{itemsSpacingVertical:24,children:[(0,y.ye)(S.subscriptionPlan,!1,!0),(0,a.FD)(m.Ah,{flexDirection:"column",textAlign:"center",itemsSpacingVertical:0,children:[(0,a.Y)(u.RF,{className:"text-body",children:v}),l]}),(0,a.Y)(f.A,{accessConfig:e.accessConfig}),e.additionalActionsNode?e.additionalActionsNode:null]})})})};var v=n(73496);let x=e=>{let{Component:t,featureName:n,disabledBackgroundImage:o,disabledBackgroundImageMobile:i,containerStyle:l,containerStyleMobile:s,hideFeatureNotAccessible:c=!1,onlyShowBlurredImage:d=!1,cta:u,additionalActionsNode:m,customFeatureNotAccessible:p}=e;return e=>{let{isFeatureAccessible:y,featureAccessConfig:h}=(0,v.R)(n);return y?(0,a.Y)(t,{...e}):p?(0,a.Y)(r.Fragment,{children:p}):c?null:h?(0,a.Y)(g,{accessConfig:h,disabledBackgroundImage:o,disabledBackgroundImageMobile:i,containerStyle:l,containerStyleMobile:s,cta:u,onlyShowBlurredImage:d,additionalActionsNode:m}):null}}},85335:(e,t,n)=>{n.d(t,{Cs:()=>c,IF:()=>m,hx:()=>d,jw:()=>p,lL:()=>s,m$:()=>u,p:()=>l});var a=n(57090);n(12115);var r=n(92672),o=n(59420),i=n(41784);let l=e=>{let{className:t,...n}=e;return(0,a.Y)("div",{className:(0,i.cn)("inline-flex items-center mx-4",t),...n,"data-sentry-component":"ArrowContainer","data-sentry-source-file":"scoreImpactAtoms.tsx"})},s=e=>{let{className:t,style:n,...r}=e;return(0,a.Y)(o.A,{...r,className:(0,i.cn)("text-3xl font-semibold",t),style:{fontStyle:"normal",textAlign:"center",width:"initial",...n},"data-sentry-element":"PortfolioScoreHolder","data-sentry-component":"ColoredPortfolioScore","data-sentry-source-file":"scoreImpactAtoms.tsx"})},c=e=>{let{className:t,...n}=e;return(0,a.Y)("div",{className:(0,i.cn)("text-center",t),...n,"data-sentry-component":"MainScoreSectionContainer","data-sentry-source-file":"scoreImpactAtoms.tsx"})},d=e=>{let{className:t,...n}=e;return(0,a.Y)("div",{className:(0,i.cn)("text-sm text-body",t),...n,"data-sentry-component":"PortfolioLabel","data-sentry-source-file":"scoreImpactAtoms.tsx"})},u=r.Ah,m=e=>{let{className:t,...n}=e;return(0,a.Y)("div",{className:(0,i.cn)("flex items-center",t),...n,"data-sentry-component":"MainScoreImpactRow","data-sentry-source-file":"scoreImpactAtoms.tsx"})}
3,p=e=>{let{className:t,style:n,...o}=e;return(0,a.Y)(r.Ah,{...o,className:t,style:{display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",padding:"16px 20px 16px 0",...n},"data-sentry-element":"FlexLayout","data-sentry-component":"SubScoresImpactContainer","data-sentry-source-file":"scoreImpactAtoms.tsx"})}},85365:(e,t,n)=>{e.exports=n.p+"static/media/ob_optimize_taxes.a2ab89bcbea65b86.svg"},85505:(e,t,n)=>{n.d(t,{A:()=>y});var a=n(57090);n(12115);var r=n(33624),o=n(38249),i=n(13340),l=n(99026),s=n(31260),c=n(86216),d=n(97765),u=n(74547),m=n(41784),p=n(6558);let y=e=>{let{loading:t}=e,{preferredCurrency:n}=(0,s.yf)(),{preferredCurrencySymbol:y}=(0,d._)(),h=e.value?(0,l.Yw)(c.A.convert(i.mF,n,(0,l.YZ)(e.value)),(0,p.mK)((0,l.YZ)(e.value))):e.value,f=void 0!==e.maxValue?c.A.convert(i.mF,n,e.maxValue):void 0;return(0,a.Y)(o.A,{...e,className:(0,m.cn)("currency-affix-darker",e.className),max:f,value:h,onChange:t=>{let a=c.A.convert(n,i.mF,(0,l.YZ)(t));if(e.onChange)return e.onChange(a)},humanizeNumber:r.vUk(!0,e.humanizeNumber),addonBefore:t?(0,a.Y)(u.y$,{size:"sm",iconOnly:!0}):y,"data-sentry-element":"InputNumber","data-sentry-component":"CurrencyInput","data-sentry-source-file":"CurrencyInput.tsx"})}},85543:(e,t,n)=>{n.d(t,{Df:()=>d,EY:()=>f,F3:()=>F,Ft:()=>h,HC:()=>p,Im:()=>u,Ji:()=>_,Kb:()=>N,Kh:()=>C,Lh:()=>b,Qf:()=>R,Qr:()=>v,SG:()=>x,SH:()=>g,Y8:()=>S,Yv:()=>I,eg:()=>y,fQ:()=>k,gK:()=>L,in:()=>w,oI:()=>T,sW:()=>Y,vZ:()=>P,wB:()=>M,wx:()=>m});var a=n(33624),r=n(22462),o=n(67891),i=n(67297),l=n(84978),s=n(13340),c=n(34857);let d=(e,t)=>a.vUk(void 0,a.zyy(t,e)?e[t]:void 0),u=e=>a.pbD(e=>a.mKk(e.investmentType,l.X_),e),m=e=>{let t=[...l.G2,...l.bD];return a.pbD(e=>a.mKk(e.investmentType,t),e)},p=e=>a.pbD(e=>e.investmentType===l.q8.CashNonInvestable,e),y=e=>a.pbD(e=>e.investmentType===l.q8.CashInvestable,e),h=e=>a.pbD(e=>(0,c.FU)(e.investmentType),e),f=e=>a.pbD(e=>e.investmentType===l.q8.RealEstate,e),g=e=>a.pbD(e=>e.investmentType===l.q8.TotalRealEstateHoldings,e),v=e=>a.pbD(e=>e.investmentType===l.q8.Securities,e),x=e=>{let t,n=f(e),r=(t=a.pbD(e=>e.investmentType===l.q8.RealEstateMortgage,e),a.wQP(a.UpL(a.QOB(["additionalDetail","netWorthItemId"])),t));return a.TjK(e=>({...e,mortgageDetail:a.vUk(null,r[e.netWorthItemId])}),n)},A=e=>null===e.updatedAt?0:new Date(e.updatedAt).getTime(),S=e=>r.A(a._w2("netWorthItemId",e)),b=e=>a.gD_(a._w2("netWorthItemId",e)),C=e=>{var t;let n=a.HVh(a.Va7([a.jk0(A),a.jk0(a._w2("netWorthItemId"))],e));return null!=(t=null==n?void 0:n.valueUpdateMode)?t:l.hJ.UpdateWithMarket},I=(e,t)=>({netWorthItemId:null,investmentValue:0,currentInvestmentValue:0,investmentType:l.q8.RealEstate,additionalDetail:{propertyLocation:l._H.UnitedStates,propertyType:null,state:null,code:null,nickname:"",rentalProperty:!1,monthlyRentalIncome:null,entryMode:l.AB.Live,streetAddress:null,providerPropertyId:null},currency:e,valueUpdateMode:t}),w=(e,t)=>({netWorthItemId:null,investmentValue:0,currentInvestmentValue:0,investmentType:l.q8.RealEstateMortgage,additionalDetail:{netWorthItemId:t,interestRate:null}
3,currency:e,valueUpdateMode:l.hJ.UpdateWithMarket}),P=(e,t)=>{let{defaultCurrency:n}=t,{propertyLocation:a}=e.additionalDetail||{};return a===l._H.UnitedStates?s.Sj.USD:a===l._H.Canada?s.Sj.CAD:n},k=7,F=new Date().getFullYear()+7,T=function(e,t){var n,a,r,o,s;let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.X_[0],d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",u=i.bJ[c];return{netWorthItemId:null,investmentValue:0,currentInvestmentValue:0,investmentType:c,additionalDetail:{name:d,expectedYearlyIncome:null,amountInvested:null,investmentYear:null,distributionTimeline:k,expectedIpoYear:F,managementFee:null,carry:null,percentageVested:null,strikePrice:null,numberOfShares:null,ownershipStake:null,customTypeName:null,country:null!=(n=null==u?void 0:u.country)?n:null,assetClass:null!=(a=null==u?void 0:u.assetClass)?a:null,sectorOrBondType:null!=(r=null==u?void 0:u.sectorOrBondType)?r:null,oneYearExpectedReturn:null!=(o=null==u?void 0:u.oneYearExpectedReturn)?o:null,risk:null!=(s=null==u?void 0:u.risk)?s:null},currency:e,valueUpdateMode:t}},E=e=>({name:e,oneYearExpectedReturn:null,risk:null,country:null,sector:null,assetClass:null,originalInvestmentAmount:0}),Y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return{netWorthItemId:null,investmentValue:0,currentInvestmentValue:0,investmentType:l.G2[0],additionalDetail:E(t),currency:e,valueUpdateMode:l.hJ.Upd
3ateWithMarket}},D=(e,t,n)=>({name:t,netPresentValue:null,monthlyPayout:0,paidAs:l.v0.Monthly,startAge:n,endMode:l.rT.Life,endAge:null,lumpSumAmount:null,inflationAdjusted:(0,l.QF)(e),survivorShare:l.eN.NoSurvivor,taxTreatment:l.Ae.Ordinary}),R=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.bD[0],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{netWorthItemId:null,investmentValue:0,currentInvestmentValue:0,investmentType:t,additionalDetail:D(t,n,a),currency:e,valueUpdateMode:l.hJ.UpdateWithMarket}},N=(e,t,n,a)=>{let r=(0,c.An)(e),o=(0,c.An)(t),i=n&&"name"in n?n.name:"";return r&&o?{...n,inflationAdjusted:(0,l.QF)(e)}:r?D(e,null!=i?i:"",a):o?E(null!=i?i:""):n},M=e=>{let t=S(e),n=(e,n)=>t&&o.A(e)?e:n,r=(()=>{let t="property",r="private equity",o="other asset",i="pension/annuity",l=a.vUk({},e.additionalDetail);return(0,c.yK)(e.investmentType)?"nickname"in l?n(null==l?void 0:l.nickname,t):t:(0,c.iV)(e.investmentType)?"name"in l?n(null==l?void 0:l.name,r):r:(0,c.An)(e.investmentType)?"name"in l?n(null==l?void 0:l.name,i):i:(0,c.U$)(e.investmentType)?"name"in l?n(null==l?void 0:l.name,o):o:"net worth item"})();return{title:"".concat(t?"Edit":"Add"," ").concat(r),submitLabel:t?"Save":"Add"}},L=(e,t)=>a.I6j(e=>e.additionalDetail.cashPortfolioId===t.cashPortfolioId,e),_=(e,t)=>a.I6j(e=>e.investmentType===l.q8.TotalRealEstateHoldings&&e.netWorthItemId===t,e)},85731:(e,t,n)=>{n.d(t,{x:()=>c});var a=n(33624),r=n(67891),o=n(73321),i=n(73285),l=n(54519),s=n(99026);let c=()=>{let e=(0,i.w)(),t=(0,o.useParams)(),n=null==t?void 0:t.slug,[c,d]=Array.isArray(n)?n:[],u=a.sfR({country:a.z7s(r.A,a.s5T),conceptType:a.z7s(r.A,e=>(0,s.F8)(e))})({country:c,conceptType:d}),m=async t=>{let n={...u,...t},a=(0,l.n2)(n);await e.push(a)};return{macroExplorerQueryParams:u,setMacroExplorerQueryParams:m}}},85780:(e,t,n)=>{n.d(t,{EA:()=>p,Fl:()=>y,J$:()=>u,PW:()=>r,_C:()=>m,dF:()=>l,kv:()=>d,tf:()=>c,uH:()=>s,v7:()=>o,yH:()=>i});var a=n(75075);let r="cashPortfolioId",o="name",i="apy",l="cashValue",s="isInvestable",c="isActive",d="accountType",u=1e9,m=[{label:"Checking account",value:a.z.CheckingAccount},{label:"Savings account",value:a.z.SavingAccount},{label:"Money market account",value:a.z.MoneyMarketAccount},{label:"Loan account",value:a.z.LoanAccount},{label:"Mortgage account",value:a.z.MortgageAccount},{label:"Credit card account",value:a.z.CreditCardAccount},{label:"Other cash account",value:a.z.OtherCashAccount}],p=[{label:"Cash (Investable)",value:!0},{label:"Cash (Non-investable)",value:!1}],y="Cash (Investable) is all cash you feel comfortable investing. Cash (Non-investable) is all cash that you don't want to invest such as emergency funds, etc."},85794:(e,t,n)=>{n.d(t,{AL:()=>S,Cz:()=>k,FB:()=>A,Fy:()=>g,G0:()=>h,Ge:()=>f,K7:()=>x,Qe:()=>w,Zh:()=>C,aG:()=>I,cd:()=>P,d:()=>v,rA:()=>b,w8:()=>F});var a=n(57090),r=n(62570),o=n(74547),i=n(12667),l=n(35209),s=n(92672),c=n(23462),d=n(50343);n(12115);var u=n(36934),m=n(41784),p=n(99750),y=n(87216);let h=(0,r.A)(i.y,{target:"e1iwp5yt0"})("width:110px;"),f=(0,r.A)("div",{target:"e1iwp5yt1"})("min-width:120px;flex-basis:49%;"),g=(0,r.A)(i.y,{target:"e1iwp5yt2"})("width:100%;"),v=(0,r.A)(d.J$,{target:"e1iwp5yt3"})(e=>e.isInvalid?(0,c.AH)("border:1px solid ",e.theme.colors.danger,";"):"",":hover{border-color:",e=>e.isInvalid&&e.theme.colors.danger,";}"),x=(0,r.A)(o.aF,{target:"e1iwp5yt4"})(".ant-modal-title{font-size:20px;}"),A=(0,r.A)(l.A,{target:"e1iwp5yt5"})("width:100%;"),S=(0,r.A)(l.A,{target:"e1iwp5yt6"})("width:100%;"),b=(0,r.A)(g,{target:"e1iwp5yt7"})((0,s.BK)({width:["100%"]})),C=(0,r.A)(l.A,{target:"e1iwp5yt8"})("min-width:120px;",(0,s.BK)({width:["100%"]})),I=(0,r.A)(g,{target:"e1iwp5yt9"})(),w=(0,r.A)(y.A,{target:"e1iwp5yt10"})(),P=(0,r.A)(e=>(0,a.Y)(u.km,{...e,className:(0,m.cn)("text-neutral-500",e.className),"data-sentry-element":"Body2W400","data-sentry-component":"Body2W400BoundNeutral500","data-sentry-source-file":"atoms.tsx"}),{target:"e1iwp5yt11"})("color:",e=>e.theme.colors.neutral500,";"),k=e=>(0,a.Y)(P,{"data-sentry-element":"NetworthItemSecondaryText","data-sentry-component":"NetworthItemSecondary
3DetailsContainer","data-sentry-source-file":"atoms.tsx",children:(0,a.Y)(s.Ah,{flexDirection:"row",itemsSpacingHorizontal:12,justifyContent:"flex-start","data-sentry-element":"FlexLayout","data-sentry-source-file":"atoms.tsx",children:e.children})}),F=e=>{let{isBelow576:t}=(0,p.uF)();return(0,a.Y)(s.Ah,{justifyContent:"flex-start",itemsSpacingHorizontal:12*!t,itemsSpacingVertical:12*!!t,"data-sentry-element":"FlexLayout","data-sentry-component":"NetworthItemMainContentContainer","data-sentry-source-file":"atoms.tsx",children:e.children})}},86136:(e,t,n)=>{n.d(t,{Au:()=>m,Jv:()=>d,dQ:()=>y,gs:()=>c,hb:()=>h,lS:()=>p});var a=n(10833),r=n(55805),o=n(73070),i=n(17667),l=n(84245),s=n(9974);let c=()=>(0,a.I)({queryKey:o.ub.SavedScenarios,queryFn:()=>r.YN.getAllSavedScenarios(),...l.gz}),d=e=>(0,a.I)({queryKey:[...o.ub.SavedScenarios,e],queryFn:()=>r.YN.getSavedScenario(e),...l.gz,enabled:(0,s.KH)(e)}),u=()=>{let e=(0,a.j)();return()=>{e.invalidateQueries(o.ub.SavedScenarios)}},m=()=>{let e=u();return(0,i.A)(e=>r.YN.createDraftScenario(e),{onSuccess:e})},p=()=>{let e=u();return(0,i.A)(e=>r.YN.commitDraftScenario(e),{onSuccess:e,onSuccessMessage:()=>"Scenario saved successfully"})},y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=u();return(0,i.A)(e=>r.YN.updateSavedScenario(e),{onSuccess:t,onSuccessMessage:()=>!1===e.showSuccessMessage?null:"Scenario updated successfully"})},h=()=>{let e=(0,a.j)();return(0,i.A)(e=>r.YN.deleteSavedScenario(e),{onSuccess:(t,n)=>{e.invalidateQueries([...o.ub.SavedScenarios,n],{refetchActive:!1}),e.invalidateQueries(o.ub.SavedScenarios,{exact:!0})},onSuccessMessage:()=>"Scenario deleted successfully"})}},87351:(e,t,n)=>{n.d(t,{A:()=>h});var a=n(57090);n(12115);var r=n(74547),o=n(36934),i=n(41784),l=n(47640),s=n(11325),c=n(13340),d=n(51852),u=n(81671);let m=e=>{let{previousReturn:t,optimizedReturn:n,isStacked:o}=e;return(0,a.FD)(r.Ah,{occupyParentWidth:!0,flexDirection:o?"column":"row",justifyContent:"center",alignItems:"center",fontSize:16,flexWrap:"nowrap",itemsSpacingHorizontal:8*!o,itemsSpacingVertical:4*!!o,"data-sentry-element":"FlexLayout","data-sentry-component":"ReturnIndicator","data-sentry-source-file":"ReturnsChanged.tsx",children:[t,(0,a.Y)(r.In,{icon:o?u.$.ArrowDown:u.$.ArrowRight,className:"text-icon flex-shrink-0",size:16,"data-sentry-element":"Icon","data-sentry-source-file":"ReturnsChanged.tsx"}),n]})},p=e=>{let{amount:t}=e;return(0,a.FD)("span",{className:"whitespace-nowrap","data-sentry-component":"CurrencyAmountDisplay","data-sentry-source-file":"ReturnsChanged.tsx",children:[(0,a.Y)(s.eF,{amount:t,customFormatOptions:{hideDecimals:!0},sourceCurrency:c.mF,"data-sentry-element":"CurrencyAmount","data-sentry-source-file":"ReturnsChanged.tsx"}),"/yr"]})},y=e=>{let{title:t,children:n}=e;return(0,a.Y)(r.Zp,{classNames:{body:"text-center"},"data-sentry-element":"Card","data-sentry-component":"ReturnCard","data-sentry-source-file":"ReturnsChanged.tsx",children:(0,a.FD)(r.Ah,{display:"block",itemsSpacingVertical:8,"data-sentry-element":"FlexLayout","data-sentry-source-file":"ReturnsChanged.tsx",children:[(0,a.Y)(o.xp,{className:(0,i.cn)("text-neutral-500","!text-center"),"data-sentry-element":"CaptionW700","data-sentry-source-file":"ReturnsChanged.tsx",children:t}),n]})})},h=e=>{let{expReturns:t,dividendReturns:n}=e,{ref:o,compactMode:i}=(0,d.ro)(576),{optimizedValue:s,previousValue:c}=t,{optimizedValue:u,previousValue:h}=n;return(0,a.FD)(r.Ah,{ref:o,width:"100%",alignItems:"stretch",justifyContent:"space-between",equalWidthItems:!0,itemsSpacingHorizontal:i?6:24,itemsSpacingVertical:16,"data-sentry-element":"FlexLayout","data-sentry-component":"ReturnsChanged","data-sentry-source-file":"ReturnsChanged.tsx",children:[(0,a.Y)(y,{title:"Portfolio exp. returns","data-sentry-element":"ReturnCard","data-sentry-source-file":"ReturnsChanged.tsx",children:(0,a.Y)(m,{isStacked:i,previousReturn:(0,a.Y)(l.Ay,{expectedReturn:c,hideIndicator:i,justifyContent:"center",fractionDigits:2}),optimizedReturn:(0,a.Y)(l.Ay,{expectedReturn:s,hideIndicator:i,justifyContent:"center",fractionDigits:2}),"data-sentry-element":"ReturnIndicator","data-sentry-source-file":"ReturnsChanged.tsx"})}),(0,a.Y)(y,{title:"Dividend & fixed income","data-sentry-element":"ReturnCard","data-sentry-source-file":"ReturnsChanged.tsx",children:(0,a.Y)(m,{isStacked:i,previousReturn:(0,a.Y)(p,{amount:h}),optimizedReturn:(0,a.Y)(p,{amount:u}),"data-sentry-element":"ReturnIndicator","data-sentry-source-file":"ReturnsChanged.tsx"})})]})}}
3,87449:(e,t,n)=>{n.d(t,{Oi:()=>o,fH:()=>a,xJ:()=>r});var a=function(e){return e.VeryLow="Very Low",e.Low="Low",e.Neutral="Neutral",e.High="High",e.VeryHigh="Very High",e}({});let r={USDownturnProbability:"US Downturn Probability",USUnemployment:"US Unemployment Rate",USInflation:"US Inflation (YoY)",USBondYield10Years:"US 10-Year Bond Yield"};var o=function(e){return e.Commodities="Commodities",e.Companies="Companies",e.Currencies="Currencies",e.Cryptocurrencies="Cryptocurrencies",e.ETFs="ETFs",e.ETFOrMutualFund="ETF / Mutual Fund",e.Factors="Factors",e.MarketDynamics="Market Dynamics",e.MarketIndexes="Market Indexes",e.MSCIIndexes="MSCI Indexes",e.MutualFunds="Mutual Funds",e.OtherSecurities="Other Securities",e.Reit="REITs",e.SectorIndexes="Sector Indexes",e.UnknownSecurities="UnknownSecurities",e.BudgetBalance="Budget balance",e.BusinessConfidenceSurvey="Business confidence survey",e.BuildingPermits="Building permits",e.BusinessCredit="Business credit",e.BusinessCreditInterestRate="Business credit interest rate",e.CentralGovernmentDebt="Central Government Debt",e.ConsumerConfidenceSurvey="Consumer confidence survey",e.ConsumerCredit="Consumer credit",e.ConsumptionGrowth="Consumption growth",e.ConsumptionPercentGDP="Consumption as percent of GDP",e.CPI="CPI",e.CurrentAccountBalance="Current account balance",e.DebtServiceRatiosPrivateNonFinancial="Debt service ratios for private non-financial sector",e.DiscountInterestRate="Discount Interest Rate",e.EconomicGrowth="Economic growth, quarterly",e.EconomicGrowthQoQ="Economic growth Q-on-Q",e.Employment="Employment",e.ExchangeRate="Exchange rate to USD",e.Exports="Exports",e.FDI="FDI",e.ForeignExchangeReserves="Foreign exchange reserves",e.GDP="GDP",e.GovernmentExpenditure="Government expenditure",e.GovernmentNetDebt="Government Net Debt",e.HouseholdConsumption="Household consumption",e.HouseholdCredit="Household credit",e.HouseholdDebtToGDP="Household debt to GDP",e.HousePriceIndex="House price index",e.IndustrialProduction="Industrial production",e.InterbankRate="Interbank Rate",e.Investment="Investment",e.InvestmentGrowth="Investment growth",e.InvestmentPercentGDP="Investment as percent of GDP",e.LaborCost="Labor cost",e.M2="M2",e.MinimumWage="Minimum wage",e.MoneySupplyBroad="Money supply (broad money)",e.MortgageCredit="Mortgage credit",e.MortgageCreditInterestRate="Mortgage credit interest rate",e.NetCurrentAccount="Net Current Account",e.PolicyRate="Policy rate",e.PrivateSectorCredit="Private sector credit",e.PurchasingManagersIndexComposite="Purchasing Managers Index (PMI), composite",e.PurchasingManagersIndexManufacturing="Purchasing Managers Index (PMI), manufacturing",e.PurchasingManagersIndexServices="Purchasing Managers Index (PMI), services",e.RetailSalesYonY="Retail sales Y-on-Y",e.ResidentialPropertyPrices="Real residential property prices Y-on-Y change",e.StockMarketCapitilizationToGDP="Stock Market Capitalization to GDP",e.StringencyIndex="Stringency Index",e.TenYearGovernmentBondYields="Ten-Year Long-term Government Bond Yields",e.TotalInvestment="Total Investment",e.TotalExports="Total Exports",e.TotalImports="Total Imports",e.TotalReservesExcludingGold="Total Reserves Excluding Gold",e.Unemployment="Unemployment",e.Covid19ConfirmedCases="Covid-19 Confirmed Cases",e.PercentVaccinated="Percent Vaccinated",e.TechnologyTrends="Technology Trends",e.Population="Population",e}({})},87778:(e,t,n)=>{n.d(t,{$I:()=>p,BA:()=>h,BN:()=>b,Cy:()=>A,GI:()=>s,I0:()=>g,JU:()=>y,MG:()=>m,Nc:()=>x,Nt:()=>d,TA:()=>f,cN:()=>u,cV:()=>v,uM:()=>S,wf:()=>c});var a=n(57090);n(12115);var r=n(62570),o=n(88179),i=n(74547),l=n(35209);let s=(0,r.A)(l.A,{target:"ev2v85i0"})("min-width:270px;"),c=(0,r.A)(i._s,{target:"ev2v85i1"})(".ant-drawer-body{display:flex;flex-direction:column;}"),d=(0,r.A)(o.q,{target:"ev2v85i2"})("flex:1;padding:0;"),u=(0,r.A)(o.JF,{target:"ev2v85i3"})(".ant-form-item-label{padding-bottom:4px;}"),m=(0,r.A)("div",{target:"ev2v85i4"})("display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;height:100%;.ant-form-item{margin-bottom:0;}"),p=(0,r.A)(i.Ah,{target:"ev2v85i5"})("position:sticky;bottom:0;background:",e=>e.theme.colors.white,";margin:auto 0 0 0;justify-content:flex-end;width:100%;border-top:1px solid ",e=>e.theme.colors.neutral200,";padding:16px 0 8px;z-index:1;"),y=(0,r.A)("div",{target:"ev2v85i6"})("margin-bottom:4px;"),h=(0,r.A)("div",{target:"ev2v85i7"})("font-weight:500;font-size:16px;line-height:24px;color:",e=>e.theme.colors.neutral900,";margin:24px 0 16px 0;"),f=(0,r.A)("div",{target:"ev2v85i8"})("& + &{margin-top:24px;}"),g=(0,r.A)("span",{target:"ev2v85i9"})("margin-left:8px;font-weight:400;font-size:12px;color:",e=>e.theme.colors.neutral500,";"),v=(0,r.A)("div",{target:"ev2v85i10"})("margin-top:12px;"),x=(0,r.A)(i.aF,{target:"ev2v85i12"}
3)(".ant-modal-body{display:flex;justify-content:center;flex-direction:column;}"),A=(0,r.A)("div",{target:"ev2v85i13"})("& > div{max-height:calc(var(--vh,1vh) * 60);}"),S=()=>(0,a.Y)("span",{"data-sentry-component":"AdvisorFeeHelperMessage","data-sentry-source-file":"atoms.tsx",children:"Required for fee estimation (in percent, e.g. enter 1% as 1 or 25bp as .25). Maximum 3%."}),b=e=>(0,a.Y)(i._P,{...e,popupMatchSelectWidth:!1,popupClassName:"max-w-[calc(100vw-2rem)]","data-sentry-element":"AntdSelect","data-sentry-component":"AccountTypeStyledSelect","data-sentry-source-file":"atoms.tsx"})},87813:(e,t,n)=>{n.d(t,{AD:()=>s,DP:()=>u,Xz:()=>l,ZO:()=>m,ZP:()=>c,_J:()=>d,aU:()=>p,bG:()=>r,nc:()=>o,o9:()=>a,uu:()=>i});let a=5e3,r="What else should PortfolioPilot know to personalize your insights?",o="Use this space for anything that doesn't fit elsewhere (e.g. investment thesis, themes to avoid, short/long-term plans, etc). This context guides which investments we consider and how the AI Assistant responds — it doesn't set hard numeric rules such as a minimum trade size. It will get updated automatically over time.",i="e.g. My macro strategy is ABC. I don't ever want to sell X and Y. I'm planning to buy a house in 2 years. I'm supporting my parents financially. I want to avoid complex strategies and only invest in US stocks.",l="Net worth portfolio",s="Applies to every group",c="Asset group",d="e.g. My 401k only offers a set fund menu, so only suggest swaps within it. This is long-term money, so no tactical trades.",u="Add group-specific context",m="Update group-specific context",p="These preferences apply to your Net worth portfolio and every asset group."},88105:(e,t,n)=>{n.d(t,{A:()=>y,y:()=>p});var a=n(57090),r=n(12115),o=n(43948),i=n(99026),l=n(74547),s=n(36934),c=n(95825);let d=e=>{var t,n,r,o;if(!e.open)return null;let i=null!=(t=e.title)?t:"You have unsaved changes",d=null!=(n=e.description)?n:"The changes you made weren't saved. Do you want to save them?",u=null!=(r=e.discardButtonLabel)?r:"Discard",m=null!=(o=e.saveButtonLabel)?o:"Save changes";return(0,a.Y)(l.aF,{open:e.open,title:i,onCancel:e.onClose,footer:(0,a.FD)(c.jl,{children:[(0,a.Y)(l.$n,{onClick:e.onDiscard,children:u}),(0,a.Y)(l.$n,{onClick:e.onSave,variant:"filled",children:m})]}),"data-sentry-element":"Modal","data-sentry-component":"UnsavedChangesModal","data-sentry-source-file":"UnsavedChangesModal.tsx",children:(0,a.Y)(s.bU,{className:"text-body","data-sentry-element":"Body1W400","data-sentry-source-file":"UnsavedChangesModal.tsx",children:d})})},{useUnsavedChangesModalLaunchEventListener:u,emitUnsavedChangesModalLaunchEvent:m}=(0,o.createEvent)("UnsavedChangesModalLaunchEvent")(),p=()=>({launchUnsavedChangesModal:e=>{m(e)}}),y=()=>{let[e,t]=r.useState(null),n=r.useRef(i.lQ);u(e=>{t(e),n.current=e.onClose||i.lQ});let o=()=>{t(null),n.current(),n.current=i.lQ},l=async()=>{e&&await e.onDiscard(),o()},s=async()=>{e&&await e.onSave(),o()};return e?(0,a.Y)(d,{open:!0,title:e.title,description:e.description,discardButtonLabel:e.discardButtonLabel,saveButtonLabel:e.saveButtonLabel,onDiscard:l,onSave:s,onClose:o,"data-sentry-element":"UnsavedChangesModal","data-sentry-component":"GlobalUnsavedChangesModalLauncher","data-sentry-source-file":"GlobalUnsavedChangesModalLauncher.tsx"}):null}},88669:(e,t,n)=>{n.d(t,{I:()=>d,_:()=>u});var a=n(57090),r=n(12115),o=n(33624),i=n(74547),l=n(98868),s=n(59149),c=n(99026);let d=e=>{let t=r.useMemo(()=>(()=>{let e=(0,c.w5)(l.R$);return o.TjK(e=>{let t=s.wZ[e],n=s.ti[e].volatility,a="".concat(t," (").concat(n,"% risk)");return e===l.R$.NoRisk?a="No risk preference - Risk Match not evaluated":e===l.R$.Extreme&&(a="".concat(a," - Risk Match not evaluated")),{label:a,value:e}},e)})(),[]);return(0,a.Y)(i._P,{style:{width:"100%"},options:t,value:e.value,onChange:e.onChange,onBlur:e.onBlur,disabled:e.disabled,placeholder:e.placeholder,"data-sentry-element":"Select","data-sentry-component":"RiskProfileSelector","data-sentry-source-file":"RiskProfileSelector.tsx"})},u=e=>(0,a.Y)(d,{value:e.value,onChange:t=>{var n;null==(n=e.onChange)||n.call(e,t)},disabled:e.disabled,onBlur:e.onBlur,placeholder:e.placeholder,"data-sentry-element":"RiskProfileSelector","data-sentry-component":"RiskProfileSelectorFormInput","data-sentry-source-file":"RiskProfileSelector.tsx"})}
3,89093:(e,t,n)=>{n.d(t,{Ie:()=>r,Wk:()=>o,c$:()=>l,cT:()=>i});var a=n(18281);let r=["application/pdf","text/*","image/*","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-zip-compressed","application/x-rar-compressed","application/x-7z-compressed","application/json"],o="48 hours",i=["application/pdf","text/*","image/*","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],l={[a.SN.Transactions]:"/api/statements/upload_transactions_and_anything",[a.SN.Anything]:"/api/statements/upload_transactions_and_anything",[a.SN.Brokerage]:"/api/statements/upload_brokerage_statement"}},89263:(e,t,n)=>{n.d(t,{Gr:()=>u,V2:()=>d,XD:()=>p,aM:()=>m});var a=n(10833),r=n(81237),o=n(17667),i=n(35208);let l=["User","MFAuth"],s=[...l,"MFA_SETUP"],c=[...l,"MFA_STATUS"],d=()=>{let e=(0,a.j)();return(0,a.I)(s,r.A.getMfaSetup,{...i.Lo,onSuccess:t=>
3{t.success||e.invalidateQueries(c)}})},u=()=>{let e=(0,a.j)();return(0,o.A)(e=>r.A.verifyAndEnableMfa(e),{onSuccess:()=>{e.invalidateQueries(c)},onError:e=>{console.error("Error verifying and enabling MFA:",e)}})},m=()=>(0,a.I)(c,r.A.getMfaStatus,i.Lo),p=()=>{let e=(0,a.j)();return(0,o.A)(r.A.disableMfa,{onSuccess:t=>{t.success&&(e.invalidateQueries(c),e.removeQueries(s))},onSuccessMessage:e=>e.success?"MFA has been disabled":null,onError:e=>{console.error("Error disabling MFA:",e)}})}},89417:(e,t,n)=>{n.d(t,{R3:()=>o,uv:()=>r});let a=0,r=()=>{a+=1;let e=!1;return()=>{e||(e=!0,a=Math.max(0,a-1))}},o=()=>a>0},89703:(e,t,n)=>{n.d(t,{A0:()=>c,MG:()=>l,W_:()=>s,nA:()=>d});var a=n(57090);n(12115);var r=n(95825),o=n(35209),i=n(11);let l=e=>{let{children:t,className:n}=e;return(0,a.Y)("div",{className:"flex flex-col gap-4 justify-center items-center ".concat(n||""),"data-sentry-component":"FormContainer","data-sentry-source-file":"atoms.tsx",children:t})},s=e=>{var t,n;let r=("string"==typeof e.value?e.value:"").length>i.xN;return(0,a.Y)(o.A,{...e,maxLength:null!=(t=e.maxLength)?t:i.xN,isInvalid:e.isInvalid||r,errorMessage:null!=(n=e.errorMessage)?n:r?i.uu.message:void 0,className:"p-1 w-full ".concat(e.className||""),"data-sentry-element":"Input","data-sentry-component":"PortfolioNameInput","data-sentry-source-file":"atoms.tsx"})},c=e=>{let{children:t,className:n}=e;return(0,a.Y)("div",{className:"w-full flex flex-col justify-center items-start flex-nowrap content-around ".concat(n||""),"data-sentry-component":"InputContainer","data-sentry-source-file":"atoms.tsx",children:t})},d=e=>(0,a.Y)(r.Ay,{...e,"data-sentry-element":"Modal","data-sentry-component":"RecommendationNewDraftPopup","data-sentry-source-file":"atoms.tsx"})},90165:(e,t,n)=>{n.d(t,{B:()=>m,l:()=>p});var a=n(12115),r=n(33624),o=n(17667),i=n(50543),l=n(81527),s=n(95107),c=n.n(s),d=n(43847),u=n(55605);let m=(e,t)=>{(0,a.useEffect)(()=>{if(e.current&&t){let n=e.current.chart;(0,u.pY)(n,t)}},[t,e])},p=(e,t,n)=>{let{data:s}=(e=>(0,l.I)(["CheckInsightImageExists",e],()=>i.Ay.checkInsightImageExists(e)))(t),u=(0,o.A)(e=>{let{insightId:t,insightImage:n,mimeType:a}=e;return i.Ay.saveInsightImage(t,n,a)}),m=r.gD_(s)||s.exists;(0,a.useEffect)(()=>{"object"==typeof n&&c()(n)},[n]),(0,a.useEffect)(()=>{(async()=>{if((null==e?void 0:e.current)&&!m){let n=e.current.chart.getSVG(),a="image/png",r=await (0,d.lZ)(n,a);u.mutate({insightId:t,insightImage:r,mimeType:a})}})()},[m,e,t])}},90454:(e,t,n)=>{n.d(t,{s:()=>f});var a=n(12115),r=n(73321),o=n(81255),i=n(35270),l=n(23577),s=n(29743),c=n(54519),d=n(97663),u=n(39054),m=n(29053),p=n(32189);n(76778);let y=a.createContext(null),h=e=>e?e.includes(c.Ay.assetGroups)?s.dU.GROUPS:e.includes(c.Ay.drafts)?s.dU.DRAFTS:e.includes(c.Ay.transactions)?s.dU.TRANSACTIONS:e.includes(c.Ay.networth)?s.dU.NETWORTH:e.includes(c.Ay.income)?s.dU.INCOME:e.includes(c.Ay.details)?s.dU.DETAILS:e.includes(c.Ay.userAccountSettings)?s.dU.SETTINGS:e.includes(c.Ay.portfolioScore)?s.dU.PORTFOLIO_SCORE:e.includes(c.Ay.compare)?s.dU.COMPARISON:e.includes(c.Ay.taxes)?s.dU.TAXES:e.includes(c.Ay.fees)?s.dU.FEES:e.includes(c.Ay.portfolio)?s.dU.PORTFOLIO:e.includes(c.Ay.simulations)?s.dU.SIMULATIONS:e.includes(c.Ay.recommendations)?s.dU.RECOMMENDATIONS:e.includes(c.Ay.stockScreener)?s.dU.STOCK_SCREENER:e.includes(c.Ay.fundScreener)?s.dU.FUND_SCREENER:e.includes(c.Ay.cryptoScreener)?s.dU.CRYPTO_SCREENER:e.includes(c.Ay.screener)?s.dU.SCREENER:e.includes(c.Ay.securityExplorer)?s.dU.SECURITY_EXPLORER:e.includes(c.Ay.macroExplorer)?s.dU.MACRO_EXPLORER:e.includes(c.Ay.marketOverview)?s.dU.MARKET_OVERVIEW:e.includes(c.Ay.insights)?s.dU.INSIGHTS:e.includes(c.Ay.insight)?s.dU.INSIGHT:e.includes(c.Ay.aiEquityResearch)?s.dU.AI_EQUITY_RESEARCH:e.includes(c.Ay.portfolioFeed)?s.dU.PORTFOLIO_FEED:e.includes(c.Ay.anomalies)?s.dU.ANOMALIES:null:null,f=()=>{var e,t,n,f;let g=(0,r.usePathname)(),v=(0,r.useSearchParams)(),x=a.useContext(y),A=(0,o.A)(),S=a.useMemo(()=>{var e;let t=(0,i.X7)(null!=(e=null==v?void 0:v.get(l.k.paramName))?e:null);if(t)return t;let n=null==v?void 0:v.get("view");return(0,i.f0)(null!=n?n:null)},[v]),{currentPage:b,pageName:C,detectedSubSection:I}=a.useMemo(()=>
3{if(S)return{currentPage:S.page,pageName:S.pageName,detectedSubSection:S.subSection};if(A.isUserInTrackingRoute||A.isUserInPortfolioTracking||A.isUserInTrackPage||A.isUserNetWorthPageNetworthTab){let e=h(g);return{currentPage:s.Nb.TRACK,pageName:"Track",detectedSubSection:e}}if(A.isUserInPlanning)return{currentPage:s.Nb.PLAN,pageName:"Plan",detectedSubSection:null};if(A.isUserInPortfolioOverview)return{currentPage:s.Nb.IMPROVE,pageName:"Improve",detectedSubSection:s.dU.PORTFOLIO};if(A.isUserInSimulations)return{currentPage:s.Nb.IMPROVE,pageName:"Improve",detectedSubSection:s.dU.SIMULATIONS};if(A.isUserInPortfolioScoreRoute)return{currentPage:s.Nb.IMPROVE,pageName:"Improve",detectedSubSection:null};if(A.isUserInPortfolioRecommendations||A.isUserOnNext1000DollarsRecommendationsPage)return{currentPage:s.Nb.IMPROVE,pageName:"Improve",detectedSubSection:s.dU.RECOMMENDATIONS};if(A.isUserInCompareRoute)return{currentPage:s.Nb.IMPROVE,pageName:"Improve",detectedSubSection:s.dU.COMPARISON};if(null==g?void 0:g.startsWith(c.fe.improve)){let e=h(g);return{currentPage:s.Nb.IMPROVE,pageName:"Improve",detectedSubSection:e}}if(A.isUserInEconomyExploration||(null==g?void 0:g.startsWith(c.fe.explore))){let e=h(g);return{currentPage:s.Nb.EXPLORE,pageName:"Explore",detectedSubSection:e}}return{currentPage:s.Nb.OTHER,pageName:"PortfolioPilot",detectedSubSection:null}},[A,g,S]),w=a.useMemo(()=>{if(S)return I;let e=null==v?void 0:v.get("tab"),t=null==v?void 0:v.get("category");return b===s.Nb.TRACK&&I===s.dU.NETWORTH?e===d.d.Groups?s.dU.GROUPS:e===d.d.Drafts?s.dU.DRAFTS:e===d.d.Transactions?s.dU.TRANSACTIONS:s.dU.NETWORTH:b===s.Nb.TRACK&&I===s.dU.SETTINGS?e===u.fW.Preferences?s.dU.PREFERENCES:e===u.fW.EmailAlerts?s.dU.EMAIL_ALERTS:e===u.fW.PersonalSettings?s.dU.ACCOUNT_SETTINGS:e===u.fW.Subscription?s.dU.SUBSCRIPTION:e===u.fW.Billing?s.dU.BILLING:s.dU.SETTINGS:b===s.Nb.PLAN?e===m.ji.Estate?s.dU.ESTATE:s.dU.RETIREMENT:b===s.Nb.IMPROVE&&A.isUserInPortfolioScoreRoute?t===p.x5.RiskMatch?s.dU.RISK_MATCH:t===p.x5.SharpeRatio?s.dU.RISK_ADJUSTED_RETURNS:t===p.x5.DownsideProtection?s.dU.DOWNSIDE_PROTECTION:s.dU.RISK_MATCH:I||null},[b,v,I,A.isUserInPortfolioScoreRoute,S]),P=null!=(e=null==x?void 0:x.subSection)?e:w,k=null!=(t=null==x?void 0:x.setSubSection)?t:()=>{};return{page:b,currentPage:b,pageName:C,subSection:P,setSubSection:k,metadata:null!=(n=null==x?void 0:x.metadata)?n:{},setMetadata:null!=(f=null==x?void 0:x.setMetadata)?f:()=>{}}}},90521:(e,t,n)=>{n.d(t,{GT:()=>C,I4:()=>A,Tw:()=>b,dR:()=>x,eY:()=>S,rE:()=>I});var a=n(62212),r=n(32189),o=n(17667),i=n(80067),l=n(544),s=n(50202),c=n(70890),d=n(84245),u=n(8921),m=n(42036),p=n(35974),y=n(93382),h=n(4603),f=n(67759),g=n(79768),v=n(48298);let x=()=>{let e=(0,a.j)();return(0,o.A)(e=>(0,i.BD)(e),{onSuccess:async()=>{await (0,c.A9)(e)},onErrorMessage:e=>e})},A=()=>{let{switchActivePortfolio:e}=(0,m.Ay)(),t=(0,a.j)();return(0,o.A)(i.id,{onSuccess:async n=>{await (0,c.A9)(t),(0,f.trackDraftPortfolioCreated)({scenario:h.PortfolioCreationScenario.Manual}),e(n.createdPortfolioId,m.Gl.Auto,"Created and switched to new Draft Portfolio")}})},S=()=>{let e=(0,a.j)(),{portfoliosList:t}=(0,s.RW)();return(0,o.A)(async e=>{let n=(0,l.Fk)(t,e.portfolioId),a=null==n?void 0:n.source;return await (0,i.pE)(e),{initialPortfolioSource:a}},{onSuccess:(t,n)=>{(0,c.A9)(e),t.initialPortfolioSource===r.GB.Demo&&(0,p.h)({demoPortfolioId:n.portfolioId,reason:y.$.PortfolioPropertiesEdited})},onErrorMessage:e=>e})},b=()=>{let e=S(),t=async t=>{let{portfolioId:n,portfolioName:a,portfolioDescription:r,referencePortfolioId:o}=t;await e.mutateAsync({portfolioId:n,portfolioName:a,portfolioDescription:r,referencePortfolioId:o},{onSuccess:async(e,t)=>{(0,u.Ds)(u._n.Success,"".concat(t.portfolioName," has been updated"))}})};return(0,o.A)(t)},C=()=>{let e=(0,a.j)(),{portfoliosList:t,mainPortfolio:n}=(0,s.RW)(),u=(0,g.rA)();return(0,o.A)(async e=>{let{portfolioId:n}=e,a=(0,l.Fk)(t,n),r=(null==a?void 0:a.portfolioName)||"Portfolio",o=null==a?void 0:a.source,s=null==a?void 0:a.portfolioType;return await (0,i.Dk)(n),{portfolioId:n,portfolioName:r,portfolioSource:o,portfolioType:s}},{onSuccess:async t=>{let{portfolioType:a}=t;
3await (0,c.A9)(e),a===r.N$.Current&&(u(n),await e.invalidateQueries(d.u$))},onErrorMessage:(e,t)=>t.suppressNotification?null:e})},I=()=>(0,o.A)(async()=>v.Ay.invalidatePortfolios())},90799:(e,t,n)=>{n.d(t,{b:()=>f});var a=n(57090);n(12115);var r=n(96242),o=n(2175),i=n(62570),l=n(32189),s=n(44619),c=n(36934);let d=(0,i.A)(r.A,{target:"e2es4lf0"})("width:100%;.ant-select-selector{border-radius:6px !important;}"),u=(0,i.A)("div",{target:"e2es4lf1"})("display:flex;flex-direction:column;gap:2px;padding:4px 0;"),m=(0,i.A)("span",{target:"e2es4lf2"})("font-weight:500;"),p=(0,i.A)("span",{target:"e2es4lf3"})("font-size:12px;color:",e=>e.theme.colors.neutral500,";line-height:1.3;"),y=(0,i.A)(c.km,{target:"e2es4lf4"})("color:#d97706;margin-top:4px;"),h=[l.MG.Taxable,l.MG.TaxAdvantaged,l.MG.TaxFree];function f(e){return(0,a.FD)(o.A,{direction:"vertical",size:4,style:{width:"100%"},"data-sentry-element":"Space","data-sentry-component":"TaxTreatmentSelector","data-sentry-source-file":"TaxTreatmentSelector.tsx",children:[(0,a.Y)(d,{value:e.value,onChange:t=>e.onChange(t),disabled:e.disabled,optionLabelProp:"label",popupMatchSelectWidth:!1,popupClassName:"max-w-[calc(100vw-2rem)]","data-sentry-element":"StyledSelect","data-sentry-source-file":"TaxTreatmentSelector.tsx",children:h.map(e=>(0,a.Y)(r.A.Option,{value:e,label:(0,s.OL)(e),children:(0,a.FD)(u,{children:[(0,a.Y)(m,{children:(0,s.OL)(e)}),(0,a.Y)(p,{children:(0,s.JN)(e)})]})},e))}),e.warningMessage&&(0,a.Y)(y,{children:e.warningMessage})]})}},90997:(e,t,n)=>{n.d(t,{i:()=>i,s:()=>o});var a=n(33624),r=n(22977);let o=e=>a.jp7(r.AP,e),i=e=>a.jp7(r.wR,e)},91217:(e,t,n)=>{n.d(t,{CP:()=>r,R5:()=>o,ZK:()=>i,kp:()=>a});let a=-.5,r=.5,o=0,i=1},91469:(e,t,n)=>{n.d(t,{A:()=>m,S:()=>u});var a=n(57090),r=n(12115),o=n(99026),i=n(41686),l=n(43948),s=n(17481);let{useAccountSetupLaunchEventListener:c,emitAccountSetupLaunchEvent:d}=(0,l.createEvent)("AccountSetupLaunchEvent")(),u=e=>{let t=async e=>{d(e),await (0,o.yy)(100)};return{launchAccountSetup:async(e,n)=>{await t({connectedInvestmentAccount:e,openAs:s.h.Modal,isOperationAbortable:!1,onCloseCallback:n})},launchAccountEditDrawer:async()=>{e?await t({connectedInvestmentAccount:e,openAs:s.h.Drawer,isOperationAbortable:!0}):console.error("No connectedInvestmentAccount provided to launchAccountSetup")},launchAccountSetupWithConnectedInvestmentAccount:t}},m=()=>{let[e,t]=r.useState(null),n=r.useRef(o.lQ),l=r.useRef(o.lQ);c(e=>{let{onCloseCallback:a}=e;t(e),l.current=a||o.lQ,(0,i.E0)(()=>{n.current()})});let d=()=>{t(null),l.current()};if(e){let{connectedInvestmentAccount:t,openAs:n,isOperationAbortable:r}=e||{};return(0,a.Y)(s.A,{openAs:n,isOperationAbortable:r,investmentAccountId:t.id,onCancel:d,onClose:d})}return null}},91571:(e,t,n)=>{n.d(t,{O7:()=>d,jF:()=>u,sK:()=>m});var a=n(81527),r=n(47364),o=n(55805),i=n(86136),l=n(9974),s=n(98804);let c=["ScenarioPlanning","BaseScenarioId"],d=()=>{var e;let t=(0,a.I)(c,()=>o.gO.getBaseScenarioId(),{staleTime:1/0});return{data:null==(e=t.data)?void 0:e.scenarioId,isLoading:t.isLoading,isError:t.isError}},u=()=>{let{searchParams:e}=(0,r.o)(["scenarioId"]),t=(0,l.So)(e.scenarioId),n=d();return(0,l.KH)(t)?{scenarioId:t,isLoading:!1,isInWhatIfScenario:!0,isError:!1}:{scenarioId:n.data,isLoading:n.isLoading,isInWhatIfScenario:!1,isError:n.isError}},m=()=>{let{scenarioId:e,isInWhatIfScenario:t}=u(),{data:n,isLoading:a}=(0,i.Jv)(t&&e?e:l.$Y);return t?{kind:null==n?void 0:n.kind,isDraft:(null==n?void 0:n.kind)===s.Qf.Draft,isLoading:a}:{kind:s.Qf.Base,isDraft:!1,isLoading:!1}}},91905:(e,t,n)=>{n.d(t,{$C:()=>p,Ay:()=>g,h8:()=>f});var a=n(57090),r=n(12115),o=n(43948),i=n(45676),l=n(34584),s=n(39510),c=n(26214),d=n(73285),u=n(25373);let m=e=>{var t;let n=(0,d.w)(),{goToTopRecommendationsAfterDraftCreation:r}=(()=>{let{flagValue:e}=(0,s.$L)(c.mr.Test428DraftCreatedToTopRecommendations,c.U7.Control);return{goToTopRecommendationsAfterDraftCreation:e===c.U7.Variant1}})();return(0,a.Y)(i.A,{title:e.title,activePortfolio:e.activePortfolio,emptyStart:{initialMode:null!=(t=e.initialStartMode)?t:l.V.CopyOfHoldings},onClose:e.onClose,onDraftPortfolioCreated:t=>{var a;null==(a=e.onDraftPortfolioCreated)||a.call(e,t),r&&(0,u.ST)(n)},"data-sentry-element":"CopyPortfolioActionContainer","data-sentry-component":"GenericDraftCreationModal","data-sentry-source-file":"GenericDraftCreationModal.tsx"})};var p=function(e){return e.GenericCreation="GenericCreation",e.WithinExistingFlow="WithinExistingFlow",e}({});let{useGlobalCopyPortfolioActionLaunchListener:y,emitGlobalCopyPortfolioActionLaunch:h}=(0,o.createEvent)("GlobalCopyPortfolioActionLaunch")(),f=()=>({launchCopyPortfolioAction:e=>{h(e)}}),g=()=>{let[e,t]=(0,r.useState)(null),[n,o]=(0,r.useState)(0);y(e=>{t(e),o(e=>e+1)});let l=()=>t(null);return e?"GenericCreation"===e.draftCreationOrigin?(0,a.Y)(m,{title:e.title,activePortfolio:e.portfolio,initialStartMode:e.initialStartMode,onClose:l,onDraftPortfolioCreated:e.onDraftPortfolioCreated,"data-sentry-element":"GenericDraftCreationModal","data-sentry-component":"GlobalCopyPortfolioActionLauncher","data-sentry-source-file":"GlobalCopyPortfolioAction.tsx"},n):(0,a.Y)(i.A,{title:e.title,activePortfolio:e.portfolio,onClose:l,onDraftPortfolioCreated:e.onDraftPortfolioCreated,"data-sentry-element":"CopyPortfolioActionContainer","data-sentry-component":"GlobalCopyPortfolioActionLauncher","data-sentry-source-file":"GlobalCopyPortfolioAction.tsx"},n):null}},92487:(e,t,n)=>{n.d(t,{y:()=>i});var a=n(33624),r=n(46165),o=n(84455);let i=()=>{let{data:e,isFetching:t,isSuccess:n}=(0,r.Kv)(),{investorRiskProfile:i}=(0,r.gm)(),l=null==e?void 0:e.response,s=a.aIS(l,o.SO.AggregatedPortfolio);return{isAggregatedManagementPreference:s,isAssetGroupManagementPreference:a.aIS(l,o.SO.AssetGroups),isDefaultManagementPreference:s,isPreferenceLoading:t,isPreferenceLoaded:n,accountRiskProfile:i}}},92657:(e,t,n)=>{n.d(t,{$p:()=>w,Bt:()=>I,Ce:()=>P,Cf:()=>k,Gs:()=>L,In:()=>x,J0:()=>D,L6:()=>z,L9:()=>V,LX:()=>U,MX:()=>_,N5:()=>G,P0:()=>T,Ph:()=>H,Pq:()=>B,R6:()=>F,Rw:()=>E,Tu:()=>C,UV:()=>Z,W_:()=>g,XU:()=>q,YO:()=>Q,_S:()=>O,av:()=>R,bt:()=>ea,fk:()=>K,g7:()=>ee,gH:()=>S,gb:()=>M,i4:()=>J,iQ:()=>v,lz:()=>X,mv:()=>en,nb:()=>b,pR:()=>j,qV:()=>$,rg:()=>W,vd:()=>Y,wj:()=>A});var a=n(57090);n(12115);var r=n(62570),o=n(23462),i=n(74547),l=n(40248),s=n(92672),c=n(59949);n(28811);var d=n(87027),u=n(370),m=n(18290),p=n(36934),y=n(68446),h=n(41784),f=n(81671);let g=(0,r.A)("div",{target:"ei3ezvv1"})("color:",e=>e.theme.colors.neutral900,";font-weight:500;font-size:16px;"),v=(0,r.A)("div",{target:"ei3ezvv2"})("display:flex;align-items:center;flex-direction:column;row-gap:8px;min-width:0;& >:first-child{display:flex;align-items:center;height:24px;}"),x=(0,r.A)("div",{target:"ei3ezvv3"})("&:before{background-image:",e=>"url('".concat((0,y.s)(e.icon),"')"),";content:'';width:20px;height:20px;background-size:contain;background-repeat:no-repeat;display:block;}"),A=(0,r.A)("div",{target:"ei3ezvv4"})("color:",e=>e.theme.colors.neutral500,";font-size:12px;text-align:center;margin-top:auto;"),S=(0,r.A)("a",{target:"ei3ezvv5"})("color:inherit;text-decoration:underline;");(0,r.A)(s.Ah,{target:"ei3ezvv7"})((0,s.BK)({flexBasis:["100%","100%","80%"]}));let b=(0,r.A)(d.A,{target:"ei3ezvv8"})(e=>e.isMobilePortrait?"min-height: 160px; max-height: 196px; overflow-y:auto; scrollbar-color: black;":""),C=(0,r.A)("div",{target:"ei3ezvv9"})(e=>e.compactHorizontal?{width:"40px",height:"40px"}:(0,s.BK)({width:[e.compactCards?"40px":"64px","80px"],height:[e.compactCards?"40px":"64px","80px"]}),"  &:before{background-image:",e=>"url('".concat((0,y.s)(e.icon),"')"),";content:'';background-size:contain;background-repeat:no-repeat;display:block;",e=>e.compactHorizontal?{width:"40px",height:"40px"}:(0,s.BK)({width:[e.compactCards?"40px":"64px","80px"],height:[e.compactCards?"40px":"64px","80px"]}),"}"),I=(0,r.A)(i.y$,{target:"ei3ezvv10"})(),w=(0,r.A)("div",{target:"ei3ezvv11"})("display:flex;align-items:flex-start;"),P=(0,r.A)("div",{target:"ei3ezvv12"})("display:flex;column-gap:16px;max-width:100%;"),k=(0,r.A)("img",{target:"ei3ezvv13"})("height:24px;min-width:0;"),F=(0,r.A)(i._P,{target:"ei3ezvv14"})("&.ant-select-single .ant-select-selector{border-radius:8px;border:1px solid ",e=>e.theme.colors.blue600,";& >
3 .ant-select-selection-placeholder{",(0,s.BK)({fontSize:["12px","12px","14px"]}),"}.ant-select-selection-search-input{font-size:14px;}}.ant-select-item{border-radius:0;}&.ant-select .ant-select-dropdown{.rc-virtual-list-holder{scrollbar-gutter:stable;padding-right:4px;}.ant-select-item.ant-select-item-option{padding:12px 12px 12px 8px;&:not(:last-child){border-bottom:1px solid ",e=>e.theme.colors.neutral300,";}.ant-select-item-option-content .ant-divider{margin:8px 0 0 0;height:1px;background:",e=>e.theme.colors.neutral200,";}}}"),T=(0,r.A)(u.default,{target:"ei3ezvv15"})("padding:0 32px;"),E=()=>(0,a.Y)(i.In,{icon:f.$.CircleCheck,className:"pt-2 text-primary h-6 w-6 text-2xl","data-sentry-element":"IconifyIcon","data-sentry-component":"PersonalizationCompletedIndicator","data-sentry-source-file":"atoms.tsx"}),Y=(0,r.A)(e=>{let{className:t,...n}=e;return(0,a.Y)(p.lc,{...n,className:(0,h.cn)("text-body",t),"data-sentry-element":"Body1W600","data-sentry-component":"QuestionLabelBase","data-sentry-source-file":"atoms.tsx"})},{target:"ei3ezvv16"})((0,s.BK)({fontSize:["18px"]}),"  line-height:1.3;text-align:center;"),D=(0,r.A)(e=>{let{className:t,...n}=e;return(0,a.Y)(p.km,{...n,className:(0,h.cn)("text-body",t),"data-sentry-element":"Body2W400","data-sentry-component":"QuestionDescriptionBase","data-sentry-source-file":"atoms.tsx"})},{target:"ei3ezvv17"})("text-align:center;color:",e=>e.theme.colors.neutral500,";"),R=(0,r.A)(s.Ah,{target:"ei3ezvv18"})("display:flex;flex-direction:column;align-items:center;"),N=e=>(0,a.Y)(s.Ah,{...e,className:"w-full max-w-[1200px] mx-auto px-4 sm:px-6 md:px-8 lg:px-12 xs:pt-3 pt-4","data-sentry-element":"FlexLayout","data-sentry-component":"ProgressBarContainer","data-sentry-source-file":"atoms.tsx"}),M=e=>{var t;return(0,a.Y)(N,{"data-sentry-element":"ProgressBarContainer","data-sentry-component":"OnboardingProgressBar","data-sentry-source-file":"atoms.tsx",children:(0,a.Y)(c.A,{"aria-label":e.ariaLabel,minValue:0,maxValue:null!=(t=e.maxValue)?t:100,value:e.value,classNames:{indicator:"bg-primary-800",track:e.trackOutline?"h-2 outline outline-2 outline-[#F1F5F9] rounded-full":"h-2",base:"h-2"},"data-sentry-element":"Progress","data-sentry-source-file":"atoms.tsx"})})},L=e=>(0,a.FD)(p.Z4,{className:"text-neutral-500 text-center mt-1","data-sentry-element":"CaptionW500","data-sentry-component":"OnboardingProgressBarAssessmentLabel","data-sentry-source-file":"atoms.tsx",children:[e.percent,"% to your free assessment"]}),_=e=>(0,a.Y)(p.Z4,{className:"text-neutral-500 text-center mt-1","data-sentry-element":"CaptionW500","data-sentry-component":"OnboardingProgressBarCompletionCaption","data-sentry-source-file":"atoms.tsx",children:e.children}),O=(0,r.A)(e=>{let{className:t,...n}=e;return(0,a.Y)(p.km,{...n,className:(0,h.cn)("text-body",t),"data-sentry-element":"Body2W400","data-sentry-component":"StepValueBase","data-sentry-source-file":"atoms.tsx"})},{target:"ei3ezvv19"})("color:",e=>e.theme.colors.neutral500,";"),W=(0,r.A)(R,{target:"ei3ezvv20"})(),B=(0,r.A)("div",{target:"ei3ezvv21"})("width:100%;display:flex;justify-content:center;"),U="640px",z=(0,r.A)("div",{target:"ei3ezvv22"})("display:flex;align-items:center;background:",e=>e.theme.colors.white,";box-sizing:border-box;margin-top:8px;border-radius:var(--card-border-radius,8px);",(0,s.BK)({width:["100%","560px"],padding:["16px","16px","32px 16px"]}),";> div:first-of-type{margin-right:12px;}label{display:block;padding-bottom:4px;font-size:14px;line-height:20px;color:",e=>e.theme.colors.neutral900,";}"),V=(0,r.A)(z,{target:"ei3ezvv23"})(),j=(0,r.A)(z,{target:"ei3ezvv24"})(),H=(0,r.A)("div",{target:"ei3ezvv25"})((0,s.BK)({display:["block","block","flex"]}),";flex-basis:90%;align-items:center;justify-content:space-between;width:100%;min-width:0;& > div{min-width:0;padding-bottom:16px;> label{padding-bottom:4px;}}& > div:first-of-type{flex-basis:65%;}&:not(:has(> div:nth-of-type(2))) > div:first-of-type{flex-basis:100%;}& > div:nth-of-type(2){flex-basis:30%;}"),q=e=>(0,a.Y)("div",{...e,className:"flex-1 min-w-0","data-sentry-component":"OnboardingSelectContainer","data-sentry-source-file":"atoms.tsx"}),G=(0,r.A)("div",{target:"ei3ezvv26"})("display:flex;flex-direction:column;width:100%;min-height:inherit;margin:auto 0;padding-bottom:",e=>e.contentOverflowSpacer,"px;"),K=(0,r.A)("div",{target:"ei3ezvv27"})("flex-grow:1;overflow-y:",e=>e.isInline?"visible":"auto",";display:flex;& > div{margin:",e=>e.isInline?"0 auto":"auto",";}",e=>e.isInline?"":"min-height: 100%;"),Q=(0,r.A)(s.Ah,{target:"ei3ezvv28"})("width:100%;display:flex;justify-content:center;align-items:center;flex-direction:column;",(0,s.BK)({padding:["16px 0 0","16px 0 0","24px 0 0"]})),$=(0,r.A)(m.$,{target:"ei3ezvv29"})(),X=(0,r.A)("div",{target:"ei3ezvv30"})("box-sizing:border-box;",(0,s.BK)({padding:["16px 16px 0"]})),J=(0,r.A)("div",{target:"ei3ezvv31"})((0,s.BK)({paddingBottom:["12px"]})),Z=(0,r.A)(R,{target:"ei3ezvv32"})((0,s.BK)({paddingTop:["4px"]})),ee=(0,r.A)("div",{target:"ei3ezvv33"})(e=>e.fullWidth?"width: 100%;":""," ",e=>(0,s.BK)({maxWidth:e.maxWidths})),et=(0,o.i7)("0%,100%{transform:scale(1);}50%{transform:scale(1.015);}"),en=(0,r.A)(l.A,{target:"ei3ezvv34"})("animation:",et," 1s ease-in-out infinite;"),ea=(0,r.A)("div",{target:"ei3ezvv35"})((0,s.BK)({padding:["0","0","0"]}),"  & > * + *{margin-top:0.75rem;}",e=>e.disableClickEvents&&"pointer-events: none")},93042:(e,t,n)=>{n.d(t,{M:()=>o,p:()=>r});var a=n(12115);let r=a.createContext(void 0);r.displayName="PortfolioTuningContext";let o=()=>{let e=a.useContext(r);if(void 0===e)throw Error("usePortfolioTuningContext must be used within a PortfolioTuningContext Provider");return e}},93130:(e,t,n)=>{n.d(t,{V2:()=>k,IJ:()=>w,TD:()=>P,Hf:()=>I});var a=n(33624),r=n(10833),o=n(51436),i=n(17667),l=n(10388),s=n(6976),c=n(96806),d=n(55711),u=n(28056),m=n(58613),p=n(16462),y=n(73672),h=n(84245);let f=()=>(0,r.I)({queryKey:l.on.Preferences,queryFn:o.e,enabled:!0,...h.gz});var g=n(47178),v=n(12115),x=n(18069),A=n(98804),S=n(84455),b=n(46165),C=n(18457);let I=()=>{let{data:e=[],...t}=f(),n=(0,g.es)(e),a=(0,g.Xm)(n),r=(0,g.aY)(n),o=(0,g.EG)(n);return{...t,estatePlanningPreferences:n,estatePlanningChecklistPreferences:r,estatePlanningChecklistReminderPreferences:o,lastUpdatedAt:a}},w=e=>{let t=(()=>{let e=(0,r.j)(),{activeRecommendations:t}=(0,m.Ay)(),n=(0,y.ug)(),s=a.I6j(a.wqE("recommendationType",p.A.EstatePlanning),t);return(0,i.A)(async e=>{await Promise.all(a.TjK(o.u,e))},{onMutate:()=>{e.cancelQueries(l.on.Preferences)},onSuccess:async(t,r)=>
3{if(await e.invalidateQueries(l.on.Preferences),s){let{recommendation:e}=s;a.I6j(t=>t.questionId.toString()==e.questionId.toString(),r)&&n.mutateAsync({recommendationType:p.A.EstatePlanning,autocompleteWithoutChecking:!0})}}})})(),n=(0,v.useMemo)(()=>(0,g.QE)(e),[e]),s=async(e,a)=>{let r=n[e],o=(0,g.fD)({...r||{},questionId:e,response:a});await t.mutateAsync([o])};return{estatePlanningPreferencesMap:n,updateChecklistPreference:s,isChecklistItemUpdateInProgress:e=>t.isLoading&&a.bzn(a.wqE("questionId",e),a.X4r([],["variables"],t)),isChecklistItemCompleted:e=>{let t=n[e];return t&&(0,g.on)(t)}}},P=()=>{let{data:e=[],isLoading:t}=f(),n=(0,g.Ix)(e),o=(()=>{let e=(0,r.j)(),t=(0,s.nP)(),n=(0,c.Jz)(void 0);return(0,i.A)(async e=>{if((0,d.uc)(e.questionId))await t.mutateAsync([e]);else if((0,u.A0)(e.questionId))await n.mutateAsync([e]);else throw Error("Unknown preference type")},{onMutate:()=>{e.cancelQueries(l.on.Preferences)},onSuccess:async()=>{await e.invalidateQueries(l.on.Preferences)}})})(),{userResidency:m}=(0,b.R2)(),{getPreferenceOptions:p}=(e=>{let{options:t}=(0,b.Mf)(),n=(0,x.YU)(e.residency||void 0),r=(0,C.mf)();return{getPreferenceOptions:e=>{switch(e){case S.od.EstimatedNetWorth:return t;case S.od.CurrentAge:return r;case S.od.TaxFilingStatus:return[{value:S.Xx.MarriedFilingJointly,label:"Married"},{value:S.Xx.Single,label:"Single"}];case A.WR.Children:return a.TjK(e=>({value:String(e),label:String(e)}),a.y17(0,11));case S.od.Residency:return(0,x.B_)();case A.WR.State:return a.TjK(e=>({value:e,label:e}),n)}}}})({residency:m}),y=a.wQP(e=>e.questionId,n);return{settingPreferences:n,settingPreferencesMap:y,updateSettings:e=>o.mutateAsync(e),isSettingsUpdateInProgress:e=>{var t;return o.isLoading&&(null==(t=o.variables)?void 0:t.questionId)===e},getPreferenceOptions:p,isEstatePlanningPreferencesLoading:t}},k=()=>{let{settingPreferences:e}=P(),{estimatedNetworth:t}=(0,b.w)();return{getItemVisibility:n=>{let a=(0,g.H2)(e,A.WR.Children),r=(0,l.wv)(null==a?void 0:a.response);return(0,l.j2)(n,{isUserWithDependents:r,estimatedNetworth:t})}}}},93344:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(57090);n(12115);var r=n(68446);let o=e=>{let{icon:t,className:n}=e;return(0,a.Y)("div",{className:"inline-block w-8 h-9 ".concat(n||""),"data-sentry-component":"IconContainer","data-sentry-source-file":"IconContainer.tsx",children:(0,a.Y)("div",{className:"inline-block w-full h-full rounded-lg bg-contain bg-no-repeat",style:{backgroundImage:"url('".concat((0,r.s)(t),"')")}})})}},93382:(e,t,n)=>{n.d(t,{$:()=>a});var a=function(e){return e.PortfolioInvestmentsEdited="Portfolio investments edited",e.PortfolioPropertiesEdited="Portfolio properties edited",e.ManualDeletion="Manual Deletion",e.RemoveDemoPromptAccepted="Remove Demo prompt accepted",e.DemoPortfolioSetupRejected="Demo portfolio setup rejected",e}({})},93959:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(88963),r=n(62031),o=n.n(r),i=n(13125),l=n.n(i);class s{constructor(){this.getConnectedAccounts=async()=>{let e=await this.apiCaller.get("/settings/get_connected_accounts",{});return o()(e,{deep:!0})},this.deleteConnectedAccount=async(e,t,n)=>{let a=await this.apiCaller.post("/settings/delete_bank_account",l()({investmentAccountId:e,disconnectOption:t,softDelete:!!n}));return o()(a)},this.apiCaller=new a.Ay}}let c=new s},94119:(e,t,n)=>{n.d(t,{A:()=>T});var a=n(57090),r=n(12115),o=n(33624),i=n(67030),l=n(45640),s=n(22912),c=n(33841),d=n(12584);n(19273);var u=n(92615),m=n.n(u),p=n(53898),y=n(43847),h=n(80375),f=n(71754),g=n(41784),v=n(36934),x=n(63338),A=n(90165),S=n(75463),b=n(14185),C=n.n(b);"object"==typeof s&&(C()(s),C()(c));let I=e=>{let{data:t,yLabel:n,yFormat:i,xLabel:l,xFormat:s,xAxisKey:u,colorMode:b,insightId:C,accessibilityDescription:I}=e,w=(0,y.NU)(),P=r.useMemo(()=>{let e=o._w2(u,t),a=o.HPH(o.cJW([u,"y_range","display_name"],t)),r=o.TjK(e=>{let n=o._w2(e,t);return{name:e,data:o.TjK(e=>(0,y.Cs)(e,i),n),...(0,y.L1)(e)}},a),c=((e,t)=>{let n;return(0,y.fM)({chart:{type:"column"},tooltip:(n={formatValue:n=>"".concat((0,p.Gj)(n)).concat((0,y.Yj)({format:e,text:"",hideDecimals:!1,preferredCurrency:t}))},{useHTML:!0,...x.uh,formatter:function(){var e,t;let a;return a={heading:String(null!=(e=this.x)?e:""),seriesName:this.series.name,seriesColor:"string"==typeof this.color?this.color:f._C.text,valueText:n.formatValue(null!=(t=this.y)?t:void 0)},(0,x.mp)({paddingClass:"p-2",innerHtml:'<div class="'.concat((0,g.cn)(v.gI.body2W700,"whitespace-nowrap"),'" style="color:').concat(f._C.text,'">').concat((0,h.Z)(a.heading),"</div>")+'<div class="'.concat((0,g.cn)(v.gI.captionW500,"whitespace-nowrap","mt-0.5"),'"><span style="color:').concat((0,h.Z)(a.seriesColor),'">').concat((0,h.Z)(a.seriesName),':</span> <span style="color:').concat(f._C.text,'">').concat((0,h.Z)(a.valueText),"</span></div>")})}})})})(i,w);return o.jp7(c,{colors:(0,y.Kz)(b),xAxis:{categories:e,title:{text:l},labels:{format:"{text}".concat((0,y.Yj)({format:s,text:"",hideDecimals:!1,preferredCurrency:w}))}},yAxis:{opposite:!1,labels:{format:"{text}".concat((0,y.Yj)({format:i,text:"",hideDecimals:!1,preferredCurrency:w}))},title:{text:n}},series:r,lang:{accessibility:{chartContainerLabel:I}},accessibility:{description:I}})},[u,b,t,s,l,i,n,I,w]),k=r.useRef(null);return(0,d.k)(k),(0,A.B)(k,t.y_range),(0,a.FD)(r.Fragment,{children:[(0,a.Y)(m(),{ref:k,highcharts:c,options:P,"data-sentry-element":"HighchartsReact","data-sentry-source-file":"BarChart.tsx"}),C?(0,a.Y)(S.A,{insightId:C,highCharts:c,chartComponentRef:k}):null]})};var w=n(49857),P=n(31624),k=n(83439);let F={value:"Value",latestValue:"Latest Value"},T=e=>{let{chartType:t,suptitle:n,title:r,data:s,stripForecastsData:c=!1}=e,{insightId:d}=e.commonInsightBlockContent||{},u=c?y.xI:o.D_O;return(0,a.FD)("div",{"data-sentry-component":"InsightChart","data-sentry-source-file":"InsightChart.tsx",children:[e.hideHeading?null:(0,a.Y)(w.A,{title:n,subTitle:r,commonInsightBlockContent:e.commonInsightBlockContent}),(()=>{switch(t){case i.NB.LineChart:{var n;let t=u(s),r={...e,data:t}
3,o=(null!=(n=e.chartLanguage)?n:P.z.Legacy)===P.z.Legacy&&k.A(t[F.latestValue])?{windowSeriesName:F.latestValue,historySeriesName:F.value}:null;return(0,a.Y)(l.default,{...r,insightId:d,seriesHighlight:o})}case i.NB.BarChart:{let t=u(s),n={...e,data:t};return(0,a.Y)(I,{...n,insightId:d})}default:return console.error("InsightChart: Unknown chart type",t),null}})()]})}},94568:(e,t,n)=>{e.exports=n.p+"static/media/ob_other_generic.4ad2ae95fa9d0a57.svg"},95392:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(12115),r=n(8921),o=n(66909),i=n(25374);let l=(e,t,n,l)=>{a.useEffect(()=>{if(e&&!(0,i.Xx)(t)){let e=t?(0,o.u)(t):null==l?void 0:l.description;(0,r.Ds)(r._n.Error,n,{description:e,...l})}},[e,n,t])}},95505:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(33624),r=n(58888);let o=()=>{let{data:e=[],isLoading:t}=(0,r.Aj)();return{portfolioGroups:e,isGroupsLoading:t,getPortfolioGroupByPortfolioId:t=>a.I6j(a.wqE("portfolioSummaryId",t),e)}}},95633:(e,t,n)=>{n.d(t,{b:()=>s,d:()=>c});var a=n(33624),r=n(45085),o=n(52568),i=n(84245),l=n(35208),s=function(e){return e.EETutorialPopupShown="ee_tutorial_popup_shown",e.HLRNotificationShown="hlr_notification_shown",e.ProactiveAssistantStats="proactive_assistant_stats",e.ScheduleOnboardingCallLastShownAt="schedule_onboarding_call_last_shown_at",e.ScheduleOnboardingCallClickedThrough="schedule_onboarding_call_clicked_through",e.DemoModeConnectNudgeLastShownAt="demo_mode_connect_nudge_last_shown_at",e.DemoModeBannerDismissed="demo_mode_banner_dismissed",e.RecommendationDetailsViewedOnce="recommendation_details_viewed_once",e.TopRecommendationsVisited="top_recommendations_visited",e.Test321LeaveRecsAddContextModalShown="test321_leave_recs_add_context_modal_shown",e.GettingStartedBannerCompletedSteps="getting_started_banner_completed_steps",e.AIAssessmentSeen="ai_assessment_seen",e.Test338RecsDraftsModalSeen="test338_recs_drafts_modal_seen",e.Test429SurveyAnsweredQuestionIds="test429_survey_answered_question_ids",e.RetirementQuestionnaireAnsweredIds="retirement_questionnaire_answered_question_ids",e.RetirementQuestionnaireQuestionSetIds="retirement_questionnaire_question_set_ids",e.RetirementQuestionnaireCreatedTemplateIds="retirement_questionnaire_created_template_ids",e.RetirementWalkthroughVideoPopupDismissed="retirement_walkthrough_video_popup_dismissed",e}({});let c=(e,t,n)=>{let s=(0,r.jE)(),c=["BackendCache",e],{data:d,isLoading:u,isError:m,isSuccess:p}=(0,r.IT)(c,async()=>{let n=await o.A.get(e);return null!==n.value?n.value:t},{...a.gD_(n)?l.Lo:i.gz,retry:!1,refetchOnMount:!0,refetchOnWindowFocus:!1,onError:t=>{console.warn('Failed to fetch cache for key "'.concat(e,'":'),t)}}),y=(0,r.n_)(async t=>(await o.A.set(e,t,a.vUk(-1,n)),t),{onError:t=>{console.error('Failed to set cache for key "'.concat(e,'":'),t)}}),h=null!=d?d:t;return{value:h,setValue:t=>{try{let e=t instanceof Function?t(h):t;s.setQueryData(c,e),y.mutate(e)}catch(t){console.error('Error setting cache for key "'.concat(e,'":'),t)}},isLoading:u,isError:m,isSuccess:p}}},95655:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(57090),r=n(12115),o=n(33624),i=n(92332),l=n(39633),s=n(62346),c=n(74547);let d=e=>{let{value:t="",onChange:n,placeholder:d="e.g., SPY, VOO, VTI",inForm:u=!0}=e,[m]=(0,l.A)(t,300),{data:p=[],isLoading:y}=(0,s.Lp)(m),h=r.useMemo(()=>p.map(e=>({label:"".concat(e.ticker," - ").concat(e.seriesName),value:e.ticker,textValue:e.ticker})),[p]);return(0,a.Y)(c.j9,{inForm:u,value:t,onChange:e=>{let t=(null==e?void 0:e.toUpperCase())||"";null==n||n(t)},items:h,isLoading:y,placeholder:d,allowsCustomValue:!0,allowsEmptyCollection:!0,filterOption:(e,t)=>{let n=t.toLowerCase(),a=p.find(t=>t.ticker===e);return!!a&&(a.ticker.toLowerCase().includes(n)||a.seriesName.toLowerCase().includes(n))},hideSelectorButton:!1,notFoundContent:i.A(t)&&!y&&o.Ime(p)?(0,a.Y)("div",{className:"p-2 text-sm text-neutral-500",children:"No matching tickers found"}):null,"data-sentry-element":"AutoComplete","data-sentry-component":"TrackingTickerInput","data-sentry-source-file":"TrackingTickerInput.tsx"})}},95777:(e,t,n)=>{n.d(t,{B:()=>u,u:()=>d});var a=n(57090);n(12115);var r=n(33624),o=n(35208),i=n(32189),l=n(50202),s=n(74547);let c=e=>{let{selectedPortfolioId:t,filterTypes:n,disabled:o,className:i,onChange:c,optional:d}=e,{portfoliosList:u}=(0,l.RW)(),m=r.pbD(e=>r.mKk(e.portfolioType,n),u),p=r.TjK(e=>({value:e.portfolioId,label:e.portfolioName}),m);return(0,a.Y)(s._P,{className:i,options:p,value:t,onChange:c,style:{width:"100%"},disabled:o,placeholder:d?"Select a portfolio (optional)":"Select a portfolio","data-sentry-element":"Select","data-sentry-component":"PortfolioSelector","data-sentry-source-file":"PortfolioSelector.tsx"})},d=e=>(0,a.Y)(c,{...e,filterTypes:[...o.Zn],"data-sentry-element":"PortfolioSelector","data-sentry-component":"DraftReferencePortfolioSelector","data-sentry-source-file":"PortfolioSelector.tsx"}),u=e=>(0,a.Y)(c,{...e,filterTypes:[i.N$.Current],"data-sentry-element":"PortfolioSelector","data-sentry-component":"CurrentPortfolioSelector","data-sentry-source-file":"PortfolioSelector.tsx"})},95935:(e,t,n)=>{n.d(t,{d:()=>c});var a=n(84245),r=n(9082),o=n(58888),i=n(83731),l=n(70890),s=n(19647);let c=async e=>
3{await Promise.allSettled([await (0,i.No)(e),await e.invalidateQueries(a.u$),(0,l.su)(e),(0,o.gy)(e),e.invalidateQueries(r.N.userPreferences),(0,l.UH)(e),(0,l.DK)(e)]),(0,s.a)()}},96548:(e,t,n)=>{n.d(t,{A:()=>a});var a=function(e){return e.KeepAsManualPortfolio="keep_as_manual_portfolio",e.DeletePortfolio="delete_portfolio",e.KeepAsSingleManualPortfolio="keep_as_single_manual_portfolio",e}({})},96806:(e,t,n)=>{n.d(t,{fu:()=>a.fu,nM:()=>s.nM,lS:()=>m.lS,Au:()=>m.Au,hb:()=>m.hb,Cd:()=>s.Cd,Gc:()=>h,iK:()=>s.iK,Pp:()=>d,gs:()=>m.gs,vV:()=>s.vV,Jz:()=>u.Jz,sr:()=>u.sr,No:()=>f,u4:()=>a.u4,dQ:()=>m.dQ,pN:()=>s.pN});var a=n(52967),r=n(81527),o=n(55805),i=n(73070),l=n(84245),s=n(65782),c=n(91571);let d=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{scenarioId:n}=(0,c.jF)(),{data:d=[],isLoading:u}=(0,s.nM)(n),m=e?{...e,maxYears:10,otherParams:d}:null,p=[...i.ub.SimulationResult,"LiquidityStress",m],y=(0,r.I)({queryKey:p,queryFn:e=>(0,o.vX)(m,e.queryKey),enabled:t&&void 0!==n&&!u&&null!==m,...l.gz});return(0,a.F$)(p,y.data,y.isFetching,y.isError,"scenario_liquidity_stress")};var u=n(16658),m=n(86136),p=n(17667),y=n(62848);let h=()=>{let{scenarioId:e}=(0,c.jF)(),{firstName:t,lastName:n}=(0,y.i3)();return(0,p.A)(async a=>{let r=null!=e?e:(await o.gO.getBaseScenarioId()).scenarioId,i=await o.gO.getAllScenarioParams(r),l={...a,otherParams:i},s=await (0,o.Af)(l),c=new Date().getFullYear(),d=c+(a.lifeExpectancy-a.currentAge),u=(null==t?void 0:t.trim())||"User",m=(null==n?void 0:n.trim())||"",p="PortfolioPilot Scenario details ".concat(c,"-").concat(d," - ").concat(u," ").concat(m,".csv").trim(),y=new Blob([s],{type:"text/csv"}),h=window.URL.createObjectURL(y),f=document.createElement("a");f.href=h,f.download=p,document.body.appendChild(f),f.click(),document.body.removeChild(f),window.URL.revokeObjectURL(h)},{onSuccessMessage:()=>"Download started",onErrorMessage:e=>e})},f=e=>(0,r.I)({queryKey:[...i.ub.ScenarioRiskPreferenceReturns,null==e?void 0:e.portfolioScore,null==e?void 0:e.portfolioRebalanceFrequency,null==e?void 0:e.taxLossHarvesting],queryFn:()=>(0,o.GF)(e),...l.gz,enabled:null!==e})},97077:(e,t,n)=>{n.d(t,{A:()=>b,R:()=>S});var a=n(57090),r=n(12115),o=n(62570),i=n(8921),l=n(64489),s=n(65438),
3c=n(62346),d=n(92672),u=n(14365),m=n(4603),p=n(67759),y=n(84978),h=n(74547),f=n(14219),g=n(81671);let v=(0,o.A)(l.xh,{target:"edqr15i0"})("> button{",(0,d.BK)({width:["100%","auto"]}),"}"),x=(0,o.A)(l.G7,{target:"edqr15i1"})(),A=(0,o.A)(l.G7,{target:"edqr15i2"})(),S=e=>{let{title:t}=e,n=(0,f.v)(m.PortfoliosSyncMode.Manual),r=async()=>{await n.mutateAsync(void 0,{onSuccess:()=>{(0,i.Ds)(i._n.Success,"Accounts synced successfully")}})};return(0,a.Y)(A,{variant:"outlined",disabled:!1,title:t,onClick:r,prefix:(0,a.Y)(l.Fj,{}),"data-sentry-element":"SyncAccountsButton","data-sentry-component":"SyncAccountsWrapper","data-sentry-source-file":"InvestmentAccountsActions.tsx",children:t})},b=()=>{let{value:e,setTrue:t,setFalse:n}=(0,s.A)(!1),{data:o}=(0,c.aV)();return(0,a.FD)(r.Fragment,{children:[(0,a.FD)(v,{"data-sentry-element":"AccountActionsContainer","data-sentry-source-file":"InvestmentAccountsActions.tsx",children:[(0,a.Y)(x,{variant:"outlined",onClick:()=>{(0,p.trackNetworthAssetImporterOpened)({assetType:y.q8.TotalSecurities,source:m.AssetImportSource.InvestmentProfileSettings}),t()},prefix:(0,a.Y)(h.In,{icon:g.$.CirclePlus,size:20}),"data-sentry-element":"AddAccountButton","data-sentry-source-file":"InvestmentAccountsActions.tsx",children:"Add account"}),o&&o.length>0&&(0,a.Y)(S,{title:"Sync accounts"})]}),(0,a.Y)(u.G,{open:e,onClose:()=>{n()},"data-sentry-element":"SecuritiesNetworthAssetImporter","data-sentry-source-file":"InvestmentAccountsActions.tsx"})]})}},97139:(e,t,n)=>{n.d(t,{F6:()=>d,JY:()=>p,PO:()=>s,kn:()=>c,yr:()=>y});var a=n(33624),r=n(78190),o=n(98868),i=n(98804),l=n(62525),s=function(e){return e.BigExpenses="retirement_questionnaire_big_expenses",e.BigInflows="retirement_questionnaire_big_inflows",e.PensionItems="retirement_questionnaire_pension_items",e}({}),c=function(e){return e.Options="options",e.NumberInput="number_input",e.StateSelect="state_select",e.LifeEventTemplates="life_event_templates",e.PensionItems="pension_items",e}({}),d=function(e){return e.Recommended="Recommended",e.Typical="Typical",e}({});let u=[o.R$.NoRisk,o.R$.Conservative,o.R$.ModeratelyConservative,o.R$.ModeratelyAggressive,o.R$.Aggressive,o.R$.VeryAggressive,o.R$.Extreme],m=(e,t)=>{let n=a.qhd(e,u);return n<0?o.R$.Conservative:u[Math.max(0,n-t)]},p=e=>[{id:i.WR.IncludeSpouse,kind:"options",label:"Do you plan your retirement together with a spouse or partner?",hint:"If yes, we model both of you: two timelines, two Social Security checks.",options:[{value:"true",label:"Yes"},{value:"false",label:"No"}]},{id:i.WR.SpouseAge,kind:"number_input",label:"How old is your spouse or partner?",min:18,max:100,placeholder:"Age"},{id:i.WR.SpouseRetirementAge,kind:"number_input",label:"At what age does your spouse or partner plan to stop working?",hint:"Couples often retire within a few years of each other.",min:18,max:100,placeholder:"Age"},{id:i.WR.SpouseIncomeAsHouseholdPercentage,kind:"options",label:"Roughly what share of your household income does your spouse or partner earn?",options:[{value:"0.25",label:"About a quarter"},{value:"0.5",label:"About half"},{value:"0.75",label:"About three quarters"},{value:"0.9",label:"Nearly all of it"}]},{id:i.WR.LifeExpectancy,kind:"options",label:"To what age should we plan for you to live?",hint:"Estimate how long you expect to live. The default is 95, considering improvements in healthcare and longevity. Your plan runs through this age.",options:[{value:"85",label:"85"},{value:"90",label:"90"},{value:"95",label:"95",description:"Typical planning default",tag:"Recommended"},{value:"100",label:"100"}]},{id:i.WR.SocialSecurityBenefitsStartAge,kind:"options",label:"At what age do you plan to start claiming Social Security?",hint:"You can claim as early as 62, but waiting until your full retirement age (66–67, depending on your birth year) or later can increase your benefits.",options:[{value:"62",label:"62",description:"The earliest you can claim"},{value:"65",label:"65"},{value:"67",label:"67",description:"Full retirement age for most people"},{value:"70",label:"70",description:"Maximum benefit"},{value:"not_sure",label:"Not sure yet",description:"We'll assume full retirement age",persistAs:"67"}]},{id:i.WR.SocialSecurityBenefits,kind:"options",label:"Roughly how much do you expect from Social Security each year?",hint:"Your ssa.gov statement has y
3our own estimate. The average retired worker receives roughly $24,000 a year.",options:[{value:"0",label:"Nothing",description:"I won't claim Social Security"},{value:"12000",label:"About $12,000"},{value:"24000",label:"About $24,000",description:"Close to the national average",tag:"Typical"},{value:"36000",label:"About $36,000"},{value:"50000",label:"$50,000 or more"}]},{id:"retirement_questionnaire_pension_items",kind:"pension_items",label:l.wc},{id:i.WR.OtherRetirementIncome,kind:"options",label:"Any other retirement income?",hint:"Not Social Security, and not a pension, annuity, or rental property already in your net worth - those are counted.",options:[{value:"0",label:"None"},{value:"12000",label:"About $12,000 a year"},{value:"25000",label:"About $25,000 a year"},{value:"50000",label:"About $50,000 a year"},{value:"75000",label:"More than $75,000 a year"}]},{id:i.WR.LumpsumPayoutOnRetirement,kind:"options",label:"Do you expect a lump-sum payout when you retire?",hint:"A pension buyout, deferred compensation, or selling a practice all count.",options:[{value:"0",label:"No lump sum"},{value:"50000",label:"About $50,000"},{value:"150000",label:"About $150,000"},{value:"500000",label:"$500,000 or more"}]},{id:i.WR.State,kind:"state_select",label:"Which ".concat(e.residency===r.XM.CAD?"province":"state"," do you live in?"),hint:e.residency===r.XM.CAD?"Provincial tax rates vary widely, so this changes what your plan keeps after tax.":"State taxes matter, and eight states have no income tax at all."},{id:i.WR.SalaryIncreaseYoY,kind:"options",label:"How do you expect your income to grow until you retire?",hint:"Typical raises track inflation.",options:[{value:"0.03",label:"It keeps pace with inflation",description:"About 3% a year",tag:"Typical"},{value:"0.05",label:"A bit faster than inflation",description:"About 5% a year"},{value:"0.07",label:"Considerably faster",description:"7% a year or more"},{value:"0",label:"It won't grow"}]},{id:"retirement_questionnaire_big_expenses",kind:"life_event_templates",label:"Any big one-time expenses ahead?",hint:"Pick any that apply. We'll add them to your plan and you can set the amounts later.",templateIds:["down_payment","college_tuition","kids_wedding","big_trip","home_improvement","purchase_another_property"]},{id:"retirement_questionnaire_big_inflows",kind:"life_event_templates",label:"Any big money likely coming your way?",hint:"Pick any that apply. We'll add them to your plan and you can set the amounts later.",templateIds:["inheritance","sell_business","severance","insurance_proceeds","deferred_compensation"]},{id:i.WR.RetirementRiskPreference,kind:"options",label:"Once you're retired, do you want to take less investment risk?",hint:"The risk level you set during onboarding applies to the years before you retire.",options:(e=>[{value:"keep",label:"Keep it about the same",persistAs:e},{value:"dial_down",label:"Dial it down a little",description:"A step more conservative than you invest today",tag:"Typical",persistAs:m(e,1)},{value:"much_safer",label:"Much more conservative",description:"Protecting what you have becomes the priority",persistAs:o.R$.Conservative},{value:"not_sure",label:"I'm not sure",description:"We'll ease off a little, which is what most people do",persistAs:m(e,1)}])(e.riskPreference)},{id:i.WR.PortfolioRebalanceFrequency,kind:"options",label:"How often do you rebalance your portfolio?",hint:"About once a year is typical.",options:[{value:"quarterly",label:"Every few months"},{value:"yearly",label:"About once a year",tag:"Typical"},{value:"never",label:"Rarely or never"}]},{id:i.WR.PortfolioManagementFee,kind:"options",label:"Do you pay a management fee on your portfolio?",options:[{value:"0",label:"No fee",description:"I manage it myself"},{value:"0.0025",label:"About 0.25%",description:"Typical robo-advisor"},{value:"0.005",label:"About 0.5%"},{value:"0.01",label:"About 1%",description:"Typical human advisor"}]},{id:i.WR.TaxLossHarvesting,kind:"options",label:"How often do you harvest tax losses?",hint:"Realizing losses trims your tax bill. If you have never set this up, pick never.",options:[{value:"monthly",label:"Every month"},{value:"yearly",label:"About once a year",tag:"Typical"},{value:"never",label:"Never, or not sure what this is"}]},{id:i.WR.MaxOutYearlyRothContribution,kind:"options",label:"Do you max out your Roth contributions each year?",hint:"Many savers fill this bucket first.",options:[{value:"true",label:"Yes, most years"},{value:"false",label:"No",description:"Including if you're not eligible"}]},{id:i.WR.DistributionStrategy,kind:"options",label:"When you start drawing down, which accounts should we withdraw from first?",hint:"Most people spend taxable accounts first.",options:[{value:"taxable_first",label:"Tax-efficient withdrawal",description:"Taxable, then tax-deferred, then tax-free",tag:"Typical"},{value:"pro_rata",label:"Proportional withdrawal",description:"Withdraw proportionally from all accounts"},{value:"guardrails",label:"Guardrails withdrawal",description:"Adjusts spending with market conditions, within \xb120% bands"}]}],y=e=>a.vUk(e.value,e.persistAs)},97691:(e,t,n)=>{n.d(t,{L:()=>m});var a=n(57090);n(12115);var r=n(95825),o=n(40248),i=n(28649),l=n(41491),s=n(84461),c=n(4603),d=n(67759),u=n(84978);let m=e=>{let{isDemoMode:t}
3=(0,l._)(),{launchSecuritiesNetworthAssetImporter:n}=(0,s.c)(),m=async()=>{e.onAddAnotherAccount(),await n(),(0,d.trackNetworthAssetImporterOpened)({assetType:u.q8.TotalSecurities,source:c.AssetImportSource.IncompletePortfolioWarning})};return(0,a.Y)(r.Ay,{title:i.qW,centered:!0,open:e.open,destroyOnClose:!0,closable:!0,maskClosable:!1,keyboard:!0,onCancel:e.onIgnore,size:r.rI.Sm,footer:(0,a.FD)(r.jl,{children:[t?(0,a.Y)(o.A,{onClick:e.onKeepDemoPortfolio,variant:"outlined",children:"Keep demo alongside"}):null,(0,a.Y)(o.A,{onClick:m,variant:"filled",children:"Add another account"})]}),"data-sentry-element":"Modal","data-sentry-component":"IncompletePortfolioWarning","data-sentry-source-file":"IncompletePortfolioWarning.tsx",children:(0,a.Y)(i.n6,{warningData:e.warningData,nextStep:t?i.Q7:i.a9,"data-sentry-element":"WarningDescription","data-sentry-source-file":"IncompletePortfolioWarning.tsx"})})}},97765:(e,t,n)=>{n.d(t,{_:()=>o});var a=n(31260),r=n(13340);let o=()=>{let{preferredCurrency:e}=(0,a.yf)();return{preferredCurrency:e,preferredCurrencySymbol:r.IK[e]}}},97780:(e,t,n)=>{n.d(t,{Ay:()=>m,Vi:()=>d,hr:()=>u});var a=n(57090),r=n(12115),o=n(44764),i=n(73285),l=n(54519),s=n(1120),c=n.n(s);let d="PageDataLayer",u=()=>{c().initialize({gtmId:"GTM-5ZW748R",dataLayerName:d})},m=()=>{let{data:e,isSuccess:t}=(0,o.n)(),n=(0,i.w)().asPath;return(0,a.Y)(r.Fragment,{children:(0,l.Sq)(n)?(()=>{if(t&&e){let t="".concat(e.id),n=JSON.stringify(e);c().dataLayer({dataLayer:{page_path:window.location.pathname,user_id:t,user_details:n},dataLayerName:d})}return null})():null})}},98007:(e,t,n)=>{n.d(t,{A:()=>F,w:()=>k});var a=n(57090),r=n(12115),o=n(99026),i=n(43948),l=n(33624),s=n(12919),c=n(61422),d=n(513);let u=()=>(0,a.FD)("div",{className:"flex w-full flex-col gap-4","data-sentry-component":"InvestmentExplorationSkeleton","data-sentry-source-file":"InvestmentExplorationSkeleton.tsx",children:[(0,a.Y)(d.EA,{className:"mx-auto h-7 w-1/2 rounded-md","data-sentry-element":"Skeleton","data-sentry-source-file":"InvestmentExplorationSkeleton.tsx"}),(0,a.FD)("div",{className:"flex flex-col gap-2",children:[(0,a.Y)(d.EA,{className:"h-5 w-28 rounded-md","data-sentry-element":"Skeleton","data-sentry-source-file":"InvestmentExplorationSkeleton.tsx"}),(0,a.Y)(d.EA,{className:"h-4 w-full rounded-md","data-sentry-element":"Skeleton","data-sentry-source-file":"InvestmentExplorationSkeleton.tsx"}),(0,a.Y)(d.EA,{className:"h-4 w-full rounded-md","data-sentry-element":"Skeleton","data-sentry-source-file":"InvestmentExplorationSkeleton.tsx"}),(0,a.Y)(d.EA,{className:"h-4 w-3/4 rounded-md","data-sentry-element":"Skeleton","data-sentry-source-file":"InvestmentExplorationSkeleton.tsx"})]}),(0,a.Y)("div",{"data-testid":"security-skeleton-stats",className:"grid grid-cols-3 gap-x-4 gap-y-6",children:Array.from({length:6}).map((e,t)=>(0,a.FD)("div",{className:"flex flex-col items-center gap-2",children:[(0,a.Y)(d.EA,{className:"h-6 w-20 rounded-md"}),(0,a.Y)(d.EA,{className:"h-4 w-16 rounded-md"})]},t))}),(0,a.Y)(d.er,{className:"mx-auto w-40","data-sentry-element":"SkeletonButton","data-sentry-source-file":"InvestmentExplorationSkeleton.tsx"}),(0,a.FD)("div",{className:"flex flex-col gap-2",children:[(0,a.Y)(d.EA,{className:"h-5 w-32 rounded-md","data-sentry-element":"Skeleton","data-sentry-source-file":"InvestmentExplorationSkeleton.tsx"}),(0,a.Y)(d.EA,{className:"h-64 w-full rounded-lg","data-sentry-element":"Skeleton","data-sentry-source-file":"InvestmentExplorationSkeleton.tsx"})]})]});var m=n(54519),p=n(67883),y=n(84978),h=n(544),f=n(13897),g=n(95392),v=n(39510),x=n(26214),A=n(74547),S=n(5036),b=n(81671);let C=e=>(0,a.FD)(s.tb,{"data-sentry-element":"DrawerFooter","data-sentry-component":"InvestmentExploreFooter","data-sentry-source-file":"InvestmentExploreFooter.tsx",children:[e.addToDraftVisible?(0,a.Y)(S.A,{ticker:e.ticker,text:"Add to draft",heldText:"Change in draft"}):null,(0,a.Y)(A.$n,{variant:e.addToDraftVisible?"outlined":"filled",onClick:e.onViewDetails,disabled:e.isExplorableTickerUnavailable,disabledTooltip:{title:"More details are not available for custom security"},suffix:(0,a.Y)(A.In,{icon:b.$.SquareArrowTopRight}),"data-sentry-element":"Button","data-sentry-source-file":"InvestmentExploreFooter.tsx",children:e.ctaLabel})]}),I=e=>{var t,n;let{data:r,isError:i,isFetching:d,error:A}=(0,f.S)(e.ticker);(0,g.A)(i,A,"Failed to fetch Security exploration details");let{isVariant1:S}=(()=>{let{flagValue:e}=(0,v.$L)(x.mr.Test288AddToDraftSecurityPanel,x.ay.Control);return{isVariant1:e===x.ay.Variant1}})(),b=r?(0,p.yK)(r):null,I=l.gD_(b),w=b?"View ".concat(b," full profile"):"View more details",P=!(0,h.Xw)(e.ticker)||(null==r?void 0:r.assetType)===y.PW.Cash||(null==r?void 0:r.assetType)===y.PW.CashOutsideBrokerage,k=P?null:b,F=S&&!P&&!e.suppressFooterAddToDraft,T=P?null:(0,a.Y)(C,{ticker:e.ticker,addToDraftVisible:F,isExplorableTickerUnavailable:I,ctaLabel:w,onViewDetails:()=>{b&&(0,o.V3)((0,m.RZ)(b))}}),E=()=>{e.onClose()};return(0,a.FD)(s._s,{width:700,title:null!=(t=e.title)?t:"Details",open:!0,onClose:E,destroyOnClose:!0,keyboard:!0,maskClosable:!0,closable:!0,footer:T,"data-sentry-element":"Drawer","data-sentry-component":"InvestmentExplorationSlideover","data-sentry-source-file":"popup.tsx",children:[null!=(n=e.extraInformation)?n:null,d?(0,a.Y)(u,{}):r?(0,a.Y)(c.A,{data:r,netWorthDetail:e.netWorthDetail,fullProfileTicker:k,onExternalSecurityActionInitiated:E,editSecurityOverrideAction:e.editSecurityOverrideAction}):null]})},{useGlobalInvestmentExplorationLaunchEventListener:w,emitGlobalInvestmentExplorationLaunchEvent:P}=(0,i.createEvent)("GlobalInvestmentExplorationLaunchEvent")(),k=()=>({launchInvestmentExploration:async e=>{(0,h._p)(e.ticker)||P(e)}}),F=()=>{let[e,t]=r.useState(null),n=r.useRef(o.lQ);return w(e=>{let{afterClose:a=o.lQ,...r}=e;t(r),n.current=a}),e?(0,a.Y)(I,{...e,onClose:()=>{t(null),n.current(),n.current=o.lQ},"data-sentry-element":"InvestmentExplorationSlideover","data-sentry-component":"GlobalInvestmentExplorationLauncher","data-sentry-source-file":"GlobalInvestmentExplorationLauncher.tsx"}):null}},98687:(e,t,n)=>{n.d(t,{c:()=>a});var a=function(e){return e.Closed="closed",e.Open="open",e}({})},98868:(e,t,n)=>{n.d(t,{J7:()=>i,Mb:()=>
3o,R$:()=>s,UP:()=>r,Xh:()=>l,oF:()=>a});var a=function(e){return e.StronglyDisagree="strongly_disagree",e.Disagree="disagree",e.Agree="agree",e.StronglyAgree="strongly_agree",e}({}),r=function(e){return e.OneToTwoYears="one_to_two_years",e.TwoToFive="two_to_five",e.FiveToFifteen="five_to_fifteen",e.FifteenOrMore="fifteen_or_more",e}({}),o=function(e){return e.Least="least",e.Medium="medium",e.Most="most",e}({}),i=function(e){return e.Beginner="beginner",e.Moderate="moderate",e.Expert="expert",e}({}),l=function(e){return e.VeryUncomfortable="very_uncomfortable",e.Uncomfortable="uncomfortable",e.Comfortable="comfortable",e.VeryComfortable="very_comfortable",e}({}),s=function(e){return e.Conservative="conservative",e.ModeratelyConservative="moderately_conservative",e.ModeratelyAggressive="moderately_aggressive",e.Aggressive="aggressive",e.VeryAggressive="very_aggressive",e.Extreme="extreme",e.NoRisk="no_risk",e}({})},99147:(e,t,n)=>{n.d(t,{du:()=>f,uV:()=>A,j7:()=>y,n_:()=>v,YT:()=>g,c8:()=>m,cy:()=>p,W$:()=>u});var a=n(57090);n(12115);var r=n(62570),o=n(40248),i=n(92672),l=n(85505),s=n(36934),c=n(74547),d=n(81671);let u=e=>(0,a.Y)(s.s9,{...e,"data-sentry-element":"Body2W600","data-sentry-component":"StyledPortfolioTableColumnTitle","data-sentry-source-file":"atoms.tsx"}),m=(0,r.A)(l.A,{target:"eegqf8g0"})("width:100%;&.ant-input-number-disabled input{background-color:",e=>e.theme.colors.white,";color:",e=>e.theme.colors.defaultFontColor,";}"),p=(0,r.A)("span",{target:"eegqf8g1"})("display:flex;align-items:center;justify-content:start;line-height:0;min-width:120px;"),y=(0,r.A)("div",{target:"eegqf8g2"})("display:inline-block;width:100%;font-weight:normal;font-size:16px;line-height:24px;color:",e=>e.theme.colors.defaultFontColor,";"),h=(0,r.A)(o.A,{target:"eegqf8g3"})("border:none;cursor:pointer;"),f=e=>(0,a.Y)(h,{isIconOnly:!0,variant:"outlined",...e,"data-sentry-element":"InvestmentActionButton","data-sentry-component":"CustomizeInvestmentButton","data-sentry-source-file":"atoms.tsx",children:(0,a.Y)(c.In,{icon:d.$.Pencil,className:"text-primary","data-sentry-element":"Icon","data-sentry-source-file":"atoms.tsx"})}),g=(0,r.A)(h,{target:"eegqf8g4"})(),v=(0,r.A)(i.Ah,{target:"eegqf8g5"})("display:flex;justify-content:space-between;",(0,i.BK)({flexDirection:["column","column","column","row","row","row"]}),"  flex-wrap:wrap;"),x=(0,r.A)("span",{target:"eegqf8g6"})(e=>{let t=(e=>{let t=!!e,n=t?String(e):"none";return{display:t?"-webkit-box":"block",webkitLineClamp:n,lineClamp:n,overflow:t?"hidden":"visible"}})(e.lines);return"\n      display: ".concat(t.display,";\n      -webkit-line-clamp: ").concat(t.webkitLineClamp,";\n      line-clamp: ").concat(t.lineClamp,";\n      overflow: ").concat(t.overflow,";\n    ")},"  -webkit-box-orient:vertical;white-space:normal;overflow-wrap:anywhere;"),A=e=>(0,a.Y)(x,{lines:e.lines,className:e.className,"data-sentry-element":"InvestmentLabelText","data-sentry-component":"InvestmentLabel","data-sentry-source-file":"atoms.tsx",children:e.children})},99885:(e,t,n)=>{n.d(t,{n:()=>i});var a=n(12115),r=n(33624),o=n(99026);let i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",[t,n]=a.useState(e),i=r.Bqr(t),l=a.useCallback(e=>n((0,o.Dw)(String(e))),[]);return{textInput:t,trimmedTextInput:i,setTextInput:l,resetTextInput:()=>l(e)}}},99996:(e,t,n)=>{n.d(t,{N:()=>p});var a=n(12115),r=n(33624),o=n(8921),i=n(16933),l=n(6915),s=n(4603),c=n(67759),d=n(18281),u=n(89093),m=n(41491);let p=e=>{let{dataDomain:t,portfolioId:n,onUploadResponseSuccess:p,onUploadResponseError:y}=e,{isDemoMode:h}=(0,m._)(),[f,g]=(0,a.useState)("idle"),{uploaderInstanceRef:v,isFilesEmpty:x,updateFilesList:A,onSubmit:S,resetUploaderInstance:b}=(()=>{let{isGuestSession:e,openGuestUnlockModal:t}=(0,l.Cs)(),n=a.useRef(null),r=()=>!n.current||0===n.current.getFiles().length,[s,c]=a.useState(r),d=async a=>{let{onSuccess:r,onError:l}=a;if(!n.current){console.error("Uploader instance not found"),(0,o.Ds)(o._n.Error,"Upload error",{description:"An unexpected error occurred during file upload."});return}if(e)return void t();
3let s=await n.current.processFiles(),{isAllFilesUploaded:c,uploadedFiles:d,failedFiles:u}=(0,i.B)(s);c?r({uploadedFiles:d}):(console.log(n.current.status),l({failedFiles:u}))};return{uploaderInstanceRef:n,isFilesEmpty:s,updateFilesList:e=>{c(0===e.length)},resetUploaderInstance:()=>{var e;null==(e=n.current)||e.removeFiles({revert:!0}),c(r())},onSubmit:d}})(),C=(e=>{let{dataDomain:t,onFilesListChanged:n,onUploadResponseReceived:a,portfolioId:o}=e,i=u.c$[t];switch(t){case d.SN.Anything:return{remoteServer:{url:i,onUploadResponseReceived:a},statementType:t,portfolioId:o,allowMultiple:!1,allowProcess:!0,onFilesListChanged:n,acceptedFileTypes:[...u.Ie]};case d.SN.Transactions:{let e=!r.gD_(o);return{remoteServer:{url:i,onUploadResponseReceived:a},statementType:t,portfolioId:o,allowMultiple:!0,allowProcess:e,onFilesListChanged:n,acceptedFileTypes:[...u.Ie]}}case d.SN.Brokerage:return{remoteServer:{url:i,onUploadResponseReceived:a},statementType:t,allowMultiple:!1,onFilesListChanged:n,acceptedFileTypes:[...u.cT]};default:throw Error("Invalid data domain: ".concat(t))}})({dataDomain:t,portfolioId:n,onFilesListChanged:e=>{A(e),(0,c.trackStatementsImport)({dataDomain:t,event:s.StatementsImportEvent.FilesListChanged,filesCount:e.length})},onUploadResponseReceived:e=>{let{response:t,isError:n}=e;n?null==y||y(t):null==p||p(t)}}),I=async function(){let{onSuccess:e,onError:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};await S({onSuccess:n=>{let{uploadedFiles:a}=n;g("success"),(0,c.trackStatementsImport)({dataDomain:t,event:s.StatementsImportEvent.FilesUploadSucceeded,filesCount:a.length}),null==e||e({uploadedFiles:a})},onError:e=>{let{failedFiles:a}=e;g("error");let o=r.TjK(e=>({filename:e.file.name,filetype:e.file.type,status:e.status}),a);(0,c.trackStatementsImport)({dataDomain:t,event:s.StatementsImportEvent.FilesUploadFailed,filesCount:o.length,errorStatuses:o}),null==n||n({failedFiles:a})}})},w=r.gD_(n)&&t===d.SN.Transactions||x;return{uploaderInstanceRef:v,uploaderConfig:C,resetUploaderInstance:b,afterUploaderOpened:()=>{(0,c.trackStatementsImport)({dataDomain:t,event:s.StatementsImportEvent.ImporterOpened})},isFilesEmpty:x,disableSubmit:w,onSubmit:I,remoteUploadStatus:f,exitUploader:()=>{g("idle"),b(),(0,c.trackStatementsImport)({dataDomain:t,event:s.StatementsImportEvent.ImporterClosed})},isRemoteUploadSuccess:"success"===f,showPortfolioSelector:(e=>e.dataDomain===d.SN.Transactions||e.dataDomain===d.SN.Anything&&!e.isDemoMode)({dataDomain:t,isDemoMode:h})}}}}]);
4//# debugId=32bb7347-21c9-5412-a286-ba4a8a0ab1f3
5
6//# chunkId=32bb7347-21c9-5412-a286-ba4a8a0ab1f3

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.