vue 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++) {
@@ -120,8 +121,8 @@ const slotFlagsText = {
120
121
  [3]: "FORWARDED"
121
122
  };
122
123
 
123
- 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";
124
- const isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
124
+ 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";
125
+ const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
125
126
 
126
127
  const range = 2;
127
128
  function generateCodeFrame(source, start = 0, end = source.length) {
@@ -176,9 +177,7 @@ function normalizeStyle(value) {
176
177
  }
177
178
  }
178
179
  return res;
179
- } else if (isString(value)) {
180
- return value;
181
- } else if (isObject(value)) {
180
+ } else if (isString(value) || isObject(value)) {
182
181
  return value;
183
182
  }
184
183
  }
@@ -527,7 +526,7 @@ function cleanupEffect(effect2) {
527
526
  }
528
527
  }
529
528
  function effect(fn, options) {
530
- if (fn.effect) {
529
+ if (fn.effect instanceof ReactiveEffect) {
531
530
  fn = fn.effect.fn;
532
531
  }
533
532
  const _effect = new ReactiveEffect(fn);
@@ -693,10 +692,6 @@ const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`
693
692
  const builtInSymbols = new Set(
694
693
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
695
694
  );
696
- const get$1 = /* @__PURE__ */ createGetter();
697
- const shallowGet = /* @__PURE__ */ createGetter(false, true);
698
- const readonlyGet = /* @__PURE__ */ createGetter(true);
699
- const shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
700
695
  const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
701
696
  function createArrayInstrumentations() {
702
697
  const instrumentations = {};
@@ -729,8 +724,13 @@ function hasOwnProperty(key) {
729
724
  track(obj, "has", key);
730
725
  return obj.hasOwnProperty(key);
731
726
  }
732
- function createGetter(isReadonly2 = false, shallow = false) {
733
- return function get2(target, key, receiver) {
727
+ class BaseReactiveHandler {
728
+ constructor(_isReadonly = false, _shallow = false) {
729
+ this._isReadonly = _isReadonly;
730
+ this._shallow = _shallow;
731
+ }
732
+ get(target, key, receiver) {
733
+ const isReadonly2 = this._isReadonly, shallow = this._shallow;
734
734
  if (key === "__v_isReactive") {
735
735
  return !isReadonly2;
736
736
  } else if (key === "__v_isReadonly") {
@@ -766,17 +766,18 @@ function createGetter(isReadonly2 = false, shallow = false) {
766
766
  return isReadonly2 ? readonly(res) : reactive(res);
767
767
  }
768
768
  return res;
769
- };
769
+ }
770
770
  }
771
- const set$1 = /* @__PURE__ */ createSetter();
772
- const shallowSet = /* @__PURE__ */ createSetter(true);
773
- function createSetter(shallow = false) {
774
- return function set2(target, key, value, receiver) {
771
+ class MutableReactiveHandler extends BaseReactiveHandler {
772
+ constructor(shallow = false) {
773
+ super(false, shallow);
774
+ }
775
+ set(target, key, value, receiver) {
775
776
  let oldValue = target[key];
776
777
  if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
777
778
  return false;
778
779
  }
779
- if (!shallow) {
780
+ if (!this._shallow) {
780
781
  if (!isShallow(value) && !isReadonly(value)) {
781
782
  oldValue = toRaw(oldValue);
782
783
  value = toRaw(value);
@@ -796,37 +797,36 @@ function createSetter(shallow = false) {
796
797
  }
797
798
  }
798
799
  return result;
799
- };
800
- }
801
- function deleteProperty(target, key) {
802
- const hadKey = hasOwn(target, key);
803
- const oldValue = target[key];
804
- const result = Reflect.deleteProperty(target, key);
805
- if (result && hadKey) {
806
- trigger(target, "delete", key, void 0, oldValue);
807
800
  }
808
- return result;
809
- }
810
- function has$1(target, key) {
811
- const result = Reflect.has(target, key);
812
- if (!isSymbol(key) || !builtInSymbols.has(key)) {
813
- track(target, "has", key);
801
+ deleteProperty(target, key) {
802
+ const hadKey = hasOwn(target, key);
803
+ const oldValue = target[key];
804
+ const result = Reflect.deleteProperty(target, key);
805
+ if (result && hadKey) {
806
+ trigger(target, "delete", key, void 0, oldValue);
807
+ }
808
+ return result;
809
+ }
810
+ has(target, key) {
811
+ const result = Reflect.has(target, key);
812
+ if (!isSymbol(key) || !builtInSymbols.has(key)) {
813
+ track(target, "has", key);
814
+ }
815
+ return result;
816
+ }
817
+ ownKeys(target) {
818
+ track(
819
+ target,
820
+ "iterate",
821
+ isArray(target) ? "length" : ITERATE_KEY
822
+ );
823
+ return Reflect.ownKeys(target);
814
824
  }
815
- return result;
816
- }
817
- function ownKeys(target) {
818
- track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY);
819
- return Reflect.ownKeys(target);
820
825
  }
821
- const mutableHandlers = {
822
- get: get$1,
823
- set: set$1,
824
- deleteProperty,
825
- has: has$1,
826
- ownKeys
827
- };
828
- const readonlyHandlers = {
829
- get: readonlyGet,
826
+ class ReadonlyReactiveHandler extends BaseReactiveHandler {
827
+ constructor(shallow = false) {
828
+ super(true, shallow);
829
+ }
830
830
  set(target, key) {
831
831
  {
832
832
  warn$1(
@@ -835,7 +835,7 @@ const readonlyHandlers = {
835
835
  );
836
836
  }
837
837
  return true;
838
- },
838
+ }
839
839
  deleteProperty(target, key) {
840
840
  {
841
841
  warn$1(
@@ -845,22 +845,13 @@ const readonlyHandlers = {
845
845
  }
846
846
  return true;
847
847
  }
848
- };
849
- const shallowReactiveHandlers = /* @__PURE__ */ extend(
850
- {},
851
- mutableHandlers,
852
- {
853
- get: shallowGet,
854
- set: shallowSet
855
- }
856
- );
857
- const shallowReadonlyHandlers = /* @__PURE__ */ extend(
858
- {},
859
- readonlyHandlers,
860
- {
861
- get: shallowReadonlyGet
862
- }
848
+ }
849
+ const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
850
+ const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
851
+ const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
852
+ true
863
853
  );
854
+ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
864
855
 
865
856
  const toShallow = (value) => value;
866
857
  const getProto = (v) => Reflect.getPrototypeOf(v);
@@ -869,7 +860,7 @@ function get(target, key, isReadonly = false, isShallow = false) {
869
860
  const rawTarget = toRaw(target);
870
861
  const rawKey = toRaw(key);
871
862
  if (!isReadonly) {
872
- if (key !== rawKey) {
863
+ if (hasChanged(key, rawKey)) {
873
864
  track(rawTarget, "get", key);
874
865
  }
875
866
  track(rawTarget, "get", rawKey);
@@ -889,7 +880,7 @@ function has(key, isReadonly = false) {
889
880
  const rawTarget = toRaw(target);
890
881
  const rawKey = toRaw(key);
891
882
  if (!isReadonly) {
892
- if (key !== rawKey) {
883
+ if (hasChanged(key, rawKey)) {
893
884
  track(rawTarget, "has", key);
894
885
  }
895
886
  track(rawTarget, "has", rawKey);
@@ -1419,11 +1410,7 @@ function toRef(source, key, defaultValue) {
1419
1410
  }
1420
1411
  function propertyToRef(source, key, defaultValue) {
1421
1412
  const val = source[key];
1422
- return isRef(val) ? val : new ObjectRefImpl(
1423
- source,
1424
- key,
1425
- defaultValue
1426
- );
1413
+ return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1427
1414
  }
1428
1415
 
1429
1416
  class ComputedRefImpl {
@@ -3196,9 +3183,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3196
3183
  }
3197
3184
  if (cb) {
3198
3185
  const newValue = effect.run();
3199
- if (deep || forceTrigger || (isMultiSource ? newValue.some(
3200
- (v, i) => hasChanged(v, oldValue[i])
3201
- ) : hasChanged(newValue, oldValue)) || false) {
3186
+ if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
3202
3187
  if (cleanup) {
3203
3188
  cleanup();
3204
3189
  }
@@ -3369,6 +3354,8 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3369
3354
  }
3370
3355
  }
3371
3356
 
3357
+ const leaveCbKey = Symbol("_leaveCb");
3358
+ const enterCbKey$1 = Symbol("_enterCb");
3372
3359
  function useTransitionState() {
3373
3360
  const state = {
3374
3361
  isMounted: false,
@@ -3489,9 +3476,9 @@ const BaseTransitionImpl = {
3489
3476
  oldInnerChild
3490
3477
  );
3491
3478
  leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
3492
- el._leaveCb = () => {
3479
+ el[leaveCbKey] = () => {
3493
3480
  earlyRemove();
3494
- el._leaveCb = void 0;
3481
+ el[leaveCbKey] = void 0;
3495
3482
  delete enterHooks.delayedLeave;
3496
3483
  };
3497
3484
  enterHooks.delayedLeave = delayedLeave;
@@ -3562,15 +3549,15 @@ function resolveTransitionHooks(vnode, props, state, instance) {
3562
3549
  return;
3563
3550
  }
3564
3551
  }
3565
- if (el._leaveCb) {
3566
- el._leaveCb(
3552
+ if (el[leaveCbKey]) {
3553
+ el[leaveCbKey](
3567
3554
  true
3568
3555
  /* cancelled */
3569
3556
  );
3570
3557
  }
3571
3558
  const leavingVNode = leavingVNodesCache[key];
3572
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el._leaveCb) {
3573
- leavingVNode.el._leaveCb();
3559
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
3560
+ leavingVNode.el[leaveCbKey]();
3574
3561
  }
3575
3562
  callHook(hook, [el]);
3576
3563
  },
@@ -3588,7 +3575,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
3588
3575
  }
3589
3576
  }
3590
3577
  let called = false;
3591
- const done = el._enterCb = (cancelled) => {
3578
+ const done = el[enterCbKey$1] = (cancelled) => {
3592
3579
  if (called)
3593
3580
  return;
3594
3581
  called = true;
@@ -3600,7 +3587,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
3600
3587
  if (hooks.delayedLeave) {
3601
3588
  hooks.delayedLeave();
3602
3589
  }
3603
- el._enterCb = void 0;
3590
+ el[enterCbKey$1] = void 0;
3604
3591
  };
3605
3592
  if (hook) {
3606
3593
  callAsyncHook(hook, [el, done]);
@@ -3610,8 +3597,8 @@ function resolveTransitionHooks(vnode, props, state, instance) {
3610
3597
  },
3611
3598
  leave(el, remove) {
3612
3599
  const key2 = String(vnode.key);
3613
- if (el._enterCb) {
3614
- el._enterCb(
3600
+ if (el[enterCbKey$1]) {
3601
+ el[enterCbKey$1](
3615
3602
  true
3616
3603
  /* cancelled */
3617
3604
  );
@@ -3621,7 +3608,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
3621
3608
  }
3622
3609
  callHook(onBeforeLeave, [el]);
3623
3610
  let called = false;
3624
- const done = el._leaveCb = (cancelled) => {
3611
+ const done = el[leaveCbKey] = (cancelled) => {
3625
3612
  if (called)
3626
3613
  return;
3627
3614
  called = true;
@@ -3631,7 +3618,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
3631
3618
  } else {
3632
3619
  callHook(onAfterLeave, [el]);
3633
3620
  }
3634
- el._leaveCb = void 0;
3621
+ el[leaveCbKey] = void 0;
3635
3622
  if (leavingVNodesCache[key2] === vnode) {
3636
3623
  delete leavingVNodesCache[key2];
3637
3624
  }
@@ -3693,6 +3680,8 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
3693
3680
  return ret;
3694
3681
  }
3695
3682
 
3683
+ /*! #__NO_SIDE_EFFECTS__ */
3684
+ // @__NO_SIDE_EFFECTS__
3696
3685
  function defineComponent(options, extraOptions) {
3697
3686
  return isFunction(options) ? (
3698
3687
  // #8326: extend call and options.name access are considered side-effects
@@ -3702,6 +3691,8 @@ function defineComponent(options, extraOptions) {
3702
3691
  }
3703
3692
 
3704
3693
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
3694
+ /*! #__NO_SIDE_EFFECTS__ */
3695
+ // @__NO_SIDE_EFFECTS__
3705
3696
  function defineAsyncComponent(source) {
3706
3697
  if (isFunction(source)) {
3707
3698
  source = { loader: source };
@@ -4480,7 +4471,7 @@ const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend(
4480
4471
  return PublicInstanceProxyHandlers.get(target, key, target);
4481
4472
  },
4482
4473
  has(_, key) {
4483
- const has = key[0] !== "_" && !isGloballyWhitelisted(key);
4474
+ const has = key[0] !== "_" && !isGloballyAllowed(key);
4484
4475
  if (!has && PublicInstanceProxyHandlers.has(_, key)) {
4485
4476
  warn(
4486
4477
  `Property ${JSON.stringify(
@@ -5156,12 +5147,12 @@ function createAppAPI(render, hydrate) {
5156
5147
  },
5157
5148
  set() {
5158
5149
  warn(
5159
- `app.config.unwrapInjectedRef has been deprecated. 3.3 now alawys unwraps injected refs in Options API.`
5150
+ `app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.`
5160
5151
  );
5161
5152
  }
5162
5153
  });
5163
5154
  }
5164
- const installedPlugins = /* @__PURE__ */ new Set();
5155
+ const installedPlugins = /* @__PURE__ */ new WeakSet();
5165
5156
  let isMounted = false;
5166
5157
  const app = context.app = {
5167
5158
  _uid: uid$1++,
@@ -5243,10 +5234,7 @@ function createAppAPI(render, hydrate) {
5243
5234
  If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
5244
5235
  );
5245
5236
  }
5246
- const vnode = createVNode(
5247
- rootComponent,
5248
- rootProps
5249
- );
5237
+ const vnode = createVNode(rootComponent, rootProps);
5250
5238
  vnode.appContext = context;
5251
5239
  {
5252
5240
  context.reload = () => {
@@ -5828,7 +5816,7 @@ const updateSlots = (instance, children, optimized) => {
5828
5816
  }
5829
5817
  if (needDeletionCheck) {
5830
5818
  for (const key in slots) {
5831
- if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {
5819
+ if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
5832
5820
  delete slots[key];
5833
5821
  }
5834
5822
  }
@@ -5992,8 +5980,10 @@ function createHydrationFunctions(rendererInternals) {
5992
5980
  hasMismatch = true;
5993
5981
  warn(
5994
5982
  `Hydration text mismatch:
5995
- - Client: ${JSON.stringify(node.data)}
5996
- - Server: ${JSON.stringify(vnode.children)}`
5983
+ - Server rendered: ${JSON.stringify(
5984
+ node.data
5985
+ )}
5986
+ - Client rendered: ${JSON.stringify(vnode.children)}`
5997
5987
  );
5998
5988
  node.data = vnode.children;
5999
5989
  }
@@ -6196,8 +6186,8 @@ function createHydrationFunctions(rendererInternals) {
6196
6186
  hasMismatch = true;
6197
6187
  warn(
6198
6188
  `Hydration text content mismatch in <${vnode.type}>:
6199
- - Client: ${el.textContent}
6200
- - Server: ${vnode.children}`
6189
+ - Server rendered: ${el.textContent}
6190
+ - Client rendered: ${vnode.children}`
6201
6191
  );
6202
6192
  el.textContent = vnode.children;
6203
6193
  }
@@ -7945,6 +7935,10 @@ const TeleportImpl = {
7945
7935
  internals,
7946
7936
  1
7947
7937
  );
7938
+ } else {
7939
+ if (n2.props && n1.props && n2.props.to !== n1.props.to) {
7940
+ n2.props.to = n1.props.to;
7941
+ }
7948
7942
  }
7949
7943
  } else {
7950
7944
  if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
@@ -7985,19 +7979,18 @@ const TeleportImpl = {
7985
7979
  if (target) {
7986
7980
  hostRemove(targetAnchor);
7987
7981
  }
7988
- if (doRemove || !isTeleportDisabled(props)) {
7989
- hostRemove(anchor);
7990
- if (shapeFlag & 16) {
7991
- for (let i = 0; i < children.length; i++) {
7992
- const child = children[i];
7993
- unmount(
7994
- child,
7995
- parentComponent,
7996
- parentSuspense,
7997
- true,
7998
- !!child.dynamicChildren
7999
- );
8000
- }
7982
+ doRemove && hostRemove(anchor);
7983
+ if (shapeFlag & 16) {
7984
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
7985
+ for (let i = 0; i < children.length; i++) {
7986
+ const child = children[i];
7987
+ unmount(
7988
+ child,
7989
+ parentComponent,
7990
+ parentSuspense,
7991
+ shouldRemove,
7992
+ !!child.dynamicChildren
7993
+ );
8001
7994
  }
8002
7995
  }
8003
7996
  },
@@ -8081,7 +8074,7 @@ function updateCssVars(vnode) {
8081
8074
  const ctx = vnode.ctx;
8082
8075
  if (ctx && ctx.ut) {
8083
8076
  let node = vnode.children[0].el;
8084
- while (node !== vnode.targetAnchor) {
8077
+ while (node && node !== vnode.targetAnchor) {
8085
8078
  if (node.nodeType === 1)
8086
8079
  node.setAttribute("data-v-owner", ctx.uid);
8087
8080
  node = node.nextSibling;
@@ -8725,9 +8718,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
8725
8718
  {
8726
8719
  setCurrentInstance(instance);
8727
8720
  pauseTracking();
8728
- applyOptions(instance);
8729
- resetTracking();
8730
- unsetCurrentInstance();
8721
+ try {
8722
+ applyOptions(instance);
8723
+ } finally {
8724
+ resetTracking();
8725
+ unsetCurrentInstance();
8726
+ }
8731
8727
  }
8732
8728
  if (!Component.render && instance.render === NOOP && !isSSR) {
8733
8729
  if (!compile$1 && Component.template) {
@@ -9093,7 +9089,7 @@ function isMemoSame(cached, memo) {
9093
9089
  return true;
9094
9090
  }
9095
9091
 
9096
- const version = "3.3.4";
9092
+ const version = "3.3.6";
9097
9093
  const ssrUtils = null;
9098
9094
  const resolveFilter = null;
9099
9095
  const compatUtils = null;
@@ -9165,54 +9161,363 @@ const nodeOps = {
9165
9161
  }
9166
9162
  };
9167
9163
 
9168
- function patchClass(el, value, isSVG) {
9169
- const transitionClasses = el._vtc;
9170
- if (transitionClasses) {
9171
- value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
9164
+ const TRANSITION$1 = "transition";
9165
+ const ANIMATION = "animation";
9166
+ const vtcKey = Symbol("_vtc");
9167
+ const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
9168
+ Transition.displayName = "Transition";
9169
+ const DOMTransitionPropsValidators = {
9170
+ name: String,
9171
+ type: String,
9172
+ css: {
9173
+ type: Boolean,
9174
+ default: true
9175
+ },
9176
+ duration: [String, Number, Object],
9177
+ enterFromClass: String,
9178
+ enterActiveClass: String,
9179
+ enterToClass: String,
9180
+ appearFromClass: String,
9181
+ appearActiveClass: String,
9182
+ appearToClass: String,
9183
+ leaveFromClass: String,
9184
+ leaveActiveClass: String,
9185
+ leaveToClass: String
9186
+ };
9187
+ const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
9188
+ {},
9189
+ BaseTransitionPropsValidators,
9190
+ DOMTransitionPropsValidators
9191
+ );
9192
+ const callHook = (hook, args = []) => {
9193
+ if (isArray(hook)) {
9194
+ hook.forEach((h2) => h2(...args));
9195
+ } else if (hook) {
9196
+ hook(...args);
9172
9197
  }
9173
- if (value == null) {
9174
- el.removeAttribute("class");
9175
- } else if (isSVG) {
9176
- el.setAttribute("class", value);
9177
- } else {
9178
- el.className = value;
9198
+ };
9199
+ const hasExplicitCallback = (hook) => {
9200
+ return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
9201
+ };
9202
+ function resolveTransitionProps(rawProps) {
9203
+ const baseProps = {};
9204
+ for (const key in rawProps) {
9205
+ if (!(key in DOMTransitionPropsValidators)) {
9206
+ baseProps[key] = rawProps[key];
9207
+ }
9179
9208
  }
9180
- }
9181
-
9182
- function patchStyle(el, prev, next) {
9183
- const style = el.style;
9184
- const isCssString = isString(next);
9185
- if (next && !isCssString) {
9186
- if (prev && !isString(prev)) {
9187
- for (const key in prev) {
9188
- if (next[key] == null) {
9189
- setStyle(style, key, "");
9209
+ if (rawProps.css === false) {
9210
+ return baseProps;
9211
+ }
9212
+ const {
9213
+ name = "v",
9214
+ type,
9215
+ duration,
9216
+ enterFromClass = `${name}-enter-from`,
9217
+ enterActiveClass = `${name}-enter-active`,
9218
+ enterToClass = `${name}-enter-to`,
9219
+ appearFromClass = enterFromClass,
9220
+ appearActiveClass = enterActiveClass,
9221
+ appearToClass = enterToClass,
9222
+ leaveFromClass = `${name}-leave-from`,
9223
+ leaveActiveClass = `${name}-leave-active`,
9224
+ leaveToClass = `${name}-leave-to`
9225
+ } = rawProps;
9226
+ const durations = normalizeDuration(duration);
9227
+ const enterDuration = durations && durations[0];
9228
+ const leaveDuration = durations && durations[1];
9229
+ const {
9230
+ onBeforeEnter,
9231
+ onEnter,
9232
+ onEnterCancelled,
9233
+ onLeave,
9234
+ onLeaveCancelled,
9235
+ onBeforeAppear = onBeforeEnter,
9236
+ onAppear = onEnter,
9237
+ onAppearCancelled = onEnterCancelled
9238
+ } = baseProps;
9239
+ const finishEnter = (el, isAppear, done) => {
9240
+ removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
9241
+ removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
9242
+ done && done();
9243
+ };
9244
+ const finishLeave = (el, done) => {
9245
+ el._isLeaving = false;
9246
+ removeTransitionClass(el, leaveFromClass);
9247
+ removeTransitionClass(el, leaveToClass);
9248
+ removeTransitionClass(el, leaveActiveClass);
9249
+ done && done();
9250
+ };
9251
+ const makeEnterHook = (isAppear) => {
9252
+ return (el, done) => {
9253
+ const hook = isAppear ? onAppear : onEnter;
9254
+ const resolve = () => finishEnter(el, isAppear, done);
9255
+ callHook(hook, [el, resolve]);
9256
+ nextFrame(() => {
9257
+ removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
9258
+ addTransitionClass(el, isAppear ? appearToClass : enterToClass);
9259
+ if (!hasExplicitCallback(hook)) {
9260
+ whenTransitionEnds(el, type, enterDuration, resolve);
9190
9261
  }
9191
- }
9192
- }
9193
- for (const key in next) {
9194
- setStyle(style, key, next[key]);
9262
+ });
9263
+ };
9264
+ };
9265
+ return extend(baseProps, {
9266
+ onBeforeEnter(el) {
9267
+ callHook(onBeforeEnter, [el]);
9268
+ addTransitionClass(el, enterFromClass);
9269
+ addTransitionClass(el, enterActiveClass);
9270
+ },
9271
+ onBeforeAppear(el) {
9272
+ callHook(onBeforeAppear, [el]);
9273
+ addTransitionClass(el, appearFromClass);
9274
+ addTransitionClass(el, appearActiveClass);
9275
+ },
9276
+ onEnter: makeEnterHook(false),
9277
+ onAppear: makeEnterHook(true),
9278
+ onLeave(el, done) {
9279
+ el._isLeaving = true;
9280
+ const resolve = () => finishLeave(el, done);
9281
+ addTransitionClass(el, leaveFromClass);
9282
+ forceReflow();
9283
+ addTransitionClass(el, leaveActiveClass);
9284
+ nextFrame(() => {
9285
+ if (!el._isLeaving) {
9286
+ return;
9287
+ }
9288
+ removeTransitionClass(el, leaveFromClass);
9289
+ addTransitionClass(el, leaveToClass);
9290
+ if (!hasExplicitCallback(onLeave)) {
9291
+ whenTransitionEnds(el, type, leaveDuration, resolve);
9292
+ }
9293
+ });
9294
+ callHook(onLeave, [el, resolve]);
9295
+ },
9296
+ onEnterCancelled(el) {
9297
+ finishEnter(el, false);
9298
+ callHook(onEnterCancelled, [el]);
9299
+ },
9300
+ onAppearCancelled(el) {
9301
+ finishEnter(el, true);
9302
+ callHook(onAppearCancelled, [el]);
9303
+ },
9304
+ onLeaveCancelled(el) {
9305
+ finishLeave(el);
9306
+ callHook(onLeaveCancelled, [el]);
9195
9307
  }
9308
+ });
9309
+ }
9310
+ function normalizeDuration(duration) {
9311
+ if (duration == null) {
9312
+ return null;
9313
+ } else if (isObject(duration)) {
9314
+ return [NumberOf(duration.enter), NumberOf(duration.leave)];
9196
9315
  } else {
9197
- const currentDisplay = style.display;
9198
- if (isCssString) {
9199
- if (prev !== next) {
9200
- style.cssText = next;
9201
- }
9202
- } else if (prev) {
9203
- el.removeAttribute("style");
9204
- }
9205
- if ("_vod" in el) {
9206
- style.display = currentDisplay;
9207
- }
9316
+ const n = NumberOf(duration);
9317
+ return [n, n];
9208
9318
  }
9209
9319
  }
9210
- const semicolonRE = /[^\\];\s*$/;
9211
- const importantRE = /\s*!important$/;
9212
- function setStyle(style, name, val) {
9213
- if (isArray(val)) {
9214
- val.forEach((v) => setStyle(style, name, v));
9215
- } else {
9320
+ function NumberOf(val) {
9321
+ const res = toNumber(val);
9322
+ {
9323
+ assertNumber(res, "<transition> explicit duration");
9324
+ }
9325
+ return res;
9326
+ }
9327
+ function addTransitionClass(el, cls) {
9328
+ cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
9329
+ (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
9330
+ }
9331
+ function removeTransitionClass(el, cls) {
9332
+ cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
9333
+ const _vtc = el[vtcKey];
9334
+ if (_vtc) {
9335
+ _vtc.delete(cls);
9336
+ if (!_vtc.size) {
9337
+ el[vtcKey] = void 0;
9338
+ }
9339
+ }
9340
+ }
9341
+ function nextFrame(cb) {
9342
+ requestAnimationFrame(() => {
9343
+ requestAnimationFrame(cb);
9344
+ });
9345
+ }
9346
+ let endId = 0;
9347
+ function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
9348
+ const id = el._endId = ++endId;
9349
+ const resolveIfNotStale = () => {
9350
+ if (id === el._endId) {
9351
+ resolve();
9352
+ }
9353
+ };
9354
+ if (explicitTimeout) {
9355
+ return setTimeout(resolveIfNotStale, explicitTimeout);
9356
+ }
9357
+ const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
9358
+ if (!type) {
9359
+ return resolve();
9360
+ }
9361
+ const endEvent = type + "end";
9362
+ let ended = 0;
9363
+ const end = () => {
9364
+ el.removeEventListener(endEvent, onEnd);
9365
+ resolveIfNotStale();
9366
+ };
9367
+ const onEnd = (e) => {
9368
+ if (e.target === el && ++ended >= propCount) {
9369
+ end();
9370
+ }
9371
+ };
9372
+ setTimeout(() => {
9373
+ if (ended < propCount) {
9374
+ end();
9375
+ }
9376
+ }, timeout + 1);
9377
+ el.addEventListener(endEvent, onEnd);
9378
+ }
9379
+ function getTransitionInfo(el, expectedType) {
9380
+ const styles = window.getComputedStyle(el);
9381
+ const getStyleProperties = (key) => (styles[key] || "").split(", ");
9382
+ const transitionDelays = getStyleProperties(`${TRANSITION$1}Delay`);
9383
+ const transitionDurations = getStyleProperties(`${TRANSITION$1}Duration`);
9384
+ const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
9385
+ const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
9386
+ const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
9387
+ const animationTimeout = getTimeout(animationDelays, animationDurations);
9388
+ let type = null;
9389
+ let timeout = 0;
9390
+ let propCount = 0;
9391
+ if (expectedType === TRANSITION$1) {
9392
+ if (transitionTimeout > 0) {
9393
+ type = TRANSITION$1;
9394
+ timeout = transitionTimeout;
9395
+ propCount = transitionDurations.length;
9396
+ }
9397
+ } else if (expectedType === ANIMATION) {
9398
+ if (animationTimeout > 0) {
9399
+ type = ANIMATION;
9400
+ timeout = animationTimeout;
9401
+ propCount = animationDurations.length;
9402
+ }
9403
+ } else {
9404
+ timeout = Math.max(transitionTimeout, animationTimeout);
9405
+ type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION$1 : ANIMATION : null;
9406
+ propCount = type ? type === TRANSITION$1 ? transitionDurations.length : animationDurations.length : 0;
9407
+ }
9408
+ const hasTransform = type === TRANSITION$1 && /\b(transform|all)(,|$)/.test(
9409
+ getStyleProperties(`${TRANSITION$1}Property`).toString()
9410
+ );
9411
+ return {
9412
+ type,
9413
+ timeout,
9414
+ propCount,
9415
+ hasTransform
9416
+ };
9417
+ }
9418
+ function getTimeout(delays, durations) {
9419
+ while (delays.length < durations.length) {
9420
+ delays = delays.concat(delays);
9421
+ }
9422
+ return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
9423
+ }
9424
+ function toMs(s) {
9425
+ if (s === "auto")
9426
+ return 0;
9427
+ return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
9428
+ }
9429
+ function forceReflow() {
9430
+ return document.body.offsetHeight;
9431
+ }
9432
+
9433
+ function patchClass(el, value, isSVG) {
9434
+ const transitionClasses = el[vtcKey];
9435
+ if (transitionClasses) {
9436
+ value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
9437
+ }
9438
+ if (value == null) {
9439
+ el.removeAttribute("class");
9440
+ } else if (isSVG) {
9441
+ el.setAttribute("class", value);
9442
+ } else {
9443
+ el.className = value;
9444
+ }
9445
+ }
9446
+
9447
+ const vShowOldKey = Symbol("_vod");
9448
+ const vShow = {
9449
+ beforeMount(el, { value }, { transition }) {
9450
+ el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display;
9451
+ if (transition && value) {
9452
+ transition.beforeEnter(el);
9453
+ } else {
9454
+ setDisplay(el, value);
9455
+ }
9456
+ },
9457
+ mounted(el, { value }, { transition }) {
9458
+ if (transition && value) {
9459
+ transition.enter(el);
9460
+ }
9461
+ },
9462
+ updated(el, { value, oldValue }, { transition }) {
9463
+ if (!value === !oldValue)
9464
+ return;
9465
+ if (transition) {
9466
+ if (value) {
9467
+ transition.beforeEnter(el);
9468
+ setDisplay(el, true);
9469
+ transition.enter(el);
9470
+ } else {
9471
+ transition.leave(el, () => {
9472
+ setDisplay(el, false);
9473
+ });
9474
+ }
9475
+ } else {
9476
+ setDisplay(el, value);
9477
+ }
9478
+ },
9479
+ beforeUnmount(el, { value }) {
9480
+ setDisplay(el, value);
9481
+ }
9482
+ };
9483
+ function setDisplay(el, value) {
9484
+ el.style.display = value ? el[vShowOldKey] : "none";
9485
+ }
9486
+
9487
+ function patchStyle(el, prev, next) {
9488
+ const style = el.style;
9489
+ const isCssString = isString(next);
9490
+ if (next && !isCssString) {
9491
+ if (prev && !isString(prev)) {
9492
+ for (const key in prev) {
9493
+ if (next[key] == null) {
9494
+ setStyle(style, key, "");
9495
+ }
9496
+ }
9497
+ }
9498
+ for (const key in next) {
9499
+ setStyle(style, key, next[key]);
9500
+ }
9501
+ } else {
9502
+ const currentDisplay = style.display;
9503
+ if (isCssString) {
9504
+ if (prev !== next) {
9505
+ style.cssText = next;
9506
+ }
9507
+ } else if (prev) {
9508
+ el.removeAttribute("style");
9509
+ }
9510
+ if (vShowOldKey in el) {
9511
+ style.display = currentDisplay;
9512
+ }
9513
+ }
9514
+ }
9515
+ const semicolonRE = /[^\\];\s*$/;
9516
+ const importantRE = /\s*!important$/;
9517
+ function setStyle(style, name, val) {
9518
+ if (isArray(val)) {
9519
+ val.forEach((v) => setStyle(style, name, v));
9520
+ } else {
9216
9521
  if (val == null)
9217
9522
  val = "";
9218
9523
  {
@@ -9331,8 +9636,9 @@ function addEventListener(el, event, handler, options) {
9331
9636
  function removeEventListener(el, event, handler, options) {
9332
9637
  el.removeEventListener(event, handler, options);
9333
9638
  }
9639
+ const veiKey = Symbol("_vei");
9334
9640
  function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
9335
- const invokers = el._vei || (el._vei = {});
9641
+ const invokers = el[veiKey] || (el[veiKey] = {});
9336
9642
  const existingInvoker = invokers[rawName];
9337
9643
  if (nextValue && existingInvoker) {
9338
9644
  existingInvoker.value = nextValue;
@@ -9452,6 +9758,8 @@ function shouldSetAsProp(el, key, value, isSVG) {
9452
9758
  return key in el;
9453
9759
  }
9454
9760
 
9761
+ /*! #__NO_SIDE_EFFECTS__ */
9762
+ // @__NO_SIDE_EFFECTS__
9455
9763
  function defineCustomElement(options, hydrate2) {
9456
9764
  const Comp = defineComponent(options);
9457
9765
  class VueCustomElement extends VueElement {
@@ -9462,8 +9770,9 @@ function defineCustomElement(options, hydrate2) {
9462
9770
  VueCustomElement.def = Comp;
9463
9771
  return VueCustomElement;
9464
9772
  }
9465
- const defineSSRCustomElement = (options) => {
9466
- return defineCustomElement(options, hydrate);
9773
+ /*! #__NO_SIDE_EFFECTS__ */
9774
+ const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options) => {
9775
+ return /* @__PURE__ */ defineCustomElement(options, hydrate);
9467
9776
  };
9468
9777
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
9469
9778
  };
@@ -9479,6 +9788,7 @@ class VueElement extends BaseClass {
9479
9788
  this._connected = false;
9480
9789
  this._resolved = false;
9481
9790
  this._numberProps = null;
9791
+ this._ob = null;
9482
9792
  if (this.shadowRoot && hydrate2) {
9483
9793
  hydrate2(this._createVNode(), this.shadowRoot);
9484
9794
  } else {
@@ -9505,6 +9815,10 @@ class VueElement extends BaseClass {
9505
9815
  }
9506
9816
  disconnectedCallback() {
9507
9817
  this._connected = false;
9818
+ if (this._ob) {
9819
+ this._ob.disconnect();
9820
+ this._ob = null;
9821
+ }
9508
9822
  nextTick(() => {
9509
9823
  if (!this._connected) {
9510
9824
  render(null, this.shadowRoot);
@@ -9520,11 +9834,12 @@ class VueElement extends BaseClass {
9520
9834
  for (let i = 0; i < this.attributes.length; i++) {
9521
9835
  this._setAttr(this.attributes[i].name);
9522
9836
  }
9523
- new MutationObserver((mutations) => {
9837
+ this._ob = new MutationObserver((mutations) => {
9524
9838
  for (const m of mutations) {
9525
9839
  this._setAttr(m.attributeName);
9526
9840
  }
9527
- }).observe(this, { attributes: true });
9841
+ });
9842
+ this._ob.observe(this, { attributes: true });
9528
9843
  const resolve = (def, isAsync = false) => {
9529
9844
  const { props, styles } = def;
9530
9845
  let numberProps;
@@ -9745,274 +10060,10 @@ function setVarsOnNode(el, vars) {
9745
10060
  }
9746
10061
  }
9747
10062
 
9748
- const TRANSITION$1 = "transition";
9749
- const ANIMATION = "animation";
9750
- const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
9751
- Transition.displayName = "Transition";
9752
- const DOMTransitionPropsValidators = {
9753
- name: String,
9754
- type: String,
9755
- css: {
9756
- type: Boolean,
9757
- default: true
9758
- },
9759
- duration: [String, Number, Object],
9760
- enterFromClass: String,
9761
- enterActiveClass: String,
9762
- enterToClass: String,
9763
- appearFromClass: String,
9764
- appearActiveClass: String,
9765
- appearToClass: String,
9766
- leaveFromClass: String,
9767
- leaveActiveClass: String,
9768
- leaveToClass: String
9769
- };
9770
- const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
9771
- {},
9772
- BaseTransitionPropsValidators,
9773
- DOMTransitionPropsValidators
9774
- );
9775
- const callHook = (hook, args = []) => {
9776
- if (isArray(hook)) {
9777
- hook.forEach((h2) => h2(...args));
9778
- } else if (hook) {
9779
- hook(...args);
9780
- }
9781
- };
9782
- const hasExplicitCallback = (hook) => {
9783
- return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
9784
- };
9785
- function resolveTransitionProps(rawProps) {
9786
- const baseProps = {};
9787
- for (const key in rawProps) {
9788
- if (!(key in DOMTransitionPropsValidators)) {
9789
- baseProps[key] = rawProps[key];
9790
- }
9791
- }
9792
- if (rawProps.css === false) {
9793
- return baseProps;
9794
- }
9795
- const {
9796
- name = "v",
9797
- type,
9798
- duration,
9799
- enterFromClass = `${name}-enter-from`,
9800
- enterActiveClass = `${name}-enter-active`,
9801
- enterToClass = `${name}-enter-to`,
9802
- appearFromClass = enterFromClass,
9803
- appearActiveClass = enterActiveClass,
9804
- appearToClass = enterToClass,
9805
- leaveFromClass = `${name}-leave-from`,
9806
- leaveActiveClass = `${name}-leave-active`,
9807
- leaveToClass = `${name}-leave-to`
9808
- } = rawProps;
9809
- const durations = normalizeDuration(duration);
9810
- const enterDuration = durations && durations[0];
9811
- const leaveDuration = durations && durations[1];
9812
- const {
9813
- onBeforeEnter,
9814
- onEnter,
9815
- onEnterCancelled,
9816
- onLeave,
9817
- onLeaveCancelled,
9818
- onBeforeAppear = onBeforeEnter,
9819
- onAppear = onEnter,
9820
- onAppearCancelled = onEnterCancelled
9821
- } = baseProps;
9822
- const finishEnter = (el, isAppear, done) => {
9823
- removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
9824
- removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
9825
- done && done();
9826
- };
9827
- const finishLeave = (el, done) => {
9828
- el._isLeaving = false;
9829
- removeTransitionClass(el, leaveFromClass);
9830
- removeTransitionClass(el, leaveToClass);
9831
- removeTransitionClass(el, leaveActiveClass);
9832
- done && done();
9833
- };
9834
- const makeEnterHook = (isAppear) => {
9835
- return (el, done) => {
9836
- const hook = isAppear ? onAppear : onEnter;
9837
- const resolve = () => finishEnter(el, isAppear, done);
9838
- callHook(hook, [el, resolve]);
9839
- nextFrame(() => {
9840
- removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
9841
- addTransitionClass(el, isAppear ? appearToClass : enterToClass);
9842
- if (!hasExplicitCallback(hook)) {
9843
- whenTransitionEnds(el, type, enterDuration, resolve);
9844
- }
9845
- });
9846
- };
9847
- };
9848
- return extend(baseProps, {
9849
- onBeforeEnter(el) {
9850
- callHook(onBeforeEnter, [el]);
9851
- addTransitionClass(el, enterFromClass);
9852
- addTransitionClass(el, enterActiveClass);
9853
- },
9854
- onBeforeAppear(el) {
9855
- callHook(onBeforeAppear, [el]);
9856
- addTransitionClass(el, appearFromClass);
9857
- addTransitionClass(el, appearActiveClass);
9858
- },
9859
- onEnter: makeEnterHook(false),
9860
- onAppear: makeEnterHook(true),
9861
- onLeave(el, done) {
9862
- el._isLeaving = true;
9863
- const resolve = () => finishLeave(el, done);
9864
- addTransitionClass(el, leaveFromClass);
9865
- forceReflow();
9866
- addTransitionClass(el, leaveActiveClass);
9867
- nextFrame(() => {
9868
- if (!el._isLeaving) {
9869
- return;
9870
- }
9871
- removeTransitionClass(el, leaveFromClass);
9872
- addTransitionClass(el, leaveToClass);
9873
- if (!hasExplicitCallback(onLeave)) {
9874
- whenTransitionEnds(el, type, leaveDuration, resolve);
9875
- }
9876
- });
9877
- callHook(onLeave, [el, resolve]);
9878
- },
9879
- onEnterCancelled(el) {
9880
- finishEnter(el, false);
9881
- callHook(onEnterCancelled, [el]);
9882
- },
9883
- onAppearCancelled(el) {
9884
- finishEnter(el, true);
9885
- callHook(onAppearCancelled, [el]);
9886
- },
9887
- onLeaveCancelled(el) {
9888
- finishLeave(el);
9889
- callHook(onLeaveCancelled, [el]);
9890
- }
9891
- });
9892
- }
9893
- function normalizeDuration(duration) {
9894
- if (duration == null) {
9895
- return null;
9896
- } else if (isObject(duration)) {
9897
- return [NumberOf(duration.enter), NumberOf(duration.leave)];
9898
- } else {
9899
- const n = NumberOf(duration);
9900
- return [n, n];
9901
- }
9902
- }
9903
- function NumberOf(val) {
9904
- const res = toNumber(val);
9905
- {
9906
- assertNumber(res, "<transition> explicit duration");
9907
- }
9908
- return res;
9909
- }
9910
- function addTransitionClass(el, cls) {
9911
- cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
9912
- (el._vtc || (el._vtc = /* @__PURE__ */ new Set())).add(cls);
9913
- }
9914
- function removeTransitionClass(el, cls) {
9915
- cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
9916
- const { _vtc } = el;
9917
- if (_vtc) {
9918
- _vtc.delete(cls);
9919
- if (!_vtc.size) {
9920
- el._vtc = void 0;
9921
- }
9922
- }
9923
- }
9924
- function nextFrame(cb) {
9925
- requestAnimationFrame(() => {
9926
- requestAnimationFrame(cb);
9927
- });
9928
- }
9929
- let endId = 0;
9930
- function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
9931
- const id = el._endId = ++endId;
9932
- const resolveIfNotStale = () => {
9933
- if (id === el._endId) {
9934
- resolve();
9935
- }
9936
- };
9937
- if (explicitTimeout) {
9938
- return setTimeout(resolveIfNotStale, explicitTimeout);
9939
- }
9940
- const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
9941
- if (!type) {
9942
- return resolve();
9943
- }
9944
- const endEvent = type + "end";
9945
- let ended = 0;
9946
- const end = () => {
9947
- el.removeEventListener(endEvent, onEnd);
9948
- resolveIfNotStale();
9949
- };
9950
- const onEnd = (e) => {
9951
- if (e.target === el && ++ended >= propCount) {
9952
- end();
9953
- }
9954
- };
9955
- setTimeout(() => {
9956
- if (ended < propCount) {
9957
- end();
9958
- }
9959
- }, timeout + 1);
9960
- el.addEventListener(endEvent, onEnd);
9961
- }
9962
- function getTransitionInfo(el, expectedType) {
9963
- const styles = window.getComputedStyle(el);
9964
- const getStyleProperties = (key) => (styles[key] || "").split(", ");
9965
- const transitionDelays = getStyleProperties(`${TRANSITION$1}Delay`);
9966
- const transitionDurations = getStyleProperties(`${TRANSITION$1}Duration`);
9967
- const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
9968
- const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
9969
- const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
9970
- const animationTimeout = getTimeout(animationDelays, animationDurations);
9971
- let type = null;
9972
- let timeout = 0;
9973
- let propCount = 0;
9974
- if (expectedType === TRANSITION$1) {
9975
- if (transitionTimeout > 0) {
9976
- type = TRANSITION$1;
9977
- timeout = transitionTimeout;
9978
- propCount = transitionDurations.length;
9979
- }
9980
- } else if (expectedType === ANIMATION) {
9981
- if (animationTimeout > 0) {
9982
- type = ANIMATION;
9983
- timeout = animationTimeout;
9984
- propCount = animationDurations.length;
9985
- }
9986
- } else {
9987
- timeout = Math.max(transitionTimeout, animationTimeout);
9988
- type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION$1 : ANIMATION : null;
9989
- propCount = type ? type === TRANSITION$1 ? transitionDurations.length : animationDurations.length : 0;
9990
- }
9991
- const hasTransform = type === TRANSITION$1 && /\b(transform|all)(,|$)/.test(
9992
- getStyleProperties(`${TRANSITION$1}Property`).toString()
9993
- );
9994
- return {
9995
- type,
9996
- timeout,
9997
- propCount,
9998
- hasTransform
9999
- };
10000
- }
10001
- function getTimeout(delays, durations) {
10002
- while (delays.length < durations.length) {
10003
- delays = delays.concat(delays);
10004
- }
10005
- return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
10006
- }
10007
- function toMs(s) {
10008
- return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
10009
- }
10010
- function forceReflow() {
10011
- return document.body.offsetHeight;
10012
- }
10013
-
10014
10063
  const positionMap = /* @__PURE__ */ new WeakMap();
10015
10064
  const newPositionMap = /* @__PURE__ */ new WeakMap();
10065
+ const moveCbKey = Symbol("_moveCb");
10066
+ const enterCbKey = Symbol("_enterCb");
10016
10067
  const TransitionGroupImpl = {
10017
10068
  name: "TransitionGroup",
10018
10069
  props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
@@ -10045,13 +10096,13 @@ const TransitionGroupImpl = {
10045
10096
  const style = el.style;
10046
10097
  addTransitionClass(el, moveClass);
10047
10098
  style.transform = style.webkitTransform = style.transitionDuration = "";
10048
- const cb = el._moveCb = (e) => {
10099
+ const cb = el[moveCbKey] = (e) => {
10049
10100
  if (e && e.target !== el) {
10050
10101
  return;
10051
10102
  }
10052
10103
  if (!e || /transform$/.test(e.propertyName)) {
10053
10104
  el.removeEventListener("transitionend", cb);
10054
- el._moveCb = null;
10105
+ el[moveCbKey] = null;
10055
10106
  removeTransitionClass(el, moveClass);
10056
10107
  }
10057
10108
  };
@@ -10094,11 +10145,11 @@ const removeMode = (props) => delete props.mode;
10094
10145
  const TransitionGroup = TransitionGroupImpl;
10095
10146
  function callPendingCbs(c) {
10096
10147
  const el = c.el;
10097
- if (el._moveCb) {
10098
- el._moveCb();
10148
+ if (el[moveCbKey]) {
10149
+ el[moveCbKey]();
10099
10150
  }
10100
- if (el._enterCb) {
10101
- el._enterCb();
10151
+ if (el[enterCbKey]) {
10152
+ el[enterCbKey]();
10102
10153
  }
10103
10154
  }
10104
10155
  function recordPosition(c) {
@@ -10118,8 +10169,9 @@ function applyTranslation(c) {
10118
10169
  }
10119
10170
  function hasCSSTransform(el, root, moveClass) {
10120
10171
  const clone = el.cloneNode();
10121
- if (el._vtc) {
10122
- el._vtc.forEach((cls) => {
10172
+ const _vtc = el[vtcKey];
10173
+ if (_vtc) {
10174
+ _vtc.forEach((cls) => {
10123
10175
  cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
10124
10176
  });
10125
10177
  }
@@ -10146,9 +10198,10 @@ function onCompositionEnd(e) {
10146
10198
  target.dispatchEvent(new Event("input"));
10147
10199
  }
10148
10200
  }
10201
+ const assignKey = Symbol("_assign");
10149
10202
  const vModelText = {
10150
10203
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
10151
- el._assign = getModelAssigner(vnode);
10204
+ el[assignKey] = getModelAssigner(vnode);
10152
10205
  const castToNumber = number || vnode.props && vnode.props.type === "number";
10153
10206
  addEventListener(el, lazy ? "change" : "input", (e) => {
10154
10207
  if (e.target.composing)
@@ -10160,7 +10213,7 @@ const vModelText = {
10160
10213
  if (castToNumber) {
10161
10214
  domValue = looseToNumber(domValue);
10162
10215
  }
10163
- el._assign(domValue);
10216
+ el[assignKey](domValue);
10164
10217
  });
10165
10218
  if (trim) {
10166
10219
  addEventListener(el, "change", () => {
@@ -10178,7 +10231,7 @@ const vModelText = {
10178
10231
  el.value = value == null ? "" : value;
10179
10232
  },
10180
10233
  beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {
10181
- el._assign = getModelAssigner(vnode);
10234
+ el[assignKey] = getModelAssigner(vnode);
10182
10235
  if (el.composing)
10183
10236
  return;
10184
10237
  if (document.activeElement === el && el.type !== "range") {
@@ -10202,12 +10255,12 @@ const vModelCheckbox = {
10202
10255
  // #4096 array checkboxes need to be deep traversed
10203
10256
  deep: true,
10204
10257
  created(el, _, vnode) {
10205
- el._assign = getModelAssigner(vnode);
10258
+ el[assignKey] = getModelAssigner(vnode);
10206
10259
  addEventListener(el, "change", () => {
10207
10260
  const modelValue = el._modelValue;
10208
10261
  const elementValue = getValue(el);
10209
10262
  const checked = el.checked;
10210
- const assign = el._assign;
10263
+ const assign = el[assignKey];
10211
10264
  if (isArray(modelValue)) {
10212
10265
  const index = looseIndexOf(modelValue, elementValue);
10213
10266
  const found = index !== -1;
@@ -10234,7 +10287,7 @@ const vModelCheckbox = {
10234
10287
  // set initial checked on mount to wait for true-value/false-value
10235
10288
  mounted: setChecked,
10236
10289
  beforeUpdate(el, binding, vnode) {
10237
- el._assign = getModelAssigner(vnode);
10290
+ el[assignKey] = getModelAssigner(vnode);
10238
10291
  setChecked(el, binding, vnode);
10239
10292
  }
10240
10293
  };
@@ -10251,13 +10304,13 @@ function setChecked(el, { value, oldValue }, vnode) {
10251
10304
  const vModelRadio = {
10252
10305
  created(el, { value }, vnode) {
10253
10306
  el.checked = looseEqual(value, vnode.props.value);
10254
- el._assign = getModelAssigner(vnode);
10307
+ el[assignKey] = getModelAssigner(vnode);
10255
10308
  addEventListener(el, "change", () => {
10256
- el._assign(getValue(el));
10309
+ el[assignKey](getValue(el));
10257
10310
  });
10258
10311
  },
10259
10312
  beforeUpdate(el, { value, oldValue }, vnode) {
10260
- el._assign = getModelAssigner(vnode);
10313
+ el[assignKey] = getModelAssigner(vnode);
10261
10314
  if (value !== oldValue) {
10262
10315
  el.checked = looseEqual(value, vnode.props.value);
10263
10316
  }
@@ -10272,11 +10325,11 @@ const vModelSelect = {
10272
10325
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
10273
10326
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
10274
10327
  );
10275
- el._assign(
10328
+ el[assignKey](
10276
10329
  el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
10277
10330
  );
10278
10331
  });
10279
- el._assign = getModelAssigner(vnode);
10332
+ el[assignKey] = getModelAssigner(vnode);
10280
10333
  },
10281
10334
  // set value in mounted & updated because <select> relies on its children
10282
10335
  // <option>s.
@@ -10284,7 +10337,7 @@ const vModelSelect = {
10284
10337
  setSelected(el, value);
10285
10338
  },
10286
10339
  beforeUpdate(el, _binding, vnode) {
10287
- el._assign = getModelAssigner(vnode);
10340
+ el[assignKey] = getModelAssigner(vnode);
10288
10341
  },
10289
10342
  updated(el, { value }) {
10290
10343
  setSelected(el, value);
@@ -10411,45 +10464,6 @@ const withKeys = (fn, modifiers) => {
10411
10464
  };
10412
10465
  };
10413
10466
 
10414
- const vShow = {
10415
- beforeMount(el, { value }, { transition }) {
10416
- el._vod = el.style.display === "none" ? "" : el.style.display;
10417
- if (transition && value) {
10418
- transition.beforeEnter(el);
10419
- } else {
10420
- setDisplay(el, value);
10421
- }
10422
- },
10423
- mounted(el, { value }, { transition }) {
10424
- if (transition && value) {
10425
- transition.enter(el);
10426
- }
10427
- },
10428
- updated(el, { value, oldValue }, { transition }) {
10429
- if (!value === !oldValue)
10430
- return;
10431
- if (transition) {
10432
- if (value) {
10433
- transition.beforeEnter(el);
10434
- setDisplay(el, true);
10435
- transition.enter(el);
10436
- } else {
10437
- transition.leave(el, () => {
10438
- setDisplay(el, false);
10439
- });
10440
- }
10441
- } else {
10442
- setDisplay(el, value);
10443
- }
10444
- },
10445
- beforeUnmount(el, { value }) {
10446
- setDisplay(el, value);
10447
- }
10448
- };
10449
- function setDisplay(el, value) {
10450
- el.style.display = value ? el._vod : "none";
10451
- }
10452
-
10453
10467
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
10454
10468
  let renderer;
10455
10469
  let enabledHydration = false;
@@ -11384,7 +11398,7 @@ function parseChildren(context, mode, ancestors) {
11384
11398
  continue;
11385
11399
  } else if (/[a-z]/i.test(s[2])) {
11386
11400
  emitError(context, 23);
11387
- parseTag(context, TagType.End, parent);
11401
+ parseTag(context, 1 /* End */, parent);
11388
11402
  continue;
11389
11403
  } else {
11390
11404
  emitError(
@@ -11532,7 +11546,7 @@ function parseElement(context, ancestors) {
11532
11546
  const wasInPre = context.inPre;
11533
11547
  const wasInVPre = context.inVPre;
11534
11548
  const parent = last(ancestors);
11535
- const element = parseTag(context, TagType.Start, parent);
11549
+ const element = parseTag(context, 0 /* Start */, parent);
11536
11550
  const isPreBoundary = context.inPre && !wasInPre;
11537
11551
  const isVPreBoundary = context.inVPre && !wasInVPre;
11538
11552
  if (element.isSelfClosing || context.options.isVoidTag(element.tag)) {
@@ -11550,7 +11564,7 @@ function parseElement(context, ancestors) {
11550
11564
  ancestors.pop();
11551
11565
  element.children = children;
11552
11566
  if (startsWithEndTagOpen(context.source, element.tag)) {
11553
- parseTag(context, TagType.End, parent);
11567
+ parseTag(context, 1 /* End */, parent);
11554
11568
  } else {
11555
11569
  emitError(context, 24, 0, element.loc.start);
11556
11570
  if (context.source.length === 0 && element.tag.toLowerCase() === "script") {
@@ -11569,11 +11583,6 @@ function parseElement(context, ancestors) {
11569
11583
  }
11570
11584
  return element;
11571
11585
  }
11572
- var TagType = /* @__PURE__ */ ((TagType2) => {
11573
- TagType2[TagType2["Start"] = 0] = "Start";
11574
- TagType2[TagType2["End"] = 1] = "End";
11575
- return TagType2;
11576
- })(TagType || {});
11577
11586
  const isSpecialTemplateDirective = /* @__PURE__ */ makeMap(
11578
11587
  `if,else,else-if,for,slot`
11579
11588
  );
@@ -12288,7 +12297,7 @@ function createTransformContext(root, {
12288
12297
  directives: /* @__PURE__ */ new Set(),
12289
12298
  hoists: [],
12290
12299
  imports: [],
12291
- constantCache: /* @__PURE__ */ new Map(),
12300
+ constantCache: /* @__PURE__ */ new WeakMap(),
12292
12301
  temps: 0,
12293
12302
  cached: 0,
12294
12303
  identifiers: /* @__PURE__ */ Object.create(null),