PageSourceSearch

https://twprobe.com/_next/static/chunks/49888-ba31f9f77a1a4911.js

js twprobe.com collected 2026-10-06 09:22:59 UTC 7,719 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[49888],{49888:(e,s,a)=>{a.r(s),a.d(s,{default:()=>f});var l=a(95155),t=a(33546),n=a(93954),r=a(35484),i=a(14577),d=a(64962),o=a(12115),c=a(99003),m=a(76105),x=a(13993),u=a(64086),h=a(21831),b=a(87459);let j=e=>{let s=Number(e);return Number.isFinite(s)?Math.max(0,s):0};var v=a(42743);let N=v.Ik({housePrice:v.ai().min(0,"房屋總價不能為負數"),renovationCost:v.ai().min(0,"裝潢成本不能為負數"),monthlyRent:v.ai().min(0,"月租金不能為負數"),monthlyManagementFee:v.ai().min(0,"每月管理費不能為負數"),vacancyRate:v.ai().min(0).max(100,"空置率不能大於 100")}),p=e=>{let s=Number(e);return Number.isFinite(s)?Math.max(0,s):0};function f(){let[e,s]=(0,o.useState)(!1),[a,v]=(0,o.useState)(null),{handleSubmit:f,watch:g,setValue:y}=(0,c.mN)({resolver:(0,t.u)(N),defaultValues:{housePrice:1500,renovationCost:150,monthlyRent:3e4,monthlyManagementFee:2500,vacancyRate:5}}),w=e=>{let s={housePrice:p(e.housePrice),renovationCost:p(e.renovationCost),monthlyRent:p(e.monthlyRent),monthlyManagementFee:p(e.monthlyManagementFee),vacancyRate:p(e.vacancyRate)};0===s.housePrice&&0===s.renovationCost?v({isValid:!1,grossYield:0,netYield:0,annualGrossRent:0,annualNetRent:0,status:"low",isVacancyRateLow:!1}):v(function(e){let s=1e4*j(e.housePrice),a=1e4*j(e.renovationCost),l=j(e.monthlyRent),t=j(e.monthlyManagementFee),n=Math.min(1,Math.max(0,j(e.vacancyRate)/100)),r=s+a;if(s<=0||l<=0||r<=0)return{grossYield:0,netYield:0,annualGrossRent:0,annualNetRent:0,status:"low",isVacancyRateLow:!1,isValid:!1};let i=12*l,d=(l-t)*12*(1-n),o=s>0?i/s*100:0,c=r>0?d/r*100:0,m=Number.isFinite(o)?Number(o.toFixed(2)):0,x=Number.isFinite(c)?Number(c.toFixed(2)):0,u=Number.isFinite(i)?Math.round(i):0,h=Number.isFinite(d)?Math.round(d):0,b="low";return x>=4?b="high":x>=2&&(b="medium"),{grossYield:m,netYield:x,annualGrossRent:u,annualNetRent:h,status:b,isVacancyRateLow:n<.05,isValid:!0}}(s))},R=(0,b.Qb)("yield",g(),e=>{for(let[s,a]of Object.entries(e))y(s,a)});return((0,o.useEffect)(()=>{s(!0),f(w)()},[]),(0,o.useEffect)(()=>{if(!e)return;let s=g(()=>f(w)());return()=>s.unsubscribe()},[g,f,e]),e)?(0,l.jsx)(h.default,{toolType:"yield",toolInput:R,title:"",children:(0,l.jsx)(m.Z,{children:(0,l.jsx)(u.X,{inputs:(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-4 text-slate-900 font-bold border-b pb-2 border-slate-200/90",children:[(0,l.jsx)("div",{className:"w-1.5 h-5 bg-slate-900 rounded-full inline-block"}),(0,l.jsx)("span",{children:"租賃投資試算參數"})]}),(0,l.jsx)(x.Cw,{label:"房屋總價",value:g("housePrice"),min:0,max:1e4,step:50,unit:"萬元",onChange:e=>y("housePrice",e)}),(0,l.jsx)(x.Cw,{label:"裝潢與買賣稅費成本",value:g("renovationCost"),min:0,max:1e3,step:10,unit:"萬元",onChange:e=>y("renovationCost",e)}),(0,l.jsx)(x.Cw,{label:"預期每月租金收入",value:g("monthlyRent"),min:0,max:2e5,step:1e3,unit:"元",onChange:e=>y("monthlyRent",e)}),(0,l.jsx)(x.Cw,{label:"每月管理費",value:g("monthlyManagementFee"),min:0,max:2e4,step:100,unit:"元",onChange:e=>y("monthlyManagementFee",e)}),(0,l.jsx)(x.Cw,{label:"年化空置率",sub:"(預設 5%:每年約空租半個月)",value:g("vacancyRate"),min:0,max:50,step:1,unit:"%",onChange:e=>y("vacancyRate",e)})]}),results:a?.isValid?(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-4 text-slate-900 font-bold border-b pb-2 border-slate-200/90",children:[(0,l.jsx)("div",{className:"w-1.5 h-5 bg-slate-900 rounded-full inline-block"}),(0,l.jsx)("span",{children:"淨報酬率試算結果"})]}),(0,l.jsxs)("div",{className:"bg-white border border-slate-200/90 rounded-2xl p-6 shadow-2xs space-y-3",children:[(0,l.jsxs)("div",{className:"text-slate-900 font-extrabold flex items-center gap-1.5 text-xs uppercase tracking-wider",children:[(0,l.jsx)(n.A,{className:"w-4 h-4 text-blue-600"}),"真實淨投報率 (CAP Rate)"]}),(0,l.jsxs)("div",{className:"text-3xl sm:text-4xl font-black text-emerald-600 font-mono tabular-nums",children:[a.netYield,"%"]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,l.jsx)(u.S,{label:"表面毛投報率 (Gross Yield)",value:a.grossYield,unit:"%",variant:"secondary"}),(0,l.jsx)(u.S,{label:"真實年化淨租金",value:a.annualNetRent.toLocaleStr
1ing(),unit:"元",subValue:"扣除管理費與空置損失",variant:"secondary"})]}),(0,l.jsxs)("div",{className:"space-y-3",children:["low"===a.status&&(0,l.jsxs)("div",{className:"p-4 bg-slate-50 border-l-4 border-rose-600 rounded-r-xl border border-slate-200/90 flex gap-3",children:[(0,l.jsx)(r.A,{className:"text-rose-600 shrink-0 mt-0.5"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h4",{className:"font-bold text-rose-700",children:"[資金效率偏低]"}),(0,l.jsx)("p",{className:"text-sm text-rose-600/90 mt-1",children:"淨投報率低於 2%,可能產生負向現金流。建議重新評估資產配置,或考慮其他具備抗通膨效益之投資標的。"})]})]}),"medium"===a.status&&(0,l.jsxs)("div",{className:"p-4 bg-slate-50 border-l-4 border-amber-500 rounded-r-xl border border-slate-200/90 flex gap-3",children:[(0,l.jsx)(i.A,{className:"text-amber-600 shrink-0 mt-0.5"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h4",{className:"font-bold text-amber-800",children:"[資金效率中等]"}),(0,l.jsx)("p",{className:"text-sm text-amber-700 mt-1",children:"淨投報率介於 2%~4%,符合都會區市場均值。租金收益可涵蓋基礎利息支出,整體潛在報酬將高度取決於未來之資本利得。"})]})]}),"high"===a.status&&(0,l.jsxs)("div",{className:"p-4 bg-slate-50 border-l-4 border-emerald-500 rounded-r-xl border border-slate-200/90 flex gap-3",children:[(0,l.jsx)(d.A,{className:"text-emerald-600 shrink-0 mt-0.5"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h4",{className:"font-bold text-emerald-800",children:"[資金效率優異]"}),(0,l.jsx)("p",{className:"text-sm text-emerald-700 mt-1",children:"淨投報率超過 4%,具備穩定之正向現金流,屬於超越市場均值的高收益資產。"})]})]}),a.isVacancyRateLow&&(0,l.jsxs)("div",{className:"p-4 bg-slate-50 border-l-4 border-slate-400 rounded-r-xl border border-slate-200/90 flex gap-3",children:[(0,l.jsx)(i.A,{className:"text-slate-600 shrink-0 mt-0.5"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h4",{className:"font-bold text-slate-800",children:"[風險提示]"}),(0,l.jsx)("p",{className:"text-sm text-slate-700 mt-1",children:"你設定的空置率極低。實務上房客退租、修繕、找新房客均需時間成本,建議空置率抓 5%~10% (約每年空半個月至一個月) 較為安全。"})]})]})]})]}):(0,l.jsx)("div",{className:"flex items-center justify-center h-full text-slate-400 font-medium",children:a&&!a.isValid?"請輸入有效的數值":"請在左側輸入數值開始試算"})})})}):(0,l.jsx)(h.default,{toolType:"yield",toolInput:R,title:"",children:(0,l.jsxs)("div",{className:"animate-pulse flex flex-col lg:flex-row gap-6 lg:gap-8 w-full",children:[(0,l.jsxs)("div",{className:"flex-1 w-full lg:min-w-[300px] space-y-6",children:[(0,l.jsx)("div",{className:"h-[220px] bg-slate-100 rounded-xl w-full"}),(0,l.jsx)("div",{className:"h-[220px] bg-slate-100 rounded-xl w-full"}),(0,l.jsx)("div",{className:"h-[180px] bg-slate-100 rounded-xl w-full"})]}),(0,l.jsxs)("div",{className:"flex-1 w-full lg:min-w-[350px] space-y-6",children:[(0,l.jsx)("div",{className:"h-[160px] bg-slate-100 rounded-xl w-full"}),(0,l.jsx)("div",{className:"h-[100px] bg-slate-100 rounded-xl w-full"}),(0,l.jsx)("div",{className:"h-[240px] bg-slate-100 rounded-xl w-full"})]})]})})}}}]);

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.