;
{
  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] = "056c5990-659c-44e7-833a-057157d86a1c", e._sentryDebugIdIdentifier = "sentry-dbid-056c5990-659c-44e7-833a-057157d86a1c");
  } catch (e) {
  }
}
;
import { ac as entriesOf } from "./StoreProvider-CqQrndhS.js";
class ValidationResult {
  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;
  }
}
const omitKeys = (obj, omit) => Object.keys(obj).filter((k) => !omit.includes(k)).reduce((a, c) => {
  a[c] = obj[c];
  return a;
}, {});
const addKeys = (obj, add, initialValue, defaultData, pendingData) => add.reduce(
  (a, c) => ({
    ...a,
    [c]: a[c] ?? pendingData?.[c] ?? defaultData?.[c] ?? initialValue
  }),
  obj
);
function getDataByFields(formData, fieldKeys) {
  return entriesOf(formData).reduce((acc, [key, val]) => {
    if (fieldKeys.includes(key)) {
      return { ...acc, [key]: val };
    }
    return acc;
  }, {});
}
export {
  ValidationResult as V,
  addKeys as a,
  getDataByFields as g,
  omitKeys as o
};
