{"version":3,"file":"vee-validate-v13u8JjQ.js","sources":["../../node_modules/vee-validate/dist/vee-validate.mjs"],"sourcesContent":["/**\n  * vee-validate v4.15.0\n  * (c) 2024 Abdelrahman Awad\n  * @license MIT\n  */\nimport { getCurrentInstance, inject, warn as warn$1, computed, toValue, ref, watch, nextTick, unref, isRef, reactive, onUnmounted, onMounted, provide, onBeforeUnmount, defineComponent, toRef, resolveDynamicComponent, h, readonly, watchEffect, shallowRef } from 'vue';\n\nfunction isCallable(fn) {\n    return typeof fn === 'function';\n}\nfunction isNullOrUndefined(value) {\n    return value === null || value === undefined;\n}\nconst isObject = (obj) => obj !== null && !!obj && typeof obj === 'object' && !Array.isArray(obj);\nfunction isIndex(value) {\n    return Number(value) >= 0;\n}\nfunction toNumber(value) {\n    const n = parseFloat(value);\n    return isNaN(n) ? value : n;\n}\nfunction isObjectLike(value) {\n    return typeof value === 'object' && value !== null;\n}\nfunction getTag(value) {\n    if (value == null) {\n        return value === undefined ? '[object Undefined]' : '[object Null]';\n    }\n    return Object.prototype.toString.call(value);\n}\n// Reference: https://github.com/lodash/lodash/blob/master/isPlainObject.js\nfunction isPlainObject(value) {\n    if (!isObjectLike(value) || getTag(value) !== '[object Object]') {\n        return false;\n    }\n    if (Object.getPrototypeOf(value) === null) {\n        return true;\n    }\n    let proto = value;\n    while (Object.getPrototypeOf(proto) !== null) {\n        proto = Object.getPrototypeOf(proto);\n    }\n    return Object.getPrototypeOf(value) === proto;\n}\nfunction merge(target, source) {\n    Object.keys(source).forEach(key => {\n        if (isPlainObject(source[key]) && isPlainObject(target[key])) {\n            if (!target[key]) {\n                target[key] = {};\n            }\n            merge(target[key], source[key]);\n            return;\n        }\n        target[key] = source[key];\n    });\n    return target;\n}\n/**\n * Constructs a path with dot paths for arrays to use brackets to be compatible with vee-validate path syntax\n */\nfunction normalizeFormPath(path) {\n    const pathArr = path.split('.');\n    if (!pathArr.length) {\n        return '';\n    }\n    let fullPath = String(pathArr[0]);\n    for (let i = 1; i < pathArr.length; i++) {\n        if (isIndex(pathArr[i])) {\n            fullPath += `[${pathArr[i]}]`;\n            continue;\n        }\n        fullPath += `.${pathArr[i]}`;\n    }\n    return fullPath;\n}\n\nconst RULES = {};\n/**\n * Adds a custom validator to the list of validation rules.\n */\nfunction defineRule(id, validator) {\n    // makes sure new rules are properly formatted.\n    guardExtend(id, validator);\n    RULES[id] = validator;\n}\n/**\n * Gets an already defined rule\n */\nfunction resolveRule(id) {\n    return RULES[id];\n}\n/**\n * Guards from extension violations.\n */\nfunction guardExtend(id, validator) {\n    if (isCallable(validator)) {\n        return;\n    }\n    throw new Error(`Extension Error: The validator '${id}' must be a function.`);\n}\n\nfunction set(obj, key, val) {\n\tif (typeof val.value === 'object') val.value = klona(val.value);\n\tif (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === '__proto__') {\n\t\tObject.defineProperty(obj, key, val);\n\t} else obj[key] = val.value;\n}\n\nfunction klona(x) {\n\tif (typeof x !== 'object') return x;\n\n\tvar i=0, k, list, tmp, str=Object.prototype.toString.call(x);\n\n\tif (str === '[object Object]') {\n\t\ttmp = Object.create(x.__proto__ || null);\n\t} else if (str === '[object Array]') {\n\t\ttmp = Array(x.length);\n\t} else if (str === '[object Set]') {\n\t\ttmp = new Set;\n\t\tx.forEach(function (val) {\n\t\t\ttmp.add(klona(val));\n\t\t});\n\t} else if (str === '[object Map]') {\n\t\ttmp = new Map;\n\t\tx.forEach(function (val, key) {\n\t\t\ttmp.set(klona(key), klona(val));\n\t\t});\n\t} else if (str === '[object Date]') {\n\t\ttmp = new Date(+x);\n\t} else if (str === '[object RegExp]') {\n\t\ttmp = new RegExp(x.source, x.flags);\n\t} else if (str === '[object DataView]') {\n\t\ttmp = new x.constructor( klona(x.buffer) );\n\t} else if (str === '[object ArrayBuffer]') {\n\t\ttmp = x.slice(0);\n\t} else if (str.slice(-6) === 'Array]') {\n\t\t// ArrayBuffer.isView(x)\n\t\t// ~> `new` bcuz `Buffer.slice` => ref\n\t\ttmp = new x.constructor(x);\n\t}\n\n\tif (tmp) {\n\t\tfor (list=Object.getOwnPropertySymbols(x); i < list.length; i++) {\n\t\t\tset(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));\n\t\t}\n\n\t\tfor (i=0, list=Object.getOwnPropertyNames(x); i < list.length; i++) {\n\t\t\tif (Object.hasOwnProperty.call(tmp, k=list[i]) && tmp[k] === x[k]) continue;\n\t\t\tset(tmp, k, Object.getOwnPropertyDescriptor(x, k));\n\t\t}\n\t}\n\n\treturn tmp || x;\n}\n\nconst FormContextKey = Symbol('vee-validate-form');\nconst PublicFormContextKey = Symbol('vee-validate-form-context');\nconst FieldContextKey = Symbol('vee-validate-field-instance');\nconst IS_ABSENT = Symbol('Default empty value');\n\nconst isClient = typeof window !== 'undefined';\nfunction isLocator(value) {\n    return isCallable(value) && !!value.__locatorRef;\n}\nfunction isTypedSchema(value) {\n    return !!value && isCallable(value.parse) && value.__type === 'VVTypedSchema';\n}\nfunction isYupValidator(value) {\n    return !!value && isCallable(value.validate);\n}\nfunction hasCheckedAttr(type) {\n    return type === 'checkbox' || type === 'radio';\n}\nfunction isContainerValue(value) {\n    return isObject(value) || Array.isArray(value);\n}\n/**\n * True if the value is an empty object or array\n */\nfunction isEmptyContainer(value) {\n    if (Array.isArray(value)) {\n        return value.length === 0;\n    }\n    return isObject(value) && Object.keys(value).length === 0;\n}\n/**\n * Checks if the path opted out of nested fields using `[fieldName]` syntax\n */\nfunction isNotNestedPath(path) {\n    return /^\\[.+\\]$/i.test(path);\n}\n/**\n * Checks if an element is a native HTML5 multi-select input element\n */\nfunction isNativeMultiSelect(el) {\n    return isNativeSelect(el) && el.multiple;\n}\n/**\n * Checks if an element is a native HTML5 select input element\n */\nfunction isNativeSelect(el) {\n    return el.tagName === 'SELECT';\n}\n/**\n * Checks if a tag name with attrs object will render a native multi-select element\n */\nfunction isNativeMultiSelectNode(tag, attrs) {\n    // The falsy value array is the values that Vue won't add the `multiple` prop if it has one of these values\n    const hasTruthyBindingValue = ![false, null, undefined, 0].includes(attrs.multiple) && !Number.isNaN(attrs.multiple);\n    return tag === 'select' && 'multiple' in attrs && hasTruthyBindingValue;\n}\n/**\n * Checks if a node should have a `:value` binding or not\n *\n * These nodes should not have a value binding\n * For files, because they are not reactive\n * For multi-selects because the value binding will reset the value\n */\nfunction shouldHaveValueBinding(tag, attrs) {\n    return !isNativeMultiSelectNode(tag, attrs) && attrs.type !== 'file' && !hasCheckedAttr(attrs.type);\n}\nfunction isFormSubmitEvent(evt) {\n    return isEvent(evt) && evt.target && 'submit' in evt.target;\n}\nfunction isEvent(evt) {\n    if (!evt) {\n        return false;\n    }\n    if (typeof Event !== 'undefined' && isCallable(Event) && evt instanceof Event) {\n        return true;\n    }\n    // this is for IE and Cypress #3161\n    /* istanbul ignore next */\n    if (evt && evt.srcElement) {\n        return true;\n    }\n    return false;\n}\nfunction isPropPresent(obj, prop) {\n    return prop in obj && obj[prop] !== IS_ABSENT;\n}\n/**\n * Compares if two values are the same borrowed from:\n * https://github.com/epoberezkin/fast-deep-equal\n * We added a case for file matching since `Object.keys` doesn't work with Files.\n *\n * NB: keys with the value undefined are ignored in the evaluation and considered equal to missing keys.\n * */\nfunction isEqual(a, b) {\n    if (a === b)\n        return true;\n    if (a && b && typeof a === 'object' && typeof b === 'object') {\n        if (a.constructor !== b.constructor)\n            return false;\n        // eslint-disable-next-line no-var\n        var length, i, keys;\n        if (Array.isArray(a)) {\n            length = a.length;\n            if (length != b.length)\n                return false;\n            for (i = length; i-- !== 0;)\n                if (!isEqual(a[i], b[i]))\n                    return false;\n            return true;\n        }\n        if (a instanceof Map && b instanceof Map) {\n            if (a.size !== b.size)\n                return false;\n            for (i of a.entries())\n                if (!b.has(i[0]))\n                    return false;\n            for (i of a.entries())\n                if (!isEqual(i[1], b.get(i[0])))\n                    return false;\n            return true;\n        }\n        // We added this part for file comparison, arguably a little naive but should work for most cases.\n        // #3911\n        if (isFile(a) && isFile(b)) {\n            if (a.size !== b.size)\n                return false;\n            if (a.name !== b.name)\n                return false;\n            if (a.lastModified !== b.lastModified)\n                return false;\n            if (a.type !== b.type)\n                return false;\n            return true;\n        }\n        if (a instanceof Set && b instanceof Set) {\n            if (a.size !== b.size)\n                return false;\n            for (i of a.entries())\n                if (!b.has(i[0]))\n                    return false;\n            return true;\n        }\n        if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n            length = a.length;\n            if (length != b.length)\n                return false;\n            for (i = length; i-- !== 0;)\n                if (a[i] !== b[i])\n                    return false;\n            return true;\n        }\n        if (a.constructor === RegExp)\n            return a.source === b.source && a.flags === b.flags;\n        if (a.valueOf !== Object.prototype.valueOf)\n            return a.valueOf() === b.valueOf();\n        if (a.toString !== Object.prototype.toString)\n            return a.toString() === b.toString();\n        keys = Object.keys(a);\n        length = keys.length - countUndefinedValues(a, keys);\n        if (length !== Object.keys(b).length - countUndefinedValues(b, Object.keys(b)))\n            return false;\n        for (i = length; i-- !== 0;) {\n            if (!Object.prototype.hasOwnProperty.call(b, keys[i]))\n                return false;\n        }\n        for (i = length; i-- !== 0;) {\n            // eslint-disable-next-line no-var\n            var key = keys[i];\n            if (!isEqual(a[key], b[key]))\n                return false;\n        }\n        return true;\n    }\n    // true if both NaN, false otherwise\n    return a !== a && b !== b;\n}\nfunction countUndefinedValues(a, keys) {\n    let result = 0;\n    for (let i = keys.length; i-- !== 0;) {\n        // eslint-disable-next-line no-var\n        var key = keys[i];\n        if (a[key] === undefined)\n            result++;\n    }\n    return result;\n}\nfunction isFile(a) {\n    if (!isClient) {\n        return false;\n    }\n    return a instanceof File;\n}\n\nfunction cleanupNonNestedPath(path) {\n    if (isNotNestedPath(path)) {\n        return path.replace(/\\[|\\]/gi, '');\n    }\n    return path;\n}\nfunction getFromPath(object, path, fallback) {\n    if (!object) {\n        return fallback;\n    }\n    if (isNotNestedPath(path)) {\n        return object[cleanupNonNestedPath(path)];\n    }\n    const resolvedValue = (path || '')\n        .split(/\\.|\\[(\\d+)\\]/)\n        .filter(Boolean)\n        .reduce((acc, propKey) => {\n        if (isContainerValue(acc) && propKey in acc) {\n            return acc[propKey];\n        }\n        return fallback;\n    }, object);\n    return resolvedValue;\n}\n/**\n * Sets a nested property value in a path, creates the path properties if it doesn't exist\n */\nfunction setInPath(object, path, value) {\n    if (isNotNestedPath(path)) {\n        object[cleanupNonNestedPath(path)] = value;\n        return;\n    }\n    const keys = path.split(/\\.|\\[(\\d+)\\]/).filter(Boolean);\n    let acc = object;\n    for (let i = 0; i < keys.length; i++) {\n        // Last key, set it\n        if (i === keys.length - 1) {\n            acc[keys[i]] = value;\n            return;\n        }\n        // Key does not exist, create a container for it\n        if (!(keys[i] in acc) || isNullOrUndefined(acc[keys[i]])) {\n            // container can be either an object or an array depending on the next key if it exists\n            acc[keys[i]] = isIndex(keys[i + 1]) ? [] : {};\n        }\n        acc = acc[keys[i]];\n    }\n}\nfunction unset(object, key) {\n    if (Array.isArray(object) && isIndex(key)) {\n        object.splice(Number(key), 1);\n        return;\n    }\n    if (isObject(object)) {\n        delete object[key];\n    }\n}\n/**\n * Removes a nested property from object\n */\nfunction unsetPath(object, path) {\n    if (isNotNestedPath(path)) {\n        delete object[cleanupNonNestedPath(path)];\n        return;\n    }\n    const keys = path.split(/\\.|\\[(\\d+)\\]/).filter(Boolean);\n    let acc = object;\n    for (let i = 0; i < keys.length; i++) {\n        // Last key, unset it\n        if (i === keys.length - 1) {\n            unset(acc, keys[i]);\n            break;\n        }\n        // Key does not exist, exit\n        if (!(keys[i] in acc) || isNullOrUndefined(acc[keys[i]])) {\n            break;\n        }\n        acc = acc[keys[i]];\n    }\n    const pathValues = keys.map((_, idx) => {\n        return getFromPath(object, keys.slice(0, idx).join('.'));\n    });\n    for (let i = pathValues.length - 1; i >= 0; i--) {\n        if (!isEmptyContainer(pathValues[i])) {\n            continue;\n        }\n        if (i === 0) {\n            unset(object, keys[0]);\n            continue;\n        }\n        unset(pathValues[i - 1], keys[i - 1]);\n    }\n}\n/**\n * A typed version of Object.keys\n */\nfunction keysOf(record) {\n    return Object.keys(record);\n}\n// Uses same component provide as its own injections\n// Due to changes in https://github.com/vuejs/vue-next/pull/2424\nfunction injectWithSelf(symbol, def = undefined) {\n    const vm = getCurrentInstance();\n    return (vm === null || vm === void 0 ? void 0 : vm.provides[symbol]) || inject(symbol, def);\n}\nfunction warn(message) {\n    warn$1(`[vee-validate]: ${message}`);\n}\nfunction resolveNextCheckboxValue(currentValue, checkedValue, uncheckedValue) {\n    if (Array.isArray(currentValue)) {\n        const newVal = [...currentValue];\n        // Use isEqual since checked object values can possibly fail the equality check #3883\n        const idx = newVal.findIndex(v => isEqual(v, checkedValue));\n        idx >= 0 ? newVal.splice(idx, 1) : newVal.push(checkedValue);\n        return newVal;\n    }\n    return isEqual(currentValue, checkedValue) ? uncheckedValue : checkedValue;\n}\n/**\n * Creates a throttled function that only invokes the provided function (`func`) at most once per within a given number of milliseconds\n * (`limit`)\n */\nfunction throttle(func, limit) {\n    let inThrottle;\n    let lastResult;\n    return function (...args) {\n        // eslint-disable-next-line @typescript-eslint/no-this-alias\n        const context = this;\n        if (!inThrottle) {\n            inThrottle = true;\n            setTimeout(() => (inThrottle = false), limit);\n            lastResult = func.apply(context, args);\n        }\n        return lastResult;\n    };\n}\nfunction debounceAsync(inner, ms = 0) {\n    let timer = null;\n    let resolves = [];\n    return function (...args) {\n        // Run the function after a certain amount of time\n        if (timer) {\n            clearTimeout(timer);\n        }\n        // @ts-expect-error timer is a number\n        timer = setTimeout(() => {\n            // Get the result of the inner function, then apply it to the resolve function of\n            // each promise that has been created since the last time the inner function was run\n            const result = inner(...args);\n            resolves.forEach(r => r(result));\n            resolves = [];\n        }, ms);\n        return new Promise(resolve => resolves.push(resolve));\n    };\n}\nfunction applyModelModifiers(value, modifiers) {\n    if (!isObject(modifiers)) {\n        return value;\n    }\n    if (modifiers.number) {\n        return toNumber(value);\n    }\n    return value;\n}\nfunction withLatest(fn, onDone) {\n    let latestRun;\n    return async function runLatest(...args) {\n        const pending = fn(...args);\n        latestRun = pending;\n        const result = await pending;\n        if (pending !== latestRun) {\n            return result;\n        }\n        latestRun = undefined;\n        return onDone(result, args);\n    };\n}\nfunction computedDeep({ get, set }) {\n    const baseRef = ref(klona(get()));\n    watch(get, newValue => {\n        if (isEqual(newValue, baseRef.value)) {\n            return;\n        }\n        baseRef.value = klona(newValue);\n    }, {\n        deep: true,\n    });\n    watch(baseRef, newValue => {\n        if (isEqual(newValue, get())) {\n            return;\n        }\n        set(klona(newValue));\n    }, {\n        deep: true,\n    });\n    return baseRef;\n}\nfunction normalizeErrorItem(message) {\n    return Array.isArray(message) ? message : message ? [message] : [];\n}\nfunction resolveFieldOrPathState(path) {\n    const form = injectWithSelf(FormContextKey);\n    const state = path ? computed(() => form === null || form === void 0 ? void 0 : form.getPathState(toValue(path))) : undefined;\n    const field = path ? undefined : inject(FieldContextKey);\n    if (!field && !(state === null || state === void 0 ? void 0 : state.value)) {\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn(`field with name ${toValue(path)} was not found`);\n        }\n    }\n    return state || field;\n}\nfunction omit(obj, keys) {\n    const target = {};\n    for (const key in obj) {\n        if (!keys.includes(key)) {\n            target[key] = obj[key];\n        }\n    }\n    return target;\n}\nfunction debounceNextTick(inner) {\n    let lastTick = null;\n    let resolves = [];\n    return function (...args) {\n        // Run the function after a certain amount of time\n        const thisTick = nextTick(() => {\n            if (lastTick !== thisTick) {\n                return;\n            }\n            // Get the result of the inner function, then apply it to the resolve function of\n            // each promise that has been created since the last time the inner function was run\n            const result = inner(...args);\n            resolves.forEach(r => r(result));\n            resolves = [];\n            lastTick = null;\n        });\n        lastTick = thisTick;\n        return new Promise(resolve => resolves.push(resolve));\n    };\n}\n\nfunction normalizeChildren(tag, context, slotProps) {\n    if (!context.slots.default) {\n        return context.slots.default;\n    }\n    if (typeof tag === 'string' || !tag) {\n        return context.slots.default(slotProps());\n    }\n    return {\n        default: () => { var _a, _b; return (_b = (_a = context.slots).default) === null || _b === void 0 ? void 0 : _b.call(_a, slotProps()); },\n    };\n}\n/**\n * Vue adds a `_value` prop at the moment on the input elements to store the REAL value on them, real values are different than the `value` attribute\n * as they do not get casted to strings unlike `el.value` which preserves user-code behavior\n */\nfunction getBoundValue(el) {\n    if (hasValueBinding(el)) {\n        return el._value;\n    }\n    return undefined;\n}\n/**\n * Vue adds a `_value` prop at the moment on the input elements to store the REAL value on them, real values are different than the `value` attribute\n * as they do not get casted to strings unlike `el.value` which preserves user-code behavior\n */\nfunction hasValueBinding(el) {\n    return '_value' in el;\n}\n\nfunction parseInputValue(el) {\n    if (el.type === 'number') {\n        return Number.isNaN(el.valueAsNumber) ? el.value : el.valueAsNumber;\n    }\n    if (el.type === 'range') {\n        return Number.isNaN(el.valueAsNumber) ? el.value : el.valueAsNumber;\n    }\n    return el.value;\n}\nfunction normalizeEventValue(value) {\n    if (!isEvent(value)) {\n        return value;\n    }\n    const input = value.target;\n    // Vue sets the current bound value on `_value` prop\n    // for checkboxes it it should fetch the value binding type as is (boolean instead of string)\n    if (hasCheckedAttr(input.type) && hasValueBinding(input)) {\n        return getBoundValue(input);\n    }\n    if (input.type === 'file' && input.files) {\n        const files = Array.from(input.files);\n        return input.multiple ? files : files[0];\n    }\n    if (isNativeMultiSelect(input)) {\n        return Array.from(input.options)\n            .filter(opt => opt.selected && !opt.disabled)\n            .map(getBoundValue);\n    }\n    // makes sure we get the actual `option` bound value\n    // #3440\n    if (isNativeSelect(input)) {\n        const selectedOption = Array.from(input.options).find(opt => opt.selected);\n        return selectedOption ? getBoundValue(selectedOption) : input.value;\n    }\n    return parseInputValue(input);\n}\n\n/**\n * Normalizes the given rules expression.\n */\nfunction normalizeRules(rules) {\n    const acc = {};\n    Object.defineProperty(acc, '_$$isNormalized', {\n        value: true,\n        writable: false,\n        enumerable: false,\n        configurable: false,\n    });\n    if (!rules) {\n        return acc;\n    }\n    // Object is already normalized, skip.\n    if (isObject(rules) && rules._$$isNormalized) {\n        return rules;\n    }\n    if (isObject(rules)) {\n        return Object.keys(rules).reduce((prev, curr) => {\n            const params = normalizeParams(rules[curr]);\n            if (rules[curr] !== false) {\n                prev[curr] = buildParams(params);\n            }\n            return prev;\n        }, acc);\n    }\n    /* istanbul ignore if */\n    if (typeof rules !== 'string') {\n        return acc;\n    }\n    return rules.split('|').reduce((prev, rule) => {\n        const parsedRule = parseRule(rule);\n        if (!parsedRule.name) {\n            return prev;\n        }\n        prev[parsedRule.name] = buildParams(parsedRule.params);\n        return prev;\n    }, acc);\n}\n/**\n * Normalizes a rule param.\n */\nfunction normalizeParams(params) {\n    if (params === true) {\n        return [];\n    }\n    if (Array.isArray(params)) {\n        return params;\n    }\n    if (isObject(params)) {\n        return params;\n    }\n    return [params];\n}\nfunction buildParams(provided) {\n    const mapValueToLocator = (value) => {\n        // A target param using interpolation\n        if (typeof value === 'string' && value[0] === '@') {\n            return createLocator(value.slice(1));\n        }\n        return value;\n    };\n    if (Array.isArray(provided)) {\n        return provided.map(mapValueToLocator);\n    }\n    // #3073\n    if (provided instanceof RegExp) {\n        return [provided];\n    }\n    return Object.keys(provided).reduce((prev, key) => {\n        prev[key] = mapValueToLocator(provided[key]);\n        return prev;\n    }, {});\n}\n/**\n * Parses a rule string expression.\n */\nconst parseRule = (rule) => {\n    let params = [];\n    const name = rule.split(':')[0];\n    if (rule.includes(':')) {\n        params = rule.split(':').slice(1).join(':').split(',');\n    }\n    return { name, params };\n};\nfunction createLocator(value) {\n    const locator = (crossTable) => {\n        var _a;\n        const val = (_a = getFromPath(crossTable, value)) !== null && _a !== void 0 ? _a : crossTable[value];\n        return val;\n    };\n    locator.__locatorRef = value;\n    return locator;\n}\nfunction extractLocators(params) {\n    if (Array.isArray(params)) {\n        return params.filter(isLocator);\n    }\n    return keysOf(params)\n        .filter(key => isLocator(params[key]))\n        .map(key => params[key]);\n}\n\nconst DEFAULT_CONFIG = {\n    generateMessage: ({ field }) => `${field} is not valid.`,\n    bails: true,\n    validateOnBlur: true,\n    validateOnChange: true,\n    validateOnInput: false,\n    validateOnModelUpdate: true,\n};\nlet currentConfig = Object.assign({}, DEFAULT_CONFIG);\nconst getConfig = () => currentConfig;\nconst setConfig = (newConf) => {\n    currentConfig = Object.assign(Object.assign({}, currentConfig), newConf);\n};\nconst configure = setConfig;\n\n/**\n * Validates a value against the rules.\n */\nasync function validate(value, rules, options = {}) {\n    const shouldBail = options === null || options === void 0 ? void 0 : options.bails;\n    const field = {\n        name: (options === null || options === void 0 ? void 0 : options.name) || '{field}',\n        rules,\n        label: options === null || options === void 0 ? void 0 : options.label,\n        bails: shouldBail !== null && shouldBail !== void 0 ? shouldBail : true,\n        formData: (options === null || options === void 0 ? void 0 : options.values) || {},\n    };\n    const result = await _validate(field, value);\n    return Object.assign(Object.assign({}, result), { valid: !result.errors.length });\n}\n/**\n * Starts the validation process.\n */\nasync function _validate(field, value) {\n    const rules = field.rules;\n    if (isTypedSchema(rules) || isYupValidator(rules)) {\n        return validateFieldWithTypedSchema(value, Object.assign(Object.assign({}, field), { rules }));\n    }\n    // if a generic function or chain of generic functions\n    if (isCallable(rules) || Array.isArray(rules)) {\n        const ctx = {\n            field: field.label || field.name,\n            name: field.name,\n            label: field.label,\n            form: field.formData,\n            value,\n        };\n        // Normalize the pipeline\n        const pipeline = Array.isArray(rules) ? rules : [rules];\n        const length = pipeline.length;\n        const errors = [];\n        for (let i = 0; i < length; i++) {\n            const rule = pipeline[i];\n            const result = await rule(value, ctx);\n            const isValid = typeof result !== 'string' && !Array.isArray(result) && result;\n            if (isValid) {\n                continue;\n            }\n            if (Array.isArray(result)) {\n                errors.push(...result);\n            }\n            else {\n                const message = typeof result === 'string' ? result : _generateFieldError(ctx);\n                errors.push(message);\n            }\n            if (field.bails) {\n                return {\n                    errors,\n                };\n            }\n        }\n        return {\n            errors,\n        };\n    }\n    const normalizedContext = Object.assign(Object.assign({}, field), { rules: normalizeRules(rules) });\n    const errors = [];\n    const rulesKeys = Object.keys(normalizedContext.rules);\n    const length = rulesKeys.length;\n    for (let i = 0; i < length; i++) {\n        const rule = rulesKeys[i];\n        const result = await _test(normalizedContext, value, {\n            name: rule,\n            params: normalizedContext.rules[rule],\n        });\n        if (result.error) {\n            errors.push(result.error);\n            if (field.bails) {\n                return {\n                    errors,\n                };\n            }\n        }\n    }\n    return {\n        errors,\n    };\n}\nfunction isYupError(err) {\n    return !!err && err.name === 'ValidationError';\n}\nfunction yupToTypedSchema(yupSchema) {\n    const schema = {\n        __type: 'VVTypedSchema',\n        async parse(values, context) {\n            var _a;\n            try {\n                const output = await yupSchema.validate(values, { abortEarly: false, context: (context === null || context === void 0 ? void 0 : context.formData) || {} });\n                return {\n                    output,\n                    errors: [],\n                };\n            }\n            catch (err) {\n                // Yup errors have a name prop one them.\n                // https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string\n                if (!isYupError(err)) {\n                    throw err;\n                }\n                if (!((_a = err.inner) === null || _a === void 0 ? void 0 : _a.length) && err.errors.length) {\n                    return { errors: [{ path: err.path, errors: err.errors }] };\n                }\n                const errors = err.inner.reduce((acc, curr) => {\n                    const path = curr.path || '';\n                    if (!acc[path]) {\n                        acc[path] = { errors: [], path };\n                    }\n                    acc[path].errors.push(...curr.errors);\n                    return acc;\n                }, {});\n                return { errors: Object.values(errors) };\n            }\n        },\n    };\n    return schema;\n}\n/**\n * Handles yup validation\n */\nasync function validateFieldWithTypedSchema(value, context) {\n    const typedSchema = isTypedSchema(context.rules) ? context.rules : yupToTypedSchema(context.rules);\n    const result = await typedSchema.parse(value, { formData: context.formData });\n    const messages = [];\n    for (const error of result.errors) {\n        if (error.errors.length) {\n            messages.push(...error.errors);\n        }\n    }\n    return {\n        value: result.value,\n        errors: messages,\n    };\n}\n/**\n * Tests a single input value against a rule.\n */\nasync function _test(field, value, rule) {\n    const validator = resolveRule(rule.name);\n    if (!validator) {\n        throw new Error(`No such validator '${rule.name}' exists.`);\n    }\n    const params = fillTargetValues(rule.params, field.formData);\n    const ctx = {\n        field: field.label || field.name,\n        name: field.name,\n        label: field.label,\n        value,\n        form: field.formData,\n        rule: Object.assign(Object.assign({}, rule), { params }),\n    };\n    const result = await validator(value, params, ctx);\n    if (typeof result === 'string') {\n        return {\n            error: result,\n        };\n    }\n    return {\n        error: result ? undefined : _generateFieldError(ctx),\n    };\n}\n/**\n * Generates error messages.\n */\nfunction _generateFieldError(fieldCtx) {\n    const message = getConfig().generateMessage;\n    if (!message) {\n        return 'Field is invalid';\n    }\n    return message(fieldCtx);\n}\nfunction fillTargetValues(params, crossTable) {\n    const normalize = (value) => {\n        if (isLocator(value)) {\n            return value(crossTable);\n        }\n        return value;\n    };\n    if (Array.isArray(params)) {\n        return params.map(normalize);\n    }\n    return Object.keys(params).reduce((acc, param) => {\n        acc[param] = normalize(params[param]);\n        return acc;\n    }, {});\n}\nasync function validateTypedSchema(schema, values) {\n    const typedSchema = isTypedSchema(schema) ? schema : yupToTypedSchema(schema);\n    const validationResult = await typedSchema.parse(klona(values), { formData: klona(values) });\n    const results = {};\n    const errors = {};\n    for (const error of validationResult.errors) {\n        const messages = error.errors;\n        // Fixes issue with path mapping with Yup 1.0 including quotes around array indices\n        const path = (error.path || '').replace(/\\[\"(\\d+)\"\\]/g, (_, m) => {\n            return `[${m}]`;\n        });\n        results[path] = { valid: !messages.length, errors: messages };\n        if (messages.length) {\n            errors[path] = messages[0];\n        }\n    }\n    return {\n        valid: !validationResult.errors.length,\n        results,\n        errors,\n        values: validationResult.value,\n        source: 'schema',\n    };\n}\nasync function validateObjectSchema(schema, values, opts) {\n    const paths = keysOf(schema);\n    const validations = paths.map(async (path) => {\n        var _a, _b, _c;\n        const strings = (_a = opts === null || opts === void 0 ? void 0 : opts.names) === null || _a === void 0 ? void 0 : _a[path];\n        const fieldResult = await validate(getFromPath(values, path), schema[path], {\n            name: (strings === null || strings === void 0 ? void 0 : strings.name) || path,\n            label: strings === null || strings === void 0 ? void 0 : strings.label,\n            values: values,\n            bails: (_c = (_b = opts === null || opts === void 0 ? void 0 : opts.bailsMap) === null || _b === void 0 ? void 0 : _b[path]) !== null && _c !== void 0 ? _c : true,\n        });\n        return Object.assign(Object.assign({}, fieldResult), { path });\n    });\n    let isAllValid = true;\n    const validationResults = await Promise.all(validations);\n    const results = {};\n    const errors = {};\n    for (const result of validationResults) {\n        results[result.path] = {\n            valid: result.valid,\n            errors: result.errors,\n        };\n        if (!result.valid) {\n            isAllValid = false;\n            errors[result.path] = result.errors[0];\n        }\n    }\n    return {\n        valid: isAllValid,\n        results,\n        errors,\n        source: 'schema',\n    };\n}\n\nlet ID_COUNTER = 0;\nfunction useFieldState(path, init) {\n    const { value, initialValue, setInitialValue } = _useFieldValue(path, init.modelValue, init.form);\n    if (!init.form) {\n        const { errors, setErrors } = createFieldErrors();\n        const id = ID_COUNTER >= Number.MAX_SAFE_INTEGER ? 0 : ++ID_COUNTER;\n        const meta = createFieldMeta(value, initialValue, errors, init.schema);\n        function setState(state) {\n            var _a;\n            if ('value' in state) {\n                value.value = state.value;\n            }\n            if ('errors' in state) {\n                setErrors(state.errors);\n            }\n            if ('touched' in state) {\n                meta.touched = (_a = state.touched) !== null && _a !== void 0 ? _a : meta.touched;\n            }\n            if ('initialValue' in state) {\n                setInitialValue(state.initialValue);\n            }\n        }\n        return {\n            id,\n            path,\n            value,\n            initialValue,\n            meta,\n            flags: { pendingUnmount: { [id]: false }, pendingReset: false },\n            errors,\n            setState,\n        };\n    }\n    const state = init.form.createPathState(path, {\n        bails: init.bails,\n        label: init.label,\n        type: init.type,\n        validate: init.validate,\n        schema: init.schema,\n    });\n    const errors = computed(() => state.errors);\n    function setState(state) {\n        var _a, _b, _c;\n        if ('value' in state) {\n            value.value = state.value;\n        }\n        if ('errors' in state) {\n            (_a = init.form) === null || _a === void 0 ? void 0 : _a.setFieldError(unref(path), state.errors);\n        }\n        if ('touched' in state) {\n            (_b = init.form) === null || _b === void 0 ? void 0 : _b.setFieldTouched(unref(path), (_c = state.touched) !== null && _c !== void 0 ? _c : false);\n        }\n        if ('initialValue' in state) {\n            setInitialValue(state.initialValue);\n        }\n    }\n    return {\n        id: Array.isArray(state.id) ? state.id[state.id.length - 1] : state.id,\n        path,\n        value,\n        errors,\n        meta: state,\n        initialValue,\n        flags: state.__flags,\n        setState,\n    };\n}\n/**\n * Creates the field value and resolves the initial value\n */\nfunction _useFieldValue(path, modelValue, form) {\n    const modelRef = ref(unref(modelValue));\n    function resolveInitialValue() {\n        if (!form) {\n            return unref(modelRef);\n        }\n        return getFromPath(form.initialValues.value, unref(path), unref(modelRef));\n    }\n    function setInitialValue(value) {\n        if (!form) {\n            modelRef.value = value;\n            return;\n        }\n        form.setFieldInitialValue(unref(path), value, true);\n    }\n    const initialValue = computed(resolveInitialValue);\n    // if no form is associated, use a regular ref.\n    if (!form) {\n        const value = ref(resolveInitialValue());\n        return {\n            value,\n            initialValue,\n            setInitialValue,\n        };\n    }\n    // to set the initial value, first check if there is a current value, if there is then use it.\n    // otherwise use the configured initial value if it exists.\n    // prioritize model value over form values\n    // #3429\n    const currentValue = resolveModelValue(modelValue, form, initialValue, path);\n    form.stageInitialValue(unref(path), currentValue, true);\n    // otherwise use a computed setter that triggers the `setFieldValue`\n    const value = computed({\n        get() {\n            return getFromPath(form.values, unref(path));\n        },\n        set(newVal) {\n            form.setFieldValue(unref(path), newVal, false);\n        },\n    });\n    return {\n        value,\n        initialValue,\n        setInitialValue,\n    };\n}\n/*\n  to set the initial value, first check if there is a current value, if there is then use it.\n  otherwise use the configured initial value if it exists.\n  prioritize model value over form values\n  #3429\n*/\nfunction resolveModelValue(modelValue, form, initialValue, path) {\n    if (isRef(modelValue)) {\n        return unref(modelValue);\n    }\n    if (modelValue !== undefined) {\n        return modelValue;\n    }\n    return getFromPath(form.values, unref(path), unref(initialValue));\n}\n/**\n * Creates meta flags state and some associated effects with them\n */\nfunction createFieldMeta(currentValue, initialValue, errors, schema) {\n    const isRequired = computed(() => { var _a, _b, _c; return (_c = (_b = (_a = toValue(schema)) === null || _a === void 0 ? void 0 : _a.describe) === null || _b === void 0 ? void 0 : _b.call(_a).required) !== null && _c !== void 0 ? _c : false; });\n    const meta = reactive({\n        touched: false,\n        pending: false,\n        valid: true,\n        required: isRequired,\n        validated: !!unref(errors).length,\n        initialValue: computed(() => unref(initialValue)),\n        dirty: computed(() => {\n            return !isEqual(unref(currentValue), unref(initialValue));\n        }),\n    });\n    watch(errors, value => {\n        meta.valid = !value.length;\n    }, {\n        immediate: true,\n        flush: 'sync',\n    });\n    return meta;\n}\n/**\n * Creates the error message state for the field state\n */\nfunction createFieldErrors() {\n    const errors = ref([]);\n    return {\n        errors,\n        setErrors: (messages) => {\n            errors.value = normalizeErrorItem(messages);\n        },\n    };\n}\n\nconst DEVTOOLS_FORMS = {};\nconst DEVTOOLS_FIELDS = {};\nconst INSPECTOR_ID = 'vee-validate-inspector';\nconst COLORS = {\n    error: 0xbd4b4b,\n    success: 0x06d77b,\n    unknown: 0x54436b,\n    white: 0xffffff,\n    black: 0x000000,\n    blue: 0x035397,\n    purple: 0xb980f0,\n    orange: 0xf5a962,\n    gray: 0xbbbfca,\n};\nlet SELECTED_NODE = null;\n/**\n * Plugin API\n */\nlet API;\nasync function installDevtoolsPlugin(app) {\n    if ((process.env.NODE_ENV !== 'production')) {\n        if (!isClient) {\n            return;\n        }\n        const devtools = await import('@vue/devtools-api');\n        devtools.setupDevtoolsPlugin({\n            id: 'vee-validate-devtools-plugin',\n            label: 'VeeValidate Plugin',\n            packageName: 'vee-validate',\n            homepage: 'https://vee-validate.logaretm.com/v4',\n            app,\n            logo: 'https://vee-validate.logaretm.com/v4/logo.png',\n        }, api => {\n            API = api;\n            api.addInspector({\n                id: INSPECTOR_ID,\n                icon: 'rule',\n                label: 'vee-validate',\n                noSelectionText: 'Select a vee-validate node to inspect',\n                actions: [\n                    {\n                        icon: 'done_outline',\n                        tooltip: 'Validate selected item',\n                        action: async () => {\n                            if (!SELECTED_NODE) {\n                                // eslint-disable-next-line no-console\n                                console.error('There is not a valid selected vee-validate node or component');\n                                return;\n                            }\n                            if (SELECTED_NODE.type === 'field') {\n                                await SELECTED_NODE.field.validate();\n                                return;\n                            }\n                            if (SELECTED_NODE.type === 'form') {\n                                await SELECTED_NODE.form.validate();\n                                return;\n                            }\n                            if (SELECTED_NODE.type === 'pathState') {\n                                await SELECTED_NODE.form.validateField(SELECTED_NODE.state.path);\n                            }\n                        },\n                    },\n                    {\n                        icon: 'delete_sweep',\n                        tooltip: 'Clear validation state of the selected item',\n                        action: () => {\n                            if (!SELECTED_NODE) {\n                                // eslint-disable-next-line no-console\n                                console.error('There is not a valid selected vee-validate node or component');\n                                return;\n                            }\n                            if (SELECTED_NODE.type === 'field') {\n                                SELECTED_NODE.field.resetField();\n                                return;\n                            }\n                            if (SELECTED_NODE.type === 'form') {\n                                SELECTED_NODE.form.resetForm();\n                            }\n                            if (SELECTED_NODE.type === 'pathState') {\n                                SELECTED_NODE.form.resetField(SELECTED_NODE.state.path);\n                            }\n                        },\n                    },\n                ],\n            });\n            api.on.getInspectorTree(payload => {\n                if (payload.inspectorId !== INSPECTOR_ID) {\n                    return;\n                }\n                const forms = Object.values(DEVTOOLS_FORMS);\n                const fields = Object.values(DEVTOOLS_FIELDS);\n                payload.rootNodes = [\n                    ...forms.map(mapFormForDevtoolsInspector),\n                    ...fields.map(field => mapFieldForDevtoolsInspector(field)),\n                ];\n            });\n            api.on.getInspectorState(payload => {\n                if (payload.inspectorId !== INSPECTOR_ID) {\n                    return;\n                }\n                const { form, field, state, type } = decodeNodeId(payload.nodeId);\n                api.unhighlightElement();\n                if (form && type === 'form') {\n                    payload.state = buildFormState(form);\n                    SELECTED_NODE = { type: 'form', form };\n                    api.highlightElement(form._vm);\n                    return;\n                }\n                if (state && type === 'pathState' && form) {\n                    payload.state = buildFieldState(state);\n                    SELECTED_NODE = { type: 'pathState', state, form };\n                    return;\n                }\n                if (field && type === 'field') {\n                    payload.state = buildFieldState({\n                        errors: field.errors.value,\n                        dirty: field.meta.dirty,\n                        valid: field.meta.valid,\n                        touched: field.meta.touched,\n                        value: field.value.value,\n                        initialValue: field.meta.initialValue,\n                    });\n                    SELECTED_NODE = { field, type: 'field' };\n                    api.highlightElement(field._vm);\n                    return;\n                }\n                SELECTED_NODE = null;\n                api.unhighlightElement();\n            });\n        });\n    }\n}\nconst refreshInspector = throttle(() => {\n    setTimeout(async () => {\n        await nextTick();\n        API === null || API === void 0 ? void 0 : API.sendInspectorState(INSPECTOR_ID);\n        API === null || API === void 0 ? void 0 : API.sendInspectorTree(INSPECTOR_ID);\n    }, 100);\n}, 100);\nfunction registerFormWithDevTools(form) {\n    const vm = getCurrentInstance();\n    if (!API) {\n        const app = vm === null || vm === void 0 ? void 0 : vm.appContext.app;\n        if (!app) {\n            return;\n        }\n        installDevtoolsPlugin(app);\n    }\n    DEVTOOLS_FORMS[form.formId] = Object.assign({}, form);\n    DEVTOOLS_FORMS[form.formId]._vm = vm;\n    onUnmounted(() => {\n        delete DEVTOOLS_FORMS[form.formId];\n        refreshInspector();\n    });\n    refreshInspector();\n}\nfunction registerSingleFieldWithDevtools(field) {\n    const vm = getCurrentInstance();\n    if (!API) {\n        const app = vm === null || vm === void 0 ? void 0 : vm.appContext.app;\n        if (!app) {\n            return;\n        }\n        installDevtoolsPlugin(app);\n    }\n    DEVTOOLS_FIELDS[field.id] = Object.assign({}, field);\n    DEVTOOLS_FIELDS[field.id]._vm = vm;\n    onUnmounted(() => {\n        delete DEVTOOLS_FIELDS[field.id];\n        refreshInspector();\n    });\n    refreshInspector();\n}\nfunction mapFormForDevtoolsInspector(form) {\n    const { textColor, bgColor } = getValidityColors(form.meta.value.valid);\n    const formTreeNodes = {};\n    Object.values(form.getAllPathStates()).forEach(state => {\n        setInPath(formTreeNodes, toValue(state.path), mapPathForDevtoolsInspector(state, form));\n    });\n    function buildFormTree(tree, path = []) {\n        const key = [...path].pop();\n        if ('id' in tree) {\n            return Object.assign(Object.assign({}, tree), { label: key || tree.label });\n        }\n        if (isObject(tree)) {\n            return {\n                id: `${path.join('.')}`,\n                label: key || '',\n                children: Object.keys(tree).map(key => buildFormTree(tree[key], [...path, key])),\n            };\n        }\n        if (Array.isArray(tree)) {\n            return {\n                id: `${path.join('.')}`,\n                label: `${key}[]`,\n                children: tree.map((c, idx) => buildFormTree(c, [...path, String(idx)])),\n            };\n        }\n        return { id: '', label: '', children: [] };\n    }\n    const { children } = buildFormTree(formTreeNodes);\n    return {\n        id: encodeNodeId(form),\n        label: form.name,\n        children,\n        tags: [\n            {\n                label: 'Form',\n                textColor,\n                backgroundColor: bgColor,\n            },\n            {\n                label: `${form.getAllPathStates().length} fields`,\n                textColor: COLORS.white,\n                backgroundColor: COLORS.unknown,\n            },\n        ],\n    };\n}\nfunction mapPathForDevtoolsInspector(state, form) {\n    return {\n        id: encodeNodeId(form, state),\n        label: toValue(state.path),\n        tags: getFieldNodeTags(state.multiple, state.fieldsCount, state.type, state.valid, form),\n    };\n}\nfunction mapFieldForDevtoolsInspector(field, form) {\n    return {\n        id: encodeNodeId(form, field),\n        label: unref(field.name),\n        tags: getFieldNodeTags(false, 1, field.type, field.meta.valid, form),\n    };\n}\nfunction getFieldNodeTags(multiple, fieldsCount, type, valid, form) {\n    const { textColor, bgColor } = getValidityColors(valid);\n    return [\n        multiple\n            ? undefined\n            : {\n                label: 'Field',\n                textColor,\n                backgroundColor: bgColor,\n            },\n        !form\n            ? {\n                label: 'Standalone',\n                textColor: COLORS.black,\n                backgroundColor: COLORS.gray,\n            }\n            : undefined,\n        type === 'checkbox'\n            ? {\n                label: 'Checkbox',\n                textColor: COLORS.white,\n                backgroundColor: COLORS.blue,\n            }\n            : undefined,\n        type === 'radio'\n            ? {\n                label: 'Radio',\n                textColor: COLORS.white,\n                backgroundColor: COLORS.purple,\n            }\n            : undefined,\n        multiple\n            ? {\n                label: 'Multiple',\n                textColor: COLORS.black,\n                backgroundColor: COLORS.orange,\n            }\n            : undefined,\n    ].filter(Boolean);\n}\nfunction encodeNodeId(form, stateOrField) {\n    const type = stateOrField ? ('path' in stateOrField ? 'pathState' : 'field') : 'form';\n    const fieldPath = stateOrField ? ('path' in stateOrField ? stateOrField === null || stateOrField === void 0 ? void 0 : stateOrField.path : toValue(stateOrField === null || stateOrField === void 0 ? void 0 : stateOrField.name)) : '';\n    const idObject = { f: form === null || form === void 0 ? void 0 : form.formId, ff: (stateOrField === null || stateOrField === void 0 ? void 0 : stateOrField.id) || fieldPath, type };\n    return btoa(encodeURIComponent(JSON.stringify(idObject)));\n}\nfunction decodeNodeId(nodeId) {\n    try {\n        const idObject = JSON.parse(decodeURIComponent(atob(nodeId)));\n        const form = DEVTOOLS_FORMS[idObject.f];\n        if (!form && idObject.ff) {\n            const field = DEVTOOLS_FIELDS[idObject.ff];\n            if (!field) {\n                return {};\n            }\n            return {\n                type: idObject.type,\n                field,\n            };\n        }\n        if (!form) {\n            return {};\n        }\n        const state = form.getPathState(idObject.ff);\n        return {\n            type: idObject.type,\n            form,\n            state,\n        };\n    }\n    catch (err) {\n        // console.error(`Devtools: [vee-validate] Failed to parse node id ${nodeId}`);\n    }\n    return {};\n}\nfunction buildFieldState(state) {\n    return {\n        'Field state': [\n            { key: 'errors', value: state.errors },\n            {\n                key: 'initialValue',\n                value: state.initialValue,\n            },\n            {\n                key: 'currentValue',\n                value: state.value,\n            },\n            {\n                key: 'touched',\n                value: state.touched,\n            },\n            {\n                key: 'dirty',\n                value: state.dirty,\n            },\n            {\n                key: 'valid',\n                value: state.valid,\n            },\n        ],\n    };\n}\nfunction buildFormState(form) {\n    const { errorBag, meta, values, isSubmitting, isValidating, submitCount } = form;\n    return {\n        'Form state': [\n            {\n                key: 'submitCount',\n                value: submitCount.value,\n            },\n            {\n                key: 'isSubmitting',\n                value: isSubmitting.value,\n            },\n            {\n                key: 'isValidating',\n                value: isValidating.value,\n            },\n            {\n                key: 'touched',\n                value: meta.value.touched,\n            },\n            {\n                key: 'dirty',\n                value: meta.value.dirty,\n            },\n            {\n                key: 'valid',\n                value: meta.value.valid,\n            },\n            {\n                key: 'initialValues',\n                value: meta.value.initialValues,\n            },\n            {\n                key: 'currentValues',\n                value: values,\n            },\n            {\n                key: 'errors',\n                value: keysOf(errorBag.value).reduce((acc, key) => {\n                    var _a;\n                    const message = (_a = errorBag.value[key]) === null || _a === void 0 ? void 0 : _a[0];\n                    if (message) {\n                        acc[key] = message;\n                    }\n                    return acc;\n                }, {}),\n            },\n        ],\n    };\n}\n/**\n * Resolves the tag color based on the form state\n */\nfunction getValidityColors(valid) {\n    return {\n        bgColor: valid ? COLORS.success : COLORS.error,\n        textColor: valid ? COLORS.black : COLORS.white,\n    };\n}\n\n/**\n * Creates a field composite.\n */\nfunction useField(path, rules, opts) {\n    if (hasCheckedAttr(opts === null || opts === void 0 ? void 0 : opts.type)) {\n        return useFieldWithChecked(path, rules, opts);\n    }\n    return _useField(path, rules, opts);\n}\nfunction _useField(path, rules, opts) {\n    const { initialValue: modelValue, validateOnMount, bails, type, checkedValue, label, validateOnValueUpdate, uncheckedValue, controlled, keepValueOnUnmount, syncVModel, form: controlForm, } = normalizeOptions(opts);\n    const injectedForm = controlled ? injectWithSelf(FormContextKey) : undefined;\n    const form = controlForm || injectedForm;\n    const name = computed(() => normalizeFormPath(toValue(path)));\n    const validator = computed(() => {\n        const schema = toValue(form === null || form === void 0 ? void 0 : form.schema);\n        if (schema) {\n            return undefined;\n        }\n        const rulesValue = unref(rules);\n        if (isYupValidator(rulesValue) ||\n            isTypedSchema(rulesValue) ||\n            isCallable(rulesValue) ||\n            Array.isArray(rulesValue)) {\n            return rulesValue;\n        }\n        return normalizeRules(rulesValue);\n    });\n    const isTyped = !isCallable(validator.value) && isTypedSchema(toValue(rules));\n    const { id, value, initialValue, meta, setState, errors, flags } = useFieldState(name, {\n        modelValue,\n        form,\n        bails,\n        label,\n        type,\n        validate: validator.value ? validate$1 : undefined,\n        schema: isTyped ? rules : undefined,\n    });\n    const errorMessage = computed(() => errors.value[0]);\n    if (syncVModel) {\n        useVModel({\n            value,\n            prop: syncVModel,\n            handleChange,\n            shouldValidate: () => validateOnValueUpdate && !flags.pendingReset,\n        });\n    }\n    /**\n     * Handles common onBlur meta update\n     */\n    const handleBlur = (evt, shouldValidate = false) => {\n        meta.touched = true;\n        if (shouldValidate) {\n            validateWithStateMutation();\n        }\n    };\n    async function validateCurrentValue(mode) {\n        var _a, _b;\n        if (form === null || form === void 0 ? void 0 : form.validateSchema) {\n            const { results } = await form.validateSchema(mode);\n            return (_a = results[toValue(name)]) !== null && _a !== void 0 ? _a : { valid: true, errors: [] };\n        }\n        if (validator.value) {\n            return validate(value.value, validator.value, {\n                name: toValue(name),\n                label: toValue(label),\n                values: (_b = form === null || form === void 0 ? void 0 : form.values) !== null && _b !== void 0 ? _b : {},\n                bails,\n            });\n        }\n        return { valid: true, errors: [] };\n    }\n    const validateWithStateMutation = withLatest(async () => {\n        meta.pending = true;\n        meta.validated = true;\n        return validateCurrentValue('validated-only');\n    }, result => {\n        if (flags.pendingUnmount[field.id]) {\n            return result;\n        }\n        setState({ errors: result.errors });\n        meta.pending = false;\n        meta.valid = result.valid;\n        return result;\n    });\n    const validateValidStateOnly = withLatest(async () => {\n        return validateCurrentValue('silent');\n    }, result => {\n        meta.valid = result.valid;\n        return result;\n    });\n    function validate$1(opts) {\n        if ((opts === null || opts === void 0 ? void 0 : opts.mode) === 'silent') {\n            return validateValidStateOnly();\n        }\n        return validateWithStateMutation();\n    }\n    // Common input/change event handler\n    function handleChange(e, shouldValidate = true) {\n        const newValue = normalizeEventValue(e);\n        setValue(newValue, shouldValidate);\n    }\n    // Runs the initial validation\n    onMounted(() => {\n        if (validateOnMount) {\n            return validateWithStateMutation();\n        }\n        // validate self initially if no form was handling this\n        // forms should have their own initial silent validation run to make things more efficient\n        if (!form || !form.validateSchema) {\n            validateValidStateOnly();\n        }\n    });\n    function setTouched(isTouched) {\n        meta.touched = isTouched;\n    }\n    function resetField(state) {\n        var _a;\n        const newValue = state && 'value' in state ? state.value : initialValue.value;\n        setState({\n            value: klona(newValue),\n            initialValue: klona(newValue),\n            touched: (_a = state === null || state === void 0 ? void 0 : state.touched) !== null && _a !== void 0 ? _a : false,\n            errors: (state === null || state === void 0 ? void 0 : state.errors) || [],\n        });\n        meta.pending = false;\n        meta.validated = false;\n        validateValidStateOnly();\n    }\n    const vm = getCurrentInstance();\n    function setValue(newValue, shouldValidate = true) {\n        value.value = vm && syncVModel ? applyModelModifiers(newValue, vm.props.modelModifiers) : newValue;\n        const validateFn = shouldValidate ? validateWithStateMutation : validateValidStateOnly;\n        validateFn();\n    }\n    function setErrors(errors) {\n        setState({ errors: Array.isArray(errors) ? errors : [errors] });\n    }\n    const valueProxy = computed({\n        get() {\n            return value.value;\n        },\n        set(newValue) {\n            setValue(newValue, validateOnValueUpdate);\n        },\n    });\n    const field = {\n        id,\n        name,\n        label,\n        value: valueProxy,\n        meta,\n        errors,\n        errorMessage,\n        type,\n        checkedValue,\n        uncheckedValue,\n        bails,\n        keepValueOnUnmount,\n        resetField,\n        handleReset: () => resetField(),\n        validate: validate$1,\n        handleChange,\n        handleBlur,\n        setState,\n        setTouched,\n        setErrors,\n        setValue,\n    };\n    provide(FieldContextKey, field);\n    if (isRef(rules) && typeof unref(rules) !== 'function') {\n        watch(rules, (value, oldValue) => {\n            if (isEqual(value, oldValue)) {\n                return;\n            }\n            meta.validated ? validateWithStateMutation() : validateValidStateOnly();\n        }, {\n            deep: true,\n        });\n    }\n    if ((process.env.NODE_ENV !== 'production')) {\n        field._vm = getCurrentInstance();\n        watch(() => (Object.assign(Object.assign({ errors: errors.value }, meta), { value: value.value })), refreshInspector, {\n            deep: true,\n        });\n        if (!form) {\n            registerSingleFieldWithDevtools(field);\n        }\n    }\n    // if no associated form return the field API immediately\n    if (!form) {\n        return field;\n    }\n    // associate the field with the given form\n    // extract cross-field dependencies in a computed prop\n    const dependencies = computed(() => {\n        const rulesVal = validator.value;\n        // is falsy, a function schema or a yup schema\n        if (!rulesVal ||\n            isCallable(rulesVal) ||\n            isYupValidator(rulesVal) ||\n            isTypedSchema(rulesVal) ||\n            Array.isArray(rulesVal)) {\n            return {};\n        }\n        return Object.keys(rulesVal).reduce((acc, rule) => {\n            const deps = extractLocators(rulesVal[rule])\n                .map((dep) => dep.__locatorRef)\n                .reduce((depAcc, depName) => {\n                const depValue = getFromPath(form.values, depName) || form.values[depName];\n                if (depValue !== undefined) {\n                    depAcc[depName] = depValue;\n                }\n                return depAcc;\n            }, {});\n            Object.assign(acc, deps);\n            return acc;\n        }, {});\n    });\n    // Adds a watcher that runs the validation whenever field dependencies change\n    watch(dependencies, (deps, oldDeps) => {\n        // Skip if no dependencies or if the field wasn't manipulated\n        if (!Object.keys(deps).length) {\n            return;\n        }\n        const shouldValidate = !isEqual(deps, oldDeps);\n        if (shouldValidate) {\n            meta.validated ? validateWithStateMutation() : validateValidStateOnly();\n        }\n    });\n    onBeforeUnmount(() => {\n        var _a;\n        const shouldKeepValue = (_a = toValue(field.keepValueOnUnmount)) !== null && _a !== void 0 ? _a : toValue(form.keepValuesOnUnmount);\n        const path = toValue(name);\n        if (shouldKeepValue || !form || flags.pendingUnmount[field.id]) {\n            form === null || form === void 0 ? void 0 : form.removePathState(path, id);\n            return;\n        }\n        flags.pendingUnmount[field.id] = true;\n        const pathState = form.getPathState(path);\n        const matchesId = Array.isArray(pathState === null || pathState === void 0 ? void 0 : pathState.id) && (pathState === null || pathState === void 0 ? void 0 : pathState.multiple)\n            ? pathState === null || pathState === void 0 ? void 0 : pathState.id.includes(field.id)\n            : (pathState === null || pathState === void 0 ? void 0 : pathState.id) === field.id;\n        if (!matchesId) {\n            return;\n        }\n        if ((pathState === null || pathState === void 0 ? void 0 : pathState.multiple) && Array.isArray(pathState.value)) {\n            const valueIdx = pathState.value.findIndex(i => isEqual(i, toValue(field.checkedValue)));\n            if (valueIdx > -1) {\n                const newVal = [...pathState.value];\n                newVal.splice(valueIdx, 1);\n                form.setFieldValue(path, newVal);\n            }\n            if (Array.isArray(pathState.id)) {\n                pathState.id.splice(pathState.id.indexOf(field.id), 1);\n            }\n        }\n        else {\n            form.unsetPathValue(toValue(name));\n        }\n        form.removePathState(path, id);\n    });\n    return field;\n}\n/**\n * Normalizes partial field options to include the full options\n */\nfunction normalizeOptions(opts) {\n    const defaults = () => ({\n        initialValue: undefined,\n        validateOnMount: false,\n        bails: true,\n        label: undefined,\n        validateOnValueUpdate: true,\n        keepValueOnUnmount: undefined,\n        syncVModel: false,\n        controlled: true,\n    });\n    const isVModelSynced = !!(opts === null || opts === void 0 ? void 0 : opts.syncVModel);\n    const modelPropName = typeof (opts === null || opts === void 0 ? void 0 : opts.syncVModel) === 'string' ? opts.syncVModel : (opts === null || opts === void 0 ? void 0 : opts.modelPropName) || 'modelValue';\n    const initialValue = isVModelSynced && !('initialValue' in (opts || {}))\n        ? getCurrentModelValue(getCurrentInstance(), modelPropName)\n        : opts === null || opts === void 0 ? void 0 : opts.initialValue;\n    if (!opts) {\n        return Object.assign(Object.assign({}, defaults()), { initialValue });\n    }\n    // TODO: Deprecate this in next major release\n    const checkedValue = 'valueProp' in opts ? opts.valueProp : opts.checkedValue;\n    const controlled = 'standalone' in opts ? !opts.standalone : opts.controlled;\n    const syncVModel = (opts === null || opts === void 0 ? void 0 : opts.modelPropName) || (opts === null || opts === void 0 ? void 0 : opts.syncVModel) || false;\n    return Object.assign(Object.assign(Object.assign({}, defaults()), (opts || {})), { initialValue, controlled: controlled !== null && controlled !== void 0 ? controlled : true, checkedValue,\n        syncVModel });\n}\nfunction useFieldWithChecked(name, rules, opts) {\n    const form = !(opts === null || opts === void 0 ? void 0 : opts.standalone) ? injectWithSelf(FormContextKey) : undefined;\n    const checkedValue = opts === null || opts === void 0 ? void 0 : opts.checkedValue;\n    const uncheckedValue = opts === null || opts === void 0 ? void 0 : opts.uncheckedValue;\n    function patchCheckedApi(field) {\n        const handleChange = field.handleChange;\n        const checked = computed(() => {\n            const currentValue = toValue(field.value);\n            const checkedVal = toValue(checkedValue);\n            return Array.isArray(currentValue)\n                ? currentValue.findIndex(v => isEqual(v, checkedVal)) >= 0\n                : isEqual(checkedVal, currentValue);\n        });\n        function handleCheckboxChange(e, shouldValidate = true) {\n            var _a, _b;\n            if (checked.value === ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.checked)) {\n                if (shouldValidate) {\n                    field.validate();\n                }\n                return;\n            }\n            const path = toValue(name);\n            const pathState = form === null || form === void 0 ? void 0 : form.getPathState(path);\n            const value = normalizeEventValue(e);\n            let newValue = (_b = toValue(checkedValue)) !== null && _b !== void 0 ? _b : value;\n            if (form && (pathState === null || pathState === void 0 ? void 0 : pathState.multiple) && pathState.type === 'checkbox') {\n                newValue = resolveNextCheckboxValue(getFromPath(form.values, path) || [], newValue, undefined);\n            }\n            else if ((opts === null || opts === void 0 ? void 0 : opts.type) === 'checkbox') {\n                newValue = resolveNextCheckboxValue(toValue(field.value), newValue, toValue(uncheckedValue));\n            }\n            handleChange(newValue, shouldValidate);\n        }\n        return Object.assign(Object.assign({}, field), { checked,\n            checkedValue,\n            uncheckedValue, handleChange: handleCheckboxChange });\n    }\n    return patchCheckedApi(_useField(name, rules, opts));\n}\nfunction useVModel({ prop, value, handleChange, shouldValidate }) {\n    const vm = getCurrentInstance();\n    /* istanbul ignore next */\n    if (!vm || !prop) {\n        if ((process.env.NODE_ENV !== 'production')) {\n            // eslint-disable-next-line no-console\n            console.warn('Failed to setup model events because `useField` was not called in setup.');\n        }\n        return;\n    }\n    const propName = typeof prop === 'string' ? prop : 'modelValue';\n    const emitName = `update:${propName}`;\n    // Component doesn't have a model prop setup (must be defined on the props)\n    if (!(propName in vm.props)) {\n        return;\n    }\n    watch(value, newValue => {\n        if (isEqual(newValue, getCurrentModelValue(vm, propName))) {\n            return;\n        }\n        vm.emit(emitName, newValue);\n    });\n    watch(() => getCurrentModelValue(vm, propName), propValue => {\n        if (propValue === IS_ABSENT && value.value === undefined) {\n            return;\n        }\n        const newValue = propValue === IS_ABSENT ? undefined : propValue;\n        if (isEqual(newValue, value.value)) {\n            return;\n        }\n        handleChange(newValue, shouldValidate());\n    });\n}\nfunction getCurrentModelValue(vm, propName) {\n    if (!vm) {\n        return undefined;\n    }\n    return vm.props[propName];\n}\n\nconst FieldImpl = /** #__PURE__ */ defineComponent({\n    name: 'Field',\n    inheritAttrs: false,\n    props: {\n        as: {\n            type: [String, Object],\n            default: undefined,\n        },\n        name: {\n            type: String,\n            required: true,\n        },\n        rules: {\n            type: [Object, String, Function],\n            default: undefined,\n        },\n        validateOnMount: {\n            type: Boolean,\n            default: false,\n        },\n        validateOnBlur: {\n            type: Boolean,\n            default: undefined,\n        },\n        validateOnChange: {\n            type: Boolean,\n            default: undefined,\n        },\n        validateOnInput: {\n            type: Boolean,\n            default: undefined,\n        },\n        validateOnModelUpdate: {\n            type: Boolean,\n            default: undefined,\n        },\n        bails: {\n            type: Boolean,\n            default: () => getConfig().bails,\n        },\n        label: {\n            type: String,\n            default: undefined,\n        },\n        uncheckedValue: {\n            type: null,\n            default: undefined,\n        },\n        modelValue: {\n            type: null,\n            default: IS_ABSENT,\n        },\n        modelModifiers: {\n            type: null,\n            default: () => ({}),\n        },\n        'onUpdate:modelValue': {\n            type: null,\n            default: undefined,\n        },\n        standalone: {\n            type: Boolean,\n            default: false,\n        },\n        keepValue: {\n            type: Boolean,\n            default: undefined,\n        },\n    },\n    setup(props, ctx) {\n        const rules = toRef(props, 'rules');\n        const name = toRef(props, 'name');\n        const label = toRef(props, 'label');\n        const uncheckedValue = toRef(props, 'uncheckedValue');\n        const keepValue = toRef(props, 'keepValue');\n        const { errors, value, errorMessage, validate: validateField, handleChange, handleBlur, setTouched, resetField, handleReset, meta, checked, setErrors, setValue, } = useField(name, rules, {\n            validateOnMount: props.validateOnMount,\n            bails: props.bails,\n            standalone: props.standalone,\n            type: ctx.attrs.type,\n            initialValue: resolveInitialValue(props, ctx),\n            // Only for checkboxes and radio buttons\n            checkedValue: ctx.attrs.value,\n            uncheckedValue,\n            label,\n            validateOnValueUpdate: props.validateOnModelUpdate,\n            keepValueOnUnmount: keepValue,\n            syncVModel: true,\n        });\n        // If there is a v-model applied on the component we need to emit the `update:modelValue` whenever the value binding changes\n        const onChangeHandler = function handleChangeWithModel(e, shouldValidate = true) {\n            handleChange(e, shouldValidate);\n        };\n        const sharedProps = computed(() => {\n            const { validateOnInput, validateOnChange, validateOnBlur, validateOnModelUpdate } = resolveValidationTriggers(props);\n            function baseOnBlur(e) {\n                handleBlur(e, validateOnBlur);\n                if (isCallable(ctx.attrs.onBlur)) {\n                    ctx.attrs.onBlur(e);\n                }\n            }\n            function baseOnInput(e) {\n                onChangeHandler(e, validateOnInput);\n                if (isCallable(ctx.attrs.onInput)) {\n                    ctx.attrs.onInput(e);\n                }\n            }\n            function baseOnChange(e) {\n                onChangeHandler(e, validateOnChange);\n                if (isCallable(ctx.attrs.onChange)) {\n                    ctx.attrs.onChange(e);\n                }\n            }\n            const attrs = {\n                name: props.name,\n                onBlur: baseOnBlur,\n                onInput: baseOnInput,\n                onChange: baseOnChange,\n            };\n            attrs['onUpdate:modelValue'] = e => onChangeHandler(e, validateOnModelUpdate);\n            return attrs;\n        });\n        const fieldProps = computed(() => {\n            const attrs = Object.assign({}, sharedProps.value);\n            if (hasCheckedAttr(ctx.attrs.type) && checked) {\n                attrs.checked = checked.value;\n            }\n            const tag = resolveTag(props, ctx);\n            if (shouldHaveValueBinding(tag, ctx.attrs)) {\n                attrs.value = value.value;\n            }\n            return attrs;\n        });\n        const componentProps = computed(() => {\n            return Object.assign(Object.assign({}, sharedProps.value), { modelValue: value.value });\n        });\n        function slotProps() {\n            return {\n                field: fieldProps.value,\n                componentField: componentProps.value,\n                value: value.value,\n                meta,\n                errors: errors.value,\n                errorMessage: errorMessage.value,\n                validate: validateField,\n                resetField,\n                handleChange: onChangeHandler,\n                handleInput: e => onChangeHandler(e, false),\n                handleReset,\n                handleBlur: sharedProps.value.onBlur,\n                setTouched,\n                setErrors,\n                setValue,\n            };\n        }\n        ctx.expose({\n            value,\n            meta,\n            errors,\n            errorMessage,\n            setErrors,\n            setTouched,\n            setValue,\n            reset: resetField,\n            validate: validateField,\n            handleChange,\n        });\n        return () => {\n            const tag = resolveDynamicComponent(resolveTag(props, ctx));\n            const children = normalizeChildren(tag, ctx, slotProps);\n            if (tag) {\n                return h(tag, Object.assign(Object.assign({}, ctx.attrs), fieldProps.value), children);\n            }\n            return children;\n        };\n    },\n});\nfunction resolveTag(props, ctx) {\n    let tag = props.as || '';\n    if (!props.as && !ctx.slots.default) {\n        tag = 'input';\n    }\n    return tag;\n}\nfunction resolveValidationTriggers(props) {\n    var _a, _b, _c, _d;\n    const { validateOnInput, validateOnChange, validateOnBlur, validateOnModelUpdate } = getConfig();\n    return {\n        validateOnInput: (_a = props.validateOnInput) !== null && _a !== void 0 ? _a : validateOnInput,\n        validateOnChange: (_b = props.validateOnChange) !== null && _b !== void 0 ? _b : validateOnChange,\n        validateOnBlur: (_c = props.validateOnBlur) !== null && _c !== void 0 ? _c : validateOnBlur,\n        validateOnModelUpdate: (_d = props.validateOnModelUpdate) !== null && _d !== void 0 ? _d : validateOnModelUpdate,\n    };\n}\nfunction resolveInitialValue(props, ctx) {\n    // Gets the initial value either from `value` prop/attr or `v-model` binding (modelValue)\n    // For checkboxes and radio buttons it will always be the model value not the `value` attribute\n    if (!hasCheckedAttr(ctx.attrs.type)) {\n        return isPropPresent(props, 'modelValue') ? props.modelValue : ctx.attrs.value;\n    }\n    return isPropPresent(props, 'modelValue') ? props.modelValue : undefined;\n}\nconst Field = FieldImpl;\n\nlet FORM_COUNTER = 0;\nconst PRIVATE_PATH_STATE_KEYS = ['bails', 'fieldsCount', 'id', 'multiple', 'type', 'validate'];\nfunction resolveInitialValues(opts) {\n    const givenInitial = (opts === null || opts === void 0 ? void 0 : opts.initialValues) || {};\n    const providedValues = Object.assign({}, toValue(givenInitial));\n    const schema = unref(opts === null || opts === void 0 ? void 0 : opts.validationSchema);\n    if (schema && isTypedSchema(schema) && isCallable(schema.cast)) {\n        return klona(schema.cast(providedValues) || {});\n    }\n    return klona(providedValues);\n}\nfunction useForm(opts) {\n    var _a;\n    const formId = FORM_COUNTER++;\n    const name = (opts === null || opts === void 0 ? void 0 : opts.name) || 'Form';\n    // Prevents fields from double resetting their values, which causes checkboxes to toggle their initial value\n    let FIELD_ID_COUNTER = 0;\n    // If the form is currently submitting\n    const isSubmitting = ref(false);\n    // If the form is currently validating\n    const isValidating = ref(false);\n    // The number of times the user tried to submit the form\n    const submitCount = ref(0);\n    // field arrays managed by this form\n    const fieldArrays = [];\n    // a private ref for all form values\n    const formValues = reactive(resolveInitialValues(opts));\n    const pathStates = ref([]);\n    const extraErrorsBag = ref({});\n    const pathStateLookup = ref({});\n    const rebuildPathLookup = debounceNextTick(() => {\n        pathStateLookup.value = pathStates.value.reduce((names, state) => {\n            names[normalizeFormPath(toValue(state.path))] = state;\n            return names;\n        }, {});\n    });\n    /**\n     * Manually sets an error message on a specific field\n     */\n    function setFieldError(field, message) {\n        const state = findPathState(field);\n        if (!state) {\n            if (typeof field === 'string') {\n                extraErrorsBag.value[normalizeFormPath(field)] = normalizeErrorItem(message);\n            }\n            return;\n        }\n        // Move the error from the extras path if exists\n        if (typeof field === 'string') {\n            const normalizedPath = normalizeFormPath(field);\n            if (extraErrorsBag.value[normalizedPath]) {\n                delete extraErrorsBag.value[normalizedPath];\n            }\n        }\n        state.errors = normalizeErrorItem(message);\n        state.valid = !state.errors.length;\n    }\n    /**\n     * Sets errors for the fields specified in the object\n     */\n    function setErrors(paths) {\n        keysOf(paths).forEach(path => {\n            setFieldError(path, paths[path]);\n        });\n    }\n    if (opts === null || opts === void 0 ? void 0 : opts.initialErrors) {\n        setErrors(opts.initialErrors);\n    }\n    const errorBag = computed(() => {\n        const pathErrors = pathStates.value.reduce((acc, state) => {\n            if (state.errors.length) {\n                acc[toValue(state.path)] = state.errors;\n            }\n            return acc;\n        }, {});\n        return Object.assign(Object.assign({}, extraErrorsBag.value), pathErrors);\n    });\n    // Gets the first error of each field\n    const errors = computed(() => {\n        return keysOf(errorBag.value).reduce((acc, key) => {\n            const errors = errorBag.value[key];\n            if (errors === null || errors === void 0 ? void 0 : errors.length) {\n                acc[key] = errors[0];\n            }\n            return acc;\n        }, {});\n    });\n    /**\n     * Holds a computed reference to all fields names and labels\n     */\n    const fieldNames = computed(() => {\n        return pathStates.value.reduce((names, state) => {\n            names[toValue(state.path)] = { name: toValue(state.path) || '', label: state.label || '' };\n            return names;\n        }, {});\n    });\n    const fieldBailsMap = computed(() => {\n        return pathStates.value.reduce((map, state) => {\n            var _a;\n            map[toValue(state.path)] = (_a = state.bails) !== null && _a !== void 0 ? _a : true;\n            return map;\n        }, {});\n    });\n    // mutable non-reactive reference to initial errors\n    // we need this to process initial errors then unset them\n    const initialErrors = Object.assign({}, ((opts === null || opts === void 0 ? void 0 : opts.initialErrors) || {}));\n    const keepValuesOnUnmount = (_a = opts === null || opts === void 0 ? void 0 : opts.keepValuesOnUnmount) !== null && _a !== void 0 ? _a : false;\n    // initial form values\n    const { initialValues, originalInitialValues, setInitialValues } = useFormInitialValues(pathStates, formValues, opts);\n    // form meta aggregations\n    const meta = useFormMeta(pathStates, formValues, originalInitialValues, errors);\n    const controlledValues = computed(() => {\n        return pathStates.value.reduce((acc, state) => {\n            const value = getFromPath(formValues, toValue(state.path));\n            setInPath(acc, toValue(state.path), value);\n            return acc;\n        }, {});\n    });\n    const schema = opts === null || opts === void 0 ? void 0 : opts.validationSchema;\n    function createPathState(path, config) {\n        var _a, _b;\n        const initialValue = computed(() => getFromPath(initialValues.value, toValue(path)));\n        const pathStateExists = pathStateLookup.value[toValue(path)];\n        const isCheckboxOrRadio = (config === null || config === void 0 ? void 0 : config.type) === 'checkbox' || (config === null || config === void 0 ? void 0 : config.type) === 'radio';\n        if (pathStateExists && isCheckboxOrRadio) {\n            pathStateExists.multiple = true;\n            const id = FIELD_ID_COUNTER++;\n            if (Array.isArray(pathStateExists.id)) {\n                pathStateExists.id.push(id);\n            }\n            else {\n                pathStateExists.id = [pathStateExists.id, id];\n            }\n            pathStateExists.fieldsCount++;\n            pathStateExists.__flags.pendingUnmount[id] = false;\n            return pathStateExists;\n        }\n        const currentValue = computed(() => getFromPath(formValues, toValue(path)));\n        const pathValue = toValue(path);\n        const unsetBatchIndex = UNSET_BATCH.findIndex(_path => _path === pathValue);\n        if (unsetBatchIndex !== -1) {\n            UNSET_BATCH.splice(unsetBatchIndex, 1);\n        }\n        const isRequired = computed(() => {\n            var _a, _b, _c, _d;\n            const schemaValue = toValue(schema);\n            if (isTypedSchema(schemaValue)) {\n                return (_b = (_a = schemaValue.describe) === null || _a === void 0 ? void 0 : _a.call(schemaValue, toValue(path)).required) !== null && _b !== void 0 ? _b : false;\n            }\n            // Path own schema\n            const configSchemaValue = toValue(config === null || config === void 0 ? void 0 : config.schema);\n            if (isTypedSchema(configSchemaValue)) {\n                return (_d = (_c = configSchemaValue.describe) === null || _c === void 0 ? void 0 : _c.call(configSchemaValue).required) !== null && _d !== void 0 ? _d : false;\n            }\n            return false;\n        });\n        const id = FIELD_ID_COUNTER++;\n        const state = reactive({\n            id,\n            path,\n            touched: false,\n            pending: false,\n            valid: true,\n            validated: !!((_a = initialErrors[pathValue]) === null || _a === void 0 ? void 0 : _a.length),\n            required: isRequired,\n            initialValue,\n            errors: shallowRef([]),\n            bails: (_b = config === null || config === void 0 ? void 0 : config.bails) !== null && _b !== void 0 ? _b : false,\n            label: config === null || config === void 0 ? void 0 : config.label,\n            type: (config === null || config === void 0 ? void 0 : config.type) || 'default',\n            value: currentValue,\n            multiple: false,\n            __flags: {\n                pendingUnmount: { [id]: false },\n                pendingReset: false,\n            },\n            fieldsCount: 1,\n            validate: config === null || config === void 0 ? void 0 : config.validate,\n            dirty: computed(() => {\n                return !isEqual(unref(currentValue), unref(initialValue));\n            }),\n        });\n        pathStates.value.push(state);\n        pathStateLookup.value[pathValue] = state;\n        rebuildPathLookup();\n        if (errors.value[pathValue] && !initialErrors[pathValue]) {\n            nextTick(() => {\n                validateField(pathValue, { mode: 'silent' });\n            });\n        }\n        // Handles when a path changes\n        if (isRef(path)) {\n            watch(path, newPath => {\n                rebuildPathLookup();\n                const nextValue = klona(currentValue.value);\n                pathStateLookup.value[newPath] = state;\n                nextTick(() => {\n                    setInPath(formValues, newPath, nextValue);\n                });\n            });\n        }\n        return state;\n    }\n    /**\n     * Batches validation runs in 5ms batches\n     * Must have two distinct batch queues to make sure they don't override each other settings #3783\n     */\n    const debouncedSilentValidation = debounceAsync(_validateSchema, 5);\n    const debouncedValidation = debounceAsync(_validateSchema, 5);\n    const validateSchema = withLatest(async (mode) => {\n        return (await (mode === 'silent'\n            ? debouncedSilentValidation()\n            : debouncedValidation()));\n    }, (formResult, [mode]) => {\n        // fields by id lookup\n        // errors fields names, we need it to also check if custom errors are updated\n        const currentErrorsPaths = keysOf(formCtx.errorBag.value);\n        // collect all the keys from the schema and all fields\n        // this ensures we have a complete key map of all the fields\n        const paths = [\n            ...new Set([...keysOf(formResult.results), ...pathStates.value.map(p => p.path), ...currentErrorsPaths]),\n        ].sort();\n        // aggregates the paths into a single result object while applying the results on the fields\n        const results = paths.reduce((validation, _path) => {\n            var _a;\n            const expectedPath = _path;\n            const pathState = findPathState(expectedPath) || findHoistedPath(expectedPath);\n            const messages = ((_a = formResult.results[expectedPath]) === null || _a === void 0 ? void 0 : _a.errors) || [];\n            // This is the real path of the field, because it might've been a hoisted field\n            const path = (toValue(pathState === null || pathState === void 0 ? void 0 : pathState.path) || expectedPath);\n            // It is possible that multiple paths are collected across loops\n            // We want to merge them to avoid overriding any iteration's results\n            const fieldResult = mergeValidationResults({ errors: messages, valid: !messages.length }, validation.results[path]);\n            validation.results[path] = fieldResult;\n            if (!fieldResult.valid) {\n                validation.errors[path] = fieldResult.errors[0];\n            }\n            // clean up extra errors if path state exists\n            if (pathState && extraErrorsBag.value[path]) {\n                delete extraErrorsBag.value[path];\n            }\n            // field not rendered\n            if (!pathState) {\n                setFieldError(path, messages);\n                return validation;\n            }\n            // always update the valid flag regardless of the mode\n            pathState.valid = fieldResult.valid;\n            if (mode === 'silent') {\n                return validation;\n            }\n            if (mode === 'validated-only' && !pathState.validated) {\n                return validation;\n            }\n            setFieldError(pathState, fieldResult.errors);\n            return validation;\n        }, {\n            valid: formResult.valid,\n            results: {},\n            errors: {},\n            source: formResult.source,\n        });\n        if (formResult.values) {\n            results.values = formResult.values;\n            results.source = formResult.source;\n        }\n        keysOf(results.results).forEach(path => {\n            var _a;\n            const pathState = findPathState(path);\n            if (!pathState) {\n                return;\n            }\n            if (mode === 'silent') {\n                return;\n            }\n            if (mode === 'validated-only' && !pathState.validated) {\n                return;\n            }\n            setFieldError(pathState, (_a = results.results[path]) === null || _a === void 0 ? void 0 : _a.errors);\n        });\n        return results;\n    });\n    function mutateAllPathState(mutation) {\n        pathStates.value.forEach(mutation);\n    }\n    function findPathState(path) {\n        const normalizedPath = typeof path === 'string' ? normalizeFormPath(path) : path;\n        const pathState = typeof normalizedPath === 'string' ? pathStateLookup.value[normalizedPath] : normalizedPath;\n        return pathState;\n    }\n    function findHoistedPath(path) {\n        const candidates = pathStates.value.filter(state => path.startsWith(toValue(state.path)));\n        return candidates.reduce((bestCandidate, candidate) => {\n            if (!bestCandidate) {\n                return candidate;\n            }\n            return (candidate.path.length > bestCandidate.path.length ? candidate : bestCandidate);\n        }, undefined);\n    }\n    let UNSET_BATCH = [];\n    let PENDING_UNSET;\n    function unsetPathValue(path) {\n        UNSET_BATCH.push(path);\n        if (!PENDING_UNSET) {\n            PENDING_UNSET = nextTick(() => {\n                const sortedPaths = [...UNSET_BATCH].sort().reverse();\n                sortedPaths.forEach(p => {\n                    unsetPath(formValues, p);\n                });\n                UNSET_BATCH = [];\n                PENDING_UNSET = null;\n            });\n        }\n        return PENDING_UNSET;\n    }\n    function makeSubmissionFactory(onlyControlled) {\n        return function submitHandlerFactory(fn, onValidationError) {\n            return function submissionHandler(e) {\n                if (e instanceof Event) {\n                    e.preventDefault();\n                    e.stopPropagation();\n                }\n                // Touch all fields\n                mutateAllPathState(s => (s.touched = true));\n                isSubmitting.value = true;\n                submitCount.value++;\n                return validate()\n                    .then(result => {\n                    const values = klona(formValues);\n                    if (result.valid && typeof fn === 'function') {\n                        const controlled = klona(controlledValues.value);\n                        let submittedValues = (onlyControlled ? controlled : values);\n                        if (result.values) {\n                            submittedValues =\n                                result.source === 'schema'\n                                    ? result.values\n                                    : Object.assign({}, submittedValues, result.values);\n                        }\n                        return fn(submittedValues, {\n                            evt: e,\n                            controlledValues: controlled,\n                            setErrors,\n                            setFieldError,\n                            setTouched,\n                            setFieldTouched,\n                            setValues,\n                            setFieldValue,\n                            resetForm,\n                            resetField,\n                        });\n                    }\n                    if (!result.valid && typeof onValidationError === 'function') {\n                        onValidationError({\n                            values,\n                            evt: e,\n                            errors: result.errors,\n                            results: result.results,\n                        });\n                    }\n                })\n                    .then(returnVal => {\n                    isSubmitting.value = false;\n                    return returnVal;\n                }, err => {\n                    isSubmitting.value = false;\n                    // re-throw the err so it doesn't go silent\n                    throw err;\n                });\n            };\n        };\n    }\n    const handleSubmitImpl = makeSubmissionFactory(false);\n    const handleSubmit = handleSubmitImpl;\n    handleSubmit.withControlled = makeSubmissionFactory(true);\n    function removePathState(path, id) {\n        const idx = pathStates.value.findIndex(s => {\n            return s.path === path && (Array.isArray(s.id) ? s.id.includes(id) : s.id === id);\n        });\n        const pathState = pathStates.value[idx];\n        if (idx === -1 || !pathState) {\n            return;\n        }\n        nextTick(() => {\n            validateField(path, { mode: 'silent', warn: false });\n        });\n        if (pathState.multiple && pathState.fieldsCount) {\n            pathState.fieldsCount--;\n        }\n        if (Array.isArray(pathState.id)) {\n            const idIndex = pathState.id.indexOf(id);\n            if (idIndex >= 0) {\n                pathState.id.splice(idIndex, 1);\n            }\n            delete pathState.__flags.pendingUnmount[id];\n        }\n        if (!pathState.multiple || pathState.fieldsCount <= 0) {\n            pathStates.value.splice(idx, 1);\n            unsetInitialValue(path);\n            rebuildPathLookup();\n            delete pathStateLookup.value[path];\n        }\n    }\n    function destroyPath(path) {\n        keysOf(pathStateLookup.value).forEach(key => {\n            if (key.startsWith(path)) {\n                delete pathStateLookup.value[key];\n            }\n        });\n        pathStates.value = pathStates.value.filter(s => !s.path.startsWith(path));\n        nextTick(() => {\n            rebuildPathLookup();\n        });\n    }\n    const formCtx = {\n        name,\n        formId,\n        values: formValues,\n        controlledValues,\n        errorBag,\n        errors,\n        schema,\n        submitCount,\n        meta,\n        isSubmitting,\n        isValidating,\n        fieldArrays,\n        keepValuesOnUnmount,\n        validateSchema: unref(schema) ? validateSchema : undefined,\n        validate,\n        setFieldError,\n        validateField,\n        setFieldValue,\n        setValues,\n        setErrors,\n        setFieldTouched,\n        setTouched,\n        resetForm,\n        resetField,\n        handleSubmit,\n        useFieldModel,\n        defineInputBinds,\n        defineComponentBinds: defineComponentBinds,\n        defineField,\n        stageInitialValue,\n        unsetInitialValue,\n        setFieldInitialValue,\n        createPathState,\n        getPathState: findPathState,\n        unsetPathValue,\n        removePathState,\n        initialValues: initialValues,\n        getAllPathStates: () => pathStates.value,\n        destroyPath,\n        isFieldTouched,\n        isFieldDirty,\n        isFieldValid,\n    };\n    /**\n     * Sets a single field value\n     */\n    function setFieldValue(field, value, shouldValidate = true) {\n        const clonedValue = klona(value);\n        const path = typeof field === 'string' ? field : field.path;\n        const pathState = findPathState(path);\n        if (!pathState) {\n            createPathState(path);\n        }\n        setInPath(formValues, path, clonedValue);\n        if (shouldValidate) {\n            validateField(path);\n        }\n    }\n    function forceSetValues(fields, shouldValidate = true) {\n        // clean up old values\n        keysOf(formValues).forEach(key => {\n            delete formValues[key];\n        });\n        // set up new values\n        keysOf(fields).forEach(path => {\n            setFieldValue(path, fields[path], false);\n        });\n        if (shouldValidate) {\n            validate();\n        }\n    }\n    /**\n     * Sets multiple fields values\n     */\n    function setValues(fields, shouldValidate = true) {\n        merge(formValues, fields);\n        // regenerate the arrays when the form values change\n        fieldArrays.forEach(f => f && f.reset());\n        if (shouldValidate) {\n            validate();\n        }\n    }\n    function createModel(path, shouldValidate) {\n        const pathState = findPathState(toValue(path)) || createPathState(path);\n        return computed({\n            get() {\n                return pathState.value;\n            },\n            set(value) {\n                var _a;\n                const pathValue = toValue(path);\n                setFieldValue(pathValue, value, (_a = toValue(shouldValidate)) !== null && _a !== void 0 ? _a : false);\n            },\n        });\n    }\n    /**\n     * Sets the touched meta state on a field\n     */\n    function setFieldTouched(field, isTouched) {\n        const pathState = findPathState(field);\n        if (pathState) {\n            pathState.touched = isTouched;\n        }\n    }\n    function isFieldTouched(field) {\n        const pathState = findPathState(field);\n        if (pathState) {\n            return pathState.touched;\n        }\n        // Find all nested paths and consider their touched state\n        return pathStates.value.filter(s => s.path.startsWith(field)).some(s => s.touched);\n    }\n    function isFieldDirty(field) {\n        const pathState = findPathState(field);\n        if (pathState) {\n            return pathState.dirty;\n        }\n        return pathStates.value.filter(s => s.path.startsWith(field)).some(s => s.dirty);\n    }\n    function isFieldValid(field) {\n        const pathState = findPathState(field);\n        if (pathState) {\n            return pathState.valid;\n        }\n        return pathStates.value.filter(s => s.path.startsWith(field)).every(s => s.valid);\n    }\n    /**\n     * Sets the touched meta state on multiple fields\n     */\n    function setTouched(fields) {\n        if (typeof fields === 'boolean') {\n            mutateAllPathState(state => {\n                state.touched = fields;\n            });\n            return;\n        }\n        keysOf(fields).forEach(field => {\n            setFieldTouched(field, !!fields[field]);\n        });\n    }\n    function resetField(field, state) {\n        var _a;\n        const newValue = state && 'value' in state ? state.value : getFromPath(initialValues.value, field);\n        const pathState = findPathState(field);\n        if (pathState) {\n            pathState.__flags.pendingReset = true;\n        }\n        setFieldInitialValue(field, klona(newValue), true);\n        setFieldValue(field, newValue, false);\n        setFieldTouched(field, (_a = state === null || state === void 0 ? void 0 : state.touched) !== null && _a !== void 0 ? _a : false);\n        setFieldError(field, (state === null || state === void 0 ? void 0 : state.errors) || []);\n        nextTick(() => {\n            if (pathState) {\n                pathState.__flags.pendingReset = false;\n            }\n        });\n    }\n    /**\n     * Resets all fields\n     */\n    function resetForm(resetState, opts) {\n        let newValues = klona((resetState === null || resetState === void 0 ? void 0 : resetState.values) ? resetState.values : originalInitialValues.value);\n        newValues = (opts === null || opts === void 0 ? void 0 : opts.force) ? newValues : merge(originalInitialValues.value, newValues);\n        newValues = isTypedSchema(schema) && isCallable(schema.cast) ? schema.cast(newValues) : newValues;\n        setInitialValues(newValues, { force: opts === null || opts === void 0 ? void 0 : opts.force });\n        mutateAllPathState(state => {\n            var _a;\n            state.__flags.pendingReset = true;\n            state.validated = false;\n            state.touched = ((_a = resetState === null || resetState === void 0 ? void 0 : resetState.touched) === null || _a === void 0 ? void 0 : _a[toValue(state.path)]) || false;\n            setFieldValue(toValue(state.path), getFromPath(newValues, toValue(state.path)), false);\n            setFieldError(toValue(state.path), undefined);\n        });\n        (opts === null || opts === void 0 ? void 0 : opts.force) ? forceSetValues(newValues, false) : setValues(newValues, false);\n        setErrors((resetState === null || resetState === void 0 ? void 0 : resetState.errors) || {});\n        submitCount.value = (resetState === null || resetState === void 0 ? void 0 : resetState.submitCount) || 0;\n        nextTick(() => {\n            validate({ mode: 'silent' });\n            mutateAllPathState(state => {\n                state.__flags.pendingReset = false;\n            });\n        });\n    }\n    async function validate(opts) {\n        const mode = (opts === null || opts === void 0 ? void 0 : opts.mode) || 'force';\n        if (mode === 'force') {\n            mutateAllPathState(f => (f.validated = true));\n        }\n        if (formCtx.validateSchema) {\n            return formCtx.validateSchema(mode);\n        }\n        isValidating.value = true;\n        // No schema, each field is responsible to validate itself\n        const validations = await Promise.all(pathStates.value.map(state => {\n            if (!state.validate) {\n                return Promise.resolve({\n                    key: toValue(state.path),\n                    valid: true,\n                    errors: [],\n                    value: undefined,\n                });\n            }\n            return state.validate(opts).then(result => {\n                return {\n                    key: toValue(state.path),\n                    valid: result.valid,\n                    errors: result.errors,\n                    value: result.value,\n                };\n            });\n        }));\n        isValidating.value = false;\n        const results = {};\n        const errors = {};\n        const values = {};\n        for (const validation of validations) {\n            results[validation.key] = {\n                valid: validation.valid,\n                errors: validation.errors,\n            };\n            if (validation.value) {\n                setInPath(values, validation.key, validation.value);\n            }\n            if (validation.errors.length) {\n                errors[validation.key] = validation.errors[0];\n            }\n        }\n        return {\n            valid: validations.every(r => r.valid),\n            results,\n            errors,\n            values,\n            source: 'fields',\n        };\n    }\n    async function validateField(path, opts) {\n        var _a;\n        const state = findPathState(path);\n        if (state && (opts === null || opts === void 0 ? void 0 : opts.mode) !== 'silent') {\n            state.validated = true;\n        }\n        if (schema) {\n            const { results } = await validateSchema((opts === null || opts === void 0 ? void 0 : opts.mode) || 'validated-only');\n            return results[path] || { errors: [], valid: true };\n        }\n        if (state === null || state === void 0 ? void 0 : state.validate) {\n            return state.validate(opts);\n        }\n        const shouldWarn = !state && ((_a = opts === null || opts === void 0 ? void 0 : opts.warn) !== null && _a !== void 0 ? _a : true);\n        if (shouldWarn) {\n            if ((process.env.NODE_ENV !== 'production')) {\n                warn$1(`field with path ${path} was not found`);\n            }\n        }\n        return Promise.resolve({ errors: [], valid: true });\n    }\n    function unsetInitialValue(path) {\n        unsetPath(initialValues.value, path);\n    }\n    /**\n     * Sneaky function to set initial field values\n     */\n    function stageInitialValue(path, value, updateOriginal = false) {\n        setFieldInitialValue(path, value);\n        setInPath(formValues, path, value);\n        if (updateOriginal && !(opts === null || opts === void 0 ? void 0 : opts.initialValues)) {\n            setInPath(originalInitialValues.value, path, klona(value));\n        }\n    }\n    function setFieldInitialValue(path, value, updateOriginal = false) {\n        setInPath(initialValues.value, path, klona(value));\n        if (updateOriginal) {\n            setInPath(originalInitialValues.value, path, klona(value));\n        }\n    }\n    async function _validateSchema() {\n        const schemaValue = unref(schema);\n        if (!schemaValue) {\n            return { valid: true, results: {}, errors: {}, source: 'none' };\n        }\n        isValidating.value = true;\n        const formResult = isYupValidator(schemaValue) || isTypedSchema(schemaValue)\n            ? await validateTypedSchema(schemaValue, formValues)\n            : await validateObjectSchema(schemaValue, formValues, {\n                names: fieldNames.value,\n                bailsMap: fieldBailsMap.value,\n            });\n        isValidating.value = false;\n        return formResult;\n    }\n    const submitForm = handleSubmit((_, { evt }) => {\n        if (isFormSubmitEvent(evt)) {\n            evt.target.submit();\n        }\n    });\n    // Trigger initial validation\n    onMounted(() => {\n        if (opts === null || opts === void 0 ? void 0 : opts.initialErrors) {\n            setErrors(opts.initialErrors);\n        }\n        if (opts === null || opts === void 0 ? void 0 : opts.initialTouched) {\n            setTouched(opts.initialTouched);\n        }\n        // if validate on mount was enabled\n        if (opts === null || opts === void 0 ? void 0 : opts.validateOnMount) {\n            validate();\n            return;\n        }\n        // otherwise run initial silent validation through schema if available\n        // the useField should skip their own silent validation if a yup schema is present\n        if (formCtx.validateSchema) {\n            formCtx.validateSchema('silent');\n        }\n    });\n    if (isRef(schema)) {\n        watch(schema, () => {\n            var _a;\n            (_a = formCtx.validateSchema) === null || _a === void 0 ? void 0 : _a.call(formCtx, 'validated-only');\n        });\n    }\n    // Provide injections\n    provide(FormContextKey, formCtx);\n    if ((process.env.NODE_ENV !== 'production')) {\n        registerFormWithDevTools(formCtx);\n        watch(() => (Object.assign(Object.assign({ errors: errorBag.value }, meta.value), { values: formValues, isSubmitting: isSubmitting.value, isValidating: isValidating.value, submitCount: submitCount.value })), refreshInspector, {\n            deep: true,\n        });\n    }\n    function defineField(path, config) {\n        const label = isCallable(config) ? undefined : config === null || config === void 0 ? void 0 : config.label;\n        const pathState = (findPathState(toValue(path)) || createPathState(path, { label }));\n        const evalConfig = () => (isCallable(config) ? config(omit(pathState, PRIVATE_PATH_STATE_KEYS)) : config || {});\n        function onBlur() {\n            var _a;\n            pathState.touched = true;\n            const validateOnBlur = (_a = evalConfig().validateOnBlur) !== null && _a !== void 0 ? _a : getConfig().validateOnBlur;\n            if (validateOnBlur) {\n                validateField(toValue(pathState.path));\n            }\n        }\n        function onInput() {\n            var _a;\n            const validateOnInput = (_a = evalConfig().validateOnInput) !== null && _a !== void 0 ? _a : getConfig().validateOnInput;\n            if (validateOnInput) {\n                nextTick(() => {\n                    validateField(toValue(pathState.path));\n                });\n            }\n        }\n        function onChange() {\n            var _a;\n            const validateOnChange = (_a = evalConfig().validateOnChange) !== null && _a !== void 0 ? _a : getConfig().validateOnChange;\n            if (validateOnChange) {\n                nextTick(() => {\n                    validateField(toValue(pathState.path));\n                });\n            }\n        }\n        const props = computed(() => {\n            const base = {\n                onChange,\n                onInput,\n                onBlur,\n            };\n            if (isCallable(config)) {\n                return Object.assign(Object.assign({}, base), (config(omit(pathState, PRIVATE_PATH_STATE_KEYS)).props || {}));\n            }\n            if (config === null || config === void 0 ? void 0 : config.props) {\n                return Object.assign(Object.assign({}, base), config.props(omit(pathState, PRIVATE_PATH_STATE_KEYS)));\n            }\n            return base;\n        });\n        const model = createModel(path, () => { var _a, _b, _c; return (_c = (_a = evalConfig().validateOnModelUpdate) !== null && _a !== void 0 ? _a : (_b = getConfig()) === null || _b === void 0 ? void 0 : _b.validateOnModelUpdate) !== null && _c !== void 0 ? _c : true; });\n        return [model, props];\n    }\n    function useFieldModel(pathOrPaths) {\n        if (!Array.isArray(pathOrPaths)) {\n            return createModel(pathOrPaths);\n        }\n        return pathOrPaths.map(p => createModel(p, true));\n    }\n    /**\n     * @deprecated use defineField instead\n     */\n    function defineInputBinds(path, config) {\n        const [model, props] = defineField(path, config);\n        function onBlur() {\n            props.value.onBlur();\n        }\n        function onInput(e) {\n            const value = normalizeEventValue(e);\n            setFieldValue(toValue(path), value, false);\n            props.value.onInput();\n        }\n        function onChange(e) {\n            const value = normalizeEventValue(e);\n            setFieldValue(toValue(path), value, false);\n            props.value.onChange();\n        }\n        return computed(() => {\n            return Object.assign(Object.assign({}, props.value), { onBlur,\n                onInput,\n                onChange, value: model.value });\n        });\n    }\n    /**\n     * @deprecated use defineField instead\n     */\n    function defineComponentBinds(path, config) {\n        const [model, props] = defineField(path, config);\n        const pathState = findPathState(toValue(path));\n        function onUpdateModelValue(value) {\n            model.value = value;\n        }\n        return computed(() => {\n            const conf = isCallable(config) ? config(omit(pathState, PRIVATE_PATH_STATE_KEYS)) : config || {};\n            return Object.assign({ [conf.model || 'modelValue']: model.value, [`onUpdate:${conf.model || 'modelValue'}`]: onUpdateModelValue }, props.value);\n        });\n    }\n    const ctx = Object.assign(Object.assign({}, formCtx), { values: readonly(formValues), handleReset: () => resetForm(), submitForm });\n    provide(PublicFormContextKey, ctx);\n    return ctx;\n}\n/**\n * Manages form meta aggregation\n */\nfunction useFormMeta(pathsState, currentValues, initialValues, errors) {\n    const MERGE_STRATEGIES = {\n        touched: 'some',\n        pending: 'some',\n        valid: 'every',\n    };\n    const isDirty = computed(() => {\n        return !isEqual(currentValues, unref(initialValues));\n    });\n    function calculateFlags() {\n        const states = pathsState.value;\n        return keysOf(MERGE_STRATEGIES).reduce((acc, flag) => {\n            const mergeMethod = MERGE_STRATEGIES[flag];\n            acc[flag] = states[mergeMethod](s => s[flag]);\n            return acc;\n        }, {});\n    }\n    const flags = reactive(calculateFlags());\n    watchEffect(() => {\n        const value = calculateFlags();\n        flags.touched = value.touched;\n        flags.valid = value.valid;\n        flags.pending = value.pending;\n    });\n    return computed(() => {\n        return Object.assign(Object.assign({ initialValues: unref(initialValues) }, flags), { valid: flags.valid && !keysOf(errors.value).length, dirty: isDirty.value });\n    });\n}\n/**\n * Manages the initial values prop\n */\nfunction useFormInitialValues(pathsState, formValues, opts) {\n    const values = resolveInitialValues(opts);\n    // these are the mutable initial values as the fields are mounted/unmounted\n    const initialValues = ref(values);\n    // these are the original initial value as provided by the user initially, they don't keep track of conditional fields\n    // this is important because some conditional fields will overwrite the initial values for other fields who had the same name\n    // like array fields, any push/insert operation will overwrite the initial values because they \"create new fields\"\n    // so these are the values that the reset function should use\n    // these only change when the user explicitly changes the initial values or when the user resets them with new values.\n    const originalInitialValues = ref(klona(values));\n    function setInitialValues(values, opts) {\n        if (opts === null || opts === void 0 ? void 0 : opts.force) {\n            initialValues.value = klona(values);\n            originalInitialValues.value = klona(values);\n        }\n        else {\n            initialValues.value = merge(klona(initialValues.value) || {}, klona(values));\n            originalInitialValues.value = merge(klona(originalInitialValues.value) || {}, klona(values));\n        }\n        if (!(opts === null || opts === void 0 ? void 0 : opts.updateFields)) {\n            return;\n        }\n        // update the pristine non-touched fields\n        // those are excluded because it's unlikely you want to change the form values using initial values\n        // we mostly watch them for API population or newly inserted fields\n        // if the user API is taking too much time before user interaction they should consider disabling or hiding their inputs until the values are ready\n        pathsState.value.forEach(state => {\n            const wasTouched = state.touched;\n            if (wasTouched) {\n                return;\n            }\n            const newValue = getFromPath(initialValues.value, toValue(state.path));\n            setInPath(formValues, toValue(state.path), klona(newValue));\n        });\n    }\n    return {\n        initialValues,\n        originalInitialValues,\n        setInitialValues,\n    };\n}\nfunction mergeValidationResults(a, b) {\n    if (!b) {\n        return a;\n    }\n    return {\n        valid: a.valid && b.valid,\n        errors: [...a.errors, ...b.errors],\n    };\n}\nfunction useFormContext() {\n    return inject(PublicFormContextKey);\n}\n\nconst FormImpl = /** #__PURE__ */ defineComponent({\n    name: 'Form',\n    inheritAttrs: false,\n    props: {\n        as: {\n            type: null,\n            default: 'form',\n        },\n        validationSchema: {\n            type: Object,\n            default: undefined,\n        },\n        initialValues: {\n            type: Object,\n            default: undefined,\n        },\n        initialErrors: {\n            type: Object,\n            default: undefined,\n        },\n        initialTouched: {\n            type: Object,\n            default: undefined,\n        },\n        validateOnMount: {\n            type: Boolean,\n            default: false,\n        },\n        onSubmit: {\n            type: Function,\n            default: undefined,\n        },\n        onInvalidSubmit: {\n            type: Function,\n            default: undefined,\n        },\n        keepValues: {\n            type: Boolean,\n            default: false,\n        },\n        name: {\n            type: String,\n            default: 'Form',\n        },\n    },\n    setup(props, ctx) {\n        const validationSchema = toRef(props, 'validationSchema');\n        const keepValues = toRef(props, 'keepValues');\n        const { errors, errorBag, values, meta, isSubmitting, isValidating, submitCount, controlledValues, validate, validateField, handleReset, resetForm, handleSubmit, setErrors, setFieldError, setFieldValue, setValues, setFieldTouched, setTouched, resetField, } = useForm({\n            validationSchema: validationSchema.value ? validationSchema : undefined,\n            initialValues: props.initialValues,\n            initialErrors: props.initialErrors,\n            initialTouched: props.initialTouched,\n            validateOnMount: props.validateOnMount,\n            keepValuesOnUnmount: keepValues,\n            name: props.name,\n        });\n        const submitForm = handleSubmit((_, { evt }) => {\n            if (isFormSubmitEvent(evt)) {\n                evt.target.submit();\n            }\n        }, props.onInvalidSubmit);\n        const onSubmit = props.onSubmit ? handleSubmit(props.onSubmit, props.onInvalidSubmit) : submitForm;\n        function handleFormReset(e) {\n            if (isEvent(e)) {\n                // Prevent default form reset behavior\n                e.preventDefault();\n            }\n            handleReset();\n            if (typeof ctx.attrs.onReset === 'function') {\n                ctx.attrs.onReset();\n            }\n        }\n        function handleScopedSlotSubmit(evt, onSubmit) {\n            const onSuccess = typeof evt === 'function' && !onSubmit ? evt : onSubmit;\n            return handleSubmit(onSuccess, props.onInvalidSubmit)(evt);\n        }\n        function getValues() {\n            return klona(values);\n        }\n        function getMeta() {\n            return klona(meta.value);\n        }\n        function getErrors() {\n            return klona(errors.value);\n        }\n        function slotProps() {\n            return {\n                meta: meta.value,\n                errors: errors.value,\n                errorBag: errorBag.value,\n                values,\n                isSubmitting: isSubmitting.value,\n                isValidating: isValidating.value,\n                submitCount: submitCount.value,\n                controlledValues: controlledValues.value,\n                validate,\n                validateField,\n                handleSubmit: handleScopedSlotSubmit,\n                handleReset,\n                submitForm,\n                setErrors,\n                setFieldError,\n                setFieldValue,\n                setValues,\n                setFieldTouched,\n                setTouched,\n                resetForm,\n                resetField,\n                getValues,\n                getMeta,\n                getErrors,\n            };\n        }\n        // expose these functions and methods as part of public API\n        ctx.expose({\n            setFieldError,\n            setErrors,\n            setFieldValue,\n            setValues,\n            setFieldTouched,\n            setTouched,\n            resetForm,\n            validate,\n            validateField,\n            resetField,\n            getValues,\n            getMeta,\n            getErrors,\n            values,\n            meta,\n            errors,\n        });\n        return function renderForm() {\n            // avoid resolving the form component as itself\n            const tag = props.as === 'form' ? props.as : !props.as ? null : resolveDynamicComponent(props.as);\n            const children = normalizeChildren(tag, ctx, slotProps);\n            if (!tag) {\n                return children;\n            }\n            // Attributes to add on a native `form` tag\n            const formAttrs = tag === 'form'\n                ? {\n                    // Disables native validation as vee-validate will handle it.\n                    novalidate: true,\n                }\n                : {};\n            return h(tag, Object.assign(Object.assign(Object.assign({}, formAttrs), ctx.attrs), { onSubmit, onReset: handleFormReset }), children);\n        };\n    },\n});\nconst Form = FormImpl;\n\nfunction useFieldArray(arrayPath) {\n    const form = injectWithSelf(FormContextKey, undefined);\n    const fields = ref([]);\n    const noOp = () => { };\n    const noOpApi = {\n        fields,\n        remove: noOp,\n        push: noOp,\n        swap: noOp,\n        insert: noOp,\n        update: noOp,\n        replace: noOp,\n        prepend: noOp,\n        move: noOp,\n    };\n    if (!form) {\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn('FieldArray requires being a child of `<Form/>` or `useForm` being called before it. Array fields may not work correctly');\n        }\n        return noOpApi;\n    }\n    if (!unref(arrayPath)) {\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn('FieldArray requires a field path to be provided, did you forget to pass the `name` prop?');\n        }\n        return noOpApi;\n    }\n    const alreadyExists = form.fieldArrays.find(a => unref(a.path) === unref(arrayPath));\n    if (alreadyExists) {\n        return alreadyExists;\n    }\n    let entryCounter = 0;\n    function getCurrentValues() {\n        return getFromPath(form === null || form === void 0 ? void 0 : form.values, toValue(arrayPath), []) || [];\n    }\n    function initFields() {\n        const currentValues = getCurrentValues();\n        if (!Array.isArray(currentValues)) {\n            return;\n        }\n        fields.value = currentValues.map((v, idx) => createEntry(v, idx, fields.value));\n        updateEntryFlags();\n    }\n    initFields();\n    function updateEntryFlags() {\n        const fieldsLength = fields.value.length;\n        for (let i = 0; i < fieldsLength; i++) {\n            const entry = fields.value[i];\n            entry.isFirst = i === 0;\n            entry.isLast = i === fieldsLength - 1;\n        }\n    }\n    function createEntry(value, idx, currentFields) {\n        // Skips the work by returning the current entry if it already exists\n        // This should make the `key` prop stable and doesn't cause more re-renders than needed\n        // The value is computed and should update anyways\n        if (currentFields && !isNullOrUndefined(idx) && currentFields[idx]) {\n            return currentFields[idx];\n        }\n        const key = entryCounter++;\n        const entry = {\n            key,\n            value: computedDeep({\n                get() {\n                    const currentValues = getFromPath(form === null || form === void 0 ? void 0 : form.values, toValue(arrayPath), []) || [];\n                    const idx = fields.value.findIndex(e => e.key === key);\n                    return idx === -1 ? value : currentValues[idx];\n                },\n                set(value) {\n                    const idx = fields.value.findIndex(e => e.key === key);\n                    if (idx === -1) {\n                        if ((process.env.NODE_ENV !== 'production')) {\n                            warn(`Attempting to update a non-existent array item`);\n                        }\n                        return;\n                    }\n                    update(idx, value);\n                },\n            }), // will be auto unwrapped\n            isFirst: false,\n            isLast: false,\n        };\n        return entry;\n    }\n    function afterMutation() {\n        updateEntryFlags();\n        // Should trigger a silent validation since a field may not do that #4096\n        form === null || form === void 0 ? void 0 : form.validate({ mode: 'silent' });\n    }\n    function remove(idx) {\n        const pathName = toValue(arrayPath);\n        const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName);\n        if (!pathValue || !Array.isArray(pathValue)) {\n            return;\n        }\n        const newValue = [...pathValue];\n        newValue.splice(idx, 1);\n        const fieldPath = pathName + `[${idx}]`;\n        form.destroyPath(fieldPath);\n        form.unsetInitialValue(fieldPath);\n        setInPath(form.values, pathName, newValue);\n        fields.value.splice(idx, 1);\n        afterMutation();\n    }\n    function push(initialValue) {\n        const value = klona(initialValue);\n        const pathName = toValue(arrayPath);\n        const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName);\n        const normalizedPathValue = isNullOrUndefined(pathValue) ? [] : pathValue;\n        if (!Array.isArray(normalizedPathValue)) {\n            return;\n        }\n        const newValue = [...normalizedPathValue];\n        newValue.push(value);\n        form.stageInitialValue(pathName + `[${newValue.length - 1}]`, value);\n        setInPath(form.values, pathName, newValue);\n        fields.value.push(createEntry(value));\n        afterMutation();\n    }\n    function swap(indexA, indexB) {\n        const pathName = toValue(arrayPath);\n        const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName);\n        if (!Array.isArray(pathValue) || !(indexA in pathValue) || !(indexB in pathValue)) {\n            return;\n        }\n        const newValue = [...pathValue];\n        const newFields = [...fields.value];\n        // the old switcheroo\n        const temp = newValue[indexA];\n        newValue[indexA] = newValue[indexB];\n        newValue[indexB] = temp;\n        const tempEntry = newFields[indexA];\n        newFields[indexA] = newFields[indexB];\n        newFields[indexB] = tempEntry;\n        setInPath(form.values, pathName, newValue);\n        fields.value = newFields;\n        updateEntryFlags();\n    }\n    function insert(idx, initialValue) {\n        const value = klona(initialValue);\n        const pathName = toValue(arrayPath);\n        const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName);\n        if (!Array.isArray(pathValue) || pathValue.length < idx) {\n            return;\n        }\n        const newValue = [...pathValue];\n        const newFields = [...fields.value];\n        newValue.splice(idx, 0, value);\n        newFields.splice(idx, 0, createEntry(value));\n        setInPath(form.values, pathName, newValue);\n        fields.value = newFields;\n        afterMutation();\n    }\n    function replace(arr) {\n        const pathName = toValue(arrayPath);\n        form.stageInitialValue(pathName, arr);\n        setInPath(form.values, pathName, arr);\n        initFields();\n        afterMutation();\n    }\n    function update(idx, value) {\n        const pathName = toValue(arrayPath);\n        const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName);\n        if (!Array.isArray(pathValue) || pathValue.length - 1 < idx) {\n            return;\n        }\n        setInPath(form.values, `${pathName}[${idx}]`, value);\n        form === null || form === void 0 ? void 0 : form.validate({ mode: 'validated-only' });\n    }\n    function prepend(initialValue) {\n        const value = klona(initialValue);\n        const pathName = toValue(arrayPath);\n        const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName);\n        const normalizedPathValue = isNullOrUndefined(pathValue) ? [] : pathValue;\n        if (!Array.isArray(normalizedPathValue)) {\n            return;\n        }\n        const newValue = [value, ...normalizedPathValue];\n        setInPath(form.values, pathName, newValue);\n        form.stageInitialValue(pathName + `[0]`, value);\n        fields.value.unshift(createEntry(value));\n        afterMutation();\n    }\n    function move(oldIdx, newIdx) {\n        const pathName = toValue(arrayPath);\n        const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName);\n        const newValue = isNullOrUndefined(pathValue) ? [] : [...pathValue];\n        if (!Array.isArray(pathValue) || !(oldIdx in pathValue) || !(newIdx in pathValue)) {\n            return;\n        }\n        const newFields = [...fields.value];\n        const movedItem = newFields[oldIdx];\n        newFields.splice(oldIdx, 1);\n        newFields.splice(newIdx, 0, movedItem);\n        const movedValue = newValue[oldIdx];\n        newValue.splice(oldIdx, 1);\n        newValue.splice(newIdx, 0, movedValue);\n        setInPath(form.values, pathName, newValue);\n        fields.value = newFields;\n        afterMutation();\n    }\n    const fieldArrayCtx = {\n        fields,\n        remove,\n        push,\n        swap,\n        insert,\n        update,\n        replace,\n        prepend,\n        move,\n    };\n    form.fieldArrays.push(Object.assign({ path: arrayPath, reset: initFields }, fieldArrayCtx));\n    onBeforeUnmount(() => {\n        const idx = form.fieldArrays.findIndex(i => toValue(i.path) === toValue(arrayPath));\n        if (idx >= 0) {\n            form.fieldArrays.splice(idx, 1);\n        }\n    });\n    // Makes sure to sync the form values with the array value if they go out of sync\n    // #4153\n    watch(getCurrentValues, formValues => {\n        const fieldsValues = fields.value.map(f => f.value);\n        // If form values are not the same as the current values then something overrode them.\n        if (!isEqual(formValues, fieldsValues)) {\n            initFields();\n        }\n    });\n    return fieldArrayCtx;\n}\n\nconst FieldArrayImpl = /** #__PURE__ */ defineComponent({\n    name: 'FieldArray',\n    inheritAttrs: false,\n    props: {\n        name: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, ctx) {\n        const { push, remove, swap, insert, replace, update, prepend, move, fields } = useFieldArray(() => props.name);\n        function slotProps() {\n            return {\n                fields: fields.value,\n                push,\n                remove,\n                swap,\n                insert,\n                update,\n                replace,\n                prepend,\n                move,\n            };\n        }\n        ctx.expose({\n            push,\n            remove,\n            swap,\n            insert,\n            update,\n            replace,\n            prepend,\n            move,\n        });\n        return () => {\n            const children = normalizeChildren(undefined, ctx, slotProps);\n            return children;\n        };\n    },\n});\nconst FieldArray = FieldArrayImpl;\n\nconst ErrorMessageImpl = /** #__PURE__ */ defineComponent({\n    name: 'ErrorMessage',\n    props: {\n        as: {\n            type: String,\n            default: undefined,\n        },\n        name: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, ctx) {\n        const form = inject(FormContextKey, undefined);\n        const message = computed(() => {\n            return form === null || form === void 0 ? void 0 : form.errors.value[props.name];\n        });\n        function slotProps() {\n            return {\n                message: message.value,\n            };\n        }\n        return () => {\n            // Renders nothing if there are no messages\n            if (!message.value) {\n                return undefined;\n            }\n            const tag = (props.as ? resolveDynamicComponent(props.as) : props.as);\n            const children = normalizeChildren(tag, ctx, slotProps);\n            const attrs = Object.assign({ role: 'alert' }, ctx.attrs);\n            // If no tag was specified and there are children\n            // render the slot as is without wrapping it\n            if (!tag && (Array.isArray(children) || !children) && (children === null || children === void 0 ? void 0 : children.length)) {\n                return children;\n            }\n            // If no children in slot\n            // render whatever specified and fallback to a <span> with the message in it's contents\n            if ((Array.isArray(children) || !children) && !(children === null || children === void 0 ? void 0 : children.length)) {\n                return h(tag || 'span', attrs, message.value);\n            }\n            return h(tag, attrs, children);\n        };\n    },\n});\nconst ErrorMessage = ErrorMessageImpl;\n\nfunction useResetForm() {\n    const form = injectWithSelf(FormContextKey);\n    if (!form) {\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n        }\n    }\n    return function resetForm(state, opts) {\n        if (!form) {\n            return;\n        }\n        return form.resetForm(state, opts);\n    };\n}\n\n/**\n * If a field is dirty or not\n */\nfunction useIsFieldDirty(path) {\n    const fieldOrPath = resolveFieldOrPathState(path);\n    return computed(() => {\n        var _a, _b;\n        if (!fieldOrPath) {\n            return false;\n        }\n        return (_b = ('meta' in fieldOrPath ? fieldOrPath.meta.dirty : (_a = fieldOrPath === null || fieldOrPath === void 0 ? void 0 : fieldOrPath.value) === null || _a === void 0 ? void 0 : _a.dirty)) !== null && _b !== void 0 ? _b : false;\n    });\n}\n\n/**\n * If a field is touched or not\n */\nfunction useIsFieldTouched(path) {\n    const fieldOrPath = resolveFieldOrPathState(path);\n    return computed(() => {\n        var _a, _b;\n        if (!fieldOrPath) {\n            return false;\n        }\n        return (_b = ('meta' in fieldOrPath ? fieldOrPath.meta.touched : (_a = fieldOrPath === null || fieldOrPath === void 0 ? void 0 : fieldOrPath.value) === null || _a === void 0 ? void 0 : _a.touched)) !== null && _b !== void 0 ? _b : false;\n    });\n}\n\n/**\n * If a field is validated and is valid\n */\nfunction useIsFieldValid(path) {\n    const fieldOrPath = resolveFieldOrPathState(path);\n    return computed(() => {\n        var _a, _b;\n        if (!fieldOrPath) {\n            return false;\n        }\n        return (_b = ('meta' in fieldOrPath ? fieldOrPath.meta.valid : (_a = fieldOrPath === null || fieldOrPath === void 0 ? void 0 : fieldOrPath.value) === null || _a === void 0 ? void 0 : _a.valid)) !== null && _b !== void 0 ? _b : false;\n    });\n}\n\n/**\n * If the form is submitting or not\n */\nfunction useIsSubmitting() {\n    const form = injectWithSelf(FormContextKey);\n    if (!form) {\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n        }\n    }\n    return computed(() => {\n        var _a;\n        return (_a = form === null || form === void 0 ? void 0 : form.isSubmitting.value) !== null && _a !== void 0 ? _a : false;\n    });\n}\n\n/**\n * If the form is validating or not\n */\nfunction useIsValidating() {\n    const form = injectWithSelf(FormContextKey);\n    if (!form) {\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n        }\n    }\n    return computed(() => {\n        var _a;\n        return (_a = form === null || form === void 0 ? void 0 : form.isValidating.value) !== null && _a !== void 0 ? _a : false;\n    });\n}\n\n/**\n * Validates a single field\n */\nfunction useValidateField(path) {\n    const form = injectWithSelf(FormContextKey);\n    const field = path ? undefined : inject(FieldContextKey);\n    return function validateField() {\n        if (field) {\n            return field.validate();\n        }\n        if (form && path) {\n            return form === null || form === void 0 ? void 0 : form.validateField(toValue(path));\n        }\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn(`field with name ${unref(path)} was not found`);\n        }\n        return Promise.resolve({\n            errors: [],\n            valid: true,\n        });\n    };\n}\n\n/**\n * If the form is dirty or not\n */\nfunction useIsFormDirty() {\n    const form = injectWithSelf(FormContextKey);\n    if (!form) {\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n        }\n    }\n    return computed(() => {\n        var _a;\n        return (_a = form === null || form === void 0 ? void 0 : form.meta.value.dirty) !== null && _a !== void 0 ? _a : false;\n    });\n}\n\n/**\n * If the form is touched or not\n */\nfunction useIsFormTouched() {\n    const form = injectWithSelf(FormContextKey);\n    if (!form) {\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n        }\n    }\n    return computed(() => {\n        var _a;\n        return (_a = form === null || form === void 0 ? void 0 : form.meta.value.touched) !== null && _a !== void 0 ? _a : false;\n    });\n}\n\n/**\n * If the form has been validated and is valid\n */\nfunction useIsFormValid() {\n    const form = injectWithSelf(FormContextKey);\n    if (!form) {\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n        }\n    }\n    return computed(() => {\n        var _a;\n        return (_a = form === null || form === void 0 ? void 0 : form.meta.value.valid) !== null && _a !== void 0 ? _a : false;\n    });\n}\n\n/**\n * Validate multiple fields\n */\nfunction useValidateForm() {\n    const form = injectWithSelf(FormContextKey);\n    if (!form) {\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n        }\n    }\n    return function validateField() {\n        if (!form) {\n            return Promise.resolve({ results: {}, errors: {}, valid: true, source: 'none' });\n        }\n        return form.validate();\n    };\n}\n\n/**\n * The number of form's submission count\n */\nfunction useSubmitCount() {\n    const form = injectWithSelf(FormContextKey);\n    if (!form) {\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n        }\n    }\n    return computed(() => {\n        var _a;\n        return (_a = form === null || form === void 0 ? void 0 : form.submitCount.value) !== null && _a !== void 0 ? _a : 0;\n    });\n}\n\n/**\n * Gives access to a field's current value\n */\nfunction useFieldValue(path) {\n    const form = injectWithSelf(FormContextKey);\n    // We don't want to use self injected context as it doesn't make sense\n    const field = path ? undefined : inject(FieldContextKey);\n    return computed(() => {\n        if (path) {\n            return getFromPath(form === null || form === void 0 ? void 0 : form.values, toValue(path));\n        }\n        return toValue(field === null || field === void 0 ? void 0 : field.value);\n    });\n}\n\n/**\n * Gives access to a form's values\n */\nfunction useFormValues() {\n    const form = injectWithSelf(FormContextKey);\n    if (!form) {\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n        }\n    }\n    return computed(() => {\n        return (form === null || form === void 0 ? void 0 : form.values) || {};\n    });\n}\n\n/**\n * Gives access to all form errors\n */\nfunction useFormErrors() {\n    const form = injectWithSelf(FormContextKey);\n    if (!form) {\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n        }\n    }\n    return computed(() => {\n        return ((form === null || form === void 0 ? void 0 : form.errors.value) || {});\n    });\n}\n\n/**\n * Gives access to a single field error\n */\nfunction useFieldError(path) {\n    const form = injectWithSelf(FormContextKey);\n    // We don't want to use self injected context as it doesn't make sense\n    const field = path ? undefined : inject(FieldContextKey);\n    return computed(() => {\n        if (path) {\n            return form === null || form === void 0 ? void 0 : form.errors.value[toValue(path)];\n        }\n        return field === null || field === void 0 ? void 0 : field.errorMessage.value;\n    });\n}\n\nfunction useSubmitForm(cb) {\n    const form = injectWithSelf(FormContextKey);\n    if (!form) {\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n        }\n    }\n    const onSubmit = form ? form.handleSubmit(cb) : undefined;\n    return function submitForm(e) {\n        if (!onSubmit) {\n            return;\n        }\n        return onSubmit(e);\n    };\n}\n\n/**\n * Sets a field's error message\n */\nfunction useSetFieldError(path) {\n    const form = injectWithSelf(FormContextKey);\n    // We don't want to use self injected context as it doesn't make sense\n    const field = path ? undefined : inject(FieldContextKey);\n    return function setFieldError(message) {\n        if (path && form) {\n            form.setFieldError(toValue(path), message);\n            return;\n        }\n        if (field) {\n            field.setErrors(message || []);\n            return;\n        }\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn(`Could not set error message since there is no form context or a field named \"${toValue(path)}\", did you forget to call \"useField\" or \"useForm\"?`);\n        }\n    };\n}\n\n/**\n * Sets a field's touched meta state\n */\nfunction useSetFieldTouched(path) {\n    const form = injectWithSelf(FormContextKey);\n    // We don't want to use self injected context as it doesn't make sense\n    const field = path ? undefined : inject(FieldContextKey);\n    return function setFieldTouched(touched) {\n        if (path && form) {\n            form.setFieldTouched(toValue(path), touched);\n            return;\n        }\n        if (field) {\n            field.setTouched(touched);\n            return;\n        }\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn(`Could not set touched state since there is no form context or a field named \"${toValue(path)}\", did you forget to call \"useField\" or \"useForm\"?`);\n        }\n    };\n}\n\n/**\n * Sets a field's value\n */\nfunction useSetFieldValue(path) {\n    const form = injectWithSelf(FormContextKey);\n    // We don't want to use self injected context as it doesn't make sense\n    const field = path ? undefined : inject(FieldContextKey);\n    return function setFieldValue(value, shouldValidate = true) {\n        if (path && form) {\n            form.setFieldValue(toValue(path), value, shouldValidate);\n            return;\n        }\n        if (field) {\n            field.setValue(value, shouldValidate);\n            return;\n        }\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn(`Could not set value since there is no form context or a field named \"${toValue(path)}\", did you forget to call \"useField\" or \"useForm\"?`);\n        }\n    };\n}\n\n/**\n * Sets multiple fields errors\n */\nfunction useSetFormErrors() {\n    const form = injectWithSelf(FormContextKey);\n    function setFormErrors(fields) {\n        if (form) {\n            form.setErrors(fields);\n            return;\n        }\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn(`Could not set errors because a form was not detected, did you forget to use \"useForm\" in a parent component?`);\n        }\n    }\n    return setFormErrors;\n}\n\n/**\n * Sets multiple fields touched or all fields in the form\n */\nfunction useSetFormTouched() {\n    const form = injectWithSelf(FormContextKey);\n    function setFormTouched(fields) {\n        if (form) {\n            form.setTouched(fields);\n            return;\n        }\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn(`Could not set touched state because a form was not detected, did you forget to use \"useForm\" in a parent component?`);\n        }\n    }\n    return setFormTouched;\n}\n\n/**\n * Sets multiple fields values\n */\nfunction useSetFormValues() {\n    const form = injectWithSelf(FormContextKey);\n    function setFormValues(fields, shouldValidate = true) {\n        if (form) {\n            form.setValues(fields, shouldValidate);\n            return;\n        }\n        if ((process.env.NODE_ENV !== 'production')) {\n            warn(`Could not set form values because a form was not detected, did you forget to use \"useForm\" in a parent component?`);\n        }\n    }\n    return setFormValues;\n}\n\nexport { ErrorMessage, Field, FieldArray, FieldContextKey, Form, FormContextKey, IS_ABSENT, PublicFormContextKey, cleanupNonNestedPath, configure, defineRule, isNotNestedPath, normalizeRules, useField, useFieldArray, useFieldError, useFieldValue, useForm, useFormContext, useFormErrors, useFormValues, useIsFieldDirty, useIsFieldTouched, useIsFieldValid, useIsFormDirty, useIsFormTouched, useIsFormValid, useIsSubmitting, useIsValidating, useResetForm, useSetFieldError, useSetFieldTouched, useSetFieldValue, useSetFormErrors, useSetFormTouched, useSetFormValues, useSubmitCount, useSubmitForm, useValidateField, useValidateForm, validate, validateObjectSchema as validateObject };\n"],"names":["isCallable","fn","isNullOrUndefined","value","isObject","obj","isIndex","toNumber","isObjectLike","getTag","isPlainObject","proto","merge","target","source","key","normalizeFormPath","path","pathArr","fullPath","i","RULES","resolveRule","id","set","val","klona","x","k","list","tmp","str","FormContextKey","PublicFormContextKey","FieldContextKey","IS_ABSENT","isClient","isLocator","isTypedSchema","isYupValidator","hasCheckedAttr","type","isContainerValue","isEmptyContainer","isNotNestedPath","isNativeMultiSelect","el","isNativeSelect","isNativeMultiSelectNode","tag","attrs","hasTruthyBindingValue","shouldHaveValueBinding","isFormSubmitEvent","evt","isEvent","isPropPresent","prop","isEqual","a","b","length","keys","isFile","countUndefinedValues","result","cleanupNonNestedPath","getFromPath","object","fallback","acc","propKey","setInPath","unset","unsetPath","pathValues","_","idx","keysOf","record","injectWithSelf","symbol","def","vm","getCurrentInstance","inject","resolveNextCheckboxValue","currentValue","checkedValue","uncheckedValue","newVal","v","debounceAsync","inner","ms","timer","resolves","args","r","resolve","applyModelModifiers","modifiers","withLatest","onDone","latestRun","pending","normalizeErrorItem","message","resolveFieldOrPathState","omit","debounceNextTick","lastTick","thisTick","nextTick","normalizeChildren","context","slotProps","_a","_b","getBoundValue","hasValueBinding","parseInputValue","normalizeEventValue","input","files","opt","selectedOption","normalizeRules","rules","prev","curr","params","normalizeParams","buildParams","rule","parsedRule","parseRule","provided","mapValueToLocator","createLocator","name","locator","crossTable","extractLocators","DEFAULT_CONFIG","field","currentConfig","getConfig","validate","options","shouldBail","_validate","validateFieldWithTypedSchema","ctx","pipeline","errors","_generateFieldError","normalizedContext","rulesKeys","_test","isYupError","err","yupToTypedSchema","yupSchema","values","messages","error","validator","fillTargetValues","fieldCtx","normalize","param","validateTypedSchema","schema","validationResult","results","m","validateObjectSchema","opts","validations","_c","strings","fieldResult","isAllValid","validationResults","ID_COUNTER","useFieldState","init","initialValue","setInitialValue","_useFieldValue","setState","state","setErrors","meta","createFieldErrors","createFieldMeta","computed","unref","modelValue","form","modelRef","ref","resolveInitialValue","resolveModelValue","isRef","isRequired","toValue","reactive","watch","useField","useFieldWithChecked","_useField","validateOnMount","bails","label","validateOnValueUpdate","controlled","keepValueOnUnmount","syncVModel","controlForm","normalizeOptions","injectedForm","rulesValue","isTyped","flags","validate$1","errorMessage","useVModel","handleChange","handleBlur","shouldValidate","validateWithStateMutation","validateCurrentValue","mode","validateValidStateOnly","e","newValue","setValue","onMounted","setTouched","isTouched","resetField","valueProxy","provide","oldValue","dependencies","rulesVal","deps","dep","depAcc","depName","depValue","oldDeps","onBeforeUnmount","shouldKeepValue","pathState","valueIdx","defaults","isVModelSynced","modelPropName","getCurrentModelValue","patchCheckedApi","checked","checkedVal","handleCheckboxChange","propName","emitName","propValue","FieldImpl","defineComponent","props","toRef","keepValue","validateField","handleReset","onChangeHandler","sharedProps","validateOnInput","validateOnChange","validateOnBlur","validateOnModelUpdate","resolveValidationTriggers","baseOnBlur","baseOnInput","baseOnChange","fieldProps","resolveTag","componentProps","resolveDynamicComponent","children","h","_d","Field","FORM_COUNTER","PRIVATE_PATH_STATE_KEYS","resolveInitialValues","givenInitial","providedValues","useForm","formId","FIELD_ID_COUNTER","isSubmitting","isValidating","submitCount","fieldArrays","formValues","pathStates","extraErrorsBag","pathStateLookup","rebuildPathLookup","names","setFieldError","findPathState","normalizedPath","paths","errorBag","pathErrors","fieldNames","fieldBailsMap","map","initialErrors","keepValuesOnUnmount","initialValues","originalInitialValues","setInitialValues","useFormInitialValues","useFormMeta","controlledValues","createPathState","config","pathStateExists","isCheckboxOrRadio","pathValue","unsetBatchIndex","UNSET_BATCH","_path","schemaValue","configSchemaValue","shallowRef","newPath","nextValue","debouncedSilentValidation","_validateSchema","debouncedValidation","validateSchema","formResult","currentErrorsPaths","formCtx","p","validation","expectedPath","findHoistedPath","mergeValidationResults","mutateAllPathState","mutation","bestCandidate","candidate","PENDING_UNSET","unsetPathValue","makeSubmissionFactory","onlyControlled","onValidationError","s","submittedValues","setFieldTouched","setValues","setFieldValue","resetForm","returnVal","handleSubmit","removePathState","idIndex","unsetInitialValue","destroyPath","useFieldModel","defineInputBinds","defineComponentBinds","defineField","stageInitialValue","setFieldInitialValue","isFieldTouched","isFieldDirty","isFieldValid","clonedValue","forceSetValues","fields","f","createModel","resetState","newValues","updateOriginal","submitForm","evalConfig","onBlur","onInput","onChange","base","pathOrPaths","model","onUpdateModelValue","conf","readonly","pathsState","currentValues","MERGE_STRATEGIES","isDirty","calculateFlags","states","flag","mergeMethod","watchEffect","FormImpl","validationSchema","keepValues","onSubmit","handleFormReset","handleScopedSlotSubmit","getValues","getMeta","getErrors","Form","ErrorMessageImpl","ErrorMessage","useIsFieldDirty","fieldOrPath","useIsFieldTouched","useIsFieldValid","useFieldError"],"mappings":"sgBAAA;AAAA;AAAA;AAAA;AAAA,IAOA,SAASA,EAAWC,EAAI,CACpB,OAAO,OAAOA,GAAO,UACzB,CACA,SAASC,GAAkBC,EAAO,CACvB,OAAAA,GAAU,IACrB,CACA,MAAMC,GAAYC,GAAQA,IAAQ,MAAQ,CAAC,CAACA,GAAO,OAAOA,GAAQ,UAAY,CAAC,MAAM,QAAQA,CAAG,EAChG,SAASC,GAAQH,EAAO,CACb,OAAA,OAAOA,CAAK,GAAK,CAC5B,CACA,SAASI,GAASJ,EAAO,CACf,MAAA,EAAI,WAAWA,CAAK,EACnB,OAAA,MAAM,CAAC,EAAIA,EAAQ,CAC9B,CACA,SAASK,GAAaL,EAAO,CAClB,OAAA,OAAOA,GAAU,UAAYA,IAAU,IAClD,CACA,SAASM,GAAON,EAAO,CACnB,OAAIA,GAAS,KACFA,IAAU,OAAY,qBAAuB,gBAEjD,OAAO,UAAU,SAAS,KAAKA,CAAK,CAC/C,CAEA,SAASO,GAAcP,EAAO,CAC1B,GAAI,CAACK,GAAaL,CAAK,GAAKM,GAAON,CAAK,IAAM,kBACnC,MAAA,GAEX,GAAI,OAAO,eAAeA,CAAK,IAAM,KAC1B,MAAA,GAEX,IAAIQ,EAAQR,EACZ,KAAO,OAAO,eAAeQ,CAAK,IAAM,MAC5BA,EAAA,OAAO,eAAeA,CAAK,EAEhC,OAAA,OAAO,eAAeR,CAAK,IAAMQ,CAC5C,CACA,SAASC,GAAMC,EAAQC,EAAQ,CAC3B,cAAO,KAAKA,CAAM,EAAE,QAAeC,GAAA,CAC3B,GAAAL,GAAcI,EAAOC,CA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