{"version":3,"file":"index.esm.U-N8LX71.js","sources":["../../../../../../app/node_modules/vee-validate/dist/vee-validate.esm.js","../../../../../../app/node_modules/property-expr/index.js","../../../../../../app/node_modules/tiny-case/index.js","../../../../../../app/node_modules/toposort/index.js","../../../../../../app/node_modules/yup/index.esm.js"],"sourcesContent":["/**\n * vee-validate v4.12.6\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';\nimport { setupDevtoolsPlugin } from '@vue/devtools-api';\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 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 * */\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 // eslint-disable-next-line eqeqeq\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 // eslint-disable-next-line eqeqeq\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;\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 // eslint-disable-next-line no-self-compare\n return a !== a && b !== b;\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 const val = getFromPath(crossTable, value) || 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 const errors = result.errors;\n return {\n errors,\n valid: !errors.length,\n };\n}\n/**\n * Starts the validation process.\n */\nasync function _validate(field, value) {\n if (isTypedSchema(field.rules) || isYupValidator(field.rules)) {\n return validateFieldWithTypedSchema(value, field.rules);\n }\n // if a generic function or chain of generic functions\n if (isCallable(field.rules) || Array.isArray(field.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(field.rules) ? field.rules : [field.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(field.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) {\n var _a;\n try {\n const output = await yupSchema.validate(values, { abortEarly: false });\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, schema) {\n const typedSchema = isTypedSchema(schema) ? schema : yupToTypedSchema(schema);\n const result = await typedSchema.parse(value);\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 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));\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 };\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 };\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 var _a, _b;\n const isRequired = (_b = (_a = schema === null || schema === void 0 ? void 0 : schema.describe) === null || _a === void 0 ? void 0 : _a.call(schema).required) !== null && _b !== void 0 ? _b : 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\nfunction installDevtoolsPlugin(app) {\n if ((process.env.NODE_ENV !== 'production')) {\n 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 }, setupApiHooks);\n }\n}\nconst DEVTOOLS_FORMS = {};\nconst DEVTOOLS_FIELDS = {};\nlet API;\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}\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;\nfunction setupApiHooks(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 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 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, ctx) => {\n if (payload.inspectorId !== INSPECTOR_ID || ctx.currentTab !== `custom-inspector:${INSPECTOR_ID}`) {\n return;\n }\n const { form, field, state, type } = decodeNodeId(payload.nodeId);\n if (form && type === 'form') {\n payload.state = buildFormState(form);\n SELECTED_NODE = { type: 'form', form };\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 return;\n }\n SELECTED_NODE = null;\n });\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, unref(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',\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: unref(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 : unref(stateOrField === null || stateOrField === void 0 ? void 0 : stateOrField.name)) : '';\n const idObject = { f: form === null || form === void 0 ? void 0 : form.formId, ff: 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 { 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: isTypedSchema(rules) ? 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 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, } = 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 };\n }\n ctx.expose({\n value,\n meta,\n errors,\n errorMessage,\n setErrors,\n setTouched,\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 providedValues = Object.assign({}, toValue((opts === null || opts === void 0 ? void 0 : opts.initialValues) || {}));\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 // 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[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[state.path] = { name: 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[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, state.path);\n setInPath(acc, 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, _e, _f;\n if (isTypedSchema(schema)) {\n return (_c = (_b = (_a = schema).describe) === null || _b === void 0 ? void 0 : _b.call(_a, toValue(path)).required) !== null && _c !== void 0 ? _c : false;\n }\n // Path own schema\n if (isTypedSchema(config === null || config === void 0 ? void 0 : config.schema)) {\n return (_f = (_e = (_d = (config === null || config === void 0 ? void 0 : config.schema)).describe) === null || _e === void 0 ? void 0 : _e.call(_d).required) !== null && _f !== void 0 ? _f : 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 }, { valid: formResult.valid, results: {}, errors: {} });\n if (formResult.values) {\n results.values = formResult.values;\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(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 = 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 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);\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[state.path]) || false;\n setFieldValue(state.path, getFromPath(newValues, state.path), false);\n setFieldError(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: state.path,\n valid: true,\n errors: [],\n });\n }\n return state.validate(opts).then((result) => {\n return {\n key: state.path,\n valid: result.valid,\n errors: result.errors,\n };\n });\n }));\n isValidating.value = false;\n const results = {};\n const errors = {};\n for (const validation of validations) {\n results[validation.key] = {\n valid: validation.valid,\n errors: validation.errors,\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 };\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: {} };\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(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(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(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 return Object.assign(Object.assign({}, formCtx), { values: readonly(formValues), handleReset: () => resetForm(), submitForm });\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, updateFields = false) {\n initialValues.value = merge(klona(initialValues.value) || {}, klona(values));\n originalInitialValues.value = merge(klona(originalInitialValues.value) || {}, klona(values));\n if (!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, state.path);\n setInPath(formValues, 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}\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 },\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 });\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 // eslint-disable-next-line @typescript-eslint/no-empty-function\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 `
` 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 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 or `useForm` was detected in the component tree');\n }\n }\n return function resetForm(state) {\n if (!form) {\n return;\n }\n return form.resetForm(state);\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 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 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 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 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 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 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 });\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 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 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 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 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, cleanupNonNestedPath, configure, defineRule, isNotNestedPath, normalizeRules, useField, useFieldArray, useFieldError, useFieldValue, useForm, 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","/**\n * Based on Kendo UI Core expression code \n */\n'use strict'\n\nfunction Cache(maxSize) {\n this._maxSize = maxSize\n this.clear()\n}\nCache.prototype.clear = function () {\n this._size = 0\n this._values = Object.create(null)\n}\nCache.prototype.get = function (key) {\n return this._values[key]\n}\nCache.prototype.set = function (key, value) {\n this._size >= this._maxSize && this.clear()\n if (!(key in this._values)) this._size++\n\n return (this._values[key] = value)\n}\n\nvar SPLIT_REGEX = /[^.^\\]^[]+|(?=\\[\\]|\\.\\.)/g,\n DIGIT_REGEX = /^\\d+$/,\n LEAD_DIGIT_REGEX = /^\\d/,\n SPEC_CHAR_REGEX = /[~`!#$%\\^&*+=\\-\\[\\]\\\\';,/{}|\\\\\":<>\\?]/g,\n CLEAN_QUOTES_REGEX = /^\\s*(['\"]?)(.*?)(\\1)\\s*$/,\n MAX_CACHE_SIZE = 512\n\nvar pathCache = new Cache(MAX_CACHE_SIZE),\n setCache = new Cache(MAX_CACHE_SIZE),\n getCache = new Cache(MAX_CACHE_SIZE)\n\nvar config\n\nmodule.exports = {\n Cache: Cache,\n\n split: split,\n\n normalizePath: normalizePath,\n\n setter: function (path) {\n var parts = normalizePath(path)\n\n return (\n setCache.get(path) ||\n setCache.set(path, function setter(obj, value) {\n var index = 0\n var len = parts.length\n var data = obj\n\n while (index < len - 1) {\n var part = parts[index]\n if (\n part === '__proto__' ||\n part === 'constructor' ||\n part === 'prototype'\n ) {\n return obj\n }\n\n data = data[parts[index++]]\n }\n data[parts[index]] = value\n })\n )\n },\n\n getter: function (path, safe) {\n var parts = normalizePath(path)\n return (\n getCache.get(path) ||\n getCache.set(path, function getter(data) {\n var index = 0,\n len = parts.length\n while (index < len) {\n if (data != null || !safe) data = data[parts[index++]]\n else return\n }\n return data\n })\n )\n },\n\n join: function (segments) {\n return segments.reduce(function (path, part) {\n return (\n path +\n (isQuoted(part) || DIGIT_REGEX.test(part)\n ? '[' + part + ']'\n : (path ? '.' : '') + part)\n )\n }, '')\n },\n\n forEach: function (path, cb, thisArg) {\n forEach(Array.isArray(path) ? path : split(path), cb, thisArg)\n },\n}\n\nfunction normalizePath(path) {\n return (\n pathCache.get(path) ||\n pathCache.set(\n path,\n split(path).map(function (part) {\n return part.replace(CLEAN_QUOTES_REGEX, '$2')\n })\n )\n )\n}\n\nfunction split(path) {\n return path.match(SPLIT_REGEX) || ['']\n}\n\nfunction forEach(parts, iter, thisArg) {\n var len = parts.length,\n part,\n idx,\n isArray,\n isBracket\n\n for (idx = 0; idx < len; idx++) {\n part = parts[idx]\n\n if (part) {\n if (shouldBeQuoted(part)) {\n part = '\"' + part + '\"'\n }\n\n isBracket = isQuoted(part)\n isArray = !isBracket && /^\\d+$/.test(part)\n\n iter.call(thisArg, part, isBracket, isArray, idx, parts)\n }\n }\n}\n\nfunction isQuoted(str) {\n return (\n typeof str === 'string' && str && [\"'\", '\"'].indexOf(str.charAt(0)) !== -1\n )\n}\n\nfunction hasLeadingNumber(part) {\n return part.match(LEAD_DIGIT_REGEX) && !part.match(DIGIT_REGEX)\n}\n\nfunction hasSpecialChars(part) {\n return SPEC_CHAR_REGEX.test(part)\n}\n\nfunction shouldBeQuoted(part) {\n return !isQuoted(part) && (hasLeadingNumber(part) || hasSpecialChars(part))\n}\n","const reWords = /[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+|(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?)*/g\n\nconst words = (str) => str.match(reWords) || []\n\nconst upperFirst = (str) => str[0].toUpperCase() + str.slice(1)\n\nconst join = (str, d) => words(str).join(d).toLowerCase()\n\nconst camelCase = (str) =>\n words(str).reduce(\n (acc, next) =>\n `${acc}${\n !acc\n ? next.toLowerCase()\n : next[0].toUpperCase() + next.slice(1).toLowerCase()\n }`,\n '',\n )\n\nconst pascalCase = (str) => upperFirst(camelCase(str))\n\nconst snakeCase = (str) => join(str, '_')\n\nconst kebabCase = (str) => join(str, '-')\n\nconst sentenceCase = (str) => upperFirst(join(str, ' '))\n\nconst titleCase = (str) => words(str).map(upperFirst).join(' ')\n\nmodule.exports = {\n words,\n upperFirst,\n camelCase,\n pascalCase,\n snakeCase,\n kebabCase,\n sentenceCase,\n titleCase,\n}\n","\n/**\n * Topological sorting function\n *\n * @param {Array} edges\n * @returns {Array}\n */\n\nmodule.exports = function(edges) {\n return toposort(uniqueNodes(edges), edges)\n}\n\nmodule.exports.array = toposort\n\nfunction toposort(nodes, edges) {\n var cursor = nodes.length\n , sorted = new Array(cursor)\n , visited = {}\n , i = cursor\n // Better data structures make algorithm much faster.\n , outgoingEdges = makeOutgoingEdges(edges)\n , nodesHash = makeNodesHash(nodes)\n\n // check for unknown nodes\n edges.forEach(function(edge) {\n if (!nodesHash.has(edge[0]) || !nodesHash.has(edge[1])) {\n throw new Error('Unknown node. There is an unknown node in the supplied edges.')\n }\n })\n\n while (i--) {\n if (!visited[i]) visit(nodes[i], i, new Set())\n }\n\n return sorted\n\n function visit(node, i, predecessors) {\n if(predecessors.has(node)) {\n var nodeRep\n try {\n nodeRep = \", node was:\" + JSON.stringify(node)\n } catch(e) {\n nodeRep = \"\"\n }\n throw new Error('Cyclic dependency' + nodeRep)\n }\n\n if (!nodesHash.has(node)) {\n throw new Error('Found unknown node. Make sure to provided all involved nodes. Unknown node: '+JSON.stringify(node))\n }\n\n if (visited[i]) return;\n visited[i] = true\n\n var outgoing = outgoingEdges.get(node) || new Set()\n outgoing = Array.from(outgoing)\n\n if (i = outgoing.length) {\n predecessors.add(node)\n do {\n var child = outgoing[--i]\n visit(child, nodesHash.get(child), predecessors)\n } while (i)\n predecessors.delete(node)\n }\n\n sorted[--cursor] = node\n }\n}\n\nfunction uniqueNodes(arr){\n var res = new Set()\n for (var i = 0, len = arr.length; i < len; i++) {\n var edge = arr[i]\n res.add(edge[0])\n res.add(edge[1])\n }\n return Array.from(res)\n}\n\nfunction makeOutgoingEdges(arr){\n var edges = new Map()\n for (var i = 0, len = arr.length; i < len; i++) {\n var edge = arr[i]\n if (!edges.has(edge[0])) edges.set(edge[0], new Set())\n if (!edges.has(edge[1])) edges.set(edge[1], new Set())\n edges.get(edge[0]).add(edge[1])\n }\n return edges\n}\n\nfunction makeNodesHash(arr){\n var res = new Map()\n for (var i = 0, len = arr.length; i < len; i++) {\n res.set(arr[i], i)\n }\n return res\n}\n","import { getter, forEach, split, normalizePath, join } from 'property-expr';\nimport { camelCase, snakeCase } from 'tiny-case';\nimport toposort from 'toposort';\n\nconst toString = Object.prototype.toString;\nconst errorToString = Error.prototype.toString;\nconst regExpToString = RegExp.prototype.toString;\nconst symbolToString = typeof Symbol !== 'undefined' ? Symbol.prototype.toString : () => '';\nconst SYMBOL_REGEXP = /^Symbol\\((.*)\\)(.*)$/;\nfunction printNumber(val) {\n if (val != +val) return 'NaN';\n const isNegativeZero = val === 0 && 1 / val < 0;\n return isNegativeZero ? '-0' : '' + val;\n}\nfunction printSimpleValue(val, quoteStrings = false) {\n if (val == null || val === true || val === false) return '' + val;\n const typeOf = typeof val;\n if (typeOf === 'number') return printNumber(val);\n if (typeOf === 'string') return quoteStrings ? `\"${val}\"` : val;\n if (typeOf === 'function') return '[Function ' + (val.name || 'anonymous') + ']';\n if (typeOf === 'symbol') return symbolToString.call(val).replace(SYMBOL_REGEXP, 'Symbol($1)');\n const tag = toString.call(val).slice(8, -1);\n if (tag === 'Date') return isNaN(val.getTime()) ? '' + val : val.toISOString(val);\n if (tag === 'Error' || val instanceof Error) return '[' + errorToString.call(val) + ']';\n if (tag === 'RegExp') return regExpToString.call(val);\n return null;\n}\nfunction printValue(value, quoteStrings) {\n let result = printSimpleValue(value, quoteStrings);\n if (result !== null) return result;\n return JSON.stringify(value, function (key, value) {\n let result = printSimpleValue(this[key], quoteStrings);\n if (result !== null) return result;\n return value;\n }, 2);\n}\n\nfunction toArray(value) {\n return value == null ? [] : [].concat(value);\n}\n\nlet _Symbol$toStringTag, _Symbol$hasInstance, _Symbol$toStringTag2;\nlet strReg = /\\$\\{\\s*(\\w+)\\s*\\}/g;\n_Symbol$toStringTag = Symbol.toStringTag;\nclass ValidationErrorNoStack {\n constructor(errorOrErrors, value, field, type) {\n this.name = void 0;\n this.message = void 0;\n this.value = void 0;\n this.path = void 0;\n this.type = void 0;\n this.params = void 0;\n this.errors = void 0;\n this.inner = void 0;\n this[_Symbol$toStringTag] = 'Error';\n this.name = 'ValidationError';\n this.value = value;\n this.path = field;\n this.type = type;\n this.errors = [];\n this.inner = [];\n toArray(errorOrErrors).forEach(err => {\n if (ValidationError.isError(err)) {\n this.errors.push(...err.errors);\n const innerErrors = err.inner.length ? err.inner : [err];\n this.inner.push(...innerErrors);\n } else {\n this.errors.push(err);\n }\n });\n this.message = this.errors.length > 1 ? `${this.errors.length} errors occurred` : this.errors[0];\n }\n}\n_Symbol$hasInstance = Symbol.hasInstance;\n_Symbol$toStringTag2 = Symbol.toStringTag;\nclass ValidationError extends Error {\n static formatError(message, params) {\n const path = params.label || params.path || 'this';\n if (path !== params.path) params = Object.assign({}, params, {\n path\n });\n if (typeof message === 'string') return message.replace(strReg, (_, key) => printValue(params[key]));\n if (typeof message === 'function') return message(params);\n return message;\n }\n static isError(err) {\n return err && err.name === 'ValidationError';\n }\n constructor(errorOrErrors, value, field, type, disableStack) {\n const errorNoStack = new ValidationErrorNoStack(errorOrErrors, value, field, type);\n if (disableStack) {\n return errorNoStack;\n }\n super();\n this.value = void 0;\n this.path = void 0;\n this.type = void 0;\n this.params = void 0;\n this.errors = [];\n this.inner = [];\n this[_Symbol$toStringTag2] = 'Error';\n this.name = errorNoStack.name;\n this.message = errorNoStack.message;\n this.type = errorNoStack.type;\n this.value = errorNoStack.value;\n this.path = errorNoStack.path;\n this.errors = errorNoStack.errors;\n this.inner = errorNoStack.inner;\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, ValidationError);\n }\n }\n static [_Symbol$hasInstance](inst) {\n return ValidationErrorNoStack[Symbol.hasInstance](inst) || super[Symbol.hasInstance](inst);\n }\n}\n\nlet mixed = {\n default: '${path} is invalid',\n required: '${path} is a required field',\n defined: '${path} must be defined',\n notNull: '${path} cannot be null',\n oneOf: '${path} must be one of the following values: ${values}',\n notOneOf: '${path} must not be one of the following values: ${values}',\n notType: ({\n path,\n type,\n value,\n originalValue\n }) => {\n const castMsg = originalValue != null && originalValue !== value ? ` (cast from the value \\`${printValue(originalValue, true)}\\`).` : '.';\n return type !== 'mixed' ? `${path} must be a \\`${type}\\` type, ` + `but the final value was: \\`${printValue(value, true)}\\`` + castMsg : `${path} must match the configured type. ` + `The validated value was: \\`${printValue(value, true)}\\`` + castMsg;\n }\n};\nlet string = {\n length: '${path} must be exactly ${length} characters',\n min: '${path} must be at least ${min} characters',\n max: '${path} must be at most ${max} characters',\n matches: '${path} must match the following: \"${regex}\"',\n email: '${path} must be a valid email',\n url: '${path} must be a valid URL',\n uuid: '${path} must be a valid UUID',\n datetime: '${path} must be a valid ISO date-time',\n datetime_precision: '${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits',\n datetime_offset: '${path} must be a valid ISO date-time with UTC \"Z\" timezone',\n trim: '${path} must be a trimmed string',\n lowercase: '${path} must be a lowercase string',\n uppercase: '${path} must be a upper case string'\n};\nlet number = {\n min: '${path} must be greater than or equal to ${min}',\n max: '${path} must be less than or equal to ${max}',\n lessThan: '${path} must be less than ${less}',\n moreThan: '${path} must be greater than ${more}',\n positive: '${path} must be a positive number',\n negative: '${path} must be a negative number',\n integer: '${path} must be an integer'\n};\nlet date = {\n min: '${path} field must be later than ${min}',\n max: '${path} field must be at earlier than ${max}'\n};\nlet boolean = {\n isValue: '${path} field must be ${value}'\n};\nlet object = {\n noUnknown: '${path} field has unspecified keys: ${unknown}'\n};\nlet array = {\n min: '${path} field must have at least ${min} items',\n max: '${path} field must have less than or equal to ${max} items',\n length: '${path} must have ${length} items'\n};\nlet tuple = {\n notType: params => {\n const {\n path,\n value,\n spec\n } = params;\n const typeLen = spec.types.length;\n if (Array.isArray(value)) {\n if (value.length < typeLen) return `${path} tuple value has too few items, expected a length of ${typeLen} but got ${value.length} for value: \\`${printValue(value, true)}\\``;\n if (value.length > typeLen) return `${path} tuple value has too many items, expected a length of ${typeLen} but got ${value.length} for value: \\`${printValue(value, true)}\\``;\n }\n return ValidationError.formatError(mixed.notType, params);\n }\n};\nvar locale = Object.assign(Object.create(null), {\n mixed,\n string,\n number,\n date,\n object,\n array,\n boolean,\n tuple\n});\n\nconst isSchema = obj => obj && obj.__isYupSchema__;\n\nclass Condition {\n static fromOptions(refs, config) {\n if (!config.then && !config.otherwise) throw new TypeError('either `then:` or `otherwise:` is required for `when()` conditions');\n let {\n is,\n then,\n otherwise\n } = config;\n let check = typeof is === 'function' ? is : (...values) => values.every(value => value === is);\n return new Condition(refs, (values, schema) => {\n var _branch;\n let branch = check(...values) ? then : otherwise;\n return (_branch = branch == null ? void 0 : branch(schema)) != null ? _branch : schema;\n });\n }\n constructor(refs, builder) {\n this.fn = void 0;\n this.refs = refs;\n this.refs = refs;\n this.fn = builder;\n }\n resolve(base, options) {\n let values = this.refs.map(ref =>\n // TODO: ? operator here?\n ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context));\n let schema = this.fn(values, base, options);\n if (schema === undefined ||\n // @ts-ignore this can be base\n schema === base) {\n return base;\n }\n if (!isSchema(schema)) throw new TypeError('conditions must return a schema object');\n return schema.resolve(options);\n }\n}\n\nconst prefixes = {\n context: '$',\n value: '.'\n};\nfunction create$9(key, options) {\n return new Reference(key, options);\n}\nclass Reference {\n constructor(key, options = {}) {\n this.key = void 0;\n this.isContext = void 0;\n this.isValue = void 0;\n this.isSibling = void 0;\n this.path = void 0;\n this.getter = void 0;\n this.map = void 0;\n if (typeof key !== 'string') throw new TypeError('ref must be a string, got: ' + key);\n this.key = key.trim();\n if (key === '') throw new TypeError('ref must be a non-empty string');\n this.isContext = this.key[0] === prefixes.context;\n this.isValue = this.key[0] === prefixes.value;\n this.isSibling = !this.isContext && !this.isValue;\n let prefix = this.isContext ? prefixes.context : this.isValue ? prefixes.value : '';\n this.path = this.key.slice(prefix.length);\n this.getter = this.path && getter(this.path, true);\n this.map = options.map;\n }\n getValue(value, parent, context) {\n let result = this.isContext ? context : this.isValue ? value : parent;\n if (this.getter) result = this.getter(result || {});\n if (this.map) result = this.map(result);\n return result;\n }\n\n /**\n *\n * @param {*} value\n * @param {Object} options\n * @param {Object=} options.context\n * @param {Object=} options.parent\n */\n cast(value, options) {\n return this.getValue(value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context);\n }\n resolve() {\n return this;\n }\n describe() {\n return {\n type: 'ref',\n key: this.key\n };\n }\n toString() {\n return `Ref(${this.key})`;\n }\n static isRef(value) {\n return value && value.__isYupRef;\n }\n}\n\n// @ts-ignore\nReference.prototype.__isYupRef = true;\n\nconst isAbsent = value => value == null;\n\nfunction createValidation(config) {\n function validate({\n value,\n path = '',\n options,\n originalValue,\n schema\n }, panic, next) {\n const {\n name,\n test,\n params,\n message,\n skipAbsent\n } = config;\n let {\n parent,\n context,\n abortEarly = schema.spec.abortEarly,\n disableStackTrace = schema.spec.disableStackTrace\n } = options;\n function resolve(item) {\n return Reference.isRef(item) ? item.getValue(value, parent, context) : item;\n }\n function createError(overrides = {}) {\n const nextParams = Object.assign({\n value,\n originalValue,\n label: schema.spec.label,\n path: overrides.path || path,\n spec: schema.spec,\n disableStackTrace: overrides.disableStackTrace || disableStackTrace\n }, params, overrides.params);\n for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);\n const error = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name, nextParams.disableStackTrace);\n error.params = nextParams;\n return error;\n }\n const invalid = abortEarly ? panic : next;\n let ctx = {\n path,\n parent,\n type: name,\n from: options.from,\n createError,\n resolve,\n options,\n originalValue,\n schema\n };\n const handleResult = validOrError => {\n if (ValidationError.isError(validOrError)) invalid(validOrError);else if (!validOrError) invalid(createError());else next(null);\n };\n const handleError = err => {\n if (ValidationError.isError(err)) invalid(err);else panic(err);\n };\n const shouldSkip = skipAbsent && isAbsent(value);\n if (shouldSkip) {\n return handleResult(true);\n }\n let result;\n try {\n var _result;\n result = test.call(ctx, value, ctx);\n if (typeof ((_result = result) == null ? void 0 : _result.then) === 'function') {\n if (options.sync) {\n throw new Error(`Validation test of type: \"${ctx.type}\" returned a Promise during a synchronous validate. ` + `This test will finish after the validate call has returned`);\n }\n return Promise.resolve(result).then(handleResult, handleError);\n }\n } catch (err) {\n handleError(err);\n return;\n }\n handleResult(result);\n }\n validate.OPTIONS = config;\n return validate;\n}\n\nfunction getIn(schema, path, value, context = value) {\n let parent, lastPart, lastPartDebug;\n\n // root path: ''\n if (!path) return {\n parent,\n parentPath: path,\n schema\n };\n forEach(path, (_part, isBracket, isArray) => {\n let part = isBracket ? _part.slice(1, _part.length - 1) : _part;\n schema = schema.resolve({\n context,\n parent,\n value\n });\n let isTuple = schema.type === 'tuple';\n let idx = isArray ? parseInt(part, 10) : 0;\n if (schema.innerType || isTuple) {\n if (isTuple && !isArray) throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part \"${lastPartDebug}\" must contain an index to the tuple element, e.g. \"${lastPartDebug}[0]\"`);\n if (value && idx >= value.length) {\n throw new Error(`Yup.reach cannot resolve an array item at index: ${_part}, in the path: ${path}. ` + `because there is no value at that index. `);\n }\n parent = value;\n value = value && value[idx];\n schema = isTuple ? schema.spec.types[idx] : schema.innerType;\n }\n\n // sometimes the array index part of a path doesn't exist: \"nested.arr.child\"\n // in these cases the current part is the next schema and should be processed\n // in this iteration. For cases where the index signature is included this\n // check will fail and we'll handle the `child` part on the next iteration like normal\n if (!isArray) {\n if (!schema.fields || !schema.fields[part]) throw new Error(`The schema does not contain the path: ${path}. ` + `(failed at: ${lastPartDebug} which is a type: \"${schema.type}\")`);\n parent = value;\n value = value && value[part];\n schema = schema.fields[part];\n }\n lastPart = part;\n lastPartDebug = isBracket ? '[' + _part + ']' : '.' + _part;\n });\n return {\n schema,\n parent,\n parentPath: lastPart\n };\n}\nfunction reach(obj, path, value, context) {\n return getIn(obj, path, value, context).schema;\n}\n\nclass ReferenceSet extends Set {\n describe() {\n const description = [];\n for (const item of this.values()) {\n description.push(Reference.isRef(item) ? item.describe() : item);\n }\n return description;\n }\n resolveAll(resolve) {\n let result = [];\n for (const item of this.values()) {\n result.push(resolve(item));\n }\n return result;\n }\n clone() {\n return new ReferenceSet(this.values());\n }\n merge(newItems, removeItems) {\n const next = this.clone();\n newItems.forEach(value => next.add(value));\n removeItems.forEach(value => next.delete(value));\n return next;\n }\n}\n\n// tweaked from https://github.com/Kelin2025/nanoclone/blob/0abeb7635bda9b68ef2277093f76dbe3bf3948e1/src/index.js\nfunction clone(src, seen = new Map()) {\n if (isSchema(src) || !src || typeof src !== 'object') return src;\n if (seen.has(src)) return seen.get(src);\n let copy;\n if (src instanceof Date) {\n // Date\n copy = new Date(src.getTime());\n seen.set(src, copy);\n } else if (src instanceof RegExp) {\n // RegExp\n copy = new RegExp(src);\n seen.set(src, copy);\n } else if (Array.isArray(src)) {\n // Array\n copy = new Array(src.length);\n seen.set(src, copy);\n for (let i = 0; i < src.length; i++) copy[i] = clone(src[i], seen);\n } else if (src instanceof Map) {\n // Map\n copy = new Map();\n seen.set(src, copy);\n for (const [k, v] of src.entries()) copy.set(k, clone(v, seen));\n } else if (src instanceof Set) {\n // Set\n copy = new Set();\n seen.set(src, copy);\n for (const v of src) copy.add(clone(v, seen));\n } else if (src instanceof Object) {\n // Object\n copy = {};\n seen.set(src, copy);\n for (const [k, v] of Object.entries(src)) copy[k] = clone(v, seen);\n } else {\n throw Error(`Unable to clone ${src}`);\n }\n return copy;\n}\n\n// If `CustomSchemaMeta` isn't extended with any keys, we'll fall back to a\n// loose Record definition allowing free form usage.\nclass Schema {\n constructor(options) {\n this.type = void 0;\n this.deps = [];\n this.tests = void 0;\n this.transforms = void 0;\n this.conditions = [];\n this._mutate = void 0;\n this.internalTests = {};\n this._whitelist = new ReferenceSet();\n this._blacklist = new ReferenceSet();\n this.exclusiveTests = Object.create(null);\n this._typeCheck = void 0;\n this.spec = void 0;\n this.tests = [];\n this.transforms = [];\n this.withMutation(() => {\n this.typeError(mixed.notType);\n });\n this.type = options.type;\n this._typeCheck = options.check;\n this.spec = Object.assign({\n strip: false,\n strict: false,\n abortEarly: true,\n recursive: true,\n disableStackTrace: false,\n nullable: false,\n optional: true,\n coerce: true\n }, options == null ? void 0 : options.spec);\n this.withMutation(s => {\n s.nonNullable();\n });\n }\n\n // TODO: remove\n get _type() {\n return this.type;\n }\n clone(spec) {\n if (this._mutate) {\n if (spec) Object.assign(this.spec, spec);\n return this;\n }\n\n // if the nested value is a schema we can skip cloning, since\n // they are already immutable\n const next = Object.create(Object.getPrototypeOf(this));\n\n // @ts-expect-error this is readonly\n next.type = this.type;\n next._typeCheck = this._typeCheck;\n next._whitelist = this._whitelist.clone();\n next._blacklist = this._blacklist.clone();\n next.internalTests = Object.assign({}, this.internalTests);\n next.exclusiveTests = Object.assign({}, this.exclusiveTests);\n\n // @ts-expect-error this is readonly\n next.deps = [...this.deps];\n next.conditions = [...this.conditions];\n next.tests = [...this.tests];\n next.transforms = [...this.transforms];\n next.spec = clone(Object.assign({}, this.spec, spec));\n return next;\n }\n label(label) {\n let next = this.clone();\n next.spec.label = label;\n return next;\n }\n meta(...args) {\n if (args.length === 0) return this.spec.meta;\n let next = this.clone();\n next.spec.meta = Object.assign(next.spec.meta || {}, args[0]);\n return next;\n }\n withMutation(fn) {\n let before = this._mutate;\n this._mutate = true;\n let result = fn(this);\n this._mutate = before;\n return result;\n }\n concat(schema) {\n if (!schema || schema === this) return this;\n if (schema.type !== this.type && this.type !== 'mixed') throw new TypeError(`You cannot \\`concat()\\` schema's of different types: ${this.type} and ${schema.type}`);\n let base = this;\n let combined = schema.clone();\n const mergedSpec = Object.assign({}, base.spec, combined.spec);\n combined.spec = mergedSpec;\n combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);\n\n // manually merge the blacklist/whitelist (the other `schema` takes\n // precedence in case of conflicts)\n combined._whitelist = base._whitelist.merge(schema._whitelist, schema._blacklist);\n combined._blacklist = base._blacklist.merge(schema._blacklist, schema._whitelist);\n\n // start with the current tests\n combined.tests = base.tests;\n combined.exclusiveTests = base.exclusiveTests;\n\n // manually add the new tests to ensure\n // the deduping logic is consistent\n combined.withMutation(next => {\n schema.tests.forEach(fn => {\n next.test(fn.OPTIONS);\n });\n });\n combined.transforms = [...base.transforms, ...combined.transforms];\n return combined;\n }\n isType(v) {\n if (v == null) {\n if (this.spec.nullable && v === null) return true;\n if (this.spec.optional && v === undefined) return true;\n return false;\n }\n return this._typeCheck(v);\n }\n resolve(options) {\n let schema = this;\n if (schema.conditions.length) {\n let conditions = schema.conditions;\n schema = schema.clone();\n schema.conditions = [];\n schema = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema);\n schema = schema.resolve(options);\n }\n return schema;\n }\n resolveOptions(options) {\n var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;\n return Object.assign({}, options, {\n from: options.from || [],\n strict: (_options$strict = options.strict) != null ? _options$strict : this.spec.strict,\n abortEarly: (_options$abortEarly = options.abortEarly) != null ? _options$abortEarly : this.spec.abortEarly,\n recursive: (_options$recursive = options.recursive) != null ? _options$recursive : this.spec.recursive,\n disableStackTrace: (_options$disableStack = options.disableStackTrace) != null ? _options$disableStack : this.spec.disableStackTrace\n });\n }\n\n /**\n * Run the configured transform pipeline over an input value.\n */\n\n cast(value, options = {}) {\n let resolvedSchema = this.resolve(Object.assign({\n value\n }, options));\n let allowOptionality = options.assert === 'ignore-optionality';\n let result = resolvedSchema._cast(value, options);\n if (options.assert !== false && !resolvedSchema.isType(result)) {\n if (allowOptionality && isAbsent(result)) {\n return result;\n }\n let formattedValue = printValue(value);\n let formattedResult = printValue(result);\n throw new TypeError(`The value of ${options.path || 'field'} could not be cast to a value ` + `that satisfies the schema type: \"${resolvedSchema.type}\". \\n\\n` + `attempted value: ${formattedValue} \\n` + (formattedResult !== formattedValue ? `result of cast: ${formattedResult}` : ''));\n }\n return result;\n }\n _cast(rawValue, options) {\n let value = rawValue === undefined ? rawValue : this.transforms.reduce((prevValue, fn) => fn.call(this, prevValue, rawValue, this), rawValue);\n if (value === undefined) {\n value = this.getDefault(options);\n }\n return value;\n }\n _validate(_value, options = {}, panic, next) {\n let {\n path,\n originalValue = _value,\n strict = this.spec.strict\n } = options;\n let value = _value;\n if (!strict) {\n value = this._cast(value, Object.assign({\n assert: false\n }, options));\n }\n let initialTests = [];\n for (let test of Object.values(this.internalTests)) {\n if (test) initialTests.push(test);\n }\n this.runTests({\n path,\n value,\n originalValue,\n options,\n tests: initialTests\n }, panic, initialErrors => {\n // even if we aren't ending early we can't proceed further if the types aren't correct\n if (initialErrors.length) {\n return next(initialErrors, value);\n }\n this.runTests({\n path,\n value,\n originalValue,\n options,\n tests: this.tests\n }, panic, next);\n });\n }\n\n /**\n * Executes a set of validations, either schema, produced Tests or a nested\n * schema validate result.\n */\n runTests(runOptions, panic, next) {\n let fired = false;\n let {\n tests,\n value,\n originalValue,\n path,\n options\n } = runOptions;\n let panicOnce = arg => {\n if (fired) return;\n fired = true;\n panic(arg, value);\n };\n let nextOnce = arg => {\n if (fired) return;\n fired = true;\n next(arg, value);\n };\n let count = tests.length;\n let nestedErrors = [];\n if (!count) return nextOnce([]);\n let args = {\n value,\n originalValue,\n path,\n options,\n schema: this\n };\n for (let i = 0; i < tests.length; i++) {\n const test = tests[i];\n test(args, panicOnce, function finishTestRun(err) {\n if (err) {\n Array.isArray(err) ? nestedErrors.push(...err) : nestedErrors.push(err);\n }\n if (--count <= 0) {\n nextOnce(nestedErrors);\n }\n });\n }\n }\n asNestedTest({\n key,\n index,\n parent,\n parentPath,\n originalParent,\n options\n }) {\n const k = key != null ? key : index;\n if (k == null) {\n throw TypeError('Must include `key` or `index` for nested validations');\n }\n const isIndex = typeof k === 'number';\n let value = parent[k];\n const testOptions = Object.assign({}, options, {\n // Nested validations fields are always strict:\n // 1. parent isn't strict so the casting will also have cast inner values\n // 2. parent is strict in which case the nested values weren't cast either\n strict: true,\n parent,\n value,\n originalValue: originalParent[k],\n // FIXME: tests depend on `index` being passed around deeply,\n // we should not let the options.key/index bleed through\n key: undefined,\n // index: undefined,\n [isIndex ? 'index' : 'key']: k,\n path: isIndex || k.includes('.') ? `${parentPath || ''}[${isIndex ? k : `\"${k}\"`}]` : (parentPath ? `${parentPath}.` : '') + key\n });\n return (_, panic, next) => this.resolve(testOptions)._validate(value, testOptions, panic, next);\n }\n validate(value, options) {\n var _options$disableStack2;\n let schema = this.resolve(Object.assign({}, options, {\n value\n }));\n let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema.spec.disableStackTrace;\n return new Promise((resolve, reject) => schema._validate(value, options, (error, parsed) => {\n if (ValidationError.isError(error)) error.value = parsed;\n reject(error);\n }, (errors, validated) => {\n if (errors.length) reject(new ValidationError(errors, validated, undefined, undefined, disableStackTrace));else resolve(validated);\n }));\n }\n validateSync(value, options) {\n var _options$disableStack3;\n let schema = this.resolve(Object.assign({}, options, {\n value\n }));\n let result;\n let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema.spec.disableStackTrace;\n schema._validate(value, Object.assign({}, options, {\n sync: true\n }), (error, parsed) => {\n if (ValidationError.isError(error)) error.value = parsed;\n throw error;\n }, (errors, validated) => {\n if (errors.length) throw new ValidationError(errors, value, undefined, undefined, disableStackTrace);\n result = validated;\n });\n return result;\n }\n isValid(value, options) {\n return this.validate(value, options).then(() => true, err => {\n if (ValidationError.isError(err)) return false;\n throw err;\n });\n }\n isValidSync(value, options) {\n try {\n this.validateSync(value, options);\n return true;\n } catch (err) {\n if (ValidationError.isError(err)) return false;\n throw err;\n }\n }\n _getDefault(options) {\n let defaultValue = this.spec.default;\n if (defaultValue == null) {\n return defaultValue;\n }\n return typeof defaultValue === 'function' ? defaultValue.call(this, options) : clone(defaultValue);\n }\n getDefault(options\n // If schema is defaulted we know it's at least not undefined\n ) {\n let schema = this.resolve(options || {});\n return schema._getDefault(options);\n }\n default(def) {\n if (arguments.length === 0) {\n return this._getDefault();\n }\n let next = this.clone({\n default: def\n });\n return next;\n }\n strict(isStrict = true) {\n return this.clone({\n strict: isStrict\n });\n }\n nullability(nullable, message) {\n const next = this.clone({\n nullable\n });\n next.internalTests.nullable = createValidation({\n message,\n name: 'nullable',\n test(value) {\n return value === null ? this.schema.spec.nullable : true;\n }\n });\n return next;\n }\n optionality(optional, message) {\n const next = this.clone({\n optional\n });\n next.internalTests.optionality = createValidation({\n message,\n name: 'optionality',\n test(value) {\n return value === undefined ? this.schema.spec.optional : true;\n }\n });\n return next;\n }\n optional() {\n return this.optionality(true);\n }\n defined(message = mixed.defined) {\n return this.optionality(false, message);\n }\n nullable() {\n return this.nullability(true);\n }\n nonNullable(message = mixed.notNull) {\n return this.nullability(false, message);\n }\n required(message = mixed.required) {\n return this.clone().withMutation(next => next.nonNullable(message).defined(message));\n }\n notRequired() {\n return this.clone().withMutation(next => next.nullable().optional());\n }\n transform(fn) {\n let next = this.clone();\n next.transforms.push(fn);\n return next;\n }\n\n /**\n * Adds a test function to the schema's queue of tests.\n * tests can be exclusive or non-exclusive.\n *\n * - exclusive tests, will replace any existing tests of the same name.\n * - non-exclusive: can be stacked\n *\n * If a non-exclusive test is added to a schema with an exclusive test of the same name\n * the exclusive test is removed and further tests of the same name will be stacked.\n *\n * If an exclusive test is added to a schema with non-exclusive tests of the same name\n * the previous tests are removed and further tests of the same name will replace each other.\n */\n\n test(...args) {\n let opts;\n if (args.length === 1) {\n if (typeof args[0] === 'function') {\n opts = {\n test: args[0]\n };\n } else {\n opts = args[0];\n }\n } else if (args.length === 2) {\n opts = {\n name: args[0],\n test: args[1]\n };\n } else {\n opts = {\n name: args[0],\n message: args[1],\n test: args[2]\n };\n }\n if (opts.message === undefined) opts.message = mixed.default;\n if (typeof opts.test !== 'function') throw new TypeError('`test` is a required parameters');\n let next = this.clone();\n let validate = createValidation(opts);\n let isExclusive = opts.exclusive || opts.name && next.exclusiveTests[opts.name] === true;\n if (opts.exclusive) {\n if (!opts.name) throw new TypeError('Exclusive tests must provide a unique `name` identifying the test');\n }\n if (opts.name) next.exclusiveTests[opts.name] = !!opts.exclusive;\n next.tests = next.tests.filter(fn => {\n if (fn.OPTIONS.name === opts.name) {\n if (isExclusive) return false;\n if (fn.OPTIONS.test === validate.OPTIONS.test) return false;\n }\n return true;\n });\n next.tests.push(validate);\n return next;\n }\n when(keys, options) {\n if (!Array.isArray(keys) && typeof keys !== 'string') {\n options = keys;\n keys = '.';\n }\n let next = this.clone();\n let deps = toArray(keys).map(key => new Reference(key));\n deps.forEach(dep => {\n // @ts-ignore readonly array\n if (dep.isSibling) next.deps.push(dep.key);\n });\n next.conditions.push(typeof options === 'function' ? new Condition(deps, options) : Condition.fromOptions(deps, options));\n return next;\n }\n typeError(message) {\n let next = this.clone();\n next.internalTests.typeError = createValidation({\n message,\n name: 'typeError',\n skipAbsent: true,\n test(value) {\n if (!this.schema._typeCheck(value)) return this.createError({\n params: {\n type: this.schema.type\n }\n });\n return true;\n }\n });\n return next;\n }\n oneOf(enums, message = mixed.oneOf) {\n let next = this.clone();\n enums.forEach(val => {\n next._whitelist.add(val);\n next._blacklist.delete(val);\n });\n next.internalTests.whiteList = createValidation({\n message,\n name: 'oneOf',\n skipAbsent: true,\n test(value) {\n let valids = this.schema._whitelist;\n let resolved = valids.resolveAll(this.resolve);\n return resolved.includes(value) ? true : this.createError({\n params: {\n values: Array.from(valids).join(', '),\n resolved\n }\n });\n }\n });\n return next;\n }\n notOneOf(enums, message = mixed.notOneOf) {\n let next = this.clone();\n enums.forEach(val => {\n next._blacklist.add(val);\n next._whitelist.delete(val);\n });\n next.internalTests.blacklist = createValidation({\n message,\n name: 'notOneOf',\n test(value) {\n let invalids = this.schema._blacklist;\n let resolved = invalids.resolveAll(this.resolve);\n if (resolved.includes(value)) return this.createError({\n params: {\n values: Array.from(invalids).join(', '),\n resolved\n }\n });\n return true;\n }\n });\n return next;\n }\n strip(strip = true) {\n let next = this.clone();\n next.spec.strip = strip;\n return next;\n }\n\n /**\n * Return a serialized description of the schema including validations, flags, types etc.\n *\n * @param options Provide any needed context for resolving runtime schema alterations (lazy, when conditions, etc).\n */\n describe(options) {\n const next = (options ? this.resolve(options) : this).clone();\n const {\n label,\n meta,\n optional,\n nullable\n } = next.spec;\n const description = {\n meta,\n label,\n optional,\n nullable,\n default: next.getDefault(options),\n type: next.type,\n oneOf: next._whitelist.describe(),\n notOneOf: next._blacklist.describe(),\n tests: next.tests.map(fn => ({\n name: fn.OPTIONS.name,\n params: fn.OPTIONS.params\n })).filter((n, idx, list) => list.findIndex(c => c.name === n.name) === idx)\n };\n return description;\n }\n}\n// @ts-expect-error\nSchema.prototype.__isYupSchema__ = true;\nfor (const method of ['validate', 'validateSync']) Schema.prototype[`${method}At`] = function (path, value, options = {}) {\n const {\n parent,\n parentPath,\n schema\n } = getIn(this, path, value, options.context);\n return schema[method](parent && parent[parentPath], Object.assign({}, options, {\n parent,\n path\n }));\n};\nfor (const alias of ['equals', 'is']) Schema.prototype[alias] = Schema.prototype.oneOf;\nfor (const alias of ['not', 'nope']) Schema.prototype[alias] = Schema.prototype.notOneOf;\n\nconst returnsTrue = () => true;\nfunction create$8(spec) {\n return new MixedSchema(spec);\n}\nclass MixedSchema extends Schema {\n constructor(spec) {\n super(typeof spec === 'function' ? {\n type: 'mixed',\n check: spec\n } : Object.assign({\n type: 'mixed',\n check: returnsTrue\n }, spec));\n }\n}\ncreate$8.prototype = MixedSchema.prototype;\n\nfunction create$7() {\n return new BooleanSchema();\n}\nclass BooleanSchema extends Schema {\n constructor() {\n super({\n type: 'boolean',\n check(v) {\n if (v instanceof Boolean) v = v.valueOf();\n return typeof v === 'boolean';\n }\n });\n this.withMutation(() => {\n this.transform((value, _raw, ctx) => {\n if (ctx.spec.coerce && !ctx.isType(value)) {\n if (/^(true|1)$/i.test(String(value))) return true;\n if (/^(false|0)$/i.test(String(value))) return false;\n }\n return value;\n });\n });\n }\n isTrue(message = boolean.isValue) {\n return this.test({\n message,\n name: 'is-value',\n exclusive: true,\n params: {\n value: 'true'\n },\n test(value) {\n return isAbsent(value) || value === true;\n }\n });\n }\n isFalse(message = boolean.isValue) {\n return this.test({\n message,\n name: 'is-value',\n exclusive: true,\n params: {\n value: 'false'\n },\n test(value) {\n return isAbsent(value) || value === false;\n }\n });\n }\n default(def) {\n return super.default(def);\n }\n defined(msg) {\n return super.defined(msg);\n }\n optional() {\n return super.optional();\n }\n required(msg) {\n return super.required(msg);\n }\n notRequired() {\n return super.notRequired();\n }\n nullable() {\n return super.nullable();\n }\n nonNullable(msg) {\n return super.nonNullable(msg);\n }\n strip(v) {\n return super.strip(v);\n }\n}\ncreate$7.prototype = BooleanSchema.prototype;\n\n/**\n * This file is a modified version of the file from the following repository:\n * Date.parse with progressive enhancement for ISO 8601 \n * NON-CONFORMANT EDITION.\n * © 2011 Colin Snover \n * Released under MIT license.\n */\n\n// prettier-ignore\n// 1 YYYY 2 MM 3 DD 4 HH 5 mm 6 ss 7 msec 8 Z 9 ± 10 tzHH 11 tzmm\nconst isoReg = /^(\\d{4}|[+-]\\d{6})(?:-?(\\d{2})(?:-?(\\d{2}))?)?(?:[ T]?(\\d{2}):?(\\d{2})(?::?(\\d{2})(?:[,.](\\d{1,}))?)?(?:(Z)|([+-])(\\d{2})(?::?(\\d{2}))?)?)?$/;\nfunction parseIsoDate(date) {\n const struct = parseDateStruct(date);\n if (!struct) return Date.parse ? Date.parse(date) : Number.NaN;\n\n // timestamps without timezone identifiers should be considered local time\n if (struct.z === undefined && struct.plusMinus === undefined) {\n return new Date(struct.year, struct.month, struct.day, struct.hour, struct.minute, struct.second, struct.millisecond).valueOf();\n }\n let totalMinutesOffset = 0;\n if (struct.z !== 'Z' && struct.plusMinus !== undefined) {\n totalMinutesOffset = struct.hourOffset * 60 + struct.minuteOffset;\n if (struct.plusMinus === '+') totalMinutesOffset = 0 - totalMinutesOffset;\n }\n return Date.UTC(struct.year, struct.month, struct.day, struct.hour, struct.minute + totalMinutesOffset, struct.second, struct.millisecond);\n}\nfunction parseDateStruct(date) {\n var _regexResult$7$length, _regexResult$;\n const regexResult = isoReg.exec(date);\n if (!regexResult) return null;\n\n // use of toNumber() avoids NaN timestamps caused by “undefined”\n // values being passed to Date constructor\n return {\n year: toNumber(regexResult[1]),\n month: toNumber(regexResult[2], 1) - 1,\n day: toNumber(regexResult[3], 1),\n hour: toNumber(regexResult[4]),\n minute: toNumber(regexResult[5]),\n second: toNumber(regexResult[6]),\n millisecond: regexResult[7] ?\n // allow arbitrary sub-second precision beyond milliseconds\n toNumber(regexResult[7].substring(0, 3)) : 0,\n precision: (_regexResult$7$length = (_regexResult$ = regexResult[7]) == null ? void 0 : _regexResult$.length) != null ? _regexResult$7$length : undefined,\n z: regexResult[8] || undefined,\n plusMinus: regexResult[9] || undefined,\n hourOffset: toNumber(regexResult[10]),\n minuteOffset: toNumber(regexResult[11])\n };\n}\nfunction toNumber(str, defaultValue = 0) {\n return Number(str) || defaultValue;\n}\n\n// Taken from HTML spec: https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address\nlet rEmail =\n// eslint-disable-next-line\n/^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/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z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|[\\uE000-\\uF8FF]|\\/|\\?)*)?(\\#((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|\\/|\\?)*)?$/i;\n\n// eslint-disable-next-line\nlet rUUID = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;\nlet yearMonthDay = '^\\\\d{4}-\\\\d{2}-\\\\d{2}';\nlet hourMinuteSecond = '\\\\d{2}:\\\\d{2}:\\\\d{2}';\nlet zOrOffset = '(([+-]\\\\d{2}(:?\\\\d{2})?)|Z)';\nlet rIsoDateTime = new RegExp(`${yearMonthDay}T${hourMinuteSecond}(\\\\.\\\\d+)?${zOrOffset}$`);\nlet isTrimmed = value => isAbsent(value) || value === value.trim();\nlet objStringTag = {}.toString();\nfunction create$6() {\n return new StringSchema();\n}\nclass StringSchema extends Schema {\n constructor() {\n super({\n type: 'string',\n check(value) {\n if (value instanceof String) value = value.valueOf();\n return typeof value === 'string';\n }\n });\n this.withMutation(() => {\n this.transform((value, _raw, ctx) => {\n if (!ctx.spec.coerce || ctx.isType(value)) return value;\n\n // don't ever convert arrays\n if (Array.isArray(value)) return value;\n const strValue = value != null && value.toString ? value.toString() : value;\n\n // no one wants plain objects converted to [Object object]\n if (strValue === objStringTag) return value;\n return strValue;\n });\n });\n }\n required(message) {\n return super.required(message).withMutation(schema => schema.test({\n message: message || mixed.required,\n name: 'required',\n skipAbsent: true,\n test: value => !!value.length\n }));\n }\n notRequired() {\n return super.notRequired().withMutation(schema => {\n schema.tests = schema.tests.filter(t => t.OPTIONS.name !== 'required');\n return schema;\n });\n }\n length(length, message = string.length) {\n return this.test({\n message,\n name: 'length',\n exclusive: true,\n params: {\n length\n },\n skipAbsent: true,\n test(value) {\n return value.length === this.resolve(length);\n }\n });\n }\n min(min, message = string.min) {\n return this.test({\n message,\n name: 'min',\n exclusive: true,\n params: {\n min\n },\n skipAbsent: true,\n test(value) {\n return value.length >= this.resolve(min);\n }\n });\n }\n max(max, message = string.max) {\n return this.test({\n name: 'max',\n exclusive: true,\n message,\n params: {\n max\n },\n skipAbsent: true,\n test(value) {\n return value.length <= this.resolve(max);\n }\n });\n }\n matches(regex, options) {\n let excludeEmptyString = false;\n let message;\n let name;\n if (options) {\n if (typeof options === 'object') {\n ({\n excludeEmptyString = false,\n message,\n name\n } = options);\n } else {\n message = options;\n }\n }\n return this.test({\n name: name || 'matches',\n message: message || string.matches,\n params: {\n regex\n },\n skipAbsent: true,\n test: value => value === '' && excludeEmptyString || value.search(regex) !== -1\n });\n }\n email(message = string.email) {\n return this.matches(rEmail, {\n name: 'email',\n message,\n excludeEmptyString: true\n });\n }\n url(message = string.url) {\n return this.matches(rUrl, {\n name: 'url',\n message,\n excludeEmptyString: true\n });\n }\n uuid(message = string.uuid) {\n return this.matches(rUUID, {\n name: 'uuid',\n message,\n excludeEmptyString: false\n });\n }\n datetime(options) {\n let message = '';\n let allowOffset;\n let precision;\n if (options) {\n if (typeof options === 'object') {\n ({\n message = '',\n allowOffset = false,\n precision = undefined\n } = options);\n } else {\n message = options;\n }\n }\n return this.matches(rIsoDateTime, {\n name: 'datetime',\n message: message || string.datetime,\n excludeEmptyString: true\n }).test({\n name: 'datetime_offset',\n message: message || string.datetime_offset,\n params: {\n allowOffset\n },\n skipAbsent: true,\n test: value => {\n if (!value || allowOffset) return true;\n const struct = parseDateStruct(value);\n if (!struct) return false;\n return !!struct.z;\n }\n }).test({\n name: 'datetime_precision',\n message: message || string.datetime_precision,\n params: {\n precision\n },\n skipAbsent: true,\n test: value => {\n if (!value || precision == undefined) return true;\n const struct = parseDateStruct(value);\n if (!struct) return false;\n return struct.precision === precision;\n }\n });\n }\n\n //-- transforms --\n ensure() {\n return this.default('').transform(val => val === null ? '' : val);\n }\n trim(message = string.trim) {\n return this.transform(val => val != null ? val.trim() : val).test({\n message,\n name: 'trim',\n test: isTrimmed\n });\n }\n lowercase(message = string.lowercase) {\n return this.transform(value => !isAbsent(value) ? value.toLowerCase() : value).test({\n message,\n name: 'string_case',\n exclusive: true,\n skipAbsent: true,\n test: value => isAbsent(value) || value === value.toLowerCase()\n });\n }\n uppercase(message = string.uppercase) {\n return this.transform(value => !isAbsent(value) ? value.toUpperCase() : value).test({\n message,\n name: 'string_case',\n exclusive: true,\n skipAbsent: true,\n test: value => isAbsent(value) || value === value.toUpperCase()\n });\n }\n}\ncreate$6.prototype = StringSchema.prototype;\n\n//\n// String Interfaces\n//\n\nlet isNaN$1 = value => value != +value;\nfunction create$5() {\n return new NumberSchema();\n}\nclass NumberSchema extends Schema {\n constructor() {\n super({\n type: 'number',\n check(value) {\n if (value instanceof Number) value = value.valueOf();\n return typeof value === 'number' && !isNaN$1(value);\n }\n });\n this.withMutation(() => {\n this.transform((value, _raw, ctx) => {\n if (!ctx.spec.coerce) return value;\n let parsed = value;\n if (typeof parsed === 'string') {\n parsed = parsed.replace(/\\s/g, '');\n if (parsed === '') return NaN;\n // don't use parseFloat to avoid positives on alpha-numeric strings\n parsed = +parsed;\n }\n\n // null -> NaN isn't useful; treat all nulls as null and let it fail on\n // nullability check vs TypeErrors\n if (ctx.isType(parsed) || parsed === null) return parsed;\n return parseFloat(parsed);\n });\n });\n }\n min(min, message = number.min) {\n return this.test({\n message,\n name: 'min',\n exclusive: true,\n params: {\n min\n },\n skipAbsent: true,\n test(value) {\n return value >= this.resolve(min);\n }\n });\n }\n max(max, message = number.max) {\n return this.test({\n message,\n name: 'max',\n exclusive: true,\n params: {\n max\n },\n skipAbsent: true,\n test(value) {\n return value <= this.resolve(max);\n }\n });\n }\n lessThan(less, message = number.lessThan) {\n return this.test({\n message,\n name: 'max',\n exclusive: true,\n params: {\n less\n },\n skipAbsent: true,\n test(value) {\n return value < this.resolve(less);\n }\n });\n }\n moreThan(more, message = number.moreThan) {\n return this.test({\n message,\n name: 'min',\n exclusive: true,\n params: {\n more\n },\n skipAbsent: true,\n test(value) {\n return value > this.resolve(more);\n }\n });\n }\n positive(msg = number.positive) {\n return this.moreThan(0, msg);\n }\n negative(msg = number.negative) {\n return this.lessThan(0, msg);\n }\n integer(message = number.integer) {\n return this.test({\n name: 'integer',\n message,\n skipAbsent: true,\n test: val => Number.isInteger(val)\n });\n }\n truncate() {\n return this.transform(value => !isAbsent(value) ? value | 0 : value);\n }\n round(method) {\n var _method;\n let avail = ['ceil', 'floor', 'round', 'trunc'];\n method = ((_method = method) == null ? void 0 : _method.toLowerCase()) || 'round';\n\n // this exists for symemtry with the new Math.trunc\n if (method === 'trunc') return this.truncate();\n if (avail.indexOf(method.toLowerCase()) === -1) throw new TypeError('Only valid options for round() are: ' + avail.join(', '));\n return this.transform(value => !isAbsent(value) ? Math[method](value) : value);\n }\n}\ncreate$5.prototype = NumberSchema.prototype;\n\n//\n// Number Interfaces\n//\n\nlet invalidDate = new Date('');\nlet isDate = obj => Object.prototype.toString.call(obj) === '[object Date]';\nfunction create$4() {\n return new DateSchema();\n}\nclass DateSchema extends Schema {\n constructor() {\n super({\n type: 'date',\n check(v) {\n return isDate(v) && !isNaN(v.getTime());\n }\n });\n this.withMutation(() => {\n this.transform((value, _raw, ctx) => {\n // null -> InvalidDate isn't useful; treat all nulls as null and let it fail on\n // nullability check vs TypeErrors\n if (!ctx.spec.coerce || ctx.isType(value) || value === null) return value;\n value = parseIsoDate(value);\n\n // 0 is a valid timestamp equivalent to 1970-01-01T00:00:00Z(unix epoch) or before.\n return !isNaN(value) ? new Date(value) : DateSchema.INVALID_DATE;\n });\n });\n }\n prepareParam(ref, name) {\n let param;\n if (!Reference.isRef(ref)) {\n let cast = this.cast(ref);\n if (!this._typeCheck(cast)) throw new TypeError(`\\`${name}\\` must be a Date or a value that can be \\`cast()\\` to a Date`);\n param = cast;\n } else {\n param = ref;\n }\n return param;\n }\n min(min, message = date.min) {\n let limit = this.prepareParam(min, 'min');\n return this.test({\n message,\n name: 'min',\n exclusive: true,\n params: {\n min\n },\n skipAbsent: true,\n test(value) {\n return value >= this.resolve(limit);\n }\n });\n }\n max(max, message = date.max) {\n let limit = this.prepareParam(max, 'max');\n return this.test({\n message,\n name: 'max',\n exclusive: true,\n params: {\n max\n },\n skipAbsent: true,\n test(value) {\n return value <= this.resolve(limit);\n }\n });\n }\n}\nDateSchema.INVALID_DATE = invalidDate;\ncreate$4.prototype = DateSchema.prototype;\ncreate$4.INVALID_DATE = invalidDate;\n\n// @ts-expect-error\nfunction sortFields(fields, excludedEdges = []) {\n let edges = [];\n let nodes = new Set();\n let excludes = new Set(excludedEdges.map(([a, b]) => `${a}-${b}`));\n function addNode(depPath, key) {\n let node = split(depPath)[0];\n nodes.add(node);\n if (!excludes.has(`${key}-${node}`)) edges.push([key, node]);\n }\n for (const key of Object.keys(fields)) {\n let value = fields[key];\n nodes.add(key);\n if (Reference.isRef(value) && value.isSibling) addNode(value.path, key);else if (isSchema(value) && 'deps' in value) value.deps.forEach(path => addNode(path, key));\n }\n return toposort.array(Array.from(nodes), edges).reverse();\n}\n\nfunction findIndex(arr, err) {\n let idx = Infinity;\n arr.some((key, ii) => {\n var _err$path;\n if ((_err$path = err.path) != null && _err$path.includes(key)) {\n idx = ii;\n return true;\n }\n });\n return idx;\n}\nfunction sortByKeyOrder(keys) {\n return (a, b) => {\n return findIndex(keys, a) - findIndex(keys, b);\n };\n}\n\nconst parseJson = (value, _, ctx) => {\n if (typeof value !== 'string') {\n return value;\n }\n let parsed = value;\n try {\n parsed = JSON.parse(value);\n } catch (err) {\n /* */\n }\n return ctx.isType(parsed) ? parsed : value;\n};\n\n// @ts-ignore\nfunction deepPartial(schema) {\n if ('fields' in schema) {\n const partial = {};\n for (const [key, fieldSchema] of Object.entries(schema.fields)) {\n partial[key] = deepPartial(fieldSchema);\n }\n return schema.setFields(partial);\n }\n if (schema.type === 'array') {\n const nextArray = schema.optional();\n if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);\n return nextArray;\n }\n if (schema.type === 'tuple') {\n return schema.optional().clone({\n types: schema.spec.types.map(deepPartial)\n });\n }\n if ('optional' in schema) {\n return schema.optional();\n }\n return schema;\n}\nconst deepHas = (obj, p) => {\n const path = [...normalizePath(p)];\n if (path.length === 1) return path[0] in obj;\n let last = path.pop();\n let parent = getter(join(path), true)(obj);\n return !!(parent && last in parent);\n};\nlet isObject = obj => Object.prototype.toString.call(obj) === '[object Object]';\nfunction unknown(ctx, value) {\n let known = Object.keys(ctx.fields);\n return Object.keys(value).filter(key => known.indexOf(key) === -1);\n}\nconst defaultSort = sortByKeyOrder([]);\nfunction create$3(spec) {\n return new ObjectSchema(spec);\n}\nclass ObjectSchema extends Schema {\n constructor(spec) {\n super({\n type: 'object',\n check(value) {\n return isObject(value) || typeof value === 'function';\n }\n });\n this.fields = Object.create(null);\n this._sortErrors = defaultSort;\n this._nodes = [];\n this._excludedEdges = [];\n this.withMutation(() => {\n if (spec) {\n this.shape(spec);\n }\n });\n }\n _cast(_value, options = {}) {\n var _options$stripUnknown;\n let value = super._cast(_value, options);\n\n //should ignore nulls here\n if (value === undefined) return this.getDefault(options);\n if (!this._typeCheck(value)) return value;\n let fields = this.fields;\n let strip = (_options$stripUnknown = options.stripUnknown) != null ? _options$stripUnknown : this.spec.noUnknown;\n let props = [].concat(this._nodes, Object.keys(value).filter(v => !this._nodes.includes(v)));\n let intermediateValue = {}; // is filled during the transform below\n let innerOptions = Object.assign({}, options, {\n parent: intermediateValue,\n __validating: options.__validating || false\n });\n let isChanged = false;\n for (const prop of props) {\n let field = fields[prop];\n let exists = (prop in value);\n if (field) {\n let fieldValue;\n let inputValue = value[prop];\n\n // safe to mutate since this is fired in sequence\n innerOptions.path = (options.path ? `${options.path}.` : '') + prop;\n field = field.resolve({\n value: inputValue,\n context: options.context,\n parent: intermediateValue\n });\n let fieldSpec = field instanceof Schema ? field.spec : undefined;\n let strict = fieldSpec == null ? void 0 : fieldSpec.strict;\n if (fieldSpec != null && fieldSpec.strip) {\n isChanged = isChanged || prop in value;\n continue;\n }\n fieldValue = !options.__validating || !strict ?\n // TODO: use _cast, this is double resolving\n field.cast(value[prop], innerOptions) : value[prop];\n if (fieldValue !== undefined) {\n intermediateValue[prop] = fieldValue;\n }\n } else if (exists && !strip) {\n intermediateValue[prop] = value[prop];\n }\n if (exists !== prop in intermediateValue || intermediateValue[prop] !== value[prop]) {\n isChanged = true;\n }\n }\n return isChanged ? intermediateValue : value;\n }\n _validate(_value, options = {}, panic, next) {\n let {\n from = [],\n originalValue = _value,\n recursive = this.spec.recursive\n } = options;\n options.from = [{\n schema: this,\n value: originalValue\n }, ...from];\n // this flag is needed for handling `strict` correctly in the context of\n // validation vs just casting. e.g strict() on a field is only used when validating\n options.__validating = true;\n options.originalValue = originalValue;\n super._validate(_value, options, panic, (objectErrors, value) => {\n if (!recursive || !isObject(value)) {\n next(objectErrors, value);\n return;\n }\n originalValue = originalValue || value;\n let tests = [];\n for (let key of this._nodes) {\n let field = this.fields[key];\n if (!field || Reference.isRef(field)) {\n continue;\n }\n tests.push(field.asNestedTest({\n options,\n key,\n parent: value,\n parentPath: options.path,\n originalParent: originalValue\n }));\n }\n this.runTests({\n tests,\n value,\n originalValue,\n options\n }, panic, fieldErrors => {\n next(fieldErrors.sort(this._sortErrors).concat(objectErrors), value);\n });\n });\n }\n clone(spec) {\n const next = super.clone(spec);\n next.fields = Object.assign({}, this.fields);\n next._nodes = this._nodes;\n next._excludedEdges = this._excludedEdges;\n next._sortErrors = this._sortErrors;\n return next;\n }\n concat(schema) {\n let next = super.concat(schema);\n let nextFields = next.fields;\n for (let [field, schemaOrRef] of Object.entries(this.fields)) {\n const target = nextFields[field];\n nextFields[field] = target === undefined ? schemaOrRef : target;\n }\n return next.withMutation(s =>\n // XXX: excludes here is wrong\n s.setFields(nextFields, [...this._excludedEdges, ...schema._excludedEdges]));\n }\n _getDefault(options) {\n if ('default' in this.spec) {\n return super._getDefault(options);\n }\n\n // if there is no default set invent one\n if (!this._nodes.length) {\n return undefined;\n }\n let dft = {};\n this._nodes.forEach(key => {\n var _innerOptions;\n const field = this.fields[key];\n let innerOptions = options;\n if ((_innerOptions = innerOptions) != null && _innerOptions.value) {\n innerOptions = Object.assign({}, innerOptions, {\n parent: innerOptions.value,\n value: innerOptions.value[key]\n });\n }\n dft[key] = field && 'getDefault' in field ? field.getDefault(innerOptions) : undefined;\n });\n return dft;\n }\n setFields(shape, excludedEdges) {\n let next = this.clone();\n next.fields = shape;\n next._nodes = sortFields(shape, excludedEdges);\n next._sortErrors = sortByKeyOrder(Object.keys(shape));\n // XXX: this carries over edges which may not be what you want\n if (excludedEdges) next._excludedEdges = excludedEdges;\n return next;\n }\n shape(additions, excludes = []) {\n return this.clone().withMutation(next => {\n let edges = next._excludedEdges;\n if (excludes.length) {\n if (!Array.isArray(excludes[0])) excludes = [excludes];\n edges = [...next._excludedEdges, ...excludes];\n }\n\n // XXX: excludes here is wrong\n return next.setFields(Object.assign(next.fields, additions), edges);\n });\n }\n partial() {\n const partial = {};\n for (const [key, schema] of Object.entries(this.fields)) {\n partial[key] = 'optional' in schema && schema.optional instanceof Function ? schema.optional() : schema;\n }\n return this.setFields(partial);\n }\n deepPartial() {\n const next = deepPartial(this);\n return next;\n }\n pick(keys) {\n const picked = {};\n for (const key of keys) {\n if (this.fields[key]) picked[key] = this.fields[key];\n }\n return this.setFields(picked, this._excludedEdges.filter(([a, b]) => keys.includes(a) && keys.includes(b)));\n }\n omit(keys) {\n const remaining = [];\n for (const key of Object.keys(this.fields)) {\n if (keys.includes(key)) continue;\n remaining.push(key);\n }\n return this.pick(remaining);\n }\n from(from, to, alias) {\n let fromGetter = getter(from, true);\n return this.transform(obj => {\n if (!obj) return obj;\n let newObj = obj;\n if (deepHas(obj, from)) {\n newObj = Object.assign({}, obj);\n if (!alias) delete newObj[from];\n newObj[to] = fromGetter(obj);\n }\n return newObj;\n });\n }\n\n /** Parse an input JSON string to an object */\n json() {\n return this.transform(parseJson);\n }\n noUnknown(noAllow = true, message = object.noUnknown) {\n if (typeof noAllow !== 'boolean') {\n message = noAllow;\n noAllow = true;\n }\n let next = this.test({\n name: 'noUnknown',\n exclusive: true,\n message: message,\n test(value) {\n if (value == null) return true;\n const unknownKeys = unknown(this.schema, value);\n return !noAllow || unknownKeys.length === 0 || this.createError({\n params: {\n unknown: unknownKeys.join(', ')\n }\n });\n }\n });\n next.spec.noUnknown = noAllow;\n return next;\n }\n unknown(allow = true, message = object.noUnknown) {\n return this.noUnknown(!allow, message);\n }\n transformKeys(fn) {\n return this.transform(obj => {\n if (!obj) return obj;\n const result = {};\n for (const key of Object.keys(obj)) result[fn(key)] = obj[key];\n return result;\n });\n }\n camelCase() {\n return this.transformKeys(camelCase);\n }\n snakeCase() {\n return this.transformKeys(snakeCase);\n }\n constantCase() {\n return this.transformKeys(key => snakeCase(key).toUpperCase());\n }\n describe(options) {\n const next = (options ? this.resolve(options) : this).clone();\n const base = super.describe(options);\n base.fields = {};\n for (const [key, value] of Object.entries(next.fields)) {\n var _innerOptions2;\n let innerOptions = options;\n if ((_innerOptions2 = innerOptions) != null && _innerOptions2.value) {\n innerOptions = Object.assign({}, innerOptions, {\n parent: innerOptions.value,\n value: innerOptions.value[key]\n });\n }\n base.fields[key] = value.describe(innerOptions);\n }\n return base;\n }\n}\ncreate$3.prototype = ObjectSchema.prototype;\n\nfunction create$2(type) {\n return new ArraySchema(type);\n}\nclass ArraySchema extends Schema {\n constructor(type) {\n super({\n type: 'array',\n spec: {\n types: type\n },\n check(v) {\n return Array.isArray(v);\n }\n });\n\n // `undefined` specifically means uninitialized, as opposed to \"no subtype\"\n this.innerType = void 0;\n this.innerType = type;\n }\n _cast(_value, _opts) {\n const value = super._cast(_value, _opts);\n\n // should ignore nulls here\n if (!this._typeCheck(value) || !this.innerType) {\n return value;\n }\n let isChanged = false;\n const castArray = value.map((v, idx) => {\n const castElement = this.innerType.cast(v, Object.assign({}, _opts, {\n path: `${_opts.path || ''}[${idx}]`\n }));\n if (castElement !== v) {\n isChanged = true;\n }\n return castElement;\n });\n return isChanged ? castArray : value;\n }\n _validate(_value, options = {}, panic, next) {\n var _options$recursive;\n // let sync = options.sync;\n // let path = options.path;\n let innerType = this.innerType;\n // let endEarly = options.abortEarly ?? this.spec.abortEarly;\n let recursive = (_options$recursive = options.recursive) != null ? _options$recursive : this.spec.recursive;\n options.originalValue != null ? options.originalValue : _value;\n super._validate(_value, options, panic, (arrayErrors, value) => {\n var _options$originalValu2;\n if (!recursive || !innerType || !this._typeCheck(value)) {\n next(arrayErrors, value);\n return;\n }\n\n // #950 Ensure that sparse array empty slots are validated\n let tests = new Array(value.length);\n for (let index = 0; index < value.length; index++) {\n var _options$originalValu;\n tests[index] = innerType.asNestedTest({\n options,\n index,\n parent: value,\n parentPath: options.path,\n originalParent: (_options$originalValu = options.originalValue) != null ? _options$originalValu : _value\n });\n }\n this.runTests({\n value,\n tests,\n originalValue: (_options$originalValu2 = options.originalValue) != null ? _options$originalValu2 : _value,\n options\n }, panic, innerTypeErrors => next(innerTypeErrors.concat(arrayErrors), value));\n });\n }\n clone(spec) {\n const next = super.clone(spec);\n // @ts-expect-error readonly\n next.innerType = this.innerType;\n return next;\n }\n\n /** Parse an input JSON string to an object */\n json() {\n return this.transform(parseJson);\n }\n concat(schema) {\n let next = super.concat(schema);\n\n // @ts-expect-error readonly\n next.innerType = this.innerType;\n if (schema.innerType)\n // @ts-expect-error readonly\n next.innerType = next.innerType ?\n // @ts-expect-error Lazy doesn't have concat and will break\n next.innerType.concat(schema.innerType) : schema.innerType;\n return next;\n }\n of(schema) {\n // FIXME: this should return a new instance of array without the default to be\n let next = this.clone();\n if (!isSchema(schema)) throw new TypeError('`array.of()` sub-schema must be a valid yup schema not: ' + printValue(schema));\n\n // @ts-expect-error readonly\n next.innerType = schema;\n next.spec = Object.assign({}, next.spec, {\n types: schema\n });\n return next;\n }\n length(length, message = array.length) {\n return this.test({\n message,\n name: 'length',\n exclusive: true,\n params: {\n length\n },\n skipAbsent: true,\n test(value) {\n return value.length === this.resolve(length);\n }\n });\n }\n min(min, message) {\n message = message || array.min;\n return this.test({\n message,\n name: 'min',\n exclusive: true,\n params: {\n min\n },\n skipAbsent: true,\n // FIXME(ts): Array\n test(value) {\n return value.length >= this.resolve(min);\n }\n });\n }\n max(max, message) {\n message = message || array.max;\n return this.test({\n message,\n name: 'max',\n exclusive: true,\n params: {\n max\n },\n skipAbsent: true,\n test(value) {\n return value.length <= this.resolve(max);\n }\n });\n }\n ensure() {\n return this.default(() => []).transform((val, original) => {\n // We don't want to return `null` for nullable schema\n if (this._typeCheck(val)) return val;\n return original == null ? [] : [].concat(original);\n });\n }\n compact(rejector) {\n let reject = !rejector ? v => !!v : (v, i, a) => !rejector(v, i, a);\n return this.transform(values => values != null ? values.filter(reject) : values);\n }\n describe(options) {\n const next = (options ? this.resolve(options) : this).clone();\n const base = super.describe(options);\n if (next.innerType) {\n var _innerOptions;\n let innerOptions = options;\n if ((_innerOptions = innerOptions) != null && _innerOptions.value) {\n innerOptions = Object.assign({}, innerOptions, {\n parent: innerOptions.value,\n value: innerOptions.value[0]\n });\n }\n base.innerType = next.innerType.describe(innerOptions);\n }\n return base;\n }\n}\ncreate$2.prototype = ArraySchema.prototype;\n\n// @ts-ignore\nfunction create$1(schemas) {\n return new TupleSchema(schemas);\n}\nclass TupleSchema extends Schema {\n constructor(schemas) {\n super({\n type: 'tuple',\n spec: {\n types: schemas\n },\n check(v) {\n const types = this.spec.types;\n return Array.isArray(v) && v.length === types.length;\n }\n });\n this.withMutation(() => {\n this.typeError(tuple.notType);\n });\n }\n _cast(inputValue, options) {\n const {\n types\n } = this.spec;\n const value = super._cast(inputValue, options);\n if (!this._typeCheck(value)) {\n return value;\n }\n let isChanged = false;\n const castArray = types.map((type, idx) => {\n const castElement = type.cast(value[idx], Object.assign({}, options, {\n path: `${options.path || ''}[${idx}]`\n }));\n if (castElement !== value[idx]) isChanged = true;\n return castElement;\n });\n return isChanged ? castArray : value;\n }\n _validate(_value, options = {}, panic, next) {\n let itemTypes = this.spec.types;\n super._validate(_value, options, panic, (tupleErrors, value) => {\n var _options$originalValu2;\n // intentionally not respecting recursive\n if (!this._typeCheck(value)) {\n next(tupleErrors, value);\n return;\n }\n let tests = [];\n for (let [index, itemSchema] of itemTypes.entries()) {\n var _options$originalValu;\n tests[index] = itemSchema.asNestedTest({\n options,\n index,\n parent: value,\n parentPath: options.path,\n originalParent: (_options$originalValu = options.originalValue) != null ? _options$originalValu : _value\n });\n }\n this.runTests({\n value,\n tests,\n originalValue: (_options$originalValu2 = options.originalValue) != null ? _options$originalValu2 : _value,\n options\n }, panic, innerTypeErrors => next(innerTypeErrors.concat(tupleErrors), value));\n });\n }\n describe(options) {\n const next = (options ? this.resolve(options) : this).clone();\n const base = super.describe(options);\n base.innerType = next.spec.types.map((schema, index) => {\n var _innerOptions;\n let innerOptions = options;\n if ((_innerOptions = innerOptions) != null && _innerOptions.value) {\n innerOptions = Object.assign({}, innerOptions, {\n parent: innerOptions.value,\n value: innerOptions.value[index]\n });\n }\n return schema.describe(innerOptions);\n });\n return base;\n }\n}\ncreate$1.prototype = TupleSchema.prototype;\n\nfunction create(builder) {\n return new Lazy(builder);\n}\nclass Lazy {\n constructor(builder) {\n this.type = 'lazy';\n this.__isYupSchema__ = true;\n this.spec = void 0;\n this._resolve = (value, options = {}) => {\n let schema = this.builder(value, options);\n if (!isSchema(schema)) throw new TypeError('lazy() functions must return a valid schema');\n if (this.spec.optional) schema = schema.optional();\n return schema.resolve(options);\n };\n this.builder = builder;\n this.spec = {\n meta: undefined,\n optional: false\n };\n }\n clone(spec) {\n const next = new Lazy(this.builder);\n next.spec = Object.assign({}, this.spec, spec);\n return next;\n }\n optionality(optional) {\n const next = this.clone({\n optional\n });\n return next;\n }\n optional() {\n return this.optionality(true);\n }\n resolve(options) {\n return this._resolve(options.value, options);\n }\n cast(value, options) {\n return this._resolve(value, options).cast(value, options);\n }\n asNestedTest(config) {\n let {\n key,\n index,\n parent,\n options\n } = config;\n let value = parent[index != null ? index : key];\n return this._resolve(value, Object.assign({}, options, {\n value,\n parent\n })).asNestedTest(config);\n }\n validate(value, options) {\n return this._resolve(value, options).validate(value, options);\n }\n validateSync(value, options) {\n return this._resolve(value, options).validateSync(value, options);\n }\n validateAt(path, value, options) {\n return this._resolve(value, options).validateAt(path, value, options);\n }\n validateSyncAt(path, value, options) {\n return this._resolve(value, options).validateSyncAt(path, value, options);\n }\n isValid(value, options) {\n return this._resolve(value, options).isValid(value, options);\n }\n isValidSync(value, options) {\n return this._resolve(value, options).isValidSync(value, options);\n }\n describe(options) {\n return options ? this.resolve(options).describe(options) : {\n type: 'lazy',\n meta: this.spec.meta,\n label: undefined\n };\n }\n meta(...args) {\n if (args.length === 0) return this.spec.meta;\n let next = this.clone();\n next.spec.meta = Object.assign(next.spec.meta || {}, args[0]);\n return next;\n }\n}\n\nfunction setLocale(custom) {\n Object.keys(custom).forEach(type => {\n // @ts-ignore\n Object.keys(custom[type]).forEach(method => {\n // @ts-ignore\n locale[type][method] = custom[type][method];\n });\n });\n}\n\nfunction addMethod(schemaType, name, fn) {\n if (!schemaType || !isSchema(schemaType.prototype)) throw new TypeError('You must provide a yup schema constructor function');\n if (typeof name !== 'string') throw new TypeError('A Method name must be provided');\n if (typeof fn !== 'function') throw new TypeError('Method function must be provided');\n schemaType.prototype[name] = fn;\n}\n\nexport { ArraySchema, BooleanSchema, DateSchema, MixedSchema, NumberSchema, ObjectSchema, Schema, StringSchema, TupleSchema, ValidationError, addMethod, create$2 as array, create$7 as bool, create$7 as boolean, create$4 as date, locale as defaultLocale, getIn, isSchema, create as lazy, create$8 as mixed, create$5 as number, create$3 as object, printValue, reach, create$9 as ref, setLocale, create$6 as string, create$1 as tuple };\n"],"names":["isCallable","fn","isNullOrUndefined","value","isObject","obj","isIndex","toNumber","n","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","FieldContextKey","IS_ABSENT","isClient","isLocator","isTypedSchema","isYupValidator","hasCheckedAttr","type","isContainerValue","isEmptyContainer","isNotNestedPath","isNativeMultiSelect","el","isNativeSelect","isFormSubmitEvent","evt","isEvent","isEqual","a","b","length","keys","isFile","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","result","r","resolve","applyModelModifiers","modifiers","withLatest","onDone","latestRun","pending","normalizeErrorItem","message","omit","debounceNextTick","lastTick","thisTick","nextTick","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","errors","_validate","validateFieldWithTypedSchema","ctx","pipeline","_generateFieldError","normalizedContext","rulesKeys","_test","isYupError","err","yupToTypedSchema","yupSchema","values","_a","schema","messages","error","validator","fillTargetValues","fieldCtx","normalize","param","validateTypedSchema","validationResult","results","m","validateObjectSchema","opts","validations","_b","_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","reactive","watch","useField","useFieldWithChecked","_useField","validateOnMount","bails","label","validateOnValueUpdate","controlled","keepValueOnUnmount","syncVModel","controlForm","normalizeOptions","injectedForm","toValue","rulesValue","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","prop","propName","emitName","propValue","FORM_COUNTER","PRIVATE_PATH_STATE_KEYS","resolveInitialValues","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","_d","_e","_f","shallowRef","validateField","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","schemaValue","submitForm","evalConfig","onBlur","onInput","onChange","props","base","pathOrPaths","model","onUpdateModelValue","conf","readonly","pathsState","currentValues","MERGE_STRATEGIES","isDirty","calculateFlags","states","flag","mergeMethod","watchEffect","updateFields","Cache","maxSize","SPLIT_REGEX","DIGIT_REGEX","LEAD_DIGIT_REGEX","SPEC_CHAR_REGEX","CLEAN_QUOTES_REGEX","MAX_CACHE_SIZE","pathCache","setCache","getCache","propertyExpr","split","normalizePath","parts","index","len","data","part","safe","segments","isQuoted","cb","thisArg","forEach","iter","isArray","isBracket","shouldBeQuoted","hasLeadingNumber","hasSpecialChars","reWords","words","upperFirst","join","d","camelCase","next","pascalCase","snakeCase","kebabCase","sentenceCase","titleCase","tinyCase","toposortModule","edges","toposort","uniqueNodes","nodes","cursor","sorted","visited","outgoingEdges","makeOutgoingEdges","nodesHash","makeNodesHash","edge","visit","node","predecessors","nodeRep","outgoing","child","arr","res","toString","errorToString","regExpToString","symbolToString","SYMBOL_REGEXP","printNumber","printSimpleValue","quoteStrings","typeOf","tag","printValue","toArray","_Symbol$toStringTag","_Symbol$hasInstance","_Symbol$toStringTag2","strReg","ValidationErrorNoStack","errorOrErrors","ValidationError","innerErrors","disableStack","errorNoStack","inst","mixed","originalValue","castMsg","string","number","date","boolean","array","tuple","spec","typeLen","isSchema","Condition","refs","is","then","otherwise","check","_branch","branch","builder","prefixes","Reference","prefix","getter","parent","context","isAbsent","createValidation","panic","test","skipAbsent","abortEarly","disableStackTrace","item","createError","overrides","nextParams","invalid","handleResult","validOrError","handleError","_result","getIn","lastPart","lastPartDebug","_part","isTuple","ReferenceSet","description","newItems","removeItems","clone","src","seen","copy","Schema","before","combined","mergedSpec","conditions","prevSchema","condition","_options$strict","_options$abortEarly","_options$recursive","_options$disableStack","resolvedSchema","allowOptionality","formattedValue","formattedResult","rawValue","prevValue","_value","strict","initialTests","runOptions","fired","tests","panicOnce","arg","nextOnce","count","nestedErrors","parentPath","originalParent","testOptions","_options$disableStack2","reject","parsed","validated","_options$disableStack3","defaultValue","isStrict","nullable","optional","isExclusive","enums","valids","resolved","invalids","strip","c","method","alias","create$7","BooleanSchema","_raw","msg","isoReg","parseIsoDate","struct","parseDateStruct","totalMinutesOffset","_regexResult$7$length","_regexResult$","regexResult","rEmail","rUrl","rUUID","yearMonthDay","hourMinuteSecond","zOrOffset","rIsoDateTime","isTrimmed","objStringTag","create$6","StringSchema","strValue","t","min","max","regex","excludeEmptyString","allowOffset","precision","isNaN$1","create$5","NumberSchema","less","more","_method","avail","invalidDate","isDate","DateSchema","cast","limit","sortFields","excludedEdges","excludes","addNode","depPath","findIndex","ii","_err$path","sortByKeyOrder","parseJson","deepPartial","partial","fieldSchema","nextArray","deepHas","last","unknown","known","defaultSort","create$3","ObjectSchema","_options$stripUnknown","intermediateValue","innerOptions","isChanged","exists","fieldValue","inputValue","fieldSpec","from","recursive","objectErrors","fieldErrors","nextFields","schemaOrRef","dft","_innerOptions","shape","additions","picked","remaining","to","fromGetter","newObj","noAllow","unknownKeys","allow","_innerOptions2"],"mappings":"sKAAA;AAAA;AAAA;AAAA;AAAA,IAQA,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,MAAAK,EAAI,WAAWL,CAAK,EACnB,OAAA,MAAMK,CAAC,EAAIL,EAAQK,CAC9B,CACA,SAASC,GAAaN,EAAO,CAClB,OAAA,OAAOA,GAAU,UAAYA,IAAU,IAClD,CACA,SAASO,GAAOP,EAAO,CACnB,OAAIA,GAAS,KACFA,IAAU,OAAY,qBAAuB,gBAEjD,OAAO,UAAU,SAAS,KAAKA,CAAK,CAC/C,CAEA,SAASQ,GAAcR,EAAO,CAC1B,GAAI,CAACM,GAAaN,CAAK,GAAKO,GAAOP,CAAK,IAAM,kBACnC,MAAA,GAEX,GAAI,OAAO,eAAeA,CAAK,IAAM,KAC1B,MAAA,GAEX,IAAI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