@vue/runtime-core 3.2.19 → 3.2.23

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.
@@ -1,6 +1,6 @@
1
1
  import { toRaw, ref, pauseTracking, resetTracking, reactive, computed, isRef, shallowReactive, trigger, ReactiveEffect, isProxy, shallowReadonly, track, EffectScope, markRaw, proxyRefs, isReactive, isReadonly } from '@vue/reactivity';
2
2
  export { EffectScope, ReactiveEffect, computed, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, triggerRef, unref } from '@vue/reactivity';
3
- import { getGlobalThis, extend, EMPTY_OBJ, toHandlerKey, isFunction as isFunction$1, toNumber, hyphenate, camelize, isArray, isOn, hasOwn, isModelListener, isObject as isObject$1, remove, isString, invokeArrayFns, isPromise as isPromise$1, NOOP, def, isReservedProp, EMPTY_ARR, capitalize, toRawType, makeMap, NO, normalizeClass, normalizeStyle, isGloballyWhitelisted, hasChanged, isSet, isMap, isPlainObject } from '@vue/shared';
3
+ import { getGlobalThis, extend, EMPTY_OBJ, toHandlerKey, isFunction, toNumber, hyphenate, camelize, isArray, isOn, hasOwn, isModelListener, isObject, remove, isString, invokeArrayFns, isPromise, NOOP, def, isReservedProp, EMPTY_ARR, capitalize, toRawType, makeMap, NO, normalizeClass, normalizeStyle, isGloballyWhitelisted, hasChanged, isSet, isMap, isPlainObject } from '@vue/shared';
4
4
  export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
5
5
 
6
6
  /* eslint-disable no-restricted-globals */
@@ -23,19 +23,22 @@ function registerHMR(instance) {
23
23
  const id = instance.type.__hmrId;
24
24
  let record = map.get(id);
25
25
  if (!record) {
26
- createRecord(id);
26
+ createRecord(id, instance.type);
27
27
  record = map.get(id);
28
28
  }
29
- record.add(instance);
29
+ record.instances.add(instance);
30
30
  }
31
31
  function unregisterHMR(instance) {
32
- map.get(instance.type.__hmrId).delete(instance);
32
+ map.get(instance.type.__hmrId).instances.delete(instance);
33
33
  }
34
- function createRecord(id) {
34
+ function createRecord(id, initialDef) {
35
35
  if (map.has(id)) {
36
36
  return false;
37
37
  }
38
- map.set(id, new Set());
38
+ map.set(id, {
39
+ initialDef: normalizeClassComponent(initialDef),
40
+ instances: new Set()
41
+ });
39
42
  return true;
40
43
  }
41
44
  function normalizeClassComponent(component) {
@@ -46,7 +49,9 @@ function rerender(id, newRender) {
46
49
  if (!record) {
47
50
  return;
48
51
  }
49
- [...record].forEach(instance => {
52
+ // update initial record (for not-yet-rendered component)
53
+ record.initialDef.render = newRender;
54
+ [...record.instances].forEach(instance => {
50
55
  if (newRender) {
51
56
  instance.render = newRender;
52
57
  normalizeClassComponent(instance.type).render = newRender;
@@ -63,17 +68,16 @@ function reload(id, newComp) {
63
68
  if (!record)
64
69
  return;
65
70
  newComp = normalizeClassComponent(newComp);
71
+ // update initial def (for not-yet-rendered components)
72
+ updateComponentDef(record.initialDef, newComp);
66
73
  // create a snapshot which avoids the set being mutated during updates
67
- const instances = [...record];
74
+ const instances = [...record.instances];
68
75
  for (const instance of instances) {
69
76
  const oldComp = normalizeClassComponent(instance.type);
70
77
  if (!hmrDirtyComponents.has(oldComp)) {
71
78
  // 1. Update existing comp definition to match new one
72
- extend(oldComp, newComp);
73
- for (const key in oldComp) {
74
- if (key !== '__file' && !(key in newComp)) {
75
- delete oldComp[key];
76
- }
79
+ if (oldComp !== record.initialDef) {
80
+ updateComponentDef(oldComp, newComp);
77
81
  }
78
82
  // 2. mark definition dirty. This forces the renderer to replace the
79
83
  // component on patch.
@@ -119,6 +123,14 @@ function reload(id, newComp) {
119
123
  }
120
124
  });
121
125
  }
126
+ function updateComponentDef(oldComp, newComp) {
127
+ extend(oldComp, newComp);
128
+ for (const key in oldComp) {
129
+ if (key !== '__file' && !(key in newComp)) {
130
+ delete oldComp[key];
131
+ }
132
+ }
133
+ }
122
134
  function tryWrap(fn) {
123
135
  return (id, arg) => {
124
136
  try {
@@ -134,27 +146,52 @@ function tryWrap(fn) {
134
146
 
135
147
  let devtools;
136
148
  let buffer = [];
149
+ let devtoolsNotInstalled = false;
137
150
  function emit(event, ...args) {
138
151
  if (devtools) {
139
152
  devtools.emit(event, ...args);
140
153
  }
141
- else {
154
+ else if (!devtoolsNotInstalled) {
142
155
  buffer.push({ event, args });
143
156
  }
144
157
  }
145
158
  function setDevtoolsHook(hook, target) {
159
+ var _a, _b;
146
160
  devtools = hook;
147
161
  if (devtools) {
148
162
  devtools.enabled = true;
149
163
  buffer.forEach(({ event, args }) => devtools.emit(event, ...args));
150
164
  buffer = [];
151
165
  }
152
- else {
166
+ else if (
167
+ // handle late devtools injection - only do this if we are in an actual
168
+ // browser environment to avoid the timer handle stalling test runner exit
169
+ // (#4815)
170
+ // eslint-disable-next-line no-restricted-globals
171
+ typeof window !== 'undefined' &&
172
+ // some envs mock window but not fully
173
+ window.HTMLElement &&
174
+ // also exclude jsdom
175
+ !((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes('jsdom'))) {
153
176
  const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
154
177
  target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []);
155
178
  replay.push((newHook) => {
156
179
  setDevtoolsHook(newHook, target);
157
180
  });
181
+ // clear buffer after 3s - the user probably doesn't have devtools installed
182
+ // at all, and keeping the buffer will cause memory leaks (#4738)
183
+ setTimeout(() => {
184
+ if (!devtools) {
185
+ target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
186
+ devtoolsNotInstalled = true;
187
+ buffer = [];
188
+ }
189
+ }, 3000);
190
+ }
191
+ else {
192
+ // non-browser env, assume not installed
193
+ devtoolsNotInstalled = true;
194
+ buffer = [];
158
195
  }
159
196
  }
160
197
  function devtoolsInitApp(app, version) {
@@ -203,7 +240,7 @@ function emit$1(instance, event, ...rawArgs) {
203
240
  }
204
241
  else {
205
242
  const validator = emitsOptions[event];
206
- if (isFunction$1(validator)) {
243
+ if (isFunction(validator)) {
207
244
  const isValid = validator(...rawArgs);
208
245
  if (!isValid) {
209
246
  warn(`Invalid event arguments: event validation failed for event "${event}".`);
@@ -273,7 +310,7 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
273
310
  let normalized = {};
274
311
  // apply mixin/extends props
275
312
  let hasExtends = false;
276
- if (__VUE_OPTIONS_API__ && !isFunction$1(comp)) {
313
+ if (__VUE_OPTIONS_API__ && !isFunction(comp)) {
277
314
  const extendEmits = (raw) => {
278
315
  const normalizedFromExtend = normalizeEmitsOptions(raw, appContext, true);
279
316
  if (normalizedFromExtend) {
@@ -723,7 +760,7 @@ const SuspenseImpl = {
723
760
  const Suspense = (SuspenseImpl );
724
761
  function triggerEvent(vnode, name) {
725
762
  const eventListener = vnode.props && vnode.props[name];
726
- if (isFunction$1(eventListener)) {
763
+ if (isFunction(eventListener)) {
727
764
  eventListener();
728
765
  }
729
766
  }
@@ -1069,7 +1106,7 @@ function normalizeSuspenseChildren(vnode) {
1069
1106
  }
1070
1107
  function normalizeSuspenseSlot(s) {
1071
1108
  let block;
1072
- if (isFunction$1(s)) {
1109
+ if (isFunction(s)) {
1073
1110
  const trackBlock = isBlockTreeEnabled && s._c;
1074
1111
  if (trackBlock) {
1075
1112
  // disableTracking: false
@@ -1160,7 +1197,7 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
1160
1197
  return provides[key];
1161
1198
  }
1162
1199
  else if (arguments.length > 1) {
1163
- return treatDefaultAsFactory && isFunction$1(defaultValue)
1200
+ return treatDefaultAsFactory && isFunction(defaultValue)
1164
1201
  ? defaultValue.call(instance.proxy)
1165
1202
  : defaultValue;
1166
1203
  }
@@ -1230,7 +1267,9 @@ const BaseTransitionImpl = {
1230
1267
  const rawProps = toRaw(props);
1231
1268
  const { mode } = rawProps;
1232
1269
  // check mode
1233
- if ((process.env.NODE_ENV !== 'production') && mode && !['in-out', 'out-in', 'default'].includes(mode)) {
1270
+ if ((process.env.NODE_ENV !== 'production') &&
1271
+ mode &&
1272
+ mode !== 'in-out' && mode !== 'out-in' && mode !== 'default') {
1234
1273
  warn(`invalid <transition> mode: ${mode}`);
1235
1274
  }
1236
1275
  // at this point children has a guaranteed length of 1.
@@ -1487,12 +1526,12 @@ function getTransitionRawChildren(children, keepComment = false) {
1487
1526
 
1488
1527
  // implementation, close to no-op
1489
1528
  function defineComponent(options) {
1490
- return isFunction$1(options) ? { setup: options, name: options.name } : options;
1529
+ return isFunction(options) ? { setup: options, name: options.name } : options;
1491
1530
  }
1492
1531
 
1493
1532
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
1494
1533
  function defineAsyncComponent(source) {
1495
- if (isFunction$1(source)) {
1534
+ if (isFunction(source)) {
1496
1535
  source = { loader: source };
1497
1536
  }
1498
1537
  const { loader, loadingComponent, errorComponent, delay = 200, timeout, // undefined = never times out
@@ -1536,7 +1575,7 @@ function defineAsyncComponent(source) {
1536
1575
  (comp.__esModule || comp[Symbol.toStringTag] === 'Module')) {
1537
1576
  comp = comp.default;
1538
1577
  }
1539
- if ((process.env.NODE_ENV !== 'production') && comp && !isObject$1(comp) && !isFunction$1(comp)) {
1578
+ if ((process.env.NODE_ENV !== 'production') && comp && !isObject(comp) && !isFunction(comp)) {
1540
1579
  throw new Error(`Invalid async component load result: ${comp}`);
1541
1580
  }
1542
1581
  resolvedComp = comp;
@@ -1870,7 +1909,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
1870
1909
  }
1871
1910
  current = current.parent;
1872
1911
  }
1873
- hook();
1912
+ return hook();
1874
1913
  });
1875
1914
  injectHook(type, wrappedHook, target);
1876
1915
  // In addition to registering it on the target instance, we walk up the parent
@@ -2022,7 +2061,7 @@ function applyOptions(instance) {
2022
2061
  if (methods) {
2023
2062
  for (const key in methods) {
2024
2063
  const methodHandler = methods[key];
2025
- if (isFunction$1(methodHandler)) {
2064
+ if (isFunction(methodHandler)) {
2026
2065
  // In dev mode, we use the `createRenderContext` function to define
2027
2066
  // methods to the proxy target, and those are read-only but
2028
2067
  // reconfigurable, so it needs to be redefined here
@@ -2048,17 +2087,17 @@ function applyOptions(instance) {
2048
2087
  }
2049
2088
  }
2050
2089
  if (dataOptions) {
2051
- if ((process.env.NODE_ENV !== 'production') && !isFunction$1(dataOptions)) {
2090
+ if ((process.env.NODE_ENV !== 'production') && !isFunction(dataOptions)) {
2052
2091
  warn(`The data option must be a function. ` +
2053
2092
  `Plain object usage is no longer supported.`);
2054
2093
  }
2055
2094
  const data = dataOptions.call(publicThis, publicThis);
2056
- if ((process.env.NODE_ENV !== 'production') && isPromise$1(data)) {
2095
+ if ((process.env.NODE_ENV !== 'production') && isPromise(data)) {
2057
2096
  warn(`data() returned a Promise - note data() cannot be async; If you ` +
2058
2097
  `intend to perform data fetching before component renders, use ` +
2059
2098
  `async setup() + <Suspense>.`);
2060
2099
  }
2061
- if (!isObject$1(data)) {
2100
+ if (!isObject(data)) {
2062
2101
  (process.env.NODE_ENV !== 'production') && warn(`data() should return an object.`);
2063
2102
  }
2064
2103
  else {
@@ -2084,15 +2123,15 @@ function applyOptions(instance) {
2084
2123
  if (computedOptions) {
2085
2124
  for (const key in computedOptions) {
2086
2125
  const opt = computedOptions[key];
2087
- const get = isFunction$1(opt)
2126
+ const get = isFunction(opt)
2088
2127
  ? opt.bind(publicThis, publicThis)
2089
- : isFunction$1(opt.get)
2128
+ : isFunction(opt.get)
2090
2129
  ? opt.get.bind(publicThis, publicThis)
2091
2130
  : NOOP;
2092
2131
  if ((process.env.NODE_ENV !== 'production') && get === NOOP) {
2093
2132
  warn(`Computed property "${key}" has no getter.`);
2094
2133
  }
2095
- const set = !isFunction$1(opt) && isFunction$1(opt.set)
2134
+ const set = !isFunction(opt) && isFunction(opt.set)
2096
2135
  ? opt.set.bind(publicThis)
2097
2136
  : (process.env.NODE_ENV !== 'production')
2098
2137
  ? () => {
@@ -2120,7 +2159,7 @@ function applyOptions(instance) {
2120
2159
  }
2121
2160
  }
2122
2161
  if (provideOptions) {
2123
- const provides = isFunction$1(provideOptions)
2162
+ const provides = isFunction(provideOptions)
2124
2163
  ? provideOptions.call(publicThis)
2125
2164
  : provideOptions;
2126
2165
  Reflect.ownKeys(provides).forEach(key => {
@@ -2185,7 +2224,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
2185
2224
  for (const key in injectOptions) {
2186
2225
  const opt = injectOptions[key];
2187
2226
  let injected;
2188
- if (isObject$1(opt)) {
2227
+ if (isObject(opt)) {
2189
2228
  if ('default' in opt) {
2190
2229
  injected = inject(opt.from || key, opt.default, true /* treat default function as factory */);
2191
2230
  }
@@ -2236,25 +2275,25 @@ function createWatcher(raw, ctx, publicThis, key) {
2236
2275
  : () => publicThis[key];
2237
2276
  if (isString(raw)) {
2238
2277
  const handler = ctx[raw];
2239
- if (isFunction$1(handler)) {
2278
+ if (isFunction(handler)) {
2240
2279
  watch(getter, handler);
2241
2280
  }
2242
2281
  else if ((process.env.NODE_ENV !== 'production')) {
2243
2282
  warn(`Invalid watch handler specified by key "${raw}"`, handler);
2244
2283
  }
2245
2284
  }
2246
- else if (isFunction$1(raw)) {
2285
+ else if (isFunction(raw)) {
2247
2286
  watch(getter, raw.bind(publicThis));
2248
2287
  }
2249
- else if (isObject$1(raw)) {
2288
+ else if (isObject(raw)) {
2250
2289
  if (isArray(raw)) {
2251
2290
  raw.forEach(r => createWatcher(r, ctx, publicThis, key));
2252
2291
  }
2253
2292
  else {
2254
- const handler = isFunction$1(raw.handler)
2293
+ const handler = isFunction(raw.handler)
2255
2294
  ? raw.handler.bind(publicThis)
2256
2295
  : ctx[raw.handler];
2257
- if (isFunction$1(handler)) {
2296
+ if (isFunction(handler)) {
2258
2297
  watch(getter, handler, raw);
2259
2298
  }
2260
2299
  else if ((process.env.NODE_ENV !== 'production')) {
@@ -2355,7 +2394,7 @@ function mergeDataFn(to, from) {
2355
2394
  return from;
2356
2395
  }
2357
2396
  return function mergedDataFn() {
2358
- return (extend)(isFunction$1(to) ? to.call(this, this) : to, isFunction$1(from) ? from.call(this, this) : from);
2397
+ return (extend)(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
2359
2398
  };
2360
2399
  }
2361
2400
  function mergeInject(to, from) {
@@ -2562,7 +2601,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
2562
2601
  // default values
2563
2602
  if (hasDefault && value === undefined) {
2564
2603
  const defaultValue = opt.default;
2565
- if (opt.type !== Function && isFunction$1(defaultValue)) {
2604
+ if (opt.type !== Function && isFunction(defaultValue)) {
2566
2605
  const { propsDefaults } = instance;
2567
2606
  if (key in propsDefaults) {
2568
2607
  value = propsDefaults[key];
@@ -2601,7 +2640,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
2601
2640
  const needCastKeys = [];
2602
2641
  // apply mixin/extends props
2603
2642
  let hasExtends = false;
2604
- if (__VUE_OPTIONS_API__ && !isFunction$1(comp)) {
2643
+ if (__VUE_OPTIONS_API__ && !isFunction(comp)) {
2605
2644
  const extendProps = (raw) => {
2606
2645
  hasExtends = true;
2607
2646
  const [props, keys] = normalizePropsOptions(raw, appContext, true);
@@ -2635,7 +2674,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
2635
2674
  }
2636
2675
  }
2637
2676
  else if (raw) {
2638
- if ((process.env.NODE_ENV !== 'production') && !isObject$1(raw)) {
2677
+ if ((process.env.NODE_ENV !== 'production') && !isObject(raw)) {
2639
2678
  warn(`invalid props options`, raw);
2640
2679
  }
2641
2680
  for (const key in raw) {
@@ -2643,7 +2682,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
2643
2682
  if (validatePropName(normalizedKey)) {
2644
2683
  const opt = raw[key];
2645
2684
  const prop = (normalized[normalizedKey] =
2646
- isArray(opt) || isFunction$1(opt) ? { type: opt } : opt);
2685
+ isArray(opt) || isFunction(opt) ? { type: opt } : opt);
2647
2686
  if (prop) {
2648
2687
  const booleanIndex = getTypeIndex(Boolean, prop.type);
2649
2688
  const stringIndex = getTypeIndex(String, prop.type);
@@ -2684,7 +2723,7 @@ function getTypeIndex(type, expectedTypes) {
2684
2723
  if (isArray(expectedTypes)) {
2685
2724
  return expectedTypes.findIndex(t => isSameType(t, type));
2686
2725
  }
2687
- else if (isFunction$1(expectedTypes)) {
2726
+ else if (isFunction(expectedTypes)) {
2688
2727
  return isSameType(expectedTypes, type) ? 0 : -1;
2689
2728
  }
2690
2729
  return -1;
@@ -2753,7 +2792,7 @@ function assertType(value, type) {
2753
2792
  }
2754
2793
  }
2755
2794
  else if (expectedType === 'Object') {
2756
- valid = isObject$1(value);
2795
+ valid = isObject(value);
2757
2796
  }
2758
2797
  else if (expectedType === 'Array') {
2759
2798
  valid = isArray(value);
@@ -2842,7 +2881,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
2842
2881
  if (isInternalKey(key))
2843
2882
  continue;
2844
2883
  const value = rawSlots[key];
2845
- if (isFunction$1(value)) {
2884
+ if (isFunction(value)) {
2846
2885
  slots[key] = normalizeSlot(key, value, ctx);
2847
2886
  }
2848
2887
  else if (value != null) {
@@ -2952,7 +2991,7 @@ return withDirectives(h(comp), [
2952
2991
  [bar, this.y]
2953
2992
  ])
2954
2993
  */
2955
- const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text');
2994
+ const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
2956
2995
  function validateDirectiveName(name) {
2957
2996
  if (isBuiltInDirective(name)) {
2958
2997
  warn('Do not use built-in directive ids as custom directive id: ' + name);
@@ -2971,7 +3010,7 @@ function withDirectives(vnode, directives) {
2971
3010
  const bindings = vnode.dirs || (vnode.dirs = []);
2972
3011
  for (let i = 0; i < directives.length; i++) {
2973
3012
  let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
2974
- if (isFunction$1(dir)) {
3013
+ if (isFunction(dir)) {
2975
3014
  dir = {
2976
3015
  mounted: dir,
2977
3016
  updated: dir
@@ -3039,7 +3078,7 @@ function createAppContext() {
3039
3078
  let uid = 0;
3040
3079
  function createAppAPI(render, hydrate) {
3041
3080
  return function createApp(rootComponent, rootProps = null) {
3042
- if (rootProps != null && !isObject$1(rootProps)) {
3081
+ if (rootProps != null && !isObject(rootProps)) {
3043
3082
  (process.env.NODE_ENV !== 'production') && warn(`root props passed to app.mount() must be an object.`);
3044
3083
  rootProps = null;
3045
3084
  }
@@ -3066,11 +3105,11 @@ function createAppAPI(render, hydrate) {
3066
3105
  if (installedPlugins.has(plugin)) {
3067
3106
  (process.env.NODE_ENV !== 'production') && warn(`Plugin has already been applied to target app.`);
3068
3107
  }
3069
- else if (plugin && isFunction$1(plugin.install)) {
3108
+ else if (plugin && isFunction(plugin.install)) {
3070
3109
  installedPlugins.add(plugin);
3071
3110
  plugin.install(app, ...options);
3072
3111
  }
3073
- else if (isFunction$1(plugin)) {
3112
+ else if (isFunction(plugin)) {
3074
3113
  installedPlugins.add(plugin);
3075
3114
  plugin(app, ...options);
3076
3115
  }
@@ -4897,7 +4936,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4897
4936
  doSet();
4898
4937
  }
4899
4938
  }
4900
- else if (isFunction$1(ref)) {
4939
+ else if (isFunction(ref)) {
4901
4940
  callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
4902
4941
  }
4903
4942
  else if ((process.env.NODE_ENV !== 'production')) {
@@ -4918,8 +4957,8 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
4918
4957
  *
4919
4958
  * #2080
4920
4959
  * Inside keyed `template` fragment static children, if a fragment is moved,
4921
- * the children will always moved so that need inherit el form previous nodes
4922
- * to ensure correct moved position.
4960
+ * the children will always be moved. Therefore, in order to ensure correct move
4961
+ * position, el should be inherited from previous nodes.
4923
4962
  */
4924
4963
  function traverseStaticChildren(n1, n2, shallow = false) {
4925
4964
  const ch1 = n1.children;
@@ -5374,7 +5413,7 @@ const InternalObjectKey = `__vInternal`;
5374
5413
  const normalizeKey = ({ key }) => key != null ? key : null;
5375
5414
  const normalizeRef = ({ ref }) => {
5376
5415
  return (ref != null
5377
- ? isString(ref) || isRef(ref) || isFunction$1(ref)
5416
+ ? isString(ref) || isRef(ref) || isFunction(ref)
5378
5417
  ? { i: currentRenderingInstance, r: ref }
5379
5418
  : ref
5380
5419
  : null);
@@ -5473,7 +5512,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
5473
5512
  if (klass && !isString(klass)) {
5474
5513
  props.class = normalizeClass(klass);
5475
5514
  }
5476
- if (isObject$1(style)) {
5515
+ if (isObject(style)) {
5477
5516
  // reactive state objects need to be cloned since they are likely to be
5478
5517
  // mutated
5479
5518
  if (isProxy(style) && !isArray(style)) {
@@ -5489,9 +5528,9 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
5489
5528
  ? 128 /* SUSPENSE */
5490
5529
  : isTeleport(type)
5491
5530
  ? 64 /* TELEPORT */
5492
- : isObject$1(type)
5531
+ : isObject(type)
5493
5532
  ? 4 /* STATEFUL_COMPONENT */
5494
- : isFunction$1(type)
5533
+ : isFunction(type)
5495
5534
  ? 2 /* FUNCTIONAL_COMPONENT */
5496
5535
  : 0;
5497
5536
  if ((process.env.NODE_ENV !== 'production') && shapeFlag & 4 /* STATEFUL_COMPONENT */ && isProxy(type)) {
@@ -5670,7 +5709,7 @@ function normalizeChildren(vnode, children) {
5670
5709
  }
5671
5710
  }
5672
5711
  }
5673
- else if (isFunction$1(children)) {
5712
+ else if (isFunction(children)) {
5674
5713
  children = { default: children, _ctx: currentRenderingInstance };
5675
5714
  type = 32 /* SLOTS_CHILDREN */;
5676
5715
  }
@@ -5704,7 +5743,8 @@ function mergeProps(...args) {
5704
5743
  else if (isOn(key)) {
5705
5744
  const existing = ret[key];
5706
5745
  const incoming = toMerge[key];
5707
- if (existing !== incoming) {
5746
+ if (existing !== incoming &&
5747
+ !(isArray(existing) && existing.includes(incoming))) {
5708
5748
  ret[key] = existing
5709
5749
  ? [].concat(existing, incoming)
5710
5750
  : incoming;
@@ -5740,7 +5780,7 @@ function renderList(source, renderItem, cache, index) {
5740
5780
  ret[i] = renderItem(i + 1, i, undefined, cached && cached[i]);
5741
5781
  }
5742
5782
  }
5743
- else if (isObject$1(source)) {
5783
+ else if (isObject(source)) {
5744
5784
  if (source[Symbol.iterator]) {
5745
5785
  ret = Array.from(source, (item, i) => renderItem(item, i, undefined, cached && cached[i]));
5746
5786
  }
@@ -5842,7 +5882,7 @@ function ensureValidVNode(vnodes) {
5842
5882
  */
5843
5883
  function toHandlers(obj) {
5844
5884
  const ret = {};
5845
- if ((process.env.NODE_ENV !== 'production') && !isObject$1(obj)) {
5885
+ if ((process.env.NODE_ENV !== 'production') && !isObject(obj)) {
5846
5886
  warn(`v-on with no argument expects an object value.`);
5847
5887
  return ret;
5848
5888
  }
@@ -5908,23 +5948,23 @@ const PublicInstanceProxyHandlers = {
5908
5948
  const n = accessCache[key];
5909
5949
  if (n !== undefined) {
5910
5950
  switch (n) {
5911
- case 0 /* SETUP */:
5951
+ case 1 /* SETUP */:
5912
5952
  return setupState[key];
5913
- case 1 /* DATA */:
5953
+ case 2 /* DATA */:
5914
5954
  return data[key];
5915
- case 3 /* CONTEXT */:
5955
+ case 4 /* CONTEXT */:
5916
5956
  return ctx[key];
5917
- case 2 /* PROPS */:
5957
+ case 3 /* PROPS */:
5918
5958
  return props[key];
5919
5959
  // default: just fallthrough
5920
5960
  }
5921
5961
  }
5922
5962
  else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
5923
- accessCache[key] = 0 /* SETUP */;
5963
+ accessCache[key] = 1 /* SETUP */;
5924
5964
  return setupState[key];
5925
5965
  }
5926
5966
  else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
5927
- accessCache[key] = 1 /* DATA */;
5967
+ accessCache[key] = 2 /* DATA */;
5928
5968
  return data[key];
5929
5969
  }
5930
5970
  else if (
@@ -5932,15 +5972,15 @@ const PublicInstanceProxyHandlers = {
5932
5972
  // props
5933
5973
  (normalizedProps = instance.propsOptions[0]) &&
5934
5974
  hasOwn(normalizedProps, key)) {
5935
- accessCache[key] = 2 /* PROPS */;
5975
+ accessCache[key] = 3 /* PROPS */;
5936
5976
  return props[key];
5937
5977
  }
5938
5978
  else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
5939
- accessCache[key] = 3 /* CONTEXT */;
5979
+ accessCache[key] = 4 /* CONTEXT */;
5940
5980
  return ctx[key];
5941
5981
  }
5942
5982
  else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) {
5943
- accessCache[key] = 4 /* OTHER */;
5983
+ accessCache[key] = 0 /* OTHER */;
5944
5984
  }
5945
5985
  }
5946
5986
  const publicGetter = publicPropertiesMap[key];
@@ -5961,7 +6001,7 @@ const PublicInstanceProxyHandlers = {
5961
6001
  }
5962
6002
  else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
5963
6003
  // user may set custom properties to `this` that start with `$`
5964
- accessCache[key] = 3 /* CONTEXT */;
6004
+ accessCache[key] = 4 /* CONTEXT */;
5965
6005
  return ctx[key];
5966
6006
  }
5967
6007
  else if (
@@ -6025,7 +6065,7 @@ const PublicInstanceProxyHandlers = {
6025
6065
  },
6026
6066
  has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
6027
6067
  let normalizedProps;
6028
- return (accessCache[key] !== undefined ||
6068
+ return (!!accessCache[key] ||
6029
6069
  (data !== EMPTY_OBJ && hasOwn(data, key)) ||
6030
6070
  (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
6031
6071
  ((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
@@ -6277,7 +6317,7 @@ function setupStatefulComponent(instance, isSSR) {
6277
6317
  const setupResult = callWithErrorHandling(setup, instance, 0 /* SETUP_FUNCTION */, [(process.env.NODE_ENV !== 'production') ? shallowReadonly(instance.props) : instance.props, setupContext]);
6278
6318
  resetTracking();
6279
6319
  unsetCurrentInstance();
6280
- if (isPromise$1(setupResult)) {
6320
+ if (isPromise(setupResult)) {
6281
6321
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
6282
6322
  if (isSSR) {
6283
6323
  // return the promise so server-renderer can wait on it
@@ -6304,7 +6344,7 @@ function setupStatefulComponent(instance, isSSR) {
6304
6344
  }
6305
6345
  }
6306
6346
  function handleSetupResult(instance, setupResult, isSSR) {
6307
- if (isFunction$1(setupResult)) {
6347
+ if (isFunction(setupResult)) {
6308
6348
  // setup returned an inline render function
6309
6349
  if (instance.type.__ssrInlineRender) {
6310
6350
  // when the function's name is `ssrRender` (compiled by SFC inline mode),
@@ -6315,7 +6355,7 @@ function handleSetupResult(instance, setupResult, isSSR) {
6315
6355
  instance.render = setupResult;
6316
6356
  }
6317
6357
  }
6318
- else if (isObject$1(setupResult)) {
6358
+ else if (isObject(setupResult)) {
6319
6359
  if ((process.env.NODE_ENV !== 'production') && isVNode(setupResult)) {
6320
6360
  warn(`setup() should not return VNodes directly - ` +
6321
6361
  `return a render function instead.`);
@@ -6484,7 +6524,7 @@ function getExposeProxy(instance) {
6484
6524
  const classifyRE = /(?:^|[-_])(\w)/g;
6485
6525
  const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
6486
6526
  function getComponentName(Component) {
6487
- return isFunction$1(Component)
6527
+ return isFunction(Component)
6488
6528
  ? Component.displayName || Component.name
6489
6529
  : Component.name;
6490
6530
  }
@@ -6513,7 +6553,7 @@ function formatComponentName(instance, Component, isRoot = false) {
6513
6553
  return name ? classify(name) : isRoot ? `App` : `Anonymous`;
6514
6554
  }
6515
6555
  function isClassComponent(value) {
6516
- return isFunction$1(value) && '__vccOpts' in value;
6556
+ return isFunction(value) && '__vccOpts' in value;
6517
6557
  }
6518
6558
 
6519
6559
  const stack = [];
@@ -6621,7 +6661,7 @@ function formatProp(key, value, raw) {
6621
6661
  value = formatProp(key, toRaw(value.value), true);
6622
6662
  return raw ? value : [`${key}=Ref<`, value, `>`];
6623
6663
  }
6624
- else if (isFunction$1(value)) {
6664
+ else if (isFunction(value)) {
6625
6665
  return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
6626
6666
  }
6627
6667
  else {
@@ -6673,9 +6713,9 @@ function callWithErrorHandling(fn, instance, type, args) {
6673
6713
  return res;
6674
6714
  }
6675
6715
  function callWithAsyncErrorHandling(fn, instance, type, args) {
6676
- if (isFunction$1(fn)) {
6716
+ if (isFunction(fn)) {
6677
6717
  const res = callWithErrorHandling(fn, instance, type, args);
6678
- if (res && isPromise$1(res)) {
6718
+ if (res && isPromise(res)) {
6679
6719
  res.catch(err => {
6680
6720
  handleError(err, instance, type);
6681
6721
  });
@@ -6963,7 +7003,7 @@ function watchSyncEffect(effect, options) {
6963
7003
  const INITIAL_WATCHER_VALUE = {};
6964
7004
  // implementation
6965
7005
  function watch(source, cb, options) {
6966
- if ((process.env.NODE_ENV !== 'production') && !isFunction$1(cb)) {
7006
+ if ((process.env.NODE_ENV !== 'production') && !isFunction(cb)) {
6967
7007
  warn(`\`watch(fn, options?)\` signature has been moved to a separate API. ` +
6968
7008
  `Use \`watchEffect(fn, options?)\` instead. \`watch\` now only ` +
6969
7009
  `supports \`watch(source, cb, options?) signature.`);
@@ -7007,7 +7047,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
7007
7047
  else if (isReactive(s)) {
7008
7048
  return traverse(s);
7009
7049
  }
7010
- else if (isFunction$1(s)) {
7050
+ else if (isFunction(s)) {
7011
7051
  return callWithErrorHandling(s, instance, 2 /* WATCH_GETTER */);
7012
7052
  }
7013
7053
  else {
@@ -7015,7 +7055,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
7015
7055
  }
7016
7056
  });
7017
7057
  }
7018
- else if (isFunction$1(source)) {
7058
+ else if (isFunction(source)) {
7019
7059
  if (cb) {
7020
7060
  // getter with cb
7021
7061
  getter = () => callWithErrorHandling(source, instance, 2 /* WATCH_GETTER */);
@@ -7155,7 +7195,7 @@ function instanceWatch(source, value, options) {
7155
7195
  : () => publicThis[source]
7156
7196
  : source.bind(publicThis, publicThis);
7157
7197
  let cb;
7158
- if (isFunction$1(value)) {
7198
+ if (isFunction(value)) {
7159
7199
  cb = value;
7160
7200
  }
7161
7201
  else {
@@ -7184,7 +7224,7 @@ function createPathGetter(ctx, path) {
7184
7224
  };
7185
7225
  }
7186
7226
  function traverse(value, seen) {
7187
- if (!isObject$1(value) || value["__v_skip" /* SKIP */]) {
7227
+ if (!isObject(value) || value["__v_skip" /* SKIP */]) {
7188
7228
  return value;
7189
7229
  }
7190
7230
  seen = seen || new Set();
@@ -7213,16 +7253,6 @@ function traverse(value, seen) {
7213
7253
  return value;
7214
7254
  }
7215
7255
 
7216
- (process.env.NODE_ENV !== 'production')
7217
- ? Object.freeze({})
7218
- : {};
7219
- (process.env.NODE_ENV !== 'production') ? Object.freeze([]) : [];
7220
- const isFunction = (val) => typeof val === 'function';
7221
- const isObject = (val) => val !== null && typeof val === 'object';
7222
- const isPromise = (val) => {
7223
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
7224
- };
7225
-
7226
7256
  // dev only
7227
7257
  const warnRuntimeUsage = (method) => warn(`${method}() is a compiler-hint helper that is only usable inside ` +
7228
7258
  `<script setup> of a single file component. Its arguments should be ` +
@@ -7300,15 +7330,21 @@ function getContext() {
7300
7330
  * only.
7301
7331
  * @internal
7302
7332
  */
7303
- function mergeDefaults(
7304
- // the base props is compiler-generated and guaranteed to be in this shape.
7305
- props, defaults) {
7333
+ function mergeDefaults(raw, defaults) {
7334
+ const props = isArray(raw)
7335
+ ? raw.reduce((normalized, p) => ((normalized[p] = {}), normalized), {})
7336
+ : raw;
7306
7337
  for (const key in defaults) {
7307
- const val = props[key];
7308
- if (val) {
7309
- val.default = defaults[key];
7338
+ const opt = props[key];
7339
+ if (opt) {
7340
+ if (isArray(opt) || isFunction(opt)) {
7341
+ props[key] = { type: opt, default: defaults[key] };
7342
+ }
7343
+ else {
7344
+ opt.default = defaults[key];
7345
+ }
7310
7346
  }
7311
- else if (val === null) {
7347
+ else if (opt === null) {
7312
7348
  props[key] = { default: defaults[key] };
7313
7349
  }
7314
7350
  else if ((process.env.NODE_ENV !== 'production')) {
@@ -7317,6 +7353,23 @@ props, defaults) {
7317
7353
  }
7318
7354
  return props;
7319
7355
  }
7356
+ /**
7357
+ * Used to create a proxy for the rest element when destructuring props with
7358
+ * defineProps().
7359
+ * @internal
7360
+ */
7361
+ function createPropsRestProxy(props, excludedKeys) {
7362
+ const ret = {};
7363
+ for (const key in props) {
7364
+ if (!excludedKeys.includes(key)) {
7365
+ Object.defineProperty(ret, key, {
7366
+ enumerable: true,
7367
+ get: () => props[key]
7368
+ });
7369
+ }
7370
+ }
7371
+ return ret;
7372
+ }
7320
7373
  /**
7321
7374
  * `<script setup>` helper for persisting the current instance context over
7322
7375
  * async/await flows.
@@ -7356,7 +7409,7 @@ function withAsyncContext(getAwaitable) {
7356
7409
  function h(type, propsOrChildren, children) {
7357
7410
  const l = arguments.length;
7358
7411
  if (l === 2) {
7359
- if (isObject$1(propsOrChildren) && !isArray(propsOrChildren)) {
7412
+ if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
7360
7413
  // single vnode without props
7361
7414
  if (isVNode(propsOrChildren)) {
7362
7415
  return createVNode(type, null, [propsOrChildren]);
@@ -7406,7 +7459,7 @@ function initCustomFormatter() {
7406
7459
  const formatter = {
7407
7460
  header(obj) {
7408
7461
  // TODO also format ComponentPublicInstance & ctx.slots/attrs in setup
7409
- if (!isObject$1(obj)) {
7462
+ if (!isObject(obj)) {
7410
7463
  return null;
7411
7464
  }
7412
7465
  if (obj.__isVue) {
@@ -7531,7 +7584,7 @@ function initCustomFormatter() {
7531
7584
  else if (typeof v === 'boolean') {
7532
7585
  return ['span', keywordStyle, v];
7533
7586
  }
7534
- else if (isObject$1(v)) {
7587
+ else if (isObject(v)) {
7535
7588
  return ['object', { object: asRaw ? toRaw(v) : v }];
7536
7589
  }
7537
7590
  else {
@@ -7540,7 +7593,7 @@ function initCustomFormatter() {
7540
7593
  }
7541
7594
  function extractKeys(instance, type) {
7542
7595
  const Comp = instance.type;
7543
- if (isFunction$1(Comp)) {
7596
+ if (isFunction(Comp)) {
7544
7597
  return;
7545
7598
  }
7546
7599
  const extracted = {};
@@ -7554,7 +7607,7 @@ function initCustomFormatter() {
7554
7607
  function isKeyOfType(Comp, key, type) {
7555
7608
  const opts = Comp[type];
7556
7609
  if ((isArray(opts) && opts.includes(key)) ||
7557
- (isObject$1(opts) && key in opts)) {
7610
+ (isObject(opts) && key in opts)) {
7558
7611
  return true;
7559
7612
  }
7560
7613
  if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
@@ -7609,7 +7662,7 @@ function isMemoSame(cached, memo) {
7609
7662
  }
7610
7663
 
7611
7664
  // Core API ------------------------------------------------------------------
7612
- const version = "3.2.19";
7665
+ const version = "3.2.23";
7613
7666
  const _ssrUtils = {
7614
7667
  createComponentInstance,
7615
7668
  setupComponent,
@@ -7632,4 +7685,4 @@ const resolveFilter = null;
7632
7685
  */
7633
7686
  const compatUtils = (null);
7634
7687
 
7635
- export { BaseTransition, Comment, Fragment, KeepAlive, Static, Suspense, Teleport, Text, callWithAsyncErrorHandling, callWithErrorHandling, cloneVNode, compatUtils, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineProps, devtools, getCurrentInstance, getTransitionRawChildren, guardReactiveProps, h, handleError, initCustomFormatter, inject, isMemoSame, isRuntimeOnly, isVNode, mergeDefaults, mergeProps, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, pushScopeId, queuePostFlushCb, registerRuntimeCompiler, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, ssrContextKey, ssrUtils, toHandlers, transformVNodeArgs, useAttrs, useSSRContext, useSlots, useTransitionState, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
7688
+ export { BaseTransition, Comment, Fragment, KeepAlive, Static, Suspense, Teleport, Text, callWithAsyncErrorHandling, callWithErrorHandling, cloneVNode, compatUtils, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineProps, devtools, getCurrentInstance, getTransitionRawChildren, guardReactiveProps, h, handleError, initCustomFormatter, inject, isMemoSame, isRuntimeOnly, isVNode, mergeDefaults, mergeProps, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, pushScopeId, queuePostFlushCb, registerRuntimeCompiler, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, ssrContextKey, ssrUtils, toHandlers, transformVNodeArgs, useAttrs, useSSRContext, useSlots, useTransitionState, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };