@vue/compat 3.3.0-alpha.8 → 3.3.0-beta.1

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.
@@ -97,7 +97,7 @@ const getGlobalThis = () => {
97
97
  return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
98
98
  };
99
99
 
100
- const GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt";
100
+ const GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
101
101
  const isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
102
102
 
103
103
  function normalizeStyle(value) {
@@ -1856,6 +1856,8 @@ function reload(id, newComp) {
1856
1856
  }
1857
1857
  hmrDirtyComponents.add(oldComp);
1858
1858
  }
1859
+ instance.appContext.propsCache.delete(instance.type);
1860
+ instance.appContext.emitsCache.delete(instance.type);
1859
1861
  instance.appContext.optionsCache.delete(instance.type);
1860
1862
  if (instance.ceReload) {
1861
1863
  hmrDirtyComponents.add(oldComp);
@@ -3171,7 +3173,8 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3171
3173
  }
3172
3174
  }
3173
3175
  let hasWarned = false;
3174
- function createSuspenseBoundary(vnode, parent, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3176
+ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3177
+ var _a;
3175
3178
  if (!hasWarned) {
3176
3179
  hasWarned = true;
3177
3180
  console[console.info ? "info" : "log"](
@@ -3185,13 +3188,21 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
3185
3188
  n: next,
3186
3189
  o: { parentNode, remove }
3187
3190
  } = rendererInternals;
3191
+ let parentSuspenseId;
3192
+ const isSuspensible = ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
3193
+ if (isSuspensible) {
3194
+ if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
3195
+ parentSuspenseId = parentSuspense == null ? void 0 : parentSuspense.pendingId;
3196
+ parentSuspense.deps++;
3197
+ }
3198
+ }
3188
3199
  const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
3189
3200
  {
3190
3201
  assertNumber(timeout, `Suspense timeout`);
3191
3202
  }
3192
3203
  const suspense = {
3193
3204
  vnode,
3194
- parent,
3205
+ parent: parentSuspense,
3195
3206
  parentComponent,
3196
3207
  isSVG,
3197
3208
  container,
@@ -3251,20 +3262,28 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
3251
3262
  setActiveBranch(suspense, pendingBranch);
3252
3263
  suspense.pendingBranch = null;
3253
3264
  suspense.isInFallback = false;
3254
- let parent2 = suspense.parent;
3265
+ let parent = suspense.parent;
3255
3266
  let hasUnresolvedAncestor = false;
3256
- while (parent2) {
3257
- if (parent2.pendingBranch) {
3258
- parent2.effects.push(...effects);
3267
+ while (parent) {
3268
+ if (parent.pendingBranch) {
3269
+ parent.effects.push(...effects);
3259
3270
  hasUnresolvedAncestor = true;
3260
3271
  break;
3261
3272
  }
3262
- parent2 = parent2.parent;
3273
+ parent = parent.parent;
3263
3274
  }
3264
3275
  if (!hasUnresolvedAncestor) {
3265
3276
  queuePostFlushCb(effects);
3266
3277
  }
3267
3278
  suspense.effects = [];
3279
+ if (isSuspensible) {
3280
+ if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
3281
+ parentSuspense.deps--;
3282
+ if (parentSuspense.deps === 0) {
3283
+ parentSuspense.resolve();
3284
+ }
3285
+ }
3286
+ }
3268
3287
  triggerEvent(vnode2, "onResolve");
3269
3288
  },
3270
3289
  fallback(fallbackVNode) {
@@ -3364,13 +3383,13 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
3364
3383
  }
3365
3384
  });
3366
3385
  },
3367
- unmount(parentSuspense, doRemove) {
3386
+ unmount(parentSuspense2, doRemove) {
3368
3387
  suspense.isUnmounted = true;
3369
3388
  if (suspense.activeBranch) {
3370
3389
  unmount(
3371
3390
  suspense.activeBranch,
3372
3391
  parentComponent,
3373
- parentSuspense,
3392
+ parentSuspense2,
3374
3393
  doRemove
3375
3394
  );
3376
3395
  }
@@ -3378,7 +3397,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
3378
3397
  unmount(
3379
3398
  suspense.pendingBranch,
3380
3399
  parentComponent,
3381
- parentSuspense,
3400
+ parentSuspense2,
3382
3401
  doRemove
3383
3402
  );
3384
3403
  }
@@ -3471,33 +3490,41 @@ function setActiveBranch(suspense, branch) {
3471
3490
  }
3472
3491
  }
3473
3492
 
3474
- function provide(key, value) {
3475
- if (!currentInstance) {
3476
- {
3477
- warn(`provide() can only be used inside setup().`);
3478
- }
3479
- } else {
3480
- let provides = currentInstance.provides;
3481
- const parentProvides = currentInstance.parent && currentInstance.parent.provides;
3482
- if (parentProvides === provides) {
3483
- provides = currentInstance.provides = Object.create(parentProvides);
3484
- }
3485
- provides[key] = value;
3486
- }
3487
- }
3488
- function inject(key, defaultValue, treatDefaultAsFactory = false) {
3489
- const instance = currentInstance || currentRenderingInstance;
3490
- if (instance) {
3491
- const provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides;
3492
- if (provides && key in provides) {
3493
- return provides[key];
3494
- } else if (arguments.length > 1) {
3495
- return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance.proxy) : defaultValue;
3493
+ const legacyDirectiveHookMap = {
3494
+ beforeMount: "bind",
3495
+ mounted: "inserted",
3496
+ updated: ["update", "componentUpdated"],
3497
+ unmounted: "unbind"
3498
+ };
3499
+ function mapCompatDirectiveHook(name, dir, instance) {
3500
+ const mappedName = legacyDirectiveHookMap[name];
3501
+ if (mappedName) {
3502
+ if (isArray(mappedName)) {
3503
+ const hook = [];
3504
+ mappedName.forEach((mapped) => {
3505
+ const mappedHook = dir[mapped];
3506
+ if (mappedHook) {
3507
+ softAssertCompatEnabled(
3508
+ "CUSTOM_DIR",
3509
+ instance,
3510
+ mapped,
3511
+ name
3512
+ );
3513
+ hook.push(mappedHook);
3514
+ }
3515
+ });
3516
+ return hook.length ? hook : void 0;
3496
3517
  } else {
3497
- warn(`injection "${String(key)}" not found.`);
3518
+ if (dir[mappedName]) {
3519
+ softAssertCompatEnabled(
3520
+ "CUSTOM_DIR",
3521
+ instance,
3522
+ mappedName,
3523
+ name
3524
+ );
3525
+ }
3526
+ return dir[mappedName];
3498
3527
  }
3499
- } else {
3500
- warn(`inject() can only be used inside setup() or functional components.`);
3501
3528
  }
3502
3529
  }
3503
3530
 
@@ -3736,6 +3763,68 @@ function traverse(value, seen) {
3736
3763
  return value;
3737
3764
  }
3738
3765
 
3766
+ function validateDirectiveName(name) {
3767
+ if (isBuiltInDirective(name)) {
3768
+ warn("Do not use built-in directive ids as custom directive id: " + name);
3769
+ }
3770
+ }
3771
+ function withDirectives(vnode, directives) {
3772
+ const internalInstance = currentRenderingInstance;
3773
+ if (internalInstance === null) {
3774
+ warn(`withDirectives can only be used inside render functions.`);
3775
+ return vnode;
3776
+ }
3777
+ const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
3778
+ const bindings = vnode.dirs || (vnode.dirs = []);
3779
+ for (let i = 0; i < directives.length; i++) {
3780
+ let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
3781
+ if (dir) {
3782
+ if (isFunction(dir)) {
3783
+ dir = {
3784
+ mounted: dir,
3785
+ updated: dir
3786
+ };
3787
+ }
3788
+ if (dir.deep) {
3789
+ traverse(value);
3790
+ }
3791
+ bindings.push({
3792
+ dir,
3793
+ instance,
3794
+ value,
3795
+ oldValue: void 0,
3796
+ arg,
3797
+ modifiers
3798
+ });
3799
+ }
3800
+ }
3801
+ return vnode;
3802
+ }
3803
+ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3804
+ const bindings = vnode.dirs;
3805
+ const oldBindings = prevVNode && prevVNode.dirs;
3806
+ for (let i = 0; i < bindings.length; i++) {
3807
+ const binding = bindings[i];
3808
+ if (oldBindings) {
3809
+ binding.oldValue = oldBindings[i].value;
3810
+ }
3811
+ let hook = binding.dir[name];
3812
+ if (!hook) {
3813
+ hook = mapCompatDirectiveHook(name, binding.dir, instance);
3814
+ }
3815
+ if (hook) {
3816
+ pauseTracking();
3817
+ callWithAsyncErrorHandling(hook, instance, 8, [
3818
+ vnode.el,
3819
+ binding,
3820
+ vnode,
3821
+ prevVNode
3822
+ ]);
3823
+ resetTracking();
3824
+ }
3825
+ }
3826
+ }
3827
+
3739
3828
  function useTransitionState() {
3740
3829
  const state = {
3741
3830
  isMounted: false,
@@ -4534,106 +4623,6 @@ function getCompatListeners(instance) {
4534
4623
  return listeners;
4535
4624
  }
4536
4625
 
4537
- const legacyDirectiveHookMap = {
4538
- beforeMount: "bind",
4539
- mounted: "inserted",
4540
- updated: ["update", "componentUpdated"],
4541
- unmounted: "unbind"
4542
- };
4543
- function mapCompatDirectiveHook(name, dir, instance) {
4544
- const mappedName = legacyDirectiveHookMap[name];
4545
- if (mappedName) {
4546
- if (isArray(mappedName)) {
4547
- const hook = [];
4548
- mappedName.forEach((mapped) => {
4549
- const mappedHook = dir[mapped];
4550
- if (mappedHook) {
4551
- softAssertCompatEnabled(
4552
- "CUSTOM_DIR",
4553
- instance,
4554
- mapped,
4555
- name
4556
- );
4557
- hook.push(mappedHook);
4558
- }
4559
- });
4560
- return hook.length ? hook : void 0;
4561
- } else {
4562
- if (dir[mappedName]) {
4563
- softAssertCompatEnabled(
4564
- "CUSTOM_DIR",
4565
- instance,
4566
- mappedName,
4567
- name
4568
- );
4569
- }
4570
- return dir[mappedName];
4571
- }
4572
- }
4573
- }
4574
-
4575
- function validateDirectiveName(name) {
4576
- if (isBuiltInDirective(name)) {
4577
- warn("Do not use built-in directive ids as custom directive id: " + name);
4578
- }
4579
- }
4580
- function withDirectives(vnode, directives) {
4581
- const internalInstance = currentRenderingInstance;
4582
- if (internalInstance === null) {
4583
- warn(`withDirectives can only be used inside render functions.`);
4584
- return vnode;
4585
- }
4586
- const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
4587
- const bindings = vnode.dirs || (vnode.dirs = []);
4588
- for (let i = 0; i < directives.length; i++) {
4589
- let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
4590
- if (dir) {
4591
- if (isFunction(dir)) {
4592
- dir = {
4593
- mounted: dir,
4594
- updated: dir
4595
- };
4596
- }
4597
- if (dir.deep) {
4598
- traverse(value);
4599
- }
4600
- bindings.push({
4601
- dir,
4602
- instance,
4603
- value,
4604
- oldValue: void 0,
4605
- arg,
4606
- modifiers
4607
- });
4608
- }
4609
- }
4610
- return vnode;
4611
- }
4612
- function invokeDirectiveHook(vnode, prevVNode, instance, name) {
4613
- const bindings = vnode.dirs;
4614
- const oldBindings = prevVNode && prevVNode.dirs;
4615
- for (let i = 0; i < bindings.length; i++) {
4616
- const binding = bindings[i];
4617
- if (oldBindings) {
4618
- binding.oldValue = oldBindings[i].value;
4619
- }
4620
- let hook = binding.dir[name];
4621
- if (!hook) {
4622
- hook = mapCompatDirectiveHook(name, binding.dir, instance);
4623
- }
4624
- if (hook) {
4625
- pauseTracking();
4626
- callWithAsyncErrorHandling(hook, instance, 8, [
4627
- vnode.el,
4628
- binding,
4629
- vnode,
4630
- prevVNode
4631
- ]);
4632
- resetTracking();
4633
- }
4634
- }
4635
- }
4636
-
4637
4626
  const COMPONENTS = "components";
4638
4627
  const DIRECTIVES = "directives";
4639
4628
  const FILTERS = "filters";
@@ -5349,6 +5338,8 @@ const PublicInstanceProxyHandlers = {
5349
5338
  if (key === "$attrs") {
5350
5339
  track(instance, "get", key);
5351
5340
  markAttrsAccessed();
5341
+ } else if (key === "$slots") {
5342
+ track(instance, "get", key);
5352
5343
  }
5353
5344
  return publicGetter(instance);
5354
5345
  } else if (
@@ -5538,24 +5529,179 @@ function deepMergeData(to, from) {
5538
5529
  return to;
5539
5530
  }
5540
5531
 
5541
- function createDuplicateChecker() {
5542
- const cache = /* @__PURE__ */ Object.create(null);
5543
- return (type, key) => {
5544
- if (cache[key]) {
5545
- warn(`${type} property "${key}" is already defined in ${cache[key]}.`);
5546
- } else {
5547
- cache[key] = type;
5548
- }
5549
- };
5532
+ const warnRuntimeUsage = (method) => warn(
5533
+ `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`
5534
+ );
5535
+ function defineProps() {
5536
+ {
5537
+ warnRuntimeUsage(`defineProps`);
5538
+ }
5539
+ return null;
5550
5540
  }
5551
- let shouldCacheAccess = true;
5552
- function applyOptions(instance) {
5553
- const options = resolveMergedOptions(instance);
5554
- const publicThis = instance.proxy;
5555
- const ctx = instance.ctx;
5556
- shouldCacheAccess = false;
5557
- if (options.beforeCreate) {
5558
- callHook$1(options.beforeCreate, instance, "bc");
5541
+ function defineEmits() {
5542
+ {
5543
+ warnRuntimeUsage(`defineEmits`);
5544
+ }
5545
+ return null;
5546
+ }
5547
+ function defineExpose(exposed) {
5548
+ {
5549
+ warnRuntimeUsage(`defineExpose`);
5550
+ }
5551
+ }
5552
+ function defineOptions(options) {
5553
+ {
5554
+ warnRuntimeUsage(`defineOptions`);
5555
+ }
5556
+ }
5557
+ function defineSlots() {
5558
+ {
5559
+ warnRuntimeUsage(`defineSlots`);
5560
+ }
5561
+ return null;
5562
+ }
5563
+ function defineModel() {
5564
+ {
5565
+ warnRuntimeUsage("defineModel");
5566
+ }
5567
+ }
5568
+ function withDefaults(props, defaults) {
5569
+ {
5570
+ warnRuntimeUsage(`withDefaults`);
5571
+ }
5572
+ return null;
5573
+ }
5574
+ function useSlots() {
5575
+ return getContext().slots;
5576
+ }
5577
+ function useAttrs() {
5578
+ return getContext().attrs;
5579
+ }
5580
+ function useModel(props, name, options) {
5581
+ const i = getCurrentInstance();
5582
+ if (!i) {
5583
+ warn(`useModel() called without active instance.`);
5584
+ return ref();
5585
+ }
5586
+ if (!i.propsOptions[0][name]) {
5587
+ warn(`useModel() called with prop "${name}" which is not declared.`);
5588
+ return ref();
5589
+ }
5590
+ if (options && options.local) {
5591
+ const proxy = ref(props[name]);
5592
+ watch(
5593
+ () => props[name],
5594
+ (v) => proxy.value = v
5595
+ );
5596
+ watch(proxy, (value) => {
5597
+ if (value !== props[name]) {
5598
+ i.emit(`update:${name}`, value);
5599
+ }
5600
+ });
5601
+ return proxy;
5602
+ } else {
5603
+ return {
5604
+ __v_isRef: true,
5605
+ get value() {
5606
+ return props[name];
5607
+ },
5608
+ set value(value) {
5609
+ i.emit(`update:${name}`, value);
5610
+ }
5611
+ };
5612
+ }
5613
+ }
5614
+ function getContext() {
5615
+ const i = getCurrentInstance();
5616
+ if (!i) {
5617
+ warn(`useContext() called without active instance.`);
5618
+ }
5619
+ return i.setupContext || (i.setupContext = createSetupContext(i));
5620
+ }
5621
+ function normalizePropsOrEmits(props) {
5622
+ return isArray(props) ? props.reduce(
5623
+ (normalized, p) => (normalized[p] = null, normalized),
5624
+ {}
5625
+ ) : props;
5626
+ }
5627
+ function mergeDefaults(raw, defaults) {
5628
+ const props = normalizePropsOrEmits(raw);
5629
+ for (const key in defaults) {
5630
+ if (key.startsWith("__skip"))
5631
+ continue;
5632
+ let opt = props[key];
5633
+ if (opt) {
5634
+ if (isArray(opt) || isFunction(opt)) {
5635
+ opt = props[key] = { type: opt, default: defaults[key] };
5636
+ } else {
5637
+ opt.default = defaults[key];
5638
+ }
5639
+ } else if (opt === null) {
5640
+ opt = props[key] = { default: defaults[key] };
5641
+ } else {
5642
+ warn(`props default key "${key}" has no corresponding declaration.`);
5643
+ }
5644
+ if (opt && defaults[`__skip_${key}`]) {
5645
+ opt.skipFactory = true;
5646
+ }
5647
+ }
5648
+ return props;
5649
+ }
5650
+ function mergeModels(a, b) {
5651
+ if (!a || !b)
5652
+ return a || b;
5653
+ if (isArray(a) && isArray(b))
5654
+ return a.concat(b);
5655
+ return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
5656
+ }
5657
+ function createPropsRestProxy(props, excludedKeys) {
5658
+ const ret = {};
5659
+ for (const key in props) {
5660
+ if (!excludedKeys.includes(key)) {
5661
+ Object.defineProperty(ret, key, {
5662
+ enumerable: true,
5663
+ get: () => props[key]
5664
+ });
5665
+ }
5666
+ }
5667
+ return ret;
5668
+ }
5669
+ function withAsyncContext(getAwaitable) {
5670
+ const ctx = getCurrentInstance();
5671
+ if (!ctx) {
5672
+ warn(
5673
+ `withAsyncContext called without active current instance. This is likely a bug.`
5674
+ );
5675
+ }
5676
+ let awaitable = getAwaitable();
5677
+ unsetCurrentInstance();
5678
+ if (isPromise(awaitable)) {
5679
+ awaitable = awaitable.catch((e) => {
5680
+ setCurrentInstance(ctx);
5681
+ throw e;
5682
+ });
5683
+ }
5684
+ return [awaitable, () => setCurrentInstance(ctx)];
5685
+ }
5686
+
5687
+ function createDuplicateChecker() {
5688
+ const cache = /* @__PURE__ */ Object.create(null);
5689
+ return (type, key) => {
5690
+ if (cache[key]) {
5691
+ warn(`${type} property "${key}" is already defined in ${cache[key]}.`);
5692
+ } else {
5693
+ cache[key] = type;
5694
+ }
5695
+ };
5696
+ }
5697
+ let shouldCacheAccess = true;
5698
+ function applyOptions(instance) {
5699
+ const options = resolveMergedOptions(instance);
5700
+ const publicThis = instance.proxy;
5701
+ const ctx = instance.ctx;
5702
+ shouldCacheAccess = false;
5703
+ if (options.beforeCreate) {
5704
+ callHook$1(options.beforeCreate, instance, "bc");
5559
5705
  }
5560
5706
  const {
5561
5707
  // state
@@ -5600,12 +5746,7 @@ function applyOptions(instance) {
5600
5746
  }
5601
5747
  }
5602
5748
  if (injectOptions) {
5603
- resolveInjections(
5604
- injectOptions,
5605
- ctx,
5606
- checkDuplicateProperties,
5607
- instance.appContext.config.unwrapInjectedRef
5608
- );
5749
+ resolveInjections(injectOptions, ctx, checkDuplicateProperties);
5609
5750
  }
5610
5751
  if (methods) {
5611
5752
  for (const key in methods) {
@@ -5756,7 +5897,7 @@ function applyOptions(instance) {
5756
5897
  instance.filters = filters;
5757
5898
  }
5758
5899
  }
5759
- function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP, unwrapRef = false) {
5900
+ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
5760
5901
  if (isArray(injectOptions)) {
5761
5902
  injectOptions = normalizeInject(injectOptions);
5762
5903
  }
@@ -5778,21 +5919,12 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
5778
5919
  injected = inject(opt);
5779
5920
  }
5780
5921
  if (isRef(injected)) {
5781
- if (unwrapRef) {
5782
- Object.defineProperty(ctx, key, {
5783
- enumerable: true,
5784
- configurable: true,
5785
- get: () => injected.value,
5786
- set: (v) => injected.value = v
5787
- });
5788
- } else {
5789
- {
5790
- warn(
5791
- `injected property "${key}" is a ref and will be auto-unwrapped and no longer needs \`.value\` in the next minor release. To opt-in to the new behavior now, set \`app.config.unwrapInjectedRef = true\` (this config is temporary and will not be needed in the future.)`
5792
- );
5793
- }
5794
- ctx[key] = injected;
5795
- }
5922
+ Object.defineProperty(ctx, key, {
5923
+ enumerable: true,
5924
+ configurable: true,
5925
+ get: () => injected.value,
5926
+ set: (v) => injected.value = v
5927
+ });
5796
5928
  } else {
5797
5929
  ctx[key] = injected;
5798
5930
  }
@@ -5895,10 +6027,8 @@ function mergeOptions(to, from, strats, asMixin = false) {
5895
6027
  }
5896
6028
  const internalOptionMergeStrats = {
5897
6029
  data: mergeDataFn,
5898
- props: mergeObjectOptions,
5899
- // TODO
5900
- emits: mergeObjectOptions,
5901
- // TODO
6030
+ props: mergeEmitsOrPropsOptions,
6031
+ emits: mergeEmitsOrPropsOptions,
5902
6032
  // objects
5903
6033
  methods: mergeObjectOptions,
5904
6034
  computed: mergeObjectOptions,
@@ -5960,7 +6090,21 @@ function mergeAsArray(to, from) {
5960
6090
  return to ? [...new Set([].concat(to, from))] : from;
5961
6091
  }
5962
6092
  function mergeObjectOptions(to, from) {
5963
- return to ? extend(extend(/* @__PURE__ */ Object.create(null), to), from) : from;
6093
+ return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
6094
+ }
6095
+ function mergeEmitsOrPropsOptions(to, from) {
6096
+ if (to) {
6097
+ if (isArray(to) && isArray(from)) {
6098
+ return [.../* @__PURE__ */ new Set([...to, ...from])];
6099
+ }
6100
+ return extend(
6101
+ /* @__PURE__ */ Object.create(null),
6102
+ normalizePropsOrEmits(to),
6103
+ normalizePropsOrEmits(from != null ? from : {})
6104
+ );
6105
+ } else {
6106
+ return from;
6107
+ }
5964
6108
  }
5965
6109
  function mergeWatchOptions(to, from) {
5966
6110
  if (!to)
@@ -5974,1179 +6118,1234 @@ function mergeWatchOptions(to, from) {
5974
6118
  return merged;
5975
6119
  }
5976
6120
 
5977
- function createPropsDefaultThis(instance, rawProps, propKey) {
5978
- return new Proxy(
5979
- {},
5980
- {
5981
- get(_, key) {
5982
- warnDeprecation("PROPS_DEFAULT_THIS", null, propKey);
5983
- if (key === "$options") {
5984
- return resolveMergedOptions(instance);
5985
- }
5986
- if (key in rawProps) {
5987
- return rawProps[key];
5988
- }
5989
- const injections = instance.type.inject;
5990
- if (injections) {
5991
- if (isArray(injections)) {
5992
- if (injections.includes(key)) {
5993
- return inject(key);
5994
- }
5995
- } else if (key in injections) {
5996
- return inject(key);
5997
- }
6121
+ function installLegacyConfigWarnings(config) {
6122
+ const legacyConfigOptions = {
6123
+ silent: "CONFIG_SILENT",
6124
+ devtools: "CONFIG_DEVTOOLS",
6125
+ ignoredElements: "CONFIG_IGNORED_ELEMENTS",
6126
+ keyCodes: "CONFIG_KEY_CODES",
6127
+ productionTip: "CONFIG_PRODUCTION_TIP"
6128
+ };
6129
+ Object.keys(legacyConfigOptions).forEach((key) => {
6130
+ let val = config[key];
6131
+ Object.defineProperty(config, key, {
6132
+ enumerable: true,
6133
+ get() {
6134
+ return val;
6135
+ },
6136
+ set(newVal) {
6137
+ if (!isCopyingConfig) {
6138
+ warnDeprecation(legacyConfigOptions[key], null);
5998
6139
  }
6140
+ val = newVal;
5999
6141
  }
6000
- }
6001
- );
6142
+ });
6143
+ });
6002
6144
  }
6003
-
6004
- function shouldSkipAttr(key, instance) {
6005
- if (key === "is") {
6006
- return true;
6007
- }
6008
- if ((key === "class" || key === "style") && isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE", instance)) {
6009
- return true;
6010
- }
6011
- if (isOn(key) && isCompatEnabled("INSTANCE_LISTENERS", instance)) {
6012
- return true;
6013
- }
6014
- if (key.startsWith("routerView") || key === "registerRouteInstance") {
6015
- return true;
6016
- }
6017
- return false;
6145
+ function installLegacyOptionMergeStrats(config) {
6146
+ config.optionMergeStrategies = new Proxy({}, {
6147
+ get(target, key) {
6148
+ if (key in target) {
6149
+ return target[key];
6150
+ }
6151
+ if (key in internalOptionMergeStrats && softAssertCompatEnabled(
6152
+ "CONFIG_OPTION_MERGE_STRATS",
6153
+ null
6154
+ )) {
6155
+ return internalOptionMergeStrats[key];
6156
+ }
6157
+ }
6158
+ });
6018
6159
  }
6019
6160
 
6020
- function initProps(instance, rawProps, isStateful, isSSR = false) {
6021
- const props = {};
6022
- const attrs = {};
6023
- def(attrs, InternalObjectKey, 1);
6024
- instance.propsDefaults = /* @__PURE__ */ Object.create(null);
6025
- setFullProps(instance, rawProps, props, attrs);
6026
- for (const key in instance.propsOptions[0]) {
6027
- if (!(key in props)) {
6028
- props[key] = void 0;
6161
+ let isCopyingConfig = false;
6162
+ let singletonApp;
6163
+ let singletonCtor;
6164
+ function createCompatVue$1(createApp, createSingletonApp) {
6165
+ singletonApp = createSingletonApp({});
6166
+ const Vue = singletonCtor = function Vue2(options = {}) {
6167
+ return createCompatApp(options, Vue2);
6168
+ };
6169
+ function createCompatApp(options = {}, Ctor) {
6170
+ assertCompatEnabled("GLOBAL_MOUNT", null);
6171
+ const { data } = options;
6172
+ if (data && !isFunction(data) && softAssertCompatEnabled("OPTIONS_DATA_FN", null)) {
6173
+ options.data = () => data;
6174
+ }
6175
+ const app = createApp(options);
6176
+ if (Ctor !== Vue) {
6177
+ applySingletonPrototype(app, Ctor);
6178
+ }
6179
+ const vm = app._createRoot(options);
6180
+ if (options.el) {
6181
+ return vm.$mount(options.el);
6182
+ } else {
6183
+ return vm;
6029
6184
  }
6030
6185
  }
6031
- {
6032
- validateProps(rawProps || {}, props, instance);
6033
- }
6034
- if (isStateful) {
6035
- instance.props = isSSR ? props : shallowReactive(props);
6036
- } else {
6037
- if (!instance.type.props) {
6038
- instance.props = attrs;
6186
+ Vue.version = `2.6.14-compat:${"3.3.0-beta.1"}`;
6187
+ Vue.config = singletonApp.config;
6188
+ Vue.use = (p, ...options) => {
6189
+ if (p && isFunction(p.install)) {
6190
+ p.install(Vue, ...options);
6191
+ } else if (isFunction(p)) {
6192
+ p(Vue, ...options);
6193
+ }
6194
+ return Vue;
6195
+ };
6196
+ Vue.mixin = (m) => {
6197
+ singletonApp.mixin(m);
6198
+ return Vue;
6199
+ };
6200
+ Vue.component = (name, comp) => {
6201
+ if (comp) {
6202
+ singletonApp.component(name, comp);
6203
+ return Vue;
6039
6204
  } else {
6040
- instance.props = props;
6205
+ return singletonApp.component(name);
6206
+ }
6207
+ };
6208
+ Vue.directive = (name, dir) => {
6209
+ if (dir) {
6210
+ singletonApp.directive(name, dir);
6211
+ return Vue;
6212
+ } else {
6213
+ return singletonApp.directive(name);
6214
+ }
6215
+ };
6216
+ Vue.options = { _base: Vue };
6217
+ let cid = 1;
6218
+ Vue.cid = cid;
6219
+ Vue.nextTick = nextTick;
6220
+ const extendCache = /* @__PURE__ */ new WeakMap();
6221
+ function extendCtor(extendOptions = {}) {
6222
+ assertCompatEnabled("GLOBAL_EXTEND", null);
6223
+ if (isFunction(extendOptions)) {
6224
+ extendOptions = extendOptions.options;
6225
+ }
6226
+ if (extendCache.has(extendOptions)) {
6227
+ return extendCache.get(extendOptions);
6228
+ }
6229
+ const Super = this;
6230
+ function SubVue(inlineOptions) {
6231
+ if (!inlineOptions) {
6232
+ return createCompatApp(SubVue.options, SubVue);
6233
+ } else {
6234
+ return createCompatApp(
6235
+ mergeOptions(
6236
+ extend({}, SubVue.options),
6237
+ inlineOptions,
6238
+ internalOptionMergeStrats
6239
+ ),
6240
+ SubVue
6241
+ );
6242
+ }
6041
6243
  }
6244
+ SubVue.super = Super;
6245
+ SubVue.prototype = Object.create(Vue.prototype);
6246
+ SubVue.prototype.constructor = SubVue;
6247
+ const mergeBase = {};
6248
+ for (const key in Super.options) {
6249
+ const superValue = Super.options[key];
6250
+ mergeBase[key] = isArray(superValue) ? superValue.slice() : isObject(superValue) ? extend(/* @__PURE__ */ Object.create(null), superValue) : superValue;
6251
+ }
6252
+ SubVue.options = mergeOptions(
6253
+ mergeBase,
6254
+ extendOptions,
6255
+ internalOptionMergeStrats
6256
+ );
6257
+ SubVue.options._base = SubVue;
6258
+ SubVue.extend = extendCtor.bind(SubVue);
6259
+ SubVue.mixin = Super.mixin;
6260
+ SubVue.use = Super.use;
6261
+ SubVue.cid = ++cid;
6262
+ extendCache.set(extendOptions, SubVue);
6263
+ return SubVue;
6042
6264
  }
6043
- instance.attrs = attrs;
6265
+ Vue.extend = extendCtor.bind(Vue);
6266
+ Vue.set = (target, key, value) => {
6267
+ assertCompatEnabled("GLOBAL_SET", null);
6268
+ target[key] = value;
6269
+ };
6270
+ Vue.delete = (target, key) => {
6271
+ assertCompatEnabled("GLOBAL_DELETE", null);
6272
+ delete target[key];
6273
+ };
6274
+ Vue.observable = (target) => {
6275
+ assertCompatEnabled("GLOBAL_OBSERVABLE", null);
6276
+ return reactive(target);
6277
+ };
6278
+ Vue.filter = (name, filter) => {
6279
+ if (filter) {
6280
+ singletonApp.filter(name, filter);
6281
+ return Vue;
6282
+ } else {
6283
+ return singletonApp.filter(name);
6284
+ }
6285
+ };
6286
+ const util = {
6287
+ warn: warn ,
6288
+ extend,
6289
+ mergeOptions: (parent, child, vm) => mergeOptions(
6290
+ parent,
6291
+ child,
6292
+ vm ? void 0 : internalOptionMergeStrats
6293
+ ),
6294
+ defineReactive
6295
+ };
6296
+ Object.defineProperty(Vue, "util", {
6297
+ get() {
6298
+ assertCompatEnabled("GLOBAL_PRIVATE_UTIL", null);
6299
+ return util;
6300
+ }
6301
+ });
6302
+ Vue.configureCompat = configureCompat$1;
6303
+ return Vue;
6044
6304
  }
6045
- function isInHmrContext(instance) {
6046
- while (instance) {
6047
- if (instance.type.__hmrId)
6048
- return true;
6049
- instance = instance.parent;
6305
+ function installAppCompatProperties(app, context, render) {
6306
+ installFilterMethod(app, context);
6307
+ installLegacyOptionMergeStrats(app.config);
6308
+ if (!singletonApp) {
6309
+ return;
6050
6310
  }
6311
+ installCompatMount(app, context, render);
6312
+ installLegacyAPIs(app);
6313
+ applySingletonAppMutations(app);
6314
+ installLegacyConfigWarnings(app.config);
6051
6315
  }
6052
- function updateProps(instance, rawProps, rawPrevProps, optimized) {
6053
- const {
6054
- props,
6055
- attrs,
6056
- vnode: { patchFlag }
6057
- } = instance;
6058
- const rawCurrentProps = toRaw(props);
6059
- const [options] = instance.propsOptions;
6060
- let hasAttrsChanged = false;
6061
- if (
6062
- // always force full diff in dev
6063
- // - #1942 if hmr is enabled with sfc component
6064
- // - vite#872 non-sfc component used by sfc component
6065
- !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
6066
- ) {
6067
- if (patchFlag & 8) {
6068
- const propsToUpdate = instance.vnode.dynamicProps;
6069
- for (let i = 0; i < propsToUpdate.length; i++) {
6070
- let key = propsToUpdate[i];
6071
- if (isEmitListener(instance.emitsOptions, key)) {
6072
- continue;
6073
- }
6074
- const value = rawProps[key];
6075
- if (options) {
6076
- if (hasOwn(attrs, key)) {
6077
- if (value !== attrs[key]) {
6078
- attrs[key] = value;
6079
- hasAttrsChanged = true;
6080
- }
6081
- } else {
6082
- const camelizedKey = camelize(key);
6083
- props[camelizedKey] = resolvePropValue(
6084
- options,
6085
- rawCurrentProps,
6086
- camelizedKey,
6087
- value,
6088
- instance,
6089
- false
6090
- /* isAbsent */
6091
- );
6092
- }
6093
- } else {
6094
- {
6095
- if (isOn(key) && key.endsWith("Native")) {
6096
- key = key.slice(0, -6);
6097
- } else if (shouldSkipAttr(key, instance)) {
6098
- continue;
6099
- }
6100
- }
6101
- if (value !== attrs[key]) {
6102
- attrs[key] = value;
6103
- hasAttrsChanged = true;
6104
- }
6105
- }
6106
- }
6316
+ function installFilterMethod(app, context) {
6317
+ context.filters = {};
6318
+ app.filter = (name, filter) => {
6319
+ assertCompatEnabled("FILTERS", null);
6320
+ if (!filter) {
6321
+ return context.filters[name];
6107
6322
  }
6108
- } else {
6109
- if (setFullProps(instance, rawProps, props, attrs)) {
6110
- hasAttrsChanged = true;
6323
+ if (context.filters[name]) {
6324
+ warn(`Filter "${name}" has already been registered.`);
6111
6325
  }
6112
- let kebabKey;
6113
- for (const key in rawCurrentProps) {
6114
- if (!rawProps || // for camelCase
6115
- !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
6116
- // and converted to camelCase (#955)
6117
- ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
6118
- if (options) {
6119
- if (rawPrevProps && // for camelCase
6120
- (rawPrevProps[key] !== void 0 || // for kebab-case
6121
- rawPrevProps[kebabKey] !== void 0)) {
6122
- props[key] = resolvePropValue(
6123
- options,
6124
- rawCurrentProps,
6125
- key,
6126
- void 0,
6127
- instance,
6128
- true
6129
- /* isAbsent */
6130
- );
6131
- }
6132
- } else {
6133
- delete props[key];
6134
- }
6326
+ context.filters[name] = filter;
6327
+ return app;
6328
+ };
6329
+ }
6330
+ function installLegacyAPIs(app) {
6331
+ Object.defineProperties(app, {
6332
+ // so that app.use() can work with legacy plugins that extend prototypes
6333
+ prototype: {
6334
+ get() {
6335
+ warnDeprecation("GLOBAL_PROTOTYPE", null);
6336
+ return app.config.globalProperties;
6135
6337
  }
6136
- }
6137
- if (attrs !== rawCurrentProps) {
6138
- for (const key in attrs) {
6139
- if (!rawProps || !hasOwn(rawProps, key) && !hasOwn(rawProps, key + "Native")) {
6140
- delete attrs[key];
6141
- hasAttrsChanged = true;
6142
- }
6338
+ },
6339
+ nextTick: { value: nextTick },
6340
+ extend: { value: singletonCtor.extend },
6341
+ set: { value: singletonCtor.set },
6342
+ delete: { value: singletonCtor.delete },
6343
+ observable: { value: singletonCtor.observable },
6344
+ util: {
6345
+ get() {
6346
+ return singletonCtor.util;
6143
6347
  }
6144
6348
  }
6349
+ });
6350
+ }
6351
+ function applySingletonAppMutations(app) {
6352
+ app._context.mixins = [...singletonApp._context.mixins];
6353
+ ["components", "directives", "filters"].forEach((key) => {
6354
+ app._context[key] = Object.create(singletonApp._context[key]);
6355
+ });
6356
+ isCopyingConfig = true;
6357
+ for (const key in singletonApp.config) {
6358
+ if (key === "isNativeTag")
6359
+ continue;
6360
+ if (isRuntimeOnly() && (key === "isCustomElement" || key === "compilerOptions")) {
6361
+ continue;
6362
+ }
6363
+ const val = singletonApp.config[key];
6364
+ app.config[key] = isObject(val) ? Object.create(val) : val;
6365
+ if (key === "ignoredElements" && isCompatEnabled("CONFIG_IGNORED_ELEMENTS", null) && !isRuntimeOnly() && isArray(val)) {
6366
+ app.config.compilerOptions.isCustomElement = (tag) => {
6367
+ return val.some((v) => isString(v) ? v === tag : v.test(tag));
6368
+ };
6369
+ }
6145
6370
  }
6146
- if (hasAttrsChanged) {
6147
- trigger(instance, "set", "$attrs");
6148
- }
6149
- {
6150
- validateProps(rawProps || {}, props, instance);
6371
+ isCopyingConfig = false;
6372
+ applySingletonPrototype(app, singletonCtor);
6373
+ }
6374
+ function applySingletonPrototype(app, Ctor) {
6375
+ const enabled = isCompatEnabled("GLOBAL_PROTOTYPE", null);
6376
+ if (enabled) {
6377
+ app.config.globalProperties = Object.create(Ctor.prototype);
6378
+ }
6379
+ let hasPrototypeAugmentations = false;
6380
+ const descriptors = Object.getOwnPropertyDescriptors(Ctor.prototype);
6381
+ for (const key in descriptors) {
6382
+ if (key !== "constructor") {
6383
+ hasPrototypeAugmentations = true;
6384
+ if (enabled) {
6385
+ Object.defineProperty(
6386
+ app.config.globalProperties,
6387
+ key,
6388
+ descriptors[key]
6389
+ );
6390
+ }
6391
+ }
6392
+ }
6393
+ if (hasPrototypeAugmentations) {
6394
+ warnDeprecation("GLOBAL_PROTOTYPE", null);
6151
6395
  }
6152
6396
  }
6153
- function setFullProps(instance, rawProps, props, attrs) {
6154
- const [options, needCastKeys] = instance.propsOptions;
6155
- let hasAttrsChanged = false;
6156
- let rawCastValues;
6157
- if (rawProps) {
6158
- for (let key in rawProps) {
6159
- if (isReservedProp(key)) {
6160
- continue;
6397
+ function installCompatMount(app, context, render) {
6398
+ let isMounted = false;
6399
+ app._createRoot = (options) => {
6400
+ const component = app._component;
6401
+ const vnode = createVNode(component, options.propsData || null);
6402
+ vnode.appContext = context;
6403
+ const hasNoRender = !isFunction(component) && !component.render && !component.template;
6404
+ const emptyRender = () => {
6405
+ };
6406
+ const instance = createComponentInstance(vnode, null, null);
6407
+ if (hasNoRender) {
6408
+ instance.render = emptyRender;
6409
+ }
6410
+ setupComponent(instance);
6411
+ vnode.component = instance;
6412
+ vnode.isCompatRoot = true;
6413
+ instance.ctx._compat_mount = (selectorOrEl) => {
6414
+ if (isMounted) {
6415
+ warn(`Root instance is already mounted.`);
6416
+ return;
6161
6417
  }
6162
- {
6163
- if (key.startsWith("onHook:")) {
6164
- softAssertCompatEnabled(
6165
- "INSTANCE_EVENT_HOOKS",
6166
- instance,
6167
- key.slice(2).toLowerCase()
6418
+ let container;
6419
+ if (typeof selectorOrEl === "string") {
6420
+ const result = document.querySelector(selectorOrEl);
6421
+ if (!result) {
6422
+ warn(
6423
+ `Failed to mount root instance: selector "${selectorOrEl}" returned null.`
6168
6424
  );
6425
+ return;
6169
6426
  }
6170
- if (key === "inline-template") {
6171
- continue;
6172
- }
6427
+ container = result;
6428
+ } else {
6429
+ container = selectorOrEl || document.createElement("div");
6173
6430
  }
6174
- const value = rawProps[key];
6175
- let camelKey;
6176
- if (options && hasOwn(options, camelKey = camelize(key))) {
6177
- if (!needCastKeys || !needCastKeys.includes(camelKey)) {
6178
- props[camelKey] = value;
6179
- } else {
6180
- (rawCastValues || (rawCastValues = {}))[camelKey] = value;
6181
- }
6182
- } else if (!isEmitListener(instance.emitsOptions, key)) {
6431
+ const isSVG = container instanceof SVGElement;
6432
+ {
6433
+ context.reload = () => {
6434
+ const cloned = cloneVNode(vnode);
6435
+ cloned.component = null;
6436
+ render(cloned, container, isSVG);
6437
+ };
6438
+ }
6439
+ if (hasNoRender && instance.render === emptyRender) {
6183
6440
  {
6184
- if (isOn(key) && key.endsWith("Native")) {
6185
- key = key.slice(0, -6);
6186
- } else if (shouldSkipAttr(key, instance)) {
6187
- continue;
6441
+ for (let i = 0; i < container.attributes.length; i++) {
6442
+ const attr = container.attributes[i];
6443
+ if (attr.name !== "v-cloak" && /^(v-|:|@)/.test(attr.name)) {
6444
+ warnDeprecation("GLOBAL_MOUNT_CONTAINER", null);
6445
+ break;
6446
+ }
6188
6447
  }
6189
6448
  }
6190
- if (!(key in attrs) || value !== attrs[key]) {
6191
- attrs[key] = value;
6192
- hasAttrsChanged = true;
6193
- }
6449
+ instance.render = null;
6450
+ component.template = container.innerHTML;
6451
+ finishComponentSetup(
6452
+ instance,
6453
+ false,
6454
+ true
6455
+ /* skip options */
6456
+ );
6194
6457
  }
6195
- }
6196
- }
6197
- if (needCastKeys) {
6198
- const rawCurrentProps = toRaw(props);
6199
- const castValues = rawCastValues || EMPTY_OBJ;
6200
- for (let i = 0; i < needCastKeys.length; i++) {
6201
- const key = needCastKeys[i];
6202
- props[key] = resolvePropValue(
6203
- options,
6204
- rawCurrentProps,
6205
- key,
6206
- castValues[key],
6207
- instance,
6208
- !hasOwn(castValues, key)
6209
- );
6210
- }
6211
- }
6212
- return hasAttrsChanged;
6213
- }
6214
- function resolvePropValue(options, props, key, value, instance, isAbsent) {
6215
- const opt = options[key];
6216
- if (opt != null) {
6217
- const hasDefault = hasOwn(opt, "default");
6218
- if (hasDefault && value === void 0) {
6219
- const defaultValue = opt.default;
6220
- if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
6221
- const { propsDefaults } = instance;
6222
- if (key in propsDefaults) {
6223
- value = propsDefaults[key];
6224
- } else {
6225
- setCurrentInstance(instance);
6226
- value = propsDefaults[key] = defaultValue.call(
6227
- isCompatEnabled("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props, key) : null,
6228
- props
6229
- );
6230
- unsetCurrentInstance();
6458
+ container.innerHTML = "";
6459
+ render(vnode, container, isSVG);
6460
+ if (container instanceof Element) {
6461
+ container.removeAttribute("v-cloak");
6462
+ container.setAttribute("data-v-app", "");
6463
+ }
6464
+ isMounted = true;
6465
+ app._container = container;
6466
+ container.__vue_app__ = app;
6467
+ {
6468
+ devtoolsInitApp(app, version);
6469
+ }
6470
+ return instance.proxy;
6471
+ };
6472
+ instance.ctx._compat_destroy = () => {
6473
+ if (isMounted) {
6474
+ render(null, app._container);
6475
+ {
6476
+ devtoolsUnmountApp(app);
6231
6477
  }
6478
+ delete app._container.__vue_app__;
6232
6479
  } else {
6233
- value = defaultValue;
6234
- }
6235
- }
6236
- if (opt[0 /* shouldCast */]) {
6237
- if (isAbsent && !hasDefault) {
6238
- value = false;
6239
- } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
6240
- value = true;
6480
+ const { bum, scope, um } = instance;
6481
+ if (bum) {
6482
+ invokeArrayFns(bum);
6483
+ }
6484
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
6485
+ instance.emit("hook:beforeDestroy");
6486
+ }
6487
+ if (scope) {
6488
+ scope.stop();
6489
+ }
6490
+ if (um) {
6491
+ invokeArrayFns(um);
6492
+ }
6493
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
6494
+ instance.emit("hook:destroyed");
6495
+ }
6241
6496
  }
6497
+ };
6498
+ return instance.proxy;
6499
+ };
6500
+ }
6501
+ const methodsToPatch = [
6502
+ "push",
6503
+ "pop",
6504
+ "shift",
6505
+ "unshift",
6506
+ "splice",
6507
+ "sort",
6508
+ "reverse"
6509
+ ];
6510
+ const patched = /* @__PURE__ */ new WeakSet();
6511
+ function defineReactive(obj, key, val) {
6512
+ if (isObject(val) && !isReactive(val) && !patched.has(val)) {
6513
+ const reactiveVal = reactive(val);
6514
+ if (isArray(val)) {
6515
+ methodsToPatch.forEach((m) => {
6516
+ val[m] = (...args) => {
6517
+ Array.prototype[m].call(reactiveVal, ...args);
6518
+ };
6519
+ });
6520
+ } else {
6521
+ Object.keys(val).forEach((key2) => {
6522
+ try {
6523
+ defineReactiveSimple(val, key2, val[key2]);
6524
+ } catch (e) {
6525
+ }
6526
+ });
6242
6527
  }
6243
6528
  }
6244
- return value;
6529
+ const i = obj.$;
6530
+ if (i && obj === i.proxy) {
6531
+ defineReactiveSimple(i.ctx, key, val);
6532
+ i.accessCache = /* @__PURE__ */ Object.create(null);
6533
+ } else if (isReactive(obj)) {
6534
+ obj[key] = val;
6535
+ } else {
6536
+ defineReactiveSimple(obj, key, val);
6537
+ }
6245
6538
  }
6246
- function normalizePropsOptions(comp, appContext, asMixin = false) {
6247
- const cache = appContext.propsCache;
6248
- const cached = cache.get(comp);
6249
- if (cached) {
6250
- return cached;
6251
- }
6252
- const raw = comp.props;
6253
- const normalized = {};
6254
- const needCastKeys = [];
6255
- let hasExtends = false;
6256
- if (!isFunction(comp)) {
6257
- const extendProps = (raw2) => {
6258
- if (isFunction(raw2)) {
6259
- raw2 = raw2.options;
6260
- }
6261
- hasExtends = true;
6262
- const [props, keys] = normalizePropsOptions(raw2, appContext, true);
6263
- extend(normalized, props);
6264
- if (keys)
6265
- needCastKeys.push(...keys);
6266
- };
6267
- if (!asMixin && appContext.mixins.length) {
6268
- appContext.mixins.forEach(extendProps);
6269
- }
6270
- if (comp.extends) {
6271
- extendProps(comp.extends);
6272
- }
6273
- if (comp.mixins) {
6274
- comp.mixins.forEach(extendProps);
6539
+ function defineReactiveSimple(obj, key, val) {
6540
+ val = isObject(val) ? reactive(val) : val;
6541
+ Object.defineProperty(obj, key, {
6542
+ enumerable: true,
6543
+ configurable: true,
6544
+ get() {
6545
+ track(obj, "get", key);
6546
+ return val;
6547
+ },
6548
+ set(newVal) {
6549
+ val = isObject(newVal) ? reactive(newVal) : newVal;
6550
+ trigger(obj, "set", key, newVal);
6275
6551
  }
6276
- }
6277
- if (!raw && !hasExtends) {
6278
- if (isObject(comp)) {
6279
- cache.set(comp, EMPTY_ARR);
6552
+ });
6553
+ }
6554
+
6555
+ function createAppContext() {
6556
+ return {
6557
+ app: null,
6558
+ config: {
6559
+ isNativeTag: NO,
6560
+ performance: false,
6561
+ globalProperties: {},
6562
+ optionMergeStrategies: {},
6563
+ errorHandler: void 0,
6564
+ warnHandler: void 0,
6565
+ compilerOptions: {}
6566
+ },
6567
+ mixins: [],
6568
+ components: {},
6569
+ directives: {},
6570
+ provides: /* @__PURE__ */ Object.create(null),
6571
+ optionsCache: /* @__PURE__ */ new WeakMap(),
6572
+ propsCache: /* @__PURE__ */ new WeakMap(),
6573
+ emitsCache: /* @__PURE__ */ new WeakMap()
6574
+ };
6575
+ }
6576
+ let uid$1 = 0;
6577
+ function createAppAPI(render, hydrate) {
6578
+ return function createApp(rootComponent, rootProps = null) {
6579
+ if (!isFunction(rootComponent)) {
6580
+ rootComponent = extend({}, rootComponent);
6280
6581
  }
6281
- return EMPTY_ARR;
6282
- }
6283
- if (isArray(raw)) {
6284
- for (let i = 0; i < raw.length; i++) {
6285
- if (!isString(raw[i])) {
6286
- warn(`props must be strings when using array syntax.`, raw[i]);
6287
- }
6288
- const normalizedKey = camelize(raw[i]);
6289
- if (validatePropName(normalizedKey)) {
6290
- normalized[normalizedKey] = EMPTY_OBJ;
6291
- }
6582
+ if (rootProps != null && !isObject(rootProps)) {
6583
+ warn(`root props passed to app.mount() must be an object.`);
6584
+ rootProps = null;
6292
6585
  }
6293
- } else if (raw) {
6294
- if (!isObject(raw)) {
6295
- warn(`invalid props options`, raw);
6586
+ const context = createAppContext();
6587
+ {
6588
+ Object.defineProperty(context.config, "unwrapInjectedRef", {
6589
+ get() {
6590
+ return true;
6591
+ },
6592
+ set() {
6593
+ warn(
6594
+ `app.config.unwrapInjectedRef has been deprecated. 3.3 now alawys unwraps injected refs in Options API.`
6595
+ );
6596
+ }
6597
+ });
6296
6598
  }
6297
- for (const key in raw) {
6298
- const normalizedKey = camelize(key);
6299
- if (validatePropName(normalizedKey)) {
6300
- const opt = raw[key];
6301
- const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
6302
- if (prop) {
6303
- const booleanIndex = getTypeIndex(Boolean, prop.type);
6304
- const stringIndex = getTypeIndex(String, prop.type);
6305
- prop[0 /* shouldCast */] = booleanIndex > -1;
6306
- prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
6307
- if (booleanIndex > -1 || hasOwn(prop, "default")) {
6308
- needCastKeys.push(normalizedKey);
6599
+ const installedPlugins = /* @__PURE__ */ new Set();
6600
+ let isMounted = false;
6601
+ const app = context.app = {
6602
+ _uid: uid$1++,
6603
+ _component: rootComponent,
6604
+ _props: rootProps,
6605
+ _container: null,
6606
+ _context: context,
6607
+ _instance: null,
6608
+ version,
6609
+ get config() {
6610
+ return context.config;
6611
+ },
6612
+ set config(v) {
6613
+ {
6614
+ warn(
6615
+ `app.config cannot be replaced. Modify individual options instead.`
6616
+ );
6617
+ }
6618
+ },
6619
+ use(plugin, ...options) {
6620
+ if (installedPlugins.has(plugin)) {
6621
+ warn(`Plugin has already been applied to target app.`);
6622
+ } else if (plugin && isFunction(plugin.install)) {
6623
+ installedPlugins.add(plugin);
6624
+ plugin.install(app, ...options);
6625
+ } else if (isFunction(plugin)) {
6626
+ installedPlugins.add(plugin);
6627
+ plugin(app, ...options);
6628
+ } else {
6629
+ warn(
6630
+ `A plugin must either be a function or an object with an "install" function.`
6631
+ );
6632
+ }
6633
+ return app;
6634
+ },
6635
+ mixin(mixin) {
6636
+ {
6637
+ if (!context.mixins.includes(mixin)) {
6638
+ context.mixins.push(mixin);
6639
+ } else {
6640
+ warn(
6641
+ "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
6642
+ );
6643
+ }
6644
+ }
6645
+ return app;
6646
+ },
6647
+ component(name, component) {
6648
+ {
6649
+ validateComponentName(name, context.config);
6650
+ }
6651
+ if (!component) {
6652
+ return context.components[name];
6653
+ }
6654
+ if (context.components[name]) {
6655
+ warn(`Component "${name}" has already been registered in target app.`);
6656
+ }
6657
+ context.components[name] = component;
6658
+ return app;
6659
+ },
6660
+ directive(name, directive) {
6661
+ {
6662
+ validateDirectiveName(name);
6663
+ }
6664
+ if (!directive) {
6665
+ return context.directives[name];
6666
+ }
6667
+ if (context.directives[name]) {
6668
+ warn(`Directive "${name}" has already been registered in target app.`);
6669
+ }
6670
+ context.directives[name] = directive;
6671
+ return app;
6672
+ },
6673
+ mount(rootContainer, isHydrate, isSVG) {
6674
+ if (!isMounted) {
6675
+ if (rootContainer.__vue_app__) {
6676
+ warn(
6677
+ `There is already an app instance mounted on the host container.
6678
+ If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
6679
+ );
6309
6680
  }
6681
+ const vnode = createVNode(
6682
+ rootComponent,
6683
+ rootProps
6684
+ );
6685
+ vnode.appContext = context;
6686
+ {
6687
+ context.reload = () => {
6688
+ render(cloneVNode(vnode), rootContainer, isSVG);
6689
+ };
6690
+ }
6691
+ if (isHydrate && hydrate) {
6692
+ hydrate(vnode, rootContainer);
6693
+ } else {
6694
+ render(vnode, rootContainer, isSVG);
6695
+ }
6696
+ isMounted = true;
6697
+ app._container = rootContainer;
6698
+ rootContainer.__vue_app__ = app;
6699
+ {
6700
+ app._instance = vnode.component;
6701
+ devtoolsInitApp(app, version);
6702
+ }
6703
+ return getExposeProxy(vnode.component) || vnode.component.proxy;
6704
+ } else {
6705
+ warn(
6706
+ `App has already been mounted.
6707
+ If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\``
6708
+ );
6709
+ }
6710
+ },
6711
+ unmount() {
6712
+ if (isMounted) {
6713
+ render(null, app._container);
6714
+ {
6715
+ app._instance = null;
6716
+ devtoolsUnmountApp(app);
6717
+ }
6718
+ delete app._container.__vue_app__;
6719
+ } else {
6720
+ warn(`Cannot unmount an app that is not mounted.`);
6721
+ }
6722
+ },
6723
+ provide(key, value) {
6724
+ if (key in context.provides) {
6725
+ warn(
6726
+ `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
6727
+ );
6728
+ }
6729
+ context.provides[key] = value;
6730
+ return app;
6731
+ },
6732
+ runWithContext(fn) {
6733
+ currentApp = app;
6734
+ try {
6735
+ return fn();
6736
+ } finally {
6737
+ currentApp = null;
6310
6738
  }
6311
6739
  }
6740
+ };
6741
+ {
6742
+ installAppCompatProperties(app, context, render);
6312
6743
  }
6313
- }
6314
- const res = [normalized, needCastKeys];
6315
- if (isObject(comp)) {
6316
- cache.set(comp, res);
6317
- }
6318
- return res;
6744
+ return app;
6745
+ };
6319
6746
  }
6320
- function validatePropName(key) {
6321
- if (key[0] !== "$") {
6322
- return true;
6747
+ let currentApp = null;
6748
+
6749
+ function provide(key, value) {
6750
+ if (!currentInstance) {
6751
+ {
6752
+ warn(`provide() can only be used inside setup().`);
6753
+ }
6323
6754
  } else {
6324
- warn(`Invalid prop name: "${key}" is a reserved property.`);
6755
+ let provides = currentInstance.provides;
6756
+ const parentProvides = currentInstance.parent && currentInstance.parent.provides;
6757
+ if (parentProvides === provides) {
6758
+ provides = currentInstance.provides = Object.create(parentProvides);
6759
+ }
6760
+ provides[key] = value;
6325
6761
  }
6326
- return false;
6327
6762
  }
6328
- function getType(ctor) {
6329
- const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
6330
- return match ? match[2] : ctor === null ? "null" : "";
6331
- }
6332
- function isSameType(a, b) {
6333
- return getType(a) === getType(b);
6334
- }
6335
- function getTypeIndex(type, expectedTypes) {
6336
- if (isArray(expectedTypes)) {
6337
- return expectedTypes.findIndex((t) => isSameType(t, type));
6338
- } else if (isFunction(expectedTypes)) {
6339
- return isSameType(expectedTypes, type) ? 0 : -1;
6763
+ function inject(key, defaultValue, treatDefaultAsFactory = false) {
6764
+ const instance = currentInstance || currentRenderingInstance;
6765
+ if (instance || currentApp) {
6766
+ const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
6767
+ if (provides && key in provides) {
6768
+ return provides[key];
6769
+ } else if (arguments.length > 1) {
6770
+ return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
6771
+ } else {
6772
+ warn(`injection "${String(key)}" not found.`);
6773
+ }
6774
+ } else {
6775
+ warn(`inject() can only be used inside setup() or functional components.`);
6340
6776
  }
6341
- return -1;
6342
6777
  }
6343
- function validateProps(rawProps, props, instance) {
6344
- const resolvedValues = toRaw(props);
6345
- const options = instance.propsOptions[0];
6346
- for (const key in options) {
6347
- let opt = options[key];
6348
- if (opt == null)
6349
- continue;
6350
- validateProp(
6351
- key,
6352
- resolvedValues[key],
6353
- opt,
6354
- !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
6355
- );
6356
- }
6778
+ function hasInjectionContext() {
6779
+ return !!(currentInstance || currentRenderingInstance || currentApp);
6357
6780
  }
6358
- function validateProp(name, value, prop, isAbsent) {
6359
- const { type, required, validator, skipCheck } = prop;
6360
- if (required && isAbsent) {
6361
- warn('Missing required prop: "' + name + '"');
6362
- return;
6363
- }
6364
- if (value == null && !prop.required) {
6365
- return;
6366
- }
6367
- if (type != null && type !== true && !skipCheck) {
6368
- let isValid = false;
6369
- const types = isArray(type) ? type : [type];
6370
- const expectedTypes = [];
6371
- for (let i = 0; i < types.length && !isValid; i++) {
6372
- const { valid, expectedType } = assertType(value, types[i]);
6373
- expectedTypes.push(expectedType || "");
6374
- isValid = valid;
6375
- }
6376
- if (!isValid) {
6377
- warn(getInvalidTypeMessage(name, value, expectedTypes));
6378
- return;
6781
+
6782
+ function createPropsDefaultThis(instance, rawProps, propKey) {
6783
+ return new Proxy(
6784
+ {},
6785
+ {
6786
+ get(_, key) {
6787
+ warnDeprecation("PROPS_DEFAULT_THIS", null, propKey);
6788
+ if (key === "$options") {
6789
+ return resolveMergedOptions(instance);
6790
+ }
6791
+ if (key in rawProps) {
6792
+ return rawProps[key];
6793
+ }
6794
+ const injections = instance.type.inject;
6795
+ if (injections) {
6796
+ if (isArray(injections)) {
6797
+ if (injections.includes(key)) {
6798
+ return inject(key);
6799
+ }
6800
+ } else if (key in injections) {
6801
+ return inject(key);
6802
+ }
6803
+ }
6804
+ }
6379
6805
  }
6380
- }
6381
- if (validator && !validator(value)) {
6382
- warn('Invalid prop: custom validator check failed for prop "' + name + '".');
6383
- }
6806
+ );
6384
6807
  }
6385
- const isSimpleType = /* @__PURE__ */ makeMap(
6386
- "String,Number,Boolean,Function,Symbol,BigInt"
6387
- );
6388
- function assertType(value, type) {
6389
- let valid;
6390
- const expectedType = getType(type);
6391
- if (isSimpleType(expectedType)) {
6392
- const t = typeof value;
6393
- valid = t === expectedType.toLowerCase();
6394
- if (!valid && t === "object") {
6395
- valid = value instanceof type;
6396
- }
6397
- } else if (expectedType === "Object") {
6398
- valid = isObject(value);
6399
- } else if (expectedType === "Array") {
6400
- valid = isArray(value);
6401
- } else if (expectedType === "null") {
6402
- valid = value === null;
6403
- } else {
6404
- valid = value instanceof type;
6808
+
6809
+ function shouldSkipAttr(key, instance) {
6810
+ if (key === "is") {
6811
+ return true;
6405
6812
  }
6406
- return {
6407
- valid,
6408
- expectedType
6409
- };
6410
- }
6411
- function getInvalidTypeMessage(name, value, expectedTypes) {
6412
- let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
6413
- const expectedType = expectedTypes[0];
6414
- const receivedType = toRawType(value);
6415
- const expectedValue = styleValue(value, expectedType);
6416
- const receivedValue = styleValue(value, receivedType);
6417
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
6418
- message += ` with value ${expectedValue}`;
6813
+ if ((key === "class" || key === "style") && isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE", instance)) {
6814
+ return true;
6419
6815
  }
6420
- message += `, got ${receivedType} `;
6421
- if (isExplicable(receivedType)) {
6422
- message += `with value ${receivedValue}.`;
6816
+ if (isOn(key) && isCompatEnabled("INSTANCE_LISTENERS", instance)) {
6817
+ return true;
6423
6818
  }
6424
- return message;
6425
- }
6426
- function styleValue(value, type) {
6427
- if (type === "String") {
6428
- return `"${value}"`;
6429
- } else if (type === "Number") {
6430
- return `${Number(value)}`;
6431
- } else {
6432
- return `${value}`;
6819
+ if (key.startsWith("routerView") || key === "registerRouteInstance") {
6820
+ return true;
6433
6821
  }
6434
- }
6435
- function isExplicable(type) {
6436
- const explicitTypes = ["string", "number", "boolean"];
6437
- return explicitTypes.some((elem) => type.toLowerCase() === elem);
6438
- }
6439
- function isBoolean(...args) {
6440
- return args.some((elem) => elem.toLowerCase() === "boolean");
6822
+ return false;
6441
6823
  }
6442
6824
 
6443
- const isInternalKey = (key) => key[0] === "_" || key === "$stable";
6444
- const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
6445
- const normalizeSlot = (key, rawSlot, ctx) => {
6446
- if (rawSlot._n) {
6447
- return rawSlot;
6448
- }
6449
- const normalized = withCtx((...args) => {
6450
- if (currentInstance) {
6451
- warn(
6452
- `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.`
6453
- );
6454
- }
6455
- return normalizeSlotValue(rawSlot(...args));
6456
- }, ctx);
6457
- normalized._c = false;
6458
- return normalized;
6459
- };
6460
- const normalizeObjectSlots = (rawSlots, slots, instance) => {
6461
- const ctx = rawSlots._ctx;
6462
- for (const key in rawSlots) {
6463
- if (isInternalKey(key))
6464
- continue;
6465
- const value = rawSlots[key];
6466
- if (isFunction(value)) {
6467
- slots[key] = normalizeSlot(key, value, ctx);
6468
- } else if (value != null) {
6469
- if (!isCompatEnabled("RENDER_FUNCTION", instance)) {
6470
- warn(
6471
- `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
6472
- );
6473
- }
6474
- const normalized = normalizeSlotValue(value);
6475
- slots[key] = () => normalized;
6825
+ function initProps(instance, rawProps, isStateful, isSSR = false) {
6826
+ const props = {};
6827
+ const attrs = {};
6828
+ def(attrs, InternalObjectKey, 1);
6829
+ instance.propsDefaults = /* @__PURE__ */ Object.create(null);
6830
+ setFullProps(instance, rawProps, props, attrs);
6831
+ for (const key in instance.propsOptions[0]) {
6832
+ if (!(key in props)) {
6833
+ props[key] = void 0;
6476
6834
  }
6477
6835
  }
6478
- };
6479
- const normalizeVNodeSlots = (instance, children) => {
6480
- if (!isKeepAlive(instance.vnode) && !isCompatEnabled("RENDER_FUNCTION", instance)) {
6481
- warn(
6482
- `Non-function value encountered for default slot. Prefer function slots for better performance.`
6483
- );
6836
+ {
6837
+ validateProps(rawProps || {}, props, instance);
6484
6838
  }
6485
- const normalized = normalizeSlotValue(children);
6486
- instance.slots.default = () => normalized;
6487
- };
6488
- const initSlots = (instance, children) => {
6489
- if (instance.vnode.shapeFlag & 32) {
6490
- const type = children._;
6491
- if (type) {
6492
- instance.slots = toRaw(children);
6493
- def(children, "_", type);
6494
- } else {
6495
- normalizeObjectSlots(
6496
- children,
6497
- instance.slots = {},
6498
- instance
6499
- );
6500
- }
6839
+ if (isStateful) {
6840
+ instance.props = isSSR ? props : shallowReactive(props);
6501
6841
  } else {
6502
- instance.slots = {};
6503
- if (children) {
6504
- normalizeVNodeSlots(instance, children);
6842
+ if (!instance.type.props) {
6843
+ instance.props = attrs;
6844
+ } else {
6845
+ instance.props = props;
6505
6846
  }
6506
6847
  }
6507
- def(instance.slots, InternalObjectKey, 1);
6508
- };
6509
- const updateSlots = (instance, children, optimized) => {
6510
- const { vnode, slots } = instance;
6511
- let needDeletionCheck = true;
6512
- let deletionComparisonTarget = EMPTY_OBJ;
6513
- if (vnode.shapeFlag & 32) {
6514
- const type = children._;
6515
- if (type) {
6516
- if (isHmrUpdating) {
6517
- extend(slots, children);
6518
- } else if (optimized && type === 1) {
6519
- needDeletionCheck = false;
6520
- } else {
6521
- extend(slots, children);
6522
- if (!optimized && type === 1) {
6523
- delete slots._;
6848
+ instance.attrs = attrs;
6849
+ }
6850
+ function isInHmrContext(instance) {
6851
+ while (instance) {
6852
+ if (instance.type.__hmrId)
6853
+ return true;
6854
+ instance = instance.parent;
6855
+ }
6856
+ }
6857
+ function updateProps(instance, rawProps, rawPrevProps, optimized) {
6858
+ const {
6859
+ props,
6860
+ attrs,
6861
+ vnode: { patchFlag }
6862
+ } = instance;
6863
+ const rawCurrentProps = toRaw(props);
6864
+ const [options] = instance.propsOptions;
6865
+ let hasAttrsChanged = false;
6866
+ if (
6867
+ // always force full diff in dev
6868
+ // - #1942 if hmr is enabled with sfc component
6869
+ // - vite#872 non-sfc component used by sfc component
6870
+ !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
6871
+ ) {
6872
+ if (patchFlag & 8) {
6873
+ const propsToUpdate = instance.vnode.dynamicProps;
6874
+ for (let i = 0; i < propsToUpdate.length; i++) {
6875
+ let key = propsToUpdate[i];
6876
+ if (isEmitListener(instance.emitsOptions, key)) {
6877
+ continue;
6878
+ }
6879
+ const value = rawProps[key];
6880
+ if (options) {
6881
+ if (hasOwn(attrs, key)) {
6882
+ if (value !== attrs[key]) {
6883
+ attrs[key] = value;
6884
+ hasAttrsChanged = true;
6885
+ }
6886
+ } else {
6887
+ const camelizedKey = camelize(key);
6888
+ props[camelizedKey] = resolvePropValue(
6889
+ options,
6890
+ rawCurrentProps,
6891
+ camelizedKey,
6892
+ value,
6893
+ instance,
6894
+ false
6895
+ /* isAbsent */
6896
+ );
6897
+ }
6898
+ } else {
6899
+ {
6900
+ if (isOn(key) && key.endsWith("Native")) {
6901
+ key = key.slice(0, -6);
6902
+ } else if (shouldSkipAttr(key, instance)) {
6903
+ continue;
6904
+ }
6905
+ }
6906
+ if (value !== attrs[key]) {
6907
+ attrs[key] = value;
6908
+ hasAttrsChanged = true;
6909
+ }
6524
6910
  }
6525
6911
  }
6526
- } else {
6527
- needDeletionCheck = !children.$stable;
6528
- normalizeObjectSlots(children, slots, instance);
6529
6912
  }
6530
- deletionComparisonTarget = children;
6531
- } else if (children) {
6532
- normalizeVNodeSlots(instance, children);
6533
- deletionComparisonTarget = { default: 1 };
6534
- }
6535
- if (needDeletionCheck) {
6536
- for (const key in slots) {
6537
- if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {
6538
- delete slots[key];
6913
+ } else {
6914
+ if (setFullProps(instance, rawProps, props, attrs)) {
6915
+ hasAttrsChanged = true;
6916
+ }
6917
+ let kebabKey;
6918
+ for (const key in rawCurrentProps) {
6919
+ if (!rawProps || // for camelCase
6920
+ !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
6921
+ // and converted to camelCase (#955)
6922
+ ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
6923
+ if (options) {
6924
+ if (rawPrevProps && // for camelCase
6925
+ (rawPrevProps[key] !== void 0 || // for kebab-case
6926
+ rawPrevProps[kebabKey] !== void 0)) {
6927
+ props[key] = resolvePropValue(
6928
+ options,
6929
+ rawCurrentProps,
6930
+ key,
6931
+ void 0,
6932
+ instance,
6933
+ true
6934
+ /* isAbsent */
6935
+ );
6936
+ }
6937
+ } else {
6938
+ delete props[key];
6939
+ }
6539
6940
  }
6540
6941
  }
6541
- }
6542
- };
6543
-
6544
- function installLegacyConfigWarnings(config) {
6545
- const legacyConfigOptions = {
6546
- silent: "CONFIG_SILENT",
6547
- devtools: "CONFIG_DEVTOOLS",
6548
- ignoredElements: "CONFIG_IGNORED_ELEMENTS",
6549
- keyCodes: "CONFIG_KEY_CODES",
6550
- productionTip: "CONFIG_PRODUCTION_TIP"
6551
- };
6552
- Object.keys(legacyConfigOptions).forEach((key) => {
6553
- let val = config[key];
6554
- Object.defineProperty(config, key, {
6555
- enumerable: true,
6556
- get() {
6557
- return val;
6558
- },
6559
- set(newVal) {
6560
- if (!isCopyingConfig) {
6561
- warnDeprecation(legacyConfigOptions[key], null);
6942
+ if (attrs !== rawCurrentProps) {
6943
+ for (const key in attrs) {
6944
+ if (!rawProps || !hasOwn(rawProps, key) && !hasOwn(rawProps, key + "Native")) {
6945
+ delete attrs[key];
6946
+ hasAttrsChanged = true;
6562
6947
  }
6563
- val = newVal;
6564
6948
  }
6565
- });
6566
- });
6949
+ }
6950
+ }
6951
+ if (hasAttrsChanged) {
6952
+ trigger(instance, "set", "$attrs");
6953
+ }
6954
+ {
6955
+ validateProps(rawProps || {}, props, instance);
6956
+ }
6567
6957
  }
6568
- function installLegacyOptionMergeStrats(config) {
6569
- config.optionMergeStrategies = new Proxy({}, {
6570
- get(target, key) {
6571
- if (key in target) {
6572
- return target[key];
6958
+ function setFullProps(instance, rawProps, props, attrs) {
6959
+ const [options, needCastKeys] = instance.propsOptions;
6960
+ let hasAttrsChanged = false;
6961
+ let rawCastValues;
6962
+ if (rawProps) {
6963
+ for (let key in rawProps) {
6964
+ if (isReservedProp(key)) {
6965
+ continue;
6573
6966
  }
6574
- if (key in internalOptionMergeStrats && softAssertCompatEnabled(
6575
- "CONFIG_OPTION_MERGE_STRATS",
6576
- null
6577
- )) {
6578
- return internalOptionMergeStrats[key];
6967
+ {
6968
+ if (key.startsWith("onHook:")) {
6969
+ softAssertCompatEnabled(
6970
+ "INSTANCE_EVENT_HOOKS",
6971
+ instance,
6972
+ key.slice(2).toLowerCase()
6973
+ );
6974
+ }
6975
+ if (key === "inline-template") {
6976
+ continue;
6977
+ }
6978
+ }
6979
+ const value = rawProps[key];
6980
+ let camelKey;
6981
+ if (options && hasOwn(options, camelKey = camelize(key))) {
6982
+ if (!needCastKeys || !needCastKeys.includes(camelKey)) {
6983
+ props[camelKey] = value;
6984
+ } else {
6985
+ (rawCastValues || (rawCastValues = {}))[camelKey] = value;
6986
+ }
6987
+ } else if (!isEmitListener(instance.emitsOptions, key)) {
6988
+ {
6989
+ if (isOn(key) && key.endsWith("Native")) {
6990
+ key = key.slice(0, -6);
6991
+ } else if (shouldSkipAttr(key, instance)) {
6992
+ continue;
6993
+ }
6994
+ }
6995
+ if (!(key in attrs) || value !== attrs[key]) {
6996
+ attrs[key] = value;
6997
+ hasAttrsChanged = true;
6998
+ }
6579
6999
  }
6580
7000
  }
6581
- });
7001
+ }
7002
+ if (needCastKeys) {
7003
+ const rawCurrentProps = toRaw(props);
7004
+ const castValues = rawCastValues || EMPTY_OBJ;
7005
+ for (let i = 0; i < needCastKeys.length; i++) {
7006
+ const key = needCastKeys[i];
7007
+ props[key] = resolvePropValue(
7008
+ options,
7009
+ rawCurrentProps,
7010
+ key,
7011
+ castValues[key],
7012
+ instance,
7013
+ !hasOwn(castValues, key)
7014
+ );
7015
+ }
7016
+ }
7017
+ return hasAttrsChanged;
6582
7018
  }
6583
-
6584
- let isCopyingConfig = false;
6585
- let singletonApp;
6586
- let singletonCtor;
6587
- function createCompatVue$1(createApp, createSingletonApp) {
6588
- singletonApp = createSingletonApp({});
6589
- const Vue = singletonCtor = function Vue2(options = {}) {
6590
- return createCompatApp(options, Vue2);
6591
- };
6592
- function createCompatApp(options = {}, Ctor) {
6593
- assertCompatEnabled("GLOBAL_MOUNT", null);
6594
- const { data } = options;
6595
- if (data && !isFunction(data) && softAssertCompatEnabled("OPTIONS_DATA_FN", null)) {
6596
- options.data = () => data;
7019
+ function resolvePropValue(options, props, key, value, instance, isAbsent) {
7020
+ const opt = options[key];
7021
+ if (opt != null) {
7022
+ const hasDefault = hasOwn(opt, "default");
7023
+ if (hasDefault && value === void 0) {
7024
+ const defaultValue = opt.default;
7025
+ if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
7026
+ const { propsDefaults } = instance;
7027
+ if (key in propsDefaults) {
7028
+ value = propsDefaults[key];
7029
+ } else {
7030
+ setCurrentInstance(instance);
7031
+ value = propsDefaults[key] = defaultValue.call(
7032
+ isCompatEnabled("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props, key) : null,
7033
+ props
7034
+ );
7035
+ unsetCurrentInstance();
7036
+ }
7037
+ } else {
7038
+ value = defaultValue;
7039
+ }
6597
7040
  }
6598
- const app = createApp(options);
6599
- if (Ctor !== Vue) {
6600
- applySingletonPrototype(app, Ctor);
6601
- }
6602
- const vm = app._createRoot(options);
6603
- if (options.el) {
6604
- return vm.$mount(options.el);
6605
- } else {
6606
- return vm;
7041
+ if (opt[0 /* shouldCast */]) {
7042
+ if (isAbsent && !hasDefault) {
7043
+ value = false;
7044
+ } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
7045
+ value = true;
7046
+ }
6607
7047
  }
6608
7048
  }
6609
- Vue.version = `2.6.14-compat:${"3.3.0-alpha.8"}`;
6610
- Vue.config = singletonApp.config;
6611
- Vue.use = (p, ...options) => {
6612
- if (p && isFunction(p.install)) {
6613
- p.install(Vue, ...options);
6614
- } else if (isFunction(p)) {
6615
- p(Vue, ...options);
6616
- }
6617
- return Vue;
6618
- };
6619
- Vue.mixin = (m) => {
6620
- singletonApp.mixin(m);
6621
- return Vue;
6622
- };
6623
- Vue.component = (name, comp) => {
6624
- if (comp) {
6625
- singletonApp.component(name, comp);
6626
- return Vue;
6627
- } else {
6628
- return singletonApp.component(name);
7049
+ return value;
7050
+ }
7051
+ function normalizePropsOptions(comp, appContext, asMixin = false) {
7052
+ const cache = appContext.propsCache;
7053
+ const cached = cache.get(comp);
7054
+ if (cached) {
7055
+ return cached;
7056
+ }
7057
+ const raw = comp.props;
7058
+ const normalized = {};
7059
+ const needCastKeys = [];
7060
+ let hasExtends = false;
7061
+ if (!isFunction(comp)) {
7062
+ const extendProps = (raw2) => {
7063
+ if (isFunction(raw2)) {
7064
+ raw2 = raw2.options;
7065
+ }
7066
+ hasExtends = true;
7067
+ const [props, keys] = normalizePropsOptions(raw2, appContext, true);
7068
+ extend(normalized, props);
7069
+ if (keys)
7070
+ needCastKeys.push(...keys);
7071
+ };
7072
+ if (!asMixin && appContext.mixins.length) {
7073
+ appContext.mixins.forEach(extendProps);
6629
7074
  }
6630
- };
6631
- Vue.directive = (name, dir) => {
6632
- if (dir) {
6633
- singletonApp.directive(name, dir);
6634
- return Vue;
6635
- } else {
6636
- return singletonApp.directive(name);
7075
+ if (comp.extends) {
7076
+ extendProps(comp.extends);
6637
7077
  }
6638
- };
6639
- Vue.options = { _base: Vue };
6640
- let cid = 1;
6641
- Vue.cid = cid;
6642
- Vue.nextTick = nextTick;
6643
- const extendCache = /* @__PURE__ */ new WeakMap();
6644
- function extendCtor(extendOptions = {}) {
6645
- assertCompatEnabled("GLOBAL_EXTEND", null);
6646
- if (isFunction(extendOptions)) {
6647
- extendOptions = extendOptions.options;
7078
+ if (comp.mixins) {
7079
+ comp.mixins.forEach(extendProps);
6648
7080
  }
6649
- if (extendCache.has(extendOptions)) {
6650
- return extendCache.get(extendOptions);
7081
+ }
7082
+ if (!raw && !hasExtends) {
7083
+ if (isObject(comp)) {
7084
+ cache.set(comp, EMPTY_ARR);
6651
7085
  }
6652
- const Super = this;
6653
- function SubVue(inlineOptions) {
6654
- if (!inlineOptions) {
6655
- return createCompatApp(SubVue.options, SubVue);
6656
- } else {
6657
- return createCompatApp(
6658
- mergeOptions(
6659
- extend({}, SubVue.options),
6660
- inlineOptions,
6661
- internalOptionMergeStrats
6662
- ),
6663
- SubVue
6664
- );
7086
+ return EMPTY_ARR;
7087
+ }
7088
+ if (isArray(raw)) {
7089
+ for (let i = 0; i < raw.length; i++) {
7090
+ if (!isString(raw[i])) {
7091
+ warn(`props must be strings when using array syntax.`, raw[i]);
7092
+ }
7093
+ const normalizedKey = camelize(raw[i]);
7094
+ if (validatePropName(normalizedKey)) {
7095
+ normalized[normalizedKey] = EMPTY_OBJ;
6665
7096
  }
6666
7097
  }
6667
- SubVue.super = Super;
6668
- SubVue.prototype = Object.create(Vue.prototype);
6669
- SubVue.prototype.constructor = SubVue;
6670
- const mergeBase = {};
6671
- for (const key in Super.options) {
6672
- const superValue = Super.options[key];
6673
- mergeBase[key] = isArray(superValue) ? superValue.slice() : isObject(superValue) ? extend(/* @__PURE__ */ Object.create(null), superValue) : superValue;
7098
+ } else if (raw) {
7099
+ if (!isObject(raw)) {
7100
+ warn(`invalid props options`, raw);
6674
7101
  }
6675
- SubVue.options = mergeOptions(
6676
- mergeBase,
6677
- extendOptions,
6678
- internalOptionMergeStrats
7102
+ for (const key in raw) {
7103
+ const normalizedKey = camelize(key);
7104
+ if (validatePropName(normalizedKey)) {
7105
+ const opt = raw[key];
7106
+ const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
7107
+ if (prop) {
7108
+ const booleanIndex = getTypeIndex(Boolean, prop.type);
7109
+ const stringIndex = getTypeIndex(String, prop.type);
7110
+ prop[0 /* shouldCast */] = booleanIndex > -1;
7111
+ prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
7112
+ if (booleanIndex > -1 || hasOwn(prop, "default")) {
7113
+ needCastKeys.push(normalizedKey);
7114
+ }
7115
+ }
7116
+ }
7117
+ }
7118
+ }
7119
+ const res = [normalized, needCastKeys];
7120
+ if (isObject(comp)) {
7121
+ cache.set(comp, res);
7122
+ }
7123
+ return res;
7124
+ }
7125
+ function validatePropName(key) {
7126
+ if (key[0] !== "$") {
7127
+ return true;
7128
+ } else {
7129
+ warn(`Invalid prop name: "${key}" is a reserved property.`);
7130
+ }
7131
+ return false;
7132
+ }
7133
+ function getType(ctor) {
7134
+ const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
7135
+ return match ? match[2] : ctor === null ? "null" : "";
7136
+ }
7137
+ function isSameType(a, b) {
7138
+ return getType(a) === getType(b);
7139
+ }
7140
+ function getTypeIndex(type, expectedTypes) {
7141
+ if (isArray(expectedTypes)) {
7142
+ return expectedTypes.findIndex((t) => isSameType(t, type));
7143
+ } else if (isFunction(expectedTypes)) {
7144
+ return isSameType(expectedTypes, type) ? 0 : -1;
7145
+ }
7146
+ return -1;
7147
+ }
7148
+ function validateProps(rawProps, props, instance) {
7149
+ const resolvedValues = toRaw(props);
7150
+ const options = instance.propsOptions[0];
7151
+ for (const key in options) {
7152
+ let opt = options[key];
7153
+ if (opt == null)
7154
+ continue;
7155
+ validateProp(
7156
+ key,
7157
+ resolvedValues[key],
7158
+ opt,
7159
+ !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
6679
7160
  );
6680
- SubVue.options._base = SubVue;
6681
- SubVue.extend = extendCtor.bind(SubVue);
6682
- SubVue.mixin = Super.mixin;
6683
- SubVue.use = Super.use;
6684
- SubVue.cid = ++cid;
6685
- extendCache.set(extendOptions, SubVue);
6686
- return SubVue;
6687
7161
  }
6688
- Vue.extend = extendCtor.bind(Vue);
6689
- Vue.set = (target, key, value) => {
6690
- assertCompatEnabled("GLOBAL_SET", null);
6691
- target[key] = value;
6692
- };
6693
- Vue.delete = (target, key) => {
6694
- assertCompatEnabled("GLOBAL_DELETE", null);
6695
- delete target[key];
6696
- };
6697
- Vue.observable = (target) => {
6698
- assertCompatEnabled("GLOBAL_OBSERVABLE", null);
6699
- return reactive(target);
6700
- };
6701
- Vue.filter = (name, filter) => {
6702
- if (filter) {
6703
- singletonApp.filter(name, filter);
6704
- return Vue;
6705
- } else {
6706
- return singletonApp.filter(name);
6707
- }
6708
- };
6709
- const util = {
6710
- warn: warn ,
6711
- extend,
6712
- mergeOptions: (parent, child, vm) => mergeOptions(
6713
- parent,
6714
- child,
6715
- vm ? void 0 : internalOptionMergeStrats
6716
- ),
6717
- defineReactive
6718
- };
6719
- Object.defineProperty(Vue, "util", {
6720
- get() {
6721
- assertCompatEnabled("GLOBAL_PRIVATE_UTIL", null);
6722
- return util;
6723
- }
6724
- });
6725
- Vue.configureCompat = configureCompat$1;
6726
- return Vue;
6727
7162
  }
6728
- function installAppCompatProperties(app, context, render) {
6729
- installFilterMethod(app, context);
6730
- installLegacyOptionMergeStrats(app.config);
6731
- if (!singletonApp) {
7163
+ function validateProp(name, value, prop, isAbsent) {
7164
+ const { type, required, validator, skipCheck } = prop;
7165
+ if (required && isAbsent) {
7166
+ warn('Missing required prop: "' + name + '"');
6732
7167
  return;
6733
7168
  }
6734
- installCompatMount(app, context, render);
6735
- installLegacyAPIs(app);
6736
- applySingletonAppMutations(app);
6737
- installLegacyConfigWarnings(app.config);
6738
- }
6739
- function installFilterMethod(app, context) {
6740
- context.filters = {};
6741
- app.filter = (name, filter) => {
6742
- assertCompatEnabled("FILTERS", null);
6743
- if (!filter) {
6744
- return context.filters[name];
7169
+ if (value == null && !required) {
7170
+ return;
7171
+ }
7172
+ if (type != null && type !== true && !skipCheck) {
7173
+ let isValid = false;
7174
+ const types = isArray(type) ? type : [type];
7175
+ const expectedTypes = [];
7176
+ for (let i = 0; i < types.length && !isValid; i++) {
7177
+ const { valid, expectedType } = assertType(value, types[i]);
7178
+ expectedTypes.push(expectedType || "");
7179
+ isValid = valid;
6745
7180
  }
6746
- if (context.filters[name]) {
6747
- warn(`Filter "${name}" has already been registered.`);
7181
+ if (!isValid) {
7182
+ warn(getInvalidTypeMessage(name, value, expectedTypes));
7183
+ return;
6748
7184
  }
6749
- context.filters[name] = filter;
6750
- return app;
6751
- };
7185
+ }
7186
+ if (validator && !validator(value)) {
7187
+ warn('Invalid prop: custom validator check failed for prop "' + name + '".');
7188
+ }
6752
7189
  }
6753
- function installLegacyAPIs(app) {
6754
- Object.defineProperties(app, {
6755
- // so that app.use() can work with legacy plugins that extend prototypes
6756
- prototype: {
6757
- get() {
6758
- warnDeprecation("GLOBAL_PROTOTYPE", null);
6759
- return app.config.globalProperties;
6760
- }
6761
- },
6762
- nextTick: { value: nextTick },
6763
- extend: { value: singletonCtor.extend },
6764
- set: { value: singletonCtor.set },
6765
- delete: { value: singletonCtor.delete },
6766
- observable: { value: singletonCtor.observable },
6767
- util: {
6768
- get() {
6769
- return singletonCtor.util;
6770
- }
6771
- }
6772
- });
6773
- }
6774
- function applySingletonAppMutations(app) {
6775
- app._context.mixins = [...singletonApp._context.mixins];
6776
- ["components", "directives", "filters"].forEach((key) => {
6777
- app._context[key] = Object.create(singletonApp._context[key]);
6778
- });
6779
- isCopyingConfig = true;
6780
- for (const key in singletonApp.config) {
6781
- if (key === "isNativeTag")
6782
- continue;
6783
- if (isRuntimeOnly() && (key === "isCustomElement" || key === "compilerOptions")) {
6784
- continue;
6785
- }
6786
- const val = singletonApp.config[key];
6787
- app.config[key] = isObject(val) ? Object.create(val) : val;
6788
- if (key === "ignoredElements" && isCompatEnabled("CONFIG_IGNORED_ELEMENTS", null) && !isRuntimeOnly() && isArray(val)) {
6789
- app.config.compilerOptions.isCustomElement = (tag) => {
6790
- return val.some((v) => isString(v) ? v === tag : v.test(tag));
6791
- };
6792
- }
6793
- }
6794
- isCopyingConfig = false;
6795
- applySingletonPrototype(app, singletonCtor);
6796
- }
6797
- function applySingletonPrototype(app, Ctor) {
6798
- const enabled = isCompatEnabled("GLOBAL_PROTOTYPE", null);
6799
- if (enabled) {
6800
- app.config.globalProperties = Object.create(Ctor.prototype);
6801
- }
6802
- let hasPrototypeAugmentations = false;
6803
- const descriptors = Object.getOwnPropertyDescriptors(Ctor.prototype);
6804
- for (const key in descriptors) {
6805
- if (key !== "constructor") {
6806
- hasPrototypeAugmentations = true;
6807
- if (enabled) {
6808
- Object.defineProperty(
6809
- app.config.globalProperties,
6810
- key,
6811
- descriptors[key]
6812
- );
6813
- }
6814
- }
6815
- }
6816
- if (hasPrototypeAugmentations) {
6817
- warnDeprecation("GLOBAL_PROTOTYPE", null);
6818
- }
6819
- }
6820
- function installCompatMount(app, context, render) {
6821
- let isMounted = false;
6822
- app._createRoot = (options) => {
6823
- const component = app._component;
6824
- const vnode = createVNode(component, options.propsData || null);
6825
- vnode.appContext = context;
6826
- const hasNoRender = !isFunction(component) && !component.render && !component.template;
6827
- const emptyRender = () => {
6828
- };
6829
- const instance = createComponentInstance(vnode, null, null);
6830
- if (hasNoRender) {
6831
- instance.render = emptyRender;
6832
- }
6833
- setupComponent(instance);
6834
- vnode.component = instance;
6835
- vnode.isCompatRoot = true;
6836
- instance.ctx._compat_mount = (selectorOrEl) => {
6837
- if (isMounted) {
6838
- warn(`Root instance is already mounted.`);
6839
- return;
6840
- }
6841
- let container;
6842
- if (typeof selectorOrEl === "string") {
6843
- const result = document.querySelector(selectorOrEl);
6844
- if (!result) {
6845
- warn(
6846
- `Failed to mount root instance: selector "${selectorOrEl}" returned null.`
6847
- );
6848
- return;
6849
- }
6850
- container = result;
6851
- } else {
6852
- container = selectorOrEl || document.createElement("div");
6853
- }
6854
- const isSVG = container instanceof SVGElement;
6855
- {
6856
- context.reload = () => {
6857
- const cloned = cloneVNode(vnode);
6858
- cloned.component = null;
6859
- render(cloned, container, isSVG);
6860
- };
6861
- }
6862
- if (hasNoRender && instance.render === emptyRender) {
6863
- {
6864
- for (let i = 0; i < container.attributes.length; i++) {
6865
- const attr = container.attributes[i];
6866
- if (attr.name !== "v-cloak" && /^(v-|:|@)/.test(attr.name)) {
6867
- warnDeprecation("GLOBAL_MOUNT_CONTAINER", null);
6868
- break;
6869
- }
6870
- }
6871
- }
6872
- instance.render = null;
6873
- component.template = container.innerHTML;
6874
- finishComponentSetup(
6875
- instance,
6876
- false,
6877
- true
6878
- /* skip options */
6879
- );
6880
- }
6881
- container.innerHTML = "";
6882
- render(vnode, container, isSVG);
6883
- if (container instanceof Element) {
6884
- container.removeAttribute("v-cloak");
6885
- container.setAttribute("data-v-app", "");
6886
- }
6887
- isMounted = true;
6888
- app._container = container;
6889
- container.__vue_app__ = app;
6890
- {
6891
- devtoolsInitApp(app, version);
6892
- }
6893
- return instance.proxy;
6894
- };
6895
- instance.ctx._compat_destroy = () => {
6896
- if (isMounted) {
6897
- render(null, app._container);
6898
- {
6899
- devtoolsUnmountApp(app);
6900
- }
6901
- delete app._container.__vue_app__;
6902
- } else {
6903
- const { bum, scope, um } = instance;
6904
- if (bum) {
6905
- invokeArrayFns(bum);
6906
- }
6907
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
6908
- instance.emit("hook:beforeDestroy");
6909
- }
6910
- if (scope) {
6911
- scope.stop();
6912
- }
6913
- if (um) {
6914
- invokeArrayFns(um);
6915
- }
6916
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
6917
- instance.emit("hook:destroyed");
6918
- }
6919
- }
6920
- };
6921
- return instance.proxy;
6922
- };
6923
- }
6924
- const methodsToPatch = [
6925
- "push",
6926
- "pop",
6927
- "shift",
6928
- "unshift",
6929
- "splice",
6930
- "sort",
6931
- "reverse"
6932
- ];
6933
- const patched = /* @__PURE__ */ new WeakSet();
6934
- function defineReactive(obj, key, val) {
6935
- if (isObject(val) && !isReactive(val) && !patched.has(val)) {
6936
- const reactiveVal = reactive(val);
6937
- if (isArray(val)) {
6938
- methodsToPatch.forEach((m) => {
6939
- val[m] = (...args) => {
6940
- Array.prototype[m].call(reactiveVal, ...args);
6941
- };
6942
- });
6943
- } else {
6944
- Object.keys(val).forEach((key2) => {
6945
- try {
6946
- defineReactiveSimple(val, key2, val[key2]);
6947
- } catch (e) {
6948
- }
6949
- });
7190
+ const isSimpleType = /* @__PURE__ */ makeMap(
7191
+ "String,Number,Boolean,Function,Symbol,BigInt"
7192
+ );
7193
+ function assertType(value, type) {
7194
+ let valid;
7195
+ const expectedType = getType(type);
7196
+ if (isSimpleType(expectedType)) {
7197
+ const t = typeof value;
7198
+ valid = t === expectedType.toLowerCase();
7199
+ if (!valid && t === "object") {
7200
+ valid = value instanceof type;
6950
7201
  }
6951
- }
6952
- const i = obj.$;
6953
- if (i && obj === i.proxy) {
6954
- defineReactiveSimple(i.ctx, key, val);
6955
- i.accessCache = /* @__PURE__ */ Object.create(null);
6956
- } else if (isReactive(obj)) {
6957
- obj[key] = val;
7202
+ } else if (expectedType === "Object") {
7203
+ valid = isObject(value);
7204
+ } else if (expectedType === "Array") {
7205
+ valid = isArray(value);
7206
+ } else if (expectedType === "null") {
7207
+ valid = value === null;
6958
7208
  } else {
6959
- defineReactiveSimple(obj, key, val);
7209
+ valid = value instanceof type;
6960
7210
  }
6961
- }
6962
- function defineReactiveSimple(obj, key, val) {
6963
- val = isObject(val) ? reactive(val) : val;
6964
- Object.defineProperty(obj, key, {
6965
- enumerable: true,
6966
- configurable: true,
6967
- get() {
6968
- track(obj, "get", key);
6969
- return val;
6970
- },
6971
- set(newVal) {
6972
- val = isObject(newVal) ? reactive(newVal) : newVal;
6973
- trigger(obj, "set", key, newVal);
6974
- }
6975
- });
6976
- }
6977
-
6978
- function createAppContext() {
6979
7211
  return {
6980
- app: null,
6981
- config: {
6982
- isNativeTag: NO,
6983
- performance: false,
6984
- globalProperties: {},
6985
- optionMergeStrategies: {},
6986
- errorHandler: void 0,
6987
- warnHandler: void 0,
6988
- compilerOptions: {}
6989
- },
6990
- mixins: [],
6991
- components: {},
6992
- directives: {},
6993
- provides: /* @__PURE__ */ Object.create(null),
6994
- optionsCache: /* @__PURE__ */ new WeakMap(),
6995
- propsCache: /* @__PURE__ */ new WeakMap(),
6996
- emitsCache: /* @__PURE__ */ new WeakMap()
6997
- };
6998
- }
6999
- let uid$1 = 0;
7000
- function createAppAPI(render, hydrate) {
7001
- return function createApp(rootComponent, rootProps = null) {
7002
- if (!isFunction(rootComponent)) {
7003
- rootComponent = extend({}, rootComponent);
7004
- }
7005
- if (rootProps != null && !isObject(rootProps)) {
7006
- warn(`root props passed to app.mount() must be an object.`);
7007
- rootProps = null;
7008
- }
7009
- const context = createAppContext();
7010
- const installedPlugins = /* @__PURE__ */ new Set();
7011
- let isMounted = false;
7012
- const app = context.app = {
7013
- _uid: uid$1++,
7014
- _component: rootComponent,
7015
- _props: rootProps,
7016
- _container: null,
7017
- _context: context,
7018
- _instance: null,
7019
- version,
7020
- get config() {
7021
- return context.config;
7022
- },
7023
- set config(v) {
7024
- {
7025
- warn(
7026
- `app.config cannot be replaced. Modify individual options instead.`
7027
- );
7028
- }
7029
- },
7030
- use(plugin, ...options) {
7031
- if (installedPlugins.has(plugin)) {
7032
- warn(`Plugin has already been applied to target app.`);
7033
- } else if (plugin && isFunction(plugin.install)) {
7034
- installedPlugins.add(plugin);
7035
- plugin.install(app, ...options);
7036
- } else if (isFunction(plugin)) {
7037
- installedPlugins.add(plugin);
7038
- plugin(app, ...options);
7039
- } else {
7040
- warn(
7041
- `A plugin must either be a function or an object with an "install" function.`
7042
- );
7043
- }
7044
- return app;
7045
- },
7046
- mixin(mixin) {
7047
- {
7048
- if (!context.mixins.includes(mixin)) {
7049
- context.mixins.push(mixin);
7050
- } else {
7051
- warn(
7052
- "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
7053
- );
7054
- }
7055
- }
7056
- return app;
7057
- },
7058
- component(name, component) {
7059
- {
7060
- validateComponentName(name, context.config);
7061
- }
7062
- if (!component) {
7063
- return context.components[name];
7064
- }
7065
- if (context.components[name]) {
7066
- warn(`Component "${name}" has already been registered in target app.`);
7067
- }
7068
- context.components[name] = component;
7069
- return app;
7070
- },
7071
- directive(name, directive) {
7072
- {
7073
- validateDirectiveName(name);
7074
- }
7075
- if (!directive) {
7076
- return context.directives[name];
7077
- }
7078
- if (context.directives[name]) {
7079
- warn(`Directive "${name}" has already been registered in target app.`);
7080
- }
7081
- context.directives[name] = directive;
7082
- return app;
7083
- },
7084
- mount(rootContainer, isHydrate, isSVG) {
7085
- if (!isMounted) {
7086
- if (rootContainer.__vue_app__) {
7087
- warn(
7088
- `There is already an app instance mounted on the host container.
7089
- If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
7090
- );
7091
- }
7092
- const vnode = createVNode(
7093
- rootComponent,
7094
- rootProps
7095
- );
7096
- vnode.appContext = context;
7097
- {
7098
- context.reload = () => {
7099
- render(cloneVNode(vnode), rootContainer, isSVG);
7100
- };
7101
- }
7102
- if (isHydrate && hydrate) {
7103
- hydrate(vnode, rootContainer);
7104
- } else {
7105
- render(vnode, rootContainer, isSVG);
7106
- }
7107
- isMounted = true;
7108
- app._container = rootContainer;
7109
- rootContainer.__vue_app__ = app;
7110
- {
7111
- app._instance = vnode.component;
7112
- devtoolsInitApp(app, version);
7113
- }
7114
- return getExposeProxy(vnode.component) || vnode.component.proxy;
7115
- } else {
7116
- warn(
7117
- `App has already been mounted.
7118
- If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\``
7119
- );
7120
- }
7121
- },
7122
- unmount() {
7123
- if (isMounted) {
7124
- render(null, app._container);
7125
- {
7126
- app._instance = null;
7127
- devtoolsUnmountApp(app);
7128
- }
7129
- delete app._container.__vue_app__;
7130
- } else {
7131
- warn(`Cannot unmount an app that is not mounted.`);
7132
- }
7133
- },
7134
- provide(key, value) {
7135
- if (key in context.provides) {
7136
- warn(
7137
- `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
7138
- );
7212
+ valid,
7213
+ expectedType
7214
+ };
7215
+ }
7216
+ function getInvalidTypeMessage(name, value, expectedTypes) {
7217
+ let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
7218
+ const expectedType = expectedTypes[0];
7219
+ const receivedType = toRawType(value);
7220
+ const expectedValue = styleValue(value, expectedType);
7221
+ const receivedValue = styleValue(value, receivedType);
7222
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
7223
+ message += ` with value ${expectedValue}`;
7224
+ }
7225
+ message += `, got ${receivedType} `;
7226
+ if (isExplicable(receivedType)) {
7227
+ message += `with value ${receivedValue}.`;
7228
+ }
7229
+ return message;
7230
+ }
7231
+ function styleValue(value, type) {
7232
+ if (type === "String") {
7233
+ return `"${value}"`;
7234
+ } else if (type === "Number") {
7235
+ return `${Number(value)}`;
7236
+ } else {
7237
+ return `${value}`;
7238
+ }
7239
+ }
7240
+ function isExplicable(type) {
7241
+ const explicitTypes = ["string", "number", "boolean"];
7242
+ return explicitTypes.some((elem) => type.toLowerCase() === elem);
7243
+ }
7244
+ function isBoolean(...args) {
7245
+ return args.some((elem) => elem.toLowerCase() === "boolean");
7246
+ }
7247
+
7248
+ const isInternalKey = (key) => key[0] === "_" || key === "$stable";
7249
+ const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
7250
+ const normalizeSlot = (key, rawSlot, ctx) => {
7251
+ if (rawSlot._n) {
7252
+ return rawSlot;
7253
+ }
7254
+ const normalized = withCtx((...args) => {
7255
+ if (currentInstance) {
7256
+ warn(
7257
+ `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.`
7258
+ );
7259
+ }
7260
+ return normalizeSlotValue(rawSlot(...args));
7261
+ }, ctx);
7262
+ normalized._c = false;
7263
+ return normalized;
7264
+ };
7265
+ const normalizeObjectSlots = (rawSlots, slots, instance) => {
7266
+ const ctx = rawSlots._ctx;
7267
+ for (const key in rawSlots) {
7268
+ if (isInternalKey(key))
7269
+ continue;
7270
+ const value = rawSlots[key];
7271
+ if (isFunction(value)) {
7272
+ slots[key] = normalizeSlot(key, value, ctx);
7273
+ } else if (value != null) {
7274
+ if (!isCompatEnabled("RENDER_FUNCTION", instance)) {
7275
+ warn(
7276
+ `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
7277
+ );
7278
+ }
7279
+ const normalized = normalizeSlotValue(value);
7280
+ slots[key] = () => normalized;
7281
+ }
7282
+ }
7283
+ };
7284
+ const normalizeVNodeSlots = (instance, children) => {
7285
+ if (!isKeepAlive(instance.vnode) && !isCompatEnabled("RENDER_FUNCTION", instance)) {
7286
+ warn(
7287
+ `Non-function value encountered for default slot. Prefer function slots for better performance.`
7288
+ );
7289
+ }
7290
+ const normalized = normalizeSlotValue(children);
7291
+ instance.slots.default = () => normalized;
7292
+ };
7293
+ const initSlots = (instance, children) => {
7294
+ if (instance.vnode.shapeFlag & 32) {
7295
+ const type = children._;
7296
+ if (type) {
7297
+ instance.slots = toRaw(children);
7298
+ def(children, "_", type);
7299
+ } else {
7300
+ normalizeObjectSlots(
7301
+ children,
7302
+ instance.slots = {},
7303
+ instance
7304
+ );
7305
+ }
7306
+ } else {
7307
+ instance.slots = {};
7308
+ if (children) {
7309
+ normalizeVNodeSlots(instance, children);
7310
+ }
7311
+ }
7312
+ def(instance.slots, InternalObjectKey, 1);
7313
+ };
7314
+ const updateSlots = (instance, children, optimized) => {
7315
+ const { vnode, slots } = instance;
7316
+ let needDeletionCheck = true;
7317
+ let deletionComparisonTarget = EMPTY_OBJ;
7318
+ if (vnode.shapeFlag & 32) {
7319
+ const type = children._;
7320
+ if (type) {
7321
+ if (isHmrUpdating) {
7322
+ extend(slots, children);
7323
+ trigger(instance, "set", "$slots");
7324
+ } else if (optimized && type === 1) {
7325
+ needDeletionCheck = false;
7326
+ } else {
7327
+ extend(slots, children);
7328
+ if (!optimized && type === 1) {
7329
+ delete slots._;
7139
7330
  }
7140
- context.provides[key] = value;
7141
- return app;
7142
7331
  }
7143
- };
7144
- {
7145
- installAppCompatProperties(app, context, render);
7332
+ } else {
7333
+ needDeletionCheck = !children.$stable;
7334
+ normalizeObjectSlots(children, slots, instance);
7146
7335
  }
7147
- return app;
7148
- };
7149
- }
7336
+ deletionComparisonTarget = children;
7337
+ } else if (children) {
7338
+ normalizeVNodeSlots(instance, children);
7339
+ deletionComparisonTarget = { default: 1 };
7340
+ }
7341
+ if (needDeletionCheck) {
7342
+ for (const key in slots) {
7343
+ if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {
7344
+ delete slots[key];
7345
+ }
7346
+ }
7347
+ }
7348
+ };
7150
7349
 
7151
7350
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7152
7351
  if (isArray(rawRef)) {
@@ -8050,7 +8249,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8050
8249
  areChildrenSVG,
8051
8250
  slotScopeIds
8052
8251
  );
8053
- if (parentComponent && parentComponent.type.__hmrId) {
8252
+ {
8054
8253
  traverseStaticChildren(n1, n2);
8055
8254
  }
8056
8255
  } else if (!optimized) {
@@ -8246,21 +8445,8 @@ function baseCreateRenderer(options, createHydrationFns) {
8246
8445
  isSVG,
8247
8446
  slotScopeIds
8248
8447
  );
8249
- if (parentComponent && parentComponent.type.__hmrId) {
8448
+ {
8250
8449
  traverseStaticChildren(n1, n2);
8251
- } else if (
8252
- // #2080 if the stable fragment has a key, it's a <template v-for> that may
8253
- // get moved around. Make sure all root level vnodes inherit el.
8254
- // #2134 or if it's a component root, it may also get moved around
8255
- // as the component is being moved.
8256
- n2.key != null || parentComponent && n2 === parentComponent.subTree
8257
- ) {
8258
- traverseStaticChildren(
8259
- n1,
8260
- n2,
8261
- true
8262
- /* shallow */
8263
- );
8264
8450
  }
8265
8451
  } else {
8266
8452
  patchChildren(
@@ -9929,6 +10115,8 @@ function createComponentInstance(vnode, parent, suspense) {
9929
10115
  refs: EMPTY_OBJ,
9930
10116
  setupState: EMPTY_OBJ,
9931
10117
  setupContext: null,
10118
+ attrsProxy: null,
10119
+ slotsProxy: null,
9932
10120
  // suspense related
9933
10121
  suspense,
9934
10122
  suspenseId: suspense ? suspense.pendingId : 0,
@@ -10168,8 +10356,8 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
10168
10356
  }
10169
10357
  }
10170
10358
  }
10171
- function createAttrsProxy(instance) {
10172
- return new Proxy(
10359
+ function getAttrsProxy(instance) {
10360
+ return instance.attrsProxy || (instance.attrsProxy = new Proxy(
10173
10361
  instance.attrs,
10174
10362
  {
10175
10363
  get(target, key) {
@@ -10186,7 +10374,23 @@ function createAttrsProxy(instance) {
10186
10374
  return false;
10187
10375
  }
10188
10376
  }
10189
- );
10377
+ ));
10378
+ }
10379
+ function getSlotsProxy(instance) {
10380
+ return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
10381
+ get(target, key) {
10382
+ track(instance, "get", "$slots");
10383
+ return target[key];
10384
+ },
10385
+ set() {
10386
+ warn(`setupContext.slots is readonly.`);
10387
+ return false;
10388
+ },
10389
+ deleteProperty() {
10390
+ warn(`setupContext.slots is readonly.`);
10391
+ return false;
10392
+ }
10393
+ }));
10190
10394
  }
10191
10395
  function createSetupContext(instance) {
10192
10396
  const expose = (exposed) => {
@@ -10212,14 +10416,13 @@ function createSetupContext(instance) {
10212
10416
  }
10213
10417
  instance.exposed = exposed || {};
10214
10418
  };
10215
- let attrs;
10216
10419
  {
10217
10420
  return Object.freeze({
10218
10421
  get attrs() {
10219
- return attrs || (attrs = createAttrsProxy(instance));
10422
+ return getAttrsProxy(instance);
10220
10423
  },
10221
10424
  get slots() {
10222
- return shallowReadonly(instance.slots);
10425
+ return getSlotsProxy(instance);
10223
10426
  },
10224
10427
  get emit() {
10225
10428
  return (event, ...args) => instance.emit(event, ...args);
@@ -10279,111 +10482,6 @@ const computed = (getterOrOptions, debugOptions) => {
10279
10482
  return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
10280
10483
  };
10281
10484
 
10282
- const warnRuntimeUsage = (method) => warn(
10283
- `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`
10284
- );
10285
- function defineProps() {
10286
- {
10287
- warnRuntimeUsage(`defineProps`);
10288
- }
10289
- return null;
10290
- }
10291
- function defineEmits() {
10292
- {
10293
- warnRuntimeUsage(`defineEmits`);
10294
- }
10295
- return null;
10296
- }
10297
- function defineExpose(exposed) {
10298
- {
10299
- warnRuntimeUsage(`defineExpose`);
10300
- }
10301
- }
10302
- function defineOptions(options) {
10303
- {
10304
- warnRuntimeUsage(`defineOptions`);
10305
- }
10306
- }
10307
- function defineSlots() {
10308
- {
10309
- warnRuntimeUsage(`defineSlots`);
10310
- }
10311
- }
10312
- function withDefaults(props, defaults) {
10313
- {
10314
- warnRuntimeUsage(`withDefaults`);
10315
- }
10316
- return null;
10317
- }
10318
- function useSlots() {
10319
- return getContext().slots;
10320
- }
10321
- function useAttrs() {
10322
- return getContext().attrs;
10323
- }
10324
- function getContext() {
10325
- const i = getCurrentInstance();
10326
- if (!i) {
10327
- warn(`useContext() called without active instance.`);
10328
- }
10329
- return i.setupContext || (i.setupContext = createSetupContext(i));
10330
- }
10331
- function mergeDefaults(raw, defaults) {
10332
- const props = isArray(raw) ? raw.reduce(
10333
- (normalized, p) => (normalized[p] = {}, normalized),
10334
- {}
10335
- ) : raw;
10336
- for (const key in defaults) {
10337
- if (key.startsWith("__skip"))
10338
- continue;
10339
- let opt = props[key];
10340
- if (opt) {
10341
- if (isArray(opt) || isFunction(opt)) {
10342
- opt = props[key] = { type: opt, default: defaults[key] };
10343
- } else {
10344
- opt.default = defaults[key];
10345
- }
10346
- } else if (opt === null) {
10347
- opt = props[key] = { default: defaults[key] };
10348
- } else {
10349
- warn(`props default key "${key}" has no corresponding declaration.`);
10350
- }
10351
- if (opt && defaults[`__skip_${key}`]) {
10352
- opt.skipFactory = true;
10353
- }
10354
- }
10355
- return props;
10356
- }
10357
- function createPropsRestProxy(props, excludedKeys) {
10358
- const ret = {};
10359
- for (const key in props) {
10360
- if (!excludedKeys.includes(key)) {
10361
- Object.defineProperty(ret, key, {
10362
- enumerable: true,
10363
- get: () => props[key]
10364
- });
10365
- }
10366
- }
10367
- return ret;
10368
- }
10369
- function withAsyncContext(getAwaitable) {
10370
- const ctx = getCurrentInstance();
10371
- if (!ctx) {
10372
- warn(
10373
- `withAsyncContext called without active current instance. This is likely a bug.`
10374
- );
10375
- }
10376
- let awaitable = getAwaitable();
10377
- unsetCurrentInstance();
10378
- if (isPromise(awaitable)) {
10379
- awaitable = awaitable.catch((e) => {
10380
- setCurrentInstance(ctx);
10381
- throw e;
10382
- });
10383
- }
10384
- return [awaitable, () => setCurrentInstance(ctx)];
10385
- }
10386
-
10387
10485
  function h(type, propsOrChildren, children) {
10388
10486
  const l = arguments.length;
10389
10487
  if (l === 2) {
@@ -10619,7 +10717,7 @@ function isMemoSame(cached, memo) {
10619
10717
  return true;
10620
10718
  }
10621
10719
 
10622
- const version = "3.3.0-alpha.8";
10720
+ const version = "3.3.0-beta.1";
10623
10721
  const ssrUtils = null;
10624
10722
  const resolveFilter = resolveFilter$1 ;
10625
10723
  const _compatUtils = {
@@ -12275,6 +12373,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
12275
12373
  defineCustomElement: defineCustomElement,
12276
12374
  defineEmits: defineEmits,
12277
12375
  defineExpose: defineExpose,
12376
+ defineModel: defineModel,
12278
12377
  defineOptions: defineOptions,
12279
12378
  defineProps: defineProps,
12280
12379
  defineSSRCustomElement: defineSSRCustomElement,
@@ -12288,6 +12387,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
12288
12387
  guardReactiveProps: guardReactiveProps,
12289
12388
  h: h,
12290
12389
  handleError: handleError,
12390
+ hasInjectionContext: hasInjectionContext,
12291
12391
  hydrate: hydrate,
12292
12392
  initCustomFormatter: initCustomFormatter,
12293
12393
  initDirectivesForSSR: initDirectivesForSSR,
@@ -12302,6 +12402,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
12302
12402
  isVNode: isVNode,
12303
12403
  markRaw: markRaw,
12304
12404
  mergeDefaults: mergeDefaults,
12405
+ mergeModels: mergeModels,
12305
12406
  mergeProps: mergeProps,
12306
12407
  nextTick: nextTick,
12307
12408
  normalizeClass: normalizeClass,
@@ -12360,6 +12461,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
12360
12461
  useAttrs: useAttrs,
12361
12462
  useCssModule: useCssModule,
12362
12463
  useCssVars: useCssVars,
12464
+ useModel: useModel,
12363
12465
  useSSRContext: useSSRContext,
12364
12466
  useSlots: useSlots,
12365
12467
  useTransitionState: useTransitionState,
@@ -12430,4 +12532,4 @@ var Vue$1 = Vue;
12430
12532
 
12431
12533
  const { configureCompat } = Vue$1;
12432
12534
 
12433
- export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, 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$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, 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, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
12535
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, 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$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, 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, 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, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };