import{S as s}from"./Str.js?ver=1.5.2";import{A as i}from"./Arr.js?ver=1.5.2";const o=a=>"fcart-"+s.snake(i.get(window,"fluentCartAdminApp.app_config.version","1.0.0"))+"_"+a;class l{static get(t,e=""){let r=localStorage.getItem(o(t));if(r&&["{","["].indexOf(r[0])!==-1)try{r=JSON.parse(r)}catch{return e}else{if(r==="true")return!0;if(r==="false")return!1}return r||e}static set(t,e){typeof e=="object"&&(e=JSON.stringify(e)),localStorage.setItem(o(t),e)}static remove(t){localStorage.removeItem(o(t))}static clear(){localStorage.clear()}static serverMaxUploadSize(){return i.get(window,"fluentCartAdminApp.max_upload_size")||""}static readableFileSizeFromBytes(t){if(t==0)return"0 B";if(!t)return"";const e=Math.floor(Math.log(t)/Math.log(1024)),r=["B","KB","MB","GB","TB"];return(t/Math.pow(1024,e)).toFixed(2)+" "+r[e]}}export{l as S};
