import { c } from "react-compiler-runtime";
import React, { useEffect, useState } from "react";
import { UdpFluentDialog } from "udp-react-stencil-component-library";
//#region src/UI/fluent-web-components/UdpDialog.tsx
const UdpDialog = (props) => {
	const $ = c(7);
	const [shouldRender, setShouldRender] = useState(props.open);
	if (props.open && !shouldRender) setShouldRender(true);
	let t0;
	let t1;
	if ($[0] !== props.open || $[1] !== shouldRender) {
		t0 = () => {
			if (!props.open && shouldRender) {
				const timeoutId = setTimeout(() => {
					setShouldRender(false);
				}, 500);
				return () => clearTimeout(timeoutId);
			}
		};
		t1 = [props.open, shouldRender];
		$[0] = props.open;
		$[1] = shouldRender;
		$[2] = t0;
		$[3] = t1;
	} else {
		t0 = $[2];
		t1 = $[3];
	}
	useEffect(t0, t1);
	const t2 = shouldRender ? props.children : null;
	let t3;
	if ($[4] !== props || $[5] !== t2) {
		t3 = /* @__PURE__ */ React.createElement(UdpFluentDialog, props, t2);
		$[4] = props;
		$[5] = t2;
		$[6] = t3;
	} else t3 = $[6];
	return t3;
};
//#endregion
export { UdpDialog };

//# sourceMappingURL=UdpDialog.mjs.map