@vue/compat 3.5.24 → 3.5.26

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,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.24
2
+ * @vue/compat v3.5.26
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -929,13 +929,13 @@ function addSub(link) {
929
929
  }
930
930
  }
931
931
  const targetMap = /* @__PURE__ */ new WeakMap();
932
- const ITERATE_KEY = Symbol(
932
+ const ITERATE_KEY = /* @__PURE__ */ Symbol(
933
933
  "Object iterate"
934
934
  );
935
- const MAP_KEY_ITERATE_KEY = Symbol(
935
+ const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol(
936
936
  "Map keys iterate"
937
937
  );
938
- const ARRAY_ITERATE_KEY = Symbol(
938
+ const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol(
939
939
  "Array iterate"
940
940
  );
941
941
  function track(target, type, key) {
@@ -1043,10 +1043,16 @@ function shallowReadArray(arr) {
1043
1043
  track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
1044
1044
  return arr;
1045
1045
  }
1046
+ function toWrapped(target, item) {
1047
+ if (isReadonly(target)) {
1048
+ return isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item);
1049
+ }
1050
+ return toReactive(item);
1051
+ }
1046
1052
  const arrayInstrumentations = {
1047
1053
  __proto__: null,
1048
1054
  [Symbol.iterator]() {
1049
- return iterator(this, Symbol.iterator, toReactive);
1055
+ return iterator(this, Symbol.iterator, (item) => toWrapped(this, item));
1050
1056
  },
1051
1057
  concat(...args) {
1052
1058
  return reactiveReadArray(this).concat(
@@ -1055,7 +1061,7 @@ const arrayInstrumentations = {
1055
1061
  },
1056
1062
  entries() {
1057
1063
  return iterator(this, "entries", (value) => {
1058
- value[1] = toReactive(value[1]);
1064
+ value[1] = toWrapped(this, value[1]);
1059
1065
  return value;
1060
1066
  });
1061
1067
  },
@@ -1063,16 +1069,37 @@ const arrayInstrumentations = {
1063
1069
  return apply(this, "every", fn, thisArg, void 0, arguments);
1064
1070
  },
1065
1071
  filter(fn, thisArg) {
1066
- return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments);
1072
+ return apply(
1073
+ this,
1074
+ "filter",
1075
+ fn,
1076
+ thisArg,
1077
+ (v) => v.map((item) => toWrapped(this, item)),
1078
+ arguments
1079
+ );
1067
1080
  },
1068
1081
  find(fn, thisArg) {
1069
- return apply(this, "find", fn, thisArg, toReactive, arguments);
1082
+ return apply(
1083
+ this,
1084
+ "find",
1085
+ fn,
1086
+ thisArg,
1087
+ (item) => toWrapped(this, item),
1088
+ arguments
1089
+ );
1070
1090
  },
1071
1091
  findIndex(fn, thisArg) {
1072
1092
  return apply(this, "findIndex", fn, thisArg, void 0, arguments);
1073
1093
  },
1074
1094
  findLast(fn, thisArg) {
1075
- return apply(this, "findLast", fn, thisArg, toReactive, arguments);
1095
+ return apply(
1096
+ this,
1097
+ "findLast",
1098
+ fn,
1099
+ thisArg,
1100
+ (item) => toWrapped(this, item),
1101
+ arguments
1102
+ );
1076
1103
  },
1077
1104
  findLastIndex(fn, thisArg) {
1078
1105
  return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
@@ -1132,7 +1159,7 @@ const arrayInstrumentations = {
1132
1159
  return noTracking(this, "unshift", args);
1133
1160
  },
1134
1161
  values() {
1135
- return iterator(this, "values", toReactive);
1162
+ return iterator(this, "values", (item) => toWrapped(this, item));
1136
1163
  }
1137
1164
  };
1138
1165
  function iterator(self, method, wrapValue) {
@@ -1163,7 +1190,7 @@ function apply(self, method, fn, thisArg, wrappedRetFn, args) {
1163
1190
  if (arr !== self) {
1164
1191
  if (needsWrap) {
1165
1192
  wrappedFn = function(item, index) {
1166
- return fn.call(this, toReactive(item), index, self);
1193
+ return fn.call(this, toWrapped(self, item), index, self);
1167
1194
  };
1168
1195
  } else if (fn.length > 2) {
1169
1196
  wrappedFn = function(item, index) {
@@ -1180,7 +1207,7 @@ function reduce(self, method, fn, args) {
1180
1207
  if (arr !== self) {
1181
1208
  if (!isShallow(self)) {
1182
1209
  wrappedFn = function(acc, item, index) {
1183
- return fn.call(this, acc, toReactive(item), index, self);
1210
+ return fn.call(this, acc, toWrapped(self, item), index, self);
1184
1211
  };
1185
1212
  } else if (fn.length > 3) {
1186
1213
  wrappedFn = function(acc, item, index) {
@@ -1284,13 +1311,14 @@ class MutableReactiveHandler extends BaseReactiveHandler {
1284
1311
  }
1285
1312
  set(target, key, value, receiver) {
1286
1313
  let oldValue = target[key];
1314
+ const isArrayWithIntegerKey = isArray(target) && isIntegerKey(key);
1287
1315
  if (!this._isShallow) {
1288
1316
  const isOldValueReadonly = isReadonly(oldValue);
1289
1317
  if (!isShallow(value) && !isReadonly(value)) {
1290
1318
  oldValue = toRaw(oldValue);
1291
1319
  value = toRaw(value);
1292
1320
  }
1293
- if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
1321
+ if (!isArrayWithIntegerKey && isRef(oldValue) && !isRef(value)) {
1294
1322
  if (isOldValueReadonly) {
1295
1323
  {
1296
1324
  warn$2(
@@ -1305,7 +1333,7 @@ class MutableReactiveHandler extends BaseReactiveHandler {
1305
1333
  }
1306
1334
  }
1307
1335
  }
1308
- const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
1336
+ const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
1309
1337
  const result = Reflect.set(
1310
1338
  target,
1311
1339
  key,
@@ -1835,16 +1863,35 @@ class ObjectRefImpl {
1835
1863
  this._defaultValue = _defaultValue;
1836
1864
  this["__v_isRef"] = true;
1837
1865
  this._value = void 0;
1866
+ this._raw = toRaw(_object);
1867
+ let shallow = true;
1868
+ let obj = _object;
1869
+ if (!isArray(_object) || !isIntegerKey(String(_key))) {
1870
+ do {
1871
+ shallow = !isProxy(obj) || isShallow(obj);
1872
+ } while (shallow && (obj = obj["__v_raw"]));
1873
+ }
1874
+ this._shallow = shallow;
1838
1875
  }
1839
1876
  get value() {
1840
- const val = this._object[this._key];
1877
+ let val = this._object[this._key];
1878
+ if (this._shallow) {
1879
+ val = unref(val);
1880
+ }
1841
1881
  return this._value = val === void 0 ? this._defaultValue : val;
1842
1882
  }
1843
1883
  set value(newVal) {
1884
+ if (this._shallow && isRef(this._raw[this._key])) {
1885
+ const nestedRef = this._object[this._key];
1886
+ if (isRef(nestedRef)) {
1887
+ nestedRef.value = newVal;
1888
+ return;
1889
+ }
1890
+ }
1844
1891
  this._object[this._key] = newVal;
1845
1892
  }
1846
1893
  get dep() {
1847
- return getDepFromReactive(toRaw(this._object), this._key);
1894
+ return getDepFromReactive(this._raw, this._key);
1848
1895
  }
1849
1896
  }
1850
1897
  class GetterRefImpl {
@@ -1870,8 +1917,7 @@ function toRef(source, key, defaultValue) {
1870
1917
  }
1871
1918
  }
1872
1919
  function propertyToRef(source, key, defaultValue) {
1873
- const val = source[key];
1874
- return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1920
+ return new ObjectRefImpl(source, key, defaultValue);
1875
1921
  }
1876
1922
 
1877
1923
  class ComputedRefImpl {
@@ -3257,65 +3303,6 @@ function emit$1(instance, event, args) {
3257
3303
  return instance.proxy;
3258
3304
  }
3259
3305
 
3260
- const compatModelEventPrefix = `onModelCompat:`;
3261
- const warnedTypes = /* @__PURE__ */ new WeakSet();
3262
- function convertLegacyVModelProps(vnode) {
3263
- const { type, shapeFlag, props, dynamicProps } = vnode;
3264
- const comp = type;
3265
- if (shapeFlag & 6 && props && "modelValue" in props) {
3266
- if (!isCompatEnabled(
3267
- "COMPONENT_V_MODEL",
3268
- // this is a special case where we want to use the vnode component's
3269
- // compat config instead of the current rendering instance (which is the
3270
- // parent of the component that exposes v-model)
3271
- { type }
3272
- )) {
3273
- return;
3274
- }
3275
- if (!warnedTypes.has(comp)) {
3276
- pushWarningContext(vnode);
3277
- warnDeprecation("COMPONENT_V_MODEL", { type }, comp);
3278
- popWarningContext();
3279
- warnedTypes.add(comp);
3280
- }
3281
- const model = comp.model || {};
3282
- applyModelFromMixins(model, comp.mixins);
3283
- const { prop = "value", event = "input" } = model;
3284
- if (prop !== "modelValue") {
3285
- props[prop] = props.modelValue;
3286
- delete props.modelValue;
3287
- }
3288
- if (dynamicProps) {
3289
- dynamicProps[dynamicProps.indexOf("modelValue")] = prop;
3290
- }
3291
- props[compatModelEventPrefix + event] = props["onUpdate:modelValue"];
3292
- delete props["onUpdate:modelValue"];
3293
- }
3294
- }
3295
- function applyModelFromMixins(model, mixins) {
3296
- if (mixins) {
3297
- mixins.forEach((m) => {
3298
- if (m.model) extend(model, m.model);
3299
- if (m.mixins) applyModelFromMixins(model, m.mixins);
3300
- });
3301
- }
3302
- }
3303
- function compatModelEmit(instance, event, args) {
3304
- if (!isCompatEnabled("COMPONENT_V_MODEL", instance)) {
3305
- return;
3306
- }
3307
- const props = instance.vnode.props;
3308
- const modelHandler = props && props[compatModelEventPrefix + event];
3309
- if (modelHandler) {
3310
- callWithErrorHandling(
3311
- modelHandler,
3312
- instance,
3313
- 6,
3314
- args
3315
- );
3316
- }
3317
- }
3318
-
3319
3306
  let currentRenderingInstance = null;
3320
3307
  let currentScopeId = null;
3321
3308
  function setCurrentRenderingInstance(instance) {
@@ -3466,7 +3453,180 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3466
3453
  }
3467
3454
  }
3468
3455
 
3469
- const TeleportEndKey = Symbol("_vte");
3456
+ function provide(key, value) {
3457
+ {
3458
+ if (!currentInstance || currentInstance.isMounted) {
3459
+ warn$1(`provide() can only be used inside setup().`);
3460
+ }
3461
+ }
3462
+ if (currentInstance) {
3463
+ let provides = currentInstance.provides;
3464
+ const parentProvides = currentInstance.parent && currentInstance.parent.provides;
3465
+ if (parentProvides === provides) {
3466
+ provides = currentInstance.provides = Object.create(parentProvides);
3467
+ }
3468
+ provides[key] = value;
3469
+ }
3470
+ }
3471
+ function inject(key, defaultValue, treatDefaultAsFactory = false) {
3472
+ const instance = getCurrentInstance();
3473
+ if (instance || currentApp) {
3474
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
3475
+ if (provides && key in provides) {
3476
+ return provides[key];
3477
+ } else if (arguments.length > 1) {
3478
+ return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
3479
+ } else {
3480
+ warn$1(`injection "${String(key)}" not found.`);
3481
+ }
3482
+ } else {
3483
+ warn$1(`inject() can only be used inside setup() or functional components.`);
3484
+ }
3485
+ }
3486
+ function hasInjectionContext() {
3487
+ return !!(getCurrentInstance() || currentApp);
3488
+ }
3489
+
3490
+ const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
3491
+ const useSSRContext = () => {
3492
+ {
3493
+ const ctx = inject(ssrContextKey);
3494
+ if (!ctx) {
3495
+ warn$1(
3496
+ `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
3497
+ );
3498
+ }
3499
+ return ctx;
3500
+ }
3501
+ };
3502
+
3503
+ function watchEffect(effect, options) {
3504
+ return doWatch(effect, null, options);
3505
+ }
3506
+ function watchPostEffect(effect, options) {
3507
+ return doWatch(
3508
+ effect,
3509
+ null,
3510
+ extend({}, options, { flush: "post" })
3511
+ );
3512
+ }
3513
+ function watchSyncEffect(effect, options) {
3514
+ return doWatch(
3515
+ effect,
3516
+ null,
3517
+ extend({}, options, { flush: "sync" })
3518
+ );
3519
+ }
3520
+ function watch(source, cb, options) {
3521
+ if (!isFunction(cb)) {
3522
+ warn$1(
3523
+ `\`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.`
3524
+ );
3525
+ }
3526
+ return doWatch(source, cb, options);
3527
+ }
3528
+ function doWatch(source, cb, options = EMPTY_OBJ) {
3529
+ const { immediate, deep, flush, once } = options;
3530
+ if (!cb) {
3531
+ if (immediate !== void 0) {
3532
+ warn$1(
3533
+ `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
3534
+ );
3535
+ }
3536
+ if (deep !== void 0) {
3537
+ warn$1(
3538
+ `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
3539
+ );
3540
+ }
3541
+ if (once !== void 0) {
3542
+ warn$1(
3543
+ `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
3544
+ );
3545
+ }
3546
+ }
3547
+ const baseWatchOptions = extend({}, options);
3548
+ baseWatchOptions.onWarn = warn$1;
3549
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
3550
+ let ssrCleanup;
3551
+ if (isInSSRComponentSetup) {
3552
+ if (flush === "sync") {
3553
+ const ctx = useSSRContext();
3554
+ ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
3555
+ } else if (!runsImmediately) {
3556
+ const watchStopHandle = () => {
3557
+ };
3558
+ watchStopHandle.stop = NOOP;
3559
+ watchStopHandle.resume = NOOP;
3560
+ watchStopHandle.pause = NOOP;
3561
+ return watchStopHandle;
3562
+ }
3563
+ }
3564
+ const instance = currentInstance;
3565
+ baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
3566
+ let isPre = false;
3567
+ if (flush === "post") {
3568
+ baseWatchOptions.scheduler = (job) => {
3569
+ queuePostRenderEffect(job, instance && instance.suspense);
3570
+ };
3571
+ } else if (flush !== "sync") {
3572
+ isPre = true;
3573
+ baseWatchOptions.scheduler = (job, isFirstRun) => {
3574
+ if (isFirstRun) {
3575
+ job();
3576
+ } else {
3577
+ queueJob(job);
3578
+ }
3579
+ };
3580
+ }
3581
+ baseWatchOptions.augmentJob = (job) => {
3582
+ if (cb) {
3583
+ job.flags |= 4;
3584
+ }
3585
+ if (isPre) {
3586
+ job.flags |= 2;
3587
+ if (instance) {
3588
+ job.id = instance.uid;
3589
+ job.i = instance;
3590
+ }
3591
+ }
3592
+ };
3593
+ const watchHandle = watch$1(source, cb, baseWatchOptions);
3594
+ if (isInSSRComponentSetup) {
3595
+ if (ssrCleanup) {
3596
+ ssrCleanup.push(watchHandle);
3597
+ } else if (runsImmediately) {
3598
+ watchHandle();
3599
+ }
3600
+ }
3601
+ return watchHandle;
3602
+ }
3603
+ function instanceWatch(source, value, options) {
3604
+ const publicThis = this.proxy;
3605
+ const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
3606
+ let cb;
3607
+ if (isFunction(value)) {
3608
+ cb = value;
3609
+ } else {
3610
+ cb = value.handler;
3611
+ options = value;
3612
+ }
3613
+ const reset = setCurrentInstance(this);
3614
+ const res = doWatch(getter, cb.bind(publicThis), options);
3615
+ reset();
3616
+ return res;
3617
+ }
3618
+ function createPathGetter(ctx, path) {
3619
+ const segments = path.split(".");
3620
+ return () => {
3621
+ let cur = ctx;
3622
+ for (let i = 0; i < segments.length && cur; i++) {
3623
+ cur = cur[segments[i]];
3624
+ }
3625
+ return cur;
3626
+ };
3627
+ }
3628
+
3629
+ const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
3470
3630
  const isTeleport = (type) => type.__isTeleport;
3471
3631
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
3472
3632
  const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
@@ -3826,8 +3986,8 @@ function prepareAnchor(target, vnode, createText, insert) {
3826
3986
  return targetAnchor;
3827
3987
  }
3828
3988
 
3829
- const leaveCbKey = Symbol("_leaveCb");
3830
- const enterCbKey$1 = Symbol("_enterCb");
3989
+ const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
3990
+ const enterCbKey$1 = /* @__PURE__ */ Symbol("_enterCb");
3831
3991
  function useTransitionState() {
3832
3992
  const state = {
3833
3993
  isMounted: false,
@@ -5367,7 +5527,9 @@ const KeepAliveImpl = {
5367
5527
  }
5368
5528
  function pruneCache(filter) {
5369
5529
  cache.forEach((vnode, key) => {
5370
- const name = getComponentName(vnode.type);
5530
+ const name = getComponentName(
5531
+ isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type
5532
+ );
5371
5533
  if (name && !filter(name)) {
5372
5534
  pruneCacheEntry(key);
5373
5535
  }
@@ -5634,7 +5796,7 @@ const FILTERS = "filters";
5634
5796
  function resolveComponent(name, maybeSelfReference) {
5635
5797
  return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
5636
5798
  }
5637
- const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
5799
+ const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
5638
5800
  function resolveDynamicComponent(component) {
5639
5801
  if (isString(component)) {
5640
5802
  return resolveAsset(COMPONENTS, component, false) || component;
@@ -6341,7 +6503,6 @@ const PublicInstanceProxyHandlers = {
6341
6503
  if (key === "__isVue") {
6342
6504
  return true;
6343
6505
  }
6344
- let normalizedProps;
6345
6506
  if (key[0] !== "$") {
6346
6507
  const n = accessCache[key];
6347
6508
  if (n !== void 0) {
@@ -6361,11 +6522,7 @@ const PublicInstanceProxyHandlers = {
6361
6522
  } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
6362
6523
  accessCache[key] = 2 /* DATA */;
6363
6524
  return data[key];
6364
- } else if (
6365
- // only cache other properties when instance has declared (thus stable)
6366
- // props
6367
- (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
6368
- ) {
6525
+ } else if (hasOwn(props, key)) {
6369
6526
  accessCache[key] = 3 /* PROPS */;
6370
6527
  return props[key];
6371
6528
  } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
@@ -6456,10 +6613,10 @@ const PublicInstanceProxyHandlers = {
6456
6613
  return true;
6457
6614
  },
6458
6615
  has({
6459
- _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
6616
+ _: { data, setupState, accessCache, ctx, appContext, props, type }
6460
6617
  }, key) {
6461
- let normalizedProps, cssModules;
6462
- return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
6618
+ let cssModules;
6619
+ return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || hasOwn(props, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
6463
6620
  },
6464
6621
  defineProperty(target, key, descriptor) {
6465
6622
  if (descriptor.get != null) {
@@ -7204,7 +7361,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7204
7361
  return vm;
7205
7362
  }
7206
7363
  }
7207
- Vue.version = `2.6.14-compat:${"3.5.24"}`;
7364
+ Vue.version = `2.6.14-compat:${"3.5.26"}`;
7208
7365
  Vue.config = singletonApp.config;
7209
7366
  Vue.use = (plugin, ...options) => {
7210
7367
  if (plugin && isFunction(plugin.install)) {
@@ -7781,1439 +7938,2003 @@ If you want to remount the same app, move your app creation logic into a factory
7781
7938
  }
7782
7939
  let currentApp = null;
7783
7940
 
7784
- function provide(key, value) {
7785
- if (!currentInstance) {
7786
- {
7787
- warn$1(`provide() can only be used inside setup().`);
7788
- }
7789
- } else {
7790
- let provides = currentInstance.provides;
7791
- const parentProvides = currentInstance.parent && currentInstance.parent.provides;
7792
- if (parentProvides === provides) {
7793
- provides = currentInstance.provides = Object.create(parentProvides);
7794
- }
7795
- provides[key] = value;
7796
- }
7797
- }
7798
- function inject(key, defaultValue, treatDefaultAsFactory = false) {
7799
- const instance = getCurrentInstance();
7800
- if (instance || currentApp) {
7801
- let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
7802
- if (provides && key in provides) {
7803
- return provides[key];
7804
- } else if (arguments.length > 1) {
7805
- return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
7806
- } else {
7807
- warn$1(`injection "${String(key)}" not found.`);
7941
+ const compatModelEventPrefix = `onModelCompat:`;
7942
+ const warnedTypes = /* @__PURE__ */ new WeakSet();
7943
+ function convertLegacyVModelProps(vnode) {
7944
+ const { type, shapeFlag, props, dynamicProps } = vnode;
7945
+ const comp = type;
7946
+ if (shapeFlag & 6 && props && "modelValue" in props) {
7947
+ if (!isCompatEnabled(
7948
+ "COMPONENT_V_MODEL",
7949
+ // this is a special case where we want to use the vnode component's
7950
+ // compat config instead of the current rendering instance (which is the
7951
+ // parent of the component that exposes v-model)
7952
+ { type }
7953
+ )) {
7954
+ return;
7808
7955
  }
7809
- } else {
7810
- warn$1(`inject() can only be used inside setup() or functional components.`);
7956
+ if (!warnedTypes.has(comp)) {
7957
+ pushWarningContext(vnode);
7958
+ warnDeprecation(
7959
+ "COMPONENT_V_MODEL",
7960
+ {
7961
+ type,
7962
+ appContext: vnode.ctx && vnode.ctx.appContext || createAppContext()
7963
+ },
7964
+ comp
7965
+ );
7966
+ popWarningContext();
7967
+ warnedTypes.add(comp);
7968
+ }
7969
+ const model = comp.model || {};
7970
+ applyModelFromMixins(model, comp.mixins);
7971
+ const { prop = "value", event = "input" } = model;
7972
+ if (prop !== "modelValue") {
7973
+ props[prop] = props.modelValue;
7974
+ delete props.modelValue;
7975
+ }
7976
+ if (dynamicProps) {
7977
+ dynamicProps[dynamicProps.indexOf("modelValue")] = prop;
7978
+ }
7979
+ props[compatModelEventPrefix + event] = props["onUpdate:modelValue"];
7980
+ delete props["onUpdate:modelValue"];
7811
7981
  }
7812
7982
  }
7813
- function hasInjectionContext() {
7814
- return !!(getCurrentInstance() || currentApp);
7983
+ function applyModelFromMixins(model, mixins) {
7984
+ if (mixins) {
7985
+ mixins.forEach((m) => {
7986
+ if (m.model) extend(model, m.model);
7987
+ if (m.mixins) applyModelFromMixins(model, m.mixins);
7988
+ });
7989
+ }
7990
+ }
7991
+ function compatModelEmit(instance, event, args) {
7992
+ if (!isCompatEnabled("COMPONENT_V_MODEL", instance)) {
7993
+ return;
7994
+ }
7995
+ const props = instance.vnode.props;
7996
+ const modelHandler = props && props[compatModelEventPrefix + event];
7997
+ if (modelHandler) {
7998
+ callWithErrorHandling(
7999
+ modelHandler,
8000
+ instance,
8001
+ 6,
8002
+ args
8003
+ );
8004
+ }
7815
8005
  }
7816
8006
 
7817
- function createPropsDefaultThis(instance, rawProps, propKey) {
7818
- return new Proxy(
7819
- {},
7820
- {
7821
- get(_, key) {
7822
- warnDeprecation("PROPS_DEFAULT_THIS", null, propKey);
7823
- if (key === "$options") {
7824
- return resolveMergedOptions(instance);
8007
+ function useModel(props, name, options = EMPTY_OBJ) {
8008
+ const i = getCurrentInstance();
8009
+ if (!i) {
8010
+ warn$1(`useModel() called without active instance.`);
8011
+ return ref();
8012
+ }
8013
+ const camelizedName = camelize(name);
8014
+ if (!i.propsOptions[0][camelizedName]) {
8015
+ warn$1(`useModel() called with prop "${name}" which is not declared.`);
8016
+ return ref();
8017
+ }
8018
+ const hyphenatedName = hyphenate(name);
8019
+ const modifiers = getModelModifiers(props, camelizedName);
8020
+ const res = customRef((track, trigger) => {
8021
+ let localValue;
8022
+ let prevSetValue = EMPTY_OBJ;
8023
+ let prevEmittedValue;
8024
+ watchSyncEffect(() => {
8025
+ const propValue = props[camelizedName];
8026
+ if (hasChanged(localValue, propValue)) {
8027
+ localValue = propValue;
8028
+ trigger();
8029
+ }
8030
+ });
8031
+ return {
8032
+ get() {
8033
+ track();
8034
+ return options.get ? options.get(localValue) : localValue;
8035
+ },
8036
+ set(value) {
8037
+ const emittedValue = options.set ? options.set(value) : value;
8038
+ if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
8039
+ return;
7825
8040
  }
7826
- if (key in rawProps) {
7827
- return rawProps[key];
8041
+ const rawProps = i.vnode.props;
8042
+ if (!(rawProps && // check if parent has passed v-model
8043
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
8044
+ localValue = value;
8045
+ trigger();
7828
8046
  }
7829
- const injections = instance.type.inject;
7830
- if (injections) {
7831
- if (isArray(injections)) {
7832
- if (injections.includes(key)) {
7833
- return inject(key);
7834
- }
7835
- } else if (key in injections) {
7836
- return inject(key);
7837
- }
8047
+ i.emit(`update:${name}`, emittedValue);
8048
+ if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
8049
+ trigger();
7838
8050
  }
8051
+ prevSetValue = value;
8052
+ prevEmittedValue = emittedValue;
7839
8053
  }
7840
- }
7841
- );
8054
+ };
8055
+ });
8056
+ res[Symbol.iterator] = () => {
8057
+ let i2 = 0;
8058
+ return {
8059
+ next() {
8060
+ if (i2 < 2) {
8061
+ return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false };
8062
+ } else {
8063
+ return { done: true };
8064
+ }
8065
+ }
8066
+ };
8067
+ };
8068
+ return res;
7842
8069
  }
8070
+ const getModelModifiers = (props, modelName) => {
8071
+ return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
8072
+ };
7843
8073
 
7844
- function shouldSkipAttr(key, instance) {
7845
- if (key === "is") {
7846
- return true;
7847
- }
7848
- if ((key === "class" || key === "style") && isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE", instance)) {
7849
- return true;
7850
- }
7851
- if (isOn(key) && isCompatEnabled("INSTANCE_LISTENERS", instance)) {
7852
- return true;
7853
- }
7854
- if (key.startsWith("routerView") || key === "registerRouteInstance") {
7855
- return true;
8074
+ function emit(instance, event, ...rawArgs) {
8075
+ if (instance.isUnmounted) return;
8076
+ const props = instance.vnode.props || EMPTY_OBJ;
8077
+ {
8078
+ const {
8079
+ emitsOptions,
8080
+ propsOptions: [propsOptions]
8081
+ } = instance;
8082
+ if (emitsOptions) {
8083
+ if (!(event in emitsOptions) && !(event.startsWith("hook:") || event.startsWith(compatModelEventPrefix))) {
8084
+ if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
8085
+ warn$1(
8086
+ `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
8087
+ );
8088
+ }
8089
+ } else {
8090
+ const validator = emitsOptions[event];
8091
+ if (isFunction(validator)) {
8092
+ const isValid = validator(...rawArgs);
8093
+ if (!isValid) {
8094
+ warn$1(
8095
+ `Invalid event arguments: event validation failed for event "${event}".`
8096
+ );
8097
+ }
8098
+ }
8099
+ }
8100
+ }
7856
8101
  }
7857
- return false;
7858
- }
7859
-
7860
- const internalObjectProto = {};
7861
- const createInternalObject = () => Object.create(internalObjectProto);
7862
- const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
7863
-
7864
- function initProps(instance, rawProps, isStateful, isSSR = false) {
7865
- const props = {};
7866
- const attrs = createInternalObject();
7867
- instance.propsDefaults = /* @__PURE__ */ Object.create(null);
7868
- setFullProps(instance, rawProps, props, attrs);
7869
- for (const key in instance.propsOptions[0]) {
7870
- if (!(key in props)) {
7871
- props[key] = void 0;
8102
+ let args = rawArgs;
8103
+ const isCompatModelListener = compatModelEventPrefix + event in props;
8104
+ const isModelListener = isCompatModelListener || event.startsWith("update:");
8105
+ const modifiers = isCompatModelListener ? props.modelModifiers : isModelListener && getModelModifiers(props, event.slice(7));
8106
+ if (modifiers) {
8107
+ if (modifiers.trim) {
8108
+ args = rawArgs.map((a) => isString(a) ? a.trim() : a);
8109
+ }
8110
+ if (modifiers.number) {
8111
+ args = rawArgs.map(looseToNumber);
7872
8112
  }
7873
8113
  }
7874
8114
  {
7875
- validateProps(rawProps || {}, props, instance);
8115
+ devtoolsComponentEmit(instance, event, args);
7876
8116
  }
7877
- if (isStateful) {
7878
- instance.props = isSSR ? props : shallowReactive(props);
7879
- } else {
7880
- if (!instance.type.props) {
7881
- instance.props = attrs;
7882
- } else {
7883
- instance.props = props;
8117
+ {
8118
+ const lowerCaseEvent = event.toLowerCase();
8119
+ if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
8120
+ warn$1(
8121
+ `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
8122
+ instance,
8123
+ instance.type
8124
+ )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
8125
+ event
8126
+ )}" instead of "${event}".`
8127
+ );
7884
8128
  }
7885
8129
  }
7886
- instance.attrs = attrs;
7887
- }
7888
- function isInHmrContext(instance) {
7889
- while (instance) {
7890
- if (instance.type.__hmrId) return true;
7891
- instance = instance.parent;
8130
+ let handlerName;
8131
+ let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
8132
+ props[handlerName = toHandlerKey(camelize(event))];
8133
+ if (!handler && isModelListener) {
8134
+ handler = props[handlerName = toHandlerKey(hyphenate(event))];
7892
8135
  }
7893
- }
7894
- function updateProps(instance, rawProps, rawPrevProps, optimized) {
7895
- const {
7896
- props,
7897
- attrs,
7898
- vnode: { patchFlag }
7899
- } = instance;
7900
- const rawCurrentProps = toRaw(props);
7901
- const [options] = instance.propsOptions;
7902
- let hasAttrsChanged = false;
7903
- if (
7904
- // always force full diff in dev
7905
- // - #1942 if hmr is enabled with sfc component
7906
- // - vite#872 non-sfc component used by sfc component
7907
- !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
7908
- ) {
7909
- if (patchFlag & 8) {
7910
- const propsToUpdate = instance.vnode.dynamicProps;
7911
- for (let i = 0; i < propsToUpdate.length; i++) {
7912
- let key = propsToUpdate[i];
7913
- if (isEmitListener(instance.emitsOptions, key)) {
7914
- continue;
7915
- }
7916
- const value = rawProps[key];
7917
- if (options) {
7918
- if (hasOwn(attrs, key)) {
7919
- if (value !== attrs[key]) {
7920
- attrs[key] = value;
7921
- hasAttrsChanged = true;
7922
- }
7923
- } else {
7924
- const camelizedKey = camelize(key);
7925
- props[camelizedKey] = resolvePropValue(
7926
- options,
7927
- rawCurrentProps,
7928
- camelizedKey,
7929
- value,
7930
- instance,
7931
- false
7932
- );
7933
- }
7934
- } else {
7935
- {
7936
- if (isOn(key) && key.endsWith("Native")) {
7937
- key = key.slice(0, -6);
7938
- } else if (shouldSkipAttr(key, instance)) {
7939
- continue;
7940
- }
7941
- }
7942
- if (value !== attrs[key]) {
7943
- attrs[key] = value;
7944
- hasAttrsChanged = true;
7945
- }
7946
- }
7947
- }
7948
- }
7949
- } else {
7950
- if (setFullProps(instance, rawProps, props, attrs)) {
7951
- hasAttrsChanged = true;
7952
- }
7953
- let kebabKey;
7954
- for (const key in rawCurrentProps) {
7955
- if (!rawProps || // for camelCase
7956
- !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
7957
- // and converted to camelCase (#955)
7958
- ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
7959
- if (options) {
7960
- if (rawPrevProps && // for camelCase
7961
- (rawPrevProps[key] !== void 0 || // for kebab-case
7962
- rawPrevProps[kebabKey] !== void 0)) {
7963
- props[key] = resolvePropValue(
7964
- options,
7965
- rawCurrentProps,
7966
- key,
7967
- void 0,
7968
- instance,
7969
- true
7970
- );
7971
- }
7972
- } else {
7973
- delete props[key];
7974
- }
7975
- }
7976
- }
7977
- if (attrs !== rawCurrentProps) {
7978
- for (const key in attrs) {
7979
- if (!rawProps || !hasOwn(rawProps, key) && !hasOwn(rawProps, key + "Native")) {
7980
- delete attrs[key];
7981
- hasAttrsChanged = true;
7982
- }
7983
- }
7984
- }
7985
- }
7986
- if (hasAttrsChanged) {
7987
- trigger(instance.attrs, "set", "");
7988
- }
7989
- {
7990
- validateProps(rawProps || {}, props, instance);
7991
- }
7992
- }
7993
- function setFullProps(instance, rawProps, props, attrs) {
7994
- const [options, needCastKeys] = instance.propsOptions;
7995
- let hasAttrsChanged = false;
7996
- let rawCastValues;
7997
- if (rawProps) {
7998
- for (let key in rawProps) {
7999
- if (isReservedProp(key)) {
8000
- continue;
8001
- }
8002
- {
8003
- if (key.startsWith("onHook:")) {
8004
- softAssertCompatEnabled(
8005
- "INSTANCE_EVENT_HOOKS",
8006
- instance,
8007
- key.slice(2).toLowerCase()
8008
- );
8009
- }
8010
- if (key === "inline-template") {
8011
- continue;
8012
- }
8013
- }
8014
- const value = rawProps[key];
8015
- let camelKey;
8016
- if (options && hasOwn(options, camelKey = camelize(key))) {
8017
- if (!needCastKeys || !needCastKeys.includes(camelKey)) {
8018
- props[camelKey] = value;
8019
- } else {
8020
- (rawCastValues || (rawCastValues = {}))[camelKey] = value;
8021
- }
8022
- } else if (!isEmitListener(instance.emitsOptions, key)) {
8023
- {
8024
- if (isOn(key) && key.endsWith("Native")) {
8025
- key = key.slice(0, -6);
8026
- } else if (shouldSkipAttr(key, instance)) {
8027
- continue;
8028
- }
8029
- }
8030
- if (!(key in attrs) || value !== attrs[key]) {
8031
- attrs[key] = value;
8032
- hasAttrsChanged = true;
8033
- }
8034
- }
8035
- }
8136
+ if (handler) {
8137
+ callWithAsyncErrorHandling(
8138
+ handler,
8139
+ instance,
8140
+ 6,
8141
+ args
8142
+ );
8036
8143
  }
8037
- if (needCastKeys) {
8038
- const rawCurrentProps = toRaw(props);
8039
- const castValues = rawCastValues || EMPTY_OBJ;
8040
- for (let i = 0; i < needCastKeys.length; i++) {
8041
- const key = needCastKeys[i];
8042
- props[key] = resolvePropValue(
8043
- options,
8044
- rawCurrentProps,
8045
- key,
8046
- castValues[key],
8047
- instance,
8048
- !hasOwn(castValues, key)
8049
- );
8144
+ const onceHandler = props[handlerName + `Once`];
8145
+ if (onceHandler) {
8146
+ if (!instance.emitted) {
8147
+ instance.emitted = {};
8148
+ } else if (instance.emitted[handlerName]) {
8149
+ return;
8050
8150
  }
8151
+ instance.emitted[handlerName] = true;
8152
+ callWithAsyncErrorHandling(
8153
+ onceHandler,
8154
+ instance,
8155
+ 6,
8156
+ args
8157
+ );
8051
8158
  }
8052
- return hasAttrsChanged;
8053
- }
8054
- function resolvePropValue(options, props, key, value, instance, isAbsent) {
8055
- const opt = options[key];
8056
- if (opt != null) {
8057
- const hasDefault = hasOwn(opt, "default");
8058
- if (hasDefault && value === void 0) {
8059
- const defaultValue = opt.default;
8060
- if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
8061
- const { propsDefaults } = instance;
8062
- if (key in propsDefaults) {
8063
- value = propsDefaults[key];
8064
- } else {
8065
- const reset = setCurrentInstance(instance);
8066
- value = propsDefaults[key] = defaultValue.call(
8067
- isCompatEnabled("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props, key) : null,
8068
- props
8069
- );
8070
- reset();
8071
- }
8072
- } else {
8073
- value = defaultValue;
8074
- }
8075
- if (instance.ce) {
8076
- instance.ce._setProp(key, value);
8077
- }
8078
- }
8079
- if (opt[0 /* shouldCast */]) {
8080
- if (isAbsent && !hasDefault) {
8081
- value = false;
8082
- } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
8083
- value = true;
8084
- }
8085
- }
8159
+ {
8160
+ compatModelEmit(instance, event, args);
8161
+ return emit$1(instance, event, args);
8086
8162
  }
8087
- return value;
8088
8163
  }
8089
- const mixinPropsCache = /* @__PURE__ */ new WeakMap();
8090
- function normalizePropsOptions(comp, appContext, asMixin = false) {
8091
- const cache = asMixin ? mixinPropsCache : appContext.propsCache;
8164
+ const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
8165
+ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
8166
+ const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
8092
8167
  const cached = cache.get(comp);
8093
- if (cached) {
8168
+ if (cached !== void 0) {
8094
8169
  return cached;
8095
8170
  }
8096
- const raw = comp.props;
8097
- const normalized = {};
8098
- const needCastKeys = [];
8171
+ const raw = comp.emits;
8172
+ let normalized = {};
8099
8173
  let hasExtends = false;
8100
8174
  if (!isFunction(comp)) {
8101
- const extendProps = (raw2) => {
8102
- if (isFunction(raw2)) {
8103
- raw2 = raw2.options;
8175
+ const extendEmits = (raw2) => {
8176
+ const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
8177
+ if (normalizedFromExtend) {
8178
+ hasExtends = true;
8179
+ extend(normalized, normalizedFromExtend);
8104
8180
  }
8105
- hasExtends = true;
8106
- const [props, keys] = normalizePropsOptions(raw2, appContext, true);
8107
- extend(normalized, props);
8108
- if (keys) needCastKeys.push(...keys);
8109
8181
  };
8110
8182
  if (!asMixin && appContext.mixins.length) {
8111
- appContext.mixins.forEach(extendProps);
8183
+ appContext.mixins.forEach(extendEmits);
8112
8184
  }
8113
8185
  if (comp.extends) {
8114
- extendProps(comp.extends);
8186
+ extendEmits(comp.extends);
8115
8187
  }
8116
8188
  if (comp.mixins) {
8117
- comp.mixins.forEach(extendProps);
8189
+ comp.mixins.forEach(extendEmits);
8118
8190
  }
8119
8191
  }
8120
8192
  if (!raw && !hasExtends) {
8121
8193
  if (isObject(comp)) {
8122
- cache.set(comp, EMPTY_ARR);
8194
+ cache.set(comp, null);
8123
8195
  }
8124
- return EMPTY_ARR;
8196
+ return null;
8125
8197
  }
8126
8198
  if (isArray(raw)) {
8127
- for (let i = 0; i < raw.length; i++) {
8128
- if (!isString(raw[i])) {
8129
- warn$1(`props must be strings when using array syntax.`, raw[i]);
8130
- }
8131
- const normalizedKey = camelize(raw[i]);
8132
- if (validatePropName(normalizedKey)) {
8133
- normalized[normalizedKey] = EMPTY_OBJ;
8134
- }
8135
- }
8136
- } else if (raw) {
8137
- if (!isObject(raw)) {
8138
- warn$1(`invalid props options`, raw);
8139
- }
8140
- for (const key in raw) {
8141
- const normalizedKey = camelize(key);
8142
- if (validatePropName(normalizedKey)) {
8143
- const opt = raw[key];
8144
- const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
8145
- const propType = prop.type;
8146
- let shouldCast = false;
8147
- let shouldCastTrue = true;
8148
- if (isArray(propType)) {
8149
- for (let index = 0; index < propType.length; ++index) {
8150
- const type = propType[index];
8151
- const typeName = isFunction(type) && type.name;
8152
- if (typeName === "Boolean") {
8153
- shouldCast = true;
8154
- break;
8155
- } else if (typeName === "String") {
8156
- shouldCastTrue = false;
8157
- }
8158
- }
8159
- } else {
8160
- shouldCast = isFunction(propType) && propType.name === "Boolean";
8161
- }
8162
- prop[0 /* shouldCast */] = shouldCast;
8163
- prop[1 /* shouldCastTrue */] = shouldCastTrue;
8164
- if (shouldCast || hasOwn(prop, "default")) {
8165
- needCastKeys.push(normalizedKey);
8166
- }
8167
- }
8168
- }
8199
+ raw.forEach((key) => normalized[key] = null);
8200
+ } else {
8201
+ extend(normalized, raw);
8169
8202
  }
8170
- const res = [normalized, needCastKeys];
8171
8203
  if (isObject(comp)) {
8172
- cache.set(comp, res);
8204
+ cache.set(comp, normalized);
8173
8205
  }
8174
- return res;
8206
+ return normalized;
8175
8207
  }
8176
- function validatePropName(key) {
8177
- if (key[0] !== "$" && !isReservedProp(key)) {
8208
+ function isEmitListener(options, key) {
8209
+ if (!options || !isOn(key)) {
8210
+ return false;
8211
+ }
8212
+ if (key.startsWith(compatModelEventPrefix)) {
8178
8213
  return true;
8179
- } else {
8180
- warn$1(`Invalid prop name: "${key}" is a reserved property.`);
8181
8214
  }
8182
- return false;
8215
+ key = key.slice(2).replace(/Once$/, "");
8216
+ return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
8183
8217
  }
8184
- function getType(ctor) {
8185
- if (ctor === null) {
8186
- return "null";
8218
+
8219
+ let accessedAttrs = false;
8220
+ function markAttrsAccessed() {
8221
+ accessedAttrs = true;
8222
+ }
8223
+ function renderComponentRoot(instance) {
8224
+ const {
8225
+ type: Component,
8226
+ vnode,
8227
+ proxy,
8228
+ withProxy,
8229
+ propsOptions: [propsOptions],
8230
+ slots,
8231
+ attrs,
8232
+ emit,
8233
+ render,
8234
+ renderCache,
8235
+ props,
8236
+ data,
8237
+ setupState,
8238
+ ctx,
8239
+ inheritAttrs
8240
+ } = instance;
8241
+ const prev = setCurrentRenderingInstance(instance);
8242
+ let result;
8243
+ let fallthroughAttrs;
8244
+ {
8245
+ accessedAttrs = false;
8187
8246
  }
8188
- if (typeof ctor === "function") {
8189
- return ctor.name || "";
8190
- } else if (typeof ctor === "object") {
8191
- const name = ctor.constructor && ctor.constructor.name;
8192
- return name || "";
8247
+ try {
8248
+ if (vnode.shapeFlag & 4) {
8249
+ const proxyToUse = withProxy || proxy;
8250
+ const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
8251
+ get(target, key, receiver) {
8252
+ warn$1(
8253
+ `Property '${String(
8254
+ key
8255
+ )}' was accessed via 'this'. Avoid using 'this' in templates.`
8256
+ );
8257
+ return Reflect.get(target, key, receiver);
8258
+ }
8259
+ }) : proxyToUse;
8260
+ result = normalizeVNode(
8261
+ render.call(
8262
+ thisProxy,
8263
+ proxyToUse,
8264
+ renderCache,
8265
+ true ? shallowReadonly(props) : props,
8266
+ setupState,
8267
+ data,
8268
+ ctx
8269
+ )
8270
+ );
8271
+ fallthroughAttrs = attrs;
8272
+ } else {
8273
+ const render2 = Component;
8274
+ if (attrs === props) {
8275
+ markAttrsAccessed();
8276
+ }
8277
+ result = normalizeVNode(
8278
+ render2.length > 1 ? render2(
8279
+ true ? shallowReadonly(props) : props,
8280
+ true ? {
8281
+ get attrs() {
8282
+ markAttrsAccessed();
8283
+ return shallowReadonly(attrs);
8284
+ },
8285
+ slots,
8286
+ emit
8287
+ } : { attrs, slots, emit }
8288
+ ) : render2(
8289
+ true ? shallowReadonly(props) : props,
8290
+ null
8291
+ )
8292
+ );
8293
+ fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
8294
+ }
8295
+ } catch (err) {
8296
+ blockStack.length = 0;
8297
+ handleError(err, instance, 1);
8298
+ result = createVNode(Comment);
8193
8299
  }
8194
- return "";
8195
- }
8196
- function validateProps(rawProps, props, instance) {
8197
- const resolvedValues = toRaw(props);
8198
- const options = instance.propsOptions[0];
8199
- const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
8200
- for (const key in options) {
8201
- let opt = options[key];
8202
- if (opt == null) continue;
8203
- validateProp(
8204
- key,
8205
- resolvedValues[key],
8206
- opt,
8207
- shallowReadonly(resolvedValues) ,
8208
- !camelizePropsKey.includes(key)
8209
- );
8300
+ let root = result;
8301
+ let setRoot = void 0;
8302
+ if (result.patchFlag > 0 && result.patchFlag & 2048) {
8303
+ [root, setRoot] = getChildRoot(result);
8210
8304
  }
8211
- }
8212
- function validateProp(name, value, prop, props, isAbsent) {
8213
- const { type, required, validator, skipCheck } = prop;
8214
- if (required && isAbsent) {
8215
- warn$1('Missing required prop: "' + name + '"');
8216
- return;
8305
+ if (fallthroughAttrs && inheritAttrs !== false) {
8306
+ const keys = Object.keys(fallthroughAttrs);
8307
+ const { shapeFlag } = root;
8308
+ if (keys.length) {
8309
+ if (shapeFlag & (1 | 6)) {
8310
+ if (propsOptions && keys.some(isModelListener)) {
8311
+ fallthroughAttrs = filterModelListeners(
8312
+ fallthroughAttrs,
8313
+ propsOptions
8314
+ );
8315
+ }
8316
+ root = cloneVNode(root, fallthroughAttrs, false, true);
8317
+ } else if (!accessedAttrs && root.type !== Comment) {
8318
+ const allAttrs = Object.keys(attrs);
8319
+ const eventAttrs = [];
8320
+ const extraAttrs = [];
8321
+ for (let i = 0, l = allAttrs.length; i < l; i++) {
8322
+ const key = allAttrs[i];
8323
+ if (isOn(key)) {
8324
+ if (!isModelListener(key)) {
8325
+ eventAttrs.push(key[2].toLowerCase() + key.slice(3));
8326
+ }
8327
+ } else {
8328
+ extraAttrs.push(key);
8329
+ }
8330
+ }
8331
+ if (extraAttrs.length) {
8332
+ warn$1(
8333
+ `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
8334
+ );
8335
+ }
8336
+ if (eventAttrs.length) {
8337
+ warn$1(
8338
+ `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
8339
+ );
8340
+ }
8341
+ }
8342
+ }
8217
8343
  }
8218
- if (value == null && !required) {
8219
- return;
8344
+ if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE", instance) && vnode.shapeFlag & 4 && root.shapeFlag & (1 | 6)) {
8345
+ const { class: cls, style } = vnode.props || {};
8346
+ if (cls || style) {
8347
+ if (inheritAttrs === false) {
8348
+ warnDeprecation(
8349
+ "INSTANCE_ATTRS_CLASS_STYLE",
8350
+ instance,
8351
+ getComponentName(instance.type)
8352
+ );
8353
+ }
8354
+ root = cloneVNode(
8355
+ root,
8356
+ {
8357
+ class: cls,
8358
+ style
8359
+ },
8360
+ false,
8361
+ true
8362
+ );
8363
+ }
8220
8364
  }
8221
- if (type != null && type !== true && !skipCheck) {
8222
- let isValid = false;
8223
- const types = isArray(type) ? type : [type];
8224
- const expectedTypes = [];
8225
- for (let i = 0; i < types.length && !isValid; i++) {
8226
- const { valid, expectedType } = assertType(value, types[i]);
8227
- expectedTypes.push(expectedType || "");
8228
- isValid = valid;
8365
+ if (vnode.dirs) {
8366
+ if (!isElementRoot(root)) {
8367
+ warn$1(
8368
+ `Runtime directive used on component with non-element root node. The directives will not function as intended.`
8369
+ );
8229
8370
  }
8230
- if (!isValid) {
8231
- warn$1(getInvalidTypeMessage(name, value, expectedTypes));
8232
- return;
8371
+ root = cloneVNode(root, null, false, true);
8372
+ root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
8373
+ }
8374
+ if (vnode.transition) {
8375
+ if (!isElementRoot(root)) {
8376
+ warn$1(
8377
+ `Component inside <Transition> renders non-element root node that cannot be animated.`
8378
+ );
8233
8379
  }
8380
+ setTransitionHooks(root, vnode.transition);
8234
8381
  }
8235
- if (validator && !validator(value, props)) {
8236
- warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
8382
+ if (setRoot) {
8383
+ setRoot(root);
8384
+ } else {
8385
+ result = root;
8237
8386
  }
8387
+ setCurrentRenderingInstance(prev);
8388
+ return result;
8238
8389
  }
8239
- const isSimpleType = /* @__PURE__ */ makeMap(
8240
- "String,Number,Boolean,Function,Symbol,BigInt"
8241
- );
8242
- function assertType(value, type) {
8243
- let valid;
8244
- const expectedType = getType(type);
8245
- if (expectedType === "null") {
8246
- valid = value === null;
8247
- } else if (isSimpleType(expectedType)) {
8248
- const t = typeof value;
8249
- valid = t === expectedType.toLowerCase();
8250
- if (!valid && t === "object") {
8251
- valid = value instanceof type;
8252
- }
8253
- } else if (expectedType === "Object") {
8254
- valid = isObject(value);
8255
- } else if (expectedType === "Array") {
8256
- valid = isArray(value);
8257
- } else {
8258
- valid = value instanceof type;
8259
- }
8260
- return {
8261
- valid,
8262
- expectedType
8263
- };
8264
- }
8265
- function getInvalidTypeMessage(name, value, expectedTypes) {
8266
- if (expectedTypes.length === 0) {
8267
- return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
8268
- }
8269
- let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
8270
- const expectedType = expectedTypes[0];
8271
- const receivedType = toRawType(value);
8272
- const expectedValue = styleValue(value, expectedType);
8273
- const receivedValue = styleValue(value, receivedType);
8274
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
8275
- message += ` with value ${expectedValue}`;
8276
- }
8277
- message += `, got ${receivedType} `;
8278
- if (isExplicable(receivedType)) {
8279
- message += `with value ${receivedValue}.`;
8280
- }
8281
- return message;
8282
- }
8283
- function styleValue(value, type) {
8284
- if (type === "String") {
8285
- return `"${value}"`;
8286
- } else if (type === "Number") {
8287
- return `${Number(value)}`;
8288
- } else {
8289
- return `${value}`;
8290
- }
8291
- }
8292
- function isExplicable(type) {
8293
- const explicitTypes = ["string", "number", "boolean"];
8294
- return explicitTypes.some((elem) => type.toLowerCase() === elem);
8295
- }
8296
- function isBoolean(...args) {
8297
- return args.some((elem) => elem.toLowerCase() === "boolean");
8298
- }
8299
-
8300
- const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
8301
- const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
8302
- const normalizeSlot = (key, rawSlot, ctx) => {
8303
- if (rawSlot._n) {
8304
- return rawSlot;
8390
+ const getChildRoot = (vnode) => {
8391
+ const rawChildren = vnode.children;
8392
+ const dynamicChildren = vnode.dynamicChildren;
8393
+ const childRoot = filterSingleRoot(rawChildren, false);
8394
+ if (!childRoot) {
8395
+ return [vnode, void 0];
8396
+ } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
8397
+ return getChildRoot(childRoot);
8305
8398
  }
8306
- const normalized = withCtx((...args) => {
8307
- if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
8308
- warn$1(
8309
- `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
8310
- );
8399
+ const index = rawChildren.indexOf(childRoot);
8400
+ const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
8401
+ const setRoot = (updatedRoot) => {
8402
+ rawChildren[index] = updatedRoot;
8403
+ if (dynamicChildren) {
8404
+ if (dynamicIndex > -1) {
8405
+ dynamicChildren[dynamicIndex] = updatedRoot;
8406
+ } else if (updatedRoot.patchFlag > 0) {
8407
+ vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
8408
+ }
8311
8409
  }
8312
- return normalizeSlotValue(rawSlot(...args));
8313
- }, ctx);
8314
- normalized._c = false;
8315
- return normalized;
8410
+ };
8411
+ return [normalizeVNode(childRoot), setRoot];
8316
8412
  };
8317
- const normalizeObjectSlots = (rawSlots, slots, instance) => {
8318
- const ctx = rawSlots._ctx;
8319
- for (const key in rawSlots) {
8320
- if (isInternalKey(key)) continue;
8321
- const value = rawSlots[key];
8322
- if (isFunction(value)) {
8323
- slots[key] = normalizeSlot(key, value, ctx);
8324
- } else if (value != null) {
8325
- if (!isCompatEnabled("RENDER_FUNCTION", instance)) {
8326
- warn$1(
8327
- `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
8328
- );
8413
+ function filterSingleRoot(children, recurse = true) {
8414
+ let singleRoot;
8415
+ for (let i = 0; i < children.length; i++) {
8416
+ const child = children[i];
8417
+ if (isVNode(child)) {
8418
+ if (child.type !== Comment || child.children === "v-if") {
8419
+ if (singleRoot) {
8420
+ return;
8421
+ } else {
8422
+ singleRoot = child;
8423
+ if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
8424
+ return filterSingleRoot(singleRoot.children);
8425
+ }
8426
+ }
8329
8427
  }
8330
- const normalized = normalizeSlotValue(value);
8331
- slots[key] = () => normalized;
8428
+ } else {
8429
+ return;
8332
8430
  }
8333
8431
  }
8334
- };
8335
- const normalizeVNodeSlots = (instance, children) => {
8336
- if (!isKeepAlive(instance.vnode) && !isCompatEnabled("RENDER_FUNCTION", instance)) {
8337
- warn$1(
8338
- `Non-function value encountered for default slot. Prefer function slots for better performance.`
8339
- );
8340
- }
8341
- const normalized = normalizeSlotValue(children);
8342
- instance.slots.default = () => normalized;
8343
- };
8344
- const assignSlots = (slots, children, optimized) => {
8345
- for (const key in children) {
8346
- if (optimized || !isInternalKey(key)) {
8347
- slots[key] = children[key];
8432
+ return singleRoot;
8433
+ }
8434
+ const getFunctionalFallthrough = (attrs) => {
8435
+ let res;
8436
+ for (const key in attrs) {
8437
+ if (key === "class" || key === "style" || isOn(key)) {
8438
+ (res || (res = {}))[key] = attrs[key];
8348
8439
  }
8349
8440
  }
8441
+ return res;
8350
8442
  };
8351
- const initSlots = (instance, children, optimized) => {
8352
- const slots = instance.slots = createInternalObject();
8353
- if (instance.vnode.shapeFlag & 32) {
8354
- const type = children._;
8355
- if (type) {
8356
- assignSlots(slots, children, optimized);
8357
- if (optimized) {
8358
- def(slots, "_", type, true);
8359
- }
8360
- } else {
8361
- normalizeObjectSlots(children, slots, instance);
8443
+ const filterModelListeners = (attrs, props) => {
8444
+ const res = {};
8445
+ for (const key in attrs) {
8446
+ if (!isModelListener(key) || !(key.slice(9) in props)) {
8447
+ res[key] = attrs[key];
8362
8448
  }
8363
- } else if (children) {
8364
- normalizeVNodeSlots(instance, children);
8365
8449
  }
8450
+ return res;
8366
8451
  };
8367
- const updateSlots = (instance, children, optimized) => {
8368
- const { vnode, slots } = instance;
8369
- let needDeletionCheck = true;
8370
- let deletionComparisonTarget = EMPTY_OBJ;
8371
- if (vnode.shapeFlag & 32) {
8372
- const type = children._;
8373
- if (type) {
8374
- if (isHmrUpdating) {
8375
- assignSlots(slots, children, optimized);
8376
- trigger(instance, "set", "$slots");
8377
- } else if (optimized && type === 1) {
8378
- needDeletionCheck = false;
8379
- } else {
8380
- assignSlots(slots, children, optimized);
8452
+ const isElementRoot = (vnode) => {
8453
+ return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
8454
+ };
8455
+ function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
8456
+ const { props: prevProps, children: prevChildren, component } = prevVNode;
8457
+ const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
8458
+ const emits = component.emitsOptions;
8459
+ if ((prevChildren || nextChildren) && isHmrUpdating) {
8460
+ return true;
8461
+ }
8462
+ if (nextVNode.dirs || nextVNode.transition) {
8463
+ return true;
8464
+ }
8465
+ if (optimized && patchFlag >= 0) {
8466
+ if (patchFlag & 1024) {
8467
+ return true;
8468
+ }
8469
+ if (patchFlag & 16) {
8470
+ if (!prevProps) {
8471
+ return !!nextProps;
8472
+ }
8473
+ return hasPropsChanged(prevProps, nextProps, emits);
8474
+ } else if (patchFlag & 8) {
8475
+ const dynamicProps = nextVNode.dynamicProps;
8476
+ for (let i = 0; i < dynamicProps.length; i++) {
8477
+ const key = dynamicProps[i];
8478
+ if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
8479
+ return true;
8480
+ }
8381
8481
  }
8382
- } else {
8383
- needDeletionCheck = !children.$stable;
8384
- normalizeObjectSlots(children, slots, instance);
8385
8482
  }
8386
- deletionComparisonTarget = children;
8387
- } else if (children) {
8388
- normalizeVNodeSlots(instance, children);
8389
- deletionComparisonTarget = { default: 1 };
8390
- }
8391
- if (needDeletionCheck) {
8392
- for (const key in slots) {
8393
- if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
8394
- delete slots[key];
8483
+ } else {
8484
+ if (prevChildren || nextChildren) {
8485
+ if (!nextChildren || !nextChildren.$stable) {
8486
+ return true;
8395
8487
  }
8396
8488
  }
8489
+ if (prevProps === nextProps) {
8490
+ return false;
8491
+ }
8492
+ if (!prevProps) {
8493
+ return !!nextProps;
8494
+ }
8495
+ if (!nextProps) {
8496
+ return true;
8497
+ }
8498
+ return hasPropsChanged(prevProps, nextProps, emits);
8397
8499
  }
8398
- };
8399
-
8400
- let supported;
8401
- let perf;
8402
- function startMeasure(instance, type) {
8403
- if (instance.appContext.config.performance && isSupported()) {
8404
- perf.mark(`vue-${type}-${instance.uid}`);
8500
+ return false;
8501
+ }
8502
+ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
8503
+ const nextKeys = Object.keys(nextProps);
8504
+ if (nextKeys.length !== Object.keys(prevProps).length) {
8505
+ return true;
8405
8506
  }
8406
- {
8407
- devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
8507
+ for (let i = 0; i < nextKeys.length; i++) {
8508
+ const key = nextKeys[i];
8509
+ if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
8510
+ return true;
8511
+ }
8408
8512
  }
8513
+ return false;
8409
8514
  }
8410
- function endMeasure(instance, type) {
8411
- if (instance.appContext.config.performance && isSupported()) {
8412
- const startTag = `vue-${type}-${instance.uid}`;
8413
- const endTag = startTag + `:end`;
8414
- const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
8415
- perf.mark(endTag);
8416
- perf.measure(measureName, startTag, endTag);
8417
- perf.clearMeasures(measureName);
8418
- perf.clearMarks(startTag);
8419
- perf.clearMarks(endTag);
8420
- }
8421
- {
8422
- devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
8515
+ function updateHOCHostEl({ vnode, parent }, el) {
8516
+ while (parent) {
8517
+ const root = parent.subTree;
8518
+ if (root.suspense && root.suspense.activeBranch === vnode) {
8519
+ root.el = vnode.el;
8520
+ }
8521
+ if (root === vnode) {
8522
+ (vnode = parent.vnode).el = el;
8523
+ parent = parent.parent;
8524
+ } else {
8525
+ break;
8526
+ }
8423
8527
  }
8424
8528
  }
8425
- function isSupported() {
8426
- if (supported !== void 0) {
8427
- return supported;
8529
+
8530
+ function createPropsDefaultThis(instance, rawProps, propKey) {
8531
+ return new Proxy(
8532
+ {},
8533
+ {
8534
+ get(_, key) {
8535
+ warnDeprecation("PROPS_DEFAULT_THIS", null, propKey);
8536
+ if (key === "$options") {
8537
+ return resolveMergedOptions(instance);
8538
+ }
8539
+ if (key in rawProps) {
8540
+ return rawProps[key];
8541
+ }
8542
+ const injections = instance.type.inject;
8543
+ if (injections) {
8544
+ if (isArray(injections)) {
8545
+ if (injections.includes(key)) {
8546
+ return inject(key);
8547
+ }
8548
+ } else if (key in injections) {
8549
+ return inject(key);
8550
+ }
8551
+ }
8552
+ }
8553
+ }
8554
+ );
8555
+ }
8556
+
8557
+ function shouldSkipAttr(key, instance) {
8558
+ if (key === "is") {
8559
+ return true;
8428
8560
  }
8429
- if (typeof window !== "undefined" && window.performance) {
8430
- supported = true;
8431
- perf = window.performance;
8432
- } else {
8433
- supported = false;
8561
+ if ((key === "class" || key === "style") && isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE", instance)) {
8562
+ return true;
8434
8563
  }
8435
- return supported;
8564
+ if (isOn(key) && isCompatEnabled("INSTANCE_LISTENERS", instance)) {
8565
+ return true;
8566
+ }
8567
+ if (key.startsWith("routerView") || key === "registerRouteInstance") {
8568
+ return true;
8569
+ }
8570
+ return false;
8436
8571
  }
8437
8572
 
8438
- const queuePostRenderEffect = queueEffectWithSuspense ;
8439
- function createRenderer(options) {
8440
- return baseCreateRenderer(options);
8441
- }
8442
- function createHydrationRenderer(options) {
8443
- return baseCreateRenderer(options, createHydrationFunctions);
8444
- }
8445
- function baseCreateRenderer(options, createHydrationFns) {
8446
- const target = getGlobalThis();
8447
- target.__VUE__ = true;
8573
+ const internalObjectProto = {};
8574
+ const createInternalObject = () => Object.create(internalObjectProto);
8575
+ const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
8576
+
8577
+ function initProps(instance, rawProps, isStateful, isSSR = false) {
8578
+ const props = {};
8579
+ const attrs = createInternalObject();
8580
+ instance.propsDefaults = /* @__PURE__ */ Object.create(null);
8581
+ setFullProps(instance, rawProps, props, attrs);
8582
+ for (const key in instance.propsOptions[0]) {
8583
+ if (!(key in props)) {
8584
+ props[key] = void 0;
8585
+ }
8586
+ }
8448
8587
  {
8449
- setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
8588
+ validateProps(rawProps || {}, props, instance);
8450
8589
  }
8451
- const {
8452
- insert: hostInsert,
8453
- remove: hostRemove,
8454
- patchProp: hostPatchProp,
8455
- createElement: hostCreateElement,
8456
- createText: hostCreateText,
8457
- createComment: hostCreateComment,
8458
- setText: hostSetText,
8459
- setElementText: hostSetElementText,
8460
- parentNode: hostParentNode,
8461
- nextSibling: hostNextSibling,
8462
- setScopeId: hostSetScopeId = NOOP,
8463
- insertStaticContent: hostInsertStaticContent
8464
- } = options;
8465
- const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
8466
- if (n1 === n2) {
8467
- return;
8590
+ if (isStateful) {
8591
+ instance.props = isSSR ? props : shallowReactive(props);
8592
+ } else {
8593
+ if (!instance.type.props) {
8594
+ instance.props = attrs;
8595
+ } else {
8596
+ instance.props = props;
8468
8597
  }
8469
- if (n1 && !isSameVNodeType(n1, n2)) {
8470
- anchor = getNextHostNode(n1);
8471
- unmount(n1, parentComponent, parentSuspense, true);
8472
- n1 = null;
8598
+ }
8599
+ instance.attrs = attrs;
8600
+ }
8601
+ function isInHmrContext(instance) {
8602
+ while (instance) {
8603
+ if (instance.type.__hmrId) return true;
8604
+ instance = instance.parent;
8605
+ }
8606
+ }
8607
+ function updateProps(instance, rawProps, rawPrevProps, optimized) {
8608
+ const {
8609
+ props,
8610
+ attrs,
8611
+ vnode: { patchFlag }
8612
+ } = instance;
8613
+ const rawCurrentProps = toRaw(props);
8614
+ const [options] = instance.propsOptions;
8615
+ let hasAttrsChanged = false;
8616
+ if (
8617
+ // always force full diff in dev
8618
+ // - #1942 if hmr is enabled with sfc component
8619
+ // - vite#872 non-sfc component used by sfc component
8620
+ !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
8621
+ ) {
8622
+ if (patchFlag & 8) {
8623
+ const propsToUpdate = instance.vnode.dynamicProps;
8624
+ for (let i = 0; i < propsToUpdate.length; i++) {
8625
+ let key = propsToUpdate[i];
8626
+ if (isEmitListener(instance.emitsOptions, key)) {
8627
+ continue;
8628
+ }
8629
+ const value = rawProps[key];
8630
+ if (options) {
8631
+ if (hasOwn(attrs, key)) {
8632
+ if (value !== attrs[key]) {
8633
+ attrs[key] = value;
8634
+ hasAttrsChanged = true;
8635
+ }
8636
+ } else {
8637
+ const camelizedKey = camelize(key);
8638
+ props[camelizedKey] = resolvePropValue(
8639
+ options,
8640
+ rawCurrentProps,
8641
+ camelizedKey,
8642
+ value,
8643
+ instance,
8644
+ false
8645
+ );
8646
+ }
8647
+ } else {
8648
+ {
8649
+ if (isOn(key) && key.endsWith("Native")) {
8650
+ key = key.slice(0, -6);
8651
+ } else if (shouldSkipAttr(key, instance)) {
8652
+ continue;
8653
+ }
8654
+ }
8655
+ if (value !== attrs[key]) {
8656
+ attrs[key] = value;
8657
+ hasAttrsChanged = true;
8658
+ }
8659
+ }
8660
+ }
8473
8661
  }
8474
- if (n2.patchFlag === -2) {
8475
- optimized = false;
8476
- n2.dynamicChildren = null;
8662
+ } else {
8663
+ if (setFullProps(instance, rawProps, props, attrs)) {
8664
+ hasAttrsChanged = true;
8477
8665
  }
8478
- const { type, ref, shapeFlag } = n2;
8479
- switch (type) {
8480
- case Text:
8481
- processText(n1, n2, container, anchor);
8482
- break;
8483
- case Comment:
8484
- processCommentNode(n1, n2, container, anchor);
8485
- break;
8486
- case Static:
8487
- if (n1 == null) {
8488
- mountStaticNode(n2, container, anchor, namespace);
8666
+ let kebabKey;
8667
+ for (const key in rawCurrentProps) {
8668
+ if (!rawProps || // for camelCase
8669
+ !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
8670
+ // and converted to camelCase (#955)
8671
+ ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
8672
+ if (options) {
8673
+ if (rawPrevProps && // for camelCase
8674
+ (rawPrevProps[key] !== void 0 || // for kebab-case
8675
+ rawPrevProps[kebabKey] !== void 0)) {
8676
+ props[key] = resolvePropValue(
8677
+ options,
8678
+ rawCurrentProps,
8679
+ key,
8680
+ void 0,
8681
+ instance,
8682
+ true
8683
+ );
8684
+ }
8489
8685
  } else {
8490
- patchStaticNode(n1, n2, container, namespace);
8686
+ delete props[key];
8491
8687
  }
8492
- break;
8493
- case Fragment:
8494
- processFragment(
8495
- n1,
8496
- n2,
8497
- container,
8498
- anchor,
8499
- parentComponent,
8500
- parentSuspense,
8501
- namespace,
8502
- slotScopeIds,
8503
- optimized
8504
- );
8505
- break;
8506
- default:
8507
- if (shapeFlag & 1) {
8508
- processElement(
8509
- n1,
8510
- n2,
8511
- container,
8512
- anchor,
8513
- parentComponent,
8514
- parentSuspense,
8515
- namespace,
8516
- slotScopeIds,
8517
- optimized
8518
- );
8519
- } else if (shapeFlag & 6) {
8520
- processComponent(
8521
- n1,
8522
- n2,
8523
- container,
8524
- anchor,
8525
- parentComponent,
8526
- parentSuspense,
8527
- namespace,
8528
- slotScopeIds,
8529
- optimized
8530
- );
8531
- } else if (shapeFlag & 64) {
8532
- type.process(
8533
- n1,
8534
- n2,
8535
- container,
8536
- anchor,
8537
- parentComponent,
8538
- parentSuspense,
8539
- namespace,
8540
- slotScopeIds,
8541
- optimized,
8542
- internals
8543
- );
8544
- } else if (shapeFlag & 128) {
8545
- type.process(
8546
- n1,
8547
- n2,
8548
- container,
8549
- anchor,
8550
- parentComponent,
8551
- parentSuspense,
8552
- namespace,
8553
- slotScopeIds,
8554
- optimized,
8555
- internals
8688
+ }
8689
+ }
8690
+ if (attrs !== rawCurrentProps) {
8691
+ for (const key in attrs) {
8692
+ if (!rawProps || !hasOwn(rawProps, key) && !hasOwn(rawProps, key + "Native")) {
8693
+ delete attrs[key];
8694
+ hasAttrsChanged = true;
8695
+ }
8696
+ }
8697
+ }
8698
+ }
8699
+ if (hasAttrsChanged) {
8700
+ trigger(instance.attrs, "set", "");
8701
+ }
8702
+ {
8703
+ validateProps(rawProps || {}, props, instance);
8704
+ }
8705
+ }
8706
+ function setFullProps(instance, rawProps, props, attrs) {
8707
+ const [options, needCastKeys] = instance.propsOptions;
8708
+ let hasAttrsChanged = false;
8709
+ let rawCastValues;
8710
+ if (rawProps) {
8711
+ for (let key in rawProps) {
8712
+ if (isReservedProp(key)) {
8713
+ continue;
8714
+ }
8715
+ {
8716
+ if (key.startsWith("onHook:")) {
8717
+ softAssertCompatEnabled(
8718
+ "INSTANCE_EVENT_HOOKS",
8719
+ instance,
8720
+ key.slice(2).toLowerCase()
8556
8721
  );
8722
+ }
8723
+ if (key === "inline-template") {
8724
+ continue;
8725
+ }
8726
+ }
8727
+ const value = rawProps[key];
8728
+ let camelKey;
8729
+ if (options && hasOwn(options, camelKey = camelize(key))) {
8730
+ if (!needCastKeys || !needCastKeys.includes(camelKey)) {
8731
+ props[camelKey] = value;
8557
8732
  } else {
8558
- warn$1("Invalid VNode type:", type, `(${typeof type})`);
8733
+ (rawCastValues || (rawCastValues = {}))[camelKey] = value;
8559
8734
  }
8735
+ } else if (!isEmitListener(instance.emitsOptions, key)) {
8736
+ {
8737
+ if (isOn(key) && key.endsWith("Native")) {
8738
+ key = key.slice(0, -6);
8739
+ } else if (shouldSkipAttr(key, instance)) {
8740
+ continue;
8741
+ }
8742
+ }
8743
+ if (!(key in attrs) || value !== attrs[key]) {
8744
+ attrs[key] = value;
8745
+ hasAttrsChanged = true;
8746
+ }
8747
+ }
8560
8748
  }
8561
- if (ref != null && parentComponent) {
8562
- setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
8563
- } else if (ref == null && n1 && n1.ref != null) {
8564
- setRef(n1.ref, null, parentSuspense, n1, true);
8565
- }
8566
- };
8567
- const processText = (n1, n2, container, anchor) => {
8568
- if (n1 == null) {
8569
- hostInsert(
8570
- n2.el = hostCreateText(n2.children),
8571
- container,
8572
- anchor
8749
+ }
8750
+ if (needCastKeys) {
8751
+ const rawCurrentProps = toRaw(props);
8752
+ const castValues = rawCastValues || EMPTY_OBJ;
8753
+ for (let i = 0; i < needCastKeys.length; i++) {
8754
+ const key = needCastKeys[i];
8755
+ props[key] = resolvePropValue(
8756
+ options,
8757
+ rawCurrentProps,
8758
+ key,
8759
+ castValues[key],
8760
+ instance,
8761
+ !hasOwn(castValues, key)
8573
8762
  );
8574
- } else {
8575
- const el = n2.el = n1.el;
8576
- if (n2.children !== n1.children) {
8577
- hostSetText(el, n2.children);
8763
+ }
8764
+ }
8765
+ return hasAttrsChanged;
8766
+ }
8767
+ function resolvePropValue(options, props, key, value, instance, isAbsent) {
8768
+ const opt = options[key];
8769
+ if (opt != null) {
8770
+ const hasDefault = hasOwn(opt, "default");
8771
+ if (hasDefault && value === void 0) {
8772
+ const defaultValue = opt.default;
8773
+ if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
8774
+ const { propsDefaults } = instance;
8775
+ if (key in propsDefaults) {
8776
+ value = propsDefaults[key];
8777
+ } else {
8778
+ const reset = setCurrentInstance(instance);
8779
+ value = propsDefaults[key] = defaultValue.call(
8780
+ isCompatEnabled("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props, key) : null,
8781
+ props
8782
+ );
8783
+ reset();
8784
+ }
8785
+ } else {
8786
+ value = defaultValue;
8787
+ }
8788
+ if (instance.ce) {
8789
+ instance.ce._setProp(key, value);
8578
8790
  }
8579
8791
  }
8580
- };
8581
- const processCommentNode = (n1, n2, container, anchor) => {
8582
- if (n1 == null) {
8583
- hostInsert(
8584
- n2.el = hostCreateComment(n2.children || ""),
8585
- container,
8586
- anchor
8587
- );
8588
- } else {
8589
- n2.el = n1.el;
8792
+ if (opt[0 /* shouldCast */]) {
8793
+ if (isAbsent && !hasDefault) {
8794
+ value = false;
8795
+ } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
8796
+ value = true;
8797
+ }
8590
8798
  }
8591
- };
8592
- const mountStaticNode = (n2, container, anchor, namespace) => {
8593
- [n2.el, n2.anchor] = hostInsertStaticContent(
8594
- n2.children,
8595
- container,
8596
- anchor,
8597
- namespace,
8598
- n2.el,
8599
- n2.anchor
8600
- );
8601
- };
8602
- const patchStaticNode = (n1, n2, container, namespace) => {
8603
- if (n2.children !== n1.children) {
8604
- const anchor = hostNextSibling(n1.anchor);
8605
- removeStaticNode(n1);
8606
- [n2.el, n2.anchor] = hostInsertStaticContent(
8607
- n2.children,
8608
- container,
8609
- anchor,
8610
- namespace
8611
- );
8612
- } else {
8613
- n2.el = n1.el;
8614
- n2.anchor = n1.anchor;
8799
+ }
8800
+ return value;
8801
+ }
8802
+ const mixinPropsCache = /* @__PURE__ */ new WeakMap();
8803
+ function normalizePropsOptions(comp, appContext, asMixin = false) {
8804
+ const cache = asMixin ? mixinPropsCache : appContext.propsCache;
8805
+ const cached = cache.get(comp);
8806
+ if (cached) {
8807
+ return cached;
8808
+ }
8809
+ const raw = comp.props;
8810
+ const normalized = {};
8811
+ const needCastKeys = [];
8812
+ let hasExtends = false;
8813
+ if (!isFunction(comp)) {
8814
+ const extendProps = (raw2) => {
8815
+ if (isFunction(raw2)) {
8816
+ raw2 = raw2.options;
8817
+ }
8818
+ hasExtends = true;
8819
+ const [props, keys] = normalizePropsOptions(raw2, appContext, true);
8820
+ extend(normalized, props);
8821
+ if (keys) needCastKeys.push(...keys);
8822
+ };
8823
+ if (!asMixin && appContext.mixins.length) {
8824
+ appContext.mixins.forEach(extendProps);
8615
8825
  }
8616
- };
8617
- const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
8618
- let next;
8619
- while (el && el !== anchor) {
8620
- next = hostNextSibling(el);
8621
- hostInsert(el, container, nextSibling);
8622
- el = next;
8826
+ if (comp.extends) {
8827
+ extendProps(comp.extends);
8623
8828
  }
8624
- hostInsert(anchor, container, nextSibling);
8625
- };
8626
- const removeStaticNode = ({ el, anchor }) => {
8627
- let next;
8628
- while (el && el !== anchor) {
8629
- next = hostNextSibling(el);
8630
- hostRemove(el);
8631
- el = next;
8829
+ if (comp.mixins) {
8830
+ comp.mixins.forEach(extendProps);
8632
8831
  }
8633
- hostRemove(anchor);
8634
- };
8635
- const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8636
- if (n2.type === "svg") {
8637
- namespace = "svg";
8638
- } else if (n2.type === "math") {
8639
- namespace = "mathml";
8832
+ }
8833
+ if (!raw && !hasExtends) {
8834
+ if (isObject(comp)) {
8835
+ cache.set(comp, EMPTY_ARR);
8640
8836
  }
8641
- if (n1 == null) {
8642
- mountElement(
8643
- n2,
8644
- container,
8645
- anchor,
8646
- parentComponent,
8647
- parentSuspense,
8648
- namespace,
8649
- slotScopeIds,
8650
- optimized
8651
- );
8652
- } else {
8653
- const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
8654
- try {
8655
- if (customElement) {
8656
- customElement._beginPatch();
8657
- }
8658
- patchElement(
8659
- n1,
8660
- n2,
8661
- parentComponent,
8662
- parentSuspense,
8663
- namespace,
8664
- slotScopeIds,
8665
- optimized
8666
- );
8667
- } finally {
8668
- if (customElement) {
8669
- customElement._endPatch();
8670
- }
8837
+ return EMPTY_ARR;
8838
+ }
8839
+ if (isArray(raw)) {
8840
+ for (let i = 0; i < raw.length; i++) {
8841
+ if (!isString(raw[i])) {
8842
+ warn$1(`props must be strings when using array syntax.`, raw[i]);
8843
+ }
8844
+ const normalizedKey = camelize(raw[i]);
8845
+ if (validatePropName(normalizedKey)) {
8846
+ normalized[normalizedKey] = EMPTY_OBJ;
8671
8847
  }
8672
8848
  }
8673
- };
8674
- const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8675
- let el;
8676
- let vnodeHook;
8677
- const { props, shapeFlag, transition, dirs } = vnode;
8678
- el = vnode.el = hostCreateElement(
8679
- vnode.type,
8680
- namespace,
8681
- props && props.is,
8682
- props
8683
- );
8684
- if (shapeFlag & 8) {
8685
- hostSetElementText(el, vnode.children);
8686
- } else if (shapeFlag & 16) {
8687
- mountChildren(
8688
- vnode.children,
8689
- el,
8690
- null,
8691
- parentComponent,
8692
- parentSuspense,
8693
- resolveChildrenNamespace(vnode, namespace),
8694
- slotScopeIds,
8695
- optimized
8696
- );
8697
- }
8698
- if (dirs) {
8699
- invokeDirectiveHook(vnode, null, parentComponent, "created");
8849
+ } else if (raw) {
8850
+ if (!isObject(raw)) {
8851
+ warn$1(`invalid props options`, raw);
8700
8852
  }
8701
- setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
8702
- if (props) {
8703
- for (const key in props) {
8704
- if (key !== "value" && !isReservedProp(key)) {
8705
- hostPatchProp(el, key, null, props[key], namespace, parentComponent);
8853
+ for (const key in raw) {
8854
+ const normalizedKey = camelize(key);
8855
+ if (validatePropName(normalizedKey)) {
8856
+ const opt = raw[key];
8857
+ const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
8858
+ const propType = prop.type;
8859
+ let shouldCast = false;
8860
+ let shouldCastTrue = true;
8861
+ if (isArray(propType)) {
8862
+ for (let index = 0; index < propType.length; ++index) {
8863
+ const type = propType[index];
8864
+ const typeName = isFunction(type) && type.name;
8865
+ if (typeName === "Boolean") {
8866
+ shouldCast = true;
8867
+ break;
8868
+ } else if (typeName === "String") {
8869
+ shouldCastTrue = false;
8870
+ }
8871
+ }
8872
+ } else {
8873
+ shouldCast = isFunction(propType) && propType.name === "Boolean";
8874
+ }
8875
+ prop[0 /* shouldCast */] = shouldCast;
8876
+ prop[1 /* shouldCastTrue */] = shouldCastTrue;
8877
+ if (shouldCast || hasOwn(prop, "default")) {
8878
+ needCastKeys.push(normalizedKey);
8706
8879
  }
8707
8880
  }
8708
- if ("value" in props) {
8709
- hostPatchProp(el, "value", null, props.value, namespace);
8710
- }
8711
- if (vnodeHook = props.onVnodeBeforeMount) {
8712
- invokeVNodeHook(vnodeHook, parentComponent, vnode);
8713
- }
8714
- }
8715
- {
8716
- def(el, "__vnode", vnode, true);
8717
- def(el, "__vueParentComponent", parentComponent, true);
8718
8881
  }
8719
- if (dirs) {
8720
- invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
8882
+ }
8883
+ const res = [normalized, needCastKeys];
8884
+ if (isObject(comp)) {
8885
+ cache.set(comp, res);
8886
+ }
8887
+ return res;
8888
+ }
8889
+ function validatePropName(key) {
8890
+ if (key[0] !== "$" && !isReservedProp(key)) {
8891
+ return true;
8892
+ } else {
8893
+ warn$1(`Invalid prop name: "${key}" is a reserved property.`);
8894
+ }
8895
+ return false;
8896
+ }
8897
+ function getType(ctor) {
8898
+ if (ctor === null) {
8899
+ return "null";
8900
+ }
8901
+ if (typeof ctor === "function") {
8902
+ return ctor.name || "";
8903
+ } else if (typeof ctor === "object") {
8904
+ const name = ctor.constructor && ctor.constructor.name;
8905
+ return name || "";
8906
+ }
8907
+ return "";
8908
+ }
8909
+ function validateProps(rawProps, props, instance) {
8910
+ const resolvedValues = toRaw(props);
8911
+ const options = instance.propsOptions[0];
8912
+ const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
8913
+ for (const key in options) {
8914
+ let opt = options[key];
8915
+ if (opt == null) continue;
8916
+ validateProp(
8917
+ key,
8918
+ resolvedValues[key],
8919
+ opt,
8920
+ shallowReadonly(resolvedValues) ,
8921
+ !camelizePropsKey.includes(key)
8922
+ );
8923
+ }
8924
+ }
8925
+ function validateProp(name, value, prop, props, isAbsent) {
8926
+ const { type, required, validator, skipCheck } = prop;
8927
+ if (required && isAbsent) {
8928
+ warn$1('Missing required prop: "' + name + '"');
8929
+ return;
8930
+ }
8931
+ if (value == null && !required) {
8932
+ return;
8933
+ }
8934
+ if (type != null && type !== true && !skipCheck) {
8935
+ let isValid = false;
8936
+ const types = isArray(type) ? type : [type];
8937
+ const expectedTypes = [];
8938
+ for (let i = 0; i < types.length && !isValid; i++) {
8939
+ const { valid, expectedType } = assertType(value, types[i]);
8940
+ expectedTypes.push(expectedType || "");
8941
+ isValid = valid;
8721
8942
  }
8722
- const needCallTransitionHooks = needTransition(parentSuspense, transition);
8723
- if (needCallTransitionHooks) {
8724
- transition.beforeEnter(el);
8943
+ if (!isValid) {
8944
+ warn$1(getInvalidTypeMessage(name, value, expectedTypes));
8945
+ return;
8725
8946
  }
8726
- hostInsert(el, container, anchor);
8727
- if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
8728
- queuePostRenderEffect(() => {
8729
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
8730
- needCallTransitionHooks && transition.enter(el);
8731
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
8732
- }, parentSuspense);
8947
+ }
8948
+ if (validator && !validator(value, props)) {
8949
+ warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
8950
+ }
8951
+ }
8952
+ const isSimpleType = /* @__PURE__ */ makeMap(
8953
+ "String,Number,Boolean,Function,Symbol,BigInt"
8954
+ );
8955
+ function assertType(value, type) {
8956
+ let valid;
8957
+ const expectedType = getType(type);
8958
+ if (expectedType === "null") {
8959
+ valid = value === null;
8960
+ } else if (isSimpleType(expectedType)) {
8961
+ const t = typeof value;
8962
+ valid = t === expectedType.toLowerCase();
8963
+ if (!valid && t === "object") {
8964
+ valid = value instanceof type;
8733
8965
  }
8966
+ } else if (expectedType === "Object") {
8967
+ valid = isObject(value);
8968
+ } else if (expectedType === "Array") {
8969
+ valid = isArray(value);
8970
+ } else {
8971
+ valid = value instanceof type;
8972
+ }
8973
+ return {
8974
+ valid,
8975
+ expectedType
8734
8976
  };
8735
- const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
8736
- if (scopeId) {
8737
- hostSetScopeId(el, scopeId);
8738
- }
8739
- if (slotScopeIds) {
8740
- for (let i = 0; i < slotScopeIds.length; i++) {
8741
- hostSetScopeId(el, slotScopeIds[i]);
8742
- }
8977
+ }
8978
+ function getInvalidTypeMessage(name, value, expectedTypes) {
8979
+ if (expectedTypes.length === 0) {
8980
+ return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
8981
+ }
8982
+ let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
8983
+ const expectedType = expectedTypes[0];
8984
+ const receivedType = toRawType(value);
8985
+ const expectedValue = styleValue(value, expectedType);
8986
+ const receivedValue = styleValue(value, receivedType);
8987
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
8988
+ message += ` with value ${expectedValue}`;
8989
+ }
8990
+ message += `, got ${receivedType} `;
8991
+ if (isExplicable(receivedType)) {
8992
+ message += `with value ${receivedValue}.`;
8993
+ }
8994
+ return message;
8995
+ }
8996
+ function styleValue(value, type) {
8997
+ if (type === "String") {
8998
+ return `"${value}"`;
8999
+ } else if (type === "Number") {
9000
+ return `${Number(value)}`;
9001
+ } else {
9002
+ return `${value}`;
9003
+ }
9004
+ }
9005
+ function isExplicable(type) {
9006
+ const explicitTypes = ["string", "number", "boolean"];
9007
+ return explicitTypes.some((elem) => type.toLowerCase() === elem);
9008
+ }
9009
+ function isBoolean(...args) {
9010
+ return args.some((elem) => elem.toLowerCase() === "boolean");
9011
+ }
9012
+
9013
+ const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
9014
+ const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
9015
+ const normalizeSlot = (key, rawSlot, ctx) => {
9016
+ if (rawSlot._n) {
9017
+ return rawSlot;
9018
+ }
9019
+ const normalized = withCtx((...args) => {
9020
+ if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
9021
+ warn$1(
9022
+ `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
9023
+ );
8743
9024
  }
8744
- if (parentComponent) {
8745
- let subTree = parentComponent.subTree;
8746
- if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
8747
- subTree = filterSingleRoot(subTree.children) || subTree;
8748
- }
8749
- if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
8750
- const parentVNode = parentComponent.vnode;
8751
- setScopeId(
8752
- el,
8753
- parentVNode,
8754
- parentVNode.scopeId,
8755
- parentVNode.slotScopeIds,
8756
- parentComponent.parent
9025
+ return normalizeSlotValue(rawSlot(...args));
9026
+ }, ctx);
9027
+ normalized._c = false;
9028
+ return normalized;
9029
+ };
9030
+ const normalizeObjectSlots = (rawSlots, slots, instance) => {
9031
+ const ctx = rawSlots._ctx;
9032
+ for (const key in rawSlots) {
9033
+ if (isInternalKey(key)) continue;
9034
+ const value = rawSlots[key];
9035
+ if (isFunction(value)) {
9036
+ slots[key] = normalizeSlot(key, value, ctx);
9037
+ } else if (value != null) {
9038
+ if (!isCompatEnabled("RENDER_FUNCTION", instance)) {
9039
+ warn$1(
9040
+ `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
8757
9041
  );
8758
9042
  }
9043
+ const normalized = normalizeSlotValue(value);
9044
+ slots[key] = () => normalized;
8759
9045
  }
8760
- };
8761
- const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
8762
- for (let i = start; i < children.length; i++) {
8763
- const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
8764
- patch(
8765
- null,
8766
- child,
8767
- container,
8768
- anchor,
8769
- parentComponent,
8770
- parentSuspense,
8771
- namespace,
8772
- slotScopeIds,
8773
- optimized
8774
- );
8775
- }
8776
- };
8777
- const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8778
- const el = n2.el = n1.el;
8779
- {
8780
- el.__vnode = n2;
8781
- }
8782
- let { patchFlag, dynamicChildren, dirs } = n2;
8783
- patchFlag |= n1.patchFlag & 16;
8784
- const oldProps = n1.props || EMPTY_OBJ;
8785
- const newProps = n2.props || EMPTY_OBJ;
8786
- let vnodeHook;
8787
- parentComponent && toggleRecurse(parentComponent, false);
8788
- if (vnodeHook = newProps.onVnodeBeforeUpdate) {
8789
- invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
8790
- }
8791
- if (dirs) {
8792
- invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
8793
- }
8794
- parentComponent && toggleRecurse(parentComponent, true);
8795
- if (isHmrUpdating) {
8796
- patchFlag = 0;
8797
- optimized = false;
8798
- dynamicChildren = null;
8799
- }
8800
- if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
8801
- hostSetElementText(el, "");
9046
+ }
9047
+ };
9048
+ const normalizeVNodeSlots = (instance, children) => {
9049
+ if (!isKeepAlive(instance.vnode) && !isCompatEnabled("RENDER_FUNCTION", instance)) {
9050
+ warn$1(
9051
+ `Non-function value encountered for default slot. Prefer function slots for better performance.`
9052
+ );
9053
+ }
9054
+ const normalized = normalizeSlotValue(children);
9055
+ instance.slots.default = () => normalized;
9056
+ };
9057
+ const assignSlots = (slots, children, optimized) => {
9058
+ for (const key in children) {
9059
+ if (optimized || !isInternalKey(key)) {
9060
+ slots[key] = children[key];
8802
9061
  }
8803
- if (dynamicChildren) {
8804
- patchBlockChildren(
8805
- n1.dynamicChildren,
8806
- dynamicChildren,
8807
- el,
8808
- parentComponent,
8809
- parentSuspense,
8810
- resolveChildrenNamespace(n2, namespace),
8811
- slotScopeIds
8812
- );
8813
- {
8814
- traverseStaticChildren(n1, n2);
9062
+ }
9063
+ };
9064
+ const initSlots = (instance, children, optimized) => {
9065
+ const slots = instance.slots = createInternalObject();
9066
+ if (instance.vnode.shapeFlag & 32) {
9067
+ const type = children._;
9068
+ if (type) {
9069
+ assignSlots(slots, children, optimized);
9070
+ if (optimized) {
9071
+ def(slots, "_", type, true);
8815
9072
  }
8816
- } else if (!optimized) {
8817
- patchChildren(
8818
- n1,
8819
- n2,
8820
- el,
8821
- null,
8822
- parentComponent,
8823
- parentSuspense,
8824
- resolveChildrenNamespace(n2, namespace),
8825
- slotScopeIds,
8826
- false
8827
- );
9073
+ } else {
9074
+ normalizeObjectSlots(children, slots, instance);
8828
9075
  }
8829
- if (patchFlag > 0) {
8830
- if (patchFlag & 16) {
8831
- patchProps(el, oldProps, newProps, parentComponent, namespace);
9076
+ } else if (children) {
9077
+ normalizeVNodeSlots(instance, children);
9078
+ }
9079
+ };
9080
+ const updateSlots = (instance, children, optimized) => {
9081
+ const { vnode, slots } = instance;
9082
+ let needDeletionCheck = true;
9083
+ let deletionComparisonTarget = EMPTY_OBJ;
9084
+ if (vnode.shapeFlag & 32) {
9085
+ const type = children._;
9086
+ if (type) {
9087
+ if (isHmrUpdating) {
9088
+ assignSlots(slots, children, optimized);
9089
+ trigger(instance, "set", "$slots");
9090
+ } else if (optimized && type === 1) {
9091
+ needDeletionCheck = false;
8832
9092
  } else {
8833
- if (patchFlag & 2) {
8834
- if (oldProps.class !== newProps.class) {
8835
- hostPatchProp(el, "class", null, newProps.class, namespace);
8836
- }
8837
- }
8838
- if (patchFlag & 4) {
8839
- hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
8840
- }
8841
- if (patchFlag & 8) {
8842
- const propsToUpdate = n2.dynamicProps;
8843
- for (let i = 0; i < propsToUpdate.length; i++) {
8844
- const key = propsToUpdate[i];
8845
- const prev = oldProps[key];
8846
- const next = newProps[key];
8847
- if (next !== prev || key === "value") {
8848
- hostPatchProp(el, key, prev, next, namespace, parentComponent);
8849
- }
8850
- }
8851
- }
8852
- }
8853
- if (patchFlag & 1) {
8854
- if (n1.children !== n2.children) {
8855
- hostSetElementText(el, n2.children);
8856
- }
9093
+ assignSlots(slots, children, optimized);
8857
9094
  }
8858
- } else if (!optimized && dynamicChildren == null) {
8859
- patchProps(el, oldProps, newProps, parentComponent, namespace);
8860
- }
8861
- if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
8862
- queuePostRenderEffect(() => {
8863
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
8864
- dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
8865
- }, parentSuspense);
8866
- }
8867
- };
8868
- const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
8869
- for (let i = 0; i < newChildren.length; i++) {
8870
- const oldVNode = oldChildren[i];
8871
- const newVNode = newChildren[i];
8872
- const container = (
8873
- // oldVNode may be an errored async setup() component inside Suspense
8874
- // which will not have a mounted element
8875
- oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
8876
- // of the Fragment itself so it can move its children.
8877
- (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
8878
- // which also requires the correct parent container
8879
- !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
8880
- oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
8881
- // In other cases, the parent container is not actually used so we
8882
- // just pass the block element here to avoid a DOM parentNode call.
8883
- fallbackContainer
8884
- )
8885
- );
8886
- patch(
8887
- oldVNode,
8888
- newVNode,
8889
- container,
8890
- null,
8891
- parentComponent,
8892
- parentSuspense,
8893
- namespace,
8894
- slotScopeIds,
8895
- true
8896
- );
9095
+ } else {
9096
+ needDeletionCheck = !children.$stable;
9097
+ normalizeObjectSlots(children, slots, instance);
8897
9098
  }
8898
- };
8899
- const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
8900
- if (oldProps !== newProps) {
8901
- if (oldProps !== EMPTY_OBJ) {
8902
- for (const key in oldProps) {
8903
- if (!isReservedProp(key) && !(key in newProps)) {
8904
- hostPatchProp(
8905
- el,
8906
- key,
8907
- oldProps[key],
8908
- null,
8909
- namespace,
8910
- parentComponent
8911
- );
8912
- }
8913
- }
8914
- }
8915
- for (const key in newProps) {
8916
- if (isReservedProp(key)) continue;
8917
- const next = newProps[key];
8918
- const prev = oldProps[key];
8919
- if (next !== prev && key !== "value") {
8920
- hostPatchProp(el, key, prev, next, namespace, parentComponent);
8921
- }
8922
- }
8923
- if ("value" in newProps) {
8924
- hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
9099
+ deletionComparisonTarget = children;
9100
+ } else if (children) {
9101
+ normalizeVNodeSlots(instance, children);
9102
+ deletionComparisonTarget = { default: 1 };
9103
+ }
9104
+ if (needDeletionCheck) {
9105
+ for (const key in slots) {
9106
+ if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
9107
+ delete slots[key];
8925
9108
  }
8926
9109
  }
8927
- };
8928
- const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8929
- const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
8930
- const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
8931
- let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
8932
- if (
8933
- // #5523 dev root fragment may inherit directives
8934
- isHmrUpdating || patchFlag & 2048
8935
- ) {
8936
- patchFlag = 0;
8937
- optimized = false;
8938
- dynamicChildren = null;
9110
+ }
9111
+ };
9112
+
9113
+ let supported;
9114
+ let perf;
9115
+ function startMeasure(instance, type) {
9116
+ if (instance.appContext.config.performance && isSupported()) {
9117
+ perf.mark(`vue-${type}-${instance.uid}`);
9118
+ }
9119
+ {
9120
+ devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
9121
+ }
9122
+ }
9123
+ function endMeasure(instance, type) {
9124
+ if (instance.appContext.config.performance && isSupported()) {
9125
+ const startTag = `vue-${type}-${instance.uid}`;
9126
+ const endTag = startTag + `:end`;
9127
+ const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
9128
+ perf.mark(endTag);
9129
+ perf.measure(measureName, startTag, endTag);
9130
+ perf.clearMeasures(measureName);
9131
+ perf.clearMarks(startTag);
9132
+ perf.clearMarks(endTag);
9133
+ }
9134
+ {
9135
+ devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
9136
+ }
9137
+ }
9138
+ function isSupported() {
9139
+ if (supported !== void 0) {
9140
+ return supported;
9141
+ }
9142
+ if (typeof window !== "undefined" && window.performance) {
9143
+ supported = true;
9144
+ perf = window.performance;
9145
+ } else {
9146
+ supported = false;
9147
+ }
9148
+ return supported;
9149
+ }
9150
+
9151
+ const queuePostRenderEffect = queueEffectWithSuspense ;
9152
+ function createRenderer(options) {
9153
+ return baseCreateRenderer(options);
9154
+ }
9155
+ function createHydrationRenderer(options) {
9156
+ return baseCreateRenderer(options, createHydrationFunctions);
9157
+ }
9158
+ function baseCreateRenderer(options, createHydrationFns) {
9159
+ const target = getGlobalThis();
9160
+ target.__VUE__ = true;
9161
+ {
9162
+ setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
9163
+ }
9164
+ const {
9165
+ insert: hostInsert,
9166
+ remove: hostRemove,
9167
+ patchProp: hostPatchProp,
9168
+ createElement: hostCreateElement,
9169
+ createText: hostCreateText,
9170
+ createComment: hostCreateComment,
9171
+ setText: hostSetText,
9172
+ setElementText: hostSetElementText,
9173
+ parentNode: hostParentNode,
9174
+ nextSibling: hostNextSibling,
9175
+ setScopeId: hostSetScopeId = NOOP,
9176
+ insertStaticContent: hostInsertStaticContent
9177
+ } = options;
9178
+ const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
9179
+ if (n1 === n2) {
9180
+ return;
8939
9181
  }
8940
- if (fragmentSlotScopeIds) {
8941
- slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
9182
+ if (n1 && !isSameVNodeType(n1, n2)) {
9183
+ anchor = getNextHostNode(n1);
9184
+ unmount(n1, parentComponent, parentSuspense, true);
9185
+ n1 = null;
8942
9186
  }
8943
- if (n1 == null) {
8944
- hostInsert(fragmentStartAnchor, container, anchor);
8945
- hostInsert(fragmentEndAnchor, container, anchor);
8946
- mountChildren(
8947
- // #10007
8948
- // such fragment like `<></>` will be compiled into
8949
- // a fragment which doesn't have a children.
8950
- // In this case fallback to an empty array
8951
- n2.children || [],
8952
- container,
8953
- fragmentEndAnchor,
8954
- parentComponent,
8955
- parentSuspense,
8956
- namespace,
8957
- slotScopeIds,
8958
- optimized
8959
- );
8960
- } else {
8961
- if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
8962
- // of renderSlot() with no valid children
8963
- n1.dynamicChildren) {
8964
- patchBlockChildren(
8965
- n1.dynamicChildren,
8966
- dynamicChildren,
8967
- container,
8968
- parentComponent,
8969
- parentSuspense,
8970
- namespace,
8971
- slotScopeIds
8972
- );
8973
- {
8974
- traverseStaticChildren(n1, n2);
9187
+ if (n2.patchFlag === -2) {
9188
+ optimized = false;
9189
+ n2.dynamicChildren = null;
9190
+ }
9191
+ const { type, ref, shapeFlag } = n2;
9192
+ switch (type) {
9193
+ case Text:
9194
+ processText(n1, n2, container, anchor);
9195
+ break;
9196
+ case Comment:
9197
+ processCommentNode(n1, n2, container, anchor);
9198
+ break;
9199
+ case Static:
9200
+ if (n1 == null) {
9201
+ mountStaticNode(n2, container, anchor, namespace);
9202
+ } else {
9203
+ patchStaticNode(n1, n2, container, namespace);
8975
9204
  }
8976
- } else {
8977
- patchChildren(
9205
+ break;
9206
+ case Fragment:
9207
+ processFragment(
8978
9208
  n1,
8979
9209
  n2,
8980
9210
  container,
8981
- fragmentEndAnchor,
9211
+ anchor,
8982
9212
  parentComponent,
8983
9213
  parentSuspense,
8984
9214
  namespace,
8985
9215
  slotScopeIds,
8986
9216
  optimized
8987
9217
  );
8988
- }
9218
+ break;
9219
+ default:
9220
+ if (shapeFlag & 1) {
9221
+ processElement(
9222
+ n1,
9223
+ n2,
9224
+ container,
9225
+ anchor,
9226
+ parentComponent,
9227
+ parentSuspense,
9228
+ namespace,
9229
+ slotScopeIds,
9230
+ optimized
9231
+ );
9232
+ } else if (shapeFlag & 6) {
9233
+ processComponent(
9234
+ n1,
9235
+ n2,
9236
+ container,
9237
+ anchor,
9238
+ parentComponent,
9239
+ parentSuspense,
9240
+ namespace,
9241
+ slotScopeIds,
9242
+ optimized
9243
+ );
9244
+ } else if (shapeFlag & 64) {
9245
+ type.process(
9246
+ n1,
9247
+ n2,
9248
+ container,
9249
+ anchor,
9250
+ parentComponent,
9251
+ parentSuspense,
9252
+ namespace,
9253
+ slotScopeIds,
9254
+ optimized,
9255
+ internals
9256
+ );
9257
+ } else if (shapeFlag & 128) {
9258
+ type.process(
9259
+ n1,
9260
+ n2,
9261
+ container,
9262
+ anchor,
9263
+ parentComponent,
9264
+ parentSuspense,
9265
+ namespace,
9266
+ slotScopeIds,
9267
+ optimized,
9268
+ internals
9269
+ );
9270
+ } else {
9271
+ warn$1("Invalid VNode type:", type, `(${typeof type})`);
9272
+ }
9273
+ }
9274
+ if (ref != null && parentComponent) {
9275
+ setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
9276
+ } else if (ref == null && n1 && n1.ref != null) {
9277
+ setRef(n1.ref, null, parentSuspense, n1, true);
8989
9278
  }
8990
9279
  };
8991
- const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8992
- n2.slotScopeIds = slotScopeIds;
9280
+ const processText = (n1, n2, container, anchor) => {
8993
9281
  if (n1 == null) {
8994
- if (n2.shapeFlag & 512) {
8995
- parentComponent.ctx.activate(
8996
- n2,
8997
- container,
8998
- anchor,
8999
- namespace,
9000
- optimized
9001
- );
9002
- } else {
9003
- mountComponent(
9004
- n2,
9005
- container,
9006
- anchor,
9007
- parentComponent,
9008
- parentSuspense,
9009
- namespace,
9010
- optimized
9011
- );
9012
- }
9282
+ hostInsert(
9283
+ n2.el = hostCreateText(n2.children),
9284
+ container,
9285
+ anchor
9286
+ );
9013
9287
  } else {
9014
- updateComponent(n1, n2, optimized);
9288
+ const el = n2.el = n1.el;
9289
+ if (n2.children !== n1.children) {
9290
+ if (isHmrUpdating && n2.patchFlag === -1 && "__elIndex" in n1) {
9291
+ const childNodes = container.childNodes;
9292
+ const newChild = hostCreateText(n2.children);
9293
+ const oldChild = childNodes[n2.__elIndex = n1.__elIndex];
9294
+ hostInsert(newChild, container, oldChild);
9295
+ hostRemove(oldChild);
9296
+ } else {
9297
+ hostSetText(el, n2.children);
9298
+ }
9299
+ }
9015
9300
  }
9016
9301
  };
9017
- const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
9018
- const compatMountInstance = initialVNode.isCompatRoot && initialVNode.component;
9019
- const instance = compatMountInstance || (initialVNode.component = createComponentInstance(
9020
- initialVNode,
9021
- parentComponent,
9022
- parentSuspense
9023
- ));
9024
- if (instance.type.__hmrId) {
9025
- registerHMR(instance);
9026
- }
9027
- {
9028
- pushWarningContext(initialVNode);
9029
- startMeasure(instance, `mount`);
9030
- }
9031
- if (isKeepAlive(initialVNode)) {
9032
- instance.ctx.renderer = internals;
9302
+ const processCommentNode = (n1, n2, container, anchor) => {
9303
+ if (n1 == null) {
9304
+ hostInsert(
9305
+ n2.el = hostCreateComment(n2.children || ""),
9306
+ container,
9307
+ anchor
9308
+ );
9309
+ } else {
9310
+ n2.el = n1.el;
9033
9311
  }
9034
- if (!compatMountInstance) {
9035
- {
9036
- startMeasure(instance, `init`);
9037
- }
9038
- setupComponent(instance, false, optimized);
9039
- {
9040
- endMeasure(instance, `init`);
9041
- }
9042
- }
9043
- if (isHmrUpdating) initialVNode.el = null;
9044
- if (instance.asyncDep) {
9045
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
9046
- if (!initialVNode.el) {
9047
- const placeholder = instance.subTree = createVNode(Comment);
9048
- processCommentNode(null, placeholder, container, anchor);
9049
- initialVNode.placeholder = placeholder.el;
9050
- }
9312
+ };
9313
+ const mountStaticNode = (n2, container, anchor, namespace) => {
9314
+ [n2.el, n2.anchor] = hostInsertStaticContent(
9315
+ n2.children,
9316
+ container,
9317
+ anchor,
9318
+ namespace,
9319
+ n2.el,
9320
+ n2.anchor
9321
+ );
9322
+ };
9323
+ const patchStaticNode = (n1, n2, container, namespace) => {
9324
+ if (n2.children !== n1.children) {
9325
+ const anchor = hostNextSibling(n1.anchor);
9326
+ removeStaticNode(n1);
9327
+ [n2.el, n2.anchor] = hostInsertStaticContent(
9328
+ n2.children,
9329
+ container,
9330
+ anchor,
9331
+ namespace
9332
+ );
9051
9333
  } else {
9052
- setupRenderEffect(
9053
- instance,
9054
- initialVNode,
9334
+ n2.el = n1.el;
9335
+ n2.anchor = n1.anchor;
9336
+ }
9337
+ };
9338
+ const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
9339
+ let next;
9340
+ while (el && el !== anchor) {
9341
+ next = hostNextSibling(el);
9342
+ hostInsert(el, container, nextSibling);
9343
+ el = next;
9344
+ }
9345
+ hostInsert(anchor, container, nextSibling);
9346
+ };
9347
+ const removeStaticNode = ({ el, anchor }) => {
9348
+ let next;
9349
+ while (el && el !== anchor) {
9350
+ next = hostNextSibling(el);
9351
+ hostRemove(el);
9352
+ el = next;
9353
+ }
9354
+ hostRemove(anchor);
9355
+ };
9356
+ const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9357
+ if (n2.type === "svg") {
9358
+ namespace = "svg";
9359
+ } else if (n2.type === "math") {
9360
+ namespace = "mathml";
9361
+ }
9362
+ if (n1 == null) {
9363
+ mountElement(
9364
+ n2,
9055
9365
  container,
9056
9366
  anchor,
9367
+ parentComponent,
9057
9368
  parentSuspense,
9058
9369
  namespace,
9370
+ slotScopeIds,
9371
+ optimized
9372
+ );
9373
+ } else {
9374
+ const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
9375
+ try {
9376
+ if (customElement) {
9377
+ customElement._beginPatch();
9378
+ }
9379
+ patchElement(
9380
+ n1,
9381
+ n2,
9382
+ parentComponent,
9383
+ parentSuspense,
9384
+ namespace,
9385
+ slotScopeIds,
9386
+ optimized
9387
+ );
9388
+ } finally {
9389
+ if (customElement) {
9390
+ customElement._endPatch();
9391
+ }
9392
+ }
9393
+ }
9394
+ };
9395
+ const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9396
+ let el;
9397
+ let vnodeHook;
9398
+ const { props, shapeFlag, transition, dirs } = vnode;
9399
+ el = vnode.el = hostCreateElement(
9400
+ vnode.type,
9401
+ namespace,
9402
+ props && props.is,
9403
+ props
9404
+ );
9405
+ if (shapeFlag & 8) {
9406
+ hostSetElementText(el, vnode.children);
9407
+ } else if (shapeFlag & 16) {
9408
+ mountChildren(
9409
+ vnode.children,
9410
+ el,
9411
+ null,
9412
+ parentComponent,
9413
+ parentSuspense,
9414
+ resolveChildrenNamespace(vnode, namespace),
9415
+ slotScopeIds,
9059
9416
  optimized
9060
9417
  );
9061
9418
  }
9419
+ if (dirs) {
9420
+ invokeDirectiveHook(vnode, null, parentComponent, "created");
9421
+ }
9422
+ setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
9423
+ if (props) {
9424
+ for (const key in props) {
9425
+ if (key !== "value" && !isReservedProp(key)) {
9426
+ hostPatchProp(el, key, null, props[key], namespace, parentComponent);
9427
+ }
9428
+ }
9429
+ if ("value" in props) {
9430
+ hostPatchProp(el, "value", null, props.value, namespace);
9431
+ }
9432
+ if (vnodeHook = props.onVnodeBeforeMount) {
9433
+ invokeVNodeHook(vnodeHook, parentComponent, vnode);
9434
+ }
9435
+ }
9062
9436
  {
9063
- popWarningContext();
9064
- endMeasure(instance, `mount`);
9437
+ def(el, "__vnode", vnode, true);
9438
+ def(el, "__vueParentComponent", parentComponent, true);
9439
+ }
9440
+ if (dirs) {
9441
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
9442
+ }
9443
+ const needCallTransitionHooks = needTransition(parentSuspense, transition);
9444
+ if (needCallTransitionHooks) {
9445
+ transition.beforeEnter(el);
9446
+ }
9447
+ hostInsert(el, container, anchor);
9448
+ if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
9449
+ queuePostRenderEffect(() => {
9450
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
9451
+ needCallTransitionHooks && transition.enter(el);
9452
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
9453
+ }, parentSuspense);
9065
9454
  }
9066
9455
  };
9067
- const updateComponent = (n1, n2, optimized) => {
9068
- const instance = n2.component = n1.component;
9069
- if (shouldUpdateComponent(n1, n2, optimized)) {
9070
- if (instance.asyncDep && !instance.asyncResolved) {
9071
- {
9072
- pushWarningContext(n2);
9073
- }
9074
- updateComponentPreRender(instance, n2, optimized);
9075
- {
9076
- popWarningContext();
9077
- }
9078
- return;
9079
- } else {
9080
- instance.next = n2;
9081
- instance.update();
9456
+ const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
9457
+ if (scopeId) {
9458
+ hostSetScopeId(el, scopeId);
9459
+ }
9460
+ if (slotScopeIds) {
9461
+ for (let i = 0; i < slotScopeIds.length; i++) {
9462
+ hostSetScopeId(el, slotScopeIds[i]);
9463
+ }
9464
+ }
9465
+ if (parentComponent) {
9466
+ let subTree = parentComponent.subTree;
9467
+ if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
9468
+ subTree = filterSingleRoot(subTree.children) || subTree;
9469
+ }
9470
+ if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
9471
+ const parentVNode = parentComponent.vnode;
9472
+ setScopeId(
9473
+ el,
9474
+ parentVNode,
9475
+ parentVNode.scopeId,
9476
+ parentVNode.slotScopeIds,
9477
+ parentComponent.parent
9478
+ );
9082
9479
  }
9083
- } else {
9084
- n2.el = n1.el;
9085
- instance.vnode = n2;
9086
9480
  }
9087
9481
  };
9088
- const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
9089
- const componentUpdateFn = () => {
9090
- if (!instance.isMounted) {
9091
- let vnodeHook;
9092
- const { el, props } = initialVNode;
9093
- const { bm, m, parent, root, type } = instance;
9094
- const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
9095
- toggleRecurse(instance, false);
9096
- if (bm) {
9097
- invokeArrayFns(bm);
9098
- }
9099
- if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
9100
- invokeVNodeHook(vnodeHook, parent, initialVNode);
9101
- }
9102
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
9103
- instance.emit("hook:beforeMount");
9104
- }
9105
- toggleRecurse(instance, true);
9106
- if (el && hydrateNode) {
9107
- const hydrateSubTree = () => {
9108
- {
9109
- startMeasure(instance, `render`);
9110
- }
9111
- instance.subTree = renderComponentRoot(instance);
9112
- {
9113
- endMeasure(instance, `render`);
9114
- }
9115
- {
9116
- startMeasure(instance, `hydrate`);
9117
- }
9118
- hydrateNode(
9119
- el,
9120
- instance.subTree,
9121
- instance,
9122
- parentSuspense,
9123
- null
9124
- );
9125
- {
9126
- endMeasure(instance, `hydrate`);
9127
- }
9128
- };
9129
- if (isAsyncWrapperVNode && type.__asyncHydrate) {
9130
- type.__asyncHydrate(
9131
- el,
9132
- instance,
9133
- hydrateSubTree
9134
- );
9135
- } else {
9136
- hydrateSubTree();
9137
- }
9138
- } else {
9139
- if (root.ce && // @ts-expect-error _def is private
9140
- root.ce._def.shadowRoot !== false) {
9141
- root.ce._injectChildStyle(type);
9142
- }
9143
- {
9144
- startMeasure(instance, `render`);
9145
- }
9146
- const subTree = instance.subTree = renderComponentRoot(instance);
9147
- {
9148
- endMeasure(instance, `render`);
9149
- }
9150
- {
9151
- startMeasure(instance, `patch`);
9152
- }
9153
- patch(
9154
- null,
9155
- subTree,
9156
- container,
9157
- anchor,
9158
- instance,
9159
- parentSuspense,
9160
- namespace
9161
- );
9162
- {
9163
- endMeasure(instance, `patch`);
9482
+ const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
9483
+ for (let i = start; i < children.length; i++) {
9484
+ const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
9485
+ patch(
9486
+ null,
9487
+ child,
9488
+ container,
9489
+ anchor,
9490
+ parentComponent,
9491
+ parentSuspense,
9492
+ namespace,
9493
+ slotScopeIds,
9494
+ optimized
9495
+ );
9496
+ }
9497
+ };
9498
+ const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9499
+ const el = n2.el = n1.el;
9500
+ {
9501
+ el.__vnode = n2;
9502
+ }
9503
+ let { patchFlag, dynamicChildren, dirs } = n2;
9504
+ patchFlag |= n1.patchFlag & 16;
9505
+ const oldProps = n1.props || EMPTY_OBJ;
9506
+ const newProps = n2.props || EMPTY_OBJ;
9507
+ let vnodeHook;
9508
+ parentComponent && toggleRecurse(parentComponent, false);
9509
+ if (vnodeHook = newProps.onVnodeBeforeUpdate) {
9510
+ invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
9511
+ }
9512
+ if (dirs) {
9513
+ invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
9514
+ }
9515
+ parentComponent && toggleRecurse(parentComponent, true);
9516
+ if (isHmrUpdating) {
9517
+ patchFlag = 0;
9518
+ optimized = false;
9519
+ dynamicChildren = null;
9520
+ }
9521
+ if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
9522
+ hostSetElementText(el, "");
9523
+ }
9524
+ if (dynamicChildren) {
9525
+ patchBlockChildren(
9526
+ n1.dynamicChildren,
9527
+ dynamicChildren,
9528
+ el,
9529
+ parentComponent,
9530
+ parentSuspense,
9531
+ resolveChildrenNamespace(n2, namespace),
9532
+ slotScopeIds
9533
+ );
9534
+ {
9535
+ traverseStaticChildren(n1, n2);
9536
+ }
9537
+ } else if (!optimized) {
9538
+ patchChildren(
9539
+ n1,
9540
+ n2,
9541
+ el,
9542
+ null,
9543
+ parentComponent,
9544
+ parentSuspense,
9545
+ resolveChildrenNamespace(n2, namespace),
9546
+ slotScopeIds,
9547
+ false
9548
+ );
9549
+ }
9550
+ if (patchFlag > 0) {
9551
+ if (patchFlag & 16) {
9552
+ patchProps(el, oldProps, newProps, parentComponent, namespace);
9553
+ } else {
9554
+ if (patchFlag & 2) {
9555
+ if (oldProps.class !== newProps.class) {
9556
+ hostPatchProp(el, "class", null, newProps.class, namespace);
9164
9557
  }
9165
- initialVNode.el = subTree.el;
9166
9558
  }
9167
- if (m) {
9168
- queuePostRenderEffect(m, parentSuspense);
9559
+ if (patchFlag & 4) {
9560
+ hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
9169
9561
  }
9170
- if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
9171
- const scopedInitialVNode = initialVNode;
9172
- queuePostRenderEffect(
9173
- () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
9174
- parentSuspense
9175
- );
9562
+ if (patchFlag & 8) {
9563
+ const propsToUpdate = n2.dynamicProps;
9564
+ for (let i = 0; i < propsToUpdate.length; i++) {
9565
+ const key = propsToUpdate[i];
9566
+ const prev = oldProps[key];
9567
+ const next = newProps[key];
9568
+ if (next !== prev || key === "value") {
9569
+ hostPatchProp(el, key, prev, next, namespace, parentComponent);
9570
+ }
9571
+ }
9176
9572
  }
9177
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
9178
- queuePostRenderEffect(
9179
- () => instance.emit("hook:mounted"),
9180
- parentSuspense
9181
- );
9573
+ }
9574
+ if (patchFlag & 1) {
9575
+ if (n1.children !== n2.children) {
9576
+ hostSetElementText(el, n2.children);
9182
9577
  }
9183
- if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
9184
- instance.a && queuePostRenderEffect(instance.a, parentSuspense);
9185
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
9186
- queuePostRenderEffect(
9187
- () => instance.emit("hook:activated"),
9188
- parentSuspense
9578
+ }
9579
+ } else if (!optimized && dynamicChildren == null) {
9580
+ patchProps(el, oldProps, newProps, parentComponent, namespace);
9581
+ }
9582
+ if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
9583
+ queuePostRenderEffect(() => {
9584
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
9585
+ dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
9586
+ }, parentSuspense);
9587
+ }
9588
+ };
9589
+ const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
9590
+ for (let i = 0; i < newChildren.length; i++) {
9591
+ const oldVNode = oldChildren[i];
9592
+ const newVNode = newChildren[i];
9593
+ const container = (
9594
+ // oldVNode may be an errored async setup() component inside Suspense
9595
+ // which will not have a mounted element
9596
+ oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
9597
+ // of the Fragment itself so it can move its children.
9598
+ (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
9599
+ // which also requires the correct parent container
9600
+ !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
9601
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
9602
+ // In other cases, the parent container is not actually used so we
9603
+ // just pass the block element here to avoid a DOM parentNode call.
9604
+ fallbackContainer
9605
+ )
9606
+ );
9607
+ patch(
9608
+ oldVNode,
9609
+ newVNode,
9610
+ container,
9611
+ null,
9612
+ parentComponent,
9613
+ parentSuspense,
9614
+ namespace,
9615
+ slotScopeIds,
9616
+ true
9617
+ );
9618
+ }
9619
+ };
9620
+ const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
9621
+ if (oldProps !== newProps) {
9622
+ if (oldProps !== EMPTY_OBJ) {
9623
+ for (const key in oldProps) {
9624
+ if (!isReservedProp(key) && !(key in newProps)) {
9625
+ hostPatchProp(
9626
+ el,
9627
+ key,
9628
+ oldProps[key],
9629
+ null,
9630
+ namespace,
9631
+ parentComponent
9189
9632
  );
9190
9633
  }
9191
9634
  }
9192
- instance.isMounted = true;
9193
- {
9194
- devtoolsComponentAdded(instance);
9635
+ }
9636
+ for (const key in newProps) {
9637
+ if (isReservedProp(key)) continue;
9638
+ const next = newProps[key];
9639
+ const prev = oldProps[key];
9640
+ if (next !== prev && key !== "value") {
9641
+ hostPatchProp(el, key, prev, next, namespace, parentComponent);
9195
9642
  }
9196
- initialVNode = container = anchor = null;
9197
- } else {
9198
- let { next, bu, u, parent, vnode } = instance;
9643
+ }
9644
+ if ("value" in newProps) {
9645
+ hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
9646
+ }
9647
+ }
9648
+ };
9649
+ const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9650
+ const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
9651
+ const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
9652
+ let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
9653
+ if (
9654
+ // #5523 dev root fragment may inherit directives
9655
+ isHmrUpdating || patchFlag & 2048
9656
+ ) {
9657
+ patchFlag = 0;
9658
+ optimized = false;
9659
+ dynamicChildren = null;
9660
+ }
9661
+ if (fragmentSlotScopeIds) {
9662
+ slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
9663
+ }
9664
+ if (n1 == null) {
9665
+ hostInsert(fragmentStartAnchor, container, anchor);
9666
+ hostInsert(fragmentEndAnchor, container, anchor);
9667
+ mountChildren(
9668
+ // #10007
9669
+ // such fragment like `<></>` will be compiled into
9670
+ // a fragment which doesn't have a children.
9671
+ // In this case fallback to an empty array
9672
+ n2.children || [],
9673
+ container,
9674
+ fragmentEndAnchor,
9675
+ parentComponent,
9676
+ parentSuspense,
9677
+ namespace,
9678
+ slotScopeIds,
9679
+ optimized
9680
+ );
9681
+ } else {
9682
+ if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
9683
+ // of renderSlot() with no valid children
9684
+ n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
9685
+ patchBlockChildren(
9686
+ n1.dynamicChildren,
9687
+ dynamicChildren,
9688
+ container,
9689
+ parentComponent,
9690
+ parentSuspense,
9691
+ namespace,
9692
+ slotScopeIds
9693
+ );
9199
9694
  {
9200
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
9201
- if (nonHydratedAsyncRoot) {
9202
- if (next) {
9203
- next.el = vnode.el;
9204
- updateComponentPreRender(instance, next, optimized);
9205
- }
9206
- nonHydratedAsyncRoot.asyncDep.then(() => {
9207
- if (!instance.isUnmounted) {
9208
- componentUpdateFn();
9209
- }
9210
- });
9211
- return;
9212
- }
9695
+ traverseStaticChildren(n1, n2);
9213
9696
  }
9214
- let originNext = next;
9215
- let vnodeHook;
9216
- {
9697
+ } else {
9698
+ patchChildren(
9699
+ n1,
9700
+ n2,
9701
+ container,
9702
+ fragmentEndAnchor,
9703
+ parentComponent,
9704
+ parentSuspense,
9705
+ namespace,
9706
+ slotScopeIds,
9707
+ optimized
9708
+ );
9709
+ }
9710
+ }
9711
+ };
9712
+ const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9713
+ n2.slotScopeIds = slotScopeIds;
9714
+ if (n1 == null) {
9715
+ if (n2.shapeFlag & 512) {
9716
+ parentComponent.ctx.activate(
9717
+ n2,
9718
+ container,
9719
+ anchor,
9720
+ namespace,
9721
+ optimized
9722
+ );
9723
+ } else {
9724
+ mountComponent(
9725
+ n2,
9726
+ container,
9727
+ anchor,
9728
+ parentComponent,
9729
+ parentSuspense,
9730
+ namespace,
9731
+ optimized
9732
+ );
9733
+ }
9734
+ } else {
9735
+ updateComponent(n1, n2, optimized);
9736
+ }
9737
+ };
9738
+ const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
9739
+ const compatMountInstance = initialVNode.isCompatRoot && initialVNode.component;
9740
+ const instance = compatMountInstance || (initialVNode.component = createComponentInstance(
9741
+ initialVNode,
9742
+ parentComponent,
9743
+ parentSuspense
9744
+ ));
9745
+ if (instance.type.__hmrId) {
9746
+ registerHMR(instance);
9747
+ }
9748
+ {
9749
+ pushWarningContext(initialVNode);
9750
+ startMeasure(instance, `mount`);
9751
+ }
9752
+ if (isKeepAlive(initialVNode)) {
9753
+ instance.ctx.renderer = internals;
9754
+ }
9755
+ if (!compatMountInstance) {
9756
+ {
9757
+ startMeasure(instance, `init`);
9758
+ }
9759
+ setupComponent(instance, false, optimized);
9760
+ {
9761
+ endMeasure(instance, `init`);
9762
+ }
9763
+ }
9764
+ if (isHmrUpdating) initialVNode.el = null;
9765
+ if (instance.asyncDep) {
9766
+ parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
9767
+ if (!initialVNode.el) {
9768
+ const placeholder = instance.subTree = createVNode(Comment);
9769
+ processCommentNode(null, placeholder, container, anchor);
9770
+ initialVNode.placeholder = placeholder.el;
9771
+ }
9772
+ } else {
9773
+ setupRenderEffect(
9774
+ instance,
9775
+ initialVNode,
9776
+ container,
9777
+ anchor,
9778
+ parentSuspense,
9779
+ namespace,
9780
+ optimized
9781
+ );
9782
+ }
9783
+ {
9784
+ popWarningContext();
9785
+ endMeasure(instance, `mount`);
9786
+ }
9787
+ };
9788
+ const updateComponent = (n1, n2, optimized) => {
9789
+ const instance = n2.component = n1.component;
9790
+ if (shouldUpdateComponent(n1, n2, optimized)) {
9791
+ if (instance.asyncDep && !instance.asyncResolved) {
9792
+ {
9793
+ pushWarningContext(n2);
9794
+ }
9795
+ updateComponentPreRender(instance, n2, optimized);
9796
+ {
9797
+ popWarningContext();
9798
+ }
9799
+ return;
9800
+ } else {
9801
+ instance.next = n2;
9802
+ instance.update();
9803
+ }
9804
+ } else {
9805
+ n2.el = n1.el;
9806
+ instance.vnode = n2;
9807
+ }
9808
+ };
9809
+ const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
9810
+ const componentUpdateFn = () => {
9811
+ if (!instance.isMounted) {
9812
+ let vnodeHook;
9813
+ const { el, props } = initialVNode;
9814
+ const { bm, m, parent, root, type } = instance;
9815
+ const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
9816
+ toggleRecurse(instance, false);
9817
+ if (bm) {
9818
+ invokeArrayFns(bm);
9819
+ }
9820
+ if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
9821
+ invokeVNodeHook(vnodeHook, parent, initialVNode);
9822
+ }
9823
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
9824
+ instance.emit("hook:beforeMount");
9825
+ }
9826
+ toggleRecurse(instance, true);
9827
+ if (el && hydrateNode) {
9828
+ const hydrateSubTree = () => {
9829
+ {
9830
+ startMeasure(instance, `render`);
9831
+ }
9832
+ instance.subTree = renderComponentRoot(instance);
9833
+ {
9834
+ endMeasure(instance, `render`);
9835
+ }
9836
+ {
9837
+ startMeasure(instance, `hydrate`);
9838
+ }
9839
+ hydrateNode(
9840
+ el,
9841
+ instance.subTree,
9842
+ instance,
9843
+ parentSuspense,
9844
+ null
9845
+ );
9846
+ {
9847
+ endMeasure(instance, `hydrate`);
9848
+ }
9849
+ };
9850
+ if (isAsyncWrapperVNode && type.__asyncHydrate) {
9851
+ type.__asyncHydrate(
9852
+ el,
9853
+ instance,
9854
+ hydrateSubTree
9855
+ );
9856
+ } else {
9857
+ hydrateSubTree();
9858
+ }
9859
+ } else {
9860
+ if (root.ce && // @ts-expect-error _def is private
9861
+ root.ce._def.shadowRoot !== false) {
9862
+ root.ce._injectChildStyle(type);
9863
+ }
9864
+ {
9865
+ startMeasure(instance, `render`);
9866
+ }
9867
+ const subTree = instance.subTree = renderComponentRoot(instance);
9868
+ {
9869
+ endMeasure(instance, `render`);
9870
+ }
9871
+ {
9872
+ startMeasure(instance, `patch`);
9873
+ }
9874
+ patch(
9875
+ null,
9876
+ subTree,
9877
+ container,
9878
+ anchor,
9879
+ instance,
9880
+ parentSuspense,
9881
+ namespace
9882
+ );
9883
+ {
9884
+ endMeasure(instance, `patch`);
9885
+ }
9886
+ initialVNode.el = subTree.el;
9887
+ }
9888
+ if (m) {
9889
+ queuePostRenderEffect(m, parentSuspense);
9890
+ }
9891
+ if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
9892
+ const scopedInitialVNode = initialVNode;
9893
+ queuePostRenderEffect(
9894
+ () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
9895
+ parentSuspense
9896
+ );
9897
+ }
9898
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
9899
+ queuePostRenderEffect(
9900
+ () => instance.emit("hook:mounted"),
9901
+ parentSuspense
9902
+ );
9903
+ }
9904
+ if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
9905
+ instance.a && queuePostRenderEffect(instance.a, parentSuspense);
9906
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
9907
+ queuePostRenderEffect(
9908
+ () => instance.emit("hook:activated"),
9909
+ parentSuspense
9910
+ );
9911
+ }
9912
+ }
9913
+ instance.isMounted = true;
9914
+ {
9915
+ devtoolsComponentAdded(instance);
9916
+ }
9917
+ initialVNode = container = anchor = null;
9918
+ } else {
9919
+ let { next, bu, u, parent, vnode } = instance;
9920
+ {
9921
+ const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
9922
+ if (nonHydratedAsyncRoot) {
9923
+ if (next) {
9924
+ next.el = vnode.el;
9925
+ updateComponentPreRender(instance, next, optimized);
9926
+ }
9927
+ nonHydratedAsyncRoot.asyncDep.then(() => {
9928
+ if (!instance.isUnmounted) {
9929
+ componentUpdateFn();
9930
+ }
9931
+ });
9932
+ return;
9933
+ }
9934
+ }
9935
+ let originNext = next;
9936
+ let vnodeHook;
9937
+ {
9217
9938
  pushWarningContext(next || instance.vnode);
9218
9939
  }
9219
9940
  toggleRecurse(instance, false);
@@ -9574,8 +10295,8 @@ function baseCreateRenderer(options, createHydrationFns) {
9574
10295
  const nextChild = c2[nextIndex];
9575
10296
  const anchorVNode = c2[nextIndex + 1];
9576
10297
  const anchor = nextIndex + 1 < l2 ? (
9577
- // #13559, fallback to el placeholder for unresolved async component
9578
- anchorVNode.el || anchorVNode.placeholder
10298
+ // #13559, #14173 fallback to el placeholder for unresolved async component
10299
+ anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
9579
10300
  ) : parentAnchor;
9580
10301
  if (newIndexToOldIndexMap[i] === 0) {
9581
10302
  patch(
@@ -9840,815 +10561,169 @@ function baseCreateRenderer(options, createHydrationFns) {
9840
10561
  };
9841
10562
  let isFlushing = false;
9842
10563
  const render = (vnode, container, namespace) => {
10564
+ let instance;
9843
10565
  if (vnode == null) {
9844
10566
  if (container._vnode) {
9845
10567
  unmount(container._vnode, null, null, true);
10568
+ instance = container._vnode.component;
9846
10569
  }
9847
- } else {
9848
- patch(
9849
- container._vnode || null,
9850
- vnode,
9851
- container,
9852
- null,
9853
- null,
9854
- null,
9855
- namespace
9856
- );
9857
- }
9858
- container._vnode = vnode;
9859
- if (!isFlushing) {
9860
- isFlushing = true;
9861
- flushPreFlushCbs();
9862
- flushPostFlushCbs();
9863
- isFlushing = false;
9864
- }
9865
- };
9866
- const internals = {
9867
- p: patch,
9868
- um: unmount,
9869
- m: move,
9870
- r: remove,
9871
- mt: mountComponent,
9872
- mc: mountChildren,
9873
- pc: patchChildren,
9874
- pbc: patchBlockChildren,
9875
- n: getNextHostNode,
9876
- o: options
9877
- };
9878
- let hydrate;
9879
- let hydrateNode;
9880
- if (createHydrationFns) {
9881
- [hydrate, hydrateNode] = createHydrationFns(
9882
- internals
9883
- );
9884
- }
9885
- return {
9886
- render,
9887
- hydrate,
9888
- createApp: createAppAPI(render, hydrate)
9889
- };
9890
- }
9891
- function resolveChildrenNamespace({ type, props }, currentNamespace) {
9892
- return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
9893
- }
9894
- function toggleRecurse({ effect, job }, allowed) {
9895
- if (allowed) {
9896
- effect.flags |= 32;
9897
- job.flags |= 4;
9898
- } else {
9899
- effect.flags &= -33;
9900
- job.flags &= -5;
9901
- }
9902
- }
9903
- function needTransition(parentSuspense, transition) {
9904
- return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
9905
- }
9906
- function traverseStaticChildren(n1, n2, shallow = false) {
9907
- const ch1 = n1.children;
9908
- const ch2 = n2.children;
9909
- if (isArray(ch1) && isArray(ch2)) {
9910
- for (let i = 0; i < ch1.length; i++) {
9911
- const c1 = ch1[i];
9912
- let c2 = ch2[i];
9913
- if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
9914
- if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
9915
- c2 = ch2[i] = cloneIfMounted(ch2[i]);
9916
- c2.el = c1.el;
9917
- }
9918
- if (!shallow && c2.patchFlag !== -2)
9919
- traverseStaticChildren(c1, c2);
9920
- }
9921
- if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
9922
- c2.patchFlag !== -1) {
9923
- c2.el = c1.el;
9924
- }
9925
- if (c2.type === Comment && !c2.el) {
9926
- c2.el = c1.el;
9927
- }
9928
- {
9929
- c2.el && (c2.el.__vnode = c2);
9930
- }
9931
- }
9932
- }
9933
- }
9934
- function getSequence(arr) {
9935
- const p = arr.slice();
9936
- const result = [0];
9937
- let i, j, u, v, c;
9938
- const len = arr.length;
9939
- for (i = 0; i < len; i++) {
9940
- const arrI = arr[i];
9941
- if (arrI !== 0) {
9942
- j = result[result.length - 1];
9943
- if (arr[j] < arrI) {
9944
- p[i] = j;
9945
- result.push(i);
9946
- continue;
9947
- }
9948
- u = 0;
9949
- v = result.length - 1;
9950
- while (u < v) {
9951
- c = u + v >> 1;
9952
- if (arr[result[c]] < arrI) {
9953
- u = c + 1;
9954
- } else {
9955
- v = c;
9956
- }
9957
- }
9958
- if (arrI < arr[result[u]]) {
9959
- if (u > 0) {
9960
- p[i] = result[u - 1];
9961
- }
9962
- result[u] = i;
9963
- }
9964
- }
9965
- }
9966
- u = result.length;
9967
- v = result[u - 1];
9968
- while (u-- > 0) {
9969
- result[u] = v;
9970
- v = p[v];
9971
- }
9972
- return result;
9973
- }
9974
- function locateNonHydratedAsyncRoot(instance) {
9975
- const subComponent = instance.subTree.component;
9976
- if (subComponent) {
9977
- if (subComponent.asyncDep && !subComponent.asyncResolved) {
9978
- return subComponent;
9979
- } else {
9980
- return locateNonHydratedAsyncRoot(subComponent);
9981
- }
9982
- }
9983
- }
9984
- function invalidateMount(hooks) {
9985
- if (hooks) {
9986
- for (let i = 0; i < hooks.length; i++)
9987
- hooks[i].flags |= 8;
9988
- }
9989
- }
9990
-
9991
- const ssrContextKey = Symbol.for("v-scx");
9992
- const useSSRContext = () => {
9993
- {
9994
- const ctx = inject(ssrContextKey);
9995
- if (!ctx) {
9996
- warn$1(
9997
- `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
9998
- );
9999
- }
10000
- return ctx;
10001
- }
10002
- };
10003
-
10004
- function watchEffect(effect, options) {
10005
- return doWatch(effect, null, options);
10006
- }
10007
- function watchPostEffect(effect, options) {
10008
- return doWatch(
10009
- effect,
10010
- null,
10011
- extend({}, options, { flush: "post" })
10012
- );
10013
- }
10014
- function watchSyncEffect(effect, options) {
10015
- return doWatch(
10016
- effect,
10017
- null,
10018
- extend({}, options, { flush: "sync" })
10019
- );
10020
- }
10021
- function watch(source, cb, options) {
10022
- if (!isFunction(cb)) {
10023
- warn$1(
10024
- `\`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.`
10025
- );
10026
- }
10027
- return doWatch(source, cb, options);
10028
- }
10029
- function doWatch(source, cb, options = EMPTY_OBJ) {
10030
- const { immediate, deep, flush, once } = options;
10031
- if (!cb) {
10032
- if (immediate !== void 0) {
10033
- warn$1(
10034
- `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
10035
- );
10036
- }
10037
- if (deep !== void 0) {
10038
- warn$1(
10039
- `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
10040
- );
10041
- }
10042
- if (once !== void 0) {
10043
- warn$1(
10044
- `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
10045
- );
10046
- }
10047
- }
10048
- const baseWatchOptions = extend({}, options);
10049
- baseWatchOptions.onWarn = warn$1;
10050
- const runsImmediately = cb && immediate || !cb && flush !== "post";
10051
- let ssrCleanup;
10052
- if (isInSSRComponentSetup) {
10053
- if (flush === "sync") {
10054
- const ctx = useSSRContext();
10055
- ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
10056
- } else if (!runsImmediately) {
10057
- const watchStopHandle = () => {
10058
- };
10059
- watchStopHandle.stop = NOOP;
10060
- watchStopHandle.resume = NOOP;
10061
- watchStopHandle.pause = NOOP;
10062
- return watchStopHandle;
10063
- }
10064
- }
10065
- const instance = currentInstance;
10066
- baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
10067
- let isPre = false;
10068
- if (flush === "post") {
10069
- baseWatchOptions.scheduler = (job) => {
10070
- queuePostRenderEffect(job, instance && instance.suspense);
10071
- };
10072
- } else if (flush !== "sync") {
10073
- isPre = true;
10074
- baseWatchOptions.scheduler = (job, isFirstRun) => {
10075
- if (isFirstRun) {
10076
- job();
10077
- } else {
10078
- queueJob(job);
10079
- }
10080
- };
10081
- }
10082
- baseWatchOptions.augmentJob = (job) => {
10083
- if (cb) {
10084
- job.flags |= 4;
10085
- }
10086
- if (isPre) {
10087
- job.flags |= 2;
10088
- if (instance) {
10089
- job.id = instance.uid;
10090
- job.i = instance;
10091
- }
10092
- }
10093
- };
10094
- const watchHandle = watch$1(source, cb, baseWatchOptions);
10095
- if (isInSSRComponentSetup) {
10096
- if (ssrCleanup) {
10097
- ssrCleanup.push(watchHandle);
10098
- } else if (runsImmediately) {
10099
- watchHandle();
10100
- }
10101
- }
10102
- return watchHandle;
10103
- }
10104
- function instanceWatch(source, value, options) {
10105
- const publicThis = this.proxy;
10106
- const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
10107
- let cb;
10108
- if (isFunction(value)) {
10109
- cb = value;
10110
- } else {
10111
- cb = value.handler;
10112
- options = value;
10113
- }
10114
- const reset = setCurrentInstance(this);
10115
- const res = doWatch(getter, cb.bind(publicThis), options);
10116
- reset();
10117
- return res;
10118
- }
10119
- function createPathGetter(ctx, path) {
10120
- const segments = path.split(".");
10121
- return () => {
10122
- let cur = ctx;
10123
- for (let i = 0; i < segments.length && cur; i++) {
10124
- cur = cur[segments[i]];
10125
- }
10126
- return cur;
10127
- };
10128
- }
10129
-
10130
- function useModel(props, name, options = EMPTY_OBJ) {
10131
- const i = getCurrentInstance();
10132
- if (!i) {
10133
- warn$1(`useModel() called without active instance.`);
10134
- return ref();
10135
- }
10136
- const camelizedName = camelize(name);
10137
- if (!i.propsOptions[0][camelizedName]) {
10138
- warn$1(`useModel() called with prop "${name}" which is not declared.`);
10139
- return ref();
10140
- }
10141
- const hyphenatedName = hyphenate(name);
10142
- const modifiers = getModelModifiers(props, camelizedName);
10143
- const res = customRef((track, trigger) => {
10144
- let localValue;
10145
- let prevSetValue = EMPTY_OBJ;
10146
- let prevEmittedValue;
10147
- watchSyncEffect(() => {
10148
- const propValue = props[camelizedName];
10149
- if (hasChanged(localValue, propValue)) {
10150
- localValue = propValue;
10151
- trigger();
10152
- }
10153
- });
10154
- return {
10155
- get() {
10156
- track();
10157
- return options.get ? options.get(localValue) : localValue;
10158
- },
10159
- set(value) {
10160
- const emittedValue = options.set ? options.set(value) : value;
10161
- if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
10162
- return;
10163
- }
10164
- const rawProps = i.vnode.props;
10165
- if (!(rawProps && // check if parent has passed v-model
10166
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
10167
- localValue = value;
10168
- trigger();
10169
- }
10170
- i.emit(`update:${name}`, emittedValue);
10171
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
10172
- trigger();
10173
- }
10174
- prevSetValue = value;
10175
- prevEmittedValue = emittedValue;
10176
- }
10177
- };
10178
- });
10179
- res[Symbol.iterator] = () => {
10180
- let i2 = 0;
10181
- return {
10182
- next() {
10183
- if (i2 < 2) {
10184
- return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false };
10185
- } else {
10186
- return { done: true };
10187
- }
10188
- }
10189
- };
10190
- };
10191
- return res;
10192
- }
10193
- const getModelModifiers = (props, modelName) => {
10194
- return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
10195
- };
10196
-
10197
- function emit(instance, event, ...rawArgs) {
10198
- if (instance.isUnmounted) return;
10199
- const props = instance.vnode.props || EMPTY_OBJ;
10200
- {
10201
- const {
10202
- emitsOptions,
10203
- propsOptions: [propsOptions]
10204
- } = instance;
10205
- if (emitsOptions) {
10206
- if (!(event in emitsOptions) && !(event.startsWith("hook:") || event.startsWith(compatModelEventPrefix))) {
10207
- if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
10208
- warn$1(
10209
- `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
10210
- );
10211
- }
10212
- } else {
10213
- const validator = emitsOptions[event];
10214
- if (isFunction(validator)) {
10215
- const isValid = validator(...rawArgs);
10216
- if (!isValid) {
10217
- warn$1(
10218
- `Invalid event arguments: event validation failed for event "${event}".`
10219
- );
10220
- }
10221
- }
10222
- }
10223
- }
10224
- }
10225
- let args = rawArgs;
10226
- const isCompatModelListener = compatModelEventPrefix + event in props;
10227
- const isModelListener = isCompatModelListener || event.startsWith("update:");
10228
- const modifiers = isCompatModelListener ? props.modelModifiers : isModelListener && getModelModifiers(props, event.slice(7));
10229
- if (modifiers) {
10230
- if (modifiers.trim) {
10231
- args = rawArgs.map((a) => isString(a) ? a.trim() : a);
10232
- }
10233
- if (modifiers.number) {
10234
- args = rawArgs.map(looseToNumber);
10235
- }
10236
- }
10237
- {
10238
- devtoolsComponentEmit(instance, event, args);
10239
- }
10240
- {
10241
- const lowerCaseEvent = event.toLowerCase();
10242
- if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
10243
- warn$1(
10244
- `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
10245
- instance,
10246
- instance.type
10247
- )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
10248
- event
10249
- )}" instead of "${event}".`
10250
- );
10251
- }
10252
- }
10253
- let handlerName;
10254
- let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
10255
- props[handlerName = toHandlerKey(camelize(event))];
10256
- if (!handler && isModelListener) {
10257
- handler = props[handlerName = toHandlerKey(hyphenate(event))];
10258
- }
10259
- if (handler) {
10260
- callWithAsyncErrorHandling(
10261
- handler,
10262
- instance,
10263
- 6,
10264
- args
10265
- );
10266
- }
10267
- const onceHandler = props[handlerName + `Once`];
10268
- if (onceHandler) {
10269
- if (!instance.emitted) {
10270
- instance.emitted = {};
10271
- } else if (instance.emitted[handlerName]) {
10272
- return;
10273
- }
10274
- instance.emitted[handlerName] = true;
10275
- callWithAsyncErrorHandling(
10276
- onceHandler,
10277
- instance,
10278
- 6,
10279
- args
10280
- );
10281
- }
10282
- {
10283
- compatModelEmit(instance, event, args);
10284
- return emit$1(instance, event, args);
10285
- }
10286
- }
10287
- const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
10288
- function normalizeEmitsOptions(comp, appContext, asMixin = false) {
10289
- const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
10290
- const cached = cache.get(comp);
10291
- if (cached !== void 0) {
10292
- return cached;
10293
- }
10294
- const raw = comp.emits;
10295
- let normalized = {};
10296
- let hasExtends = false;
10297
- if (!isFunction(comp)) {
10298
- const extendEmits = (raw2) => {
10299
- const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
10300
- if (normalizedFromExtend) {
10301
- hasExtends = true;
10302
- extend(normalized, normalizedFromExtend);
10303
- }
10304
- };
10305
- if (!asMixin && appContext.mixins.length) {
10306
- appContext.mixins.forEach(extendEmits);
10307
- }
10308
- if (comp.extends) {
10309
- extendEmits(comp.extends);
10310
- }
10311
- if (comp.mixins) {
10312
- comp.mixins.forEach(extendEmits);
10313
- }
10314
- }
10315
- if (!raw && !hasExtends) {
10316
- if (isObject(comp)) {
10317
- cache.set(comp, null);
10318
- }
10319
- return null;
10320
- }
10321
- if (isArray(raw)) {
10322
- raw.forEach((key) => normalized[key] = null);
10323
- } else {
10324
- extend(normalized, raw);
10325
- }
10326
- if (isObject(comp)) {
10327
- cache.set(comp, normalized);
10328
- }
10329
- return normalized;
10330
- }
10331
- function isEmitListener(options, key) {
10332
- if (!options || !isOn(key)) {
10333
- return false;
10334
- }
10335
- if (key.startsWith(compatModelEventPrefix)) {
10336
- return true;
10337
- }
10338
- key = key.slice(2).replace(/Once$/, "");
10339
- return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
10340
- }
10341
-
10342
- let accessedAttrs = false;
10343
- function markAttrsAccessed() {
10344
- accessedAttrs = true;
10345
- }
10346
- function renderComponentRoot(instance) {
10347
- const {
10348
- type: Component,
10349
- vnode,
10350
- proxy,
10351
- withProxy,
10352
- propsOptions: [propsOptions],
10353
- slots,
10354
- attrs,
10355
- emit,
10356
- render,
10357
- renderCache,
10358
- props,
10359
- data,
10360
- setupState,
10361
- ctx,
10362
- inheritAttrs
10363
- } = instance;
10364
- const prev = setCurrentRenderingInstance(instance);
10365
- let result;
10366
- let fallthroughAttrs;
10367
- {
10368
- accessedAttrs = false;
10369
- }
10370
- try {
10371
- if (vnode.shapeFlag & 4) {
10372
- const proxyToUse = withProxy || proxy;
10373
- const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
10374
- get(target, key, receiver) {
10375
- warn$1(
10376
- `Property '${String(
10377
- key
10378
- )}' was accessed via 'this'. Avoid using 'this' in templates.`
10379
- );
10380
- return Reflect.get(target, key, receiver);
10381
- }
10382
- }) : proxyToUse;
10383
- result = normalizeVNode(
10384
- render.call(
10385
- thisProxy,
10386
- proxyToUse,
10387
- renderCache,
10388
- true ? shallowReadonly(props) : props,
10389
- setupState,
10390
- data,
10391
- ctx
10392
- )
10393
- );
10394
- fallthroughAttrs = attrs;
10395
- } else {
10396
- const render2 = Component;
10397
- if (attrs === props) {
10398
- markAttrsAccessed();
10399
- }
10400
- result = normalizeVNode(
10401
- render2.length > 1 ? render2(
10402
- true ? shallowReadonly(props) : props,
10403
- true ? {
10404
- get attrs() {
10405
- markAttrsAccessed();
10406
- return shallowReadonly(attrs);
10407
- },
10408
- slots,
10409
- emit
10410
- } : { attrs, slots, emit }
10411
- ) : render2(
10412
- true ? shallowReadonly(props) : props,
10413
- null
10414
- )
10415
- );
10416
- fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
10417
- }
10418
- } catch (err) {
10419
- blockStack.length = 0;
10420
- handleError(err, instance, 1);
10421
- result = createVNode(Comment);
10422
- }
10423
- let root = result;
10424
- let setRoot = void 0;
10425
- if (result.patchFlag > 0 && result.patchFlag & 2048) {
10426
- [root, setRoot] = getChildRoot(result);
10427
- }
10428
- if (fallthroughAttrs && inheritAttrs !== false) {
10429
- const keys = Object.keys(fallthroughAttrs);
10430
- const { shapeFlag } = root;
10431
- if (keys.length) {
10432
- if (shapeFlag & (1 | 6)) {
10433
- if (propsOptions && keys.some(isModelListener)) {
10434
- fallthroughAttrs = filterModelListeners(
10435
- fallthroughAttrs,
10436
- propsOptions
10437
- );
10438
- }
10439
- root = cloneVNode(root, fallthroughAttrs, false, true);
10440
- } else if (!accessedAttrs && root.type !== Comment) {
10441
- const allAttrs = Object.keys(attrs);
10442
- const eventAttrs = [];
10443
- const extraAttrs = [];
10444
- for (let i = 0, l = allAttrs.length; i < l; i++) {
10445
- const key = allAttrs[i];
10446
- if (isOn(key)) {
10447
- if (!isModelListener(key)) {
10448
- eventAttrs.push(key[2].toLowerCase() + key.slice(3));
10449
- }
10450
- } else {
10451
- extraAttrs.push(key);
10452
- }
10453
- }
10454
- if (extraAttrs.length) {
10455
- warn$1(
10456
- `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
10457
- );
10458
- }
10459
- if (eventAttrs.length) {
10460
- warn$1(
10461
- `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
10462
- );
10463
- }
10464
- }
10465
- }
10466
- }
10467
- if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE", instance) && vnode.shapeFlag & 4 && root.shapeFlag & (1 | 6)) {
10468
- const { class: cls, style } = vnode.props || {};
10469
- if (cls || style) {
10470
- if (inheritAttrs === false) {
10471
- warnDeprecation(
10472
- "INSTANCE_ATTRS_CLASS_STYLE",
10473
- instance,
10474
- getComponentName(instance.type)
10475
- );
10476
- }
10477
- root = cloneVNode(
10478
- root,
10479
- {
10480
- class: cls,
10481
- style
10482
- },
10483
- false,
10484
- true
10485
- );
10486
- }
10487
- }
10488
- if (vnode.dirs) {
10489
- if (!isElementRoot(root)) {
10490
- warn$1(
10491
- `Runtime directive used on component with non-element root node. The directives will not function as intended.`
10570
+ } else {
10571
+ patch(
10572
+ container._vnode || null,
10573
+ vnode,
10574
+ container,
10575
+ null,
10576
+ null,
10577
+ null,
10578
+ namespace
10492
10579
  );
10493
10580
  }
10494
- root = cloneVNode(root, null, false, true);
10495
- root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
10496
- }
10497
- if (vnode.transition) {
10498
- if (!isElementRoot(root)) {
10499
- warn$1(
10500
- `Component inside <Transition> renders non-element root node that cannot be animated.`
10501
- );
10581
+ container._vnode = vnode;
10582
+ if (!isFlushing) {
10583
+ isFlushing = true;
10584
+ flushPreFlushCbs(instance);
10585
+ flushPostFlushCbs();
10586
+ isFlushing = false;
10502
10587
  }
10503
- setTransitionHooks(root, vnode.transition);
10588
+ };
10589
+ const internals = {
10590
+ p: patch,
10591
+ um: unmount,
10592
+ m: move,
10593
+ r: remove,
10594
+ mt: mountComponent,
10595
+ mc: mountChildren,
10596
+ pc: patchChildren,
10597
+ pbc: patchBlockChildren,
10598
+ n: getNextHostNode,
10599
+ o: options
10600
+ };
10601
+ let hydrate;
10602
+ let hydrateNode;
10603
+ if (createHydrationFns) {
10604
+ [hydrate, hydrateNode] = createHydrationFns(
10605
+ internals
10606
+ );
10504
10607
  }
10505
- if (setRoot) {
10506
- setRoot(root);
10608
+ return {
10609
+ render,
10610
+ hydrate,
10611
+ createApp: createAppAPI(render, hydrate)
10612
+ };
10613
+ }
10614
+ function resolveChildrenNamespace({ type, props }, currentNamespace) {
10615
+ return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
10616
+ }
10617
+ function toggleRecurse({ effect, job }, allowed) {
10618
+ if (allowed) {
10619
+ effect.flags |= 32;
10620
+ job.flags |= 4;
10507
10621
  } else {
10508
- result = root;
10622
+ effect.flags &= -33;
10623
+ job.flags &= -5;
10509
10624
  }
10510
- setCurrentRenderingInstance(prev);
10511
- return result;
10512
10625
  }
10513
- const getChildRoot = (vnode) => {
10514
- const rawChildren = vnode.children;
10515
- const dynamicChildren = vnode.dynamicChildren;
10516
- const childRoot = filterSingleRoot(rawChildren, false);
10517
- if (!childRoot) {
10518
- return [vnode, void 0];
10519
- } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
10520
- return getChildRoot(childRoot);
10521
- }
10522
- const index = rawChildren.indexOf(childRoot);
10523
- const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
10524
- const setRoot = (updatedRoot) => {
10525
- rawChildren[index] = updatedRoot;
10526
- if (dynamicChildren) {
10527
- if (dynamicIndex > -1) {
10528
- dynamicChildren[dynamicIndex] = updatedRoot;
10529
- } else if (updatedRoot.patchFlag > 0) {
10530
- vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
10626
+ function needTransition(parentSuspense, transition) {
10627
+ return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
10628
+ }
10629
+ function traverseStaticChildren(n1, n2, shallow = false) {
10630
+ const ch1 = n1.children;
10631
+ const ch2 = n2.children;
10632
+ if (isArray(ch1) && isArray(ch2)) {
10633
+ for (let i = 0; i < ch1.length; i++) {
10634
+ const c1 = ch1[i];
10635
+ let c2 = ch2[i];
10636
+ if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
10637
+ if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
10638
+ c2 = ch2[i] = cloneIfMounted(ch2[i]);
10639
+ c2.el = c1.el;
10640
+ }
10641
+ if (!shallow && c2.patchFlag !== -2)
10642
+ traverseStaticChildren(c1, c2);
10531
10643
  }
10532
- }
10533
- };
10534
- return [normalizeVNode(childRoot), setRoot];
10535
- };
10536
- function filterSingleRoot(children, recurse = true) {
10537
- let singleRoot;
10538
- for (let i = 0; i < children.length; i++) {
10539
- const child = children[i];
10540
- if (isVNode(child)) {
10541
- if (child.type !== Comment || child.children === "v-if") {
10542
- if (singleRoot) {
10543
- return;
10644
+ if (c2.type === Text) {
10645
+ if (c2.patchFlag !== -1) {
10646
+ c2.el = c1.el;
10544
10647
  } else {
10545
- singleRoot = child;
10546
- if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
10547
- return filterSingleRoot(singleRoot.children);
10548
- }
10648
+ c2.__elIndex = i + // take fragment start anchor into account
10649
+ (n1.type === Fragment ? 1 : 0);
10549
10650
  }
10550
10651
  }
10551
- } else {
10552
- return;
10652
+ if (c2.type === Comment && !c2.el) {
10653
+ c2.el = c1.el;
10654
+ }
10655
+ {
10656
+ c2.el && (c2.el.__vnode = c2);
10657
+ }
10553
10658
  }
10554
10659
  }
10555
- return singleRoot;
10556
10660
  }
10557
- const getFunctionalFallthrough = (attrs) => {
10558
- let res;
10559
- for (const key in attrs) {
10560
- if (key === "class" || key === "style" || isOn(key)) {
10561
- (res || (res = {}))[key] = attrs[key];
10562
- }
10563
- }
10564
- return res;
10565
- };
10566
- const filterModelListeners = (attrs, props) => {
10567
- const res = {};
10568
- for (const key in attrs) {
10569
- if (!isModelListener(key) || !(key.slice(9) in props)) {
10570
- res[key] = attrs[key];
10571
- }
10572
- }
10573
- return res;
10574
- };
10575
- const isElementRoot = (vnode) => {
10576
- return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
10577
- };
10578
- function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
10579
- const { props: prevProps, children: prevChildren, component } = prevVNode;
10580
- const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
10581
- const emits = component.emitsOptions;
10582
- if ((prevChildren || nextChildren) && isHmrUpdating) {
10583
- return true;
10584
- }
10585
- if (nextVNode.dirs || nextVNode.transition) {
10586
- return true;
10587
- }
10588
- if (optimized && patchFlag >= 0) {
10589
- if (patchFlag & 1024) {
10590
- return true;
10591
- }
10592
- if (patchFlag & 16) {
10593
- if (!prevProps) {
10594
- return !!nextProps;
10661
+ function getSequence(arr) {
10662
+ const p = arr.slice();
10663
+ const result = [0];
10664
+ let i, j, u, v, c;
10665
+ const len = arr.length;
10666
+ for (i = 0; i < len; i++) {
10667
+ const arrI = arr[i];
10668
+ if (arrI !== 0) {
10669
+ j = result[result.length - 1];
10670
+ if (arr[j] < arrI) {
10671
+ p[i] = j;
10672
+ result.push(i);
10673
+ continue;
10595
10674
  }
10596
- return hasPropsChanged(prevProps, nextProps, emits);
10597
- } else if (patchFlag & 8) {
10598
- const dynamicProps = nextVNode.dynamicProps;
10599
- for (let i = 0; i < dynamicProps.length; i++) {
10600
- const key = dynamicProps[i];
10601
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
10602
- return true;
10675
+ u = 0;
10676
+ v = result.length - 1;
10677
+ while (u < v) {
10678
+ c = u + v >> 1;
10679
+ if (arr[result[c]] < arrI) {
10680
+ u = c + 1;
10681
+ } else {
10682
+ v = c;
10603
10683
  }
10604
10684
  }
10605
- }
10606
- } else {
10607
- if (prevChildren || nextChildren) {
10608
- if (!nextChildren || !nextChildren.$stable) {
10609
- return true;
10685
+ if (arrI < arr[result[u]]) {
10686
+ if (u > 0) {
10687
+ p[i] = result[u - 1];
10688
+ }
10689
+ result[u] = i;
10610
10690
  }
10611
10691
  }
10612
- if (prevProps === nextProps) {
10613
- return false;
10614
- }
10615
- if (!prevProps) {
10616
- return !!nextProps;
10617
- }
10618
- if (!nextProps) {
10619
- return true;
10620
- }
10621
- return hasPropsChanged(prevProps, nextProps, emits);
10622
- }
10623
- return false;
10624
- }
10625
- function hasPropsChanged(prevProps, nextProps, emitsOptions) {
10626
- const nextKeys = Object.keys(nextProps);
10627
- if (nextKeys.length !== Object.keys(prevProps).length) {
10628
- return true;
10629
10692
  }
10630
- for (let i = 0; i < nextKeys.length; i++) {
10631
- const key = nextKeys[i];
10632
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
10633
- return true;
10634
- }
10693
+ u = result.length;
10694
+ v = result[u - 1];
10695
+ while (u-- > 0) {
10696
+ result[u] = v;
10697
+ v = p[v];
10635
10698
  }
10636
- return false;
10699
+ return result;
10637
10700
  }
10638
- function updateHOCHostEl({ vnode, parent }, el) {
10639
- while (parent) {
10640
- const root = parent.subTree;
10641
- if (root.suspense && root.suspense.activeBranch === vnode) {
10642
- root.el = vnode.el;
10643
- }
10644
- if (root === vnode) {
10645
- (vnode = parent.vnode).el = el;
10646
- parent = parent.parent;
10701
+ function locateNonHydratedAsyncRoot(instance) {
10702
+ const subComponent = instance.subTree.component;
10703
+ if (subComponent) {
10704
+ if (subComponent.asyncDep && !subComponent.asyncResolved) {
10705
+ return subComponent;
10647
10706
  } else {
10648
- break;
10707
+ return locateNonHydratedAsyncRoot(subComponent);
10649
10708
  }
10650
10709
  }
10651
10710
  }
10711
+ function invalidateMount(hooks) {
10712
+ if (hooks) {
10713
+ for (let i = 0; i < hooks.length; i++)
10714
+ hooks[i].flags |= 8;
10715
+ }
10716
+ }
10717
+ function resolveAsyncComponentPlaceholder(anchorVnode) {
10718
+ if (anchorVnode.placeholder) {
10719
+ return anchorVnode.placeholder;
10720
+ }
10721
+ const instance = anchorVnode.component;
10722
+ if (instance) {
10723
+ return resolveAsyncComponentPlaceholder(instance.subTree);
10724
+ }
10725
+ return null;
10726
+ }
10652
10727
 
10653
10728
  const isSuspense = (type) => type.__isSuspense;
10654
10729
  let suspenseId = 0;
@@ -11003,7 +11078,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11003
11078
  }
11004
11079
  unmount(activeBranch, parentComponent2, suspense, true);
11005
11080
  if (!delayEnter && isInFallback && vnode2.ssFallback) {
11006
- vnode2.ssFallback.el = null;
11081
+ queuePostRenderEffect(() => vnode2.ssFallback.el = null, suspense);
11007
11082
  }
11008
11083
  }
11009
11084
  if (!delayEnter) {
@@ -11308,10 +11383,10 @@ function convertLegacyComponent(comp, instance) {
11308
11383
  return comp;
11309
11384
  }
11310
11385
 
11311
- const Fragment = Symbol.for("v-fgt");
11312
- const Text = Symbol.for("v-txt");
11313
- const Comment = Symbol.for("v-cmt");
11314
- const Static = Symbol.for("v-stc");
11386
+ const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
11387
+ const Text = /* @__PURE__ */ Symbol.for("v-txt");
11388
+ const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
11389
+ const Static = /* @__PURE__ */ Symbol.for("v-stc");
11315
11390
  const blockStack = [];
11316
11391
  let currentBlock = null;
11317
11392
  function openBlock(disableTracking = false) {
@@ -11847,7 +11922,6 @@ function setupComponent(instance, isSSR = false, optimized = false) {
11847
11922
  return setupResult;
11848
11923
  }
11849
11924
  function setupStatefulComponent(instance, isSSR) {
11850
- var _a;
11851
11925
  const Component = instance.type;
11852
11926
  {
11853
11927
  if (Component.name) {
@@ -11907,7 +11981,7 @@ function setupStatefulComponent(instance, isSSR) {
11907
11981
  } else {
11908
11982
  instance.asyncDep = setupResult;
11909
11983
  if (!instance.suspense) {
11910
- const name = (_a = Component.name) != null ? _a : "Anonymous";
11984
+ const name = formatComponentName(instance, Component);
11911
11985
  warn$1(
11912
11986
  `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`
11913
11987
  );
@@ -12117,7 +12191,7 @@ function formatComponentName(instance, Component, isRoot = false) {
12117
12191
  name = match[1];
12118
12192
  }
12119
12193
  }
12120
- if (!name && instance && instance.parent) {
12194
+ if (!name && instance) {
12121
12195
  const inferFromRegistry = (registry) => {
12122
12196
  for (const key in registry) {
12123
12197
  if (registry[key] === Component) {
@@ -12125,8 +12199,8 @@ function formatComponentName(instance, Component, isRoot = false) {
12125
12199
  }
12126
12200
  }
12127
12201
  };
12128
- name = inferFromRegistry(
12129
- instance.components || instance.parent.type.components
12202
+ name = inferFromRegistry(instance.components) || instance.parent && inferFromRegistry(
12203
+ instance.parent.type.components
12130
12204
  ) || inferFromRegistry(instance.appContext.components);
12131
12205
  }
12132
12206
  return name ? classify(name) : isRoot ? `App` : `Anonymous`;
@@ -12378,7 +12452,7 @@ function isMemoSame(cached, memo) {
12378
12452
  return true;
12379
12453
  }
12380
12454
 
12381
- const version = "3.5.24";
12455
+ const version = "3.5.26";
12382
12456
  const warn = warn$1 ;
12383
12457
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12384
12458
  const devtools = devtools$1 ;
@@ -12490,7 +12564,7 @@ const nodeOps = {
12490
12564
 
12491
12565
  const TRANSITION = "transition";
12492
12566
  const ANIMATION = "animation";
12493
- const vtcKey = Symbol("_vtc");
12567
+ const vtcKey = /* @__PURE__ */ Symbol("_vtc");
12494
12568
  const DOMTransitionPropsValidators = {
12495
12569
  name: String,
12496
12570
  type: String,
@@ -12820,8 +12894,8 @@ function patchClass(el, value, isSVG) {
12820
12894
  }
12821
12895
  }
12822
12896
 
12823
- const vShowOriginalDisplay = Symbol("_vod");
12824
- const vShowHidden = Symbol("_vsh");
12897
+ const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
12898
+ const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
12825
12899
  const vShow = {
12826
12900
  // used for prop mismatch check during hydration
12827
12901
  name: "show",
@@ -12870,7 +12944,7 @@ function initVShowForSSR() {
12870
12944
  };
12871
12945
  }
12872
12946
 
12873
- const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
12947
+ const CSS_VAR_TEXT = /* @__PURE__ */ Symbol("CSS_VAR_TEXT" );
12874
12948
  function useCssVars(getter) {
12875
12949
  const instance = getCurrentInstance();
12876
12950
  if (!instance) {
@@ -13068,7 +13142,7 @@ function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBoolean
13068
13142
  const isEnumeratedAttr = /* @__PURE__ */ makeMap("contenteditable,draggable,spellcheck") ;
13069
13143
  function compatCoerceAttr(el, key, value, instance = null) {
13070
13144
  if (isEnumeratedAttr(key)) {
13071
- const v2CoercedValue = value === null ? "false" : typeof value !== "boolean" && value !== void 0 ? "true" : null;
13145
+ const v2CoercedValue = value === void 0 ? null : value === null || value === false || value === "false" ? "false" : "true";
13072
13146
  if (v2CoercedValue && compatUtils.softAssertCompatEnabled(
13073
13147
  "ATTR_ENUMERATED_COERCION",
13074
13148
  instance,
@@ -13164,7 +13238,7 @@ function addEventListener(el, event, handler, options) {
13164
13238
  function removeEventListener(el, event, handler, options) {
13165
13239
  el.removeEventListener(event, handler, options);
13166
13240
  }
13167
- const veiKey = Symbol("_vei");
13241
+ const veiKey = /* @__PURE__ */ Symbol("_vei");
13168
13242
  function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
13169
13243
  const invokers = el[veiKey] || (el[veiKey] = {});
13170
13244
  const existingInvoker = invokers[rawName];
@@ -13802,8 +13876,8 @@ function useCssModule(name = "$style") {
13802
13876
 
13803
13877
  const positionMap = /* @__PURE__ */ new WeakMap();
13804
13878
  const newPositionMap = /* @__PURE__ */ new WeakMap();
13805
- const moveCbKey = Symbol("_moveCb");
13806
- const enterCbKey = Symbol("_enterCb");
13879
+ const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
13880
+ const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
13807
13881
  const decorate = (t) => {
13808
13882
  delete t.props.mode;
13809
13883
  {
@@ -13965,7 +14039,7 @@ function onCompositionEnd(e) {
13965
14039
  target.dispatchEvent(new Event("input"));
13966
14040
  }
13967
14041
  }
13968
- const assignKey = Symbol("_assign");
14042
+ const assignKey = /* @__PURE__ */ Symbol("_assign");
13969
14043
  function castValue(value, trim, number) {
13970
14044
  if (trim) value = value.trim();
13971
14045
  if (number) value = looseToNumber(value);
@@ -14539,6 +14613,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
14539
14613
  mergeModels: mergeModels,
14540
14614
  mergeProps: mergeProps,
14541
14615
  nextTick: nextTick,
14616
+ nodeOps: nodeOps,
14542
14617
  normalizeClass: normalizeClass,
14543
14618
  normalizeProps: normalizeProps,
14544
14619
  normalizeStyle: normalizeStyle,
@@ -14557,6 +14632,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
14557
14632
  onUpdated: onUpdated,
14558
14633
  onWatcherCleanup: onWatcherCleanup,
14559
14634
  openBlock: openBlock,
14635
+ patchProp: patchProp,
14560
14636
  popScopeId: popScopeId,
14561
14637
  provide: provide,
14562
14638
  proxyRefs: proxyRefs,
@@ -14669,4 +14745,4 @@ Vue.compile = (() => {
14669
14745
 
14670
14746
  const configureCompat = Vue.configureCompat;
14671
14747
 
14672
- export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getCurrentWatcher, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useHost, useId, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
14748
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getCurrentWatcher, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, nodeOps, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, patchProp, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useHost, useId, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };