import { jsx as i } from "react/jsx-runtime";
import { useState as l, useEffect as D } from "react";
import { noop as H } from "es-toolkit/function";
import U from "./BottomSheet.js";
import m from "../../hooks/useTimeout.js";
import { useLocalStorage as y } from "../../hooks/useStorage.js";
const L = 0, N = 36e5, _ = (t) => `${t.charAt(0).toUpperCase()}${t.slice(1)}`.replaceAll(" ", ""), b = (t) => {
  const {
    dismissed: e = !1,
    featureName: n,
    showAfter: s = L,
    hideAfter: d = N,
    alwaysOn: f = !1,
    showCloseButton: c = !0,
    width: h,
    cleanupLocalStorage: r = !1,
    onClose: u = H,
    bodyClassName: p = "padding-25 margin-right-25",
    localStoragePrefix: S = "",
    className: B,
    children: g,
    ...A
  } = t, [w, o] = l(!1), [C, a, E] = y(
    `${S}hide${_(n)}`,
    !1
  ), [F, T] = l(e);
  return e && e !== F && (T(e), a(!0), o(!1)), m(() => {
    !e && !C && !r && o(!0);
  }, s), m(() => o(!!f), s + d), D(() => {
    r && E();
  }, []), /* @__PURE__ */ i("div", { ...A, children: /* @__PURE__ */ i(
    U,
    {
      show: w,
      width: h,
      detach: !0,
      showCloseButton: c,
      onClose: () => {
        o(!1), a(!0), u();
      },
      className: B,
      bodyClassName: p,
      children: g
    }
  ) });
};
export {
  b as TimedBottomSheet,
  b as default
};
//# sourceMappingURL=TimedBottomSheet.js.map
