@vue/runtime-dom 3.6.0-rc.1 → 3.6.0-rc.10

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,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-rc.1
2
+ * @vue/runtime-dom v3.6.0-rc.10
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -11,7 +11,7 @@
11
11
  * \/\*#\_\_PURE\_\_\*\/
12
12
  * So that they can be tree-shaken if necessary.
13
13
  */
14
- /* @__NO_SIDE_EFFECTS__ */
14
+ /*@__NO_SIDE_EFFECTS__*/
15
15
  function makeMap(str) {
16
16
  const map = Object.create(null);
17
17
  for (const key of str.split(",")) map[key] = 1;
@@ -55,9 +55,9 @@ const toRawType = (value) => {
55
55
  };
56
56
  const isPlainObject = (val) => toTypeString(val) === "[object Object]";
57
57
  const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
58
- const isReservedProp = /* @__PURE__ */ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
59
- const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
60
- const isBuiltInDirective = /* @__PURE__ */ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
58
+ const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
59
+ const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
60
+ const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
61
61
  const cacheStringFunction = (fn) => {
62
62
  const cache = Object.create(null);
63
63
  return ((str) => {
@@ -131,7 +131,7 @@ const getGlobalThis = () => {
131
131
  function canSetValueDirectly(tagName) {
132
132
  return tagName !== "PROGRESS" && !tagName.includes("-");
133
133
  }
134
- const isGloballyAllowed = /* @__PURE__ */ makeMap("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,Error,Symbol");
134
+ const isGloballyAllowed = /*@__PURE__*/ makeMap("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,Error,Symbol");
135
135
  //#endregion
136
136
  //#region packages/shared/src/normalizeProp.ts
137
137
  function normalizeStyle(value) {
@@ -147,10 +147,10 @@ function normalizeStyle(value) {
147
147
  }
148
148
  const listDelimiterRE = /;(?![^(]*\))/g;
149
149
  const propertyDelimiterRE = /:([^]+)/;
150
- const styleCommentRE = /\/\*[^]*?\*\//g;
150
+ const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
151
151
  function parseStringStyle(cssText) {
152
152
  const ret = {};
153
- cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
153
+ cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
154
154
  if (item) {
155
155
  const tmp = item.split(propertyDelimiterRE);
156
156
  tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
@@ -199,17 +199,17 @@ const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math
199
199
  * Compiler only.
200
200
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
201
201
  */
202
- const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
202
+ const isHTMLTag = /*@__PURE__*/ makeMap(HTML_TAGS);
203
203
  /**
204
204
  * Compiler only.
205
205
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
206
206
  */
207
- const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
207
+ const isSVGTag = /*@__PURE__*/ makeMap(SVG_TAGS);
208
208
  /**
209
209
  * Compiler only.
210
210
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
211
211
  */
212
- const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
212
+ const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
213
213
  //#endregion
214
214
  //#region packages/shared/src/domAttrConfig.ts
215
215
  /**
@@ -224,11 +224,11 @@ const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
224
224
  * - readonly -> readOnly
225
225
  */
226
226
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
227
- const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
227
+ const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
228
228
  /**
229
229
  * The full list is needed during SSR to produce the correct initial markup.
230
230
  */
231
- const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
231
+ const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
232
232
  /**
233
233
  * Boolean attributes should be included if the value is truthy or ''.
234
234
  * e.g. `<select multiple>` compiles to `{ multiple: '' }`
@@ -242,11 +242,11 @@ function includeBooleanAttr(value) {
242
242
  * Don't also forget to allow `data-*` and `aria-*`!
243
243
  * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
244
244
  */
245
- const isKnownHtmlAttr = /* @__PURE__ */ makeMap("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap");
245
+ const isKnownHtmlAttr = /*@__PURE__*/ makeMap("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap");
246
246
  /**
247
247
  * Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
248
248
  */
249
- const isKnownSvgAttr = /* @__PURE__ */ makeMap("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan");
249
+ const isKnownSvgAttr = /*@__PURE__*/ makeMap("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan");
250
250
  /**
251
251
  * Shared between server-renderer and runtime-core hydration logic
252
252
  */
@@ -272,13 +272,54 @@ function getEscapedCssVarName(key, doubleEscape) {
272
272
  }
273
273
  //#endregion
274
274
  //#region packages/shared/src/looseEqual.ts
275
- function looseCompareArrays(a, b) {
275
+ function looseCompareArrays(a, b, seen) {
276
276
  if (a.length !== b.length) return false;
277
277
  let equal = true;
278
- for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
278
+ for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i], seen);
279
279
  return equal;
280
280
  }
281
- function looseEqual(a, b) {
281
+ function looseCompareCollections(a, b, seen) {
282
+ if (a.size !== b.size) return false;
283
+ const candidates = Array.from(b);
284
+ const matched = new Uint8Array(candidates.length);
285
+ for (const item of a) {
286
+ let index = -1;
287
+ for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i], seen)) {
288
+ index = i;
289
+ break;
290
+ }
291
+ if (index < 0) return false;
292
+ matched[index] = 1;
293
+ }
294
+ return true;
295
+ }
296
+ function looseCompareObjects(a, b, seen) {
297
+ let aValidType = isMap(a);
298
+ let bValidType = isMap(b);
299
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
300
+ aValidType = isSet(a);
301
+ bValidType = isSet(b);
302
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
303
+ if (Object.keys(a).length !== Object.keys(b).length) return false;
304
+ for (const key in a) {
305
+ const aHasKey = a.hasOwnProperty(key);
306
+ const bHasKey = b.hasOwnProperty(key);
307
+ if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) return false;
308
+ }
309
+ return String(a) === String(b);
310
+ }
311
+ function looseCompareNested(a, b, seen, compare) {
312
+ if (!seen) seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
313
+ const [seenA, seenB] = seen;
314
+ if (seenA.has(a) || seenB.has(b)) return seenA.get(a) === b && seenB.get(b) === a;
315
+ seenA.set(a, b);
316
+ seenB.set(b, a);
317
+ const equal = compare(a, b, seen);
318
+ seenA.delete(a);
319
+ seenB.delete(b);
320
+ return equal;
321
+ }
322
+ function looseEqual(a, b, seen) {
282
323
  if (a === b) return true;
283
324
  let aValidType = isDate(a);
284
325
  let bValidType = isDate(b);
@@ -288,17 +329,12 @@ function looseEqual(a, b) {
288
329
  if (aValidType || bValidType) return a === b;
289
330
  aValidType = isArray(a);
290
331
  bValidType = isArray(b);
291
- if (aValidType || bValidType) return aValidType && bValidType ? looseCompareArrays(a, b) : false;
332
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
292
333
  aValidType = isObject(a);
293
334
  bValidType = isObject(b);
294
335
  if (aValidType || bValidType) {
295
336
  if (!aValidType || !bValidType) return false;
296
- if (Object.keys(a).length !== Object.keys(b).length) return false;
297
- for (const key in a) {
298
- const aHasKey = a.hasOwnProperty(key);
299
- const bHasKey = b.hasOwnProperty(key);
300
- if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) return false;
301
- }
337
+ return looseCompareNested(a, b, seen, looseCompareObjects);
302
338
  }
303
339
  return String(a) === String(b);
304
340
  }
@@ -428,6 +464,8 @@ function setupFlagsHandler(target) {
428
464
  function warn$2(msg, ...args) {
429
465
  console.warn(`[Vue warn] ${msg}`, ...args);
430
466
  }
467
+ //#endregion
468
+ //#region packages/reactivity/src/system.ts
431
469
  const notifyBuffer = [];
432
470
  let batchDepth = 0;
433
471
  let activeSub = void 0;
@@ -566,13 +604,23 @@ function endTracking(sub, prevSub) {
566
604
  sub.flags &= -5;
567
605
  }
568
606
  function flush() {
607
+ let hasError = false;
608
+ let error;
569
609
  while (notifyIndex < notifyBufferLength) {
570
610
  const effect = notifyBuffer[notifyIndex];
571
611
  notifyBuffer[notifyIndex++] = void 0;
572
- effect.notify();
612
+ try {
613
+ effect.notify();
614
+ } catch (err) {
615
+ if (!hasError) {
616
+ hasError = true;
617
+ error = err;
618
+ }
619
+ }
573
620
  }
574
621
  notifyIndex = 0;
575
622
  notifyBufferLength = 0;
623
+ if (hasError) throw error;
576
624
  }
577
625
  function checkDirty(link, sub) {
578
626
  let stack;
@@ -656,7 +704,7 @@ var Dep = class {
656
704
  }
657
705
  set subs(value) {
658
706
  this._subs = value;
659
- if (value === void 0) this.map.delete(this.key);
707
+ if (value === void 0 && this.map) this.map.delete(this.key);
660
708
  }
661
709
  };
662
710
  const targetMap = /* @__PURE__ */ new WeakMap();
@@ -739,9 +787,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
739
787
  if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
740
788
  }
741
789
  break;
742
- case "set":
743
- if (isMap(target)) run(depsMap.get(ITERATE_KEY));
744
- break;
790
+ case "set": if (isMap(target)) run(depsMap.get(ITERATE_KEY));
745
791
  }
746
792
  }
747
793
  }
@@ -756,13 +802,17 @@ function getDepFromReactive(object, key) {
756
802
  /**
757
803
  * Track array iteration and return:
758
804
  * - if input is reactive: a cloned raw array with reactive values
759
- * - if input is non-reactive or shallowReactive: the original raw array
805
+ * - if input is readonly: a cloned raw array with readonly values, preserving
806
+ * reactivity
807
+ * - if input is raw or shallow: the original raw array
760
808
  */
761
809
  function reactiveReadArray(array) {
762
810
  const raw = /* @__PURE__ */ toRaw(array);
763
811
  if (raw === array) return raw;
764
812
  track(raw, "iterate", ARRAY_ITERATE_KEY);
765
- return /* @__PURE__ */ isShallow(array) ? raw : raw.map(toReactive);
813
+ if (/* @__PURE__ */ isShallow(array)) return raw;
814
+ if (!/* @__PURE__ */ isReadonly(array)) return raw.map(toReactive);
815
+ return /* @__PURE__ */ isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
766
816
  }
767
817
  /**
768
818
  * Track array iteration and return raw array
@@ -938,8 +988,8 @@ function noTracking(self, method, args = []) {
938
988
  }
939
989
  //#endregion
940
990
  //#region packages/reactivity/src/baseHandlers.ts
941
- const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
942
- const builtInSymbols = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
991
+ const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
992
+ const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
943
993
  function hasOwnProperty(key) {
944
994
  if (!isSymbol(key)) key = String(key);
945
995
  const obj = /* @__PURE__ */ toRaw(this);
@@ -994,12 +1044,14 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
994
1044
  oldValue = /* @__PURE__ */ toRaw(oldValue);
995
1045
  value = /* @__PURE__ */ toRaw(value);
996
1046
  }
997
- if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) if (isOldValueReadonly) {
998
- warn$2(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
999
- return true;
1000
- } else {
1001
- oldValue.value = value;
1002
- return true;
1047
+ if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
1048
+ if (isOldValueReadonly) {
1049
+ warn$2(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
1050
+ return true;
1051
+ } else {
1052
+ oldValue.value = value;
1053
+ return true;
1054
+ }
1003
1055
  }
1004
1056
  }
1005
1057
  const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
@@ -1040,10 +1092,10 @@ var ReadonlyReactiveHandler = class extends BaseReactiveHandler {
1040
1092
  return true;
1041
1093
  }
1042
1094
  };
1043
- const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
1044
- const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
1045
- const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
1046
- const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
1095
+ const mutableHandlers = /*@__PURE__*/ new MutableReactiveHandler();
1096
+ const readonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler();
1097
+ const shallowReactiveHandlers = /*@__PURE__*/ new MutableReactiveHandler(true);
1098
+ const shallowReadonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler(true);
1047
1099
  //#endregion
1048
1100
  //#region packages/reactivity/src/collectionHandlers.ts
1049
1101
  const toShallow = (value) => value;
@@ -1194,10 +1246,10 @@ function createInstrumentationGetter(isReadonly, shallow) {
1194
1246
  return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
1195
1247
  };
1196
1248
  }
1197
- const mutableCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, false) };
1198
- const shallowCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, true) };
1199
- const readonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, false) };
1200
- const shallowReadonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, true) };
1249
+ const mutableCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, false) };
1250
+ const shallowCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, true) };
1251
+ const readonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, false) };
1252
+ const shallowReadonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, true) };
1201
1253
  function checkIdentityKeys(target, has, key) {
1202
1254
  const rawKey = /* @__PURE__ */ toRaw(key);
1203
1255
  if (rawKey !== key && has.call(target, rawKey)) {
@@ -1222,7 +1274,7 @@ function targetTypeMap(rawType) {
1222
1274
  default: return 0;
1223
1275
  }
1224
1276
  }
1225
- /* @__NO_SIDE_EFFECTS__ */
1277
+ /*@__NO_SIDE_EFFECTS__*/
1226
1278
  function reactive(target) {
1227
1279
  if (/* @__PURE__ */ isReadonly(target)) return target;
1228
1280
  return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
@@ -1257,7 +1309,7 @@ function reactive(target) {
1257
1309
  * @param target - The source object.
1258
1310
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreactive}
1259
1311
  */
1260
- /* @__NO_SIDE_EFFECTS__ */
1312
+ /*@__NO_SIDE_EFFECTS__*/
1261
1313
  function shallowReactive(target) {
1262
1314
  return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
1263
1315
  }
@@ -1290,7 +1342,7 @@ function shallowReactive(target) {
1290
1342
  * @param target - The source object.
1291
1343
  * @see {@link https://vuejs.org/api/reactivity-core.html#readonly}
1292
1344
  */
1293
- /* @__NO_SIDE_EFFECTS__ */
1345
+ /*@__NO_SIDE_EFFECTS__*/
1294
1346
  function readonly(target) {
1295
1347
  return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
1296
1348
  }
@@ -1324,7 +1376,7 @@ function readonly(target) {
1324
1376
  * @param target - The source object.
1325
1377
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreadonly}
1326
1378
  */
1327
- /* @__NO_SIDE_EFFECTS__ */
1379
+ /*@__NO_SIDE_EFFECTS__*/
1328
1380
  function shallowReadonly(target) {
1329
1381
  return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
1330
1382
  }
@@ -1361,7 +1413,7 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
1361
1413
  * @param value - The value to check.
1362
1414
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#isreactive}
1363
1415
  */
1364
- /* @__NO_SIDE_EFFECTS__ */
1416
+ /*@__NO_SIDE_EFFECTS__*/
1365
1417
  function isReactive(value) {
1366
1418
  if (/* @__PURE__ */ isReadonly(value)) return /* @__PURE__ */ isReactive(value["__v_raw"]);
1367
1419
  return !!(value && value["__v_isReactive"]);
@@ -1377,11 +1429,11 @@ function isReactive(value) {
1377
1429
  * @param value - The value to check.
1378
1430
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#isreadonly}
1379
1431
  */
1380
- /* @__NO_SIDE_EFFECTS__ */
1432
+ /*@__NO_SIDE_EFFECTS__*/
1381
1433
  function isReadonly(value) {
1382
1434
  return !!(value && value["__v_isReadonly"]);
1383
1435
  }
1384
- /* @__NO_SIDE_EFFECTS__ */
1436
+ /*@__NO_SIDE_EFFECTS__*/
1385
1437
  function isShallow(value) {
1386
1438
  return !!(value && value["__v_isShallow"]);
1387
1439
  }
@@ -1392,7 +1444,7 @@ function isShallow(value) {
1392
1444
  * @param value - The value to check.
1393
1445
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#isproxy}
1394
1446
  */
1395
- /* @__NO_SIDE_EFFECTS__ */
1447
+ /*@__NO_SIDE_EFFECTS__*/
1396
1448
  function isProxy(value) {
1397
1449
  return value ? !!value["__v_raw"] : false;
1398
1450
  }
@@ -1419,7 +1471,7 @@ function isProxy(value) {
1419
1471
  * @param observed - The object for which the "raw" value is requested.
1420
1472
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#toraw}
1421
1473
  */
1422
- /* @__NO_SIDE_EFFECTS__ */
1474
+ /*@__NO_SIDE_EFFECTS__*/
1423
1475
  function toRaw(observed) {
1424
1476
  const raw = observed && observed["__v_raw"];
1425
1477
  return raw ? /* @__PURE__ */ toRaw(raw) : observed;
@@ -1468,15 +1520,15 @@ const toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value)
1468
1520
  const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
1469
1521
  //#endregion
1470
1522
  //#region packages/reactivity/src/ref.ts
1471
- /* @__NO_SIDE_EFFECTS__ */
1523
+ /*@__NO_SIDE_EFFECTS__*/
1472
1524
  function isRef(r) {
1473
1525
  return r ? r["__v_isRef"] === true : false;
1474
1526
  }
1475
- /* @__NO_SIDE_EFFECTS__ */
1527
+ /*@__NO_SIDE_EFFECTS__*/
1476
1528
  function ref(value) {
1477
1529
  return createRef(value, toReactive);
1478
1530
  }
1479
- /* @__NO_SIDE_EFFECTS__ */
1531
+ /*@__NO_SIDE_EFFECTS__*/
1480
1532
  function shallowRef(value) {
1481
1533
  return createRef(value);
1482
1534
  }
@@ -1679,7 +1731,7 @@ function customRef(factory) {
1679
1731
  * @param object - Reactive object to be made into an object of linked refs.
1680
1732
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#torefs}
1681
1733
  */
1682
- /* @__NO_SIDE_EFFECTS__ */
1734
+ /*@__NO_SIDE_EFFECTS__*/
1683
1735
  function toRefs(object) {
1684
1736
  const ret = isArray(object) ? new Array(object.length) : {};
1685
1737
  for (const key in object) ret[key] = propertyToRef(object, key);
@@ -1730,7 +1782,7 @@ var GetterRefImpl = class {
1730
1782
  return this._value = this._getter();
1731
1783
  }
1732
1784
  };
1733
- /* @__NO_SIDE_EFFECTS__ */
1785
+ /*@__NO_SIDE_EFFECTS__*/
1734
1786
  function toRef(source, key, defaultValue) {
1735
1787
  if (/* @__PURE__ */ isRef(source)) return source;
1736
1788
  else if (isFunction(source)) return new GetterRefImpl(source);
@@ -1796,10 +1848,12 @@ var ReactiveEffect = class {
1796
1848
  get dirty() {
1797
1849
  const flags = this.flags;
1798
1850
  if (flags & 16) return true;
1799
- if (flags & 32) if (checkDirty(this.deps, this)) {
1800
- this.flags = flags | 16;
1801
- return true;
1802
- } else this.flags = flags & -33;
1851
+ if (flags & 32) {
1852
+ if (checkDirty(this.deps, this)) {
1853
+ this.flags = flags | 16;
1854
+ return true;
1855
+ } else this.flags = flags & -33;
1856
+ }
1803
1857
  return false;
1804
1858
  }
1805
1859
  };
@@ -1978,10 +2032,12 @@ var ComputedRefImpl = class {
1978
2032
  get _dirty() {
1979
2033
  const flags = this.flags;
1980
2034
  if (flags & 16) return true;
1981
- if (flags & 32) if (checkDirty(this.deps, this)) {
1982
- this.flags = flags | 16;
1983
- return true;
1984
- } else this.flags = flags & -33;
2035
+ if (flags & 32) {
2036
+ if (checkDirty(this.deps, this)) {
2037
+ this.flags = flags | 16;
2038
+ return true;
2039
+ } else this.flags = flags & -33;
2040
+ }
1985
2041
  return false;
1986
2042
  }
1987
2043
  /**
@@ -2042,7 +2098,7 @@ var ComputedRefImpl = class {
2042
2098
  }
2043
2099
  };
2044
2100
  setupOnTrigger(ComputedRefImpl);
2045
- /* @__NO_SIDE_EFFECTS__ */
2101
+ /*@__NO_SIDE_EFFECTS__*/
2046
2102
  function computed$1(getterOrOptions, debugOptions, isSSR = false) {
2047
2103
  let getter;
2048
2104
  let setter;
@@ -2120,25 +2176,26 @@ var WatcherEffect = class extends ReactiveEffect {
2120
2176
  else if (isFunction(s)) return call ? call(s, 2) : s();
2121
2177
  else warnInvalidSource(s, onWarn);
2122
2178
  });
2123
- } else if (isFunction(source)) if (cb) getter = call ? () => call(source, 2) : source;
2124
- else getter = () => {
2125
- if (this.cleanupsLength) {
2126
- const prevSub = setActiveSub();
2179
+ } else if (isFunction(source)) {
2180
+ if (cb) getter = call ? () => call(source, 2) : source;
2181
+ else getter = () => {
2182
+ if (this.cleanupsLength) {
2183
+ const prevSub = setActiveSub();
2184
+ try {
2185
+ cleanup(this);
2186
+ } finally {
2187
+ setActiveSub(prevSub);
2188
+ }
2189
+ }
2190
+ const currentEffect = activeWatcher;
2191
+ activeWatcher = this;
2127
2192
  try {
2128
- cleanup(this);
2193
+ return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
2129
2194
  } finally {
2130
- setActiveSub(prevSub);
2195
+ activeWatcher = currentEffect;
2131
2196
  }
2132
- }
2133
- const currentEffect = activeWatcher;
2134
- activeWatcher = this;
2135
- try {
2136
- return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
2137
- } finally {
2138
- activeWatcher = currentEffect;
2139
- }
2140
- };
2141
- else {
2197
+ };
2198
+ } else {
2142
2199
  getter = NOOP;
2143
2200
  warnInvalidSource(source, onWarn);
2144
2201
  }
@@ -2462,7 +2519,7 @@ let currentFlushPromise = null;
2462
2519
  let jobsLength = 0;
2463
2520
  let flushIndex = 0;
2464
2521
  let postFlushIndex = 0;
2465
- const resolvedPromise = /* @__PURE__ */ Promise.resolve();
2522
+ const resolvedPromise = /*@__PURE__*/ Promise.resolve();
2466
2523
  const RECURSION_LIMIT = 100;
2467
2524
  function nextTick(fn) {
2468
2525
  const p = currentFlushPromise || resolvedPromise;
@@ -2501,6 +2558,7 @@ const doFlushJobs = () => {
2501
2558
  flushJobs();
2502
2559
  } catch (e) {
2503
2560
  currentFlushPromise = null;
2561
+ if (jobsLength || postJobs.length) queueFlush();
2504
2562
  throw e;
2505
2563
  }
2506
2564
  };
@@ -2508,9 +2566,10 @@ function queueFlush() {
2508
2566
  if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(doFlushJobs);
2509
2567
  }
2510
2568
  function queuePostFlushCb(jobs, id = Infinity) {
2511
- if (!isArray(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
2512
- else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
2513
- else for (const job of jobs) queueJobWorker(job, id, postJobs, postJobs.length, 0);
2569
+ if (!isArray(jobs)) {
2570
+ if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
2571
+ else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
2572
+ } else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
2514
2573
  queueFlush();
2515
2574
  }
2516
2575
  function flushPreFlushCbs(instance, seen) {
@@ -2524,32 +2583,39 @@ function flushPreFlushCbs(instance, seen) {
2524
2583
  i--;
2525
2584
  jobsLength--;
2526
2585
  if (cb.flags & 2) cb.flags &= -2;
2527
- cb();
2528
- if (!(cb.flags & 2)) cb.flags &= -2;
2586
+ try {
2587
+ cb();
2588
+ } finally {
2589
+ if (!(cb.flags & 2)) cb.flags &= -2;
2590
+ }
2529
2591
  }
2530
2592
  }
2531
2593
  function flushPostFlushCbs(seen) {
2532
2594
  if (postJobs.length) {
2533
2595
  if (activePostJobs) {
2534
- activePostJobs.push(...postJobs);
2596
+ for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
2535
2597
  postJobs.length = 0;
2536
2598
  return;
2537
2599
  }
2538
2600
  activePostJobs = postJobs;
2539
2601
  postJobs = [];
2540
2602
  seen = seen || /* @__PURE__ */ new Map();
2541
- while (postFlushIndex < activePostJobs.length) {
2542
- const cb = activePostJobs[postFlushIndex++];
2543
- if (checkRecursiveUpdates(seen, cb)) continue;
2544
- if (cb.flags & 2) cb.flags &= -2;
2545
- if (!(cb.flags & 4)) try {
2546
- cb();
2547
- } finally {
2548
- cb.flags &= -2;
2603
+ try {
2604
+ while (postFlushIndex < activePostJobs.length) {
2605
+ const cb = activePostJobs[postFlushIndex++];
2606
+ if (checkRecursiveUpdates(seen, cb)) continue;
2607
+ if (cb.flags & 2) cb.flags &= -2;
2608
+ if (!(cb.flags & 4)) try {
2609
+ cb();
2610
+ } finally {
2611
+ if (!(cb.flags & 2)) cb.flags &= -2;
2612
+ }
2549
2613
  }
2614
+ } finally {
2615
+ while (postFlushIndex < activePostJobs.length) activePostJobs[postFlushIndex++].flags &= -2;
2616
+ activePostJobs = null;
2617
+ postFlushIndex = 0;
2550
2618
  }
2551
- activePostJobs = null;
2552
- postFlushIndex = 0;
2553
2619
  }
2554
2620
  }
2555
2621
  let isFlushing = false;
@@ -2559,9 +2625,12 @@ let isFlushing = false;
2559
2625
  function flushOnAppMount(instance) {
2560
2626
  if (!isFlushing) {
2561
2627
  isFlushing = true;
2562
- flushPreFlushCbs(instance);
2563
- flushPostFlushCbs();
2564
- isFlushing = false;
2628
+ try {
2629
+ flushPreFlushCbs(instance);
2630
+ flushPostFlushCbs();
2631
+ } finally {
2632
+ isFlushing = false;
2633
+ }
2565
2634
  }
2566
2635
  }
2567
2636
  function flushJobs(seen) {
@@ -2591,8 +2660,8 @@ function flushJobs(seen) {
2591
2660
  jobsLength = 0;
2592
2661
  jobs.length = 0;
2593
2662
  flushPostFlushCbs(seen);
2594
- currentFlushPromise = null;
2595
2663
  if (jobsLength || postJobs.length) flushJobs(seen);
2664
+ else currentFlushPromise = null;
2596
2665
  }
2597
2666
  }
2598
2667
  function checkRecursiveUpdates(seen, fn) {
@@ -2623,6 +2692,19 @@ getGlobalThis().__VUE_HMR_RUNTIME__ = {
2623
2692
  rerender: tryWrap(rerender),
2624
2693
  reload: tryWrap(reload)
2625
2694
  };
2695
+ function runWithHmrUpdating(fn) {
2696
+ isHmrUpdating = true;
2697
+ let done = false;
2698
+ try {
2699
+ fn();
2700
+ done = true;
2701
+ } finally {
2702
+ if (done) nextTick(() => {
2703
+ isHmrUpdating = false;
2704
+ });
2705
+ else isHmrUpdating = false;
2706
+ }
2707
+ }
2626
2708
  const map = /* @__PURE__ */ new Map();
2627
2709
  function registerHMR(instance) {
2628
2710
  const id = instance.type.__hmrId;
@@ -2664,18 +2746,16 @@ function rerender(id, newRender) {
2664
2746
  instance.render = newRender;
2665
2747
  normalizeClassComponent(instance.type).render = newRender;
2666
2748
  }
2667
- isHmrUpdating = true;
2668
- if (instance.vapor) {
2669
- if (!instance.isUnmounted) instance.hmrRerender();
2670
- } else {
2671
- const i = instance;
2672
- if (!(i.effect.flags & 1024)) {
2673
- i.renderCache = [];
2674
- i.effect.run();
2749
+ runWithHmrUpdating(() => {
2750
+ if (instance.vapor) {
2751
+ if (!instance.isUnmounted) instance.hmrRerender();
2752
+ } else {
2753
+ const i = instance;
2754
+ if (!(i.effect.flags & 1024)) {
2755
+ i.renderCache = [];
2756
+ i.effect.run();
2757
+ }
2675
2758
  }
2676
- }
2677
- nextTick(() => {
2678
- isHmrUpdating = false;
2679
2759
  });
2680
2760
  });
2681
2761
  }
@@ -2690,17 +2770,19 @@ function reload(id, newComp) {
2690
2770
  for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
2691
2771
  const dirtyInstances = new Set(instances);
2692
2772
  const rerenderedParents = /* @__PURE__ */ new Set();
2693
- for (const instance of instances) {
2694
- const parent = instance.parent;
2695
- if (parent) {
2696
- if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
2697
- rerenderedParents.add(parent);
2698
- parent.hmrRerender();
2699
- }
2700
- } else instance.hmrReload(newComp);
2701
- }
2773
+ runWithHmrUpdating(() => {
2774
+ for (const instance of instances) {
2775
+ const parent = instance.parent;
2776
+ if (parent) {
2777
+ if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
2778
+ rerenderedParents.add(parent);
2779
+ parent.hmrRerender();
2780
+ }
2781
+ } else instance.hmrReload(newComp);
2782
+ }
2783
+ });
2702
2784
  } else {
2703
- const parentUpdates = /* @__PURE__ */ new Map();
2785
+ const parents = /* @__PURE__ */ new Set();
2704
2786
  const dirtyInstanceSet = new Set(instances);
2705
2787
  for (const instance of instances) {
2706
2788
  const oldComp = normalizeClassComponent(instance.type);
@@ -2719,33 +2801,23 @@ function reload(id, newComp) {
2719
2801
  instance.ceReload(newComp.styles);
2720
2802
  dirtyInstances.delete(instance);
2721
2803
  } else if (instance.parent) {
2722
- const parent = instance.parent;
2723
- if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
2724
- let updates = parentUpdates.get(parent);
2725
- if (!updates) parentUpdates.set(parent, updates = []);
2726
- updates.push([instance, dirtyInstances]);
2727
- }
2804
+ if (!hasDirtyAncestor(instance, dirtyInstanceSet)) parents.add(instance.parent);
2728
2805
  } else if (instance.appContext.reload) instance.appContext.reload();
2729
2806
  else if (typeof window !== "undefined") window.location.reload();
2730
2807
  else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2731
2808
  if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2732
2809
  }
2733
- parentUpdates.forEach((updates, parent) => {
2810
+ parents.forEach((parent) => {
2734
2811
  queueJob(() => {
2735
- isHmrUpdating = true;
2736
- if (parent.vapor) parent.hmrRerender();
2737
- else {
2738
- const i = parent;
2739
- if (!(i.effect.flags & 1024)) {
2740
- i.renderCache = [];
2741
- i.effect.run();
2812
+ runWithHmrUpdating(() => {
2813
+ if (parent.vapor) parent.hmrRerender();
2814
+ else {
2815
+ const i = parent;
2816
+ if (!(i.effect.flags & 1024)) {
2817
+ i.renderCache = [];
2818
+ i.effect.run();
2819
+ }
2742
2820
  }
2743
- }
2744
- nextTick(() => {
2745
- isHmrUpdating = false;
2746
- });
2747
- updates.forEach(([instance, dirtyInstances]) => {
2748
- dirtyInstances.delete(instance);
2749
2821
  });
2750
2822
  });
2751
2823
  });
@@ -2815,20 +2887,20 @@ function devtoolsInitApp(app, version) {
2815
2887
  function devtoolsUnmountApp(app) {
2816
2888
  emit$1("app:unmount", app);
2817
2889
  }
2818
- const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added");
2819
- const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated");
2820
- const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook("component:removed");
2890
+ const devtoolsComponentAdded = /*@__PURE__*/ createDevtoolsComponentHook("component:added");
2891
+ const devtoolsComponentUpdated = /*@__PURE__*/ createDevtoolsComponentHook("component:updated");
2892
+ const _devtoolsComponentRemoved = /*@__PURE__*/ createDevtoolsComponentHook("component:removed");
2821
2893
  const devtoolsComponentRemoved = (component) => {
2822
2894
  if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && !devtools$1.cleanupBuffer(component)) _devtoolsComponentRemoved(component);
2823
2895
  };
2824
- /* @__NO_SIDE_EFFECTS__ */
2896
+ /*@__NO_SIDE_EFFECTS__*/
2825
2897
  function createDevtoolsComponentHook(hook) {
2826
2898
  return (component) => {
2827
2899
  emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component);
2828
2900
  };
2829
2901
  }
2830
- const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start");
2831
- const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end");
2902
+ const devtoolsPerfStart = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:start");
2903
+ const devtoolsPerfEnd = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:end");
2832
2904
  function createDevtoolsPerformanceHook(hook) {
2833
2905
  return (component, type, time) => {
2834
2906
  emit$1(hook, component.appContext.app, component.uid, component, type, time);
@@ -3071,7 +3143,7 @@ function instanceWatch(source, value, options) {
3071
3143
  }
3072
3144
  const prev = setCurrentInstance(this);
3073
3145
  const res = doWatch(getter, cb.bind(publicThis), options);
3074
- setCurrentInstance(...prev);
3146
+ restoreCurrentInstance(prev);
3075
3147
  return res;
3076
3148
  }
3077
3149
  function createPathGetter(ctx, path) {
@@ -3093,15 +3165,16 @@ const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target inst
3093
3165
  const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
3094
3166
  const resolveTarget = (props, select) => {
3095
3167
  const targetSelector = props && props.to;
3096
- if (isString(targetSelector)) if (!select) {
3097
- warn$1("Current renderer does not support string target for Teleports. (missing querySelector renderer option)");
3098
- return null;
3168
+ if (isString(targetSelector)) {
3169
+ if (!select) {
3170
+ warn$1("Current renderer does not support string target for Teleports. (missing querySelector renderer option)");
3171
+ return null;
3172
+ } else {
3173
+ const target = select(targetSelector);
3174
+ if (!target && !isTeleportDisabled(props)) warn$1(`Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`);
3175
+ return target;
3176
+ }
3099
3177
  } else {
3100
- const target = select(targetSelector);
3101
- if (!target && !isTeleportDisabled(props)) warn$1(`Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`);
3102
- return target;
3103
- }
3104
- else {
3105
3178
  if (!targetSelector && !isTeleportDisabled(props)) warn$1(`Invalid Teleport target: ${targetSelector}`);
3106
3179
  return targetSelector;
3107
3180
  }
@@ -3139,7 +3212,8 @@ const TeleportImpl = {
3139
3212
  if (pendingMounts.get(vnode) !== mountJob) return;
3140
3213
  pendingMounts.delete(vnode);
3141
3214
  if (isTeleportDisabled(vnode.props)) {
3142
- mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
3215
+ const mountContainer = parentNode(vnode.el) || container;
3216
+ mount(vnode, mountContainer, vnode.anchor);
3143
3217
  updateCssVars(vnode, true);
3144
3218
  }
3145
3219
  mountToTarget(vnode);
@@ -3248,15 +3322,17 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3248
3322
  const disabled = isTeleportDisabled(vnode.props);
3249
3323
  if (target) {
3250
3324
  const targetNode = target._lpa || target.firstChild;
3251
- if (vnode.shapeFlag & 16) if (disabled) {
3252
- hydrateDisabledTeleport(node, vnode);
3253
- hydrateAnchor(target, targetNode);
3254
- if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
3255
- } else {
3256
- vnode.anchor = nextSibling(node);
3257
- hydrateAnchor(target, targetNode);
3258
- if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
3259
- hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
3325
+ if (vnode.shapeFlag & 16) {
3326
+ if (disabled) {
3327
+ hydrateDisabledTeleport(node, vnode);
3328
+ hydrateAnchor(target, targetNode);
3329
+ if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
3330
+ } else {
3331
+ vnode.anchor = nextSibling(node);
3332
+ hydrateAnchor(target, targetNode);
3333
+ if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
3334
+ hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
3335
+ }
3260
3336
  }
3261
3337
  updateCssVars(vnode, disabled);
3262
3338
  } else if (disabled) {
@@ -3344,49 +3420,16 @@ const BaseTransitionImpl = {
3344
3420
  setup(props, { slots }) {
3345
3421
  const instance = getCurrentInstance();
3346
3422
  const state = useTransitionState();
3423
+ let resumeAfterLeave;
3347
3424
  return () => {
3348
- const children = slots.default && getTransitionRawChildren(slots.default(), true);
3349
- const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
3425
+ const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
3350
3426
  if (!child) return;
3351
3427
  const rawProps = /* @__PURE__ */ toRaw(props);
3352
3428
  const { mode } = rawProps;
3353
3429
  checkTransitionMode(mode);
3354
- if (state.isLeaving) return emptyPlaceholder(child);
3355
- const innerChild = getInnerChild$1(child);
3356
- if (!innerChild) return emptyPlaceholder(child);
3357
- let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
3358
- if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
3359
- let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3360
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3361
- let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
3362
- setTransitionHooks(oldInnerChild, leavingHooks);
3363
- if (mode === "out-in" && innerChild.type !== Comment) {
3364
- state.isLeaving = true;
3365
- leavingHooks.afterLeave = () => {
3366
- state.isLeaving = false;
3367
- if (!(instance.job.flags & 4)) instance.update();
3368
- delete leavingHooks.afterLeave;
3369
- oldInnerChild = void 0;
3370
- };
3371
- return emptyPlaceholder(child);
3372
- } else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
3373
- const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
3374
- leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
3375
- el[leaveCbKey] = () => {
3376
- earlyRemove();
3377
- el[leaveCbKey] = void 0;
3378
- delete enterHooks.delayedLeave;
3379
- oldInnerChild = void 0;
3380
- };
3381
- enterHooks.delayedLeave = () => {
3382
- delayedLeave();
3383
- delete enterHooks.delayedLeave;
3384
- oldInnerChild = void 0;
3385
- };
3386
- };
3387
- else oldInnerChild = void 0;
3388
- } else if (oldInnerChild) oldInnerChild = void 0;
3389
- return child;
3430
+ return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
3431
+ if (!(instance.job.flags & 4)) instance.update();
3432
+ }) : NOOP);
3390
3433
  };
3391
3434
  }
3392
3435
  };
@@ -3455,8 +3498,10 @@ function baseResolveTransitionHooks(context, props, state, instance) {
3455
3498
  persisted,
3456
3499
  beforeEnter(el) {
3457
3500
  let hook = onBeforeEnter;
3458
- if (!state.isMounted) if (appear) hook = onBeforeAppear || onBeforeEnter;
3459
- else return;
3501
+ if (!state.isMounted) {
3502
+ if (appear) hook = onBeforeAppear || onBeforeEnter;
3503
+ else return;
3504
+ }
3460
3505
  if (el[leaveCbKey]) el[leaveCbKey](true);
3461
3506
  earlyRemove();
3462
3507
  callHook(hook, [el]);
@@ -3466,11 +3511,13 @@ function baseResolveTransitionHooks(context, props, state, instance) {
3466
3511
  let hook = onEnter;
3467
3512
  let afterHook = onAfterEnter;
3468
3513
  let cancelHook = onEnterCancelled;
3469
- if (!state.isMounted) if (appear) {
3470
- hook = onAppear || onEnter;
3471
- afterHook = onAfterAppear || onAfterEnter;
3472
- cancelHook = onAppearCancelled || onEnterCancelled;
3473
- } else return;
3514
+ if (!state.isMounted) {
3515
+ if (appear) {
3516
+ hook = onAppear || onEnter;
3517
+ afterHook = onAfterAppear || onAfterEnter;
3518
+ cancelHook = onAppearCancelled || onEnterCancelled;
3519
+ } else return;
3520
+ }
3474
3521
  let called = false;
3475
3522
  el[enterCbKey$1] = (cancelled) => {
3476
3523
  if (called) return;
@@ -3504,7 +3551,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
3504
3551
  else done();
3505
3552
  },
3506
3553
  clone(node) {
3507
- return cloneHooks(node);
3554
+ return cloneHooks ? cloneHooks(node) : hooks;
3508
3555
  }
3509
3556
  };
3510
3557
  return hooks;
@@ -3528,16 +3575,91 @@ function getInnerChild$1(vnode) {
3528
3575
  if (shapeFlag & 32 && isFunction(children.default)) return children.default();
3529
3576
  }
3530
3577
  }
3578
+ function resolveTransitionChild(children, renderEmpty = false) {
3579
+ const branches = children && getTransitionRawChildren(children, true);
3580
+ return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
3581
+ }
3582
+ /**
3583
+ * @internal
3584
+ */
3585
+ function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
3586
+ if (state.isLeaving) return emptyPlaceholder(next);
3587
+ const nextInner = getInnerChild$1(next);
3588
+ if (!nextInner) return emptyPlaceholder(next);
3589
+ let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
3590
+ if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
3591
+ enterHooks = hooks;
3592
+ });
3593
+ if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
3594
+ if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
3595
+ const mode = props.mode;
3596
+ const previousInner = previous && getInnerChild$1(previous);
3597
+ if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
3598
+ const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
3599
+ if (nextInner.type !== Comment && (mode === "out-in" || mode === "in-out") && applyTransitionModeSwitch(previousInner, leavingHooks, mode === "in-out" ? () => enterHooks : void 0, props, state, resumeAfterLeave)) return emptyPlaceholder(next);
3600
+ }
3601
+ return next;
3602
+ }
3603
+ function forwardDelayedLeave(hooks, source) {
3604
+ const delayedLeave = source && source.delayedLeave;
3605
+ if (!delayedLeave) return;
3606
+ hooks.delayedLeave = () => {
3607
+ if (source.delayedLeave === delayedLeave) delayedLeave();
3608
+ delete hooks.delayedLeave;
3609
+ };
3610
+ }
3611
+ function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
3612
+ return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
3613
+ }
3614
+ function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
3615
+ if (props.mode === "out-in") {
3616
+ state.isLeaving = true;
3617
+ leavingHooks.afterLeave = () => {
3618
+ state.isLeaving = false;
3619
+ resumeAfterLeave();
3620
+ delete leavingHooks.afterLeave;
3621
+ };
3622
+ return true;
3623
+ } else if (props.mode === "in-out" && getEnterHooks) {
3624
+ let delayedLeavingVNode = leavingVNode;
3625
+ leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
3626
+ const enterHooks = getEnterHooks();
3627
+ if (!enterHooks) {
3628
+ delayedLeave();
3629
+ return;
3630
+ }
3631
+ const vnode = delayedLeavingVNode;
3632
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3633
+ leavingVNodesCache[String(vnode.key)] = vnode;
3634
+ el[leaveCbKey] = () => {
3635
+ earlyRemove();
3636
+ el[leaveCbKey] = void 0;
3637
+ delete enterHooks.delayedLeave;
3638
+ delayedLeavingVNode = void 0;
3639
+ };
3640
+ enterHooks.delayedLeave = () => {
3641
+ delayedLeave();
3642
+ delete enterHooks.delayedLeave;
3643
+ delayedLeavingVNode = void 0;
3644
+ };
3645
+ };
3646
+ }
3647
+ return false;
3648
+ }
3531
3649
  function setTransitionHooks(vnode, hooks) {
3532
- if (vnode.shapeFlag & 6 && vnode.component) if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
3533
- else {
3650
+ if (vnode.shapeFlag & 6 && vnode.component) {
3534
3651
  vnode.transition = hooks;
3535
- setTransitionHooks(vnode.component.subTree, hooks);
3536
- }
3537
- else if (vnode.shapeFlag & 128) {
3538
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3539
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3652
+ if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
3653
+ else {
3654
+ const subTree = vnode.component.subTree;
3655
+ return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
3656
+ }
3657
+ } else if (vnode.shapeFlag & 128) {
3658
+ const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3659
+ const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3660
+ return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
3540
3661
  } else vnode.transition = hooks;
3662
+ return hooks;
3541
3663
  }
3542
3664
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
3543
3665
  let ret = [];
@@ -3561,9 +3683,9 @@ function checkTransitionMode(mode) {
3561
3683
  }
3562
3684
  //#endregion
3563
3685
  //#region packages/runtime-core/src/apiDefineComponent.ts
3564
- /* @__NO_SIDE_EFFECTS__ */
3686
+ /*@__NO_SIDE_EFFECTS__*/
3565
3687
  function defineComponent(options, extraOptions) {
3566
- return isFunction(options) ? extend({ name: options.name }, extraOptions, { setup: options }) : options;
3688
+ return isFunction(options) ? /*@__PURE__*/ (() => extend({ name: options.name }, extraOptions, { setup: options }))() : options;
3567
3689
  }
3568
3690
  //#endregion
3569
3691
  //#region packages/runtime-core/src/helpers/useId.ts
@@ -3660,15 +3782,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3660
3782
  if (rawRef.f) {
3661
3783
  const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
3662
3784
  if (isUnmount) isArray(existing) && remove(existing, refValue);
3663
- else if (!isArray(existing)) if (_isString) {
3664
- refs[ref] = [refValue];
3665
- if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
3666
- } else {
3667
- const newVal = [refValue];
3668
- if (canSetRef(ref, rawRef.k)) ref.value = newVal;
3669
- if (rawRef.k) refs[rawRef.k] = newVal;
3670
- }
3671
- else if (!existing.includes(refValue)) existing.push(refValue);
3785
+ else if (!isArray(existing)) {
3786
+ if (_isString) {
3787
+ refs[ref] = [refValue];
3788
+ if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
3789
+ } else {
3790
+ const newVal = [refValue];
3791
+ if (canSetRef(ref, rawRef.k)) ref.value = newVal;
3792
+ if (rawRef.k) refs[rawRef.k] = newVal;
3793
+ }
3794
+ } else if (!existing.includes(refValue)) existing.push(refValue);
3672
3795
  } else if (_isString) {
3673
3796
  refs[ref] = value;
3674
3797
  if (canSetSetupRef(ref)) setupState[ref] = value;
@@ -3720,7 +3843,18 @@ const logMismatchError = () => {
3720
3843
  hasLoggedMismatchError = true;
3721
3844
  };
3722
3845
  const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
3723
- const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
3846
+ const isMathMLContainer = (container) => {
3847
+ if (!container.namespaceURI.includes("MathML")) return false;
3848
+ if (container.tagName !== "annotation-xml") return true;
3849
+ const encoding = container.getAttribute("encoding");
3850
+ return !encoding || !encoding.includes("html");
3851
+ };
3852
+ /**
3853
+ * Resolve the element namespace a container's children should be created in.
3854
+ * The live DOM is the source of truth, so this also covers containers that are
3855
+ * only known at runtime (interop boundaries, teleport targets).
3856
+ * @internal
3857
+ */
3724
3858
  const getContainerType = (container) => {
3725
3859
  if (container.nodeType !== 1) return void 0;
3726
3860
  if (isSVGContainer(container)) return "svg";
@@ -3744,7 +3878,7 @@ function createHydrationFunctions(rendererInternals) {
3744
3878
  };
3745
3879
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
3746
3880
  optimized = optimized || !!vnode.dynamicChildren;
3747
- const isFragmentStart = isComment(node) && node.data === "[";
3881
+ const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
3748
3882
  const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
3749
3883
  const { type, ref, shapeFlag, patchFlag } = vnode;
3750
3884
  let domType = node.nodeType;
@@ -3758,11 +3892,12 @@ function createHydrationFunctions(rendererInternals) {
3758
3892
  let nextNode = null;
3759
3893
  switch (type) {
3760
3894
  case Text:
3761
- if (domType !== 3) if (vnode.children === "") {
3762
- insert(vnode.el = createText(""), parentNode(node), node);
3763
- nextNode = node;
3764
- } else nextNode = onMismatch();
3765
- else {
3895
+ if (domType !== 3) {
3896
+ if (vnode.children === "") {
3897
+ insert(vnode.el = createText(""), parentNode(node), node);
3898
+ nextNode = node;
3899
+ } else nextNode = onMismatch();
3900
+ } else {
3766
3901
  if (node.data !== vnode.children) {
3767
3902
  warn$1(`Hydration text mismatch in`, node.parentNode, `\n - rendered on server: ${JSON.stringify(node.data)}\n - expected on client: ${JSON.stringify(vnode.children)}`);
3768
3903
  logMismatchError();
@@ -3799,45 +3934,35 @@ function createHydrationFunctions(rendererInternals) {
3799
3934
  else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
3800
3935
  break;
3801
3936
  case VaporSlot:
3802
- nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
3937
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
3803
3938
  break;
3804
- default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
3805
- else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
3806
- else if (shapeFlag & 6) {
3939
+ default: if (shapeFlag & 1) {
3940
+ if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
3941
+ else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
3942
+ } else if (shapeFlag & 6) {
3807
3943
  vnode.slotScopeIds = slotScopeIds;
3808
3944
  const container = parentNode(node);
3809
3945
  if (isFragmentStart) nextNode = locateClosingAnchor(node);
3810
3946
  else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
3811
3947
  else nextNode = nextSibling(node);
3812
- if (vnode.type.__vapor) {
3813
- const vnodeBeforeMountHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeBeforeMount;
3814
- getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
3815
- if (vnode.dirs) {
3816
- invokeDirectiveHook(vnode, null, parentComponent, "created");
3817
- invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
3818
- }
3819
- }, () => {
3820
- if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
3821
- });
3822
- if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
3823
- const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
3824
- if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
3825
- } else {
3948
+ if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense);
3949
+ else {
3826
3950
  mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
3827
3951
  const component = vnode.component;
3828
- if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved || component.asyncDep && !component.asyncResolved) {
3952
+ if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
3829
3953
  let subTree;
3830
3954
  if (isFragmentStart) {
3831
- subTree = createVNode(Fragment);
3955
+ subTree = createVNode(Static);
3832
3956
  subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
3833
- } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
3957
+ } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
3834
3958
  subTree.el = node;
3835
3959
  component.subTree = subTree;
3836
3960
  }
3837
3961
  }
3838
- } else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
3839
- else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
3840
- else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
3962
+ } else if (shapeFlag & 64) {
3963
+ if (domType !== 8) nextNode = onMismatch();
3964
+ else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
3965
+ } else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
3841
3966
  else warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
3842
3967
  }
3843
3968
  if (ref != null) setRef(ref, null, parentSuspense, vnode);
@@ -3889,7 +4014,10 @@ function createHydrationFunctions(rendererInternals) {
3889
4014
  const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
3890
4015
  for (const key in props) {
3891
4016
  if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
3892
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) patchProp(el, key, null, props[key], namespace, parentComponent);
4017
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
4018
+ if (isUnchangedResourceProp(el, key, props[key])) continue;
4019
+ patchProp(el, key, null, props[key], namespace, parentComponent);
4020
+ }
3893
4021
  }
3894
4022
  }
3895
4023
  let vnodeHooks;
@@ -3937,8 +4065,9 @@ function createHydrationFunctions(rendererInternals) {
3937
4065
  const { slotScopeIds: fragmentSlotScopeIds } = vnode;
3938
4066
  if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
3939
4067
  const container = parentNode(node);
3940
- const next = hydrateChildren(nextSibling(node), vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
3941
- if (next && isComment(next) && next.data === "]") return nextSibling(vnode.anchor = next);
4068
+ const first = nextSibling(node);
4069
+ const next = vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
4070
+ if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
3942
4071
  else {
3943
4072
  logMismatchError();
3944
4073
  insert(vnode.anchor = createComment(`]`), container, next);
@@ -3947,7 +4076,7 @@ function createHydrationFunctions(rendererInternals) {
3947
4076
  };
3948
4077
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
3949
4078
  if (!isNodeMismatchAllowed(node, vnode)) {
3950
- warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
4079
+ warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && (node.data === "[" || node.data === "(") ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
3951
4080
  logMismatchError();
3952
4081
  }
3953
4082
  vnode.el = null;
@@ -3963,20 +4092,22 @@ function createHydrationFunctions(rendererInternals) {
3963
4092
  const container = parentNode(node);
3964
4093
  remove(node);
3965
4094
  patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
3966
- if (parentComponent) {
4095
+ if (parentComponent && parentComponent.vnode) {
3967
4096
  parentComponent.vnode.el = vnode.el;
3968
4097
  updateHOCHostEl(parentComponent, vnode.el);
3969
4098
  }
3970
4099
  return next;
3971
4100
  };
3972
- const locateClosingAnchor = (node, open = "[", close = "]") => {
4101
+ const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
3973
4102
  let match = 0;
3974
4103
  while (node) {
3975
4104
  node = nextSibling(node);
3976
4105
  if (node && isComment(node)) {
3977
4106
  if (node.data === open) match++;
3978
- if (node.data === close) if (match === 0) return nextSibling(node);
3979
- else match--;
4107
+ if (node.data === close) {
4108
+ if (match === 0) return nextSibling(node);
4109
+ else match--;
4110
+ }
3980
4111
  }
3981
4112
  }
3982
4113
  return node;
@@ -3986,7 +4117,7 @@ function createHydrationFunctions(rendererInternals) {
3986
4117
  if (parentNode) parentNode.replaceChild(newNode, oldNode);
3987
4118
  let parent = parentComponent;
3988
4119
  while (parent) {
3989
- if (parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
4120
+ if (parent.vnode && parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
3990
4121
  parent = parent.parent;
3991
4122
  }
3992
4123
  };
@@ -3995,6 +4126,16 @@ function createHydrationFunctions(rendererInternals) {
3995
4126
  const isTemplateNode = (node) => {
3996
4127
  return node.nodeType === 1 && node.tagName === "TEMPLATE";
3997
4128
  };
4129
+ const resourceProps = /*@__PURE__*/ new Set([
4130
+ "src",
4131
+ "srcset",
4132
+ "href",
4133
+ "poster"
4134
+ ]);
4135
+ function isUnchangedResourceProp(el, key, clientValue) {
4136
+ if (!resourceProps.has(key)) return false;
4137
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
4138
+ }
3998
4139
  /**
3999
4140
  * Dev only
4000
4141
  */
@@ -4038,7 +4179,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
4038
4179
  function getAttributeMismatch(el, key, clientValue) {
4039
4180
  let actual;
4040
4181
  let expected;
4041
- if (isBooleanAttr(key)) {
4182
+ if (key === "hidden") {
4183
+ actual = normalizeHiddenValue(el.getAttribute(key));
4184
+ expected = normalizeHiddenValue(clientValue);
4185
+ } else if (isBooleanAttr(key)) {
4042
4186
  actual = el.hasAttribute(key);
4043
4187
  expected = includeBooleanAttr(clientValue);
4044
4188
  } else if (clientValue == null) {
@@ -4066,6 +4210,11 @@ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
4066
4210
  }
4067
4211
  return false;
4068
4212
  }
4213
+ function normalizeHiddenValue(value) {
4214
+ if (!isRenderableAttrValue(value)) return false;
4215
+ if (isString(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
4216
+ return includeBooleanAttr(value) ? "" : false;
4217
+ }
4069
4218
  function toClassSet(str) {
4070
4219
  return new Set(str.trim().split(/\s+/));
4071
4220
  }
@@ -4204,16 +4353,18 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
4204
4353
  return teardown;
4205
4354
  };
4206
4355
  function forEachElement(node, cb) {
4207
- if (isComment(node) && node.data === "[") {
4356
+ if (isComment(node) && (node.data === "[" || node.data === "(")) {
4357
+ const open = node.data;
4358
+ const close = open === "[" ? "]" : ")";
4208
4359
  let depth = 1;
4209
4360
  let next = node.nextSibling;
4210
4361
  while (next) {
4211
4362
  if (next.nodeType === 1) {
4212
4363
  if (cb(next) === false) break;
4213
4364
  } else if (isComment(next)) {
4214
- if (next.data === "]") {
4365
+ if (next.data === close) {
4215
4366
  if (--depth === 0) break;
4216
- } else if (next.data === "[") depth++;
4367
+ } else if (next.data === open) depth++;
4217
4368
  }
4218
4369
  next = next.nextSibling;
4219
4370
  }
@@ -4222,14 +4373,14 @@ function forEachElement(node, cb) {
4222
4373
  //#endregion
4223
4374
  //#region packages/runtime-core/src/apiAsyncComponent.ts
4224
4375
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
4225
- /* @__NO_SIDE_EFFECTS__ */
4376
+ /*@__NO_SIDE_EFFECTS__*/
4226
4377
  function defineAsyncComponent(source) {
4227
4378
  const { load, getResolvedComp, setPendingRequest, source: { loadingComponent, errorComponent, delay, hydrate: hydrateStrategy, timeout, suspensible = true } } = createAsyncComponentContext(source);
4228
4379
  return /* @__PURE__ */ defineComponent({
4229
4380
  name: "AsyncComponentWrapper",
4230
4381
  __asyncLoader: load,
4231
4382
  __asyncHydrate(el, instance, hydrate) {
4232
- performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy);
4383
+ performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, true);
4233
4384
  },
4234
4385
  get __asyncResolved() {
4235
4386
  return getResolvedComp();
@@ -4348,10 +4499,10 @@ const useAsyncComponentState = (delay, timeout, onError, instance = currentInsta
4348
4499
  * shared between core and vapor
4349
4500
  * @internal
4350
4501
  */
4351
- function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
4502
+ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, skipIfUpdated) {
4352
4503
  const wasConnected = el.isConnected;
4353
4504
  let patched = false;
4354
- (instance.bu || (instance.bu = [])).push(() => patched = true);
4505
+ if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
4355
4506
  const performHydrate = () => {
4356
4507
  if (patched) {
4357
4508
  {
@@ -4437,10 +4588,13 @@ const KeepAlive = {
4437
4588
  });
4438
4589
  let pendingCacheKey = null;
4439
4590
  const cacheSubtree = () => {
4440
- if (pendingCacheKey != null) if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
4441
- cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
4442
- }, void 0, keepAliveInstance.subTree.suspense);
4443
- else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
4591
+ if (pendingCacheKey != null) {
4592
+ if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
4593
+ const vnode = getInnerChild(keepAliveInstance.subTree);
4594
+ if (vnode.component) cache.set(pendingCacheKey, vnode);
4595
+ }, void 0, keepAliveInstance.subTree.suspense);
4596
+ else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
4597
+ }
4444
4598
  };
4445
4599
  onMounted(cacheSubtree);
4446
4600
  onUpdated(cacheSubtree);
@@ -4597,7 +4751,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
4597
4751
  try {
4598
4752
  return callWithAsyncErrorHandling(hook, target, type, args);
4599
4753
  } finally {
4600
- setCurrentInstance(...prev);
4754
+ restoreCurrentInstance(prev);
4601
4755
  setActiveSub(prevSub);
4602
4756
  }
4603
4757
  });
@@ -4682,23 +4836,25 @@ function renderList(source, renderItem, cache, index) {
4682
4836
  }
4683
4837
  ret = new Array(source.length);
4684
4838
  for (let i = 0, l = source.length; i < l; i++) ret[i] = renderItem(needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], i, void 0, cached && cached[i]);
4685
- } else if (typeof source === "number") if (!Number.isInteger(source) || source < 0) {
4686
- warn$1(`The v-for range expects a positive integer value but got ${source}.`);
4687
- ret = [];
4688
- } else {
4689
- ret = new Array(source);
4690
- for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
4691
- }
4692
- else if (isObject(source)) if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
4693
- else {
4694
- const keys = Object.keys(source);
4695
- ret = new Array(keys.length);
4696
- for (let i = 0, l = keys.length; i < l; i++) {
4697
- const key = keys[i];
4698
- ret[i] = renderItem(source[key], key, i, cached && cached[i]);
4839
+ } else if (typeof source === "number") {
4840
+ if (!Number.isInteger(source) || source < 0) {
4841
+ warn$1(`The v-for range expects a positive integer value but got ${source}.`);
4842
+ ret = [];
4843
+ } else {
4844
+ ret = new Array(source);
4845
+ for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
4699
4846
  }
4700
- }
4701
- else ret = [];
4847
+ } else if (isObject(source)) {
4848
+ if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
4849
+ else {
4850
+ const keys = Object.keys(source);
4851
+ ret = new Array(keys.length);
4852
+ for (let i = 0, l = keys.length; i < l; i++) {
4853
+ const key = keys[i];
4854
+ ret[i] = renderItem(source[key], key, i, cached && cached[i]);
4855
+ }
4856
+ }
4857
+ } else ret = [];
4702
4858
  if (cache) cache[index] = ret;
4703
4859
  return ret;
4704
4860
  }
@@ -4723,18 +4879,28 @@ function createSlots(slots, dynamicSlots) {
4723
4879
  //#endregion
4724
4880
  //#region packages/runtime-core/src/helpers/renderSlot.ts
4725
4881
  /**
4882
+ * Links a slot function to its raw vapor slot: a raw vapor slot carries
4883
+ * itself, and the wrapper the interop slots proxy hands out carries the raw
4884
+ * slot it wraps — one lookup answers both "is this a vapor slot" and
4885
+ * "which one". Internal to vapor interop.
4886
+ */
4887
+ const rawVaporSlotKey = Symbol(`rawVaporSlot`);
4888
+ /**
4726
4889
  * Compiler runtime helper for rendering `<slot/>`
4727
4890
  * @private
4728
4891
  */
4729
- function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
4892
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
4893
+ if (props == null) props = {};
4730
4894
  let slot = slots[name];
4731
- if (fallback) fallback.__vdom = true;
4732
- const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
4895
+ const vaporSlot = slot && slot[rawVaporSlotKey];
4733
4896
  if (vaporSlot) {
4734
4897
  const ret = (openBlock(), createBlock(VaporSlot, props));
4735
4898
  ret.vs = {
4736
4899
  slot: vaporSlot,
4737
- fallback
4900
+ outlets: fallback ? [{
4901
+ fallback,
4902
+ owner: currentRenderingInstance
4903
+ }] : void 0
4738
4904
  };
4739
4905
  if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
4740
4906
  return ret;
@@ -4755,9 +4921,15 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
4755
4921
  let rendered;
4756
4922
  try {
4757
4923
  const validSlotContent = slot && ensureValidVNode(slot(props));
4758
- ensureVaporSlotFallback(validSlotContent, fallback);
4924
+ let attached = false;
4925
+ if (fallback && validSlotContent && currentRenderingInstance) {
4926
+ const interop = currentRenderingInstance.appContext.vapor;
4927
+ if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
4928
+ }
4759
4929
  const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
4760
4930
  rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
4931
+ if (!validSlotContent && fallback) rendered.shapeFlag |= 1024;
4932
+ if (attached) rendered.vo = true;
4761
4933
  } catch (err) {
4762
4934
  for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
4763
4935
  throw err;
@@ -4775,10 +4947,6 @@ function ensureValidVNode(vnodes) {
4775
4947
  return true;
4776
4948
  }) ? vnodes : null;
4777
4949
  }
4778
- function ensureVaporSlotFallback(vnodes, fallback) {
4779
- let vaporSlot;
4780
- if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
4781
- }
4782
4950
  //#endregion
4783
4951
  //#region packages/runtime-core/src/helpers/toHandlers.ts
4784
4952
  /**
@@ -4806,11 +4974,38 @@ const getPublicInstance = (i) => {
4806
4974
  if (isStatefulComponent(i)) return getComponentPublicInstance(i);
4807
4975
  return getPublicInstance(i.parent);
4808
4976
  };
4977
+ const resolveDevRootEl = (vnode) => {
4978
+ let found = false;
4979
+ while (true) {
4980
+ if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
4981
+ const root = filterSingleRoot(vnode.children);
4982
+ if (!root) return;
4983
+ vnode = root;
4984
+ found = true;
4985
+ continue;
4986
+ }
4987
+ const component = vnode.component;
4988
+ if (component && component.subTree) {
4989
+ vnode = component.subTree;
4990
+ continue;
4991
+ }
4992
+ const suspense = vnode.suspense;
4993
+ if (suspense && suspense.activeBranch) {
4994
+ vnode = suspense.activeBranch;
4995
+ continue;
4996
+ }
4997
+ return found ? vnode.el : void 0;
4998
+ }
4999
+ };
5000
+ const getDevRootFragmentEl = (i) => {
5001
+ const el = i.subTree && resolveDevRootEl(i.subTree);
5002
+ return el === void 0 ? i.vnode.el : el;
5003
+ };
4809
5004
  let publicPropertiesMap;
4810
5005
  const getPublicPropertiesMap = () => {
4811
5006
  if (!publicPropertiesMap) publicPropertiesMap = extend(Object.create(null), {
4812
5007
  $: (i) => i,
4813
- $el: (i) => i.vnode.el,
5008
+ $el: (i) => getDevRootFragmentEl(i),
4814
5009
  $data: (i) => i.data,
4815
5010
  $props: (i) => /* @__PURE__ */ shallowReadonly(i.props),
4816
5011
  $attrs: (i) => /* @__PURE__ */ shallowReadonly(i.attrs),
@@ -4916,7 +5111,7 @@ PublicInstanceProxyHandlers.ownKeys = (target) => {
4916
5111
  warn$1("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.");
4917
5112
  return Reflect.ownKeys(target);
4918
5113
  };
4919
- const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, {
5114
+ const RuntimeCompiledPublicInstanceProxyHandlers = /*@__PURE__*/ extend({}, PublicInstanceProxyHandlers, {
4920
5115
  get(target, key) {
4921
5116
  if (key === Symbol.unscopables) return;
4922
5117
  return PublicInstanceProxyHandlers.get(target, key, target);
@@ -5088,12 +5283,13 @@ function mergeDefaults(raw, defaults) {
5088
5283
  for (const key in defaults) {
5089
5284
  if (key.startsWith("__skip")) continue;
5090
5285
  let opt = props[key];
5091
- if (opt) if (isArray(opt) || isFunction(opt)) opt = props[key] = {
5092
- type: opt,
5093
- default: defaults[key]
5094
- };
5095
- else opt.default = defaults[key];
5096
- else if (opt === null) opt = props[key] = { default: defaults[key] };
5286
+ if (opt) {
5287
+ if (isArray(opt) || isFunction(opt)) opt = props[key] = {
5288
+ type: opt,
5289
+ default: defaults[key]
5290
+ };
5291
+ else opt.default = defaults[key];
5292
+ } else if (opt === null) opt = props[key] = { default: defaults[key] };
5097
5293
  else warn$1(`props default key "${key}" has no corresponding declaration.`);
5098
5294
  if (opt && defaults[`__skip_${key}`]) opt.skipFactory = true;
5099
5295
  }
@@ -5143,37 +5339,32 @@ function createPropsRestProxy(props, excludedKeys) {
5143
5339
  function withAsyncContext(getAwaitable) {
5144
5340
  const ctx = getCurrentGenericInstance();
5145
5341
  const inSSRSetup = isInSSRComponentSetup;
5146
- const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
5147
5342
  if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
5148
5343
  let awaitable = getAwaitable();
5149
5344
  setCurrentInstance(null, void 0);
5150
5345
  if (inSSRSetup) setInSSRSetupState(false);
5151
5346
  const restore = () => {
5152
- const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
5347
+ const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
5153
5348
  setCurrentInstance(ctx);
5154
5349
  if (inSSRSetup) setInSSRSetupState(true);
5155
- const reset = restoreAsyncContext && restoreAsyncContext();
5156
- return () => {
5157
- if (reset) reset();
5158
- if (resetStoppedScope) resetStoppedScope.reset();
5159
- };
5350
+ return stoppedScope;
5160
5351
  };
5161
5352
  const cleanup = () => {
5162
5353
  setCurrentInstance(null, void 0);
5163
5354
  if (inSSRSetup) setInSSRSetupState(false);
5164
5355
  };
5165
5356
  if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
5166
- const reset = restore();
5357
+ const stoppedScope = restore();
5167
5358
  Promise.resolve().then(() => Promise.resolve().then(() => {
5168
- if (reset) reset();
5359
+ if (stoppedScope) stoppedScope.reset();
5169
5360
  cleanup();
5170
5361
  }));
5171
5362
  throw e;
5172
5363
  });
5173
5364
  return [awaitable, () => {
5174
- const reset = restore();
5365
+ const stoppedScope = restore();
5175
5366
  Promise.resolve().then(() => {
5176
- if (reset) reset();
5367
+ if (stoppedScope) stoppedScope.reset();
5177
5368
  cleanup();
5178
5369
  });
5179
5370
  }];
@@ -5236,11 +5427,12 @@ function applyOptions(instance) {
5236
5427
  const opt = computedOptions[key];
5237
5428
  const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
5238
5429
  if (get === NOOP) warn$1(`Computed property "${key}" has no getter.`);
5430
+ const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
5431
+ warn$1(`Write operation failed: computed property "${key}" is readonly.`);
5432
+ };
5239
5433
  const c = computed({
5240
5434
  get,
5241
- set: !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
5242
- warn$1(`Write operation failed: computed property "${key}" is readonly.`);
5243
- }
5435
+ set
5244
5436
  });
5245
5437
  Object.defineProperty(ctx, key, {
5246
5438
  enumerable: true,
@@ -5296,9 +5488,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP)
5296
5488
  for (const key in injectOptions) {
5297
5489
  const opt = injectOptions[key];
5298
5490
  let injected;
5299
- if (isObject(opt)) if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
5300
- else injected = inject(opt.from || key);
5301
- else injected = inject(opt);
5491
+ if (isObject(opt)) {
5492
+ if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
5493
+ else injected = inject(opt.from || key);
5494
+ } else injected = inject(opt);
5302
5495
  if (/* @__PURE__ */ isRef(injected)) Object.defineProperty(ctx, key, {
5303
5496
  enumerable: true,
5304
5497
  configurable: true,
@@ -5319,13 +5512,14 @@ function createWatcher(raw, ctx, publicThis, key) {
5319
5512
  if (isFunction(handler)) watch(getter, handler);
5320
5513
  else warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
5321
5514
  } else if (isFunction(raw)) watch(getter, raw.bind(publicThis));
5322
- else if (isObject(raw)) if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
5323
- else {
5324
- const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
5325
- if (isFunction(handler)) watch(getter, handler, raw);
5326
- else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
5327
- }
5328
- else warn$1(`Invalid watch option: "${key}"`, raw);
5515
+ else if (isObject(raw)) {
5516
+ if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
5517
+ else {
5518
+ const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
5519
+ if (isFunction(handler)) watch(getter, handler, raw);
5520
+ else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
5521
+ }
5522
+ } else warn$1(`Invalid watch option: "${key}"`, raw);
5329
5523
  }
5330
5524
  /**
5331
5525
  * Resolve merged options and cache it on the component.
@@ -5411,7 +5605,7 @@ function mergeObjectOptions(to, from) {
5411
5605
  }
5412
5606
  function mergeEmitsOrPropsOptions(to, from) {
5413
5607
  if (to) {
5414
- if (isArray(to) && isArray(from)) return [...new Set([...to, ...from])];
5608
+ if (isArray(to) && isArray(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
5415
5609
  return extend(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
5416
5610
  } else return from;
5417
5611
  }
@@ -5530,8 +5724,10 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
5530
5724
  } else warn$1(`Cannot unmount an app that is not mounted.`);
5531
5725
  },
5532
5726
  provide(key, value) {
5533
- if (key in context.provides) if (hasOwn(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
5534
- else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
5727
+ if (key in context.provides) {
5728
+ if (hasOwn(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
5729
+ else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
5730
+ }
5535
5731
  context.provides[key] = value;
5536
5732
  return app;
5537
5733
  },
@@ -5570,13 +5766,17 @@ function useModel(props, name, options = EMPTY_OBJ) {
5570
5766
  const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
5571
5767
  const res = customRef((track, trigger) => {
5572
5768
  let localValue;
5769
+ let prevPropValue = EMPTY_OBJ;
5573
5770
  let prevSetValue = EMPTY_OBJ;
5574
5771
  let prevEmittedValue;
5575
5772
  watchSyncEffect(() => {
5576
5773
  const propValue = props[camelizedName];
5577
- if (hasChanged(localValue, propValue)) {
5578
- localValue = propValue;
5579
- trigger();
5774
+ if (hasChanged(prevPropValue, propValue)) {
5775
+ prevPropValue = propValue;
5776
+ if (hasChanged(localValue, propValue)) {
5777
+ localValue = propValue;
5778
+ trigger();
5779
+ }
5580
5780
  }
5581
5781
  });
5582
5782
  return {
@@ -5638,12 +5838,14 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
5638
5838
  if (instance.isUnmounted) return;
5639
5839
  {
5640
5840
  const { emitsOptions, propsOptions } = instance;
5641
- if (emitsOptions) if (!(event in emitsOptions) && true) {
5642
- if (!propsOptions || !propsOptions[0] || !(toHandlerKey(camelize(event)) in propsOptions[0])) warn$1(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`);
5643
- } else {
5644
- const validator = emitsOptions[event];
5645
- if (isFunction(validator)) {
5646
- if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
5841
+ if (emitsOptions) {
5842
+ if (!(event in emitsOptions) && true) {
5843
+ if (!propsOptions || !propsOptions[0] || !(toHandlerKey(camelize(event)) in propsOptions[0])) warn$1(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`);
5844
+ } else {
5845
+ const validator = emitsOptions[event];
5846
+ if (isFunction(validator)) {
5847
+ if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
5848
+ }
5647
5849
  }
5648
5850
  }
5649
5851
  }
@@ -5652,7 +5854,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
5652
5854
  const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
5653
5855
  if (modifiers) {
5654
5856
  if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
5655
- if (modifiers.number) args = rawArgs.map(looseToNumber);
5857
+ if (modifiers.number) args = args.map(looseToNumber);
5656
5858
  }
5657
5859
  devtoolsComponentEmit(instance, event, args);
5658
5860
  {
@@ -5779,8 +5981,9 @@ function renderComponentRoot(instance) {
5779
5981
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
5780
5982
  }
5781
5983
  if (vnode.transition) {
5782
- if (!isElementRoot(root)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
5783
- setTransitionHooks(root, vnode.transition);
5984
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
5985
+ if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
5986
+ setTransitionHooks(child, vnode.transition);
5784
5987
  }
5785
5988
  if (setRoot) setRoot(root);
5786
5989
  else result = root;
@@ -5831,18 +6034,21 @@ function filterSingleRoot(children, recurse = true) {
5831
6034
  for (let i = 0; i < children.length; i++) {
5832
6035
  const child = children[i];
5833
6036
  if (isVNode(child)) {
5834
- if (child.type !== Comment || child.children === "v-if") if (singleRoot) return;
5835
- else {
5836
- singleRoot = child;
5837
- if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
6037
+ if (child.type !== Comment || child.children === "v-if") {
6038
+ if (singleRoot) return;
6039
+ else {
6040
+ singleRoot = child;
6041
+ if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
6042
+ }
5838
6043
  }
5839
6044
  } else return;
5840
6045
  }
5841
6046
  return singleRoot;
5842
6047
  }
6048
+ const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
5843
6049
  const getFunctionalFallthrough = (attrs) => {
5844
6050
  let res;
5845
- for (const key in attrs) if (key === "class" || key === "style" || isOn(key)) (res || (res = {}))[key] = attrs[key];
6051
+ for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
5846
6052
  return res;
5847
6053
  };
5848
6054
  const filterModelListeners = (attrs, props) => {
@@ -5954,16 +6160,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
5954
6160
  let key = propsToUpdate[i];
5955
6161
  if (isEmitListener(instance.emitsOptions, key)) continue;
5956
6162
  const value = rawProps[key];
5957
- if (options) if (hasOwn(attrs, key)) {
5958
- if (value !== attrs[key]) {
5959
- attrs[key] = value;
5960
- hasAttrsChanged = true;
6163
+ if (options) {
6164
+ if (hasOwn(attrs, key)) {
6165
+ if (value !== attrs[key]) {
6166
+ attrs[key] = value;
6167
+ hasAttrsChanged = true;
6168
+ }
6169
+ } else {
6170
+ const camelizedKey = camelize(key);
6171
+ props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
5961
6172
  }
5962
- } else {
5963
- const camelizedKey = camelize(key);
5964
- props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
5965
- }
5966
- else if (value !== attrs[key]) {
6173
+ } else if (value !== attrs[key]) {
5967
6174
  attrs[key] = value;
5968
6175
  hasAttrsChanged = true;
5969
6176
  }
@@ -5972,9 +6179,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
5972
6179
  } else {
5973
6180
  if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
5974
6181
  let kebabKey;
5975
- for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) if (options) {
5976
- if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
5977
- } else delete props[key];
6182
+ for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
6183
+ if (options) {
6184
+ if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
6185
+ } else delete props[key];
6186
+ }
5978
6187
  if (attrs !== rawCurrentProps) {
5979
6188
  for (const key in attrs) if (!rawProps || !hasOwn(rawProps, key) && true) {
5980
6189
  delete attrs[key];
@@ -5993,9 +6202,10 @@ function setFullProps(instance, rawProps, props, attrs) {
5993
6202
  if (isReservedProp(key)) continue;
5994
6203
  const value = rawProps[key];
5995
6204
  let camelKey;
5996
- if (options && hasOwn(options, camelKey = camelize(key))) if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
5997
- else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
5998
- else if (!isEmitListener(instance.emitsOptions, key)) {
6205
+ if (options && hasOwn(options, camelKey = camelize(key))) {
6206
+ if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
6207
+ else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
6208
+ } else if (!isEmitListener(instance.emitsOptions, key)) {
5999
6209
  if (!(key in attrs) || value !== attrs[key]) {
6000
6210
  attrs[key] = value;
6001
6211
  hasAttrsChanged = true;
@@ -6042,7 +6252,7 @@ function baseResolveDefault(factory, instance, key) {
6042
6252
  const prev = setCurrentInstance(instance);
6043
6253
  const props = /* @__PURE__ */ toRaw(instance.props);
6044
6254
  value = factory.call(null, props);
6045
- setCurrentInstance(...prev);
6255
+ restoreCurrentInstance(prev);
6046
6256
  return value;
6047
6257
  }
6048
6258
  const mixinPropsCache = /* @__PURE__ */ new WeakMap();
@@ -6158,7 +6368,7 @@ function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
6158
6368
  }
6159
6369
  if (validator && !validator(value, /* @__PURE__ */ shallowReadonly(resolvedProps))) warn$1("Invalid prop: custom validator check failed for prop \"" + key + "\".");
6160
6370
  }
6161
- const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
6371
+ const isSimpleType = /*@__PURE__*/ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
6162
6372
  /**
6163
6373
  * dev only
6164
6374
  */
@@ -6271,12 +6481,13 @@ const updateSlots = (instance, children, optimized) => {
6271
6481
  let deletionComparisonTarget = EMPTY_OBJ;
6272
6482
  if (vnode.shapeFlag & 32) {
6273
6483
  const type = children._;
6274
- if (type) if (isHmrUpdating) {
6275
- assignSlots(slots, children, optimized);
6276
- trigger(instance, "set", "$slots");
6277
- } else if (optimized && type === 1) needDeletionCheck = false;
6278
- else assignSlots(slots, children, optimized);
6279
- else {
6484
+ if (type) {
6485
+ if (isHmrUpdating) {
6486
+ assignSlots(slots, children, optimized);
6487
+ trigger(instance, "set", "$slots");
6488
+ } else if (optimized && type === 1) needDeletionCheck = false;
6489
+ else assignSlots(slots, children, optimized);
6490
+ } else {
6280
6491
  needDeletionCheck = !children.$stable;
6281
6492
  normalizeObjectSlots(children, slots, instance);
6282
6493
  }
@@ -6294,7 +6505,7 @@ const updateSlots = (instance, children, optimized) => {
6294
6505
  let supported;
6295
6506
  let perf;
6296
6507
  let cachedNow$1 = 0;
6297
- const p$1 = /* @__PURE__ */ Promise.resolve();
6508
+ const p$1 = /*@__PURE__*/ Promise.resolve();
6298
6509
  const getNow$1 = () => cachedNow$1 || (p$1.then(() => cachedNow$1 = 0), cachedNow$1 = isSupported() ? perf.now() : Date.now());
6299
6510
  /**
6300
6511
  * @internal
@@ -6375,6 +6586,10 @@ function baseCreateRenderer(options, createHydrationFns) {
6375
6586
  optimized = false;
6376
6587
  n2.dynamicChildren = null;
6377
6588
  }
6589
+ if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
6590
+ if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
6591
+ n2.dynamicChildren.hasOnce = true;
6592
+ }
6378
6593
  const { type, ref, shapeFlag } = n2;
6379
6594
  switch (type) {
6380
6595
  case Text:
@@ -6391,7 +6606,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6391
6606
  processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6392
6607
  break;
6393
6608
  case VaporSlot:
6394
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
6609
+ getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
6395
6610
  break;
6396
6611
  default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6397
6612
  else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
@@ -6510,7 +6725,10 @@ function baseCreateRenderer(options, createHydrationFns) {
6510
6725
  for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
6511
6726
  };
6512
6727
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
6513
- for (let i = start; i < children.length; i++) patch(null, children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]), container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6728
+ for (let i = start; i < children.length; i++) {
6729
+ const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
6730
+ patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6731
+ }
6514
6732
  };
6515
6733
  const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6516
6734
  const el = n2.el = n1.el;
@@ -6522,6 +6740,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6522
6740
  let vnodeHook;
6523
6741
  parentComponent && toggleRecurse(parentComponent, false);
6524
6742
  if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
6743
+ if (n2.ibu) n2.ibu();
6525
6744
  if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
6526
6745
  parentComponent && toggleRecurse(parentComponent, true);
6527
6746
  if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
@@ -6555,8 +6774,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6555
6774
  if (n1.children !== n2.children) hostSetElementText(el, n2.children);
6556
6775
  }
6557
6776
  } else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
6558
- if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
6777
+ if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
6559
6778
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
6779
+ n2.iu && n2.iu();
6560
6780
  dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
6561
6781
  }, void 0, parentSuspense);
6562
6782
  };
@@ -6564,7 +6784,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6564
6784
  for (let i = 0; i < newChildren.length; i++) {
6565
6785
  const oldVNode = oldChildren[i];
6566
6786
  const newVNode = newChildren[i];
6567
- patch(oldVNode, newVNode, oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
6787
+ const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
6788
+ patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
6568
6789
  }
6569
6790
  };
6570
6791
  const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
@@ -6602,41 +6823,15 @@ function baseCreateRenderer(options, createHydrationFns) {
6602
6823
  };
6603
6824
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6604
6825
  n2.slotScopeIds = slotScopeIds;
6605
- if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
6606
- else {
6607
- const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
6608
- getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
6609
- if (n2.dirs) {
6610
- invokeDirectiveHook(n2, null, parentComponent, "created");
6611
- invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
6612
- }
6613
- }, () => {
6614
- if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
6615
- });
6616
- if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
6617
- const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
6618
- if (vnodeMountedHook) {
6619
- const scopedVNode = n2;
6620
- queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
6621
- }
6622
- }
6623
- else {
6624
- const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
6625
- getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
6626
- if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
6627
- }, () => {
6628
- const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
6629
- if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
6630
- });
6631
- const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
6632
- if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
6633
- n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
6634
- vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
6635
- }, void 0, parentSuspense);
6636
- }
6637
- else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
6638
- else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
6639
- else updateComponent(n1, n2, optimized);
6826
+ if (n2.type.__vapor) {
6827
+ if (n1 == null) {
6828
+ if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
6829
+ else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
6830
+ } else getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized));
6831
+ } else if (n1 == null) {
6832
+ if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
6833
+ else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
6834
+ } else updateComponent(n1, n2, optimized);
6640
6835
  };
6641
6836
  const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
6642
6837
  const instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense);
@@ -6677,16 +6872,18 @@ function baseCreateRenderer(options, createHydrationFns) {
6677
6872
  };
6678
6873
  const updateComponent = (n1, n2, optimized) => {
6679
6874
  const instance = n2.component = n1.component;
6680
- if (shouldUpdateComponent(n1, n2, optimized)) if (instance.asyncDep && !instance.asyncResolved) {
6681
- pushWarningContext(n2);
6682
- updateComponentPreRender(instance, n2, optimized);
6683
- popWarningContext();
6684
- return;
6875
+ if (shouldUpdateComponent(n1, n2, optimized)) {
6876
+ if (instance.asyncDep && !instance.asyncResolved) {
6877
+ pushWarningContext(n2);
6878
+ n2.el = n1.el;
6879
+ updateComponentPreRender(instance, n2, optimized);
6880
+ popWarningContext();
6881
+ return;
6882
+ } else {
6883
+ instance.next = n2;
6884
+ instance.effect.run();
6885
+ }
6685
6886
  } else {
6686
- instance.next = n2;
6687
- instance.effect.run();
6688
- }
6689
- else {
6690
6887
  n2.el = n1.el;
6691
6888
  instance.vnode = n2;
6692
6889
  }
@@ -6784,6 +6981,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6784
6981
  } else next = vnode;
6785
6982
  if (bu) invokeArrayFns(bu);
6786
6983
  if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
6984
+ if (next.ibu) next.ibu();
6787
6985
  toggleRecurse(instance, true);
6788
6986
  startMeasure(instance, `render`);
6789
6987
  const nextTree = renderComponentRoot(instance);
@@ -6796,7 +6994,10 @@ function baseCreateRenderer(options, createHydrationFns) {
6796
6994
  next.el = nextTree.el;
6797
6995
  if (originNext === null) updateHOCHostEl(instance, nextTree.el);
6798
6996
  if (u) queuePostRenderEffect(u, void 0, parentSuspense);
6799
- if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), void 0, parentSuspense);
6997
+ if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
6998
+ vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
6999
+ next.iu && next.iu();
7000
+ }, void 0, parentSuspense);
6800
7001
  devtoolsComponentUpdated(instance);
6801
7002
  popWarningContext();
6802
7003
  }
@@ -6836,9 +7037,10 @@ function baseCreateRenderer(options, createHydrationFns) {
6836
7037
  if (shapeFlag & 8) {
6837
7038
  if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
6838
7039
  if (c2 !== c1) hostSetElementText(container, c2);
6839
- } else if (prevShapeFlag & 16) if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6840
- else unmountChildren(c1, parentComponent, parentSuspense, true);
6841
- else {
7040
+ } else if (prevShapeFlag & 16) {
7041
+ if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
7042
+ else unmountChildren(c1, parentComponent, parentSuspense, true);
7043
+ } else {
6842
7044
  if (prevShapeFlag & 8) hostSetElementText(container, "");
6843
7045
  if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6844
7046
  }
@@ -6937,15 +7139,17 @@ function baseCreateRenderer(options, createHydrationFns) {
6937
7139
  const anchorVNode = c2[nextIndex + 1];
6938
7140
  const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
6939
7141
  if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6940
- else if (moved) if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
6941
- else j--;
7142
+ else if (moved) {
7143
+ if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
7144
+ else j--;
7145
+ }
6942
7146
  }
6943
7147
  }
6944
7148
  };
6945
7149
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
6946
7150
  const { el, type, transition, children, shapeFlag } = vnode;
6947
7151
  if (isVaporComponent(type) || type === VaporSlot) {
6948
- getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
7152
+ getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
6949
7153
  return;
6950
7154
  }
6951
7155
  if (shapeFlag & 6) {
@@ -6970,54 +7174,37 @@ function baseCreateRenderer(options, createHydrationFns) {
6970
7174
  moveStaticNode(vnode, container, anchor);
6971
7175
  return;
6972
7176
  }
6973
- if (moveType !== 2 && shapeFlag & 1 && transition) if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
6974
- else {
6975
- const { leave, delayLeave, afterLeave } = transition;
6976
- const remove = () => {
7177
+ if (moveType !== 2 && shapeFlag & 1 && transition) {
7178
+ if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
7179
+ else performTransitionLeave(el, transition, () => {
6977
7180
  if (vnode.ctx.isUnmounted) hostRemove(el);
6978
7181
  else hostInsert(el, container, anchor);
6979
- };
6980
- const performLeave = () => {
6981
- const wasLeaving = el._isLeaving || !!el[leaveCbKey];
6982
- if (el._isLeaving) el[leaveCbKey](true);
6983
- if (transition.persisted && !wasLeaving) remove();
6984
- else leave(el, () => {
6985
- remove();
6986
- afterLeave && afterLeave();
6987
- });
6988
- };
6989
- if (delayLeave) delayLeave(el, remove, performLeave);
6990
- else performLeave();
6991
- }
6992
- else hostInsert(el, container, anchor);
7182
+ }, true, true);
7183
+ } else hostInsert(el, container, anchor);
6993
7184
  };
6994
7185
  const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
6995
7186
  const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
6996
- if (patchFlag === -2) optimized = false;
7187
+ if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
6997
7188
  if (ref != null) {
6998
7189
  const prevSub = setActiveSub();
6999
7190
  setRef(ref, null, parentSuspense, vnode, true);
7000
7191
  setActiveSub(prevSub);
7001
7192
  }
7002
- if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
7193
+ if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
7003
7194
  if (shapeFlag & 256) {
7004
- if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
7195
+ if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
7005
7196
  else parentComponent.ctx.deactivate(vnode);
7006
7197
  return;
7007
7198
  }
7199
+ if (shapeFlag & 6 && isVaporComponent(type)) {
7200
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
7201
+ return;
7202
+ }
7008
7203
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
7009
7204
  const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
7010
7205
  let vnodeHook;
7011
7206
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
7012
- if (shapeFlag & 6) if (isVaporComponent(type)) {
7013
- if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
7014
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
7015
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
7016
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
7017
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7018
- }, void 0, parentSuspense);
7019
- return;
7020
- } else unmountComponent(vnode.component, parentSuspense, doRemove);
7207
+ if (shapeFlag & 6) unmountComponent(vnode.component, parentSuspense, doRemove);
7021
7208
  else {
7022
7209
  if (shapeFlag & 128) {
7023
7210
  vnode.suspense.unmount(parentSuspense, doRemove);
@@ -7028,7 +7215,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7028
7215
  else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
7029
7216
  else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
7030
7217
  if (type === VaporSlot) {
7031
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
7218
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
7032
7219
  return;
7033
7220
  }
7034
7221
  if (doRemove) remove(vnode);
@@ -7052,6 +7239,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7052
7239
  }
7053
7240
  if (type === Static) {
7054
7241
  removeStaticNode(vnode);
7242
+ if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
7055
7243
  return;
7056
7244
  }
7057
7245
  if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
@@ -7076,7 +7264,10 @@ function baseCreateRenderer(options, createHydrationFns) {
7076
7264
  if (effect) {
7077
7265
  effect.stop();
7078
7266
  unmount(subTree, instance, parentSuspense, doRemove);
7079
- } else if (doRemove && subTree && instance.vnode.el) remove(subTree);
7267
+ } else if (instance.vnode.el && subTree) {
7268
+ subTree.transition = instance.vnode.transition;
7269
+ unmount(subTree, instance, parentSuspense, doRemove);
7270
+ }
7080
7271
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
7081
7272
  queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
7082
7273
  devtoolsComponentRemoved(instance);
@@ -7150,12 +7341,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
7150
7341
  return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
7151
7342
  }
7152
7343
  function toggleRecurse({ effect, job, vapor }, allowed) {
7153
- if (!vapor) if (allowed) {
7154
- effect.flags |= 128;
7155
- job.flags |= 2;
7156
- } else {
7157
- effect.flags &= -129;
7158
- job.flags &= -3;
7344
+ if (!vapor) {
7345
+ if (allowed) {
7346
+ effect.flags |= 128;
7347
+ job.flags |= 2;
7348
+ } else {
7349
+ effect.flags &= -129;
7350
+ job.flags &= -3;
7351
+ }
7159
7352
  }
7160
7353
  }
7161
7354
  function needTransition(parentSuspense, transition) {
@@ -7195,8 +7388,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
7195
7388
  }
7196
7389
  function locateNonHydratedAsyncRoot(instance) {
7197
7390
  const subComponent = instance.subTree && instance.subTree.component;
7198
- if (subComponent) if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
7199
- else return locateNonHydratedAsyncRoot(subComponent);
7391
+ if (subComponent) {
7392
+ if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
7393
+ else return locateNonHydratedAsyncRoot(subComponent);
7394
+ }
7200
7395
  }
7201
7396
  function invalidateMount(hooks) {
7202
7397
  if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
@@ -7215,13 +7410,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
7215
7410
  function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
7216
7411
  const performRemove = () => {
7217
7412
  remove();
7218
- if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
7413
+ if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
7219
7414
  };
7220
7415
  if (force || isElement && transition && !transition.persisted) {
7221
7416
  const { leave, delayLeave } = transition;
7222
7417
  const performLeave = () => {
7418
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
7223
7419
  if (el._isLeaving && force) el[leaveCbKey](true);
7224
- leave(el, performRemove);
7420
+ if (force && transition.persisted && !wasLeaving) remove();
7421
+ else leave(el, performRemove);
7225
7422
  };
7226
7423
  if (delayLeave) delayLeave(el, performRemove, performLeave);
7227
7424
  else performLeave();
@@ -7240,7 +7437,7 @@ function isVaporComponent(type) {
7240
7437
  /**
7241
7438
  * shared between vdom and vapor
7242
7439
  */
7243
- function getInheritedScopeIds(vnode, parentComponent) {
7440
+ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
7244
7441
  const inheritedScopeIds = [];
7245
7442
  let currentParent = parentComponent;
7246
7443
  let currentVNode = vnode;
@@ -7256,6 +7453,8 @@ function getInheritedScopeIds(vnode, parentComponent) {
7256
7453
  currentParent = currentParent.parent;
7257
7454
  } else break;
7258
7455
  }
7456
+ const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
7457
+ if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
7259
7458
  return inheritedScopeIds;
7260
7459
  }
7261
7460
  function resolveAsyncComponentPlaceholder(anchorVnode) {
@@ -7274,7 +7473,7 @@ const Suspense = {
7274
7473
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
7275
7474
  if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
7276
7475
  else {
7277
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
7476
+ if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
7278
7477
  n2.suspense = n1.suspense;
7279
7478
  n2.suspense.vnode = n2;
7280
7479
  n2.el = n1.el;
@@ -7312,10 +7511,12 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7312
7511
  if (pendingBranch) {
7313
7512
  suspense.pendingBranch = newBranch;
7314
7513
  if (isSameVNodeType(pendingBranch, newBranch)) {
7315
- patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
7514
+ suspense.deps++;
7515
+ patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
7516
+ suspense.deps--;
7316
7517
  if (suspense.deps <= 0) suspense.resolve();
7317
7518
  else if (isInFallback) {
7318
- if (!isHydrating) {
7519
+ if (!isHydrating && !suspense.isFallbackMountPending) {
7319
7520
  patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
7320
7521
  setActiveBranch(suspense, newFallback);
7321
7522
  }
@@ -7327,12 +7528,16 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7327
7528
  suspense.activeBranch = pendingBranch;
7328
7529
  } else unmount(pendingBranch, parentComponent, suspense);
7329
7530
  suspense.deps = 0;
7531
+ for (let i = 0; i < suspense.effects.length; i++) {
7532
+ const effect = suspense.effects[i];
7533
+ if (effect.flags & 8) queuePostFlushCb(effect);
7534
+ }
7330
7535
  suspense.effects.length = 0;
7331
7536
  suspense.hiddenContainer = createElement("div");
7332
7537
  if (isInFallback) {
7333
7538
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
7334
7539
  if (suspense.deps <= 0) suspense.resolve();
7335
- else {
7540
+ else if (!suspense.isFallbackMountPending) {
7336
7541
  patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
7337
7542
  setActiveBranch(suspense, newFallback);
7338
7543
  }
@@ -7434,7 +7639,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7434
7639
  let hasUnresolvedAncestor = false;
7435
7640
  while (parent) {
7436
7641
  if (parent.pendingBranch) {
7437
- parent.effects.push(...effects);
7642
+ for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
7438
7643
  hasUnresolvedAncestor = true;
7439
7644
  break;
7440
7645
  }
@@ -7444,6 +7649,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7444
7649
  suspense.effects = [];
7445
7650
  if (isSuspensible) {
7446
7651
  if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
7652
+ parentSuspenseId = void 0;
7447
7653
  parentSuspense.deps--;
7448
7654
  if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
7449
7655
  }
@@ -7458,8 +7664,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7458
7664
  const mountFallback = () => {
7459
7665
  suspense.isFallbackMountPending = false;
7460
7666
  if (!suspense.isInFallback) return;
7461
- patch(null, fallbackVNode, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
7462
- setActiveBranch(suspense, fallbackVNode);
7667
+ const latestFallback = suspense.vnode.ssFallback;
7668
+ patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
7669
+ setActiveBranch(suspense, latestFallback);
7463
7670
  };
7464
7671
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
7465
7672
  if (delayEnter) {
@@ -7480,11 +7687,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7480
7687
  registerDep(instance, onResolve) {
7481
7688
  const isInPendingSuspense = !!suspense.pendingBranch;
7482
7689
  if (isInPendingSuspense) suspense.deps++;
7690
+ const hydratedEl = instance.vnode && instance.vnode.el;
7483
7691
  instance.asyncDep.catch((err) => {
7484
7692
  handleError(err, instance, 0);
7485
7693
  }).then((asyncSetupResult) => {
7486
7694
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
7487
7695
  setCurrentInstance(null, void 0);
7696
+ if (hydratedEl && !instance.scope.active) {
7697
+ if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
7698
+ return;
7699
+ }
7488
7700
  instance.asyncResolved = true;
7489
7701
  onResolve(asyncSetupResult);
7490
7702
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
@@ -7535,9 +7747,10 @@ function normalizeSuspenseSlot(s) {
7535
7747
  return s;
7536
7748
  }
7537
7749
  function queueEffectWithSuspense(fn, id, suspense) {
7538
- if (suspense && suspense.pendingBranch) if (isArray(fn)) suspense.effects.push(...fn);
7539
- else suspense.effects.push(fn);
7540
- else queuePostFlushCb(fn, id);
7750
+ if (suspense && suspense.pendingBranch) {
7751
+ if (isArray(fn)) suspense.effects.push(...fn);
7752
+ else suspense.effects.push(fn);
7753
+ } else queuePostFlushCb(fn, id);
7541
7754
  }
7542
7755
  function setActiveBranch(suspense, branch) {
7543
7756
  suspense.activeBranch = branch;
@@ -7704,9 +7917,24 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
7704
7917
  if (shapeFlag & 128) type.normalize(vnode);
7705
7918
  } else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
7706
7919
  if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
7920
+ if (props && vnode.shapeFlag & 1) {
7921
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
7922
+ if (overwritingProp && hasContentChildren(vnode.children)) warn$1(`The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`);
7923
+ }
7707
7924
  if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
7708
7925
  return vnode;
7709
7926
  }
7927
+ /**
7928
+ * dev only
7929
+ * Whether children would actually render something. Empty text and empty
7930
+ * arrays are ignored, mirroring the compiler's `node.children.length` check
7931
+ * for `v-html` / `v-text`.
7932
+ */
7933
+ function hasContentChildren(children) {
7934
+ if (isString(children)) return children !== "";
7935
+ if (isArray(children)) return children.length > 0;
7936
+ return false;
7937
+ }
7710
7938
  const createVNode = createVNodeWithArgsTransform;
7711
7939
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
7712
7940
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -7716,8 +7944,10 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
7716
7944
  if (isVNode(type)) {
7717
7945
  const cloned = cloneVNode(type, props, true);
7718
7946
  if (children) normalizeChildren(cloned, children);
7719
- if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
7720
- else currentBlock.push(cloned);
7947
+ if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
7948
+ if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
7949
+ else currentBlock.push(cloned);
7950
+ }
7721
7951
  cloned.patchFlag = -2;
7722
7952
  return cloned;
7723
7953
  }
@@ -7777,7 +8007,10 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
7777
8007
  ce: vnode.ce,
7778
8008
  vi: vnode.vi,
7779
8009
  vs: cloneVaporSlotMeta(vnode),
7780
- vb: vnode.vb
8010
+ vb: vnode.vb,
8011
+ ibu: vnode.ibu,
8012
+ iu: vnode.iu,
8013
+ cacheIndex: vnode.cacheIndex
7781
8014
  };
7782
8015
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
7783
8016
  return cloned;
@@ -7787,8 +8020,7 @@ function cloneVaporSlotMeta(vnode) {
7787
8020
  if (!vaporSlot) return vaporSlot;
7788
8021
  const cloned = {
7789
8022
  slot: vaporSlot.slot,
7790
- fallback: vaporSlot.fallback,
7791
- outletFallback: vaporSlot.outletFallback
8023
+ outlets: vaporSlot.outlets
7792
8024
  };
7793
8025
  if (vnode.el) {
7794
8026
  cloned.state = vaporSlot.state;
@@ -7840,25 +8072,28 @@ function normalizeChildren(vnode, children) {
7840
8072
  const { shapeFlag } = vnode;
7841
8073
  if (children == null) children = null;
7842
8074
  else if (isArray(children)) type = 16;
7843
- else if (typeof children === "object") if (shapeFlag & 65) {
7844
- const slot = children.default;
7845
- if (slot) {
7846
- slot._c && (slot._d = false);
7847
- normalizeChildren(vnode, slot());
7848
- slot._c && (slot._d = true);
7849
- }
7850
- return;
7851
- } else {
7852
- type = 32;
7853
- const slotFlag = children._;
7854
- if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
7855
- else if (slotFlag === 3 && currentRenderingInstance) if (currentRenderingInstance.slots._ === 1) children._ = 1;
7856
- else {
7857
- children._ = 2;
7858
- vnode.patchFlag |= 1024;
8075
+ else if (typeof children === "object") {
8076
+ if (shapeFlag & 65) {
8077
+ const slot = children.default;
8078
+ if (slot) {
8079
+ slot._c && (slot._d = false);
8080
+ normalizeChildren(vnode, slot());
8081
+ slot._c && (slot._d = true);
8082
+ }
8083
+ return;
8084
+ } else {
8085
+ type = 32;
8086
+ const slotFlag = children._;
8087
+ if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
8088
+ else if (slotFlag === 3 && currentRenderingInstance) {
8089
+ if (currentRenderingInstance.slots._ === 1) children._ = 1;
8090
+ else {
8091
+ children._ = 2;
8092
+ vnode.patchFlag |= 1024;
8093
+ }
8094
+ }
7859
8095
  }
7860
- }
7861
- else if (isFunction(children)) {
8096
+ } else if (isFunction(children)) {
7862
8097
  if (shapeFlag & 65) {
7863
8098
  normalizeChildren(vnode, { default: children });
7864
8099
  return;
@@ -7926,6 +8161,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
7926
8161
  simpleSetCurrentInstance(instance);
7927
8162
  }
7928
8163
  };
8164
+ /**
8165
+ * Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
8166
+ * `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
8167
+ * verbatim instead of re-triggering the `instance.scope` default.
8168
+ * @internal
8169
+ */
8170
+ const restoreCurrentInstance = (prev) => {
8171
+ setCurrentScope(prev[1]);
8172
+ simpleSetCurrentInstance(prev[0]);
8173
+ };
7929
8174
  const internalOptions = [
7930
8175
  "ce",
7931
8176
  "type",
@@ -7957,7 +8202,7 @@ const useInstanceOption = (key, silent = false) => {
7957
8202
  };
7958
8203
  //#endregion
7959
8204
  //#region packages/runtime-core/src/component.ts
7960
- const emptyAppContext = /* @__PURE__ */ createAppContext();
8205
+ const emptyAppContext = /*@__PURE__*/ createAppContext();
7961
8206
  let uid = 0;
7962
8207
  function createComponentInstance(vnode, parent, suspense) {
7963
8208
  const type = vnode.type;
@@ -8077,7 +8322,7 @@ function setupStatefulComponent(instance, isSSR) {
8077
8322
  const setupResult = callWithErrorHandling(setup, instance, 0, [/* @__PURE__ */ shallowReadonly(instance.props), setupContext]);
8078
8323
  const isAsyncSetup = isPromise(setupResult);
8079
8324
  setActiveSub(prevSub);
8080
- setCurrentInstance(...prev);
8325
+ restoreCurrentInstance(prev);
8081
8326
  if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
8082
8327
  if (isAsyncSetup) {
8083
8328
  const unsetCurrentInstance = () => {
@@ -8085,7 +8330,12 @@ function setupStatefulComponent(instance, isSSR) {
8085
8330
  };
8086
8331
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
8087
8332
  if (isSSR) return setupResult.then((resolvedResult) => {
8088
- handleSetupResult(instance, resolvedResult, isSSR);
8333
+ setInSSRSetupState(true);
8334
+ try {
8335
+ handleSetupResult(instance, resolvedResult, isSSR);
8336
+ } finally {
8337
+ setInSSRSetupState(false);
8338
+ }
8089
8339
  }).catch((e) => {
8090
8340
  handleError(e, instance, 0);
8091
8341
  });
@@ -8146,13 +8396,15 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
8146
8396
  applyOptions(instance);
8147
8397
  } finally {
8148
8398
  setActiveSub(prevSub);
8149
- setCurrentInstance(...prevInstance);
8399
+ restoreCurrentInstance(prevInstance);
8150
8400
  }
8151
8401
  }
8152
- if (!Component.render && instance.render === NOOP && !isSSR) if (!compile && Component.template)
8402
+ if (!Component.render && instance.render === NOOP && !isSSR) {
8403
+ if (!compile && Component.template)
8153
8404
  /* v8 ignore start */
8154
- warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Use \"vue.esm-browser.js\" instead.");
8155
- else warn$1(`Component is missing template or render function: `, Component);
8405
+ warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Use \"vue.esm-browser.js\" instead.");
8406
+ else warn$1(`Component is missing template or render function: `, Component);
8407
+ }
8156
8408
  }
8157
8409
  const attrsProxyHandlers = {
8158
8410
  get(target, key) {
@@ -8215,14 +8467,13 @@ function getComponentPublicInstance(instance) {
8215
8467
  if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
8216
8468
  get(target, key) {
8217
8469
  if (key in target) return target[key];
8218
- else {
8470
+ else if (!instance.vapor) {
8219
8471
  const publicPropertiesMap = getPublicPropertiesMap();
8220
8472
  if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
8221
8473
  }
8222
8474
  },
8223
8475
  has(target, key) {
8224
- const publicPropertiesMap = getPublicPropertiesMap();
8225
- return key in target || key in publicPropertiesMap;
8476
+ return key in target || !instance.vapor && key in getPublicPropertiesMap();
8226
8477
  }
8227
8478
  }));
8228
8479
  else return instance.proxy;
@@ -8260,11 +8511,12 @@ function h(type, propsOrChildren, children) {
8260
8511
  try {
8261
8512
  setBlockTracking(-1);
8262
8513
  const l = arguments.length;
8263
- if (l === 2) if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
8264
- if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
8265
- return createVNode(type, propsOrChildren);
8266
- } else return createVNode(type, null, propsOrChildren);
8267
- else {
8514
+ if (l === 2) {
8515
+ if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
8516
+ if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
8517
+ return createVNode(type, propsOrChildren);
8518
+ } else return createVNode(type, null, propsOrChildren);
8519
+ } else {
8268
8520
  if (l > 3) children = Array.prototype.slice.call(arguments, 2);
8269
8521
  else if (l === 3 && isVNode(children)) children = [children];
8270
8522
  return createVNode(type, propsOrChildren, children);
@@ -8456,7 +8708,7 @@ function isMemoSame(cached, memo) {
8456
8708
  }
8457
8709
  //#endregion
8458
8710
  //#region packages/runtime-core/src/index.ts
8459
- const version = "3.6.0-rc.1";
8711
+ const version = "3.6.0-rc.10";
8460
8712
  const warn = warn$1;
8461
8713
  /**
8462
8714
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -8484,7 +8736,7 @@ const DeprecationTypes = null;
8484
8736
  let policy = void 0;
8485
8737
  const tt = typeof window !== "undefined" && window.trustedTypes;
8486
8738
  if (tt) try {
8487
- policy = /* @__PURE__ */ tt.createPolicy("vue", { createHTML: (val) => val });
8739
+ policy = /*@__PURE__*/ tt.createPolicy("vue", { createHTML: (val) => val });
8488
8740
  } catch (e) {
8489
8741
  warn(`Error creating trusted types policy: ${e}`);
8490
8742
  }
@@ -8492,7 +8744,7 @@ const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) =>
8492
8744
  const svgNS = "http://www.w3.org/2000/svg";
8493
8745
  const mathmlNS = "http://www.w3.org/1998/Math/MathML";
8494
8746
  const doc = typeof document !== "undefined" ? document : null;
8495
- const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
8747
+ const templateContainer = doc && /*@__PURE__*/ doc.createElement("template");
8496
8748
  const nodeOps = {
8497
8749
  insert: (child, parent, anchor) => {
8498
8750
  parent.insertBefore(child, anchor || null);
@@ -8566,7 +8818,7 @@ const DOMTransitionPropsValidators = {
8566
8818
  leaveActiveClass: String,
8567
8819
  leaveToClass: String
8568
8820
  };
8569
- const TransitionPropsValidators = /* @__PURE__ */ extend({}, BaseTransitionPropsValidators, DOMTransitionPropsValidators);
8821
+ const TransitionPropsValidators = /*@__PURE__*/ extend({}, BaseTransitionPropsValidators, DOMTransitionPropsValidators);
8570
8822
  /**
8571
8823
  * Wrap logic that attaches extra properties to Transition in a function
8572
8824
  * so that it can be annotated as pure
@@ -8580,7 +8832,7 @@ const decorate$1 = (t) => {
8580
8832
  * DOM Transition is a higher-order-component based on the platform-agnostic
8581
8833
  * base Transition component, with DOM-specific logic.
8582
8834
  */
8583
- const Transition = /* @__PURE__ */ decorate$1((props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots));
8835
+ const Transition = /*@__PURE__*/ decorate$1((props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots));
8584
8836
  /**
8585
8837
  * #3227 Incoming hooks may be merged into arrays when wrapping Transition
8586
8838
  * with custom HOCs.
@@ -8802,14 +9054,15 @@ const vShow = {
8802
9054
  },
8803
9055
  updated(el, { value, oldValue }, { transition }) {
8804
9056
  if (!value === !oldValue) return;
8805
- if (transition) if (value) {
8806
- transition.beforeEnter(el);
8807
- setDisplay(el, true);
8808
- transition.enter(el);
8809
- } else transition.leave(el, () => {
8810
- setDisplay(el, false);
8811
- });
8812
- else setDisplay(el, value);
9057
+ if (transition) {
9058
+ if (value) {
9059
+ transition.beforeEnter(el);
9060
+ setDisplay(el, true);
9061
+ transition.enter(el);
9062
+ } else transition.leave(el, () => {
9063
+ setDisplay(el, false);
9064
+ });
9065
+ } else setDisplay(el, value);
8813
9066
  },
8814
9067
  beforeUnmount(el, { value }) {
8815
9068
  setDisplay(el, value);
@@ -8828,49 +9081,20 @@ const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT");
8828
9081
  */
8829
9082
  function useCssVars(getter) {
8830
9083
  const instance = getCurrentInstance();
8831
- const getVars = () => getter(instance.proxy);
8832
- const setVars = (vars) => {
8833
- if (instance.ce) setVarsOnNode(instance.ce, vars);
8834
- else setVarsOnVNode(instance.subTree, vars);
8835
- };
8836
- baseUseCssVars(instance, () => instance.subTree.el.parentNode, getVars, setVars);
8837
- }
8838
- function setVarsOnVNode(vnode, vars) {
8839
- if (vnode.shapeFlag & 128) {
8840
- const suspense = vnode.suspense;
8841
- vnode = suspense.activeBranch;
8842
- if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
8843
- setVarsOnVNode(suspense.activeBranch, vars);
8844
- });
8845
- }
8846
- while (vnode.component) vnode = vnode.component.subTree;
8847
- if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
8848
- else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
8849
- else if (vnode.type === Static) {
8850
- let { el, anchor } = vnode;
8851
- while (el) {
8852
- setVarsOnNode(el, vars);
8853
- if (el === anchor) break;
8854
- el = el.nextSibling;
8855
- }
8856
- }
8857
- }
8858
- /**
8859
- * @internal
8860
- * shared between vdom and vapor
8861
- */
8862
- function baseUseCssVars(instance, getParentNode, getVars, setVars) {
8863
9084
  /* v8 ignore start */
8864
9085
  if (!instance) {
8865
9086
  warn(`useCssVars is called without current active component instance.`);
8866
9087
  return;
8867
9088
  }
9089
+ /* v8 ignore stop */
9090
+ const getVars = () => getter(instance.proxy);
8868
9091
  instance.getCssVars = getVars;
8869
9092
  const updateTeleports = instance.ut = (vars = getVars()) => {
8870
9093
  Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach((node) => setVarsOnNode(node, vars));
8871
9094
  };
8872
9095
  const applyCssVars = (vars = getVars()) => {
8873
- setVars(vars);
9096
+ if (instance.ce) setVarsOnNode(instance.ce, vars);
9097
+ else setVarsOnVNode(instance.subTree, vars);
8874
9098
  updateTeleports(vars);
8875
9099
  };
8876
9100
  onBeforeUpdate(() => {
@@ -8883,10 +9107,38 @@ function baseUseCssVars(instance, getParentNode, getVars, setVars) {
8883
9107
  applyCssVars(vars);
8884
9108
  }, NOOP, { flush: "post" });
8885
9109
  const ob = new MutationObserver(() => applyCssVars());
8886
- ob.observe(getParentNode(), { childList: true });
9110
+ ob.observe(instance.subTree.el.parentNode, { childList: true });
8887
9111
  onUnmounted(() => ob.disconnect());
8888
9112
  });
8889
9113
  }
9114
+ function setVarsOnVNode(vnode, vars) {
9115
+ if (vnode.shapeFlag & 128) {
9116
+ const suspense = vnode.suspense;
9117
+ vnode = suspense.activeBranch;
9118
+ if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
9119
+ setVarsOnVNode(suspense.activeBranch, vars);
9120
+ });
9121
+ }
9122
+ while (vnode.component) {
9123
+ const component = vnode.component;
9124
+ if (component.vapor) {
9125
+ component.appContext.vapor.applyCssVars(vnode, vars);
9126
+ return;
9127
+ }
9128
+ vnode = vnode.component.subTree;
9129
+ }
9130
+ if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
9131
+ else if (vnode.vb) vnode.ctx.appContext.vapor.applyCssVars(vnode, vars);
9132
+ else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
9133
+ else if (vnode.type === Static) {
9134
+ let { el, anchor } = vnode;
9135
+ while (el) {
9136
+ setVarsOnNode(el, vars);
9137
+ if (el === anchor) break;
9138
+ el = el.nextSibling;
9139
+ }
9140
+ }
9141
+ }
8890
9142
  /**
8891
9143
  * @internal
8892
9144
  * shared between vdom and vapor
@@ -8911,11 +9163,13 @@ function patchStyle(el, prev, next) {
8911
9163
  const isCssString = isString(next);
8912
9164
  let hasControlledDisplay = false;
8913
9165
  if (next && !isCssString) {
8914
- if (prev) if (!isString(prev)) {
8915
- for (const key in prev) if (next[key] == null) setStyle(style, key, "");
8916
- } else for (const prevStyle of prev.split(";")) {
8917
- const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
8918
- if (next[key] == null) setStyle(style, key, "");
9166
+ if (prev) {
9167
+ if (!isString(prev)) {
9168
+ for (const key in prev) if (next[key] == null) setStyle(style, key, "");
9169
+ } else for (const prevStyle of prev.split(";")) {
9170
+ const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
9171
+ if (next[key] == null) setStyle(style, key, "");
9172
+ }
8919
9173
  }
8920
9174
  for (const key in next) {
8921
9175
  if (key === "display") hasControlledDisplay = true;
@@ -8931,7 +9185,11 @@ function patchStyle(el, prev, next) {
8931
9185
  style.cssText = next;
8932
9186
  hasControlledDisplay = displayRE.test(next);
8933
9187
  }
8934
- } else if (prev) el.removeAttribute("style");
9188
+ } else if (prev) {
9189
+ const cssVarText = style[CSS_VAR_TEXT];
9190
+ if (cssVarText) style.cssText = cssVarText;
9191
+ else el.removeAttribute("style");
9192
+ }
8935
9193
  if (vShowOriginalDisplay in el) {
8936
9194
  el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
8937
9195
  if (el[vShowHidden]) style.display = "none";
@@ -8944,8 +9202,10 @@ function setStyle(style, name, rawVal) {
8944
9202
  else {
8945
9203
  const val = rawVal == null ? "" : String(rawVal);
8946
9204
  if (semicolonRE.test(val)) warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
8947
- if (name.startsWith("--")) style.setProperty(name, val);
8948
- else {
9205
+ if (name.startsWith("--")) {
9206
+ if (importantRE.test(val)) style.setProperty(name, val.replace(importantRE, ""), "important");
9207
+ else style.setProperty(name, val);
9208
+ } else {
8949
9209
  const prefixed = autoPrefix(style, name);
8950
9210
  if (importantRE.test(val)) style.setProperty(hyphenate(prefixed), val.replace(importantRE, ""), "important");
8951
9211
  else style[prefixed] = val;
@@ -8982,9 +9242,10 @@ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
8982
9242
  //#region packages/runtime-dom/src/modules/attrs.ts
8983
9243
  const xlinkNS = "http://www.w3.org/1999/xlink";
8984
9244
  function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
8985
- if (isSVG && key.startsWith("xlink:")) if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
8986
- else el.setAttributeNS(xlinkNS, key, value);
8987
- else if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
9245
+ if (isSVG && key.startsWith("xlink:")) {
9246
+ if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
9247
+ else el.setAttributeNS(xlinkNS, key, value);
9248
+ } else if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
8988
9249
  else el.setAttribute(key, isBoolean ? "" : isSymbol(value) ? String(value) : value);
8989
9250
  }
8990
9251
  //#endregion
@@ -9057,7 +9318,7 @@ function parseEventName(name) {
9057
9318
  return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
9058
9319
  }
9059
9320
  let cachedNow = 0;
9060
- const p = /* @__PURE__ */ Promise.resolve();
9321
+ const p = /*@__PURE__*/ Promise.resolve();
9061
9322
  const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
9062
9323
  function createInvoker(initialValue, instance) {
9063
9324
  const invoker = (e) => {
@@ -9125,7 +9386,7 @@ function shouldSetAsPropForVueCE(el, key) {
9125
9386
  //#endregion
9126
9387
  //#region packages/runtime-dom/src/apiCustomElement.ts
9127
9388
  const REMOVAL = {};
9128
- /* @__NO_SIDE_EFFECTS__ */
9389
+ /*@__NO_SIDE_EFFECTS__*/
9129
9390
  function defineCustomElement(options, extraOptions, _createApp) {
9130
9391
  let Comp = /* @__PURE__ */ defineComponent(options, extraOptions);
9131
9392
  if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
@@ -9174,12 +9435,14 @@ var VueElementBase = class VueElementBase extends BaseClass {
9174
9435
  this._parent = parent;
9175
9436
  break;
9176
9437
  }
9177
- if (!this._instance) if (this._resolved) this._mountComponent(this._def);
9178
- else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
9179
- this._pendingResolve = void 0;
9180
- this._resolveDef();
9181
- });
9182
- else this._resolveDef();
9438
+ if (!this._instance) {
9439
+ if (this._resolved) this._mountComponent(this._def);
9440
+ else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
9441
+ this._pendingResolve = void 0;
9442
+ if (this.isConnected) return this._resolveDef();
9443
+ });
9444
+ else this._resolveDef();
9445
+ }
9183
9446
  }
9184
9447
  disconnectedCallback() {
9185
9448
  this._connected = false;
@@ -9213,7 +9476,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
9213
9476
  * resolve inner component definition (handle possible async component)
9214
9477
  */
9215
9478
  _resolveDef() {
9216
- if (this._pendingResolve) return;
9479
+ if (this._pendingResolve) return this._pendingResolve;
9217
9480
  for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
9218
9481
  this._ob = new MutationObserver(this._processMutations.bind(this));
9219
9482
  this._ob.observe(this, { attributes: true });
@@ -9243,6 +9506,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
9243
9506
  this._def = def;
9244
9507
  resolve(def);
9245
9508
  });
9509
+ return this._pendingResolve;
9246
9510
  } else resolve(this._def);
9247
9511
  }
9248
9512
  _mountComponent(def) {
@@ -9281,14 +9545,17 @@ var VueElementBase = class VueElementBase extends BaseClass {
9281
9545
  const { props } = def;
9282
9546
  const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
9283
9547
  for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
9284
- for (const key of declaredPropKeys.map(camelize)) Object.defineProperty(this, key, {
9285
- get() {
9286
- return this._getProp(key);
9287
- },
9288
- set(val) {
9289
- this._setProp(key, val, true, !this._patching);
9290
- }
9291
- });
9548
+ for (const key of declaredPropKeys.map(camelize)) {
9549
+ if (key in Object.getPrototypeOf(this)) warn(`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`);
9550
+ Object.defineProperty(this, key, {
9551
+ get() {
9552
+ return this._getProp(key);
9553
+ },
9554
+ set(val) {
9555
+ this._setProp(key, val, true, !this._patching);
9556
+ }
9557
+ });
9558
+ }
9292
9559
  }
9293
9560
  _setAttr(key) {
9294
9561
  if (key.startsWith("data-v-")) return;
@@ -9391,13 +9658,11 @@ var VueElementBase = class VueElementBase extends BaseClass {
9391
9658
  _renderSlots() {
9392
9659
  const outlets = this._getSlots();
9393
9660
  const scopeId = this._instance.type.__scopeId;
9394
- const slotReplacements = /* @__PURE__ */ new Map();
9395
9661
  for (let i = 0; i < outlets.length; i++) {
9396
9662
  const o = outlets[i];
9397
9663
  const slotName = o.getAttribute("name") || "default";
9398
9664
  const content = this._slots[slotName];
9399
9665
  const parent = o.parentNode;
9400
- const replacementNodes = [];
9401
9666
  if (content) for (const n of content) {
9402
9667
  if (scopeId && n.nodeType === 1) {
9403
9668
  const id = scopeId + "-s";
@@ -9407,20 +9672,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
9407
9672
  while (child = walker.nextNode()) child.setAttribute(id, "");
9408
9673
  }
9409
9674
  parent.insertBefore(n, o);
9410
- replacementNodes.push(n);
9411
- }
9412
- else while (o.firstChild) {
9413
- const child = o.firstChild;
9414
- parent.insertBefore(child, o);
9415
- replacementNodes.push(child);
9416
9675
  }
9676
+ else while (o.firstChild) parent.insertBefore(o.firstChild, o);
9417
9677
  parent.removeChild(o);
9418
- slotReplacements.set(o, {
9419
- nodes: replacementNodes,
9420
- usedFallback: !content
9421
- });
9422
9678
  }
9423
- this._updateSlotNodes(slotReplacements);
9424
9679
  }
9425
9680
  /**
9426
9681
  * @internal
@@ -9459,7 +9714,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
9459
9714
  * @internal
9460
9715
  */
9461
9716
  _hasShadowRoot() {
9462
- return this._def.shadowRoot !== false;
9717
+ return this._root !== this;
9463
9718
  }
9464
9719
  /**
9465
9720
  * @internal
@@ -9504,10 +9759,6 @@ var VueElement = class extends VueElementBase {
9504
9759
  if (this._instance && this._instance.ce) this._instance.ce = void 0;
9505
9760
  this._app = this._instance = null;
9506
9761
  }
9507
- /**
9508
- * Only called when shadowRoot is false
9509
- */
9510
- _updateSlotNodes(replacements) {}
9511
9762
  _createVNode() {
9512
9763
  const baseProps = {};
9513
9764
  if (!this.shadowRoot) baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
@@ -9573,7 +9824,7 @@ const decorate = (t) => {
9573
9824
  };
9574
9825
  const TransitionGroup = /* @__PURE__ */ decorate({
9575
9826
  name: "TransitionGroup",
9576
- props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
9827
+ props: /*@__PURE__*/ extend({}, TransitionPropsValidators, {
9577
9828
  tag: String,
9578
9829
  moveClass: String
9579
9830
  }),
@@ -9704,13 +9955,22 @@ function onCompositionEnd(e) {
9704
9955
  }
9705
9956
  }
9706
9957
  const assignKey = Symbol("_assign");
9958
+ const initialValueKey = Symbol("_initialValue");
9707
9959
  const vModelText = {
9708
9960
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
9961
+ if (el.parentNode) {
9962
+ if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
9963
+ else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
9964
+ }
9709
9965
  el[assignKey] = getModelAssigner(vnode);
9710
9966
  vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
9711
9967
  },
9712
- mounted(el, { value }) {
9713
- el.value = value == null ? "" : value;
9968
+ mounted(el, { value, modifiers: { trim, number } }) {
9969
+ const newValue = value == null ? "" : value;
9970
+ const initialValue = el[initialValueKey];
9971
+ delete el[initialValueKey];
9972
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
9973
+ else el.value = newValue;
9714
9974
  },
9715
9975
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
9716
9976
  el[assignKey] = getModelAssigner(vnode);
@@ -9845,19 +10105,39 @@ const vModelSelectInit = (el, value, number, set) => {
9845
10105
  el._modelValue = value;
9846
10106
  addEventListener(el, "change", () => {
9847
10107
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
9848
- (set || el[assignKey])(el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
9849
- el._assigning = true;
9850
- nextTick(() => {
9851
- el._assigning = false;
9852
- });
10108
+ const multiple = el.multiple;
10109
+ const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
10110
+ const pending = el._pendingValue = [multiple, multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue];
10111
+ try {
10112
+ (set || el[assignKey])(assignedValue);
10113
+ } finally {
10114
+ nextTick(() => {
10115
+ if (el._pendingValue === pending) el._pendingValue = void 0;
10116
+ });
10117
+ }
9853
10118
  });
9854
10119
  };
10120
+ function isSameSelectValue(value, assignedValue, multiple) {
10121
+ if (!multiple) return looseEqual(value, assignedValue);
10122
+ if (isArray(value)) return looseEqual(value, assignedValue);
10123
+ if (isSet(value)) {
10124
+ if (value.size !== assignedValue.length) return false;
10125
+ for (const item of assignedValue) if (!value.has(item)) return false;
10126
+ return true;
10127
+ }
10128
+ return false;
10129
+ }
9855
10130
  /**
9856
10131
  * @internal
9857
10132
  */
9858
10133
  const vModelSetSelected = (el, value) => {
9859
10134
  el._modelValue = value;
9860
- if (el._assigning) return;
10135
+ const pending = el._pendingValue;
10136
+ el._pendingValue = void 0;
10137
+ if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
10138
+ setSelected(el, value);
10139
+ };
10140
+ function setSelected(el, value) {
9861
10141
  const isMultiple = el.multiple;
9862
10142
  const isArrayValue = isArray(value);
9863
10143
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -9867,18 +10147,19 @@ const vModelSetSelected = (el, value) => {
9867
10147
  for (let i = 0, l = el.options.length; i < l; i++) {
9868
10148
  const option = el.options[i];
9869
10149
  const optionValue = getValue(option);
9870
- if (isMultiple) if (isArrayValue) {
9871
- const optionType = typeof optionValue;
9872
- if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
9873
- else option.selected = looseIndexOf(value, optionValue) > -1;
9874
- } else option.selected = value.has(optionValue);
9875
- else if (looseEqual(getValue(option), value)) {
10150
+ if (isMultiple) {
10151
+ if (isArrayValue) {
10152
+ const optionType = typeof optionValue;
10153
+ if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
10154
+ else option.selected = looseIndexOf(value, optionValue) > -1;
10155
+ } else option.selected = value.has(optionValue);
10156
+ } else if (looseEqual(getValue(option), value)) {
9876
10157
  if (el.selectedIndex !== i) el.selectedIndex = i;
9877
10158
  return;
9878
10159
  }
9879
10160
  }
9880
10161
  if (!isMultiple && el.selectedIndex !== -1) el.selectedIndex = -1;
9881
- };
10162
+ }
9882
10163
  /**
9883
10164
  * @internal retrieve raw value set via :value bindings
9884
10165
  */
@@ -9980,7 +10261,7 @@ const withKeys = (fn, modifiers) => {
9980
10261
  };
9981
10262
  //#endregion
9982
10263
  //#region packages/runtime-dom/src/index.ts
9983
- const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
10264
+ const rendererOptions = /*@__PURE__*/ extend({ patchProp }, nodeOps);
9984
10265
  let renderer;
9985
10266
  let enabledHydration = false;
9986
10267
  function ensureRenderer() {