Version Description
~ Changed SQL to read course items by user item ID. ~ Improved performance in admin orders page. ~ Upgraded Vue/Vuex to latest version. ~ Added new theme to LP ad.
Download this release
Release Info
Developer | tunnhn |
Plugin | LearnPress – WordPress LMS Plugin |
Version | 3.2.5.3 |
Comparing to | |
See all releases |
Code changes from version 3.2.5.2 to 3.2.5.3
- assets/js/admin/admin.js +0 -1
- assets/js/admin/course-editor.js +56 -57
- assets/js/admin/meta-box-order.js +4 -2
- assets/js/admin/modal-search-items.js +7 -5
- assets/js/admin/modal-search-users.js +8 -5
- assets/js/admin/question-editor.js +22 -17
- assets/js/admin/quiz-editor.js +65 -64
- assets/js/admin/statistic.js +0 -1
- assets/js/admin/sync-data.js +0 -1
- assets/js/admin/update.js +0 -3
- assets/js/admin/utils/_dropdown-pages.js +0 -1
- assets/js/global.js +3 -2
- assets/js/vendor/{sortable.1.6.0.js → sortable.js} +0 -0
- assets/js/vendor/{vue-resource.1.3.4.js → vue-resource.js} +0 -0
- assets/js/vendor/vue.js +11722 -9834
- assets/js/vendor/vue.min.js +3 -3
- assets/js/vendor/{vuedraggable.2.14.1.js → vuedraggable.js} +0 -0
- assets/js/vendor/vuex.2.3.1.js +0 -809
- assets/js/vendor/vuex.js +1005 -0
- inc/admin/class-lp-admin-assets.php +5 -5
- inc/admin/class-lp-post-type-actions.php +4 -0
- inc/admin/lp-admin-functions.php +2 -0
- inc/admin/views/course/added-items-preview.php +6 -3
- inc/admin/views/course/curriculum.php +4 -3
- inc/admin/views/course/editor.php +4 -3
- inc/admin/views/course/modal-choose-items.php +8 -6
- inc/admin/views/course/new-section-item.php +5 -3
- inc/admin/views/course/new-section.php +5 -3
- inc/admin/views/course/pagination.php +5 -3
- inc/admin/views/course/section-item.php +5 -3
- inc/admin/views/course/section.php +5 -3
- inc/admin/views/course/sections.php +5 -3
- inc/admin/views/question/actions.php +4 -3
- inc/admin/views/question/answer.php +4 -3
- inc/admin/views/question/editor.php +4 -3
- inc/admin/views/question/option.php +4 -3
- inc/admin/views/quiz/added-items-preview.php +4 -3
- inc/admin/views/quiz/editor.php +4 -3
- inc/admin/views/quiz/modal-choose-items.php +9 -6
- inc/admin/views/quiz/pagination.php +4 -3
- inc/admin/views/quiz/question-actions.php +4 -3
- inc/admin/views/quiz/question-answer-option.php +4 -3
- inc/admin/views/quiz/question-answer.php +5 -3
- inc/admin/views/quiz/question-meta.php +4 -3
- inc/admin/views/quiz/question-settings.php +5 -3
- inc/admin/views/quiz/question.php +4 -3
- inc/admin/views/quiz/questions.php +4 -4
- inc/admin/views/tools/course/html-course.php +4 -1
- inc/admin/views/tools/course/html-user-item.php +3 -1
- inc/admin/views/tools/course/html-user.php +3 -1
- inc/class-lp-assets.php +3 -3
- inc/curds/class-lp-course-curd.php +1 -1
- inc/curds/class-lp-helper-curd.php +4 -3
- inc/curds/class-lp-order-curd.php +12 -4
- inc/curds/class-lp-quiz-curd.php +2 -1
- inc/curds/class-lp-user-curd.php +10 -9
- inc/custom-post-types/abstract.php +1 -1
- inc/custom-post-types/course.php +6 -2
- inc/custom-post-types/order.php +12 -19
- inc/emails/class-lp-email-cancelled-order-instructor.php +4 -1
- inc/emails/class-lp-email-enrolled-course-instructor.php +4 -1
- inc/emails/class-lp-email-finished-course-instructor.php +4 -1
- inc/emails/class-lp-email-new-order-instructor.php +4 -1
- inc/lp-constants.php +1 -1
- inc/lp-core-functions.php +14 -7
- inc/lp-template-functions.php +9 -6
- inc/quiz/class-lp-quiz.php +7 -6
- inc/user-item/class-lp-user-item-quiz.php +1 -1
- learnpress.php +1 -1
- readme.txt +7 -1
- templates/emails/order-items-table.php +1 -1
assets/js/admin/admin.js
CHANGED
@@ -66,7 +66,6 @@
|
|
66 |
order: order
|
67 |
},
|
68 |
success: function (response) {
|
69 |
-
console.log(response)
|
70 |
}
|
71 |
});
|
72 |
}
|
66 |
order: order
|
67 |
},
|
68 |
success: function (response) {
|
|
|
69 |
}
|
70 |
});
|
71 |
}
|
assets/js/admin/course-editor.js
CHANGED
@@ -15,8 +15,12 @@
|
|
15 |
};
|
16 |
})(window);
|
17 |
|
18 |
-
|
|
|
|
|
|
|
19 |
|
|
|
20 |
|
21 |
/**
|
22 |
* I18n Store
|
@@ -24,7 +28,7 @@ jQuery(function ($) {
|
|
24 |
* @since 3.0.0
|
25 |
*/
|
26 |
|
27 |
-
var LP_Curriculum_i18n_Store = (function (
|
28 |
var state = helpers.cloneObject(data.i18n);
|
29 |
|
30 |
var getters = {
|
@@ -39,14 +43,14 @@ jQuery(function ($) {
|
|
39 |
getters: getters
|
40 |
};
|
41 |
|
42 |
-
})(
|
43 |
|
44 |
/**
|
45 |
* Sections Store.
|
46 |
*
|
47 |
* @since 3.0.0
|
48 |
*/
|
49 |
-
var LP_Curriculum_Sections_Store = (function (
|
50 |
var state = helpers.cloneObject(data.sections);
|
51 |
|
52 |
state.statusUpdateSection = {};
|
@@ -111,9 +115,7 @@ jQuery(function ($) {
|
|
111 |
var pos;
|
112 |
|
113 |
if (newSection.temp_id) {
|
114 |
-
console.log(newSection)
|
115 |
state.sections.map(function (section, i) {
|
116 |
-
console.log(section)
|
117 |
if (newSection.temp_id == section.id) {
|
118 |
pos = i;
|
119 |
return false;
|
@@ -122,7 +124,7 @@ jQuery(function ($) {
|
|
122 |
}
|
123 |
|
124 |
if (pos !== undefined) {
|
125 |
-
Vue.set(state.sections, pos, newSection);
|
126 |
} else {
|
127 |
state.sections.push(newSection);
|
128 |
}
|
@@ -205,27 +207,27 @@ jQuery(function ($) {
|
|
205 |
},
|
206 |
|
207 |
'UPDATE_SECTION_REQUEST': function (state, sectionId) {
|
208 |
-
Vue.set(state.statusUpdateSection, sectionId, 'updating');
|
209 |
},
|
210 |
|
211 |
'UPDATE_SECTION_SUCCESS': function (state, sectionId) {
|
212 |
-
Vue.set(state.statusUpdateSection, sectionId, 'successful');
|
213 |
},
|
214 |
|
215 |
'UPDATE_SECTION_FAILURE': function (state, sectionId) {
|
216 |
-
Vue.set(state.statusUpdateSection, sectionId, 'failed');
|
217 |
},
|
218 |
|
219 |
'UPDATE_SECTION_ITEM_REQUEST': function (state, itemId) {
|
220 |
-
Vue.set(state.statusUpdateSectionItem, itemId, 'updating');
|
221 |
},
|
222 |
|
223 |
'UPDATE_SECTION_ITEM_SUCCESS': function (state, itemId) {
|
224 |
-
Vue.set(state.statusUpdateSectionItem, itemId, 'successful');
|
225 |
},
|
226 |
|
227 |
'UPDATE_SECTION_ITEM_FAILURE': function (state, itemId) {
|
228 |
-
Vue.set(state.statusUpdateSectionItem, itemId, 'failed');
|
229 |
},
|
230 |
'APPEND_EMPTY_ITEM_TO_SECTION': function (state, data) {
|
231 |
|
@@ -257,7 +259,7 @@ jQuery(function ($) {
|
|
257 |
var item_id = section.items[i].id;
|
258 |
if (item_id) {
|
259 |
if (data.items[item_id]) {
|
260 |
-
Vue.set(section.items, i, data.items[item_id])
|
261 |
}
|
262 |
}
|
263 |
} catch (ex) {
|
@@ -280,14 +282,14 @@ jQuery(function ($) {
|
|
280 |
context.commit('CLOSE_ALL_SECTIONS');
|
281 |
}
|
282 |
|
283 |
-
|
284 |
type: 'hidden-sections',
|
285 |
hidden: context.getters['hiddenSections']
|
286 |
});
|
287 |
},
|
288 |
|
289 |
updateSectionsOrder: function (context, order) {
|
290 |
-
|
291 |
type: 'sort-sections',
|
292 |
order: JSON.stringify(order)
|
293 |
}).then(
|
@@ -309,7 +311,7 @@ jQuery(function ($) {
|
|
309 |
context.commit('OPEN_SECTION', section);
|
310 |
}
|
311 |
|
312 |
-
|
313 |
type: 'hidden-sections',
|
314 |
hidden: context.getters['hiddenSections']
|
315 |
});
|
@@ -318,11 +320,10 @@ jQuery(function ($) {
|
|
318 |
updateSection: function (context, section) {
|
319 |
context.commit('UPDATE_SECTION_REQUEST', section.id);
|
320 |
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
})
|
326 |
.then(function () {
|
327 |
context.commit('UPDATE_SECTION_SUCCESS', section.id);
|
328 |
})
|
@@ -334,7 +335,7 @@ jQuery(function ($) {
|
|
334 |
removeSection: function (context, payload) {
|
335 |
context.commit('REMOVE_SECTION', payload.index);
|
336 |
|
337 |
-
|
338 |
type: 'remove-section',
|
339 |
section_id: payload.section.id
|
340 |
}).then(
|
@@ -360,7 +361,7 @@ jQuery(function ($) {
|
|
360 |
title: newSection.section_name
|
361 |
});
|
362 |
|
363 |
-
|
364 |
function (response) {
|
365 |
var result = response.body;
|
366 |
|
@@ -380,7 +381,7 @@ jQuery(function ($) {
|
|
380 |
updateSectionItem: function (context, payload) {
|
381 |
context.commit('UPDATE_SECTION_ITEM_REQUEST', payload.item.id);
|
382 |
|
383 |
-
|
384 |
type: 'update-section-item',
|
385 |
section_id: payload.section_id,
|
386 |
item: JSON.stringify(payload.item)
|
@@ -407,12 +408,11 @@ jQuery(function ($) {
|
|
407 |
var id = payload.item.id;
|
408 |
context.commit('REMOVE_SECTION_ITEM', payload);
|
409 |
payload.item.temp_id = 0;
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
}).then(
|
416 |
function () {
|
417 |
context.commit('REMOVE_SECTION_ITEM', payload);
|
418 |
}
|
@@ -423,12 +423,11 @@ jQuery(function ($) {
|
|
423 |
var id = payload.item.id;
|
424 |
context.commit('REMOVE_SECTION_ITEM', payload);
|
425 |
payload.item.temp_id = 0;
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
}).then(
|
432 |
function () {
|
433 |
context.commit('REMOVE_SECTION_ITEM', payload);
|
434 |
}
|
@@ -439,7 +438,7 @@ jQuery(function ($) {
|
|
439 |
|
440 |
context.commit('APPEND_EMPTY_ITEM_TO_SECTION', payload)
|
441 |
//context.commit('UPDATE_SECTION_ITEMS', {section_id: payload.section_id, items: result.data});
|
442 |
-
|
443 |
type: 'new-section-item',
|
444 |
section_id: payload.section_id,
|
445 |
item: JSON.stringify(payload.item)
|
@@ -466,7 +465,7 @@ jQuery(function ($) {
|
|
466 |
},
|
467 |
|
468 |
updateSectionItems: function (context, payload) {
|
469 |
-
|
470 |
type: 'update-section-items',
|
471 |
section_id: payload.section_id,
|
472 |
items: JSON.stringify(payload.items),
|
@@ -493,7 +492,7 @@ jQuery(function ($) {
|
|
493 |
mutations: mutations,
|
494 |
actions: actions
|
495 |
};
|
496 |
-
})(
|
497 |
|
498 |
|
499 |
/**
|
@@ -503,7 +502,7 @@ jQuery(function ($) {
|
|
503 |
*
|
504 |
* @type {{namespaced, state, getters, mutations, actions}}
|
505 |
*/
|
506 |
-
var LP_Choose_Items_Modal_Store = (function (exports,
|
507 |
var state = helpers.cloneObject(data.chooseItems);
|
508 |
state.sectionId = false;
|
509 |
state.pagination = '';
|
@@ -594,7 +593,7 @@ jQuery(function ($) {
|
|
594 |
searchItems: function (context, payload) {
|
595 |
context.commit('SEARCH_ITEMS_REQUEST');
|
596 |
|
597 |
-
|
598 |
type: 'search-items',
|
599 |
query: payload.query,
|
600 |
item_type: payload.type,
|
@@ -634,7 +633,7 @@ jQuery(function ($) {
|
|
634 |
var items = context.getters.addedItems;
|
635 |
|
636 |
if (items.length > 0) {
|
637 |
-
|
638 |
type: 'add-items-to-section',
|
639 |
section_id: context.getters.section,
|
640 |
items: JSON.stringify(items)
|
@@ -667,14 +666,14 @@ jQuery(function ($) {
|
|
667 |
mutations: mutations,
|
668 |
actions: actions
|
669 |
}
|
670 |
-
})(window,
|
671 |
|
672 |
/**
|
673 |
* Root Store
|
674 |
*
|
675 |
* @since 3.0.0
|
676 |
*/
|
677 |
-
(function (exports,
|
678 |
var state = helpers.cloneObject(data.root);
|
679 |
|
680 |
state.status = 'success';
|
@@ -737,7 +736,7 @@ jQuery(function ($) {
|
|
737 |
|
738 |
var actions = {
|
739 |
heartbeat: function (context) {
|
740 |
-
|
741 |
type: 'heartbeat'
|
742 |
}).then(
|
743 |
function (response) {
|
@@ -754,7 +753,7 @@ jQuery(function ($) {
|
|
754 |
var auto_draft = context.getters['autoDraft'];
|
755 |
|
756 |
if (auto_draft) {
|
757 |
-
|
758 |
type: 'draft-course',
|
759 |
course: JSON.stringify(payload)
|
760 |
}).then(function (response) {
|
@@ -789,7 +788,7 @@ jQuery(function ($) {
|
|
789 |
}
|
790 |
};
|
791 |
|
792 |
-
exports.LP_Curriculum_Store = new Vuex.Store({
|
793 |
state: state,
|
794 |
getters: getters,
|
795 |
mutations: mutations,
|
@@ -801,20 +800,20 @@ jQuery(function ($) {
|
|
801 |
}
|
802 |
});
|
803 |
|
804 |
-
})(window,
|
805 |
|
806 |
/**
|
807 |
* HTTP
|
808 |
*
|
809 |
* @since 3.0.0
|
810 |
*/
|
811 |
-
(function (exports,
|
812 |
-
|
813 |
payload['id'] = $store.getters.id;
|
814 |
payload['nonce'] = $store.getters.nonce;
|
815 |
payload['lp-ajax'] = $store.getters.action;
|
816 |
|
817 |
-
return
|
818 |
payload,
|
819 |
{
|
820 |
emulateJSON: true,
|
@@ -824,7 +823,7 @@ jQuery(function ($) {
|
|
824 |
});
|
825 |
};
|
826 |
|
827 |
-
|
828 |
if (request.params['namespace'] !== 'LPCurriculumRequest') {
|
829 |
next();
|
830 |
return;
|
@@ -848,20 +847,20 @@ jQuery(function ($) {
|
|
848 |
}
|
849 |
});
|
850 |
});
|
851 |
-
})(window,
|
852 |
|
853 |
/**
|
854 |
* Init app.
|
855 |
*
|
856 |
* @since 3.0.0
|
857 |
*/
|
858 |
-
(function ($,
|
859 |
$(document).ready(function () {
|
860 |
-
window.LP_Course_Editor = new Vue({
|
861 |
el: '#admin-editor-lp_course',
|
862 |
template: '<lp-course-editor></lp-course-editor>'
|
863 |
});
|
864 |
});
|
865 |
-
})(jQuery,
|
866 |
|
867 |
});
|
15 |
};
|
16 |
})(window);
|
17 |
|
18 |
+
window.$Vue = window.$Vue || Vue;
|
19 |
+
window.$Vuex = window.$Vuex || Vuex;
|
20 |
+
|
21 |
+
var $VueHTTP = Vue.http;
|
22 |
|
23 |
+
jQuery(function ($) {
|
24 |
|
25 |
/**
|
26 |
* I18n Store
|
28 |
* @since 3.0.0
|
29 |
*/
|
30 |
|
31 |
+
var LP_Curriculum_i18n_Store = (function (helpers, data) {
|
32 |
var state = helpers.cloneObject(data.i18n);
|
33 |
|
34 |
var getters = {
|
43 |
getters: getters
|
44 |
};
|
45 |
|
46 |
+
})(LP_Helpers, lpAdminCourseEditorSettings);
|
47 |
|
48 |
/**
|
49 |
* Sections Store.
|
50 |
*
|
51 |
* @since 3.0.0
|
52 |
*/
|
53 |
+
var LP_Curriculum_Sections_Store = (function (helpers, data) {
|
54 |
var state = helpers.cloneObject(data.sections);
|
55 |
|
56 |
state.statusUpdateSection = {};
|
115 |
var pos;
|
116 |
|
117 |
if (newSection.temp_id) {
|
|
|
118 |
state.sections.map(function (section, i) {
|
|
|
119 |
if (newSection.temp_id == section.id) {
|
120 |
pos = i;
|
121 |
return false;
|
124 |
}
|
125 |
|
126 |
if (pos !== undefined) {
|
127 |
+
$Vue.set(state.sections, pos, newSection);
|
128 |
} else {
|
129 |
state.sections.push(newSection);
|
130 |
}
|
207 |
},
|
208 |
|
209 |
'UPDATE_SECTION_REQUEST': function (state, sectionId) {
|
210 |
+
$Vue.set(state.statusUpdateSection, sectionId, 'updating');
|
211 |
},
|
212 |
|
213 |
'UPDATE_SECTION_SUCCESS': function (state, sectionId) {
|
214 |
+
$Vue.set(state.statusUpdateSection, sectionId, 'successful');
|
215 |
},
|
216 |
|
217 |
'UPDATE_SECTION_FAILURE': function (state, sectionId) {
|
218 |
+
$Vue.set(state.statusUpdateSection, sectionId, 'failed');
|
219 |
},
|
220 |
|
221 |
'UPDATE_SECTION_ITEM_REQUEST': function (state, itemId) {
|
222 |
+
$Vue.set(state.statusUpdateSectionItem, itemId, 'updating');
|
223 |
},
|
224 |
|
225 |
'UPDATE_SECTION_ITEM_SUCCESS': function (state, itemId) {
|
226 |
+
$Vue.set(state.statusUpdateSectionItem, itemId, 'successful');
|
227 |
},
|
228 |
|
229 |
'UPDATE_SECTION_ITEM_FAILURE': function (state, itemId) {
|
230 |
+
$Vue.set(state.statusUpdateSectionItem, itemId, 'failed');
|
231 |
},
|
232 |
'APPEND_EMPTY_ITEM_TO_SECTION': function (state, data) {
|
233 |
|
259 |
var item_id = section.items[i].id;
|
260 |
if (item_id) {
|
261 |
if (data.items[item_id]) {
|
262 |
+
$Vue.set(section.items, i, data.items[item_id])
|
263 |
}
|
264 |
}
|
265 |
} catch (ex) {
|
282 |
context.commit('CLOSE_ALL_SECTIONS');
|
283 |
}
|
284 |
|
285 |
+
LP.Request({
|
286 |
type: 'hidden-sections',
|
287 |
hidden: context.getters['hiddenSections']
|
288 |
});
|
289 |
},
|
290 |
|
291 |
updateSectionsOrder: function (context, order) {
|
292 |
+
LP.Request({
|
293 |
type: 'sort-sections',
|
294 |
order: JSON.stringify(order)
|
295 |
}).then(
|
311 |
context.commit('OPEN_SECTION', section);
|
312 |
}
|
313 |
|
314 |
+
LP.Request({
|
315 |
type: 'hidden-sections',
|
316 |
hidden: context.getters['hiddenSections']
|
317 |
});
|
320 |
updateSection: function (context, section) {
|
321 |
context.commit('UPDATE_SECTION_REQUEST', section.id);
|
322 |
|
323 |
+
LP.Request({
|
324 |
+
type: 'update-section',
|
325 |
+
section: JSON.stringify(section)
|
326 |
+
})
|
|
|
327 |
.then(function () {
|
328 |
context.commit('UPDATE_SECTION_SUCCESS', section.id);
|
329 |
})
|
335 |
removeSection: function (context, payload) {
|
336 |
context.commit('REMOVE_SECTION', payload.index);
|
337 |
|
338 |
+
LP.Request({
|
339 |
type: 'remove-section',
|
340 |
section_id: payload.section.id
|
341 |
}).then(
|
361 |
title: newSection.section_name
|
362 |
});
|
363 |
|
364 |
+
LP.Request(newSection).then(
|
365 |
function (response) {
|
366 |
var result = response.body;
|
367 |
|
381 |
updateSectionItem: function (context, payload) {
|
382 |
context.commit('UPDATE_SECTION_ITEM_REQUEST', payload.item.id);
|
383 |
|
384 |
+
LP.Request({
|
385 |
type: 'update-section-item',
|
386 |
section_id: payload.section_id,
|
387 |
item: JSON.stringify(payload.item)
|
408 |
var id = payload.item.id;
|
409 |
context.commit('REMOVE_SECTION_ITEM', payload);
|
410 |
payload.item.temp_id = 0;
|
411 |
+
LP.Request({
|
412 |
+
type: 'remove-section-item',
|
413 |
+
section_id: payload.section_id,
|
414 |
+
item_id: id
|
415 |
+
}).then(
|
|
|
416 |
function () {
|
417 |
context.commit('REMOVE_SECTION_ITEM', payload);
|
418 |
}
|
423 |
var id = payload.item.id;
|
424 |
context.commit('REMOVE_SECTION_ITEM', payload);
|
425 |
payload.item.temp_id = 0;
|
426 |
+
LP.Request({
|
427 |
+
type: 'delete-section-item',
|
428 |
+
section_id: payload.section_id,
|
429 |
+
item_id: id
|
430 |
+
}).then(
|
|
|
431 |
function () {
|
432 |
context.commit('REMOVE_SECTION_ITEM', payload);
|
433 |
}
|
438 |
|
439 |
context.commit('APPEND_EMPTY_ITEM_TO_SECTION', payload)
|
440 |
//context.commit('UPDATE_SECTION_ITEMS', {section_id: payload.section_id, items: result.data});
|
441 |
+
LP.Request({
|
442 |
type: 'new-section-item',
|
443 |
section_id: payload.section_id,
|
444 |
item: JSON.stringify(payload.item)
|
465 |
},
|
466 |
|
467 |
updateSectionItems: function (context, payload) {
|
468 |
+
LP.Request({
|
469 |
type: 'update-section-items',
|
470 |
section_id: payload.section_id,
|
471 |
items: JSON.stringify(payload.items),
|
492 |
mutations: mutations,
|
493 |
actions: actions
|
494 |
};
|
495 |
+
})(LP_Helpers, lpAdminCourseEditorSettings);
|
496 |
|
497 |
|
498 |
/**
|
502 |
*
|
503 |
* @type {{namespaced, state, getters, mutations, actions}}
|
504 |
*/
|
505 |
+
var LP_Choose_Items_Modal_Store = (function (exports, helpers, data) {
|
506 |
var state = helpers.cloneObject(data.chooseItems);
|
507 |
state.sectionId = false;
|
508 |
state.pagination = '';
|
593 |
searchItems: function (context, payload) {
|
594 |
context.commit('SEARCH_ITEMS_REQUEST');
|
595 |
|
596 |
+
LP.Request({
|
597 |
type: 'search-items',
|
598 |
query: payload.query,
|
599 |
item_type: payload.type,
|
633 |
var items = context.getters.addedItems;
|
634 |
|
635 |
if (items.length > 0) {
|
636 |
+
LP.Request({
|
637 |
type: 'add-items-to-section',
|
638 |
section_id: context.getters.section,
|
639 |
items: JSON.stringify(items)
|
666 |
mutations: mutations,
|
667 |
actions: actions
|
668 |
}
|
669 |
+
})(window, LP_Helpers, lpAdminCourseEditorSettings);
|
670 |
|
671 |
/**
|
672 |
* Root Store
|
673 |
*
|
674 |
* @since 3.0.0
|
675 |
*/
|
676 |
+
(function (exports, helpers, data) {
|
677 |
var state = helpers.cloneObject(data.root);
|
678 |
|
679 |
state.status = 'success';
|
736 |
|
737 |
var actions = {
|
738 |
heartbeat: function (context) {
|
739 |
+
LP.Request({
|
740 |
type: 'heartbeat'
|
741 |
}).then(
|
742 |
function (response) {
|
753 |
var auto_draft = context.getters['autoDraft'];
|
754 |
|
755 |
if (auto_draft) {
|
756 |
+
LP.Request({
|
757 |
type: 'draft-course',
|
758 |
course: JSON.stringify(payload)
|
759 |
}).then(function (response) {
|
788 |
}
|
789 |
};
|
790 |
|
791 |
+
exports.LP_Curriculum_Store = new $Vuex.Store({
|
792 |
state: state,
|
793 |
getters: getters,
|
794 |
mutations: mutations,
|
800 |
}
|
801 |
});
|
802 |
|
803 |
+
})(window, LP_Helpers, lpAdminCourseEditorSettings);
|
804 |
|
805 |
/**
|
806 |
* HTTP
|
807 |
*
|
808 |
* @since 3.0.0
|
809 |
*/
|
810 |
+
(function (exports, $store) {
|
811 |
+
LP.Request = function (payload) {
|
812 |
payload['id'] = $store.getters.id;
|
813 |
payload['nonce'] = $store.getters.nonce;
|
814 |
payload['lp-ajax'] = $store.getters.action;
|
815 |
|
816 |
+
return $VueHTTP.post($store.getters.urlAjax,
|
817 |
payload,
|
818 |
{
|
819 |
emulateJSON: true,
|
823 |
});
|
824 |
};
|
825 |
|
826 |
+
$VueHTTP.interceptors.push(function (request, next) {
|
827 |
if (request.params['namespace'] !== 'LPCurriculumRequest') {
|
828 |
next();
|
829 |
return;
|
847 |
}
|
848 |
});
|
849 |
});
|
850 |
+
})(window, LP_Curriculum_Store);
|
851 |
|
852 |
/**
|
853 |
* Init app.
|
854 |
*
|
855 |
* @since 3.0.0
|
856 |
*/
|
857 |
+
(function ($, $store) {
|
858 |
$(document).ready(function () {
|
859 |
+
window.LP_Course_Editor = new $Vue({
|
860 |
el: '#admin-editor-lp_course',
|
861 |
template: '<lp-course-editor></lp-course-editor>'
|
862 |
});
|
863 |
});
|
864 |
+
})(jQuery, LP_Curriculum_Store);
|
865 |
|
866 |
});
|
assets/js/admin/meta-box-order.js
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
;
|
2 |
(function ($) {
|
3 |
"use strict";
|
|
|
|
|
4 |
$(document).ready(function () {
|
5 |
|
6 |
var $listItems = $('.list-order-items').find('tbody'),
|
@@ -60,7 +62,7 @@
|
|
60 |
$listItems.find('.no-order-items').show();
|
61 |
}
|
62 |
|
63 |
-
Vue.http.post(
|
64 |
window.location.href, {
|
65 |
order_id: $('#post_ID').val(),
|
66 |
items: [item_id],
|
@@ -102,7 +104,7 @@
|
|
102 |
callbacks: {
|
103 |
addItems: function () {
|
104 |
var that = this;
|
105 |
-
Vue.http.post(
|
106 |
window.location.href, {
|
107 |
order_id: this.contextId,
|
108 |
items: this.selected,
|
1 |
;
|
2 |
(function ($) {
|
3 |
"use strict";
|
4 |
+
window.$Vue = window.$Vue || Vue;
|
5 |
+
|
6 |
$(document).ready(function () {
|
7 |
|
8 |
var $listItems = $('.list-order-items').find('tbody'),
|
62 |
$listItems.find('.no-order-items').show();
|
63 |
}
|
64 |
|
65 |
+
$Vue.http.post(
|
66 |
window.location.href, {
|
67 |
order_id: $('#post_ID').val(),
|
68 |
items: [item_id],
|
104 |
callbacks: {
|
105 |
addItems: function () {
|
106 |
var that = this;
|
107 |
+
$Vue.http.post(
|
108 |
window.location.href, {
|
109 |
order_id: this.contextId,
|
110 |
items: this.selected,
|
assets/js/admin/modal-search-items.js
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
/*global jQuery, Backbone, _ */
|
2 |
-
(function ($,
|
3 |
'use strict';
|
|
|
|
|
4 |
|
5 |
$(document).ready(function () {
|
6 |
-
Vue.component('learn-press-modal-search-items', {
|
7 |
template: '#learn-press-modal-search-items',
|
8 |
data: function () {
|
9 |
return {
|
@@ -37,7 +39,7 @@
|
|
37 |
search: _.debounce(function (term) {
|
38 |
$('#modal-search-items').addClass('loading');
|
39 |
var that = this;
|
40 |
-
|
41 |
window.location.href, {
|
42 |
type: this.postType,
|
43 |
context: this.context,
|
@@ -112,7 +114,7 @@
|
|
112 |
}
|
113 |
});
|
114 |
|
115 |
-
window.LP.$modalSearchItems = new Vue({
|
116 |
el: '#vue-modal-search-items',
|
117 |
data: {
|
118 |
show: false,
|
@@ -140,4 +142,4 @@
|
|
140 |
}
|
141 |
});
|
142 |
});
|
143 |
-
}(jQuery,
|
1 |
/*global jQuery, Backbone, _ */
|
2 |
+
(function ($, _) {
|
3 |
'use strict';
|
4 |
+
window.$Vue = window.$Vue || Vue;
|
5 |
+
var $VueHTTP = $Vue.http;
|
6 |
|
7 |
$(document).ready(function () {
|
8 |
+
$Vue.component('learn-press-modal-search-items', {
|
9 |
template: '#learn-press-modal-search-items',
|
10 |
data: function () {
|
11 |
return {
|
39 |
search: _.debounce(function (term) {
|
40 |
$('#modal-search-items').addClass('loading');
|
41 |
var that = this;
|
42 |
+
$VueHTTP.post(
|
43 |
window.location.href, {
|
44 |
type: this.postType,
|
45 |
context: this.context,
|
114 |
}
|
115 |
});
|
116 |
|
117 |
+
window.LP.$modalSearchItems = new $Vue({
|
118 |
el: '#vue-modal-search-items',
|
119 |
data: {
|
120 |
show: false,
|
142 |
}
|
143 |
});
|
144 |
});
|
145 |
+
}(jQuery, _));
|
assets/js/admin/modal-search-users.js
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
/*global jQuery, Backbone, _ */
|
2 |
-
( function ($,
|
3 |
'use strict';
|
|
|
|
|
|
|
4 |
|
5 |
$(document).ready(function () {
|
6 |
-
Vue.component('learn-press-modal-search-users', {
|
7 |
template: '#learn-press-modal-search-users',
|
8 |
data: function () {
|
9 |
return {
|
@@ -32,7 +35,7 @@
|
|
32 |
},
|
33 |
search: _.debounce(function (term) {
|
34 |
var that = this;
|
35 |
-
|
36 |
window.location.href, {
|
37 |
type: this.postType,
|
38 |
context: this.context,
|
@@ -114,7 +117,7 @@
|
|
114 |
}
|
115 |
});
|
116 |
|
117 |
-
window.LP.$modalSearchUsers = new Vue({
|
118 |
el: '#vue-modal-search-users',
|
119 |
data: {
|
120 |
show: false,
|
@@ -142,4 +145,4 @@
|
|
142 |
});
|
143 |
});
|
144 |
|
145 |
-
}(jQuery,
|
1 |
/*global jQuery, Backbone, _ */
|
2 |
+
( function ($, _) {
|
3 |
'use strict';
|
4 |
+
window.$Vue = window.$Vue || Vue;
|
5 |
+
|
6 |
+
var $VueHTTP = $Vue.http;
|
7 |
|
8 |
$(document).ready(function () {
|
9 |
+
$Vue.component('learn-press-modal-search-users', {
|
10 |
template: '#learn-press-modal-search-users',
|
11 |
data: function () {
|
12 |
return {
|
35 |
},
|
36 |
search: _.debounce(function (term) {
|
37 |
var that = this;
|
38 |
+
$VueHTTP.post(
|
39 |
window.location.href, {
|
40 |
type: this.postType,
|
41 |
context: this.context,
|
117 |
}
|
118 |
});
|
119 |
|
120 |
+
window.LP.$modalSearchUsers = new $Vue({
|
121 |
el: '#vue-modal-search-users',
|
122 |
data: {
|
123 |
show: false,
|
145 |
});
|
146 |
});
|
147 |
|
148 |
+
}(jQuery, _));
|
assets/js/admin/question-editor.js
CHANGED
@@ -15,12 +15,17 @@
|
|
15 |
};
|
16 |
})(window);
|
17 |
|
|
|
|
|
|
|
|
|
|
|
18 |
/**
|
19 |
* Root Store
|
20 |
*
|
21 |
* @since 3.0.0
|
22 |
*/
|
23 |
-
(function (exports,
|
24 |
|
25 |
var state = helpers.cloneObject(data.root),
|
26 |
i18n = helpers.cloneObject(data.i18n);
|
@@ -129,7 +134,7 @@
|
|
129 |
var actions = {
|
130 |
|
131 |
changeQuestionType: function (context, payload) {
|
132 |
-
|
133 |
type: 'change-question-type',
|
134 |
question_type: payload.type,
|
135 |
draft_question: context.getters.autoDraft ? JSON.stringify(payload.question) : ''
|
@@ -144,7 +149,7 @@
|
|
144 |
},
|
145 |
|
146 |
updateAnswersOrder: function (context, order) {
|
147 |
-
|
148 |
type: 'sort-answer',
|
149 |
order: order
|
150 |
}).then(
|
@@ -162,14 +167,14 @@
|
|
162 |
return;
|
163 |
}
|
164 |
answer = JSON.stringify(answer);
|
165 |
-
|
166 |
type: 'update-answer-title',
|
167 |
answer: answer
|
168 |
})
|
169 |
},
|
170 |
|
171 |
updateCorrectAnswer: function (context, correct) {
|
172 |
-
|
173 |
type: 'change-correct',
|
174 |
correct: JSON.stringify(correct)
|
175 |
}).then(
|
@@ -186,7 +191,7 @@
|
|
186 |
deleteAnswer: function (context, payload) {
|
187 |
|
188 |
context.commit('DELETE_ANSWER', payload.id);
|
189 |
-
|
190 |
type: 'delete-answer',
|
191 |
answer_id: payload.id
|
192 |
}).then(
|
@@ -203,7 +208,7 @@
|
|
203 |
|
204 |
newAnswer: function (context, data) {
|
205 |
context.commit('ADD_NEW_ANSWER', data.answer);
|
206 |
-
|
207 |
type: 'new-answer'
|
208 |
}).then(
|
209 |
function (response) {
|
@@ -236,14 +241,14 @@
|
|
236 |
}
|
237 |
};
|
238 |
|
239 |
-
exports.LP_Question_Store = new Vuex.Store({
|
240 |
state: state,
|
241 |
getters: getters,
|
242 |
mutations: mutations,
|
243 |
actions: actions
|
244 |
});
|
245 |
|
246 |
-
})(window,
|
247 |
|
248 |
|
249 |
/**
|
@@ -251,11 +256,11 @@
|
|
251 |
*
|
252 |
* @since 3.0.0
|
253 |
*/
|
254 |
-
(function (exports,
|
255 |
var $ = jQuery,
|
256 |
$publishingAction = null;
|
257 |
|
258 |
-
|
259 |
$publishingAction = $('#publishing-action');
|
260 |
|
261 |
payload['id'] = $store.getters.id;
|
@@ -267,7 +272,7 @@
|
|
267 |
$publishingAction.find('.spinner').addClass('is-active');
|
268 |
$publishingAction.addClass('code-' + payload['code']);
|
269 |
|
270 |
-
return
|
271 |
payload,
|
272 |
{
|
273 |
emulateJSON: true,
|
@@ -278,7 +283,7 @@
|
|
278 |
});
|
279 |
};
|
280 |
|
281 |
-
|
282 |
if (request.params['namespace'] !== 'LPQuestionEditorRequest') {
|
283 |
next();
|
284 |
return;
|
@@ -307,7 +312,7 @@
|
|
307 |
|
308 |
});
|
309 |
});
|
310 |
-
})(window,
|
311 |
|
312 |
|
313 |
/**
|
@@ -315,11 +320,11 @@
|
|
315 |
*
|
316 |
* @since 3.0.0
|
317 |
*/
|
318 |
-
(function ($,
|
319 |
$(document).ready(function () {
|
320 |
-
window.LP_Question_Editor = new Vue({
|
321 |
el: '#admin-editor-lp_question',
|
322 |
template: '<lp-question-editor></lp-question-editor>'
|
323 |
});
|
324 |
});
|
325 |
-
})(jQuery,
|
15 |
};
|
16 |
})(window);
|
17 |
|
18 |
+
window.$Vue = window.$Vue || Vue;
|
19 |
+
window.$Vuex = window.$Vuex || Vuex;
|
20 |
+
|
21 |
+
var $VueHTTP = Vue.http;
|
22 |
+
|
23 |
/**
|
24 |
* Root Store
|
25 |
*
|
26 |
* @since 3.0.0
|
27 |
*/
|
28 |
+
(function (exports, helpers, data) {
|
29 |
|
30 |
var state = helpers.cloneObject(data.root),
|
31 |
i18n = helpers.cloneObject(data.i18n);
|
134 |
var actions = {
|
135 |
|
136 |
changeQuestionType: function (context, payload) {
|
137 |
+
LP.Request({
|
138 |
type: 'change-question-type',
|
139 |
question_type: payload.type,
|
140 |
draft_question: context.getters.autoDraft ? JSON.stringify(payload.question) : ''
|
149 |
},
|
150 |
|
151 |
updateAnswersOrder: function (context, order) {
|
152 |
+
LP.Request({
|
153 |
type: 'sort-answer',
|
154 |
order: order
|
155 |
}).then(
|
167 |
return;
|
168 |
}
|
169 |
answer = JSON.stringify(answer);
|
170 |
+
LP.Request({
|
171 |
type: 'update-answer-title',
|
172 |
answer: answer
|
173 |
})
|
174 |
},
|
175 |
|
176 |
updateCorrectAnswer: function (context, correct) {
|
177 |
+
LP.Request({
|
178 |
type: 'change-correct',
|
179 |
correct: JSON.stringify(correct)
|
180 |
}).then(
|
191 |
deleteAnswer: function (context, payload) {
|
192 |
|
193 |
context.commit('DELETE_ANSWER', payload.id);
|
194 |
+
LP.Request({
|
195 |
type: 'delete-answer',
|
196 |
answer_id: payload.id
|
197 |
}).then(
|
208 |
|
209 |
newAnswer: function (context, data) {
|
210 |
context.commit('ADD_NEW_ANSWER', data.answer);
|
211 |
+
LP.Request({
|
212 |
type: 'new-answer'
|
213 |
}).then(
|
214 |
function (response) {
|
241 |
}
|
242 |
};
|
243 |
|
244 |
+
exports.LP_Question_Store = new $Vuex.Store({
|
245 |
state: state,
|
246 |
getters: getters,
|
247 |
mutations: mutations,
|
248 |
actions: actions
|
249 |
});
|
250 |
|
251 |
+
})(window, LP_Helpers, lp_question_editor);
|
252 |
|
253 |
|
254 |
/**
|
256 |
*
|
257 |
* @since 3.0.0
|
258 |
*/
|
259 |
+
(function (exports, $store) {
|
260 |
var $ = jQuery,
|
261 |
$publishingAction = null;
|
262 |
|
263 |
+
LP.Request = function (payload) {
|
264 |
$publishingAction = $('#publishing-action');
|
265 |
|
266 |
payload['id'] = $store.getters.id;
|
272 |
$publishingAction.find('.spinner').addClass('is-active');
|
273 |
$publishingAction.addClass('code-' + payload['code']);
|
274 |
|
275 |
+
return $VueHTTP.post($store.getters.urlAjax,
|
276 |
payload,
|
277 |
{
|
278 |
emulateJSON: true,
|
283 |
});
|
284 |
};
|
285 |
|
286 |
+
$VueHTTP.interceptors.push(function (request, next) {
|
287 |
if (request.params['namespace'] !== 'LPQuestionEditorRequest') {
|
288 |
next();
|
289 |
return;
|
312 |
|
313 |
});
|
314 |
});
|
315 |
+
})(window, LP_Question_Store);
|
316 |
|
317 |
|
318 |
/**
|
320 |
*
|
321 |
* @since 3.0.0
|
322 |
*/
|
323 |
+
(function ($, $store) {
|
324 |
$(document).ready(function () {
|
325 |
+
window.LP_Question_Editor = new $Vue({
|
326 |
el: '#admin-editor-lp_question',
|
327 |
template: '<lp-question-editor></lp-question-editor>'
|
328 |
});
|
329 |
});
|
330 |
+
})(jQuery, LP_Question_Store);
|
assets/js/admin/quiz-editor.js
CHANGED
@@ -15,12 +15,17 @@
|
|
15 |
};
|
16 |
})(window);
|
17 |
|
|
|
|
|
|
|
|
|
|
|
18 |
/**
|
19 |
* Choose quiz items modal store.
|
20 |
*
|
21 |
* @since 3.0.0
|
22 |
*/
|
23 |
-
var LP_Choose_Quiz_Items_Modal_Store = (function (exports,
|
24 |
|
25 |
var state = helpers.cloneObject(data.chooseItems);
|
26 |
state.quizId = false;
|
@@ -114,13 +119,12 @@ var LP_Choose_Quiz_Items_Modal_Store = (function (exports, Vue, helpers, data) {
|
|
114 |
searchItems: function (context, payload) {
|
115 |
context.commit('SEARCH_ITEM_REQUEST');
|
116 |
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
}).then(
|
124 |
function (response) {
|
125 |
var result = response.body;
|
126 |
|
@@ -156,7 +160,7 @@ var LP_Choose_Quiz_Items_Modal_Store = (function (exports, Vue, helpers, data) {
|
|
156 |
var items = context.getters.addedItems;
|
157 |
|
158 |
if (items.length > 0) {
|
159 |
-
|
160 |
type: 'add-questions-to-quiz',
|
161 |
items: JSON.stringify(items),
|
162 |
draft_quiz: JSON.stringify(quiz)
|
@@ -188,14 +192,14 @@ var LP_Choose_Quiz_Items_Modal_Store = (function (exports, Vue, helpers, data) {
|
|
188 |
actions: actions
|
189 |
}
|
190 |
|
191 |
-
})(window,
|
192 |
|
193 |
/**
|
194 |
* I18n Store
|
195 |
*
|
196 |
* @since 3.0.0
|
197 |
*/
|
198 |
-
var LP_Quiz_i18n_Store = (function (
|
199 |
|
200 |
var state = helpers.cloneObject(data.i18n);
|
201 |
|
@@ -211,14 +215,14 @@ var LP_Quiz_i18n_Store = (function (Vue, helpers, data) {
|
|
211 |
getters: getters
|
212 |
}
|
213 |
|
214 |
-
})(
|
215 |
|
216 |
/**
|
217 |
* List quiz questions store.
|
218 |
*
|
219 |
* @since 3.0.0
|
220 |
*/
|
221 |
-
var LP_List_Quiz_Questions_Store = (function (
|
222 |
|
223 |
var state = helpers.cloneObject(data.listQuestions);
|
224 |
|
@@ -300,7 +304,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
300 |
for (var i = 0, n = question.answers.length; i < n; i++) {
|
301 |
if (question.answers[i].question_answer_id == payload.answer.temp_id) {
|
302 |
found = true;
|
303 |
-
Vue.set(question.answers, i, payload.answer);
|
304 |
}
|
305 |
}
|
306 |
}
|
@@ -328,7 +332,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
328 |
if (question.temp_id) {
|
329 |
for (var i = 0, n = state.questions.length; i < n; i++) {
|
330 |
if (state.questions[i].id === question.temp_id) {
|
331 |
-
Vue.set(state.questions, i, question);
|
332 |
found = true;
|
333 |
break;
|
334 |
}
|
@@ -413,23 +417,23 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
413 |
})
|
414 |
},
|
415 |
'UPDATE_QUESTION_REQUEST': function (state, questionId) {
|
416 |
-
Vue.set(state.statusUpdateQuestionItem, questionId, 'updating');
|
417 |
},
|
418 |
'UPDATE_QUESTION_SUCCESS': function (state, questionID) {
|
419 |
-
Vue.set(state.statusUpdateQuestionItem, questionID, 'successful');
|
420 |
},
|
421 |
'UPDATE_QUESTION_FAILURE': function (state, questionID) {
|
422 |
-
Vue.set(state.statusUpdateQuestionItem, questionID, 'failed')
|
423 |
},
|
424 |
|
425 |
'UPDATE_QUESTION_ANSWER_REQUEST': function (state, question_id) {
|
426 |
-
Vue.set(state.statusUpdateQuestionAnswer, question_id, 'updating');
|
427 |
},
|
428 |
'UPDATE_QUESTION_ANSWER_SUCCESS': function (state, question_id) {
|
429 |
-
Vue.set(state.statusUpdateQuestionAnswer, question_id, 'successful');
|
430 |
},
|
431 |
'UPDATE_QUESTION_ANSWER_FAIL': function (state, question_id) {
|
432 |
-
Vue.set(state.statusUpdateQuestionAnswer, question_id, 'failed');
|
433 |
},
|
434 |
'DELETE_ANSWER': function (state, data) {
|
435 |
state.questions.map(function (question, index) {
|
@@ -459,14 +463,14 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
459 |
context.commit('CLOSE_LIST_QUESTIONS');
|
460 |
}
|
461 |
|
462 |
-
|
463 |
type: 'hidden-questions',
|
464 |
hidden: context.getters['hiddenQuestions']
|
465 |
})
|
466 |
},
|
467 |
|
468 |
updateQuizQuestionsHidden: function (context, data) {
|
469 |
-
|
470 |
type: 'update-quiz-questions-hidden'
|
471 |
}));
|
472 |
},
|
@@ -475,7 +479,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
475 |
var newQuestion = JSON.parse(JSON.stringify(payload.question));
|
476 |
newQuestion.settings = {};
|
477 |
context.commit('ADD_NEW_QUESTION', newQuestion);
|
478 |
-
|
479 |
type: 'new-question',
|
480 |
question: JSON.stringify(payload.question),
|
481 |
draft_quiz: JSON.stringify(payload.quiz)
|
@@ -499,7 +503,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
499 |
},
|
500 |
|
501 |
updateQuestionsOrder: function (context, order) {
|
502 |
-
|
503 |
type: 'sort-questions',
|
504 |
order: JSON.stringify(order)
|
505 |
}).then(
|
@@ -516,7 +520,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
516 |
|
517 |
context.commit('UPDATE_QUESTION_REQUEST', question.id);
|
518 |
|
519 |
-
|
520 |
type: 'update-question-title',
|
521 |
question: JSON.stringify(question)
|
522 |
}).then(
|
@@ -533,7 +537,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
533 |
|
534 |
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
535 |
|
536 |
-
|
537 |
type: 'change-question-type',
|
538 |
question_id: payload.question_id,
|
539 |
question_type: payload.type
|
@@ -556,7 +560,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
556 |
},
|
557 |
|
558 |
cloneQuestion: function (context, question) {
|
559 |
-
|
560 |
type: 'clone-question',
|
561 |
question: JSON.stringify(question)
|
562 |
}).then(
|
@@ -581,7 +585,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
581 |
question.temp_id = LP.uniqueId();
|
582 |
context.commit('REMOVE_QUESTION', question);
|
583 |
|
584 |
-
|
585 |
type: 'remove-question',
|
586 |
question_id: question_id
|
587 |
}).then(
|
@@ -604,11 +608,10 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
604 |
var question_id = question.id;
|
605 |
question.temp_id = LP.uniqueId();
|
606 |
context.commit('REMOVE_QUESTION', question);
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
})
|
612 |
.then(function () {
|
613 |
question.id = question.temp_id;
|
614 |
question.temp_id = 0;
|
@@ -627,7 +630,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
627 |
context.commit('OPEN_QUESTION', question);
|
628 |
}
|
629 |
|
630 |
-
|
631 |
type: 'hidden-questions',
|
632 |
hidden: context.getters['hiddenQuestions']
|
633 |
}
|
@@ -637,7 +640,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
637 |
updateQuestionAnswersOrder: function (context, payload) {
|
638 |
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
639 |
|
640 |
-
|
641 |
type: 'sort-question-answers',
|
642 |
question_id: payload.question_id,
|
643 |
order: JSON.stringify(payload.order)
|
@@ -659,7 +662,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
659 |
|
660 |
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
661 |
|
662 |
-
|
663 |
type: 'update-question-answer-title',
|
664 |
question_id: parseInt(payload.question_id),
|
665 |
answer: JSON.stringify(payload.answer)
|
@@ -678,7 +681,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
678 |
updateQuestionCorrectAnswer: function (context, payload) {
|
679 |
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
680 |
|
681 |
-
|
682 |
type: 'change-question-correct-answer',
|
683 |
question_id: payload.question_id,
|
684 |
correct: JSON.stringify(payload.correct)
|
@@ -702,7 +705,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
702 |
context.commit('DELETE_ANSWER', payload);
|
703 |
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
704 |
|
705 |
-
|
706 |
type: 'delete-question-answer',
|
707 |
question_id: payload.question_id,
|
708 |
answer_id: payload.answer_id
|
@@ -734,12 +737,11 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
734 |
question_id: question_id,
|
735 |
answer: {'text': LP_Quiz_Store.getters['i18n/all'].new_option, 'question_answer_id': temp_id}
|
736 |
});
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
})
|
743 |
.then(
|
744 |
function (response) {
|
745 |
var result = response.body;
|
@@ -764,7 +766,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
764 |
|
765 |
context.commit('UPDATE_QUESTION_REQUEST', question.id);
|
766 |
|
767 |
-
|
768 |
type: 'update-question-content',
|
769 |
question: JSON.stringify(question)
|
770 |
}).then(
|
@@ -781,7 +783,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
781 |
|
782 |
context.commit('UPDATE_QUESTION_REQUEST', payload.question.id);
|
783 |
|
784 |
-
|
785 |
type: 'update-question-meta',
|
786 |
question: JSON.stringify(payload.question),
|
787 |
meta_key: payload.meta_key
|
@@ -804,14 +806,14 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
804 |
actions: actions
|
805 |
}
|
806 |
|
807 |
-
})(
|
808 |
|
809 |
/**
|
810 |
* Root Store
|
811 |
*
|
812 |
* @since 3.0.0
|
813 |
*/
|
814 |
-
(function (exports,
|
815 |
|
816 |
var state = helpers.cloneObject(data.root);
|
817 |
|
@@ -871,11 +873,10 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
871 |
|
872 |
var actions = {
|
873 |
heartbeat: function (context) {
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
)
|
879 |
.then(
|
880 |
function (response) {
|
881 |
var result = response.body;
|
@@ -906,7 +907,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
906 |
}
|
907 |
};
|
908 |
|
909 |
-
exports.LP_Quiz_Store = new Vuex.Store({
|
910 |
state: state,
|
911 |
getters: getters,
|
912 |
mutations: mutations,
|
@@ -918,7 +919,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
918 |
}
|
919 |
});
|
920 |
|
921 |
-
})(window,
|
922 |
|
923 |
|
924 |
/**
|
@@ -926,11 +927,11 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
926 |
*
|
927 |
* @since 3.0.0
|
928 |
*/
|
929 |
-
(function (exports,
|
930 |
var $ = jQuery,
|
931 |
$publishingAction = null;
|
932 |
|
933 |
-
|
934 |
payload['id'] = $store.getters.id;
|
935 |
payload['nonce'] = $store.getters.nonce;
|
936 |
payload['lp-ajax'] = $store.getters.action;
|
@@ -942,7 +943,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
942 |
$publishingAction.find('.spinner').addClass('is-active');
|
943 |
$publishingAction.addClass('code-' + payload['code']);
|
944 |
|
945 |
-
return
|
946 |
payload, {
|
947 |
emulateJSON: true,
|
948 |
params: {
|
@@ -952,7 +953,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
952 |
});
|
953 |
};
|
954 |
|
955 |
-
|
956 |
if (request.params['namespace'] !== 'LPListQuizQuestionsRequest') {
|
957 |
next();
|
958 |
return;
|
@@ -984,18 +985,18 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
|
|
984 |
});
|
985 |
});
|
986 |
|
987 |
-
})(window,
|
988 |
|
989 |
/**
|
990 |
* Init app.
|
991 |
*
|
992 |
* @since 3.0.0
|
993 |
*/
|
994 |
-
(function ($,
|
995 |
$(document).ready(function () {
|
996 |
-
window.LP_Quiz_Editor = new Vue({
|
997 |
el: '#admin-editor-lp_quiz',
|
998 |
template: '<lp-quiz-editor></lp-quiz-editor>'
|
999 |
});
|
1000 |
});
|
1001 |
-
})(jQuery,
|
15 |
};
|
16 |
})(window);
|
17 |
|
18 |
+
window.$Vue = window.$Vue || Vue;
|
19 |
+
window.$Vuex = window.$Vuex || Vuex;
|
20 |
+
|
21 |
+
var $VueHTTP = Vue.http;
|
22 |
+
|
23 |
/**
|
24 |
* Choose quiz items modal store.
|
25 |
*
|
26 |
* @since 3.0.0
|
27 |
*/
|
28 |
+
var LP_Choose_Quiz_Items_Modal_Store = (function (exports, helpers, data) {
|
29 |
|
30 |
var state = helpers.cloneObject(data.chooseItems);
|
31 |
state.quizId = false;
|
119 |
searchItems: function (context, payload) {
|
120 |
context.commit('SEARCH_ITEM_REQUEST');
|
121 |
|
122 |
+
LP.Request({
|
123 |
+
type: 'search-items',
|
124 |
+
query: payload.query,
|
125 |
+
page: payload.page,
|
126 |
+
exclude: JSON.stringify([])
|
127 |
+
}).then(
|
|
|
128 |
function (response) {
|
129 |
var result = response.body;
|
130 |
|
160 |
var items = context.getters.addedItems;
|
161 |
|
162 |
if (items.length > 0) {
|
163 |
+
LP.Request({
|
164 |
type: 'add-questions-to-quiz',
|
165 |
items: JSON.stringify(items),
|
166 |
draft_quiz: JSON.stringify(quiz)
|
192 |
actions: actions
|
193 |
}
|
194 |
|
195 |
+
})(window, LP_Helpers, lp_quiz_editor);
|
196 |
|
197 |
/**
|
198 |
* I18n Store
|
199 |
*
|
200 |
* @since 3.0.0
|
201 |
*/
|
202 |
+
var LP_Quiz_i18n_Store = (function (helpers, data) {
|
203 |
|
204 |
var state = helpers.cloneObject(data.i18n);
|
205 |
|
215 |
getters: getters
|
216 |
}
|
217 |
|
218 |
+
})(LP_Helpers, lp_quiz_editor);
|
219 |
|
220 |
/**
|
221 |
* List quiz questions store.
|
222 |
*
|
223 |
* @since 3.0.0
|
224 |
*/
|
225 |
+
var LP_List_Quiz_Questions_Store = (function (helpers, data, $) {
|
226 |
|
227 |
var state = helpers.cloneObject(data.listQuestions);
|
228 |
|
304 |
for (var i = 0, n = question.answers.length; i < n; i++) {
|
305 |
if (question.answers[i].question_answer_id == payload.answer.temp_id) {
|
306 |
found = true;
|
307 |
+
$Vue.set(question.answers, i, payload.answer);
|
308 |
}
|
309 |
}
|
310 |
}
|
332 |
if (question.temp_id) {
|
333 |
for (var i = 0, n = state.questions.length; i < n; i++) {
|
334 |
if (state.questions[i].id === question.temp_id) {
|
335 |
+
$Vue.set(state.questions, i, question);
|
336 |
found = true;
|
337 |
break;
|
338 |
}
|
417 |
})
|
418 |
},
|
419 |
'UPDATE_QUESTION_REQUEST': function (state, questionId) {
|
420 |
+
$Vue.set(state.statusUpdateQuestionItem, questionId, 'updating');
|
421 |
},
|
422 |
'UPDATE_QUESTION_SUCCESS': function (state, questionID) {
|
423 |
+
$Vue.set(state.statusUpdateQuestionItem, questionID, 'successful');
|
424 |
},
|
425 |
'UPDATE_QUESTION_FAILURE': function (state, questionID) {
|
426 |
+
$Vue.set(state.statusUpdateQuestionItem, questionID, 'failed')
|
427 |
},
|
428 |
|
429 |
'UPDATE_QUESTION_ANSWER_REQUEST': function (state, question_id) {
|
430 |
+
$Vue.set(state.statusUpdateQuestionAnswer, question_id, 'updating');
|
431 |
},
|
432 |
'UPDATE_QUESTION_ANSWER_SUCCESS': function (state, question_id) {
|
433 |
+
$Vue.set(state.statusUpdateQuestionAnswer, question_id, 'successful');
|
434 |
},
|
435 |
'UPDATE_QUESTION_ANSWER_FAIL': function (state, question_id) {
|
436 |
+
$Vue.set(state.statusUpdateQuestionAnswer, question_id, 'failed');
|
437 |
},
|
438 |
'DELETE_ANSWER': function (state, data) {
|
439 |
state.questions.map(function (question, index) {
|
463 |
context.commit('CLOSE_LIST_QUESTIONS');
|
464 |
}
|
465 |
|
466 |
+
LP.Request({
|
467 |
type: 'hidden-questions',
|
468 |
hidden: context.getters['hiddenQuestions']
|
469 |
})
|
470 |
},
|
471 |
|
472 |
updateQuizQuestionsHidden: function (context, data) {
|
473 |
+
LP.Request($.extend({}, data, {
|
474 |
type: 'update-quiz-questions-hidden'
|
475 |
}));
|
476 |
},
|
479 |
var newQuestion = JSON.parse(JSON.stringify(payload.question));
|
480 |
newQuestion.settings = {};
|
481 |
context.commit('ADD_NEW_QUESTION', newQuestion);
|
482 |
+
LP.Request({
|
483 |
type: 'new-question',
|
484 |
question: JSON.stringify(payload.question),
|
485 |
draft_quiz: JSON.stringify(payload.quiz)
|
503 |
},
|
504 |
|
505 |
updateQuestionsOrder: function (context, order) {
|
506 |
+
LP.Request({
|
507 |
type: 'sort-questions',
|
508 |
order: JSON.stringify(order)
|
509 |
}).then(
|
520 |
|
521 |
context.commit('UPDATE_QUESTION_REQUEST', question.id);
|
522 |
|
523 |
+
LP.Request({
|
524 |
type: 'update-question-title',
|
525 |
question: JSON.stringify(question)
|
526 |
}).then(
|
537 |
|
538 |
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
539 |
|
540 |
+
LP.Request({
|
541 |
type: 'change-question-type',
|
542 |
question_id: payload.question_id,
|
543 |
question_type: payload.type
|
560 |
},
|
561 |
|
562 |
cloneQuestion: function (context, question) {
|
563 |
+
LP.Request({
|
564 |
type: 'clone-question',
|
565 |
question: JSON.stringify(question)
|
566 |
}).then(
|
585 |
question.temp_id = LP.uniqueId();
|
586 |
context.commit('REMOVE_QUESTION', question);
|
587 |
|
588 |
+
LP.Request({
|
589 |
type: 'remove-question',
|
590 |
question_id: question_id
|
591 |
}).then(
|
608 |
var question_id = question.id;
|
609 |
question.temp_id = LP.uniqueId();
|
610 |
context.commit('REMOVE_QUESTION', question);
|
611 |
+
LP.Request({
|
612 |
+
type: 'delete-question',
|
613 |
+
question_id: question_id
|
614 |
+
})
|
|
|
615 |
.then(function () {
|
616 |
question.id = question.temp_id;
|
617 |
question.temp_id = 0;
|
630 |
context.commit('OPEN_QUESTION', question);
|
631 |
}
|
632 |
|
633 |
+
LP.Request({
|
634 |
type: 'hidden-questions',
|
635 |
hidden: context.getters['hiddenQuestions']
|
636 |
}
|
640 |
updateQuestionAnswersOrder: function (context, payload) {
|
641 |
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
642 |
|
643 |
+
LP.Request({
|
644 |
type: 'sort-question-answers',
|
645 |
question_id: payload.question_id,
|
646 |
order: JSON.stringify(payload.order)
|
662 |
|
663 |
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
664 |
|
665 |
+
LP.Request({
|
666 |
type: 'update-question-answer-title',
|
667 |
question_id: parseInt(payload.question_id),
|
668 |
answer: JSON.stringify(payload.answer)
|
681 |
updateQuestionCorrectAnswer: function (context, payload) {
|
682 |
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
683 |
|
684 |
+
LP.Request({
|
685 |
type: 'change-question-correct-answer',
|
686 |
question_id: payload.question_id,
|
687 |
correct: JSON.stringify(payload.correct)
|
705 |
context.commit('DELETE_ANSWER', payload);
|
706 |
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
707 |
|
708 |
+
LP.Request({
|
709 |
type: 'delete-question-answer',
|
710 |
question_id: payload.question_id,
|
711 |
answer_id: payload.answer_id
|
737 |
question_id: question_id,
|
738 |
answer: {'text': LP_Quiz_Store.getters['i18n/all'].new_option, 'question_answer_id': temp_id}
|
739 |
});
|
740 |
+
LP.Request({
|
741 |
+
type: 'new-question-answer',
|
742 |
+
question_id: question_id,
|
743 |
+
question_answer_id: temp_id
|
744 |
+
})
|
|
|
745 |
.then(
|
746 |
function (response) {
|
747 |
var result = response.body;
|
766 |
|
767 |
context.commit('UPDATE_QUESTION_REQUEST', question.id);
|
768 |
|
769 |
+
LP.Request({
|
770 |
type: 'update-question-content',
|
771 |
question: JSON.stringify(question)
|
772 |
}).then(
|
783 |
|
784 |
context.commit('UPDATE_QUESTION_REQUEST', payload.question.id);
|
785 |
|
786 |
+
LP.Request({
|
787 |
type: 'update-question-meta',
|
788 |
question: JSON.stringify(payload.question),
|
789 |
meta_key: payload.meta_key
|
806 |
actions: actions
|
807 |
}
|
808 |
|
809 |
+
})(LP_Helpers, lp_quiz_editor, jQuery);
|
810 |
|
811 |
/**
|
812 |
* Root Store
|
813 |
*
|
814 |
* @since 3.0.0
|
815 |
*/
|
816 |
+
(function (exports, helpers, data) {
|
817 |
|
818 |
var state = helpers.cloneObject(data.root);
|
819 |
|
873 |
|
874 |
var actions = {
|
875 |
heartbeat: function (context) {
|
876 |
+
LP.Request({
|
877 |
+
type: 'heartbeat'
|
878 |
+
}
|
879 |
+
)
|
|
|
880 |
.then(
|
881 |
function (response) {
|
882 |
var result = response.body;
|
907 |
}
|
908 |
};
|
909 |
|
910 |
+
exports.LP_Quiz_Store = new $Vuex.Store({
|
911 |
state: state,
|
912 |
getters: getters,
|
913 |
mutations: mutations,
|
919 |
}
|
920 |
});
|
921 |
|
922 |
+
})(window, LP_Helpers, lp_quiz_editor);
|
923 |
|
924 |
|
925 |
/**
|
927 |
*
|
928 |
* @since 3.0.0
|
929 |
*/
|
930 |
+
(function (exports, $store) {
|
931 |
var $ = jQuery,
|
932 |
$publishingAction = null;
|
933 |
|
934 |
+
LP.Request = function (payload) {
|
935 |
payload['id'] = $store.getters.id;
|
936 |
payload['nonce'] = $store.getters.nonce;
|
937 |
payload['lp-ajax'] = $store.getters.action;
|
943 |
$publishingAction.find('.spinner').addClass('is-active');
|
944 |
$publishingAction.addClass('code-' + payload['code']);
|
945 |
|
946 |
+
return $VueHTTP.post($store.getters.urlAjax,
|
947 |
payload, {
|
948 |
emulateJSON: true,
|
949 |
params: {
|
953 |
});
|
954 |
};
|
955 |
|
956 |
+
$VueHTTP.interceptors.push(function (request, next) {
|
957 |
if (request.params['namespace'] !== 'LPListQuizQuestionsRequest') {
|
958 |
next();
|
959 |
return;
|
985 |
});
|
986 |
});
|
987 |
|
988 |
+
})(window, LP_Quiz_Store);
|
989 |
|
990 |
/**
|
991 |
* Init app.
|
992 |
*
|
993 |
* @since 3.0.0
|
994 |
*/
|
995 |
+
(function ($, $store) {
|
996 |
$(document).ready(function () {
|
997 |
+
window.LP_Quiz_Editor = new $Vue({
|
998 |
el: '#admin-editor-lp_quiz',
|
999 |
template: '<lp-quiz-editor></lp-quiz-editor>'
|
1000 |
});
|
1001 |
});
|
1002 |
+
})(jQuery, LP_Quiz_Store);
|
assets/js/admin/statistic.js
CHANGED
@@ -131,7 +131,6 @@
|
|
131 |
* @returns {Boolean}
|
132 |
*/
|
133 |
var LP_Statistic_Orders_Upgrade_Chart =function(){
|
134 |
-
console.log('abc');
|
135 |
var type = '', from = '', to = '', report_sales_by = 'date', cat_id = 0, course_id = 0;
|
136 |
report_sales_by = $('#report_sales_by').val();
|
137 |
$container = $('#learn-press-chart');
|
131 |
* @returns {Boolean}
|
132 |
*/
|
133 |
var LP_Statistic_Orders_Upgrade_Chart =function(){
|
|
|
134 |
var type = '', from = '', to = '', report_sales_by = 'date', cat_id = 0, course_id = 0;
|
135 |
report_sales_by = $('#report_sales_by').val();
|
136 |
$container = $('#learn-press-chart');
|
assets/js/admin/sync-data.js
CHANGED
@@ -87,7 +87,6 @@
|
|
87 |
that.items = [];
|
88 |
that.callToCallback();
|
89 |
}
|
90 |
-
console.log('Get items: ', that.items.length);
|
91 |
}
|
92 |
});
|
93 |
}
|
87 |
that.items = [];
|
88 |
that.callToCallback();
|
89 |
}
|
|
|
90 |
}
|
91 |
});
|
92 |
}
|
assets/js/admin/update.js
CHANGED
@@ -124,8 +124,6 @@
|
|
124 |
i = i ? i : 1;
|
125 |
|
126 |
if (p) {
|
127 |
-
console.log('Updating ...', this.packages.currentVersion(), p)
|
128 |
-
|
129 |
$.ajax({
|
130 |
url: lpGlobalSettings.admin_url,
|
131 |
data: {
|
@@ -154,7 +152,6 @@
|
|
154 |
}
|
155 |
},
|
156 |
error: function () {
|
157 |
-
console.log('Update Error: Retry!');
|
158 |
that.doUpdate(p, i);
|
159 |
}
|
160 |
});
|
124 |
i = i ? i : 1;
|
125 |
|
126 |
if (p) {
|
|
|
|
|
127 |
$.ajax({
|
128 |
url: lpGlobalSettings.admin_url,
|
129 |
data: {
|
152 |
}
|
153 |
},
|
154 |
error: function () {
|
|
|
155 |
that.doUpdate(p, i);
|
156 |
}
|
157 |
});
|
assets/js/admin/utils/_dropdown-pages.js
CHANGED
@@ -28,7 +28,6 @@
|
|
28 |
$sel.append($option);
|
29 |
} else {
|
30 |
$option.insertAfter($('option[value="' + args.positions[position - 1] + '"]', $sel));
|
31 |
-
console.log($('option[value="' + args.positions[position - 1] + '"]', $sel))
|
32 |
}
|
33 |
});
|
34 |
}
|
28 |
$sel.append($option);
|
29 |
} else {
|
30 |
$option.insertAfter($('option[value="' + args.positions[position - 1] + '"]', $sel));
|
|
|
31 |
}
|
32 |
});
|
33 |
}
|
assets/js/global.js
CHANGED
@@ -1273,7 +1273,8 @@ if (typeof window.LP == 'undefined') {
|
|
1273 |
}
|
1274 |
|
1275 |
$('#field-_lp_sale_start div, #field-_lp_sale_end div').remove('.learn-press-tip-floating');
|
1276 |
-
|
|
|
1277 |
_parent_start.append('<div class="learn-press-tip-floating">' + lpAdminCourseEditorSettings.i18n.notice_sale_start_date + '</div>')
|
1278 |
}
|
1279 |
});
|
@@ -1291,7 +1292,7 @@ if (typeof window.LP == 'undefined') {
|
|
1291 |
}
|
1292 |
|
1293 |
$('#field-_lp_sale_start div, #field-_lp_sale_end div').remove('.learn-press-tip-floating');
|
1294 |
-
if (_start_date
|
1295 |
_parent_end.append('<div class="learn-press-tip-floating">' + lpAdminCourseEditorSettings.i18n.notice_sale_end_date + '</div>')
|
1296 |
}
|
1297 |
});
|
1273 |
}
|
1274 |
|
1275 |
$('#field-_lp_sale_start div, #field-_lp_sale_end div').remove('.learn-press-tip-floating');
|
1276 |
+
|
1277 |
+
if (_start_date > _end_date) {
|
1278 |
_parent_start.append('<div class="learn-press-tip-floating">' + lpAdminCourseEditorSettings.i18n.notice_sale_start_date + '</div>')
|
1279 |
}
|
1280 |
});
|
1292 |
}
|
1293 |
|
1294 |
$('#field-_lp_sale_start div, #field-_lp_sale_end div').remove('.learn-press-tip-floating');
|
1295 |
+
if (_start_date > _end_date) {
|
1296 |
_parent_end.append('<div class="learn-press-tip-floating">' + lpAdminCourseEditorSettings.i18n.notice_sale_end_date + '</div>')
|
1297 |
}
|
1298 |
});
|
assets/js/vendor/{sortable.1.6.0.js → sortable.js}
RENAMED
File without changes
|
assets/js/vendor/{vue-resource.1.3.4.js → vue-resource.js}
RENAMED
File without changes
|
assets/js/vendor/vue.js
CHANGED
@@ -1,10057 +1,11945 @@
|
|
1 |
/*!
|
2 |
-
* Vue.js v2.
|
3 |
-
* (c) 2014-
|
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.Vue = factory());
|
10 |
-
}(this, (function () { 'use strict';
|
11 |
-
|
12 |
-
/* */
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
function
|
17 |
-
|
18 |
-
}
|
19 |
|
20 |
-
|
21 |
-
return v !== undefined && v !== null
|
22 |
-
}
|
23 |
|
24 |
-
|
25 |
-
return v === true
|
26 |
-
}
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
|
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
function isPrimitive (value) {
|
36 |
-
return typeof value === 'string' || typeof value === 'number'
|
37 |
-
}
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Quick object check - this is primarily used to tell
|
41 |
-
* Objects from primitive values when we know the value
|
42 |
-
* is a JSON-compliant type.
|
43 |
-
*/
|
44 |
-
function isObject (obj) {
|
45 |
-
return obj !== null && typeof obj === 'object'
|
46 |
-
}
|
47 |
|
48 |
-
|
|
|
|
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
*/
|
54 |
-
function isPlainObject (obj) {
|
55 |
-
return _toString.call(obj) === '[object Object]'
|
56 |
-
}
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
-
/**
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
69 |
|
70 |
-
/**
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
return val == null
|
75 |
-
? ''
|
76 |
-
: typeof val === 'object'
|
77 |
-
? JSON.stringify(val, null, 2)
|
78 |
-
: String(val)
|
79 |
-
}
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Convert a input value to a number for persistence.
|
83 |
-
* If the conversion fails, return original string.
|
84 |
-
*/
|
85 |
-
function toNumber (val) {
|
86 |
-
var n = parseFloat(val);
|
87 |
-
return isNaN(n) ? val : n
|
88 |
-
}
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Make a map and return a function for checking if a key
|
92 |
-
* is in that map.
|
93 |
-
*/
|
94 |
-
function makeMap (
|
95 |
-
str,
|
96 |
-
expectsLowerCase
|
97 |
-
) {
|
98 |
-
var map = Object.create(null);
|
99 |
-
var list = str.split(',');
|
100 |
-
for (var i = 0; i < list.length; i++) {
|
101 |
-
map[list[i]] = true;
|
102 |
-
}
|
103 |
-
return expectsLowerCase
|
104 |
-
? function (val) { return map[val.toLowerCase()]; }
|
105 |
-
: function (val) { return map[val]; }
|
106 |
-
}
|
107 |
-
|
108 |
-
/**
|
109 |
-
* Check if a tag is a built-in tag.
|
110 |
-
*/
|
111 |
-
var isBuiltInTag = makeMap('slot,component', true);
|
112 |
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
var isReservedAttribute = makeMap('key,ref,slot,is');
|
117 |
|
118 |
-
/**
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
if (index > -1) {
|
125 |
-
return arr.splice(index, 1)
|
126 |
}
|
127 |
-
}
|
128 |
-
}
|
129 |
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
134 |
-
function hasOwn (obj, key) {
|
135 |
-
return hasOwnProperty.call(obj, key)
|
136 |
-
}
|
137 |
|
138 |
-
/**
|
139 |
-
|
140 |
-
|
141 |
-
function
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
return hit || (cache[str] = fn(str))
|
146 |
-
})
|
147 |
-
}
|
148 |
-
|
149 |
-
/**
|
150 |
-
* Camelize a hyphen-delimited string.
|
151 |
-
*/
|
152 |
-
var camelizeRE = /-(\w)/g;
|
153 |
-
var camelize = cached(function (str) {
|
154 |
-
return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
|
155 |
-
});
|
156 |
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
|
|
163 |
|
164 |
-
/**
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
}
|
174 |
-
|
175 |
-
/**
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
}
|
224 |
-
}
|
225 |
-
return res
|
226 |
-
}
|
227 |
-
|
228 |
-
/**
|
229 |
-
* Perform no operation.
|
230 |
-
* Stubbing args to make Flow happy without leaving useless transpiled code
|
231 |
-
* with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/)
|
232 |
-
*/
|
233 |
-
function noop (a, b, c) {}
|
234 |
|
235 |
-
/**
|
236 |
-
|
237 |
-
|
238 |
-
var
|
|
|
|
|
|
|
239 |
|
240 |
-
/**
|
241 |
-
|
242 |
-
|
243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
|
245 |
-
/**
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
}
|
253 |
-
|
254 |
-
/**
|
255 |
-
* Check if two values are loosely equal - that is,
|
256 |
-
* if they are plain objects, do they have the same shape?
|
257 |
-
*/
|
258 |
-
function looseEqual (a, b) {
|
259 |
-
var isObjectA = isObject(a);
|
260 |
-
var isObjectB = isObject(b);
|
261 |
-
if (isObjectA && isObjectB) {
|
262 |
-
try {
|
263 |
-
return JSON.stringify(a) === JSON.stringify(b)
|
264 |
-
} catch (e) {
|
265 |
-
// possible circular reference
|
266 |
-
return a === b
|
267 |
-
}
|
268 |
-
} else if (!isObjectA && !isObjectB) {
|
269 |
-
return String(a) === String(b)
|
270 |
-
} else {
|
271 |
-
return false
|
272 |
-
}
|
273 |
-
}
|
274 |
-
|
275 |
-
function looseIndexOf (arr, val) {
|
276 |
-
for (var i = 0; i < arr.length; i++) {
|
277 |
-
if (looseEqual(arr[i], val)) { return i }
|
278 |
-
}
|
279 |
-
return -1
|
280 |
-
}
|
281 |
-
|
282 |
-
/**
|
283 |
-
* Ensure a function is called only once.
|
284 |
-
*/
|
285 |
-
function once (fn) {
|
286 |
-
var called = false;
|
287 |
-
return function () {
|
288 |
-
if (!called) {
|
289 |
-
called = true;
|
290 |
-
fn.apply(this, arguments);
|
291 |
-
}
|
292 |
-
}
|
293 |
-
}
|
294 |
-
|
295 |
-
var SSR_ATTR = 'data-server-rendered';
|
296 |
-
|
297 |
-
var ASSET_TYPES = [
|
298 |
-
'component',
|
299 |
-
'directive',
|
300 |
-
'filter'
|
301 |
-
];
|
302 |
-
|
303 |
-
var LIFECYCLE_HOOKS = [
|
304 |
-
'beforeCreate',
|
305 |
-
'created',
|
306 |
-
'beforeMount',
|
307 |
-
'mounted',
|
308 |
-
'beforeUpdate',
|
309 |
-
'updated',
|
310 |
-
'beforeDestroy',
|
311 |
-
'destroyed',
|
312 |
-
'activated',
|
313 |
-
'deactivated'
|
314 |
-
];
|
315 |
-
|
316 |
-
/* */
|
317 |
-
|
318 |
-
var config = ({
|
319 |
-
/**
|
320 |
-
* Option merge strategies (used in core/util/options)
|
321 |
-
*/
|
322 |
-
optionMergeStrategies: Object.create(null),
|
323 |
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
|
|
|
|
328 |
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
|
|
|
|
|
|
333 |
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
|
|
|
|
|
|
338 |
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
343 |
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
errorHandler: null,
|
348 |
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
warnHandler: null,
|
353 |
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
ignoredElements: [],
|
358 |
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
363 |
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
|
|
|
|
|
|
|
|
369 |
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
375 |
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
381 |
|
382 |
-
|
383 |
-
* Get the namespace of an element
|
384 |
-
*/
|
385 |
-
getTagNamespace: noop,
|
386 |
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
|
|
391 |
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
|
398 |
-
|
399 |
-
* Exposed for legacy reasons
|
400 |
-
*/
|
401 |
-
_lifecycleHooks: LIFECYCLE_HOOKS
|
402 |
-
});
|
403 |
|
404 |
-
/* */
|
405 |
|
406 |
-
var emptyObject = Object.freeze({});
|
407 |
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
}
|
444 |
-
}
|
445 |
-
|
446 |
-
/* */
|
447 |
-
|
448 |
-
var warn = noop;
|
449 |
-
var tip = noop;
|
450 |
-
var formatComponentName = (null); // work around flow check
|
451 |
-
|
452 |
-
{
|
453 |
-
var hasConsole = typeof console !== 'undefined';
|
454 |
-
var classifyRE = /(?:^|[-_])(\w)/g;
|
455 |
-
var classify = function (str) { return str
|
456 |
-
.replace(classifyRE, function (c) { return c.toUpperCase(); })
|
457 |
-
.replace(/[-_]/g, ''); };
|
458 |
-
|
459 |
-
warn = function (msg, vm) {
|
460 |
-
var trace = vm ? generateComponentTrace(vm) : '';
|
461 |
-
|
462 |
-
if (config.warnHandler) {
|
463 |
-
config.warnHandler.call(null, msg, vm, trace);
|
464 |
-
} else if (hasConsole && (!config.silent)) {
|
465 |
-
console.error(("[Vue warn]: " + msg + trace));
|
466 |
-
}
|
467 |
-
};
|
468 |
-
|
469 |
-
tip = function (msg, vm) {
|
470 |
-
if (hasConsole && (!config.silent)) {
|
471 |
-
console.warn("[Vue tip]: " + msg + (
|
472 |
-
vm ? generateComponentTrace(vm) : ''
|
473 |
-
));
|
474 |
-
}
|
475 |
-
};
|
476 |
-
|
477 |
-
formatComponentName = function (vm, includeFile) {
|
478 |
-
if (vm.$root === vm) {
|
479 |
-
return '<Root>'
|
480 |
-
}
|
481 |
-
var name = typeof vm === 'string'
|
482 |
-
? vm
|
483 |
-
: typeof vm === 'function' && vm.options
|
484 |
-
? vm.options.name
|
485 |
-
: vm._isVue
|
486 |
-
? vm.$options.name || vm.$options._componentTag
|
487 |
-
: vm.name;
|
488 |
-
|
489 |
-
var file = vm._isVue && vm.$options.__file;
|
490 |
-
if (!name && file) {
|
491 |
-
var match = file.match(/([^/\\]+)\.vue$/);
|
492 |
-
name = match && match[1];
|
493 |
-
}
|
494 |
-
|
495 |
-
return (
|
496 |
-
(name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
|
497 |
-
(file && includeFile !== false ? (" at " + file) : '')
|
498 |
-
)
|
499 |
-
};
|
500 |
-
|
501 |
-
var repeat = function (str, n) {
|
502 |
-
var res = '';
|
503 |
-
while (n) {
|
504 |
-
if (n % 2 === 1) { res += str; }
|
505 |
-
if (n > 1) { str += str; }
|
506 |
-
n >>= 1;
|
507 |
-
}
|
508 |
-
return res
|
509 |
-
};
|
510 |
-
|
511 |
-
var generateComponentTrace = function (vm) {
|
512 |
-
if (vm._isVue && vm.$parent) {
|
513 |
-
var tree = [];
|
514 |
-
var currentRecursiveSequence = 0;
|
515 |
-
while (vm) {
|
516 |
-
if (tree.length > 0) {
|
517 |
-
var last = tree[tree.length - 1];
|
518 |
-
if (last.constructor === vm.constructor) {
|
519 |
-
currentRecursiveSequence++;
|
520 |
-
vm = vm.$parent;
|
521 |
-
continue
|
522 |
-
} else if (currentRecursiveSequence > 0) {
|
523 |
-
tree[tree.length - 1] = [last, currentRecursiveSequence];
|
524 |
-
currentRecursiveSequence = 0;
|
525 |
-
}
|
526 |
-
}
|
527 |
-
tree.push(vm);
|
528 |
-
vm = vm.$parent;
|
529 |
-
}
|
530 |
-
return '\n\nfound in\n\n' + tree
|
531 |
-
.map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
|
532 |
-
? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
|
533 |
-
: formatComponentName(vm))); })
|
534 |
-
.join('\n')
|
535 |
-
} else {
|
536 |
-
return ("\n\n(found in " + (formatComponentName(vm)) + ")")
|
537 |
}
|
538 |
-
};
|
539 |
-
}
|
540 |
-
|
541 |
-
/* */
|
542 |
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
{
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
/* */
|
560 |
-
/* globals MutationObserver */
|
561 |
-
|
562 |
-
// can we use __proto__?
|
563 |
-
var hasProto = '__proto__' in {};
|
564 |
-
|
565 |
-
// Browser environment sniffing
|
566 |
-
var inBrowser = typeof window !== 'undefined';
|
567 |
-
var UA = inBrowser && window.navigator.userAgent.toLowerCase();
|
568 |
-
var isIE = UA && /msie|trident/.test(UA);
|
569 |
-
var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
|
570 |
-
var isEdge = UA && UA.indexOf('edge/') > 0;
|
571 |
-
var isAndroid = UA && UA.indexOf('android') > 0;
|
572 |
-
var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
|
573 |
-
var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
|
574 |
-
|
575 |
-
// Firefix has a "watch" function on Object.prototype...
|
576 |
-
var nativeWatch = ({}).watch;
|
577 |
-
|
578 |
-
var supportsPassive = false;
|
579 |
-
if (inBrowser) {
|
580 |
-
try {
|
581 |
-
var opts = {};
|
582 |
-
Object.defineProperty(opts, 'passive', ({
|
583 |
-
get: function get () {
|
584 |
-
/* istanbul ignore next */
|
585 |
-
supportsPassive = true;
|
586 |
-
}
|
587 |
-
})); // https://github.com/facebook/flow/issues/285
|
588 |
-
window.addEventListener('test-passive', null, opts);
|
589 |
-
} catch (e) {}
|
590 |
-
}
|
591 |
-
|
592 |
-
// this needs to be lazy-evaled because vue may be required before
|
593 |
-
// vue-server-renderer can set VUE_ENV
|
594 |
-
var _isServer;
|
595 |
-
var isServerRendering = function () {
|
596 |
-
if (_isServer === undefined) {
|
597 |
-
/* istanbul ignore if */
|
598 |
-
if (!inBrowser && typeof global !== 'undefined') {
|
599 |
-
// detect presence of vue-server-renderer and avoid
|
600 |
-
// Webpack shimming the process
|
601 |
-
_isServer = global['process'].env.VUE_ENV === 'server';
|
602 |
-
} else {
|
603 |
-
_isServer = false;
|
604 |
}
|
605 |
-
}
|
606 |
-
return _isServer
|
607 |
-
};
|
608 |
|
609 |
-
|
610 |
-
var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
611 |
|
612 |
-
|
613 |
-
|
614 |
-
return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
|
615 |
-
}
|
616 |
|
617 |
-
|
618 |
-
|
619 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
620 |
|
621 |
-
|
622 |
-
|
623 |
-
*/
|
624 |
-
var nextTick = (function () {
|
625 |
-
var callbacks = [];
|
626 |
-
var pending = false;
|
627 |
-
var timerFunc;
|
628 |
-
|
629 |
-
function nextTickHandler () {
|
630 |
-
pending = false;
|
631 |
-
var copies = callbacks.slice(0);
|
632 |
-
callbacks.length = 0;
|
633 |
-
for (var i = 0; i < copies.length; i++) {
|
634 |
-
copies[i]();
|
635 |
-
}
|
636 |
-
}
|
637 |
-
|
638 |
-
// the nextTick behavior leverages the microtask queue, which can be accessed
|
639 |
-
// via either native Promise.then or MutationObserver.
|
640 |
-
// MutationObserver has wider support, however it is seriously bugged in
|
641 |
-
// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
|
642 |
-
// completely stops working after triggering a few times... so, if native
|
643 |
-
// Promise is available, we will use it:
|
644 |
-
/* istanbul ignore if */
|
645 |
-
if (typeof Promise !== 'undefined' && isNative(Promise)) {
|
646 |
-
var p = Promise.resolve();
|
647 |
-
var logError = function (err) { console.error(err); };
|
648 |
-
timerFunc = function () {
|
649 |
-
p.then(nextTickHandler).catch(logError);
|
650 |
-
// in problematic UIWebViews, Promise.then doesn't completely break, but
|
651 |
-
// it can get stuck in a weird state where callbacks are pushed into the
|
652 |
-
// microtask queue but the queue isn't being flushed, until the browser
|
653 |
-
// needs to do some other work, e.g. handle a timer. Therefore we can
|
654 |
-
// "force" the microtask queue to be flushed by adding an empty timer.
|
655 |
-
if (isIOS) { setTimeout(noop); }
|
656 |
-
};
|
657 |
-
} else if (typeof MutationObserver !== 'undefined' && (
|
658 |
-
isNative(MutationObserver) ||
|
659 |
-
// PhantomJS and iOS 7.x
|
660 |
-
MutationObserver.toString() === '[object MutationObserverConstructor]'
|
661 |
-
)) {
|
662 |
-
// use MutationObserver where native Promise is not available,
|
663 |
-
// e.g. PhantomJS IE11, iOS7, Android 4.4
|
664 |
-
var counter = 1;
|
665 |
-
var observer = new MutationObserver(nextTickHandler);
|
666 |
-
var textNode = document.createTextNode(String(counter));
|
667 |
-
observer.observe(textNode, {
|
668 |
-
characterData: true
|
669 |
-
});
|
670 |
-
timerFunc = function () {
|
671 |
-
counter = (counter + 1) % 2;
|
672 |
-
textNode.data = String(counter);
|
673 |
-
};
|
674 |
-
} else {
|
675 |
-
// fallback to setTimeout
|
676 |
-
/* istanbul ignore next */
|
677 |
-
timerFunc = function () {
|
678 |
-
setTimeout(nextTickHandler, 0);
|
679 |
-
};
|
680 |
-
}
|
681 |
|
682 |
-
|
683 |
-
|
684 |
-
callbacks.push(function () {
|
685 |
-
if (cb) {
|
686 |
try {
|
687 |
-
|
688 |
-
|
689 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
690 |
}
|
691 |
-
|
692 |
-
_resolve(ctx);
|
693 |
-
}
|
694 |
-
});
|
695 |
-
if (!pending) {
|
696 |
-
pending = true;
|
697 |
-
timerFunc();
|
698 |
-
}
|
699 |
-
if (!cb && typeof Promise !== 'undefined') {
|
700 |
-
return new Promise(function (resolve, reject) {
|
701 |
-
_resolve = resolve;
|
702 |
-
})
|
703 |
-
}
|
704 |
-
}
|
705 |
-
})();
|
706 |
-
|
707 |
-
var _Set;
|
708 |
-
/* istanbul ignore if */
|
709 |
-
if (typeof Set !== 'undefined' && isNative(Set)) {
|
710 |
-
// use native Set when available.
|
711 |
-
_Set = Set;
|
712 |
-
} else {
|
713 |
-
// a non-standard Set polyfill that only works with primitive keys.
|
714 |
-
_Set = (function () {
|
715 |
-
function Set () {
|
716 |
-
this.set = Object.create(null);
|
717 |
-
}
|
718 |
-
Set.prototype.has = function has (key) {
|
719 |
-
return this.set[key] === true
|
720 |
-
};
|
721 |
-
Set.prototype.add = function add (key) {
|
722 |
-
this.set[key] = true;
|
723 |
-
};
|
724 |
-
Set.prototype.clear = function clear () {
|
725 |
-
this.set = Object.create(null);
|
726 |
};
|
727 |
|
728 |
-
|
729 |
-
|
730 |
-
}
|
731 |
|
732 |
-
/*
|
|
|
|
|
|
|
733 |
|
|
|
|
|
|
|
734 |
|
735 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
736 |
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
*/
|
741 |
-
var Dep = function Dep () {
|
742 |
-
this.id = uid++;
|
743 |
-
this.subs = [];
|
744 |
-
};
|
745 |
-
|
746 |
-
Dep.prototype.addSub = function addSub (sub) {
|
747 |
-
this.subs.push(sub);
|
748 |
-
};
|
749 |
-
|
750 |
-
Dep.prototype.removeSub = function removeSub (sub) {
|
751 |
-
remove(this.subs, sub);
|
752 |
-
};
|
753 |
-
|
754 |
-
Dep.prototype.depend = function depend () {
|
755 |
-
if (Dep.target) {
|
756 |
-
Dep.target.addDep(this);
|
757 |
-
}
|
758 |
-
};
|
759 |
-
|
760 |
-
Dep.prototype.notify = function notify () {
|
761 |
-
// stabilize the subscriber list first
|
762 |
-
var subs = this.subs.slice();
|
763 |
-
for (var i = 0, l = subs.length; i < l; i++) {
|
764 |
-
subs[i].update();
|
765 |
-
}
|
766 |
-
};
|
767 |
-
|
768 |
-
// the current target watcher being evaluated.
|
769 |
-
// this is globally unique because there could be only one
|
770 |
-
// watcher being evaluated at any time.
|
771 |
-
Dep.target = null;
|
772 |
-
var targetStack = [];
|
773 |
-
|
774 |
-
function pushTarget (_target) {
|
775 |
-
if (Dep.target) { targetStack.push(Dep.target); }
|
776 |
-
Dep.target = _target;
|
777 |
-
}
|
778 |
-
|
779 |
-
function popTarget () {
|
780 |
-
Dep.target = targetStack.pop();
|
781 |
-
}
|
782 |
-
|
783 |
-
/*
|
784 |
-
* not type checking this file because flow doesn't play well with
|
785 |
-
* dynamically accessing methods on Array prototype
|
786 |
-
*/
|
787 |
|
788 |
-
|
789 |
-
var arrayMethods = Object.create(arrayProto);[
|
790 |
-
'push',
|
791 |
-
'pop',
|
792 |
-
'shift',
|
793 |
-
'unshift',
|
794 |
-
'splice',
|
795 |
-
'sort',
|
796 |
-
'reverse'
|
797 |
-
]
|
798 |
-
.forEach(function (method) {
|
799 |
-
// cache original method
|
800 |
-
var original = arrayProto[method];
|
801 |
-
def(arrayMethods, method, function mutator () {
|
802 |
-
var args = [], len = arguments.length;
|
803 |
-
while ( len-- ) args[ len ] = arguments[ len ];
|
804 |
-
|
805 |
-
var result = original.apply(this, args);
|
806 |
-
var ob = this.__ob__;
|
807 |
-
var inserted;
|
808 |
-
switch (method) {
|
809 |
-
case 'push':
|
810 |
-
case 'unshift':
|
811 |
-
inserted = args;
|
812 |
-
break
|
813 |
-
case 'splice':
|
814 |
-
inserted = args.slice(2);
|
815 |
-
break
|
816 |
-
}
|
817 |
-
if (inserted) { ob.observeArray(inserted); }
|
818 |
-
// notify change
|
819 |
-
ob.dep.notify();
|
820 |
-
return result
|
821 |
-
});
|
822 |
-
});
|
823 |
-
|
824 |
-
/* */
|
825 |
-
|
826 |
-
var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
|
827 |
-
|
828 |
-
/**
|
829 |
-
* By default, when a reactive property is set, the new value is
|
830 |
-
* also converted to become reactive. However when passing down props,
|
831 |
-
* we don't want to force conversion because the value may be a nested value
|
832 |
-
* under a frozen data structure. Converting it would defeat the optimization.
|
833 |
-
*/
|
834 |
-
var observerState = {
|
835 |
-
shouldConvert: true
|
836 |
-
};
|
837 |
-
|
838 |
-
/**
|
839 |
-
* Observer class that are attached to each observed
|
840 |
-
* object. Once attached, the observer converts target
|
841 |
-
* object's property keys into getter/setters that
|
842 |
-
* collect dependencies and dispatches updates.
|
843 |
-
*/
|
844 |
-
var Observer = function Observer (value) {
|
845 |
-
this.value = value;
|
846 |
-
this.dep = new Dep();
|
847 |
-
this.vmCount = 0;
|
848 |
-
def(value, '__ob__', this);
|
849 |
-
if (Array.isArray(value)) {
|
850 |
-
var augment = hasProto
|
851 |
-
? protoAugment
|
852 |
-
: copyAugment;
|
853 |
-
augment(value, arrayMethods, arrayKeys);
|
854 |
-
this.observeArray(value);
|
855 |
-
} else {
|
856 |
-
this.walk(value);
|
857 |
-
}
|
858 |
-
};
|
859 |
-
|
860 |
-
/**
|
861 |
-
* Walk through each property and convert them into
|
862 |
-
* getter/setters. This method should only be called when
|
863 |
-
* value type is Object.
|
864 |
-
*/
|
865 |
-
Observer.prototype.walk = function walk (obj) {
|
866 |
-
var keys = Object.keys(obj);
|
867 |
-
for (var i = 0; i < keys.length; i++) {
|
868 |
-
defineReactive$$1(obj, keys[i], obj[keys[i]]);
|
869 |
-
}
|
870 |
-
};
|
871 |
-
|
872 |
-
/**
|
873 |
-
* Observe a list of Array items.
|
874 |
-
*/
|
875 |
-
Observer.prototype.observeArray = function observeArray (items) {
|
876 |
-
for (var i = 0, l = items.length; i < l; i++) {
|
877 |
-
observe(items[i]);
|
878 |
-
}
|
879 |
-
};
|
880 |
|
881 |
-
|
|
|
|
|
|
|
882 |
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
function
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
for (var i = 0, l = keys.length; i < l; i++) {
|
900 |
-
var key = keys[i];
|
901 |
-
def(target, key, src[key]);
|
902 |
-
}
|
903 |
-
}
|
904 |
-
|
905 |
-
/**
|
906 |
-
* Attempt to create an observer instance for a value,
|
907 |
-
* returns the new observer if successfully observed,
|
908 |
-
* or the existing observer if the value already has one.
|
909 |
-
*/
|
910 |
-
function observe (value, asRootData) {
|
911 |
-
if (!isObject(value)) {
|
912 |
-
return
|
913 |
-
}
|
914 |
-
var ob;
|
915 |
-
if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
|
916 |
-
ob = value.__ob__;
|
917 |
-
} else if (
|
918 |
-
observerState.shouldConvert &&
|
919 |
-
!isServerRendering() &&
|
920 |
-
(Array.isArray(value) || isPlainObject(value)) &&
|
921 |
-
Object.isExtensible(value) &&
|
922 |
-
!value._isVue
|
923 |
-
) {
|
924 |
-
ob = new Observer(value);
|
925 |
-
}
|
926 |
-
if (asRootData && ob) {
|
927 |
-
ob.vmCount++;
|
928 |
-
}
|
929 |
-
return ob
|
930 |
-
}
|
931 |
-
|
932 |
-
/**
|
933 |
-
* Define a reactive property on an Object.
|
934 |
-
*/
|
935 |
-
function defineReactive$$1 (
|
936 |
-
obj,
|
937 |
-
key,
|
938 |
-
val,
|
939 |
-
customSetter,
|
940 |
-
shallow
|
941 |
-
) {
|
942 |
-
var dep = new Dep();
|
943 |
-
|
944 |
-
var property = Object.getOwnPropertyDescriptor(obj, key);
|
945 |
-
if (property && property.configurable === false) {
|
946 |
-
return
|
947 |
-
}
|
948 |
-
|
949 |
-
// cater for pre-defined getter/setters
|
950 |
-
var getter = property && property.get;
|
951 |
-
var setter = property && property.set;
|
952 |
-
|
953 |
-
var childOb = !shallow && observe(val);
|
954 |
-
Object.defineProperty(obj, key, {
|
955 |
-
enumerable: true,
|
956 |
-
configurable: true,
|
957 |
-
get: function reactiveGetter () {
|
958 |
-
var value = getter ? getter.call(obj) : val;
|
959 |
-
if (Dep.target) {
|
960 |
-
dep.depend();
|
961 |
-
if (childOb) {
|
962 |
-
childOb.dep.depend();
|
963 |
-
}
|
964 |
-
if (Array.isArray(value)) {
|
965 |
-
dependArray(value);
|
966 |
-
}
|
967 |
-
}
|
968 |
-
return value
|
969 |
-
},
|
970 |
-
set: function reactiveSetter (newVal) {
|
971 |
-
var value = getter ? getter.call(obj) : val;
|
972 |
-
/* eslint-disable no-self-compare */
|
973 |
-
if (newVal === value || (newVal !== newVal && value !== value)) {
|
974 |
-
return
|
975 |
-
}
|
976 |
-
/* eslint-enable no-self-compare */
|
977 |
-
if ("development" !== 'production' && customSetter) {
|
978 |
-
customSetter();
|
979 |
-
}
|
980 |
-
if (setter) {
|
981 |
-
setter.call(obj, newVal);
|
982 |
-
} else {
|
983 |
-
val = newVal;
|
984 |
-
}
|
985 |
-
childOb = !shallow && observe(newVal);
|
986 |
-
dep.notify();
|
987 |
-
}
|
988 |
-
});
|
989 |
-
}
|
990 |
-
|
991 |
-
/**
|
992 |
-
* Set a property on an object. Adds the new property and
|
993 |
-
* triggers change notification if the property doesn't
|
994 |
-
* already exist.
|
995 |
-
*/
|
996 |
-
function set (target, key, val) {
|
997 |
-
if (Array.isArray(target) && isValidArrayIndex(key)) {
|
998 |
-
target.length = Math.max(target.length, key);
|
999 |
-
target.splice(key, 1, val);
|
1000 |
-
return val
|
1001 |
-
}
|
1002 |
-
if (hasOwn(target, key)) {
|
1003 |
-
target[key] = val;
|
1004 |
-
return val
|
1005 |
-
}
|
1006 |
-
var ob = (target).__ob__;
|
1007 |
-
if (target._isVue || (ob && ob.vmCount)) {
|
1008 |
-
"development" !== 'production' && warn(
|
1009 |
-
'Avoid adding reactive properties to a Vue instance or its root $data ' +
|
1010 |
-
'at runtime - declare it upfront in the data option.'
|
1011 |
-
);
|
1012 |
-
return val
|
1013 |
-
}
|
1014 |
-
if (!ob) {
|
1015 |
-
target[key] = val;
|
1016 |
-
return val
|
1017 |
-
}
|
1018 |
-
defineReactive$$1(ob.value, key, val);
|
1019 |
-
ob.dep.notify();
|
1020 |
-
return val
|
1021 |
-
}
|
1022 |
-
|
1023 |
-
/**
|
1024 |
-
* Delete a property and trigger change if necessary.
|
1025 |
-
*/
|
1026 |
-
function del (target, key) {
|
1027 |
-
if (Array.isArray(target) && isValidArrayIndex(key)) {
|
1028 |
-
target.splice(key, 1);
|
1029 |
-
return
|
1030 |
-
}
|
1031 |
-
var ob = (target).__ob__;
|
1032 |
-
if (target._isVue || (ob && ob.vmCount)) {
|
1033 |
-
"development" !== 'production' && warn(
|
1034 |
-
'Avoid deleting properties on a Vue instance or its root $data ' +
|
1035 |
-
'- just set it to null.'
|
1036 |
-
);
|
1037 |
-
return
|
1038 |
-
}
|
1039 |
-
if (!hasOwn(target, key)) {
|
1040 |
-
return
|
1041 |
-
}
|
1042 |
-
delete target[key];
|
1043 |
-
if (!ob) {
|
1044 |
-
return
|
1045 |
-
}
|
1046 |
-
ob.dep.notify();
|
1047 |
-
}
|
1048 |
-
|
1049 |
-
/**
|
1050 |
-
* Collect dependencies on array elements when the array is touched, since
|
1051 |
-
* we cannot intercept array element access like property getters.
|
1052 |
-
*/
|
1053 |
-
function dependArray (value) {
|
1054 |
-
for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
|
1055 |
-
e = value[i];
|
1056 |
-
e && e.__ob__ && e.__ob__.dep.depend();
|
1057 |
-
if (Array.isArray(e)) {
|
1058 |
-
dependArray(e);
|
1059 |
-
}
|
1060 |
-
}
|
1061 |
-
}
|
1062 |
-
|
1063 |
-
/* */
|
1064 |
-
|
1065 |
-
/**
|
1066 |
-
* Option overwriting strategies are functions that handle
|
1067 |
-
* how to merge a parent option value and a child option
|
1068 |
-
* value into the final value.
|
1069 |
-
*/
|
1070 |
-
var strats = config.optionMergeStrategies;
|
1071 |
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
key = keys[i];
|
1096 |
-
toVal = to[key];
|
1097 |
-
fromVal = from[key];
|
1098 |
-
if (!hasOwn(to, key)) {
|
1099 |
-
set(to, key, fromVal);
|
1100 |
-
} else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
|
1101 |
-
mergeData(toVal, fromVal);
|
1102 |
-
}
|
1103 |
-
}
|
1104 |
-
return to
|
1105 |
-
}
|
1106 |
-
|
1107 |
-
/**
|
1108 |
-
* Data
|
1109 |
-
*/
|
1110 |
-
function mergeDataOrFn (
|
1111 |
-
parentVal,
|
1112 |
-
childVal,
|
1113 |
-
vm
|
1114 |
-
) {
|
1115 |
-
if (!vm) {
|
1116 |
-
// in a Vue.extend merge, both should be functions
|
1117 |
-
if (!childVal) {
|
1118 |
-
return parentVal
|
1119 |
-
}
|
1120 |
-
if (!parentVal) {
|
1121 |
-
return childVal
|
1122 |
-
}
|
1123 |
-
// when parentVal & childVal are both present,
|
1124 |
-
// we need to return a function that returns the
|
1125 |
-
// merged result of both functions... no need to
|
1126 |
-
// check if parentVal is a function here because
|
1127 |
-
// it has to be a function to pass previous merges.
|
1128 |
-
return function mergedDataFn () {
|
1129 |
-
return mergeData(
|
1130 |
-
typeof childVal === 'function' ? childVal.call(this) : childVal,
|
1131 |
-
parentVal.call(this)
|
1132 |
-
)
|
1133 |
-
}
|
1134 |
-
} else if (parentVal || childVal) {
|
1135 |
-
return function mergedInstanceDataFn () {
|
1136 |
-
// instance merge
|
1137 |
-
var instanceData = typeof childVal === 'function'
|
1138 |
-
? childVal.call(vm)
|
1139 |
-
: childVal;
|
1140 |
-
var defaultData = typeof parentVal === 'function'
|
1141 |
-
? parentVal.call(vm)
|
1142 |
-
: undefined;
|
1143 |
-
if (instanceData) {
|
1144 |
-
return mergeData(instanceData, defaultData)
|
1145 |
-
} else {
|
1146 |
-
return defaultData
|
1147 |
-
}
|
1148 |
-
}
|
1149 |
-
}
|
1150 |
-
}
|
1151 |
-
|
1152 |
-
strats.data = function (
|
1153 |
-
parentVal,
|
1154 |
-
childVal,
|
1155 |
-
vm
|
1156 |
-
) {
|
1157 |
-
if (!vm) {
|
1158 |
-
if (childVal && typeof childVal !== 'function') {
|
1159 |
-
"development" !== 'production' && warn(
|
1160 |
-
'The "data" option should be a function ' +
|
1161 |
-
'that returns a per-instance value in component ' +
|
1162 |
-
'definitions.',
|
1163 |
-
vm
|
1164 |
-
);
|
1165 |
|
1166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1167 |
}
|
1168 |
-
return mergeDataOrFn.call(this, parentVal, childVal)
|
1169 |
-
}
|
1170 |
|
1171 |
-
|
1172 |
-
};
|
1173 |
|
1174 |
-
|
1175 |
-
* Hooks and props are merged as arrays.
|
1176 |
-
*/
|
1177 |
-
function mergeHook (
|
1178 |
-
parentVal,
|
1179 |
-
childVal
|
1180 |
-
) {
|
1181 |
-
return childVal
|
1182 |
-
? parentVal
|
1183 |
-
? parentVal.concat(childVal)
|
1184 |
-
: Array.isArray(childVal)
|
1185 |
-
? childVal
|
1186 |
-
: [childVal]
|
1187 |
-
: parentVal
|
1188 |
-
}
|
1189 |
-
|
1190 |
-
LIFECYCLE_HOOKS.forEach(function (hook) {
|
1191 |
-
strats[hook] = mergeHook;
|
1192 |
-
});
|
1193 |
-
|
1194 |
-
/**
|
1195 |
-
* Assets
|
1196 |
-
*
|
1197 |
-
* When a vm is present (instance creation), we need to do
|
1198 |
-
* a three-way merge between constructor options, instance
|
1199 |
-
* options and parent options.
|
1200 |
-
*/
|
1201 |
-
function mergeAssets (parentVal, childVal) {
|
1202 |
-
var res = Object.create(parentVal || null);
|
1203 |
-
return childVal
|
1204 |
-
? extend(res, childVal)
|
1205 |
-
: res
|
1206 |
-
}
|
1207 |
-
|
1208 |
-
ASSET_TYPES.forEach(function (type) {
|
1209 |
-
strats[type + 's'] = mergeAssets;
|
1210 |
-
});
|
1211 |
-
|
1212 |
-
/**
|
1213 |
-
* Watchers.
|
1214 |
-
*
|
1215 |
-
* Watchers hashes should not overwrite one
|
1216 |
-
* another, so we merge them as arrays.
|
1217 |
-
*/
|
1218 |
-
strats.watch = function (parentVal, childVal) {
|
1219 |
-
// work around Firefox's Object.prototype.watch...
|
1220 |
-
if (parentVal === nativeWatch) { parentVal = undefined; }
|
1221 |
-
if (childVal === nativeWatch) { childVal = undefined; }
|
1222 |
-
/* istanbul ignore if */
|
1223 |
-
if (!childVal) { return Object.create(parentVal || null) }
|
1224 |
-
if (!parentVal) { return childVal }
|
1225 |
-
var ret = {};
|
1226 |
-
extend(ret, parentVal);
|
1227 |
-
for (var key in childVal) {
|
1228 |
-
var parent = ret[key];
|
1229 |
-
var child = childVal[key];
|
1230 |
-
if (parent && !Array.isArray(parent)) {
|
1231 |
-
parent = [parent];
|
1232 |
-
}
|
1233 |
-
ret[key] = parent
|
1234 |
-
? parent.concat(child)
|
1235 |
-
: Array.isArray(child) ? child : [child];
|
1236 |
-
}
|
1237 |
-
return ret
|
1238 |
-
};
|
1239 |
-
|
1240 |
-
/**
|
1241 |
-
* Other object hashes.
|
1242 |
-
*/
|
1243 |
-
strats.props =
|
1244 |
-
strats.methods =
|
1245 |
-
strats.inject =
|
1246 |
-
strats.computed = function (parentVal, childVal) {
|
1247 |
-
if (!childVal) { return Object.create(parentVal || null) }
|
1248 |
-
if (!parentVal) { return childVal }
|
1249 |
-
var ret = Object.create(null);
|
1250 |
-
extend(ret, parentVal);
|
1251 |
-
extend(ret, childVal);
|
1252 |
-
return ret
|
1253 |
-
};
|
1254 |
-
strats.provide = mergeDataOrFn;
|
1255 |
-
|
1256 |
-
/**
|
1257 |
-
* Default strategy.
|
1258 |
-
*/
|
1259 |
-
var defaultStrat = function (parentVal, childVal) {
|
1260 |
-
return childVal === undefined
|
1261 |
-
? parentVal
|
1262 |
-
: childVal
|
1263 |
-
};
|
1264 |
-
|
1265 |
-
/**
|
1266 |
-
* Validate component names
|
1267 |
-
*/
|
1268 |
-
function checkComponents (options) {
|
1269 |
-
for (var key in options.components) {
|
1270 |
-
var lower = key.toLowerCase();
|
1271 |
-
if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
|
1272 |
-
warn(
|
1273 |
-
'Do not use built-in or reserved HTML elements as component ' +
|
1274 |
-
'id: ' + key
|
1275 |
-
);
|
1276 |
-
}
|
1277 |
-
}
|
1278 |
-
}
|
1279 |
-
|
1280 |
-
/**
|
1281 |
-
* Ensure all props option syntax are normalized into the
|
1282 |
-
* Object-based format.
|
1283 |
-
*/
|
1284 |
-
function normalizeProps (options) {
|
1285 |
-
var props = options.props;
|
1286 |
-
if (!props) { return }
|
1287 |
-
var res = {};
|
1288 |
-
var i, val, name;
|
1289 |
-
if (Array.isArray(props)) {
|
1290 |
-
i = props.length;
|
1291 |
-
while (i--) {
|
1292 |
-
val = props[i];
|
1293 |
-
if (typeof val === 'string') {
|
1294 |
-
name = camelize(val);
|
1295 |
-
res[name] = { type: null };
|
1296 |
-
} else {
|
1297 |
-
warn('props must be strings when using array syntax.');
|
1298 |
-
}
|
1299 |
-
}
|
1300 |
-
} else if (isPlainObject(props)) {
|
1301 |
-
for (var key in props) {
|
1302 |
-
val = props[key];
|
1303 |
-
name = camelize(key);
|
1304 |
-
res[name] = isPlainObject(val)
|
1305 |
-
? val
|
1306 |
-
: { type: val };
|
1307 |
-
}
|
1308 |
-
}
|
1309 |
-
options.props = res;
|
1310 |
-
}
|
1311 |
-
|
1312 |
-
/**
|
1313 |
-
* Normalize all injections into Object-based format
|
1314 |
-
*/
|
1315 |
-
function normalizeInject (options) {
|
1316 |
-
var inject = options.inject;
|
1317 |
-
if (Array.isArray(inject)) {
|
1318 |
-
var normalized = options.inject = {};
|
1319 |
-
for (var i = 0; i < inject.length; i++) {
|
1320 |
-
normalized[inject[i]] = inject[i];
|
1321 |
-
}
|
1322 |
-
}
|
1323 |
-
}
|
1324 |
-
|
1325 |
-
/**
|
1326 |
-
* Normalize raw function directives into object format.
|
1327 |
-
*/
|
1328 |
-
function normalizeDirectives (options) {
|
1329 |
-
var dirs = options.directives;
|
1330 |
-
if (dirs) {
|
1331 |
-
for (var key in dirs) {
|
1332 |
-
var def = dirs[key];
|
1333 |
-
if (typeof def === 'function') {
|
1334 |
-
dirs[key] = { bind: def, update: def };
|
1335 |
-
}
|
1336 |
-
}
|
1337 |
-
}
|
1338 |
-
}
|
1339 |
-
|
1340 |
-
/**
|
1341 |
-
* Merge two option objects into a new one.
|
1342 |
-
* Core utility used in both instantiation and inheritance.
|
1343 |
-
*/
|
1344 |
-
function mergeOptions (
|
1345 |
-
parent,
|
1346 |
-
child,
|
1347 |
-
vm
|
1348 |
-
) {
|
1349 |
-
{
|
1350 |
-
checkComponents(child);
|
1351 |
-
}
|
1352 |
-
|
1353 |
-
if (typeof child === 'function') {
|
1354 |
-
child = child.options;
|
1355 |
-
}
|
1356 |
-
|
1357 |
-
normalizeProps(child);
|
1358 |
-
normalizeInject(child);
|
1359 |
-
normalizeDirectives(child);
|
1360 |
-
var extendsFrom = child.extends;
|
1361 |
-
if (extendsFrom) {
|
1362 |
-
parent = mergeOptions(parent, extendsFrom, vm);
|
1363 |
-
}
|
1364 |
-
if (child.mixins) {
|
1365 |
-
for (var i = 0, l = child.mixins.length; i < l; i++) {
|
1366 |
-
parent = mergeOptions(parent, child.mixins[i], vm);
|
1367 |
-
}
|
1368 |
-
}
|
1369 |
-
var options = {};
|
1370 |
-
var key;
|
1371 |
-
for (key in parent) {
|
1372 |
-
mergeField(key);
|
1373 |
-
}
|
1374 |
-
for (key in child) {
|
1375 |
-
if (!hasOwn(parent, key)) {
|
1376 |
-
mergeField(key);
|
1377 |
-
}
|
1378 |
-
}
|
1379 |
-
function mergeField (key) {
|
1380 |
-
var strat = strats[key] || defaultStrat;
|
1381 |
-
options[key] = strat(parent[key], child[key], vm, key);
|
1382 |
-
}
|
1383 |
-
return options
|
1384 |
-
}
|
1385 |
-
|
1386 |
-
/**
|
1387 |
-
* Resolve an asset.
|
1388 |
-
* This function is used because child instances need access
|
1389 |
-
* to assets defined in its ancestor chain.
|
1390 |
-
*/
|
1391 |
-
function resolveAsset (
|
1392 |
-
options,
|
1393 |
-
type,
|
1394 |
-
id,
|
1395 |
-
warnMissing
|
1396 |
-
) {
|
1397 |
-
/* istanbul ignore if */
|
1398 |
-
if (typeof id !== 'string') {
|
1399 |
-
return
|
1400 |
-
}
|
1401 |
-
var assets = options[type];
|
1402 |
-
// check local registration variations first
|
1403 |
-
if (hasOwn(assets, id)) { return assets[id] }
|
1404 |
-
var camelizedId = camelize(id);
|
1405 |
-
if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
|
1406 |
-
var PascalCaseId = capitalize(camelizedId);
|
1407 |
-
if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
|
1408 |
-
// fallback to prototype chain
|
1409 |
-
var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
|
1410 |
-
if ("development" !== 'production' && warnMissing && !res) {
|
1411 |
-
warn(
|
1412 |
-
'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
|
1413 |
-
options
|
1414 |
-
);
|
1415 |
-
}
|
1416 |
-
return res
|
1417 |
-
}
|
1418 |
-
|
1419 |
-
/* */
|
1420 |
-
|
1421 |
-
function validateProp (
|
1422 |
-
key,
|
1423 |
-
propOptions,
|
1424 |
-
propsData,
|
1425 |
-
vm
|
1426 |
-
) {
|
1427 |
-
var prop = propOptions[key];
|
1428 |
-
var absent = !hasOwn(propsData, key);
|
1429 |
-
var value = propsData[key];
|
1430 |
-
// handle boolean props
|
1431 |
-
if (isType(Boolean, prop.type)) {
|
1432 |
-
if (absent && !hasOwn(prop, 'default')) {
|
1433 |
-
value = false;
|
1434 |
-
} else if (!isType(String, prop.type) && (value === '' || value === hyphenate(key))) {
|
1435 |
-
value = true;
|
1436 |
-
}
|
1437 |
-
}
|
1438 |
-
// check default value
|
1439 |
-
if (value === undefined) {
|
1440 |
-
value = getPropDefaultValue(vm, prop, key);
|
1441 |
-
// since the default value is a fresh copy,
|
1442 |
-
// make sure to observe it.
|
1443 |
-
var prevShouldConvert = observerState.shouldConvert;
|
1444 |
-
observerState.shouldConvert = true;
|
1445 |
-
observe(value);
|
1446 |
-
observerState.shouldConvert = prevShouldConvert;
|
1447 |
-
}
|
1448 |
-
{
|
1449 |
-
assertProp(prop, key, value, vm, absent);
|
1450 |
-
}
|
1451 |
-
return value
|
1452 |
-
}
|
1453 |
-
|
1454 |
-
/**
|
1455 |
-
* Get the default value of a prop.
|
1456 |
-
*/
|
1457 |
-
function getPropDefaultValue (vm, prop, key) {
|
1458 |
-
// no default, return undefined
|
1459 |
-
if (!hasOwn(prop, 'default')) {
|
1460 |
-
return undefined
|
1461 |
-
}
|
1462 |
-
var def = prop.default;
|
1463 |
-
// warn against non-factory defaults for Object & Array
|
1464 |
-
if ("development" !== 'production' && isObject(def)) {
|
1465 |
-
warn(
|
1466 |
-
'Invalid default value for prop "' + key + '": ' +
|
1467 |
-
'Props with type Object/Array must use a factory function ' +
|
1468 |
-
'to return the default value.',
|
1469 |
-
vm
|
1470 |
-
);
|
1471 |
-
}
|
1472 |
-
// the raw prop value was also undefined from previous render,
|
1473 |
-
// return previous default value to avoid unnecessary watcher trigger
|
1474 |
-
if (vm && vm.$options.propsData &&
|
1475 |
-
vm.$options.propsData[key] === undefined &&
|
1476 |
-
vm._props[key] !== undefined
|
1477 |
-
) {
|
1478 |
-
return vm._props[key]
|
1479 |
-
}
|
1480 |
-
// call factory function for non-Function types
|
1481 |
-
// a value is Function if its prototype is function even across different execution context
|
1482 |
-
return typeof def === 'function' && getType(prop.type) !== 'Function'
|
1483 |
-
? def.call(vm)
|
1484 |
-
: def
|
1485 |
-
}
|
1486 |
-
|
1487 |
-
/**
|
1488 |
-
* Assert whether a prop is valid.
|
1489 |
-
*/
|
1490 |
-
function assertProp (
|
1491 |
-
prop,
|
1492 |
-
name,
|
1493 |
-
value,
|
1494 |
-
vm,
|
1495 |
-
absent
|
1496 |
-
) {
|
1497 |
-
if (prop.required && absent) {
|
1498 |
-
warn(
|
1499 |
-
'Missing required prop: "' + name + '"',
|
1500 |
-
vm
|
1501 |
-
);
|
1502 |
-
return
|
1503 |
-
}
|
1504 |
-
if (value == null && !prop.required) {
|
1505 |
-
return
|
1506 |
-
}
|
1507 |
-
var type = prop.type;
|
1508 |
-
var valid = !type || type === true;
|
1509 |
-
var expectedTypes = [];
|
1510 |
-
if (type) {
|
1511 |
-
if (!Array.isArray(type)) {
|
1512 |
-
type = [type];
|
1513 |
-
}
|
1514 |
-
for (var i = 0; i < type.length && !valid; i++) {
|
1515 |
-
var assertedType = assertType(value, type[i]);
|
1516 |
-
expectedTypes.push(assertedType.expectedType || '');
|
1517 |
-
valid = assertedType.valid;
|
1518 |
-
}
|
1519 |
-
}
|
1520 |
-
if (!valid) {
|
1521 |
-
warn(
|
1522 |
-
'Invalid prop: type check failed for prop "' + name + '".' +
|
1523 |
-
' Expected ' + expectedTypes.map(capitalize).join(', ') +
|
1524 |
-
', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',
|
1525 |
-
vm
|
1526 |
-
);
|
1527 |
-
return
|
1528 |
-
}
|
1529 |
-
var validator = prop.validator;
|
1530 |
-
if (validator) {
|
1531 |
-
if (!validator(value)) {
|
1532 |
-
warn(
|
1533 |
-
'Invalid prop: custom validator check failed for prop "' + name + '".',
|
1534 |
-
vm
|
1535 |
-
);
|
1536 |
-
}
|
1537 |
-
}
|
1538 |
-
}
|
1539 |
-
|
1540 |
-
var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
|
1541 |
-
|
1542 |
-
function assertType (value, type) {
|
1543 |
-
var valid;
|
1544 |
-
var expectedType = getType(type);
|
1545 |
-
if (simpleCheckRE.test(expectedType)) {
|
1546 |
-
valid = typeof value === expectedType.toLowerCase();
|
1547 |
-
} else if (expectedType === 'Object') {
|
1548 |
-
valid = isPlainObject(value);
|
1549 |
-
} else if (expectedType === 'Array') {
|
1550 |
-
valid = Array.isArray(value);
|
1551 |
-
} else {
|
1552 |
-
valid = value instanceof type;
|
1553 |
-
}
|
1554 |
-
return {
|
1555 |
-
valid: valid,
|
1556 |
-
expectedType: expectedType
|
1557 |
-
}
|
1558 |
-
}
|
1559 |
-
|
1560 |
-
/**
|
1561 |
-
* Use function string name to check built-in types,
|
1562 |
-
* because a simple equality check will fail when running
|
1563 |
-
* across different vms / iframes.
|
1564 |
-
*/
|
1565 |
-
function getType (fn) {
|
1566 |
-
var match = fn && fn.toString().match(/^\s*function (\w+)/);
|
1567 |
-
return match ? match[1] : ''
|
1568 |
-
}
|
1569 |
-
|
1570 |
-
function isType (type, fn) {
|
1571 |
-
if (!Array.isArray(fn)) {
|
1572 |
-
return getType(fn) === getType(type)
|
1573 |
-
}
|
1574 |
-
for (var i = 0, len = fn.length; i < len; i++) {
|
1575 |
-
if (getType(fn[i]) === getType(type)) {
|
1576 |
-
return true
|
1577 |
-
}
|
1578 |
-
}
|
1579 |
-
/* istanbul ignore next */
|
1580 |
-
return false
|
1581 |
-
}
|
1582 |
|
1583 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1584 |
|
1585 |
-
|
1586 |
-
|
|
|
1587 |
|
1588 |
-
{
|
1589 |
-
|
1590 |
-
/* istanbul ignore if */
|
1591 |
-
if (
|
1592 |
-
perf &&
|
1593 |
-
perf.mark &&
|
1594 |
-
perf.measure &&
|
1595 |
-
perf.clearMarks &&
|
1596 |
-
perf.clearMeasures
|
1597 |
-
) {
|
1598 |
-
mark = function (tag) { return perf.mark(tag); };
|
1599 |
-
measure = function (name, startTag, endTag) {
|
1600 |
-
perf.measure(name, startTag, endTag);
|
1601 |
-
perf.clearMarks(startTag);
|
1602 |
-
perf.clearMarks(endTag);
|
1603 |
-
perf.clearMeasures(name);
|
1604 |
};
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
-
|
1609 |
-
|
1610 |
-
var initProxy;
|
1611 |
-
|
1612 |
-
{
|
1613 |
-
var allowedGlobals = makeMap(
|
1614 |
-
'Infinity,undefined,NaN,isFinite,isNaN,' +
|
1615 |
-
'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
|
1616 |
-
'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
|
1617 |
-
'require' // for Webpack/Browserify
|
1618 |
-
);
|
1619 |
-
|
1620 |
-
var warnNonPresent = function (target, key) {
|
1621 |
-
warn(
|
1622 |
-
"Property or method \"" + key + "\" is not defined on the instance but " +
|
1623 |
-
"referenced during render. Make sure to declare reactive data " +
|
1624 |
-
"properties in the data option.",
|
1625 |
-
target
|
1626 |
-
);
|
1627 |
-
};
|
1628 |
-
|
1629 |
-
var hasProxy =
|
1630 |
-
typeof Proxy !== 'undefined' &&
|
1631 |
-
Proxy.toString().match(/native code/);
|
1632 |
-
|
1633 |
-
if (hasProxy) {
|
1634 |
-
var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta');
|
1635 |
-
config.keyCodes = new Proxy(config.keyCodes, {
|
1636 |
-
set: function set (target, key, value) {
|
1637 |
-
if (isBuiltInModifier(key)) {
|
1638 |
-
warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
|
1639 |
-
return false
|
1640 |
-
} else {
|
1641 |
-
target[key] = value;
|
1642 |
-
return true
|
1643 |
}
|
1644 |
-
}
|
1645 |
-
});
|
1646 |
-
}
|
1647 |
-
|
1648 |
-
var hasHandler = {
|
1649 |
-
has: function has (target, key) {
|
1650 |
-
var has = key in target;
|
1651 |
-
var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
|
1652 |
-
if (!has && !isAllowed) {
|
1653 |
-
warnNonPresent(target, key);
|
1654 |
-
}
|
1655 |
-
return has || !isAllowed
|
1656 |
-
}
|
1657 |
-
};
|
1658 |
-
|
1659 |
-
var getHandler = {
|
1660 |
-
get: function get (target, key) {
|
1661 |
-
if (typeof key === 'string' && !(key in target)) {
|
1662 |
-
warnNonPresent(target, key);
|
1663 |
-
}
|
1664 |
-
return target[key]
|
1665 |
-
}
|
1666 |
-
};
|
1667 |
-
|
1668 |
-
initProxy = function initProxy (vm) {
|
1669 |
-
if (hasProxy) {
|
1670 |
-
// determine which proxy handler to use
|
1671 |
-
var options = vm.$options;
|
1672 |
-
var handlers = options.render && options.render._withStripped
|
1673 |
-
? getHandler
|
1674 |
-
: hasHandler;
|
1675 |
-
vm._renderProxy = new Proxy(vm, handlers);
|
1676 |
-
} else {
|
1677 |
-
vm._renderProxy = vm;
|
1678 |
-
}
|
1679 |
-
};
|
1680 |
-
}
|
1681 |
-
|
1682 |
-
/* */
|
1683 |
-
|
1684 |
-
var VNode = function VNode (
|
1685 |
-
tag,
|
1686 |
-
data,
|
1687 |
-
children,
|
1688 |
-
text,
|
1689 |
-
elm,
|
1690 |
-
context,
|
1691 |
-
componentOptions,
|
1692 |
-
asyncFactory
|
1693 |
-
) {
|
1694 |
-
this.tag = tag;
|
1695 |
-
this.data = data;
|
1696 |
-
this.children = children;
|
1697 |
-
this.text = text;
|
1698 |
-
this.elm = elm;
|
1699 |
-
this.ns = undefined;
|
1700 |
-
this.context = context;
|
1701 |
-
this.functionalContext = undefined;
|
1702 |
-
this.key = data && data.key;
|
1703 |
-
this.componentOptions = componentOptions;
|
1704 |
-
this.componentInstance = undefined;
|
1705 |
-
this.parent = undefined;
|
1706 |
-
this.raw = false;
|
1707 |
-
this.isStatic = false;
|
1708 |
-
this.isRootInsert = true;
|
1709 |
-
this.isComment = false;
|
1710 |
-
this.isCloned = false;
|
1711 |
-
this.isOnce = false;
|
1712 |
-
this.asyncFactory = asyncFactory;
|
1713 |
-
this.asyncMeta = undefined;
|
1714 |
-
this.isAsyncPlaceholder = false;
|
1715 |
-
};
|
1716 |
-
|
1717 |
-
var prototypeAccessors = { child: {} };
|
1718 |
-
|
1719 |
-
// DEPRECATED: alias for componentInstance for backwards compat.
|
1720 |
-
/* istanbul ignore next */
|
1721 |
-
prototypeAccessors.child.get = function () {
|
1722 |
-
return this.componentInstance
|
1723 |
-
};
|
1724 |
-
|
1725 |
-
Object.defineProperties( VNode.prototype, prototypeAccessors );
|
1726 |
-
|
1727 |
-
var createEmptyVNode = function (text) {
|
1728 |
-
if ( text === void 0 ) text = '';
|
1729 |
-
|
1730 |
-
var node = new VNode();
|
1731 |
-
node.text = text;
|
1732 |
-
node.isComment = true;
|
1733 |
-
return node
|
1734 |
-
};
|
1735 |
-
|
1736 |
-
function createTextVNode (val) {
|
1737 |
-
return new VNode(undefined, undefined, undefined, String(val))
|
1738 |
-
}
|
1739 |
-
|
1740 |
-
// optimized shallow clone
|
1741 |
-
// used for static nodes and slot nodes because they may be reused across
|
1742 |
-
// multiple renders, cloning them avoids errors when DOM manipulations rely
|
1743 |
-
// on their elm reference.
|
1744 |
-
function cloneVNode (vnode) {
|
1745 |
-
var cloned = new VNode(
|
1746 |
-
vnode.tag,
|
1747 |
-
vnode.data,
|
1748 |
-
vnode.children,
|
1749 |
-
vnode.text,
|
1750 |
-
vnode.elm,
|
1751 |
-
vnode.context,
|
1752 |
-
vnode.componentOptions,
|
1753 |
-
vnode.asyncFactory
|
1754 |
-
);
|
1755 |
-
cloned.ns = vnode.ns;
|
1756 |
-
cloned.isStatic = vnode.isStatic;
|
1757 |
-
cloned.key = vnode.key;
|
1758 |
-
cloned.isComment = vnode.isComment;
|
1759 |
-
cloned.isCloned = true;
|
1760 |
-
return cloned
|
1761 |
-
}
|
1762 |
-
|
1763 |
-
function cloneVNodes (vnodes) {
|
1764 |
-
var len = vnodes.length;
|
1765 |
-
var res = new Array(len);
|
1766 |
-
for (var i = 0; i < len; i++) {
|
1767 |
-
res[i] = cloneVNode(vnodes[i]);
|
1768 |
-
}
|
1769 |
-
return res
|
1770 |
-
}
|
1771 |
-
|
1772 |
-
/* */
|
1773 |
-
|
1774 |
-
var normalizeEvent = cached(function (name) {
|
1775 |
-
var passive = name.charAt(0) === '&';
|
1776 |
-
name = passive ? name.slice(1) : name;
|
1777 |
-
var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
|
1778 |
-
name = once$$1 ? name.slice(1) : name;
|
1779 |
-
var capture = name.charAt(0) === '!';
|
1780 |
-
name = capture ? name.slice(1) : name;
|
1781 |
-
return {
|
1782 |
-
name: name,
|
1783 |
-
once: once$$1,
|
1784 |
-
capture: capture,
|
1785 |
-
passive: passive
|
1786 |
-
}
|
1787 |
-
});
|
1788 |
-
|
1789 |
-
function createFnInvoker (fns) {
|
1790 |
-
function invoker () {
|
1791 |
-
var arguments$1 = arguments;
|
1792 |
-
|
1793 |
-
var fns = invoker.fns;
|
1794 |
-
if (Array.isArray(fns)) {
|
1795 |
-
var cloned = fns.slice();
|
1796 |
-
for (var i = 0; i < cloned.length; i++) {
|
1797 |
-
cloned[i].apply(null, arguments$1);
|
1798 |
-
}
|
1799 |
-
} else {
|
1800 |
-
// return handler return value for single handlers
|
1801 |
-
return fns.apply(null, arguments)
|
1802 |
-
}
|
1803 |
-
}
|
1804 |
-
invoker.fns = fns;
|
1805 |
-
return invoker
|
1806 |
-
}
|
1807 |
-
|
1808 |
-
function updateListeners (
|
1809 |
-
on,
|
1810 |
-
oldOn,
|
1811 |
-
add,
|
1812 |
-
remove$$1,
|
1813 |
-
vm
|
1814 |
-
) {
|
1815 |
-
var name, cur, old, event;
|
1816 |
-
for (name in on) {
|
1817 |
-
cur = on[name];
|
1818 |
-
old = oldOn[name];
|
1819 |
-
event = normalizeEvent(name);
|
1820 |
-
if (isUndef(cur)) {
|
1821 |
-
"development" !== 'production' && warn(
|
1822 |
-
"Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
|
1823 |
-
vm
|
1824 |
-
);
|
1825 |
-
} else if (isUndef(old)) {
|
1826 |
-
if (isUndef(cur.fns)) {
|
1827 |
-
cur = on[name] = createFnInvoker(cur);
|
1828 |
-
}
|
1829 |
-
add(event.name, cur, event.once, event.capture, event.passive);
|
1830 |
-
} else if (cur !== old) {
|
1831 |
-
old.fns = cur;
|
1832 |
-
on[name] = old;
|
1833 |
-
}
|
1834 |
-
}
|
1835 |
-
for (name in oldOn) {
|
1836 |
-
if (isUndef(on[name])) {
|
1837 |
-
event = normalizeEvent(name);
|
1838 |
-
remove$$1(event.name, oldOn[name], event.capture);
|
1839 |
-
}
|
1840 |
-
}
|
1841 |
-
}
|
1842 |
-
|
1843 |
-
/* */
|
1844 |
-
|
1845 |
-
function mergeVNodeHook (def, hookKey, hook) {
|
1846 |
-
var invoker;
|
1847 |
-
var oldHook = def[hookKey];
|
1848 |
-
|
1849 |
-
function wrappedHook () {
|
1850 |
-
hook.apply(this, arguments);
|
1851 |
-
// important: remove merged hook to ensure it's called only once
|
1852 |
-
// and prevent memory leak
|
1853 |
-
remove(invoker.fns, wrappedHook);
|
1854 |
-
}
|
1855 |
-
|
1856 |
-
if (isUndef(oldHook)) {
|
1857 |
-
// no existing hook
|
1858 |
-
invoker = createFnInvoker([wrappedHook]);
|
1859 |
-
} else {
|
1860 |
-
/* istanbul ignore if */
|
1861 |
-
if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
|
1862 |
-
// already a merged invoker
|
1863 |
-
invoker = oldHook;
|
1864 |
-
invoker.fns.push(wrappedHook);
|
1865 |
-
} else {
|
1866 |
-
// existing plain hook
|
1867 |
-
invoker = createFnInvoker([oldHook, wrappedHook]);
|
1868 |
-
}
|
1869 |
-
}
|
1870 |
-
|
1871 |
-
invoker.merged = true;
|
1872 |
-
def[hookKey] = invoker;
|
1873 |
-
}
|
1874 |
-
|
1875 |
-
/* */
|
1876 |
-
|
1877 |
-
function extractPropsFromVNodeData (
|
1878 |
-
data,
|
1879 |
-
Ctor,
|
1880 |
-
tag
|
1881 |
-
) {
|
1882 |
-
// we are only extracting raw values here.
|
1883 |
-
// validation and default values are handled in the child
|
1884 |
-
// component itself.
|
1885 |
-
var propOptions = Ctor.options.props;
|
1886 |
-
if (isUndef(propOptions)) {
|
1887 |
-
return
|
1888 |
-
}
|
1889 |
-
var res = {};
|
1890 |
-
var attrs = data.attrs;
|
1891 |
-
var props = data.props;
|
1892 |
-
if (isDef(attrs) || isDef(props)) {
|
1893 |
-
for (var key in propOptions) {
|
1894 |
-
var altKey = hyphenate(key);
|
1895 |
-
{
|
1896 |
-
var keyInLowerCase = key.toLowerCase();
|
1897 |
-
if (
|
1898 |
-
key !== keyInLowerCase &&
|
1899 |
-
attrs && hasOwn(attrs, keyInLowerCase)
|
1900 |
-
) {
|
1901 |
-
tip(
|
1902 |
-
"Prop \"" + keyInLowerCase + "\" is passed to component " +
|
1903 |
-
(formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
|
1904 |
-
" \"" + key + "\". " +
|
1905 |
-
"Note that HTML attributes are case-insensitive and camelCased " +
|
1906 |
-
"props need to use their kebab-case equivalents when using in-DOM " +
|
1907 |
-
"templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
|
1908 |
-
);
|
1909 |
-
}
|
1910 |
-
}
|
1911 |
-
checkProp(res, props, key, altKey, true) ||
|
1912 |
-
checkProp(res, attrs, key, altKey, false);
|
1913 |
-
}
|
1914 |
-
}
|
1915 |
-
return res
|
1916 |
-
}
|
1917 |
-
|
1918 |
-
function checkProp (
|
1919 |
-
res,
|
1920 |
-
hash,
|
1921 |
-
key,
|
1922 |
-
altKey,
|
1923 |
-
preserve
|
1924 |
-
) {
|
1925 |
-
if (isDef(hash)) {
|
1926 |
-
if (hasOwn(hash, key)) {
|
1927 |
-
res[key] = hash[key];
|
1928 |
-
if (!preserve) {
|
1929 |
-
delete hash[key];
|
1930 |
-
}
|
1931 |
-
return true
|
1932 |
-
} else if (hasOwn(hash, altKey)) {
|
1933 |
-
res[key] = hash[altKey];
|
1934 |
-
if (!preserve) {
|
1935 |
-
delete hash[altKey];
|
1936 |
-
}
|
1937 |
-
return true
|
1938 |
-
}
|
1939 |
-
}
|
1940 |
-
return false
|
1941 |
-
}
|
1942 |
-
|
1943 |
-
/* */
|
1944 |
-
|
1945 |
-
// The template compiler attempts to minimize the need for normalization by
|
1946 |
-
// statically analyzing the template at compile time.
|
1947 |
-
//
|
1948 |
-
// For plain HTML markup, normalization can be completely skipped because the
|
1949 |
-
// generated render function is guaranteed to return Array<VNode>. There are
|
1950 |
-
// two cases where extra normalization is needed:
|
1951 |
-
|
1952 |
-
// 1. When the children contains components - because a functional component
|
1953 |
-
// may return an Array instead of a single root. In this case, just a simple
|
1954 |
-
// normalization is needed - if any child is an Array, we flatten the whole
|
1955 |
-
// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
|
1956 |
-
// because functional components already normalize their own children.
|
1957 |
-
function simpleNormalizeChildren (children) {
|
1958 |
-
for (var i = 0; i < children.length; i++) {
|
1959 |
-
if (Array.isArray(children[i])) {
|
1960 |
-
return Array.prototype.concat.apply([], children)
|
1961 |
-
}
|
1962 |
-
}
|
1963 |
-
return children
|
1964 |
-
}
|
1965 |
-
|
1966 |
-
// 2. When the children contains constructs that always generated nested Arrays,
|
1967 |
-
// e.g. <template>, <slot>, v-for, or when the children is provided by user
|
1968 |
-
// with hand-written render functions / JSX. In such cases a full normalization
|
1969 |
-
// is needed to cater to all possible types of children values.
|
1970 |
-
function normalizeChildren (children) {
|
1971 |
-
return isPrimitive(children)
|
1972 |
-
? [createTextVNode(children)]
|
1973 |
-
: Array.isArray(children)
|
1974 |
-
? normalizeArrayChildren(children)
|
1975 |
-
: undefined
|
1976 |
-
}
|
1977 |
-
|
1978 |
-
function isTextNode (node) {
|
1979 |
-
return isDef(node) && isDef(node.text) && isFalse(node.isComment)
|
1980 |
-
}
|
1981 |
-
|
1982 |
-
function normalizeArrayChildren (children, nestedIndex) {
|
1983 |
-
var res = [];
|
1984 |
-
var i, c, last;
|
1985 |
-
for (i = 0; i < children.length; i++) {
|
1986 |
-
c = children[i];
|
1987 |
-
if (isUndef(c) || typeof c === 'boolean') { continue }
|
1988 |
-
last = res[res.length - 1];
|
1989 |
-
// nested
|
1990 |
-
if (Array.isArray(c)) {
|
1991 |
-
res.push.apply(res, normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)));
|
1992 |
-
} else if (isPrimitive(c)) {
|
1993 |
-
if (isTextNode(last)) {
|
1994 |
-
// merge adjacent text nodes
|
1995 |
-
// this is necessary for SSR hydration because text nodes are
|
1996 |
-
// essentially merged when rendered to HTML strings
|
1997 |
-
(last).text += String(c);
|
1998 |
-
} else if (c !== '') {
|
1999 |
-
// convert primitive to vnode
|
2000 |
-
res.push(createTextVNode(c));
|
2001 |
-
}
|
2002 |
-
} else {
|
2003 |
-
if (isTextNode(c) && isTextNode(last)) {
|
2004 |
-
// merge adjacent text nodes
|
2005 |
-
res[res.length - 1] = createTextVNode(last.text + c.text);
|
2006 |
-
} else {
|
2007 |
-
// default key for nested array children (likely generated by v-for)
|
2008 |
-
if (isTrue(children._isVList) &&
|
2009 |
-
isDef(c.tag) &&
|
2010 |
-
isUndef(c.key) &&
|
2011 |
-
isDef(nestedIndex)) {
|
2012 |
-
c.key = "__vlist" + nestedIndex + "_" + i + "__";
|
2013 |
-
}
|
2014 |
-
res.push(c);
|
2015 |
-
}
|
2016 |
-
}
|
2017 |
-
}
|
2018 |
-
return res
|
2019 |
-
}
|
2020 |
-
|
2021 |
-
/* */
|
2022 |
-
|
2023 |
-
function ensureCtor (comp, base) {
|
2024 |
-
if (comp.__esModule && comp.default) {
|
2025 |
-
comp = comp.default;
|
2026 |
-
}
|
2027 |
-
return isObject(comp)
|
2028 |
-
? base.extend(comp)
|
2029 |
-
: comp
|
2030 |
-
}
|
2031 |
-
|
2032 |
-
function createAsyncPlaceholder (
|
2033 |
-
factory,
|
2034 |
-
data,
|
2035 |
-
context,
|
2036 |
-
children,
|
2037 |
-
tag
|
2038 |
-
) {
|
2039 |
-
var node = createEmptyVNode();
|
2040 |
-
node.asyncFactory = factory;
|
2041 |
-
node.asyncMeta = { data: data, context: context, children: children, tag: tag };
|
2042 |
-
return node
|
2043 |
-
}
|
2044 |
-
|
2045 |
-
function resolveAsyncComponent (
|
2046 |
-
factory,
|
2047 |
-
baseCtor,
|
2048 |
-
context
|
2049 |
-
) {
|
2050 |
-
if (isTrue(factory.error) && isDef(factory.errorComp)) {
|
2051 |
-
return factory.errorComp
|
2052 |
-
}
|
2053 |
-
|
2054 |
-
if (isDef(factory.resolved)) {
|
2055 |
-
return factory.resolved
|
2056 |
-
}
|
2057 |
-
|
2058 |
-
if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
|
2059 |
-
return factory.loadingComp
|
2060 |
-
}
|
2061 |
-
|
2062 |
-
if (isDef(factory.contexts)) {
|
2063 |
-
// already pending
|
2064 |
-
factory.contexts.push(context);
|
2065 |
-
} else {
|
2066 |
-
var contexts = factory.contexts = [context];
|
2067 |
-
var sync = true;
|
2068 |
-
|
2069 |
-
var forceRender = function () {
|
2070 |
-
for (var i = 0, l = contexts.length; i < l; i++) {
|
2071 |
-
contexts[i].$forceUpdate();
|
2072 |
-
}
|
2073 |
};
|
2074 |
|
2075 |
-
|
2076 |
-
|
2077 |
-
|
2078 |
-
|
2079 |
-
|
2080 |
-
|
2081 |
-
|
2082 |
-
|
2083 |
-
});
|
2084 |
-
|
2085 |
-
var reject = once(function (reason) {
|
2086 |
-
"development" !== 'production' && warn(
|
2087 |
-
"Failed to resolve async component: " + (String(factory)) +
|
2088 |
-
(reason ? ("\nReason: " + reason) : '')
|
2089 |
-
);
|
2090 |
-
if (isDef(factory.errorComp)) {
|
2091 |
-
factory.error = true;
|
2092 |
-
forceRender();
|
2093 |
-
}
|
2094 |
-
});
|
2095 |
-
|
2096 |
-
var res = factory(resolve, reject);
|
2097 |
-
|
2098 |
-
if (isObject(res)) {
|
2099 |
-
if (typeof res.then === 'function') {
|
2100 |
-
// () => Promise
|
2101 |
-
if (isUndef(factory.resolved)) {
|
2102 |
-
res.then(resolve, reject);
|
2103 |
}
|
2104 |
-
|
2105 |
-
|
2106 |
-
|
2107 |
-
if (isDef(res.error)) {
|
2108 |
-
factory.errorComp = ensureCtor(res.error, baseCtor);
|
2109 |
}
|
|
|
2110 |
|
2111 |
-
|
2112 |
-
|
2113 |
-
|
2114 |
-
|
2115 |
-
|
2116 |
-
|
2117 |
-
|
2118 |
-
|
2119 |
-
|
2120 |
-
}
|
2121 |
-
}, res.delay || 200);
|
2122 |
-
}
|
2123 |
-
}
|
2124 |
-
|
2125 |
-
if (isDef(res.timeout)) {
|
2126 |
-
setTimeout(function () {
|
2127 |
-
if (isUndef(factory.resolved)) {
|
2128 |
-
reject(
|
2129 |
-
"timeout (" + (res.timeout) + "ms)"
|
2130 |
-
);
|
2131 |
-
}
|
2132 |
-
}, res.timeout);
|
2133 |
-
}
|
2134 |
-
}
|
2135 |
-
}
|
2136 |
-
|
2137 |
-
sync = false;
|
2138 |
-
// return in case resolved synchronously
|
2139 |
-
return factory.loading
|
2140 |
-
? factory.loadingComp
|
2141 |
-
: factory.resolved
|
2142 |
-
}
|
2143 |
-
}
|
2144 |
-
|
2145 |
-
/* */
|
2146 |
-
|
2147 |
-
function getFirstComponentChild (children) {
|
2148 |
-
if (Array.isArray(children)) {
|
2149 |
-
for (var i = 0; i < children.length; i++) {
|
2150 |
-
var c = children[i];
|
2151 |
-
if (isDef(c) && isDef(c.componentOptions)) {
|
2152 |
-
return c
|
2153 |
-
}
|
2154 |
-
}
|
2155 |
-
}
|
2156 |
-
}
|
2157 |
-
|
2158 |
-
/* */
|
2159 |
-
|
2160 |
-
/* */
|
2161 |
-
|
2162 |
-
function initEvents (vm) {
|
2163 |
-
vm._events = Object.create(null);
|
2164 |
-
vm._hasHookEvent = false;
|
2165 |
-
// init parent attached events
|
2166 |
-
var listeners = vm.$options._parentListeners;
|
2167 |
-
if (listeners) {
|
2168 |
-
updateComponentListeners(vm, listeners);
|
2169 |
-
}
|
2170 |
-
}
|
2171 |
-
|
2172 |
-
var target;
|
2173 |
-
|
2174 |
-
function add (event, fn, once$$1) {
|
2175 |
-
if (once$$1) {
|
2176 |
-
target.$once(event, fn);
|
2177 |
-
} else {
|
2178 |
-
target.$on(event, fn);
|
2179 |
-
}
|
2180 |
-
}
|
2181 |
-
|
2182 |
-
function remove$1 (event, fn) {
|
2183 |
-
target.$off(event, fn);
|
2184 |
-
}
|
2185 |
-
|
2186 |
-
function updateComponentListeners (
|
2187 |
-
vm,
|
2188 |
-
listeners,
|
2189 |
-
oldListeners
|
2190 |
-
) {
|
2191 |
-
target = vm;
|
2192 |
-
updateListeners(listeners, oldListeners || {}, add, remove$1, vm);
|
2193 |
-
}
|
2194 |
-
|
2195 |
-
function eventsMixin (Vue) {
|
2196 |
-
var hookRE = /^hook:/;
|
2197 |
-
Vue.prototype.$on = function (event, fn) {
|
2198 |
-
var this$1 = this;
|
2199 |
-
|
2200 |
-
var vm = this;
|
2201 |
-
if (Array.isArray(event)) {
|
2202 |
-
for (var i = 0, l = event.length; i < l; i++) {
|
2203 |
-
this$1.$on(event[i], fn);
|
2204 |
-
}
|
2205 |
-
} else {
|
2206 |
-
(vm._events[event] || (vm._events[event] = [])).push(fn);
|
2207 |
-
// optimize hook:event cost by using a boolean flag marked at registration
|
2208 |
-
// instead of a hash lookup
|
2209 |
-
if (hookRE.test(event)) {
|
2210 |
-
vm._hasHookEvent = true;
|
2211 |
-
}
|
2212 |
-
}
|
2213 |
-
return vm
|
2214 |
-
};
|
2215 |
-
|
2216 |
-
Vue.prototype.$once = function (event, fn) {
|
2217 |
-
var vm = this;
|
2218 |
-
function on () {
|
2219 |
-
vm.$off(event, on);
|
2220 |
-
fn.apply(vm, arguments);
|
2221 |
-
}
|
2222 |
-
on.fn = fn;
|
2223 |
-
vm.$on(event, on);
|
2224 |
-
return vm
|
2225 |
-
};
|
2226 |
-
|
2227 |
-
Vue.prototype.$off = function (event, fn) {
|
2228 |
-
var this$1 = this;
|
2229 |
-
|
2230 |
-
var vm = this;
|
2231 |
-
// all
|
2232 |
-
if (!arguments.length) {
|
2233 |
-
vm._events = Object.create(null);
|
2234 |
-
return vm
|
2235 |
-
}
|
2236 |
-
// array of events
|
2237 |
-
if (Array.isArray(event)) {
|
2238 |
-
for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
|
2239 |
-
this$1.$off(event[i$1], fn);
|
2240 |
-
}
|
2241 |
-
return vm
|
2242 |
-
}
|
2243 |
-
// specific event
|
2244 |
-
var cbs = vm._events[event];
|
2245 |
-
if (!cbs) {
|
2246 |
-
return vm
|
2247 |
-
}
|
2248 |
-
if (arguments.length === 1) {
|
2249 |
-
vm._events[event] = null;
|
2250 |
-
return vm
|
2251 |
-
}
|
2252 |
-
// specific handler
|
2253 |
-
var cb;
|
2254 |
-
var i = cbs.length;
|
2255 |
-
while (i--) {
|
2256 |
-
cb = cbs[i];
|
2257 |
-
if (cb === fn || cb.fn === fn) {
|
2258 |
-
cbs.splice(i, 1);
|
2259 |
-
break
|
2260 |
-
}
|
2261 |
-
}
|
2262 |
-
return vm
|
2263 |
-
};
|
2264 |
-
|
2265 |
-
Vue.prototype.$emit = function (event) {
|
2266 |
-
var vm = this;
|
2267 |
-
{
|
2268 |
-
var lowerCaseEvent = event.toLowerCase();
|
2269 |
-
if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
|
2270 |
-
tip(
|
2271 |
-
"Event \"" + lowerCaseEvent + "\" is emitted in component " +
|
2272 |
-
(formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
|
2273 |
-
"Note that HTML attributes are case-insensitive and you cannot use " +
|
2274 |
-
"v-on to listen to camelCase events when using in-DOM templates. " +
|
2275 |
-
"You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
|
2276 |
-
);
|
2277 |
-
}
|
2278 |
}
|
2279 |
-
|
2280 |
-
|
2281 |
-
|
2282 |
-
|
2283 |
-
for (var i = 0, l = cbs.length; i < l; i++) {
|
2284 |
-
try {
|
2285 |
-
cbs[i].apply(vm, args);
|
2286 |
-
} catch (e) {
|
2287 |
-
handleError(e, vm, ("event handler for \"" + event + "\""));
|
2288 |
-
}
|
2289 |
-
}
|
2290 |
}
|
2291 |
-
return vm
|
2292 |
-
};
|
2293 |
-
}
|
2294 |
|
2295 |
-
/* */
|
2296 |
|
2297 |
-
|
2298 |
-
|
2299 |
-
|
2300 |
-
|
2301 |
-
|
2302 |
-
|
2303 |
-
|
2304 |
-
|
2305 |
-
|
2306 |
-
return slots
|
2307 |
-
}
|
2308 |
-
var defaultSlot = [];
|
2309 |
-
for (var i = 0, l = children.length; i < l; i++) {
|
2310 |
-
var child = children[i];
|
2311 |
-
// named slots should only be respected if the vnode was rendered in the
|
2312 |
-
// same context.
|
2313 |
-
if ((child.context === context || child.functionalContext === context) &&
|
2314 |
-
child.data && child.data.slot != null
|
2315 |
) {
|
2316 |
-
|
2317 |
-
|
2318 |
-
|
2319 |
-
|
2320 |
-
|
2321 |
-
|
2322 |
-
|
2323 |
-
|
2324 |
-
|
2325 |
-
|
2326 |
-
|
2327 |
-
|
2328 |
-
|
2329 |
-
|
2330 |
-
|
2331 |
-
|
2332 |
-
|
2333 |
-
|
2334 |
-
|
2335 |
-
|
2336 |
-
|
2337 |
-
|
2338 |
-
|
2339 |
-
|
2340 |
-
res
|
2341 |
-
) {
|
2342 |
-
res = res || {};
|
2343 |
-
for (var i = 0; i < fns.length; i++) {
|
2344 |
-
if (Array.isArray(fns[i])) {
|
2345 |
-
resolveScopedSlots(fns[i], res);
|
2346 |
-
} else {
|
2347 |
-
res[fns[i].key] = fns[i].fn;
|
2348 |
-
}
|
2349 |
-
}
|
2350 |
-
return res
|
2351 |
-
}
|
2352 |
-
|
2353 |
-
/* */
|
2354 |
-
|
2355 |
-
var activeInstance = null;
|
2356 |
-
var isUpdatingChildComponent = false;
|
2357 |
-
|
2358 |
-
function initLifecycle (vm) {
|
2359 |
-
var options = vm.$options;
|
2360 |
-
|
2361 |
-
// locate first non-abstract parent
|
2362 |
-
var parent = options.parent;
|
2363 |
-
if (parent && !options.abstract) {
|
2364 |
-
while (parent.$options.abstract && parent.$parent) {
|
2365 |
-
parent = parent.$parent;
|
2366 |
-
}
|
2367 |
-
parent.$children.push(vm);
|
2368 |
-
}
|
2369 |
-
|
2370 |
-
vm.$parent = parent;
|
2371 |
-
vm.$root = parent ? parent.$root : vm;
|
2372 |
-
|
2373 |
-
vm.$children = [];
|
2374 |
-
vm.$refs = {};
|
2375 |
-
|
2376 |
-
vm._watcher = null;
|
2377 |
-
vm._inactive = null;
|
2378 |
-
vm._directInactive = false;
|
2379 |
-
vm._isMounted = false;
|
2380 |
-
vm._isDestroyed = false;
|
2381 |
-
vm._isBeingDestroyed = false;
|
2382 |
-
}
|
2383 |
-
|
2384 |
-
function lifecycleMixin (Vue) {
|
2385 |
-
Vue.prototype._update = function (vnode, hydrating) {
|
2386 |
-
var vm = this;
|
2387 |
-
if (vm._isMounted) {
|
2388 |
-
callHook(vm, 'beforeUpdate');
|
2389 |
-
}
|
2390 |
-
var prevEl = vm.$el;
|
2391 |
-
var prevVnode = vm._vnode;
|
2392 |
-
var prevActiveInstance = activeInstance;
|
2393 |
-
activeInstance = vm;
|
2394 |
-
vm._vnode = vnode;
|
2395 |
-
// Vue.prototype.__patch__ is injected in entry points
|
2396 |
-
// based on the rendering backend used.
|
2397 |
-
if (!prevVnode) {
|
2398 |
-
// initial render
|
2399 |
-
vm.$el = vm.__patch__(
|
2400 |
-
vm.$el, vnode, hydrating, false /* removeOnly */,
|
2401 |
-
vm.$options._parentElm,
|
2402 |
-
vm.$options._refElm
|
2403 |
-
);
|
2404 |
-
// no need for the ref nodes after initial patch
|
2405 |
-
// this prevents keeping a detached DOM tree in memory (#5851)
|
2406 |
-
vm.$options._parentElm = vm.$options._refElm = null;
|
2407 |
-
} else {
|
2408 |
-
// updates
|
2409 |
-
vm.$el = vm.__patch__(prevVnode, vnode);
|
2410 |
-
}
|
2411 |
-
activeInstance = prevActiveInstance;
|
2412 |
-
// update __vue__ reference
|
2413 |
-
if (prevEl) {
|
2414 |
-
prevEl.__vue__ = null;
|
2415 |
-
}
|
2416 |
-
if (vm.$el) {
|
2417 |
-
vm.$el.__vue__ = vm;
|
2418 |
-
}
|
2419 |
-
// if parent is an HOC, update its $el as well
|
2420 |
-
if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
|
2421 |
-
vm.$parent.$el = vm.$el;
|
2422 |
-
}
|
2423 |
-
// updated hook is called by the scheduler to ensure that children are
|
2424 |
-
// updated in a parent's updated hook.
|
2425 |
-
};
|
2426 |
-
|
2427 |
-
Vue.prototype.$forceUpdate = function () {
|
2428 |
-
var vm = this;
|
2429 |
-
if (vm._watcher) {
|
2430 |
-
vm._watcher.update();
|
2431 |
-
}
|
2432 |
-
};
|
2433 |
-
|
2434 |
-
Vue.prototype.$destroy = function () {
|
2435 |
-
var vm = this;
|
2436 |
-
if (vm._isBeingDestroyed) {
|
2437 |
-
return
|
2438 |
-
}
|
2439 |
-
callHook(vm, 'beforeDestroy');
|
2440 |
-
vm._isBeingDestroyed = true;
|
2441 |
-
// remove self from parent
|
2442 |
-
var parent = vm.$parent;
|
2443 |
-
if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
|
2444 |
-
remove(parent.$children, vm);
|
2445 |
-
}
|
2446 |
-
// teardown watchers
|
2447 |
-
if (vm._watcher) {
|
2448 |
-
vm._watcher.teardown();
|
2449 |
-
}
|
2450 |
-
var i = vm._watchers.length;
|
2451 |
-
while (i--) {
|
2452 |
-
vm._watchers[i].teardown();
|
2453 |
-
}
|
2454 |
-
// remove reference from data ob
|
2455 |
-
// frozen object may not have observer.
|
2456 |
-
if (vm._data.__ob__) {
|
2457 |
-
vm._data.__ob__.vmCount--;
|
2458 |
-
}
|
2459 |
-
// call the last hook...
|
2460 |
-
vm._isDestroyed = true;
|
2461 |
-
// invoke destroy hooks on current rendered tree
|
2462 |
-
vm.__patch__(vm._vnode, null);
|
2463 |
-
// fire destroyed hook
|
2464 |
-
callHook(vm, 'destroyed');
|
2465 |
-
// turn off all instance listeners.
|
2466 |
-
vm.$off();
|
2467 |
-
// remove __vue__ reference
|
2468 |
-
if (vm.$el) {
|
2469 |
-
vm.$el.__vue__ = null;
|
2470 |
-
}
|
2471 |
-
};
|
2472 |
-
}
|
2473 |
-
|
2474 |
-
function mountComponent (
|
2475 |
-
vm,
|
2476 |
-
el,
|
2477 |
-
hydrating
|
2478 |
-
) {
|
2479 |
-
vm.$el = el;
|
2480 |
-
if (!vm.$options.render) {
|
2481 |
-
vm.$options.render = createEmptyVNode;
|
2482 |
-
{
|
2483 |
-
/* istanbul ignore if */
|
2484 |
-
if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
|
2485 |
-
vm.$options.el || el) {
|
2486 |
-
warn(
|
2487 |
-
'You are using the runtime-only build of Vue where the template ' +
|
2488 |
-
'compiler is not available. Either pre-compile the templates into ' +
|
2489 |
-
'render functions, or use the compiler-included build.',
|
2490 |
-
vm
|
2491 |
-
);
|
2492 |
-
} else {
|
2493 |
-
warn(
|
2494 |
-
'Failed to mount component: template or render function not defined.',
|
2495 |
-
vm
|
2496 |
-
);
|
2497 |
-
}
|
2498 |
-
}
|
2499 |
-
}
|
2500 |
-
callHook(vm, 'beforeMount');
|
2501 |
|
2502 |
-
|
2503 |
-
|
2504 |
-
|
2505 |
-
|
2506 |
-
|
2507 |
-
|
2508 |
-
var startTag = "vue-perf-start:" + id;
|
2509 |
-
var endTag = "vue-perf-end:" + id;
|
2510 |
-
|
2511 |
-
mark(startTag);
|
2512 |
-
var vnode = vm._render();
|
2513 |
-
mark(endTag);
|
2514 |
-
measure((name + " render"), startTag, endTag);
|
2515 |
-
|
2516 |
-
mark(startTag);
|
2517 |
-
vm._update(vnode, hydrating);
|
2518 |
-
mark(endTag);
|
2519 |
-
measure((name + " patch"), startTag, endTag);
|
2520 |
};
|
2521 |
-
|
2522 |
-
|
2523 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2524 |
};
|
2525 |
-
|
2526 |
-
|
2527 |
-
|
2528 |
-
|
2529 |
-
|
2530 |
-
|
2531 |
-
|
2532 |
-
|
2533 |
-
|
2534 |
-
|
2535 |
-
|
2536 |
-
|
2537 |
-
|
2538 |
-
|
2539 |
-
|
2540 |
-
|
2541 |
-
|
2542 |
-
|
2543 |
-
|
2544 |
-
|
2545 |
-
|
2546 |
-
|
2547 |
-
isUpdatingChildComponent = true;
|
2548 |
-
}
|
2549 |
-
|
2550 |
-
// determine whether component has slot children
|
2551 |
-
// we need to do this before overwriting $options._renderChildren
|
2552 |
-
var hasChildren = !!(
|
2553 |
-
renderChildren || // has new static slots
|
2554 |
-
vm.$options._renderChildren || // has old static slots
|
2555 |
-
parentVnode.data.scopedSlots || // has new scoped slots
|
2556 |
-
vm.$scopedSlots !== emptyObject // has old scoped slots
|
2557 |
-
);
|
2558 |
-
|
2559 |
-
vm.$options._parentVnode = parentVnode;
|
2560 |
-
vm.$vnode = parentVnode; // update vm's placeholder node without re-render
|
2561 |
-
|
2562 |
-
if (vm._vnode) { // update child tree's parent
|
2563 |
-
vm._vnode.parent = parentVnode;
|
2564 |
-
}
|
2565 |
-
vm.$options._renderChildren = renderChildren;
|
2566 |
-
|
2567 |
-
// update $attrs and $listensers hash
|
2568 |
-
// these are also reactive so they may trigger child update if the child
|
2569 |
-
// used them during render
|
2570 |
-
vm.$attrs = parentVnode.data && parentVnode.data.attrs;
|
2571 |
-
vm.$listeners = listeners;
|
2572 |
-
|
2573 |
-
// update props
|
2574 |
-
if (propsData && vm.$options.props) {
|
2575 |
-
observerState.shouldConvert = false;
|
2576 |
-
var props = vm._props;
|
2577 |
-
var propKeys = vm.$options._propKeys || [];
|
2578 |
-
for (var i = 0; i < propKeys.length; i++) {
|
2579 |
-
var key = propKeys[i];
|
2580 |
-
props[key] = validateProp(key, vm.$options.props, propsData, vm);
|
2581 |
-
}
|
2582 |
-
observerState.shouldConvert = true;
|
2583 |
-
// keep a copy of raw propsData
|
2584 |
-
vm.$options.propsData = propsData;
|
2585 |
-
}
|
2586 |
-
|
2587 |
-
// update listeners
|
2588 |
-
if (listeners) {
|
2589 |
-
var oldListeners = vm.$options._parentListeners;
|
2590 |
-
vm.$options._parentListeners = listeners;
|
2591 |
-
updateComponentListeners(vm, listeners, oldListeners);
|
2592 |
-
}
|
2593 |
-
// resolve slots + force update if has children
|
2594 |
-
if (hasChildren) {
|
2595 |
-
vm.$slots = resolveSlots(renderChildren, parentVnode.context);
|
2596 |
-
vm.$forceUpdate();
|
2597 |
-
}
|
2598 |
-
|
2599 |
-
{
|
2600 |
-
isUpdatingChildComponent = false;
|
2601 |
-
}
|
2602 |
-
}
|
2603 |
-
|
2604 |
-
function isInInactiveTree (vm) {
|
2605 |
-
while (vm && (vm = vm.$parent)) {
|
2606 |
-
if (vm._inactive) { return true }
|
2607 |
-
}
|
2608 |
-
return false
|
2609 |
-
}
|
2610 |
-
|
2611 |
-
function activateChildComponent (vm, direct) {
|
2612 |
-
if (direct) {
|
2613 |
-
vm._directInactive = false;
|
2614 |
-
if (isInInactiveTree(vm)) {
|
2615 |
-
return
|
2616 |
-
}
|
2617 |
-
} else if (vm._directInactive) {
|
2618 |
-
return
|
2619 |
-
}
|
2620 |
-
if (vm._inactive || vm._inactive === null) {
|
2621 |
-
vm._inactive = false;
|
2622 |
-
for (var i = 0; i < vm.$children.length; i++) {
|
2623 |
-
activateChildComponent(vm.$children[i]);
|
2624 |
-
}
|
2625 |
-
callHook(vm, 'activated');
|
2626 |
-
}
|
2627 |
-
}
|
2628 |
-
|
2629 |
-
function deactivateChildComponent (vm, direct) {
|
2630 |
-
if (direct) {
|
2631 |
-
vm._directInactive = true;
|
2632 |
-
if (isInInactiveTree(vm)) {
|
2633 |
-
return
|
2634 |
-
}
|
2635 |
-
}
|
2636 |
-
if (!vm._inactive) {
|
2637 |
-
vm._inactive = true;
|
2638 |
-
for (var i = 0; i < vm.$children.length; i++) {
|
2639 |
-
deactivateChildComponent(vm.$children[i]);
|
2640 |
-
}
|
2641 |
-
callHook(vm, 'deactivated');
|
2642 |
-
}
|
2643 |
-
}
|
2644 |
-
|
2645 |
-
function callHook (vm, hook) {
|
2646 |
-
var handlers = vm.$options[hook];
|
2647 |
-
if (handlers) {
|
2648 |
-
for (var i = 0, j = handlers.length; i < j; i++) {
|
2649 |
-
try {
|
2650 |
-
handlers[i].call(vm);
|
2651 |
-
} catch (e) {
|
2652 |
-
handleError(e, vm, (hook + " hook"));
|
2653 |
-
}
|
2654 |
-
}
|
2655 |
-
}
|
2656 |
-
if (vm._hasHookEvent) {
|
2657 |
-
vm.$emit('hook:' + hook);
|
2658 |
-
}
|
2659 |
-
}
|
2660 |
-
|
2661 |
-
/* */
|
2662 |
-
|
2663 |
-
|
2664 |
-
var MAX_UPDATE_COUNT = 100;
|
2665 |
-
|
2666 |
-
var queue = [];
|
2667 |
-
var activatedChildren = [];
|
2668 |
-
var has = {};
|
2669 |
-
var circular = {};
|
2670 |
-
var waiting = false;
|
2671 |
-
var flushing = false;
|
2672 |
-
var index = 0;
|
2673 |
-
|
2674 |
-
/**
|
2675 |
-
* Reset the scheduler's state.
|
2676 |
-
*/
|
2677 |
-
function resetSchedulerState () {
|
2678 |
-
index = queue.length = activatedChildren.length = 0;
|
2679 |
-
has = {};
|
2680 |
-
{
|
2681 |
-
circular = {};
|
2682 |
-
}
|
2683 |
-
waiting = flushing = false;
|
2684 |
-
}
|
2685 |
-
|
2686 |
-
/**
|
2687 |
-
* Flush both queues and run the watchers.
|
2688 |
-
*/
|
2689 |
-
function flushSchedulerQueue () {
|
2690 |
-
flushing = true;
|
2691 |
-
var watcher, id;
|
2692 |
-
|
2693 |
-
// Sort queue before flush.
|
2694 |
-
// This ensures that:
|
2695 |
-
// 1. Components are updated from parent to child. (because parent is always
|
2696 |
-
// created before the child)
|
2697 |
-
// 2. A component's user watchers are run before its render watcher (because
|
2698 |
-
// user watchers are created before the render watcher)
|
2699 |
-
// 3. If a component is destroyed during a parent component's watcher run,
|
2700 |
-
// its watchers can be skipped.
|
2701 |
-
queue.sort(function (a, b) { return a.id - b.id; });
|
2702 |
-
|
2703 |
-
// do not cache length because more watchers might be pushed
|
2704 |
-
// as we run existing watchers
|
2705 |
-
for (index = 0; index < queue.length; index++) {
|
2706 |
-
watcher = queue[index];
|
2707 |
-
id = watcher.id;
|
2708 |
-
has[id] = null;
|
2709 |
-
watcher.run();
|
2710 |
-
// in dev build, check and stop circular updates.
|
2711 |
-
if ("development" !== 'production' && has[id] != null) {
|
2712 |
-
circular[id] = (circular[id] || 0) + 1;
|
2713 |
-
if (circular[id] > MAX_UPDATE_COUNT) {
|
2714 |
-
warn(
|
2715 |
-
'You may have an infinite update loop ' + (
|
2716 |
-
watcher.user
|
2717 |
-
? ("in watcher with expression \"" + (watcher.expression) + "\"")
|
2718 |
-
: "in a component render function."
|
2719 |
-
),
|
2720 |
-
watcher.vm
|
2721 |
);
|
2722 |
-
|
2723 |
-
|
2724 |
-
|
2725 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2726 |
|
2727 |
-
|
2728 |
-
|
2729 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2730 |
|
2731 |
-
|
2732 |
|
2733 |
-
|
2734 |
-
callActivatedHooks(activatedQueue);
|
2735 |
-
callUpdatedHooks(updatedQueue);
|
2736 |
|
2737 |
-
|
2738 |
-
|
2739 |
-
|
2740 |
-
|
2741 |
-
|
2742 |
-
}
|
2743 |
-
|
2744 |
-
function callUpdatedHooks (queue) {
|
2745 |
-
var i = queue.length;
|
2746 |
-
while (i--) {
|
2747 |
-
var watcher = queue[i];
|
2748 |
-
var vm = watcher.vm;
|
2749 |
-
if (vm._watcher === watcher && vm._isMounted) {
|
2750 |
-
callHook(vm, 'updated');
|
2751 |
-
}
|
2752 |
-
}
|
2753 |
-
}
|
2754 |
-
|
2755 |
-
/**
|
2756 |
-
* Queue a kept-alive component that was activated during patch.
|
2757 |
-
* The queue will be processed after the entire tree has been patched.
|
2758 |
-
*/
|
2759 |
-
function queueActivatedComponent (vm) {
|
2760 |
-
// setting _inactive to false here so that a render function can
|
2761 |
-
// rely on checking whether it's in an inactive tree (e.g. router-view)
|
2762 |
-
vm._inactive = false;
|
2763 |
-
activatedChildren.push(vm);
|
2764 |
-
}
|
2765 |
-
|
2766 |
-
function callActivatedHooks (queue) {
|
2767 |
-
for (var i = 0; i < queue.length; i++) {
|
2768 |
-
queue[i]._inactive = true;
|
2769 |
-
activateChildComponent(queue[i], true /* true */);
|
2770 |
-
}
|
2771 |
-
}
|
2772 |
-
|
2773 |
-
/**
|
2774 |
-
* Push a watcher into the watcher queue.
|
2775 |
-
* Jobs with duplicate IDs will be skipped unless it's
|
2776 |
-
* pushed when the queue is being flushed.
|
2777 |
-
*/
|
2778 |
-
function queueWatcher (watcher) {
|
2779 |
-
var id = watcher.id;
|
2780 |
-
if (has[id] == null) {
|
2781 |
-
has[id] = true;
|
2782 |
-
if (!flushing) {
|
2783 |
-
queue.push(watcher);
|
2784 |
-
} else {
|
2785 |
-
// if already flushing, splice the watcher based on its id
|
2786 |
-
// if already past its id, it will be run next immediately.
|
2787 |
-
var i = queue.length - 1;
|
2788 |
-
while (i > index && queue[i].id > watcher.id) {
|
2789 |
-
i--;
|
2790 |
-
}
|
2791 |
-
queue.splice(i + 1, 0, watcher);
|
2792 |
-
}
|
2793 |
-
// queue the flush
|
2794 |
-
if (!waiting) {
|
2795 |
-
waiting = true;
|
2796 |
-
nextTick(flushSchedulerQueue);
|
2797 |
-
}
|
2798 |
-
}
|
2799 |
-
}
|
2800 |
-
|
2801 |
-
/* */
|
2802 |
-
|
2803 |
-
var uid$2 = 0;
|
2804 |
-
|
2805 |
-
/**
|
2806 |
-
* A watcher parses an expression, collects dependencies,
|
2807 |
-
* and fires callback when the expression value changes.
|
2808 |
-
* This is used for both the $watch() api and directives.
|
2809 |
-
*/
|
2810 |
-
var Watcher = function Watcher (
|
2811 |
-
vm,
|
2812 |
-
expOrFn,
|
2813 |
-
cb,
|
2814 |
-
options
|
2815 |
-
) {
|
2816 |
-
this.vm = vm;
|
2817 |
-
vm._watchers.push(this);
|
2818 |
-
// options
|
2819 |
-
if (options) {
|
2820 |
-
this.deep = !!options.deep;
|
2821 |
-
this.user = !!options.user;
|
2822 |
-
this.lazy = !!options.lazy;
|
2823 |
-
this.sync = !!options.sync;
|
2824 |
-
} else {
|
2825 |
-
this.deep = this.user = this.lazy = this.sync = false;
|
2826 |
-
}
|
2827 |
-
this.cb = cb;
|
2828 |
-
this.id = ++uid$2; // uid for batching
|
2829 |
-
this.active = true;
|
2830 |
-
this.dirty = this.lazy; // for lazy watchers
|
2831 |
-
this.deps = [];
|
2832 |
-
this.newDeps = [];
|
2833 |
-
this.depIds = new _Set();
|
2834 |
-
this.newDepIds = new _Set();
|
2835 |
-
this.expression = expOrFn.toString();
|
2836 |
-
// parse expression for getter
|
2837 |
-
if (typeof expOrFn === 'function') {
|
2838 |
-
this.getter = expOrFn;
|
2839 |
-
} else {
|
2840 |
-
this.getter = parsePath(expOrFn);
|
2841 |
-
if (!this.getter) {
|
2842 |
-
this.getter = function () {};
|
2843 |
-
"development" !== 'production' && warn(
|
2844 |
-
"Failed watching path: \"" + expOrFn + "\" " +
|
2845 |
-
'Watcher only accepts simple dot-delimited paths. ' +
|
2846 |
-
'For full control, use a function instead.',
|
2847 |
-
vm
|
2848 |
-
);
|
2849 |
-
}
|
2850 |
-
}
|
2851 |
-
this.value = this.lazy
|
2852 |
-
? undefined
|
2853 |
-
: this.get();
|
2854 |
-
};
|
2855 |
|
2856 |
-
|
2857 |
-
|
2858 |
-
*/
|
2859 |
-
Watcher.prototype.get = function get () {
|
2860 |
-
pushTarget(this);
|
2861 |
-
var value;
|
2862 |
-
var vm = this.vm;
|
2863 |
-
try {
|
2864 |
-
value = this.getter.call(vm, vm);
|
2865 |
-
} catch (e) {
|
2866 |
-
if (this.user) {
|
2867 |
-
handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
|
2868 |
-
} else {
|
2869 |
-
throw e
|
2870 |
-
}
|
2871 |
-
} finally {
|
2872 |
-
// "touch" every property so they are all tracked as
|
2873 |
-
// dependencies for deep watching
|
2874 |
-
if (this.deep) {
|
2875 |
-
traverse(value);
|
2876 |
-
}
|
2877 |
-
popTarget();
|
2878 |
-
this.cleanupDeps();
|
2879 |
-
}
|
2880 |
-
return value
|
2881 |
-
};
|
2882 |
-
|
2883 |
-
/**
|
2884 |
-
* Add a dependency to this directive.
|
2885 |
-
*/
|
2886 |
-
Watcher.prototype.addDep = function addDep (dep) {
|
2887 |
-
var id = dep.id;
|
2888 |
-
if (!this.newDepIds.has(id)) {
|
2889 |
-
this.newDepIds.add(id);
|
2890 |
-
this.newDeps.push(dep);
|
2891 |
-
if (!this.depIds.has(id)) {
|
2892 |
-
dep.addSub(this);
|
2893 |
-
}
|
2894 |
-
}
|
2895 |
-
};
|
2896 |
-
|
2897 |
-
/**
|
2898 |
-
* Clean up for dependency collection.
|
2899 |
-
*/
|
2900 |
-
Watcher.prototype.cleanupDeps = function cleanupDeps () {
|
2901 |
-
var this$1 = this;
|
2902 |
-
|
2903 |
-
var i = this.deps.length;
|
2904 |
-
while (i--) {
|
2905 |
-
var dep = this$1.deps[i];
|
2906 |
-
if (!this$1.newDepIds.has(dep.id)) {
|
2907 |
-
dep.removeSub(this$1);
|
2908 |
-
}
|
2909 |
-
}
|
2910 |
-
var tmp = this.depIds;
|
2911 |
-
this.depIds = this.newDepIds;
|
2912 |
-
this.newDepIds = tmp;
|
2913 |
-
this.newDepIds.clear();
|
2914 |
-
tmp = this.deps;
|
2915 |
-
this.deps = this.newDeps;
|
2916 |
-
this.newDeps = tmp;
|
2917 |
-
this.newDeps.length = 0;
|
2918 |
-
};
|
2919 |
-
|
2920 |
-
/**
|
2921 |
-
* Subscriber interface.
|
2922 |
-
* Will be called when a dependency changes.
|
2923 |
-
*/
|
2924 |
-
Watcher.prototype.update = function update () {
|
2925 |
-
/* istanbul ignore else */
|
2926 |
-
if (this.lazy) {
|
2927 |
-
this.dirty = true;
|
2928 |
-
} else if (this.sync) {
|
2929 |
-
this.run();
|
2930 |
-
} else {
|
2931 |
-
queueWatcher(this);
|
2932 |
-
}
|
2933 |
-
};
|
2934 |
-
|
2935 |
-
/**
|
2936 |
-
* Scheduler job interface.
|
2937 |
-
* Will be called by the scheduler.
|
2938 |
-
*/
|
2939 |
-
Watcher.prototype.run = function run () {
|
2940 |
-
if (this.active) {
|
2941 |
-
var value = this.get();
|
2942 |
-
if (
|
2943 |
-
value !== this.value ||
|
2944 |
-
// Deep watchers and watchers on Object/Arrays should fire even
|
2945 |
-
// when the value is the same, because the value may
|
2946 |
-
// have mutated.
|
2947 |
-
isObject(value) ||
|
2948 |
-
this.deep
|
2949 |
-
) {
|
2950 |
-
// set new value
|
2951 |
-
var oldValue = this.value;
|
2952 |
-
this.value = value;
|
2953 |
-
if (this.user) {
|
2954 |
-
try {
|
2955 |
-
this.cb.call(this.vm, value, oldValue);
|
2956 |
-
} catch (e) {
|
2957 |
-
handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
|
2958 |
-
}
|
2959 |
-
} else {
|
2960 |
-
this.cb.call(this.vm, value, oldValue);
|
2961 |
-
}
|
2962 |
}
|
2963 |
-
}
|
2964 |
-
};
|
2965 |
|
2966 |
-
/**
|
2967 |
-
|
2968 |
-
|
2969 |
-
|
2970 |
-
|
2971 |
-
|
2972 |
-
|
2973 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2974 |
|
2975 |
-
/**
|
2976 |
-
|
2977 |
-
|
2978 |
-
|
2979 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
2980 |
|
2981 |
-
|
2982 |
-
|
2983 |
-
|
2984 |
-
|
2985 |
-
|
|
|
|
|
|
|
2986 |
|
2987 |
-
|
2988 |
-
|
2989 |
-
|
2990 |
-
|
2991 |
-
|
2992 |
-
|
2993 |
-
|
2994 |
-
|
2995 |
-
|
2996 |
-
|
2997 |
-
if (!this.vm._isBeingDestroyed) {
|
2998 |
-
remove(this.vm._watchers, this);
|
2999 |
-
}
|
3000 |
-
var i = this.deps.length;
|
3001 |
-
while (i--) {
|
3002 |
-
this$1.deps[i].removeSub(this$1);
|
3003 |
-
}
|
3004 |
-
this.active = false;
|
3005 |
-
}
|
3006 |
-
};
|
3007 |
-
|
3008 |
-
/**
|
3009 |
-
* Recursively traverse an object to evoke all converted
|
3010 |
-
* getters, so that every nested property inside the object
|
3011 |
-
* is collected as a "deep" dependency.
|
3012 |
-
*/
|
3013 |
-
var seenObjects = new _Set();
|
3014 |
-
function traverse (val) {
|
3015 |
-
seenObjects.clear();
|
3016 |
-
_traverse(val, seenObjects);
|
3017 |
-
}
|
3018 |
-
|
3019 |
-
function _traverse (val, seen) {
|
3020 |
-
var i, keys;
|
3021 |
-
var isA = Array.isArray(val);
|
3022 |
-
if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {
|
3023 |
-
return
|
3024 |
-
}
|
3025 |
-
if (val.__ob__) {
|
3026 |
-
var depId = val.__ob__.dep.id;
|
3027 |
-
if (seen.has(depId)) {
|
3028 |
-
return
|
3029 |
-
}
|
3030 |
-
seen.add(depId);
|
3031 |
-
}
|
3032 |
-
if (isA) {
|
3033 |
-
i = val.length;
|
3034 |
-
while (i--) { _traverse(val[i], seen); }
|
3035 |
-
} else {
|
3036 |
-
keys = Object.keys(val);
|
3037 |
-
i = keys.length;
|
3038 |
-
while (i--) { _traverse(val[keys[i]], seen); }
|
3039 |
-
}
|
3040 |
-
}
|
3041 |
-
|
3042 |
-
/* */
|
3043 |
-
|
3044 |
-
var sharedPropertyDefinition = {
|
3045 |
-
enumerable: true,
|
3046 |
-
configurable: true,
|
3047 |
-
get: noop,
|
3048 |
-
set: noop
|
3049 |
-
};
|
3050 |
-
|
3051 |
-
function proxy (target, sourceKey, key) {
|
3052 |
-
sharedPropertyDefinition.get = function proxyGetter () {
|
3053 |
-
return this[sourceKey][key]
|
3054 |
-
};
|
3055 |
-
sharedPropertyDefinition.set = function proxySetter (val) {
|
3056 |
-
this[sourceKey][key] = val;
|
3057 |
-
};
|
3058 |
-
Object.defineProperty(target, key, sharedPropertyDefinition);
|
3059 |
-
}
|
3060 |
-
|
3061 |
-
function initState (vm) {
|
3062 |
-
vm._watchers = [];
|
3063 |
-
var opts = vm.$options;
|
3064 |
-
if (opts.props) { initProps(vm, opts.props); }
|
3065 |
-
if (opts.methods) { initMethods(vm, opts.methods); }
|
3066 |
-
if (opts.data) {
|
3067 |
-
initData(vm);
|
3068 |
-
} else {
|
3069 |
-
observe(vm._data = {}, true /* asRootData */);
|
3070 |
-
}
|
3071 |
-
if (opts.computed) { initComputed(vm, opts.computed); }
|
3072 |
-
if (opts.watch && opts.watch !== nativeWatch) {
|
3073 |
-
initWatch(vm, opts.watch);
|
3074 |
-
}
|
3075 |
-
}
|
3076 |
-
|
3077 |
-
function checkOptionType (vm, name) {
|
3078 |
-
var option = vm.$options[name];
|
3079 |
-
if (!isPlainObject(option)) {
|
3080 |
-
warn(
|
3081 |
-
("component option \"" + name + "\" should be an object."),
|
3082 |
-
vm
|
3083 |
-
);
|
3084 |
-
}
|
3085 |
-
}
|
3086 |
-
|
3087 |
-
function initProps (vm, propsOptions) {
|
3088 |
-
var propsData = vm.$options.propsData || {};
|
3089 |
-
var props = vm._props = {};
|
3090 |
-
// cache prop keys so that future props updates can iterate using Array
|
3091 |
-
// instead of dynamic object key enumeration.
|
3092 |
-
var keys = vm.$options._propKeys = [];
|
3093 |
-
var isRoot = !vm.$parent;
|
3094 |
-
// root instance props should be converted
|
3095 |
-
observerState.shouldConvert = isRoot;
|
3096 |
-
var loop = function ( key ) {
|
3097 |
-
keys.push(key);
|
3098 |
-
var value = validateProp(key, propsOptions, propsData, vm);
|
3099 |
-
/* istanbul ignore else */
|
3100 |
-
{
|
3101 |
-
if (isReservedAttribute(key) || config.isReservedAttr(key)) {
|
3102 |
-
warn(
|
3103 |
-
("\"" + key + "\" is a reserved attribute and cannot be used as component prop."),
|
3104 |
-
vm
|
3105 |
-
);
|
3106 |
-
}
|
3107 |
-
defineReactive$$1(props, key, value, function () {
|
3108 |
-
if (vm.$parent && !isUpdatingChildComponent) {
|
3109 |
-
warn(
|
3110 |
-
"Avoid mutating a prop directly since the value will be " +
|
3111 |
-
"overwritten whenever the parent component re-renders. " +
|
3112 |
-
"Instead, use a data or computed property based on the prop's " +
|
3113 |
-
"value. Prop being mutated: \"" + key + "\"",
|
3114 |
-
vm
|
3115 |
-
);
|
3116 |
-
}
|
3117 |
-
});
|
3118 |
-
}
|
3119 |
-
// static props are already proxied on the component's prototype
|
3120 |
-
// during Vue.extend(). We only need to proxy props defined at
|
3121 |
-
// instantiation here.
|
3122 |
-
if (!(key in vm)) {
|
3123 |
-
proxy(vm, "_props", key);
|
3124 |
-
}
|
3125 |
-
};
|
3126 |
-
|
3127 |
-
for (var key in propsOptions) loop( key );
|
3128 |
-
observerState.shouldConvert = true;
|
3129 |
-
}
|
3130 |
-
|
3131 |
-
function initData (vm) {
|
3132 |
-
var data = vm.$options.data;
|
3133 |
-
data = vm._data = typeof data === 'function'
|
3134 |
-
? getData(data, vm)
|
3135 |
-
: data || {};
|
3136 |
-
if (!isPlainObject(data)) {
|
3137 |
-
data = {};
|
3138 |
-
"development" !== 'production' && warn(
|
3139 |
-
'data functions should return an object:\n' +
|
3140 |
-
'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
|
3141 |
-
vm
|
3142 |
-
);
|
3143 |
-
}
|
3144 |
-
// proxy data on instance
|
3145 |
-
var keys = Object.keys(data);
|
3146 |
-
var props = vm.$options.props;
|
3147 |
-
var methods = vm.$options.methods;
|
3148 |
-
var i = keys.length;
|
3149 |
-
while (i--) {
|
3150 |
-
var key = keys[i];
|
3151 |
-
{
|
3152 |
-
if (methods && hasOwn(methods, key)) {
|
3153 |
-
warn(
|
3154 |
-
("method \"" + key + "\" has already been defined as a data property."),
|
3155 |
-
vm
|
3156 |
-
);
|
3157 |
-
}
|
3158 |
}
|
3159 |
-
|
3160 |
-
|
3161 |
-
|
3162 |
-
|
3163 |
-
|
3164 |
-
|
3165 |
-
|
3166 |
-
|
3167 |
-
|
3168 |
-
|
3169 |
-
|
3170 |
-
observe(data, true /* asRootData */);
|
3171 |
-
}
|
3172 |
-
|
3173 |
-
function getData (data, vm) {
|
3174 |
-
try {
|
3175 |
-
return data.call(vm)
|
3176 |
-
} catch (e) {
|
3177 |
-
handleError(e, vm, "data()");
|
3178 |
-
return {}
|
3179 |
-
}
|
3180 |
-
}
|
3181 |
-
|
3182 |
-
var computedWatcherOptions = { lazy: true };
|
3183 |
-
|
3184 |
-
function initComputed (vm, computed) {
|
3185 |
-
"development" !== 'production' && checkOptionType(vm, 'computed');
|
3186 |
-
var watchers = vm._computedWatchers = Object.create(null);
|
3187 |
-
|
3188 |
-
for (var key in computed) {
|
3189 |
-
var userDef = computed[key];
|
3190 |
-
var getter = typeof userDef === 'function' ? userDef : userDef.get;
|
3191 |
-
{
|
3192 |
-
if (getter === undefined) {
|
3193 |
-
warn(
|
3194 |
-
("No getter function has been defined for computed property \"" + key + "\"."),
|
3195 |
-
vm
|
3196 |
-
);
|
3197 |
-
getter = noop;
|
3198 |
-
}
|
3199 |
}
|
3200 |
-
// create internal watcher for the computed property.
|
3201 |
-
watchers[key] = new Watcher(vm, getter, noop, computedWatcherOptions);
|
3202 |
|
3203 |
-
|
3204 |
-
|
3205 |
-
|
3206 |
-
|
3207 |
-
|
3208 |
-
|
3209 |
-
|
3210 |
-
|
3211 |
-
|
3212 |
-
|
3213 |
-
|
3214 |
-
|
3215 |
-
|
3216 |
-
|
3217 |
-
|
3218 |
-
|
3219 |
-
|
3220 |
-
|
3221 |
-
|
3222 |
-
|
3223 |
-
|
3224 |
-
|
3225 |
-
|
3226 |
-
|
3227 |
-
|
3228 |
-
|
3229 |
-
|
3230 |
-
|
3231 |
-
|
3232 |
-
|
3233 |
-
|
3234 |
-
|
3235 |
-
|
3236 |
-
|
3237 |
-
|
3238 |
-
|
3239 |
-
|
3240 |
-
|
3241 |
-
}
|
3242 |
-
if (Dep.target) {
|
3243 |
-
watcher.depend();
|
3244 |
-
}
|
3245 |
-
return watcher.value
|
3246 |
-
}
|
3247 |
-
}
|
3248 |
-
}
|
3249 |
-
|
3250 |
-
function initMethods (vm, methods) {
|
3251 |
-
"development" !== 'production' && checkOptionType(vm, 'methods');
|
3252 |
-
var props = vm.$options.props;
|
3253 |
-
for (var key in methods) {
|
3254 |
-
vm[key] = methods[key] == null ? noop : bind(methods[key], vm);
|
3255 |
-
{
|
3256 |
-
if (methods[key] == null) {
|
3257 |
-
warn(
|
3258 |
-
"method \"" + key + "\" has an undefined value in the component definition. " +
|
3259 |
-
"Did you reference the function correctly?",
|
3260 |
-
vm
|
3261 |
-
);
|
3262 |
-
}
|
3263 |
-
if (props && hasOwn(props, key)) {
|
3264 |
-
warn(
|
3265 |
-
("method \"" + key + "\" has already been defined as a prop."),
|
3266 |
-
vm
|
3267 |
-
);
|
3268 |
-
}
|
3269 |
-
}
|
3270 |
-
}
|
3271 |
-
}
|
3272 |
-
|
3273 |
-
function initWatch (vm, watch) {
|
3274 |
-
"development" !== 'production' && checkOptionType(vm, 'watch');
|
3275 |
-
for (var key in watch) {
|
3276 |
-
var handler = watch[key];
|
3277 |
-
if (Array.isArray(handler)) {
|
3278 |
-
for (var i = 0; i < handler.length; i++) {
|
3279 |
-
createWatcher(vm, key, handler[i]);
|
3280 |
-
}
|
3281 |
-
} else {
|
3282 |
-
createWatcher(vm, key, handler);
|
3283 |
-
}
|
3284 |
-
}
|
3285 |
-
}
|
3286 |
-
|
3287 |
-
function createWatcher (
|
3288 |
-
vm,
|
3289 |
-
keyOrFn,
|
3290 |
-
handler,
|
3291 |
-
options
|
3292 |
-
) {
|
3293 |
-
if (isPlainObject(handler)) {
|
3294 |
-
options = handler;
|
3295 |
-
handler = handler.handler;
|
3296 |
-
}
|
3297 |
-
if (typeof handler === 'string') {
|
3298 |
-
handler = vm[handler];
|
3299 |
-
}
|
3300 |
-
return vm.$watch(keyOrFn, handler, options)
|
3301 |
-
}
|
3302 |
-
|
3303 |
-
function stateMixin (Vue) {
|
3304 |
-
// flow somehow has problems with directly declared definition object
|
3305 |
-
// when using Object.defineProperty, so we have to procedurally build up
|
3306 |
-
// the object here.
|
3307 |
-
var dataDef = {};
|
3308 |
-
dataDef.get = function () { return this._data };
|
3309 |
-
var propsDef = {};
|
3310 |
-
propsDef.get = function () { return this._props };
|
3311 |
-
{
|
3312 |
-
dataDef.set = function (newData) {
|
3313 |
-
warn(
|
3314 |
-
'Avoid replacing instance root $data. ' +
|
3315 |
-
'Use nested data properties instead.',
|
3316 |
-
this
|
3317 |
-
);
|
3318 |
-
};
|
3319 |
-
propsDef.set = function () {
|
3320 |
-
warn("$props is readonly.", this);
|
3321 |
-
};
|
3322 |
-
}
|
3323 |
-
Object.defineProperty(Vue.prototype, '$data', dataDef);
|
3324 |
-
Object.defineProperty(Vue.prototype, '$props', propsDef);
|
3325 |
-
|
3326 |
-
Vue.prototype.$set = set;
|
3327 |
-
Vue.prototype.$delete = del;
|
3328 |
-
|
3329 |
-
Vue.prototype.$watch = function (
|
3330 |
-
expOrFn,
|
3331 |
-
cb,
|
3332 |
-
options
|
3333 |
-
) {
|
3334 |
-
var vm = this;
|
3335 |
-
if (isPlainObject(cb)) {
|
3336 |
-
return createWatcher(vm, expOrFn, cb, options)
|
3337 |
-
}
|
3338 |
-
options = options || {};
|
3339 |
-
options.user = true;
|
3340 |
-
var watcher = new Watcher(vm, expOrFn, cb, options);
|
3341 |
-
if (options.immediate) {
|
3342 |
-
cb.call(vm, watcher.value);
|
3343 |
-
}
|
3344 |
-
return function unwatchFn () {
|
3345 |
-
watcher.teardown();
|
3346 |
-
}
|
3347 |
-
};
|
3348 |
-
}
|
3349 |
-
|
3350 |
-
/* */
|
3351 |
-
|
3352 |
-
function initProvide (vm) {
|
3353 |
-
var provide = vm.$options.provide;
|
3354 |
-
if (provide) {
|
3355 |
-
vm._provided = typeof provide === 'function'
|
3356 |
-
? provide.call(vm)
|
3357 |
-
: provide;
|
3358 |
-
}
|
3359 |
-
}
|
3360 |
-
|
3361 |
-
function initInjections (vm) {
|
3362 |
-
var result = resolveInject(vm.$options.inject, vm);
|
3363 |
-
if (result) {
|
3364 |
-
observerState.shouldConvert = false;
|
3365 |
-
Object.keys(result).forEach(function (key) {
|
3366 |
-
/* istanbul ignore else */
|
3367 |
-
{
|
3368 |
-
defineReactive$$1(vm, key, result[key], function () {
|
3369 |
-
warn(
|
3370 |
-
"Avoid mutating an injected value directly since the changes will be " +
|
3371 |
-
"overwritten whenever the provided component re-renders. " +
|
3372 |
-
"injection being mutated: \"" + key + "\"",
|
3373 |
-
vm
|
3374 |
-
);
|
3375 |
-
});
|
3376 |
-
}
|
3377 |
-
});
|
3378 |
-
observerState.shouldConvert = true;
|
3379 |
-
}
|
3380 |
-
}
|
3381 |
-
|
3382 |
-
function resolveInject (inject, vm) {
|
3383 |
-
if (inject) {
|
3384 |
-
// inject is :any because flow is not smart enough to figure out cached
|
3385 |
-
var result = Object.create(null);
|
3386 |
-
var keys = hasSymbol
|
3387 |
-
? Reflect.ownKeys(inject)
|
3388 |
-
: Object.keys(inject);
|
3389 |
-
|
3390 |
-
for (var i = 0; i < keys.length; i++) {
|
3391 |
-
var key = keys[i];
|
3392 |
-
var provideKey = inject[key];
|
3393 |
-
var source = vm;
|
3394 |
-
while (source) {
|
3395 |
-
if (source._provided && provideKey in source._provided) {
|
3396 |
-
result[key] = source._provided[provideKey];
|
3397 |
-
break
|
3398 |
-
}
|
3399 |
-
source = source.$parent;
|
3400 |
-
}
|
3401 |
-
if ("development" !== 'production' && !hasOwn(result, key)) {
|
3402 |
-
warn(("Injection \"" + key + "\" not found"), vm);
|
3403 |
-
}
|
3404 |
-
}
|
3405 |
-
return result
|
3406 |
-
}
|
3407 |
-
}
|
3408 |
-
|
3409 |
-
/* */
|
3410 |
-
|
3411 |
-
function createFunctionalComponent (
|
3412 |
-
Ctor,
|
3413 |
-
propsData,
|
3414 |
-
data,
|
3415 |
-
context,
|
3416 |
-
children
|
3417 |
-
) {
|
3418 |
-
var props = {};
|
3419 |
-
var propOptions = Ctor.options.props;
|
3420 |
-
if (isDef(propOptions)) {
|
3421 |
-
for (var key in propOptions) {
|
3422 |
-
props[key] = validateProp(key, propOptions, propsData || {});
|
3423 |
-
}
|
3424 |
-
} else {
|
3425 |
-
if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
|
3426 |
-
if (isDef(data.props)) { mergeProps(props, data.props); }
|
3427 |
-
}
|
3428 |
-
// ensure the createElement function in functional components
|
3429 |
-
// gets a unique context - this is necessary for correct named slot check
|
3430 |
-
var _context = Object.create(context);
|
3431 |
-
var h = function (a, b, c, d) { return createElement(_context, a, b, c, d, true); };
|
3432 |
-
var vnode = Ctor.options.render.call(null, h, {
|
3433 |
-
data: data,
|
3434 |
-
props: props,
|
3435 |
-
children: children,
|
3436 |
-
parent: context,
|
3437 |
-
listeners: data.on || {},
|
3438 |
-
injections: resolveInject(Ctor.options.inject, context),
|
3439 |
-
slots: function () { return resolveSlots(children, context); }
|
3440 |
-
});
|
3441 |
-
if (vnode instanceof VNode) {
|
3442 |
-
vnode.functionalContext = context;
|
3443 |
-
vnode.functionalOptions = Ctor.options;
|
3444 |
-
if (data.slot) {
|
3445 |
-
(vnode.data || (vnode.data = {})).slot = data.slot;
|
3446 |
-
}
|
3447 |
-
}
|
3448 |
-
return vnode
|
3449 |
-
}
|
3450 |
-
|
3451 |
-
function mergeProps (to, from) {
|
3452 |
-
for (var key in from) {
|
3453 |
-
to[camelize(key)] = from[key];
|
3454 |
-
}
|
3455 |
-
}
|
3456 |
-
|
3457 |
-
/* */
|
3458 |
-
|
3459 |
-
// hooks to be invoked on component VNodes during patch
|
3460 |
-
var componentVNodeHooks = {
|
3461 |
-
init: function init (
|
3462 |
-
vnode,
|
3463 |
-
hydrating,
|
3464 |
-
parentElm,
|
3465 |
-
refElm
|
3466 |
-
) {
|
3467 |
-
if (!vnode.componentInstance || vnode.componentInstance._isDestroyed) {
|
3468 |
-
var child = vnode.componentInstance = createComponentInstanceForVnode(
|
3469 |
-
vnode,
|
3470 |
-
activeInstance,
|
3471 |
-
parentElm,
|
3472 |
-
refElm
|
3473 |
-
);
|
3474 |
-
child.$mount(hydrating ? vnode.elm : undefined, hydrating);
|
3475 |
-
} else if (vnode.data.keepAlive) {
|
3476 |
-
// kept-alive components, treat as a patch
|
3477 |
-
var mountedNode = vnode; // work around flow
|
3478 |
-
componentVNodeHooks.prepatch(mountedNode, mountedNode);
|
3479 |
-
}
|
3480 |
-
},
|
3481 |
-
|
3482 |
-
prepatch: function prepatch (oldVnode, vnode) {
|
3483 |
-
var options = vnode.componentOptions;
|
3484 |
-
var child = vnode.componentInstance = oldVnode.componentInstance;
|
3485 |
-
updateChildComponent(
|
3486 |
-
child,
|
3487 |
-
options.propsData, // updated props
|
3488 |
-
options.listeners, // updated listeners
|
3489 |
-
vnode, // new parent vnode
|
3490 |
-
options.children // new children
|
3491 |
-
);
|
3492 |
-
},
|
3493 |
-
|
3494 |
-
insert: function insert (vnode) {
|
3495 |
-
var context = vnode.context;
|
3496 |
-
var componentInstance = vnode.componentInstance;
|
3497 |
-
if (!componentInstance._isMounted) {
|
3498 |
-
componentInstance._isMounted = true;
|
3499 |
-
callHook(componentInstance, 'mounted');
|
3500 |
-
}
|
3501 |
-
if (vnode.data.keepAlive) {
|
3502 |
-
if (context._isMounted) {
|
3503 |
-
// vue-router#1212
|
3504 |
-
// During updates, a kept-alive component's child components may
|
3505 |
-
// change, so directly walking the tree here may call activated hooks
|
3506 |
-
// on incorrect children. Instead we push them into a queue which will
|
3507 |
-
// be processed after the whole patch process ended.
|
3508 |
-
queueActivatedComponent(componentInstance);
|
3509 |
-
} else {
|
3510 |
-
activateChildComponent(componentInstance, true /* direct */);
|
3511 |
-
}
|
3512 |
-
}
|
3513 |
-
},
|
3514 |
-
|
3515 |
-
destroy: function destroy (vnode) {
|
3516 |
-
var componentInstance = vnode.componentInstance;
|
3517 |
-
if (!componentInstance._isDestroyed) {
|
3518 |
-
if (!vnode.data.keepAlive) {
|
3519 |
-
componentInstance.$destroy();
|
3520 |
-
} else {
|
3521 |
-
deactivateChildComponent(componentInstance, true /* direct */);
|
3522 |
-
}
|
3523 |
-
}
|
3524 |
-
}
|
3525 |
-
};
|
3526 |
-
|
3527 |
-
var hooksToMerge = Object.keys(componentVNodeHooks);
|
3528 |
-
|
3529 |
-
function createComponent (
|
3530 |
-
Ctor,
|
3531 |
-
data,
|
3532 |
-
context,
|
3533 |
-
children,
|
3534 |
-
tag
|
3535 |
-
) {
|
3536 |
-
if (isUndef(Ctor)) {
|
3537 |
-
return
|
3538 |
-
}
|
3539 |
-
|
3540 |
-
var baseCtor = context.$options._base;
|
3541 |
-
|
3542 |
-
// plain options object: turn it into a constructor
|
3543 |
-
if (isObject(Ctor)) {
|
3544 |
-
Ctor = baseCtor.extend(Ctor);
|
3545 |
-
}
|
3546 |
-
|
3547 |
-
// if at this stage it's not a constructor or an async component factory,
|
3548 |
-
// reject.
|
3549 |
-
if (typeof Ctor !== 'function') {
|
3550 |
-
{
|
3551 |
-
warn(("Invalid Component definition: " + (String(Ctor))), context);
|
3552 |
-
}
|
3553 |
-
return
|
3554 |
-
}
|
3555 |
-
|
3556 |
-
// async component
|
3557 |
-
var asyncFactory;
|
3558 |
-
if (isUndef(Ctor.cid)) {
|
3559 |
-
asyncFactory = Ctor;
|
3560 |
-
Ctor = resolveAsyncComponent(asyncFactory, baseCtor, context);
|
3561 |
-
if (Ctor === undefined) {
|
3562 |
-
// return a placeholder node for async component, which is rendered
|
3563 |
-
// as a comment node but preserves all the raw information for the node.
|
3564 |
-
// the information will be used for async server-rendering and hydration.
|
3565 |
-
return createAsyncPlaceholder(
|
3566 |
-
asyncFactory,
|
3567 |
-
data,
|
3568 |
-
context,
|
3569 |
-
children,
|
3570 |
-
tag
|
3571 |
-
)
|
3572 |
-
}
|
3573 |
-
}
|
3574 |
-
|
3575 |
-
data = data || {};
|
3576 |
-
|
3577 |
-
// resolve constructor options in case global mixins are applied after
|
3578 |
-
// component constructor creation
|
3579 |
-
resolveConstructorOptions(Ctor);
|
3580 |
-
|
3581 |
-
// transform component v-model data into props & events
|
3582 |
-
if (isDef(data.model)) {
|
3583 |
-
transformModel(Ctor.options, data);
|
3584 |
-
}
|
3585 |
-
|
3586 |
-
// extract props
|
3587 |
-
var propsData = extractPropsFromVNodeData(data, Ctor, tag);
|
3588 |
-
|
3589 |
-
// functional component
|
3590 |
-
if (isTrue(Ctor.options.functional)) {
|
3591 |
-
return createFunctionalComponent(Ctor, propsData, data, context, children)
|
3592 |
-
}
|
3593 |
-
|
3594 |
-
// keep listeners
|
3595 |
-
var listeners = data.on;
|
3596 |
-
|
3597 |
-
if (isTrue(Ctor.options.abstract)) {
|
3598 |
-
// abstract components do not keep anything
|
3599 |
-
// other than props & listeners & slot
|
3600 |
-
|
3601 |
-
// work around flow
|
3602 |
-
var slot = data.slot;
|
3603 |
-
data = {};
|
3604 |
-
if (slot) {
|
3605 |
-
data.slot = slot;
|
3606 |
-
}
|
3607 |
-
}
|
3608 |
-
|
3609 |
-
// merge component management hooks onto the placeholder node
|
3610 |
-
mergeHooks(data);
|
3611 |
-
|
3612 |
-
// return a placeholder vnode
|
3613 |
-
var name = Ctor.options.name || tag;
|
3614 |
-
var vnode = new VNode(
|
3615 |
-
("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
|
3616 |
-
data, undefined, undefined, undefined, context,
|
3617 |
-
{ Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
|
3618 |
-
asyncFactory
|
3619 |
-
);
|
3620 |
-
return vnode
|
3621 |
-
}
|
3622 |
-
|
3623 |
-
function createComponentInstanceForVnode (
|
3624 |
-
vnode, // we know it's MountedComponentVNode but flow doesn't
|
3625 |
-
parent, // activeInstance in lifecycle state
|
3626 |
-
parentElm,
|
3627 |
-
refElm
|
3628 |
-
) {
|
3629 |
-
var vnodeComponentOptions = vnode.componentOptions;
|
3630 |
-
var options = {
|
3631 |
-
_isComponent: true,
|
3632 |
-
parent: parent,
|
3633 |
-
propsData: vnodeComponentOptions.propsData,
|
3634 |
-
_componentTag: vnodeComponentOptions.tag,
|
3635 |
-
_parentVnode: vnode,
|
3636 |
-
_parentListeners: vnodeComponentOptions.listeners,
|
3637 |
-
_renderChildren: vnodeComponentOptions.children,
|
3638 |
-
_parentElm: parentElm || null,
|
3639 |
-
_refElm: refElm || null
|
3640 |
-
};
|
3641 |
-
// check inline-template render functions
|
3642 |
-
var inlineTemplate = vnode.data.inlineTemplate;
|
3643 |
-
if (isDef(inlineTemplate)) {
|
3644 |
-
options.render = inlineTemplate.render;
|
3645 |
-
options.staticRenderFns = inlineTemplate.staticRenderFns;
|
3646 |
-
}
|
3647 |
-
return new vnodeComponentOptions.Ctor(options)
|
3648 |
-
}
|
3649 |
-
|
3650 |
-
function mergeHooks (data) {
|
3651 |
-
if (!data.hook) {
|
3652 |
-
data.hook = {};
|
3653 |
-
}
|
3654 |
-
for (var i = 0; i < hooksToMerge.length; i++) {
|
3655 |
-
var key = hooksToMerge[i];
|
3656 |
-
var fromParent = data.hook[key];
|
3657 |
-
var ours = componentVNodeHooks[key];
|
3658 |
-
data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;
|
3659 |
-
}
|
3660 |
-
}
|
3661 |
-
|
3662 |
-
function mergeHook$1 (one, two) {
|
3663 |
-
return function (a, b, c, d) {
|
3664 |
-
one(a, b, c, d);
|
3665 |
-
two(a, b, c, d);
|
3666 |
-
}
|
3667 |
-
}
|
3668 |
-
|
3669 |
-
// transform component v-model info (value and callback) into
|
3670 |
-
// prop and event handler respectively.
|
3671 |
-
function transformModel (options, data) {
|
3672 |
-
var prop = (options.model && options.model.prop) || 'value';
|
3673 |
-
var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;
|
3674 |
-
var on = data.on || (data.on = {});
|
3675 |
-
if (isDef(on[event])) {
|
3676 |
-
on[event] = [data.model.callback].concat(on[event]);
|
3677 |
-
} else {
|
3678 |
-
on[event] = data.model.callback;
|
3679 |
-
}
|
3680 |
-
}
|
3681 |
-
|
3682 |
-
/* */
|
3683 |
-
|
3684 |
-
var SIMPLE_NORMALIZE = 1;
|
3685 |
-
var ALWAYS_NORMALIZE = 2;
|
3686 |
-
|
3687 |
-
// wrapper function for providing a more flexible interface
|
3688 |
-
// without getting yelled at by flow
|
3689 |
-
function createElement (
|
3690 |
-
context,
|
3691 |
-
tag,
|
3692 |
-
data,
|
3693 |
-
children,
|
3694 |
-
normalizationType,
|
3695 |
-
alwaysNormalize
|
3696 |
-
) {
|
3697 |
-
if (Array.isArray(data) || isPrimitive(data)) {
|
3698 |
-
normalizationType = children;
|
3699 |
-
children = data;
|
3700 |
-
data = undefined;
|
3701 |
-
}
|
3702 |
-
if (isTrue(alwaysNormalize)) {
|
3703 |
-
normalizationType = ALWAYS_NORMALIZE;
|
3704 |
-
}
|
3705 |
-
return _createElement(context, tag, data, children, normalizationType)
|
3706 |
-
}
|
3707 |
-
|
3708 |
-
function _createElement (
|
3709 |
-
context,
|
3710 |
-
tag,
|
3711 |
-
data,
|
3712 |
-
children,
|
3713 |
-
normalizationType
|
3714 |
-
) {
|
3715 |
-
if (isDef(data) && isDef((data).__ob__)) {
|
3716 |
-
"development" !== 'production' && warn(
|
3717 |
-
"Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
|
3718 |
-
'Always create fresh vnode data objects in each render!',
|
3719 |
-
context
|
3720 |
-
);
|
3721 |
-
return createEmptyVNode()
|
3722 |
-
}
|
3723 |
-
// object syntax in v-bind
|
3724 |
-
if (isDef(data) && isDef(data.is)) {
|
3725 |
-
tag = data.is;
|
3726 |
-
}
|
3727 |
-
if (!tag) {
|
3728 |
-
// in case of component :is set to falsy value
|
3729 |
-
return createEmptyVNode()
|
3730 |
-
}
|
3731 |
-
// warn against non-primitive key
|
3732 |
-
if ("development" !== 'production' &&
|
3733 |
-
isDef(data) && isDef(data.key) && !isPrimitive(data.key)
|
3734 |
-
) {
|
3735 |
-
warn(
|
3736 |
-
'Avoid using non-primitive value as key, ' +
|
3737 |
-
'use string/number value instead.',
|
3738 |
-
context
|
3739 |
-
);
|
3740 |
-
}
|
3741 |
-
// support single function children as default scoped slot
|
3742 |
-
if (Array.isArray(children) &&
|
3743 |
-
typeof children[0] === 'function'
|
3744 |
-
) {
|
3745 |
-
data = data || {};
|
3746 |
-
data.scopedSlots = { default: children[0] };
|
3747 |
-
children.length = 0;
|
3748 |
-
}
|
3749 |
-
if (normalizationType === ALWAYS_NORMALIZE) {
|
3750 |
-
children = normalizeChildren(children);
|
3751 |
-
} else if (normalizationType === SIMPLE_NORMALIZE) {
|
3752 |
-
children = simpleNormalizeChildren(children);
|
3753 |
-
}
|
3754 |
-
var vnode, ns;
|
3755 |
-
if (typeof tag === 'string') {
|
3756 |
-
var Ctor;
|
3757 |
-
ns = config.getTagNamespace(tag);
|
3758 |
-
if (config.isReservedTag(tag)) {
|
3759 |
-
// platform built-in elements
|
3760 |
-
vnode = new VNode(
|
3761 |
-
config.parsePlatformTagName(tag), data, children,
|
3762 |
-
undefined, undefined, context
|
3763 |
-
);
|
3764 |
-
} else if (isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
|
3765 |
-
// component
|
3766 |
-
vnode = createComponent(Ctor, data, context, children, tag);
|
3767 |
-
} else {
|
3768 |
-
// unknown or unlisted namespaced elements
|
3769 |
-
// check at runtime because it may get assigned a namespace when its
|
3770 |
-
// parent normalizes children
|
3771 |
-
vnode = new VNode(
|
3772 |
-
tag, data, children,
|
3773 |
-
undefined, undefined, context
|
3774 |
-
);
|
3775 |
-
}
|
3776 |
-
} else {
|
3777 |
-
// direct component options / constructor
|
3778 |
-
vnode = createComponent(tag, data, context, children);
|
3779 |
-
}
|
3780 |
-
if (isDef(vnode)) {
|
3781 |
-
if (ns) { applyNS(vnode, ns); }
|
3782 |
-
return vnode
|
3783 |
-
} else {
|
3784 |
-
return createEmptyVNode()
|
3785 |
-
}
|
3786 |
-
}
|
3787 |
-
|
3788 |
-
function applyNS (vnode, ns) {
|
3789 |
-
vnode.ns = ns;
|
3790 |
-
if (vnode.tag === 'foreignObject') {
|
3791 |
-
// use default namespace inside foreignObject
|
3792 |
-
return
|
3793 |
-
}
|
3794 |
-
if (isDef(vnode.children)) {
|
3795 |
-
for (var i = 0, l = vnode.children.length; i < l; i++) {
|
3796 |
-
var child = vnode.children[i];
|
3797 |
-
if (isDef(child.tag) && isUndef(child.ns)) {
|
3798 |
-
applyNS(child, ns);
|
3799 |
-
}
|
3800 |
-
}
|
3801 |
-
}
|
3802 |
-
}
|
3803 |
-
|
3804 |
-
/* */
|
3805 |
-
|
3806 |
-
/**
|
3807 |
-
* Runtime helper for rendering v-for lists.
|
3808 |
-
*/
|
3809 |
-
function renderList (
|
3810 |
-
val,
|
3811 |
-
render
|
3812 |
-
) {
|
3813 |
-
var ret, i, l, keys, key;
|
3814 |
-
if (Array.isArray(val) || typeof val === 'string') {
|
3815 |
-
ret = new Array(val.length);
|
3816 |
-
for (i = 0, l = val.length; i < l; i++) {
|
3817 |
-
ret[i] = render(val[i], i);
|
3818 |
-
}
|
3819 |
-
} else if (typeof val === 'number') {
|
3820 |
-
ret = new Array(val);
|
3821 |
-
for (i = 0; i < val; i++) {
|
3822 |
-
ret[i] = render(i + 1, i);
|
3823 |
-
}
|
3824 |
-
} else if (isObject(val)) {
|
3825 |
-
keys = Object.keys(val);
|
3826 |
-
ret = new Array(keys.length);
|
3827 |
-
for (i = 0, l = keys.length; i < l; i++) {
|
3828 |
-
key = keys[i];
|
3829 |
-
ret[i] = render(val[key], key, i);
|
3830 |
-
}
|
3831 |
-
}
|
3832 |
-
if (isDef(ret)) {
|
3833 |
-
(ret)._isVList = true;
|
3834 |
-
}
|
3835 |
-
return ret
|
3836 |
-
}
|
3837 |
-
|
3838 |
-
/* */
|
3839 |
-
|
3840 |
-
/**
|
3841 |
-
* Runtime helper for rendering <slot>
|
3842 |
-
*/
|
3843 |
-
function renderSlot (
|
3844 |
-
name,
|
3845 |
-
fallback,
|
3846 |
-
props,
|
3847 |
-
bindObject
|
3848 |
-
) {
|
3849 |
-
var scopedSlotFn = this.$scopedSlots[name];
|
3850 |
-
if (scopedSlotFn) { // scoped slot
|
3851 |
-
props = props || {};
|
3852 |
-
if (bindObject) {
|
3853 |
-
props = extend(extend({}, bindObject), props);
|
3854 |
-
}
|
3855 |
-
return scopedSlotFn(props) || fallback
|
3856 |
-
} else {
|
3857 |
-
var slotNodes = this.$slots[name];
|
3858 |
-
// warn duplicate slot usage
|
3859 |
-
if (slotNodes && "development" !== 'production') {
|
3860 |
-
slotNodes._rendered && warn(
|
3861 |
-
"Duplicate presence of slot \"" + name + "\" found in the same render tree " +
|
3862 |
-
"- this will likely cause render errors.",
|
3863 |
-
this
|
3864 |
-
);
|
3865 |
-
slotNodes._rendered = true;
|
3866 |
-
}
|
3867 |
-
return slotNodes || fallback
|
3868 |
-
}
|
3869 |
-
}
|
3870 |
-
|
3871 |
-
/* */
|
3872 |
-
|
3873 |
-
/**
|
3874 |
-
* Runtime helper for resolving filters
|
3875 |
-
*/
|
3876 |
-
function resolveFilter (id) {
|
3877 |
-
return resolveAsset(this.$options, 'filters', id, true) || identity
|
3878 |
-
}
|
3879 |
|
3880 |
-
|
|
|
|
|
|
|
3881 |
|
3882 |
-
|
3883 |
-
|
3884 |
-
|
3885 |
-
|
3886 |
-
|
3887 |
-
key,
|
3888 |
-
builtInAlias
|
3889 |
-
) {
|
3890 |
-
var keyCodes = config.keyCodes[key] || builtInAlias;
|
3891 |
-
if (Array.isArray(keyCodes)) {
|
3892 |
-
return keyCodes.indexOf(eventKeyCode) === -1
|
3893 |
-
} else {
|
3894 |
-
return keyCodes !== eventKeyCode
|
3895 |
-
}
|
3896 |
-
}
|
3897 |
-
|
3898 |
-
/* */
|
3899 |
-
|
3900 |
-
/**
|
3901 |
-
* Runtime helper for merging v-bind="object" into a VNode's data.
|
3902 |
-
*/
|
3903 |
-
function bindObjectProps (
|
3904 |
-
data,
|
3905 |
-
tag,
|
3906 |
-
value,
|
3907 |
-
asProp,
|
3908 |
-
isSync
|
3909 |
-
) {
|
3910 |
-
if (value) {
|
3911 |
-
if (!isObject(value)) {
|
3912 |
-
"development" !== 'production' && warn(
|
3913 |
-
'v-bind without argument expects an Object or Array value',
|
3914 |
-
this
|
3915 |
-
);
|
3916 |
-
} else {
|
3917 |
-
if (Array.isArray(value)) {
|
3918 |
-
value = toObject(value);
|
3919 |
-
}
|
3920 |
-
var hash;
|
3921 |
-
var loop = function ( key ) {
|
3922 |
-
if (
|
3923 |
-
key === 'class' ||
|
3924 |
-
key === 'style' ||
|
3925 |
-
isReservedAttribute(key)
|
3926 |
-
) {
|
3927 |
-
hash = data;
|
3928 |
-
} else {
|
3929 |
-
var type = data.attrs && data.attrs.type;
|
3930 |
-
hash = asProp || config.mustUseProp(tag, type, key)
|
3931 |
-
? data.domProps || (data.domProps = {})
|
3932 |
-
: data.attrs || (data.attrs = {});
|
3933 |
-
}
|
3934 |
-
if (!(key in hash)) {
|
3935 |
-
hash[key] = value[key];
|
3936 |
-
|
3937 |
-
if (isSync) {
|
3938 |
-
var on = data.on || (data.on = {});
|
3939 |
-
on[("update:" + key)] = function ($event) {
|
3940 |
-
value[key] = $event;
|
3941 |
-
};
|
3942 |
-
}
|
3943 |
}
|
3944 |
-
};
|
3945 |
|
3946 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3947 |
}
|
3948 |
-
}
|
3949 |
-
return data
|
3950 |
-
}
|
3951 |
-
|
3952 |
-
/* */
|
3953 |
|
3954 |
-
/**
|
3955 |
-
|
3956 |
-
|
3957 |
-
|
3958 |
-
|
3959 |
-
|
3960 |
-
)
|
3961 |
-
|
3962 |
-
|
3963 |
-
|
3964 |
-
|
3965 |
-
|
3966 |
-
|
3967 |
-
|
3968 |
-
|
3969 |
-
|
3970 |
-
|
3971 |
-
|
3972 |
-
|
3973 |
-
|
3974 |
-
|
3975 |
-
|
3976 |
-
|
3977 |
-
|
3978 |
-
|
3979 |
-
|
3980 |
-
|
3981 |
-
|
3982 |
-
|
3983 |
-
|
3984 |
-
|
3985 |
-
|
3986 |
-
|
3987 |
-
|
3988 |
-
|
3989 |
-
function markStatic (
|
3990 |
-
tree,
|
3991 |
-
key,
|
3992 |
-
isOnce
|
3993 |
-
) {
|
3994 |
-
if (Array.isArray(tree)) {
|
3995 |
-
for (var i = 0; i < tree.length; i++) {
|
3996 |
-
if (tree[i] && typeof tree[i] !== 'string') {
|
3997 |
-
markStaticNode(tree[i], (key + "_" + i), isOnce);
|
3998 |
-
}
|
3999 |
-
}
|
4000 |
-
} else {
|
4001 |
-
markStaticNode(tree, key, isOnce);
|
4002 |
-
}
|
4003 |
-
}
|
4004 |
-
|
4005 |
-
function markStaticNode (node, key, isOnce) {
|
4006 |
-
node.isStatic = true;
|
4007 |
-
node.key = key;
|
4008 |
-
node.isOnce = isOnce;
|
4009 |
-
}
|
4010 |
-
|
4011 |
-
/* */
|
4012 |
-
|
4013 |
-
function bindObjectListeners (data, value) {
|
4014 |
-
if (value) {
|
4015 |
-
if (!isPlainObject(value)) {
|
4016 |
-
"development" !== 'production' && warn(
|
4017 |
-
'v-on without argument expects an Object value',
|
4018 |
-
this
|
4019 |
-
);
|
4020 |
-
} else {
|
4021 |
-
var on = data.on = data.on ? extend({}, data.on) : {};
|
4022 |
-
for (var key in value) {
|
4023 |
-
var existing = on[key];
|
4024 |
-
var ours = value[key];
|
4025 |
-
on[key] = existing ? [].concat(ours, existing) : ours;
|
4026 |
-
}
|
4027 |
-
}
|
4028 |
-
}
|
4029 |
-
return data
|
4030 |
-
}
|
4031 |
-
|
4032 |
-
/* */
|
4033 |
-
|
4034 |
-
function initRender (vm) {
|
4035 |
-
vm._vnode = null; // the root of the child tree
|
4036 |
-
vm._staticTrees = null;
|
4037 |
-
var parentVnode = vm.$vnode = vm.$options._parentVnode; // the placeholder node in parent tree
|
4038 |
-
var renderContext = parentVnode && parentVnode.context;
|
4039 |
-
vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext);
|
4040 |
-
vm.$scopedSlots = emptyObject;
|
4041 |
-
// bind the createElement fn to this instance
|
4042 |
-
// so that we get proper render context inside it.
|
4043 |
-
// args order: tag, data, children, normalizationType, alwaysNormalize
|
4044 |
-
// internal version is used by render functions compiled from templates
|
4045 |
-
vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
|
4046 |
-
// normalization is always applied for the public version, used in
|
4047 |
-
// user-written render functions.
|
4048 |
-
vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
|
4049 |
-
|
4050 |
-
// $attrs & $listeners are exposed for easier HOC creation.
|
4051 |
-
// they need to be reactive so that HOCs using them are always updated
|
4052 |
-
var parentData = parentVnode && parentVnode.data;
|
4053 |
-
/* istanbul ignore else */
|
4054 |
-
{
|
4055 |
-
defineReactive$$1(vm, '$attrs', parentData && parentData.attrs, function () {
|
4056 |
-
!isUpdatingChildComponent && warn("$attrs is readonly.", vm);
|
4057 |
-
}, true);
|
4058 |
-
defineReactive$$1(vm, '$listeners', parentData && parentData.on, function () {
|
4059 |
-
!isUpdatingChildComponent && warn("$listeners is readonly.", vm);
|
4060 |
-
}, true);
|
4061 |
-
}
|
4062 |
-
}
|
4063 |
-
|
4064 |
-
function renderMixin (Vue) {
|
4065 |
-
Vue.prototype.$nextTick = function (fn) {
|
4066 |
-
return nextTick(fn, this)
|
4067 |
-
};
|
4068 |
-
|
4069 |
-
Vue.prototype._render = function () {
|
4070 |
-
var vm = this;
|
4071 |
-
var ref = vm.$options;
|
4072 |
-
var render = ref.render;
|
4073 |
-
var staticRenderFns = ref.staticRenderFns;
|
4074 |
-
var _parentVnode = ref._parentVnode;
|
4075 |
-
|
4076 |
-
if (vm._isMounted) {
|
4077 |
-
// clone slot nodes on re-renders
|
4078 |
-
for (var key in vm.$slots) {
|
4079 |
-
vm.$slots[key] = cloneVNodes(vm.$slots[key]);
|
4080 |
-
}
|
4081 |
-
}
|
4082 |
-
|
4083 |
-
vm.$scopedSlots = (_parentVnode && _parentVnode.data.scopedSlots) || emptyObject;
|
4084 |
-
|
4085 |
-
if (staticRenderFns && !vm._staticTrees) {
|
4086 |
-
vm._staticTrees = [];
|
4087 |
-
}
|
4088 |
-
// set parent vnode. this allows render functions to have access
|
4089 |
-
// to the data on the placeholder node.
|
4090 |
-
vm.$vnode = _parentVnode;
|
4091 |
-
// render self
|
4092 |
-
var vnode;
|
4093 |
-
try {
|
4094 |
-
vnode = render.call(vm._renderProxy, vm.$createElement);
|
4095 |
-
} catch (e) {
|
4096 |
-
handleError(e, vm, "render function");
|
4097 |
-
// return error render result,
|
4098 |
-
// or previous vnode to prevent render error causing blank component
|
4099 |
-
/* istanbul ignore else */
|
4100 |
-
{
|
4101 |
-
vnode = vm.$options.renderError
|
4102 |
-
? vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e)
|
4103 |
-
: vm._vnode;
|
4104 |
-
}
|
4105 |
-
}
|
4106 |
-
// return empty vnode in case the render function errored out
|
4107 |
-
if (!(vnode instanceof VNode)) {
|
4108 |
-
if ("development" !== 'production' && Array.isArray(vnode)) {
|
4109 |
-
warn(
|
4110 |
-
'Multiple root nodes returned from render function. Render function ' +
|
4111 |
-
'should return a single root node.',
|
4112 |
-
vm
|
4113 |
-
);
|
4114 |
-
}
|
4115 |
-
vnode = createEmptyVNode();
|
4116 |
-
}
|
4117 |
-
// set parent
|
4118 |
-
vnode.parent = _parentVnode;
|
4119 |
-
return vnode
|
4120 |
-
};
|
4121 |
-
|
4122 |
-
// internal render helpers.
|
4123 |
-
// these are exposed on the instance prototype to reduce generated render
|
4124 |
-
// code size.
|
4125 |
-
Vue.prototype._o = markOnce;
|
4126 |
-
Vue.prototype._n = toNumber;
|
4127 |
-
Vue.prototype._s = toString;
|
4128 |
-
Vue.prototype._l = renderList;
|
4129 |
-
Vue.prototype._t = renderSlot;
|
4130 |
-
Vue.prototype._q = looseEqual;
|
4131 |
-
Vue.prototype._i = looseIndexOf;
|
4132 |
-
Vue.prototype._m = renderStatic;
|
4133 |
-
Vue.prototype._f = resolveFilter;
|
4134 |
-
Vue.prototype._k = checkKeyCodes;
|
4135 |
-
Vue.prototype._b = bindObjectProps;
|
4136 |
-
Vue.prototype._v = createTextVNode;
|
4137 |
-
Vue.prototype._e = createEmptyVNode;
|
4138 |
-
Vue.prototype._u = resolveScopedSlots;
|
4139 |
-
Vue.prototype._g = bindObjectListeners;
|
4140 |
-
}
|
4141 |
-
|
4142 |
-
/* */
|
4143 |
-
|
4144 |
-
var uid$1 = 0;
|
4145 |
-
|
4146 |
-
function initMixin (Vue) {
|
4147 |
-
Vue.prototype._init = function (options) {
|
4148 |
-
var vm = this;
|
4149 |
-
// a uid
|
4150 |
-
vm._uid = uid$1++;
|
4151 |
-
|
4152 |
-
var startTag, endTag;
|
4153 |
-
/* istanbul ignore if */
|
4154 |
-
if ("development" !== 'production' && config.performance && mark) {
|
4155 |
-
startTag = "vue-perf-init:" + (vm._uid);
|
4156 |
-
endTag = "vue-perf-end:" + (vm._uid);
|
4157 |
-
mark(startTag);
|
4158 |
-
}
|
4159 |
-
|
4160 |
-
// a flag to avoid this being observed
|
4161 |
-
vm._isVue = true;
|
4162 |
-
// merge options
|
4163 |
-
if (options && options._isComponent) {
|
4164 |
-
// optimize internal component instantiation
|
4165 |
-
// since dynamic options merging is pretty slow, and none of the
|
4166 |
-
// internal component options needs special treatment.
|
4167 |
-
initInternalComponent(vm, options);
|
4168 |
-
} else {
|
4169 |
-
vm.$options = mergeOptions(
|
4170 |
-
resolveConstructorOptions(vm.constructor),
|
4171 |
-
options || {},
|
4172 |
-
vm
|
4173 |
-
);
|
4174 |
}
|
4175 |
-
/* istanbul ignore else */
|
4176 |
-
{
|
4177 |
-
initProxy(vm);
|
4178 |
-
}
|
4179 |
-
// expose real self
|
4180 |
-
vm._self = vm;
|
4181 |
-
initLifecycle(vm);
|
4182 |
-
initEvents(vm);
|
4183 |
-
initRender(vm);
|
4184 |
-
callHook(vm, 'beforeCreate');
|
4185 |
-
initInjections(vm); // resolve injections before data/props
|
4186 |
-
initState(vm);
|
4187 |
-
initProvide(vm); // resolve provide after data/props
|
4188 |
-
callHook(vm, 'created');
|
4189 |
-
|
4190 |
-
/* istanbul ignore if */
|
4191 |
-
if ("development" !== 'production' && config.performance && mark) {
|
4192 |
-
vm._name = formatComponentName(vm, false);
|
4193 |
-
mark(endTag);
|
4194 |
-
measure(((vm._name) + " init"), startTag, endTag);
|
4195 |
-
}
|
4196 |
-
|
4197 |
-
if (vm.$options.el) {
|
4198 |
-
vm.$mount(vm.$options.el);
|
4199 |
-
}
|
4200 |
-
};
|
4201 |
-
}
|
4202 |
-
|
4203 |
-
function initInternalComponent (vm, options) {
|
4204 |
-
var opts = vm.$options = Object.create(vm.constructor.options);
|
4205 |
-
// doing this because it's faster than dynamic enumeration.
|
4206 |
-
opts.parent = options.parent;
|
4207 |
-
opts.propsData = options.propsData;
|
4208 |
-
opts._parentVnode = options._parentVnode;
|
4209 |
-
opts._parentListeners = options._parentListeners;
|
4210 |
-
opts._renderChildren = options._renderChildren;
|
4211 |
-
opts._componentTag = options._componentTag;
|
4212 |
-
opts._parentElm = options._parentElm;
|
4213 |
-
opts._refElm = options._refElm;
|
4214 |
-
if (options.render) {
|
4215 |
-
opts.render = options.render;
|
4216 |
-
opts.staticRenderFns = options.staticRenderFns;
|
4217 |
-
}
|
4218 |
-
}
|
4219 |
-
|
4220 |
-
function resolveConstructorOptions (Ctor) {
|
4221 |
-
var options = Ctor.options;
|
4222 |
-
if (Ctor.super) {
|
4223 |
-
var superOptions = resolveConstructorOptions(Ctor.super);
|
4224 |
-
var cachedSuperOptions = Ctor.superOptions;
|
4225 |
-
if (superOptions !== cachedSuperOptions) {
|
4226 |
-
// super option changed,
|
4227 |
-
// need to resolve new options.
|
4228 |
-
Ctor.superOptions = superOptions;
|
4229 |
-
// check if there are any late-modified/attached options (#4976)
|
4230 |
-
var modifiedOptions = resolveModifiedOptions(Ctor);
|
4231 |
-
// update base extend options
|
4232 |
-
if (modifiedOptions) {
|
4233 |
-
extend(Ctor.extendOptions, modifiedOptions);
|
4234 |
-
}
|
4235 |
-
options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
|
4236 |
-
if (options.name) {
|
4237 |
-
options.components[options.name] = Ctor;
|
4238 |
-
}
|
4239 |
-
}
|
4240 |
-
}
|
4241 |
-
return options
|
4242 |
-
}
|
4243 |
-
|
4244 |
-
function resolveModifiedOptions (Ctor) {
|
4245 |
-
var modified;
|
4246 |
-
var latest = Ctor.options;
|
4247 |
-
var extended = Ctor.extendOptions;
|
4248 |
-
var sealed = Ctor.sealedOptions;
|
4249 |
-
for (var key in latest) {
|
4250 |
-
if (latest[key] !== sealed[key]) {
|
4251 |
-
if (!modified) { modified = {}; }
|
4252 |
-
modified[key] = dedupe(latest[key], extended[key], sealed[key]);
|
4253 |
-
}
|
4254 |
-
}
|
4255 |
-
return modified
|
4256 |
-
}
|
4257 |
-
|
4258 |
-
function dedupe (latest, extended, sealed) {
|
4259 |
-
// compare latest and sealed to ensure lifecycle hooks won't be duplicated
|
4260 |
-
// between merges
|
4261 |
-
if (Array.isArray(latest)) {
|
4262 |
-
var res = [];
|
4263 |
-
sealed = Array.isArray(sealed) ? sealed : [sealed];
|
4264 |
-
extended = Array.isArray(extended) ? extended : [extended];
|
4265 |
-
for (var i = 0; i < latest.length; i++) {
|
4266 |
-
// push original options and not sealed options to exclude duplicated options
|
4267 |
-
if (extended.indexOf(latest[i]) >= 0 || sealed.indexOf(latest[i]) < 0) {
|
4268 |
-
res.push(latest[i]);
|
4269 |
-
}
|
4270 |
-
}
|
4271 |
-
return res
|
4272 |
-
} else {
|
4273 |
-
return latest
|
4274 |
-
}
|
4275 |
-
}
|
4276 |
-
|
4277 |
-
function Vue$3 (options) {
|
4278 |
-
if ("development" !== 'production' &&
|
4279 |
-
!(this instanceof Vue$3)
|
4280 |
-
) {
|
4281 |
-
warn('Vue is a constructor and should be called with the `new` keyword');
|
4282 |
-
}
|
4283 |
-
this._init(options);
|
4284 |
-
}
|
4285 |
-
|
4286 |
-
initMixin(Vue$3);
|
4287 |
-
stateMixin(Vue$3);
|
4288 |
-
eventsMixin(Vue$3);
|
4289 |
-
lifecycleMixin(Vue$3);
|
4290 |
-
renderMixin(Vue$3);
|
4291 |
-
|
4292 |
-
/* */
|
4293 |
-
|
4294 |
-
function initUse (Vue) {
|
4295 |
-
Vue.use = function (plugin) {
|
4296 |
-
var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
|
4297 |
-
if (installedPlugins.indexOf(plugin) > -1) {
|
4298 |
-
return this
|
4299 |
-
}
|
4300 |
-
|
4301 |
-
// additional parameters
|
4302 |
-
var args = toArray(arguments, 1);
|
4303 |
-
args.unshift(this);
|
4304 |
-
if (typeof plugin.install === 'function') {
|
4305 |
-
plugin.install.apply(plugin, args);
|
4306 |
-
} else if (typeof plugin === 'function') {
|
4307 |
-
plugin.apply(null, args);
|
4308 |
-
}
|
4309 |
-
installedPlugins.push(plugin);
|
4310 |
-
return this
|
4311 |
-
};
|
4312 |
-
}
|
4313 |
-
|
4314 |
-
/* */
|
4315 |
-
|
4316 |
-
function initMixin$1 (Vue) {
|
4317 |
-
Vue.mixin = function (mixin) {
|
4318 |
-
this.options = mergeOptions(this.options, mixin);
|
4319 |
-
return this
|
4320 |
-
};
|
4321 |
-
}
|
4322 |
-
|
4323 |
-
/* */
|
4324 |
-
|
4325 |
-
function initExtend (Vue) {
|
4326 |
-
/**
|
4327 |
-
* Each instance constructor, including Vue, has a unique
|
4328 |
-
* cid. This enables us to create wrapped "child
|
4329 |
-
* constructors" for prototypal inheritance and cache them.
|
4330 |
-
*/
|
4331 |
-
Vue.cid = 0;
|
4332 |
-
var cid = 1;
|
4333 |
|
4334 |
-
|
4335 |
-
|
4336 |
-
|
4337 |
-
|
4338 |
-
|
4339 |
-
|
4340 |
-
|
4341 |
-
|
4342 |
-
|
4343 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4344 |
}
|
4345 |
|
4346 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4347 |
{
|
4348 |
-
|
4349 |
-
|
4350 |
-
|
4351 |
-
|
4352 |
-
|
4353 |
-
|
4354 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4355 |
}
|
4356 |
|
4357 |
-
|
4358 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4359 |
};
|
4360 |
-
Sub.prototype = Object.create(Super.prototype);
|
4361 |
-
Sub.prototype.constructor = Sub;
|
4362 |
-
Sub.cid = cid++;
|
4363 |
-
Sub.options = mergeOptions(
|
4364 |
-
Super.options,
|
4365 |
-
extendOptions
|
4366 |
-
);
|
4367 |
-
Sub['super'] = Super;
|
4368 |
|
4369 |
-
|
4370 |
-
|
4371 |
-
|
4372 |
-
|
4373 |
-
|
4374 |
-
|
4375 |
-
|
4376 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4377 |
}
|
4378 |
|
4379 |
-
|
4380 |
-
|
4381 |
-
|
4382 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4383 |
|
4384 |
-
// create asset registers, so extended classes
|
4385 |
-
// can have their private assets too.
|
4386 |
ASSET_TYPES.forEach(function (type) {
|
4387 |
-
|
4388 |
});
|
4389 |
-
|
4390 |
-
|
4391 |
-
|
4392 |
-
|
4393 |
-
|
4394 |
-
|
4395 |
-
|
4396 |
-
|
4397 |
-
|
4398 |
-
|
4399 |
-
|
4400 |
-
|
4401 |
-
// cache constructor
|
4402 |
-
cachedCtors[SuperId] = Sub;
|
4403 |
-
return Sub
|
4404 |
-
};
|
4405 |
-
}
|
4406 |
-
|
4407 |
-
function initProps$1 (Comp) {
|
4408 |
-
var props = Comp.options.props;
|
4409 |
-
for (var key in props) {
|
4410 |
-
proxy(Comp.prototype, "_props", key);
|
4411 |
-
}
|
4412 |
-
}
|
4413 |
-
|
4414 |
-
function initComputed$1 (Comp) {
|
4415 |
-
var computed = Comp.options.computed;
|
4416 |
-
for (var key in computed) {
|
4417 |
-
defineComputed(Comp.prototype, key, computed[key]);
|
4418 |
-
}
|
4419 |
-
}
|
4420 |
-
|
4421 |
-
/* */
|
4422 |
-
|
4423 |
-
function initAssetRegisters (Vue) {
|
4424 |
-
/**
|
4425 |
-
* Create asset registration methods.
|
4426 |
-
*/
|
4427 |
-
ASSET_TYPES.forEach(function (type) {
|
4428 |
-
Vue[type] = function (
|
4429 |
-
id,
|
4430 |
-
definition
|
4431 |
) {
|
4432 |
-
|
4433 |
-
|
4434 |
-
|
4435 |
-
|
|
|
4436 |
{
|
4437 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4438 |
warn(
|
4439 |
-
|
4440 |
-
|
4441 |
);
|
4442 |
-
}
|
4443 |
}
|
4444 |
-
if (
|
4445 |
-
|
4446 |
-
|
|
|
|
|
4447 |
}
|
4448 |
-
|
4449 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4450 |
}
|
4451 |
-
|
4452 |
-
|
4453 |
-
|
4454 |
-
|
4455 |
-
|
4456 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4457 |
|
4458 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4459 |
|
4460 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4461 |
|
4462 |
-
|
4463 |
-
|
4464 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4465 |
|
4466 |
-
|
4467 |
-
|
4468 |
-
return pattern.indexOf(name) > -1
|
4469 |
-
} else if (typeof pattern === 'string') {
|
4470 |
-
return pattern.split(',').indexOf(name) > -1
|
4471 |
-
} else if (isRegExp(pattern)) {
|
4472 |
-
return pattern.test(name)
|
4473 |
-
}
|
4474 |
-
/* istanbul ignore next */
|
4475 |
-
return false
|
4476 |
-
}
|
4477 |
-
|
4478 |
-
function pruneCache (cache, current, filter) {
|
4479 |
-
for (var key in cache) {
|
4480 |
-
var cachedNode = cache[key];
|
4481 |
-
if (cachedNode) {
|
4482 |
-
var name = getComponentName(cachedNode.componentOptions);
|
4483 |
-
if (name && !filter(name)) {
|
4484 |
-
if (cachedNode !== current) {
|
4485 |
-
pruneCacheEntry(cachedNode);
|
4486 |
}
|
4487 |
-
cache[key] = null;
|
4488 |
-
}
|
4489 |
-
}
|
4490 |
-
}
|
4491 |
-
}
|
4492 |
-
|
4493 |
-
function pruneCacheEntry (vnode) {
|
4494 |
-
if (vnode) {
|
4495 |
-
vnode.componentInstance.$destroy();
|
4496 |
-
}
|
4497 |
-
}
|
4498 |
-
|
4499 |
-
var KeepAlive = {
|
4500 |
-
name: 'keep-alive',
|
4501 |
-
abstract: true,
|
4502 |
-
|
4503 |
-
props: {
|
4504 |
-
include: patternTypes,
|
4505 |
-
exclude: patternTypes
|
4506 |
-
},
|
4507 |
-
|
4508 |
-
created: function created () {
|
4509 |
-
this.cache = Object.create(null);
|
4510 |
-
},
|
4511 |
-
|
4512 |
-
destroyed: function destroyed () {
|
4513 |
-
var this$1 = this;
|
4514 |
-
|
4515 |
-
for (var key in this$1.cache) {
|
4516 |
-
pruneCacheEntry(this$1.cache[key]);
|
4517 |
-
}
|
4518 |
-
},
|
4519 |
-
|
4520 |
-
watch: {
|
4521 |
-
include: function include (val) {
|
4522 |
-
pruneCache(this.cache, this._vnode, function (name) { return matches(val, name); });
|
4523 |
-
},
|
4524 |
-
exclude: function exclude (val) {
|
4525 |
-
pruneCache(this.cache, this._vnode, function (name) { return !matches(val, name); });
|
4526 |
-
}
|
4527 |
-
},
|
4528 |
-
|
4529 |
-
render: function render () {
|
4530 |
-
var vnode = getFirstComponentChild(this.$slots.default);
|
4531 |
-
var componentOptions = vnode && vnode.componentOptions;
|
4532 |
-
if (componentOptions) {
|
4533 |
-
// check pattern
|
4534 |
-
var name = getComponentName(componentOptions);
|
4535 |
-
if (name && (
|
4536 |
-
(this.include && !matches(this.include, name)) ||
|
4537 |
-
(this.exclude && matches(this.exclude, name))
|
4538 |
-
)) {
|
4539 |
-
return vnode
|
4540 |
-
}
|
4541 |
-
var key = vnode.key == null
|
4542 |
-
// same constructor may get registered as different local components
|
4543 |
-
// so cid alone is not enough (#3269)
|
4544 |
-
? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
|
4545 |
-
: vnode.key;
|
4546 |
-
if (this.cache[key]) {
|
4547 |
-
vnode.componentInstance = this.cache[key].componentInstance;
|
4548 |
-
} else {
|
4549 |
-
this.cache[key] = vnode;
|
4550 |
-
}
|
4551 |
-
vnode.data.keepAlive = true;
|
4552 |
-
}
|
4553 |
-
return vnode
|
4554 |
-
}
|
4555 |
-
};
|
4556 |
-
|
4557 |
-
var builtInComponents = {
|
4558 |
-
KeepAlive: KeepAlive
|
4559 |
-
};
|
4560 |
-
|
4561 |
-
/* */
|
4562 |
-
|
4563 |
-
function initGlobalAPI (Vue) {
|
4564 |
-
// config
|
4565 |
-
var configDef = {};
|
4566 |
-
configDef.get = function () { return config; };
|
4567 |
-
{
|
4568 |
-
configDef.set = function () {
|
4569 |
-
warn(
|
4570 |
-
'Do not replace the Vue.config object, set individual fields instead.'
|
4571 |
-
);
|
4572 |
-
};
|
4573 |
-
}
|
4574 |
-
Object.defineProperty(Vue, 'config', configDef);
|
4575 |
-
|
4576 |
-
// exposed util methods.
|
4577 |
-
// NOTE: these are not considered part of the public API - avoid relying on
|
4578 |
-
// them unless you are aware of the risk.
|
4579 |
-
Vue.util = {
|
4580 |
-
warn: warn,
|
4581 |
-
extend: extend,
|
4582 |
-
mergeOptions: mergeOptions,
|
4583 |
-
defineReactive: defineReactive$$1
|
4584 |
-
};
|
4585 |
-
|
4586 |
-
Vue.set = set;
|
4587 |
-
Vue.delete = del;
|
4588 |
-
Vue.nextTick = nextTick;
|
4589 |
-
|
4590 |
-
Vue.options = Object.create(null);
|
4591 |
-
ASSET_TYPES.forEach(function (type) {
|
4592 |
-
Vue.options[type + 's'] = Object.create(null);
|
4593 |
-
});
|
4594 |
-
|
4595 |
-
// this is used to identify the "base" constructor to extend all plain-object
|
4596 |
-
// components with in Weex's multi-instance scenarios.
|
4597 |
-
Vue.options._base = Vue;
|
4598 |
-
|
4599 |
-
extend(Vue.options.components, builtInComponents);
|
4600 |
-
|
4601 |
-
initUse(Vue);
|
4602 |
-
initMixin$1(Vue);
|
4603 |
-
initExtend(Vue);
|
4604 |
-
initAssetRegisters(Vue);
|
4605 |
-
}
|
4606 |
-
|
4607 |
-
initGlobalAPI(Vue$3);
|
4608 |
-
|
4609 |
-
Object.defineProperty(Vue$3.prototype, '$isServer', {
|
4610 |
-
get: isServerRendering
|
4611 |
-
});
|
4612 |
-
|
4613 |
-
Object.defineProperty(Vue$3.prototype, '$ssrContext', {
|
4614 |
-
get: function get () {
|
4615 |
-
/* istanbul ignore next */
|
4616 |
-
return this.$vnode && this.$vnode.ssrContext
|
4617 |
-
}
|
4618 |
-
});
|
4619 |
-
|
4620 |
-
Vue$3.version = '2.4.0';
|
4621 |
-
|
4622 |
-
/* */
|
4623 |
-
|
4624 |
-
// these are reserved for web because they are directly compiled away
|
4625 |
-
// during template compilation
|
4626 |
-
var isReservedAttr = makeMap('style,class');
|
4627 |
-
|
4628 |
-
// attributes that should be using props for binding
|
4629 |
-
var acceptValue = makeMap('input,textarea,option,select');
|
4630 |
-
var mustUseProp = function (tag, type, attr) {
|
4631 |
-
return (
|
4632 |
-
(attr === 'value' && acceptValue(tag)) && type !== 'button' ||
|
4633 |
-
(attr === 'selected' && tag === 'option') ||
|
4634 |
-
(attr === 'checked' && tag === 'input') ||
|
4635 |
-
(attr === 'muted' && tag === 'video')
|
4636 |
-
)
|
4637 |
-
};
|
4638 |
-
|
4639 |
-
var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
|
4640 |
-
|
4641 |
-
var isBooleanAttr = makeMap(
|
4642 |
-
'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
|
4643 |
-
'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
|
4644 |
-
'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
|
4645 |
-
'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
|
4646 |
-
'required,reversed,scoped,seamless,selected,sortable,translate,' +
|
4647 |
-
'truespeed,typemustmatch,visible'
|
4648 |
-
);
|
4649 |
-
|
4650 |
-
var xlinkNS = 'http://www.w3.org/1999/xlink';
|
4651 |
-
|
4652 |
-
var isXlink = function (name) {
|
4653 |
-
return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
|
4654 |
-
};
|
4655 |
-
|
4656 |
-
var getXlinkProp = function (name) {
|
4657 |
-
return isXlink(name) ? name.slice(6, name.length) : ''
|
4658 |
-
};
|
4659 |
-
|
4660 |
-
var isFalsyAttrValue = function (val) {
|
4661 |
-
return val == null || val === false
|
4662 |
-
};
|
4663 |
-
|
4664 |
-
/* */
|
4665 |
-
|
4666 |
-
function genClassForVnode (vnode) {
|
4667 |
-
var data = vnode.data;
|
4668 |
-
var parentNode = vnode;
|
4669 |
-
var childNode = vnode;
|
4670 |
-
while (isDef(childNode.componentInstance)) {
|
4671 |
-
childNode = childNode.componentInstance._vnode;
|
4672 |
-
if (childNode.data) {
|
4673 |
-
data = mergeClassData(childNode.data, data);
|
4674 |
-
}
|
4675 |
-
}
|
4676 |
-
while (isDef(parentNode = parentNode.parent)) {
|
4677 |
-
if (parentNode.data) {
|
4678 |
-
data = mergeClassData(data, parentNode.data);
|
4679 |
-
}
|
4680 |
-
}
|
4681 |
-
return renderClass(data.staticClass, data.class)
|
4682 |
-
}
|
4683 |
-
|
4684 |
-
function mergeClassData (child, parent) {
|
4685 |
-
return {
|
4686 |
-
staticClass: concat(child.staticClass, parent.staticClass),
|
4687 |
-
class: isDef(child.class)
|
4688 |
-
? [child.class, parent.class]
|
4689 |
-
: parent.class
|
4690 |
-
}
|
4691 |
-
}
|
4692 |
-
|
4693 |
-
function renderClass (
|
4694 |
-
staticClass,
|
4695 |
-
dynamicClass
|
4696 |
-
) {
|
4697 |
-
if (isDef(staticClass) || isDef(dynamicClass)) {
|
4698 |
-
return concat(staticClass, stringifyClass(dynamicClass))
|
4699 |
-
}
|
4700 |
-
/* istanbul ignore next */
|
4701 |
-
return ''
|
4702 |
-
}
|
4703 |
-
|
4704 |
-
function concat (a, b) {
|
4705 |
-
return a ? b ? (a + ' ' + b) : a : (b || '')
|
4706 |
-
}
|
4707 |
-
|
4708 |
-
function stringifyClass (value) {
|
4709 |
-
if (Array.isArray(value)) {
|
4710 |
-
return stringifyArray(value)
|
4711 |
-
}
|
4712 |
-
if (isObject(value)) {
|
4713 |
-
return stringifyObject(value)
|
4714 |
-
}
|
4715 |
-
if (typeof value === 'string') {
|
4716 |
-
return value
|
4717 |
-
}
|
4718 |
-
/* istanbul ignore next */
|
4719 |
-
return ''
|
4720 |
-
}
|
4721 |
-
|
4722 |
-
function stringifyArray (value) {
|
4723 |
-
var res = '';
|
4724 |
-
var stringified;
|
4725 |
-
for (var i = 0, l = value.length; i < l; i++) {
|
4726 |
-
if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
|
4727 |
-
if (res) { res += ' '; }
|
4728 |
-
res += stringified;
|
4729 |
-
}
|
4730 |
-
}
|
4731 |
-
return res
|
4732 |
-
}
|
4733 |
-
|
4734 |
-
function stringifyObject (value) {
|
4735 |
-
var res = '';
|
4736 |
-
for (var key in value) {
|
4737 |
-
if (value[key]) {
|
4738 |
-
if (res) { res += ' '; }
|
4739 |
-
res += key;
|
4740 |
-
}
|
4741 |
-
}
|
4742 |
-
return res
|
4743 |
-
}
|
4744 |
-
|
4745 |
-
/* */
|
4746 |
-
|
4747 |
-
var namespaceMap = {
|
4748 |
-
svg: 'http://www.w3.org/2000/svg',
|
4749 |
-
math: 'http://www.w3.org/1998/Math/MathML'
|
4750 |
-
};
|
4751 |
-
|
4752 |
-
var isHTMLTag = makeMap(
|
4753 |
-
'html,body,base,head,link,meta,style,title,' +
|
4754 |
-
'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
|
4755 |
-
'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
|
4756 |
-
'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
|
4757 |
-
's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
|
4758 |
-
'embed,object,param,source,canvas,script,noscript,del,ins,' +
|
4759 |
-
'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
|
4760 |
-
'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
|
4761 |
-
'output,progress,select,textarea,' +
|
4762 |
-
'details,dialog,menu,menuitem,summary,' +
|
4763 |
-
'content,element,shadow,template,blockquote,iframe,tfoot'
|
4764 |
-
);
|
4765 |
-
|
4766 |
-
// this map is intentionally selective, only covering SVG elements that may
|
4767 |
-
// contain child elements.
|
4768 |
-
var isSVG = makeMap(
|
4769 |
-
'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
|
4770 |
-
'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
|
4771 |
-
'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
|
4772 |
-
true
|
4773 |
-
);
|
4774 |
-
|
4775 |
-
var isPreTag = function (tag) { return tag === 'pre'; };
|
4776 |
-
|
4777 |
-
var isReservedTag = function (tag) {
|
4778 |
-
return isHTMLTag(tag) || isSVG(tag)
|
4779 |
-
};
|
4780 |
-
|
4781 |
-
function getTagNamespace (tag) {
|
4782 |
-
if (isSVG(tag)) {
|
4783 |
-
return 'svg'
|
4784 |
-
}
|
4785 |
-
// basic support for MathML
|
4786 |
-
// note it doesn't support other MathML elements being component roots
|
4787 |
-
if (tag === 'math') {
|
4788 |
-
return 'math'
|
4789 |
-
}
|
4790 |
-
}
|
4791 |
-
|
4792 |
-
var unknownElementCache = Object.create(null);
|
4793 |
-
function isUnknownElement (tag) {
|
4794 |
-
/* istanbul ignore if */
|
4795 |
-
if (!inBrowser) {
|
4796 |
-
return true
|
4797 |
-
}
|
4798 |
-
if (isReservedTag(tag)) {
|
4799 |
-
return false
|
4800 |
-
}
|
4801 |
-
tag = tag.toLowerCase();
|
4802 |
-
/* istanbul ignore if */
|
4803 |
-
if (unknownElementCache[tag] != null) {
|
4804 |
-
return unknownElementCache[tag]
|
4805 |
-
}
|
4806 |
-
var el = document.createElement(tag);
|
4807 |
-
if (tag.indexOf('-') > -1) {
|
4808 |
-
// http://stackoverflow.com/a/28210364/1070244
|
4809 |
-
return (unknownElementCache[tag] = (
|
4810 |
-
el.constructor === window.HTMLUnknownElement ||
|
4811 |
-
el.constructor === window.HTMLElement
|
4812 |
-
))
|
4813 |
-
} else {
|
4814 |
-
return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
|
4815 |
-
}
|
4816 |
-
}
|
4817 |
-
|
4818 |
-
/* */
|
4819 |
-
|
4820 |
-
/**
|
4821 |
-
* Query an element selector if it's not an element already.
|
4822 |
-
*/
|
4823 |
-
function query (el) {
|
4824 |
-
if (typeof el === 'string') {
|
4825 |
-
var selected = document.querySelector(el);
|
4826 |
-
if (!selected) {
|
4827 |
-
"development" !== 'production' && warn(
|
4828 |
-
'Cannot find element: ' + el
|
4829 |
-
);
|
4830 |
-
return document.createElement('div')
|
4831 |
-
}
|
4832 |
-
return selected
|
4833 |
-
} else {
|
4834 |
-
return el
|
4835 |
-
}
|
4836 |
-
}
|
4837 |
-
|
4838 |
-
/* */
|
4839 |
-
|
4840 |
-
function createElement$1 (tagName, vnode) {
|
4841 |
-
var elm = document.createElement(tagName);
|
4842 |
-
if (tagName !== 'select') {
|
4843 |
-
return elm
|
4844 |
-
}
|
4845 |
-
// false or null will remove the attribute but undefined will not
|
4846 |
-
if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
|
4847 |
-
elm.setAttribute('multiple', 'multiple');
|
4848 |
-
}
|
4849 |
-
return elm
|
4850 |
-
}
|
4851 |
-
|
4852 |
-
function createElementNS (namespace, tagName) {
|
4853 |
-
return document.createElementNS(namespaceMap[namespace], tagName)
|
4854 |
-
}
|
4855 |
-
|
4856 |
-
function createTextNode (text) {
|
4857 |
-
return document.createTextNode(text)
|
4858 |
-
}
|
4859 |
-
|
4860 |
-
function createComment (text) {
|
4861 |
-
return document.createComment(text)
|
4862 |
-
}
|
4863 |
-
|
4864 |
-
function insertBefore (parentNode, newNode, referenceNode) {
|
4865 |
-
parentNode.insertBefore(newNode, referenceNode);
|
4866 |
-
}
|
4867 |
-
|
4868 |
-
function removeChild (node, child) {
|
4869 |
-
node.removeChild(child);
|
4870 |
-
}
|
4871 |
-
|
4872 |
-
function appendChild (node, child) {
|
4873 |
-
node.appendChild(child);
|
4874 |
-
}
|
4875 |
-
|
4876 |
-
function parentNode (node) {
|
4877 |
-
return node.parentNode
|
4878 |
-
}
|
4879 |
-
|
4880 |
-
function nextSibling (node) {
|
4881 |
-
return node.nextSibling
|
4882 |
-
}
|
4883 |
-
|
4884 |
-
function tagName (node) {
|
4885 |
-
return node.tagName
|
4886 |
-
}
|
4887 |
-
|
4888 |
-
function setTextContent (node, text) {
|
4889 |
-
node.textContent = text;
|
4890 |
-
}
|
4891 |
-
|
4892 |
-
function setAttribute (node, key, val) {
|
4893 |
-
node.setAttribute(key, val);
|
4894 |
-
}
|
4895 |
-
|
4896 |
-
|
4897 |
-
var nodeOps = Object.freeze({
|
4898 |
-
createElement: createElement$1,
|
4899 |
-
createElementNS: createElementNS,
|
4900 |
-
createTextNode: createTextNode,
|
4901 |
-
createComment: createComment,
|
4902 |
-
insertBefore: insertBefore,
|
4903 |
-
removeChild: removeChild,
|
4904 |
-
appendChild: appendChild,
|
4905 |
-
parentNode: parentNode,
|
4906 |
-
nextSibling: nextSibling,
|
4907 |
-
tagName: tagName,
|
4908 |
-
setTextContent: setTextContent,
|
4909 |
-
setAttribute: setAttribute
|
4910 |
-
});
|
4911 |
-
|
4912 |
-
/* */
|
4913 |
-
|
4914 |
-
var ref = {
|
4915 |
-
create: function create (_, vnode) {
|
4916 |
-
registerRef(vnode);
|
4917 |
-
},
|
4918 |
-
update: function update (oldVnode, vnode) {
|
4919 |
-
if (oldVnode.data.ref !== vnode.data.ref) {
|
4920 |
-
registerRef(oldVnode, true);
|
4921 |
-
registerRef(vnode);
|
4922 |
-
}
|
4923 |
-
},
|
4924 |
-
destroy: function destroy (vnode) {
|
4925 |
-
registerRef(vnode, true);
|
4926 |
-
}
|
4927 |
-
};
|
4928 |
-
|
4929 |
-
function registerRef (vnode, isRemoval) {
|
4930 |
-
var key = vnode.data.ref;
|
4931 |
-
if (!key) { return }
|
4932 |
-
|
4933 |
-
var vm = vnode.context;
|
4934 |
-
var ref = vnode.componentInstance || vnode.elm;
|
4935 |
-
var refs = vm.$refs;
|
4936 |
-
if (isRemoval) {
|
4937 |
-
if (Array.isArray(refs[key])) {
|
4938 |
-
remove(refs[key], ref);
|
4939 |
-
} else if (refs[key] === ref) {
|
4940 |
-
refs[key] = undefined;
|
4941 |
-
}
|
4942 |
-
} else {
|
4943 |
-
if (vnode.data.refInFor) {
|
4944 |
-
if (!Array.isArray(refs[key])) {
|
4945 |
-
refs[key] = [ref];
|
4946 |
-
} else if (refs[key].indexOf(ref) < 0) {
|
4947 |
-
// $flow-disable-line
|
4948 |
-
refs[key].push(ref);
|
4949 |
-
}
|
4950 |
-
} else {
|
4951 |
-
refs[key] = ref;
|
4952 |
-
}
|
4953 |
-
}
|
4954 |
-
}
|
4955 |
-
|
4956 |
-
/**
|
4957 |
-
* Virtual DOM patching algorithm based on Snabbdom by
|
4958 |
-
* Simon Friis Vindum (@paldepind)
|
4959 |
-
* Licensed under the MIT License
|
4960 |
-
* https://github.com/paldepind/snabbdom/blob/master/LICENSE
|
4961 |
-
*
|
4962 |
-
* modified by Evan You (@yyx990803)
|
4963 |
-
*
|
4964 |
-
|
4965 |
-
/*
|
4966 |
-
* Not type-checking this because this file is perf-critical and the cost
|
4967 |
-
* of making flow understand it is not worth it.
|
4968 |
-
*/
|
4969 |
|
4970 |
-
|
4971 |
-
|
4972 |
-
|
4973 |
-
|
4974 |
-
|
4975 |
-
|
4976 |
-
|
4977 |
-
|
4978 |
-
|
4979 |
-
|
4980 |
-
|
4981 |
-
|
4982 |
-
|
4983 |
-
|
4984 |
-
|
4985 |
-
|
4986 |
-
|
4987 |
-
)
|
4988 |
-
)
|
4989 |
-
}
|
4990 |
-
|
4991 |
-
// Some browsers do not support dynamically changing type for <input>
|
4992 |
-
// so they need to be treated as different nodes
|
4993 |
-
function sameInputType (a, b) {
|
4994 |
-
if (a.tag !== 'input') { return true }
|
4995 |
-
var i;
|
4996 |
-
var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
|
4997 |
-
var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
|
4998 |
-
return typeA === typeB
|
4999 |
-
}
|
5000 |
-
|
5001 |
-
function createKeyToOldIdx (children, beginIdx, endIdx) {
|
5002 |
-
var i, key;
|
5003 |
-
var map = {};
|
5004 |
-
for (i = beginIdx; i <= endIdx; ++i) {
|
5005 |
-
key = children[i].key;
|
5006 |
-
if (isDef(key)) { map[key] = i; }
|
5007 |
-
}
|
5008 |
-
return map
|
5009 |
-
}
|
5010 |
-
|
5011 |
-
function createPatchFunction (backend) {
|
5012 |
-
var i, j;
|
5013 |
-
var cbs = {};
|
5014 |
-
|
5015 |
-
var modules = backend.modules;
|
5016 |
-
var nodeOps = backend.nodeOps;
|
5017 |
-
|
5018 |
-
for (i = 0; i < hooks.length; ++i) {
|
5019 |
-
cbs[hooks[i]] = [];
|
5020 |
-
for (j = 0; j < modules.length; ++j) {
|
5021 |
-
if (isDef(modules[j][hooks[i]])) {
|
5022 |
-
cbs[hooks[i]].push(modules[j][hooks[i]]);
|
5023 |
-
}
|
5024 |
-
}
|
5025 |
-
}
|
5026 |
-
|
5027 |
-
function emptyNodeAt (elm) {
|
5028 |
-
return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
|
5029 |
-
}
|
5030 |
-
|
5031 |
-
function createRmCb (childElm, listeners) {
|
5032 |
-
function remove$$1 () {
|
5033 |
-
if (--remove$$1.listeners === 0) {
|
5034 |
-
removeNode(childElm);
|
5035 |
-
}
|
5036 |
-
}
|
5037 |
-
remove$$1.listeners = listeners;
|
5038 |
-
return remove$$1
|
5039 |
-
}
|
5040 |
-
|
5041 |
-
function removeNode (el) {
|
5042 |
-
var parent = nodeOps.parentNode(el);
|
5043 |
-
// element may have already been removed due to v-html / v-text
|
5044 |
-
if (isDef(parent)) {
|
5045 |
-
nodeOps.removeChild(parent, el);
|
5046 |
-
}
|
5047 |
-
}
|
5048 |
-
|
5049 |
-
var inPre = 0;
|
5050 |
-
function createElm (vnode, insertedVnodeQueue, parentElm, refElm, nested) {
|
5051 |
-
vnode.isRootInsert = !nested; // for transition enter check
|
5052 |
-
if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
|
5053 |
-
return
|
5054 |
-
}
|
5055 |
-
|
5056 |
-
var data = vnode.data;
|
5057 |
-
var children = vnode.children;
|
5058 |
-
var tag = vnode.tag;
|
5059 |
-
if (isDef(tag)) {
|
5060 |
-
{
|
5061 |
-
if (data && data.pre) {
|
5062 |
-
inPre++;
|
5063 |
}
|
5064 |
-
if (
|
5065 |
-
!inPre &&
|
5066 |
-
!vnode.ns &&
|
5067 |
-
!(config.ignoredElements.length && config.ignoredElements.indexOf(tag) > -1) &&
|
5068 |
-
config.isUnknownElement(tag)
|
5069 |
-
) {
|
5070 |
-
warn(
|
5071 |
-
'Unknown custom element: <' + tag + '> - did you ' +
|
5072 |
-
'register the component correctly? For recursive components, ' +
|
5073 |
-
'make sure to provide the "name" option.',
|
5074 |
-
vnode.context
|
5075 |
-
);
|
5076 |
-
}
|
5077 |
-
}
|
5078 |
-
vnode.elm = vnode.ns
|
5079 |
-
? nodeOps.createElementNS(vnode.ns, tag)
|
5080 |
-
: nodeOps.createElement(tag, vnode);
|
5081 |
-
setScope(vnode);
|
5082 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5083 |
/* istanbul ignore if */
|
5084 |
-
|
5085 |
-
|
5086 |
-
|
5087 |
-
|
5088 |
-
|
5089 |
-
|
5090 |
-
|
5091 |
-
|
5092 |
-
|
5093 |
-
|
5094 |
-
|
5095 |
-
|
5096 |
-
|
5097 |
-
|
5098 |
-
|
5099 |
-
|
5100 |
-
|
5101 |
-
|
5102 |
-
|
5103 |
-
|
5104 |
-
|
5105 |
-
|
5106 |
-
|
5107 |
-
|
5108 |
-
|
5109 |
-
|
5110 |
-
|
5111 |
-
|
5112 |
-
|
5113 |
-
|
5114 |
-
|
5115 |
-
|
5116 |
-
|
5117 |
-
|
5118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5119 |
}
|
5120 |
-
return true
|
5121 |
-
}
|
5122 |
}
|
5123 |
-
}
|
5124 |
|
5125 |
-
|
5126 |
-
|
5127 |
-
|
5128 |
-
|
5129 |
-
|
5130 |
-
|
5131 |
-
if (isPatchable(vnode)) {
|
5132 |
-
invokeCreateHooks(vnode, insertedVnodeQueue);
|
5133 |
-
setScope(vnode);
|
5134 |
-
} else {
|
5135 |
-
// empty component root.
|
5136 |
-
// skip all element-related modules except for ref (#3455)
|
5137 |
-
registerRef(vnode);
|
5138 |
-
// make sure to invoke the insert hook
|
5139 |
-
insertedVnodeQueue.push(vnode);
|
5140 |
-
}
|
5141 |
-
}
|
5142 |
-
|
5143 |
-
function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
|
5144 |
-
var i;
|
5145 |
-
// hack for #4339: a reactivated component with inner transition
|
5146 |
-
// does not trigger because the inner node's created hooks are not called
|
5147 |
-
// again. It's not ideal to involve module-specific logic in here but
|
5148 |
-
// there doesn't seem to be a better way to do it.
|
5149 |
-
var innerNode = vnode;
|
5150 |
-
while (innerNode.componentInstance) {
|
5151 |
-
innerNode = innerNode.componentInstance._vnode;
|
5152 |
-
if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
|
5153 |
-
for (i = 0; i < cbs.activate.length; ++i) {
|
5154 |
-
cbs.activate[i](emptyNode, innerNode);
|
5155 |
-
}
|
5156 |
-
insertedVnodeQueue.push(innerNode);
|
5157 |
-
break
|
5158 |
-
}
|
5159 |
-
}
|
5160 |
-
// unlike a newly created component,
|
5161 |
-
// a reactivated keep-alive component doesn't insert itself
|
5162 |
-
insert(parentElm, vnode.elm, refElm);
|
5163 |
-
}
|
5164 |
-
|
5165 |
-
function insert (parent, elm, ref$$1) {
|
5166 |
-
if (isDef(parent)) {
|
5167 |
-
if (isDef(ref$$1)) {
|
5168 |
-
if (ref$$1.parentNode === parent) {
|
5169 |
-
nodeOps.insertBefore(parent, elm, ref$$1);
|
5170 |
-
}
|
5171 |
-
} else {
|
5172 |
-
nodeOps.appendChild(parent, elm);
|
5173 |
-
}
|
5174 |
-
}
|
5175 |
-
}
|
5176 |
-
|
5177 |
-
function createChildren (vnode, children, insertedVnodeQueue) {
|
5178 |
-
if (Array.isArray(children)) {
|
5179 |
-
for (var i = 0; i < children.length; ++i) {
|
5180 |
-
createElm(children[i], insertedVnodeQueue, vnode.elm, null, true);
|
5181 |
-
}
|
5182 |
-
} else if (isPrimitive(vnode.text)) {
|
5183 |
-
nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));
|
5184 |
-
}
|
5185 |
-
}
|
5186 |
-
|
5187 |
-
function isPatchable (vnode) {
|
5188 |
-
while (vnode.componentInstance) {
|
5189 |
-
vnode = vnode.componentInstance._vnode;
|
5190 |
-
}
|
5191 |
-
return isDef(vnode.tag)
|
5192 |
-
}
|
5193 |
-
|
5194 |
-
function invokeCreateHooks (vnode, insertedVnodeQueue) {
|
5195 |
-
for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
|
5196 |
-
cbs.create[i$1](emptyNode, vnode);
|
5197 |
-
}
|
5198 |
-
i = vnode.data.hook; // Reuse variable
|
5199 |
-
if (isDef(i)) {
|
5200 |
-
if (isDef(i.create)) { i.create(emptyNode, vnode); }
|
5201 |
-
if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
|
5202 |
-
}
|
5203 |
-
}
|
5204 |
-
|
5205 |
-
// set scope id attribute for scoped CSS.
|
5206 |
-
// this is implemented as a special case to avoid the overhead
|
5207 |
-
// of going through the normal attribute patching process.
|
5208 |
-
function setScope (vnode) {
|
5209 |
-
var i;
|
5210 |
-
var ancestor = vnode;
|
5211 |
-
while (ancestor) {
|
5212 |
-
if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
|
5213 |
-
nodeOps.setAttribute(vnode.elm, i, '');
|
5214 |
-
}
|
5215 |
-
ancestor = ancestor.parent;
|
5216 |
-
}
|
5217 |
-
// for slot content they should also get the scopeId from the host instance.
|
5218 |
-
if (isDef(i = activeInstance) &&
|
5219 |
-
i !== vnode.context &&
|
5220 |
-
isDef(i = i.$options._scopeId)
|
5221 |
-
) {
|
5222 |
-
nodeOps.setAttribute(vnode.elm, i, '');
|
5223 |
-
}
|
5224 |
-
}
|
5225 |
-
|
5226 |
-
function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
|
5227 |
-
for (; startIdx <= endIdx; ++startIdx) {
|
5228 |
-
createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm);
|
5229 |
-
}
|
5230 |
-
}
|
5231 |
-
|
5232 |
-
function invokeDestroyHook (vnode) {
|
5233 |
-
var i, j;
|
5234 |
-
var data = vnode.data;
|
5235 |
-
if (isDef(data)) {
|
5236 |
-
if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
|
5237 |
-
for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
|
5238 |
-
}
|
5239 |
-
if (isDef(i = vnode.children)) {
|
5240 |
-
for (j = 0; j < vnode.children.length; ++j) {
|
5241 |
-
invokeDestroyHook(vnode.children[j]);
|
5242 |
-
}
|
5243 |
-
}
|
5244 |
-
}
|
5245 |
-
|
5246 |
-
function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
|
5247 |
-
for (; startIdx <= endIdx; ++startIdx) {
|
5248 |
-
var ch = vnodes[startIdx];
|
5249 |
-
if (isDef(ch)) {
|
5250 |
-
if (isDef(ch.tag)) {
|
5251 |
-
removeAndInvokeRemoveHook(ch);
|
5252 |
-
invokeDestroyHook(ch);
|
5253 |
-
} else { // Text node
|
5254 |
-
removeNode(ch.elm);
|
5255 |
-
}
|
5256 |
-
}
|
5257 |
-
}
|
5258 |
-
}
|
5259 |
-
|
5260 |
-
function removeAndInvokeRemoveHook (vnode, rm) {
|
5261 |
-
if (isDef(rm) || isDef(vnode.data)) {
|
5262 |
-
var i;
|
5263 |
-
var listeners = cbs.remove.length + 1;
|
5264 |
-
if (isDef(rm)) {
|
5265 |
-
// we have a recursively passed down rm callback
|
5266 |
-
// increase the listeners count
|
5267 |
-
rm.listeners += listeners;
|
5268 |
-
} else {
|
5269 |
-
// directly removing
|
5270 |
-
rm = createRmCb(vnode.elm, listeners);
|
5271 |
-
}
|
5272 |
-
// recursively invoke hooks on child component root node
|
5273 |
-
if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
|
5274 |
-
removeAndInvokeRemoveHook(i, rm);
|
5275 |
-
}
|
5276 |
-
for (i = 0; i < cbs.remove.length; ++i) {
|
5277 |
-
cbs.remove[i](vnode, rm);
|
5278 |
-
}
|
5279 |
-
if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
|
5280 |
-
i(vnode, rm);
|
5281 |
-
} else {
|
5282 |
-
rm();
|
5283 |
-
}
|
5284 |
-
} else {
|
5285 |
-
removeNode(vnode.elm);
|
5286 |
-
}
|
5287 |
-
}
|
5288 |
-
|
5289 |
-
function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
|
5290 |
-
var oldStartIdx = 0;
|
5291 |
-
var newStartIdx = 0;
|
5292 |
-
var oldEndIdx = oldCh.length - 1;
|
5293 |
-
var oldStartVnode = oldCh[0];
|
5294 |
-
var oldEndVnode = oldCh[oldEndIdx];
|
5295 |
-
var newEndIdx = newCh.length - 1;
|
5296 |
-
var newStartVnode = newCh[0];
|
5297 |
-
var newEndVnode = newCh[newEndIdx];
|
5298 |
-
var oldKeyToIdx, idxInOld, elmToMove, refElm;
|
5299 |
-
|
5300 |
-
// removeOnly is a special flag used only by <transition-group>
|
5301 |
-
// to ensure removed elements stay in correct relative positions
|
5302 |
-
// during leaving transitions
|
5303 |
-
var canMove = !removeOnly;
|
5304 |
-
|
5305 |
-
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
5306 |
-
if (isUndef(oldStartVnode)) {
|
5307 |
-
oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
|
5308 |
-
} else if (isUndef(oldEndVnode)) {
|
5309 |
-
oldEndVnode = oldCh[--oldEndIdx];
|
5310 |
-
} else if (sameVnode(oldStartVnode, newStartVnode)) {
|
5311 |
-
patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
|
5312 |
-
oldStartVnode = oldCh[++oldStartIdx];
|
5313 |
-
newStartVnode = newCh[++newStartIdx];
|
5314 |
-
} else if (sameVnode(oldEndVnode, newEndVnode)) {
|
5315 |
-
patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
|
5316 |
-
oldEndVnode = oldCh[--oldEndIdx];
|
5317 |
-
newEndVnode = newCh[--newEndIdx];
|
5318 |
-
} else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
|
5319 |
-
patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
|
5320 |
-
canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
|
5321 |
-
oldStartVnode = oldCh[++oldStartIdx];
|
5322 |
-
newEndVnode = newCh[--newEndIdx];
|
5323 |
-
} else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
|
5324 |
-
patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
|
5325 |
-
canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
|
5326 |
-
oldEndVnode = oldCh[--oldEndIdx];
|
5327 |
-
newStartVnode = newCh[++newStartIdx];
|
5328 |
-
} else {
|
5329 |
-
if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
|
5330 |
-
idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null;
|
5331 |
-
if (isUndef(idxInOld)) { // New element
|
5332 |
-
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
|
5333 |
-
newStartVnode = newCh[++newStartIdx];
|
5334 |
-
} else {
|
5335 |
-
elmToMove = oldCh[idxInOld];
|
5336 |
-
/* istanbul ignore if */
|
5337 |
-
if ("development" !== 'production' && !elmToMove) {
|
5338 |
-
warn(
|
5339 |
-
'It seems there are duplicate keys that is causing an update error. ' +
|
5340 |
-
'Make sure each v-for item has a unique key.'
|
5341 |
);
|
5342 |
-
|
5343 |
-
|
5344 |
-
|
5345 |
-
|
5346 |
-
|
5347 |
-
newStartVnode = newCh[++newStartIdx];
|
5348 |
-
} else {
|
5349 |
-
// same key but different element. treat as new element
|
5350 |
-
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
|
5351 |
-
newStartVnode = newCh[++newStartIdx];
|
5352 |
-
}
|
5353 |
-
}
|
5354 |
-
}
|
5355 |
-
}
|
5356 |
-
if (oldStartIdx > oldEndIdx) {
|
5357 |
-
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
|
5358 |
-
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
|
5359 |
-
} else if (newStartIdx > newEndIdx) {
|
5360 |
-
removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
|
5361 |
-
}
|
5362 |
-
}
|
5363 |
-
|
5364 |
-
function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {
|
5365 |
-
if (oldVnode === vnode) {
|
5366 |
-
return
|
5367 |
-
}
|
5368 |
-
|
5369 |
-
var elm = vnode.elm = oldVnode.elm;
|
5370 |
-
|
5371 |
-
if (isTrue(oldVnode.isAsyncPlaceholder)) {
|
5372 |
-
if (isDef(vnode.asyncFactory.resolved)) {
|
5373 |
-
hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
|
5374 |
-
} else {
|
5375 |
-
vnode.isAsyncPlaceholder = true;
|
5376 |
-
}
|
5377 |
-
return
|
5378 |
-
}
|
5379 |
-
|
5380 |
-
// reuse element for static trees.
|
5381 |
-
// note we only do this if the vnode is cloned -
|
5382 |
-
// if the new node is not cloned it means the render functions have been
|
5383 |
-
// reset by the hot-reload-api and we need to do a proper re-render.
|
5384 |
-
if (isTrue(vnode.isStatic) &&
|
5385 |
-
isTrue(oldVnode.isStatic) &&
|
5386 |
-
vnode.key === oldVnode.key &&
|
5387 |
-
(isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
|
5388 |
-
) {
|
5389 |
-
vnode.componentInstance = oldVnode.componentInstance;
|
5390 |
-
return
|
5391 |
-
}
|
5392 |
-
|
5393 |
-
var i;
|
5394 |
-
var data = vnode.data;
|
5395 |
-
if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
|
5396 |
-
i(oldVnode, vnode);
|
5397 |
-
}
|
5398 |
-
|
5399 |
-
var oldCh = oldVnode.children;
|
5400 |
-
var ch = vnode.children;
|
5401 |
-
if (isDef(data) && isPatchable(vnode)) {
|
5402 |
-
for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
|
5403 |
-
if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
|
5404 |
-
}
|
5405 |
-
if (isUndef(vnode.text)) {
|
5406 |
-
if (isDef(oldCh) && isDef(ch)) {
|
5407 |
-
if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
|
5408 |
-
} else if (isDef(ch)) {
|
5409 |
-
if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
|
5410 |
-
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
|
5411 |
-
} else if (isDef(oldCh)) {
|
5412 |
-
removeVnodes(elm, oldCh, 0, oldCh.length - 1);
|
5413 |
-
} else if (isDef(oldVnode.text)) {
|
5414 |
-
nodeOps.setTextContent(elm, '');
|
5415 |
-
}
|
5416 |
-
} else if (oldVnode.text !== vnode.text) {
|
5417 |
-
nodeOps.setTextContent(elm, vnode.text);
|
5418 |
-
}
|
5419 |
-
if (isDef(data)) {
|
5420 |
-
if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
|
5421 |
-
}
|
5422 |
-
}
|
5423 |
-
|
5424 |
-
function invokeInsertHook (vnode, queue, initial) {
|
5425 |
-
// delay insert hooks for component root nodes, invoke them after the
|
5426 |
-
// element is really inserted
|
5427 |
-
if (isTrue(initial) && isDef(vnode.parent)) {
|
5428 |
-
vnode.parent.data.pendingInsert = queue;
|
5429 |
-
} else {
|
5430 |
-
for (var i = 0; i < queue.length; ++i) {
|
5431 |
-
queue[i].data.hook.insert(queue[i]);
|
5432 |
-
}
|
5433 |
}
|
5434 |
-
}
|
5435 |
|
5436 |
-
|
5437 |
-
|
5438 |
-
|
5439 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5440 |
|
5441 |
-
|
5442 |
-
function hydrate (elm, vnode, insertedVnodeQueue) {
|
5443 |
-
if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
|
5444 |
-
vnode.elm = elm;
|
5445 |
-
vnode.isAsyncPlaceholder = true;
|
5446 |
-
return true
|
5447 |
}
|
5448 |
-
|
5449 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5450 |
return false
|
5451 |
-
}
|
5452 |
-
}
|
5453 |
-
vnode.elm = elm;
|
5454 |
-
var tag = vnode.tag;
|
5455 |
-
var data = vnode.data;
|
5456 |
-
var children = vnode.children;
|
5457 |
-
if (isDef(data)) {
|
5458 |
-
if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
|
5459 |
-
if (isDef(i = vnode.componentInstance)) {
|
5460 |
-
// child component. it should have hydrated its own tree.
|
5461 |
-
initComponent(vnode, insertedVnodeQueue);
|
5462 |
-
return true
|
5463 |
-
}
|
5464 |
}
|
5465 |
-
|
5466 |
-
|
5467 |
-
|
5468 |
-
|
5469 |
-
|
5470 |
-
|
5471 |
-
|
5472 |
-
|
5473 |
-
|
5474 |
-
|
5475 |
-
|
5476 |
-
|
5477 |
-
|
5478 |
-
|
5479 |
-
|
5480 |
-
|
5481 |
-
|
5482 |
-
|
5483 |
-
|
5484 |
-
|
5485 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5486 |
) {
|
5487 |
-
|
5488 |
-
|
5489 |
-
|
|
|
5490 |
}
|
5491 |
-
|
5492 |
-
|
5493 |
-
|
5494 |
-
|
5495 |
-
|
5496 |
-
|
5497 |
-
if (!isRenderedModule(key)) {
|
5498 |
-
invokeCreateHooks(vnode, insertedVnodeQueue);
|
5499 |
-
break
|
5500 |
-
}
|
5501 |
-
}
|
5502 |
-
}
|
5503 |
-
} else if (elm.data !== vnode.text) {
|
5504 |
-
elm.data = vnode.text;
|
5505 |
-
}
|
5506 |
-
return true
|
5507 |
-
}
|
5508 |
-
|
5509 |
-
function assertNodeMatch (node, vnode) {
|
5510 |
-
if (isDef(vnode.tag)) {
|
5511 |
-
return (
|
5512 |
-
vnode.tag.indexOf('vue-component') === 0 ||
|
5513 |
-
vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
|
5514 |
-
)
|
5515 |
-
} else {
|
5516 |
-
return node.nodeType === (vnode.isComment ? 8 : 3)
|
5517 |
}
|
5518 |
-
}
|
5519 |
|
5520 |
-
|
5521 |
-
|
5522 |
-
|
5523 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5524 |
}
|
5525 |
|
5526 |
-
|
5527 |
-
|
5528 |
-
|
5529 |
-
if (isUndef(oldVnode)) {
|
5530 |
-
// empty mount (likely as component), create new root element
|
5531 |
-
isInitialPatch = true;
|
5532 |
-
createElm(vnode, insertedVnodeQueue, parentElm, refElm);
|
5533 |
-
} else {
|
5534 |
-
var isRealElement = isDef(oldVnode.nodeType);
|
5535 |
-
if (!isRealElement && sameVnode(oldVnode, vnode)) {
|
5536 |
-
// patch existing root node
|
5537 |
-
patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);
|
5538 |
-
} else {
|
5539 |
-
if (isRealElement) {
|
5540 |
-
// mounting to a real element
|
5541 |
-
// check if this is server-rendered content and if we can perform
|
5542 |
-
// a successful hydration.
|
5543 |
-
if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
|
5544 |
-
oldVnode.removeAttribute(SSR_ATTR);
|
5545 |
-
hydrating = true;
|
5546 |
-
}
|
5547 |
-
if (isTrue(hydrating)) {
|
5548 |
-
if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
|
5549 |
-
invokeInsertHook(vnode, insertedVnodeQueue, true);
|
5550 |
-
return oldVnode
|
5551 |
-
} else {
|
5552 |
-
warn(
|
5553 |
-
'The client-side rendered virtual DOM tree is not matching ' +
|
5554 |
-
'server-rendered content. This is likely caused by incorrect ' +
|
5555 |
-
'HTML markup, for example nesting block-level elements inside ' +
|
5556 |
-
'<p>, or missing <tbody>. Bailing hydration and performing ' +
|
5557 |
-
'full client-side render.'
|
5558 |
-
);
|
5559 |
-
}
|
5560 |
-
}
|
5561 |
-
// either not server-rendered, or hydration failed.
|
5562 |
-
// create an empty node and replace it
|
5563 |
-
oldVnode = emptyNodeAt(oldVnode);
|
5564 |
-
}
|
5565 |
-
// replacing existing element
|
5566 |
-
var oldElm = oldVnode.elm;
|
5567 |
-
var parentElm$1 = nodeOps.parentNode(oldElm);
|
5568 |
-
createElm(
|
5569 |
-
vnode,
|
5570 |
-
insertedVnodeQueue,
|
5571 |
-
// extremely rare edge case: do not insert if old element is in a
|
5572 |
-
// leaving transition. Only happens when combining transition +
|
5573 |
-
// keep-alive + HOCs. (#4590)
|
5574 |
-
oldElm._leaveCb ? null : parentElm$1,
|
5575 |
-
nodeOps.nextSibling(oldElm)
|
5576 |
-
);
|
5577 |
-
|
5578 |
-
if (isDef(vnode.parent)) {
|
5579 |
-
// component root element replaced.
|
5580 |
-
// update parent placeholder node element, recursively
|
5581 |
-
var ancestor = vnode.parent;
|
5582 |
-
while (ancestor) {
|
5583 |
-
ancestor.elm = vnode.elm;
|
5584 |
-
ancestor = ancestor.parent;
|
5585 |
-
}
|
5586 |
-
if (isPatchable(vnode)) {
|
5587 |
-
for (var i = 0; i < cbs.create.length; ++i) {
|
5588 |
-
cbs.create[i](emptyNode, vnode.parent);
|
5589 |
-
}
|
5590 |
-
}
|
5591 |
-
}
|
5592 |
-
|
5593 |
-
if (isDef(parentElm$1)) {
|
5594 |
-
removeVnodes(parentElm$1, [oldVnode], 0, 0);
|
5595 |
-
} else if (isDef(oldVnode.tag)) {
|
5596 |
-
invokeDestroyHook(oldVnode);
|
5597 |
-
}
|
5598 |
-
}
|
5599 |
-
}
|
5600 |
-
|
5601 |
-
invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
|
5602 |
-
return vnode.elm
|
5603 |
-
}
|
5604 |
-
}
|
5605 |
-
|
5606 |
-
/* */
|
5607 |
-
|
5608 |
-
var directives = {
|
5609 |
-
create: updateDirectives,
|
5610 |
-
update: updateDirectives,
|
5611 |
-
destroy: function unbindDirectives (vnode) {
|
5612 |
-
updateDirectives(vnode, emptyNode);
|
5613 |
-
}
|
5614 |
-
};
|
5615 |
-
|
5616 |
-
function updateDirectives (oldVnode, vnode) {
|
5617 |
-
if (oldVnode.data.directives || vnode.data.directives) {
|
5618 |
-
_update(oldVnode, vnode);
|
5619 |
-
}
|
5620 |
-
}
|
5621 |
-
|
5622 |
-
function _update (oldVnode, vnode) {
|
5623 |
-
var isCreate = oldVnode === emptyNode;
|
5624 |
-
var isDestroy = vnode === emptyNode;
|
5625 |
-
var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
|
5626 |
-
var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
|
5627 |
-
|
5628 |
-
var dirsWithInsert = [];
|
5629 |
-
var dirsWithPostpatch = [];
|
5630 |
-
|
5631 |
-
var key, oldDir, dir;
|
5632 |
-
for (key in newDirs) {
|
5633 |
-
oldDir = oldDirs[key];
|
5634 |
-
dir = newDirs[key];
|
5635 |
-
if (!oldDir) {
|
5636 |
-
// new directive, bind
|
5637 |
-
callHook$1(dir, 'bind', vnode, oldVnode);
|
5638 |
-
if (dir.def && dir.def.inserted) {
|
5639 |
-
dirsWithInsert.push(dir);
|
5640 |
-
}
|
5641 |
-
} else {
|
5642 |
-
// existing directive, update
|
5643 |
-
dir.oldValue = oldDir.value;
|
5644 |
-
callHook$1(dir, 'update', vnode, oldVnode);
|
5645 |
-
if (dir.def && dir.def.componentUpdated) {
|
5646 |
-
dirsWithPostpatch.push(dir);
|
5647 |
-
}
|
5648 |
-
}
|
5649 |
-
}
|
5650 |
-
|
5651 |
-
if (dirsWithInsert.length) {
|
5652 |
-
var callInsert = function () {
|
5653 |
-
for (var i = 0; i < dirsWithInsert.length; i++) {
|
5654 |
-
callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
|
5655 |
-
}
|
5656 |
-
};
|
5657 |
-
if (isCreate) {
|
5658 |
-
mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert);
|
5659 |
-
} else {
|
5660 |
-
callInsert();
|
5661 |
}
|
5662 |
-
}
|
5663 |
|
5664 |
-
|
5665 |
-
|
5666 |
-
|
5667 |
-
|
5668 |
-
|
5669 |
-
|
5670 |
-
|
5671 |
-
|
5672 |
-
if (!isCreate) {
|
5673 |
-
for (key in oldDirs) {
|
5674 |
-
if (!newDirs[key]) {
|
5675 |
-
// no longer present, unbind
|
5676 |
-
callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
|
5677 |
-
}
|
5678 |
-
}
|
5679 |
-
}
|
5680 |
-
}
|
5681 |
-
|
5682 |
-
var emptyModifiers = Object.create(null);
|
5683 |
-
|
5684 |
-
function normalizeDirectives$1 (
|
5685 |
-
dirs,
|
5686 |
-
vm
|
5687 |
-
) {
|
5688 |
-
var res = Object.create(null);
|
5689 |
-
if (!dirs) {
|
5690 |
-
return res
|
5691 |
-
}
|
5692 |
-
var i, dir;
|
5693 |
-
for (i = 0; i < dirs.length; i++) {
|
5694 |
-
dir = dirs[i];
|
5695 |
-
if (!dir.modifiers) {
|
5696 |
-
dir.modifiers = emptyModifiers;
|
5697 |
-
}
|
5698 |
-
res[getRawDirName(dir)] = dir;
|
5699 |
-
dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
|
5700 |
-
}
|
5701 |
-
return res
|
5702 |
-
}
|
5703 |
-
|
5704 |
-
function getRawDirName (dir) {
|
5705 |
-
return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
|
5706 |
-
}
|
5707 |
-
|
5708 |
-
function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
|
5709 |
-
var fn = dir.def && dir.def[hook];
|
5710 |
-
if (fn) {
|
5711 |
-
try {
|
5712 |
-
fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
|
5713 |
-
} catch (e) {
|
5714 |
-
handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
|
5715 |
-
}
|
5716 |
-
}
|
5717 |
-
}
|
5718 |
-
|
5719 |
-
var baseModules = [
|
5720 |
-
ref,
|
5721 |
-
directives
|
5722 |
-
];
|
5723 |
-
|
5724 |
-
/* */
|
5725 |
-
|
5726 |
-
function updateAttrs (oldVnode, vnode) {
|
5727 |
-
var opts = vnode.componentOptions;
|
5728 |
-
if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
|
5729 |
-
return
|
5730 |
-
}
|
5731 |
-
if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
|
5732 |
-
return
|
5733 |
-
}
|
5734 |
-
var key, cur, old;
|
5735 |
-
var elm = vnode.elm;
|
5736 |
-
var oldAttrs = oldVnode.data.attrs || {};
|
5737 |
-
var attrs = vnode.data.attrs || {};
|
5738 |
-
// clone observed objects, as the user probably wants to mutate it
|
5739 |
-
if (isDef(attrs.__ob__)) {
|
5740 |
-
attrs = vnode.data.attrs = extend({}, attrs);
|
5741 |
-
}
|
5742 |
-
|
5743 |
-
for (key in attrs) {
|
5744 |
-
cur = attrs[key];
|
5745 |
-
old = oldAttrs[key];
|
5746 |
-
if (old !== cur) {
|
5747 |
-
setAttr(elm, key, cur);
|
5748 |
-
}
|
5749 |
-
}
|
5750 |
-
// #4391: in IE9, setting type can reset value for input[type=radio]
|
5751 |
-
/* istanbul ignore if */
|
5752 |
-
if (isIE9 && attrs.value !== oldAttrs.value) {
|
5753 |
-
setAttr(elm, 'value', attrs.value);
|
5754 |
-
}
|
5755 |
-
for (key in oldAttrs) {
|
5756 |
-
if (isUndef(attrs[key])) {
|
5757 |
-
if (isXlink(key)) {
|
5758 |
-
elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
|
5759 |
-
} else if (!isEnumeratedAttr(key)) {
|
5760 |
-
elm.removeAttribute(key);
|
5761 |
-
}
|
5762 |
-
}
|
5763 |
-
}
|
5764 |
-
}
|
5765 |
-
|
5766 |
-
function setAttr (el, key, value) {
|
5767 |
-
if (isBooleanAttr(key)) {
|
5768 |
-
// set attribute for blank value
|
5769 |
-
// e.g. <option disabled>Select one</option>
|
5770 |
-
if (isFalsyAttrValue(value)) {
|
5771 |
-
el.removeAttribute(key);
|
5772 |
-
} else {
|
5773 |
-
el.setAttribute(key, key);
|
5774 |
-
}
|
5775 |
-
} else if (isEnumeratedAttr(key)) {
|
5776 |
-
el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');
|
5777 |
-
} else if (isXlink(key)) {
|
5778 |
-
if (isFalsyAttrValue(value)) {
|
5779 |
-
el.removeAttributeNS(xlinkNS, getXlinkProp(key));
|
5780 |
-
} else {
|
5781 |
-
el.setAttributeNS(xlinkNS, key, value);
|
5782 |
}
|
5783 |
-
} else {
|
5784 |
-
if (isFalsyAttrValue(value)) {
|
5785 |
-
el.removeAttribute(key);
|
5786 |
-
} else {
|
5787 |
-
el.setAttribute(key, value);
|
5788 |
-
}
|
5789 |
-
}
|
5790 |
-
}
|
5791 |
-
|
5792 |
-
var attrs = {
|
5793 |
-
create: updateAttrs,
|
5794 |
-
update: updateAttrs
|
5795 |
-
};
|
5796 |
-
|
5797 |
-
/* */
|
5798 |
-
|
5799 |
-
function updateClass (oldVnode, vnode) {
|
5800 |
-
var el = vnode.elm;
|
5801 |
-
var data = vnode.data;
|
5802 |
-
var oldData = oldVnode.data;
|
5803 |
-
if (
|
5804 |
-
isUndef(data.staticClass) &&
|
5805 |
-
isUndef(data.class) && (
|
5806 |
-
isUndef(oldData) || (
|
5807 |
-
isUndef(oldData.staticClass) &&
|
5808 |
-
isUndef(oldData.class)
|
5809 |
-
)
|
5810 |
-
)
|
5811 |
-
) {
|
5812 |
-
return
|
5813 |
-
}
|
5814 |
-
|
5815 |
-
var cls = genClassForVnode(vnode);
|
5816 |
-
|
5817 |
-
// handle transition classes
|
5818 |
-
var transitionClass = el._transitionClasses;
|
5819 |
-
if (isDef(transitionClass)) {
|
5820 |
-
cls = concat(cls, stringifyClass(transitionClass));
|
5821 |
-
}
|
5822 |
-
|
5823 |
-
// set the class
|
5824 |
-
if (cls !== el._prevClass) {
|
5825 |
-
el.setAttribute('class', cls);
|
5826 |
-
el._prevClass = cls;
|
5827 |
-
}
|
5828 |
-
}
|
5829 |
-
|
5830 |
-
var klass = {
|
5831 |
-
create: updateClass,
|
5832 |
-
update: updateClass
|
5833 |
-
};
|
5834 |
-
|
5835 |
-
/* */
|
5836 |
-
|
5837 |
-
var validDivisionCharRE = /[\w).+\-_$\]]/;
|
5838 |
-
|
5839 |
-
function parseFilters (exp) {
|
5840 |
-
var inSingle = false;
|
5841 |
-
var inDouble = false;
|
5842 |
-
var inTemplateString = false;
|
5843 |
-
var inRegex = false;
|
5844 |
-
var curly = 0;
|
5845 |
-
var square = 0;
|
5846 |
-
var paren = 0;
|
5847 |
-
var lastFilterIndex = 0;
|
5848 |
-
var c, prev, i, expression, filters;
|
5849 |
-
|
5850 |
-
for (i = 0; i < exp.length; i++) {
|
5851 |
-
prev = c;
|
5852 |
-
c = exp.charCodeAt(i);
|
5853 |
-
if (inSingle) {
|
5854 |
-
if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
|
5855 |
-
} else if (inDouble) {
|
5856 |
-
if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
|
5857 |
-
} else if (inTemplateString) {
|
5858 |
-
if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
|
5859 |
-
} else if (inRegex) {
|
5860 |
-
if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
|
5861 |
-
} else if (
|
5862 |
-
c === 0x7C && // pipe
|
5863 |
-
exp.charCodeAt(i + 1) !== 0x7C &&
|
5864 |
-
exp.charCodeAt(i - 1) !== 0x7C &&
|
5865 |
-
!curly && !square && !paren
|
5866 |
-
) {
|
5867 |
-
if (expression === undefined) {
|
5868 |
-
// first filter, end of expression
|
5869 |
-
lastFilterIndex = i + 1;
|
5870 |
-
expression = exp.slice(0, i).trim();
|
5871 |
-
} else {
|
5872 |
-
pushFilter();
|
5873 |
-
}
|
5874 |
-
} else {
|
5875 |
-
switch (c) {
|
5876 |
-
case 0x22: inDouble = true; break // "
|
5877 |
-
case 0x27: inSingle = true; break // '
|
5878 |
-
case 0x60: inTemplateString = true; break // `
|
5879 |
-
case 0x28: paren++; break // (
|
5880 |
-
case 0x29: paren--; break // )
|
5881 |
-
case 0x5B: square++; break // [
|
5882 |
-
case 0x5D: square--; break // ]
|
5883 |
-
case 0x7B: curly++; break // {
|
5884 |
-
case 0x7D: curly--; break // }
|
5885 |
-
}
|
5886 |
-
if (c === 0x2f) { // /
|
5887 |
-
var j = i - 1;
|
5888 |
-
var p = (void 0);
|
5889 |
-
// find first non-whitespace prev char
|
5890 |
-
for (; j >= 0; j--) {
|
5891 |
-
p = exp.charAt(j);
|
5892 |
-
if (p !== ' ') { break }
|
5893 |
-
}
|
5894 |
-
if (!p || !validDivisionCharRE.test(p)) {
|
5895 |
-
inRegex = true;
|
5896 |
-
}
|
5897 |
-
}
|
5898 |
-
}
|
5899 |
-
}
|
5900 |
-
|
5901 |
-
if (expression === undefined) {
|
5902 |
-
expression = exp.slice(0, i).trim();
|
5903 |
-
} else if (lastFilterIndex !== 0) {
|
5904 |
-
pushFilter();
|
5905 |
-
}
|
5906 |
-
|
5907 |
-
function pushFilter () {
|
5908 |
-
(filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
|
5909 |
-
lastFilterIndex = i + 1;
|
5910 |
-
}
|
5911 |
-
|
5912 |
-
if (filters) {
|
5913 |
-
for (i = 0; i < filters.length; i++) {
|
5914 |
-
expression = wrapFilter(expression, filters[i]);
|
5915 |
-
}
|
5916 |
-
}
|
5917 |
-
|
5918 |
-
return expression
|
5919 |
-
}
|
5920 |
-
|
5921 |
-
function wrapFilter (exp, filter) {
|
5922 |
-
var i = filter.indexOf('(');
|
5923 |
-
if (i < 0) {
|
5924 |
-
// _f: resolveFilter
|
5925 |
-
return ("_f(\"" + filter + "\")(" + exp + ")")
|
5926 |
-
} else {
|
5927 |
-
var name = filter.slice(0, i);
|
5928 |
-
var args = filter.slice(i + 1);
|
5929 |
-
return ("_f(\"" + name + "\")(" + exp + "," + args)
|
5930 |
-
}
|
5931 |
-
}
|
5932 |
-
|
5933 |
-
/* */
|
5934 |
-
|
5935 |
-
function baseWarn (msg) {
|
5936 |
-
console.error(("[Vue compiler]: " + msg));
|
5937 |
-
}
|
5938 |
-
|
5939 |
-
function pluckModuleFunction (
|
5940 |
-
modules,
|
5941 |
-
key
|
5942 |
-
) {
|
5943 |
-
return modules
|
5944 |
-
? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
|
5945 |
-
: []
|
5946 |
-
}
|
5947 |
-
|
5948 |
-
function addProp (el, name, value) {
|
5949 |
-
(el.props || (el.props = [])).push({ name: name, value: value });
|
5950 |
-
}
|
5951 |
-
|
5952 |
-
function addAttr (el, name, value) {
|
5953 |
-
(el.attrs || (el.attrs = [])).push({ name: name, value: value });
|
5954 |
-
}
|
5955 |
-
|
5956 |
-
function addDirective (
|
5957 |
-
el,
|
5958 |
-
name,
|
5959 |
-
rawName,
|
5960 |
-
value,
|
5961 |
-
arg,
|
5962 |
-
modifiers
|
5963 |
-
) {
|
5964 |
-
(el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers });
|
5965 |
-
}
|
5966 |
-
|
5967 |
-
function addHandler (
|
5968 |
-
el,
|
5969 |
-
name,
|
5970 |
-
value,
|
5971 |
-
modifiers,
|
5972 |
-
important,
|
5973 |
-
warn
|
5974 |
-
) {
|
5975 |
-
// warn prevent and passive modifier
|
5976 |
-
/* istanbul ignore if */
|
5977 |
-
if (
|
5978 |
-
"development" !== 'production' && warn &&
|
5979 |
-
modifiers && modifiers.prevent && modifiers.passive
|
5980 |
-
) {
|
5981 |
-
warn(
|
5982 |
-
'passive and prevent can\'t be used together. ' +
|
5983 |
-
'Passive handler can\'t prevent default event.'
|
5984 |
-
);
|
5985 |
-
}
|
5986 |
-
// check capture modifier
|
5987 |
-
if (modifiers && modifiers.capture) {
|
5988 |
-
delete modifiers.capture;
|
5989 |
-
name = '!' + name; // mark the event as captured
|
5990 |
-
}
|
5991 |
-
if (modifiers && modifiers.once) {
|
5992 |
-
delete modifiers.once;
|
5993 |
-
name = '~' + name; // mark the event as once
|
5994 |
-
}
|
5995 |
-
/* istanbul ignore if */
|
5996 |
-
if (modifiers && modifiers.passive) {
|
5997 |
-
delete modifiers.passive;
|
5998 |
-
name = '&' + name; // mark the event as passive
|
5999 |
-
}
|
6000 |
-
var events;
|
6001 |
-
if (modifiers && modifiers.native) {
|
6002 |
-
delete modifiers.native;
|
6003 |
-
events = el.nativeEvents || (el.nativeEvents = {});
|
6004 |
-
} else {
|
6005 |
-
events = el.events || (el.events = {});
|
6006 |
-
}
|
6007 |
-
var newHandler = { value: value, modifiers: modifiers };
|
6008 |
-
var handlers = events[name];
|
6009 |
-
/* istanbul ignore if */
|
6010 |
-
if (Array.isArray(handlers)) {
|
6011 |
-
important ? handlers.unshift(newHandler) : handlers.push(newHandler);
|
6012 |
-
} else if (handlers) {
|
6013 |
-
events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
|
6014 |
-
} else {
|
6015 |
-
events[name] = newHandler;
|
6016 |
-
}
|
6017 |
-
}
|
6018 |
-
|
6019 |
-
function getBindingAttr (
|
6020 |
-
el,
|
6021 |
-
name,
|
6022 |
-
getStatic
|
6023 |
-
) {
|
6024 |
-
var dynamicValue =
|
6025 |
-
getAndRemoveAttr(el, ':' + name) ||
|
6026 |
-
getAndRemoveAttr(el, 'v-bind:' + name);
|
6027 |
-
if (dynamicValue != null) {
|
6028 |
-
return parseFilters(dynamicValue)
|
6029 |
-
} else if (getStatic !== false) {
|
6030 |
-
var staticValue = getAndRemoveAttr(el, name);
|
6031 |
-
if (staticValue != null) {
|
6032 |
-
return JSON.stringify(staticValue)
|
6033 |
-
}
|
6034 |
-
}
|
6035 |
-
}
|
6036 |
-
|
6037 |
-
function getAndRemoveAttr (el, name) {
|
6038 |
-
var val;
|
6039 |
-
if ((val = el.attrsMap[name]) != null) {
|
6040 |
-
var list = el.attrsList;
|
6041 |
-
for (var i = 0, l = list.length; i < l; i++) {
|
6042 |
-
if (list[i].name === name) {
|
6043 |
-
list.splice(i, 1);
|
6044 |
-
break
|
6045 |
-
}
|
6046 |
-
}
|
6047 |
-
}
|
6048 |
-
return val
|
6049 |
-
}
|
6050 |
-
|
6051 |
-
/* */
|
6052 |
-
|
6053 |
-
/**
|
6054 |
-
* Cross-platform code generation for component v-model
|
6055 |
-
*/
|
6056 |
-
function genComponentModel (
|
6057 |
-
el,
|
6058 |
-
value,
|
6059 |
-
modifiers
|
6060 |
-
) {
|
6061 |
-
var ref = modifiers || {};
|
6062 |
-
var number = ref.number;
|
6063 |
-
var trim = ref.trim;
|
6064 |
-
|
6065 |
-
var baseValueExpression = '$$v';
|
6066 |
-
var valueExpression = baseValueExpression;
|
6067 |
-
if (trim) {
|
6068 |
-
valueExpression =
|
6069 |
-
"(typeof " + baseValueExpression + " === 'string'" +
|
6070 |
-
"? " + baseValueExpression + ".trim()" +
|
6071 |
-
": " + baseValueExpression + ")";
|
6072 |
-
}
|
6073 |
-
if (number) {
|
6074 |
-
valueExpression = "_n(" + valueExpression + ")";
|
6075 |
-
}
|
6076 |
-
var assignment = genAssignmentCode(value, valueExpression);
|
6077 |
-
|
6078 |
-
el.model = {
|
6079 |
-
value: ("(" + value + ")"),
|
6080 |
-
expression: ("\"" + value + "\""),
|
6081 |
-
callback: ("function (" + baseValueExpression + ") {" + assignment + "}")
|
6082 |
-
};
|
6083 |
-
}
|
6084 |
-
|
6085 |
-
/**
|
6086 |
-
* Cross-platform codegen helper for generating v-model value assignment code.
|
6087 |
-
*/
|
6088 |
-
function genAssignmentCode (
|
6089 |
-
value,
|
6090 |
-
assignment
|
6091 |
-
) {
|
6092 |
-
var modelRs = parseModel(value);
|
6093 |
-
if (modelRs.idx === null) {
|
6094 |
-
return (value + "=" + assignment)
|
6095 |
-
} else {
|
6096 |
-
return ("$set(" + (modelRs.exp) + ", " + (modelRs.idx) + ", " + assignment + ")")
|
6097 |
-
}
|
6098 |
-
}
|
6099 |
-
|
6100 |
-
/**
|
6101 |
-
* parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)
|
6102 |
-
*
|
6103 |
-
* for loop possible cases:
|
6104 |
-
*
|
6105 |
-
* - test
|
6106 |
-
* - test[idx]
|
6107 |
-
* - test[test1[idx]]
|
6108 |
-
* - test["a"][idx]
|
6109 |
-
* - xxx.test[a[a].test1[idx]]
|
6110 |
-
* - test.xxx.a["asa"][test1[idx]]
|
6111 |
-
*
|
6112 |
-
*/
|
6113 |
|
6114 |
-
|
6115 |
-
|
6116 |
-
|
6117 |
-
|
6118 |
-
var expressionPos;
|
6119 |
-
var expressionEndPos;
|
6120 |
-
|
6121 |
-
function parseModel (val) {
|
6122 |
-
str = val;
|
6123 |
-
len = str.length;
|
6124 |
-
index$1 = expressionPos = expressionEndPos = 0;
|
6125 |
-
|
6126 |
-
if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
|
6127 |
-
return {
|
6128 |
-
exp: val,
|
6129 |
-
idx: null
|
6130 |
-
}
|
6131 |
-
}
|
6132 |
-
|
6133 |
-
while (!eof()) {
|
6134 |
-
chr = next();
|
6135 |
-
/* istanbul ignore if */
|
6136 |
-
if (isStringStart(chr)) {
|
6137 |
-
parseString(chr);
|
6138 |
-
} else if (chr === 0x5B) {
|
6139 |
-
parseBracket(chr);
|
6140 |
-
}
|
6141 |
-
}
|
6142 |
-
|
6143 |
-
return {
|
6144 |
-
exp: val.substring(0, expressionPos),
|
6145 |
-
idx: val.substring(expressionPos + 1, expressionEndPos)
|
6146 |
-
}
|
6147 |
-
}
|
6148 |
-
|
6149 |
-
function next () {
|
6150 |
-
return str.charCodeAt(++index$1)
|
6151 |
-
}
|
6152 |
-
|
6153 |
-
function eof () {
|
6154 |
-
return index$1 >= len
|
6155 |
-
}
|
6156 |
-
|
6157 |
-
function isStringStart (chr) {
|
6158 |
-
return chr === 0x22 || chr === 0x27
|
6159 |
-
}
|
6160 |
-
|
6161 |
-
function parseBracket (chr) {
|
6162 |
-
var inBracket = 1;
|
6163 |
-
expressionPos = index$1;
|
6164 |
-
while (!eof()) {
|
6165 |
-
chr = next();
|
6166 |
-
if (isStringStart(chr)) {
|
6167 |
-
parseString(chr);
|
6168 |
-
continue
|
6169 |
-
}
|
6170 |
-
if (chr === 0x5B) { inBracket++; }
|
6171 |
-
if (chr === 0x5D) { inBracket--; }
|
6172 |
-
if (inBracket === 0) {
|
6173 |
-
expressionEndPos = index$1;
|
6174 |
-
break
|
6175 |
-
}
|
6176 |
-
}
|
6177 |
-
}
|
6178 |
-
|
6179 |
-
function parseString (chr) {
|
6180 |
-
var stringQuote = chr;
|
6181 |
-
while (!eof()) {
|
6182 |
-
chr = next();
|
6183 |
-
if (chr === stringQuote) {
|
6184 |
-
break
|
6185 |
-
}
|
6186 |
-
}
|
6187 |
-
}
|
6188 |
-
|
6189 |
-
/* */
|
6190 |
-
|
6191 |
-
var warn$1;
|
6192 |
-
|
6193 |
-
// in some cases, the event used has to be determined at runtime
|
6194 |
-
// so we used some reserved tokens during compile.
|
6195 |
-
var RANGE_TOKEN = '__r';
|
6196 |
-
var CHECKBOX_RADIO_TOKEN = '__c';
|
6197 |
-
|
6198 |
-
function model (
|
6199 |
-
el,
|
6200 |
-
dir,
|
6201 |
-
_warn
|
6202 |
-
) {
|
6203 |
-
warn$1 = _warn;
|
6204 |
-
var value = dir.value;
|
6205 |
-
var modifiers = dir.modifiers;
|
6206 |
-
var tag = el.tag;
|
6207 |
-
var type = el.attrsMap.type;
|
6208 |
-
|
6209 |
-
{
|
6210 |
-
var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
|
6211 |
-
if (tag === 'input' && dynamicType) {
|
6212 |
-
warn$1(
|
6213 |
-
"<input :type=\"" + dynamicType + "\" v-model=\"" + value + "\">:\n" +
|
6214 |
-
"v-model does not support dynamic input types. Use v-if branches instead."
|
6215 |
-
);
|
6216 |
-
}
|
6217 |
-
// inputs with type="file" are read only and setting the input's
|
6218 |
-
// value will throw an error.
|
6219 |
-
if (tag === 'input' && type === 'file') {
|
6220 |
-
warn$1(
|
6221 |
-
"<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
|
6222 |
-
"File inputs are read only. Use a v-on:change listener instead."
|
6223 |
-
);
|
6224 |
-
}
|
6225 |
-
}
|
6226 |
-
|
6227 |
-
if (el.component) {
|
6228 |
-
genComponentModel(el, value, modifiers);
|
6229 |
-
// component v-model doesn't need extra runtime
|
6230 |
-
return false
|
6231 |
-
} else if (tag === 'select') {
|
6232 |
-
genSelect(el, value, modifiers);
|
6233 |
-
} else if (tag === 'input' && type === 'checkbox') {
|
6234 |
-
genCheckboxModel(el, value, modifiers);
|
6235 |
-
} else if (tag === 'input' && type === 'radio') {
|
6236 |
-
genRadioModel(el, value, modifiers);
|
6237 |
-
} else if (tag === 'input' || tag === 'textarea') {
|
6238 |
-
genDefaultModel(el, value, modifiers);
|
6239 |
-
} else if (!config.isReservedTag(tag)) {
|
6240 |
-
genComponentModel(el, value, modifiers);
|
6241 |
-
// component v-model doesn't need extra runtime
|
6242 |
-
return false
|
6243 |
-
} else {
|
6244 |
-
warn$1(
|
6245 |
-
"<" + (el.tag) + " v-model=\"" + value + "\">: " +
|
6246 |
-
"v-model is not supported on this element type. " +
|
6247 |
-
'If you are working with contenteditable, it\'s recommended to ' +
|
6248 |
-
'wrap a library dedicated for that purpose inside a custom component.'
|
6249 |
-
);
|
6250 |
-
}
|
6251 |
-
|
6252 |
-
// ensure runtime directive metadata
|
6253 |
-
return true
|
6254 |
-
}
|
6255 |
-
|
6256 |
-
function genCheckboxModel (
|
6257 |
-
el,
|
6258 |
-
value,
|
6259 |
-
modifiers
|
6260 |
-
) {
|
6261 |
-
var number = modifiers && modifiers.number;
|
6262 |
-
var valueBinding = getBindingAttr(el, 'value') || 'null';
|
6263 |
-
var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
|
6264 |
-
var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
|
6265 |
-
addProp(el, 'checked',
|
6266 |
-
"Array.isArray(" + value + ")" +
|
6267 |
-
"?_i(" + value + "," + valueBinding + ")>-1" + (
|
6268 |
-
trueValueBinding === 'true'
|
6269 |
-
? (":(" + value + ")")
|
6270 |
-
: (":_q(" + value + "," + trueValueBinding + ")")
|
6271 |
-
)
|
6272 |
-
);
|
6273 |
-
addHandler(el, CHECKBOX_RADIO_TOKEN,
|
6274 |
-
"var $$a=" + value + "," +
|
6275 |
-
'$$el=$event.target,' +
|
6276 |
-
"$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
|
6277 |
-
'if(Array.isArray($$a)){' +
|
6278 |
-
"var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
|
6279 |
-
'$$i=_i($$a,$$v);' +
|
6280 |
-
"if($$c){$$i<0&&(" + value + "=$$a.concat($$v))}" +
|
6281 |
-
"else{$$i>-1&&(" + value + "=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}" +
|
6282 |
-
"}else{" + (genAssignmentCode(value, '$$c')) + "}",
|
6283 |
-
null, true
|
6284 |
-
);
|
6285 |
-
}
|
6286 |
-
|
6287 |
-
function genRadioModel (
|
6288 |
-
el,
|
6289 |
-
value,
|
6290 |
-
modifiers
|
6291 |
-
) {
|
6292 |
-
var number = modifiers && modifiers.number;
|
6293 |
-
var valueBinding = getBindingAttr(el, 'value') || 'null';
|
6294 |
-
valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
|
6295 |
-
addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
|
6296 |
-
addHandler(el, CHECKBOX_RADIO_TOKEN, genAssignmentCode(value, valueBinding), null, true);
|
6297 |
-
}
|
6298 |
-
|
6299 |
-
function genSelect (
|
6300 |
-
el,
|
6301 |
-
value,
|
6302 |
-
modifiers
|
6303 |
-
) {
|
6304 |
-
var number = modifiers && modifiers.number;
|
6305 |
-
var selectedVal = "Array.prototype.filter" +
|
6306 |
-
".call($event.target.options,function(o){return o.selected})" +
|
6307 |
-
".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
|
6308 |
-
"return " + (number ? '_n(val)' : 'val') + "})";
|
6309 |
-
|
6310 |
-
var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
|
6311 |
-
var code = "var $$selectedVal = " + selectedVal + ";";
|
6312 |
-
code = code + " " + (genAssignmentCode(value, assignment));
|
6313 |
-
addHandler(el, 'change', code, null, true);
|
6314 |
-
}
|
6315 |
-
|
6316 |
-
function genDefaultModel (
|
6317 |
-
el,
|
6318 |
-
value,
|
6319 |
-
modifiers
|
6320 |
-
) {
|
6321 |
-
var type = el.attrsMap.type;
|
6322 |
-
var ref = modifiers || {};
|
6323 |
-
var lazy = ref.lazy;
|
6324 |
-
var number = ref.number;
|
6325 |
-
var trim = ref.trim;
|
6326 |
-
var needCompositionGuard = !lazy && type !== 'range';
|
6327 |
-
var event = lazy
|
6328 |
-
? 'change'
|
6329 |
-
: type === 'range'
|
6330 |
-
? RANGE_TOKEN
|
6331 |
-
: 'input';
|
6332 |
-
|
6333 |
-
var valueExpression = '$event.target.value';
|
6334 |
-
if (trim) {
|
6335 |
-
valueExpression = "$event.target.value.trim()";
|
6336 |
-
}
|
6337 |
-
if (number) {
|
6338 |
-
valueExpression = "_n(" + valueExpression + ")";
|
6339 |
-
}
|
6340 |
-
|
6341 |
-
var code = genAssignmentCode(value, valueExpression);
|
6342 |
-
if (needCompositionGuard) {
|
6343 |
-
code = "if($event.target.composing)return;" + code;
|
6344 |
-
}
|
6345 |
-
|
6346 |
-
addProp(el, 'value', ("(" + value + ")"));
|
6347 |
-
addHandler(el, event, code, null, true);
|
6348 |
-
if (trim || number) {
|
6349 |
-
addHandler(el, 'blur', '$forceUpdate()');
|
6350 |
-
}
|
6351 |
-
}
|
6352 |
-
|
6353 |
-
/* */
|
6354 |
-
|
6355 |
-
// normalize v-model event tokens that can only be determined at runtime.
|
6356 |
-
// it's important to place the event as the first in the array because
|
6357 |
-
// the whole point is ensuring the v-model callback gets called before
|
6358 |
-
// user-attached handlers.
|
6359 |
-
function normalizeEvents (on) {
|
6360 |
-
var event;
|
6361 |
-
/* istanbul ignore if */
|
6362 |
-
if (isDef(on[RANGE_TOKEN])) {
|
6363 |
-
// IE input[type=range] only supports `change` event
|
6364 |
-
event = isIE ? 'change' : 'input';
|
6365 |
-
on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
|
6366 |
-
delete on[RANGE_TOKEN];
|
6367 |
-
}
|
6368 |
-
if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
|
6369 |
-
// Chrome fires microtasks in between click/change, leads to #4521
|
6370 |
-
event = isChrome ? 'click' : 'change';
|
6371 |
-
on[event] = [].concat(on[CHECKBOX_RADIO_TOKEN], on[event] || []);
|
6372 |
-
delete on[CHECKBOX_RADIO_TOKEN];
|
6373 |
-
}
|
6374 |
-
}
|
6375 |
-
|
6376 |
-
var target$1;
|
6377 |
-
|
6378 |
-
function add$1 (
|
6379 |
-
event,
|
6380 |
-
handler,
|
6381 |
-
once$$1,
|
6382 |
-
capture,
|
6383 |
-
passive
|
6384 |
-
) {
|
6385 |
-
if (once$$1) {
|
6386 |
-
var oldHandler = handler;
|
6387 |
-
var _target = target$1; // save current target element in closure
|
6388 |
-
handler = function (ev) {
|
6389 |
-
var res = arguments.length === 1
|
6390 |
-
? oldHandler(ev)
|
6391 |
-
: oldHandler.apply(null, arguments);
|
6392 |
-
if (res !== null) {
|
6393 |
-
remove$2(event, handler, capture, _target);
|
6394 |
-
}
|
6395 |
-
};
|
6396 |
-
}
|
6397 |
-
target$1.addEventListener(
|
6398 |
-
event,
|
6399 |
-
handler,
|
6400 |
-
supportsPassive
|
6401 |
-
? { capture: capture, passive: passive }
|
6402 |
-
: capture
|
6403 |
-
);
|
6404 |
-
}
|
6405 |
-
|
6406 |
-
function remove$2 (
|
6407 |
-
event,
|
6408 |
-
handler,
|
6409 |
-
capture,
|
6410 |
-
_target
|
6411 |
-
) {
|
6412 |
-
(_target || target$1).removeEventListener(event, handler, capture);
|
6413 |
-
}
|
6414 |
-
|
6415 |
-
function updateDOMListeners (oldVnode, vnode) {
|
6416 |
-
var isComponentRoot = isDef(vnode.componentOptions);
|
6417 |
-
var oldOn = isComponentRoot ? oldVnode.data.nativeOn : oldVnode.data.on;
|
6418 |
-
var on = isComponentRoot ? vnode.data.nativeOn : vnode.data.on;
|
6419 |
-
if (isUndef(oldOn) && isUndef(on)) {
|
6420 |
-
return
|
6421 |
-
}
|
6422 |
-
on = on || {};
|
6423 |
-
oldOn = oldOn || {};
|
6424 |
-
target$1 = vnode.elm;
|
6425 |
-
normalizeEvents(on);
|
6426 |
-
updateListeners(on, oldOn, add$1, remove$2, vnode.context);
|
6427 |
-
}
|
6428 |
-
|
6429 |
-
var events = {
|
6430 |
-
create: updateDOMListeners,
|
6431 |
-
update: updateDOMListeners
|
6432 |
-
};
|
6433 |
-
|
6434 |
-
/* */
|
6435 |
-
|
6436 |
-
function updateDOMProps (oldVnode, vnode) {
|
6437 |
-
if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
|
6438 |
-
return
|
6439 |
-
}
|
6440 |
-
var key, cur;
|
6441 |
-
var elm = vnode.elm;
|
6442 |
-
var oldProps = oldVnode.data.domProps || {};
|
6443 |
-
var props = vnode.data.domProps || {};
|
6444 |
-
// clone observed objects, as the user probably wants to mutate it
|
6445 |
-
if (isDef(props.__ob__)) {
|
6446 |
-
props = vnode.data.domProps = extend({}, props);
|
6447 |
-
}
|
6448 |
-
|
6449 |
-
for (key in oldProps) {
|
6450 |
-
if (isUndef(props[key])) {
|
6451 |
-
elm[key] = '';
|
6452 |
-
}
|
6453 |
-
}
|
6454 |
-
for (key in props) {
|
6455 |
-
cur = props[key];
|
6456 |
-
// ignore children if the node has textContent or innerHTML,
|
6457 |
-
// as these will throw away existing DOM nodes and cause removal errors
|
6458 |
-
// on subsequent patches (#3360)
|
6459 |
-
if (key === 'textContent' || key === 'innerHTML') {
|
6460 |
-
if (vnode.children) { vnode.children.length = 0; }
|
6461 |
-
if (cur === oldProps[key]) { continue }
|
6462 |
-
}
|
6463 |
-
|
6464 |
-
if (key === 'value') {
|
6465 |
-
// store value as _value as well since
|
6466 |
-
// non-string values will be stringified
|
6467 |
-
elm._value = cur;
|
6468 |
-
// avoid resetting cursor position when value is the same
|
6469 |
-
var strCur = isUndef(cur) ? '' : String(cur);
|
6470 |
-
if (shouldUpdateValue(elm, vnode, strCur)) {
|
6471 |
-
elm.value = strCur;
|
6472 |
-
}
|
6473 |
-
} else {
|
6474 |
-
elm[key] = cur;
|
6475 |
-
}
|
6476 |
-
}
|
6477 |
-
}
|
6478 |
-
|
6479 |
-
// check platforms/web/util/attrs.js acceptValue
|
6480 |
-
|
6481 |
-
|
6482 |
-
function shouldUpdateValue (
|
6483 |
-
elm,
|
6484 |
-
vnode,
|
6485 |
-
checkVal
|
6486 |
-
) {
|
6487 |
-
return (!elm.composing && (
|
6488 |
-
vnode.tag === 'option' ||
|
6489 |
-
isDirty(elm, checkVal) ||
|
6490 |
-
isInputChanged(elm, checkVal)
|
6491 |
-
))
|
6492 |
-
}
|
6493 |
-
|
6494 |
-
function isDirty (elm, checkVal) {
|
6495 |
-
// return true when textbox (.number and .trim) loses focus and its value is
|
6496 |
-
// not equal to the updated value
|
6497 |
-
return document.activeElement !== elm && elm.value !== checkVal
|
6498 |
-
}
|
6499 |
-
|
6500 |
-
function isInputChanged (elm, newVal) {
|
6501 |
-
var value = elm.value;
|
6502 |
-
var modifiers = elm._vModifiers; // injected by v-model runtime
|
6503 |
-
if (isDef(modifiers) && modifiers.number) {
|
6504 |
-
return toNumber(value) !== toNumber(newVal)
|
6505 |
-
}
|
6506 |
-
if (isDef(modifiers) && modifiers.trim) {
|
6507 |
-
return value.trim() !== newVal.trim()
|
6508 |
-
}
|
6509 |
-
return value !== newVal
|
6510 |
-
}
|
6511 |
-
|
6512 |
-
var domProps = {
|
6513 |
-
create: updateDOMProps,
|
6514 |
-
update: updateDOMProps
|
6515 |
-
};
|
6516 |
-
|
6517 |
-
/* */
|
6518 |
-
|
6519 |
-
var parseStyleText = cached(function (cssText) {
|
6520 |
-
var res = {};
|
6521 |
-
var listDelimiter = /;(?![^(]*\))/g;
|
6522 |
-
var propertyDelimiter = /:(.+)/;
|
6523 |
-
cssText.split(listDelimiter).forEach(function (item) {
|
6524 |
-
if (item) {
|
6525 |
-
var tmp = item.split(propertyDelimiter);
|
6526 |
-
tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
|
6527 |
-
}
|
6528 |
-
});
|
6529 |
-
return res
|
6530 |
-
});
|
6531 |
-
|
6532 |
-
// merge static and dynamic style data on the same vnode
|
6533 |
-
function normalizeStyleData (data) {
|
6534 |
-
var style = normalizeStyleBinding(data.style);
|
6535 |
-
// static style is pre-processed into an object during compilation
|
6536 |
-
// and is always a fresh object, so it's safe to merge into it
|
6537 |
-
return data.staticStyle
|
6538 |
-
? extend(data.staticStyle, style)
|
6539 |
-
: style
|
6540 |
-
}
|
6541 |
-
|
6542 |
-
// normalize possible array / string values into Object
|
6543 |
-
function normalizeStyleBinding (bindingStyle) {
|
6544 |
-
if (Array.isArray(bindingStyle)) {
|
6545 |
-
return toObject(bindingStyle)
|
6546 |
-
}
|
6547 |
-
if (typeof bindingStyle === 'string') {
|
6548 |
-
return parseStyleText(bindingStyle)
|
6549 |
-
}
|
6550 |
-
return bindingStyle
|
6551 |
-
}
|
6552 |
-
|
6553 |
-
/**
|
6554 |
-
* parent component style should be after child's
|
6555 |
-
* so that parent component's style could override it
|
6556 |
-
*/
|
6557 |
-
function getStyle (vnode, checkChild) {
|
6558 |
-
var res = {};
|
6559 |
-
var styleData;
|
6560 |
-
|
6561 |
-
if (checkChild) {
|
6562 |
-
var childNode = vnode;
|
6563 |
-
while (childNode.componentInstance) {
|
6564 |
-
childNode = childNode.componentInstance._vnode;
|
6565 |
-
if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {
|
6566 |
-
extend(res, styleData);
|
6567 |
-
}
|
6568 |
-
}
|
6569 |
-
}
|
6570 |
-
|
6571 |
-
if ((styleData = normalizeStyleData(vnode.data))) {
|
6572 |
-
extend(res, styleData);
|
6573 |
-
}
|
6574 |
-
|
6575 |
-
var parentNode = vnode;
|
6576 |
-
while ((parentNode = parentNode.parent)) {
|
6577 |
-
if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
|
6578 |
-
extend(res, styleData);
|
6579 |
-
}
|
6580 |
-
}
|
6581 |
-
return res
|
6582 |
-
}
|
6583 |
-
|
6584 |
-
/* */
|
6585 |
-
|
6586 |
-
var cssVarRE = /^--/;
|
6587 |
-
var importantRE = /\s*!important$/;
|
6588 |
-
var setProp = function (el, name, val) {
|
6589 |
-
/* istanbul ignore if */
|
6590 |
-
if (cssVarRE.test(name)) {
|
6591 |
-
el.style.setProperty(name, val);
|
6592 |
-
} else if (importantRE.test(val)) {
|
6593 |
-
el.style.setProperty(name, val.replace(importantRE, ''), 'important');
|
6594 |
-
} else {
|
6595 |
-
var normalizedName = normalize(name);
|
6596 |
-
if (Array.isArray(val)) {
|
6597 |
-
// Support values array created by autoprefixer, e.g.
|
6598 |
-
// {display: ["-webkit-box", "-ms-flexbox", "flex"]}
|
6599 |
-
// Set them one by one, and the browser will only set those it can recognize
|
6600 |
-
for (var i = 0, len = val.length; i < len; i++) {
|
6601 |
-
el.style[normalizedName] = val[i];
|
6602 |
-
}
|
6603 |
-
} else {
|
6604 |
-
el.style[normalizedName] = val;
|
6605 |
-
}
|
6606 |
-
}
|
6607 |
-
};
|
6608 |
-
|
6609 |
-
var vendorNames = ['Webkit', 'Moz', 'ms'];
|
6610 |
-
|
6611 |
-
var emptyStyle;
|
6612 |
-
var normalize = cached(function (prop) {
|
6613 |
-
emptyStyle = emptyStyle || document.createElement('div').style;
|
6614 |
-
prop = camelize(prop);
|
6615 |
-
if (prop !== 'filter' && (prop in emptyStyle)) {
|
6616 |
-
return prop
|
6617 |
-
}
|
6618 |
-
var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
|
6619 |
-
for (var i = 0; i < vendorNames.length; i++) {
|
6620 |
-
var name = vendorNames[i] + capName;
|
6621 |
-
if (name in emptyStyle) {
|
6622 |
-
return name
|
6623 |
-
}
|
6624 |
-
}
|
6625 |
-
});
|
6626 |
-
|
6627 |
-
function updateStyle (oldVnode, vnode) {
|
6628 |
-
var data = vnode.data;
|
6629 |
-
var oldData = oldVnode.data;
|
6630 |
-
|
6631 |
-
if (isUndef(data.staticStyle) && isUndef(data.style) &&
|
6632 |
-
isUndef(oldData.staticStyle) && isUndef(oldData.style)
|
6633 |
-
) {
|
6634 |
-
return
|
6635 |
-
}
|
6636 |
-
|
6637 |
-
var cur, name;
|
6638 |
-
var el = vnode.elm;
|
6639 |
-
var oldStaticStyle = oldData.staticStyle;
|
6640 |
-
var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
|
6641 |
-
|
6642 |
-
// if static style exists, stylebinding already merged into it when doing normalizeStyleData
|
6643 |
-
var oldStyle = oldStaticStyle || oldStyleBinding;
|
6644 |
-
|
6645 |
-
var style = normalizeStyleBinding(vnode.data.style) || {};
|
6646 |
-
|
6647 |
-
// store normalized style under a different key for next diff
|
6648 |
-
// make sure to clone it if it's reactive, since the user likley wants
|
6649 |
-
// to mutate it.
|
6650 |
-
vnode.data.normalizedStyle = isDef(style.__ob__)
|
6651 |
-
? extend({}, style)
|
6652 |
-
: style;
|
6653 |
-
|
6654 |
-
var newStyle = getStyle(vnode, true);
|
6655 |
-
|
6656 |
-
for (name in oldStyle) {
|
6657 |
-
if (isUndef(newStyle[name])) {
|
6658 |
-
setProp(el, name, '');
|
6659 |
-
}
|
6660 |
-
}
|
6661 |
-
for (name in newStyle) {
|
6662 |
-
cur = newStyle[name];
|
6663 |
-
if (cur !== oldStyle[name]) {
|
6664 |
-
// ie9 setting to null has no effect, must use empty string
|
6665 |
-
setProp(el, name, cur == null ? '' : cur);
|
6666 |
-
}
|
6667 |
-
}
|
6668 |
-
}
|
6669 |
-
|
6670 |
-
var style = {
|
6671 |
-
create: updateStyle,
|
6672 |
-
update: updateStyle
|
6673 |
-
};
|
6674 |
-
|
6675 |
-
/* */
|
6676 |
-
|
6677 |
-
/**
|
6678 |
-
* Add class with compatibility for SVG since classList is not supported on
|
6679 |
-
* SVG elements in IE
|
6680 |
-
*/
|
6681 |
-
function addClass (el, cls) {
|
6682 |
-
/* istanbul ignore if */
|
6683 |
-
if (!cls || !(cls = cls.trim())) {
|
6684 |
-
return
|
6685 |
-
}
|
6686 |
-
|
6687 |
-
/* istanbul ignore else */
|
6688 |
-
if (el.classList) {
|
6689 |
-
if (cls.indexOf(' ') > -1) {
|
6690 |
-
cls.split(/\s+/).forEach(function (c) { return el.classList.add(c); });
|
6691 |
-
} else {
|
6692 |
-
el.classList.add(cls);
|
6693 |
}
|
6694 |
-
} else {
|
6695 |
-
var cur = " " + (el.getAttribute('class') || '') + " ";
|
6696 |
-
if (cur.indexOf(' ' + cls + ' ') < 0) {
|
6697 |
-
el.setAttribute('class', (cur + cls).trim());
|
6698 |
-
}
|
6699 |
-
}
|
6700 |
-
}
|
6701 |
|
6702 |
-
|
6703 |
-
|
6704 |
-
* SVG elements in IE
|
6705 |
-
*/
|
6706 |
-
function removeClass (el, cls) {
|
6707 |
-
/* istanbul ignore if */
|
6708 |
-
if (!cls || !(cls = cls.trim())) {
|
6709 |
-
return
|
6710 |
-
}
|
6711 |
-
|
6712 |
-
/* istanbul ignore else */
|
6713 |
-
if (el.classList) {
|
6714 |
-
if (cls.indexOf(' ') > -1) {
|
6715 |
-
cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); });
|
6716 |
-
} else {
|
6717 |
-
el.classList.remove(cls);
|
6718 |
-
}
|
6719 |
-
if (!el.classList.length) {
|
6720 |
-
el.removeAttribute('class');
|
6721 |
-
}
|
6722 |
-
} else {
|
6723 |
-
var cur = " " + (el.getAttribute('class') || '') + " ";
|
6724 |
-
var tar = ' ' + cls + ' ';
|
6725 |
-
while (cur.indexOf(tar) >= 0) {
|
6726 |
-
cur = cur.replace(tar, ' ');
|
6727 |
}
|
6728 |
-
cur = cur.trim();
|
6729 |
-
if (cur) {
|
6730 |
-
el.setAttribute('class', cur);
|
6731 |
-
} else {
|
6732 |
-
el.removeAttribute('class');
|
6733 |
-
}
|
6734 |
-
}
|
6735 |
-
}
|
6736 |
-
|
6737 |
-
/* */
|
6738 |
-
|
6739 |
-
function resolveTransition (def$$1) {
|
6740 |
-
if (!def$$1) {
|
6741 |
-
return
|
6742 |
-
}
|
6743 |
-
/* istanbul ignore else */
|
6744 |
-
if (typeof def$$1 === 'object') {
|
6745 |
-
var res = {};
|
6746 |
-
if (def$$1.css !== false) {
|
6747 |
-
extend(res, autoCssTransition(def$$1.name || 'v'));
|
6748 |
-
}
|
6749 |
-
extend(res, def$$1);
|
6750 |
-
return res
|
6751 |
-
} else if (typeof def$$1 === 'string') {
|
6752 |
-
return autoCssTransition(def$$1)
|
6753 |
-
}
|
6754 |
-
}
|
6755 |
-
|
6756 |
-
var autoCssTransition = cached(function (name) {
|
6757 |
-
return {
|
6758 |
-
enterClass: (name + "-enter"),
|
6759 |
-
enterToClass: (name + "-enter-to"),
|
6760 |
-
enterActiveClass: (name + "-enter-active"),
|
6761 |
-
leaveClass: (name + "-leave"),
|
6762 |
-
leaveToClass: (name + "-leave-to"),
|
6763 |
-
leaveActiveClass: (name + "-leave-active")
|
6764 |
-
}
|
6765 |
-
});
|
6766 |
-
|
6767 |
-
var hasTransition = inBrowser && !isIE9;
|
6768 |
-
var TRANSITION = 'transition';
|
6769 |
-
var ANIMATION = 'animation';
|
6770 |
-
|
6771 |
-
// Transition property/event sniffing
|
6772 |
-
var transitionProp = 'transition';
|
6773 |
-
var transitionEndEvent = 'transitionend';
|
6774 |
-
var animationProp = 'animation';
|
6775 |
-
var animationEndEvent = 'animationend';
|
6776 |
-
if (hasTransition) {
|
6777 |
-
/* istanbul ignore if */
|
6778 |
-
if (window.ontransitionend === undefined &&
|
6779 |
-
window.onwebkittransitionend !== undefined
|
6780 |
-
) {
|
6781 |
-
transitionProp = 'WebkitTransition';
|
6782 |
-
transitionEndEvent = 'webkitTransitionEnd';
|
6783 |
-
}
|
6784 |
-
if (window.onanimationend === undefined &&
|
6785 |
-
window.onwebkitanimationend !== undefined
|
6786 |
-
) {
|
6787 |
-
animationProp = 'WebkitAnimation';
|
6788 |
-
animationEndEvent = 'webkitAnimationEnd';
|
6789 |
-
}
|
6790 |
-
}
|
6791 |
-
|
6792 |
-
// binding to window is necessary to make hot reload work in IE in strict mode
|
6793 |
-
var raf = inBrowser && window.requestAnimationFrame
|
6794 |
-
? window.requestAnimationFrame.bind(window)
|
6795 |
-
: setTimeout;
|
6796 |
-
|
6797 |
-
function nextFrame (fn) {
|
6798 |
-
raf(function () {
|
6799 |
-
raf(fn);
|
6800 |
-
});
|
6801 |
-
}
|
6802 |
-
|
6803 |
-
function addTransitionClass (el, cls) {
|
6804 |
-
var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
|
6805 |
-
if (transitionClasses.indexOf(cls) < 0) {
|
6806 |
-
transitionClasses.push(cls);
|
6807 |
-
addClass(el, cls);
|
6808 |
-
}
|
6809 |
-
}
|
6810 |
-
|
6811 |
-
function removeTransitionClass (el, cls) {
|
6812 |
-
if (el._transitionClasses) {
|
6813 |
-
remove(el._transitionClasses, cls);
|
6814 |
-
}
|
6815 |
-
removeClass(el, cls);
|
6816 |
-
}
|
6817 |
-
|
6818 |
-
function whenTransitionEnds (
|
6819 |
-
el,
|
6820 |
-
expectedType,
|
6821 |
-
cb
|
6822 |
-
) {
|
6823 |
-
var ref = getTransitionInfo(el, expectedType);
|
6824 |
-
var type = ref.type;
|
6825 |
-
var timeout = ref.timeout;
|
6826 |
-
var propCount = ref.propCount;
|
6827 |
-
if (!type) { return cb() }
|
6828 |
-
var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
|
6829 |
-
var ended = 0;
|
6830 |
-
var end = function () {
|
6831 |
-
el.removeEventListener(event, onEnd);
|
6832 |
-
cb();
|
6833 |
-
};
|
6834 |
-
var onEnd = function (e) {
|
6835 |
-
if (e.target === el) {
|
6836 |
-
if (++ended >= propCount) {
|
6837 |
-
end();
|
6838 |
-
}
|
6839 |
-
}
|
6840 |
-
};
|
6841 |
-
setTimeout(function () {
|
6842 |
-
if (ended < propCount) {
|
6843 |
-
end();
|
6844 |
-
}
|
6845 |
-
}, timeout + 1);
|
6846 |
-
el.addEventListener(event, onEnd);
|
6847 |
-
}
|
6848 |
-
|
6849 |
-
var transformRE = /\b(transform|all)(,|$)/;
|
6850 |
-
|
6851 |
-
function getTransitionInfo (el, expectedType) {
|
6852 |
-
var styles = window.getComputedStyle(el);
|
6853 |
-
var transitionDelays = styles[transitionProp + 'Delay'].split(', ');
|
6854 |
-
var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
|
6855 |
-
var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
|
6856 |
-
var animationDelays = styles[animationProp + 'Delay'].split(', ');
|
6857 |
-
var animationDurations = styles[animationProp + 'Duration'].split(', ');
|
6858 |
-
var animationTimeout = getTimeout(animationDelays, animationDurations);
|
6859 |
-
|
6860 |
-
var type;
|
6861 |
-
var timeout = 0;
|
6862 |
-
var propCount = 0;
|
6863 |
-
/* istanbul ignore if */
|
6864 |
-
if (expectedType === TRANSITION) {
|
6865 |
-
if (transitionTimeout > 0) {
|
6866 |
-
type = TRANSITION;
|
6867 |
-
timeout = transitionTimeout;
|
6868 |
-
propCount = transitionDurations.length;
|
6869 |
-
}
|
6870 |
-
} else if (expectedType === ANIMATION) {
|
6871 |
-
if (animationTimeout > 0) {
|
6872 |
-
type = ANIMATION;
|
6873 |
-
timeout = animationTimeout;
|
6874 |
-
propCount = animationDurations.length;
|
6875 |
-
}
|
6876 |
-
} else {
|
6877 |
-
timeout = Math.max(transitionTimeout, animationTimeout);
|
6878 |
-
type = timeout > 0
|
6879 |
-
? transitionTimeout > animationTimeout
|
6880 |
-
? TRANSITION
|
6881 |
-
: ANIMATION
|
6882 |
-
: null;
|
6883 |
-
propCount = type
|
6884 |
-
? type === TRANSITION
|
6885 |
-
? transitionDurations.length
|
6886 |
-
: animationDurations.length
|
6887 |
-
: 0;
|
6888 |
-
}
|
6889 |
-
var hasTransform =
|
6890 |
-
type === TRANSITION &&
|
6891 |
-
transformRE.test(styles[transitionProp + 'Property']);
|
6892 |
-
return {
|
6893 |
-
type: type,
|
6894 |
-
timeout: timeout,
|
6895 |
-
propCount: propCount,
|
6896 |
-
hasTransform: hasTransform
|
6897 |
-
}
|
6898 |
-
}
|
6899 |
-
|
6900 |
-
function getTimeout (delays, durations) {
|
6901 |
-
/* istanbul ignore next */
|
6902 |
-
while (delays.length < durations.length) {
|
6903 |
-
delays = delays.concat(delays);
|
6904 |
-
}
|
6905 |
-
|
6906 |
-
return Math.max.apply(null, durations.map(function (d, i) {
|
6907 |
-
return toMs(d) + toMs(delays[i])
|
6908 |
-
}))
|
6909 |
-
}
|
6910 |
-
|
6911 |
-
function toMs (s) {
|
6912 |
-
return Number(s.slice(0, -1)) * 1000
|
6913 |
-
}
|
6914 |
-
|
6915 |
-
/* */
|
6916 |
-
|
6917 |
-
function enter (vnode, toggleDisplay) {
|
6918 |
-
var el = vnode.elm;
|
6919 |
|
6920 |
-
|
6921 |
-
|
6922 |
-
|
6923 |
-
|
6924 |
-
|
6925 |
-
|
6926 |
-
|
6927 |
-
|
6928 |
-
|
6929 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6930 |
|
6931 |
-
|
6932 |
-
|
6933 |
-
|
6934 |
-
|
6935 |
-
|
6936 |
-
|
6937 |
-
|
6938 |
-
|
6939 |
-
|
6940 |
-
|
6941 |
-
|
6942 |
-
|
6943 |
-
|
6944 |
-
|
6945 |
-
|
6946 |
-
|
6947 |
-
|
6948 |
-
|
6949 |
-
|
6950 |
-
|
6951 |
-
|
6952 |
-
|
6953 |
-
|
6954 |
-
|
6955 |
-
|
6956 |
-
// as the root node of a child component. In that case we need to check
|
6957 |
-
// <transition>'s parent for appear check.
|
6958 |
-
var context = activeInstance;
|
6959 |
-
var transitionNode = activeInstance.$vnode;
|
6960 |
-
while (transitionNode && transitionNode.parent) {
|
6961 |
-
transitionNode = transitionNode.parent;
|
6962 |
-
context = transitionNode.context;
|
6963 |
-
}
|
6964 |
-
|
6965 |
-
var isAppear = !context._isMounted || !vnode.isRootInsert;
|
6966 |
-
|
6967 |
-
if (isAppear && !appear && appear !== '') {
|
6968 |
-
return
|
6969 |
-
}
|
6970 |
-
|
6971 |
-
var startClass = isAppear && appearClass
|
6972 |
-
? appearClass
|
6973 |
-
: enterClass;
|
6974 |
-
var activeClass = isAppear && appearActiveClass
|
6975 |
-
? appearActiveClass
|
6976 |
-
: enterActiveClass;
|
6977 |
-
var toClass = isAppear && appearToClass
|
6978 |
-
? appearToClass
|
6979 |
-
: enterToClass;
|
6980 |
-
|
6981 |
-
var beforeEnterHook = isAppear
|
6982 |
-
? (beforeAppear || beforeEnter)
|
6983 |
-
: beforeEnter;
|
6984 |
-
var enterHook = isAppear
|
6985 |
-
? (typeof appear === 'function' ? appear : enter)
|
6986 |
-
: enter;
|
6987 |
-
var afterEnterHook = isAppear
|
6988 |
-
? (afterAppear || afterEnter)
|
6989 |
-
: afterEnter;
|
6990 |
-
var enterCancelledHook = isAppear
|
6991 |
-
? (appearCancelled || enterCancelled)
|
6992 |
-
: enterCancelled;
|
6993 |
-
|
6994 |
-
var explicitEnterDuration = toNumber(
|
6995 |
-
isObject(duration)
|
6996 |
-
? duration.enter
|
6997 |
-
: duration
|
6998 |
-
);
|
6999 |
-
|
7000 |
-
if ("development" !== 'production' && explicitEnterDuration != null) {
|
7001 |
-
checkDuration(explicitEnterDuration, 'enter', vnode);
|
7002 |
-
}
|
7003 |
-
|
7004 |
-
var expectsCSS = css !== false && !isIE9;
|
7005 |
-
var userWantsControl = getHookArgumentsLength(enterHook);
|
7006 |
-
|
7007 |
-
var cb = el._enterCb = once(function () {
|
7008 |
-
if (expectsCSS) {
|
7009 |
-
removeTransitionClass(el, toClass);
|
7010 |
-
removeTransitionClass(el, activeClass);
|
7011 |
-
}
|
7012 |
-
if (cb.cancelled) {
|
7013 |
-
if (expectsCSS) {
|
7014 |
-
removeTransitionClass(el, startClass);
|
7015 |
-
}
|
7016 |
-
enterCancelledHook && enterCancelledHook(el);
|
7017 |
-
} else {
|
7018 |
-
afterEnterHook && afterEnterHook(el);
|
7019 |
-
}
|
7020 |
-
el._enterCb = null;
|
7021 |
-
});
|
7022 |
-
|
7023 |
-
if (!vnode.data.show) {
|
7024 |
-
// remove pending leave element on enter by injecting an insert hook
|
7025 |
-
mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {
|
7026 |
-
var parent = el.parentNode;
|
7027 |
-
var pendingNode = parent && parent._pending && parent._pending[vnode.key];
|
7028 |
-
if (pendingNode &&
|
7029 |
-
pendingNode.tag === vnode.tag &&
|
7030 |
-
pendingNode.elm._leaveCb
|
7031 |
-
) {
|
7032 |
-
pendingNode.elm._leaveCb();
|
7033 |
-
}
|
7034 |
-
enterHook && enterHook(el, cb);
|
7035 |
-
});
|
7036 |
-
}
|
7037 |
-
|
7038 |
-
// start enter transition
|
7039 |
-
beforeEnterHook && beforeEnterHook(el);
|
7040 |
-
if (expectsCSS) {
|
7041 |
-
addTransitionClass(el, startClass);
|
7042 |
-
addTransitionClass(el, activeClass);
|
7043 |
-
nextFrame(function () {
|
7044 |
-
addTransitionClass(el, toClass);
|
7045 |
-
removeTransitionClass(el, startClass);
|
7046 |
-
if (!cb.cancelled && !userWantsControl) {
|
7047 |
-
if (isValidDuration(explicitEnterDuration)) {
|
7048 |
-
setTimeout(cb, explicitEnterDuration);
|
7049 |
} else {
|
7050 |
-
|
7051 |
}
|
7052 |
-
}
|
7053 |
-
});
|
7054 |
-
}
|
7055 |
-
|
7056 |
-
if (vnode.data.show) {
|
7057 |
-
toggleDisplay && toggleDisplay();
|
7058 |
-
enterHook && enterHook(el, cb);
|
7059 |
-
}
|
7060 |
-
|
7061 |
-
if (!expectsCSS && !userWantsControl) {
|
7062 |
-
cb();
|
7063 |
-
}
|
7064 |
-
}
|
7065 |
-
|
7066 |
-
function leave (vnode, rm) {
|
7067 |
-
var el = vnode.elm;
|
7068 |
-
|
7069 |
-
// call enter callback now
|
7070 |
-
if (isDef(el._enterCb)) {
|
7071 |
-
el._enterCb.cancelled = true;
|
7072 |
-
el._enterCb();
|
7073 |
-
}
|
7074 |
-
|
7075 |
-
var data = resolveTransition(vnode.data.transition);
|
7076 |
-
if (isUndef(data)) {
|
7077 |
-
return rm()
|
7078 |
-
}
|
7079 |
-
|
7080 |
-
/* istanbul ignore if */
|
7081 |
-
if (isDef(el._leaveCb) || el.nodeType !== 1) {
|
7082 |
-
return
|
7083 |
-
}
|
7084 |
-
|
7085 |
-
var css = data.css;
|
7086 |
-
var type = data.type;
|
7087 |
-
var leaveClass = data.leaveClass;
|
7088 |
-
var leaveToClass = data.leaveToClass;
|
7089 |
-
var leaveActiveClass = data.leaveActiveClass;
|
7090 |
-
var beforeLeave = data.beforeLeave;
|
7091 |
-
var leave = data.leave;
|
7092 |
-
var afterLeave = data.afterLeave;
|
7093 |
-
var leaveCancelled = data.leaveCancelled;
|
7094 |
-
var delayLeave = data.delayLeave;
|
7095 |
-
var duration = data.duration;
|
7096 |
-
|
7097 |
-
var expectsCSS = css !== false && !isIE9;
|
7098 |
-
var userWantsControl = getHookArgumentsLength(leave);
|
7099 |
-
|
7100 |
-
var explicitLeaveDuration = toNumber(
|
7101 |
-
isObject(duration)
|
7102 |
-
? duration.leave
|
7103 |
-
: duration
|
7104 |
-
);
|
7105 |
-
|
7106 |
-
if ("development" !== 'production' && isDef(explicitLeaveDuration)) {
|
7107 |
-
checkDuration(explicitLeaveDuration, 'leave', vnode);
|
7108 |
-
}
|
7109 |
-
|
7110 |
-
var cb = el._leaveCb = once(function () {
|
7111 |
-
if (el.parentNode && el.parentNode._pending) {
|
7112 |
-
el.parentNode._pending[vnode.key] = null;
|
7113 |
-
}
|
7114 |
-
if (expectsCSS) {
|
7115 |
-
removeTransitionClass(el, leaveToClass);
|
7116 |
-
removeTransitionClass(el, leaveActiveClass);
|
7117 |
-
}
|
7118 |
-
if (cb.cancelled) {
|
7119 |
-
if (expectsCSS) {
|
7120 |
-
removeTransitionClass(el, leaveClass);
|
7121 |
-
}
|
7122 |
-
leaveCancelled && leaveCancelled(el);
|
7123 |
-
} else {
|
7124 |
-
rm();
|
7125 |
-
afterLeave && afterLeave(el);
|
7126 |
-
}
|
7127 |
-
el._leaveCb = null;
|
7128 |
-
});
|
7129 |
-
|
7130 |
-
if (delayLeave) {
|
7131 |
-
delayLeave(performLeave);
|
7132 |
-
} else {
|
7133 |
-
performLeave();
|
7134 |
-
}
|
7135 |
-
|
7136 |
-
function performLeave () {
|
7137 |
-
// the delayed leave may have already been cancelled
|
7138 |
-
if (cb.cancelled) {
|
7139 |
-
return
|
7140 |
-
}
|
7141 |
-
// record leaving element
|
7142 |
-
if (!vnode.data.show) {
|
7143 |
-
(el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;
|
7144 |
-
}
|
7145 |
-
beforeLeave && beforeLeave(el);
|
7146 |
-
if (expectsCSS) {
|
7147 |
-
addTransitionClass(el, leaveClass);
|
7148 |
-
addTransitionClass(el, leaveActiveClass);
|
7149 |
-
nextFrame(function () {
|
7150 |
-
addTransitionClass(el, leaveToClass);
|
7151 |
-
removeTransitionClass(el, leaveClass);
|
7152 |
-
if (!cb.cancelled && !userWantsControl) {
|
7153 |
-
if (isValidDuration(explicitLeaveDuration)) {
|
7154 |
-
setTimeout(cb, explicitLeaveDuration);
|
7155 |
-
} else {
|
7156 |
-
whenTransitionEnds(el, type, cb);
|
7157 |
-
}
|
7158 |
-
}
|
7159 |
-
});
|
7160 |
-
}
|
7161 |
-
leave && leave(el, cb);
|
7162 |
-
if (!expectsCSS && !userWantsControl) {
|
7163 |
-
cb();
|
7164 |
-
}
|
7165 |
-
}
|
7166 |
-
}
|
7167 |
-
|
7168 |
-
// only used in dev mode
|
7169 |
-
function checkDuration (val, name, vnode) {
|
7170 |
-
if (typeof val !== 'number') {
|
7171 |
-
warn(
|
7172 |
-
"<transition> explicit " + name + " duration is not a valid number - " +
|
7173 |
-
"got " + (JSON.stringify(val)) + ".",
|
7174 |
-
vnode.context
|
7175 |
-
);
|
7176 |
-
} else if (isNaN(val)) {
|
7177 |
-
warn(
|
7178 |
-
"<transition> explicit " + name + " duration is NaN - " +
|
7179 |
-
'the duration expression might be incorrect.',
|
7180 |
-
vnode.context
|
7181 |
-
);
|
7182 |
-
}
|
7183 |
-
}
|
7184 |
-
|
7185 |
-
function isValidDuration (val) {
|
7186 |
-
return typeof val === 'number' && !isNaN(val)
|
7187 |
-
}
|
7188 |
-
|
7189 |
-
/**
|
7190 |
-
* Normalize a transition hook's argument length. The hook may be:
|
7191 |
-
* - a merged hook (invoker) with the original in .fns
|
7192 |
-
* - a wrapped component method (check ._length)
|
7193 |
-
* - a plain function (.length)
|
7194 |
-
*/
|
7195 |
-
function getHookArgumentsLength (fn) {
|
7196 |
-
if (isUndef(fn)) {
|
7197 |
-
return false
|
7198 |
-
}
|
7199 |
-
var invokerFns = fn.fns;
|
7200 |
-
if (isDef(invokerFns)) {
|
7201 |
-
// invoker
|
7202 |
-
return getHookArgumentsLength(
|
7203 |
-
Array.isArray(invokerFns)
|
7204 |
-
? invokerFns[0]
|
7205 |
-
: invokerFns
|
7206 |
-
)
|
7207 |
-
} else {
|
7208 |
-
return (fn._length || fn.length) > 1
|
7209 |
-
}
|
7210 |
-
}
|
7211 |
-
|
7212 |
-
function _enter (_, vnode) {
|
7213 |
-
if (vnode.data.show !== true) {
|
7214 |
-
enter(vnode);
|
7215 |
-
}
|
7216 |
-
}
|
7217 |
-
|
7218 |
-
var transition = inBrowser ? {
|
7219 |
-
create: _enter,
|
7220 |
-
activate: _enter,
|
7221 |
-
remove: function remove$$1 (vnode, rm) {
|
7222 |
-
/* istanbul ignore else */
|
7223 |
-
if (vnode.data.show !== true) {
|
7224 |
-
leave(vnode, rm);
|
7225 |
-
} else {
|
7226 |
-
rm();
|
7227 |
}
|
7228 |
-
}
|
7229 |
-
} : {};
|
7230 |
|
7231 |
-
|
7232 |
-
|
7233 |
-
|
7234 |
-
|
7235 |
-
|
7236 |
-
|
7237 |
-
transition
|
7238 |
-
];
|
7239 |
|
7240 |
-
/* */
|
7241 |
|
7242 |
-
// the directive module should be applied last, after all
|
7243 |
-
// built-in modules have been applied.
|
7244 |
-
var modules = platformModules.concat(baseModules);
|
7245 |
|
7246 |
-
var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
|
7247 |
|
7248 |
-
|
7249 |
-
|
7250 |
-
|
7251 |
-
|
|
|
|
|
|
|
7252 |
|
7253 |
-
|
7254 |
-
|
7255 |
-
|
7256 |
-
|
7257 |
-
// http://www.matts411.com/post/internet-explorer-9-oninput/
|
7258 |
-
document.addEventListener('selectionchange', function () {
|
7259 |
-
var el = document.activeElement;
|
7260 |
-
if (el && el.vmodel) {
|
7261 |
-
trigger(el, 'input');
|
7262 |
-
}
|
7263 |
-
});
|
7264 |
-
}
|
7265 |
-
|
7266 |
-
var model$1 = {
|
7267 |
-
inserted: function inserted (el, binding, vnode) {
|
7268 |
-
if (vnode.tag === 'select') {
|
7269 |
-
var cb = function () {
|
7270 |
-
setSelected(el, binding, vnode.context);
|
7271 |
-
};
|
7272 |
-
cb();
|
7273 |
-
/* istanbul ignore if */
|
7274 |
-
if (isIE || isEdge) {
|
7275 |
-
setTimeout(cb, 0);
|
7276 |
-
}
|
7277 |
-
} else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
|
7278 |
-
el._vModifiers = binding.modifiers;
|
7279 |
-
if (!binding.modifiers.lazy) {
|
7280 |
-
// Safari < 10.2 & UIWebView doesn't fire compositionend when
|
7281 |
-
// switching focus before confirming composition choice
|
7282 |
-
// this also fixes the issue where some browsers e.g. iOS Chrome
|
7283 |
-
// fires "change" instead of "input" on autocomplete.
|
7284 |
-
el.addEventListener('change', onCompositionEnd);
|
7285 |
-
if (!isAndroid) {
|
7286 |
-
el.addEventListener('compositionstart', onCompositionStart);
|
7287 |
-
el.addEventListener('compositionend', onCompositionEnd);
|
7288 |
-
}
|
7289 |
-
/* istanbul ignore if */
|
7290 |
-
if (isIE9) {
|
7291 |
-
el.vmodel = true;
|
7292 |
-
}
|
7293 |
-
}
|
7294 |
-
}
|
7295 |
-
},
|
7296 |
-
componentUpdated: function componentUpdated (el, binding, vnode) {
|
7297 |
-
if (vnode.tag === 'select') {
|
7298 |
-
setSelected(el, binding, vnode.context);
|
7299 |
-
// in case the options rendered by v-for have changed,
|
7300 |
-
// it's possible that the value is out-of-sync with the rendered options.
|
7301 |
-
// detect such cases and filter out values that no longer has a matching
|
7302 |
-
// option in the DOM.
|
7303 |
-
var needReset = el.multiple
|
7304 |
-
? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })
|
7305 |
-
: binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options);
|
7306 |
-
if (needReset) {
|
7307 |
-
trigger(el, 'change');
|
7308 |
-
}
|
7309 |
-
}
|
7310 |
-
}
|
7311 |
-
};
|
7312 |
-
|
7313 |
-
function setSelected (el, binding, vm) {
|
7314 |
-
var value = binding.value;
|
7315 |
-
var isMultiple = el.multiple;
|
7316 |
-
if (isMultiple && !Array.isArray(value)) {
|
7317 |
-
"development" !== 'production' && warn(
|
7318 |
-
"<select multiple v-model=\"" + (binding.expression) + "\"> " +
|
7319 |
-
"expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
|
7320 |
-
vm
|
7321 |
-
);
|
7322 |
-
return
|
7323 |
-
}
|
7324 |
-
var selected, option;
|
7325 |
-
for (var i = 0, l = el.options.length; i < l; i++) {
|
7326 |
-
option = el.options[i];
|
7327 |
-
if (isMultiple) {
|
7328 |
-
selected = looseIndexOf(value, getValue(option)) > -1;
|
7329 |
-
if (option.selected !== selected) {
|
7330 |
-
option.selected = selected;
|
7331 |
-
}
|
7332 |
-
} else {
|
7333 |
-
if (looseEqual(getValue(option), value)) {
|
7334 |
-
if (el.selectedIndex !== i) {
|
7335 |
-
el.selectedIndex = i;
|
7336 |
-
}
|
7337 |
-
return
|
7338 |
-
}
|
7339 |
-
}
|
7340 |
-
}
|
7341 |
-
if (!isMultiple) {
|
7342 |
-
el.selectedIndex = -1;
|
7343 |
-
}
|
7344 |
-
}
|
7345 |
-
|
7346 |
-
function hasNoMatchingOption (value, options) {
|
7347 |
-
for (var i = 0, l = options.length; i < l; i++) {
|
7348 |
-
if (looseEqual(getValue(options[i]), value)) {
|
7349 |
-
return false
|
7350 |
-
}
|
7351 |
-
}
|
7352 |
-
return true
|
7353 |
-
}
|
7354 |
-
|
7355 |
-
function getValue (option) {
|
7356 |
-
return '_value' in option
|
7357 |
-
? option._value
|
7358 |
-
: option.value
|
7359 |
-
}
|
7360 |
-
|
7361 |
-
function onCompositionStart (e) {
|
7362 |
-
e.target.composing = true;
|
7363 |
-
}
|
7364 |
-
|
7365 |
-
function onCompositionEnd (e) {
|
7366 |
-
// prevent triggering an input event for no reason
|
7367 |
-
if (!e.target.composing) { return }
|
7368 |
-
e.target.composing = false;
|
7369 |
-
trigger(e.target, 'input');
|
7370 |
-
}
|
7371 |
-
|
7372 |
-
function trigger (el, type) {
|
7373 |
-
var e = document.createEvent('HTMLEvents');
|
7374 |
-
e.initEvent(type, true, true);
|
7375 |
-
el.dispatchEvent(e);
|
7376 |
-
}
|
7377 |
-
|
7378 |
-
/* */
|
7379 |
-
|
7380 |
-
// recursively search for possible transition defined inside the component root
|
7381 |
-
function locateNode (vnode) {
|
7382 |
-
return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
|
7383 |
-
? locateNode(vnode.componentInstance._vnode)
|
7384 |
-
: vnode
|
7385 |
-
}
|
7386 |
-
|
7387 |
-
var show = {
|
7388 |
-
bind: function bind (el, ref, vnode) {
|
7389 |
-
var value = ref.value;
|
7390 |
-
|
7391 |
-
vnode = locateNode(vnode);
|
7392 |
-
var transition$$1 = vnode.data && vnode.data.transition;
|
7393 |
-
var originalDisplay = el.__vOriginalDisplay =
|
7394 |
-
el.style.display === 'none' ? '' : el.style.display;
|
7395 |
-
if (value && transition$$1 && !isIE9) {
|
7396 |
-
vnode.data.show = true;
|
7397 |
-
enter(vnode, function () {
|
7398 |
-
el.style.display = originalDisplay;
|
7399 |
-
});
|
7400 |
-
} else {
|
7401 |
-
el.style.display = value ? originalDisplay : 'none';
|
7402 |
-
}
|
7403 |
-
},
|
7404 |
-
|
7405 |
-
update: function update (el, ref, vnode) {
|
7406 |
-
var value = ref.value;
|
7407 |
-
var oldValue = ref.oldValue;
|
7408 |
-
|
7409 |
-
/* istanbul ignore if */
|
7410 |
-
if (value === oldValue) { return }
|
7411 |
-
vnode = locateNode(vnode);
|
7412 |
-
var transition$$1 = vnode.data && vnode.data.transition;
|
7413 |
-
if (transition$$1 && !isIE9) {
|
7414 |
-
vnode.data.show = true;
|
7415 |
-
if (value) {
|
7416 |
-
enter(vnode, function () {
|
7417 |
-
el.style.display = el.__vOriginalDisplay;
|
7418 |
-
});
|
7419 |
-
} else {
|
7420 |
-
leave(vnode, function () {
|
7421 |
-
el.style.display = 'none';
|
7422 |
-
});
|
7423 |
-
}
|
7424 |
-
} else {
|
7425 |
-
el.style.display = value ? el.__vOriginalDisplay : 'none';
|
7426 |
-
}
|
7427 |
-
},
|
7428 |
-
|
7429 |
-
unbind: function unbind (
|
7430 |
-
el,
|
7431 |
-
binding,
|
7432 |
-
vnode,
|
7433 |
-
oldVnode,
|
7434 |
-
isDestroy
|
7435 |
-
) {
|
7436 |
-
if (!isDestroy) {
|
7437 |
-
el.style.display = el.__vOriginalDisplay;
|
7438 |
-
}
|
7439 |
-
}
|
7440 |
-
};
|
7441 |
-
|
7442 |
-
var platformDirectives = {
|
7443 |
-
model: model$1,
|
7444 |
-
show: show
|
7445 |
-
};
|
7446 |
-
|
7447 |
-
/* */
|
7448 |
-
|
7449 |
-
// Provides transition support for a single element/component.
|
7450 |
-
// supports transition mode (out-in / in-out)
|
7451 |
-
|
7452 |
-
var transitionProps = {
|
7453 |
-
name: String,
|
7454 |
-
appear: Boolean,
|
7455 |
-
css: Boolean,
|
7456 |
-
mode: String,
|
7457 |
-
type: String,
|
7458 |
-
enterClass: String,
|
7459 |
-
leaveClass: String,
|
7460 |
-
enterToClass: String,
|
7461 |
-
leaveToClass: String,
|
7462 |
-
enterActiveClass: String,
|
7463 |
-
leaveActiveClass: String,
|
7464 |
-
appearClass: String,
|
7465 |
-
appearActiveClass: String,
|
7466 |
-
appearToClass: String,
|
7467 |
-
duration: [Number, String, Object]
|
7468 |
-
};
|
7469 |
-
|
7470 |
-
// in case the child is also an abstract component, e.g. <keep-alive>
|
7471 |
-
// we want to recursively retrieve the real component to be rendered
|
7472 |
-
function getRealChild (vnode) {
|
7473 |
-
var compOptions = vnode && vnode.componentOptions;
|
7474 |
-
if (compOptions && compOptions.Ctor.options.abstract) {
|
7475 |
-
return getRealChild(getFirstComponentChild(compOptions.children))
|
7476 |
-
} else {
|
7477 |
-
return vnode
|
7478 |
-
}
|
7479 |
-
}
|
7480 |
-
|
7481 |
-
function extractTransitionData (comp) {
|
7482 |
-
var data = {};
|
7483 |
-
var options = comp.$options;
|
7484 |
-
// props
|
7485 |
-
for (var key in options.propsData) {
|
7486 |
-
data[key] = comp[key];
|
7487 |
-
}
|
7488 |
-
// events.
|
7489 |
-
// extract listeners and pass them directly to the transition methods
|
7490 |
-
var listeners = options._parentListeners;
|
7491 |
-
for (var key$1 in listeners) {
|
7492 |
-
data[camelize(key$1)] = listeners[key$1];
|
7493 |
-
}
|
7494 |
-
return data
|
7495 |
-
}
|
7496 |
-
|
7497 |
-
function placeholder (h, rawChild) {
|
7498 |
-
if (/\d-keep-alive$/.test(rawChild.tag)) {
|
7499 |
-
return h('keep-alive', {
|
7500 |
-
props: rawChild.componentOptions.propsData
|
7501 |
-
})
|
7502 |
-
}
|
7503 |
-
}
|
7504 |
-
|
7505 |
-
function hasParentTransition (vnode) {
|
7506 |
-
while ((vnode = vnode.parent)) {
|
7507 |
-
if (vnode.data.transition) {
|
7508 |
-
return true
|
7509 |
-
}
|
7510 |
-
}
|
7511 |
-
}
|
7512 |
-
|
7513 |
-
function isSameChild (child, oldChild) {
|
7514 |
-
return oldChild.key === child.key && oldChild.tag === child.tag
|
7515 |
-
}
|
7516 |
-
|
7517 |
-
function isAsyncPlaceholder (node) {
|
7518 |
-
return node.isComment && node.asyncFactory
|
7519 |
-
}
|
7520 |
-
|
7521 |
-
var Transition = {
|
7522 |
-
name: 'transition',
|
7523 |
-
props: transitionProps,
|
7524 |
-
abstract: true,
|
7525 |
-
|
7526 |
-
render: function render (h) {
|
7527 |
-
var this$1 = this;
|
7528 |
-
|
7529 |
-
var children = this.$options._renderChildren;
|
7530 |
-
if (!children) {
|
7531 |
-
return
|
7532 |
-
}
|
7533 |
-
|
7534 |
-
// filter out text nodes (possible whitespaces)
|
7535 |
-
children = children.filter(function (c) { return c.tag || isAsyncPlaceholder(c); });
|
7536 |
-
/* istanbul ignore if */
|
7537 |
-
if (!children.length) {
|
7538 |
-
return
|
7539 |
-
}
|
7540 |
-
|
7541 |
-
// warn multiple elements
|
7542 |
-
if ("development" !== 'production' && children.length > 1) {
|
7543 |
-
warn(
|
7544 |
-
'<transition> can only be used on a single element. Use ' +
|
7545 |
-
'<transition-group> for lists.',
|
7546 |
-
this.$parent
|
7547 |
-
);
|
7548 |
-
}
|
7549 |
-
|
7550 |
-
var mode = this.mode;
|
7551 |
-
|
7552 |
-
// warn invalid mode
|
7553 |
-
if ("development" !== 'production' &&
|
7554 |
-
mode && mode !== 'in-out' && mode !== 'out-in'
|
7555 |
-
) {
|
7556 |
-
warn(
|
7557 |
-
'invalid <transition> mode: ' + mode,
|
7558 |
-
this.$parent
|
7559 |
-
);
|
7560 |
-
}
|
7561 |
|
7562 |
-
|
|
|
7563 |
|
7564 |
-
//
|
7565 |
-
|
7566 |
-
|
7567 |
-
|
|
|
7568 |
}
|
7569 |
|
7570 |
-
|
7571 |
-
|
7572 |
-
|
7573 |
-
|
7574 |
-
|
7575 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7576 |
}
|
7577 |
|
7578 |
-
|
7579 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7580 |
}
|
7581 |
|
7582 |
-
|
7583 |
-
|
7584 |
-
|
7585 |
-
|
7586 |
-
|
7587 |
-
? child.isComment
|
7588 |
-
? id + 'comment'
|
7589 |
-
: id + child.tag
|
7590 |
-
: isPrimitive(child.key)
|
7591 |
-
? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
|
7592 |
-
: child.key;
|
7593 |
-
|
7594 |
-
var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
|
7595 |
-
var oldRawChild = this._vnode;
|
7596 |
-
var oldChild = getRealChild(oldRawChild);
|
7597 |
-
|
7598 |
-
// mark v-show
|
7599 |
-
// so that the transition module can hand over the control to the directive
|
7600 |
-
if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {
|
7601 |
-
child.data.show = true;
|
7602 |
}
|
7603 |
|
7604 |
-
|
7605 |
-
|
7606 |
-
|
7607 |
-
|
7608 |
-
|
|
|
7609 |
) {
|
7610 |
-
|
7611 |
-
|
7612 |
-
|
7613 |
-
|
7614 |
-
|
7615 |
-
|
7616 |
-
this._leaving = true;
|
7617 |
-
mergeVNodeHook(oldData, 'afterLeave', function () {
|
7618 |
-
this$1._leaving = false;
|
7619 |
-
this$1.$forceUpdate();
|
7620 |
-
});
|
7621 |
-
return placeholder(h, rawChild)
|
7622 |
-
} else if (mode === 'in-out') {
|
7623 |
-
if (isAsyncPlaceholder(child)) {
|
7624 |
-
return oldRawChild
|
7625 |
-
}
|
7626 |
-
var delayedLeave;
|
7627 |
-
var performLeave = function () { delayedLeave(); };
|
7628 |
-
mergeVNodeHook(data, 'afterEnter', performLeave);
|
7629 |
-
mergeVNodeHook(data, 'enterCancelled', performLeave);
|
7630 |
-
mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });
|
7631 |
-
}
|
7632 |
-
}
|
7633 |
-
|
7634 |
-
return rawChild
|
7635 |
-
}
|
7636 |
-
};
|
7637 |
-
|
7638 |
-
/* */
|
7639 |
-
|
7640 |
-
// Provides transition support for list items.
|
7641 |
-
// supports move transitions using the FLIP technique.
|
7642 |
-
|
7643 |
-
// Because the vdom's children update algorithm is "unstable" - i.e.
|
7644 |
-
// it doesn't guarantee the relative positioning of removed elements,
|
7645 |
-
// we force transition-group to update its children into two passes:
|
7646 |
-
// in the first pass, we remove all nodes that need to be removed,
|
7647 |
-
// triggering their leaving transition; in the second pass, we insert/move
|
7648 |
-
// into the final desired state. This way in the second pass removed
|
7649 |
-
// nodes will remain where they should be.
|
7650 |
-
|
7651 |
-
var props = extend({
|
7652 |
-
tag: String,
|
7653 |
-
moveClass: String
|
7654 |
-
}, transitionProps);
|
7655 |
-
|
7656 |
-
delete props.mode;
|
7657 |
-
|
7658 |
-
var TransitionGroup = {
|
7659 |
-
props: props,
|
7660 |
-
|
7661 |
-
render: function render (h) {
|
7662 |
-
var tag = this.tag || this.$vnode.data.tag || 'span';
|
7663 |
-
var map = Object.create(null);
|
7664 |
-
var prevChildren = this.prevChildren = this.children;
|
7665 |
-
var rawChildren = this.$slots.default || [];
|
7666 |
-
var children = this.children = [];
|
7667 |
-
var transitionData = extractTransitionData(this);
|
7668 |
-
|
7669 |
-
for (var i = 0; i < rawChildren.length; i++) {
|
7670 |
-
var c = rawChildren[i];
|
7671 |
-
if (c.tag) {
|
7672 |
-
if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
|
7673 |
-
children.push(c);
|
7674 |
-
map[c.key] = c
|
7675 |
-
;(c.data || (c.data = {})).transition = transitionData;
|
7676 |
-
} else {
|
7677 |
-
var opts = c.componentOptions;
|
7678 |
-
var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;
|
7679 |
-
warn(("<transition-group> children must be keyed: <" + name + ">"));
|
7680 |
-
}
|
7681 |
-
}
|
7682 |
-
}
|
7683 |
-
|
7684 |
-
if (prevChildren) {
|
7685 |
-
var kept = [];
|
7686 |
-
var removed = [];
|
7687 |
-
for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
|
7688 |
-
var c$1 = prevChildren[i$1];
|
7689 |
-
c$1.data.transition = transitionData;
|
7690 |
-
c$1.data.pos = c$1.elm.getBoundingClientRect();
|
7691 |
-
if (map[c$1.key]) {
|
7692 |
-
kept.push(c$1);
|
7693 |
-
} else {
|
7694 |
-
removed.push(c$1);
|
7695 |
}
|
7696 |
-
}
|
7697 |
-
this.kept = h(tag, null, kept);
|
7698 |
-
this.removed = removed;
|
7699 |
}
|
7700 |
|
7701 |
-
|
7702 |
-
|
7703 |
-
|
7704 |
-
|
7705 |
-
|
7706 |
-
|
7707 |
-
|
7708 |
-
|
7709 |
-
|
7710 |
-
|
7711 |
-
|
7712 |
-
|
7713 |
-
|
7714 |
-
|
7715 |
-
|
7716 |
-
|
7717 |
-
|
7718 |
-
|
7719 |
-
|
7720 |
-
|
7721 |
-
|
7722 |
-
// we divide the work into three loops to avoid mixing DOM reads and writes
|
7723 |
-
// in each iteration - which helps prevent layout thrashing.
|
7724 |
-
children.forEach(callPendingCbs);
|
7725 |
-
children.forEach(recordPosition);
|
7726 |
-
children.forEach(applyTranslation);
|
7727 |
-
|
7728 |
-
// force reflow to put everything in position
|
7729 |
-
var body = document.body;
|
7730 |
-
var f = body.offsetHeight; // eslint-disable-line
|
7731 |
-
|
7732 |
-
children.forEach(function (c) {
|
7733 |
-
if (c.data.moved) {
|
7734 |
-
var el = c.elm;
|
7735 |
-
var s = el.style;
|
7736 |
-
addTransitionClass(el, moveClass);
|
7737 |
-
s.transform = s.WebkitTransform = s.transitionDuration = '';
|
7738 |
-
el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
|
7739 |
-
if (!e || /transform$/.test(e.propertyName)) {
|
7740 |
-
el.removeEventListener(transitionEndEvent, cb);
|
7741 |
-
el._moveCb = null;
|
7742 |
-
removeTransitionClass(el, moveClass);
|
7743 |
-
}
|
7744 |
-
});
|
7745 |
-
}
|
7746 |
-
});
|
7747 |
-
},
|
7748 |
|
7749 |
-
|
7750 |
-
hasMove: function hasMove (el, moveClass) {
|
7751 |
-
/* istanbul ignore if */
|
7752 |
-
if (!hasTransition) {
|
7753 |
-
return false
|
7754 |
-
}
|
7755 |
-
/* istanbul ignore if */
|
7756 |
-
if (this._hasMove) {
|
7757 |
-
return this._hasMove
|
7758 |
-
}
|
7759 |
-
// Detect whether an element with the move class applied has
|
7760 |
-
// CSS transitions. Since the element may be inside an entering
|
7761 |
-
// transition at this very moment, we make a clone of it and remove
|
7762 |
-
// all other transition classes applied to ensure only the move class
|
7763 |
-
// is applied.
|
7764 |
-
var clone = el.cloneNode();
|
7765 |
-
if (el._transitionClasses) {
|
7766 |
-
el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });
|
7767 |
-
}
|
7768 |
-
addClass(clone, moveClass);
|
7769 |
-
clone.style.display = 'none';
|
7770 |
-
this.$el.appendChild(clone);
|
7771 |
-
var info = getTransitionInfo(clone);
|
7772 |
-
this.$el.removeChild(clone);
|
7773 |
-
return (this._hasMove = info.hasTransform)
|
7774 |
-
}
|
7775 |
-
}
|
7776 |
-
};
|
7777 |
-
|
7778 |
-
function callPendingCbs (c) {
|
7779 |
-
/* istanbul ignore if */
|
7780 |
-
if (c.elm._moveCb) {
|
7781 |
-
c.elm._moveCb();
|
7782 |
-
}
|
7783 |
-
/* istanbul ignore if */
|
7784 |
-
if (c.elm._enterCb) {
|
7785 |
-
c.elm._enterCb();
|
7786 |
-
}
|
7787 |
-
}
|
7788 |
-
|
7789 |
-
function recordPosition (c) {
|
7790 |
-
c.data.newPos = c.elm.getBoundingClientRect();
|
7791 |
-
}
|
7792 |
-
|
7793 |
-
function applyTranslation (c) {
|
7794 |
-
var oldPos = c.data.pos;
|
7795 |
-
var newPos = c.data.newPos;
|
7796 |
-
var dx = oldPos.left - newPos.left;
|
7797 |
-
var dy = oldPos.top - newPos.top;
|
7798 |
-
if (dx || dy) {
|
7799 |
-
c.data.moved = true;
|
7800 |
-
var s = c.elm.style;
|
7801 |
-
s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
|
7802 |
-
s.transitionDuration = '0s';
|
7803 |
-
}
|
7804 |
-
}
|
7805 |
-
|
7806 |
-
var platformComponents = {
|
7807 |
-
Transition: Transition,
|
7808 |
-
TransitionGroup: TransitionGroup
|
7809 |
-
};
|
7810 |
-
|
7811 |
-
/* */
|
7812 |
-
|
7813 |
-
// install platform specific utils
|
7814 |
-
Vue$3.config.mustUseProp = mustUseProp;
|
7815 |
-
Vue$3.config.isReservedTag = isReservedTag;
|
7816 |
-
Vue$3.config.isReservedAttr = isReservedAttr;
|
7817 |
-
Vue$3.config.getTagNamespace = getTagNamespace;
|
7818 |
-
Vue$3.config.isUnknownElement = isUnknownElement;
|
7819 |
-
|
7820 |
-
// install platform runtime directives & components
|
7821 |
-
extend(Vue$3.options.directives, platformDirectives);
|
7822 |
-
extend(Vue$3.options.components, platformComponents);
|
7823 |
-
|
7824 |
-
// install platform patch function
|
7825 |
-
Vue$3.prototype.__patch__ = inBrowser ? patch : noop;
|
7826 |
-
|
7827 |
-
// public mount method
|
7828 |
-
Vue$3.prototype.$mount = function (
|
7829 |
-
el,
|
7830 |
-
hydrating
|
7831 |
-
) {
|
7832 |
-
el = el && inBrowser ? query(el) : undefined;
|
7833 |
-
return mountComponent(this, el, hydrating)
|
7834 |
-
};
|
7835 |
-
|
7836 |
-
// devtools global hook
|
7837 |
-
/* istanbul ignore next */
|
7838 |
-
setTimeout(function () {
|
7839 |
-
if (config.devtools) {
|
7840 |
-
if (devtools) {
|
7841 |
-
devtools.emit('init', Vue$3);
|
7842 |
-
} else if ("development" !== 'production' && isChrome) {
|
7843 |
-
console[console.info ? 'info' : 'log'](
|
7844 |
-
'Download the Vue Devtools extension for a better development experience:\n' +
|
7845 |
-
'https://github.com/vuejs/vue-devtools'
|
7846 |
-
);
|
7847 |
-
}
|
7848 |
-
}
|
7849 |
-
if ("development" !== 'production' &&
|
7850 |
-
config.productionTip !== false &&
|
7851 |
-
inBrowser && typeof console !== 'undefined'
|
7852 |
-
) {
|
7853 |
-
console[console.info ? 'info' : 'log'](
|
7854 |
-
"You are running Vue in development mode.\n" +
|
7855 |
-
"Make sure to turn on production mode when deploying for production.\n" +
|
7856 |
-
"See more tips at https://vuejs.org/guide/deployment.html"
|
7857 |
-
);
|
7858 |
-
}
|
7859 |
-
}, 0);
|
7860 |
-
|
7861 |
-
/* */
|
7862 |
-
|
7863 |
-
// check whether current browser encodes a char inside attribute values
|
7864 |
-
function shouldDecode (content, encoded) {
|
7865 |
-
var div = document.createElement('div');
|
7866 |
-
div.innerHTML = "<div a=\"" + content + "\"/>";
|
7867 |
-
return div.innerHTML.indexOf(encoded) > 0
|
7868 |
-
}
|
7869 |
-
|
7870 |
-
// #3663
|
7871 |
-
// IE encodes newlines inside attribute values while other browsers don't
|
7872 |
-
var shouldDecodeNewlines = inBrowser ? shouldDecode('\n', ' ') : false;
|
7873 |
-
|
7874 |
-
/* */
|
7875 |
-
|
7876 |
-
var defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g;
|
7877 |
-
var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
|
7878 |
-
|
7879 |
-
var buildRegex = cached(function (delimiters) {
|
7880 |
-
var open = delimiters[0].replace(regexEscapeRE, '\\$&');
|
7881 |
-
var close = delimiters[1].replace(regexEscapeRE, '\\$&');
|
7882 |
-
return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
|
7883 |
-
});
|
7884 |
-
|
7885 |
-
function parseText (
|
7886 |
-
text,
|
7887 |
-
delimiters
|
7888 |
-
) {
|
7889 |
-
var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
|
7890 |
-
if (!tagRE.test(text)) {
|
7891 |
-
return
|
7892 |
-
}
|
7893 |
-
var tokens = [];
|
7894 |
-
var lastIndex = tagRE.lastIndex = 0;
|
7895 |
-
var match, index;
|
7896 |
-
while ((match = tagRE.exec(text))) {
|
7897 |
-
index = match.index;
|
7898 |
-
// push text token
|
7899 |
-
if (index > lastIndex) {
|
7900 |
-
tokens.push(JSON.stringify(text.slice(lastIndex, index)));
|
7901 |
-
}
|
7902 |
-
// tag token
|
7903 |
-
var exp = parseFilters(match[1].trim());
|
7904 |
-
tokens.push(("_s(" + exp + ")"));
|
7905 |
-
lastIndex = index + match[0].length;
|
7906 |
-
}
|
7907 |
-
if (lastIndex < text.length) {
|
7908 |
-
tokens.push(JSON.stringify(text.slice(lastIndex)));
|
7909 |
-
}
|
7910 |
-
return tokens.join('+')
|
7911 |
-
}
|
7912 |
-
|
7913 |
-
/* */
|
7914 |
-
|
7915 |
-
function transformNode (el, options) {
|
7916 |
-
var warn = options.warn || baseWarn;
|
7917 |
-
var staticClass = getAndRemoveAttr(el, 'class');
|
7918 |
-
if ("development" !== 'production' && staticClass) {
|
7919 |
-
var expression = parseText(staticClass, options.delimiters);
|
7920 |
-
if (expression) {
|
7921 |
-
warn(
|
7922 |
-
"class=\"" + staticClass + "\": " +
|
7923 |
-
'Interpolation inside attributes has been removed. ' +
|
7924 |
-
'Use v-bind or the colon shorthand instead. For example, ' +
|
7925 |
-
'instead of <div class="{{ val }}">, use <div :class="val">.'
|
7926 |
-
);
|
7927 |
-
}
|
7928 |
-
}
|
7929 |
-
if (staticClass) {
|
7930 |
-
el.staticClass = JSON.stringify(staticClass);
|
7931 |
-
}
|
7932 |
-
var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
|
7933 |
-
if (classBinding) {
|
7934 |
-
el.classBinding = classBinding;
|
7935 |
-
}
|
7936 |
-
}
|
7937 |
-
|
7938 |
-
function genData (el) {
|
7939 |
-
var data = '';
|
7940 |
-
if (el.staticClass) {
|
7941 |
-
data += "staticClass:" + (el.staticClass) + ",";
|
7942 |
-
}
|
7943 |
-
if (el.classBinding) {
|
7944 |
-
data += "class:" + (el.classBinding) + ",";
|
7945 |
-
}
|
7946 |
-
return data
|
7947 |
-
}
|
7948 |
-
|
7949 |
-
var klass$1 = {
|
7950 |
-
staticKeys: ['staticClass'],
|
7951 |
-
transformNode: transformNode,
|
7952 |
-
genData: genData
|
7953 |
-
};
|
7954 |
-
|
7955 |
-
/* */
|
7956 |
-
|
7957 |
-
function transformNode$1 (el, options) {
|
7958 |
-
var warn = options.warn || baseWarn;
|
7959 |
-
var staticStyle = getAndRemoveAttr(el, 'style');
|
7960 |
-
if (staticStyle) {
|
7961 |
-
/* istanbul ignore if */
|
7962 |
-
{
|
7963 |
-
var expression = parseText(staticStyle, options.delimiters);
|
7964 |
-
if (expression) {
|
7965 |
-
warn(
|
7966 |
-
"style=\"" + staticStyle + "\": " +
|
7967 |
-
'Interpolation inside attributes has been removed. ' +
|
7968 |
-
'Use v-bind or the colon shorthand instead. For example, ' +
|
7969 |
-
'instead of <div style="{{ val }}">, use <div :style="val">.'
|
7970 |
-
);
|
7971 |
-
}
|
7972 |
-
}
|
7973 |
-
el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
|
7974 |
-
}
|
7975 |
-
|
7976 |
-
var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
|
7977 |
-
if (styleBinding) {
|
7978 |
-
el.styleBinding = styleBinding;
|
7979 |
-
}
|
7980 |
-
}
|
7981 |
-
|
7982 |
-
function genData$1 (el) {
|
7983 |
-
var data = '';
|
7984 |
-
if (el.staticStyle) {
|
7985 |
-
data += "staticStyle:" + (el.staticStyle) + ",";
|
7986 |
-
}
|
7987 |
-
if (el.styleBinding) {
|
7988 |
-
data += "style:(" + (el.styleBinding) + "),";
|
7989 |
-
}
|
7990 |
-
return data
|
7991 |
-
}
|
7992 |
-
|
7993 |
-
var style$1 = {
|
7994 |
-
staticKeys: ['staticStyle'],
|
7995 |
-
transformNode: transformNode$1,
|
7996 |
-
genData: genData$1
|
7997 |
-
};
|
7998 |
-
|
7999 |
-
var modules$1 = [
|
8000 |
-
klass$1,
|
8001 |
-
style$1
|
8002 |
-
];
|
8003 |
-
|
8004 |
-
/* */
|
8005 |
-
|
8006 |
-
function text (el, dir) {
|
8007 |
-
if (dir.value) {
|
8008 |
-
addProp(el, 'textContent', ("_s(" + (dir.value) + ")"));
|
8009 |
-
}
|
8010 |
-
}
|
8011 |
-
|
8012 |
-
/* */
|
8013 |
-
|
8014 |
-
function html (el, dir) {
|
8015 |
-
if (dir.value) {
|
8016 |
-
addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"));
|
8017 |
-
}
|
8018 |
-
}
|
8019 |
-
|
8020 |
-
var directives$1 = {
|
8021 |
-
model: model,
|
8022 |
-
text: text,
|
8023 |
-
html: html
|
8024 |
-
};
|
8025 |
-
|
8026 |
-
/* */
|
8027 |
-
|
8028 |
-
var isUnaryTag = makeMap(
|
8029 |
-
'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
|
8030 |
-
'link,meta,param,source,track,wbr'
|
8031 |
-
);
|
8032 |
-
|
8033 |
-
// Elements that you can, intentionally, leave open
|
8034 |
-
// (and which close themselves)
|
8035 |
-
var canBeLeftOpenTag = makeMap(
|
8036 |
-
'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
|
8037 |
-
);
|
8038 |
-
|
8039 |
-
// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
|
8040 |
-
// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
|
8041 |
-
var isNonPhrasingTag = makeMap(
|
8042 |
-
'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
|
8043 |
-
'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
|
8044 |
-
'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
|
8045 |
-
'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
|
8046 |
-
'title,tr,track'
|
8047 |
-
);
|
8048 |
-
|
8049 |
-
/* */
|
8050 |
-
|
8051 |
-
var baseOptions = {
|
8052 |
-
expectHTML: true,
|
8053 |
-
modules: modules$1,
|
8054 |
-
directives: directives$1,
|
8055 |
-
isPreTag: isPreTag,
|
8056 |
-
isUnaryTag: isUnaryTag,
|
8057 |
-
mustUseProp: mustUseProp,
|
8058 |
-
canBeLeftOpenTag: canBeLeftOpenTag,
|
8059 |
-
isReservedTag: isReservedTag,
|
8060 |
-
getTagNamespace: getTagNamespace,
|
8061 |
-
staticKeys: genStaticKeys(modules$1)
|
8062 |
-
};
|
8063 |
-
|
8064 |
-
/* */
|
8065 |
-
|
8066 |
-
var decoder;
|
8067 |
-
|
8068 |
-
var he = {
|
8069 |
-
decode: function decode (html) {
|
8070 |
-
decoder = decoder || document.createElement('div');
|
8071 |
-
decoder.innerHTML = html;
|
8072 |
-
return decoder.textContent
|
8073 |
-
}
|
8074 |
-
};
|
8075 |
-
|
8076 |
-
/**
|
8077 |
-
* Not type-checking this file because it's mostly vendor code.
|
8078 |
-
*/
|
8079 |
|
8080 |
-
|
8081 |
-
* HTML Parser By John Resig (ejohn.org)
|
8082 |
-
* Modified by Juriy "kangax" Zaytsev
|
8083 |
-
* Original code by Erik Arvidsson, Mozilla Public License
|
8084 |
-
* http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
|
8085 |
-
*/
|
8086 |
|
8087 |
-
|
8088 |
-
|
8089 |
-
|
8090 |
-
|
8091 |
-
|
8092 |
-
|
8093 |
-
|
8094 |
-
|
8095 |
-
|
8096 |
-
|
8097 |
-
];
|
8098 |
-
var
|
8099 |
-
|
8100 |
-
|
8101 |
-
|
8102 |
-
)
|
8103 |
-
|
8104 |
-
|
8105 |
-
|
8106 |
-
|
8107 |
-
var
|
8108 |
-
var
|
8109 |
-
|
8110 |
-
|
8111 |
-
|
8112 |
-
var
|
8113 |
-
|
8114 |
-
|
8115 |
-
|
8116 |
-
|
8117 |
-
|
8118 |
-
|
8119 |
-
|
8120 |
-
// Special Elements (can contain anything)
|
8121 |
-
var isPlainTextElement = makeMap('script,style,textarea', true);
|
8122 |
-
var reCache = {};
|
8123 |
-
|
8124 |
-
var decodingMap = {
|
8125 |
-
'<': '<',
|
8126 |
-
'>': '>',
|
8127 |
-
'"': '"',
|
8128 |
-
'&': '&',
|
8129 |
-
' ': '\n'
|
8130 |
-
};
|
8131 |
-
var encodedAttr = /&(?:lt|gt|quot|amp);/g;
|
8132 |
-
var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#10);/g;
|
8133 |
-
|
8134 |
-
// #5992
|
8135 |
-
var isIgnoreNewlineTag = makeMap('pre,textarea', true);
|
8136 |
-
var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; };
|
8137 |
-
|
8138 |
-
function decodeAttr (value, shouldDecodeNewlines) {
|
8139 |
-
var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
|
8140 |
-
return value.replace(re, function (match) { return decodingMap[match]; })
|
8141 |
-
}
|
8142 |
-
|
8143 |
-
function parseHTML (html, options) {
|
8144 |
-
var stack = [];
|
8145 |
-
var expectHTML = options.expectHTML;
|
8146 |
-
var isUnaryTag$$1 = options.isUnaryTag || no;
|
8147 |
-
var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
|
8148 |
-
var index = 0;
|
8149 |
-
var last, lastTag;
|
8150 |
-
while (html) {
|
8151 |
-
last = html;
|
8152 |
-
// Make sure we're not in a plaintext content element like script/style
|
8153 |
-
if (!lastTag || !isPlainTextElement(lastTag)) {
|
8154 |
-
if (shouldIgnoreFirstNewline(lastTag, html)) {
|
8155 |
-
advance(1);
|
8156 |
-
}
|
8157 |
-
var textEnd = html.indexOf('<');
|
8158 |
-
if (textEnd === 0) {
|
8159 |
-
// Comment:
|
8160 |
-
if (comment.test(html)) {
|
8161 |
-
var commentEnd = html.indexOf('-->');
|
8162 |
-
|
8163 |
-
if (commentEnd >= 0) {
|
8164 |
-
if (options.shouldKeepComment) {
|
8165 |
-
options.comment(html.substring(4, commentEnd));
|
8166 |
-
}
|
8167 |
-
advance(commentEnd + 3);
|
8168 |
-
continue
|
8169 |
-
}
|
8170 |
-
}
|
8171 |
-
|
8172 |
-
// http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
|
8173 |
-
if (conditionalComment.test(html)) {
|
8174 |
-
var conditionalEnd = html.indexOf(']>');
|
8175 |
-
|
8176 |
-
if (conditionalEnd >= 0) {
|
8177 |
-
advance(conditionalEnd + 2);
|
8178 |
-
continue
|
8179 |
-
}
|
8180 |
-
}
|
8181 |
-
|
8182 |
-
// Doctype:
|
8183 |
-
var doctypeMatch = html.match(doctype);
|
8184 |
-
if (doctypeMatch) {
|
8185 |
-
advance(doctypeMatch[0].length);
|
8186 |
-
continue
|
8187 |
-
}
|
8188 |
-
|
8189 |
-
// End tag:
|
8190 |
-
var endTagMatch = html.match(endTag);
|
8191 |
-
if (endTagMatch) {
|
8192 |
-
var curIndex = index;
|
8193 |
-
advance(endTagMatch[0].length);
|
8194 |
-
parseEndTag(endTagMatch[1], curIndex, index);
|
8195 |
-
continue
|
8196 |
-
}
|
8197 |
-
|
8198 |
-
// Start tag:
|
8199 |
-
var startTagMatch = parseStartTag();
|
8200 |
-
if (startTagMatch) {
|
8201 |
-
handleStartTag(startTagMatch);
|
8202 |
-
continue
|
8203 |
-
}
|
8204 |
-
}
|
8205 |
-
|
8206 |
-
var text = (void 0), rest = (void 0), next = (void 0);
|
8207 |
-
if (textEnd >= 0) {
|
8208 |
-
rest = html.slice(textEnd);
|
8209 |
-
while (
|
8210 |
-
!endTag.test(rest) &&
|
8211 |
-
!startTagOpen.test(rest) &&
|
8212 |
-
!comment.test(rest) &&
|
8213 |
-
!conditionalComment.test(rest)
|
8214 |
-
) {
|
8215 |
-
// < in plain text, be forgiving and treat it as text
|
8216 |
-
next = rest.indexOf('<', 1);
|
8217 |
-
if (next < 0) { break }
|
8218 |
-
textEnd += next;
|
8219 |
-
rest = html.slice(textEnd);
|
8220 |
-
}
|
8221 |
-
text = html.substring(0, textEnd);
|
8222 |
-
advance(textEnd);
|
8223 |
-
}
|
8224 |
-
|
8225 |
-
if (textEnd < 0) {
|
8226 |
-
text = html;
|
8227 |
-
html = '';
|
8228 |
-
}
|
8229 |
-
|
8230 |
-
if (options.chars && text) {
|
8231 |
-
options.chars(text);
|
8232 |
-
}
|
8233 |
-
} else {
|
8234 |
-
var endTagLength = 0;
|
8235 |
-
var stackedTag = lastTag.toLowerCase();
|
8236 |
-
var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
|
8237 |
-
var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {
|
8238 |
-
endTagLength = endTag.length;
|
8239 |
-
if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
|
8240 |
-
text = text
|
8241 |
-
.replace(/<!--([\s\S]*?)-->/g, '$1')
|
8242 |
-
.replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
|
8243 |
-
}
|
8244 |
-
if (shouldIgnoreFirstNewline(stackedTag, text)) {
|
8245 |
-
text = text.slice(1);
|
8246 |
-
}
|
8247 |
-
if (options.chars) {
|
8248 |
-
options.chars(text);
|
8249 |
}
|
8250 |
-
return ''
|
8251 |
-
});
|
8252 |
-
index += html.length - rest$1.length;
|
8253 |
-
html = rest$1;
|
8254 |
-
parseEndTag(stackedTag, index - endTagLength, index);
|
8255 |
-
}
|
8256 |
-
|
8257 |
-
if (html === last) {
|
8258 |
-
options.chars && options.chars(html);
|
8259 |
-
if ("development" !== 'production' && !stack.length && options.warn) {
|
8260 |
-
options.warn(("Mal-formatted tag at end of template: \"" + html + "\""));
|
8261 |
-
}
|
8262 |
-
break
|
8263 |
-
}
|
8264 |
-
}
|
8265 |
-
|
8266 |
-
// Clean up any remaining tags
|
8267 |
-
parseEndTag();
|
8268 |
-
|
8269 |
-
function advance (n) {
|
8270 |
-
index += n;
|
8271 |
-
html = html.substring(n);
|
8272 |
-
}
|
8273 |
-
|
8274 |
-
function parseStartTag () {
|
8275 |
-
var start = html.match(startTagOpen);
|
8276 |
-
if (start) {
|
8277 |
-
var match = {
|
8278 |
-
tagName: start[1],
|
8279 |
-
attrs: [],
|
8280 |
-
start: index
|
8281 |
-
};
|
8282 |
-
advance(start[0].length);
|
8283 |
-
var end, attr;
|
8284 |
-
while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {
|
8285 |
-
advance(attr[0].length);
|
8286 |
-
match.attrs.push(attr);
|
8287 |
-
}
|
8288 |
-
if (end) {
|
8289 |
-
match.unarySlash = end[1];
|
8290 |
-
advance(end[0].length);
|
8291 |
-
match.end = index;
|
8292 |
-
return match
|
8293 |
-
}
|
8294 |
-
}
|
8295 |
-
}
|
8296 |
-
|
8297 |
-
function handleStartTag (match) {
|
8298 |
-
var tagName = match.tagName;
|
8299 |
-
var unarySlash = match.unarySlash;
|
8300 |
-
|
8301 |
-
if (expectHTML) {
|
8302 |
-
if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
|
8303 |
-
parseEndTag(lastTag);
|
8304 |
-
}
|
8305 |
-
if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
|
8306 |
-
parseEndTag(tagName);
|
8307 |
-
}
|
8308 |
-
}
|
8309 |
-
|
8310 |
-
var unary = isUnaryTag$$1(tagName) || !!unarySlash;
|
8311 |
-
|
8312 |
-
var l = match.attrs.length;
|
8313 |
-
var attrs = new Array(l);
|
8314 |
-
for (var i = 0; i < l; i++) {
|
8315 |
-
var args = match.attrs[i];
|
8316 |
-
// hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778
|
8317 |
-
if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) {
|
8318 |
-
if (args[3] === '') { delete args[3]; }
|
8319 |
-
if (args[4] === '') { delete args[4]; }
|
8320 |
-
if (args[5] === '') { delete args[5]; }
|
8321 |
-
}
|
8322 |
-
var value = args[3] || args[4] || args[5] || '';
|
8323 |
-
attrs[i] = {
|
8324 |
-
name: args[1],
|
8325 |
-
value: decodeAttr(
|
8326 |
-
value,
|
8327 |
-
options.shouldDecodeNewlines
|
8328 |
-
)
|
8329 |
-
};
|
8330 |
}
|
8331 |
|
8332 |
-
|
8333 |
-
|
8334 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8335 |
}
|
8336 |
|
8337 |
-
|
8338 |
-
options.start(tagName, attrs, unary, match.start, match.end);
|
8339 |
-
}
|
8340 |
-
}
|
8341 |
|
8342 |
-
function parseEndTag (tagName, start, end) {
|
8343 |
-
var pos, lowerCasedTagName;
|
8344 |
-
if (start == null) { start = index; }
|
8345 |
-
if (end == null) { end = index; }
|
8346 |
|
8347 |
-
if (tagName) {
|
8348 |
-
lowerCasedTagName = tagName.toLowerCase();
|
8349 |
-
}
|
8350 |
|
8351 |
-
|
8352 |
-
|
8353 |
-
|
8354 |
-
|
8355 |
-
|
|
|
8356 |
}
|
8357 |
-
}
|
8358 |
-
} else {
|
8359 |
-
// If no tag name is provided, clean shop
|
8360 |
-
pos = 0;
|
8361 |
}
|
8362 |
|
8363 |
-
|
8364 |
-
|
8365 |
-
|
8366 |
-
|
8367 |
-
|
8368 |
-
|
|
|
8369 |
) {
|
8370 |
-
|
8371 |
-
|
8372 |
-
|
8373 |
-
}
|
8374 |
-
if (options.end) {
|
8375 |
-
options.end(stack[i].tag, start, end);
|
8376 |
-
}
|
8377 |
-
}
|
8378 |
-
|
8379 |
-
// Remove the open elements from the stack
|
8380 |
-
stack.length = pos;
|
8381 |
-
lastTag = pos && stack[pos - 1].tag;
|
8382 |
-
} else if (lowerCasedTagName === 'br') {
|
8383 |
-
if (options.start) {
|
8384 |
-
options.start(tagName, [], true, start, end);
|
8385 |
-
}
|
8386 |
-
} else if (lowerCasedTagName === 'p') {
|
8387 |
-
if (options.start) {
|
8388 |
-
options.start(tagName, [], false, start, end);
|
8389 |
-
}
|
8390 |
-
if (options.end) {
|
8391 |
-
options.end(tagName, start, end);
|
8392 |
-
}
|
8393 |
-
}
|
8394 |
-
}
|
8395 |
-
}
|
8396 |
-
|
8397 |
-
/* */
|
8398 |
-
|
8399 |
-
var onRE = /^@|^v-on:/;
|
8400 |
-
var dirRE = /^v-|^@|^:/;
|
8401 |
-
var forAliasRE = /(.*?)\s+(?:in|of)\s+(.*)/;
|
8402 |
-
var forIteratorRE = /\((\{[^}]*\}|[^,]*),([^,]*)(?:,([^,]*))?\)/;
|
8403 |
-
|
8404 |
-
var argRE = /:(.*)$/;
|
8405 |
-
var bindRE = /^:|^v-bind:/;
|
8406 |
-
var modifierRE = /\.[^.]+/g;
|
8407 |
-
|
8408 |
-
var decodeHTMLCached = cached(he.decode);
|
8409 |
-
|
8410 |
-
// configurable state
|
8411 |
-
var warn$2;
|
8412 |
-
var delimiters;
|
8413 |
-
var transforms;
|
8414 |
-
var preTransforms;
|
8415 |
-
var postTransforms;
|
8416 |
-
var platformIsPreTag;
|
8417 |
-
var platformMustUseProp;
|
8418 |
-
var platformGetTagNamespace;
|
8419 |
-
|
8420 |
-
/**
|
8421 |
-
* Convert HTML string to AST.
|
8422 |
-
*/
|
8423 |
-
function parse (
|
8424 |
-
template,
|
8425 |
-
options
|
8426 |
-
) {
|
8427 |
-
warn$2 = options.warn || baseWarn;
|
8428 |
-
|
8429 |
-
platformIsPreTag = options.isPreTag || no;
|
8430 |
-
platformMustUseProp = options.mustUseProp || no;
|
8431 |
-
platformGetTagNamespace = options.getTagNamespace || no;
|
8432 |
-
|
8433 |
-
transforms = pluckModuleFunction(options.modules, 'transformNode');
|
8434 |
-
preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
|
8435 |
-
postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
|
8436 |
-
|
8437 |
-
delimiters = options.delimiters;
|
8438 |
-
|
8439 |
-
var stack = [];
|
8440 |
-
var preserveWhitespace = options.preserveWhitespace !== false;
|
8441 |
-
var root;
|
8442 |
-
var currentParent;
|
8443 |
-
var inVPre = false;
|
8444 |
-
var inPre = false;
|
8445 |
-
var warned = false;
|
8446 |
-
|
8447 |
-
function warnOnce (msg) {
|
8448 |
-
if (!warned) {
|
8449 |
-
warned = true;
|
8450 |
-
warn$2(msg);
|
8451 |
-
}
|
8452 |
-
}
|
8453 |
-
|
8454 |
-
function endPre (element) {
|
8455 |
-
// check pre state
|
8456 |
-
if (element.pre) {
|
8457 |
-
inVPre = false;
|
8458 |
-
}
|
8459 |
-
if (platformIsPreTag(element.tag)) {
|
8460 |
-
inPre = false;
|
8461 |
-
}
|
8462 |
-
}
|
8463 |
-
|
8464 |
-
parseHTML(template, {
|
8465 |
-
warn: warn$2,
|
8466 |
-
expectHTML: options.expectHTML,
|
8467 |
-
isUnaryTag: options.isUnaryTag,
|
8468 |
-
canBeLeftOpenTag: options.canBeLeftOpenTag,
|
8469 |
-
shouldDecodeNewlines: options.shouldDecodeNewlines,
|
8470 |
-
shouldKeepComment: options.comments,
|
8471 |
-
start: function start (tag, attrs, unary) {
|
8472 |
-
// check namespace.
|
8473 |
-
// inherit parent ns if there is one
|
8474 |
-
var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
|
8475 |
-
|
8476 |
-
// handle IE svg bug
|
8477 |
-
/* istanbul ignore if */
|
8478 |
-
if (isIE && ns === 'svg') {
|
8479 |
-
attrs = guardIESVGBug(attrs);
|
8480 |
-
}
|
8481 |
-
|
8482 |
-
var element = {
|
8483 |
-
type: 1,
|
8484 |
-
tag: tag,
|
8485 |
-
attrsList: attrs,
|
8486 |
-
attrsMap: makeAttrsMap(attrs),
|
8487 |
-
parent: currentParent,
|
8488 |
-
children: []
|
8489 |
-
};
|
8490 |
-
if (ns) {
|
8491 |
-
element.ns = ns;
|
8492 |
-
}
|
8493 |
-
|
8494 |
-
if (isForbiddenTag(element) && !isServerRendering()) {
|
8495 |
-
element.forbidden = true;
|
8496 |
-
"development" !== 'production' && warn$2(
|
8497 |
-
'Templates should only be responsible for mapping the state to the ' +
|
8498 |
-
'UI. Avoid placing tags with side-effects in your templates, such as ' +
|
8499 |
-
"<" + tag + ">" + ', as they will not be parsed.'
|
8500 |
-
);
|
8501 |
-
}
|
8502 |
-
|
8503 |
-
// apply pre-transforms
|
8504 |
-
for (var i = 0; i < preTransforms.length; i++) {
|
8505 |
-
preTransforms[i](element, options);
|
8506 |
-
}
|
8507 |
-
|
8508 |
-
if (!inVPre) {
|
8509 |
-
processPre(element);
|
8510 |
-
if (element.pre) {
|
8511 |
-
inVPre = true;
|
8512 |
-
}
|
8513 |
-
}
|
8514 |
-
if (platformIsPreTag(element.tag)) {
|
8515 |
-
inPre = true;
|
8516 |
-
}
|
8517 |
-
if (inVPre) {
|
8518 |
-
processRawAttrs(element);
|
8519 |
-
} else {
|
8520 |
-
processFor(element);
|
8521 |
-
processIf(element);
|
8522 |
-
processOnce(element);
|
8523 |
-
processKey(element);
|
8524 |
|
8525 |
-
|
8526 |
-
|
8527 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8528 |
|
8529 |
-
|
8530 |
-
|
8531 |
-
|
8532 |
-
|
8533 |
-
|
8534 |
-
|
8535 |
-
|
8536 |
-
}
|
8537 |
|
8538 |
-
|
8539 |
-
|
8540 |
-
|
8541 |
-
|
8542 |
-
|
8543 |
-
|
8544 |
-
|
8545 |
-
|
8546 |
-
|
8547 |
-
|
8548 |
-
|
8549 |
-
|
8550 |
-
|
8551 |
-
|
8552 |
-
|
8553 |
-
|
8554 |
-
|
8555 |
-
|
8556 |
-
|
8557 |
-
|
8558 |
-
|
8559 |
-
|
8560 |
-
|
8561 |
-
|
8562 |
-
|
8563 |
-
|
8564 |
-
|
8565 |
-
|
8566 |
-
|
8567 |
-
|
8568 |
-
|
8569 |
-
|
8570 |
-
|
8571 |
-
|
8572 |
-
|
8573 |
-
|
8574 |
-
|
8575 |
-
|
8576 |
-
|
8577 |
-
|
8578 |
-
|
8579 |
-
|
8580 |
-
|
8581 |
-
|
8582 |
-
|
8583 |
-
|
8584 |
-
|
8585 |
-
|
8586 |
-
|
8587 |
-
|
8588 |
-
|
8589 |
-
|
8590 |
-
|
8591 |
-
|
8592 |
-
|
8593 |
-
|
8594 |
-
|
8595 |
-
|
8596 |
-
|
8597 |
-
|
8598 |
-
end: function end () {
|
8599 |
-
// remove trailing whitespace
|
8600 |
-
var element = stack[stack.length - 1];
|
8601 |
-
var lastNode = element.children[element.children.length - 1];
|
8602 |
-
if (lastNode && lastNode.type === 3 && lastNode.text === ' ' && !inPre) {
|
8603 |
-
element.children.pop();
|
8604 |
-
}
|
8605 |
-
// pop stack
|
8606 |
-
stack.length -= 1;
|
8607 |
-
currentParent = stack[stack.length - 1];
|
8608 |
-
endPre(element);
|
8609 |
-
},
|
8610 |
-
|
8611 |
-
chars: function chars (text) {
|
8612 |
-
if (!currentParent) {
|
8613 |
-
{
|
8614 |
-
if (text === template) {
|
8615 |
-
warnOnce(
|
8616 |
-
'Component template requires a root element, rather than just text.'
|
8617 |
-
);
|
8618 |
-
} else if ((text = text.trim())) {
|
8619 |
-
warnOnce(
|
8620 |
-
("text \"" + text + "\" outside root element will be ignored.")
|
8621 |
-
);
|
8622 |
-
}
|
8623 |
-
}
|
8624 |
-
return
|
8625 |
-
}
|
8626 |
-
// IE textarea placeholder bug
|
8627 |
-
/* istanbul ignore if */
|
8628 |
-
if (isIE &&
|
8629 |
-
currentParent.tag === 'textarea' &&
|
8630 |
-
currentParent.attrsMap.placeholder === text
|
8631 |
-
) {
|
8632 |
-
return
|
8633 |
-
}
|
8634 |
-
var children = currentParent.children;
|
8635 |
-
text = inPre || text.trim()
|
8636 |
-
? isTextTag(currentParent) ? text : decodeHTMLCached(text)
|
8637 |
-
// only preserve whitespace if its not right after a starting tag
|
8638 |
-
: preserveWhitespace && children.length ? ' ' : '';
|
8639 |
-
if (text) {
|
8640 |
-
var expression;
|
8641 |
-
if (!inVPre && text !== ' ' && (expression = parseText(text, delimiters))) {
|
8642 |
-
children.push({
|
8643 |
-
type: 2,
|
8644 |
-
expression: expression,
|
8645 |
-
text: text
|
8646 |
-
});
|
8647 |
-
} else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
|
8648 |
-
children.push({
|
8649 |
-
type: 3,
|
8650 |
-
text: text
|
8651 |
-
});
|
8652 |
-
}
|
8653 |
-
}
|
8654 |
-
},
|
8655 |
-
comment: function comment (text) {
|
8656 |
-
currentParent.children.push({
|
8657 |
-
type: 3,
|
8658 |
-
text: text,
|
8659 |
-
isComment: true
|
8660 |
-
});
|
8661 |
-
}
|
8662 |
-
});
|
8663 |
-
return root
|
8664 |
-
}
|
8665 |
-
|
8666 |
-
function processPre (el) {
|
8667 |
-
if (getAndRemoveAttr(el, 'v-pre') != null) {
|
8668 |
-
el.pre = true;
|
8669 |
-
}
|
8670 |
-
}
|
8671 |
-
|
8672 |
-
function processRawAttrs (el) {
|
8673 |
-
var l = el.attrsList.length;
|
8674 |
-
if (l) {
|
8675 |
-
var attrs = el.attrs = new Array(l);
|
8676 |
-
for (var i = 0; i < l; i++) {
|
8677 |
-
attrs[i] = {
|
8678 |
-
name: el.attrsList[i].name,
|
8679 |
-
value: JSON.stringify(el.attrsList[i].value)
|
8680 |
-
};
|
8681 |
-
}
|
8682 |
-
} else if (!el.pre) {
|
8683 |
-
// non root node in pre blocks with no attributes
|
8684 |
-
el.plain = true;
|
8685 |
-
}
|
8686 |
-
}
|
8687 |
-
|
8688 |
-
function processKey (el) {
|
8689 |
-
var exp = getBindingAttr(el, 'key');
|
8690 |
-
if (exp) {
|
8691 |
-
if ("development" !== 'production' && el.tag === 'template') {
|
8692 |
-
warn$2("<template> cannot be keyed. Place the key on real elements instead.");
|
8693 |
-
}
|
8694 |
-
el.key = exp;
|
8695 |
-
}
|
8696 |
-
}
|
8697 |
-
|
8698 |
-
function processRef (el) {
|
8699 |
-
var ref = getBindingAttr(el, 'ref');
|
8700 |
-
if (ref) {
|
8701 |
-
el.ref = ref;
|
8702 |
-
el.refInFor = checkInFor(el);
|
8703 |
-
}
|
8704 |
-
}
|
8705 |
-
|
8706 |
-
function processFor (el) {
|
8707 |
-
var exp;
|
8708 |
-
if ((exp = getAndRemoveAttr(el, 'v-for'))) {
|
8709 |
-
var inMatch = exp.match(forAliasRE);
|
8710 |
-
if (!inMatch) {
|
8711 |
-
"development" !== 'production' && warn$2(
|
8712 |
-
("Invalid v-for expression: " + exp)
|
8713 |
-
);
|
8714 |
-
return
|
8715 |
-
}
|
8716 |
-
el.for = inMatch[2].trim();
|
8717 |
-
var alias = inMatch[1].trim();
|
8718 |
-
var iteratorMatch = alias.match(forIteratorRE);
|
8719 |
-
if (iteratorMatch) {
|
8720 |
-
el.alias = iteratorMatch[1].trim();
|
8721 |
-
el.iterator1 = iteratorMatch[2].trim();
|
8722 |
-
if (iteratorMatch[3]) {
|
8723 |
-
el.iterator2 = iteratorMatch[3].trim();
|
8724 |
-
}
|
8725 |
-
} else {
|
8726 |
-
el.alias = alias;
|
8727 |
-
}
|
8728 |
-
}
|
8729 |
-
}
|
8730 |
-
|
8731 |
-
function processIf (el) {
|
8732 |
-
var exp = getAndRemoveAttr(el, 'v-if');
|
8733 |
-
if (exp) {
|
8734 |
-
el.if = exp;
|
8735 |
-
addIfCondition(el, {
|
8736 |
-
exp: exp,
|
8737 |
-
block: el
|
8738 |
-
});
|
8739 |
-
} else {
|
8740 |
-
if (getAndRemoveAttr(el, 'v-else') != null) {
|
8741 |
-
el.else = true;
|
8742 |
-
}
|
8743 |
-
var elseif = getAndRemoveAttr(el, 'v-else-if');
|
8744 |
-
if (elseif) {
|
8745 |
-
el.elseif = elseif;
|
8746 |
-
}
|
8747 |
-
}
|
8748 |
-
}
|
8749 |
-
|
8750 |
-
function processIfConditions (el, parent) {
|
8751 |
-
var prev = findPrevElement(parent.children);
|
8752 |
-
if (prev && prev.if) {
|
8753 |
-
addIfCondition(prev, {
|
8754 |
-
exp: el.elseif,
|
8755 |
-
block: el
|
8756 |
-
});
|
8757 |
-
} else {
|
8758 |
-
warn$2(
|
8759 |
-
"v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
|
8760 |
-
"used on element <" + (el.tag) + "> without corresponding v-if."
|
8761 |
-
);
|
8762 |
-
}
|
8763 |
-
}
|
8764 |
-
|
8765 |
-
function findPrevElement (children) {
|
8766 |
-
var i = children.length;
|
8767 |
-
while (i--) {
|
8768 |
-
if (children[i].type === 1) {
|
8769 |
-
return children[i]
|
8770 |
-
} else {
|
8771 |
-
if ("development" !== 'production' && children[i].text !== ' ') {
|
8772 |
-
warn$2(
|
8773 |
-
"text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
|
8774 |
-
"will be ignored."
|
8775 |
-
);
|
8776 |
-
}
|
8777 |
-
children.pop();
|
8778 |
-
}
|
8779 |
-
}
|
8780 |
-
}
|
8781 |
-
|
8782 |
-
function addIfCondition (el, condition) {
|
8783 |
-
if (!el.ifConditions) {
|
8784 |
-
el.ifConditions = [];
|
8785 |
-
}
|
8786 |
-
el.ifConditions.push(condition);
|
8787 |
-
}
|
8788 |
-
|
8789 |
-
function processOnce (el) {
|
8790 |
-
var once$$1 = getAndRemoveAttr(el, 'v-once');
|
8791 |
-
if (once$$1 != null) {
|
8792 |
-
el.once = true;
|
8793 |
-
}
|
8794 |
-
}
|
8795 |
-
|
8796 |
-
function processSlot (el) {
|
8797 |
-
if (el.tag === 'slot') {
|
8798 |
-
el.slotName = getBindingAttr(el, 'name');
|
8799 |
-
if ("development" !== 'production' && el.key) {
|
8800 |
-
warn$2(
|
8801 |
-
"`key` does not work on <slot> because slots are abstract outlets " +
|
8802 |
-
"and can possibly expand into multiple elements. " +
|
8803 |
-
"Use the key on a wrapping element instead."
|
8804 |
-
);
|
8805 |
-
}
|
8806 |
-
} else {
|
8807 |
-
var slotTarget = getBindingAttr(el, 'slot');
|
8808 |
-
if (slotTarget) {
|
8809 |
-
el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
|
8810 |
-
}
|
8811 |
-
if (el.tag === 'template') {
|
8812 |
-
el.slotScope = getAndRemoveAttr(el, 'scope');
|
8813 |
-
}
|
8814 |
-
}
|
8815 |
-
}
|
8816 |
-
|
8817 |
-
function processComponent (el) {
|
8818 |
-
var binding;
|
8819 |
-
if ((binding = getBindingAttr(el, 'is'))) {
|
8820 |
-
el.component = binding;
|
8821 |
-
}
|
8822 |
-
if (getAndRemoveAttr(el, 'inline-template') != null) {
|
8823 |
-
el.inlineTemplate = true;
|
8824 |
-
}
|
8825 |
-
}
|
8826 |
-
|
8827 |
-
function processAttrs (el) {
|
8828 |
-
var list = el.attrsList;
|
8829 |
-
var i, l, name, rawName, value, modifiers, isProp;
|
8830 |
-
for (i = 0, l = list.length; i < l; i++) {
|
8831 |
-
name = rawName = list[i].name;
|
8832 |
-
value = list[i].value;
|
8833 |
-
if (dirRE.test(name)) {
|
8834 |
-
// mark element as dynamic
|
8835 |
-
el.hasBindings = true;
|
8836 |
-
// modifiers
|
8837 |
-
modifiers = parseModifiers(name);
|
8838 |
-
if (modifiers) {
|
8839 |
-
name = name.replace(modifierRE, '');
|
8840 |
-
}
|
8841 |
-
if (bindRE.test(name)) { // v-bind
|
8842 |
-
name = name.replace(bindRE, '');
|
8843 |
-
value = parseFilters(value);
|
8844 |
-
isProp = false;
|
8845 |
-
if (modifiers) {
|
8846 |
-
if (modifiers.prop) {
|
8847 |
-
isProp = true;
|
8848 |
-
name = camelize(name);
|
8849 |
-
if (name === 'innerHtml') { name = 'innerHTML'; }
|
8850 |
-
}
|
8851 |
-
if (modifiers.camel) {
|
8852 |
-
name = camelize(name);
|
8853 |
-
}
|
8854 |
-
if (modifiers.sync) {
|
8855 |
-
addHandler(
|
8856 |
-
el,
|
8857 |
-
("update:" + (camelize(name))),
|
8858 |
-
genAssignmentCode(value, "$event")
|
8859 |
-
);
|
8860 |
-
}
|
8861 |
}
|
8862 |
-
if (!el.component && (
|
8863 |
-
isProp || platformMustUseProp(el.tag, el.attrsMap.type, name)
|
8864 |
-
)) {
|
8865 |
-
addProp(el, name, value);
|
8866 |
-
} else {
|
8867 |
-
addAttr(el, name, value);
|
8868 |
-
}
|
8869 |
-
} else if (onRE.test(name)) { // v-on
|
8870 |
-
name = name.replace(onRE, '');
|
8871 |
-
addHandler(el, name, value, modifiers, false, warn$2);
|
8872 |
-
} else { // normal directives
|
8873 |
-
name = name.replace(dirRE, '');
|
8874 |
-
// parse arg
|
8875 |
-
var argMatch = name.match(argRE);
|
8876 |
-
var arg = argMatch && argMatch[1];
|
8877 |
-
if (arg) {
|
8878 |
-
name = name.slice(0, -(arg.length + 1));
|
8879 |
-
}
|
8880 |
-
addDirective(el, name, rawName, value, arg, modifiers);
|
8881 |
-
if ("development" !== 'production' && name === 'model') {
|
8882 |
-
checkForAliasModel(el, value);
|
8883 |
-
}
|
8884 |
-
}
|
8885 |
-
} else {
|
8886 |
-
// literal attribute
|
8887 |
-
{
|
8888 |
-
var expression = parseText(value, delimiters);
|
8889 |
-
if (expression) {
|
8890 |
-
warn$2(
|
8891 |
-
name + "=\"" + value + "\": " +
|
8892 |
-
'Interpolation inside attributes has been removed. ' +
|
8893 |
-
'Use v-bind or the colon shorthand instead. For example, ' +
|
8894 |
-
'instead of <div id="{{ val }}">, use <div :id="val">.'
|
8895 |
-
);
|
8896 |
-
}
|
8897 |
-
}
|
8898 |
-
addAttr(el, name, JSON.stringify(value));
|
8899 |
-
}
|
8900 |
-
}
|
8901 |
-
}
|
8902 |
-
|
8903 |
-
function checkInFor (el) {
|
8904 |
-
var parent = el;
|
8905 |
-
while (parent) {
|
8906 |
-
if (parent.for !== undefined) {
|
8907 |
-
return true
|
8908 |
-
}
|
8909 |
-
parent = parent.parent;
|
8910 |
-
}
|
8911 |
-
return false
|
8912 |
-
}
|
8913 |
-
|
8914 |
-
function parseModifiers (name) {
|
8915 |
-
var match = name.match(modifierRE);
|
8916 |
-
if (match) {
|
8917 |
-
var ret = {};
|
8918 |
-
match.forEach(function (m) { ret[m.slice(1)] = true; });
|
8919 |
-
return ret
|
8920 |
-
}
|
8921 |
-
}
|
8922 |
-
|
8923 |
-
function makeAttrsMap (attrs) {
|
8924 |
-
var map = {};
|
8925 |
-
for (var i = 0, l = attrs.length; i < l; i++) {
|
8926 |
-
if (
|
8927 |
-
"development" !== 'production' &&
|
8928 |
-
map[attrs[i].name] && !isIE && !isEdge
|
8929 |
-
) {
|
8930 |
-
warn$2('duplicate attribute: ' + attrs[i].name);
|
8931 |
-
}
|
8932 |
-
map[attrs[i].name] = attrs[i].value;
|
8933 |
-
}
|
8934 |
-
return map
|
8935 |
-
}
|
8936 |
-
|
8937 |
-
// for script (e.g. type="x/template") or style, do not decode content
|
8938 |
-
function isTextTag (el) {
|
8939 |
-
return el.tag === 'script' || el.tag === 'style'
|
8940 |
-
}
|
8941 |
-
|
8942 |
-
function isForbiddenTag (el) {
|
8943 |
-
return (
|
8944 |
-
el.tag === 'style' ||
|
8945 |
-
(el.tag === 'script' && (
|
8946 |
-
!el.attrsMap.type ||
|
8947 |
-
el.attrsMap.type === 'text/javascript'
|
8948 |
-
))
|
8949 |
-
)
|
8950 |
-
}
|
8951 |
-
|
8952 |
-
var ieNSBug = /^xmlns:NS\d+/;
|
8953 |
-
var ieNSPrefix = /^NS\d+:/;
|
8954 |
-
|
8955 |
-
/* istanbul ignore next */
|
8956 |
-
function guardIESVGBug (attrs) {
|
8957 |
-
var res = [];
|
8958 |
-
for (var i = 0; i < attrs.length; i++) {
|
8959 |
-
var attr = attrs[i];
|
8960 |
-
if (!ieNSBug.test(attr.name)) {
|
8961 |
-
attr.name = attr.name.replace(ieNSPrefix, '');
|
8962 |
-
res.push(attr);
|
8963 |
-
}
|
8964 |
-
}
|
8965 |
-
return res
|
8966 |
-
}
|
8967 |
-
|
8968 |
-
function checkForAliasModel (el, value) {
|
8969 |
-
var _el = el;
|
8970 |
-
while (_el) {
|
8971 |
-
if (_el.for && _el.alias === value) {
|
8972 |
-
warn$2(
|
8973 |
-
"<" + (el.tag) + " v-model=\"" + value + "\">: " +
|
8974 |
-
"You are binding v-model directly to a v-for iteration alias. " +
|
8975 |
-
"This will not be able to modify the v-for source array because " +
|
8976 |
-
"writing to the alias is like modifying a function local variable. " +
|
8977 |
-
"Consider using an array of objects and use v-model on an object property instead."
|
8978 |
-
);
|
8979 |
-
}
|
8980 |
-
_el = _el.parent;
|
8981 |
-
}
|
8982 |
-
}
|
8983 |
-
|
8984 |
-
/* */
|
8985 |
-
|
8986 |
-
var isStaticKey;
|
8987 |
-
var isPlatformReservedTag;
|
8988 |
-
|
8989 |
-
var genStaticKeysCached = cached(genStaticKeys$1);
|
8990 |
-
|
8991 |
-
/**
|
8992 |
-
* Goal of the optimizer: walk the generated template AST tree
|
8993 |
-
* and detect sub-trees that are purely static, i.e. parts of
|
8994 |
-
* the DOM that never needs to change.
|
8995 |
-
*
|
8996 |
-
* Once we detect these sub-trees, we can:
|
8997 |
-
*
|
8998 |
-
* 1. Hoist them into constants, so that we no longer need to
|
8999 |
-
* create fresh nodes for them on each re-render;
|
9000 |
-
* 2. Completely skip them in the patching process.
|
9001 |
-
*/
|
9002 |
-
function optimize (root, options) {
|
9003 |
-
if (!root) { return }
|
9004 |
-
isStaticKey = genStaticKeysCached(options.staticKeys || '');
|
9005 |
-
isPlatformReservedTag = options.isReservedTag || no;
|
9006 |
-
// first pass: mark all non-static nodes.
|
9007 |
-
markStatic$1(root);
|
9008 |
-
// second pass: mark static roots.
|
9009 |
-
markStaticRoots(root, false);
|
9010 |
-
}
|
9011 |
-
|
9012 |
-
function genStaticKeys$1 (keys) {
|
9013 |
-
return makeMap(
|
9014 |
-
'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +
|
9015 |
-
(keys ? ',' + keys : '')
|
9016 |
-
)
|
9017 |
-
}
|
9018 |
-
|
9019 |
-
function markStatic$1 (node) {
|
9020 |
-
node.static = isStatic(node);
|
9021 |
-
if (node.type === 1) {
|
9022 |
-
// do not make component slot content static. this avoids
|
9023 |
-
// 1. components not able to mutate slot nodes
|
9024 |
-
// 2. static slot content fails for hot-reloading
|
9025 |
-
if (
|
9026 |
-
!isPlatformReservedTag(node.tag) &&
|
9027 |
-
node.tag !== 'slot' &&
|
9028 |
-
node.attrsMap['inline-template'] == null
|
9029 |
-
) {
|
9030 |
-
return
|
9031 |
-
}
|
9032 |
-
for (var i = 0, l = node.children.length; i < l; i++) {
|
9033 |
-
var child = node.children[i];
|
9034 |
-
markStatic$1(child);
|
9035 |
-
if (!child.static) {
|
9036 |
-
node.static = false;
|
9037 |
-
}
|
9038 |
-
}
|
9039 |
-
if (node.ifConditions) {
|
9040 |
-
for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
|
9041 |
-
var block = node.ifConditions[i$1].block;
|
9042 |
-
markStatic$1(block);
|
9043 |
-
if (!block.static) {
|
9044 |
-
node.static = false;
|
9045 |
-
}
|
9046 |
-
}
|
9047 |
-
}
|
9048 |
-
}
|
9049 |
-
}
|
9050 |
-
|
9051 |
-
function markStaticRoots (node, isInFor) {
|
9052 |
-
if (node.type === 1) {
|
9053 |
-
if (node.static || node.once) {
|
9054 |
-
node.staticInFor = isInFor;
|
9055 |
-
}
|
9056 |
-
// For a node to qualify as a static root, it should have children that
|
9057 |
-
// are not just static text. Otherwise the cost of hoisting out will
|
9058 |
-
// outweigh the benefits and it's better off to just always render it fresh.
|
9059 |
-
if (node.static && node.children.length && !(
|
9060 |
-
node.children.length === 1 &&
|
9061 |
-
node.children[0].type === 3
|
9062 |
-
)) {
|
9063 |
-
node.staticRoot = true;
|
9064 |
-
return
|
9065 |
-
} else {
|
9066 |
-
node.staticRoot = false;
|
9067 |
-
}
|
9068 |
-
if (node.children) {
|
9069 |
-
for (var i = 0, l = node.children.length; i < l; i++) {
|
9070 |
-
markStaticRoots(node.children[i], isInFor || !!node.for);
|
9071 |
-
}
|
9072 |
-
}
|
9073 |
-
if (node.ifConditions) {
|
9074 |
-
for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
|
9075 |
-
markStaticRoots(node.ifConditions[i$1].block, isInFor);
|
9076 |
-
}
|
9077 |
-
}
|
9078 |
-
}
|
9079 |
-
}
|
9080 |
-
|
9081 |
-
function isStatic (node) {
|
9082 |
-
if (node.type === 2) { // expression
|
9083 |
-
return false
|
9084 |
-
}
|
9085 |
-
if (node.type === 3) { // text
|
9086 |
-
return true
|
9087 |
-
}
|
9088 |
-
return !!(node.pre || (
|
9089 |
-
!node.hasBindings && // no dynamic bindings
|
9090 |
-
!node.if && !node.for && // not v-if or v-for or v-else
|
9091 |
-
!isBuiltInTag(node.tag) && // not a built-in
|
9092 |
-
isPlatformReservedTag(node.tag) && // not a component
|
9093 |
-
!isDirectChildOfTemplateFor(node) &&
|
9094 |
-
Object.keys(node).every(isStaticKey)
|
9095 |
-
))
|
9096 |
-
}
|
9097 |
-
|
9098 |
-
function isDirectChildOfTemplateFor (node) {
|
9099 |
-
while (node.parent) {
|
9100 |
-
node = node.parent;
|
9101 |
-
if (node.tag !== 'template') {
|
9102 |
-
return false
|
9103 |
-
}
|
9104 |
-
if (node.for) {
|
9105 |
-
return true
|
9106 |
-
}
|
9107 |
-
}
|
9108 |
-
return false
|
9109 |
-
}
|
9110 |
-
|
9111 |
-
/* */
|
9112 |
-
|
9113 |
-
var fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
|
9114 |
-
var simplePathRE = /^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?']|\[".*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*\s*$/;
|
9115 |
-
|
9116 |
-
// keyCode aliases
|
9117 |
-
var keyCodes = {
|
9118 |
-
esc: 27,
|
9119 |
-
tab: 9,
|
9120 |
-
enter: 13,
|
9121 |
-
space: 32,
|
9122 |
-
up: 38,
|
9123 |
-
left: 37,
|
9124 |
-
right: 39,
|
9125 |
-
down: 40,
|
9126 |
-
'delete': [8, 46]
|
9127 |
-
};
|
9128 |
-
|
9129 |
-
// #4868: modifiers that prevent the execution of the listener
|
9130 |
-
// need to explicitly return null so that we can determine whether to remove
|
9131 |
-
// the listener for .once
|
9132 |
-
var genGuard = function (condition) { return ("if(" + condition + ")return null;"); };
|
9133 |
-
|
9134 |
-
var modifierCode = {
|
9135 |
-
stop: '$event.stopPropagation();',
|
9136 |
-
prevent: '$event.preventDefault();',
|
9137 |
-
self: genGuard("$event.target !== $event.currentTarget"),
|
9138 |
-
ctrl: genGuard("!$event.ctrlKey"),
|
9139 |
-
shift: genGuard("!$event.shiftKey"),
|
9140 |
-
alt: genGuard("!$event.altKey"),
|
9141 |
-
meta: genGuard("!$event.metaKey"),
|
9142 |
-
left: genGuard("'button' in $event && $event.button !== 0"),
|
9143 |
-
middle: genGuard("'button' in $event && $event.button !== 1"),
|
9144 |
-
right: genGuard("'button' in $event && $event.button !== 2")
|
9145 |
-
};
|
9146 |
-
|
9147 |
-
function genHandlers (
|
9148 |
-
events,
|
9149 |
-
isNative,
|
9150 |
-
warn
|
9151 |
-
) {
|
9152 |
-
var res = isNative ? 'nativeOn:{' : 'on:{';
|
9153 |
-
for (var name in events) {
|
9154 |
-
var handler = events[name];
|
9155 |
-
// #5330: warn click.right, since right clicks do not actually fire click events.
|
9156 |
-
if ("development" !== 'production' &&
|
9157 |
-
name === 'click' &&
|
9158 |
-
handler && handler.modifiers && handler.modifiers.right
|
9159 |
-
) {
|
9160 |
-
warn(
|
9161 |
-
"Use \"contextmenu\" instead of \"click.right\" since right clicks " +
|
9162 |
-
"do not actually fire \"click\" events."
|
9163 |
-
);
|
9164 |
-
}
|
9165 |
-
res += "\"" + name + "\":" + (genHandler(name, handler)) + ",";
|
9166 |
-
}
|
9167 |
-
return res.slice(0, -1) + '}'
|
9168 |
-
}
|
9169 |
-
|
9170 |
-
function genHandler (
|
9171 |
-
name,
|
9172 |
-
handler
|
9173 |
-
) {
|
9174 |
-
if (!handler) {
|
9175 |
-
return 'function(){}'
|
9176 |
-
}
|
9177 |
-
|
9178 |
-
if (Array.isArray(handler)) {
|
9179 |
-
return ("[" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + "]")
|
9180 |
-
}
|
9181 |
-
|
9182 |
-
var isMethodPath = simplePathRE.test(handler.value);
|
9183 |
-
var isFunctionExpression = fnExpRE.test(handler.value);
|
9184 |
-
|
9185 |
-
if (!handler.modifiers) {
|
9186 |
-
return isMethodPath || isFunctionExpression
|
9187 |
-
? handler.value
|
9188 |
-
: ("function($event){" + (handler.value) + "}") // inline statement
|
9189 |
-
} else {
|
9190 |
-
var code = '';
|
9191 |
-
var genModifierCode = '';
|
9192 |
-
var keys = [];
|
9193 |
-
for (var key in handler.modifiers) {
|
9194 |
-
if (modifierCode[key]) {
|
9195 |
-
genModifierCode += modifierCode[key];
|
9196 |
-
// left/right
|
9197 |
-
if (keyCodes[key]) {
|
9198 |
-
keys.push(key);
|
9199 |
-
}
|
9200 |
-
} else {
|
9201 |
-
keys.push(key);
|
9202 |
-
}
|
9203 |
-
}
|
9204 |
-
if (keys.length) {
|
9205 |
-
code += genKeyFilter(keys);
|
9206 |
-
}
|
9207 |
-
// Make sure modifiers like prevent and stop get executed after key filtering
|
9208 |
-
if (genModifierCode) {
|
9209 |
-
code += genModifierCode;
|
9210 |
-
}
|
9211 |
-
var handlerCode = isMethodPath
|
9212 |
-
? handler.value + '($event)'
|
9213 |
-
: isFunctionExpression
|
9214 |
-
? ("(" + (handler.value) + ")($event)")
|
9215 |
-
: handler.value;
|
9216 |
-
return ("function($event){" + code + handlerCode + "}")
|
9217 |
-
}
|
9218 |
-
}
|
9219 |
-
|
9220 |
-
function genKeyFilter (keys) {
|
9221 |
-
return ("if(!('button' in $event)&&" + (keys.map(genFilterCode).join('&&')) + ")return null;")
|
9222 |
-
}
|
9223 |
-
|
9224 |
-
function genFilterCode (key) {
|
9225 |
-
var keyVal = parseInt(key, 10);
|
9226 |
-
if (keyVal) {
|
9227 |
-
return ("$event.keyCode!==" + keyVal)
|
9228 |
-
}
|
9229 |
-
var alias = keyCodes[key];
|
9230 |
-
return ("_k($event.keyCode," + (JSON.stringify(key)) + (alias ? ',' + JSON.stringify(alias) : '') + ")")
|
9231 |
-
}
|
9232 |
-
|
9233 |
-
/* */
|
9234 |
-
|
9235 |
-
function on (el, dir) {
|
9236 |
-
if ("development" !== 'production' && dir.modifiers) {
|
9237 |
-
warn("v-on without argument does not support modifiers.");
|
9238 |
-
}
|
9239 |
-
el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); };
|
9240 |
-
}
|
9241 |
-
|
9242 |
-
/* */
|
9243 |
-
|
9244 |
-
function bind$1 (el, dir) {
|
9245 |
-
el.wrapData = function (code) {
|
9246 |
-
return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")")
|
9247 |
-
};
|
9248 |
-
}
|
9249 |
-
|
9250 |
-
/* */
|
9251 |
-
|
9252 |
-
var baseDirectives = {
|
9253 |
-
on: on,
|
9254 |
-
bind: bind$1,
|
9255 |
-
cloak: noop
|
9256 |
-
};
|
9257 |
-
|
9258 |
-
/* */
|
9259 |
-
|
9260 |
-
var CodegenState = function CodegenState (options) {
|
9261 |
-
this.options = options;
|
9262 |
-
this.warn = options.warn || baseWarn;
|
9263 |
-
this.transforms = pluckModuleFunction(options.modules, 'transformCode');
|
9264 |
-
this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
|
9265 |
-
this.directives = extend(extend({}, baseDirectives), options.directives);
|
9266 |
-
var isReservedTag = options.isReservedTag || no;
|
9267 |
-
this.maybeComponent = function (el) { return !isReservedTag(el.tag); };
|
9268 |
-
this.onceId = 0;
|
9269 |
-
this.staticRenderFns = [];
|
9270 |
-
};
|
9271 |
-
|
9272 |
-
|
9273 |
-
|
9274 |
-
function generate (
|
9275 |
-
ast,
|
9276 |
-
options
|
9277 |
-
) {
|
9278 |
-
var state = new CodegenState(options);
|
9279 |
-
var code = ast ? genElement(ast, state) : '_c("div")';
|
9280 |
-
return {
|
9281 |
-
render: ("with(this){return " + code + "}"),
|
9282 |
-
staticRenderFns: state.staticRenderFns
|
9283 |
-
}
|
9284 |
-
}
|
9285 |
-
|
9286 |
-
function genElement (el, state) {
|
9287 |
-
if (el.staticRoot && !el.staticProcessed) {
|
9288 |
-
return genStatic(el, state)
|
9289 |
-
} else if (el.once && !el.onceProcessed) {
|
9290 |
-
return genOnce(el, state)
|
9291 |
-
} else if (el.for && !el.forProcessed) {
|
9292 |
-
return genFor(el, state)
|
9293 |
-
} else if (el.if && !el.ifProcessed) {
|
9294 |
-
return genIf(el, state)
|
9295 |
-
} else if (el.tag === 'template' && !el.slotTarget) {
|
9296 |
-
return genChildren(el, state) || 'void 0'
|
9297 |
-
} else if (el.tag === 'slot') {
|
9298 |
-
return genSlot(el, state)
|
9299 |
-
} else {
|
9300 |
-
// component or element
|
9301 |
-
var code;
|
9302 |
-
if (el.component) {
|
9303 |
-
code = genComponent(el.component, el, state);
|
9304 |
-
} else {
|
9305 |
-
var data = el.plain ? undefined : genData$2(el, state);
|
9306 |
-
|
9307 |
-
var children = el.inlineTemplate ? null : genChildren(el, state, true);
|
9308 |
-
code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
|
9309 |
-
}
|
9310 |
-
// module transforms
|
9311 |
-
for (var i = 0; i < state.transforms.length; i++) {
|
9312 |
-
code = state.transforms[i](el, code);
|
9313 |
-
}
|
9314 |
-
return code
|
9315 |
-
}
|
9316 |
-
}
|
9317 |
-
|
9318 |
-
// hoist static sub-trees out
|
9319 |
-
function genStatic (el, state) {
|
9320 |
-
el.staticProcessed = true;
|
9321 |
-
state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}"));
|
9322 |
-
return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
|
9323 |
-
}
|
9324 |
-
|
9325 |
-
// v-once
|
9326 |
-
function genOnce (el, state) {
|
9327 |
-
el.onceProcessed = true;
|
9328 |
-
if (el.if && !el.ifProcessed) {
|
9329 |
-
return genIf(el, state)
|
9330 |
-
} else if (el.staticInFor) {
|
9331 |
-
var key = '';
|
9332 |
-
var parent = el.parent;
|
9333 |
-
while (parent) {
|
9334 |
-
if (parent.for) {
|
9335 |
-
key = parent.key;
|
9336 |
-
break
|
9337 |
-
}
|
9338 |
-
parent = parent.parent;
|
9339 |
-
}
|
9340 |
-
if (!key) {
|
9341 |
-
"development" !== 'production' && state.warn(
|
9342 |
-
"v-once can only be used inside v-for that is keyed. "
|
9343 |
-
);
|
9344 |
-
return genElement(el, state)
|
9345 |
-
}
|
9346 |
-
return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + (key ? ("," + key) : "") + ")")
|
9347 |
-
} else {
|
9348 |
-
return genStatic(el, state)
|
9349 |
-
}
|
9350 |
-
}
|
9351 |
-
|
9352 |
-
function genIf (
|
9353 |
-
el,
|
9354 |
-
state,
|
9355 |
-
altGen,
|
9356 |
-
altEmpty
|
9357 |
-
) {
|
9358 |
-
el.ifProcessed = true; // avoid recursion
|
9359 |
-
return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)
|
9360 |
-
}
|
9361 |
-
|
9362 |
-
function genIfConditions (
|
9363 |
-
conditions,
|
9364 |
-
state,
|
9365 |
-
altGen,
|
9366 |
-
altEmpty
|
9367 |
-
) {
|
9368 |
-
if (!conditions.length) {
|
9369 |
-
return altEmpty || '_e()'
|
9370 |
-
}
|
9371 |
-
|
9372 |
-
var condition = conditions.shift();
|
9373 |
-
if (condition.exp) {
|
9374 |
-
return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty)))
|
9375 |
-
} else {
|
9376 |
-
return ("" + (genTernaryExp(condition.block)))
|
9377 |
-
}
|
9378 |
-
|
9379 |
-
// v-if with v-once should generate code like (a)?_m(0):_m(1)
|
9380 |
-
function genTernaryExp (el) {
|
9381 |
-
return altGen
|
9382 |
-
? altGen(el, state)
|
9383 |
-
: el.once
|
9384 |
-
? genOnce(el, state)
|
9385 |
-
: genElement(el, state)
|
9386 |
-
}
|
9387 |
-
}
|
9388 |
-
|
9389 |
-
function genFor (
|
9390 |
-
el,
|
9391 |
-
state,
|
9392 |
-
altGen,
|
9393 |
-
altHelper
|
9394 |
-
) {
|
9395 |
-
var exp = el.for;
|
9396 |
-
var alias = el.alias;
|
9397 |
-
var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
|
9398 |
-
var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
|
9399 |
-
|
9400 |
-
if ("development" !== 'production' &&
|
9401 |
-
state.maybeComponent(el) &&
|
9402 |
-
el.tag !== 'slot' &&
|
9403 |
-
el.tag !== 'template' &&
|
9404 |
-
!el.key
|
9405 |
-
) {
|
9406 |
-
state.warn(
|
9407 |
-
"<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " +
|
9408 |
-
"v-for should have explicit keys. " +
|
9409 |
-
"See https://vuejs.org/guide/list.html#key for more info.",
|
9410 |
-
true /* tip */
|
9411 |
-
);
|
9412 |
-
}
|
9413 |
-
|
9414 |
-
el.forProcessed = true; // avoid recursion
|
9415 |
-
return (altHelper || '_l') + "((" + exp + ")," +
|
9416 |
-
"function(" + alias + iterator1 + iterator2 + "){" +
|
9417 |
-
"return " + ((altGen || genElement)(el, state)) +
|
9418 |
-
'})'
|
9419 |
-
}
|
9420 |
-
|
9421 |
-
function genData$2 (el, state) {
|
9422 |
-
var data = '{';
|
9423 |
-
|
9424 |
-
// directives first.
|
9425 |
-
// directives may mutate the el's other properties before they are generated.
|
9426 |
-
var dirs = genDirectives(el, state);
|
9427 |
-
if (dirs) { data += dirs + ','; }
|
9428 |
-
|
9429 |
-
// key
|
9430 |
-
if (el.key) {
|
9431 |
-
data += "key:" + (el.key) + ",";
|
9432 |
-
}
|
9433 |
-
// ref
|
9434 |
-
if (el.ref) {
|
9435 |
-
data += "ref:" + (el.ref) + ",";
|
9436 |
-
}
|
9437 |
-
if (el.refInFor) {
|
9438 |
-
data += "refInFor:true,";
|
9439 |
-
}
|
9440 |
-
// pre
|
9441 |
-
if (el.pre) {
|
9442 |
-
data += "pre:true,";
|
9443 |
-
}
|
9444 |
-
// record original tag name for components using "is" attribute
|
9445 |
-
if (el.component) {
|
9446 |
-
data += "tag:\"" + (el.tag) + "\",";
|
9447 |
-
}
|
9448 |
-
// module data generation functions
|
9449 |
-
for (var i = 0; i < state.dataGenFns.length; i++) {
|
9450 |
-
data += state.dataGenFns[i](el);
|
9451 |
-
}
|
9452 |
-
// attributes
|
9453 |
-
if (el.attrs) {
|
9454 |
-
data += "attrs:{" + (genProps(el.attrs)) + "},";
|
9455 |
-
}
|
9456 |
-
// DOM props
|
9457 |
-
if (el.props) {
|
9458 |
-
data += "domProps:{" + (genProps(el.props)) + "},";
|
9459 |
-
}
|
9460 |
-
// event handlers
|
9461 |
-
if (el.events) {
|
9462 |
-
data += (genHandlers(el.events, false, state.warn)) + ",";
|
9463 |
-
}
|
9464 |
-
if (el.nativeEvents) {
|
9465 |
-
data += (genHandlers(el.nativeEvents, true, state.warn)) + ",";
|
9466 |
-
}
|
9467 |
-
// slot target
|
9468 |
-
if (el.slotTarget) {
|
9469 |
-
data += "slot:" + (el.slotTarget) + ",";
|
9470 |
-
}
|
9471 |
-
// scoped slots
|
9472 |
-
if (el.scopedSlots) {
|
9473 |
-
data += (genScopedSlots(el.scopedSlots, state)) + ",";
|
9474 |
-
}
|
9475 |
-
// component v-model
|
9476 |
-
if (el.model) {
|
9477 |
-
data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},";
|
9478 |
-
}
|
9479 |
-
// inline-template
|
9480 |
-
if (el.inlineTemplate) {
|
9481 |
-
var inlineTemplate = genInlineTemplate(el, state);
|
9482 |
-
if (inlineTemplate) {
|
9483 |
-
data += inlineTemplate + ",";
|
9484 |
-
}
|
9485 |
-
}
|
9486 |
-
data = data.replace(/,$/, '') + '}';
|
9487 |
-
// v-bind data wrap
|
9488 |
-
if (el.wrapData) {
|
9489 |
-
data = el.wrapData(data);
|
9490 |
-
}
|
9491 |
-
// v-on data wrap
|
9492 |
-
if (el.wrapListeners) {
|
9493 |
-
data = el.wrapListeners(data);
|
9494 |
-
}
|
9495 |
-
return data
|
9496 |
-
}
|
9497 |
-
|
9498 |
-
function genDirectives (el, state) {
|
9499 |
-
var dirs = el.directives;
|
9500 |
-
if (!dirs) { return }
|
9501 |
-
var res = 'directives:[';
|
9502 |
-
var hasRuntime = false;
|
9503 |
-
var i, l, dir, needRuntime;
|
9504 |
-
for (i = 0, l = dirs.length; i < l; i++) {
|
9505 |
-
dir = dirs[i];
|
9506 |
-
needRuntime = true;
|
9507 |
-
var gen = state.directives[dir.name];
|
9508 |
-
if (gen) {
|
9509 |
-
// compile-time directive that manipulates AST.
|
9510 |
-
// returns true if it also needs a runtime counterpart.
|
9511 |
-
needRuntime = !!gen(el, dir, state.warn);
|
9512 |
-
}
|
9513 |
-
if (needRuntime) {
|
9514 |
-
hasRuntime = true;
|
9515 |
-
res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:\"" + (dir.arg) + "\"") : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
|
9516 |
-
}
|
9517 |
-
}
|
9518 |
-
if (hasRuntime) {
|
9519 |
-
return res.slice(0, -1) + ']'
|
9520 |
-
}
|
9521 |
-
}
|
9522 |
-
|
9523 |
-
function genInlineTemplate (el, state) {
|
9524 |
-
var ast = el.children[0];
|
9525 |
-
if ("development" !== 'production' && (
|
9526 |
-
el.children.length > 1 || ast.type !== 1
|
9527 |
-
)) {
|
9528 |
-
state.warn('Inline-template components must have exactly one child element.');
|
9529 |
-
}
|
9530 |
-
if (ast.type === 1) {
|
9531 |
-
var inlineRenderFns = generate(ast, state.options);
|
9532 |
-
return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
|
9533 |
-
}
|
9534 |
-
}
|
9535 |
-
|
9536 |
-
function genScopedSlots (
|
9537 |
-
slots,
|
9538 |
-
state
|
9539 |
-
) {
|
9540 |
-
return ("scopedSlots:_u([" + (Object.keys(slots).map(function (key) {
|
9541 |
-
return genScopedSlot(key, slots[key], state)
|
9542 |
-
}).join(',')) + "])")
|
9543 |
-
}
|
9544 |
-
|
9545 |
-
function genScopedSlot (
|
9546 |
-
key,
|
9547 |
-
el,
|
9548 |
-
state
|
9549 |
-
) {
|
9550 |
-
if (el.for && !el.forProcessed) {
|
9551 |
-
return genForScopedSlot(key, el, state)
|
9552 |
-
}
|
9553 |
-
return "{key:" + key + ",fn:function(" + (String(el.attrsMap.scope)) + "){" +
|
9554 |
-
"return " + (el.tag === 'template'
|
9555 |
-
? genChildren(el, state) || 'void 0'
|
9556 |
-
: genElement(el, state)) + "}}"
|
9557 |
-
}
|
9558 |
-
|
9559 |
-
function genForScopedSlot (
|
9560 |
-
key,
|
9561 |
-
el,
|
9562 |
-
state
|
9563 |
-
) {
|
9564 |
-
var exp = el.for;
|
9565 |
-
var alias = el.alias;
|
9566 |
-
var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
|
9567 |
-
var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
|
9568 |
-
el.forProcessed = true; // avoid recursion
|
9569 |
-
return "_l((" + exp + ")," +
|
9570 |
-
"function(" + alias + iterator1 + iterator2 + "){" +
|
9571 |
-
"return " + (genScopedSlot(key, el, state)) +
|
9572 |
-
'})'
|
9573 |
-
}
|
9574 |
-
|
9575 |
-
function genChildren (
|
9576 |
-
el,
|
9577 |
-
state,
|
9578 |
-
checkSkip,
|
9579 |
-
altGenElement,
|
9580 |
-
altGenNode
|
9581 |
-
) {
|
9582 |
-
var children = el.children;
|
9583 |
-
if (children.length) {
|
9584 |
-
var el$1 = children[0];
|
9585 |
-
// optimize single v-for
|
9586 |
-
if (children.length === 1 &&
|
9587 |
-
el$1.for &&
|
9588 |
-
el$1.tag !== 'template' &&
|
9589 |
-
el$1.tag !== 'slot'
|
9590 |
-
) {
|
9591 |
-
return (altGenElement || genElement)(el$1, state)
|
9592 |
-
}
|
9593 |
-
var normalizationType = checkSkip
|
9594 |
-
? getNormalizationType(children, state.maybeComponent)
|
9595 |
-
: 0;
|
9596 |
-
var gen = altGenNode || genNode;
|
9597 |
-
return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType ? ("," + normalizationType) : ''))
|
9598 |
-
}
|
9599 |
-
}
|
9600 |
-
|
9601 |
-
// determine the normalization needed for the children array.
|
9602 |
-
// 0: no normalization needed
|
9603 |
-
// 1: simple normalization needed (possible 1-level deep nested array)
|
9604 |
-
// 2: full normalization needed
|
9605 |
-
function getNormalizationType (
|
9606 |
-
children,
|
9607 |
-
maybeComponent
|
9608 |
-
) {
|
9609 |
-
var res = 0;
|
9610 |
-
for (var i = 0; i < children.length; i++) {
|
9611 |
-
var el = children[i];
|
9612 |
-
if (el.type !== 1) {
|
9613 |
-
continue
|
9614 |
-
}
|
9615 |
-
if (needsNormalization(el) ||
|
9616 |
-
(el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
|
9617 |
-
res = 2;
|
9618 |
-
break
|
9619 |
-
}
|
9620 |
-
if (maybeComponent(el) ||
|
9621 |
-
(el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
|
9622 |
-
res = 1;
|
9623 |
-
}
|
9624 |
-
}
|
9625 |
-
return res
|
9626 |
-
}
|
9627 |
-
|
9628 |
-
function needsNormalization (el) {
|
9629 |
-
return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
|
9630 |
-
}
|
9631 |
-
|
9632 |
-
function genNode (node, state) {
|
9633 |
-
if (node.type === 1) {
|
9634 |
-
return genElement(node, state)
|
9635 |
-
} if (node.type === 3 && node.isComment) {
|
9636 |
-
return genComment(node)
|
9637 |
-
} else {
|
9638 |
-
return genText(node)
|
9639 |
-
}
|
9640 |
-
}
|
9641 |
-
|
9642 |
-
function genText (text) {
|
9643 |
-
return ("_v(" + (text.type === 2
|
9644 |
-
? text.expression // no need for () because already wrapped in _s()
|
9645 |
-
: transformSpecialNewlines(JSON.stringify(text.text))) + ")")
|
9646 |
-
}
|
9647 |
-
|
9648 |
-
function genComment (comment) {
|
9649 |
-
return ("_e('" + (comment.text) + "')")
|
9650 |
-
}
|
9651 |
-
|
9652 |
-
function genSlot (el, state) {
|
9653 |
-
var slotName = el.slotName || '"default"';
|
9654 |
-
var children = genChildren(el, state);
|
9655 |
-
var res = "_t(" + slotName + (children ? ("," + children) : '');
|
9656 |
-
var attrs = el.attrs && ("{" + (el.attrs.map(function (a) { return ((camelize(a.name)) + ":" + (a.value)); }).join(',')) + "}");
|
9657 |
-
var bind$$1 = el.attrsMap['v-bind'];
|
9658 |
-
if ((attrs || bind$$1) && !children) {
|
9659 |
-
res += ",null";
|
9660 |
-
}
|
9661 |
-
if (attrs) {
|
9662 |
-
res += "," + attrs;
|
9663 |
-
}
|
9664 |
-
if (bind$$1) {
|
9665 |
-
res += (attrs ? '' : ',null') + "," + bind$$1;
|
9666 |
-
}
|
9667 |
-
return res + ')'
|
9668 |
-
}
|
9669 |
-
|
9670 |
-
// componentName is el.component, take it as argument to shun flow's pessimistic refinement
|
9671 |
-
function genComponent (
|
9672 |
-
componentName,
|
9673 |
-
el,
|
9674 |
-
state
|
9675 |
-
) {
|
9676 |
-
var children = el.inlineTemplate ? null : genChildren(el, state, true);
|
9677 |
-
return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")")
|
9678 |
-
}
|
9679 |
-
|
9680 |
-
function genProps (props) {
|
9681 |
-
var res = '';
|
9682 |
-
for (var i = 0; i < props.length; i++) {
|
9683 |
-
var prop = props[i];
|
9684 |
-
res += "\"" + (prop.name) + "\":" + (transformSpecialNewlines(prop.value)) + ",";
|
9685 |
-
}
|
9686 |
-
return res.slice(0, -1)
|
9687 |
-
}
|
9688 |
-
|
9689 |
-
// #3895, #4268
|
9690 |
-
function transformSpecialNewlines (text) {
|
9691 |
-
return text
|
9692 |
-
.replace(/\u2028/g, '\\u2028')
|
9693 |
-
.replace(/\u2029/g, '\\u2029')
|
9694 |
-
}
|
9695 |
-
|
9696 |
-
/* */
|
9697 |
-
|
9698 |
-
// these keywords should not appear inside expressions, but operators like
|
9699 |
-
// typeof, instanceof and in are allowed
|
9700 |
-
var prohibitedKeywordRE = new RegExp('\\b' + (
|
9701 |
-
'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
|
9702 |
-
'super,throw,while,yield,delete,export,import,return,switch,default,' +
|
9703 |
-
'extends,finally,continue,debugger,function,arguments'
|
9704 |
-
).split(',').join('\\b|\\b') + '\\b');
|
9705 |
-
|
9706 |
-
// these unary operators should not be used as property/method names
|
9707 |
-
var unaryOperatorsRE = new RegExp('\\b' + (
|
9708 |
-
'delete,typeof,void'
|
9709 |
-
).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
|
9710 |
-
|
9711 |
-
// check valid identifier for v-for
|
9712 |
-
var identRE = /[A-Za-z_$][\w$]*/;
|
9713 |
-
|
9714 |
-
// strip strings in expressions
|
9715 |
-
var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
|
9716 |
-
|
9717 |
-
// detect problematic expressions in a template
|
9718 |
-
function detectErrors (ast) {
|
9719 |
-
var errors = [];
|
9720 |
-
if (ast) {
|
9721 |
-
checkNode(ast, errors);
|
9722 |
-
}
|
9723 |
-
return errors
|
9724 |
-
}
|
9725 |
-
|
9726 |
-
function checkNode (node, errors) {
|
9727 |
-
if (node.type === 1) {
|
9728 |
-
for (var name in node.attrsMap) {
|
9729 |
-
if (dirRE.test(name)) {
|
9730 |
-
var value = node.attrsMap[name];
|
9731 |
-
if (value) {
|
9732 |
-
if (name === 'v-for') {
|
9733 |
-
checkFor(node, ("v-for=\"" + value + "\""), errors);
|
9734 |
-
} else if (onRE.test(name)) {
|
9735 |
-
checkEvent(value, (name + "=\"" + value + "\""), errors);
|
9736 |
-
} else {
|
9737 |
-
checkExpression(value, (name + "=\"" + value + "\""), errors);
|
9738 |
-
}
|
9739 |
-
}
|
9740 |
-
}
|
9741 |
-
}
|
9742 |
-
if (node.children) {
|
9743 |
-
for (var i = 0; i < node.children.length; i++) {
|
9744 |
-
checkNode(node.children[i], errors);
|
9745 |
-
}
|
9746 |
-
}
|
9747 |
-
} else if (node.type === 2) {
|
9748 |
-
checkExpression(node.expression, node.text, errors);
|
9749 |
-
}
|
9750 |
-
}
|
9751 |
-
|
9752 |
-
function checkEvent (exp, text, errors) {
|
9753 |
-
var stipped = exp.replace(stripStringRE, '');
|
9754 |
-
var keywordMatch = stipped.match(unaryOperatorsRE);
|
9755 |
-
if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {
|
9756 |
-
errors.push(
|
9757 |
-
"avoid using JavaScript unary operator as property name: " +
|
9758 |
-
"\"" + (keywordMatch[0]) + "\" in expression " + (text.trim())
|
9759 |
-
);
|
9760 |
-
}
|
9761 |
-
checkExpression(exp, text, errors);
|
9762 |
-
}
|
9763 |
-
|
9764 |
-
function checkFor (node, text, errors) {
|
9765 |
-
checkExpression(node.for || '', text, errors);
|
9766 |
-
checkIdentifier(node.alias, 'v-for alias', text, errors);
|
9767 |
-
checkIdentifier(node.iterator1, 'v-for iterator', text, errors);
|
9768 |
-
checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
|
9769 |
-
}
|
9770 |
-
|
9771 |
-
function checkIdentifier (ident, type, text, errors) {
|
9772 |
-
if (typeof ident === 'string' && !identRE.test(ident)) {
|
9773 |
-
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())));
|
9774 |
-
}
|
9775 |
-
}
|
9776 |
-
|
9777 |
-
function checkExpression (exp, text, errors) {
|
9778 |
-
try {
|
9779 |
-
new Function(("return " + exp));
|
9780 |
-
} catch (e) {
|
9781 |
-
var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
|
9782 |
-
if (keywordMatch) {
|
9783 |
-
errors.push(
|
9784 |
-
"avoid using JavaScript keyword as property name: " +
|
9785 |
-
"\"" + (keywordMatch[0]) + "\" in expression " + (text.trim())
|
9786 |
-
);
|
9787 |
-
} else {
|
9788 |
-
errors.push(("invalid expression: " + (text.trim())));
|
9789 |
}
|
9790 |
-
}
|
9791 |
-
}
|
9792 |
|
9793 |
-
/* */
|
9794 |
|
9795 |
-
function
|
9796 |
-
|
9797 |
-
|
9798 |
-
|
9799 |
-
|
9800 |
-
|
9801 |
-
|
9802 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9803 |
|
9804 |
-
|
9805 |
-
|
|
|
|
|
|
|
|
|
9806 |
|
9807 |
-
|
9808 |
-
template,
|
9809 |
-
options,
|
9810 |
-
vm
|
9811 |
-
) {
|
9812 |
-
options = options || {};
|
9813 |
|
9814 |
-
|
9815 |
-
|
9816 |
-
|
9817 |
-
|
9818 |
-
|
9819 |
-
|
9820 |
-
|
9821 |
-
|
9822 |
-
|
9823 |
-
|
9824 |
-
|
9825 |
-
|
9826 |
-
|
9827 |
-
|
9828 |
-
|
9829 |
-
|
9830 |
-
|
9831 |
-
|
9832 |
-
// check cache
|
9833 |
-
var key = options.delimiters
|
9834 |
-
? String(options.delimiters) + template
|
9835 |
-
: template;
|
9836 |
-
if (cache[key]) {
|
9837 |
-
return cache[key]
|
9838 |
-
}
|
9839 |
-
|
9840 |
-
// compile
|
9841 |
-
var compiled = compile(template, options);
|
9842 |
-
|
9843 |
-
// check compilation errors/tips
|
9844 |
-
{
|
9845 |
-
if (compiled.errors && compiled.errors.length) {
|
9846 |
-
warn(
|
9847 |
-
"Error compiling template:\n\n" + template + "\n\n" +
|
9848 |
-
compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n',
|
9849 |
-
vm
|
9850 |
-
);
|
9851 |
-
}
|
9852 |
-
if (compiled.tips && compiled.tips.length) {
|
9853 |
-
compiled.tips.forEach(function (msg) { return tip(msg, vm); });
|
9854 |
-
}
|
9855 |
-
}
|
9856 |
-
|
9857 |
-
// turn code into functions
|
9858 |
-
var res = {};
|
9859 |
-
var fnGenErrors = [];
|
9860 |
-
res.render = createFunction(compiled.render, fnGenErrors);
|
9861 |
-
res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
|
9862 |
-
return createFunction(code, fnGenErrors)
|
9863 |
});
|
9864 |
|
9865 |
-
|
9866 |
-
|
9867 |
-
|
9868 |
-
|
9869 |
-
|
9870 |
-
|
9871 |
-
|
9872 |
-
|
9873 |
-
|
9874 |
-
|
9875 |
-
|
9876 |
-
|
9877 |
-
|
9878 |
-
|
9879 |
-
vm
|
9880 |
-
);
|
9881 |
-
}
|
9882 |
}
|
9883 |
|
9884 |
-
|
9885 |
-
|
9886 |
-
|
|
|
9887 |
|
9888 |
-
/* */
|
|
|
|
|
|
|
|
|
|
|
9889 |
|
9890 |
-
|
9891 |
-
|
9892 |
-
|
9893 |
-
|
9894 |
-
options
|
9895 |
) {
|
9896 |
-
|
9897 |
-
var errors = [];
|
9898 |
-
var tips = [];
|
9899 |
-
finalOptions.warn = function (msg, tip) {
|
9900 |
-
(tip ? tips : errors).push(msg);
|
9901 |
-
};
|
9902 |
-
|
9903 |
-
if (options) {
|
9904 |
-
// merge custom modules
|
9905 |
-
if (options.modules) {
|
9906 |
-
finalOptions.modules =
|
9907 |
-
(baseOptions.modules || []).concat(options.modules);
|
9908 |
-
}
|
9909 |
-
// merge custom directives
|
9910 |
-
if (options.directives) {
|
9911 |
-
finalOptions.directives = extend(
|
9912 |
-
Object.create(baseOptions.directives),
|
9913 |
-
options.directives
|
9914 |
-
);
|
9915 |
-
}
|
9916 |
-
// copy other options
|
9917 |
-
for (var key in options) {
|
9918 |
-
if (key !== 'modules' && key !== 'directives') {
|
9919 |
-
finalOptions[key] = options[key];
|
9920 |
-
}
|
9921 |
-
}
|
9922 |
-
}
|
9923 |
-
|
9924 |
-
var compiled = baseCompile(template, finalOptions);
|
9925 |
-
{
|
9926 |
-
errors.push.apply(errors, detectErrors(compiled.ast));
|
9927 |
-
}
|
9928 |
-
compiled.errors = errors;
|
9929 |
-
compiled.tips = tips;
|
9930 |
-
return compiled
|
9931 |
-
}
|
9932 |
-
|
9933 |
-
return {
|
9934 |
-
compile: compile,
|
9935 |
-
compileToFunctions: createCompileToFunctionFn(compile)
|
9936 |
-
}
|
9937 |
-
}
|
9938 |
-
}
|
9939 |
-
|
9940 |
-
/* */
|
9941 |
-
|
9942 |
-
// `createCompilerCreator` allows creating compilers that use alternative
|
9943 |
-
// parser/optimizer/codegen, e.g the SSR optimizing compiler.
|
9944 |
-
// Here we just export a default compiler using the default parts.
|
9945 |
-
var createCompiler = createCompilerCreator(function baseCompile (
|
9946 |
-
template,
|
9947 |
-
options
|
9948 |
-
) {
|
9949 |
-
var ast = parse(template.trim(), options);
|
9950 |
-
optimize(ast, options);
|
9951 |
-
var code = generate(ast, options);
|
9952 |
-
return {
|
9953 |
-
ast: ast,
|
9954 |
-
render: code.render,
|
9955 |
-
staticRenderFns: code.staticRenderFns
|
9956 |
-
}
|
9957 |
-
});
|
9958 |
-
|
9959 |
-
/* */
|
9960 |
-
|
9961 |
-
var ref$1 = createCompiler(baseOptions);
|
9962 |
-
var compileToFunctions = ref$1.compileToFunctions;
|
9963 |
-
|
9964 |
-
/* */
|
9965 |
-
|
9966 |
-
var idToTemplate = cached(function (id) {
|
9967 |
-
var el = query(id);
|
9968 |
-
return el && el.innerHTML
|
9969 |
-
});
|
9970 |
-
|
9971 |
-
var mount = Vue$3.prototype.$mount;
|
9972 |
-
Vue$3.prototype.$mount = function (
|
9973 |
-
el,
|
9974 |
-
hydrating
|
9975 |
-
) {
|
9976 |
-
el = el && query(el);
|
9977 |
|
9978 |
-
|
9979 |
-
|
9980 |
-
"development" !== 'production' && warn(
|
9981 |
-
"Do not mount Vue to <html> or <body> - mount to normal elements instead."
|
9982 |
-
);
|
9983 |
-
return this
|
9984 |
-
}
|
9985 |
-
|
9986 |
-
var options = this.$options;
|
9987 |
-
// resolve template/el and convert to render function
|
9988 |
-
if (!options.render) {
|
9989 |
-
var template = options.template;
|
9990 |
-
if (template) {
|
9991 |
-
if (typeof template === 'string') {
|
9992 |
-
if (template.charAt(0) === '#') {
|
9993 |
-
template = idToTemplate(template);
|
9994 |
-
/* istanbul ignore if */
|
9995 |
-
if ("development" !== 'production' && !template) {
|
9996 |
warn(
|
9997 |
-
|
9998 |
-
this
|
9999 |
);
|
10000 |
-
|
10001 |
}
|
10002 |
-
|
10003 |
-
|
10004 |
-
|
10005 |
-
{
|
10006 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10007 |
}
|
10008 |
-
return this
|
10009 |
-
|
10010 |
-
} else if (el) {
|
10011 |
-
template = getOuterHTML(el);
|
10012 |
-
}
|
10013 |
-
if (template) {
|
10014 |
-
/* istanbul ignore if */
|
10015 |
-
if ("development" !== 'production' && config.performance && mark) {
|
10016 |
-
mark('compile');
|
10017 |
-
}
|
10018 |
-
|
10019 |
-
var ref = compileToFunctions(template, {
|
10020 |
-
shouldDecodeNewlines: shouldDecodeNewlines,
|
10021 |
-
delimiters: options.delimiters,
|
10022 |
-
comments: options.comments
|
10023 |
-
}, this);
|
10024 |
-
var render = ref.render;
|
10025 |
-
var staticRenderFns = ref.staticRenderFns;
|
10026 |
-
options.render = render;
|
10027 |
-
options.staticRenderFns = staticRenderFns;
|
10028 |
|
10029 |
-
|
10030 |
-
|
10031 |
-
|
10032 |
-
|
10033 |
-
|
10034 |
-
|
10035 |
-
|
10036 |
-
|
10037 |
-
|
10038 |
-
|
10039 |
-
|
10040 |
-
|
10041 |
-
|
10042 |
-
*/
|
10043 |
-
function getOuterHTML (el) {
|
10044 |
-
if (el.outerHTML) {
|
10045 |
-
return el.outerHTML
|
10046 |
-
} else {
|
10047 |
-
var container = document.createElement('div');
|
10048 |
-
container.appendChild(el.cloneNode(true));
|
10049 |
-
return container.innerHTML
|
10050 |
-
}
|
10051 |
-
}
|
10052 |
|
10053 |
-
Vue
|
10054 |
|
10055 |
-
return Vue
|
10056 |
|
10057 |
-
}))
|
1 |
/*!
|
2 |
+
* Vue.js v2.6.10
|
3 |
+
* (c) 2014-2019 Evan You
|
4 |
* Released under the MIT License.
|
5 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
+
(function (global, factory) {
|
8 |
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
9 |
+
typeof define === 'function' && define.amd ? define(factory) :
|
10 |
+
(global = global || self, global.Vue = factory());
|
11 |
+
}(this, function () { 'use strict';
|
12 |
|
13 |
+
/* */
|
|
|
|
|
14 |
|
15 |
+
var emptyObject = Object.freeze({});
|
|
|
|
|
16 |
|
17 |
+
// These helpers produce better VM code in JS engines due to their
|
18 |
+
// explicitness and function inlining.
|
19 |
+
function isUndef (v) {
|
20 |
+
return v === undefined || v === null
|
21 |
+
}
|
22 |
|
23 |
+
function isDef (v) {
|
24 |
+
return v !== undefined && v !== null
|
25 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
+
function isTrue (v) {
|
28 |
+
return v === true
|
29 |
+
}
|
30 |
|
31 |
+
function isFalse (v) {
|
32 |
+
return v === false
|
33 |
+
}
|
|
|
|
|
|
|
|
|
34 |
|
35 |
+
/**
|
36 |
+
* Check if value is primitive.
|
37 |
+
*/
|
38 |
+
function isPrimitive (value) {
|
39 |
+
return (
|
40 |
+
typeof value === 'string' ||
|
41 |
+
typeof value === 'number' ||
|
42 |
+
// $flow-disable-line
|
43 |
+
typeof value === 'symbol' ||
|
44 |
+
typeof value === 'boolean'
|
45 |
+
)
|
46 |
+
}
|
47 |
|
48 |
+
/**
|
49 |
+
* Quick object check - this is primarily used to tell
|
50 |
+
* Objects from primitive values when we know the value
|
51 |
+
* is a JSON-compliant type.
|
52 |
+
*/
|
53 |
+
function isObject (obj) {
|
54 |
+
return obj !== null && typeof obj === 'object'
|
55 |
+
}
|
56 |
|
57 |
+
/**
|
58 |
+
* Get the raw type string of a value, e.g., [object Object].
|
59 |
+
*/
|
60 |
+
var _toString = Object.prototype.toString;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
+
function toRawType (value) {
|
63 |
+
return _toString.call(value).slice(8, -1)
|
64 |
+
}
|
|
|
65 |
|
66 |
+
/**
|
67 |
+
* Strict object type check. Only returns true
|
68 |
+
* for plain JavaScript objects.
|
69 |
+
*/
|
70 |
+
function isPlainObject (obj) {
|
71 |
+
return _toString.call(obj) === '[object Object]'
|
|
|
|
|
72 |
}
|
|
|
|
|
73 |
|
74 |
+
function isRegExp (v) {
|
75 |
+
return _toString.call(v) === '[object RegExp]'
|
76 |
+
}
|
|
|
|
|
|
|
|
|
77 |
|
78 |
+
/**
|
79 |
+
* Check if val is a valid array index.
|
80 |
+
*/
|
81 |
+
function isValidArrayIndex (val) {
|
82 |
+
var n = parseFloat(String(val));
|
83 |
+
return n >= 0 && Math.floor(n) === n && isFinite(val)
|
84 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
+
function isPromise (val) {
|
87 |
+
return (
|
88 |
+
isDef(val) &&
|
89 |
+
typeof val.then === 'function' &&
|
90 |
+
typeof val.catch === 'function'
|
91 |
+
)
|
92 |
+
}
|
93 |
|
94 |
+
/**
|
95 |
+
* Convert a value to a string that is actually rendered.
|
96 |
+
*/
|
97 |
+
function toString (val) {
|
98 |
+
return val == null
|
99 |
+
? ''
|
100 |
+
: Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
|
101 |
+
? JSON.stringify(val, null, 2)
|
102 |
+
: String(val)
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Convert an input value to a number for persistence.
|
107 |
+
* If the conversion fails, return original string.
|
108 |
+
*/
|
109 |
+
function toNumber (val) {
|
110 |
+
var n = parseFloat(val);
|
111 |
+
return isNaN(n) ? val : n
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Make a map and return a function for checking if a key
|
116 |
+
* is in that map.
|
117 |
+
*/
|
118 |
+
function makeMap (
|
119 |
+
str,
|
120 |
+
expectsLowerCase
|
121 |
+
) {
|
122 |
+
var map = Object.create(null);
|
123 |
+
var list = str.split(',');
|
124 |
+
for (var i = 0; i < list.length; i++) {
|
125 |
+
map[list[i]] = true;
|
126 |
+
}
|
127 |
+
return expectsLowerCase
|
128 |
+
? function (val) { return map[val.toLowerCase()]; }
|
129 |
+
: function (val) { return map[val]; }
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Check if a tag is a built-in tag.
|
134 |
+
*/
|
135 |
+
var isBuiltInTag = makeMap('slot,component', true);
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Check if an attribute is a reserved attribute.
|
139 |
+
*/
|
140 |
+
var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Remove an item from an array.
|
144 |
+
*/
|
145 |
+
function remove (arr, item) {
|
146 |
+
if (arr.length) {
|
147 |
+
var index = arr.indexOf(item);
|
148 |
+
if (index > -1) {
|
149 |
+
return arr.splice(index, 1)
|
150 |
+
}
|
151 |
+
}
|
152 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
+
/**
|
155 |
+
* Check whether an object has the property.
|
156 |
+
*/
|
157 |
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
158 |
+
function hasOwn (obj, key) {
|
159 |
+
return hasOwnProperty.call(obj, key)
|
160 |
+
}
|
161 |
|
162 |
+
/**
|
163 |
+
* Create a cached version of a pure function.
|
164 |
+
*/
|
165 |
+
function cached (fn) {
|
166 |
+
var cache = Object.create(null);
|
167 |
+
return (function cachedFn (str) {
|
168 |
+
var hit = cache[str];
|
169 |
+
return hit || (cache[str] = fn(str))
|
170 |
+
})
|
171 |
+
}
|
172 |
|
173 |
+
/**
|
174 |
+
* Camelize a hyphen-delimited string.
|
175 |
+
*/
|
176 |
+
var camelizeRE = /-(\w)/g;
|
177 |
+
var camelize = cached(function (str) {
|
178 |
+
return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
|
179 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
|
181 |
+
/**
|
182 |
+
* Capitalize a string.
|
183 |
+
*/
|
184 |
+
var capitalize = cached(function (str) {
|
185 |
+
return str.charAt(0).toUpperCase() + str.slice(1)
|
186 |
+
});
|
187 |
|
188 |
+
/**
|
189 |
+
* Hyphenate a camelCase string.
|
190 |
+
*/
|
191 |
+
var hyphenateRE = /\B([A-Z])/g;
|
192 |
+
var hyphenate = cached(function (str) {
|
193 |
+
return str.replace(hyphenateRE, '-$1').toLowerCase()
|
194 |
+
});
|
195 |
|
196 |
+
/**
|
197 |
+
* Simple bind polyfill for environments that do not support it,
|
198 |
+
* e.g., PhantomJS 1.x. Technically, we don't need this anymore
|
199 |
+
* since native bind is now performant enough in most browsers.
|
200 |
+
* But removing it would mean breaking code that was able to run in
|
201 |
+
* PhantomJS 1.x, so this must be kept for backward compatibility.
|
202 |
+
*/
|
203 |
|
204 |
+
/* istanbul ignore next */
|
205 |
+
function polyfillBind (fn, ctx) {
|
206 |
+
function boundFn (a) {
|
207 |
+
var l = arguments.length;
|
208 |
+
return l
|
209 |
+
? l > 1
|
210 |
+
? fn.apply(ctx, arguments)
|
211 |
+
: fn.call(ctx, a)
|
212 |
+
: fn.call(ctx)
|
213 |
+
}
|
214 |
|
215 |
+
boundFn._length = fn.length;
|
216 |
+
return boundFn
|
217 |
+
}
|
|
|
218 |
|
219 |
+
function nativeBind (fn, ctx) {
|
220 |
+
return fn.bind(ctx)
|
221 |
+
}
|
|
|
222 |
|
223 |
+
var bind = Function.prototype.bind
|
224 |
+
? nativeBind
|
225 |
+
: polyfillBind;
|
|
|
226 |
|
227 |
+
/**
|
228 |
+
* Convert an Array-like object to a real Array.
|
229 |
+
*/
|
230 |
+
function toArray (list, start) {
|
231 |
+
start = start || 0;
|
232 |
+
var i = list.length - start;
|
233 |
+
var ret = new Array(i);
|
234 |
+
while (i--) {
|
235 |
+
ret[i] = list[i + start];
|
236 |
+
}
|
237 |
+
return ret
|
238 |
+
}
|
239 |
|
240 |
+
/**
|
241 |
+
* Mix properties into target object.
|
242 |
+
*/
|
243 |
+
function extend (to, _from) {
|
244 |
+
for (var key in _from) {
|
245 |
+
to[key] = _from[key];
|
246 |
+
}
|
247 |
+
return to
|
248 |
+
}
|
249 |
|
250 |
+
/**
|
251 |
+
* Merge an Array of Objects into a single Object.
|
252 |
+
*/
|
253 |
+
function toObject (arr) {
|
254 |
+
var res = {};
|
255 |
+
for (var i = 0; i < arr.length; i++) {
|
256 |
+
if (arr[i]) {
|
257 |
+
extend(res, arr[i]);
|
258 |
+
}
|
259 |
+
}
|
260 |
+
return res
|
261 |
+
}
|
262 |
+
|
263 |
+
/* eslint-disable no-unused-vars */
|
264 |
+
|
265 |
+
/**
|
266 |
+
* Perform no operation.
|
267 |
+
* Stubbing args to make Flow happy without leaving useless transpiled code
|
268 |
+
* with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
|
269 |
+
*/
|
270 |
+
function noop (a, b, c) {}
|
271 |
+
|
272 |
+
/**
|
273 |
+
* Always return false.
|
274 |
+
*/
|
275 |
+
var no = function (a, b, c) { return false; };
|
276 |
+
|
277 |
+
/* eslint-enable no-unused-vars */
|
278 |
+
|
279 |
+
/**
|
280 |
+
* Return the same value.
|
281 |
+
*/
|
282 |
+
var identity = function (_) { return _; };
|
283 |
+
|
284 |
+
/**
|
285 |
+
* Generate a string containing static keys from compiler modules.
|
286 |
+
*/
|
287 |
+
function genStaticKeys (modules) {
|
288 |
+
return modules.reduce(function (keys, m) {
|
289 |
+
return keys.concat(m.staticKeys || [])
|
290 |
+
}, []).join(',')
|
291 |
+
}
|
292 |
+
|
293 |
+
/**
|
294 |
+
* Check if two values are loosely equal - that is,
|
295 |
+
* if they are plain objects, do they have the same shape?
|
296 |
+
*/
|
297 |
+
function looseEqual (a, b) {
|
298 |
+
if (a === b) { return true }
|
299 |
+
var isObjectA = isObject(a);
|
300 |
+
var isObjectB = isObject(b);
|
301 |
+
if (isObjectA && isObjectB) {
|
302 |
+
try {
|
303 |
+
var isArrayA = Array.isArray(a);
|
304 |
+
var isArrayB = Array.isArray(b);
|
305 |
+
if (isArrayA && isArrayB) {
|
306 |
+
return a.length === b.length && a.every(function (e, i) {
|
307 |
+
return looseEqual(e, b[i])
|
308 |
+
})
|
309 |
+
} else if (a instanceof Date && b instanceof Date) {
|
310 |
+
return a.getTime() === b.getTime()
|
311 |
+
} else if (!isArrayA && !isArrayB) {
|
312 |
+
var keysA = Object.keys(a);
|
313 |
+
var keysB = Object.keys(b);
|
314 |
+
return keysA.length === keysB.length && keysA.every(function (key) {
|
315 |
+
return looseEqual(a[key], b[key])
|
316 |
+
})
|
317 |
+
} else {
|
318 |
+
/* istanbul ignore next */
|
319 |
+
return false
|
320 |
+
}
|
321 |
+
} catch (e) {
|
322 |
+
/* istanbul ignore next */
|
323 |
+
return false
|
324 |
+
}
|
325 |
+
} else if (!isObjectA && !isObjectB) {
|
326 |
+
return String(a) === String(b)
|
327 |
+
} else {
|
328 |
+
return false
|
329 |
+
}
|
330 |
+
}
|
331 |
|
332 |
+
/**
|
333 |
+
* Return the first index at which a loosely equal value can be
|
334 |
+
* found in the array (if value is a plain object, the array must
|
335 |
+
* contain an object of the same shape), or -1 if it is not present.
|
336 |
+
*/
|
337 |
+
function looseIndexOf (arr, val) {
|
338 |
+
for (var i = 0; i < arr.length; i++) {
|
339 |
+
if (looseEqual(arr[i], val)) { return i }
|
340 |
+
}
|
341 |
+
return -1
|
342 |
+
}
|
343 |
+
|
344 |
+
/**
|
345 |
+
* Ensure a function is called only once.
|
346 |
+
*/
|
347 |
+
function once (fn) {
|
348 |
+
var called = false;
|
349 |
+
return function () {
|
350 |
+
if (!called) {
|
351 |
+
called = true;
|
352 |
+
fn.apply(this, arguments);
|
353 |
+
}
|
354 |
+
}
|
355 |
+
}
|
356 |
|
357 |
+
var SSR_ATTR = 'data-server-rendered';
|
|
|
|
|
|
|
358 |
|
359 |
+
var ASSET_TYPES = [
|
360 |
+
'component',
|
361 |
+
'directive',
|
362 |
+
'filter'
|
363 |
+
];
|
364 |
|
365 |
+
var LIFECYCLE_HOOKS = [
|
366 |
+
'beforeCreate',
|
367 |
+
'created',
|
368 |
+
'beforeMount',
|
369 |
+
'mounted',
|
370 |
+
'beforeUpdate',
|
371 |
+
'updated',
|
372 |
+
'beforeDestroy',
|
373 |
+
'destroyed',
|
374 |
+
'activated',
|
375 |
+
'deactivated',
|
376 |
+
'errorCaptured',
|
377 |
+
'serverPrefetch'
|
378 |
+
];
|
379 |
|
380 |
+
/* */
|
|
|
|
|
|
|
|
|
381 |
|
|
|
382 |
|
|
|
383 |
|
384 |
+
var config = ({
|
385 |
+
/**
|
386 |
+
* Option merge strategies (used in core/util/options)
|
387 |
+
*/
|
388 |
+
// $flow-disable-line
|
389 |
+
optionMergeStrategies: Object.create(null),
|
390 |
+
|
391 |
+
/**
|
392 |
+
* Whether to suppress warnings.
|
393 |
+
*/
|
394 |
+
silent: false,
|
395 |
+
|
396 |
+
/**
|
397 |
+
* Show production mode tip message on boot?
|
398 |
+
*/
|
399 |
+
productionTip: "development" !== 'production',
|
400 |
+
|
401 |
+
/**
|
402 |
+
* Whether to enable devtools
|
403 |
+
*/
|
404 |
+
devtools: "development" !== 'production',
|
405 |
+
|
406 |
+
/**
|
407 |
+
* Whether to record perf
|
408 |
+
*/
|
409 |
+
performance: false,
|
410 |
+
|
411 |
+
/**
|
412 |
+
* Error handler for watcher errors
|
413 |
+
*/
|
414 |
+
errorHandler: null,
|
415 |
+
|
416 |
+
/**
|
417 |
+
* Warn handler for watcher warns
|
418 |
+
*/
|
419 |
+
warnHandler: null,
|
420 |
+
|
421 |
+
/**
|
422 |
+
* Ignore certain custom elements
|
423 |
+
*/
|
424 |
+
ignoredElements: [],
|
425 |
+
|
426 |
+
/**
|
427 |
+
* Custom user key aliases for v-on
|
428 |
+
*/
|
429 |
+
// $flow-disable-line
|
430 |
+
keyCodes: Object.create(null),
|
431 |
+
|
432 |
+
/**
|
433 |
+
* Check if a tag is reserved so that it cannot be registered as a
|
434 |
+
* component. This is platform-dependent and may be overwritten.
|
435 |
+
*/
|
436 |
+
isReservedTag: no,
|
437 |
+
|
438 |
+
/**
|
439 |
+
* Check if an attribute is reserved so that it cannot be used as a component
|
440 |
+
* prop. This is platform-dependent and may be overwritten.
|
441 |
+
*/
|
442 |
+
isReservedAttr: no,
|
443 |
+
|
444 |
+
/**
|
445 |
+
* Check if a tag is an unknown element.
|
446 |
+
* Platform-dependent.
|
447 |
+
*/
|
448 |
+
isUnknownElement: no,
|
449 |
+
|
450 |
+
/**
|
451 |
+
* Get the namespace of an element
|
452 |
+
*/
|
453 |
+
getTagNamespace: noop,
|
454 |
+
|
455 |
+
/**
|
456 |
+
* Parse the real tag name for the specific platform.
|
457 |
+
*/
|
458 |
+
parsePlatformTagName: identity,
|
459 |
+
|
460 |
+
/**
|
461 |
+
* Check if an attribute must be bound using property, e.g. value
|
462 |
+
* Platform-dependent.
|
463 |
+
*/
|
464 |
+
mustUseProp: no,
|
465 |
+
|
466 |
+
/**
|
467 |
+
* Perform updates asynchronously. Intended to be used by Vue Test Utils
|
468 |
+
* This will significantly reduce performance if set to false.
|
469 |
+
*/
|
470 |
+
async: true,
|
471 |
+
|
472 |
+
/**
|
473 |
+
* Exposed for legacy reasons
|
474 |
+
*/
|
475 |
+
_lifecycleHooks: LIFECYCLE_HOOKS
|
476 |
+
});
|
477 |
|
478 |
+
/* */
|
479 |
+
|
480 |
+
/**
|
481 |
+
* unicode letters used for parsing html tags, component names and property paths.
|
482 |
+
* using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
|
483 |
+
* skipping \u10000-\uEFFFF due to it freezing up PhantomJS
|
484 |
+
*/
|
485 |
+
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/;
|
486 |
+
|
487 |
+
/**
|
488 |
+
* Check if a string starts with $ or _
|
489 |
+
*/
|
490 |
+
function isReserved (str) {
|
491 |
+
var c = (str + '').charCodeAt(0);
|
492 |
+
return c === 0x24 || c === 0x5F
|
493 |
+
}
|
494 |
+
|
495 |
+
/**
|
496 |
+
* Define a property.
|
497 |
+
*/
|
498 |
+
function def (obj, key, val, enumerable) {
|
499 |
+
Object.defineProperty(obj, key, {
|
500 |
+
value: val,
|
501 |
+
enumerable: !!enumerable,
|
502 |
+
writable: true,
|
503 |
+
configurable: true
|
504 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
}
|
|
|
|
|
|
|
|
|
506 |
|
507 |
+
/**
|
508 |
+
* Parse simple path.
|
509 |
+
*/
|
510 |
+
var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
|
511 |
+
function parsePath (path) {
|
512 |
+
if (bailRE.test(path)) {
|
513 |
+
return
|
514 |
+
}
|
515 |
+
var segments = path.split('.');
|
516 |
+
return function (obj) {
|
517 |
+
for (var i = 0; i < segments.length; i++) {
|
518 |
+
if (!obj) { return }
|
519 |
+
obj = obj[segments[i]];
|
520 |
+
}
|
521 |
+
return obj
|
522 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
}
|
|
|
|
|
|
|
524 |
|
525 |
+
/* */
|
|
|
526 |
|
527 |
+
// can we use __proto__?
|
528 |
+
var hasProto = '__proto__' in {};
|
|
|
|
|
529 |
|
530 |
+
// Browser environment sniffing
|
531 |
+
var inBrowser = typeof window !== 'undefined';
|
532 |
+
var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
|
533 |
+
var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
|
534 |
+
var UA = inBrowser && window.navigator.userAgent.toLowerCase();
|
535 |
+
var isIE = UA && /msie|trident/.test(UA);
|
536 |
+
var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
|
537 |
+
var isEdge = UA && UA.indexOf('edge/') > 0;
|
538 |
+
var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
|
539 |
+
var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
|
540 |
+
var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
|
541 |
+
var isPhantomJS = UA && /phantomjs/.test(UA);
|
542 |
+
var isFF = UA && UA.match(/firefox\/(\d+)/);
|
543 |
|
544 |
+
// Firefox has a "watch" function on Object.prototype...
|
545 |
+
var nativeWatch = ({}).watch;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
546 |
|
547 |
+
var supportsPassive = false;
|
548 |
+
if (inBrowser) {
|
|
|
|
|
549 |
try {
|
550 |
+
var opts = {};
|
551 |
+
Object.defineProperty(opts, 'passive', ({
|
552 |
+
get: function get () {
|
553 |
+
/* istanbul ignore next */
|
554 |
+
supportsPassive = true;
|
555 |
+
}
|
556 |
+
})); // https://github.com/facebook/flow/issues/285
|
557 |
+
window.addEventListener('test-passive', null, opts);
|
558 |
+
} catch (e) {}
|
559 |
+
}
|
560 |
+
|
561 |
+
// this needs to be lazy-evaled because vue may be required before
|
562 |
+
// vue-server-renderer can set VUE_ENV
|
563 |
+
var _isServer;
|
564 |
+
var isServerRendering = function () {
|
565 |
+
if (_isServer === undefined) {
|
566 |
+
/* istanbul ignore if */
|
567 |
+
if (!inBrowser && !inWeex && typeof global !== 'undefined') {
|
568 |
+
// detect presence of vue-server-renderer and avoid
|
569 |
+
// Webpack shimming the process
|
570 |
+
_isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
|
571 |
+
} else {
|
572 |
+
_isServer = false;
|
573 |
+
}
|
574 |
}
|
575 |
+
return _isServer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
576 |
};
|
577 |
|
578 |
+
// detect devtools
|
579 |
+
var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
|
580 |
|
581 |
+
/* istanbul ignore next */
|
582 |
+
function isNative (Ctor) {
|
583 |
+
return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
|
584 |
+
}
|
585 |
|
586 |
+
var hasSymbol =
|
587 |
+
typeof Symbol !== 'undefined' && isNative(Symbol) &&
|
588 |
+
typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
|
589 |
|
590 |
+
var _Set;
|
591 |
+
/* istanbul ignore if */ // $flow-disable-line
|
592 |
+
if (typeof Set !== 'undefined' && isNative(Set)) {
|
593 |
+
// use native Set when available.
|
594 |
+
_Set = Set;
|
595 |
+
} else {
|
596 |
+
// a non-standard Set polyfill that only works with primitive keys.
|
597 |
+
_Set = /*@__PURE__*/(function () {
|
598 |
+
function Set () {
|
599 |
+
this.set = Object.create(null);
|
600 |
+
}
|
601 |
+
Set.prototype.has = function has (key) {
|
602 |
+
return this.set[key] === true
|
603 |
+
};
|
604 |
+
Set.prototype.add = function add (key) {
|
605 |
+
this.set[key] = true;
|
606 |
+
};
|
607 |
+
Set.prototype.clear = function clear () {
|
608 |
+
this.set = Object.create(null);
|
609 |
+
};
|
610 |
|
611 |
+
return Set;
|
612 |
+
}());
|
613 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
614 |
|
615 |
+
/* */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
616 |
|
617 |
+
var warn = noop;
|
618 |
+
var tip = noop;
|
619 |
+
var generateComponentTrace = (noop); // work around flow check
|
620 |
+
var formatComponentName = (noop);
|
621 |
|
622 |
+
{
|
623 |
+
var hasConsole = typeof console !== 'undefined';
|
624 |
+
var classifyRE = /(?:^|[-_])(\w)/g;
|
625 |
+
var classify = function (str) { return str
|
626 |
+
.replace(classifyRE, function (c) { return c.toUpperCase(); })
|
627 |
+
.replace(/[-_]/g, ''); };
|
628 |
+
|
629 |
+
warn = function (msg, vm) {
|
630 |
+
var trace = vm ? generateComponentTrace(vm) : '';
|
631 |
+
|
632 |
+
if (config.warnHandler) {
|
633 |
+
config.warnHandler.call(null, msg, vm, trace);
|
634 |
+
} else if (hasConsole && (!config.silent)) {
|
635 |
+
console.error(("[Vue warn]: " + msg + trace));
|
636 |
+
}
|
637 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
638 |
|
639 |
+
tip = function (msg, vm) {
|
640 |
+
if (hasConsole && (!config.silent)) {
|
641 |
+
console.warn("[Vue tip]: " + msg + (
|
642 |
+
vm ? generateComponentTrace(vm) : ''
|
643 |
+
));
|
644 |
+
}
|
645 |
+
};
|
646 |
+
|
647 |
+
formatComponentName = function (vm, includeFile) {
|
648 |
+
if (vm.$root === vm) {
|
649 |
+
return '<Root>'
|
650 |
+
}
|
651 |
+
var options = typeof vm === 'function' && vm.cid != null
|
652 |
+
? vm.options
|
653 |
+
: vm._isVue
|
654 |
+
? vm.$options || vm.constructor.options
|
655 |
+
: vm;
|
656 |
+
var name = options.name || options._componentTag;
|
657 |
+
var file = options.__file;
|
658 |
+
if (!name && file) {
|
659 |
+
var match = file.match(/([^/\\]+)\.vue$/);
|
660 |
+
name = match && match[1];
|
661 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
662 |
|
663 |
+
return (
|
664 |
+
(name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
|
665 |
+
(file && includeFile !== false ? (" at " + file) : '')
|
666 |
+
)
|
667 |
+
};
|
668 |
+
|
669 |
+
var repeat = function (str, n) {
|
670 |
+
var res = '';
|
671 |
+
while (n) {
|
672 |
+
if (n % 2 === 1) { res += str; }
|
673 |
+
if (n > 1) { str += str; }
|
674 |
+
n >>= 1;
|
675 |
+
}
|
676 |
+
return res
|
677 |
+
};
|
678 |
+
|
679 |
+
generateComponentTrace = function (vm) {
|
680 |
+
if (vm._isVue && vm.$parent) {
|
681 |
+
var tree = [];
|
682 |
+
var currentRecursiveSequence = 0;
|
683 |
+
while (vm) {
|
684 |
+
if (tree.length > 0) {
|
685 |
+
var last = tree[tree.length - 1];
|
686 |
+
if (last.constructor === vm.constructor) {
|
687 |
+
currentRecursiveSequence++;
|
688 |
+
vm = vm.$parent;
|
689 |
+
continue
|
690 |
+
} else if (currentRecursiveSequence > 0) {
|
691 |
+
tree[tree.length - 1] = [last, currentRecursiveSequence];
|
692 |
+
currentRecursiveSequence = 0;
|
693 |
+
}
|
694 |
+
}
|
695 |
+
tree.push(vm);
|
696 |
+
vm = vm.$parent;
|
697 |
+
}
|
698 |
+
return '\n\nfound in\n\n' + tree
|
699 |
+
.map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
|
700 |
+
? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
|
701 |
+
: formatComponentName(vm))); })
|
702 |
+
.join('\n')
|
703 |
+
} else {
|
704 |
+
return ("\n\n(found in " + (formatComponentName(vm)) + ")")
|
705 |
+
}
|
706 |
+
};
|
707 |
}
|
|
|
|
|
708 |
|
709 |
+
/* */
|
|
|
710 |
|
711 |
+
var uid = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
712 |
|
713 |
+
/**
|
714 |
+
* A dep is an observable that can have multiple
|
715 |
+
* directives subscribing to it.
|
716 |
+
*/
|
717 |
+
var Dep = function Dep () {
|
718 |
+
this.id = uid++;
|
719 |
+
this.subs = [];
|
720 |
+
};
|
721 |
|
722 |
+
Dep.prototype.addSub = function addSub (sub) {
|
723 |
+
this.subs.push(sub);
|
724 |
+
};
|
725 |
|
726 |
+
Dep.prototype.removeSub = function removeSub (sub) {
|
727 |
+
remove(this.subs, sub);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
728 |
};
|
729 |
+
|
730 |
+
Dep.prototype.depend = function depend () {
|
731 |
+
if (Dep.target) {
|
732 |
+
Dep.target.addDep(this);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
733 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
734 |
};
|
735 |
|
736 |
+
Dep.prototype.notify = function notify () {
|
737 |
+
// stabilize the subscriber list first
|
738 |
+
var subs = this.subs.slice();
|
739 |
+
if (!config.async) {
|
740 |
+
// subs aren't sorted in scheduler if not running async
|
741 |
+
// we need to sort them now to make sure they fire in correct
|
742 |
+
// order
|
743 |
+
subs.sort(function (a, b) { return a.id - b.id; });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
744 |
}
|
745 |
+
for (var i = 0, l = subs.length; i < l; i++) {
|
746 |
+
subs[i].update();
|
|
|
|
|
|
|
747 |
}
|
748 |
+
};
|
749 |
|
750 |
+
// The current target watcher being evaluated.
|
751 |
+
// This is globally unique because only one watcher
|
752 |
+
// can be evaluated at a time.
|
753 |
+
Dep.target = null;
|
754 |
+
var targetStack = [];
|
755 |
+
|
756 |
+
function pushTarget (target) {
|
757 |
+
targetStack.push(target);
|
758 |
+
Dep.target = target;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
759 |
}
|
760 |
+
|
761 |
+
function popTarget () {
|
762 |
+
targetStack.pop();
|
763 |
+
Dep.target = targetStack[targetStack.length - 1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
764 |
}
|
|
|
|
|
|
|
765 |
|
766 |
+
/* */
|
767 |
|
768 |
+
var VNode = function VNode (
|
769 |
+
tag,
|
770 |
+
data,
|
771 |
+
children,
|
772 |
+
text,
|
773 |
+
elm,
|
774 |
+
context,
|
775 |
+
componentOptions,
|
776 |
+
asyncFactory
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
777 |
) {
|
778 |
+
this.tag = tag;
|
779 |
+
this.data = data;
|
780 |
+
this.children = children;
|
781 |
+
this.text = text;
|
782 |
+
this.elm = elm;
|
783 |
+
this.ns = undefined;
|
784 |
+
this.context = context;
|
785 |
+
this.fnContext = undefined;
|
786 |
+
this.fnOptions = undefined;
|
787 |
+
this.fnScopeId = undefined;
|
788 |
+
this.key = data && data.key;
|
789 |
+
this.componentOptions = componentOptions;
|
790 |
+
this.componentInstance = undefined;
|
791 |
+
this.parent = undefined;
|
792 |
+
this.raw = false;
|
793 |
+
this.isStatic = false;
|
794 |
+
this.isRootInsert = true;
|
795 |
+
this.isComment = false;
|
796 |
+
this.isCloned = false;
|
797 |
+
this.isOnce = false;
|
798 |
+
this.asyncFactory = asyncFactory;
|
799 |
+
this.asyncMeta = undefined;
|
800 |
+
this.isAsyncPlaceholder = false;
|
801 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
802 |
|
803 |
+
var prototypeAccessors = { child: { configurable: true } };
|
804 |
+
|
805 |
+
// DEPRECATED: alias for componentInstance for backwards compat.
|
806 |
+
/* istanbul ignore next */
|
807 |
+
prototypeAccessors.child.get = function () {
|
808 |
+
return this.componentInstance
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
809 |
};
|
810 |
+
|
811 |
+
Object.defineProperties( VNode.prototype, prototypeAccessors );
|
812 |
+
|
813 |
+
var createEmptyVNode = function (text) {
|
814 |
+
if ( text === void 0 ) text = '';
|
815 |
+
|
816 |
+
var node = new VNode();
|
817 |
+
node.text = text;
|
818 |
+
node.isComment = true;
|
819 |
+
return node
|
820 |
};
|
821 |
+
|
822 |
+
function createTextVNode (val) {
|
823 |
+
return new VNode(undefined, undefined, undefined, String(val))
|
824 |
+
}
|
825 |
+
|
826 |
+
// optimized shallow clone
|
827 |
+
// used for static nodes and slot nodes because they may be reused across
|
828 |
+
// multiple renders, cloning them avoids errors when DOM manipulations rely
|
829 |
+
// on their elm reference.
|
830 |
+
function cloneVNode (vnode) {
|
831 |
+
var cloned = new VNode(
|
832 |
+
vnode.tag,
|
833 |
+
vnode.data,
|
834 |
+
// #7975
|
835 |
+
// clone children array to avoid mutating original in case of cloning
|
836 |
+
// a child.
|
837 |
+
vnode.children && vnode.children.slice(),
|
838 |
+
vnode.text,
|
839 |
+
vnode.elm,
|
840 |
+
vnode.context,
|
841 |
+
vnode.componentOptions,
|
842 |
+
vnode.asyncFactory
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
843 |
);
|
844 |
+
cloned.ns = vnode.ns;
|
845 |
+
cloned.isStatic = vnode.isStatic;
|
846 |
+
cloned.key = vnode.key;
|
847 |
+
cloned.isComment = vnode.isComment;
|
848 |
+
cloned.fnContext = vnode.fnContext;
|
849 |
+
cloned.fnOptions = vnode.fnOptions;
|
850 |
+
cloned.fnScopeId = vnode.fnScopeId;
|
851 |
+
cloned.asyncMeta = vnode.asyncMeta;
|
852 |
+
cloned.isCloned = true;
|
853 |
+
return cloned
|
854 |
+
}
|
855 |
+
|
856 |
+
/*
|
857 |
+
* not type checking this file because flow doesn't play well with
|
858 |
+
* dynamically accessing methods on Array prototype
|
859 |
+
*/
|
860 |
|
861 |
+
var arrayProto = Array.prototype;
|
862 |
+
var arrayMethods = Object.create(arrayProto);
|
863 |
+
|
864 |
+
var methodsToPatch = [
|
865 |
+
'push',
|
866 |
+
'pop',
|
867 |
+
'shift',
|
868 |
+
'unshift',
|
869 |
+
'splice',
|
870 |
+
'sort',
|
871 |
+
'reverse'
|
872 |
+
];
|
873 |
+
|
874 |
+
/**
|
875 |
+
* Intercept mutating methods and emit events
|
876 |
+
*/
|
877 |
+
methodsToPatch.forEach(function (method) {
|
878 |
+
// cache original method
|
879 |
+
var original = arrayProto[method];
|
880 |
+
def(arrayMethods, method, function mutator () {
|
881 |
+
var args = [], len = arguments.length;
|
882 |
+
while ( len-- ) args[ len ] = arguments[ len ];
|
883 |
+
|
884 |
+
var result = original.apply(this, args);
|
885 |
+
var ob = this.__ob__;
|
886 |
+
var inserted;
|
887 |
+
switch (method) {
|
888 |
+
case 'push':
|
889 |
+
case 'unshift':
|
890 |
+
inserted = args;
|
891 |
+
break
|
892 |
+
case 'splice':
|
893 |
+
inserted = args.slice(2);
|
894 |
+
break
|
895 |
+
}
|
896 |
+
if (inserted) { ob.observeArray(inserted); }
|
897 |
+
// notify change
|
898 |
+
ob.dep.notify();
|
899 |
+
return result
|
900 |
+
});
|
901 |
+
});
|
902 |
|
903 |
+
/* */
|
904 |
|
905 |
+
var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
|
|
|
|
|
906 |
|
907 |
+
/**
|
908 |
+
* In some cases we may want to disable observation inside a component's
|
909 |
+
* update computation.
|
910 |
+
*/
|
911 |
+
var shouldObserve = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
912 |
|
913 |
+
function toggleObserving (value) {
|
914 |
+
shouldObserve = value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
915 |
}
|
|
|
|
|
916 |
|
917 |
+
/**
|
918 |
+
* Observer class that is attached to each observed
|
919 |
+
* object. Once attached, the observer converts the target
|
920 |
+
* object's property keys into getter/setters that
|
921 |
+
* collect dependencies and dispatch updates.
|
922 |
+
*/
|
923 |
+
var Observer = function Observer (value) {
|
924 |
+
this.value = value;
|
925 |
+
this.dep = new Dep();
|
926 |
+
this.vmCount = 0;
|
927 |
+
def(value, '__ob__', this);
|
928 |
+
if (Array.isArray(value)) {
|
929 |
+
if (hasProto) {
|
930 |
+
protoAugment(value, arrayMethods);
|
931 |
+
} else {
|
932 |
+
copyAugment(value, arrayMethods, arrayKeys);
|
933 |
+
}
|
934 |
+
this.observeArray(value);
|
935 |
+
} else {
|
936 |
+
this.walk(value);
|
937 |
+
}
|
938 |
+
};
|
939 |
|
940 |
+
/**
|
941 |
+
* Walk through all properties and convert them into
|
942 |
+
* getter/setters. This method should only be called when
|
943 |
+
* value type is Object.
|
944 |
+
*/
|
945 |
+
Observer.prototype.walk = function walk (obj) {
|
946 |
+
var keys = Object.keys(obj);
|
947 |
+
for (var i = 0; i < keys.length; i++) {
|
948 |
+
defineReactive$$1(obj, keys[i]);
|
949 |
+
}
|
950 |
+
};
|
951 |
|
952 |
+
/**
|
953 |
+
* Observe a list of Array items.
|
954 |
+
*/
|
955 |
+
Observer.prototype.observeArray = function observeArray (items) {
|
956 |
+
for (var i = 0, l = items.length; i < l; i++) {
|
957 |
+
observe(items[i]);
|
958 |
+
}
|
959 |
+
};
|
960 |
|
961 |
+
// helpers
|
962 |
+
|
963 |
+
/**
|
964 |
+
* Augment a target Object or Array by intercepting
|
965 |
+
* the prototype chain using __proto__
|
966 |
+
*/
|
967 |
+
function protoAugment (target, src) {
|
968 |
+
/* eslint-disable no-proto */
|
969 |
+
target.__proto__ = src;
|
970 |
+
/* eslint-enable no-proto */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
971 |
}
|
972 |
+
|
973 |
+
/**
|
974 |
+
* Augment a target Object or Array by defining
|
975 |
+
* hidden properties.
|
976 |
+
*/
|
977 |
+
/* istanbul ignore next */
|
978 |
+
function copyAugment (target, src, keys) {
|
979 |
+
for (var i = 0, l = keys.length; i < l; i++) {
|
980 |
+
var key = keys[i];
|
981 |
+
def(target, key, src[key]);
|
982 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
983 |
}
|
|
|
|
|
984 |
|
985 |
+
/**
|
986 |
+
* Attempt to create an observer instance for a value,
|
987 |
+
* returns the new observer if successfully observed,
|
988 |
+
* or the existing observer if the value already has one.
|
989 |
+
*/
|
990 |
+
function observe (value, asRootData) {
|
991 |
+
if (!isObject(value) || value instanceof VNode) {
|
992 |
+
return
|
993 |
+
}
|
994 |
+
var ob;
|
995 |
+
if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
|
996 |
+
ob = value.__ob__;
|
997 |
+
} else if (
|
998 |
+
shouldObserve &&
|
999 |
+
!isServerRendering() &&
|
1000 |
+
(Array.isArray(value) || isPlainObject(value)) &&
|
1001 |
+
Object.isExtensible(value) &&
|
1002 |
+
!value._isVue
|
1003 |
+
) {
|
1004 |
+
ob = new Observer(value);
|
1005 |
+
}
|
1006 |
+
if (asRootData && ob) {
|
1007 |
+
ob.vmCount++;
|
1008 |
+
}
|
1009 |
+
return ob
|
1010 |
+
}
|
1011 |
+
|
1012 |
+
/**
|
1013 |
+
* Define a reactive property on an Object.
|
1014 |
+
*/
|
1015 |
+
function defineReactive$$1 (
|
1016 |
+
obj,
|
1017 |
+
key,
|
1018 |
+
val,
|
1019 |
+
customSetter,
|
1020 |
+
shallow
|
1021 |
+
) {
|
1022 |
+
var dep = new Dep();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1023 |
|
1024 |
+
var property = Object.getOwnPropertyDescriptor(obj, key);
|
1025 |
+
if (property && property.configurable === false) {
|
1026 |
+
return
|
1027 |
+
}
|
1028 |
|
1029 |
+
// cater for pre-defined getter/setters
|
1030 |
+
var getter = property && property.get;
|
1031 |
+
var setter = property && property.set;
|
1032 |
+
if ((!getter || setter) && arguments.length === 2) {
|
1033 |
+
val = obj[key];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1034 |
}
|
|
|
1035 |
|
1036 |
+
var childOb = !shallow && observe(val);
|
1037 |
+
Object.defineProperty(obj, key, {
|
1038 |
+
enumerable: true,
|
1039 |
+
configurable: true,
|
1040 |
+
get: function reactiveGetter () {
|
1041 |
+
var value = getter ? getter.call(obj) : val;
|
1042 |
+
if (Dep.target) {
|
1043 |
+
dep.depend();
|
1044 |
+
if (childOb) {
|
1045 |
+
childOb.dep.depend();
|
1046 |
+
if (Array.isArray(value)) {
|
1047 |
+
dependArray(value);
|
1048 |
+
}
|
1049 |
+
}
|
1050 |
+
}
|
1051 |
+
return value
|
1052 |
+
},
|
1053 |
+
set: function reactiveSetter (newVal) {
|
1054 |
+
var value = getter ? getter.call(obj) : val;
|
1055 |
+
/* eslint-disable no-self-compare */
|
1056 |
+
if (newVal === value || (newVal !== newVal && value !== value)) {
|
1057 |
+
return
|
1058 |
+
}
|
1059 |
+
/* eslint-enable no-self-compare */
|
1060 |
+
if (customSetter) {
|
1061 |
+
customSetter();
|
1062 |
+
}
|
1063 |
+
// #7981: for accessor properties without setter
|
1064 |
+
if (getter && !setter) { return }
|
1065 |
+
if (setter) {
|
1066 |
+
setter.call(obj, newVal);
|
1067 |
+
} else {
|
1068 |
+
val = newVal;
|
1069 |
+
}
|
1070 |
+
childOb = !shallow && observe(newVal);
|
1071 |
+
dep.notify();
|
1072 |
+
}
|
1073 |
+
});
|
1074 |
}
|
|
|
|
|
|
|
|
|
|
|
1075 |
|
1076 |
+
/**
|
1077 |
+
* Set a property on an object. Adds the new property and
|
1078 |
+
* triggers change notification if the property doesn't
|
1079 |
+
* already exist.
|
1080 |
+
*/
|
1081 |
+
function set (target, key, val) {
|
1082 |
+
if (isUndef(target) || isPrimitive(target)
|
1083 |
+
) {
|
1084 |
+
warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
|
1085 |
+
}
|
1086 |
+
if (Array.isArray(target) && isValidArrayIndex(key)) {
|
1087 |
+
target.length = Math.max(target.length, key);
|
1088 |
+
target.splice(key, 1, val);
|
1089 |
+
return val
|
1090 |
+
}
|
1091 |
+
if (key in target && !(key in Object.prototype)) {
|
1092 |
+
target[key] = val;
|
1093 |
+
return val
|
1094 |
+
}
|
1095 |
+
var ob = (target).__ob__;
|
1096 |
+
if (target._isVue || (ob && ob.vmCount)) {
|
1097 |
+
warn(
|
1098 |
+
'Avoid adding reactive properties to a Vue instance or its root $data ' +
|
1099 |
+
'at runtime - declare it upfront in the data option.'
|
1100 |
+
);
|
1101 |
+
return val
|
1102 |
+
}
|
1103 |
+
if (!ob) {
|
1104 |
+
target[key] = val;
|
1105 |
+
return val
|
1106 |
+
}
|
1107 |
+
defineReactive$$1(ob.value, key, val);
|
1108 |
+
ob.dep.notify();
|
1109 |
+
return val
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1110 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1111 |
|
1112 |
+
/**
|
1113 |
+
* Delete a property and trigger change if necessary.
|
1114 |
+
*/
|
1115 |
+
function del (target, key) {
|
1116 |
+
if (isUndef(target) || isPrimitive(target)
|
1117 |
+
) {
|
1118 |
+
warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
|
1119 |
+
}
|
1120 |
+
if (Array.isArray(target) && isValidArrayIndex(key)) {
|
1121 |
+
target.splice(key, 1);
|
1122 |
+
return
|
1123 |
+
}
|
1124 |
+
var ob = (target).__ob__;
|
1125 |
+
if (target._isVue || (ob && ob.vmCount)) {
|
1126 |
+
warn(
|
1127 |
+
'Avoid deleting properties on a Vue instance or its root $data ' +
|
1128 |
+
'- just set it to null.'
|
1129 |
+
);
|
1130 |
+
return
|
1131 |
+
}
|
1132 |
+
if (!hasOwn(target, key)) {
|
1133 |
+
return
|
1134 |
+
}
|
1135 |
+
delete target[key];
|
1136 |
+
if (!ob) {
|
1137 |
+
return
|
1138 |
+
}
|
1139 |
+
ob.dep.notify();
|
1140 |
+
}
|
1141 |
+
|
1142 |
+
/**
|
1143 |
+
* Collect dependencies on array elements when the array is touched, since
|
1144 |
+
* we cannot intercept array element access like property getters.
|
1145 |
+
*/
|
1146 |
+
function dependArray (value) {
|
1147 |
+
for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
|
1148 |
+
e = value[i];
|
1149 |
+
e && e.__ob__ && e.__ob__.dep.depend();
|
1150 |
+
if (Array.isArray(e)) {
|
1151 |
+
dependArray(e);
|
1152 |
+
}
|
1153 |
+
}
|
1154 |
}
|
1155 |
|
1156 |
+
/* */
|
1157 |
+
|
1158 |
+
/**
|
1159 |
+
* Option overwriting strategies are functions that handle
|
1160 |
+
* how to merge a parent option value and a child option
|
1161 |
+
* value into the final value.
|
1162 |
+
*/
|
1163 |
+
var strats = config.optionMergeStrategies;
|
1164 |
+
|
1165 |
+
/**
|
1166 |
+
* Options with restrictions
|
1167 |
+
*/
|
1168 |
{
|
1169 |
+
strats.el = strats.propsData = function (parent, child, vm, key) {
|
1170 |
+
if (!vm) {
|
1171 |
+
warn(
|
1172 |
+
"option \"" + key + "\" can only be used during instance " +
|
1173 |
+
'creation with the `new` keyword.'
|
1174 |
+
);
|
1175 |
+
}
|
1176 |
+
return defaultStrat(parent, child)
|
1177 |
+
};
|
1178 |
+
}
|
1179 |
+
|
1180 |
+
/**
|
1181 |
+
* Helper that recursively merges two data objects together.
|
1182 |
+
*/
|
1183 |
+
function mergeData (to, from) {
|
1184 |
+
if (!from) { return to }
|
1185 |
+
var key, toVal, fromVal;
|
1186 |
+
|
1187 |
+
var keys = hasSymbol
|
1188 |
+
? Reflect.ownKeys(from)
|
1189 |
+
: Object.keys(from);
|
1190 |
+
|
1191 |
+
for (var i = 0; i < keys.length; i++) {
|
1192 |
+
key = keys[i];
|
1193 |
+
// in case the object is already observed...
|
1194 |
+
if (key === '__ob__') { continue }
|
1195 |
+
toVal = to[key];
|
1196 |
+
fromVal = from[key];
|
1197 |
+
if (!hasOwn(to, key)) {
|
1198 |
+
set(to, key, fromVal);
|
1199 |
+
} else if (
|
1200 |
+
toVal !== fromVal &&
|
1201 |
+
isPlainObject(toVal) &&
|
1202 |
+
isPlainObject(fromVal)
|
1203 |
+
) {
|
1204 |
+
mergeData(toVal, fromVal);
|
1205 |
+
}
|
1206 |
+
}
|
1207 |
+
return to
|
1208 |
+
}
|
1209 |
+
|
1210 |
+
/**
|
1211 |
+
* Data
|
1212 |
+
*/
|
1213 |
+
function mergeDataOrFn (
|
1214 |
+
parentVal,
|
1215 |
+
childVal,
|
1216 |
+
vm
|
1217 |
+
) {
|
1218 |
+
if (!vm) {
|
1219 |
+
// in a Vue.extend merge, both should be functions
|
1220 |
+
if (!childVal) {
|
1221 |
+
return parentVal
|
1222 |
+
}
|
1223 |
+
if (!parentVal) {
|
1224 |
+
return childVal
|
1225 |
+
}
|
1226 |
+
// when parentVal & childVal are both present,
|
1227 |
+
// we need to return a function that returns the
|
1228 |
+
// merged result of both functions... no need to
|
1229 |
+
// check if parentVal is a function here because
|
1230 |
+
// it has to be a function to pass previous merges.
|
1231 |
+
return function mergedDataFn () {
|
1232 |
+
return mergeData(
|
1233 |
+
typeof childVal === 'function' ? childVal.call(this, this) : childVal,
|
1234 |
+
typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
|
1235 |
+
)
|
1236 |
+
}
|
1237 |
+
} else {
|
1238 |
+
return function mergedInstanceDataFn () {
|
1239 |
+
// instance merge
|
1240 |
+
var instanceData = typeof childVal === 'function'
|
1241 |
+
? childVal.call(vm, vm)
|
1242 |
+
: childVal;
|
1243 |
+
var defaultData = typeof parentVal === 'function'
|
1244 |
+
? parentVal.call(vm, vm)
|
1245 |
+
: parentVal;
|
1246 |
+
if (instanceData) {
|
1247 |
+
return mergeData(instanceData, defaultData)
|
1248 |
+
} else {
|
1249 |
+
return defaultData
|
1250 |
+
}
|
1251 |
+
}
|
1252 |
+
}
|
1253 |
}
|
1254 |
|
1255 |
+
strats.data = function (
|
1256 |
+
parentVal,
|
1257 |
+
childVal,
|
1258 |
+
vm
|
1259 |
+
) {
|
1260 |
+
if (!vm) {
|
1261 |
+
if (childVal && typeof childVal !== 'function') {
|
1262 |
+
warn(
|
1263 |
+
'The "data" option should be a function ' +
|
1264 |
+
'that returns a per-instance value in component ' +
|
1265 |
+
'definitions.',
|
1266 |
+
vm
|
1267 |
+
);
|
1268 |
+
|
1269 |
+
return parentVal
|
1270 |
+
}
|
1271 |
+
return mergeDataOrFn(parentVal, childVal)
|
1272 |
+
}
|
1273 |
+
|
1274 |
+
return mergeDataOrFn(parentVal, childVal, vm)
|
1275 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1276 |
|
1277 |
+
/**
|
1278 |
+
* Hooks and props are merged as arrays.
|
1279 |
+
*/
|
1280 |
+
function mergeHook (
|
1281 |
+
parentVal,
|
1282 |
+
childVal
|
1283 |
+
) {
|
1284 |
+
var res = childVal
|
1285 |
+
? parentVal
|
1286 |
+
? parentVal.concat(childVal)
|
1287 |
+
: Array.isArray(childVal)
|
1288 |
+
? childVal
|
1289 |
+
: [childVal]
|
1290 |
+
: parentVal;
|
1291 |
+
return res
|
1292 |
+
? dedupeHooks(res)
|
1293 |
+
: res
|
1294 |
+
}
|
1295 |
+
|
1296 |
+
function dedupeHooks (hooks) {
|
1297 |
+
var res = [];
|
1298 |
+
for (var i = 0; i < hooks.length; i++) {
|
1299 |
+
if (res.indexOf(hooks[i]) === -1) {
|
1300 |
+
res.push(hooks[i]);
|
1301 |
+
}
|
1302 |
+
}
|
1303 |
+
return res
|
1304 |
}
|
1305 |
|
1306 |
+
LIFECYCLE_HOOKS.forEach(function (hook) {
|
1307 |
+
strats[hook] = mergeHook;
|
1308 |
+
});
|
1309 |
+
|
1310 |
+
/**
|
1311 |
+
* Assets
|
1312 |
+
*
|
1313 |
+
* When a vm is present (instance creation), we need to do
|
1314 |
+
* a three-way merge between constructor options, instance
|
1315 |
+
* options and parent options.
|
1316 |
+
*/
|
1317 |
+
function mergeAssets (
|
1318 |
+
parentVal,
|
1319 |
+
childVal,
|
1320 |
+
vm,
|
1321 |
+
key
|
1322 |
+
) {
|
1323 |
+
var res = Object.create(parentVal || null);
|
1324 |
+
if (childVal) {
|
1325 |
+
assertObjectType(key, childVal, vm);
|
1326 |
+
return extend(res, childVal)
|
1327 |
+
} else {
|
1328 |
+
return res
|
1329 |
+
}
|
1330 |
+
}
|
1331 |
|
|
|
|
|
1332 |
ASSET_TYPES.forEach(function (type) {
|
1333 |
+
strats[type + 's'] = mergeAssets;
|
1334 |
});
|
1335 |
+
|
1336 |
+
/**
|
1337 |
+
* Watchers.
|
1338 |
+
*
|
1339 |
+
* Watchers hashes should not overwrite one
|
1340 |
+
* another, so we merge them as arrays.
|
1341 |
+
*/
|
1342 |
+
strats.watch = function (
|
1343 |
+
parentVal,
|
1344 |
+
childVal,
|
1345 |
+
vm,
|
1346 |
+
key
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1347 |
) {
|
1348 |
+
// work around Firefox's Object.prototype.watch...
|
1349 |
+
if (parentVal === nativeWatch) { parentVal = undefined; }
|
1350 |
+
if (childVal === nativeWatch) { childVal = undefined; }
|
1351 |
+
/* istanbul ignore if */
|
1352 |
+
if (!childVal) { return Object.create(parentVal || null) }
|
1353 |
{
|
1354 |
+
assertObjectType(key, childVal, vm);
|
1355 |
+
}
|
1356 |
+
if (!parentVal) { return childVal }
|
1357 |
+
var ret = {};
|
1358 |
+
extend(ret, parentVal);
|
1359 |
+
for (var key$1 in childVal) {
|
1360 |
+
var parent = ret[key$1];
|
1361 |
+
var child = childVal[key$1];
|
1362 |
+
if (parent && !Array.isArray(parent)) {
|
1363 |
+
parent = [parent];
|
1364 |
+
}
|
1365 |
+
ret[key$1] = parent
|
1366 |
+
? parent.concat(child)
|
1367 |
+
: Array.isArray(child) ? child : [child];
|
1368 |
+
}
|
1369 |
+
return ret
|
1370 |
+
};
|
1371 |
+
|
1372 |
+
/**
|
1373 |
+
* Other object hashes.
|
1374 |
+
*/
|
1375 |
+
strats.props =
|
1376 |
+
strats.methods =
|
1377 |
+
strats.inject =
|
1378 |
+
strats.computed = function (
|
1379 |
+
parentVal,
|
1380 |
+
childVal,
|
1381 |
+
vm,
|
1382 |
+
key
|
1383 |
+
) {
|
1384 |
+
if (childVal && "development" !== 'production') {
|
1385 |
+
assertObjectType(key, childVal, vm);
|
1386 |
+
}
|
1387 |
+
if (!parentVal) { return childVal }
|
1388 |
+
var ret = Object.create(null);
|
1389 |
+
extend(ret, parentVal);
|
1390 |
+
if (childVal) { extend(ret, childVal); }
|
1391 |
+
return ret
|
1392 |
+
};
|
1393 |
+
strats.provide = mergeDataOrFn;
|
1394 |
+
|
1395 |
+
/**
|
1396 |
+
* Default strategy.
|
1397 |
+
*/
|
1398 |
+
var defaultStrat = function (parentVal, childVal) {
|
1399 |
+
return childVal === undefined
|
1400 |
+
? parentVal
|
1401 |
+
: childVal
|
1402 |
+
};
|
1403 |
+
|
1404 |
+
/**
|
1405 |
+
* Validate component names
|
1406 |
+
*/
|
1407 |
+
function checkComponents (options) {
|
1408 |
+
for (var key in options.components) {
|
1409 |
+
validateComponentName(key);
|
1410 |
+
}
|
1411 |
+
}
|
1412 |
+
|
1413 |
+
function validateComponentName (name) {
|
1414 |
+
if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
|
1415 |
warn(
|
1416 |
+
'Invalid component name: "' + name + '". Component names ' +
|
1417 |
+
'should conform to valid custom element name in html5 specification.'
|
1418 |
);
|
|
|
1419 |
}
|
1420 |
+
if (isBuiltInTag(name) || config.isReservedTag(name)) {
|
1421 |
+
warn(
|
1422 |
+
'Do not use built-in or reserved HTML elements as component ' +
|
1423 |
+
'id: ' + name
|
1424 |
+
);
|
1425 |
}
|
1426 |
+
}
|
1427 |
+
|
1428 |
+
/**
|
1429 |
+
* Ensure all props option syntax are normalized into the
|
1430 |
+
* Object-based format.
|
1431 |
+
*/
|
1432 |
+
function normalizeProps (options, vm) {
|
1433 |
+
var props = options.props;
|
1434 |
+
if (!props) { return }
|
1435 |
+
var res = {};
|
1436 |
+
var i, val, name;
|
1437 |
+
if (Array.isArray(props)) {
|
1438 |
+
i = props.length;
|
1439 |
+
while (i--) {
|
1440 |
+
val = props[i];
|
1441 |
+
if (typeof val === 'string') {
|
1442 |
+
name = camelize(val);
|
1443 |
+
res[name] = { type: null };
|
1444 |
+
} else {
|
1445 |
+
warn('props must be strings when using array syntax.');
|
1446 |
+
}
|
1447 |
+
}
|
1448 |
+
} else if (isPlainObject(props)) {
|
1449 |
+
for (var key in props) {
|
1450 |
+
val = props[key];
|
1451 |
+
name = camelize(key);
|
1452 |
+
res[name] = isPlainObject(val)
|
1453 |
+
? val
|
1454 |
+
: { type: val };
|
1455 |
+
}
|
1456 |
+
} else {
|
1457 |
+
warn(
|
1458 |
+
"Invalid value for option \"props\": expected an Array or an Object, " +
|
1459 |
+
"but got " + (toRawType(props)) + ".",
|
1460 |
+
vm
|
1461 |
+
);
|
1462 |
}
|
1463 |
+
options.props = res;
|
1464 |
+
}
|
1465 |
+
|
1466 |
+
/**
|
1467 |
+
* Normalize all injections into Object-based format
|
1468 |
+
*/
|
1469 |
+
function normalizeInject (options, vm) {
|
1470 |
+
var inject = options.inject;
|
1471 |
+
if (!inject) { return }
|
1472 |
+
var normalized = options.inject = {};
|
1473 |
+
if (Array.isArray(inject)) {
|
1474 |
+
for (var i = 0; i < inject.length; i++) {
|
1475 |
+
normalized[inject[i]] = { from: inject[i] };
|
1476 |
+
}
|
1477 |
+
} else if (isPlainObject(inject)) {
|
1478 |
+
for (var key in inject) {
|
1479 |
+
var val = inject[key];
|
1480 |
+
normalized[key] = isPlainObject(val)
|
1481 |
+
? extend({ from: key }, val)
|
1482 |
+
: { from: val };
|
1483 |
+
}
|
1484 |
+
} else {
|
1485 |
+
warn(
|
1486 |
+
"Invalid value for option \"inject\": expected an Array or an Object, " +
|
1487 |
+
"but got " + (toRawType(inject)) + ".",
|
1488 |
+
vm
|
1489 |
+
);
|
1490 |
+
}
|
1491 |
+
}
|
1492 |
|
1493 |
+
/**
|
1494 |
+
* Normalize raw function directives into object format.
|
1495 |
+
*/
|
1496 |
+
function normalizeDirectives (options) {
|
1497 |
+
var dirs = options.directives;
|
1498 |
+
if (dirs) {
|
1499 |
+
for (var key in dirs) {
|
1500 |
+
var def$$1 = dirs[key];
|
1501 |
+
if (typeof def$$1 === 'function') {
|
1502 |
+
dirs[key] = { bind: def$$1, update: def$$1 };
|
1503 |
+
}
|
1504 |
+
}
|
1505 |
+
}
|
1506 |
+
}
|
1507 |
|
1508 |
+
function assertObjectType (name, value, vm) {
|
1509 |
+
if (!isPlainObject(value)) {
|
1510 |
+
warn(
|
1511 |
+
"Invalid value for option \"" + name + "\": expected an Object, " +
|
1512 |
+
"but got " + (toRawType(value)) + ".",
|
1513 |
+
vm
|
1514 |
+
);
|
1515 |
+
}
|
1516 |
+
}
|
1517 |
|
1518 |
+
/**
|
1519 |
+
* Merge two option objects into a new one.
|
1520 |
+
* Core utility used in both instantiation and inheritance.
|
1521 |
+
*/
|
1522 |
+
function mergeOptions (
|
1523 |
+
parent,
|
1524 |
+
child,
|
1525 |
+
vm
|
1526 |
+
) {
|
1527 |
+
{
|
1528 |
+
checkComponents(child);
|
1529 |
+
}
|
1530 |
|
1531 |
+
if (typeof child === 'function') {
|
1532 |
+
child = child.options;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1533 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1534 |
|
1535 |
+
normalizeProps(child, vm);
|
1536 |
+
normalizeInject(child, vm);
|
1537 |
+
normalizeDirectives(child);
|
1538 |
+
|
1539 |
+
// Apply extends and mixins on the child options,
|
1540 |
+
// but only if it is a raw options object that isn't
|
1541 |
+
// the result of another mergeOptions call.
|
1542 |
+
// Only merged options has the _base property.
|
1543 |
+
if (!child._base) {
|
1544 |
+
if (child.extends) {
|
1545 |
+
parent = mergeOptions(parent, child.extends, vm);
|
1546 |
+
}
|
1547 |
+
if (child.mixins) {
|
1548 |
+
for (var i = 0, l = child.mixins.length; i < l; i++) {
|
1549 |
+
parent = mergeOptions(parent, child.mixins[i], vm);
|
1550 |
+
}
|
1551 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1552 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1553 |
|
1554 |
+
var options = {};
|
1555 |
+
var key;
|
1556 |
+
for (key in parent) {
|
1557 |
+
mergeField(key);
|
1558 |
+
}
|
1559 |
+
for (key in child) {
|
1560 |
+
if (!hasOwn(parent, key)) {
|
1561 |
+
mergeField(key);
|
1562 |
+
}
|
1563 |
+
}
|
1564 |
+
function mergeField (key) {
|
1565 |
+
var strat = strats[key] || defaultStrat;
|
1566 |
+
options[key] = strat(parent[key], child[key], vm, key);
|
1567 |
+
}
|
1568 |
+
return options
|
1569 |
+
}
|
1570 |
+
|
1571 |
+
/**
|
1572 |
+
* Resolve an asset.
|
1573 |
+
* This function is used because child instances need access
|
1574 |
+
* to assets defined in its ancestor chain.
|
1575 |
+
*/
|
1576 |
+
function resolveAsset (
|
1577 |
+
options,
|
1578 |
+
type,
|
1579 |
+
id,
|
1580 |
+
warnMissing
|
1581 |
+
) {
|
1582 |
/* istanbul ignore if */
|
1583 |
+
if (typeof id !== 'string') {
|
1584 |
+
return
|
1585 |
+
}
|
1586 |
+
var assets = options[type];
|
1587 |
+
// check local registration variations first
|
1588 |
+
if (hasOwn(assets, id)) { return assets[id] }
|
1589 |
+
var camelizedId = camelize(id);
|
1590 |
+
if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
|
1591 |
+
var PascalCaseId = capitalize(camelizedId);
|
1592 |
+
if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
|
1593 |
+
// fallback to prototype chain
|
1594 |
+
var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
|
1595 |
+
if (warnMissing && !res) {
|
1596 |
+
warn(
|
1597 |
+
'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
|
1598 |
+
options
|
1599 |
+
);
|
1600 |
+
}
|
1601 |
+
return res
|
1602 |
+
}
|
1603 |
+
|
1604 |
+
/* */
|
1605 |
+
|
1606 |
+
|
1607 |
+
|
1608 |
+
function validateProp (
|
1609 |
+
key,
|
1610 |
+
propOptions,
|
1611 |
+
propsData,
|
1612 |
+
vm
|
1613 |
+
) {
|
1614 |
+
var prop = propOptions[key];
|
1615 |
+
var absent = !hasOwn(propsData, key);
|
1616 |
+
var value = propsData[key];
|
1617 |
+
// boolean casting
|
1618 |
+
var booleanIndex = getTypeIndex(Boolean, prop.type);
|
1619 |
+
if (booleanIndex > -1) {
|
1620 |
+
if (absent && !hasOwn(prop, 'default')) {
|
1621 |
+
value = false;
|
1622 |
+
} else if (value === '' || value === hyphenate(key)) {
|
1623 |
+
// only cast empty string / same name to boolean if
|
1624 |
+
// boolean has higher priority
|
1625 |
+
var stringIndex = getTypeIndex(String, prop.type);
|
1626 |
+
if (stringIndex < 0 || booleanIndex < stringIndex) {
|
1627 |
+
value = true;
|
1628 |
+
}
|
1629 |
+
}
|
1630 |
+
}
|
1631 |
+
// check default value
|
1632 |
+
if (value === undefined) {
|
1633 |
+
value = getPropDefaultValue(vm, prop, key);
|
1634 |
+
// since the default value is a fresh copy,
|
1635 |
+
// make sure to observe it.
|
1636 |
+
var prevShouldObserve = shouldObserve;
|
1637 |
+
toggleObserving(true);
|
1638 |
+
observe(value);
|
1639 |
+
toggleObserving(prevShouldObserve);
|
1640 |
+
}
|
1641 |
+
{
|
1642 |
+
assertProp(prop, key, value, vm, absent);
|
1643 |
+
}
|
1644 |
+
return value
|
1645 |
+
}
|
1646 |
+
|
1647 |
+
/**
|
1648 |
+
* Get the default value of a prop.
|
1649 |
+
*/
|
1650 |
+
function getPropDefaultValue (vm, prop, key) {
|
1651 |
+
// no default, return undefined
|
1652 |
+
if (!hasOwn(prop, 'default')) {
|
1653 |
+
return undefined
|
1654 |
+
}
|
1655 |
+
var def = prop.default;
|
1656 |
+
// warn against non-factory defaults for Object & Array
|
1657 |
+
if (isObject(def)) {
|
1658 |
+
warn(
|
1659 |
+
'Invalid default value for prop "' + key + '": ' +
|
1660 |
+
'Props with type Object/Array must use a factory function ' +
|
1661 |
+
'to return the default value.',
|
1662 |
+
vm
|
1663 |
+
);
|
1664 |
+
}
|
1665 |
+
// the raw prop value was also undefined from previous render,
|
1666 |
+
// return previous default value to avoid unnecessary watcher trigger
|
1667 |
+
if (vm && vm.$options.propsData &&
|
1668 |
+
vm.$options.propsData[key] === undefined &&
|
1669 |
+
vm._props[key] !== undefined
|
1670 |
+
) {
|
1671 |
+
return vm._props[key]
|
1672 |
+
}
|
1673 |
+
// call factory function for non-Function types
|
1674 |
+
// a value is Function if its prototype is function even across different execution context
|
1675 |
+
return typeof def === 'function' && getType(prop.type) !== 'Function'
|
1676 |
+
? def.call(vm)
|
1677 |
+
: def
|
1678 |
+
}
|
1679 |
+
|
1680 |
+
/**
|
1681 |
+
* Assert whether a prop is valid.
|
1682 |
+
*/
|
1683 |
+
function assertProp (
|
1684 |
+
prop,
|
1685 |
+
name,
|
1686 |
+
value,
|
1687 |
+
vm,
|
1688 |
+
absent
|
1689 |
+
) {
|
1690 |
+
if (prop.required && absent) {
|
1691 |
+
warn(
|
1692 |
+
'Missing required prop: "' + name + '"',
|
1693 |
+
vm
|
1694 |
+
);
|
1695 |
+
return
|
1696 |
+
}
|
1697 |
+
if (value == null && !prop.required) {
|
1698 |
+
return
|
1699 |
+
}
|
1700 |
+
var type = prop.type;
|
1701 |
+
var valid = !type || type === true;
|
1702 |
+
var expectedTypes = [];
|
1703 |
+
if (type) {
|
1704 |
+
if (!Array.isArray(type)) {
|
1705 |
+
type = [type];
|
1706 |
+
}
|
1707 |
+
for (var i = 0; i < type.length && !valid; i++) {
|
1708 |
+
var assertedType = assertType(value, type[i]);
|
1709 |
+
expectedTypes.push(assertedType.expectedType || '');
|
1710 |
+
valid = assertedType.valid;
|
1711 |
+
}
|
1712 |
+
}
|
1713 |
+
|
1714 |
+
if (!valid) {
|
1715 |
+
warn(
|
1716 |
+
getInvalidTypeMessage(name, value, expectedTypes),
|
1717 |
+
vm
|
1718 |
+
);
|
1719 |
+
return
|
1720 |
+
}
|
1721 |
+
var validator = prop.validator;
|
1722 |
+
if (validator) {
|
1723 |
+
if (!validator(value)) {
|
1724 |
+
warn(
|
1725 |
+
'Invalid prop: custom validator check failed for prop "' + name + '".',
|
1726 |
+
vm
|
1727 |
+
);
|
1728 |
+
}
|
1729 |
+
}
|
1730 |
+
}
|
1731 |
+
|
1732 |
+
var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
|
1733 |
+
|
1734 |
+
function assertType (value, type) {
|
1735 |
+
var valid;
|
1736 |
+
var expectedType = getType(type);
|
1737 |
+
if (simpleCheckRE.test(expectedType)) {
|
1738 |
+
var t = typeof value;
|
1739 |
+
valid = t === expectedType.toLowerCase();
|
1740 |
+
// for primitive wrapper objects
|
1741 |
+
if (!valid && t === 'object') {
|
1742 |
+
valid = value instanceof type;
|
1743 |
+
}
|
1744 |
+
} else if (expectedType === 'Object') {
|
1745 |
+
valid = isPlainObject(value);
|
1746 |
+
} else if (expectedType === 'Array') {
|
1747 |
+
valid = Array.isArray(value);
|
1748 |
+
} else {
|
1749 |
+
valid = value instanceof type;
|
1750 |
+
}
|
1751 |
+
return {
|
1752 |
+
valid: valid,
|
1753 |
+
expectedType: expectedType
|
1754 |
+
}
|
1755 |
+
}
|
1756 |
+
|
1757 |
+
/**
|
1758 |
+
* Use function string name to check built-in types,
|
1759 |
+
* because a simple equality check will fail when running
|
1760 |
+
* across different vms / iframes.
|
1761 |
+
*/
|
1762 |
+
function getType (fn) {
|
1763 |
+
var match = fn && fn.toString().match(/^\s*function (\w+)/);
|
1764 |
+
return match ? match[1] : ''
|
1765 |
+
}
|
1766 |
+
|
1767 |
+
function isSameType (a, b) {
|
1768 |
+
return getType(a) === getType(b)
|
1769 |
+
}
|
1770 |
+
|
1771 |
+
function getTypeIndex (type, expectedTypes) {
|
1772 |
+
if (!Array.isArray(expectedTypes)) {
|
1773 |
+
return isSameType(expectedTypes, type) ? 0 : -1
|
1774 |
+
}
|
1775 |
+
for (var i = 0, len = expectedTypes.length; i < len; i++) {
|
1776 |
+
if (isSameType(expectedTypes[i], type)) {
|
1777 |
+
return i
|
1778 |
+
}
|
1779 |
+
}
|
1780 |
+
return -1
|
1781 |
+
}
|
1782 |
+
|
1783 |
+
function getInvalidTypeMessage (name, value, expectedTypes) {
|
1784 |
+
var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
|
1785 |
+
" Expected " + (expectedTypes.map(capitalize).join(', '));
|
1786 |
+
var expectedType = expectedTypes[0];
|
1787 |
+
var receivedType = toRawType(value);
|
1788 |
+
var expectedValue = styleValue(value, expectedType);
|
1789 |
+
var receivedValue = styleValue(value, receivedType);
|
1790 |
+
// check if we need to specify expected value
|
1791 |
+
if (expectedTypes.length === 1 &&
|
1792 |
+
isExplicable(expectedType) &&
|
1793 |
+
!isBoolean(expectedType, receivedType)) {
|
1794 |
+
message += " with value " + expectedValue;
|
1795 |
+
}
|
1796 |
+
message += ", got " + receivedType + " ";
|
1797 |
+
// check if we need to specify received value
|
1798 |
+
if (isExplicable(receivedType)) {
|
1799 |
+
message += "with value " + receivedValue + ".";
|
1800 |
+
}
|
1801 |
+
return message
|
1802 |
+
}
|
1803 |
+
|
1804 |
+
function styleValue (value, type) {
|
1805 |
+
if (type === 'String') {
|
1806 |
+
return ("\"" + value + "\"")
|
1807 |
+
} else if (type === 'Number') {
|
1808 |
+
return ("" + (Number(value)))
|
1809 |
+
} else {
|
1810 |
+
return ("" + value)
|
1811 |
+
}
|
1812 |
+
}
|
1813 |
+
|
1814 |
+
function isExplicable (value) {
|
1815 |
+
var explicitTypes = ['string', 'number', 'boolean'];
|
1816 |
+
return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
|
1817 |
+
}
|
1818 |
+
|
1819 |
+
function isBoolean () {
|
1820 |
+
var args = [], len = arguments.length;
|
1821 |
+
while ( len-- ) args[ len ] = arguments[ len ];
|
1822 |
+
|
1823 |
+
return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
|
1824 |
+
}
|
1825 |
+
|
1826 |
+
/* */
|
1827 |
+
|
1828 |
+
function handleError (err, vm, info) {
|
1829 |
+
// Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
|
1830 |
+
// See: https://github.com/vuejs/vuex/issues/1505
|
1831 |
+
pushTarget();
|
1832 |
+
try {
|
1833 |
+
if (vm) {
|
1834 |
+
var cur = vm;
|
1835 |
+
while ((cur = cur.$parent)) {
|
1836 |
+
var hooks = cur.$options.errorCaptured;
|
1837 |
+
if (hooks) {
|
1838 |
+
for (var i = 0; i < hooks.length; i++) {
|
1839 |
+
try {
|
1840 |
+
var capture = hooks[i].call(cur, err, vm, info) === false;
|
1841 |
+
if (capture) { return }
|
1842 |
+
} catch (e) {
|
1843 |
+
globalHandleError(e, cur, 'errorCaptured hook');
|
1844 |
+
}
|
1845 |
+
}
|
1846 |
+
}
|
1847 |
+
}
|
1848 |
+
}
|
1849 |
+
globalHandleError(err, vm, info);
|
1850 |
+
} finally {
|
1851 |
+
popTarget();
|
1852 |
+
}
|
1853 |
+
}
|
1854 |
+
|
1855 |
+
function invokeWithErrorHandling (
|
1856 |
+
handler,
|
1857 |
+
context,
|
1858 |
+
args,
|
1859 |
+
vm,
|
1860 |
+
info
|
1861 |
+
) {
|
1862 |
+
var res;
|
1863 |
+
try {
|
1864 |
+
res = args ? handler.apply(context, args) : handler.call(context);
|
1865 |
+
if (res && !res._isVue && isPromise(res) && !res._handled) {
|
1866 |
+
res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
|
1867 |
+
// issue #9511
|
1868 |
+
// avoid catch triggering multiple times when nested calls
|
1869 |
+
res._handled = true;
|
1870 |
+
}
|
1871 |
+
} catch (e) {
|
1872 |
+
handleError(e, vm, info);
|
1873 |
+
}
|
1874 |
+
return res
|
1875 |
+
}
|
1876 |
+
|
1877 |
+
function globalHandleError (err, vm, info) {
|
1878 |
+
if (config.errorHandler) {
|
1879 |
+
try {
|
1880 |
+
return config.errorHandler.call(null, err, vm, info)
|
1881 |
+
} catch (e) {
|
1882 |
+
// if the user intentionally throws the original error in the handler,
|
1883 |
+
// do not log it twice
|
1884 |
+
if (e !== err) {
|
1885 |
+
logError(e, null, 'config.errorHandler');
|
1886 |
+
}
|
1887 |
+
}
|
1888 |
+
}
|
1889 |
+
logError(err, vm, info);
|
1890 |
+
}
|
1891 |
+
|
1892 |
+
function logError (err, vm, info) {
|
1893 |
+
{
|
1894 |
+
warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
|
1895 |
+
}
|
1896 |
+
/* istanbul ignore else */
|
1897 |
+
if ((inBrowser || inWeex) && typeof console !== 'undefined') {
|
1898 |
+
console.error(err);
|
1899 |
+
} else {
|
1900 |
+
throw err
|
1901 |
+
}
|
1902 |
+
}
|
1903 |
+
|
1904 |
+
/* */
|
1905 |
+
|
1906 |
+
var isUsingMicroTask = false;
|
1907 |
+
|
1908 |
+
var callbacks = [];
|
1909 |
+
var pending = false;
|
1910 |
+
|
1911 |
+
function flushCallbacks () {
|
1912 |
+
pending = false;
|
1913 |
+
var copies = callbacks.slice(0);
|
1914 |
+
callbacks.length = 0;
|
1915 |
+
for (var i = 0; i < copies.length; i++) {
|
1916 |
+
copies[i]();
|
1917 |
+
}
|
1918 |
+
}
|
1919 |
+
|
1920 |
+
// Here we have async deferring wrappers using microtasks.
|
1921 |
+
// In 2.5 we used (macro) tasks (in combination with microtasks).
|
1922 |
+
// However, it has subtle problems when state is changed right before repaint
|
1923 |
+
// (e.g. #6813, out-in transitions).
|
1924 |
+
// Also, using (macro) tasks in event handler would cause some weird behaviors
|
1925 |
+
// that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
|
1926 |
+
// So we now use microtasks everywhere, again.
|
1927 |
+
// A major drawback of this tradeoff is that there are some scenarios
|
1928 |
+
// where microtasks have too high a priority and fire in between supposedly
|
1929 |
+
// sequential events (e.g. #4521, #6690, which have workarounds)
|
1930 |
+
// or even between bubbling of the same event (#6566).
|
1931 |
+
var timerFunc;
|
1932 |
+
|
1933 |
+
// The nextTick behavior leverages the microtask queue, which can be accessed
|
1934 |
+
// via either native Promise.then or MutationObserver.
|
1935 |
+
// MutationObserver has wider support, however it is seriously bugged in
|
1936 |
+
// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
|
1937 |
+
// completely stops working after triggering a few times... so, if native
|
1938 |
+
// Promise is available, we will use it:
|
1939 |
+
/* istanbul ignore next, $flow-disable-line */
|
1940 |
+
if (typeof Promise !== 'undefined' && isNative(Promise)) {
|
1941 |
+
var p = Promise.resolve();
|
1942 |
+
timerFunc = function () {
|
1943 |
+
p.then(flushCallbacks);
|
1944 |
+
// In problematic UIWebViews, Promise.then doesn't completely break, but
|
1945 |
+
// it can get stuck in a weird state where callbacks are pushed into the
|
1946 |
+
// microtask queue but the queue isn't being flushed, until the browser
|
1947 |
+
// needs to do some other work, e.g. handle a timer. Therefore we can
|
1948 |
+
// "force" the microtask queue to be flushed by adding an empty timer.
|
1949 |
+
if (isIOS) { setTimeout(noop); }
|
1950 |
+
};
|
1951 |
+
isUsingMicroTask = true;
|
1952 |
+
} else if (!isIE && typeof MutationObserver !== 'undefined' && (
|
1953 |
+
isNative(MutationObserver) ||
|
1954 |
+
// PhantomJS and iOS 7.x
|
1955 |
+
MutationObserver.toString() === '[object MutationObserverConstructor]'
|
1956 |
+
)) {
|
1957 |
+
// Use MutationObserver where native Promise is not available,
|
1958 |
+
// e.g. PhantomJS, iOS7, Android 4.4
|
1959 |
+
// (#6466 MutationObserver is unreliable in IE11)
|
1960 |
+
var counter = 1;
|
1961 |
+
var observer = new MutationObserver(flushCallbacks);
|
1962 |
+
var textNode = document.createTextNode(String(counter));
|
1963 |
+
observer.observe(textNode, {
|
1964 |
+
characterData: true
|
1965 |
+
});
|
1966 |
+
timerFunc = function () {
|
1967 |
+
counter = (counter + 1) % 2;
|
1968 |
+
textNode.data = String(counter);
|
1969 |
+
};
|
1970 |
+
isUsingMicroTask = true;
|
1971 |
+
} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
|
1972 |
+
// Fallback to setImmediate.
|
1973 |
+
// Techinically it leverages the (macro) task queue,
|
1974 |
+
// but it is still a better choice than setTimeout.
|
1975 |
+
timerFunc = function () {
|
1976 |
+
setImmediate(flushCallbacks);
|
1977 |
+
};
|
1978 |
+
} else {
|
1979 |
+
// Fallback to setTimeout.
|
1980 |
+
timerFunc = function () {
|
1981 |
+
setTimeout(flushCallbacks, 0);
|
1982 |
+
};
|
1983 |
+
}
|
1984 |
+
|
1985 |
+
function nextTick (cb, ctx) {
|
1986 |
+
var _resolve;
|
1987 |
+
callbacks.push(function () {
|
1988 |
+
if (cb) {
|
1989 |
+
try {
|
1990 |
+
cb.call(ctx);
|
1991 |
+
} catch (e) {
|
1992 |
+
handleError(e, ctx, 'nextTick');
|
1993 |
+
}
|
1994 |
+
} else if (_resolve) {
|
1995 |
+
_resolve(ctx);
|
1996 |
+
}
|
1997 |
+
});
|
1998 |
+
if (!pending) {
|
1999 |
+
pending = true;
|
2000 |
+
timerFunc();
|
2001 |
+
}
|
2002 |
+
// $flow-disable-line
|
2003 |
+
if (!cb && typeof Promise !== 'undefined') {
|
2004 |
+
return new Promise(function (resolve) {
|
2005 |
+
_resolve = resolve;
|
2006 |
+
})
|
2007 |
+
}
|
2008 |
+
}
|
2009 |
+
|
2010 |
+
/* */
|
2011 |
+
|
2012 |
+
var mark;
|
2013 |
+
var measure;
|
2014 |
+
|
2015 |
+
{
|
2016 |
+
var perf = inBrowser && window.performance;
|
2017 |
+
/* istanbul ignore if */
|
2018 |
+
if (
|
2019 |
+
perf &&
|
2020 |
+
perf.mark &&
|
2021 |
+
perf.measure &&
|
2022 |
+
perf.clearMarks &&
|
2023 |
+
perf.clearMeasures
|
2024 |
+
) {
|
2025 |
+
mark = function (tag) { return perf.mark(tag); };
|
2026 |
+
measure = function (name, startTag, endTag) {
|
2027 |
+
perf.measure(name, startTag, endTag);
|
2028 |
+
perf.clearMarks(startTag);
|
2029 |
+
perf.clearMarks(endTag);
|
2030 |
+
// perf.clearMeasures(name)
|
2031 |
+
};
|
2032 |
+
}
|
2033 |
+
}
|
2034 |
+
|
2035 |
+
/* not type checking this file because flow doesn't play well with Proxy */
|
2036 |
+
|
2037 |
+
var initProxy;
|
2038 |
+
|
2039 |
+
{
|
2040 |
+
var allowedGlobals = makeMap(
|
2041 |
+
'Infinity,undefined,NaN,isFinite,isNaN,' +
|
2042 |
+
'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
|
2043 |
+
'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
|
2044 |
+
'require' // for Webpack/Browserify
|
2045 |
+
);
|
2046 |
+
|
2047 |
+
var warnNonPresent = function (target, key) {
|
2048 |
+
warn(
|
2049 |
+
"Property or method \"" + key + "\" is not defined on the instance but " +
|
2050 |
+
'referenced during render. Make sure that this property is reactive, ' +
|
2051 |
+
'either in the data option, or for class-based components, by ' +
|
2052 |
+
'initializing the property. ' +
|
2053 |
+
'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
|
2054 |
+
target
|
2055 |
+
);
|
2056 |
+
};
|
2057 |
+
|
2058 |
+
var warnReservedPrefix = function (target, key) {
|
2059 |
+
warn(
|
2060 |
+
"Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
|
2061 |
+
'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
|
2062 |
+
'prevent conflicts with Vue internals' +
|
2063 |
+
'See: https://vuejs.org/v2/api/#data',
|
2064 |
+
target
|
2065 |
+
);
|
2066 |
+
};
|
2067 |
+
|
2068 |
+
var hasProxy =
|
2069 |
+
typeof Proxy !== 'undefined' && isNative(Proxy);
|
2070 |
+
|
2071 |
+
if (hasProxy) {
|
2072 |
+
var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
|
2073 |
+
config.keyCodes = new Proxy(config.keyCodes, {
|
2074 |
+
set: function set (target, key, value) {
|
2075 |
+
if (isBuiltInModifier(key)) {
|
2076 |
+
warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
|
2077 |
+
return false
|
2078 |
+
} else {
|
2079 |
+
target[key] = value;
|
2080 |
+
return true
|
2081 |
+
}
|
2082 |
+
}
|
2083 |
+
});
|
2084 |
+
}
|
2085 |
+
|
2086 |
+
var hasHandler = {
|
2087 |
+
has: function has (target, key) {
|
2088 |
+
var has = key in target;
|
2089 |
+
var isAllowed = allowedGlobals(key) ||
|
2090 |
+
(typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
|
2091 |
+
if (!has && !isAllowed) {
|
2092 |
+
if (key in target.$data) { warnReservedPrefix(target, key); }
|
2093 |
+
else { warnNonPresent(target, key); }
|
2094 |
+
}
|
2095 |
+
return has || !isAllowed
|
2096 |
+
}
|
2097 |
+
};
|
2098 |
+
|
2099 |
+
var getHandler = {
|
2100 |
+
get: function get (target, key) {
|
2101 |
+
if (typeof key === 'string' && !(key in target)) {
|
2102 |
+
if (key in target.$data) { warnReservedPrefix(target, key); }
|
2103 |
+
else { warnNonPresent(target, key); }
|
2104 |
+
}
|
2105 |
+
return target[key]
|
2106 |
+
}
|
2107 |
+
};
|
2108 |
+
|
2109 |
+
initProxy = function initProxy (vm) {
|
2110 |
+
if (hasProxy) {
|
2111 |
+
// determine which proxy handler to use
|
2112 |
+
var options = vm.$options;
|
2113 |
+
var handlers = options.render && options.render._withStripped
|
2114 |
+
? getHandler
|
2115 |
+
: hasHandler;
|
2116 |
+
vm._renderProxy = new Proxy(vm, handlers);
|
2117 |
+
} else {
|
2118 |
+
vm._renderProxy = vm;
|
2119 |
+
}
|
2120 |
+
};
|
2121 |
+
}
|
2122 |
+
|
2123 |
+
/* */
|
2124 |
+
|
2125 |
+
var seenObjects = new _Set();
|
2126 |
+
|
2127 |
+
/**
|
2128 |
+
* Recursively traverse an object to evoke all converted
|
2129 |
+
* getters, so that every nested property inside the object
|
2130 |
+
* is collected as a "deep" dependency.
|
2131 |
+
*/
|
2132 |
+
function traverse (val) {
|
2133 |
+
_traverse(val, seenObjects);
|
2134 |
+
seenObjects.clear();
|
2135 |
+
}
|
2136 |
+
|
2137 |
+
function _traverse (val, seen) {
|
2138 |
+
var i, keys;
|
2139 |
+
var isA = Array.isArray(val);
|
2140 |
+
if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
|
2141 |
+
return
|
2142 |
+
}
|
2143 |
+
if (val.__ob__) {
|
2144 |
+
var depId = val.__ob__.dep.id;
|
2145 |
+
if (seen.has(depId)) {
|
2146 |
+
return
|
2147 |
+
}
|
2148 |
+
seen.add(depId);
|
2149 |
+
}
|
2150 |
+
if (isA) {
|
2151 |
+
i = val.length;
|
2152 |
+
while (i--) { _traverse(val[i], seen); }
|
2153 |
+
} else {
|
2154 |
+
keys = Object.keys(val);
|
2155 |
+
i = keys.length;
|
2156 |
+
while (i--) { _traverse(val[keys[i]], seen); }
|
2157 |
+
}
|
2158 |
+
}
|
2159 |
+
|
2160 |
+
/* */
|
2161 |
+
|
2162 |
+
var normalizeEvent = cached(function (name) {
|
2163 |
+
var passive = name.charAt(0) === '&';
|
2164 |
+
name = passive ? name.slice(1) : name;
|
2165 |
+
var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
|
2166 |
+
name = once$$1 ? name.slice(1) : name;
|
2167 |
+
var capture = name.charAt(0) === '!';
|
2168 |
+
name = capture ? name.slice(1) : name;
|
2169 |
+
return {
|
2170 |
+
name: name,
|
2171 |
+
once: once$$1,
|
2172 |
+
capture: capture,
|
2173 |
+
passive: passive
|
2174 |
+
}
|
2175 |
+
});
|
2176 |
+
|
2177 |
+
function createFnInvoker (fns, vm) {
|
2178 |
+
function invoker () {
|
2179 |
+
var arguments$1 = arguments;
|
2180 |
+
|
2181 |
+
var fns = invoker.fns;
|
2182 |
+
if (Array.isArray(fns)) {
|
2183 |
+
var cloned = fns.slice();
|
2184 |
+
for (var i = 0; i < cloned.length; i++) {
|
2185 |
+
invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
|
2186 |
+
}
|
2187 |
+
} else {
|
2188 |
+
// return handler return value for single handlers
|
2189 |
+
return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
|
2190 |
+
}
|
2191 |
+
}
|
2192 |
+
invoker.fns = fns;
|
2193 |
+
return invoker
|
2194 |
+
}
|
2195 |
+
|
2196 |
+
function updateListeners (
|
2197 |
+
on,
|
2198 |
+
oldOn,
|
2199 |
+
add,
|
2200 |
+
remove$$1,
|
2201 |
+
createOnceHandler,
|
2202 |
+
vm
|
2203 |
+
) {
|
2204 |
+
var name, def$$1, cur, old, event;
|
2205 |
+
for (name in on) {
|
2206 |
+
def$$1 = cur = on[name];
|
2207 |
+
old = oldOn[name];
|
2208 |
+
event = normalizeEvent(name);
|
2209 |
+
if (isUndef(cur)) {
|
2210 |
+
warn(
|
2211 |
+
"Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
|
2212 |
+
vm
|
2213 |
+
);
|
2214 |
+
} else if (isUndef(old)) {
|
2215 |
+
if (isUndef(cur.fns)) {
|
2216 |
+
cur = on[name] = createFnInvoker(cur, vm);
|
2217 |
+
}
|
2218 |
+
if (isTrue(event.once)) {
|
2219 |
+
cur = on[name] = createOnceHandler(event.name, cur, event.capture);
|
2220 |
+
}
|
2221 |
+
add(event.name, cur, event.capture, event.passive, event.params);
|
2222 |
+
} else if (cur !== old) {
|
2223 |
+
old.fns = cur;
|
2224 |
+
on[name] = old;
|
2225 |
+
}
|
2226 |
+
}
|
2227 |
+
for (name in oldOn) {
|
2228 |
+
if (isUndef(on[name])) {
|
2229 |
+
event = normalizeEvent(name);
|
2230 |
+
remove$$1(event.name, oldOn[name], event.capture);
|
2231 |
+
}
|
2232 |
+
}
|
2233 |
+
}
|
2234 |
+
|
2235 |
+
/* */
|
2236 |
+
|
2237 |
+
function mergeVNodeHook (def, hookKey, hook) {
|
2238 |
+
if (def instanceof VNode) {
|
2239 |
+
def = def.data.hook || (def.data.hook = {});
|
2240 |
+
}
|
2241 |
+
var invoker;
|
2242 |
+
var oldHook = def[hookKey];
|
2243 |
+
|
2244 |
+
function wrappedHook () {
|
2245 |
+
hook.apply(this, arguments);
|
2246 |
+
// important: remove merged hook to ensure it's called only once
|
2247 |
+
// and prevent memory leak
|
2248 |
+
remove(invoker.fns, wrappedHook);
|
2249 |
+
}
|
2250 |
+
|
2251 |
+
if (isUndef(oldHook)) {
|
2252 |
+
// no existing hook
|
2253 |
+
invoker = createFnInvoker([wrappedHook]);
|
2254 |
+
} else {
|
2255 |
+
/* istanbul ignore if */
|
2256 |
+
if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
|
2257 |
+
// already a merged invoker
|
2258 |
+
invoker = oldHook;
|
2259 |
+
invoker.fns.push(wrappedHook);
|
2260 |
+
} else {
|
2261 |
+
// existing plain hook
|
2262 |
+
invoker = createFnInvoker([oldHook, wrappedHook]);
|
2263 |
+
}
|
2264 |
+
}
|
2265 |
+
|
2266 |
+
invoker.merged = true;
|
2267 |
+
def[hookKey] = invoker;
|
2268 |
+
}
|
2269 |
+
|
2270 |
+
/* */
|
2271 |
+
|
2272 |
+
function extractPropsFromVNodeData (
|
2273 |
+
data,
|
2274 |
+
Ctor,
|
2275 |
+
tag
|
2276 |
+
) {
|
2277 |
+
// we are only extracting raw values here.
|
2278 |
+
// validation and default values are handled in the child
|
2279 |
+
// component itself.
|
2280 |
+
var propOptions = Ctor.options.props;
|
2281 |
+
if (isUndef(propOptions)) {
|
2282 |
+
return
|
2283 |
+
}
|
2284 |
+
var res = {};
|
2285 |
+
var attrs = data.attrs;
|
2286 |
+
var props = data.props;
|
2287 |
+
if (isDef(attrs) || isDef(props)) {
|
2288 |
+
for (var key in propOptions) {
|
2289 |
+
var altKey = hyphenate(key);
|
2290 |
+
{
|
2291 |
+
var keyInLowerCase = key.toLowerCase();
|
2292 |
+
if (
|
2293 |
+
key !== keyInLowerCase &&
|
2294 |
+
attrs && hasOwn(attrs, keyInLowerCase)
|
2295 |
+
) {
|
2296 |
+
tip(
|
2297 |
+
"Prop \"" + keyInLowerCase + "\" is passed to component " +
|
2298 |
+
(formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
|
2299 |
+
" \"" + key + "\". " +
|
2300 |
+
"Note that HTML attributes are case-insensitive and camelCased " +
|
2301 |
+
"props need to use their kebab-case equivalents when using in-DOM " +
|
2302 |
+
"templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
|
2303 |
+
);
|
2304 |
+
}
|
2305 |
+
}
|
2306 |
+
checkProp(res, props, key, altKey, true) ||
|
2307 |
+
checkProp(res, attrs, key, altKey, false);
|
2308 |
+
}
|
2309 |
+
}
|
2310 |
+
return res
|
2311 |
+
}
|
2312 |
+
|
2313 |
+
function checkProp (
|
2314 |
+
res,
|
2315 |
+
hash,
|
2316 |
+
key,
|
2317 |
+
altKey,
|
2318 |
+
preserve
|
2319 |
+
) {
|
2320 |
+
if (isDef(hash)) {
|
2321 |
+
if (hasOwn(hash, key)) {
|
2322 |
+
res[key] = hash[key];
|
2323 |
+
if (!preserve) {
|
2324 |
+
delete hash[key];
|
2325 |
+
}
|
2326 |
+
return true
|
2327 |
+
} else if (hasOwn(hash, altKey)) {
|
2328 |
+
res[key] = hash[altKey];
|
2329 |
+
if (!preserve) {
|
2330 |
+
delete hash[altKey];
|
2331 |
+
}
|
2332 |
+
return true
|
2333 |
+
}
|
2334 |
+
}
|
2335 |
+
return false
|
2336 |
+
}
|
2337 |
+
|
2338 |
+
/* */
|
2339 |
+
|
2340 |
+
// The template compiler attempts to minimize the need for normalization by
|
2341 |
+
// statically analyzing the template at compile time.
|
2342 |
+
//
|
2343 |
+
// For plain HTML markup, normalization can be completely skipped because the
|
2344 |
+
// generated render function is guaranteed to return Array<VNode>. There are
|
2345 |
+
// two cases where extra normalization is needed:
|
2346 |
+
|
2347 |
+
// 1. When the children contains components - because a functional component
|
2348 |
+
// may return an Array instead of a single root. In this case, just a simple
|
2349 |
+
// normalization is needed - if any child is an Array, we flatten the whole
|
2350 |
+
// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
|
2351 |
+
// because functional components already normalize their own children.
|
2352 |
+
function simpleNormalizeChildren (children) {
|
2353 |
+
for (var i = 0; i < children.length; i++) {
|
2354 |
+
if (Array.isArray(children[i])) {
|
2355 |
+
return Array.prototype.concat.apply([], children)
|
2356 |
+
}
|
2357 |
+
}
|
2358 |
+
return children
|
2359 |
+
}
|
2360 |
+
|
2361 |
+
// 2. When the children contains constructs that always generated nested Arrays,
|
2362 |
+
// e.g. <template>, <slot>, v-for, or when the children is provided by user
|
2363 |
+
// with hand-written render functions / JSX. In such cases a full normalization
|
2364 |
+
// is needed to cater to all possible types of children values.
|
2365 |
+
function normalizeChildren (children) {
|
2366 |
+
return isPrimitive(children)
|
2367 |
+
? [createTextVNode(children)]
|
2368 |
+
: Array.isArray(children)
|
2369 |
+
? normalizeArrayChildren(children)
|
2370 |
+
: undefined
|
2371 |
+
}
|
2372 |
+
|
2373 |
+
function isTextNode (node) {
|
2374 |
+
return isDef(node) && isDef(node.text) && isFalse(node.isComment)
|
2375 |
+
}
|
2376 |
+
|
2377 |
+
function normalizeArrayChildren (children, nestedIndex) {
|
2378 |
+
var res = [];
|
2379 |
+
var i, c, lastIndex, last;
|
2380 |
+
for (i = 0; i < children.length; i++) {
|
2381 |
+
c = children[i];
|
2382 |
+
if (isUndef(c) || typeof c === 'boolean') { continue }
|
2383 |
+
lastIndex = res.length - 1;
|
2384 |
+
last = res[lastIndex];
|
2385 |
+
// nested
|
2386 |
+
if (Array.isArray(c)) {
|
2387 |
+
if (c.length > 0) {
|
2388 |
+
c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
|
2389 |
+
// merge adjacent text nodes
|
2390 |
+
if (isTextNode(c[0]) && isTextNode(last)) {
|
2391 |
+
res[lastIndex] = createTextVNode(last.text + (c[0]).text);
|
2392 |
+
c.shift();
|
2393 |
+
}
|
2394 |
+
res.push.apply(res, c);
|
2395 |
+
}
|
2396 |
+
} else if (isPrimitive(c)) {
|
2397 |
+
if (isTextNode(last)) {
|
2398 |
+
// merge adjacent text nodes
|
2399 |
+
// this is necessary for SSR hydration because text nodes are
|
2400 |
+
// essentially merged when rendered to HTML strings
|
2401 |
+
res[lastIndex] = createTextVNode(last.text + c);
|
2402 |
+
} else if (c !== '') {
|
2403 |
+
// convert primitive to vnode
|
2404 |
+
res.push(createTextVNode(c));
|
2405 |
+
}
|
2406 |
+
} else {
|
2407 |
+
if (isTextNode(c) && isTextNode(last)) {
|
2408 |
+
// merge adjacent text nodes
|
2409 |
+
res[lastIndex] = createTextVNode(last.text + c.text);
|
2410 |
+
} else {
|
2411 |
+
// default key for nested array children (likely generated by v-for)
|
2412 |
+
if (isTrue(children._isVList) &&
|
2413 |
+
isDef(c.tag) &&
|
2414 |
+
isUndef(c.key) &&
|
2415 |
+
isDef(nestedIndex)) {
|
2416 |
+
c.key = "__vlist" + nestedIndex + "_" + i + "__";
|
2417 |
+
}
|
2418 |
+
res.push(c);
|
2419 |
+
}
|
2420 |
+
}
|
2421 |
+
}
|
2422 |
+
return res
|
2423 |
+
}
|
2424 |
+
|
2425 |
+
/* */
|
2426 |
+
|
2427 |
+
function initProvide (vm) {
|
2428 |
+
var provide = vm.$options.provide;
|
2429 |
+
if (provide) {
|
2430 |
+
vm._provided = typeof provide === 'function'
|
2431 |
+
? provide.call(vm)
|
2432 |
+
: provide;
|
2433 |
+
}
|
2434 |
+
}
|
2435 |
+
|
2436 |
+
function initInjections (vm) {
|
2437 |
+
var result = resolveInject(vm.$options.inject, vm);
|
2438 |
+
if (result) {
|
2439 |
+
toggleObserving(false);
|
2440 |
+
Object.keys(result).forEach(function (key) {
|
2441 |
+
/* istanbul ignore else */
|
2442 |
+
{
|
2443 |
+
defineReactive$$1(vm, key, result[key], function () {
|
2444 |
+
warn(
|
2445 |
+
"Avoid mutating an injected value directly since the changes will be " +
|
2446 |
+
"overwritten whenever the provided component re-renders. " +
|
2447 |
+
"injection being mutated: \"" + key + "\"",
|
2448 |
+
vm
|
2449 |
+
);
|
2450 |
+
});
|
2451 |
+
}
|
2452 |
+
});
|
2453 |
+
toggleObserving(true);
|
2454 |
+
}
|
2455 |
+
}
|
2456 |
+
|
2457 |
+
function resolveInject (inject, vm) {
|
2458 |
+
if (inject) {
|
2459 |
+
// inject is :any because flow is not smart enough to figure out cached
|
2460 |
+
var result = Object.create(null);
|
2461 |
+
var keys = hasSymbol
|
2462 |
+
? Reflect.ownKeys(inject)
|
2463 |
+
: Object.keys(inject);
|
2464 |
+
|
2465 |
+
for (var i = 0; i < keys.length; i++) {
|
2466 |
+
var key = keys[i];
|
2467 |
+
// #6574 in case the inject object is observed...
|
2468 |
+
if (key === '__ob__') { continue }
|
2469 |
+
var provideKey = inject[key].from;
|
2470 |
+
var source = vm;
|
2471 |
+
while (source) {
|
2472 |
+
if (source._provided && hasOwn(source._provided, provideKey)) {
|
2473 |
+
result[key] = source._provided[provideKey];
|
2474 |
+
break
|
2475 |
+
}
|
2476 |
+
source = source.$parent;
|
2477 |
+
}
|
2478 |
+
if (!source) {
|
2479 |
+
if ('default' in inject[key]) {
|
2480 |
+
var provideDefault = inject[key].default;
|
2481 |
+
result[key] = typeof provideDefault === 'function'
|
2482 |
+
? provideDefault.call(vm)
|
2483 |
+
: provideDefault;
|
2484 |
+
} else {
|
2485 |
+
warn(("Injection \"" + key + "\" not found"), vm);
|
2486 |
+
}
|
2487 |
+
}
|
2488 |
+
}
|
2489 |
+
return result
|
2490 |
+
}
|
2491 |
+
}
|
2492 |
+
|
2493 |
+
/* */
|
2494 |
+
|
2495 |
+
|
2496 |
+
|
2497 |
+
/**
|
2498 |
+
* Runtime helper for resolving raw children VNodes into a slot object.
|
2499 |
+
*/
|
2500 |
+
function resolveSlots (
|
2501 |
+
children,
|
2502 |
+
context
|
2503 |
+
) {
|
2504 |
+
if (!children || !children.length) {
|
2505 |
+
return {}
|
2506 |
+
}
|
2507 |
+
var slots = {};
|
2508 |
+
for (var i = 0, l = children.length; i < l; i++) {
|
2509 |
+
var child = children[i];
|
2510 |
+
var data = child.data;
|
2511 |
+
// remove slot attribute if the node is resolved as a Vue slot node
|
2512 |
+
if (data && data.attrs && data.attrs.slot) {
|
2513 |
+
delete data.attrs.slot;
|
2514 |
+
}
|
2515 |
+
// named slots should only be respected if the vnode was rendered in the
|
2516 |
+
// same context.
|
2517 |
+
if ((child.context === context || child.fnContext === context) &&
|
2518 |
+
data && data.slot != null
|
2519 |
+
) {
|
2520 |
+
var name = data.slot;
|
2521 |
+
var slot = (slots[name] || (slots[name] = []));
|
2522 |
+
if (child.tag === 'template') {
|
2523 |
+
slot.push.apply(slot, child.children || []);
|
2524 |
+
} else {
|
2525 |
+
slot.push(child);
|
2526 |
+
}
|
2527 |
+
} else {
|
2528 |
+
(slots.default || (slots.default = [])).push(child);
|
2529 |
+
}
|
2530 |
+
}
|
2531 |
+
// ignore slots that contains only whitespace
|
2532 |
+
for (var name$1 in slots) {
|
2533 |
+
if (slots[name$1].every(isWhitespace)) {
|
2534 |
+
delete slots[name$1];
|
2535 |
+
}
|
2536 |
+
}
|
2537 |
+
return slots
|
2538 |
+
}
|
2539 |
+
|
2540 |
+
function isWhitespace (node) {
|
2541 |
+
return (node.isComment && !node.asyncFactory) || node.text === ' '
|
2542 |
+
}
|
2543 |
+
|
2544 |
+
/* */
|
2545 |
+
|
2546 |
+
function normalizeScopedSlots (
|
2547 |
+
slots,
|
2548 |
+
normalSlots,
|
2549 |
+
prevSlots
|
2550 |
+
) {
|
2551 |
+
var res;
|
2552 |
+
var hasNormalSlots = Object.keys(normalSlots).length > 0;
|
2553 |
+
var isStable = slots ? !!slots.$stable : !hasNormalSlots;
|
2554 |
+
var key = slots && slots.$key;
|
2555 |
+
if (!slots) {
|
2556 |
+
res = {};
|
2557 |
+
} else if (slots._normalized) {
|
2558 |
+
// fast path 1: child component re-render only, parent did not change
|
2559 |
+
return slots._normalized
|
2560 |
+
} else if (
|
2561 |
+
isStable &&
|
2562 |
+
prevSlots &&
|
2563 |
+
prevSlots !== emptyObject &&
|
2564 |
+
key === prevSlots.$key &&
|
2565 |
+
!hasNormalSlots &&
|
2566 |
+
!prevSlots.$hasNormal
|
2567 |
+
) {
|
2568 |
+
// fast path 2: stable scoped slots w/ no normal slots to proxy,
|
2569 |
+
// only need to normalize once
|
2570 |
+
return prevSlots
|
2571 |
+
} else {
|
2572 |
+
res = {};
|
2573 |
+
for (var key$1 in slots) {
|
2574 |
+
if (slots[key$1] && key$1[0] !== '$') {
|
2575 |
+
res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
|
2576 |
+
}
|
2577 |
+
}
|
2578 |
+
}
|
2579 |
+
// expose normal slots on scopedSlots
|
2580 |
+
for (var key$2 in normalSlots) {
|
2581 |
+
if (!(key$2 in res)) {
|
2582 |
+
res[key$2] = proxyNormalSlot(normalSlots, key$2);
|
2583 |
+
}
|
2584 |
+
}
|
2585 |
+
// avoriaz seems to mock a non-extensible $scopedSlots object
|
2586 |
+
// and when that is passed down this would cause an error
|
2587 |
+
if (slots && Object.isExtensible(slots)) {
|
2588 |
+
(slots)._normalized = res;
|
2589 |
+
}
|
2590 |
+
def(res, '$stable', isStable);
|
2591 |
+
def(res, '$key', key);
|
2592 |
+
def(res, '$hasNormal', hasNormalSlots);
|
2593 |
+
return res
|
2594 |
+
}
|
2595 |
+
|
2596 |
+
function normalizeScopedSlot(normalSlots, key, fn) {
|
2597 |
+
var normalized = function () {
|
2598 |
+
var res = arguments.length ? fn.apply(null, arguments) : fn({});
|
2599 |
+
res = res && typeof res === 'object' && !Array.isArray(res)
|
2600 |
+
? [res] // single vnode
|
2601 |
+
: normalizeChildren(res);
|
2602 |
+
return res && (
|
2603 |
+
res.length === 0 ||
|
2604 |
+
(res.length === 1 && res[0].isComment) // #9658
|
2605 |
+
) ? undefined
|
2606 |
+
: res
|
2607 |
+
};
|
2608 |
+
// this is a slot using the new v-slot syntax without scope. although it is
|
2609 |
+
// compiled as a scoped slot, render fn users would expect it to be present
|
2610 |
+
// on this.$slots because the usage is semantically a normal slot.
|
2611 |
+
if (fn.proxy) {
|
2612 |
+
Object.defineProperty(normalSlots, key, {
|
2613 |
+
get: normalized,
|
2614 |
+
enumerable: true,
|
2615 |
+
configurable: true
|
2616 |
+
});
|
2617 |
+
}
|
2618 |
+
return normalized
|
2619 |
+
}
|
2620 |
+
|
2621 |
+
function proxyNormalSlot(slots, key) {
|
2622 |
+
return function () { return slots[key]; }
|
2623 |
+
}
|
2624 |
+
|
2625 |
+
/* */
|
2626 |
+
|
2627 |
+
/**
|
2628 |
+
* Runtime helper for rendering v-for lists.
|
2629 |
+
*/
|
2630 |
+
function renderList (
|
2631 |
+
val,
|
2632 |
+
render
|
2633 |
+
) {
|
2634 |
+
var ret, i, l, keys, key;
|
2635 |
+
if (Array.isArray(val) || typeof val === 'string') {
|
2636 |
+
ret = new Array(val.length);
|
2637 |
+
for (i = 0, l = val.length; i < l; i++) {
|
2638 |
+
ret[i] = render(val[i], i);
|
2639 |
+
}
|
2640 |
+
} else if (typeof val === 'number') {
|
2641 |
+
ret = new Array(val);
|
2642 |
+
for (i = 0; i < val; i++) {
|
2643 |
+
ret[i] = render(i + 1, i);
|
2644 |
+
}
|
2645 |
+
} else if (isObject(val)) {
|
2646 |
+
if (hasSymbol && val[Symbol.iterator]) {
|
2647 |
+
ret = [];
|
2648 |
+
var iterator = val[Symbol.iterator]();
|
2649 |
+
var result = iterator.next();
|
2650 |
+
while (!result.done) {
|
2651 |
+
ret.push(render(result.value, ret.length));
|
2652 |
+
result = iterator.next();
|
2653 |
+
}
|
2654 |
+
} else {
|
2655 |
+
keys = Object.keys(val);
|
2656 |
+
ret = new Array(keys.length);
|
2657 |
+
for (i = 0, l = keys.length; i < l; i++) {
|
2658 |
+
key = keys[i];
|
2659 |
+
ret[i] = render(val[key], key, i);
|
2660 |
+
}
|
2661 |
+
}
|
2662 |
+
}
|
2663 |
+
if (!isDef(ret)) {
|
2664 |
+
ret = [];
|
2665 |
+
}
|
2666 |
+
(ret)._isVList = true;
|
2667 |
+
return ret
|
2668 |
+
}
|
2669 |
+
|
2670 |
+
/* */
|
2671 |
+
|
2672 |
+
/**
|
2673 |
+
* Runtime helper for rendering <slot>
|
2674 |
+
*/
|
2675 |
+
function renderSlot (
|
2676 |
+
name,
|
2677 |
+
fallback,
|
2678 |
+
props,
|
2679 |
+
bindObject
|
2680 |
+
) {
|
2681 |
+
var scopedSlotFn = this.$scopedSlots[name];
|
2682 |
+
var nodes;
|
2683 |
+
if (scopedSlotFn) { // scoped slot
|
2684 |
+
props = props || {};
|
2685 |
+
if (bindObject) {
|
2686 |
+
if (!isObject(bindObject)) {
|
2687 |
+
warn(
|
2688 |
+
'slot v-bind without argument expects an Object',
|
2689 |
+
this
|
2690 |
+
);
|
2691 |
+
}
|
2692 |
+
props = extend(extend({}, bindObject), props);
|
2693 |
+
}
|
2694 |
+
nodes = scopedSlotFn(props) || fallback;
|
2695 |
+
} else {
|
2696 |
+
nodes = this.$slots[name] || fallback;
|
2697 |
+
}
|
2698 |
+
|
2699 |
+
var target = props && props.slot;
|
2700 |
+
if (target) {
|
2701 |
+
return this.$createElement('template', { slot: target }, nodes)
|
2702 |
+
} else {
|
2703 |
+
return nodes
|
2704 |
+
}
|
2705 |
+
}
|
2706 |
+
|
2707 |
+
/* */
|
2708 |
+
|
2709 |
+
/**
|
2710 |
+
* Runtime helper for resolving filters
|
2711 |
+
*/
|
2712 |
+
function resolveFilter (id) {
|
2713 |
+
return resolveAsset(this.$options, 'filters', id, true) || identity
|
2714 |
+
}
|
2715 |
+
|
2716 |
+
/* */
|
2717 |
+
|
2718 |
+
function isKeyNotMatch (expect, actual) {
|
2719 |
+
if (Array.isArray(expect)) {
|
2720 |
+
return expect.indexOf(actual) === -1
|
2721 |
+
} else {
|
2722 |
+
return expect !== actual
|
2723 |
+
}
|
2724 |
+
}
|
2725 |
+
|
2726 |
+
/**
|
2727 |
+
* Runtime helper for checking keyCodes from config.
|
2728 |
+
* exposed as Vue.prototype._k
|
2729 |
+
* passing in eventKeyName as last argument separately for backwards compat
|
2730 |
+
*/
|
2731 |
+
function checkKeyCodes (
|
2732 |
+
eventKeyCode,
|
2733 |
+
key,
|
2734 |
+
builtInKeyCode,
|
2735 |
+
eventKeyName,
|
2736 |
+
builtInKeyName
|
2737 |
+
) {
|
2738 |
+
var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
|
2739 |
+
if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
|
2740 |
+
return isKeyNotMatch(builtInKeyName, eventKeyName)
|
2741 |
+
} else if (mappedKeyCode) {
|
2742 |
+
return isKeyNotMatch(mappedKeyCode, eventKeyCode)
|
2743 |
+
} else if (eventKeyName) {
|
2744 |
+
return hyphenate(eventKeyName) !== key
|
2745 |
+
}
|
2746 |
+
}
|
2747 |
+
|
2748 |
+
/* */
|
2749 |
+
|
2750 |
+
/**
|
2751 |
+
* Runtime helper for merging v-bind="object" into a VNode's data.
|
2752 |
+
*/
|
2753 |
+
function bindObjectProps (
|
2754 |
+
data,
|
2755 |
+
tag,
|
2756 |
+
value,
|
2757 |
+
asProp,
|
2758 |
+
isSync
|
2759 |
+
) {
|
2760 |
+
if (value) {
|
2761 |
+
if (!isObject(value)) {
|
2762 |
+
warn(
|
2763 |
+
'v-bind without argument expects an Object or Array value',
|
2764 |
+
this
|
2765 |
+
);
|
2766 |
+
} else {
|
2767 |
+
if (Array.isArray(value)) {
|
2768 |
+
value = toObject(value);
|
2769 |
+
}
|
2770 |
+
var hash;
|
2771 |
+
var loop = function ( key ) {
|
2772 |
+
if (
|
2773 |
+
key === 'class' ||
|
2774 |
+
key === 'style' ||
|
2775 |
+
isReservedAttribute(key)
|
2776 |
+
) {
|
2777 |
+
hash = data;
|
2778 |
+
} else {
|
2779 |
+
var type = data.attrs && data.attrs.type;
|
2780 |
+
hash = asProp || config.mustUseProp(tag, type, key)
|
2781 |
+
? data.domProps || (data.domProps = {})
|
2782 |
+
: data.attrs || (data.attrs = {});
|
2783 |
+
}
|
2784 |
+
var camelizedKey = camelize(key);
|
2785 |
+
var hyphenatedKey = hyphenate(key);
|
2786 |
+
if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
|
2787 |
+
hash[key] = value[key];
|
2788 |
+
|
2789 |
+
if (isSync) {
|
2790 |
+
var on = data.on || (data.on = {});
|
2791 |
+
on[("update:" + key)] = function ($event) {
|
2792 |
+
value[key] = $event;
|
2793 |
+
};
|
2794 |
+
}
|
2795 |
+
}
|
2796 |
+
};
|
2797 |
+
|
2798 |
+
for (var key in value) loop( key );
|
2799 |
+
}
|
2800 |
+
}
|
2801 |
+
return data
|
2802 |
+
}
|
2803 |
+
|
2804 |
+
/* */
|
2805 |
+
|
2806 |
+
/**
|
2807 |
+
* Runtime helper for rendering static trees.
|
2808 |
+
*/
|
2809 |
+
function renderStatic (
|
2810 |
+
index,
|
2811 |
+
isInFor
|
2812 |
+
) {
|
2813 |
+
var cached = this._staticTrees || (this._staticTrees = []);
|
2814 |
+
var tree = cached[index];
|
2815 |
+
// if has already-rendered static tree and not inside v-for,
|
2816 |
+
// we can reuse the same tree.
|
2817 |
+
if (tree && !isInFor) {
|
2818 |
+
return tree
|
2819 |
+
}
|
2820 |
+
// otherwise, render a fresh tree.
|
2821 |
+
tree = cached[index] = this.$options.staticRenderFns[index].call(
|
2822 |
+
this._renderProxy,
|
2823 |
+
null,
|
2824 |
+
this // for render fns generated for functional component templates
|
2825 |
+
);
|
2826 |
+
markStatic(tree, ("__static__" + index), false);
|
2827 |
+
return tree
|
2828 |
+
}
|
2829 |
+
|
2830 |
+
/**
|
2831 |
+
* Runtime helper for v-once.
|
2832 |
+
* Effectively it means marking the node as static with a unique key.
|
2833 |
+
*/
|
2834 |
+
function markOnce (
|
2835 |
+
tree,
|
2836 |
+
index,
|
2837 |
+
key
|
2838 |
+
) {
|
2839 |
+
markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
|
2840 |
+
return tree
|
2841 |
+
}
|
2842 |
+
|
2843 |
+
function markStatic (
|
2844 |
+
tree,
|
2845 |
+
key,
|
2846 |
+
isOnce
|
2847 |
+
) {
|
2848 |
+
if (Array.isArray(tree)) {
|
2849 |
+
for (var i = 0; i < tree.length; i++) {
|
2850 |
+
if (tree[i] && typeof tree[i] !== 'string') {
|
2851 |
+
markStaticNode(tree[i], (key + "_" + i), isOnce);
|
2852 |
+
}
|
2853 |
+
}
|
2854 |
+
} else {
|
2855 |
+
markStaticNode(tree, key, isOnce);
|
2856 |
+
}
|
2857 |
+
}
|
2858 |
+
|
2859 |
+
function markStaticNode (node, key, isOnce) {
|
2860 |
+
node.isStatic = true;
|
2861 |
+
node.key = key;
|
2862 |
+
node.isOnce = isOnce;
|
2863 |
+
}
|
2864 |
+
|
2865 |
+
/* */
|
2866 |
+
|
2867 |
+
function bindObjectListeners (data, value) {
|
2868 |
+
if (value) {
|
2869 |
+
if (!isPlainObject(value)) {
|
2870 |
+
warn(
|
2871 |
+
'v-on without argument expects an Object value',
|
2872 |
+
this
|
2873 |
+
);
|
2874 |
+
} else {
|
2875 |
+
var on = data.on = data.on ? extend({}, data.on) : {};
|
2876 |
+
for (var key in value) {
|
2877 |
+
var existing = on[key];
|
2878 |
+
var ours = value[key];
|
2879 |
+
on[key] = existing ? [].concat(existing, ours) : ours;
|
2880 |
+
}
|
2881 |
+
}
|
2882 |
+
}
|
2883 |
+
return data
|
2884 |
+
}
|
2885 |
+
|
2886 |
+
/* */
|
2887 |
+
|
2888 |
+
function resolveScopedSlots (
|
2889 |
+
fns, // see flow/vnode
|
2890 |
+
res,
|
2891 |
+
// the following are added in 2.6
|
2892 |
+
hasDynamicKeys,
|
2893 |
+
contentHashKey
|
2894 |
+
) {
|
2895 |
+
res = res || { $stable: !hasDynamicKeys };
|
2896 |
+
for (var i = 0; i < fns.length; i++) {
|
2897 |
+
var slot = fns[i];
|
2898 |
+
if (Array.isArray(slot)) {
|
2899 |
+
resolveScopedSlots(slot, res, hasDynamicKeys);
|
2900 |
+
} else if (slot) {
|
2901 |
+
// marker for reverse proxying v-slot without scope on this.$slots
|
2902 |
+
if (slot.proxy) {
|
2903 |
+
slot.fn.proxy = true;
|
2904 |
+
}
|
2905 |
+
res[slot.key] = slot.fn;
|
2906 |
+
}
|
2907 |
+
}
|
2908 |
+
if (contentHashKey) {
|
2909 |
+
(res).$key = contentHashKey;
|
2910 |
+
}
|
2911 |
+
return res
|
2912 |
+
}
|
2913 |
+
|
2914 |
+
/* */
|
2915 |
+
|
2916 |
+
function bindDynamicKeys (baseObj, values) {
|
2917 |
+
for (var i = 0; i < values.length; i += 2) {
|
2918 |
+
var key = values[i];
|
2919 |
+
if (typeof key === 'string' && key) {
|
2920 |
+
baseObj[values[i]] = values[i + 1];
|
2921 |
+
} else if (key !== '' && key !== null) {
|
2922 |
+
// null is a speical value for explicitly removing a binding
|
2923 |
+
warn(
|
2924 |
+
("Invalid value for dynamic directive argument (expected string or null): " + key),
|
2925 |
+
this
|
2926 |
+
);
|
2927 |
+
}
|
2928 |
+
}
|
2929 |
+
return baseObj
|
2930 |
+
}
|
2931 |
+
|
2932 |
+
// helper to dynamically append modifier runtime markers to event names.
|
2933 |
+
// ensure only append when value is already string, otherwise it will be cast
|
2934 |
+
// to string and cause the type check to miss.
|
2935 |
+
function prependModifier (value, symbol) {
|
2936 |
+
return typeof value === 'string' ? symbol + value : value
|
2937 |
+
}
|
2938 |
+
|
2939 |
+
/* */
|
2940 |
+
|
2941 |
+
function installRenderHelpers (target) {
|
2942 |
+
target._o = markOnce;
|
2943 |
+
target._n = toNumber;
|
2944 |
+
target._s = toString;
|
2945 |
+
target._l = renderList;
|
2946 |
+
target._t = renderSlot;
|
2947 |
+
target._q = looseEqual;
|
2948 |
+
target._i = looseIndexOf;
|
2949 |
+
target._m = renderStatic;
|
2950 |
+
target._f = resolveFilter;
|
2951 |
+
target._k = checkKeyCodes;
|
2952 |
+
target._b = bindObjectProps;
|
2953 |
+
target._v = createTextVNode;
|
2954 |
+
target._e = createEmptyVNode;
|
2955 |
+
target._u = resolveScopedSlots;
|
2956 |
+
target._g = bindObjectListeners;
|
2957 |
+
target._d = bindDynamicKeys;
|
2958 |
+
target._p = prependModifier;
|
2959 |
+
}
|
2960 |
+
|
2961 |
+
/* */
|
2962 |
+
|
2963 |
+
function FunctionalRenderContext (
|
2964 |
+
data,
|
2965 |
+
props,
|
2966 |
+
children,
|
2967 |
+
parent,
|
2968 |
+
Ctor
|
2969 |
+
) {
|
2970 |
+
var this$1 = this;
|
2971 |
+
|
2972 |
+
var options = Ctor.options;
|
2973 |
+
// ensure the createElement function in functional components
|
2974 |
+
// gets a unique context - this is necessary for correct named slot check
|
2975 |
+
var contextVm;
|
2976 |
+
if (hasOwn(parent, '_uid')) {
|
2977 |
+
contextVm = Object.create(parent);
|
2978 |
+
// $flow-disable-line
|
2979 |
+
contextVm._original = parent;
|
2980 |
+
} else {
|
2981 |
+
// the context vm passed in is a functional context as well.
|
2982 |
+
// in this case we want to make sure we are able to get a hold to the
|
2983 |
+
// real context instance.
|
2984 |
+
contextVm = parent;
|
2985 |
+
// $flow-disable-line
|
2986 |
+
parent = parent._original;
|
2987 |
+
}
|
2988 |
+
var isCompiled = isTrue(options._compiled);
|
2989 |
+
var needNormalization = !isCompiled;
|
2990 |
+
|
2991 |
+
this.data = data;
|
2992 |
+
this.props = props;
|
2993 |
+
this.children = children;
|
2994 |
+
this.parent = parent;
|
2995 |
+
this.listeners = data.on || emptyObject;
|
2996 |
+
this.injections = resolveInject(options.inject, parent);
|
2997 |
+
this.slots = function () {
|
2998 |
+
if (!this$1.$slots) {
|
2999 |
+
normalizeScopedSlots(
|
3000 |
+
data.scopedSlots,
|
3001 |
+
this$1.$slots = resolveSlots(children, parent)
|
3002 |
+
);
|
3003 |
+
}
|
3004 |
+
return this$1.$slots
|
3005 |
+
};
|
3006 |
+
|
3007 |
+
Object.defineProperty(this, 'scopedSlots', ({
|
3008 |
+
enumerable: true,
|
3009 |
+
get: function get () {
|
3010 |
+
return normalizeScopedSlots(data.scopedSlots, this.slots())
|
3011 |
+
}
|
3012 |
+
}));
|
3013 |
+
|
3014 |
+
// support for compiled functional template
|
3015 |
+
if (isCompiled) {
|
3016 |
+
// exposing $options for renderStatic()
|
3017 |
+
this.$options = options;
|
3018 |
+
// pre-resolve slots for renderSlot()
|
3019 |
+
this.$slots = this.slots();
|
3020 |
+
this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
|
3021 |
+
}
|
3022 |
+
|
3023 |
+
if (options._scopeId) {
|
3024 |
+
this._c = function (a, b, c, d) {
|
3025 |
+
var vnode = createElement(contextVm, a, b, c, d, needNormalization);
|
3026 |
+
if (vnode && !Array.isArray(vnode)) {
|
3027 |
+
vnode.fnScopeId = options._scopeId;
|
3028 |
+
vnode.fnContext = parent;
|
3029 |
+
}
|
3030 |
+
return vnode
|
3031 |
+
};
|
3032 |
+
} else {
|
3033 |
+
this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
|
3034 |
+
}
|
3035 |
+
}
|
3036 |
+
|
3037 |
+
installRenderHelpers(FunctionalRenderContext.prototype);
|
3038 |
+
|
3039 |
+
function createFunctionalComponent (
|
3040 |
+
Ctor,
|
3041 |
+
propsData,
|
3042 |
+
data,
|
3043 |
+
contextVm,
|
3044 |
+
children
|
3045 |
+
) {
|
3046 |
+
var options = Ctor.options;
|
3047 |
+
var props = {};
|
3048 |
+
var propOptions = options.props;
|
3049 |
+
if (isDef(propOptions)) {
|
3050 |
+
for (var key in propOptions) {
|
3051 |
+
props[key] = validateProp(key, propOptions, propsData || emptyObject);
|
3052 |
+
}
|
3053 |
+
} else {
|
3054 |
+
if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
|
3055 |
+
if (isDef(data.props)) { mergeProps(props, data.props); }
|
3056 |
+
}
|
3057 |
+
|
3058 |
+
var renderContext = new FunctionalRenderContext(
|
3059 |
+
data,
|
3060 |
+
props,
|
3061 |
+
children,
|
3062 |
+
contextVm,
|
3063 |
+
Ctor
|
3064 |
+
);
|
3065 |
+
|
3066 |
+
var vnode = options.render.call(null, renderContext._c, renderContext);
|
3067 |
+
|
3068 |
+
if (vnode instanceof VNode) {
|
3069 |
+
return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
|
3070 |
+
} else if (Array.isArray(vnode)) {
|
3071 |
+
var vnodes = normalizeChildren(vnode) || [];
|
3072 |
+
var res = new Array(vnodes.length);
|
3073 |
+
for (var i = 0; i < vnodes.length; i++) {
|
3074 |
+
res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
|
3075 |
+
}
|
3076 |
+
return res
|
3077 |
+
}
|
3078 |
+
}
|
3079 |
+
|
3080 |
+
function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
|
3081 |
+
// #7817 clone node before setting fnContext, otherwise if the node is reused
|
3082 |
+
// (e.g. it was from a cached normal slot) the fnContext causes named slots
|
3083 |
+
// that should not be matched to match.
|
3084 |
+
var clone = cloneVNode(vnode);
|
3085 |
+
clone.fnContext = contextVm;
|
3086 |
+
clone.fnOptions = options;
|
3087 |
+
{
|
3088 |
+
(clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
|
3089 |
+
}
|
3090 |
+
if (data.slot) {
|
3091 |
+
(clone.data || (clone.data = {})).slot = data.slot;
|
3092 |
+
}
|
3093 |
+
return clone
|
3094 |
+
}
|
3095 |
+
|
3096 |
+
function mergeProps (to, from) {
|
3097 |
+
for (var key in from) {
|
3098 |
+
to[camelize(key)] = from[key];
|
3099 |
+
}
|
3100 |
+
}
|
3101 |
+
|
3102 |
+
/* */
|
3103 |
+
|
3104 |
+
/* */
|
3105 |
+
|
3106 |
+
/* */
|
3107 |
+
|
3108 |
+
/* */
|
3109 |
+
|
3110 |
+
// inline hooks to be invoked on component VNodes during patch
|
3111 |
+
var componentVNodeHooks = {
|
3112 |
+
init: function init (vnode, hydrating) {
|
3113 |
+
if (
|
3114 |
+
vnode.componentInstance &&
|
3115 |
+
!vnode.componentInstance._isDestroyed &&
|
3116 |
+
vnode.data.keepAlive
|
3117 |
+
) {
|
3118 |
+
// kept-alive components, treat as a patch
|
3119 |
+
var mountedNode = vnode; // work around flow
|
3120 |
+
componentVNodeHooks.prepatch(mountedNode, mountedNode);
|
3121 |
+
} else {
|
3122 |
+
var child = vnode.componentInstance = createComponentInstanceForVnode(
|
3123 |
+
vnode,
|
3124 |
+
activeInstance
|
3125 |
+
);
|
3126 |
+
child.$mount(hydrating ? vnode.elm : undefined, hydrating);
|
3127 |
+
}
|
3128 |
+
},
|
3129 |
+
|
3130 |
+
prepatch: function prepatch (oldVnode, vnode) {
|
3131 |
+
var options = vnode.componentOptions;
|
3132 |
+
var child = vnode.componentInstance = oldVnode.componentInstance;
|
3133 |
+
updateChildComponent(
|
3134 |
+
child,
|
3135 |
+
options.propsData, // updated props
|
3136 |
+
options.listeners, // updated listeners
|
3137 |
+
vnode, // new parent vnode
|
3138 |
+
options.children // new children
|
3139 |
+
);
|
3140 |
+
},
|
3141 |
+
|
3142 |
+
insert: function insert (vnode) {
|
3143 |
+
var context = vnode.context;
|
3144 |
+
var componentInstance = vnode.componentInstance;
|
3145 |
+
if (!componentInstance._isMounted) {
|
3146 |
+
componentInstance._isMounted = true;
|
3147 |
+
callHook(componentInstance, 'mounted');
|
3148 |
+
}
|
3149 |
+
if (vnode.data.keepAlive) {
|
3150 |
+
if (context._isMounted) {
|
3151 |
+
// vue-router#1212
|
3152 |
+
// During updates, a kept-alive component's child components may
|
3153 |
+
// change, so directly walking the tree here may call activated hooks
|
3154 |
+
// on incorrect children. Instead we push them into a queue which will
|
3155 |
+
// be processed after the whole patch process ended.
|
3156 |
+
queueActivatedComponent(componentInstance);
|
3157 |
+
} else {
|
3158 |
+
activateChildComponent(componentInstance, true /* direct */);
|
3159 |
+
}
|
3160 |
+
}
|
3161 |
+
},
|
3162 |
+
|
3163 |
+
destroy: function destroy (vnode) {
|
3164 |
+
var componentInstance = vnode.componentInstance;
|
3165 |
+
if (!componentInstance._isDestroyed) {
|
3166 |
+
if (!vnode.data.keepAlive) {
|
3167 |
+
componentInstance.$destroy();
|
3168 |
+
} else {
|
3169 |
+
deactivateChildComponent(componentInstance, true /* direct */);
|
3170 |
+
}
|
3171 |
+
}
|
3172 |
+
}
|
3173 |
+
};
|
3174 |
+
|
3175 |
+
var hooksToMerge = Object.keys(componentVNodeHooks);
|
3176 |
+
|
3177 |
+
function createComponent (
|
3178 |
+
Ctor,
|
3179 |
+
data,
|
3180 |
+
context,
|
3181 |
+
children,
|
3182 |
+
tag
|
3183 |
+
) {
|
3184 |
+
if (isUndef(Ctor)) {
|
3185 |
+
return
|
3186 |
+
}
|
3187 |
+
|
3188 |
+
var baseCtor = context.$options._base;
|
3189 |
+
|
3190 |
+
// plain options object: turn it into a constructor
|
3191 |
+
if (isObject(Ctor)) {
|
3192 |
+
Ctor = baseCtor.extend(Ctor);
|
3193 |
+
}
|
3194 |
+
|
3195 |
+
// if at this stage it's not a constructor or an async component factory,
|
3196 |
+
// reject.
|
3197 |
+
if (typeof Ctor !== 'function') {
|
3198 |
+
{
|
3199 |
+
warn(("Invalid Component definition: " + (String(Ctor))), context);
|
3200 |
+
}
|
3201 |
+
return
|
3202 |
+
}
|
3203 |
+
|
3204 |
+
// async component
|
3205 |
+
var asyncFactory;
|
3206 |
+
if (isUndef(Ctor.cid)) {
|
3207 |
+
asyncFactory = Ctor;
|
3208 |
+
Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
|
3209 |
+
if (Ctor === undefined) {
|
3210 |
+
// return a placeholder node for async component, which is rendered
|
3211 |
+
// as a comment node but preserves all the raw information for the node.
|
3212 |
+
// the information will be used for async server-rendering and hydration.
|
3213 |
+
return createAsyncPlaceholder(
|
3214 |
+
asyncFactory,
|
3215 |
+
data,
|
3216 |
+
context,
|
3217 |
+
children,
|
3218 |
+
tag
|
3219 |
+
)
|
3220 |
+
}
|
3221 |
+
}
|
3222 |
+
|
3223 |
+
data = data || {};
|
3224 |
+
|
3225 |
+
// resolve constructor options in case global mixins are applied after
|
3226 |
+
// component constructor creation
|
3227 |
+
resolveConstructorOptions(Ctor);
|
3228 |
+
|
3229 |
+
// transform component v-model data into props & events
|
3230 |
+
if (isDef(data.model)) {
|
3231 |
+
transformModel(Ctor.options, data);
|
3232 |
+
}
|
3233 |
+
|
3234 |
+
// extract props
|
3235 |
+
var propsData = extractPropsFromVNodeData(data, Ctor, tag);
|
3236 |
+
|
3237 |
+
// functional component
|
3238 |
+
if (isTrue(Ctor.options.functional)) {
|
3239 |
+
return createFunctionalComponent(Ctor, propsData, data, context, children)
|
3240 |
+
}
|
3241 |
+
|
3242 |
+
// extract listeners, since these needs to be treated as
|
3243 |
+
// child component listeners instead of DOM listeners
|
3244 |
+
var listeners = data.on;
|
3245 |
+
// replace with listeners with .native modifier
|
3246 |
+
// so it gets processed during parent component patch.
|
3247 |
+
data.on = data.nativeOn;
|
3248 |
+
|
3249 |
+
if (isTrue(Ctor.options.abstract)) {
|
3250 |
+
// abstract components do not keep anything
|
3251 |
+
// other than props & listeners & slot
|
3252 |
+
|
3253 |
+
// work around flow
|
3254 |
+
var slot = data.slot;
|
3255 |
+
data = {};
|
3256 |
+
if (slot) {
|
3257 |
+
data.slot = slot;
|
3258 |
+
}
|
3259 |
+
}
|
3260 |
+
|
3261 |
+
// install component management hooks onto the placeholder node
|
3262 |
+
installComponentHooks(data);
|
3263 |
+
|
3264 |
+
// return a placeholder vnode
|
3265 |
+
var name = Ctor.options.name || tag;
|
3266 |
+
var vnode = new VNode(
|
3267 |
+
("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
|
3268 |
+
data, undefined, undefined, undefined, context,
|
3269 |
+
{ Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
|
3270 |
+
asyncFactory
|
3271 |
+
);
|
3272 |
+
|
3273 |
+
return vnode
|
3274 |
+
}
|
3275 |
+
|
3276 |
+
function createComponentInstanceForVnode (
|
3277 |
+
vnode, // we know it's MountedComponentVNode but flow doesn't
|
3278 |
+
parent // activeInstance in lifecycle state
|
3279 |
+
) {
|
3280 |
+
var options = {
|
3281 |
+
_isComponent: true,
|
3282 |
+
_parentVnode: vnode,
|
3283 |
+
parent: parent
|
3284 |
+
};
|
3285 |
+
// check inline-template render functions
|
3286 |
+
var inlineTemplate = vnode.data.inlineTemplate;
|
3287 |
+
if (isDef(inlineTemplate)) {
|
3288 |
+
options.render = inlineTemplate.render;
|
3289 |
+
options.staticRenderFns = inlineTemplate.staticRenderFns;
|
3290 |
+
}
|
3291 |
+
return new vnode.componentOptions.Ctor(options)
|
3292 |
+
}
|
3293 |
+
|
3294 |
+
function installComponentHooks (data) {
|
3295 |
+
var hooks = data.hook || (data.hook = {});
|
3296 |
+
for (var i = 0; i < hooksToMerge.length; i++) {
|
3297 |
+
var key = hooksToMerge[i];
|
3298 |
+
var existing = hooks[key];
|
3299 |
+
var toMerge = componentVNodeHooks[key];
|
3300 |
+
if (existing !== toMerge && !(existing && existing._merged)) {
|
3301 |
+
hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
|
3302 |
+
}
|
3303 |
+
}
|
3304 |
+
}
|
3305 |
+
|
3306 |
+
function mergeHook$1 (f1, f2) {
|
3307 |
+
var merged = function (a, b) {
|
3308 |
+
// flow complains about extra args which is why we use any
|
3309 |
+
f1(a, b);
|
3310 |
+
f2(a, b);
|
3311 |
+
};
|
3312 |
+
merged._merged = true;
|
3313 |
+
return merged
|
3314 |
+
}
|
3315 |
+
|
3316 |
+
// transform component v-model info (value and callback) into
|
3317 |
+
// prop and event handler respectively.
|
3318 |
+
function transformModel (options, data) {
|
3319 |
+
var prop = (options.model && options.model.prop) || 'value';
|
3320 |
+
var event = (options.model && options.model.event) || 'input'
|
3321 |
+
;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
|
3322 |
+
var on = data.on || (data.on = {});
|
3323 |
+
var existing = on[event];
|
3324 |
+
var callback = data.model.callback;
|
3325 |
+
if (isDef(existing)) {
|
3326 |
+
if (
|
3327 |
+
Array.isArray(existing)
|
3328 |
+
? existing.indexOf(callback) === -1
|
3329 |
+
: existing !== callback
|
3330 |
+
) {
|
3331 |
+
on[event] = [callback].concat(existing);
|
3332 |
+
}
|
3333 |
+
} else {
|
3334 |
+
on[event] = callback;
|
3335 |
+
}
|
3336 |
+
}
|
3337 |
+
|
3338 |
+
/* */
|
3339 |
+
|
3340 |
+
var SIMPLE_NORMALIZE = 1;
|
3341 |
+
var ALWAYS_NORMALIZE = 2;
|
3342 |
+
|
3343 |
+
// wrapper function for providing a more flexible interface
|
3344 |
+
// without getting yelled at by flow
|
3345 |
+
function createElement (
|
3346 |
+
context,
|
3347 |
+
tag,
|
3348 |
+
data,
|
3349 |
+
children,
|
3350 |
+
normalizationType,
|
3351 |
+
alwaysNormalize
|
3352 |
+
) {
|
3353 |
+
if (Array.isArray(data) || isPrimitive(data)) {
|
3354 |
+
normalizationType = children;
|
3355 |
+
children = data;
|
3356 |
+
data = undefined;
|
3357 |
+
}
|
3358 |
+
if (isTrue(alwaysNormalize)) {
|
3359 |
+
normalizationType = ALWAYS_NORMALIZE;
|
3360 |
+
}
|
3361 |
+
return _createElement(context, tag, data, children, normalizationType)
|
3362 |
+
}
|
3363 |
+
|
3364 |
+
function _createElement (
|
3365 |
+
context,
|
3366 |
+
tag,
|
3367 |
+
data,
|
3368 |
+
children,
|
3369 |
+
normalizationType
|
3370 |
+
) {
|
3371 |
+
if (isDef(data) && isDef((data).__ob__)) {
|
3372 |
+
warn(
|
3373 |
+
"Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
|
3374 |
+
'Always create fresh vnode data objects in each render!',
|
3375 |
+
context
|
3376 |
+
);
|
3377 |
+
return createEmptyVNode()
|
3378 |
+
}
|
3379 |
+
// object syntax in v-bind
|
3380 |
+
if (isDef(data) && isDef(data.is)) {
|
3381 |
+
tag = data.is;
|
3382 |
+
}
|
3383 |
+
if (!tag) {
|
3384 |
+
// in case of component :is set to falsy value
|
3385 |
+
return createEmptyVNode()
|
3386 |
+
}
|
3387 |
+
// warn against non-primitive key
|
3388 |
+
if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)
|
3389 |
+
) {
|
3390 |
+
{
|
3391 |
+
warn(
|
3392 |
+
'Avoid using non-primitive value as key, ' +
|
3393 |
+
'use string/number value instead.',
|
3394 |
+
context
|
3395 |
+
);
|
3396 |
+
}
|
3397 |
+
}
|
3398 |
+
// support single function children as default scoped slot
|
3399 |
+
if (Array.isArray(children) &&
|
3400 |
+
typeof children[0] === 'function'
|
3401 |
+
) {
|
3402 |
+
data = data || {};
|
3403 |
+
data.scopedSlots = { default: children[0] };
|
3404 |
+
children.length = 0;
|
3405 |
+
}
|
3406 |
+
if (normalizationType === ALWAYS_NORMALIZE) {
|
3407 |
+
children = normalizeChildren(children);
|
3408 |
+
} else if (normalizationType === SIMPLE_NORMALIZE) {
|
3409 |
+
children = simpleNormalizeChildren(children);
|
3410 |
+
}
|
3411 |
+
var vnode, ns;
|
3412 |
+
if (typeof tag === 'string') {
|
3413 |
+
var Ctor;
|
3414 |
+
ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
|
3415 |
+
if (config.isReservedTag(tag)) {
|
3416 |
+
// platform built-in elements
|
3417 |
+
vnode = new VNode(
|
3418 |
+
config.parsePlatformTagName(tag), data, children,
|
3419 |
+
undefined, undefined, context
|
3420 |
+
);
|
3421 |
+
} else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
|
3422 |
+
// component
|
3423 |
+
vnode = createComponent(Ctor, data, context, children, tag);
|
3424 |
+
} else {
|
3425 |
+
// unknown or unlisted namespaced elements
|
3426 |
+
// check at runtime because it may get assigned a namespace when its
|
3427 |
+
// parent normalizes children
|
3428 |
+
vnode = new VNode(
|
3429 |
+
tag, data, children,
|
3430 |
+
undefined, undefined, context
|
3431 |
+
);
|
3432 |
+
}
|
3433 |
+
} else {
|
3434 |
+
// direct component options / constructor
|
3435 |
+
vnode = createComponent(tag, data, context, children);
|
3436 |
+
}
|
3437 |
+
if (Array.isArray(vnode)) {
|
3438 |
+
return vnode
|
3439 |
+
} else if (isDef(vnode)) {
|
3440 |
+
if (isDef(ns)) { applyNS(vnode, ns); }
|
3441 |
+
if (isDef(data)) { registerDeepBindings(data); }
|
3442 |
+
return vnode
|
3443 |
+
} else {
|
3444 |
+
return createEmptyVNode()
|
3445 |
+
}
|
3446 |
+
}
|
3447 |
+
|
3448 |
+
function applyNS (vnode, ns, force) {
|
3449 |
+
vnode.ns = ns;
|
3450 |
+
if (vnode.tag === 'foreignObject') {
|
3451 |
+
// use default namespace inside foreignObject
|
3452 |
+
ns = undefined;
|
3453 |
+
force = true;
|
3454 |
+
}
|
3455 |
+
if (isDef(vnode.children)) {
|
3456 |
+
for (var i = 0, l = vnode.children.length; i < l; i++) {
|
3457 |
+
var child = vnode.children[i];
|
3458 |
+
if (isDef(child.tag) && (
|
3459 |
+
isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
|
3460 |
+
applyNS(child, ns, force);
|
3461 |
+
}
|
3462 |
+
}
|
3463 |
+
}
|
3464 |
+
}
|
3465 |
+
|
3466 |
+
// ref #5318
|
3467 |
+
// necessary to ensure parent re-render when deep bindings like :style and
|
3468 |
+
// :class are used on slot nodes
|
3469 |
+
function registerDeepBindings (data) {
|
3470 |
+
if (isObject(data.style)) {
|
3471 |
+
traverse(data.style);
|
3472 |
+
}
|
3473 |
+
if (isObject(data.class)) {
|
3474 |
+
traverse(data.class);
|
3475 |
+
}
|
3476 |
+
}
|
3477 |
+
|
3478 |
+
/* */
|
3479 |
+
|
3480 |
+
function initRender (vm) {
|
3481 |
+
vm._vnode = null; // the root of the child tree
|
3482 |
+
vm._staticTrees = null; // v-once cached trees
|
3483 |
+
var options = vm.$options;
|
3484 |
+
var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
|
3485 |
+
var renderContext = parentVnode && parentVnode.context;
|
3486 |
+
vm.$slots = resolveSlots(options._renderChildren, renderContext);
|
3487 |
+
vm.$scopedSlots = emptyObject;
|
3488 |
+
// bind the createElement fn to this instance
|
3489 |
+
// so that we get proper render context inside it.
|
3490 |
+
// args order: tag, data, children, normalizationType, alwaysNormalize
|
3491 |
+
// internal version is used by render functions compiled from templates
|
3492 |
+
vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
|
3493 |
+
// normalization is always applied for the public version, used in
|
3494 |
+
// user-written render functions.
|
3495 |
+
vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
|
3496 |
+
|
3497 |
+
// $attrs & $listeners are exposed for easier HOC creation.
|
3498 |
+
// they need to be reactive so that HOCs using them are always updated
|
3499 |
+
var parentData = parentVnode && parentVnode.data;
|
3500 |
+
|
3501 |
+
/* istanbul ignore else */
|
3502 |
+
{
|
3503 |
+
defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
|
3504 |
+
!isUpdatingChildComponent && warn("$attrs is readonly.", vm);
|
3505 |
+
}, true);
|
3506 |
+
defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
|
3507 |
+
!isUpdatingChildComponent && warn("$listeners is readonly.", vm);
|
3508 |
+
}, true);
|
3509 |
+
}
|
3510 |
+
}
|
3511 |
+
|
3512 |
+
var currentRenderingInstance = null;
|
3513 |
+
|
3514 |
+
function renderMixin (Vue) {
|
3515 |
+
// install runtime convenience helpers
|
3516 |
+
installRenderHelpers(Vue.prototype);
|
3517 |
+
|
3518 |
+
Vue.prototype.$nextTick = function (fn) {
|
3519 |
+
return nextTick(fn, this)
|
3520 |
+
};
|
3521 |
+
|
3522 |
+
Vue.prototype._render = function () {
|
3523 |
+
var vm = this;
|
3524 |
+
var ref = vm.$options;
|
3525 |
+
var render = ref.render;
|
3526 |
+
var _parentVnode = ref._parentVnode;
|
3527 |
+
|
3528 |
+
if (_parentVnode) {
|
3529 |
+
vm.$scopedSlots = normalizeScopedSlots(
|
3530 |
+
_parentVnode.data.scopedSlots,
|
3531 |
+
vm.$slots,
|
3532 |
+
vm.$scopedSlots
|
3533 |
+
);
|
3534 |
+
}
|
3535 |
+
|
3536 |
+
// set parent vnode. this allows render functions to have access
|
3537 |
+
// to the data on the placeholder node.
|
3538 |
+
vm.$vnode = _parentVnode;
|
3539 |
+
// render self
|
3540 |
+
var vnode;
|
3541 |
+
try {
|
3542 |
+
// There's no need to maintain a stack becaues all render fns are called
|
3543 |
+
// separately from one another. Nested component's render fns are called
|
3544 |
+
// when parent component is patched.
|
3545 |
+
currentRenderingInstance = vm;
|
3546 |
+
vnode = render.call(vm._renderProxy, vm.$createElement);
|
3547 |
+
} catch (e) {
|
3548 |
+
handleError(e, vm, "render");
|
3549 |
+
// return error render result,
|
3550 |
+
// or previous vnode to prevent render error causing blank component
|
3551 |
+
/* istanbul ignore else */
|
3552 |
+
if (vm.$options.renderError) {
|
3553 |
+
try {
|
3554 |
+
vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
|
3555 |
+
} catch (e) {
|
3556 |
+
handleError(e, vm, "renderError");
|
3557 |
+
vnode = vm._vnode;
|
3558 |
+
}
|
3559 |
+
} else {
|
3560 |
+
vnode = vm._vnode;
|
3561 |
+
}
|
3562 |
+
} finally {
|
3563 |
+
currentRenderingInstance = null;
|
3564 |
+
}
|
3565 |
+
// if the returned array contains only a single node, allow it
|
3566 |
+
if (Array.isArray(vnode) && vnode.length === 1) {
|
3567 |
+
vnode = vnode[0];
|
3568 |
+
}
|
3569 |
+
// return empty vnode in case the render function errored out
|
3570 |
+
if (!(vnode instanceof VNode)) {
|
3571 |
+
if (Array.isArray(vnode)) {
|
3572 |
+
warn(
|
3573 |
+
'Multiple root nodes returned from render function. Render function ' +
|
3574 |
+
'should return a single root node.',
|
3575 |
+
vm
|
3576 |
+
);
|
3577 |
+
}
|
3578 |
+
vnode = createEmptyVNode();
|
3579 |
+
}
|
3580 |
+
// set parent
|
3581 |
+
vnode.parent = _parentVnode;
|
3582 |
+
return vnode
|
3583 |
+
};
|
3584 |
+
}
|
3585 |
+
|
3586 |
+
/* */
|
3587 |
+
|
3588 |
+
function ensureCtor (comp, base) {
|
3589 |
+
if (
|
3590 |
+
comp.__esModule ||
|
3591 |
+
(hasSymbol && comp[Symbol.toStringTag] === 'Module')
|
3592 |
+
) {
|
3593 |
+
comp = comp.default;
|
3594 |
+
}
|
3595 |
+
return isObject(comp)
|
3596 |
+
? base.extend(comp)
|
3597 |
+
: comp
|
3598 |
+
}
|
3599 |
+
|
3600 |
+
function createAsyncPlaceholder (
|
3601 |
+
factory,
|
3602 |
+
data,
|
3603 |
+
context,
|
3604 |
+
children,
|
3605 |
+
tag
|
3606 |
+
) {
|
3607 |
+
var node = createEmptyVNode();
|
3608 |
+
node.asyncFactory = factory;
|
3609 |
+
node.asyncMeta = { data: data, context: context, children: children, tag: tag };
|
3610 |
+
return node
|
3611 |
+
}
|
3612 |
+
|
3613 |
+
function resolveAsyncComponent (
|
3614 |
+
factory,
|
3615 |
+
baseCtor
|
3616 |
+
) {
|
3617 |
+
if (isTrue(factory.error) && isDef(factory.errorComp)) {
|
3618 |
+
return factory.errorComp
|
3619 |
+
}
|
3620 |
+
|
3621 |
+
if (isDef(factory.resolved)) {
|
3622 |
+
return factory.resolved
|
3623 |
+
}
|
3624 |
+
|
3625 |
+
var owner = currentRenderingInstance;
|
3626 |
+
if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
|
3627 |
+
// already pending
|
3628 |
+
factory.owners.push(owner);
|
3629 |
+
}
|
3630 |
+
|
3631 |
+
if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
|
3632 |
+
return factory.loadingComp
|
3633 |
+
}
|
3634 |
+
|
3635 |
+
if (owner && !isDef(factory.owners)) {
|
3636 |
+
var owners = factory.owners = [owner];
|
3637 |
+
var sync = true;
|
3638 |
+
var timerLoading = null;
|
3639 |
+
var timerTimeout = null
|
3640 |
+
|
3641 |
+
;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
|
3642 |
+
|
3643 |
+
var forceRender = function (renderCompleted) {
|
3644 |
+
for (var i = 0, l = owners.length; i < l; i++) {
|
3645 |
+
(owners[i]).$forceUpdate();
|
3646 |
+
}
|
3647 |
+
|
3648 |
+
if (renderCompleted) {
|
3649 |
+
owners.length = 0;
|
3650 |
+
if (timerLoading !== null) {
|
3651 |
+
clearTimeout(timerLoading);
|
3652 |
+
timerLoading = null;
|
3653 |
+
}
|
3654 |
+
if (timerTimeout !== null) {
|
3655 |
+
clearTimeout(timerTimeout);
|
3656 |
+
timerTimeout = null;
|
3657 |
+
}
|
3658 |
+
}
|
3659 |
+
};
|
3660 |
+
|
3661 |
+
var resolve = once(function (res) {
|
3662 |
+
// cache resolved
|
3663 |
+
factory.resolved = ensureCtor(res, baseCtor);
|
3664 |
+
// invoke callbacks only if this is not a synchronous resolve
|
3665 |
+
// (async resolves are shimmed as synchronous during SSR)
|
3666 |
+
if (!sync) {
|
3667 |
+
forceRender(true);
|
3668 |
+
} else {
|
3669 |
+
owners.length = 0;
|
3670 |
+
}
|
3671 |
+
});
|
3672 |
+
|
3673 |
+
var reject = once(function (reason) {
|
3674 |
+
warn(
|
3675 |
+
"Failed to resolve async component: " + (String(factory)) +
|
3676 |
+
(reason ? ("\nReason: " + reason) : '')
|
3677 |
+
);
|
3678 |
+
if (isDef(factory.errorComp)) {
|
3679 |
+
factory.error = true;
|
3680 |
+
forceRender(true);
|
3681 |
+
}
|
3682 |
+
});
|
3683 |
+
|
3684 |
+
var res = factory(resolve, reject);
|
3685 |
+
|
3686 |
+
if (isObject(res)) {
|
3687 |
+
if (isPromise(res)) {
|
3688 |
+
// () => Promise
|
3689 |
+
if (isUndef(factory.resolved)) {
|
3690 |
+
res.then(resolve, reject);
|
3691 |
+
}
|
3692 |
+
} else if (isPromise(res.component)) {
|
3693 |
+
res.component.then(resolve, reject);
|
3694 |
+
|
3695 |
+
if (isDef(res.error)) {
|
3696 |
+
factory.errorComp = ensureCtor(res.error, baseCtor);
|
3697 |
+
}
|
3698 |
+
|
3699 |
+
if (isDef(res.loading)) {
|
3700 |
+
factory.loadingComp = ensureCtor(res.loading, baseCtor);
|
3701 |
+
if (res.delay === 0) {
|
3702 |
+
factory.loading = true;
|
3703 |
+
} else {
|
3704 |
+
timerLoading = setTimeout(function () {
|
3705 |
+
timerLoading = null;
|
3706 |
+
if (isUndef(factory.resolved) && isUndef(factory.error)) {
|
3707 |
+
factory.loading = true;
|
3708 |
+
forceRender(false);
|
3709 |
+
}
|
3710 |
+
}, res.delay || 200);
|
3711 |
+
}
|
3712 |
+
}
|
3713 |
+
|
3714 |
+
if (isDef(res.timeout)) {
|
3715 |
+
timerTimeout = setTimeout(function () {
|
3716 |
+
timerTimeout = null;
|
3717 |
+
if (isUndef(factory.resolved)) {
|
3718 |
+
reject(
|
3719 |
+
"timeout (" + (res.timeout) + "ms)"
|
3720 |
+
);
|
3721 |
+
}
|
3722 |
+
}, res.timeout);
|
3723 |
+
}
|
3724 |
+
}
|
3725 |
+
}
|
3726 |
+
|
3727 |
+
sync = false;
|
3728 |
+
// return in case resolved synchronously
|
3729 |
+
return factory.loading
|
3730 |
+
? factory.loadingComp
|
3731 |
+
: factory.resolved
|
3732 |
+
}
|
3733 |
+
}
|
3734 |
+
|
3735 |
+
/* */
|
3736 |
+
|
3737 |
+
function isAsyncPlaceholder (node) {
|
3738 |
+
return node.isComment && node.asyncFactory
|
3739 |
+
}
|
3740 |
+
|
3741 |
+
/* */
|
3742 |
+
|
3743 |
+
function getFirstComponentChild (children) {
|
3744 |
+
if (Array.isArray(children)) {
|
3745 |
+
for (var i = 0; i < children.length; i++) {
|
3746 |
+
var c = children[i];
|
3747 |
+
if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
|
3748 |
+
return c
|
3749 |
+
}
|
3750 |
+
}
|
3751 |
+
}
|
3752 |
+
}
|
3753 |
+
|
3754 |
+
/* */
|
3755 |
+
|
3756 |
+
/* */
|
3757 |
+
|
3758 |
+
function initEvents (vm) {
|
3759 |
+
vm._events = Object.create(null);
|
3760 |
+
vm._hasHookEvent = false;
|
3761 |
+
// init parent attached events
|
3762 |
+
var listeners = vm.$options._parentListeners;
|
3763 |
+
if (listeners) {
|
3764 |
+
updateComponentListeners(vm, listeners);
|
3765 |
+
}
|
3766 |
+
}
|
3767 |
+
|
3768 |
+
var target;
|
3769 |
+
|
3770 |
+
function add (event, fn) {
|
3771 |
+
target.$on(event, fn);
|
3772 |
+
}
|
3773 |
+
|
3774 |
+
function remove$1 (event, fn) {
|
3775 |
+
target.$off(event, fn);
|
3776 |
+
}
|
3777 |
+
|
3778 |
+
function createOnceHandler (event, fn) {
|
3779 |
+
var _target = target;
|
3780 |
+
return function onceHandler () {
|
3781 |
+
var res = fn.apply(null, arguments);
|
3782 |
+
if (res !== null) {
|
3783 |
+
_target.$off(event, onceHandler);
|
3784 |
+
}
|
3785 |
+
}
|
3786 |
+
}
|
3787 |
+
|
3788 |
+
function updateComponentListeners (
|
3789 |
+
vm,
|
3790 |
+
listeners,
|
3791 |
+
oldListeners
|
3792 |
+
) {
|
3793 |
+
target = vm;
|
3794 |
+
updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
|
3795 |
+
target = undefined;
|
3796 |
+
}
|
3797 |
+
|
3798 |
+
function eventsMixin (Vue) {
|
3799 |
+
var hookRE = /^hook:/;
|
3800 |
+
Vue.prototype.$on = function (event, fn) {
|
3801 |
+
var vm = this;
|
3802 |
+
if (Array.isArray(event)) {
|
3803 |
+
for (var i = 0, l = event.length; i < l; i++) {
|
3804 |
+
vm.$on(event[i], fn);
|
3805 |
+
}
|
3806 |
+
} else {
|
3807 |
+
(vm._events[event] || (vm._events[event] = [])).push(fn);
|
3808 |
+
// optimize hook:event cost by using a boolean flag marked at registration
|
3809 |
+
// instead of a hash lookup
|
3810 |
+
if (hookRE.test(event)) {
|
3811 |
+
vm._hasHookEvent = true;
|
3812 |
+
}
|
3813 |
+
}
|
3814 |
+
return vm
|
3815 |
+
};
|
3816 |
+
|
3817 |
+
Vue.prototype.$once = function (event, fn) {
|
3818 |
+
var vm = this;
|
3819 |
+
function on () {
|
3820 |
+
vm.$off(event, on);
|
3821 |
+
fn.apply(vm, arguments);
|
3822 |
+
}
|
3823 |
+
on.fn = fn;
|
3824 |
+
vm.$on(event, on);
|
3825 |
+
return vm
|
3826 |
+
};
|
3827 |
+
|
3828 |
+
Vue.prototype.$off = function (event, fn) {
|
3829 |
+
var vm = this;
|
3830 |
+
// all
|
3831 |
+
if (!arguments.length) {
|
3832 |
+
vm._events = Object.create(null);
|
3833 |
+
return vm
|
3834 |
+
}
|
3835 |
+
// array of events
|
3836 |
+
if (Array.isArray(event)) {
|
3837 |
+
for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
|
3838 |
+
vm.$off(event[i$1], fn);
|
3839 |
+
}
|
3840 |
+
return vm
|
3841 |
+
}
|
3842 |
+
// specific event
|
3843 |
+
var cbs = vm._events[event];
|
3844 |
+
if (!cbs) {
|
3845 |
+
return vm
|
3846 |
+
}
|
3847 |
+
if (!fn) {
|
3848 |
+
vm._events[event] = null;
|
3849 |
+
return vm
|
3850 |
+
}
|
3851 |
+
// specific handler
|
3852 |
+
var cb;
|
3853 |
+
var i = cbs.length;
|
3854 |
+
while (i--) {
|
3855 |
+
cb = cbs[i];
|
3856 |
+
if (cb === fn || cb.fn === fn) {
|
3857 |
+
cbs.splice(i, 1);
|
3858 |
+
break
|
3859 |
+
}
|
3860 |
+
}
|
3861 |
+
return vm
|
3862 |
+
};
|
3863 |
+
|
3864 |
+
Vue.prototype.$emit = function (event) {
|
3865 |
+
var vm = this;
|
3866 |
+
{
|
3867 |
+
var lowerCaseEvent = event.toLowerCase();
|
3868 |
+
if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
|
3869 |
+
tip(
|
3870 |
+
"Event \"" + lowerCaseEvent + "\" is emitted in component " +
|
3871 |
+
(formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
|
3872 |
+
"Note that HTML attributes are case-insensitive and you cannot use " +
|
3873 |
+
"v-on to listen to camelCase events when using in-DOM templates. " +
|
3874 |
+
"You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
|
3875 |
+
);
|
3876 |
+
}
|
3877 |
+
}
|
3878 |
+
var cbs = vm._events[event];
|
3879 |
+
if (cbs) {
|
3880 |
+
cbs = cbs.length > 1 ? toArray(cbs) : cbs;
|
3881 |
+
var args = toArray(arguments, 1);
|
3882 |
+
var info = "event handler for \"" + event + "\"";
|
3883 |
+
for (var i = 0, l = cbs.length; i < l; i++) {
|
3884 |
+
invokeWithErrorHandling(cbs[i], vm, args, vm, info);
|
3885 |
+
}
|
3886 |
+
}
|
3887 |
+
return vm
|
3888 |
+
};
|
3889 |
+
}
|
3890 |
+
|
3891 |
+
/* */
|
3892 |
+
|
3893 |
+
var activeInstance = null;
|
3894 |
+
var isUpdatingChildComponent = false;
|
3895 |
+
|
3896 |
+
function setActiveInstance(vm) {
|
3897 |
+
var prevActiveInstance = activeInstance;
|
3898 |
+
activeInstance = vm;
|
3899 |
+
return function () {
|
3900 |
+
activeInstance = prevActiveInstance;
|
3901 |
+
}
|
3902 |
+
}
|
3903 |
+
|
3904 |
+
function initLifecycle (vm) {
|
3905 |
+
var options = vm.$options;
|
3906 |
+
|
3907 |
+
// locate first non-abstract parent
|
3908 |
+
var parent = options.parent;
|
3909 |
+
if (parent && !options.abstract) {
|
3910 |
+
while (parent.$options.abstract && parent.$parent) {
|
3911 |
+
parent = parent.$parent;
|
3912 |
+
}
|
3913 |
+
parent.$children.push(vm);
|
3914 |
+
}
|
3915 |
+
|
3916 |
+
vm.$parent = parent;
|
3917 |
+
vm.$root = parent ? parent.$root : vm;
|
3918 |
+
|
3919 |
+
vm.$children = [];
|
3920 |
+
vm.$refs = {};
|
3921 |
+
|
3922 |
+
vm._watcher = null;
|
3923 |
+
vm._inactive = null;
|
3924 |
+
vm._directInactive = false;
|
3925 |
+
vm._isMounted = false;
|
3926 |
+
vm._isDestroyed = false;
|
3927 |
+
vm._isBeingDestroyed = false;
|
3928 |
+
}
|
3929 |
+
|
3930 |
+
function lifecycleMixin (Vue) {
|
3931 |
+
Vue.prototype._update = function (vnode, hydrating) {
|
3932 |
+
var vm = this;
|
3933 |
+
var prevEl = vm.$el;
|
3934 |
+
var prevVnode = vm._vnode;
|
3935 |
+
var restoreActiveInstance = setActiveInstance(vm);
|
3936 |
+
vm._vnode = vnode;
|
3937 |
+
// Vue.prototype.__patch__ is injected in entry points
|
3938 |
+
// based on the rendering backend used.
|
3939 |
+
if (!prevVnode) {
|
3940 |
+
// initial render
|
3941 |
+
vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
|
3942 |
+
} else {
|
3943 |
+
// updates
|
3944 |
+
vm.$el = vm.__patch__(prevVnode, vnode);
|
3945 |
+
}
|
3946 |
+
restoreActiveInstance();
|
3947 |
+
// update __vue__ reference
|
3948 |
+
if (prevEl) {
|
3949 |
+
prevEl.__vue__ = null;
|
3950 |
+
}
|
3951 |
+
if (vm.$el) {
|
3952 |
+
vm.$el.__vue__ = vm;
|
3953 |
+
}
|
3954 |
+
// if parent is an HOC, update its $el as well
|
3955 |
+
if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
|
3956 |
+
vm.$parent.$el = vm.$el;
|
3957 |
+
}
|
3958 |
+
// updated hook is called by the scheduler to ensure that children are
|
3959 |
+
// updated in a parent's updated hook.
|
3960 |
+
};
|
3961 |
+
|
3962 |
+
Vue.prototype.$forceUpdate = function () {
|
3963 |
+
var vm = this;
|
3964 |
+
if (vm._watcher) {
|
3965 |
+
vm._watcher.update();
|
3966 |
+
}
|
3967 |
+
};
|
3968 |
+
|
3969 |
+
Vue.prototype.$destroy = function () {
|
3970 |
+
var vm = this;
|
3971 |
+
if (vm._isBeingDestroyed) {
|
3972 |
+
return
|
3973 |
+
}
|
3974 |
+
callHook(vm, 'beforeDestroy');
|
3975 |
+
vm._isBeingDestroyed = true;
|
3976 |
+
// remove self from parent
|
3977 |
+
var parent = vm.$parent;
|
3978 |
+
if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
|
3979 |
+
remove(parent.$children, vm);
|
3980 |
+
}
|
3981 |
+
// teardown watchers
|
3982 |
+
if (vm._watcher) {
|
3983 |
+
vm._watcher.teardown();
|
3984 |
+
}
|
3985 |
+
var i = vm._watchers.length;
|
3986 |
+
while (i--) {
|
3987 |
+
vm._watchers[i].teardown();
|
3988 |
+
}
|
3989 |
+
// remove reference from data ob
|
3990 |
+
// frozen object may not have observer.
|
3991 |
+
if (vm._data.__ob__) {
|
3992 |
+
vm._data.__ob__.vmCount--;
|
3993 |
+
}
|
3994 |
+
// call the last hook...
|
3995 |
+
vm._isDestroyed = true;
|
3996 |
+
// invoke destroy hooks on current rendered tree
|
3997 |
+
vm.__patch__(vm._vnode, null);
|
3998 |
+
// fire destroyed hook
|
3999 |
+
callHook(vm, 'destroyed');
|
4000 |
+
// turn off all instance listeners.
|
4001 |
+
vm.$off();
|
4002 |
+
// remove __vue__ reference
|
4003 |
+
if (vm.$el) {
|
4004 |
+
vm.$el.__vue__ = null;
|
4005 |
+
}
|
4006 |
+
// release circular reference (#6759)
|
4007 |
+
if (vm.$vnode) {
|
4008 |
+
vm.$vnode.parent = null;
|
4009 |
+
}
|
4010 |
+
};
|
4011 |
+
}
|
4012 |
+
|
4013 |
+
function mountComponent (
|
4014 |
+
vm,
|
4015 |
+
el,
|
4016 |
+
hydrating
|
4017 |
+
) {
|
4018 |
+
vm.$el = el;
|
4019 |
+
if (!vm.$options.render) {
|
4020 |
+
vm.$options.render = createEmptyVNode;
|
4021 |
+
{
|
4022 |
+
/* istanbul ignore if */
|
4023 |
+
if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
|
4024 |
+
vm.$options.el || el) {
|
4025 |
+
warn(
|
4026 |
+
'You are using the runtime-only build of Vue where the template ' +
|
4027 |
+
'compiler is not available. Either pre-compile the templates into ' +
|
4028 |
+
'render functions, or use the compiler-included build.',
|
4029 |
+
vm
|
4030 |
+
);
|
4031 |
+
} else {
|
4032 |
+
warn(
|
4033 |
+
'Failed to mount component: template or render function not defined.',
|
4034 |
+
vm
|
4035 |
+
);
|
4036 |
+
}
|
4037 |
+
}
|
4038 |
+
}
|
4039 |
+
callHook(vm, 'beforeMount');
|
4040 |
+
|
4041 |
+
var updateComponent;
|
4042 |
+
/* istanbul ignore if */
|
4043 |
+
if (config.performance && mark) {
|
4044 |
+
updateComponent = function () {
|
4045 |
+
var name = vm._name;
|
4046 |
+
var id = vm._uid;
|
4047 |
+
var startTag = "vue-perf-start:" + id;
|
4048 |
+
var endTag = "vue-perf-end:" + id;
|
4049 |
+
|
4050 |
+
mark(startTag);
|
4051 |
+
var vnode = vm._render();
|
4052 |
+
mark(endTag);
|
4053 |
+
measure(("vue " + name + " render"), startTag, endTag);
|
4054 |
+
|
4055 |
+
mark(startTag);
|
4056 |
+
vm._update(vnode, hydrating);
|
4057 |
+
mark(endTag);
|
4058 |
+
measure(("vue " + name + " patch"), startTag, endTag);
|
4059 |
+
};
|
4060 |
+
} else {
|
4061 |
+
updateComponent = function () {
|
4062 |
+
vm._update(vm._render(), hydrating);
|
4063 |
+
};
|
4064 |
+
}
|
4065 |
+
|
4066 |
+
// we set this to vm._watcher inside the watcher's constructor
|
4067 |
+
// since the watcher's initial patch may call $forceUpdate (e.g. inside child
|
4068 |
+
// component's mounted hook), which relies on vm._watcher being already defined
|
4069 |
+
new Watcher(vm, updateComponent, noop, {
|
4070 |
+
before: function before () {
|
4071 |
+
if (vm._isMounted && !vm._isDestroyed) {
|
4072 |
+
callHook(vm, 'beforeUpdate');
|
4073 |
+
}
|
4074 |
+
}
|
4075 |
+
}, true /* isRenderWatcher */);
|
4076 |
+
hydrating = false;
|
4077 |
+
|
4078 |
+
// manually mounted instance, call mounted on self
|
4079 |
+
// mounted is called for render-created child components in its inserted hook
|
4080 |
+
if (vm.$vnode == null) {
|
4081 |
+
vm._isMounted = true;
|
4082 |
+
callHook(vm, 'mounted');
|
4083 |
+
}
|
4084 |
+
return vm
|
4085 |
+
}
|
4086 |
+
|
4087 |
+
function updateChildComponent (
|
4088 |
+
vm,
|
4089 |
+
propsData,
|
4090 |
+
listeners,
|
4091 |
+
parentVnode,
|
4092 |
+
renderChildren
|
4093 |
+
) {
|
4094 |
+
{
|
4095 |
+
isUpdatingChildComponent = true;
|
4096 |
+
}
|
4097 |
+
|
4098 |
+
// determine whether component has slot children
|
4099 |
+
// we need to do this before overwriting $options._renderChildren.
|
4100 |
+
|
4101 |
+
// check if there are dynamic scopedSlots (hand-written or compiled but with
|
4102 |
+
// dynamic slot names). Static scoped slots compiled from template has the
|
4103 |
+
// "$stable" marker.
|
4104 |
+
var newScopedSlots = parentVnode.data.scopedSlots;
|
4105 |
+
var oldScopedSlots = vm.$scopedSlots;
|
4106 |
+
var hasDynamicScopedSlot = !!(
|
4107 |
+
(newScopedSlots && !newScopedSlots.$stable) ||
|
4108 |
+
(oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
|
4109 |
+
(newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
|
4110 |
+
);
|
4111 |
+
|
4112 |
+
// Any static slot children from the parent may have changed during parent's
|
4113 |
+
// update. Dynamic scoped slots may also have changed. In such cases, a forced
|
4114 |
+
// update is necessary to ensure correctness.
|
4115 |
+
var needsForceUpdate = !!(
|
4116 |
+
renderChildren || // has new static slots
|
4117 |
+
vm.$options._renderChildren || // has old static slots
|
4118 |
+
hasDynamicScopedSlot
|
4119 |
+
);
|
4120 |
+
|
4121 |
+
vm.$options._parentVnode = parentVnode;
|
4122 |
+
vm.$vnode = parentVnode; // update vm's placeholder node without re-render
|
4123 |
+
|
4124 |
+
if (vm._vnode) { // update child tree's parent
|
4125 |
+
vm._vnode.parent = parentVnode;
|
4126 |
+
}
|
4127 |
+
vm.$options._renderChildren = renderChildren;
|
4128 |
+
|
4129 |
+
// update $attrs and $listeners hash
|
4130 |
+
// these are also reactive so they may trigger child update if the child
|
4131 |
+
// used them during render
|
4132 |
+
vm.$attrs = parentVnode.data.attrs || emptyObject;
|
4133 |
+
vm.$listeners = listeners || emptyObject;
|
4134 |
+
|
4135 |
+
// update props
|
4136 |
+
if (propsData && vm.$options.props) {
|
4137 |
+
toggleObserving(false);
|
4138 |
+
var props = vm._props;
|
4139 |
+
var propKeys = vm.$options._propKeys || [];
|
4140 |
+
for (var i = 0; i < propKeys.length; i++) {
|
4141 |
+
var key = propKeys[i];
|
4142 |
+
var propOptions = vm.$options.props; // wtf flow?
|
4143 |
+
props[key] = validateProp(key, propOptions, propsData, vm);
|
4144 |
+
}
|
4145 |
+
toggleObserving(true);
|
4146 |
+
// keep a copy of raw propsData
|
4147 |
+
vm.$options.propsData = propsData;
|
4148 |
+
}
|
4149 |
+
|
4150 |
+
// update listeners
|
4151 |
+
listeners = listeners || emptyObject;
|
4152 |
+
var oldListeners = vm.$options._parentListeners;
|
4153 |
+
vm.$options._parentListeners = listeners;
|
4154 |
+
updateComponentListeners(vm, listeners, oldListeners);
|
4155 |
+
|
4156 |
+
// resolve slots + force update if has children
|
4157 |
+
if (needsForceUpdate) {
|
4158 |
+
vm.$slots = resolveSlots(renderChildren, parentVnode.context);
|
4159 |
+
vm.$forceUpdate();
|
4160 |
+
}
|
4161 |
+
|
4162 |
+
{
|
4163 |
+
isUpdatingChildComponent = false;
|
4164 |
+
}
|
4165 |
+
}
|
4166 |
+
|
4167 |
+
function isInInactiveTree (vm) {
|
4168 |
+
while (vm && (vm = vm.$parent)) {
|
4169 |
+
if (vm._inactive) { return true }
|
4170 |
+
}
|
4171 |
+
return false
|
4172 |
+
}
|
4173 |
+
|
4174 |
+
function activateChildComponent (vm, direct) {
|
4175 |
+
if (direct) {
|
4176 |
+
vm._directInactive = false;
|
4177 |
+
if (isInInactiveTree(vm)) {
|
4178 |
+
return
|
4179 |
+
}
|
4180 |
+
} else if (vm._directInactive) {
|
4181 |
+
return
|
4182 |
+
}
|
4183 |
+
if (vm._inactive || vm._inactive === null) {
|
4184 |
+
vm._inactive = false;
|
4185 |
+
for (var i = 0; i < vm.$children.length; i++) {
|
4186 |
+
activateChildComponent(vm.$children[i]);
|
4187 |
+
}
|
4188 |
+
callHook(vm, 'activated');
|
4189 |
+
}
|
4190 |
+
}
|
4191 |
+
|
4192 |
+
function deactivateChildComponent (vm, direct) {
|
4193 |
+
if (direct) {
|
4194 |
+
vm._directInactive = true;
|
4195 |
+
if (isInInactiveTree(vm)) {
|
4196 |
+
return
|
4197 |
+
}
|
4198 |
+
}
|
4199 |
+
if (!vm._inactive) {
|
4200 |
+
vm._inactive = true;
|
4201 |
+
for (var i = 0; i < vm.$children.length; i++) {
|
4202 |
+
deactivateChildComponent(vm.$children[i]);
|
4203 |
+
}
|
4204 |
+
callHook(vm, 'deactivated');
|
4205 |
+
}
|
4206 |
+
}
|
4207 |
+
|
4208 |
+
function callHook (vm, hook) {
|
4209 |
+
// #7573 disable dep collection when invoking lifecycle hooks
|
4210 |
+
pushTarget();
|
4211 |
+
var handlers = vm.$options[hook];
|
4212 |
+
var info = hook + " hook";
|
4213 |
+
if (handlers) {
|
4214 |
+
for (var i = 0, j = handlers.length; i < j; i++) {
|
4215 |
+
invokeWithErrorHandling(handlers[i], vm, null, vm, info);
|
4216 |
+
}
|
4217 |
+
}
|
4218 |
+
if (vm._hasHookEvent) {
|
4219 |
+
vm.$emit('hook:' + hook);
|
4220 |
+
}
|
4221 |
+
popTarget();
|
4222 |
+
}
|
4223 |
+
|
4224 |
+
/* */
|
4225 |
+
|
4226 |
+
var MAX_UPDATE_COUNT = 100;
|
4227 |
+
|
4228 |
+
var queue = [];
|
4229 |
+
var activatedChildren = [];
|
4230 |
+
var has = {};
|
4231 |
+
var circular = {};
|
4232 |
+
var waiting = false;
|
4233 |
+
var flushing = false;
|
4234 |
+
var index = 0;
|
4235 |
+
|
4236 |
+
/**
|
4237 |
+
* Reset the scheduler's state.
|
4238 |
+
*/
|
4239 |
+
function resetSchedulerState () {
|
4240 |
+
index = queue.length = activatedChildren.length = 0;
|
4241 |
+
has = {};
|
4242 |
+
{
|
4243 |
+
circular = {};
|
4244 |
+
}
|
4245 |
+
waiting = flushing = false;
|
4246 |
+
}
|
4247 |
+
|
4248 |
+
// Async edge case #6566 requires saving the timestamp when event listeners are
|
4249 |
+
// attached. However, calling performance.now() has a perf overhead especially
|
4250 |
+
// if the page has thousands of event listeners. Instead, we take a timestamp
|
4251 |
+
// every time the scheduler flushes and use that for all event listeners
|
4252 |
+
// attached during that flush.
|
4253 |
+
var currentFlushTimestamp = 0;
|
4254 |
+
|
4255 |
+
// Async edge case fix requires storing an event listener's attach timestamp.
|
4256 |
+
var getNow = Date.now;
|
4257 |
+
|
4258 |
+
// Determine what event timestamp the browser is using. Annoyingly, the
|
4259 |
+
// timestamp can either be hi-res (relative to page load) or low-res
|
4260 |
+
// (relative to UNIX epoch), so in order to compare time we have to use the
|
4261 |
+
// same timestamp type when saving the flush timestamp.
|
4262 |
+
// All IE versions use low-res event timestamps, and have problematic clock
|
4263 |
+
// implementations (#9632)
|
4264 |
+
if (inBrowser && !isIE) {
|
4265 |
+
var performance = window.performance;
|
4266 |
+
if (
|
4267 |
+
performance &&
|
4268 |
+
typeof performance.now === 'function' &&
|
4269 |
+
getNow() > document.createEvent('Event').timeStamp
|
4270 |
+
) {
|
4271 |
+
// if the event timestamp, although evaluated AFTER the Date.now(), is
|
4272 |
+
// smaller than it, it means the event is using a hi-res timestamp,
|
4273 |
+
// and we need to use the hi-res version for event listener timestamps as
|
4274 |
+
// well.
|
4275 |
+
getNow = function () { return performance.now(); };
|
4276 |
+
}
|
4277 |
+
}
|
4278 |
+
|
4279 |
+
/**
|
4280 |
+
* Flush both queues and run the watchers.
|
4281 |
+
*/
|
4282 |
+
function flushSchedulerQueue () {
|
4283 |
+
currentFlushTimestamp = getNow();
|
4284 |
+
flushing = true;
|
4285 |
+
var watcher, id;
|
4286 |
+
|
4287 |
+
// Sort queue before flush.
|
4288 |
+
// This ensures that:
|
4289 |
+
// 1. Components are updated from parent to child. (because parent is always
|
4290 |
+
// created before the child)
|
4291 |
+
// 2. A component's user watchers are run before its render watcher (because
|
4292 |
+
// user watchers are created before the render watcher)
|
4293 |
+
// 3. If a component is destroyed during a parent component's watcher run,
|
4294 |
+
// its watchers can be skipped.
|
4295 |
+
queue.sort(function (a, b) { return a.id - b.id; });
|
4296 |
+
|
4297 |
+
// do not cache length because more watchers might be pushed
|
4298 |
+
// as we run existing watchers
|
4299 |
+
for (index = 0; index < queue.length; index++) {
|
4300 |
+
watcher = queue[index];
|
4301 |
+
if (watcher.before) {
|
4302 |
+
watcher.before();
|
4303 |
+
}
|
4304 |
+
id = watcher.id;
|
4305 |
+
has[id] = null;
|
4306 |
+
watcher.run();
|
4307 |
+
// in dev build, check and stop circular updates.
|
4308 |
+
if (has[id] != null) {
|
4309 |
+
circular[id] = (circular[id] || 0) + 1;
|
4310 |
+
if (circular[id] > MAX_UPDATE_COUNT) {
|
4311 |
+
warn(
|
4312 |
+
'You may have an infinite update loop ' + (
|
4313 |
+
watcher.user
|
4314 |
+
? ("in watcher with expression \"" + (watcher.expression) + "\"")
|
4315 |
+
: "in a component render function."
|
4316 |
+
),
|
4317 |
+
watcher.vm
|
4318 |
+
);
|
4319 |
+
break
|
4320 |
+
}
|
4321 |
+
}
|
4322 |
+
}
|
4323 |
+
|
4324 |
+
// keep copies of post queues before resetting state
|
4325 |
+
var activatedQueue = activatedChildren.slice();
|
4326 |
+
var updatedQueue = queue.slice();
|
4327 |
+
|
4328 |
+
resetSchedulerState();
|
4329 |
+
|
4330 |
+
// call component updated and activated hooks
|
4331 |
+
callActivatedHooks(activatedQueue);
|
4332 |
+
callUpdatedHooks(updatedQueue);
|
4333 |
+
|
4334 |
+
// devtool hook
|
4335 |
+
/* istanbul ignore if */
|
4336 |
+
if (devtools && config.devtools) {
|
4337 |
+
devtools.emit('flush');
|
4338 |
+
}
|
4339 |
+
}
|
4340 |
+
|
4341 |
+
function callUpdatedHooks (queue) {
|
4342 |
+
var i = queue.length;
|
4343 |
+
while (i--) {
|
4344 |
+
var watcher = queue[i];
|
4345 |
+
var vm = watcher.vm;
|
4346 |
+
if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
|
4347 |
+
callHook(vm, 'updated');
|
4348 |
+
}
|
4349 |
+
}
|
4350 |
+
}
|
4351 |
+
|
4352 |
+
/**
|
4353 |
+
* Queue a kept-alive component that was activated during patch.
|
4354 |
+
* The queue will be processed after the entire tree has been patched.
|
4355 |
+
*/
|
4356 |
+
function queueActivatedComponent (vm) {
|
4357 |
+
// setting _inactive to false here so that a render function can
|
4358 |
+
// rely on checking whether it's in an inactive tree (e.g. router-view)
|
4359 |
+
vm._inactive = false;
|
4360 |
+
activatedChildren.push(vm);
|
4361 |
+
}
|
4362 |
+
|
4363 |
+
function callActivatedHooks (queue) {
|
4364 |
+
for (var i = 0; i < queue.length; i++) {
|
4365 |
+
queue[i]._inactive = true;
|
4366 |
+
activateChildComponent(queue[i], true /* true */);
|
4367 |
+
}
|
4368 |
+
}
|
4369 |
+
|
4370 |
+
/**
|
4371 |
+
* Push a watcher into the watcher queue.
|
4372 |
+
* Jobs with duplicate IDs will be skipped unless it's
|
4373 |
+
* pushed when the queue is being flushed.
|
4374 |
+
*/
|
4375 |
+
function queueWatcher (watcher) {
|
4376 |
+
var id = watcher.id;
|
4377 |
+
if (has[id] == null) {
|
4378 |
+
has[id] = true;
|
4379 |
+
if (!flushing) {
|
4380 |
+
queue.push(watcher);
|
4381 |
+
} else {
|
4382 |
+
// if already flushing, splice the watcher based on its id
|
4383 |
+
// if already past its id, it will be run next immediately.
|
4384 |
+
var i = queue.length - 1;
|
4385 |
+
while (i > index && queue[i].id > watcher.id) {
|
4386 |
+
i--;
|
4387 |
+
}
|
4388 |
+
queue.splice(i + 1, 0, watcher);
|
4389 |
+
}
|
4390 |
+
// queue the flush
|
4391 |
+
if (!waiting) {
|
4392 |
+
waiting = true;
|
4393 |
+
|
4394 |
+
if (!config.async) {
|
4395 |
+
flushSchedulerQueue();
|
4396 |
+
return
|
4397 |
+
}
|
4398 |
+
nextTick(flushSchedulerQueue);
|
4399 |
+
}
|
4400 |
+
}
|
4401 |
+
}
|
4402 |
+
|
4403 |
+
/* */
|
4404 |
+
|
4405 |
+
|
4406 |
+
|
4407 |
+
var uid$2 = 0;
|
4408 |
+
|
4409 |
+
/**
|
4410 |
+
* A watcher parses an expression, collects dependencies,
|
4411 |
+
* and fires callback when the expression value changes.
|
4412 |
+
* This is used for both the $watch() api and directives.
|
4413 |
+
*/
|
4414 |
+
var Watcher = function Watcher (
|
4415 |
+
vm,
|
4416 |
+
expOrFn,
|
4417 |
+
cb,
|
4418 |
+
options,
|
4419 |
+
isRenderWatcher
|
4420 |
+
) {
|
4421 |
+
this.vm = vm;
|
4422 |
+
if (isRenderWatcher) {
|
4423 |
+
vm._watcher = this;
|
4424 |
+
}
|
4425 |
+
vm._watchers.push(this);
|
4426 |
+
// options
|
4427 |
+
if (options) {
|
4428 |
+
this.deep = !!options.deep;
|
4429 |
+
this.user = !!options.user;
|
4430 |
+
this.lazy = !!options.lazy;
|
4431 |
+
this.sync = !!options.sync;
|
4432 |
+
this.before = options.before;
|
4433 |
+
} else {
|
4434 |
+
this.deep = this.user = this.lazy = this.sync = false;
|
4435 |
+
}
|
4436 |
+
this.cb = cb;
|
4437 |
+
this.id = ++uid$2; // uid for batching
|
4438 |
+
this.active = true;
|
4439 |
+
this.dirty = this.lazy; // for lazy watchers
|
4440 |
+
this.deps = [];
|
4441 |
+
this.newDeps = [];
|
4442 |
+
this.depIds = new _Set();
|
4443 |
+
this.newDepIds = new _Set();
|
4444 |
+
this.expression = expOrFn.toString();
|
4445 |
+
// parse expression for getter
|
4446 |
+
if (typeof expOrFn === 'function') {
|
4447 |
+
this.getter = expOrFn;
|
4448 |
+
} else {
|
4449 |
+
this.getter = parsePath(expOrFn);
|
4450 |
+
if (!this.getter) {
|
4451 |
+
this.getter = noop;
|
4452 |
+
warn(
|
4453 |
+
"Failed watching path: \"" + expOrFn + "\" " +
|
4454 |
+
'Watcher only accepts simple dot-delimited paths. ' +
|
4455 |
+
'For full control, use a function instead.',
|
4456 |
+
vm
|
4457 |
+
);
|
4458 |
+
}
|
4459 |
+
}
|
4460 |
+
this.value = this.lazy
|
4461 |
+
? undefined
|
4462 |
+
: this.get();
|
4463 |
+
};
|
4464 |
+
|
4465 |
+
/**
|
4466 |
+
* Evaluate the getter, and re-collect dependencies.
|
4467 |
+
*/
|
4468 |
+
Watcher.prototype.get = function get () {
|
4469 |
+
pushTarget(this);
|
4470 |
+
var value;
|
4471 |
+
var vm = this.vm;
|
4472 |
+
try {
|
4473 |
+
value = this.getter.call(vm, vm);
|
4474 |
+
} catch (e) {
|
4475 |
+
if (this.user) {
|
4476 |
+
handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
|
4477 |
+
} else {
|
4478 |
+
throw e
|
4479 |
+
}
|
4480 |
+
} finally {
|
4481 |
+
// "touch" every property so they are all tracked as
|
4482 |
+
// dependencies for deep watching
|
4483 |
+
if (this.deep) {
|
4484 |
+
traverse(value);
|
4485 |
+
}
|
4486 |
+
popTarget();
|
4487 |
+
this.cleanupDeps();
|
4488 |
+
}
|
4489 |
+
return value
|
4490 |
+
};
|
4491 |
+
|
4492 |
+
/**
|
4493 |
+
* Add a dependency to this directive.
|
4494 |
+
*/
|
4495 |
+
Watcher.prototype.addDep = function addDep (dep) {
|
4496 |
+
var id = dep.id;
|
4497 |
+
if (!this.newDepIds.has(id)) {
|
4498 |
+
this.newDepIds.add(id);
|
4499 |
+
this.newDeps.push(dep);
|
4500 |
+
if (!this.depIds.has(id)) {
|
4501 |
+
dep.addSub(this);
|
4502 |
+
}
|
4503 |
+
}
|
4504 |
+
};
|
4505 |
+
|
4506 |
+
/**
|
4507 |
+
* Clean up for dependency collection.
|
4508 |
+
*/
|
4509 |
+
Watcher.prototype.cleanupDeps = function cleanupDeps () {
|
4510 |
+
var i = this.deps.length;
|
4511 |
+
while (i--) {
|
4512 |
+
var dep = this.deps[i];
|
4513 |
+
if (!this.newDepIds.has(dep.id)) {
|
4514 |
+
dep.removeSub(this);
|
4515 |
+
}
|
4516 |
+
}
|
4517 |
+
var tmp = this.depIds;
|
4518 |
+
this.depIds = this.newDepIds;
|
4519 |
+
this.newDepIds = tmp;
|
4520 |
+
this.newDepIds.clear();
|
4521 |
+
tmp = this.deps;
|
4522 |
+
this.deps = this.newDeps;
|
4523 |
+
this.newDeps = tmp;
|
4524 |
+
this.newDeps.length = 0;
|
4525 |
+
};
|
4526 |
+
|
4527 |
+
/**
|
4528 |
+
* Subscriber interface.
|
4529 |
+
* Will be called when a dependency changes.
|
4530 |
+
*/
|
4531 |
+
Watcher.prototype.update = function update () {
|
4532 |
+
/* istanbul ignore else */
|
4533 |
+
if (this.lazy) {
|
4534 |
+
this.dirty = true;
|
4535 |
+
} else if (this.sync) {
|
4536 |
+
this.run();
|
4537 |
+
} else {
|
4538 |
+
queueWatcher(this);
|
4539 |
+
}
|
4540 |
+
};
|
4541 |
+
|
4542 |
+
/**
|
4543 |
+
* Scheduler job interface.
|
4544 |
+
* Will be called by the scheduler.
|
4545 |
+
*/
|
4546 |
+
Watcher.prototype.run = function run () {
|
4547 |
+
if (this.active) {
|
4548 |
+
var value = this.get();
|
4549 |
+
if (
|
4550 |
+
value !== this.value ||
|
4551 |
+
// Deep watchers and watchers on Object/Arrays should fire even
|
4552 |
+
// when the value is the same, because the value may
|
4553 |
+
// have mutated.
|
4554 |
+
isObject(value) ||
|
4555 |
+
this.deep
|
4556 |
+
) {
|
4557 |
+
// set new value
|
4558 |
+
var oldValue = this.value;
|
4559 |
+
this.value = value;
|
4560 |
+
if (this.user) {
|
4561 |
+
try {
|
4562 |
+
this.cb.call(this.vm, value, oldValue);
|
4563 |
+
} catch (e) {
|
4564 |
+
handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
|
4565 |
+
}
|
4566 |
+
} else {
|
4567 |
+
this.cb.call(this.vm, value, oldValue);
|
4568 |
+
}
|
4569 |
+
}
|
4570 |
+
}
|
4571 |
+
};
|
4572 |
+
|
4573 |
+
/**
|
4574 |
+
* Evaluate the value of the watcher.
|
4575 |
+
* This only gets called for lazy watchers.
|
4576 |
+
*/
|
4577 |
+
Watcher.prototype.evaluate = function evaluate () {
|
4578 |
+
this.value = this.get();
|
4579 |
+
this.dirty = false;
|
4580 |
+
};
|
4581 |
+
|
4582 |
+
/**
|
4583 |
+
* Depend on all deps collected by this watcher.
|
4584 |
+
*/
|
4585 |
+
Watcher.prototype.depend = function depend () {
|
4586 |
+
var i = this.deps.length;
|
4587 |
+
while (i--) {
|
4588 |
+
this.deps[i].depend();
|
4589 |
+
}
|
4590 |
+
};
|
4591 |
+
|
4592 |
+
/**
|
4593 |
+
* Remove self from all dependencies' subscriber list.
|
4594 |
+
*/
|
4595 |
+
Watcher.prototype.teardown = function teardown () {
|
4596 |
+
if (this.active) {
|
4597 |
+
// remove self from vm's watcher list
|
4598 |
+
// this is a somewhat expensive operation so we skip it
|
4599 |
+
// if the vm is being destroyed.
|
4600 |
+
if (!this.vm._isBeingDestroyed) {
|
4601 |
+
remove(this.vm._watchers, this);
|
4602 |
+
}
|
4603 |
+
var i = this.deps.length;
|
4604 |
+
while (i--) {
|
4605 |
+
this.deps[i].removeSub(this);
|
4606 |
+
}
|
4607 |
+
this.active = false;
|
4608 |
+
}
|
4609 |
+
};
|
4610 |
+
|
4611 |
+
/* */
|
4612 |
+
|
4613 |
+
var sharedPropertyDefinition = {
|
4614 |
+
enumerable: true,
|
4615 |
+
configurable: true,
|
4616 |
+
get: noop,
|
4617 |
+
set: noop
|
4618 |
+
};
|
4619 |
+
|
4620 |
+
function proxy (target, sourceKey, key) {
|
4621 |
+
sharedPropertyDefinition.get = function proxyGetter () {
|
4622 |
+
return this[sourceKey][key]
|
4623 |
+
};
|
4624 |
+
sharedPropertyDefinition.set = function proxySetter (val) {
|
4625 |
+
this[sourceKey][key] = val;
|
4626 |
+
};
|
4627 |
+
Object.defineProperty(target, key, sharedPropertyDefinition);
|
4628 |
+
}
|
4629 |
+
|
4630 |
+
function initState (vm) {
|
4631 |
+
vm._watchers = [];
|
4632 |
+
var opts = vm.$options;
|
4633 |
+
if (opts.props) { initProps(vm, opts.props); }
|
4634 |
+
if (opts.methods) { initMethods(vm, opts.methods); }
|
4635 |
+
if (opts.data) {
|
4636 |
+
initData(vm);
|
4637 |
+
} else {
|
4638 |
+
observe(vm._data = {}, true /* asRootData */);
|
4639 |
+
}
|
4640 |
+
if (opts.computed) { initComputed(vm, opts.computed); }
|
4641 |
+
if (opts.watch && opts.watch !== nativeWatch) {
|
4642 |
+
initWatch(vm, opts.watch);
|
4643 |
+
}
|
4644 |
+
}
|
4645 |
+
|
4646 |
+
function initProps (vm, propsOptions) {
|
4647 |
+
var propsData = vm.$options.propsData || {};
|
4648 |
+
var props = vm._props = {};
|
4649 |
+
// cache prop keys so that future props updates can iterate using Array
|
4650 |
+
// instead of dynamic object key enumeration.
|
4651 |
+
var keys = vm.$options._propKeys = [];
|
4652 |
+
var isRoot = !vm.$parent;
|
4653 |
+
// root instance props should be converted
|
4654 |
+
if (!isRoot) {
|
4655 |
+
toggleObserving(false);
|
4656 |
+
}
|
4657 |
+
var loop = function ( key ) {
|
4658 |
+
keys.push(key);
|
4659 |
+
var value = validateProp(key, propsOptions, propsData, vm);
|
4660 |
+
/* istanbul ignore else */
|
4661 |
+
{
|
4662 |
+
var hyphenatedKey = hyphenate(key);
|
4663 |
+
if (isReservedAttribute(hyphenatedKey) ||
|
4664 |
+
config.isReservedAttr(hyphenatedKey)) {
|
4665 |
+
warn(
|
4666 |
+
("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
|
4667 |
+
vm
|
4668 |
+
);
|
4669 |
+
}
|
4670 |
+
defineReactive$$1(props, key, value, function () {
|
4671 |
+
if (!isRoot && !isUpdatingChildComponent) {
|
4672 |
+
warn(
|
4673 |
+
"Avoid mutating a prop directly since the value will be " +
|
4674 |
+
"overwritten whenever the parent component re-renders. " +
|
4675 |
+
"Instead, use a data or computed property based on the prop's " +
|
4676 |
+
"value. Prop being mutated: \"" + key + "\"",
|
4677 |
+
vm
|
4678 |
+
);
|
4679 |
+
}
|
4680 |
+
});
|
4681 |
+
}
|
4682 |
+
// static props are already proxied on the component's prototype
|
4683 |
+
// during Vue.extend(). We only need to proxy props defined at
|
4684 |
+
// instantiation here.
|
4685 |
+
if (!(key in vm)) {
|
4686 |
+
proxy(vm, "_props", key);
|
4687 |
+
}
|
4688 |
+
};
|
4689 |
+
|
4690 |
+
for (var key in propsOptions) loop( key );
|
4691 |
+
toggleObserving(true);
|
4692 |
+
}
|
4693 |
+
|
4694 |
+
function initData (vm) {
|
4695 |
+
var data = vm.$options.data;
|
4696 |
+
data = vm._data = typeof data === 'function'
|
4697 |
+
? getData(data, vm)
|
4698 |
+
: data || {};
|
4699 |
+
if (!isPlainObject(data)) {
|
4700 |
+
data = {};
|
4701 |
+
warn(
|
4702 |
+
'data functions should return an object:\n' +
|
4703 |
+
'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
|
4704 |
+
vm
|
4705 |
+
);
|
4706 |
+
}
|
4707 |
+
// proxy data on instance
|
4708 |
+
var keys = Object.keys(data);
|
4709 |
+
var props = vm.$options.props;
|
4710 |
+
var methods = vm.$options.methods;
|
4711 |
+
var i = keys.length;
|
4712 |
+
while (i--) {
|
4713 |
+
var key = keys[i];
|
4714 |
+
{
|
4715 |
+
if (methods && hasOwn(methods, key)) {
|
4716 |
+
warn(
|
4717 |
+
("Method \"" + key + "\" has already been defined as a data property."),
|
4718 |
+
vm
|
4719 |
+
);
|
4720 |
+
}
|
4721 |
+
}
|
4722 |
+
if (props && hasOwn(props, key)) {
|
4723 |
+
warn(
|
4724 |
+
"The data property \"" + key + "\" is already declared as a prop. " +
|
4725 |
+
"Use prop default value instead.",
|
4726 |
+
vm
|
4727 |
+
);
|
4728 |
+
} else if (!isReserved(key)) {
|
4729 |
+
proxy(vm, "_data", key);
|
4730 |
+
}
|
4731 |
+
}
|
4732 |
+
// observe data
|
4733 |
+
observe(data, true /* asRootData */);
|
4734 |
+
}
|
4735 |
+
|
4736 |
+
function getData (data, vm) {
|
4737 |
+
// #7573 disable dep collection when invoking data getters
|
4738 |
+
pushTarget();
|
4739 |
+
try {
|
4740 |
+
return data.call(vm, vm)
|
4741 |
+
} catch (e) {
|
4742 |
+
handleError(e, vm, "data()");
|
4743 |
+
return {}
|
4744 |
+
} finally {
|
4745 |
+
popTarget();
|
4746 |
+
}
|
4747 |
+
}
|
4748 |
+
|
4749 |
+
var computedWatcherOptions = { lazy: true };
|
4750 |
+
|
4751 |
+
function initComputed (vm, computed) {
|
4752 |
+
// $flow-disable-line
|
4753 |
+
var watchers = vm._computedWatchers = Object.create(null);
|
4754 |
+
// computed properties are just getters during SSR
|
4755 |
+
var isSSR = isServerRendering();
|
4756 |
+
|
4757 |
+
for (var key in computed) {
|
4758 |
+
var userDef = computed[key];
|
4759 |
+
var getter = typeof userDef === 'function' ? userDef : userDef.get;
|
4760 |
+
if (getter == null) {
|
4761 |
+
warn(
|
4762 |
+
("Getter is missing for computed property \"" + key + "\"."),
|
4763 |
+
vm
|
4764 |
+
);
|
4765 |
+
}
|
4766 |
+
|
4767 |
+
if (!isSSR) {
|
4768 |
+
// create internal watcher for the computed property.
|
4769 |
+
watchers[key] = new Watcher(
|
4770 |
+
vm,
|
4771 |
+
getter || noop,
|
4772 |
+
noop,
|
4773 |
+
computedWatcherOptions
|
4774 |
+
);
|
4775 |
+
}
|
4776 |
+
|
4777 |
+
// component-defined computed properties are already defined on the
|
4778 |
+
// component prototype. We only need to define computed properties defined
|
4779 |
+
// at instantiation here.
|
4780 |
+
if (!(key in vm)) {
|
4781 |
+
defineComputed(vm, key, userDef);
|
4782 |
+
} else {
|
4783 |
+
if (key in vm.$data) {
|
4784 |
+
warn(("The computed property \"" + key + "\" is already defined in data."), vm);
|
4785 |
+
} else if (vm.$options.props && key in vm.$options.props) {
|
4786 |
+
warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
|
4787 |
+
}
|
4788 |
+
}
|
4789 |
+
}
|
4790 |
+
}
|
4791 |
+
|
4792 |
+
function defineComputed (
|
4793 |
+
target,
|
4794 |
+
key,
|
4795 |
+
userDef
|
4796 |
+
) {
|
4797 |
+
var shouldCache = !isServerRendering();
|
4798 |
+
if (typeof userDef === 'function') {
|
4799 |
+
sharedPropertyDefinition.get = shouldCache
|
4800 |
+
? createComputedGetter(key)
|
4801 |
+
: createGetterInvoker(userDef);
|
4802 |
+
sharedPropertyDefinition.set = noop;
|
4803 |
+
} else {
|
4804 |
+
sharedPropertyDefinition.get = userDef.get
|
4805 |
+
? shouldCache && userDef.cache !== false
|
4806 |
+
? createComputedGetter(key)
|
4807 |
+
: createGetterInvoker(userDef.get)
|
4808 |
+
: noop;
|
4809 |
+
sharedPropertyDefinition.set = userDef.set || noop;
|
4810 |
+
}
|
4811 |
+
if (sharedPropertyDefinition.set === noop) {
|
4812 |
+
sharedPropertyDefinition.set = function () {
|
4813 |
+
warn(
|
4814 |
+
("Computed property \"" + key + "\" was assigned to but it has no setter."),
|
4815 |
+
this
|
4816 |
+
);
|
4817 |
+
};
|
4818 |
+
}
|
4819 |
+
Object.defineProperty(target, key, sharedPropertyDefinition);
|
4820 |
+
}
|
4821 |
+
|
4822 |
+
function createComputedGetter (key) {
|
4823 |
+
return function computedGetter () {
|
4824 |
+
var watcher = this._computedWatchers && this._computedWatchers[key];
|
4825 |
+
if (watcher) {
|
4826 |
+
if (watcher.dirty) {
|
4827 |
+
watcher.evaluate();
|
4828 |
+
}
|
4829 |
+
if (Dep.target) {
|
4830 |
+
watcher.depend();
|
4831 |
+
}
|
4832 |
+
return watcher.value
|
4833 |
+
}
|
4834 |
+
}
|
4835 |
+
}
|
4836 |
+
|
4837 |
+
function createGetterInvoker(fn) {
|
4838 |
+
return function computedGetter () {
|
4839 |
+
return fn.call(this, this)
|
4840 |
+
}
|
4841 |
+
}
|
4842 |
+
|
4843 |
+
function initMethods (vm, methods) {
|
4844 |
+
var props = vm.$options.props;
|
4845 |
+
for (var key in methods) {
|
4846 |
+
{
|
4847 |
+
if (typeof methods[key] !== 'function') {
|
4848 |
+
warn(
|
4849 |
+
"Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
|
4850 |
+
"Did you reference the function correctly?",
|
4851 |
+
vm
|
4852 |
+
);
|
4853 |
+
}
|
4854 |
+
if (props && hasOwn(props, key)) {
|
4855 |
+
warn(
|
4856 |
+
("Method \"" + key + "\" has already been defined as a prop."),
|
4857 |
+
vm
|
4858 |
+
);
|
4859 |
+
}
|
4860 |
+
if ((key in vm) && isReserved(key)) {
|
4861 |
+
warn(
|
4862 |
+
"Method \"" + key + "\" conflicts with an existing Vue instance method. " +
|
4863 |
+
"Avoid defining component methods that start with _ or $."
|
4864 |
+
);
|
4865 |
+
}
|
4866 |
+
}
|
4867 |
+
vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
|
4868 |
+
}
|
4869 |
+
}
|
4870 |
+
|
4871 |
+
function initWatch (vm, watch) {
|
4872 |
+
for (var key in watch) {
|
4873 |
+
var handler = watch[key];
|
4874 |
+
if (Array.isArray(handler)) {
|
4875 |
+
for (var i = 0; i < handler.length; i++) {
|
4876 |
+
createWatcher(vm, key, handler[i]);
|
4877 |
+
}
|
4878 |
+
} else {
|
4879 |
+
createWatcher(vm, key, handler);
|
4880 |
+
}
|
4881 |
+
}
|
4882 |
+
}
|
4883 |
+
|
4884 |
+
function createWatcher (
|
4885 |
+
vm,
|
4886 |
+
expOrFn,
|
4887 |
+
handler,
|
4888 |
+
options
|
4889 |
+
) {
|
4890 |
+
if (isPlainObject(handler)) {
|
4891 |
+
options = handler;
|
4892 |
+
handler = handler.handler;
|
4893 |
+
}
|
4894 |
+
if (typeof handler === 'string') {
|
4895 |
+
handler = vm[handler];
|
4896 |
+
}
|
4897 |
+
return vm.$watch(expOrFn, handler, options)
|
4898 |
+
}
|
4899 |
+
|
4900 |
+
function stateMixin (Vue) {
|
4901 |
+
// flow somehow has problems with directly declared definition object
|
4902 |
+
// when using Object.defineProperty, so we have to procedurally build up
|
4903 |
+
// the object here.
|
4904 |
+
var dataDef = {};
|
4905 |
+
dataDef.get = function () { return this._data };
|
4906 |
+
var propsDef = {};
|
4907 |
+
propsDef.get = function () { return this._props };
|
4908 |
+
{
|
4909 |
+
dataDef.set = function () {
|
4910 |
+
warn(
|
4911 |
+
'Avoid replacing instance root $data. ' +
|
4912 |
+
'Use nested data properties instead.',
|
4913 |
+
this
|
4914 |
+
);
|
4915 |
+
};
|
4916 |
+
propsDef.set = function () {
|
4917 |
+
warn("$props is readonly.", this);
|
4918 |
+
};
|
4919 |
+
}
|
4920 |
+
Object.defineProperty(Vue.prototype, '$data', dataDef);
|
4921 |
+
Object.defineProperty(Vue.prototype, '$props', propsDef);
|
4922 |
+
|
4923 |
+
Vue.prototype.$set = set;
|
4924 |
+
Vue.prototype.$delete = del;
|
4925 |
+
|
4926 |
+
Vue.prototype.$watch = function (
|
4927 |
+
expOrFn,
|
4928 |
+
cb,
|
4929 |
+
options
|
4930 |
+
) {
|
4931 |
+
var vm = this;
|
4932 |
+
if (isPlainObject(cb)) {
|
4933 |
+
return createWatcher(vm, expOrFn, cb, options)
|
4934 |
+
}
|
4935 |
+
options = options || {};
|
4936 |
+
options.user = true;
|
4937 |
+
var watcher = new Watcher(vm, expOrFn, cb, options);
|
4938 |
+
if (options.immediate) {
|
4939 |
+
try {
|
4940 |
+
cb.call(vm, watcher.value);
|
4941 |
+
} catch (error) {
|
4942 |
+
handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
|
4943 |
+
}
|
4944 |
+
}
|
4945 |
+
return function unwatchFn () {
|
4946 |
+
watcher.teardown();
|
4947 |
+
}
|
4948 |
+
};
|
4949 |
+
}
|
4950 |
+
|
4951 |
+
/* */
|
4952 |
+
|
4953 |
+
var uid$3 = 0;
|
4954 |
+
|
4955 |
+
function initMixin (Vue) {
|
4956 |
+
Vue.prototype._init = function (options) {
|
4957 |
+
var vm = this;
|
4958 |
+
// a uid
|
4959 |
+
vm._uid = uid$3++;
|
4960 |
+
|
4961 |
+
var startTag, endTag;
|
4962 |
+
/* istanbul ignore if */
|
4963 |
+
if (config.performance && mark) {
|
4964 |
+
startTag = "vue-perf-start:" + (vm._uid);
|
4965 |
+
endTag = "vue-perf-end:" + (vm._uid);
|
4966 |
+
mark(startTag);
|
4967 |
+
}
|
4968 |
+
|
4969 |
+
// a flag to avoid this being observed
|
4970 |
+
vm._isVue = true;
|
4971 |
+
// merge options
|
4972 |
+
if (options && options._isComponent) {
|
4973 |
+
// optimize internal component instantiation
|
4974 |
+
// since dynamic options merging is pretty slow, and none of the
|
4975 |
+
// internal component options needs special treatment.
|
4976 |
+
initInternalComponent(vm, options);
|
4977 |
+
} else {
|
4978 |
+
vm.$options = mergeOptions(
|
4979 |
+
resolveConstructorOptions(vm.constructor),
|
4980 |
+
options || {},
|
4981 |
+
vm
|
4982 |
+
);
|
4983 |
+
}
|
4984 |
+
/* istanbul ignore else */
|
4985 |
+
{
|
4986 |
+
initProxy(vm);
|
4987 |
+
}
|
4988 |
+
// expose real self
|
4989 |
+
vm._self = vm;
|
4990 |
+
initLifecycle(vm);
|
4991 |
+
initEvents(vm);
|
4992 |
+
initRender(vm);
|
4993 |
+
callHook(vm, 'beforeCreate');
|
4994 |
+
initInjections(vm); // resolve injections before data/props
|
4995 |
+
initState(vm);
|
4996 |
+
initProvide(vm); // resolve provide after data/props
|
4997 |
+
callHook(vm, 'created');
|
4998 |
+
|
4999 |
+
/* istanbul ignore if */
|
5000 |
+
if (config.performance && mark) {
|
5001 |
+
vm._name = formatComponentName(vm, false);
|
5002 |
+
mark(endTag);
|
5003 |
+
measure(("vue " + (vm._name) + " init"), startTag, endTag);
|
5004 |
+
}
|
5005 |
+
|
5006 |
+
if (vm.$options.el) {
|
5007 |
+
vm.$mount(vm.$options.el);
|
5008 |
+
}
|
5009 |
+
};
|
5010 |
+
}
|
5011 |
+
|
5012 |
+
function initInternalComponent (vm, options) {
|
5013 |
+
var opts = vm.$options = Object.create(vm.constructor.options);
|
5014 |
+
// doing this because it's faster than dynamic enumeration.
|
5015 |
+
var parentVnode = options._parentVnode;
|
5016 |
+
opts.parent = options.parent;
|
5017 |
+
opts._parentVnode = parentVnode;
|
5018 |
+
|
5019 |
+
var vnodeComponentOptions = parentVnode.componentOptions;
|
5020 |
+
opts.propsData = vnodeComponentOptions.propsData;
|
5021 |
+
opts._parentListeners = vnodeComponentOptions.listeners;
|
5022 |
+
opts._renderChildren = vnodeComponentOptions.children;
|
5023 |
+
opts._componentTag = vnodeComponentOptions.tag;
|
5024 |
+
|
5025 |
+
if (options.render) {
|
5026 |
+
opts.render = options.render;
|
5027 |
+
opts.staticRenderFns = options.staticRenderFns;
|
5028 |
+
}
|
5029 |
+
}
|
5030 |
+
|
5031 |
+
function resolveConstructorOptions (Ctor) {
|
5032 |
+
var options = Ctor.options;
|
5033 |
+
if (Ctor.super) {
|
5034 |
+
var superOptions = resolveConstructorOptions(Ctor.super);
|
5035 |
+
var cachedSuperOptions = Ctor.superOptions;
|
5036 |
+
if (superOptions !== cachedSuperOptions) {
|
5037 |
+
// super option changed,
|
5038 |
+
// need to resolve new options.
|
5039 |
+
Ctor.superOptions = superOptions;
|
5040 |
+
// check if there are any late-modified/attached options (#4976)
|
5041 |
+
var modifiedOptions = resolveModifiedOptions(Ctor);
|
5042 |
+
// update base extend options
|
5043 |
+
if (modifiedOptions) {
|
5044 |
+
extend(Ctor.extendOptions, modifiedOptions);
|
5045 |
+
}
|
5046 |
+
options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
|
5047 |
+
if (options.name) {
|
5048 |
+
options.components[options.name] = Ctor;
|
5049 |
+
}
|
5050 |
+
}
|
5051 |
+
}
|
5052 |
+
return options
|
5053 |
+
}
|
5054 |
+
|
5055 |
+
function resolveModifiedOptions (Ctor) {
|
5056 |
+
var modified;
|
5057 |
+
var latest = Ctor.options;
|
5058 |
+
var sealed = Ctor.sealedOptions;
|
5059 |
+
for (var key in latest) {
|
5060 |
+
if (latest[key] !== sealed[key]) {
|
5061 |
+
if (!modified) { modified = {}; }
|
5062 |
+
modified[key] = latest[key];
|
5063 |
+
}
|
5064 |
+
}
|
5065 |
+
return modified
|
5066 |
+
}
|
5067 |
+
|
5068 |
+
function Vue (options) {
|
5069 |
+
if (!(this instanceof Vue)
|
5070 |
+
) {
|
5071 |
+
warn('Vue is a constructor and should be called with the `new` keyword');
|
5072 |
+
}
|
5073 |
+
this._init(options);
|
5074 |
+
}
|
5075 |
+
|
5076 |
+
initMixin(Vue);
|
5077 |
+
stateMixin(Vue);
|
5078 |
+
eventsMixin(Vue);
|
5079 |
+
lifecycleMixin(Vue);
|
5080 |
+
renderMixin(Vue);
|
5081 |
+
|
5082 |
+
/* */
|
5083 |
+
|
5084 |
+
function initUse (Vue) {
|
5085 |
+
Vue.use = function (plugin) {
|
5086 |
+
var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
|
5087 |
+
if (installedPlugins.indexOf(plugin) > -1) {
|
5088 |
+
return this
|
5089 |
+
}
|
5090 |
+
|
5091 |
+
// additional parameters
|
5092 |
+
var args = toArray(arguments, 1);
|
5093 |
+
args.unshift(this);
|
5094 |
+
if (typeof plugin.install === 'function') {
|
5095 |
+
plugin.install.apply(plugin, args);
|
5096 |
+
} else if (typeof plugin === 'function') {
|
5097 |
+
plugin.apply(null, args);
|
5098 |
+
}
|
5099 |
+
installedPlugins.push(plugin);
|
5100 |
+
return this
|
5101 |
+
};
|
5102 |
+
}
|
5103 |
+
|
5104 |
+
/* */
|
5105 |
+
|
5106 |
+
function initMixin$1 (Vue) {
|
5107 |
+
Vue.mixin = function (mixin) {
|
5108 |
+
this.options = mergeOptions(this.options, mixin);
|
5109 |
+
return this
|
5110 |
+
};
|
5111 |
+
}
|
5112 |
+
|
5113 |
+
/* */
|
5114 |
+
|
5115 |
+
function initExtend (Vue) {
|
5116 |
+
/**
|
5117 |
+
* Each instance constructor, including Vue, has a unique
|
5118 |
+
* cid. This enables us to create wrapped "child
|
5119 |
+
* constructors" for prototypal inheritance and cache them.
|
5120 |
+
*/
|
5121 |
+
Vue.cid = 0;
|
5122 |
+
var cid = 1;
|
5123 |
+
|
5124 |
+
/**
|
5125 |
+
* Class inheritance
|
5126 |
+
*/
|
5127 |
+
Vue.extend = function (extendOptions) {
|
5128 |
+
extendOptions = extendOptions || {};
|
5129 |
+
var Super = this;
|
5130 |
+
var SuperId = Super.cid;
|
5131 |
+
var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
|
5132 |
+
if (cachedCtors[SuperId]) {
|
5133 |
+
return cachedCtors[SuperId]
|
5134 |
+
}
|
5135 |
+
|
5136 |
+
var name = extendOptions.name || Super.options.name;
|
5137 |
+
if (name) {
|
5138 |
+
validateComponentName(name);
|
5139 |
+
}
|
5140 |
+
|
5141 |
+
var Sub = function VueComponent (options) {
|
5142 |
+
this._init(options);
|
5143 |
+
};
|
5144 |
+
Sub.prototype = Object.create(Super.prototype);
|
5145 |
+
Sub.prototype.constructor = Sub;
|
5146 |
+
Sub.cid = cid++;
|
5147 |
+
Sub.options = mergeOptions(
|
5148 |
+
Super.options,
|
5149 |
+
extendOptions
|
5150 |
+
);
|
5151 |
+
Sub['super'] = Super;
|
5152 |
+
|
5153 |
+
// For props and computed properties, we define the proxy getters on
|
5154 |
+
// the Vue instances at extension time, on the extended prototype. This
|
5155 |
+
// avoids Object.defineProperty calls for each instance created.
|
5156 |
+
if (Sub.options.props) {
|
5157 |
+
initProps$1(Sub);
|
5158 |
+
}
|
5159 |
+
if (Sub.options.computed) {
|
5160 |
+
initComputed$1(Sub);
|
5161 |
+
}
|
5162 |
+
|
5163 |
+
// allow further extension/mixin/plugin usage
|
5164 |
+
Sub.extend = Super.extend;
|
5165 |
+
Sub.mixin = Super.mixin;
|
5166 |
+
Sub.use = Super.use;
|
5167 |
+
|
5168 |
+
// create asset registers, so extended classes
|
5169 |
+
// can have their private assets too.
|
5170 |
+
ASSET_TYPES.forEach(function (type) {
|
5171 |
+
Sub[type] = Super[type];
|
5172 |
+
});
|
5173 |
+
// enable recursive self-lookup
|
5174 |
+
if (name) {
|
5175 |
+
Sub.options.components[name] = Sub;
|
5176 |
+
}
|
5177 |
+
|
5178 |
+
// keep a reference to the super options at extension time.
|
5179 |
+
// later at instantiation we can check if Super's options have
|
5180 |
+
// been updated.
|
5181 |
+
Sub.superOptions = Super.options;
|
5182 |
+
Sub.extendOptions = extendOptions;
|
5183 |
+
Sub.sealedOptions = extend({}, Sub.options);
|
5184 |
+
|
5185 |
+
// cache constructor
|
5186 |
+
cachedCtors[SuperId] = Sub;
|
5187 |
+
return Sub
|
5188 |
+
};
|
5189 |
+
}
|
5190 |
+
|
5191 |
+
function initProps$1 (Comp) {
|
5192 |
+
var props = Comp.options.props;
|
5193 |
+
for (var key in props) {
|
5194 |
+
proxy(Comp.prototype, "_props", key);
|
5195 |
+
}
|
5196 |
+
}
|
5197 |
+
|
5198 |
+
function initComputed$1 (Comp) {
|
5199 |
+
var computed = Comp.options.computed;
|
5200 |
+
for (var key in computed) {
|
5201 |
+
defineComputed(Comp.prototype, key, computed[key]);
|
5202 |
+
}
|
5203 |
+
}
|
5204 |
+
|
5205 |
+
/* */
|
5206 |
+
|
5207 |
+
function initAssetRegisters (Vue) {
|
5208 |
+
/**
|
5209 |
+
* Create asset registration methods.
|
5210 |
+
*/
|
5211 |
+
ASSET_TYPES.forEach(function (type) {
|
5212 |
+
Vue[type] = function (
|
5213 |
+
id,
|
5214 |
+
definition
|
5215 |
+
) {
|
5216 |
+
if (!definition) {
|
5217 |
+
return this.options[type + 's'][id]
|
5218 |
+
} else {
|
5219 |
+
/* istanbul ignore if */
|
5220 |
+
if (type === 'component') {
|
5221 |
+
validateComponentName(id);
|
5222 |
+
}
|
5223 |
+
if (type === 'component' && isPlainObject(definition)) {
|
5224 |
+
definition.name = definition.name || id;
|
5225 |
+
definition = this.options._base.extend(definition);
|
5226 |
+
}
|
5227 |
+
if (type === 'directive' && typeof definition === 'function') {
|
5228 |
+
definition = { bind: definition, update: definition };
|
5229 |
+
}
|
5230 |
+
this.options[type + 's'][id] = definition;
|
5231 |
+
return definition
|
5232 |
+
}
|
5233 |
+
};
|
5234 |
+
});
|
5235 |
+
}
|
5236 |
+
|
5237 |
+
/* */
|
5238 |
+
|
5239 |
+
|
5240 |
+
|
5241 |
+
function getComponentName (opts) {
|
5242 |
+
return opts && (opts.Ctor.options.name || opts.tag)
|
5243 |
+
}
|
5244 |
+
|
5245 |
+
function matches (pattern, name) {
|
5246 |
+
if (Array.isArray(pattern)) {
|
5247 |
+
return pattern.indexOf(name) > -1
|
5248 |
+
} else if (typeof pattern === 'string') {
|
5249 |
+
return pattern.split(',').indexOf(name) > -1
|
5250 |
+
} else if (isRegExp(pattern)) {
|
5251 |
+
return pattern.test(name)
|
5252 |
+
}
|
5253 |
+
/* istanbul ignore next */
|
5254 |
+
return false
|
5255 |
+
}
|
5256 |
+
|
5257 |
+
function pruneCache (keepAliveInstance, filter) {
|
5258 |
+
var cache = keepAliveInstance.cache;
|
5259 |
+
var keys = keepAliveInstance.keys;
|
5260 |
+
var _vnode = keepAliveInstance._vnode;
|
5261 |
+
for (var key in cache) {
|
5262 |
+
var cachedNode = cache[key];
|
5263 |
+
if (cachedNode) {
|
5264 |
+
var name = getComponentName(cachedNode.componentOptions);
|
5265 |
+
if (name && !filter(name)) {
|
5266 |
+
pruneCacheEntry(cache, key, keys, _vnode);
|
5267 |
+
}
|
5268 |
+
}
|
5269 |
+
}
|
5270 |
+
}
|
5271 |
+
|
5272 |
+
function pruneCacheEntry (
|
5273 |
+
cache,
|
5274 |
+
key,
|
5275 |
+
keys,
|
5276 |
+
current
|
5277 |
+
) {
|
5278 |
+
var cached$$1 = cache[key];
|
5279 |
+
if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
|
5280 |
+
cached$$1.componentInstance.$destroy();
|
5281 |
+
}
|
5282 |
+
cache[key] = null;
|
5283 |
+
remove(keys, key);
|
5284 |
+
}
|
5285 |
+
|
5286 |
+
var patternTypes = [String, RegExp, Array];
|
5287 |
+
|
5288 |
+
var KeepAlive = {
|
5289 |
+
name: 'keep-alive',
|
5290 |
+
abstract: true,
|
5291 |
+
|
5292 |
+
props: {
|
5293 |
+
include: patternTypes,
|
5294 |
+
exclude: patternTypes,
|
5295 |
+
max: [String, Number]
|
5296 |
+
},
|
5297 |
+
|
5298 |
+
created: function created () {
|
5299 |
+
this.cache = Object.create(null);
|
5300 |
+
this.keys = [];
|
5301 |
+
},
|
5302 |
+
|
5303 |
+
destroyed: function destroyed () {
|
5304 |
+
for (var key in this.cache) {
|
5305 |
+
pruneCacheEntry(this.cache, key, this.keys);
|
5306 |
+
}
|
5307 |
+
},
|
5308 |
+
|
5309 |
+
mounted: function mounted () {
|
5310 |
+
var this$1 = this;
|
5311 |
+
|
5312 |
+
this.$watch('include', function (val) {
|
5313 |
+
pruneCache(this$1, function (name) { return matches(val, name); });
|
5314 |
+
});
|
5315 |
+
this.$watch('exclude', function (val) {
|
5316 |
+
pruneCache(this$1, function (name) { return !matches(val, name); });
|
5317 |
+
});
|
5318 |
+
},
|
5319 |
+
|
5320 |
+
render: function render () {
|
5321 |
+
var slot = this.$slots.default;
|
5322 |
+
var vnode = getFirstComponentChild(slot);
|
5323 |
+
var componentOptions = vnode && vnode.componentOptions;
|
5324 |
+
if (componentOptions) {
|
5325 |
+
// check pattern
|
5326 |
+
var name = getComponentName(componentOptions);
|
5327 |
+
var ref = this;
|
5328 |
+
var include = ref.include;
|
5329 |
+
var exclude = ref.exclude;
|
5330 |
+
if (
|
5331 |
+
// not included
|
5332 |
+
(include && (!name || !matches(include, name))) ||
|
5333 |
+
// excluded
|
5334 |
+
(exclude && name && matches(exclude, name))
|
5335 |
+
) {
|
5336 |
+
return vnode
|
5337 |
+
}
|
5338 |
+
|
5339 |
+
var ref$1 = this;
|
5340 |
+
var cache = ref$1.cache;
|
5341 |
+
var keys = ref$1.keys;
|
5342 |
+
var key = vnode.key == null
|
5343 |
+
// same constructor may get registered as different local components
|
5344 |
+
// so cid alone is not enough (#3269)
|
5345 |
+
? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
|
5346 |
+
: vnode.key;
|
5347 |
+
if (cache[key]) {
|
5348 |
+
vnode.componentInstance = cache[key].componentInstance;
|
5349 |
+
// make current key freshest
|
5350 |
+
remove(keys, key);
|
5351 |
+
keys.push(key);
|
5352 |
+
} else {
|
5353 |
+
cache[key] = vnode;
|
5354 |
+
keys.push(key);
|
5355 |
+
// prune oldest entry
|
5356 |
+
if (this.max && keys.length > parseInt(this.max)) {
|
5357 |
+
pruneCacheEntry(cache, keys[0], keys, this._vnode);
|
5358 |
+
}
|
5359 |
+
}
|
5360 |
+
|
5361 |
+
vnode.data.keepAlive = true;
|
5362 |
+
}
|
5363 |
+
return vnode || (slot && slot[0])
|
5364 |
+
}
|
5365 |
+
};
|
5366 |
+
|
5367 |
+
var builtInComponents = {
|
5368 |
+
KeepAlive: KeepAlive
|
5369 |
+
};
|
5370 |
+
|
5371 |
+
/* */
|
5372 |
+
|
5373 |
+
function initGlobalAPI (Vue) {
|
5374 |
+
// config
|
5375 |
+
var configDef = {};
|
5376 |
+
configDef.get = function () { return config; };
|
5377 |
+
{
|
5378 |
+
configDef.set = function () {
|
5379 |
+
warn(
|
5380 |
+
'Do not replace the Vue.config object, set individual fields instead.'
|
5381 |
+
);
|
5382 |
+
};
|
5383 |
+
}
|
5384 |
+
Object.defineProperty(Vue, 'config', configDef);
|
5385 |
+
|
5386 |
+
// exposed util methods.
|
5387 |
+
// NOTE: these are not considered part of the public API - avoid relying on
|
5388 |
+
// them unless you are aware of the risk.
|
5389 |
+
Vue.util = {
|
5390 |
+
warn: warn,
|
5391 |
+
extend: extend,
|
5392 |
+
mergeOptions: mergeOptions,
|
5393 |
+
defineReactive: defineReactive$$1
|
5394 |
+
};
|
5395 |
+
|
5396 |
+
Vue.set = set;
|
5397 |
+
Vue.delete = del;
|
5398 |
+
Vue.nextTick = nextTick;
|
5399 |
+
|
5400 |
+
// 2.6 explicit observable API
|
5401 |
+
Vue.observable = function (obj) {
|
5402 |
+
observe(obj);
|
5403 |
+
return obj
|
5404 |
+
};
|
5405 |
+
|
5406 |
+
Vue.options = Object.create(null);
|
5407 |
+
ASSET_TYPES.forEach(function (type) {
|
5408 |
+
Vue.options[type + 's'] = Object.create(null);
|
5409 |
+
});
|
5410 |
+
|
5411 |
+
// this is used to identify the "base" constructor to extend all plain-object
|
5412 |
+
// components with in Weex's multi-instance scenarios.
|
5413 |
+
Vue.options._base = Vue;
|
5414 |
+
|
5415 |
+
extend(Vue.options.components, builtInComponents);
|
5416 |
+
|
5417 |
+
initUse(Vue);
|
5418 |
+
initMixin$1(Vue);
|
5419 |
+
initExtend(Vue);
|
5420 |
+
initAssetRegisters(Vue);
|
5421 |
+
}
|
5422 |
+
|
5423 |
+
initGlobalAPI(Vue);
|
5424 |
+
|
5425 |
+
Object.defineProperty(Vue.prototype, '$isServer', {
|
5426 |
+
get: isServerRendering
|
5427 |
+
});
|
5428 |
+
|
5429 |
+
Object.defineProperty(Vue.prototype, '$ssrContext', {
|
5430 |
+
get: function get () {
|
5431 |
+
/* istanbul ignore next */
|
5432 |
+
return this.$vnode && this.$vnode.ssrContext
|
5433 |
+
}
|
5434 |
+
});
|
5435 |
+
|
5436 |
+
// expose FunctionalRenderContext for ssr runtime helper installation
|
5437 |
+
Object.defineProperty(Vue, 'FunctionalRenderContext', {
|
5438 |
+
value: FunctionalRenderContext
|
5439 |
+
});
|
5440 |
+
|
5441 |
+
Vue.version = '2.6.10';
|
5442 |
+
|
5443 |
+
/* */
|
5444 |
+
|
5445 |
+
// these are reserved for web because they are directly compiled away
|
5446 |
+
// during template compilation
|
5447 |
+
var isReservedAttr = makeMap('style,class');
|
5448 |
+
|
5449 |
+
// attributes that should be using props for binding
|
5450 |
+
var acceptValue = makeMap('input,textarea,option,select,progress');
|
5451 |
+
var mustUseProp = function (tag, type, attr) {
|
5452 |
+
return (
|
5453 |
+
(attr === 'value' && acceptValue(tag)) && type !== 'button' ||
|
5454 |
+
(attr === 'selected' && tag === 'option') ||
|
5455 |
+
(attr === 'checked' && tag === 'input') ||
|
5456 |
+
(attr === 'muted' && tag === 'video')
|
5457 |
+
)
|
5458 |
+
};
|
5459 |
+
|
5460 |
+
var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
|
5461 |
+
|
5462 |
+
var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
|
5463 |
+
|
5464 |
+
var convertEnumeratedValue = function (key, value) {
|
5465 |
+
return isFalsyAttrValue(value) || value === 'false'
|
5466 |
+
? 'false'
|
5467 |
+
// allow arbitrary string value for contenteditable
|
5468 |
+
: key === 'contenteditable' && isValidContentEditableValue(value)
|
5469 |
+
? value
|
5470 |
+
: 'true'
|
5471 |
+
};
|
5472 |
+
|
5473 |
+
var isBooleanAttr = makeMap(
|
5474 |
+
'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
|
5475 |
+
'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
|
5476 |
+
'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
|
5477 |
+
'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
|
5478 |
+
'required,reversed,scoped,seamless,selected,sortable,translate,' +
|
5479 |
+
'truespeed,typemustmatch,visible'
|
5480 |
+
);
|
5481 |
+
|
5482 |
+
var xlinkNS = 'http://www.w3.org/1999/xlink';
|
5483 |
+
|
5484 |
+
var isXlink = function (name) {
|
5485 |
+
return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
|
5486 |
+
};
|
5487 |
+
|
5488 |
+
var getXlinkProp = function (name) {
|
5489 |
+
return isXlink(name) ? name.slice(6, name.length) : ''
|
5490 |
+
};
|
5491 |
+
|
5492 |
+
var isFalsyAttrValue = function (val) {
|
5493 |
+
return val == null || val === false
|
5494 |
+
};
|
5495 |
+
|
5496 |
+
/* */
|
5497 |
+
|
5498 |
+
function genClassForVnode (vnode) {
|
5499 |
+
var data = vnode.data;
|
5500 |
+
var parentNode = vnode;
|
5501 |
+
var childNode = vnode;
|
5502 |
+
while (isDef(childNode.componentInstance)) {
|
5503 |
+
childNode = childNode.componentInstance._vnode;
|
5504 |
+
if (childNode && childNode.data) {
|
5505 |
+
data = mergeClassData(childNode.data, data);
|
5506 |
+
}
|
5507 |
+
}
|
5508 |
+
while (isDef(parentNode = parentNode.parent)) {
|
5509 |
+
if (parentNode && parentNode.data) {
|
5510 |
+
data = mergeClassData(data, parentNode.data);
|
5511 |
+
}
|
5512 |
+
}
|
5513 |
+
return renderClass(data.staticClass, data.class)
|
5514 |
+
}
|
5515 |
+
|
5516 |
+
function mergeClassData (child, parent) {
|
5517 |
+
return {
|
5518 |
+
staticClass: concat(child.staticClass, parent.staticClass),
|
5519 |
+
class: isDef(child.class)
|
5520 |
+
? [child.class, parent.class]
|
5521 |
+
: parent.class
|
5522 |
+
}
|
5523 |
+
}
|
5524 |
+
|
5525 |
+
function renderClass (
|
5526 |
+
staticClass,
|
5527 |
+
dynamicClass
|
5528 |
+
) {
|
5529 |
+
if (isDef(staticClass) || isDef(dynamicClass)) {
|
5530 |
+
return concat(staticClass, stringifyClass(dynamicClass))
|
5531 |
+
}
|
5532 |
+
/* istanbul ignore next */
|
5533 |
+
return ''
|
5534 |
+
}
|
5535 |
+
|
5536 |
+
function concat (a, b) {
|
5537 |
+
return a ? b ? (a + ' ' + b) : a : (b || '')
|
5538 |
+
}
|
5539 |
+
|
5540 |
+
function stringifyClass (value) {
|
5541 |
+
if (Array.isArray(value)) {
|
5542 |
+
return stringifyArray(value)
|
5543 |
+
}
|
5544 |
+
if (isObject(value)) {
|
5545 |
+
return stringifyObject(value)
|
5546 |
+
}
|
5547 |
+
if (typeof value === 'string') {
|
5548 |
+
return value
|
5549 |
+
}
|
5550 |
+
/* istanbul ignore next */
|
5551 |
+
return ''
|
5552 |
+
}
|
5553 |
+
|
5554 |
+
function stringifyArray (value) {
|
5555 |
+
var res = '';
|
5556 |
+
var stringified;
|
5557 |
+
for (var i = 0, l = value.length; i < l; i++) {
|
5558 |
+
if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
|
5559 |
+
if (res) { res += ' '; }
|
5560 |
+
res += stringified;
|
5561 |
+
}
|
5562 |
+
}
|
5563 |
+
return res
|
5564 |
+
}
|
5565 |
+
|
5566 |
+
function stringifyObject (value) {
|
5567 |
+
var res = '';
|
5568 |
+
for (var key in value) {
|
5569 |
+
if (value[key]) {
|
5570 |
+
if (res) { res += ' '; }
|
5571 |
+
res += key;
|
5572 |
+
}
|
5573 |
+
}
|
5574 |
+
return res
|
5575 |
+
}
|
5576 |
+
|
5577 |
+
/* */
|
5578 |
+
|
5579 |
+
var namespaceMap = {
|
5580 |
+
svg: 'http://www.w3.org/2000/svg',
|
5581 |
+
math: 'http://www.w3.org/1998/Math/MathML'
|
5582 |
+
};
|
5583 |
+
|
5584 |
+
var isHTMLTag = makeMap(
|
5585 |
+
'html,body,base,head,link,meta,style,title,' +
|
5586 |
+
'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
|
5587 |
+
'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
|
5588 |
+
'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
|
5589 |
+
's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
|
5590 |
+
'embed,object,param,source,canvas,script,noscript,del,ins,' +
|
5591 |
+
'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
|
5592 |
+
'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
|
5593 |
+
'output,progress,select,textarea,' +
|
5594 |
+
'details,dialog,menu,menuitem,summary,' +
|
5595 |
+
'content,element,shadow,template,blockquote,iframe,tfoot'
|
5596 |
+
);
|
5597 |
+
|
5598 |
+
// this map is intentionally selective, only covering SVG elements that may
|
5599 |
+
// contain child elements.
|
5600 |
+
var isSVG = makeMap(
|
5601 |
+
'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
|
5602 |
+
'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
|
5603 |
+
'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
|
5604 |
+
true
|
5605 |
+
);
|
5606 |
+
|
5607 |
+
var isPreTag = function (tag) { return tag === 'pre'; };
|
5608 |
+
|
5609 |
+
var isReservedTag = function (tag) {
|
5610 |
+
return isHTMLTag(tag) || isSVG(tag)
|
5611 |
+
};
|
5612 |
+
|
5613 |
+
function getTagNamespace (tag) {
|
5614 |
+
if (isSVG(tag)) {
|
5615 |
+
return 'svg'
|
5616 |
+
}
|
5617 |
+
// basic support for MathML
|
5618 |
+
// note it doesn't support other MathML elements being component roots
|
5619 |
+
if (tag === 'math') {
|
5620 |
+
return 'math'
|
5621 |
+
}
|
5622 |
+
}
|
5623 |
+
|
5624 |
+
var unknownElementCache = Object.create(null);
|
5625 |
+
function isUnknownElement (tag) {
|
5626 |
+
/* istanbul ignore if */
|
5627 |
+
if (!inBrowser) {
|
5628 |
+
return true
|
5629 |
+
}
|
5630 |
+
if (isReservedTag(tag)) {
|
5631 |
+
return false
|
5632 |
+
}
|
5633 |
+
tag = tag.toLowerCase();
|
5634 |
+
/* istanbul ignore if */
|
5635 |
+
if (unknownElementCache[tag] != null) {
|
5636 |
+
return unknownElementCache[tag]
|
5637 |
+
}
|
5638 |
+
var el = document.createElement(tag);
|
5639 |
+
if (tag.indexOf('-') > -1) {
|
5640 |
+
// http://stackoverflow.com/a/28210364/1070244
|
5641 |
+
return (unknownElementCache[tag] = (
|
5642 |
+
el.constructor === window.HTMLUnknownElement ||
|
5643 |
+
el.constructor === window.HTMLElement
|
5644 |
+
))
|
5645 |
+
} else {
|
5646 |
+
return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
|
5647 |
+
}
|
5648 |
+
}
|
5649 |
+
|
5650 |
+
var isTextInputType = makeMap('text,number,password,search,email,tel,url');
|
5651 |
+
|
5652 |
+
/* */
|
5653 |
+
|
5654 |
+
/**
|
5655 |
+
* Query an element selector if it's not an element already.
|
5656 |
+
*/
|
5657 |
+
function query (el) {
|
5658 |
+
if (typeof el === 'string') {
|
5659 |
+
var selected = document.querySelector(el);
|
5660 |
+
if (!selected) {
|
5661 |
+
warn(
|
5662 |
+
'Cannot find element: ' + el
|
5663 |
+
);
|
5664 |
+
return document.createElement('div')
|
5665 |
+
}
|
5666 |
+
return selected
|
5667 |
+
} else {
|
5668 |
+
return el
|
5669 |
+
}
|
5670 |
+
}
|
5671 |
+
|
5672 |
+
/* */
|
5673 |
+
|
5674 |
+
function createElement$1 (tagName, vnode) {
|
5675 |
+
var elm = document.createElement(tagName);
|
5676 |
+
if (tagName !== 'select') {
|
5677 |
+
return elm
|
5678 |
+
}
|
5679 |
+
// false or null will remove the attribute but undefined will not
|
5680 |
+
if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
|
5681 |
+
elm.setAttribute('multiple', 'multiple');
|
5682 |
+
}
|
5683 |
+
return elm
|
5684 |
+
}
|
5685 |
+
|
5686 |
+
function createElementNS (namespace, tagName) {
|
5687 |
+
return document.createElementNS(namespaceMap[namespace], tagName)
|
5688 |
+
}
|
5689 |
+
|
5690 |
+
function createTextNode (text) {
|
5691 |
+
return document.createTextNode(text)
|
5692 |
+
}
|
5693 |
+
|
5694 |
+
function createComment (text) {
|
5695 |
+
return document.createComment(text)
|
5696 |
+
}
|
5697 |
+
|
5698 |
+
function insertBefore (parentNode, newNode, referenceNode) {
|
5699 |
+
parentNode.insertBefore(newNode, referenceNode);
|
5700 |
+
}
|
5701 |
+
|
5702 |
+
function removeChild (node, child) {
|
5703 |
+
node.removeChild(child);
|
5704 |
+
}
|
5705 |
+
|
5706 |
+
function appendChild (node, child) {
|
5707 |
+
node.appendChild(child);
|
5708 |
+
}
|
5709 |
+
|
5710 |
+
function parentNode (node) {
|
5711 |
+
return node.parentNode
|
5712 |
+
}
|
5713 |
+
|
5714 |
+
function nextSibling (node) {
|
5715 |
+
return node.nextSibling
|
5716 |
+
}
|
5717 |
+
|
5718 |
+
function tagName (node) {
|
5719 |
+
return node.tagName
|
5720 |
+
}
|
5721 |
+
|
5722 |
+
function setTextContent (node, text) {
|
5723 |
+
node.textContent = text;
|
5724 |
+
}
|
5725 |
+
|
5726 |
+
function setStyleScope (node, scopeId) {
|
5727 |
+
node.setAttribute(scopeId, '');
|
5728 |
+
}
|
5729 |
+
|
5730 |
+
var nodeOps = /*#__PURE__*/Object.freeze({
|
5731 |
+
createElement: createElement$1,
|
5732 |
+
createElementNS: createElementNS,
|
5733 |
+
createTextNode: createTextNode,
|
5734 |
+
createComment: createComment,
|
5735 |
+
insertBefore: insertBefore,
|
5736 |
+
removeChild: removeChild,
|
5737 |
+
appendChild: appendChild,
|
5738 |
+
parentNode: parentNode,
|
5739 |
+
nextSibling: nextSibling,
|
5740 |
+
tagName: tagName,
|
5741 |
+
setTextContent: setTextContent,
|
5742 |
+
setStyleScope: setStyleScope
|
5743 |
+
});
|
5744 |
+
|
5745 |
+
/* */
|
5746 |
+
|
5747 |
+
var ref = {
|
5748 |
+
create: function create (_, vnode) {
|
5749 |
+
registerRef(vnode);
|
5750 |
+
},
|
5751 |
+
update: function update (oldVnode, vnode) {
|
5752 |
+
if (oldVnode.data.ref !== vnode.data.ref) {
|
5753 |
+
registerRef(oldVnode, true);
|
5754 |
+
registerRef(vnode);
|
5755 |
+
}
|
5756 |
+
},
|
5757 |
+
destroy: function destroy (vnode) {
|
5758 |
+
registerRef(vnode, true);
|
5759 |
+
}
|
5760 |
+
};
|
5761 |
+
|
5762 |
+
function registerRef (vnode, isRemoval) {
|
5763 |
+
var key = vnode.data.ref;
|
5764 |
+
if (!isDef(key)) { return }
|
5765 |
+
|
5766 |
+
var vm = vnode.context;
|
5767 |
+
var ref = vnode.componentInstance || vnode.elm;
|
5768 |
+
var refs = vm.$refs;
|
5769 |
+
if (isRemoval) {
|
5770 |
+
if (Array.isArray(refs[key])) {
|
5771 |
+
remove(refs[key], ref);
|
5772 |
+
} else if (refs[key] === ref) {
|
5773 |
+
refs[key] = undefined;
|
5774 |
+
}
|
5775 |
+
} else {
|
5776 |
+
if (vnode.data.refInFor) {
|
5777 |
+
if (!Array.isArray(refs[key])) {
|
5778 |
+
refs[key] = [ref];
|
5779 |
+
} else if (refs[key].indexOf(ref) < 0) {
|
5780 |
+
// $flow-disable-line
|
5781 |
+
refs[key].push(ref);
|
5782 |
+
}
|
5783 |
+
} else {
|
5784 |
+
refs[key] = ref;
|
5785 |
+
}
|
5786 |
+
}
|
5787 |
+
}
|
5788 |
+
|
5789 |
+
/**
|
5790 |
+
* Virtual DOM patching algorithm based on Snabbdom by
|
5791 |
+
* Simon Friis Vindum (@paldepind)
|
5792 |
+
* Licensed under the MIT License
|
5793 |
+
* https://github.com/paldepind/snabbdom/blob/master/LICENSE
|
5794 |
+
*
|
5795 |
+
* modified by Evan You (@yyx990803)
|
5796 |
+
*
|
5797 |
+
* Not type-checking this because this file is perf-critical and the cost
|
5798 |
+
* of making flow understand it is not worth it.
|
5799 |
+
*/
|
5800 |
+
|
5801 |
+
var emptyNode = new VNode('', {}, []);
|
5802 |
+
|
5803 |
+
var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
|
5804 |
+
|
5805 |
+
function sameVnode (a, b) {
|
5806 |
+
return (
|
5807 |
+
a.key === b.key && (
|
5808 |
+
(
|
5809 |
+
a.tag === b.tag &&
|
5810 |
+
a.isComment === b.isComment &&
|
5811 |
+
isDef(a.data) === isDef(b.data) &&
|
5812 |
+
sameInputType(a, b)
|
5813 |
+
) || (
|
5814 |
+
isTrue(a.isAsyncPlaceholder) &&
|
5815 |
+
a.asyncFactory === b.asyncFactory &&
|
5816 |
+
isUndef(b.asyncFactory.error)
|
5817 |
+
)
|
5818 |
+
)
|
5819 |
+
)
|
5820 |
+
}
|
5821 |
+
|
5822 |
+
function sameInputType (a, b) {
|
5823 |
+
if (a.tag !== 'input') { return true }
|
5824 |
+
var i;
|
5825 |
+
var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
|
5826 |
+
var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
|
5827 |
+
return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)
|
5828 |
+
}
|
5829 |
+
|
5830 |
+
function createKeyToOldIdx (children, beginIdx, endIdx) {
|
5831 |
+
var i, key;
|
5832 |
+
var map = {};
|
5833 |
+
for (i = beginIdx; i <= endIdx; ++i) {
|
5834 |
+
key = children[i].key;
|
5835 |
+
if (isDef(key)) { map[key] = i; }
|
5836 |
+
}
|
5837 |
+
return map
|
5838 |
+
}
|
5839 |
+
|
5840 |
+
function createPatchFunction (backend) {
|
5841 |
+
var i, j;
|
5842 |
+
var cbs = {};
|
5843 |
+
|
5844 |
+
var modules = backend.modules;
|
5845 |
+
var nodeOps = backend.nodeOps;
|
5846 |
+
|
5847 |
+
for (i = 0; i < hooks.length; ++i) {
|
5848 |
+
cbs[hooks[i]] = [];
|
5849 |
+
for (j = 0; j < modules.length; ++j) {
|
5850 |
+
if (isDef(modules[j][hooks[i]])) {
|
5851 |
+
cbs[hooks[i]].push(modules[j][hooks[i]]);
|
5852 |
+
}
|
5853 |
+
}
|
5854 |
+
}
|
5855 |
+
|
5856 |
+
function emptyNodeAt (elm) {
|
5857 |
+
return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
|
5858 |
+
}
|
5859 |
+
|
5860 |
+
function createRmCb (childElm, listeners) {
|
5861 |
+
function remove$$1 () {
|
5862 |
+
if (--remove$$1.listeners === 0) {
|
5863 |
+
removeNode(childElm);
|
5864 |
+
}
|
5865 |
+
}
|
5866 |
+
remove$$1.listeners = listeners;
|
5867 |
+
return remove$$1
|
5868 |
+
}
|
5869 |
+
|
5870 |
+
function removeNode (el) {
|
5871 |
+
var parent = nodeOps.parentNode(el);
|
5872 |
+
// element may have already been removed due to v-html / v-text
|
5873 |
+
if (isDef(parent)) {
|
5874 |
+
nodeOps.removeChild(parent, el);
|
5875 |
+
}
|
5876 |
+
}
|
5877 |
+
|
5878 |
+
function isUnknownElement$$1 (vnode, inVPre) {
|
5879 |
+
return (
|
5880 |
+
!inVPre &&
|
5881 |
+
!vnode.ns &&
|
5882 |
+
!(
|
5883 |
+
config.ignoredElements.length &&
|
5884 |
+
config.ignoredElements.some(function (ignore) {
|
5885 |
+
return isRegExp(ignore)
|
5886 |
+
? ignore.test(vnode.tag)
|
5887 |
+
: ignore === vnode.tag
|
5888 |
+
})
|
5889 |
+
) &&
|
5890 |
+
config.isUnknownElement(vnode.tag)
|
5891 |
+
)
|
5892 |
+
}
|
5893 |
+
|
5894 |
+
var creatingElmInVPre = 0;
|
5895 |
+
|
5896 |
+
function createElm (
|
5897 |
+
vnode,
|
5898 |
+
insertedVnodeQueue,
|
5899 |
+
parentElm,
|
5900 |
+
refElm,
|
5901 |
+
nested,
|
5902 |
+
ownerArray,
|
5903 |
+
index
|
5904 |
+
) {
|
5905 |
+
if (isDef(vnode.elm) && isDef(ownerArray)) {
|
5906 |
+
// This vnode was used in a previous render!
|
5907 |
+
// now it's used as a new node, overwriting its elm would cause
|
5908 |
+
// potential patch errors down the road when it's used as an insertion
|
5909 |
+
// reference node. Instead, we clone the node on-demand before creating
|
5910 |
+
// associated DOM element for it.
|
5911 |
+
vnode = ownerArray[index] = cloneVNode(vnode);
|
5912 |
+
}
|
5913 |
+
|
5914 |
+
vnode.isRootInsert = !nested; // for transition enter check
|
5915 |
+
if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
|
5916 |
+
return
|
5917 |
+
}
|
5918 |
+
|
5919 |
+
var data = vnode.data;
|
5920 |
+
var children = vnode.children;
|
5921 |
+
var tag = vnode.tag;
|
5922 |
+
if (isDef(tag)) {
|
5923 |
+
{
|
5924 |
+
if (data && data.pre) {
|
5925 |
+
creatingElmInVPre++;
|
5926 |
+
}
|
5927 |
+
if (isUnknownElement$$1(vnode, creatingElmInVPre)) {
|
5928 |
+
warn(
|
5929 |
+
'Unknown custom element: <' + tag + '> - did you ' +
|
5930 |
+
'register the component correctly? For recursive components, ' +
|
5931 |
+
'make sure to provide the "name" option.',
|
5932 |
+
vnode.context
|
5933 |
+
);
|
5934 |
+
}
|
5935 |
+
}
|
5936 |
+
|
5937 |
+
vnode.elm = vnode.ns
|
5938 |
+
? nodeOps.createElementNS(vnode.ns, tag)
|
5939 |
+
: nodeOps.createElement(tag, vnode);
|
5940 |
+
setScope(vnode);
|
5941 |
+
|
5942 |
+
/* istanbul ignore if */
|
5943 |
+
{
|
5944 |
+
createChildren(vnode, children, insertedVnodeQueue);
|
5945 |
+
if (isDef(data)) {
|
5946 |
+
invokeCreateHooks(vnode, insertedVnodeQueue);
|
5947 |
+
}
|
5948 |
+
insert(parentElm, vnode.elm, refElm);
|
5949 |
+
}
|
5950 |
+
|
5951 |
+
if (data && data.pre) {
|
5952 |
+
creatingElmInVPre--;
|
5953 |
+
}
|
5954 |
+
} else if (isTrue(vnode.isComment)) {
|
5955 |
+
vnode.elm = nodeOps.createComment(vnode.text);
|
5956 |
+
insert(parentElm, vnode.elm, refElm);
|
5957 |
+
} else {
|
5958 |
+
vnode.elm = nodeOps.createTextNode(vnode.text);
|
5959 |
+
insert(parentElm, vnode.elm, refElm);
|
5960 |
+
}
|
5961 |
+
}
|
5962 |
+
|
5963 |
+
function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
|
5964 |
+
var i = vnode.data;
|
5965 |
+
if (isDef(i)) {
|
5966 |
+
var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
|
5967 |
+
if (isDef(i = i.hook) && isDef(i = i.init)) {
|
5968 |
+
i(vnode, false /* hydrating */);
|
5969 |
+
}
|
5970 |
+
// after calling the init hook, if the vnode is a child component
|
5971 |
+
// it should've created a child instance and mounted it. the child
|
5972 |
+
// component also has set the placeholder vnode's elm.
|
5973 |
+
// in that case we can just return the element and be done.
|
5974 |
+
if (isDef(vnode.componentInstance)) {
|
5975 |
+
initComponent(vnode, insertedVnodeQueue);
|
5976 |
+
insert(parentElm, vnode.elm, refElm);
|
5977 |
+
if (isTrue(isReactivated)) {
|
5978 |
+
reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
|
5979 |
+
}
|
5980 |
+
return true
|
5981 |
+
}
|
5982 |
+
}
|
5983 |
+
}
|
5984 |
+
|
5985 |
+
function initComponent (vnode, insertedVnodeQueue) {
|
5986 |
+
if (isDef(vnode.data.pendingInsert)) {
|
5987 |
+
insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
|
5988 |
+
vnode.data.pendingInsert = null;
|
5989 |
+
}
|
5990 |
+
vnode.elm = vnode.componentInstance.$el;
|
5991 |
+
if (isPatchable(vnode)) {
|
5992 |
+
invokeCreateHooks(vnode, insertedVnodeQueue);
|
5993 |
+
setScope(vnode);
|
5994 |
+
} else {
|
5995 |
+
// empty component root.
|
5996 |
+
// skip all element-related modules except for ref (#3455)
|
5997 |
+
registerRef(vnode);
|
5998 |
+
// make sure to invoke the insert hook
|
5999 |
+
insertedVnodeQueue.push(vnode);
|
6000 |
+
}
|
6001 |
+
}
|
6002 |
+
|
6003 |
+
function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
|
6004 |
+
var i;
|
6005 |
+
// hack for #4339: a reactivated component with inner transition
|
6006 |
+
// does not trigger because the inner node's created hooks are not called
|
6007 |
+
// again. It's not ideal to involve module-specific logic in here but
|
6008 |
+
// there doesn't seem to be a better way to do it.
|
6009 |
+
var innerNode = vnode;
|
6010 |
+
while (innerNode.componentInstance) {
|
6011 |
+
innerNode = innerNode.componentInstance._vnode;
|
6012 |
+
if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
|
6013 |
+
for (i = 0; i < cbs.activate.length; ++i) {
|
6014 |
+
cbs.activate[i](emptyNode, innerNode);
|
6015 |
+
}
|
6016 |
+
insertedVnodeQueue.push(innerNode);
|
6017 |
+
break
|
6018 |
+
}
|
6019 |
+
}
|
6020 |
+
// unlike a newly created component,
|
6021 |
+
// a reactivated keep-alive component doesn't insert itself
|
6022 |
+
insert(parentElm, vnode.elm, refElm);
|
6023 |
+
}
|
6024 |
+
|
6025 |
+
function insert (parent, elm, ref$$1) {
|
6026 |
+
if (isDef(parent)) {
|
6027 |
+
if (isDef(ref$$1)) {
|
6028 |
+
if (nodeOps.parentNode(ref$$1) === parent) {
|
6029 |
+
nodeOps.insertBefore(parent, elm, ref$$1);
|
6030 |
+
}
|
6031 |
+
} else {
|
6032 |
+
nodeOps.appendChild(parent, elm);
|
6033 |
+
}
|
6034 |
+
}
|
6035 |
+
}
|
6036 |
+
|
6037 |
+
function createChildren (vnode, children, insertedVnodeQueue) {
|
6038 |
+
if (Array.isArray(children)) {
|
6039 |
+
{
|
6040 |
+
checkDuplicateKeys(children);
|
6041 |
+
}
|
6042 |
+
for (var i = 0; i < children.length; ++i) {
|
6043 |
+
createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);
|
6044 |
+
}
|
6045 |
+
} else if (isPrimitive(vnode.text)) {
|
6046 |
+
nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
|
6047 |
+
}
|
6048 |
+
}
|
6049 |
+
|
6050 |
+
function isPatchable (vnode) {
|
6051 |
+
while (vnode.componentInstance) {
|
6052 |
+
vnode = vnode.componentInstance._vnode;
|
6053 |
+
}
|
6054 |
+
return isDef(vnode.tag)
|
6055 |
+
}
|
6056 |
+
|
6057 |
+
function invokeCreateHooks (vnode, insertedVnodeQueue) {
|
6058 |
+
for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
|
6059 |
+
cbs.create[i$1](emptyNode, vnode);
|
6060 |
+
}
|
6061 |
+
i = vnode.data.hook; // Reuse variable
|
6062 |
+
if (isDef(i)) {
|
6063 |
+
if (isDef(i.create)) { i.create(emptyNode, vnode); }
|
6064 |
+
if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
|
6065 |
+
}
|
6066 |
+
}
|
6067 |
+
|
6068 |
+
// set scope id attribute for scoped CSS.
|
6069 |
+
// this is implemented as a special case to avoid the overhead
|
6070 |
+
// of going through the normal attribute patching process.
|
6071 |
+
function setScope (vnode) {
|
6072 |
+
var i;
|
6073 |
+
if (isDef(i = vnode.fnScopeId)) {
|
6074 |
+
nodeOps.setStyleScope(vnode.elm, i);
|
6075 |
+
} else {
|
6076 |
+
var ancestor = vnode;
|
6077 |
+
while (ancestor) {
|
6078 |
+
if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
|
6079 |
+
nodeOps.setStyleScope(vnode.elm, i);
|
6080 |
+
}
|
6081 |
+
ancestor = ancestor.parent;
|
6082 |
+
}
|
6083 |
+
}
|
6084 |
+
// for slot content they should also get the scopeId from the host instance.
|
6085 |
+
if (isDef(i = activeInstance) &&
|
6086 |
+
i !== vnode.context &&
|
6087 |
+
i !== vnode.fnContext &&
|
6088 |
+
isDef(i = i.$options._scopeId)
|
6089 |
+
) {
|
6090 |
+
nodeOps.setStyleScope(vnode.elm, i);
|
6091 |
+
}
|
6092 |
+
}
|
6093 |
+
|
6094 |
+
function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
|
6095 |
+
for (; startIdx <= endIdx; ++startIdx) {
|
6096 |
+
createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
|
6097 |
+
}
|
6098 |
+
}
|
6099 |
+
|
6100 |
+
function invokeDestroyHook (vnode) {
|
6101 |
+
var i, j;
|
6102 |
+
var data = vnode.data;
|
6103 |
+
if (isDef(data)) {
|
6104 |
+
if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
|
6105 |
+
for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
|
6106 |
+
}
|
6107 |
+
if (isDef(i = vnode.children)) {
|
6108 |
+
for (j = 0; j < vnode.children.length; ++j) {
|
6109 |
+
invokeDestroyHook(vnode.children[j]);
|
6110 |
+
}
|
6111 |
+
}
|
6112 |
+
}
|
6113 |
+
|
6114 |
+
function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
|
6115 |
+
for (; startIdx <= endIdx; ++startIdx) {
|
6116 |
+
var ch = vnodes[startIdx];
|
6117 |
+
if (isDef(ch)) {
|
6118 |
+
if (isDef(ch.tag)) {
|
6119 |
+
removeAndInvokeRemoveHook(ch);
|
6120 |
+
invokeDestroyHook(ch);
|
6121 |
+
} else { // Text node
|
6122 |
+
removeNode(ch.elm);
|
6123 |
+
}
|
6124 |
+
}
|
6125 |
+
}
|
6126 |
+
}
|
6127 |
+
|
6128 |
+
function removeAndInvokeRemoveHook (vnode, rm) {
|
6129 |
+
if (isDef(rm) || isDef(vnode.data)) {
|
6130 |
+
var i;
|
6131 |
+
var listeners = cbs.remove.length + 1;
|
6132 |
+
if (isDef(rm)) {
|
6133 |
+
// we have a recursively passed down rm callback
|
6134 |
+
// increase the listeners count
|
6135 |
+
rm.listeners += listeners;
|
6136 |
+
} else {
|
6137 |
+
// directly removing
|
6138 |
+
rm = createRmCb(vnode.elm, listeners);
|
6139 |
+
}
|
6140 |
+
// recursively invoke hooks on child component root node
|
6141 |
+
if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
|
6142 |
+
removeAndInvokeRemoveHook(i, rm);
|
6143 |
+
}
|
6144 |
+
for (i = 0; i < cbs.remove.length; ++i) {
|
6145 |
+
cbs.remove[i](vnode, rm);
|
6146 |
+
}
|
6147 |
+
if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
|
6148 |
+
i(vnode, rm);
|
6149 |
+
} else {
|
6150 |
+
rm();
|
6151 |
+
}
|
6152 |
+
} else {
|
6153 |
+
removeNode(vnode.elm);
|
6154 |
+
}
|
6155 |
+
}
|
6156 |
+
|
6157 |
+
function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
|
6158 |
+
var oldStartIdx = 0;
|
6159 |
+
var newStartIdx = 0;
|
6160 |
+
var oldEndIdx = oldCh.length - 1;
|
6161 |
+
var oldStartVnode = oldCh[0];
|
6162 |
+
var oldEndVnode = oldCh[oldEndIdx];
|
6163 |
+
var newEndIdx = newCh.length - 1;
|
6164 |
+
var newStartVnode = newCh[0];
|
6165 |
+
var newEndVnode = newCh[newEndIdx];
|
6166 |
+
var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
|
6167 |
+
|
6168 |
+
// removeOnly is a special flag used only by <transition-group>
|
6169 |
+
// to ensure removed elements stay in correct relative positions
|
6170 |
+
// during leaving transitions
|
6171 |
+
var canMove = !removeOnly;
|
6172 |
+
|
6173 |
+
{
|
6174 |
+
checkDuplicateKeys(newCh);
|
6175 |
+
}
|
6176 |
+
|
6177 |
+
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
6178 |
+
if (isUndef(oldStartVnode)) {
|
6179 |
+
oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
|
6180 |
+
} else if (isUndef(oldEndVnode)) {
|
6181 |
+
oldEndVnode = oldCh[--oldEndIdx];
|
6182 |
+
} else if (sameVnode(oldStartVnode, newStartVnode)) {
|
6183 |
+
patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
|
6184 |
+
oldStartVnode = oldCh[++oldStartIdx];
|
6185 |
+
newStartVnode = newCh[++newStartIdx];
|
6186 |
+
} else if (sameVnode(oldEndVnode, newEndVnode)) {
|
6187 |
+
patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
|
6188 |
+
oldEndVnode = oldCh[--oldEndIdx];
|
6189 |
+
newEndVnode = newCh[--newEndIdx];
|
6190 |
+
} else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
|
6191 |
+
patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
|
6192 |
+
canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
|
6193 |
+
oldStartVnode = oldCh[++oldStartIdx];
|
6194 |
+
newEndVnode = newCh[--newEndIdx];
|
6195 |
+
} else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
|
6196 |
+
patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
|
6197 |
+
canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
|
6198 |
+
oldEndVnode = oldCh[--oldEndIdx];
|
6199 |
+
newStartVnode = newCh[++newStartIdx];
|
6200 |
+
} else {
|
6201 |
+
if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
|
6202 |
+
idxInOld = isDef(newStartVnode.key)
|
6203 |
+
? oldKeyToIdx[newStartVnode.key]
|
6204 |
+
: findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
|
6205 |
+
if (isUndef(idxInOld)) { // New element
|
6206 |
+
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
|
6207 |
+
} else {
|
6208 |
+
vnodeToMove = oldCh[idxInOld];
|
6209 |
+
if (sameVnode(vnodeToMove, newStartVnode)) {
|
6210 |
+
patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
|
6211 |
+
oldCh[idxInOld] = undefined;
|
6212 |
+
canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
|
6213 |
+
} else {
|
6214 |
+
// same key but different element. treat as new element
|
6215 |
+
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
|
6216 |
+
}
|
6217 |
+
}
|
6218 |
+
newStartVnode = newCh[++newStartIdx];
|
6219 |
+
}
|
6220 |
+
}
|
6221 |
+
if (oldStartIdx > oldEndIdx) {
|
6222 |
+
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
|
6223 |
+
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
|
6224 |
+
} else if (newStartIdx > newEndIdx) {
|
6225 |
+
removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
|
6226 |
+
}
|
6227 |
+
}
|
6228 |
+
|
6229 |
+
function checkDuplicateKeys (children) {
|
6230 |
+
var seenKeys = {};
|
6231 |
+
for (var i = 0; i < children.length; i++) {
|
6232 |
+
var vnode = children[i];
|
6233 |
+
var key = vnode.key;
|
6234 |
+
if (isDef(key)) {
|
6235 |
+
if (seenKeys[key]) {
|
6236 |
+
warn(
|
6237 |
+
("Duplicate keys detected: '" + key + "'. This may cause an update error."),
|
6238 |
+
vnode.context
|
6239 |
+
);
|
6240 |
+
} else {
|
6241 |
+
seenKeys[key] = true;
|
6242 |
+
}
|
6243 |
+
}
|
6244 |
+
}
|
6245 |
+
}
|
6246 |
+
|
6247 |
+
function findIdxInOld (node, oldCh, start, end) {
|
6248 |
+
for (var i = start; i < end; i++) {
|
6249 |
+
var c = oldCh[i];
|
6250 |
+
if (isDef(c) && sameVnode(node, c)) { return i }
|
6251 |
+
}
|
6252 |
+
}
|
6253 |
+
|
6254 |
+
function patchVnode (
|
6255 |
+
oldVnode,
|
6256 |
+
vnode,
|
6257 |
+
insertedVnodeQueue,
|
6258 |
+
ownerArray,
|
6259 |
+
index,
|
6260 |
+
removeOnly
|
6261 |
+
) {
|
6262 |
+
if (oldVnode === vnode) {
|
6263 |
+
return
|
6264 |
+
}
|
6265 |
+
|
6266 |
+
if (isDef(vnode.elm) && isDef(ownerArray)) {
|
6267 |
+
// clone reused vnode
|
6268 |
+
vnode = ownerArray[index] = cloneVNode(vnode);
|
6269 |
+
}
|
6270 |
+
|
6271 |
+
var elm = vnode.elm = oldVnode.elm;
|
6272 |
+
|
6273 |
+
if (isTrue(oldVnode.isAsyncPlaceholder)) {
|
6274 |
+
if (isDef(vnode.asyncFactory.resolved)) {
|
6275 |
+
hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
|
6276 |
+
} else {
|
6277 |
+
vnode.isAsyncPlaceholder = true;
|
6278 |
+
}
|
6279 |
+
return
|
6280 |
+
}
|
6281 |
+
|
6282 |
+
// reuse element for static trees.
|
6283 |
+
// note we only do this if the vnode is cloned -
|
6284 |
+
// if the new node is not cloned it means the render functions have been
|
6285 |
+
// reset by the hot-reload-api and we need to do a proper re-render.
|
6286 |
+
if (isTrue(vnode.isStatic) &&
|
6287 |
+
isTrue(oldVnode.isStatic) &&
|
6288 |
+
vnode.key === oldVnode.key &&
|
6289 |
+
(isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
|
6290 |
+
) {
|
6291 |
+
vnode.componentInstance = oldVnode.componentInstance;
|
6292 |
+
return
|
6293 |
+
}
|
6294 |
+
|
6295 |
+
var i;
|
6296 |
+
var data = vnode.data;
|
6297 |
+
if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
|
6298 |
+
i(oldVnode, vnode);
|
6299 |
+
}
|
6300 |
+
|
6301 |
+
var oldCh = oldVnode.children;
|
6302 |
+
var ch = vnode.children;
|
6303 |
+
if (isDef(data) && isPatchable(vnode)) {
|
6304 |
+
for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
|
6305 |
+
if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
|
6306 |
+
}
|
6307 |
+
if (isUndef(vnode.text)) {
|
6308 |
+
if (isDef(oldCh) && isDef(ch)) {
|
6309 |
+
if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
|
6310 |
+
} else if (isDef(ch)) {
|
6311 |
+
{
|
6312 |
+
checkDuplicateKeys(ch);
|
6313 |
+
}
|
6314 |
+
if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
|
6315 |
+
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
|
6316 |
+
} else if (isDef(oldCh)) {
|
6317 |
+
removeVnodes(elm, oldCh, 0, oldCh.length - 1);
|
6318 |
+
} else if (isDef(oldVnode.text)) {
|
6319 |
+
nodeOps.setTextContent(elm, '');
|
6320 |
+
}
|
6321 |
+
} else if (oldVnode.text !== vnode.text) {
|
6322 |
+
nodeOps.setTextContent(elm, vnode.text);
|
6323 |
+
}
|
6324 |
+
if (isDef(data)) {
|
6325 |
+
if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
|
6326 |
+
}
|
6327 |
+
}
|
6328 |
+
|
6329 |
+
function invokeInsertHook (vnode, queue, initial) {
|
6330 |
+
// delay insert hooks for component root nodes, invoke them after the
|
6331 |
+
// element is really inserted
|
6332 |
+
if (isTrue(initial) && isDef(vnode.parent)) {
|
6333 |
+
vnode.parent.data.pendingInsert = queue;
|
6334 |
+
} else {
|
6335 |
+
for (var i = 0; i < queue.length; ++i) {
|
6336 |
+
queue[i].data.hook.insert(queue[i]);
|
6337 |
+
}
|
6338 |
+
}
|
6339 |
+
}
|
6340 |
+
|
6341 |
+
var hydrationBailed = false;
|
6342 |
+
// list of modules that can skip create hook during hydration because they
|
6343 |
+
// are already rendered on the client or has no need for initialization
|
6344 |
+
// Note: style is excluded because it relies on initial clone for future
|
6345 |
+
// deep updates (#7063).
|
6346 |
+
var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
|
6347 |
+
|
6348 |
+
// Note: this is a browser-only function so we can assume elms are DOM nodes.
|
6349 |
+
function hydrate (elm, vnode, insertedVnodeQueue, inVPre) {
|
6350 |
+
var i;
|
6351 |
+
var tag = vnode.tag;
|
6352 |
+
var data = vnode.data;
|
6353 |
+
var children = vnode.children;
|
6354 |
+
inVPre = inVPre || (data && data.pre);
|
6355 |
+
vnode.elm = elm;
|
6356 |
+
|
6357 |
+
if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
|
6358 |
+
vnode.isAsyncPlaceholder = true;
|
6359 |
+
return true
|
6360 |
+
}
|
6361 |
+
// assert node match
|
6362 |
+
{
|
6363 |
+
if (!assertNodeMatch(elm, vnode, inVPre)) {
|
6364 |
+
return false
|
6365 |
+
}
|
6366 |
+
}
|
6367 |
+
if (isDef(data)) {
|
6368 |
+
if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
|
6369 |
+
if (isDef(i = vnode.componentInstance)) {
|
6370 |
+
// child component. it should have hydrated its own tree.
|
6371 |
+
initComponent(vnode, insertedVnodeQueue);
|
6372 |
+
return true
|
6373 |
+
}
|
6374 |
+
}
|
6375 |
+
if (isDef(tag)) {
|
6376 |
+
if (isDef(children)) {
|
6377 |
+
// empty element, allow client to pick up and populate children
|
6378 |
+
if (!elm.hasChildNodes()) {
|
6379 |
+
createChildren(vnode, children, insertedVnodeQueue);
|
6380 |
+
} else {
|
6381 |
+
// v-html and domProps: innerHTML
|
6382 |
+
if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
|
6383 |
+
if (i !== elm.innerHTML) {
|
6384 |
+
/* istanbul ignore if */
|
6385 |
+
if (typeof console !== 'undefined' &&
|
6386 |
+
!hydrationBailed
|
6387 |
+
) {
|
6388 |
+
hydrationBailed = true;
|
6389 |
+
console.warn('Parent: ', elm);
|
6390 |
+
console.warn('server innerHTML: ', i);
|
6391 |
+
console.warn('client innerHTML: ', elm.innerHTML);
|
6392 |
+
}
|
6393 |
+
return false
|
6394 |
+
}
|
6395 |
+
} else {
|
6396 |
+
// iterate and compare children lists
|
6397 |
+
var childrenMatch = true;
|
6398 |
+
var childNode = elm.firstChild;
|
6399 |
+
for (var i$1 = 0; i$1 < children.length; i$1++) {
|
6400 |
+
if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {
|
6401 |
+
childrenMatch = false;
|
6402 |
+
break
|
6403 |
+
}
|
6404 |
+
childNode = childNode.nextSibling;
|
6405 |
+
}
|
6406 |
+
// if childNode is not null, it means the actual childNodes list is
|
6407 |
+
// longer than the virtual children list.
|
6408 |
+
if (!childrenMatch || childNode) {
|
6409 |
+
/* istanbul ignore if */
|
6410 |
+
if (typeof console !== 'undefined' &&
|
6411 |
+
!hydrationBailed
|
6412 |
+
) {
|
6413 |
+
hydrationBailed = true;
|
6414 |
+
console.warn('Parent: ', elm);
|
6415 |
+
console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
|
6416 |
+
}
|
6417 |
+
return false
|
6418 |
+
}
|
6419 |
+
}
|
6420 |
+
}
|
6421 |
+
}
|
6422 |
+
if (isDef(data)) {
|
6423 |
+
var fullInvoke = false;
|
6424 |
+
for (var key in data) {
|
6425 |
+
if (!isRenderedModule(key)) {
|
6426 |
+
fullInvoke = true;
|
6427 |
+
invokeCreateHooks(vnode, insertedVnodeQueue);
|
6428 |
+
break
|
6429 |
+
}
|
6430 |
+
}
|
6431 |
+
if (!fullInvoke && data['class']) {
|
6432 |
+
// ensure collecting deps for deep class bindings for future updates
|
6433 |
+
traverse(data['class']);
|
6434 |
+
}
|
6435 |
+
}
|
6436 |
+
} else if (elm.data !== vnode.text) {
|
6437 |
+
elm.data = vnode.text;
|
6438 |
+
}
|
6439 |
+
return true
|
6440 |
+
}
|
6441 |
+
|
6442 |
+
function assertNodeMatch (node, vnode, inVPre) {
|
6443 |
+
if (isDef(vnode.tag)) {
|
6444 |
+
return vnode.tag.indexOf('vue-component') === 0 || (
|
6445 |
+
!isUnknownElement$$1(vnode, inVPre) &&
|
6446 |
+
vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
|
6447 |
+
)
|
6448 |
+
} else {
|
6449 |
+
return node.nodeType === (vnode.isComment ? 8 : 3)
|
6450 |
+
}
|
6451 |
+
}
|
6452 |
+
|
6453 |
+
return function patch (oldVnode, vnode, hydrating, removeOnly) {
|
6454 |
+
if (isUndef(vnode)) {
|
6455 |
+
if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }
|
6456 |
+
return
|
6457 |
+
}
|
6458 |
+
|
6459 |
+
var isInitialPatch = false;
|
6460 |
+
var insertedVnodeQueue = [];
|
6461 |
+
|
6462 |
+
if (isUndef(oldVnode)) {
|
6463 |
+
// empty mount (likely as component), create new root element
|
6464 |
+
isInitialPatch = true;
|
6465 |
+
createElm(vnode, insertedVnodeQueue);
|
6466 |
+
} else {
|
6467 |
+
var isRealElement = isDef(oldVnode.nodeType);
|
6468 |
+
if (!isRealElement && sameVnode(oldVnode, vnode)) {
|
6469 |
+
// patch existing root node
|
6470 |
+
patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
|
6471 |
+
} else {
|
6472 |
+
if (isRealElement) {
|
6473 |
+
// mounting to a real element
|
6474 |
+
// check if this is server-rendered content and if we can perform
|
6475 |
+
// a successful hydration.
|
6476 |
+
if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
|
6477 |
+
oldVnode.removeAttribute(SSR_ATTR);
|
6478 |
+
hydrating = true;
|
6479 |
+
}
|
6480 |
+
if (isTrue(hydrating)) {
|
6481 |
+
if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
|
6482 |
+
invokeInsertHook(vnode, insertedVnodeQueue, true);
|
6483 |
+
return oldVnode
|
6484 |
+
} else {
|
6485 |
+
warn(
|
6486 |
+
'The client-side rendered virtual DOM tree is not matching ' +
|
6487 |
+
'server-rendered content. This is likely caused by incorrect ' +
|
6488 |
+
'HTML markup, for example nesting block-level elements inside ' +
|
6489 |
+
'<p>, or missing <tbody>. Bailing hydration and performing ' +
|
6490 |
+
'full client-side render.'
|
6491 |
+
);
|
6492 |
+
}
|
6493 |
+
}
|
6494 |
+
// either not server-rendered, or hydration failed.
|
6495 |
+
// create an empty node and replace it
|
6496 |
+
oldVnode = emptyNodeAt(oldVnode);
|
6497 |
+
}
|
6498 |
+
|
6499 |
+
// replacing existing element
|
6500 |
+
var oldElm = oldVnode.elm;
|
6501 |
+
var parentElm = nodeOps.parentNode(oldElm);
|
6502 |
+
|
6503 |
+
// create new node
|
6504 |
+
createElm(
|
6505 |
+
vnode,
|
6506 |
+
insertedVnodeQueue,
|
6507 |
+
// extremely rare edge case: do not insert if old element is in a
|
6508 |
+
// leaving transition. Only happens when combining transition +
|
6509 |
+
// keep-alive + HOCs. (#4590)
|
6510 |
+
oldElm._leaveCb ? null : parentElm,
|
6511 |
+
nodeOps.nextSibling(oldElm)
|
6512 |
+
);
|
6513 |
+
|
6514 |
+
// update parent placeholder node element, recursively
|
6515 |
+
if (isDef(vnode.parent)) {
|
6516 |
+
var ancestor = vnode.parent;
|
6517 |
+
var patchable = isPatchable(vnode);
|
6518 |
+
while (ancestor) {
|
6519 |
+
for (var i = 0; i < cbs.destroy.length; ++i) {
|
6520 |
+
cbs.destroy[i](ancestor);
|
6521 |
+
}
|
6522 |
+
ancestor.elm = vnode.elm;
|
6523 |
+
if (patchable) {
|
6524 |
+
for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
|
6525 |
+
cbs.create[i$1](emptyNode, ancestor);
|
6526 |
+
}
|
6527 |
+
// #6513
|
6528 |
+
// invoke insert hooks that may have been merged by create hooks.
|
6529 |
+
// e.g. for directives that uses the "inserted" hook.
|
6530 |
+
var insert = ancestor.data.hook.insert;
|
6531 |
+
if (insert.merged) {
|
6532 |
+
// start at index 1 to avoid re-invoking component mounted hook
|
6533 |
+
for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {
|
6534 |
+
insert.fns[i$2]();
|
6535 |
+
}
|
6536 |
+
}
|
6537 |
+
} else {
|
6538 |
+
registerRef(ancestor);
|
6539 |
+
}
|
6540 |
+
ancestor = ancestor.parent;
|
6541 |
+
}
|
6542 |
+
}
|
6543 |
+
|
6544 |
+
// destroy old node
|
6545 |
+
if (isDef(parentElm)) {
|
6546 |
+
removeVnodes(parentElm, [oldVnode], 0, 0);
|
6547 |
+
} else if (isDef(oldVnode.tag)) {
|
6548 |
+
invokeDestroyHook(oldVnode);
|
6549 |
+
}
|
6550 |
+
}
|
6551 |
+
}
|
6552 |
+
|
6553 |
+
invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
|
6554 |
+
return vnode.elm
|
6555 |
+
}
|
6556 |
+
}
|
6557 |
+
|
6558 |
+
/* */
|
6559 |
+
|
6560 |
+
var directives = {
|
6561 |
+
create: updateDirectives,
|
6562 |
+
update: updateDirectives,
|
6563 |
+
destroy: function unbindDirectives (vnode) {
|
6564 |
+
updateDirectives(vnode, emptyNode);
|
6565 |
+
}
|
6566 |
+
};
|
6567 |
+
|
6568 |
+
function updateDirectives (oldVnode, vnode) {
|
6569 |
+
if (oldVnode.data.directives || vnode.data.directives) {
|
6570 |
+
_update(oldVnode, vnode);
|
6571 |
+
}
|
6572 |
+
}
|
6573 |
+
|
6574 |
+
function _update (oldVnode, vnode) {
|
6575 |
+
var isCreate = oldVnode === emptyNode;
|
6576 |
+
var isDestroy = vnode === emptyNode;
|
6577 |
+
var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
|
6578 |
+
var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
|
6579 |
+
|
6580 |
+
var dirsWithInsert = [];
|
6581 |
+
var dirsWithPostpatch = [];
|
6582 |
+
|
6583 |
+
var key, oldDir, dir;
|
6584 |
+
for (key in newDirs) {
|
6585 |
+
oldDir = oldDirs[key];
|
6586 |
+
dir = newDirs[key];
|
6587 |
+
if (!oldDir) {
|
6588 |
+
// new directive, bind
|
6589 |
+
callHook$1(dir, 'bind', vnode, oldVnode);
|
6590 |
+
if (dir.def && dir.def.inserted) {
|
6591 |
+
dirsWithInsert.push(dir);
|
6592 |
+
}
|
6593 |
+
} else {
|
6594 |
+
// existing directive, update
|
6595 |
+
dir.oldValue = oldDir.value;
|
6596 |
+
dir.oldArg = oldDir.arg;
|
6597 |
+
callHook$1(dir, 'update', vnode, oldVnode);
|
6598 |
+
if (dir.def && dir.def.componentUpdated) {
|
6599 |
+
dirsWithPostpatch.push(dir);
|
6600 |
+
}
|
6601 |
+
}
|
6602 |
+
}
|
6603 |
+
|
6604 |
+
if (dirsWithInsert.length) {
|
6605 |
+
var callInsert = function () {
|
6606 |
+
for (var i = 0; i < dirsWithInsert.length; i++) {
|
6607 |
+
callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
|
6608 |
+
}
|
6609 |
+
};
|
6610 |
+
if (isCreate) {
|
6611 |
+
mergeVNodeHook(vnode, 'insert', callInsert);
|
6612 |
+
} else {
|
6613 |
+
callInsert();
|
6614 |
+
}
|
6615 |
+
}
|
6616 |
+
|
6617 |
+
if (dirsWithPostpatch.length) {
|
6618 |
+
mergeVNodeHook(vnode, 'postpatch', function () {
|
6619 |
+
for (var i = 0; i < dirsWithPostpatch.length; i++) {
|
6620 |
+
callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
|
6621 |
+
}
|
6622 |
+
});
|
6623 |
+
}
|
6624 |
+
|
6625 |
+
if (!isCreate) {
|
6626 |
+
for (key in oldDirs) {
|
6627 |
+
if (!newDirs[key]) {
|
6628 |
+
// no longer present, unbind
|
6629 |
+
callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
|
6630 |
+
}
|
6631 |
+
}
|
6632 |
+
}
|
6633 |
+
}
|
6634 |
+
|
6635 |
+
var emptyModifiers = Object.create(null);
|
6636 |
+
|
6637 |
+
function normalizeDirectives$1 (
|
6638 |
+
dirs,
|
6639 |
+
vm
|
6640 |
+
) {
|
6641 |
+
var res = Object.create(null);
|
6642 |
+
if (!dirs) {
|
6643 |
+
// $flow-disable-line
|
6644 |
+
return res
|
6645 |
+
}
|
6646 |
+
var i, dir;
|
6647 |
+
for (i = 0; i < dirs.length; i++) {
|
6648 |
+
dir = dirs[i];
|
6649 |
+
if (!dir.modifiers) {
|
6650 |
+
// $flow-disable-line
|
6651 |
+
dir.modifiers = emptyModifiers;
|
6652 |
+
}
|
6653 |
+
res[getRawDirName(dir)] = dir;
|
6654 |
+
dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
|
6655 |
+
}
|
6656 |
+
// $flow-disable-line
|
6657 |
+
return res
|
6658 |
+
}
|
6659 |
+
|
6660 |
+
function getRawDirName (dir) {
|
6661 |
+
return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
|
6662 |
+
}
|
6663 |
+
|
6664 |
+
function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
|
6665 |
+
var fn = dir.def && dir.def[hook];
|
6666 |
+
if (fn) {
|
6667 |
+
try {
|
6668 |
+
fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
|
6669 |
+
} catch (e) {
|
6670 |
+
handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
|
6671 |
+
}
|
6672 |
+
}
|
6673 |
+
}
|
6674 |
+
|
6675 |
+
var baseModules = [
|
6676 |
+
ref,
|
6677 |
+
directives
|
6678 |
+
];
|
6679 |
+
|
6680 |
+
/* */
|
6681 |
+
|
6682 |
+
function updateAttrs (oldVnode, vnode) {
|
6683 |
+
var opts = vnode.componentOptions;
|
6684 |
+
if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
|
6685 |
+
return
|
6686 |
+
}
|
6687 |
+
if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
|
6688 |
+
return
|
6689 |
+
}
|
6690 |
+
var key, cur, old;
|
6691 |
+
var elm = vnode.elm;
|
6692 |
+
var oldAttrs = oldVnode.data.attrs || {};
|
6693 |
+
var attrs = vnode.data.attrs || {};
|
6694 |
+
// clone observed objects, as the user probably wants to mutate it
|
6695 |
+
if (isDef(attrs.__ob__)) {
|
6696 |
+
attrs = vnode.data.attrs = extend({}, attrs);
|
6697 |
+
}
|
6698 |
+
|
6699 |
+
for (key in attrs) {
|
6700 |
+
cur = attrs[key];
|
6701 |
+
old = oldAttrs[key];
|
6702 |
+
if (old !== cur) {
|
6703 |
+
setAttr(elm, key, cur);
|
6704 |
+
}
|
6705 |
+
}
|
6706 |
+
// #4391: in IE9, setting type can reset value for input[type=radio]
|
6707 |
+
// #6666: IE/Edge forces progress value down to 1 before setting a max
|
6708 |
+
/* istanbul ignore if */
|
6709 |
+
if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
|
6710 |
+
setAttr(elm, 'value', attrs.value);
|
6711 |
+
}
|
6712 |
+
for (key in oldAttrs) {
|
6713 |
+
if (isUndef(attrs[key])) {
|
6714 |
+
if (isXlink(key)) {
|
6715 |
+
elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
|
6716 |
+
} else if (!isEnumeratedAttr(key)) {
|
6717 |
+
elm.removeAttribute(key);
|
6718 |
+
}
|
6719 |
+
}
|
6720 |
+
}
|
6721 |
+
}
|
6722 |
+
|
6723 |
+
function setAttr (el, key, value) {
|
6724 |
+
if (el.tagName.indexOf('-') > -1) {
|
6725 |
+
baseSetAttr(el, key, value);
|
6726 |
+
} else if (isBooleanAttr(key)) {
|
6727 |
+
// set attribute for blank value
|
6728 |
+
// e.g. <option disabled>Select one</option>
|
6729 |
+
if (isFalsyAttrValue(value)) {
|
6730 |
+
el.removeAttribute(key);
|
6731 |
+
} else {
|
6732 |
+
// technically allowfullscreen is a boolean attribute for <iframe>,
|
6733 |
+
// but Flash expects a value of "true" when used on <embed> tag
|
6734 |
+
value = key === 'allowfullscreen' && el.tagName === 'EMBED'
|
6735 |
+
? 'true'
|
6736 |
+
: key;
|
6737 |
+
el.setAttribute(key, value);
|
6738 |
+
}
|
6739 |
+
} else if (isEnumeratedAttr(key)) {
|
6740 |
+
el.setAttribute(key, convertEnumeratedValue(key, value));
|
6741 |
+
} else if (isXlink(key)) {
|
6742 |
+
if (isFalsyAttrValue(value)) {
|
6743 |
+
el.removeAttributeNS(xlinkNS, getXlinkProp(key));
|
6744 |
+
} else {
|
6745 |
+
el.setAttributeNS(xlinkNS, key, value);
|
6746 |
+
}
|
6747 |
+
} else {
|
6748 |
+
baseSetAttr(el, key, value);
|
6749 |
+
}
|
6750 |
+
}
|
6751 |
+
|
6752 |
+
function baseSetAttr (el, key, value) {
|
6753 |
+
if (isFalsyAttrValue(value)) {
|
6754 |
+
el.removeAttribute(key);
|
6755 |
+
} else {
|
6756 |
+
// #7138: IE10 & 11 fires input event when setting placeholder on
|
6757 |
+
// <textarea>... block the first input event and remove the blocker
|
6758 |
+
// immediately.
|
6759 |
+
/* istanbul ignore if */
|
6760 |
+
if (
|
6761 |
+
isIE && !isIE9 &&
|
6762 |
+
el.tagName === 'TEXTAREA' &&
|
6763 |
+
key === 'placeholder' && value !== '' && !el.__ieph
|
6764 |
+
) {
|
6765 |
+
var blocker = function (e) {
|
6766 |
+
e.stopImmediatePropagation();
|
6767 |
+
el.removeEventListener('input', blocker);
|
6768 |
+
};
|
6769 |
+
el.addEventListener('input', blocker);
|
6770 |
+
// $flow-disable-line
|
6771 |
+
el.__ieph = true; /* IE placeholder patched */
|
6772 |
+
}
|
6773 |
+
el.setAttribute(key, value);
|
6774 |
+
}
|
6775 |
+
}
|
6776 |
+
|
6777 |
+
var attrs = {
|
6778 |
+
create: updateAttrs,
|
6779 |
+
update: updateAttrs
|
6780 |
+
};
|
6781 |
+
|
6782 |
+
/* */
|
6783 |
+
|
6784 |
+
function updateClass (oldVnode, vnode) {
|
6785 |
+
var el = vnode.elm;
|
6786 |
+
var data = vnode.data;
|
6787 |
+
var oldData = oldVnode.data;
|
6788 |
+
if (
|
6789 |
+
isUndef(data.staticClass) &&
|
6790 |
+
isUndef(data.class) && (
|
6791 |
+
isUndef(oldData) || (
|
6792 |
+
isUndef(oldData.staticClass) &&
|
6793 |
+
isUndef(oldData.class)
|
6794 |
+
)
|
6795 |
+
)
|
6796 |
+
) {
|
6797 |
+
return
|
6798 |
+
}
|
6799 |
+
|
6800 |
+
var cls = genClassForVnode(vnode);
|
6801 |
+
|
6802 |
+
// handle transition classes
|
6803 |
+
var transitionClass = el._transitionClasses;
|
6804 |
+
if (isDef(transitionClass)) {
|
6805 |
+
cls = concat(cls, stringifyClass(transitionClass));
|
6806 |
+
}
|
6807 |
+
|
6808 |
+
// set the class
|
6809 |
+
if (cls !== el._prevClass) {
|
6810 |
+
el.setAttribute('class', cls);
|
6811 |
+
el._prevClass = cls;
|
6812 |
+
}
|
6813 |
+
}
|
6814 |
+
|
6815 |
+
var klass = {
|
6816 |
+
create: updateClass,
|
6817 |
+
update: updateClass
|
6818 |
+
};
|
6819 |
+
|
6820 |
+
/* */
|
6821 |
+
|
6822 |
+
var validDivisionCharRE = /[\w).+\-_$\]]/;
|
6823 |
+
|
6824 |
+
function parseFilters (exp) {
|
6825 |
+
var inSingle = false;
|
6826 |
+
var inDouble = false;
|
6827 |
+
var inTemplateString = false;
|
6828 |
+
var inRegex = false;
|
6829 |
+
var curly = 0;
|
6830 |
+
var square = 0;
|
6831 |
+
var paren = 0;
|
6832 |
+
var lastFilterIndex = 0;
|
6833 |
+
var c, prev, i, expression, filters;
|
6834 |
+
|
6835 |
+
for (i = 0; i < exp.length; i++) {
|
6836 |
+
prev = c;
|
6837 |
+
c = exp.charCodeAt(i);
|
6838 |
+
if (inSingle) {
|
6839 |
+
if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
|
6840 |
+
} else if (inDouble) {
|
6841 |
+
if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
|
6842 |
+
} else if (inTemplateString) {
|
6843 |
+
if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
|
6844 |
+
} else if (inRegex) {
|
6845 |
+
if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
|
6846 |
+
} else if (
|
6847 |
+
c === 0x7C && // pipe
|
6848 |
+
exp.charCodeAt(i + 1) !== 0x7C &&
|
6849 |
+
exp.charCodeAt(i - 1) !== 0x7C &&
|
6850 |
+
!curly && !square && !paren
|
6851 |
+
) {
|
6852 |
+
if (expression === undefined) {
|
6853 |
+
// first filter, end of expression
|
6854 |
+
lastFilterIndex = i + 1;
|
6855 |
+
expression = exp.slice(0, i).trim();
|
6856 |
+
} else {
|
6857 |
+
pushFilter();
|
6858 |
+
}
|
6859 |
+
} else {
|
6860 |
+
switch (c) {
|
6861 |
+
case 0x22: inDouble = true; break // "
|
6862 |
+
case 0x27: inSingle = true; break // '
|
6863 |
+
case 0x60: inTemplateString = true; break // `
|
6864 |
+
case 0x28: paren++; break // (
|
6865 |
+
case 0x29: paren--; break // )
|
6866 |
+
case 0x5B: square++; break // [
|
6867 |
+
case 0x5D: square--; break // ]
|
6868 |
+
case 0x7B: curly++; break // {
|
6869 |
+
case 0x7D: curly--; break // }
|
6870 |
+
}
|
6871 |
+
if (c === 0x2f) { // /
|
6872 |
+
var j = i - 1;
|
6873 |
+
var p = (void 0);
|
6874 |
+
// find first non-whitespace prev char
|
6875 |
+
for (; j >= 0; j--) {
|
6876 |
+
p = exp.charAt(j);
|
6877 |
+
if (p !== ' ') { break }
|
6878 |
+
}
|
6879 |
+
if (!p || !validDivisionCharRE.test(p)) {
|
6880 |
+
inRegex = true;
|
6881 |
+
}
|
6882 |
+
}
|
6883 |
+
}
|
6884 |
+
}
|
6885 |
+
|
6886 |
+
if (expression === undefined) {
|
6887 |
+
expression = exp.slice(0, i).trim();
|
6888 |
+
} else if (lastFilterIndex !== 0) {
|
6889 |
+
pushFilter();
|
6890 |
+
}
|
6891 |
+
|
6892 |
+
function pushFilter () {
|
6893 |
+
(filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
|
6894 |
+
lastFilterIndex = i + 1;
|
6895 |
+
}
|
6896 |
+
|
6897 |
+
if (filters) {
|
6898 |
+
for (i = 0; i < filters.length; i++) {
|
6899 |
+
expression = wrapFilter(expression, filters[i]);
|
6900 |
+
}
|
6901 |
+
}
|
6902 |
+
|
6903 |
+
return expression
|
6904 |
+
}
|
6905 |
+
|
6906 |
+
function wrapFilter (exp, filter) {
|
6907 |
+
var i = filter.indexOf('(');
|
6908 |
+
if (i < 0) {
|
6909 |
+
// _f: resolveFilter
|
6910 |
+
return ("_f(\"" + filter + "\")(" + exp + ")")
|
6911 |
+
} else {
|
6912 |
+
var name = filter.slice(0, i);
|
6913 |
+
var args = filter.slice(i + 1);
|
6914 |
+
return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args))
|
6915 |
+
}
|
6916 |
+
}
|
6917 |
+
|
6918 |
+
/* */
|
6919 |
+
|
6920 |
+
|
6921 |
+
|
6922 |
+
/* eslint-disable no-unused-vars */
|
6923 |
+
function baseWarn (msg, range) {
|
6924 |
+
console.error(("[Vue compiler]: " + msg));
|
6925 |
+
}
|
6926 |
+
/* eslint-enable no-unused-vars */
|
6927 |
+
|
6928 |
+
function pluckModuleFunction (
|
6929 |
+
modules,
|
6930 |
+
key
|
6931 |
+
) {
|
6932 |
+
return modules
|
6933 |
+
? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
|
6934 |
+
: []
|
6935 |
+
}
|
6936 |
+
|
6937 |
+
function addProp (el, name, value, range, dynamic) {
|
6938 |
+
(el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
|
6939 |
+
el.plain = false;
|
6940 |
+
}
|
6941 |
+
|
6942 |
+
function addAttr (el, name, value, range, dynamic) {
|
6943 |
+
var attrs = dynamic
|
6944 |
+
? (el.dynamicAttrs || (el.dynamicAttrs = []))
|
6945 |
+
: (el.attrs || (el.attrs = []));
|
6946 |
+
attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
|
6947 |
+
el.plain = false;
|
6948 |
+
}
|
6949 |
+
|
6950 |
+
// add a raw attr (use this in preTransforms)
|
6951 |
+
function addRawAttr (el, name, value, range) {
|
6952 |
+
el.attrsMap[name] = value;
|
6953 |
+
el.attrsList.push(rangeSetItem({ name: name, value: value }, range));
|
6954 |
+
}
|
6955 |
+
|
6956 |
+
function addDirective (
|
6957 |
+
el,
|
6958 |
+
name,
|
6959 |
+
rawName,
|
6960 |
+
value,
|
6961 |
+
arg,
|
6962 |
+
isDynamicArg,
|
6963 |
+
modifiers,
|
6964 |
+
range
|
6965 |
+
) {
|
6966 |
+
(el.directives || (el.directives = [])).push(rangeSetItem({
|
6967 |
+
name: name,
|
6968 |
+
rawName: rawName,
|
6969 |
+
value: value,
|
6970 |
+
arg: arg,
|
6971 |
+
isDynamicArg: isDynamicArg,
|
6972 |
+
modifiers: modifiers
|
6973 |
+
}, range));
|
6974 |
+
el.plain = false;
|
6975 |
+
}
|
6976 |
+
|
6977 |
+
function prependModifierMarker (symbol, name, dynamic) {
|
6978 |
+
return dynamic
|
6979 |
+
? ("_p(" + name + ",\"" + symbol + "\")")
|
6980 |
+
: symbol + name // mark the event as captured
|
6981 |
+
}
|
6982 |
+
|
6983 |
+
function addHandler (
|
6984 |
+
el,
|
6985 |
+
name,
|
6986 |
+
value,
|
6987 |
+
modifiers,
|
6988 |
+
important,
|
6989 |
+
warn,
|
6990 |
+
range,
|
6991 |
+
dynamic
|
6992 |
+
) {
|
6993 |
+
modifiers = modifiers || emptyObject;
|
6994 |
+
// warn prevent and passive modifier
|
6995 |
+
/* istanbul ignore if */
|
6996 |
+
if (
|
6997 |
+
warn &&
|
6998 |
+
modifiers.prevent && modifiers.passive
|
6999 |
+
) {
|
7000 |
+
warn(
|
7001 |
+
'passive and prevent can\'t be used together. ' +
|
7002 |
+
'Passive handler can\'t prevent default event.',
|
7003 |
+
range
|
7004 |
+
);
|
7005 |
+
}
|
7006 |
+
|
7007 |
+
// normalize click.right and click.middle since they don't actually fire
|
7008 |
+
// this is technically browser-specific, but at least for now browsers are
|
7009 |
+
// the only target envs that have right/middle clicks.
|
7010 |
+
if (modifiers.right) {
|
7011 |
+
if (dynamic) {
|
7012 |
+
name = "(" + name + ")==='click'?'contextmenu':(" + name + ")";
|
7013 |
+
} else if (name === 'click') {
|
7014 |
+
name = 'contextmenu';
|
7015 |
+
delete modifiers.right;
|
7016 |
+
}
|
7017 |
+
} else if (modifiers.middle) {
|
7018 |
+
if (dynamic) {
|
7019 |
+
name = "(" + name + ")==='click'?'mouseup':(" + name + ")";
|
7020 |
+
} else if (name === 'click') {
|
7021 |
+
name = 'mouseup';
|
7022 |
+
}
|
7023 |
+
}
|
7024 |
+
|
7025 |
+
// check capture modifier
|
7026 |
+
if (modifiers.capture) {
|
7027 |
+
delete modifiers.capture;
|
7028 |
+
name = prependModifierMarker('!', name, dynamic);
|
7029 |
+
}
|
7030 |
+
if (modifiers.once) {
|
7031 |
+
delete modifiers.once;
|
7032 |
+
name = prependModifierMarker('~', name, dynamic);
|
7033 |
+
}
|
7034 |
+
/* istanbul ignore if */
|
7035 |
+
if (modifiers.passive) {
|
7036 |
+
delete modifiers.passive;
|
7037 |
+
name = prependModifierMarker('&', name, dynamic);
|
7038 |
+
}
|
7039 |
+
|
7040 |
+
var events;
|
7041 |
+
if (modifiers.native) {
|
7042 |
+
delete modifiers.native;
|
7043 |
+
events = el.nativeEvents || (el.nativeEvents = {});
|
7044 |
+
} else {
|
7045 |
+
events = el.events || (el.events = {});
|
7046 |
+
}
|
7047 |
+
|
7048 |
+
var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range);
|
7049 |
+
if (modifiers !== emptyObject) {
|
7050 |
+
newHandler.modifiers = modifiers;
|
7051 |
+
}
|
7052 |
+
|
7053 |
+
var handlers = events[name];
|
7054 |
+
/* istanbul ignore if */
|
7055 |
+
if (Array.isArray(handlers)) {
|
7056 |
+
important ? handlers.unshift(newHandler) : handlers.push(newHandler);
|
7057 |
+
} else if (handlers) {
|
7058 |
+
events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
|
7059 |
+
} else {
|
7060 |
+
events[name] = newHandler;
|
7061 |
+
}
|
7062 |
+
|
7063 |
+
el.plain = false;
|
7064 |
+
}
|
7065 |
+
|
7066 |
+
function getRawBindingAttr (
|
7067 |
+
el,
|
7068 |
+
name
|
7069 |
+
) {
|
7070 |
+
return el.rawAttrsMap[':' + name] ||
|
7071 |
+
el.rawAttrsMap['v-bind:' + name] ||
|
7072 |
+
el.rawAttrsMap[name]
|
7073 |
+
}
|
7074 |
+
|
7075 |
+
function getBindingAttr (
|
7076 |
+
el,
|
7077 |
+
name,
|
7078 |
+
getStatic
|
7079 |
+
) {
|
7080 |
+
var dynamicValue =
|
7081 |
+
getAndRemoveAttr(el, ':' + name) ||
|
7082 |
+
getAndRemoveAttr(el, 'v-bind:' + name);
|
7083 |
+
if (dynamicValue != null) {
|
7084 |
+
return parseFilters(dynamicValue)
|
7085 |
+
} else if (getStatic !== false) {
|
7086 |
+
var staticValue = getAndRemoveAttr(el, name);
|
7087 |
+
if (staticValue != null) {
|
7088 |
+
return JSON.stringify(staticValue)
|
7089 |
+
}
|
7090 |
+
}
|
7091 |
+
}
|
7092 |
+
|
7093 |
+
// note: this only removes the attr from the Array (attrsList) so that it
|
7094 |
+
// doesn't get processed by processAttrs.
|
7095 |
+
// By default it does NOT remove it from the map (attrsMap) because the map is
|
7096 |
+
// needed during codegen.
|
7097 |
+
function getAndRemoveAttr (
|
7098 |
+
el,
|
7099 |
+
name,
|
7100 |
+
removeFromMap
|
7101 |
+
) {
|
7102 |
+
var val;
|
7103 |
+
if ((val = el.attrsMap[name]) != null) {
|
7104 |
+
var list = el.attrsList;
|
7105 |
+
for (var i = 0, l = list.length; i < l; i++) {
|
7106 |
+
if (list[i].name === name) {
|
7107 |
+
list.splice(i, 1);
|
7108 |
+
break
|
7109 |
+
}
|
7110 |
+
}
|
7111 |
+
}
|
7112 |
+
if (removeFromMap) {
|
7113 |
+
delete el.attrsMap[name];
|
7114 |
+
}
|
7115 |
+
return val
|
7116 |
+
}
|
7117 |
+
|
7118 |
+
function getAndRemoveAttrByRegex (
|
7119 |
+
el,
|
7120 |
+
name
|
7121 |
+
) {
|
7122 |
+
var list = el.attrsList;
|
7123 |
+
for (var i = 0, l = list.length; i < l; i++) {
|
7124 |
+
var attr = list[i];
|
7125 |
+
if (name.test(attr.name)) {
|
7126 |
+
list.splice(i, 1);
|
7127 |
+
return attr
|
7128 |
+
}
|
7129 |
+
}
|
7130 |
+
}
|
7131 |
+
|
7132 |
+
function rangeSetItem (
|
7133 |
+
item,
|
7134 |
+
range
|
7135 |
+
) {
|
7136 |
+
if (range) {
|
7137 |
+
if (range.start != null) {
|
7138 |
+
item.start = range.start;
|
7139 |
+
}
|
7140 |
+
if (range.end != null) {
|
7141 |
+
item.end = range.end;
|
7142 |
+
}
|
7143 |
+
}
|
7144 |
+
return item
|
7145 |
+
}
|
7146 |
+
|
7147 |
+
/* */
|
7148 |
+
|
7149 |
+
/**
|
7150 |
+
* Cross-platform code generation for component v-model
|
7151 |
+
*/
|
7152 |
+
function genComponentModel (
|
7153 |
+
el,
|
7154 |
+
value,
|
7155 |
+
modifiers
|
7156 |
+
) {
|
7157 |
+
var ref = modifiers || {};
|
7158 |
+
var number = ref.number;
|
7159 |
+
var trim = ref.trim;
|
7160 |
+
|
7161 |
+
var baseValueExpression = '$$v';
|
7162 |
+
var valueExpression = baseValueExpression;
|
7163 |
+
if (trim) {
|
7164 |
+
valueExpression =
|
7165 |
+
"(typeof " + baseValueExpression + " === 'string'" +
|
7166 |
+
"? " + baseValueExpression + ".trim()" +
|
7167 |
+
": " + baseValueExpression + ")";
|
7168 |
+
}
|
7169 |
+
if (number) {
|
7170 |
+
valueExpression = "_n(" + valueExpression + ")";
|
7171 |
+
}
|
7172 |
+
var assignment = genAssignmentCode(value, valueExpression);
|
7173 |
+
|
7174 |
+
el.model = {
|
7175 |
+
value: ("(" + value + ")"),
|
7176 |
+
expression: JSON.stringify(value),
|
7177 |
+
callback: ("function (" + baseValueExpression + ") {" + assignment + "}")
|
7178 |
+
};
|
7179 |
+
}
|
7180 |
+
|
7181 |
+
/**
|
7182 |
+
* Cross-platform codegen helper for generating v-model value assignment code.
|
7183 |
+
*/
|
7184 |
+
function genAssignmentCode (
|
7185 |
+
value,
|
7186 |
+
assignment
|
7187 |
+
) {
|
7188 |
+
var res = parseModel(value);
|
7189 |
+
if (res.key === null) {
|
7190 |
+
return (value + "=" + assignment)
|
7191 |
+
} else {
|
7192 |
+
return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")")
|
7193 |
+
}
|
7194 |
+
}
|
7195 |
+
|
7196 |
+
/**
|
7197 |
+
* Parse a v-model expression into a base path and a final key segment.
|
7198 |
+
* Handles both dot-path and possible square brackets.
|
7199 |
+
*
|
7200 |
+
* Possible cases:
|
7201 |
+
*
|
7202 |
+
* - test
|
7203 |
+
* - test[key]
|
7204 |
+
* - test[test1[key]]
|
7205 |
+
* - test["a"][key]
|
7206 |
+
* - xxx.test[a[a].test1[key]]
|
7207 |
+
* - test.xxx.a["asa"][test1[key]]
|
7208 |
+
*
|
7209 |
+
*/
|
7210 |
+
|
7211 |
+
var len, str, chr, index$1, expressionPos, expressionEndPos;
|
7212 |
+
|
7213 |
+
|
7214 |
+
|
7215 |
+
function parseModel (val) {
|
7216 |
+
// Fix https://github.com/vuejs/vue/pull/7730
|
7217 |
+
// allow v-model="obj.val " (trailing whitespace)
|
7218 |
+
val = val.trim();
|
7219 |
+
len = val.length;
|
7220 |
+
|
7221 |
+
if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
|
7222 |
+
index$1 = val.lastIndexOf('.');
|
7223 |
+
if (index$1 > -1) {
|
7224 |
+
return {
|
7225 |
+
exp: val.slice(0, index$1),
|
7226 |
+
key: '"' + val.slice(index$1 + 1) + '"'
|
7227 |
+
}
|
7228 |
+
} else {
|
7229 |
+
return {
|
7230 |
+
exp: val,
|
7231 |
+
key: null
|
7232 |
+
}
|
7233 |
+
}
|
7234 |
+
}
|
7235 |
+
|
7236 |
+
str = val;
|
7237 |
+
index$1 = expressionPos = expressionEndPos = 0;
|
7238 |
+
|
7239 |
+
while (!eof()) {
|
7240 |
+
chr = next();
|
7241 |
+
/* istanbul ignore if */
|
7242 |
+
if (isStringStart(chr)) {
|
7243 |
+
parseString(chr);
|
7244 |
+
} else if (chr === 0x5B) {
|
7245 |
+
parseBracket(chr);
|
7246 |
+
}
|
7247 |
+
}
|
7248 |
+
|
7249 |
+
return {
|
7250 |
+
exp: val.slice(0, expressionPos),
|
7251 |
+
key: val.slice(expressionPos + 1, expressionEndPos)
|
7252 |
+
}
|
7253 |
+
}
|
7254 |
+
|
7255 |
+
function next () {
|
7256 |
+
return str.charCodeAt(++index$1)
|
7257 |
+
}
|
7258 |
+
|
7259 |
+
function eof () {
|
7260 |
+
return index$1 >= len
|
7261 |
+
}
|
7262 |
+
|
7263 |
+
function isStringStart (chr) {
|
7264 |
+
return chr === 0x22 || chr === 0x27
|
7265 |
+
}
|
7266 |
+
|
7267 |
+
function parseBracket (chr) {
|
7268 |
+
var inBracket = 1;
|
7269 |
+
expressionPos = index$1;
|
7270 |
+
while (!eof()) {
|
7271 |
+
chr = next();
|
7272 |
+
if (isStringStart(chr)) {
|
7273 |
+
parseString(chr);
|
7274 |
+
continue
|
7275 |
+
}
|
7276 |
+
if (chr === 0x5B) { inBracket++; }
|
7277 |
+
if (chr === 0x5D) { inBracket--; }
|
7278 |
+
if (inBracket === 0) {
|
7279 |
+
expressionEndPos = index$1;
|
7280 |
+
break
|
7281 |
+
}
|
7282 |
+
}
|
7283 |
+
}
|
7284 |
+
|
7285 |
+
function parseString (chr) {
|
7286 |
+
var stringQuote = chr;
|
7287 |
+
while (!eof()) {
|
7288 |
+
chr = next();
|
7289 |
+
if (chr === stringQuote) {
|
7290 |
+
break
|
7291 |
+
}
|
7292 |
+
}
|
7293 |
+
}
|
7294 |
+
|
7295 |
+
/* */
|
7296 |
+
|
7297 |
+
var warn$1;
|
7298 |
+
|
7299 |
+
// in some cases, the event used has to be determined at runtime
|
7300 |
+
// so we used some reserved tokens during compile.
|
7301 |
+
var RANGE_TOKEN = '__r';
|
7302 |
+
var CHECKBOX_RADIO_TOKEN = '__c';
|
7303 |
+
|
7304 |
+
function model (
|
7305 |
+
el,
|
7306 |
+
dir,
|
7307 |
+
_warn
|
7308 |
+
) {
|
7309 |
+
warn$1 = _warn;
|
7310 |
+
var value = dir.value;
|
7311 |
+
var modifiers = dir.modifiers;
|
7312 |
+
var tag = el.tag;
|
7313 |
+
var type = el.attrsMap.type;
|
7314 |
+
|
7315 |
+
{
|
7316 |
+
// inputs with type="file" are read only and setting the input's
|
7317 |
+
// value will throw an error.
|
7318 |
+
if (tag === 'input' && type === 'file') {
|
7319 |
+
warn$1(
|
7320 |
+
"<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
|
7321 |
+
"File inputs are read only. Use a v-on:change listener instead.",
|
7322 |
+
el.rawAttrsMap['v-model']
|
7323 |
+
);
|
7324 |
+
}
|
7325 |
+
}
|
7326 |
+
|
7327 |
+
if (el.component) {
|
7328 |
+
genComponentModel(el, value, modifiers);
|
7329 |
+
// component v-model doesn't need extra runtime
|
7330 |
+
return false
|
7331 |
+
} else if (tag === 'select') {
|
7332 |
+
genSelect(el, value, modifiers);
|
7333 |
+
} else if (tag === 'input' && type === 'checkbox') {
|
7334 |
+
genCheckboxModel(el, value, modifiers);
|
7335 |
+
} else if (tag === 'input' && type === 'radio') {
|
7336 |
+
genRadioModel(el, value, modifiers);
|
7337 |
+
} else if (tag === 'input' || tag === 'textarea') {
|
7338 |
+
genDefaultModel(el, value, modifiers);
|
7339 |
+
} else if (!config.isReservedTag(tag)) {
|
7340 |
+
genComponentModel(el, value, modifiers);
|
7341 |
+
// component v-model doesn't need extra runtime
|
7342 |
+
return false
|
7343 |
+
} else {
|
7344 |
+
warn$1(
|
7345 |
+
"<" + (el.tag) + " v-model=\"" + value + "\">: " +
|
7346 |
+
"v-model is not supported on this element type. " +
|
7347 |
+
'If you are working with contenteditable, it\'s recommended to ' +
|
7348 |
+
'wrap a library dedicated for that purpose inside a custom component.',
|
7349 |
+
el.rawAttrsMap['v-model']
|
7350 |
+
);
|
7351 |
+
}
|
7352 |
+
|
7353 |
+
// ensure runtime directive metadata
|
7354 |
+
return true
|
7355 |
+
}
|
7356 |
+
|
7357 |
+
function genCheckboxModel (
|
7358 |
+
el,
|
7359 |
+
value,
|
7360 |
+
modifiers
|
7361 |
+
) {
|
7362 |
+
var number = modifiers && modifiers.number;
|
7363 |
+
var valueBinding = getBindingAttr(el, 'value') || 'null';
|
7364 |
+
var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
|
7365 |
+
var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
|
7366 |
+
addProp(el, 'checked',
|
7367 |
+
"Array.isArray(" + value + ")" +
|
7368 |
+
"?_i(" + value + "," + valueBinding + ")>-1" + (
|
7369 |
+
trueValueBinding === 'true'
|
7370 |
+
? (":(" + value + ")")
|
7371 |
+
: (":_q(" + value + "," + trueValueBinding + ")")
|
7372 |
+
)
|
7373 |
+
);
|
7374 |
+
addHandler(el, 'change',
|
7375 |
+
"var $$a=" + value + "," +
|
7376 |
+
'$$el=$event.target,' +
|
7377 |
+
"$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
|
7378 |
+
'if(Array.isArray($$a)){' +
|
7379 |
+
"var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
|
7380 |
+
'$$i=_i($$a,$$v);' +
|
7381 |
+
"if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" +
|
7382 |
+
"else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" +
|
7383 |
+
"}else{" + (genAssignmentCode(value, '$$c')) + "}",
|
7384 |
+
null, true
|
7385 |
+
);
|
7386 |
+
}
|
7387 |
+
|
7388 |
+
function genRadioModel (
|
7389 |
+
el,
|
7390 |
+
value,
|
7391 |
+
modifiers
|
7392 |
+
) {
|
7393 |
+
var number = modifiers && modifiers.number;
|
7394 |
+
var valueBinding = getBindingAttr(el, 'value') || 'null';
|
7395 |
+
valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
|
7396 |
+
addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
|
7397 |
+
addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);
|
7398 |
+
}
|
7399 |
+
|
7400 |
+
function genSelect (
|
7401 |
+
el,
|
7402 |
+
value,
|
7403 |
+
modifiers
|
7404 |
+
) {
|
7405 |
+
var number = modifiers && modifiers.number;
|
7406 |
+
var selectedVal = "Array.prototype.filter" +
|
7407 |
+
".call($event.target.options,function(o){return o.selected})" +
|
7408 |
+
".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
|
7409 |
+
"return " + (number ? '_n(val)' : 'val') + "})";
|
7410 |
+
|
7411 |
+
var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
|
7412 |
+
var code = "var $$selectedVal = " + selectedVal + ";";
|
7413 |
+
code = code + " " + (genAssignmentCode(value, assignment));
|
7414 |
+
addHandler(el, 'change', code, null, true);
|
7415 |
+
}
|
7416 |
+
|
7417 |
+
function genDefaultModel (
|
7418 |
+
el,
|
7419 |
+
value,
|
7420 |
+
modifiers
|
7421 |
+
) {
|
7422 |
+
var type = el.attrsMap.type;
|
7423 |
+
|
7424 |
+
// warn if v-bind:value conflicts with v-model
|
7425 |
+
// except for inputs with v-bind:type
|
7426 |
+
{
|
7427 |
+
var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];
|
7428 |
+
var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
|
7429 |
+
if (value$1 && !typeBinding) {
|
7430 |
+
var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';
|
7431 |
+
warn$1(
|
7432 |
+
binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " +
|
7433 |
+
'because the latter already expands to a value binding internally',
|
7434 |
+
el.rawAttrsMap[binding]
|
7435 |
+
);
|
7436 |
+
}
|
7437 |
+
}
|
7438 |
+
|
7439 |
+
var ref = modifiers || {};
|
7440 |
+
var lazy = ref.lazy;
|
7441 |
+
var number = ref.number;
|
7442 |
+
var trim = ref.trim;
|
7443 |
+
var needCompositionGuard = !lazy && type !== 'range';
|
7444 |
+
var event = lazy
|
7445 |
+
? 'change'
|
7446 |
+
: type === 'range'
|
7447 |
+
? RANGE_TOKEN
|
7448 |
+
: 'input';
|
7449 |
+
|
7450 |
+
var valueExpression = '$event.target.value';
|
7451 |
+
if (trim) {
|
7452 |
+
valueExpression = "$event.target.value.trim()";
|
7453 |
+
}
|
7454 |
+
if (number) {
|
7455 |
+
valueExpression = "_n(" + valueExpression + ")";
|
7456 |
+
}
|
7457 |
+
|
7458 |
+
var code = genAssignmentCode(value, valueExpression);
|
7459 |
+
if (needCompositionGuard) {
|
7460 |
+
code = "if($event.target.composing)return;" + code;
|
7461 |
+
}
|
7462 |
+
|
7463 |
+
addProp(el, 'value', ("(" + value + ")"));
|
7464 |
+
addHandler(el, event, code, null, true);
|
7465 |
+
if (trim || number) {
|
7466 |
+
addHandler(el, 'blur', '$forceUpdate()');
|
7467 |
+
}
|
7468 |
+
}
|
7469 |
+
|
7470 |
+
/* */
|
7471 |
+
|
7472 |
+
// normalize v-model event tokens that can only be determined at runtime.
|
7473 |
+
// it's important to place the event as the first in the array because
|
7474 |
+
// the whole point is ensuring the v-model callback gets called before
|
7475 |
+
// user-attached handlers.
|
7476 |
+
function normalizeEvents (on) {
|
7477 |
+
/* istanbul ignore if */
|
7478 |
+
if (isDef(on[RANGE_TOKEN])) {
|
7479 |
+
// IE input[type=range] only supports `change` event
|
7480 |
+
var event = isIE ? 'change' : 'input';
|
7481 |
+
on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
|
7482 |
+
delete on[RANGE_TOKEN];
|
7483 |
+
}
|
7484 |
+
// This was originally intended to fix #4521 but no longer necessary
|
7485 |
+
// after 2.5. Keeping it for backwards compat with generated code from < 2.4
|
7486 |
+
/* istanbul ignore if */
|
7487 |
+
if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
|
7488 |
+
on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
|
7489 |
+
delete on[CHECKBOX_RADIO_TOKEN];
|
7490 |
+
}
|
7491 |
+
}
|
7492 |
+
|
7493 |
+
var target$1;
|
7494 |
+
|
7495 |
+
function createOnceHandler$1 (event, handler, capture) {
|
7496 |
+
var _target = target$1; // save current target element in closure
|
7497 |
+
return function onceHandler () {
|
7498 |
+
var res = handler.apply(null, arguments);
|
7499 |
+
if (res !== null) {
|
7500 |
+
remove$2(event, onceHandler, capture, _target);
|
7501 |
+
}
|
7502 |
+
}
|
7503 |
+
}
|
7504 |
+
|
7505 |
+
// #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
|
7506 |
+
// implementation and does not fire microtasks in between event propagation, so
|
7507 |
+
// safe to exclude.
|
7508 |
+
var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
|
7509 |
+
|
7510 |
+
function add$1 (
|
7511 |
+
name,
|
7512 |
+
handler,
|
7513 |
+
capture,
|
7514 |
+
passive
|
7515 |
+
) {
|
7516 |
+
// async edge case #6566: inner click event triggers patch, event handler
|
7517 |
+
// attached to outer element during patch, and triggered again. This
|
7518 |
+
// happens because browsers fire microtask ticks between event propagation.
|
7519 |
+
// the solution is simple: we save the timestamp when a handler is attached,
|
7520 |
+
// and the handler would only fire if the event passed to it was fired
|
7521 |
+
// AFTER it was attached.
|
7522 |
+
if (useMicrotaskFix) {
|
7523 |
+
var attachedTimestamp = currentFlushTimestamp;
|
7524 |
+
var original = handler;
|
7525 |
+
handler = original._wrapper = function (e) {
|
7526 |
+
if (
|
7527 |
+
// no bubbling, should always fire.
|
7528 |
+
// this is just a safety net in case event.timeStamp is unreliable in
|
7529 |
+
// certain weird environments...
|
7530 |
+
e.target === e.currentTarget ||
|
7531 |
+
// event is fired after handler attachment
|
7532 |
+
e.timeStamp >= attachedTimestamp ||
|
7533 |
+
// bail for environments that have buggy event.timeStamp implementations
|
7534 |
+
// #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
|
7535 |
+
// #9681 QtWebEngine event.timeStamp is negative value
|
7536 |
+
e.timeStamp <= 0 ||
|
7537 |
+
// #9448 bail if event is fired in another document in a multi-page
|
7538 |
+
// electron/nw.js app, since event.timeStamp will be using a different
|
7539 |
+
// starting reference
|
7540 |
+
e.target.ownerDocument !== document
|
7541 |
+
) {
|
7542 |
+
return original.apply(this, arguments)
|
7543 |
+
}
|
7544 |
+
};
|
7545 |
+
}
|
7546 |
+
target$1.addEventListener(
|
7547 |
+
name,
|
7548 |
+
handler,
|
7549 |
+
supportsPassive
|
7550 |
+
? { capture: capture, passive: passive }
|
7551 |
+
: capture
|
7552 |
+
);
|
7553 |
+
}
|
7554 |
+
|
7555 |
+
function remove$2 (
|
7556 |
+
name,
|
7557 |
+
handler,
|
7558 |
+
capture,
|
7559 |
+
_target
|
7560 |
+
) {
|
7561 |
+
(_target || target$1).removeEventListener(
|
7562 |
+
name,
|
7563 |
+
handler._wrapper || handler,
|
7564 |
+
capture
|
7565 |
+
);
|
7566 |
+
}
|
7567 |
+
|
7568 |
+
function updateDOMListeners (oldVnode, vnode) {
|
7569 |
+
if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
|
7570 |
+
return
|
7571 |
+
}
|
7572 |
+
var on = vnode.data.on || {};
|
7573 |
+
var oldOn = oldVnode.data.on || {};
|
7574 |
+
target$1 = vnode.elm;
|
7575 |
+
normalizeEvents(on);
|
7576 |
+
updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context);
|
7577 |
+
target$1 = undefined;
|
7578 |
+
}
|
7579 |
+
|
7580 |
+
var events = {
|
7581 |
+
create: updateDOMListeners,
|
7582 |
+
update: updateDOMListeners
|
7583 |
+
};
|
7584 |
+
|
7585 |
+
/* */
|
7586 |
+
|
7587 |
+
var svgContainer;
|
7588 |
+
|
7589 |
+
function updateDOMProps (oldVnode, vnode) {
|
7590 |
+
if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
|
7591 |
+
return
|
7592 |
+
}
|
7593 |
+
var key, cur;
|
7594 |
+
var elm = vnode.elm;
|
7595 |
+
var oldProps = oldVnode.data.domProps || {};
|
7596 |
+
var props = vnode.data.domProps || {};
|
7597 |
+
// clone observed objects, as the user probably wants to mutate it
|
7598 |
+
if (isDef(props.__ob__)) {
|
7599 |
+
props = vnode.data.domProps = extend({}, props);
|
7600 |
+
}
|
7601 |
+
|
7602 |
+
for (key in oldProps) {
|
7603 |
+
if (!(key in props)) {
|
7604 |
+
elm[key] = '';
|
7605 |
+
}
|
7606 |
+
}
|
7607 |
+
|
7608 |
+
for (key in props) {
|
7609 |
+
cur = props[key];
|
7610 |
+
// ignore children if the node has textContent or innerHTML,
|
7611 |
+
// as these will throw away existing DOM nodes and cause removal errors
|
7612 |
+
// on subsequent patches (#3360)
|
7613 |
+
if (key === 'textContent' || key === 'innerHTML') {
|
7614 |
+
if (vnode.children) { vnode.children.length = 0; }
|
7615 |
+
if (cur === oldProps[key]) { continue }
|
7616 |
+
// #6601 work around Chrome version <= 55 bug where single textNode
|
7617 |
+
// replaced by innerHTML/textContent retains its parentNode property
|
7618 |
+
if (elm.childNodes.length === 1) {
|
7619 |
+
elm.removeChild(elm.childNodes[0]);
|
7620 |
+
}
|
7621 |
+
}
|
7622 |
+
|
7623 |
+
if (key === 'value' && elm.tagName !== 'PROGRESS') {
|
7624 |
+
// store value as _value as well since
|
7625 |
+
// non-string values will be stringified
|
7626 |
+
elm._value = cur;
|
7627 |
+
// avoid resetting cursor position when value is the same
|
7628 |
+
var strCur = isUndef(cur) ? '' : String(cur);
|
7629 |
+
if (shouldUpdateValue(elm, strCur)) {
|
7630 |
+
elm.value = strCur;
|
7631 |
+
}
|
7632 |
+
} else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) {
|
7633 |
+
// IE doesn't support innerHTML for SVG elements
|
7634 |
+
svgContainer = svgContainer || document.createElement('div');
|
7635 |
+
svgContainer.innerHTML = "<svg>" + cur + "</svg>";
|
7636 |
+
var svg = svgContainer.firstChild;
|
7637 |
+
while (elm.firstChild) {
|
7638 |
+
elm.removeChild(elm.firstChild);
|
7639 |
+
}
|
7640 |
+
while (svg.firstChild) {
|
7641 |
+
elm.appendChild(svg.firstChild);
|
7642 |
+
}
|
7643 |
+
} else if (
|
7644 |
+
// skip the update if old and new VDOM state is the same.
|
7645 |
+
// `value` is handled separately because the DOM value may be temporarily
|
7646 |
+
// out of sync with VDOM state due to focus, composition and modifiers.
|
7647 |
+
// This #4521 by skipping the unnecesarry `checked` update.
|
7648 |
+
cur !== oldProps[key]
|
7649 |
+
) {
|
7650 |
+
// some property updates can throw
|
7651 |
+
// e.g. `value` on <progress> w/ non-finite value
|
7652 |
+
try {
|
7653 |
+
elm[key] = cur;
|
7654 |
+
} catch (e) {}
|
7655 |
+
}
|
7656 |
+
}
|
7657 |
+
}
|
7658 |
+
|
7659 |
+
// check platforms/web/util/attrs.js acceptValue
|
7660 |
+
|
7661 |
+
|
7662 |
+
function shouldUpdateValue (elm, checkVal) {
|
7663 |
+
return (!elm.composing && (
|
7664 |
+
elm.tagName === 'OPTION' ||
|
7665 |
+
isNotInFocusAndDirty(elm, checkVal) ||
|
7666 |
+
isDirtyWithModifiers(elm, checkVal)
|
7667 |
+
))
|
7668 |
+
}
|
7669 |
+
|
7670 |
+
function isNotInFocusAndDirty (elm, checkVal) {
|
7671 |
+
// return true when textbox (.number and .trim) loses focus and its value is
|
7672 |
+
// not equal to the updated value
|
7673 |
+
var notInFocus = true;
|
7674 |
+
// #6157
|
7675 |
+
// work around IE bug when accessing document.activeElement in an iframe
|
7676 |
+
try { notInFocus = document.activeElement !== elm; } catch (e) {}
|
7677 |
+
return notInFocus && elm.value !== checkVal
|
7678 |
+
}
|
7679 |
+
|
7680 |
+
function isDirtyWithModifiers (elm, newVal) {
|
7681 |
+
var value = elm.value;
|
7682 |
+
var modifiers = elm._vModifiers; // injected by v-model runtime
|
7683 |
+
if (isDef(modifiers)) {
|
7684 |
+
if (modifiers.number) {
|
7685 |
+
return toNumber(value) !== toNumber(newVal)
|
7686 |
+
}
|
7687 |
+
if (modifiers.trim) {
|
7688 |
+
return value.trim() !== newVal.trim()
|
7689 |
+
}
|
7690 |
+
}
|
7691 |
+
return value !== newVal
|
7692 |
+
}
|
7693 |
+
|
7694 |
+
var domProps = {
|
7695 |
+
create: updateDOMProps,
|
7696 |
+
update: updateDOMProps
|
7697 |
+
};
|
7698 |
+
|
7699 |
+
/* */
|
7700 |
+
|
7701 |
+
var parseStyleText = cached(function (cssText) {
|
7702 |
+
var res = {};
|
7703 |
+
var listDelimiter = /;(?![^(]*\))/g;
|
7704 |
+
var propertyDelimiter = /:(.+)/;
|
7705 |
+
cssText.split(listDelimiter).forEach(function (item) {
|
7706 |
+
if (item) {
|
7707 |
+
var tmp = item.split(propertyDelimiter);
|
7708 |
+
tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
|
7709 |
+
}
|
7710 |
+
});
|
7711 |
+
return res
|
7712 |
+
});
|
7713 |
+
|
7714 |
+
// merge static and dynamic style data on the same vnode
|
7715 |
+
function normalizeStyleData (data) {
|
7716 |
+
var style = normalizeStyleBinding(data.style);
|
7717 |
+
// static style is pre-processed into an object during compilation
|
7718 |
+
// and is always a fresh object, so it's safe to merge into it
|
7719 |
+
return data.staticStyle
|
7720 |
+
? extend(data.staticStyle, style)
|
7721 |
+
: style
|
7722 |
+
}
|
7723 |
+
|
7724 |
+
// normalize possible array / string values into Object
|
7725 |
+
function normalizeStyleBinding (bindingStyle) {
|
7726 |
+
if (Array.isArray(bindingStyle)) {
|
7727 |
+
return toObject(bindingStyle)
|
7728 |
+
}
|
7729 |
+
if (typeof bindingStyle === 'string') {
|
7730 |
+
return parseStyleText(bindingStyle)
|
7731 |
+
}
|
7732 |
+
return bindingStyle
|
7733 |
+
}
|
7734 |
+
|
7735 |
+
/**
|
7736 |
+
* parent component style should be after child's
|
7737 |
+
* so that parent component's style could override it
|
7738 |
+
*/
|
7739 |
+
function getStyle (vnode, checkChild) {
|
7740 |
+
var res = {};
|
7741 |
+
var styleData;
|
7742 |
+
|
7743 |
+
if (checkChild) {
|
7744 |
+
var childNode = vnode;
|
7745 |
+
while (childNode.componentInstance) {
|
7746 |
+
childNode = childNode.componentInstance._vnode;
|
7747 |
+
if (
|
7748 |
+
childNode && childNode.data &&
|
7749 |
+
(styleData = normalizeStyleData(childNode.data))
|
7750 |
+
) {
|
7751 |
+
extend(res, styleData);
|
7752 |
+
}
|
7753 |
+
}
|
7754 |
+
}
|
7755 |
+
|
7756 |
+
if ((styleData = normalizeStyleData(vnode.data))) {
|
7757 |
+
extend(res, styleData);
|
7758 |
+
}
|
7759 |
+
|
7760 |
+
var parentNode = vnode;
|
7761 |
+
while ((parentNode = parentNode.parent)) {
|
7762 |
+
if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
|
7763 |
+
extend(res, styleData);
|
7764 |
+
}
|
7765 |
+
}
|
7766 |
+
return res
|
7767 |
+
}
|
7768 |
+
|
7769 |
+
/* */
|
7770 |
+
|
7771 |
+
var cssVarRE = /^--/;
|
7772 |
+
var importantRE = /\s*!important$/;
|
7773 |
+
var setProp = function (el, name, val) {
|
7774 |
+
/* istanbul ignore if */
|
7775 |
+
if (cssVarRE.test(name)) {
|
7776 |
+
el.style.setProperty(name, val);
|
7777 |
+
} else if (importantRE.test(val)) {
|
7778 |
+
el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
|
7779 |
+
} else {
|
7780 |
+
var normalizedName = normalize(name);
|
7781 |
+
if (Array.isArray(val)) {
|
7782 |
+
// Support values array created by autoprefixer, e.g.
|
7783 |
+
// {display: ["-webkit-box", "-ms-flexbox", "flex"]}
|
7784 |
+
// Set them one by one, and the browser will only set those it can recognize
|
7785 |
+
for (var i = 0, len = val.length; i < len; i++) {
|
7786 |
+
el.style[normalizedName] = val[i];
|
7787 |
+
}
|
7788 |
+
} else {
|
7789 |
+
el.style[normalizedName] = val;
|
7790 |
+
}
|
7791 |
+
}
|
7792 |
+
};
|
7793 |
+
|
7794 |
+
var vendorNames = ['Webkit', 'Moz', 'ms'];
|
7795 |
+
|
7796 |
+
var emptyStyle;
|
7797 |
+
var normalize = cached(function (prop) {
|
7798 |
+
emptyStyle = emptyStyle || document.createElement('div').style;
|
7799 |
+
prop = camelize(prop);
|
7800 |
+
if (prop !== 'filter' && (prop in emptyStyle)) {
|
7801 |
+
return prop
|
7802 |
+
}
|
7803 |
+
var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
|
7804 |
+
for (var i = 0; i < vendorNames.length; i++) {
|
7805 |
+
var name = vendorNames[i] + capName;
|
7806 |
+
if (name in emptyStyle) {
|
7807 |
+
return name
|
7808 |
+
}
|
7809 |
+
}
|
7810 |
+
});
|
7811 |
+
|
7812 |
+
function updateStyle (oldVnode, vnode) {
|
7813 |
+
var data = vnode.data;
|
7814 |
+
var oldData = oldVnode.data;
|
7815 |
+
|
7816 |
+
if (isUndef(data.staticStyle) && isUndef(data.style) &&
|
7817 |
+
isUndef(oldData.staticStyle) && isUndef(oldData.style)
|
7818 |
+
) {
|
7819 |
+
return
|
7820 |
+
}
|
7821 |
+
|
7822 |
+
var cur, name;
|
7823 |
+
var el = vnode.elm;
|
7824 |
+
var oldStaticStyle = oldData.staticStyle;
|
7825 |
+
var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
|
7826 |
+
|
7827 |
+
// if static style exists, stylebinding already merged into it when doing normalizeStyleData
|
7828 |
+
var oldStyle = oldStaticStyle || oldStyleBinding;
|
7829 |
+
|
7830 |
+
var style = normalizeStyleBinding(vnode.data.style) || {};
|
7831 |
+
|
7832 |
+
// store normalized style under a different key for next diff
|
7833 |
+
// make sure to clone it if it's reactive, since the user likely wants
|
7834 |
+
// to mutate it.
|
7835 |
+
vnode.data.normalizedStyle = isDef(style.__ob__)
|
7836 |
+
? extend({}, style)
|
7837 |
+
: style;
|
7838 |
+
|
7839 |
+
var newStyle = getStyle(vnode, true);
|
7840 |
+
|
7841 |
+
for (name in oldStyle) {
|
7842 |
+
if (isUndef(newStyle[name])) {
|
7843 |
+
setProp(el, name, '');
|
7844 |
+
}
|
7845 |
+
}
|
7846 |
+
for (name in newStyle) {
|
7847 |
+
cur = newStyle[name];
|
7848 |
+
if (cur !== oldStyle[name]) {
|
7849 |
+
// ie9 setting to null has no effect, must use empty string
|
7850 |
+
setProp(el, name, cur == null ? '' : cur);
|
7851 |
+
}
|
7852 |
+
}
|
7853 |
+
}
|
7854 |
+
|
7855 |
+
var style = {
|
7856 |
+
create: updateStyle,
|
7857 |
+
update: updateStyle
|
7858 |
+
};
|
7859 |
+
|
7860 |
+
/* */
|
7861 |
+
|
7862 |
+
var whitespaceRE = /\s+/;
|
7863 |
+
|
7864 |
+
/**
|
7865 |
+
* Add class with compatibility for SVG since classList is not supported on
|
7866 |
+
* SVG elements in IE
|
7867 |
+
*/
|
7868 |
+
function addClass (el, cls) {
|
7869 |
+
/* istanbul ignore if */
|
7870 |
+
if (!cls || !(cls = cls.trim())) {
|
7871 |
+
return
|
7872 |
+
}
|
7873 |
+
|
7874 |
+
/* istanbul ignore else */
|
7875 |
+
if (el.classList) {
|
7876 |
+
if (cls.indexOf(' ') > -1) {
|
7877 |
+
cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });
|
7878 |
+
} else {
|
7879 |
+
el.classList.add(cls);
|
7880 |
+
}
|
7881 |
+
} else {
|
7882 |
+
var cur = " " + (el.getAttribute('class') || '') + " ";
|
7883 |
+
if (cur.indexOf(' ' + cls + ' ') < 0) {
|
7884 |
+
el.setAttribute('class', (cur + cls).trim());
|
7885 |
+
}
|
7886 |
+
}
|
7887 |
+
}
|
7888 |
+
|
7889 |
+
/**
|
7890 |
+
* Remove class with compatibility for SVG since classList is not supported on
|
7891 |
+
* SVG elements in IE
|
7892 |
+
*/
|
7893 |
+
function removeClass (el, cls) {
|
7894 |
+
/* istanbul ignore if */
|
7895 |
+
if (!cls || !(cls = cls.trim())) {
|
7896 |
+
return
|
7897 |
+
}
|
7898 |
+
|
7899 |
+
/* istanbul ignore else */
|
7900 |
+
if (el.classList) {
|
7901 |
+
if (cls.indexOf(' ') > -1) {
|
7902 |
+
cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });
|
7903 |
+
} else {
|
7904 |
+
el.classList.remove(cls);
|
7905 |
+
}
|
7906 |
+
if (!el.classList.length) {
|
7907 |
+
el.removeAttribute('class');
|
7908 |
+
}
|
7909 |
+
} else {
|
7910 |
+
var cur = " " + (el.getAttribute('class') || '') + " ";
|
7911 |
+
var tar = ' ' + cls + ' ';
|
7912 |
+
while (cur.indexOf(tar) >= 0) {
|
7913 |
+
cur = cur.replace(tar, ' ');
|
7914 |
+
}
|
7915 |
+
cur = cur.trim();
|
7916 |
+
if (cur) {
|
7917 |
+
el.setAttribute('class', cur);
|
7918 |
+
} else {
|
7919 |
+
el.removeAttribute('class');
|
7920 |
+
}
|
7921 |
+
}
|
7922 |
+
}
|
7923 |
+
|
7924 |
+
/* */
|
7925 |
+
|
7926 |
+
function resolveTransition (def$$1) {
|
7927 |
+
if (!def$$1) {
|
7928 |
+
return
|
7929 |
+
}
|
7930 |
+
/* istanbul ignore else */
|
7931 |
+
if (typeof def$$1 === 'object') {
|
7932 |
+
var res = {};
|
7933 |
+
if (def$$1.css !== false) {
|
7934 |
+
extend(res, autoCssTransition(def$$1.name || 'v'));
|
7935 |
+
}
|
7936 |
+
extend(res, def$$1);
|
7937 |
+
return res
|
7938 |
+
} else if (typeof def$$1 === 'string') {
|
7939 |
+
return autoCssTransition(def$$1)
|
7940 |
+
}
|
7941 |
+
}
|
7942 |
+
|
7943 |
+
var autoCssTransition = cached(function (name) {
|
7944 |
+
return {
|
7945 |
+
enterClass: (name + "-enter"),
|
7946 |
+
enterToClass: (name + "-enter-to"),
|
7947 |
+
enterActiveClass: (name + "-enter-active"),
|
7948 |
+
leaveClass: (name + "-leave"),
|
7949 |
+
leaveToClass: (name + "-leave-to"),
|
7950 |
+
leaveActiveClass: (name + "-leave-active")
|
7951 |
+
}
|
7952 |
+
});
|
7953 |
+
|
7954 |
+
var hasTransition = inBrowser && !isIE9;
|
7955 |
+
var TRANSITION = 'transition';
|
7956 |
+
var ANIMATION = 'animation';
|
7957 |
+
|
7958 |
+
// Transition property/event sniffing
|
7959 |
+
var transitionProp = 'transition';
|
7960 |
+
var transitionEndEvent = 'transitionend';
|
7961 |
+
var animationProp = 'animation';
|
7962 |
+
var animationEndEvent = 'animationend';
|
7963 |
+
if (hasTransition) {
|
7964 |
+
/* istanbul ignore if */
|
7965 |
+
if (window.ontransitionend === undefined &&
|
7966 |
+
window.onwebkittransitionend !== undefined
|
7967 |
+
) {
|
7968 |
+
transitionProp = 'WebkitTransition';
|
7969 |
+
transitionEndEvent = 'webkitTransitionEnd';
|
7970 |
+
}
|
7971 |
+
if (window.onanimationend === undefined &&
|
7972 |
+
window.onwebkitanimationend !== undefined
|
7973 |
+
) {
|
7974 |
+
animationProp = 'WebkitAnimation';
|
7975 |
+
animationEndEvent = 'webkitAnimationEnd';
|
7976 |
+
}
|
7977 |
+
}
|
7978 |
+
|
7979 |
+
// binding to window is necessary to make hot reload work in IE in strict mode
|
7980 |
+
var raf = inBrowser
|
7981 |
+
? window.requestAnimationFrame
|
7982 |
+
? window.requestAnimationFrame.bind(window)
|
7983 |
+
: setTimeout
|
7984 |
+
: /* istanbul ignore next */ function (fn) { return fn(); };
|
7985 |
+
|
7986 |
+
function nextFrame (fn) {
|
7987 |
+
raf(function () {
|
7988 |
+
raf(fn);
|
7989 |
+
});
|
7990 |
+
}
|
7991 |
+
|
7992 |
+
function addTransitionClass (el, cls) {
|
7993 |
+
var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
|
7994 |
+
if (transitionClasses.indexOf(cls) < 0) {
|
7995 |
+
transitionClasses.push(cls);
|
7996 |
+
addClass(el, cls);
|
7997 |
+
}
|
7998 |
+
}
|
7999 |
+
|
8000 |
+
function removeTransitionClass (el, cls) {
|
8001 |
+
if (el._transitionClasses) {
|
8002 |
+
remove(el._transitionClasses, cls);
|
8003 |
+
}
|
8004 |
+
removeClass(el, cls);
|
8005 |
+
}
|
8006 |
+
|
8007 |
+
function whenTransitionEnds (
|
8008 |
+
el,
|
8009 |
+
expectedType,
|
8010 |
+
cb
|
8011 |
+
) {
|
8012 |
+
var ref = getTransitionInfo(el, expectedType);
|
8013 |
+
var type = ref.type;
|
8014 |
+
var timeout = ref.timeout;
|
8015 |
+
var propCount = ref.propCount;
|
8016 |
+
if (!type) { return cb() }
|
8017 |
+
var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
|
8018 |
+
var ended = 0;
|
8019 |
+
var end = function () {
|
8020 |
+
el.removeEventListener(event, onEnd);
|
8021 |
+
cb();
|
8022 |
+
};
|
8023 |
+
var onEnd = function (e) {
|
8024 |
+
if (e.target === el) {
|
8025 |
+
if (++ended >= propCount) {
|
8026 |
+
end();
|
8027 |
+
}
|
8028 |
+
}
|
8029 |
+
};
|
8030 |
+
setTimeout(function () {
|
8031 |
+
if (ended < propCount) {
|
8032 |
+
end();
|
8033 |
+
}
|
8034 |
+
}, timeout + 1);
|
8035 |
+
el.addEventListener(event, onEnd);
|
8036 |
+
}
|
8037 |
+
|
8038 |
+
var transformRE = /\b(transform|all)(,|$)/;
|
8039 |
+
|
8040 |
+
function getTransitionInfo (el, expectedType) {
|
8041 |
+
var styles = window.getComputedStyle(el);
|
8042 |
+
// JSDOM may return undefined for transition properties
|
8043 |
+
var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
|
8044 |
+
var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
|
8045 |
+
var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
|
8046 |
+
var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
|
8047 |
+
var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
|
8048 |
+
var animationTimeout = getTimeout(animationDelays, animationDurations);
|
8049 |
+
|
8050 |
+
var type;
|
8051 |
+
var timeout = 0;
|
8052 |
+
var propCount = 0;
|
8053 |
+
/* istanbul ignore if */
|
8054 |
+
if (expectedType === TRANSITION) {
|
8055 |
+
if (transitionTimeout > 0) {
|
8056 |
+
type = TRANSITION;
|
8057 |
+
timeout = transitionTimeout;
|
8058 |
+
propCount = transitionDurations.length;
|
8059 |
+
}
|
8060 |
+
} else if (expectedType === ANIMATION) {
|
8061 |
+
if (animationTimeout > 0) {
|
8062 |
+
type = ANIMATION;
|
8063 |
+
timeout = animationTimeout;
|
8064 |
+
propCount = animationDurations.length;
|
8065 |
+
}
|
8066 |
+
} else {
|
8067 |
+
timeout = Math.max(transitionTimeout, animationTimeout);
|
8068 |
+
type = timeout > 0
|
8069 |
+
? transitionTimeout > animationTimeout
|
8070 |
+
? TRANSITION
|
8071 |
+
: ANIMATION
|
8072 |
+
: null;
|
8073 |
+
propCount = type
|
8074 |
+
? type === TRANSITION
|
8075 |
+
? transitionDurations.length
|
8076 |
+
: animationDurations.length
|
8077 |
+
: 0;
|
8078 |
+
}
|
8079 |
+
var hasTransform =
|
8080 |
+
type === TRANSITION &&
|
8081 |
+
transformRE.test(styles[transitionProp + 'Property']);
|
8082 |
+
return {
|
8083 |
+
type: type,
|
8084 |
+
timeout: timeout,
|
8085 |
+
propCount: propCount,
|
8086 |
+
hasTransform: hasTransform
|
8087 |
+
}
|
8088 |
+
}
|
8089 |
+
|
8090 |
+
function getTimeout (delays, durations) {
|
8091 |
+
/* istanbul ignore next */
|
8092 |
+
while (delays.length < durations.length) {
|
8093 |
+
delays = delays.concat(delays);
|
8094 |
+
}
|
8095 |
+
|
8096 |
+
return Math.max.apply(null, durations.map(function (d, i) {
|
8097 |
+
return toMs(d) + toMs(delays[i])
|
8098 |
+
}))
|
8099 |
+
}
|
8100 |
+
|
8101 |
+
// Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
|
8102 |
+
// in a locale-dependent way, using a comma instead of a dot.
|
8103 |
+
// If comma is not replaced with a dot, the input will be rounded down (i.e. acting
|
8104 |
+
// as a floor function) causing unexpected behaviors
|
8105 |
+
function toMs (s) {
|
8106 |
+
return Number(s.slice(0, -1).replace(',', '.')) * 1000
|
8107 |
+
}
|
8108 |
+
|
8109 |
+
/* */
|
8110 |
+
|
8111 |
+
function enter (vnode, toggleDisplay) {
|
8112 |
+
var el = vnode.elm;
|
8113 |
+
|
8114 |
+
// call leave callback now
|
8115 |
+
if (isDef(el._leaveCb)) {
|
8116 |
+
el._leaveCb.cancelled = true;
|
8117 |
+
el._leaveCb();
|
8118 |
+
}
|
8119 |
+
|
8120 |
+
var data = resolveTransition(vnode.data.transition);
|
8121 |
+
if (isUndef(data)) {
|
8122 |
+
return
|
8123 |
+
}
|
8124 |
+
|
8125 |
+
/* istanbul ignore if */
|
8126 |
+
if (isDef(el._enterCb) || el.nodeType !== 1) {
|
8127 |
+
return
|
8128 |
+
}
|
8129 |
+
|
8130 |
+
var css = data.css;
|
8131 |
+
var type = data.type;
|
8132 |
+
var enterClass = data.enterClass;
|
8133 |
+
var enterToClass = data.enterToClass;
|
8134 |
+
var enterActiveClass = data.enterActiveClass;
|
8135 |
+
var appearClass = data.appearClass;
|
8136 |
+
var appearToClass = data.appearToClass;
|
8137 |
+
var appearActiveClass = data.appearActiveClass;
|
8138 |
+
var beforeEnter = data.beforeEnter;
|
8139 |
+
var enter = data.enter;
|
8140 |
+
var afterEnter = data.afterEnter;
|
8141 |
+
var enterCancelled = data.enterCancelled;
|
8142 |
+
var beforeAppear = data.beforeAppear;
|
8143 |
+
var appear = data.appear;
|
8144 |
+
var afterAppear = data.afterAppear;
|
8145 |
+
var appearCancelled = data.appearCancelled;
|
8146 |
+
var duration = data.duration;
|
8147 |
+
|
8148 |
+
// activeInstance will always be the <transition> component managing this
|
8149 |
+
// transition. One edge case to check is when the <transition> is placed
|
8150 |
+
// as the root node of a child component. In that case we need to check
|
8151 |
+
// <transition>'s parent for appear check.
|
8152 |
+
var context = activeInstance;
|
8153 |
+
var transitionNode = activeInstance.$vnode;
|
8154 |
+
while (transitionNode && transitionNode.parent) {
|
8155 |
+
context = transitionNode.context;
|
8156 |
+
transitionNode = transitionNode.parent;
|
8157 |
+
}
|
8158 |
+
|
8159 |
+
var isAppear = !context._isMounted || !vnode.isRootInsert;
|
8160 |
+
|
8161 |
+
if (isAppear && !appear && appear !== '') {
|
8162 |
+
return
|
8163 |
+
}
|
8164 |
+
|
8165 |
+
var startClass = isAppear && appearClass
|
8166 |
+
? appearClass
|
8167 |
+
: enterClass;
|
8168 |
+
var activeClass = isAppear && appearActiveClass
|
8169 |
+
? appearActiveClass
|
8170 |
+
: enterActiveClass;
|
8171 |
+
var toClass = isAppear && appearToClass
|
8172 |
+
? appearToClass
|
8173 |
+
: enterToClass;
|
8174 |
+
|
8175 |
+
var beforeEnterHook = isAppear
|
8176 |
+
? (beforeAppear || beforeEnter)
|
8177 |
+
: beforeEnter;
|
8178 |
+
var enterHook = isAppear
|
8179 |
+
? (typeof appear === 'function' ? appear : enter)
|
8180 |
+
: enter;
|
8181 |
+
var afterEnterHook = isAppear
|
8182 |
+
? (afterAppear || afterEnter)
|
8183 |
+
: afterEnter;
|
8184 |
+
var enterCancelledHook = isAppear
|
8185 |
+
? (appearCancelled || enterCancelled)
|
8186 |
+
: enterCancelled;
|
8187 |
+
|
8188 |
+
var explicitEnterDuration = toNumber(
|
8189 |
+
isObject(duration)
|
8190 |
+
? duration.enter
|
8191 |
+
: duration
|
8192 |
+
);
|
8193 |
+
|
8194 |
+
if (explicitEnterDuration != null) {
|
8195 |
+
checkDuration(explicitEnterDuration, 'enter', vnode);
|
8196 |
+
}
|
8197 |
+
|
8198 |
+
var expectsCSS = css !== false && !isIE9;
|
8199 |
+
var userWantsControl = getHookArgumentsLength(enterHook);
|
8200 |
+
|
8201 |
+
var cb = el._enterCb = once(function () {
|
8202 |
+
if (expectsCSS) {
|
8203 |
+
removeTransitionClass(el, toClass);
|
8204 |
+
removeTransitionClass(el, activeClass);
|
8205 |
+
}
|
8206 |
+
if (cb.cancelled) {
|
8207 |
+
if (expectsCSS) {
|
8208 |
+
removeTransitionClass(el, startClass);
|
8209 |
+
}
|
8210 |
+
enterCancelledHook && enterCancelledHook(el);
|
8211 |
+
} else {
|
8212 |
+
afterEnterHook && afterEnterHook(el);
|
8213 |
+
}
|
8214 |
+
el._enterCb = null;
|
8215 |
+
});
|
8216 |
+
|
8217 |
+
if (!vnode.data.show) {
|
8218 |
+
// remove pending leave element on enter by injecting an insert hook
|
8219 |
+
mergeVNodeHook(vnode, 'insert', function () {
|
8220 |
+
var parent = el.parentNode;
|
8221 |
+
var pendingNode = parent && parent._pending && parent._pending[vnode.key];
|
8222 |
+
if (pendingNode &&
|
8223 |
+
pendingNode.tag === vnode.tag &&
|
8224 |
+
pendingNode.elm._leaveCb
|
8225 |
+
) {
|
8226 |
+
pendingNode.elm._leaveCb();
|
8227 |
+
}
|
8228 |
+
enterHook && enterHook(el, cb);
|
8229 |
+
});
|
8230 |
+
}
|
8231 |
+
|
8232 |
+
// start enter transition
|
8233 |
+
beforeEnterHook && beforeEnterHook(el);
|
8234 |
+
if (expectsCSS) {
|
8235 |
+
addTransitionClass(el, startClass);
|
8236 |
+
addTransitionClass(el, activeClass);
|
8237 |
+
nextFrame(function () {
|
8238 |
+
removeTransitionClass(el, startClass);
|
8239 |
+
if (!cb.cancelled) {
|
8240 |
+
addTransitionClass(el, toClass);
|
8241 |
+
if (!userWantsControl) {
|
8242 |
+
if (isValidDuration(explicitEnterDuration)) {
|
8243 |
+
setTimeout(cb, explicitEnterDuration);
|
8244 |
+
} else {
|
8245 |
+
whenTransitionEnds(el, type, cb);
|
8246 |
+
}
|
8247 |
+
}
|
8248 |
+
}
|
8249 |
+
});
|
8250 |
+
}
|
8251 |
+
|
8252 |
+
if (vnode.data.show) {
|
8253 |
+
toggleDisplay && toggleDisplay();
|
8254 |
+
enterHook && enterHook(el, cb);
|
8255 |
+
}
|
8256 |
+
|
8257 |
+
if (!expectsCSS && !userWantsControl) {
|
8258 |
+
cb();
|
8259 |
+
}
|
8260 |
+
}
|
8261 |
+
|
8262 |
+
function leave (vnode, rm) {
|
8263 |
+
var el = vnode.elm;
|
8264 |
+
|
8265 |
+
// call enter callback now
|
8266 |
+
if (isDef(el._enterCb)) {
|
8267 |
+
el._enterCb.cancelled = true;
|
8268 |
+
el._enterCb();
|
8269 |
+
}
|
8270 |
+
|
8271 |
+
var data = resolveTransition(vnode.data.transition);
|
8272 |
+
if (isUndef(data) || el.nodeType !== 1) {
|
8273 |
+
return rm()
|
8274 |
+
}
|
8275 |
+
|
8276 |
+
/* istanbul ignore if */
|
8277 |
+
if (isDef(el._leaveCb)) {
|
8278 |
+
return
|
8279 |
+
}
|
8280 |
+
|
8281 |
+
var css = data.css;
|
8282 |
+
var type = data.type;
|
8283 |
+
var leaveClass = data.leaveClass;
|
8284 |
+
var leaveToClass = data.leaveToClass;
|
8285 |
+
var leaveActiveClass = data.leaveActiveClass;
|
8286 |
+
var beforeLeave = data.beforeLeave;
|
8287 |
+
var leave = data.leave;
|
8288 |
+
var afterLeave = data.afterLeave;
|
8289 |
+
var leaveCancelled = data.leaveCancelled;
|
8290 |
+
var delayLeave = data.delayLeave;
|
8291 |
+
var duration = data.duration;
|
8292 |
+
|
8293 |
+
var expectsCSS = css !== false && !isIE9;
|
8294 |
+
var userWantsControl = getHookArgumentsLength(leave);
|
8295 |
+
|
8296 |
+
var explicitLeaveDuration = toNumber(
|
8297 |
+
isObject(duration)
|
8298 |
+
? duration.leave
|
8299 |
+
: duration
|
8300 |
+
);
|
8301 |
+
|
8302 |
+
if (isDef(explicitLeaveDuration)) {
|
8303 |
+
checkDuration(explicitLeaveDuration, 'leave', vnode);
|
8304 |
+
}
|
8305 |
+
|
8306 |
+
var cb = el._leaveCb = once(function () {
|
8307 |
+
if (el.parentNode && el.parentNode._pending) {
|
8308 |
+
el.parentNode._pending[vnode.key] = null;
|
8309 |
+
}
|
8310 |
+
if (expectsCSS) {
|
8311 |
+
removeTransitionClass(el, leaveToClass);
|
8312 |
+
removeTransitionClass(el, leaveActiveClass);
|
8313 |
+
}
|
8314 |
+
if (cb.cancelled) {
|
8315 |
+
if (expectsCSS) {
|
8316 |
+
removeTransitionClass(el, leaveClass);
|
8317 |
+
}
|
8318 |
+
leaveCancelled && leaveCancelled(el);
|
8319 |
+
} else {
|
8320 |
+
rm();
|
8321 |
+
afterLeave && afterLeave(el);
|
8322 |
+
}
|
8323 |
+
el._leaveCb = null;
|
8324 |
+
});
|
8325 |
+
|
8326 |
+
if (delayLeave) {
|
8327 |
+
delayLeave(performLeave);
|
8328 |
+
} else {
|
8329 |
+
performLeave();
|
8330 |
+
}
|
8331 |
+
|
8332 |
+
function performLeave () {
|
8333 |
+
// the delayed leave may have already been cancelled
|
8334 |
+
if (cb.cancelled) {
|
8335 |
+
return
|
8336 |
+
}
|
8337 |
+
// record leaving element
|
8338 |
+
if (!vnode.data.show && el.parentNode) {
|
8339 |
+
(el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;
|
8340 |
+
}
|
8341 |
+
beforeLeave && beforeLeave(el);
|
8342 |
+
if (expectsCSS) {
|
8343 |
+
addTransitionClass(el, leaveClass);
|
8344 |
+
addTransitionClass(el, leaveActiveClass);
|
8345 |
+
nextFrame(function () {
|
8346 |
+
removeTransitionClass(el, leaveClass);
|
8347 |
+
if (!cb.cancelled) {
|
8348 |
+
addTransitionClass(el, leaveToClass);
|
8349 |
+
if (!userWantsControl) {
|
8350 |
+
if (isValidDuration(explicitLeaveDuration)) {
|
8351 |
+
setTimeout(cb, explicitLeaveDuration);
|
8352 |
+
} else {
|
8353 |
+
whenTransitionEnds(el, type, cb);
|
8354 |
+
}
|
8355 |
+
}
|
8356 |
+
}
|
8357 |
+
});
|
8358 |
+
}
|
8359 |
+
leave && leave(el, cb);
|
8360 |
+
if (!expectsCSS && !userWantsControl) {
|
8361 |
+
cb();
|
8362 |
+
}
|
8363 |
+
}
|
8364 |
+
}
|
8365 |
+
|
8366 |
+
// only used in dev mode
|
8367 |
+
function checkDuration (val, name, vnode) {
|
8368 |
+
if (typeof val !== 'number') {
|
8369 |
+
warn(
|
8370 |
+
"<transition> explicit " + name + " duration is not a valid number - " +
|
8371 |
+
"got " + (JSON.stringify(val)) + ".",
|
8372 |
+
vnode.context
|
8373 |
+
);
|
8374 |
+
} else if (isNaN(val)) {
|
8375 |
+
warn(
|
8376 |
+
"<transition> explicit " + name + " duration is NaN - " +
|
8377 |
+
'the duration expression might be incorrect.',
|
8378 |
+
vnode.context
|
8379 |
+
);
|
8380 |
+
}
|
8381 |
+
}
|
8382 |
+
|
8383 |
+
function isValidDuration (val) {
|
8384 |
+
return typeof val === 'number' && !isNaN(val)
|
8385 |
+
}
|
8386 |
+
|
8387 |
+
/**
|
8388 |
+
* Normalize a transition hook's argument length. The hook may be:
|
8389 |
+
* - a merged hook (invoker) with the original in .fns
|
8390 |
+
* - a wrapped component method (check ._length)
|
8391 |
+
* - a plain function (.length)
|
8392 |
+
*/
|
8393 |
+
function getHookArgumentsLength (fn) {
|
8394 |
+
if (isUndef(fn)) {
|
8395 |
+
return false
|
8396 |
+
}
|
8397 |
+
var invokerFns = fn.fns;
|
8398 |
+
if (isDef(invokerFns)) {
|
8399 |
+
// invoker
|
8400 |
+
return getHookArgumentsLength(
|
8401 |
+
Array.isArray(invokerFns)
|
8402 |
+
? invokerFns[0]
|
8403 |
+
: invokerFns
|
8404 |
+
)
|
8405 |
+
} else {
|
8406 |
+
return (fn._length || fn.length) > 1
|
8407 |
+
}
|
8408 |
+
}
|
8409 |
+
|
8410 |
+
function _enter (_, vnode) {
|
8411 |
+
if (vnode.data.show !== true) {
|
8412 |
+
enter(vnode);
|
8413 |
+
}
|
8414 |
+
}
|
8415 |
+
|
8416 |
+
var transition = inBrowser ? {
|
8417 |
+
create: _enter,
|
8418 |
+
activate: _enter,
|
8419 |
+
remove: function remove$$1 (vnode, rm) {
|
8420 |
+
/* istanbul ignore else */
|
8421 |
+
if (vnode.data.show !== true) {
|
8422 |
+
leave(vnode, rm);
|
8423 |
+
} else {
|
8424 |
+
rm();
|
8425 |
+
}
|
8426 |
+
}
|
8427 |
+
} : {};
|
8428 |
+
|
8429 |
+
var platformModules = [
|
8430 |
+
attrs,
|
8431 |
+
klass,
|
8432 |
+
events,
|
8433 |
+
domProps,
|
8434 |
+
style,
|
8435 |
+
transition
|
8436 |
+
];
|
8437 |
+
|
8438 |
+
/* */
|
8439 |
+
|
8440 |
+
// the directive module should be applied last, after all
|
8441 |
+
// built-in modules have been applied.
|
8442 |
+
var modules = platformModules.concat(baseModules);
|
8443 |
+
|
8444 |
+
var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
|
8445 |
+
|
8446 |
+
/**
|
8447 |
+
* Not type checking this file because flow doesn't like attaching
|
8448 |
+
* properties to Elements.
|
8449 |
+
*/
|
8450 |
+
|
8451 |
+
/* istanbul ignore if */
|
8452 |
+
if (isIE9) {
|
8453 |
+
// http://www.matts411.com/post/internet-explorer-9-oninput/
|
8454 |
+
document.addEventListener('selectionchange', function () {
|
8455 |
+
var el = document.activeElement;
|
8456 |
+
if (el && el.vmodel) {
|
8457 |
+
trigger(el, 'input');
|
8458 |
+
}
|
8459 |
+
});
|
8460 |
+
}
|
8461 |
+
|
8462 |
+
var directive = {
|
8463 |
+
inserted: function inserted (el, binding, vnode, oldVnode) {
|
8464 |
+
if (vnode.tag === 'select') {
|
8465 |
+
// #6903
|
8466 |
+
if (oldVnode.elm && !oldVnode.elm._vOptions) {
|
8467 |
+
mergeVNodeHook(vnode, 'postpatch', function () {
|
8468 |
+
directive.componentUpdated(el, binding, vnode);
|
8469 |
+
});
|
8470 |
+
} else {
|
8471 |
+
setSelected(el, binding, vnode.context);
|
8472 |
+
}
|
8473 |
+
el._vOptions = [].map.call(el.options, getValue);
|
8474 |
+
} else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
|
8475 |
+
el._vModifiers = binding.modifiers;
|
8476 |
+
if (!binding.modifiers.lazy) {
|
8477 |
+
el.addEventListener('compositionstart', onCompositionStart);
|
8478 |
+
el.addEventListener('compositionend', onCompositionEnd);
|
8479 |
+
// Safari < 10.2 & UIWebView doesn't fire compositionend when
|
8480 |
+
// switching focus before confirming composition choice
|
8481 |
+
// this also fixes the issue where some browsers e.g. iOS Chrome
|
8482 |
+
// fires "change" instead of "input" on autocomplete.
|
8483 |
+
el.addEventListener('change', onCompositionEnd);
|
8484 |
+
/* istanbul ignore if */
|
8485 |
+
if (isIE9) {
|
8486 |
+
el.vmodel = true;
|
8487 |
+
}
|
8488 |
+
}
|
8489 |
+
}
|
8490 |
+
},
|
8491 |
+
|
8492 |
+
componentUpdated: function componentUpdated (el, binding, vnode) {
|
8493 |
+
if (vnode.tag === 'select') {
|
8494 |
+
setSelected(el, binding, vnode.context);
|
8495 |
+
// in case the options rendered by v-for have changed,
|
8496 |
+
// it's possible that the value is out-of-sync with the rendered options.
|
8497 |
+
// detect such cases and filter out values that no longer has a matching
|
8498 |
+
// option in the DOM.
|
8499 |
+
var prevOptions = el._vOptions;
|
8500 |
+
var curOptions = el._vOptions = [].map.call(el.options, getValue);
|
8501 |
+
if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) {
|
8502 |
+
// trigger change event if
|
8503 |
+
// no matching option found for at least one value
|
8504 |
+
var needReset = el.multiple
|
8505 |
+
? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); })
|
8506 |
+
: binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);
|
8507 |
+
if (needReset) {
|
8508 |
+
trigger(el, 'change');
|
8509 |
+
}
|
8510 |
+
}
|
8511 |
+
}
|
8512 |
+
}
|
8513 |
+
};
|
8514 |
+
|
8515 |
+
function setSelected (el, binding, vm) {
|
8516 |
+
actuallySetSelected(el, binding, vm);
|
8517 |
+
/* istanbul ignore if */
|
8518 |
+
if (isIE || isEdge) {
|
8519 |
+
setTimeout(function () {
|
8520 |
+
actuallySetSelected(el, binding, vm);
|
8521 |
+
}, 0);
|
8522 |
+
}
|
8523 |
+
}
|
8524 |
+
|
8525 |
+
function actuallySetSelected (el, binding, vm) {
|
8526 |
+
var value = binding.value;
|
8527 |
+
var isMultiple = el.multiple;
|
8528 |
+
if (isMultiple && !Array.isArray(value)) {
|
8529 |
+
warn(
|
8530 |
+
"<select multiple v-model=\"" + (binding.expression) + "\"> " +
|
8531 |
+
"expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
|
8532 |
+
vm
|
8533 |
+
);
|
8534 |
+
return
|
8535 |
+
}
|
8536 |
+
var selected, option;
|
8537 |
+
for (var i = 0, l = el.options.length; i < l; i++) {
|
8538 |
+
option = el.options[i];
|
8539 |
+
if (isMultiple) {
|
8540 |
+
selected = looseIndexOf(value, getValue(option)) > -1;
|
8541 |
+
if (option.selected !== selected) {
|
8542 |
+
option.selected = selected;
|
8543 |
+
}
|
8544 |
+
} else {
|
8545 |
+
if (looseEqual(getValue(option), value)) {
|
8546 |
+
if (el.selectedIndex !== i) {
|
8547 |
+
el.selectedIndex = i;
|
8548 |
+
}
|
8549 |
+
return
|
8550 |
+
}
|
8551 |
+
}
|
8552 |
+
}
|
8553 |
+
if (!isMultiple) {
|
8554 |
+
el.selectedIndex = -1;
|
8555 |
+
}
|
8556 |
+
}
|
8557 |
+
|
8558 |
+
function hasNoMatchingOption (value, options) {
|
8559 |
+
return options.every(function (o) { return !looseEqual(o, value); })
|
8560 |
+
}
|
8561 |
+
|
8562 |
+
function getValue (option) {
|
8563 |
+
return '_value' in option
|
8564 |
+
? option._value
|
8565 |
+
: option.value
|
8566 |
+
}
|
8567 |
+
|
8568 |
+
function onCompositionStart (e) {
|
8569 |
+
e.target.composing = true;
|
8570 |
+
}
|
8571 |
+
|
8572 |
+
function onCompositionEnd (e) {
|
8573 |
+
// prevent triggering an input event for no reason
|
8574 |
+
if (!e.target.composing) { return }
|
8575 |
+
e.target.composing = false;
|
8576 |
+
trigger(e.target, 'input');
|
8577 |
+
}
|
8578 |
+
|
8579 |
+
function trigger (el, type) {
|
8580 |
+
var e = document.createEvent('HTMLEvents');
|
8581 |
+
e.initEvent(type, true, true);
|
8582 |
+
el.dispatchEvent(e);
|
8583 |
+
}
|
8584 |
+
|
8585 |
+
/* */
|
8586 |
+
|
8587 |
+
// recursively search for possible transition defined inside the component root
|
8588 |
+
function locateNode (vnode) {
|
8589 |
+
return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
|
8590 |
+
? locateNode(vnode.componentInstance._vnode)
|
8591 |
+
: vnode
|
8592 |
+
}
|
8593 |
+
|
8594 |
+
var show = {
|
8595 |
+
bind: function bind (el, ref, vnode) {
|
8596 |
+
var value = ref.value;
|
8597 |
+
|
8598 |
+
vnode = locateNode(vnode);
|
8599 |
+
var transition$$1 = vnode.data && vnode.data.transition;
|
8600 |
+
var originalDisplay = el.__vOriginalDisplay =
|
8601 |
+
el.style.display === 'none' ? '' : el.style.display;
|
8602 |
+
if (value && transition$$1) {
|
8603 |
+
vnode.data.show = true;
|
8604 |
+
enter(vnode, function () {
|
8605 |
+
el.style.display = originalDisplay;
|
8606 |
+
});
|
8607 |
+
} else {
|
8608 |
+
el.style.display = value ? originalDisplay : 'none';
|
8609 |
+
}
|
8610 |
+
},
|
8611 |
+
|
8612 |
+
update: function update (el, ref, vnode) {
|
8613 |
+
var value = ref.value;
|
8614 |
+
var oldValue = ref.oldValue;
|
8615 |
+
|
8616 |
+
/* istanbul ignore if */
|
8617 |
+
if (!value === !oldValue) { return }
|
8618 |
+
vnode = locateNode(vnode);
|
8619 |
+
var transition$$1 = vnode.data && vnode.data.transition;
|
8620 |
+
if (transition$$1) {
|
8621 |
+
vnode.data.show = true;
|
8622 |
+
if (value) {
|
8623 |
+
enter(vnode, function () {
|
8624 |
+
el.style.display = el.__vOriginalDisplay;
|
8625 |
+
});
|
8626 |
+
} else {
|
8627 |
+
leave(vnode, function () {
|
8628 |
+
el.style.display = 'none';
|
8629 |
+
});
|
8630 |
+
}
|
8631 |
+
} else {
|
8632 |
+
el.style.display = value ? el.__vOriginalDisplay : 'none';
|
8633 |
+
}
|
8634 |
+
},
|
8635 |
+
|
8636 |
+
unbind: function unbind (
|
8637 |
+
el,
|
8638 |
+
binding,
|
8639 |
+
vnode,
|
8640 |
+
oldVnode,
|
8641 |
+
isDestroy
|
8642 |
+
) {
|
8643 |
+
if (!isDestroy) {
|
8644 |
+
el.style.display = el.__vOriginalDisplay;
|
8645 |
+
}
|
8646 |
+
}
|
8647 |
+
};
|
8648 |
+
|
8649 |
+
var platformDirectives = {
|
8650 |
+
model: directive,
|
8651 |
+
show: show
|
8652 |
+
};
|
8653 |
+
|
8654 |
+
/* */
|
8655 |
+
|
8656 |
+
var transitionProps = {
|
8657 |
+
name: String,
|
8658 |
+
appear: Boolean,
|
8659 |
+
css: Boolean,
|
8660 |
+
mode: String,
|
8661 |
+
type: String,
|
8662 |
+
enterClass: String,
|
8663 |
+
leaveClass: String,
|
8664 |
+
enterToClass: String,
|
8665 |
+
leaveToClass: String,
|
8666 |
+
enterActiveClass: String,
|
8667 |
+
leaveActiveClass: String,
|
8668 |
+
appearClass: String,
|
8669 |
+
appearActiveClass: String,
|
8670 |
+
appearToClass: String,
|
8671 |
+
duration: [Number, String, Object]
|
8672 |
+
};
|
8673 |
+
|
8674 |
+
// in case the child is also an abstract component, e.g. <keep-alive>
|
8675 |
+
// we want to recursively retrieve the real component to be rendered
|
8676 |
+
function getRealChild (vnode) {
|
8677 |
+
var compOptions = vnode && vnode.componentOptions;
|
8678 |
+
if (compOptions && compOptions.Ctor.options.abstract) {
|
8679 |
+
return getRealChild(getFirstComponentChild(compOptions.children))
|
8680 |
+
} else {
|
8681 |
+
return vnode
|
8682 |
+
}
|
8683 |
+
}
|
8684 |
+
|
8685 |
+
function extractTransitionData (comp) {
|
8686 |
+
var data = {};
|
8687 |
+
var options = comp.$options;
|
8688 |
+
// props
|
8689 |
+
for (var key in options.propsData) {
|
8690 |
+
data[key] = comp[key];
|
8691 |
+
}
|
8692 |
+
// events.
|
8693 |
+
// extract listeners and pass them directly to the transition methods
|
8694 |
+
var listeners = options._parentListeners;
|
8695 |
+
for (var key$1 in listeners) {
|
8696 |
+
data[camelize(key$1)] = listeners[key$1];
|
8697 |
+
}
|
8698 |
+
return data
|
8699 |
+
}
|
8700 |
+
|
8701 |
+
function placeholder (h, rawChild) {
|
8702 |
+
if (/\d-keep-alive$/.test(rawChild.tag)) {
|
8703 |
+
return h('keep-alive', {
|
8704 |
+
props: rawChild.componentOptions.propsData
|
8705 |
+
})
|
8706 |
+
}
|
8707 |
+
}
|
8708 |
+
|
8709 |
+
function hasParentTransition (vnode) {
|
8710 |
+
while ((vnode = vnode.parent)) {
|
8711 |
+
if (vnode.data.transition) {
|
8712 |
+
return true
|
8713 |
+
}
|
8714 |
+
}
|
8715 |
+
}
|
8716 |
+
|
8717 |
+
function isSameChild (child, oldChild) {
|
8718 |
+
return oldChild.key === child.key && oldChild.tag === child.tag
|
8719 |
+
}
|
8720 |
+
|
8721 |
+
var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
|
8722 |
+
|
8723 |
+
var isVShowDirective = function (d) { return d.name === 'show'; };
|
8724 |
+
|
8725 |
+
var Transition = {
|
8726 |
+
name: 'transition',
|
8727 |
+
props: transitionProps,
|
8728 |
+
abstract: true,
|
8729 |
+
|
8730 |
+
render: function render (h) {
|
8731 |
+
var this$1 = this;
|
8732 |
+
|
8733 |
+
var children = this.$slots.default;
|
8734 |
+
if (!children) {
|
8735 |
+
return
|
8736 |
+
}
|
8737 |
+
|
8738 |
+
// filter out text nodes (possible whitespaces)
|
8739 |
+
children = children.filter(isNotTextNode);
|
8740 |
+
/* istanbul ignore if */
|
8741 |
+
if (!children.length) {
|
8742 |
+
return
|
8743 |
+
}
|
8744 |
+
|
8745 |
+
// warn multiple elements
|
8746 |
+
if (children.length > 1) {
|
8747 |
+
warn(
|
8748 |
+
'<transition> can only be used on a single element. Use ' +
|
8749 |
+
'<transition-group> for lists.',
|
8750 |
+
this.$parent
|
8751 |
+
);
|
8752 |
+
}
|
8753 |
+
|
8754 |
+
var mode = this.mode;
|
8755 |
+
|
8756 |
+
// warn invalid mode
|
8757 |
+
if (mode && mode !== 'in-out' && mode !== 'out-in'
|
8758 |
+
) {
|
8759 |
+
warn(
|
8760 |
+
'invalid <transition> mode: ' + mode,
|
8761 |
+
this.$parent
|
8762 |
+
);
|
8763 |
+
}
|
8764 |
+
|
8765 |
+
var rawChild = children[0];
|
8766 |
+
|
8767 |
+
// if this is a component root node and the component's
|
8768 |
+
// parent container node also has transition, skip.
|
8769 |
+
if (hasParentTransition(this.$vnode)) {
|
8770 |
+
return rawChild
|
8771 |
+
}
|
8772 |
+
|
8773 |
+
// apply transition data to child
|
8774 |
+
// use getRealChild() to ignore abstract components e.g. keep-alive
|
8775 |
+
var child = getRealChild(rawChild);
|
8776 |
+
/* istanbul ignore if */
|
8777 |
+
if (!child) {
|
8778 |
+
return rawChild
|
8779 |
+
}
|
8780 |
+
|
8781 |
+
if (this._leaving) {
|
8782 |
+
return placeholder(h, rawChild)
|
8783 |
+
}
|
8784 |
+
|
8785 |
+
// ensure a key that is unique to the vnode type and to this transition
|
8786 |
+
// component instance. This key will be used to remove pending leaving nodes
|
8787 |
+
// during entering.
|
8788 |
+
var id = "__transition-" + (this._uid) + "-";
|
8789 |
+
child.key = child.key == null
|
8790 |
+
? child.isComment
|
8791 |
+
? id + 'comment'
|
8792 |
+
: id + child.tag
|
8793 |
+
: isPrimitive(child.key)
|
8794 |
+
? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
|
8795 |
+
: child.key;
|
8796 |
+
|
8797 |
+
var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
|
8798 |
+
var oldRawChild = this._vnode;
|
8799 |
+
var oldChild = getRealChild(oldRawChild);
|
8800 |
+
|
8801 |
+
// mark v-show
|
8802 |
+
// so that the transition module can hand over the control to the directive
|
8803 |
+
if (child.data.directives && child.data.directives.some(isVShowDirective)) {
|
8804 |
+
child.data.show = true;
|
8805 |
+
}
|
8806 |
+
|
8807 |
+
if (
|
8808 |
+
oldChild &&
|
8809 |
+
oldChild.data &&
|
8810 |
+
!isSameChild(child, oldChild) &&
|
8811 |
+
!isAsyncPlaceholder(oldChild) &&
|
8812 |
+
// #6687 component root is a comment node
|
8813 |
+
!(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)
|
8814 |
+
) {
|
8815 |
+
// replace old child transition data with fresh one
|
8816 |
+
// important for dynamic transitions!
|
8817 |
+
var oldData = oldChild.data.transition = extend({}, data);
|
8818 |
+
// handle transition mode
|
8819 |
+
if (mode === 'out-in') {
|
8820 |
+
// return placeholder node and queue update when leave finishes
|
8821 |
+
this._leaving = true;
|
8822 |
+
mergeVNodeHook(oldData, 'afterLeave', function () {
|
8823 |
+
this$1._leaving = false;
|
8824 |
+
this$1.$forceUpdate();
|
8825 |
+
});
|
8826 |
+
return placeholder(h, rawChild)
|
8827 |
+
} else if (mode === 'in-out') {
|
8828 |
+
if (isAsyncPlaceholder(child)) {
|
8829 |
+
return oldRawChild
|
8830 |
+
}
|
8831 |
+
var delayedLeave;
|
8832 |
+
var performLeave = function () { delayedLeave(); };
|
8833 |
+
mergeVNodeHook(data, 'afterEnter', performLeave);
|
8834 |
+
mergeVNodeHook(data, 'enterCancelled', performLeave);
|
8835 |
+
mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });
|
8836 |
+
}
|
8837 |
+
}
|
8838 |
+
|
8839 |
+
return rawChild
|
8840 |
+
}
|
8841 |
+
};
|
8842 |
+
|
8843 |
+
/* */
|
8844 |
+
|
8845 |
+
var props = extend({
|
8846 |
+
tag: String,
|
8847 |
+
moveClass: String
|
8848 |
+
}, transitionProps);
|
8849 |
+
|
8850 |
+
delete props.mode;
|
8851 |
+
|
8852 |
+
var TransitionGroup = {
|
8853 |
+
props: props,
|
8854 |
+
|
8855 |
+
beforeMount: function beforeMount () {
|
8856 |
+
var this$1 = this;
|
8857 |
+
|
8858 |
+
var update = this._update;
|
8859 |
+
this._update = function (vnode, hydrating) {
|
8860 |
+
var restoreActiveInstance = setActiveInstance(this$1);
|
8861 |
+
// force removing pass
|
8862 |
+
this$1.__patch__(
|
8863 |
+
this$1._vnode,
|
8864 |
+
this$1.kept,
|
8865 |
+
false, // hydrating
|
8866 |
+
true // removeOnly (!important, avoids unnecessary moves)
|
8867 |
+
);
|
8868 |
+
this$1._vnode = this$1.kept;
|
8869 |
+
restoreActiveInstance();
|
8870 |
+
update.call(this$1, vnode, hydrating);
|
8871 |
+
};
|
8872 |
+
},
|
8873 |
+
|
8874 |
+
render: function render (h) {
|
8875 |
+
var tag = this.tag || this.$vnode.data.tag || 'span';
|
8876 |
+
var map = Object.create(null);
|
8877 |
+
var prevChildren = this.prevChildren = this.children;
|
8878 |
+
var rawChildren = this.$slots.default || [];
|
8879 |
+
var children = this.children = [];
|
8880 |
+
var transitionData = extractTransitionData(this);
|
8881 |
+
|
8882 |
+
for (var i = 0; i < rawChildren.length; i++) {
|
8883 |
+
var c = rawChildren[i];
|
8884 |
+
if (c.tag) {
|
8885 |
+
if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
|
8886 |
+
children.push(c);
|
8887 |
+
map[c.key] = c
|
8888 |
+
;(c.data || (c.data = {})).transition = transitionData;
|
8889 |
+
} else {
|
8890 |
+
var opts = c.componentOptions;
|
8891 |
+
var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;
|
8892 |
+
warn(("<transition-group> children must be keyed: <" + name + ">"));
|
8893 |
+
}
|
8894 |
+
}
|
8895 |
+
}
|
8896 |
+
|
8897 |
+
if (prevChildren) {
|
8898 |
+
var kept = [];
|
8899 |
+
var removed = [];
|
8900 |
+
for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
|
8901 |
+
var c$1 = prevChildren[i$1];
|
8902 |
+
c$1.data.transition = transitionData;
|
8903 |
+
c$1.data.pos = c$1.elm.getBoundingClientRect();
|
8904 |
+
if (map[c$1.key]) {
|
8905 |
+
kept.push(c$1);
|
8906 |
+
} else {
|
8907 |
+
removed.push(c$1);
|
8908 |
+
}
|
8909 |
+
}
|
8910 |
+
this.kept = h(tag, null, kept);
|
8911 |
+
this.removed = removed;
|
8912 |
+
}
|
8913 |
+
|
8914 |
+
return h(tag, null, children)
|
8915 |
+
},
|
8916 |
+
|
8917 |
+
updated: function updated () {
|
8918 |
+
var children = this.prevChildren;
|
8919 |
+
var moveClass = this.moveClass || ((this.name || 'v') + '-move');
|
8920 |
+
if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
|
8921 |
+
return
|
8922 |
+
}
|
8923 |
+
|
8924 |
+
// we divide the work into three loops to avoid mixing DOM reads and writes
|
8925 |
+
// in each iteration - which helps prevent layout thrashing.
|
8926 |
+
children.forEach(callPendingCbs);
|
8927 |
+
children.forEach(recordPosition);
|
8928 |
+
children.forEach(applyTranslation);
|
8929 |
+
|
8930 |
+
// force reflow to put everything in position
|
8931 |
+
// assign to this to avoid being removed in tree-shaking
|
8932 |
+
// $flow-disable-line
|
8933 |
+
this._reflow = document.body.offsetHeight;
|
8934 |
+
|
8935 |
+
children.forEach(function (c) {
|
8936 |
+
if (c.data.moved) {
|
8937 |
+
var el = c.elm;
|
8938 |
+
var s = el.style;
|
8939 |
+
addTransitionClass(el, moveClass);
|
8940 |
+
s.transform = s.WebkitTransform = s.transitionDuration = '';
|
8941 |
+
el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
|
8942 |
+
if (e && e.target !== el) {
|
8943 |
+
return
|
8944 |
+
}
|
8945 |
+
if (!e || /transform$/.test(e.propertyName)) {
|
8946 |
+
el.removeEventListener(transitionEndEvent, cb);
|
8947 |
+
el._moveCb = null;
|
8948 |
+
removeTransitionClass(el, moveClass);
|
8949 |
+
}
|
8950 |
+
});
|
8951 |
+
}
|
8952 |
+
});
|
8953 |
+
},
|
8954 |
+
|
8955 |
+
methods: {
|
8956 |
+
hasMove: function hasMove (el, moveClass) {
|
8957 |
+
/* istanbul ignore if */
|
8958 |
+
if (!hasTransition) {
|
8959 |
+
return false
|
8960 |
+
}
|
8961 |
+
/* istanbul ignore if */
|
8962 |
+
if (this._hasMove) {
|
8963 |
+
return this._hasMove
|
8964 |
+
}
|
8965 |
+
// Detect whether an element with the move class applied has
|
8966 |
+
// CSS transitions. Since the element may be inside an entering
|
8967 |
+
// transition at this very moment, we make a clone of it and remove
|
8968 |
+
// all other transition classes applied to ensure only the move class
|
8969 |
+
// is applied.
|
8970 |
+
var clone = el.cloneNode();
|
8971 |
+
if (el._transitionClasses) {
|
8972 |
+
el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });
|
8973 |
+
}
|
8974 |
+
addClass(clone, moveClass);
|
8975 |
+
clone.style.display = 'none';
|
8976 |
+
this.$el.appendChild(clone);
|
8977 |
+
var info = getTransitionInfo(clone);
|
8978 |
+
this.$el.removeChild(clone);
|
8979 |
+
return (this._hasMove = info.hasTransform)
|
8980 |
+
}
|
8981 |
+
}
|
8982 |
+
};
|
8983 |
+
|
8984 |
+
function callPendingCbs (c) {
|
8985 |
+
/* istanbul ignore if */
|
8986 |
+
if (c.elm._moveCb) {
|
8987 |
+
c.elm._moveCb();
|
8988 |
+
}
|
8989 |
+
/* istanbul ignore if */
|
8990 |
+
if (c.elm._enterCb) {
|
8991 |
+
c.elm._enterCb();
|
8992 |
+
}
|
8993 |
+
}
|
8994 |
+
|
8995 |
+
function recordPosition (c) {
|
8996 |
+
c.data.newPos = c.elm.getBoundingClientRect();
|
8997 |
+
}
|
8998 |
+
|
8999 |
+
function applyTranslation (c) {
|
9000 |
+
var oldPos = c.data.pos;
|
9001 |
+
var newPos = c.data.newPos;
|
9002 |
+
var dx = oldPos.left - newPos.left;
|
9003 |
+
var dy = oldPos.top - newPos.top;
|
9004 |
+
if (dx || dy) {
|
9005 |
+
c.data.moved = true;
|
9006 |
+
var s = c.elm.style;
|
9007 |
+
s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
|
9008 |
+
s.transitionDuration = '0s';
|
9009 |
+
}
|
9010 |
+
}
|
9011 |
+
|
9012 |
+
var platformComponents = {
|
9013 |
+
Transition: Transition,
|
9014 |
+
TransitionGroup: TransitionGroup
|
9015 |
+
};
|
9016 |
+
|
9017 |
+
/* */
|
9018 |
+
|
9019 |
+
// install platform specific utils
|
9020 |
+
Vue.config.mustUseProp = mustUseProp;
|
9021 |
+
Vue.config.isReservedTag = isReservedTag;
|
9022 |
+
Vue.config.isReservedAttr = isReservedAttr;
|
9023 |
+
Vue.config.getTagNamespace = getTagNamespace;
|
9024 |
+
Vue.config.isUnknownElement = isUnknownElement;
|
9025 |
+
|
9026 |
+
// install platform runtime directives & components
|
9027 |
+
extend(Vue.options.directives, platformDirectives);
|
9028 |
+
extend(Vue.options.components, platformComponents);
|
9029 |
+
|
9030 |
+
// install platform patch function
|
9031 |
+
Vue.prototype.__patch__ = inBrowser ? patch : noop;
|
9032 |
+
|
9033 |
+
// public mount method
|
9034 |
+
Vue.prototype.$mount = function (
|
9035 |
+
el,
|
9036 |
+
hydrating
|
9037 |
+
) {
|
9038 |
+
el = el && inBrowser ? query(el) : undefined;
|
9039 |
+
return mountComponent(this, el, hydrating)
|
9040 |
+
};
|
9041 |
+
|
9042 |
+
// devtools global hook
|
9043 |
+
/* istanbul ignore next */
|
9044 |
+
if (inBrowser) {
|
9045 |
+
setTimeout(function () {
|
9046 |
+
if (config.devtools) {
|
9047 |
+
if (devtools) {
|
9048 |
+
devtools.emit('init', Vue);
|
9049 |
+
} else {
|
9050 |
+
console[console.info ? 'info' : 'log'](
|
9051 |
+
'Download the Vue Devtools extension for a better development experience:\n' +
|
9052 |
+
'https://github.com/vuejs/vue-devtools'
|
9053 |
+
);
|
9054 |
+
}
|
9055 |
+
}
|
9056 |
+
if (config.productionTip !== false &&
|
9057 |
+
typeof console !== 'undefined'
|
9058 |
+
) {
|
9059 |
+
console[console.info ? 'info' : 'log'](
|
9060 |
+
"You are running Vue in development mode.\n" +
|
9061 |
+
"Make sure to turn on production mode when deploying for production.\n" +
|
9062 |
+
"See more tips at https://vuejs.org/guide/deployment.html"
|
9063 |
+
);
|
9064 |
+
}
|
9065 |
+
}, 0);
|
9066 |
+
}
|
9067 |
+
|
9068 |
+
/* */
|
9069 |
+
|
9070 |
+
var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g;
|
9071 |
+
var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
|
9072 |
+
|
9073 |
+
var buildRegex = cached(function (delimiters) {
|
9074 |
+
var open = delimiters[0].replace(regexEscapeRE, '\\$&');
|
9075 |
+
var close = delimiters[1].replace(regexEscapeRE, '\\$&');
|
9076 |
+
return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
|
9077 |
+
});
|
9078 |
+
|
9079 |
+
|
9080 |
+
|
9081 |
+
function parseText (
|
9082 |
+
text,
|
9083 |
+
delimiters
|
9084 |
+
) {
|
9085 |
+
var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
|
9086 |
+
if (!tagRE.test(text)) {
|
9087 |
+
return
|
9088 |
+
}
|
9089 |
+
var tokens = [];
|
9090 |
+
var rawTokens = [];
|
9091 |
+
var lastIndex = tagRE.lastIndex = 0;
|
9092 |
+
var match, index, tokenValue;
|
9093 |
+
while ((match = tagRE.exec(text))) {
|
9094 |
+
index = match.index;
|
9095 |
+
// push text token
|
9096 |
+
if (index > lastIndex) {
|
9097 |
+
rawTokens.push(tokenValue = text.slice(lastIndex, index));
|
9098 |
+
tokens.push(JSON.stringify(tokenValue));
|
9099 |
+
}
|
9100 |
+
// tag token
|
9101 |
+
var exp = parseFilters(match[1].trim());
|
9102 |
+
tokens.push(("_s(" + exp + ")"));
|
9103 |
+
rawTokens.push({ '@binding': exp });
|
9104 |
+
lastIndex = index + match[0].length;
|
9105 |
+
}
|
9106 |
+
if (lastIndex < text.length) {
|
9107 |
+
rawTokens.push(tokenValue = text.slice(lastIndex));
|
9108 |
+
tokens.push(JSON.stringify(tokenValue));
|
9109 |
+
}
|
9110 |
+
return {
|
9111 |
+
expression: tokens.join('+'),
|
9112 |
+
tokens: rawTokens
|
9113 |
+
}
|
9114 |
+
}
|
9115 |
+
|
9116 |
+
/* */
|
9117 |
+
|
9118 |
+
function transformNode (el, options) {
|
9119 |
+
var warn = options.warn || baseWarn;
|
9120 |
+
var staticClass = getAndRemoveAttr(el, 'class');
|
9121 |
+
if (staticClass) {
|
9122 |
+
var res = parseText(staticClass, options.delimiters);
|
9123 |
+
if (res) {
|
9124 |
+
warn(
|
9125 |
+
"class=\"" + staticClass + "\": " +
|
9126 |
+
'Interpolation inside attributes has been removed. ' +
|
9127 |
+
'Use v-bind or the colon shorthand instead. For example, ' +
|
9128 |
+
'instead of <div class="{{ val }}">, use <div :class="val">.',
|
9129 |
+
el.rawAttrsMap['class']
|
9130 |
+
);
|
9131 |
+
}
|
9132 |
+
}
|
9133 |
+
if (staticClass) {
|
9134 |
+
el.staticClass = JSON.stringify(staticClass);
|
9135 |
+
}
|
9136 |
+
var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
|
9137 |
+
if (classBinding) {
|
9138 |
+
el.classBinding = classBinding;
|
9139 |
+
}
|
9140 |
+
}
|
9141 |
+
|
9142 |
+
function genData (el) {
|
9143 |
+
var data = '';
|
9144 |
+
if (el.staticClass) {
|
9145 |
+
data += "staticClass:" + (el.staticClass) + ",";
|
9146 |
+
}
|
9147 |
+
if (el.classBinding) {
|
9148 |
+
data += "class:" + (el.classBinding) + ",";
|
9149 |
+
}
|
9150 |
+
return data
|
9151 |
+
}
|
9152 |
+
|
9153 |
+
var klass$1 = {
|
9154 |
+
staticKeys: ['staticClass'],
|
9155 |
+
transformNode: transformNode,
|
9156 |
+
genData: genData
|
9157 |
+
};
|
9158 |
+
|
9159 |
+
/* */
|
9160 |
+
|
9161 |
+
function transformNode$1 (el, options) {
|
9162 |
+
var warn = options.warn || baseWarn;
|
9163 |
+
var staticStyle = getAndRemoveAttr(el, 'style');
|
9164 |
+
if (staticStyle) {
|
9165 |
+
/* istanbul ignore if */
|
9166 |
+
{
|
9167 |
+
var res = parseText(staticStyle, options.delimiters);
|
9168 |
+
if (res) {
|
9169 |
+
warn(
|
9170 |
+
"style=\"" + staticStyle + "\": " +
|
9171 |
+
'Interpolation inside attributes has been removed. ' +
|
9172 |
+
'Use v-bind or the colon shorthand instead. For example, ' +
|
9173 |
+
'instead of <div style="{{ val }}">, use <div :style="val">.',
|
9174 |
+
el.rawAttrsMap['style']
|
9175 |
+
);
|
9176 |
+
}
|
9177 |
+
}
|
9178 |
+
el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
|
9179 |
+
}
|
9180 |
+
|
9181 |
+
var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
|
9182 |
+
if (styleBinding) {
|
9183 |
+
el.styleBinding = styleBinding;
|
9184 |
+
}
|
9185 |
+
}
|
9186 |
+
|
9187 |
+
function genData$1 (el) {
|
9188 |
+
var data = '';
|
9189 |
+
if (el.staticStyle) {
|
9190 |
+
data += "staticStyle:" + (el.staticStyle) + ",";
|
9191 |
+
}
|
9192 |
+
if (el.styleBinding) {
|
9193 |
+
data += "style:(" + (el.styleBinding) + "),";
|
9194 |
+
}
|
9195 |
+
return data
|
9196 |
+
}
|
9197 |
+
|
9198 |
+
var style$1 = {
|
9199 |
+
staticKeys: ['staticStyle'],
|
9200 |
+
transformNode: transformNode$1,
|
9201 |
+
genData: genData$1
|
9202 |
+
};
|
9203 |
+
|
9204 |
+
/* */
|
9205 |
+
|
9206 |
+
var decoder;
|
9207 |
+
|
9208 |
+
var he = {
|
9209 |
+
decode: function decode (html) {
|
9210 |
+
decoder = decoder || document.createElement('div');
|
9211 |
+
decoder.innerHTML = html;
|
9212 |
+
return decoder.textContent
|
9213 |
+
}
|
9214 |
+
};
|
9215 |
+
|
9216 |
+
/* */
|
9217 |
+
|
9218 |
+
var isUnaryTag = makeMap(
|
9219 |
+
'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
|
9220 |
+
'link,meta,param,source,track,wbr'
|
9221 |
+
);
|
9222 |
+
|
9223 |
+
// Elements that you can, intentionally, leave open
|
9224 |
+
// (and which close themselves)
|
9225 |
+
var canBeLeftOpenTag = makeMap(
|
9226 |
+
'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
|
9227 |
+
);
|
9228 |
+
|
9229 |
+
// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
|
9230 |
+
// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
|
9231 |
+
var isNonPhrasingTag = makeMap(
|
9232 |
+
'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
|
9233 |
+
'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
|
9234 |
+
'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
|
9235 |
+
'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
|
9236 |
+
'title,tr,track'
|
9237 |
+
);
|
9238 |
+
|
9239 |
+
/**
|
9240 |
+
* Not type-checking this file because it's mostly vendor code.
|
9241 |
+
*/
|
9242 |
+
|
9243 |
+
// Regular Expressions for parsing tags and attributes
|
9244 |
+
var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
|
9245 |
+
var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
|
9246 |
+
var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*";
|
9247 |
+
var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
|
9248 |
+
var startTagOpen = new RegExp(("^<" + qnameCapture));
|
9249 |
+
var startTagClose = /^\s*(\/?)>/;
|
9250 |
+
var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
|
9251 |
+
var doctype = /^<!DOCTYPE [^>]+>/i;
|
9252 |
+
// #7298: escape - to avoid being pased as HTML comment when inlined in page
|
9253 |
+
var comment = /^<!\--/;
|
9254 |
+
var conditionalComment = /^<!\[/;
|
9255 |
+
|
9256 |
+
// Special Elements (can contain anything)
|
9257 |
+
var isPlainTextElement = makeMap('script,style,textarea', true);
|
9258 |
+
var reCache = {};
|
9259 |
+
|
9260 |
+
var decodingMap = {
|
9261 |
+
'<': '<',
|
9262 |
+
'>': '>',
|
9263 |
+
'"': '"',
|
9264 |
+
'&': '&',
|
9265 |
+
' ': '\n',
|
9266 |
+
'	': '\t',
|
9267 |
+
''': "'"
|
9268 |
+
};
|
9269 |
+
var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;
|
9270 |
+
var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g;
|
9271 |
+
|
9272 |
+
// #5992
|
9273 |
+
var isIgnoreNewlineTag = makeMap('pre,textarea', true);
|
9274 |
+
var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; };
|
9275 |
+
|
9276 |
+
function decodeAttr (value, shouldDecodeNewlines) {
|
9277 |
+
var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
|
9278 |
+
return value.replace(re, function (match) { return decodingMap[match]; })
|
9279 |
+
}
|
9280 |
+
|
9281 |
+
function parseHTML (html, options) {
|
9282 |
+
var stack = [];
|
9283 |
+
var expectHTML = options.expectHTML;
|
9284 |
+
var isUnaryTag$$1 = options.isUnaryTag || no;
|
9285 |
+
var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
|
9286 |
+
var index = 0;
|
9287 |
+
var last, lastTag;
|
9288 |
+
while (html) {
|
9289 |
+
last = html;
|
9290 |
+
// Make sure we're not in a plaintext content element like script/style
|
9291 |
+
if (!lastTag || !isPlainTextElement(lastTag)) {
|
9292 |
+
var textEnd = html.indexOf('<');
|
9293 |
+
if (textEnd === 0) {
|
9294 |
+
// Comment:
|
9295 |
+
if (comment.test(html)) {
|
9296 |
+
var commentEnd = html.indexOf('-->');
|
9297 |
+
|
9298 |
+
if (commentEnd >= 0) {
|
9299 |
+
if (options.shouldKeepComment) {
|
9300 |
+
options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);
|
9301 |
+
}
|
9302 |
+
advance(commentEnd + 3);
|
9303 |
+
continue
|
9304 |
+
}
|
9305 |
+
}
|
9306 |
+
|
9307 |
+
// http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
|
9308 |
+
if (conditionalComment.test(html)) {
|
9309 |
+
var conditionalEnd = html.indexOf(']>');
|
9310 |
+
|
9311 |
+
if (conditionalEnd >= 0) {
|
9312 |
+
advance(conditionalEnd + 2);
|
9313 |
+
continue
|
9314 |
+
}
|
9315 |
+
}
|
9316 |
+
|
9317 |
+
// Doctype:
|
9318 |
+
var doctypeMatch = html.match(doctype);
|
9319 |
+
if (doctypeMatch) {
|
9320 |
+
advance(doctypeMatch[0].length);
|
9321 |
+
continue
|
9322 |
+
}
|
9323 |
+
|
9324 |
+
// End tag:
|
9325 |
+
var endTagMatch = html.match(endTag);
|
9326 |
+
if (endTagMatch) {
|
9327 |
+
var curIndex = index;
|
9328 |
+
advance(endTagMatch[0].length);
|
9329 |
+
parseEndTag(endTagMatch[1], curIndex, index);
|
9330 |
+
continue
|
9331 |
+
}
|
9332 |
+
|
9333 |
+
// Start tag:
|
9334 |
+
var startTagMatch = parseStartTag();
|
9335 |
+
if (startTagMatch) {
|
9336 |
+
handleStartTag(startTagMatch);
|
9337 |
+
if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {
|
9338 |
+
advance(1);
|
9339 |
+
}
|
9340 |
+
continue
|
9341 |
+
}
|
9342 |
+
}
|
9343 |
+
|
9344 |
+
var text = (void 0), rest = (void 0), next = (void 0);
|
9345 |
+
if (textEnd >= 0) {
|
9346 |
+
rest = html.slice(textEnd);
|
9347 |
+
while (
|
9348 |
+
!endTag.test(rest) &&
|
9349 |
+
!startTagOpen.test(rest) &&
|
9350 |
+
!comment.test(rest) &&
|
9351 |
+
!conditionalComment.test(rest)
|
9352 |
+
) {
|
9353 |
+
// < in plain text, be forgiving and treat it as text
|
9354 |
+
next = rest.indexOf('<', 1);
|
9355 |
+
if (next < 0) { break }
|
9356 |
+
textEnd += next;
|
9357 |
+
rest = html.slice(textEnd);
|
9358 |
+
}
|
9359 |
+
text = html.substring(0, textEnd);
|
9360 |
+
}
|
9361 |
+
|
9362 |
+
if (textEnd < 0) {
|
9363 |
+
text = html;
|
9364 |
+
}
|
9365 |
+
|
9366 |
+
if (text) {
|
9367 |
+
advance(text.length);
|
9368 |
+
}
|
9369 |
+
|
9370 |
+
if (options.chars && text) {
|
9371 |
+
options.chars(text, index - text.length, index);
|
9372 |
+
}
|
9373 |
+
} else {
|
9374 |
+
var endTagLength = 0;
|
9375 |
+
var stackedTag = lastTag.toLowerCase();
|
9376 |
+
var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
|
9377 |
+
var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {
|
9378 |
+
endTagLength = endTag.length;
|
9379 |
+
if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
|
9380 |
+
text = text
|
9381 |
+
.replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298
|
9382 |
+
.replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
|
9383 |
+
}
|
9384 |
+
if (shouldIgnoreFirstNewline(stackedTag, text)) {
|
9385 |
+
text = text.slice(1);
|
9386 |
+
}
|
9387 |
+
if (options.chars) {
|
9388 |
+
options.chars(text);
|
9389 |
+
}
|
9390 |
+
return ''
|
9391 |
+
});
|
9392 |
+
index += html.length - rest$1.length;
|
9393 |
+
html = rest$1;
|
9394 |
+
parseEndTag(stackedTag, index - endTagLength, index);
|
9395 |
+
}
|
9396 |
+
|
9397 |
+
if (html === last) {
|
9398 |
+
options.chars && options.chars(html);
|
9399 |
+
if (!stack.length && options.warn) {
|
9400 |
+
options.warn(("Mal-formatted tag at end of template: \"" + html + "\""), { start: index + html.length });
|
9401 |
+
}
|
9402 |
+
break
|
9403 |
+
}
|
9404 |
+
}
|
9405 |
+
|
9406 |
+
// Clean up any remaining tags
|
9407 |
+
parseEndTag();
|
9408 |
+
|
9409 |
+
function advance (n) {
|
9410 |
+
index += n;
|
9411 |
+
html = html.substring(n);
|
9412 |
+
}
|
9413 |
+
|
9414 |
+
function parseStartTag () {
|
9415 |
+
var start = html.match(startTagOpen);
|
9416 |
+
if (start) {
|
9417 |
+
var match = {
|
9418 |
+
tagName: start[1],
|
9419 |
+
attrs: [],
|
9420 |
+
start: index
|
9421 |
+
};
|
9422 |
+
advance(start[0].length);
|
9423 |
+
var end, attr;
|
9424 |
+
while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {
|
9425 |
+
attr.start = index;
|
9426 |
+
advance(attr[0].length);
|
9427 |
+
attr.end = index;
|
9428 |
+
match.attrs.push(attr);
|
9429 |
+
}
|
9430 |
+
if (end) {
|
9431 |
+
match.unarySlash = end[1];
|
9432 |
+
advance(end[0].length);
|
9433 |
+
match.end = index;
|
9434 |
+
return match
|
9435 |
+
}
|
9436 |
+
}
|
9437 |
+
}
|
9438 |
+
|
9439 |
+
function handleStartTag (match) {
|
9440 |
+
var tagName = match.tagName;
|
9441 |
+
var unarySlash = match.unarySlash;
|
9442 |
+
|
9443 |
+
if (expectHTML) {
|
9444 |
+
if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
|
9445 |
+
parseEndTag(lastTag);
|
9446 |
+
}
|
9447 |
+
if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
|
9448 |
+
parseEndTag(tagName);
|
9449 |
+
}
|
9450 |
+
}
|
9451 |
+
|
9452 |
+
var unary = isUnaryTag$$1(tagName) || !!unarySlash;
|
9453 |
+
|
9454 |
+
var l = match.attrs.length;
|
9455 |
+
var attrs = new Array(l);
|
9456 |
+
for (var i = 0; i < l; i++) {
|
9457 |
+
var args = match.attrs[i];
|
9458 |
+
var value = args[3] || args[4] || args[5] || '';
|
9459 |
+
var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'
|
9460 |
+
? options.shouldDecodeNewlinesForHref
|
9461 |
+
: options.shouldDecodeNewlines;
|
9462 |
+
attrs[i] = {
|
9463 |
+
name: args[1],
|
9464 |
+
value: decodeAttr(value, shouldDecodeNewlines)
|
9465 |
+
};
|
9466 |
+
if (options.outputSourceRange) {
|
9467 |
+
attrs[i].start = args.start + args[0].match(/^\s*/).length;
|
9468 |
+
attrs[i].end = args.end;
|
9469 |
+
}
|
9470 |
+
}
|
9471 |
+
|
9472 |
+
if (!unary) {
|
9473 |
+
stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end });
|
9474 |
+
lastTag = tagName;
|
9475 |
+
}
|
9476 |
+
|
9477 |
+
if (options.start) {
|
9478 |
+
options.start(tagName, attrs, unary, match.start, match.end);
|
9479 |
+
}
|
9480 |
+
}
|
9481 |
+
|
9482 |
+
function parseEndTag (tagName, start, end) {
|
9483 |
+
var pos, lowerCasedTagName;
|
9484 |
+
if (start == null) { start = index; }
|
9485 |
+
if (end == null) { end = index; }
|
9486 |
+
|
9487 |
+
// Find the closest opened tag of the same type
|
9488 |
+
if (tagName) {
|
9489 |
+
lowerCasedTagName = tagName.toLowerCase();
|
9490 |
+
for (pos = stack.length - 1; pos >= 0; pos--) {
|
9491 |
+
if (stack[pos].lowerCasedTag === lowerCasedTagName) {
|
9492 |
+
break
|
9493 |
+
}
|
9494 |
+
}
|
9495 |
+
} else {
|
9496 |
+
// If no tag name is provided, clean shop
|
9497 |
+
pos = 0;
|
9498 |
+
}
|
9499 |
+
|
9500 |
+
if (pos >= 0) {
|
9501 |
+
// Close all the open elements, up the stack
|
9502 |
+
for (var i = stack.length - 1; i >= pos; i--) {
|
9503 |
+
if (i > pos || !tagName &&
|
9504 |
+
options.warn
|
9505 |
+
) {
|
9506 |
+
options.warn(
|
9507 |
+
("tag <" + (stack[i].tag) + "> has no matching end tag."),
|
9508 |
+
{ start: stack[i].start, end: stack[i].end }
|
9509 |
+
);
|
9510 |
+
}
|
9511 |
+
if (options.end) {
|
9512 |
+
options.end(stack[i].tag, start, end);
|
9513 |
+
}
|
9514 |
+
}
|
9515 |
+
|
9516 |
+
// Remove the open elements from the stack
|
9517 |
+
stack.length = pos;
|
9518 |
+
lastTag = pos && stack[pos - 1].tag;
|
9519 |
+
} else if (lowerCasedTagName === 'br') {
|
9520 |
+
if (options.start) {
|
9521 |
+
options.start(tagName, [], true, start, end);
|
9522 |
+
}
|
9523 |
+
} else if (lowerCasedTagName === 'p') {
|
9524 |
+
if (options.start) {
|
9525 |
+
options.start(tagName, [], false, start, end);
|
9526 |
+
}
|
9527 |
+
if (options.end) {
|
9528 |
+
options.end(tagName, start, end);
|
9529 |
+
}
|
9530 |
+
}
|
9531 |
+
}
|
9532 |
+
}
|
9533 |
+
|
9534 |
+
/* */
|
9535 |
+
|
9536 |
+
var onRE = /^@|^v-on:/;
|
9537 |
+
var dirRE = /^v-|^@|^:/;
|
9538 |
+
var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
|
9539 |
+
var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
|
9540 |
+
var stripParensRE = /^\(|\)$/g;
|
9541 |
+
var dynamicArgRE = /^\[.*\]$/;
|
9542 |
+
|
9543 |
+
var argRE = /:(.*)$/;
|
9544 |
+
var bindRE = /^:|^\.|^v-bind:/;
|
9545 |
+
var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g;
|
9546 |
+
|
9547 |
+
var slotRE = /^v-slot(:|$)|^#/;
|
9548 |
+
|
9549 |
+
var lineBreakRE = /[\r\n]/;
|
9550 |
+
var whitespaceRE$1 = /\s+/g;
|
9551 |
+
|
9552 |
+
var invalidAttributeRE = /[\s"'<>\/=]/;
|
9553 |
+
|
9554 |
+
var decodeHTMLCached = cached(he.decode);
|
9555 |
+
|
9556 |
+
var emptySlotScopeToken = "_empty_";
|
9557 |
+
|
9558 |
+
// configurable state
|
9559 |
+
var warn$2;
|
9560 |
+
var delimiters;
|
9561 |
+
var transforms;
|
9562 |
+
var preTransforms;
|
9563 |
+
var postTransforms;
|
9564 |
+
var platformIsPreTag;
|
9565 |
+
var platformMustUseProp;
|
9566 |
+
var platformGetTagNamespace;
|
9567 |
+
var maybeComponent;
|
9568 |
+
|
9569 |
+
function createASTElement (
|
9570 |
+
tag,
|
9571 |
+
attrs,
|
9572 |
+
parent
|
9573 |
+
) {
|
9574 |
+
return {
|
9575 |
+
type: 1,
|
9576 |
+
tag: tag,
|
9577 |
+
attrsList: attrs,
|
9578 |
+
attrsMap: makeAttrsMap(attrs),
|
9579 |
+
rawAttrsMap: {},
|
9580 |
+
parent: parent,
|
9581 |
+
children: []
|
9582 |
+
}
|
9583 |
+
}
|
9584 |
+
|
9585 |
+
/**
|
9586 |
+
* Convert HTML string to AST.
|
9587 |
+
*/
|
9588 |
+
function parse (
|
9589 |
+
template,
|
9590 |
+
options
|
9591 |
+
) {
|
9592 |
+
warn$2 = options.warn || baseWarn;
|
9593 |
+
|
9594 |
+
platformIsPreTag = options.isPreTag || no;
|
9595 |
+
platformMustUseProp = options.mustUseProp || no;
|
9596 |
+
platformGetTagNamespace = options.getTagNamespace || no;
|
9597 |
+
var isReservedTag = options.isReservedTag || no;
|
9598 |
+
maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
|
9599 |
+
|
9600 |
+
transforms = pluckModuleFunction(options.modules, 'transformNode');
|
9601 |
+
preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
|
9602 |
+
postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
|
9603 |
+
|
9604 |
+
delimiters = options.delimiters;
|
9605 |
+
|
9606 |
+
var stack = [];
|
9607 |
+
var preserveWhitespace = options.preserveWhitespace !== false;
|
9608 |
+
var whitespaceOption = options.whitespace;
|
9609 |
+
var root;
|
9610 |
+
var currentParent;
|
9611 |
+
var inVPre = false;
|
9612 |
+
var inPre = false;
|
9613 |
+
var warned = false;
|
9614 |
+
|
9615 |
+
function warnOnce (msg, range) {
|
9616 |
+
if (!warned) {
|
9617 |
+
warned = true;
|
9618 |
+
warn$2(msg, range);
|
9619 |
+
}
|
9620 |
+
}
|
9621 |
+
|
9622 |
+
function closeElement (element) {
|
9623 |
+
trimEndingWhitespace(element);
|
9624 |
+
if (!inVPre && !element.processed) {
|
9625 |
+
element = processElement(element, options);
|
9626 |
+
}
|
9627 |
+
// tree management
|
9628 |
+
if (!stack.length && element !== root) {
|
9629 |
+
// allow root elements with v-if, v-else-if and v-else
|
9630 |
+
if (root.if && (element.elseif || element.else)) {
|
9631 |
+
{
|
9632 |
+
checkRootConstraints(element);
|
9633 |
+
}
|
9634 |
+
addIfCondition(root, {
|
9635 |
+
exp: element.elseif,
|
9636 |
+
block: element
|
9637 |
+
});
|
9638 |
+
} else {
|
9639 |
+
warnOnce(
|
9640 |
+
"Component template should contain exactly one root element. " +
|
9641 |
+
"If you are using v-if on multiple elements, " +
|
9642 |
+
"use v-else-if to chain them instead.",
|
9643 |
+
{ start: element.start }
|
9644 |
+
);
|
9645 |
+
}
|
9646 |
+
}
|
9647 |
+
if (currentParent && !element.forbidden) {
|
9648 |
+
if (element.elseif || element.else) {
|
9649 |
+
processIfConditions(element, currentParent);
|
9650 |
+
} else {
|
9651 |
+
if (element.slotScope) {
|
9652 |
+
// scoped slot
|
9653 |
+
// keep it in the children list so that v-else(-if) conditions can
|
9654 |
+
// find it as the prev node.
|
9655 |
+
var name = element.slotTarget || '"default"'
|
9656 |
+
;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
|
9657 |
+
}
|
9658 |
+
currentParent.children.push(element);
|
9659 |
+
element.parent = currentParent;
|
9660 |
+
}
|
9661 |
+
}
|
9662 |
+
|
9663 |
+
// final children cleanup
|
9664 |
+
// filter out scoped slots
|
9665 |
+
element.children = element.children.filter(function (c) { return !(c).slotScope; });
|
9666 |
+
// remove trailing whitespace node again
|
9667 |
+
trimEndingWhitespace(element);
|
9668 |
+
|
9669 |
+
// check pre state
|
9670 |
+
if (element.pre) {
|
9671 |
+
inVPre = false;
|
9672 |
+
}
|
9673 |
+
if (platformIsPreTag(element.tag)) {
|
9674 |
+
inPre = false;
|
9675 |
+
}
|
9676 |
+
// apply post-transforms
|
9677 |
+
for (var i = 0; i < postTransforms.length; i++) {
|
9678 |
+
postTransforms[i](element, options);
|
9679 |
+
}
|
9680 |
+
}
|
9681 |
+
|
9682 |
+
function trimEndingWhitespace (el) {
|
9683 |
+
// remove trailing whitespace node
|
9684 |
+
if (!inPre) {
|
9685 |
+
var lastNode;
|
9686 |
+
while (
|
9687 |
+
(lastNode = el.children[el.children.length - 1]) &&
|
9688 |
+
lastNode.type === 3 &&
|
9689 |
+
lastNode.text === ' '
|
9690 |
+
) {
|
9691 |
+
el.children.pop();
|
9692 |
+
}
|
9693 |
+
}
|
9694 |
+
}
|
9695 |
+
|
9696 |
+
function checkRootConstraints (el) {
|
9697 |
+
if (el.tag === 'slot' || el.tag === 'template') {
|
9698 |
+
warnOnce(
|
9699 |
+
"Cannot use <" + (el.tag) + "> as component root element because it may " +
|
9700 |
+
'contain multiple nodes.',
|
9701 |
+
{ start: el.start }
|
9702 |
+
);
|
9703 |
+
}
|
9704 |
+
if (el.attrsMap.hasOwnProperty('v-for')) {
|
9705 |
+
warnOnce(
|
9706 |
+
'Cannot use v-for on stateful component root element because ' +
|
9707 |
+
'it renders multiple elements.',
|
9708 |
+
el.rawAttrsMap['v-for']
|
9709 |
+
);
|
9710 |
+
}
|
9711 |
+
}
|
9712 |
+
|
9713 |
+
parseHTML(template, {
|
9714 |
+
warn: warn$2,
|
9715 |
+
expectHTML: options.expectHTML,
|
9716 |
+
isUnaryTag: options.isUnaryTag,
|
9717 |
+
canBeLeftOpenTag: options.canBeLeftOpenTag,
|
9718 |
+
shouldDecodeNewlines: options.shouldDecodeNewlines,
|
9719 |
+
shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
|
9720 |
+
shouldKeepComment: options.comments,
|
9721 |
+
outputSourceRange: options.outputSourceRange,
|
9722 |
+
start: function start (tag, attrs, unary, start$1, end) {
|
9723 |
+
// check namespace.
|
9724 |
+
// inherit parent ns if there is one
|
9725 |
+
var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
|
9726 |
+
|
9727 |
+
// handle IE svg bug
|
9728 |
+
/* istanbul ignore if */
|
9729 |
+
if (isIE && ns === 'svg') {
|
9730 |
+
attrs = guardIESVGBug(attrs);
|
9731 |
+
}
|
9732 |
+
|
9733 |
+
var element = createASTElement(tag, attrs, currentParent);
|
9734 |
+
if (ns) {
|
9735 |
+
element.ns = ns;
|
9736 |
+
}
|
9737 |
+
|
9738 |
+
{
|
9739 |
+
if (options.outputSourceRange) {
|
9740 |
+
element.start = start$1;
|
9741 |
+
element.end = end;
|
9742 |
+
element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {
|
9743 |
+
cumulated[attr.name] = attr;
|
9744 |
+
return cumulated
|
9745 |
+
}, {});
|
9746 |
+
}
|
9747 |
+
attrs.forEach(function (attr) {
|
9748 |
+
if (invalidAttributeRE.test(attr.name)) {
|
9749 |
+
warn$2(
|
9750 |
+
"Invalid dynamic argument expression: attribute names cannot contain " +
|
9751 |
+
"spaces, quotes, <, >, / or =.",
|
9752 |
+
{
|
9753 |
+
start: attr.start + attr.name.indexOf("["),
|
9754 |
+
end: attr.start + attr.name.length
|
9755 |
+
}
|
9756 |
+
);
|
9757 |
+
}
|
9758 |
+
});
|
9759 |
+
}
|
9760 |
+
|
9761 |
+
if (isForbiddenTag(element) && !isServerRendering()) {
|
9762 |
+
element.forbidden = true;
|
9763 |
+
warn$2(
|
9764 |
+
'Templates should only be responsible for mapping the state to the ' +
|
9765 |
+
'UI. Avoid placing tags with side-effects in your templates, such as ' +
|
9766 |
+
"<" + tag + ">" + ', as they will not be parsed.',
|
9767 |
+
{ start: element.start }
|
9768 |
+
);
|
9769 |
+
}
|
9770 |
+
|
9771 |
+
// apply pre-transforms
|
9772 |
+
for (var i = 0; i < preTransforms.length; i++) {
|
9773 |
+
element = preTransforms[i](element, options) || element;
|
9774 |
+
}
|
9775 |
+
|
9776 |
+
if (!inVPre) {
|
9777 |
+
processPre(element);
|
9778 |
+
if (element.pre) {
|
9779 |
+
inVPre = true;
|
9780 |
+
}
|
9781 |
+
}
|
9782 |
+
if (platformIsPreTag(element.tag)) {
|
9783 |
+
inPre = true;
|
9784 |
+
}
|
9785 |
+
if (inVPre) {
|
9786 |
+
processRawAttrs(element);
|
9787 |
+
} else if (!element.processed) {
|
9788 |
+
// structural directives
|
9789 |
+
processFor(element);
|
9790 |
+
processIf(element);
|
9791 |
+
processOnce(element);
|
9792 |
+
}
|
9793 |
+
|
9794 |
+
if (!root) {
|
9795 |
+
root = element;
|
9796 |
+
{
|
9797 |
+
checkRootConstraints(root);
|
9798 |
+
}
|
9799 |
+
}
|
9800 |
+
|
9801 |
+
if (!unary) {
|
9802 |
+
currentParent = element;
|
9803 |
+
stack.push(element);
|
9804 |
+
} else {
|
9805 |
+
closeElement(element);
|
9806 |
+
}
|
9807 |
+
},
|
9808 |
+
|
9809 |
+
end: function end (tag, start, end$1) {
|
9810 |
+
var element = stack[stack.length - 1];
|
9811 |
+
// pop stack
|
9812 |
+
stack.length -= 1;
|
9813 |
+
currentParent = stack[stack.length - 1];
|
9814 |
+
if (options.outputSourceRange) {
|
9815 |
+
element.end = end$1;
|
9816 |
+
}
|
9817 |
+
closeElement(element);
|
9818 |
+
},
|
9819 |
+
|
9820 |
+
chars: function chars (text, start, end) {
|
9821 |
+
if (!currentParent) {
|
9822 |
+
{
|
9823 |
+
if (text === template) {
|
9824 |
+
warnOnce(
|
9825 |
+
'Component template requires a root element, rather than just text.',
|
9826 |
+
{ start: start }
|
9827 |
+
);
|
9828 |
+
} else if ((text = text.trim())) {
|
9829 |
+
warnOnce(
|
9830 |
+
("text \"" + text + "\" outside root element will be ignored."),
|
9831 |
+
{ start: start }
|
9832 |
+
);
|
9833 |
+
}
|
9834 |
+
}
|
9835 |
+
return
|
9836 |
+
}
|
9837 |
+
// IE textarea placeholder bug
|
9838 |
+
/* istanbul ignore if */
|
9839 |
+
if (isIE &&
|
9840 |
+
currentParent.tag === 'textarea' &&
|
9841 |
+
currentParent.attrsMap.placeholder === text
|
9842 |
+
) {
|
9843 |
+
return
|
9844 |
+
}
|
9845 |
+
var children = currentParent.children;
|
9846 |
+
if (inPre || text.trim()) {
|
9847 |
+
text = isTextTag(currentParent) ? text : decodeHTMLCached(text);
|
9848 |
+
} else if (!children.length) {
|
9849 |
+
// remove the whitespace-only node right after an opening tag
|
9850 |
+
text = '';
|
9851 |
+
} else if (whitespaceOption) {
|
9852 |
+
if (whitespaceOption === 'condense') {
|
9853 |
+
// in condense mode, remove the whitespace node if it contains
|
9854 |
+
// line break, otherwise condense to a single space
|
9855 |
+
text = lineBreakRE.test(text) ? '' : ' ';
|
9856 |
+
} else {
|
9857 |
+
text = ' ';
|
9858 |
+
}
|
9859 |
+
} else {
|
9860 |
+
text = preserveWhitespace ? ' ' : '';
|
9861 |
+
}
|
9862 |
+
if (text) {
|
9863 |
+
if (!inPre && whitespaceOption === 'condense') {
|
9864 |
+
// condense consecutive whitespaces into single space
|
9865 |
+
text = text.replace(whitespaceRE$1, ' ');
|
9866 |
+
}
|
9867 |
+
var res;
|
9868 |
+
var child;
|
9869 |
+
if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
|
9870 |
+
child = {
|
9871 |
+
type: 2,
|
9872 |
+
expression: res.expression,
|
9873 |
+
tokens: res.tokens,
|
9874 |
+
text: text
|
9875 |
+
};
|
9876 |
+
} else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
|
9877 |
+
child = {
|
9878 |
+
type: 3,
|
9879 |
+
text: text
|
9880 |
+
};
|
9881 |
+
}
|
9882 |
+
if (child) {
|
9883 |
+
if (options.outputSourceRange) {
|
9884 |
+
child.start = start;
|
9885 |
+
child.end = end;
|
9886 |
+
}
|
9887 |
+
children.push(child);
|
9888 |
+
}
|
9889 |
+
}
|
9890 |
+
},
|
9891 |
+
comment: function comment (text, start, end) {
|
9892 |
+
// adding anyting as a sibling to the root node is forbidden
|
9893 |
+
// comments should still be allowed, but ignored
|
9894 |
+
if (currentParent) {
|
9895 |
+
var child = {
|
9896 |
+
type: 3,
|
9897 |
+
text: text,
|
9898 |
+
isComment: true
|
9899 |
+
};
|
9900 |
+
if (options.outputSourceRange) {
|
9901 |
+
child.start = start;
|
9902 |
+
child.end = end;
|
9903 |
+
}
|
9904 |
+
currentParent.children.push(child);
|
9905 |
+
}
|
9906 |
+
}
|
9907 |
+
});
|
9908 |
+
return root
|
9909 |
+
}
|
9910 |
+
|
9911 |
+
function processPre (el) {
|
9912 |
+
if (getAndRemoveAttr(el, 'v-pre') != null) {
|
9913 |
+
el.pre = true;
|
9914 |
+
}
|
9915 |
+
}
|
9916 |
+
|
9917 |
+
function processRawAttrs (el) {
|
9918 |
+
var list = el.attrsList;
|
9919 |
+
var len = list.length;
|
9920 |
+
if (len) {
|
9921 |
+
var attrs = el.attrs = new Array(len);
|
9922 |
+
for (var i = 0; i < len; i++) {
|
9923 |
+
attrs[i] = {
|
9924 |
+
name: list[i].name,
|
9925 |
+
value: JSON.stringify(list[i].value)
|
9926 |
+
};
|
9927 |
+
if (list[i].start != null) {
|
9928 |
+
attrs[i].start = list[i].start;
|
9929 |
+
attrs[i].end = list[i].end;
|
9930 |
+
}
|
9931 |
+
}
|
9932 |
+
} else if (!el.pre) {
|
9933 |
+
// non root node in pre blocks with no attributes
|
9934 |
+
el.plain = true;
|
9935 |
+
}
|
9936 |
+
}
|
9937 |
+
|
9938 |
+
function processElement (
|
9939 |
+
element,
|
9940 |
+
options
|
9941 |
+
) {
|
9942 |
+
processKey(element);
|
9943 |
+
|
9944 |
+
// determine whether this is a plain element after
|
9945 |
+
// removing structural attributes
|
9946 |
+
element.plain = (
|
9947 |
+
!element.key &&
|
9948 |
+
!element.scopedSlots &&
|
9949 |
+
!element.attrsList.length
|
9950 |
+
);
|
9951 |
+
|
9952 |
+
processRef(element);
|
9953 |
+
processSlotContent(element);
|
9954 |
+
processSlotOutlet(element);
|
9955 |
+
processComponent(element);
|
9956 |
+
for (var i = 0; i < transforms.length; i++) {
|
9957 |
+
element = transforms[i](element, options) || element;
|
9958 |
+
}
|
9959 |
+
processAttrs(element);
|
9960 |
+
return element
|
9961 |
+
}
|
9962 |
+
|
9963 |
+
function processKey (el) {
|
9964 |
+
var exp = getBindingAttr(el, 'key');
|
9965 |
+
if (exp) {
|
9966 |
+
{
|
9967 |
+
if (el.tag === 'template') {
|
9968 |
+
warn$2(
|
9969 |
+
"<template> cannot be keyed. Place the key on real elements instead.",
|
9970 |
+
getRawBindingAttr(el, 'key')
|
9971 |
+
);
|
9972 |
+
}
|
9973 |
+
if (el.for) {
|
9974 |
+
var iterator = el.iterator2 || el.iterator1;
|
9975 |
+
var parent = el.parent;
|
9976 |
+
if (iterator && iterator === exp && parent && parent.tag === 'transition-group') {
|
9977 |
+
warn$2(
|
9978 |
+
"Do not use v-for index as key on <transition-group> children, " +
|
9979 |
+
"this is the same as not using keys.",
|
9980 |
+
getRawBindingAttr(el, 'key'),
|
9981 |
+
true /* tip */
|
9982 |
+
);
|
9983 |
+
}
|
9984 |
+
}
|
9985 |
+
}
|
9986 |
+
el.key = exp;
|
9987 |
+
}
|
9988 |
+
}
|
9989 |
+
|
9990 |
+
function processRef (el) {
|
9991 |
+
var ref = getBindingAttr(el, 'ref');
|
9992 |
+
if (ref) {
|
9993 |
+
el.ref = ref;
|
9994 |
+
el.refInFor = checkInFor(el);
|
9995 |
+
}
|
9996 |
+
}
|
9997 |
+
|
9998 |
+
function processFor (el) {
|
9999 |
+
var exp;
|
10000 |
+
if ((exp = getAndRemoveAttr(el, 'v-for'))) {
|
10001 |
+
var res = parseFor(exp);
|
10002 |
+
if (res) {
|
10003 |
+
extend(el, res);
|
10004 |
+
} else {
|
10005 |
+
warn$2(
|
10006 |
+
("Invalid v-for expression: " + exp),
|
10007 |
+
el.rawAttrsMap['v-for']
|
10008 |
+
);
|
10009 |
+
}
|
10010 |
+
}
|
10011 |
+
}
|
10012 |
+
|
10013 |
+
|
10014 |
+
|
10015 |
+
function parseFor (exp) {
|
10016 |
+
var inMatch = exp.match(forAliasRE);
|
10017 |
+
if (!inMatch) { return }
|
10018 |
+
var res = {};
|
10019 |
+
res.for = inMatch[2].trim();
|
10020 |
+
var alias = inMatch[1].trim().replace(stripParensRE, '');
|
10021 |
+
var iteratorMatch = alias.match(forIteratorRE);
|
10022 |
+
if (iteratorMatch) {
|
10023 |
+
res.alias = alias.replace(forIteratorRE, '').trim();
|
10024 |
+
res.iterator1 = iteratorMatch[1].trim();
|
10025 |
+
if (iteratorMatch[2]) {
|
10026 |
+
res.iterator2 = iteratorMatch[2].trim();
|
10027 |
+
}
|
10028 |
+
} else {
|
10029 |
+
res.alias = alias;
|
10030 |
+
}
|
10031 |
+
return res
|
10032 |
+
}
|
10033 |
+
|
10034 |
+
function processIf (el) {
|
10035 |
+
var exp = getAndRemoveAttr(el, 'v-if');
|
10036 |
+
if (exp) {
|
10037 |
+
el.if = exp;
|
10038 |
+
addIfCondition(el, {
|
10039 |
+
exp: exp,
|
10040 |
+
block: el
|
10041 |
+
});
|
10042 |
+
} else {
|
10043 |
+
if (getAndRemoveAttr(el, 'v-else') != null) {
|
10044 |
+
el.else = true;
|
10045 |
+
}
|
10046 |
+
var elseif = getAndRemoveAttr(el, 'v-else-if');
|
10047 |
+
if (elseif) {
|
10048 |
+
el.elseif = elseif;
|
10049 |
+
}
|
10050 |
+
}
|
10051 |
+
}
|
10052 |
+
|
10053 |
+
function processIfConditions (el, parent) {
|
10054 |
+
var prev = findPrevElement(parent.children);
|
10055 |
+
if (prev && prev.if) {
|
10056 |
+
addIfCondition(prev, {
|
10057 |
+
exp: el.elseif,
|
10058 |
+
block: el
|
10059 |
+
});
|
10060 |
+
} else {
|
10061 |
+
warn$2(
|
10062 |
+
"v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
|
10063 |
+
"used on element <" + (el.tag) + "> without corresponding v-if.",
|
10064 |
+
el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']
|
10065 |
+
);
|
10066 |
+
}
|
10067 |
+
}
|
10068 |
+
|
10069 |
+
function findPrevElement (children) {
|
10070 |
+
var i = children.length;
|
10071 |
+
while (i--) {
|
10072 |
+
if (children[i].type === 1) {
|
10073 |
+
return children[i]
|
10074 |
+
} else {
|
10075 |
+
if (children[i].text !== ' ') {
|
10076 |
+
warn$2(
|
10077 |
+
"text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
|
10078 |
+
"will be ignored.",
|
10079 |
+
children[i]
|
10080 |
+
);
|
10081 |
+
}
|
10082 |
+
children.pop();
|
10083 |
+
}
|
10084 |
+
}
|
10085 |
+
}
|
10086 |
+
|
10087 |
+
function addIfCondition (el, condition) {
|
10088 |
+
if (!el.ifConditions) {
|
10089 |
+
el.ifConditions = [];
|
10090 |
+
}
|
10091 |
+
el.ifConditions.push(condition);
|
10092 |
+
}
|
10093 |
+
|
10094 |
+
function processOnce (el) {
|
10095 |
+
var once$$1 = getAndRemoveAttr(el, 'v-once');
|
10096 |
+
if (once$$1 != null) {
|
10097 |
+
el.once = true;
|
10098 |
+
}
|
10099 |
+
}
|
10100 |
+
|
10101 |
+
// handle content being passed to a component as slot,
|
10102 |
+
// e.g. <template slot="xxx">, <div slot-scope="xxx">
|
10103 |
+
function processSlotContent (el) {
|
10104 |
+
var slotScope;
|
10105 |
+
if (el.tag === 'template') {
|
10106 |
+
slotScope = getAndRemoveAttr(el, 'scope');
|
10107 |
+
/* istanbul ignore if */
|
10108 |
+
if (slotScope) {
|
10109 |
+
warn$2(
|
10110 |
+
"the \"scope\" attribute for scoped slots have been deprecated and " +
|
10111 |
+
"replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " +
|
10112 |
+
"can also be used on plain elements in addition to <template> to " +
|
10113 |
+
"denote scoped slots.",
|
10114 |
+
el.rawAttrsMap['scope'],
|
10115 |
+
true
|
10116 |
+
);
|
10117 |
+
}
|
10118 |
+
el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
|
10119 |
+
} else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
|
10120 |
+
/* istanbul ignore if */
|
10121 |
+
if (el.attrsMap['v-for']) {
|
10122 |
+
warn$2(
|
10123 |
+
"Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
|
10124 |
+
"(v-for takes higher priority). Use a wrapper <template> for the " +
|
10125 |
+
"scoped slot to make it clearer.",
|
10126 |
+
el.rawAttrsMap['slot-scope'],
|
10127 |
+
true
|
10128 |
+
);
|
10129 |
+
}
|
10130 |
+
el.slotScope = slotScope;
|
10131 |
+
}
|
10132 |
+
|
10133 |
+
// slot="xxx"
|
10134 |
+
var slotTarget = getBindingAttr(el, 'slot');
|
10135 |
+
if (slotTarget) {
|
10136 |
+
el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
|
10137 |
+
el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']);
|
10138 |
+
// preserve slot as an attribute for native shadow DOM compat
|
10139 |
+
// only for non-scoped slots.
|
10140 |
+
if (el.tag !== 'template' && !el.slotScope) {
|
10141 |
+
addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));
|
10142 |
+
}
|
10143 |
+
}
|
10144 |
+
|
10145 |
+
// 2.6 v-slot syntax
|
10146 |
+
{
|
10147 |
+
if (el.tag === 'template') {
|
10148 |
+
// v-slot on <template>
|
10149 |
+
var slotBinding = getAndRemoveAttrByRegex(el, slotRE);
|
10150 |
+
if (slotBinding) {
|
10151 |
+
{
|
10152 |
+
if (el.slotTarget || el.slotScope) {
|
10153 |
+
warn$2(
|
10154 |
+
"Unexpected mixed usage of different slot syntaxes.",
|
10155 |
+
el
|
10156 |
+
);
|
10157 |
+
}
|
10158 |
+
if (el.parent && !maybeComponent(el.parent)) {
|
10159 |
+
warn$2(
|
10160 |
+
"<template v-slot> can only appear at the root level inside " +
|
10161 |
+
"the receiving the component",
|
10162 |
+
el
|
10163 |
+
);
|
10164 |
+
}
|
10165 |
+
}
|
10166 |
+
var ref = getSlotName(slotBinding);
|
10167 |
+
var name = ref.name;
|
10168 |
+
var dynamic = ref.dynamic;
|
10169 |
+
el.slotTarget = name;
|
10170 |
+
el.slotTargetDynamic = dynamic;
|
10171 |
+
el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf
|
10172 |
+
}
|
10173 |
+
} else {
|
10174 |
+
// v-slot on component, denotes default slot
|
10175 |
+
var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE);
|
10176 |
+
if (slotBinding$1) {
|
10177 |
+
{
|
10178 |
+
if (!maybeComponent(el)) {
|
10179 |
+
warn$2(
|
10180 |
+
"v-slot can only be used on components or <template>.",
|
10181 |
+
slotBinding$1
|
10182 |
+
);
|
10183 |
+
}
|
10184 |
+
if (el.slotScope || el.slotTarget) {
|
10185 |
+
warn$2(
|
10186 |
+
"Unexpected mixed usage of different slot syntaxes.",
|
10187 |
+
el
|
10188 |
+
);
|
10189 |
+
}
|
10190 |
+
if (el.scopedSlots) {
|
10191 |
+
warn$2(
|
10192 |
+
"To avoid scope ambiguity, the default slot should also use " +
|
10193 |
+
"<template> syntax when there are other named slots.",
|
10194 |
+
slotBinding$1
|
10195 |
+
);
|
10196 |
+
}
|
10197 |
+
}
|
10198 |
+
// add the component's children to its default slot
|
10199 |
+
var slots = el.scopedSlots || (el.scopedSlots = {});
|
10200 |
+
var ref$1 = getSlotName(slotBinding$1);
|
10201 |
+
var name$1 = ref$1.name;
|
10202 |
+
var dynamic$1 = ref$1.dynamic;
|
10203 |
+
var slotContainer = slots[name$1] = createASTElement('template', [], el);
|
10204 |
+
slotContainer.slotTarget = name$1;
|
10205 |
+
slotContainer.slotTargetDynamic = dynamic$1;
|
10206 |
+
slotContainer.children = el.children.filter(function (c) {
|
10207 |
+
if (!c.slotScope) {
|
10208 |
+
c.parent = slotContainer;
|
10209 |
+
return true
|
10210 |
+
}
|
10211 |
+
});
|
10212 |
+
slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken;
|
10213 |
+
// remove children as they are returned from scopedSlots now
|
10214 |
+
el.children = [];
|
10215 |
+
// mark el non-plain so data gets generated
|
10216 |
+
el.plain = false;
|
10217 |
+
}
|
10218 |
+
}
|
10219 |
+
}
|
10220 |
+
}
|
10221 |
+
|
10222 |
+
function getSlotName (binding) {
|
10223 |
+
var name = binding.name.replace(slotRE, '');
|
10224 |
+
if (!name) {
|
10225 |
+
if (binding.name[0] !== '#') {
|
10226 |
+
name = 'default';
|
10227 |
+
} else {
|
10228 |
+
warn$2(
|
10229 |
+
"v-slot shorthand syntax requires a slot name.",
|
10230 |
+
binding
|
10231 |
+
);
|
10232 |
+
}
|
10233 |
+
}
|
10234 |
+
return dynamicArgRE.test(name)
|
10235 |
+
// dynamic [name]
|
10236 |
+
? { name: name.slice(1, -1), dynamic: true }
|
10237 |
+
// static name
|
10238 |
+
: { name: ("\"" + name + "\""), dynamic: false }
|
10239 |
+
}
|
10240 |
+
|
10241 |
+
// handle <slot/> outlets
|
10242 |
+
function processSlotOutlet (el) {
|
10243 |
+
if (el.tag === 'slot') {
|
10244 |
+
el.slotName = getBindingAttr(el, 'name');
|
10245 |
+
if (el.key) {
|
10246 |
+
warn$2(
|
10247 |
+
"`key` does not work on <slot> because slots are abstract outlets " +
|
10248 |
+
"and can possibly expand into multiple elements. " +
|
10249 |
+
"Use the key on a wrapping element instead.",
|
10250 |
+
getRawBindingAttr(el, 'key')
|
10251 |
+
);
|
10252 |
+
}
|
10253 |
+
}
|
10254 |
+
}
|
10255 |
+
|
10256 |
+
function processComponent (el) {
|
10257 |
+
var binding;
|
10258 |
+
if ((binding = getBindingAttr(el, 'is'))) {
|
10259 |
+
el.component = binding;
|
10260 |
+
}
|
10261 |
+
if (getAndRemoveAttr(el, 'inline-template') != null) {
|
10262 |
+
el.inlineTemplate = true;
|
10263 |
+
}
|
10264 |
+
}
|
10265 |
+
|
10266 |
+
function processAttrs (el) {
|
10267 |
+
var list = el.attrsList;
|
10268 |
+
var i, l, name, rawName, value, modifiers, syncGen, isDynamic;
|
10269 |
+
for (i = 0, l = list.length; i < l; i++) {
|
10270 |
+
name = rawName = list[i].name;
|
10271 |
+
value = list[i].value;
|
10272 |
+
if (dirRE.test(name)) {
|
10273 |
+
// mark element as dynamic
|
10274 |
+
el.hasBindings = true;
|
10275 |
+
// modifiers
|
10276 |
+
modifiers = parseModifiers(name.replace(dirRE, ''));
|
10277 |
+
// support .foo shorthand syntax for the .prop modifier
|
10278 |
+
if (modifiers) {
|
10279 |
+
name = name.replace(modifierRE, '');
|
10280 |
+
}
|
10281 |
+
if (bindRE.test(name)) { // v-bind
|
10282 |
+
name = name.replace(bindRE, '');
|
10283 |
+
value = parseFilters(value);
|
10284 |
+
isDynamic = dynamicArgRE.test(name);
|
10285 |
+
if (isDynamic) {
|
10286 |
+
name = name.slice(1, -1);
|
10287 |
+
}
|
10288 |
+
if (
|
10289 |
+
value.trim().length === 0
|
10290 |
+
) {
|
10291 |
+
warn$2(
|
10292 |
+
("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"")
|
10293 |
+
);
|
10294 |
+
}
|
10295 |
+
if (modifiers) {
|
10296 |
+
if (modifiers.prop && !isDynamic) {
|
10297 |
+
name = camelize(name);
|
10298 |
+
if (name === 'innerHtml') { name = 'innerHTML'; }
|
10299 |
+
}
|
10300 |
+
if (modifiers.camel && !isDynamic) {
|
10301 |
+
name = camelize(name);
|
10302 |
+
}
|
10303 |
+
if (modifiers.sync) {
|
10304 |
+
syncGen = genAssignmentCode(value, "$event");
|
10305 |
+
if (!isDynamic) {
|
10306 |
+
addHandler(
|
10307 |
+
el,
|
10308 |
+
("update:" + (camelize(name))),
|
10309 |
+
syncGen,
|
10310 |
+
null,
|
10311 |
+
false,
|
10312 |
+
warn$2,
|
10313 |
+
list[i]
|
10314 |
+
);
|
10315 |
+
if (hyphenate(name) !== camelize(name)) {
|
10316 |
+
addHandler(
|
10317 |
+
el,
|
10318 |
+
("update:" + (hyphenate(name))),
|
10319 |
+
syncGen,
|
10320 |
+
null,
|
10321 |
+
false,
|
10322 |
+
warn$2,
|
10323 |
+
list[i]
|
10324 |
+
);
|
10325 |
+
}
|
10326 |
+
} else {
|
10327 |
+
// handler w/ dynamic event name
|
10328 |
+
addHandler(
|
10329 |
+
el,
|
10330 |
+
("\"update:\"+(" + name + ")"),
|
10331 |
+
syncGen,
|
10332 |
+
null,
|
10333 |
+
false,
|
10334 |
+
warn$2,
|
10335 |
+
list[i],
|
10336 |
+
true // dynamic
|
10337 |
+
);
|
10338 |
+
}
|
10339 |
+
}
|
10340 |
+
}
|
10341 |
+
if ((modifiers && modifiers.prop) || (
|
10342 |
+
!el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)
|
10343 |
+
)) {
|
10344 |
+
addProp(el, name, value, list[i], isDynamic);
|
10345 |
+
} else {
|
10346 |
+
addAttr(el, name, value, list[i], isDynamic);
|
10347 |
+
}
|
10348 |
+
} else if (onRE.test(name)) { // v-on
|
10349 |
+
name = name.replace(onRE, '');
|
10350 |
+
isDynamic = dynamicArgRE.test(name);
|
10351 |
+
if (isDynamic) {
|
10352 |
+
name = name.slice(1, -1);
|
10353 |
+
}
|
10354 |
+
addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic);
|
10355 |
+
} else { // normal directives
|
10356 |
+
name = name.replace(dirRE, '');
|
10357 |
+
// parse arg
|
10358 |
+
var argMatch = name.match(argRE);
|
10359 |
+
var arg = argMatch && argMatch[1];
|
10360 |
+
isDynamic = false;
|
10361 |
+
if (arg) {
|
10362 |
+
name = name.slice(0, -(arg.length + 1));
|
10363 |
+
if (dynamicArgRE.test(arg)) {
|
10364 |
+
arg = arg.slice(1, -1);
|
10365 |
+
isDynamic = true;
|
10366 |
+
}
|
10367 |
+
}
|
10368 |
+
addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);
|
10369 |
+
if (name === 'model') {
|
10370 |
+
checkForAliasModel(el, value);
|
10371 |
+
}
|
10372 |
+
}
|
10373 |
+
} else {
|
10374 |
+
// literal attribute
|
10375 |
+
{
|
10376 |
+
var res = parseText(value, delimiters);
|
10377 |
+
if (res) {
|
10378 |
+
warn$2(
|
10379 |
+
name + "=\"" + value + "\": " +
|
10380 |
+
'Interpolation inside attributes has been removed. ' +
|
10381 |
+
'Use v-bind or the colon shorthand instead. For example, ' +
|
10382 |
+
'instead of <div id="{{ val }}">, use <div :id="val">.',
|
10383 |
+
list[i]
|
10384 |
+
);
|
10385 |
+
}
|
10386 |
+
}
|
10387 |
+
addAttr(el, name, JSON.stringify(value), list[i]);
|
10388 |
+
// #6887 firefox doesn't update muted state if set via attribute
|
10389 |
+
// even immediately after element creation
|
10390 |
+
if (!el.component &&
|
10391 |
+
name === 'muted' &&
|
10392 |
+
platformMustUseProp(el.tag, el.attrsMap.type, name)) {
|
10393 |
+
addProp(el, name, 'true', list[i]);
|
10394 |
+
}
|
10395 |
+
}
|
10396 |
+
}
|
10397 |
+
}
|
10398 |
+
|
10399 |
+
function checkInFor (el) {
|
10400 |
+
var parent = el;
|
10401 |
+
while (parent) {
|
10402 |
+
if (parent.for !== undefined) {
|
10403 |
+
return true
|
10404 |
+
}
|
10405 |
+
parent = parent.parent;
|
10406 |
+
}
|
10407 |
+
return false
|
10408 |
+
}
|
10409 |
+
|
10410 |
+
function parseModifiers (name) {
|
10411 |
+
var match = name.match(modifierRE);
|
10412 |
+
if (match) {
|
10413 |
+
var ret = {};
|
10414 |
+
match.forEach(function (m) { ret[m.slice(1)] = true; });
|
10415 |
+
return ret
|
10416 |
+
}
|
10417 |
+
}
|
10418 |
+
|
10419 |
+
function makeAttrsMap (attrs) {
|
10420 |
+
var map = {};
|
10421 |
+
for (var i = 0, l = attrs.length; i < l; i++) {
|
10422 |
+
if (
|
10423 |
+
map[attrs[i].name] && !isIE && !isEdge
|
10424 |
+
) {
|
10425 |
+
warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]);
|
10426 |
+
}
|
10427 |
+
map[attrs[i].name] = attrs[i].value;
|
10428 |
+
}
|
10429 |
+
return map
|
10430 |
+
}
|
10431 |
+
|
10432 |
+
// for script (e.g. type="x/template") or style, do not decode content
|
10433 |
+
function isTextTag (el) {
|
10434 |
+
return el.tag === 'script' || el.tag === 'style'
|
10435 |
+
}
|
10436 |
+
|
10437 |
+
function isForbiddenTag (el) {
|
10438 |
+
return (
|
10439 |
+
el.tag === 'style' ||
|
10440 |
+
(el.tag === 'script' && (
|
10441 |
+
!el.attrsMap.type ||
|
10442 |
+
el.attrsMap.type === 'text/javascript'
|
10443 |
+
))
|
10444 |
+
)
|
10445 |
+
}
|
10446 |
+
|
10447 |
+
var ieNSBug = /^xmlns:NS\d+/;
|
10448 |
+
var ieNSPrefix = /^NS\d+:/;
|
10449 |
+
|
10450 |
+
/* istanbul ignore next */
|
10451 |
+
function guardIESVGBug (attrs) {
|
10452 |
+
var res = [];
|
10453 |
+
for (var i = 0; i < attrs.length; i++) {
|
10454 |
+
var attr = attrs[i];
|
10455 |
+
if (!ieNSBug.test(attr.name)) {
|
10456 |
+
attr.name = attr.name.replace(ieNSPrefix, '');
|
10457 |
+
res.push(attr);
|
10458 |
+
}
|
10459 |
+
}
|
10460 |
+
return res
|
10461 |
+
}
|
10462 |
+
|
10463 |
+
function checkForAliasModel (el, value) {
|
10464 |
+
var _el = el;
|
10465 |
+
while (_el) {
|
10466 |
+
if (_el.for && _el.alias === value) {
|
10467 |
+
warn$2(
|
10468 |
+
"<" + (el.tag) + " v-model=\"" + value + "\">: " +
|
10469 |
+
"You are binding v-model directly to a v-for iteration alias. " +
|
10470 |
+
"This will not be able to modify the v-for source array because " +
|
10471 |
+
"writing to the alias is like modifying a function local variable. " +
|
10472 |
+
"Consider using an array of objects and use v-model on an object property instead.",
|
10473 |
+
el.rawAttrsMap['v-model']
|
10474 |
+
);
|
10475 |
+
}
|
10476 |
+
_el = _el.parent;
|
10477 |
+
}
|
10478 |
+
}
|
10479 |
+
|
10480 |
+
/* */
|
10481 |
+
|
10482 |
+
function preTransformNode (el, options) {
|
10483 |
+
if (el.tag === 'input') {
|
10484 |
+
var map = el.attrsMap;
|
10485 |
+
if (!map['v-model']) {
|
10486 |
+
return
|
10487 |
+
}
|
10488 |
+
|
10489 |
+
var typeBinding;
|
10490 |
+
if (map[':type'] || map['v-bind:type']) {
|
10491 |
+
typeBinding = getBindingAttr(el, 'type');
|
10492 |
+
}
|
10493 |
+
if (!map.type && !typeBinding && map['v-bind']) {
|
10494 |
+
typeBinding = "(" + (map['v-bind']) + ").type";
|
10495 |
+
}
|
10496 |
+
|
10497 |
+
if (typeBinding) {
|
10498 |
+
var ifCondition = getAndRemoveAttr(el, 'v-if', true);
|
10499 |
+
var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : "";
|
10500 |
+
var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;
|
10501 |
+
var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);
|
10502 |
+
// 1. checkbox
|
10503 |
+
var branch0 = cloneASTElement(el);
|
10504 |
+
// process for on the main node
|
10505 |
+
processFor(branch0);
|
10506 |
+
addRawAttr(branch0, 'type', 'checkbox');
|
10507 |
+
processElement(branch0, options);
|
10508 |
+
branch0.processed = true; // prevent it from double-processed
|
10509 |
+
branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra;
|
10510 |
+
addIfCondition(branch0, {
|
10511 |
+
exp: branch0.if,
|
10512 |
+
block: branch0
|
10513 |
+
});
|
10514 |
+
// 2. add radio else-if condition
|
10515 |
+
var branch1 = cloneASTElement(el);
|
10516 |
+
getAndRemoveAttr(branch1, 'v-for', true);
|
10517 |
+
addRawAttr(branch1, 'type', 'radio');
|
10518 |
+
processElement(branch1, options);
|
10519 |
+
addIfCondition(branch0, {
|
10520 |
+
exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra,
|
10521 |
+
block: branch1
|
10522 |
+
});
|
10523 |
+
// 3. other
|
10524 |
+
var branch2 = cloneASTElement(el);
|
10525 |
+
getAndRemoveAttr(branch2, 'v-for', true);
|
10526 |
+
addRawAttr(branch2, ':type', typeBinding);
|
10527 |
+
processElement(branch2, options);
|
10528 |
+
addIfCondition(branch0, {
|
10529 |
+
exp: ifCondition,
|
10530 |
+
block: branch2
|
10531 |
+
});
|
10532 |
+
|
10533 |
+
if (hasElse) {
|
10534 |
+
branch0.else = true;
|
10535 |
+
} else if (elseIfCondition) {
|
10536 |
+
branch0.elseif = elseIfCondition;
|
10537 |
+
}
|
10538 |
+
|
10539 |
+
return branch0
|
10540 |
+
}
|
10541 |
+
}
|
10542 |
+
}
|
10543 |
+
|
10544 |
+
function cloneASTElement (el) {
|
10545 |
+
return createASTElement(el.tag, el.attrsList.slice(), el.parent)
|
10546 |
+
}
|
10547 |
+
|
10548 |
+
var model$1 = {
|
10549 |
+
preTransformNode: preTransformNode
|
10550 |
+
};
|
10551 |
+
|
10552 |
+
var modules$1 = [
|
10553 |
+
klass$1,
|
10554 |
+
style$1,
|
10555 |
+
model$1
|
10556 |
+
];
|
10557 |
+
|
10558 |
+
/* */
|
10559 |
+
|
10560 |
+
function text (el, dir) {
|
10561 |
+
if (dir.value) {
|
10562 |
+
addProp(el, 'textContent', ("_s(" + (dir.value) + ")"), dir);
|
10563 |
+
}
|
10564 |
+
}
|
10565 |
+
|
10566 |
+
/* */
|
10567 |
+
|
10568 |
+
function html (el, dir) {
|
10569 |
+
if (dir.value) {
|
10570 |
+
addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"), dir);
|
10571 |
+
}
|
10572 |
+
}
|
10573 |
+
|
10574 |
+
var directives$1 = {
|
10575 |
+
model: model,
|
10576 |
+
text: text,
|
10577 |
+
html: html
|
10578 |
+
};
|
10579 |
+
|
10580 |
+
/* */
|
10581 |
+
|
10582 |
+
var baseOptions = {
|
10583 |
+
expectHTML: true,
|
10584 |
+
modules: modules$1,
|
10585 |
+
directives: directives$1,
|
10586 |
+
isPreTag: isPreTag,
|
10587 |
+
isUnaryTag: isUnaryTag,
|
10588 |
+
mustUseProp: mustUseProp,
|
10589 |
+
canBeLeftOpenTag: canBeLeftOpenTag,
|
10590 |
+
isReservedTag: isReservedTag,
|
10591 |
+
getTagNamespace: getTagNamespace,
|
10592 |
+
staticKeys: genStaticKeys(modules$1)
|
10593 |
+
};
|
10594 |
+
|
10595 |
+
/* */
|
10596 |
+
|
10597 |
+
var isStaticKey;
|
10598 |
+
var isPlatformReservedTag;
|
10599 |
+
|
10600 |
+
var genStaticKeysCached = cached(genStaticKeys$1);
|
10601 |
+
|
10602 |
+
/**
|
10603 |
+
* Goal of the optimizer: walk the generated template AST tree
|
10604 |
+
* and detect sub-trees that are purely static, i.e. parts of
|
10605 |
+
* the DOM that never needs to change.
|
10606 |
+
*
|
10607 |
+
* Once we detect these sub-trees, we can:
|
10608 |
+
*
|
10609 |
+
* 1. Hoist them into constants, so that we no longer need to
|
10610 |
+
* create fresh nodes for them on each re-render;
|
10611 |
+
* 2. Completely skip them in the patching process.
|
10612 |
+
*/
|
10613 |
+
function optimize (root, options) {
|
10614 |
+
if (!root) { return }
|
10615 |
+
isStaticKey = genStaticKeysCached(options.staticKeys || '');
|
10616 |
+
isPlatformReservedTag = options.isReservedTag || no;
|
10617 |
+
// first pass: mark all non-static nodes.
|
10618 |
+
markStatic$1(root);
|
10619 |
+
// second pass: mark static roots.
|
10620 |
+
markStaticRoots(root, false);
|
10621 |
+
}
|
10622 |
+
|
10623 |
+
function genStaticKeys$1 (keys) {
|
10624 |
+
return makeMap(
|
10625 |
+
'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' +
|
10626 |
+
(keys ? ',' + keys : '')
|
10627 |
+
)
|
10628 |
+
}
|
10629 |
+
|
10630 |
+
function markStatic$1 (node) {
|
10631 |
+
node.static = isStatic(node);
|
10632 |
+
if (node.type === 1) {
|
10633 |
+
// do not make component slot content static. this avoids
|
10634 |
+
// 1. components not able to mutate slot nodes
|
10635 |
+
// 2. static slot content fails for hot-reloading
|
10636 |
+
if (
|
10637 |
+
!isPlatformReservedTag(node.tag) &&
|
10638 |
+
node.tag !== 'slot' &&
|
10639 |
+
node.attrsMap['inline-template'] == null
|
10640 |
+
) {
|
10641 |
+
return
|
10642 |
+
}
|
10643 |
+
for (var i = 0, l = node.children.length; i < l; i++) {
|
10644 |
+
var child = node.children[i];
|
10645 |
+
markStatic$1(child);
|
10646 |
+
if (!child.static) {
|
10647 |
+
node.static = false;
|
10648 |
+
}
|
10649 |
+
}
|
10650 |
+
if (node.ifConditions) {
|
10651 |
+
for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
|
10652 |
+
var block = node.ifConditions[i$1].block;
|
10653 |
+
markStatic$1(block);
|
10654 |
+
if (!block.static) {
|
10655 |
+
node.static = false;
|
10656 |
+
}
|
10657 |
+
}
|
10658 |
+
}
|
10659 |
+
}
|
10660 |
+
}
|
10661 |
+
|
10662 |
+
function markStaticRoots (node, isInFor) {
|
10663 |
+
if (node.type === 1) {
|
10664 |
+
if (node.static || node.once) {
|
10665 |
+
node.staticInFor = isInFor;
|
10666 |
+
}
|
10667 |
+
// For a node to qualify as a static root, it should have children that
|
10668 |
+
// are not just static text. Otherwise the cost of hoisting out will
|
10669 |
+
// outweigh the benefits and it's better off to just always render it fresh.
|
10670 |
+
if (node.static && node.children.length && !(
|
10671 |
+
node.children.length === 1 &&
|
10672 |
+
node.children[0].type === 3
|
10673 |
+
)) {
|
10674 |
+
node.staticRoot = true;
|
10675 |
+
return
|
10676 |
+
} else {
|
10677 |
+
node.staticRoot = false;
|
10678 |
+
}
|
10679 |
+
if (node.children) {
|
10680 |
+
for (var i = 0, l = node.children.length; i < l; i++) {
|
10681 |
+
markStaticRoots(node.children[i], isInFor || !!node.for);
|
10682 |
+
}
|
10683 |
+
}
|
10684 |
+
if (node.ifConditions) {
|
10685 |
+
for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
|
10686 |
+
markStaticRoots(node.ifConditions[i$1].block, isInFor);
|
10687 |
+
}
|
10688 |
+
}
|
10689 |
+
}
|
10690 |
+
}
|
10691 |
+
|
10692 |
+
function isStatic (node) {
|
10693 |
+
if (node.type === 2) { // expression
|
10694 |
+
return false
|
10695 |
+
}
|
10696 |
+
if (node.type === 3) { // text
|
10697 |
+
return true
|
10698 |
+
}
|
10699 |
+
return !!(node.pre || (
|
10700 |
+
!node.hasBindings && // no dynamic bindings
|
10701 |
+
!node.if && !node.for && // not v-if or v-for or v-else
|
10702 |
+
!isBuiltInTag(node.tag) && // not a built-in
|
10703 |
+
isPlatformReservedTag(node.tag) && // not a component
|
10704 |
+
!isDirectChildOfTemplateFor(node) &&
|
10705 |
+
Object.keys(node).every(isStaticKey)
|
10706 |
+
))
|
10707 |
+
}
|
10708 |
+
|
10709 |
+
function isDirectChildOfTemplateFor (node) {
|
10710 |
+
while (node.parent) {
|
10711 |
+
node = node.parent;
|
10712 |
+
if (node.tag !== 'template') {
|
10713 |
+
return false
|
10714 |
+
}
|
10715 |
+
if (node.for) {
|
10716 |
+
return true
|
10717 |
+
}
|
10718 |
+
}
|
10719 |
+
return false
|
10720 |
+
}
|
10721 |
+
|
10722 |
+
/* */
|
10723 |
+
|
10724 |
+
var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*(?:[\w$]+)?\s*\(/;
|
10725 |
+
var fnInvokeRE = /\([^)]*?\);*$/;
|
10726 |
+
var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
|
10727 |
+
|
10728 |
+
// KeyboardEvent.keyCode aliases
|
10729 |
+
var keyCodes = {
|
10730 |
+
esc: 27,
|
10731 |
+
tab: 9,
|
10732 |
+
enter: 13,
|
10733 |
+
space: 32,
|
10734 |
+
up: 38,
|
10735 |
+
left: 37,
|
10736 |
+
right: 39,
|
10737 |
+
down: 40,
|
10738 |
+
'delete': [8, 46]
|
10739 |
+
};
|
10740 |
+
|
10741 |
+
// KeyboardEvent.key aliases
|
10742 |
+
var keyNames = {
|
10743 |
+
// #7880: IE11 and Edge use `Esc` for Escape key name.
|
10744 |
+
esc: ['Esc', 'Escape'],
|
10745 |
+
tab: 'Tab',
|
10746 |
+
enter: 'Enter',
|
10747 |
+
// #9112: IE11 uses `Spacebar` for Space key name.
|
10748 |
+
space: [' ', 'Spacebar'],
|
10749 |
+
// #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
|
10750 |
+
up: ['Up', 'ArrowUp'],
|
10751 |
+
left: ['Left', 'ArrowLeft'],
|
10752 |
+
right: ['Right', 'ArrowRight'],
|
10753 |
+
down: ['Down', 'ArrowDown'],
|
10754 |
+
// #9112: IE11 uses `Del` for Delete key name.
|
10755 |
+
'delete': ['Backspace', 'Delete', 'Del']
|
10756 |
+
};
|
10757 |
+
|
10758 |
+
// #4868: modifiers that prevent the execution of the listener
|
10759 |
+
// need to explicitly return null so that we can determine whether to remove
|
10760 |
+
// the listener for .once
|
10761 |
+
var genGuard = function (condition) { return ("if(" + condition + ")return null;"); };
|
10762 |
+
|
10763 |
+
var modifierCode = {
|
10764 |
+
stop: '$event.stopPropagation();',
|
10765 |
+
prevent: '$event.preventDefault();',
|
10766 |
+
self: genGuard("$event.target !== $event.currentTarget"),
|
10767 |
+
ctrl: genGuard("!$event.ctrlKey"),
|
10768 |
+
shift: genGuard("!$event.shiftKey"),
|
10769 |
+
alt: genGuard("!$event.altKey"),
|
10770 |
+
meta: genGuard("!$event.metaKey"),
|
10771 |
+
left: genGuard("'button' in $event && $event.button !== 0"),
|
10772 |
+
middle: genGuard("'button' in $event && $event.button !== 1"),
|
10773 |
+
right: genGuard("'button' in $event && $event.button !== 2")
|
10774 |
+
};
|
10775 |
+
|
10776 |
+
function genHandlers (
|
10777 |
+
events,
|
10778 |
+
isNative
|
10779 |
+
) {
|
10780 |
+
var prefix = isNative ? 'nativeOn:' : 'on:';
|
10781 |
+
var staticHandlers = "";
|
10782 |
+
var dynamicHandlers = "";
|
10783 |
+
for (var name in events) {
|
10784 |
+
var handlerCode = genHandler(events[name]);
|
10785 |
+
if (events[name] && events[name].dynamic) {
|
10786 |
+
dynamicHandlers += name + "," + handlerCode + ",";
|
10787 |
+
} else {
|
10788 |
+
staticHandlers += "\"" + name + "\":" + handlerCode + ",";
|
10789 |
+
}
|
10790 |
+
}
|
10791 |
+
staticHandlers = "{" + (staticHandlers.slice(0, -1)) + "}";
|
10792 |
+
if (dynamicHandlers) {
|
10793 |
+
return prefix + "_d(" + staticHandlers + ",[" + (dynamicHandlers.slice(0, -1)) + "])"
|
10794 |
+
} else {
|
10795 |
+
return prefix + staticHandlers
|
10796 |
+
}
|
10797 |
+
}
|
10798 |
+
|
10799 |
+
function genHandler (handler) {
|
10800 |
+
if (!handler) {
|
10801 |
+
return 'function(){}'
|
10802 |
+
}
|
10803 |
+
|
10804 |
+
if (Array.isArray(handler)) {
|
10805 |
+
return ("[" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + "]")
|
10806 |
+
}
|
10807 |
+
|
10808 |
+
var isMethodPath = simplePathRE.test(handler.value);
|
10809 |
+
var isFunctionExpression = fnExpRE.test(handler.value);
|
10810 |
+
var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));
|
10811 |
+
|
10812 |
+
if (!handler.modifiers) {
|
10813 |
+
if (isMethodPath || isFunctionExpression) {
|
10814 |
+
return handler.value
|
10815 |
+
}
|
10816 |
+
return ("function($event){" + (isFunctionInvocation ? ("return " + (handler.value)) : handler.value) + "}") // inline statement
|
10817 |
+
} else {
|
10818 |
+
var code = '';
|
10819 |
+
var genModifierCode = '';
|
10820 |
+
var keys = [];
|
10821 |
+
for (var key in handler.modifiers) {
|
10822 |
+
if (modifierCode[key]) {
|
10823 |
+
genModifierCode += modifierCode[key];
|
10824 |
+
// left/right
|
10825 |
+
if (keyCodes[key]) {
|
10826 |
+
keys.push(key);
|
10827 |
+
}
|
10828 |
+
} else if (key === 'exact') {
|
10829 |
+
var modifiers = (handler.modifiers);
|
10830 |
+
genModifierCode += genGuard(
|
10831 |
+
['ctrl', 'shift', 'alt', 'meta']
|
10832 |
+
.filter(function (keyModifier) { return !modifiers[keyModifier]; })
|
10833 |
+
.map(function (keyModifier) { return ("$event." + keyModifier + "Key"); })
|
10834 |
+
.join('||')
|
10835 |
+
);
|
10836 |
+
} else {
|
10837 |
+
keys.push(key);
|
10838 |
+
}
|
10839 |
+
}
|
10840 |
+
if (keys.length) {
|
10841 |
+
code += genKeyFilter(keys);
|
10842 |
+
}
|
10843 |
+
// Make sure modifiers like prevent and stop get executed after key filtering
|
10844 |
+
if (genModifierCode) {
|
10845 |
+
code += genModifierCode;
|
10846 |
+
}
|
10847 |
+
var handlerCode = isMethodPath
|
10848 |
+
? ("return " + (handler.value) + "($event)")
|
10849 |
+
: isFunctionExpression
|
10850 |
+
? ("return (" + (handler.value) + ")($event)")
|
10851 |
+
: isFunctionInvocation
|
10852 |
+
? ("return " + (handler.value))
|
10853 |
+
: handler.value;
|
10854 |
+
return ("function($event){" + code + handlerCode + "}")
|
10855 |
+
}
|
10856 |
+
}
|
10857 |
+
|
10858 |
+
function genKeyFilter (keys) {
|
10859 |
+
return (
|
10860 |
+
// make sure the key filters only apply to KeyboardEvents
|
10861 |
+
// #9441: can't use 'keyCode' in $event because Chrome autofill fires fake
|
10862 |
+
// key events that do not have keyCode property...
|
10863 |
+
"if(!$event.type.indexOf('key')&&" +
|
10864 |
+
(keys.map(genFilterCode).join('&&')) + ")return null;"
|
10865 |
+
)
|
10866 |
+
}
|
10867 |
+
|
10868 |
+
function genFilterCode (key) {
|
10869 |
+
var keyVal = parseInt(key, 10);
|
10870 |
+
if (keyVal) {
|
10871 |
+
return ("$event.keyCode!==" + keyVal)
|
10872 |
+
}
|
10873 |
+
var keyCode = keyCodes[key];
|
10874 |
+
var keyName = keyNames[key];
|
10875 |
+
return (
|
10876 |
+
"_k($event.keyCode," +
|
10877 |
+
(JSON.stringify(key)) + "," +
|
10878 |
+
(JSON.stringify(keyCode)) + "," +
|
10879 |
+
"$event.key," +
|
10880 |
+
"" + (JSON.stringify(keyName)) +
|
10881 |
+
")"
|
10882 |
+
)
|
10883 |
+
}
|
10884 |
+
|
10885 |
+
/* */
|
10886 |
+
|
10887 |
+
function on (el, dir) {
|
10888 |
+
if (dir.modifiers) {
|
10889 |
+
warn("v-on without argument does not support modifiers.");
|
10890 |
+
}
|
10891 |
+
el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); };
|
10892 |
+
}
|
10893 |
+
|
10894 |
+
/* */
|
10895 |
+
|
10896 |
+
function bind$1 (el, dir) {
|
10897 |
+
el.wrapData = function (code) {
|
10898 |
+
return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")")
|
10899 |
+
};
|
10900 |
+
}
|
10901 |
+
|
10902 |
+
/* */
|
10903 |
+
|
10904 |
+
var baseDirectives = {
|
10905 |
+
on: on,
|
10906 |
+
bind: bind$1,
|
10907 |
+
cloak: noop
|
10908 |
+
};
|
10909 |
+
|
10910 |
+
/* */
|
10911 |
+
|
10912 |
+
|
10913 |
+
|
10914 |
+
|
10915 |
+
|
10916 |
+
var CodegenState = function CodegenState (options) {
|
10917 |
+
this.options = options;
|
10918 |
+
this.warn = options.warn || baseWarn;
|
10919 |
+
this.transforms = pluckModuleFunction(options.modules, 'transformCode');
|
10920 |
+
this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
|
10921 |
+
this.directives = extend(extend({}, baseDirectives), options.directives);
|
10922 |
+
var isReservedTag = options.isReservedTag || no;
|
10923 |
+
this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
|
10924 |
+
this.onceId = 0;
|
10925 |
+
this.staticRenderFns = [];
|
10926 |
+
this.pre = false;
|
10927 |
+
};
|
10928 |
+
|
10929 |
+
|
10930 |
+
|
10931 |
+
function generate (
|
10932 |
+
ast,
|
10933 |
+
options
|
10934 |
+
) {
|
10935 |
+
var state = new CodegenState(options);
|
10936 |
+
var code = ast ? genElement(ast, state) : '_c("div")';
|
10937 |
+
return {
|
10938 |
+
render: ("with(this){return " + code + "}"),
|
10939 |
+
staticRenderFns: state.staticRenderFns
|
10940 |
+
}
|
10941 |
+
}
|
10942 |
+
|
10943 |
+
function genElement (el, state) {
|
10944 |
+
if (el.parent) {
|
10945 |
+
el.pre = el.pre || el.parent.pre;
|
10946 |
+
}
|
10947 |
+
|
10948 |
+
if (el.staticRoot && !el.staticProcessed) {
|
10949 |
+
return genStatic(el, state)
|
10950 |
+
} else if (el.once && !el.onceProcessed) {
|
10951 |
+
return genOnce(el, state)
|
10952 |
+
} else if (el.for && !el.forProcessed) {
|
10953 |
+
return genFor(el, state)
|
10954 |
+
} else if (el.if && !el.ifProcessed) {
|
10955 |
+
return genIf(el, state)
|
10956 |
+
} else if (el.tag === 'template' && !el.slotTarget && !state.pre) {
|
10957 |
+
return genChildren(el, state) || 'void 0'
|
10958 |
+
} else if (el.tag === 'slot') {
|
10959 |
+
return genSlot(el, state)
|
10960 |
+
} else {
|
10961 |
+
// component or element
|
10962 |
+
var code;
|
10963 |
+
if (el.component) {
|
10964 |
+
code = genComponent(el.component, el, state);
|
10965 |
+
} else {
|
10966 |
+
var data;
|
10967 |
+
if (!el.plain || (el.pre && state.maybeComponent(el))) {
|
10968 |
+
data = genData$2(el, state);
|
10969 |
+
}
|
10970 |
+
|
10971 |
+
var children = el.inlineTemplate ? null : genChildren(el, state, true);
|
10972 |
+
code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
|
10973 |
+
}
|
10974 |
+
// module transforms
|
10975 |
+
for (var i = 0; i < state.transforms.length; i++) {
|
10976 |
+
code = state.transforms[i](el, code);
|
10977 |
+
}
|
10978 |
+
return code
|
10979 |
+
}
|
10980 |
+
}
|
10981 |
+
|
10982 |
+
// hoist static sub-trees out
|
10983 |
+
function genStatic (el, state) {
|
10984 |
+
el.staticProcessed = true;
|
10985 |
+
// Some elements (templates) need to behave differently inside of a v-pre
|
10986 |
+
// node. All pre nodes are static roots, so we can use this as a location to
|
10987 |
+
// wrap a state change and reset it upon exiting the pre node.
|
10988 |
+
var originalPreState = state.pre;
|
10989 |
+
if (el.pre) {
|
10990 |
+
state.pre = el.pre;
|
10991 |
+
}
|
10992 |
+
state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}"));
|
10993 |
+
state.pre = originalPreState;
|
10994 |
+
return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
|
10995 |
+
}
|
10996 |
+
|
10997 |
+
// v-once
|
10998 |
+
function genOnce (el, state) {
|
10999 |
+
el.onceProcessed = true;
|
11000 |
+
if (el.if && !el.ifProcessed) {
|
11001 |
+
return genIf(el, state)
|
11002 |
+
} else if (el.staticInFor) {
|
11003 |
+
var key = '';
|
11004 |
+
var parent = el.parent;
|
11005 |
+
while (parent) {
|
11006 |
+
if (parent.for) {
|
11007 |
+
key = parent.key;
|
11008 |
+
break
|
11009 |
+
}
|
11010 |
+
parent = parent.parent;
|
11011 |
+
}
|
11012 |
+
if (!key) {
|
11013 |
+
state.warn(
|
11014 |
+
"v-once can only be used inside v-for that is keyed. ",
|
11015 |
+
el.rawAttrsMap['v-once']
|
11016 |
+
);
|
11017 |
+
return genElement(el, state)
|
11018 |
+
}
|
11019 |
+
return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")")
|
11020 |
+
} else {
|
11021 |
+
return genStatic(el, state)
|
11022 |
+
}
|
11023 |
+
}
|
11024 |
+
|
11025 |
+
function genIf (
|
11026 |
+
el,
|
11027 |
+
state,
|
11028 |
+
altGen,
|
11029 |
+
altEmpty
|
11030 |
+
) {
|
11031 |
+
el.ifProcessed = true; // avoid recursion
|
11032 |
+
return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)
|
11033 |
+
}
|
11034 |
+
|
11035 |
+
function genIfConditions (
|
11036 |
+
conditions,
|
11037 |
+
state,
|
11038 |
+
altGen,
|
11039 |
+
altEmpty
|
11040 |
+
) {
|
11041 |
+
if (!conditions.length) {
|
11042 |
+
return altEmpty || '_e()'
|
11043 |
+
}
|
11044 |
+
|
11045 |
+
var condition = conditions.shift();
|
11046 |
+
if (condition.exp) {
|
11047 |
+
return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty)))
|
11048 |
+
} else {
|
11049 |
+
return ("" + (genTernaryExp(condition.block)))
|
11050 |
+
}
|
11051 |
+
|
11052 |
+
// v-if with v-once should generate code like (a)?_m(0):_m(1)
|
11053 |
+
function genTernaryExp (el) {
|
11054 |
+
return altGen
|
11055 |
+
? altGen(el, state)
|
11056 |
+
: el.once
|
11057 |
+
? genOnce(el, state)
|
11058 |
+
: genElement(el, state)
|
11059 |
+
}
|
11060 |
+
}
|
11061 |
+
|
11062 |
+
function genFor (
|
11063 |
+
el,
|
11064 |
+
state,
|
11065 |
+
altGen,
|
11066 |
+
altHelper
|
11067 |
+
) {
|
11068 |
+
var exp = el.for;
|
11069 |
+
var alias = el.alias;
|
11070 |
+
var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
|
11071 |
+
var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
|
11072 |
+
|
11073 |
+
if (state.maybeComponent(el) &&
|
11074 |
+
el.tag !== 'slot' &&
|
11075 |
+
el.tag !== 'template' &&
|
11076 |
+
!el.key
|
11077 |
+
) {
|
11078 |
+
state.warn(
|
11079 |
+
"<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " +
|
11080 |
+
"v-for should have explicit keys. " +
|
11081 |
+
"See https://vuejs.org/guide/list.html#key for more info.",
|
11082 |
+
el.rawAttrsMap['v-for'],
|
11083 |
+
true /* tip */
|
11084 |
+
);
|
11085 |
+
}
|
11086 |
+
|
11087 |
+
el.forProcessed = true; // avoid recursion
|
11088 |
+
return (altHelper || '_l') + "((" + exp + ")," +
|
11089 |
+
"function(" + alias + iterator1 + iterator2 + "){" +
|
11090 |
+
"return " + ((altGen || genElement)(el, state)) +
|
11091 |
+
'})'
|
11092 |
+
}
|
11093 |
+
|
11094 |
+
function genData$2 (el, state) {
|
11095 |
+
var data = '{';
|
11096 |
+
|
11097 |
+
// directives first.
|
11098 |
+
// directives may mutate the el's other properties before they are generated.
|
11099 |
+
var dirs = genDirectives(el, state);
|
11100 |
+
if (dirs) { data += dirs + ','; }
|
11101 |
+
|
11102 |
+
// key
|
11103 |
+
if (el.key) {
|
11104 |
+
data += "key:" + (el.key) + ",";
|
11105 |
+
}
|
11106 |
+
// ref
|
11107 |
+
if (el.ref) {
|
11108 |
+
data += "ref:" + (el.ref) + ",";
|
11109 |
+
}
|
11110 |
+
if (el.refInFor) {
|
11111 |
+
data += "refInFor:true,";
|
11112 |
+
}
|
11113 |
+
// pre
|
11114 |
+
if (el.pre) {
|
11115 |
+
data += "pre:true,";
|
11116 |
+
}
|
11117 |
+
// record original tag name for components using "is" attribute
|
11118 |
+
if (el.component) {
|
11119 |
+
data += "tag:\"" + (el.tag) + "\",";
|
11120 |
+
}
|
11121 |
+
// module data generation functions
|
11122 |
+
for (var i = 0; i < state.dataGenFns.length; i++) {
|
11123 |
+
data += state.dataGenFns[i](el);
|
11124 |
+
}
|
11125 |
+
// attributes
|
11126 |
+
if (el.attrs) {
|
11127 |
+
data += "attrs:" + (genProps(el.attrs)) + ",";
|
11128 |
+
}
|
11129 |
+
// DOM props
|
11130 |
+
if (el.props) {
|
11131 |
+
data += "domProps:" + (genProps(el.props)) + ",";
|
11132 |
+
}
|
11133 |
+
// event handlers
|
11134 |
+
if (el.events) {
|
11135 |
+
data += (genHandlers(el.events, false)) + ",";
|
11136 |
+
}
|
11137 |
+
if (el.nativeEvents) {
|
11138 |
+
data += (genHandlers(el.nativeEvents, true)) + ",";
|
11139 |
+
}
|
11140 |
+
// slot target
|
11141 |
+
// only for non-scoped slots
|
11142 |
+
if (el.slotTarget && !el.slotScope) {
|
11143 |
+
data += "slot:" + (el.slotTarget) + ",";
|
11144 |
+
}
|
11145 |
+
// scoped slots
|
11146 |
+
if (el.scopedSlots) {
|
11147 |
+
data += (genScopedSlots(el, el.scopedSlots, state)) + ",";
|
11148 |
+
}
|
11149 |
+
// component v-model
|
11150 |
+
if (el.model) {
|
11151 |
+
data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},";
|
11152 |
+
}
|
11153 |
+
// inline-template
|
11154 |
+
if (el.inlineTemplate) {
|
11155 |
+
var inlineTemplate = genInlineTemplate(el, state);
|
11156 |
+
if (inlineTemplate) {
|
11157 |
+
data += inlineTemplate + ",";
|
11158 |
+
}
|
11159 |
+
}
|
11160 |
+
data = data.replace(/,$/, '') + '}';
|
11161 |
+
// v-bind dynamic argument wrap
|
11162 |
+
// v-bind with dynamic arguments must be applied using the same v-bind object
|
11163 |
+
// merge helper so that class/style/mustUseProp attrs are handled correctly.
|
11164 |
+
if (el.dynamicAttrs) {
|
11165 |
+
data = "_b(" + data + ",\"" + (el.tag) + "\"," + (genProps(el.dynamicAttrs)) + ")";
|
11166 |
+
}
|
11167 |
+
// v-bind data wrap
|
11168 |
+
if (el.wrapData) {
|
11169 |
+
data = el.wrapData(data);
|
11170 |
+
}
|
11171 |
+
// v-on data wrap
|
11172 |
+
if (el.wrapListeners) {
|
11173 |
+
data = el.wrapListeners(data);
|
11174 |
+
}
|
11175 |
+
return data
|
11176 |
+
}
|
11177 |
+
|
11178 |
+
function genDirectives (el, state) {
|
11179 |
+
var dirs = el.directives;
|
11180 |
+
if (!dirs) { return }
|
11181 |
+
var res = 'directives:[';
|
11182 |
+
var hasRuntime = false;
|
11183 |
+
var i, l, dir, needRuntime;
|
11184 |
+
for (i = 0, l = dirs.length; i < l; i++) {
|
11185 |
+
dir = dirs[i];
|
11186 |
+
needRuntime = true;
|
11187 |
+
var gen = state.directives[dir.name];
|
11188 |
+
if (gen) {
|
11189 |
+
// compile-time directive that manipulates AST.
|
11190 |
+
// returns true if it also needs a runtime counterpart.
|
11191 |
+
needRuntime = !!gen(el, dir, state.warn);
|
11192 |
+
}
|
11193 |
+
if (needRuntime) {
|
11194 |
+
hasRuntime = true;
|
11195 |
+
res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:" + (dir.isDynamicArg ? dir.arg : ("\"" + (dir.arg) + "\""))) : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
|
11196 |
+
}
|
11197 |
+
}
|
11198 |
+
if (hasRuntime) {
|
11199 |
+
return res.slice(0, -1) + ']'
|
11200 |
}
|
|
|
|
|
11201 |
}
|
|
|
11202 |
|
11203 |
+
function genInlineTemplate (el, state) {
|
11204 |
+
var ast = el.children[0];
|
11205 |
+
if (el.children.length !== 1 || ast.type !== 1) {
|
11206 |
+
state.warn(
|
11207 |
+
'Inline-template components must have exactly one child element.',
|
11208 |
+
{ start: el.start }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11209 |
);
|
11210 |
+
}
|
11211 |
+
if (ast && ast.type === 1) {
|
11212 |
+
var inlineRenderFns = generate(ast, state.options);
|
11213 |
+
return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
|
11214 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11215 |
}
|
|
|
11216 |
|
11217 |
+
function genScopedSlots (
|
11218 |
+
el,
|
11219 |
+
slots,
|
11220 |
+
state
|
11221 |
+
) {
|
11222 |
+
// by default scoped slots are considered "stable", this allows child
|
11223 |
+
// components with only scoped slots to skip forced updates from parent.
|
11224 |
+
// but in some cases we have to bail-out of this optimization
|
11225 |
+
// for example if the slot contains dynamic names, has v-if or v-for on them...
|
11226 |
+
var needsForceUpdate = el.for || Object.keys(slots).some(function (key) {
|
11227 |
+
var slot = slots[key];
|
11228 |
+
return (
|
11229 |
+
slot.slotTargetDynamic ||
|
11230 |
+
slot.if ||
|
11231 |
+
slot.for ||
|
11232 |
+
containsSlotChild(slot) // is passing down slot from parent which may be dynamic
|
11233 |
+
)
|
11234 |
+
});
|
11235 |
+
|
11236 |
+
// #9534: if a component with scoped slots is inside a conditional branch,
|
11237 |
+
// it's possible for the same component to be reused but with different
|
11238 |
+
// compiled slot content. To avoid that, we generate a unique key based on
|
11239 |
+
// the generated code of all the slot contents.
|
11240 |
+
var needsKey = !!el.if;
|
11241 |
+
|
11242 |
+
// OR when it is inside another scoped slot or v-for (the reactivity may be
|
11243 |
+
// disconnected due to the intermediate scope variable)
|
11244 |
+
// #9438, #9506
|
11245 |
+
// TODO: this can be further optimized by properly analyzing in-scope bindings
|
11246 |
+
// and skip force updating ones that do not actually use scope variables.
|
11247 |
+
if (!needsForceUpdate) {
|
11248 |
+
var parent = el.parent;
|
11249 |
+
while (parent) {
|
11250 |
+
if (
|
11251 |
+
(parent.slotScope && parent.slotScope !== emptySlotScopeToken) ||
|
11252 |
+
parent.for
|
11253 |
+
) {
|
11254 |
+
needsForceUpdate = true;
|
11255 |
+
break
|
11256 |
+
}
|
11257 |
+
if (parent.if) {
|
11258 |
+
needsKey = true;
|
11259 |
+
}
|
11260 |
+
parent = parent.parent;
|
11261 |
+
}
|
11262 |
+
}
|
11263 |
+
|
11264 |
+
var generatedSlots = Object.keys(slots)
|
11265 |
+
.map(function (key) { return genScopedSlot(slots[key], state); })
|
11266 |
+
.join(',');
|
11267 |
|
11268 |
+
return ("scopedSlots:_u([" + generatedSlots + "]" + (needsForceUpdate ? ",null,true" : "") + (!needsForceUpdate && needsKey ? (",null,false," + (hash(generatedSlots))) : "") + ")")
|
|
|
|
|
|
|
|
|
|
|
11269 |
}
|
11270 |
+
|
11271 |
+
function hash(str) {
|
11272 |
+
var hash = 5381;
|
11273 |
+
var i = str.length;
|
11274 |
+
while(i) {
|
11275 |
+
hash = (hash * 33) ^ str.charCodeAt(--i);
|
11276 |
+
}
|
11277 |
+
return hash >>> 0
|
11278 |
+
}
|
11279 |
+
|
11280 |
+
function containsSlotChild (el) {
|
11281 |
+
if (el.type === 1) {
|
11282 |
+
if (el.tag === 'slot') {
|
11283 |
+
return true
|
11284 |
+
}
|
11285 |
+
return el.children.some(containsSlotChild)
|
11286 |
+
}
|
11287 |
return false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11288 |
}
|
11289 |
+
|
11290 |
+
function genScopedSlot (
|
11291 |
+
el,
|
11292 |
+
state
|
11293 |
+
) {
|
11294 |
+
var isLegacySyntax = el.attrsMap['slot-scope'];
|
11295 |
+
if (el.if && !el.ifProcessed && !isLegacySyntax) {
|
11296 |
+
return genIf(el, state, genScopedSlot, "null")
|
11297 |
+
}
|
11298 |
+
if (el.for && !el.forProcessed) {
|
11299 |
+
return genFor(el, state, genScopedSlot)
|
11300 |
+
}
|
11301 |
+
var slotScope = el.slotScope === emptySlotScopeToken
|
11302 |
+
? ""
|
11303 |
+
: String(el.slotScope);
|
11304 |
+
var fn = "function(" + slotScope + "){" +
|
11305 |
+
"return " + (el.tag === 'template'
|
11306 |
+
? el.if && isLegacySyntax
|
11307 |
+
? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined")
|
11308 |
+
: genChildren(el, state) || 'undefined'
|
11309 |
+
: genElement(el, state)) + "}";
|
11310 |
+
// reverse proxy v-slot without scope on this.$slots
|
11311 |
+
var reverseProxy = slotScope ? "" : ",proxy:true";
|
11312 |
+
return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + reverseProxy + "}")
|
11313 |
+
}
|
11314 |
+
|
11315 |
+
function genChildren (
|
11316 |
+
el,
|
11317 |
+
state,
|
11318 |
+
checkSkip,
|
11319 |
+
altGenElement,
|
11320 |
+
altGenNode
|
11321 |
+
) {
|
11322 |
+
var children = el.children;
|
11323 |
+
if (children.length) {
|
11324 |
+
var el$1 = children[0];
|
11325 |
+
// optimize single v-for
|
11326 |
+
if (children.length === 1 &&
|
11327 |
+
el$1.for &&
|
11328 |
+
el$1.tag !== 'template' &&
|
11329 |
+
el$1.tag !== 'slot'
|
11330 |
) {
|
11331 |
+
var normalizationType = checkSkip
|
11332 |
+
? state.maybeComponent(el$1) ? ",1" : ",0"
|
11333 |
+
: "";
|
11334 |
+
return ("" + ((altGenElement || genElement)(el$1, state)) + normalizationType)
|
11335 |
}
|
11336 |
+
var normalizationType$1 = checkSkip
|
11337 |
+
? getNormalizationType(children, state.maybeComponent)
|
11338 |
+
: 0;
|
11339 |
+
var gen = altGenNode || genNode;
|
11340 |
+
return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType$1 ? ("," + normalizationType$1) : ''))
|
11341 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11342 |
}
|
|
|
11343 |
|
11344 |
+
// determine the normalization needed for the children array.
|
11345 |
+
// 0: no normalization needed
|
11346 |
+
// 1: simple normalization needed (possible 1-level deep nested array)
|
11347 |
+
// 2: full normalization needed
|
11348 |
+
function getNormalizationType (
|
11349 |
+
children,
|
11350 |
+
maybeComponent
|
11351 |
+
) {
|
11352 |
+
var res = 0;
|
11353 |
+
for (var i = 0; i < children.length; i++) {
|
11354 |
+
var el = children[i];
|
11355 |
+
if (el.type !== 1) {
|
11356 |
+
continue
|
11357 |
+
}
|
11358 |
+
if (needsNormalization(el) ||
|
11359 |
+
(el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
|
11360 |
+
res = 2;
|
11361 |
+
break
|
11362 |
+
}
|
11363 |
+
if (maybeComponent(el) ||
|
11364 |
+
(el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
|
11365 |
+
res = 1;
|
11366 |
+
}
|
11367 |
+
}
|
11368 |
+
return res
|
11369 |
}
|
11370 |
|
11371 |
+
function needsNormalization (el) {
|
11372 |
+
return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11373 |
}
|
|
|
11374 |
|
11375 |
+
function genNode (node, state) {
|
11376 |
+
if (node.type === 1) {
|
11377 |
+
return genElement(node, state)
|
11378 |
+
} else if (node.type === 3 && node.isComment) {
|
11379 |
+
return genComment(node)
|
11380 |
+
} else {
|
11381 |
+
return genText(node)
|
11382 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11383 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11384 |
|
11385 |
+
function genText (text) {
|
11386 |
+
return ("_v(" + (text.type === 2
|
11387 |
+
? text.expression // no need for () because already wrapped in _s()
|
11388 |
+
: transformSpecialNewlines(JSON.stringify(text.text))) + ")")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11389 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11390 |
|
11391 |
+
function genComment (comment) {
|
11392 |
+
return ("_e(" + (JSON.stringify(comment.text)) + ")")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11393 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11394 |
|
11395 |
+
function genSlot (el, state) {
|
11396 |
+
var slotName = el.slotName || '"default"';
|
11397 |
+
var children = genChildren(el, state);
|
11398 |
+
var res = "_t(" + slotName + (children ? ("," + children) : '');
|
11399 |
+
var attrs = el.attrs || el.dynamicAttrs
|
11400 |
+
? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({
|
11401 |
+
// slot props are camelized
|
11402 |
+
name: camelize(attr.name),
|
11403 |
+
value: attr.value,
|
11404 |
+
dynamic: attr.dynamic
|
11405 |
+
}); }))
|
11406 |
+
: null;
|
11407 |
+
var bind$$1 = el.attrsMap['v-bind'];
|
11408 |
+
if ((attrs || bind$$1) && !children) {
|
11409 |
+
res += ",null";
|
11410 |
+
}
|
11411 |
+
if (attrs) {
|
11412 |
+
res += "," + attrs;
|
11413 |
+
}
|
11414 |
+
if (bind$$1) {
|
11415 |
+
res += (attrs ? '' : ',null') + "," + bind$$1;
|
11416 |
+
}
|
11417 |
+
return res + ')'
|
11418 |
+
}
|
11419 |
|
11420 |
+
// componentName is el.component, take it as argument to shun flow's pessimistic refinement
|
11421 |
+
function genComponent (
|
11422 |
+
componentName,
|
11423 |
+
el,
|
11424 |
+
state
|
11425 |
+
) {
|
11426 |
+
var children = el.inlineTemplate ? null : genChildren(el, state, true);
|
11427 |
+
return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")")
|
11428 |
+
}
|
11429 |
+
|
11430 |
+
function genProps (props) {
|
11431 |
+
var staticProps = "";
|
11432 |
+
var dynamicProps = "";
|
11433 |
+
for (var i = 0; i < props.length; i++) {
|
11434 |
+
var prop = props[i];
|
11435 |
+
var value = transformSpecialNewlines(prop.value);
|
11436 |
+
if (prop.dynamic) {
|
11437 |
+
dynamicProps += (prop.name) + "," + value + ",";
|
11438 |
+
} else {
|
11439 |
+
staticProps += "\"" + (prop.name) + "\":" + value + ",";
|
11440 |
+
}
|
11441 |
+
}
|
11442 |
+
staticProps = "{" + (staticProps.slice(0, -1)) + "}";
|
11443 |
+
if (dynamicProps) {
|
11444 |
+
return ("_d(" + staticProps + ",[" + (dynamicProps.slice(0, -1)) + "])")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11445 |
} else {
|
11446 |
+
return staticProps
|
11447 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11448 |
}
|
|
|
|
|
11449 |
|
11450 |
+
// #3895, #4268
|
11451 |
+
function transformSpecialNewlines (text) {
|
11452 |
+
return text
|
11453 |
+
.replace(/\u2028/g, '\\u2028')
|
11454 |
+
.replace(/\u2029/g, '\\u2029')
|
11455 |
+
}
|
|
|
|
|
11456 |
|
11457 |
+
/* */
|
11458 |
|
|
|
|
|
|
|
11459 |
|
|
|
11460 |
|
11461 |
+
// these keywords should not appear inside expressions, but operators like
|
11462 |
+
// typeof, instanceof and in are allowed
|
11463 |
+
var prohibitedKeywordRE = new RegExp('\\b' + (
|
11464 |
+
'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
|
11465 |
+
'super,throw,while,yield,delete,export,import,return,switch,default,' +
|
11466 |
+
'extends,finally,continue,debugger,function,arguments'
|
11467 |
+
).split(',').join('\\b|\\b') + '\\b');
|
11468 |
|
11469 |
+
// these unary operators should not be used as property/method names
|
11470 |
+
var unaryOperatorsRE = new RegExp('\\b' + (
|
11471 |
+
'delete,typeof,void'
|
11472 |
+
).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11473 |
|
11474 |
+
// strip strings in expressions
|
11475 |
+
var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
|
11476 |
|
11477 |
+
// detect problematic expressions in a template
|
11478 |
+
function detectErrors (ast, warn) {
|
11479 |
+
if (ast) {
|
11480 |
+
checkNode(ast, warn);
|
11481 |
+
}
|
11482 |
}
|
11483 |
|
11484 |
+
function checkNode (node, warn) {
|
11485 |
+
if (node.type === 1) {
|
11486 |
+
for (var name in node.attrsMap) {
|
11487 |
+
if (dirRE.test(name)) {
|
11488 |
+
var value = node.attrsMap[name];
|
11489 |
+
if (value) {
|
11490 |
+
var range = node.rawAttrsMap[name];
|
11491 |
+
if (name === 'v-for') {
|
11492 |
+
checkFor(node, ("v-for=\"" + value + "\""), warn, range);
|
11493 |
+
} else if (onRE.test(name)) {
|
11494 |
+
checkEvent(value, (name + "=\"" + value + "\""), warn, range);
|
11495 |
+
} else {
|
11496 |
+
checkExpression(value, (name + "=\"" + value + "\""), warn, range);
|
11497 |
+
}
|
11498 |
+
}
|
11499 |
+
}
|
11500 |
+
}
|
11501 |
+
if (node.children) {
|
11502 |
+
for (var i = 0; i < node.children.length; i++) {
|
11503 |
+
checkNode(node.children[i], warn);
|
11504 |
+
}
|
11505 |
+
}
|
11506 |
+
} else if (node.type === 2) {
|
11507 |
+
checkExpression(node.expression, node.text, warn, node);
|
11508 |
+
}
|
11509 |
}
|
11510 |
|
11511 |
+
function checkEvent (exp, text, warn, range) {
|
11512 |
+
var stipped = exp.replace(stripStringRE, '');
|
11513 |
+
var keywordMatch = stipped.match(unaryOperatorsRE);
|
11514 |
+
if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {
|
11515 |
+
warn(
|
11516 |
+
"avoid using JavaScript unary operator as property name: " +
|
11517 |
+
"\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
|
11518 |
+
range
|
11519 |
+
);
|
11520 |
+
}
|
11521 |
+
checkExpression(exp, text, warn, range);
|
11522 |
}
|
11523 |
|
11524 |
+
function checkFor (node, text, warn, range) {
|
11525 |
+
checkExpression(node.for || '', text, warn, range);
|
11526 |
+
checkIdentifier(node.alias, 'v-for alias', text, warn, range);
|
11527 |
+
checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range);
|
11528 |
+
checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11529 |
}
|
11530 |
|
11531 |
+
function checkIdentifier (
|
11532 |
+
ident,
|
11533 |
+
type,
|
11534 |
+
text,
|
11535 |
+
warn,
|
11536 |
+
range
|
11537 |
) {
|
11538 |
+
if (typeof ident === 'string') {
|
11539 |
+
try {
|
11540 |
+
new Function(("var " + ident + "=_"));
|
11541 |
+
} catch (e) {
|
11542 |
+
warn(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())), range);
|
11543 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11544 |
}
|
|
|
|
|
|
|
11545 |
}
|
11546 |
|
11547 |
+
function checkExpression (exp, text, warn, range) {
|
11548 |
+
try {
|
11549 |
+
new Function(("return " + exp));
|
11550 |
+
} catch (e) {
|
11551 |
+
var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
|
11552 |
+
if (keywordMatch) {
|
11553 |
+
warn(
|
11554 |
+
"avoid using JavaScript keyword as property name: " +
|
11555 |
+
"\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim()),
|
11556 |
+
range
|
11557 |
+
);
|
11558 |
+
} else {
|
11559 |
+
warn(
|
11560 |
+
"invalid expression: " + (e.message) + " in\n\n" +
|
11561 |
+
" " + exp + "\n\n" +
|
11562 |
+
" Raw expression: " + (text.trim()) + "\n",
|
11563 |
+
range
|
11564 |
+
);
|
11565 |
+
}
|
11566 |
+
}
|
11567 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11568 |
|
11569 |
+
/* */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11570 |
|
11571 |
+
var range = 2;
|
|
|
|
|
|
|
|
|
|
|
11572 |
|
11573 |
+
function generateCodeFrame (
|
11574 |
+
source,
|
11575 |
+
start,
|
11576 |
+
end
|
11577 |
+
) {
|
11578 |
+
if ( start === void 0 ) start = 0;
|
11579 |
+
if ( end === void 0 ) end = source.length;
|
11580 |
+
|
11581 |
+
var lines = source.split(/\r?\n/);
|
11582 |
+
var count = 0;
|
11583 |
+
var res = [];
|
11584 |
+
for (var i = 0; i < lines.length; i++) {
|
11585 |
+
count += lines[i].length + 1;
|
11586 |
+
if (count >= start) {
|
11587 |
+
for (var j = i - range; j <= i + range || end > count; j++) {
|
11588 |
+
if (j < 0 || j >= lines.length) { continue }
|
11589 |
+
res.push(("" + (j + 1) + (repeat$1(" ", 3 - String(j + 1).length)) + "| " + (lines[j])));
|
11590 |
+
var lineLength = lines[j].length;
|
11591 |
+
if (j === i) {
|
11592 |
+
// push underline
|
11593 |
+
var pad = start - (count - lineLength) + 1;
|
11594 |
+
var length = end > count ? lineLength - pad : end - start;
|
11595 |
+
res.push(" | " + repeat$1(" ", pad) + repeat$1("^", length));
|
11596 |
+
} else if (j > i) {
|
11597 |
+
if (end > count) {
|
11598 |
+
var length$1 = Math.min(end - count, lineLength);
|
11599 |
+
res.push(" | " + repeat$1("^", length$1));
|
11600 |
+
}
|
11601 |
+
count += lineLength + 1;
|
11602 |
+
}
|
11603 |
+
}
|
11604 |
+
break
|
11605 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11606 |
}
|
11607 |
+
return res.join('\n')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11608 |
}
|
11609 |
|
11610 |
+
function repeat$1 (str, n) {
|
11611 |
+
var result = '';
|
11612 |
+
if (n > 0) {
|
11613 |
+
while (true) { // eslint-disable-line
|
11614 |
+
if (n & 1) { result += str; }
|
11615 |
+
n >>>= 1;
|
11616 |
+
if (n <= 0) { break }
|
11617 |
+
str += str;
|
11618 |
+
}
|
11619 |
+
}
|
11620 |
+
return result
|
11621 |
}
|
11622 |
|
11623 |
+
/* */
|
|
|
|
|
|
|
11624 |
|
|
|
|
|
|
|
|
|
11625 |
|
|
|
|
|
|
|
11626 |
|
11627 |
+
function createFunction (code, errors) {
|
11628 |
+
try {
|
11629 |
+
return new Function(code)
|
11630 |
+
} catch (err) {
|
11631 |
+
errors.push({ err: err, code: code });
|
11632 |
+
return noop
|
11633 |
}
|
|
|
|
|
|
|
|
|
11634 |
}
|
11635 |
|
11636 |
+
function createCompileToFunctionFn (compile) {
|
11637 |
+
var cache = Object.create(null);
|
11638 |
+
|
11639 |
+
return function compileToFunctions (
|
11640 |
+
template,
|
11641 |
+
options,
|
11642 |
+
vm
|
11643 |
) {
|
11644 |
+
options = extend({}, options);
|
11645 |
+
var warn$$1 = options.warn || warn;
|
11646 |
+
delete options.warn;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11647 |
|
11648 |
+
/* istanbul ignore if */
|
11649 |
+
{
|
11650 |
+
// detect possible CSP restriction
|
11651 |
+
try {
|
11652 |
+
new Function('return 1');
|
11653 |
+
} catch (e) {
|
11654 |
+
if (e.toString().match(/unsafe-eval|CSP/)) {
|
11655 |
+
warn$$1(
|
11656 |
+
'It seems you are using the standalone build of Vue.js in an ' +
|
11657 |
+
'environment with Content Security Policy that prohibits unsafe-eval. ' +
|
11658 |
+
'The template compiler cannot work in this environment. Consider ' +
|
11659 |
+
'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
|
11660 |
+
'templates into render functions.'
|
11661 |
+
);
|
11662 |
+
}
|
11663 |
+
}
|
11664 |
+
}
|
11665 |
|
11666 |
+
// check cache
|
11667 |
+
var key = options.delimiters
|
11668 |
+
? String(options.delimiters) + template
|
11669 |
+
: template;
|
11670 |
+
if (cache[key]) {
|
11671 |
+
return cache[key]
|
11672 |
+
}
|
|
|
11673 |
|
11674 |
+
// compile
|
11675 |
+
var compiled = compile(template, options);
|
11676 |
+
|
11677 |
+
// check compilation errors/tips
|
11678 |
+
{
|
11679 |
+
if (compiled.errors && compiled.errors.length) {
|
11680 |
+
if (options.outputSourceRange) {
|
11681 |
+
compiled.errors.forEach(function (e) {
|
11682 |
+
warn$$1(
|
11683 |
+
"Error compiling template:\n\n" + (e.msg) + "\n\n" +
|
11684 |
+
generateCodeFrame(template, e.start, e.end),
|
11685 |
+
vm
|
11686 |
+
);
|
11687 |
+
});
|
11688 |
+
} else {
|
11689 |
+
warn$$1(
|
11690 |
+
"Error compiling template:\n\n" + template + "\n\n" +
|
11691 |
+
compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n',
|
11692 |
+
vm
|
11693 |
+
);
|
11694 |
+
}
|
11695 |
+
}
|
11696 |
+
if (compiled.tips && compiled.tips.length) {
|
11697 |
+
if (options.outputSourceRange) {
|
11698 |
+
compiled.tips.forEach(function (e) { return tip(e.msg, vm); });
|
11699 |
+
} else {
|
11700 |
+
compiled.tips.forEach(function (msg) { return tip(msg, vm); });
|
11701 |
+
}
|
11702 |
+
}
|
11703 |
+
}
|
11704 |
+
|
11705 |
+
// turn code into functions
|
11706 |
+
var res = {};
|
11707 |
+
var fnGenErrors = [];
|
11708 |
+
res.render = createFunction(compiled.render, fnGenErrors);
|
11709 |
+
res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
|
11710 |
+
return createFunction(code, fnGenErrors)
|
11711 |
+
});
|
11712 |
+
|
11713 |
+
// check function generation errors.
|
11714 |
+
// this should only happen if there is a bug in the compiler itself.
|
11715 |
+
// mostly for codegen development use
|
11716 |
+
/* istanbul ignore if */
|
11717 |
+
{
|
11718 |
+
if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
|
11719 |
+
warn$$1(
|
11720 |
+
"Failed to generate render function:\n\n" +
|
11721 |
+
fnGenErrors.map(function (ref) {
|
11722 |
+
var err = ref.err;
|
11723 |
+
var code = ref.code;
|
11724 |
+
|
11725 |
+
return ((err.toString()) + " in\n\n" + code + "\n");
|
11726 |
+
}).join('\n'),
|
11727 |
+
vm
|
11728 |
+
);
|
11729 |
+
}
|
11730 |
+
}
|
11731 |
+
|
11732 |
+
return (cache[key] = res)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11733 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11734 |
}
|
|
|
|
|
11735 |
|
11736 |
+
/* */
|
11737 |
|
11738 |
+
function createCompilerCreator (baseCompile) {
|
11739 |
+
return function createCompiler (baseOptions) {
|
11740 |
+
function compile (
|
11741 |
+
template,
|
11742 |
+
options
|
11743 |
+
) {
|
11744 |
+
var finalOptions = Object.create(baseOptions);
|
11745 |
+
var errors = [];
|
11746 |
+
var tips = [];
|
11747 |
+
|
11748 |
+
var warn = function (msg, range, tip) {
|
11749 |
+
(tip ? tips : errors).push(msg);
|
11750 |
+
};
|
11751 |
+
|
11752 |
+
if (options) {
|
11753 |
+
if (options.outputSourceRange) {
|
11754 |
+
// $flow-disable-line
|
11755 |
+
var leadingSpaceLength = template.match(/^\s*/)[0].length;
|
11756 |
+
|
11757 |
+
warn = function (msg, range, tip) {
|
11758 |
+
var data = { msg: msg };
|
11759 |
+
if (range) {
|
11760 |
+
if (range.start != null) {
|
11761 |
+
data.start = range.start + leadingSpaceLength;
|
11762 |
+
}
|
11763 |
+
if (range.end != null) {
|
11764 |
+
data.end = range.end + leadingSpaceLength;
|
11765 |
+
}
|
11766 |
+
}
|
11767 |
+
(tip ? tips : errors).push(data);
|
11768 |
+
};
|
11769 |
+
}
|
11770 |
+
// merge custom modules
|
11771 |
+
if (options.modules) {
|
11772 |
+
finalOptions.modules =
|
11773 |
+
(baseOptions.modules || []).concat(options.modules);
|
11774 |
+
}
|
11775 |
+
// merge custom directives
|
11776 |
+
if (options.directives) {
|
11777 |
+
finalOptions.directives = extend(
|
11778 |
+
Object.create(baseOptions.directives || null),
|
11779 |
+
options.directives
|
11780 |
+
);
|
11781 |
+
}
|
11782 |
+
// copy other options
|
11783 |
+
for (var key in options) {
|
11784 |
+
if (key !== 'modules' && key !== 'directives') {
|
11785 |
+
finalOptions[key] = options[key];
|
11786 |
+
}
|
11787 |
+
}
|
11788 |
+
}
|
11789 |
+
|
11790 |
+
finalOptions.warn = warn;
|
11791 |
+
|
11792 |
+
var compiled = baseCompile(template.trim(), finalOptions);
|
11793 |
+
{
|
11794 |
+
detectErrors(compiled.ast, warn);
|
11795 |
+
}
|
11796 |
+
compiled.errors = errors;
|
11797 |
+
compiled.tips = tips;
|
11798 |
+
return compiled
|
11799 |
+
}
|
11800 |
|
11801 |
+
return {
|
11802 |
+
compile: compile,
|
11803 |
+
compileToFunctions: createCompileToFunctionFn(compile)
|
11804 |
+
}
|
11805 |
+
}
|
11806 |
+
}
|
11807 |
|
11808 |
+
/* */
|
|
|
|
|
|
|
|
|
|
|
11809 |
|
11810 |
+
// `createCompilerCreator` allows creating compilers that use alternative
|
11811 |
+
// parser/optimizer/codegen, e.g the SSR optimizing compiler.
|
11812 |
+
// Here we just export a default compiler using the default parts.
|
11813 |
+
var createCompiler = createCompilerCreator(function baseCompile (
|
11814 |
+
template,
|
11815 |
+
options
|
11816 |
+
) {
|
11817 |
+
var ast = parse(template.trim(), options);
|
11818 |
+
if (options.optimize !== false) {
|
11819 |
+
optimize(ast, options);
|
11820 |
+
}
|
11821 |
+
var code = generate(ast, options);
|
11822 |
+
return {
|
11823 |
+
ast: ast,
|
11824 |
+
render: code.render,
|
11825 |
+
staticRenderFns: code.staticRenderFns
|
11826 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11827 |
});
|
11828 |
|
11829 |
+
/* */
|
11830 |
+
|
11831 |
+
var ref$1 = createCompiler(baseOptions);
|
11832 |
+
var compile = ref$1.compile;
|
11833 |
+
var compileToFunctions = ref$1.compileToFunctions;
|
11834 |
+
|
11835 |
+
/* */
|
11836 |
+
|
11837 |
+
// check whether current browser encodes a char inside attribute values
|
11838 |
+
var div;
|
11839 |
+
function getShouldDecode (href) {
|
11840 |
+
div = div || document.createElement('div');
|
11841 |
+
div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>";
|
11842 |
+
return div.innerHTML.indexOf(' ') > 0
|
|
|
|
|
|
|
11843 |
}
|
11844 |
|
11845 |
+
// #3663: IE encodes newlines inside attribute values while other browsers don't
|
11846 |
+
var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false;
|
11847 |
+
// #6828: chrome encodes content in a[href]
|
11848 |
+
var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false;
|
11849 |
|
11850 |
+
/* */
|
11851 |
+
|
11852 |
+
var idToTemplate = cached(function (id) {
|
11853 |
+
var el = query(id);
|
11854 |
+
return el && el.innerHTML
|
11855 |
+
});
|
11856 |
|
11857 |
+
var mount = Vue.prototype.$mount;
|
11858 |
+
Vue.prototype.$mount = function (
|
11859 |
+
el,
|
11860 |
+
hydrating
|
|
|
11861 |
) {
|
11862 |
+
el = el && query(el);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11863 |
|
11864 |
+
/* istanbul ignore if */
|
11865 |
+
if (el === document.body || el === document.documentElement) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11866 |
warn(
|
11867 |
+
"Do not mount Vue to <html> or <body> - mount to normal elements instead."
|
|
|
11868 |
);
|
11869 |
+
return this
|
11870 |
}
|
11871 |
+
|
11872 |
+
var options = this.$options;
|
11873 |
+
// resolve template/el and convert to render function
|
11874 |
+
if (!options.render) {
|
11875 |
+
var template = options.template;
|
11876 |
+
if (template) {
|
11877 |
+
if (typeof template === 'string') {
|
11878 |
+
if (template.charAt(0) === '#') {
|
11879 |
+
template = idToTemplate(template);
|
11880 |
+
/* istanbul ignore if */
|
11881 |
+
if (!template) {
|
11882 |
+
warn(
|
11883 |
+
("Template element not found or is empty: " + (options.template)),
|
11884 |
+
this
|
11885 |
+
);
|
11886 |
+
}
|
11887 |
+
}
|
11888 |
+
} else if (template.nodeType) {
|
11889 |
+
template = template.innerHTML;
|
11890 |
+
} else {
|
11891 |
+
{
|
11892 |
+
warn('invalid template option:' + template, this);
|
11893 |
+
}
|
11894 |
+
return this
|
11895 |
+
}
|
11896 |
+
} else if (el) {
|
11897 |
+
template = getOuterHTML(el);
|
11898 |
+
}
|
11899 |
+
if (template) {
|
11900 |
+
/* istanbul ignore if */
|
11901 |
+
if (config.performance && mark) {
|
11902 |
+
mark('compile');
|
11903 |
+
}
|
11904 |
+
|
11905 |
+
var ref = compileToFunctions(template, {
|
11906 |
+
outputSourceRange: "development" !== 'production',
|
11907 |
+
shouldDecodeNewlines: shouldDecodeNewlines,
|
11908 |
+
shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref,
|
11909 |
+
delimiters: options.delimiters,
|
11910 |
+
comments: options.comments
|
11911 |
+
}, this);
|
11912 |
+
var render = ref.render;
|
11913 |
+
var staticRenderFns = ref.staticRenderFns;
|
11914 |
+
options.render = render;
|
11915 |
+
options.staticRenderFns = staticRenderFns;
|
11916 |
+
|
11917 |
+
/* istanbul ignore if */
|
11918 |
+
if (config.performance && mark) {
|
11919 |
+
mark('compile end');
|
11920 |
+
measure(("vue " + (this._name) + " compile"), 'compile', 'compile end');
|
11921 |
+
}
|
11922 |
+
}
|
11923 |
}
|
11924 |
+
return mount.call(this, el, hydrating)
|
11925 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11926 |
|
11927 |
+
/**
|
11928 |
+
* Get outerHTML of elements, taking care
|
11929 |
+
* of SVG elements in IE as well.
|
11930 |
+
*/
|
11931 |
+
function getOuterHTML (el) {
|
11932 |
+
if (el.outerHTML) {
|
11933 |
+
return el.outerHTML
|
11934 |
+
} else {
|
11935 |
+
var container = document.createElement('div');
|
11936 |
+
container.appendChild(el.cloneNode(true));
|
11937 |
+
return container.innerHTML
|
11938 |
+
}
|
11939 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11940 |
|
11941 |
+
Vue.compile = compileToFunctions;
|
11942 |
|
11943 |
+
return Vue;
|
11944 |
|
11945 |
+
}));
|
assets/js/vendor/vue.min.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/*!
|
2 |
-
* Vue.js v2.
|
3 |
-
* (c) 2014-
|
4 |
* Released under the MIT License.
|
5 |
*/
|
6 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";var y=Object.freeze({});function M(e){return null==e}function D(e){return null!=e}function S(e){return!0===e}function T(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function P(e){return null!==e&&"object"==typeof e}var r=Object.prototype.toString;function l(e){return"[object Object]"===r.call(e)}function i(e){var t=parseFloat(String(e));return 0<=t&&Math.floor(t)===t&&isFinite(e)}function t(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function F(e){var t=parseFloat(e);return isNaN(t)?e:t}function s(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var c=s("slot,component",!0),u=s("key,ref,slot,slot-scope,is");function f(e,t){if(e.length){var n=e.indexOf(t);if(-1<n)return e.splice(n,1)}}var n=Object.prototype.hasOwnProperty;function p(e,t){return n.call(e,t)}function e(t){var n=Object.create(null);return function(e){return n[e]||(n[e]=t(e))}}var o=/-(\w)/g,g=e(function(e){return e.replace(o,function(e,t){return t?t.toUpperCase():""})}),d=e(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),a=/\B([A-Z])/g,_=e(function(e){return e.replace(a,"-$1").toLowerCase()});var v=Function.prototype.bind?function(e,t){return e.bind(t)}:function(n,r){function e(e){var t=arguments.length;return t?1<t?n.apply(r,arguments):n.call(r,e):n.call(r)}return e._length=n.length,e};function h(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function m(e,t){for(var n in t)e[n]=t[n];return e}function b(e){for(var t={},n=0;n<e.length;n++)e[n]&&m(t,e[n]);return t}function $(e,t,n){}var O=function(e,t,n){return!1},w=function(e){return e};function C(t,n){if(t===n)return!0;var e=P(t),r=P(n);if(!e||!r)return!e&&!r&&String(t)===String(n);try{var i=Array.isArray(t),o=Array.isArray(n);if(i&&o)return t.length===n.length&&t.every(function(e,t){return C(e,n[t])});if(i||o)return!1;var a=Object.keys(t),s=Object.keys(n);return a.length===s.length&&a.every(function(e){return C(t[e],n[e])})}catch(e){return!1}}function x(e,t){for(var n=0;n<e.length;n++)if(C(e[n],t))return n;return-1}function R(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}var E="data-server-rendered",k=["component","directive","filter"],A=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured"],j={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:O,isReservedAttr:O,isUnknownElement:O,getTagNamespace:$,parsePlatformTagName:w,mustUseProp:O,_lifecycleHooks:A};function N(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var L=/[^\w.$]/;var I,H="__proto__"in{},B="undefined"!=typeof window,U="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,V=U&&WXEnvironment.platform.toLowerCase(),z=B&&window.navigator.userAgent.toLowerCase(),K=z&&/msie|trident/.test(z),J=z&&0<z.indexOf("msie 9.0"),q=z&&0<z.indexOf("edge/"),W=(z&&z.indexOf("android"),z&&/iphone|ipad|ipod|ios/.test(z)||"ios"===V),G=(z&&/chrome\/\d+/.test(z),{}.watch),Z=!1;if(B)try{var X={};Object.defineProperty(X,"passive",{get:function(){Z=!0}}),window.addEventListener("test-passive",null,X)}catch(e){}var Y=function(){return void 0===I&&(I=!B&&!U&&"undefined"!=typeof global&&"server"===global.process.env.VUE_ENV),I},Q=B&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ee(e){return"function"==typeof e&&/native code/.test(e.toString())}var te,ne="undefined"!=typeof Symbol&&ee(Symbol)&&"undefined"!=typeof Reflect&&ee(Reflect.ownKeys);te="undefined"!=typeof Set&&ee(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var re=$,ie=0,oe=function(){this.id=ie++,this.subs=[]};oe.prototype.addSub=function(e){this.subs.push(e)},oe.prototype.removeSub=function(e){f(this.subs,e)},oe.prototype.depend=function(){oe.target&&oe.target.addDep(this)},oe.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t<n;t++)e[t].update()},oe.target=null;var ae=[];function se(e){oe.target&&ae.push(oe.target),oe.target=e}function ce(){oe.target=ae.pop()}var le=function(e,t,n,r,i,o,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},ue={child:{configurable:!0}};ue.child.get=function(){return this.componentInstance},Object.defineProperties(le.prototype,ue);var fe=function(e){void 0===e&&(e="");var t=new le;return t.text=e,t.isComment=!0,t};function pe(e){return new le(void 0,void 0,void 0,String(e))}function de(e){var t=new le(e.tag,e.data,e.children,e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.isCloned=!0,t}var ve=Array.prototype,he=Object.create(ve);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(o){var a=ve[o];N(he,o,function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r=a.apply(this,e),i=this.__ob__;switch(o){case"push":case"unshift":n=e;break;case"splice":n=e.slice(2)}return n&&i.observeArray(n),i.dep.notify(),r})});var me=Object.getOwnPropertyNames(he),ye=!0;function ge(e){ye=e}var _e=function(e){(this.value=e,this.dep=new oe,this.vmCount=0,N(e,"__ob__",this),Array.isArray(e))?((H?be:$e)(e,he,me),this.observeArray(e)):this.walk(e)};function be(e,t,n){e.__proto__=t}function $e(e,t,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];N(e,o,t[o])}}function we(e,t){var n;if(P(e)&&!(e instanceof le))return p(e,"__ob__")&&e.__ob__ instanceof _e?n=e.__ob__:ye&&!Y()&&(Array.isArray(e)||l(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new _e(e)),t&&n&&n.vmCount++,n}function Ce(n,e,r,t,i){var o=new oe,a=Object.getOwnPropertyDescriptor(n,e);if(!a||!1!==a.configurable){var s=a&&a.get;s||2!==arguments.length||(r=n[e]);var c=a&&a.set,l=!i&&we(r);Object.defineProperty(n,e,{enumerable:!0,configurable:!0,get:function(){var e=s?s.call(n):r;return oe.target&&(o.depend(),l&&(l.dep.depend(),Array.isArray(e)&&function e(t){for(var n=void 0,r=0,i=t.length;r<i;r++)(n=t[r])&&n.__ob__&&n.__ob__.dep.depend(),Array.isArray(n)&&e(n)}(e))),e},set:function(e){var t=s?s.call(n):r;e===t||e!=e&&t!=t||(c?c.call(n,e):r=e,l=!i&&we(e),o.notify())}})}}function xe(e,t,n){if(Array.isArray(e)&&i(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n;var r=e.__ob__;return e._isVue||r&&r.vmCount?n:r?(Ce(r.value,t,n),r.dep.notify(),n):e[t]=n}function ke(e,t){if(Array.isArray(e)&&i(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount||p(e,t)&&(delete e[t],n&&n.dep.notify())}}_e.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)Ce(e,t[n])},_e.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)we(e[t])};var Ae=j.optionMergeStrategies;function Oe(e,t){if(!t)return e;for(var n,r,i,o=Object.keys(t),a=0;a<o.length;a++)r=e[n=o[a]],i=t[n],p(e,n)?l(r)&&l(i)&&Oe(r,i):xe(e,n,i);return e}function Se(n,r,i){return i?function(){var e="function"==typeof r?r.call(i,i):r,t="function"==typeof n?n.call(i,i):n;return e?Oe(e,t):t}:r?n?function(){return Oe("function"==typeof r?r.call(this,this):r,"function"==typeof n?n.call(this,this):n)}:r:n}function Te(e,t){return t?e?e.concat(t):Array.isArray(t)?t:[t]:e}function Ee(e,t,n,r){var i=Object.create(e||null);return t?m(i,t):i}Ae.data=function(e,t,n){return n?Se(e,t,n):t&&"function"!=typeof t?e:Se(e,t)},A.forEach(function(e){Ae[e]=Te}),k.forEach(function(e){Ae[e+"s"]=Ee}),Ae.watch=function(e,t,n,r){if(e===G&&(e=void 0),t===G&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var i={};for(var o in m(i,e),t){var a=i[o],s=t[o];a&&!Array.isArray(a)&&(a=[a]),i[o]=a?a.concat(s):Array.isArray(s)?s:[s]}return i},Ae.props=Ae.methods=Ae.inject=Ae.computed=function(e,t,n,r){if(!e)return t;var i=Object.create(null);return m(i,e),t&&m(i,t),i},Ae.provide=Se;var je=function(e,t){return void 0===t?e:t};function Ne(n,r,i){"function"==typeof r&&(r=r.options),function(e,t){var n=e.props;if(n){var r,i,o={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(i=n[r])&&(o[g(i)]={type:null});else if(l(n))for(var a in n)i=n[a],o[g(a)]=l(i)?i:{type:i};e.props=o}}(r),function(e,t){var n=e.inject;if(n){var r=e.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(l(n))for(var o in n){var a=n[o];r[o]=l(a)?m({from:o},a):{from:a}}}}(r),function(e){var t=e.directives;if(t)for(var n in t){var r=t[n];"function"==typeof r&&(t[n]={bind:r,update:r})}}(r);var e=r.extends;if(e&&(n=Ne(n,e,i)),r.mixins)for(var t=0,o=r.mixins.length;t<o;t++)n=Ne(n,r.mixins[t],i);var a,s={};for(a in n)c(a);for(a in r)p(n,a)||c(a);function c(e){var t=Ae[e]||je;s[e]=t(n[e],r[e],i,e)}return s}function Le(e,t,n,r){if("string"==typeof n){var i=e[t];if(p(i,n))return i[n];var o=g(n);if(p(i,o))return i[o];var a=d(o);return p(i,a)?i[a]:i[n]||i[o]||i[a]}}function Ie(e,t,n,r){var i=t[e],o=!p(n,e),a=n[e],s=Pe(Boolean,i.type);if(-1<s)if(o&&!p(i,"default"))a=!1;else if(""===a||a===_(e)){var c=Pe(String,i.type);(c<0||s<c)&&(a=!0)}if(void 0===a){a=function(e,t,n){if(!p(t,"default"))return;var r=t.default;if(e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n])return e._props[n];return"function"==typeof r&&"Function"!==Me(t.type)?r.call(e):r}(r,i,e);var l=ye;ge(!0),we(a),ge(l)}return a}function Me(e){var t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function De(e,t){return Me(e)===Me(t)}function Pe(e,t){if(!Array.isArray(t))return De(t,e)?0:-1;for(var n=0,r=t.length;n<r;n++)if(De(t[n],e))return n;return-1}function Fe(e,t,n){if(t)for(var r=t;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{if(!1===i[o].call(r,e,t,n))return}catch(e){Re(e,r,"errorCaptured hook")}}Re(e,t,n)}function Re(e,t,n){if(j.errorHandler)try{return j.errorHandler.call(null,e,t,n)}catch(e){He(e,null,"config.errorHandler")}He(e,t,n)}function He(e,t,n){if(!B&&!U||"undefined"==typeof console)throw e;console.error(e)}var Be,Ue,Ve=[],ze=!1;function Ke(){ze=!1;for(var e=Ve.slice(0),t=Ve.length=0;t<e.length;t++)e[t]()}var Je=!1;if("undefined"!=typeof setImmediate&&ee(setImmediate))Ue=function(){setImmediate(Ke)};else if("undefined"==typeof MessageChannel||!ee(MessageChannel)&&"[object MessageChannelConstructor]"!==MessageChannel.toString())Ue=function(){setTimeout(Ke,0)};else{var qe=new MessageChannel,We=qe.port2;qe.port1.onmessage=Ke,Ue=function(){We.postMessage(1)}}if("undefined"!=typeof Promise&&ee(Promise)){var Ge=Promise.resolve();Be=function(){Ge.then(Ke),W&&setTimeout($)}}else Be=Ue;function Ze(e,t){var n;if(Ve.push(function(){if(e)try{e.call(t)}catch(e){Fe(e,t,"nextTick")}else n&&n(t)}),ze||(ze=!0,Je?Ue():Be()),!e&&"undefined"!=typeof Promise)return new Promise(function(e){n=e})}var Xe=new te;function Ye(e){!function e(t,n){var r,i;var o=Array.isArray(t);if(!o&&!P(t)||Object.isFrozen(t)||t instanceof le)return;if(t.__ob__){var a=t.__ob__.dep.id;if(n.has(a))return;n.add(a)}if(o)for(r=t.length;r--;)e(t[r],n);else for(i=Object.keys(t),r=i.length;r--;)e(t[i[r]],n)}(e,Xe),Xe.clear()}var Qe,et=e(function(e){var t="&"===e.charAt(0),n="~"===(e=t?e.slice(1):e).charAt(0),r="!"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}});function tt(e){function i(){var e=arguments,t=i.fns;if(!Array.isArray(t))return t.apply(null,arguments);for(var n=t.slice(),r=0;r<n.length;r++)n[r].apply(null,e)}return i.fns=e,i}function nt(e,t,n,r,i){var o,a,s,c;for(o in e)a=e[o],s=t[o],c=et(o),M(a)||(M(s)?(M(a.fns)&&(a=e[o]=tt(a)),n(c.name,a,c.once,c.capture,c.passive,c.params)):a!==s&&(s.fns=a,e[o]=s));for(o in t)M(e[o])&&r((c=et(o)).name,t[o],c.capture)}function rt(e,t,n){var r;e instanceof le&&(e=e.data.hook||(e.data.hook={}));var i=e[t];function o(){n.apply(this,arguments),f(r.fns,o)}M(i)?r=tt([o]):D(i.fns)&&S(i.merged)?(r=i).fns.push(o):r=tt([i,o]),r.merged=!0,e[t]=r}function it(e,t,n,r,i){if(D(t)){if(p(t,n))return e[n]=t[n],i||delete t[n],!0;if(p(t,r))return e[n]=t[r],i||delete t[r],!0}return!1}function ot(e){return T(e)?[pe(e)]:Array.isArray(e)?function e(t,n){var r=[];var i,o,a,s;for(i=0;i<t.length;i++)M(o=t[i])||"boolean"==typeof o||(a=r.length-1,s=r[a],Array.isArray(o)?0<o.length&&(at((o=e(o,(n||"")+"_"+i))[0])&&at(s)&&(r[a]=pe(s.text+o[0].text),o.shift()),r.push.apply(r,o)):T(o)?at(s)?r[a]=pe(s.text+o):""!==o&&r.push(pe(o)):at(o)&&at(s)?r[a]=pe(s.text+o.text):(S(t._isVList)&&D(o.tag)&&M(o.key)&&D(n)&&(o.key="__vlist"+n+"_"+i+"__"),r.push(o)));return r}(e):void 0}function at(e){return D(e)&&D(e.text)&&!1===e.isComment}function st(e,t){return(e.__esModule||ne&&"Module"===e[Symbol.toStringTag])&&(e=e.default),P(e)?t.extend(e):e}function ct(e){return e.isComment&&e.asyncFactory}function lt(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];if(D(n)&&(D(n.componentOptions)||ct(n)))return n}}function ut(e,t,n){n?Qe.$once(e,t):Qe.$on(e,t)}function ft(e,t){Qe.$off(e,t)}function pt(e,t,n){Qe=e,nt(t,n||{},ut,ft),Qe=void 0}function dt(e,t){var n={};if(!e)return n;for(var r=0,i=e.length;r<i;r++){var o=e[r],a=o.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,o.context!==t&&o.fnContext!==t||!a||null==a.slot)(n.default||(n.default=[])).push(o);else{var s=a.slot,c=n[s]||(n[s]=[]);"template"===o.tag?c.push.apply(c,o.children||[]):c.push(o)}}for(var l in n)n[l].every(vt)&&delete n[l];return n}function vt(e){return e.isComment&&!e.asyncFactory||" "===e.text}function ht(e,t){t=t||{};for(var n=0;n<e.length;n++)Array.isArray(e[n])?ht(e[n],t):t[e[n].key]=e[n].fn;return t}var mt=null;function yt(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function gt(e,t){if(t){if(e._directInactive=!1,yt(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)gt(e.$children[n]);_t(e,"activated")}}function _t(t,n){se();var e=t.$options[n];if(e)for(var r=0,i=e.length;r<i;r++)try{e[r].call(t)}catch(e){Fe(e,t,n+" hook")}t._hasHookEvent&&t.$emit("hook:"+n),ce()}var bt=[],$t=[],wt={},Ct=!1,xt=!1,kt=0;function At(){var e,t;for(xt=!0,bt.sort(function(e,t){return e.id-t.id}),kt=0;kt<bt.length;kt++)t=(e=bt[kt]).id,wt[t]=null,e.run();var n=$t.slice(),r=bt.slice();kt=bt.length=$t.length=0,wt={},Ct=xt=!1,function(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,gt(e[t],!0)}(n),function(e){var t=e.length;for(;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&_t(r,"updated")}}(r),Q&&j.devtools&&Q.emit("flush")}var Ot=0,St=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++Ot,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new te,this.newDepIds=new te,this.expression="","function"==typeof t?this.getter=t:(this.getter=function(e){if(!L.test(e)){var n=e.split(".");return function(e){for(var t=0;t<n.length;t++){if(!e)return;e=e[n[t]]}return e}}}(t),this.getter||(this.getter=function(){})),this.value=this.lazy?void 0:this.get()};St.prototype.get=function(){var e;se(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(e){if(!this.user)throw e;Fe(e,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&Ye(e),ce(),this.cleanupDeps()}return e},St.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},St.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},St.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():function(e){var t=e.id;if(null==wt[t]){if(wt[t]=!0,xt){for(var n=bt.length-1;kt<n&&bt[n].id>e.id;)n--;bt.splice(n+1,0,e)}else bt.push(e);Ct||(Ct=!0,Ze(At))}}(this)},St.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||P(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Fe(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},St.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},St.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},St.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||f(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Tt={enumerable:!0,configurable:!0,get:$,set:$};function Et(e,t,n){Tt.get=function(){return this[t][n]},Tt.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Tt)}function jt(e){e._watchers=[];var t=e.$options;t.props&&function(n,r){var i=n.$options.propsData||{},o=n._props={},a=n.$options._propKeys=[];n.$parent&&ge(!1);var e=function(e){a.push(e);var t=Ie(e,r,i,n);Ce(o,e,t),e in n||Et(n,"_props",e)};for(var t in r)e(t);ge(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]=null==t[n]?$:v(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;l(t=e._data="function"==typeof t?function(e,t){se();try{return e.call(t,t)}catch(e){return Fe(e,t,"data()"),{}}finally{ce()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&p(r,o)||(void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&Et(e,"_data",o))}var a;we(t,!0)}(e):we(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=Y();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new St(e,a||$,$,Nt)),i in e||Lt(e,i,o)}}(e,t.computed),t.watch&&t.watch!==G&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)Mt(e,n,r[i]);else Mt(e,n,r)}}(e,t.watch)}var Nt={lazy:!0};function Lt(e,t,n){var r=!Y();"function"==typeof n?(Tt.get=r?It(t):n,Tt.set=$):(Tt.get=n.get?r&&!1!==n.cache?It(t):n.get:$,Tt.set=n.set?n.set:$),Object.defineProperty(e,t,Tt)}function It(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),oe.target&&e.depend(),e.value}}function Mt(e,t,n,r){return l(n)&&(n=(r=n).handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}function Dt(t,e){if(t){for(var n=Object.create(null),r=ne?Reflect.ownKeys(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}):Object.keys(t),i=0;i<r.length;i++){for(var o=r[i],a=t[o].from,s=e;s;){if(s._provided&&p(s._provided,a)){n[o]=s._provided[a];break}s=s.$parent}if(!s&&"default"in t[o]){var c=t[o].default;n[o]="function"==typeof c?c.call(e):c}}return n}}function Pt(e,t){var n,r,i,o,a;if(Array.isArray(e)||"string"==typeof e)for(n=new Array(e.length),r=0,i=e.length;r<i;r++)n[r]=t(e[r],r);else if("number"==typeof e)for(n=new Array(e),r=0;r<e;r++)n[r]=t(r+1,r);else if(P(e))for(o=Object.keys(e),n=new Array(o.length),r=0,i=o.length;r<i;r++)a=o[r],n[r]=t(e[a],a,r);return D(n)&&(n._isVList=!0),n}function Ft(e,t,n,r){var i,o=this.$scopedSlots[e];if(o)n=n||{},r&&(n=m(m({},r),n)),i=o(n)||t;else{var a=this.$slots[e];a&&(a._rendered=!0),i=a||t}var s=n&&n.slot;return s?this.$createElement("template",{slot:s},i):i}function Rt(e){return Le(this.$options,"filters",e)||w}function Ht(e,t){return Array.isArray(e)?-1===e.indexOf(t):e!==t}function Bt(e,t,n,r,i){var o=j.keyCodes[t]||n;return i&&r&&!j.keyCodes[t]?Ht(i,r):o?Ht(o,e):r?_(r)!==t:void 0}function Ut(n,r,i,o,a){if(i)if(P(i)){var s;Array.isArray(i)&&(i=b(i));var e=function(t){if("class"===t||"style"===t||u(t))s=n;else{var e=n.attrs&&n.attrs.type;s=o||j.mustUseProp(r,e,t)?n.domProps||(n.domProps={}):n.attrs||(n.attrs={})}t in s||(s[t]=i[t],a&&((n.on||(n.on={}))["update:"+t]=function(e){i[t]=e}))};for(var t in i)e(t)}else;return n}function Vt(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t||Kt(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),"__static__"+e,!1),r}function zt(e,t,n){return Kt(e,"__once__"+t+(n?"_"+n:""),!0),e}function Kt(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&"string"!=typeof e[r]&&Jt(e[r],t+"_"+r,n);else Jt(e,t,n)}function Jt(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function qt(e,t){if(t)if(l(t)){var n=e.on=e.on?m({},e.on):{};for(var r in t){var i=n[r],o=t[r];n[r]=i?[].concat(i,o):o}}else;return e}function Wt(e){e._o=zt,e._n=F,e._s=t,e._l=Pt,e._t=Ft,e._q=C,e._i=x,e._m=Vt,e._f=Rt,e._k=Bt,e._b=Ut,e._v=pe,e._e=fe,e._u=ht,e._g=qt}function Gt(e,t,n,o,r){var a,s=r.options;p(o,"_uid")?(a=Object.create(o))._original=o:o=(a=o)._original;var i=S(s._compiled),c=!i;this.data=e,this.props=t,this.children=n,this.parent=o,this.listeners=e.on||y,this.injections=Dt(s.inject,o),this.slots=function(){return dt(n,o)},i&&(this.$options=s,this.$slots=this.slots(),this.$scopedSlots=e.scopedSlots||y),s._scopeId?this._c=function(e,t,n,r){var i=rn(a,e,t,n,r,c);return i&&!Array.isArray(i)&&(i.fnScopeId=s._scopeId,i.fnContext=o),i}:this._c=function(e,t,n,r){return rn(a,e,t,n,r,c)}}function Zt(e,t,n,r){var i=de(e);return i.fnContext=n,i.fnOptions=r,t.slot&&((i.data||(i.data={})).slot=t.slot),i}function Xt(e,t){for(var n in t)e[g(n)]=t[n]}Wt(Gt.prototype);var Yt={init:function(e,t,n,r){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var i=e;Yt.prepatch(i,i)}else{(e.componentInstance=function(e,t,n,r){var i={_isComponent:!0,parent:t,_parentVnode:e,_parentElm:n||null,_refElm:r||null},o=e.data.inlineTemplate;D(o)&&(i.render=o.render,i.staticRenderFns=o.staticRenderFns);return new e.componentOptions.Ctor(i)}(e,mt,n,r)).$mount(t?e.elm:void 0,t)}},prepatch:function(e,t){var n=t.componentOptions;!function(e,t,n,r,i){var o=!!(i||e.$options._renderChildren||r.data.scopedSlots||e.$scopedSlots!==y);if(e.$options._parentVnode=r,e.$vnode=r,e._vnode&&(e._vnode.parent=r),e.$options._renderChildren=i,e.$attrs=r.data.attrs||y,e.$listeners=n||y,t&&e.$options.props){ge(!1);for(var a=e._props,s=e.$options._propKeys||[],c=0;c<s.length;c++){var l=s[c],u=e.$options.props;a[l]=Ie(l,u,t,e)}ge(!0),e.$options.propsData=t}n=n||y;var f=e.$options._parentListeners;e.$options._parentListeners=n,pt(e,n,f),o&&(e.$slots=dt(i,r.context),e.$forceUpdate())}(t.componentInstance=e.componentInstance,n.propsData,n.listeners,t,n.children)},insert:function(e){var t,n=e.context,r=e.componentInstance;r._isMounted||(r._isMounted=!0,_t(r,"mounted")),e.data.keepAlive&&(n._isMounted?((t=r)._inactive=!1,$t.push(t)):gt(r,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?function e(t,n){if(!(n&&(t._directInactive=!0,yt(t))||t._inactive)){t._inactive=!0;for(var r=0;r<t.$children.length;r++)e(t.$children[r]);_t(t,"deactivated")}}(t,!0):t.$destroy())}},Qt=Object.keys(Yt);function en(e,t,n,r,i){if(!M(e)){var o=n.$options._base;if(P(e)&&(e=o.extend(e)),"function"==typeof e){var a,s,c,l,u,f,p;if(M(e.cid)&&void 0===(e=function(t,n,e){if(S(t.error)&&D(t.errorComp))return t.errorComp;if(D(t.resolved))return t.resolved;if(S(t.loading)&&D(t.loadingComp))return t.loadingComp;if(!D(t.contexts)){var r=t.contexts=[e],i=!0,o=function(){for(var e=0,t=r.length;e<t;e++)r[e].$forceUpdate()},a=R(function(e){t.resolved=st(e,n),i||o()}),s=R(function(e){D(t.errorComp)&&(t.error=!0,o())}),c=t(a,s);return P(c)&&("function"==typeof c.then?M(t.resolved)&&c.then(a,s):D(c.component)&&"function"==typeof c.component.then&&(c.component.then(a,s),D(c.error)&&(t.errorComp=st(c.error,n)),D(c.loading)&&(t.loadingComp=st(c.loading,n),0===c.delay?t.loading=!0:setTimeout(function(){M(t.resolved)&&M(t.error)&&(t.loading=!0,o())},c.delay||200)),D(c.timeout)&&setTimeout(function(){M(t.resolved)&&s(null)},c.timeout))),i=!1,t.loading?t.loadingComp:t.resolved}t.contexts.push(e)}(a=e,o,n)))return s=a,c=t,l=n,u=r,f=i,(p=fe()).asyncFactory=s,p.asyncMeta={data:c,context:l,children:u,tag:f},p;t=t||{},dn(e),D(t.model)&&function(e,t){var n=e.model&&e.model.prop||"value",r=e.model&&e.model.event||"input";(t.props||(t.props={}))[n]=t.model.value;var i=t.on||(t.on={});D(i[r])?i[r]=[t.model.callback].concat(i[r]):i[r]=t.model.callback}(e.options,t);var d=function(e,t,n){var r=t.options.props;if(!M(r)){var i={},o=e.attrs,a=e.props;if(D(o)||D(a))for(var s in r){var c=_(s);it(i,a,s,c,!0)||it(i,o,s,c,!1)}return i}}(t,e);if(S(e.options.functional))return function(e,t,n,r,i){var o=e.options,a={},s=o.props;if(D(s))for(var c in s)a[c]=Ie(c,s,t||y);else D(n.attrs)&&Xt(a,n.attrs),D(n.props)&&Xt(a,n.props);var l=new Gt(n,a,i,r,e),u=o.render.call(null,l._c,l);if(u instanceof le)return Zt(u,n,l.parent,o);if(Array.isArray(u)){for(var f=ot(u)||[],p=new Array(f.length),d=0;d<f.length;d++)p[d]=Zt(f[d],n,l.parent,o);return p}}(e,d,t,n,r);var v=t.on;if(t.on=t.nativeOn,S(e.options.abstract)){var h=t.slot;t={},h&&(t.slot=h)}!function(e){for(var t=e.hook||(e.hook={}),n=0;n<Qt.length;n++){var r=Qt[n];t[r]=Yt[r]}}(t);var m=e.options.name||i;return new le("vue-component-"+e.cid+(m?"-"+m:""),t,void 0,void 0,void 0,n,{Ctor:e,propsData:d,listeners:v,tag:i,children:r},a)}}}var tn=1,nn=2;function rn(e,t,n,r,i,o){return(Array.isArray(n)||T(n))&&(i=r,r=n,n=void 0),S(o)&&(i=nn),function(e,t,n,r,i){if(D(n)&&D(n.__ob__))return fe();D(n)&&D(n.is)&&(t=n.is);if(!t)return fe();Array.isArray(r)&&"function"==typeof r[0]&&((n=n||{}).scopedSlots={default:r[0]},r.length=0);i===nn?r=ot(r):i===tn&&(r=function(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}(r));var o,a;if("string"==typeof t){var s;a=e.$vnode&&e.$vnode.ns||j.getTagNamespace(t),o=j.isReservedTag(t)?new le(j.parsePlatformTagName(t),n,r,void 0,void 0,e):D(s=Le(e.$options,"components",t))?en(s,n,e,r,t):new le(t,n,r,void 0,void 0,e)}else o=en(t,n,e,r);return Array.isArray(o)?o:D(o)?(D(a)&&function e(t,n,r){t.ns=n;"foreignObject"===t.tag&&(n=void 0,r=!0);if(D(t.children))for(var i=0,o=t.children.length;i<o;i++){var a=t.children[i];D(a.tag)&&(M(a.ns)||S(r)&&"svg"!==a.tag)&&e(a,n,r)}}(o,a),D(n)&&function(e){P(e.style)&&Ye(e.style);P(e.class)&&Ye(e.class)}(n),o):fe()}(e,t,n,r,i)}var on,an,sn,cn,ln,un,fn,pn=0;function dn(e){var t=e.options;if(e.super){var n=dn(e.super);if(n!==e.superOptions){e.superOptions=n;var r=function(e){var t,n=e.options,r=e.extendOptions,i=e.sealedOptions;for(var o in n)n[o]!==i[o]&&(t||(t={}),t[o]=vn(n[o],r[o],i[o]));return t}(e);r&&m(e.extendOptions,r),(t=e.options=Ne(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function vn(e,t,n){if(Array.isArray(e)){var r=[];n=Array.isArray(n)?n:[n],t=Array.isArray(t)?t:[t];for(var i=0;i<e.length;i++)(0<=t.indexOf(e[i])||n.indexOf(e[i])<0)&&r.push(e[i]);return r}return e}function hn(e){this._init(e)}function mn(e){e.cid=0;var a=1;e.extend=function(e){e=e||{};var t=this,n=t.cid,r=e._Ctor||(e._Ctor={});if(r[n])return r[n];var i=e.name||t.options.name,o=function(e){this._init(e)};return((o.prototype=Object.create(t.prototype)).constructor=o).cid=a++,o.options=Ne(t.options,e),o.super=t,o.options.props&&function(e){var t=e.options.props;for(var n in t)Et(e.prototype,"_props",n)}(o),o.options.computed&&function(e){var t=e.options.computed;for(var n in t)Lt(e.prototype,n,t[n])}(o),o.extend=t.extend,o.mixin=t.mixin,o.use=t.use,k.forEach(function(e){o[e]=t[e]}),i&&(o.options.components[i]=o),o.superOptions=t.options,o.extendOptions=e,o.sealedOptions=m({},o.options),r[n]=o}}function yn(e){return e&&(e.Ctor.options.name||e.tag)}function gn(e,t){return Array.isArray(e)?-1<e.indexOf(t):"string"==typeof e?-1<e.split(",").indexOf(t):(n=e,"[object RegExp]"===r.call(n)&&e.test(t));var n}function _n(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=yn(a.componentOptions);s&&!t(s)&&bn(n,o,r,i)}}}function bn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,f(n,t)}hn.prototype._init=function(e){var t,n,r,i,o=this;o._uid=pn++,o._isVue=!0,e&&e._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r,n._parentElm=t._parentElm,n._refElm=t._refElm;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(o,e):o.$options=Ne(dn(o.constructor),e||{},o),function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}((o._renderProxy=o)._self=o),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&pt(e,t)}(o),function(i){i._vnode=null,i._staticTrees=null;var e=i.$options,t=i.$vnode=e._parentVnode,n=t&&t.context;i.$slots=dt(e._renderChildren,n),i.$scopedSlots=y,i._c=function(e,t,n,r){return rn(i,e,t,n,r,!1)},i.$createElement=function(e,t,n,r){return rn(i,e,t,n,r,!0)};var r=t&&t.data;Ce(i,"$attrs",r&&r.attrs||y,null,!0),Ce(i,"$listeners",e._parentListeners||y,null,!0)}(o),_t(o,"beforeCreate"),(n=Dt((t=o).$options.inject,t))&&(ge(!1),Object.keys(n).forEach(function(e){Ce(t,e,n[e])}),ge(!0)),jt(o),(i=(r=o).$options.provide)&&(r._provided="function"==typeof i?i.call(r):i),_t(o,"created"),o.$options.el&&o.$mount(o.$options.el)},on=hn,an={get:function(){return this._data}},sn={get:function(){return this._props}},Object.defineProperty(on.prototype,"$data",an),Object.defineProperty(on.prototype,"$props",sn),on.prototype.$set=xe,on.prototype.$delete=ke,on.prototype.$watch=function(e,t,n){if(l(t))return Mt(this,e,t,n);(n=n||{}).user=!0;var r=new St(this,e,t,n);return n.immediate&&t.call(this,r.value),function(){r.teardown()}},ln=/^hook:/,(cn=hn).prototype.$on=function(e,t){if(Array.isArray(e))for(var n=0,r=e.length;n<r;n++)this.$on(e[n],t);else(this._events[e]||(this._events[e]=[])).push(t),ln.test(e)&&(this._hasHookEvent=!0);return this},cn.prototype.$once=function(e,t){var n=this;function r(){n.$off(e,r),t.apply(n,arguments)}return r.fn=t,n.$on(e,r),n},cn.prototype.$off=function(e,t){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(e)){for(var r=0,i=e.length;r<i;r++)this.$off(e[r],t);return n}var o=n._events[e];if(!o)return n;if(!t)return n._events[e]=null,n;if(t)for(var a,s=o.length;s--;)if((a=o[s])===t||a.fn===t){o.splice(s,1);break}return n},cn.prototype.$emit=function(t){var n=this,e=n._events[t];if(e){e=1<e.length?h(e):e;for(var r=h(arguments,1),i=0,o=e.length;i<o;i++)try{e[i].apply(n,r)}catch(e){Fe(e,n,'event handler for "'+t+'"')}}return n},(un=hn).prototype._update=function(e,t){var n=this;n._isMounted&&_t(n,"beforeUpdate");var r=n.$el,i=n._vnode,o=mt;(mt=n)._vnode=e,i?n.$el=n.__patch__(i,e):(n.$el=n.__patch__(n.$el,e,t,!1,n.$options._parentElm,n.$options._refElm),n.$options._parentElm=n.$options._refElm=null),mt=o,r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},un.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},un.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){_t(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||f(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),_t(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}},Wt((fn=hn).prototype),fn.prototype.$nextTick=function(e){return Ze(e,this)},fn.prototype._render=function(){var t,n=this,e=n.$options,r=e.render,i=e._parentVnode;i&&(n.$scopedSlots=i.data.scopedSlots||y),n.$vnode=i;try{t=r.call(n._renderProxy,n.$createElement)}catch(e){Fe(e,n,"render"),t=n._vnode}return t instanceof le||(t=fe()),t.parent=i,t};var $n,wn,Cn,xn=[String,RegExp,Array],kn={KeepAlive:{name:"keep-alive",abstract:!0,props:{include:xn,exclude:xn,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)bn(this.cache,e,this.keys)},mounted:function(){var e=this;this.$watch("include",function(t){_n(e,function(e){return gn(t,e)})}),this.$watch("exclude",function(t){_n(e,function(e){return!gn(t,e)})})},render:function(){var e=this.$slots.default,t=lt(e),n=t&&t.componentOptions;if(n){var r=yn(n),i=this.include,o=this.exclude;if(i&&(!r||!gn(i,r))||o&&r&&gn(o,r))return t;var a=this.cache,s=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;a[c]?(t.componentInstance=a[c].componentInstance,f(s,c),s.push(c)):(a[c]=t,s.push(c),this.max&&s.length>parseInt(this.max)&&bn(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};$n=hn,Cn={get:function(){return j}},Object.defineProperty($n,"config",Cn),$n.util={warn:re,extend:m,mergeOptions:Ne,defineReactive:Ce},$n.set=xe,$n.delete=ke,$n.nextTick=Ze,$n.options=Object.create(null),k.forEach(function(e){$n.options[e+"s"]=Object.create(null)}),m(($n.options._base=$n).options.components,kn),$n.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(-1<t.indexOf(e))return this;var n=h(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this},$n.mixin=function(e){return this.options=Ne(this.options,e),this},mn($n),wn=$n,k.forEach(function(n){wn[n]=function(e,t){return t?("component"===n&&l(t)&&(t.name=t.name||e,t=this.options._base.extend(t)),"directive"===n&&"function"==typeof t&&(t={bind:t,update:t}),this.options[n+"s"][e]=t):this.options[n+"s"][e]}}),Object.defineProperty(hn.prototype,"$isServer",{get:Y}),Object.defineProperty(hn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(hn,"FunctionalRenderContext",{value:Gt}),hn.version="2.5.16";var An=s("style,class"),On=s("input,textarea,option,select,progress"),Sn=function(e,t,n){return"value"===n&&On(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Tn=s("contenteditable,draggable,spellcheck"),En=s("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),jn="http://www.w3.org/1999/xlink",Nn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Ln=function(e){return Nn(e)?e.slice(6,e.length):""},In=function(e){return null==e||!1===e};function Mn(e){for(var t=e.data,n=e,r=e;D(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=Dn(r.data,t));for(;D(n=n.parent);)n&&n.data&&(t=Dn(t,n.data));return function(e,t){if(D(e)||D(t))return Pn(e,Fn(t));return""}(t.staticClass,t.class)}function Dn(e,t){return{staticClass:Pn(e.staticClass,t.staticClass),class:D(e.class)?[e.class,t.class]:t.class}}function Pn(e,t){return e?t?e+" "+t:e:t||""}function Fn(e){return Array.isArray(e)?function(e){for(var t,n="",r=0,i=e.length;r<i;r++)D(t=Fn(e[r]))&&""!==t&&(n&&(n+=" "),n+=t);return n}(e):P(e)?function(e){var t="";for(var n in e)e[n]&&(t&&(t+=" "),t+=n);return t}(e):"string"==typeof e?e:""}var Rn={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Hn=s("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Bn=s("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Un=function(e){return Hn(e)||Bn(e)};function Vn(e){return Bn(e)?"svg":"math"===e?"math":void 0}var zn=Object.create(null);var Kn=s("text,number,password,search,email,tel,url");function Jn(e){if("string"==typeof e){var t=document.querySelector(e);return t||document.createElement("div")}return e}var qn=Object.freeze({createElement:function(e,t){var n=document.createElement(e);return"select"!==e||t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n},createElementNS:function(e,t){return document.createElementNS(Rn[e],t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},setStyleScope:function(e,t){e.setAttribute(t,"")}}),Wn={create:function(e,t){Gn(t)},update:function(e,t){e.data.ref!==t.data.ref&&(Gn(e,!0),Gn(t))},destroy:function(e){Gn(e,!0)}};function Gn(e,t){var n=e.data.ref;if(D(n)){var r=e.context,i=e.componentInstance||e.elm,o=r.$refs;t?Array.isArray(o[n])?f(o[n],i):o[n]===i&&(o[n]=void 0):e.data.refInFor?Array.isArray(o[n])?o[n].indexOf(i)<0&&o[n].push(i):o[n]=[i]:o[n]=i}}var Zn=new le("",{},[]),Xn=["create","activate","update","remove","destroy"];function Yn(e,t){return e.key===t.key&&(e.tag===t.tag&&e.isComment===t.isComment&&D(e.data)===D(t.data)&&function(e,t){if("input"!==e.tag)return!0;var n,r=D(n=e.data)&&D(n=n.attrs)&&n.type,i=D(n=t.data)&&D(n=n.attrs)&&n.type;return r===i||Kn(r)&&Kn(i)}(e,t)||S(e.isAsyncPlaceholder)&&e.asyncFactory===t.asyncFactory&&M(t.asyncFactory.error))}function Qn(e,t,n){var r,i,o={};for(r=t;r<=n;++r)D(i=e[r].key)&&(o[i]=r);return o}var er={create:tr,update:tr,destroy:function(e){tr(e,Zn)}};function tr(e,t){(e.data.directives||t.data.directives)&&function(t,n){var e,r,i,o=t===Zn,a=n===Zn,s=rr(t.data.directives,t.context),c=rr(n.data.directives,n.context),l=[],u=[];for(e in c)r=s[e],i=c[e],r?(i.oldValue=r.value,ir(i,"update",n,t),i.def&&i.def.componentUpdated&&u.push(i)):(ir(i,"bind",n,t),i.def&&i.def.inserted&&l.push(i));if(l.length){var f=function(){for(var e=0;e<l.length;e++)ir(l[e],"inserted",n,t)};o?rt(n,"insert",f):f()}u.length&&rt(n,"postpatch",function(){for(var e=0;e<u.length;e++)ir(u[e],"componentUpdated",n,t)});if(!o)for(e in s)c[e]||ir(s[e],"unbind",t,t,a)}(e,t)}var nr=Object.create(null);function rr(e,t){var n,r,i,o=Object.create(null);if(!e)return o;for(n=0;n<e.length;n++)(r=e[n]).modifiers||(r.modifiers=nr),(o[(i=r,i.rawName||i.name+"."+Object.keys(i.modifiers||{}).join("."))]=r).def=Le(t.$options,"directives",r.name);return o}function ir(t,n,r,e,i){var o=t.def&&t.def[n];if(o)try{o(r.elm,t,r,e,i)}catch(e){Fe(e,r.context,"directive "+t.name+" "+n+" hook")}}var or=[Wn,er];function ar(e,t){var n=t.componentOptions;if(!(D(n)&&!1===n.Ctor.options.inheritAttrs||M(e.data.attrs)&&M(t.data.attrs))){var r,i,o=t.elm,a=e.data.attrs||{},s=t.data.attrs||{};for(r in D(s.__ob__)&&(s=t.data.attrs=m({},s)),s)i=s[r],a[r]!==i&&sr(o,r,i);for(r in(K||q)&&s.value!==a.value&&sr(o,"value",s.value),a)M(s[r])&&(Nn(r)?o.removeAttributeNS(jn,Ln(r)):Tn(r)||o.removeAttribute(r))}}function sr(e,t,n){-1<e.tagName.indexOf("-")?cr(e,t,n):En(t)?In(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Tn(t)?e.setAttribute(t,In(n)||"false"===n?"false":"true"):Nn(t)?In(n)?e.removeAttributeNS(jn,Ln(t)):e.setAttributeNS(jn,t,n):cr(e,t,n)}function cr(t,e,n){if(In(n))t.removeAttribute(e);else{if(K&&!J&&"TEXTAREA"===t.tagName&&"placeholder"===e&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var lr={create:ar,update:ar};function ur(e,t){var n=t.elm,r=t.data,i=e.data;if(!(M(r.staticClass)&&M(r.class)&&(M(i)||M(i.staticClass)&&M(i.class)))){var o=Mn(t),a=n._transitionClasses;D(a)&&(o=Pn(o,Fn(a))),o!==n._prevClass&&(n.setAttribute("class",o),n._prevClass=o)}}var fr,pr,dr,vr,hr,mr,yr={create:ur,update:ur},gr=/[\w).+\-_$\]]/;function _r(e){var t,n,r,i,o,a=!1,s=!1,c=!1,l=!1,u=0,f=0,p=0,d=0;for(r=0;r<e.length;r++)if(n=t,t=e.charCodeAt(r),a)39===t&&92!==n&&(a=!1);else if(s)34===t&&92!==n&&(s=!1);else if(c)96===t&&92!==n&&(c=!1);else if(l)47===t&&92!==n&&(l=!1);else if(124!==t||124===e.charCodeAt(r+1)||124===e.charCodeAt(r-1)||u||f||p){switch(t){case 34:s=!0;break;case 39:a=!0;break;case 96:c=!0;break;case 40:p++;break;case 41:p--;break;case 91:f++;break;case 93:f--;break;case 123:u++;break;case 125:u--}if(47===t){for(var v=r-1,h=void 0;0<=v&&" "===(h=e.charAt(v));v--);h&&gr.test(h)||(l=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r<o.length;r++)i=br(i,o[r]);return i}function br(e,t){var n=t.indexOf("(");if(n<0)return'_f("'+t+'")('+e+")";var r=t.slice(0,n),i=t.slice(n+1);return'_f("'+r+'")('+e+(")"!==i?","+i:i)}function $r(e){console.error("[Vue compiler]: "+e)}function wr(e,t){return e?e.map(function(e){return e[t]}).filter(function(e){return e}):[]}function Cr(e,t,n){(e.props||(e.props=[])).push({name:t,value:n}),e.plain=!1}function xr(e,t,n){(e.attrs||(e.attrs=[])).push({name:t,value:n}),e.plain=!1}function kr(e,t,n){e.attrsMap[t]=n,e.attrsList.push({name:t,value:n})}function Ar(e,t,n,r,i,o){var a;(r=r||y).capture&&(delete r.capture,t="!"+t),r.once&&(delete r.once,t="~"+t),r.passive&&(delete r.passive,t="&"+t),"click"===t&&(r.right?(t="contextmenu",delete r.right):r.middle&&(t="mouseup")),r.native?(delete r.native,a=e.nativeEvents||(e.nativeEvents={})):a=e.events||(e.events={});var s={value:n.trim()};r!==y&&(s.modifiers=r);var c=a[t];Array.isArray(c)?i?c.unshift(s):c.push(s):a[t]=c?i?[s,c]:[c,s]:s,e.plain=!1}function Or(e,t,n){var r=Sr(e,":"+t)||Sr(e,"v-bind:"+t);if(null!=r)return _r(r);if(!1!==n){var i=Sr(e,t);if(null!=i)return JSON.stringify(i)}}function Sr(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var i=e.attrsList,o=0,a=i.length;o<a;o++)if(i[o].name===t){i.splice(o,1);break}return n&&delete e.attrsMap[t],r}function Tr(e,t,n){var r=n||{},i=r.number,o="$$v",a=o;r.trim&&(a="(typeof $$v === 'string'? $$v.trim(): $$v)"),i&&(a="_n("+a+")");var s=Er(t,a);e.model={value:"("+t+")",expression:'"'+t+'"',callback:"function ($$v) {"+s+"}"}}function Er(e,t){var n=function(e){if(e=e.trim(),fr=e.length,e.indexOf("[")<0||e.lastIndexOf("]")<fr-1)return-1<(vr=e.lastIndexOf("."))?{exp:e.slice(0,vr),key:'"'+e.slice(vr+1)+'"'}:{exp:e,key:null};pr=e,vr=hr=mr=0;for(;!Nr();)Lr(dr=jr())?Mr(dr):91===dr&&Ir(dr);return{exp:e.slice(0,hr),key:e.slice(hr+1,mr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function jr(){return pr.charCodeAt(++vr)}function Nr(){return fr<=vr}function Lr(e){return 34===e||39===e}function Ir(e){var t=1;for(hr=vr;!Nr();)if(Lr(e=jr()))Mr(e);else if(91===e&&t++,93===e&&t--,0===t){mr=vr;break}}function Mr(e){for(var t=e;!Nr()&&(e=jr())!==t;);}var Dr,Pr="__r",Fr="__c";function Rr(e,t,n,r,i){var o,a,s,c,l;t=(o=t)._withTask||(o._withTask=function(){Je=!0;var e=o.apply(null,arguments);return Je=!1,e}),n&&(a=t,s=e,c=r,l=Dr,t=function e(){null!==a.apply(null,arguments)&&Hr(s,e,c,l)}),Dr.addEventListener(e,t,Z?{capture:r,passive:i}:r)}function Hr(e,t,n,r){(r||Dr).removeEventListener(e,t._withTask||t,n)}function Br(e,t){if(!M(e.data.on)||!M(t.data.on)){var n=t.data.on||{},r=e.data.on||{};Dr=t.elm,function(e){if(D(e[Pr])){var t=K?"change":"input";e[t]=[].concat(e[Pr],e[t]||[]),delete e[Pr]}D(e[Fr])&&(e.change=[].concat(e[Fr],e.change||[]),delete e[Fr])}(n),nt(n,r,Rr,Hr,t.context),Dr=void 0}}var Ur={create:Br,update:Br};function Vr(e,t){if(!M(e.data.domProps)||!M(t.data.domProps)){var n,r,i,o,a=t.elm,s=e.data.domProps||{},c=t.data.domProps||{};for(n in D(c.__ob__)&&(c=t.data.domProps=m({},c)),s)M(c[n])&&(a[n]="");for(n in c){if(r=c[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),r===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n){var l=M(a._value=r)?"":String(r);o=l,(i=a).composing||"OPTION"!==i.tagName&&!function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(i,o)&&!function(e,t){var n=e.value,r=e._vModifiers;if(D(r)){if(r.lazy)return!1;if(r.number)return F(n)!==F(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}(i,o)||(a.value=l)}else a[n]=r}}}var zr={create:Vr,update:Vr},Kr=e(function(e){var n={},r=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var t=e.split(r);1<t.length&&(n[t[0].trim()]=t[1].trim())}}),n});function Jr(e){var t=qr(e.style);return e.staticStyle?m(e.staticStyle,t):t}function qr(e){return Array.isArray(e)?b(e):"string"==typeof e?Kr(e):e}var Wr,Gr=/^--/,Zr=/\s*!important$/,Xr=function(e,t,n){if(Gr.test(t))e.style.setProperty(t,n);else if(Zr.test(n))e.style.setProperty(t,n.replace(Zr,""),"important");else{var r=Qr(t);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)e.style[r]=n[i];else e.style[r]=n}},Yr=["Webkit","Moz","ms"],Qr=e(function(e){if(Wr=Wr||document.createElement("div").style,"filter"!==(e=g(e))&&e in Wr)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<Yr.length;n++){var r=Yr[n]+t;if(r in Wr)return r}});function ei(e,t){var n=t.data,r=e.data;if(!(M(n.staticStyle)&&M(n.style)&&M(r.staticStyle)&&M(r.style))){var i,o,a=t.elm,s=r.staticStyle,c=r.normalizedStyle||r.style||{},l=s||c,u=qr(t.data.style)||{};t.data.normalizedStyle=D(u.__ob__)?m({},u):u;var f=function(e,t){var n,r={};if(t)for(var i=e;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=Jr(i.data))&&m(r,n);(n=Jr(e.data))&&m(r,n);for(var o=e;o=o.parent;)o.data&&(n=Jr(o.data))&&m(r,n);return r}(t,!0);for(o in l)M(f[o])&&Xr(a,o,"");for(o in f)(i=f[o])!==l[o]&&Xr(a,o,null==i?"":i)}}var ti={create:ei,update:ei};function ni(t,e){if(e&&(e=e.trim()))if(t.classList)-1<e.indexOf(" ")?e.split(/\s+/).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function ri(t,e){if(e&&(e=e.trim()))if(t.classList)-1<e.indexOf(" ")?e.split(/\s+/).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";0<=n.indexOf(r);)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function ii(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&m(t,oi(e.name||"v")),m(t,e),t}return"string"==typeof e?oi(e):void 0}}var oi=e(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),ai=B&&!J,si="transition",ci="animation",li="transition",ui="transitionend",fi="animation",pi="animationend";ai&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(li="WebkitTransition",ui="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(fi="WebkitAnimation",pi="webkitAnimationEnd"));var di=B?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function vi(e){di(function(){di(e)})}function hi(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),ni(e,t))}function mi(e,t){e._transitionClasses&&f(e._transitionClasses,t),ri(e,t)}function yi(t,e,n){var r=_i(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===si?ui:pi,c=0,l=function(){t.removeEventListener(s,u),n()},u=function(e){e.target===t&&++c>=a&&l()};setTimeout(function(){c<a&&l()},o+1),t.addEventListener(s,u)}var gi=/\b(transform|all)(,|$)/;function _i(e,t){var n,r=window.getComputedStyle(e),i=r[li+"Delay"].split(", "),o=r[li+"Duration"].split(", "),a=bi(i,o),s=r[fi+"Delay"].split(", "),c=r[fi+"Duration"].split(", "),l=bi(s,c),u=0,f=0;return t===si?0<a&&(n=si,u=a,f=o.length):t===ci?0<l&&(n=ci,u=l,f=c.length):f=(n=0<(u=Math.max(a,l))?l<a?si:ci:null)?n===si?o.length:c.length:0,{type:n,timeout:u,propCount:f,hasTransform:n===si&&gi.test(r[li+"Property"])}}function bi(n,e){for(;n.length<e.length;)n=n.concat(n);return Math.max.apply(null,e.map(function(e,t){return $i(e)+$i(n[t])}))}function $i(e){return 1e3*Number(e.slice(0,-1))}function wi(n,e){var r=n.elm;D(r._leaveCb)&&(r._leaveCb.cancelled=!0,r._leaveCb());var t=ii(n.data.transition);if(!M(t)&&!D(r._enterCb)&&1===r.nodeType){for(var i=t.css,o=t.type,a=t.enterClass,s=t.enterToClass,c=t.enterActiveClass,l=t.appearClass,u=t.appearToClass,f=t.appearActiveClass,p=t.beforeEnter,d=t.enter,v=t.afterEnter,h=t.enterCancelled,m=t.beforeAppear,y=t.appear,g=t.afterAppear,_=t.appearCancelled,b=t.duration,$=mt,w=mt.$vnode;w&&w.parent;)$=(w=w.parent).context;var C=!$._isMounted||!n.isRootInsert;if(!C||y||""===y){var x=C&&l?l:a,k=C&&f?f:c,A=C&&u?u:s,O=C&&m||p,S=C&&"function"==typeof y?y:d,T=C&&g||v,E=C&&_||h,j=F(P(b)?b.enter:b),N=!1!==i&&!J,L=ki(S),I=r._enterCb=R(function(){N&&(mi(r,A),mi(r,k)),I.cancelled?(N&&mi(r,x),E&&E(r)):T&&T(r),r._enterCb=null});n.data.show||rt(n,"insert",function(){var e=r.parentNode,t=e&&e._pending&&e._pending[n.key];t&&t.tag===n.tag&&t.elm._leaveCb&&t.elm._leaveCb(),S&&S(r,I)}),O&&O(r),N&&(hi(r,x),hi(r,k),vi(function(){mi(r,x),I.cancelled||(hi(r,A),L||(xi(j)?setTimeout(I,j):yi(r,o,I)))})),n.data.show&&(e&&e(),S&&S(r,I)),N||L||I()}}}function Ci(e,t){var n=e.elm;D(n._enterCb)&&(n._enterCb.cancelled=!0,n._enterCb());var r=ii(e.data.transition);if(M(r)||1!==n.nodeType)return t();if(!D(n._leaveCb)){var i=r.css,o=r.type,a=r.leaveClass,s=r.leaveToClass,c=r.leaveActiveClass,l=r.beforeLeave,u=r.leave,f=r.afterLeave,p=r.leaveCancelled,d=r.delayLeave,v=r.duration,h=!1!==i&&!J,m=ki(u),y=F(P(v)?v.leave:v),g=n._leaveCb=R(function(){n.parentNode&&n.parentNode._pending&&(n.parentNode._pending[e.key]=null),h&&(mi(n,s),mi(n,c)),g.cancelled?(h&&mi(n,a),p&&p(n)):(t(),f&&f(n)),n._leaveCb=null});d?d(_):_()}function _(){g.cancelled||(e.data.show||((n.parentNode._pending||(n.parentNode._pending={}))[e.key]=e),l&&l(n),h&&(hi(n,a),hi(n,c),vi(function(){mi(n,a),g.cancelled||(hi(n,s),m||(xi(y)?setTimeout(g,y):yi(n,o,g)))})),u&&u(n,g),h||m||g())}}function xi(e){return"number"==typeof e&&!isNaN(e)}function ki(e){if(M(e))return!1;var t=e.fns;return D(t)?ki(Array.isArray(t)?t[0]:t):1<(e._length||e.length)}function Ai(e,t){!0!==t.data.show&&wi(t)}var Oi=function(e){var r,t,g={},n=e.modules,_=e.nodeOps;for(r=0;r<Xn.length;++r)for(g[Xn[r]]=[],t=0;t<n.length;++t)D(n[t][Xn[r]])&&g[Xn[r]].push(n[t][Xn[r]]);function o(e){var t=_.parentNode(e);D(t)&&_.removeChild(t,e)}function b(e,t,n,r,i,o,a){if(D(e.elm)&&D(o)&&(e=o[a]=de(e)),e.isRootInsert=!i,!function(e,t,n,r){var i=e.data;if(D(i)){var o=D(e.componentInstance)&&i.keepAlive;if(D(i=i.hook)&&D(i=i.init)&&i(e,!1,n,r),D(e.componentInstance))return d(e,t),S(o)&&function(e,t,n,r){for(var i,o=e;o.componentInstance;)if(o=o.componentInstance._vnode,D(i=o.data)&&D(i=i.transition)){for(i=0;i<g.activate.length;++i)g.activate[i](Zn,o);t.push(o);break}u(n,e.elm,r)}(e,t,n,r),!0}}(e,t,n,r)){var s=e.data,c=e.children,l=e.tag;D(l)?(e.elm=e.ns?_.createElementNS(e.ns,l):_.createElement(l,e),f(e),v(e,c,t),D(s)&&h(e,t)):S(e.isComment)?e.elm=_.createComment(e.text):e.elm=_.createTextNode(e.text),u(n,e.elm,r)}}function d(e,t){D(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,$(e)?(h(e,t),f(e)):(Gn(e),t.push(e))}function u(e,t,n){D(e)&&(D(n)?n.parentNode===e&&_.insertBefore(e,t,n):_.appendChild(e,t))}function v(e,t,n){if(Array.isArray(t))for(var r=0;r<t.length;++r)b(t[r],n,e.elm,null,!0,t,r);else T(e.text)&&_.appendChild(e.elm,_.createTextNode(String(e.text)))}function $(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return D(e.tag)}function h(e,t){for(var n=0;n<g.create.length;++n)g.create[n](Zn,e);D(r=e.data.hook)&&(D(r.create)&&r.create(Zn,e),D(r.insert)&&t.push(e))}function f(e){var t;if(D(t=e.fnScopeId))_.setStyleScope(e.elm,t);else for(var n=e;n;)D(t=n.context)&&D(t=t.$options._scopeId)&&_.setStyleScope(e.elm,t),n=n.parent;D(t=mt)&&t!==e.context&&t!==e.fnContext&&D(t=t.$options._scopeId)&&_.setStyleScope(e.elm,t)}function y(e,t,n,r,i,o){for(;r<=i;++r)b(n[r],o,e,t,!1,n,r)}function w(e){var t,n,r=e.data;if(D(r))for(D(t=r.hook)&&D(t=t.destroy)&&t(e),t=0;t<g.destroy.length;++t)g.destroy[t](e);if(D(t=e.children))for(n=0;n<e.children.length;++n)w(e.children[n])}function C(e,t,n,r){for(;n<=r;++n){var i=t[n];D(i)&&(D(i.tag)?(a(i),w(i)):o(i.elm))}}function a(e,t){if(D(t)||D(e.data)){var n,r=g.remove.length+1;for(D(t)?t.listeners+=r:t=function(e,t){function n(){0==--n.listeners&&o(e)}return n.listeners=t,n}(e.elm,r),D(n=e.componentInstance)&&D(n=n._vnode)&&D(n.data)&&a(n,t),n=0;n<g.remove.length;++n)g.remove[n](e,t);D(n=e.data.hook)&&D(n=n.remove)?n(e,t):t()}else o(e.elm)}function x(e,t,n,r){for(var i=n;i<r;i++){var o=t[i];if(D(o)&&Yn(e,o))return i}}function k(e,t,n,r){if(e!==t){var i=t.elm=e.elm;if(S(e.isAsyncPlaceholder))D(t.asyncFactory.resolved)?O(e.elm,t,n):t.isAsyncPlaceholder=!0;else if(S(t.isStatic)&&S(e.isStatic)&&t.key===e.key&&(S(t.isCloned)||S(t.isOnce)))t.componentInstance=e.componentInstance;else{var o,a=t.data;D(a)&&D(o=a.hook)&&D(o=o.prepatch)&&o(e,t);var s=e.children,c=t.children;if(D(a)&&$(t)){for(o=0;o<g.update.length;++o)g.update[o](e,t);D(o=a.hook)&&D(o=o.update)&&o(e,t)}M(t.text)?D(s)&&D(c)?s!==c&&function(e,t,n,r,i){for(var o,a,s,c=0,l=0,u=t.length-1,f=t[0],p=t[u],d=n.length-1,v=n[0],h=n[d],m=!i;c<=u&&l<=d;)M(f)?f=t[++c]:M(p)?p=t[--u]:Yn(f,v)?(k(f,v,r),f=t[++c],v=n[++l]):Yn(p,h)?(k(p,h,r),p=t[--u],h=n[--d]):Yn(f,h)?(k(f,h,r),m&&_.insertBefore(e,f.elm,_.nextSibling(p.elm)),f=t[++c],h=n[--d]):(Yn(p,v)?(k(p,v,r),m&&_.insertBefore(e,p.elm,f.elm),p=t[--u]):(M(o)&&(o=Qn(t,c,u)),M(a=D(v.key)?o[v.key]:x(v,t,c,u))?b(v,r,e,f.elm,!1,n,l):Yn(s=t[a],v)?(k(s,v,r),t[a]=void 0,m&&_.insertBefore(e,s.elm,f.elm)):b(v,r,e,f.elm,!1,n,l)),v=n[++l]);u<c?y(e,M(n[d+1])?null:n[d+1].elm,n,l,d,r):d<l&&C(0,t,c,u)}(i,s,c,n,r):D(c)?(D(e.text)&&_.setTextContent(i,""),y(i,null,c,0,c.length-1,n)):D(s)?C(0,s,0,s.length-1):D(e.text)&&_.setTextContent(i,""):e.text!==t.text&&_.setTextContent(i,t.text),D(a)&&D(o=a.hook)&&D(o=o.postpatch)&&o(e,t)}}}function A(e,t,n){if(S(n)&&D(e.parent))e.parent.data.pendingInsert=t;else for(var r=0;r<t.length;++r)t[r].data.hook.insert(t[r])}var m=s("attrs,class,staticClass,staticStyle,key");function O(e,t,n,r){var i,o=t.tag,a=t.data,s=t.children;if(r=r||a&&a.pre,t.elm=e,S(t.isComment)&&D(t.asyncFactory))return t.isAsyncPlaceholder=!0;if(D(a)&&(D(i=a.hook)&&D(i=i.init)&&i(t,!0),D(i=t.componentInstance)))return d(t,n),!0;if(D(o)){if(D(s))if(e.hasChildNodes())if(D(i=a)&&D(i=i.domProps)&&D(i=i.innerHTML)){if(i!==e.innerHTML)return!1}else{for(var c=!0,l=e.firstChild,u=0;u<s.length;u++){if(!l||!O(l,s[u],n,r)){c=!1;break}l=l.nextSibling}if(!c||l)return!1}else v(t,s,n);if(D(a)){var f=!1;for(var p in a)if(!m(p)){f=!0,h(t,n);break}!f&&a.class&&Ye(a.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,t,n,r,i,o){if(!M(t)){var a,s=!1,c=[];if(M(e))s=!0,b(t,c,i,o);else{var l=D(e.nodeType);if(!l&&Yn(e,t))k(e,t,c,r);else{if(l){if(1===e.nodeType&&e.hasAttribute(E)&&(e.removeAttribute(E),n=!0),S(n)&&O(e,t,c))return A(t,c,!0),e;a=e,e=new le(_.tagName(a).toLowerCase(),{},[],void 0,a)}var u=e.elm,f=_.parentNode(u);if(b(t,c,u._leaveCb?null:f,_.nextSibling(u)),D(t.parent))for(var p=t.parent,d=$(t);p;){for(var v=0;v<g.destroy.length;++v)g.destroy[v](p);if(p.elm=t.elm,d){for(var h=0;h<g.create.length;++h)g.create[h](Zn,p);var m=p.data.hook.insert;if(m.merged)for(var y=1;y<m.fns.length;y++)m.fns[y]()}else Gn(p);p=p.parent}D(f)?C(0,[e],0,0):D(e.tag)&&w(e)}}return A(t,c,s),t.elm}D(e)&&w(e)}}({nodeOps:qn,modules:[lr,yr,Ur,zr,ti,B?{create:Ai,activate:Ai,remove:function(e,t){!0!==e.data.show?Ci(e,t):t()}}:{}].concat(or)});J&&document.addEventListener("selectionchange",function(){var e=document.activeElement;e&&e.vmodel&&Mi(e,"input")});var Si={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?rt(n,"postpatch",function(){Si.componentUpdated(e,t,n)}):Ti(e,t,n.context),e._vOptions=[].map.call(e.options,Ni)):("textarea"===n.tag||Kn(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",Li),e.addEventListener("compositionend",Ii),e.addEventListener("change",Ii),J&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){Ti(e,t,n.context);var r=e._vOptions,i=e._vOptions=[].map.call(e.options,Ni);if(i.some(function(e,t){return!C(e,r[t])}))(e.multiple?t.value.some(function(e){return ji(e,i)}):t.value!==t.oldValue&&ji(t.value,i))&&Mi(e,"change")}}};function Ti(e,t,n){Ei(e,t,n),(K||q)&&setTimeout(function(){Ei(e,t,n)},0)}function Ei(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s<c;s++)if(a=e.options[s],i)o=-1<x(r,Ni(a)),a.selected!==o&&(a.selected=o);else if(C(Ni(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function ji(t,e){return e.every(function(e){return!C(e,t)})}function Ni(e){return"_value"in e?e._value:e.value}function Li(e){e.target.composing=!0}function Ii(e){e.target.composing&&(e.target.composing=!1,Mi(e.target,"input"))}function Mi(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Di(e){return!e.componentInstance||e.data&&e.data.transition?e:Di(e.componentInstance._vnode)}var Pi={model:Si,show:{bind:function(e,t,n){var r=t.value,i=(n=Di(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,wi(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Di(n)).data&&n.data.transition?(n.data.show=!0,r?wi(n,function(){e.style.display=e.__vOriginalDisplay}):Ci(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Fi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Ri(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Ri(lt(t.children)):e}function Hi(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[g(o)]=i[o];return t}function Bi(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var Ui={name:"transition",props:Fi,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(function(e){return e.tag||ct(e)})).length){var r=this.mode,i=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return i;var o=Ri(i);if(!o)return i;if(this._leaving)return Bi(e,i);var a="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?a+"comment":a+o.tag:T(o.key)?0===String(o.key).indexOf(a)?o.key:a+o.key:o.key;var s,c,l=(o.data||(o.data={})).transition=Hi(this),u=this._vnode,f=Ri(u);if(o.data.directives&&o.data.directives.some(function(e){return"show"===e.name})&&(o.data.show=!0),f&&f.data&&(s=o,(c=f).key!==s.key||c.tag!==s.tag)&&!ct(f)&&(!f.componentInstance||!f.componentInstance._vnode.isComment)){var p=f.data.transition=m({},l);if("out-in"===r)return this._leaving=!0,rt(p,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),Bi(e,i);if("in-out"===r){if(ct(o))return u;var d,v=function(){d()};rt(l,"afterEnter",v),rt(l,"enterCancelled",v),rt(p,"delayLeave",function(e){d=e})}}return i}}},Vi=m({tag:String,moveClass:String},Fi);function zi(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Ki(e){e.data.newPos=e.elm.getBoundingClientRect()}function Ji(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete Vi.mode;var qi={Transition:Ui,TransitionGroup:{props:Vi,render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Hi(this),s=0;s<i.length;s++){var c=i[s];c.tag&&null!=c.key&&0!==String(c.key).indexOf("__vlist")&&(o.push(c),((n[c.key]=c).data||(c.data={})).transition=a)}if(r){for(var l=[],u=[],f=0;f<r.length;f++){var p=r[f];p.data.transition=a,p.data.pos=p.elm.getBoundingClientRect(),n[p.key]?l.push(p):u.push(p)}this.kept=e(t,null,l),this.removed=u}return e(t,null,o)},beforeUpdate:function(){this.__patch__(this._vnode,this.kept,!1,!0),this._vnode=this.kept},updated:function(){var e=this.prevChildren,r=this.moveClass||(this.name||"v")+"-move";e.length&&this.hasMove(e[0].elm,r)&&(e.forEach(zi),e.forEach(Ki),e.forEach(Ji),this._reflow=document.body.offsetHeight,e.forEach(function(e){if(e.data.moved){var n=e.elm,t=n.style;hi(n,r),t.transform=t.WebkitTransform=t.transitionDuration="",n.addEventListener(ui,n._moveCb=function e(t){t&&!/transform$/.test(t.propertyName)||(n.removeEventListener(ui,e),n._moveCb=null,mi(n,r))})}}))},methods:{hasMove:function(e,t){if(!ai)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach(function(e){ri(n,e)}),ni(n,t),n.style.display="none",this.$el.appendChild(n);var r=_i(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}}};hn.config.mustUseProp=Sn,hn.config.isReservedTag=Un,hn.config.isReservedAttr=An,hn.config.getTagNamespace=Vn,hn.config.isUnknownElement=function(e){if(!B)return!0;if(Un(e))return!1;if(e=e.toLowerCase(),null!=zn[e])return zn[e];var t=document.createElement(e);return-1<e.indexOf("-")?zn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:zn[e]=/HTMLUnknownElement/.test(t.toString())},m(hn.options.directives,Pi),m(hn.options.components,qi),hn.prototype.__patch__=B?Oi:$,hn.prototype.$mount=function(e,t){return e=e&&B?Jn(e):void 0,r=e,i=t,(n=this).$el=r,n.$options.render||(n.$options.render=fe),_t(n,"beforeMount"),new St(n,function(){n._update(n._render(),i)},$,null,!0),i=!1,null==n.$vnode&&(n._isMounted=!0,_t(n,"mounted")),n;var n,r,i},B&&setTimeout(function(){j.devtools&&Q&&Q.emit("init",hn)},0);var Wi=/\{\{((?:.|\n)+?)\}\}/g,Gi=/[-.*+?^${}()|[\]\/\\]/g,Zi=e(function(e){var t=e[0].replace(Gi,"\\$&"),n=e[1].replace(Gi,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var Xi={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=Sr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Or(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var Yi,Qi={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=Sr(e,"style");n&&(e.staticStyle=JSON.stringify(Kr(n)));var r=Or(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},eo=function(e){return(Yi=Yi||document.createElement("div")).innerHTML=e,Yi.textContent},to=s("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),no=s("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),ro=s("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),io=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,oo="[a-zA-Z_][\\w\\-\\.]*",ao="((?:"+oo+"\\:)?"+oo+")",so=new RegExp("^<"+ao),co=/^\s*(\/?)>/,lo=new RegExp("^<\\/"+ao+"[^>]*>"),uo=/^<!DOCTYPE [^>]+>/i,fo=/^<!\--/,po=/^<!\[/,vo=!1;"x".replace(/x(.)?/g,function(e,t){vo=""===t});var ho=s("script,style,textarea",!0),mo={},yo={"<":"<",">":">",""":'"',"&":"&"," ":"\n","	":"\t"},go=/&(?:lt|gt|quot|amp);/g,_o=/&(?:lt|gt|quot|amp|#10|#9);/g,bo=s("pre,textarea",!0),$o=function(e,t){return e&&bo(e)&&"\n"===t[0]};var wo,Co,xo,ko,Ao,Oo,So,To,Eo=/^@|^v-on:/,jo=/^v-|^@|^:/,No=/([^]*?)\s+(?:in|of)\s+([^]*)/,Lo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Io=/^\(|\)$/g,Mo=/:(.*)$/,Do=/^:|^v-bind:/,Po=/\.[^.]+/g,Fo=e(eo);function Ro(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:function(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n].name]=e[n].value;return t}(t),parent:n,children:[]}}function Ho(e,p){wo=p.warn||$r,Oo=p.isPreTag||O,So=p.mustUseProp||O,To=p.getTagNamespace||O,xo=wr(p.modules,"transformNode"),ko=wr(p.modules,"preTransformNode"),Ao=wr(p.modules,"postTransformNode"),Co=p.delimiters;var d,v,h=[],i=!1!==p.preserveWhitespace,m=!1,y=!1;function g(e){e.pre&&(m=!1),Oo(e.tag)&&(y=!1);for(var t=0;t<Ao.length;t++)Ao[t](e,p)}return function(i,d){for(var e,v,h=[],m=d.expectHTML,y=d.isUnaryTag||O,g=d.canBeLeftOpenTag||O,a=0;i;){if(e=i,v&&ho(v)){var r=0,o=v.toLowerCase(),t=mo[o]||(mo[o]=new RegExp("([\\s\\S]*?)(</"+o+"[^>]*>)","i")),n=i.replace(t,function(e,t,n){return r=n.length,ho(o)||"noscript"===o||(t=t.replace(/<!\--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),$o(o,t)&&(t=t.slice(1)),d.chars&&d.chars(t),""});a+=i.length-n.length,i=n,A(o,a-r,a)}else{var s=i.indexOf("<");if(0===s){if(fo.test(i)){var c=i.indexOf("--\x3e");if(0<=c){d.shouldKeepComment&&d.comment(i.substring(4,c)),C(c+3);continue}}if(po.test(i)){var l=i.indexOf("]>");if(0<=l){C(l+2);continue}}var u=i.match(uo);if(u){C(u[0].length);continue}var f=i.match(lo);if(f){var p=a;C(f[0].length),A(f[1],p,a);continue}var _=x();if(_){k(_),$o(v,i)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(0<=s){for($=i.slice(s);!(lo.test($)||so.test($)||fo.test($)||po.test($)||(w=$.indexOf("<",1))<0);)s+=w,$=i.slice(s);b=i.substring(0,s),C(s)}s<0&&(b=i,i=""),d.chars&&b&&d.chars(b)}if(i===e){d.chars&&d.chars(i);break}}function C(e){a+=e,i=i.substring(e)}function x(){var e=i.match(so);if(e){var t,n,r={tagName:e[1],attrs:[],start:a};for(C(e[0].length);!(t=i.match(co))&&(n=i.match(io));)C(n[0].length),r.attrs.push(n);if(t)return r.unarySlash=t[1],C(t[0].length),r.end=a,r}}function k(e){var t=e.tagName,n=e.unarySlash;m&&("p"===v&&ro(t)&&A(v),g(t)&&v===t&&A(t));for(var r,i,o,a=y(t)||!!n,s=e.attrs.length,c=new Array(s),l=0;l<s;l++){var u=e.attrs[l];vo&&-1===u[0].indexOf('""')&&(""===u[3]&&delete u[3],""===u[4]&&delete u[4],""===u[5]&&delete u[5]);var f=u[3]||u[4]||u[5]||"",p="a"===t&&"href"===u[1]?d.shouldDecodeNewlinesForHref:d.shouldDecodeNewlines;c[l]={name:u[1],value:(r=f,i=p,o=i?_o:go,r.replace(o,function(e){return yo[e]}))}}a||(h.push({tag:t,lowerCasedTag:t.toLowerCase(),attrs:c}),v=t),d.start&&d.start(t,c,a,e.start,e.end)}function A(e,t,n){var r,i;if(null==t&&(t=a),null==n&&(n=a),e&&(i=e.toLowerCase()),e)for(r=h.length-1;0<=r&&h[r].lowerCasedTag!==i;r--);else r=0;if(0<=r){for(var o=h.length-1;r<=o;o--)d.end&&d.end(h[o].tag,t,n);h.length=r,v=r&&h[r-1].tag}else"br"===i?d.start&&d.start(e,[],!0,t,n):"p"===i&&(d.start&&d.start(e,[],!1,t,n),d.end&&d.end(e,t,n))}A()}(e,{warn:wo,expectHTML:p.expectHTML,isUnaryTag:p.isUnaryTag,canBeLeftOpenTag:p.canBeLeftOpenTag,shouldDecodeNewlines:p.shouldDecodeNewlines,shouldDecodeNewlinesForHref:p.shouldDecodeNewlinesForHref,shouldKeepComment:p.comments,start:function(e,t,n){var r=v&&v.ns||To(e);K&&"svg"===r&&(t=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];Ko.test(r.name)||(r.name=r.name.replace(Jo,""),t.push(r))}return t}(t));var i,o,a,s,c,l=Ro(e,t,v);r&&(l.ns=r),"style"!==(i=l).tag&&("script"!==i.tag||i.attrsMap.type&&"text/javascript"!==i.attrsMap.type)||Y()||(l.forbidden=!0);for(var u=0;u<ko.length;u++)l=ko[u](l,p)||l;if(m||(null!=Sr(o=l,"v-pre")&&(o.pre=!0),l.pre&&(m=!0)),Oo(l.tag)&&(y=!0),m?function(e){var t=e.attrsList.length;if(t)for(var n=e.attrs=new Array(t),r=0;r<t;r++)n[r]={name:e.attrsList[r].name,value:JSON.stringify(e.attrsList[r].value)};else e.pre||(e.plain=!0)}(l):l.processed||(Uo(l),function(e){var t=Sr(e,"v-if");if(t)e.if=t,Vo(e,{exp:t,block:e});else{null!=Sr(e,"v-else")&&(e.else=!0);var n=Sr(e,"v-else-if");n&&(e.elseif=n)}}(l),null!=Sr(a=l,"v-once")&&(a.once=!0),Bo(l,p)),d?h.length||d.if&&(l.elseif||l.else)&&Vo(d,{exp:l.elseif,block:l}):d=l,v&&!l.forbidden)if(l.elseif||l.else)s=l,(c=function(e){var t=e.length;for(;t--;){if(1===e[t].type)return e[t];e.pop()}}(v.children))&&c.if&&Vo(c,{exp:s.elseif,block:s});else if(l.slotScope){v.plain=!1;var f=l.slotTarget||'"default"';(v.scopedSlots||(v.scopedSlots={}))[f]=l}else v.children.push(l),l.parent=v;n?g(l):(v=l,h.push(l))},end:function(){var e=h[h.length-1],t=e.children[e.children.length-1];t&&3===t.type&&" "===t.text&&!y&&e.children.pop(),h.length-=1,v=h[h.length-1],g(e)},chars:function(e){if(v&&(!K||"textarea"!==v.tag||v.attrsMap.placeholder!==e)){var t,n,r=v.children;if(e=y||e.trim()?"script"===(t=v).tag||"style"===t.tag?e:Fo(e):i&&r.length?" ":"")!m&&" "!==e&&(n=function(e,t){var n=t?Zi(t):Wi;if(n.test(e)){for(var r,i,o,a=[],s=[],c=n.lastIndex=0;r=n.exec(e);){c<(i=r.index)&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var l=_r(r[1].trim());a.push("_s("+l+")"),s.push({"@binding":l}),c=i+r[0].length}return c<e.length&&(s.push(o=e.slice(c)),a.push(JSON.stringify(o))),{expression:a.join("+"),tokens:s}}}(e,Co))?r.push({type:2,expression:n.expression,tokens:n.tokens,text:e}):" "===e&&r.length&&" "===r[r.length-1].text||r.push({type:3,text:e})}},comment:function(e){v.children.push({type:3,text:e,isComment:!0})}}),d}function Bo(e,t){var n,r,i,o;(r=Or(n=e,"key"))&&(n.key=r),e.plain=!e.key&&!e.attrsList.length,(o=Or(i=e,"ref"))&&(i.ref=o,i.refInFor=function(e){for(var t=e;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}(i)),function(e){if("slot"===e.tag)e.slotName=Or(e,"name");else{var t;"template"===e.tag?(t=Sr(e,"scope"),e.slotScope=t||Sr(e,"slot-scope")):(t=Sr(e,"slot-scope"))&&(e.slotScope=t);var n=Or(e,"slot");n&&(e.slotTarget='""'===n?'"default"':n,"template"===e.tag||e.slotScope||xr(e,"slot",n))}}(e),function(e){var t;(t=Or(e,"is"))&&(e.component=t);null!=Sr(e,"inline-template")&&(e.inlineTemplate=!0)}(e);for(var a=0;a<xo.length;a++)e=xo[a](e,t)||e;!function(e){var t,n,r,i,o,a,s,c=e.attrsList;for(t=0,n=c.length;t<n;t++)if(r=i=c[t].name,o=c[t].value,jo.test(r))if(e.hasBindings=!0,(a=zo(r))&&(r=r.replace(Po,"")),Do.test(r))r=r.replace(Do,""),o=_r(o),s=!1,a&&(a.prop&&(s=!0,"innerHtml"===(r=g(r))&&(r="innerHTML")),a.camel&&(r=g(r)),a.sync&&Ar(e,"update:"+g(r),Er(o,"$event"))),s||!e.component&&So(e.tag,e.attrsMap.type,r)?Cr(e,r,o):xr(e,r,o);else if(Eo.test(r))r=r.replace(Eo,""),Ar(e,r,o,a,!1);else{var l=(r=r.replace(jo,"")).match(Mo),u=l&&l[1];u&&(r=r.slice(0,-(u.length+1))),p=r,d=i,v=o,h=u,m=a,((f=e).directives||(f.directives=[])).push({name:p,rawName:d,value:v,arg:h,modifiers:m}),f.plain=!1}else xr(e,r,JSON.stringify(o)),!e.component&&"muted"===r&&So(e.tag,e.attrsMap.type,r)&&Cr(e,r,"true");var f,p,d,v,h,m}(e)}function Uo(e){var t;if(t=Sr(e,"v-for")){var n=function(e){var t=e.match(No);if(!t)return;var n={};n.for=t[2].trim();var r=t[1].trim().replace(Io,""),i=r.match(Lo);i?(n.alias=r.replace(Lo,""),n.iterator1=i[1].trim(),i[2]&&(n.iterator2=i[2].trim())):n.alias=r;return n}(t);n&&m(e,n)}}function Vo(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function zo(e){var t=e.match(Po);if(t){var n={};return t.forEach(function(e){n[e.slice(1)]=!0}),n}}var Ko=/^xmlns:NS\d+/,Jo=/^NS\d+:/;function qo(e){return Ro(e.tag,e.attrsList.slice(),e.parent)}var Wo=[Xi,Qi,{preTransformNode:function(e,t){if("input"===e.tag){var n,r=e.attrsMap;if(!r["v-model"])return;if((r[":type"]||r["v-bind:type"])&&(n=Or(e,"type")),r.type||n||!r["v-bind"]||(n="("+r["v-bind"]+").type"),n){var i=Sr(e,"v-if",!0),o=i?"&&("+i+")":"",a=null!=Sr(e,"v-else",!0),s=Sr(e,"v-else-if",!0),c=qo(e);Uo(c),kr(c,"type","checkbox"),Bo(c,t),c.processed=!0,c.if="("+n+")==='checkbox'"+o,Vo(c,{exp:c.if,block:c});var l=qo(e);Sr(l,"v-for",!0),kr(l,"type","radio"),Bo(l,t),Vo(c,{exp:"("+n+")==='radio'"+o,block:l});var u=qo(e);return Sr(u,"v-for",!0),kr(u,":type",n),Bo(u,t),Vo(c,{exp:i,block:u}),a?c.else=!0:s&&(c.elseif=s),c}}}}];var Go,Zo,Xo,Yo={expectHTML:!0,modules:Wo,directives:{model:function(e,t,n){var r,i,o,a,s,c,l,u,f,p,d,v,h,m,y,g,_=t.value,b=t.modifiers,$=e.tag,w=e.attrsMap.type;if(e.component)return Tr(e,_,b),!1;if("select"===$)h=e,m=_,g=(g='var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+((y=b)&&y.number?"_n(val)":"val")+"});")+" "+Er(m,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),Ar(h,"change",g,null,!0);else if("input"===$&&"checkbox"===w)c=e,l=_,f=(u=b)&&u.number,p=Or(c,"value")||"null",d=Or(c,"true-value")||"true",v=Or(c,"false-value")||"false",Cr(c,"checked","Array.isArray("+l+")?_i("+l+","+p+")>-1"+("true"===d?":("+l+")":":_q("+l+","+d+")")),Ar(c,"change","var $$a="+l+",$$el=$event.target,$$c=$$el.checked?("+d+"):("+v+");if(Array.isArray($$a)){var $$v="+(f?"_n("+p+")":p)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Er(l,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Er(l,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Er(l,"$$c")+"}",null,!0);else if("input"===$&&"radio"===w)r=e,i=_,a=(o=b)&&o.number,s=Or(r,"value")||"null",Cr(r,"checked","_q("+i+","+(s=a?"_n("+s+")":s)+")"),Ar(r,"change",Er(i,s),null,!0);else if("input"===$||"textarea"===$)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,l=o?"change":"range"===r?Pr:"input",u="$event.target.value";s&&(u="$event.target.value.trim()"),a&&(u="_n("+u+")");var f=Er(t,u);c&&(f="if($event.target.composing)return;"+f),Cr(e,"value","("+t+")"),Ar(e,l,f,null,!0),(s||a)&&Ar(e,"blur","$forceUpdate()")}(e,_,b);else if(!j.isReservedTag($))return Tr(e,_,b),!1;return!0},text:function(e,t){t.value&&Cr(e,"textContent","_s("+t.value+")")},html:function(e,t){t.value&&Cr(e,"innerHTML","_s("+t.value+")")}},isPreTag:function(e){return"pre"===e},isUnaryTag:to,mustUseProp:Sn,canBeLeftOpenTag:no,isReservedTag:Un,getTagNamespace:Vn,staticKeys:(Go=Wo,Go.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(","))},Qo=e(function(e){return s("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(e?","+e:""))});function ea(e,t){e&&(Zo=Qo(t.staticKeys||""),Xo=t.isReservedTag||O,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||c(e.tag)||!Xo(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(Zo)))}(t);if(1===t.type){if(!Xo(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n<r;n++){var i=t.children[n];e(i),i.static||(t.static=!1)}if(t.ifConditions)for(var o=1,a=t.ifConditions.length;o<a;o++){var s=t.ifConditions[o].block;e(s),s.static||(t.static=!1)}}}(e),function e(t,n){if(1===t.type){if((t.static||t.once)&&(t.staticInFor=n),t.static&&t.children.length&&(1!==t.children.length||3!==t.children[0].type))return void(t.staticRoot=!0);if(t.staticRoot=!1,t.children)for(var r=0,i=t.children.length;r<i;r++)e(t.children[r],n||!!t.for);if(t.ifConditions)for(var o=1,a=t.ifConditions.length;o<a;o++)e(t.ifConditions[o].block,n)}}(e,!1))}var ta=/^([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/,na=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,ra={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ia={esc:"Escape",tab:"Tab",enter:"Enter",space:" ",up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete"]},oa=function(e){return"if("+e+")return null;"},aa={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:oa("$event.target !== $event.currentTarget"),ctrl:oa("!$event.ctrlKey"),shift:oa("!$event.shiftKey"),alt:oa("!$event.altKey"),meta:oa("!$event.metaKey"),left:oa("'button' in $event && $event.button !== 0"),middle:oa("'button' in $event && $event.button !== 1"),right:oa("'button' in $event && $event.button !== 2")};function sa(e,t,n){var r=t?"nativeOn:{":"on:{";for(var i in e)r+='"'+i+'":'+ca(i,e[i])+",";return r.slice(0,-1)+"}"}function ca(t,e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return ca(t,e)}).join(",")+"]";var n=na.test(e.value),r=ta.test(e.value);if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(aa[s])o+=aa[s],ra[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=oa(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+="if(!('button' in $event)&&"+a.map(la).join("&&")+")return null;"),o&&(i+=o),"function($event){"+i+(n?"return "+e.value+"($event)":r?"return ("+e.value+")($event)":e.value)+"}"}return n||r?e.value:"function($event){"+e.value+"}"}function la(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=ra[e],r=ia[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var ua={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(t,n){t.wrapData=function(e){return"_b("+e+",'"+t.tag+"',"+n.value+","+(n.modifiers&&n.modifiers.prop?"true":"false")+(n.modifiers&&n.modifiers.sync?",true":"")+")"}},cloak:$},fa=function(e){this.options=e,this.warn=e.warn||$r,this.transforms=wr(e.modules,"transformCode"),this.dataGenFns=wr(e.modules,"genData"),this.directives=m(m({},ua),e.directives);var t=e.isReservedTag||O;this.maybeComponent=function(e){return!t(e.tag)},this.onceId=0,this.staticRenderFns=[]};function pa(e,t){var n=new fa(t);return{render:"with(this){return "+(e?da(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function da(e,t){if(e.staticRoot&&!e.staticProcessed)return va(e,t);if(e.once&&!e.onceProcessed)return ha(e,t);if(e.for&&!e.forProcessed)return f=t,v=(u=e).for,h=u.alias,m=u.iterator1?","+u.iterator1:"",y=u.iterator2?","+u.iterator2:"",u.forProcessed=!0,(d||"_l")+"(("+v+"),function("+h+m+y+"){return "+(p||da)(u,f)+"})";if(e.if&&!e.ifProcessed)return ma(e,t);if("template"!==e.tag||e.slotTarget){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=_a(e,t),i="_t("+n+(r?","+r:""),o=e.attrs&&"{"+e.attrs.map(function(e){return g(e.name)+":"+e.value}).join(",")+"}",a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)a=e.component,c=t,l=(s=e).inlineTemplate?null:_a(s,c,!0),n="_c("+a+","+ya(s,c)+(l?","+l:"")+")";else{var r=e.plain?void 0:ya(e,t),i=e.inlineTemplate?null:_a(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o<t.transforms.length;o++)n=t.transforms[o](e,n);return n}return _a(e,t)||"void 0";var a,s,c,l,u,f,p,d,v,h,m,y}function va(e,t){return e.staticProcessed=!0,t.staticRenderFns.push("with(this){return "+da(e,t)+"}"),"_m("+(t.staticRenderFns.length-1)+(e.staticInFor?",true":"")+")"}function ha(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return ma(e,t);if(e.staticInFor){for(var n="",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+da(e,t)+","+t.onceId+++","+n+")":da(e,t)}return va(e,t)}function ma(e,t,n,r){return e.ifProcessed=!0,function e(t,n,r,i){if(!t.length)return i||"_e()";var o=t.shift();return o.exp?"("+o.exp+")?"+a(o.block)+":"+e(t,n,r,i):""+a(o.block);function a(e){return r?r(e,n):e.once?ha(e,n):da(e,n)}}(e.ifConditions.slice(),t,n,r)}function ya(e,t){var n,r,i="{",o=function(e,t){var n=e.directives;if(!n)return;var r,i,o,a,s="directives:[",c=!1;for(r=0,i=n.length;r<i;r++){o=n[r],a=!0;var l=t.directives[o.name];l&&(a=!!l(e,o,t.warn)),a&&(c=!0,s+='{name:"'+o.name+'",rawName:"'+o.rawName+'"'+(o.value?",value:("+o.value+"),expression:"+JSON.stringify(o.value):"")+(o.arg?',arg:"'+o.arg+'"':"")+(o.modifiers?",modifiers:"+JSON.stringify(o.modifiers):"")+"},")}if(c)return s.slice(0,-1)+"]"}(e,t);o&&(i+=o+","),e.key&&(i+="key:"+e.key+","),e.ref&&(i+="ref:"+e.ref+","),e.refInFor&&(i+="refInFor:true,"),e.pre&&(i+="pre:true,"),e.component&&(i+='tag:"'+e.tag+'",');for(var a=0;a<t.dataGenFns.length;a++)i+=t.dataGenFns[a](e);if(e.attrs&&(i+="attrs:{"+wa(e.attrs)+"},"),e.props&&(i+="domProps:{"+wa(e.props)+"},"),e.events&&(i+=sa(e.events,!1,t.warn)+","),e.nativeEvents&&(i+=sa(e.nativeEvents,!0,t.warn)+","),e.slotTarget&&!e.slotScope&&(i+="slot:"+e.slotTarget+","),e.scopedSlots&&(i+=(n=e.scopedSlots,r=t,"scopedSlots:_u(["+Object.keys(n).map(function(e){return ga(e,n[e],r)}).join(",")+"]),")),e.model&&(i+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var s=function(e,t){var n=e.children[0];if(1===n.type){var r=pa(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(e){return"function(){"+e+"}"}).join(",")+"]}"}}(e,t);s&&(i+=s+",")}return i=i.replace(/,$/,"")+"}",e.wrapData&&(i=e.wrapData(i)),e.wrapListeners&&(i=e.wrapListeners(i)),i}function ga(e,t,n){return t.for&&!t.forProcessed?(r=e,o=n,a=(i=t).for,s=i.alias,c=i.iterator1?","+i.iterator1:"",l=i.iterator2?","+i.iterator2:"",i.forProcessed=!0,"_l(("+a+"),function("+s+c+l+"){return "+ga(r,i,o)+"})"):"{key:"+e+",fn:"+("function("+String(t.slotScope)+"){return "+("template"===t.tag?t.if?t.if+"?"+(_a(t,n)||"undefined")+":undefined":_a(t,n)||"undefined":da(t,n))+"}")+"}";var r,i,o,a,s,c,l}function _a(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag)return(r||da)(a,t);var s=n?function(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(1===i.type){if(ba(i)||i.ifConditions&&i.ifConditions.some(function(e){return ba(e.block)})){n=2;break}(t(i)||i.ifConditions&&i.ifConditions.some(function(e){return t(e.block)}))&&(n=1)}}return n}(o,t.maybeComponent):0,c=i||$a;return"["+o.map(function(e){return c(e,t)}).join(",")+"]"+(s?","+s:"")}}function ba(e){return void 0!==e.for||"template"===e.tag||"slot"===e.tag}function $a(e,t){return 1===e.type?da(e,t):3===e.type&&e.isComment?(r=e,"_e("+JSON.stringify(r.text)+")"):"_v("+(2===(n=e).type?n.expression:Ca(JSON.stringify(n.text)))+")";var n,r}function wa(e){for(var t="",n=0;n<e.length;n++){var r=e[n];t+='"'+r.name+'":'+Ca(r.value)+","}return t.slice(0,-1)}function Ca(e){return e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b"),new RegExp("\\b"+"delete,typeof,void".split(",").join("\\s*\\([^\\)]*\\)|\\b")+"\\s*\\([^\\)]*\\)");function xa(t,n){try{return new Function(t)}catch(e){return n.push({err:e,code:t}),$}}var ka,Aa,Oa=(ka=function(e,t){var n=Ho(e.trim(),t);!1!==t.optimize&&ea(n,t);var r=pa(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}},function(s){function e(e,t){var n=Object.create(s),r=[],i=[];if(n.warn=function(e,t){(t?i:r).push(e)},t)for(var o in t.modules&&(n.modules=(s.modules||[]).concat(t.modules)),t.directives&&(n.directives=m(Object.create(s.directives||null),t.directives)),t)"modules"!==o&&"directives"!==o&&(n[o]=t[o]);var a=ka(e,n);return a.errors=r,a.tips=i,a}return{compile:e,compileToFunctions:(c=e,l=Object.create(null),function(e,t,n){(t=m({},t)).warn,delete t.warn;var r=t.delimiters?String(t.delimiters)+e:e;if(l[r])return l[r];var i=c(e,t),o={},a=[];return o.render=xa(i.render,a),o.staticRenderFns=i.staticRenderFns.map(function(e){return xa(e,a)}),l[r]=o})};var c,l})(Yo).compileToFunctions;function Sa(e){return(Aa=Aa||document.createElement("div")).innerHTML=e?'<a href="\n"/>':'<div a="\n"/>',0<Aa.innerHTML.indexOf(" ")}var Ta=!!B&&Sa(!1),Ea=!!B&&Sa(!0),ja=e(function(e){var t=Jn(e);return t&&t.innerHTML}),Na=hn.prototype.$mount;return hn.prototype.$mount=function(e,t){if((e=e&&Jn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ja(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){{if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}}(e));if(r){var i=Oa(r,{shouldDecodeNewlines:Ta,shouldDecodeNewlinesForHref:Ea,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Na.call(this,e,t)},hn.compile=Oa,hn});
|
1 |
/*!
|
2 |
+
* Vue.js v2.6.10
|
3 |
+
* (c) 2014-2019 Evan You
|
4 |
* Released under the MIT License.
|
5 |
*/
|
6 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Vue=t()}(this,function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return n(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function l(e){return null==e?"":Array.isArray(e)||s(e)&&e.toString===a?JSON.stringify(e,null,2):String(e)}function f(e){var t=parseFloat(e);return isNaN(t)?e:t}function p(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var d=p("slot,component",!0),v=p("key,ref,slot,slot-scope,is");function h(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}var m=Object.prototype.hasOwnProperty;function y(e,t){return m.call(e,t)}function g(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var _=/-(\w)/g,b=g(function(e){return e.replace(_,function(e,t){return t?t.toUpperCase():""})}),$=g(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),w=/\B([A-Z])/g,C=g(function(e){return e.replace(w,"-$1").toLowerCase()});var x=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function k(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function A(e,t){for(var n in t)e[n]=t[n];return e}function O(e){for(var t={},n=0;n<e.length;n++)e[n]&&A(t,e[n]);return t}function S(e,t,n){}var T=function(e,t,n){return!1},E=function(e){return e};function N(e,t){if(e===t)return!0;var n=o(e),r=o(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var i=Array.isArray(e),a=Array.isArray(t);if(i&&a)return e.length===t.length&&e.every(function(e,n){return N(e,t[n])});if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(i||a)return!1;var s=Object.keys(e),c=Object.keys(t);return s.length===c.length&&s.every(function(n){return N(e[n],t[n])})}catch(e){return!1}}function j(e,t){for(var n=0;n<e.length;n++)if(N(e[n],t))return n;return-1}function D(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}var L="data-server-rendered",M=["component","directive","filter"],I=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch"],F={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:T,isReservedAttr:T,isUnknownElement:T,getTagNamespace:S,parsePlatformTagName:E,mustUseProp:T,async:!0,_lifecycleHooks:I},P=/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/;function R(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var H=new RegExp("[^"+P.source+".$_\\d]");var B,U="__proto__"in{},z="undefined"!=typeof window,V="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,K=V&&WXEnvironment.platform.toLowerCase(),J=z&&window.navigator.userAgent.toLowerCase(),q=J&&/msie|trident/.test(J),W=J&&J.indexOf("msie 9.0")>0,Z=J&&J.indexOf("edge/")>0,G=(J&&J.indexOf("android"),J&&/iphone|ipad|ipod|ios/.test(J)||"ios"===K),X=(J&&/chrome\/\d+/.test(J),J&&/phantomjs/.test(J),J&&J.match(/firefox\/(\d+)/)),Y={}.watch,Q=!1;if(z)try{var ee={};Object.defineProperty(ee,"passive",{get:function(){Q=!0}}),window.addEventListener("test-passive",null,ee)}catch(e){}var te=function(){return void 0===B&&(B=!z&&!V&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),B},ne=z&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function re(e){return"function"==typeof e&&/native code/.test(e.toString())}var ie,oe="undefined"!=typeof Symbol&&re(Symbol)&&"undefined"!=typeof Reflect&&re(Reflect.ownKeys);ie="undefined"!=typeof Set&&re(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ae=S,se=0,ce=function(){this.id=se++,this.subs=[]};ce.prototype.addSub=function(e){this.subs.push(e)},ce.prototype.removeSub=function(e){h(this.subs,e)},ce.prototype.depend=function(){ce.target&&ce.target.addDep(this)},ce.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t<n;t++)e[t].update()},ce.target=null;var ue=[];function le(e){ue.push(e),ce.target=e}function fe(){ue.pop(),ce.target=ue[ue.length-1]}var pe=function(e,t,n,r,i,o,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},de={child:{configurable:!0}};de.child.get=function(){return this.componentInstance},Object.defineProperties(pe.prototype,de);var ve=function(e){void 0===e&&(e="");var t=new pe;return t.text=e,t.isComment=!0,t};function he(e){return new pe(void 0,void 0,void 0,String(e))}function me(e){var t=new pe(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var ye=Array.prototype,ge=Object.create(ye);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(e){var t=ye[e];R(ge,e,function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var i,o=t.apply(this,n),a=this.__ob__;switch(e){case"push":case"unshift":i=n;break;case"splice":i=n.slice(2)}return i&&a.observeArray(i),a.dep.notify(),o})});var _e=Object.getOwnPropertyNames(ge),be=!0;function $e(e){be=e}var we=function(e){var t;this.value=e,this.dep=new ce,this.vmCount=0,R(e,"__ob__",this),Array.isArray(e)?(U?(t=ge,e.__proto__=t):function(e,t,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];R(e,o,t[o])}}(e,ge,_e),this.observeArray(e)):this.walk(e)};function Ce(e,t){var n;if(o(e)&&!(e instanceof pe))return y(e,"__ob__")&&e.__ob__ instanceof we?n=e.__ob__:be&&!te()&&(Array.isArray(e)||s(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new we(e)),t&&n&&n.vmCount++,n}function xe(e,t,n,r,i){var o=new ce,a=Object.getOwnPropertyDescriptor(e,t);if(!a||!1!==a.configurable){var s=a&&a.get,c=a&&a.set;s&&!c||2!==arguments.length||(n=e[t]);var u=!i&&Ce(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=s?s.call(e):n;return ce.target&&(o.depend(),u&&(u.dep.depend(),Array.isArray(t)&&function e(t){for(var n=void 0,r=0,i=t.length;r<i;r++)(n=t[r])&&n.__ob__&&n.__ob__.dep.depend(),Array.isArray(n)&&e(n)}(t))),t},set:function(t){var r=s?s.call(e):n;t===r||t!=t&&r!=r||s&&!c||(c?c.call(e,t):n=t,u=!i&&Ce(t),o.notify())}})}}function ke(e,t,n){if(Array.isArray(e)&&c(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var r=e.__ob__;return e._isVue||r&&r.vmCount?n:r?(xe(r.value,t,n),r.dep.notify(),n):(e[t]=n,n)}function Ae(e,t){if(Array.isArray(e)&&c(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount||y(e,t)&&(delete e[t],n&&n.dep.notify())}}we.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)xe(e,t[n])},we.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)Ce(e[t])};var Oe=F.optionMergeStrategies;function Se(e,t){if(!t)return e;for(var n,r,i,o=oe?Reflect.ownKeys(t):Object.keys(t),a=0;a<o.length;a++)"__ob__"!==(n=o[a])&&(r=e[n],i=t[n],y(e,n)?r!==i&&s(r)&&s(i)&&Se(r,i):ke(e,n,i));return e}function Te(e,t,n){return n?function(){var r="function"==typeof t?t.call(n,n):t,i="function"==typeof e?e.call(n,n):e;return r?Se(r,i):i}:t?e?function(){return Se("function"==typeof t?t.call(this,this):t,"function"==typeof e?e.call(this,this):e)}:t:e}function Ee(e,t){var n=t?e?e.concat(t):Array.isArray(t)?t:[t]:e;return n?function(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(n):n}function Ne(e,t,n,r){var i=Object.create(e||null);return t?A(i,t):i}Oe.data=function(e,t,n){return n?Te(e,t,n):t&&"function"!=typeof t?e:Te(e,t)},I.forEach(function(e){Oe[e]=Ee}),M.forEach(function(e){Oe[e+"s"]=Ne}),Oe.watch=function(e,t,n,r){if(e===Y&&(e=void 0),t===Y&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var i={};for(var o in A(i,e),t){var a=i[o],s=t[o];a&&!Array.isArray(a)&&(a=[a]),i[o]=a?a.concat(s):Array.isArray(s)?s:[s]}return i},Oe.props=Oe.methods=Oe.inject=Oe.computed=function(e,t,n,r){if(!e)return t;var i=Object.create(null);return A(i,e),t&&A(i,t),i},Oe.provide=Te;var je=function(e,t){return void 0===t?e:t};function De(e,t,n){if("function"==typeof t&&(t=t.options),function(e,t){var n=e.props;if(n){var r,i,o={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(i=n[r])&&(o[b(i)]={type:null});else if(s(n))for(var a in n)i=n[a],o[b(a)]=s(i)?i:{type:i};e.props=o}}(t),function(e,t){var n=e.inject;if(n){var r=e.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(s(n))for(var o in n){var a=n[o];r[o]=s(a)?A({from:o},a):{from:a}}}}(t),function(e){var t=e.directives;if(t)for(var n in t){var r=t[n];"function"==typeof r&&(t[n]={bind:r,update:r})}}(t),!t._base&&(t.extends&&(e=De(e,t.extends,n)),t.mixins))for(var r=0,i=t.mixins.length;r<i;r++)e=De(e,t.mixins[r],n);var o,a={};for(o in e)c(o);for(o in t)y(e,o)||c(o);function c(r){var i=Oe[r]||je;a[r]=i(e[r],t[r],n,r)}return a}function Le(e,t,n,r){if("string"==typeof n){var i=e[t];if(y(i,n))return i[n];var o=b(n);if(y(i,o))return i[o];var a=$(o);return y(i,a)?i[a]:i[n]||i[o]||i[a]}}function Me(e,t,n,r){var i=t[e],o=!y(n,e),a=n[e],s=Pe(Boolean,i.type);if(s>-1)if(o&&!y(i,"default"))a=!1;else if(""===a||a===C(e)){var c=Pe(String,i.type);(c<0||s<c)&&(a=!0)}if(void 0===a){a=function(e,t,n){if(!y(t,"default"))return;var r=t.default;if(e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n])return e._props[n];return"function"==typeof r&&"Function"!==Ie(t.type)?r.call(e):r}(r,i,e);var u=be;$e(!0),Ce(a),$e(u)}return a}function Ie(e){var t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function Fe(e,t){return Ie(e)===Ie(t)}function Pe(e,t){if(!Array.isArray(t))return Fe(t,e)?0:-1;for(var n=0,r=t.length;n<r;n++)if(Fe(t[n],e))return n;return-1}function Re(e,t,n){le();try{if(t)for(var r=t;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{if(!1===i[o].call(r,e,t,n))return}catch(e){Be(e,r,"errorCaptured hook")}}Be(e,t,n)}finally{fe()}}function He(e,t,n,r,i){var o;try{(o=n?e.apply(t,n):e.call(t))&&!o._isVue&&u(o)&&!o._handled&&(o.catch(function(e){return Re(e,r,i+" (Promise/async)")}),o._handled=!0)}catch(e){Re(e,r,i)}return o}function Be(e,t,n){if(F.errorHandler)try{return F.errorHandler.call(null,e,t,n)}catch(t){t!==e&&Ue(t,null,"config.errorHandler")}Ue(e,t,n)}function Ue(e,t,n){if(!z&&!V||"undefined"==typeof console)throw e;console.error(e)}var ze,Ve=!1,Ke=[],Je=!1;function qe(){Je=!1;var e=Ke.slice(0);Ke.length=0;for(var t=0;t<e.length;t++)e[t]()}if("undefined"!=typeof Promise&&re(Promise)){var We=Promise.resolve();ze=function(){We.then(qe),G&&setTimeout(S)},Ve=!0}else if(q||"undefined"==typeof MutationObserver||!re(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())ze="undefined"!=typeof setImmediate&&re(setImmediate)?function(){setImmediate(qe)}:function(){setTimeout(qe,0)};else{var Ze=1,Ge=new MutationObserver(qe),Xe=document.createTextNode(String(Ze));Ge.observe(Xe,{characterData:!0}),ze=function(){Ze=(Ze+1)%2,Xe.data=String(Ze)},Ve=!0}function Ye(e,t){var n;if(Ke.push(function(){if(e)try{e.call(t)}catch(e){Re(e,t,"nextTick")}else n&&n(t)}),Je||(Je=!0,ze()),!e&&"undefined"!=typeof Promise)return new Promise(function(e){n=e})}var Qe=new ie;function et(e){!function e(t,n){var r,i;var a=Array.isArray(t);if(!a&&!o(t)||Object.isFrozen(t)||t instanceof pe)return;if(t.__ob__){var s=t.__ob__.dep.id;if(n.has(s))return;n.add(s)}if(a)for(r=t.length;r--;)e(t[r],n);else for(i=Object.keys(t),r=i.length;r--;)e(t[i[r]],n)}(e,Qe),Qe.clear()}var tt=g(function(e){var t="&"===e.charAt(0),n="~"===(e=t?e.slice(1):e).charAt(0),r="!"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}});function nt(e,t){function n(){var e=arguments,r=n.fns;if(!Array.isArray(r))return He(r,null,arguments,t,"v-on handler");for(var i=r.slice(),o=0;o<i.length;o++)He(i[o],null,e,t,"v-on handler")}return n.fns=e,n}function rt(e,n,i,o,a,s){var c,u,l,f;for(c in e)u=e[c],l=n[c],f=tt(c),t(u)||(t(l)?(t(u.fns)&&(u=e[c]=nt(u,s)),r(f.once)&&(u=e[c]=a(f.name,u,f.capture)),i(f.name,u,f.capture,f.passive,f.params)):u!==l&&(l.fns=u,e[c]=l));for(c in n)t(e[c])&&o((f=tt(c)).name,n[c],f.capture)}function it(e,i,o){var a;e instanceof pe&&(e=e.data.hook||(e.data.hook={}));var s=e[i];function c(){o.apply(this,arguments),h(a.fns,c)}t(s)?a=nt([c]):n(s.fns)&&r(s.merged)?(a=s).fns.push(c):a=nt([s,c]),a.merged=!0,e[i]=a}function ot(e,t,r,i,o){if(n(t)){if(y(t,r))return e[r]=t[r],o||delete t[r],!0;if(y(t,i))return e[r]=t[i],o||delete t[i],!0}return!1}function at(e){return i(e)?[he(e)]:Array.isArray(e)?function e(o,a){var s=[];var c,u,l,f;for(c=0;c<o.length;c++)t(u=o[c])||"boolean"==typeof u||(l=s.length-1,f=s[l],Array.isArray(u)?u.length>0&&(st((u=e(u,(a||"")+"_"+c))[0])&&st(f)&&(s[l]=he(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?st(f)?s[l]=he(f.text+u):""!==u&&s.push(he(u)):st(u)&&st(f)?s[l]=he(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function st(e){return n(e)&&n(e.text)&&!1===e.isComment}function ct(e,t){if(e){for(var n=Object.create(null),r=oe?Reflect.ownKeys(e):Object.keys(e),i=0;i<r.length;i++){var o=r[i];if("__ob__"!==o){for(var a=e[o].from,s=t;s;){if(s._provided&&y(s._provided,a)){n[o]=s._provided[a];break}s=s.$parent}if(!s&&"default"in e[o]){var c=e[o].default;n[o]="function"==typeof c?c.call(t):c}}}return n}}function ut(e,t){if(!e||!e.length)return{};for(var n={},r=0,i=e.length;r<i;r++){var o=e[r],a=o.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,o.context!==t&&o.fnContext!==t||!a||null==a.slot)(n.default||(n.default=[])).push(o);else{var s=a.slot,c=n[s]||(n[s]=[]);"template"===o.tag?c.push.apply(c,o.children||[]):c.push(o)}}for(var u in n)n[u].every(lt)&&delete n[u];return n}function lt(e){return e.isComment&&!e.asyncFactory||" "===e.text}function ft(t,n,r){var i,o=Object.keys(n).length>0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==e&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var c in i={},t)t[c]&&"$"!==c[0]&&(i[c]=pt(n,c,t[c]))}else i={};for(var u in n)u in i||(i[u]=dt(n,u));return t&&Object.isExtensible(t)&&(t._normalized=i),R(i,"$stable",a),R(i,"$key",s),R(i,"$hasNormal",o),i}function pt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:at(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function dt(e,t){return function(){return e[t]}}function vt(e,t){var r,i,a,s,c;if(Array.isArray(e)||"string"==typeof e)for(r=new Array(e.length),i=0,a=e.length;i<a;i++)r[i]=t(e[i],i);else if("number"==typeof e)for(r=new Array(e),i=0;i<e;i++)r[i]=t(i+1,i);else if(o(e))if(oe&&e[Symbol.iterator]){r=[];for(var u=e[Symbol.iterator](),l=u.next();!l.done;)r.push(t(l.value,r.length)),l=u.next()}else for(s=Object.keys(e),r=new Array(s.length),i=0,a=s.length;i<a;i++)c=s[i],r[i]=t(e[c],c,i);return n(r)||(r=[]),r._isVList=!0,r}function ht(e,t,n,r){var i,o=this.$scopedSlots[e];o?(n=n||{},r&&(n=A(A({},r),n)),i=o(n)||t):i=this.$slots[e]||t;var a=n&&n.slot;return a?this.$createElement("template",{slot:a},i):i}function mt(e){return Le(this.$options,"filters",e)||E}function yt(e,t){return Array.isArray(e)?-1===e.indexOf(t):e!==t}function gt(e,t,n,r,i){var o=F.keyCodes[t]||n;return i&&r&&!F.keyCodes[t]?yt(i,r):o?yt(o,e):r?C(r)!==t:void 0}function _t(e,t,n,r,i){if(n)if(o(n)){var a;Array.isArray(n)&&(n=O(n));var s=function(o){if("class"===o||"style"===o||v(o))a=e;else{var s=e.attrs&&e.attrs.type;a=r||F.mustUseProp(t,s,o)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}var c=b(o),u=C(o);c in a||u in a||(a[o]=n[o],i&&((e.on||(e.on={}))["update:"+o]=function(e){n[o]=e}))};for(var c in n)s(c)}else;return e}function bt(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t?r:(wt(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),"__static__"+e,!1),r)}function $t(e,t,n){return wt(e,"__once__"+t+(n?"_"+n:""),!0),e}function wt(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&"string"!=typeof e[r]&&Ct(e[r],t+"_"+r,n);else Ct(e,t,n)}function Ct(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function xt(e,t){if(t)if(s(t)){var n=e.on=e.on?A({},e.on):{};for(var r in t){var i=n[r],o=t[r];n[r]=i?[].concat(i,o):o}}else;return e}function kt(e,t,n,r){t=t||{$stable:!n};for(var i=0;i<e.length;i++){var o=e[i];Array.isArray(o)?kt(o,t,n):o&&(o.proxy&&(o.fn.proxy=!0),t[o.key]=o.fn)}return r&&(t.$key=r),t}function At(e,t){for(var n=0;n<t.length;n+=2){var r=t[n];"string"==typeof r&&r&&(e[t[n]]=t[n+1])}return e}function Ot(e,t){return"string"==typeof e?t+e:e}function St(e){e._o=$t,e._n=f,e._s=l,e._l=vt,e._t=ht,e._q=N,e._i=j,e._m=bt,e._f=mt,e._k=gt,e._b=_t,e._v=he,e._e=ve,e._u=kt,e._g=xt,e._d=At,e._p=Ot}function Tt(t,n,i,o,a){var s,c=this,u=a.options;y(o,"_uid")?(s=Object.create(o))._original=o:(s=o,o=o._original);var l=r(u._compiled),f=!l;this.data=t,this.props=n,this.children=i,this.parent=o,this.listeners=t.on||e,this.injections=ct(u.inject,o),this.slots=function(){return c.$slots||ft(t.scopedSlots,c.$slots=ut(i,o)),c.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return ft(t.scopedSlots,this.slots())}}),l&&(this.$options=u,this.$slots=this.slots(),this.$scopedSlots=ft(t.scopedSlots,this.$slots)),u._scopeId?this._c=function(e,t,n,r){var i=Pt(s,e,t,n,r,f);return i&&!Array.isArray(i)&&(i.fnScopeId=u._scopeId,i.fnContext=o),i}:this._c=function(e,t,n,r){return Pt(s,e,t,n,r,f)}}function Et(e,t,n,r,i){var o=me(e);return o.fnContext=n,o.fnOptions=r,t.slot&&((o.data||(o.data={})).slot=t.slot),o}function Nt(e,t){for(var n in t)e[b(n)]=t[n]}St(Tt.prototype);var jt={init:function(e,t){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var r=e;jt.prepatch(r,r)}else{(e.componentInstance=function(e,t){var r={_isComponent:!0,_parentVnode:e,parent:t},i=e.data.inlineTemplate;n(i)&&(r.render=i.render,r.staticRenderFns=i.staticRenderFns);return new e.componentOptions.Ctor(r)}(e,Wt)).$mount(t?e.elm:void 0,t)}},prepatch:function(t,n){var r=n.componentOptions;!function(t,n,r,i,o){var a=i.data.scopedSlots,s=t.$scopedSlots,c=!!(a&&!a.$stable||s!==e&&!s.$stable||a&&t.$scopedSlots.$key!==a.$key),u=!!(o||t.$options._renderChildren||c);t.$options._parentVnode=i,t.$vnode=i,t._vnode&&(t._vnode.parent=i);if(t.$options._renderChildren=o,t.$attrs=i.data.attrs||e,t.$listeners=r||e,n&&t.$options.props){$e(!1);for(var l=t._props,f=t.$options._propKeys||[],p=0;p<f.length;p++){var d=f[p],v=t.$options.props;l[d]=Me(d,v,n,t)}$e(!0),t.$options.propsData=n}r=r||e;var h=t.$options._parentListeners;t.$options._parentListeners=r,qt(t,r,h),u&&(t.$slots=ut(o,i.context),t.$forceUpdate())}(n.componentInstance=t.componentInstance,r.propsData,r.listeners,n,r.children)},insert:function(e){var t,n=e.context,r=e.componentInstance;r._isMounted||(r._isMounted=!0,Yt(r,"mounted")),e.data.keepAlive&&(n._isMounted?((t=r)._inactive=!1,en.push(t)):Xt(r,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?function e(t,n){if(n&&(t._directInactive=!0,Gt(t)))return;if(!t._inactive){t._inactive=!0;for(var r=0;r<t.$children.length;r++)e(t.$children[r]);Yt(t,"deactivated")}}(t,!0):t.$destroy())}},Dt=Object.keys(jt);function Lt(i,a,s,c,l){if(!t(i)){var f=s.$options._base;if(o(i)&&(i=f.extend(i)),"function"==typeof i){var p;if(t(i.cid)&&void 0===(i=function(e,i){if(r(e.error)&&n(e.errorComp))return e.errorComp;if(n(e.resolved))return e.resolved;var a=Ht;a&&n(e.owners)&&-1===e.owners.indexOf(a)&&e.owners.push(a);if(r(e.loading)&&n(e.loadingComp))return e.loadingComp;if(a&&!n(e.owners)){var s=e.owners=[a],c=!0,l=null,f=null;a.$on("hook:destroyed",function(){return h(s,a)});var p=function(e){for(var t=0,n=s.length;t<n;t++)s[t].$forceUpdate();e&&(s.length=0,null!==l&&(clearTimeout(l),l=null),null!==f&&(clearTimeout(f),f=null))},d=D(function(t){e.resolved=Bt(t,i),c?s.length=0:p(!0)}),v=D(function(t){n(e.errorComp)&&(e.error=!0,p(!0))}),m=e(d,v);return o(m)&&(u(m)?t(e.resolved)&&m.then(d,v):u(m.component)&&(m.component.then(d,v),n(m.error)&&(e.errorComp=Bt(m.error,i)),n(m.loading)&&(e.loadingComp=Bt(m.loading,i),0===m.delay?e.loading=!0:l=setTimeout(function(){l=null,t(e.resolved)&&t(e.error)&&(e.loading=!0,p(!1))},m.delay||200)),n(m.timeout)&&(f=setTimeout(function(){f=null,t(e.resolved)&&v(null)},m.timeout)))),c=!1,e.loading?e.loadingComp:e.resolved}}(p=i,f)))return function(e,t,n,r,i){var o=ve();return o.asyncFactory=e,o.asyncMeta={data:t,context:n,children:r,tag:i},o}(p,a,s,c,l);a=a||{},$n(i),n(a.model)&&function(e,t){var r=e.model&&e.model.prop||"value",i=e.model&&e.model.event||"input";(t.attrs||(t.attrs={}))[r]=t.model.value;var o=t.on||(t.on={}),a=o[i],s=t.model.callback;n(a)?(Array.isArray(a)?-1===a.indexOf(s):a!==s)&&(o[i]=[s].concat(a)):o[i]=s}(i.options,a);var d=function(e,r,i){var o=r.options.props;if(!t(o)){var a={},s=e.attrs,c=e.props;if(n(s)||n(c))for(var u in o){var l=C(u);ot(a,c,u,l,!0)||ot(a,s,u,l,!1)}return a}}(a,i);if(r(i.options.functional))return function(t,r,i,o,a){var s=t.options,c={},u=s.props;if(n(u))for(var l in u)c[l]=Me(l,u,r||e);else n(i.attrs)&&Nt(c,i.attrs),n(i.props)&&Nt(c,i.props);var f=new Tt(i,c,a,o,t),p=s.render.call(null,f._c,f);if(p instanceof pe)return Et(p,i,f.parent,s);if(Array.isArray(p)){for(var d=at(p)||[],v=new Array(d.length),h=0;h<d.length;h++)v[h]=Et(d[h],i,f.parent,s);return v}}(i,d,a,s,c);var v=a.on;if(a.on=a.nativeOn,r(i.options.abstract)){var m=a.slot;a={},m&&(a.slot=m)}!function(e){for(var t=e.hook||(e.hook={}),n=0;n<Dt.length;n++){var r=Dt[n],i=t[r],o=jt[r];i===o||i&&i._merged||(t[r]=i?Mt(o,i):o)}}(a);var y=i.options.name||l;return new pe("vue-component-"+i.cid+(y?"-"+y:""),a,void 0,void 0,void 0,s,{Ctor:i,propsData:d,listeners:v,tag:l,children:c},p)}}}function Mt(e,t){var n=function(n,r){e(n,r),t(n,r)};return n._merged=!0,n}var It=1,Ft=2;function Pt(e,a,s,c,u,l){return(Array.isArray(s)||i(s))&&(u=c,c=s,s=void 0),r(l)&&(u=Ft),function(e,i,a,s,c){if(n(a)&&n(a.__ob__))return ve();n(a)&&n(a.is)&&(i=a.is);if(!i)return ve();Array.isArray(s)&&"function"==typeof s[0]&&((a=a||{}).scopedSlots={default:s[0]},s.length=0);c===Ft?s=at(s):c===It&&(s=function(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}(s));var u,l;if("string"==typeof i){var f;l=e.$vnode&&e.$vnode.ns||F.getTagNamespace(i),u=F.isReservedTag(i)?new pe(F.parsePlatformTagName(i),a,s,void 0,void 0,e):a&&a.pre||!n(f=Le(e.$options,"components",i))?new pe(i,a,s,void 0,void 0,e):Lt(f,a,e,s,i)}else u=Lt(i,a,e,s);return Array.isArray(u)?u:n(u)?(n(l)&&function e(i,o,a){i.ns=o;"foreignObject"===i.tag&&(o=void 0,a=!0);if(n(i.children))for(var s=0,c=i.children.length;s<c;s++){var u=i.children[s];n(u.tag)&&(t(u.ns)||r(a)&&"svg"!==u.tag)&&e(u,o,a)}}(u,l),n(a)&&function(e){o(e.style)&&et(e.style);o(e.class)&&et(e.class)}(a),u):ve()}(e,a,s,c,u)}var Rt,Ht=null;function Bt(e,t){return(e.__esModule||oe&&"Module"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function Ut(e){return e.isComment&&e.asyncFactory}function zt(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var r=e[t];if(n(r)&&(n(r.componentOptions)||Ut(r)))return r}}function Vt(e,t){Rt.$on(e,t)}function Kt(e,t){Rt.$off(e,t)}function Jt(e,t){var n=Rt;return function r(){null!==t.apply(null,arguments)&&n.$off(e,r)}}function qt(e,t,n){Rt=e,rt(t,n||{},Vt,Kt,Jt,e),Rt=void 0}var Wt=null;function Zt(e){var t=Wt;return Wt=e,function(){Wt=t}}function Gt(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function Xt(e,t){if(t){if(e._directInactive=!1,Gt(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)Xt(e.$children[n]);Yt(e,"activated")}}function Yt(e,t){le();var n=e.$options[t],r=t+" hook";if(n)for(var i=0,o=n.length;i<o;i++)He(n[i],e,null,e,r);e._hasHookEvent&&e.$emit("hook:"+t),fe()}var Qt=[],en=[],tn={},nn=!1,rn=!1,on=0;var an=0,sn=Date.now;if(z&&!q){var cn=window.performance;cn&&"function"==typeof cn.now&&sn()>document.createEvent("Event").timeStamp&&(sn=function(){return cn.now()})}function un(){var e,t;for(an=sn(),rn=!0,Qt.sort(function(e,t){return e.id-t.id}),on=0;on<Qt.length;on++)(e=Qt[on]).before&&e.before(),t=e.id,tn[t]=null,e.run();var n=en.slice(),r=Qt.slice();on=Qt.length=en.length=0,tn={},nn=rn=!1,function(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,Xt(e[t],!0)}(n),function(e){var t=e.length;for(;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&Yt(r,"updated")}}(r),ne&&F.devtools&&ne.emit("flush")}var ln=0,fn=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++ln,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ie,this.newDepIds=new ie,this.expression="","function"==typeof t?this.getter=t:(this.getter=function(e){if(!H.test(e)){var t=e.split(".");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}(t),this.getter||(this.getter=S)),this.value=this.lazy?void 0:this.get()};fn.prototype.get=function(){var e;le(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(e){if(!this.user)throw e;Re(e,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&et(e),fe(),this.cleanupDeps()}return e},fn.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},fn.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},fn.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():function(e){var t=e.id;if(null==tn[t]){if(tn[t]=!0,rn){for(var n=Qt.length-1;n>on&&Qt[n].id>e.id;)n--;Qt.splice(n+1,0,e)}else Qt.push(e);nn||(nn=!0,Ye(un))}}(this)},fn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Re(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},fn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},fn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},fn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||h(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var pn={enumerable:!0,configurable:!0,get:S,set:S};function dn(e,t,n){pn.get=function(){return this[t][n]},pn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,pn)}function vn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&$e(!1);var o=function(o){i.push(o);var a=Me(o,t,n,e);xe(r,o,a),o in e||dn(e,"_props",o)};for(var a in t)o(a);$e(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?S:x(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){le();try{return e.call(t,t)}catch(e){return Re(e,t,"data()"),{}}finally{fe()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&y(r,o)||(a=void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&dn(e,"_data",o))}var a;Ce(t,!0)}(e):Ce(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=te();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new fn(e,a||S,S,hn)),i in e||mn(e,i,o)}}(e,t.computed),t.watch&&t.watch!==Y&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)_n(e,n,r[i]);else _n(e,n,r)}}(e,t.watch)}var hn={lazy:!0};function mn(e,t,n){var r=!te();"function"==typeof n?(pn.get=r?yn(t):gn(n),pn.set=S):(pn.get=n.get?r&&!1!==n.cache?yn(t):gn(n.get):S,pn.set=n.set||S),Object.defineProperty(e,t,pn)}function yn(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),ce.target&&t.depend(),t.value}}function gn(e){return function(){return e.call(this,this)}}function _n(e,t,n,r){return s(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}var bn=0;function $n(e){var t=e.options;if(e.super){var n=$n(e.super);if(n!==e.superOptions){e.superOptions=n;var r=function(e){var t,n=e.options,r=e.sealedOptions;for(var i in n)n[i]!==r[i]&&(t||(t={}),t[i]=n[i]);return t}(e);r&&A(e.extendOptions,r),(t=e.options=De(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function wn(e){this._init(e)}function Cn(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name,a=function(e){this._init(e)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=t++,a.options=De(n.options,e),a.super=n,a.options.props&&function(e){var t=e.options.props;for(var n in t)dn(e.prototype,"_props",n)}(a),a.options.computed&&function(e){var t=e.options.computed;for(var n in t)mn(e.prototype,n,t[n])}(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,M.forEach(function(e){a[e]=n[e]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=A({},a.options),i[r]=a,a}}function xn(e){return e&&(e.Ctor.options.name||e.tag)}function kn(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function An(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=xn(a.componentOptions);s&&!t(s)&&On(n,o,r,i)}}}function On(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,h(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=bn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=De($n(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&qt(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=ut(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return Pt(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Pt(t,e,n,r,i,!0)};var o=r&&r.data;xe(t,"$attrs",o&&o.attrs||e,null,!0),xe(t,"$listeners",n._parentListeners||e,null,!0)}(n),Yt(n,"beforeCreate"),function(e){var t=ct(e.$options.inject,e);t&&($e(!1),Object.keys(t).forEach(function(n){xe(e,n,t[n])}),$e(!0))}(n),vn(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),Yt(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(wn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=ke,e.prototype.$delete=Ae,e.prototype.$watch=function(e,t,n){if(s(t))return _n(this,e,t,n);(n=n||{}).user=!0;var r=new fn(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){Re(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(wn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i<o;i++)r.$on(e[i],n);else(r._events[e]||(r._events[e]=[])).push(n),t.test(e)&&(r._hasHookEvent=!0);return r},e.prototype.$once=function(e,t){var n=this;function r(){n.$off(e,r),t.apply(n,arguments)}return r.fn=t,n.$on(e,r),n},e.prototype.$off=function(e,t){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(e)){for(var r=0,i=e.length;r<i;r++)n.$off(e[r],t);return n}var o,a=n._events[e];if(!a)return n;if(!t)return n._events[e]=null,n;for(var s=a.length;s--;)if((o=a[s])===t||o.fn===t){a.splice(s,1);break}return n},e.prototype.$emit=function(e){var t=this._events[e];if(t){t=t.length>1?k(t):t;for(var n=k(arguments,1),r='event handler for "'+e+'"',i=0,o=t.length;i<o;i++)He(t[i],this,n,this,r)}return this}}(wn),function(e){e.prototype._update=function(e,t){var n=this,r=n.$el,i=n._vnode,o=Zt(n);n._vnode=e,n.$el=i?n.__patch__(i,e):n.__patch__(n.$el,e,t,!1),o(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},e.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){Yt(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||h(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),Yt(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}(wn),function(e){St(e.prototype),e.prototype.$nextTick=function(e){return Ye(e,this)},e.prototype._render=function(){var e,t=this,n=t.$options,r=n.render,i=n._parentVnode;i&&(t.$scopedSlots=ft(i.data.scopedSlots,t.$slots,t.$scopedSlots)),t.$vnode=i;try{Ht=t,e=r.call(t._renderProxy,t.$createElement)}catch(n){Re(n,t,"render"),e=t._vnode}finally{Ht=null}return Array.isArray(e)&&1===e.length&&(e=e[0]),e instanceof pe||(e=ve()),e.parent=i,e}}(wn);var Sn=[String,RegExp,Array],Tn={KeepAlive:{name:"keep-alive",abstract:!0,props:{include:Sn,exclude:Sn,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)On(this.cache,e,this.keys)},mounted:function(){var e=this;this.$watch("include",function(t){An(e,function(e){return kn(t,e)})}),this.$watch("exclude",function(t){An(e,function(e){return!kn(t,e)})})},render:function(){var e=this.$slots.default,t=zt(e),n=t&&t.componentOptions;if(n){var r=xn(n),i=this.include,o=this.exclude;if(i&&(!r||!kn(i,r))||o&&r&&kn(o,r))return t;var a=this.cache,s=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;a[c]?(t.componentInstance=a[c].componentInstance,h(s,c),s.push(c)):(a[c]=t,s.push(c),this.max&&s.length>parseInt(this.max)&&On(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return F}};Object.defineProperty(e,"config",t),e.util={warn:ae,extend:A,mergeOptions:De,defineReactive:xe},e.set=ke,e.delete=Ae,e.nextTick=Ye,e.observable=function(e){return Ce(e),e},e.options=Object.create(null),M.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,A(e.options.components,Tn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=k(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=De(this.options,e),this}}(e),Cn(e),function(e){M.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(wn),Object.defineProperty(wn.prototype,"$isServer",{get:te}),Object.defineProperty(wn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(wn,"FunctionalRenderContext",{value:Tt}),wn.version="2.6.10";var En=p("style,class"),Nn=p("input,textarea,option,select,progress"),jn=function(e,t,n){return"value"===n&&Nn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Dn=p("contenteditable,draggable,spellcheck"),Ln=p("events,caret,typing,plaintext-only"),Mn=function(e,t){return Hn(t)||"false"===t?"false":"contenteditable"===e&&Ln(t)?t:"true"},In=p("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Fn="http://www.w3.org/1999/xlink",Pn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Rn=function(e){return Pn(e)?e.slice(6,e.length):""},Hn=function(e){return null==e||!1===e};function Bn(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Un(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=Un(t,r.data));return function(e,t){if(n(e)||n(t))return zn(e,Vn(t));return""}(t.staticClass,t.class)}function Un(e,t){return{staticClass:zn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function zn(e,t){return e?t?e+" "+t:e:t||""}function Vn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i<o;i++)n(t=Vn(e[i]))&&""!==t&&(r&&(r+=" "),r+=t);return r}(e):o(e)?function(e){var t="";for(var n in e)e[n]&&(t&&(t+=" "),t+=n);return t}(e):"string"==typeof e?e:""}var Kn={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Jn=p("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),qn=p("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Wn=function(e){return Jn(e)||qn(e)};function Zn(e){return qn(e)?"svg":"math"===e?"math":void 0}var Gn=Object.create(null);var Xn=p("text,number,password,search,email,tel,url");function Yn(e){if("string"==typeof e){var t=document.querySelector(e);return t||document.createElement("div")}return e}var Qn=Object.freeze({createElement:function(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)},createElementNS:function(e,t){return document.createElementNS(Kn[e],t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},setStyleScope:function(e,t){e.setAttribute(t,"")}}),er={create:function(e,t){tr(t)},update:function(e,t){e.data.ref!==t.data.ref&&(tr(e,!0),tr(t))},destroy:function(e){tr(e,!0)}};function tr(e,t){var r=e.data.ref;if(n(r)){var i=e.context,o=e.componentInstance||e.elm,a=i.$refs;t?Array.isArray(a[r])?h(a[r],o):a[r]===o&&(a[r]=void 0):e.data.refInFor?Array.isArray(a[r])?a[r].indexOf(o)<0&&a[r].push(o):a[r]=[o]:a[r]=o}}var nr=new pe("",{},[]),rr=["create","activate","update","remove","destroy"];function ir(e,i){return e.key===i.key&&(e.tag===i.tag&&e.isComment===i.isComment&&n(e.data)===n(i.data)&&function(e,t){if("input"!==e.tag)return!0;var r,i=n(r=e.data)&&n(r=r.attrs)&&r.type,o=n(r=t.data)&&n(r=r.attrs)&&r.type;return i===o||Xn(i)&&Xn(o)}(e,i)||r(e.isAsyncPlaceholder)&&e.asyncFactory===i.asyncFactory&&t(i.asyncFactory.error))}function or(e,t,r){var i,o,a={};for(i=t;i<=r;++i)n(o=e[i].key)&&(a[o]=i);return a}var ar={create:sr,update:sr,destroy:function(e){sr(e,nr)}};function sr(e,t){(e.data.directives||t.data.directives)&&function(e,t){var n,r,i,o=e===nr,a=t===nr,s=ur(e.data.directives,e.context),c=ur(t.data.directives,t.context),u=[],l=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,i.oldArg=r.arg,fr(i,"update",t,e),i.def&&i.def.componentUpdated&&l.push(i)):(fr(i,"bind",t,e),i.def&&i.def.inserted&&u.push(i));if(u.length){var f=function(){for(var n=0;n<u.length;n++)fr(u[n],"inserted",t,e)};o?it(t,"insert",f):f()}l.length&&it(t,"postpatch",function(){for(var n=0;n<l.length;n++)fr(l[n],"componentUpdated",t,e)});if(!o)for(n in s)c[n]||fr(s[n],"unbind",e,e,a)}(e,t)}var cr=Object.create(null);function ur(e,t){var n,r,i=Object.create(null);if(!e)return i;for(n=0;n<e.length;n++)(r=e[n]).modifiers||(r.modifiers=cr),i[lr(r)]=r,r.def=Le(t.$options,"directives",r.name);return i}function lr(e){return e.rawName||e.name+"."+Object.keys(e.modifiers||{}).join(".")}function fr(e,t,n,r,i){var o=e.def&&e.def[t];if(o)try{o(n.elm,e,n,r,i)}catch(r){Re(r,n.context,"directive "+e.name+" "+t+" hook")}}var pr=[er,ar];function dr(e,r){var i=r.componentOptions;if(!(n(i)&&!1===i.Ctor.options.inheritAttrs||t(e.data.attrs)&&t(r.data.attrs))){var o,a,s=r.elm,c=e.data.attrs||{},u=r.data.attrs||{};for(o in n(u.__ob__)&&(u=r.data.attrs=A({},u)),u)a=u[o],c[o]!==a&&vr(s,o,a);for(o in(q||Z)&&u.value!==c.value&&vr(s,"value",u.value),c)t(u[o])&&(Pn(o)?s.removeAttributeNS(Fn,Rn(o)):Dn(o)||s.removeAttribute(o))}}function vr(e,t,n){e.tagName.indexOf("-")>-1?hr(e,t,n):In(t)?Hn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Dn(t)?e.setAttribute(t,Mn(t,n)):Pn(t)?Hn(n)?e.removeAttributeNS(Fn,Rn(t)):e.setAttributeNS(Fn,t,n):hr(e,t,n)}function hr(e,t,n){if(Hn(n))e.removeAttribute(t);else{if(q&&!W&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var mr={create:dr,update:dr};function yr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=Bn(r),c=i._transitionClasses;n(c)&&(s=zn(s,Vn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var gr,_r,br,$r,wr,Cr,xr={create:yr,update:yr},kr=/[\w).+\-_$\]]/;function Ar(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r<e.length;r++)if(n=t,t=e.charCodeAt(r),a)39===t&&92!==n&&(a=!1);else if(s)34===t&&92!==n&&(s=!1);else if(c)96===t&&92!==n&&(c=!1);else if(u)47===t&&92!==n&&(u=!1);else if(124!==t||124===e.charCodeAt(r+1)||124===e.charCodeAt(r-1)||l||f||p){switch(t){case 34:s=!0;break;case 39:a=!0;break;case 96:c=!0;break;case 40:p++;break;case 41:p--;break;case 91:f++;break;case 93:f--;break;case 123:l++;break;case 125:l--}if(47===t){for(var v=r-1,h=void 0;v>=0&&" "===(h=e.charAt(v));v--);h&&kr.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r<o.length;r++)i=Or(i,o[r]);return i}function Or(e,t){var n=t.indexOf("(");if(n<0)return'_f("'+t+'")('+e+")";var r=t.slice(0,n),i=t.slice(n+1);return'_f("'+r+'")('+e+(")"!==i?","+i:i)}function Sr(e,t){console.error("[Vue compiler]: "+e)}function Tr(e,t){return e?e.map(function(e){return e[t]}).filter(function(e){return e}):[]}function Er(e,t,n,r,i){(e.props||(e.props=[])).push(Rr({name:t,value:n,dynamic:i},r)),e.plain=!1}function Nr(e,t,n,r,i){(i?e.dynamicAttrs||(e.dynamicAttrs=[]):e.attrs||(e.attrs=[])).push(Rr({name:t,value:n,dynamic:i},r)),e.plain=!1}function jr(e,t,n,r){e.attrsMap[t]=n,e.attrsList.push(Rr({name:t,value:n},r))}function Dr(e,t,n,r,i,o,a,s){(e.directives||(e.directives=[])).push(Rr({name:t,rawName:n,value:r,arg:i,isDynamicArg:o,modifiers:a},s)),e.plain=!1}function Lr(e,t,n){return n?"_p("+t+',"'+e+'")':e+t}function Mr(t,n,r,i,o,a,s,c){var u;(i=i||e).right?c?n="("+n+")==='click'?'contextmenu':("+n+")":"click"===n&&(n="contextmenu",delete i.right):i.middle&&(c?n="("+n+")==='click'?'mouseup':("+n+")":"click"===n&&(n="mouseup")),i.capture&&(delete i.capture,n=Lr("!",n,c)),i.once&&(delete i.once,n=Lr("~",n,c)),i.passive&&(delete i.passive,n=Lr("&",n,c)),i.native?(delete i.native,u=t.nativeEvents||(t.nativeEvents={})):u=t.events||(t.events={});var l=Rr({value:r.trim(),dynamic:c},s);i!==e&&(l.modifiers=i);var f=u[n];Array.isArray(f)?o?f.unshift(l):f.push(l):u[n]=f?o?[l,f]:[f,l]:l,t.plain=!1}function Ir(e,t,n){var r=Fr(e,":"+t)||Fr(e,"v-bind:"+t);if(null!=r)return Ar(r);if(!1!==n){var i=Fr(e,t);if(null!=i)return JSON.stringify(i)}}function Fr(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var i=e.attrsList,o=0,a=i.length;o<a;o++)if(i[o].name===t){i.splice(o,1);break}return n&&delete e.attrsMap[t],r}function Pr(e,t){for(var n=e.attrsList,r=0,i=n.length;r<i;r++){var o=n[r];if(t.test(o.name))return n.splice(r,1),o}}function Rr(e,t){return t&&(null!=t.start&&(e.start=t.start),null!=t.end&&(e.end=t.end)),e}function Hr(e,t,n){var r=n||{},i=r.number,o="$$v";r.trim&&(o="(typeof $$v === 'string'? $$v.trim(): $$v)"),i&&(o="_n("+o+")");var a=Br(t,o);e.model={value:"("+t+")",expression:JSON.stringify(t),callback:"function ($$v) {"+a+"}"}}function Br(e,t){var n=function(e){if(e=e.trim(),gr=e.length,e.indexOf("[")<0||e.lastIndexOf("]")<gr-1)return($r=e.lastIndexOf("."))>-1?{exp:e.slice(0,$r),key:'"'+e.slice($r+1)+'"'}:{exp:e,key:null};_r=e,$r=wr=Cr=0;for(;!zr();)Vr(br=Ur())?Jr(br):91===br&&Kr(br);return{exp:e.slice(0,wr),key:e.slice(wr+1,Cr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function Ur(){return _r.charCodeAt(++$r)}function zr(){return $r>=gr}function Vr(e){return 34===e||39===e}function Kr(e){var t=1;for(wr=$r;!zr();)if(Vr(e=Ur()))Jr(e);else if(91===e&&t++,93===e&&t--,0===t){Cr=$r;break}}function Jr(e){for(var t=e;!zr()&&(e=Ur())!==t;);}var qr,Wr="__r",Zr="__c";function Gr(e,t,n){var r=qr;return function i(){null!==t.apply(null,arguments)&&Qr(e,i,n,r)}}var Xr=Ve&&!(X&&Number(X[1])<=53);function Yr(e,t,n,r){if(Xr){var i=an,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}qr.addEventListener(e,t,Q?{capture:n,passive:r}:n)}function Qr(e,t,n,r){(r||qr).removeEventListener(e,t._wrapper||t,n)}function ei(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};qr=r.elm,function(e){if(n(e[Wr])){var t=q?"change":"input";e[t]=[].concat(e[Wr],e[t]||[]),delete e[Wr]}n(e[Zr])&&(e.change=[].concat(e[Zr],e.change||[]),delete e[Zr])}(i),rt(i,o,Yr,Qr,Gr,r.context),qr=void 0}}var ti,ni={create:ei,update:ei};function ri(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=A({},c)),s)i in c||(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i&&"PROGRESS"!==a.tagName){a._value=o;var u=t(o)?"":String(o);ii(a,u)&&(a.value=u)}else if("innerHTML"===i&&qn(a.tagName)&&t(a.innerHTML)){(ti=ti||document.createElement("div")).innerHTML="<svg>"+o+"</svg>";for(var l=ti.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(o!==s[i])try{a[i]=o}catch(e){}}}}function ii(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.number)return f(r)!==f(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var oi={create:ri,update:ri},ai=g(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function si(e){var t=ci(e.style);return e.staticStyle?A(e.staticStyle,t):t}function ci(e){return Array.isArray(e)?O(e):"string"==typeof e?ai(e):e}var ui,li=/^--/,fi=/\s*!important$/,pi=function(e,t,n){if(li.test(t))e.style.setProperty(t,n);else if(fi.test(n))e.style.setProperty(C(t),n.replace(fi,""),"important");else{var r=vi(t);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)e.style[r]=n[i];else e.style[r]=n}},di=["Webkit","Moz","ms"],vi=g(function(e){if(ui=ui||document.createElement("div").style,"filter"!==(e=b(e))&&e in ui)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<di.length;n++){var r=di[n]+t;if(r in ui)return r}});function hi(e,r){var i=r.data,o=e.data;if(!(t(i.staticStyle)&&t(i.style)&&t(o.staticStyle)&&t(o.style))){var a,s,c=r.elm,u=o.staticStyle,l=o.normalizedStyle||o.style||{},f=u||l,p=ci(r.data.style)||{};r.data.normalizedStyle=n(p.__ob__)?A({},p):p;var d=function(e,t){var n,r={};if(t)for(var i=e;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=si(i.data))&&A(r,n);(n=si(e.data))&&A(r,n);for(var o=e;o=o.parent;)o.data&&(n=si(o.data))&&A(r,n);return r}(r,!0);for(s in f)t(d[s])&&pi(c,s,"");for(s in d)(a=d[s])!==f[s]&&pi(c,s,null==a?"":a)}}var mi={create:hi,update:hi},yi=/\s+/;function gi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(yi).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function _i(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(yi).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function bi(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&A(t,$i(e.name||"v")),A(t,e),t}return"string"==typeof e?$i(e):void 0}}var $i=g(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),wi=z&&!W,Ci="transition",xi="animation",ki="transition",Ai="transitionend",Oi="animation",Si="animationend";wi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ki="WebkitTransition",Ai="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Oi="WebkitAnimation",Si="webkitAnimationEnd"));var Ti=z?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ei(e){Ti(function(){Ti(e)})}function Ni(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),gi(e,t))}function ji(e,t){e._transitionClasses&&h(e._transitionClasses,t),_i(e,t)}function Di(e,t,n){var r=Mi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Ci?Ai:Si,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c<a&&u()},o+1),e.addEventListener(s,l)}var Li=/\b(transform|all)(,|$)/;function Mi(e,t){var n,r=window.getComputedStyle(e),i=(r[ki+"Delay"]||"").split(", "),o=(r[ki+"Duration"]||"").split(", "),a=Ii(i,o),s=(r[Oi+"Delay"]||"").split(", "),c=(r[Oi+"Duration"]||"").split(", "),u=Ii(s,c),l=0,f=0;return t===Ci?a>0&&(n=Ci,l=a,f=o.length):t===xi?u>0&&(n=xi,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?Ci:xi:null)?n===Ci?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===Ci&&Li.test(r[ki+"Property"])}}function Ii(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map(function(t,n){return Fi(t)+Fi(e[n])}))}function Fi(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function Pi(e,r){var i=e.elm;n(i._leaveCb)&&(i._leaveCb.cancelled=!0,i._leaveCb());var a=bi(e.data.transition);if(!t(a)&&!n(i._enterCb)&&1===i.nodeType){for(var s=a.css,c=a.type,u=a.enterClass,l=a.enterToClass,p=a.enterActiveClass,d=a.appearClass,v=a.appearToClass,h=a.appearActiveClass,m=a.beforeEnter,y=a.enter,g=a.afterEnter,_=a.enterCancelled,b=a.beforeAppear,$=a.appear,w=a.afterAppear,C=a.appearCancelled,x=a.duration,k=Wt,A=Wt.$vnode;A&&A.parent;)k=A.context,A=A.parent;var O=!k._isMounted||!e.isRootInsert;if(!O||$||""===$){var S=O&&d?d:u,T=O&&h?h:p,E=O&&v?v:l,N=O&&b||m,j=O&&"function"==typeof $?$:y,L=O&&w||g,M=O&&C||_,I=f(o(x)?x.enter:x),F=!1!==s&&!W,P=Bi(j),R=i._enterCb=D(function(){F&&(ji(i,E),ji(i,T)),R.cancelled?(F&&ji(i,S),M&&M(i)):L&&L(i),i._enterCb=null});e.data.show||it(e,"insert",function(){var t=i.parentNode,n=t&&t._pending&&t._pending[e.key];n&&n.tag===e.tag&&n.elm._leaveCb&&n.elm._leaveCb(),j&&j(i,R)}),N&&N(i),F&&(Ni(i,S),Ni(i,T),Ei(function(){ji(i,S),R.cancelled||(Ni(i,E),P||(Hi(I)?setTimeout(R,I):Di(i,c,R)))})),e.data.show&&(r&&r(),j&&j(i,R)),F||P||R()}}}function Ri(e,r){var i=e.elm;n(i._enterCb)&&(i._enterCb.cancelled=!0,i._enterCb());var a=bi(e.data.transition);if(t(a)||1!==i.nodeType)return r();if(!n(i._leaveCb)){var s=a.css,c=a.type,u=a.leaveClass,l=a.leaveToClass,p=a.leaveActiveClass,d=a.beforeLeave,v=a.leave,h=a.afterLeave,m=a.leaveCancelled,y=a.delayLeave,g=a.duration,_=!1!==s&&!W,b=Bi(v),$=f(o(g)?g.leave:g),w=i._leaveCb=D(function(){i.parentNode&&i.parentNode._pending&&(i.parentNode._pending[e.key]=null),_&&(ji(i,l),ji(i,p)),w.cancelled?(_&&ji(i,u),m&&m(i)):(r(),h&&h(i)),i._leaveCb=null});y?y(C):C()}function C(){w.cancelled||(!e.data.show&&i.parentNode&&((i.parentNode._pending||(i.parentNode._pending={}))[e.key]=e),d&&d(i),_&&(Ni(i,u),Ni(i,p),Ei(function(){ji(i,u),w.cancelled||(Ni(i,l),b||(Hi($)?setTimeout(w,$):Di(i,c,w)))})),v&&v(i,w),_||b||w())}}function Hi(e){return"number"==typeof e&&!isNaN(e)}function Bi(e){if(t(e))return!1;var r=e.fns;return n(r)?Bi(Array.isArray(r)?r[0]:r):(e._length||e.length)>1}function Ui(e,t){!0!==t.data.show&&Pi(t)}var zi=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;o<rr.length;++o)for(s[rr[o]]=[],a=0;a<c.length;++a)n(c[a][rr[o]])&&s[rr[o]].push(c[a][rr[o]]);function l(e){var t=u.parentNode(e);n(t)&&u.removeChild(t,e)}function f(e,t,i,o,a,c,l){if(n(e.elm)&&n(c)&&(e=c[l]=me(e)),e.isRootInsert=!a,!function(e,t,i,o){var a=e.data;if(n(a)){var c=n(e.componentInstance)&&a.keepAlive;if(n(a=a.hook)&&n(a=a.init)&&a(e,!1),n(e.componentInstance))return d(e,t),v(i,e.elm,o),r(c)&&function(e,t,r,i){for(var o,a=e;a.componentInstance;)if(a=a.componentInstance._vnode,n(o=a.data)&&n(o=o.transition)){for(o=0;o<s.activate.length;++o)s.activate[o](nr,a);t.push(a);break}v(r,e.elm,i)}(e,t,i,o),!0}}(e,t,i,o)){var f=e.data,p=e.children,m=e.tag;n(m)?(e.elm=e.ns?u.createElementNS(e.ns,m):u.createElement(m,e),g(e),h(e,p,t),n(f)&&y(e,t),v(i,e.elm,o)):r(e.isComment)?(e.elm=u.createComment(e.text),v(i,e.elm,o)):(e.elm=u.createTextNode(e.text),v(i,e.elm,o))}}function d(e,t){n(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,m(e)?(y(e,t),g(e)):(tr(e),t.push(e))}function v(e,t,r){n(e)&&(n(r)?u.parentNode(r)===e&&u.insertBefore(e,t,r):u.appendChild(e,t))}function h(e,t,n){if(Array.isArray(t))for(var r=0;r<t.length;++r)f(t[r],n,e.elm,null,!0,t,r);else i(e.text)&&u.appendChild(e.elm,u.createTextNode(String(e.text)))}function m(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return n(e.tag)}function y(e,t){for(var r=0;r<s.create.length;++r)s.create[r](nr,e);n(o=e.data.hook)&&(n(o.create)&&o.create(nr,e),n(o.insert)&&t.push(e))}function g(e){var t;if(n(t=e.fnScopeId))u.setStyleScope(e.elm,t);else for(var r=e;r;)n(t=r.context)&&n(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t),r=r.parent;n(t=Wt)&&t!==e.context&&t!==e.fnContext&&n(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t)}function _(e,t,n,r,i,o){for(;r<=i;++r)f(n[r],o,e,t,!1,n,r)}function b(e){var t,r,i=e.data;if(n(i))for(n(t=i.hook)&&n(t=t.destroy)&&t(e),t=0;t<s.destroy.length;++t)s.destroy[t](e);if(n(t=e.children))for(r=0;r<e.children.length;++r)b(e.children[r])}function $(e,t,r,i){for(;r<=i;++r){var o=t[r];n(o)&&(n(o.tag)?(w(o),b(o)):l(o.elm))}}function w(e,t){if(n(t)||n(e.data)){var r,i=s.remove.length+1;for(n(t)?t.listeners+=i:t=function(e,t){function n(){0==--n.listeners&&l(e)}return n.listeners=t,n}(e.elm,i),n(r=e.componentInstance)&&n(r=r._vnode)&&n(r.data)&&w(r,t),r=0;r<s.remove.length;++r)s.remove[r](e,t);n(r=e.data.hook)&&n(r=r.remove)?r(e,t):t()}else l(e.elm)}function C(e,t,r,i){for(var o=r;o<i;o++){var a=t[o];if(n(a)&&ir(e,a))return o}}function x(e,i,o,a,c,l){if(e!==i){n(i.elm)&&n(a)&&(i=a[c]=me(i));var p=i.elm=e.elm;if(r(e.isAsyncPlaceholder))n(i.asyncFactory.resolved)?O(e.elm,i,o):i.isAsyncPlaceholder=!0;else if(r(i.isStatic)&&r(e.isStatic)&&i.key===e.key&&(r(i.isCloned)||r(i.isOnce)))i.componentInstance=e.componentInstance;else{var d,v=i.data;n(v)&&n(d=v.hook)&&n(d=d.prepatch)&&d(e,i);var h=e.children,y=i.children;if(n(v)&&m(i)){for(d=0;d<s.update.length;++d)s.update[d](e,i);n(d=v.hook)&&n(d=d.update)&&d(e,i)}t(i.text)?n(h)&&n(y)?h!==y&&function(e,r,i,o,a){for(var s,c,l,p=0,d=0,v=r.length-1,h=r[0],m=r[v],y=i.length-1,g=i[0],b=i[y],w=!a;p<=v&&d<=y;)t(h)?h=r[++p]:t(m)?m=r[--v]:ir(h,g)?(x(h,g,o,i,d),h=r[++p],g=i[++d]):ir(m,b)?(x(m,b,o,i,y),m=r[--v],b=i[--y]):ir(h,b)?(x(h,b,o,i,y),w&&u.insertBefore(e,h.elm,u.nextSibling(m.elm)),h=r[++p],b=i[--y]):ir(m,g)?(x(m,g,o,i,d),w&&u.insertBefore(e,m.elm,h.elm),m=r[--v],g=i[++d]):(t(s)&&(s=or(r,p,v)),t(c=n(g.key)?s[g.key]:C(g,r,p,v))?f(g,o,e,h.elm,!1,i,d):ir(l=r[c],g)?(x(l,g,o,i,d),r[c]=void 0,w&&u.insertBefore(e,l.elm,h.elm)):f(g,o,e,h.elm,!1,i,d),g=i[++d]);p>v?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(0,r,p,v)}(p,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(p,""),_(p,null,y,0,y.length-1,o)):n(h)?$(0,h,0,h.length-1):n(e.text)&&u.setTextContent(p,""):e.text!==i.text&&u.setTextContent(p,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o<t.length;++o)t[o].data.hook.insert(t[o])}var A=p("attrs,class,staticClass,staticStyle,key");function O(e,t,i,o){var a,s=t.tag,c=t.data,u=t.children;if(o=o||c&&c.pre,t.elm=e,r(t.isComment)&&n(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(n(c)&&(n(a=c.hook)&&n(a=a.init)&&a(t,!0),n(a=t.componentInstance)))return d(t,i),!0;if(n(s)){if(n(u))if(e.hasChildNodes())if(n(a=c)&&n(a=a.domProps)&&n(a=a.innerHTML)){if(a!==e.innerHTML)return!1}else{for(var l=!0,f=e.firstChild,p=0;p<u.length;p++){if(!f||!O(f,u[p],i,o)){l=!1;break}f=f.nextSibling}if(!l||f)return!1}else h(t,u,i);if(n(c)){var v=!1;for(var m in c)if(!A(m)){v=!0,y(t,i);break}!v&&c.class&&et(c.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,i,o,a){if(!t(i)){var c,l=!1,p=[];if(t(e))l=!0,f(i,p);else{var d=n(e.nodeType);if(!d&&ir(e,i))x(e,i,p,null,null,a);else{if(d){if(1===e.nodeType&&e.hasAttribute(L)&&(e.removeAttribute(L),o=!0),r(o)&&O(e,i,p))return k(i,p,!0),e;c=e,e=new pe(u.tagName(c).toLowerCase(),{},[],void 0,c)}var v=e.elm,h=u.parentNode(v);if(f(i,p,v._leaveCb?null:h,u.nextSibling(v)),n(i.parent))for(var y=i.parent,g=m(i);y;){for(var _=0;_<s.destroy.length;++_)s.destroy[_](y);if(y.elm=i.elm,g){for(var w=0;w<s.create.length;++w)s.create[w](nr,y);var C=y.data.hook.insert;if(C.merged)for(var A=1;A<C.fns.length;A++)C.fns[A]()}else tr(y);y=y.parent}n(h)?$(0,[e],0,0):n(e.tag)&&b(e)}}return k(i,p,l),i.elm}n(e)&&b(e)}}({nodeOps:Qn,modules:[mr,xr,ni,oi,mi,z?{create:Ui,activate:Ui,remove:function(e,t){!0!==e.data.show?Ri(e,t):t()}}:{}].concat(pr)});W&&document.addEventListener("selectionchange",function(){var e=document.activeElement;e&&e.vmodel&&Xi(e,"input")});var Vi={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?it(n,"postpatch",function(){Vi.componentUpdated(e,t,n)}):Ki(e,t,n.context),e._vOptions=[].map.call(e.options,Wi)):("textarea"===n.tag||Xn(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",Zi),e.addEventListener("compositionend",Gi),e.addEventListener("change",Gi),W&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){Ki(e,t,n.context);var r=e._vOptions,i=e._vOptions=[].map.call(e.options,Wi);if(i.some(function(e,t){return!N(e,r[t])}))(e.multiple?t.value.some(function(e){return qi(e,i)}):t.value!==t.oldValue&&qi(t.value,i))&&Xi(e,"change")}}};function Ki(e,t,n){Ji(e,t,n),(q||Z)&&setTimeout(function(){Ji(e,t,n)},0)}function Ji(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s<c;s++)if(a=e.options[s],i)o=j(r,Wi(a))>-1,a.selected!==o&&(a.selected=o);else if(N(Wi(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function qi(e,t){return t.every(function(t){return!N(t,e)})}function Wi(e){return"_value"in e?e._value:e.value}function Zi(e){e.target.composing=!0}function Gi(e){e.target.composing&&(e.target.composing=!1,Xi(e.target,"input"))}function Xi(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Yi(e){return!e.componentInstance||e.data&&e.data.transition?e:Yi(e.componentInstance._vnode)}var Qi={model:Vi,show:{bind:function(e,t,n){var r=t.value,i=(n=Yi(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,Pi(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Yi(n)).data&&n.data.transition?(n.data.show=!0,r?Pi(n,function(){e.style.display=e.__vOriginalDisplay}):Ri(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},eo={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function to(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?to(zt(t.children)):e}function no(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[b(o)]=i[o];return t}function ro(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var io=function(e){return e.tag||Ut(e)},oo=function(e){return"show"===e.name},ao={name:"transition",props:eo,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(io)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=to(o);if(!a)return o;if(this._leaving)return ro(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=no(this),u=this._vnode,l=to(u);if(a.data.directives&&a.data.directives.some(oo)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!Ut(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=A({},c);if("out-in"===r)return this._leaving=!0,it(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),ro(e,o);if("in-out"===r){if(Ut(a))return u;var p,d=function(){p()};it(c,"afterEnter",d),it(c,"enterCancelled",d),it(f,"delayLeave",function(e){p=e})}}return o}}},so=A({tag:String,moveClass:String},eo);function co(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function uo(e){e.data.newPos=e.elm.getBoundingClientRect()}function lo(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete so.mode;var fo={Transition:ao,TransitionGroup:{props:so,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Zt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=no(this),s=0;s<i.length;s++){var c=i[s];c.tag&&null!=c.key&&0!==String(c.key).indexOf("__vlist")&&(o.push(c),n[c.key]=c,(c.data||(c.data={})).transition=a)}if(r){for(var u=[],l=[],f=0;f<r.length;f++){var p=r[f];p.data.transition=a,p.data.pos=p.elm.getBoundingClientRect(),n[p.key]?u.push(p):l.push(p)}this.kept=e(t,null,u),this.removed=l}return e(t,null,o)},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||"v")+"-move";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(co),e.forEach(uo),e.forEach(lo),this._reflow=document.body.offsetHeight,e.forEach(function(e){if(e.data.moved){var n=e.elm,r=n.style;Ni(n,t),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(Ai,n._moveCb=function e(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(Ai,e),n._moveCb=null,ji(n,t))})}}))},methods:{hasMove:function(e,t){if(!wi)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach(function(e){_i(n,e)}),gi(n,t),n.style.display="none",this.$el.appendChild(n);var r=Mi(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}}};wn.config.mustUseProp=jn,wn.config.isReservedTag=Wn,wn.config.isReservedAttr=En,wn.config.getTagNamespace=Zn,wn.config.isUnknownElement=function(e){if(!z)return!0;if(Wn(e))return!1;if(e=e.toLowerCase(),null!=Gn[e])return Gn[e];var t=document.createElement(e);return e.indexOf("-")>-1?Gn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Gn[e]=/HTMLUnknownElement/.test(t.toString())},A(wn.options.directives,Qi),A(wn.options.components,fo),wn.prototype.__patch__=z?zi:S,wn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=ve),Yt(e,"beforeMount"),r=function(){e._update(e._render(),n)},new fn(e,r,S,{before:function(){e._isMounted&&!e._isDestroyed&&Yt(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,Yt(e,"mounted")),e}(this,e=e&&z?Yn(e):void 0,t)},z&&setTimeout(function(){F.devtools&&ne&&ne.emit("init",wn)},0);var po=/\{\{((?:.|\r?\n)+?)\}\}/g,vo=/[-.*+?^${}()|[\]\/\\]/g,ho=g(function(e){var t=e[0].replace(vo,"\\$&"),n=e[1].replace(vo,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var mo={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=Fr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Ir(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var yo,go={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=Fr(e,"style");n&&(e.staticStyle=JSON.stringify(ai(n)));var r=Ir(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},_o=function(e){return(yo=yo||document.createElement("div")).innerHTML=e,yo.textContent},bo=p("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),$o=p("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),wo=p("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),Co=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,xo=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ko="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+P.source+"]*",Ao="((?:"+ko+"\\:)?"+ko+")",Oo=new RegExp("^<"+Ao),So=/^\s*(\/?)>/,To=new RegExp("^<\\/"+Ao+"[^>]*>"),Eo=/^<!DOCTYPE [^>]+>/i,No=/^<!\--/,jo=/^<!\[/,Do=p("script,style,textarea",!0),Lo={},Mo={"<":"<",">":">",""":'"',"&":"&"," ":"\n","	":"\t","'":"'"},Io=/&(?:lt|gt|quot|amp|#39);/g,Fo=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Po=p("pre,textarea",!0),Ro=function(e,t){return e&&Po(e)&&"\n"===t[0]};function Ho(e,t){var n=t?Fo:Io;return e.replace(n,function(e){return Mo[e]})}var Bo,Uo,zo,Vo,Ko,Jo,qo,Wo,Zo=/^@|^v-on:/,Go=/^v-|^@|^:/,Xo=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Yo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Qo=/^\(|\)$/g,ea=/^\[.*\]$/,ta=/:(.*)$/,na=/^:|^\.|^v-bind:/,ra=/\.[^.\]]+(?=[^\]]*$)/g,ia=/^v-slot(:|$)|^#/,oa=/[\r\n]/,aa=/\s+/g,sa=g(_o),ca="_empty_";function ua(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:ma(t),rawAttrsMap:{},parent:n,children:[]}}function la(e,t){Bo=t.warn||Sr,Jo=t.isPreTag||T,qo=t.mustUseProp||T,Wo=t.getTagNamespace||T;t.isReservedTag;zo=Tr(t.modules,"transformNode"),Vo=Tr(t.modules,"preTransformNode"),Ko=Tr(t.modules,"postTransformNode"),Uo=t.delimiters;var n,r,i=[],o=!1!==t.preserveWhitespace,a=t.whitespace,s=!1,c=!1;function u(e){if(l(e),s||e.processed||(e=fa(e,t)),i.length||e===n||n.if&&(e.elseif||e.else)&&da(n,{exp:e.elseif,block:e}),r&&!e.forbidden)if(e.elseif||e.else)a=e,(u=function(e){var t=e.length;for(;t--;){if(1===e[t].type)return e[t];e.pop()}}(r.children))&&u.if&&da(u,{exp:a.elseif,block:a});else{if(e.slotScope){var o=e.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[o]=e}r.children.push(e),e.parent=r}var a,u;e.children=e.children.filter(function(e){return!e.slotScope}),l(e),e.pre&&(s=!1),Jo(e.tag)&&(c=!1);for(var f=0;f<Ko.length;f++)Ko[f](e,t)}function l(e){if(!c)for(var t;(t=e.children[e.children.length-1])&&3===t.type&&" "===t.text;)e.children.pop()}return function(e,t){for(var n,r,i=[],o=t.expectHTML,a=t.isUnaryTag||T,s=t.canBeLeftOpenTag||T,c=0;e;){if(n=e,r&&Do(r)){var u=0,l=r.toLowerCase(),f=Lo[l]||(Lo[l]=new RegExp("([\\s\\S]*?)(</"+l+"[^>]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,Do(l)||"noscript"===l||(n=n.replace(/<!\--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),Ro(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(No.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),C(v+3);continue}}if(jo.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(Eo);if(m){C(m[0].length);continue}var y=e.match(To);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),Ro(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(To.test($)||Oo.test($)||No.test($)||jo.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d)}d<0&&(b=e),b&&C(b.length),t.chars&&b&&t.chars(b,c-b.length,c)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(Oo);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(So))&&(r=e.match(xo)||e.match(Co));)r.start=c,C(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&wo(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p<l;p++){var d=e.attrs[p],v=d[3]||d[4]||d[5]||"",h="a"===n&&"href"===d[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;f[p]={name:d[1],value:Ho(v,h)}}u||(i.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:f,start:e.start,end:e.end}),r=n),t.start&&t.start(n,f,u,e.start,e.end)}function A(e,n,o){var a,s;if(null==n&&(n=c),null==o&&(o=c),e)for(s=e.toLowerCase(),a=i.length-1;a>=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:Bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,o,a,l,f){var p=r&&r.ns||Wo(e);q&&"svg"===p&&(o=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];ya.test(r.name)||(r.name=r.name.replace(ga,""),t.push(r))}return t}(o));var d,v=ua(e,o,r);p&&(v.ns=p),"style"!==(d=v).tag&&("script"!==d.tag||d.attrsMap.type&&"text/javascript"!==d.attrsMap.type)||te()||(v.forbidden=!0);for(var h=0;h<Vo.length;h++)v=Vo[h](v,t)||v;s||(!function(e){null!=Fr(e,"v-pre")&&(e.pre=!0)}(v),v.pre&&(s=!0)),Jo(v.tag)&&(c=!0),s?function(e){var t=e.attrsList,n=t.length;if(n)for(var r=e.attrs=new Array(n),i=0;i<n;i++)r[i]={name:t[i].name,value:JSON.stringify(t[i].value)},null!=t[i].start&&(r[i].start=t[i].start,r[i].end=t[i].end);else e.pre||(e.plain=!0)}(v):v.processed||(pa(v),function(e){var t=Fr(e,"v-if");if(t)e.if=t,da(e,{exp:t,block:e});else{null!=Fr(e,"v-else")&&(e.else=!0);var n=Fr(e,"v-else-if");n&&(e.elseif=n)}}(v),function(e){null!=Fr(e,"v-once")&&(e.once=!0)}(v)),n||(n=v),a?u(v):(r=v,i.push(v))},end:function(e,t,n){var o=i[i.length-1];i.length-=1,r=i[i.length-1],u(o)},chars:function(e,t,n){if(r&&(!q||"textarea"!==r.tag||r.attrsMap.placeholder!==e)){var i,u,l,f=r.children;if(e=c||e.trim()?"script"===(i=r).tag||"style"===i.tag?e:sa(e):f.length?a?"condense"===a&&oa.test(e)?"":" ":o?" ":"":"")c||"condense"!==a||(e=e.replace(aa," ")),!s&&" "!==e&&(u=function(e,t){var n=t?ho(t):po;if(n.test(e)){for(var r,i,o,a=[],s=[],c=n.lastIndex=0;r=n.exec(e);){(i=r.index)>c&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=Ar(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c<e.length&&(s.push(o=e.slice(c)),a.push(JSON.stringify(o))),{expression:a.join("+"),tokens:s}}}(e,Uo))?l={type:2,expression:u.expression,tokens:u.tokens,text:e}:" "===e&&f.length&&" "===f[f.length-1].text||(l={type:3,text:e}),l&&f.push(l)}},comment:function(e,t,n){if(r){var i={type:3,text:e,isComment:!0};r.children.push(i)}}}),n}function fa(e,t){var n,r;(r=Ir(n=e,"key"))&&(n.key=r),e.plain=!e.key&&!e.scopedSlots&&!e.attrsList.length,function(e){var t=Ir(e,"ref");t&&(e.ref=t,e.refInFor=function(e){var t=e;for(;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}(e))}(e),function(e){var t;"template"===e.tag?(t=Fr(e,"scope"),e.slotScope=t||Fr(e,"slot-scope")):(t=Fr(e,"slot-scope"))&&(e.slotScope=t);var n=Ir(e,"slot");n&&(e.slotTarget='""'===n?'"default"':n,e.slotTargetDynamic=!(!e.attrsMap[":slot"]&&!e.attrsMap["v-bind:slot"]),"template"===e.tag||e.slotScope||Nr(e,"slot",n,function(e,t){return e.rawAttrsMap[":"+t]||e.rawAttrsMap["v-bind:"+t]||e.rawAttrsMap[t]}(e,"slot")));if("template"===e.tag){var r=Pr(e,ia);if(r){var i=va(r),o=i.name,a=i.dynamic;e.slotTarget=o,e.slotTargetDynamic=a,e.slotScope=r.value||ca}}else{var s=Pr(e,ia);if(s){var c=e.scopedSlots||(e.scopedSlots={}),u=va(s),l=u.name,f=u.dynamic,p=c[l]=ua("template",[],e);p.slotTarget=l,p.slotTargetDynamic=f,p.children=e.children.filter(function(e){if(!e.slotScope)return e.parent=p,!0}),p.slotScope=s.value||ca,e.children=[],e.plain=!1}}}(e),function(e){"slot"===e.tag&&(e.slotName=Ir(e,"name"))}(e),function(e){var t;(t=Ir(e,"is"))&&(e.component=t);null!=Fr(e,"inline-template")&&(e.inlineTemplate=!0)}(e);for(var i=0;i<zo.length;i++)e=zo[i](e,t)||e;return function(e){var t,n,r,i,o,a,s,c,u=e.attrsList;for(t=0,n=u.length;t<n;t++)if(r=i=u[t].name,o=u[t].value,Go.test(r))if(e.hasBindings=!0,(a=ha(r.replace(Go,"")))&&(r=r.replace(ra,"")),na.test(r))r=r.replace(na,""),o=Ar(o),(c=ea.test(r))&&(r=r.slice(1,-1)),a&&(a.prop&&!c&&"innerHtml"===(r=b(r))&&(r="innerHTML"),a.camel&&!c&&(r=b(r)),a.sync&&(s=Br(o,"$event"),c?Mr(e,'"update:"+('+r+")",s,null,!1,0,u[t],!0):(Mr(e,"update:"+b(r),s,null,!1,0,u[t]),C(r)!==b(r)&&Mr(e,"update:"+C(r),s,null,!1,0,u[t])))),a&&a.prop||!e.component&&qo(e.tag,e.attrsMap.type,r)?Er(e,r,o,u[t],c):Nr(e,r,o,u[t],c);else if(Zo.test(r))r=r.replace(Zo,""),(c=ea.test(r))&&(r=r.slice(1,-1)),Mr(e,r,o,a,!1,0,u[t],c);else{var l=(r=r.replace(Go,"")).match(ta),f=l&&l[1];c=!1,f&&(r=r.slice(0,-(f.length+1)),ea.test(f)&&(f=f.slice(1,-1),c=!0)),Dr(e,r,i,o,f,c,a,u[t])}else Nr(e,r,JSON.stringify(o),u[t]),!e.component&&"muted"===r&&qo(e.tag,e.attrsMap.type,r)&&Er(e,r,"true",u[t])}(e),e}function pa(e){var t;if(t=Fr(e,"v-for")){var n=function(e){var t=e.match(Xo);if(!t)return;var n={};n.for=t[2].trim();var r=t[1].trim().replace(Qo,""),i=r.match(Yo);i?(n.alias=r.replace(Yo,"").trim(),n.iterator1=i[1].trim(),i[2]&&(n.iterator2=i[2].trim())):n.alias=r;return n}(t);n&&A(e,n)}}function da(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function va(e){var t=e.name.replace(ia,"");return t||"#"!==e.name[0]&&(t="default"),ea.test(t)?{name:t.slice(1,-1),dynamic:!0}:{name:'"'+t+'"',dynamic:!1}}function ha(e){var t=e.match(ra);if(t){var n={};return t.forEach(function(e){n[e.slice(1)]=!0}),n}}function ma(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n].name]=e[n].value;return t}var ya=/^xmlns:NS\d+/,ga=/^NS\d+:/;function _a(e){return ua(e.tag,e.attrsList.slice(),e.parent)}var ba=[mo,go,{preTransformNode:function(e,t){if("input"===e.tag){var n,r=e.attrsMap;if(!r["v-model"])return;if((r[":type"]||r["v-bind:type"])&&(n=Ir(e,"type")),r.type||n||!r["v-bind"]||(n="("+r["v-bind"]+").type"),n){var i=Fr(e,"v-if",!0),o=i?"&&("+i+")":"",a=null!=Fr(e,"v-else",!0),s=Fr(e,"v-else-if",!0),c=_a(e);pa(c),jr(c,"type","checkbox"),fa(c,t),c.processed=!0,c.if="("+n+")==='checkbox'"+o,da(c,{exp:c.if,block:c});var u=_a(e);Fr(u,"v-for",!0),jr(u,"type","radio"),fa(u,t),da(c,{exp:"("+n+")==='radio'"+o,block:u});var l=_a(e);return Fr(l,"v-for",!0),jr(l,":type",n),fa(l,t),da(c,{exp:i,block:l}),a?c.else=!0:s&&(c.elseif=s),c}}}}];var $a,wa,Ca={expectHTML:!0,modules:ba,directives:{model:function(e,t,n){var r=t.value,i=t.modifiers,o=e.tag,a=e.attrsMap.type;if(e.component)return Hr(e,r,i),!1;if("select"===o)!function(e,t,n){var r='var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(n&&n.number?"_n(val)":"val")+"});";r=r+" "+Br(t,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),Mr(e,"change",r,null,!0)}(e,r,i);else if("input"===o&&"checkbox"===a)!function(e,t,n){var r=n&&n.number,i=Ir(e,"value")||"null",o=Ir(e,"true-value")||"true",a=Ir(e,"false-value")||"false";Er(e,"checked","Array.isArray("+t+")?_i("+t+","+i+")>-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),Mr(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Br(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Br(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Br(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=Ir(e,"value")||"null";Er(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),Mr(e,"change",Br(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Wr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Br(t,l);c&&(f="if($event.target.composing)return;"+f),Er(e,"value","("+t+")"),Mr(e,u,f,null,!0),(s||a)&&Mr(e,"blur","$forceUpdate()")}(e,r,i);else if(!F.isReservedTag(o))return Hr(e,r,i),!1;return!0},text:function(e,t){t.value&&Er(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&Er(e,"innerHTML","_s("+t.value+")",t)}},isPreTag:function(e){return"pre"===e},isUnaryTag:bo,mustUseProp:jn,canBeLeftOpenTag:$o,isReservedTag:Wn,getTagNamespace:Zn,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}(ba)},xa=g(function(e){return p("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))});function ka(e,t){e&&($a=xa(t.staticKeys||""),wa=t.isReservedTag||T,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||d(e.tag)||!wa(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every($a)))}(t);if(1===t.type){if(!wa(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n<r;n++){var i=t.children[n];e(i),i.static||(t.static=!1)}if(t.ifConditions)for(var o=1,a=t.ifConditions.length;o<a;o++){var s=t.ifConditions[o].block;e(s),s.static||(t.static=!1)}}}(e),function e(t,n){if(1===t.type){if((t.static||t.once)&&(t.staticInFor=n),t.static&&t.children.length&&(1!==t.children.length||3!==t.children[0].type))return void(t.staticRoot=!0);if(t.staticRoot=!1,t.children)for(var r=0,i=t.children.length;r<i;r++)e(t.children[r],n||!!t.for);if(t.ifConditions)for(var o=1,a=t.ifConditions.length;o<a;o++)e(t.ifConditions[o].block,n)}}(e,!1))}var Aa=/^([\w$_]+|\([^)]*?\))\s*=>|^function\s*(?:[\w$]+)?\s*\(/,Oa=/\([^)]*?\);*$/,Sa=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ta={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ea={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Na=function(e){return"if("+e+")return null;"},ja={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Na("$event.target !== $event.currentTarget"),ctrl:Na("!$event.ctrlKey"),shift:Na("!$event.shiftKey"),alt:Na("!$event.altKey"),meta:Na("!$event.metaKey"),left:Na("'button' in $event && $event.button !== 0"),middle:Na("'button' in $event && $event.button !== 1"),right:Na("'button' in $event && $event.button !== 2")};function Da(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var a=La(e[o]);e[o]&&e[o].dynamic?i+=o+","+a+",":r+='"'+o+'":'+a+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function La(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return La(e)}).join(",")+"]";var t=Sa.test(e.value),n=Aa.test(e.value),r=Sa.test(e.value.replace(Oa,""));if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(ja[s])o+=ja[s],Ta[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=Na(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(Ma).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(t?"return "+e.value+"($event)":n?"return ("+e.value+")($event)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function Ma(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Ta[e],r=Ea[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Ia={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:S},Fa=function(e){this.options=e,this.warn=e.warn||Sr,this.transforms=Tr(e.modules,"transformCode"),this.dataGenFns=Tr(e.modules,"genData"),this.directives=A(A({},Ia),e.directives);var t=e.isReservedTag||T;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Pa(e,t){var n=new Fa(t);return{render:"with(this){return "+(e?Ra(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Ra(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Ha(e,t);if(e.once&&!e.onceProcessed)return Ba(e,t);if(e.for&&!e.forProcessed)return za(e,t);if(e.if&&!e.ifProcessed)return Ua(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=qa(e,t),i="_t("+n+(r?","+r:""),o=e.attrs||e.dynamicAttrs?Ga((e.attrs||[]).concat(e.dynamicAttrs||[]).map(function(e){return{name:b(e.name),value:e.value,dynamic:e.dynamic}})):null,a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:qa(t,n,!0);return"_c("+e+","+Va(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Va(e,t));var i=e.inlineTemplate?null:qa(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o<t.transforms.length;o++)n=t.transforms[o](e,n);return n}return qa(e,t)||"void 0"}function Ha(e,t){e.staticProcessed=!0;var n=t.pre;return e.pre&&(t.pre=e.pre),t.staticRenderFns.push("with(this){return "+Ra(e,t)+"}"),t.pre=n,"_m("+(t.staticRenderFns.length-1)+(e.staticInFor?",true":"")+")"}function Ba(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return Ua(e,t);if(e.staticInFor){for(var n="",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+Ra(e,t)+","+t.onceId+++","+n+")":Ra(e,t)}return Ha(e,t)}function Ua(e,t,n,r){return e.ifProcessed=!0,function e(t,n,r,i){if(!t.length)return i||"_e()";var o=t.shift();return o.exp?"("+o.exp+")?"+a(o.block)+":"+e(t,n,r,i):""+a(o.block);function a(e){return r?r(e,n):e.once?Ba(e,n):Ra(e,n)}}(e.ifConditions.slice(),t,n,r)}function za(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||Ra)(e,t)+"})"}function Va(e,t){var n="{",r=function(e,t){var n=e.directives;if(!n)return;var r,i,o,a,s="directives:[",c=!1;for(r=0,i=n.length;r<i;r++){o=n[r],a=!0;var u=t.directives[o.name];u&&(a=!!u(e,o,t.warn)),a&&(c=!0,s+='{name:"'+o.name+'",rawName:"'+o.rawName+'"'+(o.value?",value:("+o.value+"),expression:"+JSON.stringify(o.value):"")+(o.arg?",arg:"+(o.isDynamicArg?o.arg:'"'+o.arg+'"'):"")+(o.modifiers?",modifiers:"+JSON.stringify(o.modifiers):"")+"},")}if(c)return s.slice(0,-1)+"]"}(e,t);r&&(n+=r+","),e.key&&(n+="key:"+e.key+","),e.ref&&(n+="ref:"+e.ref+","),e.refInFor&&(n+="refInFor:true,"),e.pre&&(n+="pre:true,"),e.component&&(n+='tag:"'+e.tag+'",');for(var i=0;i<t.dataGenFns.length;i++)n+=t.dataGenFns[i](e);if(e.attrs&&(n+="attrs:"+Ga(e.attrs)+","),e.props&&(n+="domProps:"+Ga(e.props)+","),e.events&&(n+=Da(e.events,!1)+","),e.nativeEvents&&(n+=Da(e.nativeEvents,!0)+","),e.slotTarget&&!e.slotScope&&(n+="slot:"+e.slotTarget+","),e.scopedSlots&&(n+=function(e,t,n){var r=e.for||Object.keys(t).some(function(e){var n=t[e];return n.slotTargetDynamic||n.if||n.for||Ka(n)}),i=!!e.if;if(!r)for(var o=e.parent;o;){if(o.slotScope&&o.slotScope!==ca||o.for){r=!0;break}o.if&&(i=!0),o=o.parent}var a=Object.keys(t).map(function(e){return Ja(t[e],n)}).join(",");return"scopedSlots:_u(["+a+"]"+(r?",null,true":"")+(!r&&i?",null,false,"+function(e){var t=5381,n=e.length;for(;n;)t=33*t^e.charCodeAt(--n);return t>>>0}(a):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var o=function(e,t){var n=e.children[0];if(n&&1===n.type){var r=Pa(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(e){return"function(){"+e+"}"}).join(",")+"]}"}}(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+Ga(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Ka(e){return 1===e.type&&("slot"===e.tag||e.children.some(Ka))}function Ja(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Ua(e,t,Ja,"null");if(e.for&&!e.forProcessed)return za(e,t,Ja);var r=e.slotScope===ca?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(qa(e,t)||"undefined")+":undefined":qa(e,t)||"undefined":Ra(e,t))+"}",o=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+o+"}"}function qa(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?t.maybeComponent(a)?",1":",0":"";return""+(r||Ra)(a,t)+s}var c=n?function(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(1===i.type){if(Wa(i)||i.ifConditions&&i.ifConditions.some(function(e){return Wa(e.block)})){n=2;break}(t(i)||i.ifConditions&&i.ifConditions.some(function(e){return t(e.block)}))&&(n=1)}}return n}(o,t.maybeComponent):0,u=i||Za;return"["+o.map(function(e){return u(e,t)}).join(",")+"]"+(c?","+c:"")}}function Wa(e){return void 0!==e.for||"template"===e.tag||"slot"===e.tag}function Za(e,t){return 1===e.type?Ra(e,t):3===e.type&&e.isComment?(r=e,"_e("+JSON.stringify(r.text)+")"):"_v("+(2===(n=e).type?n.expression:Xa(JSON.stringify(n.text)))+")";var n,r}function Ga(e){for(var t="",n="",r=0;r<e.length;r++){var i=e[r],o=Xa(i.value);i.dynamic?n+=i.name+","+o+",":t+='"'+i.name+'":'+o+","}return t="{"+t.slice(0,-1)+"}",n?"_d("+t+",["+n.slice(0,-1)+"])":t}function Xa(e){return e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b");function Ya(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),S}}function Qa(e){var t=Object.create(null);return function(n,r,i){(r=A({},r)).warn;delete r.warn;var o=r.delimiters?String(r.delimiters)+n:n;if(t[o])return t[o];var a=e(n,r),s={},c=[];return s.render=Ya(a.render,c),s.staticRenderFns=a.staticRenderFns.map(function(e){return Ya(e,c)}),t[o]=s}}var es,ts,ns=(es=function(e,t){var n=la(e.trim(),t);!1!==t.optimize&&ka(n,t);var r=Pa(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}},function(e){function t(t,n){var r=Object.create(e),i=[],o=[];if(n)for(var a in n.modules&&(r.modules=(e.modules||[]).concat(n.modules)),n.directives&&(r.directives=A(Object.create(e.directives||null),n.directives)),n)"modules"!==a&&"directives"!==a&&(r[a]=n[a]);r.warn=function(e,t,n){(n?o:i).push(e)};var s=es(t.trim(),r);return s.errors=i,s.tips=o,s}return{compile:t,compileToFunctions:Qa(t)}})(Ca),rs=(ns.compile,ns.compileToFunctions);function is(e){return(ts=ts||document.createElement("div")).innerHTML=e?'<a href="\n"/>':'<div a="\n"/>',ts.innerHTML.indexOf(" ")>0}var os=!!z&&is(!1),as=!!z&&is(!0),ss=g(function(e){var t=Yn(e);return t&&t.innerHTML}),cs=wn.prototype.$mount;return wn.prototype.$mount=function(e,t){if((e=e&&Yn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ss(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=rs(r,{outputSourceRange:!1,shouldDecodeNewlines:os,shouldDecodeNewlinesForHref:as,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return cs.call(this,e,t)},wn.compile=rs,wn});
|
assets/js/vendor/{vuedraggable.2.14.1.js → vuedraggable.js}
RENAMED
File without changes
|
assets/js/vendor/vuex.2.3.1.js
DELETED
@@ -1,809 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* vuex v2.3.0
|
3 |
-
* (c) 2017 Evan You
|
4 |
-
* @license MIT
|
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.Vuex = factory());
|
10 |
-
}(this, (function () { 'use strict';
|
11 |
-
|
12 |
-
var applyMixin = function (Vue) {
|
13 |
-
var version = Number(Vue.version.split('.')[0]);
|
14 |
-
|
15 |
-
if (version >= 2) {
|
16 |
-
var usesInit = Vue.config._lifecycleHooks.indexOf('init') > -1;
|
17 |
-
Vue.mixin(usesInit ? { init: vuexInit } : { beforeCreate: vuexInit });
|
18 |
-
} else {
|
19 |
-
// override init and inject vuex init procedure
|
20 |
-
// for 1.x backwards compatibility.
|
21 |
-
var _init = Vue.prototype._init;
|
22 |
-
Vue.prototype._init = function (options) {
|
23 |
-
if ( options === void 0 ) options = {};
|
24 |
-
|
25 |
-
options.init = options.init
|
26 |
-
? [vuexInit].concat(options.init)
|
27 |
-
: vuexInit;
|
28 |
-
_init.call(this, options);
|
29 |
-
};
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Vuex init hook, injected into each instances init hooks list.
|
34 |
-
*/
|
35 |
-
|
36 |
-
function vuexInit () {
|
37 |
-
var options = this.$options;
|
38 |
-
// store injection
|
39 |
-
if (options.store) {
|
40 |
-
this.$store = options.store;
|
41 |
-
} else if (options.parent && options.parent.$store) {
|
42 |
-
this.$store = options.parent.$store;
|
43 |
-
}
|
44 |
-
}
|
45 |
-
};
|
46 |
-
|
47 |
-
var devtoolHook =
|
48 |
-
typeof window !== 'undefined' &&
|
49 |
-
window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
50 |
-
|
51 |
-
function devtoolPlugin (store) {
|
52 |
-
if (!devtoolHook) { return }
|
53 |
-
|
54 |
-
store._devtoolHook = devtoolHook;
|
55 |
-
|
56 |
-
devtoolHook.emit('vuex:init', store);
|
57 |
-
|
58 |
-
devtoolHook.on('vuex:travel-to-state', function (targetState) {
|
59 |
-
store.replaceState(targetState);
|
60 |
-
});
|
61 |
-
|
62 |
-
store.subscribe(function (mutation, state) {
|
63 |
-
devtoolHook.emit('vuex:mutation', mutation, state);
|
64 |
-
});
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Get the first item that pass the test
|
69 |
-
* by second argument function
|
70 |
-
*
|
71 |
-
* @param {Array} list
|
72 |
-
* @param {Function} f
|
73 |
-
* @return {*}
|
74 |
-
*/
|
75 |
-
/**
|
76 |
-
* Deep copy the given object considering circular structure.
|
77 |
-
* This function caches all nested objects and its copies.
|
78 |
-
* If it detects circular structure, use cached copy to avoid infinite loop.
|
79 |
-
*
|
80 |
-
* @param {*} obj
|
81 |
-
* @param {Array<Object>} cache
|
82 |
-
* @return {*}
|
83 |
-
*/
|
84 |
-
|
85 |
-
|
86 |
-
/**
|
87 |
-
* forEach for object
|
88 |
-
*/
|
89 |
-
function forEachValue (obj, fn) {
|
90 |
-
Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
|
91 |
-
}
|
92 |
-
|
93 |
-
function isObject (obj) {
|
94 |
-
return obj !== null && typeof obj === 'object'
|
95 |
-
}
|
96 |
-
|
97 |
-
function isPromise (val) {
|
98 |
-
return val && typeof val.then === 'function'
|
99 |
-
}
|
100 |
-
|
101 |
-
function assert (condition, msg) {
|
102 |
-
if (!condition) { throw new Error(("[vuex] " + msg)) }
|
103 |
-
}
|
104 |
-
|
105 |
-
var Module = function Module (rawModule, runtime) {
|
106 |
-
this.runtime = runtime;
|
107 |
-
this._children = Object.create(null);
|
108 |
-
this._rawModule = rawModule;
|
109 |
-
var rawState = rawModule.state;
|
110 |
-
this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
|
111 |
-
};
|
112 |
-
|
113 |
-
var prototypeAccessors$1 = { namespaced: {} };
|
114 |
-
|
115 |
-
prototypeAccessors$1.namespaced.get = function () {
|
116 |
-
return !!this._rawModule.namespaced
|
117 |
-
};
|
118 |
-
|
119 |
-
Module.prototype.addChild = function addChild (key, module) {
|
120 |
-
this._children[key] = module;
|
121 |
-
};
|
122 |
-
|
123 |
-
Module.prototype.removeChild = function removeChild (key) {
|
124 |
-
delete this._children[key];
|
125 |
-
};
|
126 |
-
|
127 |
-
Module.prototype.getChild = function getChild (key) {
|
128 |
-
return this._children[key]
|
129 |
-
};
|
130 |
-
|
131 |
-
Module.prototype.update = function update (rawModule) {
|
132 |
-
this._rawModule.namespaced = rawModule.namespaced;
|
133 |
-
if (rawModule.actions) {
|
134 |
-
this._rawModule.actions = rawModule.actions;
|
135 |
-
}
|
136 |
-
if (rawModule.mutations) {
|
137 |
-
this._rawModule.mutations = rawModule.mutations;
|
138 |
-
}
|
139 |
-
if (rawModule.getters) {
|
140 |
-
this._rawModule.getters = rawModule.getters;
|
141 |
-
}
|
142 |
-
};
|
143 |
-
|
144 |
-
Module.prototype.forEachChild = function forEachChild (fn) {
|
145 |
-
forEachValue(this._children, fn);
|
146 |
-
};
|
147 |
-
|
148 |
-
Module.prototype.forEachGetter = function forEachGetter (fn) {
|
149 |
-
if (this._rawModule.getters) {
|
150 |
-
forEachValue(this._rawModule.getters, fn);
|
151 |
-
}
|
152 |
-
};
|
153 |
-
|
154 |
-
Module.prototype.forEachAction = function forEachAction (fn) {
|
155 |
-
if (this._rawModule.actions) {
|
156 |
-
forEachValue(this._rawModule.actions, fn);
|
157 |
-
}
|
158 |
-
};
|
159 |
-
|
160 |
-
Module.prototype.forEachMutation = function forEachMutation (fn) {
|
161 |
-
if (this._rawModule.mutations) {
|
162 |
-
forEachValue(this._rawModule.mutations, fn);
|
163 |
-
}
|
164 |
-
};
|
165 |
-
|
166 |
-
Object.defineProperties( Module.prototype, prototypeAccessors$1 );
|
167 |
-
|
168 |
-
var ModuleCollection = function ModuleCollection (rawRootModule) {
|
169 |
-
var this$1 = this;
|
170 |
-
|
171 |
-
// register root module (Vuex.Store options)
|
172 |
-
this.root = new Module(rawRootModule, false);
|
173 |
-
|
174 |
-
// register all nested modules
|
175 |
-
if (rawRootModule.modules) {
|
176 |
-
forEachValue(rawRootModule.modules, function (rawModule, key) {
|
177 |
-
this$1.register([key], rawModule, false);
|
178 |
-
});
|
179 |
-
}
|
180 |
-
};
|
181 |
-
|
182 |
-
ModuleCollection.prototype.get = function get (path) {
|
183 |
-
return path.reduce(function (module, key) {
|
184 |
-
return module.getChild(key)
|
185 |
-
}, this.root)
|
186 |
-
};
|
187 |
-
|
188 |
-
ModuleCollection.prototype.getNamespace = function getNamespace (path) {
|
189 |
-
var module = this.root;
|
190 |
-
return path.reduce(function (namespace, key) {
|
191 |
-
module = module.getChild(key);
|
192 |
-
return namespace + (module.namespaced ? key + '/' : '')
|
193 |
-
}, '')
|
194 |
-
};
|
195 |
-
|
196 |
-
ModuleCollection.prototype.update = function update$1 (rawRootModule) {
|
197 |
-
update(this.root, rawRootModule);
|
198 |
-
};
|
199 |
-
|
200 |
-
ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
|
201 |
-
var this$1 = this;
|
202 |
-
if ( runtime === void 0 ) runtime = true;
|
203 |
-
|
204 |
-
var parent = this.get(path.slice(0, -1));
|
205 |
-
var newModule = new Module(rawModule, runtime);
|
206 |
-
parent.addChild(path[path.length - 1], newModule);
|
207 |
-
|
208 |
-
// register nested modules
|
209 |
-
if (rawModule.modules) {
|
210 |
-
forEachValue(rawModule.modules, function (rawChildModule, key) {
|
211 |
-
this$1.register(path.concat(key), rawChildModule, runtime);
|
212 |
-
});
|
213 |
-
}
|
214 |
-
};
|
215 |
-
|
216 |
-
ModuleCollection.prototype.unregister = function unregister (path) {
|
217 |
-
var parent = this.get(path.slice(0, -1));
|
218 |
-
var key = path[path.length - 1];
|
219 |
-
if (!parent.getChild(key).runtime) { return }
|
220 |
-
|
221 |
-
parent.removeChild(key);
|
222 |
-
};
|
223 |
-
|
224 |
-
function update (targetModule, newModule) {
|
225 |
-
// update target module
|
226 |
-
targetModule.update(newModule);
|
227 |
-
|
228 |
-
// update nested modules
|
229 |
-
if (newModule.modules) {
|
230 |
-
for (var key in newModule.modules) {
|
231 |
-
if (!targetModule.getChild(key)) {
|
232 |
-
console.warn(
|
233 |
-
"[vuex] trying to add a new module '" + key + "' on hot reloading, " +
|
234 |
-
'manual reload is needed'
|
235 |
-
);
|
236 |
-
return
|
237 |
-
}
|
238 |
-
update(targetModule.getChild(key), newModule.modules[key]);
|
239 |
-
}
|
240 |
-
}
|
241 |
-
}
|
242 |
-
|
243 |
-
var Vue; // bind on install
|
244 |
-
|
245 |
-
var Store = function Store (options) {
|
246 |
-
var this$1 = this;
|
247 |
-
if ( options === void 0 ) options = {};
|
248 |
-
|
249 |
-
assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
|
250 |
-
assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
|
251 |
-
|
252 |
-
var state = options.state; if ( state === void 0 ) state = {};
|
253 |
-
var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
|
254 |
-
var strict = options.strict; if ( strict === void 0 ) strict = false;
|
255 |
-
|
256 |
-
// store internal state
|
257 |
-
this._committing = false;
|
258 |
-
this._actions = Object.create(null);
|
259 |
-
this._mutations = Object.create(null);
|
260 |
-
this._wrappedGetters = Object.create(null);
|
261 |
-
this._modules = new ModuleCollection(options);
|
262 |
-
this._modulesNamespaceMap = Object.create(null);
|
263 |
-
this._subscribers = [];
|
264 |
-
this._watcherVM = new Vue();
|
265 |
-
|
266 |
-
// bind commit and dispatch to self
|
267 |
-
var store = this;
|
268 |
-
var ref = this;
|
269 |
-
var dispatch = ref.dispatch;
|
270 |
-
var commit = ref.commit;
|
271 |
-
this.dispatch = function boundDispatch (type, payload) {
|
272 |
-
return dispatch.call(store, type, payload)
|
273 |
-
};
|
274 |
-
this.commit = function boundCommit (type, payload, options) {
|
275 |
-
return commit.call(store, type, payload, options)
|
276 |
-
};
|
277 |
-
|
278 |
-
// strict mode
|
279 |
-
this.strict = strict;
|
280 |
-
|
281 |
-
// init root module.
|
282 |
-
// this also recursively registers all sub-modules
|
283 |
-
// and collects all module getters inside this._wrappedGetters
|
284 |
-
installModule(this, state, [], this._modules.root);
|
285 |
-
|
286 |
-
// initialize the store vm, which is responsible for the reactivity
|
287 |
-
// (also registers _wrappedGetters as computed properties)
|
288 |
-
resetStoreVM(this, state);
|
289 |
-
|
290 |
-
// apply plugins
|
291 |
-
plugins.concat(devtoolPlugin).forEach(function (plugin) { return plugin(this$1); });
|
292 |
-
};
|
293 |
-
|
294 |
-
var prototypeAccessors = { state: {} };
|
295 |
-
|
296 |
-
prototypeAccessors.state.get = function () {
|
297 |
-
return this._vm._data.$$state
|
298 |
-
};
|
299 |
-
|
300 |
-
prototypeAccessors.state.set = function (v) {
|
301 |
-
assert(false, "Use store.replaceState() to explicit replace store state.");
|
302 |
-
};
|
303 |
-
|
304 |
-
Store.prototype.commit = function commit (_type, _payload, _options) {
|
305 |
-
var this$1 = this;
|
306 |
-
|
307 |
-
// check object-style commit
|
308 |
-
var ref = unifyObjectStyle(_type, _payload, _options);
|
309 |
-
var type = ref.type;
|
310 |
-
var payload = ref.payload;
|
311 |
-
var options = ref.options;
|
312 |
-
|
313 |
-
var mutation = { type: type, payload: payload };
|
314 |
-
var entry = this._mutations[type];
|
315 |
-
if (!entry) {
|
316 |
-
console.error(("[vuex] unknown mutation type: " + type));
|
317 |
-
return
|
318 |
-
}
|
319 |
-
this._withCommit(function () {
|
320 |
-
entry.forEach(function commitIterator (handler) {
|
321 |
-
handler(payload);
|
322 |
-
});
|
323 |
-
});
|
324 |
-
this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); });
|
325 |
-
|
326 |
-
if (options && options.silent) {
|
327 |
-
console.warn(
|
328 |
-
"[vuex] mutation type: " + type + ". Silent option has been removed. " +
|
329 |
-
'Use the filter functionality in the vue-devtools'
|
330 |
-
);
|
331 |
-
}
|
332 |
-
};
|
333 |
-
|
334 |
-
Store.prototype.dispatch = function dispatch (_type, _payload) {
|
335 |
-
// check object-style dispatch
|
336 |
-
var ref = unifyObjectStyle(_type, _payload);
|
337 |
-
var type = ref.type;
|
338 |
-
var payload = ref.payload;
|
339 |
-
|
340 |
-
var entry = this._actions[type];
|
341 |
-
if (!entry) {
|
342 |
-
console.error(("[vuex] unknown action type: " + type));
|
343 |
-
return
|
344 |
-
}
|
345 |
-
return entry.length > 1
|
346 |
-
? Promise.all(entry.map(function (handler) { return handler(payload); }))
|
347 |
-
: entry[0](payload)
|
348 |
-
};
|
349 |
-
|
350 |
-
Store.prototype.subscribe = function subscribe (fn) {
|
351 |
-
var subs = this._subscribers;
|
352 |
-
if (subs.indexOf(fn) < 0) {
|
353 |
-
subs.push(fn);
|
354 |
-
}
|
355 |
-
return function () {
|
356 |
-
var i = subs.indexOf(fn);
|
357 |
-
if (i > -1) {
|
358 |
-
subs.splice(i, 1);
|
359 |
-
}
|
360 |
-
}
|
361 |
-
};
|
362 |
-
|
363 |
-
Store.prototype.watch = function watch (getter, cb, options) {
|
364 |
-
var this$1 = this;
|
365 |
-
|
366 |
-
assert(typeof getter === 'function', "store.watch only accepts a function.");
|
367 |
-
return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
|
368 |
-
};
|
369 |
-
|
370 |
-
Store.prototype.replaceState = function replaceState (state) {
|
371 |
-
var this$1 = this;
|
372 |
-
|
373 |
-
this._withCommit(function () {
|
374 |
-
this$1._vm._data.$$state = state;
|
375 |
-
});
|
376 |
-
};
|
377 |
-
|
378 |
-
Store.prototype.registerModule = function registerModule (path, rawModule) {
|
379 |
-
if (typeof path === 'string') { path = [path]; }
|
380 |
-
assert(Array.isArray(path), "module path must be a string or an Array.");
|
381 |
-
this._modules.register(path, rawModule);
|
382 |
-
installModule(this, this.state, path, this._modules.get(path));
|
383 |
-
// reset store to update getters...
|
384 |
-
resetStoreVM(this, this.state);
|
385 |
-
};
|
386 |
-
|
387 |
-
Store.prototype.unregisterModule = function unregisterModule (path) {
|
388 |
-
var this$1 = this;
|
389 |
-
|
390 |
-
if (typeof path === 'string') { path = [path]; }
|
391 |
-
assert(Array.isArray(path), "module path must be a string or an Array.");
|
392 |
-
this._modules.unregister(path);
|
393 |
-
this._withCommit(function () {
|
394 |
-
var parentState = getNestedState(this$1.state, path.slice(0, -1));
|
395 |
-
Vue.delete(parentState, path[path.length - 1]);
|
396 |
-
});
|
397 |
-
resetStore(this);
|
398 |
-
};
|
399 |
-
|
400 |
-
Store.prototype.hotUpdate = function hotUpdate (newOptions) {
|
401 |
-
this._modules.update(newOptions);
|
402 |
-
resetStore(this, true);
|
403 |
-
};
|
404 |
-
|
405 |
-
Store.prototype._withCommit = function _withCommit (fn) {
|
406 |
-
var committing = this._committing;
|
407 |
-
this._committing = true;
|
408 |
-
fn();
|
409 |
-
this._committing = committing;
|
410 |
-
};
|
411 |
-
|
412 |
-
Object.defineProperties( Store.prototype, prototypeAccessors );
|
413 |
-
|
414 |
-
function resetStore (store, hot) {
|
415 |
-
store._actions = Object.create(null);
|
416 |
-
store._mutations = Object.create(null);
|
417 |
-
store._wrappedGetters = Object.create(null);
|
418 |
-
store._modulesNamespaceMap = Object.create(null);
|
419 |
-
var state = store.state;
|
420 |
-
// init all modules
|
421 |
-
installModule(store, state, [], store._modules.root, true);
|
422 |
-
// reset vm
|
423 |
-
resetStoreVM(store, state, hot);
|
424 |
-
}
|
425 |
-
|
426 |
-
function resetStoreVM (store, state, hot) {
|
427 |
-
var oldVm = store._vm;
|
428 |
-
|
429 |
-
// bind store public getters
|
430 |
-
store.getters = {};
|
431 |
-
var wrappedGetters = store._wrappedGetters;
|
432 |
-
var computed = {};
|
433 |
-
forEachValue(wrappedGetters, function (fn, key) {
|
434 |
-
// use computed to leverage its lazy-caching mechanism
|
435 |
-
computed[key] = function () { return fn(store); };
|
436 |
-
Object.defineProperty(store.getters, key, {
|
437 |
-
get: function () { return store._vm[key]; },
|
438 |
-
enumerable: true // for local getters
|
439 |
-
});
|
440 |
-
});
|
441 |
-
|
442 |
-
// use a Vue instance to store the state tree
|
443 |
-
// suppress warnings just in case the user has added
|
444 |
-
// some funky global mixins
|
445 |
-
var silent = Vue.config.silent;
|
446 |
-
Vue.config.silent = true;
|
447 |
-
store._vm = new Vue({
|
448 |
-
data: {
|
449 |
-
$$state: state
|
450 |
-
},
|
451 |
-
computed: computed
|
452 |
-
});
|
453 |
-
Vue.config.silent = silent;
|
454 |
-
|
455 |
-
// enable strict mode for new vm
|
456 |
-
if (store.strict) {
|
457 |
-
enableStrictMode(store);
|
458 |
-
}
|
459 |
-
|
460 |
-
if (oldVm) {
|
461 |
-
if (hot) {
|
462 |
-
// dispatch changes in all subscribed watchers
|
463 |
-
// to force getter re-evaluation for hot reloading.
|
464 |
-
store._withCommit(function () {
|
465 |
-
oldVm._data.$$state = null;
|
466 |
-
});
|
467 |
-
}
|
468 |
-
Vue.nextTick(function () { return oldVm.$destroy(); });
|
469 |
-
}
|
470 |
-
}
|
471 |
-
|
472 |
-
function installModule (store, rootState, path, module, hot) {
|
473 |
-
var isRoot = !path.length;
|
474 |
-
var namespace = store._modules.getNamespace(path);
|
475 |
-
|
476 |
-
// register in namespace map
|
477 |
-
if (module.namespaced) {
|
478 |
-
store._modulesNamespaceMap[namespace] = module;
|
479 |
-
}
|
480 |
-
|
481 |
-
// set state
|
482 |
-
if (!isRoot && !hot) {
|
483 |
-
var parentState = getNestedState(rootState, path.slice(0, -1));
|
484 |
-
var moduleName = path[path.length - 1];
|
485 |
-
store._withCommit(function () {
|
486 |
-
Vue.set(parentState, moduleName, module.state);
|
487 |
-
});
|
488 |
-
}
|
489 |
-
|
490 |
-
var local = module.context = makeLocalContext(store, namespace, path);
|
491 |
-
|
492 |
-
module.forEachMutation(function (mutation, key) {
|
493 |
-
var namespacedType = namespace + key;
|
494 |
-
registerMutation(store, namespacedType, mutation, local);
|
495 |
-
});
|
496 |
-
|
497 |
-
module.forEachAction(function (action, key) {
|
498 |
-
var namespacedType = namespace + key;
|
499 |
-
registerAction(store, namespacedType, action, local);
|
500 |
-
});
|
501 |
-
|
502 |
-
module.forEachGetter(function (getter, key) {
|
503 |
-
var namespacedType = namespace + key;
|
504 |
-
registerGetter(store, namespacedType, getter, local);
|
505 |
-
});
|
506 |
-
|
507 |
-
module.forEachChild(function (child, key) {
|
508 |
-
installModule(store, rootState, path.concat(key), child, hot);
|
509 |
-
});
|
510 |
-
}
|
511 |
-
|
512 |
-
/**
|
513 |
-
* make localized dispatch, commit, getters and state
|
514 |
-
* if there is no namespace, just use root ones
|
515 |
-
*/
|
516 |
-
function makeLocalContext (store, namespace, path) {
|
517 |
-
var noNamespace = namespace === '';
|
518 |
-
|
519 |
-
var local = {
|
520 |
-
dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
|
521 |
-
var args = unifyObjectStyle(_type, _payload, _options);
|
522 |
-
var payload = args.payload;
|
523 |
-
var options = args.options;
|
524 |
-
var type = args.type;
|
525 |
-
|
526 |
-
if (!options || !options.root) {
|
527 |
-
type = namespace + type;
|
528 |
-
if (!store._actions[type]) {
|
529 |
-
console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
|
530 |
-
return
|
531 |
-
}
|
532 |
-
}
|
533 |
-
|
534 |
-
return store.dispatch(type, payload)
|
535 |
-
},
|
536 |
-
|
537 |
-
commit: noNamespace ? store.commit : function (_type, _payload, _options) {
|
538 |
-
var args = unifyObjectStyle(_type, _payload, _options);
|
539 |
-
var payload = args.payload;
|
540 |
-
var options = args.options;
|
541 |
-
var type = args.type;
|
542 |
-
|
543 |
-
if (!options || !options.root) {
|
544 |
-
type = namespace + type;
|
545 |
-
if (!store._mutations[type]) {
|
546 |
-
console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
|
547 |
-
return
|
548 |
-
}
|
549 |
-
}
|
550 |
-
|
551 |
-
store.commit(type, payload, options);
|
552 |
-
}
|
553 |
-
};
|
554 |
-
|
555 |
-
// getters and state object must be gotten lazily
|
556 |
-
// because they will be changed by vm update
|
557 |
-
Object.defineProperties(local, {
|
558 |
-
getters: {
|
559 |
-
get: noNamespace
|
560 |
-
? function () { return store.getters; }
|
561 |
-
: function () { return makeLocalGetters(store, namespace); }
|
562 |
-
},
|
563 |
-
state: {
|
564 |
-
get: function () { return getNestedState(store.state, path); }
|
565 |
-
}
|
566 |
-
});
|
567 |
-
|
568 |
-
return local
|
569 |
-
}
|
570 |
-
|
571 |
-
function makeLocalGetters (store, namespace) {
|
572 |
-
var gettersProxy = {};
|
573 |
-
|
574 |
-
var splitPos = namespace.length;
|
575 |
-
Object.keys(store.getters).forEach(function (type) {
|
576 |
-
// skip if the target getter is not match this namespace
|
577 |
-
if (type.slice(0, splitPos) !== namespace) { return }
|
578 |
-
|
579 |
-
// extract local getter type
|
580 |
-
var localType = type.slice(splitPos);
|
581 |
-
|
582 |
-
// Add a port to the getters proxy.
|
583 |
-
// Define as getter property because
|
584 |
-
// we do not want to evaluate the getters in this time.
|
585 |
-
Object.defineProperty(gettersProxy, localType, {
|
586 |
-
get: function () { return store.getters[type]; },
|
587 |
-
enumerable: true
|
588 |
-
});
|
589 |
-
});
|
590 |
-
|
591 |
-
return gettersProxy
|
592 |
-
}
|
593 |
-
|
594 |
-
function registerMutation (store, type, handler, local) {
|
595 |
-
var entry = store._mutations[type] || (store._mutations[type] = []);
|
596 |
-
entry.push(function wrappedMutationHandler (payload) {
|
597 |
-
handler(local.state, payload);
|
598 |
-
});
|
599 |
-
}
|
600 |
-
|
601 |
-
function registerAction (store, type, handler, local) {
|
602 |
-
var entry = store._actions[type] || (store._actions[type] = []);
|
603 |
-
entry.push(function wrappedActionHandler (payload, cb) {
|
604 |
-
var res = handler({
|
605 |
-
dispatch: local.dispatch,
|
606 |
-
commit: local.commit,
|
607 |
-
getters: local.getters,
|
608 |
-
state: local.state,
|
609 |
-
rootGetters: store.getters,
|
610 |
-
rootState: store.state
|
611 |
-
}, payload, cb);
|
612 |
-
if (!isPromise(res)) {
|
613 |
-
res = Promise.resolve(res);
|
614 |
-
}
|
615 |
-
if (store._devtoolHook) {
|
616 |
-
return res.catch(function (err) {
|
617 |
-
store._devtoolHook.emit('vuex:error', err);
|
618 |
-
throw err
|
619 |
-
})
|
620 |
-
} else {
|
621 |
-
return res
|
622 |
-
}
|
623 |
-
});
|
624 |
-
}
|
625 |
-
|
626 |
-
function registerGetter (store, type, rawGetter, local) {
|
627 |
-
if (store._wrappedGetters[type]) {
|
628 |
-
console.error(("[vuex] duplicate getter key: " + type));
|
629 |
-
return
|
630 |
-
}
|
631 |
-
store._wrappedGetters[type] = function wrappedGetter (store) {
|
632 |
-
return rawGetter(
|
633 |
-
local.state, // local state
|
634 |
-
local.getters, // local getters
|
635 |
-
store.state, // root state
|
636 |
-
store.getters // root getters
|
637 |
-
)
|
638 |
-
};
|
639 |
-
}
|
640 |
-
|
641 |
-
function enableStrictMode (store) {
|
642 |
-
store._vm.$watch(function () { return this._data.$$state }, function () {
|
643 |
-
assert(store._committing, "Do not mutate vuex store state outside mutation handlers.");
|
644 |
-
}, { deep: true, sync: true });
|
645 |
-
}
|
646 |
-
|
647 |
-
function getNestedState (state, path) {
|
648 |
-
return path.length
|
649 |
-
? path.reduce(function (state, key) { return state[key]; }, state)
|
650 |
-
: state
|
651 |
-
}
|
652 |
-
|
653 |
-
function unifyObjectStyle (type, payload, options) {
|
654 |
-
if (isObject(type) && type.type) {
|
655 |
-
options = payload;
|
656 |
-
payload = type;
|
657 |
-
type = type.type;
|
658 |
-
}
|
659 |
-
|
660 |
-
assert(typeof type === 'string', ("Expects string as the type, but found " + (typeof type) + "."));
|
661 |
-
|
662 |
-
return { type: type, payload: payload, options: options }
|
663 |
-
}
|
664 |
-
|
665 |
-
function install (_Vue) {
|
666 |
-
if (Vue) {
|
667 |
-
console.error(
|
668 |
-
'[vuex] already installed. Vue.use(Vuex) should be called only once.'
|
669 |
-
);
|
670 |
-
return
|
671 |
-
}
|
672 |
-
Vue = _Vue;
|
673 |
-
applyMixin(Vue);
|
674 |
-
}
|
675 |
-
|
676 |
-
// auto install in dist mode
|
677 |
-
if (typeof window !== 'undefined' && window.Vue) {
|
678 |
-
install(window.Vue);
|
679 |
-
}
|
680 |
-
|
681 |
-
var mapState = normalizeNamespace(function (namespace, states) {
|
682 |
-
var res = {};
|
683 |
-
normalizeMap(states).forEach(function (ref) {
|
684 |
-
var key = ref.key;
|
685 |
-
var val = ref.val;
|
686 |
-
|
687 |
-
res[key] = function mappedState () {
|
688 |
-
var state = this.$store.state;
|
689 |
-
var getters = this.$store.getters;
|
690 |
-
if (namespace) {
|
691 |
-
var module = getModuleByNamespace(this.$store, 'mapState', namespace);
|
692 |
-
if (!module) {
|
693 |
-
return
|
694 |
-
}
|
695 |
-
state = module.context.state;
|
696 |
-
getters = module.context.getters;
|
697 |
-
}
|
698 |
-
return typeof val === 'function'
|
699 |
-
? val.call(this, state, getters)
|
700 |
-
: state[val]
|
701 |
-
};
|
702 |
-
// mark vuex getter for devtools
|
703 |
-
res[key].vuex = true;
|
704 |
-
});
|
705 |
-
return res
|
706 |
-
});
|
707 |
-
|
708 |
-
var mapMutations = normalizeNamespace(function (namespace, mutations) {
|
709 |
-
var res = {};
|
710 |
-
normalizeMap(mutations).forEach(function (ref) {
|
711 |
-
var key = ref.key;
|
712 |
-
var val = ref.val;
|
713 |
-
|
714 |
-
val = namespace + val;
|
715 |
-
res[key] = function mappedMutation () {
|
716 |
-
var args = [], len = arguments.length;
|
717 |
-
while ( len-- ) args[ len ] = arguments[ len ];
|
718 |
-
|
719 |
-
if (namespace && !getModuleByNamespace(this.$store, 'mapMutations', namespace)) {
|
720 |
-
return
|
721 |
-
}
|
722 |
-
return this.$store.commit.apply(this.$store, [val].concat(args))
|
723 |
-
};
|
724 |
-
});
|
725 |
-
return res
|
726 |
-
});
|
727 |
-
|
728 |
-
var mapGetters = normalizeNamespace(function (namespace, getters) {
|
729 |
-
var res = {};
|
730 |
-
normalizeMap(getters).forEach(function (ref) {
|
731 |
-
var key = ref.key;
|
732 |
-
var val = ref.val;
|
733 |
-
|
734 |
-
val = namespace + val;
|
735 |
-
res[key] = function mappedGetter () {
|
736 |
-
if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
|
737 |
-
return
|
738 |
-
}
|
739 |
-
if (!(val in this.$store.getters)) {
|
740 |
-
console.error(("[vuex] unknown getter: " + val));
|
741 |
-
return
|
742 |
-
}
|
743 |
-
return this.$store.getters[val]
|
744 |
-
};
|
745 |
-
// mark vuex getter for devtools
|
746 |
-
res[key].vuex = true;
|
747 |
-
});
|
748 |
-
return res
|
749 |
-
});
|
750 |
-
|
751 |
-
var mapActions = normalizeNamespace(function (namespace, actions) {
|
752 |
-
var res = {};
|
753 |
-
normalizeMap(actions).forEach(function (ref) {
|
754 |
-
var key = ref.key;
|
755 |
-
var val = ref.val;
|
756 |
-
|
757 |
-
val = namespace + val;
|
758 |
-
res[key] = function mappedAction () {
|
759 |
-
var args = [], len = arguments.length;
|
760 |
-
while ( len-- ) args[ len ] = arguments[ len ];
|
761 |
-
|
762 |
-
if (namespace && !getModuleByNamespace(this.$store, 'mapActions', namespace)) {
|
763 |
-
return
|
764 |
-
}
|
765 |
-
return this.$store.dispatch.apply(this.$store, [val].concat(args))
|
766 |
-
};
|
767 |
-
});
|
768 |
-
return res
|
769 |
-
});
|
770 |
-
|
771 |
-
function normalizeMap (map) {
|
772 |
-
return Array.isArray(map)
|
773 |
-
? map.map(function (key) { return ({ key: key, val: key }); })
|
774 |
-
: Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
|
775 |
-
}
|
776 |
-
|
777 |
-
function normalizeNamespace (fn) {
|
778 |
-
return function (namespace, map) {
|
779 |
-
if (typeof namespace !== 'string') {
|
780 |
-
map = namespace;
|
781 |
-
namespace = '';
|
782 |
-
} else if (namespace.charAt(namespace.length - 1) !== '/') {
|
783 |
-
namespace += '/';
|
784 |
-
}
|
785 |
-
return fn(namespace, map)
|
786 |
-
}
|
787 |
-
}
|
788 |
-
|
789 |
-
function getModuleByNamespace (store, helper, namespace) {
|
790 |
-
var module = store._modulesNamespaceMap[namespace];
|
791 |
-
if (!module) {
|
792 |
-
console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
|
793 |
-
}
|
794 |
-
return module
|
795 |
-
}
|
796 |
-
|
797 |
-
var index = {
|
798 |
-
Store: Store,
|
799 |
-
install: install,
|
800 |
-
version: '2.3.0',
|
801 |
-
mapState: mapState,
|
802 |
-
mapMutations: mapMutations,
|
803 |
-
mapGetters: mapGetters,
|
804 |
-
mapActions: mapActions
|
805 |
-
};
|
806 |
-
|
807 |
-
return index;
|
808 |
-
|
809 |
-
})));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/vuex.js
ADDED
@@ -0,0 +1,1005 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* vuex v3.1.0
|
3 |
+
* (c) 2019 Evan You
|
4 |
+
* @license MIT
|
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.Vuex = factory());
|
10 |
+
}(this, function () { 'use strict';
|
11 |
+
|
12 |
+
function applyMixin (Vue) {
|
13 |
+
var version = Number(Vue.version.split('.')[0]);
|
14 |
+
|
15 |
+
if (version >= 2) {
|
16 |
+
Vue.mixin({ beforeCreate: vuexInit });
|
17 |
+
} else {
|
18 |
+
// override init and inject vuex init procedure
|
19 |
+
// for 1.x backwards compatibility.
|
20 |
+
var _init = Vue.prototype._init;
|
21 |
+
Vue.prototype._init = function (options) {
|
22 |
+
if ( options === void 0 ) options = {};
|
23 |
+
|
24 |
+
options.init = options.init
|
25 |
+
? [vuexInit].concat(options.init)
|
26 |
+
: vuexInit;
|
27 |
+
_init.call(this, options);
|
28 |
+
};
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Vuex init hook, injected into each instances init hooks list.
|
33 |
+
*/
|
34 |
+
|
35 |
+
function vuexInit () {
|
36 |
+
var options = this.$options;
|
37 |
+
// store injection
|
38 |
+
if (options.store) {
|
39 |
+
this.$store = typeof options.store === 'function'
|
40 |
+
? options.store()
|
41 |
+
: options.store;
|
42 |
+
} else if (options.parent && options.parent.$store) {
|
43 |
+
this.$store = options.parent.$store;
|
44 |
+
}
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
var devtoolHook =
|
49 |
+
typeof window !== 'undefined' &&
|
50 |
+
window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
51 |
+
|
52 |
+
function devtoolPlugin (store) {
|
53 |
+
if (!devtoolHook) { return }
|
54 |
+
|
55 |
+
store._devtoolHook = devtoolHook;
|
56 |
+
|
57 |
+
devtoolHook.emit('vuex:init', store);
|
58 |
+
|
59 |
+
devtoolHook.on('vuex:travel-to-state', function (targetState) {
|
60 |
+
store.replaceState(targetState);
|
61 |
+
});
|
62 |
+
|
63 |
+
store.subscribe(function (mutation, state) {
|
64 |
+
devtoolHook.emit('vuex:mutation', mutation, state);
|
65 |
+
});
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Get the first item that pass the test
|
70 |
+
* by second argument function
|
71 |
+
*
|
72 |
+
* @param {Array} list
|
73 |
+
* @param {Function} f
|
74 |
+
* @return {*}
|
75 |
+
*/
|
76 |
+
|
77 |
+
/**
|
78 |
+
* forEach for object
|
79 |
+
*/
|
80 |
+
function forEachValue (obj, fn) {
|
81 |
+
Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
|
82 |
+
}
|
83 |
+
|
84 |
+
function isObject (obj) {
|
85 |
+
return obj !== null && typeof obj === 'object'
|
86 |
+
}
|
87 |
+
|
88 |
+
function isPromise (val) {
|
89 |
+
return val && typeof val.then === 'function'
|
90 |
+
}
|
91 |
+
|
92 |
+
function assert (condition, msg) {
|
93 |
+
if (!condition) { throw new Error(("[vuex] " + msg)) }
|
94 |
+
}
|
95 |
+
|
96 |
+
// Base data struct for store's module, package with some attribute and method
|
97 |
+
var Module = function Module (rawModule, runtime) {
|
98 |
+
this.runtime = runtime;
|
99 |
+
// Store some children item
|
100 |
+
this._children = Object.create(null);
|
101 |
+
// Store the origin module object which passed by programmer
|
102 |
+
this._rawModule = rawModule;
|
103 |
+
var rawState = rawModule.state;
|
104 |
+
|
105 |
+
// Store the origin module's state
|
106 |
+
this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
|
107 |
+
};
|
108 |
+
|
109 |
+
var prototypeAccessors = { namespaced: { configurable: true } };
|
110 |
+
|
111 |
+
prototypeAccessors.namespaced.get = function () {
|
112 |
+
return !!this._rawModule.namespaced
|
113 |
+
};
|
114 |
+
|
115 |
+
Module.prototype.addChild = function addChild (key, module) {
|
116 |
+
this._children[key] = module;
|
117 |
+
};
|
118 |
+
|
119 |
+
Module.prototype.removeChild = function removeChild (key) {
|
120 |
+
delete this._children[key];
|
121 |
+
};
|
122 |
+
|
123 |
+
Module.prototype.getChild = function getChild (key) {
|
124 |
+
return this._children[key]
|
125 |
+
};
|
126 |
+
|
127 |
+
Module.prototype.update = function update (rawModule) {
|
128 |
+
this._rawModule.namespaced = rawModule.namespaced;
|
129 |
+
if (rawModule.actions) {
|
130 |
+
this._rawModule.actions = rawModule.actions;
|
131 |
+
}
|
132 |
+
if (rawModule.mutations) {
|
133 |
+
this._rawModule.mutations = rawModule.mutations;
|
134 |
+
}
|
135 |
+
if (rawModule.getters) {
|
136 |
+
this._rawModule.getters = rawModule.getters;
|
137 |
+
}
|
138 |
+
};
|
139 |
+
|
140 |
+
Module.prototype.forEachChild = function forEachChild (fn) {
|
141 |
+
forEachValue(this._children, fn);
|
142 |
+
};
|
143 |
+
|
144 |
+
Module.prototype.forEachGetter = function forEachGetter (fn) {
|
145 |
+
if (this._rawModule.getters) {
|
146 |
+
forEachValue(this._rawModule.getters, fn);
|
147 |
+
}
|
148 |
+
};
|
149 |
+
|
150 |
+
Module.prototype.forEachAction = function forEachAction (fn) {
|
151 |
+
if (this._rawModule.actions) {
|
152 |
+
forEachValue(this._rawModule.actions, fn);
|
153 |
+
}
|
154 |
+
};
|
155 |
+
|
156 |
+
Module.prototype.forEachMutation = function forEachMutation (fn) {
|
157 |
+
if (this._rawModule.mutations) {
|
158 |
+
forEachValue(this._rawModule.mutations, fn);
|
159 |
+
}
|
160 |
+
};
|
161 |
+
|
162 |
+
Object.defineProperties( Module.prototype, prototypeAccessors );
|
163 |
+
|
164 |
+
var ModuleCollection = function ModuleCollection (rawRootModule) {
|
165 |
+
// register root module (Vuex.Store options)
|
166 |
+
this.register([], rawRootModule, false);
|
167 |
+
};
|
168 |
+
|
169 |
+
ModuleCollection.prototype.get = function get (path) {
|
170 |
+
return path.reduce(function (module, key) {
|
171 |
+
return module.getChild(key)
|
172 |
+
}, this.root)
|
173 |
+
};
|
174 |
+
|
175 |
+
ModuleCollection.prototype.getNamespace = function getNamespace (path) {
|
176 |
+
var module = this.root;
|
177 |
+
return path.reduce(function (namespace, key) {
|
178 |
+
module = module.getChild(key);
|
179 |
+
return namespace + (module.namespaced ? key + '/' : '')
|
180 |
+
}, '')
|
181 |
+
};
|
182 |
+
|
183 |
+
ModuleCollection.prototype.update = function update$1 (rawRootModule) {
|
184 |
+
update([], this.root, rawRootModule);
|
185 |
+
};
|
186 |
+
|
187 |
+
ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
|
188 |
+
var this$1 = this;
|
189 |
+
if ( runtime === void 0 ) runtime = true;
|
190 |
+
|
191 |
+
{
|
192 |
+
assertRawModule(path, rawModule);
|
193 |
+
}
|
194 |
+
|
195 |
+
var newModule = new Module(rawModule, runtime);
|
196 |
+
if (path.length === 0) {
|
197 |
+
this.root = newModule;
|
198 |
+
} else {
|
199 |
+
var parent = this.get(path.slice(0, -1));
|
200 |
+
parent.addChild(path[path.length - 1], newModule);
|
201 |
+
}
|
202 |
+
|
203 |
+
// register nested modules
|
204 |
+
if (rawModule.modules) {
|
205 |
+
forEachValue(rawModule.modules, function (rawChildModule, key) {
|
206 |
+
this$1.register(path.concat(key), rawChildModule, runtime);
|
207 |
+
});
|
208 |
+
}
|
209 |
+
};
|
210 |
+
|
211 |
+
ModuleCollection.prototype.unregister = function unregister (path) {
|
212 |
+
var parent = this.get(path.slice(0, -1));
|
213 |
+
var key = path[path.length - 1];
|
214 |
+
if (!parent.getChild(key).runtime) { return }
|
215 |
+
|
216 |
+
parent.removeChild(key);
|
217 |
+
};
|
218 |
+
|
219 |
+
function update (path, targetModule, newModule) {
|
220 |
+
{
|
221 |
+
assertRawModule(path, newModule);
|
222 |
+
}
|
223 |
+
|
224 |
+
// update target module
|
225 |
+
targetModule.update(newModule);
|
226 |
+
|
227 |
+
// update nested modules
|
228 |
+
if (newModule.modules) {
|
229 |
+
for (var key in newModule.modules) {
|
230 |
+
if (!targetModule.getChild(key)) {
|
231 |
+
{
|
232 |
+
console.warn(
|
233 |
+
"[vuex] trying to add a new module '" + key + "' on hot reloading, " +
|
234 |
+
'manual reload is needed'
|
235 |
+
);
|
236 |
+
}
|
237 |
+
return
|
238 |
+
}
|
239 |
+
update(
|
240 |
+
path.concat(key),
|
241 |
+
targetModule.getChild(key),
|
242 |
+
newModule.modules[key]
|
243 |
+
);
|
244 |
+
}
|
245 |
+
}
|
246 |
+
}
|
247 |
+
|
248 |
+
var functionAssert = {
|
249 |
+
assert: function (value) { return typeof value === 'function'; },
|
250 |
+
expected: 'function'
|
251 |
+
};
|
252 |
+
|
253 |
+
var objectAssert = {
|
254 |
+
assert: function (value) { return typeof value === 'function' ||
|
255 |
+
(typeof value === 'object' && typeof value.handler === 'function'); },
|
256 |
+
expected: 'function or object with "handler" function'
|
257 |
+
};
|
258 |
+
|
259 |
+
var assertTypes = {
|
260 |
+
getters: functionAssert,
|
261 |
+
mutations: functionAssert,
|
262 |
+
actions: objectAssert
|
263 |
+
};
|
264 |
+
|
265 |
+
function assertRawModule (path, rawModule) {
|
266 |
+
Object.keys(assertTypes).forEach(function (key) {
|
267 |
+
if (!rawModule[key]) { return }
|
268 |
+
|
269 |
+
var assertOptions = assertTypes[key];
|
270 |
+
|
271 |
+
forEachValue(rawModule[key], function (value, type) {
|
272 |
+
assert(
|
273 |
+
assertOptions.assert(value),
|
274 |
+
makeAssertionMessage(path, key, type, value, assertOptions.expected)
|
275 |
+
);
|
276 |
+
});
|
277 |
+
});
|
278 |
+
}
|
279 |
+
|
280 |
+
function makeAssertionMessage (path, key, type, value, expected) {
|
281 |
+
var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
|
282 |
+
if (path.length > 0) {
|
283 |
+
buf += " in module \"" + (path.join('.')) + "\"";
|
284 |
+
}
|
285 |
+
buf += " is " + (JSON.stringify(value)) + ".";
|
286 |
+
return buf
|
287 |
+
}
|
288 |
+
|
289 |
+
var Vue; // bind on install
|
290 |
+
|
291 |
+
var Store = function Store (options) {
|
292 |
+
var this$1 = this;
|
293 |
+
if ( options === void 0 ) options = {};
|
294 |
+
|
295 |
+
// Auto install if it is not done yet and `window` has `Vue`.
|
296 |
+
// To allow users to avoid auto-installation in some cases,
|
297 |
+
// this code should be placed here. See #731
|
298 |
+
if (!Vue && typeof window !== 'undefined' && window.Vue) {
|
299 |
+
install(window.Vue);
|
300 |
+
}
|
301 |
+
|
302 |
+
{
|
303 |
+
assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
|
304 |
+
assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
|
305 |
+
assert(this instanceof Store, "store must be called with the new operator.");
|
306 |
+
}
|
307 |
+
|
308 |
+
var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
|
309 |
+
var strict = options.strict; if ( strict === void 0 ) strict = false;
|
310 |
+
|
311 |
+
// store internal state
|
312 |
+
this._committing = false;
|
313 |
+
this._actions = Object.create(null);
|
314 |
+
this._actionSubscribers = [];
|
315 |
+
this._mutations = Object.create(null);
|
316 |
+
this._wrappedGetters = Object.create(null);
|
317 |
+
this._modules = new ModuleCollection(options);
|
318 |
+
this._modulesNamespaceMap = Object.create(null);
|
319 |
+
this._subscribers = [];
|
320 |
+
this._watcherVM = new Vue();
|
321 |
+
|
322 |
+
// bind commit and dispatch to self
|
323 |
+
var store = this;
|
324 |
+
var ref = this;
|
325 |
+
var dispatch = ref.dispatch;
|
326 |
+
var commit = ref.commit;
|
327 |
+
this.dispatch = function boundDispatch (type, payload) {
|
328 |
+
return dispatch.call(store, type, payload)
|
329 |
+
};
|
330 |
+
this.commit = function boundCommit (type, payload, options) {
|
331 |
+
return commit.call(store, type, payload, options)
|
332 |
+
};
|
333 |
+
|
334 |
+
// strict mode
|
335 |
+
this.strict = strict;
|
336 |
+
|
337 |
+
var state = this._modules.root.state;
|
338 |
+
|
339 |
+
// init root module.
|
340 |
+
// this also recursively registers all sub-modules
|
341 |
+
// and collects all module getters inside this._wrappedGetters
|
342 |
+
installModule(this, state, [], this._modules.root);
|
343 |
+
|
344 |
+
// initialize the store vm, which is responsible for the reactivity
|
345 |
+
// (also registers _wrappedGetters as computed properties)
|
346 |
+
resetStoreVM(this, state);
|
347 |
+
|
348 |
+
// apply plugins
|
349 |
+
plugins.forEach(function (plugin) { return plugin(this$1); });
|
350 |
+
|
351 |
+
var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
|
352 |
+
if (useDevtools) {
|
353 |
+
devtoolPlugin(this);
|
354 |
+
}
|
355 |
+
};
|
356 |
+
|
357 |
+
var prototypeAccessors$1 = { state: { configurable: true } };
|
358 |
+
|
359 |
+
prototypeAccessors$1.state.get = function () {
|
360 |
+
return this._vm._data.$$state
|
361 |
+
};
|
362 |
+
|
363 |
+
prototypeAccessors$1.state.set = function (v) {
|
364 |
+
{
|
365 |
+
assert(false, "use store.replaceState() to explicit replace store state.");
|
366 |
+
}
|
367 |
+
};
|
368 |
+
|
369 |
+
Store.prototype.commit = function commit (_type, _payload, _options) {
|
370 |
+
var this$1 = this;
|
371 |
+
|
372 |
+
// check object-style commit
|
373 |
+
var ref = unifyObjectStyle(_type, _payload, _options);
|
374 |
+
var type = ref.type;
|
375 |
+
var payload = ref.payload;
|
376 |
+
var options = ref.options;
|
377 |
+
|
378 |
+
var mutation = { type: type, payload: payload };
|
379 |
+
var entry = this._mutations[type];
|
380 |
+
if (!entry) {
|
381 |
+
{
|
382 |
+
console.error(("[vuex] unknown mutation type: " + type));
|
383 |
+
}
|
384 |
+
return
|
385 |
+
}
|
386 |
+
this._withCommit(function () {
|
387 |
+
entry.forEach(function commitIterator (handler) {
|
388 |
+
handler(payload);
|
389 |
+
});
|
390 |
+
});
|
391 |
+
this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); });
|
392 |
+
|
393 |
+
if (
|
394 |
+
options && options.silent
|
395 |
+
) {
|
396 |
+
console.warn(
|
397 |
+
"[vuex] mutation type: " + type + ". Silent option has been removed. " +
|
398 |
+
'Use the filter functionality in the vue-devtools'
|
399 |
+
);
|
400 |
+
}
|
401 |
+
};
|
402 |
+
|
403 |
+
Store.prototype.dispatch = function dispatch (_type, _payload) {
|
404 |
+
var this$1 = this;
|
405 |
+
|
406 |
+
// check object-style dispatch
|
407 |
+
var ref = unifyObjectStyle(_type, _payload);
|
408 |
+
var type = ref.type;
|
409 |
+
var payload = ref.payload;
|
410 |
+
|
411 |
+
var action = { type: type, payload: payload };
|
412 |
+
var entry = this._actions[type];
|
413 |
+
if (!entry) {
|
414 |
+
{
|
415 |
+
console.error(("[vuex] unknown action type: " + type));
|
416 |
+
}
|
417 |
+
return
|
418 |
+
}
|
419 |
+
|
420 |
+
try {
|
421 |
+
this._actionSubscribers
|
422 |
+
.filter(function (sub) { return sub.before; })
|
423 |
+
.forEach(function (sub) { return sub.before(action, this$1.state); });
|
424 |
+
} catch (e) {
|
425 |
+
{
|
426 |
+
console.warn("[vuex] error in before action subscribers: ");
|
427 |
+
console.error(e);
|
428 |
+
}
|
429 |
+
}
|
430 |
+
|
431 |
+
var result = entry.length > 1
|
432 |
+
? Promise.all(entry.map(function (handler) { return handler(payload); }))
|
433 |
+
: entry[0](payload);
|
434 |
+
|
435 |
+
return result.then(function (res) {
|
436 |
+
try {
|
437 |
+
this$1._actionSubscribers
|
438 |
+
.filter(function (sub) { return sub.after; })
|
439 |
+
.forEach(function (sub) { return sub.after(action, this$1.state); });
|
440 |
+
} catch (e) {
|
441 |
+
{
|
442 |
+
console.warn("[vuex] error in after action subscribers: ");
|
443 |
+
console.error(e);
|
444 |
+
}
|
445 |
+
}
|
446 |
+
return res
|
447 |
+
})
|
448 |
+
};
|
449 |
+
|
450 |
+
Store.prototype.subscribe = function subscribe (fn) {
|
451 |
+
return genericSubscribe(fn, this._subscribers)
|
452 |
+
};
|
453 |
+
|
454 |
+
Store.prototype.subscribeAction = function subscribeAction (fn) {
|
455 |
+
var subs = typeof fn === 'function' ? { before: fn } : fn;
|
456 |
+
return genericSubscribe(subs, this._actionSubscribers)
|
457 |
+
};
|
458 |
+
|
459 |
+
Store.prototype.watch = function watch (getter, cb, options) {
|
460 |
+
var this$1 = this;
|
461 |
+
|
462 |
+
{
|
463 |
+
assert(typeof getter === 'function', "store.watch only accepts a function.");
|
464 |
+
}
|
465 |
+
return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
|
466 |
+
};
|
467 |
+
|
468 |
+
Store.prototype.replaceState = function replaceState (state) {
|
469 |
+
var this$1 = this;
|
470 |
+
|
471 |
+
this._withCommit(function () {
|
472 |
+
this$1._vm._data.$$state = state;
|
473 |
+
});
|
474 |
+
};
|
475 |
+
|
476 |
+
Store.prototype.registerModule = function registerModule (path, rawModule, options) {
|
477 |
+
if ( options === void 0 ) options = {};
|
478 |
+
|
479 |
+
if (typeof path === 'string') { path = [path]; }
|
480 |
+
|
481 |
+
{
|
482 |
+
assert(Array.isArray(path), "module path must be a string or an Array.");
|
483 |
+
assert(path.length > 0, 'cannot register the root module by using registerModule.');
|
484 |
+
}
|
485 |
+
|
486 |
+
this._modules.register(path, rawModule);
|
487 |
+
installModule(this, this.state, path, this._modules.get(path), options.preserveState);
|
488 |
+
// reset store to update getters...
|
489 |
+
resetStoreVM(this, this.state);
|
490 |
+
};
|
491 |
+
|
492 |
+
Store.prototype.unregisterModule = function unregisterModule (path) {
|
493 |
+
var this$1 = this;
|
494 |
+
|
495 |
+
if (typeof path === 'string') { path = [path]; }
|
496 |
+
|
497 |
+
{
|
498 |
+
assert(Array.isArray(path), "module path must be a string or an Array.");
|
499 |
+
}
|
500 |
+
|
501 |
+
this._modules.unregister(path);
|
502 |
+
this._withCommit(function () {
|
503 |
+
var parentState = getNestedState(this$1.state, path.slice(0, -1));
|
504 |
+
Vue.delete(parentState, path[path.length - 1]);
|
505 |
+
});
|
506 |
+
resetStore(this);
|
507 |
+
};
|
508 |
+
|
509 |
+
Store.prototype.hotUpdate = function hotUpdate (newOptions) {
|
510 |
+
this._modules.update(newOptions);
|
511 |
+
resetStore(this, true);
|
512 |
+
};
|
513 |
+
|
514 |
+
Store.prototype._withCommit = function _withCommit (fn) {
|
515 |
+
var committing = this._committing;
|
516 |
+
this._committing = true;
|
517 |
+
fn();
|
518 |
+
this._committing = committing;
|
519 |
+
};
|
520 |
+
|
521 |
+
Object.defineProperties( Store.prototype, prototypeAccessors$1 );
|
522 |
+
|
523 |
+
function genericSubscribe (fn, subs) {
|
524 |
+
if (subs.indexOf(fn) < 0) {
|
525 |
+
subs.push(fn);
|
526 |
+
}
|
527 |
+
return function () {
|
528 |
+
var i = subs.indexOf(fn);
|
529 |
+
if (i > -1) {
|
530 |
+
subs.splice(i, 1);
|
531 |
+
}
|
532 |
+
}
|
533 |
+
}
|
534 |
+
|
535 |
+
function resetStore (store, hot) {
|
536 |
+
store._actions = Object.create(null);
|
537 |
+
store._mutations = Object.create(null);
|
538 |
+
store._wrappedGetters = Object.create(null);
|
539 |
+
store._modulesNamespaceMap = Object.create(null);
|
540 |
+
var state = store.state;
|
541 |
+
// init all modules
|
542 |
+
installModule(store, state, [], store._modules.root, true);
|
543 |
+
// reset vm
|
544 |
+
resetStoreVM(store, state, hot);
|
545 |
+
}
|
546 |
+
|
547 |
+
function resetStoreVM (store, state, hot) {
|
548 |
+
var oldVm = store._vm;
|
549 |
+
|
550 |
+
// bind store public getters
|
551 |
+
store.getters = {};
|
552 |
+
var wrappedGetters = store._wrappedGetters;
|
553 |
+
var computed = {};
|
554 |
+
forEachValue(wrappedGetters, function (fn, key) {
|
555 |
+
// use computed to leverage its lazy-caching mechanism
|
556 |
+
computed[key] = function () { return fn(store); };
|
557 |
+
Object.defineProperty(store.getters, key, {
|
558 |
+
get: function () { return store._vm[key]; },
|
559 |
+
enumerable: true // for local getters
|
560 |
+
});
|
561 |
+
});
|
562 |
+
|
563 |
+
// use a Vue instance to store the state tree
|
564 |
+
// suppress warnings just in case the user has added
|
565 |
+
// some funky global mixins
|
566 |
+
var silent = Vue.config.silent;
|
567 |
+
Vue.config.silent = true;
|
568 |
+
store._vm = new Vue({
|
569 |
+
data: {
|
570 |
+
$$state: state
|
571 |
+
},
|
572 |
+
computed: computed
|
573 |
+
});
|
574 |
+
Vue.config.silent = silent;
|
575 |
+
|
576 |
+
// enable strict mode for new vm
|
577 |
+
if (store.strict) {
|
578 |
+
enableStrictMode(store);
|
579 |
+
}
|
580 |
+
|
581 |
+
if (oldVm) {
|
582 |
+
if (hot) {
|
583 |
+
// dispatch changes in all subscribed watchers
|
584 |
+
// to force getter re-evaluation for hot reloading.
|
585 |
+
store._withCommit(function () {
|
586 |
+
oldVm._data.$$state = null;
|
587 |
+
});
|
588 |
+
}
|
589 |
+
Vue.nextTick(function () { return oldVm.$destroy(); });
|
590 |
+
}
|
591 |
+
}
|
592 |
+
|
593 |
+
function installModule (store, rootState, path, module, hot) {
|
594 |
+
var isRoot = !path.length;
|
595 |
+
var namespace = store._modules.getNamespace(path);
|
596 |
+
|
597 |
+
// register in namespace map
|
598 |
+
if (module.namespaced) {
|
599 |
+
store._modulesNamespaceMap[namespace] = module;
|
600 |
+
}
|
601 |
+
|
602 |
+
// set state
|
603 |
+
if (!isRoot && !hot) {
|
604 |
+
var parentState = getNestedState(rootState, path.slice(0, -1));
|
605 |
+
var moduleName = path[path.length - 1];
|
606 |
+
store._withCommit(function () {
|
607 |
+
Vue.set(parentState, moduleName, module.state);
|
608 |
+
});
|
609 |
+
}
|
610 |
+
|
611 |
+
var local = module.context = makeLocalContext(store, namespace, path);
|
612 |
+
|
613 |
+
module.forEachMutation(function (mutation, key) {
|
614 |
+
var namespacedType = namespace + key;
|
615 |
+
registerMutation(store, namespacedType, mutation, local);
|
616 |
+
});
|
617 |
+
|
618 |
+
module.forEachAction(function (action, key) {
|
619 |
+
var type = action.root ? key : namespace + key;
|
620 |
+
var handler = action.handler || action;
|
621 |
+
registerAction(store, type, handler, local);
|
622 |
+
});
|
623 |
+
|
624 |
+
module.forEachGetter(function (getter, key) {
|
625 |
+
var namespacedType = namespace + key;
|
626 |
+
registerGetter(store, namespacedType, getter, local);
|
627 |
+
});
|
628 |
+
|
629 |
+
module.forEachChild(function (child, key) {
|
630 |
+
installModule(store, rootState, path.concat(key), child, hot);
|
631 |
+
});
|
632 |
+
}
|
633 |
+
|
634 |
+
/**
|
635 |
+
* make localized dispatch, commit, getters and state
|
636 |
+
* if there is no namespace, just use root ones
|
637 |
+
*/
|
638 |
+
function makeLocalContext (store, namespace, path) {
|
639 |
+
var noNamespace = namespace === '';
|
640 |
+
|
641 |
+
var local = {
|
642 |
+
dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
|
643 |
+
var args = unifyObjectStyle(_type, _payload, _options);
|
644 |
+
var payload = args.payload;
|
645 |
+
var options = args.options;
|
646 |
+
var type = args.type;
|
647 |
+
|
648 |
+
if (!options || !options.root) {
|
649 |
+
type = namespace + type;
|
650 |
+
if (!store._actions[type]) {
|
651 |
+
console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
|
652 |
+
return
|
653 |
+
}
|
654 |
+
}
|
655 |
+
|
656 |
+
return store.dispatch(type, payload)
|
657 |
+
},
|
658 |
+
|
659 |
+
commit: noNamespace ? store.commit : function (_type, _payload, _options) {
|
660 |
+
var args = unifyObjectStyle(_type, _payload, _options);
|
661 |
+
var payload = args.payload;
|
662 |
+
var options = args.options;
|
663 |
+
var type = args.type;
|
664 |
+
|
665 |
+
if (!options || !options.root) {
|
666 |
+
type = namespace + type;
|
667 |
+
if (!store._mutations[type]) {
|
668 |
+
console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
|
669 |
+
return
|
670 |
+
}
|
671 |
+
}
|
672 |
+
|
673 |
+
store.commit(type, payload, options);
|
674 |
+
}
|
675 |
+
};
|
676 |
+
|
677 |
+
// getters and state object must be gotten lazily
|
678 |
+
// because they will be changed by vm update
|
679 |
+
Object.defineProperties(local, {
|
680 |
+
getters: {
|
681 |
+
get: noNamespace
|
682 |
+
? function () { return store.getters; }
|
683 |
+
: function () { return makeLocalGetters(store, namespace); }
|
684 |
+
},
|
685 |
+
state: {
|
686 |
+
get: function () { return getNestedState(store.state, path); }
|
687 |
+
}
|
688 |
+
});
|
689 |
+
|
690 |
+
return local
|
691 |
+
}
|
692 |
+
|
693 |
+
function makeLocalGetters (store, namespace) {
|
694 |
+
var gettersProxy = {};
|
695 |
+
|
696 |
+
var splitPos = namespace.length;
|
697 |
+
Object.keys(store.getters).forEach(function (type) {
|
698 |
+
// skip if the target getter is not match this namespace
|
699 |
+
if (type.slice(0, splitPos) !== namespace) { return }
|
700 |
+
|
701 |
+
// extract local getter type
|
702 |
+
var localType = type.slice(splitPos);
|
703 |
+
|
704 |
+
// Add a port to the getters proxy.
|
705 |
+
// Define as getter property because
|
706 |
+
// we do not want to evaluate the getters in this time.
|
707 |
+
Object.defineProperty(gettersProxy, localType, {
|
708 |
+
get: function () { return store.getters[type]; },
|
709 |
+
enumerable: true
|
710 |
+
});
|
711 |
+
});
|
712 |
+
|
713 |
+
return gettersProxy
|
714 |
+
}
|
715 |
+
|
716 |
+
function registerMutation (store, type, handler, local) {
|
717 |
+
var entry = store._mutations[type] || (store._mutations[type] = []);
|
718 |
+
entry.push(function wrappedMutationHandler (payload) {
|
719 |
+
handler.call(store, local.state, payload);
|
720 |
+
});
|
721 |
+
}
|
722 |
+
|
723 |
+
function registerAction (store, type, handler, local) {
|
724 |
+
var entry = store._actions[type] || (store._actions[type] = []);
|
725 |
+
entry.push(function wrappedActionHandler (payload, cb) {
|
726 |
+
var res = handler.call(store, {
|
727 |
+
dispatch: local.dispatch,
|
728 |
+
commit: local.commit,
|
729 |
+
getters: local.getters,
|
730 |
+
state: local.state,
|
731 |
+
rootGetters: store.getters,
|
732 |
+
rootState: store.state
|
733 |
+
}, payload, cb);
|
734 |
+
if (!isPromise(res)) {
|
735 |
+
res = Promise.resolve(res);
|
736 |
+
}
|
737 |
+
if (store._devtoolHook) {
|
738 |
+
return res.catch(function (err) {
|
739 |
+
store._devtoolHook.emit('vuex:error', err);
|
740 |
+
throw err
|
741 |
+
})
|
742 |
+
} else {
|
743 |
+
return res
|
744 |
+
}
|
745 |
+
});
|
746 |
+
}
|
747 |
+
|
748 |
+
function registerGetter (store, type, rawGetter, local) {
|
749 |
+
if (store._wrappedGetters[type]) {
|
750 |
+
{
|
751 |
+
console.error(("[vuex] duplicate getter key: " + type));
|
752 |
+
}
|
753 |
+
return
|
754 |
+
}
|
755 |
+
store._wrappedGetters[type] = function wrappedGetter (store) {
|
756 |
+
return rawGetter(
|
757 |
+
local.state, // local state
|
758 |
+
local.getters, // local getters
|
759 |
+
store.state, // root state
|
760 |
+
store.getters // root getters
|
761 |
+
)
|
762 |
+
};
|
763 |
+
}
|
764 |
+
|
765 |
+
function enableStrictMode (store) {
|
766 |
+
store._vm.$watch(function () { return this._data.$$state }, function () {
|
767 |
+
{
|
768 |
+
assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
|
769 |
+
}
|
770 |
+
}, { deep: true, sync: true });
|
771 |
+
}
|
772 |
+
|
773 |
+
function getNestedState (state, path) {
|
774 |
+
return path.length
|
775 |
+
? path.reduce(function (state, key) { return state[key]; }, state)
|
776 |
+
: state
|
777 |
+
}
|
778 |
+
|
779 |
+
function unifyObjectStyle (type, payload, options) {
|
780 |
+
if (isObject(type) && type.type) {
|
781 |
+
options = payload;
|
782 |
+
payload = type;
|
783 |
+
type = type.type;
|
784 |
+
}
|
785 |
+
|
786 |
+
{
|
787 |
+
assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
|
788 |
+
}
|
789 |
+
|
790 |
+
return { type: type, payload: payload, options: options }
|
791 |
+
}
|
792 |
+
|
793 |
+
function install (_Vue) {
|
794 |
+
if (Vue && _Vue === Vue) {
|
795 |
+
{
|
796 |
+
console.error(
|
797 |
+
'[vuex] already installed. Vue.use(Vuex) should be called only once.'
|
798 |
+
);
|
799 |
+
}
|
800 |
+
return
|
801 |
+
}
|
802 |
+
Vue = _Vue;
|
803 |
+
applyMixin(Vue);
|
804 |
+
}
|
805 |
+
|
806 |
+
/**
|
807 |
+
* Reduce the code which written in Vue.js for getting the state.
|
808 |
+
* @param {String} [namespace] - Module's namespace
|
809 |
+
* @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
|
810 |
+
* @param {Object}
|
811 |
+
*/
|
812 |
+
var mapState = normalizeNamespace(function (namespace, states) {
|
813 |
+
var res = {};
|
814 |
+
normalizeMap(states).forEach(function (ref) {
|
815 |
+
var key = ref.key;
|
816 |
+
var val = ref.val;
|
817 |
+
|
818 |
+
res[key] = function mappedState () {
|
819 |
+
var state = this.$store.state;
|
820 |
+
var getters = this.$store.getters;
|
821 |
+
if (namespace) {
|
822 |
+
var module = getModuleByNamespace(this.$store, 'mapState', namespace);
|
823 |
+
if (!module) {
|
824 |
+
return
|
825 |
+
}
|
826 |
+
state = module.context.state;
|
827 |
+
getters = module.context.getters;
|
828 |
+
}
|
829 |
+
return typeof val === 'function'
|
830 |
+
? val.call(this, state, getters)
|
831 |
+
: state[val]
|
832 |
+
};
|
833 |
+
// mark vuex getter for devtools
|
834 |
+
res[key].vuex = true;
|
835 |
+
});
|
836 |
+
return res
|
837 |
+
});
|
838 |
+
|
839 |
+
/**
|
840 |
+
* Reduce the code which written in Vue.js for committing the mutation
|
841 |
+
* @param {String} [namespace] - Module's namespace
|
842 |
+
* @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept anthor params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
|
843 |
+
* @return {Object}
|
844 |
+
*/
|
845 |
+
var mapMutations = normalizeNamespace(function (namespace, mutations) {
|
846 |
+
var res = {};
|
847 |
+
normalizeMap(mutations).forEach(function (ref) {
|
848 |
+
var key = ref.key;
|
849 |
+
var val = ref.val;
|
850 |
+
|
851 |
+
res[key] = function mappedMutation () {
|
852 |
+
var args = [], len = arguments.length;
|
853 |
+
while ( len-- ) args[ len ] = arguments[ len ];
|
854 |
+
|
855 |
+
// Get the commit method from store
|
856 |
+
var commit = this.$store.commit;
|
857 |
+
if (namespace) {
|
858 |
+
var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
|
859 |
+
if (!module) {
|
860 |
+
return
|
861 |
+
}
|
862 |
+
commit = module.context.commit;
|
863 |
+
}
|
864 |
+
return typeof val === 'function'
|
865 |
+
? val.apply(this, [commit].concat(args))
|
866 |
+
: commit.apply(this.$store, [val].concat(args))
|
867 |
+
};
|
868 |
+
});
|
869 |
+
return res
|
870 |
+
});
|
871 |
+
|
872 |
+
/**
|
873 |
+
* Reduce the code which written in Vue.js for getting the getters
|
874 |
+
* @param {String} [namespace] - Module's namespace
|
875 |
+
* @param {Object|Array} getters
|
876 |
+
* @return {Object}
|
877 |
+
*/
|
878 |
+
var mapGetters = normalizeNamespace(function (namespace, getters) {
|
879 |
+
var res = {};
|
880 |
+
normalizeMap(getters).forEach(function (ref) {
|
881 |
+
var key = ref.key;
|
882 |
+
var val = ref.val;
|
883 |
+
|
884 |
+
// The namespace has been mutated by normalizeNamespace
|
885 |
+
val = namespace + val;
|
886 |
+
res[key] = function mappedGetter () {
|
887 |
+
if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
|
888 |
+
return
|
889 |
+
}
|
890 |
+
if (!(val in this.$store.getters)) {
|
891 |
+
console.error(("[vuex] unknown getter: " + val));
|
892 |
+
return
|
893 |
+
}
|
894 |
+
return this.$store.getters[val]
|
895 |
+
};
|
896 |
+
// mark vuex getter for devtools
|
897 |
+
res[key].vuex = true;
|
898 |
+
});
|
899 |
+
return res
|
900 |
+
});
|
901 |
+
|
902 |
+
/**
|
903 |
+
* Reduce the code which written in Vue.js for dispatch the action
|
904 |
+
* @param {String} [namespace] - Module's namespace
|
905 |
+
* @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
|
906 |
+
* @return {Object}
|
907 |
+
*/
|
908 |
+
var mapActions = normalizeNamespace(function (namespace, actions) {
|
909 |
+
var res = {};
|
910 |
+
normalizeMap(actions).forEach(function (ref) {
|
911 |
+
var key = ref.key;
|
912 |
+
var val = ref.val;
|
913 |
+
|
914 |
+
res[key] = function mappedAction () {
|
915 |
+
var args = [], len = arguments.length;
|
916 |
+
while ( len-- ) args[ len ] = arguments[ len ];
|
917 |
+
|
918 |
+
// get dispatch function from store
|
919 |
+
var dispatch = this.$store.dispatch;
|
920 |
+
if (namespace) {
|
921 |
+
var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
|
922 |
+
if (!module) {
|
923 |
+
return
|
924 |
+
}
|
925 |
+
dispatch = module.context.dispatch;
|
926 |
+
}
|
927 |
+
return typeof val === 'function'
|
928 |
+
? val.apply(this, [dispatch].concat(args))
|
929 |
+
: dispatch.apply(this.$store, [val].concat(args))
|
930 |
+
};
|
931 |
+
});
|
932 |
+
return res
|
933 |
+
});
|
934 |
+
|
935 |
+
/**
|
936 |
+
* Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
|
937 |
+
* @param {String} namespace
|
938 |
+
* @return {Object}
|
939 |
+
*/
|
940 |
+
var createNamespacedHelpers = function (namespace) { return ({
|
941 |
+
mapState: mapState.bind(null, namespace),
|
942 |
+
mapGetters: mapGetters.bind(null, namespace),
|
943 |
+
mapMutations: mapMutations.bind(null, namespace),
|
944 |
+
mapActions: mapActions.bind(null, namespace)
|
945 |
+
}); };
|
946 |
+
|
947 |
+
/**
|
948 |
+
* Normalize the map
|
949 |
+
* normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
|
950 |
+
* normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
|
951 |
+
* @param {Array|Object} map
|
952 |
+
* @return {Object}
|
953 |
+
*/
|
954 |
+
function normalizeMap (map) {
|
955 |
+
return Array.isArray(map)
|
956 |
+
? map.map(function (key) { return ({ key: key, val: key }); })
|
957 |
+
: Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
|
958 |
+
}
|
959 |
+
|
960 |
+
/**
|
961 |
+
* Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
|
962 |
+
* @param {Function} fn
|
963 |
+
* @return {Function}
|
964 |
+
*/
|
965 |
+
function normalizeNamespace (fn) {
|
966 |
+
return function (namespace, map) {
|
967 |
+
if (typeof namespace !== 'string') {
|
968 |
+
map = namespace;
|
969 |
+
namespace = '';
|
970 |
+
} else if (namespace.charAt(namespace.length - 1) !== '/') {
|
971 |
+
namespace += '/';
|
972 |
+
}
|
973 |
+
return fn(namespace, map)
|
974 |
+
}
|
975 |
+
}
|
976 |
+
|
977 |
+
/**
|
978 |
+
* Search a special module from store by namespace. if module not exist, print error message.
|
979 |
+
* @param {Object} store
|
980 |
+
* @param {String} helper
|
981 |
+
* @param {String} namespace
|
982 |
+
* @return {Object}
|
983 |
+
*/
|
984 |
+
function getModuleByNamespace (store, helper, namespace) {
|
985 |
+
var module = store._modulesNamespaceMap[namespace];
|
986 |
+
if (!module) {
|
987 |
+
console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
|
988 |
+
}
|
989 |
+
return module
|
990 |
+
}
|
991 |
+
|
992 |
+
var index = {
|
993 |
+
Store: Store,
|
994 |
+
install: install,
|
995 |
+
version: '3.1.0',
|
996 |
+
mapState: mapState,
|
997 |
+
mapMutations: mapMutations,
|
998 |
+
mapGetters: mapGetters,
|
999 |
+
mapActions: mapActions,
|
1000 |
+
createNamespacedHelpers: createNamespacedHelpers
|
1001 |
+
};
|
1002 |
+
|
1003 |
+
return index;
|
1004 |
+
|
1005 |
+
}));
|
inc/admin/class-lp-admin-assets.php
CHANGED
@@ -65,19 +65,19 @@ class LP_Admin_Assets extends LP_Abstract_Assets {
|
|
65 |
'ver' => '2.5.16'
|
66 |
),
|
67 |
'lp-vuex' => array(
|
68 |
-
'url' => self::url( 'js/vendor/vuex.
|
69 |
-
'ver' => '
|
70 |
),
|
71 |
'lp-vue-resource' => array(
|
72 |
-
'url' => self::url( 'js/vendor/vue-resource.
|
73 |
'ver' => '1.3.4'
|
74 |
),
|
75 |
'lp-sortable' => array(
|
76 |
-
'url' => self::url( 'js/vendor/sortable.
|
77 |
'ver' => '1.6.0'
|
78 |
),
|
79 |
'lp-vuedraggable' => array(
|
80 |
-
'url' => self::url( 'js/vendor/vuedraggable.
|
81 |
'ver' => '2.14.1',
|
82 |
'deps' => array( 'lp-sortable' )
|
83 |
),
|
65 |
'ver' => '2.5.16'
|
66 |
),
|
67 |
'lp-vuex' => array(
|
68 |
+
'url' => self::url( 'js/vendor/vuex.js' ),
|
69 |
+
'ver' => '3.1.0'
|
70 |
),
|
71 |
'lp-vue-resource' => array(
|
72 |
+
'url' => self::url( 'js/vendor/vue-resource.js' ),
|
73 |
'ver' => '1.3.4'
|
74 |
),
|
75 |
'lp-sortable' => array(
|
76 |
+
'url' => self::url( 'js/vendor/sortable.js' ),
|
77 |
'ver' => '1.6.0'
|
78 |
),
|
79 |
'lp-vuedraggable' => array(
|
80 |
+
'url' => self::url( 'js/vendor/vuedraggable.js' ),
|
81 |
'ver' => '2.14.1',
|
82 |
'deps' => array( 'lp-sortable' )
|
83 |
),
|
inc/admin/class-lp-post-type-actions.php
CHANGED
@@ -115,6 +115,10 @@ class LP_Post_Type_Actions {
|
|
115 |
}
|
116 |
} elseif ( $this->is_course( $post_id ) ) {
|
117 |
do_action( 'learn-press/trashed-course', $post_id );
|
|
|
|
|
|
|
|
|
118 |
}
|
119 |
|
120 |
//echo 'trashed';
|
115 |
}
|
116 |
} elseif ( $this->is_course( $post_id ) ) {
|
117 |
do_action( 'learn-press/trashed-course', $post_id );
|
118 |
+
} elseif ( get_post_type( $post_id ) == LP_QUESTION_CPT ) {
|
119 |
+
global $wpdb;
|
120 |
+
// Delete the question trashed from quizzes
|
121 |
+
$wpdb->delete( $wpdb->prefix . 'learnpress_quiz_questions', array( 'question_id' => $post_id ), array( '%d' ) );
|
122 |
}
|
123 |
|
124 |
//echo 'trashed';
|
inc/admin/lp-admin-functions.php
CHANGED
@@ -449,6 +449,7 @@ function learn_press_get_education_themes() {
|
|
449 |
return apply_filters(
|
450 |
'learn-press/education-themes',
|
451 |
array(
|
|
|
452 |
'22773871' => 'ivy-school',
|
453 |
'20370918' => 'wordpress-lms',
|
454 |
'14058034' => 'eduma',
|
@@ -507,6 +508,7 @@ function learn_press_footer_advertisement() {
|
|
507 |
$theme_ids = learn_press_get_education_themes();
|
508 |
$current_theme = wp_get_theme();
|
509 |
|
|
|
510 |
$include = array_keys( $theme_ids );
|
511 |
|
512 |
if ( false !== ( $key = array_search( $current_theme->name, $theme_ids, true ) ) ) {
|
449 |
return apply_filters(
|
450 |
'learn-press/education-themes',
|
451 |
array(
|
452 |
+
'23451388' => 'kindergarten',
|
453 |
'22773871' => 'ivy-school',
|
454 |
'20370918' => 'wordpress-lms',
|
455 |
'14058034' => 'eduma',
|
508 |
$theme_ids = learn_press_get_education_themes();
|
509 |
$current_theme = wp_get_theme();
|
510 |
|
511 |
+
|
512 |
$include = array_keys( $theme_ids );
|
513 |
|
514 |
if ( false !== ( $key = array_search( $current_theme->name, $theme_ids, true ) ) ) {
|
inc/admin/views/course/added-items-preview.php
CHANGED
@@ -22,9 +22,12 @@
|
|
22 |
</script>
|
23 |
|
24 |
<script type="text/javascript">
|
|
|
|
|
25 |
jQuery(function() {
|
26 |
-
(function (
|
27 |
-
|
|
|
28 |
template: '#tmpl-lp-added-items-preview',
|
29 |
props: {
|
30 |
show: true
|
@@ -40,6 +43,6 @@
|
|
40 |
}
|
41 |
}
|
42 |
});
|
43 |
-
})(
|
44 |
});
|
45 |
</script>
|
22 |
</script>
|
23 |
|
24 |
<script type="text/javascript">
|
25 |
+
window.$Vue = window.$Vue || Vue;
|
26 |
+
|
27 |
jQuery(function() {
|
28 |
+
(function ($store) {
|
29 |
+
|
30 |
+
$Vue.component('lp-added-items-preview', {
|
31 |
template: '#tmpl-lp-added-items-preview',
|
32 |
props: {
|
33 |
show: true
|
43 |
}
|
44 |
}
|
45 |
});
|
46 |
+
})(LP_Curriculum_Store);
|
47 |
});
|
48 |
</script>
|
inc/admin/views/course/curriculum.php
CHANGED
@@ -23,11 +23,12 @@ learn_press_admin_view( 'course/sections' );
|
|
23 |
</script>
|
24 |
|
25 |
<script type="text/javascript">
|
|
|
26 |
jQuery(function ($) {
|
27 |
|
28 |
-
(function (
|
29 |
|
30 |
-
Vue.component('lp-curriculum', {
|
31 |
template: '#tmpl-lp-course-curriculum',
|
32 |
computed: {
|
33 |
status: function () {
|
@@ -55,7 +56,7 @@ learn_press_admin_view( 'course/sections' );
|
|
55 |
}
|
56 |
});
|
57 |
|
58 |
-
})(
|
59 |
|
60 |
})
|
61 |
</script>
|
23 |
</script>
|
24 |
|
25 |
<script type="text/javascript">
|
26 |
+
window.$Vue = window.$Vue = Vue;
|
27 |
jQuery(function ($) {
|
28 |
|
29 |
+
(function ( $store) {
|
30 |
|
31 |
+
$Vue.component('lp-curriculum', {
|
32 |
template: '#tmpl-lp-course-curriculum',
|
33 |
computed: {
|
34 |
status: function () {
|
56 |
}
|
57 |
});
|
58 |
|
59 |
+
})(LP_Curriculum_Store);
|
60 |
|
61 |
})
|
62 |
</script>
|
inc/admin/views/course/editor.php
CHANGED
@@ -29,10 +29,11 @@ learn_press_admin_view( 'course/modal-choose-items' );
|
|
29 |
</script>
|
30 |
|
31 |
<script type="text/javascript">
|
|
|
32 |
jQuery(function ($) {
|
33 |
-
(function (
|
34 |
|
35 |
-
Vue.component('lp-course-editor', {
|
36 |
template: '#tmpl-lp-course-editor',
|
37 |
created: function () {
|
38 |
setInterval(function () {
|
@@ -46,6 +47,6 @@ learn_press_admin_view( 'course/modal-choose-items' );
|
|
46 |
}
|
47 |
});
|
48 |
|
49 |
-
})(
|
50 |
})
|
51 |
</script>
|
29 |
</script>
|
30 |
|
31 |
<script type="text/javascript">
|
32 |
+
window.$Vue = window.$Vue || Vue;
|
33 |
jQuery(function ($) {
|
34 |
+
(function ($store) {
|
35 |
|
36 |
+
$Vue.component('lp-course-editor', {
|
37 |
template: '#tmpl-lp-course-editor',
|
38 |
created: function () {
|
39 |
setInterval(function () {
|
47 |
}
|
48 |
});
|
49 |
|
50 |
+
})(LP_Curriculum_Store);
|
51 |
})
|
52 |
</script>
|
inc/admin/views/course/modal-choose-items.php
CHANGED
@@ -18,10 +18,11 @@ learn_press_admin_view( 'course/pagination' );
|
|
18 |
</script>
|
19 |
|
20 |
<script type="text/javascript">
|
|
|
21 |
|
22 |
jQuery(function ($) {
|
23 |
-
(function (
|
24 |
-
Vue.component('lp-course-choose-item', {
|
25 |
template: '#tmpl-lp-course-choose-item',
|
26 |
props: ['item', 'added'],
|
27 |
watch: {
|
@@ -43,7 +44,7 @@ learn_press_admin_view( 'course/pagination' );
|
|
43 |
}
|
44 |
});
|
45 |
|
46 |
-
})(
|
47 |
})
|
48 |
|
49 |
</script>
|
@@ -113,12 +114,13 @@ learn_press_admin_view( 'course/pagination' );
|
|
113 |
</script>
|
114 |
|
115 |
<script type="text/javascript">
|
|
|
116 |
|
117 |
jQuery(function ($) {
|
118 |
|
119 |
-
(function (
|
120 |
|
121 |
-
Vue.component('lp-curriculum-choose-items', {
|
122 |
template: '#tmpl-lp-course-choose-items',
|
123 |
data: function () {
|
124 |
return {
|
@@ -272,6 +274,6 @@ learn_press_admin_view( 'course/pagination' );
|
|
272 |
}
|
273 |
});
|
274 |
|
275 |
-
})(
|
276 |
});
|
277 |
</script>
|
18 |
</script>
|
19 |
|
20 |
<script type="text/javascript">
|
21 |
+
window.$Vue = window.$Vue || Vue;
|
22 |
|
23 |
jQuery(function ($) {
|
24 |
+
(function ($store) {
|
25 |
+
$Vue.component('lp-course-choose-item', {
|
26 |
template: '#tmpl-lp-course-choose-item',
|
27 |
props: ['item', 'added'],
|
28 |
watch: {
|
44 |
}
|
45 |
});
|
46 |
|
47 |
+
})(LP_Curriculum_Store);
|
48 |
})
|
49 |
|
50 |
</script>
|
114 |
</script>
|
115 |
|
116 |
<script type="text/javascript">
|
117 |
+
window.$Vue = window.$Vue || Vue;
|
118 |
|
119 |
jQuery(function ($) {
|
120 |
|
121 |
+
(function ($store) {
|
122 |
|
123 |
+
$Vue.component('lp-curriculum-choose-items', {
|
124 |
template: '#tmpl-lp-course-choose-items',
|
125 |
data: function () {
|
126 |
return {
|
274 |
}
|
275 |
});
|
276 |
|
277 |
+
})(LP_Curriculum_Store);
|
278 |
});
|
279 |
</script>
|
inc/admin/views/course/new-section-item.php
CHANGED
@@ -26,11 +26,13 @@
|
|
26 |
</script>
|
27 |
|
28 |
<script type="text/javascript">
|
|
|
|
|
29 |
jQuery(function ($) {
|
30 |
|
31 |
-
(function (
|
32 |
|
33 |
-
Vue.component('lp-new-section-item', {
|
34 |
template: '#tmpl-lp-new-section-item',
|
35 |
props: [],
|
36 |
data: function () {
|
@@ -132,6 +134,6 @@
|
|
132 |
}
|
133 |
});
|
134 |
|
135 |
-
})(
|
136 |
})
|
137 |
</script>
|
26 |
</script>
|
27 |
|
28 |
<script type="text/javascript">
|
29 |
+
window.$Vue = window.$Vue || Vue;
|
30 |
+
|
31 |
jQuery(function ($) {
|
32 |
|
33 |
+
(function ($store) {
|
34 |
|
35 |
+
$Vue.component('lp-new-section-item', {
|
36 |
template: '#tmpl-lp-new-section-item',
|
37 |
props: [],
|
38 |
data: function () {
|
134 |
}
|
135 |
});
|
136 |
|
137 |
+
})( LP_Curriculum_Store);
|
138 |
})
|
139 |
</script>
|
inc/admin/views/course/new-section.php
CHANGED
@@ -22,11 +22,13 @@
|
|
22 |
</script>
|
23 |
|
24 |
<script type="text/javascript">
|
|
|
|
|
25 |
jQuery(function ($) {
|
26 |
|
27 |
-
(function (
|
28 |
|
29 |
-
Vue.component('lp-new-section', {
|
30 |
template: '#tmpl-lp-new-section',
|
31 |
data: function () {
|
32 |
return {
|
@@ -58,6 +60,6 @@
|
|
58 |
}
|
59 |
});
|
60 |
|
61 |
-
})(
|
62 |
});
|
63 |
</script>
|
22 |
</script>
|
23 |
|
24 |
<script type="text/javascript">
|
25 |
+
window.$Vue = window.$Vue || Vue;
|
26 |
+
|
27 |
jQuery(function ($) {
|
28 |
|
29 |
+
(function ($store) {
|
30 |
|
31 |
+
$Vue.component('lp-new-section', {
|
32 |
template: '#tmpl-lp-new-section',
|
33 |
data: function () {
|
34 |
return {
|
60 |
}
|
61 |
});
|
62 |
|
63 |
+
})(LP_Curriculum_Store);
|
64 |
});
|
65 |
</script>
|
inc/admin/views/course/pagination.php
CHANGED
@@ -28,11 +28,13 @@
|
|
28 |
</script>
|
29 |
|
30 |
<script type="text/javascript">
|
|
|
|
|
31 |
jQuery(function ($) {
|
32 |
|
33 |
-
(function (
|
34 |
|
35 |
-
Vue.component('lp-pagination', {
|
36 |
template: '#tmpl-lp-pagination',
|
37 |
props: ['total'],
|
38 |
data: function () {
|
@@ -73,7 +75,7 @@
|
|
73 |
}
|
74 |
});
|
75 |
|
76 |
-
})(
|
77 |
|
78 |
})
|
79 |
</script>
|
28 |
</script>
|
29 |
|
30 |
<script type="text/javascript">
|
31 |
+
window.$Vue = window.$Vue || Vue;
|
32 |
+
|
33 |
jQuery(function ($) {
|
34 |
|
35 |
+
(function ($store) {
|
36 |
|
37 |
+
$Vue.component('lp-pagination', {
|
38 |
template: '#tmpl-lp-pagination',
|
39 |
props: ['total'],
|
40 |
data: function () {
|
75 |
}
|
76 |
});
|
77 |
|
78 |
+
})(LP_Curriculum_Store);
|
79 |
|
80 |
})
|
81 |
</script>
|
inc/admin/views/course/section-item.php
CHANGED
@@ -47,11 +47,13 @@
|
|
47 |
</script>
|
48 |
|
49 |
<script type="text/javascript">
|
|
|
|
|
50 |
jQuery(function ($) {
|
51 |
|
52 |
-
(function (
|
53 |
|
54 |
-
Vue.component('lp-section-item', {
|
55 |
template: '#tmpl-lp-section-item',
|
56 |
props: ['item', 'order', 'disableCurriculum'],
|
57 |
data: function () {
|
@@ -142,6 +144,6 @@
|
|
142 |
}
|
143 |
});
|
144 |
|
145 |
-
})(
|
146 |
})
|
147 |
</script>
|
47 |
</script>
|
48 |
|
49 |
<script type="text/javascript">
|
50 |
+
window.$Vue = window.$Vue || Vue;
|
51 |
+
|
52 |
jQuery(function ($) {
|
53 |
|
54 |
+
(function ($store) {
|
55 |
|
56 |
+
$Vue.component('lp-section-item', {
|
57 |
template: '#tmpl-lp-section-item',
|
58 |
props: ['item', 'order', 'disableCurriculum'],
|
59 |
data: function () {
|
144 |
}
|
145 |
});
|
146 |
|
147 |
+
})(LP_Curriculum_Store);
|
148 |
})
|
149 |
</script>
|
inc/admin/views/course/section.php
CHANGED
@@ -66,11 +66,13 @@ learn_press_admin_view( 'course/new-section-item' );
|
|
66 |
</script>
|
67 |
|
68 |
<script type="text/javascript">
|
|
|
|
|
69 |
jQuery(function ($) {
|
70 |
|
71 |
-
(function (
|
72 |
|
73 |
-
Vue.component('lp-section', {
|
74 |
template: '#tmpl-lp-section',
|
75 |
props: ['section', 'index', 'disableCurriculum'],
|
76 |
data: function () {
|
@@ -288,6 +290,6 @@ learn_press_admin_view( 'course/new-section-item' );
|
|
288 |
}
|
289 |
});
|
290 |
|
291 |
-
})(
|
292 |
});
|
293 |
</script>
|
66 |
</script>
|
67 |
|
68 |
<script type="text/javascript">
|
69 |
+
window.$Vue = window.$Vue || Vue;
|
70 |
+
|
71 |
jQuery(function ($) {
|
72 |
|
73 |
+
(function ($store) {
|
74 |
|
75 |
+
$Vue.component('lp-section', {
|
76 |
template: '#tmpl-lp-section',
|
77 |
props: ['section', 'index', 'disableCurriculum'],
|
78 |
data: function () {
|
290 |
}
|
291 |
});
|
292 |
|
293 |
+
})(LP_Curriculum_Store);
|
294 |
});
|
295 |
</script>
|
inc/admin/views/course/sections.php
CHANGED
@@ -24,11 +24,13 @@ learn_press_admin_view( 'course/new-section' );
|
|
24 |
</script>
|
25 |
|
26 |
<script type="text/javascript">
|
|
|
|
|
27 |
jQuery(function ($) {
|
28 |
|
29 |
-
(function (
|
30 |
|
31 |
-
Vue.component('lp-list-sections', {
|
32 |
template: '#tmpl-lp-list-sections',
|
33 |
computed: {
|
34 |
// all sections
|
@@ -68,6 +70,6 @@ learn_press_admin_view( 'course/new-section' );
|
|
68 |
}
|
69 |
}
|
70 |
});
|
71 |
-
})(
|
72 |
});
|
73 |
</script>
|
24 |
</script>
|
25 |
|
26 |
<script type="text/javascript">
|
27 |
+
window.$Vue = window.$Vue || Vue;
|
28 |
+
|
29 |
jQuery(function ($) {
|
30 |
|
31 |
+
(function ( $store) {
|
32 |
|
33 |
+
$Vue.component('lp-list-sections', {
|
34 |
template: '#tmpl-lp-list-sections',
|
35 |
computed: {
|
36 |
// all sections
|
70 |
}
|
71 |
}
|
72 |
});
|
73 |
+
})( LP_Curriculum_Store);
|
74 |
});
|
75 |
</script>
|
inc/admin/views/question/actions.php
CHANGED
@@ -31,9 +31,10 @@
|
|
31 |
|
32 |
<script type="text/javascript">
|
33 |
|
34 |
-
(function (
|
|
|
35 |
|
36 |
-
Vue.component('lp-question-actions', {
|
37 |
template: '#tmpl-lp-question-actions',
|
38 |
props: ['type'],
|
39 |
computed: {
|
@@ -60,6 +61,6 @@
|
|
60 |
}
|
61 |
})
|
62 |
|
63 |
-
})(
|
64 |
|
65 |
</script>
|
31 |
|
32 |
<script type="text/javascript">
|
33 |
|
34 |
+
(function ($store) {
|
35 |
+
window.$Vue = window.$Vue || Vue;
|
36 |
|
37 |
+
$Vue.component('lp-question-actions', {
|
38 |
template: '#tmpl-lp-question-actions',
|
39 |
props: ['type'],
|
40 |
computed: {
|
61 |
}
|
62 |
})
|
63 |
|
64 |
+
})(LP_Question_Store);
|
65 |
|
66 |
</script>
|
inc/admin/views/question/answer.php
CHANGED
@@ -38,9 +38,10 @@ learn_press_admin_view( 'question/option' );
|
|
38 |
</script>
|
39 |
|
40 |
<script type="text/javascript">
|
41 |
-
(function (
|
|
|
42 |
|
43 |
-
Vue.component('lp-question-answer', {
|
44 |
template: '#tmpl-lp-question-answer',
|
45 |
props: ['type', 'answers'],
|
46 |
computed: {
|
@@ -136,6 +137,6 @@ learn_press_admin_view( 'question/option' );
|
|
136 |
}
|
137 |
}
|
138 |
})
|
139 |
-
})(
|
140 |
|
141 |
</script>
|
38 |
</script>
|
39 |
|
40 |
<script type="text/javascript">
|
41 |
+
(function ($store, $) {
|
42 |
+
window.$Vue = window.$Vue || Vue;
|
43 |
|
44 |
+
$Vue.component('lp-question-answer', {
|
45 |
template: '#tmpl-lp-question-answer',
|
46 |
props: ['type', 'answers'],
|
47 |
computed: {
|
137 |
}
|
138 |
}
|
139 |
})
|
140 |
+
})(LP_Question_Store, jQuery);
|
141 |
|
142 |
</script>
|
inc/admin/views/question/editor.php
CHANGED
@@ -24,9 +24,10 @@ learn_press_admin_view( 'question/answer' );
|
|
24 |
</script>
|
25 |
|
26 |
<script type="text/javascript">
|
27 |
-
(function (
|
|
|
28 |
|
29 |
-
Vue.component('lp-question-editor', {
|
30 |
template: '#tmpl-lp-question-editor',
|
31 |
mounted: function () {
|
32 |
var vm = this;
|
@@ -62,5 +63,5 @@ learn_press_admin_view( 'question/answer' );
|
|
62 |
}
|
63 |
});
|
64 |
|
65 |
-
})(
|
66 |
</script>
|
24 |
</script>
|
25 |
|
26 |
<script type="text/javascript">
|
27 |
+
(function ($store, $) {
|
28 |
+
window.$Vue = window.$Vue || Vue;
|
29 |
|
30 |
+
$Vue.component('lp-question-editor', {
|
31 |
template: '#tmpl-lp-question-editor',
|
32 |
mounted: function () {
|
33 |
var vm = this;
|
63 |
}
|
64 |
});
|
65 |
|
66 |
+
})(LP_Question_Store, jQuery);
|
67 |
</script>
|
inc/admin/views/question/option.php
CHANGED
@@ -30,9 +30,10 @@
|
|
30 |
</script>
|
31 |
|
32 |
<script type="text/javascript">
|
33 |
-
(function (
|
|
|
34 |
|
35 |
-
Vue.component('lp-question-answer-option', {
|
36 |
template: '#tmpl-lp-question-answer-option',
|
37 |
props: ['answer', 'index', 'type', 'radio', 'number'],
|
38 |
data: function () {
|
@@ -88,6 +89,6 @@
|
|
88 |
}
|
89 |
}
|
90 |
})
|
91 |
-
})(
|
92 |
|
93 |
</script>
|
30 |
</script>
|
31 |
|
32 |
<script type="text/javascript">
|
33 |
+
(function ($store, $) {
|
34 |
+
window.$Vue = window.$Vue || Vue;
|
35 |
|
36 |
+
$Vue.component('lp-question-answer-option', {
|
37 |
template: '#tmpl-lp-question-answer-option',
|
38 |
props: ['answer', 'index', 'type', 'radio', 'number'],
|
39 |
data: function () {
|
89 |
}
|
90 |
}
|
91 |
})
|
92 |
+
})(LP_Question_Store, jQuery);
|
93 |
|
94 |
</script>
|
inc/admin/views/quiz/added-items-preview.php
CHANGED
@@ -20,9 +20,10 @@
|
|
20 |
</script>
|
21 |
|
22 |
<script type="text/javascript">
|
23 |
-
(function (
|
|
|
24 |
|
25 |
-
Vue.component('lp-quiz-added-items-preview', {
|
26 |
template: '#tmpl-lp-quiz-added-items-preview',
|
27 |
props: {
|
28 |
// only show added items
|
@@ -41,5 +42,5 @@
|
|
41 |
}
|
42 |
);
|
43 |
|
44 |
-
})(
|
45 |
</script>
|
20 |
</script>
|
21 |
|
22 |
<script type="text/javascript">
|
23 |
+
(function ($store) {
|
24 |
+
window.$Vue = window.$Vue || Vue;
|
25 |
|
26 |
+
$Vue.component('lp-quiz-added-items-preview', {
|
27 |
template: '#tmpl-lp-quiz-added-items-preview',
|
28 |
props: {
|
29 |
// only show added items
|
42 |
}
|
43 |
);
|
44 |
|
45 |
+
})(LP_Quiz_Store);
|
46 |
</script>
|
inc/admin/views/quiz/editor.php
CHANGED
@@ -82,9 +82,10 @@ learn_press_admin_view( 'quiz/modal-choose-items' );
|
|
82 |
</script>
|
83 |
|
84 |
<script type="text/javascript">
|
85 |
-
(function (
|
|
|
86 |
|
87 |
-
Vue.component('lp-quiz-editor', {
|
88 |
template: '#tmpl-lp-quiz-editor',
|
89 |
data: function () {
|
90 |
return {
|
@@ -180,5 +181,5 @@ learn_press_admin_view( 'quiz/modal-choose-items' );
|
|
180 |
}
|
181 |
})
|
182 |
|
183 |
-
})(
|
184 |
</script>
|
82 |
</script>
|
83 |
|
84 |
<script type="text/javascript">
|
85 |
+
(function ($store, $) {
|
86 |
+
window.$Vue = window.$Vue || Vue;
|
87 |
|
88 |
+
$Vue.component('lp-quiz-editor', {
|
89 |
template: '#tmpl-lp-quiz-editor',
|
90 |
data: function () {
|
91 |
return {
|
181 |
}
|
182 |
})
|
183 |
|
184 |
+
})(LP_Quiz_Store, jQuery);
|
185 |
</script>
|
inc/admin/views/quiz/modal-choose-items.php
CHANGED
@@ -17,9 +17,10 @@ learn_press_admin_view( 'quiz/pagination' );
|
|
17 |
</script>
|
18 |
|
19 |
<script type="text/javascript">
|
20 |
-
(function (
|
|
|
21 |
|
22 |
-
Vue.component('lp-quiz-choose-item', {
|
23 |
template: '#tmpl-lp-quiz-choose-item',
|
24 |
props: ['item', 'added'],
|
25 |
watch: {
|
@@ -41,7 +42,7 @@ learn_press_admin_view( 'quiz/pagination' );
|
|
41 |
}
|
42 |
})
|
43 |
|
44 |
-
})(
|
45 |
</script>
|
46 |
|
47 |
<script type="text/x-template" id="tmpl-lp-quiz-choose-items">
|
@@ -103,9 +104,11 @@ learn_press_admin_view( 'quiz/pagination' );
|
|
103 |
</script>
|
104 |
|
105 |
<script>
|
106 |
-
|
107 |
|
108 |
-
|
|
|
|
|
109 |
template: '#tmpl-lp-quiz-choose-items',
|
110 |
data: function () {
|
111 |
return {
|
@@ -238,5 +241,5 @@ learn_press_admin_view( 'quiz/pagination' );
|
|
238 |
}
|
239 |
})
|
240 |
|
241 |
-
})(
|
242 |
</script>
|
17 |
</script>
|
18 |
|
19 |
<script type="text/javascript">
|
20 |
+
(function ($store) {
|
21 |
+
window.$Vue = window.$Vue || Vue;
|
22 |
|
23 |
+
$Vue.component('lp-quiz-choose-item', {
|
24 |
template: '#tmpl-lp-quiz-choose-item',
|
25 |
props: ['item', 'added'],
|
26 |
watch: {
|
42 |
}
|
43 |
})
|
44 |
|
45 |
+
})(LP_Quiz_Store);
|
46 |
</script>
|
47 |
|
48 |
<script type="text/x-template" id="tmpl-lp-quiz-choose-items">
|
104 |
</script>
|
105 |
|
106 |
<script>
|
107 |
+
window.$Vue = window.$Vue || Vue;
|
108 |
|
109 |
+
(function ($store, $) {
|
110 |
+
|
111 |
+
$Vue.component('lp-quiz-choose-items', {
|
112 |
template: '#tmpl-lp-quiz-choose-items',
|
113 |
data: function () {
|
114 |
return {
|
241 |
}
|
242 |
})
|
243 |
|
244 |
+
})(LP_Quiz_Store, jQuery)
|
245 |
</script>
|
inc/admin/views/quiz/pagination.php
CHANGED
@@ -26,9 +26,10 @@
|
|
26 |
</script>
|
27 |
|
28 |
<script type="text/javascript">
|
29 |
-
(function (
|
|
|
30 |
|
31 |
-
Vue.component('lp-quiz-pagination', {
|
32 |
template: '#tmpl-lp-quiz-pagination',
|
33 |
props: ['total'],
|
34 |
data: function () {
|
@@ -72,5 +73,5 @@
|
|
72 |
}
|
73 |
});
|
74 |
|
75 |
-
})(
|
76 |
</script>
|
26 |
</script>
|
27 |
|
28 |
<script type="text/javascript">
|
29 |
+
(function ($store, $) {
|
30 |
+
window.$Vue = window.$Vue || Vue;
|
31 |
|
32 |
+
$Vue.component('lp-quiz-pagination', {
|
33 |
template: '#tmpl-lp-quiz-pagination',
|
34 |
props: ['total'],
|
35 |
data: function () {
|
73 |
}
|
74 |
});
|
75 |
|
76 |
+
})(LP_Quiz_Store, jQuery)
|
77 |
</script>
|
inc/admin/views/quiz/question-actions.php
CHANGED
@@ -58,9 +58,10 @@
|
|
58 |
</script>
|
59 |
|
60 |
<script type="text/javascript">
|
61 |
-
(function (
|
|
|
62 |
|
63 |
-
Vue.component('lp-quiz-question-actions', {
|
64 |
template: '#tmpl-lp-quiz-question-actions',
|
65 |
props: ['question', 'index'],
|
66 |
data: function () {
|
@@ -160,5 +161,5 @@
|
|
160 |
}
|
161 |
});
|
162 |
|
163 |
-
})(
|
164 |
</script>
|
58 |
</script>
|
59 |
|
60 |
<script type="text/javascript">
|
61 |
+
(function ($store) {
|
62 |
+
window.$Vue = window.$Vue || Vue;
|
63 |
|
64 |
+
$Vue.component('lp-quiz-question-actions', {
|
65 |
template: '#tmpl-lp-quiz-question-actions',
|
66 |
props: ['question', 'index'],
|
67 |
data: function () {
|
161 |
}
|
162 |
});
|
163 |
|
164 |
+
})(LP_Quiz_Store);
|
165 |
</script>
|
inc/admin/views/quiz/question-answer-option.php
CHANGED
@@ -28,9 +28,10 @@
|
|
28 |
</script>
|
29 |
|
30 |
<script type="text/javascript">
|
31 |
-
(function (
|
|
|
32 |
|
33 |
-
Vue.component('lp-quiz-question-answer-option', {
|
34 |
template: '#tmpl-lp-quiz-question-answer-option',
|
35 |
props: ['question', 'answer', 'index'],
|
36 |
data: function () {
|
@@ -110,5 +111,5 @@
|
|
110 |
}
|
111 |
});
|
112 |
|
113 |
-
})(
|
114 |
</script>
|
28 |
</script>
|
29 |
|
30 |
<script type="text/javascript">
|
31 |
+
(function ($store) {
|
32 |
+
window.$Vue = window.$Vue || Vue;
|
33 |
|
34 |
+
$Vue.component('lp-quiz-question-answer-option', {
|
35 |
template: '#tmpl-lp-quiz-question-answer-option',
|
36 |
props: ['question', 'answer', 'index'],
|
37 |
data: function () {
|
111 |
}
|
112 |
});
|
113 |
|
114 |
+
})(LP_Quiz_Store);
|
115 |
</script>
|
inc/admin/views/quiz/question-answer.php
CHANGED
@@ -37,8 +37,10 @@ learn_press_admin_view( 'quiz/question-answer-option' );
|
|
37 |
</script>
|
38 |
|
39 |
<script type="text/javascript">
|
40 |
-
(function (
|
41 |
-
Vue
|
|
|
|
|
42 |
template: '#tmpl-lp-quiz-question-answers',
|
43 |
props: ['question'],
|
44 |
computed: {
|
@@ -127,5 +129,5 @@ learn_press_admin_view( 'quiz/question-answer-option' );
|
|
127 |
}
|
128 |
}
|
129 |
})
|
130 |
-
})(
|
131 |
</script>
|
37 |
</script>
|
38 |
|
39 |
<script type="text/javascript">
|
40 |
+
(function ($store, $) {
|
41 |
+
window.$Vue = window.$Vue || Vue;
|
42 |
+
|
43 |
+
$Vue.component('lp-quiz-question-answers', {
|
44 |
template: '#tmpl-lp-quiz-question-answers',
|
45 |
props: ['question'],
|
46 |
computed: {
|
129 |
}
|
130 |
}
|
131 |
})
|
132 |
+
})(LP_Quiz_Store, jQuery);
|
133 |
</script>
|
inc/admin/views/quiz/question-meta.php
CHANGED
@@ -72,9 +72,10 @@
|
|
72 |
</script>
|
73 |
|
74 |
<script type="text/javascript">
|
75 |
-
(function (
|
|
|
76 |
|
77 |
-
Vue.component('lp-quiz-question-meta', {
|
78 |
template: '#tmpl-lp-quiz-question-meta',
|
79 |
props: ['question'],
|
80 |
methods: {
|
@@ -109,5 +110,5 @@
|
|
109 |
}
|
110 |
})
|
111 |
|
112 |
-
})(
|
113 |
</script>
|
72 |
</script>
|
73 |
|
74 |
<script type="text/javascript">
|
75 |
+
(function ($store) {
|
76 |
+
window.$Vue = window.$Vue || Vue;
|
77 |
|
78 |
+
$Vue.component('lp-quiz-question-meta', {
|
79 |
template: '#tmpl-lp-quiz-question-meta',
|
80 |
props: ['question'],
|
81 |
methods: {
|
110 |
}
|
111 |
})
|
112 |
|
113 |
+
})(LP_Quiz_Store);
|
114 |
</script>
|
inc/admin/views/quiz/question-settings.php
CHANGED
@@ -25,8 +25,10 @@ learn_press_admin_view( 'quiz/question-meta' );
|
|
25 |
|
26 |
|
27 |
<script type="text/javascript">
|
28 |
-
(function ($,
|
29 |
-
Vue
|
|
|
|
|
30 |
template: '#tmpl-lp-quiz-question-settings',
|
31 |
props: ['question', 'index'],
|
32 |
computed: {
|
@@ -41,5 +43,5 @@ learn_press_admin_view( 'quiz/question-meta' );
|
|
41 |
}
|
42 |
}
|
43 |
})
|
44 |
-
})(jQuery,
|
45 |
</script>
|
25 |
|
26 |
|
27 |
<script type="text/javascript">
|
28 |
+
(function ($, $store) {
|
29 |
+
window.$Vue = window.$Vue || Vue;
|
30 |
+
|
31 |
+
$Vue.component('lp-quiz-question-settings', {
|
32 |
template: '#tmpl-lp-quiz-question-settings',
|
33 |
props: ['question', 'index'],
|
34 |
computed: {
|
43 |
}
|
44 |
}
|
45 |
})
|
46 |
+
})(jQuery, LP_Quiz_Store)
|
47 |
</script>
|
inc/admin/views/quiz/question.php
CHANGED
@@ -18,9 +18,10 @@ learn_press_admin_view( 'quiz/question-settings' );
|
|
18 |
</script>
|
19 |
|
20 |
<script type="text/javascript">
|
21 |
-
(function (
|
|
|
22 |
|
23 |
-
Vue.component('lp-quiz-question-item', {
|
24 |
template: '#tmpl-lp-quiz-question-item',
|
25 |
props: ['question', 'index'],
|
26 |
computed: {
|
@@ -54,5 +55,5 @@ learn_press_admin_view( 'quiz/question-settings' );
|
|
54 |
}
|
55 |
});
|
56 |
|
57 |
-
})(
|
58 |
</script>
|
18 |
</script>
|
19 |
|
20 |
<script type="text/javascript">
|
21 |
+
(function ($store, $) {
|
22 |
+
window.$Vue = window.$Vue || Vue;
|
23 |
|
24 |
+
$Vue.component('lp-quiz-question-item', {
|
25 |
template: '#tmpl-lp-quiz-question-item',
|
26 |
props: ['question', 'index'],
|
27 |
computed: {
|
55 |
}
|
56 |
});
|
57 |
|
58 |
+
})(LP_Quiz_Store, jQuery);
|
59 |
</script>
|
inc/admin/views/quiz/questions.php
CHANGED
@@ -16,9 +16,9 @@ learn_press_admin_view( 'quiz/question' );
|
|
16 |
</script>
|
17 |
|
18 |
<script type="text/javascript">
|
19 |
-
(function (
|
20 |
-
|
21 |
-
Vue.component('lp-quiz-questions', {
|
22 |
template: '#tmpl-lp-quiz-questions',
|
23 |
computed: {
|
24 |
// list quiz questions
|
@@ -55,5 +55,5 @@ learn_press_admin_view( 'quiz/question' );
|
|
55 |
}
|
56 |
});
|
57 |
|
58 |
-
})(
|
59 |
</script>
|
16 |
</script>
|
17 |
|
18 |
<script type="text/javascript">
|
19 |
+
(function ($store, $) {
|
20 |
+
window.$Vue = window.$Vue || Vue;
|
21 |
+
$Vue.component('lp-quiz-questions', {
|
22 |
template: '#tmpl-lp-quiz-questions',
|
23 |
computed: {
|
24 |
// list quiz questions
|
55 |
}
|
56 |
});
|
57 |
|
58 |
+
})(LP_Quiz_Store, jQuery)
|
59 |
</script>
|
inc/admin/views/tools/course/html-course.php
CHANGED
@@ -63,10 +63,13 @@ $localize = array(
|
|
63 |
);
|
64 |
?>
|
65 |
<script>
|
|
|
|
|
66 |
jQuery(function ($) {
|
|
|
67 |
var js_localize = <?php echo wp_json_encode( $localize );?>
|
68 |
|
69 |
-
new Vue({
|
70 |
el: '#learn-press-reset-course-users',
|
71 |
data: {
|
72 |
s: '',
|
63 |
);
|
64 |
?>
|
65 |
<script>
|
66 |
+
window.$Vue = window.$Vue || Vue;
|
67 |
+
|
68 |
jQuery(function ($) {
|
69 |
+
|
70 |
var js_localize = <?php echo wp_json_encode( $localize );?>
|
71 |
|
72 |
+
new $Vue({
|
73 |
el: '#learn-press-reset-course-users',
|
74 |
data: {
|
75 |
s: '',
|
inc/admin/views/tools/course/html-user-item.php
CHANGED
@@ -36,10 +36,12 @@ $localize = array(
|
|
36 |
);
|
37 |
?>
|
38 |
<script>
|
|
|
|
|
39 |
jQuery(function ($) {
|
40 |
var js_localize = <?php echo wp_json_encode( $localize );?>
|
41 |
|
42 |
-
new Vue({
|
43 |
el: '#learn-press-reset-user-item',
|
44 |
data: {
|
45 |
user_id: '',
|
36 |
);
|
37 |
?>
|
38 |
<script>
|
39 |
+
window.$Vue = window.$Vue || Vue;
|
40 |
+
|
41 |
jQuery(function ($) {
|
42 |
var js_localize = <?php echo wp_json_encode( $localize );?>
|
43 |
|
44 |
+
new $Vue({
|
45 |
el: '#learn-press-reset-user-item',
|
46 |
data: {
|
47 |
user_id: '',
|
inc/admin/views/tools/course/html-user.php
CHANGED
@@ -71,10 +71,12 @@ $localize = array(
|
|
71 |
);
|
72 |
?>
|
73 |
<script>
|
|
|
|
|
74 |
jQuery(function ($) {
|
75 |
var js_localize = <?php echo wp_json_encode( $localize );?>
|
76 |
|
77 |
-
new Vue({
|
78 |
el: '#learn-press-reset-user-courses',
|
79 |
data: {
|
80 |
s: '',
|
71 |
);
|
72 |
?>
|
73 |
<script>
|
74 |
+
window.$Vue = window.$Vue || Vue;
|
75 |
+
|
76 |
jQuery(function ($) {
|
77 |
var js_localize = <?php echo wp_json_encode( $localize );?>
|
78 |
|
79 |
+
new $Vue({
|
80 |
el: '#learn-press-reset-user-courses',
|
81 |
data: {
|
82 |
s: '',
|
inc/class-lp-assets.php
CHANGED
@@ -85,12 +85,12 @@ class LP_Assets extends LP_Abstract_Assets {
|
|
85 |
'enqueue' => false
|
86 |
),
|
87 |
'lp-vuex' => array(
|
88 |
-
'url' => self::url( 'js/vendor/vuex.
|
89 |
-
'ver' => '
|
90 |
'enqueue' => false
|
91 |
),
|
92 |
'lp-vue-resource' => array(
|
93 |
-
'url' => self::url( 'js/vendor/vue-resource.
|
94 |
'ver' => '1.3.4',
|
95 |
'enqueue' => false
|
96 |
),
|
85 |
'enqueue' => false
|
86 |
),
|
87 |
'lp-vuex' => array(
|
88 |
+
'url' => self::url( 'js/vendor/vuex.js' ),
|
89 |
+
'ver' => '3.1.0',
|
90 |
'enqueue' => false
|
91 |
),
|
92 |
'lp-vue-resource' => array(
|
93 |
+
'url' => self::url( 'js/vendor/vue-resource.js' ),
|
94 |
'ver' => '1.3.4',
|
95 |
'enqueue' => false
|
96 |
),
|
inc/curds/class-lp-course-curd.php
CHANGED
@@ -250,7 +250,7 @@ if ( ! class_exists( 'LP_Course_CURD' ) ) {
|
|
250 |
}
|
251 |
|
252 |
$query = $wpdb->prepare( "
|
253 |
-
SELECT item_id id,
|
254 |
FROM {$wpdb->learnpress_section_items} si
|
255 |
INNER JOIN {$wpdb->learnpress_sections} s ON si.section_id = s.section_id
|
256 |
INNER JOIN {$wpdb->posts} c ON c.ID = s.section_course_id
|
250 |
}
|
251 |
|
252 |
$query = $wpdb->prepare( "
|
253 |
+
SELECT item_id id, it.post_type `type`, si.section_id
|
254 |
FROM {$wpdb->learnpress_section_items} si
|
255 |
INNER JOIN {$wpdb->learnpress_sections} s ON si.section_id = s.section_id
|
256 |
INNER JOIN {$wpdb->posts} c ON c.ID = s.section_course_id
|
inc/curds/class-lp-helper-curd.php
CHANGED
@@ -16,9 +16,9 @@ class LP_Helper_CURD {
|
|
16 |
*
|
17 |
* @since 3.0.0
|
18 |
*
|
19 |
-
* @param string
|
20 |
-
* @param array
|
21 |
-
* @param int
|
22 |
*/
|
23 |
public static function update_meta_cache( $ids, $type = 'post', $limit = 500 ) {
|
24 |
|
@@ -95,6 +95,7 @@ class LP_Helper_CURD {
|
|
95 |
foreach ( $posts as $post ) {
|
96 |
$post = sanitize_post( $post, 'raw' );
|
97 |
$post_types[ $post->ID ] = $post->post_type;
|
|
|
98 |
wp_cache_set( $post->ID, $post, 'posts' );
|
99 |
}
|
100 |
}
|
16 |
*
|
17 |
* @since 3.0.0
|
18 |
*
|
19 |
+
* @param string $type - E.g: post, user, ...
|
20 |
+
* @param array|int $ids
|
21 |
+
* @param int $limit
|
22 |
*/
|
23 |
public static function update_meta_cache( $ids, $type = 'post', $limit = 500 ) {
|
24 |
|
95 |
foreach ( $posts as $post ) {
|
96 |
$post = sanitize_post( $post, 'raw' );
|
97 |
$post_types[ $post->ID ] = $post->post_type;
|
98 |
+
|
99 |
wp_cache_set( $post->ID, $post, 'posts' );
|
100 |
}
|
101 |
}
|
inc/curds/class-lp-order-curd.php
CHANGED
@@ -95,12 +95,17 @@ class LP_Order_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
|
|
95 |
* @return mixed
|
96 |
*/
|
97 |
public function read_items( $order ) {
|
98 |
-
|
99 |
global $wpdb;
|
100 |
-
|
101 |
$query = $wpdb->prepare( "
|
102 |
-
SELECT order_item_id as id, order_item_name as name
|
|
|
|
|
|
|
103 |
FROM {$wpdb->learnpress_order_items} oi
|
|
|
|
|
|
|
104 |
WHERE order_id = %d
|
105 |
", $order->get_id() );
|
106 |
|
@@ -110,7 +115,10 @@ class LP_Order_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
|
|
110 |
if ( $_items ) {
|
111 |
foreach ( $_items as $item ) {
|
112 |
$item = (array) $item;
|
113 |
-
$
|
|
|
|
|
|
|
114 |
if ( ! empty( $item['course_id'] ) ) {
|
115 |
$items[ $item['id'] ] = $item;
|
116 |
}
|
95 |
* @return mixed
|
96 |
*/
|
97 |
public function read_items( $order ) {
|
|
|
98 |
global $wpdb;
|
99 |
+
$screen = function_exists('get_current_screen')? get_current_screen():null;
|
100 |
$query = $wpdb->prepare( "
|
101 |
+
SELECT order_item_id as id, order_item_name as name
|
102 |
+
, oim.meta_value as `course_id`
|
103 |
+
# , oim2.meta_value as `quantity`
|
104 |
+
# , oim3.meta_value as `total`
|
105 |
FROM {$wpdb->learnpress_order_items} oi
|
106 |
+
INNER JOIN {$wpdb->learnpress_order_itemmeta} oim ON oi.order_item_id = oim.learnpress_order_item_id AND oim.meta_key='_course_id'
|
107 |
+
# INNER JOIN {$wpdb->learnpress_order_itemmeta} oim2 ON oi.order_item_id = oim2.learnpress_order_item_id AND oim2.meta_key='_quantity'
|
108 |
+
# INNER JOIN {$wpdb->learnpress_order_itemmeta} oim3 ON oi.order_item_id = oim3.learnpress_order_item_id AND oim3.meta_key='_total'
|
109 |
WHERE order_id = %d
|
110 |
", $order->get_id() );
|
111 |
|
115 |
if ( $_items ) {
|
116 |
foreach ( $_items as $item ) {
|
117 |
$item = (array) $item;
|
118 |
+
$items[$item['id']] = $item;
|
119 |
+
if(!$screen || $screen->id !== 'edit-lp_order'){
|
120 |
+
$this->get_item_meta( $item );
|
121 |
+
}
|
122 |
if ( ! empty( $item['course_id'] ) ) {
|
123 |
$items[ $item['id'] ] = $item;
|
124 |
}
|
inc/curds/class-lp-quiz-curd.php
CHANGED
@@ -236,10 +236,11 @@ if ( ! function_exists( 'LP_Quiz_CURD' ) ) {
|
|
236 |
SELECT question_id
|
237 |
FROM {$wpdb->posts} p
|
238 |
INNER JOIN {$wpdb->learnpress_quiz_questions} qq ON qq.quiz_id = p.ID
|
|
|
239 |
AND p.ID = %d
|
240 |
AND p.post_status = %s
|
241 |
ORDER BY question_order
|
242 |
-
", $quiz_id, 'publish' );
|
243 |
|
244 |
$ids = $wpdb->get_col( $query );
|
245 |
|
236 |
SELECT question_id
|
237 |
FROM {$wpdb->posts} p
|
238 |
INNER JOIN {$wpdb->learnpress_quiz_questions} qq ON qq.quiz_id = p.ID
|
239 |
+
INNER JOIN {$wpdb->posts} q ON qq.question_id = q.ID AND q.post_status <> %s
|
240 |
AND p.ID = %d
|
241 |
AND p.post_status = %s
|
242 |
ORDER BY question_order
|
243 |
+
", 'trash', $quiz_id, 'publish' );
|
244 |
|
245 |
$ids = $wpdb->get_col( $query );
|
246 |
|
inc/curds/class-lp-user-curd.php
CHANGED
@@ -507,15 +507,16 @@ class LP_User_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
|
|
507 |
* group of an item
|
508 |
*/
|
509 |
$query = $wpdb->prepare( "
|
510 |
-
SELECT
|
511 |
-
FROM (
|
512 |
-
SELECT
|
513 |
-
FROM {$wpdb->learnpress_user_items}
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
|
|
519 |
", $user_item_id );
|
520 |
|
521 |
return $wpdb->get_results( $query );
|
507 |
* group of an item
|
508 |
*/
|
509 |
$query = $wpdb->prepare( "
|
510 |
+
SELECT ui.*
|
511 |
+
FROM (
|
512 |
+
SELECT user_id, item_id, MAX(user_item_id) max_id
|
513 |
+
FROM {$wpdb->learnpress_user_items} GROUP BY user_id, item_id
|
514 |
+
) AS X
|
515 |
+
INNER JOIN {$wpdb->learnpress_user_items} ui ON ui.user_id = X.user_id AND ui.item_id = X.item_id AND ui.user_item_id = X.max_id
|
516 |
+
INNER JOIN {$wpdb->users} u ON u.ID = X.user_id
|
517 |
+
INNER JOIN {$wpdb->posts} p ON p.ID = X.item_id
|
518 |
+
WHERE ui.parent_id = %d
|
519 |
+
ORDER BY user_item_id ASC
|
520 |
", $user_item_id );
|
521 |
|
522 |
return $wpdb->get_results( $query );
|
inc/custom-post-types/abstract.php
CHANGED
@@ -151,7 +151,7 @@ abstract class LP_Abstract_Post_Type {
|
|
151 |
jQuery(function ($) {
|
152 |
var $input = $('#post-search-input'),
|
153 |
$form = $($input[0].form),
|
154 |
-
$select = $('<select name="author" id="author"></select>').append('<?php echo
|
155 |
ajax: {
|
156 |
url: window.location.href + '&lp-ajax=search-authors',
|
157 |
dataType: 'json',
|
151 |
jQuery(function ($) {
|
152 |
var $input = $('#post-search-input'),
|
153 |
$form = $($input[0].form),
|
154 |
+
$select = $('<select name="author" id="author"></select>').append($('<?php echo $option;?>')).insertAfter($input).select2({
|
155 |
ajax: {
|
156 |
url: window.location.href + '&lp-ajax=search-authors',
|
157 |
dataType: 'json',
|
inc/custom-post-types/course.php
CHANGED
@@ -108,7 +108,7 @@ if ( ! class_exists( 'LP_Course_Post_Type' ) ) {
|
|
108 |
'notice_sale_price' => __( 'Course sale price must less than the regular price', 'learnpress' ),
|
109 |
'notice_price' => __( 'Course price must greater than the sale price', 'learnpress' ),
|
110 |
'notice_sale_start_date' => __( 'Sale start date must before sale end date', 'learnpress' ),
|
111 |
-
'notice_sale_end_date' => __( 'Sale end date must
|
112 |
'notice_invalid_date' => __( 'Invalid date', 'learnpress' ),
|
113 |
),
|
114 |
'sections' => array(
|
@@ -1230,6 +1230,7 @@ if ( ! class_exists( 'LP_Course_Post_Type' ) ) {
|
|
1230 |
} else if ( ( $sale_price == '' ) || ( $sale_price < 0 ) || ( absint( $sale_price ) >= $price ) || ! $this->_validate_sale_price_date() ) {
|
1231 |
$keys = array( '_lp_sale_price', '_lp_sale_start', '_lp_sale_end' );
|
1232 |
}
|
|
|
1233 |
if ( $keys ) {
|
1234 |
$format = array_fill( 0, sizeof( $keys ), '%s' );
|
1235 |
$sql = "
|
@@ -1245,6 +1246,7 @@ if ( ! class_exists( 'LP_Course_Post_Type' ) ) {
|
|
1245 |
unset( $_REQUEST[ $key ] );
|
1246 |
unset( $_POST[ $key ] );
|
1247 |
}
|
|
|
1248 |
}
|
1249 |
|
1250 |
if ( $price ) {
|
@@ -1266,7 +1268,9 @@ if ( ! class_exists( 'LP_Course_Post_Type' ) ) {
|
|
1266 |
$end = strtotime( $sale_price_end );
|
1267 |
$start = strtotime( $sale_price_start );
|
1268 |
|
1269 |
-
|
|
|
|
|
1270 |
}
|
1271 |
|
1272 |
/**
|
108 |
'notice_sale_price' => __( 'Course sale price must less than the regular price', 'learnpress' ),
|
109 |
'notice_price' => __( 'Course price must greater than the sale price', 'learnpress' ),
|
110 |
'notice_sale_start_date' => __( 'Sale start date must before sale end date', 'learnpress' ),
|
111 |
+
'notice_sale_end_date' => __( 'Sale end date must after sale start date', 'learnpress' ),
|
112 |
'notice_invalid_date' => __( 'Invalid date', 'learnpress' ),
|
113 |
),
|
114 |
'sections' => array(
|
1230 |
} else if ( ( $sale_price == '' ) || ( $sale_price < 0 ) || ( absint( $sale_price ) >= $price ) || ! $this->_validate_sale_price_date() ) {
|
1231 |
$keys = array( '_lp_sale_price', '_lp_sale_start', '_lp_sale_end' );
|
1232 |
}
|
1233 |
+
|
1234 |
if ( $keys ) {
|
1235 |
$format = array_fill( 0, sizeof( $keys ), '%s' );
|
1236 |
$sql = "
|
1246 |
unset( $_REQUEST[ $key ] );
|
1247 |
unset( $_POST[ $key ] );
|
1248 |
}
|
1249 |
+
|
1250 |
}
|
1251 |
|
1252 |
if ( $price ) {
|
1268 |
$end = strtotime( $sale_price_end );
|
1269 |
$start = strtotime( $sale_price_start );
|
1270 |
|
1271 |
+
learn_press_debug($now, $sale_price_end, $sale_price_start, $end,$start);
|
1272 |
+
|
1273 |
+
return ( ( $sale_price_start ) && ( $now <= $end || ! $sale_price_end ) || ( ! $sale_price_start && ! $sale_price_end ) );
|
1274 |
}
|
1275 |
|
1276 |
/**
|
inc/custom-post-types/order.php
CHANGED
@@ -485,13 +485,12 @@ if ( ! class_exists( 'LP_Order_Post_Type' ) ) {
|
|
485 |
*/
|
486 |
public function posts_where_paged( $where ) {
|
487 |
global $wpdb, $wp_query;
|
488 |
-
|
489 |
-
if(is_admin() && $this->_is_archive() && !$wp_query->query['post_status']){
|
490 |
$statuses = array_keys(learn_press_get_register_order_statuses());
|
491 |
$search = "{$wpdb->posts}.post_status = 'publish' ";
|
492 |
$tmps = array($search);
|
493 |
$tmp = "{$wpdb->posts}.post_status = %s ";
|
494 |
-
foreach($statuses as $status ){
|
495 |
$tmps[]=$wpdb->prepare( $tmp, $status );
|
496 |
}
|
497 |
$replace = implode(' OR ',$tmps);
|
@@ -505,22 +504,9 @@ if ( ! class_exists( 'LP_Order_Post_Type' ) ) {
|
|
505 |
# filter by user id
|
506 |
preg_match( "#{$wpdb->posts}\.post_author IN\s*\((\d+)\)#", $where, $matches );
|
507 |
if ( ! empty( $matches ) && isset( $matches[1] ) ) {
|
508 |
-
|
509 |
$author_id = intval( $matches[1] );
|
510 |
-
$sql
|
511 |
-
|
512 |
-
FROM
|
513 |
-
{$wpdb->posts} AS p
|
514 |
-
INNER JOIN
|
515 |
-
{$wpdb->postmeta} m ON p.ID = m.post_id and p.post_type = %s
|
516 |
-
AND m.meta_key = %s
|
517 |
-
INNER JOIN
|
518 |
-
{$wpdb->users} u on m.meta_value = u.ID
|
519 |
-
WHERE
|
520 |
-
p.post_type = 'lp_order'
|
521 |
-
AND u.ID = %d ) ";
|
522 |
-
|
523 |
-
$sql = $wpdb->prepare( $sql, array( LP_ORDER_CPT, '_user_id', $author_id ) );
|
524 |
$where = str_replace( $matches[0], $sql, $where );
|
525 |
}
|
526 |
|
@@ -552,6 +538,7 @@ if ( ! class_exists( 'LP_Order_Post_Type' ) ) {
|
|
552 |
SELECT DISTINCT order_id FROM {$wpdb->learnpress_order_items} WHERE `order_item_name` like %s
|
553 |
)",$s);
|
554 |
if ( ! empty( $matches2 ) && isset( $matches2[0] ) ) {
|
|
|
555 |
$where = str_replace( $matches2[0], $sql . ' OR ' . $matches2[0], $where );
|
556 |
} else {
|
557 |
$where .= " AND " . $sql;
|
@@ -562,6 +549,8 @@ if ( ! class_exists( 'LP_Order_Post_Type' ) ) {
|
|
562 |
}
|
563 |
|
564 |
public function posts_fields( $fields ) {
|
|
|
|
|
565 |
if ( ! $this->_is_archive() || ! $this->_is_search() ) {
|
566 |
return $fields;
|
567 |
}
|
@@ -599,12 +588,16 @@ if ( ! class_exists( 'LP_Order_Post_Type' ) ) {
|
|
599 |
}
|
600 |
|
601 |
public function posts_join_paged( $join ) {
|
|
|
602 |
if ( ! $this->_is_archive() ) {
|
603 |
return $join;
|
604 |
}
|
605 |
-
|
606 |
$join .= " INNER JOIN {$wpdb->postmeta} pm1 ON {$wpdb->posts}.ID = pm1.post_id AND pm1.meta_key = '_user_id'";
|
607 |
$join .= " INNER JOIN {$wpdb->postmeta} pm2 ON {$wpdb->posts}.ID = pm2.post_id AND pm2.meta_key = '_order_total'";
|
|
|
|
|
|
|
608 |
$join .= " LEFT JOIN {$wpdb->users} uu ON pm1.meta_value = uu.ID";
|
609 |
|
610 |
return $join;
|
485 |
*/
|
486 |
public function posts_where_paged( $where ) {
|
487 |
global $wpdb, $wp_query;
|
488 |
+
if( is_admin() && $this->_is_archive() && !$wp_query->query['post_status'] ) {
|
|
|
489 |
$statuses = array_keys(learn_press_get_register_order_statuses());
|
490 |
$search = "{$wpdb->posts}.post_status = 'publish' ";
|
491 |
$tmps = array($search);
|
492 |
$tmp = "{$wpdb->posts}.post_status = %s ";
|
493 |
+
foreach( $statuses as $status ) {
|
494 |
$tmps[]=$wpdb->prepare( $tmp, $status );
|
495 |
}
|
496 |
$replace = implode(' OR ',$tmps);
|
504 |
# filter by user id
|
505 |
preg_match( "#{$wpdb->posts}\.post_author IN\s*\((\d+)\)#", $where, $matches );
|
506 |
if ( ! empty( $matches ) && isset( $matches[1] ) ) {
|
|
|
507 |
$author_id = intval( $matches[1] );
|
508 |
+
$sql = " pm1.meta_value = %d ";
|
509 |
+
$sql = $wpdb->prepare( $sql, $author_id );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
510 |
$where = str_replace( $matches[0], $sql, $where );
|
511 |
}
|
512 |
|
538 |
SELECT DISTINCT order_id FROM {$wpdb->learnpress_order_items} WHERE `order_item_name` like %s
|
539 |
)",$s);
|
540 |
if ( ! empty( $matches2 ) && isset( $matches2[0] ) ) {
|
541 |
+
$sql = $wpdb->prepare(" loi.order_item_name LIKE %s",$s);
|
542 |
$where = str_replace( $matches2[0], $sql . ' OR ' . $matches2[0], $where );
|
543 |
} else {
|
544 |
$where .= " AND " . $sql;
|
549 |
}
|
550 |
|
551 |
public function posts_fields( $fields ) {
|
552 |
+
global $wp_query;
|
553 |
+
|
554 |
if ( ! $this->_is_archive() || ! $this->_is_search() ) {
|
555 |
return $fields;
|
556 |
}
|
588 |
}
|
589 |
|
590 |
public function posts_join_paged( $join ) {
|
591 |
+
global $wpdb, $wp_query;
|
592 |
if ( ! $this->_is_archive() ) {
|
593 |
return $join;
|
594 |
}
|
595 |
+
$s = $wp_query->get( 's' );
|
596 |
$join .= " INNER JOIN {$wpdb->postmeta} pm1 ON {$wpdb->posts}.ID = pm1.post_id AND pm1.meta_key = '_user_id'";
|
597 |
$join .= " INNER JOIN {$wpdb->postmeta} pm2 ON {$wpdb->posts}.ID = pm2.post_id AND pm2.meta_key = '_order_total'";
|
598 |
+
if ( $s ) {
|
599 |
+
$join .= " INNER JOIN {$wpdb->learnpress_order_items} loi ON {$wpdb->posts}.ID = loi.order_id";
|
600 |
+
}
|
601 |
$join .= " LEFT JOIN {$wpdb->users} uu ON pm1.meta_value = uu.ID";
|
602 |
|
603 |
return $join;
|
inc/emails/class-lp-email-cancelled-order-instructor.php
CHANGED
@@ -67,7 +67,10 @@ if ( ! class_exists( 'LP_Email_Cancelled_Order_Instructor' ) ) {
|
|
67 |
/**
|
68 |
* If the instructor also is admin and email for admin is enabled
|
69 |
*/
|
70 |
-
|
|
|
|
|
|
|
71 |
continue;
|
72 |
}
|
73 |
|
67 |
/**
|
68 |
* If the instructor also is admin and email for admin is enabled
|
69 |
*/
|
70 |
+
$instructor_email = $instructor->get_email();
|
71 |
+
$admin_email = apply_filters( 'learn-press/email/admin-email', get_option( 'admin_email' ));
|
72 |
+
$admin_email =LP()->settings->get( 'emails_cancelled-order-admin.recipients', $admin_email );
|
73 |
+
if ( $user->is_admin() && $admin_email == $instructor_email && LP_Emails::get_email( 'cancelled-order-admin' )->enable() ) {
|
74 |
continue;
|
75 |
}
|
76 |
|
inc/emails/class-lp-email-enrolled-course-instructor.php
CHANGED
@@ -57,7 +57,10 @@ if ( ! class_exists( 'LP_Email_Enrolled_Course_Instructor' ) ) {
|
|
57 |
/**
|
58 |
* If the instructor also is admin and email for admin is enabled
|
59 |
*/
|
60 |
-
|
|
|
|
|
|
|
61 |
return false;
|
62 |
}
|
63 |
|
57 |
/**
|
58 |
* If the instructor also is admin and email for admin is enabled
|
59 |
*/
|
60 |
+
$instructor_email = $instructor->get_email();
|
61 |
+
$admin_email = apply_filters( 'learn-press/email/admin-email', get_option( 'admin_email' ));
|
62 |
+
$admin_email =LP()->settings->get( 'emails_enrolled-course-admin.recipients', $admin_email );
|
63 |
+
if ( $instructor->is_admin() && $admin_email== $instructor_email && LP_Emails::get_email( 'enrolled-course-admin' )->enable() ) {
|
64 |
return false;
|
65 |
}
|
66 |
|
inc/emails/class-lp-email-finished-course-instructor.php
CHANGED
@@ -57,7 +57,10 @@ if ( ! class_exists( 'LP_Email_Finished_Course_Instructor' ) ) {
|
|
57 |
/**
|
58 |
* If the instructor also is admin and email for admin is enabled
|
59 |
*/
|
60 |
-
|
|
|
|
|
|
|
61 |
return false;
|
62 |
}
|
63 |
|
57 |
/**
|
58 |
* If the instructor also is admin and email for admin is enabled
|
59 |
*/
|
60 |
+
$instructor_email = $instructor->get_email();
|
61 |
+
$admin_email = apply_filters( 'learn-press/email/admin-email', get_option( 'admin_email' ));
|
62 |
+
$admin_email =LP()->settings->get( 'emails_finished-course-admin.recipients', $admin_email );
|
63 |
+
if ( $instructor->is_admin() && $admin_email == $instructor_email && LP_Emails::get_email( 'finished-course-admin' )->enable() ) {
|
64 |
return false;
|
65 |
}
|
66 |
|
inc/emails/class-lp-email-new-order-instructor.php
CHANGED
@@ -81,7 +81,10 @@ if ( ! class_exists( 'LP_Email_New_Order_Instructor' ) ) {
|
|
81 |
/**
|
82 |
* If the instructor also is admin and email for admin is enabled
|
83 |
*/
|
84 |
-
|
|
|
|
|
|
|
85 |
continue;
|
86 |
}
|
87 |
|
81 |
/**
|
82 |
* If the instructor also is admin and email for admin is enabled
|
83 |
*/
|
84 |
+
$instructor_email = $instructor->get_email();
|
85 |
+
$admin_email = apply_filters( 'learn-press/email/admin-email', get_option( 'admin_email' ));
|
86 |
+
$admin_email =LP()->settings->get( 'emails_new-order-admin.recipients', $admin_email );
|
87 |
+
if ( $user->is_admin() && $admin_email == $instructor_email && LP_Emails::get_email( 'new-order-admin' )->enable() ) {
|
88 |
continue;
|
89 |
}
|
90 |
|
inc/lp-constants.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*/
|
5 |
$upload_dir = wp_upload_dir();
|
6 |
// version
|
7 |
-
define( 'LEARNPRESS_VERSION', '3.2.5.
|
8 |
|
9 |
define( 'LP_WP_CONTENT', basename( WP_CONTENT_DIR ) );
|
10 |
|
4 |
*/
|
5 |
$upload_dir = wp_upload_dir();
|
6 |
// version
|
7 |
+
define( 'LEARNPRESS_VERSION', '3.2.5.3' );
|
8 |
|
9 |
define( 'LP_WP_CONTENT', basename( WP_CONTENT_DIR ) );
|
10 |
|
inc/lp-core-functions.php
CHANGED
@@ -99,11 +99,10 @@ function learn_press_is_debug() {
|
|
99 |
*/
|
100 |
function learn_press_get_post() {
|
101 |
global $post;
|
102 |
-
$post_id =
|
103 |
-
if
|
104 |
-
$post_id =
|
105 |
}
|
106 |
-
|
107 |
if ( empty( $post_id ) ) {
|
108 |
$post_id = learn_press_get_request( 'post_ID' );
|
109 |
}
|
@@ -1563,7 +1562,13 @@ function learn_press_get_become_a_teacher_form_fields() {
|
|
1563 |
'type' => 'text',
|
1564 |
'placeholder' => __( 'Your phone number', 'learnpress' ),
|
1565 |
'id' => 'bat_phone'
|
1566 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
1567 |
);
|
1568 |
$fields = apply_filters( 'learn_press_become_teacher_form_fields', $fields );
|
1569 |
|
@@ -1584,7 +1589,8 @@ function learn_press_process_become_a_teacher_form( $args = null ) {
|
|
1584 |
array(
|
1585 |
'name' => null,
|
1586 |
'email' => null,
|
1587 |
-
'phone' => null
|
|
|
1588 |
)
|
1589 |
);
|
1590 |
|
@@ -1607,7 +1613,7 @@ function learn_press_process_become_a_teacher_form( $args = null ) {
|
|
1607 |
$subject = __( 'Please moderate', 'learnpress' );
|
1608 |
|
1609 |
$fields = learn_press_get_become_a_teacher_form_fields();
|
1610 |
-
$default_fields = array( 'bat_name', 'bat_email', 'bat_phone' );
|
1611 |
foreach ( $fields as $key => $field ) {
|
1612 |
if ( isset( $_POST[ $key ] ) ) {
|
1613 |
$fields[ $key ]['value'] = $_POST[ $key ];
|
@@ -1619,6 +1625,7 @@ function learn_press_process_become_a_teacher_form( $args = null ) {
|
|
1619 |
$notify_message .= sprintf( __( 'Name: %s', 'learnpress' ), $args['name'] ) . "\r\n";
|
1620 |
$notify_message .= sprintf( __( 'Email: %s', 'learnpress' ), $args['email'] ) . "\r\n";
|
1621 |
$notify_message .= sprintf( __( 'Phone: %s', 'learnpress' ), $args['phone'] ) . "\r\n";
|
|
|
1622 |
foreach ( $fields as $key => $field ) {
|
1623 |
if ( ! in_array( $key, $default_fields ) ) {
|
1624 |
$notify_message .= $field['title'] . ': ' . ( isset( $field['value'] ) ? $field['value'] : '' ) . "\r\n";
|
99 |
*/
|
100 |
function learn_press_get_post() {
|
101 |
global $post;
|
102 |
+
$post_id = learn_press_get_request( 'post' );
|
103 |
+
if(!$post_id){
|
104 |
+
$post_id = ! empty( $post ) ? $post->ID : 0;
|
105 |
}
|
|
|
106 |
if ( empty( $post_id ) ) {
|
107 |
$post_id = learn_press_get_request( 'post_ID' );
|
108 |
}
|
1562 |
'type' => 'text',
|
1563 |
'placeholder' => __( 'Your phone number', 'learnpress' ),
|
1564 |
'id' => 'bat_phone'
|
1565 |
+
),
|
1566 |
+
'bat_message' => array(
|
1567 |
+
'title' => __( 'Message', 'learnpress' ),
|
1568 |
+
'type' => 'textarea',
|
1569 |
+
'placeholder' => __( 'Your message', 'learnpress' ),
|
1570 |
+
'id' => 'bat_message'
|
1571 |
+
)
|
1572 |
);
|
1573 |
$fields = apply_filters( 'learn_press_become_teacher_form_fields', $fields );
|
1574 |
|
1589 |
array(
|
1590 |
'name' => null,
|
1591 |
'email' => null,
|
1592 |
+
'phone' => null,
|
1593 |
+
'message' => null,
|
1594 |
)
|
1595 |
);
|
1596 |
|
1613 |
$subject = __( 'Please moderate', 'learnpress' );
|
1614 |
|
1615 |
$fields = learn_press_get_become_a_teacher_form_fields();
|
1616 |
+
$default_fields = array( 'bat_name', 'bat_email', 'bat_phone', 'bat_message' );
|
1617 |
foreach ( $fields as $key => $field ) {
|
1618 |
if ( isset( $_POST[ $key ] ) ) {
|
1619 |
$fields[ $key ]['value'] = $_POST[ $key ];
|
1625 |
$notify_message .= sprintf( __( 'Name: %s', 'learnpress' ), $args['name'] ) . "\r\n";
|
1626 |
$notify_message .= sprintf( __( 'Email: %s', 'learnpress' ), $args['email'] ) . "\r\n";
|
1627 |
$notify_message .= sprintf( __( 'Phone: %s', 'learnpress' ), $args['phone'] ) . "\r\n";
|
1628 |
+
$notify_message .= sprintf( __( 'Message: %s', 'learnpress' ), $args['message'] ) . "\r\n";
|
1629 |
foreach ( $fields as $key => $field ) {
|
1630 |
if ( ! in_array( $key, $default_fields ) ) {
|
1631 |
$notify_message .= $field['title'] . ': ' . ( isset( $field['value'] ) ? $field['value'] : '' ) . "\r\n";
|
inc/lp-template-functions.php
CHANGED
@@ -73,19 +73,22 @@ if ( ! function_exists( 'learn_press_course_enroll_button' ) ) {
|
|
73 |
$course = LP_Global::course();
|
74 |
|
75 |
if ( $course->get_external_link() ) {
|
76 |
-
learn_press_show_log('Course has external link');
|
|
|
77 |
return;
|
78 |
}
|
79 |
|
80 |
// If course is not published
|
81 |
if ( ! $course->is_publish() ) {
|
82 |
-
learn_press_show_log('Course is not published');
|
|
|
83 |
return;
|
84 |
}
|
85 |
|
86 |
// Locked course for user
|
87 |
if ( $user->is_locked_course( $course->get_id() ) ) {
|
88 |
-
learn_press_show_log('Course is locked');
|
|
|
89 |
return;
|
90 |
}
|
91 |
|
@@ -583,7 +586,7 @@ if ( ! function_exists( 'learn_press_get_course_tabs' ) ) {
|
|
583 |
if ( $request_tab === $v['id'] ) {
|
584 |
$v['active'] = true;
|
585 |
$has_active = $k;
|
586 |
-
} elseif(isset($v['active']) && $v['active'] ){
|
587 |
$has_active = true;
|
588 |
}
|
589 |
$tabs[ $k ] = $v;
|
@@ -2125,7 +2128,7 @@ function learn_press_setup_object_data( $post ) {
|
|
2125 |
if ( isset( $GLOBALS['course'] ) ) {
|
2126 |
unset( $GLOBALS['course'] );
|
2127 |
}
|
2128 |
-
$object
|
2129 |
$object->prepare();
|
2130 |
LP()->global['course'] = $GLOBALS['course'] = $GLOBALS['lp_course'] = $object;
|
2131 |
}
|
@@ -3730,7 +3733,7 @@ add_action( 'wp_enqueue_scripts', 'learn_press_maybe_load_comment_js' );
|
|
3730 |
|
3731 |
add_filter( 'learn-press/can-view-item', 'learn_press_filter_can_view_item', 10, 4 );
|
3732 |
|
3733 |
-
function learn_press_filter_can_view_item( $view, $item_id, $
|
3734 |
$user = learn_press_get_user( $user_id );
|
3735 |
|
3736 |
if ( ! get_post_meta( $course_id, '_lp_submission', true ) ) {
|
73 |
$course = LP_Global::course();
|
74 |
|
75 |
if ( $course->get_external_link() ) {
|
76 |
+
learn_press_show_log( 'Course has external link' );
|
77 |
+
|
78 |
return;
|
79 |
}
|
80 |
|
81 |
// If course is not published
|
82 |
if ( ! $course->is_publish() ) {
|
83 |
+
learn_press_show_log( 'Course is not published' );
|
84 |
+
|
85 |
return;
|
86 |
}
|
87 |
|
88 |
// Locked course for user
|
89 |
if ( $user->is_locked_course( $course->get_id() ) ) {
|
90 |
+
learn_press_show_log( 'Course is locked' );
|
91 |
+
|
92 |
return;
|
93 |
}
|
94 |
|
586 |
if ( $request_tab === $v['id'] ) {
|
587 |
$v['active'] = true;
|
588 |
$has_active = $k;
|
589 |
+
} elseif ( isset( $v['active'] ) && $v['active'] ) {
|
590 |
$has_active = true;
|
591 |
}
|
592 |
$tabs[ $k ] = $v;
|
2128 |
if ( isset( $GLOBALS['course'] ) ) {
|
2129 |
unset( $GLOBALS['course'] );
|
2130 |
}
|
2131 |
+
$object = learn_press_get_course( $post );
|
2132 |
$object->prepare();
|
2133 |
LP()->global['course'] = $GLOBALS['course'] = $GLOBALS['lp_course'] = $object;
|
2134 |
}
|
3733 |
|
3734 |
add_filter( 'learn-press/can-view-item', 'learn_press_filter_can_view_item', 10, 4 );
|
3735 |
|
3736 |
+
function learn_press_filter_can_view_item( $view, $item_id, $user_id, $course_id ) {
|
3737 |
$user = learn_press_get_user( $user_id );
|
3738 |
|
3739 |
if ( ! get_post_meta( $course_id, '_lp_submission', true ) ) {
|
inc/quiz/class-lp-quiz.php
CHANGED
@@ -335,8 +335,9 @@ if ( ! class_exists( 'LP_Quiz' ) ) {
|
|
335 |
$questions = $this->get_questions();
|
336 |
$mark = 0;
|
337 |
foreach ( $questions as $question_id ) {
|
338 |
-
$question = LP_Question::get_question( $question_id )
|
339 |
-
|
|
|
340 |
}
|
341 |
$this->_set_data( 'mark', $mark );
|
342 |
}
|
@@ -582,11 +583,11 @@ if ( ! class_exists( 'LP_Quiz' ) ) {
|
|
582 |
if ( '' != get_option( 'permalink_structure' ) && get_post_status( $this->get_id() ) != 'draft' ) {
|
583 |
if ( get_post_type( $question_id ) === LP_QUESTION_CPT ) {
|
584 |
$question_name = get_post_field( 'post_name', $question_id );
|
585 |
-
preg_match('/\?/i', $permalink, $result);
|
586 |
-
if(empty($result)){
|
587 |
-
$permalink
|
588 |
} else {
|
589 |
-
$permalink = preg_replace('/\?/i', '/'
|
590 |
}
|
591 |
}
|
592 |
} else {
|
335 |
$questions = $this->get_questions();
|
336 |
$mark = 0;
|
337 |
foreach ( $questions as $question_id ) {
|
338 |
+
if ( $question = LP_Question::get_question( $question_id ) ) {
|
339 |
+
$mark += $question->get_mark();
|
340 |
+
}
|
341 |
}
|
342 |
$this->_set_data( 'mark', $mark );
|
343 |
}
|
583 |
if ( '' != get_option( 'permalink_structure' ) && get_post_status( $this->get_id() ) != 'draft' ) {
|
584 |
if ( get_post_type( $question_id ) === LP_QUESTION_CPT ) {
|
585 |
$question_name = get_post_field( 'post_name', $question_id );
|
586 |
+
preg_match( '/\?/i', $permalink, $result );
|
587 |
+
if ( empty( $result ) ) {
|
588 |
+
$permalink = $permalink . $question_name;
|
589 |
} else {
|
590 |
+
$permalink = preg_replace( '/\?/i', '/' . $question_name . '/?', $permalink );
|
591 |
}
|
592 |
}
|
593 |
} else {
|
inc/user-item/class-lp-user-item-quiz.php
CHANGED
@@ -244,7 +244,7 @@ class LP_User_Item_Quiz extends LP_User_Item {
|
|
244 |
$result['question_empty'] ++;
|
245 |
} else {
|
246 |
// minus for each wrong, empty question
|
247 |
-
$result['user_mark'] -= $quiz->get_minus_points();
|
248 |
$result['question_wrong'] ++;
|
249 |
}
|
250 |
}
|
244 |
$result['question_empty'] ++;
|
245 |
} else {
|
246 |
// minus for each wrong, empty question
|
247 |
+
$result['user_mark'] -= intval($quiz->get_minus_points());
|
248 |
$result['question_wrong'] ++;
|
249 |
}
|
250 |
}
|
learnpress.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: LearnPress
|
|
4 |
Plugin URI: http://thimpress.com/learnpress
|
5 |
Description: LearnPress is a WordPress complete solution for creating a Learning Management System (LMS). It can help you to create courses, lessons and quizzes.
|
6 |
Author: ThimPress
|
7 |
-
Version: 3.2.5.
|
8 |
Author URI: http://thimpress.com
|
9 |
Requires at least: 3.8
|
10 |
Tested up to: 5.0.2
|
4 |
Plugin URI: http://thimpress.com/learnpress
|
5 |
Description: LearnPress is a WordPress complete solution for creating a Learning Management System (LMS). It can help you to create courses, lessons and quizzes.
|
6 |
Author: ThimPress
|
7 |
+
Version: 3.2.5.3
|
8 |
Author URI: http://thimpress.com
|
9 |
Requires at least: 3.8
|
10 |
Tested up to: 5.0.2
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link:
|
|
4 |
Tags: WordPress LMS, LMS, eLearning, e-Learning, Learning Management System, LMS WordPress, Course, Courses, Quiz, Quizzes, Training, Guru, Sell Courses
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 5.0.2
|
7 |
-
Stable tag: 3.2.5.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -199,6 +199,12 @@ https://www.transifex.com/projects/p/learnpress/
|
|
199 |
8. Add-ons of LearnPress.
|
200 |
|
201 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
= 3.2.5.2 =
|
203 |
~ Fixed bug can't access course after purchased.
|
204 |
~ Fixed bug user can't redo quiz with option 'Retake' is 1.
|
4 |
Tags: WordPress LMS, LMS, eLearning, e-Learning, Learning Management System, LMS WordPress, Course, Courses, Quiz, Quizzes, Training, Guru, Sell Courses
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 5.0.2
|
7 |
+
Stable tag: 3.2.5.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
199 |
8. Add-ons of LearnPress.
|
200 |
|
201 |
== Changelog ==
|
202 |
+
= 3.2.5.3 =
|
203 |
+
~ Changed SQL to read course items by user item ID.
|
204 |
+
~ Improved performance in admin orders page.
|
205 |
+
~ Upgraded Vue/Vuex to latest version.
|
206 |
+
~ Added new theme to LP ad.
|
207 |
+
|
208 |
= 3.2.5.2 =
|
209 |
~ Fixed bug can't access course after purchased.
|
210 |
~ Fixed bug user can't redo quiz with option 'Retake' is 1.
|
templates/emails/order-items-table.php
CHANGED
@@ -43,7 +43,7 @@ if ( ! $items ) {
|
|
43 |
</tr>
|
44 |
<tr>
|
45 |
<th><?php _e( 'Purchase Date', 'learnpress' ); ?></th>
|
46 |
-
<td><?php echo date_i18n( get_option( 'date_format' ),
|
47 |
</tr>
|
48 |
<tr>
|
49 |
<th><?php _e( 'Payment Method', 'learnpress' ); ?></th>
|
43 |
</tr>
|
44 |
<tr>
|
45 |
<th><?php _e( 'Purchase Date', 'learnpress' ); ?></th>
|
46 |
+
<td><?php echo date_i18n( get_option( 'date_format' ), $order->get_order_date( 'timestamp' ) ); ?></td>
|
47 |
</tr>
|
48 |
<tr>
|
49 |
<th><?php _e( 'Payment Method', 'learnpress' ); ?></th>
|