import { useCallback as e, useEffect as t, useLayoutEffect as n, useMemo as r, useRef as i } from "react";
//#region ../../node_modules/@dnd-kit/utilities/dist/utilities.esm.js
function a() {
	var e = [...arguments];
	return r(() => (t) => {
		e.forEach((e) => e(t));
	}, e);
}
var o = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0;
function s(e) {
	let t = Object.prototype.toString.call(e);
	return t === "[object Window]" || t === "[object global]";
}
function c(e) {
	return "nodeType" in e;
}
function l(e) {
	return e ? s(e) ? e : c(e) ? e.ownerDocument?.defaultView ?? window : window : window;
}
function u(e) {
	let { Document: t } = l(e);
	return e instanceof t;
}
function d(e) {
	return s(e) ? !1 : e instanceof l(e).HTMLElement;
}
function f(e) {
	return e instanceof l(e).SVGElement;
}
function p(e) {
	return e ? s(e) ? e.document : c(e) ? u(e) ? e : d(e) || f(e) ? e.ownerDocument : document : document : document;
}
var m = o ? n : t;
function h(t) {
	let n = i(t);
	return m(() => {
		n.current = t;
	}), e(function() {
		var e = [...arguments];
		return n.current == null ? void 0 : n.current(...e);
	}, []);
}
function g() {
	let t = i(null);
	return [e((e, n) => {
		t.current = setInterval(e, n);
	}, []), e(() => {
		t.current !== null && (clearInterval(t.current), t.current = null);
	}, [])];
}
function _(e, t) {
	t === void 0 && (t = [e]);
	let n = i(e);
	return m(() => {
		n.current !== e && (n.current = e);
	}, t), n;
}
function v(e, t) {
	let n = i();
	return r(() => {
		let t = e(n.current);
		return n.current = t, t;
	}, [...t]);
}
function y(t) {
	let n = h(t), r = i(null);
	return [r, e((e) => {
		e !== r.current && n?.(e, r.current), r.current = e;
	}, [])];
}
function b(e) {
	let n = i();
	return t(() => {
		n.current = e;
	}, [e]), n.current;
}
var x = {};
function S(e, t) {
	return r(() => {
		if (t) return t;
		let n = x[e] == null ? 0 : x[e] + 1;
		return x[e] = n, e + "-" + n;
	}, [e, t]);
}
function C(e) {
	return function(t) {
		return [...arguments].slice(1).reduce((t, n) => {
			let r = Object.entries(n);
			for (let [n, i] of r) {
				let r = t[n];
				r != null && (t[n] = r + e * i);
			}
			return t;
		}, { ...t });
	};
}
var w = /* @__PURE__ */ C(1), T = /* @__PURE__ */ C(-1);
function E(e) {
	return "clientX" in e && "clientY" in e;
}
function D(e) {
	if (!e) return !1;
	let { KeyboardEvent: t } = l(e.target);
	return t && e instanceof t;
}
function O(e) {
	if (!e) return !1;
	let { TouchEvent: t } = l(e.target);
	return t && e instanceof t;
}
function k(e) {
	if (O(e)) {
		if (e.touches && e.touches.length) {
			let { clientX: t, clientY: n } = e.touches[0];
			return {
				x: t,
				y: n
			};
		} else if (e.changedTouches && e.changedTouches.length) {
			let { clientX: t, clientY: n } = e.changedTouches[0];
			return {
				x: t,
				y: n
			};
		}
	}
	return E(e) ? {
		x: e.clientX,
		y: e.clientY
	} : null;
}
var A = /* @__PURE__ */ Object.freeze({
	Translate: { toString(e) {
		if (!e) return;
		let { x: t, y: n } = e;
		return "translate3d(" + (t ? Math.round(t) : 0) + "px, " + (n ? Math.round(n) : 0) + "px, 0)";
	} },
	Scale: { toString(e) {
		if (!e) return;
		let { scaleX: t, scaleY: n } = e;
		return "scaleX(" + t + ") scaleY(" + n + ")";
	} },
	Transform: { toString(e) {
		if (e) return [A.Translate.toString(e), A.Scale.toString(e)].join(" ");
	} },
	Transition: { toString(e) {
		let { property: t, duration: n, easing: r } = e;
		return t + " " + n + "ms " + r;
	} }
}), j = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
function M(e) {
	return e.matches(j) ? e : e.querySelector(j);
}
//#endregion
export { A as CSS, w as add, o as canUseDOM, M as findFirstFocusableNode, k as getEventCoordinates, p as getOwnerDocument, l as getWindow, u as isDocument, d as isHTMLElement, D as isKeyboardEvent, c as isNode, f as isSVGElement, s as isWindow, T as subtract, a as useCombinedRefs, h as useEvent, g as useInterval, m as useIsomorphicLayoutEffect, _ as useLatestValue, v as useLazyMemo, y as useNodeRef, b as usePrevious, S as useUniqueId };

//# sourceMappingURL=utilities.esm.js.map