@vitejs/devtools 0.0.0-alpha.3 → 0.0.0-alpha.31
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/DockIcon-BfVdt_M0.js +1717 -0
- package/dist/ViewBuiltinLogs-C8wFxIxg.js +12 -0
- package/dist/ViewBuiltinTerminals-CrBOq_Ni.js +10414 -0
- package/dist/cli-commands.d.ts +18 -0
- package/dist/cli-commands.js +67 -0
- package/dist/cli.js +4 -87
- package/dist/client/inject.js +111 -14
- package/dist/client/standalone/assets/ViewBuiltinLogs-CYvdMq-7.js +1 -0
- package/dist/client/standalone/assets/ViewBuiltinTerminals-B9l9XmES.js +36 -0
- package/dist/client/standalone/assets/index-DWC0UjCz.js +2 -0
- package/dist/client/standalone/assets/index-DzhHPm4X.css +1 -0
- package/dist/client/standalone/index.html +3 -3
- package/dist/client/webcomponents.d.ts +1471 -29
- package/dist/client/webcomponents.js +1121 -323
- package/dist/config.d.ts +25 -0
- package/dist/config.js +20 -0
- package/dist/dirs.js +7 -1
- package/dist/dist-BpFPAu5f.js +916 -0
- package/dist/docks-CYaKLVhQ.js +131 -0
- package/dist/export-helper-DjM8b2QE.js +9 -0
- package/dist/index.d.ts +197 -8
- package/dist/index.js +1 -2
- package/dist/plugins-BbzqUdpu.js +3038 -0
- package/dist/standalone-DVh1a9tu.js +34 -0
- package/dist/{core-uTAXYiA1.js → vue.runtime.esm-bundler-DL0i8o0W.js} +1262 -1514
- package/package.json +33 -20
- package/dist/client/standalone/assets/index-C0WqLnSL.js +0 -7
- package/dist/client/standalone/assets/index-DLsPMQDX.css +0 -1
- package/dist/dirs-B7dOX6eI.js +0 -9
- package/dist/plugins-DDjui9Ga.js +0 -1314
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@vue+shared@3.5.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@vue+shared@3.5.27/node_modules/@vue/shared/dist/shared.esm-bundler.js
|
|
2
2
|
/**
|
|
3
|
-
* @vue/shared v3.5.
|
|
3
|
+
* @vue/shared v3.5.27
|
|
4
4
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
5
|
* @license MIT
|
|
6
6
|
**/
|
|
7
7
|
/* @__NO_SIDE_EFFECTS__ */
|
|
8
8
|
function makeMap(str) {
|
|
9
|
-
const map
|
|
10
|
-
for (const key of str.split(",")) map
|
|
11
|
-
return (val) => val in map
|
|
9
|
+
const map = /* @__PURE__ */ Object.create(null);
|
|
10
|
+
for (const key of str.split(",")) map[key] = 1;
|
|
11
|
+
return (val) => val in map;
|
|
12
12
|
}
|
|
13
13
|
const EMPTY_OBJ = !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
|
|
14
14
|
const EMPTY_ARR = !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
|
|
@@ -22,16 +22,16 @@ const remove = (arr, el) => {
|
|
|
22
22
|
if (i > -1) arr.splice(i, 1);
|
|
23
23
|
};
|
|
24
24
|
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
25
|
-
const hasOwn
|
|
25
|
+
const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
|
|
26
26
|
const isArray = Array.isArray;
|
|
27
27
|
const isMap = (val) => toTypeString(val) === "[object Map]";
|
|
28
28
|
const isSet = (val) => toTypeString(val) === "[object Set]";
|
|
29
29
|
const isFunction = (val) => typeof val === "function";
|
|
30
30
|
const isString = (val) => typeof val === "string";
|
|
31
31
|
const isSymbol = (val) => typeof val === "symbol";
|
|
32
|
-
const isObject
|
|
32
|
+
const isObject = (val) => val !== null && typeof val === "object";
|
|
33
33
|
const isPromise = (val) => {
|
|
34
|
-
return (isObject
|
|
34
|
+
return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
|
|
35
35
|
};
|
|
36
36
|
const objectToString = Object.prototype.toString;
|
|
37
37
|
const toTypeString = (value) => objectToString.call(value);
|
|
@@ -42,22 +42,22 @@ const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
|
42
42
|
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
43
43
|
const isReservedProp = /* @__PURE__ */ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
44
44
|
const isBuiltInDirective = /* @__PURE__ */ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
45
|
-
const cacheStringFunction
|
|
45
|
+
const cacheStringFunction = (fn) => {
|
|
46
46
|
const cache = /* @__PURE__ */ Object.create(null);
|
|
47
47
|
return ((str) => {
|
|
48
48
|
return cache[str] || (cache[str] = fn(str));
|
|
49
49
|
});
|
|
50
50
|
};
|
|
51
|
-
const camelizeRE
|
|
52
|
-
const camelize
|
|
53
|
-
return str.replace(camelizeRE
|
|
51
|
+
const camelizeRE = /-\w/g;
|
|
52
|
+
const camelize = cacheStringFunction((str) => {
|
|
53
|
+
return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
|
|
54
54
|
});
|
|
55
|
-
const hyphenateRE
|
|
56
|
-
const hyphenate
|
|
57
|
-
const capitalize = cacheStringFunction
|
|
55
|
+
const hyphenateRE = /\B([A-Z])/g;
|
|
56
|
+
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
57
|
+
const capitalize = cacheStringFunction((str) => {
|
|
58
58
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
59
59
|
});
|
|
60
|
-
const toHandlerKey = cacheStringFunction
|
|
60
|
+
const toHandlerKey = cacheStringFunction((str) => {
|
|
61
61
|
return str ? `on${capitalize(str)}` : ``;
|
|
62
62
|
});
|
|
63
63
|
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
@@ -93,7 +93,7 @@ function normalizeStyle(value) {
|
|
|
93
93
|
if (normalized) for (const key in normalized) res[key] = normalized[key];
|
|
94
94
|
}
|
|
95
95
|
return res;
|
|
96
|
-
} else if (isString(value) || isObject
|
|
96
|
+
} else if (isString(value) || isObject(value)) return value;
|
|
97
97
|
}
|
|
98
98
|
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
99
99
|
const propertyDelimiterRE = /:([^]+)/;
|
|
@@ -115,7 +115,7 @@ function normalizeClass(value) {
|
|
|
115
115
|
const normalized = normalizeClass(value[i]);
|
|
116
116
|
if (normalized) res += normalized + " ";
|
|
117
117
|
}
|
|
118
|
-
else if (isObject
|
|
118
|
+
else if (isObject(value)) {
|
|
119
119
|
for (const name in value) if (value[name]) res += name + " ";
|
|
120
120
|
}
|
|
121
121
|
return res.trim();
|
|
@@ -136,7 +136,7 @@ const isRef$1 = (val) => {
|
|
|
136
136
|
return !!(val && val["__v_isRef"] === true);
|
|
137
137
|
};
|
|
138
138
|
const toDisplayString = (val) => {
|
|
139
|
-
return isString(val) ? val : val == null ? "" : isArray(val) || isObject
|
|
139
|
+
return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
|
|
140
140
|
};
|
|
141
141
|
const replacer = (_key, val) => {
|
|
142
142
|
if (isRef$1(val)) return replacer(_key, val.value);
|
|
@@ -146,7 +146,7 @@ const replacer = (_key, val) => {
|
|
|
146
146
|
}, {}) };
|
|
147
147
|
else if (isSet(val)) return { [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) };
|
|
148
148
|
else if (isSymbol(val)) return stringifySymbol(val);
|
|
149
|
-
else if (isObject
|
|
149
|
+
else if (isObject(val) && !isArray(val) && !isPlainObject(val)) return String(val);
|
|
150
150
|
return val;
|
|
151
151
|
};
|
|
152
152
|
const stringifySymbol = (v, i = "") => {
|
|
@@ -155,7 +155,12 @@ const stringifySymbol = (v, i = "") => {
|
|
|
155
155
|
};
|
|
156
156
|
|
|
157
157
|
//#endregion
|
|
158
|
-
//#region ../../node_modules/.pnpm/@vue+reactivity@3.5.
|
|
158
|
+
//#region ../../node_modules/.pnpm/@vue+reactivity@3.5.27/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
|
|
159
|
+
/**
|
|
160
|
+
* @vue/reactivity v3.5.27
|
|
161
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
162
|
+
* @license MIT
|
|
163
|
+
**/
|
|
159
164
|
function warn$2(msg, ...args) {
|
|
160
165
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
161
166
|
}
|
|
@@ -434,24 +439,24 @@ function isDirty(sub) {
|
|
|
434
439
|
if (sub._dirty) return true;
|
|
435
440
|
return false;
|
|
436
441
|
}
|
|
437
|
-
function refreshComputed(computed
|
|
438
|
-
if (computed
|
|
439
|
-
computed
|
|
440
|
-
if (computed
|
|
441
|
-
computed
|
|
442
|
-
if (!computed
|
|
443
|
-
computed
|
|
444
|
-
const dep = computed
|
|
442
|
+
function refreshComputed(computed) {
|
|
443
|
+
if (computed.flags & 4 && !(computed.flags & 16)) return;
|
|
444
|
+
computed.flags &= -17;
|
|
445
|
+
if (computed.globalVersion === globalVersion) return;
|
|
446
|
+
computed.globalVersion = globalVersion;
|
|
447
|
+
if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) return;
|
|
448
|
+
computed.flags |= 2;
|
|
449
|
+
const dep = computed.dep;
|
|
445
450
|
const prevSub = activeSub;
|
|
446
451
|
const prevShouldTrack = shouldTrack;
|
|
447
|
-
activeSub = computed
|
|
452
|
+
activeSub = computed;
|
|
448
453
|
shouldTrack = true;
|
|
449
454
|
try {
|
|
450
|
-
prepareDeps(computed
|
|
451
|
-
const value = computed
|
|
452
|
-
if (dep.version === 0 || hasChanged(value, computed
|
|
453
|
-
computed
|
|
454
|
-
computed
|
|
455
|
+
prepareDeps(computed);
|
|
456
|
+
const value = computed.fn(computed._value);
|
|
457
|
+
if (dep.version === 0 || hasChanged(value, computed._value)) {
|
|
458
|
+
computed.flags |= 128;
|
|
459
|
+
computed._value = value;
|
|
455
460
|
dep.version++;
|
|
456
461
|
}
|
|
457
462
|
} catch (err) {
|
|
@@ -460,8 +465,8 @@ function refreshComputed(computed$2) {
|
|
|
460
465
|
} finally {
|
|
461
466
|
activeSub = prevSub;
|
|
462
467
|
shouldTrack = prevShouldTrack;
|
|
463
|
-
cleanupDeps(computed
|
|
464
|
-
computed
|
|
468
|
+
cleanupDeps(computed);
|
|
469
|
+
computed.flags &= -3;
|
|
465
470
|
}
|
|
466
471
|
}
|
|
467
472
|
function removeSub(link, soft = false) {
|
|
@@ -528,8 +533,8 @@ var Link = class {
|
|
|
528
533
|
}
|
|
529
534
|
};
|
|
530
535
|
var Dep = class {
|
|
531
|
-
constructor(computed
|
|
532
|
-
this.computed = computed
|
|
536
|
+
constructor(computed) {
|
|
537
|
+
this.computed = computed;
|
|
533
538
|
this.version = 0;
|
|
534
539
|
/**
|
|
535
540
|
* Link between this dep and the current active effect
|
|
@@ -602,10 +607,10 @@ var Dep = class {
|
|
|
602
607
|
function addSub(link) {
|
|
603
608
|
link.dep.sc++;
|
|
604
609
|
if (link.sub.flags & 4) {
|
|
605
|
-
const computed
|
|
606
|
-
if (computed
|
|
607
|
-
computed
|
|
608
|
-
for (let l = computed
|
|
610
|
+
const computed = link.dep.computed;
|
|
611
|
+
if (computed && !link.dep.subs) {
|
|
612
|
+
computed.flags |= 20;
|
|
613
|
+
for (let l = computed.deps; l; l = l.nextDep) addSub(l);
|
|
609
614
|
}
|
|
610
615
|
const currentTail = link.dep.subs;
|
|
611
616
|
if (currentTail !== link) {
|
|
@@ -617,9 +622,9 @@ function addSub(link) {
|
|
|
617
622
|
}
|
|
618
623
|
}
|
|
619
624
|
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
620
|
-
const ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "Object iterate" : "");
|
|
621
|
-
const MAP_KEY_ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "Map keys iterate" : "");
|
|
622
|
-
const ARRAY_ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "Array iterate" : "");
|
|
625
|
+
const ITERATE_KEY = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? "Object iterate" : "");
|
|
626
|
+
const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? "Map keys iterate" : "");
|
|
627
|
+
const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? "Array iterate" : "");
|
|
623
628
|
function track(target, type, key) {
|
|
624
629
|
if (shouldTrack && activeSub) {
|
|
625
630
|
let depsMap = targetMap.get(target);
|
|
@@ -694,26 +699,30 @@ function getDepFromReactive(object, key) {
|
|
|
694
699
|
return depMap && depMap.get(key);
|
|
695
700
|
}
|
|
696
701
|
function reactiveReadArray(array) {
|
|
697
|
-
const raw = toRaw(array);
|
|
702
|
+
const raw = /* @__PURE__ */ toRaw(array);
|
|
698
703
|
if (raw === array) return raw;
|
|
699
704
|
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
700
|
-
return isShallow(array) ? raw : raw.map(toReactive);
|
|
705
|
+
return /* @__PURE__ */ isShallow(array) ? raw : raw.map(toReactive);
|
|
701
706
|
}
|
|
702
707
|
function shallowReadArray(arr) {
|
|
703
|
-
track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
|
|
708
|
+
track(arr = /* @__PURE__ */ toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
|
|
704
709
|
return arr;
|
|
705
710
|
}
|
|
711
|
+
function toWrapped(target, item) {
|
|
712
|
+
if (/* @__PURE__ */ isReadonly(target)) return /* @__PURE__ */ isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item);
|
|
713
|
+
return toReactive(item);
|
|
714
|
+
}
|
|
706
715
|
const arrayInstrumentations = {
|
|
707
716
|
__proto__: null,
|
|
708
717
|
[Symbol.iterator]() {
|
|
709
|
-
return iterator(this, Symbol.iterator,
|
|
718
|
+
return iterator(this, Symbol.iterator, (item) => toWrapped(this, item));
|
|
710
719
|
},
|
|
711
720
|
concat(...args) {
|
|
712
721
|
return reactiveReadArray(this).concat(...args.map((x) => isArray(x) ? reactiveReadArray(x) : x));
|
|
713
722
|
},
|
|
714
723
|
entries() {
|
|
715
724
|
return iterator(this, "entries", (value) => {
|
|
716
|
-
value[1] =
|
|
725
|
+
value[1] = toWrapped(this, value[1]);
|
|
717
726
|
return value;
|
|
718
727
|
});
|
|
719
728
|
},
|
|
@@ -721,16 +730,16 @@ const arrayInstrumentations = {
|
|
|
721
730
|
return apply(this, "every", fn, thisArg, void 0, arguments);
|
|
722
731
|
},
|
|
723
732
|
filter(fn, thisArg) {
|
|
724
|
-
return apply(this, "filter", fn, thisArg, (v) => v.map(
|
|
733
|
+
return apply(this, "filter", fn, thisArg, (v) => v.map((item) => toWrapped(this, item)), arguments);
|
|
725
734
|
},
|
|
726
735
|
find(fn, thisArg) {
|
|
727
|
-
return apply(this, "find", fn, thisArg,
|
|
736
|
+
return apply(this, "find", fn, thisArg, (item) => toWrapped(this, item), arguments);
|
|
728
737
|
},
|
|
729
738
|
findIndex(fn, thisArg) {
|
|
730
739
|
return apply(this, "findIndex", fn, thisArg, void 0, arguments);
|
|
731
740
|
},
|
|
732
741
|
findLast(fn, thisArg) {
|
|
733
|
-
return apply(this, "findLast", fn, thisArg,
|
|
742
|
+
return apply(this, "findLast", fn, thisArg, (item) => toWrapped(this, item), arguments);
|
|
734
743
|
},
|
|
735
744
|
findLastIndex(fn, thisArg) {
|
|
736
745
|
return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
|
|
@@ -787,13 +796,13 @@ const arrayInstrumentations = {
|
|
|
787
796
|
return noTracking(this, "unshift", args);
|
|
788
797
|
},
|
|
789
798
|
values() {
|
|
790
|
-
return iterator(this, "values",
|
|
799
|
+
return iterator(this, "values", (item) => toWrapped(this, item));
|
|
791
800
|
}
|
|
792
801
|
};
|
|
793
|
-
function iterator(self
|
|
794
|
-
const arr = shallowReadArray(self
|
|
802
|
+
function iterator(self, method, wrapValue) {
|
|
803
|
+
const arr = shallowReadArray(self);
|
|
795
804
|
const iter = arr[method]();
|
|
796
|
-
if (arr !== self
|
|
805
|
+
if (arr !== self && !/* @__PURE__ */ isShallow(self)) {
|
|
797
806
|
iter._next = iter.next;
|
|
798
807
|
iter.next = () => {
|
|
799
808
|
const result = iter._next();
|
|
@@ -804,53 +813,53 @@ function iterator(self$1, method, wrapValue) {
|
|
|
804
813
|
return iter;
|
|
805
814
|
}
|
|
806
815
|
const arrayProto = Array.prototype;
|
|
807
|
-
function apply(self
|
|
808
|
-
const arr = shallowReadArray(self
|
|
809
|
-
const needsWrap = arr !== self
|
|
816
|
+
function apply(self, method, fn, thisArg, wrappedRetFn, args) {
|
|
817
|
+
const arr = shallowReadArray(self);
|
|
818
|
+
const needsWrap = arr !== self && !/* @__PURE__ */ isShallow(self);
|
|
810
819
|
const methodFn = arr[method];
|
|
811
820
|
if (methodFn !== arrayProto[method]) {
|
|
812
|
-
const result2 = methodFn.apply(self
|
|
821
|
+
const result2 = methodFn.apply(self, args);
|
|
813
822
|
return needsWrap ? toReactive(result2) : result2;
|
|
814
823
|
}
|
|
815
824
|
let wrappedFn = fn;
|
|
816
|
-
if (arr !== self
|
|
825
|
+
if (arr !== self) {
|
|
817
826
|
if (needsWrap) wrappedFn = function(item, index) {
|
|
818
|
-
return fn.call(this,
|
|
827
|
+
return fn.call(this, toWrapped(self, item), index, self);
|
|
819
828
|
};
|
|
820
829
|
else if (fn.length > 2) wrappedFn = function(item, index) {
|
|
821
|
-
return fn.call(this, item, index, self
|
|
830
|
+
return fn.call(this, item, index, self);
|
|
822
831
|
};
|
|
823
832
|
}
|
|
824
833
|
const result = methodFn.call(arr, wrappedFn, thisArg);
|
|
825
834
|
return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
|
|
826
835
|
}
|
|
827
|
-
function reduce(self
|
|
828
|
-
const arr = shallowReadArray(self
|
|
836
|
+
function reduce(self, method, fn, args) {
|
|
837
|
+
const arr = shallowReadArray(self);
|
|
829
838
|
let wrappedFn = fn;
|
|
830
|
-
if (arr !== self
|
|
831
|
-
if (
|
|
832
|
-
return fn.call(this, acc,
|
|
839
|
+
if (arr !== self) {
|
|
840
|
+
if (!/* @__PURE__ */ isShallow(self)) wrappedFn = function(acc, item, index) {
|
|
841
|
+
return fn.call(this, acc, toWrapped(self, item), index, self);
|
|
833
842
|
};
|
|
834
843
|
else if (fn.length > 3) wrappedFn = function(acc, item, index) {
|
|
835
|
-
return fn.call(this, acc, item, index, self
|
|
844
|
+
return fn.call(this, acc, item, index, self);
|
|
836
845
|
};
|
|
837
846
|
}
|
|
838
847
|
return arr[method](wrappedFn, ...args);
|
|
839
848
|
}
|
|
840
|
-
function searchProxy(self
|
|
841
|
-
const arr = toRaw(self
|
|
849
|
+
function searchProxy(self, method, args) {
|
|
850
|
+
const arr = /* @__PURE__ */ toRaw(self);
|
|
842
851
|
track(arr, "iterate", ARRAY_ITERATE_KEY);
|
|
843
852
|
const res = arr[method](...args);
|
|
844
|
-
if ((res === -1 || res === false) && isProxy(args[0])) {
|
|
845
|
-
args[0] = toRaw(args[0]);
|
|
853
|
+
if ((res === -1 || res === false) && /* @__PURE__ */ isProxy(args[0])) {
|
|
854
|
+
args[0] = /* @__PURE__ */ toRaw(args[0]);
|
|
846
855
|
return arr[method](...args);
|
|
847
856
|
}
|
|
848
857
|
return res;
|
|
849
858
|
}
|
|
850
|
-
function noTracking(self
|
|
859
|
+
function noTracking(self, method, args = []) {
|
|
851
860
|
pauseTracking();
|
|
852
861
|
startBatch();
|
|
853
|
-
const res = toRaw(self
|
|
862
|
+
const res = (/* @__PURE__ */ toRaw(self))[method].apply(self, args);
|
|
854
863
|
endBatch();
|
|
855
864
|
resetTracking();
|
|
856
865
|
return res;
|
|
@@ -859,7 +868,7 @@ const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`
|
|
|
859
868
|
const builtInSymbols = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
860
869
|
function hasOwnProperty(key) {
|
|
861
870
|
if (!isSymbol(key)) key = String(key);
|
|
862
|
-
const obj = toRaw(this);
|
|
871
|
+
const obj = /* @__PURE__ */ toRaw(this);
|
|
863
872
|
track(obj, "has", key);
|
|
864
873
|
return obj.hasOwnProperty(key);
|
|
865
874
|
}
|
|
@@ -884,15 +893,15 @@ var BaseReactiveHandler = class {
|
|
|
884
893
|
if (targetIsArray && (fn = arrayInstrumentations[key])) return fn;
|
|
885
894
|
if (key === "hasOwnProperty") return hasOwnProperty;
|
|
886
895
|
}
|
|
887
|
-
const res = Reflect.get(target, key, isRef(target) ? target : receiver);
|
|
896
|
+
const res = Reflect.get(target, key, /* @__PURE__ */ isRef(target) ? target : receiver);
|
|
888
897
|
if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) return res;
|
|
889
898
|
if (!isReadonly2) track(target, "get", key);
|
|
890
899
|
if (isShallow2) return res;
|
|
891
|
-
if (isRef(res)) {
|
|
900
|
+
if (/* @__PURE__ */ isRef(res)) {
|
|
892
901
|
const value = targetIsArray && isIntegerKey(key) ? res : res.value;
|
|
893
|
-
return isReadonly2 && isObject
|
|
902
|
+
return isReadonly2 && isObject(value) ? /* @__PURE__ */ readonly(value) : value;
|
|
894
903
|
}
|
|
895
|
-
if (isObject
|
|
904
|
+
if (isObject(res)) return isReadonly2 ? /* @__PURE__ */ readonly(res) : /* @__PURE__ */ reactive(res);
|
|
896
905
|
return res;
|
|
897
906
|
}
|
|
898
907
|
};
|
|
@@ -902,13 +911,14 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
|
|
|
902
911
|
}
|
|
903
912
|
set(target, key, value, receiver) {
|
|
904
913
|
let oldValue = target[key];
|
|
914
|
+
const isArrayWithIntegerKey = isArray(target) && isIntegerKey(key);
|
|
905
915
|
if (!this._isShallow) {
|
|
906
|
-
const isOldValueReadonly = isReadonly(oldValue);
|
|
907
|
-
if (
|
|
908
|
-
oldValue = toRaw(oldValue);
|
|
909
|
-
value = toRaw(value);
|
|
916
|
+
const isOldValueReadonly = /* @__PURE__ */ isReadonly(oldValue);
|
|
917
|
+
if (!/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value)) {
|
|
918
|
+
oldValue = /* @__PURE__ */ toRaw(oldValue);
|
|
919
|
+
value = /* @__PURE__ */ toRaw(value);
|
|
910
920
|
}
|
|
911
|
-
if (!
|
|
921
|
+
if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) if (isOldValueReadonly) {
|
|
912
922
|
if (!!(process.env.NODE_ENV !== "production")) warn$2(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
|
|
913
923
|
return true;
|
|
914
924
|
} else {
|
|
@@ -916,16 +926,16 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
|
|
|
916
926
|
return true;
|
|
917
927
|
}
|
|
918
928
|
}
|
|
919
|
-
const hadKey =
|
|
920
|
-
const result = Reflect.set(target, key, value, isRef(target) ? target : receiver);
|
|
921
|
-
if (target === toRaw(receiver)) {
|
|
929
|
+
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
930
|
+
const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
|
|
931
|
+
if (target === /* @__PURE__ */ toRaw(receiver)) {
|
|
922
932
|
if (!hadKey) trigger(target, "add", key, value);
|
|
923
933
|
else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
|
|
924
934
|
}
|
|
925
935
|
return result;
|
|
926
936
|
}
|
|
927
937
|
deleteProperty(target, key) {
|
|
928
|
-
const hadKey = hasOwn
|
|
938
|
+
const hadKey = hasOwn(target, key);
|
|
929
939
|
const oldValue = target[key];
|
|
930
940
|
const result = Reflect.deleteProperty(target, key);
|
|
931
941
|
if (result && hadKey) trigger(target, "delete", key, void 0, oldValue);
|
|
@@ -963,65 +973,60 @@ const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
|
963
973
|
function createIterableMethod(method, isReadonly2, isShallow2) {
|
|
964
974
|
return function(...args) {
|
|
965
975
|
const target = this["__v_raw"];
|
|
966
|
-
const rawTarget = toRaw(target);
|
|
976
|
+
const rawTarget = /* @__PURE__ */ toRaw(target);
|
|
967
977
|
const targetIsMap = isMap(rawTarget);
|
|
968
978
|
const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
|
|
969
979
|
const isKeyOnly = method === "keys" && targetIsMap;
|
|
970
980
|
const innerIterator = target[method](...args);
|
|
971
981
|
const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
972
982
|
!isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
|
|
973
|
-
return {
|
|
974
|
-
next()
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
},
|
|
984
|
-
[Symbol.iterator]() {
|
|
985
|
-
return this;
|
|
986
|
-
}
|
|
987
|
-
};
|
|
983
|
+
return extend(Object.create(innerIterator), { next() {
|
|
984
|
+
const { value, done } = innerIterator.next();
|
|
985
|
+
return done ? {
|
|
986
|
+
value,
|
|
987
|
+
done
|
|
988
|
+
} : {
|
|
989
|
+
value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
|
|
990
|
+
done
|
|
991
|
+
};
|
|
992
|
+
} });
|
|
988
993
|
};
|
|
989
994
|
}
|
|
990
995
|
function createReadonlyMethod(type) {
|
|
991
996
|
return function(...args) {
|
|
992
997
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
993
998
|
const key = args[0] ? `on key "${args[0]}" ` : ``;
|
|
994
|
-
warn$2(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));
|
|
999
|
+
warn$2(`${capitalize(type)} operation ${key}failed: target is readonly.`, /* @__PURE__ */ toRaw(this));
|
|
995
1000
|
}
|
|
996
1001
|
return type === "delete" ? false : type === "clear" ? void 0 : this;
|
|
997
1002
|
};
|
|
998
1003
|
}
|
|
999
|
-
function createInstrumentations(readonly
|
|
1004
|
+
function createInstrumentations(readonly, shallow) {
|
|
1000
1005
|
const instrumentations = {
|
|
1001
1006
|
get(key) {
|
|
1002
1007
|
const target = this["__v_raw"];
|
|
1003
|
-
const rawTarget = toRaw(target);
|
|
1004
|
-
const rawKey = toRaw(key);
|
|
1005
|
-
if (!readonly
|
|
1008
|
+
const rawTarget = /* @__PURE__ */ toRaw(target);
|
|
1009
|
+
const rawKey = /* @__PURE__ */ toRaw(key);
|
|
1010
|
+
if (!readonly) {
|
|
1006
1011
|
if (hasChanged(key, rawKey)) track(rawTarget, "get", key);
|
|
1007
1012
|
track(rawTarget, "get", rawKey);
|
|
1008
1013
|
}
|
|
1009
1014
|
const { has } = getProto(rawTarget);
|
|
1010
|
-
const wrap = shallow ? toShallow : readonly
|
|
1015
|
+
const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
|
|
1011
1016
|
if (has.call(rawTarget, key)) return wrap(target.get(key));
|
|
1012
1017
|
else if (has.call(rawTarget, rawKey)) return wrap(target.get(rawKey));
|
|
1013
1018
|
else if (target !== rawTarget) target.get(key);
|
|
1014
1019
|
},
|
|
1015
1020
|
get size() {
|
|
1016
1021
|
const target = this["__v_raw"];
|
|
1017
|
-
!readonly
|
|
1022
|
+
!readonly && track(/* @__PURE__ */ toRaw(target), "iterate", ITERATE_KEY);
|
|
1018
1023
|
return target.size;
|
|
1019
1024
|
},
|
|
1020
1025
|
has(key) {
|
|
1021
1026
|
const target = this["__v_raw"];
|
|
1022
|
-
const rawTarget = toRaw(target);
|
|
1023
|
-
const rawKey = toRaw(key);
|
|
1024
|
-
if (!readonly
|
|
1027
|
+
const rawTarget = /* @__PURE__ */ toRaw(target);
|
|
1028
|
+
const rawKey = /* @__PURE__ */ toRaw(key);
|
|
1029
|
+
if (!readonly) {
|
|
1025
1030
|
if (hasChanged(key, rawKey)) track(rawTarget, "has", key);
|
|
1026
1031
|
track(rawTarget, "has", rawKey);
|
|
1027
1032
|
}
|
|
@@ -1030,23 +1035,23 @@ function createInstrumentations(readonly$1, shallow) {
|
|
|
1030
1035
|
forEach(callback, thisArg) {
|
|
1031
1036
|
const observed = this;
|
|
1032
1037
|
const target = observed["__v_raw"];
|
|
1033
|
-
const rawTarget = toRaw(target);
|
|
1034
|
-
const wrap = shallow ? toShallow : readonly
|
|
1035
|
-
!readonly
|
|
1038
|
+
const rawTarget = /* @__PURE__ */ toRaw(target);
|
|
1039
|
+
const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
|
|
1040
|
+
!readonly && track(rawTarget, "iterate", ITERATE_KEY);
|
|
1036
1041
|
return target.forEach((value, key) => {
|
|
1037
1042
|
return callback.call(thisArg, wrap(value), wrap(key), observed);
|
|
1038
1043
|
});
|
|
1039
1044
|
}
|
|
1040
1045
|
};
|
|
1041
|
-
extend(instrumentations, readonly
|
|
1046
|
+
extend(instrumentations, readonly ? {
|
|
1042
1047
|
add: createReadonlyMethod("add"),
|
|
1043
1048
|
set: createReadonlyMethod("set"),
|
|
1044
1049
|
delete: createReadonlyMethod("delete"),
|
|
1045
1050
|
clear: createReadonlyMethod("clear")
|
|
1046
1051
|
} : {
|
|
1047
1052
|
add(value) {
|
|
1048
|
-
if (!shallow &&
|
|
1049
|
-
const target = toRaw(this);
|
|
1053
|
+
if (!shallow && !/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value)) value = /* @__PURE__ */ toRaw(value);
|
|
1054
|
+
const target = /* @__PURE__ */ toRaw(this);
|
|
1050
1055
|
if (!getProto(target).has.call(target, value)) {
|
|
1051
1056
|
target.add(value);
|
|
1052
1057
|
trigger(target, "add", value, value);
|
|
@@ -1054,12 +1059,12 @@ function createInstrumentations(readonly$1, shallow) {
|
|
|
1054
1059
|
return this;
|
|
1055
1060
|
},
|
|
1056
1061
|
set(key, value) {
|
|
1057
|
-
if (!shallow &&
|
|
1058
|
-
const target = toRaw(this);
|
|
1062
|
+
if (!shallow && !/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value)) value = /* @__PURE__ */ toRaw(value);
|
|
1063
|
+
const target = /* @__PURE__ */ toRaw(this);
|
|
1059
1064
|
const { has, get } = getProto(target);
|
|
1060
1065
|
let hadKey = has.call(target, key);
|
|
1061
1066
|
if (!hadKey) {
|
|
1062
|
-
key = toRaw(key);
|
|
1067
|
+
key = /* @__PURE__ */ toRaw(key);
|
|
1063
1068
|
hadKey = has.call(target, key);
|
|
1064
1069
|
} else if (!!(process.env.NODE_ENV !== "production")) checkIdentityKeys(target, has, key);
|
|
1065
1070
|
const oldValue = get.call(target, key);
|
|
@@ -1069,11 +1074,11 @@ function createInstrumentations(readonly$1, shallow) {
|
|
|
1069
1074
|
return this;
|
|
1070
1075
|
},
|
|
1071
1076
|
delete(key) {
|
|
1072
|
-
const target = toRaw(this);
|
|
1077
|
+
const target = /* @__PURE__ */ toRaw(this);
|
|
1073
1078
|
const { has, get } = getProto(target);
|
|
1074
1079
|
let hadKey = has.call(target, key);
|
|
1075
1080
|
if (!hadKey) {
|
|
1076
|
-
key = toRaw(key);
|
|
1081
|
+
key = /* @__PURE__ */ toRaw(key);
|
|
1077
1082
|
hadKey = has.call(target, key);
|
|
1078
1083
|
} else if (!!(process.env.NODE_ENV !== "production")) checkIdentityKeys(target, has, key);
|
|
1079
1084
|
const oldValue = get ? get.call(target, key) : void 0;
|
|
@@ -1082,7 +1087,7 @@ function createInstrumentations(readonly$1, shallow) {
|
|
|
1082
1087
|
return result;
|
|
1083
1088
|
},
|
|
1084
1089
|
clear() {
|
|
1085
|
-
const target = toRaw(this);
|
|
1090
|
+
const target = /* @__PURE__ */ toRaw(this);
|
|
1086
1091
|
const hadItems = target.size !== 0;
|
|
1087
1092
|
const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0;
|
|
1088
1093
|
const result = target.clear();
|
|
@@ -1096,7 +1101,7 @@ function createInstrumentations(readonly$1, shallow) {
|
|
|
1096
1101
|
"entries",
|
|
1097
1102
|
Symbol.iterator
|
|
1098
1103
|
].forEach((method) => {
|
|
1099
|
-
instrumentations[method] = createIterableMethod(method, readonly
|
|
1104
|
+
instrumentations[method] = createIterableMethod(method, readonly, shallow);
|
|
1100
1105
|
});
|
|
1101
1106
|
return instrumentations;
|
|
1102
1107
|
}
|
|
@@ -1106,7 +1111,7 @@ function createInstrumentationGetter(isReadonly2, shallow) {
|
|
|
1106
1111
|
if (key === "__v_isReactive") return !isReadonly2;
|
|
1107
1112
|
else if (key === "__v_isReadonly") return isReadonly2;
|
|
1108
1113
|
else if (key === "__v_raw") return target;
|
|
1109
|
-
return Reflect.get(hasOwn
|
|
1114
|
+
return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
|
|
1110
1115
|
};
|
|
1111
1116
|
}
|
|
1112
1117
|
const mutableCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, false) };
|
|
@@ -1114,7 +1119,7 @@ const shallowCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGe
|
|
|
1114
1119
|
const readonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, false) };
|
|
1115
1120
|
const shallowReadonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, true) };
|
|
1116
1121
|
function checkIdentityKeys(target, has, key) {
|
|
1117
|
-
const rawKey = toRaw(key);
|
|
1122
|
+
const rawKey = /* @__PURE__ */ toRaw(key);
|
|
1118
1123
|
if (rawKey !== key && has.call(target, rawKey)) {
|
|
1119
1124
|
const type = toRawType(target);
|
|
1120
1125
|
warn$2(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);
|
|
@@ -1138,21 +1143,25 @@ function targetTypeMap(rawType) {
|
|
|
1138
1143
|
function getTargetType(value) {
|
|
1139
1144
|
return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
1140
1145
|
}
|
|
1146
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1141
1147
|
function reactive(target) {
|
|
1142
|
-
if (isReadonly(target)) return target;
|
|
1148
|
+
if (/* @__PURE__ */ isReadonly(target)) return target;
|
|
1143
1149
|
return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
|
|
1144
1150
|
}
|
|
1151
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1145
1152
|
function shallowReactive(target) {
|
|
1146
1153
|
return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
|
|
1147
1154
|
}
|
|
1155
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1148
1156
|
function readonly(target) {
|
|
1149
1157
|
return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
|
|
1150
1158
|
}
|
|
1159
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1151
1160
|
function shallowReadonly(target) {
|
|
1152
1161
|
return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
|
|
1153
1162
|
}
|
|
1154
1163
|
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
|
|
1155
|
-
if (!isObject
|
|
1164
|
+
if (!isObject(target)) {
|
|
1156
1165
|
if (!!(process.env.NODE_ENV !== "production")) warn$2(`value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(target)}`);
|
|
1157
1166
|
return target;
|
|
1158
1167
|
}
|
|
@@ -1165,40 +1174,48 @@ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandl
|
|
|
1165
1174
|
proxyMap.set(target, proxy);
|
|
1166
1175
|
return proxy;
|
|
1167
1176
|
}
|
|
1177
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1168
1178
|
function isReactive(value) {
|
|
1169
|
-
if (isReadonly(value)) return isReactive(value["__v_raw"]);
|
|
1179
|
+
if (/* @__PURE__ */ isReadonly(value)) return /* @__PURE__ */ isReactive(value["__v_raw"]);
|
|
1170
1180
|
return !!(value && value["__v_isReactive"]);
|
|
1171
1181
|
}
|
|
1182
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1172
1183
|
function isReadonly(value) {
|
|
1173
1184
|
return !!(value && value["__v_isReadonly"]);
|
|
1174
1185
|
}
|
|
1186
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1175
1187
|
function isShallow(value) {
|
|
1176
1188
|
return !!(value && value["__v_isShallow"]);
|
|
1177
1189
|
}
|
|
1190
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1178
1191
|
function isProxy(value) {
|
|
1179
1192
|
return value ? !!value["__v_raw"] : false;
|
|
1180
1193
|
}
|
|
1194
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1181
1195
|
function toRaw(observed) {
|
|
1182
1196
|
const raw = observed && observed["__v_raw"];
|
|
1183
|
-
return raw ? toRaw(raw) : observed;
|
|
1197
|
+
return raw ? /* @__PURE__ */ toRaw(raw) : observed;
|
|
1184
1198
|
}
|
|
1185
1199
|
function markRaw(value) {
|
|
1186
|
-
if (!hasOwn
|
|
1200
|
+
if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) def(value, "__v_skip", true);
|
|
1187
1201
|
return value;
|
|
1188
1202
|
}
|
|
1189
|
-
const toReactive = (value) => isObject
|
|
1190
|
-
const toReadonly = (value) => isObject
|
|
1203
|
+
const toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value) : value;
|
|
1204
|
+
const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
|
|
1205
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1191
1206
|
function isRef(r) {
|
|
1192
1207
|
return r ? r["__v_isRef"] === true : false;
|
|
1193
1208
|
}
|
|
1209
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1194
1210
|
function ref(value) {
|
|
1195
|
-
return createRef
|
|
1211
|
+
return createRef(value, false);
|
|
1196
1212
|
}
|
|
1213
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1197
1214
|
function shallowRef(value) {
|
|
1198
|
-
return createRef
|
|
1215
|
+
return createRef(value, true);
|
|
1199
1216
|
}
|
|
1200
|
-
function createRef
|
|
1201
|
-
if (isRef(rawValue)) return rawValue;
|
|
1217
|
+
function createRef(rawValue, shallow) {
|
|
1218
|
+
if (/* @__PURE__ */ isRef(rawValue)) return rawValue;
|
|
1202
1219
|
return new RefImpl(rawValue, shallow);
|
|
1203
1220
|
}
|
|
1204
1221
|
var RefImpl = class {
|
|
@@ -1206,7 +1223,7 @@ var RefImpl = class {
|
|
|
1206
1223
|
this.dep = new Dep();
|
|
1207
1224
|
this["__v_isRef"] = true;
|
|
1208
1225
|
this["__v_isShallow"] = false;
|
|
1209
|
-
this._rawValue = isShallow2 ? value : toRaw(value);
|
|
1226
|
+
this._rawValue = isShallow2 ? value : /* @__PURE__ */ toRaw(value);
|
|
1210
1227
|
this._value = isShallow2 ? value : toReactive(value);
|
|
1211
1228
|
this["__v_isShallow"] = isShallow2;
|
|
1212
1229
|
}
|
|
@@ -1221,8 +1238,8 @@ var RefImpl = class {
|
|
|
1221
1238
|
}
|
|
1222
1239
|
set value(newValue) {
|
|
1223
1240
|
const oldValue = this._rawValue;
|
|
1224
|
-
const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
|
|
1225
|
-
newValue = useDirectValue ? newValue : toRaw(newValue);
|
|
1241
|
+
const useDirectValue = this["__v_isShallow"] || /* @__PURE__ */ isShallow(newValue) || /* @__PURE__ */ isReadonly(newValue);
|
|
1242
|
+
newValue = useDirectValue ? newValue : /* @__PURE__ */ toRaw(newValue);
|
|
1226
1243
|
if (hasChanged(newValue, oldValue)) {
|
|
1227
1244
|
this._rawValue = newValue;
|
|
1228
1245
|
this._value = useDirectValue ? newValue : toReactive(newValue);
|
|
@@ -1238,7 +1255,7 @@ var RefImpl = class {
|
|
|
1238
1255
|
}
|
|
1239
1256
|
};
|
|
1240
1257
|
function unref(ref2) {
|
|
1241
|
-
return isRef(ref2) ? ref2.value : ref2;
|
|
1258
|
+
return /* @__PURE__ */ isRef(ref2) ? ref2.value : ref2;
|
|
1242
1259
|
}
|
|
1243
1260
|
function toValue(source) {
|
|
1244
1261
|
return isFunction(source) ? source() : unref(source);
|
|
@@ -1247,14 +1264,14 @@ const shallowUnwrapHandlers = {
|
|
|
1247
1264
|
get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
|
|
1248
1265
|
set: (target, key, value, receiver) => {
|
|
1249
1266
|
const oldValue = target[key];
|
|
1250
|
-
if (isRef(oldValue) &&
|
|
1267
|
+
if (/* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
|
|
1251
1268
|
oldValue.value = value;
|
|
1252
1269
|
return true;
|
|
1253
1270
|
} else return Reflect.set(target, key, value, receiver);
|
|
1254
1271
|
}
|
|
1255
1272
|
};
|
|
1256
1273
|
function proxyRefs(objectWithRefs) {
|
|
1257
|
-
return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
|
|
1274
|
+
return /* @__PURE__ */ isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
|
|
1258
1275
|
}
|
|
1259
1276
|
var CustomRefImpl = class {
|
|
1260
1277
|
constructor(factory) {
|
|
@@ -1275,8 +1292,9 @@ var CustomRefImpl = class {
|
|
|
1275
1292
|
function customRef(factory) {
|
|
1276
1293
|
return new CustomRefImpl(factory);
|
|
1277
1294
|
}
|
|
1278
|
-
|
|
1279
|
-
|
|
1295
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1296
|
+
function toRefs(object) {
|
|
1297
|
+
if (!!(process.env.NODE_ENV !== "production") && !/* @__PURE__ */ isProxy(object)) warn$2(`toRefs() expects a reactive object but received a plain one.`);
|
|
1280
1298
|
const ret = isArray(object) ? new Array(object.length) : {};
|
|
1281
1299
|
for (const key in object) ret[key] = propertyToRef(object, key);
|
|
1282
1300
|
return ret;
|
|
@@ -1288,16 +1306,31 @@ var ObjectRefImpl = class {
|
|
|
1288
1306
|
this._defaultValue = _defaultValue;
|
|
1289
1307
|
this["__v_isRef"] = true;
|
|
1290
1308
|
this._value = void 0;
|
|
1309
|
+
this._raw = /* @__PURE__ */ toRaw(_object);
|
|
1310
|
+
let shallow = true;
|
|
1311
|
+
let obj = _object;
|
|
1312
|
+
if (!isArray(_object) || !isIntegerKey(String(_key))) do
|
|
1313
|
+
shallow = !/* @__PURE__ */ isProxy(obj) || /* @__PURE__ */ isShallow(obj);
|
|
1314
|
+
while (shallow && (obj = obj["__v_raw"]));
|
|
1315
|
+
this._shallow = shallow;
|
|
1291
1316
|
}
|
|
1292
1317
|
get value() {
|
|
1293
|
-
|
|
1318
|
+
let val = this._object[this._key];
|
|
1319
|
+
if (this._shallow) val = unref(val);
|
|
1294
1320
|
return this._value = val === void 0 ? this._defaultValue : val;
|
|
1295
1321
|
}
|
|
1296
1322
|
set value(newVal) {
|
|
1323
|
+
if (this._shallow && /* @__PURE__ */ isRef(this._raw[this._key])) {
|
|
1324
|
+
const nestedRef = this._object[this._key];
|
|
1325
|
+
if (/* @__PURE__ */ isRef(nestedRef)) {
|
|
1326
|
+
nestedRef.value = newVal;
|
|
1327
|
+
return;
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1297
1330
|
this._object[this._key] = newVal;
|
|
1298
1331
|
}
|
|
1299
1332
|
get dep() {
|
|
1300
|
-
return getDepFromReactive(
|
|
1333
|
+
return getDepFromReactive(this._raw, this._key);
|
|
1301
1334
|
}
|
|
1302
1335
|
};
|
|
1303
1336
|
var GetterRefImpl = class {
|
|
@@ -1311,15 +1344,15 @@ var GetterRefImpl = class {
|
|
|
1311
1344
|
return this._value = this._getter();
|
|
1312
1345
|
}
|
|
1313
1346
|
};
|
|
1314
|
-
|
|
1315
|
-
|
|
1347
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1348
|
+
function toRef(source, key, defaultValue) {
|
|
1349
|
+
if (/* @__PURE__ */ isRef(source)) return source;
|
|
1316
1350
|
else if (isFunction(source)) return new GetterRefImpl(source);
|
|
1317
|
-
else if (isObject
|
|
1318
|
-
else return ref(source);
|
|
1351
|
+
else if (isObject(source) && arguments.length > 1) return propertyToRef(source, key, defaultValue);
|
|
1352
|
+
else return /* @__PURE__ */ ref(source);
|
|
1319
1353
|
}
|
|
1320
1354
|
function propertyToRef(source, key, defaultValue) {
|
|
1321
|
-
|
|
1322
|
-
return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
|
|
1355
|
+
return new ObjectRefImpl(source, key, defaultValue);
|
|
1323
1356
|
}
|
|
1324
1357
|
var ComputedRefImpl = class {
|
|
1325
1358
|
constructor(fn, setter, isSSR) {
|
|
@@ -1386,6 +1419,7 @@ var ComputedRefImpl = class {
|
|
|
1386
1419
|
else if (!!(process.env.NODE_ENV !== "production")) warn$2("Write operation failed: computed value is readonly");
|
|
1387
1420
|
}
|
|
1388
1421
|
};
|
|
1422
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1389
1423
|
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1390
1424
|
let getter;
|
|
1391
1425
|
let setter;
|
|
@@ -1418,27 +1452,27 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
|
|
|
1418
1452
|
};
|
|
1419
1453
|
const reactiveGetter = (source2) => {
|
|
1420
1454
|
if (deep) return source2;
|
|
1421
|
-
if (isShallow(source2) || deep === false || deep === 0) return traverse(source2, 1);
|
|
1455
|
+
if (/* @__PURE__ */ isShallow(source2) || deep === false || deep === 0) return traverse(source2, 1);
|
|
1422
1456
|
return traverse(source2);
|
|
1423
1457
|
};
|
|
1424
|
-
let effect
|
|
1458
|
+
let effect;
|
|
1425
1459
|
let getter;
|
|
1426
1460
|
let cleanup;
|
|
1427
1461
|
let boundCleanup;
|
|
1428
1462
|
let forceTrigger = false;
|
|
1429
1463
|
let isMultiSource = false;
|
|
1430
|
-
if (isRef(source)) {
|
|
1464
|
+
if (/* @__PURE__ */ isRef(source)) {
|
|
1431
1465
|
getter = () => source.value;
|
|
1432
|
-
forceTrigger = isShallow(source);
|
|
1433
|
-
} else if (isReactive(source)) {
|
|
1466
|
+
forceTrigger = /* @__PURE__ */ isShallow(source);
|
|
1467
|
+
} else if (/* @__PURE__ */ isReactive(source)) {
|
|
1434
1468
|
getter = () => reactiveGetter(source);
|
|
1435
1469
|
forceTrigger = true;
|
|
1436
1470
|
} else if (isArray(source)) {
|
|
1437
1471
|
isMultiSource = true;
|
|
1438
|
-
forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
|
|
1472
|
+
forceTrigger = source.some((s) => /* @__PURE__ */ isReactive(s) || /* @__PURE__ */ isShallow(s));
|
|
1439
1473
|
getter = () => source.map((s) => {
|
|
1440
|
-
if (isRef(s)) return s.value;
|
|
1441
|
-
else if (isReactive(s)) return reactiveGetter(s);
|
|
1474
|
+
if (/* @__PURE__ */ isRef(s)) return s.value;
|
|
1475
|
+
else if (/* @__PURE__ */ isReactive(s)) return reactiveGetter(s);
|
|
1442
1476
|
else if (isFunction(s)) return call ? call(s, 2) : s();
|
|
1443
1477
|
else process.env.NODE_ENV !== "production" && warnInvalidSource(s);
|
|
1444
1478
|
});
|
|
@@ -1453,7 +1487,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
|
|
|
1453
1487
|
}
|
|
1454
1488
|
}
|
|
1455
1489
|
const currentEffect = activeWatcher;
|
|
1456
|
-
activeWatcher = effect
|
|
1490
|
+
activeWatcher = effect;
|
|
1457
1491
|
try {
|
|
1458
1492
|
return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
|
|
1459
1493
|
} finally {
|
|
@@ -1471,8 +1505,8 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
|
|
|
1471
1505
|
}
|
|
1472
1506
|
const scope = getCurrentScope();
|
|
1473
1507
|
const watchHandle = () => {
|
|
1474
|
-
effect
|
|
1475
|
-
if (scope && scope.active) remove(scope.effects, effect
|
|
1508
|
+
effect.stop();
|
|
1509
|
+
if (scope && scope.active) remove(scope.effects, effect);
|
|
1476
1510
|
};
|
|
1477
1511
|
if (once && cb) {
|
|
1478
1512
|
const _cb = cb;
|
|
@@ -1483,13 +1517,13 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
|
|
|
1483
1517
|
}
|
|
1484
1518
|
let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
|
|
1485
1519
|
const job = (immediateFirstRun) => {
|
|
1486
|
-
if (!(effect
|
|
1520
|
+
if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) return;
|
|
1487
1521
|
if (cb) {
|
|
1488
|
-
const newValue = effect
|
|
1522
|
+
const newValue = effect.run();
|
|
1489
1523
|
if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
1490
1524
|
if (cleanup) cleanup();
|
|
1491
1525
|
const currentWatcher = activeWatcher;
|
|
1492
|
-
activeWatcher = effect
|
|
1526
|
+
activeWatcher = effect;
|
|
1493
1527
|
try {
|
|
1494
1528
|
const args = [
|
|
1495
1529
|
newValue,
|
|
@@ -1502,40 +1536,40 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
|
|
|
1502
1536
|
activeWatcher = currentWatcher;
|
|
1503
1537
|
}
|
|
1504
1538
|
}
|
|
1505
|
-
} else effect
|
|
1539
|
+
} else effect.run();
|
|
1506
1540
|
};
|
|
1507
1541
|
if (augmentJob) augmentJob(job);
|
|
1508
|
-
effect
|
|
1509
|
-
effect
|
|
1510
|
-
boundCleanup = (fn) => onWatcherCleanup(fn, false, effect
|
|
1511
|
-
cleanup = effect
|
|
1512
|
-
const cleanups = cleanupMap.get(effect
|
|
1542
|
+
effect = new ReactiveEffect(getter);
|
|
1543
|
+
effect.scheduler = scheduler ? () => scheduler(job, false) : job;
|
|
1544
|
+
boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);
|
|
1545
|
+
cleanup = effect.onStop = () => {
|
|
1546
|
+
const cleanups = cleanupMap.get(effect);
|
|
1513
1547
|
if (cleanups) {
|
|
1514
1548
|
if (call) call(cleanups, 4);
|
|
1515
1549
|
else for (const cleanup2 of cleanups) cleanup2();
|
|
1516
|
-
cleanupMap.delete(effect
|
|
1550
|
+
cleanupMap.delete(effect);
|
|
1517
1551
|
}
|
|
1518
1552
|
};
|
|
1519
1553
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1520
|
-
effect
|
|
1521
|
-
effect
|
|
1554
|
+
effect.onTrack = options.onTrack;
|
|
1555
|
+
effect.onTrigger = options.onTrigger;
|
|
1522
1556
|
}
|
|
1523
1557
|
if (cb) if (immediate) job(true);
|
|
1524
|
-
else oldValue = effect
|
|
1558
|
+
else oldValue = effect.run();
|
|
1525
1559
|
else if (scheduler) scheduler(job.bind(null, true), true);
|
|
1526
|
-
else effect
|
|
1527
|
-
watchHandle.pause = effect
|
|
1528
|
-
watchHandle.resume = effect
|
|
1560
|
+
else effect.run();
|
|
1561
|
+
watchHandle.pause = effect.pause.bind(effect);
|
|
1562
|
+
watchHandle.resume = effect.resume.bind(effect);
|
|
1529
1563
|
watchHandle.stop = watchHandle;
|
|
1530
1564
|
return watchHandle;
|
|
1531
1565
|
}
|
|
1532
1566
|
function traverse(value, depth = Infinity, seen) {
|
|
1533
|
-
if (depth <= 0 || !isObject
|
|
1567
|
+
if (depth <= 0 || !isObject(value) || value["__v_skip"]) return value;
|
|
1534
1568
|
seen = seen || /* @__PURE__ */ new Map();
|
|
1535
1569
|
if ((seen.get(value) || 0) >= depth) return value;
|
|
1536
1570
|
seen.set(value, depth);
|
|
1537
1571
|
depth--;
|
|
1538
|
-
if (isRef(value)) traverse(value.value, depth, seen);
|
|
1572
|
+
if (/* @__PURE__ */ isRef(value)) traverse(value.value, depth, seen);
|
|
1539
1573
|
else if (isArray(value)) for (let i = 0; i < value.length; i++) traverse(value[i], depth, seen);
|
|
1540
1574
|
else if (isSet(value) || isMap(value)) value.forEach((v) => {
|
|
1541
1575
|
traverse(v, depth, seen);
|
|
@@ -1548,7 +1582,12 @@ function traverse(value, depth = Infinity, seen) {
|
|
|
1548
1582
|
}
|
|
1549
1583
|
|
|
1550
1584
|
//#endregion
|
|
1551
|
-
//#region ../../node_modules/.pnpm/@vue+runtime-core@3.5.
|
|
1585
|
+
//#region ../../node_modules/.pnpm/@vue+runtime-core@3.5.27/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
|
|
1586
|
+
/**
|
|
1587
|
+
* @vue/runtime-core v3.5.27
|
|
1588
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
1589
|
+
* @license MIT
|
|
1590
|
+
**/
|
|
1552
1591
|
const stack = [];
|
|
1553
1592
|
function pushWarningContext(vnode) {
|
|
1554
1593
|
stack.push(vnode);
|
|
@@ -1644,6 +1683,12 @@ function formatProp(key, value, raw) {
|
|
|
1644
1683
|
return raw ? value : [`${key}=`, value];
|
|
1645
1684
|
}
|
|
1646
1685
|
}
|
|
1686
|
+
function assertNumber(val, type) {
|
|
1687
|
+
if (!!!(process.env.NODE_ENV !== "production")) return;
|
|
1688
|
+
if (val === void 0) return;
|
|
1689
|
+
else if (typeof val !== "number") warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
|
|
1690
|
+
else if (isNaN(val)) warn$1(`${type} is NaN - the duration expression might be incorrect.`);
|
|
1691
|
+
}
|
|
1647
1692
|
const ErrorTypeStrings$1 = {
|
|
1648
1693
|
["sp"]: "serverPrefetch hook",
|
|
1649
1694
|
["bc"]: "beforeCreate hook",
|
|
@@ -1745,8 +1790,8 @@ const resolvedPromise = /* @__PURE__ */ Promise.resolve();
|
|
|
1745
1790
|
let currentFlushPromise = null;
|
|
1746
1791
|
const RECURSION_LIMIT = 100;
|
|
1747
1792
|
function nextTick(fn) {
|
|
1748
|
-
const p
|
|
1749
|
-
return fn ? p
|
|
1793
|
+
const p = currentFlushPromise || resolvedPromise;
|
|
1794
|
+
return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
1750
1795
|
}
|
|
1751
1796
|
function findInsertionIndex(id) {
|
|
1752
1797
|
let start = flushIndex + 1;
|
|
@@ -1988,8 +2033,8 @@ function setDevtoolsHook$1(hook, target) {
|
|
|
1988
2033
|
buffer = [];
|
|
1989
2034
|
}
|
|
1990
2035
|
}
|
|
1991
|
-
function devtoolsInitApp(app, version
|
|
1992
|
-
emit$1("app:init", app, version
|
|
2036
|
+
function devtoolsInitApp(app, version) {
|
|
2037
|
+
emit$1("app:init", app, version, {
|
|
1993
2038
|
Fragment,
|
|
1994
2039
|
Text,
|
|
1995
2040
|
Comment,
|
|
@@ -2099,10 +2144,122 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
2099
2144
|
}
|
|
2100
2145
|
}
|
|
2101
2146
|
}
|
|
2102
|
-
|
|
2147
|
+
function provide(key, value) {
|
|
2148
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2149
|
+
if (!currentInstance || currentInstance.isMounted) warn$1(`provide() can only be used inside setup().`);
|
|
2150
|
+
}
|
|
2151
|
+
if (currentInstance) {
|
|
2152
|
+
let provides = currentInstance.provides;
|
|
2153
|
+
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
2154
|
+
if (parentProvides === provides) provides = currentInstance.provides = Object.create(parentProvides);
|
|
2155
|
+
provides[key] = value;
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
2159
|
+
const instance = getCurrentInstance();
|
|
2160
|
+
if (instance || currentApp) {
|
|
2161
|
+
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
|
|
2162
|
+
if (provides && key in provides) return provides[key];
|
|
2163
|
+
else if (arguments.length > 1) return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
2164
|
+
else if (!!(process.env.NODE_ENV !== "production")) warn$1(`injection "${String(key)}" not found.`);
|
|
2165
|
+
} else if (!!(process.env.NODE_ENV !== "production")) warn$1(`inject() can only be used inside setup() or functional components.`);
|
|
2166
|
+
}
|
|
2167
|
+
function hasInjectionContext() {
|
|
2168
|
+
return !!(getCurrentInstance() || currentApp);
|
|
2169
|
+
}
|
|
2170
|
+
const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
|
|
2171
|
+
const useSSRContext = () => {
|
|
2172
|
+
{
|
|
2173
|
+
const ctx = inject(ssrContextKey);
|
|
2174
|
+
if (!ctx) process.env.NODE_ENV !== "production" && warn$1(`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`);
|
|
2175
|
+
return ctx;
|
|
2176
|
+
}
|
|
2177
|
+
};
|
|
2178
|
+
function watchEffect(effect, options) {
|
|
2179
|
+
return doWatch(effect, null, options);
|
|
2180
|
+
}
|
|
2181
|
+
function watch(source, cb, options) {
|
|
2182
|
+
if (!!(process.env.NODE_ENV !== "production") && !isFunction(cb)) warn$1(`\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`);
|
|
2183
|
+
return doWatch(source, cb, options);
|
|
2184
|
+
}
|
|
2185
|
+
function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
2186
|
+
const { immediate, deep, flush, once } = options;
|
|
2187
|
+
if (!!(process.env.NODE_ENV !== "production") && !cb) {
|
|
2188
|
+
if (immediate !== void 0) warn$1(`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`);
|
|
2189
|
+
if (deep !== void 0) warn$1(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`);
|
|
2190
|
+
if (once !== void 0) warn$1(`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`);
|
|
2191
|
+
}
|
|
2192
|
+
const baseWatchOptions = extend({}, options);
|
|
2193
|
+
if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
|
|
2194
|
+
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
2195
|
+
let ssrCleanup;
|
|
2196
|
+
if (isInSSRComponentSetup) {
|
|
2197
|
+
if (flush === "sync") {
|
|
2198
|
+
const ctx = useSSRContext();
|
|
2199
|
+
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
2200
|
+
} else if (!runsImmediately) {
|
|
2201
|
+
const watchStopHandle = () => {};
|
|
2202
|
+
watchStopHandle.stop = NOOP;
|
|
2203
|
+
watchStopHandle.resume = NOOP;
|
|
2204
|
+
watchStopHandle.pause = NOOP;
|
|
2205
|
+
return watchStopHandle;
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
const instance = currentInstance;
|
|
2209
|
+
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
2210
|
+
let isPre = false;
|
|
2211
|
+
if (flush === "post") baseWatchOptions.scheduler = (job) => {
|
|
2212
|
+
queuePostRenderEffect(job, instance && instance.suspense);
|
|
2213
|
+
};
|
|
2214
|
+
else if (flush !== "sync") {
|
|
2215
|
+
isPre = true;
|
|
2216
|
+
baseWatchOptions.scheduler = (job, isFirstRun) => {
|
|
2217
|
+
if (isFirstRun) job();
|
|
2218
|
+
else queueJob(job);
|
|
2219
|
+
};
|
|
2220
|
+
}
|
|
2221
|
+
baseWatchOptions.augmentJob = (job) => {
|
|
2222
|
+
if (cb) job.flags |= 4;
|
|
2223
|
+
if (isPre) {
|
|
2224
|
+
job.flags |= 2;
|
|
2225
|
+
if (instance) {
|
|
2226
|
+
job.id = instance.uid;
|
|
2227
|
+
job.i = instance;
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
};
|
|
2231
|
+
const watchHandle = watch$1(source, cb, baseWatchOptions);
|
|
2232
|
+
if (isInSSRComponentSetup) {
|
|
2233
|
+
if (ssrCleanup) ssrCleanup.push(watchHandle);
|
|
2234
|
+
else if (runsImmediately) watchHandle();
|
|
2235
|
+
}
|
|
2236
|
+
return watchHandle;
|
|
2237
|
+
}
|
|
2238
|
+
function instanceWatch(source, value, options) {
|
|
2239
|
+
const publicThis = this.proxy;
|
|
2240
|
+
const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
2241
|
+
let cb;
|
|
2242
|
+
if (isFunction(value)) cb = value;
|
|
2243
|
+
else {
|
|
2244
|
+
cb = value.handler;
|
|
2245
|
+
options = value;
|
|
2246
|
+
}
|
|
2247
|
+
const reset = setCurrentInstance(this);
|
|
2248
|
+
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
2249
|
+
reset();
|
|
2250
|
+
return res;
|
|
2251
|
+
}
|
|
2252
|
+
function createPathGetter(ctx, path) {
|
|
2253
|
+
const segments = path.split(".");
|
|
2254
|
+
return () => {
|
|
2255
|
+
let cur = ctx;
|
|
2256
|
+
for (let i = 0; i < segments.length && cur; i++) cur = cur[segments[i]];
|
|
2257
|
+
return cur;
|
|
2258
|
+
};
|
|
2259
|
+
}
|
|
2260
|
+
const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
|
|
2103
2261
|
const isTeleport = (type) => type.__isTeleport;
|
|
2104
|
-
const leaveCbKey = Symbol("_leaveCb");
|
|
2105
|
-
const enterCbKey$1 = Symbol("_enterCb");
|
|
2262
|
+
const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
|
|
2106
2263
|
function setTransitionHooks(vnode, hooks) {
|
|
2107
2264
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
2108
2265
|
vnode.transition = hooks;
|
|
@@ -2114,7 +2271,7 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
2114
2271
|
}
|
|
2115
2272
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2116
2273
|
function defineComponent(options, extraOptions) {
|
|
2117
|
-
return isFunction(options) ?
|
|
2274
|
+
return isFunction(options) ? extend({ name: options.name }, extraOptions, { setup: options }) : options;
|
|
2118
2275
|
}
|
|
2119
2276
|
function markAsyncBoundary(instance) {
|
|
2120
2277
|
instance.ids = [
|
|
@@ -2153,7 +2310,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
2153
2310
|
}
|
|
2154
2311
|
const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
|
|
2155
2312
|
const value = isUnmount ? null : refValue;
|
|
2156
|
-
const { i: owner, r: ref
|
|
2313
|
+
const { i: owner, r: ref } = rawRef;
|
|
2157
2314
|
if (!!(process.env.NODE_ENV !== "production") && !owner) {
|
|
2158
2315
|
warn$1(`Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`);
|
|
2159
2316
|
return;
|
|
@@ -2164,15 +2321,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
2164
2321
|
const rawSetupState = toRaw(setupState);
|
|
2165
2322
|
const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => {
|
|
2166
2323
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2167
|
-
if (hasOwn
|
|
2324
|
+
if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) warn$1(`Template ref "${key}" used on a non-ref value. It will not work in the production build.`);
|
|
2168
2325
|
if (knownTemplateRefs.has(rawSetupState[key])) return false;
|
|
2169
2326
|
}
|
|
2170
|
-
return hasOwn
|
|
2327
|
+
return hasOwn(rawSetupState, key);
|
|
2171
2328
|
};
|
|
2172
2329
|
const canSetRef = (ref2) => {
|
|
2173
2330
|
return !!!(process.env.NODE_ENV !== "production") || !knownTemplateRefs.has(ref2);
|
|
2174
2331
|
};
|
|
2175
|
-
if (oldRef != null && oldRef !== ref
|
|
2332
|
+
if (oldRef != null && oldRef !== ref) {
|
|
2176
2333
|
invalidatePendingSetRef(oldRawRef);
|
|
2177
2334
|
if (isString(oldRef)) {
|
|
2178
2335
|
refs[oldRef] = null;
|
|
@@ -2183,31 +2340,31 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
2183
2340
|
if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
|
|
2184
2341
|
}
|
|
2185
2342
|
}
|
|
2186
|
-
if (isFunction(ref
|
|
2343
|
+
if (isFunction(ref)) callWithErrorHandling(ref, owner, 12, [value, refs]);
|
|
2187
2344
|
else {
|
|
2188
|
-
const _isString = isString(ref
|
|
2189
|
-
const _isRef = isRef(ref
|
|
2345
|
+
const _isString = isString(ref);
|
|
2346
|
+
const _isRef = isRef(ref);
|
|
2190
2347
|
if (_isString || _isRef) {
|
|
2191
2348
|
const doSet = () => {
|
|
2192
2349
|
if (rawRef.f) {
|
|
2193
|
-
const existing = _isString ? canSetSetupRef(ref
|
|
2350
|
+
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
2194
2351
|
if (isUnmount) isArray(existing) && remove(existing, refValue);
|
|
2195
2352
|
else if (!isArray(existing)) if (_isString) {
|
|
2196
|
-
refs[ref
|
|
2197
|
-
if (canSetSetupRef(ref
|
|
2353
|
+
refs[ref] = [refValue];
|
|
2354
|
+
if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
|
|
2198
2355
|
} else {
|
|
2199
2356
|
const newVal = [refValue];
|
|
2200
|
-
if (canSetRef(ref
|
|
2357
|
+
if (canSetRef(ref)) ref.value = newVal;
|
|
2201
2358
|
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
2202
2359
|
}
|
|
2203
2360
|
else if (!existing.includes(refValue)) existing.push(refValue);
|
|
2204
2361
|
} else if (_isString) {
|
|
2205
|
-
refs[ref
|
|
2206
|
-
if (canSetSetupRef(ref
|
|
2362
|
+
refs[ref] = value;
|
|
2363
|
+
if (canSetSetupRef(ref)) setupState[ref] = value;
|
|
2207
2364
|
} else if (_isRef) {
|
|
2208
|
-
if (canSetRef(ref
|
|
2365
|
+
if (canSetRef(ref)) ref.value = value;
|
|
2209
2366
|
if (rawRef.k) refs[rawRef.k] = value;
|
|
2210
|
-
} else if (!!(process.env.NODE_ENV !== "production")) warn$1("Invalid template ref type:", ref
|
|
2367
|
+
} else if (!!(process.env.NODE_ENV !== "production")) warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
|
|
2211
2368
|
};
|
|
2212
2369
|
if (value) {
|
|
2213
2370
|
const job = () => {
|
|
@@ -2221,7 +2378,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
2221
2378
|
invalidatePendingSetRef(rawRef);
|
|
2222
2379
|
doSet();
|
|
2223
2380
|
}
|
|
2224
|
-
} else if (!!(process.env.NODE_ENV !== "production")) warn$1("Invalid template ref type:", ref
|
|
2381
|
+
} else if (!!(process.env.NODE_ENV !== "production")) warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
|
|
2225
2382
|
}
|
|
2226
2383
|
}
|
|
2227
2384
|
function invalidatePendingSetRef(rawRef) {
|
|
@@ -2231,9 +2388,130 @@ function invalidatePendingSetRef(rawRef) {
|
|
|
2231
2388
|
pendingSetRefMap.delete(rawRef);
|
|
2232
2389
|
}
|
|
2233
2390
|
}
|
|
2391
|
+
const isComment = (node) => node.nodeType === 8;
|
|
2234
2392
|
const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
2235
2393
|
const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
2394
|
+
function forEachElement(node, cb) {
|
|
2395
|
+
if (isComment(node) && node.data === "[") {
|
|
2396
|
+
let depth = 1;
|
|
2397
|
+
let next = node.nextSibling;
|
|
2398
|
+
while (next) {
|
|
2399
|
+
if (next.nodeType === 1) {
|
|
2400
|
+
if (cb(next) === false) break;
|
|
2401
|
+
} else if (isComment(next)) {
|
|
2402
|
+
if (next.data === "]") {
|
|
2403
|
+
if (--depth === 0) break;
|
|
2404
|
+
} else if (next.data === "[") depth++;
|
|
2405
|
+
}
|
|
2406
|
+
next = next.nextSibling;
|
|
2407
|
+
}
|
|
2408
|
+
} else cb(node);
|
|
2409
|
+
}
|
|
2236
2410
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
2411
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2412
|
+
function defineAsyncComponent(source) {
|
|
2413
|
+
if (isFunction(source)) source = { loader: source };
|
|
2414
|
+
const { loader, loadingComponent, errorComponent, delay = 200, hydrate: hydrateStrategy, timeout, suspensible = true, onError: userOnError } = source;
|
|
2415
|
+
let pendingRequest = null;
|
|
2416
|
+
let resolvedComp;
|
|
2417
|
+
let retries = 0;
|
|
2418
|
+
const retry = () => {
|
|
2419
|
+
retries++;
|
|
2420
|
+
pendingRequest = null;
|
|
2421
|
+
return load();
|
|
2422
|
+
};
|
|
2423
|
+
const load = () => {
|
|
2424
|
+
let thisRequest;
|
|
2425
|
+
return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
|
|
2426
|
+
err = err instanceof Error ? err : new Error(String(err));
|
|
2427
|
+
if (userOnError) return new Promise((resolve, reject) => {
|
|
2428
|
+
const userRetry = () => resolve(retry());
|
|
2429
|
+
const userFail = () => reject(err);
|
|
2430
|
+
userOnError(err, userRetry, userFail, retries + 1);
|
|
2431
|
+
});
|
|
2432
|
+
else throw err;
|
|
2433
|
+
}).then((comp) => {
|
|
2434
|
+
if (thisRequest !== pendingRequest && pendingRequest) return pendingRequest;
|
|
2435
|
+
if (!!(process.env.NODE_ENV !== "production") && !comp) warn$1(`Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`);
|
|
2436
|
+
if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) comp = comp.default;
|
|
2437
|
+
if (!!(process.env.NODE_ENV !== "production") && comp && !isObject(comp) && !isFunction(comp)) throw new Error(`Invalid async component load result: ${comp}`);
|
|
2438
|
+
resolvedComp = comp;
|
|
2439
|
+
return comp;
|
|
2440
|
+
}));
|
|
2441
|
+
};
|
|
2442
|
+
return /* @__PURE__ */ defineComponent({
|
|
2443
|
+
name: "AsyncComponentWrapper",
|
|
2444
|
+
__asyncLoader: load,
|
|
2445
|
+
__asyncHydrate(el, instance, hydrate) {
|
|
2446
|
+
let patched = false;
|
|
2447
|
+
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
2448
|
+
const performHydrate = () => {
|
|
2449
|
+
if (patched) {
|
|
2450
|
+
if (!!(process.env.NODE_ENV !== "production")) warn$1(`Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`);
|
|
2451
|
+
return;
|
|
2452
|
+
}
|
|
2453
|
+
hydrate();
|
|
2454
|
+
};
|
|
2455
|
+
const doHydrate = hydrateStrategy ? () => {
|
|
2456
|
+
const teardown = hydrateStrategy(performHydrate, (cb) => forEachElement(el, cb));
|
|
2457
|
+
if (teardown) (instance.bum || (instance.bum = [])).push(teardown);
|
|
2458
|
+
} : performHydrate;
|
|
2459
|
+
if (resolvedComp) doHydrate();
|
|
2460
|
+
else load().then(() => !instance.isUnmounted && doHydrate());
|
|
2461
|
+
},
|
|
2462
|
+
get __asyncResolved() {
|
|
2463
|
+
return resolvedComp;
|
|
2464
|
+
},
|
|
2465
|
+
setup() {
|
|
2466
|
+
const instance = currentInstance;
|
|
2467
|
+
markAsyncBoundary(instance);
|
|
2468
|
+
if (resolvedComp) return () => createInnerComp(resolvedComp, instance);
|
|
2469
|
+
const onError = (err) => {
|
|
2470
|
+
pendingRequest = null;
|
|
2471
|
+
handleError(err, instance, 13, !errorComponent);
|
|
2472
|
+
};
|
|
2473
|
+
if (suspensible && instance.suspense || isInSSRComponentSetup) return load().then((comp) => {
|
|
2474
|
+
return () => createInnerComp(comp, instance);
|
|
2475
|
+
}).catch((err) => {
|
|
2476
|
+
onError(err);
|
|
2477
|
+
return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
|
|
2478
|
+
});
|
|
2479
|
+
const loaded = ref(false);
|
|
2480
|
+
const error = ref();
|
|
2481
|
+
const delayed = ref(!!delay);
|
|
2482
|
+
if (delay) setTimeout(() => {
|
|
2483
|
+
delayed.value = false;
|
|
2484
|
+
}, delay);
|
|
2485
|
+
if (timeout != null) setTimeout(() => {
|
|
2486
|
+
if (!loaded.value && !error.value) {
|
|
2487
|
+
const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
|
|
2488
|
+
onError(err);
|
|
2489
|
+
error.value = err;
|
|
2490
|
+
}
|
|
2491
|
+
}, timeout);
|
|
2492
|
+
load().then(() => {
|
|
2493
|
+
loaded.value = true;
|
|
2494
|
+
if (instance.parent && isKeepAlive(instance.parent.vnode)) instance.parent.update();
|
|
2495
|
+
}).catch((err) => {
|
|
2496
|
+
onError(err);
|
|
2497
|
+
error.value = err;
|
|
2498
|
+
});
|
|
2499
|
+
return () => {
|
|
2500
|
+
if (loaded.value && resolvedComp) return createInnerComp(resolvedComp, instance);
|
|
2501
|
+
else if (error.value && errorComponent) return createVNode(errorComponent, { error: error.value });
|
|
2502
|
+
else if (loadingComponent && !delayed.value) return createInnerComp(loadingComponent, instance);
|
|
2503
|
+
};
|
|
2504
|
+
}
|
|
2505
|
+
});
|
|
2506
|
+
}
|
|
2507
|
+
function createInnerComp(comp, parent) {
|
|
2508
|
+
const { ref: ref2, props, children, ce } = parent.vnode;
|
|
2509
|
+
const vnode = createVNode(comp, props, children);
|
|
2510
|
+
vnode.ref = ref2;
|
|
2511
|
+
vnode.ce = ce;
|
|
2512
|
+
delete parent.vnode.ce;
|
|
2513
|
+
return vnode;
|
|
2514
|
+
}
|
|
2237
2515
|
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
|
|
2238
2516
|
function onActivated(hook, target) {
|
|
2239
2517
|
registerKeepAliveHook(hook, "a", target);
|
|
@@ -2279,10 +2557,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
2279
2557
|
if (prepend) hooks.unshift(wrappedHook);
|
|
2280
2558
|
else hooks.push(wrappedHook);
|
|
2281
2559
|
return wrappedHook;
|
|
2282
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
2283
|
-
const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
|
|
2284
|
-
warn$1(`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`);
|
|
2285
|
-
}
|
|
2560
|
+
} else if (!!(process.env.NODE_ENV !== "production")) warn$1(`${toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""))} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`);
|
|
2286
2561
|
}
|
|
2287
2562
|
const createHook = (lifecycle) => (hook, target = currentInstance) => {
|
|
2288
2563
|
if (!isInSSRComponentSetup || lifecycle === "sp") injectHook(lifecycle, (...args) => hook(...args), target);
|
|
@@ -2299,7 +2574,7 @@ const onRenderTracked = createHook("rtc");
|
|
|
2299
2574
|
function onErrorCaptured(hook, target = currentInstance) {
|
|
2300
2575
|
injectHook("ec", hook, target);
|
|
2301
2576
|
}
|
|
2302
|
-
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
2577
|
+
const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
|
|
2303
2578
|
function renderList(source, renderItem, cache, index) {
|
|
2304
2579
|
let ret;
|
|
2305
2580
|
const cached = cache && cache[index];
|
|
@@ -2319,7 +2594,7 @@ function renderList(source, renderItem, cache, index) {
|
|
|
2319
2594
|
if (!!(process.env.NODE_ENV !== "production") && !Number.isInteger(source)) warn$1(`The v-for range expect an integer value but got ${source}.`);
|
|
2320
2595
|
ret = new Array(source);
|
|
2321
2596
|
for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
2322
|
-
} else if (isObject
|
|
2597
|
+
} else if (isObject(source)) if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
2323
2598
|
else {
|
|
2324
2599
|
const keys = Object.keys(source);
|
|
2325
2600
|
ret = new Array(keys.length);
|
|
@@ -2385,13 +2660,12 @@ const publicPropertiesMap = /* @__PURE__ */ extend(/* @__PURE__ */ Object.create
|
|
|
2385
2660
|
$watch: (i) => __VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP
|
|
2386
2661
|
});
|
|
2387
2662
|
const isReservedPrefix = (key) => key === "_" || key === "$";
|
|
2388
|
-
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn
|
|
2663
|
+
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
|
|
2389
2664
|
const PublicInstanceProxyHandlers = {
|
|
2390
2665
|
get({ _: instance }, key) {
|
|
2391
2666
|
if (key === "__v_skip") return true;
|
|
2392
2667
|
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
2393
2668
|
if (!!(process.env.NODE_ENV !== "production") && key === "__isVue") return true;
|
|
2394
|
-
let normalizedProps;
|
|
2395
2669
|
if (key[0] !== "$") {
|
|
2396
2670
|
const n = accessCache[key];
|
|
2397
2671
|
if (n !== void 0) switch (n) {
|
|
@@ -2403,13 +2677,13 @@ const PublicInstanceProxyHandlers = {
|
|
|
2403
2677
|
else if (hasSetupBinding(setupState, key)) {
|
|
2404
2678
|
accessCache[key] = 1;
|
|
2405
2679
|
return setupState[key];
|
|
2406
|
-
} else if (data !== EMPTY_OBJ && hasOwn
|
|
2680
|
+
} else if (__VUE_OPTIONS_API__ && data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
2407
2681
|
accessCache[key] = 2;
|
|
2408
2682
|
return data[key];
|
|
2409
|
-
} else if (
|
|
2683
|
+
} else if (hasOwn(props, key)) {
|
|
2410
2684
|
accessCache[key] = 3;
|
|
2411
2685
|
return props[key];
|
|
2412
|
-
} else if (ctx !== EMPTY_OBJ && hasOwn
|
|
2686
|
+
} else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
2413
2687
|
accessCache[key] = 4;
|
|
2414
2688
|
return ctx[key];
|
|
2415
2689
|
} else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) accessCache[key] = 0;
|
|
@@ -2423,12 +2697,12 @@ const PublicInstanceProxyHandlers = {
|
|
|
2423
2697
|
} else if (!!(process.env.NODE_ENV !== "production") && key === "$slots") track(instance, "get", key);
|
|
2424
2698
|
return publicGetter(instance);
|
|
2425
2699
|
} else if ((cssModule = type.__cssModules) && (cssModule = cssModule[key])) return cssModule;
|
|
2426
|
-
else if (ctx !== EMPTY_OBJ && hasOwn
|
|
2700
|
+
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
2427
2701
|
accessCache[key] = 4;
|
|
2428
2702
|
return ctx[key];
|
|
2429
|
-
} else if (globalProperties = appContext.config.globalProperties, hasOwn
|
|
2703
|
+
} else if (globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)) return globalProperties[key];
|
|
2430
2704
|
else if (!!(process.env.NODE_ENV !== "production") && currentRenderingInstance && (!isString(key) || key.indexOf("__v") !== 0)) {
|
|
2431
|
-
if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn
|
|
2705
|
+
if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) warn$1(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`);
|
|
2432
2706
|
else if (instance === currentRenderingInstance) warn$1(`Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`);
|
|
2433
2707
|
}
|
|
2434
2708
|
},
|
|
@@ -2437,13 +2711,13 @@ const PublicInstanceProxyHandlers = {
|
|
|
2437
2711
|
if (hasSetupBinding(setupState, key)) {
|
|
2438
2712
|
setupState[key] = value;
|
|
2439
2713
|
return true;
|
|
2440
|
-
} else if (!!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup && hasOwn
|
|
2714
|
+
} else if (!!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup && hasOwn(setupState, key)) {
|
|
2441
2715
|
warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
2442
2716
|
return false;
|
|
2443
|
-
} else if (data !== EMPTY_OBJ && hasOwn
|
|
2717
|
+
} else if (__VUE_OPTIONS_API__ && data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
2444
2718
|
data[key] = value;
|
|
2445
2719
|
return true;
|
|
2446
|
-
} else if (hasOwn
|
|
2720
|
+
} else if (hasOwn(instance.props, key)) {
|
|
2447
2721
|
process.env.NODE_ENV !== "production" && warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
|
|
2448
2722
|
return false;
|
|
2449
2723
|
}
|
|
@@ -2458,13 +2732,13 @@ const PublicInstanceProxyHandlers = {
|
|
|
2458
2732
|
else ctx[key] = value;
|
|
2459
2733
|
return true;
|
|
2460
2734
|
},
|
|
2461
|
-
has({ _: { data, setupState, accessCache, ctx, appContext,
|
|
2462
|
-
let
|
|
2463
|
-
return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn
|
|
2735
|
+
has({ _: { data, setupState, accessCache, ctx, appContext, props, type } }, key) {
|
|
2736
|
+
let cssModules;
|
|
2737
|
+
return !!(accessCache[key] || __VUE_OPTIONS_API__ && data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || hasOwn(props, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
|
|
2464
2738
|
},
|
|
2465
2739
|
defineProperty(target, key, descriptor) {
|
|
2466
2740
|
if (descriptor.get != null) target._.accessCache[key] = 0;
|
|
2467
|
-
else if (hasOwn
|
|
2741
|
+
else if (hasOwn(descriptor, "value")) this.set(target, key, descriptor.value, null);
|
|
2468
2742
|
return Reflect.defineProperty(target, key, descriptor);
|
|
2469
2743
|
}
|
|
2470
2744
|
};
|
|
@@ -2518,12 +2792,7 @@ function exposeSetupStateOnRenderContext(instance) {
|
|
|
2518
2792
|
});
|
|
2519
2793
|
}
|
|
2520
2794
|
function normalizePropsOrEmits(props) {
|
|
2521
|
-
return isArray(props) ? props.reduce((normalized, p
|
|
2522
|
-
}
|
|
2523
|
-
function mergeModels(a, b) {
|
|
2524
|
-
if (!a || !b) return a || b;
|
|
2525
|
-
if (isArray(a) && isArray(b)) return a.concat(b);
|
|
2526
|
-
return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
|
|
2795
|
+
return isArray(props) ? props.reduce((normalized, p) => (normalized[p] = null, normalized), {}) : props;
|
|
2527
2796
|
}
|
|
2528
2797
|
function createDuplicateChecker() {
|
|
2529
2798
|
const cache = /* @__PURE__ */ Object.create(null);
|
|
@@ -2539,7 +2808,7 @@ function applyOptions(instance) {
|
|
|
2539
2808
|
const ctx = instance.ctx;
|
|
2540
2809
|
shouldCacheAccess = false;
|
|
2541
2810
|
if (options.beforeCreate) callHook(options.beforeCreate, instance, "bc");
|
|
2542
|
-
const { data: dataOptions, computed: computedOptions, methods, watch: watchOptions, provide: provideOptions, inject: injectOptions, created, beforeMount, mounted, beforeUpdate, updated, activated, deactivated, beforeDestroy, beforeUnmount, destroyed, unmounted, render
|
|
2811
|
+
const { data: dataOptions, computed: computedOptions, methods, watch: watchOptions, provide: provideOptions, inject: injectOptions, created, beforeMount, mounted, beforeUpdate, updated, activated, deactivated, beforeDestroy, beforeUnmount, destroyed, unmounted, render, renderTracked, renderTriggered, errorCaptured, serverPrefetch, expose, inheritAttrs, components, directives, filters } = options;
|
|
2543
2812
|
const checkDuplicateProperties = !!(process.env.NODE_ENV !== "production") ? createDuplicateChecker() : null;
|
|
2544
2813
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2545
2814
|
const [propsOptions] = instance.propsOptions;
|
|
@@ -2563,7 +2832,7 @@ function applyOptions(instance) {
|
|
|
2563
2832
|
if (!!(process.env.NODE_ENV !== "production") && !isFunction(dataOptions)) warn$1(`The data option must be a function. Plain object usage is no longer supported.`);
|
|
2564
2833
|
const data = dataOptions.call(publicThis, publicThis);
|
|
2565
2834
|
if (!!(process.env.NODE_ENV !== "production") && isPromise(data)) warn$1(`data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`);
|
|
2566
|
-
if (!isObject
|
|
2835
|
+
if (!isObject(data)) process.env.NODE_ENV !== "production" && warn$1(`data() should return an object.`);
|
|
2567
2836
|
else {
|
|
2568
2837
|
instance.data = reactive(data);
|
|
2569
2838
|
if (!!(process.env.NODE_ENV !== "production")) for (const key in data) {
|
|
@@ -2582,12 +2851,11 @@ function applyOptions(instance) {
|
|
|
2582
2851
|
const opt = computedOptions[key];
|
|
2583
2852
|
const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
|
|
2584
2853
|
if (!!(process.env.NODE_ENV !== "production") && get === NOOP) warn$1(`Computed property "${key}" has no getter.`);
|
|
2585
|
-
const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : !!(process.env.NODE_ENV !== "production") ? () => {
|
|
2586
|
-
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
2587
|
-
} : NOOP;
|
|
2588
2854
|
const c = computed({
|
|
2589
2855
|
get,
|
|
2590
|
-
set
|
|
2856
|
+
set: !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : !!(process.env.NODE_ENV !== "production") ? () => {
|
|
2857
|
+
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
2858
|
+
} : NOOP
|
|
2591
2859
|
});
|
|
2592
2860
|
Object.defineProperty(ctx, key, {
|
|
2593
2861
|
enumerable: true,
|
|
@@ -2633,7 +2901,7 @@ function applyOptions(instance) {
|
|
|
2633
2901
|
});
|
|
2634
2902
|
} else if (!instance.exposed) instance.exposed = {};
|
|
2635
2903
|
}
|
|
2636
|
-
if (render
|
|
2904
|
+
if (render && instance.render === NOOP) instance.render = render;
|
|
2637
2905
|
if (inheritAttrs != null) instance.inheritAttrs = inheritAttrs;
|
|
2638
2906
|
if (components) instance.components = components;
|
|
2639
2907
|
if (directives) instance.directives = directives;
|
|
@@ -2644,7 +2912,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP)
|
|
|
2644
2912
|
for (const key in injectOptions) {
|
|
2645
2913
|
const opt = injectOptions[key];
|
|
2646
2914
|
let injected;
|
|
2647
|
-
if (isObject
|
|
2915
|
+
if (isObject(opt)) if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
|
|
2648
2916
|
else injected = inject(opt.from || key);
|
|
2649
2917
|
else injected = inject(opt);
|
|
2650
2918
|
if (isRef(injected)) Object.defineProperty(ctx, key, {
|
|
@@ -2658,7 +2926,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP)
|
|
|
2658
2926
|
}
|
|
2659
2927
|
}
|
|
2660
2928
|
function callHook(hook, instance, type) {
|
|
2661
|
-
callWithAsyncErrorHandling(isArray(hook) ? hook.map((h
|
|
2929
|
+
callWithAsyncErrorHandling(isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy), instance, type);
|
|
2662
2930
|
}
|
|
2663
2931
|
function createWatcher(raw, ctx, publicThis, key) {
|
|
2664
2932
|
let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
|
|
@@ -2667,7 +2935,7 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
2667
2935
|
if (isFunction(handler)) watch(getter, handler);
|
|
2668
2936
|
else if (!!(process.env.NODE_ENV !== "production")) warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
2669
2937
|
} else if (isFunction(raw)) watch(getter, raw.bind(publicThis));
|
|
2670
|
-
else if (isObject
|
|
2938
|
+
else if (isObject(raw)) if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
2671
2939
|
else {
|
|
2672
2940
|
const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
2673
2941
|
if (isFunction(handler)) watch(getter, handler, raw);
|
|
@@ -2688,7 +2956,7 @@ function resolveMergedOptions(instance) {
|
|
|
2688
2956
|
if (globalMixins.length) globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true));
|
|
2689
2957
|
mergeOptions(resolved, base, optionMergeStrategies);
|
|
2690
2958
|
}
|
|
2691
|
-
if (isObject
|
|
2959
|
+
if (isObject(base)) cache.set(base, resolved);
|
|
2692
2960
|
return resolved;
|
|
2693
2961
|
}
|
|
2694
2962
|
function mergeOptions(to, from, strats, asMixin = false) {
|
|
@@ -2787,10 +3055,10 @@ function createAppContext() {
|
|
|
2787
3055
|
};
|
|
2788
3056
|
}
|
|
2789
3057
|
let uid$1 = 0;
|
|
2790
|
-
function createAppAPI(render
|
|
2791
|
-
return function createApp
|
|
3058
|
+
function createAppAPI(render, hydrate) {
|
|
3059
|
+
return function createApp(rootComponent, rootProps = null) {
|
|
2792
3060
|
if (!isFunction(rootComponent)) rootComponent = extend({}, rootComponent);
|
|
2793
|
-
if (rootProps != null && !isObject
|
|
3061
|
+
if (rootProps != null && !isObject(rootProps)) {
|
|
2794
3062
|
process.env.NODE_ENV !== "production" && warn$1(`root props passed to app.mount() must be an object.`);
|
|
2795
3063
|
rootProps = null;
|
|
2796
3064
|
}
|
|
@@ -2855,10 +3123,10 @@ function createAppAPI(render$1, hydrate) {
|
|
|
2855
3123
|
if (!!(process.env.NODE_ENV !== "production")) context.reload = () => {
|
|
2856
3124
|
const cloned = cloneVNode(vnode);
|
|
2857
3125
|
cloned.el = null;
|
|
2858
|
-
render
|
|
3126
|
+
render(cloned, rootContainer, namespace);
|
|
2859
3127
|
};
|
|
2860
3128
|
if (isHydrate && hydrate) hydrate(vnode, rootContainer);
|
|
2861
|
-
else render
|
|
3129
|
+
else render(vnode, rootContainer, namespace);
|
|
2862
3130
|
isMounted = true;
|
|
2863
3131
|
app._container = rootContainer;
|
|
2864
3132
|
rootContainer.__vue_app__ = app;
|
|
@@ -2877,7 +3145,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
2877
3145
|
unmount() {
|
|
2878
3146
|
if (isMounted) {
|
|
2879
3147
|
callWithAsyncErrorHandling(pluginCleanupFns, app._instance, 16);
|
|
2880
|
-
render
|
|
3148
|
+
render(null, app._container);
|
|
2881
3149
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
2882
3150
|
app._instance = null;
|
|
2883
3151
|
devtoolsUnmountApp(app);
|
|
@@ -2886,7 +3154,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
2886
3154
|
} else if (!!(process.env.NODE_ENV !== "production")) warn$1(`Cannot unmount an app that is not mounted.`);
|
|
2887
3155
|
},
|
|
2888
3156
|
provide(key, value) {
|
|
2889
|
-
if (!!(process.env.NODE_ENV !== "production") && key in context.provides) if (hasOwn
|
|
3157
|
+
if (!!(process.env.NODE_ENV !== "production") && key in context.provides) if (hasOwn(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
|
|
2890
3158
|
else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
|
|
2891
3159
|
context.provides[key] = value;
|
|
2892
3160
|
return app;
|
|
@@ -2905,38 +3173,263 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
2905
3173
|
};
|
|
2906
3174
|
}
|
|
2907
3175
|
let currentApp = null;
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
3176
|
+
const getModelModifiers = (props, modelName) => {
|
|
3177
|
+
return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
|
|
3178
|
+
};
|
|
3179
|
+
function emit(instance, event, ...rawArgs) {
|
|
3180
|
+
if (instance.isUnmounted) return;
|
|
3181
|
+
const props = instance.vnode.props || EMPTY_OBJ;
|
|
3182
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3183
|
+
const { emitsOptions, propsOptions: [propsOptions] } = instance;
|
|
3184
|
+
if (emitsOptions) if (!(event in emitsOptions) && true) {
|
|
3185
|
+
if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) warn$1(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`);
|
|
3186
|
+
} else {
|
|
3187
|
+
const validator = emitsOptions[event];
|
|
3188
|
+
if (isFunction(validator)) {
|
|
3189
|
+
if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
3190
|
+
}
|
|
3191
|
+
}
|
|
3192
|
+
}
|
|
3193
|
+
let args = rawArgs;
|
|
3194
|
+
const isModelListener = event.startsWith("update:");
|
|
3195
|
+
const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
|
|
3196
|
+
if (modifiers) {
|
|
3197
|
+
if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
|
|
3198
|
+
if (modifiers.number) args = rawArgs.map(looseToNumber);
|
|
3199
|
+
}
|
|
3200
|
+
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) devtoolsComponentEmit(instance, event, args);
|
|
3201
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3202
|
+
const lowerCaseEvent = event.toLowerCase();
|
|
3203
|
+
if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) warn$1(`Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(instance, instance.type)} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(event)}" instead of "${event}".`);
|
|
3204
|
+
}
|
|
3205
|
+
let handlerName;
|
|
3206
|
+
let handler = props[handlerName = toHandlerKey(event)] || props[handlerName = toHandlerKey(camelize(event))];
|
|
3207
|
+
if (!handler && isModelListener) handler = props[handlerName = toHandlerKey(hyphenate(event))];
|
|
3208
|
+
if (handler) callWithAsyncErrorHandling(handler, instance, 6, args);
|
|
3209
|
+
const onceHandler = props[handlerName + `Once`];
|
|
3210
|
+
if (onceHandler) {
|
|
3211
|
+
if (!instance.emitted) instance.emitted = {};
|
|
3212
|
+
else if (instance.emitted[handlerName]) return;
|
|
3213
|
+
instance.emitted[handlerName] = true;
|
|
3214
|
+
callWithAsyncErrorHandling(onceHandler, instance, 6, args);
|
|
2916
3215
|
}
|
|
2917
3216
|
}
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
3217
|
+
const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
|
|
3218
|
+
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
3219
|
+
const cache = __VUE_OPTIONS_API__ && asMixin ? mixinEmitsCache : appContext.emitsCache;
|
|
3220
|
+
const cached = cache.get(comp);
|
|
3221
|
+
if (cached !== void 0) return cached;
|
|
3222
|
+
const raw = comp.emits;
|
|
3223
|
+
let normalized = {};
|
|
3224
|
+
let hasExtends = false;
|
|
3225
|
+
if (__VUE_OPTIONS_API__ && !isFunction(comp)) {
|
|
3226
|
+
const extendEmits = (raw2) => {
|
|
3227
|
+
const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
|
|
3228
|
+
if (normalizedFromExtend) {
|
|
3229
|
+
hasExtends = true;
|
|
3230
|
+
extend(normalized, normalizedFromExtend);
|
|
3231
|
+
}
|
|
3232
|
+
};
|
|
3233
|
+
if (!asMixin && appContext.mixins.length) appContext.mixins.forEach(extendEmits);
|
|
3234
|
+
if (comp.extends) extendEmits(comp.extends);
|
|
3235
|
+
if (comp.mixins) comp.mixins.forEach(extendEmits);
|
|
3236
|
+
}
|
|
3237
|
+
if (!raw && !hasExtends) {
|
|
3238
|
+
if (isObject(comp)) cache.set(comp, null);
|
|
3239
|
+
return null;
|
|
3240
|
+
}
|
|
3241
|
+
if (isArray(raw)) raw.forEach((key) => normalized[key] = null);
|
|
3242
|
+
else extend(normalized, raw);
|
|
3243
|
+
if (isObject(comp)) cache.set(comp, normalized);
|
|
3244
|
+
return normalized;
|
|
2926
3245
|
}
|
|
2927
|
-
function
|
|
2928
|
-
|
|
3246
|
+
function isEmitListener(options, key) {
|
|
3247
|
+
if (!options || !isOn(key)) return false;
|
|
3248
|
+
key = key.slice(2).replace(/Once$/, "");
|
|
3249
|
+
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
|
|
2929
3250
|
}
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
const attrs =
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
if (!!(process.env.NODE_ENV !== "production"))
|
|
3251
|
+
let accessedAttrs = false;
|
|
3252
|
+
function markAttrsAccessed() {
|
|
3253
|
+
accessedAttrs = true;
|
|
3254
|
+
}
|
|
3255
|
+
function renderComponentRoot(instance) {
|
|
3256
|
+
const { type: Component, vnode, proxy, withProxy, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, props, data, setupState, ctx, inheritAttrs } = instance;
|
|
3257
|
+
const prev = setCurrentRenderingInstance(instance);
|
|
3258
|
+
let result;
|
|
3259
|
+
let fallthroughAttrs;
|
|
3260
|
+
if (!!(process.env.NODE_ENV !== "production")) accessedAttrs = false;
|
|
3261
|
+
try {
|
|
3262
|
+
if (vnode.shapeFlag & 4) {
|
|
3263
|
+
const proxyToUse = withProxy || proxy;
|
|
3264
|
+
const thisProxy = !!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup ? new Proxy(proxyToUse, { get(target, key, receiver) {
|
|
3265
|
+
warn$1(`Property '${String(key)}' was accessed via 'this'. Avoid using 'this' in templates.`);
|
|
3266
|
+
return Reflect.get(target, key, receiver);
|
|
3267
|
+
} }) : proxyToUse;
|
|
3268
|
+
result = normalizeVNode(render.call(thisProxy, proxyToUse, renderCache, !!(process.env.NODE_ENV !== "production") ? shallowReadonly(props) : props, setupState, data, ctx));
|
|
3269
|
+
fallthroughAttrs = attrs;
|
|
3270
|
+
} else {
|
|
3271
|
+
const render2 = Component;
|
|
3272
|
+
if (!!(process.env.NODE_ENV !== "production") && attrs === props) markAttrsAccessed();
|
|
3273
|
+
result = normalizeVNode(render2.length > 1 ? render2(!!(process.env.NODE_ENV !== "production") ? shallowReadonly(props) : props, !!(process.env.NODE_ENV !== "production") ? {
|
|
3274
|
+
get attrs() {
|
|
3275
|
+
markAttrsAccessed();
|
|
3276
|
+
return shallowReadonly(attrs);
|
|
3277
|
+
},
|
|
3278
|
+
slots,
|
|
3279
|
+
emit
|
|
3280
|
+
} : {
|
|
3281
|
+
attrs,
|
|
3282
|
+
slots,
|
|
3283
|
+
emit
|
|
3284
|
+
}) : render2(!!(process.env.NODE_ENV !== "production") ? shallowReadonly(props) : props, null));
|
|
3285
|
+
fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
|
|
3286
|
+
}
|
|
3287
|
+
} catch (err) {
|
|
3288
|
+
blockStack.length = 0;
|
|
3289
|
+
handleError(err, instance, 1);
|
|
3290
|
+
result = createVNode(Comment);
|
|
3291
|
+
}
|
|
3292
|
+
let root = result;
|
|
3293
|
+
let setRoot = void 0;
|
|
3294
|
+
if (!!(process.env.NODE_ENV !== "production") && result.patchFlag > 0 && result.patchFlag & 2048) [root, setRoot] = getChildRoot(result);
|
|
3295
|
+
if (fallthroughAttrs && inheritAttrs !== false) {
|
|
3296
|
+
const keys = Object.keys(fallthroughAttrs);
|
|
3297
|
+
const { shapeFlag } = root;
|
|
3298
|
+
if (keys.length) {
|
|
3299
|
+
if (shapeFlag & 7) {
|
|
3300
|
+
if (propsOptions && keys.some(isModelListener)) fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
|
|
3301
|
+
root = cloneVNode(root, fallthroughAttrs, false, true);
|
|
3302
|
+
} else if (!!(process.env.NODE_ENV !== "production") && !accessedAttrs && root.type !== Comment) {
|
|
3303
|
+
const allAttrs = Object.keys(attrs);
|
|
3304
|
+
const eventAttrs = [];
|
|
3305
|
+
const extraAttrs = [];
|
|
3306
|
+
for (let i = 0, l = allAttrs.length; i < l; i++) {
|
|
3307
|
+
const key = allAttrs[i];
|
|
3308
|
+
if (isOn(key)) {
|
|
3309
|
+
if (!isModelListener(key)) eventAttrs.push(key[2].toLowerCase() + key.slice(3));
|
|
3310
|
+
} else extraAttrs.push(key);
|
|
3311
|
+
}
|
|
3312
|
+
if (extraAttrs.length) warn$1(`Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`);
|
|
3313
|
+
if (eventAttrs.length) warn$1(`Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`);
|
|
3314
|
+
}
|
|
3315
|
+
}
|
|
3316
|
+
}
|
|
3317
|
+
if (vnode.dirs) {
|
|
3318
|
+
if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) warn$1(`Runtime directive used on component with non-element root node. The directives will not function as intended.`);
|
|
3319
|
+
root = cloneVNode(root, null, false, true);
|
|
3320
|
+
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
3321
|
+
}
|
|
3322
|
+
if (vnode.transition) {
|
|
3323
|
+
if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) warn$1(`Component inside <Transition> renders non-element root node that cannot be animated.`);
|
|
3324
|
+
setTransitionHooks(root, vnode.transition);
|
|
3325
|
+
}
|
|
3326
|
+
if (!!(process.env.NODE_ENV !== "production") && setRoot) setRoot(root);
|
|
3327
|
+
else result = root;
|
|
3328
|
+
setCurrentRenderingInstance(prev);
|
|
3329
|
+
return result;
|
|
3330
|
+
}
|
|
3331
|
+
const getChildRoot = (vnode) => {
|
|
3332
|
+
const rawChildren = vnode.children;
|
|
3333
|
+
const dynamicChildren = vnode.dynamicChildren;
|
|
3334
|
+
const childRoot = filterSingleRoot(rawChildren, false);
|
|
3335
|
+
if (!childRoot) return [vnode, void 0];
|
|
3336
|
+
else if (!!(process.env.NODE_ENV !== "production") && childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) return getChildRoot(childRoot);
|
|
3337
|
+
const index = rawChildren.indexOf(childRoot);
|
|
3338
|
+
const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
|
|
3339
|
+
const setRoot = (updatedRoot) => {
|
|
3340
|
+
rawChildren[index] = updatedRoot;
|
|
3341
|
+
if (dynamicChildren) {
|
|
3342
|
+
if (dynamicIndex > -1) dynamicChildren[dynamicIndex] = updatedRoot;
|
|
3343
|
+
else if (updatedRoot.patchFlag > 0) vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
|
|
3344
|
+
}
|
|
3345
|
+
};
|
|
3346
|
+
return [normalizeVNode(childRoot), setRoot];
|
|
3347
|
+
};
|
|
3348
|
+
function filterSingleRoot(children, recurse = true) {
|
|
3349
|
+
let singleRoot;
|
|
3350
|
+
for (let i = 0; i < children.length; i++) {
|
|
3351
|
+
const child = children[i];
|
|
3352
|
+
if (isVNode(child)) {
|
|
3353
|
+
if (child.type !== Comment || child.children === "v-if") if (singleRoot) return;
|
|
3354
|
+
else {
|
|
3355
|
+
singleRoot = child;
|
|
3356
|
+
if (!!(process.env.NODE_ENV !== "production") && recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
|
|
3357
|
+
}
|
|
3358
|
+
} else return;
|
|
3359
|
+
}
|
|
3360
|
+
return singleRoot;
|
|
3361
|
+
}
|
|
3362
|
+
const getFunctionalFallthrough = (attrs) => {
|
|
3363
|
+
let res;
|
|
3364
|
+
for (const key in attrs) if (key === "class" || key === "style" || isOn(key)) (res || (res = {}))[key] = attrs[key];
|
|
3365
|
+
return res;
|
|
3366
|
+
};
|
|
3367
|
+
const filterModelListeners = (attrs, props) => {
|
|
3368
|
+
const res = {};
|
|
3369
|
+
for (const key in attrs) if (!isModelListener(key) || !(key.slice(9) in props)) res[key] = attrs[key];
|
|
3370
|
+
return res;
|
|
3371
|
+
};
|
|
3372
|
+
const isElementRoot = (vnode) => {
|
|
3373
|
+
return vnode.shapeFlag & 7 || vnode.type === Comment;
|
|
3374
|
+
};
|
|
3375
|
+
function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
|
|
3376
|
+
const { props: prevProps, children: prevChildren, component } = prevVNode;
|
|
3377
|
+
const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
|
|
3378
|
+
const emits = component.emitsOptions;
|
|
3379
|
+
if (!!(process.env.NODE_ENV !== "production") && (prevChildren || nextChildren) && isHmrUpdating) return true;
|
|
3380
|
+
if (nextVNode.dirs || nextVNode.transition) return true;
|
|
3381
|
+
if (optimized && patchFlag >= 0) {
|
|
3382
|
+
if (patchFlag & 1024) return true;
|
|
3383
|
+
if (patchFlag & 16) {
|
|
3384
|
+
if (!prevProps) return !!nextProps;
|
|
3385
|
+
return hasPropsChanged(prevProps, nextProps, emits);
|
|
3386
|
+
} else if (patchFlag & 8) {
|
|
3387
|
+
const dynamicProps = nextVNode.dynamicProps;
|
|
3388
|
+
for (let i = 0; i < dynamicProps.length; i++) {
|
|
3389
|
+
const key = dynamicProps[i];
|
|
3390
|
+
if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) return true;
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3393
|
+
} else {
|
|
3394
|
+
if (prevChildren || nextChildren) {
|
|
3395
|
+
if (!nextChildren || !nextChildren.$stable) return true;
|
|
3396
|
+
}
|
|
3397
|
+
if (prevProps === nextProps) return false;
|
|
3398
|
+
if (!prevProps) return !!nextProps;
|
|
3399
|
+
if (!nextProps) return true;
|
|
3400
|
+
return hasPropsChanged(prevProps, nextProps, emits);
|
|
3401
|
+
}
|
|
3402
|
+
return false;
|
|
3403
|
+
}
|
|
3404
|
+
function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
3405
|
+
const nextKeys = Object.keys(nextProps);
|
|
3406
|
+
if (nextKeys.length !== Object.keys(prevProps).length) return true;
|
|
3407
|
+
for (let i = 0; i < nextKeys.length; i++) {
|
|
3408
|
+
const key = nextKeys[i];
|
|
3409
|
+
if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) return true;
|
|
3410
|
+
}
|
|
3411
|
+
return false;
|
|
3412
|
+
}
|
|
3413
|
+
function updateHOCHostEl({ vnode, parent }, el) {
|
|
3414
|
+
while (parent) {
|
|
3415
|
+
const root = parent.subTree;
|
|
3416
|
+
if (root.suspense && root.suspense.activeBranch === vnode) root.el = vnode.el;
|
|
3417
|
+
if (root === vnode) {
|
|
3418
|
+
(vnode = parent.vnode).el = el;
|
|
3419
|
+
parent = parent.parent;
|
|
3420
|
+
} else break;
|
|
3421
|
+
}
|
|
3422
|
+
}
|
|
3423
|
+
const internalObjectProto = {};
|
|
3424
|
+
const createInternalObject = () => Object.create(internalObjectProto);
|
|
3425
|
+
const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
|
|
3426
|
+
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
3427
|
+
const props = {};
|
|
3428
|
+
const attrs = createInternalObject();
|
|
3429
|
+
instance.propsDefaults = /* @__PURE__ */ Object.create(null);
|
|
3430
|
+
setFullProps(instance, rawProps, props, attrs);
|
|
3431
|
+
for (const key in instance.propsOptions[0]) if (!(key in props)) props[key] = void 0;
|
|
3432
|
+
if (!!(process.env.NODE_ENV !== "production")) validateProps(rawProps || {}, props, instance);
|
|
2940
3433
|
if (isStateful) instance.props = isSSR ? props : shallowReactive(props);
|
|
2941
3434
|
else if (!instance.type.props) instance.props = attrs;
|
|
2942
3435
|
else instance.props = props;
|
|
@@ -2960,13 +3453,13 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
2960
3453
|
let key = propsToUpdate[i];
|
|
2961
3454
|
if (isEmitListener(instance.emitsOptions, key)) continue;
|
|
2962
3455
|
const value = rawProps[key];
|
|
2963
|
-
if (options) if (hasOwn
|
|
3456
|
+
if (options) if (hasOwn(attrs, key)) {
|
|
2964
3457
|
if (value !== attrs[key]) {
|
|
2965
3458
|
attrs[key] = value;
|
|
2966
3459
|
hasAttrsChanged = true;
|
|
2967
3460
|
}
|
|
2968
3461
|
} else {
|
|
2969
|
-
const camelizedKey = camelize
|
|
3462
|
+
const camelizedKey = camelize(key);
|
|
2970
3463
|
props[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance, false);
|
|
2971
3464
|
}
|
|
2972
3465
|
else if (value !== attrs[key]) {
|
|
@@ -2978,11 +3471,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
2978
3471
|
} else {
|
|
2979
3472
|
if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
|
|
2980
3473
|
let kebabKey;
|
|
2981
|
-
for (const key in rawCurrentProps) if (!rawProps || !hasOwn
|
|
3474
|
+
for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) if (options) {
|
|
2982
3475
|
if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, rawCurrentProps, key, void 0, instance, true);
|
|
2983
3476
|
} else delete props[key];
|
|
2984
3477
|
if (attrs !== rawCurrentProps) {
|
|
2985
|
-
for (const key in attrs) if (!rawProps || !hasOwn
|
|
3478
|
+
for (const key in attrs) if (!rawProps || !hasOwn(rawProps, key) && true) {
|
|
2986
3479
|
delete attrs[key];
|
|
2987
3480
|
hasAttrsChanged = true;
|
|
2988
3481
|
}
|
|
@@ -2999,7 +3492,7 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
2999
3492
|
if (isReservedProp(key)) continue;
|
|
3000
3493
|
const value = rawProps[key];
|
|
3001
3494
|
let camelKey;
|
|
3002
|
-
if (options && hasOwn
|
|
3495
|
+
if (options && hasOwn(options, camelKey = camelize(key))) if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
|
|
3003
3496
|
else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
3004
3497
|
else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
3005
3498
|
if (!(key in attrs) || value !== attrs[key]) {
|
|
@@ -3013,7 +3506,7 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
3013
3506
|
const castValues = rawCastValues || EMPTY_OBJ;
|
|
3014
3507
|
for (let i = 0; i < needCastKeys.length; i++) {
|
|
3015
3508
|
const key = needCastKeys[i];
|
|
3016
|
-
props[key] = resolvePropValue(options, rawCurrentProps, key, castValues[key], instance, !hasOwn
|
|
3509
|
+
props[key] = resolvePropValue(options, rawCurrentProps, key, castValues[key], instance, !hasOwn(castValues, key));
|
|
3017
3510
|
}
|
|
3018
3511
|
}
|
|
3019
3512
|
return hasAttrsChanged;
|
|
@@ -3021,7 +3514,7 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
3021
3514
|
function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
3022
3515
|
const opt = options[key];
|
|
3023
3516
|
if (opt != null) {
|
|
3024
|
-
const hasDefault = hasOwn
|
|
3517
|
+
const hasDefault = hasOwn(opt, "default");
|
|
3025
3518
|
if (hasDefault && value === void 0) {
|
|
3026
3519
|
const defaultValue = opt.default;
|
|
3027
3520
|
if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
|
|
@@ -3037,7 +3530,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
3037
3530
|
}
|
|
3038
3531
|
if (opt[0]) {
|
|
3039
3532
|
if (isAbsent && !hasDefault) value = false;
|
|
3040
|
-
else if (opt[1] && (value === "" || value === hyphenate
|
|
3533
|
+
else if (opt[1] && (value === "" || value === hyphenate(key))) value = true;
|
|
3041
3534
|
}
|
|
3042
3535
|
}
|
|
3043
3536
|
return value;
|
|
@@ -3063,18 +3556,18 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
3063
3556
|
if (comp.mixins) comp.mixins.forEach(extendProps);
|
|
3064
3557
|
}
|
|
3065
3558
|
if (!raw && !hasExtends) {
|
|
3066
|
-
if (isObject
|
|
3559
|
+
if (isObject(comp)) cache.set(comp, EMPTY_ARR);
|
|
3067
3560
|
return EMPTY_ARR;
|
|
3068
3561
|
}
|
|
3069
3562
|
if (isArray(raw)) for (let i = 0; i < raw.length; i++) {
|
|
3070
3563
|
if (!!(process.env.NODE_ENV !== "production") && !isString(raw[i])) warn$1(`props must be strings when using array syntax.`, raw[i]);
|
|
3071
|
-
const normalizedKey = camelize
|
|
3564
|
+
const normalizedKey = camelize(raw[i]);
|
|
3072
3565
|
if (validatePropName(normalizedKey)) normalized[normalizedKey] = EMPTY_OBJ;
|
|
3073
3566
|
}
|
|
3074
3567
|
else if (raw) {
|
|
3075
|
-
if (!!(process.env.NODE_ENV !== "production") && !isObject
|
|
3568
|
+
if (!!(process.env.NODE_ENV !== "production") && !isObject(raw)) warn$1(`invalid props options`, raw);
|
|
3076
3569
|
for (const key in raw) {
|
|
3077
|
-
const normalizedKey = camelize
|
|
3570
|
+
const normalizedKey = camelize(key);
|
|
3078
3571
|
if (validatePropName(normalizedKey)) {
|
|
3079
3572
|
const opt = raw[key];
|
|
3080
3573
|
const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
|
|
@@ -3092,12 +3585,12 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
3092
3585
|
else shouldCast = isFunction(propType) && propType.name === "Boolean";
|
|
3093
3586
|
prop[0] = shouldCast;
|
|
3094
3587
|
prop[1] = shouldCastTrue;
|
|
3095
|
-
if (shouldCast || hasOwn
|
|
3588
|
+
if (shouldCast || hasOwn(prop, "default")) needCastKeys.push(normalizedKey);
|
|
3096
3589
|
}
|
|
3097
3590
|
}
|
|
3098
3591
|
}
|
|
3099
3592
|
const res = [normalized, needCastKeys];
|
|
3100
|
-
if (isObject
|
|
3593
|
+
if (isObject(comp)) cache.set(comp, res);
|
|
3101
3594
|
return res;
|
|
3102
3595
|
}
|
|
3103
3596
|
function validatePropName(key) {
|
|
@@ -3114,7 +3607,7 @@ function getType(ctor) {
|
|
|
3114
3607
|
function validateProps(rawProps, props, instance) {
|
|
3115
3608
|
const resolvedValues = toRaw(props);
|
|
3116
3609
|
const options = instance.propsOptions[0];
|
|
3117
|
-
const camelizePropsKey = Object.keys(rawProps).map((key) => camelize
|
|
3610
|
+
const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
|
|
3118
3611
|
for (const key in options) {
|
|
3119
3612
|
let opt = options[key];
|
|
3120
3613
|
if (opt == null) continue;
|
|
@@ -3153,7 +3646,7 @@ function assertType(value, type) {
|
|
|
3153
3646
|
const t = typeof value;
|
|
3154
3647
|
valid = t === expectedType.toLowerCase();
|
|
3155
3648
|
if (!valid && t === "object") valid = value instanceof type;
|
|
3156
|
-
} else if (expectedType === "Object") valid = isObject
|
|
3649
|
+
} else if (expectedType === "Object") valid = isObject(value);
|
|
3157
3650
|
else if (expectedType === "Array") valid = isArray(value);
|
|
3158
3651
|
else valid = value instanceof type;
|
|
3159
3652
|
return {
|
|
@@ -3323,7 +3816,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3323
3816
|
optimized = false;
|
|
3324
3817
|
n2.dynamicChildren = null;
|
|
3325
3818
|
}
|
|
3326
|
-
const { type, ref
|
|
3819
|
+
const { type, ref, shapeFlag } = n2;
|
|
3327
3820
|
switch (type) {
|
|
3328
3821
|
case Text:
|
|
3329
3822
|
processText(n1, n2, container, anchor);
|
|
@@ -3344,14 +3837,20 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3344
3837
|
else if (shapeFlag & 128) type.process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals);
|
|
3345
3838
|
else if (!!(process.env.NODE_ENV !== "production")) warn$1("Invalid VNode type:", type, `(${typeof type})`);
|
|
3346
3839
|
}
|
|
3347
|
-
if (ref
|
|
3348
|
-
else if (ref
|
|
3840
|
+
if (ref != null && parentComponent) setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
|
|
3841
|
+
else if (ref == null && n1 && n1.ref != null) setRef(n1.ref, null, parentSuspense, n1, true);
|
|
3349
3842
|
};
|
|
3350
3843
|
const processText = (n1, n2, container, anchor) => {
|
|
3351
3844
|
if (n1 == null) hostInsert(n2.el = hostCreateText(n2.children), container, anchor);
|
|
3352
3845
|
else {
|
|
3353
3846
|
const el = n2.el = n1.el;
|
|
3354
|
-
if (n2.children !== n1.children)
|
|
3847
|
+
if (n2.children !== n1.children) if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating && n2.patchFlag === -1 && "__elIndex" in n1) {
|
|
3848
|
+
const childNodes = container.childNodes;
|
|
3849
|
+
const newChild = hostCreateText(n2.children);
|
|
3850
|
+
const oldChild = childNodes[n2.__elIndex = n1.__elIndex];
|
|
3851
|
+
hostInsert(newChild, container, oldChild);
|
|
3852
|
+
hostRemove(oldChild);
|
|
3853
|
+
} else hostSetText(el, n2.children);
|
|
3355
3854
|
}
|
|
3356
3855
|
};
|
|
3357
3856
|
const processCommentNode = (n1, n2, container, anchor) => {
|
|
@@ -3393,7 +3892,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3393
3892
|
if (n2.type === "svg") namespace = "svg";
|
|
3394
3893
|
else if (n2.type === "math") namespace = "mathml";
|
|
3395
3894
|
if (n1 == null) mountElement(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3396
|
-
else
|
|
3895
|
+
else {
|
|
3896
|
+
const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
|
|
3897
|
+
try {
|
|
3898
|
+
if (customElement) customElement._beginPatch();
|
|
3899
|
+
patchElement(n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3900
|
+
} finally {
|
|
3901
|
+
if (customElement) customElement._endPatch();
|
|
3902
|
+
}
|
|
3903
|
+
}
|
|
3397
3904
|
};
|
|
3398
3905
|
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
3399
3906
|
let el;
|
|
@@ -3436,10 +3943,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3436
3943
|
}
|
|
3437
3944
|
};
|
|
3438
3945
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
3439
|
-
for (let i = start; i < children.length; i++)
|
|
3440
|
-
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
|
|
3441
|
-
patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3442
|
-
}
|
|
3946
|
+
for (let i = start; i < children.length; i++) patch(null, children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]), container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3443
3947
|
};
|
|
3444
3948
|
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
3445
3949
|
const el = n2.el = n1.el;
|
|
@@ -3493,8 +3997,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3493
3997
|
for (let i = 0; i < newChildren.length; i++) {
|
|
3494
3998
|
const oldVNode = oldChildren[i];
|
|
3495
3999
|
const newVNode = newChildren[i];
|
|
3496
|
-
|
|
3497
|
-
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
4000
|
+
patch(oldVNode, newVNode, oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
3498
4001
|
}
|
|
3499
4002
|
};
|
|
3500
4003
|
const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
|
|
@@ -3525,7 +4028,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3525
4028
|
hostInsert(fragmentStartAnchor, container, anchor);
|
|
3526
4029
|
hostInsert(fragmentEndAnchor, container, anchor);
|
|
3527
4030
|
mountChildren(n2.children || [], container, fragmentEndAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3528
|
-
} else if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && n1.dynamicChildren) {
|
|
4031
|
+
} else if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
|
|
3529
4032
|
patchBlockChildren(n1.dynamicChildren, dynamicChildren, container, parentComponent, parentSuspense, namespace, slotScopeIds);
|
|
3530
4033
|
if (!!(process.env.NODE_ENV !== "production")) traverseStaticChildren(n1, n2);
|
|
3531
4034
|
else if (n2.key != null || parentComponent && n2 === parentComponent.subTree) traverseStaticChildren(n1, n2, true);
|
|
@@ -3662,17 +4165,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3662
4165
|
}
|
|
3663
4166
|
};
|
|
3664
4167
|
instance.scope.on();
|
|
3665
|
-
const effect
|
|
4168
|
+
const effect = instance.effect = new ReactiveEffect(componentUpdateFn);
|
|
3666
4169
|
instance.scope.off();
|
|
3667
|
-
const update = instance.update = effect
|
|
3668
|
-
const job = instance.job = effect
|
|
4170
|
+
const update = instance.update = effect.run.bind(effect);
|
|
4171
|
+
const job = instance.job = effect.runIfDirty.bind(effect);
|
|
3669
4172
|
job.i = instance;
|
|
3670
4173
|
job.id = instance.uid;
|
|
3671
|
-
effect
|
|
4174
|
+
effect.scheduler = () => queueJob(job);
|
|
3672
4175
|
toggleRecurse(instance, true);
|
|
3673
4176
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3674
|
-
effect
|
|
3675
|
-
effect
|
|
4177
|
+
effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
|
|
4178
|
+
effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
|
|
3676
4179
|
}
|
|
3677
4180
|
update();
|
|
3678
4181
|
};
|
|
@@ -3803,7 +4306,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3803
4306
|
const nextIndex = s2 + i;
|
|
3804
4307
|
const nextChild = c2[nextIndex];
|
|
3805
4308
|
const anchorVNode = c2[nextIndex + 1];
|
|
3806
|
-
const anchor = nextIndex + 1 < l2 ? anchorVNode.el || anchorVNode
|
|
4309
|
+
const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
|
|
3807
4310
|
if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3808
4311
|
else if (moved) if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2);
|
|
3809
4312
|
else j--;
|
|
@@ -3857,11 +4360,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3857
4360
|
else hostInsert(el, container, anchor);
|
|
3858
4361
|
};
|
|
3859
4362
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
3860
|
-
const { type, props, ref
|
|
4363
|
+
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex } = vnode;
|
|
3861
4364
|
if (patchFlag === -2) optimized = false;
|
|
3862
|
-
if (ref
|
|
4365
|
+
if (ref != null) {
|
|
3863
4366
|
pauseTracking();
|
|
3864
|
-
setRef(ref
|
|
4367
|
+
setRef(ref, null, parentSuspense, vnode, true);
|
|
3865
4368
|
resetTracking();
|
|
3866
4369
|
}
|
|
3867
4370
|
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
@@ -3883,19 +4386,19 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3883
4386
|
if (shapeFlag & 64) vnode.type.remove(vnode, parentComponent, parentSuspense, internals, doRemove);
|
|
3884
4387
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
3885
4388
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
3886
|
-
if (doRemove) remove
|
|
4389
|
+
if (doRemove) remove(vnode);
|
|
3887
4390
|
}
|
|
3888
4391
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) queuePostRenderEffect(() => {
|
|
3889
4392
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
3890
4393
|
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
3891
4394
|
}, parentSuspense);
|
|
3892
4395
|
};
|
|
3893
|
-
const remove
|
|
4396
|
+
const remove = (vnode) => {
|
|
3894
4397
|
const { type, el, anchor, transition } = vnode;
|
|
3895
4398
|
if (type === Fragment) {
|
|
3896
4399
|
if (!!(process.env.NODE_ENV !== "production") && vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) vnode.children.forEach((child) => {
|
|
3897
4400
|
if (child.type === Comment) hostRemove(child.el);
|
|
3898
|
-
else remove
|
|
4401
|
+
else remove(child);
|
|
3899
4402
|
});
|
|
3900
4403
|
else removeFragment(el, anchor);
|
|
3901
4404
|
return;
|
|
@@ -3952,14 +4455,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3952
4455
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
3953
4456
|
};
|
|
3954
4457
|
let isFlushing = false;
|
|
3955
|
-
const render
|
|
4458
|
+
const render = (vnode, container, namespace) => {
|
|
4459
|
+
let instance;
|
|
3956
4460
|
if (vnode == null) {
|
|
3957
|
-
if (container._vnode)
|
|
4461
|
+
if (container._vnode) {
|
|
4462
|
+
unmount(container._vnode, null, null, true);
|
|
4463
|
+
instance = container._vnode.component;
|
|
4464
|
+
}
|
|
3958
4465
|
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
3959
4466
|
container._vnode = vnode;
|
|
3960
4467
|
if (!isFlushing) {
|
|
3961
4468
|
isFlushing = true;
|
|
3962
|
-
flushPreFlushCbs();
|
|
4469
|
+
flushPreFlushCbs(instance);
|
|
3963
4470
|
flushPostFlushCbs();
|
|
3964
4471
|
isFlushing = false;
|
|
3965
4472
|
}
|
|
@@ -3968,7 +4475,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3968
4475
|
p: patch,
|
|
3969
4476
|
um: unmount,
|
|
3970
4477
|
m: move,
|
|
3971
|
-
r: remove
|
|
4478
|
+
r: remove,
|
|
3972
4479
|
mt: mountComponent,
|
|
3973
4480
|
mc: mountChildren,
|
|
3974
4481
|
pc: patchChildren,
|
|
@@ -3980,20 +4487,20 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3980
4487
|
let hydrateNode;
|
|
3981
4488
|
if (createHydrationFns) [hydrate, hydrateNode] = createHydrationFns(internals);
|
|
3982
4489
|
return {
|
|
3983
|
-
render
|
|
4490
|
+
render,
|
|
3984
4491
|
hydrate,
|
|
3985
|
-
createApp: createAppAPI(render
|
|
4492
|
+
createApp: createAppAPI(render, hydrate)
|
|
3986
4493
|
};
|
|
3987
4494
|
}
|
|
3988
4495
|
function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
3989
4496
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
3990
4497
|
}
|
|
3991
|
-
function toggleRecurse({ effect
|
|
4498
|
+
function toggleRecurse({ effect, job }, allowed) {
|
|
3992
4499
|
if (allowed) {
|
|
3993
|
-
effect
|
|
4500
|
+
effect.flags |= 32;
|
|
3994
4501
|
job.flags |= 4;
|
|
3995
4502
|
} else {
|
|
3996
|
-
effect
|
|
4503
|
+
effect.flags &= -33;
|
|
3997
4504
|
job.flags &= -5;
|
|
3998
4505
|
}
|
|
3999
4506
|
}
|
|
@@ -4013,13 +4520,14 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
4013
4520
|
}
|
|
4014
4521
|
if (!shallow && c2.patchFlag !== -2) traverseStaticChildren(c1, c2);
|
|
4015
4522
|
}
|
|
4016
|
-
if (c2.type === Text
|
|
4523
|
+
if (c2.type === Text) if (c2.patchFlag !== -1) c2.el = c1.el;
|
|
4524
|
+
else c2.__elIndex = i + (n1.type === Fragment ? 1 : 0);
|
|
4017
4525
|
if (c2.type === Comment && !c2.el) c2.el = c1.el;
|
|
4018
4526
|
if (!!(process.env.NODE_ENV !== "production")) c2.el && (c2.el.__vnode = c2);
|
|
4019
4527
|
}
|
|
4020
4528
|
}
|
|
4021
4529
|
function getSequence(arr) {
|
|
4022
|
-
const p
|
|
4530
|
+
const p = arr.slice();
|
|
4023
4531
|
const result = [0];
|
|
4024
4532
|
let i, j, u, v, c;
|
|
4025
4533
|
const len = arr.length;
|
|
@@ -4028,7 +4536,7 @@ function getSequence(arr) {
|
|
|
4028
4536
|
if (arrI !== 0) {
|
|
4029
4537
|
j = result[result.length - 1];
|
|
4030
4538
|
if (arr[j] < arrI) {
|
|
4031
|
-
p
|
|
4539
|
+
p[i] = j;
|
|
4032
4540
|
result.push(i);
|
|
4033
4541
|
continue;
|
|
4034
4542
|
}
|
|
@@ -4040,7 +4548,7 @@ function getSequence(arr) {
|
|
|
4040
4548
|
else v = c;
|
|
4041
4549
|
}
|
|
4042
4550
|
if (arrI < arr[result[u]]) {
|
|
4043
|
-
if (u > 0) p
|
|
4551
|
+
if (u > 0) p[i] = result[u - 1];
|
|
4044
4552
|
result[u] = i;
|
|
4045
4553
|
}
|
|
4046
4554
|
}
|
|
@@ -4049,7 +4557,7 @@ function getSequence(arr) {
|
|
|
4049
4557
|
v = result[u - 1];
|
|
4050
4558
|
while (u-- > 0) {
|
|
4051
4559
|
result[u] = v;
|
|
4052
|
-
v = p
|
|
4560
|
+
v = p[v];
|
|
4053
4561
|
}
|
|
4054
4562
|
return result;
|
|
4055
4563
|
}
|
|
@@ -4061,412 +4569,308 @@ function locateNonHydratedAsyncRoot(instance) {
|
|
|
4061
4569
|
function invalidateMount(hooks) {
|
|
4062
4570
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 8;
|
|
4063
4571
|
}
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
return ctx;
|
|
4070
|
-
}
|
|
4071
|
-
};
|
|
4072
|
-
function watchEffect(effect$1, options) {
|
|
4073
|
-
return doWatch(effect$1, null, options);
|
|
4074
|
-
}
|
|
4075
|
-
function watchSyncEffect(effect$1, options) {
|
|
4076
|
-
return doWatch(effect$1, null, !!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "sync" }) : { flush: "sync" });
|
|
4077
|
-
}
|
|
4078
|
-
function watch(source, cb, options) {
|
|
4079
|
-
if (!!(process.env.NODE_ENV !== "production") && !isFunction(cb)) warn$1(`\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`);
|
|
4080
|
-
return doWatch(source, cb, options);
|
|
4572
|
+
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
4573
|
+
if (anchorVnode.placeholder) return anchorVnode.placeholder;
|
|
4574
|
+
const instance = anchorVnode.component;
|
|
4575
|
+
if (instance) return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
4576
|
+
return null;
|
|
4081
4577
|
}
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
const ctx = useSSRContext();
|
|
4096
|
-
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
4097
|
-
} else if (!runsImmediately) {
|
|
4098
|
-
const watchStopHandle = () => {};
|
|
4099
|
-
watchStopHandle.stop = NOOP;
|
|
4100
|
-
watchStopHandle.resume = NOOP;
|
|
4101
|
-
watchStopHandle.pause = NOOP;
|
|
4102
|
-
return watchStopHandle;
|
|
4103
|
-
}
|
|
4104
|
-
}
|
|
4105
|
-
const instance = currentInstance;
|
|
4106
|
-
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
4107
|
-
let isPre = false;
|
|
4108
|
-
if (flush === "post") baseWatchOptions.scheduler = (job) => {
|
|
4109
|
-
queuePostRenderEffect(job, instance && instance.suspense);
|
|
4110
|
-
};
|
|
4111
|
-
else if (flush !== "sync") {
|
|
4112
|
-
isPre = true;
|
|
4113
|
-
baseWatchOptions.scheduler = (job, isFirstRun) => {
|
|
4114
|
-
if (isFirstRun) job();
|
|
4115
|
-
else queueJob(job);
|
|
4116
|
-
};
|
|
4117
|
-
}
|
|
4118
|
-
baseWatchOptions.augmentJob = (job) => {
|
|
4119
|
-
if (cb) job.flags |= 4;
|
|
4120
|
-
if (isPre) {
|
|
4121
|
-
job.flags |= 2;
|
|
4122
|
-
if (instance) {
|
|
4123
|
-
job.id = instance.uid;
|
|
4124
|
-
job.i = instance;
|
|
4578
|
+
const isSuspense = (type) => type.__isSuspense;
|
|
4579
|
+
let suspenseId = 0;
|
|
4580
|
+
const Suspense = {
|
|
4581
|
+
name: "Suspense",
|
|
4582
|
+
__isSuspense: true,
|
|
4583
|
+
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
4584
|
+
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
4585
|
+
else {
|
|
4586
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
4587
|
+
n2.suspense = n1.suspense;
|
|
4588
|
+
n2.suspense.vnode = n2;
|
|
4589
|
+
n2.el = n1.el;
|
|
4590
|
+
return;
|
|
4125
4591
|
}
|
|
4592
|
+
patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, rendererInternals);
|
|
4126
4593
|
}
|
|
4127
|
-
}
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
if (ssrCleanup) ssrCleanup.push(watchHandle);
|
|
4131
|
-
else if (runsImmediately) watchHandle();
|
|
4132
|
-
}
|
|
4133
|
-
return watchHandle;
|
|
4134
|
-
}
|
|
4135
|
-
function instanceWatch(source, value, options) {
|
|
4136
|
-
const publicThis = this.proxy;
|
|
4137
|
-
const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
4138
|
-
let cb;
|
|
4139
|
-
if (isFunction(value)) cb = value;
|
|
4140
|
-
else {
|
|
4141
|
-
cb = value.handler;
|
|
4142
|
-
options = value;
|
|
4143
|
-
}
|
|
4144
|
-
const reset = setCurrentInstance(this);
|
|
4145
|
-
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
4146
|
-
reset();
|
|
4147
|
-
return res;
|
|
4148
|
-
}
|
|
4149
|
-
function createPathGetter(ctx, path) {
|
|
4150
|
-
const segments = path.split(".");
|
|
4151
|
-
return () => {
|
|
4152
|
-
let cur = ctx;
|
|
4153
|
-
for (let i = 0; i < segments.length && cur; i++) cur = cur[segments[i]];
|
|
4154
|
-
return cur;
|
|
4155
|
-
};
|
|
4156
|
-
}
|
|
4157
|
-
function useModel(props, name, options = EMPTY_OBJ) {
|
|
4158
|
-
const i = getCurrentInstance();
|
|
4159
|
-
if (!!(process.env.NODE_ENV !== "production") && !i) {
|
|
4160
|
-
warn$1(`useModel() called without active instance.`);
|
|
4161
|
-
return ref();
|
|
4162
|
-
}
|
|
4163
|
-
const camelizedName = camelize$1(name);
|
|
4164
|
-
if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][camelizedName]) {
|
|
4165
|
-
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
4166
|
-
return ref();
|
|
4167
|
-
}
|
|
4168
|
-
const hyphenatedName = hyphenate$1(name);
|
|
4169
|
-
const modifiers = getModelModifiers(props, camelizedName);
|
|
4170
|
-
const res = customRef((track$1, trigger$1) => {
|
|
4171
|
-
let localValue;
|
|
4172
|
-
let prevSetValue = EMPTY_OBJ;
|
|
4173
|
-
let prevEmittedValue;
|
|
4174
|
-
watchSyncEffect(() => {
|
|
4175
|
-
const propValue = props[camelizedName];
|
|
4176
|
-
if (hasChanged(localValue, propValue)) {
|
|
4177
|
-
localValue = propValue;
|
|
4178
|
-
trigger$1();
|
|
4179
|
-
}
|
|
4180
|
-
});
|
|
4181
|
-
return {
|
|
4182
|
-
get() {
|
|
4183
|
-
track$1();
|
|
4184
|
-
return options.get ? options.get(localValue) : localValue;
|
|
4185
|
-
},
|
|
4186
|
-
set(value) {
|
|
4187
|
-
const emittedValue = options.set ? options.set(value) : value;
|
|
4188
|
-
if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) return;
|
|
4189
|
-
const rawProps = i.vnode.props;
|
|
4190
|
-
if (!(rawProps && (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
|
|
4191
|
-
localValue = value;
|
|
4192
|
-
trigger$1();
|
|
4193
|
-
}
|
|
4194
|
-
i.emit(`update:${name}`, emittedValue);
|
|
4195
|
-
if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) trigger$1();
|
|
4196
|
-
prevSetValue = value;
|
|
4197
|
-
prevEmittedValue = emittedValue;
|
|
4198
|
-
}
|
|
4199
|
-
};
|
|
4200
|
-
});
|
|
4201
|
-
res[Symbol.iterator] = () => {
|
|
4202
|
-
let i2 = 0;
|
|
4203
|
-
return { next() {
|
|
4204
|
-
if (i2 < 2) return {
|
|
4205
|
-
value: i2++ ? modifiers || EMPTY_OBJ : res,
|
|
4206
|
-
done: false
|
|
4207
|
-
};
|
|
4208
|
-
else return { done: true };
|
|
4209
|
-
} };
|
|
4210
|
-
};
|
|
4211
|
-
return res;
|
|
4212
|
-
}
|
|
4213
|
-
const getModelModifiers = (props, modelName) => {
|
|
4214
|
-
return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize$1(modelName)}Modifiers`] || props[`${hyphenate$1(modelName)}Modifiers`];
|
|
4594
|
+
},
|
|
4595
|
+
hydrate: hydrateSuspense,
|
|
4596
|
+
normalize: normalizeSuspenseChildren
|
|
4215
4597
|
};
|
|
4216
|
-
function
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
else if (instance.emitted[handlerName]) return;
|
|
4250
|
-
instance.emitted[handlerName] = true;
|
|
4251
|
-
callWithAsyncErrorHandling(onceHandler, instance, 6, args);
|
|
4252
|
-
}
|
|
4253
|
-
}
|
|
4254
|
-
const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
|
|
4255
|
-
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
4256
|
-
const cache = __VUE_OPTIONS_API__ && asMixin ? mixinEmitsCache : appContext.emitsCache;
|
|
4257
|
-
const cached = cache.get(comp);
|
|
4258
|
-
if (cached !== void 0) return cached;
|
|
4259
|
-
const raw = comp.emits;
|
|
4260
|
-
let normalized = {};
|
|
4261
|
-
let hasExtends = false;
|
|
4262
|
-
if (__VUE_OPTIONS_API__ && !isFunction(comp)) {
|
|
4263
|
-
const extendEmits = (raw2) => {
|
|
4264
|
-
const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
|
|
4265
|
-
if (normalizedFromExtend) {
|
|
4266
|
-
hasExtends = true;
|
|
4267
|
-
extend(normalized, normalizedFromExtend);
|
|
4598
|
+
function triggerEvent(vnode, name) {
|
|
4599
|
+
const eventListener = vnode.props && vnode.props[name];
|
|
4600
|
+
if (isFunction(eventListener)) eventListener();
|
|
4601
|
+
}
|
|
4602
|
+
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
4603
|
+
const { p: patch, o: { createElement } } = rendererInternals;
|
|
4604
|
+
const hiddenContainer = createElement("div");
|
|
4605
|
+
const suspense = vnode.suspense = createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals);
|
|
4606
|
+
patch(null, suspense.pendingBranch = vnode.ssContent, hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds);
|
|
4607
|
+
if (suspense.deps > 0) {
|
|
4608
|
+
triggerEvent(vnode, "onPending");
|
|
4609
|
+
triggerEvent(vnode, "onFallback");
|
|
4610
|
+
patch(null, vnode.ssFallback, container, anchor, parentComponent, null, namespace, slotScopeIds);
|
|
4611
|
+
setActiveBranch(suspense, vnode.ssFallback);
|
|
4612
|
+
} else suspense.resolve(false, true);
|
|
4613
|
+
}
|
|
4614
|
+
function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
|
|
4615
|
+
const suspense = n2.suspense = n1.suspense;
|
|
4616
|
+
suspense.vnode = n2;
|
|
4617
|
+
n2.el = n1.el;
|
|
4618
|
+
const newBranch = n2.ssContent;
|
|
4619
|
+
const newFallback = n2.ssFallback;
|
|
4620
|
+
const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
|
|
4621
|
+
if (pendingBranch) {
|
|
4622
|
+
suspense.pendingBranch = newBranch;
|
|
4623
|
+
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
4624
|
+
patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
4625
|
+
if (suspense.deps <= 0) suspense.resolve();
|
|
4626
|
+
else if (isInFallback) {
|
|
4627
|
+
if (!isHydrating) {
|
|
4628
|
+
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
4629
|
+
setActiveBranch(suspense, newFallback);
|
|
4630
|
+
}
|
|
4268
4631
|
}
|
|
4269
|
-
};
|
|
4270
|
-
if (!asMixin && appContext.mixins.length) appContext.mixins.forEach(extendEmits);
|
|
4271
|
-
if (comp.extends) extendEmits(comp.extends);
|
|
4272
|
-
if (comp.mixins) comp.mixins.forEach(extendEmits);
|
|
4273
|
-
}
|
|
4274
|
-
if (!raw && !hasExtends) {
|
|
4275
|
-
if (isObject$1(comp)) cache.set(comp, null);
|
|
4276
|
-
return null;
|
|
4277
|
-
}
|
|
4278
|
-
if (isArray(raw)) raw.forEach((key) => normalized[key] = null);
|
|
4279
|
-
else extend(normalized, raw);
|
|
4280
|
-
if (isObject$1(comp)) cache.set(comp, normalized);
|
|
4281
|
-
return normalized;
|
|
4282
|
-
}
|
|
4283
|
-
function isEmitListener(options, key) {
|
|
4284
|
-
if (!options || !isOn(key)) return false;
|
|
4285
|
-
key = key.slice(2).replace(/Once$/, "");
|
|
4286
|
-
return hasOwn$1(options, key[0].toLowerCase() + key.slice(1)) || hasOwn$1(options, hyphenate$1(key)) || hasOwn$1(options, key);
|
|
4287
|
-
}
|
|
4288
|
-
let accessedAttrs = false;
|
|
4289
|
-
function markAttrsAccessed() {
|
|
4290
|
-
accessedAttrs = true;
|
|
4291
|
-
}
|
|
4292
|
-
function renderComponentRoot(instance) {
|
|
4293
|
-
const { type: Component, vnode, proxy, withProxy, propsOptions: [propsOptions], slots, attrs, emit: emit$2, render: render$1, renderCache, props, data, setupState, ctx, inheritAttrs } = instance;
|
|
4294
|
-
const prev = setCurrentRenderingInstance(instance);
|
|
4295
|
-
let result;
|
|
4296
|
-
let fallthroughAttrs;
|
|
4297
|
-
if (!!(process.env.NODE_ENV !== "production")) accessedAttrs = false;
|
|
4298
|
-
try {
|
|
4299
|
-
if (vnode.shapeFlag & 4) {
|
|
4300
|
-
const proxyToUse = withProxy || proxy;
|
|
4301
|
-
const thisProxy = !!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup ? new Proxy(proxyToUse, { get(target, key, receiver) {
|
|
4302
|
-
warn$1(`Property '${String(key)}' was accessed via 'this'. Avoid using 'this' in templates.`);
|
|
4303
|
-
return Reflect.get(target, key, receiver);
|
|
4304
|
-
} }) : proxyToUse;
|
|
4305
|
-
result = normalizeVNode(render$1.call(thisProxy, proxyToUse, renderCache, !!(process.env.NODE_ENV !== "production") ? shallowReadonly(props) : props, setupState, data, ctx));
|
|
4306
|
-
fallthroughAttrs = attrs;
|
|
4307
4632
|
} else {
|
|
4308
|
-
|
|
4309
|
-
if (
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
|
|
4323
|
-
}
|
|
4324
|
-
} catch (err) {
|
|
4325
|
-
blockStack.length = 0;
|
|
4326
|
-
handleError(err, instance, 1);
|
|
4327
|
-
result = createVNode(Comment);
|
|
4328
|
-
}
|
|
4329
|
-
let root = result;
|
|
4330
|
-
let setRoot = void 0;
|
|
4331
|
-
if (!!(process.env.NODE_ENV !== "production") && result.patchFlag > 0 && result.patchFlag & 2048) [root, setRoot] = getChildRoot(result);
|
|
4332
|
-
if (fallthroughAttrs && inheritAttrs !== false) {
|
|
4333
|
-
const keys = Object.keys(fallthroughAttrs);
|
|
4334
|
-
const { shapeFlag } = root;
|
|
4335
|
-
if (keys.length) {
|
|
4336
|
-
if (shapeFlag & 7) {
|
|
4337
|
-
if (propsOptions && keys.some(isModelListener)) fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
|
|
4338
|
-
root = cloneVNode(root, fallthroughAttrs, false, true);
|
|
4339
|
-
} else if (!!(process.env.NODE_ENV !== "production") && !accessedAttrs && root.type !== Comment) {
|
|
4340
|
-
const allAttrs = Object.keys(attrs);
|
|
4341
|
-
const eventAttrs = [];
|
|
4342
|
-
const extraAttrs = [];
|
|
4343
|
-
for (let i = 0, l = allAttrs.length; i < l; i++) {
|
|
4344
|
-
const key = allAttrs[i];
|
|
4345
|
-
if (isOn(key)) {
|
|
4346
|
-
if (!isModelListener(key)) eventAttrs.push(key[2].toLowerCase() + key.slice(3));
|
|
4347
|
-
} else extraAttrs.push(key);
|
|
4633
|
+
suspense.pendingId = suspenseId++;
|
|
4634
|
+
if (isHydrating) {
|
|
4635
|
+
suspense.isHydrating = false;
|
|
4636
|
+
suspense.activeBranch = pendingBranch;
|
|
4637
|
+
} else unmount(pendingBranch, parentComponent, suspense);
|
|
4638
|
+
suspense.deps = 0;
|
|
4639
|
+
suspense.effects.length = 0;
|
|
4640
|
+
suspense.hiddenContainer = createElement("div");
|
|
4641
|
+
if (isInFallback) {
|
|
4642
|
+
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
4643
|
+
if (suspense.deps <= 0) suspense.resolve();
|
|
4644
|
+
else {
|
|
4645
|
+
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
4646
|
+
setActiveBranch(suspense, newFallback);
|
|
4348
4647
|
}
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) warn$1(`Runtime directive used on component with non-element root node. The directives will not function as intended.`);
|
|
4356
|
-
root = cloneVNode(root, null, false, true);
|
|
4357
|
-
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
4358
|
-
}
|
|
4359
|
-
if (vnode.transition) {
|
|
4360
|
-
if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) warn$1(`Component inside <Transition> renders non-element root node that cannot be animated.`);
|
|
4361
|
-
setTransitionHooks(root, vnode.transition);
|
|
4362
|
-
}
|
|
4363
|
-
if (!!(process.env.NODE_ENV !== "production") && setRoot) setRoot(root);
|
|
4364
|
-
else result = root;
|
|
4365
|
-
setCurrentRenderingInstance(prev);
|
|
4366
|
-
return result;
|
|
4367
|
-
}
|
|
4368
|
-
const getChildRoot = (vnode) => {
|
|
4369
|
-
const rawChildren = vnode.children;
|
|
4370
|
-
const dynamicChildren = vnode.dynamicChildren;
|
|
4371
|
-
const childRoot = filterSingleRoot(rawChildren, false);
|
|
4372
|
-
if (!childRoot) return [vnode, void 0];
|
|
4373
|
-
else if (!!(process.env.NODE_ENV !== "production") && childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) return getChildRoot(childRoot);
|
|
4374
|
-
const index = rawChildren.indexOf(childRoot);
|
|
4375
|
-
const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
|
|
4376
|
-
const setRoot = (updatedRoot) => {
|
|
4377
|
-
rawChildren[index] = updatedRoot;
|
|
4378
|
-
if (dynamicChildren) {
|
|
4379
|
-
if (dynamicIndex > -1) dynamicChildren[dynamicIndex] = updatedRoot;
|
|
4380
|
-
else if (updatedRoot.patchFlag > 0) vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
|
|
4381
|
-
}
|
|
4382
|
-
};
|
|
4383
|
-
return [normalizeVNode(childRoot), setRoot];
|
|
4384
|
-
};
|
|
4385
|
-
function filterSingleRoot(children, recurse = true) {
|
|
4386
|
-
let singleRoot;
|
|
4387
|
-
for (let i = 0; i < children.length; i++) {
|
|
4388
|
-
const child = children[i];
|
|
4389
|
-
if (isVNode(child)) {
|
|
4390
|
-
if (child.type !== Comment || child.children === "v-if") if (singleRoot) return;
|
|
4391
|
-
else {
|
|
4392
|
-
singleRoot = child;
|
|
4393
|
-
if (!!(process.env.NODE_ENV !== "production") && recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
|
|
4394
|
-
}
|
|
4395
|
-
} else return;
|
|
4396
|
-
}
|
|
4397
|
-
return singleRoot;
|
|
4398
|
-
}
|
|
4399
|
-
const getFunctionalFallthrough = (attrs) => {
|
|
4400
|
-
let res;
|
|
4401
|
-
for (const key in attrs) if (key === "class" || key === "style" || isOn(key)) (res || (res = {}))[key] = attrs[key];
|
|
4402
|
-
return res;
|
|
4403
|
-
};
|
|
4404
|
-
const filterModelListeners = (attrs, props) => {
|
|
4405
|
-
const res = {};
|
|
4406
|
-
for (const key in attrs) if (!isModelListener(key) || !(key.slice(9) in props)) res[key] = attrs[key];
|
|
4407
|
-
return res;
|
|
4408
|
-
};
|
|
4409
|
-
const isElementRoot = (vnode) => {
|
|
4410
|
-
return vnode.shapeFlag & 7 || vnode.type === Comment;
|
|
4411
|
-
};
|
|
4412
|
-
function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
|
|
4413
|
-
const { props: prevProps, children: prevChildren, component } = prevVNode;
|
|
4414
|
-
const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
|
|
4415
|
-
const emits = component.emitsOptions;
|
|
4416
|
-
if (!!(process.env.NODE_ENV !== "production") && (prevChildren || nextChildren) && isHmrUpdating) return true;
|
|
4417
|
-
if (nextVNode.dirs || nextVNode.transition) return true;
|
|
4418
|
-
if (optimized && patchFlag >= 0) {
|
|
4419
|
-
if (patchFlag & 1024) return true;
|
|
4420
|
-
if (patchFlag & 16) {
|
|
4421
|
-
if (!prevProps) return !!nextProps;
|
|
4422
|
-
return hasPropsChanged(prevProps, nextProps, emits);
|
|
4423
|
-
} else if (patchFlag & 8) {
|
|
4424
|
-
const dynamicProps = nextVNode.dynamicProps;
|
|
4425
|
-
for (let i = 0; i < dynamicProps.length; i++) {
|
|
4426
|
-
const key = dynamicProps[i];
|
|
4427
|
-
if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) return true;
|
|
4648
|
+
} else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
|
|
4649
|
+
patch(activeBranch, newBranch, container, anchor, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
4650
|
+
suspense.resolve(true);
|
|
4651
|
+
} else {
|
|
4652
|
+
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
4653
|
+
if (suspense.deps <= 0) suspense.resolve();
|
|
4428
4654
|
}
|
|
4429
4655
|
}
|
|
4430
|
-
} else {
|
|
4431
|
-
|
|
4432
|
-
|
|
4656
|
+
} else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
|
|
4657
|
+
patch(activeBranch, newBranch, container, anchor, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
4658
|
+
setActiveBranch(suspense, newBranch);
|
|
4659
|
+
} else {
|
|
4660
|
+
triggerEvent(n2, "onPending");
|
|
4661
|
+
suspense.pendingBranch = newBranch;
|
|
4662
|
+
if (newBranch.shapeFlag & 512) suspense.pendingId = newBranch.component.suspenseId;
|
|
4663
|
+
else suspense.pendingId = suspenseId++;
|
|
4664
|
+
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
4665
|
+
if (suspense.deps <= 0) suspense.resolve();
|
|
4666
|
+
else {
|
|
4667
|
+
const { timeout, pendingId } = suspense;
|
|
4668
|
+
if (timeout > 0) setTimeout(() => {
|
|
4669
|
+
if (suspense.pendingId === pendingId) suspense.fallback(newFallback);
|
|
4670
|
+
}, timeout);
|
|
4671
|
+
else if (timeout === 0) suspense.fallback(newFallback);
|
|
4433
4672
|
}
|
|
4434
|
-
if (prevProps === nextProps) return false;
|
|
4435
|
-
if (!prevProps) return !!nextProps;
|
|
4436
|
-
if (!nextProps) return true;
|
|
4437
|
-
return hasPropsChanged(prevProps, nextProps, emits);
|
|
4438
4673
|
}
|
|
4439
|
-
return false;
|
|
4440
4674
|
}
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
if (
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) return true;
|
|
4675
|
+
let hasWarned = false;
|
|
4676
|
+
function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
|
|
4677
|
+
if (!!(process.env.NODE_ENV !== "production") && !hasWarned) {
|
|
4678
|
+
hasWarned = true;
|
|
4679
|
+
console[console.info ? "info" : "log"](`<Suspense> is an experimental feature and its API will likely change.`);
|
|
4447
4680
|
}
|
|
4448
|
-
|
|
4681
|
+
const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;
|
|
4682
|
+
let parentSuspenseId;
|
|
4683
|
+
const isSuspensible = isVNodeSuspensible(vnode);
|
|
4684
|
+
if (isSuspensible) {
|
|
4685
|
+
if (parentSuspense && parentSuspense.pendingBranch) {
|
|
4686
|
+
parentSuspenseId = parentSuspense.pendingId;
|
|
4687
|
+
parentSuspense.deps++;
|
|
4688
|
+
}
|
|
4689
|
+
}
|
|
4690
|
+
const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
|
|
4691
|
+
if (!!(process.env.NODE_ENV !== "production")) assertNumber(timeout, `Suspense timeout`);
|
|
4692
|
+
const initialAnchor = anchor;
|
|
4693
|
+
const suspense = {
|
|
4694
|
+
vnode,
|
|
4695
|
+
parent: parentSuspense,
|
|
4696
|
+
parentComponent,
|
|
4697
|
+
namespace,
|
|
4698
|
+
container,
|
|
4699
|
+
hiddenContainer,
|
|
4700
|
+
deps: 0,
|
|
4701
|
+
pendingId: suspenseId++,
|
|
4702
|
+
timeout: typeof timeout === "number" ? timeout : -1,
|
|
4703
|
+
activeBranch: null,
|
|
4704
|
+
pendingBranch: null,
|
|
4705
|
+
isInFallback: !isHydrating,
|
|
4706
|
+
isHydrating,
|
|
4707
|
+
isUnmounted: false,
|
|
4708
|
+
effects: [],
|
|
4709
|
+
resolve(resume = false, sync = false) {
|
|
4710
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
4711
|
+
if (!resume && !suspense.pendingBranch) throw new Error(`suspense.resolve() is called without a pending branch.`);
|
|
4712
|
+
if (suspense.isUnmounted) throw new Error(`suspense.resolve() is called on an already unmounted suspense boundary.`);
|
|
4713
|
+
}
|
|
4714
|
+
const { vnode: vnode2, activeBranch, pendingBranch, pendingId, effects, parentComponent: parentComponent2, container: container2, isInFallback } = suspense;
|
|
4715
|
+
let delayEnter = false;
|
|
4716
|
+
if (suspense.isHydrating) suspense.isHydrating = false;
|
|
4717
|
+
else if (!resume) {
|
|
4718
|
+
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
4719
|
+
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
4720
|
+
if (pendingId === suspense.pendingId) {
|
|
4721
|
+
move(pendingBranch, container2, anchor === initialAnchor ? next(activeBranch) : anchor, 0);
|
|
4722
|
+
queuePostFlushCb(effects);
|
|
4723
|
+
if (isInFallback && vnode2.ssFallback) vnode2.ssFallback.el = null;
|
|
4724
|
+
}
|
|
4725
|
+
};
|
|
4726
|
+
if (activeBranch) {
|
|
4727
|
+
if (parentNode(activeBranch.el) === container2) anchor = next(activeBranch);
|
|
4728
|
+
unmount(activeBranch, parentComponent2, suspense, true);
|
|
4729
|
+
if (!delayEnter && isInFallback && vnode2.ssFallback) queuePostRenderEffect(() => vnode2.ssFallback.el = null, suspense);
|
|
4730
|
+
}
|
|
4731
|
+
if (!delayEnter) move(pendingBranch, container2, anchor, 0);
|
|
4732
|
+
}
|
|
4733
|
+
setActiveBranch(suspense, pendingBranch);
|
|
4734
|
+
suspense.pendingBranch = null;
|
|
4735
|
+
suspense.isInFallback = false;
|
|
4736
|
+
let parent = suspense.parent;
|
|
4737
|
+
let hasUnresolvedAncestor = false;
|
|
4738
|
+
while (parent) {
|
|
4739
|
+
if (parent.pendingBranch) {
|
|
4740
|
+
parent.effects.push(...effects);
|
|
4741
|
+
hasUnresolvedAncestor = true;
|
|
4742
|
+
break;
|
|
4743
|
+
}
|
|
4744
|
+
parent = parent.parent;
|
|
4745
|
+
}
|
|
4746
|
+
if (!hasUnresolvedAncestor && !delayEnter) queuePostFlushCb(effects);
|
|
4747
|
+
suspense.effects = [];
|
|
4748
|
+
if (isSuspensible) {
|
|
4749
|
+
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
4750
|
+
parentSuspense.deps--;
|
|
4751
|
+
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
|
|
4752
|
+
}
|
|
4753
|
+
}
|
|
4754
|
+
triggerEvent(vnode2, "onResolve");
|
|
4755
|
+
},
|
|
4756
|
+
fallback(fallbackVNode) {
|
|
4757
|
+
if (!suspense.pendingBranch) return;
|
|
4758
|
+
const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
|
|
4759
|
+
triggerEvent(vnode2, "onFallback");
|
|
4760
|
+
const anchor2 = next(activeBranch);
|
|
4761
|
+
const mountFallback = () => {
|
|
4762
|
+
if (!suspense.isInFallback) return;
|
|
4763
|
+
patch(null, fallbackVNode, container2, anchor2, parentComponent2, null, namespace2, slotScopeIds, optimized);
|
|
4764
|
+
setActiveBranch(suspense, fallbackVNode);
|
|
4765
|
+
};
|
|
4766
|
+
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
4767
|
+
if (delayEnter) activeBranch.transition.afterLeave = mountFallback;
|
|
4768
|
+
suspense.isInFallback = true;
|
|
4769
|
+
unmount(activeBranch, parentComponent2, null, true);
|
|
4770
|
+
if (!delayEnter) mountFallback();
|
|
4771
|
+
},
|
|
4772
|
+
move(container2, anchor2, type) {
|
|
4773
|
+
suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
|
|
4774
|
+
suspense.container = container2;
|
|
4775
|
+
},
|
|
4776
|
+
next() {
|
|
4777
|
+
return suspense.activeBranch && next(suspense.activeBranch);
|
|
4778
|
+
},
|
|
4779
|
+
registerDep(instance, setupRenderEffect, optimized2) {
|
|
4780
|
+
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
4781
|
+
if (isInPendingSuspense) suspense.deps++;
|
|
4782
|
+
const hydratedEl = instance.vnode.el;
|
|
4783
|
+
instance.asyncDep.catch((err) => {
|
|
4784
|
+
handleError(err, instance, 0);
|
|
4785
|
+
}).then((asyncSetupResult) => {
|
|
4786
|
+
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
4787
|
+
instance.asyncResolved = true;
|
|
4788
|
+
const { vnode: vnode2 } = instance;
|
|
4789
|
+
if (!!(process.env.NODE_ENV !== "production")) pushWarningContext(vnode2);
|
|
4790
|
+
handleSetupResult(instance, asyncSetupResult, false);
|
|
4791
|
+
if (hydratedEl) vnode2.el = hydratedEl;
|
|
4792
|
+
const placeholder = !hydratedEl && instance.subTree.el;
|
|
4793
|
+
setupRenderEffect(instance, vnode2, parentNode(hydratedEl || instance.subTree.el), hydratedEl ? null : next(instance.subTree), suspense, namespace, optimized2);
|
|
4794
|
+
if (placeholder) {
|
|
4795
|
+
vnode2.placeholder = null;
|
|
4796
|
+
remove(placeholder);
|
|
4797
|
+
}
|
|
4798
|
+
updateHOCHostEl(instance, vnode2.el);
|
|
4799
|
+
if (!!(process.env.NODE_ENV !== "production")) popWarningContext();
|
|
4800
|
+
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
4801
|
+
});
|
|
4802
|
+
},
|
|
4803
|
+
unmount(parentSuspense2, doRemove) {
|
|
4804
|
+
suspense.isUnmounted = true;
|
|
4805
|
+
if (suspense.activeBranch) unmount(suspense.activeBranch, parentComponent, parentSuspense2, doRemove);
|
|
4806
|
+
if (suspense.pendingBranch) unmount(suspense.pendingBranch, parentComponent, parentSuspense2, doRemove);
|
|
4807
|
+
}
|
|
4808
|
+
};
|
|
4809
|
+
return suspense;
|
|
4449
4810
|
}
|
|
4450
|
-
function
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4811
|
+
function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
|
|
4812
|
+
const suspense = vnode.suspense = createSuspenseBoundary(vnode, parentSuspense, parentComponent, node.parentNode, document.createElement("div"), null, namespace, slotScopeIds, optimized, rendererInternals, true);
|
|
4813
|
+
const result = hydrateNode(node, suspense.pendingBranch = vnode.ssContent, parentComponent, suspense, slotScopeIds, optimized);
|
|
4814
|
+
if (suspense.deps === 0) suspense.resolve(false, true);
|
|
4815
|
+
return result;
|
|
4816
|
+
}
|
|
4817
|
+
function normalizeSuspenseChildren(vnode) {
|
|
4818
|
+
const { shapeFlag, children } = vnode;
|
|
4819
|
+
const isSlotChildren = shapeFlag & 32;
|
|
4820
|
+
vnode.ssContent = normalizeSuspenseSlot(isSlotChildren ? children.default : children);
|
|
4821
|
+
vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
|
|
4822
|
+
}
|
|
4823
|
+
function normalizeSuspenseSlot(s) {
|
|
4824
|
+
let block;
|
|
4825
|
+
if (isFunction(s)) {
|
|
4826
|
+
const trackBlock = isBlockTreeEnabled && s._c;
|
|
4827
|
+
if (trackBlock) {
|
|
4828
|
+
s._d = false;
|
|
4829
|
+
openBlock();
|
|
4830
|
+
}
|
|
4831
|
+
s = s();
|
|
4832
|
+
if (trackBlock) {
|
|
4833
|
+
s._d = true;
|
|
4834
|
+
block = currentBlock;
|
|
4835
|
+
closeBlock();
|
|
4836
|
+
}
|
|
4837
|
+
}
|
|
4838
|
+
if (isArray(s)) {
|
|
4839
|
+
const singleChild = filterSingleRoot(s);
|
|
4840
|
+
if (!!(process.env.NODE_ENV !== "production") && !singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) warn$1(`<Suspense> slots expect a single root node.`);
|
|
4841
|
+
s = singleChild;
|
|
4458
4842
|
}
|
|
4843
|
+
s = normalizeVNode(s);
|
|
4844
|
+
if (block && !s.dynamicChildren) s.dynamicChildren = block.filter((c) => c !== s);
|
|
4845
|
+
return s;
|
|
4459
4846
|
}
|
|
4460
|
-
const isSuspense = (type) => type.__isSuspense;
|
|
4461
4847
|
function queueEffectWithSuspense(fn, suspense) {
|
|
4462
4848
|
if (suspense && suspense.pendingBranch) if (isArray(fn)) suspense.effects.push(...fn);
|
|
4463
4849
|
else suspense.effects.push(fn);
|
|
4464
4850
|
else queuePostFlushCb(fn);
|
|
4465
4851
|
}
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
const
|
|
4469
|
-
|
|
4852
|
+
function setActiveBranch(suspense, branch) {
|
|
4853
|
+
suspense.activeBranch = branch;
|
|
4854
|
+
const { vnode, parentComponent } = suspense;
|
|
4855
|
+
let el = branch.el;
|
|
4856
|
+
while (!el && branch.component) {
|
|
4857
|
+
branch = branch.component.subTree;
|
|
4858
|
+
el = branch.el;
|
|
4859
|
+
}
|
|
4860
|
+
vnode.el = el;
|
|
4861
|
+
if (parentComponent && parentComponent.subTree === vnode) {
|
|
4862
|
+
parentComponent.vnode.el = el;
|
|
4863
|
+
updateHOCHostEl(parentComponent, el);
|
|
4864
|
+
}
|
|
4865
|
+
}
|
|
4866
|
+
function isVNodeSuspensible(vnode) {
|
|
4867
|
+
const suspensible = vnode.props && vnode.props.suspensible;
|
|
4868
|
+
return suspensible != null && suspensible !== false;
|
|
4869
|
+
}
|
|
4870
|
+
const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
|
|
4871
|
+
const Text = /* @__PURE__ */ Symbol.for("v-txt");
|
|
4872
|
+
const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
|
|
4873
|
+
const Static = /* @__PURE__ */ Symbol.for("v-stc");
|
|
4470
4874
|
const blockStack = [];
|
|
4471
4875
|
let currentBlock = null;
|
|
4472
4876
|
function openBlock(disableTracking = false) {
|
|
@@ -4512,14 +4916,14 @@ const createVNodeWithArgsTransform = (...args) => {
|
|
|
4512
4916
|
return _createVNode(...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args);
|
|
4513
4917
|
};
|
|
4514
4918
|
const normalizeKey = ({ key }) => key != null ? key : null;
|
|
4515
|
-
const normalizeRef = ({ ref
|
|
4516
|
-
if (typeof ref
|
|
4517
|
-
return ref
|
|
4919
|
+
const normalizeRef = ({ ref, ref_key, ref_for }) => {
|
|
4920
|
+
if (typeof ref === "number") ref = "" + ref;
|
|
4921
|
+
return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? {
|
|
4518
4922
|
i: currentRenderingInstance,
|
|
4519
|
-
r: ref
|
|
4923
|
+
r: ref,
|
|
4520
4924
|
k: ref_key,
|
|
4521
4925
|
f: !!ref_for
|
|
4522
|
-
} : ref
|
|
4926
|
+
} : ref : null;
|
|
4523
4927
|
};
|
|
4524
4928
|
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
|
|
4525
4929
|
const vnode = {
|
|
@@ -4578,12 +4982,12 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
4578
4982
|
props = guardReactiveProps(props);
|
|
4579
4983
|
let { class: klass, style } = props;
|
|
4580
4984
|
if (klass && !isString(klass)) props.class = normalizeClass(klass);
|
|
4581
|
-
if (isObject
|
|
4985
|
+
if (isObject(style)) {
|
|
4582
4986
|
if (isProxy(style) && !isArray(style)) style = extend({}, style);
|
|
4583
4987
|
props.style = normalizeStyle(style);
|
|
4584
4988
|
}
|
|
4585
4989
|
}
|
|
4586
|
-
const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject
|
|
4990
|
+
const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
|
|
4587
4991
|
if (!!(process.env.NODE_ENV !== "production") && shapeFlag & 4 && isProxy(type)) {
|
|
4588
4992
|
type = toRaw(type);
|
|
4589
4993
|
warn$1(`Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`, `
|
|
@@ -4596,7 +5000,7 @@ function guardReactiveProps(props) {
|
|
|
4596
5000
|
return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
|
|
4597
5001
|
}
|
|
4598
5002
|
function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
|
|
4599
|
-
const { props, ref
|
|
5003
|
+
const { props, ref, patchFlag, children, transition } = vnode;
|
|
4600
5004
|
const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
|
|
4601
5005
|
const cloned = {
|
|
4602
5006
|
__v_isVNode: true,
|
|
@@ -4604,7 +5008,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
4604
5008
|
type: vnode.type,
|
|
4605
5009
|
props: mergedProps,
|
|
4606
5010
|
key: mergedProps && normalizeKey(mergedProps),
|
|
4607
|
-
ref: extraProps && extraProps.ref ? mergeRef && ref
|
|
5011
|
+
ref: extraProps && extraProps.ref ? mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) : ref,
|
|
4608
5012
|
scopeId: vnode.scopeId,
|
|
4609
5013
|
slotScopeIds: vnode.slotScopeIds,
|
|
4610
5014
|
children: !!(process.env.NODE_ENV !== "production") && patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
|
|
@@ -4640,6 +5044,11 @@ function deepCloneVNode(vnode) {
|
|
|
4640
5044
|
function createTextVNode(text = " ", flag = 0) {
|
|
4641
5045
|
return createVNode(Text, null, text, flag);
|
|
4642
5046
|
}
|
|
5047
|
+
function createStaticVNode(content, numberOfNodes) {
|
|
5048
|
+
const vnode = createVNode(Static, null, content);
|
|
5049
|
+
vnode.staticCount = numberOfNodes;
|
|
5050
|
+
return vnode;
|
|
5051
|
+
}
|
|
4643
5052
|
function createCommentVNode(text = "", asBlock = false) {
|
|
4644
5053
|
return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
|
|
4645
5054
|
}
|
|
@@ -4835,7 +5244,6 @@ function setupComponent(instance, isSSR = false, optimized = false) {
|
|
|
4835
5244
|
return setupResult;
|
|
4836
5245
|
}
|
|
4837
5246
|
function setupStatefulComponent(instance, isSSR) {
|
|
4838
|
-
var _a;
|
|
4839
5247
|
const Component = instance.type;
|
|
4840
5248
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
4841
5249
|
if (Component.name) validateComponentName(Component.name, instance.appContext.config);
|
|
@@ -4871,10 +5279,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
4871
5279
|
});
|
|
4872
5280
|
else {
|
|
4873
5281
|
instance.asyncDep = setupResult;
|
|
4874
|
-
if (!!(process.env.NODE_ENV !== "production") && !instance.suspense) {
|
|
4875
|
-
const name = (_a = Component.name) != null ? _a : "Anonymous";
|
|
4876
|
-
warn$1(`Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`);
|
|
4877
|
-
}
|
|
5282
|
+
if (!!(process.env.NODE_ENV !== "production") && !instance.suspense) warn$1(`Component <${formatComponentName(instance, Component)}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`);
|
|
4878
5283
|
}
|
|
4879
5284
|
} else handleSetupResult(instance, setupResult, isSSR);
|
|
4880
5285
|
} else finishComponentSetup(instance, isSSR);
|
|
@@ -4882,7 +5287,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
4882
5287
|
function handleSetupResult(instance, setupResult, isSSR) {
|
|
4883
5288
|
if (isFunction(setupResult)) if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
|
|
4884
5289
|
else instance.render = setupResult;
|
|
4885
|
-
else if (isObject
|
|
5290
|
+
else if (isObject(setupResult)) {
|
|
4886
5291
|
if (!!(process.env.NODE_ENV !== "production") && isVNode(setupResult)) warn$1(`setup() should not return VNodes directly - return a render function instead.`);
|
|
4887
5292
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) instance.devtoolsRawSetupState = setupResult;
|
|
4888
5293
|
instance.setupState = proxyRefs(setupResult);
|
|
@@ -5010,11 +5415,11 @@ function formatComponentName(instance, Component, isRoot = false) {
|
|
|
5010
5415
|
const match = Component.__file.match(/([^/\\]+)\.\w+$/);
|
|
5011
5416
|
if (match) name = match[1];
|
|
5012
5417
|
}
|
|
5013
|
-
if (!name && instance
|
|
5418
|
+
if (!name && instance) {
|
|
5014
5419
|
const inferFromRegistry = (registry) => {
|
|
5015
5420
|
for (const key in registry) if (registry[key] === Component) return key;
|
|
5016
5421
|
};
|
|
5017
|
-
name = inferFromRegistry(instance.components || instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
|
|
5422
|
+
name = inferFromRegistry(instance.components) || instance.parent && inferFromRegistry(instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
|
|
5018
5423
|
}
|
|
5019
5424
|
return name ? classify(name) : isRoot ? `App` : `Anonymous`;
|
|
5020
5425
|
}
|
|
@@ -5029,6 +5434,23 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
5029
5434
|
}
|
|
5030
5435
|
return c;
|
|
5031
5436
|
};
|
|
5437
|
+
function h(type, propsOrChildren, children) {
|
|
5438
|
+
try {
|
|
5439
|
+
setBlockTracking(-1);
|
|
5440
|
+
const l = arguments.length;
|
|
5441
|
+
if (l === 2) if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
|
|
5442
|
+
if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
|
|
5443
|
+
return createVNode(type, propsOrChildren);
|
|
5444
|
+
} else return createVNode(type, null, propsOrChildren);
|
|
5445
|
+
else {
|
|
5446
|
+
if (l > 3) children = Array.prototype.slice.call(arguments, 2);
|
|
5447
|
+
else if (l === 3 && isVNode(children)) children = [children];
|
|
5448
|
+
return createVNode(type, propsOrChildren, children);
|
|
5449
|
+
}
|
|
5450
|
+
} finally {
|
|
5451
|
+
setBlockTracking(1);
|
|
5452
|
+
}
|
|
5453
|
+
}
|
|
5032
5454
|
function initCustomFormatter() {
|
|
5033
5455
|
if (!!!(process.env.NODE_ENV !== "production") || typeof window === "undefined") return;
|
|
5034
5456
|
const vueStyle = { style: "color:#3ba776" };
|
|
@@ -5038,7 +5460,7 @@ function initCustomFormatter() {
|
|
|
5038
5460
|
const formatter = {
|
|
5039
5461
|
__vue_custom_formatter: true,
|
|
5040
5462
|
header(obj) {
|
|
5041
|
-
if (!isObject
|
|
5463
|
+
if (!isObject(obj)) return null;
|
|
5042
5464
|
if (obj.__isVue) return [
|
|
5043
5465
|
"div",
|
|
5044
5466
|
vueStyle,
|
|
@@ -5102,8 +5524,8 @@ function initCustomFormatter() {
|
|
|
5102
5524
|
if (instance.type.props && instance.props) blocks.push(createInstanceBlock("props", toRaw(instance.props)));
|
|
5103
5525
|
if (instance.setupState !== EMPTY_OBJ) blocks.push(createInstanceBlock("setup", instance.setupState));
|
|
5104
5526
|
if (instance.data !== EMPTY_OBJ) blocks.push(createInstanceBlock("data", toRaw(instance.data)));
|
|
5105
|
-
const computed
|
|
5106
|
-
if (computed
|
|
5527
|
+
const computed = extractKeys(instance, "computed");
|
|
5528
|
+
if (computed) blocks.push(createInstanceBlock("computed", computed));
|
|
5107
5529
|
const injected = extractKeys(instance, "inject");
|
|
5108
5530
|
if (injected) blocks.push(createInstanceBlock("injected", injected));
|
|
5109
5531
|
blocks.push([
|
|
@@ -5163,7 +5585,7 @@ function initCustomFormatter() {
|
|
|
5163
5585
|
keywordStyle,
|
|
5164
5586
|
v
|
|
5165
5587
|
];
|
|
5166
|
-
else if (isObject
|
|
5588
|
+
else if (isObject(v)) return ["object", { object: asRaw ? toRaw(v) : v }];
|
|
5167
5589
|
else return [
|
|
5168
5590
|
"span",
|
|
5169
5591
|
stringStyle,
|
|
@@ -5179,7 +5601,7 @@ function initCustomFormatter() {
|
|
|
5179
5601
|
}
|
|
5180
5602
|
function isKeyOfType(Comp, key, type) {
|
|
5181
5603
|
const opts = Comp[type];
|
|
5182
|
-
if (isArray(opts) && opts.includes(key) || isObject
|
|
5604
|
+
if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) return true;
|
|
5183
5605
|
if (Comp.extends && isKeyOfType(Comp.extends, key, type)) return true;
|
|
5184
5606
|
if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) return true;
|
|
5185
5607
|
}
|
|
@@ -5191,13 +5613,18 @@ function initCustomFormatter() {
|
|
|
5191
5613
|
if (window.devtoolsFormatters) window.devtoolsFormatters.push(formatter);
|
|
5192
5614
|
else window.devtoolsFormatters = [formatter];
|
|
5193
5615
|
}
|
|
5194
|
-
const version = "3.5.
|
|
5616
|
+
const version = "3.5.27";
|
|
5195
5617
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
5196
5618
|
const devtools = (process.env.NODE_ENV, devtools$1);
|
|
5197
5619
|
const setDevtoolsHook = (process.env.NODE_ENV, setDevtoolsHook$1);
|
|
5198
5620
|
|
|
5199
5621
|
//#endregion
|
|
5200
|
-
//#region ../../node_modules/.pnpm/@vue+runtime-dom@3.5.
|
|
5622
|
+
//#region ../../node_modules/.pnpm/@vue+runtime-dom@3.5.27/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js
|
|
5623
|
+
/**
|
|
5624
|
+
* @vue/runtime-dom v3.5.27
|
|
5625
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5626
|
+
* @license MIT
|
|
5627
|
+
**/
|
|
5201
5628
|
let policy = void 0;
|
|
5202
5629
|
const tt = typeof window !== "undefined" && window.trustedTypes;
|
|
5203
5630
|
if (tt) try {
|
|
@@ -5256,7 +5683,7 @@ const nodeOps = {
|
|
|
5256
5683
|
return [before ? before.nextSibling : parent.firstChild, anchor ? anchor.previousSibling : parent.lastChild];
|
|
5257
5684
|
}
|
|
5258
5685
|
};
|
|
5259
|
-
const vtcKey = Symbol("_vtc");
|
|
5686
|
+
const vtcKey = /* @__PURE__ */ Symbol("_vtc");
|
|
5260
5687
|
function patchClass(el, value, isSVG) {
|
|
5261
5688
|
const transitionClasses = el[vtcKey];
|
|
5262
5689
|
if (transitionClasses) value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
|
|
@@ -5264,8 +5691,8 @@ function patchClass(el, value, isSVG) {
|
|
|
5264
5691
|
else if (isSVG) el.setAttribute("class", value);
|
|
5265
5692
|
else el.className = value;
|
|
5266
5693
|
}
|
|
5267
|
-
const vShowOriginalDisplay = Symbol("_vod");
|
|
5268
|
-
const vShowHidden = Symbol("_vsh");
|
|
5694
|
+
const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
|
|
5695
|
+
const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
|
|
5269
5696
|
const vShow = {
|
|
5270
5697
|
name: "show",
|
|
5271
5698
|
beforeMount(el, { value }, { transition }) {
|
|
@@ -5295,7 +5722,7 @@ function setDisplay(el, value) {
|
|
|
5295
5722
|
el.style.display = value ? el[vShowOriginalDisplay] : "none";
|
|
5296
5723
|
el[vShowHidden] = !value;
|
|
5297
5724
|
}
|
|
5298
|
-
const CSS_VAR_TEXT = Symbol(!!(process.env.NODE_ENV !== "production") ? "CSS_VAR_TEXT" : "");
|
|
5725
|
+
const CSS_VAR_TEXT = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? "CSS_VAR_TEXT" : "");
|
|
5299
5726
|
const displayRE = /(?:^|;)\s*display\s*:/;
|
|
5300
5727
|
function patchStyle(el, prev, next) {
|
|
5301
5728
|
const style = el.style;
|
|
@@ -5337,7 +5764,7 @@ function setStyle(style, name, val) {
|
|
|
5337
5764
|
if (name.startsWith("--")) style.setProperty(name, val);
|
|
5338
5765
|
else {
|
|
5339
5766
|
const prefixed = autoPrefix(style, name);
|
|
5340
|
-
if (importantRE.test(val)) style.setProperty(hyphenate
|
|
5767
|
+
if (importantRE.test(val)) style.setProperty(hyphenate(prefixed), val.replace(importantRE, ""), "important");
|
|
5341
5768
|
else style[prefixed] = val;
|
|
5342
5769
|
}
|
|
5343
5770
|
}
|
|
@@ -5351,7 +5778,7 @@ const prefixCache = {};
|
|
|
5351
5778
|
function autoPrefix(style, rawName) {
|
|
5352
5779
|
const cached = prefixCache[rawName];
|
|
5353
5780
|
if (cached) return cached;
|
|
5354
|
-
let name = camelize
|
|
5781
|
+
let name = camelize(rawName);
|
|
5355
5782
|
if (name !== "filter" && name in style) return prefixCache[rawName] = name;
|
|
5356
5783
|
name = capitalize(name);
|
|
5357
5784
|
for (let i = 0; i < prefixes.length; i++) {
|
|
@@ -5361,11 +5788,11 @@ function autoPrefix(style, rawName) {
|
|
|
5361
5788
|
return rawName;
|
|
5362
5789
|
}
|
|
5363
5790
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
5364
|
-
function patchAttr(el, key, value, isSVG, instance, isBoolean
|
|
5791
|
+
function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
|
|
5365
5792
|
if (isSVG && key.startsWith("xlink:")) if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
|
|
5366
5793
|
else el.setAttributeNS(xlinkNS, key, value);
|
|
5367
|
-
else if (value == null || isBoolean
|
|
5368
|
-
else el.setAttribute(key, isBoolean
|
|
5794
|
+
else if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
|
|
5795
|
+
else el.setAttribute(key, isBoolean ? "" : isSymbol(value) ? String(value) : value);
|
|
5369
5796
|
}
|
|
5370
5797
|
function patchDOMProp(el, key, value, parentComponent, attrName) {
|
|
5371
5798
|
if (key === "innerHTML" || key === "textContent") {
|
|
@@ -5406,17 +5833,15 @@ function addEventListener(el, event, handler, options) {
|
|
|
5406
5833
|
function removeEventListener(el, event, handler, options) {
|
|
5407
5834
|
el.removeEventListener(event, handler, options);
|
|
5408
5835
|
}
|
|
5409
|
-
const veiKey = Symbol("_vei");
|
|
5836
|
+
const veiKey = /* @__PURE__ */ Symbol("_vei");
|
|
5410
5837
|
function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
5411
5838
|
const invokers = el[veiKey] || (el[veiKey] = {});
|
|
5412
5839
|
const existingInvoker = invokers[rawName];
|
|
5413
5840
|
if (nextValue && existingInvoker) existingInvoker.value = !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue;
|
|
5414
5841
|
else {
|
|
5415
5842
|
const [name, options] = parseName(rawName);
|
|
5416
|
-
if (nextValue)
|
|
5417
|
-
|
|
5418
|
-
addEventListener(el, name, invoker, options);
|
|
5419
|
-
} else if (existingInvoker) {
|
|
5843
|
+
if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(!!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue, instance), options);
|
|
5844
|
+
else if (existingInvoker) {
|
|
5420
5845
|
removeEventListener(el, name, existingInvoker, options);
|
|
5421
5846
|
invokers[rawName] = void 0;
|
|
5422
5847
|
}
|
|
@@ -5433,7 +5858,7 @@ function parseName(name) {
|
|
|
5433
5858
|
options[m[0].toLowerCase()] = true;
|
|
5434
5859
|
}
|
|
5435
5860
|
}
|
|
5436
|
-
return [name[2] === ":" ? name.slice(3) : hyphenate
|
|
5861
|
+
return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
|
|
5437
5862
|
}
|
|
5438
5863
|
let cachedNow = 0;
|
|
5439
5864
|
const p = /* @__PURE__ */ Promise.resolve();
|
|
@@ -5474,7 +5899,7 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
|
|
|
5474
5899
|
} else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
|
|
5475
5900
|
patchDOMProp(el, key, nextValue);
|
|
5476
5901
|
if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
|
|
5477
|
-
} else if (el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))) patchDOMProp(el, camelize
|
|
5902
|
+
} else if (el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))) patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
|
|
5478
5903
|
else {
|
|
5479
5904
|
if (key === "true-value") el._trueValue = nextValue;
|
|
5480
5905
|
else if (key === "false-value") el._falseValue = nextValue;
|
|
@@ -5488,6 +5913,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
5488
5913
|
return false;
|
|
5489
5914
|
}
|
|
5490
5915
|
if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") return false;
|
|
5916
|
+
if (key === "sandbox" && el.tagName === "IFRAME") return false;
|
|
5491
5917
|
if (key === "form") return false;
|
|
5492
5918
|
if (key === "list" && el.tagName === "INPUT") return false;
|
|
5493
5919
|
if (key === "type" && el.tagName === "TEXTAREA") return false;
|
|
@@ -5533,6 +5959,8 @@ var VueElement = class VueElement extends BaseClass {
|
|
|
5533
5959
|
this._nonce = this._def.nonce;
|
|
5534
5960
|
this._connected = false;
|
|
5535
5961
|
this._resolved = false;
|
|
5962
|
+
this._patching = false;
|
|
5963
|
+
this._dirty = false;
|
|
5536
5964
|
this._numberProps = null;
|
|
5537
5965
|
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
5538
5966
|
this._ob = null;
|
|
@@ -5599,53 +6027,53 @@ var VueElement = class VueElement extends BaseClass {
|
|
|
5599
6027
|
for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
|
|
5600
6028
|
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
5601
6029
|
this._ob.observe(this, { attributes: true });
|
|
5602
|
-
const resolve = (def
|
|
6030
|
+
const resolve = (def, isAsync = false) => {
|
|
5603
6031
|
this._resolved = true;
|
|
5604
6032
|
this._pendingResolve = void 0;
|
|
5605
|
-
const { props, styles } = def
|
|
6033
|
+
const { props, styles } = def;
|
|
5606
6034
|
let numberProps;
|
|
5607
6035
|
if (props && !isArray(props)) for (const key in props) {
|
|
5608
6036
|
const opt = props[key];
|
|
5609
6037
|
if (opt === Number || opt && opt.type === Number) {
|
|
5610
6038
|
if (key in this._props) this._props[key] = toNumber(this._props[key]);
|
|
5611
|
-
(numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize
|
|
6039
|
+
(numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
|
|
5612
6040
|
}
|
|
5613
6041
|
}
|
|
5614
6042
|
this._numberProps = numberProps;
|
|
5615
|
-
this._resolveProps(def
|
|
6043
|
+
this._resolveProps(def);
|
|
5616
6044
|
if (this.shadowRoot) this._applyStyles(styles);
|
|
5617
6045
|
else if (!!(process.env.NODE_ENV !== "production") && styles) warn("Custom element style injection is not supported when using shadowRoot: false");
|
|
5618
|
-
this._mount(def
|
|
6046
|
+
this._mount(def);
|
|
5619
6047
|
};
|
|
5620
6048
|
const asyncDef = this._def.__asyncLoader;
|
|
5621
|
-
if (asyncDef) this._pendingResolve = asyncDef().then((def
|
|
5622
|
-
def
|
|
5623
|
-
resolve(this._def = def
|
|
6049
|
+
if (asyncDef) this._pendingResolve = asyncDef().then((def) => {
|
|
6050
|
+
def.configureApp = this._def.configureApp;
|
|
6051
|
+
resolve(this._def = def, true);
|
|
5624
6052
|
});
|
|
5625
6053
|
else resolve(this._def);
|
|
5626
6054
|
}
|
|
5627
|
-
_mount(def
|
|
5628
|
-
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) && !def
|
|
5629
|
-
this._app = this._createApp(def
|
|
6055
|
+
_mount(def) {
|
|
6056
|
+
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) && !def.name) def.name = "VueElement";
|
|
6057
|
+
this._app = this._createApp(def);
|
|
5630
6058
|
this._inheritParentContext();
|
|
5631
|
-
if (def
|
|
6059
|
+
if (def.configureApp) def.configureApp(this._app);
|
|
5632
6060
|
this._app._ceVNode = this._createVNode();
|
|
5633
6061
|
this._app.mount(this._root);
|
|
5634
6062
|
const exposed = this._instance && this._instance.exposed;
|
|
5635
6063
|
if (!exposed) return;
|
|
5636
|
-
for (const key in exposed) if (!hasOwn
|
|
6064
|
+
for (const key in exposed) if (!hasOwn(this, key)) Object.defineProperty(this, key, { get: () => unref(exposed[key]) });
|
|
5637
6065
|
else if (!!(process.env.NODE_ENV !== "production")) warn(`Exposed property "${key}" already exists on custom element.`);
|
|
5638
6066
|
}
|
|
5639
|
-
_resolveProps(def
|
|
5640
|
-
const { props } = def
|
|
6067
|
+
_resolveProps(def) {
|
|
6068
|
+
const { props } = def;
|
|
5641
6069
|
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
5642
6070
|
for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
|
|
5643
|
-
for (const key of declaredPropKeys.map(camelize
|
|
6071
|
+
for (const key of declaredPropKeys.map(camelize)) Object.defineProperty(this, key, {
|
|
5644
6072
|
get() {
|
|
5645
6073
|
return this._getProp(key);
|
|
5646
6074
|
},
|
|
5647
6075
|
set(val) {
|
|
5648
|
-
this._setProp(key, val, true,
|
|
6076
|
+
this._setProp(key, val, true, !this._patching);
|
|
5649
6077
|
}
|
|
5650
6078
|
});
|
|
5651
6079
|
}
|
|
@@ -5653,7 +6081,7 @@ var VueElement = class VueElement extends BaseClass {
|
|
|
5653
6081
|
if (key.startsWith("data-v-")) return;
|
|
5654
6082
|
const has = this.hasAttribute(key);
|
|
5655
6083
|
let value = has ? this.getAttribute(key) : REMOVAL;
|
|
5656
|
-
const camelKey = camelize
|
|
6084
|
+
const camelKey = camelize(key);
|
|
5657
6085
|
if (has && this._numberProps && this._numberProps[camelKey]) value = toNumber(value);
|
|
5658
6086
|
this._setProp(camelKey, value, false, true);
|
|
5659
6087
|
}
|
|
@@ -5668,6 +6096,7 @@ var VueElement = class VueElement extends BaseClass {
|
|
|
5668
6096
|
*/
|
|
5669
6097
|
_setProp(key, val, shouldReflect = true, shouldUpdate = false) {
|
|
5670
6098
|
if (val !== this._props[key]) {
|
|
6099
|
+
this._dirty = true;
|
|
5671
6100
|
if (val === REMOVAL) delete this._props[key];
|
|
5672
6101
|
else {
|
|
5673
6102
|
this._props[key] = val;
|
|
@@ -5680,9 +6109,9 @@ var VueElement = class VueElement extends BaseClass {
|
|
|
5680
6109
|
this._processMutations(ob.takeRecords());
|
|
5681
6110
|
ob.disconnect();
|
|
5682
6111
|
}
|
|
5683
|
-
if (val === true) this.setAttribute(hyphenate
|
|
5684
|
-
else if (typeof val === "string" || typeof val === "number") this.setAttribute(hyphenate
|
|
5685
|
-
else if (!val) this.removeAttribute(hyphenate
|
|
6112
|
+
if (val === true) this.setAttribute(hyphenate(key), "");
|
|
6113
|
+
else if (typeof val === "string" || typeof val === "number") this.setAttribute(hyphenate(key), val + "");
|
|
6114
|
+
else if (!val) this.removeAttribute(hyphenate(key));
|
|
5686
6115
|
ob && ob.observe(this, { attributes: true });
|
|
5687
6116
|
}
|
|
5688
6117
|
}
|
|
@@ -5714,7 +6143,7 @@ var VueElement = class VueElement extends BaseClass {
|
|
|
5714
6143
|
};
|
|
5715
6144
|
instance.emit = (event, ...args) => {
|
|
5716
6145
|
dispatch(event, args);
|
|
5717
|
-
if (hyphenate
|
|
6146
|
+
if (hyphenate(event) !== event) dispatch(hyphenate(event), args);
|
|
5718
6147
|
};
|
|
5719
6148
|
this._setParent();
|
|
5720
6149
|
};
|
|
@@ -5785,10 +6214,12 @@ var VueElement = class VueElement extends BaseClass {
|
|
|
5785
6214
|
_getSlots() {
|
|
5786
6215
|
const roots = [this];
|
|
5787
6216
|
if (this._teleportTargets) roots.push(...this._teleportTargets);
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
6217
|
+
const slots = /* @__PURE__ */ new Set();
|
|
6218
|
+
for (const root of roots) {
|
|
6219
|
+
const found = root.querySelectorAll("slot");
|
|
6220
|
+
for (let i = 0; i < found.length; i++) slots.add(found[i]);
|
|
6221
|
+
}
|
|
6222
|
+
return Array.from(slots);
|
|
5792
6223
|
}
|
|
5793
6224
|
/**
|
|
5794
6225
|
* @internal
|
|
@@ -5799,6 +6230,20 @@ var VueElement = class VueElement extends BaseClass {
|
|
|
5799
6230
|
/**
|
|
5800
6231
|
* @internal
|
|
5801
6232
|
*/
|
|
6233
|
+
_beginPatch() {
|
|
6234
|
+
this._patching = true;
|
|
6235
|
+
this._dirty = false;
|
|
6236
|
+
}
|
|
6237
|
+
/**
|
|
6238
|
+
* @internal
|
|
6239
|
+
*/
|
|
6240
|
+
_endPatch() {
|
|
6241
|
+
this._patching = false;
|
|
6242
|
+
if (this._dirty && this._instance) this._update();
|
|
6243
|
+
}
|
|
6244
|
+
/**
|
|
6245
|
+
* @internal
|
|
6246
|
+
*/
|
|
5802
6247
|
_removeChildStyle(comp) {
|
|
5803
6248
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
5804
6249
|
this._styleChildren.delete(comp);
|
|
@@ -5812,9 +6257,6 @@ var VueElement = class VueElement extends BaseClass {
|
|
|
5812
6257
|
}
|
|
5813
6258
|
}
|
|
5814
6259
|
};
|
|
5815
|
-
const moveCbKey = Symbol("_moveCb");
|
|
5816
|
-
const enterCbKey = Symbol("_enterCb");
|
|
5817
|
-
const assignKey = Symbol("_assign");
|
|
5818
6260
|
const systemModifiers = [
|
|
5819
6261
|
"ctrl",
|
|
5820
6262
|
"shift",
|
|
@@ -5845,6 +6287,24 @@ const withModifiers = (fn, modifiers) => {
|
|
|
5845
6287
|
return fn(event, ...args);
|
|
5846
6288
|
}));
|
|
5847
6289
|
};
|
|
6290
|
+
const keyNames = {
|
|
6291
|
+
esc: "escape",
|
|
6292
|
+
space: " ",
|
|
6293
|
+
up: "arrow-up",
|
|
6294
|
+
left: "arrow-left",
|
|
6295
|
+
right: "arrow-right",
|
|
6296
|
+
down: "arrow-down",
|
|
6297
|
+
delete: "backspace"
|
|
6298
|
+
};
|
|
6299
|
+
const withKeys = (fn, modifiers) => {
|
|
6300
|
+
const cache = fn._withKeys || (fn._withKeys = {});
|
|
6301
|
+
const cacheKey = modifiers.join(".");
|
|
6302
|
+
return cache[cacheKey] || (cache[cacheKey] = ((event) => {
|
|
6303
|
+
if (!("key" in event)) return;
|
|
6304
|
+
const eventKey = hyphenate(event.key);
|
|
6305
|
+
if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) return fn(event);
|
|
6306
|
+
}));
|
|
6307
|
+
};
|
|
5848
6308
|
const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
|
|
5849
6309
|
let renderer;
|
|
5850
6310
|
function ensureRenderer() {
|
|
@@ -5923,728 +6383,16 @@ function normalizeContainer(container) {
|
|
|
5923
6383
|
}
|
|
5924
6384
|
|
|
5925
6385
|
//#endregion
|
|
5926
|
-
//#region ../../node_modules/.pnpm/vue@3.5.
|
|
6386
|
+
//#region ../../node_modules/.pnpm/vue@3.5.27_typescript@5.9.3/node_modules/vue/dist/vue.runtime.esm-bundler.js
|
|
6387
|
+
/**
|
|
6388
|
+
* vue v3.5.27
|
|
6389
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
6390
|
+
* @license MIT
|
|
6391
|
+
**/
|
|
5927
6392
|
function initDev() {
|
|
5928
6393
|
initCustomFormatter();
|
|
5929
6394
|
}
|
|
5930
6395
|
if (!!(process.env.NODE_ENV !== "production")) initDev();
|
|
5931
6396
|
|
|
5932
6397
|
//#endregion
|
|
5933
|
-
|
|
5934
|
-
function tryOnScopeDispose(fn) {
|
|
5935
|
-
if (getCurrentScope()) {
|
|
5936
|
-
onScopeDispose(fn);
|
|
5937
|
-
return true;
|
|
5938
|
-
}
|
|
5939
|
-
return false;
|
|
5940
|
-
}
|
|
5941
|
-
const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
|
|
5942
|
-
const injectLocal = /* @__NO_SIDE_EFFECTS__ */ (...args) => {
|
|
5943
|
-
var _a;
|
|
5944
|
-
const key = args[0];
|
|
5945
|
-
const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
|
|
5946
|
-
if (instance == null && !hasInjectionContext()) throw new Error("injectLocal must be called in setup");
|
|
5947
|
-
if (instance && localProvidedStateMap.has(instance) && key in localProvidedStateMap.get(instance)) return localProvidedStateMap.get(instance)[key];
|
|
5948
|
-
return inject(...args);
|
|
5949
|
-
};
|
|
5950
|
-
const isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
5951
|
-
const isWorker = typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
5952
|
-
const notNullish = (val) => val != null;
|
|
5953
|
-
const toString = Object.prototype.toString;
|
|
5954
|
-
const isObject = (val) => toString.call(val) === "[object Object]";
|
|
5955
|
-
const noop = () => {};
|
|
5956
|
-
function toRef(...args) {
|
|
5957
|
-
if (args.length !== 1) return toRef$1(...args);
|
|
5958
|
-
const r = args[0];
|
|
5959
|
-
return typeof r === "function" ? readonly(customRef(() => ({
|
|
5960
|
-
get: r,
|
|
5961
|
-
set: noop
|
|
5962
|
-
}))) : ref(r);
|
|
5963
|
-
}
|
|
5964
|
-
function createFilterWrapper(filter, fn) {
|
|
5965
|
-
function wrapper(...args) {
|
|
5966
|
-
return new Promise((resolve, reject) => {
|
|
5967
|
-
Promise.resolve(filter(() => fn.apply(this, args), {
|
|
5968
|
-
fn,
|
|
5969
|
-
thisArg: this,
|
|
5970
|
-
args
|
|
5971
|
-
})).then(resolve).catch(reject);
|
|
5972
|
-
});
|
|
5973
|
-
}
|
|
5974
|
-
return wrapper;
|
|
5975
|
-
}
|
|
5976
|
-
const bypassFilter = (invoke) => {
|
|
5977
|
-
return invoke();
|
|
5978
|
-
};
|
|
5979
|
-
function debounceFilter(ms, options = {}) {
|
|
5980
|
-
let timer;
|
|
5981
|
-
let maxTimer;
|
|
5982
|
-
let lastRejector = noop;
|
|
5983
|
-
const _clearTimeout = (timer2) => {
|
|
5984
|
-
clearTimeout(timer2);
|
|
5985
|
-
lastRejector();
|
|
5986
|
-
lastRejector = noop;
|
|
5987
|
-
};
|
|
5988
|
-
let lastInvoker;
|
|
5989
|
-
const filter = (invoke) => {
|
|
5990
|
-
const duration = toValue(ms);
|
|
5991
|
-
const maxDuration = toValue(options.maxWait);
|
|
5992
|
-
if (timer) _clearTimeout(timer);
|
|
5993
|
-
if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
|
|
5994
|
-
if (maxTimer) {
|
|
5995
|
-
_clearTimeout(maxTimer);
|
|
5996
|
-
maxTimer = void 0;
|
|
5997
|
-
}
|
|
5998
|
-
return Promise.resolve(invoke());
|
|
5999
|
-
}
|
|
6000
|
-
return new Promise((resolve, reject) => {
|
|
6001
|
-
lastRejector = options.rejectOnCancel ? reject : resolve;
|
|
6002
|
-
lastInvoker = invoke;
|
|
6003
|
-
if (maxDuration && !maxTimer) maxTimer = setTimeout(() => {
|
|
6004
|
-
if (timer) _clearTimeout(timer);
|
|
6005
|
-
maxTimer = void 0;
|
|
6006
|
-
resolve(lastInvoker());
|
|
6007
|
-
}, maxDuration);
|
|
6008
|
-
timer = setTimeout(() => {
|
|
6009
|
-
if (maxTimer) _clearTimeout(maxTimer);
|
|
6010
|
-
maxTimer = void 0;
|
|
6011
|
-
resolve(invoke());
|
|
6012
|
-
}, duration);
|
|
6013
|
-
});
|
|
6014
|
-
};
|
|
6015
|
-
return filter;
|
|
6016
|
-
}
|
|
6017
|
-
function pausableFilter(extendFilter = bypassFilter, options = {}) {
|
|
6018
|
-
const { initialState = "active" } = options;
|
|
6019
|
-
const isActive = toRef(initialState === "active");
|
|
6020
|
-
function pause() {
|
|
6021
|
-
isActive.value = false;
|
|
6022
|
-
}
|
|
6023
|
-
function resume() {
|
|
6024
|
-
isActive.value = true;
|
|
6025
|
-
}
|
|
6026
|
-
const eventFilter = (...args) => {
|
|
6027
|
-
if (isActive.value) extendFilter(...args);
|
|
6028
|
-
};
|
|
6029
|
-
return {
|
|
6030
|
-
isActive: readonly(isActive),
|
|
6031
|
-
pause,
|
|
6032
|
-
resume,
|
|
6033
|
-
eventFilter
|
|
6034
|
-
};
|
|
6035
|
-
}
|
|
6036
|
-
function pxValue(px) {
|
|
6037
|
-
return px.endsWith("rem") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);
|
|
6038
|
-
}
|
|
6039
|
-
function toArray(value) {
|
|
6040
|
-
return Array.isArray(value) ? value : [value];
|
|
6041
|
-
}
|
|
6042
|
-
function cacheStringFunction(fn) {
|
|
6043
|
-
const cache = /* @__PURE__ */ Object.create(null);
|
|
6044
|
-
return (str) => {
|
|
6045
|
-
return cache[str] || (cache[str] = fn(str));
|
|
6046
|
-
};
|
|
6047
|
-
}
|
|
6048
|
-
const hyphenateRE = /\B([A-Z])/g;
|
|
6049
|
-
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
6050
|
-
const camelizeRE = /-(\w)/g;
|
|
6051
|
-
const camelize = cacheStringFunction((str) => {
|
|
6052
|
-
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
|
|
6053
|
-
});
|
|
6054
|
-
function getLifeCycleTarget(target) {
|
|
6055
|
-
return target || getCurrentInstance();
|
|
6056
|
-
}
|
|
6057
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
6058
|
-
function useDebounceFn(fn, ms = 200, options = {}) {
|
|
6059
|
-
return createFilterWrapper(debounceFilter(ms, options), fn);
|
|
6060
|
-
}
|
|
6061
|
-
function watchWithFilter(source, cb, options = {}) {
|
|
6062
|
-
const { eventFilter = bypassFilter,...watchOptions } = options;
|
|
6063
|
-
return watch(source, createFilterWrapper(eventFilter, cb), watchOptions);
|
|
6064
|
-
}
|
|
6065
|
-
function watchPausable(source, cb, options = {}) {
|
|
6066
|
-
const { eventFilter: filter, initialState = "active",...watchOptions } = options;
|
|
6067
|
-
const { eventFilter, pause, resume, isActive } = pausableFilter(filter, { initialState });
|
|
6068
|
-
return {
|
|
6069
|
-
stop: watchWithFilter(source, cb, {
|
|
6070
|
-
...watchOptions,
|
|
6071
|
-
eventFilter
|
|
6072
|
-
}),
|
|
6073
|
-
pause,
|
|
6074
|
-
resume,
|
|
6075
|
-
isActive
|
|
6076
|
-
};
|
|
6077
|
-
}
|
|
6078
|
-
function toRefs(objectRef, options = {}) {
|
|
6079
|
-
if (!isRef(objectRef)) return toRefs$1(objectRef);
|
|
6080
|
-
const result = Array.isArray(objectRef.value) ? Array.from({ length: objectRef.value.length }) : {};
|
|
6081
|
-
for (const key in objectRef.value) result[key] = customRef(() => ({
|
|
6082
|
-
get() {
|
|
6083
|
-
return objectRef.value[key];
|
|
6084
|
-
},
|
|
6085
|
-
set(v) {
|
|
6086
|
-
var _a;
|
|
6087
|
-
if ((_a = toValue(options.replaceRef)) != null ? _a : true) if (Array.isArray(objectRef.value)) {
|
|
6088
|
-
const copy = [...objectRef.value];
|
|
6089
|
-
copy[key] = v;
|
|
6090
|
-
objectRef.value = copy;
|
|
6091
|
-
} else {
|
|
6092
|
-
const newObject = {
|
|
6093
|
-
...objectRef.value,
|
|
6094
|
-
[key]: v
|
|
6095
|
-
};
|
|
6096
|
-
Object.setPrototypeOf(newObject, Object.getPrototypeOf(objectRef.value));
|
|
6097
|
-
objectRef.value = newObject;
|
|
6098
|
-
}
|
|
6099
|
-
else objectRef.value[key] = v;
|
|
6100
|
-
}
|
|
6101
|
-
}));
|
|
6102
|
-
return result;
|
|
6103
|
-
}
|
|
6104
|
-
function tryOnMounted(fn, sync = true, target) {
|
|
6105
|
-
if (getLifeCycleTarget(target)) onMounted(fn, target);
|
|
6106
|
-
else if (sync) fn();
|
|
6107
|
-
else nextTick(fn);
|
|
6108
|
-
}
|
|
6109
|
-
function watchImmediate(source, cb, options) {
|
|
6110
|
-
return watch(source, cb, {
|
|
6111
|
-
...options,
|
|
6112
|
-
immediate: true
|
|
6113
|
-
});
|
|
6114
|
-
}
|
|
6115
|
-
|
|
6116
|
-
//#endregion
|
|
6117
|
-
//#region ../../node_modules/.pnpm/@vueuse+core@13.9.0_vue@3.5.22_typescript@5.9.3_/node_modules/@vueuse/core/index.mjs
|
|
6118
|
-
const defaultWindow = isClient ? window : void 0;
|
|
6119
|
-
const defaultDocument = isClient ? window.document : void 0;
|
|
6120
|
-
const defaultNavigator = isClient ? window.navigator : void 0;
|
|
6121
|
-
const defaultLocation = isClient ? window.location : void 0;
|
|
6122
|
-
function unrefElement(elRef) {
|
|
6123
|
-
var _a;
|
|
6124
|
-
const plain = toValue(elRef);
|
|
6125
|
-
return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
|
|
6126
|
-
}
|
|
6127
|
-
function useEventListener(...args) {
|
|
6128
|
-
const cleanups = [];
|
|
6129
|
-
const cleanup = () => {
|
|
6130
|
-
cleanups.forEach((fn) => fn());
|
|
6131
|
-
cleanups.length = 0;
|
|
6132
|
-
};
|
|
6133
|
-
const register = (el, event, listener, options) => {
|
|
6134
|
-
el.addEventListener(event, listener, options);
|
|
6135
|
-
return () => el.removeEventListener(event, listener, options);
|
|
6136
|
-
};
|
|
6137
|
-
const firstParamTargets = computed(() => {
|
|
6138
|
-
const test = toArray(toValue(args[0])).filter((e) => e != null);
|
|
6139
|
-
return test.every((e) => typeof e !== "string") ? test : void 0;
|
|
6140
|
-
});
|
|
6141
|
-
const stopWatch = watchImmediate(() => {
|
|
6142
|
-
var _a, _b;
|
|
6143
|
-
return [
|
|
6144
|
-
(_b = (_a = firstParamTargets.value) == null ? void 0 : _a.map((e) => unrefElement(e))) != null ? _b : [defaultWindow].filter((e) => e != null),
|
|
6145
|
-
toArray(toValue(firstParamTargets.value ? args[1] : args[0])),
|
|
6146
|
-
toArray(unref(firstParamTargets.value ? args[2] : args[1])),
|
|
6147
|
-
toValue(firstParamTargets.value ? args[3] : args[2])
|
|
6148
|
-
];
|
|
6149
|
-
}, ([raw_targets, raw_events, raw_listeners, raw_options]) => {
|
|
6150
|
-
cleanup();
|
|
6151
|
-
if (!(raw_targets == null ? void 0 : raw_targets.length) || !(raw_events == null ? void 0 : raw_events.length) || !(raw_listeners == null ? void 0 : raw_listeners.length)) return;
|
|
6152
|
-
const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;
|
|
6153
|
-
cleanups.push(...raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone)))));
|
|
6154
|
-
}, { flush: "post" });
|
|
6155
|
-
const stop$1 = () => {
|
|
6156
|
-
stopWatch();
|
|
6157
|
-
cleanup();
|
|
6158
|
-
};
|
|
6159
|
-
tryOnScopeDispose(cleanup);
|
|
6160
|
-
return stop$1;
|
|
6161
|
-
}
|
|
6162
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
6163
|
-
function useMounted() {
|
|
6164
|
-
const isMounted = shallowRef(false);
|
|
6165
|
-
const instance = getCurrentInstance();
|
|
6166
|
-
if (instance) onMounted(() => {
|
|
6167
|
-
isMounted.value = true;
|
|
6168
|
-
}, instance);
|
|
6169
|
-
return isMounted;
|
|
6170
|
-
}
|
|
6171
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
6172
|
-
function useSupported(callback) {
|
|
6173
|
-
const isMounted = /* @__PURE__ */ useMounted();
|
|
6174
|
-
return computed(() => {
|
|
6175
|
-
isMounted.value;
|
|
6176
|
-
return Boolean(callback());
|
|
6177
|
-
});
|
|
6178
|
-
}
|
|
6179
|
-
function useMutationObserver(target, callback, options = {}) {
|
|
6180
|
-
const { window: window$1 = defaultWindow,...mutationOptions } = options;
|
|
6181
|
-
let observer;
|
|
6182
|
-
const isSupported$1 = /* @__PURE__ */ useSupported(() => window$1 && "MutationObserver" in window$1);
|
|
6183
|
-
const cleanup = () => {
|
|
6184
|
-
if (observer) {
|
|
6185
|
-
observer.disconnect();
|
|
6186
|
-
observer = void 0;
|
|
6187
|
-
}
|
|
6188
|
-
};
|
|
6189
|
-
const targets = computed(() => {
|
|
6190
|
-
const value = toValue(target);
|
|
6191
|
-
const items = toArray(value).map(unrefElement).filter(notNullish);
|
|
6192
|
-
return new Set(items);
|
|
6193
|
-
});
|
|
6194
|
-
const stopWatch = watch(targets, (newTargets) => {
|
|
6195
|
-
cleanup();
|
|
6196
|
-
if (isSupported$1.value && newTargets.size) {
|
|
6197
|
-
observer = new MutationObserver(callback);
|
|
6198
|
-
newTargets.forEach((el) => observer.observe(el, mutationOptions));
|
|
6199
|
-
}
|
|
6200
|
-
}, {
|
|
6201
|
-
immediate: true,
|
|
6202
|
-
flush: "post"
|
|
6203
|
-
});
|
|
6204
|
-
const takeRecords = () => {
|
|
6205
|
-
return observer == null ? void 0 : observer.takeRecords();
|
|
6206
|
-
};
|
|
6207
|
-
const stop$1 = () => {
|
|
6208
|
-
stopWatch();
|
|
6209
|
-
cleanup();
|
|
6210
|
-
};
|
|
6211
|
-
tryOnScopeDispose(stop$1);
|
|
6212
|
-
return {
|
|
6213
|
-
isSupported: isSupported$1,
|
|
6214
|
-
stop: stop$1,
|
|
6215
|
-
takeRecords
|
|
6216
|
-
};
|
|
6217
|
-
}
|
|
6218
|
-
const ssrWidthSymbol = Symbol("vueuse-ssr-width");
|
|
6219
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
6220
|
-
function useSSRWidth() {
|
|
6221
|
-
const ssrWidth = hasInjectionContext() ? injectLocal(ssrWidthSymbol, null) : null;
|
|
6222
|
-
return typeof ssrWidth === "number" ? ssrWidth : void 0;
|
|
6223
|
-
}
|
|
6224
|
-
function useMediaQuery(query, options = {}) {
|
|
6225
|
-
const { window: window$1 = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
|
|
6226
|
-
const isSupported$1 = /* @__PURE__ */ useSupported(() => window$1 && "matchMedia" in window$1 && typeof window$1.matchMedia === "function");
|
|
6227
|
-
const ssrSupport = shallowRef(typeof ssrWidth === "number");
|
|
6228
|
-
const mediaQuery = shallowRef();
|
|
6229
|
-
const matches = shallowRef(false);
|
|
6230
|
-
const handler = (event) => {
|
|
6231
|
-
matches.value = event.matches;
|
|
6232
|
-
};
|
|
6233
|
-
watchEffect(() => {
|
|
6234
|
-
if (ssrSupport.value) {
|
|
6235
|
-
ssrSupport.value = !isSupported$1.value;
|
|
6236
|
-
matches.value = toValue(query).split(",").some((queryString) => {
|
|
6237
|
-
const not = queryString.includes("not all");
|
|
6238
|
-
const minWidth = queryString.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
|
|
6239
|
-
const maxWidth = queryString.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
|
|
6240
|
-
let res = Boolean(minWidth || maxWidth);
|
|
6241
|
-
if (minWidth && res) res = ssrWidth >= pxValue(minWidth[1]);
|
|
6242
|
-
if (maxWidth && res) res = ssrWidth <= pxValue(maxWidth[1]);
|
|
6243
|
-
return not ? !res : res;
|
|
6244
|
-
});
|
|
6245
|
-
return;
|
|
6246
|
-
}
|
|
6247
|
-
if (!isSupported$1.value) return;
|
|
6248
|
-
mediaQuery.value = window$1.matchMedia(toValue(query));
|
|
6249
|
-
matches.value = mediaQuery.value.matches;
|
|
6250
|
-
});
|
|
6251
|
-
useEventListener(mediaQuery, "change", handler, { passive: true });
|
|
6252
|
-
return computed(() => matches.value);
|
|
6253
|
-
}
|
|
6254
|
-
const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
6255
|
-
const globalKey = "__vueuse_ssr_handlers__";
|
|
6256
|
-
const handlers = /* @__PURE__ */ getHandlers();
|
|
6257
|
-
function getHandlers() {
|
|
6258
|
-
if (!(globalKey in _global)) _global[globalKey] = _global[globalKey] || {};
|
|
6259
|
-
return _global[globalKey];
|
|
6260
|
-
}
|
|
6261
|
-
function getSSRHandler(key, fallback) {
|
|
6262
|
-
return handlers[key] || fallback;
|
|
6263
|
-
}
|
|
6264
|
-
function guessSerializerType(rawInit) {
|
|
6265
|
-
return rawInit == null ? "any" : rawInit instanceof Set ? "set" : rawInit instanceof Map ? "map" : rawInit instanceof Date ? "date" : typeof rawInit === "boolean" ? "boolean" : typeof rawInit === "string" ? "string" : typeof rawInit === "object" ? "object" : !Number.isNaN(rawInit) ? "number" : "any";
|
|
6266
|
-
}
|
|
6267
|
-
const StorageSerializers = {
|
|
6268
|
-
boolean: {
|
|
6269
|
-
read: (v) => v === "true",
|
|
6270
|
-
write: (v) => String(v)
|
|
6271
|
-
},
|
|
6272
|
-
object: {
|
|
6273
|
-
read: (v) => JSON.parse(v),
|
|
6274
|
-
write: (v) => JSON.stringify(v)
|
|
6275
|
-
},
|
|
6276
|
-
number: {
|
|
6277
|
-
read: (v) => Number.parseFloat(v),
|
|
6278
|
-
write: (v) => String(v)
|
|
6279
|
-
},
|
|
6280
|
-
any: {
|
|
6281
|
-
read: (v) => v,
|
|
6282
|
-
write: (v) => String(v)
|
|
6283
|
-
},
|
|
6284
|
-
string: {
|
|
6285
|
-
read: (v) => v,
|
|
6286
|
-
write: (v) => String(v)
|
|
6287
|
-
},
|
|
6288
|
-
map: {
|
|
6289
|
-
read: (v) => new Map(JSON.parse(v)),
|
|
6290
|
-
write: (v) => JSON.stringify(Array.from(v.entries()))
|
|
6291
|
-
},
|
|
6292
|
-
set: {
|
|
6293
|
-
read: (v) => new Set(JSON.parse(v)),
|
|
6294
|
-
write: (v) => JSON.stringify(Array.from(v))
|
|
6295
|
-
},
|
|
6296
|
-
date: {
|
|
6297
|
-
read: (v) => new Date(v),
|
|
6298
|
-
write: (v) => v.toISOString()
|
|
6299
|
-
}
|
|
6300
|
-
};
|
|
6301
|
-
const customStorageEventName = "vueuse-storage";
|
|
6302
|
-
function useStorage(key, defaults, storage, options = {}) {
|
|
6303
|
-
var _a;
|
|
6304
|
-
const { flush = "pre", deep = true, listenToStorageChanges = true, writeDefaults = true, mergeDefaults = false, shallow, window: window$1 = defaultWindow, eventFilter, onError = (e) => {
|
|
6305
|
-
console.error(e);
|
|
6306
|
-
}, initOnMounted } = options;
|
|
6307
|
-
const data = (shallow ? shallowRef : ref)(typeof defaults === "function" ? defaults() : defaults);
|
|
6308
|
-
const keyComputed = computed(() => toValue(key));
|
|
6309
|
-
if (!storage) try {
|
|
6310
|
-
storage = getSSRHandler("getDefaultStorage", () => {
|
|
6311
|
-
var _a2;
|
|
6312
|
-
return (_a2 = defaultWindow) == null ? void 0 : _a2.localStorage;
|
|
6313
|
-
})();
|
|
6314
|
-
} catch (e) {
|
|
6315
|
-
onError(e);
|
|
6316
|
-
}
|
|
6317
|
-
if (!storage) return data;
|
|
6318
|
-
const rawInit = toValue(defaults);
|
|
6319
|
-
const type = guessSerializerType(rawInit);
|
|
6320
|
-
const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];
|
|
6321
|
-
const { pause: pauseWatch, resume: resumeWatch } = watchPausable(data, (newValue) => write(newValue), {
|
|
6322
|
-
flush,
|
|
6323
|
-
deep,
|
|
6324
|
-
eventFilter
|
|
6325
|
-
});
|
|
6326
|
-
watch(keyComputed, () => update(), { flush });
|
|
6327
|
-
let firstMounted = false;
|
|
6328
|
-
const onStorageEvent = (ev) => {
|
|
6329
|
-
if (initOnMounted && !firstMounted) return;
|
|
6330
|
-
update(ev);
|
|
6331
|
-
};
|
|
6332
|
-
const onStorageCustomEvent = (ev) => {
|
|
6333
|
-
if (initOnMounted && !firstMounted) return;
|
|
6334
|
-
updateFromCustomEvent(ev);
|
|
6335
|
-
};
|
|
6336
|
-
if (window$1 && listenToStorageChanges) if (storage instanceof Storage) useEventListener(window$1, "storage", onStorageEvent, { passive: true });
|
|
6337
|
-
else useEventListener(window$1, customStorageEventName, onStorageCustomEvent);
|
|
6338
|
-
if (initOnMounted) tryOnMounted(() => {
|
|
6339
|
-
firstMounted = true;
|
|
6340
|
-
update();
|
|
6341
|
-
});
|
|
6342
|
-
else update();
|
|
6343
|
-
function dispatchWriteEvent(oldValue, newValue) {
|
|
6344
|
-
if (window$1) {
|
|
6345
|
-
const payload = {
|
|
6346
|
-
key: keyComputed.value,
|
|
6347
|
-
oldValue,
|
|
6348
|
-
newValue,
|
|
6349
|
-
storageArea: storage
|
|
6350
|
-
};
|
|
6351
|
-
window$1.dispatchEvent(storage instanceof Storage ? new StorageEvent("storage", payload) : new CustomEvent(customStorageEventName, { detail: payload }));
|
|
6352
|
-
}
|
|
6353
|
-
}
|
|
6354
|
-
function write(v) {
|
|
6355
|
-
try {
|
|
6356
|
-
const oldValue = storage.getItem(keyComputed.value);
|
|
6357
|
-
if (v == null) {
|
|
6358
|
-
dispatchWriteEvent(oldValue, null);
|
|
6359
|
-
storage.removeItem(keyComputed.value);
|
|
6360
|
-
} else {
|
|
6361
|
-
const serialized = serializer.write(v);
|
|
6362
|
-
if (oldValue !== serialized) {
|
|
6363
|
-
storage.setItem(keyComputed.value, serialized);
|
|
6364
|
-
dispatchWriteEvent(oldValue, serialized);
|
|
6365
|
-
}
|
|
6366
|
-
}
|
|
6367
|
-
} catch (e) {
|
|
6368
|
-
onError(e);
|
|
6369
|
-
}
|
|
6370
|
-
}
|
|
6371
|
-
function read(event) {
|
|
6372
|
-
const rawValue = event ? event.newValue : storage.getItem(keyComputed.value);
|
|
6373
|
-
if (rawValue == null) {
|
|
6374
|
-
if (writeDefaults && rawInit != null) storage.setItem(keyComputed.value, serializer.write(rawInit));
|
|
6375
|
-
return rawInit;
|
|
6376
|
-
} else if (!event && mergeDefaults) {
|
|
6377
|
-
const value = serializer.read(rawValue);
|
|
6378
|
-
if (typeof mergeDefaults === "function") return mergeDefaults(value, rawInit);
|
|
6379
|
-
else if (type === "object" && !Array.isArray(value)) return {
|
|
6380
|
-
...rawInit,
|
|
6381
|
-
...value
|
|
6382
|
-
};
|
|
6383
|
-
return value;
|
|
6384
|
-
} else if (typeof rawValue !== "string") return rawValue;
|
|
6385
|
-
else return serializer.read(rawValue);
|
|
6386
|
-
}
|
|
6387
|
-
function update(event) {
|
|
6388
|
-
if (event && event.storageArea !== storage) return;
|
|
6389
|
-
if (event && event.key == null) {
|
|
6390
|
-
data.value = rawInit;
|
|
6391
|
-
return;
|
|
6392
|
-
}
|
|
6393
|
-
if (event && event.key !== keyComputed.value) return;
|
|
6394
|
-
pauseWatch();
|
|
6395
|
-
try {
|
|
6396
|
-
const serializedData = serializer.write(data.value);
|
|
6397
|
-
if (event === void 0 || (event == null ? void 0 : event.newValue) !== serializedData) data.value = read(event);
|
|
6398
|
-
} catch (e) {
|
|
6399
|
-
onError(e);
|
|
6400
|
-
} finally {
|
|
6401
|
-
if (event) nextTick(resumeWatch);
|
|
6402
|
-
else resumeWatch();
|
|
6403
|
-
}
|
|
6404
|
-
}
|
|
6405
|
-
function updateFromCustomEvent(event) {
|
|
6406
|
-
update(event.detail);
|
|
6407
|
-
}
|
|
6408
|
-
return data;
|
|
6409
|
-
}
|
|
6410
|
-
function useCssVar(prop, target, options = {}) {
|
|
6411
|
-
const { window: window$1 = defaultWindow, initialValue, observe = false } = options;
|
|
6412
|
-
const variable = shallowRef(initialValue);
|
|
6413
|
-
const elRef = computed(() => {
|
|
6414
|
-
var _a;
|
|
6415
|
-
return unrefElement(target) || ((_a = window$1 == null ? void 0 : window$1.document) == null ? void 0 : _a.documentElement);
|
|
6416
|
-
});
|
|
6417
|
-
function updateCssVar() {
|
|
6418
|
-
var _a;
|
|
6419
|
-
const key = toValue(prop);
|
|
6420
|
-
const el = toValue(elRef);
|
|
6421
|
-
if (el && window$1 && key) variable.value = ((_a = window$1.getComputedStyle(el).getPropertyValue(key)) == null ? void 0 : _a.trim()) || variable.value || initialValue;
|
|
6422
|
-
}
|
|
6423
|
-
if (observe) useMutationObserver(elRef, updateCssVar, {
|
|
6424
|
-
attributeFilter: ["style", "class"],
|
|
6425
|
-
window: window$1
|
|
6426
|
-
});
|
|
6427
|
-
watch([elRef, () => toValue(prop)], (_, old) => {
|
|
6428
|
-
if (old[0] && old[1]) old[0].style.removeProperty(old[1]);
|
|
6429
|
-
updateCssVar();
|
|
6430
|
-
}, { immediate: true });
|
|
6431
|
-
watch([variable, elRef], ([val, el]) => {
|
|
6432
|
-
const raw_prop = toValue(prop);
|
|
6433
|
-
if ((el == null ? void 0 : el.style) && raw_prop) if (val == null) el.style.removeProperty(raw_prop);
|
|
6434
|
-
else el.style.setProperty(raw_prop, val);
|
|
6435
|
-
}, { immediate: true });
|
|
6436
|
-
return variable;
|
|
6437
|
-
}
|
|
6438
|
-
function useResizeObserver(target, callback, options = {}) {
|
|
6439
|
-
const { window: window$1 = defaultWindow,...observerOptions } = options;
|
|
6440
|
-
let observer;
|
|
6441
|
-
const isSupported$1 = /* @__PURE__ */ useSupported(() => window$1 && "ResizeObserver" in window$1);
|
|
6442
|
-
const cleanup = () => {
|
|
6443
|
-
if (observer) {
|
|
6444
|
-
observer.disconnect();
|
|
6445
|
-
observer = void 0;
|
|
6446
|
-
}
|
|
6447
|
-
};
|
|
6448
|
-
const targets = computed(() => {
|
|
6449
|
-
const _targets = toValue(target);
|
|
6450
|
-
return Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];
|
|
6451
|
-
});
|
|
6452
|
-
const stopWatch = watch(targets, (els) => {
|
|
6453
|
-
cleanup();
|
|
6454
|
-
if (isSupported$1.value && window$1) {
|
|
6455
|
-
observer = new ResizeObserver(callback);
|
|
6456
|
-
for (const _el of els) if (_el) observer.observe(_el, observerOptions);
|
|
6457
|
-
}
|
|
6458
|
-
}, {
|
|
6459
|
-
immediate: true,
|
|
6460
|
-
flush: "post"
|
|
6461
|
-
});
|
|
6462
|
-
const stop$1 = () => {
|
|
6463
|
-
cleanup();
|
|
6464
|
-
stopWatch();
|
|
6465
|
-
};
|
|
6466
|
-
tryOnScopeDispose(stop$1);
|
|
6467
|
-
return {
|
|
6468
|
-
isSupported: isSupported$1,
|
|
6469
|
-
stop: stop$1
|
|
6470
|
-
};
|
|
6471
|
-
}
|
|
6472
|
-
function useElementBounding(target, options = {}) {
|
|
6473
|
-
const { reset = true, windowResize = true, windowScroll = true, immediate = true, updateTiming = "sync" } = options;
|
|
6474
|
-
const height = shallowRef(0);
|
|
6475
|
-
const bottom = shallowRef(0);
|
|
6476
|
-
const left = shallowRef(0);
|
|
6477
|
-
const right = shallowRef(0);
|
|
6478
|
-
const top = shallowRef(0);
|
|
6479
|
-
const width = shallowRef(0);
|
|
6480
|
-
const x = shallowRef(0);
|
|
6481
|
-
const y = shallowRef(0);
|
|
6482
|
-
function recalculate() {
|
|
6483
|
-
const el = unrefElement(target);
|
|
6484
|
-
if (!el) {
|
|
6485
|
-
if (reset) {
|
|
6486
|
-
height.value = 0;
|
|
6487
|
-
bottom.value = 0;
|
|
6488
|
-
left.value = 0;
|
|
6489
|
-
right.value = 0;
|
|
6490
|
-
top.value = 0;
|
|
6491
|
-
width.value = 0;
|
|
6492
|
-
x.value = 0;
|
|
6493
|
-
y.value = 0;
|
|
6494
|
-
}
|
|
6495
|
-
return;
|
|
6496
|
-
}
|
|
6497
|
-
const rect = el.getBoundingClientRect();
|
|
6498
|
-
height.value = rect.height;
|
|
6499
|
-
bottom.value = rect.bottom;
|
|
6500
|
-
left.value = rect.left;
|
|
6501
|
-
right.value = rect.right;
|
|
6502
|
-
top.value = rect.top;
|
|
6503
|
-
width.value = rect.width;
|
|
6504
|
-
x.value = rect.x;
|
|
6505
|
-
y.value = rect.y;
|
|
6506
|
-
}
|
|
6507
|
-
function update() {
|
|
6508
|
-
if (updateTiming === "sync") recalculate();
|
|
6509
|
-
else if (updateTiming === "next-frame") requestAnimationFrame(() => recalculate());
|
|
6510
|
-
}
|
|
6511
|
-
useResizeObserver(target, update);
|
|
6512
|
-
watch(() => unrefElement(target), (ele) => !ele && update());
|
|
6513
|
-
useMutationObserver(target, update, { attributeFilter: ["style", "class"] });
|
|
6514
|
-
if (windowScroll) useEventListener("scroll", update, {
|
|
6515
|
-
capture: true,
|
|
6516
|
-
passive: true
|
|
6517
|
-
});
|
|
6518
|
-
if (windowResize) useEventListener("resize", update, { passive: true });
|
|
6519
|
-
tryOnMounted(() => {
|
|
6520
|
-
if (immediate) update();
|
|
6521
|
-
});
|
|
6522
|
-
return {
|
|
6523
|
-
height,
|
|
6524
|
-
bottom,
|
|
6525
|
-
left,
|
|
6526
|
-
right,
|
|
6527
|
-
top,
|
|
6528
|
-
width,
|
|
6529
|
-
x,
|
|
6530
|
-
y,
|
|
6531
|
-
update
|
|
6532
|
-
};
|
|
6533
|
-
}
|
|
6534
|
-
function useLocalStorage(key, initialValue, options = {}) {
|
|
6535
|
-
const { window: window$1 = defaultWindow } = options;
|
|
6536
|
-
return useStorage(key, initialValue, window$1 == null ? void 0 : window$1.localStorage, options);
|
|
6537
|
-
}
|
|
6538
|
-
const topVarName = "--vueuse-safe-area-top";
|
|
6539
|
-
const rightVarName = "--vueuse-safe-area-right";
|
|
6540
|
-
const bottomVarName = "--vueuse-safe-area-bottom";
|
|
6541
|
-
const leftVarName = "--vueuse-safe-area-left";
|
|
6542
|
-
function useScreenSafeArea() {
|
|
6543
|
-
const top = shallowRef("");
|
|
6544
|
-
const right = shallowRef("");
|
|
6545
|
-
const bottom = shallowRef("");
|
|
6546
|
-
const left = shallowRef("");
|
|
6547
|
-
if (isClient) {
|
|
6548
|
-
const topCssVar = useCssVar(topVarName);
|
|
6549
|
-
const rightCssVar = useCssVar(rightVarName);
|
|
6550
|
-
const bottomCssVar = useCssVar(bottomVarName);
|
|
6551
|
-
const leftCssVar = useCssVar(leftVarName);
|
|
6552
|
-
topCssVar.value = "env(safe-area-inset-top, 0px)";
|
|
6553
|
-
rightCssVar.value = "env(safe-area-inset-right, 0px)";
|
|
6554
|
-
bottomCssVar.value = "env(safe-area-inset-bottom, 0px)";
|
|
6555
|
-
leftCssVar.value = "env(safe-area-inset-left, 0px)";
|
|
6556
|
-
tryOnMounted(update);
|
|
6557
|
-
useEventListener("resize", useDebounceFn(update), { passive: true });
|
|
6558
|
-
}
|
|
6559
|
-
function update() {
|
|
6560
|
-
top.value = getValue(topVarName);
|
|
6561
|
-
right.value = getValue(rightVarName);
|
|
6562
|
-
bottom.value = getValue(bottomVarName);
|
|
6563
|
-
left.value = getValue(leftVarName);
|
|
6564
|
-
}
|
|
6565
|
-
return {
|
|
6566
|
-
top,
|
|
6567
|
-
right,
|
|
6568
|
-
bottom,
|
|
6569
|
-
left,
|
|
6570
|
-
update
|
|
6571
|
-
};
|
|
6572
|
-
}
|
|
6573
|
-
function getValue(position) {
|
|
6574
|
-
return getComputedStyle(document.documentElement).getPropertyValue(position);
|
|
6575
|
-
}
|
|
6576
|
-
const DEFAULT_UNITS = [
|
|
6577
|
-
{
|
|
6578
|
-
max: 6e4,
|
|
6579
|
-
value: 1e3,
|
|
6580
|
-
name: "second"
|
|
6581
|
-
},
|
|
6582
|
-
{
|
|
6583
|
-
max: 276e4,
|
|
6584
|
-
value: 6e4,
|
|
6585
|
-
name: "minute"
|
|
6586
|
-
},
|
|
6587
|
-
{
|
|
6588
|
-
max: 72e6,
|
|
6589
|
-
value: 36e5,
|
|
6590
|
-
name: "hour"
|
|
6591
|
-
},
|
|
6592
|
-
{
|
|
6593
|
-
max: 5184e5,
|
|
6594
|
-
value: 864e5,
|
|
6595
|
-
name: "day"
|
|
6596
|
-
},
|
|
6597
|
-
{
|
|
6598
|
-
max: 24192e5,
|
|
6599
|
-
value: 6048e5,
|
|
6600
|
-
name: "week"
|
|
6601
|
-
},
|
|
6602
|
-
{
|
|
6603
|
-
max: 28512e6,
|
|
6604
|
-
value: 2592e6,
|
|
6605
|
-
name: "month"
|
|
6606
|
-
},
|
|
6607
|
-
{
|
|
6608
|
-
max: Number.POSITIVE_INFINITY,
|
|
6609
|
-
value: 31536e6,
|
|
6610
|
-
name: "year"
|
|
6611
|
-
}
|
|
6612
|
-
];
|
|
6613
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
6614
|
-
function useWindowSize(options = {}) {
|
|
6615
|
-
const { window: window$1 = defaultWindow, initialWidth = Number.POSITIVE_INFINITY, initialHeight = Number.POSITIVE_INFINITY, listenOrientation = true, includeScrollbar = true, type = "inner" } = options;
|
|
6616
|
-
const width = shallowRef(initialWidth);
|
|
6617
|
-
const height = shallowRef(initialHeight);
|
|
6618
|
-
const update = () => {
|
|
6619
|
-
if (window$1) if (type === "outer") {
|
|
6620
|
-
width.value = window$1.outerWidth;
|
|
6621
|
-
height.value = window$1.outerHeight;
|
|
6622
|
-
} else if (type === "visual" && window$1.visualViewport) {
|
|
6623
|
-
const { width: visualViewportWidth, height: visualViewportHeight, scale } = window$1.visualViewport;
|
|
6624
|
-
width.value = Math.round(visualViewportWidth * scale);
|
|
6625
|
-
height.value = Math.round(visualViewportHeight * scale);
|
|
6626
|
-
} else if (includeScrollbar) {
|
|
6627
|
-
width.value = window$1.innerWidth;
|
|
6628
|
-
height.value = window$1.innerHeight;
|
|
6629
|
-
} else {
|
|
6630
|
-
width.value = window$1.document.documentElement.clientWidth;
|
|
6631
|
-
height.value = window$1.document.documentElement.clientHeight;
|
|
6632
|
-
}
|
|
6633
|
-
};
|
|
6634
|
-
update();
|
|
6635
|
-
tryOnMounted(update);
|
|
6636
|
-
const listenerOptions = { passive: true };
|
|
6637
|
-
useEventListener("resize", update, listenerOptions);
|
|
6638
|
-
if (window$1 && type === "visual" && window$1.visualViewport) useEventListener(window$1.visualViewport, "resize", update, listenerOptions);
|
|
6639
|
-
if (listenOrientation) {
|
|
6640
|
-
const matches = useMediaQuery("(orientation: portrait)");
|
|
6641
|
-
watch(matches, () => update());
|
|
6642
|
-
}
|
|
6643
|
-
return {
|
|
6644
|
-
width,
|
|
6645
|
-
height
|
|
6646
|
-
};
|
|
6647
|
-
}
|
|
6648
|
-
|
|
6649
|
-
//#endregion
|
|
6650
|
-
export { Fragment, computed, createBaseVNode, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, defineCustomElement, markRaw, mergeModels, nextTick, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, reactive, ref, renderList, renderSlot, toDisplayString, toRefs, toRefs$1, unref, useElementBounding, useEventListener, useLocalStorage, useModel, useScreenSafeArea, useTemplateRef, useWindowSize, vShow, watch, watchEffect, withCtx, withDirectives, withModifiers };
|
|
6398
|
+
export { withCtx as A, toRef as B, onUnmounted as C, useTemplateRef as D, renderSlot as E, onScopeDispose as F, normalizeStyle as G, toValue as H, reactive as I, toDisplayString as K, readonly as L, customRef as M, getCurrentScope as N, watch as O, markRaw as P, ref as R, onMounted as S, renderList as T, unref as U, toRefs as V, normalizeClass as W, getCurrentInstance as _, Fragment as a, inject as b, createBaseVNode as c, createElementBlock as d, createStaticVNode as f, defineComponent as g, defineAsyncComponent as h, withModifiers as i, withDirectives as j, watchEffect as k, createBlock as l, createVNode as m, vShow as n, Suspense as o, createTextVNode as p, withKeys as r, computed as s, defineCustomElement as t, createCommentVNode as u, h as v, openBlock as w, nextTick as x, hasInjectionContext as y, shallowRef as z };
|