"use client";
import { t as e } from "./useIsoLayoutEffect-CKOv1bV_.js";
import { u as t } from "./useRenderElement-CmuWsiNa.js";
import { t as n } from "./owner-BrzQrszh.js";
import { s as r } from "./useOpenInteractionType-D-ymktmc.js";
import * as i from "react";
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/utils/useAnchoredPopupScrollLock.js
var a = 20;
function o(t, o, s, c) {
	let [l, u] = i.useState(!1);
	e(() => {
		if (!t || !o || s == null) {
			u(!1);
			return;
		}
		let e = n(s).documentElement.clientWidth, r = s.offsetWidth;
		u(e > 0 && r > 0 && r >= e - a);
	}, [
		t,
		o,
		s
	]), r(t && (!o || l), c);
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/toolbar/root/ToolbarRootContext.js
var s = /*#__PURE__*/ i.createContext(void 0);
process.env.NODE_ENV !== "production" && (s.displayName = "ToolbarRootContext");
function c(e) {
	let n = i.useContext(s);
	if (n === void 0 && !e) throw Error(process.env.NODE_ENV === "production" ? t(69) : "Base UI: ToolbarRootContext is missing. Toolbar parts must be placed within <Toolbar.Root>.");
	return n;
}
//#endregion
export { o as n, c as t };
