1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[31160],{31160:(e,t,a)=>{a.r(t),a.d(t,{CHEMISTRIES:()=>g,DEVICE_CELL_V:()=>N,default:()=>$,parseNum:()=>y,parseSigned:()=>w,runEngine:()=>W});var s=a(45993),n=a(75837),l=a(30845),r=a(77771),i=a(35323),o=a(73950),d=a(14552),c=a(50792),u=a(6061),h=a(38372);let m=[{v:1.75,remaining:0},{v:1.85,remaining:.06},{v:1.9,remaining:.12},{v:1.95,remaining:.2},{v:2,remaining:.33},{v:2.05,remaining:.55},{v:2.1,remaining:.8},{v:2.12,remaining:1}],p=[{c:-18,factor:.6},{c:-10,factor:.7},{c:0,factor:.8},{c:5,factor:.85},{c:15,factor:.94},{c:25,factor:1}],g=[{key:"flooded",label:"Flooded lead-acid",cellV:2,packV:12,endV:1.75,dod:(0,h.Rb)("flooded"),peukert:1.25,peukertNote:"Typical range 1.20 to 1.30. This is where the rate effect really bites.",selfPctMonth:5,cRate:.2,curve:m,temp:p,note:"Cheap per watt-hour and heavy. Half the nameplate is all you get to use if you want it to last."},{key:"agm",label:"AGM lead-acid",cellV:2,packV:12,endV:1.75,dod:(0,h.Rb)("agm"),peukert:1.1,peukertNote:"Typical range 1.05 to 1.15. Better under load than a flooded battery.",selfPctMonth:2.5,
1cRate:.3,curve:m,temp:p,note:"Sealed, handles a heavier draw than flooded, still wants a 50% floor for cycle life."},{key:"gel",label:"Gel lead-acid",cellV:2,packV:12,endV:1.75,dod:(0,h.Rb)("gel"),peukert:1.15,peukertNote:"Typical range 1.10 to 1.20.",selfPctMonth:3,cRate:.25,curve:m,temp:p,note:"Fussy about charge voltage, fine on slow steady loads, unhappy with big surges."},{key:"lifepo4",label:"LiFePO4 (lithium iron phosphate)",cellV:3.2,packV:12.8,endV:2.5,dod:(0,h.Rb)("lifepo4"),peukert:1.03,peukertNote:"Typical range 1.02 to 1.05, which is close enough to nothing. That is most of the reason a lithium bank beats a lead one twice its size.",selfPctMonth:2.5,cRate:1,curve:[{v:2.5,remaining:0},{v:2.8,remaining:.03},{v:3,remaining:.06},{v:3.1,remaining:.12},{v:3.15,remaining:.25},{v:3.2,remaining:.55},{v:3.25,remaining:.85},{v:3.3,remaining:.95},{v:3.45,remaining:1}],temp:[{c:-20,factor:.75},{c:-10,factor:.82},{c:0,factor:.88},{c:10,factor:.95},{c:25,factor:1}],note:"Flat voltage almost all the way down, barely cares about the discharge rate, and 80% of the nameplate is genuinely usable."},{key:"liion",label:"Li-ion (NMC, LCO, 18650 packs)",cellV:3.7,packV:3.7,endV:3,dod:(0,h.Rb)("liion"),peukert:1.08,peukertNote:"Typical range 1.05 to 1.10.",selfPctMonth:2.5,
1cRate:1,curve:[{v:3,remaining:0},{v:3.2,remaining:.05},{v:3.4,remaining:.12},{v:3.6,remaining:.25},{v:3.7,remaining:.4},{v:3.8,remaining:.55},{v:3.9,remaining:.7},{v:4,remaining:.83},{v:4.2,remaining:1}],temp:[{c:-20,factor:.7},{c:-10,factor:.8},{c:0,factor:.87},{c:10,factor:.94},{c:25,factor:1}],note:"A sloping voltage curve, so where your device gives up matters more here than with LiFePO4."},{key:"lipo",label:"LiPo (RC and drone packs)",cellV:3.7,packV:14.8,endV:3.2,dod:(0,h.Rb)("lipo"),peukert:1.05,peukertNote:"Typical range 1.03 to 1.08 at sane currents, worse near the printed C limit.",selfPctMonth:3,cRate:10,curve:[{v:3.2,remaining:0},{v:3.4,remaining:.07},{v:3.6,remaining:.2},{v:3.7,remaining:.35},{v:3.8,remaining:.52},{v:3.9,remaining:.68},{v:4,remaining:.82},{v:4.2,remaining:1}],temp:[{c:-20,factor:.65},{c:-10,factor:.78},{c:0,factor:.86},{c:10,factor:.94},{c:25,factor:1}],note:"Land with 20% left. Flying a LiPo flat is how you turn an expensive pack into a puffy paperweight."},{key:"nimh",label:"NiMH (rechargeable AA and AAA)",cellV:1.2,packV:1.2,endV:1,dod:(0,h.Rb)("nimh"),peukert:1.1,peukertNote:"Around 1.10.",selfPctMonth:17,cRate:1,curve:[{v:1,remaining:0},{v:1.1,remaining:.1},{v:1.15,remaining:.25},{v:1.2,remaining:.55},{v:1.25,remaining:.8},{v:1.35,remaining:1}],temp:[{c:-20,factor:.7},{c:0,factor:.85},{c:10,factor:.93},{c:25,factor:1}],note:"Loses 15% to 20% a month just sitting there unless the packet says low self-discharge, in which case it is 1% to 2%."},{key:"alkaline",label:"Alkaline (single-use AA, AAA, 9V)",cellV:1.5,packV:1.5,endV:.8,dod:(0,h.Rb)("alkaline"),peukert:1.2,peukertNote:"Peukert is really a lead-acid curve fit. For alkaline it stands in for a rate effect that is genuinely severe, so treat it as a shape rather than a manufacturer figure.",selfPctMonth:.25,cRate:.1,curve:[{v:.8,remaining:0},{v:.9,remaining:.1},{v:1,remaining:.25},{v:1.1,remaining:.45},{v:1.2,remaining:.65},{v:1.3,remaining:.82},{v:1.5,remaining:1}],temp:[{c:-20,factor:.35},{c:-10,factor:.55},{c:0,factor:.7},{c:10,factor:.87},{c:25,factor:1}],note:"The voltage sags the whole way down, so a fussy device quits long before the chemistry is done."},{key:"coin",label:"Lithium coin cell (CR2032 and friends)",cellV:3,packV:3,endV:2,dod:(0,h.Rb)("coin"),peukert:1.15,peukertNote:"A stand-in for the rate effect, not a published exponent. A CR2032 is rated at roughly 0.2 mA, and it behaves very differently at 10.",selfPctMonth:.08,cRate:.001,curve:[{v:2,remaining:0},{v:2.2,remaining:.05},{v:2.4,remaining:.12},{v:2.6,remaining:.25},{v:2.8,remaining:.6},{v:2.9,remaining:.85},{v:3,remaining:1}],temp:[{c:-20,factor:.6},{c:-10,factor:.75},{c:0,factor:.85},{c:10,factor:.93},{c:25,factor:1}],note:"Shelf life measured in years, but the internal resistance means a 10 mA radio pulse never sees the datasheet capacity."}];function f(e){return g.find(t=>t.key===e)??g[3]}let x=[{name:"12V compressor fridge",val:"55",unit:"W",bus:"dc",dutyMode:"duty",amt:"40"},{name:"LED lighting",val:"8",unit:"W",bus:"dc",dutyMode:"hours",amt:"4"},{name:"Roof fan",val:"25",unit:"W",bus:"dc",dutyMode:"hours",amt:"6"},{name:"Laptop",val:"60",unit:"W",bus:"inv",dutyMode:"hours",amt:"3"},{name:"Starlink",val:"60",unit:"W",bus:"inv",dutyMode:"hours",amt:"8"},{name:"Diesel heater",val:"20",unit:"W",bus:"dc",dutyMode:"hours",amt:"8"},{name:"Water pump",val:"60",unit:"W",bus:"dc",dutyMode:"hours",amt:"0.5"},{name:"Phone charging",val:"12",unit:"W",bus:"dc",dutyMode:"hours",amt:"1.5"},{name:"Anchor light",val:"10",unit:"W",bus:"dc",dutyMode:"hours",amt:"12"},{name:"Raspberry Pi 4",val:"900",unit:"mA",bus:"dc",dutyMode:"duty",amt:"100"},{name:"Arduino Uno",val:"45",unit:"mA",bus:"dc",dutyMode:"duty",amt:"100"},{name:"GPS tracker",val:"75",unit:"mA",bus:"dc",dutyMode:"duty",amt:"100"}],v=[{key:"rv",label:"Van, RV, off-grid",chem:"lifepo4",cap:"100",capUnit:"Ah",volts:"12.8",count:"1",wiring:"parallel",invEff:"88",invIdle:"15",invHours:"24",loads:[{name:"12V compressor fridge",val:"55",unit:"W",bus:"dc",dutyMode:"duty",amt:"40"},{name:"LED lighting",val:"8",unit:"W",bus:"dc",dutyMode:"hours",amt:"4"},{name:"Laptop",val:"60",unit:"W",bus:"inv",dutyMode:"hours",amt:"3"}],blurb:"The answer here is usually days of autonomy rather than hours. Watch the inverter idle row, it is often bigger than the appli
1ance you were asking about."},{key:"marine",label:"Boat house bank",chem:"flooded",cap:"200",capUnit:"Ah",volts:"12",count:"1",wiring:"parallel",invEff:"88",invIdle:"12",invHours:"4",loads:[{name:"Anchor light",val:"10",unit:"W",bus:"dc",dutyMode:"hours",amt:"12"},{name:"Fridge",val:"45",unit:"W",bus:"dc",dutyMode:"duty",amt:"45"},{name:"Instruments and VHF",val:"15",unit:"W",bus:"dc",dutyMode:"hours",amt:"6"}],blurb:"House bank only, keep the starter battery out of this. A night at anchor is the load case worth sizing for, and it is colder on the water than the forecast says."},{key:"ups",label:"UPS or homelab",chem:"agm",cap:"9",capUnit:"Ah",volts:"12",count:"2",wiring:"series",invEff:"90",invIdle:"8",invHours:"24",loads:[{name:"Rack load",val:"400",unit:"W",bus:"inv",dutyMode:"duty",amt:"100"}],blurb:"A UPS runs its load through the inverter at a hard 100% duty, so the Peukert row does real damage here. This is the case where the sticker number is furthest from the truth."},{key:"drone",label:"Drone or RC",chem:"lipo",cap:"5000",capUnit:"mAh",volts:"14.8",count:"1",wiring:"parallel",invEff:"95",invIdle:"0",invHours:"0",loads:[{name:"Cruise draw",val:"250",unit:"W",bus:"dc",dutyMode:"duty",amt:"100"}],blurb:"Flight time, not runtime. The 80% depth of discharge is the whole point, since landing on an empty LiPo is how packs get puffy."},{key:"iot",label:"IoT or embedded",chem:"coin",cap:"225",capUnit:"mAh",volts:"3",count:"1",wiring:"parallel",invEff:"90",invIdle:"0",invHours:"0",loads:[{name:"Radio active",val:"10",unit:"mA",bus:"dc",dutyMode:"duty",amt:"1"},{name:"Sleep",val:"0.1",unit:"mA",bus:"dc",dutyMode:"duty",amt:"99"}],blurb:"Enter the active and sleep states as separate rows. The rate correction is applied per state and weighted by time share, which is the step that stops a pulsed load looking cheaper than it is."},{key:"powerbank",label:"Power bank",chem:"liion",cap:"10000",capUnit:"mAh",volts:"3.7",count:"1",wiring:"parallel",invEff:"88",invIdle:"0",invHours:"0",dod:"100",loads:[{name:"Phone charging",val:"10",unit:"W",bus:"inv",dutyMode:"duty",amt:"100"}],blurb:"The mAh on the case is measured at the 3.7 V cell, not at the 5 V USB port, which is why a 10,000 mAh bank does not fill a 4,000 mAh phone two and a half times. Usable depth is set to 100% here because the rating printed on a bank is already what its protection circuit hands over."}];function b(e){return v.find(t=>t.key===e)??v[0]}function y(e){let t=(0,c.qF)(e);return null!==t&&t>=0?t:null}function w(e){return(0,c.qF)(e)}function k(e,t=2){if(!Number.isFinite(e))return"-";let a=e.toLocaleString("en-US",{maximumFractionDigits:t});return/^-0(?:[.,]0*)?$/.test(a)?a.slice(1):a}function j(e){return Number.isFinite(e)?Math.abs(e)>=1e3?`${k(e/1e3,2)} kWh`:1>Math.abs(e)?`${k(1e3*e,1)} mWh`:`${k(e,1)} Wh`:"-"}let N=3.85;function M(e){return!Number.isFinite(e)||e<=0?"-":e<1/60?`${k(3600*e,0)} seconds`:e<2?`${k(60*e,0)} minutes`:e<72?`${k(e,1)} hours`:e<2160?`${k(e/24,1)} days`:e<17532?`${k(e/730,1)} months`:`${k(e/8766,1)} years`}function A(e,t){let a=e[0],s=e[e.length-1];if(t<=a.x)return a.y;if(t>=s.x)return s.y;for(let a=1;a<e.length;a+=1){let s=e[a-1],n=e[a];if(t<=n.x){let e=n.x-s.x;if(0===e)return n.y;return s.y+(t-s.x)/e*(n.y-s.y)}}return s.y}function C(e,t){return t>=25?1:A(e.temp.map(e=>({x:e.c,y:e.factor})),t)}function W(e){let{e0:t,bankVolts:a,bankAh:s,dodPct:n,cutoffTail:l,peukert
1:r,tempF:i,sohPct:o,states:d,pLoad:c,pConv:u,pIdle:h,selfPctMonth:m}=e;if(!(t>0)||!(c>0)||!(a>0)||!(s>0))return{ok:!1,e0:t,bankVolts:a,bankAh:s,usableWh:0,naiveHours:0,finalHours:0,steps:[],pLoad:c,pConv:u,pIdle:h,pSelf:0,kEff:1,kRaw:1,peukertClamped:!1,cutoffTail:l,dodFloor:1-n/100,cRate:0,peakCRate:0};let p=s/20,g=0,f=0,x=0;for(let e of d){let t=e.battWatts/a;t<=0||e.fraction<=0||(g+=e.fraction*t**r,f+=e.fraction*t,t>x&&(x=t))}let v=f>0&&p>0?g/(p**(r-1)*f):1,b=Math.max(1,v),y=1-n/100,w=Math.max(y,l),j=t*(1-y),N=t*(1-w),M=N/b,A=M*i,C=o/100*A,W=m/100*t/730,S=t/c,V=C/(c+u+h),P=C/(c+u+h+W),R=[];R.push({label:"Nameplate energy",detail:`${k(s,1)} Ah at ${k(a,1)} V, the number every other calculator divides`,wh:0,after:S,kind:"bank"}),y>0&&R.push({label:`Depth of discharge, ${k(n,0)}%`,detail:`The bottom ${k(100*y,0)}% is off limits if you want the cycle life you paid for`,wh:t-j,after:j/c,kind:"bank"}),j-N>1e-4&&R.push({label:"Energy your device cannot reach",detail:"Your gear browns out above the rated cutoff for this pack, so the last slice never gets used",wh:j-N,after:N/c,kind:"bank"}),N-M>1e-4&&R.push({label:`Peukert at your draw rate, exponent ${k(r,2)}`,detail:`${k(s,1)} Ah is a rating at the 20 hour rate (${k(p,2)} A). You are pulling harder, so ${k((b-1)*100,1)}% more capacity is consumed than the arithmetic says`,wh:N-M,after:M/c,kind:"bank"}),M-A>1e-4&&R.push({label:`Temperature, ${k(100*i,0)}% of the 25C rating`,detail:"Cold slows the chemistry down, and the capacity comes back when it warms up",wh:M-A,after:A/c,kind:"bank"}),A-C>1e-4&&R.push({label:`Age, ${k(o,0)}% state of health`,detail:"Manufacturers call 80% the end of life, not the point where it stops working",wh:A-C,after:C/c,kind:"bank"}),u>0&&R.push({label:"Inverter conversion loss",detail:"What the inverter burns turning DC into AC for the loads you put on it",wh:u*P,after:C/(c+u),kind:"load"}),h>0&&R.push({label:"Inverter sitting there switched on",detail:"Drawn whether or not anything is plugged in. On a small bank this row is often the biggest one here",wh:h*P,after:V,kind:"load"}),W>0&&V-P>1e-4&&R.push({label:`Self-discharge, ${k(m,2)}% a month`,detail:"The pack leaking on its own. Irrelevant over a weekend, decisive over a winter",wh:W*P,after:P,kind:"load"});let $=(c+u+h+W)/a;return{ok:!0,e0:t,bankVolts:a,bankAh:s,usableWh:C,naiveHours:S,finalHours:P,steps:R,pLoad:c,pConv:u,pIdle:h,pSelf:W,kEff:b,kRaw:v,peukertClamped:v<1,cutoffTail:l,dodFloor:y,cRate:s>0?$/s:0,peakCRate:s>0?x/s:0}}let S="flex h-9 w-full rounded-md border border-input bg-background px-2 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",V=["Ah","mAh","Wh"],P=["W","A","mA"],R=[-18,-7,4,15,25,35];function $(){var e;
1let t=v[0],a=f(t.chem),c=(0,n.useRef)(1e3),[h,m]=(0,n.useState)(t.key),[p,$]=(0,n.useState)(t.chem),[F,H]=(0,n.useState)(t.cap),[T,L]=(0,n.useState)(t.capUnit),[I,E]=(0,n.useState)(t.volts),[D,U]=(0,n.useState)(t.count),[J,B]=(0,n.useState)(t.wiring),[z,_]=(0,n.useState)(String(a.dod)),[G,Y]=(0,n.useState)(String(a.peukert)),[O,q]=(0,n.useState)(""),[K,Q]=(0,n.useState)("68"),[X,Z]=(0,n.useState)("F"),[ee,et]=(0,n.useState)("100"),[ea,es]=(0,n.useState)(t.invEff),[en,el]=(0,n.useState)(t.invIdle),[er,ei]=(0,n.useState)(t.invHours),[eo,ed]=(0,n.useState)(""),[ec,eu]=(0,n.useState)("4"),[eh,em]=(0,n.useState)("4000"),[ep,eg]=(0,n.useState)(0),[ef,ex]=(0,n.useState)(()=>t.loads.map((e,t)=>({id:t,...e})));(0,n.useEffect)(()=>{let e=new URLSearchParams(window.location.search),t=e.get("m");t&&v.some(e=>e.key===t)&&m(t);let a=e.get("ch");a&&g.some(e=>e.key===a)&&$(a);let s=e.get("c");null!==s&&H(s);let n=e.get("cu");("Ah"===n||"mAh"===n||"Wh"===n)&&L(n);let l=e.get("v");null!==l&&E(l);let r=e.get("n");null!==r&&U(r);let i=e.get("w");("series"===i||"parallel"===i)&&B(i);let o=e.get("d");null!==o&&_(o);let d=e.get("pk");null!==d&&Y(d);let u=e.get("co");null!==u&&q(u);let h=e.get("t");null!==h&&Q(h);let p=e.get("tu");("F"===p||"C"===p)&&Z(p);let f=e.get("sh");null!==f&&et(f);let x=e.get("ie");null!==x&&es(x);let b=e.get("ii");null!==b&&el(b);let y=e.get("ih");null!==y&&ei(y);let w=e.get("pw");null!==w&&ed(w);let k=e.get("sn");null!==k&&eu(k);let j=e.get("dm");null!==j&&em(j);let N=e.get("l");if(N){let e=N.split("|").filter(Boolean),t=e.slice(0,40),a=[],s=c.current;t.forEach((e,t)=>{let n=e.split(",").map(e=>{try{return decodeURIComponent(e)}catch{return e}});if(n.length<6)return;let l=n[2],r=n[3],i=n[4];a.push({id:s+t,name:n[0].slice(0,60),val:n[1],unit:P.includes(l)?l:"W",bus:"inv"===r?"inv":"dc",dutyMode:"duty"===i?"duty":"hours",amt:n[5]})}),a.length>0&&(c.current=s+t.length+1,ex(a),eg(e.length-t.length))}},[]);let ev=f(p),eb=b(h),ey=y(F),ew=y(I),ek=y(D),ej=null===ek?1:Math.min(48,Math.max(1,Math.round(ek))),eN="Wh"!==T,eM=null===ew||ew<=0,eA=null===ey||null===ew||ew<=0?null:"Ah"===T?ey:"mAh"===T?ey/1e3:ey/ew,eC=null===ew?0:"series"===J?ew*ej:ew,eW=null===eA?0:"parallel"===J?eA*ej:eA,eS=eW*eC,eV=eC>0?Math.max(1,Math.round(eC/ev.cellV)):1,eP=ev.endV*eV,eR=y(O),e$=Math.max(0,(e=(null===eR?eP:eR)/eV,A(ev.curve.map(e=>({x:e.v,y:e.remaining})),e))),eF=null!==eR&&eR<eP,eH=y(z),eT=null===eH?ev.dod:Math.min(100,Math.max(1,eH)),eL=y(G),eI=null===eL?ev.peukert:Math.min(1.5,Math.max(1,eL)),eE=null!==eL&&eL!==eI,eD=y(ee),eU=null===eD?100:Math.min(100,Math.max(30,eD)),eJ=w(K),eB=null===eJ?25:"F"===X?(eJ-32)*5/9:eJ,ez=C(ev,eB),e_=eB<0&&("lifepo4"===ev.key||"liion"===ev.key||"lipo"===ev.key),eG=y(ea),eY=null===eG?88:Math.min(99,Math.max(40,eG)),eO=null!==eG&&eG!==eY,eq=y(en)??0,eK=y(er),eQ=null===eK?0:Math.min(24,Math.max(0,eK)),eX=ef.map(e=>{let t=y(e.val),a=y(e.amt),s="hours"===e.dutyMode?24:100,n=null===a?0:Math.min(s,Math.max(0,a)),l="hours"===e.dutyMode?n/24:n/100,r=0;null!==t&&(r="W"===e.unit?t:"A"===e.unit?t*eC:t/1e3*eC);let i="inv"===e.bus?r/(eY/100):r;return{row:e,battWatts:i,fraction:l,dailyWh:i*l*24,clampedAmt:null!==a&&a!==n,bad:null===t&&""!==e.val.trim()}}),eZ=eX.reduce((e,t)=>e+("inv"===t.row.bus?t.battWatts*(eY/100):t.battWatts)*t.fraction,0),e0=eX.reduce((e,t)=>"inv"===t.row.bus?e+t.battWatts*(1-eY/100)*t.fraction:e,0),e1=eQ/24*eq,e2=eX.filter(e=>e.battWatts>0&&e.fraction>0).map(e=>({label:e.row.name,battWatts:e.battWatts,fraction:e.fraction}));e1>0&&eq>0&&e2.push({label:"Inverter idle",battWatts:eq,fraction:eQ/24});let e5={e0:eS,bankVolts:eC,bankAh:eW,dodPct:eT,cutoffTail:e$,peukert:eI,tempF:ez,sohPct:eU,states:e2,pLoad:eZ,pConv:e0,pIdle:e1,selfPctMonth:ev.selfPctMonth*2**((Math.max(eB,-20)-25)/10)},e3=W(e5),e4=eZ<=0&&ef.length>0,e8=e3.ok&&e3.finalHours>=.92*e3.naiveHours,e7=(e3.pLoad+e3.pConv+e3.pIdle+e3.pSelf)*24,e6=y(eo),e9=y(ec)??0,te=null===e6?null:e6*e9*.75,tt=y(eh),ta=null===tt?null:tt/1e3*N,ts=null!==ta&&ta>0&&e3.ok?e3.usableWh*(eY/100)*.85/ta:null,tn=R.map(e=>{let t=W({...e5,tempF:C(ev,e),selfPctMonth:ev.selfPctMonth*2**((e-25)/10)});return{c:e,hours:t.finalHours,ok:t.ok}});function tl(e,t){ex(a=>a.map(a=>a.id===e?{...a,...t}:a))}function tr(e){ex(t=>{if(t.length>=40)return t;let a=c.current;return c.current+=1,[...t,e?{id:a,...e}:{id:a,name:"New load",val:"",unit:"W",bus:"dc",dutyMode:"hours",amt:"1"}]})}let ti=ef.length>=40;return(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(i.J,{children:"What are you working out"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:v.map(e=>(0,s.jsx)(r.$,{type:"button",size:"sm",variant:h===e.key?"default":"outline",onClick:()=>(function(e){let t=b(e),a=f(t.chem);m(e),$(t.chem),H(t.cap),L(t.capUnit),E(t.volts),U(t.count),B(t.wiring),_(t.dod??String(a.dod
1)),Y(String(a.peukert)),q(""),et("100"),es(t.invEff),el(t.invIdle),ei(t.invHours),eg(0);let s=c.current;c.current+=t.loads.length,ex(t.loads.map((e,t)=>({id:s+t,...e})))})(e.key),children:e.label},e.key))}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:eb.blurb})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)(i.J,{children:"The battery"}),(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(i.J,{htmlFor:"blc-chem",className:"text-xs text-muted-foreground",children:"Chemistry"}),(0,s.jsx)("select",{id:"blc-chem",className:S,value:p,onChange:e=>(function(e){let t=f(e);$(e),_(String(t.dod)),Y(String(t.peukert)),q("");let a=y(I);(null===a||a<=0)&&E(String(t.packV))})(e.target.value),children:g.map(e=>(0,s.jsx)("option",{value:e.key,children:e.label},e.key))}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:ev.note})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(i.J,{htmlFor:"blc-cap",className:"text-xs text-muted-foreground",children:"Capacity, one battery"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.p,{id:"blc-cap",inputMode:"decimal",value:F,onChange:e=>H(e.target.value),placeholder:"100"}),(0,s.jsx)("select",{"aria-label":"Capacity unit",className:(0,d.cn)(S,"w-24 shrink-0"),value:T,onChange:e=>L(e.target.value),children:V.map(e=>(0,s.jsx)("option",{value:e,children:e},e))})]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(i.J,{htmlFor:"blc-volts",className:"text-xs text-muted-foreground",children:"Nominal voltage, one battery"}),(0,s.jsx)(l.p,{id:"blc-volts",inputMode:"decimal",value:I,onChange:e=>E(e.target.value),placeholder:String(ev.packV)}),eM?(0,s.jsx)("p",{className:"text-xs font-medium text-foreground",children:eN?`Amp-hours are not energy on their own, so I need the voltage before this means anything. A ${ev.label} pack is usually ${ev.packV} V. I am not going to assume 12 V for you, that guess is exactly how a 24 V bank ends up with an answer that is half right.`:"Watt-hours are enough for the runtime, but the voltage is still needed for the rate correction and the C-rate check."}):(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Works out to ",eV," ",1===eV?"cell":"cells"," in series at"," ",k(ev.cellV,2)," V each, which is what sets the cutoff below."]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(i.J,{htmlFor:"blc-count",className:"text-xs text-muted-foreground",children:"How many, and wired how"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.p,{id:"blc-count",inputMode:"numeric",value:D,onChange:e=>U(e.target.value),placeholder:"1"}),(0,s.jsxs)("select",{"aria-label":"Wiring",className:(0,d.cn)(S,"w-32 shrink-0"),value:J,onChange:e=>B(e.target.value),children:[(0,s.jsx)("option",{value:"parallel",children:"In parallel"}),(0,s.jsx)("option",{value:"series",children:"In series"})]})]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[null!==ek&&ek!==ej&&`Between 1 and 48, so ${k(ek,0)} was used as ${ej}. `,"Series adds volts, parallel adds amp-hours, and the watt-hours come out the same either way."]})]})]}),eS>0&&(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["That bank is ",(0,s.jsx)("span",{className:"font-medium text-foreground",children:j(eS)})," on the nameplate, ",k(eW,1)," Ah at ",k(eC,1)," V.","powerbank"===h&&" A power bank is rated at the 3.7 V cell, not at the 5 V USB port, so the watt-hour figure is the honest one to compare banks with."]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)(i.J,{children:"What is drawing from it"}),(0,s.jsx)(r.$,{type:"button",size:"sm",variant:"outline",onClick:()=>tr(),disabled:ti,children:"Add a load"})]}),(0,s.jsx)("div",{className:"space-y-2",children:ef.map(e=>{let t=eX.find(t=>t.row.id===e.id);return(0,s.jsxs)("div",{className:"rounded-md border p-2",children:[(0,s.jsxs)("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)_minmax(0,1fr)_auto]",children:[(0,s.jsx)(l.p,{"aria-label":"Load name",value:e.name,onChange:t=>tl(e.id,{name:t.target.value.slice(0,60)}),placeholder:"Fridge"}),(0,s.jsxs)("div",{className:"flex gap-1.5",children:[(0,s.jsx)(l.p,{"aria-label":`Draw for ${e.name||"this load"}`,inputMode:"decimal",value:e.val,onChange:t=>tl(e.id,{val:t.target.value}),placeholder:"55"}),(0,s.jsx)("select",{"aria-label":"Draw unit",className:(0,d.cn)(S,"w-20 shrink-0"),value:e.unit,onChange:t=>tl(e.id,{unit:t.target.value}),children:P.map(e=>(0,s.jsx)("option",{value:e,children:e},e))})]}),(0,s.jsxs)("div",{className:"flex gap-1.5",children:[(0,s.jsx)(l.p,{"aria-label":`Run time for ${e.name||"this load"}`,inputMode:"decimal",value:e.amt,onChange:t=>tl(e.id,{amt:t.target.value}),placeholder:"hours"===e.dutyMode?"4":"40"}),(0,s.jsxs)("select",{"aria-label":"Run time basis",className:(0,d.cn)(S,"w-28 shrink-0"),value:e.dutyMode,onChange:t=>tl(e.id,{dutyMode:t.target.value}),children:[(0,s.jsx)("option",{value:"hours",children:"h a day"}),(0,s.jsx)("option",{value:"duty",children:"% duty"})]})]}),(0,s.jsxs)("div",{className:"flex gap-1.5",children:[(0,s.jsxs)("select",{"aria-label":"Power path",className:(0,d.cn)(S,"w-36 shrink-0"),value:e.bus,onChange:t=>tl(e.id,{bus:t.target.value}),children:[(0,s.jsx)("option",{value:"dc",children:"Straight off DC"}),(0,s.jsx)("option",{value:"inv",children:"Via inverter"})]}),(0,s.jsx)(r.$,{type:"button",size:"sm",variant:"ghost","aria-label":`Remove ${e.name||"this load"}`,onClick:()=>{var t;return t=e.id,void ex(e=>e.filter(e=>e.id!==t))},children:"Remove"})]})]}),t&&(t.dailyWh>0||t.clampedAmt||t.bad)&&(0,s.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[t.dailyWh>0&&`${j(t.dailyWh)} a day from the battery, ${k(24*t.fraction,2)} h of running. `,t.clampedAmt&&`Capped at ${"hours"===e.dutyMode?"24 hours a day":"100% duty"}, since there is no more day than that. `,t.bad&&"That draw is not a number I can use, so this row counts as zero. "]})]},e.id)})}),ep>0&&(0,s.jsxs)("p",{className:"text-xs font-medium text-foreground",children:["Only the first ",40," loads are counted, ",ep," ",1===ep?"row was":"rows were"," left out of that shared link."]}),ti&&(0,s.jsxs)("p",{className:"text-xs font-medium text-foreground",children:[40," loads is the ceiling. Anything past that is noise against the assumptions further down, so combine the small stuff into one row."]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:x.map(e=>(0,s.jsx)("button",{type:"button",disabled:ti,onClick:()=>tr(e),className:"rounded-full border px-3 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40",children:e.name},e.name))}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Add a sleep
1state as its own row for anything that pulses. A BMS or a tracker that never switches off belongs here too, at a few milliamps."})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)(i.J,{children:"The assumptions, all editable"}),(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(i.J,{htmlFor:"blc-dod",className:"text-xs text-muted-foreground",children:"Depth of discharge, %"}),(0,s.jsx)(l.p,{id:"blc-dod",inputMode:"decimal",value:z,onChange:e=>_(e.target.value)}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[null!==eH&&eH!==eT&&`Has to be 1 to 100, so ${k(eH,0)} was used as ${eT}. `,ev.dod,"% is normal for ",ev.label.toLowerCase(),"."]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(i.J,{htmlFor:"blc-peuk",className:"text-xs text-muted-foreground",children:"Peukert exponent"}),(0,s.jsx)(l.p,{id:"blc-peuk",inputMode:"decimal",value:G,onChange:e=>Y(e.target.value)}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[eE&&(0,s.jsxs)("span",{className:"font-medium text-foreground",children:["Only 1.00 to 1.50 makes physical sense here. Below 1.00 the pack would gain capacity the harder you pull, above 1.50 no real battery behaves that way, so"," ",k(eL,2)," was used as ",k(eI,2),"."," "]}),ev.peukertNote]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(i.J,{htmlFor:"blc-cut",className:"text-xs text-muted-foreground",children:"Your device cuts out at, V"}),(0,s.jsx)(l.p,{id:"blc-cut",inputMode:"decimal",value:O,onChange:e=>q(e.target.value),placeholder:k(eP,1)}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[eF&&(0,s.jsxs)("span",{className:"font-medium text-foreground",children:["That is below the pack's own rated cutoff of ",k(eP,1)," V, and going lower does not add capacity that is not there, so this row stays at zero."," "]}),"Leave it blank for the rated ",k(eP,1)," V. Raise it if your gear browns out early."]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(i.J,{htmlFor:"blc-temp",className:"text-xs text-muted-foreground",children:"Temperature"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.p,{id:"blc-temp",inputMode:"decimal",value:K,onChange:e=>Q(e.target.value)}),(0,s.jsxs)("select",{"aria-label":"Temperature unit",className:(0,d.cn)(S,"w-20 shrink-0"),value:X,onChange:e=>Z(e.target.value),children:[(0,s.jsx)("option",{value:"F",children:"F"}),(0,s.jsx)("option",{value:"C",children:"C"})]})]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[k(100*ez,0),"% of the 25C rating.",eB>30&&" Heat does not cost you runtime, it costs you life. Every 10C above 25 roughly halves how many years the bank lasts."]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(i.J,{htmlFor:"blc-soh",className:"text-xs text-muted-foreground",children:"State of health, %"}),(0,s.jsx)(l.p,{id:"blc-soh",inputMode:"decimal",value:ee,onChange:e=>et(e.target.value)}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[null!==eD&&eD!==eU&&`Has to be 30 to 100, so ${k(eD,0)} was used as ${eU}. `,"100 for new. 80 is where a manufacturer calls it end of life."]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(i.J,{htmlFor:"blc-inveff",className:"text-xs text-muted-foreground",children:"Inverter efficiency, %"}),(0,s.jsx)(l.p,{id:"blc-inveff",inputMode:"decimal",value:ea,onChange:e=>es(e.target.value)}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[eO&&`Has to be 40 to 99, so ${k(eG,0)} was used as ${eY}. `,"85 to 92 for a pure sine unit doing real work, lower if it is barely loaded."]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(i.J,{htmlFor:"blc-idle",className:"text-xs text-muted-foreground",children:"Inverter idle draw, W"}),(0,s.jsx)(l.p,{id:"blc-idle",inputMode:"decimal",value:en,onChange:e=>el(e.target.value)}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"5 to 20 W for a typical 1,000 to 2,000 W unit. Eco mode drops it to a couple of watts."})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(i.J,{htmlFor:"blc-invh",className:"text-xs text-muted-foreground",children:"Inverter switched on, h a day"}),(0,s.jsx)(l.p,{id:"blc-invh",inputMode:"decimal",value:er,onCh
1ange:e=>ei(e.target.value)}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[null!==eK&&eK!==eQ&&`Capped at 24, so ${k(eK,1)} was used as ${eQ}. `,"Leaving it on around the clock is the single most expensive habit on a small bank."]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(i.J,{htmlFor:"blc-panel",className:"text-xs text-muted-foreground",children:"Solar panel, W (optional)"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.p,{id:"blc-panel",inputMode:"decimal",value:eo,onChange:e=>ed(e.target.value),placeholder:"200"}),(0,s.jsx)(l.p,{"aria-label":"Peak sun hours",inputMode:"decimal",className:"w-24 shrink-0",value:ec,onChange:e=>eu(e.target.value)})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Watts, then peak sun hours for your month and latitude."})]})]}),e_&&(0,s.jsx)("p",{className:"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs font-medium text-foreground",children:"Below freezing you can still discharge a lithium pack, and the number above accounts for it. Charging it below 0C is the dangerous part, because that plates lithium onto the anode and permanently kills cells. A low temperature cutoff in the BMS or a heated pack is the fix."})]}),(0,s.jsxs)("div",{className:(0,d.cn)("rounded-md border bg-muted px-4 py-3","space-y-2"),"aria-live":"polite",children:[e3.ok?e8?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",children:[(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:"Runtime"}),(0,s.jsx)("span",{className:"text-2xl font-semibold text-foreground",children:M(e3.finalHours)})]}),(0,s.jsx)("p",{className:"rounded-md border border-emerald-500/40 bg-emerald-500/10 px-3 py-2 text-sm text-foreground",children:"The textbook estimate is reliable here, within 8%. Everything below moves this answer by less than that, so capacity divided by load was close enough all along."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"If nothing goes wrong"}),(0,s.jsx)("div",{className:"text-xl font-semibold text-muted-foreground line-through decoration-1",children:M(e3.naiveHours)})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Realistically"}),(0,s.jsx)("div",{className:"text-2xl font-semibold text-foreground",children:M(e3.finalHours)})]})]}),(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:[k((1-e3.finalHours/e3.naiveHours)*100,0),"% of the answer other calculators give you is not actually there."]})]}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:e4?"A load of zero gives an infinite runtime, so the answer would be self-discharge rather than usage. Put a real draw on at least one row.":0===ef.length?"Add at least one load and the answer appears here.":eM?"Fill in the nominal voltage and the answer appears here.":"Fill in the capacity and at least one load, and the answer appears here."}),e3.ok&&(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[j(e3.usableWh)," usable out of ",j(e3.e0)," on the nameplate."," ",e7>0&&`${j(e7)} a day, so ${k(e3.finalHours/24,1)} days of autonomy. `,"Average draw ",k(e3.cRate,3),"C.",e3.cRate>ev.cRate&&` That is above the ${k(ev.cRate,2)}C this chemistry is comfortable holding, which shortens its life as well as its runtime.`]}),e3.ok&&e3.peakCRate>3*ev.cRate&&(0,s.jsxs)("p",{className:"text-xs font-medium text-foreground",children:["Your heaviest row peaks at ",k(e3.peakCRate,2),"C, well past the ",k(ev.cRate,2),"C this chemistry holds comfortably. The rate correction above covers the energy side of that, but not the voltage sag, and a pulse into a cell with real internal resistance can drop the rail far enough to reset whatever it is powering long before the energy runs out. A coin cell is the classic case, since its resistance climbs as it depletes."]}),e3.ok&&e$>=.999&&(0,s.jsx)("p",{className:"text-xs font-medium text-foreground",children:"The cutoff you entered sits at or above a full pack, so on paper there is nothing to draw. Check whether that number is the pack voltage or the per-cell voltage."})]}),e3.ok&&!e8&&e3.steps.length>1&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(i.J,{children:"Where the difference went"}),(0,s.jsx)("div",{className:"overflow-x-auto rounded-md border",children:(0,s.jsxs)("table",{className:"w-full min-w-[34rem] text-sm",children:[(0,s.jsx)("thead",{className:"bg-muted/60 text-xs text-muted-foreground",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"Step"}),(0,s.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Watt-hours"}),(0,s.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Hours lost"}),(0,s.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Left"})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-border/60",children:e3.steps.map((e,t)=>{let a=0===t?null:e3.steps[t-1],n=a?a.after-e.after:0;return(0,s.jsxs)("tr",{children:[(0,s.jsxs)("td",{className:"px-3 py-2 align-top",children:[(0,s.jsx)("div",{className:"font-medium text-foreground",children:e.label}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:e.detail})]}),(0,s.jsx)("td",{className:"whitespace-nowrap px-3 py-2 text-right al
1ign-top",children:0===t?j(e3.e0):(0,u.GY)(j(e.wh))}),(0,s.jsx)("td",{className:"whitespace-nowrap px-3 py-2 text-right align-top text-muted-foreground",children:0===t?"-":M(n)}),(0,s.jsx)("td",{className:"whitespace-nowrap px-3 py-2 text-right align-top font-medium",children:M(e.after)})]},e.label)})})]})}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["The first rows come off the bank itself, so those watt-hours are gone before anything is switched on. The inverter and self-discharge rows are energy burned over the run, which is why they eat hours without shrinking the pack.",e3.peukertClamped&&` Your draw sits below the 20 hour rate, where the Peukert fit stops being trustworthy, so no rate correction was applied. It calculated at ${k(e3.kRaw,3)}.`]})]}),e3.ok&&e7>0&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(i.J,{children:"What is actually eating the bank"}),(0,s.jsx)("div",{className:"space-y-1.5",children:[...eX.filter(e=>e.dailyWh>0).map(e=>({key:`row-${e.row.id}`,name:e.row.name||"Unnamed load",wh:e.dailyWh})),...e3.pIdle>0?[{key:"idle",name:"Inverter idle",wh:24*e3.pIdle}]:[],...24*e3.pSelf>.005*e7?[{key:"self",name:"Self-discharge",wh:24*e3.pSelf}]:[]].sort((e,t)=>t.wh-e.wh).map(e=>{let t=e.wh/e7*100;return(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsxs)("div",{className:"flex justify-between gap-3 text-xs",children:[(0,s.jsx)("span",{className:"truncate text-foreground",children:e.name}),(0,s.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:[j(e.wh)," a day, ",k(t,0),"%"]})]}),(0,s.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-border",children:(0,s.jsx)("div",{className:"h-full rounded-full bg-foreground
1/70",style:{width:`${Math.min(100,t)}%`}})})]},e.key)})}),null!==te&&(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[k(e6,0)," W of panel at ",k(e9,1)," peak sun hours puts back about"," ",j(te)," a day, against ",j(e7)," out."," ",te>=e7?"That covers it, with the surplus going into recovering whatever the last cloudy day took.":`You are ${j(e7-te)} short each day, so the bank drains even in good sun.`," ","The 0.75 in there is a rule of thumb for controller losses, heat, dust and a panel that is never aimed quite right, not physics."]})]}),"powerbank"===h&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(i.J,{htmlFor:"blc-device",children:"How big is the phone or tablet battery"}),(0,s.jsxs)("div",{className:"flex max-w-xs gap-2",children:[(0,s.jsx)(l.p,{id:"blc-device",inputMode:"decimal",value:eh,onChange:e=>em(e.target.value),placeholder:"4000"}),(0,s.jsx)("span",{className:"flex items-center text-sm text-muted-foreground",children:"mAh"})]}),null!==ts&&null!==ta&&(0,s.jsxs)("p",{className:"text-sm text-foreground",children:["About ",(0,s.jsx)("span",{className:"font-semibold",children:k(ts,1)})," full charges. The bank holds ",j(e3.e0)," and the phone holds ",j(ta),", counting the phone pack at ",N," V nominal rather than the 3.7 V the bank is rated at, and between them sits the boost to 5 V at ",eY,"% plus the phone's own charging circuit at roughly 85%.","mAh"===T&&` Dividing the two mAh numbers gives ${k((y(F)??0)/(tt||1),1)}, which is the number people expect off the box and not a number anybody has ever measured.`]}),e3.e0>0&&(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["At ",j(e3.e0)," this one is"," ",e3.e0<=100?"fine in carry-on with no paperwork, since the limit is 100 Wh":e3.e0<=160?"in the 101 to 160 Wh band, which needs airline approval before you fly":"over 160 Wh, which airlines will not carry at all","."]})]}),e3.ok&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(i.J,{children:"The same setup at other temperatures"}),(0,s.jsx)("div",{className:"overflow-x-auto rounded-md border",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-muted/60 text-xs text-muted-foreground",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"Temperature"}),(0,s.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Capacity"}),(0,s.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Runtime"})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-border/60",children:tn.map(e=>{let t=3>Math.abs(e.c-eB);return(0,s.jsxs)("tr",{className:(0,d.cn)(t&&"bg-muted/60 font-medium"),children:[(0,s.jsxs)("td",{className:"px-3 py-2",children:[k(9*e.c/5+32,0),"F (",k(e.c,0),"C)",t&&(0,s.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground",children:"yours"})]}),(0,s.jsxs)("td",{className:"px-3 py-2 text-right",children:[k(100*C(ev,e.c),0),"%"]}),(0,s.jsx)("td",{className:"px-3 py-2 text-right",children:M(e.hours)})]},e.c)})})]})}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Same bank, same loads, different month. A system that just about coped in September is a different system in January, and lead-acid feels it far more than lithium does."})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Every figure here is worked out in your browser, on your device. Nothing you type is uploaded. Treat the result as an estimate good to roughly plus or minus 20%, because the chemistry constants are typical values rather than your battery, and the duty cycle you guessed is a bigger unknown than anything in the table."}),(0,s.jsx)(o.ToolActions,{getParams:function(){let e=new URLSearchParams;return e.set("m",h),e.set("ch",p),e.set("c",F.trim()),e.set("cu",T),e.set("v",I.trim()),e.set("n",D.trim()),e.set("w",J),e.set("d",z.trim()),e.set("pk",G.trim()),""!==O.trim()&&e.set("co",O.trim()),e.set("t",K.trim()),e.set("tu",X),e.set("sh",ee.trim()),e.set("ie",ea.trim()),e.set("ii",en.trim()),e.set("ih",er.trim()),""!==eo.trim()&&(e.set("pw",eo.trim()),e.set("sn",ec.trim())),"powerbank"===h&&e.set("dm",eh.trim()),e.set("l",ef.slice(0,40).map(e=>[e.name,e.val,e.unit,e.bus,e.dutyMode,e.amt].map(e=>encodeURIComponent(e)).join(",")).join("|")),e},queryIsImpersonal:"the battery you described, the inverter settings and every load you listed",title:"Battery Life Calculator"})]})}},38372:(e,t,a)=>{a.d(t,{Rb:()=>l,ss:()=>n});let s={flooded:{fraction:.5,publishedLowPct:50,publishedHighPct:50,source:"Universal lead-acid design floor; Unbound Solar bank sizing guide gives lead-acid ~50% usable."},agm:{fraction:.5,publishedLowPct:50,publishedHighPct:50,source:"As flooded. Victron deep-cycle AGM: >=400 cycles at 80% DoD, which is a life figure, not a design depth."},gel:{fraction:.5,publishedLowPct:50,publishedHighPct:50,source:"As flooded. Victron deep-cycle GEL: >=450 cycles at 80% DoD, marginally better than AGM at the same depth; East Penn / DEKA gel is rated 1,000 cycles at 50% DoD. No publisher states a deeper DESIGN depth for gel."},lifepo4:{fraction:.8,publishedLowPct:80,publishedHighPct:90,source:"Victron LFP-Smart datasheet, 2500 cycles at 80% DoD; Unbound Solar works its lithium example at 80%."},liion:{fraction:.8,publishedLowPct:80,publishedHighPct:80,source:"Same design depth as LFP, on a chemistry with materially worse cycle life, so it is if anything generous."},lipo:{fraction:.8,publishedLowPct:80,publishedHighPct:80,source:"RC practice is to land with 20% left, which is the same number said the other way round."},nimh:{fraction:.9,publishedLowPct:90,publishedHighPct:90,source:"Held just off the floor: a deep-cycled series NiMH pack risks reversing its weakest cell."},alkaline:{fraction:1,publishedLowPct:100,publishedHighPct:100,source:"A primary cell has no cycle life to preserve, so the whole cell is the budget."},coin:{fraction:1,publishedLowPct:100,publishedHighPct:100,source:"A primary lithium cell, like alkaline: there is no cycle life to protect, so the budget is the whole cell."}},n=e=>s[e].fraction,l=e=>Math.round(100*s[e].fraction)}}]);
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.