PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 3.0.1
Defender Security – Malware Scanner, Login Security & Firewall v3.0.1
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / assets / js / vendor / vue.runtime.js

vue.runtime.js in Defender Security – Malware Scanner, Login Security & Firewall 3.0.1, at assets/js/vendor/vue.runtime.js

8,424 lines 232.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*!
2 * Vue.js v2.6.10
3 * (c) 2014-2019 Evan You
4 * Released under the MIT License.
5 */
6 (function (global, factory) {
7 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8 typeof define === 'function' && define.amd ? define(factory) :
9 (global = global || self, global.Vue = factory());
10 }(this, function () { 'use strict';
11
12 /* */
13
14 var emptyObject = Object.freeze({});
15
16 // These helpers produce better VM code in JS engines due to their
17 // explicitness and function inlining.
18 function isUndef (v) {
19 return v === undefined || v === null
20 }
21
22 function isDef (v) {
23 return v !== undefined && v !== null
24 }
25
26 function isTrue (v) {
27 return v === true
28 }
29
30 function isFalse (v) {
31 return v === false
32 }
33
34 /**
35 * Check if value is primitive.
36 */
37 function isPrimitive (value) {
38 return (
39 typeof value === 'string' ||
40 typeof value === 'number' ||
41 // $flow-disable-line
42 typeof value === 'symbol' ||
43 typeof value === 'boolean'
44 )
45 }
46
47 /**
48 * Quick object check - this is primarily used to tell
49 * Objects from primitive values when we know the value
50 * is a JSON-compliant type.
51 */
52 function isObject (obj) {
53 return obj !== null && typeof obj === 'object'
54 }
55
56 /**
57 * Get the raw type string of a value, e.g., [object Object].
58 */
59 var _toString = Object.prototype.toString;
60
61 function toRawType (value) {
62 return _toString.call(value).slice(8, -1)
63 }
64
65 /**
66 * Strict object type check. Only returns true
67 * for plain JavaScript objects.
68 */
69 function isPlainObject (obj) {
70 return _toString.call(obj) === '[object Object]'
71 }
72
73 function isRegExp (v) {
74 return _toString.call(v) === '[object RegExp]'
75 }
76
77 /**
78 * Check if val is a valid array index.
79 */
80 function isValidArrayIndex (val) {
81 var n = parseFloat(String(val));
82 return n >= 0 && Math.floor(n) === n && isFinite(val)
83 }
84
85 function isPromise (val) {
86 return (
87 isDef(val) &&
88 typeof val.then === 'function' &&
89 typeof val.catch === 'function'
90 )
91 }
92
93 /**
94 * Convert a value to a string that is actually rendered.
95 */
96 function toString (val) {
97 return val == null
98 ? ''
99 : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
100 ? JSON.stringify(val, null, 2)
101 : String(val)
102 }
103
104 /**
105 * Convert an input value to a number for persistence.
106 * If the conversion fails, return original string.
107 */
108 function toNumber (val) {
109 var n = parseFloat(val);
110 return isNaN(n) ? val : n
111 }
112
113 /**
114 * Make a map and return a function for checking if a key
115 * is in that map.
116 */
117 function makeMap (
118 str,
119 expectsLowerCase
120 ) {
121 var map = Object.create(null);
122 var list = str.split(',');
123 for (var i = 0; i < list.length; i++) {
124 map[list[i]] = true;
125 }
126 return expectsLowerCase
127 ? function (val) { return map[val.toLowerCase()]; }
128 : function (val) { return map[val]; }
129 }
130
131 /**
132 * Check if a tag is a built-in tag.
133 */
134 var isBuiltInTag = makeMap('slot,component', true);
135
136 /**
137 * Check if an attribute is a reserved attribute.
138 */
139 var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
140
141 /**
142 * Remove an item from an array.
143 */
144 function remove (arr, item) {
145 if (arr.length) {
146 var index = arr.indexOf(item);
147 if (index > -1) {
148 return arr.splice(index, 1)
149 }
150 }
151 }
152
153 /**
154 * Check whether an object has the property.
155 */
156 var hasOwnProperty = Object.prototype.hasOwnProperty;
157 function hasOwn (obj, key) {
158 return hasOwnProperty.call(obj, key)
159 }
160
161 /**
162 * Create a cached version of a pure function.
163 */
164 function cached (fn) {
165 var cache = Object.create(null);
166 return (function cachedFn (str) {
167 var hit = cache[str];
168 return hit || (cache[str] = fn(str))
169 })
170 }
171
172 /**
173 * Camelize a hyphen-delimited string.
174 */
175 var camelizeRE = /-(\w)/g;
176 var camelize = cached(function (str) {
177 return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
178 });
179
180 /**
181 * Capitalize a string.
182 */
183 var capitalize = cached(function (str) {
184 return str.charAt(0).toUpperCase() + str.slice(1)
185 });
186
187 /**
188 * Hyphenate a camelCase string.
189 */
190 var hyphenateRE = /\B([A-Z])/g;
191 var hyphenate = cached(function (str) {
192 return str.replace(hyphenateRE, '-$1').toLowerCase()
193 });
194
195 /**
196 * Simple bind polyfill for environments that do not support it,
197 * e.g., PhantomJS 1.x. Technically, we don't need this anymore
198 * since native bind is now performant enough in most browsers.
199 * But removing it would mean breaking code that was able to run in
200 * PhantomJS 1.x, so this must be kept for backward compatibility.
201 */
202
203 /* istanbul ignore next */
204 function polyfillBind (fn, ctx) {
205 function boundFn (a) {
206 var l = arguments.length;
207 return l
208 ? l > 1
209 ? fn.apply(ctx, arguments)
210 : fn.call(ctx, a)
211 : fn.call(ctx)
212 }
213
214 boundFn._length = fn.length;
215 return boundFn
216 }
217
218 function nativeBind (fn, ctx) {
219 return fn.bind(ctx)
220 }
221
222 var bind = Function.prototype.bind
223 ? nativeBind
224 : polyfillBind;
225
226 /**
227 * Convert an Array-like object to a real Array.
228 */
229 function toArray (list, start) {
230 start = start || 0;
231 var i = list.length - start;
232 var ret = new Array(i);
233 while (i--) {
234 ret[i] = list[i + start];
235 }
236 return ret
237 }
238
239 /**
240 * Mix properties into target object.
241 */
242 function extend (to, _from) {
243 for (var key in _from) {
244 to[key] = _from[key];
245 }
246 return to
247 }
248
249 /**
250 * Merge an Array of Objects into a single Object.
251 */
252 function toObject (arr) {
253 var res = {};
254 for (var i = 0; i < arr.length; i++) {
255 if (arr[i]) {
256 extend(res, arr[i]);
257 }
258 }
259 return res
260 }
261
262 /* eslint-disable no-unused-vars */
263
264 /**
265 * Perform no operation.
266 * Stubbing args to make Flow happy without leaving useless transpiled code
267 * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
268 */
269 function noop (a, b, c) {}
270
271 /**
272 * Always return false.
273 */
274 var no = function (a, b, c) { return false; };
275
276 /* eslint-enable no-unused-vars */
277
278 /**
279 * Return the same value.
280 */
281 var identity = function (_) { return _; };
282
283 /**
284 * Check if two values are loosely equal - that is,
285 * if they are plain objects, do they have the same shape?
286 */
287 function looseEqual (a, b) {
288 if (a === b) { return true }
289 var isObjectA = isObject(a);
290 var isObjectB = isObject(b);
291 if (isObjectA && isObjectB) {
292 try {
293 var isArrayA = Array.isArray(a);
294 var isArrayB = Array.isArray(b);
295 if (isArrayA && isArrayB) {
296 return a.length === b.length && a.every(function (e, i) {
297 return looseEqual(e, b[i])
298 })
299 } else if (a instanceof Date && b instanceof Date) {
300 return a.getTime() === b.getTime()
301 } else if (!isArrayA && !isArrayB) {
302 var keysA = Object.keys(a);
303 var keysB = Object.keys(b);
304 return keysA.length === keysB.length && keysA.every(function (key) {
305 return looseEqual(a[key], b[key])
306 })
307 } else {
308 /* istanbul ignore next */
309 return false
310 }
311 } catch (e) {
312 /* istanbul ignore next */
313 return false
314 }
315 } else if (!isObjectA && !isObjectB) {
316 return String(a) === String(b)
317 } else {
318 return false
319 }
320 }
321
322 /**
323 * Return the first index at which a loosely equal value can be
324 * found in the array (if value is a plain object, the array must
325 * contain an object of the same shape), or -1 if it is not present.
326 */
327 function looseIndexOf (arr, val) {
328 for (var i = 0; i < arr.length; i++) {
329 if (looseEqual(arr[i], val)) { return i }
330 }
331 return -1
332 }
333
334 /**
335 * Ensure a function is called only once.
336 */
337 function once (fn) {
338 var called = false;
339 return function () {
340 if (!called) {
341 called = true;
342 fn.apply(this, arguments);
343 }
344 }
345 }
346
347 var SSR_ATTR = 'data-server-rendered';
348
349 var ASSET_TYPES = [
350 'component',
351 'directive',
352 'filter'
353 ];
354
355 var LIFECYCLE_HOOKS = [
356 'beforeCreate',
357 'created',
358 'beforeMount',
359 'mounted',
360 'beforeUpdate',
361 'updated',
362 'beforeDestroy',
363 'destroyed',
364 'activated',
365 'deactivated',
366 'errorCaptured',
367 'serverPrefetch'
368 ];
369
370 /* */
371
372
373
374 var config = ({
375 /**
376 * Option merge strategies (used in core/util/options)
377 */
378 // $flow-disable-line
379 optionMergeStrategies: Object.create(null),
380
381 /**
382 * Whether to suppress warnings.
383 */
384 silent: false,
385
386 /**
387 * Show production mode tip message on boot?
388 */
389 productionTip: "development" !== 'production',
390
391 /**
392 * Whether to enable devtools
393 */
394 devtools: "development" !== 'production',
395
396 /**
397 * Whether to record perf
398 */
399 performance: false,
400
401 /**
402 * Error handler for watcher errors
403 */
404 errorHandler: null,
405
406 /**
407 * Warn handler for watcher warns
408 */
409 warnHandler: null,
410
411 /**
412 * Ignore certain custom elements
413 */
414 ignoredElements: [],
415
416 /**
417 * Custom user key aliases for v-on
418 */
419 // $flow-disable-line
420 keyCodes: Object.create(null),
421
422 /**
423 * Check if a tag is reserved so that it cannot be registered as a
424 * component. This is platform-dependent and may be overwritten.
425 */
426 isReservedTag: no,
427
428 /**
429 * Check if an attribute is reserved so that it cannot be used as a component
430 * prop. This is platform-dependent and may be overwritten.
431 */
432 isReservedAttr: no,
433
434 /**
435 * Check if a tag is an unknown element.
436 * Platform-dependent.
437 */
438 isUnknownElement: no,
439
440 /**
441 * Get the namespace of an element
442 */
443 getTagNamespace: noop,
444
445 /**
446 * Parse the real tag name for the specific platform.
447 */
448 parsePlatformTagName: identity,
449
450 /**
451 * Check if an attribute must be bound using property, e.g. value
452 * Platform-dependent.
453 */
454 mustUseProp: no,
455
456 /**
457 * Perform updates asynchronously. Intended to be used by Vue Test Utils
458 * This will significantly reduce performance if set to false.
459 */
460 async: true,
461
462 /**
463 * Exposed for legacy reasons
464 */
465 _lifecycleHooks: LIFECYCLE_HOOKS
466 });
467
468 /* */
469
470 /**
471 * unicode letters used for parsing html tags, component names and property paths.
472 * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
473 * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
474 */
475 var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
476
477 /**
478 * Check if a string starts with $ or _
479 */
480 function isReserved (str) {
481 var c = (str + '').charCodeAt(0);
482 return c === 0x24 || c === 0x5F
483 }
484
485 /**
486 * Define a property.
487 */
488 function def (obj, key, val, enumerable) {
489 Object.defineProperty(obj, key, {
490 value: val,
491 enumerable: !!enumerable,
492 writable: true,
493 configurable: true
494 });
495 }
496
497 /**
498 * Parse simple path.
499 */
500 var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
501 function parsePath (path) {
502 if (bailRE.test(path)) {
503 return
504 }
505 var segments = path.split('.');
506 return function (obj) {
507 for (var i = 0; i < segments.length; i++) {
508 if (!obj) { return }
509 obj = obj[segments[i]];
510 }
511 return obj
512 }
513 }
514
515 /* */
516
517 // can we use __proto__?
518 var hasProto = '__proto__' in {};
519
520 // Browser environment sniffing
521 var inBrowser = typeof window !== 'undefined';
522 var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
523 var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
524 var UA = inBrowser && window.navigator.userAgent.toLowerCase();
525 var isIE = UA && /msie|trident/.test(UA);
526 var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
527 var isEdge = UA && UA.indexOf('edge/') > 0;
528 var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
529 var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
530 var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
531 var isPhantomJS = UA && /phantomjs/.test(UA);
532 var isFF = UA && UA.match(/firefox\/(\d+)/);
533
534 // Firefox has a "watch" function on Object.prototype...
535 var nativeWatch = ({}).watch;
536
537 var supportsPassive = false;
538 if (inBrowser) {
539 try {
540 var opts = {};
541 Object.defineProperty(opts, 'passive', ({
542 get: function get () {
543 /* istanbul ignore next */
544 supportsPassive = true;
545 }
546 })); // https://github.com/facebook/flow/issues/285
547 window.addEventListener('test-passive', null, opts);
548 } catch (e) {}
549 }
550
551 // this needs to be lazy-evaled because vue may be required before
552 // vue-server-renderer can set VUE_ENV
553 var _isServer;
554 var isServerRendering = function () {
555 if (_isServer === undefined) {
556 /* istanbul ignore if */
557 if (!inBrowser && !inWeex && typeof global !== 'undefined') {
558 // detect presence of vue-server-renderer and avoid
559 // Webpack shimming the process
560 _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
561 } else {
562 _isServer = false;
563 }
564 }
565 return _isServer
566 };
567
568 // detect devtools
569 var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
570
571 /* istanbul ignore next */
572 function isNative (Ctor) {
573 return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
574 }
575
576 var hasSymbol =
577 typeof Symbol !== 'undefined' && isNative(Symbol) &&
578 typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
579
580 var _Set;
581 /* istanbul ignore if */ // $flow-disable-line
582 if (typeof Set !== 'undefined' && isNative(Set)) {
583 // use native Set when available.
584 _Set = Set;
585 } else {
586 // a non-standard Set polyfill that only works with primitive keys.
587 _Set = /*@__PURE__*/(function () {
588 function Set () {
589 this.set = Object.create(null);
590 }
591 Set.prototype.has = function has (key) {
592 return this.set[key] === true
593 };
594 Set.prototype.add = function add (key) {
595 this.set[key] = true;
596 };
597 Set.prototype.clear = function clear () {
598 this.set = Object.create(null);
599 };
600
601 return Set;
602 }());
603 }
604
605 /* */
606
607 var warn = noop;
608 var tip = noop;
609 var generateComponentTrace = (noop); // work around flow check
610 var formatComponentName = (noop);
611
612 {
613 var hasConsole = typeof console !== 'undefined';
614 var classifyRE = /(?:^|[-_])(\w)/g;
615 var classify = function (str) { return str
616 .replace(classifyRE, function (c) { return c.toUpperCase(); })
617 .replace(/[-_]/g, ''); };
618
619 warn = function (msg, vm) {
620 var trace = vm ? generateComponentTrace(vm) : '';
621
622 if (config.warnHandler) {
623 config.warnHandler.call(null, msg, vm, trace);
624 } else if (hasConsole && (!config.silent)) {
625 console.error(("[Vue warn]: " + msg + trace));
626 }
627 };
628
629 tip = function (msg, vm) {
630 if (hasConsole && (!config.silent)) {
631 console.warn("[Vue tip]: " + msg + (
632 vm ? generateComponentTrace(vm) : ''
633 ));
634 }
635 };
636
637 formatComponentName = function (vm, includeFile) {
638 if (vm.$root === vm) {
639 return '<Root>'
640 }
641 var options = typeof vm === 'function' && vm.cid != null
642 ? vm.options
643 : vm._isVue
644 ? vm.$options || vm.constructor.options
645 : vm;
646 var name = options.name || options._componentTag;
647 var file = options.__file;
648 if (!name && file) {
649 var match = file.match(/([^/\\]+)\.vue$/);
650 name = match && match[1];
651 }
652
653 return (
654 (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
655 (file && includeFile !== false ? (" at " + file) : '')
656 )
657 };
658
659 var repeat = function (str, n) {
660 var res = '';
661 while (n) {
662 if (n % 2 === 1) { res += str; }
663 if (n > 1) { str += str; }
664 n >>= 1;
665 }
666 return res
667 };
668
669 generateComponentTrace = function (vm) {
670 if (vm._isVue && vm.$parent) {
671 var tree = [];
672 var currentRecursiveSequence = 0;
673 while (vm) {
674 if (tree.length > 0) {
675 var last = tree[tree.length - 1];
676 if (last.constructor === vm.constructor) {
677 currentRecursiveSequence++;
678 vm = vm.$parent;
679 continue
680 } else if (currentRecursiveSequence > 0) {
681 tree[tree.length - 1] = [last, currentRecursiveSequence];
682 currentRecursiveSequence = 0;
683 }
684 }
685 tree.push(vm);
686 vm = vm.$parent;
687 }
688 return '\n\nfound in\n\n' + tree
689 .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
690 ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
691 : formatComponentName(vm))); })
692 .join('\n')
693 } else {
694 return ("\n\n(found in " + (formatComponentName(vm)) + ")")
695 }
696 };
697 }
698
699 /* */
700
701 var uid = 0;
702
703 /**
704 * A dep is an observable that can have multiple
705 * directives subscribing to it.
706 */
707 var Dep = function Dep () {
708 this.id = uid++;
709 this.subs = [];
710 };
711
712 Dep.prototype.addSub = function addSub (sub) {
713 this.subs.push(sub);
714 };
715
716 Dep.prototype.removeSub = function removeSub (sub) {
717 remove(this.subs, sub);
718 };
719
720 Dep.prototype.depend = function depend () {
721 if (Dep.target) {
722 Dep.target.addDep(this);
723 }
724 };
725
726 Dep.prototype.notify = function notify () {
727 // stabilize the subscriber list first
728 var subs = this.subs.slice();
729 if (!config.async) {
730 // subs aren't sorted in scheduler if not running async
731 // we need to sort them now to make sure they fire in correct
732 // order
733 subs.sort(function (a, b) { return a.id - b.id; });
734 }
735 for (var i = 0, l = subs.length; i < l; i++) {
736 subs[i].update();
737 }
738 };
739
740 // The current target watcher being evaluated.
741 // This is globally unique because only one watcher
742 // can be evaluated at a time.
743 Dep.target = null;
744 var targetStack = [];
745
746 function pushTarget (target) {
747 targetStack.push(target);
748 Dep.target = target;
749 }
750
751 function popTarget () {
752 targetStack.pop();
753 Dep.target = targetStack[targetStack.length - 1];
754 }
755
756 /* */
757
758 var VNode = function VNode (
759 tag,
760 data,
761 children,
762 text,
763 elm,
764 context,
765 componentOptions,
766 asyncFactory
767 ) {
768 this.tag = tag;
769 this.data = data;
770 this.children = children;
771 this.text = text;
772 this.elm = elm;
773 this.ns = undefined;
774 this.context = context;
775 this.fnContext = undefined;
776 this.fnOptions = undefined;
777 this.fnScopeId = undefined;
778 this.key = data && data.key;
779 this.componentOptions = componentOptions;
780 this.componentInstance = undefined;
781 this.parent = undefined;
782 this.raw = false;
783 this.isStatic = false;
784 this.isRootInsert = true;
785 this.isComment = false;
786 this.isCloned = false;
787 this.isOnce = false;
788 this.asyncFactory = asyncFactory;
789 this.asyncMeta = undefined;
790 this.isAsyncPlaceholder = false;
791 };
792
793 var prototypeAccessors = { child: { configurable: true } };
794
795 // DEPRECATED: alias for componentInstance for backwards compat.
796 /* istanbul ignore next */
797 prototypeAccessors.child.get = function () {
798 return this.componentInstance
799 };
800
801 Object.defineProperties( VNode.prototype, prototypeAccessors );
802
803 var createEmptyVNode = function (text) {
804 if ( text === void 0 ) text = '';
805
806 var node = new VNode();
807 node.text = text;
808 node.isComment = true;
809 return node
810 };
811
812 function createTextVNode (val) {
813 return new VNode(undefined, undefined, undefined, String(val))
814 }
815
816 // optimized shallow clone
817 // used for static nodes and slot nodes because they may be reused across
818 // multiple renders, cloning them avoids errors when DOM manipulations rely
819 // on their elm reference.
820 function cloneVNode (vnode) {
821 var cloned = new VNode(
822 vnode.tag,
823 vnode.data,
824 // #7975
825 // clone children array to avoid mutating original in case of cloning
826 // a child.
827 vnode.children && vnode.children.slice(),
828 vnode.text,
829 vnode.elm,
830 vnode.context,
831 vnode.componentOptions,
832 vnode.asyncFactory
833 );
834 cloned.ns = vnode.ns;
835 cloned.isStatic = vnode.isStatic;
836 cloned.key = vnode.key;
837 cloned.isComment = vnode.isComment;
838 cloned.fnContext = vnode.fnContext;
839 cloned.fnOptions = vnode.fnOptions;
840 cloned.fnScopeId = vnode.fnScopeId;
841 cloned.asyncMeta = vnode.asyncMeta;
842 cloned.isCloned = true;
843 return cloned
844 }
845
846 /*
847 * not type checking this file because flow doesn't play well with
848 * dynamically accessing methods on Array prototype
849 */
850
851 var arrayProto = Array.prototype;
852 var arrayMethods = Object.create(arrayProto);
853
854 var methodsToPatch = [
855 'push',
856 'pop',
857 'shift',
858 'unshift',
859 'splice',
860 'sort',
861 'reverse'
862 ];
863
864 /**
865 * Intercept mutating methods and emit events
866 */
867 methodsToPatch.forEach(function (method) {
868 // cache original method
869 var original = arrayProto[method];
870 def(arrayMethods, method, function mutator () {
871 var args = [], len = arguments.length;
872 while ( len-- ) args[ len ] = arguments[ len ];
873
874 var result = original.apply(this, args);
875 var ob = this.__ob__;
876 var inserted;
877 switch (method) {
878 case 'push':
879 case 'unshift':
880 inserted = args;
881 break
882 case 'splice':
883 inserted = args.slice(2);
884 break
885 }
886 if (inserted) { ob.observeArray(inserted); }
887 // notify change
888 ob.dep.notify();
889 return result
890 });
891 });
892
893 /* */
894
895 var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
896
897 /**
898 * In some cases we may want to disable observation inside a component's
899 * update computation.
900 */
901 var shouldObserve = true;
902
903 function toggleObserving (value) {
904 shouldObserve = value;
905 }
906
907 /**
908 * Observer class that is attached to each observed
909 * object. Once attached, the observer converts the target
910 * object's property keys into getter/setters that
911 * collect dependencies and dispatch updates.
912 */
913 var Observer = function Observer (value) {
914 this.value = value;
915 this.dep = new Dep();
916 this.vmCount = 0;
917 def(value, '__ob__', this);
918 if (Array.isArray(value)) {
919 if (hasProto) {
920 protoAugment(value, arrayMethods);
921 } else {
922 copyAugment(value, arrayMethods, arrayKeys);
923 }
924 this.observeArray(value);
925 } else {
926 this.walk(value);
927 }
928 };
929
930 /**
931 * Walk through all properties and convert them into
932 * getter/setters. This method should only be called when
933 * value type is Object.
934 */
935 Observer.prototype.walk = function walk (obj) {
936 var keys = Object.keys(obj);
937 for (var i = 0; i < keys.length; i++) {
938 defineReactive$$1(obj, keys[i]);
939 }
940 };
941
942 /**
943 * Observe a list of Array items.
944 */
945 Observer.prototype.observeArray = function observeArray (items) {
946 for (var i = 0, l = items.length; i < l; i++) {
947 observe(items[i]);
948 }
949 };
950
951 // helpers
952
953 /**
954 * Augment a target Object or Array by intercepting
955 * the prototype chain using __proto__
956 */
957 function protoAugment (target, src) {
958 /* eslint-disable no-proto */
959 target.__proto__ = src;
960 /* eslint-enable no-proto */
961 }
962
963 /**
964 * Augment a target Object or Array by defining
965 * hidden properties.
966 */
967 /* istanbul ignore next */
968 function copyAugment (target, src, keys) {
969 for (var i = 0, l = keys.length; i < l; i++) {
970 var key = keys[i];
971 def(target, key, src[key]);
972 }
973 }
974
975 /**
976 * Attempt to create an observer instance for a value,
977 * returns the new observer if successfully observed,
978 * or the existing observer if the value already has one.
979 */
980 function observe (value, asRootData) {
981 if (!isObject(value) || value instanceof VNode) {
982 return
983 }
984 var ob;
985 if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
986 ob = value.__ob__;
987 } else if (
988 shouldObserve &&
989 !isServerRendering() &&
990 (Array.isArray(value) || isPlainObject(value)) &&
991 Object.isExtensible(value) &&
992 !value._isVue
993 ) {
994 ob = new Observer(value);
995 }
996 if (asRootData && ob) {
997 ob.vmCount++;
998 }
999 return ob
1000 }
1001
1002 /**
1003 * Define a reactive property on an Object.
1004 */
1005 function defineReactive$$1 (
1006 obj,
1007 key,
1008 val,
1009 customSetter,
1010 shallow
1011 ) {
1012 var dep = new Dep();
1013
1014 var property = Object.getOwnPropertyDescriptor(obj, key);
1015 if (property && property.configurable === false) {
1016 return
1017 }
1018
1019 // cater for pre-defined getter/setters
1020 var getter = property && property.get;
1021 var setter = property && property.set;
1022 if ((!getter || setter) && arguments.length === 2) {
1023 val = obj[key];
1024 }
1025
1026 var childOb = !shallow && observe(val);
1027 Object.defineProperty(obj, key, {
1028 enumerable: true,
1029 configurable: true,
1030 get: function reactiveGetter () {
1031 var value = getter ? getter.call(obj) : val;
1032 if (Dep.target) {
1033 dep.depend();
1034 if (childOb) {
1035 childOb.dep.depend();
1036 if (Array.isArray(value)) {
1037 dependArray(value);
1038 }
1039 }
1040 }
1041 return value
1042 },
1043 set: function reactiveSetter (newVal) {
1044 var value = getter ? getter.call(obj) : val;
1045 /* eslint-disable no-self-compare */
1046 if (newVal === value || (newVal !== newVal && value !== value)) {
1047 return
1048 }
1049 /* eslint-enable no-self-compare */
1050 if (customSetter) {
1051 customSetter();
1052 }
1053 // #7981: for accessor properties without setter
1054 if (getter && !setter) { return }
1055 if (setter) {
1056 setter.call(obj, newVal);
1057 } else {
1058 val = newVal;
1059 }
1060 childOb = !shallow && observe(newVal);
1061 dep.notify();
1062 }
1063 });
1064 }
1065
1066 /**
1067 * Set a property on an object. Adds the new property and
1068 * triggers change notification if the property doesn't
1069 * already exist.
1070 */
1071 function set (target, key, val) {
1072 if (isUndef(target) || isPrimitive(target)
1073 ) {
1074 warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
1075 }
1076 if (Array.isArray(target) && isValidArrayIndex(key)) {
1077 target.length = Math.max(target.length, key);
1078 target.splice(key, 1, val);
1079 return val
1080 }
1081 if (key in target && !(key in Object.prototype)) {
1082 target[key] = val;
1083 return val
1084 }
1085 var ob = (target).__ob__;
1086 if (target._isVue || (ob && ob.vmCount)) {
1087 warn(
1088 'Avoid adding reactive properties to a Vue instance or its root $data ' +
1089 'at runtime - declare it upfront in the data option.'
1090 );
1091 return val
1092 }
1093 if (!ob) {
1094 target[key] = val;
1095 return val
1096 }
1097 defineReactive$$1(ob.value, key, val);
1098 ob.dep.notify();
1099 return val
1100 }
1101
1102 /**
1103 * Delete a property and trigger change if necessary.
1104 */
1105 function del (target, key) {
1106 if (isUndef(target) || isPrimitive(target)
1107 ) {
1108 warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
1109 }
1110 if (Array.isArray(target) && isValidArrayIndex(key)) {
1111 target.splice(key, 1);
1112 return
1113 }
1114 var ob = (target).__ob__;
1115 if (target._isVue || (ob && ob.vmCount)) {
1116 warn(
1117 'Avoid deleting properties on a Vue instance or its root $data ' +
1118 '- just set it to null.'
1119 );
1120 return
1121 }
1122 if (!hasOwn(target, key)) {
1123 return
1124 }
1125 delete target[key];
1126 if (!ob) {
1127 return
1128 }
1129 ob.dep.notify();
1130 }
1131
1132 /**
1133 * Collect dependencies on array elements when the array is touched, since
1134 * we cannot intercept array element access like property getters.
1135 */
1136 function dependArray (value) {
1137 for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
1138 e = value[i];
1139 e && e.__ob__ && e.__ob__.dep.depend();
1140 if (Array.isArray(e)) {
1141 dependArray(e);
1142 }
1143 }
1144 }
1145
1146 /* */
1147
1148 /**
1149 * Option overwriting strategies are functions that handle
1150 * how to merge a parent option value and a child option
1151 * value into the final value.
1152 */
1153 var strats = config.optionMergeStrategies;
1154
1155 /**
1156 * Options with restrictions
1157 */
1158 {
1159 strats.el = strats.propsData = function (parent, child, vm, key) {
1160 if (!vm) {
1161 warn(
1162 "option \"" + key + "\" can only be used during instance " +
1163 'creation with the `new` keyword.'
1164 );
1165 }
1166 return defaultStrat(parent, child)
1167 };
1168 }
1169
1170 /**
1171 * Helper that recursively merges two data objects together.
1172 */
1173 function mergeData (to, from) {
1174 if (!from) { return to }
1175 var key, toVal, fromVal;
1176
1177 var keys = hasSymbol
1178 ? Reflect.ownKeys(from)
1179 : Object.keys(from);
1180
1181 for (var i = 0; i < keys.length; i++) {
1182 key = keys[i];
1183 // in case the object is already observed...
1184 if (key === '__ob__') { continue }
1185 toVal = to[key];
1186 fromVal = from[key];
1187 if (!hasOwn(to, key)) {
1188 set(to, key, fromVal);
1189 } else if (
1190 toVal !== fromVal &&
1191 isPlainObject(toVal) &&
1192 isPlainObject(fromVal)
1193 ) {
1194 mergeData(toVal, fromVal);
1195 }
1196 }
1197 return to
1198 }
1199
1200 /**
1201 * Data
1202 */
1203 function mergeDataOrFn (
1204 parentVal,
1205 childVal,
1206 vm
1207 ) {
1208 if (!vm) {
1209 // in a Vue.extend merge, both should be functions
1210 if (!childVal) {
1211 return parentVal
1212 }
1213 if (!parentVal) {
1214 return childVal
1215 }
1216 // when parentVal & childVal are both present,
1217 // we need to return a function that returns the
1218 // merged result of both functions... no need to
1219 // check if parentVal is a function here because
1220 // it has to be a function to pass previous merges.
1221 return function mergedDataFn () {
1222 return mergeData(
1223 typeof childVal === 'function' ? childVal.call(this, this) : childVal,
1224 typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
1225 )
1226 }
1227 } else {
1228 return function mergedInstanceDataFn () {
1229 // instance merge
1230 var instanceData = typeof childVal === 'function'
1231 ? childVal.call(vm, vm)
1232 : childVal;
1233 var defaultData = typeof parentVal === 'function'
1234 ? parentVal.call(vm, vm)
1235 : parentVal;
1236 if (instanceData) {
1237 return mergeData(instanceData, defaultData)
1238 } else {
1239 return defaultData
1240 }
1241 }
1242 }
1243 }
1244
1245 strats.data = function (
1246 parentVal,
1247 childVal,
1248 vm
1249 ) {
1250 if (!vm) {
1251 if (childVal && typeof childVal !== 'function') {
1252 warn(
1253 'The "data" option should be a function ' +
1254 'that returns a per-instance value in component ' +
1255 'definitions.',
1256 vm
1257 );
1258
1259 return parentVal
1260 }
1261 return mergeDataOrFn(parentVal, childVal)
1262 }
1263
1264 return mergeDataOrFn(parentVal, childVal, vm)
1265 };
1266
1267 /**
1268 * Hooks and props are merged as arrays.
1269 */
1270 function mergeHook (
1271 parentVal,
1272 childVal
1273 ) {
1274 var res = childVal
1275 ? parentVal
1276 ? parentVal.concat(childVal)
1277 : Array.isArray(childVal)
1278 ? childVal
1279 : [childVal]
1280 : parentVal;
1281 return res
1282 ? dedupeHooks(res)
1283 : res
1284 }
1285
1286 function dedupeHooks (hooks) {
1287 var res = [];
1288 for (var i = 0; i < hooks.length; i++) {
1289 if (res.indexOf(hooks[i]) === -1) {
1290 res.push(hooks[i]);
1291 }
1292 }
1293 return res
1294 }
1295
1296 LIFECYCLE_HOOKS.forEach(function (hook) {
1297 strats[hook] = mergeHook;
1298 });
1299
1300 /**
1301 * Assets
1302 *
1303 * When a vm is present (instance creation), we need to do
1304 * a three-way merge between constructor options, instance
1305 * options and parent options.
1306 */
1307 function mergeAssets (
1308 parentVal,
1309 childVal,
1310 vm,
1311 key
1312 ) {
1313 var res = Object.create(parentVal || null);
1314 if (childVal) {
1315 assertObjectType(key, childVal, vm);
1316 return extend(res, childVal)
1317 } else {
1318 return res
1319 }
1320 }
1321
1322 ASSET_TYPES.forEach(function (type) {
1323 strats[type + 's'] = mergeAssets;
1324 });
1325
1326 /**
1327 * Watchers.
1328 *
1329 * Watchers hashes should not overwrite one
1330 * another, so we merge them as arrays.
1331 */
1332 strats.watch = function (
1333 parentVal,
1334 childVal,
1335 vm,
1336 key
1337 ) {
1338 // work around Firefox's Object.prototype.watch...
1339 if (parentVal === nativeWatch) { parentVal = undefined; }
1340 if (childVal === nativeWatch) { childVal = undefined; }
1341 /* istanbul ignore if */
1342 if (!childVal) { return Object.create(parentVal || null) }
1343 {
1344 assertObjectType(key, childVal, vm);
1345 }
1346 if (!parentVal) { return childVal }
1347 var ret = {};
1348 extend(ret, parentVal);
1349 for (var key$1 in childVal) {
1350 var parent = ret[key$1];
1351 var child = childVal[key$1];
1352 if (parent && !Array.isArray(parent)) {
1353 parent = [parent];
1354 }
1355 ret[key$1] = parent
1356 ? parent.concat(child)
1357 : Array.isArray(child) ? child : [child];
1358 }
1359 return ret
1360 };
1361
1362 /**
1363 * Other object hashes.
1364 */
1365 strats.props =
1366 strats.methods =
1367 strats.inject =
1368 strats.computed = function (
1369 parentVal,
1370 childVal,
1371 vm,
1372 key
1373 ) {
1374 if (childVal && "development" !== 'production') {
1375 assertObjectType(key, childVal, vm);
1376 }
1377 if (!parentVal) { return childVal }
1378 var ret = Object.create(null);
1379 extend(ret, parentVal);
1380 if (childVal) { extend(ret, childVal); }
1381 return ret
1382 };
1383 strats.provide = mergeDataOrFn;
1384
1385 /**
1386 * Default strategy.
1387 */
1388 var defaultStrat = function (parentVal, childVal) {
1389 return childVal === undefined
1390 ? parentVal
1391 : childVal
1392 };
1393
1394 /**
1395 * Validate component names
1396 */
1397 function checkComponents (options) {
1398 for (var key in options.components) {
1399 validateComponentName(key);
1400 }
1401 }
1402
1403 function validateComponentName (name) {
1404 if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
1405 warn(
1406 'Invalid component name: "' + name + '". Component names ' +
1407 'should conform to valid custom element name in html5 specification.'
1408 );
1409 }
1410 if (isBuiltInTag(name) || config.isReservedTag(name)) {
1411 warn(
1412 'Do not use built-in or reserved HTML elements as component ' +
1413 'id: ' + name
1414 );
1415 }
1416 }
1417
1418 /**
1419 * Ensure all props option syntax are normalized into the
1420 * Object-based format.
1421 */
1422 function normalizeProps (options, vm) {
1423 var props = options.props;
1424 if (!props) { return }
1425 var res = {};
1426 var i, val, name;
1427 if (Array.isArray(props)) {
1428 i = props.length;
1429 while (i--) {
1430 val = props[i];
1431 if (typeof val === 'string') {
1432 name = camelize(val);
1433 res[name] = { type: null };
1434 } else {
1435 warn('props must be strings when using array syntax.');
1436 }
1437 }
1438 } else if (isPlainObject(props)) {
1439 for (var key in props) {
1440 val = props[key];
1441 name = camelize(key);
1442 res[name] = isPlainObject(val)
1443 ? val
1444 : { type: val };
1445 }
1446 } else {
1447 warn(
1448 "Invalid value for option \"props\": expected an Array or an Object, " +
1449 "but got " + (toRawType(props)) + ".",
1450 vm
1451 );
1452 }
1453 options.props = res;
1454 }
1455
1456 /**
1457 * Normalize all injections into Object-based format
1458 */
1459 function normalizeInject (options, vm) {
1460 var inject = options.inject;
1461 if (!inject) { return }
1462 var normalized = options.inject = {};
1463 if (Array.isArray(inject)) {
1464 for (var i = 0; i < inject.length; i++) {
1465 normalized[inject[i]] = { from: inject[i] };
1466 }
1467 } else if (isPlainObject(inject)) {
1468 for (var key in inject) {
1469 var val = inject[key];
1470 normalized[key] = isPlainObject(val)
1471 ? extend({ from: key }, val)
1472 : { from: val };
1473 }
1474 } else {
1475 warn(
1476 "Invalid value for option \"inject\": expected an Array or an Object, " +
1477 "but got " + (toRawType(inject)) + ".",
1478 vm
1479 );
1480 }
1481 }
1482
1483 /**
1484 * Normalize raw function directives into object format.
1485 */
1486 function normalizeDirectives (options) {
1487 var dirs = options.directives;
1488 if (dirs) {
1489 for (var key in dirs) {
1490 var def$$1 = dirs[key];
1491 if (typeof def$$1 === 'function') {
1492 dirs[key] = { bind: def$$1, update: def$$1 };
1493 }
1494 }
1495 }
1496 }
1497
1498 function assertObjectType (name, value, vm) {
1499 if (!isPlainObject(value)) {
1500 warn(
1501 "Invalid value for option \"" + name + "\": expected an Object, " +
1502 "but got " + (toRawType(value)) + ".",
1503 vm
1504 );
1505 }
1506 }
1507
1508 /**
1509 * Merge two option objects into a new one.
1510 * Core utility used in both instantiation and inheritance.
1511 */
1512 function mergeOptions (
1513 parent,
1514 child,
1515 vm
1516 ) {
1517 {
1518 checkComponents(child);
1519 }
1520
1521 if (typeof child === 'function') {
1522 child = child.options;
1523 }
1524
1525 normalizeProps(child, vm);
1526 normalizeInject(child, vm);
1527 normalizeDirectives(child);
1528
1529 // Apply extends and mixins on the child options,
1530 // but only if it is a raw options object that isn't
1531 // the result of another mergeOptions call.
1532 // Only merged options has the _base property.
1533 if (!child._base) {
1534 if (child.extends) {
1535 parent = mergeOptions(parent, child.extends, vm);
1536 }
1537 if (child.mixins) {
1538 for (var i = 0, l = child.mixins.length; i < l; i++) {
1539 parent = mergeOptions(parent, child.mixins[i], vm);
1540 }
1541 }
1542 }
1543
1544 var options = {};
1545 var key;
1546 for (key in parent) {
1547 mergeField(key);
1548 }
1549 for (key in child) {
1550 if (!hasOwn(parent, key)) {
1551 mergeField(key);
1552 }
1553 }
1554 function mergeField (key) {
1555 var strat = strats[key] || defaultStrat;
1556 options[key] = strat(parent[key], child[key], vm, key);
1557 }
1558 return options
1559 }
1560
1561 /**
1562 * Resolve an asset.
1563 * This function is used because child instances need access
1564 * to assets defined in its ancestor chain.
1565 */
1566 function resolveAsset (
1567 options,
1568 type,
1569 id,
1570 warnMissing
1571 ) {
1572 /* istanbul ignore if */
1573 if (typeof id !== 'string') {
1574 return
1575 }
1576 var assets = options[type];
1577 // check local registration variations first
1578 if (hasOwn(assets, id)) { return assets[id] }
1579 var camelizedId = camelize(id);
1580 if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
1581 var PascalCaseId = capitalize(camelizedId);
1582 if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
1583 // fallback to prototype chain
1584 var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
1585 if (warnMissing && !res) {
1586 warn(
1587 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
1588 options
1589 );
1590 }
1591 return res
1592 }
1593
1594 /* */
1595
1596
1597
1598 function validateProp (
1599 key,
1600 propOptions,
1601 propsData,
1602 vm
1603 ) {
1604 var prop = propOptions[key];
1605 var absent = !hasOwn(propsData, key);
1606 var value = propsData[key];
1607 // boolean casting
1608 var booleanIndex = getTypeIndex(Boolean, prop.type);
1609 if (booleanIndex > -1) {
1610 if (absent && !hasOwn(prop, 'default')) {
1611 value = false;
1612 } else if (value === '' || value === hyphenate(key)) {
1613 // only cast empty string / same name to boolean if
1614 // boolean has higher priority
1615 var stringIndex = getTypeIndex(String, prop.type);
1616 if (stringIndex < 0 || booleanIndex < stringIndex) {
1617 value = true;
1618 }
1619 }
1620 }
1621 // check default value
1622 if (value === undefined) {
1623 value = getPropDefaultValue(vm, prop, key);
1624 // since the default value is a fresh copy,
1625 // make sure to observe it.
1626 var prevShouldObserve = shouldObserve;
1627 toggleObserving(true);
1628 observe(value);
1629 toggleObserving(prevShouldObserve);
1630 }
1631 {
1632 assertProp(prop, key, value, vm, absent);
1633 }
1634 return value
1635 }
1636
1637 /**
1638 * Get the default value of a prop.
1639 */
1640 function getPropDefaultValue (vm, prop, key) {
1641 // no default, return undefined
1642 if (!hasOwn(prop, 'default')) {
1643 return undefined
1644 }
1645 var def = prop.default;
1646 // warn against non-factory defaults for Object & Array
1647 if (isObject(def)) {
1648 warn(
1649 'Invalid default value for prop "' + key + '": ' +
1650 'Props with type Object/Array must use a factory function ' +
1651 'to return the default value.',
1652 vm
1653 );
1654 }
1655 // the raw prop value was also undefined from previous render,
1656 // return previous default value to avoid unnecessary watcher trigger
1657 if (vm && vm.$options.propsData &&
1658 vm.$options.propsData[key] === undefined &&
1659 vm._props[key] !== undefined
1660 ) {
1661 return vm._props[key]
1662 }
1663 // call factory function for non-Function types
1664 // a value is Function if its prototype is function even across different execution context
1665 return typeof def === 'function' && getType(prop.type) !== 'Function'
1666 ? def.call(vm)
1667 : def
1668 }
1669
1670 /**
1671 * Assert whether a prop is valid.
1672 */
1673 function assertProp (
1674 prop,
1675 name,
1676 value,
1677 vm,
1678 absent
1679 ) {
1680 if (prop.required && absent) {
1681 warn(
1682 'Missing required prop: "' + name + '"',
1683 vm
1684 );
1685 return
1686 }
1687 if (value == null && !prop.required) {
1688 return
1689 }
1690 var type = prop.type;
1691 var valid = !type || type === true;
1692 var expectedTypes = [];
1693 if (type) {
1694 if (!Array.isArray(type)) {
1695 type = [type];
1696 }
1697 for (var i = 0; i < type.length && !valid; i++) {
1698 var assertedType = assertType(value, type[i]);
1699 expectedTypes.push(assertedType.expectedType || '');
1700 valid = assertedType.valid;
1701 }
1702 }
1703
1704 if (!valid) {
1705 warn(
1706 getInvalidTypeMessage(name, value, expectedTypes),
1707 vm
1708 );
1709 return
1710 }
1711 var validator = prop.validator;
1712 if (validator) {
1713 if (!validator(value)) {
1714 warn(
1715 'Invalid prop: custom validator check failed for prop "' + name + '".',
1716 vm
1717 );
1718 }
1719 }
1720 }
1721
1722 var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
1723
1724 function assertType (value, type) {
1725 var valid;
1726 var expectedType = getType(type);
1727 if (simpleCheckRE.test(expectedType)) {
1728 var t = typeof value;
1729 valid = t === expectedType.toLowerCase();
1730 // for primitive wrapper objects
1731 if (!valid && t === 'object') {
1732 valid = value instanceof type;
1733 }
1734 } else if (expectedType === 'Object') {
1735 valid = isPlainObject(value);
1736 } else if (expectedType === 'Array') {
1737 valid = Array.isArray(value);
1738 } else {
1739 valid = value instanceof type;
1740 }
1741 return {
1742 valid: valid,
1743 expectedType: expectedType
1744 }
1745 }
1746
1747 /**
1748 * Use function string name to check built-in types,
1749 * because a simple equality check will fail when running
1750 * across different vms / iframes.
1751 */
1752 function getType (fn) {
1753 var match = fn && fn.toString().match(/^\s*function (\w+)/);
1754 return match ? match[1] : ''
1755 }
1756
1757 function isSameType (a, b) {
1758 return getType(a) === getType(b)
1759 }
1760
1761 function getTypeIndex (type, expectedTypes) {
1762 if (!Array.isArray(expectedTypes)) {
1763 return isSameType(expectedTypes, type) ? 0 : -1
1764 }
1765 for (var i = 0, len = expectedTypes.length; i < len; i++) {
1766 if (isSameType(expectedTypes[i], type)) {
1767 return i
1768 }
1769 }
1770 return -1
1771 }
1772
1773 function getInvalidTypeMessage (name, value, expectedTypes) {
1774 var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
1775 " Expected " + (expectedTypes.map(capitalize).join(', '));
1776 var expectedType = expectedTypes[0];
1777 var receivedType = toRawType(value);
1778 var expectedValue = styleValue(value, expectedType);
1779 var receivedValue = styleValue(value, receivedType);
1780 // check if we need to specify expected value
1781 if (expectedTypes.length === 1 &&
1782 isExplicable(expectedType) &&
1783 !isBoolean(expectedType, receivedType)) {
1784 message += " with value " + expectedValue;
1785 }
1786 message += ", got " + receivedType + " ";
1787 // check if we need to specify received value
1788 if (isExplicable(receivedType)) {
1789 message += "with value " + receivedValue + ".";
1790 }
1791 return message
1792 }
1793
1794 function styleValue (value, type) {
1795 if (type === 'String') {
1796 return ("\"" + value + "\"")
1797 } else if (type === 'Number') {
1798 return ("" + (Number(value)))
1799 } else {
1800 return ("" + value)
1801 }
1802 }
1803
1804 function isExplicable (value) {
1805 var explicitTypes = ['string', 'number', 'boolean'];
1806 return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
1807 }
1808
1809 function isBoolean () {
1810 var args = [], len = arguments.length;
1811 while ( len-- ) args[ len ] = arguments[ len ];
1812
1813 return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
1814 }
1815
1816 /* */
1817
1818 function handleError (err, vm, info) {
1819 // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
1820 // See: https://github.com/vuejs/vuex/issues/1505
1821 pushTarget();
1822 try {
1823 if (vm) {
1824 var cur = vm;
1825 while ((cur = cur.$parent)) {
1826 var hooks = cur.$options.errorCaptured;
1827 if (hooks) {
1828 for (var i = 0; i < hooks.length; i++) {
1829 try {
1830 var capture = hooks[i].call(cur, err, vm, info) === false;
1831 if (capture) { return }
1832 } catch (e) {
1833 globalHandleError(e, cur, 'errorCaptured hook');
1834 }
1835 }
1836 }
1837 }
1838 }
1839 globalHandleError(err, vm, info);
1840 } finally {
1841 popTarget();
1842 }
1843 }
1844
1845 function invokeWithErrorHandling (
1846 handler,
1847 context,
1848 args,
1849 vm,
1850 info
1851 ) {
1852 var res;
1853 try {
1854 res = args ? handler.apply(context, args) : handler.call(context);
1855 if (res && !res._isVue && isPromise(res) && !res._handled) {
1856 res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
1857 // issue #9511
1858 // avoid catch triggering multiple times when nested calls
1859 res._handled = true;
1860 }
1861 } catch (e) {
1862 handleError(e, vm, info);
1863 }
1864 return res
1865 }
1866
1867 function globalHandleError (err, vm, info) {
1868 if (config.errorHandler) {
1869 try {
1870 return config.errorHandler.call(null, err, vm, info)
1871 } catch (e) {
1872 // if the user intentionally throws the original error in the handler,
1873 // do not log it twice
1874 if (e !== err) {
1875 logError(e, null, 'config.errorHandler');
1876 }
1877 }
1878 }
1879 logError(err, vm, info);
1880 }
1881
1882 function logError (err, vm, info) {
1883 {
1884 warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
1885 }
1886 /* istanbul ignore else */
1887 if ((inBrowser || inWeex) && typeof console !== 'undefined') {
1888 console.error(err);
1889 } else {
1890 throw err
1891 }
1892 }
1893
1894 /* */
1895
1896 var isUsingMicroTask = false;
1897
1898 var callbacks = [];
1899 var pending = false;
1900
1901 function flushCallbacks () {
1902 pending = false;
1903 var copies = callbacks.slice(0);
1904 callbacks.length = 0;
1905 for (var i = 0; i < copies.length; i++) {
1906 copies[i]();
1907 }
1908 }
1909
1910 // Here we have async deferring wrappers using microtasks.
1911 // In 2.5 we used (macro) tasks (in combination with microtasks).
1912 // However, it has subtle problems when state is changed right before repaint
1913 // (e.g. #6813, out-in transitions).
1914 // Also, using (macro) tasks in event handler would cause some weird behaviors
1915 // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
1916 // So we now use microtasks everywhere, again.
1917 // A major drawback of this tradeoff is that there are some scenarios
1918 // where microtasks have too high a priority and fire in between supposedly
1919 // sequential events (e.g. #4521, #6690, which have workarounds)
1920 // or even between bubbling of the same event (#6566).
1921 var timerFunc;
1922
1923 // The nextTick behavior leverages the microtask queue, which can be accessed
1924 // via either native Promise.then or MutationObserver.
1925 // MutationObserver has wider support, however it is seriously bugged in
1926 // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
1927 // completely stops working after triggering a few times... so, if native
1928 // Promise is available, we will use it:
1929 /* istanbul ignore next, $flow-disable-line */
1930 if (typeof Promise !== 'undefined' && isNative(Promise)) {
1931 var p = Promise.resolve();
1932 timerFunc = function () {
1933 p.then(flushCallbacks);
1934 // In problematic UIWebViews, Promise.then doesn't completely break, but
1935 // it can get stuck in a weird state where callbacks are pushed into the
1936 // microtask queue but the queue isn't being flushed, until the browser
1937 // needs to do some other work, e.g. handle a timer. Therefore we can
1938 // "force" the microtask queue to be flushed by adding an empty timer.
1939 if (isIOS) { setTimeout(noop); }
1940 };
1941 isUsingMicroTask = true;
1942 } else if (!isIE && typeof MutationObserver !== 'undefined' && (
1943 isNative(MutationObserver) ||
1944 // PhantomJS and iOS 7.x
1945 MutationObserver.toString() === '[object MutationObserverConstructor]'
1946 )) {
1947 // Use MutationObserver where native Promise is not available,
1948 // e.g. PhantomJS, iOS7, Android 4.4
1949 // (#6466 MutationObserver is unreliable in IE11)
1950 var counter = 1;
1951 var observer = new MutationObserver(flushCallbacks);
1952 var textNode = document.createTextNode(String(counter));
1953 observer.observe(textNode, {
1954 characterData: true
1955 });
1956 timerFunc = function () {
1957 counter = (counter + 1) % 2;
1958 textNode.data = String(counter);
1959 };
1960 isUsingMicroTask = true;
1961 } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
1962 // Fallback to setImmediate.
1963 // Techinically it leverages the (macro) task queue,
1964 // but it is still a better choice than setTimeout.
1965 timerFunc = function () {
1966 setImmediate(flushCallbacks);
1967 };
1968 } else {
1969 // Fallback to setTimeout.
1970 timerFunc = function () {
1971 setTimeout(flushCallbacks, 0);
1972 };
1973 }
1974
1975 function nextTick (cb, ctx) {
1976 var _resolve;
1977 callbacks.push(function () {
1978 if (cb) {
1979 try {
1980 cb.call(ctx);
1981 } catch (e) {
1982 handleError(e, ctx, 'nextTick');
1983 }
1984 } else if (_resolve) {
1985 _resolve(ctx);
1986 }
1987 });
1988 if (!pending) {
1989 pending = true;
1990 timerFunc();
1991 }
1992 // $flow-disable-line
1993 if (!cb && typeof Promise !== 'undefined') {
1994 return new Promise(function (resolve) {
1995 _resolve = resolve;
1996 })
1997 }
1998 }
1999
2000 /* */
2001
2002 /* not type checking this file because flow doesn't play well with Proxy */
2003
2004 var initProxy;
2005
2006 {
2007 var allowedGlobals = makeMap(
2008 'Infinity,undefined,NaN,isFinite,isNaN,' +
2009 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
2010 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
2011 'require' // for Webpack/Browserify
2012 );
2013
2014 var warnNonPresent = function (target, key) {
2015 warn(
2016 "Property or method \"" + key + "\" is not defined on the instance but " +
2017 'referenced during render. Make sure that this property is reactive, ' +
2018 'either in the data option, or for class-based components, by ' +
2019 'initializing the property. ' +
2020 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
2021 target
2022 );
2023 };
2024
2025 var warnReservedPrefix = function (target, key) {
2026 warn(
2027 "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
2028 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
2029 'prevent conflicts with Vue internals' +
2030 'See: https://vuejs.org/v2/api/#data',
2031 target
2032 );
2033 };
2034
2035 var hasProxy =
2036 typeof Proxy !== 'undefined' && isNative(Proxy);
2037
2038 if (hasProxy) {
2039 var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
2040 config.keyCodes = new Proxy(config.keyCodes, {
2041 set: function set (target, key, value) {
2042 if (isBuiltInModifier(key)) {
2043 warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
2044 return false
2045 } else {
2046 target[key] = value;
2047 return true
2048 }
2049 }
2050 });
2051 }
2052
2053 var hasHandler = {
2054 has: function has (target, key) {
2055 var has = key in target;
2056 var isAllowed = allowedGlobals(key) ||
2057 (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
2058 if (!has && !isAllowed) {
2059 if (key in target.$data) { warnReservedPrefix(target, key); }
2060 else { warnNonPresent(target, key); }
2061 }
2062 return has || !isAllowed
2063 }
2064 };
2065
2066 var getHandler = {
2067 get: function get (target, key) {
2068 if (typeof key === 'string' && !(key in target)) {
2069 if (key in target.$data) { warnReservedPrefix(target, key); }
2070 else { warnNonPresent(target, key); }
2071 }
2072 return target[key]
2073 }
2074 };
2075
2076 initProxy = function initProxy (vm) {
2077 if (hasProxy) {
2078 // determine which proxy handler to use
2079 var options = vm.$options;
2080 var handlers = options.render && options.render._withStripped
2081 ? getHandler
2082 : hasHandler;
2083 vm._renderProxy = new Proxy(vm, handlers);
2084 } else {
2085 vm._renderProxy = vm;
2086 }
2087 };
2088 }
2089
2090 /* */
2091
2092 var seenObjects = new _Set();
2093
2094 /**
2095 * Recursively traverse an object to evoke all converted
2096 * getters, so that every nested property inside the object
2097 * is collected as a "deep" dependency.
2098 */
2099 function traverse (val) {
2100 _traverse(val, seenObjects);
2101 seenObjects.clear();
2102 }
2103
2104 function _traverse (val, seen) {
2105 var i, keys;
2106 var isA = Array.isArray(val);
2107 if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
2108 return
2109 }
2110 if (val.__ob__) {
2111 var depId = val.__ob__.dep.id;
2112 if (seen.has(depId)) {
2113 return
2114 }
2115 seen.add(depId);
2116 }
2117 if (isA) {
2118 i = val.length;
2119 while (i--) { _traverse(val[i], seen); }
2120 } else {
2121 keys = Object.keys(val);
2122 i = keys.length;
2123 while (i--) { _traverse(val[keys[i]], seen); }
2124 }
2125 }
2126
2127 var mark;
2128 var measure;
2129
2130 {
2131 var perf = inBrowser && window.performance;
2132 /* istanbul ignore if */
2133 if (
2134 perf &&
2135 perf.mark &&
2136 perf.measure &&
2137 perf.clearMarks &&
2138 perf.clearMeasures
2139 ) {
2140 mark = function (tag) { return perf.mark(tag); };
2141 measure = function (name, startTag, endTag) {
2142 perf.measure(name, startTag, endTag);
2143 perf.clearMarks(startTag);
2144 perf.clearMarks(endTag);
2145 // perf.clearMeasures(name)
2146 };
2147 }
2148 }
2149
2150 /* */
2151
2152 var normalizeEvent = cached(function (name) {
2153 var passive = name.charAt(0) === '&';
2154 name = passive ? name.slice(1) : name;
2155 var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
2156 name = once$$1 ? name.slice(1) : name;
2157 var capture = name.charAt(0) === '!';
2158 name = capture ? name.slice(1) : name;
2159 return {
2160 name: name,
2161 once: once$$1,
2162 capture: capture,
2163 passive: passive
2164 }
2165 });
2166
2167 function createFnInvoker (fns, vm) {
2168 function invoker () {
2169 var arguments$1 = arguments;
2170
2171 var fns = invoker.fns;
2172 if (Array.isArray(fns)) {
2173 var cloned = fns.slice();
2174 for (var i = 0; i < cloned.length; i++) {
2175 invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
2176 }
2177 } else {
2178 // return handler return value for single handlers
2179 return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
2180 }
2181 }
2182 invoker.fns = fns;
2183 return invoker
2184 }
2185
2186 function updateListeners (
2187 on,
2188 oldOn,
2189 add,
2190 remove$$1,
2191 createOnceHandler,
2192 vm
2193 ) {
2194 var name, def$$1, cur, old, event;
2195 for (name in on) {
2196 def$$1 = cur = on[name];
2197 old = oldOn[name];
2198 event = normalizeEvent(name);
2199 if (isUndef(cur)) {
2200 warn(
2201 "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
2202 vm
2203 );
2204 } else if (isUndef(old)) {
2205 if (isUndef(cur.fns)) {
2206 cur = on[name] = createFnInvoker(cur, vm);
2207 }
2208 if (isTrue(event.once)) {
2209 cur = on[name] = createOnceHandler(event.name, cur, event.capture);
2210 }
2211 add(event.name, cur, event.capture, event.passive, event.params);
2212 } else if (cur !== old) {
2213 old.fns = cur;
2214 on[name] = old;
2215 }
2216 }
2217 for (name in oldOn) {
2218 if (isUndef(on[name])) {
2219 event = normalizeEvent(name);
2220 remove$$1(event.name, oldOn[name], event.capture);
2221 }
2222 }
2223 }
2224
2225 /* */
2226
2227 function mergeVNodeHook (def, hookKey, hook) {
2228 if (def instanceof VNode) {
2229 def = def.data.hook || (def.data.hook = {});
2230 }
2231 var invoker;
2232 var oldHook = def[hookKey];
2233
2234 function wrappedHook () {
2235 hook.apply(this, arguments);
2236 // important: remove merged hook to ensure it's called only once
2237 // and prevent memory leak
2238 remove(invoker.fns, wrappedHook);
2239 }
2240
2241 if (isUndef(oldHook)) {
2242 // no existing hook
2243 invoker = createFnInvoker([wrappedHook]);
2244 } else {
2245 /* istanbul ignore if */
2246 if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
2247 // already a merged invoker
2248 invoker = oldHook;
2249 invoker.fns.push(wrappedHook);
2250 } else {
2251 // existing plain hook
2252 invoker = createFnInvoker([oldHook, wrappedHook]);
2253 }
2254 }
2255
2256 invoker.merged = true;
2257 def[hookKey] = invoker;
2258 }
2259
2260 /* */
2261
2262 function extractPropsFromVNodeData (
2263 data,
2264 Ctor,
2265 tag
2266 ) {
2267 // we are only extracting raw values here.
2268 // validation and default values are handled in the child
2269 // component itself.
2270 var propOptions = Ctor.options.props;
2271 if (isUndef(propOptions)) {
2272 return
2273 }
2274 var res = {};
2275 var attrs = data.attrs;
2276 var props = data.props;
2277 if (isDef(attrs) || isDef(props)) {
2278 for (var key in propOptions) {
2279 var altKey = hyphenate(key);
2280 {
2281 var keyInLowerCase = key.toLowerCase();
2282 if (
2283 key !== keyInLowerCase &&
2284 attrs && hasOwn(attrs, keyInLowerCase)
2285 ) {
2286 tip(
2287 "Prop \"" + keyInLowerCase + "\" is passed to component " +
2288 (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
2289 " \"" + key + "\". " +
2290 "Note that HTML attributes are case-insensitive and camelCased " +
2291 "props need to use their kebab-case equivalents when using in-DOM " +
2292 "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
2293 );
2294 }
2295 }
2296 checkProp(res, props, key, altKey, true) ||
2297 checkProp(res, attrs, key, altKey, false);
2298 }
2299 }
2300 return res
2301 }
2302
2303 function checkProp (
2304 res,
2305 hash,
2306 key,
2307 altKey,
2308 preserve
2309 ) {
2310 if (isDef(hash)) {
2311 if (hasOwn(hash, key)) {
2312 res[key] = hash[key];
2313 if (!preserve) {
2314 delete hash[key];
2315 }
2316 return true
2317 } else if (hasOwn(hash, altKey)) {
2318 res[key] = hash[altKey];
2319 if (!preserve) {
2320 delete hash[altKey];
2321 }
2322 return true
2323 }
2324 }
2325 return false
2326 }
2327
2328 /* */
2329
2330 // The template compiler attempts to minimize the need for normalization by
2331 // statically analyzing the template at compile time.
2332 //
2333 // For plain HTML markup, normalization can be completely skipped because the
2334 // generated render function is guaranteed to return Array<VNode>. There are
2335 // two cases where extra normalization is needed:
2336
2337 // 1. When the children contains components - because a functional component
2338 // may return an Array instead of a single root. In this case, just a simple
2339 // normalization is needed - if any child is an Array, we flatten the whole
2340 // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
2341 // because functional components already normalize their own children.
2342 function simpleNormalizeChildren (children) {
2343 for (var i = 0; i < children.length; i++) {
2344 if (Array.isArray(children[i])) {
2345 return Array.prototype.concat.apply([], children)
2346 }
2347 }
2348 return children
2349 }
2350
2351 // 2. When the children contains constructs that always generated nested Arrays,
2352 // e.g. <template>, <slot>, v-for, or when the children is provided by user
2353 // with hand-written render functions / JSX. In such cases a full normalization
2354 // is needed to cater to all possible types of children values.
2355 function normalizeChildren (children) {
2356 return isPrimitive(children)
2357 ? [createTextVNode(children)]
2358 : Array.isArray(children)
2359 ? normalizeArrayChildren(children)
2360 : undefined
2361 }
2362
2363 function isTextNode (node) {
2364 return isDef(node) && isDef(node.text) && isFalse(node.isComment)
2365 }
2366
2367 function normalizeArrayChildren (children, nestedIndex) {
2368 var res = [];
2369 var i, c, lastIndex, last;
2370 for (i = 0; i < children.length; i++) {
2371 c = children[i];
2372 if (isUndef(c) || typeof c === 'boolean') { continue }
2373 lastIndex = res.length - 1;
2374 last = res[lastIndex];
2375 // nested
2376 if (Array.isArray(c)) {
2377 if (c.length > 0) {
2378 c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
2379 // merge adjacent text nodes
2380 if (isTextNode(c[0]) && isTextNode(last)) {
2381 res[lastIndex] = createTextVNode(last.text + (c[0]).text);
2382 c.shift();
2383 }
2384 res.push.apply(res, c);
2385 }
2386 } else if (isPrimitive(c)) {
2387 if (isTextNode(last)) {
2388 // merge adjacent text nodes
2389 // this is necessary for SSR hydration because text nodes are
2390 // essentially merged when rendered to HTML strings
2391 res[lastIndex] = createTextVNode(last.text + c);
2392 } else if (c !== '') {
2393 // convert primitive to vnode
2394 res.push(createTextVNode(c));
2395 }
2396 } else {
2397 if (isTextNode(c) && isTextNode(last)) {
2398 // merge adjacent text nodes
2399 res[lastIndex] = createTextVNode(last.text + c.text);
2400 } else {
2401 // default key for nested array children (likely generated by v-for)
2402 if (isTrue(children._isVList) &&
2403 isDef(c.tag) &&
2404 isUndef(c.key) &&
2405 isDef(nestedIndex)) {
2406 c.key = "__vlist" + nestedIndex + "_" + i + "__";
2407 }
2408 res.push(c);
2409 }
2410 }
2411 }
2412 return res
2413 }
2414
2415 /* */
2416
2417 function initProvide (vm) {
2418 var provide = vm.$options.provide;
2419 if (provide) {
2420 vm._provided = typeof provide === 'function'
2421 ? provide.call(vm)
2422 : provide;
2423 }
2424 }
2425
2426 function initInjections (vm) {
2427 var result = resolveInject(vm.$options.inject, vm);
2428 if (result) {
2429 toggleObserving(false);
2430 Object.keys(result).forEach(function (key) {
2431 /* istanbul ignore else */
2432 {
2433 defineReactive$$1(vm, key, result[key], function () {
2434 warn(
2435 "Avoid mutating an injected value directly since the changes will be " +
2436 "overwritten whenever the provided component re-renders. " +
2437 "injection being mutated: \"" + key + "\"",
2438 vm
2439 );
2440 });
2441 }
2442 });
2443 toggleObserving(true);
2444 }
2445 }
2446
2447 function resolveInject (inject, vm) {
2448 if (inject) {
2449 // inject is :any because flow is not smart enough to figure out cached
2450 var result = Object.create(null);
2451 var keys = hasSymbol
2452 ? Reflect.ownKeys(inject)
2453 : Object.keys(inject);
2454
2455 for (var i = 0; i < keys.length; i++) {
2456 var key = keys[i];
2457 // #6574 in case the inject object is observed...
2458 if (key === '__ob__') { continue }
2459 var provideKey = inject[key].from;
2460 var source = vm;
2461 while (source) {
2462 if (source._provided && hasOwn(source._provided, provideKey)) {
2463 result[key] = source._provided[provideKey];
2464 break
2465 }
2466 source = source.$parent;
2467 }
2468 if (!source) {
2469 if ('default' in inject[key]) {
2470 var provideDefault = inject[key].default;
2471 result[key] = typeof provideDefault === 'function'
2472 ? provideDefault.call(vm)
2473 : provideDefault;
2474 } else {
2475 warn(("Injection \"" + key + "\" not found"), vm);
2476 }
2477 }
2478 }
2479 return result
2480 }
2481 }
2482
2483 /* */
2484
2485
2486
2487 /**
2488 * Runtime helper for resolving raw children VNodes into a slot object.
2489 */
2490 function resolveSlots (
2491 children,
2492 context
2493 ) {
2494 if (!children || !children.length) {
2495 return {}
2496 }
2497 var slots = {};
2498 for (var i = 0, l = children.length; i < l; i++) {
2499 var child = children[i];
2500 var data = child.data;
2501 // remove slot attribute if the node is resolved as a Vue slot node
2502 if (data && data.attrs && data.attrs.slot) {
2503 delete data.attrs.slot;
2504 }
2505 // named slots should only be respected if the vnode was rendered in the
2506 // same context.
2507 if ((child.context === context || child.fnContext === context) &&
2508 data && data.slot != null
2509 ) {
2510 var name = data.slot;
2511 var slot = (slots[name] || (slots[name] = []));
2512 if (child.tag === 'template') {
2513 slot.push.apply(slot, child.children || []);
2514 } else {
2515 slot.push(child);
2516 }
2517 } else {
2518 (slots.default || (slots.default = [])).push(child);
2519 }
2520 }
2521 // ignore slots that contains only whitespace
2522 for (var name$1 in slots) {
2523 if (slots[name$1].every(isWhitespace)) {
2524 delete slots[name$1];
2525 }
2526 }
2527 return slots
2528 }
2529
2530 function isWhitespace (node) {
2531 return (node.isComment && !node.asyncFactory) || node.text === ' '
2532 }
2533
2534 /* */
2535
2536 function normalizeScopedSlots (
2537 slots,
2538 normalSlots,
2539 prevSlots
2540 ) {
2541 var res;
2542 var hasNormalSlots = Object.keys(normalSlots).length > 0;
2543 var isStable = slots ? !!slots.$stable : !hasNormalSlots;
2544 var key = slots && slots.$key;
2545 if (!slots) {
2546 res = {};
2547 } else if (slots._normalized) {
2548 // fast path 1: child component re-render only, parent did not change
2549 return slots._normalized
2550 } else if (
2551 isStable &&
2552 prevSlots &&
2553 prevSlots !== emptyObject &&
2554 key === prevSlots.$key &&
2555 !hasNormalSlots &&
2556 !prevSlots.$hasNormal
2557 ) {
2558 // fast path 2: stable scoped slots w/ no normal slots to proxy,
2559 // only need to normalize once
2560 return prevSlots
2561 } else {
2562 res = {};
2563 for (var key$1 in slots) {
2564 if (slots[key$1] && key$1[0] !== '$') {
2565 res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
2566 }
2567 }
2568 }
2569 // expose normal slots on scopedSlots
2570 for (var key$2 in normalSlots) {
2571 if (!(key$2 in res)) {
2572 res[key$2] = proxyNormalSlot(normalSlots, key$2);
2573 }
2574 }
2575 // avoriaz seems to mock a non-extensible $scopedSlots object
2576 // and when that is passed down this would cause an error
2577 if (slots && Object.isExtensible(slots)) {
2578 (slots)._normalized = res;
2579 }
2580 def(res, '$stable', isStable);
2581 def(res, '$key', key);
2582 def(res, '$hasNormal', hasNormalSlots);
2583 return res
2584 }
2585
2586 function normalizeScopedSlot(normalSlots, key, fn) {
2587 var normalized = function () {
2588 var res = arguments.length ? fn.apply(null, arguments) : fn({});
2589 res = res && typeof res === 'object' && !Array.isArray(res)
2590 ? [res] // single vnode
2591 : normalizeChildren(res);
2592 return res && (
2593 res.length === 0 ||
2594 (res.length === 1 && res[0].isComment) // #9658
2595 ) ? undefined
2596 : res
2597 };
2598 // this is a slot using the new v-slot syntax without scope. although it is
2599 // compiled as a scoped slot, render fn users would expect it to be present
2600 // on this.$slots because the usage is semantically a normal slot.
2601 if (fn.proxy) {
2602 Object.defineProperty(normalSlots, key, {
2603 get: normalized,
2604 enumerable: true,
2605 configurable: true
2606 });
2607 }
2608 return normalized
2609 }
2610
2611 function proxyNormalSlot(slots, key) {
2612 return function () { return slots[key]; }
2613 }
2614
2615 /* */
2616
2617 /**
2618 * Runtime helper for rendering v-for lists.
2619 */
2620 function renderList (
2621 val,
2622 render
2623 ) {
2624 var ret, i, l, keys, key;
2625 if (Array.isArray(val) || typeof val === 'string') {
2626 ret = new Array(val.length);
2627 for (i = 0, l = val.length; i < l; i++) {
2628 ret[i] = render(val[i], i);
2629 }
2630 } else if (typeof val === 'number') {
2631 ret = new Array(val);
2632 for (i = 0; i < val; i++) {
2633 ret[i] = render(i + 1, i);
2634 }
2635 } else if (isObject(val)) {
2636 if (hasSymbol && val[Symbol.iterator]) {
2637 ret = [];
2638 var iterator = val[Symbol.iterator]();
2639 var result = iterator.next();
2640 while (!result.done) {
2641 ret.push(render(result.value, ret.length));
2642 result = iterator.next();
2643 }
2644 } else {
2645 keys = Object.keys(val);
2646 ret = new Array(keys.length);
2647 for (i = 0, l = keys.length; i < l; i++) {
2648 key = keys[i];
2649 ret[i] = render(val[key], key, i);
2650 }
2651 }
2652 }
2653 if (!isDef(ret)) {
2654 ret = [];
2655 }
2656 (ret)._isVList = true;
2657 return ret
2658 }
2659
2660 /* */
2661
2662 /**
2663 * Runtime helper for rendering <slot>
2664 */
2665 function renderSlot (
2666 name,
2667 fallback,
2668 props,
2669 bindObject
2670 ) {
2671 var scopedSlotFn = this.$scopedSlots[name];
2672 var nodes;
2673 if (scopedSlotFn) { // scoped slot
2674 props = props || {};
2675 if (bindObject) {
2676 if (!isObject(bindObject)) {
2677 warn(
2678 'slot v-bind without argument expects an Object',
2679 this
2680 );
2681 }
2682 props = extend(extend({}, bindObject), props);
2683 }
2684 nodes = scopedSlotFn(props) || fallback;
2685 } else {
2686 nodes = this.$slots[name] || fallback;
2687 }
2688
2689 var target = props && props.slot;
2690 if (target) {
2691 return this.$createElement('template', { slot: target }, nodes)
2692 } else {
2693 return nodes
2694 }
2695 }
2696
2697 /* */
2698
2699 /**
2700 * Runtime helper for resolving filters
2701 */
2702 function resolveFilter (id) {
2703 return resolveAsset(this.$options, 'filters', id, true) || identity
2704 }
2705
2706 /* */
2707
2708 function isKeyNotMatch (expect, actual) {
2709 if (Array.isArray(expect)) {
2710 return expect.indexOf(actual) === -1
2711 } else {
2712 return expect !== actual
2713 }
2714 }
2715
2716 /**
2717 * Runtime helper for checking keyCodes from config.
2718 * exposed as Vue.prototype._k
2719 * passing in eventKeyName as last argument separately for backwards compat
2720 */
2721 function checkKeyCodes (
2722 eventKeyCode,
2723 key,
2724 builtInKeyCode,
2725 eventKeyName,
2726 builtInKeyName
2727 ) {
2728 var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
2729 if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
2730 return isKeyNotMatch(builtInKeyName, eventKeyName)
2731 } else if (mappedKeyCode) {
2732 return isKeyNotMatch(mappedKeyCode, eventKeyCode)
2733 } else if (eventKeyName) {
2734 return hyphenate(eventKeyName) !== key
2735 }
2736 }
2737
2738 /* */
2739
2740 /**
2741 * Runtime helper for merging v-bind="object" into a VNode's data.
2742 */
2743 function bindObjectProps (
2744 data,
2745 tag,
2746 value,
2747 asProp,
2748 isSync
2749 ) {
2750 if (value) {
2751 if (!isObject(value)) {
2752 warn(
2753 'v-bind without argument expects an Object or Array value',
2754 this
2755 );
2756 } else {
2757 if (Array.isArray(value)) {
2758 value = toObject(value);
2759 }
2760 var hash;
2761 var loop = function ( key ) {
2762 if (
2763 key === 'class' ||
2764 key === 'style' ||
2765 isReservedAttribute(key)
2766 ) {
2767 hash = data;
2768 } else {
2769 var type = data.attrs && data.attrs.type;
2770 hash = asProp || config.mustUseProp(tag, type, key)
2771 ? data.domProps || (data.domProps = {})
2772 : data.attrs || (data.attrs = {});
2773 }
2774 var camelizedKey = camelize(key);
2775 var hyphenatedKey = hyphenate(key);
2776 if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
2777 hash[key] = value[key];
2778
2779 if (isSync) {
2780 var on = data.on || (data.on = {});
2781 on[("update:" + key)] = function ($event) {
2782 value[key] = $event;
2783 };
2784 }
2785 }
2786 };
2787
2788 for (var key in value) loop( key );
2789 }
2790 }
2791 return data
2792 }
2793
2794 /* */
2795
2796 /**
2797 * Runtime helper for rendering static trees.
2798 */
2799 function renderStatic (
2800 index,
2801 isInFor
2802 ) {
2803 var cached = this._staticTrees || (this._staticTrees = []);
2804 var tree = cached[index];
2805 // if has already-rendered static tree and not inside v-for,
2806 // we can reuse the same tree.
2807 if (tree && !isInFor) {
2808 return tree
2809 }
2810 // otherwise, render a fresh tree.
2811 tree = cached[index] = this.$options.staticRenderFns[index].call(
2812 this._renderProxy,
2813 null,
2814 this // for render fns generated for functional component templates
2815 );
2816 markStatic(tree, ("__static__" + index), false);
2817 return tree
2818 }
2819
2820 /**
2821 * Runtime helper for v-once.
2822 * Effectively it means marking the node as static with a unique key.
2823 */
2824 function markOnce (
2825 tree,
2826 index,
2827 key
2828 ) {
2829 markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
2830 return tree
2831 }
2832
2833 function markStatic (
2834 tree,
2835 key,
2836 isOnce
2837 ) {
2838 if (Array.isArray(tree)) {
2839 for (var i = 0; i < tree.length; i++) {
2840 if (tree[i] && typeof tree[i] !== 'string') {
2841 markStaticNode(tree[i], (key + "_" + i), isOnce);
2842 }
2843 }
2844 } else {
2845 markStaticNode(tree, key, isOnce);
2846 }
2847 }
2848
2849 function markStaticNode (node, key, isOnce) {
2850 node.isStatic = true;
2851 node.key = key;
2852 node.isOnce = isOnce;
2853 }
2854
2855 /* */
2856
2857 function bindObjectListeners (data, value) {
2858 if (value) {
2859 if (!isPlainObject(value)) {
2860 warn(
2861 'v-on without argument expects an Object value',
2862 this
2863 );
2864 } else {
2865 var on = data.on = data.on ? extend({}, data.on) : {};
2866 for (var key in value) {
2867 var existing = on[key];
2868 var ours = value[key];
2869 on[key] = existing ? [].concat(existing, ours) : ours;
2870 }
2871 }
2872 }
2873 return data
2874 }
2875
2876 /* */
2877
2878 function resolveScopedSlots (
2879 fns, // see flow/vnode
2880 res,
2881 // the following are added in 2.6
2882 hasDynamicKeys,
2883 contentHashKey
2884 ) {
2885 res = res || { $stable: !hasDynamicKeys };
2886 for (var i = 0; i < fns.length; i++) {
2887 var slot = fns[i];
2888 if (Array.isArray(slot)) {
2889 resolveScopedSlots(slot, res, hasDynamicKeys);
2890 } else if (slot) {
2891 // marker for reverse proxying v-slot without scope on this.$slots
2892 if (slot.proxy) {
2893 slot.fn.proxy = true;
2894 }
2895 res[slot.key] = slot.fn;
2896 }
2897 }
2898 if (contentHashKey) {
2899 (res).$key = contentHashKey;
2900 }
2901 return res
2902 }
2903
2904 /* */
2905
2906 function bindDynamicKeys (baseObj, values) {
2907 for (var i = 0; i < values.length; i += 2) {
2908 var key = values[i];
2909 if (typeof key === 'string' && key) {
2910 baseObj[values[i]] = values[i + 1];
2911 } else if (key !== '' && key !== null) {
2912 // null is a speical value for explicitly removing a binding
2913 warn(
2914 ("Invalid value for dynamic directive argument (expected string or null): " + key),
2915 this
2916 );
2917 }
2918 }
2919 return baseObj
2920 }
2921
2922 // helper to dynamically append modifier runtime markers to event names.
2923 // ensure only append when value is already string, otherwise it will be cast
2924 // to string and cause the type check to miss.
2925 function prependModifier (value, symbol) {
2926 return typeof value === 'string' ? symbol + value : value
2927 }
2928
2929 /* */
2930
2931 function installRenderHelpers (target) {
2932 target._o = markOnce;
2933 target._n = toNumber;
2934 target._s = toString;
2935 target._l = renderList;
2936 target._t = renderSlot;
2937 target._q = looseEqual;
2938 target._i = looseIndexOf;
2939 target._m = renderStatic;
2940 target._f = resolveFilter;
2941 target._k = checkKeyCodes;
2942 target._b = bindObjectProps;
2943 target._v = createTextVNode;
2944 target._e = createEmptyVNode;
2945 target._u = resolveScopedSlots;
2946 target._g = bindObjectListeners;
2947 target._d = bindDynamicKeys;
2948 target._p = prependModifier;
2949 }
2950
2951 /* */
2952
2953 function FunctionalRenderContext (
2954 data,
2955 props,
2956 children,
2957 parent,
2958 Ctor
2959 ) {
2960 var this$1 = this;
2961
2962 var options = Ctor.options;
2963 // ensure the createElement function in functional components
2964 // gets a unique context - this is necessary for correct named slot check
2965 var contextVm;
2966 if (hasOwn(parent, '_uid')) {
2967 contextVm = Object.create(parent);
2968 // $flow-disable-line
2969 contextVm._original = parent;
2970 } else {
2971 // the context vm passed in is a functional context as well.
2972 // in this case we want to make sure we are able to get a hold to the
2973 // real context instance.
2974 contextVm = parent;
2975 // $flow-disable-line
2976 parent = parent._original;
2977 }
2978 var isCompiled = isTrue(options._compiled);
2979 var needNormalization = !isCompiled;
2980
2981 this.data = data;
2982 this.props = props;
2983 this.children = children;
2984 this.parent = parent;
2985 this.listeners = data.on || emptyObject;
2986 this.injections = resolveInject(options.inject, parent);
2987 this.slots = function () {
2988 if (!this$1.$slots) {
2989 normalizeScopedSlots(
2990 data.scopedSlots,
2991 this$1.$slots = resolveSlots(children, parent)
2992 );
2993 }
2994 return this$1.$slots
2995 };
2996
2997 Object.defineProperty(this, 'scopedSlots', ({
2998 enumerable: true,
2999 get: function get () {
3000 return normalizeScopedSlots(data.scopedSlots, this.slots())
3001 }
3002 }));
3003
3004 // support for compiled functional template
3005 if (isCompiled) {
3006 // exposing $options for renderStatic()
3007 this.$options = options;
3008 // pre-resolve slots for renderSlot()
3009 this.$slots = this.slots();
3010 this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
3011 }
3012
3013 if (options._scopeId) {
3014 this._c = function (a, b, c, d) {
3015 var vnode = createElement(contextVm, a, b, c, d, needNormalization);
3016 if (vnode && !Array.isArray(vnode)) {
3017 vnode.fnScopeId = options._scopeId;
3018 vnode.fnContext = parent;
3019 }
3020 return vnode
3021 };
3022 } else {
3023 this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
3024 }
3025 }
3026
3027 installRenderHelpers(FunctionalRenderContext.prototype);
3028
3029 function createFunctionalComponent (
3030 Ctor,
3031 propsData,
3032 data,
3033 contextVm,
3034 children
3035 ) {
3036 var options = Ctor.options;
3037 var props = {};
3038 var propOptions = options.props;
3039 if (isDef(propOptions)) {
3040 for (var key in propOptions) {
3041 props[key] = validateProp(key, propOptions, propsData || emptyObject);
3042 }
3043 } else {
3044 if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
3045 if (isDef(data.props)) { mergeProps(props, data.props); }
3046 }
3047
3048 var renderContext = new FunctionalRenderContext(
3049 data,
3050 props,
3051 children,
3052 contextVm,
3053 Ctor
3054 );
3055
3056 var vnode = options.render.call(null, renderContext._c, renderContext);
3057
3058 if (vnode instanceof VNode) {
3059 return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
3060 } else if (Array.isArray(vnode)) {
3061 var vnodes = normalizeChildren(vnode) || [];
3062 var res = new Array(vnodes.length);
3063 for (var i = 0; i < vnodes.length; i++) {
3064 res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
3065 }
3066 return res
3067 }
3068 }
3069
3070 function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
3071 // #7817 clone node before setting fnContext, otherwise if the node is reused
3072 // (e.g. it was from a cached normal slot) the fnContext causes named slots
3073 // that should not be matched to match.
3074 var clone = cloneVNode(vnode);
3075 clone.fnContext = contextVm;
3076 clone.fnOptions = options;
3077 {
3078 (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
3079 }
3080 if (data.slot) {
3081 (clone.data || (clone.data = {})).slot = data.slot;
3082 }
3083 return clone
3084 }
3085
3086 function mergeProps (to, from) {
3087 for (var key in from) {
3088 to[camelize(key)] = from[key];
3089 }
3090 }
3091
3092 /* */
3093
3094 /* */
3095
3096 /* */
3097
3098 /* */
3099
3100 // inline hooks to be invoked on component VNodes during patch
3101 var componentVNodeHooks = {
3102 init: function init (vnode, hydrating) {
3103 if (
3104 vnode.componentInstance &&
3105 !vnode.componentInstance._isDestroyed &&
3106 vnode.data.keepAlive
3107 ) {
3108 // kept-alive components, treat as a patch
3109 var mountedNode = vnode; // work around flow
3110 componentVNodeHooks.prepatch(mountedNode, mountedNode);
3111 } else {
3112 var child = vnode.componentInstance = createComponentInstanceForVnode(
3113 vnode,
3114 activeInstance
3115 );
3116 child.$mount(hydrating ? vnode.elm : undefined, hydrating);
3117 }
3118 },
3119
3120 prepatch: function prepatch (oldVnode, vnode) {
3121 var options = vnode.componentOptions;
3122 var child = vnode.componentInstance = oldVnode.componentInstance;
3123 updateChildComponent(
3124 child,
3125 options.propsData, // updated props
3126 options.listeners, // updated listeners
3127 vnode, // new parent vnode
3128 options.children // new children
3129 );
3130 },
3131
3132 insert: function insert (vnode) {
3133 var context = vnode.context;
3134 var componentInstance = vnode.componentInstance;
3135 if (!componentInstance._isMounted) {
3136 componentInstance._isMounted = true;
3137 callHook(componentInstance, 'mounted');
3138 }
3139 if (vnode.data.keepAlive) {
3140 if (context._isMounted) {
3141 // vue-router#1212
3142 // During updates, a kept-alive component's child components may
3143 // change, so directly walking the tree here may call activated hooks
3144 // on incorrect children. Instead we push them into a queue which will
3145 // be processed after the whole patch process ended.
3146 queueActivatedComponent(componentInstance);
3147 } else {
3148 activateChildComponent(componentInstance, true /* direct */);
3149 }
3150 }
3151 },
3152
3153 destroy: function destroy (vnode) {
3154 var componentInstance = vnode.componentInstance;
3155 if (!componentInstance._isDestroyed) {
3156 if (!vnode.data.keepAlive) {
3157 componentInstance.$destroy();
3158 } else {
3159 deactivateChildComponent(componentInstance, true /* direct */);
3160 }
3161 }
3162 }
3163 };
3164
3165 var hooksToMerge = Object.keys(componentVNodeHooks);
3166
3167 function createComponent (
3168 Ctor,
3169 data,
3170 context,
3171 children,
3172 tag
3173 ) {
3174 if (isUndef(Ctor)) {
3175 return
3176 }
3177
3178 var baseCtor = context.$options._base;
3179
3180 // plain options object: turn it into a constructor
3181 if (isObject(Ctor)) {
3182 Ctor = baseCtor.extend(Ctor);
3183 }
3184
3185 // if at this stage it's not a constructor or an async component factory,
3186 // reject.
3187 if (typeof Ctor !== 'function') {
3188 {
3189 warn(("Invalid Component definition: " + (String(Ctor))), context);
3190 }
3191 return
3192 }
3193
3194 // async component
3195 var asyncFactory;
3196 if (isUndef(Ctor.cid)) {
3197 asyncFactory = Ctor;
3198 Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
3199 if (Ctor === undefined) {
3200 // return a placeholder node for async component, which is rendered
3201 // as a comment node but preserves all the raw information for the node.
3202 // the information will be used for async server-rendering and hydration.
3203 return createAsyncPlaceholder(
3204 asyncFactory,
3205 data,
3206 context,
3207 children,
3208 tag
3209 )
3210 }
3211 }
3212
3213 data = data || {};
3214
3215 // resolve constructor options in case global mixins are applied after
3216 // component constructor creation
3217 resolveConstructorOptions(Ctor);
3218
3219 // transform component v-model data into props & events
3220 if (isDef(data.model)) {
3221 transformModel(Ctor.options, data);
3222 }
3223
3224 // extract props
3225 var propsData = extractPropsFromVNodeData(data, Ctor, tag);
3226
3227 // functional component
3228 if (isTrue(Ctor.options.functional)) {
3229 return createFunctionalComponent(Ctor, propsData, data, context, children)
3230 }
3231
3232 // extract listeners, since these needs to be treated as
3233 // child component listeners instead of DOM listeners
3234 var listeners = data.on;
3235 // replace with listeners with .native modifier
3236 // so it gets processed during parent component patch.
3237 data.on = data.nativeOn;
3238
3239 if (isTrue(Ctor.options.abstract)) {
3240 // abstract components do not keep anything
3241 // other than props & listeners & slot
3242
3243 // work around flow
3244 var slot = data.slot;
3245 data = {};
3246 if (slot) {
3247 data.slot = slot;
3248 }
3249 }
3250
3251 // install component management hooks onto the placeholder node
3252 installComponentHooks(data);
3253
3254 // return a placeholder vnode
3255 var name = Ctor.options.name || tag;
3256 var vnode = new VNode(
3257 ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
3258 data, undefined, undefined, undefined, context,
3259 { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
3260 asyncFactory
3261 );
3262
3263 return vnode
3264 }
3265
3266 function createComponentInstanceForVnode (
3267 vnode, // we know it's MountedComponentVNode but flow doesn't
3268 parent // activeInstance in lifecycle state
3269 ) {
3270 var options = {
3271 _isComponent: true,
3272 _parentVnode: vnode,
3273 parent: parent
3274 };
3275 // check inline-template render functions
3276 var inlineTemplate = vnode.data.inlineTemplate;
3277 if (isDef(inlineTemplate)) {
3278 options.render = inlineTemplate.render;
3279 options.staticRenderFns = inlineTemplate.staticRenderFns;
3280 }
3281 return new vnode.componentOptions.Ctor(options)
3282 }
3283
3284 function installComponentHooks (data) {
3285 var hooks = data.hook || (data.hook = {});
3286 for (var i = 0; i < hooksToMerge.length; i++) {
3287 var key = hooksToMerge[i];
3288 var existing = hooks[key];
3289 var toMerge = componentVNodeHooks[key];
3290 if (existing !== toMerge && !(existing && existing._merged)) {
3291 hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
3292 }
3293 }
3294 }
3295
3296 function mergeHook$1 (f1, f2) {
3297 var merged = function (a, b) {
3298 // flow complains about extra args which is why we use any
3299 f1(a, b);
3300 f2(a, b);
3301 };
3302 merged._merged = true;
3303 return merged
3304 }
3305
3306 // transform component v-model info (value and callback) into
3307 // prop and event handler respectively.
3308 function transformModel (options, data) {
3309 var prop = (options.model && options.model.prop) || 'value';
3310 var event = (options.model && options.model.event) || 'input'
3311 ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
3312 var on = data.on || (data.on = {});
3313 var existing = on[event];
3314 var callback = data.model.callback;
3315 if (isDef(existing)) {
3316 if (
3317 Array.isArray(existing)
3318 ? existing.indexOf(callback) === -1
3319 : existing !== callback
3320 ) {
3321 on[event] = [callback].concat(existing);
3322 }
3323 } else {
3324 on[event] = callback;
3325 }
3326 }
3327
3328 /* */
3329
3330 var SIMPLE_NORMALIZE = 1;
3331 var ALWAYS_NORMALIZE = 2;
3332
3333 // wrapper function for providing a more flexible interface
3334 // without getting yelled at by flow
3335 function createElement (
3336 context,
3337 tag,
3338 data,
3339 children,
3340 normalizationType,
3341 alwaysNormalize
3342 ) {
3343 if (Array.isArray(data) || isPrimitive(data)) {
3344 normalizationType = children;
3345 children = data;
3346 data = undefined;
3347 }
3348 if (isTrue(alwaysNormalize)) {
3349 normalizationType = ALWAYS_NORMALIZE;
3350 }
3351 return _createElement(context, tag, data, children, normalizationType)
3352 }
3353
3354 function _createElement (
3355 context,
3356 tag,
3357 data,
3358 children,
3359 normalizationType
3360 ) {
3361 if (isDef(data) && isDef((data).__ob__)) {
3362 warn(
3363 "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
3364 'Always create fresh vnode data objects in each render!',
3365 context
3366 );
3367 return createEmptyVNode()
3368 }
3369 // object syntax in v-bind
3370 if (isDef(data) && isDef(data.is)) {
3371 tag = data.is;
3372 }
3373 if (!tag) {
3374 // in case of component :is set to falsy value
3375 return createEmptyVNode()
3376 }
3377 // warn against non-primitive key
3378 if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)
3379 ) {
3380 {
3381 warn(
3382 'Avoid using non-primitive value as key, ' +
3383 'use string/number value instead.',
3384 context
3385 );
3386 }
3387 }
3388 // support single function children as default scoped slot
3389 if (Array.isArray(children) &&
3390 typeof children[0] === 'function'
3391 ) {
3392 data = data || {};
3393 data.scopedSlots = { default: children[0] };
3394 children.length = 0;
3395 }
3396 if (normalizationType === ALWAYS_NORMALIZE) {
3397 children = normalizeChildren(children);
3398 } else if (normalizationType === SIMPLE_NORMALIZE) {
3399 children = simpleNormalizeChildren(children);
3400 }
3401 var vnode, ns;
3402 if (typeof tag === 'string') {
3403 var Ctor;
3404 ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
3405 if (config.isReservedTag(tag)) {
3406 // platform built-in elements
3407 vnode = new VNode(
3408 config.parsePlatformTagName(tag), data, children,
3409 undefined, undefined, context
3410 );
3411 } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
3412 // component
3413 vnode = createComponent(Ctor, data, context, children, tag);
3414 } else {
3415 // unknown or unlisted namespaced elements
3416 // check at runtime because it may get assigned a namespace when its
3417 // parent normalizes children
3418 vnode = new VNode(
3419 tag, data, children,
3420 undefined, undefined, context
3421 );
3422 }
3423 } else {
3424 // direct component options / constructor
3425 vnode = createComponent(tag, data, context, children);
3426 }
3427 if (Array.isArray(vnode)) {
3428 return vnode
3429 } else if (isDef(vnode)) {
3430 if (isDef(ns)) { applyNS(vnode, ns); }
3431 if (isDef(data)) { registerDeepBindings(data); }
3432 return vnode
3433 } else {
3434 return createEmptyVNode()
3435 }
3436 }
3437
3438 function applyNS (vnode, ns, force) {
3439 vnode.ns = ns;
3440 if (vnode.tag === 'foreignObject') {
3441 // use default namespace inside foreignObject
3442 ns = undefined;
3443 force = true;
3444 }
3445 if (isDef(vnode.children)) {
3446 for (var i = 0, l = vnode.children.length; i < l; i++) {
3447 var child = vnode.children[i];
3448 if (isDef(child.tag) && (
3449 isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
3450 applyNS(child, ns, force);
3451 }
3452 }
3453 }
3454 }
3455
3456 // ref #5318
3457 // necessary to ensure parent re-render when deep bindings like :style and
3458 // :class are used on slot nodes
3459 function registerDeepBindings (data) {
3460 if (isObject(data.style)) {
3461 traverse(data.style);
3462 }
3463 if (isObject(data.class)) {
3464 traverse(data.class);
3465 }
3466 }
3467
3468 /* */
3469
3470 function initRender (vm) {
3471 vm._vnode = null; // the root of the child tree
3472 vm._staticTrees = null; // v-once cached trees
3473 var options = vm.$options;
3474 var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
3475 var renderContext = parentVnode && parentVnode.context;
3476 vm.$slots = resolveSlots(options._renderChildren, renderContext);
3477 vm.$scopedSlots = emptyObject;
3478 // bind the createElement fn to this instance
3479 // so that we get proper render context inside it.
3480 // args order: tag, data, children, normalizationType, alwaysNormalize
3481 // internal version is used by render functions compiled from templates
3482 vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
3483 // normalization is always applied for the public version, used in
3484 // user-written render functions.
3485 vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
3486
3487 // $attrs & $listeners are exposed for easier HOC creation.
3488 // they need to be reactive so that HOCs using them are always updated
3489 var parentData = parentVnode && parentVnode.data;
3490
3491 /* istanbul ignore else */
3492 {
3493 defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
3494 !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
3495 }, true);
3496 defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
3497 !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
3498 }, true);
3499 }
3500 }
3501
3502 var currentRenderingInstance = null;
3503
3504 function renderMixin (Vue) {
3505 // install runtime convenience helpers
3506 installRenderHelpers(Vue.prototype);
3507
3508 Vue.prototype.$nextTick = function (fn) {
3509 return nextTick(fn, this)
3510 };
3511
3512 Vue.prototype._render = function () {
3513 var vm = this;
3514 var ref = vm.$options;
3515 var render = ref.render;
3516 var _parentVnode = ref._parentVnode;
3517
3518 if (_parentVnode) {
3519 vm.$scopedSlots = normalizeScopedSlots(
3520 _parentVnode.data.scopedSlots,
3521 vm.$slots,
3522 vm.$scopedSlots
3523 );
3524 }
3525
3526 // set parent vnode. this allows render functions to have access
3527 // to the data on the placeholder node.
3528 vm.$vnode = _parentVnode;
3529 // render self
3530 var vnode;
3531 try {
3532 // There's no need to maintain a stack becaues all render fns are called
3533 // separately from one another. Nested component's render fns are called
3534 // when parent component is patched.
3535 currentRenderingInstance = vm;
3536 vnode = render.call(vm._renderProxy, vm.$createElement);
3537 } catch (e) {
3538 handleError(e, vm, "render");
3539 // return error render result,
3540 // or previous vnode to prevent render error causing blank component
3541 /* istanbul ignore else */
3542 if (vm.$options.renderError) {
3543 try {
3544 vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
3545 } catch (e) {
3546 handleError(e, vm, "renderError");
3547 vnode = vm._vnode;
3548 }
3549 } else {
3550 vnode = vm._vnode;
3551 }
3552 } finally {
3553 currentRenderingInstance = null;
3554 }
3555 // if the returned array contains only a single node, allow it
3556 if (Array.isArray(vnode) && vnode.length === 1) {
3557 vnode = vnode[0];
3558 }
3559 // return empty vnode in case the render function errored out
3560 if (!(vnode instanceof VNode)) {
3561 if (Array.isArray(vnode)) {
3562 warn(
3563 'Multiple root nodes returned from render function. Render function ' +
3564 'should return a single root node.',
3565 vm
3566 );
3567 }
3568 vnode = createEmptyVNode();
3569 }
3570 // set parent
3571 vnode.parent = _parentVnode;
3572 return vnode
3573 };
3574 }
3575
3576 /* */
3577
3578 function ensureCtor (comp, base) {
3579 if (
3580 comp.__esModule ||
3581 (hasSymbol && comp[Symbol.toStringTag] === 'Module')
3582 ) {
3583 comp = comp.default;
3584 }
3585 return isObject(comp)
3586 ? base.extend(comp)
3587 : comp
3588 }
3589
3590 function createAsyncPlaceholder (
3591 factory,
3592 data,
3593 context,
3594 children,
3595 tag
3596 ) {
3597 var node = createEmptyVNode();
3598 node.asyncFactory = factory;
3599 node.asyncMeta = { data: data, context: context, children: children, tag: tag };
3600 return node
3601 }
3602
3603 function resolveAsyncComponent (
3604 factory,
3605 baseCtor
3606 ) {
3607 if (isTrue(factory.error) && isDef(factory.errorComp)) {
3608 return factory.errorComp
3609 }
3610
3611 if (isDef(factory.resolved)) {
3612 return factory.resolved
3613 }
3614
3615 var owner = currentRenderingInstance;
3616 if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
3617 // already pending
3618 factory.owners.push(owner);
3619 }
3620
3621 if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
3622 return factory.loadingComp
3623 }
3624
3625 if (owner && !isDef(factory.owners)) {
3626 var owners = factory.owners = [owner];
3627 var sync = true;
3628 var timerLoading = null;
3629 var timerTimeout = null
3630
3631 ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
3632
3633 var forceRender = function (renderCompleted) {
3634 for (var i = 0, l = owners.length; i < l; i++) {
3635 (owners[i]).$forceUpdate();
3636 }
3637
3638 if (renderCompleted) {
3639 owners.length = 0;
3640 if (timerLoading !== null) {
3641 clearTimeout(timerLoading);
3642 timerLoading = null;
3643 }
3644 if (timerTimeout !== null) {
3645 clearTimeout(timerTimeout);
3646 timerTimeout = null;
3647 }
3648 }
3649 };
3650
3651 var resolve = once(function (res) {
3652 // cache resolved
3653 factory.resolved = ensureCtor(res, baseCtor);
3654 // invoke callbacks only if this is not a synchronous resolve
3655 // (async resolves are shimmed as synchronous during SSR)
3656 if (!sync) {
3657 forceRender(true);
3658 } else {
3659 owners.length = 0;
3660 }
3661 });
3662
3663 var reject = once(function (reason) {
3664 warn(
3665 "Failed to resolve async component: " + (String(factory)) +
3666 (reason ? ("\nReason: " + reason) : '')
3667 );
3668 if (isDef(factory.errorComp)) {
3669 factory.error = true;
3670 forceRender(true);
3671 }
3672 });
3673
3674 var res = factory(resolve, reject);
3675
3676 if (isObject(res)) {
3677 if (isPromise(res)) {
3678 // () => Promise
3679 if (isUndef(factory.resolved)) {
3680 res.then(resolve, reject);
3681 }
3682 } else if (isPromise(res.component)) {
3683 res.component.then(resolve, reject);
3684
3685 if (isDef(res.error)) {
3686 factory.errorComp = ensureCtor(res.error, baseCtor);
3687 }
3688
3689 if (isDef(res.loading)) {
3690 factory.loadingComp = ensureCtor(res.loading, baseCtor);
3691 if (res.delay === 0) {
3692 factory.loading = true;
3693 } else {
3694 timerLoading = setTimeout(function () {
3695 timerLoading = null;
3696 if (isUndef(factory.resolved) && isUndef(factory.error)) {
3697 factory.loading = true;
3698 forceRender(false);
3699 }
3700 }, res.delay || 200);
3701 }
3702 }
3703
3704 if (isDef(res.timeout)) {
3705 timerTimeout = setTimeout(function () {
3706 timerTimeout = null;
3707 if (isUndef(factory.resolved)) {
3708 reject(
3709 "timeout (" + (res.timeout) + "ms)"
3710 );
3711 }
3712 }, res.timeout);
3713 }
3714 }
3715 }
3716
3717 sync = false;
3718 // return in case resolved synchronously
3719 return factory.loading
3720 ? factory.loadingComp
3721 : factory.resolved
3722 }
3723 }
3724
3725 /* */
3726
3727 function isAsyncPlaceholder (node) {
3728 return node.isComment && node.asyncFactory
3729 }
3730
3731 /* */
3732
3733 function getFirstComponentChild (children) {
3734 if (Array.isArray(children)) {
3735 for (var i = 0; i < children.length; i++) {
3736 var c = children[i];
3737 if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
3738 return c
3739 }
3740 }
3741 }
3742 }
3743
3744 /* */
3745
3746 /* */
3747
3748 function initEvents (vm) {
3749 vm._events = Object.create(null);
3750 vm._hasHookEvent = false;
3751 // init parent attached events
3752 var listeners = vm.$options._parentListeners;
3753 if (listeners) {
3754 updateComponentListeners(vm, listeners);
3755 }
3756 }
3757
3758 var target;
3759
3760 function add (event, fn) {
3761 target.$on(event, fn);
3762 }
3763
3764 function remove$1 (event, fn) {
3765 target.$off(event, fn);
3766 }
3767
3768 function createOnceHandler (event, fn) {
3769 var _target = target;
3770 return function onceHandler () {
3771 var res = fn.apply(null, arguments);
3772 if (res !== null) {
3773 _target.$off(event, onceHandler);
3774 }
3775 }
3776 }
3777
3778 function updateComponentListeners (
3779 vm,
3780 listeners,
3781 oldListeners
3782 ) {
3783 target = vm;
3784 updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
3785 target = undefined;
3786 }
3787
3788 function eventsMixin (Vue) {
3789 var hookRE = /^hook:/;
3790 Vue.prototype.$on = function (event, fn) {
3791 var vm = this;
3792 if (Array.isArray(event)) {
3793 for (var i = 0, l = event.length; i < l; i++) {
3794 vm.$on(event[i], fn);
3795 }
3796 } else {
3797 (vm._events[event] || (vm._events[event] = [])).push(fn);
3798 // optimize hook:event cost by using a boolean flag marked at registration
3799 // instead of a hash lookup
3800 if (hookRE.test(event)) {
3801 vm._hasHookEvent = true;
3802 }
3803 }
3804 return vm
3805 };
3806
3807 Vue.prototype.$once = function (event, fn) {
3808 var vm = this;
3809 function on () {
3810 vm.$off(event, on);
3811 fn.apply(vm, arguments);
3812 }
3813 on.fn = fn;
3814 vm.$on(event, on);
3815 return vm
3816 };
3817
3818 Vue.prototype.$off = function (event, fn) {
3819 var vm = this;
3820 // all
3821 if (!arguments.length) {
3822 vm._events = Object.create(null);
3823 return vm
3824 }
3825 // array of events
3826 if (Array.isArray(event)) {
3827 for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
3828 vm.$off(event[i$1], fn);
3829 }
3830 return vm
3831 }
3832 // specific event
3833 var cbs = vm._events[event];
3834 if (!cbs) {
3835 return vm
3836 }
3837 if (!fn) {
3838 vm._events[event] = null;
3839 return vm
3840 }
3841 // specific handler
3842 var cb;
3843 var i = cbs.length;
3844 while (i--) {
3845 cb = cbs[i];
3846 if (cb === fn || cb.fn === fn) {
3847 cbs.splice(i, 1);
3848 break
3849 }
3850 }
3851 return vm
3852 };
3853
3854 Vue.prototype.$emit = function (event) {
3855 var vm = this;
3856 {
3857 var lowerCaseEvent = event.toLowerCase();
3858 if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
3859 tip(
3860 "Event \"" + lowerCaseEvent + "\" is emitted in component " +
3861 (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
3862 "Note that HTML attributes are case-insensitive and you cannot use " +
3863 "v-on to listen to camelCase events when using in-DOM templates. " +
3864 "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
3865 );
3866 }
3867 }
3868 var cbs = vm._events[event];
3869 if (cbs) {
3870 cbs = cbs.length > 1 ? toArray(cbs) : cbs;
3871 var args = toArray(arguments, 1);
3872 var info = "event handler for \"" + event + "\"";
3873 for (var i = 0, l = cbs.length; i < l; i++) {
3874 invokeWithErrorHandling(cbs[i], vm, args, vm, info);
3875 }
3876 }
3877 return vm
3878 };
3879 }
3880
3881 /* */
3882
3883 var activeInstance = null;
3884 var isUpdatingChildComponent = false;
3885
3886 function setActiveInstance(vm) {
3887 var prevActiveInstance = activeInstance;
3888 activeInstance = vm;
3889 return function () {
3890 activeInstance = prevActiveInstance;
3891 }
3892 }
3893
3894 function initLifecycle (vm) {
3895 var options = vm.$options;
3896
3897 // locate first non-abstract parent
3898 var parent = options.parent;
3899 if (parent && !options.abstract) {
3900 while (parent.$options.abstract && parent.$parent) {
3901 parent = parent.$parent;
3902 }
3903 parent.$children.push(vm);
3904 }
3905
3906 vm.$parent = parent;
3907 vm.$root = parent ? parent.$root : vm;
3908
3909 vm.$children = [];
3910 vm.$refs = {};
3911
3912 vm._watcher = null;
3913 vm._inactive = null;
3914 vm._directInactive = false;
3915 vm._isMounted = false;
3916 vm._isDestroyed = false;
3917 vm._isBeingDestroyed = false;
3918 }
3919
3920 function lifecycleMixin (Vue) {
3921 Vue.prototype._update = function (vnode, hydrating) {
3922 var vm = this;
3923 var prevEl = vm.$el;
3924 var prevVnode = vm._vnode;
3925 var restoreActiveInstance = setActiveInstance(vm);
3926 vm._vnode = vnode;
3927 // Vue.prototype.__patch__ is injected in entry points
3928 // based on the rendering backend used.
3929 if (!prevVnode) {
3930 // initial render
3931 vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
3932 } else {
3933 // updates
3934 vm.$el = vm.__patch__(prevVnode, vnode);
3935 }
3936 restoreActiveInstance();
3937 // update __vue__ reference
3938 if (prevEl) {
3939 prevEl.__vue__ = null;
3940 }
3941 if (vm.$el) {
3942 vm.$el.__vue__ = vm;
3943 }
3944 // if parent is an HOC, update its $el as well
3945 if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
3946 vm.$parent.$el = vm.$el;
3947 }
3948 // updated hook is called by the scheduler to ensure that children are
3949 // updated in a parent's updated hook.
3950 };
3951
3952 Vue.prototype.$forceUpdate = function () {
3953 var vm = this;
3954 if (vm._watcher) {
3955 vm._watcher.update();
3956 }
3957 };
3958
3959 Vue.prototype.$destroy = function () {
3960 var vm = this;
3961 if (vm._isBeingDestroyed) {
3962 return
3963 }
3964 callHook(vm, 'beforeDestroy');
3965 vm._isBeingDestroyed = true;
3966 // remove self from parent
3967 var parent = vm.$parent;
3968 if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
3969 remove(parent.$children, vm);
3970 }
3971 // teardown watchers
3972 if (vm._watcher) {
3973 vm._watcher.teardown();
3974 }
3975 var i = vm._watchers.length;
3976 while (i--) {
3977 vm._watchers[i].teardown();
3978 }
3979 // remove reference from data ob
3980 // frozen object may not have observer.
3981 if (vm._data.__ob__) {
3982 vm._data.__ob__.vmCount--;
3983 }
3984 // call the last hook...
3985 vm._isDestroyed = true;
3986 // invoke destroy hooks on current rendered tree
3987 vm.__patch__(vm._vnode, null);
3988 // fire destroyed hook
3989 callHook(vm, 'destroyed');
3990 // turn off all instance listeners.
3991 vm.$off();
3992 // remove __vue__ reference
3993 if (vm.$el) {
3994 vm.$el.__vue__ = null;
3995 }
3996 // release circular reference (#6759)
3997 if (vm.$vnode) {
3998 vm.$vnode.parent = null;
3999 }
4000 };
4001 }
4002
4003 function mountComponent (
4004 vm,
4005 el,
4006 hydrating
4007 ) {
4008 vm.$el = el;
4009 if (!vm.$options.render) {
4010 vm.$options.render = createEmptyVNode;
4011 {
4012 /* istanbul ignore if */
4013 if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
4014 vm.$options.el || el) {
4015 warn(
4016 'You are using the runtime-only build of Vue where the template ' +
4017 'compiler is not available. Either pre-compile the templates into ' +
4018 'render functions, or use the compiler-included build.',
4019 vm
4020 );
4021 } else {
4022 warn(
4023 'Failed to mount component: template or render function not defined.',
4024 vm
4025 );
4026 }
4027 }
4028 }
4029 callHook(vm, 'beforeMount');
4030
4031 var updateComponent;
4032 /* istanbul ignore if */
4033 if (config.performance && mark) {
4034 updateComponent = function () {
4035 var name = vm._name;
4036 var id = vm._uid;
4037 var startTag = "vue-perf-start:" + id;
4038 var endTag = "vue-perf-end:" + id;
4039
4040 mark(startTag);
4041 var vnode = vm._render();
4042 mark(endTag);
4043 measure(("vue " + name + " render"), startTag, endTag);
4044
4045 mark(startTag);
4046 vm._update(vnode, hydrating);
4047 mark(endTag);
4048 measure(("vue " + name + " patch"), startTag, endTag);
4049 };
4050 } else {
4051 updateComponent = function () {
4052 vm._update(vm._render(), hydrating);
4053 };
4054 }
4055
4056 // we set this to vm._watcher inside the watcher's constructor
4057 // since the watcher's initial patch may call $forceUpdate (e.g. inside child
4058 // component's mounted hook), which relies on vm._watcher being already defined
4059 new Watcher(vm, updateComponent, noop, {
4060 before: function before () {
4061 if (vm._isMounted && !vm._isDestroyed) {
4062 callHook(vm, 'beforeUpdate');
4063 }
4064 }
4065 }, true /* isRenderWatcher */);
4066 hydrating = false;
4067
4068 // manually mounted instance, call mounted on self
4069 // mounted is called for render-created child components in its inserted hook
4070 if (vm.$vnode == null) {
4071 vm._isMounted = true;
4072 callHook(vm, 'mounted');
4073 }
4074 return vm
4075 }
4076
4077 function updateChildComponent (
4078 vm,
4079 propsData,
4080 listeners,
4081 parentVnode,
4082 renderChildren
4083 ) {
4084 {
4085 isUpdatingChildComponent = true;
4086 }
4087
4088 // determine whether component has slot children
4089 // we need to do this before overwriting $options._renderChildren.
4090
4091 // check if there are dynamic scopedSlots (hand-written or compiled but with
4092 // dynamic slot names). Static scoped slots compiled from template has the
4093 // "$stable" marker.
4094 var newScopedSlots = parentVnode.data.scopedSlots;
4095 var oldScopedSlots = vm.$scopedSlots;
4096 var hasDynamicScopedSlot = !!(
4097 (newScopedSlots && !newScopedSlots.$stable) ||
4098 (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
4099 (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
4100 );
4101
4102 // Any static slot children from the parent may have changed during parent's
4103 // update. Dynamic scoped slots may also have changed. In such cases, a forced
4104 // update is necessary to ensure correctness.
4105 var needsForceUpdate = !!(
4106 renderChildren || // has new static slots
4107 vm.$options._renderChildren || // has old static slots
4108 hasDynamicScopedSlot
4109 );
4110
4111 vm.$options._parentVnode = parentVnode;
4112 vm.$vnode = parentVnode; // update vm's placeholder node without re-render
4113
4114 if (vm._vnode) { // update child tree's parent
4115 vm._vnode.parent = parentVnode;
4116 }
4117 vm.$options._renderChildren = renderChildren;
4118
4119 // update $attrs and $listeners hash
4120 // these are also reactive so they may trigger child update if the child
4121 // used them during render
4122 vm.$attrs = parentVnode.data.attrs || emptyObject;
4123 vm.$listeners = listeners || emptyObject;
4124
4125 // update props
4126 if (propsData && vm.$options.props) {
4127 toggleObserving(false);
4128 var props = vm._props;
4129 var propKeys = vm.$options._propKeys || [];
4130 for (var i = 0; i < propKeys.length; i++) {
4131 var key = propKeys[i];
4132 var propOptions = vm.$options.props; // wtf flow?
4133 props[key] = validateProp(key, propOptions, propsData, vm);
4134 }
4135 toggleObserving(true);
4136 // keep a copy of raw propsData
4137 vm.$options.propsData = propsData;
4138 }
4139
4140 // update listeners
4141 listeners = listeners || emptyObject;
4142 var oldListeners = vm.$options._parentListeners;
4143 vm.$options._parentListeners = listeners;
4144 updateComponentListeners(vm, listeners, oldListeners);
4145
4146 // resolve slots + force update if has children
4147 if (needsForceUpdate) {
4148 vm.$slots = resolveSlots(renderChildren, parentVnode.context);
4149 vm.$forceUpdate();
4150 }
4151
4152 {
4153 isUpdatingChildComponent = false;
4154 }
4155 }
4156
4157 function isInInactiveTree (vm) {
4158 while (vm && (vm = vm.$parent)) {
4159 if (vm._inactive) { return true }
4160 }
4161 return false
4162 }
4163
4164 function activateChildComponent (vm, direct) {
4165 if (direct) {
4166 vm._directInactive = false;
4167 if (isInInactiveTree(vm)) {
4168 return
4169 }
4170 } else if (vm._directInactive) {
4171 return
4172 }
4173 if (vm._inactive || vm._inactive === null) {
4174 vm._inactive = false;
4175 for (var i = 0; i < vm.$children.length; i++) {
4176 activateChildComponent(vm.$children[i]);
4177 }
4178 callHook(vm, 'activated');
4179 }
4180 }
4181
4182 function deactivateChildComponent (vm, direct) {
4183 if (direct) {
4184 vm._directInactive = true;
4185 if (isInInactiveTree(vm)) {
4186 return
4187 }
4188 }
4189 if (!vm._inactive) {
4190 vm._inactive = true;
4191 for (var i = 0; i < vm.$children.length; i++) {
4192 deactivateChildComponent(vm.$children[i]);
4193 }
4194 callHook(vm, 'deactivated');
4195 }
4196 }
4197
4198 function callHook (vm, hook) {
4199 // #7573 disable dep collection when invoking lifecycle hooks
4200 pushTarget();
4201 var handlers = vm.$options[hook];
4202 var info = hook + " hook";
4203 if (handlers) {
4204 for (var i = 0, j = handlers.length; i < j; i++) {
4205 invokeWithErrorHandling(handlers[i], vm, null, vm, info);
4206 }
4207 }
4208 if (vm._hasHookEvent) {
4209 vm.$emit('hook:' + hook);
4210 }
4211 popTarget();
4212 }
4213
4214 /* */
4215
4216 var MAX_UPDATE_COUNT = 100;
4217
4218 var queue = [];
4219 var activatedChildren = [];
4220 var has = {};
4221 var circular = {};
4222 var waiting = false;
4223 var flushing = false;
4224 var index = 0;
4225
4226 /**
4227 * Reset the scheduler's state.
4228 */
4229 function resetSchedulerState () {
4230 index = queue.length = activatedChildren.length = 0;
4231 has = {};
4232 {
4233 circular = {};
4234 }
4235 waiting = flushing = false;
4236 }
4237
4238 // Async edge case #6566 requires saving the timestamp when event listeners are
4239 // attached. However, calling performance.now() has a perf overhead especially
4240 // if the page has thousands of event listeners. Instead, we take a timestamp
4241 // every time the scheduler flushes and use that for all event listeners
4242 // attached during that flush.
4243 var currentFlushTimestamp = 0;
4244
4245 // Async edge case fix requires storing an event listener's attach timestamp.
4246 var getNow = Date.now;
4247
4248 // Determine what event timestamp the browser is using. Annoyingly, the
4249 // timestamp can either be hi-res (relative to page load) or low-res
4250 // (relative to UNIX epoch), so in order to compare time we have to use the
4251 // same timestamp type when saving the flush timestamp.
4252 // All IE versions use low-res event timestamps, and have problematic clock
4253 // implementations (#9632)
4254 if (inBrowser && !isIE) {
4255 var performance = window.performance;
4256 if (
4257 performance &&
4258 typeof performance.now === 'function' &&
4259 getNow() > document.createEvent('Event').timeStamp
4260 ) {
4261 // if the event timestamp, although evaluated AFTER the Date.now(), is
4262 // smaller than it, it means the event is using a hi-res timestamp,
4263 // and we need to use the hi-res version for event listener timestamps as
4264 // well.
4265 getNow = function () { return performance.now(); };
4266 }
4267 }
4268
4269 /**
4270 * Flush both queues and run the watchers.
4271 */
4272 function flushSchedulerQueue () {
4273 currentFlushTimestamp = getNow();
4274 flushing = true;
4275 var watcher, id;
4276
4277 // Sort queue before flush.
4278 // This ensures that:
4279 // 1. Components are updated from parent to child. (because parent is always
4280 // created before the child)
4281 // 2. A component's user watchers are run before its render watcher (because
4282 // user watchers are created before the render watcher)
4283 // 3. If a component is destroyed during a parent component's watcher run,
4284 // its watchers can be skipped.
4285 queue.sort(function (a, b) { return a.id - b.id; });
4286
4287 // do not cache length because more watchers might be pushed
4288 // as we run existing watchers
4289 for (index = 0; index < queue.length; index++) {
4290 watcher = queue[index];
4291 if (watcher.before) {
4292 watcher.before();
4293 }
4294 id = watcher.id;
4295 has[id] = null;
4296 watcher.run();
4297 // in dev build, check and stop circular updates.
4298 if (has[id] != null) {
4299 circular[id] = (circular[id] || 0) + 1;
4300 if (circular[id] > MAX_UPDATE_COUNT) {
4301 warn(
4302 'You may have an infinite update loop ' + (
4303 watcher.user
4304 ? ("in watcher with expression \"" + (watcher.expression) + "\"")
4305 : "in a component render function."
4306 ),
4307 watcher.vm
4308 );
4309 break
4310 }
4311 }
4312 }
4313
4314 // keep copies of post queues before resetting state
4315 var activatedQueue = activatedChildren.slice();
4316 var updatedQueue = queue.slice();
4317
4318 resetSchedulerState();
4319
4320 // call component updated and activated hooks
4321 callActivatedHooks(activatedQueue);
4322 callUpdatedHooks(updatedQueue);
4323
4324 // devtool hook
4325 /* istanbul ignore if */
4326 if (devtools && config.devtools) {
4327 devtools.emit('flush');
4328 }
4329 }
4330
4331 function callUpdatedHooks (queue) {
4332 var i = queue.length;
4333 while (i--) {
4334 var watcher = queue[i];
4335 var vm = watcher.vm;
4336 if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
4337 callHook(vm, 'updated');
4338 }
4339 }
4340 }
4341
4342 /**
4343 * Queue a kept-alive component that was activated during patch.
4344 * The queue will be processed after the entire tree has been patched.
4345 */
4346 function queueActivatedComponent (vm) {
4347 // setting _inactive to false here so that a render function can
4348 // rely on checking whether it's in an inactive tree (e.g. router-view)
4349 vm._inactive = false;
4350 activatedChildren.push(vm);
4351 }
4352
4353 function callActivatedHooks (queue) {
4354 for (var i = 0; i < queue.length; i++) {
4355 queue[i]._inactive = true;
4356 activateChildComponent(queue[i], true /* true */);
4357 }
4358 }
4359
4360 /**
4361 * Push a watcher into the watcher queue.
4362 * Jobs with duplicate IDs will be skipped unless it's
4363 * pushed when the queue is being flushed.
4364 */
4365 function queueWatcher (watcher) {
4366 var id = watcher.id;
4367 if (has[id] == null) {
4368 has[id] = true;
4369 if (!flushing) {
4370 queue.push(watcher);
4371 } else {
4372 // if already flushing, splice the watcher based on its id
4373 // if already past its id, it will be run next immediately.
4374 var i = queue.length - 1;
4375 while (i > index && queue[i].id > watcher.id) {
4376 i--;
4377 }
4378 queue.splice(i + 1, 0, watcher);
4379 }
4380 // queue the flush
4381 if (!waiting) {
4382 waiting = true;
4383
4384 if (!config.async) {
4385 flushSchedulerQueue();
4386 return
4387 }
4388 nextTick(flushSchedulerQueue);
4389 }
4390 }
4391 }
4392
4393 /* */
4394
4395
4396
4397 var uid$2 = 0;
4398
4399 /**
4400 * A watcher parses an expression, collects dependencies,
4401 * and fires callback when the expression value changes.
4402 * This is used for both the $watch() api and directives.
4403 */
4404 var Watcher = function Watcher (
4405 vm,
4406 expOrFn,
4407 cb,
4408 options,
4409 isRenderWatcher
4410 ) {
4411 this.vm = vm;
4412 if (isRenderWatcher) {
4413 vm._watcher = this;
4414 }
4415 vm._watchers.push(this);
4416 // options
4417 if (options) {
4418 this.deep = !!options.deep;
4419 this.user = !!options.user;
4420 this.lazy = !!options.lazy;
4421 this.sync = !!options.sync;
4422 this.before = options.before;
4423 } else {
4424 this.deep = this.user = this.lazy = this.sync = false;
4425 }
4426 this.cb = cb;
4427 this.id = ++uid$2; // uid for batching
4428 this.active = true;
4429 this.dirty = this.lazy; // for lazy watchers
4430 this.deps = [];
4431 this.newDeps = [];
4432 this.depIds = new _Set();
4433 this.newDepIds = new _Set();
4434 this.expression = expOrFn.toString();
4435 // parse expression for getter
4436 if (typeof expOrFn === 'function') {
4437 this.getter = expOrFn;
4438 } else {
4439 this.getter = parsePath(expOrFn);
4440 if (!this.getter) {
4441 this.getter = noop;
4442 warn(
4443 "Failed watching path: \"" + expOrFn + "\" " +
4444 'Watcher only accepts simple dot-delimited paths. ' +
4445 'For full control, use a function instead.',
4446 vm
4447 );
4448 }
4449 }
4450 this.value = this.lazy
4451 ? undefined
4452 : this.get();
4453 };
4454
4455 /**
4456 * Evaluate the getter, and re-collect dependencies.
4457 */
4458 Watcher.prototype.get = function get () {
4459 pushTarget(this);
4460 var value;
4461 var vm = this.vm;
4462 try {
4463 value = this.getter.call(vm, vm);
4464 } catch (e) {
4465 if (this.user) {
4466 handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
4467 } else {
4468 throw e
4469 }
4470 } finally {
4471 // "touch" every property so they are all tracked as
4472 // dependencies for deep watching
4473 if (this.deep) {
4474 traverse(value);
4475 }
4476 popTarget();
4477 this.cleanupDeps();
4478 }
4479 return value
4480 };
4481
4482 /**
4483 * Add a dependency to this directive.
4484 */
4485 Watcher.prototype.addDep = function addDep (dep) {
4486 var id = dep.id;
4487 if (!this.newDepIds.has(id)) {
4488 this.newDepIds.add(id);
4489 this.newDeps.push(dep);
4490 if (!this.depIds.has(id)) {
4491 dep.addSub(this);
4492 }
4493 }
4494 };
4495
4496 /**
4497 * Clean up for dependency collection.
4498 */
4499 Watcher.prototype.cleanupDeps = function cleanupDeps () {
4500 var i = this.deps.length;
4501 while (i--) {
4502 var dep = this.deps[i];
4503 if (!this.newDepIds.has(dep.id)) {
4504 dep.removeSub(this);
4505 }
4506 }
4507 var tmp = this.depIds;
4508 this.depIds = this.newDepIds;
4509 this.newDepIds = tmp;
4510 this.newDepIds.clear();
4511 tmp = this.deps;
4512 this.deps = this.newDeps;
4513 this.newDeps = tmp;
4514 this.newDeps.length = 0;
4515 };
4516
4517 /**
4518 * Subscriber interface.
4519 * Will be called when a dependency changes.
4520 */
4521 Watcher.prototype.update = function update () {
4522 /* istanbul ignore else */
4523 if (this.lazy) {
4524 this.dirty = true;
4525 } else if (this.sync) {
4526 this.run();
4527 } else {
4528 queueWatcher(this);
4529 }
4530 };
4531
4532 /**
4533 * Scheduler job interface.
4534 * Will be called by the scheduler.
4535 */
4536 Watcher.prototype.run = function run () {
4537 if (this.active) {
4538 var value = this.get();
4539 if (
4540 value !== this.value ||
4541 // Deep watchers and watchers on Object/Arrays should fire even
4542 // when the value is the same, because the value may
4543 // have mutated.
4544 isObject(value) ||
4545 this.deep
4546 ) {
4547 // set new value
4548 var oldValue = this.value;
4549 this.value = value;
4550 if (this.user) {
4551 try {
4552 this.cb.call(this.vm, value, oldValue);
4553 } catch (e) {
4554 handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
4555 }
4556 } else {
4557 this.cb.call(this.vm, value, oldValue);
4558 }
4559 }
4560 }
4561 };
4562
4563 /**
4564 * Evaluate the value of the watcher.
4565 * This only gets called for lazy watchers.
4566 */
4567 Watcher.prototype.evaluate = function evaluate () {
4568 this.value = this.get();
4569 this.dirty = false;
4570 };
4571
4572 /**
4573 * Depend on all deps collected by this watcher.
4574 */
4575 Watcher.prototype.depend = function depend () {
4576 var i = this.deps.length;
4577 while (i--) {
4578 this.deps[i].depend();
4579 }
4580 };
4581
4582 /**
4583 * Remove self from all dependencies' subscriber list.
4584 */
4585 Watcher.prototype.teardown = function teardown () {
4586 if (this.active) {
4587 // remove self from vm's watcher list
4588 // this is a somewhat expensive operation so we skip it
4589 // if the vm is being destroyed.
4590 if (!this.vm._isBeingDestroyed) {
4591 remove(this.vm._watchers, this);
4592 }
4593 var i = this.deps.length;
4594 while (i--) {
4595 this.deps[i].removeSub(this);
4596 }
4597 this.active = false;
4598 }
4599 };
4600
4601 /* */
4602
4603 var sharedPropertyDefinition = {
4604 enumerable: true,
4605 configurable: true,
4606 get: noop,
4607 set: noop
4608 };
4609
4610 function proxy (target, sourceKey, key) {
4611 sharedPropertyDefinition.get = function proxyGetter () {
4612 return this[sourceKey][key]
4613 };
4614 sharedPropertyDefinition.set = function proxySetter (val) {
4615 this[sourceKey][key] = val;
4616 };
4617 Object.defineProperty(target, key, sharedPropertyDefinition);
4618 }
4619
4620 function initState (vm) {
4621 vm._watchers = [];
4622 var opts = vm.$options;
4623 if (opts.props) { initProps(vm, opts.props); }
4624 if (opts.methods) { initMethods(vm, opts.methods); }
4625 if (opts.data) {
4626 initData(vm);
4627 } else {
4628 observe(vm._data = {}, true /* asRootData */);
4629 }
4630 if (opts.computed) { initComputed(vm, opts.computed); }
4631 if (opts.watch && opts.watch !== nativeWatch) {
4632 initWatch(vm, opts.watch);
4633 }
4634 }
4635
4636 function initProps (vm, propsOptions) {
4637 var propsData = vm.$options.propsData || {};
4638 var props = vm._props = {};
4639 // cache prop keys so that future props updates can iterate using Array
4640 // instead of dynamic object key enumeration.
4641 var keys = vm.$options._propKeys = [];
4642 var isRoot = !vm.$parent;
4643 // root instance props should be converted
4644 if (!isRoot) {
4645 toggleObserving(false);
4646 }
4647 var loop = function ( key ) {
4648 keys.push(key);
4649 var value = validateProp(key, propsOptions, propsData, vm);
4650 /* istanbul ignore else */
4651 {
4652 var hyphenatedKey = hyphenate(key);
4653 if (isReservedAttribute(hyphenatedKey) ||
4654 config.isReservedAttr(hyphenatedKey)) {
4655 warn(
4656 ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
4657 vm
4658 );
4659 }
4660 defineReactive$$1(props, key, value, function () {
4661 if (!isRoot && !isUpdatingChildComponent) {
4662 warn(
4663 "Avoid mutating a prop directly since the value will be " +
4664 "overwritten whenever the parent component re-renders. " +
4665 "Instead, use a data or computed property based on the prop's " +
4666 "value. Prop being mutated: \"" + key + "\"",
4667 vm
4668 );
4669 }
4670 });
4671 }
4672 // static props are already proxied on the component's prototype
4673 // during Vue.extend(). We only need to proxy props defined at
4674 // instantiation here.
4675 if (!(key in vm)) {
4676 proxy(vm, "_props", key);
4677 }
4678 };
4679
4680 for (var key in propsOptions) loop( key );
4681 toggleObserving(true);
4682 }
4683
4684 function initData (vm) {
4685 var data = vm.$options.data;
4686 data = vm._data = typeof data === 'function'
4687 ? getData(data, vm)
4688 : data || {};
4689 if (!isPlainObject(data)) {
4690 data = {};
4691 warn(
4692 'data functions should return an object:\n' +
4693 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
4694 vm
4695 );
4696 }
4697 // proxy data on instance
4698 var keys = Object.keys(data);
4699 var props = vm.$options.props;
4700 var methods = vm.$options.methods;
4701 var i = keys.length;
4702 while (i--) {
4703 var key = keys[i];
4704 {
4705 if (methods && hasOwn(methods, key)) {
4706 warn(
4707 ("Method \"" + key + "\" has already been defined as a data property."),
4708 vm
4709 );
4710 }
4711 }
4712 if (props && hasOwn(props, key)) {
4713 warn(
4714 "The data property \"" + key + "\" is already declared as a prop. " +
4715 "Use prop default value instead.",
4716 vm
4717 );
4718 } else if (!isReserved(key)) {
4719 proxy(vm, "_data", key);
4720 }
4721 }
4722 // observe data
4723 observe(data, true /* asRootData */);
4724 }
4725
4726 function getData (data, vm) {
4727 // #7573 disable dep collection when invoking data getters
4728 pushTarget();
4729 try {
4730 return data.call(vm, vm)
4731 } catch (e) {
4732 handleError(e, vm, "data()");
4733 return {}
4734 } finally {
4735 popTarget();
4736 }
4737 }
4738
4739 var computedWatcherOptions = { lazy: true };
4740
4741 function initComputed (vm, computed) {
4742 // $flow-disable-line
4743 var watchers = vm._computedWatchers = Object.create(null);
4744 // computed properties are just getters during SSR
4745 var isSSR = isServerRendering();
4746
4747 for (var key in computed) {
4748 var userDef = computed[key];
4749 var getter = typeof userDef === 'function' ? userDef : userDef.get;
4750 if (getter == null) {
4751 warn(
4752 ("Getter is missing for computed property \"" + key + "\"."),
4753 vm
4754 );
4755 }
4756
4757 if (!isSSR) {
4758 // create internal watcher for the computed property.
4759 watchers[key] = new Watcher(
4760 vm,
4761 getter || noop,
4762 noop,
4763 computedWatcherOptions
4764 );
4765 }
4766
4767 // component-defined computed properties are already defined on the
4768 // component prototype. We only need to define computed properties defined
4769 // at instantiation here.
4770 if (!(key in vm)) {
4771 defineComputed(vm, key, userDef);
4772 } else {
4773 if (key in vm.$data) {
4774 warn(("The computed property \"" + key + "\" is already defined in data."), vm);
4775 } else if (vm.$options.props && key in vm.$options.props) {
4776 warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
4777 }
4778 }
4779 }
4780 }
4781
4782 function defineComputed (
4783 target,
4784 key,
4785 userDef
4786 ) {
4787 var shouldCache = !isServerRendering();
4788 if (typeof userDef === 'function') {
4789 sharedPropertyDefinition.get = shouldCache
4790 ? createComputedGetter(key)
4791 : createGetterInvoker(userDef);
4792 sharedPropertyDefinition.set = noop;
4793 } else {
4794 sharedPropertyDefinition.get = userDef.get
4795 ? shouldCache && userDef.cache !== false
4796 ? createComputedGetter(key)
4797 : createGetterInvoker(userDef.get)
4798 : noop;
4799 sharedPropertyDefinition.set = userDef.set || noop;
4800 }
4801 if (sharedPropertyDefinition.set === noop) {
4802 sharedPropertyDefinition.set = function () {
4803 warn(
4804 ("Computed property \"" + key + "\" was assigned to but it has no setter."),
4805 this
4806 );
4807 };
4808 }
4809 Object.defineProperty(target, key, sharedPropertyDefinition);
4810 }
4811
4812 function createComputedGetter (key) {
4813 return function computedGetter () {
4814 var watcher = this._computedWatchers && this._computedWatchers[key];
4815 if (watcher) {
4816 if (watcher.dirty) {
4817 watcher.evaluate();
4818 }
4819 if (Dep.target) {
4820 watcher.depend();
4821 }
4822 return watcher.value
4823 }
4824 }
4825 }
4826
4827 function createGetterInvoker(fn) {
4828 return function computedGetter () {
4829 return fn.call(this, this)
4830 }
4831 }
4832
4833 function initMethods (vm, methods) {
4834 var props = vm.$options.props;
4835 for (var key in methods) {
4836 {
4837 if (typeof methods[key] !== 'function') {
4838 warn(
4839 "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
4840 "Did you reference the function correctly?",
4841 vm
4842 );
4843 }
4844 if (props && hasOwn(props, key)) {
4845 warn(
4846 ("Method \"" + key + "\" has already been defined as a prop."),
4847 vm
4848 );
4849 }
4850 if ((key in vm) && isReserved(key)) {
4851 warn(
4852 "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
4853 "Avoid defining component methods that start with _ or $."
4854 );
4855 }
4856 }
4857 vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
4858 }
4859 }
4860
4861 function initWatch (vm, watch) {
4862 for (var key in watch) {
4863 var handler = watch[key];
4864 if (Array.isArray(handler)) {
4865 for (var i = 0; i < handler.length; i++) {
4866 createWatcher(vm, key, handler[i]);
4867 }
4868 } else {
4869 createWatcher(vm, key, handler);
4870 }
4871 }
4872 }
4873
4874 function createWatcher (
4875 vm,
4876 expOrFn,
4877 handler,
4878 options
4879 ) {
4880 if (isPlainObject(handler)) {
4881 options = handler;
4882 handler = handler.handler;
4883 }
4884 if (typeof handler === 'string') {
4885 handler = vm[handler];
4886 }
4887 return vm.$watch(expOrFn, handler, options)
4888 }
4889
4890 function stateMixin (Vue) {
4891 // flow somehow has problems with directly declared definition object
4892 // when using Object.defineProperty, so we have to procedurally build up
4893 // the object here.
4894 var dataDef = {};
4895 dataDef.get = function () { return this._data };
4896 var propsDef = {};
4897 propsDef.get = function () { return this._props };
4898 {
4899 dataDef.set = function () {
4900 warn(
4901 'Avoid replacing instance root $data. ' +
4902 'Use nested data properties instead.',
4903 this
4904 );
4905 };
4906 propsDef.set = function () {
4907 warn("$props is readonly.", this);
4908 };
4909 }
4910 Object.defineProperty(Vue.prototype, '$data', dataDef);
4911 Object.defineProperty(Vue.prototype, '$props', propsDef);
4912
4913 Vue.prototype.$set = set;
4914 Vue.prototype.$delete = del;
4915
4916 Vue.prototype.$watch = function (
4917 expOrFn,
4918 cb,
4919 options
4920 ) {
4921 var vm = this;
4922 if (isPlainObject(cb)) {
4923 return createWatcher(vm, expOrFn, cb, options)
4924 }
4925 options = options || {};
4926 options.user = true;
4927 var watcher = new Watcher(vm, expOrFn, cb, options);
4928 if (options.immediate) {
4929 try {
4930 cb.call(vm, watcher.value);
4931 } catch (error) {
4932 handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
4933 }
4934 }
4935 return function unwatchFn () {
4936 watcher.teardown();
4937 }
4938 };
4939 }
4940
4941 /* */
4942
4943 var uid$3 = 0;
4944
4945 function initMixin (Vue) {
4946 Vue.prototype._init = function (options) {
4947 var vm = this;
4948 // a uid
4949 vm._uid = uid$3++;
4950
4951 var startTag, endTag;
4952 /* istanbul ignore if */
4953 if (config.performance && mark) {
4954 startTag = "vue-perf-start:" + (vm._uid);
4955 endTag = "vue-perf-end:" + (vm._uid);
4956 mark(startTag);
4957 }
4958
4959 // a flag to avoid this being observed
4960 vm._isVue = true;
4961 // merge options
4962 if (options && options._isComponent) {
4963 // optimize internal component instantiation
4964 // since dynamic options merging is pretty slow, and none of the
4965 // internal component options needs special treatment.
4966 initInternalComponent(vm, options);
4967 } else {
4968 vm.$options = mergeOptions(
4969 resolveConstructorOptions(vm.constructor),
4970 options || {},
4971 vm
4972 );
4973 }
4974 /* istanbul ignore else */
4975 {
4976 initProxy(vm);
4977 }
4978 // expose real self
4979 vm._self = vm;
4980 initLifecycle(vm);
4981 initEvents(vm);
4982 initRender(vm);
4983 callHook(vm, 'beforeCreate');
4984 initInjections(vm); // resolve injections before data/props
4985 initState(vm);
4986 initProvide(vm); // resolve provide after data/props
4987 callHook(vm, 'created');
4988
4989 /* istanbul ignore if */
4990 if (config.performance && mark) {
4991 vm._name = formatComponentName(vm, false);
4992 mark(endTag);
4993 measure(("vue " + (vm._name) + " init"), startTag, endTag);
4994 }
4995
4996 if (vm.$options.el) {
4997 vm.$mount(vm.$options.el);
4998 }
4999 };
5000 }
5001
5002 function initInternalComponent (vm, options) {
5003 var opts = vm.$options = Object.create(vm.constructor.options);
5004 // doing this because it's faster than dynamic enumeration.
5005 var parentVnode = options._parentVnode;
5006 opts.parent = options.parent;
5007 opts._parentVnode = parentVnode;
5008
5009 var vnodeComponentOptions = parentVnode.componentOptions;
5010 opts.propsData = vnodeComponentOptions.propsData;
5011 opts._parentListeners = vnodeComponentOptions.listeners;
5012 opts._renderChildren = vnodeComponentOptions.children;
5013 opts._componentTag = vnodeComponentOptions.tag;
5014
5015 if (options.render) {
5016 opts.render = options.render;
5017 opts.staticRenderFns = options.staticRenderFns;
5018 }
5019 }
5020
5021 function resolveConstructorOptions (Ctor) {
5022 var options = Ctor.options;
5023 if (Ctor.super) {
5024 var superOptions = resolveConstructorOptions(Ctor.super);
5025 var cachedSuperOptions = Ctor.superOptions;
5026 if (superOptions !== cachedSuperOptions) {
5027 // super option changed,
5028 // need to resolve new options.
5029 Ctor.superOptions = superOptions;
5030 // check if there are any late-modified/attached options (#4976)
5031 var modifiedOptions = resolveModifiedOptions(Ctor);
5032 // update base extend options
5033 if (modifiedOptions) {
5034 extend(Ctor.extendOptions, modifiedOptions);
5035 }
5036 options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
5037 if (options.name) {
5038 options.components[options.name] = Ctor;
5039 }
5040 }
5041 }
5042 return options
5043 }
5044
5045 function resolveModifiedOptions (Ctor) {
5046 var modified;
5047 var latest = Ctor.options;
5048 var sealed = Ctor.sealedOptions;
5049 for (var key in latest) {
5050 if (latest[key] !== sealed[key]) {
5051 if (!modified) { modified = {}; }
5052 modified[key] = latest[key];
5053 }
5054 }
5055 return modified
5056 }
5057
5058 function Vue (options) {
5059 if (!(this instanceof Vue)
5060 ) {
5061 warn('Vue is a constructor and should be called with the `new` keyword');
5062 }
5063 this._init(options);
5064 }
5065
5066 initMixin(Vue);
5067 stateMixin(Vue);
5068 eventsMixin(Vue);
5069 lifecycleMixin(Vue);
5070 renderMixin(Vue);
5071
5072 /* */
5073
5074 function initUse (Vue) {
5075 Vue.use = function (plugin) {
5076 var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
5077 if (installedPlugins.indexOf(plugin) > -1) {
5078 return this
5079 }
5080
5081 // additional parameters
5082 var args = toArray(arguments, 1);
5083 args.unshift(this);
5084 if (typeof plugin.install === 'function') {
5085 plugin.install.apply(plugin, args);
5086 } else if (typeof plugin === 'function') {
5087 plugin.apply(null, args);
5088 }
5089 installedPlugins.push(plugin);
5090 return this
5091 };
5092 }
5093
5094 /* */
5095
5096 function initMixin$1 (Vue) {
5097 Vue.mixin = function (mixin) {
5098 this.options = mergeOptions(this.options, mixin);
5099 return this
5100 };
5101 }
5102
5103 /* */
5104
5105 function initExtend (Vue) {
5106 /**
5107 * Each instance constructor, including Vue, has a unique
5108 * cid. This enables us to create wrapped "child
5109 * constructors" for prototypal inheritance and cache them.
5110 */
5111 Vue.cid = 0;
5112 var cid = 1;
5113
5114 /**
5115 * Class inheritance
5116 */
5117 Vue.extend = function (extendOptions) {
5118 extendOptions = extendOptions || {};
5119 var Super = this;
5120 var SuperId = Super.cid;
5121 var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
5122 if (cachedCtors[SuperId]) {
5123 return cachedCtors[SuperId]
5124 }
5125
5126 var name = extendOptions.name || Super.options.name;
5127 if (name) {
5128 validateComponentName(name);
5129 }
5130
5131 var Sub = function VueComponent (options) {
5132 this._init(options);
5133 };
5134 Sub.prototype = Object.create(Super.prototype);
5135 Sub.prototype.constructor = Sub;
5136 Sub.cid = cid++;
5137 Sub.options = mergeOptions(
5138 Super.options,
5139 extendOptions
5140 );
5141 Sub['super'] = Super;
5142
5143 // For props and computed properties, we define the proxy getters on
5144 // the Vue instances at extension time, on the extended prototype. This
5145 // avoids Object.defineProperty calls for each instance created.
5146 if (Sub.options.props) {
5147 initProps$1(Sub);
5148 }
5149 if (Sub.options.computed) {
5150 initComputed$1(Sub);
5151 }
5152
5153 // allow further extension/mixin/plugin usage
5154 Sub.extend = Super.extend;
5155 Sub.mixin = Super.mixin;
5156 Sub.use = Super.use;
5157
5158 // create asset registers, so extended classes
5159 // can have their private assets too.
5160 ASSET_TYPES.forEach(function (type) {
5161 Sub[type] = Super[type];
5162 });
5163 // enable recursive self-lookup
5164 if (name) {
5165 Sub.options.components[name] = Sub;
5166 }
5167
5168 // keep a reference to the super options at extension time.
5169 // later at instantiation we can check if Super's options have
5170 // been updated.
5171 Sub.superOptions = Super.options;
5172 Sub.extendOptions = extendOptions;
5173 Sub.sealedOptions = extend({}, Sub.options);
5174
5175 // cache constructor
5176 cachedCtors[SuperId] = Sub;
5177 return Sub
5178 };
5179 }
5180
5181 function initProps$1 (Comp) {
5182 var props = Comp.options.props;
5183 for (var key in props) {
5184 proxy(Comp.prototype, "_props", key);
5185 }
5186 }
5187
5188 function initComputed$1 (Comp) {
5189 var computed = Comp.options.computed;
5190 for (var key in computed) {
5191 defineComputed(Comp.prototype, key, computed[key]);
5192 }
5193 }
5194
5195 /* */
5196
5197 function initAssetRegisters (Vue) {
5198 /**
5199 * Create asset registration methods.
5200 */
5201 ASSET_TYPES.forEach(function (type) {
5202 Vue[type] = function (
5203 id,
5204 definition
5205 ) {
5206 if (!definition) {
5207 return this.options[type + 's'][id]
5208 } else {
5209 /* istanbul ignore if */
5210 if (type === 'component') {
5211 validateComponentName(id);
5212 }
5213 if (type === 'component' && isPlainObject(definition)) {
5214 definition.name = definition.name || id;
5215 definition = this.options._base.extend(definition);
5216 }
5217 if (type === 'directive' && typeof definition === 'function') {
5218 definition = { bind: definition, update: definition };
5219 }
5220 this.options[type + 's'][id] = definition;
5221 return definition
5222 }
5223 };
5224 });
5225 }
5226
5227 /* */
5228
5229
5230
5231 function getComponentName (opts) {
5232 return opts && (opts.Ctor.options.name || opts.tag)
5233 }
5234
5235 function matches (pattern, name) {
5236 if (Array.isArray(pattern)) {
5237 return pattern.indexOf(name) > -1
5238 } else if (typeof pattern === 'string') {
5239 return pattern.split(',').indexOf(name) > -1
5240 } else if (isRegExp(pattern)) {
5241 return pattern.test(name)
5242 }
5243 /* istanbul ignore next */
5244 return false
5245 }
5246
5247 function pruneCache (keepAliveInstance, filter) {
5248 var cache = keepAliveInstance.cache;
5249 var keys = keepAliveInstance.keys;
5250 var _vnode = keepAliveInstance._vnode;
5251 for (var key in cache) {
5252 var cachedNode = cache[key];
5253 if (cachedNode) {
5254 var name = getComponentName(cachedNode.componentOptions);
5255 if (name && !filter(name)) {
5256 pruneCacheEntry(cache, key, keys, _vnode);
5257 }
5258 }
5259 }
5260 }
5261
5262 function pruneCacheEntry (
5263 cache,
5264 key,
5265 keys,
5266 current
5267 ) {
5268 var cached$$1 = cache[key];
5269 if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
5270 cached$$1.componentInstance.$destroy();
5271 }
5272 cache[key] = null;
5273 remove(keys, key);
5274 }
5275
5276 var patternTypes = [String, RegExp, Array];
5277
5278 var KeepAlive = {
5279 name: 'keep-alive',
5280 abstract: true,
5281
5282 props: {
5283 include: patternTypes,
5284 exclude: patternTypes,
5285 max: [String, Number]
5286 },
5287
5288 created: function created () {
5289 this.cache = Object.create(null);
5290 this.keys = [];
5291 },
5292
5293 destroyed: function destroyed () {
5294 for (var key in this.cache) {
5295 pruneCacheEntry(this.cache, key, this.keys);
5296 }
5297 },
5298
5299 mounted: function mounted () {
5300 var this$1 = this;
5301
5302 this.$watch('include', function (val) {
5303 pruneCache(this$1, function (name) { return matches(val, name); });
5304 });
5305 this.$watch('exclude', function (val) {
5306 pruneCache(this$1, function (name) { return !matches(val, name); });
5307 });
5308 },
5309
5310 render: function render () {
5311 var slot = this.$slots.default;
5312 var vnode = getFirstComponentChild(slot);
5313 var componentOptions = vnode && vnode.componentOptions;
5314 if (componentOptions) {
5315 // check pattern
5316 var name = getComponentName(componentOptions);
5317 var ref = this;
5318 var include = ref.include;
5319 var exclude = ref.exclude;
5320 if (
5321 // not included
5322 (include && (!name || !matches(include, name))) ||
5323 // excluded
5324 (exclude && name && matches(exclude, name))
5325 ) {
5326 return vnode
5327 }
5328
5329 var ref$1 = this;
5330 var cache = ref$1.cache;
5331 var keys = ref$1.keys;
5332 var key = vnode.key == null
5333 // same constructor may get registered as different local components
5334 // so cid alone is not enough (#3269)
5335 ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
5336 : vnode.key;
5337 if (cache[key]) {
5338 vnode.componentInstance = cache[key].componentInstance;
5339 // make current key freshest
5340 remove(keys, key);
5341 keys.push(key);
5342 } else {
5343 cache[key] = vnode;
5344 keys.push(key);
5345 // prune oldest entry
5346 if (this.max && keys.length > parseInt(this.max)) {
5347 pruneCacheEntry(cache, keys[0], keys, this._vnode);
5348 }
5349 }
5350
5351 vnode.data.keepAlive = true;
5352 }
5353 return vnode || (slot && slot[0])
5354 }
5355 };
5356
5357 var builtInComponents = {
5358 KeepAlive: KeepAlive
5359 };
5360
5361 /* */
5362
5363 function initGlobalAPI (Vue) {
5364 // config
5365 var configDef = {};
5366 configDef.get = function () { return config; };
5367 {
5368 configDef.set = function () {
5369 warn(
5370 'Do not replace the Vue.config object, set individual fields instead.'
5371 );
5372 };
5373 }
5374 Object.defineProperty(Vue, 'config', configDef);
5375
5376 // exposed util methods.
5377 // NOTE: these are not considered part of the public API - avoid relying on
5378 // them unless you are aware of the risk.
5379 Vue.util = {
5380 warn: warn,
5381 extend: extend,
5382 mergeOptions: mergeOptions,
5383 defineReactive: defineReactive$$1
5384 };
5385
5386 Vue.set = set;
5387 Vue.delete = del;
5388 Vue.nextTick = nextTick;
5389
5390 // 2.6 explicit observable API
5391 Vue.observable = function (obj) {
5392 observe(obj);
5393 return obj
5394 };
5395
5396 Vue.options = Object.create(null);
5397 ASSET_TYPES.forEach(function (type) {
5398 Vue.options[type + 's'] = Object.create(null);
5399 });
5400
5401 // this is used to identify the "base" constructor to extend all plain-object
5402 // components with in Weex's multi-instance scenarios.
5403 Vue.options._base = Vue;
5404
5405 extend(Vue.options.components, builtInComponents);
5406
5407 initUse(Vue);
5408 initMixin$1(Vue);
5409 initExtend(Vue);
5410 initAssetRegisters(Vue);
5411 }
5412
5413 initGlobalAPI(Vue);
5414
5415 Object.defineProperty(Vue.prototype, '$isServer', {
5416 get: isServerRendering
5417 });
5418
5419 Object.defineProperty(Vue.prototype, '$ssrContext', {
5420 get: function get () {
5421 /* istanbul ignore next */
5422 return this.$vnode && this.$vnode.ssrContext
5423 }
5424 });
5425
5426 // expose FunctionalRenderContext for ssr runtime helper installation
5427 Object.defineProperty(Vue, 'FunctionalRenderContext', {
5428 value: FunctionalRenderContext
5429 });
5430
5431 Vue.version = '2.6.10';
5432
5433 /* */
5434
5435 // these are reserved for web because they are directly compiled away
5436 // during template compilation
5437 var isReservedAttr = makeMap('style,class');
5438
5439 // attributes that should be using props for binding
5440 var acceptValue = makeMap('input,textarea,option,select,progress');
5441 var mustUseProp = function (tag, type, attr) {
5442 return (
5443 (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
5444 (attr === 'selected' && tag === 'option') ||
5445 (attr === 'checked' && tag === 'input') ||
5446 (attr === 'muted' && tag === 'video')
5447 )
5448 };
5449
5450 var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
5451
5452 var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
5453
5454 var convertEnumeratedValue = function (key, value) {
5455 return isFalsyAttrValue(value) || value === 'false'
5456 ? 'false'
5457 // allow arbitrary string value for contenteditable
5458 : key === 'contenteditable' && isValidContentEditableValue(value)
5459 ? value
5460 : 'true'
5461 };
5462
5463 var isBooleanAttr = makeMap(
5464 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
5465 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
5466 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
5467 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
5468 'required,reversed,scoped,seamless,selected,sortable,translate,' +
5469 'truespeed,typemustmatch,visible'
5470 );
5471
5472 var xlinkNS = 'http://www.w3.org/1999/xlink';
5473
5474 var isXlink = function (name) {
5475 return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
5476 };
5477
5478 var getXlinkProp = function (name) {
5479 return isXlink(name) ? name.slice(6, name.length) : ''
5480 };
5481
5482 var isFalsyAttrValue = function (val) {
5483 return val == null || val === false
5484 };
5485
5486 /* */
5487
5488 function genClassForVnode (vnode) {
5489 var data = vnode.data;
5490 var parentNode = vnode;
5491 var childNode = vnode;
5492 while (isDef(childNode.componentInstance)) {
5493 childNode = childNode.componentInstance._vnode;
5494 if (childNode && childNode.data) {
5495 data = mergeClassData(childNode.data, data);
5496 }
5497 }
5498 while (isDef(parentNode = parentNode.parent)) {
5499 if (parentNode && parentNode.data) {
5500 data = mergeClassData(data, parentNode.data);
5501 }
5502 }
5503 return renderClass(data.staticClass, data.class)
5504 }
5505
5506 function mergeClassData (child, parent) {
5507 return {
5508 staticClass: concat(child.staticClass, parent.staticClass),
5509 class: isDef(child.class)
5510 ? [child.class, parent.class]
5511 : parent.class
5512 }
5513 }
5514
5515 function renderClass (
5516 staticClass,
5517 dynamicClass
5518 ) {
5519 if (isDef(staticClass) || isDef(dynamicClass)) {
5520 return concat(staticClass, stringifyClass(dynamicClass))
5521 }
5522 /* istanbul ignore next */
5523 return ''
5524 }
5525
5526 function concat (a, b) {
5527 return a ? b ? (a + ' ' + b) : a : (b || '')
5528 }
5529
5530 function stringifyClass (value) {
5531 if (Array.isArray(value)) {
5532 return stringifyArray(value)
5533 }
5534 if (isObject(value)) {
5535 return stringifyObject(value)
5536 }
5537 if (typeof value === 'string') {
5538 return value
5539 }
5540 /* istanbul ignore next */
5541 return ''
5542 }
5543
5544 function stringifyArray (value) {
5545 var res = '';
5546 var stringified;
5547 for (var i = 0, l = value.length; i < l; i++) {
5548 if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
5549 if (res) { res += ' '; }
5550 res += stringified;
5551 }
5552 }
5553 return res
5554 }
5555
5556 function stringifyObject (value) {
5557 var res = '';
5558 for (var key in value) {
5559 if (value[key]) {
5560 if (res) { res += ' '; }
5561 res += key;
5562 }
5563 }
5564 return res
5565 }
5566
5567 /* */
5568
5569 var namespaceMap = {
5570 svg: 'http://www.w3.org/2000/svg',
5571 math: 'http://www.w3.org/1998/Math/MathML'
5572 };
5573
5574 var isHTMLTag = makeMap(
5575 'html,body,base,head,link,meta,style,title,' +
5576 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
5577 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
5578 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
5579 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
5580 'embed,object,param,source,canvas,script,noscript,del,ins,' +
5581 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
5582 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
5583 'output,progress,select,textarea,' +
5584 'details,dialog,menu,menuitem,summary,' +
5585 'content,element,shadow,template,blockquote,iframe,tfoot'
5586 );
5587
5588 // this map is intentionally selective, only covering SVG elements that may
5589 // contain child elements.
5590 var isSVG = makeMap(
5591 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
5592 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
5593 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
5594 true
5595 );
5596
5597 var isReservedTag = function (tag) {
5598 return isHTMLTag(tag) || isSVG(tag)
5599 };
5600
5601 function getTagNamespace (tag) {
5602 if (isSVG(tag)) {
5603 return 'svg'
5604 }
5605 // basic support for MathML
5606 // note it doesn't support other MathML elements being component roots
5607 if (tag === 'math') {
5608 return 'math'
5609 }
5610 }
5611
5612 var unknownElementCache = Object.create(null);
5613 function isUnknownElement (tag) {
5614 /* istanbul ignore if */
5615 if (!inBrowser) {
5616 return true
5617 }
5618 if (isReservedTag(tag)) {
5619 return false
5620 }
5621 tag = tag.toLowerCase();
5622 /* istanbul ignore if */
5623 if (unknownElementCache[tag] != null) {
5624 return unknownElementCache[tag]
5625 }
5626 var el = document.createElement(tag);
5627 if (tag.indexOf('-') > -1) {
5628 // http://stackoverflow.com/a/28210364/1070244
5629 return (unknownElementCache[tag] = (
5630 el.constructor === window.HTMLUnknownElement ||
5631 el.constructor === window.HTMLElement
5632 ))
5633 } else {
5634 return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
5635 }
5636 }
5637
5638 var isTextInputType = makeMap('text,number,password,search,email,tel,url');
5639
5640 /* */
5641
5642 /**
5643 * Query an element selector if it's not an element already.
5644 */
5645 function query (el) {
5646 if (typeof el === 'string') {
5647 var selected = document.querySelector(el);
5648 if (!selected) {
5649 warn(
5650 'Cannot find element: ' + el
5651 );
5652 return document.createElement('div')
5653 }
5654 return selected
5655 } else {
5656 return el
5657 }
5658 }
5659
5660 /* */
5661
5662 function createElement$1 (tagName, vnode) {
5663 var elm = document.createElement(tagName);
5664 if (tagName !== 'select') {
5665 return elm
5666 }
5667 // false or null will remove the attribute but undefined will not
5668 if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
5669 elm.setAttribute('multiple', 'multiple');
5670 }
5671 return elm
5672 }
5673
5674 function createElementNS (namespace, tagName) {
5675 return document.createElementNS(namespaceMap[namespace], tagName)
5676 }
5677
5678 function createTextNode (text) {
5679 return document.createTextNode(text)
5680 }
5681
5682 function createComment (text) {
5683 return document.createComment(text)
5684 }
5685
5686 function insertBefore (parentNode, newNode, referenceNode) {
5687 parentNode.insertBefore(newNode, referenceNode);
5688 }
5689
5690 function removeChild (node, child) {
5691 node.removeChild(child);
5692 }
5693
5694 function appendChild (node, child) {
5695 node.appendChild(child);
5696 }
5697
5698 function parentNode (node) {
5699 return node.parentNode
5700 }
5701
5702 function nextSibling (node) {
5703 return node.nextSibling
5704 }
5705
5706 function tagName (node) {
5707 return node.tagName
5708 }
5709
5710 function setTextContent (node, text) {
5711 node.textContent = text;
5712 }
5713
5714 function setStyleScope (node, scopeId) {
5715 node.setAttribute(scopeId, '');
5716 }
5717
5718 var nodeOps = /*#__PURE__*/Object.freeze({
5719 createElement: createElement$1,
5720 createElementNS: createElementNS,
5721 createTextNode: createTextNode,
5722 createComment: createComment,
5723 insertBefore: insertBefore,
5724 removeChild: removeChild,
5725 appendChild: appendChild,
5726 parentNode: parentNode,
5727 nextSibling: nextSibling,
5728 tagName: tagName,
5729 setTextContent: setTextContent,
5730 setStyleScope: setStyleScope
5731 });
5732
5733 /* */
5734
5735 var ref = {
5736 create: function create (_, vnode) {
5737 registerRef(vnode);
5738 },
5739 update: function update (oldVnode, vnode) {
5740 if (oldVnode.data.ref !== vnode.data.ref) {
5741 registerRef(oldVnode, true);
5742 registerRef(vnode);
5743 }
5744 },
5745 destroy: function destroy (vnode) {
5746 registerRef(vnode, true);
5747 }
5748 };
5749
5750 function registerRef (vnode, isRemoval) {
5751 var key = vnode.data.ref;
5752 if (!isDef(key)) { return }
5753
5754 var vm = vnode.context;
5755 var ref = vnode.componentInstance || vnode.elm;
5756 var refs = vm.$refs;
5757 if (isRemoval) {
5758 if (Array.isArray(refs[key])) {
5759 remove(refs[key], ref);
5760 } else if (refs[key] === ref) {
5761 refs[key] = undefined;
5762 }
5763 } else {
5764 if (vnode.data.refInFor) {
5765 if (!Array.isArray(refs[key])) {
5766 refs[key] = [ref];
5767 } else if (refs[key].indexOf(ref) < 0) {
5768 // $flow-disable-line
5769 refs[key].push(ref);
5770 }
5771 } else {
5772 refs[key] = ref;
5773 }
5774 }
5775 }
5776
5777 /**
5778 * Virtual DOM patching algorithm based on Snabbdom by
5779 * Simon Friis Vindum (@paldepind)
5780 * Licensed under the MIT License
5781 * https://github.com/paldepind/snabbdom/blob/master/LICENSE
5782 *
5783 * modified by Evan You (@yyx990803)
5784 *
5785 * Not type-checking this because this file is perf-critical and the cost
5786 * of making flow understand it is not worth it.
5787 */
5788
5789 var emptyNode = new VNode('', {}, []);
5790
5791 var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
5792
5793 function sameVnode (a, b) {
5794 return (
5795 a.key === b.key && (
5796 (
5797 a.tag === b.tag &&
5798 a.isComment === b.isComment &&
5799 isDef(a.data) === isDef(b.data) &&
5800 sameInputType(a, b)
5801 ) || (
5802 isTrue(a.isAsyncPlaceholder) &&
5803 a.asyncFactory === b.asyncFactory &&
5804 isUndef(b.asyncFactory.error)
5805 )
5806 )
5807 )
5808 }
5809
5810 function sameInputType (a, b) {
5811 if (a.tag !== 'input') { return true }
5812 var i;
5813 var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
5814 var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
5815 return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)
5816 }
5817
5818 function createKeyToOldIdx (children, beginIdx, endIdx) {
5819 var i, key;
5820 var map = {};
5821 for (i = beginIdx; i <= endIdx; ++i) {
5822 key = children[i].key;
5823 if (isDef(key)) { map[key] = i; }
5824 }
5825 return map
5826 }
5827
5828 function createPatchFunction (backend) {
5829 var i, j;
5830 var cbs = {};
5831
5832 var modules = backend.modules;
5833 var nodeOps = backend.nodeOps;
5834
5835 for (i = 0; i < hooks.length; ++i) {
5836 cbs[hooks[i]] = [];
5837 for (j = 0; j < modules.length; ++j) {
5838 if (isDef(modules[j][hooks[i]])) {
5839 cbs[hooks[i]].push(modules[j][hooks[i]]);
5840 }
5841 }
5842 }
5843
5844 function emptyNodeAt (elm) {
5845 return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
5846 }
5847
5848 function createRmCb (childElm, listeners) {
5849 function remove$$1 () {
5850 if (--remove$$1.listeners === 0) {
5851 removeNode(childElm);
5852 }
5853 }
5854 remove$$1.listeners = listeners;
5855 return remove$$1
5856 }
5857
5858 function removeNode (el) {
5859 var parent = nodeOps.parentNode(el);
5860 // element may have already been removed due to v-html / v-text
5861 if (isDef(parent)) {
5862 nodeOps.removeChild(parent, el);
5863 }
5864 }
5865
5866 function isUnknownElement$$1 (vnode, inVPre) {
5867 return (
5868 !inVPre &&
5869 !vnode.ns &&
5870 !(
5871 config.ignoredElements.length &&
5872 config.ignoredElements.some(function (ignore) {
5873 return isRegExp(ignore)
5874 ? ignore.test(vnode.tag)
5875 : ignore === vnode.tag
5876 })
5877 ) &&
5878 config.isUnknownElement(vnode.tag)
5879 )
5880 }
5881
5882 var creatingElmInVPre = 0;
5883
5884 function createElm (
5885 vnode,
5886 insertedVnodeQueue,
5887 parentElm,
5888 refElm,
5889 nested,
5890 ownerArray,
5891 index
5892 ) {
5893 if (isDef(vnode.elm) && isDef(ownerArray)) {
5894 // This vnode was used in a previous render!
5895 // now it's used as a new node, overwriting its elm would cause
5896 // potential patch errors down the road when it's used as an insertion
5897 // reference node. Instead, we clone the node on-demand before creating
5898 // associated DOM element for it.
5899 vnode = ownerArray[index] = cloneVNode(vnode);
5900 }
5901
5902 vnode.isRootInsert = !nested; // for transition enter check
5903 if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
5904 return
5905 }
5906
5907 var data = vnode.data;
5908 var children = vnode.children;
5909 var tag = vnode.tag;
5910 if (isDef(tag)) {
5911 {
5912 if (data && data.pre) {
5913 creatingElmInVPre++;
5914 }
5915 if (isUnknownElement$$1(vnode, creatingElmInVPre)) {
5916 warn(
5917 'Unknown custom element: <' + tag + '> - did you ' +
5918 'register the component correctly? For recursive components, ' +
5919 'make sure to provide the "name" option.',
5920 vnode.context
5921 );
5922 }
5923 }
5924
5925 vnode.elm = vnode.ns
5926 ? nodeOps.createElementNS(vnode.ns, tag)
5927 : nodeOps.createElement(tag, vnode);
5928 setScope(vnode);
5929
5930 /* istanbul ignore if */
5931 {
5932 createChildren(vnode, children, insertedVnodeQueue);
5933 if (isDef(data)) {
5934 invokeCreateHooks(vnode, insertedVnodeQueue);
5935 }
5936 insert(parentElm, vnode.elm, refElm);
5937 }
5938
5939 if (data && data.pre) {
5940 creatingElmInVPre--;
5941 }
5942 } else if (isTrue(vnode.isComment)) {
5943 vnode.elm = nodeOps.createComment(vnode.text);
5944 insert(parentElm, vnode.elm, refElm);
5945 } else {
5946 vnode.elm = nodeOps.createTextNode(vnode.text);
5947 insert(parentElm, vnode.elm, refElm);
5948 }
5949 }
5950
5951 function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
5952 var i = vnode.data;
5953 if (isDef(i)) {
5954 var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
5955 if (isDef(i = i.hook) && isDef(i = i.init)) {
5956 i(vnode, false /* hydrating */);
5957 }
5958 // after calling the init hook, if the vnode is a child component
5959 // it should've created a child instance and mounted it. the child
5960 // component also has set the placeholder vnode's elm.
5961 // in that case we can just return the element and be done.
5962 if (isDef(vnode.componentInstance)) {
5963 initComponent(vnode, insertedVnodeQueue);
5964 insert(parentElm, vnode.elm, refElm);
5965 if (isTrue(isReactivated)) {
5966 reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
5967 }
5968 return true
5969 }
5970 }
5971 }
5972
5973 function initComponent (vnode, insertedVnodeQueue) {
5974 if (isDef(vnode.data.pendingInsert)) {
5975 insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
5976 vnode.data.pendingInsert = null;
5977 }
5978 vnode.elm = vnode.componentInstance.$el;
5979 if (isPatchable(vnode)) {
5980 invokeCreateHooks(vnode, insertedVnodeQueue);
5981 setScope(vnode);
5982 } else {
5983 // empty component root.
5984 // skip all element-related modules except for ref (#3455)
5985 registerRef(vnode);
5986 // make sure to invoke the insert hook
5987 insertedVnodeQueue.push(vnode);
5988 }
5989 }
5990
5991 function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
5992 var i;
5993 // hack for #4339: a reactivated component with inner transition
5994 // does not trigger because the inner node's created hooks are not called
5995 // again. It's not ideal to involve module-specific logic in here but
5996 // there doesn't seem to be a better way to do it.
5997 var innerNode = vnode;
5998 while (innerNode.componentInstance) {
5999 innerNode = innerNode.componentInstance._vnode;
6000 if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
6001 for (i = 0; i < cbs.activate.length; ++i) {
6002 cbs.activate[i](emptyNode, innerNode);
6003 }
6004 insertedVnodeQueue.push(innerNode);
6005 break
6006 }
6007 }
6008 // unlike a newly created component,
6009 // a reactivated keep-alive component doesn't insert itself
6010 insert(parentElm, vnode.elm, refElm);
6011 }
6012
6013 function insert (parent, elm, ref$$1) {
6014 if (isDef(parent)) {
6015 if (isDef(ref$$1)) {
6016 if (nodeOps.parentNode(ref$$1) === parent) {
6017 nodeOps.insertBefore(parent, elm, ref$$1);
6018 }
6019 } else {
6020 nodeOps.appendChild(parent, elm);
6021 }
6022 }
6023 }
6024
6025 function createChildren (vnode, children, insertedVnodeQueue) {
6026 if (Array.isArray(children)) {
6027 {
6028 checkDuplicateKeys(children);
6029 }
6030 for (var i = 0; i < children.length; ++i) {
6031 createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);
6032 }
6033 } else if (isPrimitive(vnode.text)) {
6034 nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
6035 }
6036 }
6037
6038 function isPatchable (vnode) {
6039 while (vnode.componentInstance) {
6040 vnode = vnode.componentInstance._vnode;
6041 }
6042 return isDef(vnode.tag)
6043 }
6044
6045 function invokeCreateHooks (vnode, insertedVnodeQueue) {
6046 for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
6047 cbs.create[i$1](emptyNode, vnode);
6048 }
6049 i = vnode.data.hook; // Reuse variable
6050 if (isDef(i)) {
6051 if (isDef(i.create)) { i.create(emptyNode, vnode); }
6052 if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
6053 }
6054 }
6055
6056 // set scope id attribute for scoped CSS.
6057 // this is implemented as a special case to avoid the overhead
6058 // of going through the normal attribute patching process.
6059 function setScope (vnode) {
6060 var i;
6061 if (isDef(i = vnode.fnScopeId)) {
6062 nodeOps.setStyleScope(vnode.elm, i);
6063 } else {
6064 var ancestor = vnode;
6065 while (ancestor) {
6066 if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
6067 nodeOps.setStyleScope(vnode.elm, i);
6068 }
6069 ancestor = ancestor.parent;
6070 }
6071 }
6072 // for slot content they should also get the scopeId from the host instance.
6073 if (isDef(i = activeInstance) &&
6074 i !== vnode.context &&
6075 i !== vnode.fnContext &&
6076 isDef(i = i.$options._scopeId)
6077 ) {
6078 nodeOps.setStyleScope(vnode.elm, i);
6079 }
6080 }
6081
6082 function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
6083 for (; startIdx <= endIdx; ++startIdx) {
6084 createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
6085 }
6086 }
6087
6088 function invokeDestroyHook (vnode) {
6089 var i, j;
6090 var data = vnode.data;
6091 if (isDef(data)) {
6092 if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
6093 for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
6094 }
6095 if (isDef(i = vnode.children)) {
6096 for (j = 0; j < vnode.children.length; ++j) {
6097 invokeDestroyHook(vnode.children[j]);
6098 }
6099 }
6100 }
6101
6102 function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
6103 for (; startIdx <= endIdx; ++startIdx) {
6104 var ch = vnodes[startIdx];
6105 if (isDef(ch)) {
6106 if (isDef(ch.tag)) {
6107 removeAndInvokeRemoveHook(ch);
6108 invokeDestroyHook(ch);
6109 } else { // Text node
6110 removeNode(ch.elm);
6111 }
6112 }
6113 }
6114 }
6115
6116 function removeAndInvokeRemoveHook (vnode, rm) {
6117 if (isDef(rm) || isDef(vnode.data)) {
6118 var i;
6119 var listeners = cbs.remove.length + 1;
6120 if (isDef(rm)) {
6121 // we have a recursively passed down rm callback
6122 // increase the listeners count
6123 rm.listeners += listeners;
6124 } else {
6125 // directly removing
6126 rm = createRmCb(vnode.elm, listeners);
6127 }
6128 // recursively invoke hooks on child component root node
6129 if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
6130 removeAndInvokeRemoveHook(i, rm);
6131 }
6132 for (i = 0; i < cbs.remove.length; ++i) {
6133 cbs.remove[i](vnode, rm);
6134 }
6135 if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
6136 i(vnode, rm);
6137 } else {
6138 rm();
6139 }
6140 } else {
6141 removeNode(vnode.elm);
6142 }
6143 }
6144
6145 function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
6146 var oldStartIdx = 0;
6147 var newStartIdx = 0;
6148 var oldEndIdx = oldCh.length - 1;
6149 var oldStartVnode = oldCh[0];
6150 var oldEndVnode = oldCh[oldEndIdx];
6151 var newEndIdx = newCh.length - 1;
6152 var newStartVnode = newCh[0];
6153 var newEndVnode = newCh[newEndIdx];
6154 var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
6155
6156 // removeOnly is a special flag used only by <transition-group>
6157 // to ensure removed elements stay in correct relative positions
6158 // during leaving transitions
6159 var canMove = !removeOnly;
6160
6161 {
6162 checkDuplicateKeys(newCh);
6163 }
6164
6165 while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
6166 if (isUndef(oldStartVnode)) {
6167 oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
6168 } else if (isUndef(oldEndVnode)) {
6169 oldEndVnode = oldCh[--oldEndIdx];
6170 } else if (sameVnode(oldStartVnode, newStartVnode)) {
6171 patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
6172 oldStartVnode = oldCh[++oldStartIdx];
6173 newStartVnode = newCh[++newStartIdx];
6174 } else if (sameVnode(oldEndVnode, newEndVnode)) {
6175 patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
6176 oldEndVnode = oldCh[--oldEndIdx];
6177 newEndVnode = newCh[--newEndIdx];
6178 } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
6179 patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
6180 canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
6181 oldStartVnode = oldCh[++oldStartIdx];
6182 newEndVnode = newCh[--newEndIdx];
6183 } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
6184 patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
6185 canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
6186 oldEndVnode = oldCh[--oldEndIdx];
6187 newStartVnode = newCh[++newStartIdx];
6188 } else {
6189 if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
6190 idxInOld = isDef(newStartVnode.key)
6191 ? oldKeyToIdx[newStartVnode.key]
6192 : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
6193 if (isUndef(idxInOld)) { // New element
6194 createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
6195 } else {
6196 vnodeToMove = oldCh[idxInOld];
6197 if (sameVnode(vnodeToMove, newStartVnode)) {
6198 patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
6199 oldCh[idxInOld] = undefined;
6200 canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
6201 } else {
6202 // same key but different element. treat as new element
6203 createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
6204 }
6205 }
6206 newStartVnode = newCh[++newStartIdx];
6207 }
6208 }
6209 if (oldStartIdx > oldEndIdx) {
6210 refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
6211 addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
6212 } else if (newStartIdx > newEndIdx) {
6213 removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
6214 }
6215 }
6216
6217 function checkDuplicateKeys (children) {
6218 var seenKeys = {};
6219 for (var i = 0; i < children.length; i++) {
6220 var vnode = children[i];
6221 var key = vnode.key;
6222 if (isDef(key)) {
6223 if (seenKeys[key]) {
6224 warn(
6225 ("Duplicate keys detected: '" + key + "'. This may cause an update error."),
6226 vnode.context
6227 );
6228 } else {
6229 seenKeys[key] = true;
6230 }
6231 }
6232 }
6233 }
6234
6235 function findIdxInOld (node, oldCh, start, end) {
6236 for (var i = start; i < end; i++) {
6237 var c = oldCh[i];
6238 if (isDef(c) && sameVnode(node, c)) { return i }
6239 }
6240 }
6241
6242 function patchVnode (
6243 oldVnode,
6244 vnode,
6245 insertedVnodeQueue,
6246 ownerArray,
6247 index,
6248 removeOnly
6249 ) {
6250 if (oldVnode === vnode) {
6251 return
6252 }
6253
6254 if (isDef(vnode.elm) && isDef(ownerArray)) {
6255 // clone reused vnode
6256 vnode = ownerArray[index] = cloneVNode(vnode);
6257 }
6258
6259 var elm = vnode.elm = oldVnode.elm;
6260
6261 if (isTrue(oldVnode.isAsyncPlaceholder)) {
6262 if (isDef(vnode.asyncFactory.resolved)) {
6263 hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
6264 } else {
6265 vnode.isAsyncPlaceholder = true;
6266 }
6267 return
6268 }
6269
6270 // reuse element for static trees.
6271 // note we only do this if the vnode is cloned -
6272 // if the new node is not cloned it means the render functions have been
6273 // reset by the hot-reload-api and we need to do a proper re-render.
6274 if (isTrue(vnode.isStatic) &&
6275 isTrue(oldVnode.isStatic) &&
6276 vnode.key === oldVnode.key &&
6277 (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
6278 ) {
6279 vnode.componentInstance = oldVnode.componentInstance;
6280 return
6281 }
6282
6283 var i;
6284 var data = vnode.data;
6285 if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
6286 i(oldVnode, vnode);
6287 }
6288
6289 var oldCh = oldVnode.children;
6290 var ch = vnode.children;
6291 if (isDef(data) && isPatchable(vnode)) {
6292 for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
6293 if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
6294 }
6295 if (isUndef(vnode.text)) {
6296 if (isDef(oldCh) && isDef(ch)) {
6297 if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
6298 } else if (isDef(ch)) {
6299 {
6300 checkDuplicateKeys(ch);
6301 }
6302 if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
6303 addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
6304 } else if (isDef(oldCh)) {
6305 removeVnodes(elm, oldCh, 0, oldCh.length - 1);
6306 } else if (isDef(oldVnode.text)) {
6307 nodeOps.setTextContent(elm, '');
6308 }
6309 } else if (oldVnode.text !== vnode.text) {
6310 nodeOps.setTextContent(elm, vnode.text);
6311 }
6312 if (isDef(data)) {
6313 if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
6314 }
6315 }
6316
6317 function invokeInsertHook (vnode, queue, initial) {
6318 // delay insert hooks for component root nodes, invoke them after the
6319 // element is really inserted
6320 if (isTrue(initial) && isDef(vnode.parent)) {
6321 vnode.parent.data.pendingInsert = queue;
6322 } else {
6323 for (var i = 0; i < queue.length; ++i) {
6324 queue[i].data.hook.insert(queue[i]);
6325 }
6326 }
6327 }
6328
6329 var hydrationBailed = false;
6330 // list of modules that can skip create hook during hydration because they
6331 // are already rendered on the client or has no need for initialization
6332 // Note: style is excluded because it relies on initial clone for future
6333 // deep updates (#7063).
6334 var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
6335
6336 // Note: this is a browser-only function so we can assume elms are DOM nodes.
6337 function hydrate (elm, vnode, insertedVnodeQueue, inVPre) {
6338 var i;
6339 var tag = vnode.tag;
6340 var data = vnode.data;
6341 var children = vnode.children;
6342 inVPre = inVPre || (data && data.pre);
6343 vnode.elm = elm;
6344
6345 if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
6346 vnode.isAsyncPlaceholder = true;
6347 return true
6348 }
6349 // assert node match
6350 {
6351 if (!assertNodeMatch(elm, vnode, inVPre)) {
6352 return false
6353 }
6354 }
6355 if (isDef(data)) {
6356 if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
6357 if (isDef(i = vnode.componentInstance)) {
6358 // child component. it should have hydrated its own tree.
6359 initComponent(vnode, insertedVnodeQueue);
6360 return true
6361 }
6362 }
6363 if (isDef(tag)) {
6364 if (isDef(children)) {
6365 // empty element, allow client to pick up and populate children
6366 if (!elm.hasChildNodes()) {
6367 createChildren(vnode, children, insertedVnodeQueue);
6368 } else {
6369 // v-html and domProps: innerHTML
6370 if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
6371 if (i !== elm.innerHTML) {
6372 /* istanbul ignore if */
6373 if (typeof console !== 'undefined' &&
6374 !hydrationBailed
6375 ) {
6376 hydrationBailed = true;
6377 console.warn('Parent: ', elm);
6378 console.warn('server innerHTML: ', i);
6379 console.warn('client innerHTML: ', elm.innerHTML);
6380 }
6381 return false
6382 }
6383 } else {
6384 // iterate and compare children lists
6385 var childrenMatch = true;
6386 var childNode = elm.firstChild;
6387 for (var i$1 = 0; i$1 < children.length; i$1++) {
6388 if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {
6389 childrenMatch = false;
6390 break
6391 }
6392 childNode = childNode.nextSibling;
6393 }
6394 // if childNode is not null, it means the actual childNodes list is
6395 // longer than the virtual children list.
6396 if (!childrenMatch || childNode) {
6397 /* istanbul ignore if */
6398 if (typeof console !== 'undefined' &&
6399 !hydrationBailed
6400 ) {
6401 hydrationBailed = true;
6402 console.warn('Parent: ', elm);
6403 console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
6404 }
6405 return false
6406 }
6407 }
6408 }
6409 }
6410 if (isDef(data)) {
6411 var fullInvoke = false;
6412 for (var key in data) {
6413 if (!isRenderedModule(key)) {
6414 fullInvoke = true;
6415 invokeCreateHooks(vnode, insertedVnodeQueue);
6416 break
6417 }
6418 }
6419 if (!fullInvoke && data['class']) {
6420 // ensure collecting deps for deep class bindings for future updates
6421 traverse(data['class']);
6422 }
6423 }
6424 } else if (elm.data !== vnode.text) {
6425 elm.data = vnode.text;
6426 }
6427 return true
6428 }
6429
6430 function assertNodeMatch (node, vnode, inVPre) {
6431 if (isDef(vnode.tag)) {
6432 return vnode.tag.indexOf('vue-component') === 0 || (
6433 !isUnknownElement$$1(vnode, inVPre) &&
6434 vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
6435 )
6436 } else {
6437 return node.nodeType === (vnode.isComment ? 8 : 3)
6438 }
6439 }
6440
6441 return function patch (oldVnode, vnode, hydrating, removeOnly) {
6442 if (isUndef(vnode)) {
6443 if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }
6444 return
6445 }
6446
6447 var isInitialPatch = false;
6448 var insertedVnodeQueue = [];
6449
6450 if (isUndef(oldVnode)) {
6451 // empty mount (likely as component), create new root element
6452 isInitialPatch = true;
6453 createElm(vnode, insertedVnodeQueue);
6454 } else {
6455 var isRealElement = isDef(oldVnode.nodeType);
6456 if (!isRealElement && sameVnode(oldVnode, vnode)) {
6457 // patch existing root node
6458 patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
6459 } else {
6460 if (isRealElement) {
6461 // mounting to a real element
6462 // check if this is server-rendered content and if we can perform
6463 // a successful hydration.
6464 if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
6465 oldVnode.removeAttribute(SSR_ATTR);
6466 hydrating = true;
6467 }
6468 if (isTrue(hydrating)) {
6469 if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
6470 invokeInsertHook(vnode, insertedVnodeQueue, true);
6471 return oldVnode
6472 } else {
6473 warn(
6474 'The client-side rendered virtual DOM tree is not matching ' +
6475 'server-rendered content. This is likely caused by incorrect ' +
6476 'HTML markup, for example nesting block-level elements inside ' +
6477 '<p>, or missing <tbody>. Bailing hydration and performing ' +
6478 'full client-side render.'
6479 );
6480 }
6481 }
6482 // either not server-rendered, or hydration failed.
6483 // create an empty node and replace it
6484 oldVnode = emptyNodeAt(oldVnode);
6485 }
6486
6487 // replacing existing element
6488 var oldElm = oldVnode.elm;
6489 var parentElm = nodeOps.parentNode(oldElm);
6490
6491 // create new node
6492 createElm(
6493 vnode,
6494 insertedVnodeQueue,
6495 // extremely rare edge case: do not insert if old element is in a
6496 // leaving transition. Only happens when combining transition +
6497 // keep-alive + HOCs. (#4590)
6498 oldElm._leaveCb ? null : parentElm,
6499 nodeOps.nextSibling(oldElm)
6500 );
6501
6502 // update parent placeholder node element, recursively
6503 if (isDef(vnode.parent)) {
6504 var ancestor = vnode.parent;
6505 var patchable = isPatchable(vnode);
6506 while (ancestor) {
6507 for (var i = 0; i < cbs.destroy.length; ++i) {
6508 cbs.destroy[i](ancestor);
6509 }
6510 ancestor.elm = vnode.elm;
6511 if (patchable) {
6512 for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
6513 cbs.create[i$1](emptyNode, ancestor);
6514 }
6515 // #6513
6516 // invoke insert hooks that may have been merged by create hooks.
6517 // e.g. for directives that uses the "inserted" hook.
6518 var insert = ancestor.data.hook.insert;
6519 if (insert.merged) {
6520 // start at index 1 to avoid re-invoking component mounted hook
6521 for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {
6522 insert.fns[i$2]();
6523 }
6524 }
6525 } else {
6526 registerRef(ancestor);
6527 }
6528 ancestor = ancestor.parent;
6529 }
6530 }
6531
6532 // destroy old node
6533 if (isDef(parentElm)) {
6534 removeVnodes(parentElm, [oldVnode], 0, 0);
6535 } else if (isDef(oldVnode.tag)) {
6536 invokeDestroyHook(oldVnode);
6537 }
6538 }
6539 }
6540
6541 invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
6542 return vnode.elm
6543 }
6544 }
6545
6546 /* */
6547
6548 var directives = {
6549 create: updateDirectives,
6550 update: updateDirectives,
6551 destroy: function unbindDirectives (vnode) {
6552 updateDirectives(vnode, emptyNode);
6553 }
6554 };
6555
6556 function updateDirectives (oldVnode, vnode) {
6557 if (oldVnode.data.directives || vnode.data.directives) {
6558 _update(oldVnode, vnode);
6559 }
6560 }
6561
6562 function _update (oldVnode, vnode) {
6563 var isCreate = oldVnode === emptyNode;
6564 var isDestroy = vnode === emptyNode;
6565 var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
6566 var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
6567
6568 var dirsWithInsert = [];
6569 var dirsWithPostpatch = [];
6570
6571 var key, oldDir, dir;
6572 for (key in newDirs) {
6573 oldDir = oldDirs[key];
6574 dir = newDirs[key];
6575 if (!oldDir) {
6576 // new directive, bind
6577 callHook$1(dir, 'bind', vnode, oldVnode);
6578 if (dir.def && dir.def.inserted) {
6579 dirsWithInsert.push(dir);
6580 }
6581 } else {
6582 // existing directive, update
6583 dir.oldValue = oldDir.value;
6584 dir.oldArg = oldDir.arg;
6585 callHook$1(dir, 'update', vnode, oldVnode);
6586 if (dir.def && dir.def.componentUpdated) {
6587 dirsWithPostpatch.push(dir);
6588 }
6589 }
6590 }
6591
6592 if (dirsWithInsert.length) {
6593 var callInsert = function () {
6594 for (var i = 0; i < dirsWithInsert.length; i++) {
6595 callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
6596 }
6597 };
6598 if (isCreate) {
6599 mergeVNodeHook(vnode, 'insert', callInsert);
6600 } else {
6601 callInsert();
6602 }
6603 }
6604
6605 if (dirsWithPostpatch.length) {
6606 mergeVNodeHook(vnode, 'postpatch', function () {
6607 for (var i = 0; i < dirsWithPostpatch.length; i++) {
6608 callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
6609 }
6610 });
6611 }
6612
6613 if (!isCreate) {
6614 for (key in oldDirs) {
6615 if (!newDirs[key]) {
6616 // no longer present, unbind
6617 callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
6618 }
6619 }
6620 }
6621 }
6622
6623 var emptyModifiers = Object.create(null);
6624
6625 function normalizeDirectives$1 (
6626 dirs,
6627 vm
6628 ) {
6629 var res = Object.create(null);
6630 if (!dirs) {
6631 // $flow-disable-line
6632 return res
6633 }
6634 var i, dir;
6635 for (i = 0; i < dirs.length; i++) {
6636 dir = dirs[i];
6637 if (!dir.modifiers) {
6638 // $flow-disable-line
6639 dir.modifiers = emptyModifiers;
6640 }
6641 res[getRawDirName(dir)] = dir;
6642 dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
6643 }
6644 // $flow-disable-line
6645 return res
6646 }
6647
6648 function getRawDirName (dir) {
6649 return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
6650 }
6651
6652 function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
6653 var fn = dir.def && dir.def[hook];
6654 if (fn) {
6655 try {
6656 fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
6657 } catch (e) {
6658 handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
6659 }
6660 }
6661 }
6662
6663 var baseModules = [
6664 ref,
6665 directives
6666 ];
6667
6668 /* */
6669
6670 function updateAttrs (oldVnode, vnode) {
6671 var opts = vnode.componentOptions;
6672 if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
6673 return
6674 }
6675 if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
6676 return
6677 }
6678 var key, cur, old;
6679 var elm = vnode.elm;
6680 var oldAttrs = oldVnode.data.attrs || {};
6681 var attrs = vnode.data.attrs || {};
6682 // clone observed objects, as the user probably wants to mutate it
6683 if (isDef(attrs.__ob__)) {
6684 attrs = vnode.data.attrs = extend({}, attrs);
6685 }
6686
6687 for (key in attrs) {
6688 cur = attrs[key];
6689 old = oldAttrs[key];
6690 if (old !== cur) {
6691 setAttr(elm, key, cur);
6692 }
6693 }
6694 // #4391: in IE9, setting type can reset value for input[type=radio]
6695 // #6666: IE/Edge forces progress value down to 1 before setting a max
6696 /* istanbul ignore if */
6697 if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
6698 setAttr(elm, 'value', attrs.value);
6699 }
6700 for (key in oldAttrs) {
6701 if (isUndef(attrs[key])) {
6702 if (isXlink(key)) {
6703 elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
6704 } else if (!isEnumeratedAttr(key)) {
6705 elm.removeAttribute(key);
6706 }
6707 }
6708 }
6709 }
6710
6711 function setAttr (el, key, value) {
6712 if (el.tagName.indexOf('-') > -1) {
6713 baseSetAttr(el, key, value);
6714 } else if (isBooleanAttr(key)) {
6715 // set attribute for blank value
6716 // e.g. <option disabled>Select one</option>
6717 if (isFalsyAttrValue(value)) {
6718 el.removeAttribute(key);
6719 } else {
6720 // technically allowfullscreen is a boolean attribute for <iframe>,
6721 // but Flash expects a value of "true" when used on <embed> tag
6722 value = key === 'allowfullscreen' && el.tagName === 'EMBED'
6723 ? 'true'
6724 : key;
6725 el.setAttribute(key, value);
6726 }
6727 } else if (isEnumeratedAttr(key)) {
6728 el.setAttribute(key, convertEnumeratedValue(key, value));
6729 } else if (isXlink(key)) {
6730 if (isFalsyAttrValue(value)) {
6731 el.removeAttributeNS(xlinkNS, getXlinkProp(key));
6732 } else {
6733 el.setAttributeNS(xlinkNS, key, value);
6734 }
6735 } else {
6736 baseSetAttr(el, key, value);
6737 }
6738 }
6739
6740 function baseSetAttr (el, key, value) {
6741 if (isFalsyAttrValue(value)) {
6742 el.removeAttribute(key);
6743 } else {
6744 // #7138: IE10 & 11 fires input event when setting placeholder on
6745 // <textarea>... block the first input event and remove the blocker
6746 // immediately.
6747 /* istanbul ignore if */
6748 if (
6749 isIE && !isIE9 &&
6750 el.tagName === 'TEXTAREA' &&
6751 key === 'placeholder' && value !== '' && !el.__ieph
6752 ) {
6753 var blocker = function (e) {
6754 e.stopImmediatePropagation();
6755 el.removeEventListener('input', blocker);
6756 };
6757 el.addEventListener('input', blocker);
6758 // $flow-disable-line
6759 el.__ieph = true; /* IE placeholder patched */
6760 }
6761 el.setAttribute(key, value);
6762 }
6763 }
6764
6765 var attrs = {
6766 create: updateAttrs,
6767 update: updateAttrs
6768 };
6769
6770 /* */
6771
6772 function updateClass (oldVnode, vnode) {
6773 var el = vnode.elm;
6774 var data = vnode.data;
6775 var oldData = oldVnode.data;
6776 if (
6777 isUndef(data.staticClass) &&
6778 isUndef(data.class) && (
6779 isUndef(oldData) || (
6780 isUndef(oldData.staticClass) &&
6781 isUndef(oldData.class)
6782 )
6783 )
6784 ) {
6785 return
6786 }
6787
6788 var cls = genClassForVnode(vnode);
6789
6790 // handle transition classes
6791 var transitionClass = el._transitionClasses;
6792 if (isDef(transitionClass)) {
6793 cls = concat(cls, stringifyClass(transitionClass));
6794 }
6795
6796 // set the class
6797 if (cls !== el._prevClass) {
6798 el.setAttribute('class', cls);
6799 el._prevClass = cls;
6800 }
6801 }
6802
6803 var klass = {
6804 create: updateClass,
6805 update: updateClass
6806 };
6807
6808 /* */
6809
6810 /* */
6811
6812 /* */
6813
6814 /* */
6815
6816 // in some cases, the event used has to be determined at runtime
6817 // so we used some reserved tokens during compile.
6818 var RANGE_TOKEN = '__r';
6819 var CHECKBOX_RADIO_TOKEN = '__c';
6820
6821 /* */
6822
6823 // normalize v-model event tokens that can only be determined at runtime.
6824 // it's important to place the event as the first in the array because
6825 // the whole point is ensuring the v-model callback gets called before
6826 // user-attached handlers.
6827 function normalizeEvents (on) {
6828 /* istanbul ignore if */
6829 if (isDef(on[RANGE_TOKEN])) {
6830 // IE input[type=range] only supports `change` event
6831 var event = isIE ? 'change' : 'input';
6832 on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
6833 delete on[RANGE_TOKEN];
6834 }
6835 // This was originally intended to fix #4521 but no longer necessary
6836 // after 2.5. Keeping it for backwards compat with generated code from < 2.4
6837 /* istanbul ignore if */
6838 if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
6839 on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
6840 delete on[CHECKBOX_RADIO_TOKEN];
6841 }
6842 }
6843
6844 var target$1;
6845
6846 function createOnceHandler$1 (event, handler, capture) {
6847 var _target = target$1; // save current target element in closure
6848 return function onceHandler () {
6849 var res = handler.apply(null, arguments);
6850 if (res !== null) {
6851 remove$2(event, onceHandler, capture, _target);
6852 }
6853 }
6854 }
6855
6856 // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
6857 // implementation and does not fire microtasks in between event propagation, so
6858 // safe to exclude.
6859 var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
6860
6861 function add$1 (
6862 name,
6863 handler,
6864 capture,
6865 passive
6866 ) {
6867 // async edge case #6566: inner click event triggers patch, event handler
6868 // attached to outer element during patch, and triggered again. This
6869 // happens because browsers fire microtask ticks between event propagation.
6870 // the solution is simple: we save the timestamp when a handler is attached,
6871 // and the handler would only fire if the event passed to it was fired
6872 // AFTER it was attached.
6873 if (useMicrotaskFix) {
6874 var attachedTimestamp = currentFlushTimestamp;
6875 var original = handler;
6876 handler = original._wrapper = function (e) {
6877 if (
6878 // no bubbling, should always fire.
6879 // this is just a safety net in case event.timeStamp is unreliable in
6880 // certain weird environments...
6881 e.target === e.currentTarget ||
6882 // event is fired after handler attachment
6883 e.timeStamp >= attachedTimestamp ||
6884 // bail for environments that have buggy event.timeStamp implementations
6885 // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
6886 // #9681 QtWebEngine event.timeStamp is negative value
6887 e.timeStamp <= 0 ||
6888 // #9448 bail if event is fired in another document in a multi-page
6889 // electron/nw.js app, since event.timeStamp will be using a different
6890 // starting reference
6891 e.target.ownerDocument !== document
6892 ) {
6893 return original.apply(this, arguments)
6894 }
6895 };
6896 }
6897 target$1.addEventListener(
6898 name,
6899 handler,
6900 supportsPassive
6901 ? { capture: capture, passive: passive }
6902 : capture
6903 );
6904 }
6905
6906 function remove$2 (
6907 name,
6908 handler,
6909 capture,
6910 _target
6911 ) {
6912 (_target || target$1).removeEventListener(
6913 name,
6914 handler._wrapper || handler,
6915 capture
6916 );
6917 }
6918
6919 function updateDOMListeners (oldVnode, vnode) {
6920 if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
6921 return
6922 }
6923 var on = vnode.data.on || {};
6924 var oldOn = oldVnode.data.on || {};
6925 target$1 = vnode.elm;
6926 normalizeEvents(on);
6927 updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context);
6928 target$1 = undefined;
6929 }
6930
6931 var events = {
6932 create: updateDOMListeners,
6933 update: updateDOMListeners
6934 };
6935
6936 /* */
6937
6938 var svgContainer;
6939
6940 function updateDOMProps (oldVnode, vnode) {
6941 if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
6942 return
6943 }
6944 var key, cur;
6945 var elm = vnode.elm;
6946 var oldProps = oldVnode.data.domProps || {};
6947 var props = vnode.data.domProps || {};
6948 // clone observed objects, as the user probably wants to mutate it
6949 if (isDef(props.__ob__)) {
6950 props = vnode.data.domProps = extend({}, props);
6951 }
6952
6953 for (key in oldProps) {
6954 if (!(key in props)) {
6955 elm[key] = '';
6956 }
6957 }
6958
6959 for (key in props) {
6960 cur = props[key];
6961 // ignore children if the node has textContent or innerHTML,
6962 // as these will throw away existing DOM nodes and cause removal errors
6963 // on subsequent patches (#3360)
6964 if (key === 'textContent' || key === 'innerHTML') {
6965 if (vnode.children) { vnode.children.length = 0; }
6966 if (cur === oldProps[key]) { continue }
6967 // #6601 work around Chrome version <= 55 bug where single textNode
6968 // replaced by innerHTML/textContent retains its parentNode property
6969 if (elm.childNodes.length === 1) {
6970 elm.removeChild(elm.childNodes[0]);
6971 }
6972 }
6973
6974 if (key === 'value' && elm.tagName !== 'PROGRESS') {
6975 // store value as _value as well since
6976 // non-string values will be stringified
6977 elm._value = cur;
6978 // avoid resetting cursor position when value is the same
6979 var strCur = isUndef(cur) ? '' : String(cur);
6980 if (shouldUpdateValue(elm, strCur)) {
6981 elm.value = strCur;
6982 }
6983 } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) {
6984 // IE doesn't support innerHTML for SVG elements
6985 svgContainer = svgContainer || document.createElement('div');
6986 svgContainer.innerHTML = "<svg>" + cur + "</svg>";
6987 var svg = svgContainer.firstChild;
6988 while (elm.firstChild) {
6989 elm.removeChild(elm.firstChild);
6990 }
6991 while (svg.firstChild) {
6992 elm.appendChild(svg.firstChild);
6993 }
6994 } else if (
6995 // skip the update if old and new VDOM state is the same.
6996 // `value` is handled separately because the DOM value may be temporarily
6997 // out of sync with VDOM state due to focus, composition and modifiers.
6998 // This #4521 by skipping the unnecesarry `checked` update.
6999 cur !== oldProps[key]
7000 ) {
7001 // some property updates can throw
7002 // e.g. `value` on <progress> w/ non-finite value
7003 try {
7004 elm[key] = cur;
7005 } catch (e) {}
7006 }
7007 }
7008 }
7009
7010 // check platforms/web/util/attrs.js acceptValue
7011
7012
7013 function shouldUpdateValue (elm, checkVal) {
7014 return (!elm.composing && (
7015 elm.tagName === 'OPTION' ||
7016 isNotInFocusAndDirty(elm, checkVal) ||
7017 isDirtyWithModifiers(elm, checkVal)
7018 ))
7019 }
7020
7021 function isNotInFocusAndDirty (elm, checkVal) {
7022 // return true when textbox (.number and .trim) loses focus and its value is
7023 // not equal to the updated value
7024 var notInFocus = true;
7025 // #6157
7026 // work around IE bug when accessing document.activeElement in an iframe
7027 try { notInFocus = document.activeElement !== elm; } catch (e) {}
7028 return notInFocus && elm.value !== checkVal
7029 }
7030
7031 function isDirtyWithModifiers (elm, newVal) {
7032 var value = elm.value;
7033 var modifiers = elm._vModifiers; // injected by v-model runtime
7034 if (isDef(modifiers)) {
7035 if (modifiers.number) {
7036 return toNumber(value) !== toNumber(newVal)
7037 }
7038 if (modifiers.trim) {
7039 return value.trim() !== newVal.trim()
7040 }
7041 }
7042 return value !== newVal
7043 }
7044
7045 var domProps = {
7046 create: updateDOMProps,
7047 update: updateDOMProps
7048 };
7049
7050 /* */
7051
7052 var parseStyleText = cached(function (cssText) {
7053 var res = {};
7054 var listDelimiter = /;(?![^(]*\))/g;
7055 var propertyDelimiter = /:(.+)/;
7056 cssText.split(listDelimiter).forEach(function (item) {
7057 if (item) {
7058 var tmp = item.split(propertyDelimiter);
7059 tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
7060 }
7061 });
7062 return res
7063 });
7064
7065 // merge static and dynamic style data on the same vnode
7066 function normalizeStyleData (data) {
7067 var style = normalizeStyleBinding(data.style);
7068 // static style is pre-processed into an object during compilation
7069 // and is always a fresh object, so it's safe to merge into it
7070 return data.staticStyle
7071 ? extend(data.staticStyle, style)
7072 : style
7073 }
7074
7075 // normalize possible array / string values into Object
7076 function normalizeStyleBinding (bindingStyle) {
7077 if (Array.isArray(bindingStyle)) {
7078 return toObject(bindingStyle)
7079 }
7080 if (typeof bindingStyle === 'string') {
7081 return parseStyleText(bindingStyle)
7082 }
7083 return bindingStyle
7084 }
7085
7086 /**
7087 * parent component style should be after child's
7088 * so that parent component's style could override it
7089 */
7090 function getStyle (vnode, checkChild) {
7091 var res = {};
7092 var styleData;
7093
7094 if (checkChild) {
7095 var childNode = vnode;
7096 while (childNode.componentInstance) {
7097 childNode = childNode.componentInstance._vnode;
7098 if (
7099 childNode && childNode.data &&
7100 (styleData = normalizeStyleData(childNode.data))
7101 ) {
7102 extend(res, styleData);
7103 }
7104 }
7105 }
7106
7107 if ((styleData = normalizeStyleData(vnode.data))) {
7108 extend(res, styleData);
7109 }
7110
7111 var parentNode = vnode;
7112 while ((parentNode = parentNode.parent)) {
7113 if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
7114 extend(res, styleData);
7115 }
7116 }
7117 return res
7118 }
7119
7120 /* */
7121
7122 var cssVarRE = /^--/;
7123 var importantRE = /\s*!important$/;
7124 var setProp = function (el, name, val) {
7125 /* istanbul ignore if */
7126 if (cssVarRE.test(name)) {
7127 el.style.setProperty(name, val);
7128 } else if (importantRE.test(val)) {
7129 el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
7130 } else {
7131 var normalizedName = normalize(name);
7132 if (Array.isArray(val)) {
7133 // Support values array created by autoprefixer, e.g.
7134 // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
7135 // Set them one by one, and the browser will only set those it can recognize
7136 for (var i = 0, len = val.length; i < len; i++) {
7137 el.style[normalizedName] = val[i];
7138 }
7139 } else {
7140 el.style[normalizedName] = val;
7141 }
7142 }
7143 };
7144
7145 var vendorNames = ['Webkit', 'Moz', 'ms'];
7146
7147 var emptyStyle;
7148 var normalize = cached(function (prop) {
7149 emptyStyle = emptyStyle || document.createElement('div').style;
7150 prop = camelize(prop);
7151 if (prop !== 'filter' && (prop in emptyStyle)) {
7152 return prop
7153 }
7154 var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
7155 for (var i = 0; i < vendorNames.length; i++) {
7156 var name = vendorNames[i] + capName;
7157 if (name in emptyStyle) {
7158 return name
7159 }
7160 }
7161 });
7162
7163 function updateStyle (oldVnode, vnode) {
7164 var data = vnode.data;
7165 var oldData = oldVnode.data;
7166
7167 if (isUndef(data.staticStyle) && isUndef(data.style) &&
7168 isUndef(oldData.staticStyle) && isUndef(oldData.style)
7169 ) {
7170 return
7171 }
7172
7173 var cur, name;
7174 var el = vnode.elm;
7175 var oldStaticStyle = oldData.staticStyle;
7176 var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
7177
7178 // if static style exists, stylebinding already merged into it when doing normalizeStyleData
7179 var oldStyle = oldStaticStyle || oldStyleBinding;
7180
7181 var style = normalizeStyleBinding(vnode.data.style) || {};
7182
7183 // store normalized style under a different key for next diff
7184 // make sure to clone it if it's reactive, since the user likely wants
7185 // to mutate it.
7186 vnode.data.normalizedStyle = isDef(style.__ob__)
7187 ? extend({}, style)
7188 : style;
7189
7190 var newStyle = getStyle(vnode, true);
7191
7192 for (name in oldStyle) {
7193 if (isUndef(newStyle[name])) {
7194 setProp(el, name, '');
7195 }
7196 }
7197 for (name in newStyle) {
7198 cur = newStyle[name];
7199 if (cur !== oldStyle[name]) {
7200 // ie9 setting to null has no effect, must use empty string
7201 setProp(el, name, cur == null ? '' : cur);
7202 }
7203 }
7204 }
7205
7206 var style = {
7207 create: updateStyle,
7208 update: updateStyle
7209 };
7210
7211 /* */
7212
7213 var whitespaceRE = /\s+/;
7214
7215 /**
7216 * Add class with compatibility for SVG since classList is not supported on
7217 * SVG elements in IE
7218 */
7219 function addClass (el, cls) {
7220 /* istanbul ignore if */
7221 if (!cls || !(cls = cls.trim())) {
7222 return
7223 }
7224
7225 /* istanbul ignore else */
7226 if (el.classList) {
7227 if (cls.indexOf(' ') > -1) {
7228 cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });
7229 } else {
7230 el.classList.add(cls);
7231 }
7232 } else {
7233 var cur = " " + (el.getAttribute('class') || '') + " ";
7234 if (cur.indexOf(' ' + cls + ' ') < 0) {
7235 el.setAttribute('class', (cur + cls).trim());
7236 }
7237 }
7238 }
7239
7240 /**
7241 * Remove class with compatibility for SVG since classList is not supported on
7242 * SVG elements in IE
7243 */
7244 function removeClass (el, cls) {
7245 /* istanbul ignore if */
7246 if (!cls || !(cls = cls.trim())) {
7247 return
7248 }
7249
7250 /* istanbul ignore else */
7251 if (el.classList) {
7252 if (cls.indexOf(' ') > -1) {
7253 cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });
7254 } else {
7255 el.classList.remove(cls);
7256 }
7257 if (!el.classList.length) {
7258 el.removeAttribute('class');
7259 }
7260 } else {
7261 var cur = " " + (el.getAttribute('class') || '') + " ";
7262 var tar = ' ' + cls + ' ';
7263 while (cur.indexOf(tar) >= 0) {
7264 cur = cur.replace(tar, ' ');
7265 }
7266 cur = cur.trim();
7267 if (cur) {
7268 el.setAttribute('class', cur);
7269 } else {
7270 el.removeAttribute('class');
7271 }
7272 }
7273 }
7274
7275 /* */
7276
7277 function resolveTransition (def$$1) {
7278 if (!def$$1) {
7279 return
7280 }
7281 /* istanbul ignore else */
7282 if (typeof def$$1 === 'object') {
7283 var res = {};
7284 if (def$$1.css !== false) {
7285 extend(res, autoCssTransition(def$$1.name || 'v'));
7286 }
7287 extend(res, def$$1);
7288 return res
7289 } else if (typeof def$$1 === 'string') {
7290 return autoCssTransition(def$$1)
7291 }
7292 }
7293
7294 var autoCssTransition = cached(function (name) {
7295 return {
7296 enterClass: (name + "-enter"),
7297 enterToClass: (name + "-enter-to"),
7298 enterActiveClass: (name + "-enter-active"),
7299 leaveClass: (name + "-leave"),
7300 leaveToClass: (name + "-leave-to"),
7301 leaveActiveClass: (name + "-leave-active")
7302 }
7303 });
7304
7305 var hasTransition = inBrowser && !isIE9;
7306 var TRANSITION = 'transition';
7307 var ANIMATION = 'animation';
7308
7309 // Transition property/event sniffing
7310 var transitionProp = 'transition';
7311 var transitionEndEvent = 'transitionend';
7312 var animationProp = 'animation';
7313 var animationEndEvent = 'animationend';
7314 if (hasTransition) {
7315 /* istanbul ignore if */
7316 if (window.ontransitionend === undefined &&
7317 window.onwebkittransitionend !== undefined
7318 ) {
7319 transitionProp = 'WebkitTransition';
7320 transitionEndEvent = 'webkitTransitionEnd';
7321 }
7322 if (window.onanimationend === undefined &&
7323 window.onwebkitanimationend !== undefined
7324 ) {
7325 animationProp = 'WebkitAnimation';
7326 animationEndEvent = 'webkitAnimationEnd';
7327 }
7328 }
7329
7330 // binding to window is necessary to make hot reload work in IE in strict mode
7331 var raf = inBrowser
7332 ? window.requestAnimationFrame
7333 ? window.requestAnimationFrame.bind(window)
7334 : setTimeout
7335 : /* istanbul ignore next */ function (fn) { return fn(); };
7336
7337 function nextFrame (fn) {
7338 raf(function () {
7339 raf(fn);
7340 });
7341 }
7342
7343 function addTransitionClass (el, cls) {
7344 var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
7345 if (transitionClasses.indexOf(cls) < 0) {
7346 transitionClasses.push(cls);
7347 addClass(el, cls);
7348 }
7349 }
7350
7351 function removeTransitionClass (el, cls) {
7352 if (el._transitionClasses) {
7353 remove(el._transitionClasses, cls);
7354 }
7355 removeClass(el, cls);
7356 }
7357
7358 function whenTransitionEnds (
7359 el,
7360 expectedType,
7361 cb
7362 ) {
7363 var ref = getTransitionInfo(el, expectedType);
7364 var type = ref.type;
7365 var timeout = ref.timeout;
7366 var propCount = ref.propCount;
7367 if (!type) { return cb() }
7368 var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
7369 var ended = 0;
7370 var end = function () {
7371 el.removeEventListener(event, onEnd);
7372 cb();
7373 };
7374 var onEnd = function (e) {
7375 if (e.target === el) {
7376 if (++ended >= propCount) {
7377 end();
7378 }
7379 }
7380 };
7381 setTimeout(function () {
7382 if (ended < propCount) {
7383 end();
7384 }
7385 }, timeout + 1);
7386 el.addEventListener(event, onEnd);
7387 }
7388
7389 var transformRE = /\b(transform|all)(,|$)/;
7390
7391 function getTransitionInfo (el, expectedType) {
7392 var styles = window.getComputedStyle(el);
7393 // JSDOM may return undefined for transition properties
7394 var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
7395 var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
7396 var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
7397 var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
7398 var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
7399 var animationTimeout = getTimeout(animationDelays, animationDurations);
7400
7401 var type;
7402 var timeout = 0;
7403 var propCount = 0;
7404 /* istanbul ignore if */
7405 if (expectedType === TRANSITION) {
7406 if (transitionTimeout > 0) {
7407 type = TRANSITION;
7408 timeout = transitionTimeout;
7409 propCount = transitionDurations.length;
7410 }
7411 } else if (expectedType === ANIMATION) {
7412 if (animationTimeout > 0) {
7413 type = ANIMATION;
7414 timeout = animationTimeout;
7415 propCount = animationDurations.length;
7416 }
7417 } else {
7418 timeout = Math.max(transitionTimeout, animationTimeout);
7419 type = timeout > 0
7420 ? transitionTimeout > animationTimeout
7421 ? TRANSITION
7422 : ANIMATION
7423 : null;
7424 propCount = type
7425 ? type === TRANSITION
7426 ? transitionDurations.length
7427 : animationDurations.length
7428 : 0;
7429 }
7430 var hasTransform =
7431 type === TRANSITION &&
7432 transformRE.test(styles[transitionProp + 'Property']);
7433 return {
7434 type: type,
7435 timeout: timeout,
7436 propCount: propCount,
7437 hasTransform: hasTransform
7438 }
7439 }
7440
7441 function getTimeout (delays, durations) {
7442 /* istanbul ignore next */
7443 while (delays.length < durations.length) {
7444 delays = delays.concat(delays);
7445 }
7446
7447 return Math.max.apply(null, durations.map(function (d, i) {
7448 return toMs(d) + toMs(delays[i])
7449 }))
7450 }
7451
7452 // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
7453 // in a locale-dependent way, using a comma instead of a dot.
7454 // If comma is not replaced with a dot, the input will be rounded down (i.e. acting
7455 // as a floor function) causing unexpected behaviors
7456 function toMs (s) {
7457 return Number(s.slice(0, -1).replace(',', '.')) * 1000
7458 }
7459
7460 /* */
7461
7462 function enter (vnode, toggleDisplay) {
7463 var el = vnode.elm;
7464
7465 // call leave callback now
7466 if (isDef(el._leaveCb)) {
7467 el._leaveCb.cancelled = true;
7468 el._leaveCb();
7469 }
7470
7471 var data = resolveTransition(vnode.data.transition);
7472 if (isUndef(data)) {
7473 return
7474 }
7475
7476 /* istanbul ignore if */
7477 if (isDef(el._enterCb) || el.nodeType !== 1) {
7478 return
7479 }
7480
7481 var css = data.css;
7482 var type = data.type;
7483 var enterClass = data.enterClass;
7484 var enterToClass = data.enterToClass;
7485 var enterActiveClass = data.enterActiveClass;
7486 var appearClass = data.appearClass;
7487 var appearToClass = data.appearToClass;
7488 var appearActiveClass = data.appearActiveClass;
7489 var beforeEnter = data.beforeEnter;
7490 var enter = data.enter;
7491 var afterEnter = data.afterEnter;
7492 var enterCancelled = data.enterCancelled;
7493 var beforeAppear = data.beforeAppear;
7494 var appear = data.appear;
7495 var afterAppear = data.afterAppear;
7496 var appearCancelled = data.appearCancelled;
7497 var duration = data.duration;
7498
7499 // activeInstance will always be the <transition> component managing this
7500 // transition. One edge case to check is when the <transition> is placed
7501 // as the root node of a child component. In that case we need to check
7502 // <transition>'s parent for appear check.
7503 var context = activeInstance;
7504 var transitionNode = activeInstance.$vnode;
7505 while (transitionNode && transitionNode.parent) {
7506 context = transitionNode.context;
7507 transitionNode = transitionNode.parent;
7508 }
7509
7510 var isAppear = !context._isMounted || !vnode.isRootInsert;
7511
7512 if (isAppear && !appear && appear !== '') {
7513 return
7514 }
7515
7516 var startClass = isAppear && appearClass
7517 ? appearClass
7518 : enterClass;
7519 var activeClass = isAppear && appearActiveClass
7520 ? appearActiveClass
7521 : enterActiveClass;
7522 var toClass = isAppear && appearToClass
7523 ? appearToClass
7524 : enterToClass;
7525
7526 var beforeEnterHook = isAppear
7527 ? (beforeAppear || beforeEnter)
7528 : beforeEnter;
7529 var enterHook = isAppear
7530 ? (typeof appear === 'function' ? appear : enter)
7531 : enter;
7532 var afterEnterHook = isAppear
7533 ? (afterAppear || afterEnter)
7534 : afterEnter;
7535 var enterCancelledHook = isAppear
7536 ? (appearCancelled || enterCancelled)
7537 : enterCancelled;
7538
7539 var explicitEnterDuration = toNumber(
7540 isObject(duration)
7541 ? duration.enter
7542 : duration
7543 );
7544
7545 if (explicitEnterDuration != null) {
7546 checkDuration(explicitEnterDuration, 'enter', vnode);
7547 }
7548
7549 var expectsCSS = css !== false && !isIE9;
7550 var userWantsControl = getHookArgumentsLength(enterHook);
7551
7552 var cb = el._enterCb = once(function () {
7553 if (expectsCSS) {
7554 removeTransitionClass(el, toClass);
7555 removeTransitionClass(el, activeClass);
7556 }
7557 if (cb.cancelled) {
7558 if (expectsCSS) {
7559 removeTransitionClass(el, startClass);
7560 }
7561 enterCancelledHook && enterCancelledHook(el);
7562 } else {
7563 afterEnterHook && afterEnterHook(el);
7564 }
7565 el._enterCb = null;
7566 });
7567
7568 if (!vnode.data.show) {
7569 // remove pending leave element on enter by injecting an insert hook
7570 mergeVNodeHook(vnode, 'insert', function () {
7571 var parent = el.parentNode;
7572 var pendingNode = parent && parent._pending && parent._pending[vnode.key];
7573 if (pendingNode &&
7574 pendingNode.tag === vnode.tag &&
7575 pendingNode.elm._leaveCb
7576 ) {
7577 pendingNode.elm._leaveCb();
7578 }
7579 enterHook && enterHook(el, cb);
7580 });
7581 }
7582
7583 // start enter transition
7584 beforeEnterHook && beforeEnterHook(el);
7585 if (expectsCSS) {
7586 addTransitionClass(el, startClass);
7587 addTransitionClass(el, activeClass);
7588 nextFrame(function () {
7589 removeTransitionClass(el, startClass);
7590 if (!cb.cancelled) {
7591 addTransitionClass(el, toClass);
7592 if (!userWantsControl) {
7593 if (isValidDuration(explicitEnterDuration)) {
7594 setTimeout(cb, explicitEnterDuration);
7595 } else {
7596 whenTransitionEnds(el, type, cb);
7597 }
7598 }
7599 }
7600 });
7601 }
7602
7603 if (vnode.data.show) {
7604 toggleDisplay && toggleDisplay();
7605 enterHook && enterHook(el, cb);
7606 }
7607
7608 if (!expectsCSS && !userWantsControl) {
7609 cb();
7610 }
7611 }
7612
7613 function leave (vnode, rm) {
7614 var el = vnode.elm;
7615
7616 // call enter callback now
7617 if (isDef(el._enterCb)) {
7618 el._enterCb.cancelled = true;
7619 el._enterCb();
7620 }
7621
7622 var data = resolveTransition(vnode.data.transition);
7623 if (isUndef(data) || el.nodeType !== 1) {
7624 return rm()
7625 }
7626
7627 /* istanbul ignore if */
7628 if (isDef(el._leaveCb)) {
7629 return
7630 }
7631
7632 var css = data.css;
7633 var type = data.type;
7634 var leaveClass = data.leaveClass;
7635 var leaveToClass = data.leaveToClass;
7636 var leaveActiveClass = data.leaveActiveClass;
7637 var beforeLeave = data.beforeLeave;
7638 var leave = data.leave;
7639 var afterLeave = data.afterLeave;
7640 var leaveCancelled = data.leaveCancelled;
7641 var delayLeave = data.delayLeave;
7642 var duration = data.duration;
7643
7644 var expectsCSS = css !== false && !isIE9;
7645 var userWantsControl = getHookArgumentsLength(leave);
7646
7647 var explicitLeaveDuration = toNumber(
7648 isObject(duration)
7649 ? duration.leave
7650 : duration
7651 );
7652
7653 if (isDef(explicitLeaveDuration)) {
7654 checkDuration(explicitLeaveDuration, 'leave', vnode);
7655 }
7656
7657 var cb = el._leaveCb = once(function () {
7658 if (el.parentNode && el.parentNode._pending) {
7659 el.parentNode._pending[vnode.key] = null;
7660 }
7661 if (expectsCSS) {
7662 removeTransitionClass(el, leaveToClass);
7663 removeTransitionClass(el, leaveActiveClass);
7664 }
7665 if (cb.cancelled) {
7666 if (expectsCSS) {
7667 removeTransitionClass(el, leaveClass);
7668 }
7669 leaveCancelled && leaveCancelled(el);
7670 } else {
7671 rm();
7672 afterLeave && afterLeave(el);
7673 }
7674 el._leaveCb = null;
7675 });
7676
7677 if (delayLeave) {
7678 delayLeave(performLeave);
7679 } else {
7680 performLeave();
7681 }
7682
7683 function performLeave () {
7684 // the delayed leave may have already been cancelled
7685 if (cb.cancelled) {
7686 return
7687 }
7688 // record leaving element
7689 if (!vnode.data.show && el.parentNode) {
7690 (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;
7691 }
7692 beforeLeave && beforeLeave(el);
7693 if (expectsCSS) {
7694 addTransitionClass(el, leaveClass);
7695 addTransitionClass(el, leaveActiveClass);
7696 nextFrame(function () {
7697 removeTransitionClass(el, leaveClass);
7698 if (!cb.cancelled) {
7699 addTransitionClass(el, leaveToClass);
7700 if (!userWantsControl) {
7701 if (isValidDuration(explicitLeaveDuration)) {
7702 setTimeout(cb, explicitLeaveDuration);
7703 } else {
7704 whenTransitionEnds(el, type, cb);
7705 }
7706 }
7707 }
7708 });
7709 }
7710 leave && leave(el, cb);
7711 if (!expectsCSS && !userWantsControl) {
7712 cb();
7713 }
7714 }
7715 }
7716
7717 // only used in dev mode
7718 function checkDuration (val, name, vnode) {
7719 if (typeof val !== 'number') {
7720 warn(
7721 "<transition> explicit " + name + " duration is not a valid number - " +
7722 "got " + (JSON.stringify(val)) + ".",
7723 vnode.context
7724 );
7725 } else if (isNaN(val)) {
7726 warn(
7727 "<transition> explicit " + name + " duration is NaN - " +
7728 'the duration expression might be incorrect.',
7729 vnode.context
7730 );
7731 }
7732 }
7733
7734 function isValidDuration (val) {
7735 return typeof val === 'number' && !isNaN(val)
7736 }
7737
7738 /**
7739 * Normalize a transition hook's argument length. The hook may be:
7740 * - a merged hook (invoker) with the original in .fns
7741 * - a wrapped component method (check ._length)
7742 * - a plain function (.length)
7743 */
7744 function getHookArgumentsLength (fn) {
7745 if (isUndef(fn)) {
7746 return false
7747 }
7748 var invokerFns = fn.fns;
7749 if (isDef(invokerFns)) {
7750 // invoker
7751 return getHookArgumentsLength(
7752 Array.isArray(invokerFns)
7753 ? invokerFns[0]
7754 : invokerFns
7755 )
7756 } else {
7757 return (fn._length || fn.length) > 1
7758 }
7759 }
7760
7761 function _enter (_, vnode) {
7762 if (vnode.data.show !== true) {
7763 enter(vnode);
7764 }
7765 }
7766
7767 var transition = inBrowser ? {
7768 create: _enter,
7769 activate: _enter,
7770 remove: function remove$$1 (vnode, rm) {
7771 /* istanbul ignore else */
7772 if (vnode.data.show !== true) {
7773 leave(vnode, rm);
7774 } else {
7775 rm();
7776 }
7777 }
7778 } : {};
7779
7780 var platformModules = [
7781 attrs,
7782 klass,
7783 events,
7784 domProps,
7785 style,
7786 transition
7787 ];
7788
7789 /* */
7790
7791 // the directive module should be applied last, after all
7792 // built-in modules have been applied.
7793 var modules = platformModules.concat(baseModules);
7794
7795 var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
7796
7797 /**
7798 * Not type checking this file because flow doesn't like attaching
7799 * properties to Elements.
7800 */
7801
7802 /* istanbul ignore if */
7803 if (isIE9) {
7804 // http://www.matts411.com/post/internet-explorer-9-oninput/
7805 document.addEventListener('selectionchange', function () {
7806 var el = document.activeElement;
7807 if (el && el.vmodel) {
7808 trigger(el, 'input');
7809 }
7810 });
7811 }
7812
7813 var directive = {
7814 inserted: function inserted (el, binding, vnode, oldVnode) {
7815 if (vnode.tag === 'select') {
7816 // #6903
7817 if (oldVnode.elm && !oldVnode.elm._vOptions) {
7818 mergeVNodeHook(vnode, 'postpatch', function () {
7819 directive.componentUpdated(el, binding, vnode);
7820 });
7821 } else {
7822 setSelected(el, binding, vnode.context);
7823 }
7824 el._vOptions = [].map.call(el.options, getValue);
7825 } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
7826 el._vModifiers = binding.modifiers;
7827 if (!binding.modifiers.lazy) {
7828 el.addEventListener('compositionstart', onCompositionStart);
7829 el.addEventListener('compositionend', onCompositionEnd);
7830 // Safari < 10.2 & UIWebView doesn't fire compositionend when
7831 // switching focus before confirming composition choice
7832 // this also fixes the issue where some browsers e.g. iOS Chrome
7833 // fires "change" instead of "input" on autocomplete.
7834 el.addEventListener('change', onCompositionEnd);
7835 /* istanbul ignore if */
7836 if (isIE9) {
7837 el.vmodel = true;
7838 }
7839 }
7840 }
7841 },
7842
7843 componentUpdated: function componentUpdated (el, binding, vnode) {
7844 if (vnode.tag === 'select') {
7845 setSelected(el, binding, vnode.context);
7846 // in case the options rendered by v-for have changed,
7847 // it's possible that the value is out-of-sync with the rendered options.
7848 // detect such cases and filter out values that no longer has a matching
7849 // option in the DOM.
7850 var prevOptions = el._vOptions;
7851 var curOptions = el._vOptions = [].map.call(el.options, getValue);
7852 if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) {
7853 // trigger change event if
7854 // no matching option found for at least one value
7855 var needReset = el.multiple
7856 ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); })
7857 : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);
7858 if (needReset) {
7859 trigger(el, 'change');
7860 }
7861 }
7862 }
7863 }
7864 };
7865
7866 function setSelected (el, binding, vm) {
7867 actuallySetSelected(el, binding, vm);
7868 /* istanbul ignore if */
7869 if (isIE || isEdge) {
7870 setTimeout(function () {
7871 actuallySetSelected(el, binding, vm);
7872 }, 0);
7873 }
7874 }
7875
7876 function actuallySetSelected (el, binding, vm) {
7877 var value = binding.value;
7878 var isMultiple = el.multiple;
7879 if (isMultiple && !Array.isArray(value)) {
7880 warn(
7881 "<select multiple v-model=\"" + (binding.expression) + "\"> " +
7882 "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
7883 vm
7884 );
7885 return
7886 }
7887 var selected, option;
7888 for (var i = 0, l = el.options.length; i < l; i++) {
7889 option = el.options[i];
7890 if (isMultiple) {
7891 selected = looseIndexOf(value, getValue(option)) > -1;
7892 if (option.selected !== selected) {
7893 option.selected = selected;
7894 }
7895 } else {
7896 if (looseEqual(getValue(option), value)) {
7897 if (el.selectedIndex !== i) {
7898 el.selectedIndex = i;
7899 }
7900 return
7901 }
7902 }
7903 }
7904 if (!isMultiple) {
7905 el.selectedIndex = -1;
7906 }
7907 }
7908
7909 function hasNoMatchingOption (value, options) {
7910 return options.every(function (o) { return !looseEqual(o, value); })
7911 }
7912
7913 function getValue (option) {
7914 return '_value' in option
7915 ? option._value
7916 : option.value
7917 }
7918
7919 function onCompositionStart (e) {
7920 e.target.composing = true;
7921 }
7922
7923 function onCompositionEnd (e) {
7924 // prevent triggering an input event for no reason
7925 if (!e.target.composing) { return }
7926 e.target.composing = false;
7927 trigger(e.target, 'input');
7928 }
7929
7930 function trigger (el, type) {
7931 var e = document.createEvent('HTMLEvents');
7932 e.initEvent(type, true, true);
7933 el.dispatchEvent(e);
7934 }
7935
7936 /* */
7937
7938 // recursively search for possible transition defined inside the component root
7939 function locateNode (vnode) {
7940 return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
7941 ? locateNode(vnode.componentInstance._vnode)
7942 : vnode
7943 }
7944
7945 var show = {
7946 bind: function bind (el, ref, vnode) {
7947 var value = ref.value;
7948
7949 vnode = locateNode(vnode);
7950 var transition$$1 = vnode.data && vnode.data.transition;
7951 var originalDisplay = el.__vOriginalDisplay =
7952 el.style.display === 'none' ? '' : el.style.display;
7953 if (value && transition$$1) {
7954 vnode.data.show = true;
7955 enter(vnode, function () {
7956 el.style.display = originalDisplay;
7957 });
7958 } else {
7959 el.style.display = value ? originalDisplay : 'none';
7960 }
7961 },
7962
7963 update: function update (el, ref, vnode) {
7964 var value = ref.value;
7965 var oldValue = ref.oldValue;
7966
7967 /* istanbul ignore if */
7968 if (!value === !oldValue) { return }
7969 vnode = locateNode(vnode);
7970 var transition$$1 = vnode.data && vnode.data.transition;
7971 if (transition$$1) {
7972 vnode.data.show = true;
7973 if (value) {
7974 enter(vnode, function () {
7975 el.style.display = el.__vOriginalDisplay;
7976 });
7977 } else {
7978 leave(vnode, function () {
7979 el.style.display = 'none';
7980 });
7981 }
7982 } else {
7983 el.style.display = value ? el.__vOriginalDisplay : 'none';
7984 }
7985 },
7986
7987 unbind: function unbind (
7988 el,
7989 binding,
7990 vnode,
7991 oldVnode,
7992 isDestroy
7993 ) {
7994 if (!isDestroy) {
7995 el.style.display = el.__vOriginalDisplay;
7996 }
7997 }
7998 };
7999
8000 var platformDirectives = {
8001 model: directive,
8002 show: show
8003 };
8004
8005 /* */
8006
8007 var transitionProps = {
8008 name: String,
8009 appear: Boolean,
8010 css: Boolean,
8011 mode: String,
8012 type: String,
8013 enterClass: String,
8014 leaveClass: String,
8015 enterToClass: String,
8016 leaveToClass: String,
8017 enterActiveClass: String,
8018 leaveActiveClass: String,
8019 appearClass: String,
8020 appearActiveClass: String,
8021 appearToClass: String,
8022 duration: [Number, String, Object]
8023 };
8024
8025 // in case the child is also an abstract component, e.g. <keep-alive>
8026 // we want to recursively retrieve the real component to be rendered
8027 function getRealChild (vnode) {
8028 var compOptions = vnode && vnode.componentOptions;
8029 if (compOptions && compOptions.Ctor.options.abstract) {
8030 return getRealChild(getFirstComponentChild(compOptions.children))
8031 } else {
8032 return vnode
8033 }
8034 }
8035
8036 function extractTransitionData (comp) {
8037 var data = {};
8038 var options = comp.$options;
8039 // props
8040 for (var key in options.propsData) {
8041 data[key] = comp[key];
8042 }
8043 // events.
8044 // extract listeners and pass them directly to the transition methods
8045 var listeners = options._parentListeners;
8046 for (var key$1 in listeners) {
8047 data[camelize(key$1)] = listeners[key$1];
8048 }
8049 return data
8050 }
8051
8052 function placeholder (h, rawChild) {
8053 if (/\d-keep-alive$/.test(rawChild.tag)) {
8054 return h('keep-alive', {
8055 props: rawChild.componentOptions.propsData
8056 })
8057 }
8058 }
8059
8060 function hasParentTransition (vnode) {
8061 while ((vnode = vnode.parent)) {
8062 if (vnode.data.transition) {
8063 return true
8064 }
8065 }
8066 }
8067
8068 function isSameChild (child, oldChild) {
8069 return oldChild.key === child.key && oldChild.tag === child.tag
8070 }
8071
8072 var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
8073
8074 var isVShowDirective = function (d) { return d.name === 'show'; };
8075
8076 var Transition = {
8077 name: 'transition',
8078 props: transitionProps,
8079 abstract: true,
8080
8081 render: function render (h) {
8082 var this$1 = this;
8083
8084 var children = this.$slots.default;
8085 if (!children) {
8086 return
8087 }
8088
8089 // filter out text nodes (possible whitespaces)
8090 children = children.filter(isNotTextNode);
8091 /* istanbul ignore if */
8092 if (!children.length) {
8093 return
8094 }
8095
8096 // warn multiple elements
8097 if (children.length > 1) {
8098 warn(
8099 '<transition> can only be used on a single element. Use ' +
8100 '<transition-group> for lists.',
8101 this.$parent
8102 );
8103 }
8104
8105 var mode = this.mode;
8106
8107 // warn invalid mode
8108 if (mode && mode !== 'in-out' && mode !== 'out-in'
8109 ) {
8110 warn(
8111 'invalid <transition> mode: ' + mode,
8112 this.$parent
8113 );
8114 }
8115
8116 var rawChild = children[0];
8117
8118 // if this is a component root node and the component's
8119 // parent container node also has transition, skip.
8120 if (hasParentTransition(this.$vnode)) {
8121 return rawChild
8122 }
8123
8124 // apply transition data to child
8125 // use getRealChild() to ignore abstract components e.g. keep-alive
8126 var child = getRealChild(rawChild);
8127 /* istanbul ignore if */
8128 if (!child) {
8129 return rawChild
8130 }
8131
8132 if (this._leaving) {
8133 return placeholder(h, rawChild)
8134 }
8135
8136 // ensure a key that is unique to the vnode type and to this transition
8137 // component instance. This key will be used to remove pending leaving nodes
8138 // during entering.
8139 var id = "__transition-" + (this._uid) + "-";
8140 child.key = child.key == null
8141 ? child.isComment
8142 ? id + 'comment'
8143 : id + child.tag
8144 : isPrimitive(child.key)
8145 ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
8146 : child.key;
8147
8148 var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
8149 var oldRawChild = this._vnode;
8150 var oldChild = getRealChild(oldRawChild);
8151
8152 // mark v-show
8153 // so that the transition module can hand over the control to the directive
8154 if (child.data.directives && child.data.directives.some(isVShowDirective)) {
8155 child.data.show = true;
8156 }
8157
8158 if (
8159 oldChild &&
8160 oldChild.data &&
8161 !isSameChild(child, oldChild) &&
8162 !isAsyncPlaceholder(oldChild) &&
8163 // #6687 component root is a comment node
8164 !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)
8165 ) {
8166 // replace old child transition data with fresh one
8167 // important for dynamic transitions!
8168 var oldData = oldChild.data.transition = extend({}, data);
8169 // handle transition mode
8170 if (mode === 'out-in') {
8171 // return placeholder node and queue update when leave finishes
8172 this._leaving = true;
8173 mergeVNodeHook(oldData, 'afterLeave', function () {
8174 this$1._leaving = false;
8175 this$1.$forceUpdate();
8176 });
8177 return placeholder(h, rawChild)
8178 } else if (mode === 'in-out') {
8179 if (isAsyncPlaceholder(child)) {
8180 return oldRawChild
8181 }
8182 var delayedLeave;
8183 var performLeave = function () { delayedLeave(); };
8184 mergeVNodeHook(data, 'afterEnter', performLeave);
8185 mergeVNodeHook(data, 'enterCancelled', performLeave);
8186 mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });
8187 }
8188 }
8189
8190 return rawChild
8191 }
8192 };
8193
8194 /* */
8195
8196 var props = extend({
8197 tag: String,
8198 moveClass: String
8199 }, transitionProps);
8200
8201 delete props.mode;
8202
8203 var TransitionGroup = {
8204 props: props,
8205
8206 beforeMount: function beforeMount () {
8207 var this$1 = this;
8208
8209 var update = this._update;
8210 this._update = function (vnode, hydrating) {
8211 var restoreActiveInstance = setActiveInstance(this$1);
8212 // force removing pass
8213 this$1.__patch__(
8214 this$1._vnode,
8215 this$1.kept,
8216 false, // hydrating
8217 true // removeOnly (!important, avoids unnecessary moves)
8218 );
8219 this$1._vnode = this$1.kept;
8220 restoreActiveInstance();
8221 update.call(this$1, vnode, hydrating);
8222 };
8223 },
8224
8225 render: function render (h) {
8226 var tag = this.tag || this.$vnode.data.tag || 'span';
8227 var map = Object.create(null);
8228 var prevChildren = this.prevChildren = this.children;
8229 var rawChildren = this.$slots.default || [];
8230 var children = this.children = [];
8231 var transitionData = extractTransitionData(this);
8232
8233 for (var i = 0; i < rawChildren.length; i++) {
8234 var c = rawChildren[i];
8235 if (c.tag) {
8236 if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
8237 children.push(c);
8238 map[c.key] = c
8239 ;(c.data || (c.data = {})).transition = transitionData;
8240 } else {
8241 var opts = c.componentOptions;
8242 var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;
8243 warn(("<transition-group> children must be keyed: <" + name + ">"));
8244 }
8245 }
8246 }
8247
8248 if (prevChildren) {
8249 var kept = [];
8250 var removed = [];
8251 for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
8252 var c$1 = prevChildren[i$1];
8253 c$1.data.transition = transitionData;
8254 c$1.data.pos = c$1.elm.getBoundingClientRect();
8255 if (map[c$1.key]) {
8256 kept.push(c$1);
8257 } else {
8258 removed.push(c$1);
8259 }
8260 }
8261 this.kept = h(tag, null, kept);
8262 this.removed = removed;
8263 }
8264
8265 return h(tag, null, children)
8266 },
8267
8268 updated: function updated () {
8269 var children = this.prevChildren;
8270 var moveClass = this.moveClass || ((this.name || 'v') + '-move');
8271 if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
8272 return
8273 }
8274
8275 // we divide the work into three loops to avoid mixing DOM reads and writes
8276 // in each iteration - which helps prevent layout thrashing.
8277 children.forEach(callPendingCbs);
8278 children.forEach(recordPosition);
8279 children.forEach(applyTranslation);
8280
8281 // force reflow to put everything in position
8282 // assign to this to avoid being removed in tree-shaking
8283 // $flow-disable-line
8284 this._reflow = document.body.offsetHeight;
8285
8286 children.forEach(function (c) {
8287 if (c.data.moved) {
8288 var el = c.elm;
8289 var s = el.style;
8290 addTransitionClass(el, moveClass);
8291 s.transform = s.WebkitTransform = s.transitionDuration = '';
8292 el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
8293 if (e && e.target !== el) {
8294 return
8295 }
8296 if (!e || /transform$/.test(e.propertyName)) {
8297 el.removeEventListener(transitionEndEvent, cb);
8298 el._moveCb = null;
8299 removeTransitionClass(el, moveClass);
8300 }
8301 });
8302 }
8303 });
8304 },
8305
8306 methods: {
8307 hasMove: function hasMove (el, moveClass) {
8308 /* istanbul ignore if */
8309 if (!hasTransition) {
8310 return false
8311 }
8312 /* istanbul ignore if */
8313 if (this._hasMove) {
8314 return this._hasMove
8315 }
8316 // Detect whether an element with the move class applied has
8317 // CSS transitions. Since the element may be inside an entering
8318 // transition at this very moment, we make a clone of it and remove
8319 // all other transition classes applied to ensure only the move class
8320 // is applied.
8321 var clone = el.cloneNode();
8322 if (el._transitionClasses) {
8323 el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });
8324 }
8325 addClass(clone, moveClass);
8326 clone.style.display = 'none';
8327 this.$el.appendChild(clone);
8328 var info = getTransitionInfo(clone);
8329 this.$el.removeChild(clone);
8330 return (this._hasMove = info.hasTransform)
8331 }
8332 }
8333 };
8334
8335 function callPendingCbs (c) {
8336 /* istanbul ignore if */
8337 if (c.elm._moveCb) {
8338 c.elm._moveCb();
8339 }
8340 /* istanbul ignore if */
8341 if (c.elm._enterCb) {
8342 c.elm._enterCb();
8343 }
8344 }
8345
8346 function recordPosition (c) {
8347 c.data.newPos = c.elm.getBoundingClientRect();
8348 }
8349
8350 function applyTranslation (c) {
8351 var oldPos = c.data.pos;
8352 var newPos = c.data.newPos;
8353 var dx = oldPos.left - newPos.left;
8354 var dy = oldPos.top - newPos.top;
8355 if (dx || dy) {
8356 c.data.moved = true;
8357 var s = c.elm.style;
8358 s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
8359 s.transitionDuration = '0s';
8360 }
8361 }
8362
8363 var platformComponents = {
8364 Transition: Transition,
8365 TransitionGroup: TransitionGroup
8366 };
8367
8368 /* */
8369
8370 // install platform specific utils
8371 Vue.config.mustUseProp = mustUseProp;
8372 Vue.config.isReservedTag = isReservedTag;
8373 Vue.config.isReservedAttr = isReservedAttr;
8374 Vue.config.getTagNamespace = getTagNamespace;
8375 Vue.config.isUnknownElement = isUnknownElement;
8376
8377 // install platform runtime directives & components
8378 extend(Vue.options.directives, platformDirectives);
8379 extend(Vue.options.components, platformComponents);
8380
8381 // install platform patch function
8382 Vue.prototype.__patch__ = inBrowser ? patch : noop;
8383
8384 // public mount method
8385 Vue.prototype.$mount = function (
8386 el,
8387 hydrating
8388 ) {
8389 el = el && inBrowser ? query(el) : undefined;
8390 return mountComponent(this, el, hydrating)
8391 };
8392
8393 // devtools global hook
8394 /* istanbul ignore next */
8395 if (inBrowser) {
8396 setTimeout(function () {
8397 if (config.devtools) {
8398 if (devtools) {
8399 devtools.emit('init', Vue);
8400 } else {
8401 console[console.info ? 'info' : 'log'](
8402 'Download the Vue Devtools extension for a better development experience:\n' +
8403 'https://github.com/vuejs/vue-devtools'
8404 );
8405 }
8406 }
8407 if (config.productionTip !== false &&
8408 typeof console !== 'undefined'
8409 ) {
8410 console[console.info ? 'info' : 'log'](
8411 "You are running Vue in development mode.\n" +
8412 "Make sure to turn on production mode when deploying for production.\n" +
8413 "See more tips at https://vuejs.org/guide/deployment.html"
8414 );
8415 }
8416 }, 0);
8417 }
8418
8419 /* */
8420
8421 return Vue;
8422
8423 }));
8424