import{k as K,j as c,t as q,h as N,m as F,n as j,p as n,q as z,i as p,v as D,A as S,x as d,s as H}from"./web.Os7kOAdY.js";import{g as P,t as R}from"./i18n-runtime._BAkvU05.js";var B=S("<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><input class=tool-input type=number step=0.1></div><div class=tool-field><span class=tool-label></span><input class=tool-input type=number step=0.01></div></div><div class=tool-field style=max-width:300px><span class=tool-label></span><input class=tool-input type=number></div><!$><!/><p class=tool-hint>"),G=S("<pre class=tool-pre style=font-size:16px>");function O(){const[k,$]=c(P(),{equals:!1}),o=e=>R(e,k());q(()=>{const e=s=>{const t=s.detail?.locale;t&&$(t)};window.addEventListener("taitan:locale-change",e),$(P()),H(()=>window.removeEventListener("taitan:locale-change",e))});const[m,E]=c("40"),[f,M]=c("7.8"),[v,w]=c("500"),i=N(()=>{const e=parseFloat(m())||0,s=parseFloat(f())||0,t=parseFloat(v())||0;if(e<=0||t<=0)return null;const a=e*s,r=e/t*100,u=a/t;return{totalCost:Math.round(a*100)/100,fuelPer100km:Math.round(r*100)/100,costPerKm:Math.round(u*100)/100}});return(()=>{var e=F(B),s=e.firstChild,t=s.firstChild,a=t.firstChild,r=a.nextSibling,u=t.nextSibling,x=u.firstChild,g=x.nextSibling,_=s.nextSibling,b=_.firstChild,h=b.nextSibling,L=_.nextSibling,[C,T]=j(L.nextSibling),A=C.nextSibling;return n(a,()=>o("加油量（升）")),r.$$input=l=>E(l.currentTarget.value),n(x,()=>o("油价（元/升）")),g.$$input=l=>M(l.currentTarget.value),n(b,()=>o("行驶里程（公里）")),h.$$input=l=>w(l.currentTarget.value),n(e,(()=>{var l=z(()=>!!i());return()=>l()&&(()=>{var y=F(G);return n(y,()=>`油费总计: ${i().totalCost.toFixed(2)} 元
百公里油耗: ${i().fuelPer100km.toFixed(2)} L/100km
每公里费用: ${i().costPerKm.toFixed(2)} 元/km`),y})()})(),C,T),n(A,()=>o("输入一箱油的加油量、当前油价及对应行驶里程，即可得到油耗和费用数据。")),p(()=>d(r,"value",m())),p(()=>d(g,"value",f())),p(()=>d(h,"value",v())),D(),e})()}K(["input"]);export{O as default};
