PageSourceSearch

https://twprobe.com/_next/static/chunks/17074-9b1b1564280002f7.js

js twprobe.com collected 2026-10-06 09:23:26 UTC 17,799 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[17074],{13993:(e,t,a)=>{a.d(t,{Cw:()=>o,Iz:()=>i,dR:()=>d,x5:()=>n});var s=a(95155),l=a(75909),r=a(12115);function n({children:e,htmlFor:t,sub:a,className:l="",id:r}){return(0,s.jsxs)("label",{id:r,htmlFor:t,className:`block text-sm font-bold text-slate-800 mb-2 ${l}`,children:[e,a&&(0,s.jsx)("span",{className:"ml-2 text-xs font-normal text-slate-500",children:a})]})}function o({label:e,value:t,min:a,max:l,step:i=1,unit:d,onChange:x,sub:c}){let m=(t-a)/(l-a)*100,b=(0,r.useRef)(null),u=(0,r.useId)(),h=(0,r.useId)();return(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-3 mb-2",children:[(0,s.jsx)(n,{id:u,htmlFor:h,sub:c,className:"mb-0 flex-1 min-w-[60%]",children:e}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 bg-slate-50/50 px-3 py-1.5 rounded-lg border border-slate-200 focus-within:border-slate-900 focus-within:ring-4 focus-within:ring-slate-900/10 transition-all shrink-0 ml-auto w-fit hover:border-slate-300",children:[(0,s.jsx)("input",{id:h,type:"number",value:t,onChange:e=>x(Number(e.target.value)),className:"w-20 text-right bg-transparent border-none outline-none text-slate-900 font-bold text-[15px] p-0 focus:ring-0 tabular-nums font-mono"}),d&&(0,s.jsx)("span",{className:"text-slate-500 font-medium text-sm",children:d})]})]}),(0,s.jsxs)("div",{ref:b,className:"relative w-full h-2 bg-slate-200 rounded-full cursor-pointer hover:bg-slate-300 transition-colors group active:scale-[0.98]",onClick:e=>{if(!b.current)return;let t=b.current.getBoundingClientRect(),s=a+Math.max(0,Math.min(e.clientX-t.left,t.width))/t.width*(l-a);i&&(s=Math.round(s/i)*i),x(Math.max(a,Math.min(l,s)))},children:[(0,s.jsx)("div",{className:"absolute top-0 left-0 h-full bg-slate-900 rounded-full pointer-events-none transition-all duration-300 ease-out group-hover:bg-slate-800",style:{width:`${Math.max(0,Math.min(100,m))}%`}}),(0,s.jsx)("input",{"aria-labelledby":u,type:"range",min:a,max:l,step:i,value:t,onChange:e=>x(Number(e.target.value)),className:"absolute top-0 left-0 w-full h-full opacity-0 cursor-pointer z-10"}),(0,s.jsx)("div",{className:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 w-4 h-4 bg-white border-2 border-slate-900 rounded-full shadow-sm pointer-events-none transition-transform group-hover:scale-110 active:scale-95 focus-visible:ring-4 focus-visible:ring-slate-900/20 outline-none",style:{left:`${Math.max(0,Math.min(100,m))}%`}})]}),(0,s.jsxs)("div",{className:"flex justify-between mt-2 text-xs text-slate-500 font-medium px-1 tabular-nums",children:[(0,s.jsxs)("span",{children:[a.toLocaleString("zh-TW")," ",d]}),(0,s.jsxs)("span",{children:[l.toLocaleString("zh-TW")," ",d]})]})]})}function i({label:e,options:t,value:a,onChange:o}){let d=(0,r.useId)();return(0,s.jsxs)("div",{className:"mb-6",children:[e&&(0,s.jsx)(n,{children:e}),(0,s.jsx)("div",{className:"flex p-1 bg-slate-100/80 rounded-xl relative",children:t.map(e=>{let t=a===e.value;return(0,s.jsxs)("button",{type:"button",onClick:()=>o(e.value),className:`relative flex-1 py-1.5 text-sm font-bold rounded-lg transition-all duration-200 z-10 active:scale-[0.98] focus-visible:ring-2 focus-visible:ring-slate-900 outline-none ${t?"text-slate-900":"text-slate-600 hover:text-slate-800 hover:bg-slate-200/50"}`,children:[t&&(0,s.jsx)(l.P.div,{layoutId:d,className:"absolute inset-0 bg-white shadow-xs rounded-lg border border-slate-200/80 -z-10",transition:{type:"spring",bounce:.2,duration:.6}}),e.label]},e.value)})})]})}function d({label:e,description:t,checked:a,onChange:l}){return(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"text-sm font-bold text-slate-800",children:e}),t&&(0,s.jsx)("span",{className:"text-xs text-slate-500 mt-1 leading-relaxed",children:t})]}),(0,s.jsx)("button",{type:"button",onClick:()=>l(!a),className:`relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-slate-900 focus:ring-offset-2 ${a?"bg-slate-900":"bg-slate-200"}`,role:"switch","aria-checked":a,children:(0,s.jsx)("span",{"aria-hidden":"true",className:`pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${a?"translate-x-5":"translate-x-0"}`})})]})}},17074:(e,t,a)=>{a.r(t),a.d(t,{default:()=>b});var s=a(95155),l=a(2501),r=a(64962),n=a(35484),o=a(12115),i=a(76105),d=a(13993),x=a(64086),c=a(21831);function m(e,t=0){let a=Number(e);return Number.isFinite(a)&&!Number.isNaN(a)?a:t}function b(){let[e,t]=(0,o.useState)(!1),[a,b]=(0,o.useState)(!0),[u,h]=(0,o.useState)({appraisal:1500,unpaidBalance:500,desiredLoan:0,monthlySalary:1e5,otherMonthlyDebt:0,loanRate:2.185,loanYears:30});(0,o.useEffect)(()=>{t(!0);let e=!0;return fetch("/api/twp/rate").then(e=>e.json()).then(t=>{e&&t?.rates?.mortgageFloor&&h(e=>({...e,loanRate:t.rates.mortgageFloor}))}).catch(console.error).finally(()=>{e&&b(!1)}),()=>{e=!1}},[]);let f=e=>{let t=Number(e);return Number.isFinite(t)&&!Number.isNaN(t)?Math.max(0,t):0},p=(e,t)=>{h(a=>({...a,[e]:t}))},g=(0,o.useMemo)(()=>(function(e){let t=Math.max(0,m(e.appraisal)),a=Math.max(0,m(e.unpaidBalance)),s=null!==e.desiredLoan&&void 0!==e.desiredLoan&&m(e.desiredLoan,-1)>=0?m(e.desiredLoan):-1,l=Math.max(0,m(e.monthlySalary)),r=Math.max(0,m(e.otherMonthlyDebt)),n=Math.max(0,m(e.loanRate)),o=Math.max(0,m(e.loanYears));if(t<=0||l<=0)return{maxLoanAmount:0,maxEquitySpace:0,actualEquityLoan:0,newMortgagePayment:0,totalMonthlyDebt:0,dbr:0};
1let i=.8*t,d=Math.max(0,i-a),x=0,c=a+(x=s>=0?Math.min(s,d):d),b=0;if(c>0&&o>0){let e=1e4*c,t=n/100/12,a=12*o;if(t>0){let s=(1+t)**a,l=s-1;b=l>0?t*s*e/l:e/a}else b=e/a}let u=b+r,h=e=>Number.isFinite(e)&&!Number.isNaN(e)?e:0;return{maxLoanAmount:Math.round(100*h(i))/100,maxEquitySpace:Math.round(100*h(d))/100,actualEquityLoan:Math.round(100*h(x))/100,newMortgagePayment:Math.round(h(b)),totalMonthlyDebt:Math.round(h(u)),dbr:Math.round(100*h(l>0?u/l*100:0))/100}})({appraisal:f(u.appraisal),unpaidBalance:f(u.unpaidBalance),desiredLoan:u.desiredLoan?f(u.desiredLoan):void 0,monthlySalary:Math.max(1,f(u.monthlySalary)),otherMonthlyDebt:f(u.otherMonthlyDebt),loanRate:f(u.loanRate),loanYears:Math.max(1,f(u.loanYears))}),[u]);return e?(0,s.jsx)(i.Z,{children:(0,s.jsx)(c.default,{title:"",subtitle:"",icon:l.A,children:(0,s.jsx)(x.X,{inputs:(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("h3",{className:"font-bold text-slate-900 flex items-center gap-2 border-b border-slate-100 pb-2.5",children:[(0,s.jsx)("span",{className:"w-1.5 h-5 bg-slate-900 rounded-full inline-block"}),"增貸條件設定"]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(d.Cw,{label:"銀行保守鑑價",value:u.appraisal,min:100,max:2e4,step:50,unit:"萬元",onChange:e=>p("appraisal",e)}),(0,s.jsx)(d.Cw,{label:"原房貸未繳餘額",value:u.unpaidBalance,min:0,max:2e4,step:10,unit:"萬元",onChange:e=>p("unpaidBalance",e)}),(0,s.jsx)(d.Cw,{label:"欲增貸金額",sub:"設為 0 表示直接貸滿上限",value:u.desiredLoan||0,min:0,max:1e4,step:10,unit:"萬元",onChange:e=>p("desiredLoan",e)}),(0,s.jsx)("div",{className:"h-px bg-slate-200/80 my-4"}),(0,s.jsx)(d.Cw,{label:"申請人月薪",value:u.monthlySalary,min:2e4,max:1e6,step:5e3,unit:"元",onChange:e=>p("monthlySalary",e)}),(0,s.jsx)(d.Cw,{label:"其他月負債",value:u.otherMonthlyDebt,min:0,max:5e5,step:1e3,unit:"元",onChange:e=>p("otherMonthlyDebt",e)}),(0,s.jsx)("div",{className:"h-px bg-slate-200/80 my-4"}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(d.Cw,{label:a?"增貸預估利率 (Syncing...)":"增貸預估利率",value:u.loanRate,min:1,max:10,step:.01,unit:"%",onChange:e=>p("loanRate",e)}),(0,s.jsx)(d.Cw,{label:"還款年限",value:u.loanYears,min:1,max:40,step:1,unit:"年",onChange:e=>p("loanYears",e)})]})]})]}),results:g?(0,s.jsxs)("div",{className:"space-y-6 h-full flex flex-col",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("h3",{className:"font-bold text-slate-900 flex items-center gap-2 border-b border-slate-100 pb-2.5 mb-4",children:[(0,s.jsx)("span",{className:"w-1.5 h-5 bg-slate-900 rounded-full inline-block"}),"增貸額度與壓力測試結果"]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-4",children:[(0,s.jsxs)("div",{className:"bg-white border border-slate-200/90 rounded-2xl p-4 shadow-2xs space-y-1",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-slate-500 block",children:"銀行最高核貸額 (8成)"}),(0,s.jsxs)("span",{className:"text-xl font-bold text-slate-900 font-mono tabular-nums",children:[g.maxLoanAmount.toLocaleString()," ",(0,s.jsx)("span",{className:"text-xs font-normal text-slate-500",children:"萬元"})]})]}),(0,s.jsxs)("div",{className:"bg-white border border-slate-200/90 rounded-2xl p-4 shadow-2xs space-y-1",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-slate-500 block",children:"增貸後總房貸月付金"}),(0,s.jsxs)("span",{className:"text-xl font-bold text-blue-600 font-mono tabular-nums",children:["NT$ ",g.newMortgagePayment.toLocaleString()]})]})]})]}),(0,s.jsxs)("div",{className:"bg-white border border-slate-200/90 rounded-2xl p-5 shadow-2xs space-y-4",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center pb-3 border-b border-slate-100",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(r.A,{className:"text-emerald-600 w-5 h-5 shrink-0"}),(0,s.jsx)("span",{className:"font-bold text-slate-900 text-sm",children:"實際可核發增貸金"})]}),(0,s.jsxs)("span",{className:"text-2xl font-black text-emerald-600 font-mono tabular-nums",children:[g.actualEquityLoan.toLocaleStr
1ing()," ",(0,s.jsx)("span",{className:"text-sm font-normal text-slate-600",children:"萬元"})]})]}),(0,s.jsxs)("div",{className:"text-xs text-slate-500 flex justify-between items-center",children:[(0,s.jsx)("span",{children:"銀行極限增貸空間"}),(0,s.jsxs)("span",{className:"font-mono tabular-nums font-semibold text-slate-700",children:[g.maxEquitySpace.toLocaleString()," 萬元"]})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center pt-3 border-t border-slate-100",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(n.A,{className:`w-5 h-5 shrink-0 ${g.dbr>60?"text-rose-600":g.dbr>40?"text-amber-500":"text-emerald-600"}`}),(0,s.jsx)("span",{className:"font-bold text-slate-900 text-sm",children:"收支比 DBR (風險指標)"})]}),(0,s.jsxs)("span",{className:`text-2xl font-black font-mono tabular-nums ${g.dbr>60?"text-rose-600":g.dbr>40?"text-amber-600":"text-emerald-600"}`,children:[g.dbr,"%"]})]})]}),(0,s.jsxs)("div",{className:"mt-auto pt-2 space-y-3",children:[g.maxEquitySpace<=0&&(0,s.jsxs)("div",{className:"bg-rose-50 border-l-4 border-rose-500 p-3.5 rounded-xl text-sm text-rose-800",children:[(0,s.jsx)("b",{children:"[無增貸空間]"})," 目前原房貸未繳餘額已超過銀行估值 8 成,無法透過房屋辦理增貸。"]}),g.maxEquitySpace>0&&g.actualEquityLoan<f(u.desiredLoan)&&(0,s.jsxs)("div",{className:"bg-amber-50 border-l-4 border-amber-500 p-3.5 rounded-xl text-sm text-amber-800",children:[(0,s.jsx)("b",{children:"[額度受限警告]"})," 你的「欲增貸金額」大於銀行極限增貸空間 (",(0,s.jsx)("span",{className:"font-mono tabular-nums font-bold",children:g.maxEquitySpace})," ","萬元)。本次試算已自動調整為銀行極限核發額度。"]}),g.dbr>60?(0,s.jsxs)("div",{className:"bg-rose-50 border-l-4 border-rose-500 p-3.5 rounded-xl text-sm text-rose-800",children:[(0,s.jsx)("b",{children:"[核貸高風險警告]"})," 你的總收支比高達"," ",(0,s.jsxs)("span",{className:"font-mono tabular-nums font-bold",children:[g.dbr,"%"]}),",已超過銀行普遍認定的安全線 (60%)。銀行極有可能拒絕增貸或降低額度。"]}):g.dbr>40?(0,s.jsxs)("div",{className:"bg-amber-50 border-l-4 border-amber-500 p-3.5 rounded-xl text-sm text-amber-800",children:[(0,s.jsx)("b",{children:"[核貸邊緣注意]"})," 收支比落在"," ",(0,s.jsxs)("span",{className:"font-mono tabular-nums font-bold",children:[g.dbr,"%"]}),"。貸款雖有機會核准,但可能會影響利率條件,建議整理其他財力證明。"]}):(0,s.jsxs)("div",{className:"bg-emerald-50 border-l-4 border-emerald-500 p-3.5 rounded-xl text-sm text-emerald-800",children:[(0,s.jsx)("b",{children:"[優良收支比]"})," 你的收支比為"," ",(0,s.jsxs)("span",{className:"font-mono tabular-nums font-bold",children:[g.dbr,"%"]}),",在銀行眼中屬於優質貸款人,有很高機率可以取得最佳增貸條件。"]})]})]}):(0,s.jsx)("div",{className:"flex items-center justify-center h-full text-slate-400",children:"請在左側輸入數值開始試算"})})})}):(0,s.jsxs)("div",{className:"animate-pulse flex flex-col lg:flex-row gap-6 lg:gap-8 w-full",children:[(0,s.jsxs)("div",{className:"flex-1 w-full lg:min-w-[300px] space-y-6",children:[(0,s.jsx)("div",{className:"h-[220px] bg-slate-100 rounded-xl w-full"}),(0,s.jsx)("div",{className:"h-[220px] bg-slate-100 rounded-xl w-full"}),(0,s.jsx)("div",{className:"h-[180px] bg-slate-100 rounded-xl w-full"})]}),(0,s.jsxs)("div",{className:"flex-1 w-full lg:min-w-[350px] space-y-6",children:[(0,s.jsx)("div",{className:"h-[160px] bg-slate-100 rounded-xl w-full"}),(0,s.jsx)("div",{className:"h-[100px] bg-slate-100 rounded-xl w-full"}),(0,s.jsx)("div",{className:"h-[240px] bg-slate-100 rounded-xl w-full"})]})]})}},64086:(e,t,a)=>{a.d(t,{S:()=>r,X:()=>n});var s=a(95155),l=a(75909);function r({label:e,value:t,unit:a,subValue:n,variant:o="primary",className:i=""}){let d={primary:{bg:"bg-white",border:"border-slate-200/90 shadow-xs border-l-4 border-l-blue-600",label:"text-slate-800",value:"text-blue-600 font-black",sub:"text-slate-500"},secondary:{bg:"bg-slate-50/70",border:"border-slate-200 shadow-2xs",label:"text-slate-600",value:"text-slate-900 font-bold",sub:"text-slate-500"},info:{bg:"bg-slate-100/70",border:"border-slate-200 border-l-4 border-l-blue-600",label:"text-slate-900",value:"text-blue-600 font-black",sub:"text-slate-600"},warning:{bg:"bg-slate-100/70",border:"border-slate-200 border-l-4 border-l-amber-500",label:"text-slate-900",value:"text-amber-700 font-black",sub:"text-slate-600"},danger:{bg:"bg-slate-100/70",border:"border-slate-200 border-l-4 border-l-rose-600",label:"text-slate-900",value:"text-rose-700 font-black",sub:"text-slate-600"},alert:{bg:"bg-slate-100/70",border:"border-slate-200 border-l-4 border-l-rose-600",label:"text-slate-900",value:"text-rose-700 font-black",sub:"text-slate-600"},success:{bg:"bg-slate-100/70",border:"border-slate-200 border-l-4 border-l-emerald-600",label:"text-slate-900",value:"text-emerald-700 font-black",sub:"text-slate-600"}},x=d[o]||d.primary;return(0,s.jsxs)(l.P.div,{initial:{opacity:0,y:5}
1,animate:{opacity:1,y:0},transition:{duration:.3},className:`p-4 sm:p-5 rounded-2xl border ${x.bg} ${x.border} transition-colors duration-300 min-w-0 ${i}`,children:[(0,s.jsx)("div",{className:`text-sm font-bold mb-2 ${x.label} leading-snug`,title:e,children:e}),(0,s.jsxs)("div",{className:`text-xl sm:text-2xl lg:text-3xl font-black tracking-tight flex items-baseline flex-nowrap whitespace-nowrap overflow-hidden tabular-nums font-mono ${x.value} min-w-0`,children:[(0,s.jsx)("span",{className:"truncate",children:t}),a&&(0,s.jsx)("span",{className:"text-sm font-bold ml-1 shrink-0 font-sans",children:a})]}),n&&(0,s.jsx)("div",{className:`mt-2 text-sm font-semibold tabular-nums font-mono ${x.sub}`,children:n})]})}function n({inputs:e,results:t}){return(0,s.jsxs)("div",{className:"flex flex-col gap-8 max-w-7xl mx-auto w-full",children:[(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)("div",{className:"bg-white rounded-3xl border border-slate-200/60 shadow-sm p-6 sm:p-8",children:(0,s.jsx)("div",{className:"max-w-3xl mx-auto w-full",children:e})})}),(0,s.jsx)("div",{className:"w-full flex flex-col gap-6",children:t})]})}},76105:(e,t,a)=>{a.d(t,{Z:()=>r});var s=a(95155),l=a(12115);class r extends l.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center p-12 bg-slate-50/50 rounded-3xl border border-slate-200 shadow-sm mt-6 min-h-[300px] text-center",children:[(0,s.jsx)("div",{className:"w-16 h-16 bg-white rounded-2xl shadow-sm border border-slate-100 flex items-center justify-center mb-6",children:(0,s.jsx)("svg",{className:"w-8 h-8 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),(0,s.jsx)("h3",{className:"text-lg font-bold text-slate-800 mb-2",children:"計算模組暫時無法使用"}),(0,s.jsx)("p",{className:"text-slate-500 max-w-sm mb-6 text-sm leading-relaxed",children:"輸入的數值可能超出了安全運算範圍,或引發了例外情況。請重新整理頁面後再試一次。"}),(0,s.jsx)("button",{onClick:()=>window.location.reload(),className:"px-6 py-2.5 bg-white border border-slate-200 text-slate-700 font-semibold text-sm rounded-xl hover:bg-slate-50 active:scale-[0.98] transition-all shadow-sm focus-visible:ring-2 focus-visible:ring-slate-500 outline-none",children:"重新整理頁面"})]}):this.props.children}}}}]);

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.