"use client";
const require_get_thumb_size = require("./get-thumb-size.cjs");
const require_linear_scale = require("./linear-scale.cjs");
//#region packages/@mantine/core/src/components/ScrollArea/utils/get-scroll-position-from-pointer.ts
function getScrollPositionFromPointer(pointerPos, pointerOffset, sizes, dir = "ltr") {
	const thumbSizePx = require_get_thumb_size.getThumbSize(sizes);
	const thumbCenter = thumbSizePx / 2;
	const offset = pointerOffset || thumbCenter;
	const thumbOffsetFromEnd = thumbSizePx - offset;
	const minPointerPos = sizes.scrollbar.paddingStart + offset;
	const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd;
	const maxScrollPos = sizes.content - sizes.viewport;
	const scrollRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];
	return require_linear_scale.linearScale([minPointerPos, maxPointerPos], scrollRange)(pointerPos);
}
//#endregion
exports.getScrollPositionFromPointer = getScrollPositionFromPointer;

//# sourceMappingURL=get-scroll-position-from-pointer.cjs.map