@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.
@@ -40,7 +40,7 @@ const isString = (val) => typeof val === "string";
40
40
  const isSymbol = (val) => typeof val === "symbol";
41
41
  const isObject = (val) => val !== null && typeof val === "object";
42
42
  const isPromise = (val) => {
43
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
43
+ return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
44
44
  };
45
45
  const objectToString = Object.prototype.toString;
46
46
  const toTypeString = (value) => objectToString.call(value);
@@ -71,12 +71,13 @@ const hyphenateRE = /\B([A-Z])/g;
71
71
  const hyphenate = cacheStringFunction(
72
72
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
73
73
  );
74
- const capitalize = cacheStringFunction(
75
- (str) => str.charAt(0).toUpperCase() + str.slice(1)
76
- );
77
- const toHandlerKey = cacheStringFunction(
78
- (str) => str ? `on${capitalize(str)}` : ``
79
- );
74
+ const capitalize = cacheStringFunction((str) => {
75
+ return str.charAt(0).toUpperCase() + str.slice(1);
76
+ });
77
+ const toHandlerKey = cacheStringFunction((str) => {
78
+ const s = str ? `on${capitalize(str)}` : ``;
79
+ return s;
80
+ });
80
81
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
81
82
  const invokeArrayFns = (fns, arg) => {
82
83
  for (let i = 0; i < fns.length; i++) {
@@ -107,8 +108,8 @@ function genPropsAccessExp(name) {
107
108
  return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;
108
109
  }
109
110
 
110
- 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";
111
- const isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
111
+ 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";
112
+ const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
112
113
 
113
114
  function normalizeStyle(value) {
114
115
  if (isArray(value)) {
@@ -123,9 +124,7 @@ function normalizeStyle(value) {
123
124
  }
124
125
  }
125
126
  return res;
126
- } else if (isString(value)) {
127
- return value;
128
- } else if (isObject(value)) {
127
+ } else if (isString(value) || isObject(value)) {
129
128
  return value;
130
129
  }
131
130
  }
@@ -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);
@@ -678,10 +677,6 @@ const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`
678
677
  const builtInSymbols = new Set(
679
678
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
680
679
  );
681
- const get$1 = /* @__PURE__ */ createGetter();
682
- const shallowGet = /* @__PURE__ */ createGetter(false, true);
683
- const readonlyGet = /* @__PURE__ */ createGetter(true);
684
- const shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
685
680
  const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
686
681
  function createArrayInstrumentations() {
687
682
  const instrumentations = {};
@@ -714,8 +709,13 @@ function hasOwnProperty(key) {
714
709
  track(obj, "has", key);
715
710
  return obj.hasOwnProperty(key);
716
711
  }
717
- function createGetter(isReadonly2 = false, shallow = false) {
718
- return function get2(target, key, receiver) {
712
+ class BaseReactiveHandler {
713
+ constructor(_isReadonly = false, _shallow = false) {
714
+ this._isReadonly = _isReadonly;
715
+ this._shallow = _shallow;
716
+ }
717
+ get(target, key, receiver) {
718
+ const isReadonly2 = this._isReadonly, shallow = this._shallow;
719
719
  if (key === "__v_isReactive") {
720
720
  return !isReadonly2;
721
721
  } else if (key === "__v_isReadonly") {
@@ -751,17 +751,18 @@ function createGetter(isReadonly2 = false, shallow = false) {
751
751
  return isReadonly2 ? readonly(res) : reactive(res);
752
752
  }
753
753
  return res;
754
- };
754
+ }
755
755
  }
756
- const set$1 = /* @__PURE__ */ createSetter();
757
- const shallowSet = /* @__PURE__ */ createSetter(true);
758
- function createSetter(shallow = false) {
759
- return function set2(target, key, value, receiver) {
756
+ class MutableReactiveHandler extends BaseReactiveHandler {
757
+ constructor(shallow = false) {
758
+ super(false, shallow);
759
+ }
760
+ set(target, key, value, receiver) {
760
761
  let oldValue = target[key];
761
762
  if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
762
763
  return false;
763
764
  }
764
- if (!shallow) {
765
+ if (!this._shallow) {
765
766
  if (!isShallow(value) && !isReadonly(value)) {
766
767
  oldValue = toRaw(oldValue);
767
768
  value = toRaw(value);
@@ -781,59 +782,49 @@ function createSetter(shallow = false) {
781
782
  }
782
783
  }
783
784
  return result;
784
- };
785
- }
786
- function deleteProperty(target, key) {
787
- const hadKey = hasOwn(target, key);
788
- target[key];
789
- const result = Reflect.deleteProperty(target, key);
790
- if (result && hadKey) {
791
- trigger(target, "delete", key, void 0);
792
785
  }
793
- return result;
794
- }
795
- function has$1(target, key) {
796
- const result = Reflect.has(target, key);
797
- if (!isSymbol(key) || !builtInSymbols.has(key)) {
798
- track(target, "has", key);
786
+ deleteProperty(target, key) {
787
+ const hadKey = hasOwn(target, key);
788
+ target[key];
789
+ const result = Reflect.deleteProperty(target, key);
790
+ if (result && hadKey) {
791
+ trigger(target, "delete", key, void 0);
792
+ }
793
+ return result;
794
+ }
795
+ has(target, key) {
796
+ const result = Reflect.has(target, key);
797
+ if (!isSymbol(key) || !builtInSymbols.has(key)) {
798
+ track(target, "has", key);
799
+ }
800
+ return result;
801
+ }
802
+ ownKeys(target) {
803
+ track(
804
+ target,
805
+ "iterate",
806
+ isArray(target) ? "length" : ITERATE_KEY
807
+ );
808
+ return Reflect.ownKeys(target);
799
809
  }
800
- return result;
801
- }
802
- function ownKeys(target) {
803
- track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY);
804
- return Reflect.ownKeys(target);
805
810
  }
806
- const mutableHandlers = {
807
- get: get$1,
808
- set: set$1,
809
- deleteProperty,
810
- has: has$1,
811
- ownKeys
812
- };
813
- const readonlyHandlers = {
814
- get: readonlyGet,
811
+ class ReadonlyReactiveHandler extends BaseReactiveHandler {
812
+ constructor(shallow = false) {
813
+ super(true, shallow);
814
+ }
815
815
  set(target, key) {
816
816
  return true;
817
- },
817
+ }
818
818
  deleteProperty(target, key) {
819
819
  return true;
820
820
  }
821
- };
822
- const shallowReactiveHandlers = /* @__PURE__ */ extend(
823
- {},
824
- mutableHandlers,
825
- {
826
- get: shallowGet,
827
- set: shallowSet
828
- }
829
- );
830
- const shallowReadonlyHandlers = /* @__PURE__ */ extend(
831
- {},
832
- readonlyHandlers,
833
- {
834
- get: shallowReadonlyGet
835
- }
821
+ }
822
+ const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
823
+ const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
824
+ const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
825
+ true
836
826
  );
827
+ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
837
828
 
838
829
  const toShallow = (value) => value;
839
830
  const getProto = (v) => Reflect.getPrototypeOf(v);
@@ -842,7 +833,7 @@ function get(target, key, isReadonly = false, isShallow = false) {
842
833
  const rawTarget = toRaw(target);
843
834
  const rawKey = toRaw(key);
844
835
  if (!isReadonly) {
845
- if (key !== rawKey) {
836
+ if (hasChanged(key, rawKey)) {
846
837
  track(rawTarget, "get", key);
847
838
  }
848
839
  track(rawTarget, "get", rawKey);
@@ -862,7 +853,7 @@ function has(key, isReadonly = false) {
862
853
  const rawTarget = toRaw(target);
863
854
  const rawKey = toRaw(key);
864
855
  if (!isReadonly) {
865
- if (key !== rawKey) {
856
+ if (hasChanged(key, rawKey)) {
866
857
  track(rawTarget, "has", key);
867
858
  }
868
859
  track(rawTarget, "has", rawKey);
@@ -1356,11 +1347,7 @@ function toRef(source, key, defaultValue) {
1356
1347
  }
1357
1348
  function propertyToRef(source, key, defaultValue) {
1358
1349
  const val = source[key];
1359
- return isRef(val) ? val : new ObjectRefImpl(
1360
- source,
1361
- key,
1362
- defaultValue
1363
- );
1350
+ return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1364
1351
  }
1365
1352
 
1366
1353
  class ComputedRefImpl {
@@ -2845,9 +2832,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
2845
2832
  }
2846
2833
  if (cb) {
2847
2834
  const newValue = effect.run();
2848
- if (deep || forceTrigger || (isMultiSource ? newValue.some(
2849
- (v, i) => hasChanged(v, oldValue[i])
2850
- ) : hasChanged(newValue, oldValue)) || isArray(newValue) && isCompatEnabled$1("WATCH_ARRAY", instance)) {
2835
+ if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || isArray(newValue) && isCompatEnabled$1("WATCH_ARRAY", instance)) {
2851
2836
  if (cleanup) {
2852
2837
  cleanup();
2853
2838
  }
@@ -3013,6 +2998,8 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3013
2998
  }
3014
2999
  }
3015
3000
 
3001
+ const leaveCbKey = Symbol("_leaveCb");
3002
+ const enterCbKey$1 = Symbol("_enterCb");
3016
3003
  function useTransitionState() {
3017
3004
  const state = {
3018
3005
  isMounted: false,
@@ -3123,9 +3110,9 @@ const BaseTransitionImpl = {
3123
3110
  oldInnerChild
3124
3111
  );
3125
3112
  leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
3126
- el._leaveCb = () => {
3113
+ el[leaveCbKey] = () => {
3127
3114
  earlyRemove();
3128
- el._leaveCb = void 0;
3115
+ el[leaveCbKey] = void 0;
3129
3116
  delete enterHooks.delayedLeave;
3130
3117
  };
3131
3118
  enterHooks.delayedLeave = delayedLeave;
@@ -3199,15 +3186,15 @@ function resolveTransitionHooks(vnode, props, state, instance) {
3199
3186
  return;
3200
3187
  }
3201
3188
  }
3202
- if (el._leaveCb) {
3203
- el._leaveCb(
3189
+ if (el[leaveCbKey]) {
3190
+ el[leaveCbKey](
3204
3191
  true
3205
3192
  /* cancelled */
3206
3193
  );
3207
3194
  }
3208
3195
  const leavingVNode = leavingVNodesCache[key];
3209
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el._leaveCb) {
3210
- leavingVNode.el._leaveCb();
3196
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
3197
+ leavingVNode.el[leaveCbKey]();
3211
3198
  }
3212
3199
  callHook(hook, [el]);
3213
3200
  },
@@ -3225,7 +3212,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
3225
3212
  }
3226
3213
  }
3227
3214
  let called = false;
3228
- const done = el._enterCb = (cancelled) => {
3215
+ const done = el[enterCbKey$1] = (cancelled) => {
3229
3216
  if (called)
3230
3217
  return;
3231
3218
  called = true;
@@ -3237,7 +3224,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
3237
3224
  if (hooks.delayedLeave) {
3238
3225
  hooks.delayedLeave();
3239
3226
  }
3240
- el._enterCb = void 0;
3227
+ el[enterCbKey$1] = void 0;
3241
3228
  };
3242
3229
  if (hook) {
3243
3230
  callAsyncHook(hook, [el, done]);
@@ -3247,8 +3234,8 @@ function resolveTransitionHooks(vnode, props, state, instance) {
3247
3234
  },
3248
3235
  leave(el, remove) {
3249
3236
  const key2 = String(vnode.key);
3250
- if (el._enterCb) {
3251
- el._enterCb(
3237
+ if (el[enterCbKey$1]) {
3238
+ el[enterCbKey$1](
3252
3239
  true
3253
3240
  /* cancelled */
3254
3241
  );
@@ -3258,7 +3245,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
3258
3245
  }
3259
3246
  callHook(onBeforeLeave, [el]);
3260
3247
  let called = false;
3261
- const done = el._leaveCb = (cancelled) => {
3248
+ const done = el[leaveCbKey] = (cancelled) => {
3262
3249
  if (called)
3263
3250
  return;
3264
3251
  called = true;
@@ -3268,7 +3255,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
3268
3255
  } else {
3269
3256
  callHook(onAfterLeave, [el]);
3270
3257
  }
3271
- el._leaveCb = void 0;
3258
+ el[leaveCbKey] = void 0;
3272
3259
  if (leavingVNodesCache[key2] === vnode) {
3273
3260
  delete leavingVNodesCache[key2];
3274
3261
  }
@@ -3330,6 +3317,8 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
3330
3317
  return ret;
3331
3318
  }
3332
3319
 
3320
+ /*! #__NO_SIDE_EFFECTS__ */
3321
+ // @__NO_SIDE_EFFECTS__
3333
3322
  function defineComponent(options, extraOptions) {
3334
3323
  return isFunction(options) ? (
3335
3324
  // #8326: extend call and options.name access are considered side-effects
@@ -3339,6 +3328,8 @@ function defineComponent(options, extraOptions) {
3339
3328
  }
3340
3329
 
3341
3330
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
3331
+ /*! #__NO_SIDE_EFFECTS__ */
3332
+ // @__NO_SIDE_EFFECTS__
3342
3333
  function defineAsyncComponent(source) {
3343
3334
  if (isFunction(source)) {
3344
3335
  source = { loader: source };
@@ -4042,7 +4033,7 @@ function defineLegacyVNodeProperties(vnode) {
4042
4033
  }
4043
4034
  }
4044
4035
 
4045
- const normalizedFunctionalComponentMap = /* @__PURE__ */ new Map();
4036
+ const normalizedFunctionalComponentMap = /* @__PURE__ */ new WeakMap();
4046
4037
  const legacySlotProxyHandlers = {
4047
4038
  get(target, key) {
4048
4039
  const slot = target[key];
@@ -4310,6 +4301,7 @@ function legacyPrependModifier(value, symbol) {
4310
4301
  function installCompatInstanceProperties(map) {
4311
4302
  const set = (target, key, val) => {
4312
4303
  target[key] = val;
4304
+ return target[key];
4313
4305
  };
4314
4306
  const del = (target, key) => {
4315
4307
  delete target[key];
@@ -4545,7 +4537,7 @@ const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend(
4545
4537
  return PublicInstanceProxyHandlers.get(target, key, target);
4546
4538
  },
4547
4539
  has(_, key) {
4548
- const has = key[0] !== "_" && !isGloballyWhitelisted(key);
4540
+ const has = key[0] !== "_" && !isGloballyAllowed(key);
4549
4541
  return has;
4550
4542
  }
4551
4543
  }
@@ -5073,7 +5065,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5073
5065
  return vm;
5074
5066
  }
5075
5067
  }
5076
- Vue.version = `2.6.14-compat:${"3.3.4"}`;
5068
+ Vue.version = `2.6.14-compat:${"3.3.6"}`;
5077
5069
  Vue.config = singletonApp.config;
5078
5070
  Vue.use = (p, ...options) => {
5079
5071
  if (p && isFunction(p.install)) {
@@ -5435,7 +5427,7 @@ function createAppAPI(render, hydrate) {
5435
5427
  rootProps = null;
5436
5428
  }
5437
5429
  const context = createAppContext();
5438
- const installedPlugins = /* @__PURE__ */ new Set();
5430
+ const installedPlugins = /* @__PURE__ */ new WeakSet();
5439
5431
  let isMounted = false;
5440
5432
  const app = context.app = {
5441
5433
  _uid: uid$1++,
@@ -5484,10 +5476,7 @@ function createAppAPI(render, hydrate) {
5484
5476
  },
5485
5477
  mount(rootContainer, isHydrate, isSVG) {
5486
5478
  if (!isMounted) {
5487
- const vnode = createVNode(
5488
- rootComponent,
5489
- rootProps
5490
- );
5479
+ const vnode = createVNode(rootComponent, rootProps);
5491
5480
  vnode.appContext = context;
5492
5481
  if (isHydrate && hydrate) {
5493
5482
  hydrate(vnode, rootContainer);
@@ -5973,7 +5962,7 @@ const updateSlots = (instance, children, optimized) => {
5973
5962
  }
5974
5963
  if (needDeletionCheck) {
5975
5964
  for (const key in slots) {
5976
- if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {
5965
+ if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
5977
5966
  delete slots[key];
5978
5967
  }
5979
5968
  }
@@ -7879,6 +7868,10 @@ const TeleportImpl = {
7879
7868
  internals,
7880
7869
  1
7881
7870
  );
7871
+ } else {
7872
+ if (n2.props && n1.props && n2.props.to !== n1.props.to) {
7873
+ n2.props.to = n1.props.to;
7874
+ }
7882
7875
  }
7883
7876
  } else {
7884
7877
  if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
@@ -7913,19 +7906,18 @@ const TeleportImpl = {
7913
7906
  if (target) {
7914
7907
  hostRemove(targetAnchor);
7915
7908
  }
7916
- if (doRemove || !isTeleportDisabled(props)) {
7917
- hostRemove(anchor);
7918
- if (shapeFlag & 16) {
7919
- for (let i = 0; i < children.length; i++) {
7920
- const child = children[i];
7921
- unmount(
7922
- child,
7923
- parentComponent,
7924
- parentSuspense,
7925
- true,
7926
- !!child.dynamicChildren
7927
- );
7928
- }
7909
+ doRemove && hostRemove(anchor);
7910
+ if (shapeFlag & 16) {
7911
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
7912
+ for (let i = 0; i < children.length; i++) {
7913
+ const child = children[i];
7914
+ unmount(
7915
+ child,
7916
+ parentComponent,
7917
+ parentSuspense,
7918
+ shouldRemove,
7919
+ !!child.dynamicChildren
7920
+ );
7929
7921
  }
7930
7922
  }
7931
7923
  },
@@ -8009,7 +8001,7 @@ function updateCssVars(vnode) {
8009
8001
  const ctx = vnode.ctx;
8010
8002
  if (ctx && ctx.ut) {
8011
8003
  let node = vnode.children[0].el;
8012
- while (node !== vnode.targetAnchor) {
8004
+ while (node && node !== vnode.targetAnchor) {
8013
8005
  if (node.nodeType === 1)
8014
8006
  node.setAttribute("data-v-owner", ctx.uid);
8015
8007
  node = node.nextSibling;
@@ -8018,7 +8010,7 @@ function updateCssVars(vnode) {
8018
8010
  }
8019
8011
  }
8020
8012
 
8021
- const normalizedAsyncComponentMap = /* @__PURE__ */ new Map();
8013
+ const normalizedAsyncComponentMap = /* @__PURE__ */ new WeakMap();
8022
8014
  function convertLegacyAsyncComponent(comp) {
8023
8015
  if (normalizedAsyncComponentMap.has(comp)) {
8024
8016
  return normalizedAsyncComponentMap.get(comp);
@@ -8639,9 +8631,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
8639
8631
  if (!skipOptions) {
8640
8632
  setCurrentInstance(instance);
8641
8633
  pauseTracking();
8642
- applyOptions(instance);
8643
- resetTracking();
8644
- unsetCurrentInstance();
8634
+ try {
8635
+ applyOptions(instance);
8636
+ } finally {
8637
+ resetTracking();
8638
+ unsetCurrentInstance();
8639
+ }
8645
8640
  }
8646
8641
  }
8647
8642
  function getAttrsProxy(instance) {
@@ -8757,7 +8752,7 @@ function isMemoSame(cached, memo) {
8757
8752
  return true;
8758
8753
  }
8759
8754
 
8760
- const version = "3.3.4";
8755
+ const version = "3.3.6";
8761
8756
  const _ssrUtils = {
8762
8757
  createComponentInstance,
8763
8758
  setupComponent,
@@ -8844,135 +8839,485 @@ const nodeOps = {
8844
8839
  }
8845
8840
  };
8846
8841
 
8847
- function patchClass(el, value, isSVG) {
8848
- const transitionClasses = el._vtc;
8849
- if (transitionClasses) {
8850
- value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
8851
- }
8852
- if (value == null) {
8853
- el.removeAttribute("class");
8854
- } else if (isSVG) {
8855
- el.setAttribute("class", value);
8856
- } else {
8857
- el.className = value;
8858
- }
8842
+ const TRANSITION$1 = "transition";
8843
+ const ANIMATION = "animation";
8844
+ const vtcKey = Symbol("_vtc");
8845
+ const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
8846
+ Transition.displayName = "Transition";
8847
+ {
8848
+ Transition.__isBuiltIn = true;
8859
8849
  }
8860
-
8861
- function patchStyle(el, prev, next) {
8862
- const style = el.style;
8863
- const isCssString = isString(next);
8864
- if (next && !isCssString) {
8865
- if (prev && !isString(prev)) {
8866
- for (const key in prev) {
8867
- if (next[key] == null) {
8868
- setStyle(style, key, "");
8869
- }
8870
- }
8871
- }
8872
- for (const key in next) {
8873
- setStyle(style, key, next[key]);
8874
- }
8875
- } else {
8876
- const currentDisplay = style.display;
8877
- if (isCssString) {
8878
- if (prev !== next) {
8879
- style.cssText = next;
8880
- }
8881
- } else if (prev) {
8882
- el.removeAttribute("style");
8883
- }
8884
- if ("_vod" in el) {
8885
- style.display = currentDisplay;
8886
- }
8850
+ const DOMTransitionPropsValidators = {
8851
+ name: String,
8852
+ type: String,
8853
+ css: {
8854
+ type: Boolean,
8855
+ default: true
8856
+ },
8857
+ duration: [String, Number, Object],
8858
+ enterFromClass: String,
8859
+ enterActiveClass: String,
8860
+ enterToClass: String,
8861
+ appearFromClass: String,
8862
+ appearActiveClass: String,
8863
+ appearToClass: String,
8864
+ leaveFromClass: String,
8865
+ leaveActiveClass: String,
8866
+ leaveToClass: String
8867
+ };
8868
+ const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
8869
+ {},
8870
+ BaseTransitionPropsValidators,
8871
+ DOMTransitionPropsValidators
8872
+ );
8873
+ const callHook = (hook, args = []) => {
8874
+ if (isArray(hook)) {
8875
+ hook.forEach((h2) => h2(...args));
8876
+ } else if (hook) {
8877
+ hook(...args);
8887
8878
  }
8888
- }
8889
- const importantRE = /\s*!important$/;
8890
- function setStyle(style, name, val) {
8891
- if (isArray(val)) {
8892
- val.forEach((v) => setStyle(style, name, v));
8893
- } else {
8894
- if (val == null)
8895
- val = "";
8896
- if (name.startsWith("--")) {
8897
- style.setProperty(name, val);
8898
- } else {
8899
- const prefixed = autoPrefix(style, name);
8900
- if (importantRE.test(val)) {
8901
- style.setProperty(
8902
- hyphenate(prefixed),
8903
- val.replace(importantRE, ""),
8904
- "important"
8905
- );
8906
- } else {
8907
- style[prefixed] = val;
8908
- }
8879
+ };
8880
+ const hasExplicitCallback = (hook) => {
8881
+ return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
8882
+ };
8883
+ function resolveTransitionProps(rawProps) {
8884
+ const baseProps = {};
8885
+ for (const key in rawProps) {
8886
+ if (!(key in DOMTransitionPropsValidators)) {
8887
+ baseProps[key] = rawProps[key];
8909
8888
  }
8910
8889
  }
8911
- }
8912
- const prefixes = ["Webkit", "Moz", "ms"];
8913
- const prefixCache = {};
8914
- function autoPrefix(style, rawName) {
8915
- const cached = prefixCache[rawName];
8916
- if (cached) {
8917
- return cached;
8918
- }
8919
- let name = camelize(rawName);
8920
- if (name !== "filter" && name in style) {
8921
- return prefixCache[rawName] = name;
8922
- }
8923
- name = capitalize(name);
8924
- for (let i = 0; i < prefixes.length; i++) {
8925
- const prefixed = prefixes[i] + name;
8926
- if (prefixed in style) {
8927
- return prefixCache[rawName] = prefixed;
8928
- }
8890
+ if (rawProps.css === false) {
8891
+ return baseProps;
8929
8892
  }
8930
- return rawName;
8931
- }
8932
-
8933
- const xlinkNS = "http://www.w3.org/1999/xlink";
8934
- function patchAttr(el, key, value, isSVG, instance) {
8935
- if (isSVG && key.startsWith("xlink:")) {
8936
- if (value == null) {
8937
- el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
8938
- } else {
8939
- el.setAttributeNS(xlinkNS, key, value);
8940
- }
8941
- } else {
8942
- if (compatCoerceAttr(el, key, value, instance)) {
8943
- return;
8893
+ const {
8894
+ name = "v",
8895
+ type,
8896
+ duration,
8897
+ enterFromClass = `${name}-enter-from`,
8898
+ enterActiveClass = `${name}-enter-active`,
8899
+ enterToClass = `${name}-enter-to`,
8900
+ appearFromClass = enterFromClass,
8901
+ appearActiveClass = enterActiveClass,
8902
+ appearToClass = enterToClass,
8903
+ leaveFromClass = `${name}-leave-from`,
8904
+ leaveActiveClass = `${name}-leave-active`,
8905
+ leaveToClass = `${name}-leave-to`
8906
+ } = rawProps;
8907
+ const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES", null);
8908
+ let legacyEnterFromClass;
8909
+ let legacyAppearFromClass;
8910
+ let legacyLeaveFromClass;
8911
+ if (legacyClassEnabled) {
8912
+ const toLegacyClass = (cls) => cls.replace(/-from$/, "");
8913
+ if (!rawProps.enterFromClass) {
8914
+ legacyEnterFromClass = toLegacyClass(enterFromClass);
8944
8915
  }
8945
- const isBoolean = isSpecialBooleanAttr(key);
8946
- if (value == null || isBoolean && !includeBooleanAttr(value)) {
8947
- el.removeAttribute(key);
8948
- } else {
8949
- el.setAttribute(key, isBoolean ? "" : value);
8916
+ if (!rawProps.appearFromClass) {
8917
+ legacyAppearFromClass = toLegacyClass(appearFromClass);
8950
8918
  }
8951
- }
8952
- }
8953
- const isEnumeratedAttr = /* @__PURE__ */ makeMap("contenteditable,draggable,spellcheck") ;
8954
- function compatCoerceAttr(el, key, value, instance = null) {
8955
- if (isEnumeratedAttr(key)) {
8956
- const v2CoercedValue = value === null ? "false" : typeof value !== "boolean" && value !== void 0 ? "true" : null;
8957
- if (v2CoercedValue && compatUtils.softAssertCompatEnabled(
8958
- "ATTR_ENUMERATED_COERCION",
8959
- instance,
8960
- key,
8961
- value,
8962
- v2CoercedValue
8963
- )) {
8964
- el.setAttribute(key, v2CoercedValue);
8965
- return true;
8919
+ if (!rawProps.leaveFromClass) {
8920
+ legacyLeaveFromClass = toLegacyClass(leaveFromClass);
8966
8921
  }
8967
- } else if (value === false && !isSpecialBooleanAttr(key) && compatUtils.softAssertCompatEnabled(
8968
- "ATTR_FALSE_VALUE",
8969
- instance,
8970
- key
8971
- )) {
8972
- el.removeAttribute(key);
8973
- return true;
8974
8922
  }
8975
- return false;
8923
+ const durations = normalizeDuration(duration);
8924
+ const enterDuration = durations && durations[0];
8925
+ const leaveDuration = durations && durations[1];
8926
+ const {
8927
+ onBeforeEnter,
8928
+ onEnter,
8929
+ onEnterCancelled,
8930
+ onLeave,
8931
+ onLeaveCancelled,
8932
+ onBeforeAppear = onBeforeEnter,
8933
+ onAppear = onEnter,
8934
+ onAppearCancelled = onEnterCancelled
8935
+ } = baseProps;
8936
+ const finishEnter = (el, isAppear, done) => {
8937
+ removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
8938
+ removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
8939
+ done && done();
8940
+ };
8941
+ const finishLeave = (el, done) => {
8942
+ el._isLeaving = false;
8943
+ removeTransitionClass(el, leaveFromClass);
8944
+ removeTransitionClass(el, leaveToClass);
8945
+ removeTransitionClass(el, leaveActiveClass);
8946
+ done && done();
8947
+ };
8948
+ const makeEnterHook = (isAppear) => {
8949
+ return (el, done) => {
8950
+ const hook = isAppear ? onAppear : onEnter;
8951
+ const resolve = () => finishEnter(el, isAppear, done);
8952
+ callHook(hook, [el, resolve]);
8953
+ nextFrame(() => {
8954
+ removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
8955
+ if (legacyClassEnabled) {
8956
+ const legacyClass = isAppear ? legacyAppearFromClass : legacyEnterFromClass;
8957
+ if (legacyClass) {
8958
+ removeTransitionClass(el, legacyClass);
8959
+ }
8960
+ }
8961
+ addTransitionClass(el, isAppear ? appearToClass : enterToClass);
8962
+ if (!hasExplicitCallback(hook)) {
8963
+ whenTransitionEnds(el, type, enterDuration, resolve);
8964
+ }
8965
+ });
8966
+ };
8967
+ };
8968
+ return extend(baseProps, {
8969
+ onBeforeEnter(el) {
8970
+ callHook(onBeforeEnter, [el]);
8971
+ addTransitionClass(el, enterFromClass);
8972
+ if (legacyClassEnabled && legacyEnterFromClass) {
8973
+ addTransitionClass(el, legacyEnterFromClass);
8974
+ }
8975
+ addTransitionClass(el, enterActiveClass);
8976
+ },
8977
+ onBeforeAppear(el) {
8978
+ callHook(onBeforeAppear, [el]);
8979
+ addTransitionClass(el, appearFromClass);
8980
+ if (legacyClassEnabled && legacyAppearFromClass) {
8981
+ addTransitionClass(el, legacyAppearFromClass);
8982
+ }
8983
+ addTransitionClass(el, appearActiveClass);
8984
+ },
8985
+ onEnter: makeEnterHook(false),
8986
+ onAppear: makeEnterHook(true),
8987
+ onLeave(el, done) {
8988
+ el._isLeaving = true;
8989
+ const resolve = () => finishLeave(el, done);
8990
+ addTransitionClass(el, leaveFromClass);
8991
+ if (legacyClassEnabled && legacyLeaveFromClass) {
8992
+ addTransitionClass(el, legacyLeaveFromClass);
8993
+ }
8994
+ forceReflow();
8995
+ addTransitionClass(el, leaveActiveClass);
8996
+ nextFrame(() => {
8997
+ if (!el._isLeaving) {
8998
+ return;
8999
+ }
9000
+ removeTransitionClass(el, leaveFromClass);
9001
+ if (legacyClassEnabled && legacyLeaveFromClass) {
9002
+ removeTransitionClass(el, legacyLeaveFromClass);
9003
+ }
9004
+ addTransitionClass(el, leaveToClass);
9005
+ if (!hasExplicitCallback(onLeave)) {
9006
+ whenTransitionEnds(el, type, leaveDuration, resolve);
9007
+ }
9008
+ });
9009
+ callHook(onLeave, [el, resolve]);
9010
+ },
9011
+ onEnterCancelled(el) {
9012
+ finishEnter(el, false);
9013
+ callHook(onEnterCancelled, [el]);
9014
+ },
9015
+ onAppearCancelled(el) {
9016
+ finishEnter(el, true);
9017
+ callHook(onAppearCancelled, [el]);
9018
+ },
9019
+ onLeaveCancelled(el) {
9020
+ finishLeave(el);
9021
+ callHook(onLeaveCancelled, [el]);
9022
+ }
9023
+ });
9024
+ }
9025
+ function normalizeDuration(duration) {
9026
+ if (duration == null) {
9027
+ return null;
9028
+ } else if (isObject(duration)) {
9029
+ return [NumberOf(duration.enter), NumberOf(duration.leave)];
9030
+ } else {
9031
+ const n = NumberOf(duration);
9032
+ return [n, n];
9033
+ }
9034
+ }
9035
+ function NumberOf(val) {
9036
+ const res = toNumber(val);
9037
+ return res;
9038
+ }
9039
+ function addTransitionClass(el, cls) {
9040
+ cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
9041
+ (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
9042
+ }
9043
+ function removeTransitionClass(el, cls) {
9044
+ cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
9045
+ const _vtc = el[vtcKey];
9046
+ if (_vtc) {
9047
+ _vtc.delete(cls);
9048
+ if (!_vtc.size) {
9049
+ el[vtcKey] = void 0;
9050
+ }
9051
+ }
9052
+ }
9053
+ function nextFrame(cb) {
9054
+ requestAnimationFrame(() => {
9055
+ requestAnimationFrame(cb);
9056
+ });
9057
+ }
9058
+ let endId = 0;
9059
+ function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
9060
+ const id = el._endId = ++endId;
9061
+ const resolveIfNotStale = () => {
9062
+ if (id === el._endId) {
9063
+ resolve();
9064
+ }
9065
+ };
9066
+ if (explicitTimeout) {
9067
+ return setTimeout(resolveIfNotStale, explicitTimeout);
9068
+ }
9069
+ const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
9070
+ if (!type) {
9071
+ return resolve();
9072
+ }
9073
+ const endEvent = type + "end";
9074
+ let ended = 0;
9075
+ const end = () => {
9076
+ el.removeEventListener(endEvent, onEnd);
9077
+ resolveIfNotStale();
9078
+ };
9079
+ const onEnd = (e) => {
9080
+ if (e.target === el && ++ended >= propCount) {
9081
+ end();
9082
+ }
9083
+ };
9084
+ setTimeout(() => {
9085
+ if (ended < propCount) {
9086
+ end();
9087
+ }
9088
+ }, timeout + 1);
9089
+ el.addEventListener(endEvent, onEnd);
9090
+ }
9091
+ function getTransitionInfo(el, expectedType) {
9092
+ const styles = window.getComputedStyle(el);
9093
+ const getStyleProperties = (key) => (styles[key] || "").split(", ");
9094
+ const transitionDelays = getStyleProperties(`${TRANSITION$1}Delay`);
9095
+ const transitionDurations = getStyleProperties(`${TRANSITION$1}Duration`);
9096
+ const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
9097
+ const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
9098
+ const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
9099
+ const animationTimeout = getTimeout(animationDelays, animationDurations);
9100
+ let type = null;
9101
+ let timeout = 0;
9102
+ let propCount = 0;
9103
+ if (expectedType === TRANSITION$1) {
9104
+ if (transitionTimeout > 0) {
9105
+ type = TRANSITION$1;
9106
+ timeout = transitionTimeout;
9107
+ propCount = transitionDurations.length;
9108
+ }
9109
+ } else if (expectedType === ANIMATION) {
9110
+ if (animationTimeout > 0) {
9111
+ type = ANIMATION;
9112
+ timeout = animationTimeout;
9113
+ propCount = animationDurations.length;
9114
+ }
9115
+ } else {
9116
+ timeout = Math.max(transitionTimeout, animationTimeout);
9117
+ type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION$1 : ANIMATION : null;
9118
+ propCount = type ? type === TRANSITION$1 ? transitionDurations.length : animationDurations.length : 0;
9119
+ }
9120
+ const hasTransform = type === TRANSITION$1 && /\b(transform|all)(,|$)/.test(
9121
+ getStyleProperties(`${TRANSITION$1}Property`).toString()
9122
+ );
9123
+ return {
9124
+ type,
9125
+ timeout,
9126
+ propCount,
9127
+ hasTransform
9128
+ };
9129
+ }
9130
+ function getTimeout(delays, durations) {
9131
+ while (delays.length < durations.length) {
9132
+ delays = delays.concat(delays);
9133
+ }
9134
+ return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
9135
+ }
9136
+ function toMs(s) {
9137
+ if (s === "auto")
9138
+ return 0;
9139
+ return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
9140
+ }
9141
+ function forceReflow() {
9142
+ return document.body.offsetHeight;
9143
+ }
9144
+
9145
+ function patchClass(el, value, isSVG) {
9146
+ const transitionClasses = el[vtcKey];
9147
+ if (transitionClasses) {
9148
+ value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
9149
+ }
9150
+ if (value == null) {
9151
+ el.removeAttribute("class");
9152
+ } else if (isSVG) {
9153
+ el.setAttribute("class", value);
9154
+ } else {
9155
+ el.className = value;
9156
+ }
9157
+ }
9158
+
9159
+ const vShowOldKey = Symbol("_vod");
9160
+ const vShow = {
9161
+ beforeMount(el, { value }, { transition }) {
9162
+ el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display;
9163
+ if (transition && value) {
9164
+ transition.beforeEnter(el);
9165
+ } else {
9166
+ setDisplay(el, value);
9167
+ }
9168
+ },
9169
+ mounted(el, { value }, { transition }) {
9170
+ if (transition && value) {
9171
+ transition.enter(el);
9172
+ }
9173
+ },
9174
+ updated(el, { value, oldValue }, { transition }) {
9175
+ if (!value === !oldValue)
9176
+ return;
9177
+ if (transition) {
9178
+ if (value) {
9179
+ transition.beforeEnter(el);
9180
+ setDisplay(el, true);
9181
+ transition.enter(el);
9182
+ } else {
9183
+ transition.leave(el, () => {
9184
+ setDisplay(el, false);
9185
+ });
9186
+ }
9187
+ } else {
9188
+ setDisplay(el, value);
9189
+ }
9190
+ },
9191
+ beforeUnmount(el, { value }) {
9192
+ setDisplay(el, value);
9193
+ }
9194
+ };
9195
+ function setDisplay(el, value) {
9196
+ el.style.display = value ? el[vShowOldKey] : "none";
9197
+ }
9198
+ function initVShowForSSR() {
9199
+ vShow.getSSRProps = ({ value }) => {
9200
+ if (!value) {
9201
+ return { style: { display: "none" } };
9202
+ }
9203
+ };
9204
+ }
9205
+
9206
+ function patchStyle(el, prev, next) {
9207
+ const style = el.style;
9208
+ const isCssString = isString(next);
9209
+ if (next && !isCssString) {
9210
+ if (prev && !isString(prev)) {
9211
+ for (const key in prev) {
9212
+ if (next[key] == null) {
9213
+ setStyle(style, key, "");
9214
+ }
9215
+ }
9216
+ }
9217
+ for (const key in next) {
9218
+ setStyle(style, key, next[key]);
9219
+ }
9220
+ } else {
9221
+ const currentDisplay = style.display;
9222
+ if (isCssString) {
9223
+ if (prev !== next) {
9224
+ style.cssText = next;
9225
+ }
9226
+ } else if (prev) {
9227
+ el.removeAttribute("style");
9228
+ }
9229
+ if (vShowOldKey in el) {
9230
+ style.display = currentDisplay;
9231
+ }
9232
+ }
9233
+ }
9234
+ const importantRE = /\s*!important$/;
9235
+ function setStyle(style, name, val) {
9236
+ if (isArray(val)) {
9237
+ val.forEach((v) => setStyle(style, name, v));
9238
+ } else {
9239
+ if (val == null)
9240
+ val = "";
9241
+ if (name.startsWith("--")) {
9242
+ style.setProperty(name, val);
9243
+ } else {
9244
+ const prefixed = autoPrefix(style, name);
9245
+ if (importantRE.test(val)) {
9246
+ style.setProperty(
9247
+ hyphenate(prefixed),
9248
+ val.replace(importantRE, ""),
9249
+ "important"
9250
+ );
9251
+ } else {
9252
+ style[prefixed] = val;
9253
+ }
9254
+ }
9255
+ }
9256
+ }
9257
+ const prefixes = ["Webkit", "Moz", "ms"];
9258
+ const prefixCache = {};
9259
+ function autoPrefix(style, rawName) {
9260
+ const cached = prefixCache[rawName];
9261
+ if (cached) {
9262
+ return cached;
9263
+ }
9264
+ let name = camelize(rawName);
9265
+ if (name !== "filter" && name in style) {
9266
+ return prefixCache[rawName] = name;
9267
+ }
9268
+ name = capitalize(name);
9269
+ for (let i = 0; i < prefixes.length; i++) {
9270
+ const prefixed = prefixes[i] + name;
9271
+ if (prefixed in style) {
9272
+ return prefixCache[rawName] = prefixed;
9273
+ }
9274
+ }
9275
+ return rawName;
9276
+ }
9277
+
9278
+ const xlinkNS = "http://www.w3.org/1999/xlink";
9279
+ function patchAttr(el, key, value, isSVG, instance) {
9280
+ if (isSVG && key.startsWith("xlink:")) {
9281
+ if (value == null) {
9282
+ el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
9283
+ } else {
9284
+ el.setAttributeNS(xlinkNS, key, value);
9285
+ }
9286
+ } else {
9287
+ if (compatCoerceAttr(el, key, value, instance)) {
9288
+ return;
9289
+ }
9290
+ const isBoolean = isSpecialBooleanAttr(key);
9291
+ if (value == null || isBoolean && !includeBooleanAttr(value)) {
9292
+ el.removeAttribute(key);
9293
+ } else {
9294
+ el.setAttribute(key, isBoolean ? "" : value);
9295
+ }
9296
+ }
9297
+ }
9298
+ const isEnumeratedAttr = /* @__PURE__ */ makeMap("contenteditable,draggable,spellcheck") ;
9299
+ function compatCoerceAttr(el, key, value, instance = null) {
9300
+ if (isEnumeratedAttr(key)) {
9301
+ const v2CoercedValue = value === null ? "false" : typeof value !== "boolean" && value !== void 0 ? "true" : null;
9302
+ if (v2CoercedValue && compatUtils.softAssertCompatEnabled(
9303
+ "ATTR_ENUMERATED_COERCION",
9304
+ instance,
9305
+ key,
9306
+ value,
9307
+ v2CoercedValue
9308
+ )) {
9309
+ el.setAttribute(key, v2CoercedValue);
9310
+ return true;
9311
+ }
9312
+ } else if (value === false && !isSpecialBooleanAttr(key) && compatUtils.softAssertCompatEnabled(
9313
+ "ATTR_FALSE_VALUE",
9314
+ instance,
9315
+ key
9316
+ )) {
9317
+ el.removeAttribute(key);
9318
+ return true;
9319
+ }
9320
+ return false;
8976
9321
  }
8977
9322
 
8978
9323
  function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
@@ -9034,8 +9379,9 @@ function addEventListener(el, event, handler, options) {
9034
9379
  function removeEventListener(el, event, handler, options) {
9035
9380
  el.removeEventListener(event, handler, options);
9036
9381
  }
9382
+ const veiKey = Symbol("_vei");
9037
9383
  function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
9038
- const invokers = el._vei || (el._vei = {});
9384
+ const invokers = el[veiKey] || (el[veiKey] = {});
9039
9385
  const existingInvoker = invokers[rawName];
9040
9386
  if (nextValue && existingInvoker) {
9041
9387
  existingInvoker.value = nextValue;
@@ -9140,539 +9486,250 @@ function shouldSetAsProp(el, key, value, isSVG) {
9140
9486
  if (key === "spellcheck" || key === "draggable" || key === "translate") {
9141
9487
  return false;
9142
9488
  }
9143
- if (key === "form") {
9144
- return false;
9145
- }
9146
- if (key === "list" && el.tagName === "INPUT") {
9147
- return false;
9148
- }
9149
- if (key === "type" && el.tagName === "TEXTAREA") {
9150
- return false;
9151
- }
9152
- if (nativeOnRE.test(key) && isString(value)) {
9153
- return false;
9154
- }
9155
- return key in el;
9156
- }
9157
-
9158
- function defineCustomElement(options, hydrate2) {
9159
- const Comp = defineComponent(options);
9160
- class VueCustomElement extends VueElement {
9161
- constructor(initialProps) {
9162
- super(Comp, initialProps, hydrate2);
9163
- }
9164
- }
9165
- VueCustomElement.def = Comp;
9166
- return VueCustomElement;
9167
- }
9168
- const defineSSRCustomElement = (options) => {
9169
- return defineCustomElement(options, hydrate);
9170
- };
9171
- const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
9172
- };
9173
- class VueElement extends BaseClass {
9174
- constructor(_def, _props = {}, hydrate2) {
9175
- super();
9176
- this._def = _def;
9177
- this._props = _props;
9178
- /**
9179
- * @internal
9180
- */
9181
- this._instance = null;
9182
- this._connected = false;
9183
- this._resolved = false;
9184
- this._numberProps = null;
9185
- if (this.shadowRoot && hydrate2) {
9186
- hydrate2(this._createVNode(), this.shadowRoot);
9187
- } else {
9188
- this.attachShadow({ mode: "open" });
9189
- if (!this._def.__asyncLoader) {
9190
- this._resolveProps(this._def);
9191
- }
9192
- }
9193
- }
9194
- connectedCallback() {
9195
- this._connected = true;
9196
- if (!this._instance) {
9197
- if (this._resolved) {
9198
- this._update();
9199
- } else {
9200
- this._resolveDef();
9201
- }
9202
- }
9203
- }
9204
- disconnectedCallback() {
9205
- this._connected = false;
9206
- nextTick(() => {
9207
- if (!this._connected) {
9208
- render(null, this.shadowRoot);
9209
- this._instance = null;
9210
- }
9211
- });
9212
- }
9213
- /**
9214
- * resolve inner component definition (handle possible async component)
9215
- */
9216
- _resolveDef() {
9217
- this._resolved = true;
9218
- for (let i = 0; i < this.attributes.length; i++) {
9219
- this._setAttr(this.attributes[i].name);
9220
- }
9221
- new MutationObserver((mutations) => {
9222
- for (const m of mutations) {
9223
- this._setAttr(m.attributeName);
9224
- }
9225
- }).observe(this, { attributes: true });
9226
- const resolve = (def, isAsync = false) => {
9227
- const { props, styles } = def;
9228
- let numberProps;
9229
- if (props && !isArray(props)) {
9230
- for (const key in props) {
9231
- const opt = props[key];
9232
- if (opt === Number || opt && opt.type === Number) {
9233
- if (key in this._props) {
9234
- this._props[key] = toNumber(this._props[key]);
9235
- }
9236
- (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
9237
- }
9238
- }
9239
- }
9240
- this._numberProps = numberProps;
9241
- if (isAsync) {
9242
- this._resolveProps(def);
9243
- }
9244
- this._applyStyles(styles);
9245
- this._update();
9246
- };
9247
- const asyncDef = this._def.__asyncLoader;
9248
- if (asyncDef) {
9249
- asyncDef().then((def) => resolve(def, true));
9250
- } else {
9251
- resolve(this._def);
9252
- }
9253
- }
9254
- _resolveProps(def) {
9255
- const { props } = def;
9256
- const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
9257
- for (const key of Object.keys(this)) {
9258
- if (key[0] !== "_" && declaredPropKeys.includes(key)) {
9259
- this._setProp(key, this[key], true, false);
9260
- }
9261
- }
9262
- for (const key of declaredPropKeys.map(camelize)) {
9263
- Object.defineProperty(this, key, {
9264
- get() {
9265
- return this._getProp(key);
9266
- },
9267
- set(val) {
9268
- this._setProp(key, val);
9269
- }
9270
- });
9271
- }
9272
- }
9273
- _setAttr(key) {
9274
- let value = this.getAttribute(key);
9275
- const camelKey = camelize(key);
9276
- if (this._numberProps && this._numberProps[camelKey]) {
9277
- value = toNumber(value);
9278
- }
9279
- this._setProp(camelKey, value, false);
9280
- }
9281
- /**
9282
- * @internal
9283
- */
9284
- _getProp(key) {
9285
- return this._props[key];
9286
- }
9287
- /**
9288
- * @internal
9289
- */
9290
- _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
9291
- if (val !== this._props[key]) {
9292
- this._props[key] = val;
9293
- if (shouldUpdate && this._instance) {
9294
- this._update();
9295
- }
9296
- if (shouldReflect) {
9297
- if (val === true) {
9298
- this.setAttribute(hyphenate(key), "");
9299
- } else if (typeof val === "string" || typeof val === "number") {
9300
- this.setAttribute(hyphenate(key), val + "");
9301
- } else if (!val) {
9302
- this.removeAttribute(hyphenate(key));
9303
- }
9304
- }
9305
- }
9306
- }
9307
- _update() {
9308
- render(this._createVNode(), this.shadowRoot);
9309
- }
9310
- _createVNode() {
9311
- const vnode = createVNode(this._def, extend({}, this._props));
9312
- if (!this._instance) {
9313
- vnode.ce = (instance) => {
9314
- this._instance = instance;
9315
- instance.isCE = true;
9316
- const dispatch = (event, args) => {
9317
- this.dispatchEvent(
9318
- new CustomEvent(event, {
9319
- detail: args
9320
- })
9321
- );
9322
- };
9323
- instance.emit = (event, ...args) => {
9324
- dispatch(event, args);
9325
- if (hyphenate(event) !== event) {
9326
- dispatch(hyphenate(event), args);
9327
- }
9328
- };
9329
- let parent = this;
9330
- while (parent = parent && (parent.parentNode || parent.host)) {
9331
- if (parent instanceof VueElement) {
9332
- instance.parent = parent._instance;
9333
- instance.provides = parent._instance.provides;
9334
- break;
9335
- }
9336
- }
9337
- };
9338
- }
9339
- return vnode;
9340
- }
9341
- _applyStyles(styles) {
9342
- if (styles) {
9343
- styles.forEach((css) => {
9344
- const s = document.createElement("style");
9345
- s.textContent = css;
9346
- this.shadowRoot.appendChild(s);
9347
- });
9348
- }
9349
- }
9350
- }
9351
-
9352
- function useCssModule(name = "$style") {
9353
- {
9354
- const instance = getCurrentInstance();
9355
- if (!instance) {
9356
- return EMPTY_OBJ;
9357
- }
9358
- const modules = instance.type.__cssModules;
9359
- if (!modules) {
9360
- return EMPTY_OBJ;
9361
- }
9362
- const mod = modules[name];
9363
- if (!mod) {
9364
- return EMPTY_OBJ;
9365
- }
9366
- return mod;
9489
+ if (key === "form") {
9490
+ return false;
9367
9491
  }
9492
+ if (key === "list" && el.tagName === "INPUT") {
9493
+ return false;
9494
+ }
9495
+ if (key === "type" && el.tagName === "TEXTAREA") {
9496
+ return false;
9497
+ }
9498
+ if (nativeOnRE.test(key) && isString(value)) {
9499
+ return false;
9500
+ }
9501
+ return key in el;
9368
9502
  }
9369
9503
 
9370
- function useCssVars(getter) {
9371
- return;
9372
- }
9373
-
9374
- const TRANSITION$1 = "transition";
9375
- const ANIMATION = "animation";
9376
- const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
9377
- Transition.displayName = "Transition";
9378
- {
9379
- Transition.__isBuiltIn = true;
9380
- }
9381
- const DOMTransitionPropsValidators = {
9382
- name: String,
9383
- type: String,
9384
- css: {
9385
- type: Boolean,
9386
- default: true
9387
- },
9388
- duration: [String, Number, Object],
9389
- enterFromClass: String,
9390
- enterActiveClass: String,
9391
- enterToClass: String,
9392
- appearFromClass: String,
9393
- appearActiveClass: String,
9394
- appearToClass: String,
9395
- leaveFromClass: String,
9396
- leaveActiveClass: String,
9397
- leaveToClass: String
9398
- };
9399
- const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
9400
- {},
9401
- BaseTransitionPropsValidators,
9402
- DOMTransitionPropsValidators
9403
- );
9404
- const callHook = (hook, args = []) => {
9405
- if (isArray(hook)) {
9406
- hook.forEach((h2) => h2(...args));
9407
- } else if (hook) {
9408
- hook(...args);
9504
+ /*! #__NO_SIDE_EFFECTS__ */
9505
+ // @__NO_SIDE_EFFECTS__
9506
+ function defineCustomElement(options, hydrate2) {
9507
+ const Comp = defineComponent(options);
9508
+ class VueCustomElement extends VueElement {
9509
+ constructor(initialProps) {
9510
+ super(Comp, initialProps, hydrate2);
9511
+ }
9409
9512
  }
9513
+ VueCustomElement.def = Comp;
9514
+ return VueCustomElement;
9515
+ }
9516
+ /*! #__NO_SIDE_EFFECTS__ */
9517
+ const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options) => {
9518
+ return /* @__PURE__ */ defineCustomElement(options, hydrate);
9410
9519
  };
9411
- const hasExplicitCallback = (hook) => {
9412
- return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
9520
+ const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
9413
9521
  };
9414
- function resolveTransitionProps(rawProps) {
9415
- const baseProps = {};
9416
- for (const key in rawProps) {
9417
- if (!(key in DOMTransitionPropsValidators)) {
9418
- baseProps[key] = rawProps[key];
9522
+ class VueElement extends BaseClass {
9523
+ constructor(_def, _props = {}, hydrate2) {
9524
+ super();
9525
+ this._def = _def;
9526
+ this._props = _props;
9527
+ /**
9528
+ * @internal
9529
+ */
9530
+ this._instance = null;
9531
+ this._connected = false;
9532
+ this._resolved = false;
9533
+ this._numberProps = null;
9534
+ this._ob = null;
9535
+ if (this.shadowRoot && hydrate2) {
9536
+ hydrate2(this._createVNode(), this.shadowRoot);
9537
+ } else {
9538
+ this.attachShadow({ mode: "open" });
9539
+ if (!this._def.__asyncLoader) {
9540
+ this._resolveProps(this._def);
9541
+ }
9419
9542
  }
9420
9543
  }
9421
- if (rawProps.css === false) {
9422
- return baseProps;
9423
- }
9424
- const {
9425
- name = "v",
9426
- type,
9427
- duration,
9428
- enterFromClass = `${name}-enter-from`,
9429
- enterActiveClass = `${name}-enter-active`,
9430
- enterToClass = `${name}-enter-to`,
9431
- appearFromClass = enterFromClass,
9432
- appearActiveClass = enterActiveClass,
9433
- appearToClass = enterToClass,
9434
- leaveFromClass = `${name}-leave-from`,
9435
- leaveActiveClass = `${name}-leave-active`,
9436
- leaveToClass = `${name}-leave-to`
9437
- } = rawProps;
9438
- const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES", null);
9439
- let legacyEnterFromClass;
9440
- let legacyAppearFromClass;
9441
- let legacyLeaveFromClass;
9442
- if (legacyClassEnabled) {
9443
- const toLegacyClass = (cls) => cls.replace(/-from$/, "");
9444
- if (!rawProps.enterFromClass) {
9445
- legacyEnterFromClass = toLegacyClass(enterFromClass);
9446
- }
9447
- if (!rawProps.appearFromClass) {
9448
- legacyAppearFromClass = toLegacyClass(appearFromClass);
9544
+ connectedCallback() {
9545
+ this._connected = true;
9546
+ if (!this._instance) {
9547
+ if (this._resolved) {
9548
+ this._update();
9549
+ } else {
9550
+ this._resolveDef();
9551
+ }
9449
9552
  }
9450
- if (!rawProps.leaveFromClass) {
9451
- legacyLeaveFromClass = toLegacyClass(leaveFromClass);
9553
+ }
9554
+ disconnectedCallback() {
9555
+ this._connected = false;
9556
+ if (this._ob) {
9557
+ this._ob.disconnect();
9558
+ this._ob = null;
9452
9559
  }
9560
+ nextTick(() => {
9561
+ if (!this._connected) {
9562
+ render(null, this.shadowRoot);
9563
+ this._instance = null;
9564
+ }
9565
+ });
9453
9566
  }
9454
- const durations = normalizeDuration(duration);
9455
- const enterDuration = durations && durations[0];
9456
- const leaveDuration = durations && durations[1];
9457
- const {
9458
- onBeforeEnter,
9459
- onEnter,
9460
- onEnterCancelled,
9461
- onLeave,
9462
- onLeaveCancelled,
9463
- onBeforeAppear = onBeforeEnter,
9464
- onAppear = onEnter,
9465
- onAppearCancelled = onEnterCancelled
9466
- } = baseProps;
9467
- const finishEnter = (el, isAppear, done) => {
9468
- removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
9469
- removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
9470
- done && done();
9471
- };
9472
- const finishLeave = (el, done) => {
9473
- el._isLeaving = false;
9474
- removeTransitionClass(el, leaveFromClass);
9475
- removeTransitionClass(el, leaveToClass);
9476
- removeTransitionClass(el, leaveActiveClass);
9477
- done && done();
9478
- };
9479
- const makeEnterHook = (isAppear) => {
9480
- return (el, done) => {
9481
- const hook = isAppear ? onAppear : onEnter;
9482
- const resolve = () => finishEnter(el, isAppear, done);
9483
- callHook(hook, [el, resolve]);
9484
- nextFrame(() => {
9485
- removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
9486
- if (legacyClassEnabled) {
9487
- const legacyClass = isAppear ? legacyAppearFromClass : legacyEnterFromClass;
9488
- if (legacyClass) {
9489
- removeTransitionClass(el, legacyClass);
9567
+ /**
9568
+ * resolve inner component definition (handle possible async component)
9569
+ */
9570
+ _resolveDef() {
9571
+ this._resolved = true;
9572
+ for (let i = 0; i < this.attributes.length; i++) {
9573
+ this._setAttr(this.attributes[i].name);
9574
+ }
9575
+ this._ob = new MutationObserver((mutations) => {
9576
+ for (const m of mutations) {
9577
+ this._setAttr(m.attributeName);
9578
+ }
9579
+ });
9580
+ this._ob.observe(this, { attributes: true });
9581
+ const resolve = (def, isAsync = false) => {
9582
+ const { props, styles } = def;
9583
+ let numberProps;
9584
+ if (props && !isArray(props)) {
9585
+ for (const key in props) {
9586
+ const opt = props[key];
9587
+ if (opt === Number || opt && opt.type === Number) {
9588
+ if (key in this._props) {
9589
+ this._props[key] = toNumber(this._props[key]);
9590
+ }
9591
+ (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
9490
9592
  }
9491
9593
  }
9492
- addTransitionClass(el, isAppear ? appearToClass : enterToClass);
9493
- if (!hasExplicitCallback(hook)) {
9494
- whenTransitionEnds(el, type, enterDuration, resolve);
9495
- }
9496
- });
9497
- };
9498
- };
9499
- return extend(baseProps, {
9500
- onBeforeEnter(el) {
9501
- callHook(onBeforeEnter, [el]);
9502
- addTransitionClass(el, enterFromClass);
9503
- if (legacyClassEnabled && legacyEnterFromClass) {
9504
- addTransitionClass(el, legacyEnterFromClass);
9505
- }
9506
- addTransitionClass(el, enterActiveClass);
9507
- },
9508
- onBeforeAppear(el) {
9509
- callHook(onBeforeAppear, [el]);
9510
- addTransitionClass(el, appearFromClass);
9511
- if (legacyClassEnabled && legacyAppearFromClass) {
9512
- addTransitionClass(el, legacyAppearFromClass);
9513
9594
  }
9514
- addTransitionClass(el, appearActiveClass);
9515
- },
9516
- onEnter: makeEnterHook(false),
9517
- onAppear: makeEnterHook(true),
9518
- onLeave(el, done) {
9519
- el._isLeaving = true;
9520
- const resolve = () => finishLeave(el, done);
9521
- addTransitionClass(el, leaveFromClass);
9522
- if (legacyClassEnabled && legacyLeaveFromClass) {
9523
- addTransitionClass(el, legacyLeaveFromClass);
9595
+ this._numberProps = numberProps;
9596
+ if (isAsync) {
9597
+ this._resolveProps(def);
9524
9598
  }
9525
- forceReflow();
9526
- addTransitionClass(el, leaveActiveClass);
9527
- nextFrame(() => {
9528
- if (!el._isLeaving) {
9529
- return;
9530
- }
9531
- removeTransitionClass(el, leaveFromClass);
9532
- if (legacyClassEnabled && legacyLeaveFromClass) {
9533
- removeTransitionClass(el, legacyLeaveFromClass);
9534
- }
9535
- addTransitionClass(el, leaveToClass);
9536
- if (!hasExplicitCallback(onLeave)) {
9537
- whenTransitionEnds(el, type, leaveDuration, resolve);
9599
+ this._applyStyles(styles);
9600
+ this._update();
9601
+ };
9602
+ const asyncDef = this._def.__asyncLoader;
9603
+ if (asyncDef) {
9604
+ asyncDef().then((def) => resolve(def, true));
9605
+ } else {
9606
+ resolve(this._def);
9607
+ }
9608
+ }
9609
+ _resolveProps(def) {
9610
+ const { props } = def;
9611
+ const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
9612
+ for (const key of Object.keys(this)) {
9613
+ if (key[0] !== "_" && declaredPropKeys.includes(key)) {
9614
+ this._setProp(key, this[key], true, false);
9615
+ }
9616
+ }
9617
+ for (const key of declaredPropKeys.map(camelize)) {
9618
+ Object.defineProperty(this, key, {
9619
+ get() {
9620
+ return this._getProp(key);
9621
+ },
9622
+ set(val) {
9623
+ this._setProp(key, val);
9538
9624
  }
9539
9625
  });
9540
- callHook(onLeave, [el, resolve]);
9541
- },
9542
- onEnterCancelled(el) {
9543
- finishEnter(el, false);
9544
- callHook(onEnterCancelled, [el]);
9545
- },
9546
- onAppearCancelled(el) {
9547
- finishEnter(el, true);
9548
- callHook(onAppearCancelled, [el]);
9549
- },
9550
- onLeaveCancelled(el) {
9551
- finishLeave(el);
9552
- callHook(onLeaveCancelled, [el]);
9553
9626
  }
9554
- });
9555
- }
9556
- function normalizeDuration(duration) {
9557
- if (duration == null) {
9558
- return null;
9559
- } else if (isObject(duration)) {
9560
- return [NumberOf(duration.enter), NumberOf(duration.leave)];
9561
- } else {
9562
- const n = NumberOf(duration);
9563
- return [n, n];
9564
9627
  }
9565
- }
9566
- function NumberOf(val) {
9567
- const res = toNumber(val);
9568
- return res;
9569
- }
9570
- function addTransitionClass(el, cls) {
9571
- cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
9572
- (el._vtc || (el._vtc = /* @__PURE__ */ new Set())).add(cls);
9573
- }
9574
- function removeTransitionClass(el, cls) {
9575
- cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
9576
- const { _vtc } = el;
9577
- if (_vtc) {
9578
- _vtc.delete(cls);
9579
- if (!_vtc.size) {
9580
- el._vtc = void 0;
9628
+ _setAttr(key) {
9629
+ let value = this.getAttribute(key);
9630
+ const camelKey = camelize(key);
9631
+ if (this._numberProps && this._numberProps[camelKey]) {
9632
+ value = toNumber(value);
9581
9633
  }
9634
+ this._setProp(camelKey, value, false);
9582
9635
  }
9583
- }
9584
- function nextFrame(cb) {
9585
- requestAnimationFrame(() => {
9586
- requestAnimationFrame(cb);
9587
- });
9588
- }
9589
- let endId = 0;
9590
- function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
9591
- const id = el._endId = ++endId;
9592
- const resolveIfNotStale = () => {
9593
- if (id === el._endId) {
9594
- resolve();
9636
+ /**
9637
+ * @internal
9638
+ */
9639
+ _getProp(key) {
9640
+ return this._props[key];
9641
+ }
9642
+ /**
9643
+ * @internal
9644
+ */
9645
+ _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
9646
+ if (val !== this._props[key]) {
9647
+ this._props[key] = val;
9648
+ if (shouldUpdate && this._instance) {
9649
+ this._update();
9650
+ }
9651
+ if (shouldReflect) {
9652
+ if (val === true) {
9653
+ this.setAttribute(hyphenate(key), "");
9654
+ } else if (typeof val === "string" || typeof val === "number") {
9655
+ this.setAttribute(hyphenate(key), val + "");
9656
+ } else if (!val) {
9657
+ this.removeAttribute(hyphenate(key));
9658
+ }
9659
+ }
9595
9660
  }
9596
- };
9597
- if (explicitTimeout) {
9598
- return setTimeout(resolveIfNotStale, explicitTimeout);
9599
9661
  }
9600
- const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
9601
- if (!type) {
9602
- return resolve();
9662
+ _update() {
9663
+ render(this._createVNode(), this.shadowRoot);
9603
9664
  }
9604
- const endEvent = type + "end";
9605
- let ended = 0;
9606
- const end = () => {
9607
- el.removeEventListener(endEvent, onEnd);
9608
- resolveIfNotStale();
9609
- };
9610
- const onEnd = (e) => {
9611
- if (e.target === el && ++ended >= propCount) {
9612
- end();
9665
+ _createVNode() {
9666
+ const vnode = createVNode(this._def, extend({}, this._props));
9667
+ if (!this._instance) {
9668
+ vnode.ce = (instance) => {
9669
+ this._instance = instance;
9670
+ instance.isCE = true;
9671
+ const dispatch = (event, args) => {
9672
+ this.dispatchEvent(
9673
+ new CustomEvent(event, {
9674
+ detail: args
9675
+ })
9676
+ );
9677
+ };
9678
+ instance.emit = (event, ...args) => {
9679
+ dispatch(event, args);
9680
+ if (hyphenate(event) !== event) {
9681
+ dispatch(hyphenate(event), args);
9682
+ }
9683
+ };
9684
+ let parent = this;
9685
+ while (parent = parent && (parent.parentNode || parent.host)) {
9686
+ if (parent instanceof VueElement) {
9687
+ instance.parent = parent._instance;
9688
+ instance.provides = parent._instance.provides;
9689
+ break;
9690
+ }
9691
+ }
9692
+ };
9613
9693
  }
9614
- };
9615
- setTimeout(() => {
9616
- if (ended < propCount) {
9617
- end();
9694
+ return vnode;
9695
+ }
9696
+ _applyStyles(styles) {
9697
+ if (styles) {
9698
+ styles.forEach((css) => {
9699
+ const s = document.createElement("style");
9700
+ s.textContent = css;
9701
+ this.shadowRoot.appendChild(s);
9702
+ });
9618
9703
  }
9619
- }, timeout + 1);
9620
- el.addEventListener(endEvent, onEnd);
9704
+ }
9621
9705
  }
9622
- function getTransitionInfo(el, expectedType) {
9623
- const styles = window.getComputedStyle(el);
9624
- const getStyleProperties = (key) => (styles[key] || "").split(", ");
9625
- const transitionDelays = getStyleProperties(`${TRANSITION$1}Delay`);
9626
- const transitionDurations = getStyleProperties(`${TRANSITION$1}Duration`);
9627
- const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
9628
- const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
9629
- const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
9630
- const animationTimeout = getTimeout(animationDelays, animationDurations);
9631
- let type = null;
9632
- let timeout = 0;
9633
- let propCount = 0;
9634
- if (expectedType === TRANSITION$1) {
9635
- if (transitionTimeout > 0) {
9636
- type = TRANSITION$1;
9637
- timeout = transitionTimeout;
9638
- propCount = transitionDurations.length;
9706
+
9707
+ function useCssModule(name = "$style") {
9708
+ {
9709
+ const instance = getCurrentInstance();
9710
+ if (!instance) {
9711
+ return EMPTY_OBJ;
9639
9712
  }
9640
- } else if (expectedType === ANIMATION) {
9641
- if (animationTimeout > 0) {
9642
- type = ANIMATION;
9643
- timeout = animationTimeout;
9644
- propCount = animationDurations.length;
9713
+ const modules = instance.type.__cssModules;
9714
+ if (!modules) {
9715
+ return EMPTY_OBJ;
9645
9716
  }
9646
- } else {
9647
- timeout = Math.max(transitionTimeout, animationTimeout);
9648
- type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION$1 : ANIMATION : null;
9649
- propCount = type ? type === TRANSITION$1 ? transitionDurations.length : animationDurations.length : 0;
9650
- }
9651
- const hasTransform = type === TRANSITION$1 && /\b(transform|all)(,|$)/.test(
9652
- getStyleProperties(`${TRANSITION$1}Property`).toString()
9653
- );
9654
- return {
9655
- type,
9656
- timeout,
9657
- propCount,
9658
- hasTransform
9659
- };
9660
- }
9661
- function getTimeout(delays, durations) {
9662
- while (delays.length < durations.length) {
9663
- delays = delays.concat(delays);
9717
+ const mod = modules[name];
9718
+ if (!mod) {
9719
+ return EMPTY_OBJ;
9720
+ }
9721
+ return mod;
9664
9722
  }
9665
- return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
9666
- }
9667
- function toMs(s) {
9668
- return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
9669
9723
  }
9670
- function forceReflow() {
9671
- return document.body.offsetHeight;
9724
+
9725
+ function useCssVars(getter) {
9726
+ return;
9672
9727
  }
9673
9728
 
9674
9729
  const positionMap = /* @__PURE__ */ new WeakMap();
9675
9730
  const newPositionMap = /* @__PURE__ */ new WeakMap();
9731
+ const moveCbKey = Symbol("_moveCb");
9732
+ const enterCbKey = Symbol("_enterCb");
9676
9733
  const TransitionGroupImpl = {
9677
9734
  name: "TransitionGroup",
9678
9735
  props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
@@ -9705,13 +9762,13 @@ const TransitionGroupImpl = {
9705
9762
  const style = el.style;
9706
9763
  addTransitionClass(el, moveClass);
9707
9764
  style.transform = style.webkitTransform = style.transitionDuration = "";
9708
- const cb = el._moveCb = (e) => {
9765
+ const cb = el[moveCbKey] = (e) => {
9709
9766
  if (e && e.target !== el) {
9710
9767
  return;
9711
9768
  }
9712
9769
  if (!e || /transform$/.test(e.propertyName)) {
9713
9770
  el.removeEventListener("transitionend", cb);
9714
- el._moveCb = null;
9771
+ el[moveCbKey] = null;
9715
9772
  removeTransitionClass(el, moveClass);
9716
9773
  }
9717
9774
  };
@@ -9761,11 +9818,11 @@ const removeMode = (props) => delete props.mode;
9761
9818
  const TransitionGroup = TransitionGroupImpl;
9762
9819
  function callPendingCbs(c) {
9763
9820
  const el = c.el;
9764
- if (el._moveCb) {
9765
- el._moveCb();
9821
+ if (el[moveCbKey]) {
9822
+ el[moveCbKey]();
9766
9823
  }
9767
- if (el._enterCb) {
9768
- el._enterCb();
9824
+ if (el[enterCbKey]) {
9825
+ el[enterCbKey]();
9769
9826
  }
9770
9827
  }
9771
9828
  function recordPosition(c) {
@@ -9785,8 +9842,9 @@ function applyTranslation(c) {
9785
9842
  }
9786
9843
  function hasCSSTransform(el, root, moveClass) {
9787
9844
  const clone = el.cloneNode();
9788
- if (el._vtc) {
9789
- el._vtc.forEach((cls) => {
9845
+ const _vtc = el[vtcKey];
9846
+ if (_vtc) {
9847
+ _vtc.forEach((cls) => {
9790
9848
  cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
9791
9849
  });
9792
9850
  }
@@ -9813,9 +9871,10 @@ function onCompositionEnd(e) {
9813
9871
  target.dispatchEvent(new Event("input"));
9814
9872
  }
9815
9873
  }
9874
+ const assignKey = Symbol("_assign");
9816
9875
  const vModelText = {
9817
9876
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
9818
- el._assign = getModelAssigner(vnode);
9877
+ el[assignKey] = getModelAssigner(vnode);
9819
9878
  const castToNumber = number || vnode.props && vnode.props.type === "number";
9820
9879
  addEventListener(el, lazy ? "change" : "input", (e) => {
9821
9880
  if (e.target.composing)
@@ -9827,7 +9886,7 @@ const vModelText = {
9827
9886
  if (castToNumber) {
9828
9887
  domValue = looseToNumber(domValue);
9829
9888
  }
9830
- el._assign(domValue);
9889
+ el[assignKey](domValue);
9831
9890
  });
9832
9891
  if (trim) {
9833
9892
  addEventListener(el, "change", () => {
@@ -9845,7 +9904,7 @@ const vModelText = {
9845
9904
  el.value = value == null ? "" : value;
9846
9905
  },
9847
9906
  beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {
9848
- el._assign = getModelAssigner(vnode);
9907
+ el[assignKey] = getModelAssigner(vnode);
9849
9908
  if (el.composing)
9850
9909
  return;
9851
9910
  if (document.activeElement === el && el.type !== "range") {
@@ -9869,12 +9928,12 @@ const vModelCheckbox = {
9869
9928
  // #4096 array checkboxes need to be deep traversed
9870
9929
  deep: true,
9871
9930
  created(el, _, vnode) {
9872
- el._assign = getModelAssigner(vnode);
9931
+ el[assignKey] = getModelAssigner(vnode);
9873
9932
  addEventListener(el, "change", () => {
9874
9933
  const modelValue = el._modelValue;
9875
9934
  const elementValue = getValue(el);
9876
9935
  const checked = el.checked;
9877
- const assign = el._assign;
9936
+ const assign = el[assignKey];
9878
9937
  if (isArray(modelValue)) {
9879
9938
  const index = looseIndexOf(modelValue, elementValue);
9880
9939
  const found = index !== -1;
@@ -9901,7 +9960,7 @@ const vModelCheckbox = {
9901
9960
  // set initial checked on mount to wait for true-value/false-value
9902
9961
  mounted: setChecked,
9903
9962
  beforeUpdate(el, binding, vnode) {
9904
- el._assign = getModelAssigner(vnode);
9963
+ el[assignKey] = getModelAssigner(vnode);
9905
9964
  setChecked(el, binding, vnode);
9906
9965
  }
9907
9966
  };
@@ -9918,13 +9977,13 @@ function setChecked(el, { value, oldValue }, vnode) {
9918
9977
  const vModelRadio = {
9919
9978
  created(el, { value }, vnode) {
9920
9979
  el.checked = looseEqual(value, vnode.props.value);
9921
- el._assign = getModelAssigner(vnode);
9980
+ el[assignKey] = getModelAssigner(vnode);
9922
9981
  addEventListener(el, "change", () => {
9923
- el._assign(getValue(el));
9982
+ el[assignKey](getValue(el));
9924
9983
  });
9925
9984
  },
9926
9985
  beforeUpdate(el, { value, oldValue }, vnode) {
9927
- el._assign = getModelAssigner(vnode);
9986
+ el[assignKey] = getModelAssigner(vnode);
9928
9987
  if (value !== oldValue) {
9929
9988
  el.checked = looseEqual(value, vnode.props.value);
9930
9989
  }
@@ -9939,11 +9998,11 @@ const vModelSelect = {
9939
9998
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
9940
9999
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
9941
10000
  );
9942
- el._assign(
10001
+ el[assignKey](
9943
10002
  el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
9944
10003
  );
9945
10004
  });
9946
- el._assign = getModelAssigner(vnode);
10005
+ el[assignKey] = getModelAssigner(vnode);
9947
10006
  },
9948
10007
  // set value in mounted & updated because <select> relies on its children
9949
10008
  // <option>s.
@@ -9951,7 +10010,7 @@ const vModelSelect = {
9951
10010
  setSelected(el, value);
9952
10011
  },
9953
10012
  beforeUpdate(el, _binding, vnode) {
9954
- el._assign = getModelAssigner(vnode);
10013
+ el[assignKey] = getModelAssigner(vnode);
9955
10014
  },
9956
10015
  updated(el, { value }) {
9957
10016
  setSelected(el, value);
@@ -10139,52 +10198,6 @@ const withKeys = (fn, modifiers) => {
10139
10198
  };
10140
10199
  };
10141
10200
 
10142
- const vShow = {
10143
- beforeMount(el, { value }, { transition }) {
10144
- el._vod = el.style.display === "none" ? "" : el.style.display;
10145
- if (transition && value) {
10146
- transition.beforeEnter(el);
10147
- } else {
10148
- setDisplay(el, value);
10149
- }
10150
- },
10151
- mounted(el, { value }, { transition }) {
10152
- if (transition && value) {
10153
- transition.enter(el);
10154
- }
10155
- },
10156
- updated(el, { value, oldValue }, { transition }) {
10157
- if (!value === !oldValue)
10158
- return;
10159
- if (transition) {
10160
- if (value) {
10161
- transition.beforeEnter(el);
10162
- setDisplay(el, true);
10163
- transition.enter(el);
10164
- } else {
10165
- transition.leave(el, () => {
10166
- setDisplay(el, false);
10167
- });
10168
- }
10169
- } else {
10170
- setDisplay(el, value);
10171
- }
10172
- },
10173
- beforeUnmount(el, { value }) {
10174
- setDisplay(el, value);
10175
- }
10176
- };
10177
- function setDisplay(el, value) {
10178
- el.style.display = value ? el._vod : "none";
10179
- }
10180
- function initVShowForSSR() {
10181
- vShow.getSSRProps = ({ value }) => {
10182
- if (!value) {
10183
- return { style: { display: "none" } };
10184
- }
10185
- };
10186
- }
10187
-
10188
10201
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
10189
10202
  let renderer;
10190
10203
  let enabledHydration = false;
@@ -11078,7 +11091,7 @@ function parseChildren(context, mode, ancestors) {
11078
11091
  continue;
11079
11092
  } else if (/[a-z]/i.test(s[2])) {
11080
11093
  emitError(context, 23);
11081
- parseTag(context, TagType.End, parent);
11094
+ parseTag(context, 1 /* End */, parent);
11082
11095
  continue;
11083
11096
  } else {
11084
11097
  emitError(
@@ -11234,7 +11247,7 @@ function parseElement(context, ancestors) {
11234
11247
  const wasInPre = context.inPre;
11235
11248
  const wasInVPre = context.inVPre;
11236
11249
  const parent = last(ancestors);
11237
- const element = parseTag(context, TagType.Start, parent);
11250
+ const element = parseTag(context, 0 /* Start */, parent);
11238
11251
  const isPreBoundary = context.inPre && !wasInPre;
11239
11252
  const isVPreBoundary = context.inVPre && !wasInVPre;
11240
11253
  if (element.isSelfClosing || context.options.isVoidTag(element.tag)) {
@@ -11269,7 +11282,7 @@ function parseElement(context, ancestors) {
11269
11282
  }
11270
11283
  element.children = children;
11271
11284
  if (startsWithEndTagOpen(context.source, element.tag)) {
11272
- parseTag(context, TagType.End, parent);
11285
+ parseTag(context, 1 /* End */, parent);
11273
11286
  } else {
11274
11287
  emitError(context, 24, 0, element.loc.start);
11275
11288
  if (context.source.length === 0 && element.tag.toLowerCase() === "script") {
@@ -11288,11 +11301,6 @@ function parseElement(context, ancestors) {
11288
11301
  }
11289
11302
  return element;
11290
11303
  }
11291
- var TagType = /* @__PURE__ */ ((TagType2) => {
11292
- TagType2[TagType2["Start"] = 0] = "Start";
11293
- TagType2[TagType2["End"] = 1] = "End";
11294
- return TagType2;
11295
- })(TagType || {});
11296
11304
  const isSpecialTemplateDirective = /* @__PURE__ */ makeMap(
11297
11305
  `if,else,else-if,for,slot`
11298
11306
  );
@@ -12028,7 +12036,7 @@ function createTransformContext(root, {
12028
12036
  directives: /* @__PURE__ */ new Set(),
12029
12037
  hoists: [],
12030
12038
  imports: [],
12031
- constantCache: /* @__PURE__ */ new Map(),
12039
+ constantCache: /* @__PURE__ */ new WeakMap(),
12032
12040
  temps: 0,
12033
12041
  cached: 0,
12034
12042
  identifiers: /* @__PURE__ */ Object.create(null),
@@ -13352,7 +13360,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
13352
13360
  const bailConstant = constantBailRE.test(rawExp);
13353
13361
  if (isSimpleIdentifier(rawExp)) {
13354
13362
  const isScopeVarReference = context.identifiers[rawExp];
13355
- const isAllowedGlobal = isGloballyWhitelisted(rawExp);
13363
+ const isAllowedGlobal = isGloballyAllowed(rawExp);
13356
13364
  const isLiteral = isLiteralWhitelisted(rawExp);
13357
13365
  if (!asParams && !isScopeVarReference && !isAllowedGlobal && !isLiteral) {
13358
13366
  if (isConst(bindingMetadata[node.content])) {
@@ -13454,7 +13462,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
13454
13462
  return ret;
13455
13463
  }
13456
13464
  function canPrefix(id) {
13457
- if (isGloballyWhitelisted(id.name)) {
13465
+ if (isGloballyAllowed(id.name)) {
13458
13466
  return false;
13459
13467
  }
13460
13468
  if (id.name === "require") {