{"version":3,"sources":["webpack:///./node_modules/@vuelidate/core/dist/index.esm.js","webpack:///./node_modules/vue-demi/lib/index.mjs"],"names":["unwrapObj","obj","ignoreKeys","arguments","length","undefined","Object","keys","reduce","o","k","includes","isFunction","val","isProxy","value","callRule","rule","siblingState","instance","call","normalizeValidatorResponse","result","$valid","createAsyncResult","model","$pending","$dirty","_ref","$response","$lazy","$rewardEarly","watchTargets","$lastInvalidState","$lastCommittedOn","$invalid","$pendingCounter","$unwatch","concat","ruleResult","err","Promise","reject","resolve","then","data","catch","error","immediate","deep","createSyncResult","_ref2","returnValue","createValidatorResult","config","validatorName","propertyKey","propertyPath","$params","$async","$validator","$watchTargets","message","$message","$model","$propertyPath","$property","sortValidations","validationsRaw","validations","validationKeys","rules","nestedValidators","forEach","key","v","startsWith","_empty","ROOT_PATH","_call","body","direct","e","_callIgnored","_invoke","_async","f","args","i","apply","this","createValidationResults","resultsCache","path","externalResults","ruleKeys","cachedResult","get","$partial","$path","$touch","$reset","$commit","ruleKey","$externalResults","map","stringError","index","$uid","r","some","$error","$silentErrors","filter","res","$errors","Date","now","set","collectNestedValidationResults","nestedState","nestedExternalResults","nestedValidationKeys","results","nestedKey","setValidations","state","parentKey","globalConfig","createMetaFields","nestedResults","childResults","allResults","allRes","values","every","modelErrors","nestedErrors","errors","$anyDirty","nr","$validate","mergedConfig","unwatch","assign","s","cachedExternalResults","external","$getResultsForChild","$clearExternalResults","$autoDirty","flush","ResultsStorage","storage","Map","storedRules","storedRulesKeys","newRulesKeys","hasAllValidators","paramKey","storedRuleResultPair","isValidCache","checkRulesValidity","CollectFlag","COLLECT_ALL","COLLECT_NONE","VuelidateInjectChildResults","Symbol","VuelidateRemoveChildResults","nestedValidations","$scope","childResultsRaw","childResultsKeys","injectChildResultsIntoParent","$registerAs","childScope","$stopPropagation","push","removeChildResultsFromParent","childKey","__vuelidateInjectInstances","__vuelidateRemoveInstances","sendValidationResultsToParent","removeValidationResultsFromParent","ComputedProxyFactory","target","Proxy","prop","useVuelidate","currentVueInstance","componentOptions","type","proxy","$options","uid","_uid","validationResults","vuelidateExternalResults","validationsConfig","validationsWatchTarget","newValidationRules","isVue3"],"mappings":"kHAAA,kDAEA,SAASA,EAAUC,GACjB,IAAIC,EAAaC,UAAUC,OAAS,QAAsBC,IAAjBF,UAAU,GAAmBA,UAAU,GAAK,GACrF,OAAOG,OAAOC,KAAKN,GAAKO,OAAO,CAACC,EAAGC,KAC7BR,EAAWS,SAASD,KACxBD,EAAEC,GAAK,eAAMT,EAAIS,KADkBD,GAGlC,IAEL,SAASG,EAAWC,GAClB,MAAsB,oBAARA,EAEhB,SAASC,EAAQC,GACf,OAAO,eAAWA,IAAU,eAAWA,GAkBzC,SAASC,EAASC,EAAMF,EAAOG,EAAcC,GAC3C,OAAOF,EAAKG,KAAKD,EAAU,eAAMJ,GAAQ,eAAMG,GAAeC,GAUhE,SAASE,EAA2BC,GAClC,YAAyBjB,IAAlBiB,EAAOC,QAAwBD,EAAOC,QAAUD,EAoBzD,SAASE,EAAkBP,EAAMQ,EAAOC,EAAUC,EAAQC,EAAMC,EAAWV,GACzE,IAAI,MACFW,EAAK,aACLC,GACEH,EACAI,EAAe7B,UAAUC,OAAS,QAAsBC,IAAjBF,UAAU,GAAmBA,UAAU,GAAK,GACnFe,EAAef,UAAUC,OAAS,EAAID,UAAU,QAAKE,EACrD4B,EAAoB9B,UAAUC,OAAS,EAAID,UAAU,QAAKE,EAC1D6B,EAAmB/B,UAAUC,OAAS,GAAKD,UAAU,SAAME,EAC/D,MAAM8B,EAAW,iBAAMR,EAAOZ,OACxBqB,EAAkB,eAAI,GAC5BV,EAASX,OAAQ,EACjB,MAAMsB,EAAW,eAAM,CAACZ,EAAOE,GAAQW,OAAON,EAAcE,GAAmB,KAC7E,GACAJ,IAAUH,EAAOZ,OACjBgB,IAAiBE,EAAkBlB,QAAUW,EAASX,MACpD,OAGF,IAAIwB,EAEJ,IACEA,EAAavB,EAASC,EAAMQ,EAAOP,EAAcC,GACjD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C1E,+rBAEA,IACI0L,GAAS","file":"js/chunk-778f391e.61c2defd.js","sourcesContent":["import { isReactive, isReadonly, unref, ref, computed, watch, reactive, isRef, nextTick, inject, provide, getCurrentInstance, isVue3, onBeforeMount, onBeforeUnmount } from 'vue-demi';\n\nfunction unwrapObj(obj) {\n let ignoreKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n return Object.keys(obj).reduce((o, k) => {\n if (ignoreKeys.includes(k)) return o;\n o[k] = unref(obj[k]);\n return o;\n }, {});\n}\nfunction isFunction(val) {\n return typeof val === 'function';\n}\nfunction isProxy(value) {\n return isReactive(value) || isReadonly(value);\n}\n\n/**\n * Response form a raw Validator function.\n * Should return a Boolean or an object with $invalid property.\n * @typedef {Boolean | { $valid: Boolean }} ValidatorResponse\n */\n\n/**\n * Calls a validation rule by unwrapping its value first from a ref.\n * @param {Validator} rule\n * @param {Ref} value\n * @param {VueInstance} instance\n * @param {Object} siblingState\n * @return {Promise | ValidatorResponse}\n */\n\nfunction callRule(rule, value, siblingState, instance) {\n return rule.call(instance, unref(value), unref(siblingState), instance);\n}\n/**\n * Normalizes the validator result\n * Allows passing a boolean of an object like `{ $valid: Boolean }`\n * @param {ValidatorResponse} result - Validator result\n * @return {boolean}\n */\n\n\nfunction normalizeValidatorResponse(result) {\n return result.$valid !== undefined ? !result.$valid : !result;\n}\n/**\n * Returns the result of an async validator.\n * @param {Validator} rule\n * @param {Ref<*>} model\n * @param {Ref} $pending\n * @param {Ref} $dirty\n * @param {GlobalConfig} config\n * @param {boolean} config.$lazy\n * @param {Ref<*>} $response\n * @param {VueInstance} instance\n * @param {Ref<*>[]} watchTargets\n * @param {Object} siblingState\n * @param {Ref} $lastInvalidState\n * @param {Ref} $lastCommittedOn\n * @return {{ $invalid: Ref, $unwatch: WatchStopHandle }}\n */\n\n\nfunction createAsyncResult(rule, model, $pending, $dirty, _ref, $response, instance) {\n let {\n $lazy,\n $rewardEarly\n } = _ref;\n let watchTargets = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : [];\n let siblingState = arguments.length > 8 ? arguments[8] : undefined;\n let $lastInvalidState = arguments.length > 9 ? arguments[9] : undefined;\n let $lastCommittedOn = arguments.length > 10 ? arguments[10] : undefined;\n const $invalid = ref(!!$dirty.value);\n const $pendingCounter = ref(0);\n $pending.value = false;\n const $unwatch = watch([model, $dirty].concat(watchTargets, $lastCommittedOn), () => {\n if ( // if $lazy and not dirty, return\n $lazy && !$dirty.value || // if in $rewardEarly mode and no previous errors, nothing pending, return\n $rewardEarly && !$lastInvalidState.value && !$pending.value) {\n return;\n }\n\n let ruleResult; // make sure we dont break if a validator throws\n\n try {\n ruleResult = callRule(rule, model, siblingState, instance);\n } catch (err) {\n // convert to a promise, so we can handle it async\n ruleResult = Promise.reject(err);\n }\n\n $pendingCounter.value++;\n $pending.value = !!$pendingCounter.value; // ensure $invalid is false, while validator is resolving\n\n $invalid.value = false;\n Promise.resolve(ruleResult).then(data => {\n $pendingCounter.value--;\n $pending.value = !!$pendingCounter.value;\n $response.value = data;\n $invalid.value = normalizeValidatorResponse(data);\n }).catch(error => {\n $pendingCounter.value--;\n $pending.value = !!$pendingCounter.value;\n $response.value = error;\n $invalid.value = true;\n });\n }, {\n immediate: true,\n deep: typeof model === 'object'\n });\n return {\n $invalid,\n $unwatch\n };\n}\n/**\n * Returns the result of a sync validator\n * @param {Validator} rule\n * @param {Ref<*>} model\n * @param {Ref} $dirty\n * @param {GlobalConfig} config\n * @param {Boolean} config.$lazy\n * @param {Ref<*>} $response\n * @param {VueInstance} instance\n * @param {Object} siblingState\n * @param {Ref} $lastInvalidState\n * @return {{$unwatch: (function(): {}), $invalid: ComputedRef}}\n */\n\n\nfunction createSyncResult(rule, model, $dirty, _ref2, $response, instance, siblingState, $lastInvalidState) {\n let {\n $lazy,\n $rewardEarly\n } = _ref2;\n\n const $unwatch = () => ({});\n\n const $invalid = computed(() => {\n if ( // return early if $lazy mode and not touched\n $lazy && !$dirty.value || // If $rewardEarly mode is ON and last invalid was false (no error), return it.\n // If we want to invalidate, we just flip the last state to true, causing the computed to run again\n $rewardEarly && !$lastInvalidState.value) {\n return false;\n }\n\n let returnValue = true;\n\n try {\n const result = callRule(rule, model, siblingState, instance);\n $response.value = result;\n returnValue = normalizeValidatorResponse(result);\n } catch (err) {\n $response.value = err;\n }\n\n return returnValue;\n });\n return {\n $unwatch,\n $invalid\n };\n}\n/**\n * Returns the validation result.\n * Detects async and sync validators.\n * @param {NormalizedValidator} rule\n * @param {Ref<*>} model\n * @param {Ref} $dirty\n * @param {GlobalConfig} config - Vuelidate config\n * @param {VueInstance} instance - component instance\n * @param {string} validatorName - name of the current validator\n * @param {string} propertyKey - the current property we are validating\n * @param {string} propertyPath - the deep path to the validated property\n * @param {Object} siblingState\n * @param {Ref} $lastInvalidState - the last invalid state\n * @param {Ref} $lastCommittedOn - the last time $commit was called\n * @return {{ $params: *, $message: Ref, $pending: Ref, $invalid: Ref, $response: Ref<*>, $unwatch: WatchStopHandle }}\n */\n\n\nfunction createValidatorResult(rule, model, $dirty, config, instance, validatorName, propertyKey, propertyPath, siblingState, $lastInvalidState, $lastCommittedOn) {\n const $pending = ref(false);\n const $params = rule.$params || {};\n const $response = ref(null);\n let $invalid;\n let $unwatch;\n\n if (rule.$async) {\n ({\n $invalid,\n $unwatch\n } = createAsyncResult(rule.$validator, model, $pending, $dirty, config, $response, instance, rule.$watchTargets, siblingState, $lastInvalidState, $lastCommittedOn));\n } else {\n ({\n $invalid,\n $unwatch\n } = createSyncResult(rule.$validator, model, $dirty, config, $response, instance, siblingState, $lastInvalidState));\n }\n\n const message = rule.$message;\n const $message = isFunction(message) ? computed(() => message(unwrapObj({\n $pending,\n $invalid,\n $params: unwrapObj($params),\n // $params can hold refs, so we unwrap them for easy access\n $model: model,\n $response,\n $validator: validatorName,\n $propertyPath: propertyPath,\n $property: propertyKey\n }))) : message || '';\n return {\n $message,\n $params,\n $pending,\n $invalid,\n $response,\n $unwatch\n };\n}\n\n/**\n * Sorts a validation definition into rules, configs and nested validators.\n * @param {Object} validationsRaw\n * @return {{ rules: Object, nestedValidators: Object, config: GlobalConfig }}\n */\n\nfunction sortValidations() {\n let validationsRaw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const validations = unref(validationsRaw);\n const validationKeys = Object.keys(validations);\n const rules = {};\n const nestedValidators = {};\n const config = {};\n validationKeys.forEach(key => {\n const v = validations[key];\n\n switch (true) {\n // If it is already normalized, use it\n case isFunction(v.$validator):\n rules[key] = v;\n break;\n // If it is just a function, normalize it first\n // into { $validator: }\n\n case isFunction(v):\n rules[key] = {\n $validator: v\n };\n break;\n // Catch $-prefixed properties as config\n\n case key.startsWith('$'):\n config[key] = v;\n break;\n // If it doesn’t match any of the above,\n // treat as nestedValidators state property\n\n default:\n nestedValidators[key] = v;\n }\n });\n return {\n rules,\n nestedValidators,\n config\n };\n}\n\nfunction _empty() {}\n\nconst ROOT_PATH = '__root';\n/** @typedef {import('vue-demi').ComponentPublicInstance} VueInstance */\n\n/** @typedef {import('vue-demi').ComputedRef} ComputedRef */\n\n/** @typedef {import('vue-demi').UnwrapRef} UnwrapRef */\n\n/** @typedef {import('vue-demi').WatchStopHandle} WatchStopHandle */\n\n/** @typedef {import('vue-demi').WritableComputedRef} WritableComputedRef */\n\n/** @typedef {import('vue-demi').UnwrapNestedRefs} UnwrapNestedRefs */\n\n/**\n * @typedef NormalizedValidator\n * @property {Validator} $validator\n * @property {String | Ref | function(*): string} [$message]\n * @property {Object | Ref} [$params]\n * @property {Object | Ref} [$async]\n * @property {Ref<*>[]} [$watchTargets]\n */\n\n/**\n * Raw validator function, before being normalized\n * Can return a Promise or a {@see ValidatorResponse}\n * @typedef {function(*): ((Promise | ValidatorResponse))} Validator\n */\n\n/**\n * @typedef ErrorObject\n * @property {Ref} $message - Reactive error message\n * @property {Ref} $params - Params passed from withParams\n * @property {Ref} $pending - If validation is pending\n * @property {String} $property - State key\n * @property {String} $propertyPath - Dot notation path to state\n * @property {String} $validator - Validator name\n * @property {String} $uid - Unique identifier\n */\n\n/**\n * @typedef ValidationResult\n * @property {Ref} $pending\n * @property {Ref} $dirty\n * @property {Ref} $invalid\n * @property {Ref} $error\n * @property {Ref} $path\n * @property {Function} $touch\n * @property {Function} $reset\n * @property {ComputedRef} $errors\n * @property {ComputedRef} $silentErrors\n * @property {Function} $commit\n */\n\n/**\n * Creates the main Validation Results object for a state tree\n * Walks the tree's top level branches\n * @param {Object} rules - Rules for the current state tree\n * @param {Object} model - Current state value\n * @param {String} key - Key for the current state tree\n * @param {ResultsStorage} [resultsCache] - A cache map of all the validators\n * @param {String} [path] - the current property path\n * @param {GlobalConfig} [config] - the config object\n * @param {VueInstance} instance\n * @param {ComputedRef} externalResults\n * @param {Object} siblingState\n * @return {ValidationResult | {}}\n */\n\nfunction _call(body, then, direct) {\n if (direct) {\n return then ? then(body()) : body();\n }\n\n try {\n var result = Promise.resolve(body());\n return then ? result.then(then) : result;\n } catch (e) {\n return Promise.reject(e);\n }\n}\n/**\n * Collects the validation results of all nested state properties\n * @param {Object} validations - The validation\n * @param {Object} nestedState - Current state\n * @param {String} path - Path to current property\n * @param {ResultsStorage} resultsCache - Validations cache map\n * @param {GlobalConfig} config - The config object\n * @param {VueInstance} instance - The current Vue instance\n * @param {ComputedRef} nestedExternalResults - The external results for this nested collection\n * @return {Object}\n */\n\n\nfunction _callIgnored(body, direct) {\n return _call(body, _empty, direct);\n}\n\nfunction _invoke(body, then) {\n var result = body();\n\n if (result && result.then) {\n return result.then(then);\n }\n\n return then(result);\n}\n\nfunction _async(f) {\n return function () {\n for (var args = [], i = 0; i < arguments.length; i++) {\n args[i] = arguments[i];\n }\n\n try {\n return Promise.resolve(f.apply(this, args));\n } catch (e) {\n return Promise.reject(e);\n }\n };\n}\n\nfunction createValidationResults(rules, model, key, resultsCache, path, config, instance, externalResults, siblingState) {\n // collect the property keys\n const ruleKeys = Object.keys(rules);\n const cachedResult = resultsCache.get(path, rules);\n const $dirty = ref(false); // state for the $rewardEarly option\n\n /** The last invalid state of this property */\n\n const $lastInvalidState = ref(false);\n /** The last time $commit was called. Used to re-trigger async calls */\n\n const $lastCommittedOn = ref(0);\n\n if (cachedResult) {\n // if the rules are the same as before, use the cached results\n if (!cachedResult.$partial) return cachedResult; // remove old watchers\n\n cachedResult.$unwatch(); // use the `$dirty.value`, so we dont save references by accident\n\n $dirty.value = cachedResult.$dirty.value;\n }\n\n const result = {\n // restore $dirty from cache\n $dirty,\n $path: path,\n $touch: () => {\n if (!$dirty.value) $dirty.value = true;\n },\n $reset: () => {\n if ($dirty.value) $dirty.value = false;\n },\n $commit: () => {}\n };\n /**\n * If there are no validation rules, it is most likely\n * a top level state, aka root\n */\n\n if (!ruleKeys.length) {\n // if there are cached results, we should overwrite them with the new ones\n cachedResult && resultsCache.set(path, rules, result);\n return result;\n }\n\n ruleKeys.forEach(ruleKey => {\n result[ruleKey] = createValidatorResult(rules[ruleKey], model, result.$dirty, config, instance, ruleKey, key, path, siblingState, $lastInvalidState, $lastCommittedOn);\n });\n result.$externalResults = computed(() => {\n if (!externalResults.value) return [];\n return [].concat(externalResults.value).map((stringError, index) => ({\n $propertyPath: path,\n $property: key,\n $validator: '$externalResults',\n $uid: `${path}-externalResult-${index}`,\n $message: stringError,\n $params: {},\n $response: null,\n $pending: false\n }));\n });\n result.$invalid = computed(() => {\n const r = ruleKeys.some(ruleKey => unref(result[ruleKey].$invalid)); // cache the last invalid state\n\n $lastInvalidState.value = r;\n return !!result.$externalResults.value.length || r;\n });\n result.$pending = computed(() => ruleKeys.some(ruleKey => unref(result[ruleKey].$pending)));\n result.$error = computed(() => result.$dirty.value ? result.$pending.value || result.$invalid.value : false);\n result.$silentErrors = computed(() => ruleKeys.filter(ruleKey => unref(result[ruleKey].$invalid)).map(ruleKey => {\n const res = result[ruleKey];\n return reactive({\n $propertyPath: path,\n $property: key,\n $validator: ruleKey,\n $uid: `${path}-${ruleKey}`,\n $message: res.$message,\n $params: res.$params,\n $response: res.$response,\n $pending: res.$pending\n });\n }).concat(result.$externalResults.value));\n result.$errors = computed(() => result.$dirty.value ? result.$silentErrors.value : []);\n\n result.$unwatch = () => ruleKeys.forEach(ruleKey => {\n result[ruleKey].$unwatch();\n });\n\n result.$commit = () => {\n $lastInvalidState.value = true;\n $lastCommittedOn.value = Date.now();\n };\n\n resultsCache.set(path, rules, result);\n return result;\n}\n\nfunction collectNestedValidationResults(validations, nestedState, path, resultsCache, config, instance, nestedExternalResults) {\n const nestedValidationKeys = Object.keys(validations); // if we have no state, return empty object\n\n if (!nestedValidationKeys.length) return {};\n return nestedValidationKeys.reduce((results, nestedKey) => {\n // build validation results for nested state\n results[nestedKey] = setValidations({\n validations: validations[nestedKey],\n state: nestedState,\n key: nestedKey,\n parentKey: path,\n resultsCache,\n globalConfig: config,\n instance,\n externalResults: nestedExternalResults\n });\n return results;\n }, {});\n}\n/**\n * Generates the Meta fields from the results\n * @param {ValidationResult|{}} results\n * @param {Object.} nestedResults\n * @param {Object.} childResults\n * @return {{$anyDirty: Ref, $error: Ref, $invalid: Ref, $errors: Ref, $dirty: Ref, $touch: Function, $reset: Function }}\n */\n\n\nfunction createMetaFields(results, nestedResults, childResults) {\n const allResults = computed(() => [nestedResults, childResults].filter(res => res).reduce((allRes, res) => {\n return allRes.concat(Object.values(unref(res)));\n }, [])); // returns `$dirty` as true, if all children are dirty\n\n const $dirty = computed({\n get() {\n return results.$dirty.value || (allResults.value.length ? allResults.value.every(r => r.$dirty) : false);\n },\n\n set(v) {\n results.$dirty.value = v;\n }\n\n });\n const $silentErrors = computed(() => {\n // current state level errors, fallback to empty array if root\n const modelErrors = unref(results.$silentErrors) || []; // collect all nested and child $silentErrors\n\n const nestedErrors = allResults.value.filter(result => (unref(result).$silentErrors || []).length).reduce((errors, result) => {\n return errors.concat(...result.$silentErrors);\n }, []); // merge the $silentErrors\n\n return modelErrors.concat(nestedErrors);\n });\n const $errors = computed(() => {\n // current state level errors, fallback to empty array if root\n const modelErrors = unref(results.$errors) || []; // collect all nested and child $errors\n\n const nestedErrors = allResults.value.filter(result => (unref(result).$errors || []).length).reduce((errors, result) => {\n return errors.concat(...result.$errors);\n }, []); // merge the $errors\n\n return modelErrors.concat(nestedErrors);\n });\n const $invalid = computed(() => // if any of the nested values is invalid\n allResults.value.some(r => r.$invalid) || // or if the current state is invalid\n unref(results.$invalid) || // fallback to false if is root\n false);\n const $pending = computed(() => // if any of the nested values is pending\n allResults.value.some(r => unref(r.$pending)) || // if any of the current state validators is pending\n unref(results.$pending) || // fallback to false if is root\n false);\n const $anyDirty = computed(() => allResults.value.some(r => r.$dirty) || allResults.value.some(r => r.$anyDirty) || $dirty.value);\n const $error = computed(() => $dirty.value ? $pending.value || $invalid.value : false);\n\n const $touch = () => {\n // call the root $touch\n results.$touch(); // call all nested level $touch\n\n allResults.value.forEach(result => {\n result.$touch();\n });\n };\n\n const $commit = () => {\n // call the root $touch\n results.$commit(); // call all nested level $touch\n\n allResults.value.forEach(result => {\n result.$commit();\n });\n };\n\n const $reset = () => {\n // reset the root $dirty state\n results.$reset(); // reset all the children $dirty states\n\n allResults.value.forEach(result => {\n result.$reset();\n });\n }; // Ensure that if all child and nested results are $dirty, this also becomes $dirty\n\n\n if (allResults.value.length && allResults.value.every(nr => nr.$dirty)) $touch();\n return {\n $dirty,\n $errors,\n $invalid,\n $anyDirty,\n $error,\n $pending,\n $touch,\n $reset,\n $silentErrors,\n $commit\n };\n}\n/**\n * @typedef VuelidateState\n * @property {WritableComputedRef} $model\n * @property {ComputedRef} $dirty\n * @property {ComputedRef} $error\n * @property {ComputedRef} $errors\n * @property {ComputedRef} $invalid\n * @property {ComputedRef} $anyDirty\n * @property {ComputedRef} $pending\n * @property {Function} $touch\n * @property {Function} $reset\n * @property {String} $path\n * @property {ComputedRef} $silentErrors\n * @property {Function} [$validate]\n * @property {Function} [$getResultsForChild]\n * @property {Object.}\n */\n\n/**\n * Main Vuelidate bootstrap function.\n * Used both for Composition API in `setup` and for Global App usage.\n * Used to collect validation state, when walking recursively down the state tree\n * @param {Object} params\n * @param {Object} params.validations\n * @param {Object} params.state\n * @param {String} [params.key] - Current state property key. Used when being called on nested items\n * @param {String} [params.parentKey] - Parent state property key. Used when being called recursively\n * @param {Object} [params.childResults] - Used to collect child results.\n * @param {ResultsStorage} params.resultsCache - The cached validation results\n * @param {VueInstance} params.instance - The current Vue instance\n * @param {GlobalConfig} params.globalConfig - The validation config, passed to this setValidations instance.\n * @param {UnwrapNestedRefs | Ref} params.externalResults - External validation results\n * @return {UnwrapNestedRefs}\n */\n\n\nfunction setValidations(_ref) {\n /**\n * Executes the validators and returns the result.\n * @return {Promise}\n */\n const $validate = _async(function () {\n $touch();\n return _invoke(function () {\n if (mergedConfig.$rewardEarly) {\n $commit(); // await the watchers\n\n return _callIgnored(nextTick);\n }\n }, function () {\n // await the watchers\n return _call(nextTick, function () {\n return new Promise(resolve => {\n // return whether it is valid or not\n if (!$pending.value) return resolve(!$invalid.value);\n const unwatch = watch($pending, () => {\n resolve(!$invalid.value);\n unwatch();\n });\n });\n });\n });\n });\n /**\n * Returns a child component's results, based on registration name\n * @param {string} key\n * @return {VuelidateState}\n */\n\n\n let {\n validations,\n state,\n key,\n parentKey,\n childResults,\n resultsCache,\n globalConfig = {},\n instance,\n externalResults\n } = _ref;\n const path = parentKey ? `${parentKey}.${key}` : key; // Sort out the validation object into:\n // – rules = validators for current state tree fragment\n // — nestedValidators = nested state fragments keys that might contain more validators\n // – config = configuration properties that affect this state fragment\n\n const {\n rules,\n nestedValidators,\n config\n } = sortValidations(validations);\n const mergedConfig = Object.assign({}, globalConfig, config); // create protected state for cases when the state branch does not exist yet.\n // This protects when using the OptionsAPI as the data is bound after the setup method\n\n const nestedState = key ? computed(() => {\n const s = unref(state);\n return s ? unref(s[key]) : undefined;\n }) : state; // cache the external results, so we can revert back to them\n\n const cachedExternalResults = Object.assign({}, unref(externalResults) || {});\n const nestedExternalResults = computed(() => {\n const results = unref(externalResults);\n if (!key) return results;\n return results ? unref(results[key]) : undefined;\n }); // Use rules for the current state fragment and validate it\n\n const results = createValidationResults(rules, nestedState, key, resultsCache, path, mergedConfig, instance, nestedExternalResults, state); // Use nested keys to repeat the process\n // *WARN*: This is recursive\n\n const nestedResults = collectNestedValidationResults(nestedValidators, nestedState, path, resultsCache, mergedConfig, instance, nestedExternalResults); // Collect and merge this level validation results\n // with all nested validation results\n\n const {\n $dirty,\n $errors,\n $invalid,\n $anyDirty,\n $error,\n $pending,\n $touch,\n $reset,\n $silentErrors,\n $commit\n } = createMetaFields(results, nestedResults, childResults);\n /**\n * If we have no `key`, this is the top level state\n * We dont need `$model` there.\n */\n\n const $model = key ? computed({\n get: () => unref(nestedState),\n set: val => {\n $dirty.value = true;\n const s = unref(state);\n const external = unref(externalResults);\n\n if (external) {\n external[key] = cachedExternalResults[key];\n }\n\n if (isRef(s[key])) {\n s[key].value = val;\n } else {\n s[key] = val;\n }\n }\n }) : null;\n\n if (key && mergedConfig.$autoDirty) {\n watch(nestedState, () => {\n if (!$dirty.value) $touch();\n const external = unref(externalResults);\n\n if (external) {\n external[key] = cachedExternalResults[key];\n }\n }, {\n flush: 'sync'\n });\n }\n\n function $getResultsForChild(key) {\n return (childResults.value || {})[key];\n }\n\n function $clearExternalResults() {\n if (isRef(externalResults)) {\n externalResults.value = cachedExternalResults;\n } else {\n // if the external results state was empty, we need to delete every property, one by one\n if (Object.keys(cachedExternalResults).length === 0) {\n Object.keys(externalResults).forEach(k => {\n delete externalResults[k];\n });\n } else {\n // state was not empty, so we just assign it back into the current state\n Object.assign(externalResults, cachedExternalResults);\n }\n }\n }\n\n return reactive(Object.assign({}, results, {\n // NOTE: The order here is very important, since we want to override\n // some of the *results* meta fields with the collective version of it\n // that includes the results of nested state validation results\n $model,\n $dirty,\n $error,\n $errors,\n $invalid,\n $anyDirty,\n $pending,\n $touch,\n $reset,\n $path: path || ROOT_PATH,\n $silentErrors,\n $validate,\n $commit\n }, childResults && {\n $getResultsForChild,\n $clearExternalResults\n }, nestedResults));\n}\n\nclass ResultsStorage {\n constructor() {\n this.storage = new Map();\n }\n /**\n * Stores a validation result, and its rules by its path\n * @param {String} path\n * @param {Object} rules\n * @param {ValidationResult} result\n */\n\n\n set(path, rules, result) {\n this.storage.set(path, {\n rules,\n result\n });\n }\n /**\n * Check if the stored `results` for the provided `path` have the same `rules` compared to 'storedRules'\n * @param {String} path\n * @param {Object} rules\n * @param {Object} storedRules\n * @return {Boolean}\n */\n\n\n checkRulesValidity(path, rules, storedRules) {\n const storedRulesKeys = Object.keys(storedRules);\n const newRulesKeys = Object.keys(rules);\n if (newRulesKeys.length !== storedRulesKeys.length) return false;\n const hasAllValidators = newRulesKeys.every(ruleKey => storedRulesKeys.includes(ruleKey));\n if (!hasAllValidators) return false;\n return newRulesKeys.every(ruleKey => {\n if (!rules[ruleKey].$params) return true;\n return Object.keys(rules[ruleKey].$params).every(paramKey => {\n // make sure to unwrap before comparing\n return unref(storedRules[ruleKey].$params[paramKey]) === unref(rules[ruleKey].$params[paramKey]);\n });\n });\n }\n /**\n * Returns the matched result if catche is valid\n * @param {String} path\n * @param {Object} rules\n * @return {{$partial: boolean, $dirty: Ref, $unwatch: function}|undefined|ValidationResult}\n */\n\n\n get(path, rules) {\n const storedRuleResultPair = this.storage.get(path);\n if (!storedRuleResultPair) return undefined;\n const {\n rules: storedRules,\n result\n } = storedRuleResultPair;\n const isValidCache = this.checkRulesValidity(path, rules, storedRules);\n const $unwatch = result.$unwatch ? result.$unwatch : () => ({});\n if (!isValidCache) return {\n $dirty: result.$dirty,\n $partial: true,\n $unwatch\n };\n return result;\n }\n\n}\n\nconst CollectFlag = {\n COLLECT_ALL: true,\n COLLECT_NONE: false\n};\nconst VuelidateInjectChildResults = Symbol('vuelidate#injectChildResults');\nconst VuelidateRemoveChildResults = Symbol('vuelidate#removeChildResults');\n/**\n * Create helpers to collect validation state from child components\n * @param {Object} params\n * @param {String | Number | Boolean} params.$scope - Parent component scope\n * @return {{sendValidationResultsToParent: function[], childResults: ComputedRef, removeValidationResultsFromParent: function[]}}\n */\n\nfunction nestedValidations(_ref) {\n let {\n $scope,\n instance\n } = _ref;\n const childResultsRaw = {};\n const childResultsKeys = ref([]);\n const childResults = computed(() => childResultsKeys.value.reduce((results, key) => {\n results[key] = unref(childResultsRaw[key]);\n return results;\n }, {}));\n /**\n * Allows children to send validation data up to their parent.\n * @param {Object} results - the results\n * @param {Object} args\n * @param {String} args.$registerAs - the $registeredAs key\n * @param {String | Number | Boolean} args.$scope - the $scope key\n */\n\n function injectChildResultsIntoParent(results, _ref2) {\n let {\n $registerAs: key,\n $scope: childScope,\n $stopPropagation\n } = _ref2;\n if ($stopPropagation || $scope === CollectFlag.COLLECT_NONE || childScope === CollectFlag.COLLECT_NONE || $scope !== CollectFlag.COLLECT_ALL && $scope !== childScope) return;\n childResultsRaw[key] = results;\n childResultsKeys.value.push(key);\n } // combine with other `injectChildResultsIntoParent` from vuelidate instances in this Vue component instance\n\n\n instance.__vuelidateInjectInstances = [].concat(instance.__vuelidateInjectInstances || [], injectChildResultsIntoParent);\n /**\n * Allows children to remove the validation data from their parent, before getting destroyed.\n * @param {String} key - the registeredAs key\n */\n\n function removeChildResultsFromParent(key) {\n // remove the key\n childResultsKeys.value = childResultsKeys.value.filter(childKey => childKey !== key); // remove the stored data for the key\n\n delete childResultsRaw[key];\n } // combine with other `removeChildResultsFromParent` from vuelidate instances in this Vue component instance\n\n\n instance.__vuelidateRemoveInstances = [].concat(instance.__vuelidateRemoveInstances || [], removeChildResultsFromParent); // inject the `injectChildResultsIntoParent` method, into the current scope\n\n const sendValidationResultsToParent = inject(VuelidateInjectChildResults, []); // provide to all of its children the send results to parent function\n\n provide(VuelidateInjectChildResults, instance.__vuelidateInjectInstances);\n const removeValidationResultsFromParent = inject(VuelidateRemoveChildResults, []); // provide to all of its children the remove results function\n\n provide(VuelidateRemoveChildResults, instance.__vuelidateRemoveInstances);\n return {\n childResults,\n sendValidationResultsToParent,\n removeValidationResultsFromParent\n };\n}\n\n/**\n * Helper proxy for instance property access. It makes every reference\n * reactive for the validation function\n * @param target\n * @return {*|ComputedRef<*>}\n */\n\nfunction ComputedProxyFactory(target) {\n return new Proxy(target, {\n get(target, prop) {\n return typeof target[prop] === 'object' ? ComputedProxyFactory(target[prop]) : computed(() => target[prop]);\n }\n\n });\n}\n\n/**\n * @typedef GlobalConfig\n * @property {String} [$registerAs] - Config Object\n * @property {String | Number | Symbol} [$scope] - A scope to limit child component registration\n * @property {Boolean} [$stopPropagation] - Tells a Vue component to stop sending its results up to the parent\n * @property {Ref} [$externalResults] - External error messages, like from server validation.\n * @property {Boolean} [$autoDirty] - Should the form watch for state changed, and automatically set `$dirty` to true.\n * @property {Boolean} [$lazy] - Should the validations be lazy, and run only after they are dirty\n * @property {Boolean} [$rewardEarly] - Once valid, re-runs property validators only on manual calls of $commit\n */\n\n/**\n * Composition API compatible Vuelidate\n * Use inside the `setup` lifecycle hook\n * @param {Object | GlobalConfig} [validations] - Validations Object or the globalConfig.\n * @param {Object} [state] - State object - required if `validations` is a validation object.\n * @param {GlobalConfig} [globalConfig] - Config Object\n * @return {ComputedRef<*>}\n */\n\nfunction useVuelidate(validations, state) {\n let globalConfig = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n // if we pass only one argument, its most probably the globalConfig.\n // This use case is so parents can just collect results of child forms.\n if (arguments.length === 1) {\n globalConfig = validations;\n validations = undefined;\n state = undefined;\n }\n\n let {\n $registerAs,\n $scope = CollectFlag.COLLECT_ALL,\n $stopPropagation,\n $externalResults,\n currentVueInstance\n } = globalConfig;\n const instance = currentVueInstance || getCurrentInstance();\n const componentOptions = instance ? isVue3 ? instance.type : instance.proxy.$options : {}; // if there is no registration name, add one.\n\n if (!$registerAs && instance) {\n // NOTE:\n // ._uid // Vue 2.x Composition-API plugin\n // .uid // Vue 3.0\n const uid = instance.uid || instance._uid;\n $registerAs = `_vuelidate_${uid}`;\n }\n\n const validationResults = ref({});\n const resultsCache = new ResultsStorage();\n const {\n childResults,\n sendValidationResultsToParent,\n removeValidationResultsFromParent\n } = instance ? nestedValidations({\n $scope,\n instance\n }) : {\n childResults: ref({})\n }; // Options API\n\n if (!validations && componentOptions.validations) {\n const rules = componentOptions.validations;\n state = ref({});\n onBeforeMount(() => {\n // Delay binding state to validations defined with the Options API until mounting, when the data\n // has been attached to the component instance. From that point on it will be reactive.\n state.value = instance.proxy;\n watch(() => isFunction(rules) ? rules.call(state.value, new ComputedProxyFactory(state.value)) : rules, validations => {\n validationResults.value = setValidations({\n validations,\n state,\n childResults,\n resultsCache,\n globalConfig,\n instance: instance.proxy,\n externalResults: $externalResults || instance.proxy.vuelidateExternalResults\n });\n }, {\n immediate: true\n });\n });\n globalConfig = componentOptions.validationsConfig || globalConfig;\n } else {\n const validationsWatchTarget = isRef(validations) || isProxy(validations) ? validations // wrap plain objects in a reactive, so we can track changes if they have computed in them.\n : reactive(validations || {});\n watch(validationsWatchTarget, newValidationRules => {\n validationResults.value = setValidations({\n validations: newValidationRules,\n state,\n childResults,\n resultsCache,\n globalConfig,\n instance: instance ? instance.proxy : {},\n externalResults: $externalResults\n });\n }, {\n immediate: true\n });\n }\n\n if (instance) {\n // send all the data to the parent when the function is invoked inside setup.\n sendValidationResultsToParent.forEach(f => f(validationResults, {\n $registerAs,\n $scope,\n $stopPropagation\n })); // before this component is destroyed, remove all the data from the parent.\n\n onBeforeUnmount(() => removeValidationResultsFromParent.forEach(f => f($registerAs)));\n }\n\n return computed(() => {\n return Object.assign({}, unref(validationResults.value), childResults.value);\n });\n}\n\nexport { CollectFlag, useVuelidate as default, useVuelidate };\n","import * as Vue from 'vue'\n\nvar isVue2 = false\nvar isVue3 = true\nvar Vue2 = undefined\n\nfunction install() {}\n\nexport function set(target, key, val) {\n if (Array.isArray(target)) {\n target.length = Math.max(target.length, key)\n target.splice(key, 1, val)\n return val\n }\n target[key] = val\n return val\n}\n\nexport function del(target, key) {\n if (Array.isArray(target)) {\n target.splice(key, 1)\n return\n }\n delete target[key]\n}\n\nexport * from 'vue'\nexport {\n Vue,\n Vue2,\n isVue2,\n isVue3,\n install,\n}\n"],"sourceRoot":""}