1import{r as s,j as e}from"./vendor-react-B-3Nmese.js";import{U as N}from"./UnitToggle-B6JqtRZO.js";import{W as v}from"./WeightInput-B8MuOL9S.js";import{N as w}from"./NumberInput-D1f7am_l.js";import{C}from"./CalculatorActions-DJfHY4PV.js";import{M as h}from"./MetricCard-BHs-eCY3.js";import{e as b}from"./nutrition-C6HmhxhA.js";import{a as y,h as W}from"./index-C58_c92U.js";import{aH as S,ag as k,e as D}from"./vendor-icons-BYEb1hwq.js";import"./vendor-misc-PE8KZyAE.js";import"./Tooltip-BpeGUPim.js";import"./data-categories-Ql6VsvhB.js";import"./data-tools-BRC0Gjxf.js";import"./data-blog-CVe_QUdW.js";function O(){const{unit:a,setUnit:f}=y(),[o,n]=s.useState(75),[c,m]=s.useState(165),[l,d]=s.useState(45),[x,u]=s.useState("moderate"),[t,p]=s.useState(()=>b(75,45,"moderate")),g=r=>{r.preventDefault();let i=0;a==="metric"?i=Number(o)||75:i=W(Number(c)||165),p(b(i,Number(l)||0,x))},j=()=>{n(75),m(165),d(45),u("moderate"),p(null)};return e.jsxs("div",{className:"bg-white border border-[#e5e5e7] rounded-2xl p-6 sm:p-8 shadow-sm",children:[e.jsxs("form",{onSubmit:g,className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsx("label",{className:"text-sm font-bold text-[#141414]",children:"Measurement Units"}),e.jsx(N,{unit:a,onChange:f})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsx(v,{unit:a,weightKg:o,weightLbs:c,onWeightKgChange:n,onWeightLbsChange:m,idPrefix:"water",label:"Body Weight"}),e.jsx(w,{id:"water-exercise",label:"Daily Exercise",unit:"Minutes",value:l,onChange:d,min:0,max:360,placeholder:"e.g. 45",tooltipTitle:"Active Exercise Time",tooltipContent:"Minutes of elevated cardiovascular exertion causing fluid loss via perspiration."}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"water-climate",className:"block text-xs font-bold text-[#141414] uppercase tracking-wider mb-1.5",children:"Climate Environment"}),e.jsxs("select",{id:"water-climate",value:x,onChange:r=>u(r.target.value),className:"w-full px-4 py-3 rounded-xl bg-[#f7f7f8] border border-[#e5e5e7] text-sm text-[#141414] font-medium focus:bg-white focus:border-[#d01c17] focus:outline-hidden",children:[e.jsx("option",{value:"moderate",children:"Temperate / Normal"}),e.jsx("option",{value:"hot",children:"Hot, Humid or Dry"})]})]})]}),e.jsx(C,{submitText:"Calculate Daily Hydration",onReset:j})]}),t&&e.jsx("div",{className:"mt-8 pt-6 border-t border-[#e5e5e7]",children:e.jsxs("div",{className:"bg-[#f7f7f8] border border-slate-200 rounded-xl p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[#d01c17] text-xs font-bold uppercase tracking-wider mb-1",children:[e.jsx(S,{className:"w-4 h-4"}),e.jsx("span",{children:"Recommended Daily Fluid Intake"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-baseline gap-2 sm:gap-4 mb-4",children:[e.jsxs("span",{className:"text-4xl sm:text-5xl font-black text-[#141414]",children:[t.liters," ",e.jsx("span",{className:"text-base font-normal text-slate-500",children:"Liters / Day"})]}),e.jsxs("span",{className:"text-lg font-bold text-slate-600",children:["(",t.fluidOunces," fl oz ⢠~",t.glasses8oz," glasses of 8 oz)"]})]}),e.jsx("p",{className:"text-xs sm:text-sm text-[#5f5f67] leading-relaxed mb-4",children:t.recommendation}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 pt-4 border-t border-slate-200",children:[e.jsx(h,{label:"Standard 500ml Water Bottles",value:`~${(t.liters*2).toFixed(1)}`,unit:"bottles / day",icon:e.jsx(k,{className:"w-4 h-4"})}),e.jsx(h,{label:"Exercise Sweat Compensation",value:"Included",subtitle:`${l} mins physical exertion factored in`,icon:e.jsx(D,{className:"w-4 h-4"})})]})]})})]})}export{O as WaterIntakeCalculator};
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.