PageSourceSearch

https://jhasolutions.com/assets/ROICalculator-C0bgADfO.js

js jhasolutions.com collected 2026-10-02 01:36:56 UTC 5,087 bytes, 1 lines download raw bytes

1import{r,j as e}from"./query-vendor-CqOtiPNe.js";import{u as F,L as o}from"./index-CgiuONvO.js";import{I as m}from"./input-oPoHA7Fw.js";import{S as c}from"./slider-DIOeycPW.js";import{u as w}from"./useCurrency-BwCXcmAr.js";import"./react-vendor-Oyj1q24G.js";import"./ui-vendor-C92kXd7i.js";import"./chart-vendor-De-uRwFm.js";import"./index-BdQq_4o_.js";const M=()=>{const{t}=F(),{formatCurrency:a,currencyInfo:u}=w(),[n,p]=r.useState(5e5),[d,h]=r.useState(6e4),[i,g]=r.useState(2e4),[l,j]=r.useState(5),[x,N]=r.useState(3),f=(d-i)*l,v=n*Math.pow(1+x/100,l),b=v-n,y=f+b,I=y/n*100,C=I/l;return e.jsx("div",{className:"space-y-8",children:e.jsxs("div",{className:"grid gap-6 md:grid-cols-2 rtl:md:grid-flow-dense",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"initialInvestment",children:t("tools.initialInvestment")}),e.jsxs("div",{className:"flex gap-2 rtl:flex-row-reverse",children:[e.jsx(m,{id:"initialInvestment",type:"number",value:n,onChange:s=>p(Number(s.target.value)),min:0,max:5e6}),e.jsx("span",{className:"flex items-center text-muted-foreground",children:u.symbol})]}),e.jsx(c,{value:[n],onValueChange:([s])=>p(s),min:0,max:5e6,step:1e4,className:"mt-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a(n)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"annualIncome",children:t("tools.annualIncome")}),e.jsxs("div",{className:"flex gap-2 rtl:flex-row-reverse",children:[e.jsx(m,{id:"annualIncome",type:"number",value:d,onChange:s=>h(Number(s.target.value)),min:0,max:5e5}),e.jsx("span",{className:"flex items-center text-muted-foreground",children:u.symbol})]}),e.jsx(c,{value:[d],onValueChange:([s])=>h(s),min:0,max:5e5,step:5e3,className:"mt-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a(d)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"annualExpenses",children:t("tools.annualExpenses")}),e.jsxs("div",{className:"flex gap-2 rtl:flex-row-reverse",children:[e.jsx(m,{id:"annualExpenses",type:"number",value:i,onChange:s=>g(Number(s.target.value)),min:0,max:5e5}),e.jsx("span",{className:"flex items-center text-muted-foreground",children:u.symbol})]}),e.jsx(c,{value:[i],onValueChange:([s])=>g(s),min:0,max:5e5,step:5e3,className:"mt-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a(i)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"yearsHeld",children:t("tools.yearsHeld")}),e.jsxs("div",{className:"flex gap-2 rtl:flex-row-reverse",children:[e.jsx(m,{id:"yearsHeld",type:"number",value:l,onChange:s=>j(Number(s.target.value)),min:1,max:30}),e.jsx("span",{className:"flex items-center text-muted-foreground",children:t("tools.years")})]}),e.jsx(c,{value:[l],onValueChange:([s])=>j(s),min:1,max:30,step:1,className:"mt-2"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[l," ",t("tools.years")]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"appreciation",children:t("tools.propertyAppreciation")}),e.jsxs("div",{className:"flex gap-2 rtl:flex-row-reverse",children:[e.jsx(m,{id:"appreciation",type:"number",value:x,onChange:s=>N(Number(s.target.value)),min:0,max:15,step:.1}),e.jsx("span",{className:"flex items-center text-muted-foreground",children:"%"})]}),e.jsx(c,{value:[x],onValueChange:([s])=>N(s),min:0,max:15,step:.1,className:"mt-2"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[x.toFixed(1),"% ",t("tools.annually")]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-6 bg-primary/5 rounded-lg border-2 border-primary/20",children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-2",children:t("tools.totalROI")}),e.jsxs("p",{className:"text-4xl font-bold text-primary",children:[I.toFixed(2),"%"]})]}),e.jsxs("div",{className:"p-4 bg-accent/20 rounded-lg border border-accent/30",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:t("tools.annualROI")}),e.jsxs("p",{className:"text-2xl font-semibold text-accent-foreground",children:[C.toFixed(2),"%"]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 bg-muted rounded-lg",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:t("tools.totalProfit")}),e.jsx("p",{className:"text-lg font-semibold",children:a(y)})]}),e.jsxs("div",{className:"p-4 bg-muted rounded-lg",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:t("tools.finalValue")}),e.jsx("p",{className:"text-lg font-semibold",children:a(v)})]}),e.jsxs("div",{className:"p-4 bg-muted rounded-lg",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:t("tools.rentalIncome")}),e.jsx("p",{className:"text-lg font-semibold",children:a(f)})]}),e.jsxs("div",{className:"p-4 bg-muted rounded-lg",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:t("tools.appreciationGain")}),e.jsx("p",{className:"text-lg font-semibold",children:a(b)})]})]})]})]})})};export{M as ROICalculator};

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.