import{k as he,j as V,t as ue,h as W,m as v,n as a,p as e,f as le,q as ie,i as ae,v as ye,A as C,x as X,s as Se,F as oe}from"./web.Os7kOAdY.js";import{g as re,t as fe}from"./i18n-runtime._BAkvU05.js";var ve=C("<div class=panel style=display:flex;flex-direction:column;gap:14px><div class=tool-grid-2><div class=tool-field><span class=tool-label></span><select class=tool-input></select></div><div class=tool-field><span class=tool-label></span><input class=tool-input type=number></div></div><!$><!/><!$><!/><p class=tool-hint>"),Ce=C("<option>"),Re=C('<div style=overflow-x:auto><table class=tool-table style=width:100%;border-collapse:collapse;font-size:14px><thead><tr style=background:var(--c-bg2,#f5f5f5)><th style=padding:8px;text-align:left></th><th style=padding:8px;text-align:right></th><th style=padding:8px;text-align:right></th><th style=padding:8px;text-align:right></th><th style=padding:8px;text-align:right></th></tr></thead><tbody><!$><!/><tr style="font-weight:bold;border-top:2px solid var(--c-border,#333)"><td style=padding:8px></td><td style=padding:8px;text-align:right>—</td><td style=padding:8px;text-align:right></td><td style=padding:8px;text-align:right>—</td><td style=padding:8px;text-align:right>'),Fe=C('<tr style="border-bottom:1px solid var(--c-border,#e0e0e0)"><td style=padding:8px></td><td style=padding:8px;text-align:right><!$><!/>%</td><td style=padding:8px;text-align:right></td><td style=padding:8px;text-align:right><!$><!/>%</td><td style=padding:8px;text-align:right>'),je=C(`<pre class=tool-pre style=font-size:16px;text-align:center><!$><!/><!$><!/> <!$><!/>
<!$><!/><!$><!/> <!$><!/>
<!$><!/><!$><!/> <!$><!/>`);const se={beijing:{label:"北京",pension:[.08,.16],medical:[.02,.098],unemployment:[.005,.005],injury:[0,.004],maternity:[0,.008],housing:[.12,.12]},shanghai:{label:"上海",pension:[.08,.16],medical:[.02,.095],unemployment:[.005,.005],injury:[0,.0026],maternity:[0,.01],housing:[.07,.07]},guangzhou:{label:"广州",pension:[.08,.16],medical:[.02,.068],unemployment:[.002,.008],injury:[0,.002],maternity:[0,.0085],housing:[.05,.05]},shenzhen:{label:"深圳",pension:[.08,.16],medical:[.02,.06],unemployment:[.003,.007],injury:[0,.002],maternity:[0,.0045],housing:[.05,.05]},hangzhou:{label:"杭州",pension:[.08,.16],medical:[.02,.095],unemployment:[.005,.005],injury:[0,.003],maternity:[0,.01],housing:[.12,.12]}};function ke(){const[de,Y]=V(re(),{equals:!1}),l=i=>fe(i,de());ue(()=>{const i=t=>{const g=t.detail?.locale;g&&Y(g)};window.addEventListener("taitan:locale-change",i),Y(re()),Se(()=>window.removeEventListener("taitan:locale-change",i))});const[Z,ge]=V("beijing"),[ee,pe]=V("10000"),$e=W(()=>se[Z()]),te=W(()=>parseFloat(ee())||0),d=W(()=>{const i=te(),t=$e();if(i<=0)return null;const g=[{name:"养老保险",personalRate:t.pension[0],companyRate:t.pension[1]},{name:"医疗保险",personalRate:t.medical[0],companyRate:t.medical[1]},{name:"失业保险",personalRate:t.unemployment[0],companyRate:t.unemployment[1]},{name:"工伤保险",personalRate:t.injury[0],companyRate:t.injury[1]},{name:"生育保险",personalRate:t.maternity[0],companyRate:t.maternity[1]},{name:"住房公积金",personalRate:t.housing[0],companyRate:t.housing[1]}];let r=0,s=0;const H=g.map(x=>{const F=Math.round(i*x.personalRate*100)/100,_=Math.round(i*x.companyRate*100)/100;return r+=F,s+=_,{...x,personal:F,company:_}});r=Math.round(r*100)/100,s=Math.round(s*100)/100;const R=Math.round((i-r)*100)/100;return{rows:H,totalPersonal:r,totalCompany:s,takeHome:R}});return(()=>{var i=v(ve),t=i.firstChild,g=t.firstChild,r=g.firstChild,s=r.nextSibling,H=g.nextSibling,R=H.firstChild,x=R.nextSibling,F=t.nextSibling,[_,xe]=a(F.nextSibling),ce=_.nextSibling,[ne,_e]=a(ce.nextSibling),be=ne.nextSibling;return e(r,()=>l("城市")),s.addEventListener("change",o=>ge(o.currentTarget.value)),e(s,le(oe,{get each(){return Object.entries(se)},children:([o,n])=>(()=>{var p=v(Ce);return X(p,"value",o),e(p,()=>n.label),p})()})),e(R,()=>l("税前月薪（元）")),x.$$input=o=>pe(o.currentTarget.value),e(i,(()=>{var o=ie(()=>!!d());return()=>o()&&(()=>{var n=v(Re),p=n.firstChild,b=p.firstChild,I=b.firstChild,j=I.firstChild,m=j.nextSibling,E=m.nextSibling,M=E.nextSibling,N=M.nextSibling,h=b.nextSibling,q=h.firstChild,[k,A]=a(q.nextSibling),w=k.nextSibling,z=w.firstChild,O=z.nextSibling,u=O.nextSibling,B=u.nextSibling,D=B.nextSibling;return e(j,()=>l("项目")),e(m,()=>l("个人比例")),e(E,()=>l("个人缴纳")),e(M,()=>l("单位比例")),e(N,()=>l("单位缴纳")),e(h,le(oe,{get each(){return d().rows},children:$=>(()=>{var y=v(Fe),L=y.firstChild,S=L.nextSibling,G=S.firstChild,[f,J]=a(G.nextSibling);f.nextSibling;var P=S.nextSibling,c=P.nextSibling,K=c.firstChild,[T,Q]=a(K.nextSibling);T.nextSibling;var U=c.nextSibling;return e(L,()=>$.name),e(S,()=>($.personalRate*100).toFixed(1),f,J),e(P,()=>$.personal.toFixed(2)),e(c,()=>($.companyRate*100).toFixed(1),T,Q),e(U,()=>$.company.toFixed(2)),y})()}),k,A),e(z,()=>l("合计")),e(u,()=>d().totalPersonal.toFixed(2)),e(D,()=>d().totalCompany.toFixed(2)),n})()})(),_,xe),e(i,(()=>{var o=ie(()=>!!d());return()=>o()&&(()=>{var n=v(je),p=n.firstChild,[b,I]=a(p.nextSibling),j=b.nextSibling,[m,E]=a(j.nextSibling),M=m.nextSibling,N=M.nextSibling,[h,q]=a(N.nextSibling),k=h.nextSibling,A=k.nextSibling,[w,z]=a(A.nextSibling),O=w.nextSibling,[u,B]=a(O.nextSibling),D=u.nextSibling,$=D.nextSibling,[y,L]=a($.nextSibling),S=y.nextSibling,G=S.nextSibling,[f,J]=a(G.nextSibling),P=f.nextSibling,[c,K]=a(P.nextSibling),T=c.nextSibling,Q=T.nextSibling,[U,me]=a(Q.nextSibling);return e(n,()=>l("税前工资:"),b,I),e(n,()=>te().toFixed(2),m,E),e(n,()=>l("元"),h,q),e(n,()=>l("个人五险一金:"),w,z),e(n,()=>d().totalPersonal.toFixed(2),u,B),e(n,()=>l("元"),y,L),e(n,()=>l("到手（扣除五险一金后）:"),f,J),e(n,()=>d().takeHome.toFixed(2),c,K),e(n,()=>l("元"),U,me),n})()})(),ne,_e),e(be,()=>l("注：各城市费率以2024年常见比例为参考，实际以当地社保局公布为准。缴费基数按税前工资简化计算。")),ae(()=>X(s,"value",Z())),ae(()=>X(x,"value",ee())),ye(),i})()}he(["input"]);export{ke as default};
