import { useMemo as u } from "../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
import { noop as c } from "../utils/common.js";
import { isFunction as m } from "../utils/value/is.js";
const p = (e) => u(() => {
  let r = e?.current ?? null, o = c;
  e && (o = m(e) ? e : (t) => {
    e.current = t;
  });
  const n = (t) => {
    r = t, o(t);
  };
  return Object.defineProperty(n, "current", {
    enumerable: !0,
    get: () => r,
    set: n
  });
}, [e]);
export {
  p as default,
  p as useTrackedRef
};
