import { c } from "react-compiler-runtime";
import "react";
import { useLocation } from "react-router-dom";
//#region src/udp/pages/UdpFormsUtils/Utils.js
const useUdpFormParameters = () => {
	const $ = c(3);
	const { search } = useLocation();
	let extracted;
	if ($[0] !== search) {
		const rawParams = new URLSearchParams(typeof search === "string" ? search : window.location.search);
		let t0;
		if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
			t0 = {
				formId: "udpf_formid",
				formVersion: "udpf_formversion",
				submissionId: "udpf_submissionid",
				tenantId: "udpf_tenantid"
			};
			$[2] = t0;
		} else t0 = $[2];
		const keys = t0;
		extracted = {
			formId: null,
			formVersion: null,
			submissionId: null,
			tenantId: null,
			urlContext: {}
		};
		rawParams.forEach((value, key) => {
			const keyLower = key.toLowerCase();
			if (keyLower === keys.formId) extracted.formId = value;
			else if (keyLower === keys.formVersion) extracted.formVersion = value;
			else if (keyLower === keys.submissionId) extracted.submissionId = value;
			else if (keyLower === keys.tenantId) extracted.tenantId = value;
			if (keyLower.startsWith("udpf_") && !Object.values(keys).includes(keyLower)) {
				const cleanKey = key.slice(5).toLowerCase();
				extracted.urlContext[cleanKey] = value;
			}
		});
		$[0] = search;
		$[1] = extracted;
	} else extracted = $[1];
	return extracted;
};
//#endregion
export { useUdpFormParameters };

//# sourceMappingURL=Utils.mjs.map