@vue/runtime-core 3.5.0-alpha.4 → 3.5.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/runtime-core.cjs.js +2784 -2615
- package/dist/runtime-core.cjs.prod.js +2177 -2017
- package/dist/runtime-core.d.ts +86 -63
- package/dist/runtime-core.esm-bundler.js +2798 -2633
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.0-
|
|
2
|
+
* @vue/runtime-core v3.5.0-beta.1
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -422,11 +422,8 @@ const TeleportImpl = {
|
|
|
422
422
|
if (n1 == null) {
|
|
423
423
|
const placeholder = n2.el = createText("");
|
|
424
424
|
const mainAnchor = n2.anchor = createText("");
|
|
425
|
-
const targetStart = n2.targetStart = createText("");
|
|
426
|
-
const targetAnchor = n2.targetAnchor = createText("");
|
|
427
425
|
insert(placeholder, container, anchor);
|
|
428
426
|
insert(mainAnchor, container, anchor);
|
|
429
|
-
targetStart[TeleportEndKey] = targetAnchor;
|
|
430
427
|
const mount = (container2, anchor2) => {
|
|
431
428
|
if (shapeFlag & 16) {
|
|
432
429
|
mountChildren(
|
|
@@ -443,9 +440,8 @@ const TeleportImpl = {
|
|
|
443
440
|
};
|
|
444
441
|
const mountToTarget = () => {
|
|
445
442
|
const target = n2.target = resolveTarget(n2.props, querySelector);
|
|
443
|
+
const targetAnchor = prepareAnchor(target, n2, createText, insert);
|
|
446
444
|
if (target) {
|
|
447
|
-
insert(targetStart, target);
|
|
448
|
-
insert(targetAnchor, target);
|
|
449
445
|
if (namespace !== "svg" && isTargetSVG(target)) {
|
|
450
446
|
namespace = "svg";
|
|
451
447
|
} else if (namespace !== "mathml" && isTargetMathML(target)) {
|
|
@@ -604,7 +600,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
604
600
|
}
|
|
605
601
|
}
|
|
606
602
|
function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
|
|
607
|
-
o: { nextSibling, parentNode, querySelector }
|
|
603
|
+
o: { nextSibling, parentNode, querySelector, insert, createText }
|
|
608
604
|
}, hydrateChildren) {
|
|
609
605
|
const target = vnode.target = resolveTarget(
|
|
610
606
|
vnode.props,
|
|
@@ -623,20 +619,28 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
623
619
|
slotScopeIds,
|
|
624
620
|
optimized
|
|
625
621
|
);
|
|
626
|
-
vnode.
|
|
622
|
+
vnode.targetStart = targetNode;
|
|
623
|
+
vnode.targetAnchor = targetNode && nextSibling(targetNode);
|
|
627
624
|
} else {
|
|
628
625
|
vnode.anchor = nextSibling(node);
|
|
629
626
|
let targetAnchor = targetNode;
|
|
630
627
|
while (targetAnchor) {
|
|
631
|
-
targetAnchor
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
628
|
+
if (targetAnchor && targetAnchor.nodeType === 8) {
|
|
629
|
+
if (targetAnchor.data === "teleport start anchor") {
|
|
630
|
+
vnode.targetStart = targetAnchor;
|
|
631
|
+
} else if (targetAnchor.data === "teleport anchor") {
|
|
632
|
+
vnode.targetAnchor = targetAnchor;
|
|
633
|
+
target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
634
|
+
break;
|
|
635
|
+
}
|
|
636
636
|
}
|
|
637
|
+
targetAnchor = nextSibling(targetAnchor);
|
|
638
|
+
}
|
|
639
|
+
if (!vnode.targetAnchor) {
|
|
640
|
+
prepareAnchor(target, vnode, createText, insert);
|
|
637
641
|
}
|
|
638
642
|
hydrateChildren(
|
|
639
|
-
targetNode,
|
|
643
|
+
targetNode && nextSibling(targetNode),
|
|
640
644
|
vnode,
|
|
641
645
|
target,
|
|
642
646
|
parentComponent,
|
|
@@ -662,6 +666,16 @@ function updateCssVars(vnode) {
|
|
|
662
666
|
ctx.ut();
|
|
663
667
|
}
|
|
664
668
|
}
|
|
669
|
+
function prepareAnchor(target, vnode, createText, insert) {
|
|
670
|
+
const targetStart = vnode.targetStart = createText("");
|
|
671
|
+
const targetAnchor = vnode.targetAnchor = createText("");
|
|
672
|
+
targetStart[TeleportEndKey] = targetAnchor;
|
|
673
|
+
if (target) {
|
|
674
|
+
insert(targetStart, target);
|
|
675
|
+
insert(targetAnchor, target);
|
|
676
|
+
}
|
|
677
|
+
return targetAnchor;
|
|
678
|
+
}
|
|
665
679
|
|
|
666
680
|
const leaveCbKey = Symbol("_leaveCb");
|
|
667
681
|
const enterCbKey = Symbol("_enterCb");
|
|
@@ -1015,2160 +1029,2287 @@ function markAsyncBoundary(instance) {
|
|
|
1015
1029
|
instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
|
|
1016
1030
|
}
|
|
1017
1031
|
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1032
|
+
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
1033
|
+
if (shared.isArray(rawRef)) {
|
|
1034
|
+
rawRef.forEach(
|
|
1035
|
+
(r, i) => setRef(
|
|
1036
|
+
r,
|
|
1037
|
+
oldRawRef && (shared.isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
|
|
1038
|
+
parentSuspense,
|
|
1039
|
+
vnode,
|
|
1040
|
+
isUnmount
|
|
1041
|
+
)
|
|
1042
|
+
);
|
|
1043
|
+
return;
|
|
1024
1044
|
}
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
retries++;
|
|
1040
|
-
pendingRequest = null;
|
|
1041
|
-
return load();
|
|
1042
|
-
};
|
|
1043
|
-
const load = () => {
|
|
1044
|
-
let thisRequest;
|
|
1045
|
-
return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
|
|
1046
|
-
err = err instanceof Error ? err : new Error(String(err));
|
|
1047
|
-
if (userOnError) {
|
|
1048
|
-
return new Promise((resolve, reject) => {
|
|
1049
|
-
const userRetry = () => resolve(retry());
|
|
1050
|
-
const userFail = () => reject(err);
|
|
1051
|
-
userOnError(err, userRetry, userFail, retries + 1);
|
|
1052
|
-
});
|
|
1053
|
-
} else {
|
|
1054
|
-
throw err;
|
|
1055
|
-
}
|
|
1056
|
-
}).then((comp) => {
|
|
1057
|
-
if (thisRequest !== pendingRequest && pendingRequest) {
|
|
1058
|
-
return pendingRequest;
|
|
1059
|
-
}
|
|
1060
|
-
if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
|
|
1061
|
-
comp = comp.default;
|
|
1062
|
-
}
|
|
1063
|
-
resolvedComp = comp;
|
|
1064
|
-
return comp;
|
|
1065
|
-
}));
|
|
1066
|
-
};
|
|
1067
|
-
return defineComponent({
|
|
1068
|
-
name: "AsyncComponentWrapper",
|
|
1069
|
-
__asyncLoader: load,
|
|
1070
|
-
get __asyncResolved() {
|
|
1071
|
-
return resolvedComp;
|
|
1072
|
-
},
|
|
1073
|
-
setup() {
|
|
1074
|
-
const instance = currentInstance;
|
|
1075
|
-
markAsyncBoundary(instance);
|
|
1076
|
-
if (resolvedComp) {
|
|
1077
|
-
return () => createInnerComp(resolvedComp, instance);
|
|
1078
|
-
}
|
|
1079
|
-
const onError = (err) => {
|
|
1080
|
-
pendingRequest = null;
|
|
1081
|
-
handleError(
|
|
1082
|
-
err,
|
|
1083
|
-
instance,
|
|
1084
|
-
13,
|
|
1085
|
-
!errorComponent
|
|
1086
|
-
);
|
|
1087
|
-
};
|
|
1088
|
-
if (suspensible && instance.suspense || isInSSRComponentSetup) {
|
|
1089
|
-
return load().then((comp) => {
|
|
1090
|
-
return () => createInnerComp(comp, instance);
|
|
1091
|
-
}).catch((err) => {
|
|
1092
|
-
onError(err);
|
|
1093
|
-
return () => errorComponent ? createVNode(errorComponent, {
|
|
1094
|
-
error: err
|
|
1095
|
-
}) : null;
|
|
1096
|
-
});
|
|
1097
|
-
}
|
|
1098
|
-
const loaded = reactivity.ref(false);
|
|
1099
|
-
const error = reactivity.ref();
|
|
1100
|
-
const delayed = reactivity.ref(!!delay);
|
|
1101
|
-
if (delay) {
|
|
1102
|
-
setTimeout(() => {
|
|
1103
|
-
delayed.value = false;
|
|
1104
|
-
}, delay);
|
|
1045
|
+
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
|
|
1049
|
+
const value = isUnmount ? null : refValue;
|
|
1050
|
+
const { i: owner, r: ref } = rawRef;
|
|
1051
|
+
const oldRef = oldRawRef && oldRawRef.r;
|
|
1052
|
+
const refs = owner.refs === shared.EMPTY_OBJ ? owner.refs = {} : owner.refs;
|
|
1053
|
+
const setupState = owner.setupState;
|
|
1054
|
+
if (oldRef != null && oldRef !== ref) {
|
|
1055
|
+
if (shared.isString(oldRef)) {
|
|
1056
|
+
refs[oldRef] = null;
|
|
1057
|
+
if (shared.hasOwn(setupState, oldRef)) {
|
|
1058
|
+
setupState[oldRef] = null;
|
|
1105
1059
|
}
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1060
|
+
} else if (reactivity.isRef(oldRef)) {
|
|
1061
|
+
oldRef.value = null;
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
if (shared.isFunction(ref)) {
|
|
1065
|
+
callWithErrorHandling(ref, owner, 12, [value, refs]);
|
|
1066
|
+
} else {
|
|
1067
|
+
const _isString = shared.isString(ref);
|
|
1068
|
+
const _isRef = reactivity.isRef(ref);
|
|
1069
|
+
if (_isString || _isRef) {
|
|
1070
|
+
const doSet = () => {
|
|
1071
|
+
if (rawRef.f) {
|
|
1072
|
+
const existing = _isString ? shared.hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
|
|
1073
|
+
if (isUnmount) {
|
|
1074
|
+
shared.isArray(existing) && shared.remove(existing, refValue);
|
|
1075
|
+
} else {
|
|
1076
|
+
if (!shared.isArray(existing)) {
|
|
1077
|
+
if (_isString) {
|
|
1078
|
+
refs[ref] = [refValue];
|
|
1079
|
+
if (shared.hasOwn(setupState, ref)) {
|
|
1080
|
+
setupState[ref] = refs[ref];
|
|
1081
|
+
}
|
|
1082
|
+
} else {
|
|
1083
|
+
ref.value = [refValue];
|
|
1084
|
+
if (rawRef.k) refs[rawRef.k] = ref.value;
|
|
1085
|
+
}
|
|
1086
|
+
} else if (!existing.includes(refValue)) {
|
|
1087
|
+
existing.push(refValue);
|
|
1088
|
+
}
|
|
1114
1089
|
}
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
error.value = err;
|
|
1125
|
-
});
|
|
1126
|
-
return () => {
|
|
1127
|
-
if (loaded.value && resolvedComp) {
|
|
1128
|
-
return createInnerComp(resolvedComp, instance);
|
|
1129
|
-
} else if (error.value && errorComponent) {
|
|
1130
|
-
return createVNode(errorComponent, {
|
|
1131
|
-
error: error.value
|
|
1132
|
-
});
|
|
1133
|
-
} else if (loadingComponent && !delayed.value) {
|
|
1134
|
-
return createVNode(loadingComponent);
|
|
1135
|
-
}
|
|
1090
|
+
} else if (_isString) {
|
|
1091
|
+
refs[ref] = value;
|
|
1092
|
+
if (shared.hasOwn(setupState, ref)) {
|
|
1093
|
+
setupState[ref] = value;
|
|
1094
|
+
}
|
|
1095
|
+
} else if (_isRef) {
|
|
1096
|
+
ref.value = value;
|
|
1097
|
+
if (rawRef.k) refs[rawRef.k] = value;
|
|
1098
|
+
} else ;
|
|
1136
1099
|
};
|
|
1100
|
+
if (value) {
|
|
1101
|
+
doSet.id = -1;
|
|
1102
|
+
queuePostRenderEffect(doSet, parentSuspense);
|
|
1103
|
+
} else {
|
|
1104
|
+
doSet();
|
|
1105
|
+
}
|
|
1137
1106
|
}
|
|
1138
|
-
}
|
|
1139
|
-
}
|
|
1140
|
-
function createInnerComp(comp, parent) {
|
|
1141
|
-
const { ref: ref2, props, children, ce } = parent.vnode;
|
|
1142
|
-
const vnode = createVNode(comp, props, children);
|
|
1143
|
-
vnode.ref = ref2;
|
|
1144
|
-
vnode.ce = ce;
|
|
1145
|
-
delete parent.vnode.ce;
|
|
1146
|
-
return vnode;
|
|
1107
|
+
}
|
|
1147
1108
|
}
|
|
1148
1109
|
|
|
1149
|
-
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1110
|
+
let hasLoggedMismatchError = false;
|
|
1111
|
+
const logMismatchError = () => {
|
|
1112
|
+
if (hasLoggedMismatchError) {
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
1115
|
+
console.error("Hydration completed but contains mismatches.");
|
|
1116
|
+
hasLoggedMismatchError = true;
|
|
1117
|
+
};
|
|
1118
|
+
const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
|
|
1119
|
+
const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
|
|
1120
|
+
const getContainerType = (container) => {
|
|
1121
|
+
if (isSVGContainer(container)) return "svg";
|
|
1122
|
+
if (isMathMLContainer(container)) return "mathml";
|
|
1123
|
+
return void 0;
|
|
1124
|
+
};
|
|
1125
|
+
const isComment = (node) => node.nodeType === 8;
|
|
1126
|
+
function createHydrationFunctions(rendererInternals) {
|
|
1127
|
+
const {
|
|
1128
|
+
mt: mountComponent,
|
|
1129
|
+
p: patch,
|
|
1130
|
+
o: {
|
|
1131
|
+
patchProp,
|
|
1132
|
+
createText,
|
|
1133
|
+
nextSibling,
|
|
1134
|
+
parentNode,
|
|
1135
|
+
remove,
|
|
1136
|
+
insert,
|
|
1137
|
+
createComment
|
|
1169
1138
|
}
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
m: move,
|
|
1178
|
-
um: _unmount,
|
|
1179
|
-
o: { createElement }
|
|
1180
|
-
}
|
|
1181
|
-
} = sharedContext;
|
|
1182
|
-
const storageContainer = createElement("div");
|
|
1183
|
-
sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
|
|
1184
|
-
const instance2 = vnode.component;
|
|
1185
|
-
move(vnode, container, anchor, 0, parentSuspense);
|
|
1186
|
-
patch(
|
|
1187
|
-
instance2.vnode,
|
|
1188
|
-
vnode,
|
|
1189
|
-
container,
|
|
1190
|
-
anchor,
|
|
1191
|
-
instance2,
|
|
1192
|
-
parentSuspense,
|
|
1193
|
-
namespace,
|
|
1194
|
-
vnode.slotScopeIds,
|
|
1195
|
-
optimized
|
|
1196
|
-
);
|
|
1197
|
-
queuePostRenderEffect(() => {
|
|
1198
|
-
instance2.isDeactivated = false;
|
|
1199
|
-
if (instance2.a) {
|
|
1200
|
-
shared.invokeArrayFns(instance2.a);
|
|
1201
|
-
}
|
|
1202
|
-
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
|
|
1203
|
-
if (vnodeHook) {
|
|
1204
|
-
invokeVNodeHook(vnodeHook, instance2.parent, vnode);
|
|
1205
|
-
}
|
|
1206
|
-
}, parentSuspense);
|
|
1207
|
-
};
|
|
1208
|
-
sharedContext.deactivate = (vnode) => {
|
|
1209
|
-
const instance2 = vnode.component;
|
|
1210
|
-
invalidateMount(instance2.m);
|
|
1211
|
-
invalidateMount(instance2.a);
|
|
1212
|
-
move(vnode, storageContainer, null, 1, parentSuspense);
|
|
1213
|
-
queuePostRenderEffect(() => {
|
|
1214
|
-
if (instance2.da) {
|
|
1215
|
-
shared.invokeArrayFns(instance2.da);
|
|
1216
|
-
}
|
|
1217
|
-
const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
|
|
1218
|
-
if (vnodeHook) {
|
|
1219
|
-
invokeVNodeHook(vnodeHook, instance2.parent, vnode);
|
|
1220
|
-
}
|
|
1221
|
-
instance2.isDeactivated = true;
|
|
1222
|
-
}, parentSuspense);
|
|
1223
|
-
};
|
|
1224
|
-
function unmount(vnode) {
|
|
1225
|
-
resetShapeFlag(vnode);
|
|
1226
|
-
_unmount(vnode, instance, parentSuspense, true);
|
|
1227
|
-
}
|
|
1228
|
-
function pruneCache(filter) {
|
|
1229
|
-
cache.forEach((vnode, key) => {
|
|
1230
|
-
const name = getComponentName(vnode.type);
|
|
1231
|
-
if (name && (!filter || !filter(name))) {
|
|
1232
|
-
pruneCacheEntry(key);
|
|
1233
|
-
}
|
|
1234
|
-
});
|
|
1235
|
-
}
|
|
1236
|
-
function pruneCacheEntry(key) {
|
|
1237
|
-
const cached = cache.get(key);
|
|
1238
|
-
if (!current || !isSameVNodeType(cached, current)) {
|
|
1239
|
-
unmount(cached);
|
|
1240
|
-
} else if (current) {
|
|
1241
|
-
resetShapeFlag(current);
|
|
1242
|
-
}
|
|
1243
|
-
cache.delete(key);
|
|
1244
|
-
keys.delete(key);
|
|
1139
|
+
} = rendererInternals;
|
|
1140
|
+
const hydrate = (vnode, container) => {
|
|
1141
|
+
if (!container.hasChildNodes()) {
|
|
1142
|
+
patch(null, vnode, container);
|
|
1143
|
+
flushPostFlushCbs();
|
|
1144
|
+
container._vnode = vnode;
|
|
1145
|
+
return;
|
|
1245
1146
|
}
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1147
|
+
hydrateNode(container.firstChild, vnode, null, null, null);
|
|
1148
|
+
flushPostFlushCbs();
|
|
1149
|
+
container._vnode = vnode;
|
|
1150
|
+
};
|
|
1151
|
+
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
1152
|
+
optimized = optimized || !!vnode.dynamicChildren;
|
|
1153
|
+
const isFragmentStart = isComment(node) && node.data === "[";
|
|
1154
|
+
const onMismatch = () => handleMismatch(
|
|
1155
|
+
node,
|
|
1156
|
+
vnode,
|
|
1157
|
+
parentComponent,
|
|
1158
|
+
parentSuspense,
|
|
1159
|
+
slotScopeIds,
|
|
1160
|
+
isFragmentStart
|
|
1254
1161
|
);
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1162
|
+
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
1163
|
+
let domType = node.nodeType;
|
|
1164
|
+
vnode.el = node;
|
|
1165
|
+
if (patchFlag === -2) {
|
|
1166
|
+
optimized = false;
|
|
1167
|
+
vnode.dynamicChildren = null;
|
|
1168
|
+
}
|
|
1169
|
+
let nextNode = null;
|
|
1170
|
+
switch (type) {
|
|
1171
|
+
case Text:
|
|
1172
|
+
if (domType !== 3) {
|
|
1173
|
+
if (vnode.children === "") {
|
|
1174
|
+
insert(vnode.el = createText(""), parentNode(node), node);
|
|
1175
|
+
nextNode = node;
|
|
1176
|
+
} else {
|
|
1177
|
+
nextNode = onMismatch();
|
|
1178
|
+
}
|
|
1262
1179
|
} else {
|
|
1263
|
-
|
|
1180
|
+
if (node.data !== vnode.children) {
|
|
1181
|
+
logMismatchError();
|
|
1182
|
+
node.data = vnode.children;
|
|
1183
|
+
}
|
|
1184
|
+
nextNode = nextSibling(node);
|
|
1264
1185
|
}
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1186
|
+
break;
|
|
1187
|
+
case Comment:
|
|
1188
|
+
if (isTemplateNode(node)) {
|
|
1189
|
+
nextNode = nextSibling(node);
|
|
1190
|
+
replaceNode(
|
|
1191
|
+
vnode.el = node.content.firstChild,
|
|
1192
|
+
node,
|
|
1193
|
+
parentComponent
|
|
1194
|
+
);
|
|
1195
|
+
} else if (domType !== 8 || isFragmentStart) {
|
|
1196
|
+
nextNode = onMismatch();
|
|
1197
|
+
} else {
|
|
1198
|
+
nextNode = nextSibling(node);
|
|
1278
1199
|
}
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
if (!slots.default) {
|
|
1285
|
-
return null;
|
|
1286
|
-
}
|
|
1287
|
-
const children = slots.default();
|
|
1288
|
-
const rawVNode = children[0];
|
|
1289
|
-
if (children.length > 1) {
|
|
1290
|
-
current = null;
|
|
1291
|
-
return children;
|
|
1292
|
-
} else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
|
|
1293
|
-
current = null;
|
|
1294
|
-
return rawVNode;
|
|
1295
|
-
}
|
|
1296
|
-
let vnode = getInnerChild(rawVNode);
|
|
1297
|
-
const comp = vnode.type;
|
|
1298
|
-
const name = getComponentName(
|
|
1299
|
-
isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
|
|
1300
|
-
);
|
|
1301
|
-
const { include, exclude, max } = props;
|
|
1302
|
-
if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
|
|
1303
|
-
current = vnode;
|
|
1304
|
-
return rawVNode;
|
|
1305
|
-
}
|
|
1306
|
-
const key = vnode.key == null ? comp : vnode.key;
|
|
1307
|
-
const cachedVNode = cache.get(key);
|
|
1308
|
-
if (vnode.el) {
|
|
1309
|
-
vnode = cloneVNode(vnode);
|
|
1310
|
-
if (rawVNode.shapeFlag & 128) {
|
|
1311
|
-
rawVNode.ssContent = vnode;
|
|
1200
|
+
break;
|
|
1201
|
+
case Static:
|
|
1202
|
+
if (isFragmentStart) {
|
|
1203
|
+
node = nextSibling(node);
|
|
1204
|
+
domType = node.nodeType;
|
|
1312
1205
|
}
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1206
|
+
if (domType === 1 || domType === 3) {
|
|
1207
|
+
nextNode = node;
|
|
1208
|
+
const needToAdoptContent = !vnode.children.length;
|
|
1209
|
+
for (let i = 0; i < vnode.staticCount; i++) {
|
|
1210
|
+
if (needToAdoptContent)
|
|
1211
|
+
vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data;
|
|
1212
|
+
if (i === vnode.staticCount - 1) {
|
|
1213
|
+
vnode.anchor = nextNode;
|
|
1214
|
+
}
|
|
1215
|
+
nextNode = nextSibling(nextNode);
|
|
1216
|
+
}
|
|
1217
|
+
return isFragmentStart ? nextSibling(nextNode) : nextNode;
|
|
1218
|
+
} else {
|
|
1219
|
+
onMismatch();
|
|
1320
1220
|
}
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1221
|
+
break;
|
|
1222
|
+
case Fragment:
|
|
1223
|
+
if (!isFragmentStart) {
|
|
1224
|
+
nextNode = onMismatch();
|
|
1225
|
+
} else {
|
|
1226
|
+
nextNode = hydrateFragment(
|
|
1227
|
+
node,
|
|
1228
|
+
vnode,
|
|
1229
|
+
parentComponent,
|
|
1230
|
+
parentSuspense,
|
|
1231
|
+
slotScopeIds,
|
|
1232
|
+
optimized
|
|
1233
|
+
);
|
|
1328
1234
|
}
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
}
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1235
|
+
break;
|
|
1236
|
+
default:
|
|
1237
|
+
if (shapeFlag & 1) {
|
|
1238
|
+
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
|
|
1239
|
+
nextNode = onMismatch();
|
|
1240
|
+
} else {
|
|
1241
|
+
nextNode = hydrateElement(
|
|
1242
|
+
node,
|
|
1243
|
+
vnode,
|
|
1244
|
+
parentComponent,
|
|
1245
|
+
parentSuspense,
|
|
1246
|
+
slotScopeIds,
|
|
1247
|
+
optimized
|
|
1248
|
+
);
|
|
1249
|
+
}
|
|
1250
|
+
} else if (shapeFlag & 6) {
|
|
1251
|
+
vnode.slotScopeIds = slotScopeIds;
|
|
1252
|
+
const container = parentNode(node);
|
|
1253
|
+
if (isFragmentStart) {
|
|
1254
|
+
nextNode = locateClosingAnchor(node);
|
|
1255
|
+
} else if (isComment(node) && node.data === "teleport start") {
|
|
1256
|
+
nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
1257
|
+
} else {
|
|
1258
|
+
nextNode = nextSibling(node);
|
|
1259
|
+
}
|
|
1260
|
+
mountComponent(
|
|
1261
|
+
vnode,
|
|
1262
|
+
container,
|
|
1263
|
+
null,
|
|
1264
|
+
parentComponent,
|
|
1265
|
+
parentSuspense,
|
|
1266
|
+
getContainerType(container),
|
|
1267
|
+
optimized
|
|
1268
|
+
);
|
|
1269
|
+
if (isAsyncWrapper(vnode)) {
|
|
1270
|
+
let subTree;
|
|
1271
|
+
if (isFragmentStart) {
|
|
1272
|
+
subTree = createVNode(Fragment);
|
|
1273
|
+
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
1274
|
+
} else {
|
|
1275
|
+
subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
1276
|
+
}
|
|
1277
|
+
subTree.el = node;
|
|
1278
|
+
vnode.component.subTree = subTree;
|
|
1279
|
+
}
|
|
1280
|
+
} else if (shapeFlag & 64) {
|
|
1281
|
+
if (domType !== 8) {
|
|
1282
|
+
nextNode = onMismatch();
|
|
1283
|
+
} else {
|
|
1284
|
+
nextNode = vnode.type.hydrate(
|
|
1285
|
+
node,
|
|
1286
|
+
vnode,
|
|
1287
|
+
parentComponent,
|
|
1288
|
+
parentSuspense,
|
|
1289
|
+
slotScopeIds,
|
|
1290
|
+
optimized,
|
|
1291
|
+
rendererInternals,
|
|
1292
|
+
hydrateChildren
|
|
1293
|
+
);
|
|
1294
|
+
}
|
|
1295
|
+
} else if (shapeFlag & 128) {
|
|
1296
|
+
nextNode = vnode.type.hydrate(
|
|
1297
|
+
node,
|
|
1298
|
+
vnode,
|
|
1299
|
+
parentComponent,
|
|
1300
|
+
parentSuspense,
|
|
1301
|
+
getContainerType(parentNode(node)),
|
|
1302
|
+
slotScopeIds,
|
|
1303
|
+
optimized,
|
|
1304
|
+
rendererInternals,
|
|
1305
|
+
hydrateNode
|
|
1306
|
+
);
|
|
1307
|
+
} else ;
|
|
1372
1308
|
}
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
1376
|
-
const injected = injectHook(
|
|
1377
|
-
type,
|
|
1378
|
-
hook,
|
|
1379
|
-
keepAliveRoot,
|
|
1380
|
-
true
|
|
1381
|
-
/* prepend */
|
|
1382
|
-
);
|
|
1383
|
-
onUnmounted(() => {
|
|
1384
|
-
shared.remove(keepAliveRoot[type], injected);
|
|
1385
|
-
}, target);
|
|
1386
|
-
}
|
|
1387
|
-
function resetShapeFlag(vnode) {
|
|
1388
|
-
vnode.shapeFlag &= ~256;
|
|
1389
|
-
vnode.shapeFlag &= ~512;
|
|
1390
|
-
}
|
|
1391
|
-
function getInnerChild(vnode) {
|
|
1392
|
-
return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1395
|
-
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
1396
|
-
if (target) {
|
|
1397
|
-
const hooks = target[type] || (target[type] = []);
|
|
1398
|
-
const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
|
|
1399
|
-
reactivity.pauseTracking();
|
|
1400
|
-
const reset = setCurrentInstance(target);
|
|
1401
|
-
const res = callWithAsyncErrorHandling(hook, target, type, args);
|
|
1402
|
-
reset();
|
|
1403
|
-
reactivity.resetTracking();
|
|
1404
|
-
return res;
|
|
1405
|
-
});
|
|
1406
|
-
if (prepend) {
|
|
1407
|
-
hooks.unshift(wrappedHook);
|
|
1408
|
-
} else {
|
|
1409
|
-
hooks.push(wrappedHook);
|
|
1309
|
+
if (ref != null) {
|
|
1310
|
+
setRef(ref, null, parentSuspense, vnode);
|
|
1410
1311
|
}
|
|
1411
|
-
return
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
const
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
);
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1312
|
+
return nextNode;
|
|
1313
|
+
};
|
|
1314
|
+
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
1315
|
+
optimized = optimized || !!vnode.dynamicChildren;
|
|
1316
|
+
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
1317
|
+
const forcePatch = type === "input" || type === "option";
|
|
1318
|
+
if (forcePatch || patchFlag !== -1) {
|
|
1319
|
+
if (dirs) {
|
|
1320
|
+
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
1321
|
+
}
|
|
1322
|
+
let needCallTransitionHooks = false;
|
|
1323
|
+
if (isTemplateNode(el)) {
|
|
1324
|
+
needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
1325
|
+
const content = el.content.firstChild;
|
|
1326
|
+
if (needCallTransitionHooks) {
|
|
1327
|
+
transition.beforeEnter(content);
|
|
1328
|
+
}
|
|
1329
|
+
replaceNode(content, el, parentComponent);
|
|
1330
|
+
vnode.el = el = content;
|
|
1331
|
+
}
|
|
1332
|
+
if (shapeFlag & 16 && // skip if element has innerHTML / textContent
|
|
1333
|
+
!(props && (props.innerHTML || props.textContent))) {
|
|
1334
|
+
let next = hydrateChildren(
|
|
1335
|
+
el.firstChild,
|
|
1336
|
+
vnode,
|
|
1337
|
+
el,
|
|
1338
|
+
parentComponent,
|
|
1339
|
+
parentSuspense,
|
|
1340
|
+
slotScopeIds,
|
|
1341
|
+
optimized
|
|
1342
|
+
);
|
|
1343
|
+
while (next) {
|
|
1344
|
+
if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
|
|
1345
|
+
logMismatchError();
|
|
1346
|
+
}
|
|
1347
|
+
const cur = next;
|
|
1348
|
+
next = next.nextSibling;
|
|
1349
|
+
remove(cur);
|
|
1350
|
+
}
|
|
1351
|
+
} else if (shapeFlag & 8) {
|
|
1352
|
+
if (el.textContent !== vnode.children) {
|
|
1353
|
+
if (!isMismatchAllowed(el, 0 /* TEXT */)) {
|
|
1354
|
+
logMismatchError();
|
|
1355
|
+
}
|
|
1356
|
+
el.textContent = vnode.children;
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
if (props) {
|
|
1360
|
+
if (forcePatch || !optimized || patchFlag & (16 | 32)) {
|
|
1361
|
+
const isCustomElement = el.tagName.includes("-");
|
|
1362
|
+
for (const key in props) {
|
|
1363
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
1364
|
+
key[0] === "." || isCustomElement) {
|
|
1365
|
+
patchProp(el, key, null, props[key], void 0, parentComponent);
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
} else if (props.onClick) {
|
|
1369
|
+
patchProp(
|
|
1370
|
+
el,
|
|
1371
|
+
"onClick",
|
|
1372
|
+
null,
|
|
1373
|
+
props.onClick,
|
|
1374
|
+
void 0,
|
|
1375
|
+
parentComponent
|
|
1376
|
+
);
|
|
1377
|
+
} else if (patchFlag & 4 && reactivity.isReactive(props.style)) {
|
|
1378
|
+
for (const key in props.style) props.style[key];
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
let vnodeHooks;
|
|
1382
|
+
if (vnodeHooks = props && props.onVnodeBeforeMount) {
|
|
1383
|
+
invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
1384
|
+
}
|
|
1385
|
+
if (dirs) {
|
|
1386
|
+
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
1387
|
+
}
|
|
1388
|
+
if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
|
|
1389
|
+
queueEffectWithSuspense(() => {
|
|
1390
|
+
vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
1391
|
+
needCallTransitionHooks && transition.enter(el);
|
|
1392
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
1393
|
+
}, parentSuspense);
|
|
1463
1394
|
}
|
|
1464
1395
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1396
|
+
return el.nextSibling;
|
|
1397
|
+
};
|
|
1398
|
+
const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
1399
|
+
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
1400
|
+
const children = parentVNode.children;
|
|
1401
|
+
const l = children.length;
|
|
1402
|
+
for (let i = 0; i < l; i++) {
|
|
1403
|
+
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
1404
|
+
const isText = vnode.type === Text;
|
|
1405
|
+
if (node) {
|
|
1406
|
+
if (isText && !optimized) {
|
|
1407
|
+
let next = children[i + 1];
|
|
1408
|
+
if (next && (next = normalizeVNode(next)).type === Text) {
|
|
1409
|
+
insert(
|
|
1410
|
+
createText(
|
|
1411
|
+
node.data.slice(vnode.children.length)
|
|
1412
|
+
),
|
|
1413
|
+
container,
|
|
1414
|
+
nextSibling(node)
|
|
1415
|
+
);
|
|
1416
|
+
node.data = vnode.children;
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
node = hydrateNode(
|
|
1420
|
+
node,
|
|
1421
|
+
vnode,
|
|
1422
|
+
parentComponent,
|
|
1423
|
+
parentSuspense,
|
|
1424
|
+
slotScopeIds,
|
|
1425
|
+
optimized
|
|
1426
|
+
);
|
|
1427
|
+
} else if (isText && !vnode.children) {
|
|
1428
|
+
insert(vnode.el = createText(""), container);
|
|
1429
|
+
} else {
|
|
1430
|
+
if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
|
|
1431
|
+
logMismatchError();
|
|
1432
|
+
}
|
|
1433
|
+
patch(
|
|
1434
|
+
null,
|
|
1435
|
+
vnode,
|
|
1436
|
+
container,
|
|
1437
|
+
null,
|
|
1438
|
+
parentComponent,
|
|
1439
|
+
parentSuspense,
|
|
1440
|
+
getContainerType(container),
|
|
1441
|
+
slotScopeIds
|
|
1442
|
+
);
|
|
1443
|
+
}
|
|
1498
1444
|
}
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1445
|
+
return node;
|
|
1446
|
+
};
|
|
1447
|
+
const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
1448
|
+
const { slotScopeIds: fragmentSlotScopeIds } = vnode;
|
|
1449
|
+
if (fragmentSlotScopeIds) {
|
|
1450
|
+
slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
|
|
1503
1451
|
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1452
|
+
const container = parentNode(node);
|
|
1453
|
+
const next = hydrateChildren(
|
|
1454
|
+
nextSibling(node),
|
|
1455
|
+
vnode,
|
|
1456
|
+
container,
|
|
1457
|
+
parentComponent,
|
|
1458
|
+
parentSuspense,
|
|
1459
|
+
slotScopeIds,
|
|
1460
|
+
optimized
|
|
1461
|
+
);
|
|
1462
|
+
if (next && isComment(next) && next.data === "]") {
|
|
1463
|
+
return nextSibling(vnode.anchor = next);
|
|
1510
1464
|
} else {
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
const key = keys[i];
|
|
1515
|
-
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
1516
|
-
}
|
|
1517
|
-
}
|
|
1518
|
-
} else {
|
|
1519
|
-
ret = [];
|
|
1520
|
-
}
|
|
1521
|
-
if (cache) {
|
|
1522
|
-
cache[index] = ret;
|
|
1523
|
-
}
|
|
1524
|
-
return ret;
|
|
1525
|
-
}
|
|
1526
|
-
|
|
1527
|
-
function createSlots(slots, dynamicSlots) {
|
|
1528
|
-
for (let i = 0; i < dynamicSlots.length; i++) {
|
|
1529
|
-
const slot = dynamicSlots[i];
|
|
1530
|
-
if (shared.isArray(slot)) {
|
|
1531
|
-
for (let j = 0; j < slot.length; j++) {
|
|
1532
|
-
slots[slot[j].name] = slot[j].fn;
|
|
1533
|
-
}
|
|
1534
|
-
} else if (slot) {
|
|
1535
|
-
slots[slot.name] = slot.key ? (...args) => {
|
|
1536
|
-
const res = slot.fn(...args);
|
|
1537
|
-
if (res) res.key = slot.key;
|
|
1538
|
-
return res;
|
|
1539
|
-
} : slot.fn;
|
|
1465
|
+
logMismatchError();
|
|
1466
|
+
insert(vnode.anchor = createComment(`]`), container, next);
|
|
1467
|
+
return next;
|
|
1540
1468
|
}
|
|
1541
|
-
}
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
1546
|
-
if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
|
|
1547
|
-
if (name !== "default") props.name = name;
|
|
1548
|
-
return createVNode("slot", props, fallback && fallback());
|
|
1549
|
-
}
|
|
1550
|
-
let slot = slots[name];
|
|
1551
|
-
if (slot && slot._c) {
|
|
1552
|
-
slot._d = false;
|
|
1553
|
-
}
|
|
1554
|
-
openBlock();
|
|
1555
|
-
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
1556
|
-
const rendered = createBlock(
|
|
1557
|
-
Fragment,
|
|
1558
|
-
{
|
|
1559
|
-
key: (props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
1560
|
-
// key attached in the `createSlots` helper, respect that
|
|
1561
|
-
validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
1562
|
-
(!validSlotContent && fallback ? "_fb" : "")
|
|
1563
|
-
},
|
|
1564
|
-
validSlotContent || (fallback ? fallback() : []),
|
|
1565
|
-
validSlotContent && slots._ === 1 ? 64 : -2
|
|
1566
|
-
);
|
|
1567
|
-
if (!noSlotted && rendered.scopeId) {
|
|
1568
|
-
rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
1569
|
-
}
|
|
1570
|
-
if (slot && slot._c) {
|
|
1571
|
-
slot._d = true;
|
|
1572
|
-
}
|
|
1573
|
-
return rendered;
|
|
1574
|
-
}
|
|
1575
|
-
function ensureValidVNode(vnodes) {
|
|
1576
|
-
return vnodes.some((child) => {
|
|
1577
|
-
if (!isVNode(child)) return true;
|
|
1578
|
-
if (child.type === Comment) return false;
|
|
1579
|
-
if (child.type === Fragment && !ensureValidVNode(child.children))
|
|
1580
|
-
return false;
|
|
1581
|
-
return true;
|
|
1582
|
-
}) ? vnodes : null;
|
|
1583
|
-
}
|
|
1584
|
-
|
|
1585
|
-
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
1586
|
-
const ret = {};
|
|
1587
|
-
for (const key in obj) {
|
|
1588
|
-
ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = obj[key];
|
|
1589
|
-
}
|
|
1590
|
-
return ret;
|
|
1591
|
-
}
|
|
1592
|
-
|
|
1593
|
-
const getPublicInstance = (i) => {
|
|
1594
|
-
if (!i) return null;
|
|
1595
|
-
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
1596
|
-
return getPublicInstance(i.parent);
|
|
1597
|
-
};
|
|
1598
|
-
const publicPropertiesMap = (
|
|
1599
|
-
// Move PURE marker to new line to workaround compiler discarding it
|
|
1600
|
-
// due to type annotation
|
|
1601
|
-
/* @__PURE__ */ shared.extend(/* @__PURE__ */ Object.create(null), {
|
|
1602
|
-
$: (i) => i,
|
|
1603
|
-
$el: (i) => i.vnode.el,
|
|
1604
|
-
$data: (i) => i.data,
|
|
1605
|
-
$props: (i) => i.props,
|
|
1606
|
-
$attrs: (i) => i.attrs,
|
|
1607
|
-
$slots: (i) => i.slots,
|
|
1608
|
-
$refs: (i) => i.refs,
|
|
1609
|
-
$parent: (i) => getPublicInstance(i.parent),
|
|
1610
|
-
$root: (i) => getPublicInstance(i.root),
|
|
1611
|
-
$emit: (i) => i.emit,
|
|
1612
|
-
$options: (i) => resolveMergedOptions(i) ,
|
|
1613
|
-
$forceUpdate: (i) => i.f || (i.f = () => {
|
|
1614
|
-
queueJob(i.update);
|
|
1615
|
-
}),
|
|
1616
|
-
$nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
|
|
1617
|
-
$watch: (i) => instanceWatch.bind(i)
|
|
1618
|
-
})
|
|
1619
|
-
);
|
|
1620
|
-
const hasSetupBinding = (state, key) => state !== shared.EMPTY_OBJ && !state.__isScriptSetup && shared.hasOwn(state, key);
|
|
1621
|
-
const PublicInstanceProxyHandlers = {
|
|
1622
|
-
get({ _: instance }, key) {
|
|
1623
|
-
if (key === "__v_skip") {
|
|
1624
|
-
return true;
|
|
1469
|
+
};
|
|
1470
|
+
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
1471
|
+
if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
|
|
1472
|
+
logMismatchError();
|
|
1625
1473
|
}
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
return data[key];
|
|
1636
|
-
case 4 /* CONTEXT */:
|
|
1637
|
-
return ctx[key];
|
|
1638
|
-
case 3 /* PROPS */:
|
|
1639
|
-
return props[key];
|
|
1474
|
+
vnode.el = null;
|
|
1475
|
+
if (isFragment) {
|
|
1476
|
+
const end = locateClosingAnchor(node);
|
|
1477
|
+
while (true) {
|
|
1478
|
+
const next2 = nextSibling(node);
|
|
1479
|
+
if (next2 && next2 !== end) {
|
|
1480
|
+
remove(next2);
|
|
1481
|
+
} else {
|
|
1482
|
+
break;
|
|
1640
1483
|
}
|
|
1641
|
-
} else if (hasSetupBinding(setupState, key)) {
|
|
1642
|
-
accessCache[key] = 1 /* SETUP */;
|
|
1643
|
-
return setupState[key];
|
|
1644
|
-
} else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
|
|
1645
|
-
accessCache[key] = 2 /* DATA */;
|
|
1646
|
-
return data[key];
|
|
1647
|
-
} else if (
|
|
1648
|
-
// only cache other properties when instance has declared (thus stable)
|
|
1649
|
-
// props
|
|
1650
|
-
(normalizedProps = instance.propsOptions[0]) && shared.hasOwn(normalizedProps, key)
|
|
1651
|
-
) {
|
|
1652
|
-
accessCache[key] = 3 /* PROPS */;
|
|
1653
|
-
return props[key];
|
|
1654
|
-
} else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
|
|
1655
|
-
accessCache[key] = 4 /* CONTEXT */;
|
|
1656
|
-
return ctx[key];
|
|
1657
|
-
} else if (shouldCacheAccess) {
|
|
1658
|
-
accessCache[key] = 0 /* OTHER */;
|
|
1659
1484
|
}
|
|
1660
1485
|
}
|
|
1661
|
-
const
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
{
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
return true;
|
|
1690
|
-
} else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
|
|
1691
|
-
data[key] = value;
|
|
1692
|
-
return true;
|
|
1693
|
-
} else if (shared.hasOwn(instance.props, key)) {
|
|
1694
|
-
return false;
|
|
1695
|
-
}
|
|
1696
|
-
if (key[0] === "$" && key.slice(1) in instance) {
|
|
1697
|
-
return false;
|
|
1698
|
-
} else {
|
|
1699
|
-
{
|
|
1700
|
-
ctx[key] = value;
|
|
1486
|
+
const next = nextSibling(node);
|
|
1487
|
+
const container = parentNode(node);
|
|
1488
|
+
remove(node);
|
|
1489
|
+
patch(
|
|
1490
|
+
null,
|
|
1491
|
+
vnode,
|
|
1492
|
+
container,
|
|
1493
|
+
next,
|
|
1494
|
+
parentComponent,
|
|
1495
|
+
parentSuspense,
|
|
1496
|
+
getContainerType(container),
|
|
1497
|
+
slotScopeIds
|
|
1498
|
+
);
|
|
1499
|
+
return next;
|
|
1500
|
+
};
|
|
1501
|
+
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
1502
|
+
let match = 0;
|
|
1503
|
+
while (node) {
|
|
1504
|
+
node = nextSibling(node);
|
|
1505
|
+
if (node && isComment(node)) {
|
|
1506
|
+
if (node.data === open) match++;
|
|
1507
|
+
if (node.data === close) {
|
|
1508
|
+
if (match === 0) {
|
|
1509
|
+
return nextSibling(node);
|
|
1510
|
+
} else {
|
|
1511
|
+
match--;
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1701
1514
|
}
|
|
1702
1515
|
}
|
|
1703
|
-
return
|
|
1704
|
-
}
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
return !!accessCache[key] || data !== shared.EMPTY_OBJ && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && shared.hasOwn(normalizedProps, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key);
|
|
1710
|
-
},
|
|
1711
|
-
defineProperty(target, key, descriptor) {
|
|
1712
|
-
if (descriptor.get != null) {
|
|
1713
|
-
target._.accessCache[key] = 0;
|
|
1714
|
-
} else if (shared.hasOwn(descriptor, "value")) {
|
|
1715
|
-
this.set(target, key, descriptor.value, null);
|
|
1516
|
+
return node;
|
|
1517
|
+
};
|
|
1518
|
+
const replaceNode = (newNode, oldNode, parentComponent) => {
|
|
1519
|
+
const parentNode2 = oldNode.parentNode;
|
|
1520
|
+
if (parentNode2) {
|
|
1521
|
+
parentNode2.replaceChild(newNode, oldNode);
|
|
1716
1522
|
}
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
{},
|
|
1722
|
-
PublicInstanceProxyHandlers,
|
|
1723
|
-
{
|
|
1724
|
-
get(target, key) {
|
|
1725
|
-
if (key === Symbol.unscopables) {
|
|
1726
|
-
return;
|
|
1523
|
+
let parent = parentComponent;
|
|
1524
|
+
while (parent) {
|
|
1525
|
+
if (parent.vnode.el === oldNode) {
|
|
1526
|
+
parent.vnode.el = parent.subTree.el = newNode;
|
|
1727
1527
|
}
|
|
1728
|
-
|
|
1729
|
-
},
|
|
1730
|
-
has(_, key) {
|
|
1731
|
-
const has = key[0] !== "_" && !shared.isGloballyAllowed(key);
|
|
1732
|
-
return has;
|
|
1528
|
+
parent = parent.parent;
|
|
1733
1529
|
}
|
|
1734
|
-
}
|
|
1735
|
-
)
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
return
|
|
1739
|
-
}
|
|
1740
|
-
function defineEmits() {
|
|
1741
|
-
return null;
|
|
1742
|
-
}
|
|
1743
|
-
function defineExpose(exposed) {
|
|
1744
|
-
}
|
|
1745
|
-
function defineOptions(options) {
|
|
1746
|
-
}
|
|
1747
|
-
function defineSlots() {
|
|
1748
|
-
return null;
|
|
1749
|
-
}
|
|
1750
|
-
function defineModel() {
|
|
1751
|
-
}
|
|
1752
|
-
function withDefaults(props, defaults) {
|
|
1753
|
-
return null;
|
|
1754
|
-
}
|
|
1755
|
-
function useSlots() {
|
|
1756
|
-
return getContext().slots;
|
|
1757
|
-
}
|
|
1758
|
-
function useAttrs() {
|
|
1759
|
-
return getContext().attrs;
|
|
1760
|
-
}
|
|
1761
|
-
function getContext() {
|
|
1762
|
-
const i = getCurrentInstance();
|
|
1763
|
-
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
1764
|
-
}
|
|
1765
|
-
function normalizePropsOrEmits(props) {
|
|
1766
|
-
return shared.isArray(props) ? props.reduce(
|
|
1767
|
-
(normalized, p) => (normalized[p] = null, normalized),
|
|
1768
|
-
{}
|
|
1769
|
-
) : props;
|
|
1530
|
+
};
|
|
1531
|
+
const isTemplateNode = (node) => {
|
|
1532
|
+
return node.nodeType === 1 && node.tagName.toLowerCase() === "template";
|
|
1533
|
+
};
|
|
1534
|
+
return [hydrate, hydrateNode];
|
|
1770
1535
|
}
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
opt = props[key] = { default: defaults[key] };
|
|
1784
|
-
} else ;
|
|
1785
|
-
if (opt && defaults[`__skip_${key}`]) {
|
|
1786
|
-
opt.skipFactory = true;
|
|
1536
|
+
const allowMismatchAttr = "data-allow-mismatch";
|
|
1537
|
+
const MismatchTypeString = {
|
|
1538
|
+
[0 /* TEXT */]: "text",
|
|
1539
|
+
[1 /* CHILDREN */]: "children",
|
|
1540
|
+
[2 /* CLASS */]: "class",
|
|
1541
|
+
[3 /* STYLE */]: "style",
|
|
1542
|
+
[4 /* ATTRIBUTE */]: "attribute"
|
|
1543
|
+
};
|
|
1544
|
+
function isMismatchAllowed(el, allowedType) {
|
|
1545
|
+
if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
|
|
1546
|
+
while (el && !el.hasAttribute(allowMismatchAttr)) {
|
|
1547
|
+
el = el.parentElement;
|
|
1787
1548
|
}
|
|
1788
1549
|
}
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
if (
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
for (const key in props) {
|
|
1799
|
-
if (!excludedKeys.includes(key)) {
|
|
1800
|
-
Object.defineProperty(ret, key, {
|
|
1801
|
-
enumerable: true,
|
|
1802
|
-
get: () => props[key]
|
|
1803
|
-
});
|
|
1550
|
+
const allowedAttr = el && el.getAttribute(allowMismatchAttr);
|
|
1551
|
+
if (allowedAttr == null) {
|
|
1552
|
+
return false;
|
|
1553
|
+
} else if (allowedAttr === "") {
|
|
1554
|
+
return true;
|
|
1555
|
+
} else {
|
|
1556
|
+
const list = allowedAttr.split(",");
|
|
1557
|
+
if (allowedType === 0 /* TEXT */ && list.includes("children")) {
|
|
1558
|
+
return true;
|
|
1804
1559
|
}
|
|
1560
|
+
return allowedAttr.split(",").includes(MismatchTypeString[allowedType]);
|
|
1805
1561
|
}
|
|
1806
|
-
return ret;
|
|
1807
1562
|
}
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1563
|
+
|
|
1564
|
+
const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
|
|
1565
|
+
const id = requestIdleCallback(hydrate, { timeout });
|
|
1566
|
+
return () => cancelIdleCallback(id);
|
|
1567
|
+
};
|
|
1568
|
+
const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
1569
|
+
const ob = new IntersectionObserver((entries) => {
|
|
1570
|
+
for (const e of entries) {
|
|
1571
|
+
if (!e.isIntersecting) continue;
|
|
1572
|
+
ob.disconnect();
|
|
1573
|
+
hydrate();
|
|
1574
|
+
break;
|
|
1575
|
+
}
|
|
1576
|
+
}, opts);
|
|
1577
|
+
forEach((el) => ob.observe(el));
|
|
1578
|
+
return () => ob.disconnect();
|
|
1579
|
+
};
|
|
1580
|
+
const hydrateOnMediaQuery = (query) => (hydrate) => {
|
|
1581
|
+
if (query) {
|
|
1582
|
+
const mql = matchMedia(query);
|
|
1583
|
+
if (mql.matches) {
|
|
1584
|
+
hydrate();
|
|
1585
|
+
} else {
|
|
1586
|
+
mql.addEventListener("change", hydrate, { once: true });
|
|
1587
|
+
return () => mql.removeEventListener("change", hydrate);
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
};
|
|
1591
|
+
const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
1592
|
+
if (shared.isString(interactions)) interactions = [interactions];
|
|
1593
|
+
let hasHydrated = false;
|
|
1594
|
+
const doHydrate = (e) => {
|
|
1595
|
+
if (!hasHydrated) {
|
|
1596
|
+
hasHydrated = true;
|
|
1597
|
+
teardown();
|
|
1598
|
+
hydrate();
|
|
1599
|
+
e.target.dispatchEvent(new e.constructor(e.type, e));
|
|
1600
|
+
}
|
|
1601
|
+
};
|
|
1602
|
+
const teardown = () => {
|
|
1603
|
+
forEach((el) => {
|
|
1604
|
+
for (const i of interactions) {
|
|
1605
|
+
el.removeEventListener(i, doHydrate);
|
|
1606
|
+
}
|
|
1816
1607
|
});
|
|
1608
|
+
};
|
|
1609
|
+
forEach((el) => {
|
|
1610
|
+
for (const i of interactions) {
|
|
1611
|
+
el.addEventListener(i, doHydrate, { once: true });
|
|
1612
|
+
}
|
|
1613
|
+
});
|
|
1614
|
+
return teardown;
|
|
1615
|
+
};
|
|
1616
|
+
function forEachElement(node, cb) {
|
|
1617
|
+
if (isComment(node) && node.data === "[") {
|
|
1618
|
+
let depth = 1;
|
|
1619
|
+
let next = node.nextSibling;
|
|
1620
|
+
while (next) {
|
|
1621
|
+
if (next.nodeType === 1) {
|
|
1622
|
+
cb(next);
|
|
1623
|
+
} else if (isComment(next)) {
|
|
1624
|
+
if (next.data === "]") {
|
|
1625
|
+
if (--depth === 0) break;
|
|
1626
|
+
} else if (next.data === "[") {
|
|
1627
|
+
depth++;
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
next = next.nextSibling;
|
|
1631
|
+
}
|
|
1632
|
+
} else {
|
|
1633
|
+
cb(node);
|
|
1817
1634
|
}
|
|
1818
|
-
return [awaitable, () => setCurrentInstance(ctx)];
|
|
1819
1635
|
}
|
|
1820
1636
|
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
if (options.beforeCreate) {
|
|
1828
|
-
callHook(options.beforeCreate, instance, "bc");
|
|
1637
|
+
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
1638
|
+
/*! #__NO_SIDE_EFFECTS__ */
|
|
1639
|
+
// @__NO_SIDE_EFFECTS__
|
|
1640
|
+
function defineAsyncComponent(source) {
|
|
1641
|
+
if (shared.isFunction(source)) {
|
|
1642
|
+
source = { loader: source };
|
|
1829
1643
|
}
|
|
1830
1644
|
const {
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1645
|
+
loader,
|
|
1646
|
+
loadingComponent,
|
|
1647
|
+
errorComponent,
|
|
1648
|
+
delay = 200,
|
|
1649
|
+
hydrate: hydrateStrategy,
|
|
1650
|
+
timeout,
|
|
1651
|
+
// undefined = never times out
|
|
1652
|
+
suspensible = true,
|
|
1653
|
+
onError: userOnError
|
|
1654
|
+
} = source;
|
|
1655
|
+
let pendingRequest = null;
|
|
1656
|
+
let resolvedComp;
|
|
1657
|
+
let retries = 0;
|
|
1658
|
+
const retry = () => {
|
|
1659
|
+
retries++;
|
|
1660
|
+
pendingRequest = null;
|
|
1661
|
+
return load();
|
|
1662
|
+
};
|
|
1663
|
+
const load = () => {
|
|
1664
|
+
let thisRequest;
|
|
1665
|
+
return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
|
|
1666
|
+
err = err instanceof Error ? err : new Error(String(err));
|
|
1667
|
+
if (userOnError) {
|
|
1668
|
+
return new Promise((resolve, reject) => {
|
|
1669
|
+
const userRetry = () => resolve(retry());
|
|
1670
|
+
const userFail = () => reject(err);
|
|
1671
|
+
userOnError(err, userRetry, userFail, retries + 1);
|
|
1672
|
+
});
|
|
1673
|
+
} else {
|
|
1674
|
+
throw err;
|
|
1675
|
+
}
|
|
1676
|
+
}).then((comp) => {
|
|
1677
|
+
if (thisRequest !== pendingRequest && pendingRequest) {
|
|
1678
|
+
return pendingRequest;
|
|
1679
|
+
}
|
|
1680
|
+
if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
|
|
1681
|
+
comp = comp.default;
|
|
1682
|
+
}
|
|
1683
|
+
resolvedComp = comp;
|
|
1684
|
+
return comp;
|
|
1685
|
+
}));
|
|
1686
|
+
};
|
|
1687
|
+
return defineComponent({
|
|
1688
|
+
name: "AsyncComponentWrapper",
|
|
1689
|
+
__asyncLoader: load,
|
|
1690
|
+
__asyncHydrate(el, instance, hydrate) {
|
|
1691
|
+
const doHydrate = hydrateStrategy ? () => {
|
|
1692
|
+
const teardown = hydrateStrategy(
|
|
1693
|
+
hydrate,
|
|
1694
|
+
(cb) => forEachElement(el, cb)
|
|
1695
|
+
);
|
|
1696
|
+
if (teardown) {
|
|
1697
|
+
(instance.bum || (instance.bum = [])).push(teardown);
|
|
1873
1698
|
}
|
|
1699
|
+
} : hydrate;
|
|
1700
|
+
if (resolvedComp) {
|
|
1701
|
+
doHydrate();
|
|
1702
|
+
} else {
|
|
1703
|
+
load().then(() => !instance.isUnmounted && doHydrate());
|
|
1704
|
+
}
|
|
1705
|
+
},
|
|
1706
|
+
get __asyncResolved() {
|
|
1707
|
+
return resolvedComp;
|
|
1708
|
+
},
|
|
1709
|
+
setup() {
|
|
1710
|
+
const instance = currentInstance;
|
|
1711
|
+
markAsyncBoundary(instance);
|
|
1712
|
+
if (resolvedComp) {
|
|
1713
|
+
return () => createInnerComp(resolvedComp, instance);
|
|
1714
|
+
}
|
|
1715
|
+
const onError = (err) => {
|
|
1716
|
+
pendingRequest = null;
|
|
1717
|
+
handleError(
|
|
1718
|
+
err,
|
|
1719
|
+
instance,
|
|
1720
|
+
13,
|
|
1721
|
+
!errorComponent
|
|
1722
|
+
);
|
|
1723
|
+
};
|
|
1724
|
+
if (suspensible && instance.suspense || isInSSRComponentSetup) {
|
|
1725
|
+
return load().then((comp) => {
|
|
1726
|
+
return () => createInnerComp(comp, instance);
|
|
1727
|
+
}).catch((err) => {
|
|
1728
|
+
onError(err);
|
|
1729
|
+
return () => errorComponent ? createVNode(errorComponent, {
|
|
1730
|
+
error: err
|
|
1731
|
+
}) : null;
|
|
1732
|
+
});
|
|
1874
1733
|
}
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1734
|
+
const loaded = reactivity.ref(false);
|
|
1735
|
+
const error = reactivity.ref();
|
|
1736
|
+
const delayed = reactivity.ref(!!delay);
|
|
1737
|
+
if (delay) {
|
|
1738
|
+
setTimeout(() => {
|
|
1739
|
+
delayed.value = false;
|
|
1740
|
+
}, delay);
|
|
1741
|
+
}
|
|
1742
|
+
if (timeout != null) {
|
|
1743
|
+
setTimeout(() => {
|
|
1744
|
+
if (!loaded.value && !error.value) {
|
|
1745
|
+
const err = new Error(
|
|
1746
|
+
`Async component timed out after ${timeout}ms.`
|
|
1747
|
+
);
|
|
1748
|
+
onError(err);
|
|
1749
|
+
error.value = err;
|
|
1750
|
+
}
|
|
1751
|
+
}, timeout);
|
|
1752
|
+
}
|
|
1753
|
+
load().then(() => {
|
|
1754
|
+
loaded.value = true;
|
|
1755
|
+
if (instance.parent && isKeepAlive(instance.parent.vnode)) {
|
|
1756
|
+
queueJob(instance.parent.update);
|
|
1757
|
+
}
|
|
1758
|
+
}).catch((err) => {
|
|
1759
|
+
onError(err);
|
|
1760
|
+
error.value = err;
|
|
1898
1761
|
});
|
|
1762
|
+
return () => {
|
|
1763
|
+
if (loaded.value && resolvedComp) {
|
|
1764
|
+
return createInnerComp(resolvedComp, instance);
|
|
1765
|
+
} else if (error.value && errorComponent) {
|
|
1766
|
+
return createVNode(errorComponent, {
|
|
1767
|
+
error: error.value
|
|
1768
|
+
});
|
|
1769
|
+
} else if (loadingComponent && !delayed.value) {
|
|
1770
|
+
return createVNode(loadingComponent);
|
|
1771
|
+
}
|
|
1772
|
+
};
|
|
1899
1773
|
}
|
|
1900
|
-
}
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
function createInnerComp(comp, parent) {
|
|
1777
|
+
const { ref: ref2, props, children, ce } = parent.vnode;
|
|
1778
|
+
const vnode = createVNode(comp, props, children);
|
|
1779
|
+
vnode.ref = ref2;
|
|
1780
|
+
vnode.ce = ce;
|
|
1781
|
+
delete parent.vnode.ce;
|
|
1782
|
+
return vnode;
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
|
|
1786
|
+
const KeepAliveImpl = {
|
|
1787
|
+
name: `KeepAlive`,
|
|
1788
|
+
// Marker for special handling inside the renderer. We are not using a ===
|
|
1789
|
+
// check directly on KeepAlive in the renderer, because importing it directly
|
|
1790
|
+
// would prevent it from being tree-shaken.
|
|
1791
|
+
__isKeepAlive: true,
|
|
1792
|
+
props: {
|
|
1793
|
+
include: [String, RegExp, Array],
|
|
1794
|
+
exclude: [String, RegExp, Array],
|
|
1795
|
+
max: [String, Number]
|
|
1796
|
+
},
|
|
1797
|
+
setup(props, { slots }) {
|
|
1798
|
+
const instance = getCurrentInstance();
|
|
1799
|
+
const sharedContext = instance.ctx;
|
|
1800
|
+
if (!sharedContext.renderer) {
|
|
1801
|
+
return () => {
|
|
1802
|
+
const children = slots.default && slots.default();
|
|
1803
|
+
return children && children.length === 1 ? children[0] : children;
|
|
1804
|
+
};
|
|
1904
1805
|
}
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1806
|
+
const cache = /* @__PURE__ */ new Map();
|
|
1807
|
+
const keys = /* @__PURE__ */ new Set();
|
|
1808
|
+
let current = null;
|
|
1809
|
+
const parentSuspense = instance.suspense;
|
|
1810
|
+
const {
|
|
1811
|
+
renderer: {
|
|
1812
|
+
p: patch,
|
|
1813
|
+
m: move,
|
|
1814
|
+
um: _unmount,
|
|
1815
|
+
o: { createElement }
|
|
1816
|
+
}
|
|
1817
|
+
} = sharedContext;
|
|
1818
|
+
const storageContainer = createElement("div");
|
|
1819
|
+
sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
|
|
1820
|
+
const instance2 = vnode.component;
|
|
1821
|
+
move(vnode, container, anchor, 0, parentSuspense);
|
|
1822
|
+
patch(
|
|
1823
|
+
instance2.vnode,
|
|
1824
|
+
vnode,
|
|
1825
|
+
container,
|
|
1826
|
+
anchor,
|
|
1827
|
+
instance2,
|
|
1828
|
+
parentSuspense,
|
|
1829
|
+
namespace,
|
|
1830
|
+
vnode.slotScopeIds,
|
|
1831
|
+
optimized
|
|
1832
|
+
);
|
|
1833
|
+
queuePostRenderEffect(() => {
|
|
1834
|
+
instance2.isDeactivated = false;
|
|
1835
|
+
if (instance2.a) {
|
|
1836
|
+
shared.invokeArrayFns(instance2.a);
|
|
1837
|
+
}
|
|
1838
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
|
|
1839
|
+
if (vnodeHook) {
|
|
1840
|
+
invokeVNodeHook(vnodeHook, instance2.parent, vnode);
|
|
1841
|
+
}
|
|
1842
|
+
}, parentSuspense);
|
|
1843
|
+
};
|
|
1844
|
+
sharedContext.deactivate = (vnode) => {
|
|
1845
|
+
const instance2 = vnode.component;
|
|
1846
|
+
invalidateMount(instance2.m);
|
|
1847
|
+
invalidateMount(instance2.a);
|
|
1848
|
+
move(vnode, storageContainer, null, 1, parentSuspense);
|
|
1849
|
+
queuePostRenderEffect(() => {
|
|
1850
|
+
if (instance2.da) {
|
|
1851
|
+
shared.invokeArrayFns(instance2.da);
|
|
1852
|
+
}
|
|
1853
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
|
|
1854
|
+
if (vnodeHook) {
|
|
1855
|
+
invokeVNodeHook(vnodeHook, instance2.parent, vnode);
|
|
1856
|
+
}
|
|
1857
|
+
instance2.isDeactivated = true;
|
|
1858
|
+
}, parentSuspense);
|
|
1859
|
+
};
|
|
1860
|
+
function unmount(vnode) {
|
|
1861
|
+
resetShapeFlag(vnode);
|
|
1862
|
+
_unmount(vnode, instance, parentSuspense, true);
|
|
1920
1863
|
}
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
registerLifecycleHook(onDeactivated, deactivated);
|
|
1928
|
-
registerLifecycleHook(onErrorCaptured, errorCaptured);
|
|
1929
|
-
registerLifecycleHook(onRenderTracked, renderTracked);
|
|
1930
|
-
registerLifecycleHook(onRenderTriggered, renderTriggered);
|
|
1931
|
-
registerLifecycleHook(onBeforeUnmount, beforeUnmount);
|
|
1932
|
-
registerLifecycleHook(onUnmounted, unmounted);
|
|
1933
|
-
registerLifecycleHook(onServerPrefetch, serverPrefetch);
|
|
1934
|
-
if (shared.isArray(expose)) {
|
|
1935
|
-
if (expose.length) {
|
|
1936
|
-
const exposed = instance.exposed || (instance.exposed = {});
|
|
1937
|
-
expose.forEach((key) => {
|
|
1938
|
-
Object.defineProperty(exposed, key, {
|
|
1939
|
-
get: () => publicThis[key],
|
|
1940
|
-
set: (val) => publicThis[key] = val
|
|
1941
|
-
});
|
|
1864
|
+
function pruneCache(filter) {
|
|
1865
|
+
cache.forEach((vnode, key) => {
|
|
1866
|
+
const name = getComponentName(vnode.type);
|
|
1867
|
+
if (name && (!filter || !filter(name))) {
|
|
1868
|
+
pruneCacheEntry(key);
|
|
1869
|
+
}
|
|
1942
1870
|
});
|
|
1943
|
-
} else if (!instance.exposed) {
|
|
1944
|
-
instance.exposed = {};
|
|
1945
1871
|
}
|
|
1872
|
+
function pruneCacheEntry(key) {
|
|
1873
|
+
const cached = cache.get(key);
|
|
1874
|
+
if (cached && (!current || !isSameVNodeType(cached, current))) {
|
|
1875
|
+
unmount(cached);
|
|
1876
|
+
} else if (current) {
|
|
1877
|
+
resetShapeFlag(current);
|
|
1878
|
+
}
|
|
1879
|
+
cache.delete(key);
|
|
1880
|
+
keys.delete(key);
|
|
1881
|
+
}
|
|
1882
|
+
watch(
|
|
1883
|
+
() => [props.include, props.exclude],
|
|
1884
|
+
([include, exclude]) => {
|
|
1885
|
+
include && pruneCache((name) => matches(include, name));
|
|
1886
|
+
exclude && pruneCache((name) => !matches(exclude, name));
|
|
1887
|
+
},
|
|
1888
|
+
// prune post-render after `current` has been updated
|
|
1889
|
+
{ flush: "post", deep: true }
|
|
1890
|
+
);
|
|
1891
|
+
let pendingCacheKey = null;
|
|
1892
|
+
const cacheSubtree = () => {
|
|
1893
|
+
if (pendingCacheKey != null) {
|
|
1894
|
+
if (isSuspense(instance.subTree.type)) {
|
|
1895
|
+
queuePostRenderEffect(() => {
|
|
1896
|
+
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
|
|
1897
|
+
}, instance.subTree.suspense);
|
|
1898
|
+
} else {
|
|
1899
|
+
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
};
|
|
1903
|
+
onMounted(cacheSubtree);
|
|
1904
|
+
onUpdated(cacheSubtree);
|
|
1905
|
+
onBeforeUnmount(() => {
|
|
1906
|
+
cache.forEach((cached) => {
|
|
1907
|
+
const { subTree, suspense } = instance;
|
|
1908
|
+
const vnode = getInnerChild(subTree);
|
|
1909
|
+
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
1910
|
+
resetShapeFlag(vnode);
|
|
1911
|
+
const da = vnode.component.da;
|
|
1912
|
+
da && queuePostRenderEffect(da, suspense);
|
|
1913
|
+
return;
|
|
1914
|
+
}
|
|
1915
|
+
unmount(cached);
|
|
1916
|
+
});
|
|
1917
|
+
});
|
|
1918
|
+
return () => {
|
|
1919
|
+
pendingCacheKey = null;
|
|
1920
|
+
if (!slots.default) {
|
|
1921
|
+
return null;
|
|
1922
|
+
}
|
|
1923
|
+
const children = slots.default();
|
|
1924
|
+
const rawVNode = children[0];
|
|
1925
|
+
if (children.length > 1) {
|
|
1926
|
+
current = null;
|
|
1927
|
+
return children;
|
|
1928
|
+
} else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
|
|
1929
|
+
current = null;
|
|
1930
|
+
return rawVNode;
|
|
1931
|
+
}
|
|
1932
|
+
let vnode = getInnerChild(rawVNode);
|
|
1933
|
+
if (vnode.type === Comment) {
|
|
1934
|
+
current = null;
|
|
1935
|
+
return vnode;
|
|
1936
|
+
}
|
|
1937
|
+
const comp = vnode.type;
|
|
1938
|
+
const name = getComponentName(
|
|
1939
|
+
isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
|
|
1940
|
+
);
|
|
1941
|
+
const { include, exclude, max } = props;
|
|
1942
|
+
if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
|
|
1943
|
+
current = vnode;
|
|
1944
|
+
return rawVNode;
|
|
1945
|
+
}
|
|
1946
|
+
const key = vnode.key == null ? comp : vnode.key;
|
|
1947
|
+
const cachedVNode = cache.get(key);
|
|
1948
|
+
if (vnode.el) {
|
|
1949
|
+
vnode = cloneVNode(vnode);
|
|
1950
|
+
if (rawVNode.shapeFlag & 128) {
|
|
1951
|
+
rawVNode.ssContent = vnode;
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
pendingCacheKey = key;
|
|
1955
|
+
if (cachedVNode) {
|
|
1956
|
+
vnode.el = cachedVNode.el;
|
|
1957
|
+
vnode.component = cachedVNode.component;
|
|
1958
|
+
if (vnode.transition) {
|
|
1959
|
+
setTransitionHooks(vnode, vnode.transition);
|
|
1960
|
+
}
|
|
1961
|
+
vnode.shapeFlag |= 512;
|
|
1962
|
+
keys.delete(key);
|
|
1963
|
+
keys.add(key);
|
|
1964
|
+
} else {
|
|
1965
|
+
keys.add(key);
|
|
1966
|
+
if (max && keys.size > parseInt(max, 10)) {
|
|
1967
|
+
pruneCacheEntry(keys.values().next().value);
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
vnode.shapeFlag |= 256;
|
|
1971
|
+
current = vnode;
|
|
1972
|
+
return isSuspense(rawVNode.type) ? rawVNode : vnode;
|
|
1973
|
+
};
|
|
1946
1974
|
}
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
if (
|
|
1951
|
-
|
|
1952
|
-
}
|
|
1953
|
-
|
|
1954
|
-
if (
|
|
1955
|
-
|
|
1956
|
-
markAsyncBoundary(instance);
|
|
1975
|
+
};
|
|
1976
|
+
const KeepAlive = KeepAliveImpl;
|
|
1977
|
+
function matches(pattern, name) {
|
|
1978
|
+
if (shared.isArray(pattern)) {
|
|
1979
|
+
return pattern.some((p) => matches(p, name));
|
|
1980
|
+
} else if (shared.isString(pattern)) {
|
|
1981
|
+
return pattern.split(",").includes(name);
|
|
1982
|
+
} else if (shared.isRegExp(pattern)) {
|
|
1983
|
+
return pattern.test(name);
|
|
1957
1984
|
}
|
|
1985
|
+
return false;
|
|
1958
1986
|
}
|
|
1959
|
-
function
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
true
|
|
1972
|
-
);
|
|
1973
|
-
} else {
|
|
1974
|
-
injected = inject(opt.from || key);
|
|
1987
|
+
function onActivated(hook, target) {
|
|
1988
|
+
registerKeepAliveHook(hook, "a", target);
|
|
1989
|
+
}
|
|
1990
|
+
function onDeactivated(hook, target) {
|
|
1991
|
+
registerKeepAliveHook(hook, "da", target);
|
|
1992
|
+
}
|
|
1993
|
+
function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
1994
|
+
const wrappedHook = hook.__wdc || (hook.__wdc = () => {
|
|
1995
|
+
let current = target;
|
|
1996
|
+
while (current) {
|
|
1997
|
+
if (current.isDeactivated) {
|
|
1998
|
+
return;
|
|
1975
1999
|
}
|
|
1976
|
-
|
|
1977
|
-
injected = inject(opt);
|
|
2000
|
+
current = current.parent;
|
|
1978
2001
|
}
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
2002
|
+
return hook();
|
|
2003
|
+
});
|
|
2004
|
+
injectHook(type, wrappedHook, target);
|
|
2005
|
+
if (target) {
|
|
2006
|
+
let current = target.parent;
|
|
2007
|
+
while (current && current.parent) {
|
|
2008
|
+
if (isKeepAlive(current.parent.vnode)) {
|
|
2009
|
+
injectToKeepAliveRoot(wrappedHook, type, target, current);
|
|
2010
|
+
}
|
|
2011
|
+
current = current.parent;
|
|
1988
2012
|
}
|
|
1989
2013
|
}
|
|
1990
2014
|
}
|
|
1991
|
-
function
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
2015
|
+
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
2016
|
+
const injected = injectHook(
|
|
2017
|
+
type,
|
|
2018
|
+
hook,
|
|
2019
|
+
keepAliveRoot,
|
|
2020
|
+
true
|
|
2021
|
+
/* prepend */
|
|
1996
2022
|
);
|
|
2023
|
+
onUnmounted(() => {
|
|
2024
|
+
shared.remove(keepAliveRoot[type], injected);
|
|
2025
|
+
}, target);
|
|
1997
2026
|
}
|
|
1998
|
-
function
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
const handler = ctx[raw];
|
|
2002
|
-
if (shared.isFunction(handler)) {
|
|
2003
|
-
watch(getter, handler);
|
|
2004
|
-
}
|
|
2005
|
-
} else if (shared.isFunction(raw)) {
|
|
2006
|
-
watch(getter, raw.bind(publicThis));
|
|
2007
|
-
} else if (shared.isObject(raw)) {
|
|
2008
|
-
if (shared.isArray(raw)) {
|
|
2009
|
-
raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
2010
|
-
} else {
|
|
2011
|
-
const handler = shared.isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
2012
|
-
if (shared.isFunction(handler)) {
|
|
2013
|
-
watch(getter, handler, raw);
|
|
2014
|
-
}
|
|
2015
|
-
}
|
|
2016
|
-
} else ;
|
|
2017
|
-
}
|
|
2018
|
-
function resolveMergedOptions(instance) {
|
|
2019
|
-
const base = instance.type;
|
|
2020
|
-
const { mixins, extends: extendsOptions } = base;
|
|
2021
|
-
const {
|
|
2022
|
-
mixins: globalMixins,
|
|
2023
|
-
optionsCache: cache,
|
|
2024
|
-
config: { optionMergeStrategies }
|
|
2025
|
-
} = instance.appContext;
|
|
2026
|
-
const cached = cache.get(base);
|
|
2027
|
-
let resolved;
|
|
2028
|
-
if (cached) {
|
|
2029
|
-
resolved = cached;
|
|
2030
|
-
} else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
2031
|
-
{
|
|
2032
|
-
resolved = base;
|
|
2033
|
-
}
|
|
2034
|
-
} else {
|
|
2035
|
-
resolved = {};
|
|
2036
|
-
if (globalMixins.length) {
|
|
2037
|
-
globalMixins.forEach(
|
|
2038
|
-
(m) => mergeOptions(resolved, m, optionMergeStrategies, true)
|
|
2039
|
-
);
|
|
2040
|
-
}
|
|
2041
|
-
mergeOptions(resolved, base, optionMergeStrategies);
|
|
2042
|
-
}
|
|
2043
|
-
if (shared.isObject(base)) {
|
|
2044
|
-
cache.set(base, resolved);
|
|
2045
|
-
}
|
|
2046
|
-
return resolved;
|
|
2027
|
+
function resetShapeFlag(vnode) {
|
|
2028
|
+
vnode.shapeFlag &= ~256;
|
|
2029
|
+
vnode.shapeFlag &= ~512;
|
|
2047
2030
|
}
|
|
2048
|
-
function
|
|
2049
|
-
|
|
2050
|
-
if (extendsOptions) {
|
|
2051
|
-
mergeOptions(to, extendsOptions, strats, true);
|
|
2052
|
-
}
|
|
2053
|
-
if (mixins) {
|
|
2054
|
-
mixins.forEach(
|
|
2055
|
-
(m) => mergeOptions(to, m, strats, true)
|
|
2056
|
-
);
|
|
2057
|
-
}
|
|
2058
|
-
for (const key in from) {
|
|
2059
|
-
if (asMixin && key === "expose") ; else {
|
|
2060
|
-
const strat = internalOptionMergeStrats[key] || strats && strats[key];
|
|
2061
|
-
to[key] = strat ? strat(to[key], from[key]) : from[key];
|
|
2062
|
-
}
|
|
2063
|
-
}
|
|
2064
|
-
return to;
|
|
2031
|
+
function getInnerChild(vnode) {
|
|
2032
|
+
return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
|
|
2065
2033
|
}
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
activated: mergeAsArray,
|
|
2085
|
-
deactivated: mergeAsArray,
|
|
2086
|
-
errorCaptured: mergeAsArray,
|
|
2087
|
-
serverPrefetch: mergeAsArray,
|
|
2088
|
-
// assets
|
|
2089
|
-
components: mergeObjectOptions,
|
|
2090
|
-
directives: mergeObjectOptions,
|
|
2091
|
-
// watch
|
|
2092
|
-
watch: mergeWatchOptions,
|
|
2093
|
-
// provide / inject
|
|
2094
|
-
provide: mergeDataFn,
|
|
2095
|
-
inject: mergeInject
|
|
2096
|
-
};
|
|
2097
|
-
function mergeDataFn(to, from) {
|
|
2098
|
-
if (!from) {
|
|
2099
|
-
return to;
|
|
2034
|
+
|
|
2035
|
+
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
2036
|
+
if (target) {
|
|
2037
|
+
const hooks = target[type] || (target[type] = []);
|
|
2038
|
+
const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
|
|
2039
|
+
reactivity.pauseTracking();
|
|
2040
|
+
const reset = setCurrentInstance(target);
|
|
2041
|
+
const res = callWithAsyncErrorHandling(hook, target, type, args);
|
|
2042
|
+
reset();
|
|
2043
|
+
reactivity.resetTracking();
|
|
2044
|
+
return res;
|
|
2045
|
+
});
|
|
2046
|
+
if (prepend) {
|
|
2047
|
+
hooks.unshift(wrappedHook);
|
|
2048
|
+
} else {
|
|
2049
|
+
hooks.push(wrappedHook);
|
|
2050
|
+
}
|
|
2051
|
+
return wrappedHook;
|
|
2100
2052
|
}
|
|
2101
|
-
|
|
2102
|
-
|
|
2053
|
+
}
|
|
2054
|
+
const createHook = (lifecycle) => (hook, target = currentInstance) => {
|
|
2055
|
+
if (!isInSSRComponentSetup || lifecycle === "sp") {
|
|
2056
|
+
injectHook(lifecycle, (...args) => hook(...args), target);
|
|
2103
2057
|
}
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2058
|
+
};
|
|
2059
|
+
const onBeforeMount = createHook("bm");
|
|
2060
|
+
const onMounted = createHook("m");
|
|
2061
|
+
const onBeforeUpdate = createHook(
|
|
2062
|
+
"bu"
|
|
2063
|
+
);
|
|
2064
|
+
const onUpdated = createHook("u");
|
|
2065
|
+
const onBeforeUnmount = createHook(
|
|
2066
|
+
"bum"
|
|
2067
|
+
);
|
|
2068
|
+
const onUnmounted = createHook("um");
|
|
2069
|
+
const onServerPrefetch = createHook(
|
|
2070
|
+
"sp"
|
|
2071
|
+
);
|
|
2072
|
+
const onRenderTriggered = createHook("rtg");
|
|
2073
|
+
const onRenderTracked = createHook("rtc");
|
|
2074
|
+
function onErrorCaptured(hook, target = currentInstance) {
|
|
2075
|
+
injectHook("ec", hook, target);
|
|
2110
2076
|
}
|
|
2111
|
-
|
|
2112
|
-
|
|
2077
|
+
|
|
2078
|
+
const COMPONENTS = "components";
|
|
2079
|
+
const DIRECTIVES = "directives";
|
|
2080
|
+
function resolveComponent(name, maybeSelfReference) {
|
|
2081
|
+
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
2113
2082
|
}
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
return res;
|
|
2083
|
+
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
2084
|
+
function resolveDynamicComponent(component) {
|
|
2085
|
+
if (shared.isString(component)) {
|
|
2086
|
+
return resolveAsset(COMPONENTS, component, false) || component;
|
|
2087
|
+
} else {
|
|
2088
|
+
return component || NULL_DYNAMIC_COMPONENT;
|
|
2121
2089
|
}
|
|
2122
|
-
return raw;
|
|
2123
|
-
}
|
|
2124
|
-
function mergeAsArray(to, from) {
|
|
2125
|
-
return to ? [...new Set([].concat(to, from))] : from;
|
|
2126
2090
|
}
|
|
2127
|
-
function
|
|
2128
|
-
return
|
|
2091
|
+
function resolveDirective(name) {
|
|
2092
|
+
return resolveAsset(DIRECTIVES, name);
|
|
2129
2093
|
}
|
|
2130
|
-
function
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2094
|
+
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
|
|
2095
|
+
const instance = currentRenderingInstance || currentInstance;
|
|
2096
|
+
if (instance) {
|
|
2097
|
+
const Component = instance.type;
|
|
2098
|
+
if (type === COMPONENTS) {
|
|
2099
|
+
const selfName = getComponentName(
|
|
2100
|
+
Component,
|
|
2101
|
+
false
|
|
2102
|
+
);
|
|
2103
|
+
if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) {
|
|
2104
|
+
return Component;
|
|
2105
|
+
}
|
|
2134
2106
|
}
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2107
|
+
const res = (
|
|
2108
|
+
// local registration
|
|
2109
|
+
// check instance[type] first which is resolved for options API
|
|
2110
|
+
resolve(instance[type] || Component[type], name) || // global registration
|
|
2111
|
+
resolve(instance.appContext[type], name)
|
|
2139
2112
|
);
|
|
2140
|
-
|
|
2141
|
-
|
|
2113
|
+
if (!res && maybeSelfReference) {
|
|
2114
|
+
return Component;
|
|
2115
|
+
}
|
|
2116
|
+
return res;
|
|
2142
2117
|
}
|
|
2143
2118
|
}
|
|
2144
|
-
function
|
|
2145
|
-
|
|
2146
|
-
if (!from) return to;
|
|
2147
|
-
const merged = shared.extend(/* @__PURE__ */ Object.create(null), to);
|
|
2148
|
-
for (const key in from) {
|
|
2149
|
-
merged[key] = mergeAsArray(to[key], from[key]);
|
|
2150
|
-
}
|
|
2151
|
-
return merged;
|
|
2119
|
+
function resolve(registry, name) {
|
|
2120
|
+
return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]);
|
|
2152
2121
|
}
|
|
2153
2122
|
|
|
2154
|
-
function
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
errorHandler: void 0,
|
|
2163
|
-
warnHandler: void 0,
|
|
2164
|
-
compilerOptions: {}
|
|
2165
|
-
},
|
|
2166
|
-
mixins: [],
|
|
2167
|
-
components: {},
|
|
2168
|
-
directives: {},
|
|
2169
|
-
provides: /* @__PURE__ */ Object.create(null),
|
|
2170
|
-
optionsCache: /* @__PURE__ */ new WeakMap(),
|
|
2171
|
-
propsCache: /* @__PURE__ */ new WeakMap(),
|
|
2172
|
-
emitsCache: /* @__PURE__ */ new WeakMap()
|
|
2173
|
-
};
|
|
2174
|
-
}
|
|
2175
|
-
let uid$1 = 0;
|
|
2176
|
-
function createAppAPI(render, hydrate) {
|
|
2177
|
-
return function createApp(rootComponent, rootProps = null) {
|
|
2178
|
-
if (!shared.isFunction(rootComponent)) {
|
|
2179
|
-
rootComponent = shared.extend({}, rootComponent);
|
|
2123
|
+
function renderList(source, renderItem, cache, index) {
|
|
2124
|
+
let ret;
|
|
2125
|
+
const cached = cache && cache[index];
|
|
2126
|
+
const sourceIsArray = shared.isArray(source);
|
|
2127
|
+
if (sourceIsArray || shared.isString(source)) {
|
|
2128
|
+
const sourceIsReactiveArray = sourceIsArray && reactivity.isReactive(source);
|
|
2129
|
+
if (sourceIsReactiveArray) {
|
|
2130
|
+
source = reactivity.shallowReadArray(source);
|
|
2180
2131
|
}
|
|
2181
|
-
|
|
2182
|
-
|
|
2132
|
+
ret = new Array(source.length);
|
|
2133
|
+
for (let i = 0, l = source.length; i < l; i++) {
|
|
2134
|
+
ret[i] = renderItem(
|
|
2135
|
+
sourceIsReactiveArray ? reactivity.toReactive(source[i]) : source[i],
|
|
2136
|
+
i,
|
|
2137
|
+
void 0,
|
|
2138
|
+
cached && cached[i]
|
|
2139
|
+
);
|
|
2183
2140
|
}
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
},
|
|
2211
|
-
mixin(mixin) {
|
|
2212
|
-
{
|
|
2213
|
-
if (!context.mixins.includes(mixin)) {
|
|
2214
|
-
context.mixins.push(mixin);
|
|
2215
|
-
}
|
|
2216
|
-
}
|
|
2217
|
-
return app;
|
|
2218
|
-
},
|
|
2219
|
-
component(name, component) {
|
|
2220
|
-
if (!component) {
|
|
2221
|
-
return context.components[name];
|
|
2222
|
-
}
|
|
2223
|
-
context.components[name] = component;
|
|
2224
|
-
return app;
|
|
2225
|
-
},
|
|
2226
|
-
directive(name, directive) {
|
|
2227
|
-
if (!directive) {
|
|
2228
|
-
return context.directives[name];
|
|
2229
|
-
}
|
|
2230
|
-
context.directives[name] = directive;
|
|
2231
|
-
return app;
|
|
2232
|
-
},
|
|
2233
|
-
mount(rootContainer, isHydrate, namespace) {
|
|
2234
|
-
if (!isMounted) {
|
|
2235
|
-
const vnode = createVNode(rootComponent, rootProps);
|
|
2236
|
-
vnode.appContext = context;
|
|
2237
|
-
if (namespace === true) {
|
|
2238
|
-
namespace = "svg";
|
|
2239
|
-
} else if (namespace === false) {
|
|
2240
|
-
namespace = void 0;
|
|
2241
|
-
}
|
|
2242
|
-
if (isHydrate && hydrate) {
|
|
2243
|
-
hydrate(vnode, rootContainer);
|
|
2244
|
-
} else {
|
|
2245
|
-
render(vnode, rootContainer, namespace);
|
|
2246
|
-
}
|
|
2247
|
-
isMounted = true;
|
|
2248
|
-
app._container = rootContainer;
|
|
2249
|
-
rootContainer.__vue_app__ = app;
|
|
2250
|
-
return getComponentPublicInstance(vnode.component);
|
|
2251
|
-
}
|
|
2252
|
-
},
|
|
2253
|
-
onUnmount(cleanupFn) {
|
|
2254
|
-
pluginCleanupFns.push(cleanupFn);
|
|
2255
|
-
},
|
|
2256
|
-
unmount() {
|
|
2257
|
-
if (isMounted) {
|
|
2258
|
-
callWithAsyncErrorHandling(
|
|
2259
|
-
pluginCleanupFns,
|
|
2260
|
-
app._instance,
|
|
2261
|
-
16
|
|
2262
|
-
);
|
|
2263
|
-
render(null, app._container);
|
|
2264
|
-
delete app._container.__vue_app__;
|
|
2265
|
-
}
|
|
2266
|
-
},
|
|
2267
|
-
provide(key, value) {
|
|
2268
|
-
context.provides[key] = value;
|
|
2269
|
-
return app;
|
|
2270
|
-
},
|
|
2271
|
-
runWithContext(fn) {
|
|
2272
|
-
const lastApp = currentApp;
|
|
2273
|
-
currentApp = app;
|
|
2274
|
-
try {
|
|
2275
|
-
return fn();
|
|
2276
|
-
} finally {
|
|
2277
|
-
currentApp = lastApp;
|
|
2278
|
-
}
|
|
2279
|
-
}
|
|
2280
|
-
};
|
|
2281
|
-
return app;
|
|
2282
|
-
};
|
|
2141
|
+
} else if (typeof source === "number") {
|
|
2142
|
+
ret = new Array(source);
|
|
2143
|
+
for (let i = 0; i < source; i++) {
|
|
2144
|
+
ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
2145
|
+
}
|
|
2146
|
+
} else if (shared.isObject(source)) {
|
|
2147
|
+
if (source[Symbol.iterator]) {
|
|
2148
|
+
ret = Array.from(
|
|
2149
|
+
source,
|
|
2150
|
+
(item, i) => renderItem(item, i, void 0, cached && cached[i])
|
|
2151
|
+
);
|
|
2152
|
+
} else {
|
|
2153
|
+
const keys = Object.keys(source);
|
|
2154
|
+
ret = new Array(keys.length);
|
|
2155
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
2156
|
+
const key = keys[i];
|
|
2157
|
+
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
} else {
|
|
2161
|
+
ret = [];
|
|
2162
|
+
}
|
|
2163
|
+
if (cache) {
|
|
2164
|
+
cache[index] = ret;
|
|
2165
|
+
}
|
|
2166
|
+
return ret;
|
|
2283
2167
|
}
|
|
2284
|
-
let currentApp = null;
|
|
2285
2168
|
|
|
2286
|
-
function
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2169
|
+
function createSlots(slots, dynamicSlots) {
|
|
2170
|
+
for (let i = 0; i < dynamicSlots.length; i++) {
|
|
2171
|
+
const slot = dynamicSlots[i];
|
|
2172
|
+
if (shared.isArray(slot)) {
|
|
2173
|
+
for (let j = 0; j < slot.length; j++) {
|
|
2174
|
+
slots[slot[j].name] = slot[j].fn;
|
|
2175
|
+
}
|
|
2176
|
+
} else if (slot) {
|
|
2177
|
+
slots[slot.name] = slot.key ? (...args) => {
|
|
2178
|
+
const res = slot.fn(...args);
|
|
2179
|
+
if (res) res.key = slot.key;
|
|
2180
|
+
return res;
|
|
2181
|
+
} : slot.fn;
|
|
2292
2182
|
}
|
|
2293
|
-
provides[key] = value;
|
|
2294
2183
|
}
|
|
2184
|
+
return slots;
|
|
2295
2185
|
}
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
if (
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2186
|
+
|
|
2187
|
+
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
2188
|
+
if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
|
|
2189
|
+
if (name !== "default") props.name = name;
|
|
2190
|
+
return openBlock(), createBlock(
|
|
2191
|
+
Fragment,
|
|
2192
|
+
null,
|
|
2193
|
+
[createVNode("slot", props, fallback && fallback())],
|
|
2194
|
+
64
|
|
2195
|
+
);
|
|
2196
|
+
}
|
|
2197
|
+
let slot = slots[name];
|
|
2198
|
+
if (slot && slot._c) {
|
|
2199
|
+
slot._d = false;
|
|
2200
|
+
}
|
|
2201
|
+
openBlock();
|
|
2202
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2203
|
+
const rendered = createBlock(
|
|
2204
|
+
Fragment,
|
|
2205
|
+
{
|
|
2206
|
+
key: (props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
2207
|
+
// key attached in the `createSlots` helper, respect that
|
|
2208
|
+
validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2209
|
+
(!validSlotContent && fallback ? "_fb" : "")
|
|
2210
|
+
},
|
|
2211
|
+
validSlotContent || (fallback ? fallback() : []),
|
|
2212
|
+
validSlotContent && slots._ === 1 ? 64 : -2
|
|
2213
|
+
);
|
|
2214
|
+
if (!noSlotted && rendered.scopeId) {
|
|
2215
|
+
rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
2216
|
+
}
|
|
2217
|
+
if (slot && slot._c) {
|
|
2218
|
+
slot._d = true;
|
|
2305
2219
|
}
|
|
2220
|
+
return rendered;
|
|
2306
2221
|
}
|
|
2307
|
-
function
|
|
2308
|
-
return
|
|
2222
|
+
function ensureValidVNode(vnodes) {
|
|
2223
|
+
return vnodes.some((child) => {
|
|
2224
|
+
if (!isVNode(child)) return true;
|
|
2225
|
+
if (child.type === Comment) return false;
|
|
2226
|
+
if (child.type === Fragment && !ensureValidVNode(child.children))
|
|
2227
|
+
return false;
|
|
2228
|
+
return true;
|
|
2229
|
+
}) ? vnodes : null;
|
|
2309
2230
|
}
|
|
2310
2231
|
|
|
2311
|
-
|
|
2312
|
-
const
|
|
2313
|
-
const
|
|
2314
|
-
|
|
2315
|
-
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
2316
|
-
const props = {};
|
|
2317
|
-
const attrs = createInternalObject();
|
|
2318
|
-
instance.propsDefaults = /* @__PURE__ */ Object.create(null);
|
|
2319
|
-
setFullProps(instance, rawProps, props, attrs);
|
|
2320
|
-
for (const key in instance.propsOptions[0]) {
|
|
2321
|
-
if (!(key in props)) {
|
|
2322
|
-
props[key] = void 0;
|
|
2323
|
-
}
|
|
2324
|
-
}
|
|
2325
|
-
if (isStateful) {
|
|
2326
|
-
instance.props = isSSR ? props : reactivity.shallowReactive(props);
|
|
2327
|
-
} else {
|
|
2328
|
-
if (!instance.type.props) {
|
|
2329
|
-
instance.props = attrs;
|
|
2330
|
-
} else {
|
|
2331
|
-
instance.props = props;
|
|
2332
|
-
}
|
|
2232
|
+
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
2233
|
+
const ret = {};
|
|
2234
|
+
for (const key in obj) {
|
|
2235
|
+
ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = obj[key];
|
|
2333
2236
|
}
|
|
2334
|
-
|
|
2237
|
+
return ret;
|
|
2335
2238
|
}
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
(
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2239
|
+
|
|
2240
|
+
const getPublicInstance = (i) => {
|
|
2241
|
+
if (!i) return null;
|
|
2242
|
+
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
2243
|
+
return getPublicInstance(i.parent);
|
|
2244
|
+
};
|
|
2245
|
+
const publicPropertiesMap = (
|
|
2246
|
+
// Move PURE marker to new line to workaround compiler discarding it
|
|
2247
|
+
// due to type annotation
|
|
2248
|
+
/* @__PURE__ */ shared.extend(/* @__PURE__ */ Object.create(null), {
|
|
2249
|
+
$: (i) => i,
|
|
2250
|
+
$el: (i) => i.vnode.el,
|
|
2251
|
+
$data: (i) => i.data,
|
|
2252
|
+
$props: (i) => i.props,
|
|
2253
|
+
$attrs: (i) => i.attrs,
|
|
2254
|
+
$slots: (i) => i.slots,
|
|
2255
|
+
$refs: (i) => i.refs,
|
|
2256
|
+
$parent: (i) => getPublicInstance(i.parent),
|
|
2257
|
+
$root: (i) => getPublicInstance(i.root),
|
|
2258
|
+
$host: (i) => i.ce,
|
|
2259
|
+
$emit: (i) => i.emit,
|
|
2260
|
+
$options: (i) => resolveMergedOptions(i) ,
|
|
2261
|
+
$forceUpdate: (i) => i.f || (i.f = () => {
|
|
2262
|
+
queueJob(i.update);
|
|
2263
|
+
}),
|
|
2264
|
+
$nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
|
|
2265
|
+
$watch: (i) => instanceWatch.bind(i)
|
|
2266
|
+
})
|
|
2267
|
+
);
|
|
2268
|
+
const hasSetupBinding = (state, key) => state !== shared.EMPTY_OBJ && !state.__isScriptSetup && shared.hasOwn(state, key);
|
|
2269
|
+
const PublicInstanceProxyHandlers = {
|
|
2270
|
+
get({ _: instance }, key) {
|
|
2271
|
+
if (key === "__v_skip") {
|
|
2272
|
+
return true;
|
|
2273
|
+
}
|
|
2274
|
+
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
2275
|
+
let normalizedProps;
|
|
2276
|
+
if (key[0] !== "$") {
|
|
2277
|
+
const n = accessCache[key];
|
|
2278
|
+
if (n !== void 0) {
|
|
2279
|
+
switch (n) {
|
|
2280
|
+
case 1 /* SETUP */:
|
|
2281
|
+
return setupState[key];
|
|
2282
|
+
case 2 /* DATA */:
|
|
2283
|
+
return data[key];
|
|
2284
|
+
case 4 /* CONTEXT */:
|
|
2285
|
+
return ctx[key];
|
|
2286
|
+
case 3 /* PROPS */:
|
|
2287
|
+
return props[key];
|
|
2381
2288
|
}
|
|
2289
|
+
} else if (hasSetupBinding(setupState, key)) {
|
|
2290
|
+
accessCache[key] = 1 /* SETUP */;
|
|
2291
|
+
return setupState[key];
|
|
2292
|
+
} else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
|
|
2293
|
+
accessCache[key] = 2 /* DATA */;
|
|
2294
|
+
return data[key];
|
|
2295
|
+
} else if (
|
|
2296
|
+
// only cache other properties when instance has declared (thus stable)
|
|
2297
|
+
// props
|
|
2298
|
+
(normalizedProps = instance.propsOptions[0]) && shared.hasOwn(normalizedProps, key)
|
|
2299
|
+
) {
|
|
2300
|
+
accessCache[key] = 3 /* PROPS */;
|
|
2301
|
+
return props[key];
|
|
2302
|
+
} else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
|
|
2303
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
2304
|
+
return ctx[key];
|
|
2305
|
+
} else if (shouldCacheAccess) {
|
|
2306
|
+
accessCache[key] = 0 /* OTHER */;
|
|
2382
2307
|
}
|
|
2383
2308
|
}
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
//
|
|
2393
|
-
(
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
);
|
|
2406
|
-
}
|
|
2407
|
-
} else {
|
|
2408
|
-
delete props[key];
|
|
2409
|
-
}
|
|
2309
|
+
const publicGetter = publicPropertiesMap[key];
|
|
2310
|
+
let cssModule, globalProperties;
|
|
2311
|
+
if (publicGetter) {
|
|
2312
|
+
if (key === "$attrs") {
|
|
2313
|
+
reactivity.track(instance.attrs, "get", "");
|
|
2314
|
+
}
|
|
2315
|
+
return publicGetter(instance);
|
|
2316
|
+
} else if (
|
|
2317
|
+
// css module (injected by vue-loader)
|
|
2318
|
+
(cssModule = type.__cssModules) && (cssModule = cssModule[key])
|
|
2319
|
+
) {
|
|
2320
|
+
return cssModule;
|
|
2321
|
+
} else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
|
|
2322
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
2323
|
+
return ctx[key];
|
|
2324
|
+
} else if (
|
|
2325
|
+
// global properties
|
|
2326
|
+
globalProperties = appContext.config.globalProperties, shared.hasOwn(globalProperties, key)
|
|
2327
|
+
) {
|
|
2328
|
+
{
|
|
2329
|
+
return globalProperties[key];
|
|
2410
2330
|
}
|
|
2331
|
+
} else ;
|
|
2332
|
+
},
|
|
2333
|
+
set({ _: instance }, key, value) {
|
|
2334
|
+
const { data, setupState, ctx } = instance;
|
|
2335
|
+
if (hasSetupBinding(setupState, key)) {
|
|
2336
|
+
setupState[key] = value;
|
|
2337
|
+
return true;
|
|
2338
|
+
} else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
|
|
2339
|
+
data[key] = value;
|
|
2340
|
+
return true;
|
|
2341
|
+
} else if (shared.hasOwn(instance.props, key)) {
|
|
2342
|
+
return false;
|
|
2411
2343
|
}
|
|
2412
|
-
if (
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
}
|
|
2344
|
+
if (key[0] === "$" && key.slice(1) in instance) {
|
|
2345
|
+
return false;
|
|
2346
|
+
} else {
|
|
2347
|
+
{
|
|
2348
|
+
ctx[key] = value;
|
|
2418
2349
|
}
|
|
2419
2350
|
}
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
}
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
}
|
|
2434
|
-
const value = rawProps[key];
|
|
2435
|
-
let camelKey;
|
|
2436
|
-
if (options && shared.hasOwn(options, camelKey = shared.camelize(key))) {
|
|
2437
|
-
if (!needCastKeys || !needCastKeys.includes(camelKey)) {
|
|
2438
|
-
props[camelKey] = value;
|
|
2439
|
-
} else {
|
|
2440
|
-
(rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
2441
|
-
}
|
|
2442
|
-
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
2443
|
-
if (!(key in attrs) || value !== attrs[key]) {
|
|
2444
|
-
attrs[key] = value;
|
|
2445
|
-
hasAttrsChanged = true;
|
|
2446
|
-
}
|
|
2447
|
-
}
|
|
2351
|
+
return true;
|
|
2352
|
+
},
|
|
2353
|
+
has({
|
|
2354
|
+
_: { data, setupState, accessCache, ctx, appContext, propsOptions }
|
|
2355
|
+
}, key) {
|
|
2356
|
+
let normalizedProps;
|
|
2357
|
+
return !!accessCache[key] || data !== shared.EMPTY_OBJ && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && shared.hasOwn(normalizedProps, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key);
|
|
2358
|
+
},
|
|
2359
|
+
defineProperty(target, key, descriptor) {
|
|
2360
|
+
if (descriptor.get != null) {
|
|
2361
|
+
target._.accessCache[key] = 0;
|
|
2362
|
+
} else if (shared.hasOwn(descriptor, "value")) {
|
|
2363
|
+
this.set(target, key, descriptor.value, null);
|
|
2448
2364
|
}
|
|
2365
|
+
return Reflect.defineProperty(target, key, descriptor);
|
|
2449
2366
|
}
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
props[key] = resolvePropValue(
|
|
2456
|
-
options,
|
|
2457
|
-
rawCurrentProps,
|
|
2458
|
-
key,
|
|
2459
|
-
castValues[key],
|
|
2460
|
-
instance,
|
|
2461
|
-
!shared.hasOwn(castValues, key)
|
|
2462
|
-
);
|
|
2367
|
+
};
|
|
2368
|
+
const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ shared.extend({}, PublicInstanceProxyHandlers, {
|
|
2369
|
+
get(target, key) {
|
|
2370
|
+
if (key === Symbol.unscopables) {
|
|
2371
|
+
return;
|
|
2463
2372
|
}
|
|
2373
|
+
return PublicInstanceProxyHandlers.get(target, key, target);
|
|
2374
|
+
},
|
|
2375
|
+
has(_, key) {
|
|
2376
|
+
const has = key[0] !== "_" && !shared.isGloballyAllowed(key);
|
|
2377
|
+
return has;
|
|
2464
2378
|
}
|
|
2465
|
-
|
|
2379
|
+
});
|
|
2380
|
+
|
|
2381
|
+
function defineProps() {
|
|
2382
|
+
return null;
|
|
2466
2383
|
}
|
|
2467
|
-
function
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2384
|
+
function defineEmits() {
|
|
2385
|
+
return null;
|
|
2386
|
+
}
|
|
2387
|
+
function defineExpose(exposed) {
|
|
2388
|
+
}
|
|
2389
|
+
function defineOptions(options) {
|
|
2390
|
+
}
|
|
2391
|
+
function defineSlots() {
|
|
2392
|
+
return null;
|
|
2393
|
+
}
|
|
2394
|
+
function defineModel() {
|
|
2395
|
+
}
|
|
2396
|
+
function withDefaults(props, defaults) {
|
|
2397
|
+
return null;
|
|
2398
|
+
}
|
|
2399
|
+
function useSlots() {
|
|
2400
|
+
return getContext().slots;
|
|
2401
|
+
}
|
|
2402
|
+
function useAttrs() {
|
|
2403
|
+
return getContext().attrs;
|
|
2404
|
+
}
|
|
2405
|
+
function getContext() {
|
|
2406
|
+
const i = getCurrentInstance();
|
|
2407
|
+
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
2408
|
+
}
|
|
2409
|
+
function normalizePropsOrEmits(props) {
|
|
2410
|
+
return shared.isArray(props) ? props.reduce(
|
|
2411
|
+
(normalized, p) => (normalized[p] = null, normalized),
|
|
2412
|
+
{}
|
|
2413
|
+
) : props;
|
|
2414
|
+
}
|
|
2415
|
+
function mergeDefaults(raw, defaults) {
|
|
2416
|
+
const props = normalizePropsOrEmits(raw);
|
|
2417
|
+
for (const key in defaults) {
|
|
2418
|
+
if (key.startsWith("__skip")) continue;
|
|
2419
|
+
let opt = props[key];
|
|
2420
|
+
if (opt) {
|
|
2421
|
+
if (shared.isArray(opt) || shared.isFunction(opt)) {
|
|
2422
|
+
opt = props[key] = { type: opt, default: defaults[key] };
|
|
2485
2423
|
} else {
|
|
2486
|
-
|
|
2424
|
+
opt.default = defaults[key];
|
|
2487
2425
|
}
|
|
2426
|
+
} else if (opt === null) {
|
|
2427
|
+
opt = props[key] = { default: defaults[key] };
|
|
2428
|
+
} else ;
|
|
2429
|
+
if (opt && defaults[`__skip_${key}`]) {
|
|
2430
|
+
opt.skipFactory = true;
|
|
2488
2431
|
}
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2432
|
+
}
|
|
2433
|
+
return props;
|
|
2434
|
+
}
|
|
2435
|
+
function mergeModels(a, b) {
|
|
2436
|
+
if (!a || !b) return a || b;
|
|
2437
|
+
if (shared.isArray(a) && shared.isArray(b)) return a.concat(b);
|
|
2438
|
+
return shared.extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
|
|
2439
|
+
}
|
|
2440
|
+
function createPropsRestProxy(props, excludedKeys) {
|
|
2441
|
+
const ret = {};
|
|
2442
|
+
for (const key in props) {
|
|
2443
|
+
if (!excludedKeys.includes(key)) {
|
|
2444
|
+
Object.defineProperty(ret, key, {
|
|
2445
|
+
enumerable: true,
|
|
2446
|
+
get: () => props[key]
|
|
2447
|
+
});
|
|
2495
2448
|
}
|
|
2496
2449
|
}
|
|
2497
|
-
return
|
|
2450
|
+
return ret;
|
|
2498
2451
|
}
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
if (
|
|
2504
|
-
|
|
2452
|
+
function withAsyncContext(getAwaitable) {
|
|
2453
|
+
const ctx = getCurrentInstance();
|
|
2454
|
+
let awaitable = getAwaitable();
|
|
2455
|
+
unsetCurrentInstance();
|
|
2456
|
+
if (shared.isPromise(awaitable)) {
|
|
2457
|
+
awaitable = awaitable.catch((e) => {
|
|
2458
|
+
setCurrentInstance(ctx);
|
|
2459
|
+
throw e;
|
|
2460
|
+
});
|
|
2505
2461
|
}
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2462
|
+
return [awaitable, () => setCurrentInstance(ctx)];
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
let shouldCacheAccess = true;
|
|
2466
|
+
function applyOptions(instance) {
|
|
2467
|
+
const options = resolveMergedOptions(instance);
|
|
2468
|
+
const publicThis = instance.proxy;
|
|
2469
|
+
const ctx = instance.ctx;
|
|
2470
|
+
shouldCacheAccess = false;
|
|
2471
|
+
if (options.beforeCreate) {
|
|
2472
|
+
callHook(options.beforeCreate, instance, "bc");
|
|
2473
|
+
}
|
|
2474
|
+
const {
|
|
2475
|
+
// state
|
|
2476
|
+
data: dataOptions,
|
|
2477
|
+
computed: computedOptions,
|
|
2478
|
+
methods,
|
|
2479
|
+
watch: watchOptions,
|
|
2480
|
+
provide: provideOptions,
|
|
2481
|
+
inject: injectOptions,
|
|
2482
|
+
// lifecycle
|
|
2483
|
+
created,
|
|
2484
|
+
beforeMount,
|
|
2485
|
+
mounted,
|
|
2486
|
+
beforeUpdate,
|
|
2487
|
+
updated,
|
|
2488
|
+
activated,
|
|
2489
|
+
deactivated,
|
|
2490
|
+
beforeDestroy,
|
|
2491
|
+
beforeUnmount,
|
|
2492
|
+
destroyed,
|
|
2493
|
+
unmounted,
|
|
2494
|
+
render,
|
|
2495
|
+
renderTracked,
|
|
2496
|
+
renderTriggered,
|
|
2497
|
+
errorCaptured,
|
|
2498
|
+
serverPrefetch,
|
|
2499
|
+
// public API
|
|
2500
|
+
expose,
|
|
2501
|
+
inheritAttrs,
|
|
2502
|
+
// assets
|
|
2503
|
+
components,
|
|
2504
|
+
directives,
|
|
2505
|
+
filters
|
|
2506
|
+
} = options;
|
|
2507
|
+
const checkDuplicateProperties = null;
|
|
2508
|
+
if (injectOptions) {
|
|
2509
|
+
resolveInjections(injectOptions, ctx, checkDuplicateProperties);
|
|
2510
|
+
}
|
|
2511
|
+
if (methods) {
|
|
2512
|
+
for (const key in methods) {
|
|
2513
|
+
const methodHandler = methods[key];
|
|
2514
|
+
if (shared.isFunction(methodHandler)) {
|
|
2515
|
+
{
|
|
2516
|
+
ctx[key] = methodHandler.bind(publicThis);
|
|
2517
|
+
}
|
|
2518
|
+
}
|
|
2525
2519
|
}
|
|
2526
2520
|
}
|
|
2527
|
-
if (
|
|
2528
|
-
|
|
2529
|
-
|
|
2521
|
+
if (dataOptions) {
|
|
2522
|
+
const data = dataOptions.call(publicThis, publicThis);
|
|
2523
|
+
if (!shared.isObject(data)) ; else {
|
|
2524
|
+
instance.data = reactivity.reactive(data);
|
|
2530
2525
|
}
|
|
2531
|
-
return shared.EMPTY_ARR;
|
|
2532
2526
|
}
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2527
|
+
shouldCacheAccess = true;
|
|
2528
|
+
if (computedOptions) {
|
|
2529
|
+
for (const key in computedOptions) {
|
|
2530
|
+
const opt = computedOptions[key];
|
|
2531
|
+
const get = shared.isFunction(opt) ? opt.bind(publicThis, publicThis) : shared.isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : shared.NOOP;
|
|
2532
|
+
const set = !shared.isFunction(opt) && shared.isFunction(opt.set) ? opt.set.bind(publicThis) : shared.NOOP;
|
|
2533
|
+
const c = computed({
|
|
2534
|
+
get,
|
|
2535
|
+
set
|
|
2536
|
+
});
|
|
2537
|
+
Object.defineProperty(ctx, key, {
|
|
2538
|
+
enumerable: true,
|
|
2539
|
+
configurable: true,
|
|
2540
|
+
get: () => c.value,
|
|
2541
|
+
set: (v) => c.value = v
|
|
2542
|
+
});
|
|
2539
2543
|
}
|
|
2540
|
-
}
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
const opt = raw[key];
|
|
2545
|
-
const prop = normalized[normalizedKey] = shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : shared.extend({}, opt);
|
|
2546
|
-
if (prop) {
|
|
2547
|
-
const booleanIndex = getTypeIndex(Boolean, prop.type);
|
|
2548
|
-
const stringIndex = getTypeIndex(String, prop.type);
|
|
2549
|
-
prop[0 /* shouldCast */] = booleanIndex > -1;
|
|
2550
|
-
prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
|
|
2551
|
-
if (booleanIndex > -1 || shared.hasOwn(prop, "default")) {
|
|
2552
|
-
needCastKeys.push(normalizedKey);
|
|
2553
|
-
}
|
|
2554
|
-
}
|
|
2555
|
-
}
|
|
2544
|
+
}
|
|
2545
|
+
if (watchOptions) {
|
|
2546
|
+
for (const key in watchOptions) {
|
|
2547
|
+
createWatcher(watchOptions[key], ctx, publicThis, key);
|
|
2556
2548
|
}
|
|
2557
2549
|
}
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2550
|
+
if (provideOptions) {
|
|
2551
|
+
const provides = shared.isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
|
|
2552
|
+
Reflect.ownKeys(provides).forEach((key) => {
|
|
2553
|
+
provide(key, provides[key]);
|
|
2554
|
+
});
|
|
2561
2555
|
}
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
function validatePropName(key) {
|
|
2565
|
-
if (key[0] !== "$" && !shared.isReservedProp(key)) {
|
|
2566
|
-
return true;
|
|
2556
|
+
if (created) {
|
|
2557
|
+
callHook(created, instance, "c");
|
|
2567
2558
|
}
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2559
|
+
function registerLifecycleHook(register, hook) {
|
|
2560
|
+
if (shared.isArray(hook)) {
|
|
2561
|
+
hook.forEach((_hook) => register(_hook.bind(publicThis)));
|
|
2562
|
+
} else if (hook) {
|
|
2563
|
+
register(hook.bind(publicThis));
|
|
2564
|
+
}
|
|
2573
2565
|
}
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2566
|
+
registerLifecycleHook(onBeforeMount, beforeMount);
|
|
2567
|
+
registerLifecycleHook(onMounted, mounted);
|
|
2568
|
+
registerLifecycleHook(onBeforeUpdate, beforeUpdate);
|
|
2569
|
+
registerLifecycleHook(onUpdated, updated);
|
|
2570
|
+
registerLifecycleHook(onActivated, activated);
|
|
2571
|
+
registerLifecycleHook(onDeactivated, deactivated);
|
|
2572
|
+
registerLifecycleHook(onErrorCaptured, errorCaptured);
|
|
2573
|
+
registerLifecycleHook(onRenderTracked, renderTracked);
|
|
2574
|
+
registerLifecycleHook(onRenderTriggered, renderTriggered);
|
|
2575
|
+
registerLifecycleHook(onBeforeUnmount, beforeUnmount);
|
|
2576
|
+
registerLifecycleHook(onUnmounted, unmounted);
|
|
2577
|
+
registerLifecycleHook(onServerPrefetch, serverPrefetch);
|
|
2578
|
+
if (shared.isArray(expose)) {
|
|
2579
|
+
if (expose.length) {
|
|
2580
|
+
const exposed = instance.exposed || (instance.exposed = {});
|
|
2581
|
+
expose.forEach((key) => {
|
|
2582
|
+
Object.defineProperty(exposed, key, {
|
|
2583
|
+
get: () => publicThis[key],
|
|
2584
|
+
set: (val) => publicThis[key] = val
|
|
2585
|
+
});
|
|
2586
|
+
});
|
|
2587
|
+
} else if (!instance.exposed) {
|
|
2588
|
+
instance.exposed = {};
|
|
2589
|
+
}
|
|
2579
2590
|
}
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
function isSameType(a, b) {
|
|
2583
|
-
return getType(a) === getType(b);
|
|
2584
|
-
}
|
|
2585
|
-
function getTypeIndex(type, expectedTypes) {
|
|
2586
|
-
if (shared.isArray(expectedTypes)) {
|
|
2587
|
-
return expectedTypes.findIndex((t) => isSameType(t, type));
|
|
2588
|
-
} else if (shared.isFunction(expectedTypes)) {
|
|
2589
|
-
return isSameType(expectedTypes, type) ? 0 : -1;
|
|
2591
|
+
if (render && instance.render === shared.NOOP) {
|
|
2592
|
+
instance.render = render;
|
|
2590
2593
|
}
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
const isInternalKey = (key) => key[0] === "_" || key === "$stable";
|
|
2595
|
-
const normalizeSlotValue = (value) => shared.isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
|
|
2596
|
-
const normalizeSlot = (key, rawSlot, ctx) => {
|
|
2597
|
-
if (rawSlot._n) {
|
|
2598
|
-
return rawSlot;
|
|
2594
|
+
if (inheritAttrs != null) {
|
|
2595
|
+
instance.inheritAttrs = inheritAttrs;
|
|
2599
2596
|
}
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
normalized._c = false;
|
|
2605
|
-
return normalized;
|
|
2606
|
-
};
|
|
2607
|
-
const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
2608
|
-
const ctx = rawSlots._ctx;
|
|
2609
|
-
for (const key in rawSlots) {
|
|
2610
|
-
if (isInternalKey(key)) continue;
|
|
2611
|
-
const value = rawSlots[key];
|
|
2612
|
-
if (shared.isFunction(value)) {
|
|
2613
|
-
slots[key] = normalizeSlot(key, value, ctx);
|
|
2614
|
-
} else if (value != null) {
|
|
2615
|
-
const normalized = normalizeSlotValue(value);
|
|
2616
|
-
slots[key] = () => normalized;
|
|
2617
|
-
}
|
|
2597
|
+
if (components) instance.components = components;
|
|
2598
|
+
if (directives) instance.directives = directives;
|
|
2599
|
+
if (serverPrefetch) {
|
|
2600
|
+
markAsyncBoundary(instance);
|
|
2618
2601
|
}
|
|
2619
|
-
}
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
};
|
|
2624
|
-
const assignSlots = (slots, children, optimized) => {
|
|
2625
|
-
for (const key in children) {
|
|
2626
|
-
if (optimized || key !== "_") {
|
|
2627
|
-
slots[key] = children[key];
|
|
2628
|
-
}
|
|
2602
|
+
}
|
|
2603
|
+
function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared.NOOP) {
|
|
2604
|
+
if (shared.isArray(injectOptions)) {
|
|
2605
|
+
injectOptions = normalizeInject(injectOptions);
|
|
2629
2606
|
}
|
|
2630
|
-
|
|
2631
|
-
const
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2607
|
+
for (const key in injectOptions) {
|
|
2608
|
+
const opt = injectOptions[key];
|
|
2609
|
+
let injected;
|
|
2610
|
+
if (shared.isObject(opt)) {
|
|
2611
|
+
if ("default" in opt) {
|
|
2612
|
+
injected = inject(
|
|
2613
|
+
opt.from || key,
|
|
2614
|
+
opt.default,
|
|
2615
|
+
true
|
|
2616
|
+
);
|
|
2617
|
+
} else {
|
|
2618
|
+
injected = inject(opt.from || key);
|
|
2639
2619
|
}
|
|
2640
2620
|
} else {
|
|
2641
|
-
|
|
2621
|
+
injected = inject(opt);
|
|
2642
2622
|
}
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
let deletionComparisonTarget = shared.EMPTY_OBJ;
|
|
2651
|
-
if (vnode.shapeFlag & 32) {
|
|
2652
|
-
const type = children._;
|
|
2653
|
-
if (type) {
|
|
2654
|
-
if (optimized && type === 1) {
|
|
2655
|
-
needDeletionCheck = false;
|
|
2656
|
-
} else {
|
|
2657
|
-
assignSlots(slots, children, optimized);
|
|
2658
|
-
}
|
|
2623
|
+
if (reactivity.isRef(injected)) {
|
|
2624
|
+
Object.defineProperty(ctx, key, {
|
|
2625
|
+
enumerable: true,
|
|
2626
|
+
configurable: true,
|
|
2627
|
+
get: () => injected.value,
|
|
2628
|
+
set: (v) => injected.value = v
|
|
2629
|
+
});
|
|
2659
2630
|
} else {
|
|
2660
|
-
|
|
2661
|
-
normalizeObjectSlots(children, slots);
|
|
2631
|
+
ctx[key] = injected;
|
|
2662
2632
|
}
|
|
2663
|
-
deletionComparisonTarget = children;
|
|
2664
|
-
} else if (children) {
|
|
2665
|
-
normalizeVNodeSlots(instance, children);
|
|
2666
|
-
deletionComparisonTarget = { default: 1 };
|
|
2667
2633
|
}
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2634
|
+
}
|
|
2635
|
+
function callHook(hook, instance, type) {
|
|
2636
|
+
callWithAsyncErrorHandling(
|
|
2637
|
+
shared.isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
|
|
2638
|
+
instance,
|
|
2639
|
+
type
|
|
2640
|
+
);
|
|
2641
|
+
}
|
|
2642
|
+
function createWatcher(raw, ctx, publicThis, key) {
|
|
2643
|
+
const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
|
|
2644
|
+
if (shared.isString(raw)) {
|
|
2645
|
+
const handler = ctx[raw];
|
|
2646
|
+
if (shared.isFunction(handler)) {
|
|
2647
|
+
watch(getter, handler);
|
|
2648
|
+
}
|
|
2649
|
+
} else if (shared.isFunction(raw)) {
|
|
2650
|
+
watch(getter, raw.bind(publicThis));
|
|
2651
|
+
} else if (shared.isObject(raw)) {
|
|
2652
|
+
if (shared.isArray(raw)) {
|
|
2653
|
+
raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
2654
|
+
} else {
|
|
2655
|
+
const handler = shared.isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
2656
|
+
if (shared.isFunction(handler)) {
|
|
2657
|
+
watch(getter, handler, raw);
|
|
2672
2658
|
}
|
|
2673
2659
|
}
|
|
2660
|
+
} else ;
|
|
2661
|
+
}
|
|
2662
|
+
function resolveMergedOptions(instance) {
|
|
2663
|
+
const base = instance.type;
|
|
2664
|
+
const { mixins, extends: extendsOptions } = base;
|
|
2665
|
+
const {
|
|
2666
|
+
mixins: globalMixins,
|
|
2667
|
+
optionsCache: cache,
|
|
2668
|
+
config: { optionMergeStrategies }
|
|
2669
|
+
} = instance.appContext;
|
|
2670
|
+
const cached = cache.get(base);
|
|
2671
|
+
let resolved;
|
|
2672
|
+
if (cached) {
|
|
2673
|
+
resolved = cached;
|
|
2674
|
+
} else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
2675
|
+
{
|
|
2676
|
+
resolved = base;
|
|
2677
|
+
}
|
|
2678
|
+
} else {
|
|
2679
|
+
resolved = {};
|
|
2680
|
+
if (globalMixins.length) {
|
|
2681
|
+
globalMixins.forEach(
|
|
2682
|
+
(m) => mergeOptions(resolved, m, optionMergeStrategies, true)
|
|
2683
|
+
);
|
|
2684
|
+
}
|
|
2685
|
+
mergeOptions(resolved, base, optionMergeStrategies);
|
|
2674
2686
|
}
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
2678
|
-
if (shared.isArray(rawRef)) {
|
|
2679
|
-
rawRef.forEach(
|
|
2680
|
-
(r, i) => setRef(
|
|
2681
|
-
r,
|
|
2682
|
-
oldRawRef && (shared.isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
|
|
2683
|
-
parentSuspense,
|
|
2684
|
-
vnode,
|
|
2685
|
-
isUnmount
|
|
2686
|
-
)
|
|
2687
|
-
);
|
|
2688
|
-
return;
|
|
2687
|
+
if (shared.isObject(base)) {
|
|
2688
|
+
cache.set(base, resolved);
|
|
2689
2689
|
}
|
|
2690
|
-
|
|
2691
|
-
|
|
2690
|
+
return resolved;
|
|
2691
|
+
}
|
|
2692
|
+
function mergeOptions(to, from, strats, asMixin = false) {
|
|
2693
|
+
const { mixins, extends: extendsOptions } = from;
|
|
2694
|
+
if (extendsOptions) {
|
|
2695
|
+
mergeOptions(to, extendsOptions, strats, true);
|
|
2692
2696
|
}
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
const refs = owner.refs === shared.EMPTY_OBJ ? owner.refs = {} : owner.refs;
|
|
2698
|
-
const setupState = owner.setupState;
|
|
2699
|
-
if (oldRef != null && oldRef !== ref) {
|
|
2700
|
-
if (shared.isString(oldRef)) {
|
|
2701
|
-
refs[oldRef] = null;
|
|
2702
|
-
if (shared.hasOwn(setupState, oldRef)) {
|
|
2703
|
-
setupState[oldRef] = null;
|
|
2704
|
-
}
|
|
2705
|
-
} else if (reactivity.isRef(oldRef)) {
|
|
2706
|
-
oldRef.value = null;
|
|
2707
|
-
}
|
|
2697
|
+
if (mixins) {
|
|
2698
|
+
mixins.forEach(
|
|
2699
|
+
(m) => mergeOptions(to, m, strats, true)
|
|
2700
|
+
);
|
|
2708
2701
|
}
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
const _isRef = reactivity.isRef(ref);
|
|
2714
|
-
if (_isString || _isRef) {
|
|
2715
|
-
const doSet = () => {
|
|
2716
|
-
if (rawRef.f) {
|
|
2717
|
-
const existing = _isString ? shared.hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
|
|
2718
|
-
if (isUnmount) {
|
|
2719
|
-
shared.isArray(existing) && shared.remove(existing, refValue);
|
|
2720
|
-
} else {
|
|
2721
|
-
if (!shared.isArray(existing)) {
|
|
2722
|
-
if (_isString) {
|
|
2723
|
-
refs[ref] = [refValue];
|
|
2724
|
-
if (shared.hasOwn(setupState, ref)) {
|
|
2725
|
-
setupState[ref] = refs[ref];
|
|
2726
|
-
}
|
|
2727
|
-
} else {
|
|
2728
|
-
ref.value = [refValue];
|
|
2729
|
-
if (rawRef.k) refs[rawRef.k] = ref.value;
|
|
2730
|
-
}
|
|
2731
|
-
} else if (!existing.includes(refValue)) {
|
|
2732
|
-
existing.push(refValue);
|
|
2733
|
-
}
|
|
2734
|
-
}
|
|
2735
|
-
} else if (_isString) {
|
|
2736
|
-
refs[ref] = value;
|
|
2737
|
-
if (shared.hasOwn(setupState, ref)) {
|
|
2738
|
-
setupState[ref] = value;
|
|
2739
|
-
}
|
|
2740
|
-
} else if (_isRef) {
|
|
2741
|
-
ref.value = value;
|
|
2742
|
-
if (rawRef.k) refs[rawRef.k] = value;
|
|
2743
|
-
} else ;
|
|
2744
|
-
};
|
|
2745
|
-
if (value) {
|
|
2746
|
-
doSet.id = -1;
|
|
2747
|
-
queuePostRenderEffect(doSet, parentSuspense);
|
|
2748
|
-
} else {
|
|
2749
|
-
doSet();
|
|
2750
|
-
}
|
|
2702
|
+
for (const key in from) {
|
|
2703
|
+
if (asMixin && key === "expose") ; else {
|
|
2704
|
+
const strat = internalOptionMergeStrats[key] || strats && strats[key];
|
|
2705
|
+
to[key] = strat ? strat(to[key], from[key]) : from[key];
|
|
2751
2706
|
}
|
|
2752
2707
|
}
|
|
2708
|
+
return to;
|
|
2753
2709
|
}
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2710
|
+
const internalOptionMergeStrats = {
|
|
2711
|
+
data: mergeDataFn,
|
|
2712
|
+
props: mergeEmitsOrPropsOptions,
|
|
2713
|
+
emits: mergeEmitsOrPropsOptions,
|
|
2714
|
+
// objects
|
|
2715
|
+
methods: mergeObjectOptions,
|
|
2716
|
+
computed: mergeObjectOptions,
|
|
2717
|
+
// lifecycle
|
|
2718
|
+
beforeCreate: mergeAsArray,
|
|
2719
|
+
created: mergeAsArray,
|
|
2720
|
+
beforeMount: mergeAsArray,
|
|
2721
|
+
mounted: mergeAsArray,
|
|
2722
|
+
beforeUpdate: mergeAsArray,
|
|
2723
|
+
updated: mergeAsArray,
|
|
2724
|
+
beforeDestroy: mergeAsArray,
|
|
2725
|
+
beforeUnmount: mergeAsArray,
|
|
2726
|
+
destroyed: mergeAsArray,
|
|
2727
|
+
unmounted: mergeAsArray,
|
|
2728
|
+
activated: mergeAsArray,
|
|
2729
|
+
deactivated: mergeAsArray,
|
|
2730
|
+
errorCaptured: mergeAsArray,
|
|
2731
|
+
serverPrefetch: mergeAsArray,
|
|
2732
|
+
// assets
|
|
2733
|
+
components: mergeObjectOptions,
|
|
2734
|
+
directives: mergeObjectOptions,
|
|
2735
|
+
// watch
|
|
2736
|
+
watch: mergeWatchOptions,
|
|
2737
|
+
// provide / inject
|
|
2738
|
+
provide: mergeDataFn,
|
|
2739
|
+
inject: mergeInject
|
|
2769
2740
|
};
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2741
|
+
function mergeDataFn(to, from) {
|
|
2742
|
+
if (!from) {
|
|
2743
|
+
return to;
|
|
2744
|
+
}
|
|
2745
|
+
if (!to) {
|
|
2746
|
+
return from;
|
|
2747
|
+
}
|
|
2748
|
+
return function mergedDataFn() {
|
|
2749
|
+
return (shared.extend)(
|
|
2750
|
+
shared.isFunction(to) ? to.call(this, this) : to,
|
|
2751
|
+
shared.isFunction(from) ? from.call(this, this) : from
|
|
2752
|
+
);
|
|
2753
|
+
};
|
|
2754
|
+
}
|
|
2755
|
+
function mergeInject(to, from) {
|
|
2756
|
+
return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
|
|
2757
|
+
}
|
|
2758
|
+
function normalizeInject(raw) {
|
|
2759
|
+
if (shared.isArray(raw)) {
|
|
2760
|
+
const res = {};
|
|
2761
|
+
for (let i = 0; i < raw.length; i++) {
|
|
2762
|
+
res[raw[i]] = raw[i];
|
|
2783
2763
|
}
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2764
|
+
return res;
|
|
2765
|
+
}
|
|
2766
|
+
return raw;
|
|
2767
|
+
}
|
|
2768
|
+
function mergeAsArray(to, from) {
|
|
2769
|
+
return to ? [...new Set([].concat(to, from))] : from;
|
|
2770
|
+
}
|
|
2771
|
+
function mergeObjectOptions(to, from) {
|
|
2772
|
+
return to ? shared.extend(/* @__PURE__ */ Object.create(null), to, from) : from;
|
|
2773
|
+
}
|
|
2774
|
+
function mergeEmitsOrPropsOptions(to, from) {
|
|
2775
|
+
if (to) {
|
|
2776
|
+
if (shared.isArray(to) && shared.isArray(from)) {
|
|
2777
|
+
return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
2791
2778
|
}
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
2797
|
-
optimized = optimized || !!vnode.dynamicChildren;
|
|
2798
|
-
const isFragmentStart = isComment(node) && node.data === "[";
|
|
2799
|
-
const onMismatch = () => handleMismatch(
|
|
2800
|
-
node,
|
|
2801
|
-
vnode,
|
|
2802
|
-
parentComponent,
|
|
2803
|
-
parentSuspense,
|
|
2804
|
-
slotScopeIds,
|
|
2805
|
-
isFragmentStart
|
|
2779
|
+
return shared.extend(
|
|
2780
|
+
/* @__PURE__ */ Object.create(null),
|
|
2781
|
+
normalizePropsOrEmits(to),
|
|
2782
|
+
normalizePropsOrEmits(from != null ? from : {})
|
|
2806
2783
|
);
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2784
|
+
} else {
|
|
2785
|
+
return from;
|
|
2786
|
+
}
|
|
2787
|
+
}
|
|
2788
|
+
function mergeWatchOptions(to, from) {
|
|
2789
|
+
if (!to) return from;
|
|
2790
|
+
if (!from) return to;
|
|
2791
|
+
const merged = shared.extend(/* @__PURE__ */ Object.create(null), to);
|
|
2792
|
+
for (const key in from) {
|
|
2793
|
+
merged[key] = mergeAsArray(to[key], from[key]);
|
|
2794
|
+
}
|
|
2795
|
+
return merged;
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2798
|
+
function createAppContext() {
|
|
2799
|
+
return {
|
|
2800
|
+
app: null,
|
|
2801
|
+
config: {
|
|
2802
|
+
isNativeTag: shared.NO,
|
|
2803
|
+
performance: false,
|
|
2804
|
+
globalProperties: {},
|
|
2805
|
+
optionMergeStrategies: {},
|
|
2806
|
+
errorHandler: void 0,
|
|
2807
|
+
warnHandler: void 0,
|
|
2808
|
+
compilerOptions: {}
|
|
2809
|
+
},
|
|
2810
|
+
mixins: [],
|
|
2811
|
+
components: {},
|
|
2812
|
+
directives: {},
|
|
2813
|
+
provides: /* @__PURE__ */ Object.create(null),
|
|
2814
|
+
optionsCache: /* @__PURE__ */ new WeakMap(),
|
|
2815
|
+
propsCache: /* @__PURE__ */ new WeakMap(),
|
|
2816
|
+
emitsCache: /* @__PURE__ */ new WeakMap()
|
|
2817
|
+
};
|
|
2818
|
+
}
|
|
2819
|
+
let uid$1 = 0;
|
|
2820
|
+
function createAppAPI(render, hydrate) {
|
|
2821
|
+
return function createApp(rootComponent, rootProps = null) {
|
|
2822
|
+
if (!shared.isFunction(rootComponent)) {
|
|
2823
|
+
rootComponent = shared.extend({}, rootComponent);
|
|
2813
2824
|
}
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2825
|
+
if (rootProps != null && !shared.isObject(rootProps)) {
|
|
2826
|
+
rootProps = null;
|
|
2827
|
+
}
|
|
2828
|
+
const context = createAppContext();
|
|
2829
|
+
const installedPlugins = /* @__PURE__ */ new WeakSet();
|
|
2830
|
+
const pluginCleanupFns = [];
|
|
2831
|
+
let isMounted = false;
|
|
2832
|
+
const app = context.app = {
|
|
2833
|
+
_uid: uid$1++,
|
|
2834
|
+
_component: rootComponent,
|
|
2835
|
+
_props: rootProps,
|
|
2836
|
+
_container: null,
|
|
2837
|
+
_context: context,
|
|
2838
|
+
_instance: null,
|
|
2839
|
+
version,
|
|
2840
|
+
get config() {
|
|
2841
|
+
return context.config;
|
|
2842
|
+
},
|
|
2843
|
+
set config(v) {
|
|
2844
|
+
},
|
|
2845
|
+
use(plugin, ...options) {
|
|
2846
|
+
if (installedPlugins.has(plugin)) ; else if (plugin && shared.isFunction(plugin.install)) {
|
|
2847
|
+
installedPlugins.add(plugin);
|
|
2848
|
+
plugin.install(app, ...options);
|
|
2849
|
+
} else if (shared.isFunction(plugin)) {
|
|
2850
|
+
installedPlugins.add(plugin);
|
|
2851
|
+
plugin(app, ...options);
|
|
2852
|
+
} else ;
|
|
2853
|
+
return app;
|
|
2854
|
+
},
|
|
2855
|
+
mixin(mixin) {
|
|
2856
|
+
{
|
|
2857
|
+
if (!context.mixins.includes(mixin)) {
|
|
2858
|
+
context.mixins.push(mixin);
|
|
2828
2859
|
}
|
|
2829
|
-
nextNode = nextSibling(node);
|
|
2830
|
-
}
|
|
2831
|
-
break;
|
|
2832
|
-
case Comment:
|
|
2833
|
-
if (isTemplateNode(node)) {
|
|
2834
|
-
nextNode = nextSibling(node);
|
|
2835
|
-
replaceNode(
|
|
2836
|
-
vnode.el = node.content.firstChild,
|
|
2837
|
-
node,
|
|
2838
|
-
parentComponent
|
|
2839
|
-
);
|
|
2840
|
-
} else if (domType !== 8 /* COMMENT */ || isFragmentStart) {
|
|
2841
|
-
nextNode = onMismatch();
|
|
2842
|
-
} else {
|
|
2843
|
-
nextNode = nextSibling(node);
|
|
2844
|
-
}
|
|
2845
|
-
break;
|
|
2846
|
-
case Static:
|
|
2847
|
-
if (isFragmentStart) {
|
|
2848
|
-
node = nextSibling(node);
|
|
2849
|
-
domType = node.nodeType;
|
|
2850
2860
|
}
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
vnode.children += nextNode.nodeType === 1 /* ELEMENT */ ? nextNode.outerHTML : nextNode.data;
|
|
2857
|
-
if (i === vnode.staticCount - 1) {
|
|
2858
|
-
vnode.anchor = nextNode;
|
|
2859
|
-
}
|
|
2860
|
-
nextNode = nextSibling(nextNode);
|
|
2861
|
-
}
|
|
2862
|
-
return isFragmentStart ? nextSibling(nextNode) : nextNode;
|
|
2863
|
-
} else {
|
|
2864
|
-
onMismatch();
|
|
2861
|
+
return app;
|
|
2862
|
+
},
|
|
2863
|
+
component(name, component) {
|
|
2864
|
+
if (!component) {
|
|
2865
|
+
return context.components[name];
|
|
2865
2866
|
}
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
node,
|
|
2873
|
-
vnode,
|
|
2874
|
-
parentComponent,
|
|
2875
|
-
parentSuspense,
|
|
2876
|
-
slotScopeIds,
|
|
2877
|
-
optimized
|
|
2878
|
-
);
|
|
2867
|
+
context.components[name] = component;
|
|
2868
|
+
return app;
|
|
2869
|
+
},
|
|
2870
|
+
directive(name, directive) {
|
|
2871
|
+
if (!directive) {
|
|
2872
|
+
return context.directives[name];
|
|
2879
2873
|
}
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
slotScopeIds,
|
|
2892
|
-
optimized
|
|
2893
|
-
);
|
|
2874
|
+
context.directives[name] = directive;
|
|
2875
|
+
return app;
|
|
2876
|
+
},
|
|
2877
|
+
mount(rootContainer, isHydrate, namespace) {
|
|
2878
|
+
if (!isMounted) {
|
|
2879
|
+
const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
|
|
2880
|
+
vnode.appContext = context;
|
|
2881
|
+
if (namespace === true) {
|
|
2882
|
+
namespace = "svg";
|
|
2883
|
+
} else if (namespace === false) {
|
|
2884
|
+
namespace = void 0;
|
|
2894
2885
|
}
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
const container = parentNode(node);
|
|
2898
|
-
if (isFragmentStart) {
|
|
2899
|
-
nextNode = locateClosingAnchor(node);
|
|
2900
|
-
} else if (isComment(node) && node.data === "teleport start") {
|
|
2901
|
-
nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
2886
|
+
if (isHydrate && hydrate) {
|
|
2887
|
+
hydrate(vnode, rootContainer);
|
|
2902
2888
|
} else {
|
|
2903
|
-
|
|
2889
|
+
render(vnode, rootContainer, namespace);
|
|
2904
2890
|
}
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2891
|
+
isMounted = true;
|
|
2892
|
+
app._container = rootContainer;
|
|
2893
|
+
rootContainer.__vue_app__ = app;
|
|
2894
|
+
return getComponentPublicInstance(vnode.component);
|
|
2895
|
+
}
|
|
2896
|
+
},
|
|
2897
|
+
onUnmount(cleanupFn) {
|
|
2898
|
+
pluginCleanupFns.push(cleanupFn);
|
|
2899
|
+
},
|
|
2900
|
+
unmount() {
|
|
2901
|
+
if (isMounted) {
|
|
2902
|
+
callWithAsyncErrorHandling(
|
|
2903
|
+
pluginCleanupFns,
|
|
2904
|
+
app._instance,
|
|
2905
|
+
16
|
|
2913
2906
|
);
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2907
|
+
render(null, app._container);
|
|
2908
|
+
delete app._container.__vue_app__;
|
|
2909
|
+
}
|
|
2910
|
+
},
|
|
2911
|
+
provide(key, value) {
|
|
2912
|
+
context.provides[key] = value;
|
|
2913
|
+
return app;
|
|
2914
|
+
},
|
|
2915
|
+
runWithContext(fn) {
|
|
2916
|
+
const lastApp = currentApp;
|
|
2917
|
+
currentApp = app;
|
|
2918
|
+
try {
|
|
2919
|
+
return fn();
|
|
2920
|
+
} finally {
|
|
2921
|
+
currentApp = lastApp;
|
|
2922
|
+
}
|
|
2923
|
+
}
|
|
2924
|
+
};
|
|
2925
|
+
return app;
|
|
2926
|
+
};
|
|
2927
|
+
}
|
|
2928
|
+
let currentApp = null;
|
|
2929
|
+
|
|
2930
|
+
function provide(key, value) {
|
|
2931
|
+
if (!currentInstance) ; else {
|
|
2932
|
+
let provides = currentInstance.provides;
|
|
2933
|
+
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
2934
|
+
if (parentProvides === provides) {
|
|
2935
|
+
provides = currentInstance.provides = Object.create(parentProvides);
|
|
2936
|
+
}
|
|
2937
|
+
provides[key] = value;
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2940
|
+
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
2941
|
+
const instance = currentInstance || currentRenderingInstance;
|
|
2942
|
+
if (instance || currentApp) {
|
|
2943
|
+
const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
|
|
2944
|
+
if (provides && key in provides) {
|
|
2945
|
+
return provides[key];
|
|
2946
|
+
} else if (arguments.length > 1) {
|
|
2947
|
+
return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
2948
|
+
} else ;
|
|
2949
|
+
}
|
|
2950
|
+
}
|
|
2951
|
+
function hasInjectionContext() {
|
|
2952
|
+
return !!(currentInstance || currentRenderingInstance || currentApp);
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
const internalObjectProto = {};
|
|
2956
|
+
const createInternalObject = () => Object.create(internalObjectProto);
|
|
2957
|
+
const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
|
|
2958
|
+
|
|
2959
|
+
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
2960
|
+
const props = {};
|
|
2961
|
+
const attrs = createInternalObject();
|
|
2962
|
+
instance.propsDefaults = /* @__PURE__ */ Object.create(null);
|
|
2963
|
+
setFullProps(instance, rawProps, props, attrs);
|
|
2964
|
+
for (const key in instance.propsOptions[0]) {
|
|
2965
|
+
if (!(key in props)) {
|
|
2966
|
+
props[key] = void 0;
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
|
+
if (isStateful) {
|
|
2970
|
+
instance.props = isSSR ? props : reactivity.shallowReactive(props);
|
|
2971
|
+
} else {
|
|
2972
|
+
if (!instance.type.props) {
|
|
2973
|
+
instance.props = attrs;
|
|
2974
|
+
} else {
|
|
2975
|
+
instance.props = props;
|
|
2976
|
+
}
|
|
2977
|
+
}
|
|
2978
|
+
instance.attrs = attrs;
|
|
2979
|
+
}
|
|
2980
|
+
function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
2981
|
+
const {
|
|
2982
|
+
props,
|
|
2983
|
+
attrs,
|
|
2984
|
+
vnode: { patchFlag }
|
|
2985
|
+
} = instance;
|
|
2986
|
+
const rawCurrentProps = reactivity.toRaw(props);
|
|
2987
|
+
const [options] = instance.propsOptions;
|
|
2988
|
+
let hasAttrsChanged = false;
|
|
2989
|
+
if (
|
|
2990
|
+
// always force full diff in dev
|
|
2991
|
+
// - #1942 if hmr is enabled with sfc component
|
|
2992
|
+
// - vite#872 non-sfc component used by sfc component
|
|
2993
|
+
(optimized || patchFlag > 0) && !(patchFlag & 16)
|
|
2994
|
+
) {
|
|
2995
|
+
if (patchFlag & 8) {
|
|
2996
|
+
const propsToUpdate = instance.vnode.dynamicProps;
|
|
2997
|
+
for (let i = 0; i < propsToUpdate.length; i++) {
|
|
2998
|
+
let key = propsToUpdate[i];
|
|
2999
|
+
if (isEmitListener(instance.emitsOptions, key)) {
|
|
3000
|
+
continue;
|
|
3001
|
+
}
|
|
3002
|
+
const value = rawProps[key];
|
|
3003
|
+
if (options) {
|
|
3004
|
+
if (shared.hasOwn(attrs, key)) {
|
|
3005
|
+
if (value !== attrs[key]) {
|
|
3006
|
+
attrs[key] = value;
|
|
3007
|
+
hasAttrsChanged = true;
|
|
2921
3008
|
}
|
|
2922
|
-
subTree.el = node;
|
|
2923
|
-
vnode.component.subTree = subTree;
|
|
2924
|
-
}
|
|
2925
|
-
} else if (shapeFlag & 64) {
|
|
2926
|
-
if (domType !== 8 /* COMMENT */) {
|
|
2927
|
-
nextNode = onMismatch();
|
|
2928
3009
|
} else {
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
hydrateChildren
|
|
3010
|
+
const camelizedKey = shared.camelize(key);
|
|
3011
|
+
props[camelizedKey] = resolvePropValue(
|
|
3012
|
+
options,
|
|
3013
|
+
rawCurrentProps,
|
|
3014
|
+
camelizedKey,
|
|
3015
|
+
value,
|
|
3016
|
+
instance,
|
|
3017
|
+
false
|
|
2938
3018
|
);
|
|
2939
3019
|
}
|
|
2940
|
-
} else
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
parentSuspense,
|
|
2946
|
-
getContainerType(parentNode(node)),
|
|
2947
|
-
slotScopeIds,
|
|
2948
|
-
optimized,
|
|
2949
|
-
rendererInternals,
|
|
2950
|
-
hydrateNode
|
|
2951
|
-
);
|
|
2952
|
-
} else ;
|
|
2953
|
-
}
|
|
2954
|
-
if (ref != null) {
|
|
2955
|
-
setRef(ref, null, parentSuspense, vnode);
|
|
2956
|
-
}
|
|
2957
|
-
return nextNode;
|
|
2958
|
-
};
|
|
2959
|
-
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
2960
|
-
optimized = optimized || !!vnode.dynamicChildren;
|
|
2961
|
-
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
2962
|
-
const forcePatch = type === "input" || type === "option";
|
|
2963
|
-
if (forcePatch || patchFlag !== -1) {
|
|
2964
|
-
if (dirs) {
|
|
2965
|
-
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
2966
|
-
}
|
|
2967
|
-
let needCallTransitionHooks = false;
|
|
2968
|
-
if (isTemplateNode(el)) {
|
|
2969
|
-
needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
2970
|
-
const content = el.content.firstChild;
|
|
2971
|
-
if (needCallTransitionHooks) {
|
|
2972
|
-
transition.beforeEnter(content);
|
|
2973
|
-
}
|
|
2974
|
-
replaceNode(content, el, parentComponent);
|
|
2975
|
-
vnode.el = el = content;
|
|
2976
|
-
}
|
|
2977
|
-
if (shapeFlag & 16 && // skip if element has innerHTML / textContent
|
|
2978
|
-
!(props && (props.innerHTML || props.textContent))) {
|
|
2979
|
-
let next = hydrateChildren(
|
|
2980
|
-
el.firstChild,
|
|
2981
|
-
vnode,
|
|
2982
|
-
el,
|
|
2983
|
-
parentComponent,
|
|
2984
|
-
parentSuspense,
|
|
2985
|
-
slotScopeIds,
|
|
2986
|
-
optimized
|
|
2987
|
-
);
|
|
2988
|
-
while (next) {
|
|
2989
|
-
logMismatchError();
|
|
2990
|
-
const cur = next;
|
|
2991
|
-
next = next.nextSibling;
|
|
2992
|
-
remove(cur);
|
|
2993
|
-
}
|
|
2994
|
-
} else if (shapeFlag & 8) {
|
|
2995
|
-
if (el.textContent !== vnode.children) {
|
|
2996
|
-
logMismatchError();
|
|
2997
|
-
el.textContent = vnode.children;
|
|
3020
|
+
} else {
|
|
3021
|
+
if (value !== attrs[key]) {
|
|
3022
|
+
attrs[key] = value;
|
|
3023
|
+
hasAttrsChanged = true;
|
|
3024
|
+
}
|
|
2998
3025
|
}
|
|
2999
3026
|
}
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3027
|
+
}
|
|
3028
|
+
} else {
|
|
3029
|
+
if (setFullProps(instance, rawProps, props, attrs)) {
|
|
3030
|
+
hasAttrsChanged = true;
|
|
3031
|
+
}
|
|
3032
|
+
let kebabKey;
|
|
3033
|
+
for (const key in rawCurrentProps) {
|
|
3034
|
+
if (!rawProps || // for camelCase
|
|
3035
|
+
!shared.hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
|
|
3036
|
+
// and converted to camelCase (#955)
|
|
3037
|
+
((kebabKey = shared.hyphenate(key)) === key || !shared.hasOwn(rawProps, kebabKey))) {
|
|
3038
|
+
if (options) {
|
|
3039
|
+
if (rawPrevProps && // for camelCase
|
|
3040
|
+
(rawPrevProps[key] !== void 0 || // for kebab-case
|
|
3041
|
+
rawPrevProps[kebabKey] !== void 0)) {
|
|
3042
|
+
props[key] = resolvePropValue(
|
|
3043
|
+
options,
|
|
3044
|
+
rawCurrentProps,
|
|
3045
|
+
key,
|
|
3046
|
+
void 0,
|
|
3047
|
+
instance,
|
|
3048
|
+
true
|
|
3049
|
+
);
|
|
3007
3050
|
}
|
|
3008
|
-
} else
|
|
3009
|
-
|
|
3010
|
-
el,
|
|
3011
|
-
"onClick",
|
|
3012
|
-
null,
|
|
3013
|
-
props.onClick,
|
|
3014
|
-
void 0,
|
|
3015
|
-
parentComponent
|
|
3016
|
-
);
|
|
3017
|
-
} else if (patchFlag & 4 && reactivity.isReactive(props.style)) {
|
|
3018
|
-
for (const key in props.style) props.style[key];
|
|
3051
|
+
} else {
|
|
3052
|
+
delete props[key];
|
|
3019
3053
|
}
|
|
3020
3054
|
}
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3055
|
+
}
|
|
3056
|
+
if (attrs !== rawCurrentProps) {
|
|
3057
|
+
for (const key in attrs) {
|
|
3058
|
+
if (!rawProps || !shared.hasOwn(rawProps, key) && true) {
|
|
3059
|
+
delete attrs[key];
|
|
3060
|
+
hasAttrsChanged = true;
|
|
3061
|
+
}
|
|
3024
3062
|
}
|
|
3025
|
-
|
|
3026
|
-
|
|
3063
|
+
}
|
|
3064
|
+
}
|
|
3065
|
+
if (hasAttrsChanged) {
|
|
3066
|
+
reactivity.trigger(instance.attrs, "set", "");
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
function setFullProps(instance, rawProps, props, attrs) {
|
|
3070
|
+
const [options, needCastKeys] = instance.propsOptions;
|
|
3071
|
+
let hasAttrsChanged = false;
|
|
3072
|
+
let rawCastValues;
|
|
3073
|
+
if (rawProps) {
|
|
3074
|
+
for (let key in rawProps) {
|
|
3075
|
+
if (shared.isReservedProp(key)) {
|
|
3076
|
+
continue;
|
|
3027
3077
|
}
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
}
|
|
3078
|
+
const value = rawProps[key];
|
|
3079
|
+
let camelKey;
|
|
3080
|
+
if (options && shared.hasOwn(options, camelKey = shared.camelize(key))) {
|
|
3081
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) {
|
|
3082
|
+
props[camelKey] = value;
|
|
3083
|
+
} else {
|
|
3084
|
+
(rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
3085
|
+
}
|
|
3086
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
3087
|
+
if (!(key in attrs) || value !== attrs[key]) {
|
|
3088
|
+
attrs[key] = value;
|
|
3089
|
+
hasAttrsChanged = true;
|
|
3090
|
+
}
|
|
3034
3091
|
}
|
|
3035
3092
|
}
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3093
|
+
}
|
|
3094
|
+
if (needCastKeys) {
|
|
3095
|
+
const rawCurrentProps = reactivity.toRaw(props);
|
|
3096
|
+
const castValues = rawCastValues || shared.EMPTY_OBJ;
|
|
3097
|
+
for (let i = 0; i < needCastKeys.length; i++) {
|
|
3098
|
+
const key = needCastKeys[i];
|
|
3099
|
+
props[key] = resolvePropValue(
|
|
3100
|
+
options,
|
|
3101
|
+
rawCurrentProps,
|
|
3102
|
+
key,
|
|
3103
|
+
castValues[key],
|
|
3104
|
+
instance,
|
|
3105
|
+
!shared.hasOwn(castValues, key)
|
|
3106
|
+
);
|
|
3107
|
+
}
|
|
3108
|
+
}
|
|
3109
|
+
return hasAttrsChanged;
|
|
3110
|
+
}
|
|
3111
|
+
function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
3112
|
+
const opt = options[key];
|
|
3113
|
+
if (opt != null) {
|
|
3114
|
+
const hasDefault = shared.hasOwn(opt, "default");
|
|
3115
|
+
if (hasDefault && value === void 0) {
|
|
3116
|
+
const defaultValue = opt.default;
|
|
3117
|
+
if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) {
|
|
3118
|
+
const { propsDefaults } = instance;
|
|
3119
|
+
if (key in propsDefaults) {
|
|
3120
|
+
value = propsDefaults[key];
|
|
3121
|
+
} else {
|
|
3122
|
+
const reset = setCurrentInstance(instance);
|
|
3123
|
+
value = propsDefaults[key] = defaultValue.call(
|
|
3124
|
+
null,
|
|
3125
|
+
props
|
|
3126
|
+
);
|
|
3127
|
+
reset();
|
|
3128
|
+
}
|
|
3069
3129
|
} else {
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
container,
|
|
3075
|
-
null,
|
|
3076
|
-
parentComponent,
|
|
3077
|
-
parentSuspense,
|
|
3078
|
-
getContainerType(container),
|
|
3079
|
-
slotScopeIds
|
|
3080
|
-
);
|
|
3130
|
+
value = defaultValue;
|
|
3131
|
+
}
|
|
3132
|
+
if (instance.ce) {
|
|
3133
|
+
instance.ce._setProp(key, value);
|
|
3081
3134
|
}
|
|
3082
3135
|
}
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3136
|
+
if (opt[0 /* shouldCast */]) {
|
|
3137
|
+
if (isAbsent && !hasDefault) {
|
|
3138
|
+
value = false;
|
|
3139
|
+
} else if (opt[1 /* shouldCastTrue */] && (value === "" || value === shared.hyphenate(key))) {
|
|
3140
|
+
value = true;
|
|
3141
|
+
}
|
|
3089
3142
|
}
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3143
|
+
}
|
|
3144
|
+
return value;
|
|
3145
|
+
}
|
|
3146
|
+
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
3147
|
+
function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
3148
|
+
const cache = asMixin ? mixinPropsCache : appContext.propsCache;
|
|
3149
|
+
const cached = cache.get(comp);
|
|
3150
|
+
if (cached) {
|
|
3151
|
+
return cached;
|
|
3152
|
+
}
|
|
3153
|
+
const raw = comp.props;
|
|
3154
|
+
const normalized = {};
|
|
3155
|
+
const needCastKeys = [];
|
|
3156
|
+
let hasExtends = false;
|
|
3157
|
+
if (!shared.isFunction(comp)) {
|
|
3158
|
+
const extendProps = (raw2) => {
|
|
3159
|
+
hasExtends = true;
|
|
3160
|
+
const [props, keys] = normalizePropsOptions(raw2, appContext, true);
|
|
3161
|
+
shared.extend(normalized, props);
|
|
3162
|
+
if (keys) needCastKeys.push(...keys);
|
|
3163
|
+
};
|
|
3164
|
+
if (!asMixin && appContext.mixins.length) {
|
|
3165
|
+
appContext.mixins.forEach(extendProps);
|
|
3106
3166
|
}
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3167
|
+
if (comp.extends) {
|
|
3168
|
+
extendProps(comp.extends);
|
|
3169
|
+
}
|
|
3170
|
+
if (comp.mixins) {
|
|
3171
|
+
comp.mixins.forEach(extendProps);
|
|
3172
|
+
}
|
|
3173
|
+
}
|
|
3174
|
+
if (!raw && !hasExtends) {
|
|
3175
|
+
if (shared.isObject(comp)) {
|
|
3176
|
+
cache.set(comp, shared.EMPTY_ARR);
|
|
3177
|
+
}
|
|
3178
|
+
return shared.EMPTY_ARR;
|
|
3179
|
+
}
|
|
3180
|
+
if (shared.isArray(raw)) {
|
|
3181
|
+
for (let i = 0; i < raw.length; i++) {
|
|
3182
|
+
const normalizedKey = shared.camelize(raw[i]);
|
|
3183
|
+
if (validatePropName(normalizedKey)) {
|
|
3184
|
+
normalized[normalizedKey] = shared.EMPTY_OBJ;
|
|
3120
3185
|
}
|
|
3121
3186
|
}
|
|
3122
|
-
|
|
3123
|
-
const
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
if (node && isComment(node)) {
|
|
3142
|
-
if (node.data === open) match++;
|
|
3143
|
-
if (node.data === close) {
|
|
3144
|
-
if (match === 0) {
|
|
3145
|
-
return nextSibling(node);
|
|
3146
|
-
} else {
|
|
3147
|
-
match--;
|
|
3187
|
+
} else if (raw) {
|
|
3188
|
+
for (const key in raw) {
|
|
3189
|
+
const normalizedKey = shared.camelize(key);
|
|
3190
|
+
if (validatePropName(normalizedKey)) {
|
|
3191
|
+
const opt = raw[key];
|
|
3192
|
+
const prop = normalized[normalizedKey] = shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : shared.extend({}, opt);
|
|
3193
|
+
const propType = prop.type;
|
|
3194
|
+
let shouldCast = false;
|
|
3195
|
+
let shouldCastTrue = true;
|
|
3196
|
+
if (shared.isArray(propType)) {
|
|
3197
|
+
for (let index = 0; index < propType.length; ++index) {
|
|
3198
|
+
const type = propType[index];
|
|
3199
|
+
const typeName = shared.isFunction(type) && type.name;
|
|
3200
|
+
if (typeName === "Boolean") {
|
|
3201
|
+
shouldCast = true;
|
|
3202
|
+
break;
|
|
3203
|
+
} else if (typeName === "String") {
|
|
3204
|
+
shouldCastTrue = false;
|
|
3205
|
+
}
|
|
3148
3206
|
}
|
|
3207
|
+
} else {
|
|
3208
|
+
shouldCast = shared.isFunction(propType) && propType.name === "Boolean";
|
|
3209
|
+
}
|
|
3210
|
+
prop[0 /* shouldCast */] = shouldCast;
|
|
3211
|
+
prop[1 /* shouldCastTrue */] = shouldCastTrue;
|
|
3212
|
+
if (shouldCast || shared.hasOwn(prop, "default")) {
|
|
3213
|
+
needCastKeys.push(normalizedKey);
|
|
3149
3214
|
}
|
|
3150
3215
|
}
|
|
3151
3216
|
}
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3217
|
+
}
|
|
3218
|
+
const res = [normalized, needCastKeys];
|
|
3219
|
+
if (shared.isObject(comp)) {
|
|
3220
|
+
cache.set(comp, res);
|
|
3221
|
+
}
|
|
3222
|
+
return res;
|
|
3223
|
+
}
|
|
3224
|
+
function validatePropName(key) {
|
|
3225
|
+
if (key[0] !== "$" && !shared.isReservedProp(key)) {
|
|
3226
|
+
return true;
|
|
3227
|
+
}
|
|
3228
|
+
return false;
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3231
|
+
const isInternalKey = (key) => key[0] === "_" || key === "$stable";
|
|
3232
|
+
const normalizeSlotValue = (value) => shared.isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
|
|
3233
|
+
const normalizeSlot = (key, rawSlot, ctx) => {
|
|
3234
|
+
if (rawSlot._n) {
|
|
3235
|
+
return rawSlot;
|
|
3236
|
+
}
|
|
3237
|
+
const normalized = withCtx((...args) => {
|
|
3238
|
+
if (false) ;
|
|
3239
|
+
return normalizeSlotValue(rawSlot(...args));
|
|
3240
|
+
}, ctx);
|
|
3241
|
+
normalized._c = false;
|
|
3242
|
+
return normalized;
|
|
3243
|
+
};
|
|
3244
|
+
const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
3245
|
+
const ctx = rawSlots._ctx;
|
|
3246
|
+
for (const key in rawSlots) {
|
|
3247
|
+
if (isInternalKey(key)) continue;
|
|
3248
|
+
const value = rawSlots[key];
|
|
3249
|
+
if (shared.isFunction(value)) {
|
|
3250
|
+
slots[key] = normalizeSlot(key, value, ctx);
|
|
3251
|
+
} else if (value != null) {
|
|
3252
|
+
const normalized = normalizeSlotValue(value);
|
|
3253
|
+
slots[key] = () => normalized;
|
|
3158
3254
|
}
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3255
|
+
}
|
|
3256
|
+
};
|
|
3257
|
+
const normalizeVNodeSlots = (instance, children) => {
|
|
3258
|
+
const normalized = normalizeSlotValue(children);
|
|
3259
|
+
instance.slots.default = () => normalized;
|
|
3260
|
+
};
|
|
3261
|
+
const assignSlots = (slots, children, optimized) => {
|
|
3262
|
+
for (const key in children) {
|
|
3263
|
+
if (optimized || key !== "_") {
|
|
3264
|
+
slots[key] = children[key];
|
|
3265
|
+
}
|
|
3266
|
+
}
|
|
3267
|
+
};
|
|
3268
|
+
const initSlots = (instance, children, optimized) => {
|
|
3269
|
+
const slots = instance.slots = createInternalObject();
|
|
3270
|
+
if (instance.vnode.shapeFlag & 32) {
|
|
3271
|
+
const type = children._;
|
|
3272
|
+
if (type) {
|
|
3273
|
+
assignSlots(slots, children, optimized);
|
|
3274
|
+
if (optimized) {
|
|
3275
|
+
shared.def(slots, "_", type, true);
|
|
3163
3276
|
}
|
|
3164
|
-
|
|
3277
|
+
} else {
|
|
3278
|
+
normalizeObjectSlots(children, slots);
|
|
3165
3279
|
}
|
|
3166
|
-
}
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
}
|
|
3280
|
+
} else if (children) {
|
|
3281
|
+
normalizeVNodeSlots(instance, children);
|
|
3282
|
+
}
|
|
3283
|
+
};
|
|
3284
|
+
const updateSlots = (instance, children, optimized) => {
|
|
3285
|
+
const { vnode, slots } = instance;
|
|
3286
|
+
let needDeletionCheck = true;
|
|
3287
|
+
let deletionComparisonTarget = shared.EMPTY_OBJ;
|
|
3288
|
+
if (vnode.shapeFlag & 32) {
|
|
3289
|
+
const type = children._;
|
|
3290
|
+
if (type) {
|
|
3291
|
+
if (optimized && type === 1) {
|
|
3292
|
+
needDeletionCheck = false;
|
|
3293
|
+
} else {
|
|
3294
|
+
assignSlots(slots, children, optimized);
|
|
3295
|
+
}
|
|
3296
|
+
} else {
|
|
3297
|
+
needDeletionCheck = !children.$stable;
|
|
3298
|
+
normalizeObjectSlots(children, slots);
|
|
3299
|
+
}
|
|
3300
|
+
deletionComparisonTarget = children;
|
|
3301
|
+
} else if (children) {
|
|
3302
|
+
normalizeVNodeSlots(instance, children);
|
|
3303
|
+
deletionComparisonTarget = { default: 1 };
|
|
3304
|
+
}
|
|
3305
|
+
if (needDeletionCheck) {
|
|
3306
|
+
for (const key in slots) {
|
|
3307
|
+
if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
|
|
3308
|
+
delete slots[key];
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
};
|
|
3172
3313
|
|
|
3173
3314
|
const queuePostRenderEffect = queueEffectWithSuspense ;
|
|
3174
3315
|
function createRenderer(options) {
|
|
@@ -3750,8 +3891,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3750
3891
|
const componentUpdateFn = () => {
|
|
3751
3892
|
if (!instance.isMounted) {
|
|
3752
3893
|
let vnodeHook;
|
|
3753
|
-
const { el, props
|
|
3754
|
-
const { bm, m, parent } = instance;
|
|
3894
|
+
const { el, props } = initialVNode;
|
|
3895
|
+
const { bm, m, parent, root, type } = instance;
|
|
3755
3896
|
const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
|
|
3756
3897
|
toggleRecurse(instance, false);
|
|
3757
3898
|
if (bm) {
|
|
@@ -3772,18 +3913,19 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3772
3913
|
null
|
|
3773
3914
|
);
|
|
3774
3915
|
};
|
|
3775
|
-
if (isAsyncWrapperVNode
|
|
3776
|
-
type.
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
// and it will never need to change.
|
|
3781
|
-
() => !instance.isUnmounted && hydrateSubTree()
|
|
3916
|
+
if (isAsyncWrapperVNode) {
|
|
3917
|
+
type.__asyncHydrate(
|
|
3918
|
+
el,
|
|
3919
|
+
instance,
|
|
3920
|
+
hydrateSubTree
|
|
3782
3921
|
);
|
|
3783
3922
|
} else {
|
|
3784
3923
|
hydrateSubTree();
|
|
3785
3924
|
}
|
|
3786
3925
|
} else {
|
|
3926
|
+
if (root.ce) {
|
|
3927
|
+
root.ce._injectChildStyle(type);
|
|
3928
|
+
}
|
|
3787
3929
|
const subTree = instance.subTree = renderComponentRoot(instance);
|
|
3788
3930
|
patch(
|
|
3789
3931
|
null,
|
|
@@ -4396,13 +4538,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4396
4538
|
namespace
|
|
4397
4539
|
);
|
|
4398
4540
|
}
|
|
4541
|
+
container._vnode = vnode;
|
|
4399
4542
|
if (!isFlushing) {
|
|
4400
4543
|
isFlushing = true;
|
|
4401
4544
|
flushPreFlushCbs();
|
|
4402
4545
|
flushPostFlushCbs();
|
|
4403
4546
|
isFlushing = false;
|
|
4404
4547
|
}
|
|
4405
|
-
container._vnode = vnode;
|
|
4406
4548
|
};
|
|
4407
4549
|
const internals = {
|
|
4408
4550
|
p: patch,
|
|
@@ -4563,14 +4705,16 @@ function doWatch(source, cb, {
|
|
|
4563
4705
|
const _cb = cb;
|
|
4564
4706
|
cb = (...args) => {
|
|
4565
4707
|
_cb(...args);
|
|
4566
|
-
|
|
4708
|
+
watchHandle();
|
|
4567
4709
|
};
|
|
4568
4710
|
}
|
|
4569
4711
|
const instance = currentInstance;
|
|
4570
|
-
const reactiveGetter = (source2) =>
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4712
|
+
const reactiveGetter = (source2) => {
|
|
4713
|
+
if (deep) return source2;
|
|
4714
|
+
if (reactivity.isShallow(source2) || deep === false || deep === 0)
|
|
4715
|
+
return traverse(source2, 1);
|
|
4716
|
+
return traverse(source2);
|
|
4717
|
+
};
|
|
4574
4718
|
let getter;
|
|
4575
4719
|
let forceTrigger = false;
|
|
4576
4720
|
let isMultiSource = false;
|
|
@@ -4613,7 +4757,8 @@ function doWatch(source, cb, {
|
|
|
4613
4757
|
}
|
|
4614
4758
|
if (cb && deep) {
|
|
4615
4759
|
const baseGetter = getter;
|
|
4616
|
-
|
|
4760
|
+
const depth = deep === true ? Infinity : deep;
|
|
4761
|
+
getter = () => traverse(baseGetter(), depth);
|
|
4617
4762
|
}
|
|
4618
4763
|
let cleanup;
|
|
4619
4764
|
let onCleanup = (fn) => {
|
|
@@ -4638,7 +4783,12 @@ function doWatch(source, cb, {
|
|
|
4638
4783
|
const ctx = useSSRContext();
|
|
4639
4784
|
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
4640
4785
|
} else {
|
|
4641
|
-
|
|
4786
|
+
const watchHandle2 = () => {
|
|
4787
|
+
};
|
|
4788
|
+
watchHandle2.stop = shared.NOOP;
|
|
4789
|
+
watchHandle2.resume = shared.NOOP;
|
|
4790
|
+
watchHandle2.pause = shared.NOOP;
|
|
4791
|
+
return watchHandle2;
|
|
4642
4792
|
}
|
|
4643
4793
|
}
|
|
4644
4794
|
let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
|
|
@@ -4679,12 +4829,15 @@ function doWatch(source, cb, {
|
|
|
4679
4829
|
}
|
|
4680
4830
|
effect.scheduler = scheduler;
|
|
4681
4831
|
const scope = reactivity.getCurrentScope();
|
|
4682
|
-
const
|
|
4832
|
+
const watchHandle = () => {
|
|
4683
4833
|
effect.stop();
|
|
4684
4834
|
if (scope) {
|
|
4685
4835
|
shared.remove(scope.effects, effect);
|
|
4686
4836
|
}
|
|
4687
4837
|
};
|
|
4838
|
+
watchHandle.pause = effect.pause.bind(effect);
|
|
4839
|
+
watchHandle.resume = effect.resume.bind(effect);
|
|
4840
|
+
watchHandle.stop = watchHandle;
|
|
4688
4841
|
if (cb) {
|
|
4689
4842
|
if (immediate) {
|
|
4690
4843
|
job(true);
|
|
@@ -4699,8 +4852,8 @@ function doWatch(source, cb, {
|
|
|
4699
4852
|
} else {
|
|
4700
4853
|
effect.run();
|
|
4701
4854
|
}
|
|
4702
|
-
if (ssrCleanup) ssrCleanup.push(
|
|
4703
|
-
return
|
|
4855
|
+
if (ssrCleanup) ssrCleanup.push(watchHandle);
|
|
4856
|
+
return watchHandle;
|
|
4704
4857
|
}
|
|
4705
4858
|
function instanceWatch(source, value, options) {
|
|
4706
4859
|
const publicThis = this.proxy;
|
|
@@ -4782,7 +4935,8 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
|
4782
4935
|
return options.get ? options.get(localValue) : localValue;
|
|
4783
4936
|
},
|
|
4784
4937
|
set(value) {
|
|
4785
|
-
|
|
4938
|
+
const emittedValue = options.set ? options.set(value) : value;
|
|
4939
|
+
if (!shared.hasChanged(emittedValue, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) {
|
|
4786
4940
|
return;
|
|
4787
4941
|
}
|
|
4788
4942
|
const rawProps = i.vnode.props;
|
|
@@ -4791,7 +4945,6 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
|
4791
4945
|
localValue = value;
|
|
4792
4946
|
trigger();
|
|
4793
4947
|
}
|
|
4794
|
-
const emittedValue = options.set ? options.set(value) : value;
|
|
4795
4948
|
i.emit(`update:${name}`, emittedValue);
|
|
4796
4949
|
if (shared.hasChanged(value, emittedValue) && shared.hasChanged(value, prevSetValue) && !shared.hasChanged(emittedValue, prevEmittedValue)) {
|
|
4797
4950
|
trigger();
|
|
@@ -6322,11 +6475,13 @@ function useTemplateRef(key) {
|
|
|
6322
6475
|
const r = reactivity.shallowRef(null);
|
|
6323
6476
|
if (i) {
|
|
6324
6477
|
const refs = i.refs === shared.EMPTY_OBJ ? i.refs = {} : i.refs;
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6478
|
+
{
|
|
6479
|
+
Object.defineProperty(refs, key, {
|
|
6480
|
+
enumerable: true,
|
|
6481
|
+
get: () => r.value,
|
|
6482
|
+
set: (val) => r.value = val
|
|
6483
|
+
});
|
|
6484
|
+
}
|
|
6330
6485
|
}
|
|
6331
6486
|
return r;
|
|
6332
6487
|
}
|
|
@@ -6384,7 +6539,7 @@ function isMemoSame(cached, memo) {
|
|
|
6384
6539
|
return true;
|
|
6385
6540
|
}
|
|
6386
6541
|
|
|
6387
|
-
const version = "3.5.0-
|
|
6542
|
+
const version = "3.5.0-beta.1";
|
|
6388
6543
|
const warn$1 = shared.NOOP;
|
|
6389
6544
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
6390
6545
|
const devtools = void 0;
|
|
@@ -6396,7 +6551,8 @@ const _ssrUtils = {
|
|
|
6396
6551
|
setCurrentRenderingInstance,
|
|
6397
6552
|
isVNode: isVNode,
|
|
6398
6553
|
normalizeVNode,
|
|
6399
|
-
getComponentPublicInstance
|
|
6554
|
+
getComponentPublicInstance,
|
|
6555
|
+
ensureValidVNode
|
|
6400
6556
|
};
|
|
6401
6557
|
const ssrUtils = _ssrUtils ;
|
|
6402
6558
|
const resolveFilter = null;
|
|
@@ -6483,6 +6639,10 @@ exports.guardReactiveProps = guardReactiveProps;
|
|
|
6483
6639
|
exports.h = h;
|
|
6484
6640
|
exports.handleError = handleError;
|
|
6485
6641
|
exports.hasInjectionContext = hasInjectionContext;
|
|
6642
|
+
exports.hydrateOnIdle = hydrateOnIdle;
|
|
6643
|
+
exports.hydrateOnInteraction = hydrateOnInteraction;
|
|
6644
|
+
exports.hydrateOnMediaQuery = hydrateOnMediaQuery;
|
|
6645
|
+
exports.hydrateOnVisible = hydrateOnVisible;
|
|
6486
6646
|
exports.initCustomFormatter = initCustomFormatter;
|
|
6487
6647
|
exports.inject = inject;
|
|
6488
6648
|
exports.isMemoSame = isMemoSame;
|