@vue/compat 3.5.19 → 3.5.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,8 @@
1
1
  /**
2
- * @vue/compat v3.5.19
2
+ * @vue/compat v3.5.21
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
- /*! #__NO_SIDE_EFFECTS__ */
7
6
  // @__NO_SIDE_EFFECTS__
8
7
  function makeMap(str) {
9
8
  const map = /* @__PURE__ */ Object.create(null);
@@ -61,10 +60,10 @@ const cacheStringFunction = (fn) => {
61
60
  return hit || (cache[str] = fn(str));
62
61
  });
63
62
  };
64
- const camelizeRE = /-(\w)/g;
63
+ const camelizeRE = /-\w/g;
65
64
  const camelize = cacheStringFunction(
66
65
  (str) => {
67
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
66
+ return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
68
67
  }
69
68
  );
70
69
  const hyphenateRE = /\B([A-Z])/g;
@@ -1164,7 +1163,7 @@ const arrayInstrumentations = {
1164
1163
  join(separator) {
1165
1164
  return reactiveReadArray(this).join(separator);
1166
1165
  },
1167
- // keys() iterator only reads `length`, no optimisation required
1166
+ // keys() iterator only reads `length`, no optimization required
1168
1167
  lastIndexOf(...args) {
1169
1168
  return searchProxy(this, "lastIndexOf", args);
1170
1169
  },
@@ -1516,7 +1515,7 @@ function createInstrumentations(readonly, shallow) {
1516
1515
  get size() {
1517
1516
  const target = this["__v_raw"];
1518
1517
  !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1519
- return Reflect.get(target, "size", target);
1518
+ return target.size;
1520
1519
  },
1521
1520
  has(key) {
1522
1521
  const target = this["__v_raw"];
@@ -2227,11 +2226,11 @@ function traverse(value, depth = Infinity, seen) {
2227
2226
  if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
2228
2227
  return value;
2229
2228
  }
2230
- seen = seen || /* @__PURE__ */ new Set();
2231
- if (seen.has(value)) {
2229
+ seen = seen || /* @__PURE__ */ new Map();
2230
+ if ((seen.get(value) || 0) >= depth) {
2232
2231
  return value;
2233
2232
  }
2234
- seen.add(value);
2233
+ seen.set(value, depth);
2235
2234
  depth--;
2236
2235
  if (isRef(value)) {
2237
2236
  traverse(value.value, depth, seen);
@@ -2693,11 +2692,14 @@ function checkRecursiveUpdates(seen, fn) {
2693
2692
  let isHmrUpdating = false;
2694
2693
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2695
2694
  {
2696
- getGlobalThis().__VUE_HMR_RUNTIME__ = {
2697
- createRecord: tryWrap(createRecord),
2698
- rerender: tryWrap(rerender),
2699
- reload: tryWrap(reload)
2700
- };
2695
+ const g = getGlobalThis();
2696
+ if (!g.__VUE_HMR_RUNTIME__) {
2697
+ g.__VUE_HMR_RUNTIME__ = {
2698
+ createRecord: tryWrap(createRecord),
2699
+ rerender: tryWrap(rerender),
2700
+ reload: tryWrap(reload)
2701
+ };
2702
+ }
2701
2703
  }
2702
2704
  const map = /* @__PURE__ */ new Map();
2703
2705
  function registerHMR(instance) {
@@ -2770,10 +2772,12 @@ function reload(id, newComp) {
2770
2772
  dirtyInstances.delete(instance);
2771
2773
  } else if (instance.parent) {
2772
2774
  queueJob(() => {
2773
- isHmrUpdating = true;
2774
- instance.parent.update();
2775
- isHmrUpdating = false;
2776
- dirtyInstances.delete(instance);
2775
+ if (!(instance.job.flags & 8)) {
2776
+ isHmrUpdating = true;
2777
+ instance.parent.update();
2778
+ isHmrUpdating = false;
2779
+ dirtyInstances.delete(instance);
2780
+ }
2777
2781
  });
2778
2782
  } else if (instance.appContext.reload) {
2779
2783
  instance.appContext.reload();
@@ -2877,7 +2881,6 @@ const devtoolsComponentRemoved = (component) => {
2877
2881
  _devtoolsComponentRemoved(component);
2878
2882
  }
2879
2883
  };
2880
- /*! #__NO_SIDE_EFFECTS__ */
2881
2884
  // @__NO_SIDE_EFFECTS__
2882
2885
  function createDevtoolsComponentHook(hook) {
2883
2886
  return (component) => {
@@ -3803,26 +3806,34 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3803
3806
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
3804
3807
  o: { nextSibling, parentNode, querySelector, insert, createText }
3805
3808
  }, hydrateChildren) {
3809
+ function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
3810
+ vnode2.anchor = hydrateChildren(
3811
+ nextSibling(node2),
3812
+ vnode2,
3813
+ parentNode(node2),
3814
+ parentComponent,
3815
+ parentSuspense,
3816
+ slotScopeIds,
3817
+ optimized
3818
+ );
3819
+ vnode2.targetStart = targetStart;
3820
+ vnode2.targetAnchor = targetAnchor;
3821
+ }
3806
3822
  const target = vnode.target = resolveTarget(
3807
3823
  vnode.props,
3808
3824
  querySelector
3809
3825
  );
3826
+ const disabled = isTeleportDisabled(vnode.props);
3810
3827
  if (target) {
3811
- const disabled = isTeleportDisabled(vnode.props);
3812
3828
  const targetNode = target._lpa || target.firstChild;
3813
3829
  if (vnode.shapeFlag & 16) {
3814
3830
  if (disabled) {
3815
- vnode.anchor = hydrateChildren(
3816
- nextSibling(node),
3831
+ hydrateDisabledTeleport(
3832
+ node,
3817
3833
  vnode,
3818
- parentNode(node),
3819
- parentComponent,
3820
- parentSuspense,
3821
- slotScopeIds,
3822
- optimized
3834
+ targetNode,
3835
+ targetNode && nextSibling(targetNode)
3823
3836
  );
3824
- vnode.targetStart = targetNode;
3825
- vnode.targetAnchor = targetNode && nextSibling(targetNode);
3826
3837
  } else {
3827
3838
  vnode.anchor = nextSibling(node);
3828
3839
  let targetAnchor = targetNode;
@@ -3853,6 +3864,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3853
3864
  }
3854
3865
  }
3855
3866
  updateCssVars(vnode, disabled);
3867
+ } else if (disabled) {
3868
+ if (vnode.shapeFlag & 16) {
3869
+ hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
3870
+ }
3856
3871
  }
3857
3872
  return vnode.anchor && nextSibling(vnode.anchor);
3858
3873
  }
@@ -3964,7 +3979,7 @@ const BaseTransitionImpl = {
3964
3979
  setTransitionHooks(innerChild, enterHooks);
3965
3980
  }
3966
3981
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3967
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3982
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3968
3983
  let leavingHooks = resolveTransitionHooks(
3969
3984
  oldInnerChild,
3970
3985
  rawProps,
@@ -4247,7 +4262,6 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4247
4262
  return ret;
4248
4263
  }
4249
4264
 
4250
- /*! #__NO_SIDE_EFFECTS__ */
4251
4265
  // @__NO_SIDE_EFFECTS__
4252
4266
  function defineComponent(options, extraOptions) {
4253
4267
  return isFunction(options) ? (
@@ -4300,6 +4314,7 @@ function useTemplateRef(key) {
4300
4314
  return ret;
4301
4315
  }
4302
4316
 
4317
+ const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
4303
4318
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4304
4319
  if (isArray(rawRef)) {
4305
4320
  rawRef.forEach(
@@ -4349,6 +4364,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4349
4364
  return !knownTemplateRefs.has(ref2);
4350
4365
  };
4351
4366
  if (oldRef != null && oldRef !== ref) {
4367
+ invalidatePendingSetRef(oldRawRef);
4352
4368
  if (isString(oldRef)) {
4353
4369
  refs[oldRef] = null;
4354
4370
  if (canSetSetupRef(oldRef)) {
@@ -4406,9 +4422,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4406
4422
  }
4407
4423
  };
4408
4424
  if (value) {
4409
- doSet.id = -1;
4410
- queuePostRenderEffect(doSet, parentSuspense);
4425
+ const job = () => {
4426
+ doSet();
4427
+ pendingSetRefMap.delete(rawRef);
4428
+ };
4429
+ job.id = -1;
4430
+ pendingSetRefMap.set(rawRef, job);
4431
+ queuePostRenderEffect(job, parentSuspense);
4411
4432
  } else {
4433
+ invalidatePendingSetRef(rawRef);
4412
4434
  doSet();
4413
4435
  }
4414
4436
  } else {
@@ -4416,6 +4438,13 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4416
4438
  }
4417
4439
  }
4418
4440
  }
4441
+ function invalidatePendingSetRef(rawRef) {
4442
+ const pendingSetRef = pendingSetRefMap.get(rawRef);
4443
+ if (pendingSetRef) {
4444
+ pendingSetRef.flags |= 8;
4445
+ pendingSetRefMap.delete(rawRef);
4446
+ }
4447
+ }
4419
4448
 
4420
4449
  let hasLoggedMismatchError = false;
4421
4450
  const logMismatchError = () => {
@@ -5148,7 +5177,6 @@ function forEachElement(node, cb) {
5148
5177
  }
5149
5178
 
5150
5179
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
5151
- /*! #__NO_SIDE_EFFECTS__ */
5152
5180
  // @__NO_SIDE_EFFECTS__
5153
5181
  function defineAsyncComponent(source) {
5154
5182
  if (isFunction(source)) {
@@ -6159,7 +6187,7 @@ function legacyRenderSlot(instance, name, fallback, props, bindObject) {
6159
6187
  }
6160
6188
  return renderSlot(instance.slots, name, props, fallback && (() => fallback));
6161
6189
  }
6162
- function legacyresolveScopedSlots(fns, raw, hasDynamicKeys) {
6190
+ function legacyResolveScopedSlots(fns, raw, hasDynamicKeys) {
6163
6191
  return createSlots(
6164
6192
  raw || { $stable: !hasDynamicKeys },
6165
6193
  mapKeyToName(fns)
@@ -6326,7 +6354,7 @@ function installCompatInstanceProperties(map) {
6326
6354
  _b: () => legacyBindObjectProps,
6327
6355
  _v: () => createTextVNode,
6328
6356
  _e: () => createCommentVNode,
6329
- _u: () => legacyresolveScopedSlots,
6357
+ _u: () => legacyResolveScopedSlots,
6330
6358
  _g: () => legacyBindObjectListeners,
6331
6359
  _d: () => legacyBindDynamicKeys,
6332
6360
  _p: () => legacyPrependModifier
@@ -7245,7 +7273,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7245
7273
  return vm;
7246
7274
  }
7247
7275
  }
7248
- Vue.version = `2.6.14-compat:${"3.5.19"}`;
7276
+ Vue.version = `2.6.14-compat:${"3.5.21"}`;
7249
7277
  Vue.config = singletonApp.config;
7250
7278
  Vue.use = (plugin, ...options) => {
7251
7279
  if (plugin && isFunction(plugin.install)) {
@@ -7503,7 +7531,7 @@ function installCompatMount(app, context, render) {
7503
7531
  {
7504
7532
  for (let i = 0; i < container.attributes.length; i++) {
7505
7533
  const attr = container.attributes[i];
7506
- if (attr.name !== "v-cloak" && /^(v-|:|@)/.test(attr.name)) {
7534
+ if (attr.name !== "v-cloak" && /^(?:v-|:|@)/.test(attr.name)) {
7507
7535
  warnDeprecation$1("GLOBAL_MOUNT_CONTAINER", null);
7508
7536
  break;
7509
7537
  }
@@ -10315,8 +10343,9 @@ function emit(instance, event, ...rawArgs) {
10315
10343
  return emit$1(instance, event, args);
10316
10344
  }
10317
10345
  }
10346
+ const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
10318
10347
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
10319
- const cache = appContext.emitsCache;
10348
+ const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
10320
10349
  const cached = cache.get(comp);
10321
10350
  if (cached !== void 0) {
10322
10351
  return cached;
@@ -10788,7 +10817,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
10788
10817
  const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
10789
10818
  if (pendingBranch) {
10790
10819
  suspense.pendingBranch = newBranch;
10791
- if (isSameVNodeType(newBranch, pendingBranch)) {
10820
+ if (isSameVNodeType(pendingBranch, newBranch)) {
10792
10821
  patch(
10793
10822
  pendingBranch,
10794
10823
  newBranch,
@@ -10859,7 +10888,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
10859
10888
  );
10860
10889
  setActiveBranch(suspense, newFallback);
10861
10890
  }
10862
- } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
10891
+ } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
10863
10892
  patch(
10864
10893
  activeBranch,
10865
10894
  newBranch,
@@ -10890,7 +10919,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
10890
10919
  }
10891
10920
  }
10892
10921
  } else {
10893
- if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
10922
+ if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
10894
10923
  patch(
10895
10924
  activeBranch,
10896
10925
  newBranch,
@@ -12126,7 +12155,7 @@ function getComponentPublicInstance(instance) {
12126
12155
  return instance.proxy;
12127
12156
  }
12128
12157
  }
12129
- const classifyRE = /(?:^|[-_])(\w)/g;
12158
+ const classifyRE = /(?:^|[-_])\w/g;
12130
12159
  const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
12131
12160
  function getComponentName(Component, includeInferred = true) {
12132
12161
  return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
@@ -12169,15 +12198,23 @@ const computed = (getterOrOptions, debugOptions) => {
12169
12198
  };
12170
12199
 
12171
12200
  function h(type, propsOrChildren, children) {
12201
+ const doCreateVNode = (type2, props, children2) => {
12202
+ setBlockTracking(-1);
12203
+ try {
12204
+ return createVNode(type2, props, children2);
12205
+ } finally {
12206
+ setBlockTracking(1);
12207
+ }
12208
+ };
12172
12209
  const l = arguments.length;
12173
12210
  if (l === 2) {
12174
12211
  if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
12175
12212
  if (isVNode(propsOrChildren)) {
12176
- return createVNode(type, null, [propsOrChildren]);
12213
+ return doCreateVNode(type, null, [propsOrChildren]);
12177
12214
  }
12178
- return createVNode(type, propsOrChildren);
12215
+ return doCreateVNode(type, propsOrChildren);
12179
12216
  } else {
12180
- return createVNode(type, null, propsOrChildren);
12217
+ return doCreateVNode(type, null, propsOrChildren);
12181
12218
  }
12182
12219
  } else {
12183
12220
  if (l > 3) {
@@ -12185,7 +12222,7 @@ function h(type, propsOrChildren, children) {
12185
12222
  } else if (l === 3 && isVNode(children)) {
12186
12223
  children = [children];
12187
12224
  }
12188
- return createVNode(type, propsOrChildren, children);
12225
+ return doCreateVNode(type, propsOrChildren, children);
12189
12226
  }
12190
12227
  }
12191
12228
 
@@ -12395,7 +12432,7 @@ function isMemoSame(cached, memo) {
12395
12432
  return true;
12396
12433
  }
12397
12434
 
12398
- const version = "3.5.19";
12435
+ const version = "3.5.21";
12399
12436
  const warn = warn$1 ;
12400
12437
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12401
12438
  const devtools = devtools$1 ;
@@ -12798,7 +12835,7 @@ function getTransitionInfo(el, expectedType) {
12798
12835
  type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION$1 : ANIMATION : null;
12799
12836
  propCount = type ? type === TRANSITION$1 ? transitionDurations.length : animationDurations.length : 0;
12800
12837
  }
12801
- const hasTransform = type === TRANSITION$1 && /\b(transform|all)(,|$)/.test(
12838
+ const hasTransform = type === TRANSITION$1 && /\b(?:transform|all)(?:,|$)/.test(
12802
12839
  getStyleProperties(`${TRANSITION$1}Property`).toString()
12803
12840
  );
12804
12841
  return {
@@ -12839,6 +12876,8 @@ function patchClass(el, value, isSVG) {
12839
12876
  const vShowOriginalDisplay = Symbol("_vod");
12840
12877
  const vShowHidden = Symbol("_vsh");
12841
12878
  const vShow = {
12879
+ // used for prop mismatch check during hydration
12880
+ name: "show",
12842
12881
  beforeMount(el, { value }, { transition }) {
12843
12882
  el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
12844
12883
  if (transition && value) {
@@ -12872,9 +12911,6 @@ const vShow = {
12872
12911
  setDisplay(el, value);
12873
12912
  }
12874
12913
  };
12875
- {
12876
- vShow.name = "show";
12877
- }
12878
12914
  function setDisplay(el, value) {
12879
12915
  el.style.display = value ? el[vShowOriginalDisplay] : "none";
12880
12916
  el[vShowHidden] = !value;
@@ -12960,7 +12996,7 @@ function setVarsOnNode(el, vars) {
12960
12996
  }
12961
12997
  }
12962
12998
 
12963
- const displayRE = /(^|;)\s*display\s*:/;
12999
+ const displayRE = /(?:^|;)\s*display\s*:/;
12964
13000
  function patchStyle(el, prev, next) {
12965
13001
  const style = el.style;
12966
13002
  const isCssString = isString(next);
@@ -13327,11 +13363,10 @@ function shouldSetAsProp(el, key, value, isSVG) {
13327
13363
  }
13328
13364
 
13329
13365
  const REMOVAL = {};
13330
- /*! #__NO_SIDE_EFFECTS__ */
13331
13366
  // @__NO_SIDE_EFFECTS__
13332
13367
  function defineCustomElement(options, extraOptions, _createApp) {
13333
- const Comp = defineComponent(options, extraOptions);
13334
- if (isPlainObject(Comp)) extend(Comp, extraOptions);
13368
+ let Comp = defineComponent(options, extraOptions);
13369
+ if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
13335
13370
  class VueCustomElement extends VueElement {
13336
13371
  constructor(initialProps) {
13337
13372
  super(Comp, initialProps, _createApp);
@@ -13340,7 +13375,6 @@ function defineCustomElement(options, extraOptions, _createApp) {
13340
13375
  VueCustomElement.def = Comp;
13341
13376
  return VueCustomElement;
13342
13377
  }
13343
-
13344
13378
  const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
13345
13379
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
13346
13380
  });
@@ -13816,7 +13850,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
13816
13850
  if (e && e.target !== el) {
13817
13851
  return;
13818
13852
  }
13819
- if (!e || /transform$/.test(e.propertyName)) {
13853
+ if (!e || e.propertyName.endsWith("transform")) {
13820
13854
  el.removeEventListener("transitionend", cb);
13821
13855
  el[moveCbKey] = null;
13822
13856
  removeTransitionClass(el, moveClass);
@@ -14315,7 +14349,7 @@ const createApp = ((...args) => {
14315
14349
  if (container.nodeType === 1) {
14316
14350
  for (let i = 0; i < container.attributes.length; i++) {
14317
14351
  const attr = container.attributes[i];
14318
- if (attr.name !== "v-cloak" && /^(v-|:|@)/.test(attr.name)) {
14352
+ if (attr.name !== "v-cloak" && /^(?:v-|:|@)/.test(attr.name)) {
14319
14353
  compatUtils.warnDeprecation(
14320
14354
  "GLOBAL_MOUNT_CONTAINER",
14321
14355
  null
@@ -15926,7 +15960,7 @@ const isMemberExpressionBrowser = (exp) => {
15926
15960
  return !currentOpenBracketCount && !currentOpenParensCount;
15927
15961
  };
15928
15962
  const isMemberExpression = isMemberExpressionBrowser ;
15929
- const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
15963
+ const fnExpRE = /^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/;
15930
15964
  const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp));
15931
15965
  const isFnExpression = isFnExpressionBrowser ;
15932
15966
  function assert(condition, msg) {
@@ -18065,7 +18099,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
18065
18099
  }
18066
18100
 
18067
18101
  const transformIf = createStructuralDirectiveTransform(
18068
- /^(if|else|else-if)$/,
18102
+ /^(?:if|else|else-if)$/,
18069
18103
  (node, dir, context) => {
18070
18104
  return processIf(node, dir, context, (ifNode, branch, isRoot) => {
18071
18105
  const siblings = context.parent.children;
@@ -18652,7 +18686,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
18652
18686
  );
18653
18687
  } else if (vElse = findDir(
18654
18688
  slotElement,
18655
- /^else(-if)?$/,
18689
+ /^else(?:-if)?$/,
18656
18690
  true
18657
18691
  /* allowEmpty */
18658
18692
  )) {
@@ -18664,7 +18698,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
18664
18698
  break;
18665
18699
  }
18666
18700
  }
18667
- if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) {
18701
+ if (prev && isTemplateNode(prev) && findDir(prev, /^(?:else-)?if$/)) {
18668
18702
  let conditional = dynamicSlots[dynamicSlots.length - 1];
18669
18703
  while (conditional.alternate.type === 19) {
18670
18704
  conditional = conditional.alternate;