try {
	let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
	n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d747bd68-d34a-4764-afbd-8c3946d75309", e._sentryDebugIdIdentifier = "sentry-dbid-d747bd68-d34a-4764-afbd-8c3946d75309");
} catch (e) {}
import { c as entriesOf } from "./AnalyticsContext-zvlAxIPp.js";
//#region src/hooks/useForm/utils.ts
var omitKeys = (obj, omit) => Object.keys(obj).filter((k) => !omit.includes(k)).reduce((a, c) => {
	a[c] = obj[c];
	return a;
}, {});
var addKeys = (obj, add, initialValue, defaultData, pendingData) => add.reduce((a, c) => ({
	...a,
	[c]: a[c] ?? pendingData?.[c] ?? defaultData?.[c] ?? initialValue
}), obj);
/**
* @description Extracts the field schema data from the form schema using the field component
*
* @param formData The data of the form using the field component
* @param fieldKeys The keys in the field schema
* @returns An object containing only the field schemas form data
*/
function getDataByFields(formData, fieldKeys) {
	return entriesOf(formData).reduce((acc, [key, val]) => {
		if (fieldKeys.includes(key)) return {
			...acc,
			[key]: val
		};
		return acc;
	}, {});
}
//#endregion
//#region src/utils/validation/validationResult.ts
var ValidationResult = class {
	validationResults;
	constructor(results) {
		this.validationResults = results;
	}
	/** Checks if all validation rules have passed */
	get isValid() {
		return this.validationResults.reduce((acc, result) => acc && result.isValid, true);
	}
	/** Checks if any validation rule returned an error */
	hasError() {
		return Boolean(this.getError());
	}
	/** Returns the first validation result that returned an error */
	getError() {
		return this.validationResults.find((result) => result.hasError);
	}
	/** Used to add async validation results to the static validation result*/
	addError(result) {
		this.validationResults.push(result);
		return this.validationResults;
	}
};
//#endregion
export { omitKeys as i, addKeys as n, getDataByFields as r, ValidationResult as t };
