import { useCallback as c } from "react";
import a from "./useCookies.js";
const n = (e) => {
  if (!e)
    return {
      cookieName: "cookie_settings",
      isSet: !1,
      uxCookiesAccepted: !1,
      marketingCookiesAccepted: !1,
      status: "missing"
    };
  try {
    const t = JSON.parse(e), s = t["switch-49"] === 1, o = t["switch-2"] === 1;
    let i = "custom";
    return s && !o ? i = "ux-cookies-accepted" : !s && o && (i = "marketing-cookies-accepted"), {
      cookieName: "cookie_settings",
      isSet: !0,
      rawValue: e,
      parsedValue: {
        "switch-2": Number(t["switch-2"]),
        "switch-49": Number(t["switch-49"])
      },
      uxCookiesAccepted: s,
      marketingCookiesAccepted: o,
      status: i
    };
  } catch {
    return {
      cookieName: "cookie_settings",
      isSet: !0,
      rawValue: e,
      uxCookiesAccepted: !1,
      marketingCookiesAccepted: !1,
      status: "invalid"
    };
  }
}, u = () => {
  const { getCookie: e } = a();
  return { getRioCookieConsentInfo: c(
    () => n(e("cookie_settings")),
    [e]
  ) };
};
export {
  u as default
};
//# sourceMappingURL=useRioCookieConsent.js.map
