var r=(e=>(e.B="B",e.KB="kB",e.MB="MB",e.GB="GB",e.TB="TB",e.PB="PB",e.EB="EB",e.KIB="KiB",e.MIB="MiB",e.GIB="GiB",e.TIB="TiB",e.PIB="PiB",e.EIB="EiB",e))(r||{}),s=(e=>(e[e.FIXED=0]="FIXED",e[e.PERCENT=1]="PERCENT",e))(s||{}),a=(e=>(e[e.DYNAMIC=0]="DYNAMIC",e[e.FIXED=1]="FIXED",e))(a||{});const l=e=>{var n,u,t;if(e){if(typeof e=="string")return e;switch(e.selectedType){case a.DYNAMIC:return(n=e.dynamicValue)==null?void 0:n.toString();case a.FIXED:if((u=e.fixedValue)!=null&&u.includes(",")||(t=e.fixedValue)!=null&&t.includes("-"))return e.fixedValue;if(e.fixedValue){const c=+e.fixedValue;return`${c}-${c}`}return}}},f=e=>{if(e)return e.includes(",")||e.includes("-")?{fixedValue:e,selectedType:a.FIXED}:{dynamicValue:parseInt(e),selectedType:a.DYNAMIC}},o=e=>{if(typeof e=="string")return e;if(e!=null&&e.value)return`${e.value}${e.unit}`},B=e=>{if(e)return e.includes("%")?{value:parseInt(e),unit:"%",selectedType:s.PERCENT}:{value:parseInt(e),unit:e.replace(/[0-9]/g,""),selectedType:s.FIXED}},d=e=>{switch(e){case r.B:return 1;case r.KB:return 10**3;case r.MB:return 10**6;case r.GB:return 10**9;case r.TB:return 10**12;case r.PB:return 10**15;case r.EB:return 10**18;case r.KIB:return 2**10;case r.MIB:return(2**10)**2;case r.GIB:return(2**10)**3;case r.TIB:return(2**10)**4;case r.PIB:return(2**10)**5;case r.EIB:return(2**10)**6}},v=e=>{const n=B(e);return n!=null&&n.value&&n.unit!=="%"?n.value*d(n.unit):0};export{r as B,a as C,s as M,f as a,l as c,v as l,o as m,B as p};
