import { useState as V, useCallback as p } from "react";
function v(r) {
  const { defaultValue: s, value: o, onChange: t, ...c } = r, [i, f] = V(s), n = o !== void 0, a = n ? o : i, d = p(
    (u) => {
      const l = (e) => {
        if (e !== u)
          return u;
      };
      if (n || f((e) => l(e)), t) {
        const e = l(a);
        t(e || "");
      }
    },
    [a, n, t]
  );
  return { activeValue: a, toggleValue: d, extractedProps: c };
}
export {
  v as default
};
//# sourceMappingURL=useSingleToggleGroup.js.map
