@vue/compat 3.3.4 → 3.3.6

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.
@@ -34,7 +34,7 @@ const isString = (val) => typeof val === "string";
34
34
  const isSymbol = (val) => typeof val === "symbol";
35
35
  const isObject = (val) => val !== null && typeof val === "object";
36
36
  const isPromise = (val) => {
37
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
37
+ return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
38
38
  };
39
39
  const objectToString = Object.prototype.toString;
40
40
  const toTypeString = (value) => objectToString.call(value);
@@ -65,12 +65,13 @@ const hyphenateRE = /\B([A-Z])/g;
65
65
  const hyphenate = cacheStringFunction(
66
66
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
67
67
  );
68
- const capitalize = cacheStringFunction(
69
- (str) => str.charAt(0).toUpperCase() + str.slice(1)
70
- );
71
- const toHandlerKey = cacheStringFunction(
72
- (str) => str ? `on${capitalize(str)}` : ``
73
- );
68
+ const capitalize = cacheStringFunction((str) => {
69
+ return str.charAt(0).toUpperCase() + str.slice(1);
70
+ });
71
+ const toHandlerKey = cacheStringFunction((str) => {
72
+ const s = str ? `on${capitalize(str)}` : ``;
73
+ return s;
74
+ });
74
75
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
75
76
  const invokeArrayFns = (fns, arg) => {
76
77
  for (let i = 0; i < fns.length; i++) {
@@ -97,8 +98,8 @@ const getGlobalThis = () => {
97
98
  return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
98
99
  };
99
100
 
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
- const isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
101
+ const GLOBALS_ALLOWED = "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";
102
+ const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
102
103
 
103
104
  function normalizeStyle(value) {
104
105
  if (isArray(value)) {
@@ -113,9 +114,7 @@ function normalizeStyle(value) {
113
114
  }
114
115
  }
115
116
  return res;
116
- } else if (isString(value)) {
117
- return value;
118
- } else if (isObject(value)) {
117
+ } else if (isString(value) || isObject(value)) {
119
118
  return value;
120
119
  }
121
120
  }
@@ -462,7 +461,7 @@ function cleanupEffect(effect2) {
462
461
  }
463
462
  }
464
463
  function effect(fn, options) {
465
- if (fn.effect) {
464
+ if (fn.effect instanceof ReactiveEffect) {
466
465
  fn = fn.effect.fn;
467
466
  }
468
467
  const _effect = new ReactiveEffect(fn);
@@ -628,10 +627,6 @@ const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`
628
627
  const builtInSymbols = new Set(
629
628
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
630
629
  );
631
- const get$1 = /* @__PURE__ */ createGetter();
632
- const shallowGet = /* @__PURE__ */ createGetter(false, true);
633
- const readonlyGet = /* @__PURE__ */ createGetter(true);
634
- const shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
635
630
  const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
636
631
  function createArrayInstrumentations() {
637
632
  const instrumentations = {};
@@ -664,8 +659,13 @@ function hasOwnProperty(key) {
664
659
  track(obj, "has", key);
665
660
  return obj.hasOwnProperty(key);
666
661
  }
667
- function createGetter(isReadonly2 = false, shallow = false) {
668
- return function get2(target, key, receiver) {
662
+ class BaseReactiveHandler {
663
+ constructor(_isReadonly = false, _shallow = false) {
664
+ this._isReadonly = _isReadonly;
665
+ this._shallow = _shallow;
666
+ }
667
+ get(target, key, receiver) {
668
+ const isReadonly2 = this._isReadonly, shallow = this._shallow;
669
669
  if (key === "__v_isReactive") {
670
670
  return !isReadonly2;
671
671
  } else if (key === "__v_isReadonly") {
@@ -701,17 +701,18 @@ function createGetter(isReadonly2 = false, shallow = false) {
701
701
  return isReadonly2 ? readonly(res) : reactive(res);
702
702
  }
703
703
  return res;
704
- };
704
+ }
705
705
  }
706
- const set$1 = /* @__PURE__ */ createSetter();
707
- const shallowSet = /* @__PURE__ */ createSetter(true);
708
- function createSetter(shallow = false) {
709
- return function set2(target, key, value, receiver) {
706
+ class MutableReactiveHandler extends BaseReactiveHandler {
707
+ constructor(shallow = false) {
708
+ super(false, shallow);
709
+ }
710
+ set(target, key, value, receiver) {
710
711
  let oldValue = target[key];
711
712
  if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
712
713
  return false;
713
714
  }
714
- if (!shallow) {
715
+ if (!this._shallow) {
715
716
  if (!isShallow(value) && !isReadonly(value)) {
716
717
  oldValue = toRaw(oldValue);
717
718
  value = toRaw(value);
@@ -731,37 +732,36 @@ function createSetter(shallow = false) {
731
732
  }
732
733
  }
733
734
  return result;
734
- };
735
- }
736
- function deleteProperty(target, key) {
737
- const hadKey = hasOwn(target, key);
738
- const oldValue = target[key];
739
- const result = Reflect.deleteProperty(target, key);
740
- if (result && hadKey) {
741
- trigger(target, "delete", key, void 0, oldValue);
742
735
  }
743
- return result;
744
- }
745
- function has$1(target, key) {
746
- const result = Reflect.has(target, key);
747
- if (!isSymbol(key) || !builtInSymbols.has(key)) {
748
- track(target, "has", key);
736
+ deleteProperty(target, key) {
737
+ const hadKey = hasOwn(target, key);
738
+ const oldValue = target[key];
739
+ const result = Reflect.deleteProperty(target, key);
740
+ if (result && hadKey) {
741
+ trigger(target, "delete", key, void 0, oldValue);
742
+ }
743
+ return result;
744
+ }
745
+ has(target, key) {
746
+ const result = Reflect.has(target, key);
747
+ if (!isSymbol(key) || !builtInSymbols.has(key)) {
748
+ track(target, "has", key);
749
+ }
750
+ return result;
751
+ }
752
+ ownKeys(target) {
753
+ track(
754
+ target,
755
+ "iterate",
756
+ isArray(target) ? "length" : ITERATE_KEY
757
+ );
758
+ return Reflect.ownKeys(target);
749
759
  }
750
- return result;
751
- }
752
- function ownKeys(target) {
753
- track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY);
754
- return Reflect.ownKeys(target);
755
760
  }
756
- const mutableHandlers = {
757
- get: get$1,
758
- set: set$1,
759
- deleteProperty,
760
- has: has$1,
761
- ownKeys
762
- };
763
- const readonlyHandlers = {
764
- get: readonlyGet,
761
+ class ReadonlyReactiveHandler extends BaseReactiveHandler {
762
+ constructor(shallow = false) {
763
+ super(true, shallow);
764
+ }
765
765
  set(target, key) {
766
766
  {
767
767
  warn$1(
@@ -770,7 +770,7 @@ const readonlyHandlers = {
770
770
  );
771
771
  }
772
772
  return true;
773
- },
773
+ }
774
774
  deleteProperty(target, key) {
775
775
  {
776
776
  warn$1(
@@ -780,22 +780,13 @@ const readonlyHandlers = {
780
780
  }
781
781
  return true;
782
782
  }
783
- };
784
- const shallowReactiveHandlers = /* @__PURE__ */ extend(
785
- {},
786
- mutableHandlers,
787
- {
788
- get: shallowGet,
789
- set: shallowSet
790
- }
791
- );
792
- const shallowReadonlyHandlers = /* @__PURE__ */ extend(
793
- {},
794
- readonlyHandlers,
795
- {
796
- get: shallowReadonlyGet
797
- }
783
+ }
784
+ const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
785
+ const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
786
+ const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
787
+ true
798
788
  );
789
+ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
799
790
 
800
791
  const toShallow = (value) => value;
801
792
  const getProto = (v) => Reflect.getPrototypeOf(v);
@@ -804,7 +795,7 @@ function get(target, key, isReadonly = false, isShallow = false) {
804
795
  const rawTarget = toRaw(target);
805
796
  const rawKey = toRaw(key);
806
797
  if (!isReadonly) {
807
- if (key !== rawKey) {
798
+ if (hasChanged(key, rawKey)) {
808
799
  track(rawTarget, "get", key);
809
800
  }
810
801
  track(rawTarget, "get", rawKey);
@@ -824,7 +815,7 @@ function has(key, isReadonly = false) {
824
815
  const rawTarget = toRaw(target);
825
816
  const rawKey = toRaw(key);
826
817
  if (!isReadonly) {
827
- if (key !== rawKey) {
818
+ if (hasChanged(key, rawKey)) {
828
819
  track(rawTarget, "has", key);
829
820
  }
830
821
  track(rawTarget, "has", rawKey);
@@ -1354,11 +1345,7 @@ function toRef(source, key, defaultValue) {
1354
1345
  }
1355
1346
  function propertyToRef(source, key, defaultValue) {
1356
1347
  const val = source[key];
1357
- return isRef(val) ? val : new ObjectRefImpl(
1358
- source,
1359
- key,
1360
- defaultValue
1361
- );
1348
+ return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1362
1349
  }
1363
1350
 
1364
1351
  class ComputedRefImpl {
@@ -3652,9 +3639,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3652
3639
  }
3653
3640
  if (cb) {
3654
3641
  const newValue = effect.run();
3655
- if (deep || forceTrigger || (isMultiSource ? newValue.some(
3656
- (v, i) => hasChanged(v, oldValue[i])
3657
- ) : hasChanged(newValue, oldValue)) || isArray(newValue) && isCompatEnabled("WATCH_ARRAY", instance)) {
3642
+ if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || isArray(newValue) && isCompatEnabled("WATCH_ARRAY", instance)) {
3658
3643
  if (cleanup) {
3659
3644
  cleanup();
3660
3645
  }
@@ -3828,6 +3813,8 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3828
3813
  }
3829
3814
  }
3830
3815
 
3816
+ const leaveCbKey = Symbol("_leaveCb");
3817
+ const enterCbKey$1 = Symbol("_enterCb");
3831
3818
  function useTransitionState() {
3832
3819
  const state = {
3833
3820
  isMounted: false,
@@ -3948,9 +3935,9 @@ const BaseTransitionImpl = {
3948
3935
  oldInnerChild
3949
3936
  );
3950
3937
  leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
3951
- el._leaveCb = () => {
3938
+ el[leaveCbKey] = () => {
3952
3939
  earlyRemove();
3953
- el._leaveCb = void 0;
3940
+ el[leaveCbKey] = void 0;
3954
3941
  delete enterHooks.delayedLeave;
3955
3942
  };
3956
3943
  enterHooks.delayedLeave = delayedLeave;
@@ -4024,15 +4011,15 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4024
4011
  return;
4025
4012
  }
4026
4013
  }
4027
- if (el._leaveCb) {
4028
- el._leaveCb(
4014
+ if (el[leaveCbKey]) {
4015
+ el[leaveCbKey](
4029
4016
  true
4030
4017
  /* cancelled */
4031
4018
  );
4032
4019
  }
4033
4020
  const leavingVNode = leavingVNodesCache[key];
4034
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el._leaveCb) {
4035
- leavingVNode.el._leaveCb();
4021
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
4022
+ leavingVNode.el[leaveCbKey]();
4036
4023
  }
4037
4024
  callHook(hook, [el]);
4038
4025
  },
@@ -4050,7 +4037,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4050
4037
  }
4051
4038
  }
4052
4039
  let called = false;
4053
- const done = el._enterCb = (cancelled) => {
4040
+ const done = el[enterCbKey$1] = (cancelled) => {
4054
4041
  if (called)
4055
4042
  return;
4056
4043
  called = true;
@@ -4062,7 +4049,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4062
4049
  if (hooks.delayedLeave) {
4063
4050
  hooks.delayedLeave();
4064
4051
  }
4065
- el._enterCb = void 0;
4052
+ el[enterCbKey$1] = void 0;
4066
4053
  };
4067
4054
  if (hook) {
4068
4055
  callAsyncHook(hook, [el, done]);
@@ -4072,8 +4059,8 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4072
4059
  },
4073
4060
  leave(el, remove) {
4074
4061
  const key2 = String(vnode.key);
4075
- if (el._enterCb) {
4076
- el._enterCb(
4062
+ if (el[enterCbKey$1]) {
4063
+ el[enterCbKey$1](
4077
4064
  true
4078
4065
  /* cancelled */
4079
4066
  );
@@ -4083,7 +4070,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4083
4070
  }
4084
4071
  callHook(onBeforeLeave, [el]);
4085
4072
  let called = false;
4086
- const done = el._leaveCb = (cancelled) => {
4073
+ const done = el[leaveCbKey] = (cancelled) => {
4087
4074
  if (called)
4088
4075
  return;
4089
4076
  called = true;
@@ -4093,7 +4080,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4093
4080
  } else {
4094
4081
  callHook(onAfterLeave, [el]);
4095
4082
  }
4096
- el._leaveCb = void 0;
4083
+ el[leaveCbKey] = void 0;
4097
4084
  if (leavingVNodesCache[key2] === vnode) {
4098
4085
  delete leavingVNodesCache[key2];
4099
4086
  }
@@ -4155,6 +4142,8 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4155
4142
  return ret;
4156
4143
  }
4157
4144
 
4145
+ /*! #__NO_SIDE_EFFECTS__ */
4146
+ // @__NO_SIDE_EFFECTS__
4158
4147
  function defineComponent(options, extraOptions) {
4159
4148
  return isFunction(options) ? (
4160
4149
  // #8326: extend call and options.name access are considered side-effects
@@ -4164,6 +4153,8 @@ function defineComponent(options, extraOptions) {
4164
4153
  }
4165
4154
 
4166
4155
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
4156
+ /*! #__NO_SIDE_EFFECTS__ */
4157
+ // @__NO_SIDE_EFFECTS__
4167
4158
  function defineAsyncComponent(source) {
4168
4159
  if (isFunction(source)) {
4169
4160
  source = { loader: source };
@@ -4895,7 +4886,7 @@ function defineLegacyVNodeProperties(vnode) {
4895
4886
  }
4896
4887
  }
4897
4888
 
4898
- const normalizedFunctionalComponentMap = /* @__PURE__ */ new Map();
4889
+ const normalizedFunctionalComponentMap = /* @__PURE__ */ new WeakMap();
4899
4890
  const legacySlotProxyHandlers = {
4900
4891
  get(target, key) {
4901
4892
  const slot = target[key];
@@ -5176,6 +5167,7 @@ function legacyPrependModifier(value, symbol) {
5176
5167
  function installCompatInstanceProperties(map) {
5177
5168
  const set = (target, key, val) => {
5178
5169
  target[key] = val;
5170
+ return target[key];
5179
5171
  };
5180
5172
  const del = (target, key) => {
5181
5173
  delete target[key];
@@ -5453,7 +5445,7 @@ const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend(
5453
5445
  return PublicInstanceProxyHandlers.get(target, key, target);
5454
5446
  },
5455
5447
  has(_, key) {
5456
- const has = key[0] !== "_" && !isGloballyWhitelisted(key);
5448
+ const has = key[0] !== "_" && !isGloballyAllowed(key);
5457
5449
  if (!has && PublicInstanceProxyHandlers.has(_, key)) {
5458
5450
  warn(
5459
5451
  `Property ${JSON.stringify(
@@ -6190,7 +6182,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6190
6182
  return vm;
6191
6183
  }
6192
6184
  }
6193
- Vue.version = `2.6.14-compat:${"3.3.4"}`;
6185
+ Vue.version = `2.6.14-compat:${"3.3.6"}`;
6194
6186
  Vue.config = singletonApp.config;
6195
6187
  Vue.use = (p, ...options) => {
6196
6188
  if (p && isFunction(p.install)) {
@@ -6598,12 +6590,12 @@ function createAppAPI(render, hydrate) {
6598
6590
  },
6599
6591
  set() {
6600
6592
  warn(
6601
- `app.config.unwrapInjectedRef has been deprecated. 3.3 now alawys unwraps injected refs in Options API.`
6593
+ `app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.`
6602
6594
  );
6603
6595
  }
6604
6596
  });
6605
6597
  }
6606
- const installedPlugins = /* @__PURE__ */ new Set();
6598
+ const installedPlugins = /* @__PURE__ */ new WeakSet();
6607
6599
  let isMounted = false;
6608
6600
  const app = context.app = {
6609
6601
  _uid: uid$1++,
@@ -6685,10 +6677,7 @@ function createAppAPI(render, hydrate) {
6685
6677
  If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
6686
6678
  );
6687
6679
  }
6688
- const vnode = createVNode(
6689
- rootComponent,
6690
- rootProps
6691
- );
6680
+ const vnode = createVNode(rootComponent, rootProps);
6692
6681
  vnode.appContext = context;
6693
6682
  {
6694
6683
  context.reload = () => {
@@ -7347,7 +7336,7 @@ const updateSlots = (instance, children, optimized) => {
7347
7336
  }
7348
7337
  if (needDeletionCheck) {
7349
7338
  for (const key in slots) {
7350
- if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {
7339
+ if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
7351
7340
  delete slots[key];
7352
7341
  }
7353
7342
  }
@@ -7511,8 +7500,10 @@ function createHydrationFunctions(rendererInternals) {
7511
7500
  hasMismatch = true;
7512
7501
  warn(
7513
7502
  `Hydration text mismatch:
7514
- - Client: ${JSON.stringify(node.data)}
7515
- - Server: ${JSON.stringify(vnode.children)}`
7503
+ - Server rendered: ${JSON.stringify(
7504
+ node.data
7505
+ )}
7506
+ - Client rendered: ${JSON.stringify(vnode.children)}`
7516
7507
  );
7517
7508
  node.data = vnode.children;
7518
7509
  }
@@ -7715,8 +7706,8 @@ function createHydrationFunctions(rendererInternals) {
7715
7706
  hasMismatch = true;
7716
7707
  warn(
7717
7708
  `Hydration text content mismatch in <${vnode.type}>:
7718
- - Client: ${el.textContent}
7719
- - Server: ${vnode.children}`
7709
+ - Server rendered: ${el.textContent}
7710
+ - Client rendered: ${vnode.children}`
7720
7711
  );
7721
7712
  el.textContent = vnode.children;
7722
7713
  }
@@ -9498,6 +9489,10 @@ const TeleportImpl = {
9498
9489
  internals,
9499
9490
  1
9500
9491
  );
9492
+ } else {
9493
+ if (n2.props && n1.props && n2.props.to !== n1.props.to) {
9494
+ n2.props.to = n1.props.to;
9495
+ }
9501
9496
  }
9502
9497
  } else {
9503
9498
  if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
@@ -9538,19 +9533,18 @@ const TeleportImpl = {
9538
9533
  if (target) {
9539
9534
  hostRemove(targetAnchor);
9540
9535
  }
9541
- if (doRemove || !isTeleportDisabled(props)) {
9542
- hostRemove(anchor);
9543
- if (shapeFlag & 16) {
9544
- for (let i = 0; i < children.length; i++) {
9545
- const child = children[i];
9546
- unmount(
9547
- child,
9548
- parentComponent,
9549
- parentSuspense,
9550
- true,
9551
- !!child.dynamicChildren
9552
- );
9553
- }
9536
+ doRemove && hostRemove(anchor);
9537
+ if (shapeFlag & 16) {
9538
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
9539
+ for (let i = 0; i < children.length; i++) {
9540
+ const child = children[i];
9541
+ unmount(
9542
+ child,
9543
+ parentComponent,
9544
+ parentSuspense,
9545
+ shouldRemove,
9546
+ !!child.dynamicChildren
9547
+ );
9554
9548
  }
9555
9549
  }
9556
9550
  },
@@ -9634,7 +9628,7 @@ function updateCssVars(vnode) {
9634
9628
  const ctx = vnode.ctx;
9635
9629
  if (ctx && ctx.ut) {
9636
9630
  let node = vnode.children[0].el;
9637
- while (node !== vnode.targetAnchor) {
9631
+ while (node && node !== vnode.targetAnchor) {
9638
9632
  if (node.nodeType === 1)
9639
9633
  node.setAttribute("data-v-owner", ctx.uid);
9640
9634
  node = node.nextSibling;
@@ -9643,7 +9637,7 @@ function updateCssVars(vnode) {
9643
9637
  }
9644
9638
  }
9645
9639
 
9646
- const normalizedAsyncComponentMap = /* @__PURE__ */ new Map();
9640
+ const normalizedAsyncComponentMap = /* @__PURE__ */ new WeakMap();
9647
9641
  function convertLegacyAsyncComponent(comp) {
9648
9642
  if (normalizedAsyncComponentMap.has(comp)) {
9649
9643
  return normalizedAsyncComponentMap.get(comp);
@@ -10351,9 +10345,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
10351
10345
  if (!skipOptions) {
10352
10346
  setCurrentInstance(instance);
10353
10347
  pauseTracking();
10354
- applyOptions(instance);
10355
- resetTracking();
10356
- unsetCurrentInstance();
10348
+ try {
10349
+ applyOptions(instance);
10350
+ } finally {
10351
+ resetTracking();
10352
+ unsetCurrentInstance();
10353
+ }
10357
10354
  }
10358
10355
  if (!Component.render && instance.render === NOOP && !isSSR) {
10359
10356
  if (!compile && Component.template) {
@@ -10719,7 +10716,7 @@ function isMemoSame(cached, memo) {
10719
10716
  return true;
10720
10717
  }
10721
10718
 
10722
- const version = "3.3.4";
10719
+ const version = "3.3.6";
10723
10720
  const ssrUtils = null;
10724
10721
  const resolveFilter = resolveFilter$1 ;
10725
10722
  const _compatUtils = {
@@ -10798,934 +10795,989 @@ const nodeOps = {
10798
10795
  }
10799
10796
  };
10800
10797
 
10801
- function patchClass(el, value, isSVG) {
10802
- const transitionClasses = el._vtc;
10803
- if (transitionClasses) {
10804
- value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
10805
- }
10806
- if (value == null) {
10807
- el.removeAttribute("class");
10808
- } else if (isSVG) {
10809
- el.setAttribute("class", value);
10810
- } else {
10811
- el.className = value;
10812
- }
10798
+ const TRANSITION = "transition";
10799
+ const ANIMATION = "animation";
10800
+ const vtcKey = Symbol("_vtc");
10801
+ const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
10802
+ Transition.displayName = "Transition";
10803
+ {
10804
+ Transition.__isBuiltIn = true;
10813
10805
  }
10814
-
10815
- function patchStyle(el, prev, next) {
10816
- const style = el.style;
10817
- const isCssString = isString(next);
10818
- if (next && !isCssString) {
10819
- if (prev && !isString(prev)) {
10820
- for (const key in prev) {
10821
- if (next[key] == null) {
10822
- setStyle(style, key, "");
10823
- }
10824
- }
10825
- }
10826
- for (const key in next) {
10827
- setStyle(style, key, next[key]);
10828
- }
10829
- } else {
10830
- const currentDisplay = style.display;
10831
- if (isCssString) {
10832
- if (prev !== next) {
10833
- style.cssText = next;
10834
- }
10835
- } else if (prev) {
10836
- el.removeAttribute("style");
10837
- }
10838
- if ("_vod" in el) {
10839
- style.display = currentDisplay;
10840
- }
10806
+ const DOMTransitionPropsValidators = {
10807
+ name: String,
10808
+ type: String,
10809
+ css: {
10810
+ type: Boolean,
10811
+ default: true
10812
+ },
10813
+ duration: [String, Number, Object],
10814
+ enterFromClass: String,
10815
+ enterActiveClass: String,
10816
+ enterToClass: String,
10817
+ appearFromClass: String,
10818
+ appearActiveClass: String,
10819
+ appearToClass: String,
10820
+ leaveFromClass: String,
10821
+ leaveActiveClass: String,
10822
+ leaveToClass: String
10823
+ };
10824
+ const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
10825
+ {},
10826
+ BaseTransitionPropsValidators,
10827
+ DOMTransitionPropsValidators
10828
+ );
10829
+ const callHook = (hook, args = []) => {
10830
+ if (isArray(hook)) {
10831
+ hook.forEach((h2) => h2(...args));
10832
+ } else if (hook) {
10833
+ hook(...args);
10841
10834
  }
10842
- }
10843
- const semicolonRE = /[^\\];\s*$/;
10844
- const importantRE = /\s*!important$/;
10845
- function setStyle(style, name, val) {
10846
- if (isArray(val)) {
10847
- val.forEach((v) => setStyle(style, name, v));
10848
- } else {
10849
- if (val == null)
10850
- val = "";
10851
- {
10852
- if (semicolonRE.test(val)) {
10853
- warn(
10854
- `Unexpected semicolon at the end of '${name}' style value: '${val}'`
10855
- );
10856
- }
10857
- }
10858
- if (name.startsWith("--")) {
10859
- style.setProperty(name, val);
10860
- } else {
10861
- const prefixed = autoPrefix(style, name);
10862
- if (importantRE.test(val)) {
10863
- style.setProperty(
10864
- hyphenate(prefixed),
10865
- val.replace(importantRE, ""),
10866
- "important"
10867
- );
10868
- } else {
10869
- style[prefixed] = val;
10870
- }
10835
+ };
10836
+ const hasExplicitCallback = (hook) => {
10837
+ return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
10838
+ };
10839
+ function resolveTransitionProps(rawProps) {
10840
+ const baseProps = {};
10841
+ for (const key in rawProps) {
10842
+ if (!(key in DOMTransitionPropsValidators)) {
10843
+ baseProps[key] = rawProps[key];
10871
10844
  }
10872
10845
  }
10873
- }
10874
- const prefixes = ["Webkit", "Moz", "ms"];
10875
- const prefixCache = {};
10876
- function autoPrefix(style, rawName) {
10877
- const cached = prefixCache[rawName];
10878
- if (cached) {
10879
- return cached;
10880
- }
10881
- let name = camelize(rawName);
10882
- if (name !== "filter" && name in style) {
10883
- return prefixCache[rawName] = name;
10884
- }
10885
- name = capitalize(name);
10886
- for (let i = 0; i < prefixes.length; i++) {
10887
- const prefixed = prefixes[i] + name;
10888
- if (prefixed in style) {
10889
- return prefixCache[rawName] = prefixed;
10890
- }
10846
+ if (rawProps.css === false) {
10847
+ return baseProps;
10891
10848
  }
10892
- return rawName;
10893
- }
10894
-
10895
- const xlinkNS = "http://www.w3.org/1999/xlink";
10896
- function patchAttr(el, key, value, isSVG, instance) {
10897
- if (isSVG && key.startsWith("xlink:")) {
10898
- if (value == null) {
10899
- el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
10900
- } else {
10901
- el.setAttributeNS(xlinkNS, key, value);
10849
+ const {
10850
+ name = "v",
10851
+ type,
10852
+ duration,
10853
+ enterFromClass = `${name}-enter-from`,
10854
+ enterActiveClass = `${name}-enter-active`,
10855
+ enterToClass = `${name}-enter-to`,
10856
+ appearFromClass = enterFromClass,
10857
+ appearActiveClass = enterActiveClass,
10858
+ appearToClass = enterToClass,
10859
+ leaveFromClass = `${name}-leave-from`,
10860
+ leaveActiveClass = `${name}-leave-active`,
10861
+ leaveToClass = `${name}-leave-to`
10862
+ } = rawProps;
10863
+ const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES", null);
10864
+ let legacyEnterFromClass;
10865
+ let legacyAppearFromClass;
10866
+ let legacyLeaveFromClass;
10867
+ if (legacyClassEnabled) {
10868
+ const toLegacyClass = (cls) => cls.replace(/-from$/, "");
10869
+ if (!rawProps.enterFromClass) {
10870
+ legacyEnterFromClass = toLegacyClass(enterFromClass);
10902
10871
  }
10903
- } else {
10904
- if (compatCoerceAttr(el, key, value, instance)) {
10905
- return;
10872
+ if (!rawProps.appearFromClass) {
10873
+ legacyAppearFromClass = toLegacyClass(appearFromClass);
10906
10874
  }
10907
- const isBoolean = isSpecialBooleanAttr(key);
10908
- if (value == null || isBoolean && !includeBooleanAttr(value)) {
10909
- el.removeAttribute(key);
10910
- } else {
10911
- el.setAttribute(key, isBoolean ? "" : value);
10875
+ if (!rawProps.leaveFromClass) {
10876
+ legacyLeaveFromClass = toLegacyClass(leaveFromClass);
10912
10877
  }
10913
10878
  }
10914
- }
10915
- const isEnumeratedAttr = /* @__PURE__ */ makeMap("contenteditable,draggable,spellcheck") ;
10916
- function compatCoerceAttr(el, key, value, instance = null) {
10917
- if (isEnumeratedAttr(key)) {
10918
- const v2CoercedValue = value === null ? "false" : typeof value !== "boolean" && value !== void 0 ? "true" : null;
10919
- if (v2CoercedValue && compatUtils.softAssertCompatEnabled(
10920
- "ATTR_ENUMERATED_COERCION",
10921
- instance,
10922
- key,
10923
- value,
10924
- v2CoercedValue
10925
- )) {
10926
- el.setAttribute(key, v2CoercedValue);
10927
- return true;
10928
- }
10929
- } else if (value === false && !isSpecialBooleanAttr(key) && compatUtils.softAssertCompatEnabled(
10930
- "ATTR_FALSE_VALUE",
10931
- instance,
10932
- key
10933
- )) {
10934
- el.removeAttribute(key);
10935
- return true;
10936
- }
10937
- return false;
10938
- }
10939
-
10940
- function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
10941
- if (key === "innerHTML" || key === "textContent") {
10942
- if (prevChildren) {
10943
- unmountChildren(prevChildren, parentComponent, parentSuspense);
10944
- }
10945
- el[key] = value == null ? "" : value;
10946
- return;
10947
- }
10948
- const tag = el.tagName;
10949
- if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
10950
- !tag.includes("-")) {
10951
- el._value = value;
10952
- const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
10953
- const newValue = value == null ? "" : value;
10954
- if (oldValue !== newValue) {
10955
- el.value = newValue;
10956
- }
10957
- if (value == null) {
10958
- el.removeAttribute(key);
10959
- }
10960
- return;
10961
- }
10962
- let needRemove = false;
10963
- if (value === "" || value == null) {
10964
- const type = typeof el[key];
10965
- if (type === "boolean") {
10966
- value = includeBooleanAttr(value);
10967
- } else if (value == null && type === "string") {
10968
- value = "";
10969
- needRemove = true;
10970
- } else if (type === "number") {
10971
- value = 0;
10972
- needRemove = true;
10973
- }
10974
- } else {
10975
- if (value === false && compatUtils.isCompatEnabled(
10976
- "ATTR_FALSE_VALUE",
10977
- parentComponent
10978
- )) {
10979
- const type = typeof el[key];
10980
- if (type === "string" || type === "number") {
10981
- compatUtils.warnDeprecation(
10982
- "ATTR_FALSE_VALUE",
10983
- parentComponent,
10984
- key
10985
- );
10986
- value = type === "number" ? 0 : "";
10987
- needRemove = true;
10879
+ const durations = normalizeDuration(duration);
10880
+ const enterDuration = durations && durations[0];
10881
+ const leaveDuration = durations && durations[1];
10882
+ const {
10883
+ onBeforeEnter,
10884
+ onEnter,
10885
+ onEnterCancelled,
10886
+ onLeave,
10887
+ onLeaveCancelled,
10888
+ onBeforeAppear = onBeforeEnter,
10889
+ onAppear = onEnter,
10890
+ onAppearCancelled = onEnterCancelled
10891
+ } = baseProps;
10892
+ const finishEnter = (el, isAppear, done) => {
10893
+ removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
10894
+ removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
10895
+ done && done();
10896
+ };
10897
+ const finishLeave = (el, done) => {
10898
+ el._isLeaving = false;
10899
+ removeTransitionClass(el, leaveFromClass);
10900
+ removeTransitionClass(el, leaveToClass);
10901
+ removeTransitionClass(el, leaveActiveClass);
10902
+ done && done();
10903
+ };
10904
+ const makeEnterHook = (isAppear) => {
10905
+ return (el, done) => {
10906
+ const hook = isAppear ? onAppear : onEnter;
10907
+ const resolve = () => finishEnter(el, isAppear, done);
10908
+ callHook(hook, [el, resolve]);
10909
+ nextFrame(() => {
10910
+ removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
10911
+ if (legacyClassEnabled) {
10912
+ const legacyClass = isAppear ? legacyAppearFromClass : legacyEnterFromClass;
10913
+ if (legacyClass) {
10914
+ removeTransitionClass(el, legacyClass);
10915
+ }
10916
+ }
10917
+ addTransitionClass(el, isAppear ? appearToClass : enterToClass);
10918
+ if (!hasExplicitCallback(hook)) {
10919
+ whenTransitionEnds(el, type, enterDuration, resolve);
10920
+ }
10921
+ });
10922
+ };
10923
+ };
10924
+ return extend(baseProps, {
10925
+ onBeforeEnter(el) {
10926
+ callHook(onBeforeEnter, [el]);
10927
+ addTransitionClass(el, enterFromClass);
10928
+ if (legacyClassEnabled && legacyEnterFromClass) {
10929
+ addTransitionClass(el, legacyEnterFromClass);
10988
10930
  }
10931
+ addTransitionClass(el, enterActiveClass);
10932
+ },
10933
+ onBeforeAppear(el) {
10934
+ callHook(onBeforeAppear, [el]);
10935
+ addTransitionClass(el, appearFromClass);
10936
+ if (legacyClassEnabled && legacyAppearFromClass) {
10937
+ addTransitionClass(el, legacyAppearFromClass);
10938
+ }
10939
+ addTransitionClass(el, appearActiveClass);
10940
+ },
10941
+ onEnter: makeEnterHook(false),
10942
+ onAppear: makeEnterHook(true),
10943
+ onLeave(el, done) {
10944
+ el._isLeaving = true;
10945
+ const resolve = () => finishLeave(el, done);
10946
+ addTransitionClass(el, leaveFromClass);
10947
+ if (legacyClassEnabled && legacyLeaveFromClass) {
10948
+ addTransitionClass(el, legacyLeaveFromClass);
10949
+ }
10950
+ forceReflow();
10951
+ addTransitionClass(el, leaveActiveClass);
10952
+ nextFrame(() => {
10953
+ if (!el._isLeaving) {
10954
+ return;
10955
+ }
10956
+ removeTransitionClass(el, leaveFromClass);
10957
+ if (legacyClassEnabled && legacyLeaveFromClass) {
10958
+ removeTransitionClass(el, legacyLeaveFromClass);
10959
+ }
10960
+ addTransitionClass(el, leaveToClass);
10961
+ if (!hasExplicitCallback(onLeave)) {
10962
+ whenTransitionEnds(el, type, leaveDuration, resolve);
10963
+ }
10964
+ });
10965
+ callHook(onLeave, [el, resolve]);
10966
+ },
10967
+ onEnterCancelled(el) {
10968
+ finishEnter(el, false);
10969
+ callHook(onEnterCancelled, [el]);
10970
+ },
10971
+ onAppearCancelled(el) {
10972
+ finishEnter(el, true);
10973
+ callHook(onAppearCancelled, [el]);
10974
+ },
10975
+ onLeaveCancelled(el) {
10976
+ finishLeave(el);
10977
+ callHook(onLeaveCancelled, [el]);
10989
10978
  }
10979
+ });
10980
+ }
10981
+ function normalizeDuration(duration) {
10982
+ if (duration == null) {
10983
+ return null;
10984
+ } else if (isObject(duration)) {
10985
+ return [NumberOf(duration.enter), NumberOf(duration.leave)];
10986
+ } else {
10987
+ const n = NumberOf(duration);
10988
+ return [n, n];
10990
10989
  }
10991
- try {
10992
- el[key] = value;
10993
- } catch (e) {
10994
- if (!needRemove) {
10995
- warn(
10996
- `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
10997
- e
10998
- );
10999
- }
11000
- }
11001
- needRemove && el.removeAttribute(key);
11002
10990
  }
11003
-
11004
- function addEventListener(el, event, handler, options) {
11005
- el.addEventListener(event, handler, options);
10991
+ function NumberOf(val) {
10992
+ const res = toNumber(val);
10993
+ {
10994
+ assertNumber(res, "<transition> explicit duration");
10995
+ }
10996
+ return res;
11006
10997
  }
11007
- function removeEventListener(el, event, handler, options) {
11008
- el.removeEventListener(event, handler, options);
10998
+ function addTransitionClass(el, cls) {
10999
+ cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
11000
+ (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
11009
11001
  }
11010
- function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
11011
- const invokers = el._vei || (el._vei = {});
11012
- const existingInvoker = invokers[rawName];
11013
- if (nextValue && existingInvoker) {
11014
- existingInvoker.value = nextValue;
11015
- } else {
11016
- const [name, options] = parseName(rawName);
11017
- if (nextValue) {
11018
- const invoker = invokers[rawName] = createInvoker(nextValue, instance);
11019
- addEventListener(el, name, invoker, options);
11020
- } else if (existingInvoker) {
11021
- removeEventListener(el, name, existingInvoker, options);
11022
- invokers[rawName] = void 0;
11002
+ function removeTransitionClass(el, cls) {
11003
+ cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
11004
+ const _vtc = el[vtcKey];
11005
+ if (_vtc) {
11006
+ _vtc.delete(cls);
11007
+ if (!_vtc.size) {
11008
+ el[vtcKey] = void 0;
11023
11009
  }
11024
11010
  }
11025
11011
  }
11026
- const optionsModifierRE = /(?:Once|Passive|Capture)$/;
11027
- function parseName(name) {
11028
- let options;
11029
- if (optionsModifierRE.test(name)) {
11030
- options = {};
11031
- let m;
11032
- while (m = name.match(optionsModifierRE)) {
11033
- name = name.slice(0, name.length - m[0].length);
11034
- options[m[0].toLowerCase()] = true;
11012
+ function nextFrame(cb) {
11013
+ requestAnimationFrame(() => {
11014
+ requestAnimationFrame(cb);
11015
+ });
11016
+ }
11017
+ let endId = 0;
11018
+ function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
11019
+ const id = el._endId = ++endId;
11020
+ const resolveIfNotStale = () => {
11021
+ if (id === el._endId) {
11022
+ resolve();
11035
11023
  }
11024
+ };
11025
+ if (explicitTimeout) {
11026
+ return setTimeout(resolveIfNotStale, explicitTimeout);
11036
11027
  }
11037
- const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
11038
- return [event, options];
11039
- }
11040
- let cachedNow = 0;
11041
- const p = /* @__PURE__ */ Promise.resolve();
11042
- const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
11043
- function createInvoker(initialValue, instance) {
11044
- const invoker = (e) => {
11045
- if (!e._vts) {
11046
- e._vts = Date.now();
11047
- } else if (e._vts <= invoker.attached) {
11048
- return;
11028
+ const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
11029
+ if (!type) {
11030
+ return resolve();
11031
+ }
11032
+ const endEvent = type + "end";
11033
+ let ended = 0;
11034
+ const end = () => {
11035
+ el.removeEventListener(endEvent, onEnd);
11036
+ resolveIfNotStale();
11037
+ };
11038
+ const onEnd = (e) => {
11039
+ if (e.target === el && ++ended >= propCount) {
11040
+ end();
11049
11041
  }
11050
- callWithAsyncErrorHandling(
11051
- patchStopImmediatePropagation(e, invoker.value),
11052
- instance,
11053
- 5,
11054
- [e]
11055
- );
11056
11042
  };
11057
- invoker.value = initialValue;
11058
- invoker.attached = getNow();
11059
- return invoker;
11043
+ setTimeout(() => {
11044
+ if (ended < propCount) {
11045
+ end();
11046
+ }
11047
+ }, timeout + 1);
11048
+ el.addEventListener(endEvent, onEnd);
11060
11049
  }
11061
- function patchStopImmediatePropagation(e, value) {
11062
- if (isArray(value)) {
11063
- const originalStop = e.stopImmediatePropagation;
11064
- e.stopImmediatePropagation = () => {
11065
- originalStop.call(e);
11066
- e._stopped = true;
11067
- };
11068
- return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
11050
+ function getTransitionInfo(el, expectedType) {
11051
+ const styles = window.getComputedStyle(el);
11052
+ const getStyleProperties = (key) => (styles[key] || "").split(", ");
11053
+ const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
11054
+ const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
11055
+ const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
11056
+ const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
11057
+ const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
11058
+ const animationTimeout = getTimeout(animationDelays, animationDurations);
11059
+ let type = null;
11060
+ let timeout = 0;
11061
+ let propCount = 0;
11062
+ if (expectedType === TRANSITION) {
11063
+ if (transitionTimeout > 0) {
11064
+ type = TRANSITION;
11065
+ timeout = transitionTimeout;
11066
+ propCount = transitionDurations.length;
11067
+ }
11068
+ } else if (expectedType === ANIMATION) {
11069
+ if (animationTimeout > 0) {
11070
+ type = ANIMATION;
11071
+ timeout = animationTimeout;
11072
+ propCount = animationDurations.length;
11073
+ }
11069
11074
  } else {
11070
- return value;
11075
+ timeout = Math.max(transitionTimeout, animationTimeout);
11076
+ type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
11077
+ propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
11078
+ }
11079
+ const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
11080
+ getStyleProperties(`${TRANSITION}Property`).toString()
11081
+ );
11082
+ return {
11083
+ type,
11084
+ timeout,
11085
+ propCount,
11086
+ hasTransform
11087
+ };
11088
+ }
11089
+ function getTimeout(delays, durations) {
11090
+ while (delays.length < durations.length) {
11091
+ delays = delays.concat(delays);
11071
11092
  }
11093
+ return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
11094
+ }
11095
+ function toMs(s) {
11096
+ if (s === "auto")
11097
+ return 0;
11098
+ return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
11099
+ }
11100
+ function forceReflow() {
11101
+ return document.body.offsetHeight;
11072
11102
  }
11073
11103
 
11074
- const nativeOnRE = /^on[a-z]/;
11075
- const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11076
- if (key === "class") {
11077
- patchClass(el, nextValue, isSVG);
11078
- } else if (key === "style") {
11079
- patchStyle(el, prevValue, nextValue);
11080
- } else if (isOn(key)) {
11081
- if (!isModelListener(key)) {
11082
- patchEvent(el, key, prevValue, nextValue, parentComponent);
11083
- }
11084
- } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
11085
- patchDOMProp(
11086
- el,
11087
- key,
11088
- nextValue,
11089
- prevChildren,
11090
- parentComponent,
11091
- parentSuspense,
11092
- unmountChildren
11093
- );
11104
+ function patchClass(el, value, isSVG) {
11105
+ const transitionClasses = el[vtcKey];
11106
+ if (transitionClasses) {
11107
+ value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
11108
+ }
11109
+ if (value == null) {
11110
+ el.removeAttribute("class");
11111
+ } else if (isSVG) {
11112
+ el.setAttribute("class", value);
11094
11113
  } else {
11095
- if (key === "true-value") {
11096
- el._trueValue = nextValue;
11097
- } else if (key === "false-value") {
11098
- el._falseValue = nextValue;
11099
- }
11100
- patchAttr(el, key, nextValue, isSVG, parentComponent);
11114
+ el.className = value;
11101
11115
  }
11102
- };
11103
- function shouldSetAsProp(el, key, value, isSVG) {
11104
- if (isSVG) {
11105
- if (key === "innerHTML" || key === "textContent") {
11106
- return true;
11116
+ }
11117
+
11118
+ const vShowOldKey = Symbol("_vod");
11119
+ const vShow = {
11120
+ beforeMount(el, { value }, { transition }) {
11121
+ el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display;
11122
+ if (transition && value) {
11123
+ transition.beforeEnter(el);
11124
+ } else {
11125
+ setDisplay(el, value);
11107
11126
  }
11108
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
11109
- return true;
11127
+ },
11128
+ mounted(el, { value }, { transition }) {
11129
+ if (transition && value) {
11130
+ transition.enter(el);
11110
11131
  }
11111
- return false;
11112
- }
11113
- if (key === "spellcheck" || key === "draggable" || key === "translate") {
11114
- return false;
11115
- }
11116
- if (key === "form") {
11117
- return false;
11118
- }
11119
- if (key === "list" && el.tagName === "INPUT") {
11120
- return false;
11121
- }
11122
- if (key === "type" && el.tagName === "TEXTAREA") {
11123
- return false;
11124
- }
11125
- if (nativeOnRE.test(key) && isString(value)) {
11126
- return false;
11132
+ },
11133
+ updated(el, { value, oldValue }, { transition }) {
11134
+ if (!value === !oldValue)
11135
+ return;
11136
+ if (transition) {
11137
+ if (value) {
11138
+ transition.beforeEnter(el);
11139
+ setDisplay(el, true);
11140
+ transition.enter(el);
11141
+ } else {
11142
+ transition.leave(el, () => {
11143
+ setDisplay(el, false);
11144
+ });
11145
+ }
11146
+ } else {
11147
+ setDisplay(el, value);
11148
+ }
11149
+ },
11150
+ beforeUnmount(el, { value }) {
11151
+ setDisplay(el, value);
11127
11152
  }
11128
- return key in el;
11153
+ };
11154
+ function setDisplay(el, value) {
11155
+ el.style.display = value ? el[vShowOldKey] : "none";
11129
11156
  }
11130
11157
 
11131
- function defineCustomElement(options, hydrate2) {
11132
- const Comp = defineComponent(options);
11133
- class VueCustomElement extends VueElement {
11134
- constructor(initialProps) {
11135
- super(Comp, initialProps, hydrate2);
11158
+ function patchStyle(el, prev, next) {
11159
+ const style = el.style;
11160
+ const isCssString = isString(next);
11161
+ if (next && !isCssString) {
11162
+ if (prev && !isString(prev)) {
11163
+ for (const key in prev) {
11164
+ if (next[key] == null) {
11165
+ setStyle(style, key, "");
11166
+ }
11167
+ }
11168
+ }
11169
+ for (const key in next) {
11170
+ setStyle(style, key, next[key]);
11171
+ }
11172
+ } else {
11173
+ const currentDisplay = style.display;
11174
+ if (isCssString) {
11175
+ if (prev !== next) {
11176
+ style.cssText = next;
11177
+ }
11178
+ } else if (prev) {
11179
+ el.removeAttribute("style");
11180
+ }
11181
+ if (vShowOldKey in el) {
11182
+ style.display = currentDisplay;
11136
11183
  }
11137
11184
  }
11138
- VueCustomElement.def = Comp;
11139
- return VueCustomElement;
11140
11185
  }
11141
- const defineSSRCustomElement = (options) => {
11142
- return defineCustomElement(options, hydrate);
11143
- };
11144
- const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
11145
- };
11146
- class VueElement extends BaseClass {
11147
- constructor(_def, _props = {}, hydrate2) {
11148
- super();
11149
- this._def = _def;
11150
- this._props = _props;
11151
- /**
11152
- * @internal
11153
- */
11154
- this._instance = null;
11155
- this._connected = false;
11156
- this._resolved = false;
11157
- this._numberProps = null;
11158
- if (this.shadowRoot && hydrate2) {
11159
- hydrate2(this._createVNode(), this.shadowRoot);
11160
- } else {
11161
- if (this.shadowRoot) {
11186
+ const semicolonRE = /[^\\];\s*$/;
11187
+ const importantRE = /\s*!important$/;
11188
+ function setStyle(style, name, val) {
11189
+ if (isArray(val)) {
11190
+ val.forEach((v) => setStyle(style, name, v));
11191
+ } else {
11192
+ if (val == null)
11193
+ val = "";
11194
+ {
11195
+ if (semicolonRE.test(val)) {
11162
11196
  warn(
11163
- `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
11197
+ `Unexpected semicolon at the end of '${name}' style value: '${val}'`
11164
11198
  );
11165
11199
  }
11166
- this.attachShadow({ mode: "open" });
11167
- if (!this._def.__asyncLoader) {
11168
- this._resolveProps(this._def);
11169
- }
11170
11200
  }
11171
- }
11172
- connectedCallback() {
11173
- this._connected = true;
11174
- if (!this._instance) {
11175
- if (this._resolved) {
11176
- this._update();
11201
+ if (name.startsWith("--")) {
11202
+ style.setProperty(name, val);
11203
+ } else {
11204
+ const prefixed = autoPrefix(style, name);
11205
+ if (importantRE.test(val)) {
11206
+ style.setProperty(
11207
+ hyphenate(prefixed),
11208
+ val.replace(importantRE, ""),
11209
+ "important"
11210
+ );
11177
11211
  } else {
11178
- this._resolveDef();
11212
+ style[prefixed] = val;
11179
11213
  }
11180
11214
  }
11181
11215
  }
11182
- disconnectedCallback() {
11183
- this._connected = false;
11184
- nextTick(() => {
11185
- if (!this._connected) {
11186
- render(null, this.shadowRoot);
11187
- this._instance = null;
11188
- }
11189
- });
11216
+ }
11217
+ const prefixes = ["Webkit", "Moz", "ms"];
11218
+ const prefixCache = {};
11219
+ function autoPrefix(style, rawName) {
11220
+ const cached = prefixCache[rawName];
11221
+ if (cached) {
11222
+ return cached;
11190
11223
  }
11191
- /**
11192
- * resolve inner component definition (handle possible async component)
11193
- */
11194
- _resolveDef() {
11195
- this._resolved = true;
11196
- for (let i = 0; i < this.attributes.length; i++) {
11197
- this._setAttr(this.attributes[i].name);
11224
+ let name = camelize(rawName);
11225
+ if (name !== "filter" && name in style) {
11226
+ return prefixCache[rawName] = name;
11227
+ }
11228
+ name = capitalize(name);
11229
+ for (let i = 0; i < prefixes.length; i++) {
11230
+ const prefixed = prefixes[i] + name;
11231
+ if (prefixed in style) {
11232
+ return prefixCache[rawName] = prefixed;
11198
11233
  }
11199
- new MutationObserver((mutations) => {
11200
- for (const m of mutations) {
11201
- this._setAttr(m.attributeName);
11202
- }
11203
- }).observe(this, { attributes: true });
11204
- const resolve = (def, isAsync = false) => {
11205
- const { props, styles } = def;
11206
- let numberProps;
11207
- if (props && !isArray(props)) {
11208
- for (const key in props) {
11209
- const opt = props[key];
11210
- if (opt === Number || opt && opt.type === Number) {
11211
- if (key in this._props) {
11212
- this._props[key] = toNumber(this._props[key]);
11213
- }
11214
- (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
11215
- }
11216
- }
11217
- }
11218
- this._numberProps = numberProps;
11219
- if (isAsync) {
11220
- this._resolveProps(def);
11221
- }
11222
- this._applyStyles(styles);
11223
- this._update();
11224
- };
11225
- const asyncDef = this._def.__asyncLoader;
11226
- if (asyncDef) {
11227
- asyncDef().then((def) => resolve(def, true));
11234
+ }
11235
+ return rawName;
11236
+ }
11237
+
11238
+ const xlinkNS = "http://www.w3.org/1999/xlink";
11239
+ function patchAttr(el, key, value, isSVG, instance) {
11240
+ if (isSVG && key.startsWith("xlink:")) {
11241
+ if (value == null) {
11242
+ el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
11228
11243
  } else {
11229
- resolve(this._def);
11244
+ el.setAttributeNS(xlinkNS, key, value);
11230
11245
  }
11231
- }
11232
- _resolveProps(def) {
11233
- const { props } = def;
11234
- const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
11235
- for (const key of Object.keys(this)) {
11236
- if (key[0] !== "_" && declaredPropKeys.includes(key)) {
11237
- this._setProp(key, this[key], true, false);
11238
- }
11246
+ } else {
11247
+ if (compatCoerceAttr(el, key, value, instance)) {
11248
+ return;
11239
11249
  }
11240
- for (const key of declaredPropKeys.map(camelize)) {
11241
- Object.defineProperty(this, key, {
11242
- get() {
11243
- return this._getProp(key);
11244
- },
11245
- set(val) {
11246
- this._setProp(key, val);
11247
- }
11248
- });
11250
+ const isBoolean = isSpecialBooleanAttr(key);
11251
+ if (value == null || isBoolean && !includeBooleanAttr(value)) {
11252
+ el.removeAttribute(key);
11253
+ } else {
11254
+ el.setAttribute(key, isBoolean ? "" : value);
11249
11255
  }
11250
11256
  }
11251
- _setAttr(key) {
11252
- let value = this.getAttribute(key);
11253
- const camelKey = camelize(key);
11254
- if (this._numberProps && this._numberProps[camelKey]) {
11255
- value = toNumber(value);
11257
+ }
11258
+ const isEnumeratedAttr = /* @__PURE__ */ makeMap("contenteditable,draggable,spellcheck") ;
11259
+ function compatCoerceAttr(el, key, value, instance = null) {
11260
+ if (isEnumeratedAttr(key)) {
11261
+ const v2CoercedValue = value === null ? "false" : typeof value !== "boolean" && value !== void 0 ? "true" : null;
11262
+ if (v2CoercedValue && compatUtils.softAssertCompatEnabled(
11263
+ "ATTR_ENUMERATED_COERCION",
11264
+ instance,
11265
+ key,
11266
+ value,
11267
+ v2CoercedValue
11268
+ )) {
11269
+ el.setAttribute(key, v2CoercedValue);
11270
+ return true;
11256
11271
  }
11257
- this._setProp(camelKey, value, false);
11258
- }
11259
- /**
11260
- * @internal
11261
- */
11262
- _getProp(key) {
11263
- return this._props[key];
11272
+ } else if (value === false && !isSpecialBooleanAttr(key) && compatUtils.softAssertCompatEnabled(
11273
+ "ATTR_FALSE_VALUE",
11274
+ instance,
11275
+ key
11276
+ )) {
11277
+ el.removeAttribute(key);
11278
+ return true;
11264
11279
  }
11265
- /**
11266
- * @internal
11267
- */
11268
- _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
11269
- if (val !== this._props[key]) {
11270
- this._props[key] = val;
11271
- if (shouldUpdate && this._instance) {
11272
- this._update();
11273
- }
11274
- if (shouldReflect) {
11275
- if (val === true) {
11276
- this.setAttribute(hyphenate(key), "");
11277
- } else if (typeof val === "string" || typeof val === "number") {
11278
- this.setAttribute(hyphenate(key), val + "");
11279
- } else if (!val) {
11280
- this.removeAttribute(hyphenate(key));
11281
- }
11282
- }
11280
+ return false;
11281
+ }
11282
+
11283
+ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
11284
+ if (key === "innerHTML" || key === "textContent") {
11285
+ if (prevChildren) {
11286
+ unmountChildren(prevChildren, parentComponent, parentSuspense);
11283
11287
  }
11288
+ el[key] = value == null ? "" : value;
11289
+ return;
11284
11290
  }
11285
- _update() {
11286
- render(this._createVNode(), this.shadowRoot);
11291
+ const tag = el.tagName;
11292
+ if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
11293
+ !tag.includes("-")) {
11294
+ el._value = value;
11295
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
11296
+ const newValue = value == null ? "" : value;
11297
+ if (oldValue !== newValue) {
11298
+ el.value = newValue;
11299
+ }
11300
+ if (value == null) {
11301
+ el.removeAttribute(key);
11302
+ }
11303
+ return;
11287
11304
  }
11288
- _createVNode() {
11289
- const vnode = createVNode(this._def, extend({}, this._props));
11290
- if (!this._instance) {
11291
- vnode.ce = (instance) => {
11292
- this._instance = instance;
11293
- instance.isCE = true;
11294
- {
11295
- instance.ceReload = (newStyles) => {
11296
- if (this._styles) {
11297
- this._styles.forEach((s) => this.shadowRoot.removeChild(s));
11298
- this._styles.length = 0;
11299
- }
11300
- this._applyStyles(newStyles);
11301
- this._instance = null;
11302
- this._update();
11303
- };
11304
- }
11305
- const dispatch = (event, args) => {
11306
- this.dispatchEvent(
11307
- new CustomEvent(event, {
11308
- detail: args
11309
- })
11310
- );
11311
- };
11312
- instance.emit = (event, ...args) => {
11313
- dispatch(event, args);
11314
- if (hyphenate(event) !== event) {
11315
- dispatch(hyphenate(event), args);
11316
- }
11317
- };
11318
- let parent = this;
11319
- while (parent = parent && (parent.parentNode || parent.host)) {
11320
- if (parent instanceof VueElement) {
11321
- instance.parent = parent._instance;
11322
- instance.provides = parent._instance.provides;
11323
- break;
11324
- }
11325
- }
11326
- };
11305
+ let needRemove = false;
11306
+ if (value === "" || value == null) {
11307
+ const type = typeof el[key];
11308
+ if (type === "boolean") {
11309
+ value = includeBooleanAttr(value);
11310
+ } else if (value == null && type === "string") {
11311
+ value = "";
11312
+ needRemove = true;
11313
+ } else if (type === "number") {
11314
+ value = 0;
11315
+ needRemove = true;
11316
+ }
11317
+ } else {
11318
+ if (value === false && compatUtils.isCompatEnabled(
11319
+ "ATTR_FALSE_VALUE",
11320
+ parentComponent
11321
+ )) {
11322
+ const type = typeof el[key];
11323
+ if (type === "string" || type === "number") {
11324
+ compatUtils.warnDeprecation(
11325
+ "ATTR_FALSE_VALUE",
11326
+ parentComponent,
11327
+ key
11328
+ );
11329
+ value = type === "number" ? 0 : "";
11330
+ needRemove = true;
11331
+ }
11327
11332
  }
11328
- return vnode;
11329
11333
  }
11330
- _applyStyles(styles) {
11331
- if (styles) {
11332
- styles.forEach((css) => {
11333
- const s = document.createElement("style");
11334
- s.textContent = css;
11335
- this.shadowRoot.appendChild(s);
11336
- {
11337
- (this._styles || (this._styles = [])).push(s);
11338
- }
11339
- });
11334
+ try {
11335
+ el[key] = value;
11336
+ } catch (e) {
11337
+ if (!needRemove) {
11338
+ warn(
11339
+ `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
11340
+ e
11341
+ );
11340
11342
  }
11341
11343
  }
11344
+ needRemove && el.removeAttribute(key);
11342
11345
  }
11343
11346
 
11344
- function useCssModule(name = "$style") {
11345
- {
11346
- const instance = getCurrentInstance();
11347
- if (!instance) {
11348
- warn(`useCssModule must be called inside setup()`);
11349
- return EMPTY_OBJ;
11347
+ function addEventListener(el, event, handler, options) {
11348
+ el.addEventListener(event, handler, options);
11349
+ }
11350
+ function removeEventListener(el, event, handler, options) {
11351
+ el.removeEventListener(event, handler, options);
11352
+ }
11353
+ const veiKey = Symbol("_vei");
11354
+ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
11355
+ const invokers = el[veiKey] || (el[veiKey] = {});
11356
+ const existingInvoker = invokers[rawName];
11357
+ if (nextValue && existingInvoker) {
11358
+ existingInvoker.value = nextValue;
11359
+ } else {
11360
+ const [name, options] = parseName(rawName);
11361
+ if (nextValue) {
11362
+ const invoker = invokers[rawName] = createInvoker(nextValue, instance);
11363
+ addEventListener(el, name, invoker, options);
11364
+ } else if (existingInvoker) {
11365
+ removeEventListener(el, name, existingInvoker, options);
11366
+ invokers[rawName] = void 0;
11350
11367
  }
11351
- const modules = instance.type.__cssModules;
11352
- if (!modules) {
11353
- warn(`Current instance does not have CSS modules injected.`);
11354
- return EMPTY_OBJ;
11368
+ }
11369
+ }
11370
+ const optionsModifierRE = /(?:Once|Passive|Capture)$/;
11371
+ function parseName(name) {
11372
+ let options;
11373
+ if (optionsModifierRE.test(name)) {
11374
+ options = {};
11375
+ let m;
11376
+ while (m = name.match(optionsModifierRE)) {
11377
+ name = name.slice(0, name.length - m[0].length);
11378
+ options[m[0].toLowerCase()] = true;
11355
11379
  }
11356
- const mod = modules[name];
11357
- if (!mod) {
11358
- warn(`Current instance does not have CSS module named "${name}".`);
11359
- return EMPTY_OBJ;
11380
+ }
11381
+ const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
11382
+ return [event, options];
11383
+ }
11384
+ let cachedNow = 0;
11385
+ const p = /* @__PURE__ */ Promise.resolve();
11386
+ const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
11387
+ function createInvoker(initialValue, instance) {
11388
+ const invoker = (e) => {
11389
+ if (!e._vts) {
11390
+ e._vts = Date.now();
11391
+ } else if (e._vts <= invoker.attached) {
11392
+ return;
11360
11393
  }
11361
- return mod;
11394
+ callWithAsyncErrorHandling(
11395
+ patchStopImmediatePropagation(e, invoker.value),
11396
+ instance,
11397
+ 5,
11398
+ [e]
11399
+ );
11400
+ };
11401
+ invoker.value = initialValue;
11402
+ invoker.attached = getNow();
11403
+ return invoker;
11404
+ }
11405
+ function patchStopImmediatePropagation(e, value) {
11406
+ if (isArray(value)) {
11407
+ const originalStop = e.stopImmediatePropagation;
11408
+ e.stopImmediatePropagation = () => {
11409
+ originalStop.call(e);
11410
+ e._stopped = true;
11411
+ };
11412
+ return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
11413
+ } else {
11414
+ return value;
11362
11415
  }
11363
11416
  }
11364
11417
 
11365
- function useCssVars(getter) {
11366
- const instance = getCurrentInstance();
11367
- if (!instance) {
11368
- warn(`useCssVars is called without current active component instance.`);
11369
- return;
11418
+ const nativeOnRE = /^on[a-z]/;
11419
+ const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11420
+ if (key === "class") {
11421
+ patchClass(el, nextValue, isSVG);
11422
+ } else if (key === "style") {
11423
+ patchStyle(el, prevValue, nextValue);
11424
+ } else if (isOn(key)) {
11425
+ if (!isModelListener(key)) {
11426
+ patchEvent(el, key, prevValue, nextValue, parentComponent);
11427
+ }
11428
+ } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
11429
+ patchDOMProp(
11430
+ el,
11431
+ key,
11432
+ nextValue,
11433
+ prevChildren,
11434
+ parentComponent,
11435
+ parentSuspense,
11436
+ unmountChildren
11437
+ );
11438
+ } else {
11439
+ if (key === "true-value") {
11440
+ el._trueValue = nextValue;
11441
+ } else if (key === "false-value") {
11442
+ el._falseValue = nextValue;
11443
+ }
11444
+ patchAttr(el, key, nextValue, isSVG, parentComponent);
11370
11445
  }
11371
- const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
11372
- Array.from(
11373
- document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
11374
- ).forEach((node) => setVarsOnNode(node, vars));
11375
- };
11376
- const setVars = () => {
11377
- const vars = getter(instance.proxy);
11378
- setVarsOnVNode(instance.subTree, vars);
11379
- updateTeleports(vars);
11380
- };
11381
- watchPostEffect(setVars);
11382
- onMounted(() => {
11383
- const ob = new MutationObserver(setVars);
11384
- ob.observe(instance.subTree.el.parentNode, { childList: true });
11385
- onUnmounted(() => ob.disconnect());
11386
- });
11387
- }
11388
- function setVarsOnVNode(vnode, vars) {
11389
- if (vnode.shapeFlag & 128) {
11390
- const suspense = vnode.suspense;
11391
- vnode = suspense.activeBranch;
11392
- if (suspense.pendingBranch && !suspense.isHydrating) {
11393
- suspense.effects.push(() => {
11394
- setVarsOnVNode(suspense.activeBranch, vars);
11395
- });
11446
+ };
11447
+ function shouldSetAsProp(el, key, value, isSVG) {
11448
+ if (isSVG) {
11449
+ if (key === "innerHTML" || key === "textContent") {
11450
+ return true;
11451
+ }
11452
+ if (key in el && nativeOnRE.test(key) && isFunction(value)) {
11453
+ return true;
11396
11454
  }
11455
+ return false;
11397
11456
  }
11398
- while (vnode.component) {
11399
- vnode = vnode.component.subTree;
11457
+ if (key === "spellcheck" || key === "draggable" || key === "translate") {
11458
+ return false;
11400
11459
  }
11401
- if (vnode.shapeFlag & 1 && vnode.el) {
11402
- setVarsOnNode(vnode.el, vars);
11403
- } else if (vnode.type === Fragment) {
11404
- vnode.children.forEach((c) => setVarsOnVNode(c, vars));
11405
- } else if (vnode.type === Static) {
11406
- let { el, anchor } = vnode;
11407
- while (el) {
11408
- setVarsOnNode(el, vars);
11409
- if (el === anchor)
11410
- break;
11411
- el = el.nextSibling;
11412
- }
11460
+ if (key === "form") {
11461
+ return false;
11413
11462
  }
11414
- }
11415
- function setVarsOnNode(el, vars) {
11416
- if (el.nodeType === 1) {
11417
- const style = el.style;
11418
- for (const key in vars) {
11419
- style.setProperty(`--${key}`, vars[key]);
11420
- }
11463
+ if (key === "list" && el.tagName === "INPUT") {
11464
+ return false;
11465
+ }
11466
+ if (key === "type" && el.tagName === "TEXTAREA") {
11467
+ return false;
11468
+ }
11469
+ if (nativeOnRE.test(key) && isString(value)) {
11470
+ return false;
11421
11471
  }
11472
+ return key in el;
11422
11473
  }
11423
11474
 
11424
- const TRANSITION = "transition";
11425
- const ANIMATION = "animation";
11426
- const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
11427
- Transition.displayName = "Transition";
11428
- {
11429
- Transition.__isBuiltIn = true;
11430
- }
11431
- const DOMTransitionPropsValidators = {
11432
- name: String,
11433
- type: String,
11434
- css: {
11435
- type: Boolean,
11436
- default: true
11437
- },
11438
- duration: [String, Number, Object],
11439
- enterFromClass: String,
11440
- enterActiveClass: String,
11441
- enterToClass: String,
11442
- appearFromClass: String,
11443
- appearActiveClass: String,
11444
- appearToClass: String,
11445
- leaveFromClass: String,
11446
- leaveActiveClass: String,
11447
- leaveToClass: String
11448
- };
11449
- const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
11450
- {},
11451
- BaseTransitionPropsValidators,
11452
- DOMTransitionPropsValidators
11453
- );
11454
- const callHook = (hook, args = []) => {
11455
- if (isArray(hook)) {
11456
- hook.forEach((h2) => h2(...args));
11457
- } else if (hook) {
11458
- hook(...args);
11475
+ /*! #__NO_SIDE_EFFECTS__ */
11476
+ // @__NO_SIDE_EFFECTS__
11477
+ function defineCustomElement(options, hydrate2) {
11478
+ const Comp = defineComponent(options);
11479
+ class VueCustomElement extends VueElement {
11480
+ constructor(initialProps) {
11481
+ super(Comp, initialProps, hydrate2);
11482
+ }
11459
11483
  }
11484
+ VueCustomElement.def = Comp;
11485
+ return VueCustomElement;
11486
+ }
11487
+ /*! #__NO_SIDE_EFFECTS__ */
11488
+ const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options) => {
11489
+ return /* @__PURE__ */ defineCustomElement(options, hydrate);
11460
11490
  };
11461
- const hasExplicitCallback = (hook) => {
11462
- return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
11491
+ const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
11463
11492
  };
11464
- function resolveTransitionProps(rawProps) {
11465
- const baseProps = {};
11466
- for (const key in rawProps) {
11467
- if (!(key in DOMTransitionPropsValidators)) {
11468
- baseProps[key] = rawProps[key];
11493
+ class VueElement extends BaseClass {
11494
+ constructor(_def, _props = {}, hydrate2) {
11495
+ super();
11496
+ this._def = _def;
11497
+ this._props = _props;
11498
+ /**
11499
+ * @internal
11500
+ */
11501
+ this._instance = null;
11502
+ this._connected = false;
11503
+ this._resolved = false;
11504
+ this._numberProps = null;
11505
+ this._ob = null;
11506
+ if (this.shadowRoot && hydrate2) {
11507
+ hydrate2(this._createVNode(), this.shadowRoot);
11508
+ } else {
11509
+ if (this.shadowRoot) {
11510
+ warn(
11511
+ `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
11512
+ );
11513
+ }
11514
+ this.attachShadow({ mode: "open" });
11515
+ if (!this._def.__asyncLoader) {
11516
+ this._resolveProps(this._def);
11517
+ }
11469
11518
  }
11470
11519
  }
11471
- if (rawProps.css === false) {
11472
- return baseProps;
11473
- }
11474
- const {
11475
- name = "v",
11476
- type,
11477
- duration,
11478
- enterFromClass = `${name}-enter-from`,
11479
- enterActiveClass = `${name}-enter-active`,
11480
- enterToClass = `${name}-enter-to`,
11481
- appearFromClass = enterFromClass,
11482
- appearActiveClass = enterActiveClass,
11483
- appearToClass = enterToClass,
11484
- leaveFromClass = `${name}-leave-from`,
11485
- leaveActiveClass = `${name}-leave-active`,
11486
- leaveToClass = `${name}-leave-to`
11487
- } = rawProps;
11488
- const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES", null);
11489
- let legacyEnterFromClass;
11490
- let legacyAppearFromClass;
11491
- let legacyLeaveFromClass;
11492
- if (legacyClassEnabled) {
11493
- const toLegacyClass = (cls) => cls.replace(/-from$/, "");
11494
- if (!rawProps.enterFromClass) {
11495
- legacyEnterFromClass = toLegacyClass(enterFromClass);
11496
- }
11497
- if (!rawProps.appearFromClass) {
11498
- legacyAppearFromClass = toLegacyClass(appearFromClass);
11520
+ connectedCallback() {
11521
+ this._connected = true;
11522
+ if (!this._instance) {
11523
+ if (this._resolved) {
11524
+ this._update();
11525
+ } else {
11526
+ this._resolveDef();
11527
+ }
11499
11528
  }
11500
- if (!rawProps.leaveFromClass) {
11501
- legacyLeaveFromClass = toLegacyClass(leaveFromClass);
11529
+ }
11530
+ disconnectedCallback() {
11531
+ this._connected = false;
11532
+ if (this._ob) {
11533
+ this._ob.disconnect();
11534
+ this._ob = null;
11502
11535
  }
11536
+ nextTick(() => {
11537
+ if (!this._connected) {
11538
+ render(null, this.shadowRoot);
11539
+ this._instance = null;
11540
+ }
11541
+ });
11503
11542
  }
11504
- const durations = normalizeDuration(duration);
11505
- const enterDuration = durations && durations[0];
11506
- const leaveDuration = durations && durations[1];
11507
- const {
11508
- onBeforeEnter,
11509
- onEnter,
11510
- onEnterCancelled,
11511
- onLeave,
11512
- onLeaveCancelled,
11513
- onBeforeAppear = onBeforeEnter,
11514
- onAppear = onEnter,
11515
- onAppearCancelled = onEnterCancelled
11516
- } = baseProps;
11517
- const finishEnter = (el, isAppear, done) => {
11518
- removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
11519
- removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
11520
- done && done();
11521
- };
11522
- const finishLeave = (el, done) => {
11523
- el._isLeaving = false;
11524
- removeTransitionClass(el, leaveFromClass);
11525
- removeTransitionClass(el, leaveToClass);
11526
- removeTransitionClass(el, leaveActiveClass);
11527
- done && done();
11528
- };
11529
- const makeEnterHook = (isAppear) => {
11530
- return (el, done) => {
11531
- const hook = isAppear ? onAppear : onEnter;
11532
- const resolve = () => finishEnter(el, isAppear, done);
11533
- callHook(hook, [el, resolve]);
11534
- nextFrame(() => {
11535
- removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
11536
- if (legacyClassEnabled) {
11537
- const legacyClass = isAppear ? legacyAppearFromClass : legacyEnterFromClass;
11538
- if (legacyClass) {
11539
- removeTransitionClass(el, legacyClass);
11543
+ /**
11544
+ * resolve inner component definition (handle possible async component)
11545
+ */
11546
+ _resolveDef() {
11547
+ this._resolved = true;
11548
+ for (let i = 0; i < this.attributes.length; i++) {
11549
+ this._setAttr(this.attributes[i].name);
11550
+ }
11551
+ this._ob = new MutationObserver((mutations) => {
11552
+ for (const m of mutations) {
11553
+ this._setAttr(m.attributeName);
11554
+ }
11555
+ });
11556
+ this._ob.observe(this, { attributes: true });
11557
+ const resolve = (def, isAsync = false) => {
11558
+ const { props, styles } = def;
11559
+ let numberProps;
11560
+ if (props && !isArray(props)) {
11561
+ for (const key in props) {
11562
+ const opt = props[key];
11563
+ if (opt === Number || opt && opt.type === Number) {
11564
+ if (key in this._props) {
11565
+ this._props[key] = toNumber(this._props[key]);
11566
+ }
11567
+ (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
11540
11568
  }
11541
11569
  }
11542
- addTransitionClass(el, isAppear ? appearToClass : enterToClass);
11543
- if (!hasExplicitCallback(hook)) {
11544
- whenTransitionEnds(el, type, enterDuration, resolve);
11545
- }
11546
- });
11547
- };
11548
- };
11549
- return extend(baseProps, {
11550
- onBeforeEnter(el) {
11551
- callHook(onBeforeEnter, [el]);
11552
- addTransitionClass(el, enterFromClass);
11553
- if (legacyClassEnabled && legacyEnterFromClass) {
11554
- addTransitionClass(el, legacyEnterFromClass);
11555
11570
  }
11556
- addTransitionClass(el, enterActiveClass);
11557
- },
11558
- onBeforeAppear(el) {
11559
- callHook(onBeforeAppear, [el]);
11560
- addTransitionClass(el, appearFromClass);
11561
- if (legacyClassEnabled && legacyAppearFromClass) {
11562
- addTransitionClass(el, legacyAppearFromClass);
11571
+ this._numberProps = numberProps;
11572
+ if (isAsync) {
11573
+ this._resolveProps(def);
11563
11574
  }
11564
- addTransitionClass(el, appearActiveClass);
11565
- },
11566
- onEnter: makeEnterHook(false),
11567
- onAppear: makeEnterHook(true),
11568
- onLeave(el, done) {
11569
- el._isLeaving = true;
11570
- const resolve = () => finishLeave(el, done);
11571
- addTransitionClass(el, leaveFromClass);
11572
- if (legacyClassEnabled && legacyLeaveFromClass) {
11573
- addTransitionClass(el, legacyLeaveFromClass);
11575
+ this._applyStyles(styles);
11576
+ this._update();
11577
+ };
11578
+ const asyncDef = this._def.__asyncLoader;
11579
+ if (asyncDef) {
11580
+ asyncDef().then((def) => resolve(def, true));
11581
+ } else {
11582
+ resolve(this._def);
11583
+ }
11584
+ }
11585
+ _resolveProps(def) {
11586
+ const { props } = def;
11587
+ const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
11588
+ for (const key of Object.keys(this)) {
11589
+ if (key[0] !== "_" && declaredPropKeys.includes(key)) {
11590
+ this._setProp(key, this[key], true, false);
11574
11591
  }
11575
- forceReflow();
11576
- addTransitionClass(el, leaveActiveClass);
11577
- nextFrame(() => {
11578
- if (!el._isLeaving) {
11579
- return;
11592
+ }
11593
+ for (const key of declaredPropKeys.map(camelize)) {
11594
+ Object.defineProperty(this, key, {
11595
+ get() {
11596
+ return this._getProp(key);
11597
+ },
11598
+ set(val) {
11599
+ this._setProp(key, val);
11580
11600
  }
11581
- removeTransitionClass(el, leaveFromClass);
11582
- if (legacyClassEnabled && legacyLeaveFromClass) {
11583
- removeTransitionClass(el, legacyLeaveFromClass);
11601
+ });
11602
+ }
11603
+ }
11604
+ _setAttr(key) {
11605
+ let value = this.getAttribute(key);
11606
+ const camelKey = camelize(key);
11607
+ if (this._numberProps && this._numberProps[camelKey]) {
11608
+ value = toNumber(value);
11609
+ }
11610
+ this._setProp(camelKey, value, false);
11611
+ }
11612
+ /**
11613
+ * @internal
11614
+ */
11615
+ _getProp(key) {
11616
+ return this._props[key];
11617
+ }
11618
+ /**
11619
+ * @internal
11620
+ */
11621
+ _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
11622
+ if (val !== this._props[key]) {
11623
+ this._props[key] = val;
11624
+ if (shouldUpdate && this._instance) {
11625
+ this._update();
11626
+ }
11627
+ if (shouldReflect) {
11628
+ if (val === true) {
11629
+ this.setAttribute(hyphenate(key), "");
11630
+ } else if (typeof val === "string" || typeof val === "number") {
11631
+ this.setAttribute(hyphenate(key), val + "");
11632
+ } else if (!val) {
11633
+ this.removeAttribute(hyphenate(key));
11634
+ }
11635
+ }
11636
+ }
11637
+ }
11638
+ _update() {
11639
+ render(this._createVNode(), this.shadowRoot);
11640
+ }
11641
+ _createVNode() {
11642
+ const vnode = createVNode(this._def, extend({}, this._props));
11643
+ if (!this._instance) {
11644
+ vnode.ce = (instance) => {
11645
+ this._instance = instance;
11646
+ instance.isCE = true;
11647
+ {
11648
+ instance.ceReload = (newStyles) => {
11649
+ if (this._styles) {
11650
+ this._styles.forEach((s) => this.shadowRoot.removeChild(s));
11651
+ this._styles.length = 0;
11652
+ }
11653
+ this._applyStyles(newStyles);
11654
+ this._instance = null;
11655
+ this._update();
11656
+ };
11584
11657
  }
11585
- addTransitionClass(el, leaveToClass);
11586
- if (!hasExplicitCallback(onLeave)) {
11587
- whenTransitionEnds(el, type, leaveDuration, resolve);
11658
+ const dispatch = (event, args) => {
11659
+ this.dispatchEvent(
11660
+ new CustomEvent(event, {
11661
+ detail: args
11662
+ })
11663
+ );
11664
+ };
11665
+ instance.emit = (event, ...args) => {
11666
+ dispatch(event, args);
11667
+ if (hyphenate(event) !== event) {
11668
+ dispatch(hyphenate(event), args);
11669
+ }
11670
+ };
11671
+ let parent = this;
11672
+ while (parent = parent && (parent.parentNode || parent.host)) {
11673
+ if (parent instanceof VueElement) {
11674
+ instance.parent = parent._instance;
11675
+ instance.provides = parent._instance.provides;
11676
+ break;
11677
+ }
11678
+ }
11679
+ };
11680
+ }
11681
+ return vnode;
11682
+ }
11683
+ _applyStyles(styles) {
11684
+ if (styles) {
11685
+ styles.forEach((css) => {
11686
+ const s = document.createElement("style");
11687
+ s.textContent = css;
11688
+ this.shadowRoot.appendChild(s);
11689
+ {
11690
+ (this._styles || (this._styles = [])).push(s);
11588
11691
  }
11589
11692
  });
11590
- callHook(onLeave, [el, resolve]);
11591
- },
11592
- onEnterCancelled(el) {
11593
- finishEnter(el, false);
11594
- callHook(onEnterCancelled, [el]);
11595
- },
11596
- onAppearCancelled(el) {
11597
- finishEnter(el, true);
11598
- callHook(onAppearCancelled, [el]);
11599
- },
11600
- onLeaveCancelled(el) {
11601
- finishLeave(el);
11602
- callHook(onLeaveCancelled, [el]);
11603
11693
  }
11604
- });
11605
- }
11606
- function normalizeDuration(duration) {
11607
- if (duration == null) {
11608
- return null;
11609
- } else if (isObject(duration)) {
11610
- return [NumberOf(duration.enter), NumberOf(duration.leave)];
11611
- } else {
11612
- const n = NumberOf(duration);
11613
- return [n, n];
11614
11694
  }
11615
11695
  }
11616
- function NumberOf(val) {
11617
- const res = toNumber(val);
11696
+
11697
+ function useCssModule(name = "$style") {
11618
11698
  {
11619
- assertNumber(res, "<transition> explicit duration");
11620
- }
11621
- return res;
11622
- }
11623
- function addTransitionClass(el, cls) {
11624
- cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
11625
- (el._vtc || (el._vtc = /* @__PURE__ */ new Set())).add(cls);
11626
- }
11627
- function removeTransitionClass(el, cls) {
11628
- cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
11629
- const { _vtc } = el;
11630
- if (_vtc) {
11631
- _vtc.delete(cls);
11632
- if (!_vtc.size) {
11633
- el._vtc = void 0;
11699
+ const instance = getCurrentInstance();
11700
+ if (!instance) {
11701
+ warn(`useCssModule must be called inside setup()`);
11702
+ return EMPTY_OBJ;
11634
11703
  }
11635
- }
11636
- }
11637
- function nextFrame(cb) {
11638
- requestAnimationFrame(() => {
11639
- requestAnimationFrame(cb);
11640
- });
11641
- }
11642
- let endId = 0;
11643
- function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
11644
- const id = el._endId = ++endId;
11645
- const resolveIfNotStale = () => {
11646
- if (id === el._endId) {
11647
- resolve();
11704
+ const modules = instance.type.__cssModules;
11705
+ if (!modules) {
11706
+ warn(`Current instance does not have CSS modules injected.`);
11707
+ return EMPTY_OBJ;
11648
11708
  }
11649
- };
11650
- if (explicitTimeout) {
11651
- return setTimeout(resolveIfNotStale, explicitTimeout);
11709
+ const mod = modules[name];
11710
+ if (!mod) {
11711
+ warn(`Current instance does not have CSS module named "${name}".`);
11712
+ return EMPTY_OBJ;
11713
+ }
11714
+ return mod;
11652
11715
  }
11653
- const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
11654
- if (!type) {
11655
- return resolve();
11716
+ }
11717
+
11718
+ function useCssVars(getter) {
11719
+ const instance = getCurrentInstance();
11720
+ if (!instance) {
11721
+ warn(`useCssVars is called without current active component instance.`);
11722
+ return;
11656
11723
  }
11657
- const endEvent = type + "end";
11658
- let ended = 0;
11659
- const end = () => {
11660
- el.removeEventListener(endEvent, onEnd);
11661
- resolveIfNotStale();
11724
+ const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
11725
+ Array.from(
11726
+ document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
11727
+ ).forEach((node) => setVarsOnNode(node, vars));
11662
11728
  };
11663
- const onEnd = (e) => {
11664
- if (e.target === el && ++ended >= propCount) {
11665
- end();
11666
- }
11729
+ const setVars = () => {
11730
+ const vars = getter(instance.proxy);
11731
+ setVarsOnVNode(instance.subTree, vars);
11732
+ updateTeleports(vars);
11667
11733
  };
11668
- setTimeout(() => {
11669
- if (ended < propCount) {
11670
- end();
11671
- }
11672
- }, timeout + 1);
11673
- el.addEventListener(endEvent, onEnd);
11734
+ watchPostEffect(setVars);
11735
+ onMounted(() => {
11736
+ const ob = new MutationObserver(setVars);
11737
+ ob.observe(instance.subTree.el.parentNode, { childList: true });
11738
+ onUnmounted(() => ob.disconnect());
11739
+ });
11674
11740
  }
11675
- function getTransitionInfo(el, expectedType) {
11676
- const styles = window.getComputedStyle(el);
11677
- const getStyleProperties = (key) => (styles[key] || "").split(", ");
11678
- const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
11679
- const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
11680
- const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
11681
- const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
11682
- const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
11683
- const animationTimeout = getTimeout(animationDelays, animationDurations);
11684
- let type = null;
11685
- let timeout = 0;
11686
- let propCount = 0;
11687
- if (expectedType === TRANSITION) {
11688
- if (transitionTimeout > 0) {
11689
- type = TRANSITION;
11690
- timeout = transitionTimeout;
11691
- propCount = transitionDurations.length;
11741
+ function setVarsOnVNode(vnode, vars) {
11742
+ if (vnode.shapeFlag & 128) {
11743
+ const suspense = vnode.suspense;
11744
+ vnode = suspense.activeBranch;
11745
+ if (suspense.pendingBranch && !suspense.isHydrating) {
11746
+ suspense.effects.push(() => {
11747
+ setVarsOnVNode(suspense.activeBranch, vars);
11748
+ });
11692
11749
  }
11693
- } else if (expectedType === ANIMATION) {
11694
- if (animationTimeout > 0) {
11695
- type = ANIMATION;
11696
- timeout = animationTimeout;
11697
- propCount = animationDurations.length;
11750
+ }
11751
+ while (vnode.component) {
11752
+ vnode = vnode.component.subTree;
11753
+ }
11754
+ if (vnode.shapeFlag & 1 && vnode.el) {
11755
+ setVarsOnNode(vnode.el, vars);
11756
+ } else if (vnode.type === Fragment) {
11757
+ vnode.children.forEach((c) => setVarsOnVNode(c, vars));
11758
+ } else if (vnode.type === Static) {
11759
+ let { el, anchor } = vnode;
11760
+ while (el) {
11761
+ setVarsOnNode(el, vars);
11762
+ if (el === anchor)
11763
+ break;
11764
+ el = el.nextSibling;
11698
11765
  }
11699
- } else {
11700
- timeout = Math.max(transitionTimeout, animationTimeout);
11701
- type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
11702
- propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
11703
11766
  }
11704
- const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
11705
- getStyleProperties(`${TRANSITION}Property`).toString()
11706
- );
11707
- return {
11708
- type,
11709
- timeout,
11710
- propCount,
11711
- hasTransform
11712
- };
11713
11767
  }
11714
- function getTimeout(delays, durations) {
11715
- while (delays.length < durations.length) {
11716
- delays = delays.concat(delays);
11768
+ function setVarsOnNode(el, vars) {
11769
+ if (el.nodeType === 1) {
11770
+ const style = el.style;
11771
+ for (const key in vars) {
11772
+ style.setProperty(`--${key}`, vars[key]);
11773
+ }
11717
11774
  }
11718
- return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
11719
- }
11720
- function toMs(s) {
11721
- return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
11722
- }
11723
- function forceReflow() {
11724
- return document.body.offsetHeight;
11725
11775
  }
11726
11776
 
11727
11777
  const positionMap = /* @__PURE__ */ new WeakMap();
11728
11778
  const newPositionMap = /* @__PURE__ */ new WeakMap();
11779
+ const moveCbKey = Symbol("_moveCb");
11780
+ const enterCbKey = Symbol("_enterCb");
11729
11781
  const TransitionGroupImpl = {
11730
11782
  name: "TransitionGroup",
11731
11783
  props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
@@ -11758,13 +11810,13 @@ const TransitionGroupImpl = {
11758
11810
  const style = el.style;
11759
11811
  addTransitionClass(el, moveClass);
11760
11812
  style.transform = style.webkitTransform = style.transitionDuration = "";
11761
- const cb = el._moveCb = (e) => {
11813
+ const cb = el[moveCbKey] = (e) => {
11762
11814
  if (e && e.target !== el) {
11763
11815
  return;
11764
11816
  }
11765
11817
  if (!e || /transform$/.test(e.propertyName)) {
11766
11818
  el.removeEventListener("transitionend", cb);
11767
- el._moveCb = null;
11819
+ el[moveCbKey] = null;
11768
11820
  removeTransitionClass(el, moveClass);
11769
11821
  }
11770
11822
  };
@@ -11816,11 +11868,11 @@ const removeMode = (props) => delete props.mode;
11816
11868
  const TransitionGroup = TransitionGroupImpl;
11817
11869
  function callPendingCbs(c) {
11818
11870
  const el = c.el;
11819
- if (el._moveCb) {
11820
- el._moveCb();
11871
+ if (el[moveCbKey]) {
11872
+ el[moveCbKey]();
11821
11873
  }
11822
- if (el._enterCb) {
11823
- el._enterCb();
11874
+ if (el[enterCbKey]) {
11875
+ el[enterCbKey]();
11824
11876
  }
11825
11877
  }
11826
11878
  function recordPosition(c) {
@@ -11840,8 +11892,9 @@ function applyTranslation(c) {
11840
11892
  }
11841
11893
  function hasCSSTransform(el, root, moveClass) {
11842
11894
  const clone = el.cloneNode();
11843
- if (el._vtc) {
11844
- el._vtc.forEach((cls) => {
11895
+ const _vtc = el[vtcKey];
11896
+ if (_vtc) {
11897
+ _vtc.forEach((cls) => {
11845
11898
  cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
11846
11899
  });
11847
11900
  }
@@ -11868,9 +11921,10 @@ function onCompositionEnd(e) {
11868
11921
  target.dispatchEvent(new Event("input"));
11869
11922
  }
11870
11923
  }
11924
+ const assignKey = Symbol("_assign");
11871
11925
  const vModelText = {
11872
11926
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
11873
- el._assign = getModelAssigner(vnode);
11927
+ el[assignKey] = getModelAssigner(vnode);
11874
11928
  const castToNumber = number || vnode.props && vnode.props.type === "number";
11875
11929
  addEventListener(el, lazy ? "change" : "input", (e) => {
11876
11930
  if (e.target.composing)
@@ -11882,7 +11936,7 @@ const vModelText = {
11882
11936
  if (castToNumber) {
11883
11937
  domValue = looseToNumber(domValue);
11884
11938
  }
11885
- el._assign(domValue);
11939
+ el[assignKey](domValue);
11886
11940
  });
11887
11941
  if (trim) {
11888
11942
  addEventListener(el, "change", () => {
@@ -11900,7 +11954,7 @@ const vModelText = {
11900
11954
  el.value = value == null ? "" : value;
11901
11955
  },
11902
11956
  beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {
11903
- el._assign = getModelAssigner(vnode);
11957
+ el[assignKey] = getModelAssigner(vnode);
11904
11958
  if (el.composing)
11905
11959
  return;
11906
11960
  if (document.activeElement === el && el.type !== "range") {
@@ -11924,12 +11978,12 @@ const vModelCheckbox = {
11924
11978
  // #4096 array checkboxes need to be deep traversed
11925
11979
  deep: true,
11926
11980
  created(el, _, vnode) {
11927
- el._assign = getModelAssigner(vnode);
11981
+ el[assignKey] = getModelAssigner(vnode);
11928
11982
  addEventListener(el, "change", () => {
11929
11983
  const modelValue = el._modelValue;
11930
11984
  const elementValue = getValue(el);
11931
11985
  const checked = el.checked;
11932
- const assign = el._assign;
11986
+ const assign = el[assignKey];
11933
11987
  if (isArray(modelValue)) {
11934
11988
  const index = looseIndexOf(modelValue, elementValue);
11935
11989
  const found = index !== -1;
@@ -11956,7 +12010,7 @@ const vModelCheckbox = {
11956
12010
  // set initial checked on mount to wait for true-value/false-value
11957
12011
  mounted: setChecked,
11958
12012
  beforeUpdate(el, binding, vnode) {
11959
- el._assign = getModelAssigner(vnode);
12013
+ el[assignKey] = getModelAssigner(vnode);
11960
12014
  setChecked(el, binding, vnode);
11961
12015
  }
11962
12016
  };
@@ -11973,13 +12027,13 @@ function setChecked(el, { value, oldValue }, vnode) {
11973
12027
  const vModelRadio = {
11974
12028
  created(el, { value }, vnode) {
11975
12029
  el.checked = looseEqual(value, vnode.props.value);
11976
- el._assign = getModelAssigner(vnode);
12030
+ el[assignKey] = getModelAssigner(vnode);
11977
12031
  addEventListener(el, "change", () => {
11978
- el._assign(getValue(el));
12032
+ el[assignKey](getValue(el));
11979
12033
  });
11980
12034
  },
11981
12035
  beforeUpdate(el, { value, oldValue }, vnode) {
11982
- el._assign = getModelAssigner(vnode);
12036
+ el[assignKey] = getModelAssigner(vnode);
11983
12037
  if (value !== oldValue) {
11984
12038
  el.checked = looseEqual(value, vnode.props.value);
11985
12039
  }
@@ -11994,11 +12048,11 @@ const vModelSelect = {
11994
12048
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
11995
12049
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
11996
12050
  );
11997
- el._assign(
12051
+ el[assignKey](
11998
12052
  el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
11999
12053
  );
12000
12054
  });
12001
- el._assign = getModelAssigner(vnode);
12055
+ el[assignKey] = getModelAssigner(vnode);
12002
12056
  },
12003
12057
  // set value in mounted & updated because <select> relies on its children
12004
12058
  // <option>s.
@@ -12006,7 +12060,7 @@ const vModelSelect = {
12006
12060
  setSelected(el, value);
12007
12061
  },
12008
12062
  beforeUpdate(el, _binding, vnode) {
12009
- el._assign = getModelAssigner(vnode);
12063
+ el[assignKey] = getModelAssigner(vnode);
12010
12064
  },
12011
12065
  updated(el, { value }) {
12012
12066
  setSelected(el, value);
@@ -12169,45 +12223,6 @@ const withKeys = (fn, modifiers) => {
12169
12223
  };
12170
12224
  };
12171
12225
 
12172
- const vShow = {
12173
- beforeMount(el, { value }, { transition }) {
12174
- el._vod = el.style.display === "none" ? "" : el.style.display;
12175
- if (transition && value) {
12176
- transition.beforeEnter(el);
12177
- } else {
12178
- setDisplay(el, value);
12179
- }
12180
- },
12181
- mounted(el, { value }, { transition }) {
12182
- if (transition && value) {
12183
- transition.enter(el);
12184
- }
12185
- },
12186
- updated(el, { value, oldValue }, { transition }) {
12187
- if (!value === !oldValue)
12188
- return;
12189
- if (transition) {
12190
- if (value) {
12191
- transition.beforeEnter(el);
12192
- setDisplay(el, true);
12193
- transition.enter(el);
12194
- } else {
12195
- transition.leave(el, () => {
12196
- setDisplay(el, false);
12197
- });
12198
- }
12199
- } else {
12200
- setDisplay(el, value);
12201
- }
12202
- },
12203
- beforeUnmount(el, { value }) {
12204
- setDisplay(el, value);
12205
- }
12206
- };
12207
- function setDisplay(el, value) {
12208
- el.style.display = value ? el._vod : "none";
12209
- }
12210
-
12211
12226
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
12212
12227
  let renderer;
12213
12228
  let enabledHydration = false;