1import{F as x,H as p,J as h,u as f,a as g,b,c as j,r as y,e as v,j as e,f as d,i as N}from"./index-BfBkqBNq.js";import{F as w}from"./FailureDetail-C15zjOsa.js";import{D as F,T as k}from"./DashboardLayout-CA1yfd_w.js";import{f as q}from"./triangle-alert-eBrbmV7z.js";import{r as n}from"./operating-coc-view-whQn7sjq.js";import"./investor-report.functions-CVbeLqGb.js";import{B as P}from"./building-2-BMaXS4Y1.js";import{A as c}from"./arrow-right-B8mhqEms.js";import"./report-xlsx-0elmp6kq.js";import"./x-mOM0OqM8.js";import"./printer--topBers.js";import"./index-Du5FxyQ2.js";import"./PropVaultLogo-CExv2j-M.js";import"./invites.functions-BP_ptYw7.js";import"./mortgage-read.fn-mAiJRyYd.js";const S=x({method:"GET"}).middleware([p]).handler(h("ec9e44b89f7fe8368a7e259d7821a4ca1ecf598088b357fe3cf0a724f65b4966")),l=r=>r==null?"â":q(r),C=r=>r==null?"â":`${r.toFixed(1)}%`,L=r=>r==null?"â":`${r.toFixed(2)}Ã`,O=r=>r==null?"â":`${(r*100).toFixed(1)}%`;function K(){const{user:r,loading:o}=f(),s=g(),{data:t,isLoading:m}=b(),u=j(S);y.useEffect(()=>{!o&&!r&&s({to:"/login"})},[o,r,s]);const a=v({queryKey:["investor-scoped-overview",t?.id??null],enabled:!!r&&!!t?.id,queryFn:()=>u({data:{organizationId:t.id}})});return o||!r?null:e.jsx(F,{children:e.jsxs("div",{className:"mx-auto max-w-5xl space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:"Overview"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t?.name?`Your portfolio in ${t.name}.`:"Your portfolio."})]}),e.jsxs(d,{to:"/investor",className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-xs font-medium text-muted-foreground hover:text-foreground",children:[e.jsx(k,{className:"h-3.5 w-3.5"})," My Portfolio"]})]}),m||a.isLoading?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):a.isError?e.jsxs("div",{className:"rounded-lg border border-border bg-card p-4 text-sm text-muted-foreground",children:["We couldn't load your overview."," ",e.jsx(w,{error:a.error})]}):a.data?e.jsx(R,{data:a.data,isManager:N(t?.role)}):null]})})}function R({data:r,isManager:o}){if(!r.hasEquityStakes)return e.jsxs("div",{className:"rounded-lg border border-border bg-card p-6 text-sm text-foreground",children:[e.jsx("p",{className:"font-medium",children:"No equity positions in this workspace."}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:"Once a property manager links your login to an equity stake here, your holdings will appear on this page."})]});const s=r.capitalPosition.rollup;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{children:[e.jsx("h2",{className:"mb-2 text-sm font-medium text-foreground",children:"Capital position"}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[e.jsx(i,{label:"Contributed",value:l(s.contributed)}),e.jsx(i,{label:"Distributed",value:l(s.distributed)}),e.jsx(i,{label:"Current value",value:l(s.unrealizedValue)}),e.jsx(i,{label:"Blended IRR",value:C(s.irrPct)}),e.jsx(i,{label:"Equity multiple",value:L(s.equityMultiple)}),e.jsx(i,{label:"Cash-on-cash",value:O(n(s).ratio)})]}),n(s).disclosure&&e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:n(s).disclosure}),r.capitalPosition.valuationBasis==="equity_contributed_proxy"&&r.capitalPosition.valuationNote&&e.jsx("p",{className:"mt-2 text-xs italic text-amber-700 dark:text-amber-500",children:r.capitalPosition.valuationNote})]}),r.portfolio==null&&r.noStatementsYetReason&&e.jsx("div",{className:"rounded-lg border border-border bg-card p-4 text-sm text-muted-foreground",children:r.noStatementsYetReason}),r.portfolio&&r.portfolio.properties.length>0&&e.jsxs("section",{children:[e.jsx("h2",{className:"mb-2 text-sm font-medium text-foreground",children:"Your properties"}),e.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-left text-xs uppercase tracking-wide text-muted-foreground",children:[e.jsx("th",{className:"px-4 py-2 font-medium",children:"Property"}),e.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"SF"}),e.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Occupancy"}),e.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Latest month"}),e.jsx("th",{className:"px-4 py-2"})]})}),e.jsx("tbody",{children:r.portfolio.properties.map(t=>e.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[e.jsx("td",{className:"px-4 py-2 font-medium text-foreground",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(P,{className:"h-4 w-4 text-muted-foreground"}),t.name]})}),e.jsx("td",{className:"px-4 py-2 text-right tabular-nums",children:t.sf?t.sf.toLocaleStr
1ing():"â"}),e.jsx("td",{className:"px-4 py-2 text-right tabular-nums",children:t.occupancyPct==null?"â":`${t.occupancyPct.toFixed(1)}%`}),e.jsx("td",{className:"px-4 py-2 text-right text-muted-foreground",children:t.monthLabel||"â"}),e.jsx("td",{className:"px-4 py-2 text-right",children:o?e.jsxs(d,{to:"/properties/$propertyId",params:{propertyId:t.id},className:"inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline",children:["View ",e.jsx(c,{className:"h-3 w-3"})]}):e.jsxs(d,{to:"/properties/$propertyId/investor",params:{propertyId:t.id},className:"inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline",children:["View ",e.jsx(c,{className:"h-3 w-3"})]})})]},t.id))})]})})]})]})}function i({label:r,value:o}){return e.jsxs("div",{className:"rounded-md border border-border bg-background p-3",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:r}),e.jsx("p",{className:"mt-1 text-xl font-semibold text-foreground",children:o})]})}export{K as component};
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.