import { C as e } from "./base-PQGakkrl.js";
class s {
  static _guard(r, t) {
    try {
      return r();
    } catch {
      return t;
    }
  }
  static getItem(r) {
    return this._guard(() => {
      const t = window.localStorage.getItem(r);
      if (!e.isString(t)) return t;
      try {
        return JSON.parse(t);
      } catch {
        return t;
      }
    }, null);
  }
  static setItem(r, t) {
    return this._guard(() => {
      let o;
      return e.isJson(t) && e.isObject(t) && (o = JSON.stringify(t)), window.localStorage.setItem(r, o || t);
    }, void 0);
  }
  static removeItem(r) {
    this._guard(() => {
      window.localStorage.removeItem(r);
    }, void 0);
  }
  static removeList(r) {
    this._guard(() => {
      e.isEmpty(r) || r.forEach((t) => {
        window.localStorage.removeItem(t);
      });
    }, void 0);
  }
  static clearAll() {
    this._guard(() => {
      window.localStorage.clear();
    }, void 0);
  }
}
export {
  s as L
};
//# sourceMappingURL=Tools_localStorage-DVvhtzhL.js.map
