@reactive-vscode/reactivity 1.0.0-beta.1 → 1.0.0
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/index.cjs +1659 -2069
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +21 -14
- package/dist/index.js +1660 -2123
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -1,2225 +1,1814 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
|
|
2
|
+
//#region ../../node_modules/.pnpm/@vue+shared@3.5.32/node_modules/@vue/shared/dist/shared.esm-bundler.js
|
|
3
|
+
/**
|
|
4
|
+
* @vue/shared v3.5.32
|
|
5
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
6
|
+
* @license MIT
|
|
7
|
+
**/
|
|
8
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
4
9
|
function makeMap(str) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
if (i > -1) {
|
|
17
|
-
arr.splice(i, 1);
|
|
18
|
-
}
|
|
10
|
+
const map = /* @__PURE__ */ Object.create(null);
|
|
11
|
+
for (const key of str.split(",")) map[key] = 1;
|
|
12
|
+
return (val) => val in map;
|
|
13
|
+
}
|
|
14
|
+
var EMPTY_OBJ = !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
|
|
15
|
+
process.env.NODE_ENV !== "production" && Object.freeze([]);
|
|
16
|
+
var NOOP = () => {};
|
|
17
|
+
var extend = Object.assign;
|
|
18
|
+
var remove = (arr, el) => {
|
|
19
|
+
const i = arr.indexOf(el);
|
|
20
|
+
if (i > -1) arr.splice(i, 1);
|
|
19
21
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
23
|
+
var hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
|
|
24
|
+
var isArray = Array.isArray;
|
|
25
|
+
var isMap = (val) => toTypeString(val) === "[object Map]";
|
|
26
|
+
var isSet = (val) => toTypeString(val) === "[object Set]";
|
|
27
|
+
var isFunction = (val) => typeof val === "function";
|
|
28
|
+
var isString = (val) => typeof val === "string";
|
|
29
|
+
var isSymbol = (val) => typeof val === "symbol";
|
|
30
|
+
var isObject = (val) => val !== null && typeof val === "object";
|
|
31
|
+
var isPromise = (val) => {
|
|
32
|
+
return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
|
|
31
33
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
var objectToString = Object.prototype.toString;
|
|
35
|
+
var toTypeString = (value) => objectToString.call(value);
|
|
36
|
+
var toRawType = (value) => {
|
|
37
|
+
return toTypeString(value).slice(8, -1);
|
|
36
38
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
39
|
+
var isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
40
|
+
var isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
41
|
+
var cacheStringFunction = (fn) => {
|
|
42
|
+
const cache = /* @__PURE__ */ Object.create(null);
|
|
43
|
+
return ((str) => {
|
|
44
|
+
return cache[str] || (cache[str] = fn(str));
|
|
45
|
+
});
|
|
45
46
|
};
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
var camelizeRE = /-\w/g;
|
|
48
|
+
cacheStringFunction((str) => {
|
|
49
|
+
return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
|
|
50
|
+
});
|
|
51
|
+
var hyphenateRE = /\B([A-Z])/g;
|
|
52
|
+
cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
53
|
+
var capitalize = cacheStringFunction((str) => {
|
|
54
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
55
|
+
});
|
|
56
|
+
cacheStringFunction((str) => {
|
|
57
|
+
return str ? `on${capitalize(str)}` : ``;
|
|
48
58
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
var hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
60
|
+
var def = (obj, key, value, writable = false) => {
|
|
61
|
+
Object.defineProperty(obj, key, {
|
|
62
|
+
configurable: true,
|
|
63
|
+
enumerable: false,
|
|
64
|
+
writable,
|
|
65
|
+
value
|
|
66
|
+
});
|
|
57
67
|
};
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region ../../node_modules/.pnpm/@vue+reactivity@3.5.32/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
|
|
70
|
+
/**
|
|
71
|
+
* @vue/reactivity v3.5.32
|
|
72
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
73
|
+
* @license MIT
|
|
74
|
+
**/
|
|
58
75
|
function warn$1(msg, ...args) {
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
if (!this.detached && this.parent && !fromParent) {
|
|
165
|
-
const last = this.parent.scopes.pop();
|
|
166
|
-
if (last && last !== this) {
|
|
167
|
-
this.parent.scopes[this.index] = last;
|
|
168
|
-
last.index = this.index;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
this.parent = void 0;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
76
|
+
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
77
|
+
}
|
|
78
|
+
var activeEffectScope;
|
|
79
|
+
var EffectScope = class {
|
|
80
|
+
constructor(detached = false) {
|
|
81
|
+
this.detached = detached;
|
|
82
|
+
/**
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
this._active = true;
|
|
86
|
+
/**
|
|
87
|
+
* @internal track `on` calls, allow `on` call multiple times
|
|
88
|
+
*/
|
|
89
|
+
this._on = 0;
|
|
90
|
+
/**
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
this.effects = [];
|
|
94
|
+
/**
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
97
|
+
this.cleanups = [];
|
|
98
|
+
this._isPaused = false;
|
|
99
|
+
this.__v_skip = true;
|
|
100
|
+
this.parent = activeEffectScope;
|
|
101
|
+
if (!detached && activeEffectScope) this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
|
|
102
|
+
}
|
|
103
|
+
get active() {
|
|
104
|
+
return this._active;
|
|
105
|
+
}
|
|
106
|
+
pause() {
|
|
107
|
+
if (this._active) {
|
|
108
|
+
this._isPaused = true;
|
|
109
|
+
let i, l;
|
|
110
|
+
if (this.scopes) for (i = 0, l = this.scopes.length; i < l; i++) this.scopes[i].pause();
|
|
111
|
+
for (i = 0, l = this.effects.length; i < l; i++) this.effects[i].pause();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Resumes the effect scope, including all child scopes and effects.
|
|
116
|
+
*/
|
|
117
|
+
resume() {
|
|
118
|
+
if (this._active) {
|
|
119
|
+
if (this._isPaused) {
|
|
120
|
+
this._isPaused = false;
|
|
121
|
+
let i, l;
|
|
122
|
+
if (this.scopes) for (i = 0, l = this.scopes.length; i < l; i++) this.scopes[i].resume();
|
|
123
|
+
for (i = 0, l = this.effects.length; i < l; i++) this.effects[i].resume();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
run(fn) {
|
|
128
|
+
if (this._active) {
|
|
129
|
+
const currentEffectScope = activeEffectScope;
|
|
130
|
+
try {
|
|
131
|
+
activeEffectScope = this;
|
|
132
|
+
return fn();
|
|
133
|
+
} finally {
|
|
134
|
+
activeEffectScope = currentEffectScope;
|
|
135
|
+
}
|
|
136
|
+
} else if (!!(process.env.NODE_ENV !== "production")) warn$1(`cannot run an inactive effect scope.`);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* This should only be called on non-detached scopes
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
|
+
on() {
|
|
143
|
+
if (++this._on === 1) {
|
|
144
|
+
this.prevScope = activeEffectScope;
|
|
145
|
+
activeEffectScope = this;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* This should only be called on non-detached scopes
|
|
150
|
+
* @internal
|
|
151
|
+
*/
|
|
152
|
+
off() {
|
|
153
|
+
if (this._on > 0 && --this._on === 0) {
|
|
154
|
+
activeEffectScope = this.prevScope;
|
|
155
|
+
this.prevScope = void 0;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
stop(fromParent) {
|
|
159
|
+
if (this._active) {
|
|
160
|
+
this._active = false;
|
|
161
|
+
let i, l;
|
|
162
|
+
for (i = 0, l = this.effects.length; i < l; i++) this.effects[i].stop();
|
|
163
|
+
this.effects.length = 0;
|
|
164
|
+
for (i = 0, l = this.cleanups.length; i < l; i++) this.cleanups[i]();
|
|
165
|
+
this.cleanups.length = 0;
|
|
166
|
+
if (this.scopes) {
|
|
167
|
+
for (i = 0, l = this.scopes.length; i < l; i++) this.scopes[i].stop(true);
|
|
168
|
+
this.scopes.length = 0;
|
|
169
|
+
}
|
|
170
|
+
if (!this.detached && this.parent && !fromParent) {
|
|
171
|
+
const last = this.parent.scopes.pop();
|
|
172
|
+
if (last && last !== this) {
|
|
173
|
+
this.parent.scopes[this.index] = last;
|
|
174
|
+
last.index = this.index;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
this.parent = void 0;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
};
|
|
175
181
|
function effectScope(detached) {
|
|
176
|
-
|
|
182
|
+
return new EffectScope(detached);
|
|
177
183
|
}
|
|
178
184
|
function getCurrentScope() {
|
|
179
|
-
|
|
185
|
+
return activeEffectScope;
|
|
180
186
|
}
|
|
181
187
|
function onScopeDispose(fn, failSilently = false) {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
"32": "ALLOW_RECURSE",
|
|
204
|
-
"PAUSED": 64,
|
|
205
|
-
"64": "PAUSED",
|
|
206
|
-
"EVALUATED": 128,
|
|
207
|
-
"128": "EVALUATED"
|
|
188
|
+
if (activeEffectScope) activeEffectScope.cleanups.push(fn);
|
|
189
|
+
else if (!!(process.env.NODE_ENV !== "production") && !failSilently) warn$1(`onScopeDispose() is called when there is no active effect scope to be associated with.`);
|
|
190
|
+
}
|
|
191
|
+
var activeSub;
|
|
192
|
+
var EffectFlags = {
|
|
193
|
+
"ACTIVE": 1,
|
|
194
|
+
"1": "ACTIVE",
|
|
195
|
+
"RUNNING": 2,
|
|
196
|
+
"2": "RUNNING",
|
|
197
|
+
"TRACKING": 4,
|
|
198
|
+
"4": "TRACKING",
|
|
199
|
+
"NOTIFIED": 8,
|
|
200
|
+
"8": "NOTIFIED",
|
|
201
|
+
"DIRTY": 16,
|
|
202
|
+
"16": "DIRTY",
|
|
203
|
+
"ALLOW_RECURSE": 32,
|
|
204
|
+
"32": "ALLOW_RECURSE",
|
|
205
|
+
"PAUSED": 64,
|
|
206
|
+
"64": "PAUSED",
|
|
207
|
+
"EVALUATED": 128,
|
|
208
|
+
"128": "EVALUATED"
|
|
208
209
|
};
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
let batchDepth = 0;
|
|
304
|
-
let batchedSub;
|
|
305
|
-
let batchedComputed;
|
|
210
|
+
var pausedQueueEffects = /* @__PURE__ */ new WeakSet();
|
|
211
|
+
var ReactiveEffect = class {
|
|
212
|
+
constructor(fn) {
|
|
213
|
+
this.fn = fn;
|
|
214
|
+
/**
|
|
215
|
+
* @internal
|
|
216
|
+
*/
|
|
217
|
+
this.deps = void 0;
|
|
218
|
+
/**
|
|
219
|
+
* @internal
|
|
220
|
+
*/
|
|
221
|
+
this.depsTail = void 0;
|
|
222
|
+
/**
|
|
223
|
+
* @internal
|
|
224
|
+
*/
|
|
225
|
+
this.flags = 5;
|
|
226
|
+
/**
|
|
227
|
+
* @internal
|
|
228
|
+
*/
|
|
229
|
+
this.next = void 0;
|
|
230
|
+
/**
|
|
231
|
+
* @internal
|
|
232
|
+
*/
|
|
233
|
+
this.cleanup = void 0;
|
|
234
|
+
this.scheduler = void 0;
|
|
235
|
+
if (activeEffectScope && activeEffectScope.active) activeEffectScope.effects.push(this);
|
|
236
|
+
}
|
|
237
|
+
pause() {
|
|
238
|
+
this.flags |= 64;
|
|
239
|
+
}
|
|
240
|
+
resume() {
|
|
241
|
+
if (this.flags & 64) {
|
|
242
|
+
this.flags &= -65;
|
|
243
|
+
if (pausedQueueEffects.has(this)) {
|
|
244
|
+
pausedQueueEffects.delete(this);
|
|
245
|
+
this.trigger();
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* @internal
|
|
251
|
+
*/
|
|
252
|
+
notify() {
|
|
253
|
+
if (this.flags & 2 && !(this.flags & 32)) return;
|
|
254
|
+
if (!(this.flags & 8)) batch(this);
|
|
255
|
+
}
|
|
256
|
+
run() {
|
|
257
|
+
if (!(this.flags & 1)) return this.fn();
|
|
258
|
+
this.flags |= 2;
|
|
259
|
+
cleanupEffect(this);
|
|
260
|
+
prepareDeps(this);
|
|
261
|
+
const prevEffect = activeSub;
|
|
262
|
+
const prevShouldTrack = shouldTrack;
|
|
263
|
+
activeSub = this;
|
|
264
|
+
shouldTrack = true;
|
|
265
|
+
try {
|
|
266
|
+
return this.fn();
|
|
267
|
+
} finally {
|
|
268
|
+
if (!!(process.env.NODE_ENV !== "production") && activeSub !== this) warn$1("Active effect was not restored correctly - this is likely a Vue internal bug.");
|
|
269
|
+
cleanupDeps(this);
|
|
270
|
+
activeSub = prevEffect;
|
|
271
|
+
shouldTrack = prevShouldTrack;
|
|
272
|
+
this.flags &= -3;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
stop() {
|
|
276
|
+
if (this.flags & 1) {
|
|
277
|
+
for (let link = this.deps; link; link = link.nextDep) removeSub(link);
|
|
278
|
+
this.deps = this.depsTail = void 0;
|
|
279
|
+
cleanupEffect(this);
|
|
280
|
+
this.onStop && this.onStop();
|
|
281
|
+
this.flags &= -2;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
trigger() {
|
|
285
|
+
if (this.flags & 64) pausedQueueEffects.add(this);
|
|
286
|
+
else if (this.scheduler) this.scheduler();
|
|
287
|
+
else this.runIfDirty();
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* @internal
|
|
291
|
+
*/
|
|
292
|
+
runIfDirty() {
|
|
293
|
+
if (isDirty(this)) this.run();
|
|
294
|
+
}
|
|
295
|
+
get dirty() {
|
|
296
|
+
return isDirty(this);
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
var batchDepth = 0;
|
|
300
|
+
var batchedSub;
|
|
301
|
+
var batchedComputed;
|
|
306
302
|
function batch(sub, isComputed = false) {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
303
|
+
sub.flags |= 8;
|
|
304
|
+
if (isComputed) {
|
|
305
|
+
sub.next = batchedComputed;
|
|
306
|
+
batchedComputed = sub;
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
sub.next = batchedSub;
|
|
310
|
+
batchedSub = sub;
|
|
315
311
|
}
|
|
316
312
|
function startBatch() {
|
|
317
|
-
|
|
313
|
+
batchDepth++;
|
|
318
314
|
}
|
|
319
315
|
function endBatch() {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
349
|
-
e = next;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
if (error) throw error;
|
|
316
|
+
if (--batchDepth > 0) return;
|
|
317
|
+
if (batchedComputed) {
|
|
318
|
+
let e = batchedComputed;
|
|
319
|
+
batchedComputed = void 0;
|
|
320
|
+
while (e) {
|
|
321
|
+
const next = e.next;
|
|
322
|
+
e.next = void 0;
|
|
323
|
+
e.flags &= -9;
|
|
324
|
+
e = next;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
let error;
|
|
328
|
+
while (batchedSub) {
|
|
329
|
+
let e = batchedSub;
|
|
330
|
+
batchedSub = void 0;
|
|
331
|
+
while (e) {
|
|
332
|
+
const next = e.next;
|
|
333
|
+
e.next = void 0;
|
|
334
|
+
e.flags &= -9;
|
|
335
|
+
if (e.flags & 1) try {
|
|
336
|
+
e.trigger();
|
|
337
|
+
} catch (err) {
|
|
338
|
+
if (!error) error = err;
|
|
339
|
+
}
|
|
340
|
+
e = next;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
if (error) throw error;
|
|
353
344
|
}
|
|
354
345
|
function prepareDeps(sub) {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
346
|
+
for (let link = sub.deps; link; link = link.nextDep) {
|
|
347
|
+
link.version = -1;
|
|
348
|
+
link.prevActiveLink = link.dep.activeLink;
|
|
349
|
+
link.dep.activeLink = link;
|
|
350
|
+
}
|
|
360
351
|
}
|
|
361
352
|
function cleanupDeps(sub) {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
sub.deps = head;
|
|
379
|
-
sub.depsTail = tail;
|
|
353
|
+
let head;
|
|
354
|
+
let tail = sub.depsTail;
|
|
355
|
+
let link = tail;
|
|
356
|
+
while (link) {
|
|
357
|
+
const prev = link.prevDep;
|
|
358
|
+
if (link.version === -1) {
|
|
359
|
+
if (link === tail) tail = prev;
|
|
360
|
+
removeSub(link);
|
|
361
|
+
removeDep(link);
|
|
362
|
+
} else head = link;
|
|
363
|
+
link.dep.activeLink = link.prevActiveLink;
|
|
364
|
+
link.prevActiveLink = void 0;
|
|
365
|
+
link = prev;
|
|
366
|
+
}
|
|
367
|
+
sub.deps = head;
|
|
368
|
+
sub.depsTail = tail;
|
|
380
369
|
}
|
|
381
370
|
function isDirty(sub) {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
computed2._value = value;
|
|
416
|
-
dep.version++;
|
|
417
|
-
}
|
|
418
|
-
} catch (err) {
|
|
419
|
-
dep.version++;
|
|
420
|
-
throw err;
|
|
421
|
-
} finally {
|
|
422
|
-
activeSub = prevSub;
|
|
423
|
-
shouldTrack = prevShouldTrack;
|
|
424
|
-
cleanupDeps(computed2);
|
|
425
|
-
computed2.flags &= -3;
|
|
426
|
-
}
|
|
371
|
+
for (let link = sub.deps; link; link = link.nextDep) if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) return true;
|
|
372
|
+
if (sub._dirty) return true;
|
|
373
|
+
return false;
|
|
374
|
+
}
|
|
375
|
+
function refreshComputed(computed) {
|
|
376
|
+
if (computed.flags & 4 && !(computed.flags & 16)) return;
|
|
377
|
+
computed.flags &= -17;
|
|
378
|
+
if (computed.globalVersion === globalVersion) return;
|
|
379
|
+
computed.globalVersion = globalVersion;
|
|
380
|
+
if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) return;
|
|
381
|
+
computed.flags |= 2;
|
|
382
|
+
const dep = computed.dep;
|
|
383
|
+
const prevSub = activeSub;
|
|
384
|
+
const prevShouldTrack = shouldTrack;
|
|
385
|
+
activeSub = computed;
|
|
386
|
+
shouldTrack = true;
|
|
387
|
+
try {
|
|
388
|
+
prepareDeps(computed);
|
|
389
|
+
const value = computed.fn(computed._value);
|
|
390
|
+
if (dep.version === 0 || hasChanged(value, computed._value)) {
|
|
391
|
+
computed.flags |= 128;
|
|
392
|
+
computed._value = value;
|
|
393
|
+
dep.version++;
|
|
394
|
+
}
|
|
395
|
+
} catch (err) {
|
|
396
|
+
dep.version++;
|
|
397
|
+
throw err;
|
|
398
|
+
} finally {
|
|
399
|
+
activeSub = prevSub;
|
|
400
|
+
shouldTrack = prevShouldTrack;
|
|
401
|
+
cleanupDeps(computed);
|
|
402
|
+
computed.flags &= -3;
|
|
403
|
+
}
|
|
427
404
|
}
|
|
428
405
|
function removeSub(link, soft = false) {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
if (!soft && !--dep.sc && dep.map) {
|
|
451
|
-
dep.map.delete(dep.key);
|
|
452
|
-
}
|
|
406
|
+
const { dep, prevSub, nextSub } = link;
|
|
407
|
+
if (prevSub) {
|
|
408
|
+
prevSub.nextSub = nextSub;
|
|
409
|
+
link.prevSub = void 0;
|
|
410
|
+
}
|
|
411
|
+
if (nextSub) {
|
|
412
|
+
nextSub.prevSub = prevSub;
|
|
413
|
+
link.nextSub = void 0;
|
|
414
|
+
}
|
|
415
|
+
if (!!(process.env.NODE_ENV !== "production") && dep.subsHead === link) dep.subsHead = nextSub;
|
|
416
|
+
if (dep.subs === link) {
|
|
417
|
+
dep.subs = prevSub;
|
|
418
|
+
if (!prevSub && dep.computed) {
|
|
419
|
+
dep.computed.flags &= -5;
|
|
420
|
+
for (let l = dep.computed.deps; l; l = l.nextDep) removeSub(l, true);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
if (!soft && !--dep.sc && dep.map) dep.map.delete(dep.key);
|
|
453
424
|
}
|
|
454
425
|
function removeDep(link) {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
426
|
+
const { prevDep, nextDep } = link;
|
|
427
|
+
if (prevDep) {
|
|
428
|
+
prevDep.nextDep = nextDep;
|
|
429
|
+
link.prevDep = void 0;
|
|
430
|
+
}
|
|
431
|
+
if (nextDep) {
|
|
432
|
+
nextDep.prevDep = prevDep;
|
|
433
|
+
link.nextDep = void 0;
|
|
434
|
+
}
|
|
464
435
|
}
|
|
465
436
|
function effect(fn, options) {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
}
|
|
479
|
-
const runner = e.run.bind(e);
|
|
480
|
-
runner.effect = e;
|
|
481
|
-
return runner;
|
|
437
|
+
if (fn.effect instanceof ReactiveEffect) fn = fn.effect.fn;
|
|
438
|
+
const e = new ReactiveEffect(fn);
|
|
439
|
+
if (options) extend(e, options);
|
|
440
|
+
try {
|
|
441
|
+
e.run();
|
|
442
|
+
} catch (err) {
|
|
443
|
+
e.stop();
|
|
444
|
+
throw err;
|
|
445
|
+
}
|
|
446
|
+
const runner = e.run.bind(e);
|
|
447
|
+
runner.effect = e;
|
|
448
|
+
return runner;
|
|
482
449
|
}
|
|
483
450
|
function stop(runner) {
|
|
484
|
-
|
|
451
|
+
runner.effect.stop();
|
|
485
452
|
}
|
|
486
|
-
|
|
487
|
-
|
|
453
|
+
var shouldTrack = true;
|
|
454
|
+
var trackStack = [];
|
|
488
455
|
function pauseTracking() {
|
|
489
|
-
|
|
490
|
-
|
|
456
|
+
trackStack.push(shouldTrack);
|
|
457
|
+
shouldTrack = false;
|
|
491
458
|
}
|
|
492
459
|
function enableTracking() {
|
|
493
|
-
|
|
494
|
-
|
|
460
|
+
trackStack.push(shouldTrack);
|
|
461
|
+
shouldTrack = true;
|
|
495
462
|
}
|
|
496
463
|
function resetTracking() {
|
|
497
|
-
|
|
498
|
-
|
|
464
|
+
const last = trackStack.pop();
|
|
465
|
+
shouldTrack = last === void 0 ? true : last;
|
|
499
466
|
}
|
|
500
467
|
function onEffectCleanup(fn, failSilently = false) {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
} else if (!!(process.env.NODE_ENV !== "production") && !failSilently) {
|
|
504
|
-
warn$1(
|
|
505
|
-
`onEffectCleanup() was called when there was no active effect to associate with.`
|
|
506
|
-
);
|
|
507
|
-
}
|
|
468
|
+
if (activeSub instanceof ReactiveEffect) activeSub.cleanup = fn;
|
|
469
|
+
else if (!!(process.env.NODE_ENV !== "production") && !failSilently) warn$1(`onEffectCleanup() was called when there was no active effect to associate with.`);
|
|
508
470
|
}
|
|
509
471
|
function cleanupEffect(e) {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
{
|
|
604
|
-
effect: head.sub
|
|
605
|
-
},
|
|
606
|
-
debugInfo
|
|
607
|
-
)
|
|
608
|
-
);
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
for (let link = this.subs; link; link = link.prevSub) {
|
|
613
|
-
if (link.sub.notify()) {
|
|
614
|
-
;
|
|
615
|
-
link.sub.dep.notify();
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
} finally {
|
|
619
|
-
endBatch();
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
}
|
|
472
|
+
const { cleanup } = e;
|
|
473
|
+
e.cleanup = void 0;
|
|
474
|
+
if (cleanup) {
|
|
475
|
+
const prevSub = activeSub;
|
|
476
|
+
activeSub = void 0;
|
|
477
|
+
try {
|
|
478
|
+
cleanup();
|
|
479
|
+
} finally {
|
|
480
|
+
activeSub = prevSub;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
var globalVersion = 0;
|
|
485
|
+
var Link = class {
|
|
486
|
+
constructor(sub, dep) {
|
|
487
|
+
this.sub = sub;
|
|
488
|
+
this.dep = dep;
|
|
489
|
+
this.version = dep.version;
|
|
490
|
+
this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
var Dep = class {
|
|
494
|
+
constructor(computed) {
|
|
495
|
+
this.computed = computed;
|
|
496
|
+
this.version = 0;
|
|
497
|
+
/**
|
|
498
|
+
* Link between this dep and the current active effect
|
|
499
|
+
*/
|
|
500
|
+
this.activeLink = void 0;
|
|
501
|
+
/**
|
|
502
|
+
* Doubly linked list representing the subscribing effects (tail)
|
|
503
|
+
*/
|
|
504
|
+
this.subs = void 0;
|
|
505
|
+
/**
|
|
506
|
+
* For object property deps cleanup
|
|
507
|
+
*/
|
|
508
|
+
this.map = void 0;
|
|
509
|
+
this.key = void 0;
|
|
510
|
+
/**
|
|
511
|
+
* Subscriber counter
|
|
512
|
+
*/
|
|
513
|
+
this.sc = 0;
|
|
514
|
+
/**
|
|
515
|
+
* @internal
|
|
516
|
+
*/
|
|
517
|
+
this.__v_skip = true;
|
|
518
|
+
if (!!(process.env.NODE_ENV !== "production")) this.subsHead = void 0;
|
|
519
|
+
}
|
|
520
|
+
track(debugInfo) {
|
|
521
|
+
if (!activeSub || !shouldTrack || activeSub === this.computed) return;
|
|
522
|
+
let link = this.activeLink;
|
|
523
|
+
if (link === void 0 || link.sub !== activeSub) {
|
|
524
|
+
link = this.activeLink = new Link(activeSub, this);
|
|
525
|
+
if (!activeSub.deps) activeSub.deps = activeSub.depsTail = link;
|
|
526
|
+
else {
|
|
527
|
+
link.prevDep = activeSub.depsTail;
|
|
528
|
+
activeSub.depsTail.nextDep = link;
|
|
529
|
+
activeSub.depsTail = link;
|
|
530
|
+
}
|
|
531
|
+
addSub(link);
|
|
532
|
+
} else if (link.version === -1) {
|
|
533
|
+
link.version = this.version;
|
|
534
|
+
if (link.nextDep) {
|
|
535
|
+
const next = link.nextDep;
|
|
536
|
+
next.prevDep = link.prevDep;
|
|
537
|
+
if (link.prevDep) link.prevDep.nextDep = next;
|
|
538
|
+
link.prevDep = activeSub.depsTail;
|
|
539
|
+
link.nextDep = void 0;
|
|
540
|
+
activeSub.depsTail.nextDep = link;
|
|
541
|
+
activeSub.depsTail = link;
|
|
542
|
+
if (activeSub.deps === link) activeSub.deps = next;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
if (!!(process.env.NODE_ENV !== "production") && activeSub.onTrack) activeSub.onTrack(extend({ effect: activeSub }, debugInfo));
|
|
546
|
+
return link;
|
|
547
|
+
}
|
|
548
|
+
trigger(debugInfo) {
|
|
549
|
+
this.version++;
|
|
550
|
+
globalVersion++;
|
|
551
|
+
this.notify(debugInfo);
|
|
552
|
+
}
|
|
553
|
+
notify(debugInfo) {
|
|
554
|
+
startBatch();
|
|
555
|
+
try {
|
|
556
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
557
|
+
for (let head = this.subsHead; head; head = head.nextSub) if (head.sub.onTrigger && !(head.sub.flags & 8)) head.sub.onTrigger(extend({ effect: head.sub }, debugInfo));
|
|
558
|
+
}
|
|
559
|
+
for (let link = this.subs; link; link = link.prevSub) if (link.sub.notify()) link.sub.dep.notify();
|
|
560
|
+
} finally {
|
|
561
|
+
endBatch();
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
};
|
|
623
565
|
function addSub(link) {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
645
|
-
const ITERATE_KEY = /* @__PURE__ */ Symbol(
|
|
646
|
-
!!(process.env.NODE_ENV !== "production") ? "Object iterate" : ""
|
|
647
|
-
);
|
|
648
|
-
const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol(
|
|
649
|
-
!!(process.env.NODE_ENV !== "production") ? "Map keys iterate" : ""
|
|
650
|
-
);
|
|
651
|
-
const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol(
|
|
652
|
-
!!(process.env.NODE_ENV !== "production") ? "Array iterate" : ""
|
|
653
|
-
);
|
|
566
|
+
link.dep.sc++;
|
|
567
|
+
if (link.sub.flags & 4) {
|
|
568
|
+
const computed = link.dep.computed;
|
|
569
|
+
if (computed && !link.dep.subs) {
|
|
570
|
+
computed.flags |= 20;
|
|
571
|
+
for (let l = computed.deps; l; l = l.nextDep) addSub(l);
|
|
572
|
+
}
|
|
573
|
+
const currentTail = link.dep.subs;
|
|
574
|
+
if (currentTail !== link) {
|
|
575
|
+
link.prevSub = currentTail;
|
|
576
|
+
if (currentTail) currentTail.nextSub = link;
|
|
577
|
+
}
|
|
578
|
+
if (!!(process.env.NODE_ENV !== "production") && link.dep.subsHead === void 0) link.dep.subsHead = link;
|
|
579
|
+
link.dep.subs = link;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
var targetMap = /* @__PURE__ */ new WeakMap();
|
|
583
|
+
var ITERATE_KEY = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? "Object iterate" : "");
|
|
584
|
+
var MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? "Map keys iterate" : "");
|
|
585
|
+
var ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? "Array iterate" : "");
|
|
654
586
|
function track(target, type, key) {
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
});
|
|
672
|
-
} else {
|
|
673
|
-
dep.track();
|
|
674
|
-
}
|
|
675
|
-
}
|
|
587
|
+
if (shouldTrack && activeSub) {
|
|
588
|
+
let depsMap = targetMap.get(target);
|
|
589
|
+
if (!depsMap) targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
|
|
590
|
+
let dep = depsMap.get(key);
|
|
591
|
+
if (!dep) {
|
|
592
|
+
depsMap.set(key, dep = new Dep());
|
|
593
|
+
dep.map = depsMap;
|
|
594
|
+
dep.key = key;
|
|
595
|
+
}
|
|
596
|
+
if (!!(process.env.NODE_ENV !== "production")) dep.track({
|
|
597
|
+
target,
|
|
598
|
+
type,
|
|
599
|
+
key
|
|
600
|
+
});
|
|
601
|
+
else dep.track();
|
|
602
|
+
}
|
|
676
603
|
}
|
|
677
604
|
function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
run(depsMap.get("length"));
|
|
728
|
-
}
|
|
729
|
-
break;
|
|
730
|
-
case "delete":
|
|
731
|
-
if (!targetIsArray) {
|
|
732
|
-
run(depsMap.get(ITERATE_KEY));
|
|
733
|
-
if (isMap(target)) {
|
|
734
|
-
run(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
break;
|
|
738
|
-
case "set":
|
|
739
|
-
if (isMap(target)) {
|
|
740
|
-
run(depsMap.get(ITERATE_KEY));
|
|
741
|
-
}
|
|
742
|
-
break;
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
endBatch();
|
|
605
|
+
const depsMap = targetMap.get(target);
|
|
606
|
+
if (!depsMap) {
|
|
607
|
+
globalVersion++;
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
const run = (dep) => {
|
|
611
|
+
if (dep) if (!!(process.env.NODE_ENV !== "production")) dep.trigger({
|
|
612
|
+
target,
|
|
613
|
+
type,
|
|
614
|
+
key,
|
|
615
|
+
newValue,
|
|
616
|
+
oldValue,
|
|
617
|
+
oldTarget
|
|
618
|
+
});
|
|
619
|
+
else dep.trigger();
|
|
620
|
+
};
|
|
621
|
+
startBatch();
|
|
622
|
+
if (type === "clear") depsMap.forEach(run);
|
|
623
|
+
else {
|
|
624
|
+
const targetIsArray = isArray(target);
|
|
625
|
+
const isArrayIndex = targetIsArray && isIntegerKey(key);
|
|
626
|
+
if (targetIsArray && key === "length") {
|
|
627
|
+
const newLength = Number(newValue);
|
|
628
|
+
depsMap.forEach((dep, key2) => {
|
|
629
|
+
if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) run(dep);
|
|
630
|
+
});
|
|
631
|
+
} else {
|
|
632
|
+
if (key !== void 0 || depsMap.has(void 0)) run(depsMap.get(key));
|
|
633
|
+
if (isArrayIndex) run(depsMap.get(ARRAY_ITERATE_KEY));
|
|
634
|
+
switch (type) {
|
|
635
|
+
case "add":
|
|
636
|
+
if (!targetIsArray) {
|
|
637
|
+
run(depsMap.get(ITERATE_KEY));
|
|
638
|
+
if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
639
|
+
} else if (isArrayIndex) run(depsMap.get("length"));
|
|
640
|
+
break;
|
|
641
|
+
case "delete":
|
|
642
|
+
if (!targetIsArray) {
|
|
643
|
+
run(depsMap.get(ITERATE_KEY));
|
|
644
|
+
if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
645
|
+
}
|
|
646
|
+
break;
|
|
647
|
+
case "set":
|
|
648
|
+
if (isMap(target)) run(depsMap.get(ITERATE_KEY));
|
|
649
|
+
break;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
endBatch();
|
|
747
654
|
}
|
|
748
655
|
function getDepFromReactive(object, key) {
|
|
749
|
-
|
|
750
|
-
|
|
656
|
+
const depMap = targetMap.get(object);
|
|
657
|
+
return depMap && depMap.get(key);
|
|
751
658
|
}
|
|
752
659
|
function reactiveReadArray(array) {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
660
|
+
const raw = /* @__PURE__ */ toRaw(array);
|
|
661
|
+
if (raw === array) return raw;
|
|
662
|
+
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
663
|
+
return /* @__PURE__ */ isShallow(array) ? raw : raw.map(toReactive);
|
|
757
664
|
}
|
|
758
665
|
function shallowReadArray(arr) {
|
|
759
|
-
|
|
760
|
-
|
|
666
|
+
track(arr = /* @__PURE__ */ toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
|
|
667
|
+
return arr;
|
|
761
668
|
}
|
|
762
669
|
function toWrapped(target, item) {
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
reduceRight(fn, ...args) {
|
|
853
|
-
return reduce(this, "reduceRight", fn, args);
|
|
854
|
-
},
|
|
855
|
-
shift() {
|
|
856
|
-
return noTracking(this, "shift");
|
|
857
|
-
},
|
|
858
|
-
// slice could use ARRAY_ITERATE but also seems to beg for range tracking
|
|
859
|
-
some(fn, thisArg) {
|
|
860
|
-
return apply(this, "some", fn, thisArg, void 0, arguments);
|
|
861
|
-
},
|
|
862
|
-
splice(...args) {
|
|
863
|
-
return noTracking(this, "splice", args);
|
|
864
|
-
},
|
|
865
|
-
toReversed() {
|
|
866
|
-
return reactiveReadArray(this).toReversed();
|
|
867
|
-
},
|
|
868
|
-
toSorted(comparer) {
|
|
869
|
-
return reactiveReadArray(this).toSorted(comparer);
|
|
870
|
-
},
|
|
871
|
-
toSpliced(...args) {
|
|
872
|
-
return reactiveReadArray(this).toSpliced(...args);
|
|
873
|
-
},
|
|
874
|
-
unshift(...args) {
|
|
875
|
-
return noTracking(this, "unshift", args);
|
|
876
|
-
},
|
|
877
|
-
values() {
|
|
878
|
-
return iterator(this, "values", (item) => toWrapped(this, item));
|
|
879
|
-
}
|
|
670
|
+
if (/* @__PURE__ */ isReadonly(target)) return /* @__PURE__ */ isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item);
|
|
671
|
+
return toReactive(item);
|
|
672
|
+
}
|
|
673
|
+
var arrayInstrumentations = {
|
|
674
|
+
__proto__: null,
|
|
675
|
+
[Symbol.iterator]() {
|
|
676
|
+
return iterator(this, Symbol.iterator, (item) => toWrapped(this, item));
|
|
677
|
+
},
|
|
678
|
+
concat(...args) {
|
|
679
|
+
return reactiveReadArray(this).concat(...args.map((x) => isArray(x) ? reactiveReadArray(x) : x));
|
|
680
|
+
},
|
|
681
|
+
entries() {
|
|
682
|
+
return iterator(this, "entries", (value) => {
|
|
683
|
+
value[1] = toWrapped(this, value[1]);
|
|
684
|
+
return value;
|
|
685
|
+
});
|
|
686
|
+
},
|
|
687
|
+
every(fn, thisArg) {
|
|
688
|
+
return apply(this, "every", fn, thisArg, void 0, arguments);
|
|
689
|
+
},
|
|
690
|
+
filter(fn, thisArg) {
|
|
691
|
+
return apply(this, "filter", fn, thisArg, (v) => v.map((item) => toWrapped(this, item)), arguments);
|
|
692
|
+
},
|
|
693
|
+
find(fn, thisArg) {
|
|
694
|
+
return apply(this, "find", fn, thisArg, (item) => toWrapped(this, item), arguments);
|
|
695
|
+
},
|
|
696
|
+
findIndex(fn, thisArg) {
|
|
697
|
+
return apply(this, "findIndex", fn, thisArg, void 0, arguments);
|
|
698
|
+
},
|
|
699
|
+
findLast(fn, thisArg) {
|
|
700
|
+
return apply(this, "findLast", fn, thisArg, (item) => toWrapped(this, item), arguments);
|
|
701
|
+
},
|
|
702
|
+
findLastIndex(fn, thisArg) {
|
|
703
|
+
return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
|
|
704
|
+
},
|
|
705
|
+
forEach(fn, thisArg) {
|
|
706
|
+
return apply(this, "forEach", fn, thisArg, void 0, arguments);
|
|
707
|
+
},
|
|
708
|
+
includes(...args) {
|
|
709
|
+
return searchProxy(this, "includes", args);
|
|
710
|
+
},
|
|
711
|
+
indexOf(...args) {
|
|
712
|
+
return searchProxy(this, "indexOf", args);
|
|
713
|
+
},
|
|
714
|
+
join(separator) {
|
|
715
|
+
return reactiveReadArray(this).join(separator);
|
|
716
|
+
},
|
|
717
|
+
lastIndexOf(...args) {
|
|
718
|
+
return searchProxy(this, "lastIndexOf", args);
|
|
719
|
+
},
|
|
720
|
+
map(fn, thisArg) {
|
|
721
|
+
return apply(this, "map", fn, thisArg, void 0, arguments);
|
|
722
|
+
},
|
|
723
|
+
pop() {
|
|
724
|
+
return noTracking(this, "pop");
|
|
725
|
+
},
|
|
726
|
+
push(...args) {
|
|
727
|
+
return noTracking(this, "push", args);
|
|
728
|
+
},
|
|
729
|
+
reduce(fn, ...args) {
|
|
730
|
+
return reduce(this, "reduce", fn, args);
|
|
731
|
+
},
|
|
732
|
+
reduceRight(fn, ...args) {
|
|
733
|
+
return reduce(this, "reduceRight", fn, args);
|
|
734
|
+
},
|
|
735
|
+
shift() {
|
|
736
|
+
return noTracking(this, "shift");
|
|
737
|
+
},
|
|
738
|
+
some(fn, thisArg) {
|
|
739
|
+
return apply(this, "some", fn, thisArg, void 0, arguments);
|
|
740
|
+
},
|
|
741
|
+
splice(...args) {
|
|
742
|
+
return noTracking(this, "splice", args);
|
|
743
|
+
},
|
|
744
|
+
toReversed() {
|
|
745
|
+
return reactiveReadArray(this).toReversed();
|
|
746
|
+
},
|
|
747
|
+
toSorted(comparer) {
|
|
748
|
+
return reactiveReadArray(this).toSorted(comparer);
|
|
749
|
+
},
|
|
750
|
+
toSpliced(...args) {
|
|
751
|
+
return reactiveReadArray(this).toSpliced(...args);
|
|
752
|
+
},
|
|
753
|
+
unshift(...args) {
|
|
754
|
+
return noTracking(this, "unshift", args);
|
|
755
|
+
},
|
|
756
|
+
values() {
|
|
757
|
+
return iterator(this, "values", (item) => toWrapped(this, item));
|
|
758
|
+
}
|
|
880
759
|
};
|
|
881
760
|
function iterator(self, method, wrapValue) {
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
}
|
|
896
|
-
const arrayProto = Array.prototype;
|
|
761
|
+
const arr = shallowReadArray(self);
|
|
762
|
+
const iter = arr[method]();
|
|
763
|
+
if (arr !== self && !/* @__PURE__ */ isShallow(self)) {
|
|
764
|
+
iter._next = iter.next;
|
|
765
|
+
iter.next = () => {
|
|
766
|
+
const result = iter._next();
|
|
767
|
+
if (!result.done) result.value = wrapValue(result.value);
|
|
768
|
+
return result;
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
return iter;
|
|
772
|
+
}
|
|
773
|
+
var arrayProto = Array.prototype;
|
|
897
774
|
function apply(self, method, fn, thisArg, wrappedRetFn, args) {
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
}
|
|
917
|
-
const result = methodFn.call(arr, wrappedFn, thisArg);
|
|
918
|
-
return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
|
|
775
|
+
const arr = shallowReadArray(self);
|
|
776
|
+
const needsWrap = arr !== self && !/* @__PURE__ */ isShallow(self);
|
|
777
|
+
const methodFn = arr[method];
|
|
778
|
+
if (methodFn !== arrayProto[method]) {
|
|
779
|
+
const result2 = methodFn.apply(self, args);
|
|
780
|
+
return needsWrap ? toReactive(result2) : result2;
|
|
781
|
+
}
|
|
782
|
+
let wrappedFn = fn;
|
|
783
|
+
if (arr !== self) {
|
|
784
|
+
if (needsWrap) wrappedFn = function(item, index) {
|
|
785
|
+
return fn.call(this, toWrapped(self, item), index, self);
|
|
786
|
+
};
|
|
787
|
+
else if (fn.length > 2) wrappedFn = function(item, index) {
|
|
788
|
+
return fn.call(this, item, index, self);
|
|
789
|
+
};
|
|
790
|
+
}
|
|
791
|
+
const result = methodFn.call(arr, wrappedFn, thisArg);
|
|
792
|
+
return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
|
|
919
793
|
}
|
|
920
794
|
function reduce(self, method, fn, args) {
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
795
|
+
const arr = shallowReadArray(self);
|
|
796
|
+
const needsWrap = arr !== self && !/* @__PURE__ */ isShallow(self);
|
|
797
|
+
let wrappedFn = fn;
|
|
798
|
+
let wrapInitialAccumulator = false;
|
|
799
|
+
if (arr !== self) {
|
|
800
|
+
if (needsWrap) {
|
|
801
|
+
wrapInitialAccumulator = args.length === 0;
|
|
802
|
+
wrappedFn = function(acc, item, index) {
|
|
803
|
+
if (wrapInitialAccumulator) {
|
|
804
|
+
wrapInitialAccumulator = false;
|
|
805
|
+
acc = toWrapped(self, acc);
|
|
806
|
+
}
|
|
807
|
+
return fn.call(this, acc, toWrapped(self, item), index, self);
|
|
808
|
+
};
|
|
809
|
+
} else if (fn.length > 3) wrappedFn = function(acc, item, index) {
|
|
810
|
+
return fn.call(this, acc, item, index, self);
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
const result = arr[method](wrappedFn, ...args);
|
|
814
|
+
return wrapInitialAccumulator ? toWrapped(self, result) : result;
|
|
935
815
|
}
|
|
936
816
|
function searchProxy(self, method, args) {
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
817
|
+
const arr = /* @__PURE__ */ toRaw(self);
|
|
818
|
+
track(arr, "iterate", ARRAY_ITERATE_KEY);
|
|
819
|
+
const res = arr[method](...args);
|
|
820
|
+
if ((res === -1 || res === false) && /* @__PURE__ */ isProxy(args[0])) {
|
|
821
|
+
args[0] = /* @__PURE__ */ toRaw(args[0]);
|
|
822
|
+
return arr[method](...args);
|
|
823
|
+
}
|
|
824
|
+
return res;
|
|
945
825
|
}
|
|
946
826
|
function noTracking(self, method, args = []) {
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
|
|
957
|
-
);
|
|
827
|
+
pauseTracking();
|
|
828
|
+
startBatch();
|
|
829
|
+
const res = (/* @__PURE__ */ toRaw(self))[method].apply(self, args);
|
|
830
|
+
endBatch();
|
|
831
|
+
resetTracking();
|
|
832
|
+
return res;
|
|
833
|
+
}
|
|
834
|
+
var isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
835
|
+
var builtInSymbols = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
958
836
|
function hasOwnProperty(key) {
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
trigger(target, "set", key, value, oldValue);
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
return result;
|
|
1066
|
-
}
|
|
1067
|
-
deleteProperty(target, key) {
|
|
1068
|
-
const hadKey = hasOwn(target, key);
|
|
1069
|
-
const oldValue = target[key];
|
|
1070
|
-
const result = Reflect.deleteProperty(target, key);
|
|
1071
|
-
if (result && hadKey) {
|
|
1072
|
-
trigger(target, "delete", key, void 0, oldValue);
|
|
1073
|
-
}
|
|
1074
|
-
return result;
|
|
1075
|
-
}
|
|
1076
|
-
has(target, key) {
|
|
1077
|
-
const result = Reflect.has(target, key);
|
|
1078
|
-
if (!isSymbol(key) || !builtInSymbols.has(key)) {
|
|
1079
|
-
track(target, "has", key);
|
|
1080
|
-
}
|
|
1081
|
-
return result;
|
|
1082
|
-
}
|
|
1083
|
-
ownKeys(target) {
|
|
1084
|
-
track(
|
|
1085
|
-
target,
|
|
1086
|
-
"iterate",
|
|
1087
|
-
isArray(target) ? "length" : ITERATE_KEY
|
|
1088
|
-
);
|
|
1089
|
-
return Reflect.ownKeys(target);
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
class ReadonlyReactiveHandler extends BaseReactiveHandler {
|
|
1093
|
-
constructor(isShallow2 = false) {
|
|
1094
|
-
super(true, isShallow2);
|
|
1095
|
-
}
|
|
1096
|
-
set(target, key) {
|
|
1097
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1098
|
-
warn$1(
|
|
1099
|
-
`Set operation on key "${String(key)}" failed: target is readonly.`,
|
|
1100
|
-
target
|
|
1101
|
-
);
|
|
1102
|
-
}
|
|
1103
|
-
return true;
|
|
1104
|
-
}
|
|
1105
|
-
deleteProperty(target, key) {
|
|
1106
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1107
|
-
warn$1(
|
|
1108
|
-
`Delete operation on key "${String(key)}" failed: target is readonly.`,
|
|
1109
|
-
target
|
|
1110
|
-
);
|
|
1111
|
-
}
|
|
1112
|
-
return true;
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1115
|
-
const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
|
|
1116
|
-
const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
|
|
1117
|
-
const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
|
|
1118
|
-
const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
|
|
1119
|
-
const toShallow = (value) => value;
|
|
1120
|
-
const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
837
|
+
if (!isSymbol(key)) key = String(key);
|
|
838
|
+
const obj = /* @__PURE__ */ toRaw(this);
|
|
839
|
+
track(obj, "has", key);
|
|
840
|
+
return obj.hasOwnProperty(key);
|
|
841
|
+
}
|
|
842
|
+
var BaseReactiveHandler = class {
|
|
843
|
+
constructor(_isReadonly = false, _isShallow = false) {
|
|
844
|
+
this._isReadonly = _isReadonly;
|
|
845
|
+
this._isShallow = _isShallow;
|
|
846
|
+
}
|
|
847
|
+
get(target, key, receiver) {
|
|
848
|
+
if (key === "__v_skip") return target["__v_skip"];
|
|
849
|
+
const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
|
|
850
|
+
if (key === "__v_isReactive") return !isReadonly2;
|
|
851
|
+
else if (key === "__v_isReadonly") return isReadonly2;
|
|
852
|
+
else if (key === "__v_isShallow") return isShallow2;
|
|
853
|
+
else if (key === "__v_raw") {
|
|
854
|
+
if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) return target;
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
const targetIsArray = isArray(target);
|
|
858
|
+
if (!isReadonly2) {
|
|
859
|
+
let fn;
|
|
860
|
+
if (targetIsArray && (fn = arrayInstrumentations[key])) return fn;
|
|
861
|
+
if (key === "hasOwnProperty") return hasOwnProperty;
|
|
862
|
+
}
|
|
863
|
+
const res = Reflect.get(target, key, /* @__PURE__ */ isRef(target) ? target : receiver);
|
|
864
|
+
if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) return res;
|
|
865
|
+
if (!isReadonly2) track(target, "get", key);
|
|
866
|
+
if (isShallow2) return res;
|
|
867
|
+
if (/* @__PURE__ */ isRef(res)) {
|
|
868
|
+
const value = targetIsArray && isIntegerKey(key) ? res : res.value;
|
|
869
|
+
return isReadonly2 && isObject(value) ? /* @__PURE__ */ readonly(value) : value;
|
|
870
|
+
}
|
|
871
|
+
if (isObject(res)) return isReadonly2 ? /* @__PURE__ */ readonly(res) : /* @__PURE__ */ reactive(res);
|
|
872
|
+
return res;
|
|
873
|
+
}
|
|
874
|
+
};
|
|
875
|
+
var MutableReactiveHandler = class extends BaseReactiveHandler {
|
|
876
|
+
constructor(isShallow2 = false) {
|
|
877
|
+
super(false, isShallow2);
|
|
878
|
+
}
|
|
879
|
+
set(target, key, value, receiver) {
|
|
880
|
+
let oldValue = target[key];
|
|
881
|
+
const isArrayWithIntegerKey = isArray(target) && isIntegerKey(key);
|
|
882
|
+
if (!this._isShallow) {
|
|
883
|
+
const isOldValueReadonly = /* @__PURE__ */ isReadonly(oldValue);
|
|
884
|
+
if (!/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value)) {
|
|
885
|
+
oldValue = /* @__PURE__ */ toRaw(oldValue);
|
|
886
|
+
value = /* @__PURE__ */ toRaw(value);
|
|
887
|
+
}
|
|
888
|
+
if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) if (isOldValueReadonly) {
|
|
889
|
+
if (!!(process.env.NODE_ENV !== "production")) warn$1(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
|
|
890
|
+
return true;
|
|
891
|
+
} else {
|
|
892
|
+
oldValue.value = value;
|
|
893
|
+
return true;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
897
|
+
const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
|
|
898
|
+
if (target === /* @__PURE__ */ toRaw(receiver)) {
|
|
899
|
+
if (!hadKey) trigger(target, "add", key, value);
|
|
900
|
+
else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
|
|
901
|
+
}
|
|
902
|
+
return result;
|
|
903
|
+
}
|
|
904
|
+
deleteProperty(target, key) {
|
|
905
|
+
const hadKey = hasOwn(target, key);
|
|
906
|
+
const oldValue = target[key];
|
|
907
|
+
const result = Reflect.deleteProperty(target, key);
|
|
908
|
+
if (result && hadKey) trigger(target, "delete", key, void 0, oldValue);
|
|
909
|
+
return result;
|
|
910
|
+
}
|
|
911
|
+
has(target, key) {
|
|
912
|
+
const result = Reflect.has(target, key);
|
|
913
|
+
if (!isSymbol(key) || !builtInSymbols.has(key)) track(target, "has", key);
|
|
914
|
+
return result;
|
|
915
|
+
}
|
|
916
|
+
ownKeys(target) {
|
|
917
|
+
track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY);
|
|
918
|
+
return Reflect.ownKeys(target);
|
|
919
|
+
}
|
|
920
|
+
};
|
|
921
|
+
var ReadonlyReactiveHandler = class extends BaseReactiveHandler {
|
|
922
|
+
constructor(isShallow2 = false) {
|
|
923
|
+
super(true, isShallow2);
|
|
924
|
+
}
|
|
925
|
+
set(target, key) {
|
|
926
|
+
if (!!(process.env.NODE_ENV !== "production")) warn$1(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
927
|
+
return true;
|
|
928
|
+
}
|
|
929
|
+
deleteProperty(target, key) {
|
|
930
|
+
if (!!(process.env.NODE_ENV !== "production")) warn$1(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
931
|
+
return true;
|
|
932
|
+
}
|
|
933
|
+
};
|
|
934
|
+
var mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
|
|
935
|
+
var readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
|
|
936
|
+
var shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
|
|
937
|
+
var shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
|
|
938
|
+
var toShallow = (value) => value;
|
|
939
|
+
var getProto = (v) => Reflect.getPrototypeOf(v);
|
|
1121
940
|
function createIterableMethod(method, isReadonly2, isShallow2) {
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
};
|
|
1143
|
-
},
|
|
1144
|
-
// iterable protocol
|
|
1145
|
-
[Symbol.iterator]() {
|
|
1146
|
-
return this;
|
|
1147
|
-
}
|
|
1148
|
-
};
|
|
1149
|
-
};
|
|
941
|
+
return function(...args) {
|
|
942
|
+
const target = this["__v_raw"];
|
|
943
|
+
const rawTarget = /* @__PURE__ */ toRaw(target);
|
|
944
|
+
const targetIsMap = isMap(rawTarget);
|
|
945
|
+
const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
|
|
946
|
+
const isKeyOnly = method === "keys" && targetIsMap;
|
|
947
|
+
const innerIterator = target[method](...args);
|
|
948
|
+
const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
949
|
+
!isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
|
|
950
|
+
return extend(Object.create(innerIterator), { next() {
|
|
951
|
+
const { value, done } = innerIterator.next();
|
|
952
|
+
return done ? {
|
|
953
|
+
value,
|
|
954
|
+
done
|
|
955
|
+
} : {
|
|
956
|
+
value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
|
|
957
|
+
done
|
|
958
|
+
};
|
|
959
|
+
} });
|
|
960
|
+
};
|
|
1150
961
|
}
|
|
1151
962
|
function createReadonlyMethod(type) {
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
}
|
|
1266
|
-
const oldValue = get ? get.call(target, key) : void 0;
|
|
1267
|
-
const result = target.delete(key);
|
|
1268
|
-
if (hadKey) {
|
|
1269
|
-
trigger(target, "delete", key, void 0, oldValue);
|
|
1270
|
-
}
|
|
1271
|
-
return result;
|
|
1272
|
-
},
|
|
1273
|
-
clear() {
|
|
1274
|
-
const target = toRaw(this);
|
|
1275
|
-
const hadItems = target.size !== 0;
|
|
1276
|
-
const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0;
|
|
1277
|
-
const result = target.clear();
|
|
1278
|
-
if (hadItems) {
|
|
1279
|
-
trigger(
|
|
1280
|
-
target,
|
|
1281
|
-
"clear",
|
|
1282
|
-
void 0,
|
|
1283
|
-
void 0,
|
|
1284
|
-
oldTarget
|
|
1285
|
-
);
|
|
1286
|
-
}
|
|
1287
|
-
return result;
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
);
|
|
1291
|
-
const iteratorMethods = [
|
|
1292
|
-
"keys",
|
|
1293
|
-
"values",
|
|
1294
|
-
"entries",
|
|
1295
|
-
Symbol.iterator
|
|
1296
|
-
];
|
|
1297
|
-
iteratorMethods.forEach((method) => {
|
|
1298
|
-
instrumentations[method] = createIterableMethod(method, readonly2, shallow);
|
|
1299
|
-
});
|
|
1300
|
-
return instrumentations;
|
|
963
|
+
return function(...args) {
|
|
964
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
965
|
+
const key = args[0] ? `on key "${args[0]}" ` : ``;
|
|
966
|
+
warn$1(`${capitalize(type)} operation ${key}failed: target is readonly.`, /* @__PURE__ */ toRaw(this));
|
|
967
|
+
}
|
|
968
|
+
return type === "delete" ? false : type === "clear" ? void 0 : this;
|
|
969
|
+
};
|
|
970
|
+
}
|
|
971
|
+
function createInstrumentations(readonly, shallow) {
|
|
972
|
+
const instrumentations = {
|
|
973
|
+
get(key) {
|
|
974
|
+
const target = this["__v_raw"];
|
|
975
|
+
const rawTarget = /* @__PURE__ */ toRaw(target);
|
|
976
|
+
const rawKey = /* @__PURE__ */ toRaw(key);
|
|
977
|
+
if (!readonly) {
|
|
978
|
+
if (hasChanged(key, rawKey)) track(rawTarget, "get", key);
|
|
979
|
+
track(rawTarget, "get", rawKey);
|
|
980
|
+
}
|
|
981
|
+
const { has } = getProto(rawTarget);
|
|
982
|
+
const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
|
|
983
|
+
if (has.call(rawTarget, key)) return wrap(target.get(key));
|
|
984
|
+
else if (has.call(rawTarget, rawKey)) return wrap(target.get(rawKey));
|
|
985
|
+
else if (target !== rawTarget) target.get(key);
|
|
986
|
+
},
|
|
987
|
+
get size() {
|
|
988
|
+
const target = this["__v_raw"];
|
|
989
|
+
!readonly && track(/* @__PURE__ */ toRaw(target), "iterate", ITERATE_KEY);
|
|
990
|
+
return target.size;
|
|
991
|
+
},
|
|
992
|
+
has(key) {
|
|
993
|
+
const target = this["__v_raw"];
|
|
994
|
+
const rawTarget = /* @__PURE__ */ toRaw(target);
|
|
995
|
+
const rawKey = /* @__PURE__ */ toRaw(key);
|
|
996
|
+
if (!readonly) {
|
|
997
|
+
if (hasChanged(key, rawKey)) track(rawTarget, "has", key);
|
|
998
|
+
track(rawTarget, "has", rawKey);
|
|
999
|
+
}
|
|
1000
|
+
return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
|
|
1001
|
+
},
|
|
1002
|
+
forEach(callback, thisArg) {
|
|
1003
|
+
const observed = this;
|
|
1004
|
+
const target = observed["__v_raw"];
|
|
1005
|
+
const rawTarget = /* @__PURE__ */ toRaw(target);
|
|
1006
|
+
const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
|
|
1007
|
+
!readonly && track(rawTarget, "iterate", ITERATE_KEY);
|
|
1008
|
+
return target.forEach((value, key) => {
|
|
1009
|
+
return callback.call(thisArg, wrap(value), wrap(key), observed);
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
1013
|
+
extend(instrumentations, readonly ? {
|
|
1014
|
+
add: createReadonlyMethod("add"),
|
|
1015
|
+
set: createReadonlyMethod("set"),
|
|
1016
|
+
delete: createReadonlyMethod("delete"),
|
|
1017
|
+
clear: createReadonlyMethod("clear")
|
|
1018
|
+
} : {
|
|
1019
|
+
add(value) {
|
|
1020
|
+
const target = /* @__PURE__ */ toRaw(this);
|
|
1021
|
+
const proto = getProto(target);
|
|
1022
|
+
const rawValue = /* @__PURE__ */ toRaw(value);
|
|
1023
|
+
const valueToAdd = !shallow && !/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value) ? rawValue : value;
|
|
1024
|
+
if (!(proto.has.call(target, valueToAdd) || hasChanged(value, valueToAdd) && proto.has.call(target, value) || hasChanged(rawValue, valueToAdd) && proto.has.call(target, rawValue))) {
|
|
1025
|
+
target.add(valueToAdd);
|
|
1026
|
+
trigger(target, "add", valueToAdd, valueToAdd);
|
|
1027
|
+
}
|
|
1028
|
+
return this;
|
|
1029
|
+
},
|
|
1030
|
+
set(key, value) {
|
|
1031
|
+
if (!shallow && !/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value)) value = /* @__PURE__ */ toRaw(value);
|
|
1032
|
+
const target = /* @__PURE__ */ toRaw(this);
|
|
1033
|
+
const { has, get } = getProto(target);
|
|
1034
|
+
let hadKey = has.call(target, key);
|
|
1035
|
+
if (!hadKey) {
|
|
1036
|
+
key = /* @__PURE__ */ toRaw(key);
|
|
1037
|
+
hadKey = has.call(target, key);
|
|
1038
|
+
} else if (!!(process.env.NODE_ENV !== "production")) checkIdentityKeys(target, has, key);
|
|
1039
|
+
const oldValue = get.call(target, key);
|
|
1040
|
+
target.set(key, value);
|
|
1041
|
+
if (!hadKey) trigger(target, "add", key, value);
|
|
1042
|
+
else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
|
|
1043
|
+
return this;
|
|
1044
|
+
},
|
|
1045
|
+
delete(key) {
|
|
1046
|
+
const target = /* @__PURE__ */ toRaw(this);
|
|
1047
|
+
const { has, get } = getProto(target);
|
|
1048
|
+
let hadKey = has.call(target, key);
|
|
1049
|
+
if (!hadKey) {
|
|
1050
|
+
key = /* @__PURE__ */ toRaw(key);
|
|
1051
|
+
hadKey = has.call(target, key);
|
|
1052
|
+
} else if (!!(process.env.NODE_ENV !== "production")) checkIdentityKeys(target, has, key);
|
|
1053
|
+
const oldValue = get ? get.call(target, key) : void 0;
|
|
1054
|
+
const result = target.delete(key);
|
|
1055
|
+
if (hadKey) trigger(target, "delete", key, void 0, oldValue);
|
|
1056
|
+
return result;
|
|
1057
|
+
},
|
|
1058
|
+
clear() {
|
|
1059
|
+
const target = /* @__PURE__ */ toRaw(this);
|
|
1060
|
+
const hadItems = target.size !== 0;
|
|
1061
|
+
const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0;
|
|
1062
|
+
const result = target.clear();
|
|
1063
|
+
if (hadItems) trigger(target, "clear", void 0, void 0, oldTarget);
|
|
1064
|
+
return result;
|
|
1065
|
+
}
|
|
1066
|
+
});
|
|
1067
|
+
[
|
|
1068
|
+
"keys",
|
|
1069
|
+
"values",
|
|
1070
|
+
"entries",
|
|
1071
|
+
Symbol.iterator
|
|
1072
|
+
].forEach((method) => {
|
|
1073
|
+
instrumentations[method] = createIterableMethod(method, readonly, shallow);
|
|
1074
|
+
});
|
|
1075
|
+
return instrumentations;
|
|
1301
1076
|
}
|
|
1302
1077
|
function createInstrumentationGetter(isReadonly2, shallow) {
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
receiver
|
|
1316
|
-
);
|
|
1317
|
-
};
|
|
1318
|
-
}
|
|
1319
|
-
const mutableCollectionHandlers = {
|
|
1320
|
-
get: /* @__PURE__ */ createInstrumentationGetter(false, false)
|
|
1321
|
-
};
|
|
1322
|
-
const shallowCollectionHandlers = {
|
|
1323
|
-
get: /* @__PURE__ */ createInstrumentationGetter(false, true)
|
|
1324
|
-
};
|
|
1325
|
-
const readonlyCollectionHandlers = {
|
|
1326
|
-
get: /* @__PURE__ */ createInstrumentationGetter(true, false)
|
|
1327
|
-
};
|
|
1328
|
-
const shallowReadonlyCollectionHandlers = {
|
|
1329
|
-
get: /* @__PURE__ */ createInstrumentationGetter(true, true)
|
|
1330
|
-
};
|
|
1078
|
+
const instrumentations = createInstrumentations(isReadonly2, shallow);
|
|
1079
|
+
return (target, key, receiver) => {
|
|
1080
|
+
if (key === "__v_isReactive") return !isReadonly2;
|
|
1081
|
+
else if (key === "__v_isReadonly") return isReadonly2;
|
|
1082
|
+
else if (key === "__v_raw") return target;
|
|
1083
|
+
return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
var mutableCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, false) };
|
|
1087
|
+
var shallowCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, true) };
|
|
1088
|
+
var readonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, false) };
|
|
1089
|
+
var shallowReadonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, true) };
|
|
1331
1090
|
function checkIdentityKeys(target, has, key) {
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
const readonlyMap = /* @__PURE__ */ new WeakMap();
|
|
1343
|
-
const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
|
|
1091
|
+
const rawKey = /* @__PURE__ */ toRaw(key);
|
|
1092
|
+
if (rawKey !== key && has.call(target, rawKey)) {
|
|
1093
|
+
const type = toRawType(target);
|
|
1094
|
+
warn$1(`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.`);
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
var reactiveMap = /* @__PURE__ */ new WeakMap();
|
|
1098
|
+
var shallowReactiveMap = /* @__PURE__ */ new WeakMap();
|
|
1099
|
+
var readonlyMap = /* @__PURE__ */ new WeakMap();
|
|
1100
|
+
var shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
|
|
1344
1101
|
function targetTypeMap(rawType) {
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
default:
|
|
1355
|
-
return 0;
|
|
1356
|
-
}
|
|
1102
|
+
switch (rawType) {
|
|
1103
|
+
case "Object":
|
|
1104
|
+
case "Array": return 1;
|
|
1105
|
+
case "Map":
|
|
1106
|
+
case "Set":
|
|
1107
|
+
case "WeakMap":
|
|
1108
|
+
case "WeakSet": return 2;
|
|
1109
|
+
default: return 0;
|
|
1110
|
+
}
|
|
1357
1111
|
}
|
|
1358
1112
|
function getTargetType(value) {
|
|
1359
|
-
|
|
1113
|
+
return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
1360
1114
|
}
|
|
1115
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1361
1116
|
function reactive(target) {
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
}
|
|
1365
|
-
return createReactiveObject(
|
|
1366
|
-
target,
|
|
1367
|
-
false,
|
|
1368
|
-
mutableHandlers,
|
|
1369
|
-
mutableCollectionHandlers,
|
|
1370
|
-
reactiveMap
|
|
1371
|
-
);
|
|
1117
|
+
if (/* @__PURE__ */ isReadonly(target)) return target;
|
|
1118
|
+
return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
|
|
1372
1119
|
}
|
|
1120
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1373
1121
|
function shallowReactive(target) {
|
|
1374
|
-
|
|
1375
|
-
target,
|
|
1376
|
-
false,
|
|
1377
|
-
shallowReactiveHandlers,
|
|
1378
|
-
shallowCollectionHandlers,
|
|
1379
|
-
shallowReactiveMap
|
|
1380
|
-
);
|
|
1122
|
+
return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
|
|
1381
1123
|
}
|
|
1124
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1382
1125
|
function readonly(target) {
|
|
1383
|
-
|
|
1384
|
-
target,
|
|
1385
|
-
true,
|
|
1386
|
-
readonlyHandlers,
|
|
1387
|
-
readonlyCollectionHandlers,
|
|
1388
|
-
readonlyMap
|
|
1389
|
-
);
|
|
1126
|
+
return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
|
|
1390
1127
|
}
|
|
1128
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1391
1129
|
function shallowReadonly(target) {
|
|
1392
|
-
|
|
1393
|
-
target,
|
|
1394
|
-
true,
|
|
1395
|
-
shallowReadonlyHandlers,
|
|
1396
|
-
shallowReadonlyCollectionHandlers,
|
|
1397
|
-
shallowReadonlyMap
|
|
1398
|
-
);
|
|
1130
|
+
return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
|
|
1399
1131
|
}
|
|
1400
1132
|
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
if (targetType === 0) {
|
|
1416
|
-
return target;
|
|
1417
|
-
}
|
|
1418
|
-
const existingProxy = proxyMap.get(target);
|
|
1419
|
-
if (existingProxy) {
|
|
1420
|
-
return existingProxy;
|
|
1421
|
-
}
|
|
1422
|
-
const proxy = new Proxy(
|
|
1423
|
-
target,
|
|
1424
|
-
targetType === 2 ? collectionHandlers : baseHandlers
|
|
1425
|
-
);
|
|
1426
|
-
proxyMap.set(target, proxy);
|
|
1427
|
-
return proxy;
|
|
1428
|
-
}
|
|
1133
|
+
if (!isObject(target)) {
|
|
1134
|
+
if (!!(process.env.NODE_ENV !== "production")) warn$1(`value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(target)}`);
|
|
1135
|
+
return target;
|
|
1136
|
+
}
|
|
1137
|
+
if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) return target;
|
|
1138
|
+
const targetType = getTargetType(target);
|
|
1139
|
+
if (targetType === 0) return target;
|
|
1140
|
+
const existingProxy = proxyMap.get(target);
|
|
1141
|
+
if (existingProxy) return existingProxy;
|
|
1142
|
+
const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
|
|
1143
|
+
proxyMap.set(target, proxy);
|
|
1144
|
+
return proxy;
|
|
1145
|
+
}
|
|
1146
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1429
1147
|
function isReactive(value) {
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
}
|
|
1433
|
-
return !!(value && value["__v_isReactive"]);
|
|
1148
|
+
if (/* @__PURE__ */ isReadonly(value)) return /* @__PURE__ */ isReactive(value["__v_raw"]);
|
|
1149
|
+
return !!(value && value["__v_isReactive"]);
|
|
1434
1150
|
}
|
|
1151
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1435
1152
|
function isReadonly(value) {
|
|
1436
|
-
|
|
1153
|
+
return !!(value && value["__v_isReadonly"]);
|
|
1437
1154
|
}
|
|
1155
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1438
1156
|
function isShallow(value) {
|
|
1439
|
-
|
|
1157
|
+
return !!(value && value["__v_isShallow"]);
|
|
1440
1158
|
}
|
|
1159
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1441
1160
|
function isProxy(value) {
|
|
1442
|
-
|
|
1161
|
+
return value ? !!value["__v_raw"] : false;
|
|
1443
1162
|
}
|
|
1163
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1444
1164
|
function toRaw(observed) {
|
|
1445
|
-
|
|
1446
|
-
|
|
1165
|
+
const raw = observed && observed["__v_raw"];
|
|
1166
|
+
return raw ? /* @__PURE__ */ toRaw(raw) : observed;
|
|
1447
1167
|
}
|
|
1448
1168
|
function markRaw(value) {
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
}
|
|
1452
|
-
return value;
|
|
1169
|
+
if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) def(value, "__v_skip", true);
|
|
1170
|
+
return value;
|
|
1453
1171
|
}
|
|
1454
|
-
|
|
1455
|
-
|
|
1172
|
+
var toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value) : value;
|
|
1173
|
+
var toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
|
|
1174
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1456
1175
|
function isRef(r) {
|
|
1457
|
-
|
|
1176
|
+
return r ? r["__v_isRef"] === true : false;
|
|
1458
1177
|
}
|
|
1178
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1459
1179
|
function ref(value) {
|
|
1460
|
-
|
|
1180
|
+
return createRef(value, false);
|
|
1461
1181
|
}
|
|
1182
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1462
1183
|
function shallowRef(value) {
|
|
1463
|
-
|
|
1184
|
+
return createRef(value, true);
|
|
1464
1185
|
}
|
|
1465
1186
|
function createRef(rawValue, shallow) {
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
oldValue
|
|
1506
|
-
});
|
|
1507
|
-
} else {
|
|
1508
|
-
this.dep.trigger();
|
|
1509
|
-
}
|
|
1510
|
-
}
|
|
1511
|
-
}
|
|
1512
|
-
}
|
|
1187
|
+
if (/* @__PURE__ */ isRef(rawValue)) return rawValue;
|
|
1188
|
+
return new RefImpl(rawValue, shallow);
|
|
1189
|
+
}
|
|
1190
|
+
var RefImpl = class {
|
|
1191
|
+
constructor(value, isShallow2) {
|
|
1192
|
+
this.dep = new Dep();
|
|
1193
|
+
this["__v_isRef"] = true;
|
|
1194
|
+
this["__v_isShallow"] = false;
|
|
1195
|
+
this._rawValue = isShallow2 ? value : /* @__PURE__ */ toRaw(value);
|
|
1196
|
+
this._value = isShallow2 ? value : toReactive(value);
|
|
1197
|
+
this["__v_isShallow"] = isShallow2;
|
|
1198
|
+
}
|
|
1199
|
+
get value() {
|
|
1200
|
+
if (!!(process.env.NODE_ENV !== "production")) this.dep.track({
|
|
1201
|
+
target: this,
|
|
1202
|
+
type: "get",
|
|
1203
|
+
key: "value"
|
|
1204
|
+
});
|
|
1205
|
+
else this.dep.track();
|
|
1206
|
+
return this._value;
|
|
1207
|
+
}
|
|
1208
|
+
set value(newValue) {
|
|
1209
|
+
const oldValue = this._rawValue;
|
|
1210
|
+
const useDirectValue = this["__v_isShallow"] || /* @__PURE__ */ isShallow(newValue) || /* @__PURE__ */ isReadonly(newValue);
|
|
1211
|
+
newValue = useDirectValue ? newValue : /* @__PURE__ */ toRaw(newValue);
|
|
1212
|
+
if (hasChanged(newValue, oldValue)) {
|
|
1213
|
+
this._rawValue = newValue;
|
|
1214
|
+
this._value = useDirectValue ? newValue : toReactive(newValue);
|
|
1215
|
+
if (!!(process.env.NODE_ENV !== "production")) this.dep.trigger({
|
|
1216
|
+
target: this,
|
|
1217
|
+
type: "set",
|
|
1218
|
+
key: "value",
|
|
1219
|
+
newValue,
|
|
1220
|
+
oldValue
|
|
1221
|
+
});
|
|
1222
|
+
else this.dep.trigger();
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
};
|
|
1513
1226
|
function triggerRef(ref2) {
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
});
|
|
1522
|
-
} else {
|
|
1523
|
-
ref2.dep.trigger();
|
|
1524
|
-
}
|
|
1525
|
-
}
|
|
1227
|
+
if (ref2.dep) if (!!(process.env.NODE_ENV !== "production")) ref2.dep.trigger({
|
|
1228
|
+
target: ref2,
|
|
1229
|
+
type: "set",
|
|
1230
|
+
key: "value",
|
|
1231
|
+
newValue: ref2._value
|
|
1232
|
+
});
|
|
1233
|
+
else ref2.dep.trigger();
|
|
1526
1234
|
}
|
|
1527
1235
|
function unref(ref2) {
|
|
1528
|
-
|
|
1236
|
+
return /* @__PURE__ */ isRef(ref2) ? ref2.value : ref2;
|
|
1529
1237
|
}
|
|
1530
1238
|
function toValue(source) {
|
|
1531
|
-
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
}
|
|
1543
|
-
}
|
|
1239
|
+
return isFunction(source) ? source() : unref(source);
|
|
1240
|
+
}
|
|
1241
|
+
var shallowUnwrapHandlers = {
|
|
1242
|
+
get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
|
|
1243
|
+
set: (target, key, value, receiver) => {
|
|
1244
|
+
const oldValue = target[key];
|
|
1245
|
+
if (/* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
|
|
1246
|
+
oldValue.value = value;
|
|
1247
|
+
return true;
|
|
1248
|
+
} else return Reflect.set(target, key, value, receiver);
|
|
1249
|
+
}
|
|
1544
1250
|
};
|
|
1545
1251
|
function proxyRefs(objectWithRefs) {
|
|
1546
|
-
|
|
1547
|
-
}
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
}
|
|
1252
|
+
return /* @__PURE__ */ isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
|
|
1253
|
+
}
|
|
1254
|
+
var CustomRefImpl = class {
|
|
1255
|
+
constructor(factory) {
|
|
1256
|
+
this["__v_isRef"] = true;
|
|
1257
|
+
this._value = void 0;
|
|
1258
|
+
const dep = this.dep = new Dep();
|
|
1259
|
+
const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));
|
|
1260
|
+
this._get = get;
|
|
1261
|
+
this._set = set;
|
|
1262
|
+
}
|
|
1263
|
+
get value() {
|
|
1264
|
+
return this._value = this._get();
|
|
1265
|
+
}
|
|
1266
|
+
set value(newVal) {
|
|
1267
|
+
this._set(newVal);
|
|
1268
|
+
}
|
|
1269
|
+
};
|
|
1564
1270
|
function customRef(factory) {
|
|
1565
|
-
|
|
1271
|
+
return new CustomRefImpl(factory);
|
|
1566
1272
|
}
|
|
1273
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1567
1274
|
function toRefs(object) {
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
this["__v_isReadonly"] = true;
|
|
1620
|
-
this._value = void 0;
|
|
1621
|
-
}
|
|
1622
|
-
get value() {
|
|
1623
|
-
return this._value = this._getter();
|
|
1624
|
-
}
|
|
1625
|
-
}
|
|
1275
|
+
if (!!(process.env.NODE_ENV !== "production") && !/* @__PURE__ */ isProxy(object)) warn$1(`toRefs() expects a reactive object but received a plain one.`);
|
|
1276
|
+
const ret = isArray(object) ? new Array(object.length) : {};
|
|
1277
|
+
for (const key in object) ret[key] = propertyToRef(object, key);
|
|
1278
|
+
return ret;
|
|
1279
|
+
}
|
|
1280
|
+
var ObjectRefImpl = class {
|
|
1281
|
+
constructor(_object, key, _defaultValue) {
|
|
1282
|
+
this._object = _object;
|
|
1283
|
+
this._defaultValue = _defaultValue;
|
|
1284
|
+
this["__v_isRef"] = true;
|
|
1285
|
+
this._value = void 0;
|
|
1286
|
+
this._key = isSymbol(key) ? key : String(key);
|
|
1287
|
+
this._raw = /* @__PURE__ */ toRaw(_object);
|
|
1288
|
+
let shallow = true;
|
|
1289
|
+
let obj = _object;
|
|
1290
|
+
if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) do
|
|
1291
|
+
shallow = !/* @__PURE__ */ isProxy(obj) || /* @__PURE__ */ isShallow(obj);
|
|
1292
|
+
while (shallow && (obj = obj["__v_raw"]));
|
|
1293
|
+
this._shallow = shallow;
|
|
1294
|
+
}
|
|
1295
|
+
get value() {
|
|
1296
|
+
let val = this._object[this._key];
|
|
1297
|
+
if (this._shallow) val = unref(val);
|
|
1298
|
+
return this._value = val === void 0 ? this._defaultValue : val;
|
|
1299
|
+
}
|
|
1300
|
+
set value(newVal) {
|
|
1301
|
+
if (this._shallow && /* @__PURE__ */ isRef(this._raw[this._key])) {
|
|
1302
|
+
const nestedRef = this._object[this._key];
|
|
1303
|
+
if (/* @__PURE__ */ isRef(nestedRef)) {
|
|
1304
|
+
nestedRef.value = newVal;
|
|
1305
|
+
return;
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
this._object[this._key] = newVal;
|
|
1309
|
+
}
|
|
1310
|
+
get dep() {
|
|
1311
|
+
return getDepFromReactive(this._raw, this._key);
|
|
1312
|
+
}
|
|
1313
|
+
};
|
|
1314
|
+
var GetterRefImpl = class {
|
|
1315
|
+
constructor(_getter) {
|
|
1316
|
+
this._getter = _getter;
|
|
1317
|
+
this["__v_isRef"] = true;
|
|
1318
|
+
this["__v_isReadonly"] = true;
|
|
1319
|
+
this._value = void 0;
|
|
1320
|
+
}
|
|
1321
|
+
get value() {
|
|
1322
|
+
return this._value = this._getter();
|
|
1323
|
+
}
|
|
1324
|
+
};
|
|
1325
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1626
1326
|
function toRef(source, key, defaultValue) {
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
} else if (isObject(source) && arguments.length > 1) {
|
|
1632
|
-
return propertyToRef(source, key, defaultValue);
|
|
1633
|
-
} else {
|
|
1634
|
-
return ref(source);
|
|
1635
|
-
}
|
|
1327
|
+
if (/* @__PURE__ */ isRef(source)) return source;
|
|
1328
|
+
else if (isFunction(source)) return new GetterRefImpl(source);
|
|
1329
|
+
else if (isObject(source) && arguments.length > 1) return propertyToRef(source, key, defaultValue);
|
|
1330
|
+
else return /* @__PURE__ */ ref(source);
|
|
1636
1331
|
}
|
|
1637
1332
|
function propertyToRef(source, key, defaultValue) {
|
|
1638
|
-
|
|
1639
|
-
}
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1333
|
+
return new ObjectRefImpl(source, key, defaultValue);
|
|
1334
|
+
}
|
|
1335
|
+
var ComputedRefImpl = class {
|
|
1336
|
+
constructor(fn, setter, isSSR) {
|
|
1337
|
+
this.fn = fn;
|
|
1338
|
+
this.setter = setter;
|
|
1339
|
+
/**
|
|
1340
|
+
* @internal
|
|
1341
|
+
*/
|
|
1342
|
+
this._value = void 0;
|
|
1343
|
+
/**
|
|
1344
|
+
* @internal
|
|
1345
|
+
*/
|
|
1346
|
+
this.dep = new Dep(this);
|
|
1347
|
+
/**
|
|
1348
|
+
* @internal
|
|
1349
|
+
*/
|
|
1350
|
+
this.__v_isRef = true;
|
|
1351
|
+
/**
|
|
1352
|
+
* @internal
|
|
1353
|
+
*/
|
|
1354
|
+
this.deps = void 0;
|
|
1355
|
+
/**
|
|
1356
|
+
* @internal
|
|
1357
|
+
*/
|
|
1358
|
+
this.depsTail = void 0;
|
|
1359
|
+
/**
|
|
1360
|
+
* @internal
|
|
1361
|
+
*/
|
|
1362
|
+
this.flags = 16;
|
|
1363
|
+
/**
|
|
1364
|
+
* @internal
|
|
1365
|
+
*/
|
|
1366
|
+
this.globalVersion = globalVersion - 1;
|
|
1367
|
+
/**
|
|
1368
|
+
* @internal
|
|
1369
|
+
*/
|
|
1370
|
+
this.next = void 0;
|
|
1371
|
+
this.effect = this;
|
|
1372
|
+
this["__v_isReadonly"] = !setter;
|
|
1373
|
+
this.isSSR = isSSR;
|
|
1374
|
+
}
|
|
1375
|
+
/**
|
|
1376
|
+
* @internal
|
|
1377
|
+
*/
|
|
1378
|
+
notify() {
|
|
1379
|
+
this.flags |= 16;
|
|
1380
|
+
if (!(this.flags & 8) && activeSub !== this) {
|
|
1381
|
+
batch(this, true);
|
|
1382
|
+
return true;
|
|
1383
|
+
} else if (!!(process.env.NODE_ENV !== "production"));
|
|
1384
|
+
}
|
|
1385
|
+
get value() {
|
|
1386
|
+
const link = !!(process.env.NODE_ENV !== "production") ? this.dep.track({
|
|
1387
|
+
target: this,
|
|
1388
|
+
type: "get",
|
|
1389
|
+
key: "value"
|
|
1390
|
+
}) : this.dep.track();
|
|
1391
|
+
refreshComputed(this);
|
|
1392
|
+
if (link) link.version = this.dep.version;
|
|
1393
|
+
return this._value;
|
|
1394
|
+
}
|
|
1395
|
+
set value(newValue) {
|
|
1396
|
+
if (this.setter) this.setter(newValue);
|
|
1397
|
+
else if (!!(process.env.NODE_ENV !== "production")) warn$1("Write operation failed: computed value is readonly");
|
|
1398
|
+
}
|
|
1399
|
+
};
|
|
1400
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1687
1401
|
function computed(getterOrOptions, debugOptions, isSSR = false) {
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
"ITERATE": "iterate"
|
|
1402
|
+
let getter;
|
|
1403
|
+
let setter;
|
|
1404
|
+
if (isFunction(getterOrOptions)) getter = getterOrOptions;
|
|
1405
|
+
else {
|
|
1406
|
+
getter = getterOrOptions.get;
|
|
1407
|
+
setter = getterOrOptions.set;
|
|
1408
|
+
}
|
|
1409
|
+
const cRef = new ComputedRefImpl(getter, setter, isSSR);
|
|
1410
|
+
if (!!(process.env.NODE_ENV !== "production") && debugOptions && !isSSR) {
|
|
1411
|
+
cRef.onTrack = debugOptions.onTrack;
|
|
1412
|
+
cRef.onTrigger = debugOptions.onTrigger;
|
|
1413
|
+
}
|
|
1414
|
+
return cRef;
|
|
1415
|
+
}
|
|
1416
|
+
var TrackOpTypes = {
|
|
1417
|
+
"GET": "get",
|
|
1418
|
+
"HAS": "has",
|
|
1419
|
+
"ITERATE": "iterate"
|
|
1707
1420
|
};
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1421
|
+
var TriggerOpTypes = {
|
|
1422
|
+
"SET": "set",
|
|
1423
|
+
"ADD": "add",
|
|
1424
|
+
"DELETE": "delete",
|
|
1425
|
+
"CLEAR": "clear"
|
|
1713
1426
|
};
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1427
|
+
var ReactiveFlags = {
|
|
1428
|
+
"SKIP": "__v_skip",
|
|
1429
|
+
"IS_REACTIVE": "__v_isReactive",
|
|
1430
|
+
"IS_READONLY": "__v_isReadonly",
|
|
1431
|
+
"IS_SHALLOW": "__v_isShallow",
|
|
1432
|
+
"RAW": "__v_raw",
|
|
1433
|
+
"IS_REF": "__v_isRef"
|
|
1721
1434
|
};
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1435
|
+
var WatchErrorCodes = {
|
|
1436
|
+
"WATCH_GETTER": 2,
|
|
1437
|
+
"2": "WATCH_GETTER",
|
|
1438
|
+
"WATCH_CALLBACK": 3,
|
|
1439
|
+
"3": "WATCH_CALLBACK",
|
|
1440
|
+
"WATCH_CLEANUP": 4,
|
|
1441
|
+
"4": "WATCH_CLEANUP"
|
|
1729
1442
|
};
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1443
|
+
var INITIAL_WATCHER_VALUE = {};
|
|
1444
|
+
var cleanupMap = /* @__PURE__ */ new WeakMap();
|
|
1445
|
+
var activeWatcher = void 0;
|
|
1733
1446
|
function getCurrentWatcher() {
|
|
1734
|
-
|
|
1447
|
+
return activeWatcher;
|
|
1735
1448
|
}
|
|
1736
1449
|
function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
warn$1(
|
|
1743
|
-
`onWatcherCleanup() was called when there was no active watcher to associate with.`
|
|
1744
|
-
);
|
|
1745
|
-
}
|
|
1450
|
+
if (owner) {
|
|
1451
|
+
let cleanups = cleanupMap.get(owner);
|
|
1452
|
+
if (!cleanups) cleanupMap.set(owner, cleanups = []);
|
|
1453
|
+
cleanups.push(cleanupFn);
|
|
1454
|
+
} else if (!!(process.env.NODE_ENV !== "production") && !failSilently) warn$1(`onWatcherCleanup() was called when there was no active watcher to associate with.`);
|
|
1746
1455
|
}
|
|
1747
1456
|
function watch$1(source, cb, options = EMPTY_OBJ) {
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
}
|
|
1865
|
-
};
|
|
1866
|
-
if (augmentJob) {
|
|
1867
|
-
augmentJob(job);
|
|
1868
|
-
}
|
|
1869
|
-
effect2 = new ReactiveEffect(getter);
|
|
1870
|
-
effect2.scheduler = scheduler ? () => scheduler(job, false) : job;
|
|
1871
|
-
boundCleanup = (fn) => onWatcherCleanup(fn, false, effect2);
|
|
1872
|
-
cleanup = effect2.onStop = () => {
|
|
1873
|
-
const cleanups = cleanupMap.get(effect2);
|
|
1874
|
-
if (cleanups) {
|
|
1875
|
-
if (call) {
|
|
1876
|
-
call(cleanups, 4);
|
|
1877
|
-
} else {
|
|
1878
|
-
for (const cleanup2 of cleanups) cleanup2();
|
|
1879
|
-
}
|
|
1880
|
-
cleanupMap.delete(effect2);
|
|
1881
|
-
}
|
|
1882
|
-
};
|
|
1883
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1884
|
-
effect2.onTrack = options.onTrack;
|
|
1885
|
-
effect2.onTrigger = options.onTrigger;
|
|
1886
|
-
}
|
|
1887
|
-
if (cb) {
|
|
1888
|
-
if (immediate) {
|
|
1889
|
-
job(true);
|
|
1890
|
-
} else {
|
|
1891
|
-
oldValue = effect2.run();
|
|
1892
|
-
}
|
|
1893
|
-
} else if (scheduler) {
|
|
1894
|
-
scheduler(job.bind(null, true), true);
|
|
1895
|
-
} else {
|
|
1896
|
-
effect2.run();
|
|
1897
|
-
}
|
|
1898
|
-
watchHandle.pause = effect2.pause.bind(effect2);
|
|
1899
|
-
watchHandle.resume = effect2.resume.bind(effect2);
|
|
1900
|
-
watchHandle.stop = watchHandle;
|
|
1901
|
-
return watchHandle;
|
|
1457
|
+
const { immediate, deep, once, scheduler, augmentJob, call } = options;
|
|
1458
|
+
const warnInvalidSource = (s) => {
|
|
1459
|
+
(options.onWarn || warn$1)(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`);
|
|
1460
|
+
};
|
|
1461
|
+
const reactiveGetter = (source2) => {
|
|
1462
|
+
if (deep) return source2;
|
|
1463
|
+
if (/* @__PURE__ */ isShallow(source2) || deep === false || deep === 0) return traverse(source2, 1);
|
|
1464
|
+
return traverse(source2);
|
|
1465
|
+
};
|
|
1466
|
+
let effect;
|
|
1467
|
+
let getter;
|
|
1468
|
+
let cleanup;
|
|
1469
|
+
let boundCleanup;
|
|
1470
|
+
let forceTrigger = false;
|
|
1471
|
+
let isMultiSource = false;
|
|
1472
|
+
if (/* @__PURE__ */ isRef(source)) {
|
|
1473
|
+
getter = () => source.value;
|
|
1474
|
+
forceTrigger = /* @__PURE__ */ isShallow(source);
|
|
1475
|
+
} else if (/* @__PURE__ */ isReactive(source)) {
|
|
1476
|
+
getter = () => reactiveGetter(source);
|
|
1477
|
+
forceTrigger = true;
|
|
1478
|
+
} else if (isArray(source)) {
|
|
1479
|
+
isMultiSource = true;
|
|
1480
|
+
forceTrigger = source.some((s) => /* @__PURE__ */ isReactive(s) || /* @__PURE__ */ isShallow(s));
|
|
1481
|
+
getter = () => source.map((s) => {
|
|
1482
|
+
if (/* @__PURE__ */ isRef(s)) return s.value;
|
|
1483
|
+
else if (/* @__PURE__ */ isReactive(s)) return reactiveGetter(s);
|
|
1484
|
+
else if (isFunction(s)) return call ? call(s, 2) : s();
|
|
1485
|
+
else process.env.NODE_ENV !== "production" && warnInvalidSource(s);
|
|
1486
|
+
});
|
|
1487
|
+
} else if (isFunction(source)) if (cb) getter = call ? () => call(source, 2) : source;
|
|
1488
|
+
else getter = () => {
|
|
1489
|
+
if (cleanup) {
|
|
1490
|
+
pauseTracking();
|
|
1491
|
+
try {
|
|
1492
|
+
cleanup();
|
|
1493
|
+
} finally {
|
|
1494
|
+
resetTracking();
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
const currentEffect = activeWatcher;
|
|
1498
|
+
activeWatcher = effect;
|
|
1499
|
+
try {
|
|
1500
|
+
return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
|
|
1501
|
+
} finally {
|
|
1502
|
+
activeWatcher = currentEffect;
|
|
1503
|
+
}
|
|
1504
|
+
};
|
|
1505
|
+
else {
|
|
1506
|
+
getter = NOOP;
|
|
1507
|
+
process.env.NODE_ENV !== "production" && warnInvalidSource(source);
|
|
1508
|
+
}
|
|
1509
|
+
if (cb && deep) {
|
|
1510
|
+
const baseGetter = getter;
|
|
1511
|
+
const depth = deep === true ? Infinity : deep;
|
|
1512
|
+
getter = () => traverse(baseGetter(), depth);
|
|
1513
|
+
}
|
|
1514
|
+
const scope = getCurrentScope();
|
|
1515
|
+
const watchHandle = () => {
|
|
1516
|
+
effect.stop();
|
|
1517
|
+
if (scope && scope.active) remove(scope.effects, effect);
|
|
1518
|
+
};
|
|
1519
|
+
if (once && cb) {
|
|
1520
|
+
const _cb = cb;
|
|
1521
|
+
cb = (...args) => {
|
|
1522
|
+
_cb(...args);
|
|
1523
|
+
watchHandle();
|
|
1524
|
+
};
|
|
1525
|
+
}
|
|
1526
|
+
let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
|
|
1527
|
+
const job = (immediateFirstRun) => {
|
|
1528
|
+
if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) return;
|
|
1529
|
+
if (cb) {
|
|
1530
|
+
const newValue = effect.run();
|
|
1531
|
+
if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
1532
|
+
if (cleanup) cleanup();
|
|
1533
|
+
const currentWatcher = activeWatcher;
|
|
1534
|
+
activeWatcher = effect;
|
|
1535
|
+
try {
|
|
1536
|
+
const args = [
|
|
1537
|
+
newValue,
|
|
1538
|
+
oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
|
|
1539
|
+
boundCleanup
|
|
1540
|
+
];
|
|
1541
|
+
oldValue = newValue;
|
|
1542
|
+
call ? call(cb, 3, args) : cb(...args);
|
|
1543
|
+
} finally {
|
|
1544
|
+
activeWatcher = currentWatcher;
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
} else effect.run();
|
|
1548
|
+
};
|
|
1549
|
+
if (augmentJob) augmentJob(job);
|
|
1550
|
+
effect = new ReactiveEffect(getter);
|
|
1551
|
+
effect.scheduler = scheduler ? () => scheduler(job, false) : job;
|
|
1552
|
+
boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);
|
|
1553
|
+
cleanup = effect.onStop = () => {
|
|
1554
|
+
const cleanups = cleanupMap.get(effect);
|
|
1555
|
+
if (cleanups) {
|
|
1556
|
+
if (call) call(cleanups, 4);
|
|
1557
|
+
else for (const cleanup2 of cleanups) cleanup2();
|
|
1558
|
+
cleanupMap.delete(effect);
|
|
1559
|
+
}
|
|
1560
|
+
};
|
|
1561
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1562
|
+
effect.onTrack = options.onTrack;
|
|
1563
|
+
effect.onTrigger = options.onTrigger;
|
|
1564
|
+
}
|
|
1565
|
+
if (cb) if (immediate) job(true);
|
|
1566
|
+
else oldValue = effect.run();
|
|
1567
|
+
else if (scheduler) scheduler(job.bind(null, true), true);
|
|
1568
|
+
else effect.run();
|
|
1569
|
+
watchHandle.pause = effect.pause.bind(effect);
|
|
1570
|
+
watchHandle.resume = effect.resume.bind(effect);
|
|
1571
|
+
watchHandle.stop = watchHandle;
|
|
1572
|
+
return watchHandle;
|
|
1902
1573
|
}
|
|
1903
1574
|
function traverse(value, depth = Infinity, seen) {
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
});
|
|
1923
|
-
} else if (isPlainObject(value)) {
|
|
1924
|
-
for (const key in value) {
|
|
1925
|
-
traverse(value[key], depth, seen);
|
|
1926
|
-
}
|
|
1927
|
-
for (const key of Object.getOwnPropertySymbols(value)) {
|
|
1928
|
-
if (Object.prototype.propertyIsEnumerable.call(value, key)) {
|
|
1929
|
-
traverse(value[key], depth, seen);
|
|
1930
|
-
}
|
|
1931
|
-
}
|
|
1932
|
-
}
|
|
1933
|
-
return value;
|
|
1934
|
-
}
|
|
1575
|
+
if (depth <= 0 || !isObject(value) || value["__v_skip"]) return value;
|
|
1576
|
+
seen = seen || /* @__PURE__ */ new Map();
|
|
1577
|
+
if ((seen.get(value) || 0) >= depth) return value;
|
|
1578
|
+
seen.set(value, depth);
|
|
1579
|
+
depth--;
|
|
1580
|
+
if (/* @__PURE__ */ isRef(value)) traverse(value.value, depth, seen);
|
|
1581
|
+
else if (isArray(value)) for (let i = 0; i < value.length; i++) traverse(value[i], depth, seen);
|
|
1582
|
+
else if (isSet(value) || isMap(value)) value.forEach((v) => {
|
|
1583
|
+
traverse(v, depth, seen);
|
|
1584
|
+
});
|
|
1585
|
+
else if (isPlainObject(value)) {
|
|
1586
|
+
for (const key in value) traverse(value[key], depth, seen);
|
|
1587
|
+
for (const key of Object.getOwnPropertySymbols(value)) if (Object.prototype.propertyIsEnumerable.call(value, key)) traverse(value[key], depth, seen);
|
|
1588
|
+
}
|
|
1589
|
+
return value;
|
|
1590
|
+
}
|
|
1591
|
+
//#endregion
|
|
1592
|
+
//#region src/warning.ts
|
|
1935
1593
|
function warn(msg, ...args) {
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
/* WATCH_CLEANUP */
|
|
1968
|
-
]: "watcher cleanup function",
|
|
1969
|
-
[
|
|
1970
|
-
3
|
|
1971
|
-
/* APP_ERROR_HANDLER */
|
|
1972
|
-
]: "app errorHandler",
|
|
1973
|
-
[
|
|
1974
|
-
4
|
|
1975
|
-
/* SCHEDULER */
|
|
1976
|
-
]: "scheduler flush"
|
|
1594
|
+
pauseTracking();
|
|
1595
|
+
const warnArgs = [`[Vue warn]: ${msg}`, ...args];
|
|
1596
|
+
/* istanbul ignore if */
|
|
1597
|
+
console.warn(...warnArgs);
|
|
1598
|
+
resetTracking();
|
|
1599
|
+
}
|
|
1600
|
+
//#endregion
|
|
1601
|
+
//#region src/enums.ts
|
|
1602
|
+
var LifecycleHooks = /* @__PURE__ */ function(LifecycleHooks) {
|
|
1603
|
+
LifecycleHooks["ACTIVATED"] = "a";
|
|
1604
|
+
LifecycleHooks["DEACTIVATED"] = "da";
|
|
1605
|
+
return LifecycleHooks;
|
|
1606
|
+
}({});
|
|
1607
|
+
//#endregion
|
|
1608
|
+
//#region src/errorHandling.ts
|
|
1609
|
+
var ErrorCodes = /* @__PURE__ */ function(ErrorCodes) {
|
|
1610
|
+
ErrorCodes[ErrorCodes["WATCH_GETTER"] = 0] = "WATCH_GETTER";
|
|
1611
|
+
ErrorCodes[ErrorCodes["WATCH_CALLBACK"] = 1] = "WATCH_CALLBACK";
|
|
1612
|
+
ErrorCodes[ErrorCodes["WATCH_CLEANUP"] = 2] = "WATCH_CLEANUP";
|
|
1613
|
+
ErrorCodes[ErrorCodes["APP_ERROR_HANDLER"] = 3] = "APP_ERROR_HANDLER";
|
|
1614
|
+
ErrorCodes[ErrorCodes["SCHEDULER"] = 4] = "SCHEDULER";
|
|
1615
|
+
return ErrorCodes;
|
|
1616
|
+
}({});
|
|
1617
|
+
var ErrorTypeStrings = {
|
|
1618
|
+
[LifecycleHooks.ACTIVATED]: "activated hook",
|
|
1619
|
+
[LifecycleHooks.DEACTIVATED]: "deactivated hook",
|
|
1620
|
+
[ErrorCodes.WATCH_GETTER]: "watcher getter",
|
|
1621
|
+
[ErrorCodes.WATCH_CALLBACK]: "watcher callback",
|
|
1622
|
+
[ErrorCodes.WATCH_CLEANUP]: "watcher cleanup function",
|
|
1623
|
+
[ErrorCodes.APP_ERROR_HANDLER]: "app errorHandler",
|
|
1624
|
+
[ErrorCodes.SCHEDULER]: "scheduler flush"
|
|
1977
1625
|
};
|
|
1978
1626
|
function callWithErrorHandling(fn, instance, type, args) {
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1627
|
+
try {
|
|
1628
|
+
return args ? fn(...args) : fn();
|
|
1629
|
+
} catch (err) {
|
|
1630
|
+
handleError(err, instance, type);
|
|
1631
|
+
}
|
|
1984
1632
|
}
|
|
1985
1633
|
function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
|
|
1999
|
-
}
|
|
2000
|
-
return values;
|
|
2001
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
2002
|
-
warn(
|
|
2003
|
-
`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
|
|
2004
|
-
);
|
|
2005
|
-
}
|
|
1634
|
+
if (isFunction(fn)) {
|
|
1635
|
+
const res = callWithErrorHandling(fn, instance, type, args);
|
|
1636
|
+
if (res && isPromise(res)) res.catch((err) => {
|
|
1637
|
+
handleError(err, instance, type);
|
|
1638
|
+
});
|
|
1639
|
+
return res;
|
|
1640
|
+
}
|
|
1641
|
+
if (isArray(fn)) {
|
|
1642
|
+
const values = [];
|
|
1643
|
+
for (let i = 0; i < fn.length; i++) values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
|
|
1644
|
+
return values;
|
|
1645
|
+
} else if (!!(process.env.NODE_ENV !== "production")) warn(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`);
|
|
2006
1646
|
}
|
|
2007
1647
|
function handleError(err, instance, type, throwInDev = true) {
|
|
2008
|
-
|
|
2009
|
-
logError(err, type, contextVNode, throwInDev);
|
|
1648
|
+
logError(err, type, null, throwInDev);
|
|
2010
1649
|
}
|
|
2011
1650
|
function logError(err, type, contextVNode, throwInDev = true) {
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
1651
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1652
|
+
const info = ErrorTypeStrings[type];
|
|
1653
|
+
warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
|
1654
|
+
if (throwInDev) throw err;
|
|
1655
|
+
else console.error(err);
|
|
1656
|
+
} else console.error(err);
|
|
1657
|
+
}
|
|
1658
|
+
//#endregion
|
|
1659
|
+
//#region src/scheduler.ts
|
|
1660
|
+
var SchedulerJobFlags = /* @__PURE__ */ function(SchedulerJobFlags) {
|
|
1661
|
+
SchedulerJobFlags[SchedulerJobFlags["QUEUED"] = 1] = "QUEUED";
|
|
1662
|
+
SchedulerJobFlags[SchedulerJobFlags["PRE"] = 2] = "PRE";
|
|
1663
|
+
/**
|
|
1664
|
+
* Indicates whether the effect is allowed to recursively trigger itself
|
|
1665
|
+
* when managed by the scheduler.
|
|
1666
|
+
*
|
|
1667
|
+
* By default, a job cannot trigger itself because some built-in method calls,
|
|
1668
|
+
* e.g. Array.prototype.push actually performs reads as well (#1740) which
|
|
1669
|
+
* can lead to confusing infinite loops.
|
|
1670
|
+
* The allowed cases are component update functions and watch callbacks.
|
|
1671
|
+
* Component update functions may update child component props, which in turn
|
|
1672
|
+
* trigger flush: "pre" watch callbacks that mutates state that the parent
|
|
1673
|
+
* relies on (#1801). Watch callbacks doesn't track its dependencies so if it
|
|
1674
|
+
* triggers itself again, it's likely intentional and it is the user's
|
|
1675
|
+
* responsibility to perform recursive state mutation that eventually
|
|
1676
|
+
* stabilizes (#1727).
|
|
1677
|
+
*/
|
|
1678
|
+
SchedulerJobFlags[SchedulerJobFlags["ALLOW_RECURSE"] = 4] = "ALLOW_RECURSE";
|
|
1679
|
+
SchedulerJobFlags[SchedulerJobFlags["DISPOSED"] = 8] = "DISPOSED";
|
|
1680
|
+
return SchedulerJobFlags;
|
|
1681
|
+
}({});
|
|
1682
|
+
var queue = [];
|
|
1683
|
+
var flushIndex = -1;
|
|
1684
|
+
var pendingPostFlushCbs = [];
|
|
1685
|
+
var activePostFlushCbs = null;
|
|
1686
|
+
var postFlushIndex = 0;
|
|
1687
|
+
var resolvedPromise = /* @__PURE__ */ Promise.resolve();
|
|
1688
|
+
var currentFlushPromise = null;
|
|
1689
|
+
var RECURSION_LIMIT = 100;
|
|
2039
1690
|
function nextTick(fn) {
|
|
2040
|
-
|
|
2041
|
-
|
|
1691
|
+
const p = currentFlushPromise || resolvedPromise;
|
|
1692
|
+
return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
2042
1693
|
}
|
|
2043
1694
|
function findInsertionIndex(id) {
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
}
|
|
2055
|
-
}
|
|
2056
|
-
return start;
|
|
1695
|
+
let start = flushIndex + 1;
|
|
1696
|
+
let end = queue.length;
|
|
1697
|
+
while (start < end) {
|
|
1698
|
+
const middle = start + end >>> 1;
|
|
1699
|
+
const middleJob = queue[middle];
|
|
1700
|
+
const middleJobId = getId(middleJob);
|
|
1701
|
+
if (middleJobId < id || middleJobId === id && middleJob.flags & SchedulerJobFlags.PRE) start = middle + 1;
|
|
1702
|
+
else end = middle;
|
|
1703
|
+
}
|
|
1704
|
+
return start;
|
|
2057
1705
|
}
|
|
2058
1706
|
function queueJob(job) {
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
}
|
|
2068
|
-
job.flags |= 1;
|
|
2069
|
-
queueFlush();
|
|
2070
|
-
}
|
|
1707
|
+
if (!(job.flags & SchedulerJobFlags.QUEUED)) {
|
|
1708
|
+
const jobId = getId(job);
|
|
1709
|
+
const lastJob = queue[queue.length - 1];
|
|
1710
|
+
if (!lastJob || !(job.flags & SchedulerJobFlags.PRE) && jobId >= getId(lastJob)) queue.push(job);
|
|
1711
|
+
else queue.splice(findInsertionIndex(jobId), 0, job);
|
|
1712
|
+
job.flags |= SchedulerJobFlags.QUEUED;
|
|
1713
|
+
queueFlush();
|
|
1714
|
+
}
|
|
2071
1715
|
}
|
|
2072
1716
|
function queueFlush() {
|
|
2073
|
-
|
|
2074
|
-
currentFlushPromise = resolvedPromise.then(flushJobs);
|
|
2075
|
-
}
|
|
1717
|
+
if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(flushJobs);
|
|
2076
1718
|
}
|
|
2077
1719
|
function flushPostFlushCbs(seen) {
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
if (!(cb.flags & 8)) cb();
|
|
2100
|
-
cb.flags &= -2;
|
|
2101
|
-
}
|
|
2102
|
-
activePostFlushCbs = null;
|
|
2103
|
-
postFlushIndex = 0;
|
|
2104
|
-
}
|
|
2105
|
-
}
|
|
2106
|
-
const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
|
|
1720
|
+
if (pendingPostFlushCbs.length) {
|
|
1721
|
+
const deduped = [...new Set(pendingPostFlushCbs)].sort((a, b) => getId(a) - getId(b));
|
|
1722
|
+
pendingPostFlushCbs.length = 0;
|
|
1723
|
+
if (activePostFlushCbs) {
|
|
1724
|
+
activePostFlushCbs.push(...deduped);
|
|
1725
|
+
return;
|
|
1726
|
+
}
|
|
1727
|
+
activePostFlushCbs = deduped;
|
|
1728
|
+
if (!!(process.env.NODE_ENV !== "production")) seen = seen || /* @__PURE__ */ new Map();
|
|
1729
|
+
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
|
|
1730
|
+
const cb = activePostFlushCbs[postFlushIndex];
|
|
1731
|
+
if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) continue;
|
|
1732
|
+
if (cb.flags & SchedulerJobFlags.ALLOW_RECURSE) cb.flags &= ~SchedulerJobFlags.QUEUED;
|
|
1733
|
+
if (!(cb.flags & SchedulerJobFlags.DISPOSED)) cb();
|
|
1734
|
+
cb.flags &= ~SchedulerJobFlags.QUEUED;
|
|
1735
|
+
}
|
|
1736
|
+
activePostFlushCbs = null;
|
|
1737
|
+
postFlushIndex = 0;
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
var getId = (job) => job.id == null ? job.flags & SchedulerJobFlags.PRE ? -1 : Infinity : job.id;
|
|
2107
1741
|
function flushJobs(seen) {
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
}
|
|
2132
|
-
} finally {
|
|
2133
|
-
for (; flushIndex < queue.length; flushIndex++) {
|
|
2134
|
-
const job = queue[flushIndex];
|
|
2135
|
-
if (job) {
|
|
2136
|
-
job.flags &= -2;
|
|
2137
|
-
}
|
|
2138
|
-
}
|
|
2139
|
-
flushIndex = -1;
|
|
2140
|
-
queue.length = 0;
|
|
2141
|
-
flushPostFlushCbs(seen);
|
|
2142
|
-
currentFlushPromise = null;
|
|
2143
|
-
if (queue.length || pendingPostFlushCbs.length) {
|
|
2144
|
-
flushJobs(seen);
|
|
2145
|
-
}
|
|
2146
|
-
}
|
|
1742
|
+
if (!!(process.env.NODE_ENV !== "production")) seen = seen || /* @__PURE__ */ new Map();
|
|
1743
|
+
const check = !!(process.env.NODE_ENV !== "production") ? (job) => checkRecursiveUpdates(seen, job) : NOOP;
|
|
1744
|
+
try {
|
|
1745
|
+
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
1746
|
+
const job = queue[flushIndex];
|
|
1747
|
+
if (job && !(job.flags & SchedulerJobFlags.DISPOSED)) {
|
|
1748
|
+
if (!!(process.env.NODE_ENV !== "production") && check(job)) continue;
|
|
1749
|
+
if (job.flags & SchedulerJobFlags.ALLOW_RECURSE) job.flags &= ~SchedulerJobFlags.QUEUED;
|
|
1750
|
+
callWithErrorHandling(job, null, ErrorCodes.SCHEDULER);
|
|
1751
|
+
if (!(job.flags & SchedulerJobFlags.ALLOW_RECURSE)) job.flags &= ~SchedulerJobFlags.QUEUED;
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
} finally {
|
|
1755
|
+
for (; flushIndex < queue.length; flushIndex++) {
|
|
1756
|
+
const job = queue[flushIndex];
|
|
1757
|
+
if (job) job.flags &= ~SchedulerJobFlags.QUEUED;
|
|
1758
|
+
}
|
|
1759
|
+
flushIndex = -1;
|
|
1760
|
+
queue.length = 0;
|
|
1761
|
+
flushPostFlushCbs(seen);
|
|
1762
|
+
currentFlushPromise = null;
|
|
1763
|
+
if (queue.length || pendingPostFlushCbs.length) flushJobs(seen);
|
|
1764
|
+
}
|
|
2147
1765
|
}
|
|
2148
1766
|
function checkRecursiveUpdates(seen, fn) {
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
}
|
|
2164
|
-
function watchSyncEffect(effect2, options) {
|
|
2165
|
-
return doWatch(
|
|
2166
|
-
effect2,
|
|
2167
|
-
null,
|
|
2168
|
-
!!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "sync" }) : { flush: "sync" }
|
|
2169
|
-
);
|
|
1767
|
+
const count = seen.get(fn) || 0;
|
|
1768
|
+
if (count > RECURSION_LIMIT) {
|
|
1769
|
+
handleError("Maximum recursive updates exceeded. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.", null, ErrorCodes.APP_ERROR_HANDLER);
|
|
1770
|
+
return true;
|
|
1771
|
+
}
|
|
1772
|
+
seen.set(fn, count + 1);
|
|
1773
|
+
return false;
|
|
1774
|
+
}
|
|
1775
|
+
//#endregion
|
|
1776
|
+
//#region src/apiWatch.ts
|
|
1777
|
+
function watchEffect(effect, options) {
|
|
1778
|
+
return doWatch(effect, null, options);
|
|
1779
|
+
}
|
|
1780
|
+
function watchSyncEffect(effect, options) {
|
|
1781
|
+
return doWatch(effect, null, !!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "sync" }) : { flush: "sync" });
|
|
2170
1782
|
}
|
|
2171
1783
|
function watch(source, cb, options) {
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
`\`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.`
|
|
2175
|
-
);
|
|
2176
|
-
}
|
|
2177
|
-
return doWatch(source, cb, options);
|
|
1784
|
+
if (!!(process.env.NODE_ENV !== "production") && !isFunction(cb)) warn("`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.");
|
|
1785
|
+
return doWatch(source, cb, options);
|
|
2178
1786
|
}
|
|
2179
1787
|
function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
baseWatchOptions.scheduler = (job, isFirstRun) => {
|
|
2205
|
-
if (isFirstRun) {
|
|
2206
|
-
job();
|
|
2207
|
-
} else {
|
|
2208
|
-
queueJob(job);
|
|
2209
|
-
}
|
|
2210
|
-
};
|
|
2211
|
-
}
|
|
2212
|
-
baseWatchOptions.augmentJob = (job) => {
|
|
2213
|
-
if (cb) {
|
|
2214
|
-
job.flags |= SchedulerJobFlags.ALLOW_RECURSE;
|
|
2215
|
-
}
|
|
2216
|
-
if (isPre) {
|
|
2217
|
-
job.flags |= SchedulerJobFlags.PRE;
|
|
2218
|
-
}
|
|
2219
|
-
};
|
|
2220
|
-
const watchHandle = watch$1(source, cb, baseWatchOptions);
|
|
2221
|
-
return watchHandle;
|
|
2222
|
-
}
|
|
1788
|
+
const { immediate, deep, flush, once } = options;
|
|
1789
|
+
if (!!(process.env.NODE_ENV !== "production") && !cb) {
|
|
1790
|
+
if (immediate !== void 0) warn("watch() \"immediate\" option is only respected when using the watch(source, callback, options?) signature.");
|
|
1791
|
+
if (deep !== void 0) warn("watch() \"deep\" option is only respected when using the watch(source, callback, options?) signature.");
|
|
1792
|
+
if (once !== void 0) warn("watch() \"once\" option is only respected when using the watch(source, callback, options?) signature.");
|
|
1793
|
+
}
|
|
1794
|
+
const baseWatchOptions = extend({}, options);
|
|
1795
|
+
if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn;
|
|
1796
|
+
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, null, type, args);
|
|
1797
|
+
let isPre = false;
|
|
1798
|
+
if (flush !== "sync") {
|
|
1799
|
+
isPre = true;
|
|
1800
|
+
baseWatchOptions.scheduler = (job, isFirstRun) => {
|
|
1801
|
+
if (isFirstRun) job();
|
|
1802
|
+
else queueJob(job);
|
|
1803
|
+
};
|
|
1804
|
+
}
|
|
1805
|
+
baseWatchOptions.augmentJob = (job) => {
|
|
1806
|
+
if (cb) job.flags |= SchedulerJobFlags.ALLOW_RECURSE;
|
|
1807
|
+
if (isPre) job.flags |= SchedulerJobFlags.PRE;
|
|
1808
|
+
};
|
|
1809
|
+
return watch$1(source, cb, baseWatchOptions);
|
|
1810
|
+
}
|
|
1811
|
+
//#endregion
|
|
2223
1812
|
exports.ARRAY_ITERATE_KEY = ARRAY_ITERATE_KEY;
|
|
2224
1813
|
exports.EffectFlags = EffectFlags;
|
|
2225
1814
|
exports.EffectScope = EffectScope;
|
|
@@ -2273,4 +1862,5 @@ exports.unref = unref;
|
|
|
2273
1862
|
exports.watch = watch;
|
|
2274
1863
|
exports.watchEffect = watchEffect;
|
|
2275
1864
|
exports.watchSyncEffect = watchSyncEffect;
|
|
2276
|
-
|
|
1865
|
+
|
|
1866
|
+
//# sourceMappingURL=index.cjs.map
|