cleek 1.1.5 → 1.1.6
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/dist/cleek.es.js +4741 -0
- package/dist/cleek.umd.js +1 -0
- package/{public → dist}/favicon.ico +0 -0
- package/dist/style.css +1 -0
- package/package.json +4 -1
- package/.vscode/extensions.json +0 -3
- package/config.vite.js +0 -11
- package/index.html +0 -13
- package/src/App.vue +0 -25
- package/src/assets/logo.png +0 -0
- package/src/env.d.ts +0 -8
- package/src/lib-components/HelloWorld.vue +0 -52
- package/src/lib-components/ck-button.vue +0 -69
- package/src/lib-components/functions.ts +0 -12
- package/src/lib-components/index.ts +0 -9
- package/src/main.ts +0 -27
- package/tsconfig.json +0 -15
- package/vite.config.ts +0 -14
package/dist/cleek.es.js
ADDED
|
@@ -0,0 +1,4741 @@
|
|
|
1
|
+
var functions = {
|
|
2
|
+
getGroupClass({ group = "", groupVertical = "", groupBreak = "" } = {}) {
|
|
3
|
+
const _screenSize = "";
|
|
4
|
+
if (groupBreak && groupBreak === _screenSize)
|
|
5
|
+
return [];
|
|
6
|
+
const classList = [];
|
|
7
|
+
if (group)
|
|
8
|
+
classList.push(`ck-component__group--${group}`);
|
|
9
|
+
if (groupVertical)
|
|
10
|
+
classList.push(`ck-component__group-vertical--${groupVertical}`);
|
|
11
|
+
return classList;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
function makeMap(str, expectsLowerCase) {
|
|
15
|
+
const map = Object.create(null);
|
|
16
|
+
const list = str.split(",");
|
|
17
|
+
for (let i = 0; i < list.length; i++) {
|
|
18
|
+
map[list[i]] = true;
|
|
19
|
+
}
|
|
20
|
+
return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
|
|
21
|
+
}
|
|
22
|
+
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
23
|
+
const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
|
|
24
|
+
function includeBooleanAttr(value) {
|
|
25
|
+
return !!value || value === "";
|
|
26
|
+
}
|
|
27
|
+
function normalizeStyle(value) {
|
|
28
|
+
if (isArray(value)) {
|
|
29
|
+
const res = {};
|
|
30
|
+
for (let i = 0; i < value.length; i++) {
|
|
31
|
+
const item = value[i];
|
|
32
|
+
const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
|
|
33
|
+
if (normalized) {
|
|
34
|
+
for (const key in normalized) {
|
|
35
|
+
res[key] = normalized[key];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return res;
|
|
40
|
+
} else if (isString(value)) {
|
|
41
|
+
return value;
|
|
42
|
+
} else if (isObject(value)) {
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
47
|
+
const propertyDelimiterRE = /:(.+)/;
|
|
48
|
+
function parseStringStyle(cssText) {
|
|
49
|
+
const ret = {};
|
|
50
|
+
cssText.split(listDelimiterRE).forEach((item) => {
|
|
51
|
+
if (item) {
|
|
52
|
+
const tmp = item.split(propertyDelimiterRE);
|
|
53
|
+
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return ret;
|
|
57
|
+
}
|
|
58
|
+
function normalizeClass(value) {
|
|
59
|
+
let res = "";
|
|
60
|
+
if (isString(value)) {
|
|
61
|
+
res = value;
|
|
62
|
+
} else if (isArray(value)) {
|
|
63
|
+
for (let i = 0; i < value.length; i++) {
|
|
64
|
+
const normalized = normalizeClass(value[i]);
|
|
65
|
+
if (normalized) {
|
|
66
|
+
res += normalized + " ";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
} else if (isObject(value)) {
|
|
70
|
+
for (const name in value) {
|
|
71
|
+
if (value[name]) {
|
|
72
|
+
res += name + " ";
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return res.trim();
|
|
77
|
+
}
|
|
78
|
+
const toDisplayString = (val) => {
|
|
79
|
+
return val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
|
|
80
|
+
};
|
|
81
|
+
const replacer = (_key, val) => {
|
|
82
|
+
if (val && val.__v_isRef) {
|
|
83
|
+
return replacer(_key, val.value);
|
|
84
|
+
} else if (isMap(val)) {
|
|
85
|
+
return {
|
|
86
|
+
[`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
|
|
87
|
+
entries[`${key} =>`] = val2;
|
|
88
|
+
return entries;
|
|
89
|
+
}, {})
|
|
90
|
+
};
|
|
91
|
+
} else if (isSet(val)) {
|
|
92
|
+
return {
|
|
93
|
+
[`Set(${val.size})`]: [...val.values()]
|
|
94
|
+
};
|
|
95
|
+
} else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
|
|
96
|
+
return String(val);
|
|
97
|
+
}
|
|
98
|
+
return val;
|
|
99
|
+
};
|
|
100
|
+
const EMPTY_OBJ = {};
|
|
101
|
+
const EMPTY_ARR = [];
|
|
102
|
+
const NOOP = () => {
|
|
103
|
+
};
|
|
104
|
+
const NO = () => false;
|
|
105
|
+
const onRE = /^on[^a-z]/;
|
|
106
|
+
const isOn = (key) => onRE.test(key);
|
|
107
|
+
const isModelListener = (key) => key.startsWith("onUpdate:");
|
|
108
|
+
const extend = Object.assign;
|
|
109
|
+
const remove = (arr, el) => {
|
|
110
|
+
const i = arr.indexOf(el);
|
|
111
|
+
if (i > -1) {
|
|
112
|
+
arr.splice(i, 1);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
116
|
+
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
|
117
|
+
const isArray = Array.isArray;
|
|
118
|
+
const isMap = (val) => toTypeString(val) === "[object Map]";
|
|
119
|
+
const isSet = (val) => toTypeString(val) === "[object Set]";
|
|
120
|
+
const isFunction = (val) => typeof val === "function";
|
|
121
|
+
const isString = (val) => typeof val === "string";
|
|
122
|
+
const isSymbol = (val) => typeof val === "symbol";
|
|
123
|
+
const isObject = (val) => val !== null && typeof val === "object";
|
|
124
|
+
const isPromise = (val) => {
|
|
125
|
+
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
|
126
|
+
};
|
|
127
|
+
const objectToString = Object.prototype.toString;
|
|
128
|
+
const toTypeString = (value) => objectToString.call(value);
|
|
129
|
+
const toRawType = (value) => {
|
|
130
|
+
return toTypeString(value).slice(8, -1);
|
|
131
|
+
};
|
|
132
|
+
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
133
|
+
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
134
|
+
const isReservedProp = /* @__PURE__ */ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
135
|
+
const cacheStringFunction = (fn) => {
|
|
136
|
+
const cache = Object.create(null);
|
|
137
|
+
return (str) => {
|
|
138
|
+
const hit = cache[str];
|
|
139
|
+
return hit || (cache[str] = fn(str));
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
const camelizeRE = /-(\w)/g;
|
|
143
|
+
const camelize = cacheStringFunction((str) => {
|
|
144
|
+
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
|
|
145
|
+
});
|
|
146
|
+
const hyphenateRE = /\B([A-Z])/g;
|
|
147
|
+
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
148
|
+
const capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
|
|
149
|
+
const toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);
|
|
150
|
+
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
151
|
+
const invokeArrayFns = (fns, arg) => {
|
|
152
|
+
for (let i = 0; i < fns.length; i++) {
|
|
153
|
+
fns[i](arg);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
const def = (obj, key, value) => {
|
|
157
|
+
Object.defineProperty(obj, key, {
|
|
158
|
+
configurable: true,
|
|
159
|
+
enumerable: false,
|
|
160
|
+
value
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
const toNumber = (val) => {
|
|
164
|
+
const n = parseFloat(val);
|
|
165
|
+
return isNaN(n) ? val : n;
|
|
166
|
+
};
|
|
167
|
+
let _globalThis;
|
|
168
|
+
const getGlobalThis = () => {
|
|
169
|
+
return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
|
|
170
|
+
};
|
|
171
|
+
let activeEffectScope;
|
|
172
|
+
const effectScopeStack = [];
|
|
173
|
+
class EffectScope {
|
|
174
|
+
constructor(detached = false) {
|
|
175
|
+
this.active = true;
|
|
176
|
+
this.effects = [];
|
|
177
|
+
this.cleanups = [];
|
|
178
|
+
if (!detached && activeEffectScope) {
|
|
179
|
+
this.parent = activeEffectScope;
|
|
180
|
+
this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
run(fn) {
|
|
184
|
+
if (this.active) {
|
|
185
|
+
try {
|
|
186
|
+
this.on();
|
|
187
|
+
return fn();
|
|
188
|
+
} finally {
|
|
189
|
+
this.off();
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
on() {
|
|
194
|
+
if (this.active) {
|
|
195
|
+
effectScopeStack.push(this);
|
|
196
|
+
activeEffectScope = this;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
off() {
|
|
200
|
+
if (this.active) {
|
|
201
|
+
effectScopeStack.pop();
|
|
202
|
+
activeEffectScope = effectScopeStack[effectScopeStack.length - 1];
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
stop(fromParent) {
|
|
206
|
+
if (this.active) {
|
|
207
|
+
this.effects.forEach((e) => e.stop());
|
|
208
|
+
this.cleanups.forEach((cleanup) => cleanup());
|
|
209
|
+
if (this.scopes) {
|
|
210
|
+
this.scopes.forEach((e) => e.stop(true));
|
|
211
|
+
}
|
|
212
|
+
if (this.parent && !fromParent) {
|
|
213
|
+
const last = this.parent.scopes.pop();
|
|
214
|
+
if (last && last !== this) {
|
|
215
|
+
this.parent.scopes[this.index] = last;
|
|
216
|
+
last.index = this.index;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
this.active = false;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function recordEffectScope(effect, scope) {
|
|
224
|
+
scope = scope || activeEffectScope;
|
|
225
|
+
if (scope && scope.active) {
|
|
226
|
+
scope.effects.push(effect);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
const createDep = (effects) => {
|
|
230
|
+
const dep = new Set(effects);
|
|
231
|
+
dep.w = 0;
|
|
232
|
+
dep.n = 0;
|
|
233
|
+
return dep;
|
|
234
|
+
};
|
|
235
|
+
const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
|
|
236
|
+
const newTracked = (dep) => (dep.n & trackOpBit) > 0;
|
|
237
|
+
const initDepMarkers = ({ deps }) => {
|
|
238
|
+
if (deps.length) {
|
|
239
|
+
for (let i = 0; i < deps.length; i++) {
|
|
240
|
+
deps[i].w |= trackOpBit;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
const finalizeDepMarkers = (effect) => {
|
|
245
|
+
const { deps } = effect;
|
|
246
|
+
if (deps.length) {
|
|
247
|
+
let ptr = 0;
|
|
248
|
+
for (let i = 0; i < deps.length; i++) {
|
|
249
|
+
const dep = deps[i];
|
|
250
|
+
if (wasTracked(dep) && !newTracked(dep)) {
|
|
251
|
+
dep.delete(effect);
|
|
252
|
+
} else {
|
|
253
|
+
deps[ptr++] = dep;
|
|
254
|
+
}
|
|
255
|
+
dep.w &= ~trackOpBit;
|
|
256
|
+
dep.n &= ~trackOpBit;
|
|
257
|
+
}
|
|
258
|
+
deps.length = ptr;
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
const targetMap = new WeakMap();
|
|
262
|
+
let effectTrackDepth = 0;
|
|
263
|
+
let trackOpBit = 1;
|
|
264
|
+
const maxMarkerBits = 30;
|
|
265
|
+
const effectStack = [];
|
|
266
|
+
let activeEffect;
|
|
267
|
+
const ITERATE_KEY = Symbol("");
|
|
268
|
+
const MAP_KEY_ITERATE_KEY = Symbol("");
|
|
269
|
+
class ReactiveEffect {
|
|
270
|
+
constructor(fn, scheduler = null, scope) {
|
|
271
|
+
this.fn = fn;
|
|
272
|
+
this.scheduler = scheduler;
|
|
273
|
+
this.active = true;
|
|
274
|
+
this.deps = [];
|
|
275
|
+
recordEffectScope(this, scope);
|
|
276
|
+
}
|
|
277
|
+
run() {
|
|
278
|
+
if (!this.active) {
|
|
279
|
+
return this.fn();
|
|
280
|
+
}
|
|
281
|
+
if (!effectStack.includes(this)) {
|
|
282
|
+
try {
|
|
283
|
+
effectStack.push(activeEffect = this);
|
|
284
|
+
enableTracking();
|
|
285
|
+
trackOpBit = 1 << ++effectTrackDepth;
|
|
286
|
+
if (effectTrackDepth <= maxMarkerBits) {
|
|
287
|
+
initDepMarkers(this);
|
|
288
|
+
} else {
|
|
289
|
+
cleanupEffect(this);
|
|
290
|
+
}
|
|
291
|
+
return this.fn();
|
|
292
|
+
} finally {
|
|
293
|
+
if (effectTrackDepth <= maxMarkerBits) {
|
|
294
|
+
finalizeDepMarkers(this);
|
|
295
|
+
}
|
|
296
|
+
trackOpBit = 1 << --effectTrackDepth;
|
|
297
|
+
resetTracking();
|
|
298
|
+
effectStack.pop();
|
|
299
|
+
const n = effectStack.length;
|
|
300
|
+
activeEffect = n > 0 ? effectStack[n - 1] : void 0;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
stop() {
|
|
305
|
+
if (this.active) {
|
|
306
|
+
cleanupEffect(this);
|
|
307
|
+
if (this.onStop) {
|
|
308
|
+
this.onStop();
|
|
309
|
+
}
|
|
310
|
+
this.active = false;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function cleanupEffect(effect) {
|
|
315
|
+
const { deps } = effect;
|
|
316
|
+
if (deps.length) {
|
|
317
|
+
for (let i = 0; i < deps.length; i++) {
|
|
318
|
+
deps[i].delete(effect);
|
|
319
|
+
}
|
|
320
|
+
deps.length = 0;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
let shouldTrack = true;
|
|
324
|
+
const trackStack = [];
|
|
325
|
+
function pauseTracking() {
|
|
326
|
+
trackStack.push(shouldTrack);
|
|
327
|
+
shouldTrack = false;
|
|
328
|
+
}
|
|
329
|
+
function enableTracking() {
|
|
330
|
+
trackStack.push(shouldTrack);
|
|
331
|
+
shouldTrack = true;
|
|
332
|
+
}
|
|
333
|
+
function resetTracking() {
|
|
334
|
+
const last = trackStack.pop();
|
|
335
|
+
shouldTrack = last === void 0 ? true : last;
|
|
336
|
+
}
|
|
337
|
+
function track(target, type, key) {
|
|
338
|
+
if (!isTracking()) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
let depsMap = targetMap.get(target);
|
|
342
|
+
if (!depsMap) {
|
|
343
|
+
targetMap.set(target, depsMap = new Map());
|
|
344
|
+
}
|
|
345
|
+
let dep = depsMap.get(key);
|
|
346
|
+
if (!dep) {
|
|
347
|
+
depsMap.set(key, dep = createDep());
|
|
348
|
+
}
|
|
349
|
+
trackEffects(dep);
|
|
350
|
+
}
|
|
351
|
+
function isTracking() {
|
|
352
|
+
return shouldTrack && activeEffect !== void 0;
|
|
353
|
+
}
|
|
354
|
+
function trackEffects(dep, debuggerEventExtraInfo) {
|
|
355
|
+
let shouldTrack2 = false;
|
|
356
|
+
if (effectTrackDepth <= maxMarkerBits) {
|
|
357
|
+
if (!newTracked(dep)) {
|
|
358
|
+
dep.n |= trackOpBit;
|
|
359
|
+
shouldTrack2 = !wasTracked(dep);
|
|
360
|
+
}
|
|
361
|
+
} else {
|
|
362
|
+
shouldTrack2 = !dep.has(activeEffect);
|
|
363
|
+
}
|
|
364
|
+
if (shouldTrack2) {
|
|
365
|
+
dep.add(activeEffect);
|
|
366
|
+
activeEffect.deps.push(dep);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
370
|
+
const depsMap = targetMap.get(target);
|
|
371
|
+
if (!depsMap) {
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
let deps = [];
|
|
375
|
+
if (type === "clear") {
|
|
376
|
+
deps = [...depsMap.values()];
|
|
377
|
+
} else if (key === "length" && isArray(target)) {
|
|
378
|
+
depsMap.forEach((dep, key2) => {
|
|
379
|
+
if (key2 === "length" || key2 >= newValue) {
|
|
380
|
+
deps.push(dep);
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
} else {
|
|
384
|
+
if (key !== void 0) {
|
|
385
|
+
deps.push(depsMap.get(key));
|
|
386
|
+
}
|
|
387
|
+
switch (type) {
|
|
388
|
+
case "add":
|
|
389
|
+
if (!isArray(target)) {
|
|
390
|
+
deps.push(depsMap.get(ITERATE_KEY));
|
|
391
|
+
if (isMap(target)) {
|
|
392
|
+
deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
393
|
+
}
|
|
394
|
+
} else if (isIntegerKey(key)) {
|
|
395
|
+
deps.push(depsMap.get("length"));
|
|
396
|
+
}
|
|
397
|
+
break;
|
|
398
|
+
case "delete":
|
|
399
|
+
if (!isArray(target)) {
|
|
400
|
+
deps.push(depsMap.get(ITERATE_KEY));
|
|
401
|
+
if (isMap(target)) {
|
|
402
|
+
deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
break;
|
|
406
|
+
case "set":
|
|
407
|
+
if (isMap(target)) {
|
|
408
|
+
deps.push(depsMap.get(ITERATE_KEY));
|
|
409
|
+
}
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
if (deps.length === 1) {
|
|
414
|
+
if (deps[0]) {
|
|
415
|
+
{
|
|
416
|
+
triggerEffects(deps[0]);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
} else {
|
|
420
|
+
const effects = [];
|
|
421
|
+
for (const dep of deps) {
|
|
422
|
+
if (dep) {
|
|
423
|
+
effects.push(...dep);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
{
|
|
427
|
+
triggerEffects(createDep(effects));
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
function triggerEffects(dep, debuggerEventExtraInfo) {
|
|
432
|
+
for (const effect of isArray(dep) ? dep : [...dep]) {
|
|
433
|
+
if (effect !== activeEffect || effect.allowRecurse) {
|
|
434
|
+
if (effect.scheduler) {
|
|
435
|
+
effect.scheduler();
|
|
436
|
+
} else {
|
|
437
|
+
effect.run();
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
443
|
+
const builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(isSymbol));
|
|
444
|
+
const get = /* @__PURE__ */ createGetter();
|
|
445
|
+
const shallowGet = /* @__PURE__ */ createGetter(false, true);
|
|
446
|
+
const readonlyGet = /* @__PURE__ */ createGetter(true);
|
|
447
|
+
const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
|
|
448
|
+
function createArrayInstrumentations() {
|
|
449
|
+
const instrumentations = {};
|
|
450
|
+
["includes", "indexOf", "lastIndexOf"].forEach((key) => {
|
|
451
|
+
instrumentations[key] = function(...args) {
|
|
452
|
+
const arr = toRaw(this);
|
|
453
|
+
for (let i = 0, l = this.length; i < l; i++) {
|
|
454
|
+
track(arr, "get", i + "");
|
|
455
|
+
}
|
|
456
|
+
const res = arr[key](...args);
|
|
457
|
+
if (res === -1 || res === false) {
|
|
458
|
+
return arr[key](...args.map(toRaw));
|
|
459
|
+
} else {
|
|
460
|
+
return res;
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
});
|
|
464
|
+
["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
|
|
465
|
+
instrumentations[key] = function(...args) {
|
|
466
|
+
pauseTracking();
|
|
467
|
+
const res = toRaw(this)[key].apply(this, args);
|
|
468
|
+
resetTracking();
|
|
469
|
+
return res;
|
|
470
|
+
};
|
|
471
|
+
});
|
|
472
|
+
return instrumentations;
|
|
473
|
+
}
|
|
474
|
+
function createGetter(isReadonly2 = false, shallow = false) {
|
|
475
|
+
return function get2(target, key, receiver) {
|
|
476
|
+
if (key === "__v_isReactive") {
|
|
477
|
+
return !isReadonly2;
|
|
478
|
+
} else if (key === "__v_isReadonly") {
|
|
479
|
+
return isReadonly2;
|
|
480
|
+
} else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
|
|
481
|
+
return target;
|
|
482
|
+
}
|
|
483
|
+
const targetIsArray = isArray(target);
|
|
484
|
+
if (!isReadonly2 && targetIsArray && hasOwn(arrayInstrumentations, key)) {
|
|
485
|
+
return Reflect.get(arrayInstrumentations, key, receiver);
|
|
486
|
+
}
|
|
487
|
+
const res = Reflect.get(target, key, receiver);
|
|
488
|
+
if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
|
|
489
|
+
return res;
|
|
490
|
+
}
|
|
491
|
+
if (!isReadonly2) {
|
|
492
|
+
track(target, "get", key);
|
|
493
|
+
}
|
|
494
|
+
if (shallow) {
|
|
495
|
+
return res;
|
|
496
|
+
}
|
|
497
|
+
if (isRef(res)) {
|
|
498
|
+
const shouldUnwrap = !targetIsArray || !isIntegerKey(key);
|
|
499
|
+
return shouldUnwrap ? res.value : res;
|
|
500
|
+
}
|
|
501
|
+
if (isObject(res)) {
|
|
502
|
+
return isReadonly2 ? readonly(res) : reactive(res);
|
|
503
|
+
}
|
|
504
|
+
return res;
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
const set = /* @__PURE__ */ createSetter();
|
|
508
|
+
const shallowSet = /* @__PURE__ */ createSetter(true);
|
|
509
|
+
function createSetter(shallow = false) {
|
|
510
|
+
return function set2(target, key, value, receiver) {
|
|
511
|
+
let oldValue = target[key];
|
|
512
|
+
if (!shallow && !isReadonly(value)) {
|
|
513
|
+
value = toRaw(value);
|
|
514
|
+
oldValue = toRaw(oldValue);
|
|
515
|
+
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
516
|
+
oldValue.value = value;
|
|
517
|
+
return true;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
|
|
521
|
+
const result = Reflect.set(target, key, value, receiver);
|
|
522
|
+
if (target === toRaw(receiver)) {
|
|
523
|
+
if (!hadKey) {
|
|
524
|
+
trigger(target, "add", key, value);
|
|
525
|
+
} else if (hasChanged(value, oldValue)) {
|
|
526
|
+
trigger(target, "set", key, value);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
return result;
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
function deleteProperty(target, key) {
|
|
533
|
+
const hadKey = hasOwn(target, key);
|
|
534
|
+
target[key];
|
|
535
|
+
const result = Reflect.deleteProperty(target, key);
|
|
536
|
+
if (result && hadKey) {
|
|
537
|
+
trigger(target, "delete", key, void 0);
|
|
538
|
+
}
|
|
539
|
+
return result;
|
|
540
|
+
}
|
|
541
|
+
function has(target, key) {
|
|
542
|
+
const result = Reflect.has(target, key);
|
|
543
|
+
if (!isSymbol(key) || !builtInSymbols.has(key)) {
|
|
544
|
+
track(target, "has", key);
|
|
545
|
+
}
|
|
546
|
+
return result;
|
|
547
|
+
}
|
|
548
|
+
function ownKeys(target) {
|
|
549
|
+
track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY);
|
|
550
|
+
return Reflect.ownKeys(target);
|
|
551
|
+
}
|
|
552
|
+
const mutableHandlers = {
|
|
553
|
+
get,
|
|
554
|
+
set,
|
|
555
|
+
deleteProperty,
|
|
556
|
+
has,
|
|
557
|
+
ownKeys
|
|
558
|
+
};
|
|
559
|
+
const readonlyHandlers = {
|
|
560
|
+
get: readonlyGet,
|
|
561
|
+
set(target, key) {
|
|
562
|
+
return true;
|
|
563
|
+
},
|
|
564
|
+
deleteProperty(target, key) {
|
|
565
|
+
return true;
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
const shallowReactiveHandlers = /* @__PURE__ */ extend({}, mutableHandlers, {
|
|
569
|
+
get: shallowGet,
|
|
570
|
+
set: shallowSet
|
|
571
|
+
});
|
|
572
|
+
const toShallow = (value) => value;
|
|
573
|
+
const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
574
|
+
function get$1(target, key, isReadonly2 = false, isShallow = false) {
|
|
575
|
+
target = target["__v_raw"];
|
|
576
|
+
const rawTarget = toRaw(target);
|
|
577
|
+
const rawKey = toRaw(key);
|
|
578
|
+
if (key !== rawKey) {
|
|
579
|
+
!isReadonly2 && track(rawTarget, "get", key);
|
|
580
|
+
}
|
|
581
|
+
!isReadonly2 && track(rawTarget, "get", rawKey);
|
|
582
|
+
const { has: has2 } = getProto(rawTarget);
|
|
583
|
+
const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
584
|
+
if (has2.call(rawTarget, key)) {
|
|
585
|
+
return wrap(target.get(key));
|
|
586
|
+
} else if (has2.call(rawTarget, rawKey)) {
|
|
587
|
+
return wrap(target.get(rawKey));
|
|
588
|
+
} else if (target !== rawTarget) {
|
|
589
|
+
target.get(key);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
function has$1(key, isReadonly2 = false) {
|
|
593
|
+
const target = this["__v_raw"];
|
|
594
|
+
const rawTarget = toRaw(target);
|
|
595
|
+
const rawKey = toRaw(key);
|
|
596
|
+
if (key !== rawKey) {
|
|
597
|
+
!isReadonly2 && track(rawTarget, "has", key);
|
|
598
|
+
}
|
|
599
|
+
!isReadonly2 && track(rawTarget, "has", rawKey);
|
|
600
|
+
return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
|
|
601
|
+
}
|
|
602
|
+
function size(target, isReadonly2 = false) {
|
|
603
|
+
target = target["__v_raw"];
|
|
604
|
+
!isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
|
|
605
|
+
return Reflect.get(target, "size", target);
|
|
606
|
+
}
|
|
607
|
+
function add(value) {
|
|
608
|
+
value = toRaw(value);
|
|
609
|
+
const target = toRaw(this);
|
|
610
|
+
const proto = getProto(target);
|
|
611
|
+
const hadKey = proto.has.call(target, value);
|
|
612
|
+
if (!hadKey) {
|
|
613
|
+
target.add(value);
|
|
614
|
+
trigger(target, "add", value, value);
|
|
615
|
+
}
|
|
616
|
+
return this;
|
|
617
|
+
}
|
|
618
|
+
function set$1(key, value) {
|
|
619
|
+
value = toRaw(value);
|
|
620
|
+
const target = toRaw(this);
|
|
621
|
+
const { has: has2, get: get2 } = getProto(target);
|
|
622
|
+
let hadKey = has2.call(target, key);
|
|
623
|
+
if (!hadKey) {
|
|
624
|
+
key = toRaw(key);
|
|
625
|
+
hadKey = has2.call(target, key);
|
|
626
|
+
}
|
|
627
|
+
const oldValue = get2.call(target, key);
|
|
628
|
+
target.set(key, value);
|
|
629
|
+
if (!hadKey) {
|
|
630
|
+
trigger(target, "add", key, value);
|
|
631
|
+
} else if (hasChanged(value, oldValue)) {
|
|
632
|
+
trigger(target, "set", key, value);
|
|
633
|
+
}
|
|
634
|
+
return this;
|
|
635
|
+
}
|
|
636
|
+
function deleteEntry(key) {
|
|
637
|
+
const target = toRaw(this);
|
|
638
|
+
const { has: has2, get: get2 } = getProto(target);
|
|
639
|
+
let hadKey = has2.call(target, key);
|
|
640
|
+
if (!hadKey) {
|
|
641
|
+
key = toRaw(key);
|
|
642
|
+
hadKey = has2.call(target, key);
|
|
643
|
+
}
|
|
644
|
+
get2 ? get2.call(target, key) : void 0;
|
|
645
|
+
const result = target.delete(key);
|
|
646
|
+
if (hadKey) {
|
|
647
|
+
trigger(target, "delete", key, void 0);
|
|
648
|
+
}
|
|
649
|
+
return result;
|
|
650
|
+
}
|
|
651
|
+
function clear() {
|
|
652
|
+
const target = toRaw(this);
|
|
653
|
+
const hadItems = target.size !== 0;
|
|
654
|
+
const result = target.clear();
|
|
655
|
+
if (hadItems) {
|
|
656
|
+
trigger(target, "clear", void 0, void 0);
|
|
657
|
+
}
|
|
658
|
+
return result;
|
|
659
|
+
}
|
|
660
|
+
function createForEach(isReadonly2, isShallow) {
|
|
661
|
+
return function forEach(callback, thisArg) {
|
|
662
|
+
const observed = this;
|
|
663
|
+
const target = observed["__v_raw"];
|
|
664
|
+
const rawTarget = toRaw(target);
|
|
665
|
+
const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
666
|
+
!isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
|
|
667
|
+
return target.forEach((value, key) => {
|
|
668
|
+
return callback.call(thisArg, wrap(value), wrap(key), observed);
|
|
669
|
+
});
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
function createIterableMethod(method, isReadonly2, isShallow) {
|
|
673
|
+
return function(...args) {
|
|
674
|
+
const target = this["__v_raw"];
|
|
675
|
+
const rawTarget = toRaw(target);
|
|
676
|
+
const targetIsMap = isMap(rawTarget);
|
|
677
|
+
const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
|
|
678
|
+
const isKeyOnly = method === "keys" && targetIsMap;
|
|
679
|
+
const innerIterator = target[method](...args);
|
|
680
|
+
const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
681
|
+
!isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
|
|
682
|
+
return {
|
|
683
|
+
next() {
|
|
684
|
+
const { value, done } = innerIterator.next();
|
|
685
|
+
return done ? { value, done } : {
|
|
686
|
+
value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
|
|
687
|
+
done
|
|
688
|
+
};
|
|
689
|
+
},
|
|
690
|
+
[Symbol.iterator]() {
|
|
691
|
+
return this;
|
|
692
|
+
}
|
|
693
|
+
};
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
function createReadonlyMethod(type) {
|
|
697
|
+
return function(...args) {
|
|
698
|
+
return type === "delete" ? false : this;
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
function createInstrumentations() {
|
|
702
|
+
const mutableInstrumentations2 = {
|
|
703
|
+
get(key) {
|
|
704
|
+
return get$1(this, key);
|
|
705
|
+
},
|
|
706
|
+
get size() {
|
|
707
|
+
return size(this);
|
|
708
|
+
},
|
|
709
|
+
has: has$1,
|
|
710
|
+
add,
|
|
711
|
+
set: set$1,
|
|
712
|
+
delete: deleteEntry,
|
|
713
|
+
clear,
|
|
714
|
+
forEach: createForEach(false, false)
|
|
715
|
+
};
|
|
716
|
+
const shallowInstrumentations2 = {
|
|
717
|
+
get(key) {
|
|
718
|
+
return get$1(this, key, false, true);
|
|
719
|
+
},
|
|
720
|
+
get size() {
|
|
721
|
+
return size(this);
|
|
722
|
+
},
|
|
723
|
+
has: has$1,
|
|
724
|
+
add,
|
|
725
|
+
set: set$1,
|
|
726
|
+
delete: deleteEntry,
|
|
727
|
+
clear,
|
|
728
|
+
forEach: createForEach(false, true)
|
|
729
|
+
};
|
|
730
|
+
const readonlyInstrumentations2 = {
|
|
731
|
+
get(key) {
|
|
732
|
+
return get$1(this, key, true);
|
|
733
|
+
},
|
|
734
|
+
get size() {
|
|
735
|
+
return size(this, true);
|
|
736
|
+
},
|
|
737
|
+
has(key) {
|
|
738
|
+
return has$1.call(this, key, true);
|
|
739
|
+
},
|
|
740
|
+
add: createReadonlyMethod("add"),
|
|
741
|
+
set: createReadonlyMethod("set"),
|
|
742
|
+
delete: createReadonlyMethod("delete"),
|
|
743
|
+
clear: createReadonlyMethod("clear"),
|
|
744
|
+
forEach: createForEach(true, false)
|
|
745
|
+
};
|
|
746
|
+
const shallowReadonlyInstrumentations2 = {
|
|
747
|
+
get(key) {
|
|
748
|
+
return get$1(this, key, true, true);
|
|
749
|
+
},
|
|
750
|
+
get size() {
|
|
751
|
+
return size(this, true);
|
|
752
|
+
},
|
|
753
|
+
has(key) {
|
|
754
|
+
return has$1.call(this, key, true);
|
|
755
|
+
},
|
|
756
|
+
add: createReadonlyMethod("add"),
|
|
757
|
+
set: createReadonlyMethod("set"),
|
|
758
|
+
delete: createReadonlyMethod("delete"),
|
|
759
|
+
clear: createReadonlyMethod("clear"),
|
|
760
|
+
forEach: createForEach(true, true)
|
|
761
|
+
};
|
|
762
|
+
const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
|
|
763
|
+
iteratorMethods.forEach((method) => {
|
|
764
|
+
mutableInstrumentations2[method] = createIterableMethod(method, false, false);
|
|
765
|
+
readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
|
|
766
|
+
shallowInstrumentations2[method] = createIterableMethod(method, false, true);
|
|
767
|
+
shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true);
|
|
768
|
+
});
|
|
769
|
+
return [
|
|
770
|
+
mutableInstrumentations2,
|
|
771
|
+
readonlyInstrumentations2,
|
|
772
|
+
shallowInstrumentations2,
|
|
773
|
+
shallowReadonlyInstrumentations2
|
|
774
|
+
];
|
|
775
|
+
}
|
|
776
|
+
const [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations();
|
|
777
|
+
function createInstrumentationGetter(isReadonly2, shallow) {
|
|
778
|
+
const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
|
|
779
|
+
return (target, key, receiver) => {
|
|
780
|
+
if (key === "__v_isReactive") {
|
|
781
|
+
return !isReadonly2;
|
|
782
|
+
} else if (key === "__v_isReadonly") {
|
|
783
|
+
return isReadonly2;
|
|
784
|
+
} else if (key === "__v_raw") {
|
|
785
|
+
return target;
|
|
786
|
+
}
|
|
787
|
+
return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
const mutableCollectionHandlers = {
|
|
791
|
+
get: /* @__PURE__ */ createInstrumentationGetter(false, false)
|
|
792
|
+
};
|
|
793
|
+
const shallowCollectionHandlers = {
|
|
794
|
+
get: /* @__PURE__ */ createInstrumentationGetter(false, true)
|
|
795
|
+
};
|
|
796
|
+
const readonlyCollectionHandlers = {
|
|
797
|
+
get: /* @__PURE__ */ createInstrumentationGetter(true, false)
|
|
798
|
+
};
|
|
799
|
+
const reactiveMap = new WeakMap();
|
|
800
|
+
const shallowReactiveMap = new WeakMap();
|
|
801
|
+
const readonlyMap = new WeakMap();
|
|
802
|
+
const shallowReadonlyMap = new WeakMap();
|
|
803
|
+
function targetTypeMap(rawType) {
|
|
804
|
+
switch (rawType) {
|
|
805
|
+
case "Object":
|
|
806
|
+
case "Array":
|
|
807
|
+
return 1;
|
|
808
|
+
case "Map":
|
|
809
|
+
case "Set":
|
|
810
|
+
case "WeakMap":
|
|
811
|
+
case "WeakSet":
|
|
812
|
+
return 2;
|
|
813
|
+
default:
|
|
814
|
+
return 0;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
function getTargetType(value) {
|
|
818
|
+
return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
819
|
+
}
|
|
820
|
+
function reactive(target) {
|
|
821
|
+
if (target && target["__v_isReadonly"]) {
|
|
822
|
+
return target;
|
|
823
|
+
}
|
|
824
|
+
return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
|
|
825
|
+
}
|
|
826
|
+
function shallowReactive(target) {
|
|
827
|
+
return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
|
|
828
|
+
}
|
|
829
|
+
function readonly(target) {
|
|
830
|
+
return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
|
|
831
|
+
}
|
|
832
|
+
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
|
|
833
|
+
if (!isObject(target)) {
|
|
834
|
+
return target;
|
|
835
|
+
}
|
|
836
|
+
if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
|
|
837
|
+
return target;
|
|
838
|
+
}
|
|
839
|
+
const existingProxy = proxyMap.get(target);
|
|
840
|
+
if (existingProxy) {
|
|
841
|
+
return existingProxy;
|
|
842
|
+
}
|
|
843
|
+
const targetType = getTargetType(target);
|
|
844
|
+
if (targetType === 0) {
|
|
845
|
+
return target;
|
|
846
|
+
}
|
|
847
|
+
const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
|
|
848
|
+
proxyMap.set(target, proxy);
|
|
849
|
+
return proxy;
|
|
850
|
+
}
|
|
851
|
+
function isReactive(value) {
|
|
852
|
+
if (isReadonly(value)) {
|
|
853
|
+
return isReactive(value["__v_raw"]);
|
|
854
|
+
}
|
|
855
|
+
return !!(value && value["__v_isReactive"]);
|
|
856
|
+
}
|
|
857
|
+
function isReadonly(value) {
|
|
858
|
+
return !!(value && value["__v_isReadonly"]);
|
|
859
|
+
}
|
|
860
|
+
function isProxy(value) {
|
|
861
|
+
return isReactive(value) || isReadonly(value);
|
|
862
|
+
}
|
|
863
|
+
function toRaw(observed) {
|
|
864
|
+
const raw = observed && observed["__v_raw"];
|
|
865
|
+
return raw ? toRaw(raw) : observed;
|
|
866
|
+
}
|
|
867
|
+
function markRaw(value) {
|
|
868
|
+
def(value, "__v_skip", true);
|
|
869
|
+
return value;
|
|
870
|
+
}
|
|
871
|
+
const toReactive = (value) => isObject(value) ? reactive(value) : value;
|
|
872
|
+
const toReadonly = (value) => isObject(value) ? readonly(value) : value;
|
|
873
|
+
function trackRefValue(ref2) {
|
|
874
|
+
if (isTracking()) {
|
|
875
|
+
ref2 = toRaw(ref2);
|
|
876
|
+
if (!ref2.dep) {
|
|
877
|
+
ref2.dep = createDep();
|
|
878
|
+
}
|
|
879
|
+
{
|
|
880
|
+
trackEffects(ref2.dep);
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
function triggerRefValue(ref2, newVal) {
|
|
885
|
+
ref2 = toRaw(ref2);
|
|
886
|
+
if (ref2.dep) {
|
|
887
|
+
{
|
|
888
|
+
triggerEffects(ref2.dep);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
function isRef(r) {
|
|
893
|
+
return Boolean(r && r.__v_isRef === true);
|
|
894
|
+
}
|
|
895
|
+
function ref(value) {
|
|
896
|
+
return createRef(value, false);
|
|
897
|
+
}
|
|
898
|
+
function createRef(rawValue, shallow) {
|
|
899
|
+
if (isRef(rawValue)) {
|
|
900
|
+
return rawValue;
|
|
901
|
+
}
|
|
902
|
+
return new RefImpl(rawValue, shallow);
|
|
903
|
+
}
|
|
904
|
+
class RefImpl {
|
|
905
|
+
constructor(value, _shallow) {
|
|
906
|
+
this._shallow = _shallow;
|
|
907
|
+
this.dep = void 0;
|
|
908
|
+
this.__v_isRef = true;
|
|
909
|
+
this._rawValue = _shallow ? value : toRaw(value);
|
|
910
|
+
this._value = _shallow ? value : toReactive(value);
|
|
911
|
+
}
|
|
912
|
+
get value() {
|
|
913
|
+
trackRefValue(this);
|
|
914
|
+
return this._value;
|
|
915
|
+
}
|
|
916
|
+
set value(newVal) {
|
|
917
|
+
newVal = this._shallow ? newVal : toRaw(newVal);
|
|
918
|
+
if (hasChanged(newVal, this._rawValue)) {
|
|
919
|
+
this._rawValue = newVal;
|
|
920
|
+
this._value = this._shallow ? newVal : toReactive(newVal);
|
|
921
|
+
triggerRefValue(this);
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
function unref(ref2) {
|
|
926
|
+
return isRef(ref2) ? ref2.value : ref2;
|
|
927
|
+
}
|
|
928
|
+
const shallowUnwrapHandlers = {
|
|
929
|
+
get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
|
|
930
|
+
set: (target, key, value, receiver) => {
|
|
931
|
+
const oldValue = target[key];
|
|
932
|
+
if (isRef(oldValue) && !isRef(value)) {
|
|
933
|
+
oldValue.value = value;
|
|
934
|
+
return true;
|
|
935
|
+
} else {
|
|
936
|
+
return Reflect.set(target, key, value, receiver);
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
};
|
|
940
|
+
function proxyRefs(objectWithRefs) {
|
|
941
|
+
return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
|
|
942
|
+
}
|
|
943
|
+
class ComputedRefImpl {
|
|
944
|
+
constructor(getter, _setter, isReadonly2) {
|
|
945
|
+
this._setter = _setter;
|
|
946
|
+
this.dep = void 0;
|
|
947
|
+
this._dirty = true;
|
|
948
|
+
this.__v_isRef = true;
|
|
949
|
+
this.effect = new ReactiveEffect(getter, () => {
|
|
950
|
+
if (!this._dirty) {
|
|
951
|
+
this._dirty = true;
|
|
952
|
+
triggerRefValue(this);
|
|
953
|
+
}
|
|
954
|
+
});
|
|
955
|
+
this["__v_isReadonly"] = isReadonly2;
|
|
956
|
+
}
|
|
957
|
+
get value() {
|
|
958
|
+
const self2 = toRaw(this);
|
|
959
|
+
trackRefValue(self2);
|
|
960
|
+
if (self2._dirty) {
|
|
961
|
+
self2._dirty = false;
|
|
962
|
+
self2._value = self2.effect.run();
|
|
963
|
+
}
|
|
964
|
+
return self2._value;
|
|
965
|
+
}
|
|
966
|
+
set value(newValue) {
|
|
967
|
+
this._setter(newValue);
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
function computed(getterOrOptions, debugOptions) {
|
|
971
|
+
let getter;
|
|
972
|
+
let setter;
|
|
973
|
+
const onlyGetter = isFunction(getterOrOptions);
|
|
974
|
+
if (onlyGetter) {
|
|
975
|
+
getter = getterOrOptions;
|
|
976
|
+
setter = NOOP;
|
|
977
|
+
} else {
|
|
978
|
+
getter = getterOrOptions.get;
|
|
979
|
+
setter = getterOrOptions.set;
|
|
980
|
+
}
|
|
981
|
+
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter);
|
|
982
|
+
return cRef;
|
|
983
|
+
}
|
|
984
|
+
Promise.resolve();
|
|
985
|
+
function emit$1(instance, event, ...rawArgs) {
|
|
986
|
+
const props = instance.vnode.props || EMPTY_OBJ;
|
|
987
|
+
let args = rawArgs;
|
|
988
|
+
const isModelListener2 = event.startsWith("update:");
|
|
989
|
+
const modelArg = isModelListener2 && event.slice(7);
|
|
990
|
+
if (modelArg && modelArg in props) {
|
|
991
|
+
const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
|
|
992
|
+
const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
|
|
993
|
+
if (trim) {
|
|
994
|
+
args = rawArgs.map((a) => a.trim());
|
|
995
|
+
} else if (number) {
|
|
996
|
+
args = rawArgs.map(toNumber);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
let handlerName;
|
|
1000
|
+
let handler = props[handlerName = toHandlerKey(event)] || props[handlerName = toHandlerKey(camelize(event))];
|
|
1001
|
+
if (!handler && isModelListener2) {
|
|
1002
|
+
handler = props[handlerName = toHandlerKey(hyphenate(event))];
|
|
1003
|
+
}
|
|
1004
|
+
if (handler) {
|
|
1005
|
+
callWithAsyncErrorHandling(handler, instance, 6, args);
|
|
1006
|
+
}
|
|
1007
|
+
const onceHandler = props[handlerName + `Once`];
|
|
1008
|
+
if (onceHandler) {
|
|
1009
|
+
if (!instance.emitted) {
|
|
1010
|
+
instance.emitted = {};
|
|
1011
|
+
} else if (instance.emitted[handlerName]) {
|
|
1012
|
+
return;
|
|
1013
|
+
}
|
|
1014
|
+
instance.emitted[handlerName] = true;
|
|
1015
|
+
callWithAsyncErrorHandling(onceHandler, instance, 6, args);
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
1019
|
+
const cache = appContext.emitsCache;
|
|
1020
|
+
const cached = cache.get(comp);
|
|
1021
|
+
if (cached !== void 0) {
|
|
1022
|
+
return cached;
|
|
1023
|
+
}
|
|
1024
|
+
const raw = comp.emits;
|
|
1025
|
+
let normalized = {};
|
|
1026
|
+
let hasExtends = false;
|
|
1027
|
+
if (!isFunction(comp)) {
|
|
1028
|
+
const extendEmits = (raw2) => {
|
|
1029
|
+
const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
|
|
1030
|
+
if (normalizedFromExtend) {
|
|
1031
|
+
hasExtends = true;
|
|
1032
|
+
extend(normalized, normalizedFromExtend);
|
|
1033
|
+
}
|
|
1034
|
+
};
|
|
1035
|
+
if (!asMixin && appContext.mixins.length) {
|
|
1036
|
+
appContext.mixins.forEach(extendEmits);
|
|
1037
|
+
}
|
|
1038
|
+
if (comp.extends) {
|
|
1039
|
+
extendEmits(comp.extends);
|
|
1040
|
+
}
|
|
1041
|
+
if (comp.mixins) {
|
|
1042
|
+
comp.mixins.forEach(extendEmits);
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
if (!raw && !hasExtends) {
|
|
1046
|
+
cache.set(comp, null);
|
|
1047
|
+
return null;
|
|
1048
|
+
}
|
|
1049
|
+
if (isArray(raw)) {
|
|
1050
|
+
raw.forEach((key) => normalized[key] = null);
|
|
1051
|
+
} else {
|
|
1052
|
+
extend(normalized, raw);
|
|
1053
|
+
}
|
|
1054
|
+
cache.set(comp, normalized);
|
|
1055
|
+
return normalized;
|
|
1056
|
+
}
|
|
1057
|
+
function isEmitListener(options, key) {
|
|
1058
|
+
if (!options || !isOn(key)) {
|
|
1059
|
+
return false;
|
|
1060
|
+
}
|
|
1061
|
+
key = key.slice(2).replace(/Once$/, "");
|
|
1062
|
+
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
|
|
1063
|
+
}
|
|
1064
|
+
let currentRenderingInstance = null;
|
|
1065
|
+
let currentScopeId = null;
|
|
1066
|
+
function setCurrentRenderingInstance(instance) {
|
|
1067
|
+
const prev = currentRenderingInstance;
|
|
1068
|
+
currentRenderingInstance = instance;
|
|
1069
|
+
currentScopeId = instance && instance.type.__scopeId || null;
|
|
1070
|
+
return prev;
|
|
1071
|
+
}
|
|
1072
|
+
function pushScopeId(id) {
|
|
1073
|
+
currentScopeId = id;
|
|
1074
|
+
}
|
|
1075
|
+
function popScopeId() {
|
|
1076
|
+
currentScopeId = null;
|
|
1077
|
+
}
|
|
1078
|
+
function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
1079
|
+
if (!ctx)
|
|
1080
|
+
return fn;
|
|
1081
|
+
if (fn._n) {
|
|
1082
|
+
return fn;
|
|
1083
|
+
}
|
|
1084
|
+
const renderFnWithContext = (...args) => {
|
|
1085
|
+
if (renderFnWithContext._d) {
|
|
1086
|
+
setBlockTracking(-1);
|
|
1087
|
+
}
|
|
1088
|
+
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
1089
|
+
const res = fn(...args);
|
|
1090
|
+
setCurrentRenderingInstance(prevInstance);
|
|
1091
|
+
if (renderFnWithContext._d) {
|
|
1092
|
+
setBlockTracking(1);
|
|
1093
|
+
}
|
|
1094
|
+
return res;
|
|
1095
|
+
};
|
|
1096
|
+
renderFnWithContext._n = true;
|
|
1097
|
+
renderFnWithContext._c = true;
|
|
1098
|
+
renderFnWithContext._d = true;
|
|
1099
|
+
return renderFnWithContext;
|
|
1100
|
+
}
|
|
1101
|
+
function markAttrsAccessed() {
|
|
1102
|
+
}
|
|
1103
|
+
function renderComponentRoot(instance) {
|
|
1104
|
+
const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render: render2, renderCache, data, setupState, ctx, inheritAttrs } = instance;
|
|
1105
|
+
let result;
|
|
1106
|
+
let fallthroughAttrs;
|
|
1107
|
+
const prev = setCurrentRenderingInstance(instance);
|
|
1108
|
+
try {
|
|
1109
|
+
if (vnode.shapeFlag & 4) {
|
|
1110
|
+
const proxyToUse = withProxy || proxy;
|
|
1111
|
+
result = normalizeVNode(render2.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx));
|
|
1112
|
+
fallthroughAttrs = attrs;
|
|
1113
|
+
} else {
|
|
1114
|
+
const render3 = Component;
|
|
1115
|
+
if (false)
|
|
1116
|
+
;
|
|
1117
|
+
result = normalizeVNode(render3.length > 1 ? render3(props, false ? {
|
|
1118
|
+
get attrs() {
|
|
1119
|
+
markAttrsAccessed();
|
|
1120
|
+
return attrs;
|
|
1121
|
+
},
|
|
1122
|
+
slots,
|
|
1123
|
+
emit
|
|
1124
|
+
} : { attrs, slots, emit }) : render3(props, null));
|
|
1125
|
+
fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
|
|
1126
|
+
}
|
|
1127
|
+
} catch (err) {
|
|
1128
|
+
blockStack.length = 0;
|
|
1129
|
+
handleError(err, instance, 1);
|
|
1130
|
+
result = createVNode(Comment);
|
|
1131
|
+
}
|
|
1132
|
+
let root = result;
|
|
1133
|
+
if (fallthroughAttrs && inheritAttrs !== false) {
|
|
1134
|
+
const keys = Object.keys(fallthroughAttrs);
|
|
1135
|
+
const { shapeFlag } = root;
|
|
1136
|
+
if (keys.length) {
|
|
1137
|
+
if (shapeFlag & (1 | 6)) {
|
|
1138
|
+
if (propsOptions && keys.some(isModelListener)) {
|
|
1139
|
+
fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
|
|
1140
|
+
}
|
|
1141
|
+
root = cloneVNode(root, fallthroughAttrs);
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
if (vnode.dirs) {
|
|
1146
|
+
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
1147
|
+
}
|
|
1148
|
+
if (vnode.transition) {
|
|
1149
|
+
root.transition = vnode.transition;
|
|
1150
|
+
}
|
|
1151
|
+
{
|
|
1152
|
+
result = root;
|
|
1153
|
+
}
|
|
1154
|
+
setCurrentRenderingInstance(prev);
|
|
1155
|
+
return result;
|
|
1156
|
+
}
|
|
1157
|
+
const getFunctionalFallthrough = (attrs) => {
|
|
1158
|
+
let res;
|
|
1159
|
+
for (const key in attrs) {
|
|
1160
|
+
if (key === "class" || key === "style" || isOn(key)) {
|
|
1161
|
+
(res || (res = {}))[key] = attrs[key];
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
return res;
|
|
1165
|
+
};
|
|
1166
|
+
const filterModelListeners = (attrs, props) => {
|
|
1167
|
+
const res = {};
|
|
1168
|
+
for (const key in attrs) {
|
|
1169
|
+
if (!isModelListener(key) || !(key.slice(9) in props)) {
|
|
1170
|
+
res[key] = attrs[key];
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
return res;
|
|
1174
|
+
};
|
|
1175
|
+
function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
|
|
1176
|
+
const { props: prevProps, children: prevChildren, component } = prevVNode;
|
|
1177
|
+
const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
|
|
1178
|
+
const emits = component.emitsOptions;
|
|
1179
|
+
if (nextVNode.dirs || nextVNode.transition) {
|
|
1180
|
+
return true;
|
|
1181
|
+
}
|
|
1182
|
+
if (optimized && patchFlag >= 0) {
|
|
1183
|
+
if (patchFlag & 1024) {
|
|
1184
|
+
return true;
|
|
1185
|
+
}
|
|
1186
|
+
if (patchFlag & 16) {
|
|
1187
|
+
if (!prevProps) {
|
|
1188
|
+
return !!nextProps;
|
|
1189
|
+
}
|
|
1190
|
+
return hasPropsChanged(prevProps, nextProps, emits);
|
|
1191
|
+
} else if (patchFlag & 8) {
|
|
1192
|
+
const dynamicProps = nextVNode.dynamicProps;
|
|
1193
|
+
for (let i = 0; i < dynamicProps.length; i++) {
|
|
1194
|
+
const key = dynamicProps[i];
|
|
1195
|
+
if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
|
|
1196
|
+
return true;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
} else {
|
|
1201
|
+
if (prevChildren || nextChildren) {
|
|
1202
|
+
if (!nextChildren || !nextChildren.$stable) {
|
|
1203
|
+
return true;
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
if (prevProps === nextProps) {
|
|
1207
|
+
return false;
|
|
1208
|
+
}
|
|
1209
|
+
if (!prevProps) {
|
|
1210
|
+
return !!nextProps;
|
|
1211
|
+
}
|
|
1212
|
+
if (!nextProps) {
|
|
1213
|
+
return true;
|
|
1214
|
+
}
|
|
1215
|
+
return hasPropsChanged(prevProps, nextProps, emits);
|
|
1216
|
+
}
|
|
1217
|
+
return false;
|
|
1218
|
+
}
|
|
1219
|
+
function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
1220
|
+
const nextKeys = Object.keys(nextProps);
|
|
1221
|
+
if (nextKeys.length !== Object.keys(prevProps).length) {
|
|
1222
|
+
return true;
|
|
1223
|
+
}
|
|
1224
|
+
for (let i = 0; i < nextKeys.length; i++) {
|
|
1225
|
+
const key = nextKeys[i];
|
|
1226
|
+
if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
|
|
1227
|
+
return true;
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
return false;
|
|
1231
|
+
}
|
|
1232
|
+
function updateHOCHostEl({ vnode, parent }, el) {
|
|
1233
|
+
while (parent && parent.subTree === vnode) {
|
|
1234
|
+
(vnode = parent.vnode).el = el;
|
|
1235
|
+
parent = parent.parent;
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
const isSuspense = (type) => type.__isSuspense;
|
|
1239
|
+
function queueEffectWithSuspense(fn, suspense) {
|
|
1240
|
+
if (suspense && suspense.pendingBranch) {
|
|
1241
|
+
if (isArray(fn)) {
|
|
1242
|
+
suspense.effects.push(...fn);
|
|
1243
|
+
} else {
|
|
1244
|
+
suspense.effects.push(fn);
|
|
1245
|
+
}
|
|
1246
|
+
} else {
|
|
1247
|
+
queuePostFlushCb(fn);
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
function provide(key, value) {
|
|
1251
|
+
if (!currentInstance)
|
|
1252
|
+
;
|
|
1253
|
+
else {
|
|
1254
|
+
let provides = currentInstance.provides;
|
|
1255
|
+
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
1256
|
+
if (parentProvides === provides) {
|
|
1257
|
+
provides = currentInstance.provides = Object.create(parentProvides);
|
|
1258
|
+
}
|
|
1259
|
+
provides[key] = value;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
1263
|
+
const instance = currentInstance || currentRenderingInstance;
|
|
1264
|
+
if (instance) {
|
|
1265
|
+
const provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides;
|
|
1266
|
+
if (provides && key in provides) {
|
|
1267
|
+
return provides[key];
|
|
1268
|
+
} else if (arguments.length > 1) {
|
|
1269
|
+
return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance.proxy) : defaultValue;
|
|
1270
|
+
} else
|
|
1271
|
+
;
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
function useTransitionState() {
|
|
1275
|
+
const state = {
|
|
1276
|
+
isMounted: false,
|
|
1277
|
+
isLeaving: false,
|
|
1278
|
+
isUnmounting: false,
|
|
1279
|
+
leavingVNodes: new Map()
|
|
1280
|
+
};
|
|
1281
|
+
onMounted(() => {
|
|
1282
|
+
state.isMounted = true;
|
|
1283
|
+
});
|
|
1284
|
+
onBeforeUnmount(() => {
|
|
1285
|
+
state.isUnmounting = true;
|
|
1286
|
+
});
|
|
1287
|
+
return state;
|
|
1288
|
+
}
|
|
1289
|
+
const TransitionHookValidator = [Function, Array];
|
|
1290
|
+
const BaseTransitionImpl = {
|
|
1291
|
+
name: `BaseTransition`,
|
|
1292
|
+
props: {
|
|
1293
|
+
mode: String,
|
|
1294
|
+
appear: Boolean,
|
|
1295
|
+
persisted: Boolean,
|
|
1296
|
+
onBeforeEnter: TransitionHookValidator,
|
|
1297
|
+
onEnter: TransitionHookValidator,
|
|
1298
|
+
onAfterEnter: TransitionHookValidator,
|
|
1299
|
+
onEnterCancelled: TransitionHookValidator,
|
|
1300
|
+
onBeforeLeave: TransitionHookValidator,
|
|
1301
|
+
onLeave: TransitionHookValidator,
|
|
1302
|
+
onAfterLeave: TransitionHookValidator,
|
|
1303
|
+
onLeaveCancelled: TransitionHookValidator,
|
|
1304
|
+
onBeforeAppear: TransitionHookValidator,
|
|
1305
|
+
onAppear: TransitionHookValidator,
|
|
1306
|
+
onAfterAppear: TransitionHookValidator,
|
|
1307
|
+
onAppearCancelled: TransitionHookValidator
|
|
1308
|
+
},
|
|
1309
|
+
setup(props, { slots }) {
|
|
1310
|
+
const instance = getCurrentInstance();
|
|
1311
|
+
const state = useTransitionState();
|
|
1312
|
+
let prevTransitionKey;
|
|
1313
|
+
return () => {
|
|
1314
|
+
const children = slots.default && getTransitionRawChildren(slots.default(), true);
|
|
1315
|
+
if (!children || !children.length) {
|
|
1316
|
+
return;
|
|
1317
|
+
}
|
|
1318
|
+
const rawProps = toRaw(props);
|
|
1319
|
+
const { mode } = rawProps;
|
|
1320
|
+
const child = children[0];
|
|
1321
|
+
if (state.isLeaving) {
|
|
1322
|
+
return emptyPlaceholder(child);
|
|
1323
|
+
}
|
|
1324
|
+
const innerChild = getKeepAliveChild(child);
|
|
1325
|
+
if (!innerChild) {
|
|
1326
|
+
return emptyPlaceholder(child);
|
|
1327
|
+
}
|
|
1328
|
+
const enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance);
|
|
1329
|
+
setTransitionHooks(innerChild, enterHooks);
|
|
1330
|
+
const oldChild = instance.subTree;
|
|
1331
|
+
const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
|
|
1332
|
+
let transitionKeyChanged = false;
|
|
1333
|
+
const { getTransitionKey } = innerChild.type;
|
|
1334
|
+
if (getTransitionKey) {
|
|
1335
|
+
const key = getTransitionKey();
|
|
1336
|
+
if (prevTransitionKey === void 0) {
|
|
1337
|
+
prevTransitionKey = key;
|
|
1338
|
+
} else if (key !== prevTransitionKey) {
|
|
1339
|
+
prevTransitionKey = key;
|
|
1340
|
+
transitionKeyChanged = true;
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
if (oldInnerChild && oldInnerChild.type !== Comment && (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) {
|
|
1344
|
+
const leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
|
|
1345
|
+
setTransitionHooks(oldInnerChild, leavingHooks);
|
|
1346
|
+
if (mode === "out-in") {
|
|
1347
|
+
state.isLeaving = true;
|
|
1348
|
+
leavingHooks.afterLeave = () => {
|
|
1349
|
+
state.isLeaving = false;
|
|
1350
|
+
instance.update();
|
|
1351
|
+
};
|
|
1352
|
+
return emptyPlaceholder(child);
|
|
1353
|
+
} else if (mode === "in-out" && innerChild.type !== Comment) {
|
|
1354
|
+
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
1355
|
+
const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
|
|
1356
|
+
leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
|
|
1357
|
+
el._leaveCb = () => {
|
|
1358
|
+
earlyRemove();
|
|
1359
|
+
el._leaveCb = void 0;
|
|
1360
|
+
delete enterHooks.delayedLeave;
|
|
1361
|
+
};
|
|
1362
|
+
enterHooks.delayedLeave = delayedLeave;
|
|
1363
|
+
};
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
return child;
|
|
1367
|
+
};
|
|
1368
|
+
}
|
|
1369
|
+
};
|
|
1370
|
+
const BaseTransition = BaseTransitionImpl;
|
|
1371
|
+
function getLeavingNodesForType(state, vnode) {
|
|
1372
|
+
const { leavingVNodes } = state;
|
|
1373
|
+
let leavingVNodesCache = leavingVNodes.get(vnode.type);
|
|
1374
|
+
if (!leavingVNodesCache) {
|
|
1375
|
+
leavingVNodesCache = Object.create(null);
|
|
1376
|
+
leavingVNodes.set(vnode.type, leavingVNodesCache);
|
|
1377
|
+
}
|
|
1378
|
+
return leavingVNodesCache;
|
|
1379
|
+
}
|
|
1380
|
+
function resolveTransitionHooks(vnode, props, state, instance) {
|
|
1381
|
+
const { appear, mode, persisted = false, onBeforeEnter, onEnter, onAfterEnter, onEnterCancelled, onBeforeLeave, onLeave, onAfterLeave, onLeaveCancelled, onBeforeAppear, onAppear, onAfterAppear, onAppearCancelled } = props;
|
|
1382
|
+
const key = String(vnode.key);
|
|
1383
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
1384
|
+
const callHook2 = (hook, args) => {
|
|
1385
|
+
hook && callWithAsyncErrorHandling(hook, instance, 9, args);
|
|
1386
|
+
};
|
|
1387
|
+
const hooks = {
|
|
1388
|
+
mode,
|
|
1389
|
+
persisted,
|
|
1390
|
+
beforeEnter(el) {
|
|
1391
|
+
let hook = onBeforeEnter;
|
|
1392
|
+
if (!state.isMounted) {
|
|
1393
|
+
if (appear) {
|
|
1394
|
+
hook = onBeforeAppear || onBeforeEnter;
|
|
1395
|
+
} else {
|
|
1396
|
+
return;
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
if (el._leaveCb) {
|
|
1400
|
+
el._leaveCb(true);
|
|
1401
|
+
}
|
|
1402
|
+
const leavingVNode = leavingVNodesCache[key];
|
|
1403
|
+
if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el._leaveCb) {
|
|
1404
|
+
leavingVNode.el._leaveCb();
|
|
1405
|
+
}
|
|
1406
|
+
callHook2(hook, [el]);
|
|
1407
|
+
},
|
|
1408
|
+
enter(el) {
|
|
1409
|
+
let hook = onEnter;
|
|
1410
|
+
let afterHook = onAfterEnter;
|
|
1411
|
+
let cancelHook = onEnterCancelled;
|
|
1412
|
+
if (!state.isMounted) {
|
|
1413
|
+
if (appear) {
|
|
1414
|
+
hook = onAppear || onEnter;
|
|
1415
|
+
afterHook = onAfterAppear || onAfterEnter;
|
|
1416
|
+
cancelHook = onAppearCancelled || onEnterCancelled;
|
|
1417
|
+
} else {
|
|
1418
|
+
return;
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
let called = false;
|
|
1422
|
+
const done = el._enterCb = (cancelled) => {
|
|
1423
|
+
if (called)
|
|
1424
|
+
return;
|
|
1425
|
+
called = true;
|
|
1426
|
+
if (cancelled) {
|
|
1427
|
+
callHook2(cancelHook, [el]);
|
|
1428
|
+
} else {
|
|
1429
|
+
callHook2(afterHook, [el]);
|
|
1430
|
+
}
|
|
1431
|
+
if (hooks.delayedLeave) {
|
|
1432
|
+
hooks.delayedLeave();
|
|
1433
|
+
}
|
|
1434
|
+
el._enterCb = void 0;
|
|
1435
|
+
};
|
|
1436
|
+
if (hook) {
|
|
1437
|
+
hook(el, done);
|
|
1438
|
+
if (hook.length <= 1) {
|
|
1439
|
+
done();
|
|
1440
|
+
}
|
|
1441
|
+
} else {
|
|
1442
|
+
done();
|
|
1443
|
+
}
|
|
1444
|
+
},
|
|
1445
|
+
leave(el, remove2) {
|
|
1446
|
+
const key2 = String(vnode.key);
|
|
1447
|
+
if (el._enterCb) {
|
|
1448
|
+
el._enterCb(true);
|
|
1449
|
+
}
|
|
1450
|
+
if (state.isUnmounting) {
|
|
1451
|
+
return remove2();
|
|
1452
|
+
}
|
|
1453
|
+
callHook2(onBeforeLeave, [el]);
|
|
1454
|
+
let called = false;
|
|
1455
|
+
const done = el._leaveCb = (cancelled) => {
|
|
1456
|
+
if (called)
|
|
1457
|
+
return;
|
|
1458
|
+
called = true;
|
|
1459
|
+
remove2();
|
|
1460
|
+
if (cancelled) {
|
|
1461
|
+
callHook2(onLeaveCancelled, [el]);
|
|
1462
|
+
} else {
|
|
1463
|
+
callHook2(onAfterLeave, [el]);
|
|
1464
|
+
}
|
|
1465
|
+
el._leaveCb = void 0;
|
|
1466
|
+
if (leavingVNodesCache[key2] === vnode) {
|
|
1467
|
+
delete leavingVNodesCache[key2];
|
|
1468
|
+
}
|
|
1469
|
+
};
|
|
1470
|
+
leavingVNodesCache[key2] = vnode;
|
|
1471
|
+
if (onLeave) {
|
|
1472
|
+
onLeave(el, done);
|
|
1473
|
+
if (onLeave.length <= 1) {
|
|
1474
|
+
done();
|
|
1475
|
+
}
|
|
1476
|
+
} else {
|
|
1477
|
+
done();
|
|
1478
|
+
}
|
|
1479
|
+
},
|
|
1480
|
+
clone(vnode2) {
|
|
1481
|
+
return resolveTransitionHooks(vnode2, props, state, instance);
|
|
1482
|
+
}
|
|
1483
|
+
};
|
|
1484
|
+
return hooks;
|
|
1485
|
+
}
|
|
1486
|
+
function emptyPlaceholder(vnode) {
|
|
1487
|
+
if (isKeepAlive(vnode)) {
|
|
1488
|
+
vnode = cloneVNode(vnode);
|
|
1489
|
+
vnode.children = null;
|
|
1490
|
+
return vnode;
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
function getKeepAliveChild(vnode) {
|
|
1494
|
+
return isKeepAlive(vnode) ? vnode.children ? vnode.children[0] : void 0 : vnode;
|
|
1495
|
+
}
|
|
1496
|
+
function setTransitionHooks(vnode, hooks) {
|
|
1497
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
1498
|
+
setTransitionHooks(vnode.component.subTree, hooks);
|
|
1499
|
+
} else if (vnode.shapeFlag & 128) {
|
|
1500
|
+
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1501
|
+
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1502
|
+
} else {
|
|
1503
|
+
vnode.transition = hooks;
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
function getTransitionRawChildren(children, keepComment = false) {
|
|
1507
|
+
let ret = [];
|
|
1508
|
+
let keyedFragmentCount = 0;
|
|
1509
|
+
for (let i = 0; i < children.length; i++) {
|
|
1510
|
+
const child = children[i];
|
|
1511
|
+
if (child.type === Fragment) {
|
|
1512
|
+
if (child.patchFlag & 128)
|
|
1513
|
+
keyedFragmentCount++;
|
|
1514
|
+
ret = ret.concat(getTransitionRawChildren(child.children, keepComment));
|
|
1515
|
+
} else if (keepComment || child.type !== Comment) {
|
|
1516
|
+
ret.push(child);
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
if (keyedFragmentCount > 1) {
|
|
1520
|
+
for (let i = 0; i < ret.length; i++) {
|
|
1521
|
+
ret[i].patchFlag = -2;
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
return ret;
|
|
1525
|
+
}
|
|
1526
|
+
function defineComponent(options) {
|
|
1527
|
+
return isFunction(options) ? { setup: options, name: options.name } : options;
|
|
1528
|
+
}
|
|
1529
|
+
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
1530
|
+
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
|
|
1531
|
+
function onActivated(hook, target) {
|
|
1532
|
+
registerKeepAliveHook(hook, "a", target);
|
|
1533
|
+
}
|
|
1534
|
+
function onDeactivated(hook, target) {
|
|
1535
|
+
registerKeepAliveHook(hook, "da", target);
|
|
1536
|
+
}
|
|
1537
|
+
function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
1538
|
+
const wrappedHook = hook.__wdc || (hook.__wdc = () => {
|
|
1539
|
+
let current = target;
|
|
1540
|
+
while (current) {
|
|
1541
|
+
if (current.isDeactivated) {
|
|
1542
|
+
return;
|
|
1543
|
+
}
|
|
1544
|
+
current = current.parent;
|
|
1545
|
+
}
|
|
1546
|
+
return hook();
|
|
1547
|
+
});
|
|
1548
|
+
injectHook(type, wrappedHook, target);
|
|
1549
|
+
if (target) {
|
|
1550
|
+
let current = target.parent;
|
|
1551
|
+
while (current && current.parent) {
|
|
1552
|
+
if (isKeepAlive(current.parent.vnode)) {
|
|
1553
|
+
injectToKeepAliveRoot(wrappedHook, type, target, current);
|
|
1554
|
+
}
|
|
1555
|
+
current = current.parent;
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
1560
|
+
const injected = injectHook(type, hook, keepAliveRoot, true);
|
|
1561
|
+
onUnmounted(() => {
|
|
1562
|
+
remove(keepAliveRoot[type], injected);
|
|
1563
|
+
}, target);
|
|
1564
|
+
}
|
|
1565
|
+
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
1566
|
+
if (target) {
|
|
1567
|
+
const hooks = target[type] || (target[type] = []);
|
|
1568
|
+
const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
|
|
1569
|
+
if (target.isUnmounted) {
|
|
1570
|
+
return;
|
|
1571
|
+
}
|
|
1572
|
+
pauseTracking();
|
|
1573
|
+
setCurrentInstance(target);
|
|
1574
|
+
const res = callWithAsyncErrorHandling(hook, target, type, args);
|
|
1575
|
+
unsetCurrentInstance();
|
|
1576
|
+
resetTracking();
|
|
1577
|
+
return res;
|
|
1578
|
+
});
|
|
1579
|
+
if (prepend) {
|
|
1580
|
+
hooks.unshift(wrappedHook);
|
|
1581
|
+
} else {
|
|
1582
|
+
hooks.push(wrappedHook);
|
|
1583
|
+
}
|
|
1584
|
+
return wrappedHook;
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
const createHook = (lifecycle) => (hook, target = currentInstance) => (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, hook, target);
|
|
1588
|
+
const onBeforeMount = createHook("bm");
|
|
1589
|
+
const onMounted = createHook("m");
|
|
1590
|
+
const onBeforeUpdate = createHook("bu");
|
|
1591
|
+
const onUpdated = createHook("u");
|
|
1592
|
+
const onBeforeUnmount = createHook("bum");
|
|
1593
|
+
const onUnmounted = createHook("um");
|
|
1594
|
+
const onServerPrefetch = createHook("sp");
|
|
1595
|
+
const onRenderTriggered = createHook("rtg");
|
|
1596
|
+
const onRenderTracked = createHook("rtc");
|
|
1597
|
+
function onErrorCaptured(hook, target = currentInstance) {
|
|
1598
|
+
injectHook("ec", hook, target);
|
|
1599
|
+
}
|
|
1600
|
+
let shouldCacheAccess = true;
|
|
1601
|
+
function applyOptions(instance) {
|
|
1602
|
+
const options = resolveMergedOptions(instance);
|
|
1603
|
+
const publicThis = instance.proxy;
|
|
1604
|
+
const ctx = instance.ctx;
|
|
1605
|
+
shouldCacheAccess = false;
|
|
1606
|
+
if (options.beforeCreate) {
|
|
1607
|
+
callHook(options.beforeCreate, instance, "bc");
|
|
1608
|
+
}
|
|
1609
|
+
const {
|
|
1610
|
+
data: dataOptions,
|
|
1611
|
+
computed: computedOptions,
|
|
1612
|
+
methods,
|
|
1613
|
+
watch: watchOptions,
|
|
1614
|
+
provide: provideOptions,
|
|
1615
|
+
inject: injectOptions,
|
|
1616
|
+
created,
|
|
1617
|
+
beforeMount,
|
|
1618
|
+
mounted,
|
|
1619
|
+
beforeUpdate,
|
|
1620
|
+
updated,
|
|
1621
|
+
activated,
|
|
1622
|
+
deactivated,
|
|
1623
|
+
beforeDestroy,
|
|
1624
|
+
beforeUnmount,
|
|
1625
|
+
destroyed,
|
|
1626
|
+
unmounted,
|
|
1627
|
+
render: render2,
|
|
1628
|
+
renderTracked,
|
|
1629
|
+
renderTriggered,
|
|
1630
|
+
errorCaptured,
|
|
1631
|
+
serverPrefetch,
|
|
1632
|
+
expose,
|
|
1633
|
+
inheritAttrs,
|
|
1634
|
+
components: components2,
|
|
1635
|
+
directives,
|
|
1636
|
+
filters
|
|
1637
|
+
} = options;
|
|
1638
|
+
const checkDuplicateProperties = null;
|
|
1639
|
+
if (injectOptions) {
|
|
1640
|
+
resolveInjections(injectOptions, ctx, checkDuplicateProperties, instance.appContext.config.unwrapInjectedRef);
|
|
1641
|
+
}
|
|
1642
|
+
if (methods) {
|
|
1643
|
+
for (const key in methods) {
|
|
1644
|
+
const methodHandler = methods[key];
|
|
1645
|
+
if (isFunction(methodHandler)) {
|
|
1646
|
+
{
|
|
1647
|
+
ctx[key] = methodHandler.bind(publicThis);
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
if (dataOptions) {
|
|
1653
|
+
const data = dataOptions.call(publicThis, publicThis);
|
|
1654
|
+
if (!isObject(data))
|
|
1655
|
+
;
|
|
1656
|
+
else {
|
|
1657
|
+
instance.data = reactive(data);
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
shouldCacheAccess = true;
|
|
1661
|
+
if (computedOptions) {
|
|
1662
|
+
for (const key in computedOptions) {
|
|
1663
|
+
const opt = computedOptions[key];
|
|
1664
|
+
const get2 = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
|
|
1665
|
+
const set2 = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : NOOP;
|
|
1666
|
+
const c = computed({
|
|
1667
|
+
get: get2,
|
|
1668
|
+
set: set2
|
|
1669
|
+
});
|
|
1670
|
+
Object.defineProperty(ctx, key, {
|
|
1671
|
+
enumerable: true,
|
|
1672
|
+
configurable: true,
|
|
1673
|
+
get: () => c.value,
|
|
1674
|
+
set: (v) => c.value = v
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
if (watchOptions) {
|
|
1679
|
+
for (const key in watchOptions) {
|
|
1680
|
+
createWatcher(watchOptions[key], ctx, publicThis, key);
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
if (provideOptions) {
|
|
1684
|
+
const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
|
|
1685
|
+
Reflect.ownKeys(provides).forEach((key) => {
|
|
1686
|
+
provide(key, provides[key]);
|
|
1687
|
+
});
|
|
1688
|
+
}
|
|
1689
|
+
if (created) {
|
|
1690
|
+
callHook(created, instance, "c");
|
|
1691
|
+
}
|
|
1692
|
+
function registerLifecycleHook(register, hook) {
|
|
1693
|
+
if (isArray(hook)) {
|
|
1694
|
+
hook.forEach((_hook) => register(_hook.bind(publicThis)));
|
|
1695
|
+
} else if (hook) {
|
|
1696
|
+
register(hook.bind(publicThis));
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
registerLifecycleHook(onBeforeMount, beforeMount);
|
|
1700
|
+
registerLifecycleHook(onMounted, mounted);
|
|
1701
|
+
registerLifecycleHook(onBeforeUpdate, beforeUpdate);
|
|
1702
|
+
registerLifecycleHook(onUpdated, updated);
|
|
1703
|
+
registerLifecycleHook(onActivated, activated);
|
|
1704
|
+
registerLifecycleHook(onDeactivated, deactivated);
|
|
1705
|
+
registerLifecycleHook(onErrorCaptured, errorCaptured);
|
|
1706
|
+
registerLifecycleHook(onRenderTracked, renderTracked);
|
|
1707
|
+
registerLifecycleHook(onRenderTriggered, renderTriggered);
|
|
1708
|
+
registerLifecycleHook(onBeforeUnmount, beforeUnmount);
|
|
1709
|
+
registerLifecycleHook(onUnmounted, unmounted);
|
|
1710
|
+
registerLifecycleHook(onServerPrefetch, serverPrefetch);
|
|
1711
|
+
if (isArray(expose)) {
|
|
1712
|
+
if (expose.length) {
|
|
1713
|
+
const exposed = instance.exposed || (instance.exposed = {});
|
|
1714
|
+
expose.forEach((key) => {
|
|
1715
|
+
Object.defineProperty(exposed, key, {
|
|
1716
|
+
get: () => publicThis[key],
|
|
1717
|
+
set: (val) => publicThis[key] = val
|
|
1718
|
+
});
|
|
1719
|
+
});
|
|
1720
|
+
} else if (!instance.exposed) {
|
|
1721
|
+
instance.exposed = {};
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
if (render2 && instance.render === NOOP) {
|
|
1725
|
+
instance.render = render2;
|
|
1726
|
+
}
|
|
1727
|
+
if (inheritAttrs != null) {
|
|
1728
|
+
instance.inheritAttrs = inheritAttrs;
|
|
1729
|
+
}
|
|
1730
|
+
if (components2)
|
|
1731
|
+
instance.components = components2;
|
|
1732
|
+
if (directives)
|
|
1733
|
+
instance.directives = directives;
|
|
1734
|
+
}
|
|
1735
|
+
function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP, unwrapRef = false) {
|
|
1736
|
+
if (isArray(injectOptions)) {
|
|
1737
|
+
injectOptions = normalizeInject(injectOptions);
|
|
1738
|
+
}
|
|
1739
|
+
for (const key in injectOptions) {
|
|
1740
|
+
const opt = injectOptions[key];
|
|
1741
|
+
let injected;
|
|
1742
|
+
if (isObject(opt)) {
|
|
1743
|
+
if ("default" in opt) {
|
|
1744
|
+
injected = inject(opt.from || key, opt.default, true);
|
|
1745
|
+
} else {
|
|
1746
|
+
injected = inject(opt.from || key);
|
|
1747
|
+
}
|
|
1748
|
+
} else {
|
|
1749
|
+
injected = inject(opt);
|
|
1750
|
+
}
|
|
1751
|
+
if (isRef(injected)) {
|
|
1752
|
+
if (unwrapRef) {
|
|
1753
|
+
Object.defineProperty(ctx, key, {
|
|
1754
|
+
enumerable: true,
|
|
1755
|
+
configurable: true,
|
|
1756
|
+
get: () => injected.value,
|
|
1757
|
+
set: (v) => injected.value = v
|
|
1758
|
+
});
|
|
1759
|
+
} else {
|
|
1760
|
+
ctx[key] = injected;
|
|
1761
|
+
}
|
|
1762
|
+
} else {
|
|
1763
|
+
ctx[key] = injected;
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
function callHook(hook, instance, type) {
|
|
1768
|
+
callWithAsyncErrorHandling(isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy), instance, type);
|
|
1769
|
+
}
|
|
1770
|
+
function createWatcher(raw, ctx, publicThis, key) {
|
|
1771
|
+
const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
|
|
1772
|
+
if (isString(raw)) {
|
|
1773
|
+
const handler = ctx[raw];
|
|
1774
|
+
if (isFunction(handler)) {
|
|
1775
|
+
watch(getter, handler);
|
|
1776
|
+
}
|
|
1777
|
+
} else if (isFunction(raw)) {
|
|
1778
|
+
watch(getter, raw.bind(publicThis));
|
|
1779
|
+
} else if (isObject(raw)) {
|
|
1780
|
+
if (isArray(raw)) {
|
|
1781
|
+
raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
1782
|
+
} else {
|
|
1783
|
+
const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
1784
|
+
if (isFunction(handler)) {
|
|
1785
|
+
watch(getter, handler, raw);
|
|
1786
|
+
}
|
|
1787
|
+
}
|
|
1788
|
+
} else
|
|
1789
|
+
;
|
|
1790
|
+
}
|
|
1791
|
+
function resolveMergedOptions(instance) {
|
|
1792
|
+
const base = instance.type;
|
|
1793
|
+
const { mixins, extends: extendsOptions } = base;
|
|
1794
|
+
const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext;
|
|
1795
|
+
const cached = cache.get(base);
|
|
1796
|
+
let resolved;
|
|
1797
|
+
if (cached) {
|
|
1798
|
+
resolved = cached;
|
|
1799
|
+
} else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
1800
|
+
{
|
|
1801
|
+
resolved = base;
|
|
1802
|
+
}
|
|
1803
|
+
} else {
|
|
1804
|
+
resolved = {};
|
|
1805
|
+
if (globalMixins.length) {
|
|
1806
|
+
globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true));
|
|
1807
|
+
}
|
|
1808
|
+
mergeOptions(resolved, base, optionMergeStrategies);
|
|
1809
|
+
}
|
|
1810
|
+
cache.set(base, resolved);
|
|
1811
|
+
return resolved;
|
|
1812
|
+
}
|
|
1813
|
+
function mergeOptions(to, from, strats, asMixin = false) {
|
|
1814
|
+
const { mixins, extends: extendsOptions } = from;
|
|
1815
|
+
if (extendsOptions) {
|
|
1816
|
+
mergeOptions(to, extendsOptions, strats, true);
|
|
1817
|
+
}
|
|
1818
|
+
if (mixins) {
|
|
1819
|
+
mixins.forEach((m) => mergeOptions(to, m, strats, true));
|
|
1820
|
+
}
|
|
1821
|
+
for (const key in from) {
|
|
1822
|
+
if (asMixin && key === "expose")
|
|
1823
|
+
;
|
|
1824
|
+
else {
|
|
1825
|
+
const strat = internalOptionMergeStrats[key] || strats && strats[key];
|
|
1826
|
+
to[key] = strat ? strat(to[key], from[key]) : from[key];
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
return to;
|
|
1830
|
+
}
|
|
1831
|
+
const internalOptionMergeStrats = {
|
|
1832
|
+
data: mergeDataFn,
|
|
1833
|
+
props: mergeObjectOptions,
|
|
1834
|
+
emits: mergeObjectOptions,
|
|
1835
|
+
methods: mergeObjectOptions,
|
|
1836
|
+
computed: mergeObjectOptions,
|
|
1837
|
+
beforeCreate: mergeAsArray,
|
|
1838
|
+
created: mergeAsArray,
|
|
1839
|
+
beforeMount: mergeAsArray,
|
|
1840
|
+
mounted: mergeAsArray,
|
|
1841
|
+
beforeUpdate: mergeAsArray,
|
|
1842
|
+
updated: mergeAsArray,
|
|
1843
|
+
beforeDestroy: mergeAsArray,
|
|
1844
|
+
beforeUnmount: mergeAsArray,
|
|
1845
|
+
destroyed: mergeAsArray,
|
|
1846
|
+
unmounted: mergeAsArray,
|
|
1847
|
+
activated: mergeAsArray,
|
|
1848
|
+
deactivated: mergeAsArray,
|
|
1849
|
+
errorCaptured: mergeAsArray,
|
|
1850
|
+
serverPrefetch: mergeAsArray,
|
|
1851
|
+
components: mergeObjectOptions,
|
|
1852
|
+
directives: mergeObjectOptions,
|
|
1853
|
+
watch: mergeWatchOptions,
|
|
1854
|
+
provide: mergeDataFn,
|
|
1855
|
+
inject: mergeInject
|
|
1856
|
+
};
|
|
1857
|
+
function mergeDataFn(to, from) {
|
|
1858
|
+
if (!from) {
|
|
1859
|
+
return to;
|
|
1860
|
+
}
|
|
1861
|
+
if (!to) {
|
|
1862
|
+
return from;
|
|
1863
|
+
}
|
|
1864
|
+
return function mergedDataFn() {
|
|
1865
|
+
return extend(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
|
|
1866
|
+
};
|
|
1867
|
+
}
|
|
1868
|
+
function mergeInject(to, from) {
|
|
1869
|
+
return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
|
|
1870
|
+
}
|
|
1871
|
+
function normalizeInject(raw) {
|
|
1872
|
+
if (isArray(raw)) {
|
|
1873
|
+
const res = {};
|
|
1874
|
+
for (let i = 0; i < raw.length; i++) {
|
|
1875
|
+
res[raw[i]] = raw[i];
|
|
1876
|
+
}
|
|
1877
|
+
return res;
|
|
1878
|
+
}
|
|
1879
|
+
return raw;
|
|
1880
|
+
}
|
|
1881
|
+
function mergeAsArray(to, from) {
|
|
1882
|
+
return to ? [...new Set([].concat(to, from))] : from;
|
|
1883
|
+
}
|
|
1884
|
+
function mergeObjectOptions(to, from) {
|
|
1885
|
+
return to ? extend(extend(Object.create(null), to), from) : from;
|
|
1886
|
+
}
|
|
1887
|
+
function mergeWatchOptions(to, from) {
|
|
1888
|
+
if (!to)
|
|
1889
|
+
return from;
|
|
1890
|
+
if (!from)
|
|
1891
|
+
return to;
|
|
1892
|
+
const merged = extend(Object.create(null), to);
|
|
1893
|
+
for (const key in from) {
|
|
1894
|
+
merged[key] = mergeAsArray(to[key], from[key]);
|
|
1895
|
+
}
|
|
1896
|
+
return merged;
|
|
1897
|
+
}
|
|
1898
|
+
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
1899
|
+
const props = {};
|
|
1900
|
+
const attrs = {};
|
|
1901
|
+
def(attrs, InternalObjectKey, 1);
|
|
1902
|
+
instance.propsDefaults = Object.create(null);
|
|
1903
|
+
setFullProps(instance, rawProps, props, attrs);
|
|
1904
|
+
for (const key in instance.propsOptions[0]) {
|
|
1905
|
+
if (!(key in props)) {
|
|
1906
|
+
props[key] = void 0;
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
if (isStateful) {
|
|
1910
|
+
instance.props = isSSR ? props : shallowReactive(props);
|
|
1911
|
+
} else {
|
|
1912
|
+
if (!instance.type.props) {
|
|
1913
|
+
instance.props = attrs;
|
|
1914
|
+
} else {
|
|
1915
|
+
instance.props = props;
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
instance.attrs = attrs;
|
|
1919
|
+
}
|
|
1920
|
+
function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
1921
|
+
const { props, attrs, vnode: { patchFlag } } = instance;
|
|
1922
|
+
const rawCurrentProps = toRaw(props);
|
|
1923
|
+
const [options] = instance.propsOptions;
|
|
1924
|
+
let hasAttrsChanged = false;
|
|
1925
|
+
if ((optimized || patchFlag > 0) && !(patchFlag & 16)) {
|
|
1926
|
+
if (patchFlag & 8) {
|
|
1927
|
+
const propsToUpdate = instance.vnode.dynamicProps;
|
|
1928
|
+
for (let i = 0; i < propsToUpdate.length; i++) {
|
|
1929
|
+
let key = propsToUpdate[i];
|
|
1930
|
+
const value = rawProps[key];
|
|
1931
|
+
if (options) {
|
|
1932
|
+
if (hasOwn(attrs, key)) {
|
|
1933
|
+
if (value !== attrs[key]) {
|
|
1934
|
+
attrs[key] = value;
|
|
1935
|
+
hasAttrsChanged = true;
|
|
1936
|
+
}
|
|
1937
|
+
} else {
|
|
1938
|
+
const camelizedKey = camelize(key);
|
|
1939
|
+
props[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance, false);
|
|
1940
|
+
}
|
|
1941
|
+
} else {
|
|
1942
|
+
if (value !== attrs[key]) {
|
|
1943
|
+
attrs[key] = value;
|
|
1944
|
+
hasAttrsChanged = true;
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
} else {
|
|
1950
|
+
if (setFullProps(instance, rawProps, props, attrs)) {
|
|
1951
|
+
hasAttrsChanged = true;
|
|
1952
|
+
}
|
|
1953
|
+
let kebabKey;
|
|
1954
|
+
for (const key in rawCurrentProps) {
|
|
1955
|
+
if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
|
|
1956
|
+
if (options) {
|
|
1957
|
+
if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) {
|
|
1958
|
+
props[key] = resolvePropValue(options, rawCurrentProps, key, void 0, instance, true);
|
|
1959
|
+
}
|
|
1960
|
+
} else {
|
|
1961
|
+
delete props[key];
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
if (attrs !== rawCurrentProps) {
|
|
1966
|
+
for (const key in attrs) {
|
|
1967
|
+
if (!rawProps || !hasOwn(rawProps, key)) {
|
|
1968
|
+
delete attrs[key];
|
|
1969
|
+
hasAttrsChanged = true;
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
if (hasAttrsChanged) {
|
|
1975
|
+
trigger(instance, "set", "$attrs");
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
function setFullProps(instance, rawProps, props, attrs) {
|
|
1979
|
+
const [options, needCastKeys] = instance.propsOptions;
|
|
1980
|
+
let hasAttrsChanged = false;
|
|
1981
|
+
let rawCastValues;
|
|
1982
|
+
if (rawProps) {
|
|
1983
|
+
for (let key in rawProps) {
|
|
1984
|
+
if (isReservedProp(key)) {
|
|
1985
|
+
continue;
|
|
1986
|
+
}
|
|
1987
|
+
const value = rawProps[key];
|
|
1988
|
+
let camelKey;
|
|
1989
|
+
if (options && hasOwn(options, camelKey = camelize(key))) {
|
|
1990
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) {
|
|
1991
|
+
props[camelKey] = value;
|
|
1992
|
+
} else {
|
|
1993
|
+
(rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
1994
|
+
}
|
|
1995
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
1996
|
+
if (!(key in attrs) || value !== attrs[key]) {
|
|
1997
|
+
attrs[key] = value;
|
|
1998
|
+
hasAttrsChanged = true;
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
if (needCastKeys) {
|
|
2004
|
+
const rawCurrentProps = toRaw(props);
|
|
2005
|
+
const castValues = rawCastValues || EMPTY_OBJ;
|
|
2006
|
+
for (let i = 0; i < needCastKeys.length; i++) {
|
|
2007
|
+
const key = needCastKeys[i];
|
|
2008
|
+
props[key] = resolvePropValue(options, rawCurrentProps, key, castValues[key], instance, !hasOwn(castValues, key));
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
return hasAttrsChanged;
|
|
2012
|
+
}
|
|
2013
|
+
function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
2014
|
+
const opt = options[key];
|
|
2015
|
+
if (opt != null) {
|
|
2016
|
+
const hasDefault = hasOwn(opt, "default");
|
|
2017
|
+
if (hasDefault && value === void 0) {
|
|
2018
|
+
const defaultValue = opt.default;
|
|
2019
|
+
if (opt.type !== Function && isFunction(defaultValue)) {
|
|
2020
|
+
const { propsDefaults } = instance;
|
|
2021
|
+
if (key in propsDefaults) {
|
|
2022
|
+
value = propsDefaults[key];
|
|
2023
|
+
} else {
|
|
2024
|
+
setCurrentInstance(instance);
|
|
2025
|
+
value = propsDefaults[key] = defaultValue.call(null, props);
|
|
2026
|
+
unsetCurrentInstance();
|
|
2027
|
+
}
|
|
2028
|
+
} else {
|
|
2029
|
+
value = defaultValue;
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
if (opt[0]) {
|
|
2033
|
+
if (isAbsent && !hasDefault) {
|
|
2034
|
+
value = false;
|
|
2035
|
+
} else if (opt[1] && (value === "" || value === hyphenate(key))) {
|
|
2036
|
+
value = true;
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
return value;
|
|
2041
|
+
}
|
|
2042
|
+
function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
2043
|
+
const cache = appContext.propsCache;
|
|
2044
|
+
const cached = cache.get(comp);
|
|
2045
|
+
if (cached) {
|
|
2046
|
+
return cached;
|
|
2047
|
+
}
|
|
2048
|
+
const raw = comp.props;
|
|
2049
|
+
const normalized = {};
|
|
2050
|
+
const needCastKeys = [];
|
|
2051
|
+
let hasExtends = false;
|
|
2052
|
+
if (!isFunction(comp)) {
|
|
2053
|
+
const extendProps = (raw2) => {
|
|
2054
|
+
hasExtends = true;
|
|
2055
|
+
const [props, keys] = normalizePropsOptions(raw2, appContext, true);
|
|
2056
|
+
extend(normalized, props);
|
|
2057
|
+
if (keys)
|
|
2058
|
+
needCastKeys.push(...keys);
|
|
2059
|
+
};
|
|
2060
|
+
if (!asMixin && appContext.mixins.length) {
|
|
2061
|
+
appContext.mixins.forEach(extendProps);
|
|
2062
|
+
}
|
|
2063
|
+
if (comp.extends) {
|
|
2064
|
+
extendProps(comp.extends);
|
|
2065
|
+
}
|
|
2066
|
+
if (comp.mixins) {
|
|
2067
|
+
comp.mixins.forEach(extendProps);
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
if (!raw && !hasExtends) {
|
|
2071
|
+
cache.set(comp, EMPTY_ARR);
|
|
2072
|
+
return EMPTY_ARR;
|
|
2073
|
+
}
|
|
2074
|
+
if (isArray(raw)) {
|
|
2075
|
+
for (let i = 0; i < raw.length; i++) {
|
|
2076
|
+
const normalizedKey = camelize(raw[i]);
|
|
2077
|
+
if (validatePropName(normalizedKey)) {
|
|
2078
|
+
normalized[normalizedKey] = EMPTY_OBJ;
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
} else if (raw) {
|
|
2082
|
+
for (const key in raw) {
|
|
2083
|
+
const normalizedKey = camelize(key);
|
|
2084
|
+
if (validatePropName(normalizedKey)) {
|
|
2085
|
+
const opt = raw[key];
|
|
2086
|
+
const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : opt;
|
|
2087
|
+
if (prop) {
|
|
2088
|
+
const booleanIndex = getTypeIndex(Boolean, prop.type);
|
|
2089
|
+
const stringIndex = getTypeIndex(String, prop.type);
|
|
2090
|
+
prop[0] = booleanIndex > -1;
|
|
2091
|
+
prop[1] = stringIndex < 0 || booleanIndex < stringIndex;
|
|
2092
|
+
if (booleanIndex > -1 || hasOwn(prop, "default")) {
|
|
2093
|
+
needCastKeys.push(normalizedKey);
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
const res = [normalized, needCastKeys];
|
|
2100
|
+
cache.set(comp, res);
|
|
2101
|
+
return res;
|
|
2102
|
+
}
|
|
2103
|
+
function validatePropName(key) {
|
|
2104
|
+
if (key[0] !== "$") {
|
|
2105
|
+
return true;
|
|
2106
|
+
}
|
|
2107
|
+
return false;
|
|
2108
|
+
}
|
|
2109
|
+
function getType(ctor) {
|
|
2110
|
+
const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
|
|
2111
|
+
return match ? match[1] : ctor === null ? "null" : "";
|
|
2112
|
+
}
|
|
2113
|
+
function isSameType(a, b) {
|
|
2114
|
+
return getType(a) === getType(b);
|
|
2115
|
+
}
|
|
2116
|
+
function getTypeIndex(type, expectedTypes) {
|
|
2117
|
+
if (isArray(expectedTypes)) {
|
|
2118
|
+
return expectedTypes.findIndex((t) => isSameType(t, type));
|
|
2119
|
+
} else if (isFunction(expectedTypes)) {
|
|
2120
|
+
return isSameType(expectedTypes, type) ? 0 : -1;
|
|
2121
|
+
}
|
|
2122
|
+
return -1;
|
|
2123
|
+
}
|
|
2124
|
+
const isInternalKey = (key) => key[0] === "_" || key === "$stable";
|
|
2125
|
+
const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
|
|
2126
|
+
const normalizeSlot = (key, rawSlot, ctx) => {
|
|
2127
|
+
const normalized = withCtx((...args) => {
|
|
2128
|
+
return normalizeSlotValue(rawSlot(...args));
|
|
2129
|
+
}, ctx);
|
|
2130
|
+
normalized._c = false;
|
|
2131
|
+
return normalized;
|
|
2132
|
+
};
|
|
2133
|
+
const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
2134
|
+
const ctx = rawSlots._ctx;
|
|
2135
|
+
for (const key in rawSlots) {
|
|
2136
|
+
if (isInternalKey(key))
|
|
2137
|
+
continue;
|
|
2138
|
+
const value = rawSlots[key];
|
|
2139
|
+
if (isFunction(value)) {
|
|
2140
|
+
slots[key] = normalizeSlot(key, value, ctx);
|
|
2141
|
+
} else if (value != null) {
|
|
2142
|
+
const normalized = normalizeSlotValue(value);
|
|
2143
|
+
slots[key] = () => normalized;
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
};
|
|
2147
|
+
const normalizeVNodeSlots = (instance, children) => {
|
|
2148
|
+
const normalized = normalizeSlotValue(children);
|
|
2149
|
+
instance.slots.default = () => normalized;
|
|
2150
|
+
};
|
|
2151
|
+
const initSlots = (instance, children) => {
|
|
2152
|
+
if (instance.vnode.shapeFlag & 32) {
|
|
2153
|
+
const type = children._;
|
|
2154
|
+
if (type) {
|
|
2155
|
+
instance.slots = toRaw(children);
|
|
2156
|
+
def(children, "_", type);
|
|
2157
|
+
} else {
|
|
2158
|
+
normalizeObjectSlots(children, instance.slots = {});
|
|
2159
|
+
}
|
|
2160
|
+
} else {
|
|
2161
|
+
instance.slots = {};
|
|
2162
|
+
if (children) {
|
|
2163
|
+
normalizeVNodeSlots(instance, children);
|
|
2164
|
+
}
|
|
2165
|
+
}
|
|
2166
|
+
def(instance.slots, InternalObjectKey, 1);
|
|
2167
|
+
};
|
|
2168
|
+
const updateSlots = (instance, children, optimized) => {
|
|
2169
|
+
const { vnode, slots } = instance;
|
|
2170
|
+
let needDeletionCheck = true;
|
|
2171
|
+
let deletionComparisonTarget = EMPTY_OBJ;
|
|
2172
|
+
if (vnode.shapeFlag & 32) {
|
|
2173
|
+
const type = children._;
|
|
2174
|
+
if (type) {
|
|
2175
|
+
if (optimized && type === 1) {
|
|
2176
|
+
needDeletionCheck = false;
|
|
2177
|
+
} else {
|
|
2178
|
+
extend(slots, children);
|
|
2179
|
+
if (!optimized && type === 1) {
|
|
2180
|
+
delete slots._;
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
} else {
|
|
2184
|
+
needDeletionCheck = !children.$stable;
|
|
2185
|
+
normalizeObjectSlots(children, slots);
|
|
2186
|
+
}
|
|
2187
|
+
deletionComparisonTarget = children;
|
|
2188
|
+
} else if (children) {
|
|
2189
|
+
normalizeVNodeSlots(instance, children);
|
|
2190
|
+
deletionComparisonTarget = { default: 1 };
|
|
2191
|
+
}
|
|
2192
|
+
if (needDeletionCheck) {
|
|
2193
|
+
for (const key in slots) {
|
|
2194
|
+
if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {
|
|
2195
|
+
delete slots[key];
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
};
|
|
2200
|
+
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
2201
|
+
const bindings = vnode.dirs;
|
|
2202
|
+
const oldBindings = prevVNode && prevVNode.dirs;
|
|
2203
|
+
for (let i = 0; i < bindings.length; i++) {
|
|
2204
|
+
const binding = bindings[i];
|
|
2205
|
+
if (oldBindings) {
|
|
2206
|
+
binding.oldValue = oldBindings[i].value;
|
|
2207
|
+
}
|
|
2208
|
+
let hook = binding.dir[name];
|
|
2209
|
+
if (hook) {
|
|
2210
|
+
pauseTracking();
|
|
2211
|
+
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
2212
|
+
vnode.el,
|
|
2213
|
+
binding,
|
|
2214
|
+
vnode,
|
|
2215
|
+
prevVNode
|
|
2216
|
+
]);
|
|
2217
|
+
resetTracking();
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
function createAppContext() {
|
|
2222
|
+
return {
|
|
2223
|
+
app: null,
|
|
2224
|
+
config: {
|
|
2225
|
+
isNativeTag: NO,
|
|
2226
|
+
performance: false,
|
|
2227
|
+
globalProperties: {},
|
|
2228
|
+
optionMergeStrategies: {},
|
|
2229
|
+
errorHandler: void 0,
|
|
2230
|
+
warnHandler: void 0,
|
|
2231
|
+
compilerOptions: {}
|
|
2232
|
+
},
|
|
2233
|
+
mixins: [],
|
|
2234
|
+
components: {},
|
|
2235
|
+
directives: {},
|
|
2236
|
+
provides: Object.create(null),
|
|
2237
|
+
optionsCache: new WeakMap(),
|
|
2238
|
+
propsCache: new WeakMap(),
|
|
2239
|
+
emitsCache: new WeakMap()
|
|
2240
|
+
};
|
|
2241
|
+
}
|
|
2242
|
+
let uid = 0;
|
|
2243
|
+
function createAppAPI(render2, hydrate) {
|
|
2244
|
+
return function createApp2(rootComponent, rootProps = null) {
|
|
2245
|
+
if (rootProps != null && !isObject(rootProps)) {
|
|
2246
|
+
rootProps = null;
|
|
2247
|
+
}
|
|
2248
|
+
const context = createAppContext();
|
|
2249
|
+
const installedPlugins = new Set();
|
|
2250
|
+
let isMounted = false;
|
|
2251
|
+
const app = context.app = {
|
|
2252
|
+
_uid: uid++,
|
|
2253
|
+
_component: rootComponent,
|
|
2254
|
+
_props: rootProps,
|
|
2255
|
+
_container: null,
|
|
2256
|
+
_context: context,
|
|
2257
|
+
_instance: null,
|
|
2258
|
+
version,
|
|
2259
|
+
get config() {
|
|
2260
|
+
return context.config;
|
|
2261
|
+
},
|
|
2262
|
+
set config(v) {
|
|
2263
|
+
},
|
|
2264
|
+
use(plugin, ...options) {
|
|
2265
|
+
if (installedPlugins.has(plugin))
|
|
2266
|
+
;
|
|
2267
|
+
else if (plugin && isFunction(plugin.install)) {
|
|
2268
|
+
installedPlugins.add(plugin);
|
|
2269
|
+
plugin.install(app, ...options);
|
|
2270
|
+
} else if (isFunction(plugin)) {
|
|
2271
|
+
installedPlugins.add(plugin);
|
|
2272
|
+
plugin(app, ...options);
|
|
2273
|
+
} else
|
|
2274
|
+
;
|
|
2275
|
+
return app;
|
|
2276
|
+
},
|
|
2277
|
+
mixin(mixin) {
|
|
2278
|
+
{
|
|
2279
|
+
if (!context.mixins.includes(mixin)) {
|
|
2280
|
+
context.mixins.push(mixin);
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
return app;
|
|
2284
|
+
},
|
|
2285
|
+
component(name, component) {
|
|
2286
|
+
if (!component) {
|
|
2287
|
+
return context.components[name];
|
|
2288
|
+
}
|
|
2289
|
+
context.components[name] = component;
|
|
2290
|
+
return app;
|
|
2291
|
+
},
|
|
2292
|
+
directive(name, directive) {
|
|
2293
|
+
if (!directive) {
|
|
2294
|
+
return context.directives[name];
|
|
2295
|
+
}
|
|
2296
|
+
context.directives[name] = directive;
|
|
2297
|
+
return app;
|
|
2298
|
+
},
|
|
2299
|
+
mount(rootContainer, isHydrate, isSVG) {
|
|
2300
|
+
if (!isMounted) {
|
|
2301
|
+
const vnode = createVNode(rootComponent, rootProps);
|
|
2302
|
+
vnode.appContext = context;
|
|
2303
|
+
if (isHydrate && hydrate) {
|
|
2304
|
+
hydrate(vnode, rootContainer);
|
|
2305
|
+
} else {
|
|
2306
|
+
render2(vnode, rootContainer, isSVG);
|
|
2307
|
+
}
|
|
2308
|
+
isMounted = true;
|
|
2309
|
+
app._container = rootContainer;
|
|
2310
|
+
rootContainer.__vue_app__ = app;
|
|
2311
|
+
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
2312
|
+
}
|
|
2313
|
+
},
|
|
2314
|
+
unmount() {
|
|
2315
|
+
if (isMounted) {
|
|
2316
|
+
render2(null, app._container);
|
|
2317
|
+
delete app._container.__vue_app__;
|
|
2318
|
+
}
|
|
2319
|
+
},
|
|
2320
|
+
provide(key, value) {
|
|
2321
|
+
context.provides[key] = value;
|
|
2322
|
+
return app;
|
|
2323
|
+
}
|
|
2324
|
+
};
|
|
2325
|
+
return app;
|
|
2326
|
+
};
|
|
2327
|
+
}
|
|
2328
|
+
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
2329
|
+
if (isArray(rawRef)) {
|
|
2330
|
+
rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));
|
|
2331
|
+
return;
|
|
2332
|
+
}
|
|
2333
|
+
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
2334
|
+
return;
|
|
2335
|
+
}
|
|
2336
|
+
const refValue = vnode.shapeFlag & 4 ? getExposeProxy(vnode.component) || vnode.component.proxy : vnode.el;
|
|
2337
|
+
const value = isUnmount ? null : refValue;
|
|
2338
|
+
const { i: owner, r: ref2 } = rawRef;
|
|
2339
|
+
const oldRef = oldRawRef && oldRawRef.r;
|
|
2340
|
+
const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
|
|
2341
|
+
const setupState = owner.setupState;
|
|
2342
|
+
if (oldRef != null && oldRef !== ref2) {
|
|
2343
|
+
if (isString(oldRef)) {
|
|
2344
|
+
refs[oldRef] = null;
|
|
2345
|
+
if (hasOwn(setupState, oldRef)) {
|
|
2346
|
+
setupState[oldRef] = null;
|
|
2347
|
+
}
|
|
2348
|
+
} else if (isRef(oldRef)) {
|
|
2349
|
+
oldRef.value = null;
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
if (isFunction(ref2)) {
|
|
2353
|
+
callWithErrorHandling(ref2, owner, 12, [value, refs]);
|
|
2354
|
+
} else {
|
|
2355
|
+
const _isString = isString(ref2);
|
|
2356
|
+
const _isRef = isRef(ref2);
|
|
2357
|
+
if (_isString || _isRef) {
|
|
2358
|
+
const doSet = () => {
|
|
2359
|
+
if (rawRef.f) {
|
|
2360
|
+
const existing = _isString ? refs[ref2] : ref2.value;
|
|
2361
|
+
if (isUnmount) {
|
|
2362
|
+
isArray(existing) && remove(existing, refValue);
|
|
2363
|
+
} else {
|
|
2364
|
+
if (!isArray(existing)) {
|
|
2365
|
+
if (_isString) {
|
|
2366
|
+
refs[ref2] = [refValue];
|
|
2367
|
+
} else {
|
|
2368
|
+
ref2.value = [refValue];
|
|
2369
|
+
if (rawRef.k)
|
|
2370
|
+
refs[rawRef.k] = ref2.value;
|
|
2371
|
+
}
|
|
2372
|
+
} else if (!existing.includes(refValue)) {
|
|
2373
|
+
existing.push(refValue);
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
} else if (_isString) {
|
|
2377
|
+
refs[ref2] = value;
|
|
2378
|
+
if (hasOwn(setupState, ref2)) {
|
|
2379
|
+
setupState[ref2] = value;
|
|
2380
|
+
}
|
|
2381
|
+
} else if (isRef(ref2)) {
|
|
2382
|
+
ref2.value = value;
|
|
2383
|
+
if (rawRef.k)
|
|
2384
|
+
refs[rawRef.k] = value;
|
|
2385
|
+
} else
|
|
2386
|
+
;
|
|
2387
|
+
};
|
|
2388
|
+
if (value) {
|
|
2389
|
+
doSet.id = -1;
|
|
2390
|
+
queuePostRenderEffect(doSet, parentSuspense);
|
|
2391
|
+
} else {
|
|
2392
|
+
doSet();
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
const queuePostRenderEffect = queueEffectWithSuspense;
|
|
2398
|
+
function createRenderer(options) {
|
|
2399
|
+
return baseCreateRenderer(options);
|
|
2400
|
+
}
|
|
2401
|
+
function baseCreateRenderer(options, createHydrationFns) {
|
|
2402
|
+
const target = getGlobalThis();
|
|
2403
|
+
target.__VUE__ = true;
|
|
2404
|
+
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent } = options;
|
|
2405
|
+
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
|
|
2406
|
+
if (n1 === n2) {
|
|
2407
|
+
return;
|
|
2408
|
+
}
|
|
2409
|
+
if (n1 && !isSameVNodeType(n1, n2)) {
|
|
2410
|
+
anchor = getNextHostNode(n1);
|
|
2411
|
+
unmount(n1, parentComponent, parentSuspense, true);
|
|
2412
|
+
n1 = null;
|
|
2413
|
+
}
|
|
2414
|
+
if (n2.patchFlag === -2) {
|
|
2415
|
+
optimized = false;
|
|
2416
|
+
n2.dynamicChildren = null;
|
|
2417
|
+
}
|
|
2418
|
+
const { type, ref: ref2, shapeFlag } = n2;
|
|
2419
|
+
switch (type) {
|
|
2420
|
+
case Text:
|
|
2421
|
+
processText(n1, n2, container, anchor);
|
|
2422
|
+
break;
|
|
2423
|
+
case Comment:
|
|
2424
|
+
processCommentNode(n1, n2, container, anchor);
|
|
2425
|
+
break;
|
|
2426
|
+
case Static:
|
|
2427
|
+
if (n1 == null) {
|
|
2428
|
+
mountStaticNode(n2, container, anchor, isSVG);
|
|
2429
|
+
}
|
|
2430
|
+
break;
|
|
2431
|
+
case Fragment:
|
|
2432
|
+
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2433
|
+
break;
|
|
2434
|
+
default:
|
|
2435
|
+
if (shapeFlag & 1) {
|
|
2436
|
+
processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2437
|
+
} else if (shapeFlag & 6) {
|
|
2438
|
+
processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2439
|
+
} else if (shapeFlag & 64) {
|
|
2440
|
+
type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
|
|
2441
|
+
} else if (shapeFlag & 128) {
|
|
2442
|
+
type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
|
|
2443
|
+
} else
|
|
2444
|
+
;
|
|
2445
|
+
}
|
|
2446
|
+
if (ref2 != null && parentComponent) {
|
|
2447
|
+
setRef(ref2, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
|
|
2448
|
+
}
|
|
2449
|
+
};
|
|
2450
|
+
const processText = (n1, n2, container, anchor) => {
|
|
2451
|
+
if (n1 == null) {
|
|
2452
|
+
hostInsert(n2.el = hostCreateText(n2.children), container, anchor);
|
|
2453
|
+
} else {
|
|
2454
|
+
const el = n2.el = n1.el;
|
|
2455
|
+
if (n2.children !== n1.children) {
|
|
2456
|
+
hostSetText(el, n2.children);
|
|
2457
|
+
}
|
|
2458
|
+
}
|
|
2459
|
+
};
|
|
2460
|
+
const processCommentNode = (n1, n2, container, anchor) => {
|
|
2461
|
+
if (n1 == null) {
|
|
2462
|
+
hostInsert(n2.el = hostCreateComment(n2.children || ""), container, anchor);
|
|
2463
|
+
} else {
|
|
2464
|
+
n2.el = n1.el;
|
|
2465
|
+
}
|
|
2466
|
+
};
|
|
2467
|
+
const mountStaticNode = (n2, container, anchor, isSVG) => {
|
|
2468
|
+
[n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG);
|
|
2469
|
+
};
|
|
2470
|
+
const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
|
|
2471
|
+
let next;
|
|
2472
|
+
while (el && el !== anchor) {
|
|
2473
|
+
next = hostNextSibling(el);
|
|
2474
|
+
hostInsert(el, container, nextSibling);
|
|
2475
|
+
el = next;
|
|
2476
|
+
}
|
|
2477
|
+
hostInsert(anchor, container, nextSibling);
|
|
2478
|
+
};
|
|
2479
|
+
const removeStaticNode = ({ el, anchor }) => {
|
|
2480
|
+
let next;
|
|
2481
|
+
while (el && el !== anchor) {
|
|
2482
|
+
next = hostNextSibling(el);
|
|
2483
|
+
hostRemove(el);
|
|
2484
|
+
el = next;
|
|
2485
|
+
}
|
|
2486
|
+
hostRemove(anchor);
|
|
2487
|
+
};
|
|
2488
|
+
const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
|
|
2489
|
+
isSVG = isSVG || n2.type === "svg";
|
|
2490
|
+
if (n1 == null) {
|
|
2491
|
+
mountElement(n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2492
|
+
} else {
|
|
2493
|
+
patchElement(n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2494
|
+
}
|
|
2495
|
+
};
|
|
2496
|
+
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
|
|
2497
|
+
let el;
|
|
2498
|
+
let vnodeHook;
|
|
2499
|
+
const { type, props, shapeFlag, transition, patchFlag, dirs } = vnode;
|
|
2500
|
+
if (vnode.el && hostCloneNode !== void 0 && patchFlag === -1) {
|
|
2501
|
+
el = vnode.el = hostCloneNode(vnode.el);
|
|
2502
|
+
} else {
|
|
2503
|
+
el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props);
|
|
2504
|
+
if (shapeFlag & 8) {
|
|
2505
|
+
hostSetElementText(el, vnode.children);
|
|
2506
|
+
} else if (shapeFlag & 16) {
|
|
2507
|
+
mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== "foreignObject", slotScopeIds, optimized);
|
|
2508
|
+
}
|
|
2509
|
+
if (dirs) {
|
|
2510
|
+
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
2511
|
+
}
|
|
2512
|
+
if (props) {
|
|
2513
|
+
for (const key in props) {
|
|
2514
|
+
if (key !== "value" && !isReservedProp(key)) {
|
|
2515
|
+
hostPatchProp(el, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
2516
|
+
}
|
|
2517
|
+
}
|
|
2518
|
+
if ("value" in props) {
|
|
2519
|
+
hostPatchProp(el, "value", null, props.value);
|
|
2520
|
+
}
|
|
2521
|
+
if (vnodeHook = props.onVnodeBeforeMount) {
|
|
2522
|
+
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
2526
|
+
}
|
|
2527
|
+
if (dirs) {
|
|
2528
|
+
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
2529
|
+
}
|
|
2530
|
+
const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
|
|
2531
|
+
if (needCallTransitionHooks) {
|
|
2532
|
+
transition.beforeEnter(el);
|
|
2533
|
+
}
|
|
2534
|
+
hostInsert(el, container, anchor);
|
|
2535
|
+
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
2536
|
+
queuePostRenderEffect(() => {
|
|
2537
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
2538
|
+
needCallTransitionHooks && transition.enter(el);
|
|
2539
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
2540
|
+
}, parentSuspense);
|
|
2541
|
+
}
|
|
2542
|
+
};
|
|
2543
|
+
const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
|
|
2544
|
+
if (scopeId) {
|
|
2545
|
+
hostSetScopeId(el, scopeId);
|
|
2546
|
+
}
|
|
2547
|
+
if (slotScopeIds) {
|
|
2548
|
+
for (let i = 0; i < slotScopeIds.length; i++) {
|
|
2549
|
+
hostSetScopeId(el, slotScopeIds[i]);
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
if (parentComponent) {
|
|
2553
|
+
let subTree = parentComponent.subTree;
|
|
2554
|
+
if (vnode === subTree) {
|
|
2555
|
+
const parentVNode = parentComponent.vnode;
|
|
2556
|
+
setScopeId(el, parentVNode, parentVNode.scopeId, parentVNode.slotScopeIds, parentComponent.parent);
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
};
|
|
2560
|
+
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => {
|
|
2561
|
+
for (let i = start; i < children.length; i++) {
|
|
2562
|
+
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
|
|
2563
|
+
patch(null, child, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2564
|
+
}
|
|
2565
|
+
};
|
|
2566
|
+
const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
|
|
2567
|
+
const el = n2.el = n1.el;
|
|
2568
|
+
let { patchFlag, dynamicChildren, dirs } = n2;
|
|
2569
|
+
patchFlag |= n1.patchFlag & 16;
|
|
2570
|
+
const oldProps = n1.props || EMPTY_OBJ;
|
|
2571
|
+
const newProps = n2.props || EMPTY_OBJ;
|
|
2572
|
+
let vnodeHook;
|
|
2573
|
+
parentComponent && toggleRecurse(parentComponent, false);
|
|
2574
|
+
if (vnodeHook = newProps.onVnodeBeforeUpdate) {
|
|
2575
|
+
invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
2576
|
+
}
|
|
2577
|
+
if (dirs) {
|
|
2578
|
+
invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
2579
|
+
}
|
|
2580
|
+
parentComponent && toggleRecurse(parentComponent, true);
|
|
2581
|
+
const areChildrenSVG = isSVG && n2.type !== "foreignObject";
|
|
2582
|
+
if (dynamicChildren) {
|
|
2583
|
+
patchBlockChildren(n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds);
|
|
2584
|
+
} else if (!optimized) {
|
|
2585
|
+
patchChildren(n1, n2, el, null, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds, false);
|
|
2586
|
+
}
|
|
2587
|
+
if (patchFlag > 0) {
|
|
2588
|
+
if (patchFlag & 16) {
|
|
2589
|
+
patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);
|
|
2590
|
+
} else {
|
|
2591
|
+
if (patchFlag & 2) {
|
|
2592
|
+
if (oldProps.class !== newProps.class) {
|
|
2593
|
+
hostPatchProp(el, "class", null, newProps.class, isSVG);
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
if (patchFlag & 4) {
|
|
2597
|
+
hostPatchProp(el, "style", oldProps.style, newProps.style, isSVG);
|
|
2598
|
+
}
|
|
2599
|
+
if (patchFlag & 8) {
|
|
2600
|
+
const propsToUpdate = n2.dynamicProps;
|
|
2601
|
+
for (let i = 0; i < propsToUpdate.length; i++) {
|
|
2602
|
+
const key = propsToUpdate[i];
|
|
2603
|
+
const prev = oldProps[key];
|
|
2604
|
+
const next = newProps[key];
|
|
2605
|
+
if (next !== prev || key === "value") {
|
|
2606
|
+
hostPatchProp(el, key, prev, next, isSVG, n1.children, parentComponent, parentSuspense, unmountChildren);
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
if (patchFlag & 1) {
|
|
2612
|
+
if (n1.children !== n2.children) {
|
|
2613
|
+
hostSetElementText(el, n2.children);
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
} else if (!optimized && dynamicChildren == null) {
|
|
2617
|
+
patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);
|
|
2618
|
+
}
|
|
2619
|
+
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
|
|
2620
|
+
queuePostRenderEffect(() => {
|
|
2621
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
2622
|
+
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
2623
|
+
}, parentSuspense);
|
|
2624
|
+
}
|
|
2625
|
+
};
|
|
2626
|
+
const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {
|
|
2627
|
+
for (let i = 0; i < newChildren.length; i++) {
|
|
2628
|
+
const oldVNode = oldChildren[i];
|
|
2629
|
+
const newVNode = newChildren[i];
|
|
2630
|
+
const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : fallbackContainer;
|
|
2631
|
+
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, true);
|
|
2632
|
+
}
|
|
2633
|
+
};
|
|
2634
|
+
const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
|
|
2635
|
+
if (oldProps !== newProps) {
|
|
2636
|
+
for (const key in newProps) {
|
|
2637
|
+
if (isReservedProp(key))
|
|
2638
|
+
continue;
|
|
2639
|
+
const next = newProps[key];
|
|
2640
|
+
const prev = oldProps[key];
|
|
2641
|
+
if (next !== prev && key !== "value") {
|
|
2642
|
+
hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
2643
|
+
}
|
|
2644
|
+
}
|
|
2645
|
+
if (oldProps !== EMPTY_OBJ) {
|
|
2646
|
+
for (const key in oldProps) {
|
|
2647
|
+
if (!isReservedProp(key) && !(key in newProps)) {
|
|
2648
|
+
hostPatchProp(el, key, oldProps[key], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
2649
|
+
}
|
|
2650
|
+
}
|
|
2651
|
+
}
|
|
2652
|
+
if ("value" in newProps) {
|
|
2653
|
+
hostPatchProp(el, "value", oldProps.value, newProps.value);
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
};
|
|
2657
|
+
const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
|
|
2658
|
+
const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
|
|
2659
|
+
const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
|
|
2660
|
+
let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
|
|
2661
|
+
if (fragmentSlotScopeIds) {
|
|
2662
|
+
slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
|
|
2663
|
+
}
|
|
2664
|
+
if (n1 == null) {
|
|
2665
|
+
hostInsert(fragmentStartAnchor, container, anchor);
|
|
2666
|
+
hostInsert(fragmentEndAnchor, container, anchor);
|
|
2667
|
+
mountChildren(n2.children, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2668
|
+
} else {
|
|
2669
|
+
if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && n1.dynamicChildren) {
|
|
2670
|
+
patchBlockChildren(n1.dynamicChildren, dynamicChildren, container, parentComponent, parentSuspense, isSVG, slotScopeIds);
|
|
2671
|
+
if (n2.key != null || parentComponent && n2 === parentComponent.subTree) {
|
|
2672
|
+
traverseStaticChildren(n1, n2, true);
|
|
2673
|
+
}
|
|
2674
|
+
} else {
|
|
2675
|
+
patchChildren(n1, n2, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
};
|
|
2679
|
+
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
|
|
2680
|
+
n2.slotScopeIds = slotScopeIds;
|
|
2681
|
+
if (n1 == null) {
|
|
2682
|
+
if (n2.shapeFlag & 512) {
|
|
2683
|
+
parentComponent.ctx.activate(n2, container, anchor, isSVG, optimized);
|
|
2684
|
+
} else {
|
|
2685
|
+
mountComponent(n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);
|
|
2686
|
+
}
|
|
2687
|
+
} else {
|
|
2688
|
+
updateComponent(n1, n2, optimized);
|
|
2689
|
+
}
|
|
2690
|
+
};
|
|
2691
|
+
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {
|
|
2692
|
+
const instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense);
|
|
2693
|
+
if (isKeepAlive(initialVNode)) {
|
|
2694
|
+
instance.ctx.renderer = internals;
|
|
2695
|
+
}
|
|
2696
|
+
{
|
|
2697
|
+
setupComponent(instance);
|
|
2698
|
+
}
|
|
2699
|
+
if (instance.asyncDep) {
|
|
2700
|
+
parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect);
|
|
2701
|
+
if (!initialVNode.el) {
|
|
2702
|
+
const placeholder = instance.subTree = createVNode(Comment);
|
|
2703
|
+
processCommentNode(null, placeholder, container, anchor);
|
|
2704
|
+
}
|
|
2705
|
+
return;
|
|
2706
|
+
}
|
|
2707
|
+
setupRenderEffect(instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized);
|
|
2708
|
+
};
|
|
2709
|
+
const updateComponent = (n1, n2, optimized) => {
|
|
2710
|
+
const instance = n2.component = n1.component;
|
|
2711
|
+
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
2712
|
+
if (instance.asyncDep && !instance.asyncResolved) {
|
|
2713
|
+
updateComponentPreRender(instance, n2, optimized);
|
|
2714
|
+
return;
|
|
2715
|
+
} else {
|
|
2716
|
+
instance.next = n2;
|
|
2717
|
+
invalidateJob(instance.update);
|
|
2718
|
+
instance.update();
|
|
2719
|
+
}
|
|
2720
|
+
} else {
|
|
2721
|
+
n2.component = n1.component;
|
|
2722
|
+
n2.el = n1.el;
|
|
2723
|
+
instance.vnode = n2;
|
|
2724
|
+
}
|
|
2725
|
+
};
|
|
2726
|
+
const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {
|
|
2727
|
+
const componentUpdateFn = () => {
|
|
2728
|
+
if (!instance.isMounted) {
|
|
2729
|
+
let vnodeHook;
|
|
2730
|
+
const { el, props } = initialVNode;
|
|
2731
|
+
const { bm, m, parent } = instance;
|
|
2732
|
+
const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
|
|
2733
|
+
toggleRecurse(instance, false);
|
|
2734
|
+
if (bm) {
|
|
2735
|
+
invokeArrayFns(bm);
|
|
2736
|
+
}
|
|
2737
|
+
if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
|
|
2738
|
+
invokeVNodeHook(vnodeHook, parent, initialVNode);
|
|
2739
|
+
}
|
|
2740
|
+
toggleRecurse(instance, true);
|
|
2741
|
+
if (el && hydrateNode) {
|
|
2742
|
+
const hydrateSubTree = () => {
|
|
2743
|
+
instance.subTree = renderComponentRoot(instance);
|
|
2744
|
+
hydrateNode(el, instance.subTree, instance, parentSuspense, null);
|
|
2745
|
+
};
|
|
2746
|
+
if (isAsyncWrapperVNode) {
|
|
2747
|
+
initialVNode.type.__asyncLoader().then(() => !instance.isUnmounted && hydrateSubTree());
|
|
2748
|
+
} else {
|
|
2749
|
+
hydrateSubTree();
|
|
2750
|
+
}
|
|
2751
|
+
} else {
|
|
2752
|
+
const subTree = instance.subTree = renderComponentRoot(instance);
|
|
2753
|
+
patch(null, subTree, container, anchor, instance, parentSuspense, isSVG);
|
|
2754
|
+
initialVNode.el = subTree.el;
|
|
2755
|
+
}
|
|
2756
|
+
if (m) {
|
|
2757
|
+
queuePostRenderEffect(m, parentSuspense);
|
|
2758
|
+
}
|
|
2759
|
+
if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
|
|
2760
|
+
const scopedInitialVNode = initialVNode;
|
|
2761
|
+
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense);
|
|
2762
|
+
}
|
|
2763
|
+
if (initialVNode.shapeFlag & 256) {
|
|
2764
|
+
instance.a && queuePostRenderEffect(instance.a, parentSuspense);
|
|
2765
|
+
}
|
|
2766
|
+
instance.isMounted = true;
|
|
2767
|
+
initialVNode = container = anchor = null;
|
|
2768
|
+
} else {
|
|
2769
|
+
let { next, bu, u, parent, vnode } = instance;
|
|
2770
|
+
let originNext = next;
|
|
2771
|
+
let vnodeHook;
|
|
2772
|
+
toggleRecurse(instance, false);
|
|
2773
|
+
if (next) {
|
|
2774
|
+
next.el = vnode.el;
|
|
2775
|
+
updateComponentPreRender(instance, next, optimized);
|
|
2776
|
+
} else {
|
|
2777
|
+
next = vnode;
|
|
2778
|
+
}
|
|
2779
|
+
if (bu) {
|
|
2780
|
+
invokeArrayFns(bu);
|
|
2781
|
+
}
|
|
2782
|
+
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
|
|
2783
|
+
invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
2784
|
+
}
|
|
2785
|
+
toggleRecurse(instance, true);
|
|
2786
|
+
const nextTree = renderComponentRoot(instance);
|
|
2787
|
+
const prevTree = instance.subTree;
|
|
2788
|
+
instance.subTree = nextTree;
|
|
2789
|
+
patch(prevTree, nextTree, hostParentNode(prevTree.el), getNextHostNode(prevTree), instance, parentSuspense, isSVG);
|
|
2790
|
+
next.el = nextTree.el;
|
|
2791
|
+
if (originNext === null) {
|
|
2792
|
+
updateHOCHostEl(instance, nextTree.el);
|
|
2793
|
+
}
|
|
2794
|
+
if (u) {
|
|
2795
|
+
queuePostRenderEffect(u, parentSuspense);
|
|
2796
|
+
}
|
|
2797
|
+
if (vnodeHook = next.props && next.props.onVnodeUpdated) {
|
|
2798
|
+
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
};
|
|
2802
|
+
const effect = instance.effect = new ReactiveEffect(componentUpdateFn, () => queueJob(instance.update), instance.scope);
|
|
2803
|
+
const update = instance.update = effect.run.bind(effect);
|
|
2804
|
+
update.id = instance.uid;
|
|
2805
|
+
toggleRecurse(instance, true);
|
|
2806
|
+
update();
|
|
2807
|
+
};
|
|
2808
|
+
const updateComponentPreRender = (instance, nextVNode, optimized) => {
|
|
2809
|
+
nextVNode.component = instance;
|
|
2810
|
+
const prevProps = instance.vnode.props;
|
|
2811
|
+
instance.vnode = nextVNode;
|
|
2812
|
+
instance.next = null;
|
|
2813
|
+
updateProps(instance, nextVNode.props, prevProps, optimized);
|
|
2814
|
+
updateSlots(instance, nextVNode.children, optimized);
|
|
2815
|
+
pauseTracking();
|
|
2816
|
+
flushPreFlushCbs(void 0, instance.update);
|
|
2817
|
+
resetTracking();
|
|
2818
|
+
};
|
|
2819
|
+
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
|
|
2820
|
+
const c1 = n1 && n1.children;
|
|
2821
|
+
const prevShapeFlag = n1 ? n1.shapeFlag : 0;
|
|
2822
|
+
const c2 = n2.children;
|
|
2823
|
+
const { patchFlag, shapeFlag } = n2;
|
|
2824
|
+
if (patchFlag > 0) {
|
|
2825
|
+
if (patchFlag & 128) {
|
|
2826
|
+
patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2827
|
+
return;
|
|
2828
|
+
} else if (patchFlag & 256) {
|
|
2829
|
+
patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2830
|
+
return;
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
if (shapeFlag & 8) {
|
|
2834
|
+
if (prevShapeFlag & 16) {
|
|
2835
|
+
unmountChildren(c1, parentComponent, parentSuspense);
|
|
2836
|
+
}
|
|
2837
|
+
if (c2 !== c1) {
|
|
2838
|
+
hostSetElementText(container, c2);
|
|
2839
|
+
}
|
|
2840
|
+
} else {
|
|
2841
|
+
if (prevShapeFlag & 16) {
|
|
2842
|
+
if (shapeFlag & 16) {
|
|
2843
|
+
patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2844
|
+
} else {
|
|
2845
|
+
unmountChildren(c1, parentComponent, parentSuspense, true);
|
|
2846
|
+
}
|
|
2847
|
+
} else {
|
|
2848
|
+
if (prevShapeFlag & 8) {
|
|
2849
|
+
hostSetElementText(container, "");
|
|
2850
|
+
}
|
|
2851
|
+
if (shapeFlag & 16) {
|
|
2852
|
+
mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
};
|
|
2857
|
+
const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
|
|
2858
|
+
c1 = c1 || EMPTY_ARR;
|
|
2859
|
+
c2 = c2 || EMPTY_ARR;
|
|
2860
|
+
const oldLength = c1.length;
|
|
2861
|
+
const newLength = c2.length;
|
|
2862
|
+
const commonLength = Math.min(oldLength, newLength);
|
|
2863
|
+
let i;
|
|
2864
|
+
for (i = 0; i < commonLength; i++) {
|
|
2865
|
+
const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
|
|
2866
|
+
patch(c1[i], nextChild, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2867
|
+
}
|
|
2868
|
+
if (oldLength > newLength) {
|
|
2869
|
+
unmountChildren(c1, parentComponent, parentSuspense, true, false, commonLength);
|
|
2870
|
+
} else {
|
|
2871
|
+
mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, commonLength);
|
|
2872
|
+
}
|
|
2873
|
+
};
|
|
2874
|
+
const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
|
|
2875
|
+
let i = 0;
|
|
2876
|
+
const l2 = c2.length;
|
|
2877
|
+
let e1 = c1.length - 1;
|
|
2878
|
+
let e2 = l2 - 1;
|
|
2879
|
+
while (i <= e1 && i <= e2) {
|
|
2880
|
+
const n1 = c1[i];
|
|
2881
|
+
const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
|
|
2882
|
+
if (isSameVNodeType(n1, n2)) {
|
|
2883
|
+
patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2884
|
+
} else {
|
|
2885
|
+
break;
|
|
2886
|
+
}
|
|
2887
|
+
i++;
|
|
2888
|
+
}
|
|
2889
|
+
while (i <= e1 && i <= e2) {
|
|
2890
|
+
const n1 = c1[e1];
|
|
2891
|
+
const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
|
|
2892
|
+
if (isSameVNodeType(n1, n2)) {
|
|
2893
|
+
patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2894
|
+
} else {
|
|
2895
|
+
break;
|
|
2896
|
+
}
|
|
2897
|
+
e1--;
|
|
2898
|
+
e2--;
|
|
2899
|
+
}
|
|
2900
|
+
if (i > e1) {
|
|
2901
|
+
if (i <= e2) {
|
|
2902
|
+
const nextPos = e2 + 1;
|
|
2903
|
+
const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
|
|
2904
|
+
while (i <= e2) {
|
|
2905
|
+
patch(null, c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2906
|
+
i++;
|
|
2907
|
+
}
|
|
2908
|
+
}
|
|
2909
|
+
} else if (i > e2) {
|
|
2910
|
+
while (i <= e1) {
|
|
2911
|
+
unmount(c1[i], parentComponent, parentSuspense, true);
|
|
2912
|
+
i++;
|
|
2913
|
+
}
|
|
2914
|
+
} else {
|
|
2915
|
+
const s1 = i;
|
|
2916
|
+
const s2 = i;
|
|
2917
|
+
const keyToNewIndexMap = new Map();
|
|
2918
|
+
for (i = s2; i <= e2; i++) {
|
|
2919
|
+
const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
|
|
2920
|
+
if (nextChild.key != null) {
|
|
2921
|
+
keyToNewIndexMap.set(nextChild.key, i);
|
|
2922
|
+
}
|
|
2923
|
+
}
|
|
2924
|
+
let j;
|
|
2925
|
+
let patched = 0;
|
|
2926
|
+
const toBePatched = e2 - s2 + 1;
|
|
2927
|
+
let moved = false;
|
|
2928
|
+
let maxNewIndexSoFar = 0;
|
|
2929
|
+
const newIndexToOldIndexMap = new Array(toBePatched);
|
|
2930
|
+
for (i = 0; i < toBePatched; i++)
|
|
2931
|
+
newIndexToOldIndexMap[i] = 0;
|
|
2932
|
+
for (i = s1; i <= e1; i++) {
|
|
2933
|
+
const prevChild = c1[i];
|
|
2934
|
+
if (patched >= toBePatched) {
|
|
2935
|
+
unmount(prevChild, parentComponent, parentSuspense, true);
|
|
2936
|
+
continue;
|
|
2937
|
+
}
|
|
2938
|
+
let newIndex;
|
|
2939
|
+
if (prevChild.key != null) {
|
|
2940
|
+
newIndex = keyToNewIndexMap.get(prevChild.key);
|
|
2941
|
+
} else {
|
|
2942
|
+
for (j = s2; j <= e2; j++) {
|
|
2943
|
+
if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
|
|
2944
|
+
newIndex = j;
|
|
2945
|
+
break;
|
|
2946
|
+
}
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
if (newIndex === void 0) {
|
|
2950
|
+
unmount(prevChild, parentComponent, parentSuspense, true);
|
|
2951
|
+
} else {
|
|
2952
|
+
newIndexToOldIndexMap[newIndex - s2] = i + 1;
|
|
2953
|
+
if (newIndex >= maxNewIndexSoFar) {
|
|
2954
|
+
maxNewIndexSoFar = newIndex;
|
|
2955
|
+
} else {
|
|
2956
|
+
moved = true;
|
|
2957
|
+
}
|
|
2958
|
+
patch(prevChild, c2[newIndex], container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2959
|
+
patched++;
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
|
|
2963
|
+
j = increasingNewIndexSequence.length - 1;
|
|
2964
|
+
for (i = toBePatched - 1; i >= 0; i--) {
|
|
2965
|
+
const nextIndex = s2 + i;
|
|
2966
|
+
const nextChild = c2[nextIndex];
|
|
2967
|
+
const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
|
|
2968
|
+
if (newIndexToOldIndexMap[i] === 0) {
|
|
2969
|
+
patch(null, nextChild, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
2970
|
+
} else if (moved) {
|
|
2971
|
+
if (j < 0 || i !== increasingNewIndexSequence[j]) {
|
|
2972
|
+
move(nextChild, container, anchor, 2);
|
|
2973
|
+
} else {
|
|
2974
|
+
j--;
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
|
+
}
|
|
2978
|
+
}
|
|
2979
|
+
};
|
|
2980
|
+
const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
|
|
2981
|
+
const { el, type, transition, children, shapeFlag } = vnode;
|
|
2982
|
+
if (shapeFlag & 6) {
|
|
2983
|
+
move(vnode.component.subTree, container, anchor, moveType);
|
|
2984
|
+
return;
|
|
2985
|
+
}
|
|
2986
|
+
if (shapeFlag & 128) {
|
|
2987
|
+
vnode.suspense.move(container, anchor, moveType);
|
|
2988
|
+
return;
|
|
2989
|
+
}
|
|
2990
|
+
if (shapeFlag & 64) {
|
|
2991
|
+
type.move(vnode, container, anchor, internals);
|
|
2992
|
+
return;
|
|
2993
|
+
}
|
|
2994
|
+
if (type === Fragment) {
|
|
2995
|
+
hostInsert(el, container, anchor);
|
|
2996
|
+
for (let i = 0; i < children.length; i++) {
|
|
2997
|
+
move(children[i], container, anchor, moveType);
|
|
2998
|
+
}
|
|
2999
|
+
hostInsert(vnode.anchor, container, anchor);
|
|
3000
|
+
return;
|
|
3001
|
+
}
|
|
3002
|
+
if (type === Static) {
|
|
3003
|
+
moveStaticNode(vnode, container, anchor);
|
|
3004
|
+
return;
|
|
3005
|
+
}
|
|
3006
|
+
const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
|
|
3007
|
+
if (needTransition) {
|
|
3008
|
+
if (moveType === 0) {
|
|
3009
|
+
transition.beforeEnter(el);
|
|
3010
|
+
hostInsert(el, container, anchor);
|
|
3011
|
+
queuePostRenderEffect(() => transition.enter(el), parentSuspense);
|
|
3012
|
+
} else {
|
|
3013
|
+
const { leave, delayLeave, afterLeave } = transition;
|
|
3014
|
+
const remove3 = () => hostInsert(el, container, anchor);
|
|
3015
|
+
const performLeave = () => {
|
|
3016
|
+
leave(el, () => {
|
|
3017
|
+
remove3();
|
|
3018
|
+
afterLeave && afterLeave();
|
|
3019
|
+
});
|
|
3020
|
+
};
|
|
3021
|
+
if (delayLeave) {
|
|
3022
|
+
delayLeave(el, remove3, performLeave);
|
|
3023
|
+
} else {
|
|
3024
|
+
performLeave();
|
|
3025
|
+
}
|
|
3026
|
+
}
|
|
3027
|
+
} else {
|
|
3028
|
+
hostInsert(el, container, anchor);
|
|
3029
|
+
}
|
|
3030
|
+
};
|
|
3031
|
+
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
3032
|
+
const { type, props, ref: ref2, children, dynamicChildren, shapeFlag, patchFlag, dirs } = vnode;
|
|
3033
|
+
if (ref2 != null) {
|
|
3034
|
+
setRef(ref2, null, parentSuspense, vnode, true);
|
|
3035
|
+
}
|
|
3036
|
+
if (shapeFlag & 256) {
|
|
3037
|
+
parentComponent.ctx.deactivate(vnode);
|
|
3038
|
+
return;
|
|
3039
|
+
}
|
|
3040
|
+
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
3041
|
+
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
3042
|
+
let vnodeHook;
|
|
3043
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
|
|
3044
|
+
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
3045
|
+
}
|
|
3046
|
+
if (shapeFlag & 6) {
|
|
3047
|
+
unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
3048
|
+
} else {
|
|
3049
|
+
if (shapeFlag & 128) {
|
|
3050
|
+
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
3051
|
+
return;
|
|
3052
|
+
}
|
|
3053
|
+
if (shouldInvokeDirs) {
|
|
3054
|
+
invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
3055
|
+
}
|
|
3056
|
+
if (shapeFlag & 64) {
|
|
3057
|
+
vnode.type.remove(vnode, parentComponent, parentSuspense, optimized, internals, doRemove);
|
|
3058
|
+
} else if (dynamicChildren && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
|
|
3059
|
+
unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
3060
|
+
} else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
|
|
3061
|
+
unmountChildren(children, parentComponent, parentSuspense);
|
|
3062
|
+
}
|
|
3063
|
+
if (doRemove) {
|
|
3064
|
+
remove2(vnode);
|
|
3065
|
+
}
|
|
3066
|
+
}
|
|
3067
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
|
|
3068
|
+
queuePostRenderEffect(() => {
|
|
3069
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
3070
|
+
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
3071
|
+
}, parentSuspense);
|
|
3072
|
+
}
|
|
3073
|
+
};
|
|
3074
|
+
const remove2 = (vnode) => {
|
|
3075
|
+
const { type, el, anchor, transition } = vnode;
|
|
3076
|
+
if (type === Fragment) {
|
|
3077
|
+
removeFragment(el, anchor);
|
|
3078
|
+
return;
|
|
3079
|
+
}
|
|
3080
|
+
if (type === Static) {
|
|
3081
|
+
removeStaticNode(vnode);
|
|
3082
|
+
return;
|
|
3083
|
+
}
|
|
3084
|
+
const performRemove = () => {
|
|
3085
|
+
hostRemove(el);
|
|
3086
|
+
if (transition && !transition.persisted && transition.afterLeave) {
|
|
3087
|
+
transition.afterLeave();
|
|
3088
|
+
}
|
|
3089
|
+
};
|
|
3090
|
+
if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
|
|
3091
|
+
const { leave, delayLeave } = transition;
|
|
3092
|
+
const performLeave = () => leave(el, performRemove);
|
|
3093
|
+
if (delayLeave) {
|
|
3094
|
+
delayLeave(vnode.el, performRemove, performLeave);
|
|
3095
|
+
} else {
|
|
3096
|
+
performLeave();
|
|
3097
|
+
}
|
|
3098
|
+
} else {
|
|
3099
|
+
performRemove();
|
|
3100
|
+
}
|
|
3101
|
+
};
|
|
3102
|
+
const removeFragment = (cur, end) => {
|
|
3103
|
+
let next;
|
|
3104
|
+
while (cur !== end) {
|
|
3105
|
+
next = hostNextSibling(cur);
|
|
3106
|
+
hostRemove(cur);
|
|
3107
|
+
cur = next;
|
|
3108
|
+
}
|
|
3109
|
+
hostRemove(end);
|
|
3110
|
+
};
|
|
3111
|
+
const unmountComponent = (instance, parentSuspense, doRemove) => {
|
|
3112
|
+
const { bum, scope, update, subTree, um } = instance;
|
|
3113
|
+
if (bum) {
|
|
3114
|
+
invokeArrayFns(bum);
|
|
3115
|
+
}
|
|
3116
|
+
scope.stop();
|
|
3117
|
+
if (update) {
|
|
3118
|
+
update.active = false;
|
|
3119
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
3120
|
+
}
|
|
3121
|
+
if (um) {
|
|
3122
|
+
queuePostRenderEffect(um, parentSuspense);
|
|
3123
|
+
}
|
|
3124
|
+
queuePostRenderEffect(() => {
|
|
3125
|
+
instance.isUnmounted = true;
|
|
3126
|
+
}, parentSuspense);
|
|
3127
|
+
if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
|
|
3128
|
+
parentSuspense.deps--;
|
|
3129
|
+
if (parentSuspense.deps === 0) {
|
|
3130
|
+
parentSuspense.resolve();
|
|
3131
|
+
}
|
|
3132
|
+
}
|
|
3133
|
+
};
|
|
3134
|
+
const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
|
|
3135
|
+
for (let i = start; i < children.length; i++) {
|
|
3136
|
+
unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
|
|
3137
|
+
}
|
|
3138
|
+
};
|
|
3139
|
+
const getNextHostNode = (vnode) => {
|
|
3140
|
+
if (vnode.shapeFlag & 6) {
|
|
3141
|
+
return getNextHostNode(vnode.component.subTree);
|
|
3142
|
+
}
|
|
3143
|
+
if (vnode.shapeFlag & 128) {
|
|
3144
|
+
return vnode.suspense.next();
|
|
3145
|
+
}
|
|
3146
|
+
return hostNextSibling(vnode.anchor || vnode.el);
|
|
3147
|
+
};
|
|
3148
|
+
const render2 = (vnode, container, isSVG) => {
|
|
3149
|
+
if (vnode == null) {
|
|
3150
|
+
if (container._vnode) {
|
|
3151
|
+
unmount(container._vnode, null, null, true);
|
|
3152
|
+
}
|
|
3153
|
+
} else {
|
|
3154
|
+
patch(container._vnode || null, vnode, container, null, null, null, isSVG);
|
|
3155
|
+
}
|
|
3156
|
+
flushPostFlushCbs();
|
|
3157
|
+
container._vnode = vnode;
|
|
3158
|
+
};
|
|
3159
|
+
const internals = {
|
|
3160
|
+
p: patch,
|
|
3161
|
+
um: unmount,
|
|
3162
|
+
m: move,
|
|
3163
|
+
r: remove2,
|
|
3164
|
+
mt: mountComponent,
|
|
3165
|
+
mc: mountChildren,
|
|
3166
|
+
pc: patchChildren,
|
|
3167
|
+
pbc: patchBlockChildren,
|
|
3168
|
+
n: getNextHostNode,
|
|
3169
|
+
o: options
|
|
3170
|
+
};
|
|
3171
|
+
let hydrate;
|
|
3172
|
+
let hydrateNode;
|
|
3173
|
+
if (createHydrationFns) {
|
|
3174
|
+
[hydrate, hydrateNode] = createHydrationFns(internals);
|
|
3175
|
+
}
|
|
3176
|
+
return {
|
|
3177
|
+
render: render2,
|
|
3178
|
+
hydrate,
|
|
3179
|
+
createApp: createAppAPI(render2, hydrate)
|
|
3180
|
+
};
|
|
3181
|
+
}
|
|
3182
|
+
function toggleRecurse({ effect, update }, allowed) {
|
|
3183
|
+
effect.allowRecurse = update.allowRecurse = allowed;
|
|
3184
|
+
}
|
|
3185
|
+
function traverseStaticChildren(n1, n2, shallow = false) {
|
|
3186
|
+
const ch1 = n1.children;
|
|
3187
|
+
const ch2 = n2.children;
|
|
3188
|
+
if (isArray(ch1) && isArray(ch2)) {
|
|
3189
|
+
for (let i = 0; i < ch1.length; i++) {
|
|
3190
|
+
const c1 = ch1[i];
|
|
3191
|
+
let c2 = ch2[i];
|
|
3192
|
+
if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
|
|
3193
|
+
if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
|
|
3194
|
+
c2 = ch2[i] = cloneIfMounted(ch2[i]);
|
|
3195
|
+
c2.el = c1.el;
|
|
3196
|
+
}
|
|
3197
|
+
if (!shallow)
|
|
3198
|
+
traverseStaticChildren(c1, c2);
|
|
3199
|
+
}
|
|
3200
|
+
}
|
|
3201
|
+
}
|
|
3202
|
+
}
|
|
3203
|
+
function getSequence(arr) {
|
|
3204
|
+
const p2 = arr.slice();
|
|
3205
|
+
const result = [0];
|
|
3206
|
+
let i, j, u, v, c;
|
|
3207
|
+
const len = arr.length;
|
|
3208
|
+
for (i = 0; i < len; i++) {
|
|
3209
|
+
const arrI = arr[i];
|
|
3210
|
+
if (arrI !== 0) {
|
|
3211
|
+
j = result[result.length - 1];
|
|
3212
|
+
if (arr[j] < arrI) {
|
|
3213
|
+
p2[i] = j;
|
|
3214
|
+
result.push(i);
|
|
3215
|
+
continue;
|
|
3216
|
+
}
|
|
3217
|
+
u = 0;
|
|
3218
|
+
v = result.length - 1;
|
|
3219
|
+
while (u < v) {
|
|
3220
|
+
c = u + v >> 1;
|
|
3221
|
+
if (arr[result[c]] < arrI) {
|
|
3222
|
+
u = c + 1;
|
|
3223
|
+
} else {
|
|
3224
|
+
v = c;
|
|
3225
|
+
}
|
|
3226
|
+
}
|
|
3227
|
+
if (arrI < arr[result[u]]) {
|
|
3228
|
+
if (u > 0) {
|
|
3229
|
+
p2[i] = result[u - 1];
|
|
3230
|
+
}
|
|
3231
|
+
result[u] = i;
|
|
3232
|
+
}
|
|
3233
|
+
}
|
|
3234
|
+
}
|
|
3235
|
+
u = result.length;
|
|
3236
|
+
v = result[u - 1];
|
|
3237
|
+
while (u-- > 0) {
|
|
3238
|
+
result[u] = v;
|
|
3239
|
+
v = p2[v];
|
|
3240
|
+
}
|
|
3241
|
+
return result;
|
|
3242
|
+
}
|
|
3243
|
+
const isTeleport = (type) => type.__isTeleport;
|
|
3244
|
+
const NULL_DYNAMIC_COMPONENT = Symbol();
|
|
3245
|
+
const Fragment = Symbol(void 0);
|
|
3246
|
+
const Text = Symbol(void 0);
|
|
3247
|
+
const Comment = Symbol(void 0);
|
|
3248
|
+
const Static = Symbol(void 0);
|
|
3249
|
+
const blockStack = [];
|
|
3250
|
+
let currentBlock = null;
|
|
3251
|
+
function openBlock(disableTracking = false) {
|
|
3252
|
+
blockStack.push(currentBlock = disableTracking ? null : []);
|
|
3253
|
+
}
|
|
3254
|
+
function closeBlock() {
|
|
3255
|
+
blockStack.pop();
|
|
3256
|
+
currentBlock = blockStack[blockStack.length - 1] || null;
|
|
3257
|
+
}
|
|
3258
|
+
let isBlockTreeEnabled = 1;
|
|
3259
|
+
function setBlockTracking(value) {
|
|
3260
|
+
isBlockTreeEnabled += value;
|
|
3261
|
+
}
|
|
3262
|
+
function setupBlock(vnode) {
|
|
3263
|
+
vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
|
|
3264
|
+
closeBlock();
|
|
3265
|
+
if (isBlockTreeEnabled > 0 && currentBlock) {
|
|
3266
|
+
currentBlock.push(vnode);
|
|
3267
|
+
}
|
|
3268
|
+
return vnode;
|
|
3269
|
+
}
|
|
3270
|
+
function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
|
|
3271
|
+
return setupBlock(createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, true));
|
|
3272
|
+
}
|
|
3273
|
+
function createBlock(type, props, children, patchFlag, dynamicProps) {
|
|
3274
|
+
return setupBlock(createVNode(type, props, children, patchFlag, dynamicProps, true));
|
|
3275
|
+
}
|
|
3276
|
+
function isVNode(value) {
|
|
3277
|
+
return value ? value.__v_isVNode === true : false;
|
|
3278
|
+
}
|
|
3279
|
+
function isSameVNodeType(n1, n2) {
|
|
3280
|
+
return n1.type === n2.type && n1.key === n2.key;
|
|
3281
|
+
}
|
|
3282
|
+
const InternalObjectKey = `__vInternal`;
|
|
3283
|
+
const normalizeKey = ({ key }) => key != null ? key : null;
|
|
3284
|
+
const normalizeRef = ({ ref: ref2, ref_key, ref_for }) => {
|
|
3285
|
+
return ref2 != null ? isString(ref2) || isRef(ref2) || isFunction(ref2) ? { i: currentRenderingInstance, r: ref2, k: ref_key, f: !!ref_for } : ref2 : null;
|
|
3286
|
+
};
|
|
3287
|
+
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
|
|
3288
|
+
const vnode = {
|
|
3289
|
+
__v_isVNode: true,
|
|
3290
|
+
__v_skip: true,
|
|
3291
|
+
type,
|
|
3292
|
+
props,
|
|
3293
|
+
key: props && normalizeKey(props),
|
|
3294
|
+
ref: props && normalizeRef(props),
|
|
3295
|
+
scopeId: currentScopeId,
|
|
3296
|
+
slotScopeIds: null,
|
|
3297
|
+
children,
|
|
3298
|
+
component: null,
|
|
3299
|
+
suspense: null,
|
|
3300
|
+
ssContent: null,
|
|
3301
|
+
ssFallback: null,
|
|
3302
|
+
dirs: null,
|
|
3303
|
+
transition: null,
|
|
3304
|
+
el: null,
|
|
3305
|
+
anchor: null,
|
|
3306
|
+
target: null,
|
|
3307
|
+
targetAnchor: null,
|
|
3308
|
+
staticCount: 0,
|
|
3309
|
+
shapeFlag,
|
|
3310
|
+
patchFlag,
|
|
3311
|
+
dynamicProps,
|
|
3312
|
+
dynamicChildren: null,
|
|
3313
|
+
appContext: null
|
|
3314
|
+
};
|
|
3315
|
+
if (needFullChildrenNormalization) {
|
|
3316
|
+
normalizeChildren(vnode, children);
|
|
3317
|
+
if (shapeFlag & 128) {
|
|
3318
|
+
type.normalize(vnode);
|
|
3319
|
+
}
|
|
3320
|
+
} else if (children) {
|
|
3321
|
+
vnode.shapeFlag |= isString(children) ? 8 : 16;
|
|
3322
|
+
}
|
|
3323
|
+
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) {
|
|
3324
|
+
currentBlock.push(vnode);
|
|
3325
|
+
}
|
|
3326
|
+
return vnode;
|
|
3327
|
+
}
|
|
3328
|
+
const createVNode = _createVNode;
|
|
3329
|
+
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
3330
|
+
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
3331
|
+
type = Comment;
|
|
3332
|
+
}
|
|
3333
|
+
if (isVNode(type)) {
|
|
3334
|
+
const cloned = cloneVNode(type, props, true);
|
|
3335
|
+
if (children) {
|
|
3336
|
+
normalizeChildren(cloned, children);
|
|
3337
|
+
}
|
|
3338
|
+
return cloned;
|
|
3339
|
+
}
|
|
3340
|
+
if (isClassComponent(type)) {
|
|
3341
|
+
type = type.__vccOpts;
|
|
3342
|
+
}
|
|
3343
|
+
if (props) {
|
|
3344
|
+
props = guardReactiveProps(props);
|
|
3345
|
+
let { class: klass, style } = props;
|
|
3346
|
+
if (klass && !isString(klass)) {
|
|
3347
|
+
props.class = normalizeClass(klass);
|
|
3348
|
+
}
|
|
3349
|
+
if (isObject(style)) {
|
|
3350
|
+
if (isProxy(style) && !isArray(style)) {
|
|
3351
|
+
style = extend({}, style);
|
|
3352
|
+
}
|
|
3353
|
+
props.style = normalizeStyle(style);
|
|
3354
|
+
}
|
|
3355
|
+
}
|
|
3356
|
+
const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
|
|
3357
|
+
return createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, isBlockNode, true);
|
|
3358
|
+
}
|
|
3359
|
+
function guardReactiveProps(props) {
|
|
3360
|
+
if (!props)
|
|
3361
|
+
return null;
|
|
3362
|
+
return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
|
|
3363
|
+
}
|
|
3364
|
+
function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
3365
|
+
const { props, ref: ref2, patchFlag, children } = vnode;
|
|
3366
|
+
const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
|
|
3367
|
+
const cloned = {
|
|
3368
|
+
__v_isVNode: true,
|
|
3369
|
+
__v_skip: true,
|
|
3370
|
+
type: vnode.type,
|
|
3371
|
+
props: mergedProps,
|
|
3372
|
+
key: mergedProps && normalizeKey(mergedProps),
|
|
3373
|
+
ref: extraProps && extraProps.ref ? mergeRef && ref2 ? isArray(ref2) ? ref2.concat(normalizeRef(extraProps)) : [ref2, normalizeRef(extraProps)] : normalizeRef(extraProps) : ref2,
|
|
3374
|
+
scopeId: vnode.scopeId,
|
|
3375
|
+
slotScopeIds: vnode.slotScopeIds,
|
|
3376
|
+
children,
|
|
3377
|
+
target: vnode.target,
|
|
3378
|
+
targetAnchor: vnode.targetAnchor,
|
|
3379
|
+
staticCount: vnode.staticCount,
|
|
3380
|
+
shapeFlag: vnode.shapeFlag,
|
|
3381
|
+
patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
|
|
3382
|
+
dynamicProps: vnode.dynamicProps,
|
|
3383
|
+
dynamicChildren: vnode.dynamicChildren,
|
|
3384
|
+
appContext: vnode.appContext,
|
|
3385
|
+
dirs: vnode.dirs,
|
|
3386
|
+
transition: vnode.transition,
|
|
3387
|
+
component: vnode.component,
|
|
3388
|
+
suspense: vnode.suspense,
|
|
3389
|
+
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
3390
|
+
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
3391
|
+
el: vnode.el,
|
|
3392
|
+
anchor: vnode.anchor
|
|
3393
|
+
};
|
|
3394
|
+
return cloned;
|
|
3395
|
+
}
|
|
3396
|
+
function createTextVNode(text = " ", flag = 0) {
|
|
3397
|
+
return createVNode(Text, null, text, flag);
|
|
3398
|
+
}
|
|
3399
|
+
function normalizeVNode(child) {
|
|
3400
|
+
if (child == null || typeof child === "boolean") {
|
|
3401
|
+
return createVNode(Comment);
|
|
3402
|
+
} else if (isArray(child)) {
|
|
3403
|
+
return createVNode(Fragment, null, child.slice());
|
|
3404
|
+
} else if (typeof child === "object") {
|
|
3405
|
+
return cloneIfMounted(child);
|
|
3406
|
+
} else {
|
|
3407
|
+
return createVNode(Text, null, String(child));
|
|
3408
|
+
}
|
|
3409
|
+
}
|
|
3410
|
+
function cloneIfMounted(child) {
|
|
3411
|
+
return child.el === null || child.memo ? child : cloneVNode(child);
|
|
3412
|
+
}
|
|
3413
|
+
function normalizeChildren(vnode, children) {
|
|
3414
|
+
let type = 0;
|
|
3415
|
+
const { shapeFlag } = vnode;
|
|
3416
|
+
if (children == null) {
|
|
3417
|
+
children = null;
|
|
3418
|
+
} else if (isArray(children)) {
|
|
3419
|
+
type = 16;
|
|
3420
|
+
} else if (typeof children === "object") {
|
|
3421
|
+
if (shapeFlag & (1 | 64)) {
|
|
3422
|
+
const slot = children.default;
|
|
3423
|
+
if (slot) {
|
|
3424
|
+
slot._c && (slot._d = false);
|
|
3425
|
+
normalizeChildren(vnode, slot());
|
|
3426
|
+
slot._c && (slot._d = true);
|
|
3427
|
+
}
|
|
3428
|
+
return;
|
|
3429
|
+
} else {
|
|
3430
|
+
type = 32;
|
|
3431
|
+
const slotFlag = children._;
|
|
3432
|
+
if (!slotFlag && !(InternalObjectKey in children)) {
|
|
3433
|
+
children._ctx = currentRenderingInstance;
|
|
3434
|
+
} else if (slotFlag === 3 && currentRenderingInstance) {
|
|
3435
|
+
if (currentRenderingInstance.slots._ === 1) {
|
|
3436
|
+
children._ = 1;
|
|
3437
|
+
} else {
|
|
3438
|
+
children._ = 2;
|
|
3439
|
+
vnode.patchFlag |= 1024;
|
|
3440
|
+
}
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
} else if (isFunction(children)) {
|
|
3444
|
+
children = { default: children, _ctx: currentRenderingInstance };
|
|
3445
|
+
type = 32;
|
|
3446
|
+
} else {
|
|
3447
|
+
children = String(children);
|
|
3448
|
+
if (shapeFlag & 64) {
|
|
3449
|
+
type = 16;
|
|
3450
|
+
children = [createTextVNode(children)];
|
|
3451
|
+
} else {
|
|
3452
|
+
type = 8;
|
|
3453
|
+
}
|
|
3454
|
+
}
|
|
3455
|
+
vnode.children = children;
|
|
3456
|
+
vnode.shapeFlag |= type;
|
|
3457
|
+
}
|
|
3458
|
+
function mergeProps(...args) {
|
|
3459
|
+
const ret = {};
|
|
3460
|
+
for (let i = 0; i < args.length; i++) {
|
|
3461
|
+
const toMerge = args[i];
|
|
3462
|
+
for (const key in toMerge) {
|
|
3463
|
+
if (key === "class") {
|
|
3464
|
+
if (ret.class !== toMerge.class) {
|
|
3465
|
+
ret.class = normalizeClass([ret.class, toMerge.class]);
|
|
3466
|
+
}
|
|
3467
|
+
} else if (key === "style") {
|
|
3468
|
+
ret.style = normalizeStyle([ret.style, toMerge.style]);
|
|
3469
|
+
} else if (isOn(key)) {
|
|
3470
|
+
const existing = ret[key];
|
|
3471
|
+
const incoming = toMerge[key];
|
|
3472
|
+
if (existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
|
|
3473
|
+
ret[key] = existing ? [].concat(existing, incoming) : incoming;
|
|
3474
|
+
}
|
|
3475
|
+
} else if (key !== "") {
|
|
3476
|
+
ret[key] = toMerge[key];
|
|
3477
|
+
}
|
|
3478
|
+
}
|
|
3479
|
+
}
|
|
3480
|
+
return ret;
|
|
3481
|
+
}
|
|
3482
|
+
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
3483
|
+
callWithAsyncErrorHandling(hook, instance, 7, [
|
|
3484
|
+
vnode,
|
|
3485
|
+
prevVNode
|
|
3486
|
+
]);
|
|
3487
|
+
}
|
|
3488
|
+
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
3489
|
+
if (currentRenderingInstance.isCE) {
|
|
3490
|
+
return createVNode("slot", name === "default" ? null : { name }, fallback && fallback());
|
|
3491
|
+
}
|
|
3492
|
+
let slot = slots[name];
|
|
3493
|
+
if (slot && slot._c) {
|
|
3494
|
+
slot._d = false;
|
|
3495
|
+
}
|
|
3496
|
+
openBlock();
|
|
3497
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
3498
|
+
const rendered = createBlock(Fragment, { key: props.key || `_${name}` }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
3499
|
+
if (!noSlotted && rendered.scopeId) {
|
|
3500
|
+
rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
3501
|
+
}
|
|
3502
|
+
if (slot && slot._c) {
|
|
3503
|
+
slot._d = true;
|
|
3504
|
+
}
|
|
3505
|
+
return rendered;
|
|
3506
|
+
}
|
|
3507
|
+
function ensureValidVNode(vnodes) {
|
|
3508
|
+
return vnodes.some((child) => {
|
|
3509
|
+
if (!isVNode(child))
|
|
3510
|
+
return true;
|
|
3511
|
+
if (child.type === Comment)
|
|
3512
|
+
return false;
|
|
3513
|
+
if (child.type === Fragment && !ensureValidVNode(child.children))
|
|
3514
|
+
return false;
|
|
3515
|
+
return true;
|
|
3516
|
+
}) ? vnodes : null;
|
|
3517
|
+
}
|
|
3518
|
+
const getPublicInstance = (i) => {
|
|
3519
|
+
if (!i)
|
|
3520
|
+
return null;
|
|
3521
|
+
if (isStatefulComponent(i))
|
|
3522
|
+
return getExposeProxy(i) || i.proxy;
|
|
3523
|
+
return getPublicInstance(i.parent);
|
|
3524
|
+
};
|
|
3525
|
+
const publicPropertiesMap = extend(Object.create(null), {
|
|
3526
|
+
$: (i) => i,
|
|
3527
|
+
$el: (i) => i.vnode.el,
|
|
3528
|
+
$data: (i) => i.data,
|
|
3529
|
+
$props: (i) => i.props,
|
|
3530
|
+
$attrs: (i) => i.attrs,
|
|
3531
|
+
$slots: (i) => i.slots,
|
|
3532
|
+
$refs: (i) => i.refs,
|
|
3533
|
+
$parent: (i) => getPublicInstance(i.parent),
|
|
3534
|
+
$root: (i) => getPublicInstance(i.root),
|
|
3535
|
+
$emit: (i) => i.emit,
|
|
3536
|
+
$options: (i) => resolveMergedOptions(i),
|
|
3537
|
+
$forceUpdate: (i) => () => queueJob(i.update),
|
|
3538
|
+
$nextTick: (i) => nextTick.bind(i.proxy),
|
|
3539
|
+
$watch: (i) => instanceWatch.bind(i)
|
|
3540
|
+
});
|
|
3541
|
+
const PublicInstanceProxyHandlers = {
|
|
3542
|
+
get({ _: instance }, key) {
|
|
3543
|
+
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
3544
|
+
let normalizedProps;
|
|
3545
|
+
if (key[0] !== "$") {
|
|
3546
|
+
const n = accessCache[key];
|
|
3547
|
+
if (n !== void 0) {
|
|
3548
|
+
switch (n) {
|
|
3549
|
+
case 1:
|
|
3550
|
+
return setupState[key];
|
|
3551
|
+
case 2:
|
|
3552
|
+
return data[key];
|
|
3553
|
+
case 4:
|
|
3554
|
+
return ctx[key];
|
|
3555
|
+
case 3:
|
|
3556
|
+
return props[key];
|
|
3557
|
+
}
|
|
3558
|
+
} else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
3559
|
+
accessCache[key] = 1;
|
|
3560
|
+
return setupState[key];
|
|
3561
|
+
} else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
3562
|
+
accessCache[key] = 2;
|
|
3563
|
+
return data[key];
|
|
3564
|
+
} else if ((normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)) {
|
|
3565
|
+
accessCache[key] = 3;
|
|
3566
|
+
return props[key];
|
|
3567
|
+
} else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
3568
|
+
accessCache[key] = 4;
|
|
3569
|
+
return ctx[key];
|
|
3570
|
+
} else if (shouldCacheAccess) {
|
|
3571
|
+
accessCache[key] = 0;
|
|
3572
|
+
}
|
|
3573
|
+
}
|
|
3574
|
+
const publicGetter = publicPropertiesMap[key];
|
|
3575
|
+
let cssModule, globalProperties;
|
|
3576
|
+
if (publicGetter) {
|
|
3577
|
+
if (key === "$attrs") {
|
|
3578
|
+
track(instance, "get", key);
|
|
3579
|
+
}
|
|
3580
|
+
return publicGetter(instance);
|
|
3581
|
+
} else if ((cssModule = type.__cssModules) && (cssModule = cssModule[key])) {
|
|
3582
|
+
return cssModule;
|
|
3583
|
+
} else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
3584
|
+
accessCache[key] = 4;
|
|
3585
|
+
return ctx[key];
|
|
3586
|
+
} else if (globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)) {
|
|
3587
|
+
{
|
|
3588
|
+
return globalProperties[key];
|
|
3589
|
+
}
|
|
3590
|
+
} else
|
|
3591
|
+
;
|
|
3592
|
+
},
|
|
3593
|
+
set({ _: instance }, key, value) {
|
|
3594
|
+
const { data, setupState, ctx } = instance;
|
|
3595
|
+
if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
3596
|
+
setupState[key] = value;
|
|
3597
|
+
} else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
3598
|
+
data[key] = value;
|
|
3599
|
+
} else if (hasOwn(instance.props, key)) {
|
|
3600
|
+
return false;
|
|
3601
|
+
}
|
|
3602
|
+
if (key[0] === "$" && key.slice(1) in instance) {
|
|
3603
|
+
return false;
|
|
3604
|
+
} else {
|
|
3605
|
+
{
|
|
3606
|
+
ctx[key] = value;
|
|
3607
|
+
}
|
|
3608
|
+
}
|
|
3609
|
+
return true;
|
|
3610
|
+
},
|
|
3611
|
+
has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
|
|
3612
|
+
let normalizedProps;
|
|
3613
|
+
return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || setupState !== EMPTY_OBJ && hasOwn(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
|
|
3614
|
+
}
|
|
3615
|
+
};
|
|
3616
|
+
const emptyAppContext = createAppContext();
|
|
3617
|
+
let uid$1 = 0;
|
|
3618
|
+
function createComponentInstance(vnode, parent, suspense) {
|
|
3619
|
+
const type = vnode.type;
|
|
3620
|
+
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
3621
|
+
const instance = {
|
|
3622
|
+
uid: uid$1++,
|
|
3623
|
+
vnode,
|
|
3624
|
+
type,
|
|
3625
|
+
parent,
|
|
3626
|
+
appContext,
|
|
3627
|
+
root: null,
|
|
3628
|
+
next: null,
|
|
3629
|
+
subTree: null,
|
|
3630
|
+
effect: null,
|
|
3631
|
+
update: null,
|
|
3632
|
+
scope: new EffectScope(true),
|
|
3633
|
+
render: null,
|
|
3634
|
+
proxy: null,
|
|
3635
|
+
exposed: null,
|
|
3636
|
+
exposeProxy: null,
|
|
3637
|
+
withProxy: null,
|
|
3638
|
+
provides: parent ? parent.provides : Object.create(appContext.provides),
|
|
3639
|
+
accessCache: null,
|
|
3640
|
+
renderCache: [],
|
|
3641
|
+
components: null,
|
|
3642
|
+
directives: null,
|
|
3643
|
+
propsOptions: normalizePropsOptions(type, appContext),
|
|
3644
|
+
emitsOptions: normalizeEmitsOptions(type, appContext),
|
|
3645
|
+
emit: null,
|
|
3646
|
+
emitted: null,
|
|
3647
|
+
propsDefaults: EMPTY_OBJ,
|
|
3648
|
+
inheritAttrs: type.inheritAttrs,
|
|
3649
|
+
ctx: EMPTY_OBJ,
|
|
3650
|
+
data: EMPTY_OBJ,
|
|
3651
|
+
props: EMPTY_OBJ,
|
|
3652
|
+
attrs: EMPTY_OBJ,
|
|
3653
|
+
slots: EMPTY_OBJ,
|
|
3654
|
+
refs: EMPTY_OBJ,
|
|
3655
|
+
setupState: EMPTY_OBJ,
|
|
3656
|
+
setupContext: null,
|
|
3657
|
+
suspense,
|
|
3658
|
+
suspenseId: suspense ? suspense.pendingId : 0,
|
|
3659
|
+
asyncDep: null,
|
|
3660
|
+
asyncResolved: false,
|
|
3661
|
+
isMounted: false,
|
|
3662
|
+
isUnmounted: false,
|
|
3663
|
+
isDeactivated: false,
|
|
3664
|
+
bc: null,
|
|
3665
|
+
c: null,
|
|
3666
|
+
bm: null,
|
|
3667
|
+
m: null,
|
|
3668
|
+
bu: null,
|
|
3669
|
+
u: null,
|
|
3670
|
+
um: null,
|
|
3671
|
+
bum: null,
|
|
3672
|
+
da: null,
|
|
3673
|
+
a: null,
|
|
3674
|
+
rtg: null,
|
|
3675
|
+
rtc: null,
|
|
3676
|
+
ec: null,
|
|
3677
|
+
sp: null
|
|
3678
|
+
};
|
|
3679
|
+
{
|
|
3680
|
+
instance.ctx = { _: instance };
|
|
3681
|
+
}
|
|
3682
|
+
instance.root = parent ? parent.root : instance;
|
|
3683
|
+
instance.emit = emit$1.bind(null, instance);
|
|
3684
|
+
if (vnode.ce) {
|
|
3685
|
+
vnode.ce(instance);
|
|
3686
|
+
}
|
|
3687
|
+
return instance;
|
|
3688
|
+
}
|
|
3689
|
+
let currentInstance = null;
|
|
3690
|
+
const getCurrentInstance = () => currentInstance || currentRenderingInstance;
|
|
3691
|
+
const setCurrentInstance = (instance) => {
|
|
3692
|
+
currentInstance = instance;
|
|
3693
|
+
instance.scope.on();
|
|
3694
|
+
};
|
|
3695
|
+
const unsetCurrentInstance = () => {
|
|
3696
|
+
currentInstance && currentInstance.scope.off();
|
|
3697
|
+
currentInstance = null;
|
|
3698
|
+
};
|
|
3699
|
+
function isStatefulComponent(instance) {
|
|
3700
|
+
return instance.vnode.shapeFlag & 4;
|
|
3701
|
+
}
|
|
3702
|
+
let isInSSRComponentSetup = false;
|
|
3703
|
+
function setupComponent(instance, isSSR = false) {
|
|
3704
|
+
isInSSRComponentSetup = isSSR;
|
|
3705
|
+
const { props, children } = instance.vnode;
|
|
3706
|
+
const isStateful = isStatefulComponent(instance);
|
|
3707
|
+
initProps(instance, props, isStateful, isSSR);
|
|
3708
|
+
initSlots(instance, children);
|
|
3709
|
+
const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
|
|
3710
|
+
isInSSRComponentSetup = false;
|
|
3711
|
+
return setupResult;
|
|
3712
|
+
}
|
|
3713
|
+
function setupStatefulComponent(instance, isSSR) {
|
|
3714
|
+
const Component = instance.type;
|
|
3715
|
+
instance.accessCache = Object.create(null);
|
|
3716
|
+
instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
|
|
3717
|
+
const { setup } = Component;
|
|
3718
|
+
if (setup) {
|
|
3719
|
+
const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
|
|
3720
|
+
setCurrentInstance(instance);
|
|
3721
|
+
pauseTracking();
|
|
3722
|
+
const setupResult = callWithErrorHandling(setup, instance, 0, [instance.props, setupContext]);
|
|
3723
|
+
resetTracking();
|
|
3724
|
+
unsetCurrentInstance();
|
|
3725
|
+
if (isPromise(setupResult)) {
|
|
3726
|
+
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
3727
|
+
if (isSSR) {
|
|
3728
|
+
return setupResult.then((resolvedResult) => {
|
|
3729
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
3730
|
+
}).catch((e) => {
|
|
3731
|
+
handleError(e, instance, 0);
|
|
3732
|
+
});
|
|
3733
|
+
} else {
|
|
3734
|
+
instance.asyncDep = setupResult;
|
|
3735
|
+
}
|
|
3736
|
+
} else {
|
|
3737
|
+
handleSetupResult(instance, setupResult, isSSR);
|
|
3738
|
+
}
|
|
3739
|
+
} else {
|
|
3740
|
+
finishComponentSetup(instance, isSSR);
|
|
3741
|
+
}
|
|
3742
|
+
}
|
|
3743
|
+
function handleSetupResult(instance, setupResult, isSSR) {
|
|
3744
|
+
if (isFunction(setupResult)) {
|
|
3745
|
+
if (instance.type.__ssrInlineRender) {
|
|
3746
|
+
instance.ssrRender = setupResult;
|
|
3747
|
+
} else {
|
|
3748
|
+
instance.render = setupResult;
|
|
3749
|
+
}
|
|
3750
|
+
} else if (isObject(setupResult)) {
|
|
3751
|
+
instance.setupState = proxyRefs(setupResult);
|
|
3752
|
+
} else
|
|
3753
|
+
;
|
|
3754
|
+
finishComponentSetup(instance, isSSR);
|
|
3755
|
+
}
|
|
3756
|
+
let compile;
|
|
3757
|
+
function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
3758
|
+
const Component = instance.type;
|
|
3759
|
+
if (!instance.render) {
|
|
3760
|
+
if (!isSSR && compile && !Component.render) {
|
|
3761
|
+
const template = Component.template;
|
|
3762
|
+
if (template) {
|
|
3763
|
+
const { isCustomElement, compilerOptions } = instance.appContext.config;
|
|
3764
|
+
const { delimiters, compilerOptions: componentCompilerOptions } = Component;
|
|
3765
|
+
const finalCompilerOptions = extend(extend({
|
|
3766
|
+
isCustomElement,
|
|
3767
|
+
delimiters
|
|
3768
|
+
}, compilerOptions), componentCompilerOptions);
|
|
3769
|
+
Component.render = compile(template, finalCompilerOptions);
|
|
3770
|
+
}
|
|
3771
|
+
}
|
|
3772
|
+
instance.render = Component.render || NOOP;
|
|
3773
|
+
}
|
|
3774
|
+
{
|
|
3775
|
+
setCurrentInstance(instance);
|
|
3776
|
+
pauseTracking();
|
|
3777
|
+
applyOptions(instance);
|
|
3778
|
+
resetTracking();
|
|
3779
|
+
unsetCurrentInstance();
|
|
3780
|
+
}
|
|
3781
|
+
}
|
|
3782
|
+
function createAttrsProxy(instance) {
|
|
3783
|
+
return new Proxy(instance.attrs, {
|
|
3784
|
+
get(target, key) {
|
|
3785
|
+
track(instance, "get", "$attrs");
|
|
3786
|
+
return target[key];
|
|
3787
|
+
}
|
|
3788
|
+
});
|
|
3789
|
+
}
|
|
3790
|
+
function createSetupContext(instance) {
|
|
3791
|
+
const expose = (exposed) => {
|
|
3792
|
+
instance.exposed = exposed || {};
|
|
3793
|
+
};
|
|
3794
|
+
let attrs;
|
|
3795
|
+
{
|
|
3796
|
+
return {
|
|
3797
|
+
get attrs() {
|
|
3798
|
+
return attrs || (attrs = createAttrsProxy(instance));
|
|
3799
|
+
},
|
|
3800
|
+
slots: instance.slots,
|
|
3801
|
+
emit: instance.emit,
|
|
3802
|
+
expose
|
|
3803
|
+
};
|
|
3804
|
+
}
|
|
3805
|
+
}
|
|
3806
|
+
function getExposeProxy(instance) {
|
|
3807
|
+
if (instance.exposed) {
|
|
3808
|
+
return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
|
|
3809
|
+
get(target, key) {
|
|
3810
|
+
if (key in target) {
|
|
3811
|
+
return target[key];
|
|
3812
|
+
} else if (key in publicPropertiesMap) {
|
|
3813
|
+
return publicPropertiesMap[key](instance);
|
|
3814
|
+
}
|
|
3815
|
+
}
|
|
3816
|
+
}));
|
|
3817
|
+
}
|
|
3818
|
+
}
|
|
3819
|
+
function isClassComponent(value) {
|
|
3820
|
+
return isFunction(value) && "__vccOpts" in value;
|
|
3821
|
+
}
|
|
3822
|
+
function callWithErrorHandling(fn, instance, type, args) {
|
|
3823
|
+
let res;
|
|
3824
|
+
try {
|
|
3825
|
+
res = args ? fn(...args) : fn();
|
|
3826
|
+
} catch (err) {
|
|
3827
|
+
handleError(err, instance, type);
|
|
3828
|
+
}
|
|
3829
|
+
return res;
|
|
3830
|
+
}
|
|
3831
|
+
function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
3832
|
+
if (isFunction(fn)) {
|
|
3833
|
+
const res = callWithErrorHandling(fn, instance, type, args);
|
|
3834
|
+
if (res && isPromise(res)) {
|
|
3835
|
+
res.catch((err) => {
|
|
3836
|
+
handleError(err, instance, type);
|
|
3837
|
+
});
|
|
3838
|
+
}
|
|
3839
|
+
return res;
|
|
3840
|
+
}
|
|
3841
|
+
const values = [];
|
|
3842
|
+
for (let i = 0; i < fn.length; i++) {
|
|
3843
|
+
values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
|
|
3844
|
+
}
|
|
3845
|
+
return values;
|
|
3846
|
+
}
|
|
3847
|
+
function handleError(err, instance, type, throwInDev = true) {
|
|
3848
|
+
const contextVNode = instance ? instance.vnode : null;
|
|
3849
|
+
if (instance) {
|
|
3850
|
+
let cur = instance.parent;
|
|
3851
|
+
const exposedInstance = instance.proxy;
|
|
3852
|
+
const errorInfo = type;
|
|
3853
|
+
while (cur) {
|
|
3854
|
+
const errorCapturedHooks = cur.ec;
|
|
3855
|
+
if (errorCapturedHooks) {
|
|
3856
|
+
for (let i = 0; i < errorCapturedHooks.length; i++) {
|
|
3857
|
+
if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
|
|
3858
|
+
return;
|
|
3859
|
+
}
|
|
3860
|
+
}
|
|
3861
|
+
}
|
|
3862
|
+
cur = cur.parent;
|
|
3863
|
+
}
|
|
3864
|
+
const appErrorHandler = instance.appContext.config.errorHandler;
|
|
3865
|
+
if (appErrorHandler) {
|
|
3866
|
+
callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]);
|
|
3867
|
+
return;
|
|
3868
|
+
}
|
|
3869
|
+
}
|
|
3870
|
+
logError(err, type, contextVNode, throwInDev);
|
|
3871
|
+
}
|
|
3872
|
+
function logError(err, type, contextVNode, throwInDev = true) {
|
|
3873
|
+
{
|
|
3874
|
+
console.error(err);
|
|
3875
|
+
}
|
|
3876
|
+
}
|
|
3877
|
+
let isFlushing = false;
|
|
3878
|
+
let isFlushPending = false;
|
|
3879
|
+
const queue = [];
|
|
3880
|
+
let flushIndex = 0;
|
|
3881
|
+
const pendingPreFlushCbs = [];
|
|
3882
|
+
let activePreFlushCbs = null;
|
|
3883
|
+
let preFlushIndex = 0;
|
|
3884
|
+
const pendingPostFlushCbs = [];
|
|
3885
|
+
let activePostFlushCbs = null;
|
|
3886
|
+
let postFlushIndex = 0;
|
|
3887
|
+
const resolvedPromise = Promise.resolve();
|
|
3888
|
+
let currentFlushPromise = null;
|
|
3889
|
+
let currentPreFlushParentJob = null;
|
|
3890
|
+
function nextTick(fn) {
|
|
3891
|
+
const p2 = currentFlushPromise || resolvedPromise;
|
|
3892
|
+
return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
|
|
3893
|
+
}
|
|
3894
|
+
function findInsertionIndex(id) {
|
|
3895
|
+
let start = flushIndex + 1;
|
|
3896
|
+
let end = queue.length;
|
|
3897
|
+
while (start < end) {
|
|
3898
|
+
const middle = start + end >>> 1;
|
|
3899
|
+
const middleJobId = getId(queue[middle]);
|
|
3900
|
+
middleJobId < id ? start = middle + 1 : end = middle;
|
|
3901
|
+
}
|
|
3902
|
+
return start;
|
|
3903
|
+
}
|
|
3904
|
+
function queueJob(job) {
|
|
3905
|
+
if ((!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) && job !== currentPreFlushParentJob) {
|
|
3906
|
+
if (job.id == null) {
|
|
3907
|
+
queue.push(job);
|
|
3908
|
+
} else {
|
|
3909
|
+
queue.splice(findInsertionIndex(job.id), 0, job);
|
|
3910
|
+
}
|
|
3911
|
+
queueFlush();
|
|
3912
|
+
}
|
|
3913
|
+
}
|
|
3914
|
+
function queueFlush() {
|
|
3915
|
+
if (!isFlushing && !isFlushPending) {
|
|
3916
|
+
isFlushPending = true;
|
|
3917
|
+
currentFlushPromise = resolvedPromise.then(flushJobs);
|
|
3918
|
+
}
|
|
3919
|
+
}
|
|
3920
|
+
function invalidateJob(job) {
|
|
3921
|
+
const i = queue.indexOf(job);
|
|
3922
|
+
if (i > flushIndex) {
|
|
3923
|
+
queue.splice(i, 1);
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3926
|
+
function queueCb(cb, activeQueue, pendingQueue, index) {
|
|
3927
|
+
if (!isArray(cb)) {
|
|
3928
|
+
if (!activeQueue || !activeQueue.includes(cb, cb.allowRecurse ? index + 1 : index)) {
|
|
3929
|
+
pendingQueue.push(cb);
|
|
3930
|
+
}
|
|
3931
|
+
} else {
|
|
3932
|
+
pendingQueue.push(...cb);
|
|
3933
|
+
}
|
|
3934
|
+
queueFlush();
|
|
3935
|
+
}
|
|
3936
|
+
function queuePreFlushCb(cb) {
|
|
3937
|
+
queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);
|
|
3938
|
+
}
|
|
3939
|
+
function queuePostFlushCb(cb) {
|
|
3940
|
+
queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);
|
|
3941
|
+
}
|
|
3942
|
+
function flushPreFlushCbs(seen, parentJob = null) {
|
|
3943
|
+
if (pendingPreFlushCbs.length) {
|
|
3944
|
+
currentPreFlushParentJob = parentJob;
|
|
3945
|
+
activePreFlushCbs = [...new Set(pendingPreFlushCbs)];
|
|
3946
|
+
pendingPreFlushCbs.length = 0;
|
|
3947
|
+
for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {
|
|
3948
|
+
activePreFlushCbs[preFlushIndex]();
|
|
3949
|
+
}
|
|
3950
|
+
activePreFlushCbs = null;
|
|
3951
|
+
preFlushIndex = 0;
|
|
3952
|
+
currentPreFlushParentJob = null;
|
|
3953
|
+
flushPreFlushCbs(seen, parentJob);
|
|
3954
|
+
}
|
|
3955
|
+
}
|
|
3956
|
+
function flushPostFlushCbs(seen) {
|
|
3957
|
+
if (pendingPostFlushCbs.length) {
|
|
3958
|
+
const deduped = [...new Set(pendingPostFlushCbs)];
|
|
3959
|
+
pendingPostFlushCbs.length = 0;
|
|
3960
|
+
if (activePostFlushCbs) {
|
|
3961
|
+
activePostFlushCbs.push(...deduped);
|
|
3962
|
+
return;
|
|
3963
|
+
}
|
|
3964
|
+
activePostFlushCbs = deduped;
|
|
3965
|
+
activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
|
|
3966
|
+
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
|
|
3967
|
+
activePostFlushCbs[postFlushIndex]();
|
|
3968
|
+
}
|
|
3969
|
+
activePostFlushCbs = null;
|
|
3970
|
+
postFlushIndex = 0;
|
|
3971
|
+
}
|
|
3972
|
+
}
|
|
3973
|
+
const getId = (job) => job.id == null ? Infinity : job.id;
|
|
3974
|
+
function flushJobs(seen) {
|
|
3975
|
+
isFlushPending = false;
|
|
3976
|
+
isFlushing = true;
|
|
3977
|
+
flushPreFlushCbs(seen);
|
|
3978
|
+
queue.sort((a, b) => getId(a) - getId(b));
|
|
3979
|
+
const check = NOOP;
|
|
3980
|
+
try {
|
|
3981
|
+
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
3982
|
+
const job = queue[flushIndex];
|
|
3983
|
+
if (job && job.active !== false) {
|
|
3984
|
+
if (false)
|
|
3985
|
+
;
|
|
3986
|
+
callWithErrorHandling(job, null, 14);
|
|
3987
|
+
}
|
|
3988
|
+
}
|
|
3989
|
+
} finally {
|
|
3990
|
+
flushIndex = 0;
|
|
3991
|
+
queue.length = 0;
|
|
3992
|
+
flushPostFlushCbs();
|
|
3993
|
+
isFlushing = false;
|
|
3994
|
+
currentFlushPromise = null;
|
|
3995
|
+
if (queue.length || pendingPreFlushCbs.length || pendingPostFlushCbs.length) {
|
|
3996
|
+
flushJobs(seen);
|
|
3997
|
+
}
|
|
3998
|
+
}
|
|
3999
|
+
}
|
|
4000
|
+
const INITIAL_WATCHER_VALUE = {};
|
|
4001
|
+
function watch(source, cb, options) {
|
|
4002
|
+
return doWatch(source, cb, options);
|
|
4003
|
+
}
|
|
4004
|
+
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
4005
|
+
const instance = currentInstance;
|
|
4006
|
+
let getter;
|
|
4007
|
+
let forceTrigger = false;
|
|
4008
|
+
let isMultiSource = false;
|
|
4009
|
+
if (isRef(source)) {
|
|
4010
|
+
getter = () => source.value;
|
|
4011
|
+
forceTrigger = !!source._shallow;
|
|
4012
|
+
} else if (isReactive(source)) {
|
|
4013
|
+
getter = () => source;
|
|
4014
|
+
deep = true;
|
|
4015
|
+
} else if (isArray(source)) {
|
|
4016
|
+
isMultiSource = true;
|
|
4017
|
+
forceTrigger = source.some(isReactive);
|
|
4018
|
+
getter = () => source.map((s) => {
|
|
4019
|
+
if (isRef(s)) {
|
|
4020
|
+
return s.value;
|
|
4021
|
+
} else if (isReactive(s)) {
|
|
4022
|
+
return traverse(s);
|
|
4023
|
+
} else if (isFunction(s)) {
|
|
4024
|
+
return callWithErrorHandling(s, instance, 2);
|
|
4025
|
+
} else
|
|
4026
|
+
;
|
|
4027
|
+
});
|
|
4028
|
+
} else if (isFunction(source)) {
|
|
4029
|
+
if (cb) {
|
|
4030
|
+
getter = () => callWithErrorHandling(source, instance, 2);
|
|
4031
|
+
} else {
|
|
4032
|
+
getter = () => {
|
|
4033
|
+
if (instance && instance.isUnmounted) {
|
|
4034
|
+
return;
|
|
4035
|
+
}
|
|
4036
|
+
if (cleanup) {
|
|
4037
|
+
cleanup();
|
|
4038
|
+
}
|
|
4039
|
+
return callWithAsyncErrorHandling(source, instance, 3, [onInvalidate]);
|
|
4040
|
+
};
|
|
4041
|
+
}
|
|
4042
|
+
} else {
|
|
4043
|
+
getter = NOOP;
|
|
4044
|
+
}
|
|
4045
|
+
if (cb && deep) {
|
|
4046
|
+
const baseGetter = getter;
|
|
4047
|
+
getter = () => traverse(baseGetter());
|
|
4048
|
+
}
|
|
4049
|
+
let cleanup;
|
|
4050
|
+
let onInvalidate = (fn) => {
|
|
4051
|
+
cleanup = effect.onStop = () => {
|
|
4052
|
+
callWithErrorHandling(fn, instance, 4);
|
|
4053
|
+
};
|
|
4054
|
+
};
|
|
4055
|
+
if (isInSSRComponentSetup) {
|
|
4056
|
+
onInvalidate = NOOP;
|
|
4057
|
+
if (!cb) {
|
|
4058
|
+
getter();
|
|
4059
|
+
} else if (immediate) {
|
|
4060
|
+
callWithAsyncErrorHandling(cb, instance, 3, [
|
|
4061
|
+
getter(),
|
|
4062
|
+
isMultiSource ? [] : void 0,
|
|
4063
|
+
onInvalidate
|
|
4064
|
+
]);
|
|
4065
|
+
}
|
|
4066
|
+
return NOOP;
|
|
4067
|
+
}
|
|
4068
|
+
let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
|
|
4069
|
+
const job = () => {
|
|
4070
|
+
if (!effect.active) {
|
|
4071
|
+
return;
|
|
4072
|
+
}
|
|
4073
|
+
if (cb) {
|
|
4074
|
+
const newValue = effect.run();
|
|
4075
|
+
if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
|
|
4076
|
+
if (cleanup) {
|
|
4077
|
+
cleanup();
|
|
4078
|
+
}
|
|
4079
|
+
callWithAsyncErrorHandling(cb, instance, 3, [
|
|
4080
|
+
newValue,
|
|
4081
|
+
oldValue === INITIAL_WATCHER_VALUE ? void 0 : oldValue,
|
|
4082
|
+
onInvalidate
|
|
4083
|
+
]);
|
|
4084
|
+
oldValue = newValue;
|
|
4085
|
+
}
|
|
4086
|
+
} else {
|
|
4087
|
+
effect.run();
|
|
4088
|
+
}
|
|
4089
|
+
};
|
|
4090
|
+
job.allowRecurse = !!cb;
|
|
4091
|
+
let scheduler;
|
|
4092
|
+
if (flush === "sync") {
|
|
4093
|
+
scheduler = job;
|
|
4094
|
+
} else if (flush === "post") {
|
|
4095
|
+
scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
|
|
4096
|
+
} else {
|
|
4097
|
+
scheduler = () => {
|
|
4098
|
+
if (!instance || instance.isMounted) {
|
|
4099
|
+
queuePreFlushCb(job);
|
|
4100
|
+
} else {
|
|
4101
|
+
job();
|
|
4102
|
+
}
|
|
4103
|
+
};
|
|
4104
|
+
}
|
|
4105
|
+
const effect = new ReactiveEffect(getter, scheduler);
|
|
4106
|
+
if (cb) {
|
|
4107
|
+
if (immediate) {
|
|
4108
|
+
job();
|
|
4109
|
+
} else {
|
|
4110
|
+
oldValue = effect.run();
|
|
4111
|
+
}
|
|
4112
|
+
} else if (flush === "post") {
|
|
4113
|
+
queuePostRenderEffect(effect.run.bind(effect), instance && instance.suspense);
|
|
4114
|
+
} else {
|
|
4115
|
+
effect.run();
|
|
4116
|
+
}
|
|
4117
|
+
return () => {
|
|
4118
|
+
effect.stop();
|
|
4119
|
+
if (instance && instance.scope) {
|
|
4120
|
+
remove(instance.scope.effects, effect);
|
|
4121
|
+
}
|
|
4122
|
+
};
|
|
4123
|
+
}
|
|
4124
|
+
function instanceWatch(source, value, options) {
|
|
4125
|
+
const publicThis = this.proxy;
|
|
4126
|
+
const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
4127
|
+
let cb;
|
|
4128
|
+
if (isFunction(value)) {
|
|
4129
|
+
cb = value;
|
|
4130
|
+
} else {
|
|
4131
|
+
cb = value.handler;
|
|
4132
|
+
options = value;
|
|
4133
|
+
}
|
|
4134
|
+
const cur = currentInstance;
|
|
4135
|
+
setCurrentInstance(this);
|
|
4136
|
+
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
4137
|
+
if (cur) {
|
|
4138
|
+
setCurrentInstance(cur);
|
|
4139
|
+
} else {
|
|
4140
|
+
unsetCurrentInstance();
|
|
4141
|
+
}
|
|
4142
|
+
return res;
|
|
4143
|
+
}
|
|
4144
|
+
function createPathGetter(ctx, path) {
|
|
4145
|
+
const segments = path.split(".");
|
|
4146
|
+
return () => {
|
|
4147
|
+
let cur = ctx;
|
|
4148
|
+
for (let i = 0; i < segments.length && cur; i++) {
|
|
4149
|
+
cur = cur[segments[i]];
|
|
4150
|
+
}
|
|
4151
|
+
return cur;
|
|
4152
|
+
};
|
|
4153
|
+
}
|
|
4154
|
+
function traverse(value, seen) {
|
|
4155
|
+
if (!isObject(value) || value["__v_skip"]) {
|
|
4156
|
+
return value;
|
|
4157
|
+
}
|
|
4158
|
+
seen = seen || new Set();
|
|
4159
|
+
if (seen.has(value)) {
|
|
4160
|
+
return value;
|
|
4161
|
+
}
|
|
4162
|
+
seen.add(value);
|
|
4163
|
+
if (isRef(value)) {
|
|
4164
|
+
traverse(value.value, seen);
|
|
4165
|
+
} else if (isArray(value)) {
|
|
4166
|
+
for (let i = 0; i < value.length; i++) {
|
|
4167
|
+
traverse(value[i], seen);
|
|
4168
|
+
}
|
|
4169
|
+
} else if (isSet(value) || isMap(value)) {
|
|
4170
|
+
value.forEach((v) => {
|
|
4171
|
+
traverse(v, seen);
|
|
4172
|
+
});
|
|
4173
|
+
} else if (isPlainObject(value)) {
|
|
4174
|
+
for (const key in value) {
|
|
4175
|
+
traverse(value[key], seen);
|
|
4176
|
+
}
|
|
4177
|
+
}
|
|
4178
|
+
return value;
|
|
4179
|
+
}
|
|
4180
|
+
const version = "3.2.26";
|
|
4181
|
+
const svgNS = "http://www.w3.org/2000/svg";
|
|
4182
|
+
const doc = typeof document !== "undefined" ? document : null;
|
|
4183
|
+
const staticTemplateCache = new Map();
|
|
4184
|
+
const nodeOps = {
|
|
4185
|
+
insert: (child, parent, anchor) => {
|
|
4186
|
+
parent.insertBefore(child, anchor || null);
|
|
4187
|
+
},
|
|
4188
|
+
remove: (child) => {
|
|
4189
|
+
const parent = child.parentNode;
|
|
4190
|
+
if (parent) {
|
|
4191
|
+
parent.removeChild(child);
|
|
4192
|
+
}
|
|
4193
|
+
},
|
|
4194
|
+
createElement: (tag, isSVG, is, props) => {
|
|
4195
|
+
const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0);
|
|
4196
|
+
if (tag === "select" && props && props.multiple != null) {
|
|
4197
|
+
el.setAttribute("multiple", props.multiple);
|
|
4198
|
+
}
|
|
4199
|
+
return el;
|
|
4200
|
+
},
|
|
4201
|
+
createText: (text) => doc.createTextNode(text),
|
|
4202
|
+
createComment: (text) => doc.createComment(text),
|
|
4203
|
+
setText: (node, text) => {
|
|
4204
|
+
node.nodeValue = text;
|
|
4205
|
+
},
|
|
4206
|
+
setElementText: (el, text) => {
|
|
4207
|
+
el.textContent = text;
|
|
4208
|
+
},
|
|
4209
|
+
parentNode: (node) => node.parentNode,
|
|
4210
|
+
nextSibling: (node) => node.nextSibling,
|
|
4211
|
+
querySelector: (selector) => doc.querySelector(selector),
|
|
4212
|
+
setScopeId(el, id) {
|
|
4213
|
+
el.setAttribute(id, "");
|
|
4214
|
+
},
|
|
4215
|
+
cloneNode(el) {
|
|
4216
|
+
const cloned = el.cloneNode(true);
|
|
4217
|
+
if (`_value` in el) {
|
|
4218
|
+
cloned._value = el._value;
|
|
4219
|
+
}
|
|
4220
|
+
return cloned;
|
|
4221
|
+
},
|
|
4222
|
+
insertStaticContent(content, parent, anchor, isSVG) {
|
|
4223
|
+
const before = anchor ? anchor.previousSibling : parent.lastChild;
|
|
4224
|
+
let template = staticTemplateCache.get(content);
|
|
4225
|
+
if (!template) {
|
|
4226
|
+
const t = doc.createElement("template");
|
|
4227
|
+
t.innerHTML = isSVG ? `<svg>${content}</svg>` : content;
|
|
4228
|
+
template = t.content;
|
|
4229
|
+
if (isSVG) {
|
|
4230
|
+
const wrapper = template.firstChild;
|
|
4231
|
+
while (wrapper.firstChild) {
|
|
4232
|
+
template.appendChild(wrapper.firstChild);
|
|
4233
|
+
}
|
|
4234
|
+
template.removeChild(wrapper);
|
|
4235
|
+
}
|
|
4236
|
+
staticTemplateCache.set(content, template);
|
|
4237
|
+
}
|
|
4238
|
+
parent.insertBefore(template.cloneNode(true), anchor);
|
|
4239
|
+
return [
|
|
4240
|
+
before ? before.nextSibling : parent.firstChild,
|
|
4241
|
+
anchor ? anchor.previousSibling : parent.lastChild
|
|
4242
|
+
];
|
|
4243
|
+
}
|
|
4244
|
+
};
|
|
4245
|
+
function patchClass(el, value, isSVG) {
|
|
4246
|
+
const transitionClasses = el._vtc;
|
|
4247
|
+
if (transitionClasses) {
|
|
4248
|
+
value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
|
|
4249
|
+
}
|
|
4250
|
+
if (value == null) {
|
|
4251
|
+
el.removeAttribute("class");
|
|
4252
|
+
} else if (isSVG) {
|
|
4253
|
+
el.setAttribute("class", value);
|
|
4254
|
+
} else {
|
|
4255
|
+
el.className = value;
|
|
4256
|
+
}
|
|
4257
|
+
}
|
|
4258
|
+
function patchStyle(el, prev, next) {
|
|
4259
|
+
const style = el.style;
|
|
4260
|
+
const isCssString = isString(next);
|
|
4261
|
+
if (next && !isCssString) {
|
|
4262
|
+
for (const key in next) {
|
|
4263
|
+
setStyle(style, key, next[key]);
|
|
4264
|
+
}
|
|
4265
|
+
if (prev && !isString(prev)) {
|
|
4266
|
+
for (const key in prev) {
|
|
4267
|
+
if (next[key] == null) {
|
|
4268
|
+
setStyle(style, key, "");
|
|
4269
|
+
}
|
|
4270
|
+
}
|
|
4271
|
+
}
|
|
4272
|
+
} else {
|
|
4273
|
+
const currentDisplay = style.display;
|
|
4274
|
+
if (isCssString) {
|
|
4275
|
+
if (prev !== next) {
|
|
4276
|
+
style.cssText = next;
|
|
4277
|
+
}
|
|
4278
|
+
} else if (prev) {
|
|
4279
|
+
el.removeAttribute("style");
|
|
4280
|
+
}
|
|
4281
|
+
if ("_vod" in el) {
|
|
4282
|
+
style.display = currentDisplay;
|
|
4283
|
+
}
|
|
4284
|
+
}
|
|
4285
|
+
}
|
|
4286
|
+
const importantRE = /\s*!important$/;
|
|
4287
|
+
function setStyle(style, name, val) {
|
|
4288
|
+
if (isArray(val)) {
|
|
4289
|
+
val.forEach((v) => setStyle(style, name, v));
|
|
4290
|
+
} else {
|
|
4291
|
+
if (name.startsWith("--")) {
|
|
4292
|
+
style.setProperty(name, val);
|
|
4293
|
+
} else {
|
|
4294
|
+
const prefixed = autoPrefix(style, name);
|
|
4295
|
+
if (importantRE.test(val)) {
|
|
4296
|
+
style.setProperty(hyphenate(prefixed), val.replace(importantRE, ""), "important");
|
|
4297
|
+
} else {
|
|
4298
|
+
style[prefixed] = val;
|
|
4299
|
+
}
|
|
4300
|
+
}
|
|
4301
|
+
}
|
|
4302
|
+
}
|
|
4303
|
+
const prefixes = ["Webkit", "Moz", "ms"];
|
|
4304
|
+
const prefixCache = {};
|
|
4305
|
+
function autoPrefix(style, rawName) {
|
|
4306
|
+
const cached = prefixCache[rawName];
|
|
4307
|
+
if (cached) {
|
|
4308
|
+
return cached;
|
|
4309
|
+
}
|
|
4310
|
+
let name = camelize(rawName);
|
|
4311
|
+
if (name !== "filter" && name in style) {
|
|
4312
|
+
return prefixCache[rawName] = name;
|
|
4313
|
+
}
|
|
4314
|
+
name = capitalize(name);
|
|
4315
|
+
for (let i = 0; i < prefixes.length; i++) {
|
|
4316
|
+
const prefixed = prefixes[i] + name;
|
|
4317
|
+
if (prefixed in style) {
|
|
4318
|
+
return prefixCache[rawName] = prefixed;
|
|
4319
|
+
}
|
|
4320
|
+
}
|
|
4321
|
+
return rawName;
|
|
4322
|
+
}
|
|
4323
|
+
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
4324
|
+
function patchAttr(el, key, value, isSVG, instance) {
|
|
4325
|
+
if (isSVG && key.startsWith("xlink:")) {
|
|
4326
|
+
if (value == null) {
|
|
4327
|
+
el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
|
|
4328
|
+
} else {
|
|
4329
|
+
el.setAttributeNS(xlinkNS, key, value);
|
|
4330
|
+
}
|
|
4331
|
+
} else {
|
|
4332
|
+
const isBoolean = isSpecialBooleanAttr(key);
|
|
4333
|
+
if (value == null || isBoolean && !includeBooleanAttr(value)) {
|
|
4334
|
+
el.removeAttribute(key);
|
|
4335
|
+
} else {
|
|
4336
|
+
el.setAttribute(key, isBoolean ? "" : value);
|
|
4337
|
+
}
|
|
4338
|
+
}
|
|
4339
|
+
}
|
|
4340
|
+
function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
4341
|
+
if (key === "innerHTML" || key === "textContent") {
|
|
4342
|
+
if (prevChildren) {
|
|
4343
|
+
unmountChildren(prevChildren, parentComponent, parentSuspense);
|
|
4344
|
+
}
|
|
4345
|
+
el[key] = value == null ? "" : value;
|
|
4346
|
+
return;
|
|
4347
|
+
}
|
|
4348
|
+
if (key === "value" && el.tagName !== "PROGRESS" && !el.tagName.includes("-")) {
|
|
4349
|
+
el._value = value;
|
|
4350
|
+
const newValue = value == null ? "" : value;
|
|
4351
|
+
if (el.value !== newValue || el.tagName === "OPTION") {
|
|
4352
|
+
el.value = newValue;
|
|
4353
|
+
}
|
|
4354
|
+
if (value == null) {
|
|
4355
|
+
el.removeAttribute(key);
|
|
4356
|
+
}
|
|
4357
|
+
return;
|
|
4358
|
+
}
|
|
4359
|
+
if (value === "" || value == null) {
|
|
4360
|
+
const type = typeof el[key];
|
|
4361
|
+
if (type === "boolean") {
|
|
4362
|
+
el[key] = includeBooleanAttr(value);
|
|
4363
|
+
return;
|
|
4364
|
+
} else if (value == null && type === "string") {
|
|
4365
|
+
el[key] = "";
|
|
4366
|
+
el.removeAttribute(key);
|
|
4367
|
+
return;
|
|
4368
|
+
} else if (type === "number") {
|
|
4369
|
+
try {
|
|
4370
|
+
el[key] = 0;
|
|
4371
|
+
} catch (_a) {
|
|
4372
|
+
}
|
|
4373
|
+
el.removeAttribute(key);
|
|
4374
|
+
return;
|
|
4375
|
+
}
|
|
4376
|
+
}
|
|
4377
|
+
try {
|
|
4378
|
+
el[key] = value;
|
|
4379
|
+
} catch (e) {
|
|
4380
|
+
}
|
|
4381
|
+
}
|
|
4382
|
+
let _getNow = Date.now;
|
|
4383
|
+
let skipTimestampCheck = false;
|
|
4384
|
+
if (typeof window !== "undefined") {
|
|
4385
|
+
if (_getNow() > document.createEvent("Event").timeStamp) {
|
|
4386
|
+
_getNow = () => performance.now();
|
|
4387
|
+
}
|
|
4388
|
+
const ffMatch = navigator.userAgent.match(/firefox\/(\d+)/i);
|
|
4389
|
+
skipTimestampCheck = !!(ffMatch && Number(ffMatch[1]) <= 53);
|
|
4390
|
+
}
|
|
4391
|
+
let cachedNow = 0;
|
|
4392
|
+
const p = Promise.resolve();
|
|
4393
|
+
const reset = () => {
|
|
4394
|
+
cachedNow = 0;
|
|
4395
|
+
};
|
|
4396
|
+
const getNow = () => cachedNow || (p.then(reset), cachedNow = _getNow());
|
|
4397
|
+
function addEventListener(el, event, handler, options) {
|
|
4398
|
+
el.addEventListener(event, handler, options);
|
|
4399
|
+
}
|
|
4400
|
+
function removeEventListener(el, event, handler, options) {
|
|
4401
|
+
el.removeEventListener(event, handler, options);
|
|
4402
|
+
}
|
|
4403
|
+
function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
4404
|
+
const invokers = el._vei || (el._vei = {});
|
|
4405
|
+
const existingInvoker = invokers[rawName];
|
|
4406
|
+
if (nextValue && existingInvoker) {
|
|
4407
|
+
existingInvoker.value = nextValue;
|
|
4408
|
+
} else {
|
|
4409
|
+
const [name, options] = parseName(rawName);
|
|
4410
|
+
if (nextValue) {
|
|
4411
|
+
const invoker = invokers[rawName] = createInvoker(nextValue, instance);
|
|
4412
|
+
addEventListener(el, name, invoker, options);
|
|
4413
|
+
} else if (existingInvoker) {
|
|
4414
|
+
removeEventListener(el, name, existingInvoker, options);
|
|
4415
|
+
invokers[rawName] = void 0;
|
|
4416
|
+
}
|
|
4417
|
+
}
|
|
4418
|
+
}
|
|
4419
|
+
const optionsModifierRE = /(?:Once|Passive|Capture)$/;
|
|
4420
|
+
function parseName(name) {
|
|
4421
|
+
let options;
|
|
4422
|
+
if (optionsModifierRE.test(name)) {
|
|
4423
|
+
options = {};
|
|
4424
|
+
let m;
|
|
4425
|
+
while (m = name.match(optionsModifierRE)) {
|
|
4426
|
+
name = name.slice(0, name.length - m[0].length);
|
|
4427
|
+
options[m[0].toLowerCase()] = true;
|
|
4428
|
+
}
|
|
4429
|
+
}
|
|
4430
|
+
return [hyphenate(name.slice(2)), options];
|
|
4431
|
+
}
|
|
4432
|
+
function createInvoker(initialValue, instance) {
|
|
4433
|
+
const invoker = (e) => {
|
|
4434
|
+
const timeStamp = e.timeStamp || _getNow();
|
|
4435
|
+
if (skipTimestampCheck || timeStamp >= invoker.attached - 1) {
|
|
4436
|
+
callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
|
|
4437
|
+
}
|
|
4438
|
+
};
|
|
4439
|
+
invoker.value = initialValue;
|
|
4440
|
+
invoker.attached = getNow();
|
|
4441
|
+
return invoker;
|
|
4442
|
+
}
|
|
4443
|
+
function patchStopImmediatePropagation(e, value) {
|
|
4444
|
+
if (isArray(value)) {
|
|
4445
|
+
const originalStop = e.stopImmediatePropagation;
|
|
4446
|
+
e.stopImmediatePropagation = () => {
|
|
4447
|
+
originalStop.call(e);
|
|
4448
|
+
e._stopped = true;
|
|
4449
|
+
};
|
|
4450
|
+
return value.map((fn) => (e2) => !e2._stopped && fn(e2));
|
|
4451
|
+
} else {
|
|
4452
|
+
return value;
|
|
4453
|
+
}
|
|
4454
|
+
}
|
|
4455
|
+
const nativeOnRE = /^on[a-z]/;
|
|
4456
|
+
const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
|
|
4457
|
+
if (key === "class") {
|
|
4458
|
+
patchClass(el, nextValue, isSVG);
|
|
4459
|
+
} else if (key === "style") {
|
|
4460
|
+
patchStyle(el, prevValue, nextValue);
|
|
4461
|
+
} else if (isOn(key)) {
|
|
4462
|
+
if (!isModelListener(key)) {
|
|
4463
|
+
patchEvent(el, key, prevValue, nextValue, parentComponent);
|
|
4464
|
+
}
|
|
4465
|
+
} else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
|
|
4466
|
+
patchDOMProp(el, key, nextValue, prevChildren, parentComponent, parentSuspense, unmountChildren);
|
|
4467
|
+
} else {
|
|
4468
|
+
if (key === "true-value") {
|
|
4469
|
+
el._trueValue = nextValue;
|
|
4470
|
+
} else if (key === "false-value") {
|
|
4471
|
+
el._falseValue = nextValue;
|
|
4472
|
+
}
|
|
4473
|
+
patchAttr(el, key, nextValue, isSVG);
|
|
4474
|
+
}
|
|
4475
|
+
};
|
|
4476
|
+
function shouldSetAsProp(el, key, value, isSVG) {
|
|
4477
|
+
if (isSVG) {
|
|
4478
|
+
if (key === "innerHTML" || key === "textContent") {
|
|
4479
|
+
return true;
|
|
4480
|
+
}
|
|
4481
|
+
if (key in el && nativeOnRE.test(key) && isFunction(value)) {
|
|
4482
|
+
return true;
|
|
4483
|
+
}
|
|
4484
|
+
return false;
|
|
4485
|
+
}
|
|
4486
|
+
if (key === "spellcheck" || key === "draggable") {
|
|
4487
|
+
return false;
|
|
4488
|
+
}
|
|
4489
|
+
if (key === "form") {
|
|
4490
|
+
return false;
|
|
4491
|
+
}
|
|
4492
|
+
if (key === "list" && el.tagName === "INPUT") {
|
|
4493
|
+
return false;
|
|
4494
|
+
}
|
|
4495
|
+
if (key === "type" && el.tagName === "TEXTAREA") {
|
|
4496
|
+
return false;
|
|
4497
|
+
}
|
|
4498
|
+
if (nativeOnRE.test(key) && isString(value)) {
|
|
4499
|
+
return false;
|
|
4500
|
+
}
|
|
4501
|
+
return key in el;
|
|
4502
|
+
}
|
|
4503
|
+
const DOMTransitionPropsValidators = {
|
|
4504
|
+
name: String,
|
|
4505
|
+
type: String,
|
|
4506
|
+
css: {
|
|
4507
|
+
type: Boolean,
|
|
4508
|
+
default: true
|
|
4509
|
+
},
|
|
4510
|
+
duration: [String, Number, Object],
|
|
4511
|
+
enterFromClass: String,
|
|
4512
|
+
enterActiveClass: String,
|
|
4513
|
+
enterToClass: String,
|
|
4514
|
+
appearFromClass: String,
|
|
4515
|
+
appearActiveClass: String,
|
|
4516
|
+
appearToClass: String,
|
|
4517
|
+
leaveFromClass: String,
|
|
4518
|
+
leaveActiveClass: String,
|
|
4519
|
+
leaveToClass: String
|
|
4520
|
+
};
|
|
4521
|
+
/* @__PURE__ */ extend({}, BaseTransition.props, DOMTransitionPropsValidators);
|
|
4522
|
+
const rendererOptions = extend({ patchProp }, nodeOps);
|
|
4523
|
+
let renderer;
|
|
4524
|
+
function ensureRenderer() {
|
|
4525
|
+
return renderer || (renderer = createRenderer(rendererOptions));
|
|
4526
|
+
}
|
|
4527
|
+
const createApp = (...args) => {
|
|
4528
|
+
const app = ensureRenderer().createApp(...args);
|
|
4529
|
+
const { mount } = app;
|
|
4530
|
+
app.mount = (containerOrSelector) => {
|
|
4531
|
+
const container = normalizeContainer(containerOrSelector);
|
|
4532
|
+
if (!container)
|
|
4533
|
+
return;
|
|
4534
|
+
const component = app._component;
|
|
4535
|
+
if (!isFunction(component) && !component.render && !component.template) {
|
|
4536
|
+
component.template = container.innerHTML;
|
|
4537
|
+
}
|
|
4538
|
+
container.innerHTML = "";
|
|
4539
|
+
const proxy = mount(container, false, container instanceof SVGElement);
|
|
4540
|
+
if (container instanceof Element) {
|
|
4541
|
+
container.removeAttribute("v-cloak");
|
|
4542
|
+
container.setAttribute("data-v-app", "");
|
|
4543
|
+
}
|
|
4544
|
+
return proxy;
|
|
4545
|
+
};
|
|
4546
|
+
return app;
|
|
4547
|
+
};
|
|
4548
|
+
function normalizeContainer(container) {
|
|
4549
|
+
if (isString(container)) {
|
|
4550
|
+
const res = document.querySelector(container);
|
|
4551
|
+
return res;
|
|
4552
|
+
}
|
|
4553
|
+
return container;
|
|
4554
|
+
}
|
|
4555
|
+
const _hoisted_1$3 = { class: "ck-button" };
|
|
4556
|
+
const _hoisted_2$3 = /* @__PURE__ */ createTextVNode("ck button");
|
|
4557
|
+
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4558
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
4559
|
+
createBaseVNode("button", {
|
|
4560
|
+
class: normalizeClass($options.computedClass),
|
|
4561
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
|
|
4562
|
+
}, [
|
|
4563
|
+
_hoisted_2$3,
|
|
4564
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
4565
|
+
], 2)
|
|
4566
|
+
]);
|
|
4567
|
+
}
|
|
4568
|
+
var ckButton_vue_vue_type_style_index_0_scoped_true_lang$1 = "";
|
|
4569
|
+
var _export_sfc = (sfc, props) => {
|
|
4570
|
+
const target = sfc.__vccOpts || sfc;
|
|
4571
|
+
for (const [key, val] of props) {
|
|
4572
|
+
target[key] = val;
|
|
4573
|
+
}
|
|
4574
|
+
return target;
|
|
4575
|
+
};
|
|
4576
|
+
const _sfc_main$3 = {
|
|
4577
|
+
props: {
|
|
4578
|
+
type: { type: String, default: "" },
|
|
4579
|
+
color: { type: String, default: "" },
|
|
4580
|
+
icon: { type: [String, Array], default: "" },
|
|
4581
|
+
"icon-package": { type: String, default: "" },
|
|
4582
|
+
"icon-right": { type: String, default: "" },
|
|
4583
|
+
label: { type: String, default: "" },
|
|
4584
|
+
"label-align": { type: String, default: "" },
|
|
4585
|
+
group: { type: String, default: "" },
|
|
4586
|
+
groupBreak: { type: String, default: "s" },
|
|
4587
|
+
groupVertical: { type: String, default: "" }
|
|
4588
|
+
},
|
|
4589
|
+
computed: {
|
|
4590
|
+
computedClass() {
|
|
4591
|
+
const classList = [];
|
|
4592
|
+
classList.push(functions.getGroupClass(this));
|
|
4593
|
+
if (this.color) {
|
|
4594
|
+
if (this.type === "filled") {
|
|
4595
|
+
classList.push(`ck-component__bg-color--${this.color}`);
|
|
4596
|
+
} else {
|
|
4597
|
+
classList.push(`ck-component__border-color--${this.color}`);
|
|
4598
|
+
}
|
|
4599
|
+
}
|
|
4600
|
+
return classList;
|
|
4601
|
+
}
|
|
4602
|
+
}
|
|
4603
|
+
};
|
|
4604
|
+
var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", render$1], ["__scopeId", "data-v-aac8240a"]]);
|
|
4605
|
+
var components = /* @__PURE__ */ Object.freeze({
|
|
4606
|
+
__proto__: null,
|
|
4607
|
+
[Symbol.toStringTag]: "Module",
|
|
4608
|
+
CkButton: ckButton
|
|
4609
|
+
});
|
|
4610
|
+
var _imports_0 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTk2QkI4RkE3NjE2MTFFNUE4NEU4RkIxNjQ5MTYyRDgiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTk2QkI4Rjk3NjE2MTFFNUE4NEU4RkIxNjQ5MTYyRDgiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NjU2QTEyNzk3NjkyMTFFMzkxODk4RDkwQkY4Q0U0NzYiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NjU2QTEyN0E3NjkyMTFFMzkxODk4RDkwQkY4Q0U0NzYiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5WHowqAAAXNElEQVR42uxda4xd1XVe53XvvD2eGQ/lXQcKuDwc2eFlCAGnUn7kT6T86J/+aNTgsWPchJJYciEOCQ8hF+G0hFCIHRSEqAuJBCqRaUEIEbmBppAIBGnESwZje8COZ+y587j3PLq+ffadGJix53HvPevcuz60xPjec89ZZ+39nf04+9vLSZKEFArFzHA1BAqFEkShUIIoFEoQhUIJolAoQRQKJYhCoQRRKJQgCoUSRKFQKEEUCiWIQrFo+Gv/8/YH+f/nsMWSHHMChyhxqPTTdyncWyJ3ScD/ztipiB3wXSqu6P17avN+TyFC5ggv4tRnmoxWTP1+5F+Mz17GPvPl49EKBWd3UsfXllPiso8VcYtmPba3fNuKrBVXrGFCbrdPwXndFL49ltI367roOpSUI4pGypv9s7q+ltj6JxqOQ07Bo/DgxGb2/a8cX0CnAWXJ5etz2TqdHiXHKlKj9w6i9XX8Ic41DmI8FVHhmmXk85MmRhCzJoiTWnig9LfJRHihgydxzAxJhBr7Bh/hK3yu+p9568FliTJF2aKMZfVd/kQOcKP6OBmS9+Rjm4zJ6faoeN0gOUn61MncLX4CJ+MRhe+P/dRxhfew2Df4CF/hs4jWg8vQYUKYMuWyRRkLjeHQ8YP0Z9mekVjA8Qj3VVcuoeDiXu63lkUE0ym6FA5PXBaNVr7qtPumGyPR4Bt8hK/wWUR5chn6XJYoU5StUHL8l+XEx2axhkS6yk+chJuP4rXLyOkIKJkS0B67adcqfL/0Y4pixxSysK6V8Yl9Mz7i3272NRFlhzJsu24Z5l9E9Ahmwfrpoj7uw3fZtktsRZKjIXnndlLxin7+W8ZTBwPf6I+Tg9HwxK2Ob8citbCoBoaxBxMCvsFH+CqjHCtUvLzflKWUcpwB91gupG5f9/Rtx39ZZBtmWyJtphKzHTQW0diP36b4aJmcLj/zGaSkHJPb4SWFi/tOJd8bTqd9s48VBRh4RKeUX/vjgXg8cpyCmz05xkJylxSoa8M5RF0eJaVIIkGOsg2yTc3UgpD94psiWxEOqDNYoOIXuHnGwE5AXUTFi46FTnRw4l/dwEm7/pSxcYnCF/gE3zInh52RRJkVP7/MlKFQcgCbjifHTAQBfsb2qsgBO3e1Cpf3UXBej3nRJKKrxU/rcH/pKzz4vNIQuRJTEmZklbg6EL4SPsE3GQPzinmfhbJDGQolB+r8w58abs5y8DqRt4ABeptLRR7koY9NleybEYw/MPisvF/ayT1/SvDewcnIcG32wfiCAbEvoCZyGaGsitdyz6XdTctQJq6fcT5mloNfYvu5yFZkpEz+RT0UrFoqpxVBV+vQxIrkaPnrbqdvXs6hcjbU+Jq4Nvvwd/BFRNeq2npwWfkX95iyE9p6PM72P/MhCPANTBSKu5WITHcC074Y9CUTkYglKBgcV/aVtlM5Kpp/RHFjDdfka7MP/2wG6m72661QNigjlBXKTGBtsjWKNs5atCf44Uds3xc5YD8Wknd2BxWuGjCzIxLWQzlFj+IjU108OL7bafM5sm5DDdfka/8T+9AJXyTMpqFsUEYoK5SZ0NbjVlvX500Q4Ha2A+JuCcEvhVS8qp/8MzspHhMSfO7mVPaP35BMRp9JsCQldbX+hmvxNfnamzJfqVvtWnGZoGxQRigroYs6UbfvOGHn4ORVkTaIbEWwtqg3MNO+Zql0JGCdVuCayhDuG9uJB7vp+oR17FbZc+NauCauLWLmKkqXr6NsUEYoK6GtxwY6CXXnEs0n2faIHLCPhhR8bikFKwRN+xZddHWu5a7Ol9yCZ2ZwHKdOxufGNeKRqS/hmnLWW1VMmQSrl5oyEkqOPbZu02IJAsic9sU7B+5uF9cOmqUfeLOdOaAZYb/CA+M/Ic9NxUoYMNfD/PT84f7xB807EAnrrbgMUBZt1w1SEpCIqfjF1Om5EuQNth0iu1r8tPLP76LCpX2yWpHDk2dGH018p6brtD5hOHf04cR3okOTZ0lqPVAW3gVdlMhdrfsTW6drRhDgRrYJcbeKZQxTkenvegNt6YBQwrQvOxG+P3ZHEia9TuClS9Br1XKge8XnxLlxjelzZ/2w4tijDMxyoHIsVQg1zvYPcy7KeZx4jG2zyFakFJF7Whu1XT2QvhfJeryeVNdplYPo4Pi9hKd7VVxVC8O5cH4+N65hXgoKuGfEHmWAskjGxI49Ntu6XHOCAD9ie1PcLSepjDNY00fB8m6KpSyJx/jgg9LfJEfLK40818w+LXY5e5zKaMfKl+DcIlSCZp0cd3U59igDI4+WOa2LunvfvDoD9RrcNLqAjDy3yzfrtKqbAkggSDIZmSlYxzz9a8BaJ101zF2rh3BuSTJaCKGMDEGujHbedXch0X2ebbdEkkDC6a9cQoWVguS53P0JP5xcHY1W/tppD9KxgrdAw5QxnwPn4nOukrPeqkzBJb0m9oJltLtt3a07QYD1IkMAeS7/hw0BXMhzJwXJc/eV7kuiyIN8OOGuUhLP06JUeoxz4FxiZLRouTsDM9WO2OdBRtsIgrzHtk3kgH00JO+cTipc2S9jqyCaluf2xwcnfuB6LndHuEsSzdP4N/gtzoFzSZHRIsaQQiPmidyXgttsnW0YQYDvsh2ROGBPxkMqXjNA/qlCFsnZ8UdlX+kfk0pymlnMWH2JOBfz0sWI+C3OMS1dzPphhPVWHOPC5wdMzIUOzFFHb1lwB2ARF+ZOPt0gshWBPLe/wCRZlu6CIkSei/cE0fD4g2ZbVWceyxH5WPwGvzXrrSTJaDnG7oBoGS3qaCULggCPsv1W5IAd8tzLllJwvpx1WthMIfyg9OVotHy1WVQ4V37wsfgNfkuSZLQcW8Q4lruU/RVbRykrggDXiwwN3uQWnXTa1xMkz2W/on2lndNajpNtAGePw2/MOicBMlqs+8K7GBNbjrFgGe2iX0nUgiAvs+0S2YpgndaFPVRc3SdmVanZlfGjifOiw5PrT/oGvPpG/vDkEH4jZ70Vt86rl5rYimmdP41/s3Uzc4Isup9XNxwvz+0tyNAlONPrtO6hctR+QnluKqNt52O3pxvtClhvxTH0egtmEwbBMlrUxU21OFGtCHKYbavIATv3j90z26kIea4QZRtahfhIuT0anrjH7O3rpjNVHzPIaLG3Lh8Tj5TbRQihjlNyehxTwTLarbZOiiEIcBfbPnGhMtroChXW9JN/VqeYdyPEY4nwwPj6ZCL8C1T+T61JhDqRv8MxZgwlJG2BxzEsrBmgeEzseqt9ti6SNIIA8t6wm901eFDZ66d7M4UkQ56LVgTTvvtKaRqFqoTWymjxGb6LpUzrImYcuzaOIWKJmAptPWpaB2sd+V+yvSB1wB6s7qXgwiUyBpbJdBqFq6MjU18mKCKhRsTyEbx558/wnRmYJzLiV+DYBat6JQ/MX7B1UCxBAKHy3IQrH6W7MhY9MWkUMNAN948/8Mm35/jMDIKlpC3gmBWQtsAjifkE61b36kGQP7DdL7KrVZXnXiYpjYKZxj09Gh7f4kB4yIa/8ZmU1brIIYiYIXaJ3Nbjflv3xBME+DZbSVwIzfIIK89dJkSea18Ihu+XflD9yPztCJnW5Ri5VRntpNh8giVb5ygvBIHu9yaRrchYRO6fFU0CSTPQlDLte6zshx9O3g3D3yJajySd4EDaAsQMsRPaetxk61zty+YTCXRqjf9jO19cOLnyYV+p8QffpcreMXJ7BeRgh77Ds6SIYhGbMBgB2tld1DW0nGL4VxbZfKBbdUHdhol1dl7mOi0MOjttGgWT11lAwU9r1mMSsX0oxwSxgYyWOvKXtiAvBPkV239I7GqZdVqX9FDw2V5+UoYipn2nt/WRMK3LMQlW9poYCZ7WfcrWsdwSBNggMrRYdcLdhjas0+q28lzJOc8bOU7jWLh2AwzEyLxclYm6Z2ZuBEE+YLtTZEVA9tzPdBh5biJ3q5rGD8yRjXbNAPkcm0RuyjTUqf3NQBDge2yHJFaGeDyi4tUD5J3WIXmzs8Y9NDgG3un80OCYIDZCHxqHbJ2iZiEIGmnB8twgzYIkd7vMxiBON59GLJyBQLKMdiM1qOPXyMn2f2f7X5EDdshzkUbhAtED0oZMXCAGiIXgtAW/YXusURdr9NsoufLcgmP20zKy2ErrNSNGRuunMUAshL7zABq61q/RBPkd2yNSn57+X3ZTQZA8t7H3H5p7RwwEt6KP2DrUtAQBIIUsiwt99Kf+tydFntuocVhVRltNWyBTRlumGslopRNkhO1mkRVlLCT3jHYzqyU48WSN+1ZWRou0BZDRyp3Ju9nWnaYnCHA3216JlQWy0gKy557dJSaNQn0nKNL1VrhnwTLavbbOUKsQBBApzzVpFHqsPFdIGoW6AfeG7cMwrcv3TC0io80LQZ5me07kU3WkYqSlhYvkpFGoz8C8bO7RyGjlpi14ztaVliMIIFOeizQKbpI+WdsDGfLcWvcmsaK53b4gdUW3lENZXjxrgrzNdq/IAftohbzzOql4eV/zjUUcu96K7w33KFhGi7rxVisTBEBSxWPiiqYqz71mGfmDQuS5tSIHstHyPZnd7+XKaI+RgKSxEggySWmKaXkVaSwi5xSbRmGiSdZpxVZGy/eEexMso73R1o2WJwiwk+11kQNZrNO6oo+Cc7vz39Wy07q4l+CKfnNvQu/ndVsnSAkifcCOAXq7R8W1y9JdRvI87QvfnTRtgdPeujLavBLkv9meEPnUHS2Tf1EPFT67lOKRnE77munrsrkH/+IeydPXqAO/VoLMDMhz5T2irTzXpFHoKeRPnluV0XYX0mlduTLamIRJtKUR5CDbbSIrGPfX/eUdVFyTQ3luku6OaNIW/HmH5LQFt9k6oAQ5Ab7PNiyxkmGndUhRvTNyJM9F1wrZaM9IZbQmG63MocewxIejRIKg+DaKbEXGI3KWBtT2hUFKyonUZeEfB3xkX4vsM3wXvIx/IwmMqCu0WH/B9qLIpzG6Wp/rpWBFj/x1WnaCAb4G7LPgad0XbZmTEmTukDnti0yzgZvKcwNPtDzXyGjZR5ONFincVEbbVAR5je0hkU/lkTL5F3TZzQ2EvjysJr1hH/0LuiVPTz9ky1oJsgB8iwQsN5hplISns5Hn9hXl9eurMlr2zUzrVsQuk5m0ZUxKkIXhKNsWkQN2yHNPhzx3WbqQMRZGYCOjXWZ8FDzjtsWWsRJkEfgh2zvyOvhWnovsucu75GTPtdlo4RN8i+W+s3nHli0pQRaPIXEeVeW53V46YJciz2Uf4IvxiX0juW/9h/JQ8fJCkGfZnpE5YK9QsHIJBZcIkOdW141d3Gt8EiyjfcaWqRKk6Z84kOc6duODjmzluUZGyz4g6Q18UhltaxHkXbbtIgfsRyvknQt5bobZc6dltP3Gl0SudmW7LUslSJ1mPUbFeWVUepDnDpB3SgazRtW0BXxt+ABfhE7rypyVbCKCTLF9U2QrgjQKg3b7zskGv3eI0+XsuDZ8EJy2YJMtQyVIHfEztldFDtghz728j4LzGphGoZq2gK9ZMDuwiH3ngTJ7OG+VLY8EAeTKc9ts9lwk42zEOi2st+JrYZIA1xYso12Xx4qWV4K8xPZzka3ISCrPDVY1YJ1WtfVYZWW0ctdbPW7LTAnSQHyDJCoykEYhTNdpuUsK6YDZqQ85cG5cw6y3CsWmLYBXG/NayfJMkI8oVR/KG7AfC8k7u4MKVw2kM1r1eB2RpDNXuAauJVhGe6stKyVIBrid7YA4r6o5N5BG4cxOI3mtaeWtymj53LiG4FwmKJs78lzB8k4QVIsN4ryqynN7AzP1ShXIc2tYg3GuSpJO6/aKltHK3KWmhQgCPMm2R+SAfTSkANlzV9Rw2rc6MDcyWtHZaPfYsiElSPaQOYVYiSnxiIprB8kpeGn+v8U2mZD8FjxzTpybKjqtqwQ5Od5g2yGyq4Xsued3UeHSvsW3IlUZLZ8L5xSctmCHLRMliCBgN/AJcV7F6SpbjBe8gUWkUaimLeBzmOUsU2JltOMkcbd+JQiNkYB8ErNVbPe0Nmq72i4kXMiwNUnfe+AcOJfgfCWbbVkoQQTiR2xvivPKynODNX0ULF9AGoVq2gL+Lc4hWEaL2N/XTBWq2Qgic3BYled2+ekeVfOV51az0WKNF59DsIx2XbNVpmYkyPNsuyWSBBJYf+USKsxHnlvNRsu/8WXLaHfb2CtBcoD1Ir2CPJf/wxSt2xmkupGT9c6QtoCPNdO66FfJldGub8aK1KwEeY9tm8gB+2hI3jmdVLii/+RbBdktfHAsfpPIfSm4zcZcCZIjfJftiMQBO1IQQBrrn3qCRYZ20SOOMTLacbHrrRDjW5q1EjUzQbiTTzeIbEUgz+232XNne59RfX+CbLT9omW0iHFFCZJPPMr2W5EDdshzL1tKwfkzrNOqrrfi73CMYBntKzbGpATJL64X6RXWZRVtxlnP+VgaBZO2wEu/wzGatkAJUk+8zLZLZCuCdVoXciux+rhVuXYVMD7Dd7Hc9Va7bGyVIE0Amf3kaXnuIHm9qTwXhr/xmWAZbUXk+E4JsmAcZtsqcsAOee6Z7VS08lwY/sZngmW0W21MlSBNhLvY9onzCqtIxipUuKqf3L6iMfyNz4RO6+6zsWwJ+NRawNvep8S1IhMxucie+8VT0o+6PIqPiB17rG+lCtNqBPkl2wts14gbsCONwqVLzT8Fr7d6wcawZeBS60Hm1GSSTu+a6d5EY6cEyQ5/YLtf4oCd4iQ1ma3H/TZ2SpAWwLfZSqSYK0o2ZqQEaQ1AN32T1vs54yYbMyVIC+GBVuwyLLBL+kCr3rzb4oV/vdZ/jZESZHb8iqS9F5GFp2yMlCAtjCENgcZGCTI79rPdqWH4FO60sVGCKOh7bIc0DNM4ZGNCShAFEFKOsyDVARttTJQgGoJpPMb2Gw2DicFjGgYlyExYpyHQGChBZsfv2B5p4ft/xMZAoQSZFZso3TKo1VC2965QgpwQI2w3t+B932zvXaEEOSnuZtvbQve7196zQgkyZ6zXe1UoQWbH02zPtcB9PmfvVaEEmTeG9B6VIIrZ8RbbvU18f/fae1QoQRYMJKU81oT3dYwkJj1VguQOk9REaY2Pw4323hRKkEVjJ9vrTXQ/r9t7UihBaobr9V6UIIrZ8Wu2J5rgPp6w96JQgtQcG2jmhGl5QWzvQaEEqQsOst2WY/9vs/egUILUtZIN59Dv4ZyTWwmSEyDnUx7luRtJar4qJUjT4RdsL+bI3xetzwolSMOwTn1Vgihmx2tsD+XAz4esrwolSMPxLZK9XGPS+qhQgmSCo2xbBPu3xfqoUIJkhh+yvSPQr3esbwolSOYYUp+UIIrZ8SzbM4L8ecb6pFCC6BNbWw8lSB7wLtt2AX5st74olCDikPWskfRZNSVIi2OKst2+c5P1QaEEEYuH2V7N4Lqv2msrlCDisa5FrqkEUSwIL7E93sDrPW6vqVCC5AaN0l/kVZ+iBGlxfMR2awOuc6u9lkIJkjvcwXagjuc/YK+hUILkEgnVdxeRDfYaCiVIbvEk2546nHePPbdCCZJ7rMvJORVKkEzwBtuOGp5vhz2nQgnSNMBu6uM1OM84Nedu80qQFscY1SYfx2Z7LoUSpOlwH9ubi/j9m/YcCiWIDth1YK4EaUU8z7Z7Ab/bbX+rUII0PdY36DcKJUgu8R7btnkcv83+RqEEaRncwnZkDscdsccqlCAthQrbDXM47gZ7rEIJ0nJ4lO2VE3z/ij1GoQRpWaxb4HcKJUhL4GW2XTN8vst+p1CCtDw+Oc6Y6/hEoQRpCRxm23rcv7fazxRKEIXFXZRuwBDZvxUC4GsIREHflguDkyQqaVYotIulUChBFAoliEKhBFEolCAKhRJEoVCCKBRKEIVCCaJQKJQgCoUSRKFQgigUShCFIhP8vwADACog5YM65zugAAAAAElFTkSuQmCC";
|
|
4611
|
+
var HelloWorld_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
4612
|
+
const _withScopeId = (n) => (pushScopeId("data-v-5835f392"), n = n(), popScopeId(), n);
|
|
4613
|
+
const _hoisted_1$2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createBaseVNode("p", null, [
|
|
4614
|
+
/* @__PURE__ */ createTextVNode(" Recommended IDE setup: "),
|
|
4615
|
+
/* @__PURE__ */ createBaseVNode("a", {
|
|
4616
|
+
href: "https://code.visualstudio.com/",
|
|
4617
|
+
target: "_blank"
|
|
4618
|
+
}, "VSCode"),
|
|
4619
|
+
/* @__PURE__ */ createTextVNode(" + "),
|
|
4620
|
+
/* @__PURE__ */ createBaseVNode("a", {
|
|
4621
|
+
href: "https://github.com/johnsoncodehk/volar",
|
|
4622
|
+
target: "_blank"
|
|
4623
|
+
}, "Volar")
|
|
4624
|
+
], -1));
|
|
4625
|
+
const _hoisted_2$2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createBaseVNode("p", null, [
|
|
4626
|
+
/* @__PURE__ */ createTextVNode("See "),
|
|
4627
|
+
/* @__PURE__ */ createBaseVNode("code", null, "README.md"),
|
|
4628
|
+
/* @__PURE__ */ createTextVNode(" for more information.")
|
|
4629
|
+
], -1));
|
|
4630
|
+
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createBaseVNode("p", null, [
|
|
4631
|
+
/* @__PURE__ */ createBaseVNode("a", {
|
|
4632
|
+
href: "https://vitejs.dev/guide/features.html",
|
|
4633
|
+
target: "_blank"
|
|
4634
|
+
}, " Vite Docs "),
|
|
4635
|
+
/* @__PURE__ */ createTextVNode(" | "),
|
|
4636
|
+
/* @__PURE__ */ createBaseVNode("a", {
|
|
4637
|
+
href: "https://v3.vuejs.org/",
|
|
4638
|
+
target: "_blank"
|
|
4639
|
+
}, "Vue 3 Docs")
|
|
4640
|
+
], -1));
|
|
4641
|
+
const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createBaseVNode("p", null, [
|
|
4642
|
+
/* @__PURE__ */ createTextVNode(" Edit "),
|
|
4643
|
+
/* @__PURE__ */ createBaseVNode("code", null, "components/HelloWorld.vue"),
|
|
4644
|
+
/* @__PURE__ */ createTextVNode(" to test hot module replacement. ")
|
|
4645
|
+
], -1));
|
|
4646
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
4647
|
+
props: {
|
|
4648
|
+
msg: null
|
|
4649
|
+
},
|
|
4650
|
+
setup(__props) {
|
|
4651
|
+
const count = ref(0);
|
|
4652
|
+
return (_ctx, _cache) => {
|
|
4653
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
4654
|
+
createBaseVNode("h1", null, toDisplayString(__props.msg), 1),
|
|
4655
|
+
_hoisted_1$2,
|
|
4656
|
+
_hoisted_2$2,
|
|
4657
|
+
_hoisted_3,
|
|
4658
|
+
createBaseVNode("button", {
|
|
4659
|
+
type: "button",
|
|
4660
|
+
onClick: _cache[0] || (_cache[0] = ($event) => count.value++)
|
|
4661
|
+
}, "count is: " + toDisplayString(count.value), 1),
|
|
4662
|
+
_hoisted_4
|
|
4663
|
+
], 64);
|
|
4664
|
+
};
|
|
4665
|
+
}
|
|
4666
|
+
});
|
|
4667
|
+
var HelloWorld = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-5835f392"]]);
|
|
4668
|
+
const _hoisted_1$1 = { class: "ck-button" };
|
|
4669
|
+
const _hoisted_2$1 = /* @__PURE__ */ createTextVNode("ck button");
|
|
4670
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4671
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
4672
|
+
createBaseVNode("button", {
|
|
4673
|
+
class: normalizeClass($options.computedClass),
|
|
4674
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
|
|
4675
|
+
}, [
|
|
4676
|
+
_hoisted_2$1,
|
|
4677
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
4678
|
+
], 2)
|
|
4679
|
+
]);
|
|
4680
|
+
}
|
|
4681
|
+
var ckButton_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
4682
|
+
const _sfc_main$1 = {
|
|
4683
|
+
props: {
|
|
4684
|
+
type: { type: String, default: "" },
|
|
4685
|
+
color: { type: String, default: "" },
|
|
4686
|
+
icon: { type: [String, Array], default: "" },
|
|
4687
|
+
"icon-package": { type: String, default: "" },
|
|
4688
|
+
"icon-right": { type: String, default: "" },
|
|
4689
|
+
label: { type: String, default: "" },
|
|
4690
|
+
"label-align": { type: String, default: "" },
|
|
4691
|
+
group: { type: String, default: "" },
|
|
4692
|
+
groupBreak: { type: String, default: "s" },
|
|
4693
|
+
groupVertical: { type: String, default: "" }
|
|
4694
|
+
},
|
|
4695
|
+
computed: {
|
|
4696
|
+
computedClass() {
|
|
4697
|
+
const classList = [];
|
|
4698
|
+
classList.push(functions.getGroupClass(this));
|
|
4699
|
+
if (this.color) {
|
|
4700
|
+
if (this.type === "filled") {
|
|
4701
|
+
classList.push(`ck-component__bg-color--${this.color}`);
|
|
4702
|
+
} else {
|
|
4703
|
+
classList.push(`ck-component__border-color--${this.color}`);
|
|
4704
|
+
}
|
|
4705
|
+
}
|
|
4706
|
+
return classList;
|
|
4707
|
+
}
|
|
4708
|
+
}
|
|
4709
|
+
};
|
|
4710
|
+
var CkButton = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", render], ["__scopeId", "data-v-2fa6bbca"]]);
|
|
4711
|
+
var App_vue_vue_type_style_index_0_lang = "";
|
|
4712
|
+
const _hoisted_1 = /* @__PURE__ */ createBaseVNode("img", {
|
|
4713
|
+
alt: "Vue logo",
|
|
4714
|
+
src: _imports_0
|
|
4715
|
+
}, null, -1);
|
|
4716
|
+
const _hoisted_2 = /* @__PURE__ */ createTextVNode(" Lisandrito ");
|
|
4717
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4718
|
+
setup(__props) {
|
|
4719
|
+
return (_ctx, _cache) => {
|
|
4720
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
4721
|
+
_hoisted_1,
|
|
4722
|
+
createVNode(HelloWorld, { msg: "Hello Vue 3 + TypeScript + Vite" }),
|
|
4723
|
+
createVNode(CkButton, null, {
|
|
4724
|
+
default: withCtx(() => [
|
|
4725
|
+
_hoisted_2
|
|
4726
|
+
]),
|
|
4727
|
+
_: 1
|
|
4728
|
+
})
|
|
4729
|
+
], 64);
|
|
4730
|
+
};
|
|
4731
|
+
}
|
|
4732
|
+
});
|
|
4733
|
+
const install = function installCleek(app, options) {
|
|
4734
|
+
console.log("arranco paquete");
|
|
4735
|
+
console.log("options", options);
|
|
4736
|
+
Object.entries(components).forEach(([componentName, component]) => {
|
|
4737
|
+
app.component(componentName, component);
|
|
4738
|
+
});
|
|
4739
|
+
};
|
|
4740
|
+
createApp(_sfc_main).mount("#app");
|
|
4741
|
+
export { ckButton as CkButton, install as default };
|