{"version":3,"sources":["webpack:///./node_modules/@vuelidate/core/node_modules/vue-demi/lib/index.mjs","webpack:///./node_modules/@vuelidate/core/dist/index.esm.js"],"names":["isVue3","unwrapObj","obj","ignoreKeys","Object","keys","reduce","o","k","includes","isFunction","val","isProxy","value","callRule","rule","siblingState","instance","call","normalizeValidatorResponse","result","undefined","$valid","createAsyncResult","model","$pending","$dirty","$lazy","$rewardEarly","$response","watchTargets","$lastInvalidState","$lastCommittedOn","$invalid","$pendingCounter","$unwatch","concat","ruleResult","err","Promise","reject","resolve","then","data","catch","error","immediate","deep","createSyncResult","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","arguments","length","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","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"],"mappings":"oKAGIA,GAAS,ECDb,SAASC,EAAUC,EAAKC,EAAa,IACnC,OAAOC,OAAOC,KAAKH,GAAKI,OAAO,CAACC,EAAGC,KAC7BL,EAAWM,SAASD,KACxBD,EAAEC,GAAK,eAAMN,EAAIM,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,YAAyBC,IAAlBD,EAAOE,QAAwBF,EAAOE,QAAUF,EAoBzD,SAASG,EAAkBR,EAAMS,EAAOC,EAAUC,GAAQ,MACxDC,EAAK,aACLC,GACCC,EAAWZ,EAAUa,EAAe,GAAId,EAAce,EAAmBC,GAC1E,MAAMC,EAAW,iBAAMP,EAAOb,OACxBqB,EAAkB,eAAI,GAC5BT,EAASZ,OAAQ,EACjB,MAAMsB,EAAW,eAAM,CAACX,EAAOE,GAAQU,OAAON,EAAcE,GAAmB,KAC7E,GACAL,IAAUD,EAAOb,OAASe,IAAiBG,EAAkBlB,QAAUY,EAASZ,MAC9E,OAGF,IAAIwB,EAEJ,IACEA,EAAavB,EAASC,EAAMS,EAAOR,EAAcC,GACjD,MAAOqB,GAEPD,EAAaE,QAAQC,OAAOF,GAG9BJ,EAAgBrB,QAChBY,EAASZ,QAAUqB,EAAgBrB,MAEnCoB,EAASpB,OAAQ,EACjB0B,QAAQE,QAAQJ,GAAYK,KAAKC,IAC/BT,EAAgBrB,QAChBY,EAASZ,QAAUqB,EAAgBrB,MACnCgB,EAAUhB,MAAQ8B,EAClBV,EAASpB,MAAQM,EAA2BwB,KAC3CC,MAA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D,GAASA,EAAMlD,KAAK2G,EAAMhH,MAAO,IAAIyK,EAAqBzD,EAAMhH,QAAUuD,EAAOF,IACtGgI,EAAkBrL,MAAQ+G,EAAe,CACvC1D,cACA2D,QACAK,eACAvC,eACAoC,eACA9G,SAAUA,EAAS6K,MACnBjG,gBAAiBU,GAAoBtF,EAAS6K,MAAMK,4BAErD,CACDrJ,WAAW,MAGfiF,EAAe6D,EAAiBQ,mBAAqBrE,MAChD,CACL,MAAMsE,EAAyB,eAAMnI,IAAgBtD,EAAQsD,GAAeA,EAC1E,eAASA,GAAe,IAC1B,eAAMmI,EAAwBC,IAC5BJ,EAAkBrL,MAAQ+G,EAAe,CACvC1D,YAAaoI,EACbzE,QACAK,eACAvC,eACAoC,eACA9G,SAAUA,EAAWA,EAAS6K,MAAQ,GACtCjG,gBAAiBU,KAElB,CACDzD,WAAW,IAef,OAXI7B,IAEFmK,EAA8B9G,QAAQa,GAAKA,EAAE+G,EAAmB,CAC9DtB,cACAJ,SACAM,sBAGF,eAAgB,IAAMO,EAAkC/G,QAAQa,GAAKA,EAAEyF,MAGlE,eAAS,IACPxK,OAAO2I,OAAO,GAAI,eAAMmD,EAAkBrL,OAAQqH,EAAarH","file":"js/chunk-2d0b2e68.e0189eb1.js","sourcesContent":["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","import { isReactive, isReadonly, unref, ref, computed, watch, reactive, isRef, nextTick, inject, provide, getCurrentInstance, isVue3, onBeforeMount, onBeforeUnmount } from 'vue-demi';\n\nfunction unwrapObj(obj, ignoreKeys = []) {\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, {\n $lazy,\n $rewardEarly\n}, $response, instance, watchTargets = [], siblingState, $lastInvalidState, $lastCommittedOn) {\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 || $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, {\n $lazy,\n $rewardEarly\n}, $response, instance, siblingState, $lastInvalidState) {\n const $unwatch = () => ({});\n\n const $invalid = computed(() => {\n if ( // return early if $lazy mode and not touched\n $lazy && !$dirty.value || $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(validationsRaw = {}) {\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({\n validations,\n state,\n key,\n parentKey,\n childResults,\n resultsCache,\n globalConfig = {},\n instance,\n externalResults\n}) {\n /**\n * Executes the validators and returns the result.\n * @return {Promise}\n */\n const $validate = _async(function () {\n if (!$dirty.value) $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 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#injectChiildResults');\nconst VuelidateRemoveChildResults = Symbol('vuelidate#removeChiildResults');\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({\n $scope,\n instance\n}) {\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, {\n $registerAs: key,\n $scope: childScope,\n $stopPropagation\n }) {\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, globalConfig = {}) {\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"],"sourceRoot":""}