import { UdpFormRenderer } from "../UdpFormsPrivateForm/UdpFormRenderer.mjs";
import { useUdpFormParameters } from "../UdpFormsUtils/Utils.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { useSnackbar } from "notistack";
import { useHistory } from "react-router-dom";
//#region src/udp/pages/UdpFormsPublicForm/UdpPublicForm.jsx
const UdpPublicForm = (props) => {
	const $ = c(15);
	const history = useHistory();
	const { enqueueSnackbar, closeSnackbar } = useSnackbar();
	const { formId, formVersion, submissionId, tenantId, urlContext } = useUdpFormParameters();
	const t0 = props.generic1 || urlContext.generic1;
	const t1 = props.generic2 || urlContext.generic2;
	const t2 = props.generic3 || urlContext.generic3;
	let t3;
	if ($[0] !== t0 || $[1] !== t1 || $[2] !== t2 || $[3] !== urlContext) {
		t3 = {
			...urlContext,
			generic1: t0,
			generic2: t1,
			generic3: t2
		};
		$[0] = t0;
		$[1] = t1;
		$[2] = t2;
		$[3] = urlContext;
		$[4] = t3;
	} else t3 = $[4];
	const mergedContext = t3;
	let t4;
	if ($[5] !== closeSnackbar || $[6] !== enqueueSnackbar || $[7] !== formId || $[8] !== formVersion || $[9] !== history || $[10] !== mergedContext || $[11] !== props || $[12] !== submissionId || $[13] !== tenantId) {
		t4 = /* @__PURE__ */ React.createElement(UdpFormRenderer, {
			isPublicMode: true,
			formId,
			formVersion,
			submissionId,
			tenantId,
			urlContext: mergedContext,
			callbackUrl: null,
			history,
			enqueueSnackbar,
			closeSnackbar,
			...props
		});
		$[5] = closeSnackbar;
		$[6] = enqueueSnackbar;
		$[7] = formId;
		$[8] = formVersion;
		$[9] = history;
		$[10] = mergedContext;
		$[11] = props;
		$[12] = submissionId;
		$[13] = tenantId;
		$[14] = t4;
	} else t4 = $[14];
	return t4;
};
//#endregion
export { UdpPublicForm };

//# sourceMappingURL=UdpPublicForm.mjs.map