How to use transformVNodeArgs method in Playwright Internal

Best JavaScript code snippet using playwright-internal

resources_js_views_Registration_vue.js

Source:resources_js_views_Registration_vue.js Github

copy

Full Screen

1"use strict";2(self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_views_Registration_vue"],{3/***/ "./node_modules/@vuelidate/core/dist/index.esm.js":4/*!********************************************************!*\5 !*** ./node_modules/@vuelidate/core/dist/index.esm.js ***!6 \********************************************************/7/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {8__webpack_require__.r(__webpack_exports__);9/* harmony export */ __webpack_require__.d(__webpack_exports__, {10/* harmony export */ "CollectFlag": () => (/* binding */ CollectFlag),11/* harmony export */ "default": () => (/* binding */ useVuelidate),12/* harmony export */ "useVuelidate": () => (/* binding */ useVuelidate)13/* harmony export */ });14/* harmony import */ var vue_demi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue-demi */ "./node_modules/vue-demi/lib/index.mjs");15function unwrapObj(obj) {16 let ignoreKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];17 return Object.keys(obj).reduce((o, k) => {18 if (ignoreKeys.includes(k)) return o;19 o[k] = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(obj[k]);20 return o;21 }, {});22}23function isFunction(val) {24 return typeof val === 'function';25}26function isProxy(value) {27 return (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.isReactive)(value) || (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.isReadonly)(value);28}29/**30 * Response form a raw Validator function.31 * Should return a Boolean or an object with $invalid property.32 * @typedef {Boolean | { $valid: Boolean }} ValidatorResponse33 */34/**35 * Calls a validation rule by unwrapping its value first from a ref.36 * @param {Validator} rule37 * @param {Ref} value38 * @param {VueInstance} instance39 * @param {Object} siblingState40 * @return {Promise<ValidatorResponse> | ValidatorResponse}41 */42function callRule(rule, value, siblingState, instance) {43 return rule.call(instance, (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(value), (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(siblingState), instance);44}45/**46 * Normalizes the validator result47 * Allows passing a boolean of an object like `{ $valid: Boolean }`48 * @param {ValidatorResponse} result - Validator result49 * @return {boolean}50 */51function normalizeValidatorResponse(result) {52 return result.$valid !== undefined ? !result.$valid : !result;53}54/**55 * Returns the result of an async validator.56 * @param {Validator} rule57 * @param {Ref<*>} model58 * @param {Ref<Boolean>} $pending59 * @param {Ref<Boolean>} $dirty60 * @param {GlobalConfig} config61 * @param {boolean} config.$lazy62 * @param {Ref<*>} $response63 * @param {VueInstance} instance64 * @param {Ref<*>[]} watchTargets65 * @param {Object} siblingState66 * @param {Ref<Boolean>} $lastInvalidState67 * @param {Ref<Number>} $lastCommittedOn68 * @return {{ $invalid: Ref<Boolean>, $unwatch: WatchStopHandle }}69 */70function createAsyncResult(rule, model, $pending, $dirty, _ref, $response, instance) {71 let {72 $lazy,73 $rewardEarly74 } = _ref;75 let watchTargets = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : [];76 let siblingState = arguments.length > 8 ? arguments[8] : undefined;77 let $lastInvalidState = arguments.length > 9 ? arguments[9] : undefined;78 let $lastCommittedOn = arguments.length > 10 ? arguments[10] : undefined;79 const $invalid = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.ref)(!!$dirty.value);80 const $pendingCounter = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.ref)(0);81 $pending.value = false;82 const $unwatch = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.watch)([model, $dirty].concat(watchTargets, $lastCommittedOn), () => {83 if ( // if $lazy and not dirty, return84 $lazy && !$dirty.value || // if in $rewardEarly mode and no previous errors, nothing pending, return85 $rewardEarly && !$lastInvalidState.value && !$pending.value) {86 return;87 }88 let ruleResult; // make sure we dont break if a validator throws89 try {90 ruleResult = callRule(rule, model, siblingState, instance);91 } catch (err) {92 // convert to a promise, so we can handle it async93 ruleResult = Promise.reject(err);94 }95 $pendingCounter.value++;96 $pending.value = !!$pendingCounter.value; // ensure $invalid is false, while validator is resolving97 $invalid.value = false;98 Promise.resolve(ruleResult).then(data => {99 $pendingCounter.value--;100 $pending.value = !!$pendingCounter.value;101 $response.value = data;102 $invalid.value = normalizeValidatorResponse(data);103 }).catch(error => {104 $pendingCounter.value--;105 $pending.value = !!$pendingCounter.value;106 $response.value = error;107 $invalid.value = true;108 });109 }, {110 immediate: true,111 deep: typeof model === 'object'112 });113 return {114 $invalid,115 $unwatch116 };117}118/**119 * Returns the result of a sync validator120 * @param {Validator} rule121 * @param {Ref<*>} model122 * @param {Ref<Boolean>} $dirty123 * @param {GlobalConfig} config124 * @param {Boolean} config.$lazy125 * @param {Ref<*>} $response126 * @param {VueInstance} instance127 * @param {Object} siblingState128 * @param {Ref<Boolean>} $lastInvalidState129 * @return {{$unwatch: (function(): {}), $invalid: ComputedRef<boolean>}}130 */131function createSyncResult(rule, model, $dirty, _ref2, $response, instance, siblingState, $lastInvalidState) {132 let {133 $lazy,134 $rewardEarly135 } = _ref2;136 const $unwatch = () => ({});137 const $invalid = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => {138 if ( // return early if $lazy mode and not touched139 $lazy && !$dirty.value || // If $rewardEarly mode is ON and last invalid was false (no error), return it.140 // If we want to invalidate, we just flip the last state to true, causing the computed to run again141 $rewardEarly && !$lastInvalidState.value) {142 return false;143 }144 let returnValue = true;145 try {146 const result = callRule(rule, model, siblingState, instance);147 $response.value = result;148 returnValue = normalizeValidatorResponse(result);149 } catch (err) {150 $response.value = err;151 }152 return returnValue;153 });154 return {155 $unwatch,156 $invalid157 };158}159/**160 * Returns the validation result.161 * Detects async and sync validators.162 * @param {NormalizedValidator} rule163 * @param {Ref<*>} model164 * @param {Ref<boolean>} $dirty165 * @param {GlobalConfig} config - Vuelidate config166 * @param {VueInstance} instance - component instance167 * @param {string} validatorName - name of the current validator168 * @param {string} propertyKey - the current property we are validating169 * @param {string} propertyPath - the deep path to the validated property170 * @param {Object} siblingState171 * @param {Ref<Boolean>} $lastInvalidState - the last invalid state172 * @param {Ref<Number>} $lastCommittedOn - the last time $commit was called173 * @return {{ $params: *, $message: Ref<String>, $pending: Ref<Boolean>, $invalid: Ref<Boolean>, $response: Ref<*>, $unwatch: WatchStopHandle }}174 */175function createValidatorResult(rule, model, $dirty, config, instance, validatorName, propertyKey, propertyPath, siblingState, $lastInvalidState, $lastCommittedOn) {176 const $pending = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.ref)(false);177 const $params = rule.$params || {};178 const $response = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.ref)(null);179 let $invalid;180 let $unwatch;181 if (rule.$async) {182 ({183 $invalid,184 $unwatch185 } = createAsyncResult(rule.$validator, model, $pending, $dirty, config, $response, instance, rule.$watchTargets, siblingState, $lastInvalidState, $lastCommittedOn));186 } else {187 ({188 $invalid,189 $unwatch190 } = createSyncResult(rule.$validator, model, $dirty, config, $response, instance, siblingState, $lastInvalidState));191 }192 const message = rule.$message;193 const $message = isFunction(message) ? (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => message(unwrapObj({194 $pending,195 $invalid,196 $params: unwrapObj($params),197 // $params can hold refs, so we unwrap them for easy access198 $model: model,199 $response,200 $validator: validatorName,201 $propertyPath: propertyPath,202 $property: propertyKey203 }))) : message || '';204 return {205 $message,206 $params,207 $pending,208 $invalid,209 $response,210 $unwatch211 };212}213/**214 * Sorts a validation definition into rules, configs and nested validators.215 * @param {Object<NormalizedValidator|Function>} validationsRaw216 * @return {{ rules: Object<NormalizedValidator>, nestedValidators: Object, config: GlobalConfig }}217 */218function sortValidations() {219 let validationsRaw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};220 const validations = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(validationsRaw);221 const validationKeys = Object.keys(validations);222 const rules = {};223 const nestedValidators = {};224 const config = {};225 validationKeys.forEach(key => {226 const v = validations[key];227 switch (true) {228 // If it is already normalized, use it229 case isFunction(v.$validator):230 rules[key] = v;231 break;232 // If it is just a function, normalize it first233 // into { $validator: <Fun> }234 case isFunction(v):235 rules[key] = {236 $validator: v237 };238 break;239 // Catch $-prefixed properties as config240 case key.startsWith('$'):241 config[key] = v;242 break;243 // If it doesn’t match any of the above,244 // treat as nestedValidators state property245 default:246 nestedValidators[key] = v;247 }248 });249 return {250 rules,251 nestedValidators,252 config253 };254}255function _empty() {}256const ROOT_PATH = '__root';257/** @typedef {import('vue-demi').ComponentPublicInstance} VueInstance */258/** @typedef {import('vue-demi').ComputedRef} ComputedRef */259/** @typedef {import('vue-demi').UnwrapRef} UnwrapRef */260/** @typedef {import('vue-demi').WatchStopHandle} WatchStopHandle */261/** @typedef {import('vue-demi').WritableComputedRef} WritableComputedRef */262/** @typedef {import('vue-demi').UnwrapNestedRefs} UnwrapNestedRefs */263/**264 * @typedef NormalizedValidator265 * @property {Validator} $validator266 * @property {String | Ref<String> | function(*): string} [$message]267 * @property {Object | Ref<Object>} [$params]268 * @property {Object | Ref<Object>} [$async]269 * @property {Ref<*>[]} [$watchTargets]270 */271/**272 * Raw validator function, before being normalized273 * Can return a Promise or a {@see ValidatorResponse}274 * @typedef {function(*): ((Promise<ValidatorResponse> | ValidatorResponse))} Validator275 */276/**277 * @typedef ErrorObject278 * @property {Ref<String>} $message - Reactive error message279 * @property {Ref<Object>} $params - Params passed from withParams280 * @property {Ref<Boolean>} $pending - If validation is pending281 * @property {String} $property - State key282 * @property {String} $propertyPath - Dot notation path to state283 * @property {String} $validator - Validator name284 * @property {String} $uid - Unique identifier285 */286/**287 * @typedef ValidationResult288 * @property {Ref<Boolean>} $pending289 * @property {Ref<Boolean>} $dirty290 * @property {Ref<Boolean>} $invalid291 * @property {Ref<Boolean>} $error292 * @property {Ref<String>} $path293 * @property {Function} $touch294 * @property {Function} $reset295 * @property {ComputedRef<ErrorObject[]>} $errors296 * @property {ComputedRef<ErrorObject[]>} $silentErrors297 * @property {Function} $commit298 */299/**300 * Creates the main Validation Results object for a state tree301 * Walks the tree's top level branches302 * @param {Object<NormalizedValidator>} rules - Rules for the current state tree303 * @param {Object} model - Current state value304 * @param {String} key - Key for the current state tree305 * @param {ResultsStorage} [resultsCache] - A cache map of all the validators306 * @param {String} [path] - the current property path307 * @param {GlobalConfig} [config] - the config object308 * @param {VueInstance} instance309 * @param {ComputedRef<Object>} externalResults310 * @param {Object} siblingState311 * @return {ValidationResult | {}}312 */313function _call(body, then, direct) {314 if (direct) {315 return then ? then(body()) : body();316 }317 try {318 var result = Promise.resolve(body());319 return then ? result.then(then) : result;320 } catch (e) {321 return Promise.reject(e);322 }323}324/**325 * Collects the validation results of all nested state properties326 * @param {Object<NormalizedValidator|Function>} validations - The validation327 * @param {Object} nestedState - Current state328 * @param {String} path - Path to current property329 * @param {ResultsStorage} resultsCache - Validations cache map330 * @param {GlobalConfig} config - The config object331 * @param {VueInstance} instance - The current Vue instance332 * @param {ComputedRef<object>} nestedExternalResults - The external results for this nested collection333 * @return {Object<string, VuelidateState>}334 */335function _callIgnored(body, direct) {336 return _call(body, _empty, direct);337}338function _invoke(body, then) {339 var result = body();340 if (result && result.then) {341 return result.then(then);342 }343 return then(result);344}345function _async(f) {346 return function () {347 for (var args = [], i = 0; i < arguments.length; i++) {348 args[i] = arguments[i];349 }350 try {351 return Promise.resolve(f.apply(this, args));352 } catch (e) {353 return Promise.reject(e);354 }355 };356}357function createValidationResults(rules, model, key, resultsCache, path, config, instance, externalResults, siblingState) {358 // collect the property keys359 const ruleKeys = Object.keys(rules);360 const cachedResult = resultsCache.get(path, rules);361 const $dirty = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.ref)(false); // state for the $rewardEarly option362 /** The last invalid state of this property */363 const $lastInvalidState = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.ref)(false);364 /** The last time $commit was called. Used to re-trigger async calls */365 const $lastCommittedOn = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.ref)(0);366 if (cachedResult) {367 // if the rules are the same as before, use the cached results368 if (!cachedResult.$partial) return cachedResult; // remove old watchers369 cachedResult.$unwatch(); // use the `$dirty.value`, so we dont save references by accident370 $dirty.value = cachedResult.$dirty.value;371 }372 const result = {373 // restore $dirty from cache374 $dirty,375 $path: path,376 $touch: () => {377 if (!$dirty.value) $dirty.value = true;378 },379 $reset: () => {380 if ($dirty.value) $dirty.value = false;381 },382 $commit: () => {}383 };384 /**385 * If there are no validation rules, it is most likely386 * a top level state, aka root387 */388 if (!ruleKeys.length) {389 // if there are cached results, we should overwrite them with the new ones390 cachedResult && resultsCache.set(path, rules, result);391 return result;392 }393 ruleKeys.forEach(ruleKey => {394 result[ruleKey] = createValidatorResult(rules[ruleKey], model, result.$dirty, config, instance, ruleKey, key, path, siblingState, $lastInvalidState, $lastCommittedOn);395 });396 result.$externalResults = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => {397 if (!externalResults.value) return [];398 return [].concat(externalResults.value).map((stringError, index) => ({399 $propertyPath: path,400 $property: key,401 $validator: '$externalResults',402 $uid: `${path}-externalResult-${index}`,403 $message: stringError,404 $params: {},405 $response: null,406 $pending: false407 }));408 });409 result.$invalid = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => {410 const r = ruleKeys.some(ruleKey => (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(result[ruleKey].$invalid)); // cache the last invalid state411 $lastInvalidState.value = r;412 return !!result.$externalResults.value.length || r;413 });414 result.$pending = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => ruleKeys.some(ruleKey => (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(result[ruleKey].$pending)));415 result.$error = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => result.$dirty.value ? result.$pending.value || result.$invalid.value : false);416 result.$silentErrors = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => ruleKeys.filter(ruleKey => (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(result[ruleKey].$invalid)).map(ruleKey => {417 const res = result[ruleKey];418 return (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.reactive)({419 $propertyPath: path,420 $property: key,421 $validator: ruleKey,422 $uid: `${path}-${ruleKey}`,423 $message: res.$message,424 $params: res.$params,425 $response: res.$response,426 $pending: res.$pending427 });428 }).concat(result.$externalResults.value));429 result.$errors = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => result.$dirty.value ? result.$silentErrors.value : []);430 result.$unwatch = () => ruleKeys.forEach(ruleKey => {431 result[ruleKey].$unwatch();432 });433 result.$commit = () => {434 $lastInvalidState.value = true;435 $lastCommittedOn.value = Date.now();436 };437 resultsCache.set(path, rules, result);438 return result;439}440function collectNestedValidationResults(validations, nestedState, path, resultsCache, config, instance, nestedExternalResults) {441 const nestedValidationKeys = Object.keys(validations); // if we have no state, return empty object442 if (!nestedValidationKeys.length) return {};443 return nestedValidationKeys.reduce((results, nestedKey) => {444 // build validation results for nested state445 results[nestedKey] = setValidations({446 validations: validations[nestedKey],447 state: nestedState,448 key: nestedKey,449 parentKey: path,450 resultsCache,451 globalConfig: config,452 instance,453 externalResults: nestedExternalResults454 });455 return results;456 }, {});457}458/**459 * Generates the Meta fields from the results460 * @param {ValidationResult|{}} results461 * @param {Object.<string, VuelidateState>} nestedResults462 * @param {Object.<string, ValidationResult>} childResults463 * @return {{$anyDirty: Ref<Boolean>, $error: Ref<Boolean>, $invalid: Ref<Boolean>, $errors: Ref<ErrorObject[]>, $dirty: Ref<Boolean>, $touch: Function, $reset: Function }}464 */465function createMetaFields(results, nestedResults, childResults) {466 const allResults = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => [nestedResults, childResults].filter(res => res).reduce((allRes, res) => {467 return allRes.concat(Object.values((0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(res)));468 }, [])); // returns `$dirty` as true, if all children are dirty469 const $dirty = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)({470 get() {471 return results.$dirty.value || (allResults.value.length ? allResults.value.every(r => r.$dirty) : false);472 },473 set(v) {474 results.$dirty.value = v;475 }476 });477 const $silentErrors = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => {478 // current state level errors, fallback to empty array if root479 const modelErrors = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(results.$silentErrors) || []; // collect all nested and child $silentErrors480 const nestedErrors = allResults.value.filter(result => ((0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(result).$silentErrors || []).length).reduce((errors, result) => {481 return errors.concat(...result.$silentErrors);482 }, []); // merge the $silentErrors483 return modelErrors.concat(nestedErrors);484 });485 const $errors = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => {486 // current state level errors, fallback to empty array if root487 const modelErrors = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(results.$errors) || []; // collect all nested and child $errors488 const nestedErrors = allResults.value.filter(result => ((0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(result).$errors || []).length).reduce((errors, result) => {489 return errors.concat(...result.$errors);490 }, []); // merge the $errors491 return modelErrors.concat(nestedErrors);492 });493 const $invalid = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => // if any of the nested values is invalid494 allResults.value.some(r => r.$invalid) || // or if the current state is invalid495 (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(results.$invalid) || // fallback to false if is root496 false);497 const $pending = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => // if any of the nested values is pending498 allResults.value.some(r => (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(r.$pending)) || // if any of the current state validators is pending499 (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(results.$pending) || // fallback to false if is root500 false);501 const $anyDirty = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => allResults.value.some(r => r.$dirty) || allResults.value.some(r => r.$anyDirty) || $dirty.value);502 const $error = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => $dirty.value ? $pending.value || $invalid.value : false);503 const $touch = () => {504 // call the root $touch505 results.$touch(); // call all nested level $touch506 allResults.value.forEach(result => {507 result.$touch();508 });509 };510 const $commit = () => {511 // call the root $touch512 results.$commit(); // call all nested level $touch513 allResults.value.forEach(result => {514 result.$commit();515 });516 };517 const $reset = () => {518 // reset the root $dirty state519 results.$reset(); // reset all the children $dirty states520 allResults.value.forEach(result => {521 result.$reset();522 });523 }; // Ensure that if all child and nested results are $dirty, this also becomes $dirty524 if (allResults.value.length && allResults.value.every(nr => nr.$dirty)) $touch();525 return {526 $dirty,527 $errors,528 $invalid,529 $anyDirty,530 $error,531 $pending,532 $touch,533 $reset,534 $silentErrors,535 $commit536 };537}538/**539 * @typedef VuelidateState540 * @property {WritableComputedRef<any>} $model541 * @property {ComputedRef<Boolean>} $dirty542 * @property {ComputedRef<Boolean>} $error543 * @property {ComputedRef<ErrorObject[]>} $errors544 * @property {ComputedRef<Boolean>} $invalid545 * @property {ComputedRef<Boolean>} $anyDirty546 * @property {ComputedRef<Boolean>} $pending547 * @property {Function} $touch548 * @property {Function} $reset549 * @property {String} $path550 * @property {ComputedRef<ErrorObject[]>} $silentErrors551 * @property {Function} [$validate]552 * @property {Function} [$getResultsForChild]553 * @property {Object.<string, VuelidateState>}554 */555/**556 * Main Vuelidate bootstrap function.557 * Used both for Composition API in `setup` and for Global App usage.558 * Used to collect validation state, when walking recursively down the state tree559 * @param {Object} params560 * @param {Object<NormalizedValidator|Function>} params.validations561 * @param {Object} params.state562 * @param {String} [params.key] - Current state property key. Used when being called on nested items563 * @param {String} [params.parentKey] - Parent state property key. Used when being called recursively564 * @param {Object<string, ValidationResult>} [params.childResults] - Used to collect child results.565 * @param {ResultsStorage} params.resultsCache - The cached validation results566 * @param {VueInstance} params.instance - The current Vue instance567 * @param {GlobalConfig} params.globalConfig - The validation config, passed to this setValidations instance.568 * @param {UnwrapNestedRefs<object> | Ref<Object>} params.externalResults - External validation results569 * @return {UnwrapNestedRefs<VuelidateState>}570 */571function setValidations(_ref) {572 /**573 * Executes the validators and returns the result.574 * @return {Promise<boolean>}575 */576 const $validate = _async(function () {577 if (!$dirty.value) $touch();578 return _invoke(function () {579 if (mergedConfig.$rewardEarly) {580 $commit(); // await the watchers581 return _callIgnored(vue_demi__WEBPACK_IMPORTED_MODULE_0__.nextTick);582 }583 }, function () {584 // await the watchers585 return _call(vue_demi__WEBPACK_IMPORTED_MODULE_0__.nextTick, function () {586 return new Promise(resolve => {587 // return whether it is valid or not588 if (!$pending.value) return resolve(!$invalid.value);589 const unwatch = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.watch)($pending, () => {590 resolve(!$invalid.value);591 unwatch();592 });593 });594 });595 });596 });597 /**598 * Returns a child component's results, based on registration name599 * @param {string} key600 * @return {VuelidateState}601 */602 let {603 validations,604 state,605 key,606 parentKey,607 childResults,608 resultsCache,609 globalConfig = {},610 instance,611 externalResults612 } = _ref;613 const path = parentKey ? `${parentKey}.${key}` : key; // Sort out the validation object into:614 // – rules = validators for current state tree fragment615 // — nestedValidators = nested state fragments keys that might contain more validators616 // – config = configuration properties that affect this state fragment617 const {618 rules,619 nestedValidators,620 config621 } = sortValidations(validations);622 const mergedConfig = Object.assign({}, globalConfig, config); // create protected state for cases when the state branch does not exist yet.623 // This protects when using the OptionsAPI as the data is bound after the setup method624 const nestedState = key ? (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => {625 const s = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(state);626 return s ? (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(s[key]) : undefined;627 }) : state; // cache the external results, so we can revert back to them628 const cachedExternalResults = Object.assign({}, (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(externalResults) || {});629 const nestedExternalResults = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => {630 const results = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(externalResults);631 if (!key) return results;632 return results ? (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(results[key]) : undefined;633 }); // Use rules for the current state fragment and validate it634 const results = createValidationResults(rules, nestedState, key, resultsCache, path, mergedConfig, instance, nestedExternalResults, state); // Use nested keys to repeat the process635 // *WARN*: This is recursive636 const nestedResults = collectNestedValidationResults(nestedValidators, nestedState, path, resultsCache, mergedConfig, instance, nestedExternalResults); // Collect and merge this level validation results637 // with all nested validation results638 const {639 $dirty,640 $errors,641 $invalid,642 $anyDirty,643 $error,644 $pending,645 $touch,646 $reset,647 $silentErrors,648 $commit649 } = createMetaFields(results, nestedResults, childResults);650 /**651 * If we have no `key`, this is the top level state652 * We dont need `$model` there.653 */654 const $model = key ? (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)({655 get: () => (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(nestedState),656 set: val => {657 $dirty.value = true;658 const s = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(state);659 const external = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(externalResults);660 if (external) {661 external[key] = cachedExternalResults[key];662 }663 if ((0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.isRef)(s[key])) {664 s[key].value = val;665 } else {666 s[key] = val;667 }668 }669 }) : null;670 if (key && mergedConfig.$autoDirty) {671 (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.watch)(nestedState, () => {672 if (!$dirty.value) $touch();673 const external = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(externalResults);674 if (external) {675 external[key] = cachedExternalResults[key];676 }677 }, {678 flush: 'sync'679 });680 }681 function $getResultsForChild(key) {682 return (childResults.value || {})[key];683 }684 function $clearExternalResults() {685 if ((0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.isRef)(externalResults)) {686 externalResults.value = cachedExternalResults;687 } else {688 // if the external results state was empty, we need to delete every property, one by one689 if (Object.keys(cachedExternalResults).length === 0) {690 Object.keys(externalResults).forEach(k => {691 delete externalResults[k];692 });693 } else {694 // state was not empty, so we just assign it back into the current state695 Object.assign(externalResults, cachedExternalResults);696 }697 }698 }699 return (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.reactive)(Object.assign({}, results, {700 // NOTE: The order here is very important, since we want to override701 // some of the *results* meta fields with the collective version of it702 // that includes the results of nested state validation results703 $model,704 $dirty,705 $error,706 $errors,707 $invalid,708 $anyDirty,709 $pending,710 $touch,711 $reset,712 $path: path || ROOT_PATH,713 $silentErrors,714 $validate,715 $commit716 }, childResults && {717 $getResultsForChild,718 $clearExternalResults719 }, nestedResults));720}721class ResultsStorage {722 constructor() {723 this.storage = new Map();724 }725 /**726 * Stores a validation result, and its rules by its path727 * @param {String} path728 * @param {Object<NormalizedValidator>} rules729 * @param {ValidationResult} result730 */731 set(path, rules, result) {732 this.storage.set(path, {733 rules,734 result735 });736 }737 /**738 * Check if the stored `results` for the provided `path` have the same `rules` compared to 'storedRules'739 * @param {String} path740 * @param {Object<NormalizedValidator>} rules741 * @param {Object<NormalizedValidator>} storedRules742 * @return {Boolean}743 */744 checkRulesValidity(path, rules, storedRules) {745 const storedRulesKeys = Object.keys(storedRules);746 const newRulesKeys = Object.keys(rules);747 if (newRulesKeys.length !== storedRulesKeys.length) return false;748 const hasAllValidators = newRulesKeys.every(ruleKey => storedRulesKeys.includes(ruleKey));749 if (!hasAllValidators) return false;750 return newRulesKeys.every(ruleKey => {751 if (!rules[ruleKey].$params) return true;752 return Object.keys(rules[ruleKey].$params).every(paramKey => {753 // make sure to unwrap before comparing754 return (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(storedRules[ruleKey].$params[paramKey]) === (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(rules[ruleKey].$params[paramKey]);755 });756 });757 }758 /**759 * Returns the matched result if catche is valid760 * @param {String} path761 * @param {Object<NormalizedValidator>} rules762 * @return {{$partial: boolean, $dirty: Ref<Boolean>, $unwatch: function}|undefined|ValidationResult}763 */764 get(path, rules) {765 const storedRuleResultPair = this.storage.get(path);766 if (!storedRuleResultPair) return undefined;767 const {768 rules: storedRules,769 result770 } = storedRuleResultPair;771 const isValidCache = this.checkRulesValidity(path, rules, storedRules);772 const $unwatch = result.$unwatch ? result.$unwatch : () => ({});773 if (!isValidCache) return {774 $dirty: result.$dirty,775 $partial: true,776 $unwatch777 };778 return result;779 }780}781const CollectFlag = {782 COLLECT_ALL: true,783 COLLECT_NONE: false784};785const VuelidateInjectChildResults = Symbol('vuelidate#injectChiildResults');786const VuelidateRemoveChildResults = Symbol('vuelidate#removeChiildResults');787/**788 * Create helpers to collect validation state from child components789 * @param {Object} params790 * @param {String | Number | Boolean} params.$scope - Parent component scope791 * @return {{sendValidationResultsToParent: function[], childResults: ComputedRef<Object>, removeValidationResultsFromParent: function[]}}792 */793function nestedValidations(_ref) {794 let {795 $scope,796 instance797 } = _ref;798 const childResultsRaw = {};799 const childResultsKeys = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.ref)([]);800 const childResults = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => childResultsKeys.value.reduce((results, key) => {801 results[key] = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(childResultsRaw[key]);802 return results;803 }, {}));804 /**805 * Allows children to send validation data up to their parent.806 * @param {Object} results - the results807 * @param {Object} args808 * @param {String} args.$registerAs - the $registeredAs key809 * @param {String | Number | Boolean} args.$scope - the $scope key810 */811 function injectChildResultsIntoParent(results, _ref2) {812 let {813 $registerAs: key,814 $scope: childScope,815 $stopPropagation816 } = _ref2;817 if ($stopPropagation || $scope === CollectFlag.COLLECT_NONE || childScope === CollectFlag.COLLECT_NONE || $scope !== CollectFlag.COLLECT_ALL && $scope !== childScope) return;818 childResultsRaw[key] = results;819 childResultsKeys.value.push(key);820 } // combine with other `injectChildResultsIntoParent` from vuelidate instances in this Vue component instance821 instance.__vuelidateInjectInstances = [].concat(instance.__vuelidateInjectInstances || [], injectChildResultsIntoParent);822 /**823 * Allows children to remove the validation data from their parent, before getting destroyed.824 * @param {String} key - the registeredAs key825 */826 function removeChildResultsFromParent(key) {827 // remove the key828 childResultsKeys.value = childResultsKeys.value.filter(childKey => childKey !== key); // remove the stored data for the key829 delete childResultsRaw[key];830 } // combine with other `removeChildResultsFromParent` from vuelidate instances in this Vue component instance831 instance.__vuelidateRemoveInstances = [].concat(instance.__vuelidateRemoveInstances || [], removeChildResultsFromParent); // inject the `injectChildResultsIntoParent` method, into the current scope832 const sendValidationResultsToParent = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.inject)(VuelidateInjectChildResults, []); // provide to all of its children the send results to parent function833 (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.provide)(VuelidateInjectChildResults, instance.__vuelidateInjectInstances);834 const removeValidationResultsFromParent = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.inject)(VuelidateRemoveChildResults, []); // provide to all of its children the remove results function835 (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.provide)(VuelidateRemoveChildResults, instance.__vuelidateRemoveInstances);836 return {837 childResults,838 sendValidationResultsToParent,839 removeValidationResultsFromParent840 };841}842/**843 * Helper proxy for instance property access. It makes every reference844 * reactive for the validation function845 * @param target846 * @return {*|ComputedRef<*>}847 */848function ComputedProxyFactory(target) {849 return new Proxy(target, {850 get(target, prop) {851 return typeof target[prop] === 'object' ? ComputedProxyFactory(target[prop]) : (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => target[prop]);852 }853 });854}855/**856 * @typedef GlobalConfig857 * @property {String} [$registerAs] - Config Object858 * @property {String | Number | Symbol} [$scope] - A scope to limit child component registration859 * @property {Boolean} [$stopPropagation] - Tells a Vue component to stop sending its results up to the parent860 * @property {Ref<Object>} [$externalResults] - External error messages, like from server validation.861 * @property {Boolean} [$autoDirty] - Should the form watch for state changed, and automatically set `$dirty` to true.862 * @property {Boolean} [$lazy] - Should the validations be lazy, and run only after they are dirty863 * @property {Boolean} [$rewardEarly] - Once valid, re-runs property validators only on manual calls of $commit864 */865/**866 * Composition API compatible Vuelidate867 * Use inside the `setup` lifecycle hook868 * @param {Object | GlobalConfig} [validations] - Validations Object or the globalConfig.869 * @param {Object} [state] - State object - required if `validations` is a validation object.870 * @param {GlobalConfig} [globalConfig] - Config Object871 * @return {ComputedRef<*>}872 */873function useVuelidate(validations, state) {874 let globalConfig = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};875 // if we pass only one argument, its most probably the globalConfig.876 // This use case is so parents can just collect results of child forms.877 if (arguments.length === 1) {878 globalConfig = validations;879 validations = undefined;880 state = undefined;881 }882 let {883 $registerAs,884 $scope = CollectFlag.COLLECT_ALL,885 $stopPropagation,886 $externalResults,887 currentVueInstance888 } = globalConfig;889 const instance = currentVueInstance || (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance)();890 const componentOptions = instance ? vue_demi__WEBPACK_IMPORTED_MODULE_0__.isVue3 ? instance.type : instance.proxy.$options : {}; // if there is no registration name, add one.891 if (!$registerAs && instance) {892 // NOTE:893 // ._uid // Vue 2.x Composition-API plugin894 // .uid // Vue 3.0895 const uid = instance.uid || instance._uid;896 $registerAs = `_vuelidate_${uid}`;897 }898 const validationResults = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.ref)({});899 const resultsCache = new ResultsStorage();900 const {901 childResults,902 sendValidationResultsToParent,903 removeValidationResultsFromParent904 } = instance ? nestedValidations({905 $scope,906 instance907 }) : {908 childResults: (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.ref)({})909 }; // Options API910 if (!validations && componentOptions.validations) {911 const rules = componentOptions.validations;912 state = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.ref)({});913 (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.onBeforeMount)(() => {914 // Delay binding state to validations defined with the Options API until mounting, when the data915 // has been attached to the component instance. From that point on it will be reactive.916 state.value = instance.proxy;917 (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.watch)(() => isFunction(rules) ? rules.call(state.value, new ComputedProxyFactory(state.value)) : rules, validations => {918 validationResults.value = setValidations({919 validations,920 state,921 childResults,922 resultsCache,923 globalConfig,924 instance: instance.proxy,925 externalResults: $externalResults || instance.proxy.vuelidateExternalResults926 });927 }, {928 immediate: true929 });930 });931 globalConfig = componentOptions.validationsConfig || globalConfig;932 } else {933 const validationsWatchTarget = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.isRef)(validations) || isProxy(validations) ? validations // wrap plain objects in a reactive, so we can track changes if they have computed in them.934 : (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.reactive)(validations || {});935 (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.watch)(validationsWatchTarget, newValidationRules => {936 validationResults.value = setValidations({937 validations: newValidationRules,938 state,939 childResults,940 resultsCache,941 globalConfig,942 instance: instance ? instance.proxy : {},943 externalResults: $externalResults944 });945 }, {946 immediate: true947 });948 }949 if (instance) {950 // send all the data to the parent when the function is invoked inside setup.951 sendValidationResultsToParent.forEach(f => f(validationResults, {952 $registerAs,953 $scope,954 $stopPropagation955 })); // before this component is destroyed, remove all the data from the parent.956 (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.onBeforeUnmount)(() => removeValidationResultsFromParent.forEach(f => f($registerAs)));957 }958 return (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(() => {959 return Object.assign({}, (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(validationResults.value), childResults.value);960 });961}962/***/ }),963/***/ "./node_modules/@vuelidate/validators/dist/index.esm.js":964/*!**************************************************************!*\965 !*** ./node_modules/@vuelidate/validators/dist/index.esm.js ***!966 \**************************************************************/967/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {968__webpack_require__.r(__webpack_exports__);969/* harmony export */ __webpack_require__.d(__webpack_exports__, {970/* harmony export */ "alpha": () => (/* binding */ alpha),971/* harmony export */ "alphaNum": () => (/* binding */ alphaNum),972/* harmony export */ "and": () => (/* binding */ and),973/* harmony export */ "between": () => (/* binding */ between),974/* harmony export */ "createI18nMessage": () => (/* binding */ createI18nMessage),975/* harmony export */ "decimal": () => (/* binding */ decimal),976/* harmony export */ "email": () => (/* binding */ email),977/* harmony export */ "helpers": () => (/* binding */ common),978/* harmony export */ "integer": () => (/* binding */ integer),979/* harmony export */ "ipAddress": () => (/* binding */ ipAddress),980/* harmony export */ "macAddress": () => (/* binding */ macAddress),981/* harmony export */ "maxLength": () => (/* binding */ maxLength),982/* harmony export */ "maxValue": () => (/* binding */ maxValue),983/* harmony export */ "minLength": () => (/* binding */ minLength),984/* harmony export */ "minValue": () => (/* binding */ minValue),985/* harmony export */ "not": () => (/* binding */ not),986/* harmony export */ "numeric": () => (/* binding */ numeric),987/* harmony export */ "or": () => (/* binding */ or),988/* harmony export */ "required": () => (/* binding */ required),989/* harmony export */ "requiredIf": () => (/* binding */ requiredIf),990/* harmony export */ "requiredUnless": () => (/* binding */ requiredUnless),991/* harmony export */ "sameAs": () => (/* binding */ sameAs),992/* harmony export */ "url": () => (/* binding */ url)993/* harmony export */ });994/* harmony import */ var vue_demi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue-demi */ "./node_modules/vue-demi/lib/index.mjs");995function isFunction(val) {996 return typeof val === 'function';997}998function isObject(o) {999 return o !== null && typeof o === 'object' && !Array.isArray(o);1000}1001/**1002 * Returns a standard ValidatorObject1003 * Wraps a plain function into a ValidatorObject1004 * @param {NormalizedValidator|Function} validator1005 * @return {NormalizedValidator}1006 */1007function normalizeValidatorObject(validator) {1008 return isFunction(validator.$validator) ? Object.assign({}, validator) : {1009 $validator: validator1010 };1011}1012function isPromise(object) {1013 return isObject(object) && isFunction(object.then);1014}1015/**1016 * Unwraps a ValidatorResponse object, into a boolean.1017 * @param {ValidatorResponse} result1018 * @return {boolean}1019 */1020function unwrapValidatorResponse(result) {1021 if (typeof result === 'object') return result.$valid;1022 return result;1023}1024/**1025 * Unwraps a `NormalizedValidator` object, returning its validator function.1026 * @param {NormalizedValidator | Function} validator1027 * @return {function}1028 */1029function unwrapNormalizedValidator(validator) {1030 return validator.$validator || validator;1031}1032/**1033 * Allows attaching parameters to a validator1034 * @param {Object} $params1035 * @param {NormalizedValidator|Function} $validator1036 * @return {NormalizedValidator}1037 */1038function withParams($params, $validator) {1039 if (!isObject($params)) throw new Error(`[@vuelidate/validators]: First parameter to "withParams" should be an object, provided ${typeof $params}`);1040 if (!isObject($validator) && !isFunction($validator)) throw new Error(`[@vuelidate/validators]: Validator must be a function or object with $validator parameter`);1041 const validatorObj = normalizeValidatorObject($validator);1042 validatorObj.$params = Object.assign({}, validatorObj.$params || {}, $params);1043 return validatorObj;1044}1045/**1046 * @callback MessageCallback1047 * @param {Object} params1048 * @return String1049 */1050/**1051 * Attaches a message to a validator1052 * @param {MessageCallback | String} $message1053 * @param {NormalizedValidator|Function} $validator1054 * @return {NormalizedValidator}1055 */1056function withMessage($message, $validator) {1057 if (!isFunction($message) && typeof (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)($message) !== 'string') throw new Error(`[@vuelidate/validators]: First parameter to "withMessage" should be string or a function returning a string, provided ${typeof $message}`);1058 if (!isObject($validator) && !isFunction($validator)) throw new Error(`[@vuelidate/validators]: Validator must be a function or object with $validator parameter`);1059 const validatorObj = normalizeValidatorObject($validator);1060 validatorObj.$message = $message;1061 return validatorObj;1062}1063/**1064 * @typedef {function(*): Promise<boolean|ValidatorResponse>} asyncValidator1065 */1066/**1067 * @typedef {Ref<*>[]|function(*): *} watchTargets1068 */1069/**1070 * Wraps validators that returns a Promise.1071 * @param {asyncValidator} $validator1072 * @param {watchTargets} $watchTargets1073 * @return {{$async: boolean, $validator: asyncValidator, $watchTargets: watchTargets}}1074 */1075function withAsync($validator, $watchTargets = []) {1076 const validatorObj = normalizeValidatorObject($validator);1077 return Object.assign({}, validatorObj, {1078 $async: true,1079 $watchTargets1080 });1081}1082function forEach(validators) {1083 return {1084 $validator(collection, ...others) {1085 // go over the collection. It can be a ref as well.1086 return (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(collection).reduce((previous, collectionItem) => {1087 // go over each property1088 const collectionEntryResult = Object.entries(collectionItem).reduce((all, [property, $model]) => {1089 // get the validators for this property1090 const innerValidators = validators[property] || {}; // go over each validator and run it1091 const propertyResult = Object.entries(innerValidators).reduce((all, [validatorName, currentValidator]) => {1092 // extract the validator. Supports simple and extended validators.1093 const validatorFunction = unwrapNormalizedValidator(currentValidator); // Call the validator, passing the VM as this, the value, current iterated object and the rest.1094 const $response = validatorFunction.call(this, $model, collectionItem, ...others); // extract the valid from the result1095 const $valid = unwrapValidatorResponse($response); // store the entire response for later1096 all.$data[validatorName] = $response;1097 all.$data.$invalid = !$valid || !!all.$data.$invalid;1098 all.$data.$error = all.$data.$invalid; // if not valid, get the $message1099 if (!$valid) {1100 let $message = currentValidator.$message || '';1101 const $params = currentValidator.$params || {}; // If $message is a function, we call it with the appropriate parameters1102 if (typeof $message === 'function') {1103 $message = $message({1104 $pending: false,1105 $invalid: !$valid,1106 $params,1107 $model,1108 $response1109 });1110 } // save the error object1111 all.$errors.push({1112 $property: property,1113 $message,1114 $params,1115 $response,1116 $model,1117 $pending: false,1118 $validator: validatorName1119 });1120 }1121 return {1122 $valid: all.$valid && $valid,1123 $data: all.$data,1124 $errors: all.$errors1125 };1126 }, {1127 $valid: true,1128 $data: {},1129 $errors: []1130 });1131 all.$data[property] = propertyResult.$data;1132 all.$errors[property] = propertyResult.$errors;1133 return {1134 $valid: all.$valid && propertyResult.$valid,1135 $data: all.$data,1136 $errors: all.$errors1137 };1138 }, {1139 $valid: true,1140 $data: {},1141 $errors: {}1142 });1143 return {1144 $valid: previous.$valid && collectionEntryResult.$valid,1145 $data: previous.$data.concat(collectionEntryResult.$data),1146 $errors: previous.$errors.concat(collectionEntryResult.$errors)1147 };1148 }, {1149 $valid: true,1150 $data: [],1151 $errors: []1152 });1153 },1154 // collect all the validation errors into a 2 dimensional array, for each entry in the collection, you have an array of error messages.1155 $message: ({1156 $response1157 }) => $response ? $response.$errors.map(context => {1158 return Object.values(context).map(errors => errors.map(error => error.$message)).reduce((a, b) => a.concat(b), []);1159 }) : []1160 };1161}1162// "required" core, used in almost every validator to allow empty values1163const req = value => {1164 value = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(value);1165 if (Array.isArray(value)) return !!value.length;1166 if (value === undefined || value === null) {1167 return false;1168 }1169 if (value === false) {1170 return true;1171 }1172 if (value instanceof Date) {1173 // invalid date won't pass1174 return !isNaN(value.getTime());1175 }1176 if (typeof value === 'object') {1177 for (let _ in value) return true;1178 return false;1179 }1180 return !!String(value).length;1181};1182/**1183 * Returns the length of an arbitrary value1184 * @param {Array|Object|String} value1185 * @return {number}1186 */1187const len = value => {1188 value = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(value);1189 if (Array.isArray(value)) return value.length;1190 if (typeof value === 'object') {1191 return Object.keys(value).length;1192 }1193 return String(value).length;1194};1195/**1196 * Regex based validator template1197 * @param {RegExp} expr1198 * @return {function(*=): boolean}1199 */1200function regex(expr) {1201 return value => {1202 value = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(value);1203 return !req(value) || expr.test(value);1204 };1205}1206var common = /*#__PURE__*/Object.freeze({1207 __proto__: null,1208 withParams: withParams,1209 withMessage: withMessage,1210 withAsync: withAsync,1211 forEach: forEach,1212 req: req,1213 len: len,1214 regex: regex,1215 unwrap: vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref,1216 unwrapNormalizedValidator: unwrapNormalizedValidator,1217 unwrapValidatorResponse: unwrapValidatorResponse,1218 normalizeValidatorObject: normalizeValidatorObject1219});1220var alpha$1 = regex(/^[a-zA-Z]*$/);1221/**1222 * Validate if value is alphabetical string.1223 * @type {NormalizedValidator}1224 */1225var alpha = {1226 $validator: alpha$1,1227 $message: 'The value is not alphabetical',1228 $params: {1229 type: 'alpha'1230 }1231};1232var alphaNum$1 = regex(/^[a-zA-Z0-9]*$/);1233/**1234 * Validate if value is alpha-numeric string.1235 * @type {NormalizedValidator}1236 */1237var alphaNum = {1238 $validator: alphaNum$1,1239 $message: 'The value must be alpha-numeric',1240 $params: {1241 type: 'alphaNum'1242 }1243};1244var numeric$1 = regex(/^\d*(\.\d+)?$/);1245/**1246 * Check whether a value is numeric.1247 * @type NormalizedValidator1248 */1249var numeric = {1250 $validator: numeric$1,1251 $message: 'Value must be numeric',1252 $params: {1253 type: 'numeric'1254 }1255};1256/**1257 * Check if a numeric value is between two values.1258 * @param {Ref<Number> | Number} min1259 * @param {Ref<Number> | Number} max1260 * @return {function(*=): boolean}1261 */1262function between$1 (min, max) {1263 return value => !req(value) || (!/\s/.test(value) || value instanceof Date) && +(0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(min) <= +value && +(0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(max) >= +value;1264}1265/**1266 * Checks if a value is between two values.1267 * @param {Ref<Number> | Number} min1268 * @param {Ref<Number> | Number} max1269 * @return {NormalizedValidator}1270 */1271function between (min, max) {1272 return {1273 $validator: between$1(min, max),1274 $message: ({1275 $params1276 }) => `The value must be between ${$params.min} and ${$params.max}`,1277 $params: {1278 min,1279 max,1280 type: 'between'1281 }1282 };1283}1284const emailRegex = /^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;1285var email$1 = regex(emailRegex);1286/**1287 * Validate if value is an email.1288 * @type {NormalizedValidator}1289 */1290var email = {1291 $validator: email$1,1292 $message: 'Value is not a valid email address',1293 $params: {1294 type: 'email'1295 }1296};1297/**1298 * Check if a string is an IP Address1299 * @param {String} value1300 * @returns {boolean}1301 */1302function ipAddress$1 (value) {1303 if (!req(value)) {1304 return true;1305 }1306 if (typeof value !== 'string') {1307 return false;1308 }1309 const nibbles = value.split('.');1310 return nibbles.length === 4 && nibbles.every(nibbleValid);1311}1312const nibbleValid = nibble => {1313 if (nibble.length > 3 || nibble.length === 0) {1314 return false;1315 }1316 if (nibble[0] === '0' && nibble !== '0') {1317 return false;1318 }1319 if (!nibble.match(/^\d+$/)) {1320 return false;1321 }1322 const numeric = +nibble | 0;1323 return numeric >= 0 && numeric <= 255;1324};1325/**1326 * Validate if value is an ipAddress string.1327 * @type {NormalizedValidator}1328 */1329var ipAddress = {1330 $validator: ipAddress$1,1331 $message: 'The value is not a valid IP address',1332 $params: {1333 type: 'ipAddress'1334 }1335};1336/**1337 * Check if value is a properly formatted Mac Address.1338 * @param {String | Ref<String>} [separator]1339 * @returns {function(*): boolean}1340 */1341function macAddress$1 (separator = ':') {1342 return value => {1343 separator = (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(separator);1344 if (!req(value)) {1345 return true;1346 }1347 if (typeof value !== 'string') {1348 return false;1349 }1350 const parts = typeof separator === 'string' && separator !== '' ? value.split(separator) : value.length === 12 || value.length === 16 ? value.match(/.{2}/g) : null;1351 return parts !== null && (parts.length === 6 || parts.length === 8) && parts.every(hexValid);1352 };1353}1354const hexValid = hex => hex.toLowerCase().match(/^[0-9a-f]{2}$/);1355/**1356 * Validate if value is a valid Mac Address string.1357 * @returns {NormalizedValidator}1358 */1359function macAddress (separator) {1360 return {1361 $validator: macAddress$1(separator),1362 $message: 'The value is not a valid MAC Address',1363 $params: {1364 type: 'macAddress'1365 }1366 };1367}1368/**1369 * Check if provided value has a maximum length1370 * @param {Number | Ref<Number>} length1371 * @returns {function(Array|Object|String): boolean}1372 */1373function maxLength$1 (length) {1374 return value => !req(value) || len(value) <= (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(length);1375}1376/**1377 * Validate the max length of a string.1378 * @param {Number} max1379 * @return {NormalizedValidator}1380 */1381function maxLength (max) {1382 return {1383 $validator: maxLength$1(max),1384 $message: ({1385 $params1386 }) => `The maximum length allowed is ${$params.max}`,1387 $params: {1388 max,1389 type: 'maxLength'1390 }1391 };1392}1393/**1394 * Check if value is above a threshold.1395 * @param {Number | Ref<Number>} length1396 * @returns {function(Array|Object|String): boolean}1397 */1398function minLength$1 (length) {1399 return value => !req(value) || len(value) >= (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(length);1400}1401/**1402 * Check if value is above a threshold.1403 * @param {Number | Ref<Number>} min1404 * @returns {NormalizedValidator}1405 */1406function minLength (min) {1407 return {1408 $validator: minLength$1(min),1409 $message: ({1410 $params1411 }) => `This field should be at least ${$params.min} long`,1412 $params: {1413 min,1414 type: 'minLength'1415 }1416 };1417}1418/**1419 * Validates if a value is empty.1420 * @param {String | Array | Date | Object} value1421 * @returns {boolean}1422 */1423function required$1 (value) {1424 if (typeof value === 'string') {1425 value = value.trim();1426 }1427 return req(value);1428}1429/**1430 * Check if a value is empty or not.1431 * @type {NormalizedValidator}1432 */1433var required = {1434 $validator: required$1,1435 $message: 'Value is required',1436 $params: {1437 type: 'required'1438 }1439};1440const validate$1 = (prop, val) => prop ? req(val) : true;1441/**1442 * Returns required if the passed property is truthy1443 * @param {Boolean | String | function(any): Boolean | Ref<string | boolean>} propOrFunction1444 * @return {function(value: *, parentVM: object): Boolean}1445 */1446function requiredIf$1(propOrFunction) {1447 return function (value, parentVM) {1448 if (typeof propOrFunction !== 'function') {1449 return validate$1((0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(propOrFunction), value);1450 }1451 const result = propOrFunction.call(this, value, parentVM);1452 return validate$1(result, value);1453 };1454}1455/**1456 * Returns required if the passed property is truthy1457 * @param {Boolean | String | function(): (Boolean | Promise<boolean>)} prop1458 * @return {NormalizedValidator}1459 */1460function requiredIf (prop) {1461 return {1462 $validator: requiredIf$1(prop),1463 $message: 'The value is required',1464 $params: {1465 type: 'requiredIf',1466 prop1467 }1468 };1469}1470const validate = (prop, val) => !prop ? req(val) : true;1471/**1472 * Returns required if the passed property is falsy.1473 * @param {Boolean | String | function(any): Boolean | Ref<string | boolean>} propOrFunction1474 * @return {function(value: *, parentVM: object): Boolean}1475 */1476function requiredUnless$1(propOrFunction) {1477 return function (value, parentVM) {1478 if (typeof propOrFunction !== 'function') {1479 return validate((0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(propOrFunction), value);1480 }1481 const result = propOrFunction.call(this, value, parentVM);1482 return validate(result, value);1483 };1484}1485/**1486 * Returns required unless the passed property is truthy1487 * @param {Boolean | String | function(): (Boolean | Promise<boolean>)} prop1488 * @return {NormalizedValidator}1489 */1490function requiredUnless (prop) {1491 return {1492 $validator: requiredUnless$1(prop),1493 $message: 'The value is required',1494 $params: {1495 type: 'requiredUnless',1496 prop1497 }1498 };1499}1500/**1501 * Check if two values are identical.1502 * @param {*} equalTo1503 * @return {function(*=): boolean}1504 */1505function sameAs$1 (equalTo) {1506 return value => (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(value) === (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(equalTo);1507}1508/**1509 * Check if two values are identical1510 * @param {*} equalTo1511 * @param {String} [otherName]1512 * @return {NormalizedValidator}1513 */1514function sameAs (equalTo, otherName = 'other') {1515 return {1516 $validator: sameAs$1(equalTo),1517 $message: ({1518 $params1519 }) => `The value must be equal to the ${otherName} value`,1520 $params: {1521 equalTo,1522 otherName,1523 type: 'sameAs'1524 }1525 };1526}1527/**1528 * Regex taken from {@link https://gist.github.com/dperini/729294}1529 */1530const urlRegex = /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i;1531var url$1 = regex(urlRegex);1532/**1533 * Check if a value is a url1534 * @type {NormalizedValidator}1535 */1536var url = {1537 $validator: url$1,1538 $message: 'The value is not a valid URL address',1539 $params: {1540 type: 'url'1541 }1542};1543function _await$1(value, then, direct) {1544 if (direct) {1545 return then ? then(value) : value;1546 }1547 if (!value || !value.then) {1548 value = Promise.resolve(value);1549 }1550 return then ? value.then(then) : value;1551}1552function syncOr(validators) {1553 return function (...args) {1554 return validators.reduce((valid, fn) => {1555 if (unwrapValidatorResponse(valid)) return valid;1556 return unwrapNormalizedValidator(fn).apply(this, args);1557 }, false);1558 };1559}1560function asyncOr(validators) {1561 return function (...args) {1562 const _this = this;1563 return validators.reduce(function (valid, fn) {1564 return _await$1(valid, function (r) {1565 return unwrapValidatorResponse(r) ? r : unwrapNormalizedValidator(fn).apply(_this, args);1566 });1567 }, Promise.resolve(false));1568 };1569}1570/**1571 * Returns true when one of the provided functions returns true.1572 * @param {...(NormalizedValidator|Function)} validators1573 * @return {{$validator: function(...[*]=): (boolean | Promise<boolean>), $async: boolean, $watchTargets: any[]}}1574 */1575function or$1(...validators) {1576 const $async = validators.some(v => v.$async);1577 const $watchTargets = validators.reduce((all, v) => {1578 if (!v.$watchTargets) return all;1579 return all.concat(v.$watchTargets);1580 }, []);1581 let $validator = () => false;1582 if (validators.length) $validator = $async ? asyncOr(validators) : syncOr(validators);1583 return {1584 $async,1585 $validator,1586 $watchTargets1587 };1588}1589/**1590 * Returns true when one of the provided functions returns true.1591 * @param {...(NormalizedValidator|Function)} validators1592 * @return {NormalizedValidator}1593 */1594function or (...validators) {1595 return withParams({1596 type: 'or'1597 }, withMessage('The value does not match any of the provided validators', or$1(...validators)));1598}1599function _await(value, then, direct) {1600 if (direct) {1601 return then ? then(value) : value;1602 }1603 if (!value || !value.then) {1604 value = Promise.resolve(value);1605 }1606 return then ? value.then(then) : value;1607}1608/**1609 *1610 * @param validators1611 * @return {function(...[*]=): Promise<boolean>}1612 */1613function syncAnd(validators) {1614 return function (...args) {1615 return validators.reduce((valid, fn) => {1616 if (!unwrapValidatorResponse(valid)) return valid;1617 return unwrapNormalizedValidator(fn).apply(this, args);1618 }, true);1619 };1620}1621function asyncAnd(validators) {1622 return function (...args) {1623 const _this = this;1624 return validators.reduce(function (valid, fn) {1625 return _await(valid, function (r) {1626 return unwrapValidatorResponse(r) ? unwrapNormalizedValidator(fn).apply(_this, args) : r;1627 });1628 }, Promise.resolve(true));1629 };1630}1631/**1632 * Returns true when all validators are truthy1633 * @param {...(NormalizedValidator | Function)} validators1634 * @return {{$validator: function(...[*]=): (boolean | Promise<boolean>), $async: boolean, $watchTargets: any[]}}1635 */1636function and$1(...validators) {1637 const $async = validators.some(v => v.$async);1638 const $watchTargets = validators.reduce((all, v) => {1639 if (!v.$watchTargets) return all;1640 return all.concat(v.$watchTargets);1641 }, []);1642 let $validator = () => false;1643 if (validators.length) $validator = $async ? asyncAnd(validators) : syncAnd(validators);1644 return {1645 $async,1646 $validator,1647 $watchTargets1648 };1649}1650/**1651 * Validate if all validators match.1652 * @param {...*} validators1653 * @returns {NormalizedValidator}1654 */1655function and (...validators) {1656 return withParams({1657 type: 'and'1658 }, withMessage('The value does not match all of the provided validators', and$1(...validators)));1659}1660/**1661 * Swaps the result of a value1662 * @param {NormalizedValidator|Function} validator1663 * @returns {function(*=, *=): boolean}1664 */1665function not$1 (validator) {1666 return function (value, vm) {1667 if (!req(value)) return true;1668 const response = unwrapNormalizedValidator(validator).call(this, value, vm);1669 if (!isPromise(response)) return !unwrapValidatorResponse(response);1670 return response.then(r => !unwrapValidatorResponse(r));1671 };1672}1673/**1674 * Swaps the result of a value1675 * @param {NormalizedValidator|Function} validator1676 * @returns {NormalizedValidator}1677 */1678function not (validator) {1679 return {1680 $validator: not$1(validator),1681 $message: `The value does not match the provided validator`,1682 $params: {1683 type: 'not'1684 }1685 };1686}1687/**1688 * Check if a value is above a threshold.1689 * @param {String | Number | Ref<Number> | Ref<String>} min1690 * @returns {function(*=): boolean}1691 */1692function minValue$1 (min) {1693 return value => !req(value) || (!/\s/.test(value) || value instanceof Date) && +value >= +(0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(min);1694}1695/**1696 * Check if a value is above a threshold.1697 * @param {String | Number | Ref<Number> | Ref<String>} min1698 * @returns {NormalizedValidator}1699 */1700function minValue (min) {1701 return {1702 $validator: minValue$1(min),1703 $message: ({1704 $params1705 }) => `The minimum value allowed is ${$params.min}`,1706 $params: {1707 min,1708 type: 'minValue'1709 }1710 };1711}1712/**1713 * Check if value is below a threshold.1714 * @param {Number | Ref<Number> | Ref<String>} max1715 * @returns {function(*=): boolean}1716 */1717function maxValue$1 (max) {1718 return value => !req(value) || (!/\s/.test(value) || value instanceof Date) && +value <= +(0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.unref)(max);1719}1720/**1721 * Check if value is below a threshold.1722 * @param {Number | Ref<Number> | Ref<String>} max1723 * @return {NormalizedValidator}1724 */1725var maxValue = (max => ({1726 $validator: maxValue$1(max),1727 $message: ({1728 $params1729 }) => `The maximum value is ${$params.max}`,1730 $params: {1731 max,1732 type: 'maxValue'1733 }1734}));1735// ^-[0-9]+$ - only for negative integer (minus sign without at least 1 digit is not a number)1736var integer$1 = regex(/(^[0-9]*$)|(^-[0-9]+$)/);1737/**1738 * Validate if value is integer.1739 * @type {NormalizedValidator}1740 */1741var integer = {1742 $validator: integer$1,1743 $message: 'Value is not an integer',1744 $params: {1745 type: 'integer'1746 }1747};1748var decimal$1 = regex(/^[-]?\d*(\.\d+)?$/);1749/**1750 * Validate if value is decimal number.1751 * @type {NormalizedValidator}1752 */1753var decimal = {1754 $validator: decimal$1,1755 $message: 'Value must be decimal',1756 $params: {1757 type: 'decimal'1758 }1759};1760/**1761 * Creates a translatable version of `withMessage` helper.1762 * @param {function} t - the translation function of your choice1763 * @param {function} [messagePath] - a function to generate the message path, passed to `t` for each message. By default it is `validations.${$validator}`1764 * @param {function} [messageParams] - a function to augment the params, passed to `t` for each message.1765 */1766function createI18nMessage({1767 t,1768 messagePath = ({1769 $validator1770 }) => `validations.${$validator}`,1771 messageParams = params => params1772}) {1773 return function withI18nMessage(validator, {1774 withArguments = false,1775 messagePath: localMessagePath = messagePath,1776 messageParams: localMessageParams = messageParams1777 } = {}) {1778 function message(props) {1779 return t(localMessagePath(props), localMessageParams(Object.assign({1780 model: props.$model,1781 property: props.$property,1782 pending: props.$pending,1783 invalid: props.$invalid,1784 response: props.$response,1785 validator: props.$validator,1786 propertyPath: props.$propertyPath1787 }, props.$params)));1788 }1789 if (withArguments && typeof validator === 'function') {1790 return (...args) => withMessage(message, validator(...args));1791 }1792 return withMessage(message, validator);1793 };1794}1795/***/ }),1796/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/views/Registration.vue?vue&type=script&lang=js":1797/*!*************************************************************************************************************************************************************************************************!*\1798 !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/views/Registration.vue?vue&type=script&lang=js ***!1799 \*************************************************************************************************************************************************************************************************/1800/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {1801__webpack_require__.r(__webpack_exports__);1802/* harmony export */ __webpack_require__.d(__webpack_exports__, {1803/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)1804/* harmony export */ });1805/* harmony import */ var _vuelidate_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vuelidate/core */ "./node_modules/@vuelidate/core/dist/index.esm.js");1806/* harmony import */ var _vuelidate_validators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @vuelidate/validators */ "./node_modules/@vuelidate/validators/dist/index.esm.js");1807/* harmony import */ var _helpers_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/api */ "./resources/js/helpers/api.js");1808/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({1809 setup: function setup() {1810 return {1811 v$: (0,_vuelidate_core__WEBPACK_IMPORTED_MODULE_0__["default"])()1812 };1813 },1814 data: function data() {1815 return {1816 form: {1817 name: '',1818 email: '',1819 password: '',1820 passwordConfirmation: ''1821 },1822 load_form: false,1823 errors: {1824 required: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_2__.helpers.withMessage('Поле не должно быть пустым.', _vuelidate_validators__WEBPACK_IMPORTED_MODULE_2__.required),1825 email: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_2__.helpers.withMessage('Некорректный email.', _vuelidate_validators__WEBPACK_IMPORTED_MODULE_2__.email),1826 minLength: function minLength(length) {1827 return _vuelidate_validators__WEBPACK_IMPORTED_MODULE_2__.helpers.withMessage(function (_ref) {1828 var $params = _ref.$params;1829 return "\u041F\u043E\u043B\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043D\u0435 \u043A\u043E\u0440\u043E\u0447\u0435 ".concat($params.min, " \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432.");1830 }, (0,_vuelidate_validators__WEBPACK_IMPORTED_MODULE_2__.minLength)(length));1831 },1832 sameAs: function sameAs(password) {1833 return _vuelidate_validators__WEBPACK_IMPORTED_MODULE_2__.helpers.withMessage('Неверно подтвержден пароль.', (0,_vuelidate_validators__WEBPACK_IMPORTED_MODULE_2__.sameAs)(password));1834 }1835 }1836 };1837 },1838 validations: function validations() {1839 return {1840 form: {1841 name: {1842 required: this.errors.required,1843 minLength: this.errors.minLength(2)1844 },1845 email: {1846 required: this.errors.required,1847 email: this.errors.email1848 },1849 password: {1850 required: this.errors.required,1851 minLength: this.errors.minLength(6)1852 },1853 passwordConfirmation: {1854 sameAs: this.errors.sameAs(this.form.password)1855 }1856 }1857 };1858 },1859 methods: {1860 registration: function registration() {1861 var _this = this;1862 this.v$.$touch();1863 if (this.v$.$error) return;1864 this.load_form = true;1865 var formParams = {1866 name: this.form.name,1867 email: this.form.email,1868 password: this.form.password,1869 password_confirmation: this.form.passwordConfirmation1870 };1871 _helpers_api__WEBPACK_IMPORTED_MODULE_1__["default"].post('/registration', formParams).then(function (res) {1872 _this.load_form = false;1873 localStorage.setItem('user_token', res.access_token);1874 localStorage.setItem('user', JSON.stringify(res.user));1875 _this.$store.commit('setUser', res.user);1876 _helpers_api__WEBPACK_IMPORTED_MODULE_1__["default"].defaults.headers.common.Authorization = 'Bearer ' + res.access_token;1877 _this.$router.push('/');1878 })["catch"](function (error) {1879 // handle error1880 _this.password = '';1881 _this.load_form = false;1882 _this.error = error.response.data.message;1883 });1884 }1885 }1886});1887/***/ }),1888/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/views/Registration.vue?vue&type=template&id=111cccd8":1889/*!*****************************************************************************************************************************************************************************************************************************************************************************!*\1890 !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/views/Registration.vue?vue&type=template&id=111cccd8 ***!1891 \*****************************************************************************************************************************************************************************************************************************************************************************/1892/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {1893__webpack_require__.r(__webpack_exports__);1894/* harmony export */ __webpack_require__.d(__webpack_exports__, {1895/* harmony export */ "render": () => (/* binding */ render)1896/* harmony export */ });1897/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");1898var _hoisted_1 = {1899 "class": "container vh-100"1900};1901var _hoisted_2 = {1902 "class": "row h-100 align-items-center justify-content-center"1903};1904var _hoisted_3 = {1905 "class": "col-md-7 col-lg-5s shadow bg-white rounded py-3 px-5"1906};1907var _hoisted_4 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", {1908 "class": "text-center"1909}, "Регистрация", -11910/* HOISTED */1911);1912var _hoisted_5 = {1913 "class": ""1914};1915var _hoisted_6 = {1916 "class": "form-group mt-3"1917};1918var _hoisted_7 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", {1919 "class": "form-label"1920}, "Имя", -11921/* HOISTED */1922);1923var _hoisted_8 = {1924 key: 0,1925 "class": "form-text text-danger"1926};1927var _hoisted_9 = {1928 "class": "form-group mt-3"1929};1930var _hoisted_10 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", {1931 "class": "form-label"1932}, "Email", -11933/* HOISTED */1934);1935var _hoisted_11 = {1936 key: 0,1937 "class": "form-text text-danger"1938};1939var _hoisted_12 = {1940 "class": "form-group mt-3"1941};1942var _hoisted_13 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", {1943 "class": "form-label"1944}, "Пароль", -11945/* HOISTED */1946);1947var _hoisted_14 = {1948 key: 0,1949 "class": "form-text text-danger"1950};1951var _hoisted_15 = {1952 key: 1,1953 "class": "form-text text-danger"1954};1955var _hoisted_16 = {1956 "class": "form-group mt-3 mb-5"1957};1958var _hoisted_17 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", {1959 "class": "form-label"1960}, "Подтвердите пароль", -11961/* HOISTED */1962);1963var _hoisted_18 = {1964 "class": "text-center my-3"1965};1966var _hoisted_19 = ["disabled"];1967var _hoisted_20 = {1968 "class": "my-4 text-center"1969};1970var _hoisted_21 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)("Авторизоваться");1971function render(_ctx, _cache, $props, $setup, $data, $options) {1972 var _component_router_link = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("router-link");1973 return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [_hoisted_4, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("form", {1974 onSubmit: _cache[8] || (_cache[8] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)(function () {1975 return $options.registration && $options.registration.apply($options, arguments);1976 }, ["prevent"]))1977 }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [_hoisted_7, (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", {1978 type: "text",1979 "class": "form-control",1980 placeholder: "Введите ваше имя",1981 "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {1982 return $data.form.name = $event;1983 }),1984 onBlur: _cache[1] || (_cache[1] = function () {1985 var _$setup$v$$form$name;1986 return $setup.v$.form.name.$touch && (_$setup$v$$form$name = $setup.v$.form.name).$touch.apply(_$setup$v$$form$name, arguments);1987 })1988 }, null, 5441989 /* HYDRATE_EVENTS, NEED_PATCH */1990 ), [[vue__WEBPACK_IMPORTED_MODULE_0__.vModelText, $data.form.name]]), $setup.v$.form.name.$error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_8, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.v$.form.name.$errors[0].$message), 11991 /* TEXT */1992 )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_9, [_hoisted_10, (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", {1993 type: "email",1994 "class": "form-control",1995 placeholder: "Введите ваш email",1996 "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) {1997 return $data.form.email = $event;1998 }),1999 onBlur: _cache[3] || (_cache[3] = function () {2000 var _$setup$v$$form$email;2001 return $setup.v$.form.email.$touch && (_$setup$v$$form$email = $setup.v$.form.email).$touch.apply(_$setup$v$$form$email, arguments);2002 })2003 }, null, 5442004 /* HYDRATE_EVENTS, NEED_PATCH */2005 ), [[vue__WEBPACK_IMPORTED_MODULE_0__.vModelText, $data.form.email]]), $setup.v$.form.email.$error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.v$.form.email.$errors[0].$message), 12006 /* TEXT */2007 )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_12, [_hoisted_13, (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", {2008 type: "password",2009 "class": "form-control",2010 placeholder: "Введите пароль",2011 "onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) {2012 return $data.form.password = $event;2013 }),2014 onBlur: _cache[5] || (_cache[5] = function () {2015 var _$setup$v$$form$passw;2016 return $setup.v$.form.password.$touch && (_$setup$v$$form$passw = $setup.v$.form.password).$touch.apply(_$setup$v$$form$passw, arguments);2017 })2018 }, null, 5442019 /* HYDRATE_EVENTS, NEED_PATCH */2020 ), [[vue__WEBPACK_IMPORTED_MODULE_0__.vModelText, $data.form.password]]), $setup.v$.form.password.$dirty && $setup.v$.form.password.$error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_14, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.v$.form.password.$errors[0].$message), 12021 /* TEXT */2022 )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $setup.v$.form.passwordConfirmation.$error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_15, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.v$.form.passwordConfirmation.$errors[0].$message), 12023 /* TEXT */2024 )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_16, [_hoisted_17, (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", {2025 type: "password",2026 "class": "form-control",2027 placeholder: "Подтвердите пароль",2028 "onUpdate:modelValue": _cache[6] || (_cache[6] = function ($event) {2029 return $data.form.passwordConfirmation = $event;2030 }),2031 onBlur: _cache[7] || (_cache[7] = function () {2032 var _$setup$v$$form$passw2;2033 return $setup.v$.form.passwordConfirmation.$touch && (_$setup$v$$form$passw2 = $setup.v$.form.passwordConfirmation).$touch.apply(_$setup$v$$form$passw2, arguments);2034 })2035 }, null, 5442036 /* HYDRATE_EVENTS, NEED_PATCH */2037 ), [[vue__WEBPACK_IMPORTED_MODULE_0__.vModelText, $data.form.passwordConfirmation]])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_18, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {2038 "class": "btn btn-primary",2039 disabled: $data.load_form2040 }, "Зарегистрироваться", 82041 /* PROPS */2042 , _hoisted_19)])])], 322043 /* HYDRATE_EVENTS */2044 ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_20, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_router_link, {2045 to: "/login"2046 }, {2047 "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {2048 return [_hoisted_21];2049 }),2050 _: 12051 /* STABLE */2052 })])])])]);2053}2054/***/ }),2055/***/ "./resources/js/views/Registration.vue":2056/*!*********************************************!*\2057 !*** ./resources/js/views/Registration.vue ***!2058 \*********************************************/2059/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {2060__webpack_require__.r(__webpack_exports__);2061/* harmony export */ __webpack_require__.d(__webpack_exports__, {2062/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)2063/* harmony export */ });2064/* harmony import */ var _Registration_vue_vue_type_template_id_111cccd8__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Registration.vue?vue&type=template&id=111cccd8 */ "./resources/js/views/Registration.vue?vue&type=template&id=111cccd8");2065/* harmony import */ var _Registration_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Registration.vue?vue&type=script&lang=js */ "./resources/js/views/Registration.vue?vue&type=script&lang=js");2066/* harmony import */ var C_sites_chat_vue_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");2067;2068const __exports__ = /*#__PURE__*/(0,C_sites_chat_vue_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Registration_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Registration_vue_vue_type_template_id_111cccd8__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/views/Registration.vue"]])2069/* hot reload */2070if (false) {}2071/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);2072/***/ }),2073/***/ "./resources/js/views/Registration.vue?vue&type=script&lang=js":2074/*!*********************************************************************!*\2075 !*** ./resources/js/views/Registration.vue?vue&type=script&lang=js ***!2076 \*********************************************************************/2077/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {2078__webpack_require__.r(__webpack_exports__);2079/* harmony export */ __webpack_require__.d(__webpack_exports__, {2080/* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Registration_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])2081/* harmony export */ });2082/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Registration_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Registration.vue?vue&type=script&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/views/Registration.vue?vue&type=script&lang=js");2083 2084/***/ }),2085/***/ "./resources/js/views/Registration.vue?vue&type=template&id=111cccd8":2086/*!***************************************************************************!*\2087 !*** ./resources/js/views/Registration.vue?vue&type=template&id=111cccd8 ***!2088 \***************************************************************************/2089/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {2090__webpack_require__.r(__webpack_exports__);2091/* harmony export */ __webpack_require__.d(__webpack_exports__, {2092/* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Registration_vue_vue_type_template_id_111cccd8__WEBPACK_IMPORTED_MODULE_0__.render)2093/* harmony export */ });2094/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Registration_vue_vue_type_template_id_111cccd8__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Registration.vue?vue&type=template&id=111cccd8 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/views/Registration.vue?vue&type=template&id=111cccd8");2095/***/ }),2096/***/ "./node_modules/vue-demi/lib/index.mjs":2097/*!*********************************************!*\2098 !*** ./node_modules/vue-demi/lib/index.mjs ***!2099 \*********************************************/2100/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {2101__webpack_require__.r(__webpack_exports__);2102/* harmony export */ __webpack_require__.d(__webpack_exports__, {2103/* harmony export */ "set": () => (/* binding */ set),2104/* harmony export */ "del": () => (/* binding */ del),2105/* harmony export */ "BaseTransition": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.BaseTransition),2106/* harmony export */ "Comment": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.Comment),2107/* harmony export */ "EffectScope": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.EffectScope),2108/* harmony export */ "Fragment": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.Fragment),2109/* harmony export */ "KeepAlive": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.KeepAlive),2110/* harmony export */ "ReactiveEffect": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.ReactiveEffect),2111/* harmony export */ "Static": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.Static),2112/* harmony export */ "Suspense": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.Suspense),2113/* harmony export */ "Teleport": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.Teleport),2114/* harmony export */ "Text": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.Text),2115/* harmony export */ "Transition": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.Transition),2116/* harmony export */ "TransitionGroup": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.TransitionGroup),2117/* harmony export */ "VueElement": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.VueElement),2118/* harmony export */ "callWithAsyncErrorHandling": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.callWithAsyncErrorHandling),2119/* harmony export */ "callWithErrorHandling": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.callWithErrorHandling),2120/* harmony export */ "camelize": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.camelize),2121/* harmony export */ "capitalize": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.capitalize),2122/* harmony export */ "cloneVNode": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.cloneVNode),2123/* harmony export */ "compatUtils": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.compatUtils),2124/* harmony export */ "compile": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.compile),2125/* harmony export */ "computed": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.computed),2126/* harmony export */ "createApp": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.createApp),2127/* harmony export */ "createBlock": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.createBlock),2128/* harmony export */ "createCommentVNode": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode),2129/* harmony export */ "createElementBlock": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock),2130/* harmony export */ "createElementVNode": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode),2131/* harmony export */ "createHydrationRenderer": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.createHydrationRenderer),2132/* harmony export */ "createPropsRestProxy": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.createPropsRestProxy),2133/* harmony export */ "createRenderer": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.createRenderer),2134/* harmony export */ "createSSRApp": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.createSSRApp),2135/* harmony export */ "createSlots": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.createSlots),2136/* harmony export */ "createStaticVNode": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.createStaticVNode),2137/* harmony export */ "createTextVNode": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode),2138/* harmony export */ "createVNode": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.createVNode),2139/* harmony export */ "customRef": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.customRef),2140/* harmony export */ "defineAsyncComponent": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.defineAsyncComponent),2141/* harmony export */ "defineComponent": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.defineComponent),2142/* harmony export */ "defineCustomElement": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.defineCustomElement),2143/* harmony export */ "defineEmits": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.defineEmits),2144/* harmony export */ "defineExpose": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.defineExpose),2145/* harmony export */ "defineProps": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.defineProps),2146/* harmony export */ "defineSSRCustomElement": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.defineSSRCustomElement),2147/* harmony export */ "devtools": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.devtools),2148/* harmony export */ "effect": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.effect),2149/* harmony export */ "effectScope": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.effectScope),2150/* harmony export */ "getCurrentInstance": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance),2151/* harmony export */ "getCurrentScope": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope),2152/* harmony export */ "getTransitionRawChildren": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.getTransitionRawChildren),2153/* harmony export */ "guardReactiveProps": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.guardReactiveProps),2154/* harmony export */ "h": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.h),2155/* harmony export */ "handleError": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.handleError),2156/* harmony export */ "hydrate": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.hydrate),2157/* harmony export */ "initCustomFormatter": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.initCustomFormatter),2158/* harmony export */ "initDirectivesForSSR": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.initDirectivesForSSR),2159/* harmony export */ "inject": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.inject),2160/* harmony export */ "isMemoSame": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.isMemoSame),2161/* harmony export */ "isProxy": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.isProxy),2162/* harmony export */ "isReactive": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.isReactive),2163/* harmony export */ "isReadonly": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.isReadonly),2164/* harmony export */ "isRef": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.isRef),2165/* harmony export */ "isRuntimeOnly": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.isRuntimeOnly),2166/* harmony export */ "isVNode": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.isVNode),2167/* harmony export */ "markRaw": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.markRaw),2168/* harmony export */ "mergeDefaults": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.mergeDefaults),2169/* harmony export */ "mergeProps": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.mergeProps),2170/* harmony export */ "nextTick": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.nextTick),2171/* harmony export */ "normalizeClass": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass),2172/* harmony export */ "normalizeProps": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.normalizeProps),2173/* harmony export */ "normalizeStyle": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle),2174/* harmony export */ "onActivated": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.onActivated),2175/* harmony export */ "onBeforeMount": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.onBeforeMount),2176/* harmony export */ "onBeforeUnmount": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.onBeforeUnmount),2177/* harmony export */ "onBeforeUpdate": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.onBeforeUpdate),2178/* harmony export */ "onDeactivated": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.onDeactivated),2179/* harmony export */ "onErrorCaptured": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.onErrorCaptured),2180/* harmony export */ "onMounted": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.onMounted),2181/* harmony export */ "onRenderTracked": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.onRenderTracked),2182/* harmony export */ "onRenderTriggered": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.onRenderTriggered),2183/* harmony export */ "onScopeDispose": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.onScopeDispose),2184/* harmony export */ "onServerPrefetch": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.onServerPrefetch),2185/* harmony export */ "onUnmounted": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.onUnmounted),2186/* harmony export */ "onUpdated": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.onUpdated),2187/* harmony export */ "openBlock": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.openBlock),2188/* harmony export */ "popScopeId": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId),2189/* harmony export */ "provide": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.provide),2190/* harmony export */ "proxyRefs": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.proxyRefs),2191/* harmony export */ "pushScopeId": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId),2192/* harmony export */ "queuePostFlushCb": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.queuePostFlushCb),2193/* harmony export */ "reactive": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.reactive),2194/* harmony export */ "readonly": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.readonly),2195/* harmony export */ "ref": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.ref),2196/* harmony export */ "registerRuntimeCompiler": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.registerRuntimeCompiler),2197/* harmony export */ "render": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.render),2198/* harmony export */ "renderList": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.renderList),2199/* harmony export */ "renderSlot": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot),2200/* harmony export */ "resolveComponent": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent),2201/* harmony export */ "resolveDirective": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective),2202/* harmony export */ "resolveDynamicComponent": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.resolveDynamicComponent),2203/* harmony export */ "resolveFilter": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.resolveFilter),2204/* harmony export */ "resolveTransitionHooks": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.resolveTransitionHooks),2205/* harmony export */ "setBlockTracking": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.setBlockTracking),2206/* harmony export */ "setDevtoolsHook": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.setDevtoolsHook),2207/* harmony export */ "setTransitionHooks": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.setTransitionHooks),2208/* harmony export */ "shallowReactive": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.shallowReactive),2209/* harmony export */ "shallowReadonly": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly),2210/* harmony export */ "shallowRef": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.shallowRef),2211/* harmony export */ "ssrContextKey": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.ssrContextKey),2212/* harmony export */ "ssrUtils": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.ssrUtils),2213/* harmony export */ "stop": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.stop),2214/* harmony export */ "toDisplayString": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString),2215/* harmony export */ "toHandlerKey": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.toHandlerKey),2216/* harmony export */ "toHandlers": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.toHandlers),2217/* harmony export */ "toRaw": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.toRaw),2218/* harmony export */ "toRef": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.toRef),2219/* harmony export */ "toRefs": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.toRefs),2220/* harmony export */ "transformVNodeArgs": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.transformVNodeArgs),2221/* harmony export */ "triggerRef": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.triggerRef),2222/* harmony export */ "unref": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.unref),2223/* harmony export */ "useAttrs": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.useAttrs),2224/* harmony export */ "useCssModule": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.useCssModule),2225/* harmony export */ "useCssVars": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.useCssVars),2226/* harmony export */ "useSSRContext": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.useSSRContext),2227/* harmony export */ "useSlots": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.useSlots),2228/* harmony export */ "useTransitionState": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.useTransitionState),2229/* harmony export */ "vModelCheckbox": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.vModelCheckbox),2230/* harmony export */ "vModelDynamic": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.vModelDynamic),2231/* harmony export */ "vModelRadio": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.vModelRadio),2232/* harmony export */ "vModelSelect": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.vModelSelect),2233/* harmony export */ "vModelText": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.vModelText),2234/* harmony export */ "vShow": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.vShow),2235/* harmony export */ "version": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.version),2236/* harmony export */ "warn": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.warn),2237/* harmony export */ "watch": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.watch),2238/* harmony export */ "watchEffect": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.watchEffect),2239/* harmony export */ "watchPostEffect": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.watchPostEffect),2240/* harmony export */ "watchSyncEffect": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.watchSyncEffect),2241/* harmony export */ "withAsyncContext": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.withAsyncContext),2242/* harmony export */ "withCtx": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.withCtx),2243/* harmony export */ "withDefaults": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.withDefaults),2244/* harmony export */ "withDirectives": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives),2245/* harmony export */ "withKeys": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.withKeys),2246/* harmony export */ "withMemo": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.withMemo),2247/* harmony export */ "withModifiers": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers),2248/* harmony export */ "withScopeId": () => (/* reexport safe */ vue__WEBPACK_IMPORTED_MODULE_0__.withScopeId),2249/* harmony export */ "Vue": () => (/* reexport module object */ vue__WEBPACK_IMPORTED_MODULE_0__),2250/* harmony export */ "Vue2": () => (/* binding */ Vue2),2251/* harmony export */ "isVue2": () => (/* binding */ isVue2),2252/* harmony export */ "isVue3": () => (/* binding */ isVue3),2253/* harmony export */ "install": () => (/* binding */ install)2254/* harmony export */ });2255/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");2256var isVue2 = false2257var isVue3 = true2258var Vue2 = undefined2259function install() {}2260function set(target, key, val) {2261 if (Array.isArray(target)) {2262 target.length = Math.max(target.length, key)2263 target.splice(key, 1, val)2264 return val2265 }2266 target[key] = val2267 return val2268}2269function del(target, key) {2270 if (Array.isArray(target)) {2271 target.splice(key, 1)2272 return2273 }2274 delete target[key]2275}2276/***/ })...

Full Screen

Full Screen

vuex.js

Source:vuex.js Github

copy

Full Screen

1import { T as Transition, a as TransitionGroup, V as VueElement, c as createApp, b as createSSRApp, d as defineCustomElement, e as defineSSRCustomElement, h as hydrate, i as initDirectivesForSSR, r as render, u as useCssModule, f as useCssVars, v as vModelCheckbox, g as vModelDynamic, j as vModelRadio, k as vModelSelect, l as vModelText, m as vShow, w as withKeys, n as withModifiers } from './common/runtime-dom.esm-bundler-bd54d879.js';2import { a3 as EffectScope, a4 as ReactiveEffect, Z as computed, a5 as customRef, a6 as effect, a7 as effectScope, a8 as getCurrentScope, a9 as isProxy, aa as isReactive, ab as isReadonly, ac as isRef, ad as markRaw, ae as onScopeDispose, af as proxyRefs, _ as reactive, ag as readonly, a1 as ref, ah as shallowReactive, ai as shallowReadonly, X as shallowRef, aj as stop, R as toRaw, ak as toRef, al as toRefs, am as triggerRef, Y as unref, s as camelize, u as capitalize, n as normalizeClass, an as normalizeProps, f as normalizeStyle, t as toDisplayString, ao as toHandlerKey, I as BaseTransition, ap as Comment, F as Fragment, aq as KeepAlive, S as Static, ar as Suspense, as as Teleport, at as Text, y as callWithAsyncErrorHandling, au as callWithErrorHandling, av as cloneVNode, aw as compatUtils, c as createBlock, ax as createCommentVNode, d as createElementBlock, a as createBaseVNode, W as createHydrationRenderer, i as createRenderer, ay as createSlots, az as createStaticVNode, g as createTextVNode, e as createVNode, aA as defineAsyncComponent, z as defineComponent, aB as defineEmits, aC as defineExpose, aD as defineProps, aE as devtools, O as getCurrentInstance, T as getTransitionRawChildren, aF as guardReactiveProps, H as h, aG as handleError, aH as initCustomFormatter, $ as inject, aI as isMemoSame, aJ as isRuntimeOnly, aK as isVNode, aL as mergeDefaults, aM as mergeProps, A as nextTick, aN as onActivated, aO as onBeforeMount, aP as onBeforeUnmount, aQ as onBeforeUpdate, aR as onDeactivated, aS as onErrorCaptured, D as onMounted, aT as onRenderTracked, aU as onRenderTriggered, aV as onServerPrefetch, G as onUnmounted, Q as onUpdated, o as openBlock, aW as popScopeId, a0 as provide, aX as pushScopeId, aY as queuePostFlushCb, aZ as registerRuntimeCompiler, b as renderList, a_ as renderSlot, r as resolveComponent, a$ as resolveDirective, b0 as resolveDynamicComponent, b1 as resolveFilter, V as resolveTransitionHooks, b2 as setBlockTracking, b3 as setDevtoolsHook, U as setTransitionHooks, b4 as ssrContextKey, b5 as ssrUtils, b6 as toHandlers, b7 as transformVNodeArgs, b8 as useAttrs, b9 as useSSRContext, ba as useSlots, P as useTransitionState, bb as version$1, bc as warn, a2 as watch, bd as watchEffect, C as watchPostEffect, be as watchSyncEffect, bf as withAsyncContext, w as withCtx, bg as withDefaults, bh as withDirectives, bi as withMemo, bj as withScopeId } from './common/runtime-core.esm-bundler-928c6f2b.js';3const compile = () => {4};5var vue_runtime_esmBundler = /*#__PURE__*/Object.freeze({6 __proto__: null,7 compile: compile,8 EffectScope: EffectScope,9 ReactiveEffect: ReactiveEffect,10 computed: computed,11 customRef: customRef,12 effect: effect,13 effectScope: effectScope,14 getCurrentScope: getCurrentScope,15 isProxy: isProxy,16 isReactive: isReactive,17 isReadonly: isReadonly,18 isRef: isRef,19 markRaw: markRaw,20 onScopeDispose: onScopeDispose,21 proxyRefs: proxyRefs,22 reactive: reactive,23 readonly: readonly,24 ref: ref,25 shallowReactive: shallowReactive,26 shallowReadonly: shallowReadonly,27 shallowRef: shallowRef,28 stop: stop,29 toRaw: toRaw,30 toRef: toRef,31 toRefs: toRefs,32 triggerRef: triggerRef,33 unref: unref,34 camelize: camelize,35 capitalize: capitalize,36 normalizeClass: normalizeClass,37 normalizeProps: normalizeProps,38 normalizeStyle: normalizeStyle,39 toDisplayString: toDisplayString,40 toHandlerKey: toHandlerKey,41 BaseTransition: BaseTransition,42 Comment: Comment,43 Fragment: Fragment,44 KeepAlive: KeepAlive,45 Static: Static,46 Suspense: Suspense,47 Teleport: Teleport,48 Text: Text,49 callWithAsyncErrorHandling: callWithAsyncErrorHandling,50 callWithErrorHandling: callWithErrorHandling,51 cloneVNode: cloneVNode,52 compatUtils: compatUtils,53 createBlock: createBlock,54 createCommentVNode: createCommentVNode,55 createElementBlock: createElementBlock,56 createElementVNode: createBaseVNode,57 createHydrationRenderer: createHydrationRenderer,58 createRenderer: createRenderer,59 createSlots: createSlots,60 createStaticVNode: createStaticVNode,61 createTextVNode: createTextVNode,62 createVNode: createVNode,63 defineAsyncComponent: defineAsyncComponent,64 defineComponent: defineComponent,65 defineEmits: defineEmits,66 defineExpose: defineExpose,67 defineProps: defineProps,68 get devtools () { return devtools; },69 getCurrentInstance: getCurrentInstance,70 getTransitionRawChildren: getTransitionRawChildren,71 guardReactiveProps: guardReactiveProps,72 h: h,73 handleError: handleError,74 initCustomFormatter: initCustomFormatter,75 inject: inject,76 isMemoSame: isMemoSame,77 isRuntimeOnly: isRuntimeOnly,78 isVNode: isVNode,79 mergeDefaults: mergeDefaults,80 mergeProps: mergeProps,81 nextTick: nextTick,82 onActivated: onActivated,83 onBeforeMount: onBeforeMount,84 onBeforeUnmount: onBeforeUnmount,85 onBeforeUpdate: onBeforeUpdate,86 onDeactivated: onDeactivated,87 onErrorCaptured: onErrorCaptured,88 onMounted: onMounted,89 onRenderTracked: onRenderTracked,90 onRenderTriggered: onRenderTriggered,91 onServerPrefetch: onServerPrefetch,92 onUnmounted: onUnmounted,93 onUpdated: onUpdated,94 openBlock: openBlock,95 popScopeId: popScopeId,96 provide: provide,97 pushScopeId: pushScopeId,98 queuePostFlushCb: queuePostFlushCb,99 registerRuntimeCompiler: registerRuntimeCompiler,100 renderList: renderList,101 renderSlot: renderSlot,102 resolveComponent: resolveComponent,103 resolveDirective: resolveDirective,104 resolveDynamicComponent: resolveDynamicComponent,105 resolveFilter: resolveFilter,106 resolveTransitionHooks: resolveTransitionHooks,107 setBlockTracking: setBlockTracking,108 setDevtoolsHook: setDevtoolsHook,109 setTransitionHooks: setTransitionHooks,110 ssrContextKey: ssrContextKey,111 ssrUtils: ssrUtils,112 toHandlers: toHandlers,113 transformVNodeArgs: transformVNodeArgs,114 useAttrs: useAttrs,115 useSSRContext: useSSRContext,116 useSlots: useSlots,117 useTransitionState: useTransitionState,118 version: version$1,119 warn: warn,120 watch: watch,121 watchEffect: watchEffect,122 watchPostEffect: watchPostEffect,123 watchSyncEffect: watchSyncEffect,124 withAsyncContext: withAsyncContext,125 withCtx: withCtx,126 withDefaults: withDefaults,127 withDirectives: withDirectives,128 withMemo: withMemo,129 withScopeId: withScopeId,130 Transition: Transition,131 TransitionGroup: TransitionGroup,132 VueElement: VueElement,133 createApp: createApp,134 createSSRApp: createSSRApp,135 defineCustomElement: defineCustomElement,136 defineSSRCustomElement: defineSSRCustomElement,137 hydrate: hydrate,138 initDirectivesForSSR: initDirectivesForSSR,139 render: render,140 useCssModule: useCssModule,141 useCssVars: useCssVars,142 vModelCheckbox: vModelCheckbox,143 vModelDynamic: vModelDynamic,144 vModelRadio: vModelRadio,145 vModelSelect: vModelSelect,146 vModelText: vModelText,147 vShow: vShow,148 withKeys: withKeys,149 withModifiers: withModifiers150});151function getDevtoolsGlobalHook() {152 return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;153}154function getTarget() {155 // @ts-ignore156 return (typeof navigator !== 'undefined' && typeof window !== 'undefined')157 ? window158 : typeof global !== 'undefined'159 ? global160 : {};161}162const isProxyAvailable = typeof Proxy === 'function';163const HOOK_SETUP = 'devtools-plugin:setup';164const HOOK_PLUGIN_SETTINGS_SET = 'plugin:settings:set';165class ApiProxy {166 constructor(plugin, hook) {167 this.target = null;168 this.targetQueue = [];169 this.onQueue = [];170 this.plugin = plugin;171 this.hook = hook;172 const defaultSettings = {};173 if (plugin.settings) {174 for (const id in plugin.settings) {175 const item = plugin.settings[id];176 defaultSettings[id] = item.defaultValue;177 }178 }179 const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;180 let currentSettings = { ...defaultSettings };181 try {182 const raw = localStorage.getItem(localSettingsSaveId);183 const data = JSON.parse(raw);184 Object.assign(currentSettings, data);185 }186 catch (e) {187 // noop188 }189 this.fallbacks = {190 getSettings() {191 return currentSettings;192 },193 setSettings(value) {194 try {195 localStorage.setItem(localSettingsSaveId, JSON.stringify(value));196 }197 catch (e) {198 // noop199 }200 currentSettings = value;201 }202 };203 hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {204 if (pluginId === this.plugin.id) {205 this.fallbacks.setSettings(value);206 }207 });208 this.proxiedOn = new Proxy({}, {209 get: (_target, prop) => {210 if (this.target) {211 return this.target.on[prop];212 }213 else {214 return (...args) => {215 this.onQueue.push({216 method: prop,217 args218 });219 };220 }221 }222 });223 this.proxiedTarget = new Proxy({}, {224 get: (_target, prop) => {225 if (this.target) {226 return this.target[prop];227 }228 else if (prop === 'on') {229 return this.proxiedOn;230 }231 else if (Object.keys(this.fallbacks).includes(prop)) {232 return (...args) => {233 this.targetQueue.push({234 method: prop,235 args,236 resolve: () => { }237 });238 return this.fallbacks[prop](...args);239 };240 }241 else {242 return (...args) => {243 return new Promise(resolve => {244 this.targetQueue.push({245 method: prop,246 args,247 resolve248 });249 });250 };251 }252 }253 });254 }255 async setRealTarget(target) {256 this.target = target;257 for (const item of this.onQueue) {258 this.target.on[item.method](...item.args);259 }260 for (const item of this.targetQueue) {261 item.resolve(await this.target[item.method](...item.args));262 }263 }264}265function setupDevtoolsPlugin(pluginDescriptor, setupFn) {266 const target = getTarget();267 const hook = getDevtoolsGlobalHook();268 const enableProxy = isProxyAvailable && pluginDescriptor.enableEarlyProxy;269 if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {270 hook.emit(HOOK_SETUP, pluginDescriptor, setupFn);271 }272 else {273 const proxy = enableProxy ? new ApiProxy(pluginDescriptor, hook) : null;274 const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];275 list.push({276 pluginDescriptor,277 setupFn,278 proxy279 });280 if (proxy)281 setupFn(proxy.proxiedTarget);282 }283}284var esm = /*#__PURE__*/Object.freeze({285 __proto__: null,286 setupDevtoolsPlugin: setupDevtoolsPlugin287});288var storeKey = 'store';289function useStore (key) {290 if ( key === void 0 ) key = null;291 return vue_runtime_esmBundler.inject(key !== null ? key : storeKey)292}293/**294 * Get the first item that pass the test295 * by second argument function296 *297 * @param {Array} list298 * @param {Function} f299 * @return {*}300 */301function find (list, f) {302 return list.filter(f)[0]303}304/**305 * Deep copy the given object considering circular structure.306 * This function caches all nested objects and its copies.307 * If it detects circular structure, use cached copy to avoid infinite loop.308 *309 * @param {*} obj310 * @param {Array<Object>} cache311 * @return {*}312 */313function deepCopy (obj, cache) {314 if ( cache === void 0 ) cache = [];315 // just return if obj is immutable value316 if (obj === null || typeof obj !== 'object') {317 return obj318 }319 // if obj is hit, it is in circular structure320 var hit = find(cache, function (c) { return c.original === obj; });321 if (hit) {322 return hit.copy323 }324 var copy = Array.isArray(obj) ? [] : {};325 // put the copy into cache at first326 // because we want to refer it in recursive deepCopy327 cache.push({328 original: obj,329 copy: copy330 });331 Object.keys(obj).forEach(function (key) {332 copy[key] = deepCopy(obj[key], cache);333 });334 return copy335}336/**337 * forEach for object338 */339function forEachValue (obj, fn) {340 Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });341}342function isObject (obj) {343 return obj !== null && typeof obj === 'object'344}345function isPromise (val) {346 return val && typeof val.then === 'function'347}348function partial (fn, arg) {349 return function () {350 return fn(arg)351 }352}353function genericSubscribe (fn, subs, options) {354 if (subs.indexOf(fn) < 0) {355 options && options.prepend356 ? subs.unshift(fn)357 : subs.push(fn);358 }359 return function () {360 var i = subs.indexOf(fn);361 if (i > -1) {362 subs.splice(i, 1);363 }364 }365}366function resetStore (store, hot) {367 store._actions = Object.create(null);368 store._mutations = Object.create(null);369 store._wrappedGetters = Object.create(null);370 store._modulesNamespaceMap = Object.create(null);371 var state = store.state;372 // init all modules373 installModule(store, state, [], store._modules.root, true);374 // reset state375 resetStoreState(store, state, hot);376}377function resetStoreState (store, state, hot) {378 var oldState = store._state;379 // bind store public getters380 store.getters = {};381 // reset local getters cache382 store._makeLocalGettersCache = Object.create(null);383 var wrappedGetters = store._wrappedGetters;384 var computedObj = {};385 forEachValue(wrappedGetters, function (fn, key) {386 // use computed to leverage its lazy-caching mechanism387 // direct inline function use will lead to closure preserving oldState.388 // using partial to return function with only arguments preserved in closure environment.389 computedObj[key] = partial(fn, store);390 Object.defineProperty(store.getters, key, {391 // TODO: use `computed` when it's possible. at the moment we can't due to392 // https://github.com/vuejs/vuex/pull/1883393 get: function () { return computedObj[key](); },394 enumerable: true // for local getters395 });396 });397 store._state = vue_runtime_esmBundler.reactive({398 data: state399 });400 // enable strict mode for new state401 if (store.strict) {402 enableStrictMode(store);403 }404 if (oldState) {405 if (hot) {406 // dispatch changes in all subscribed watchers407 // to force getter re-evaluation for hot reloading.408 store._withCommit(function () {409 oldState.data = null;410 });411 }412 }413}414function installModule (store, rootState, path, module, hot) {415 var isRoot = !path.length;416 var namespace = store._modules.getNamespace(path);417 // register in namespace map418 if (module.namespaced) {419 if (store._modulesNamespaceMap[namespace] && ("production" !== 'production')) {420 console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));421 }422 store._modulesNamespaceMap[namespace] = module;423 }424 // set state425 if (!isRoot && !hot) {426 var parentState = getNestedState(rootState, path.slice(0, -1));427 var moduleName = path[path.length - 1];428 store._withCommit(function () {429 parentState[moduleName] = module.state;430 });431 }432 var local = module.context = makeLocalContext(store, namespace, path);433 module.forEachMutation(function (mutation, key) {434 var namespacedType = namespace + key;435 registerMutation(store, namespacedType, mutation, local);436 });437 module.forEachAction(function (action, key) {438 var type = action.root ? key : namespace + key;439 var handler = action.handler || action;440 registerAction(store, type, handler, local);441 });442 module.forEachGetter(function (getter, key) {443 var namespacedType = namespace + key;444 registerGetter(store, namespacedType, getter, local);445 });446 module.forEachChild(function (child, key) {447 installModule(store, rootState, path.concat(key), child, hot);448 });449}450/**451 * make localized dispatch, commit, getters and state452 * if there is no namespace, just use root ones453 */454function makeLocalContext (store, namespace, path) {455 var noNamespace = namespace === '';456 var local = {457 dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {458 var args = unifyObjectStyle(_type, _payload, _options);459 var payload = args.payload;460 var options = args.options;461 var type = args.type;462 if (!options || !options.root) {463 type = namespace + type;464 }465 return store.dispatch(type, payload)466 },467 commit: noNamespace ? store.commit : function (_type, _payload, _options) {468 var args = unifyObjectStyle(_type, _payload, _options);469 var payload = args.payload;470 var options = args.options;471 var type = args.type;472 if (!options || !options.root) {473 type = namespace + type;474 }475 store.commit(type, payload, options);476 }477 };478 // getters and state object must be gotten lazily479 // because they will be changed by state update480 Object.defineProperties(local, {481 getters: {482 get: noNamespace483 ? function () { return store.getters; }484 : function () { return makeLocalGetters(store, namespace); }485 },486 state: {487 get: function () { return getNestedState(store.state, path); }488 }489 });490 return local491}492function makeLocalGetters (store, namespace) {493 if (!store._makeLocalGettersCache[namespace]) {494 var gettersProxy = {};495 var splitPos = namespace.length;496 Object.keys(store.getters).forEach(function (type) {497 // skip if the target getter is not match this namespace498 if (type.slice(0, splitPos) !== namespace) { return }499 // extract local getter type500 var localType = type.slice(splitPos);501 // Add a port to the getters proxy.502 // Define as getter property because503 // we do not want to evaluate the getters in this time.504 Object.defineProperty(gettersProxy, localType, {505 get: function () { return store.getters[type]; },506 enumerable: true507 });508 });509 store._makeLocalGettersCache[namespace] = gettersProxy;510 }511 return store._makeLocalGettersCache[namespace]512}513function registerMutation (store, type, handler, local) {514 var entry = store._mutations[type] || (store._mutations[type] = []);515 entry.push(function wrappedMutationHandler (payload) {516 handler.call(store, local.state, payload);517 });518}519function registerAction (store, type, handler, local) {520 var entry = store._actions[type] || (store._actions[type] = []);521 entry.push(function wrappedActionHandler (payload) {522 var res = handler.call(store, {523 dispatch: local.dispatch,524 commit: local.commit,525 getters: local.getters,526 state: local.state,527 rootGetters: store.getters,528 rootState: store.state529 }, payload);530 if (!isPromise(res)) {531 res = Promise.resolve(res);532 }533 if (store._devtoolHook) {534 return res.catch(function (err) {535 store._devtoolHook.emit('vuex:error', err);536 throw err537 })538 } else {539 return res540 }541 });542}543function registerGetter (store, type, rawGetter, local) {544 if (store._wrappedGetters[type]) {545 return546 }547 store._wrappedGetters[type] = function wrappedGetter (store) {548 return rawGetter(549 local.state, // local state550 local.getters, // local getters551 store.state, // root state552 store.getters // root getters553 )554 };555}556function enableStrictMode (store) {557 vue_runtime_esmBundler.watch(function () { return store._state.data; }, function () {558 }, { deep: true, flush: 'sync' });559}560function getNestedState (state, path) {561 return path.reduce(function (state, key) { return state[key]; }, state)562}563function unifyObjectStyle (type, payload, options) {564 if (isObject(type) && type.type) {565 options = payload;566 payload = type;567 type = type.type;568 }569 return { type: type, payload: payload, options: options }570}571var LABEL_VUEX_BINDINGS = 'vuex bindings';572var MUTATIONS_LAYER_ID = 'vuex:mutations';573var ACTIONS_LAYER_ID = 'vuex:actions';574var INSPECTOR_ID = 'vuex';575var actionId = 0;576function addDevtools (app, store) {577 esm.setupDevtoolsPlugin(578 {579 id: 'org.vuejs.vuex',580 app: app,581 label: 'Vuex',582 homepage: 'https://next.vuex.vuejs.org/',583 logo: 'https://vuejs.org/images/icons/favicon-96x96.png',584 packageName: 'vuex',585 componentStateTypes: [LABEL_VUEX_BINDINGS]586 },587 function (api) {588 api.addTimelineLayer({589 id: MUTATIONS_LAYER_ID,590 label: 'Vuex Mutations',591 color: COLOR_LIME_500592 });593 api.addTimelineLayer({594 id: ACTIONS_LAYER_ID,595 label: 'Vuex Actions',596 color: COLOR_LIME_500597 });598 api.addInspector({599 id: INSPECTOR_ID,600 label: 'Vuex',601 icon: 'storage',602 treeFilterPlaceholder: 'Filter stores...'603 });604 api.on.getInspectorTree(function (payload) {605 if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {606 if (payload.filter) {607 var nodes = [];608 flattenStoreForInspectorTree(nodes, store._modules.root, payload.filter, '');609 payload.rootNodes = nodes;610 } else {611 payload.rootNodes = [612 formatStoreForInspectorTree(store._modules.root, '')613 ];614 }615 }616 });617 api.on.getInspectorState(function (payload) {618 if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {619 var modulePath = payload.nodeId;620 makeLocalGetters(store, modulePath);621 payload.state = formatStoreForInspectorState(622 getStoreModule(store._modules, modulePath),623 modulePath === 'root' ? store.getters : store._makeLocalGettersCache,624 modulePath625 );626 }627 });628 api.on.editInspectorState(function (payload) {629 if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {630 var modulePath = payload.nodeId;631 var path = payload.path;632 if (modulePath !== 'root') {633 path = modulePath.split('/').filter(Boolean).concat( path);634 }635 store._withCommit(function () {636 payload.set(store._state.data, path, payload.state.value);637 });638 }639 });640 store.subscribe(function (mutation, state) {641 var data = {};642 if (mutation.payload) {643 data.payload = mutation.payload;644 }645 data.state = state;646 api.notifyComponentUpdate();647 api.sendInspectorTree(INSPECTOR_ID);648 api.sendInspectorState(INSPECTOR_ID);649 api.addTimelineEvent({650 layerId: MUTATIONS_LAYER_ID,651 event: {652 time: Date.now(),653 title: mutation.type,654 data: data655 }656 });657 });658 store.subscribeAction({659 before: function (action, state) {660 var data = {};661 if (action.payload) {662 data.payload = action.payload;663 }664 action._id = actionId++;665 action._time = Date.now();666 data.state = state;667 api.addTimelineEvent({668 layerId: ACTIONS_LAYER_ID,669 event: {670 time: action._time,671 title: action.type,672 groupId: action._id,673 subtitle: 'start',674 data: data675 }676 });677 },678 after: function (action, state) {679 var data = {};680 var duration = Date.now() - action._time;681 data.duration = {682 _custom: {683 type: 'duration',684 display: (duration + "ms"),685 tooltip: 'Action duration',686 value: duration687 }688 };689 if (action.payload) {690 data.payload = action.payload;691 }692 data.state = state;693 api.addTimelineEvent({694 layerId: ACTIONS_LAYER_ID,695 event: {696 time: Date.now(),697 title: action.type,698 groupId: action._id,699 subtitle: 'end',700 data: data701 }702 });703 }704 });705 }706 );707}708// extracted from tailwind palette709var COLOR_LIME_500 = 0x84cc16;710var COLOR_DARK = 0x666666;711var COLOR_WHITE = 0xffffff;712var TAG_NAMESPACED = {713 label: 'namespaced',714 textColor: COLOR_WHITE,715 backgroundColor: COLOR_DARK716};717/**718 * @param {string} path719 */720function extractNameFromPath (path) {721 return path && path !== 'root' ? path.split('/').slice(-2, -1)[0] : 'Root'722}723/**724 * @param {*} module725 * @return {import('@vue/devtools-api').CustomInspectorNode}726 */727function formatStoreForInspectorTree (module, path) {728 return {729 id: path || 'root',730 // all modules end with a `/`, we want the last segment only731 // cart/ -> cart732 // nested/cart/ -> cart733 label: extractNameFromPath(path),734 tags: module.namespaced ? [TAG_NAMESPACED] : [],735 children: Object.keys(module._children).map(function (moduleName) { return formatStoreForInspectorTree(736 module._children[moduleName],737 path + moduleName + '/'738 ); }739 )740 }741}742/**743 * @param {import('@vue/devtools-api').CustomInspectorNode[]} result744 * @param {*} module745 * @param {string} filter746 * @param {string} path747 */748function flattenStoreForInspectorTree (result, module, filter, path) {749 if (path.includes(filter)) {750 result.push({751 id: path || 'root',752 label: path.endsWith('/') ? path.slice(0, path.length - 1) : path || 'Root',753 tags: module.namespaced ? [TAG_NAMESPACED] : []754 });755 }756 Object.keys(module._children).forEach(function (moduleName) {757 flattenStoreForInspectorTree(result, module._children[moduleName], filter, path + moduleName + '/');758 });759}760/**761 * @param {*} module762 * @return {import('@vue/devtools-api').CustomInspectorState}763 */764function formatStoreForInspectorState (module, getters, path) {765 getters = path === 'root' ? getters : getters[path];766 var gettersKeys = Object.keys(getters);767 var storeState = {768 state: Object.keys(module.state).map(function (key) { return ({769 key: key,770 editable: true,771 value: module.state[key]772 }); })773 };774 if (gettersKeys.length) {775 var tree = transformPathsToObjectTree(getters);776 storeState.getters = Object.keys(tree).map(function (key) { return ({777 key: key.endsWith('/') ? extractNameFromPath(key) : key,778 editable: false,779 value: canThrow(function () { return tree[key]; })780 }); });781 }782 return storeState783}784function transformPathsToObjectTree (getters) {785 var result = {};786 Object.keys(getters).forEach(function (key) {787 var path = key.split('/');788 if (path.length > 1) {789 var target = result;790 var leafKey = path.pop();791 path.forEach(function (p) {792 if (!target[p]) {793 target[p] = {794 _custom: {795 value: {},796 display: p,797 tooltip: 'Module',798 abstract: true799 }800 };801 }802 target = target[p]._custom.value;803 });804 target[leafKey] = canThrow(function () { return getters[key]; });805 } else {806 result[key] = canThrow(function () { return getters[key]; });807 }808 });809 return result810}811function getStoreModule (moduleMap, path) {812 var names = path.split('/').filter(function (n) { return n; });813 return names.reduce(814 function (module, moduleName, i) {815 var child = module[moduleName];816 if (!child) {817 throw new Error(("Missing module \"" + moduleName + "\" for path \"" + path + "\"."))818 }819 return i === names.length - 1 ? child : child._children820 },821 path === 'root' ? moduleMap : moduleMap.root._children822 )823}824function canThrow (cb) {825 try {826 return cb()827 } catch (e) {828 return e829 }830}831// Base data struct for store's module, package with some attribute and method832var Module = function Module (rawModule, runtime) {833 this.runtime = runtime;834 // Store some children item835 this._children = Object.create(null);836 // Store the origin module object which passed by programmer837 this._rawModule = rawModule;838 var rawState = rawModule.state;839 // Store the origin module's state840 this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};841};842var prototypeAccessors$1 = { namespaced: { configurable: true } };843prototypeAccessors$1.namespaced.get = function () {844 return !!this._rawModule.namespaced845};846Module.prototype.addChild = function addChild (key, module) {847 this._children[key] = module;848};849Module.prototype.removeChild = function removeChild (key) {850 delete this._children[key];851};852Module.prototype.getChild = function getChild (key) {853 return this._children[key]854};855Module.prototype.hasChild = function hasChild (key) {856 return key in this._children857};858Module.prototype.update = function update (rawModule) {859 this._rawModule.namespaced = rawModule.namespaced;860 if (rawModule.actions) {861 this._rawModule.actions = rawModule.actions;862 }863 if (rawModule.mutations) {864 this._rawModule.mutations = rawModule.mutations;865 }866 if (rawModule.getters) {867 this._rawModule.getters = rawModule.getters;868 }869};870Module.prototype.forEachChild = function forEachChild (fn) {871 forEachValue(this._children, fn);872};873Module.prototype.forEachGetter = function forEachGetter (fn) {874 if (this._rawModule.getters) {875 forEachValue(this._rawModule.getters, fn);876 }877};878Module.prototype.forEachAction = function forEachAction (fn) {879 if (this._rawModule.actions) {880 forEachValue(this._rawModule.actions, fn);881 }882};883Module.prototype.forEachMutation = function forEachMutation (fn) {884 if (this._rawModule.mutations) {885 forEachValue(this._rawModule.mutations, fn);886 }887};888Object.defineProperties( Module.prototype, prototypeAccessors$1 );889var ModuleCollection = function ModuleCollection (rawRootModule) {890 // register root module (Vuex.Store options)891 this.register([], rawRootModule, false);892};893ModuleCollection.prototype.get = function get (path) {894 return path.reduce(function (module, key) {895 return module.getChild(key)896 }, this.root)897};898ModuleCollection.prototype.getNamespace = function getNamespace (path) {899 var module = this.root;900 return path.reduce(function (namespace, key) {901 module = module.getChild(key);902 return namespace + (module.namespaced ? key + '/' : '')903 }, '')904};905ModuleCollection.prototype.update = function update$1 (rawRootModule) {906 update([], this.root, rawRootModule);907};908ModuleCollection.prototype.register = function register (path, rawModule, runtime) {909 var this$1$1 = this;910 if ( runtime === void 0 ) runtime = true;911 var newModule = new Module(rawModule, runtime);912 if (path.length === 0) {913 this.root = newModule;914 } else {915 var parent = this.get(path.slice(0, -1));916 parent.addChild(path[path.length - 1], newModule);917 }918 // register nested modules919 if (rawModule.modules) {920 forEachValue(rawModule.modules, function (rawChildModule, key) {921 this$1$1.register(path.concat(key), rawChildModule, runtime);922 });923 }924};925ModuleCollection.prototype.unregister = function unregister (path) {926 var parent = this.get(path.slice(0, -1));927 var key = path[path.length - 1];928 var child = parent.getChild(key);929 if (!child) {930 return931 }932 if (!child.runtime) {933 return934 }935 parent.removeChild(key);936};937ModuleCollection.prototype.isRegistered = function isRegistered (path) {938 var parent = this.get(path.slice(0, -1));939 var key = path[path.length - 1];940 if (parent) {941 return parent.hasChild(key)942 }943 return false944};945function update (path, targetModule, newModule) {946 // update target module947 targetModule.update(newModule);948 // update nested modules949 if (newModule.modules) {950 for (var key in newModule.modules) {951 if (!targetModule.getChild(key)) {952 return953 }954 update(955 path.concat(key),956 targetModule.getChild(key),957 newModule.modules[key]958 );959 }960 }961}962function createStore (options) {963 return new Store(options)964}965var Store = function Store (options) {966 var this$1$1 = this;967 if ( options === void 0 ) options = {};968 var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];969 var strict = options.strict; if ( strict === void 0 ) strict = false;970 var devtools = options.devtools;971 // store internal state972 this._committing = false;973 this._actions = Object.create(null);974 this._actionSubscribers = [];975 this._mutations = Object.create(null);976 this._wrappedGetters = Object.create(null);977 this._modules = new ModuleCollection(options);978 this._modulesNamespaceMap = Object.create(null);979 this._subscribers = [];980 this._makeLocalGettersCache = Object.create(null);981 this._devtools = devtools;982 // bind commit and dispatch to self983 var store = this;984 var ref = this;985 var dispatch = ref.dispatch;986 var commit = ref.commit;987 this.dispatch = function boundDispatch (type, payload) {988 return dispatch.call(store, type, payload)989 };990 this.commit = function boundCommit (type, payload, options) {991 return commit.call(store, type, payload, options)992 };993 // strict mode994 this.strict = strict;995 var state = this._modules.root.state;996 // init root module.997 // this also recursively registers all sub-modules998 // and collects all module getters inside this._wrappedGetters999 installModule(this, state, [], this._modules.root);1000 // initialize the store state, which is responsible for the reactivity1001 // (also registers _wrappedGetters as computed properties)1002 resetStoreState(this, state);1003 // apply plugins1004 plugins.forEach(function (plugin) { return plugin(this$1$1); });1005};1006var prototypeAccessors = { state: { configurable: true } };1007Store.prototype.install = function install (app, injectKey) {1008 app.provide(injectKey || storeKey, this);1009 app.config.globalProperties.$store = this;1010 var useDevtools = this._devtools !== undefined1011 ? this._devtools1012 : false;1013 if (useDevtools) {1014 addDevtools(app, this);1015 }1016};1017prototypeAccessors.state.get = function () {1018 return this._state.data1019};1020prototypeAccessors.state.set = function (v) {1021};1022Store.prototype.commit = function commit (_type, _payload, _options) {1023 var this$1$1 = this;1024 // check object-style commit1025 var ref = unifyObjectStyle(_type, _payload, _options);1026 var type = ref.type;1027 var payload = ref.payload;1028 var mutation = { type: type, payload: payload };1029 var entry = this._mutations[type];1030 if (!entry) {1031 return1032 }1033 this._withCommit(function () {1034 entry.forEach(function commitIterator (handler) {1035 handler(payload);1036 });1037 });1038 this._subscribers1039 .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe1040 .forEach(function (sub) { return sub(mutation, this$1$1.state); });1041};1042Store.prototype.dispatch = function dispatch (_type, _payload) {1043 var this$1$1 = this;1044 // check object-style dispatch1045 var ref = unifyObjectStyle(_type, _payload);1046 var type = ref.type;1047 var payload = ref.payload;1048 var action = { type: type, payload: payload };1049 var entry = this._actions[type];1050 if (!entry) {1051 return1052 }1053 try {1054 this._actionSubscribers1055 .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe1056 .filter(function (sub) { return sub.before; })1057 .forEach(function (sub) { return sub.before(action, this$1$1.state); });1058 } catch (e) {1059 }1060 var result = entry.length > 11061 ? Promise.all(entry.map(function (handler) { return handler(payload); }))1062 : entry[0](payload);1063 return new Promise(function (resolve, reject) {1064 result.then(function (res) {1065 try {1066 this$1$1._actionSubscribers1067 .filter(function (sub) { return sub.after; })1068 .forEach(function (sub) { return sub.after(action, this$1$1.state); });1069 } catch (e) {1070 }1071 resolve(res);1072 }, function (error) {1073 try {1074 this$1$1._actionSubscribers1075 .filter(function (sub) { return sub.error; })1076 .forEach(function (sub) { return sub.error(action, this$1$1.state, error); });1077 } catch (e) {1078 }1079 reject(error);1080 });1081 })1082};1083Store.prototype.subscribe = function subscribe (fn, options) {1084 return genericSubscribe(fn, this._subscribers, options)1085};1086Store.prototype.subscribeAction = function subscribeAction (fn, options) {1087 var subs = typeof fn === 'function' ? { before: fn } : fn;1088 return genericSubscribe(subs, this._actionSubscribers, options)1089};1090Store.prototype.watch = function watch$1 (getter, cb, options) {1091 var this$1$1 = this;1092 return vue_runtime_esmBundler.watch(function () { return getter(this$1$1.state, this$1$1.getters); }, cb, Object.assign({}, options))1093};1094Store.prototype.replaceState = function replaceState (state) {1095 var this$1$1 = this;1096 this._withCommit(function () {1097 this$1$1._state.data = state;1098 });1099};1100Store.prototype.registerModule = function registerModule (path, rawModule, options) {1101 if ( options === void 0 ) options = {};1102 if (typeof path === 'string') { path = [path]; }1103 this._modules.register(path, rawModule);1104 installModule(this, this.state, path, this._modules.get(path), options.preserveState);1105 // reset store to update getters...1106 resetStoreState(this, this.state);1107};1108Store.prototype.unregisterModule = function unregisterModule (path) {1109 var this$1$1 = this;1110 if (typeof path === 'string') { path = [path]; }1111 this._modules.unregister(path);1112 this._withCommit(function () {1113 var parentState = getNestedState(this$1$1.state, path.slice(0, -1));1114 delete parentState[path[path.length - 1]];1115 });1116 resetStore(this);1117};1118Store.prototype.hasModule = function hasModule (path) {1119 if (typeof path === 'string') { path = [path]; }1120 return this._modules.isRegistered(path)1121};1122Store.prototype.hotUpdate = function hotUpdate (newOptions) {1123 this._modules.update(newOptions);1124 resetStore(this, true);1125};1126Store.prototype._withCommit = function _withCommit (fn) {1127 var committing = this._committing;1128 this._committing = true;1129 fn();1130 this._committing = committing;1131};1132Object.defineProperties( Store.prototype, prototypeAccessors );1133/**1134 * Reduce the code which written in Vue.js for getting the state.1135 * @param {String} [namespace] - Module's namespace1136 * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.1137 * @param {Object}1138 */1139var mapState = normalizeNamespace(function (namespace, states) {1140 var res = {};1141 normalizeMap(states).forEach(function (ref) {1142 var key = ref.key;1143 var val = ref.val;1144 res[key] = function mappedState () {1145 var state = this.$store.state;1146 var getters = this.$store.getters;1147 if (namespace) {1148 var module = getModuleByNamespace(this.$store, 'mapState', namespace);1149 if (!module) {1150 return1151 }1152 state = module.context.state;1153 getters = module.context.getters;1154 }1155 return typeof val === 'function'1156 ? val.call(this, state, getters)1157 : state[val]1158 };1159 // mark vuex getter for devtools1160 res[key].vuex = true;1161 });1162 return res1163});1164/**1165 * Reduce the code which written in Vue.js for committing the mutation1166 * @param {String} [namespace] - Module's namespace1167 * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.1168 * @return {Object}1169 */1170var mapMutations = normalizeNamespace(function (namespace, mutations) {1171 var res = {};1172 normalizeMap(mutations).forEach(function (ref) {1173 var key = ref.key;1174 var val = ref.val;1175 res[key] = function mappedMutation () {1176 var args = [], len = arguments.length;1177 while ( len-- ) args[ len ] = arguments[ len ];1178 // Get the commit method from store1179 var commit = this.$store.commit;1180 if (namespace) {1181 var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);1182 if (!module) {1183 return1184 }1185 commit = module.context.commit;1186 }1187 return typeof val === 'function'1188 ? val.apply(this, [commit].concat(args))1189 : commit.apply(this.$store, [val].concat(args))1190 };1191 });1192 return res1193});1194/**1195 * Reduce the code which written in Vue.js for getting the getters1196 * @param {String} [namespace] - Module's namespace1197 * @param {Object|Array} getters1198 * @return {Object}1199 */1200var mapGetters = normalizeNamespace(function (namespace, getters) {1201 var res = {};1202 normalizeMap(getters).forEach(function (ref) {1203 var key = ref.key;1204 var val = ref.val;1205 // The namespace has been mutated by normalizeNamespace1206 val = namespace + val;1207 res[key] = function mappedGetter () {1208 if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {1209 return1210 }1211 return this.$store.getters[val]1212 };1213 // mark vuex getter for devtools1214 res[key].vuex = true;1215 });1216 return res1217});1218/**1219 * Reduce the code which written in Vue.js for dispatch the action1220 * @param {String} [namespace] - Module's namespace1221 * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.1222 * @return {Object}1223 */1224var mapActions = normalizeNamespace(function (namespace, actions) {1225 var res = {};1226 normalizeMap(actions).forEach(function (ref) {1227 var key = ref.key;1228 var val = ref.val;1229 res[key] = function mappedAction () {1230 var args = [], len = arguments.length;1231 while ( len-- ) args[ len ] = arguments[ len ];1232 // get dispatch function from store1233 var dispatch = this.$store.dispatch;1234 if (namespace) {1235 var module = getModuleByNamespace(this.$store, 'mapActions', namespace);1236 if (!module) {1237 return1238 }1239 dispatch = module.context.dispatch;1240 }1241 return typeof val === 'function'1242 ? val.apply(this, [dispatch].concat(args))1243 : dispatch.apply(this.$store, [val].concat(args))1244 };1245 });1246 return res1247});1248/**1249 * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object1250 * @param {String} namespace1251 * @return {Object}1252 */1253var createNamespacedHelpers = function (namespace) { return ({1254 mapState: mapState.bind(null, namespace),1255 mapGetters: mapGetters.bind(null, namespace),1256 mapMutations: mapMutations.bind(null, namespace),1257 mapActions: mapActions.bind(null, namespace)1258}); };1259/**1260 * Normalize the map1261 * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]1262 * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]1263 * @param {Array|Object} map1264 * @return {Object}1265 */1266function normalizeMap (map) {1267 if (!isValidMap(map)) {1268 return []1269 }1270 return Array.isArray(map)1271 ? map.map(function (key) { return ({ key: key, val: key }); })1272 : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })1273}1274/**1275 * Validate whether given map is valid or not1276 * @param {*} map1277 * @return {Boolean}1278 */1279function isValidMap (map) {1280 return Array.isArray(map) || isObject(map)1281}1282/**1283 * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.1284 * @param {Function} fn1285 * @return {Function}1286 */1287function normalizeNamespace (fn) {1288 return function (namespace, map) {1289 if (typeof namespace !== 'string') {1290 map = namespace;1291 namespace = '';1292 } else if (namespace.charAt(namespace.length - 1) !== '/') {1293 namespace += '/';1294 }1295 return fn(namespace, map)1296 }1297}1298/**1299 * Search a special module from store by namespace. if module not exist, print error message.1300 * @param {Object} store1301 * @param {String} helper1302 * @param {String} namespace1303 * @return {Object}1304 */1305function getModuleByNamespace (store, helper, namespace) {1306 var module = store._modulesNamespaceMap[namespace];1307 return module1308}1309// Credits: borrowed code from fcomb/redux-logger1310function createLogger (ref) {1311 if ( ref === void 0 ) ref = {};1312 var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;1313 var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };1314 var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };1315 var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };1316 var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };1317 var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };1318 var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;1319 var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;1320 var logger = ref.logger; if ( logger === void 0 ) logger = console;1321 return function (store) {1322 var prevState = deepCopy(store.state);1323 if (typeof logger === 'undefined') {1324 return1325 }1326 if (logMutations) {1327 store.subscribe(function (mutation, state) {1328 var nextState = deepCopy(state);1329 if (filter(mutation, prevState, nextState)) {1330 var formattedTime = getFormattedTime();1331 var formattedMutation = mutationTransformer(mutation);1332 var message = "mutation " + (mutation.type) + formattedTime;1333 startMessage(logger, message, collapsed);1334 logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));1335 logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);1336 logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));1337 endMessage(logger);1338 }1339 prevState = nextState;1340 });1341 }1342 if (logActions) {1343 store.subscribeAction(function (action, state) {1344 if (actionFilter(action, state)) {1345 var formattedTime = getFormattedTime();1346 var formattedAction = actionTransformer(action);1347 var message = "action " + (action.type) + formattedTime;1348 startMessage(logger, message, collapsed);1349 logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);1350 endMessage(logger);1351 }1352 });1353 }1354 }1355}1356function startMessage (logger, message, collapsed) {1357 var startMessage = collapsed1358 ? logger.groupCollapsed1359 : logger.group;1360 // render1361 try {1362 startMessage.call(logger, message);1363 } catch (e) {1364 logger.log(message);1365 }1366}1367function endMessage (logger) {1368 try {1369 logger.groupEnd();1370 } catch (e) {1371 logger.log('—— log end ——');1372 }1373}1374function getFormattedTime () {1375 var time = new Date();1376 return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))1377}1378function repeat (str, times) {1379 return (new Array(times + 1)).join(str)1380}1381function pad (num, maxLength) {1382 return repeat('0', maxLength - num.toString().length) + num1383}1384var index_cjs = {1385 version: '4.0.2',1386 Store: Store,1387 storeKey: storeKey,1388 createStore: createStore,1389 useStore: useStore,1390 mapState: mapState,1391 mapMutations: mapMutations,1392 mapGetters: mapGetters,1393 mapActions: mapActions,1394 createNamespacedHelpers: createNamespacedHelpers,1395 createLogger: createLogger1396};1397var vuex_cjs = index_cjs;1398const {1399 version,1400 Store: Store$1,1401 storeKey: storeKey$1,1402 createStore: createStore$1,1403 install,1404 useStore: useStore$1,1405 mapState: mapState$1,1406 mapMutations: mapMutations$1,1407 mapGetters: mapGetters$1,1408 mapActions: mapActions$1,1409 createNamespacedHelpers: createNamespacedHelpers$1,1410 createLogger: createLogger$11411} = vuex_cjs;...

Full Screen

Full Screen

note-generate-code.js

Source:note-generate-code.js Github

copy

Full Screen

1const FRAGMENT = Symbol( `Fragment` );2const TELEPORT = Symbol( `Teleport` );3const SUSPENSE = Symbol( `Suspense` );4const KEEP_ALIVE = Symbol( `KeepAlive` );5const BASE_TRANSITION = Symbol( `BaseTransition` );6const OPEN_BLOCK = Symbol( `openBlock` );7const CREATE_BLOCK = Symbol( `createBlock` );8const CREATE_VNODE = Symbol( `createVNode` );9const CREATE_COMMENT = Symbol( `createCommentVNode` );10const CREATE_TEXT = Symbol( `createTextVNode` );11const CREATE_STATIC = Symbol( `createStaticVNode` );12const RESOLVE_COMPONENT = Symbol( `resolveComponent` );13const RESOLVE_DYNAMIC_COMPONENT = Symbol( `resolveDynamicComponent` );14const RESOLVE_DIRECTIVE = Symbol( `resolveDirective` );15const WITH_DIRECTIVES = Symbol( `withDirectives` );16const RENDER_LIST = Symbol( `renderList` );17const RENDER_SLOT = Symbol( `renderSlot` );18const CREATE_SLOTS = Symbol( `createSlots` );19const TO_DISPLAY_STRING = Symbol( `toDisplayString` );20const MERGE_PROPS = Symbol( `mergeProps` );21const TO_HANDLERS = Symbol( `toHandlers` );22const CAMELIZE = Symbol( `camelize` );23const CAPITALIZE = Symbol( `capitalize` );24const SET_BLOCK_TRACKING = Symbol( `setBlockTracking` );25const PUSH_SCOPE_ID = Symbol( `pushScopeId` );26const POP_SCOPE_ID = Symbol( `popScopeId` );27const WITH_SCOPE_ID = Symbol( `withScopeId` );28const WITH_CTX = Symbol( `withCtx` );29const helperNameMap = {30 [FRAGMENT]: `Fragment`,31 [TELEPORT]: `Teleport`,32 [SUSPENSE]: `Suspense`,33 [KEEP_ALIVE]: `KeepAlive`,34 [BASE_TRANSITION]: `BaseTransition`,35 [OPEN_BLOCK]: `openBlock`,36 [CREATE_BLOCK]: `createBlock`,37 [CREATE_VNODE]: `_createVNode`,38 [CREATE_COMMENT]: `createCommentVNode`,39 [CREATE_TEXT]: `createTextVNode`,40 [CREATE_STATIC]: `createStaticVNode`,41 [RESOLVE_COMPONENT]: `resolveComponent`,42 [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,43 [RESOLVE_DIRECTIVE]: `resolveDirective`,44 [WITH_DIRECTIVES]: `withDirectives`,45 [RENDER_LIST]: `renderList`,46 [RENDER_SLOT]: `renderSlot`,47 [CREATE_SLOTS]: `createSlots`,48 [TO_DISPLAY_STRING]: `toDisplayString`,49 [MERGE_PROPS]: `mergeProps`,50 [TO_HANDLERS]: `toHandlers`,51 [CAMELIZE]: `camelize`,52 [CAPITALIZE]: `capitalize`,53 [SET_BLOCK_TRACKING]: `setBlockTracking`,54 [PUSH_SCOPE_ID]: `pushScopeId`,55 [POP_SCOPE_ID]: `popScopeId`,56 [WITH_SCOPE_ID]: `withScopeId`,57 [WITH_CTX]: `withCtx`58};59const vnode = {60 __v_isVNode: true,61 ["__v_skip" /* SKIP */]: true,62 type,63 props,64 key: props && normalizeKey(props),65 ref: props && normalizeRef(props),66 scopeId: currentScopeId,67 children: null,68 component: null,69 suspense: null,70 ssContent: null,71 ssFallback: null,72 dirs: null,73 transition: null,74 el: null,75 anchor: null,76 target: null,77 targetAnchor: null,78 staticCount: 0,79 shapeFlag,80 patchFlag,81 dynamicProps,82 dynamicChildren: null,83 appContext: null84};85/*86* vnode shapeFlag: 87* 基本部分:0;1 ELEMENT; 2 FUNCTIONAL_COMPONENT; 4 STATEFUL_COMPONENT; 64 TELEPORT; 128 SUSPENSE88* 附加部分:0; 8 parent not TELEPORT,children is string; 16 children is array or string and parent not teleport; 32 SLOTS_CHILDREN (chidlren is object && paren not (ELEMENT|TELEPORT)), children is function89*90*/91const shapeFlag = isString(type)92? 1 /* ELEMENT */93: isSuspense(type)94 ? 128 /* SUSPENSE */95 : isTeleport(type)96 ? 64 /* TELEPORT */97 : isObject(type)98 ? 4 /* STATEFUL_COMPONENT */99 : isFunction(type)100 ? 2 /* FUNCTIONAL_COMPONENT */101 : 0;102function baseCompile(template, options = {}) {103 const onError = options.onError || defaultOnError;104 const isModuleMode = options.mode === 'module';105 /* istanbul ignore if */106 {107 if (options.prefixIdentifiers === true) {108 onError(createCompilerError(45 /* X_PREFIX_ID_NOT_SUPPORTED */));109 }110 else if (isModuleMode) {111 onError(createCompilerError(46 /* X_MODULE_MODE_NOT_SUPPORTED */));112 }113 }114 const prefixIdentifiers = !true ;115 if ( options.cacheHandlers) {116 onError(createCompilerError(47 /* X_CACHE_HANDLER_NOT_SUPPORTED */));117 }118 if (options.scopeId && !isModuleMode) {119 onError(createCompilerError(48 /* X_SCOPE_ID_NOT_SUPPORTED */));120 }121 const ast = isString(template) ? baseParse(template, options) : template;122 const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();123 transform(ast, extend({}, options, {124 prefixIdentifiers,125 nodeTransforms: [126 ...nodeTransforms,127 ...(options.nodeTransforms || []) // user transforms128 ],129 directiveTransforms: extend({}, directiveTransforms, options.directiveTransforms || {} // user transforms130 )131 }));132 return generate(ast, extend({}, options, {133 prefixIdentifiers134 }));135}136function generate(ast, options = {}) {137 const context = createCodegenContext(ast, options);138 if (options.onContextCreated)139 options.onContextCreated(context);140 // 默认:mode = 'function'141 // prefixIdentifiers = mode === 'module'142 const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;143 const hasHelpers = ast.helpers.length > 0;144 const useWithBlock = !prefixIdentifiers && mode !== 'module';145 // preambles146 {147 genFunctionPreamble(ast, context);148 }149 // binding optimizations150 const optimizeSources = options.bindingMetadata151 ? `, $props, $setup, $data, $options`152 : ``;153 // enter render function154 // 1. 普通155 // function render(_ctx, _cache, $props, $setup, $data, $options){。。。}156 if (!ssr) {157 push(`function render(_ctx, _cache${optimizeSources}) {`);158 }159 // 2. ssr160 // function ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options){。。。}161 else {162 push(`function ssrRender(_ctx, _push, _parent, _attrs${optimizeSources}) {`);163 }164 indent();165 // 默认:mode = 'function'166 if (useWithBlock) {167 push(`with (_ctx) {`);168 indent();169 // function mode const declarations should be inside with block170 // also they should be renamed to avoid collision with user properties171 if (hasHelpers) {172 push(`const { ${ast.helpers173 .map(s => `${helperNameMap[s]}: _${helperNameMap[s]}`)174 .join(', ')} } = _Vue`);175 push(`\n`);176 newline();177 }178 }179 // generate asset resolution statements180 if (ast.components.length) {181 genAssets(ast.components, 'component', context);182 if (ast.directives.length || ast.temps > 0) {183 newline();184 }185 }186 if (ast.directives.length) {187 genAssets(ast.directives, 'directive', context);188 if (ast.temps > 0) {189 newline();190 }191 }192 if (ast.temps > 0) {193 push(`let `);194 for (let i = 0; i < ast.temps; i++) {195 push(`${i > 0 ? `, ` : ``}_temp${i}`);196 }197 }198 if (ast.components.length || ast.directives.length || ast.temps) {199 push(`\n`);200 newline();201 }202 // generate the VNode tree expression203 if (!ssr) {204 push(`return `);205 }206 if (ast.codegenNode) {207 genNode(ast.codegenNode, context);208 }209 else {210 push(`null`);211 }212 if (useWithBlock) {213 deindent();214 push(`}`);215 }216 deindent();217 push(`}`);218 return {219 ast,220 code: context.code,221 // SourceMapGenerator does have toJSON() method but it's not in the types222 map: context.map ? context.map.toJSON() : undefined223 };224}225 const PURE_ANNOTATION = `/*#__PURE__*/`;226 function createCodegenContext(ast, { 227 mode = 'function', 228 prefixIdentifiers = mode === 'module', 229 sourceMap = false, 230 filename = `template.vue.html`, 231 scopeId = null, 232 optimizeImports = false, 233 runtimeGlobalName = `Vue`, 234 runtimeModuleName = `vue`, 235 ssr = false 236 }) {237 const context = {238 mode,239 prefixIdentifiers,240 sourceMap,241 filename,242 scopeId,243 optimizeImports,244 runtimeGlobalName,245 runtimeModuleName,246 ssr,247 source: ast.loc.source,248 code: ``,249 column: 1,250 line: 1,251 offset: 0,252 indentLevel: 0,253 pure: false,254 map: undefined,255 helper(key) {256 return `_${helperNameMap[key]}`;257 },258 push(code, node) {259 context.code += code;260 },261 indent() {262 newline(++context.indentLevel);263 },264 deindent(withoutNewLine = false) {265 if (withoutNewLine) {266 --context.indentLevel;267 }268 else {269 newline(--context.indentLevel);270 }271 },272 newline() {273 newline(context.indentLevel);274 }275 };276 function newline(n) {277 context.push('\n' + ` `.repeat(n));278 }279 return context;280 }281 function genFunctionPreamble(ast, context) {282 const { ssr, prefixIdentifiers, push, newline, runtimeModuleName, runtimeGlobalName } = context;283 const VueBinding = runtimeGlobalName;284 const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;285 // Generate const declaration for helpers286 // In prefix mode, we place the const declaration at top so it's done287 // only once; But if we not prefixing, we place the declaration inside the288 // with block so it doesn't incur the `in` check cost for every helper access.289 if (ast.helpers.length > 0) {290 {291 // "with" mode.292 // save Vue in a separate variable to avoid collision293 push(`const _Vue = ${VueBinding}\n`);294 // in "with" mode, helpers are declared inside the with block to avoid295 // has check cost, but hoists are lifted out of the function - we need296 // to provide the helper here.297 if (ast.hoists.length) {298 const staticHelpers = [299 CREATE_VNODE,300 CREATE_COMMENT,301 CREATE_TEXT,302 CREATE_STATIC303 ]304 .filter(helper => ast.helpers.includes(helper))305 .map(aliasHelper)306 .join(', ');307 push(`const { ${staticHelpers} } = _Vue\n`);308 }309 }310 }311 genHoists(ast.hoists, context);312 newline();313 push(`return `);314 }315 function genAssets(assets, type, { helper, push, newline }) {316 const resolver = helper(type === 'component' ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE);317 for (let i = 0; i < assets.length; i++) {318 const id = assets[i];319 push(`const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)})`);320 if (i < assets.length - 1) {321 newline();322 }323 }324 }325 function genNode(node, context) {326 if (isString(node)) {327 context.push(node);328 return;329 }330 if (isSymbol(node)) {331 context.push(context.helper(node));332 return;333 }334 switch (node.type) {335 case 1 /* ELEMENT */:336 case 9 /* IF */:337 case 11 /* FOR */:338 339 assert(node.codegenNode != null, `Codegen node is missing for element/if/for node. ` +340 `Apply appropriate transforms first.`);341 genNode(node.codegenNode, context);342 break;343 case 2 /* TEXT */:344 genText(node, context);345 break;346 case 4 /* SIMPLE_EXPRESSION */:347 genExpression(node, context);348 break;349 case 5 /* INTERPOLATION */:350 genInterpolation(node, context);351 break;352 case 12 /* TEXT_CALL */:353 genNode(node.codegenNode, context);354 break;355 case 8 /* COMPOUND_EXPRESSION */:356 genCompoundExpression(node, context);357 break;358 case 3 /* COMMENT */:359 genComment(node, context);360 break;361 /**362 * 363 * 1.root, children > 1; 364 * 2. children.length !== 1 || firstChild.type !== 1 ELEMENT && (children.length !== 1 || firstChild.type !== 11 fornode )365 * 3.fornode366 * 4.postTransformElement367 */368 case 13 /* VNODE_CALL */:369 genVNodeCall(node, context);370 break;371 case 14 /* JS_CALL_EXPRESSION */:372 genCallExpression(node, context);373 break;374 case 15 /* JS_OBJECT_EXPRESSION */:375 genObjectExpression(node, context);376 break;377 case 17 /* JS_ARRAY_EXPRESSION */:378 genArrayExpression(node, context);379 break;380 case 18 /* JS_FUNCTION_EXPRESSION */:381 genFunctionExpression(node, context);382 break;383 case 19 /* JS_CONDITIONAL_EXPRESSION */:384 genConditionalExpression(node, context);385 break;386 case 20 /* JS_CACHE_EXPRESSION */:387 genCacheExpression(node, context);388 break;389 // SSR only types390 case 21 /* JS_BLOCK_STATEMENT */:391 break;392 case 22 /* JS_TEMPLATE_LITERAL */:393 break;394 case 23 /* JS_IF_STATEMENT */:395 break;396 case 24 /* JS_ASSIGNMENT_EXPRESSION */:397 break;398 case 25 /* JS_SEQUENCE_EXPRESSION */:399 break;400 case 26 /* JS_RETURN_STATEMENT */:401 break;402 /* istanbul ignore next */403 case 10 /* IF_BRANCH */:404 // noop405 break;406 default:407 {408 assert(false, `unhandled codegen node type: ${node.type}`);409 // make sure we exhaust all possible types410 const exhaustiveCheck = node;411 return exhaustiveCheck;412 }413 }414 }415 function genText(node, context) {416 context.push(JSON.stringify(node.content), node);417 }418 function genExpression(node, context) {419 const { content, isStatic } = node;420 context.push(isStatic ? JSON.stringify(content) : content, node);421 }422 function genInterpolation(node, context) {423 const { push, helper, pure } = context;424 if (pure)425 push(PURE_ANNOTATION);426 push(`${helper(TO_DISPLAY_STRING)}(`);427 genNode(node.content, context);428 push(`)`);429 }430 function genCompoundExpression(node, context) {431 for (let i = 0; i < node.children.length; i++) {432 const child = node.children[i];433 if (isString(child)) {434 context.push(child);435 }436 else {437 genNode(child, context);438 }439 }440 }441 function genExpressionAsPropertyKey(node, context) {442 const { push } = context;443 if (node.type === 8 /* COMPOUND_EXPRESSION */) {444 push(`[`);445 genCompoundExpression(node, context);446 push(`]`);447 }448 else if (node.isStatic) {449 // only quote keys if necessary450 const text = isSimpleIdentifier(node.content)451 ? node.content452 : JSON.stringify(node.content);453 push(text, node);454 }455 else {456 push(`[${node.content}]`, node);457 }458 }459 function genComment(node, context) {460 {461 const { push, helper, pure } = context;462 if (pure) {463 push(PURE_ANNOTATION);464 }465 push(`${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, node);466 }467 }468 function genVNodeCall(node, context) {469 const { push, helper, pure } = context;470 const { tag, props, children, patchFlag, dynamicProps, directives, isBlock, disableTracking } = node;471 if (directives) {472 push(helper(WITH_DIRECTIVES) + `(`);473 }474 if (isBlock) {475 push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);476 }477 if (pure) {478 push(PURE_ANNOTATION);479 }480 push(helper(isBlock ? CREATE_BLOCK : CREATE_VNODE) + `(`, node);481 genNodeList(genNullableArgs([tag, props, children, patchFlag, dynamicProps]), context);482 push(`)`);483 if (isBlock) {484 push(`)`);485 }486 if (directives) {487 push(`, `);488 genNode(directives, context);489 push(`)`);490 }491 }492 /**493 * Adds directives to a VNode.494 */495 function withDirectives(vnode, directives) {496 const internalInstance = currentRenderingInstance;497 if (internalInstance === null) {498 warn(`withDirectives can only be used inside render functions.`);499 return vnode;500 }501 const instance = internalInstance.proxy;502 const bindings = vnode.dirs || (vnode.dirs = []);503 for (let i = 0; i < directives.length; i++) {504 let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];505 if (isFunction(dir)) {506 dir = {507 mounted: dir,508 updated: dir509 };510 }511 bindings.push({512 dir,513 instance,514 value,515 oldValue: void 0,516 arg,517 modifiers518 });519 }520 return vnode;521 }522 /**523 * Create a block root vnode. Takes the same exact arguments as `createVNode`.524 * A block root keeps track of dynamic nodes within the block in the525 * `dynamicChildren` array.526 *527 * @private528 */529 function createBlock(type, props, children, patchFlag, dynamicProps) {530 const vnode = createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */);531 // save current block children on the block vnode532 vnode.dynamicChildren = currentBlock || EMPTY_ARR;533 // close block534 closeBlock();535 // a block is always going to be patched, so track it as a child of its536 // parent block537 if (shouldTrack$1 > 0 && currentBlock) {538 currentBlock.push(vnode);539 }540 return vnode;541 }542 const createVNodeWithArgsTransform = (...args) => {543 return _createVNode(...(vnodeArgsTransformer544 ? vnodeArgsTransformer(args, currentRenderingInstance)545 : args));546 };547 function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {548 if (!type || type === NULL_DYNAMIC_COMPONENT) {549 if ( !type) {550 warn(`Invalid vnode type when creating vnode: ${type}.`);551 }552 type = Comment;553 }554 if (isVNode(type)) {555 // createVNode receiving an existing vnode. This happens in cases like556 // <component :is="vnode"/>557 // #2078 make sure to merge refs during the clone instead of overwriting it558 const cloned = cloneVNode(type, props, true /* mergeRef: true */);559 if (children) {560 normalizeChildren(cloned, children);561 }562 return cloned;563 }564 // class component normalization.565 if (isClassComponent(type)) {566 type = type.__vccOpts;567 }568 // class & style normalization.569 if (props) {570 // for reactive or proxy objects, we need to clone it to enable mutation.571 if (isProxy(props) || InternalObjectKey in props) {572 props = extend({}, props);573 }574 let { class: klass, style } = props;575 if (klass && !isString(klass)) {576 props.class = normalizeClass(klass);577 }578 if (isObject(style)) {579 // reactive state objects need to be cloned since they are likely to be580 // mutated581 if (isProxy(style) && !isArray(style)) {582 style = extend({}, style);583 }584 props.style = normalizeStyle(style);585 }586 }587 // encode the vnode type information into a bitmap588 const shapeFlag = isString(type)589 ? 1 /* ELEMENT */590 : isSuspense(type)591 ? 128 /* SUSPENSE */592 : isTeleport(type)593 ? 64 /* TELEPORT */594 : isObject(type)595 ? 4 /* STATEFUL_COMPONENT */596 : isFunction(type)597 ? 2 /* FUNCTIONAL_COMPONENT */598 : 0;599 if ( shapeFlag & 4 /* STATEFUL_COMPONENT */ && isProxy(type)) {600 type = toRaw(type);601 warn(`Vue received a Component which was made a reactive object. This can ` +602 `lead to unnecessary performance overhead, and should be avoided by ` +603 `marking the component with \`markRaw\` or using \`shallowRef\` ` +604 `instead of \`ref\`.`, `\nComponent that was made reactive: `, type);605 }606 const vnode = {607 __v_isVNode: true,608 ["__v_skip" /* SKIP */]: true,609 type,610 props,611 key: props && normalizeKey(props),612 ref: props && normalizeRef(props),613 scopeId: currentScopeId,614 children: null,615 component: null,616 suspense: null,617 ssContent: null,618 ssFallback: null,619 dirs: null,620 transition: null,621 el: null,622 anchor: null,623 target: null,624 targetAnchor: null,625 staticCount: 0,626 shapeFlag,627 patchFlag,628 dynamicProps,629 dynamicChildren: null,630 appContext: null631 };632 // validate key633 if ( vnode.key !== vnode.key) {634 warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type);635 }636 normalizeChildren(vnode, children);637 // normalize suspense children638 if ( shapeFlag & 128 /* SUSPENSE */) {639 const { content, fallback } = normalizeSuspenseChildren(vnode);640 vnode.ssContent = content;641 vnode.ssFallback = fallback;642 }643 if (shouldTrack$1 > 0 &&644 // avoid a block node from tracking itself645 !isBlockNode &&646 // has current parent block647 currentBlock &&648 // presence of a patch flag indicates this node needs patching on updates.649 // component nodes also should always be patched, because even if the650 // component doesn't need to update, it needs to persist the instance on to651 // the next vnode so that it can be properly unmounted later.652 (patchFlag > 0 || shapeFlag & 6 /* COMPONENT */) &&653 // the EVENTS flag is only for hydration and if it is the only flag, the654 // vnode should not be considered dynamic due to handler caching.655 patchFlag !== 32 /* HYDRATE_EVENTS */) {656 currentBlock.push(vnode);657 }658 return vnode;659 }660 function normalizeChildren(vnode, children) {661 let type = 0;662 const { shapeFlag } = vnode;663 if (children == null) {664 children = null;665 }666 else if (isArray(children)) {667 type = 16 /* ARRAY_CHILDREN */;668 }669 else if (typeof children === 'object') {670 if (shapeFlag & 1 /* ELEMENT */ || shapeFlag & 64 /* TELEPORT */) {671 // Normalize slot to plain children for plain element and Teleport672 const slot = children.default;673 if (slot) {674 // _c marker is added by withCtx() indicating this is a compiled slot675 slot._c && setCompiledSlotRendering(1);676 normalizeChildren(vnode, slot());677 slot._c && setCompiledSlotRendering(-1);678 }679 return;680 }681 else {682 type = 32 /* SLOTS_CHILDREN */;683 const slotFlag = children._;684 if (!slotFlag && !(InternalObjectKey in children)) {685 children._ctx = currentRenderingInstance;686 }687 else if (slotFlag === 3 /* FORWARDED */ && currentRenderingInstance) {688 // a child component receives forwarded slots from the parent.689 // its slot type is determined by its parent's slot type.690 if (currentRenderingInstance.vnode.patchFlag & 1024 /* DYNAMIC_SLOTS */) {691 children._ = 2 /* DYNAMIC */;692 vnode.patchFlag |= 1024 /* DYNAMIC_SLOTS */;693 }694 else {695 children._ = 1 /* STABLE */;696 }697 }698 }699 }700 else if (isFunction(children)) {701 children = { default: children, _ctx: currentRenderingInstance };702 type = 32 /* SLOTS_CHILDREN */;703 }704 else {705 children = String(children);706 // force teleport children to array so it can be moved around707 if (shapeFlag & 64 /* TELEPORT */) {708 type = 16 /* ARRAY_CHILDREN */;709 children = [createTextVNode(children)];710 }711 else {712 type = 8 /* TEXT_CHILDREN */;713 }714 }715 vnode.children = children;716 vnode.shapeFlag |= type;717 }718 function normalizeSuspenseChildren(vnode) {719 const { shapeFlag, children } = vnode;720 let content;721 let fallback;722 if (shapeFlag & 32 /* SLOTS_CHILDREN */) {723 content = normalizeSuspenseSlot(children.default);724 fallback = normalizeSuspenseSlot(children.fallback);725 }726 else {727 content = normalizeSuspenseSlot(children);728 fallback = normalizeVNode(null);729 }730 return {731 content,732 fallback733 };734 }735 function normalizeVNode(child) {736 if (child == null || typeof child === 'boolean') {737 // empty placeholder738 return createVNode(Comment);739 }740 else if (isArray(child)) {741 // fragment742 return createVNode(Fragment, null, child);743 }744 else if (typeof child === 'object') {745 // already vnode, this should be the most common since compiled templates746 // always produce all-vnode children arrays747 return child.el === null ? child : cloneVNode(child);748 }749 else {750 // strings and numbers751 return createVNode(Text, null, String(child));752 }753 }754 function normalizeSuspenseSlot(s) {755 if (isFunction(s)) {756 s = s();757 }758 if (isArray(s)) {759 const singleChild = filterSingleRoot(s);760 if ( !singleChild) {761 warn(`<Suspense> slots expect a single root node.`);762 }763 s = singleChild;764 }765 return normalizeVNode(s);766 }767 function filterSingleRoot(children) {768 const filtered = children.filter(child => {769 return !(isVNode(child) &&770 child.type === Comment &&771 child.children !== 'v-if');772 });773 return filtered.length === 1 && isVNode(filtered[0]) ? filtered[0] : null;774 }775 function genNodeList(nodes, context, multilines = false, comma = true) {776 const { push, newline } = context;777 for (let i = 0; i < nodes.length; i++) {778 const node = nodes[i];779 if (isString(node)) {780 push(node);781 }782 else if (isArray(node)) {783 genNodeListAsArray(node, context);784 }785 else {786 genNode(node, context);787 }788 if (i < nodes.length - 1) {789 if (multilines) {790 comma && push(',');791 newline();792 }793 else {794 comma && push(', ');795 }796 }797 }798 }799 function genNullableArgs(args) {800 let i = args.length;801 while (i--) {802 if (args[i] != null)803 break;804 }805 return args.slice(0, i + 1).map(arg => arg || `null`);806 }807 // JavaScript808 function genCallExpression(node, context) {809 const { push, helper, pure } = context;810 const callee = isString(node.callee) ? node.callee : helper(node.callee);811 if (pure) {812 push(PURE_ANNOTATION);813 }814 push(callee + `(`, node);815 genNodeList(node.arguments, context);816 push(`)`);817 }818 function genObjectExpression(node, context) {819 const { push, indent, deindent, newline } = context;820 const { properties } = node;821 if (!properties.length) {822 push(`{}`, node);823 return;824 }825 const multilines = properties.length > 1 ||826 (827 properties.some(p => p.value.type !== 4 /* SIMPLE_EXPRESSION */));828 push(multilines ? `{` : `{ `);829 multilines && indent();830 for (let i = 0; i < properties.length; i++) {831 const { key, value } = properties[i];832 // key833 genExpressionAsPropertyKey(key, context);834 push(`: `);835 // value836 genNode(value, context);837 if (i < properties.length - 1) {838 // will only reach this if it's multilines839 push(`,`);840 newline();841 }842 }843 multilines && deindent();844 push(multilines ? `}` : ` }`);845 }846 function genArrayExpression(node, context) {847 genNodeListAsArray(node.elements, context);848 }849 function genNodeListAsArray(nodes, context) {850 const multilines = nodes.length > 3 ||851 ( nodes.some(n => isArray(n) || !isText$1(n)));852 context.push(`[`);853 multilines && context.indent();854 genNodeList(nodes, context, multilines);855 multilines && context.deindent();856 context.push(`]`);857 }858 function genFunctionExpression(node, context) {859 const { push, indent, deindent, scopeId, mode } = context;860 const { params, returns, body, newline, isSlot } = node;861 if (isSlot) {862 push(`_${helperNameMap[WITH_CTX]}(`);863 }864 push(`(`, node);865 if (isArray(params)) {866 genNodeList(params, context);867 }868 else if (params) {869 genNode(params, context);870 }871 push(`) => `);872 if (newline || body) {873 push(`{`);874 indent();875 }876 if (returns) {877 if (newline) {878 push(`return `);879 }880 if (isArray(returns)) {881 genNodeListAsArray(returns, context);882 }883 else {884 genNode(returns, context);885 }886 }887 else if (body) {888 genNode(body, context);889 }890 if (newline || body) {891 deindent();892 push(`}`);893 }894 if ( isSlot) {895 push(`)`);896 }897 }898 function genConditionalExpression(node, context) {899 const { test, consequent, alternate, newline: needNewline } = node;900 const { push, indent, deindent, newline } = context;901 if (test.type === 4 /* SIMPLE_EXPRESSION */) {902 const needsParens = !isSimpleIdentifier(test.content);903 needsParens && push(`(`);904 genExpression(test, context);905 needsParens && push(`)`);906 }907 else {908 push(`(`);909 genNode(test, context);910 push(`)`);911 }912 needNewline && indent();913 context.indentLevel++;914 needNewline || push(` `);915 push(`? `);916 genNode(consequent, context);917 context.indentLevel--;918 needNewline && newline();919 needNewline || push(` `);920 push(`: `);921 const isNested = alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */;922 if (!isNested) {923 context.indentLevel++;924 }925 genNode(alternate, context);926 if (!isNested) {927 context.indentLevel--;928 }929 needNewline && deindent(true /* without newline */);930 }931 function genCacheExpression(node, context) {932 const { push, helper, indent, deindent, newline } = context;933 push(`_cache[${node.index}] || (`);934 if (node.isVNode) {935 indent();936 push(`${helper(SET_BLOCK_TRACKING)}(-1),`);937 newline();938 }939 push(`_cache[${node.index}] = `);940 genNode(node.value, context);941 if (node.isVNode) {942 push(`,`);943 newline();944 push(`${helper(SET_BLOCK_TRACKING)}(1),`);945 newline();946 push(`_cache[${node.index}]`);947 deindent();948 }949 push(`)`);950 }951/**952 * block tracking 机制953 */954// Since v-if and v-for are the two possible ways node structure can dynamically955// change, once we consider v-if branches and each v-for fragment a block, we956// can divide a template into nested blocks, and within each block the node957// structure would be stable. This allows us to skip most children diffing958// and only worry about the dynamic nodes (indicated by patch flags).959const blockStack = [];960let currentBlock = null;961/**962 * Open a block.963 * This must be called before `createBlock`. It cannot be part of `createBlock`964 * because the children of the block are evaluated before `createBlock` itself965 * is called. The generated code typically looks like this:966 *967 * ```js968 * function render() {969 * return (openBlock(),createBlock('div', null, [...]))970 * }971 * ```972 * disableTracking is true when creating a v-for fragment block, since a v-for973 * fragment always diffs its children.974 *975 * @private976 */977function openBlock(disableTracking = false) {978 blockStack.push((currentBlock = disableTracking ? null : []));979}980function closeBlock() {981 blockStack.pop();982 currentBlock = blockStack[blockStack.length - 1] || null;983}984/**985 * Create a block root vnode. Takes the same exact arguments as `createVNode`.986 * A block root keeps track of dynamic nodes within the block in the987 * `dynamicChildren` array.988 *989 * @private990 */991// createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false)992function createBlock(type, props, children, patchFlag, dynamicProps) {993 const vnode = createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */);994 // save current block children on the block vnode995 vnode.dynamicChildren = currentBlock || EMPTY_ARR;996 // close block997 closeBlock();998 // a block is always going to be patched, so track it as a child of its999 // parent block1000 if (shouldTrack$1 > 0 && currentBlock) {1001 currentBlock.push(vnode);1002 }1003 return vnode;1004}1005// Whether we should be tracking dynamic child nodes inside a block.1006// Only tracks when this value is > 01007// We are not using a simple boolean because this value may need to be1008// incremented/decremented by nested usage of v-once (see below)1009let shouldTrack$1 = 1;1010/**1011 * Block tracking sometimes needs to be disabled, for example during the1012 * creation of a tree that needs to be cached by v-once. The compiler generates1013 * code like this:1014 *1015 * ``` js1016 * _cache[1] || (1017 * setBlockTracking(-1),1018 * _cache[1] = createVNode(...),1019 * setBlockTracking(1),1020 * _cache[1]1021 * )1022 * ```1023 *1024 * @private1025 */1026function setBlockTracking(value) {1027 shouldTrack$1 += value;1028}1029var runtimeDom = /*#__PURE__*/Object.freeze({1030 __proto__: null,1031 render: render,1032 hydrate: hydrate,1033 createApp: createApp,1034 createSSRApp: createSSRApp,1035 useCssModule: useCssModule,1036 useCssVars: useCssVars,1037 Transition: Transition,1038 TransitionGroup: TransitionGroup,1039 vModelText: vModelText,1040 vModelCheckbox: vModelCheckbox,1041 vModelRadio: vModelRadio,1042 vModelSelect: vModelSelect,1043 vModelDynamic: vModelDynamic,1044 withModifiers: withModifiers,1045 withKeys: withKeys,1046 vShow: vShow,1047 reactive: reactive,1048 ref: ref,1049 readonly: readonly,1050 unref: unref,1051 proxyRefs: proxyRefs,1052 isRef: isRef,1053 toRef: toRef,1054 toRefs: toRefs,1055 isProxy: isProxy,1056 isReactive: isReactive,1057 isReadonly: isReadonly,1058 customRef: customRef,1059 triggerRef: triggerRef,1060 shallowRef: shallowRef,1061 shallowReactive: shallowReactive,1062 shallowReadonly: shallowReadonly,1063 markRaw: markRaw,1064 toRaw: toRaw,1065 computed: computed$1,1066 watch: watch,1067 watchEffect: watchEffect,1068 onBeforeMount: onBeforeMount,1069 onMounted: onMounted,1070 onBeforeUpdate: onBeforeUpdate,1071 onUpdated: onUpdated,1072 onBeforeUnmount: onBeforeUnmount,1073 onUnmounted: onUnmounted,1074 onActivated: onActivated,1075 onDeactivated: onDeactivated,1076 onRenderTracked: onRenderTracked,1077 onRenderTriggered: onRenderTriggered,1078 onErrorCaptured: onErrorCaptured,1079 provide: provide,1080 inject: inject,1081 nextTick: nextTick,1082 defineComponent: defineComponent,1083 defineAsyncComponent: defineAsyncComponent,1084 getCurrentInstance: getCurrentInstance,1085 h: h,1086 createVNode: createVNode,1087 cloneVNode: cloneVNode,1088 mergeProps: mergeProps,1089 isVNode: isVNode,1090 Fragment: Fragment,1091 Text: Text,1092 Comment: Comment,1093 Static: Static,1094 Teleport: Teleport,1095 Suspense: Suspense,1096 KeepAlive: KeepAlive,1097 BaseTransition: BaseTransition,1098 withDirectives: withDirectives,1099 useSSRContext: useSSRContext,1100 ssrContextKey: ssrContextKey,1101 createRenderer: createRenderer,1102 createHydrationRenderer: createHydrationRenderer,1103 queuePostFlushCb: queuePostFlushCb,1104 warn: warn,1105 handleError: handleError,1106 callWithErrorHandling: callWithErrorHandling,1107 callWithAsyncErrorHandling: callWithAsyncErrorHandling,1108 resolveComponent: resolveComponent,1109 resolveDirective: resolveDirective,1110 resolveDynamicComponent: resolveDynamicComponent,1111 registerRuntimeCompiler: registerRuntimeCompiler,1112 useTransitionState: useTransitionState,1113 resolveTransitionHooks: resolveTransitionHooks,1114 setTransitionHooks: setTransitionHooks,1115 getTransitionRawChildren: getTransitionRawChildren,1116 get devtools () { return devtools; },1117 setDevtoolsHook: setDevtoolsHook,1118 withCtx: withCtx,1119 renderList: renderList,1120 toHandlers: toHandlers,1121 renderSlot: renderSlot,1122 createSlots: createSlots,1123 pushScopeId: pushScopeId,1124 popScopeId: popScopeId,1125 withScopeId: withScopeId,1126 openBlock: openBlock,1127 createBlock: createBlock,1128 setBlockTracking: setBlockTracking,1129 createTextVNode: createTextVNode,1130 createCommentVNode: createCommentVNode,1131 createStaticVNode: createStaticVNode,1132 toDisplayString: toDisplayString,1133 camelize: camelize,1134 capitalize: capitalize,1135 transformVNodeArgs: transformVNodeArgs,1136 version: version,1137 ssrUtils: ssrUtils1138 });1139function compileToFunction(template, options) {1140 if (!isString(template)) {1141 if (template.nodeType) {1142 template = template.innerHTML;1143 }1144 else {1145 warn(`invalid template option: `, template);1146 return NOOP;1147 }1148 }1149 const key = template;1150 const cached = compileCache[key];1151 if (cached) {1152 return cached;1153 }1154 if (template[0] === '#') {1155 const el = document.querySelector(template);1156 if ( !el) {1157 warn(`Template element not found or is empty: ${template}`);1158 }1159 // __UNSAFE__1160 // Reason: potential execution of JS expressions in in-DOM template.1161 // The user must make sure the in-DOM template is trusted. If it's rendered1162 // by the server, the template should not contain any user data.1163 template = el ? el.innerHTML : ``;1164 }1165 const { code } = compile$1(template, extend({1166 hoistStatic: true,1167 onError(err) {1168 {1169 const message = `Template compilation error: ${err.message}`;1170 const codeFrame = err.loc &&1171 generateCodeFrame(template, err.loc.start.offset, err.loc.end.offset);1172 warn(codeFrame ? `${message}\n${codeFrame}` : message);1173 }1174 }1175 }, options));1176 // The wildcard import results in a huge object with every export1177 // with keys that cannot be mangled, and can be quite heavy size-wise.1178 // In the global build we know `Vue` is available globally so we can avoid1179 // the wildcard object.1180 const render = ( new Function('Vue', code)(runtimeDom));1181 render._rc = true;1182 return (compileCache[key] = render);...

Full Screen

Full Screen

vendor.js

Source:vendor.js Github

copy

Full Screen

1(self["webpackChunk"] = self["webpackChunk"] || []).push([["/js/vendor"],{2/***/ "./node_modules/vue/dist/vue.esm-bundler.js":3/*!**************************************************!*\4 !*** ./node_modules/vue/dist/vue.esm-bundler.js ***!5 \**************************************************/6/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {7"use strict";8__webpack_require__.r(__webpack_exports__);9/* harmony export */ __webpack_require__.d(__webpack_exports__, {10/* harmony export */ "BaseTransition": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.BaseTransition,11/* harmony export */ "Comment": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Comment,12/* harmony export */ "Fragment": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Fragment,13/* harmony export */ "KeepAlive": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.KeepAlive,14/* harmony export */ "Static": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Static,15/* harmony export */ "Suspense": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Suspense,16/* harmony export */ "Teleport": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Teleport,17/* harmony export */ "Text": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Text,18/* harmony export */ "Transition": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Transition,19/* harmony export */ "TransitionGroup": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.TransitionGroup,20/* harmony export */ "callWithAsyncErrorHandling": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.callWithAsyncErrorHandling,21/* harmony export */ "callWithErrorHandling": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.callWithErrorHandling,22/* harmony export */ "camelize": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.camelize,23/* harmony export */ "capitalize": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.capitalize,24/* harmony export */ "cloneVNode": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.cloneVNode,25/* harmony export */ "computed": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.computed,26/* harmony export */ "createApp": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createApp,27/* harmony export */ "createBlock": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createBlock,28/* harmony export */ "createCommentVNode": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode,29/* harmony export */ "createHydrationRenderer": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createHydrationRenderer,30/* harmony export */ "createRenderer": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createRenderer,31/* harmony export */ "createSSRApp": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createSSRApp,32/* harmony export */ "createSlots": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createSlots,33/* harmony export */ "createStaticVNode": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createStaticVNode,34/* harmony export */ "createTextVNode": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createTextVNode,35/* harmony export */ "createVNode": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createVNode,36/* harmony export */ "customRef": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.customRef,37/* harmony export */ "defineAsyncComponent": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineAsyncComponent,38/* harmony export */ "defineComponent": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineComponent,39/* harmony export */ "defineEmit": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineEmit,40/* harmony export */ "defineProps": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineProps,41/* harmony export */ "devtools": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.devtools,42/* harmony export */ "getCurrentInstance": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance,43/* harmony export */ "getTransitionRawChildren": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.getTransitionRawChildren,44/* harmony export */ "h": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.h,45/* harmony export */ "handleError": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.handleError,46/* harmony export */ "hydrate": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.hydrate,47/* harmony export */ "initCustomFormatter": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.initCustomFormatter,48/* harmony export */ "inject": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.inject,49/* harmony export */ "isProxy": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isProxy,50/* harmony export */ "isReactive": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isReactive,51/* harmony export */ "isReadonly": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isReadonly,52/* harmony export */ "isRef": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isRef,53/* harmony export */ "isVNode": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isVNode,54/* harmony export */ "markRaw": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.markRaw,55/* harmony export */ "mergeProps": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.mergeProps,56/* harmony export */ "nextTick": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.nextTick,57/* harmony export */ "onActivated": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onActivated,58/* harmony export */ "onBeforeMount": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onBeforeMount,59/* harmony export */ "onBeforeUnmount": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onBeforeUnmount,60/* harmony export */ "onBeforeUpdate": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onBeforeUpdate,61/* harmony export */ "onDeactivated": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onDeactivated,62/* harmony export */ "onErrorCaptured": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onErrorCaptured,63/* harmony export */ "onMounted": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onMounted,64/* harmony export */ "onRenderTracked": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onRenderTracked,65/* harmony export */ "onRenderTriggered": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onRenderTriggered,66/* harmony export */ "onUnmounted": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onUnmounted,67/* harmony export */ "onUpdated": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onUpdated,68/* harmony export */ "openBlock": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.openBlock,69/* harmony export */ "popScopeId": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.popScopeId,70/* harmony export */ "provide": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.provide,71/* harmony export */ "proxyRefs": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.proxyRefs,72/* harmony export */ "pushScopeId": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.pushScopeId,73/* harmony export */ "queuePostFlushCb": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.queuePostFlushCb,74/* harmony export */ "reactive": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.reactive,75/* harmony export */ "readonly": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.readonly,76/* harmony export */ "ref": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ref,77/* harmony export */ "registerRuntimeCompiler": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.registerRuntimeCompiler,78/* harmony export */ "render": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.render,79/* harmony export */ "renderList": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.renderList,80/* harmony export */ "renderSlot": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.renderSlot,81/* harmony export */ "resolveComponent": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveComponent,82/* harmony export */ "resolveDirective": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveDirective,83/* harmony export */ "resolveDynamicComponent": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveDynamicComponent,84/* harmony export */ "resolveTransitionHooks": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveTransitionHooks,85/* harmony export */ "setBlockTracking": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.setBlockTracking,86/* harmony export */ "setDevtoolsHook": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.setDevtoolsHook,87/* harmony export */ "setTransitionHooks": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.setTransitionHooks,88/* harmony export */ "shallowReactive": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.shallowReactive,89/* harmony export */ "shallowReadonly": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly,90/* harmony export */ "shallowRef": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.shallowRef,91/* harmony export */ "ssrContextKey": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ssrContextKey,92/* harmony export */ "ssrUtils": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ssrUtils,93/* harmony export */ "toDisplayString": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toDisplayString,94/* harmony export */ "toHandlerKey": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toHandlerKey,95/* harmony export */ "toHandlers": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toHandlers,96/* harmony export */ "toRaw": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toRaw,97/* harmony export */ "toRef": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toRef,98/* harmony export */ "toRefs": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toRefs,99/* harmony export */ "transformVNodeArgs": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.transformVNodeArgs,100/* harmony export */ "triggerRef": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.triggerRef,101/* harmony export */ "unref": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.unref,102/* harmony export */ "useContext": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useContext,103/* harmony export */ "useCssModule": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useCssModule,104/* harmony export */ "useCssVars": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useCssVars,105/* harmony export */ "useSSRContext": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useSSRContext,106/* harmony export */ "useTransitionState": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useTransitionState,107/* harmony export */ "vModelCheckbox": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelCheckbox,108/* harmony export */ "vModelDynamic": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelDynamic,109/* harmony export */ "vModelRadio": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelRadio,110/* harmony export */ "vModelSelect": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelSelect,111/* harmony export */ "vModelText": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelText,112/* harmony export */ "vShow": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vShow,113/* harmony export */ "version": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.version,114/* harmony export */ "warn": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.warn,115/* harmony export */ "watch": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.watch,116/* harmony export */ "watchEffect": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.watchEffect,117/* harmony export */ "withCtx": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withCtx,118/* harmony export */ "withDirectives": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withDirectives,119/* harmony export */ "withKeys": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withKeys,120/* harmony export */ "withModifiers": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withModifiers,121/* harmony export */ "withScopeId": () => /* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withScopeId,122/* harmony export */ "compile": () => /* binding */ compileToFunction123/* harmony export */ });124/* harmony import */ var _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/runtime-dom */ "./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js");125/* harmony import */ var _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @vue/runtime-dom */ "./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js");126/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js");127/* harmony import */ var _vue_compiler_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @vue/compiler-dom */ "./node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js");128function initDev() {129 const target = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.getGlobalThis)();130 target.__VUE__ = true;131 (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_2__.setDevtoolsHook)(target.__VUE_DEVTOOLS_GLOBAL_HOOK__);132 {133 (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_2__.initCustomFormatter)();134 }135}136// This entry is the "full-build" that includes both the runtime137( true) && initDev();138const compileCache = Object.create(null);139function compileToFunction(template, options) {140 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(template)) {141 if (template.nodeType) {142 template = template.innerHTML;143 }144 else {145 ( true) && (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_2__.warn)(`invalid template option: `, template);146 return _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP;147 }148 }149 const key = template;150 const cached = compileCache[key];151 if (cached) {152 return cached;153 }154 if (template[0] === '#') {155 const el = document.querySelector(template);156 if (( true) && !el) {157 (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_2__.warn)(`Template element not found or is empty: ${template}`);158 }159 // __UNSAFE__160 // Reason: potential execution of JS expressions in in-DOM template.161 // The user must make sure the in-DOM template is trusted. If it's rendered162 // by the server, the template should not contain any user data.163 template = el ? el.innerHTML : ``;164 }165 const { code } = (0,_vue_compiler_dom__WEBPACK_IMPORTED_MODULE_3__.compile)(template, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({166 hoistStatic: true,167 onError(err) {168 if ((true)) {169 const message = `Template compilation error: ${err.message}`;170 const codeFrame = err.loc &&171 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.generateCodeFrame)(template, err.loc.start.offset, err.loc.end.offset);172 (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_2__.warn)(codeFrame ? `${message}\n${codeFrame}` : message);173 }174 else {}175 }176 }, options));177 // The wildcard import results in a huge object with every export178 // with keys that cannot be mangled, and can be quite heavy size-wise.179 // In the global build we know `Vue` is available globally so we can avoid180 // the wildcard object.181 const render = ( new Function('Vue', code)(_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__));182 render._rc = true;183 return (compileCache[key] = render);184}185(0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_2__.registerRuntimeCompiler)(compileToFunction);186/***/ })...

Full Screen

Full Screen

script.js

Source:script.js Github

copy

Full Screen

1//const { transformVNodeArgs } = require("vue");2/*3 let c = new Color(3,5,10);4 console.log(c.toString());5*/6var draEng = new DrawingEngine();7var undoRedoManager = new UndoRedoManager();8window.onload = function() {9 document.addEventListener('keydown', function (event) {10 11 if (event.key === 'z') {12 undoRedoManager.undo()13 }14 15 if (event.key === 'y') {16 undoRedoManager.redo()17 }18 if (event.key === 'c') {19 draEng.color()20 }21 22 if (event.key === 'd') {23 deleteShape();24 }25 });26 var lineBtn = document.getElementById("line");27 var triangleBtn = document.getElementById("triangle");28 var squareBtn = document.getElementById("square");29 var rectangleBtn = document.getElementById("rectangle");30 var ellipseBtn = document.getElementById("ellipse");31 var circleBtn = document.getElementById("circle");32 var undoBtn = document.getElementById("undo");33 var redoBtn = document.getElementById("redo");34 function getMousePosition(canvas, event) {35 let rect = canvas.getBoundingClientRect();36 let x = event.clientX - rect.left;37 let y = event.clientY - rect.top;38 return new Point(x, y);39 }40 this.lineClick = function() {41 ShapeFactory.create2PointsShape("line");42 };43 this.rectangleClick = function() {44 ShapeFactory.create2PointsShape("rectangle");45 };46 this.circleClick = function() {47 ShapeFactory.create2PointsShape("circle");48 };49 this.squareClick = function() {50 ShapeFactory.create2PointsShape("square");51 };52 this.triangleClick = function() {53 ShapeFactory.create3PoitnsShape("triangle");54 };55 this.ellipseClick = function() {56 console.log(draEng.shapes);57 ShapeFactory.create2PointsShape("ellipse");58 };59 this.deleteShape = function() {60 if (draEng.selectedShape == null) return;61 let shape = draEng.selectedShape;62 draEng.clearSelectedShape();63 draEng.deleteShape(shape);64 };65 this.copyShape = function() {66 if (draEng.selectedShape == null) return;67 draEng.copySelectedShape();68 };69 this.processShapes = function(jsonArray) {70 let shapes = [];71 let n = jsonArray.length;72 for(let i = 0; i < n;i++) {73 let currentShape = jsonArray[i];74 let type = currentShape.type;75 let newShape;76 if(type == 'circle')77 newShape = new Circle(Point.JSONtoPoint(currentShape.p1), currentShape.radius);78 else if(type == 'ellipse')79 newShape = new Ellipse(Point.JSONtoPoint(currentShape.center), currentShape.radiusX, currentShape.radiusY);80 else if(type == 'line')81 newShape = new Line(Point.JSONtoPoint(currentShape.p1), Point.JSONtoPoint(currentShape.p2));82 else if(type == 'square')83 newShape = new Square(Point.JSONtoPoint(currentShape.p1), currentShape.width, currentShape.height);84 else if(type == 'rectangle')85 newShape = new Rectangle(Point.JSONtoPoint(currentShape.p1), Point.JSONtoPoint(currentShape.p2));86 else if(type == 'triangle')87 newShape = new Triangle(Point.JSONtoPoint(currentShape.p1), Point.JSONtoPoint(currentShape.p2), Point.JSONtoPoint(currentShape.p3));88 newShape.fillColor = new Color(currentShape.fillColor.r, currentShape.fillColor.g, currentShape.fillColor.b);89 newShape.edgeColor = new Color(currentShape.edgeColor.r, currentShape.edgeColor.g, currentShape.edgeColor.b);90 shapes.push(newShape);91 }92 draEng.shapes = shapes;93 undoRedoManager.snapShots = [[]];94 undoRedoManager.currentSnapIndex = 0;95 undoRedoManager.shapes = [];96 undoRedoManager.newShapes(shapes);97 draEng.refresh();98 }99 this.loadJSON = function() {100 let file = document.getElementById("fileInput").files[0];101 let formData = new FormData();102 103 formData.append("file", file);104 fetch('http://localhost:3000/uploadJsonFile', {105 method: "post",106 body: formData107 })108 .then(res => res.json())109 .then(data => {110 this.processShapes(data);111 });112 }113 this.loadXML = function() {114 let file = document.getElementById("fileInput").files[0];115 let formData = new FormData();116 117 formData.append("file", file);118 fetch('http://localhost:3000/uploadXMLFile', {119 method: "post", 120 body: formData121 })122 .then(res => res.json())123 .then(data => {124 shapes = this.processShapes(data);125 });126 }127 this.saveJSON = function() {128 let shapes = JSON.stringify(draEng.shapes);129 fetch('http://localhost:3000/createJsonFile', {130 method: "post",131 body: shapes,132 headers: {133 "Content-Type": "application/json",134 'Accept': 'application/json'135 }136 })137 .then(res => res.json())138 .then(body => {139 window.open('http://localhost:3000/getJsonFile/'+body.filename)140 })141 }142 this.saveXML = function() {143 let shapes = JSON.stringify(draEng.shapes);144 fetch('http://localhost:3000/createXMLFile', {145 method: "post",146 body: shapes,147 headers: {148 "Content-Type": "application/json",149 'Accept': 'application/json'150 }151 })152 .then(res => res.json())153 .then(body => {154 window.open('http://localhost:3000/getXMLFile/'+body.filename)155 })156 }...

Full Screen

Full Screen

vue.esm.re-export.js

Source:vue.esm.re-export.js Github

copy

Full Screen

1import { BaseTransition, Comment, Fragment, KeepAlive, Static, Suspense, 2 Teleport, Text, Transition, TransitionGroup, callWithAsyncErrorHandling, 3 callWithErrorHandling, camelize, capitalize, cloneVNode, compile, 4 computed, createApp, createBlock, createCommentVNode, 5 createHydrationRenderer, createRenderer, createSSRApp, createSlots, 6 createStaticVNode, createTextVNode, createVNode, customRef, 7 defineAsyncComponent, defineComponent, defineEmit, defineProps, 8 devtools, getCurrentInstance, getTransitionRawChildren, h, handleError, 9 hydrate, initCustomFormatter, inject, isProxy, isReactive, isReadonly, 10 isRef, isVNode, markRaw, mergeProps, nextTick, onActivated, onBeforeMount, 11 onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, 12 onRenderTracked, onRenderTriggered, onUnmounted, onUpdated, openBlock, 13 popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, 14 readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, 15 resolveComponent, resolveDirective, resolveDynamicComponent, 16 resolveTransitionHooks, setBlockTracking, setDevtoolsHook, 17 setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, 18 ssrContextKey, ssrUtils, toDisplayString, toHandlerKey, toHandlers, 19 toRaw, toRef, toRefs, transformVNodeArgs, triggerRef, unref, useContext, 20 useCssModule, useCssVars, useSSRContext, useTransitionState, 21 vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, 22 vShow, version, warn, watch, watchEffect, withCtx, withDirectives, 23 withKeys, withModifiers, withScopeId } 24 from "/node_modules/vue/dist/vue.esm-browser.js";25export { BaseTransition, Comment, Fragment, KeepAlive, Static, Suspense, 26 Teleport, Text, Transition, TransitionGroup, callWithAsyncErrorHandling, 27 callWithErrorHandling, camelize, capitalize, cloneVNode, compile, 28 computed, createApp, createBlock, createCommentVNode, 29 createHydrationRenderer, createRenderer, createSSRApp, createSlots, 30 createStaticVNode, createTextVNode, createVNode, customRef, 31 defineAsyncComponent, defineComponent, defineEmit, defineProps, 32 devtools, getCurrentInstance, getTransitionRawChildren, h, handleError, 33 hydrate, initCustomFormatter, inject, isProxy, isReactive, isReadonly, 34 isRef, isVNode, markRaw, mergeProps, nextTick, onActivated, onBeforeMount, 35 onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, 36 onRenderTracked, onRenderTriggered, onUnmounted, onUpdated, openBlock, 37 popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, 38 readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, 39 resolveComponent, resolveDirective, resolveDynamicComponent, 40 resolveTransitionHooks, setBlockTracking, setDevtoolsHook, 41 setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, 42 ssrContextKey, ssrUtils, toDisplayString, toHandlerKey, toHandlers, 43 toRaw, toRef, toRefs, transformVNodeArgs, triggerRef, unref, useContext, 44 useCssModule, useCssVars, useSSRContext, useTransitionState, 45 vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, 46 vShow, version, warn, watch, watchEffect, withCtx, withDirectives, ...

Full Screen

Full Screen

vue-v3.js

Source:vue-v3.js Github

copy

Full Screen

1/**2 * @type {import('.').LibMeta}3 */4module.exports = {5 name: 'Vue',6 members: [7 'BaseTransition',8 'Comment',9 'EffectScope',10 'Fragment',11 'KeepAlive',12 'ReactiveEffect',13 'Static',14 'Suspense',15 'Teleport',16 'Text',17 'Transition',18 'TransitionGroup',19 'VueElement',20 'callWithAsyncErrorHandling',21 'callWithErrorHandling',22 'camelize',23 'capitalize',24 'cloneVNode',25 'compatUtils',26 'compile',27 'computed',28 'createApp',29 'createBlock',30 'createCommentVNode',31 'createElementBlock',32 'createElementVNode',33 'createHydrationRenderer',34 'createPropsRestProxy',35 'createRenderer',36 'createSSRApp',37 'createSlots',38 'createStaticVNode',39 'createTextVNode',40 'createVNode',41 'customRef',42 'defineAsyncComponent',43 'defineComponent',44 'defineCustomElement',45 'defineEmits',46 'defineExpose',47 'defineProps',48 'defineSSRCustomElement',49 'effect',50 'effectScope',51 'getCurrentInstance',52 'getCurrentScope',53 'getTransitionRawChildren',54 'guardReactiveProps',55 'h',56 'handleError',57 'hydrate',58 'initCustomFormatter',59 'initDirectivesForSSR',60 'inject',61 'isMemoSame',62 'isProxy',63 'isReactive',64 'isReadonly',65 'isRef',66 'isRuntimeOnly',67 'isShallow',68 'isVNode',69 'markRaw',70 'mergeDefaults',71 'mergeProps',72 'nextTick',73 'normalizeClass',74 'normalizeProps',75 'normalizeStyle',76 'onActivated',77 'onBeforeMount',78 'onBeforeUnmount',79 'onBeforeUpdate',80 'onDeactivated',81 'onErrorCaptured',82 'onMounted',83 'onRenderTracked',84 'onRenderTriggered',85 'onScopeDispose',86 'onServerPrefetch',87 'onUnmounted',88 'onUpdated',89 'openBlock',90 'popScopeId',91 'provide',92 'proxyRefs',93 'pushScopeId',94 'queuePostFlushCb',95 'reactive',96 'readonly',97 'ref',98 'registerRuntimeCompiler',99 'render',100 'renderList',101 'renderSlot',102 'resolveComponent',103 'resolveDirective',104 'resolveDynamicComponent',105 'resolveFilter',106 'resolveTransitionHooks',107 'setBlockTracking',108 'setDevtoolsHook',109 'setTransitionHooks',110 'shallowReactive',111 'shallowReadonly',112 'shallowRef',113 'ssrContextKey',114 'ssrUtils',115 'stop',116 'toDisplayString',117 'toHandlerKey',118 'toHandlers',119 'toRaw',120 'toRef',121 'toRefs',122 'transformVNodeArgs',123 'triggerRef',124 'unref',125 'useAttrs',126 'useCssModule',127 'useCssVars',128 'useSSRContext',129 'useSlots',130 'useTransitionState',131 'vModelCheckbox',132 'vModelDynamic',133 'vModelRadio',134 'vModelSelect',135 'vModelText',136 'vShow',137 'version',138 'warn',139 'watch',140 'watchEffect',141 'watchPostEffect',142 'watchSyncEffect',143 'withAsyncContext',144 'withCtx',145 'withDefaults',146 'withDirectives',147 'withKeys',148 'withMemo',149 'withModifiers',150 'withScopeId',151 ],...

Full Screen

Full Screen

Vue.mjs

Source:Vue.mjs Github

copy

Full Screen

1/**2 * Wrap Vue 3 library to use as ES6 module in TeqFW on the front.3 *4 * @namespace TeqFw_Vue_Front_Lib_Vue5 */6if (window.Vue === undefined) {7 throw new Error(`8Add9<script type="application/javascript" src="./src/vue/vue.global.prod.js"></script>10to your startup HTML to use Vue 3. 11`);12}13// export corresponds to Vue v. 3.2.23:14export const {15 BaseTransition,16 callWithAsyncErrorHandling,17 callWithErrorHandling,18 camelize,19 capitalize,20 cloneVNode,21 Comment,22 compatUtils,23 compile,24 computed,25 createApp,26 createBlock,27 createCommentVNode,28 createElementBlock,29 createElementVNode,30 createHydrationRenderer,31 createPropsRestProxy,32 createRenderer,33 createSlots,34 createSSRApp,35 createStaticVNode,36 createTextVNode,37 createVNode,38 customRef,39 defineAsyncComponent,40 defineComponent,41 defineCustomElement,42 defineEmits,43 defineExpose,44 defineProps,45 defineSSRCustomElement,46 effect,47 EffectScope,48 effectScope,49 Fragment,50 getCurrentInstance,51 getCurrentScope,52 getTransitionRawChildren,53 guardReactiveProps,54 h,55 handleError,56 hydrate,57 initCustomFormatter,58 initDirectivesForSSR,59 inject,60 isMemoSame,61 isProxy,62 isReactive,63 isReadonly,64 isRef,65 isRuntimeOnly,66 isVNode,67 KeepAlive,68 markRaw,69 mergeDefaults,70 mergeProps,71 nextTick,72 normalizeClass,73 normalizeProps,74 normalizeStyle,75 onActivated,76 onBeforeMount,77 onBeforeUnmount,78 onBeforeUpdate,79 onDeactivated,80 onErrorCaptured,81 onMounted,82 onRenderTracked,83 onRenderTriggered,84 onScopeDispose,85 onServerPrefetch,86 onUnmounted,87 onUpdated,88 openBlock,89 popScopeId,90 provide,91 proxyRefs,92 pushScopeId,93 queuePostFlushCb,94 reactive,95 ReactiveEffect,96 readonly,97 ref,98 registerRuntimeCompiler,99 render,100 renderList,101 renderSlot,102 resolveComponent,103 resolveDirective,104 resolveDynamicComponent,105 resolveFilter,106 resolveTransitionHooks,107 setBlockTracking,108 setDevtoolsHook,109 setTransitionHooks,110 shallowReactive,111 shallowReadonly,112 shallowRef,113 ssrContextKey,114 ssrUtils,115 Static,116 stop,117 Suspense,118 Teleport,119 Text,120 toDisplayString,121 toHandlerKey,122 toHandlers,123 toRaw,124 toRef,125 toRefs,126 transformVNodeArgs,127 Transition,128 TransitionGroup,129 triggerRef,130 unref,131 useAttrs,132 useCssModule,133 useCssVars,134 useSlots,135 useSSRContext,136 useTransitionState,137 version,138 vModelCheckbox,139 vModelDynamic,140 vModelRadio,141 vModelSelect,142 vModelText,143 vShow,144 VueElement,145 warn,146 watch,147 watchEffect,148 watchPostEffect,149 watchSyncEffect,150 withAsyncContext,151 withCtx,152 withDefaults,153 withDirectives,154 withKeys,155 withMemo,156 withModifiers,157 withScopeId,...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const playwright = require('playwright');2const { transformVNodeArgs } = require('playwright/lib/server/supplements/recorder/recorderSupplement');3(async () => {4 const browser = await playwright.chromium.launch();5 const page = await browser.newPage();6 const selector = 'text=Get started';7 const vNode = await page.$(selector);8 const { vNodeArgs } = await transformVNodeArgs(vNode);9 await browser.close();10})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { transformVNodeArgs } = require('@playwright/test/lib/transformVNodeArgs');2const { toMatchImageSnapshot } = require('jest-image-snapshot');3expect.extend({ toMatchImageSnapshot });4describe('test', () => {5 it('test', async ({ page }) => {6 const image = await page.screenshot();7 expect(image).toMatchImageSnapshot();8 });9});10const { transformVNodeArgs } = require('@playwright/test/lib/transformVNodeArgs');11const { toMatchImageSnapshot } = require('jest-image-snapshot');12expect.extend({ toMatchImageSnapshot });13describe('test', () => {14 it('test', async ({ page }) => {15 const image = await page.screenshot();16 expect(image).toMatchImageSnapshot();17 });18});19const { transformVNodeArgs } = require('@playwright/test/lib/transformVNodeArgs');20const { toMatchImageSnapshot } = require('jest-image-snapshot');21expect.extend({ toMatchImageSnapshot });22describe('test', () => {23 it('test', async ({ page }) => {24 const image = await page.screenshot();25 expect(image).toMatchImageSnapshot();26 });27});28### `toMatchImageSnapshot(options)`

Full Screen

Using AI Code Generation

copy

Full Screen

1const { transformVNodeArgs } = require('@playwright/test/lib/server/frames');2const { test } = require('@playwright/test');3test('test', async ({ page }) => {4 const selector = 'input[type="text"]';5 const args = transformVNodeArgs(page, { selector });6 console.log(args);7});8{9}

Full Screen

Using AI Code Generation

copy

Full Screen

1const { transformVNodeArgs } = require('playwright/lib/server/frames');2const { parse } = require('playwright/lib/server/supplements/vnode/vnodeTypes');3const { createJSHandle } = require('playwright/lib/server/supplements/utils/remoteObjects');4(async () => {5 {6 attributes: {7 },8 },9 ];10 const page = await browser.newPage();11 const result = await transformVNodeArgs(page, args);12 console.log(result);13})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { transformVNodeArgs } = require('playwright/lib/server/supplements/recorder/vnodedom');2const { parse } = require('playwright/lib/server/supplements/recorder/frames');3const { parse: parseSelector } = require('playwright/lib/server/supplements/recorder/selectorParser2');4const { parse: parseAction } = require('playwright/lib/server/supplements/recorder/actions');5const { parse: parseModifiers } = require('playwright/lib/server/supplements/recorder/modifiers');6(async () => {7 const { vNode, attributes, properties, events, style, pseudoElements, boundingBox, content, innerText, shadowRoots } = await page.evaluate(() => {8 const element = document.querySelector('button');9 const vNode = transformVNodeArgs(element);10 const { attributes, properties, events, style, pseudoElements, boundingBox, content, innerText, shadowRoots } = vNode;11 return { vNode, attributes, properties, events, style, pseudoElements, boundingBox, content, innerText, shadowRoots };12 });13 const frame = parse(vNode, attributes, properties, events, style, pseudoElements, boundingBox, content, innerText, shadowRoots);14 const selector = parseSelector(frame);15 const action = parseAction(frame);16 const modifiers = parseModifiers(frame);17 console.log(selector);18 console.log(action);19 console.log(modifiers);20})();21{22 { name: 'css', value: 'button', engine: 'css' }23}24{25 options: { position: { x: 0, y: 0 } }26}27{28}29MIT © [Mohammed Alshehri](

Full Screen

Using AI Code Generation

copy

Full Screen

1const { transformVNodeArgs } = require('@playwright/test/lib/server/vnodedom');2const { parse } = require('playwright-core/lib/server/supplements/recorder/frames');3const { transformVNodeArgs } = require('@playwright/test/lib/server/vnodedom');4const { parse } = require('playwright-core/lib/server/supplements/recorder/frames');5test('test', async ({ page }) => {6 const frame = page.mainFrame();7 const vNode = await frame._context._evaluateInternalHandle(() => document.body);8 const parsedVNode = parse(vNode);9 const transformedVNode = transformVNodeArgs(parsedVNode);10 console.log(transformedVNode);11});12{13 _attributes: { id: 'body' },14 {15 _attributes: { id: 'hplogo' },16 {17 {18 _attributes: {19 },20 }21 },22 {23 _attributes: { id: 'lga' },

Full Screen

Using AI Code Generation

copy

Full Screen

1const playwright = require('playwright');2const { transformVNodeArgs } = require('playwright/lib/server/supplements/recorder/vnodedom');3const { html, render } = require('htm/preact');4const { parse } = require('node-html-parser');5const { h } = require('preact');6const { test } = require('@playwright/test');7test('test', async ({ page }) => {8 await page.click('input[placeholder="What needs to be done?"]');9 await page.fill('input[placeholder="What needs to be done?"]', 'test');10 await page.press('input[placeholder="What needs to be done?"]', 'Enter');11 await page.click('input[placeholder="What needs to be done?"]');12 await page.fill('input[placeholder="What needs to be done?"]', 'test2');13 await page.press('input[placeholder="What needs to be done?"]', 'Enter');14 await page.click('input[placeholder="What needs to be done?"]');15 await page.fill('input[placeholder="What needs to be done?"]', 'test3');16 await page.press('input[placeholder="What needs to be done?"]', 'Enter');17 const html = await page.innerHTML('body');18 const root = parse(html);19 const vNode = root.childNodes[0];20 const transformedVNode = transformVNodeArgs(vNode);21 console.log(transformedVNode);22});23{24 attrs: {},25 {26 attrs: { id: 'app' },27 {28 attrs: { class: 'todoapp' },29 {30 attrs: { class: 'header' },31 {32 attrs: {},33 },34 {35 attrs: {36 },37 }38 },39 {40 attrs: { class

Full Screen

Using AI Code Generation

copy

Full Screen

1const { transformVNodeArgs } = require('@playwright/test/lib/server/frames');2const { test } = require('@playwright/test');3test('test', async ({ page }) => {4 const [vnode, ,] = transformVNodeArgs(page, 'div', { id: 'foo' }, []);5 expect(vnode.props.id).toBe('foo');6});7#### `frame.evaluateHandle(function[, arg1[, arg2[, ...]]])`8const divCount = await frame.evaluateHandle(() => document.querySelectorAll('div').length);9#### `frame.evaluate(function[, arg1[, arg2[, ...]]])`10const divCount = await frame.evaluate(() => document.querySelectorAll('div').length);11#### `frame.click(selector[, options])`

Full Screen

Using AI Code Generation

copy

Full Screen

1const { transformVNodeArgs } = require('@playwright/test');2const { test } = require('@playwright/test');3test('test', async ({ page }) => {4 page.click = transformVNodeArgs(page.click, (args, vNode) => {5 const [selector] = args;6 if (typeof selector === 'string') {7 args[0] = `[data-test-id="${selector}"]`;8 } else {9 args[0] = (element) => selector(element) && element.getAttribute('data-test-id');10 }11 return args;12 });13 await page.click('test-id');14});

Full Screen

Playwright tutorial

LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.

Chapters:

  1. What is Playwright : Playwright is comparatively new but has gained good popularity. Get to know some history of the Playwright with some interesting facts connected with it.
  2. How To Install Playwright : Learn in detail about what basic configuration and dependencies are required for installing Playwright and run a test. Get a step-by-step direction for installing the Playwright automation framework.
  3. Playwright Futuristic Features: Launched in 2020, Playwright gained huge popularity quickly because of some obliging features such as Playwright Test Generator and Inspector, Playwright Reporter, Playwright auto-waiting mechanism and etc. Read up on those features to master Playwright testing.
  4. What is Component Testing: Component testing in Playwright is a unique feature that allows a tester to test a single component of a web application without integrating them with other elements. Learn how to perform Component testing on the Playwright automation framework.
  5. Inputs And Buttons In Playwright: Every website has Input boxes and buttons; learn about testing inputs and buttons with different scenarios and examples.
  6. Functions and Selectors in Playwright: Learn how to launch the Chromium browser with Playwright. Also, gain a better understanding of some important functions like “BrowserContext,” which allows you to run multiple browser sessions, and “newPage” which interacts with a page.
  7. Handling Alerts and Dropdowns in Playwright : Playwright interact with different types of alerts and pop-ups, such as simple, confirmation, and prompt, and different types of dropdowns, such as single selector and multi-selector get your hands-on with handling alerts and dropdown in Playright testing.
  8. Playwright vs Puppeteer: Get to know about the difference between two testing frameworks and how they are different than one another, which browsers they support, and what features they provide.
  9. Run Playwright Tests on LambdaTest: Playwright testing with LambdaTest leverages test performance to the utmost. You can run multiple Playwright tests in Parallel with the LammbdaTest test cloud. Get a step-by-step guide to run your Playwright test on the LambdaTest platform.
  10. Playwright Python Tutorial: Playwright automation framework support all major languages such as Python, JavaScript, TypeScript, .NET and etc. However, there are various advantages to Python end-to-end testing with Playwright because of its versatile utility. Get the hang of Playwright python testing with this chapter.
  11. Playwright End To End Testing Tutorial: Get your hands on with Playwright end-to-end testing and learn to use some exciting features such as TraceViewer, Debugging, Networking, Component testing, Visual testing, and many more.
  12. Playwright Video Tutorial: Watch the video tutorials on Playwright testing from experts and get a consecutive in-depth explanation of Playwright automation testing.

Run Playwright Internal automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful