"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function b(o,f,h){let e=0;const a=[];o.forEach((n,t)=>{n===void 0?a.push(t):e+=n});const r=1-e,l=a.length;if(o.length&&!a.length&&e!==1){if(e===0){const t=1/o.length;return o.map(()=>t)}const n=1/e;return o.map(t=>t*n)}if(r<0){const n=1/e;return o.map(t=>t===void 0?0:t*n)}let u=0,v=0,d=0,i=1;for(const n of a){const t=f[n]||0,c=h[n]||1;u+=t,v+=c,d=Math.max(d,t),i=Math.min(i,c)}if(u>1&&v<1){const n=1/l;return o.map(t=>t===void 0?n:t)}const s=r/l;if(d<=s&&s<=i)return o.map(n=>n===void 0?s:n);const m=[...o];let M=r-u;for(let n=0;n<l;n+=1){const t=a[n],c=f[t]||0,g=h[t]||1;m[t]=c;const P=g-c,x=Math.min(P,M);m[t]+=x,M-=x}return m}exports.autoPtgSizes=b;
