"use client";
const require_clamp = require("../utils/clamp/clamp.cjs");
let react = require("react");
//#region packages/@mantine/hooks/src/use-counter/use-counter.ts
const DEFAULT_OPTIONS = {
	min: -Infinity,
	max: Infinity
};
function useCounter(initialValue = 0, options) {
	const { min, max, step: _step = 1 } = {
		...DEFAULT_OPTIONS,
		...options
	};
	const step = Math.abs(_step);
	const [count, setCount] = (0, react.useState)(require_clamp.clamp(initialValue, min, max));
	return [count, {
		increment: (0, react.useCallback)(() => setCount((current) => require_clamp.clamp(current + step, min, max)), [
			min,
			max,
			step
		]),
		decrement: (0, react.useCallback)(() => setCount((current) => require_clamp.clamp(current - step, min, max)), [
			min,
			max,
			step
		]),
		set: (0, react.useCallback)((value) => setCount(require_clamp.clamp(value, min, max)), [min, max]),
		reset: (0, react.useCallback)(() => setCount(require_clamp.clamp(initialValue, min, max)), [
			initialValue,
			min,
			max
		])
	}];
}
//#endregion
exports.useCounter = useCounter;

//# sourceMappingURL=use-counter.cjs.map