@vue/server-renderer 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/server-renderer v3.6.0-rc.1
2
+ * @vue/server-renderer 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;
@@ -54,9 +54,9 @@ const toRawType = (value) => {
54
54
  };
55
55
  const isPlainObject = (val) => toTypeString(val) === "[object Object]";
56
56
  const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
57
- const isReservedProp = /* @__PURE__ */ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
58
- const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
59
- const isBuiltInDirective = /* @__PURE__ */ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
57
+ const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
58
+ const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
59
+ const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
60
60
  const cacheStringFunction = (fn) => {
61
61
  const cache = Object.create(null);
62
62
  return ((str) => {
@@ -137,10 +137,10 @@ function normalizeStyle(value) {
137
137
  }
138
138
  const listDelimiterRE = /;(?![^(]*\))/g;
139
139
  const propertyDelimiterRE = /:([^]+)/;
140
- const styleCommentRE = /\/\*[^]*?\*\//g;
140
+ const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
141
141
  function parseStringStyle(cssText) {
142
142
  const ret = {};
143
- cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
143
+ cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
144
144
  if (item) {
145
145
  const tmp = item.split(propertyDelimiterRE);
146
146
  tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
@@ -183,22 +183,22 @@ const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,tr
183
183
  * Compiler only.
184
184
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
185
185
  */
186
- const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
186
+ const isHTMLTag = /*@__PURE__*/ makeMap(HTML_TAGS);
187
187
  /**
188
188
  * Compiler only.
189
189
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
190
190
  */
191
- const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
191
+ const isSVGTag = /*@__PURE__*/ makeMap(SVG_TAGS);
192
192
  /**
193
193
  * Compiler only.
194
194
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
195
195
  */
196
- const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
196
+ const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
197
197
  /**
198
198
  * Compiler only.
199
199
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
200
200
  */
201
- const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
201
+ const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
202
202
  //#endregion
203
203
  //#region packages/shared/src/domAttrConfig.ts
204
204
  /**
@@ -213,11 +213,11 @@ const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
213
213
  * - readonly -> readOnly
214
214
  */
215
215
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
216
- const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
216
+ const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
217
217
  /**
218
218
  * The full list is needed during SSR to produce the correct initial markup.
219
219
  */
220
- const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
220
+ const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
221
221
  /**
222
222
  * Boolean attributes should be included if the value is truthy or ''.
223
223
  * e.g. `<select multiple>` compiles to `{ multiple: '' }`
@@ -225,7 +225,7 @@ const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,auto
225
225
  function includeBooleanAttr(value) {
226
226
  return !!value || value === "";
227
227
  }
228
- const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
228
+ const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u000d\u0020]/;
229
229
  const attrValidationCache = {};
230
230
  function isSSRSafeAttrName(name) {
231
231
  if (attrValidationCache.hasOwnProperty(name)) return attrValidationCache[name];
@@ -303,13 +303,54 @@ function escapeHtmlComment(src) {
303
303
  }
304
304
  //#endregion
305
305
  //#region packages/shared/src/looseEqual.ts
306
- function looseCompareArrays(a, b) {
306
+ function looseCompareArrays(a, b, seen) {
307
307
  if (a.length !== b.length) return false;
308
308
  let equal = true;
309
- for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
309
+ for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i], seen);
310
310
  return equal;
311
311
  }
312
- function looseEqual(a, b) {
312
+ function looseCompareCollections(a, b, seen) {
313
+ if (a.size !== b.size) return false;
314
+ const candidates = Array.from(b);
315
+ const matched = new Uint8Array(candidates.length);
316
+ for (const item of a) {
317
+ let index = -1;
318
+ for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i], seen)) {
319
+ index = i;
320
+ break;
321
+ }
322
+ if (index < 0) return false;
323
+ matched[index] = 1;
324
+ }
325
+ return true;
326
+ }
327
+ function looseCompareObjects(a, b, seen) {
328
+ let aValidType = isMap(a);
329
+ let bValidType = isMap(b);
330
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
331
+ aValidType = isSet(a);
332
+ bValidType = isSet(b);
333
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
334
+ if (Object.keys(a).length !== Object.keys(b).length) return false;
335
+ for (const key in a) {
336
+ const aHasKey = a.hasOwnProperty(key);
337
+ const bHasKey = b.hasOwnProperty(key);
338
+ if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) return false;
339
+ }
340
+ return String(a) === String(b);
341
+ }
342
+ function looseCompareNested(a, b, seen, compare) {
343
+ if (!seen) seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
344
+ const [seenA, seenB] = seen;
345
+ if (seenA.has(a) || seenB.has(b)) return seenA.get(a) === b && seenB.get(b) === a;
346
+ seenA.set(a, b);
347
+ seenB.set(b, a);
348
+ const equal = compare(a, b, seen);
349
+ seenA.delete(a);
350
+ seenB.delete(b);
351
+ return equal;
352
+ }
353
+ function looseEqual(a, b, seen) {
313
354
  if (a === b) return true;
314
355
  let aValidType = isDate(a);
315
356
  let bValidType = isDate(b);
@@ -319,17 +360,12 @@ function looseEqual(a, b) {
319
360
  if (aValidType || bValidType) return a === b;
320
361
  aValidType = isArray(a);
321
362
  bValidType = isArray(b);
322
- if (aValidType || bValidType) return aValidType && bValidType ? looseCompareArrays(a, b) : false;
363
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
323
364
  aValidType = isObject(a);
324
365
  bValidType = isObject(b);
325
366
  if (aValidType || bValidType) {
326
367
  if (!aValidType || !bValidType) return false;
327
- if (Object.keys(a).length !== Object.keys(b).length) return false;
328
- for (const key in a) {
329
- const aHasKey = a.hasOwnProperty(key);
330
- const bHasKey = b.hasOwnProperty(key);
331
- if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) return false;
332
- }
368
+ return looseCompareNested(a, b, seen, looseCompareObjects);
333
369
  }
334
370
  return String(a) === String(b);
335
371
  }
@@ -459,6 +495,8 @@ function setupFlagsHandler(target) {
459
495
  function warn$2(msg, ...args) {
460
496
  console.warn(`[Vue warn] ${msg}`, ...args);
461
497
  }
498
+ //#endregion
499
+ //#region packages/reactivity/src/system.ts
462
500
  const notifyBuffer = [];
463
501
  let batchDepth = 0;
464
502
  let activeSub = void 0;
@@ -597,13 +635,23 @@ function endTracking(sub, prevSub) {
597
635
  sub.flags &= -5;
598
636
  }
599
637
  function flush() {
638
+ let hasError = false;
639
+ let error;
600
640
  while (notifyIndex < notifyBufferLength) {
601
641
  const effect = notifyBuffer[notifyIndex];
602
642
  notifyBuffer[notifyIndex++] = void 0;
603
- effect.notify();
643
+ try {
644
+ effect.notify();
645
+ } catch (err) {
646
+ if (!hasError) {
647
+ hasError = true;
648
+ error = err;
649
+ }
650
+ }
604
651
  }
605
652
  notifyIndex = 0;
606
653
  notifyBufferLength = 0;
654
+ if (hasError) throw error;
607
655
  }
608
656
  function checkDirty(link, sub) {
609
657
  let stack;
@@ -687,7 +735,7 @@ var Dep = class {
687
735
  }
688
736
  set subs(value) {
689
737
  this._subs = value;
690
- if (value === void 0) this.map.delete(this.key);
738
+ if (value === void 0 && this.map) this.map.delete(this.key);
691
739
  }
692
740
  };
693
741
  const targetMap = /* @__PURE__ */ new WeakMap();
@@ -770,9 +818,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
770
818
  if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
771
819
  }
772
820
  break;
773
- case "set":
774
- if (isMap(target)) run(depsMap.get(ITERATE_KEY));
775
- break;
821
+ case "set": if (isMap(target)) run(depsMap.get(ITERATE_KEY));
776
822
  }
777
823
  }
778
824
  }
@@ -783,13 +829,17 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
783
829
  /**
784
830
  * Track array iteration and return:
785
831
  * - if input is reactive: a cloned raw array with reactive values
786
- * - if input is non-reactive or shallowReactive: the original raw array
832
+ * - if input is readonly: a cloned raw array with readonly values, preserving
833
+ * reactivity
834
+ * - if input is raw or shallow: the original raw array
787
835
  */
788
836
  function reactiveReadArray(array) {
789
837
  const raw = /* @__PURE__ */ toRaw(array);
790
838
  if (raw === array) return raw;
791
839
  track(raw, "iterate", ARRAY_ITERATE_KEY);
792
- return /* @__PURE__ */ isShallow(array) ? raw : raw.map(toReactive);
840
+ if (/* @__PURE__ */ isShallow(array)) return raw;
841
+ if (!/* @__PURE__ */ isReadonly(array)) return raw.map(toReactive);
842
+ return /* @__PURE__ */ isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
793
843
  }
794
844
  /**
795
845
  * Track array iteration and return raw array
@@ -965,8 +1015,8 @@ function noTracking(self, method, args = []) {
965
1015
  }
966
1016
  //#endregion
967
1017
  //#region packages/reactivity/src/baseHandlers.ts
968
- const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
969
- const builtInSymbols = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
1018
+ const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
1019
+ const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
970
1020
  function hasOwnProperty(key) {
971
1021
  if (!isSymbol(key)) key = String(key);
972
1022
  const obj = /* @__PURE__ */ toRaw(this);
@@ -1021,12 +1071,14 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
1021
1071
  oldValue = /* @__PURE__ */ toRaw(oldValue);
1022
1072
  value = /* @__PURE__ */ toRaw(value);
1023
1073
  }
1024
- if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) if (isOldValueReadonly) {
1025
- warn$2(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
1026
- return true;
1027
- } else {
1028
- oldValue.value = value;
1029
- return true;
1074
+ if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
1075
+ if (isOldValueReadonly) {
1076
+ warn$2(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
1077
+ return true;
1078
+ } else {
1079
+ oldValue.value = value;
1080
+ return true;
1081
+ }
1030
1082
  }
1031
1083
  }
1032
1084
  const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
@@ -1067,10 +1119,10 @@ var ReadonlyReactiveHandler = class extends BaseReactiveHandler {
1067
1119
  return true;
1068
1120
  }
1069
1121
  };
1070
- const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
1071
- const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
1072
- const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
1073
- const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
1122
+ const mutableHandlers = /*@__PURE__*/ new MutableReactiveHandler();
1123
+ const readonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler();
1124
+ const shallowReactiveHandlers = /*@__PURE__*/ new MutableReactiveHandler(true);
1125
+ const shallowReadonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler(true);
1074
1126
  //#endregion
1075
1127
  //#region packages/reactivity/src/collectionHandlers.ts
1076
1128
  const toShallow = (value) => value;
@@ -1221,10 +1273,10 @@ function createInstrumentationGetter(isReadonly, shallow) {
1221
1273
  return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
1222
1274
  };
1223
1275
  }
1224
- const mutableCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, false) };
1225
- const shallowCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, true) };
1226
- const readonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, false) };
1227
- const shallowReadonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, true) };
1276
+ const mutableCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, false) };
1277
+ const shallowCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, true) };
1278
+ const readonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, false) };
1279
+ const shallowReadonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, true) };
1228
1280
  function checkIdentityKeys(target, has, key) {
1229
1281
  const rawKey = /* @__PURE__ */ toRaw(key);
1230
1282
  if (rawKey !== key && has.call(target, rawKey)) {
@@ -1249,7 +1301,7 @@ function targetTypeMap(rawType) {
1249
1301
  default: return 0;
1250
1302
  }
1251
1303
  }
1252
- /* @__NO_SIDE_EFFECTS__ */
1304
+ /*@__NO_SIDE_EFFECTS__*/
1253
1305
  function reactive(target) {
1254
1306
  if (/* @__PURE__ */ isReadonly(target)) return target;
1255
1307
  return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
@@ -1284,7 +1336,7 @@ function reactive(target) {
1284
1336
  * @param target - The source object.
1285
1337
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreactive}
1286
1338
  */
1287
- /* @__NO_SIDE_EFFECTS__ */
1339
+ /*@__NO_SIDE_EFFECTS__*/
1288
1340
  function shallowReactive(target) {
1289
1341
  return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
1290
1342
  }
@@ -1317,7 +1369,7 @@ function shallowReactive(target) {
1317
1369
  * @param target - The source object.
1318
1370
  * @see {@link https://vuejs.org/api/reactivity-core.html#readonly}
1319
1371
  */
1320
- /* @__NO_SIDE_EFFECTS__ */
1372
+ /*@__NO_SIDE_EFFECTS__*/
1321
1373
  function readonly(target) {
1322
1374
  return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
1323
1375
  }
@@ -1351,7 +1403,7 @@ function readonly(target) {
1351
1403
  * @param target - The source object.
1352
1404
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreadonly}
1353
1405
  */
1354
- /* @__NO_SIDE_EFFECTS__ */
1406
+ /*@__NO_SIDE_EFFECTS__*/
1355
1407
  function shallowReadonly(target) {
1356
1408
  return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
1357
1409
  }
@@ -1388,7 +1440,7 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
1388
1440
  * @param value - The value to check.
1389
1441
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#isreactive}
1390
1442
  */
1391
- /* @__NO_SIDE_EFFECTS__ */
1443
+ /*@__NO_SIDE_EFFECTS__*/
1392
1444
  function isReactive(value) {
1393
1445
  if (/* @__PURE__ */ isReadonly(value)) return /* @__PURE__ */ isReactive(value["__v_raw"]);
1394
1446
  return !!(value && value["__v_isReactive"]);
@@ -1404,11 +1456,11 @@ function isReactive(value) {
1404
1456
  * @param value - The value to check.
1405
1457
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#isreadonly}
1406
1458
  */
1407
- /* @__NO_SIDE_EFFECTS__ */
1459
+ /*@__NO_SIDE_EFFECTS__*/
1408
1460
  function isReadonly(value) {
1409
1461
  return !!(value && value["__v_isReadonly"]);
1410
1462
  }
1411
- /* @__NO_SIDE_EFFECTS__ */
1463
+ /*@__NO_SIDE_EFFECTS__*/
1412
1464
  function isShallow(value) {
1413
1465
  return !!(value && value["__v_isShallow"]);
1414
1466
  }
@@ -1419,7 +1471,7 @@ function isShallow(value) {
1419
1471
  * @param value - The value to check.
1420
1472
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#isproxy}
1421
1473
  */
1422
- /* @__NO_SIDE_EFFECTS__ */
1474
+ /*@__NO_SIDE_EFFECTS__*/
1423
1475
  function isProxy(value) {
1424
1476
  return value ? !!value["__v_raw"] : false;
1425
1477
  }
@@ -1446,7 +1498,7 @@ function isProxy(value) {
1446
1498
  * @param observed - The object for which the "raw" value is requested.
1447
1499
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#toraw}
1448
1500
  */
1449
- /* @__NO_SIDE_EFFECTS__ */
1501
+ /*@__NO_SIDE_EFFECTS__*/
1450
1502
  function toRaw(observed) {
1451
1503
  const raw = observed && observed["__v_raw"];
1452
1504
  return raw ? /* @__PURE__ */ toRaw(raw) : observed;
@@ -1495,7 +1547,7 @@ const toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value)
1495
1547
  const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
1496
1548
  //#endregion
1497
1549
  //#region packages/reactivity/src/ref.ts
1498
- /* @__NO_SIDE_EFFECTS__ */
1550
+ /*@__NO_SIDE_EFFECTS__*/
1499
1551
  function isRef(r) {
1500
1552
  return r ? r["__v_isRef"] === true : false;
1501
1553
  }
@@ -1595,10 +1647,12 @@ var ReactiveEffect = class {
1595
1647
  get dirty() {
1596
1648
  const flags = this.flags;
1597
1649
  if (flags & 16) return true;
1598
- if (flags & 32) if (checkDirty(this.deps, this)) {
1599
- this.flags = flags | 16;
1600
- return true;
1601
- } else this.flags = flags & -33;
1650
+ if (flags & 32) {
1651
+ if (checkDirty(this.deps, this)) {
1652
+ this.flags = flags | 16;
1653
+ return true;
1654
+ } else this.flags = flags & -33;
1655
+ }
1602
1656
  return false;
1603
1657
  }
1604
1658
  };
@@ -1707,10 +1761,12 @@ var ComputedRefImpl = class {
1707
1761
  get _dirty() {
1708
1762
  const flags = this.flags;
1709
1763
  if (flags & 16) return true;
1710
- if (flags & 32) if (checkDirty(this.deps, this)) {
1711
- this.flags = flags | 16;
1712
- return true;
1713
- } else this.flags = flags & -33;
1764
+ if (flags & 32) {
1765
+ if (checkDirty(this.deps, this)) {
1766
+ this.flags = flags | 16;
1767
+ return true;
1768
+ } else this.flags = flags & -33;
1769
+ }
1714
1770
  return false;
1715
1771
  }
1716
1772
  /**
@@ -1771,7 +1827,7 @@ var ComputedRefImpl = class {
1771
1827
  }
1772
1828
  };
1773
1829
  setupOnTrigger(ComputedRefImpl);
1774
- /* @__NO_SIDE_EFFECTS__ */
1830
+ /*@__NO_SIDE_EFFECTS__*/
1775
1831
  function computed$1(getterOrOptions, debugOptions, isSSR = false) {
1776
1832
  let getter;
1777
1833
  let setter;
@@ -1830,25 +1886,26 @@ var WatcherEffect = class extends ReactiveEffect {
1830
1886
  else if (isFunction(s)) return call ? call(s, 2) : s();
1831
1887
  else warnInvalidSource(s, onWarn);
1832
1888
  });
1833
- } else if (isFunction(source)) if (cb) getter = call ? () => call(source, 2) : source;
1834
- else getter = () => {
1835
- if (this.cleanupsLength) {
1836
- const prevSub = setActiveSub();
1889
+ } else if (isFunction(source)) {
1890
+ if (cb) getter = call ? () => call(source, 2) : source;
1891
+ else getter = () => {
1892
+ if (this.cleanupsLength) {
1893
+ const prevSub = setActiveSub();
1894
+ try {
1895
+ cleanup(this);
1896
+ } finally {
1897
+ setActiveSub(prevSub);
1898
+ }
1899
+ }
1900
+ const currentEffect = activeWatcher;
1901
+ activeWatcher = this;
1837
1902
  try {
1838
- cleanup(this);
1903
+ return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
1839
1904
  } finally {
1840
- setActiveSub(prevSub);
1905
+ activeWatcher = currentEffect;
1841
1906
  }
1842
- }
1843
- const currentEffect = activeWatcher;
1844
- activeWatcher = this;
1845
- try {
1846
- return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
1847
- } finally {
1848
- activeWatcher = currentEffect;
1849
- }
1850
- };
1851
- else {
1907
+ };
1908
+ } else {
1852
1909
  getter = NOOP;
1853
1910
  warnInvalidSource(source, onWarn);
1854
1911
  }
@@ -1945,7 +2002,7 @@ function warn$1(msg, ...args) {
1945
2002
  isWarning = true;
1946
2003
  const prevSub = setActiveSub();
1947
2004
  const entry = stack.length ? stack[stack.length - 1] : null;
1948
- const instance = isVNode$2(entry) ? entry.component : entry;
2005
+ const instance = isVNode$3(entry) ? entry.component : entry;
1949
2006
  const appWarnHandler = instance && instance.appContext.config.warnHandler;
1950
2007
  const trace = getComponentTrace();
1951
2008
  if (appWarnHandler) callWithErrorHandling(appWarnHandler, instance, 11, [
@@ -1978,7 +2035,7 @@ function getComponentTrace() {
1978
2035
  ctx: currentCtx,
1979
2036
  recurseCount: 0
1980
2037
  });
1981
- if (isVNode$2(currentCtx)) {
2038
+ if (isVNode$3(currentCtx)) {
1982
2039
  const parent = currentCtx.component && currentCtx.component.parent;
1983
2040
  currentCtx = parent && parent.vnode || parent;
1984
2041
  } else currentCtx = currentCtx.parent;
@@ -1995,7 +2052,7 @@ function formatTrace(trace) {
1995
2052
  }
1996
2053
  function formatTraceEntry({ ctx, recurseCount }) {
1997
2054
  const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
1998
- const instance = isVNode$2(ctx) ? ctx.component : ctx;
2055
+ const instance = isVNode$3(ctx) ? ctx.component : ctx;
1999
2056
  const isRoot = instance ? instance.parent == null : false;
2000
2057
  const open = ` at <${formatComponentName(instance, ctx.type, isRoot)}`;
2001
2058
  const close = `>` + postfix;
@@ -2134,7 +2191,7 @@ let currentFlushPromise = null;
2134
2191
  let jobsLength = 0;
2135
2192
  let flushIndex = 0;
2136
2193
  let postFlushIndex = 0;
2137
- const resolvedPromise = /* @__PURE__ */ Promise.resolve();
2194
+ const resolvedPromise = /*@__PURE__*/ Promise.resolve();
2138
2195
  const RECURSION_LIMIT = 100;
2139
2196
  function nextTick(fn) {
2140
2197
  const p = currentFlushPromise || resolvedPromise;
@@ -2173,6 +2230,7 @@ const doFlushJobs = () => {
2173
2230
  flushJobs();
2174
2231
  } catch (e) {
2175
2232
  currentFlushPromise = null;
2233
+ if (jobsLength || postJobs.length) queueFlush();
2176
2234
  throw e;
2177
2235
  }
2178
2236
  };
@@ -2180,9 +2238,10 @@ function queueFlush() {
2180
2238
  if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(doFlushJobs);
2181
2239
  }
2182
2240
  function queuePostFlushCb(jobs, id = Infinity) {
2183
- if (!isArray(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
2184
- else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
2185
- else for (const job of jobs) queueJobWorker(job, id, postJobs, postJobs.length, 0);
2241
+ if (!isArray(jobs)) {
2242
+ if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
2243
+ else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
2244
+ } else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
2186
2245
  queueFlush();
2187
2246
  }
2188
2247
  function flushPreFlushCbs(instance, seen) {
@@ -2196,32 +2255,39 @@ function flushPreFlushCbs(instance, seen) {
2196
2255
  i--;
2197
2256
  jobsLength--;
2198
2257
  if (cb.flags & 2) cb.flags &= -2;
2199
- cb();
2200
- if (!(cb.flags & 2)) cb.flags &= -2;
2258
+ try {
2259
+ cb();
2260
+ } finally {
2261
+ if (!(cb.flags & 2)) cb.flags &= -2;
2262
+ }
2201
2263
  }
2202
2264
  }
2203
2265
  function flushPostFlushCbs(seen) {
2204
2266
  if (postJobs.length) {
2205
2267
  if (activePostJobs) {
2206
- activePostJobs.push(...postJobs);
2268
+ for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
2207
2269
  postJobs.length = 0;
2208
2270
  return;
2209
2271
  }
2210
2272
  activePostJobs = postJobs;
2211
2273
  postJobs = [];
2212
2274
  seen = seen || /* @__PURE__ */ new Map();
2213
- while (postFlushIndex < activePostJobs.length) {
2214
- const cb = activePostJobs[postFlushIndex++];
2215
- if (checkRecursiveUpdates(seen, cb)) continue;
2216
- if (cb.flags & 2) cb.flags &= -2;
2217
- if (!(cb.flags & 4)) try {
2218
- cb();
2219
- } finally {
2220
- cb.flags &= -2;
2275
+ try {
2276
+ while (postFlushIndex < activePostJobs.length) {
2277
+ const cb = activePostJobs[postFlushIndex++];
2278
+ if (checkRecursiveUpdates(seen, cb)) continue;
2279
+ if (cb.flags & 2) cb.flags &= -2;
2280
+ if (!(cb.flags & 4)) try {
2281
+ cb();
2282
+ } finally {
2283
+ if (!(cb.flags & 2)) cb.flags &= -2;
2284
+ }
2221
2285
  }
2286
+ } finally {
2287
+ while (postFlushIndex < activePostJobs.length) activePostJobs[postFlushIndex++].flags &= -2;
2288
+ activePostJobs = null;
2289
+ postFlushIndex = 0;
2222
2290
  }
2223
- activePostJobs = null;
2224
- postFlushIndex = 0;
2225
2291
  }
2226
2292
  }
2227
2293
  let isFlushing = false;
@@ -2231,9 +2297,12 @@ let isFlushing = false;
2231
2297
  function flushOnAppMount(instance) {
2232
2298
  if (!isFlushing) {
2233
2299
  isFlushing = true;
2234
- flushPreFlushCbs(instance);
2235
- flushPostFlushCbs();
2236
- isFlushing = false;
2300
+ try {
2301
+ flushPreFlushCbs(instance);
2302
+ flushPostFlushCbs();
2303
+ } finally {
2304
+ isFlushing = false;
2305
+ }
2237
2306
  }
2238
2307
  }
2239
2308
  function flushJobs(seen) {
@@ -2263,8 +2332,8 @@ function flushJobs(seen) {
2263
2332
  jobsLength = 0;
2264
2333
  jobs.length = 0;
2265
2334
  flushPostFlushCbs(seen);
2266
- currentFlushPromise = null;
2267
2335
  if (jobsLength || postJobs.length) flushJobs(seen);
2336
+ else currentFlushPromise = null;
2268
2337
  }
2269
2338
  }
2270
2339
  function checkRecursiveUpdates(seen, fn) {
@@ -2295,6 +2364,19 @@ getGlobalThis().__VUE_HMR_RUNTIME__ = {
2295
2364
  rerender: tryWrap(rerender),
2296
2365
  reload: tryWrap(reload)
2297
2366
  };
2367
+ function runWithHmrUpdating(fn) {
2368
+ isHmrUpdating = true;
2369
+ let done = false;
2370
+ try {
2371
+ fn();
2372
+ done = true;
2373
+ } finally {
2374
+ if (done) nextTick(() => {
2375
+ isHmrUpdating = false;
2376
+ });
2377
+ else isHmrUpdating = false;
2378
+ }
2379
+ }
2298
2380
  const map = /* @__PURE__ */ new Map();
2299
2381
  function registerHMR(instance) {
2300
2382
  const id = instance.type.__hmrId;
@@ -2336,18 +2418,16 @@ function rerender(id, newRender) {
2336
2418
  instance.render = newRender;
2337
2419
  normalizeClassComponent(instance.type).render = newRender;
2338
2420
  }
2339
- isHmrUpdating = true;
2340
- if (instance.vapor) {
2341
- if (!instance.isUnmounted) instance.hmrRerender();
2342
- } else {
2343
- const i = instance;
2344
- if (!(i.effect.flags & 1024)) {
2345
- i.renderCache = [];
2346
- i.effect.run();
2421
+ runWithHmrUpdating(() => {
2422
+ if (instance.vapor) {
2423
+ if (!instance.isUnmounted) instance.hmrRerender();
2424
+ } else {
2425
+ const i = instance;
2426
+ if (!(i.effect.flags & 1024)) {
2427
+ i.renderCache = [];
2428
+ i.effect.run();
2429
+ }
2347
2430
  }
2348
- }
2349
- nextTick(() => {
2350
- isHmrUpdating = false;
2351
2431
  });
2352
2432
  });
2353
2433
  }
@@ -2362,17 +2442,19 @@ function reload(id, newComp) {
2362
2442
  for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
2363
2443
  const dirtyInstances = new Set(instances);
2364
2444
  const rerenderedParents = /* @__PURE__ */ new Set();
2365
- for (const instance of instances) {
2366
- const parent = instance.parent;
2367
- if (parent) {
2368
- if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
2369
- rerenderedParents.add(parent);
2370
- parent.hmrRerender();
2371
- }
2372
- } else instance.hmrReload(newComp);
2373
- }
2445
+ runWithHmrUpdating(() => {
2446
+ for (const instance of instances) {
2447
+ const parent = instance.parent;
2448
+ if (parent) {
2449
+ if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
2450
+ rerenderedParents.add(parent);
2451
+ parent.hmrRerender();
2452
+ }
2453
+ } else instance.hmrReload(newComp);
2454
+ }
2455
+ });
2374
2456
  } else {
2375
- const parentUpdates = /* @__PURE__ */ new Map();
2457
+ const parents = /* @__PURE__ */ new Set();
2376
2458
  const dirtyInstanceSet = new Set(instances);
2377
2459
  for (const instance of instances) {
2378
2460
  const oldComp = normalizeClassComponent(instance.type);
@@ -2391,33 +2473,23 @@ function reload(id, newComp) {
2391
2473
  instance.ceReload(newComp.styles);
2392
2474
  dirtyInstances.delete(instance);
2393
2475
  } else if (instance.parent) {
2394
- const parent = instance.parent;
2395
- if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
2396
- let updates = parentUpdates.get(parent);
2397
- if (!updates) parentUpdates.set(parent, updates = []);
2398
- updates.push([instance, dirtyInstances]);
2399
- }
2476
+ if (!hasDirtyAncestor(instance, dirtyInstanceSet)) parents.add(instance.parent);
2400
2477
  } else if (instance.appContext.reload) instance.appContext.reload();
2401
2478
  else if (typeof window !== "undefined") window.location.reload();
2402
2479
  else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2403
2480
  if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2404
2481
  }
2405
- parentUpdates.forEach((updates, parent) => {
2482
+ parents.forEach((parent) => {
2406
2483
  queueJob(() => {
2407
- isHmrUpdating = true;
2408
- if (parent.vapor) parent.hmrRerender();
2409
- else {
2410
- const i = parent;
2411
- if (!(i.effect.flags & 1024)) {
2412
- i.renderCache = [];
2413
- i.effect.run();
2484
+ runWithHmrUpdating(() => {
2485
+ if (parent.vapor) parent.hmrRerender();
2486
+ else {
2487
+ const i = parent;
2488
+ if (!(i.effect.flags & 1024)) {
2489
+ i.renderCache = [];
2490
+ i.effect.run();
2491
+ }
2414
2492
  }
2415
- }
2416
- nextTick(() => {
2417
- isHmrUpdating = false;
2418
- });
2419
- updates.forEach(([instance, dirtyInstances]) => {
2420
- dirtyInstances.delete(instance);
2421
2493
  });
2422
2494
  });
2423
2495
  });
@@ -2487,20 +2559,20 @@ function devtoolsInitApp(app, version) {
2487
2559
  function devtoolsUnmountApp(app) {
2488
2560
  emit$1("app:unmount", app);
2489
2561
  }
2490
- const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added");
2491
- const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated");
2492
- const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook("component:removed");
2562
+ const devtoolsComponentAdded = /*@__PURE__*/ createDevtoolsComponentHook("component:added");
2563
+ const devtoolsComponentUpdated = /*@__PURE__*/ createDevtoolsComponentHook("component:updated");
2564
+ const _devtoolsComponentRemoved = /*@__PURE__*/ createDevtoolsComponentHook("component:removed");
2493
2565
  const devtoolsComponentRemoved = (component) => {
2494
2566
  if (devtools && typeof devtools.cleanupBuffer === "function" && !devtools.cleanupBuffer(component)) _devtoolsComponentRemoved(component);
2495
2567
  };
2496
- /* @__NO_SIDE_EFFECTS__ */
2568
+ /*@__NO_SIDE_EFFECTS__*/
2497
2569
  function createDevtoolsComponentHook(hook) {
2498
2570
  return (component) => {
2499
2571
  emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component);
2500
2572
  };
2501
2573
  }
2502
- const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start");
2503
- const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end");
2574
+ const devtoolsPerfStart = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:start");
2575
+ const devtoolsPerfEnd = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:end");
2504
2576
  function createDevtoolsPerformanceHook(hook) {
2505
2577
  return (component, type, time) => {
2506
2578
  emit$1(hook, component.appContext.app, component.uid, component, type, time);
@@ -2694,7 +2766,7 @@ function instanceWatch(source, value, options) {
2694
2766
  }
2695
2767
  const prev = setCurrentInstance(this);
2696
2768
  const res = doWatch(getter, cb.bind(publicThis), options);
2697
- setCurrentInstance(...prev);
2769
+ restoreCurrentInstance(prev);
2698
2770
  return res;
2699
2771
  }
2700
2772
  function createPathGetter(ctx, path) {
@@ -2712,16 +2784,47 @@ const isTeleport = (type) => type.__isTeleport;
2712
2784
  //#endregion
2713
2785
  //#region packages/runtime-core/src/components/BaseTransition.ts
2714
2786
  const leaveCbKey = Symbol("_leaveCb");
2787
+ function findNonCommentChild(children) {
2788
+ let child = children[0];
2789
+ if (children.length > 1) {
2790
+ let hasFound = false;
2791
+ for (const c of children) if (c.type !== Comment) {
2792
+ if (hasFound) {
2793
+ warn$1("<transition> can only be used on a single element or component. Use <transition-group> for lists.");
2794
+ break;
2795
+ }
2796
+ child = c;
2797
+ hasFound = true;
2798
+ }
2799
+ }
2800
+ return child;
2801
+ }
2802
+ function getInnerChild(vnode) {
2803
+ if (!isKeepAlive(vnode)) {
2804
+ if (isTeleport(vnode.type) && vnode.children) return findNonCommentChild(vnode.children);
2805
+ return vnode;
2806
+ }
2807
+ if (vnode.component) return vnode.component.subTree;
2808
+ const { shapeFlag, children } = vnode;
2809
+ if (children) {
2810
+ if (shapeFlag & 16) return children[0];
2811
+ if (shapeFlag & 32 && isFunction(children.default)) return children.default();
2812
+ }
2813
+ }
2715
2814
  function setTransitionHooks(vnode, hooks) {
2716
- if (vnode.shapeFlag & 6 && vnode.component) if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
2717
- else {
2815
+ if (vnode.shapeFlag & 6 && vnode.component) {
2718
2816
  vnode.transition = hooks;
2719
- setTransitionHooks(vnode.component.subTree, hooks);
2720
- }
2721
- else if (vnode.shapeFlag & 128) {
2722
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
2723
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
2817
+ if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
2818
+ else {
2819
+ const subTree = vnode.component.subTree;
2820
+ return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild(subTree) || subTree : subTree, hooks);
2821
+ }
2822
+ } else if (vnode.shapeFlag & 128) {
2823
+ const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
2824
+ const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
2825
+ return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
2724
2826
  } else vnode.transition = hooks;
2827
+ return hooks;
2725
2828
  }
2726
2829
  //#endregion
2727
2830
  //#region packages/runtime-core/src/helpers/useId.ts
@@ -2796,15 +2899,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
2796
2899
  if (rawRef.f) {
2797
2900
  const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
2798
2901
  if (isUnmount) isArray(existing) && remove(existing, refValue);
2799
- else if (!isArray(existing)) if (_isString) {
2800
- refs[ref] = [refValue];
2801
- if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
2802
- } else {
2803
- const newVal = [refValue];
2804
- if (canSetRef(ref, rawRef.k)) ref.value = newVal;
2805
- if (rawRef.k) refs[rawRef.k] = newVal;
2806
- }
2807
- else if (!existing.includes(refValue)) existing.push(refValue);
2902
+ else if (!isArray(existing)) {
2903
+ if (_isString) {
2904
+ refs[ref] = [refValue];
2905
+ if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
2906
+ } else {
2907
+ const newVal = [refValue];
2908
+ if (canSetRef(ref, rawRef.k)) ref.value = newVal;
2909
+ if (rawRef.k) refs[rawRef.k] = newVal;
2910
+ }
2911
+ } else if (!existing.includes(refValue)) existing.push(refValue);
2808
2912
  } else if (_isString) {
2809
2913
  refs[ref] = value;
2810
2914
  if (canSetSetupRef(ref)) setupState[ref] = value;
@@ -2891,7 +2995,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
2891
2995
  try {
2892
2996
  return callWithAsyncErrorHandling(hook, target, type, args);
2893
2997
  } finally {
2894
- setCurrentInstance(...prev);
2998
+ restoreCurrentInstance(prev);
2895
2999
  setActiveSub(prevSub);
2896
3000
  }
2897
3001
  });
@@ -2920,9 +3024,33 @@ function onErrorCaptured(hook, target = currentInstance) {
2920
3024
  const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
2921
3025
  //#endregion
2922
3026
  //#region packages/runtime-core/src/helpers/renderSlot.ts
3027
+ /**
3028
+ * Links a slot function to its raw vapor slot: a raw vapor slot carries
3029
+ * itself, and the wrapper the interop slots proxy hands out carries the raw
3030
+ * slot it wraps — one lookup answers both "is this a vapor slot" and
3031
+ * "which one". Internal to vapor interop.
3032
+ */
3033
+ const rawVaporSlotKey$2 = Symbol(`rawVaporSlot`);
3034
+ /**
3035
+ * Invokes a VDOM slot fallback under the outlet owner that produced it, the
3036
+ * way `renderSlot` would have rendered it inline. Vapor interop invokes
3037
+ * fallbacks late, outside any render, so it passes the owner recorded on the
3038
+ * vapor slot vnode. Internal to vapor interop.
3039
+ */
3040
+ function invokeSlotFallback$1(fallback, owner) {
3041
+ if (!owner) return fallback();
3042
+ const prev = setCurrentRenderingInstance$1(owner);
3043
+ const prevStackSize = blockStack.length;
3044
+ try {
3045
+ return fallback();
3046
+ } finally {
3047
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
3048
+ setCurrentRenderingInstance$1(prev);
3049
+ }
3050
+ }
2923
3051
  function ensureValidVNode$1(vnodes) {
2924
3052
  return vnodes.some((child) => {
2925
- if (!isVNode$2(child)) return true;
3053
+ if (!isVNode$3(child)) return true;
2926
3054
  if (child.type === Comment) return false;
2927
3055
  if (child.type === Fragment && !ensureValidVNode$1(child.children)) return false;
2928
3056
  return true;
@@ -2940,11 +3068,38 @@ const getPublicInstance = (i) => {
2940
3068
  if (isStatefulComponent(i)) return getComponentPublicInstance(i);
2941
3069
  return getPublicInstance(i.parent);
2942
3070
  };
3071
+ const resolveDevRootEl = (vnode) => {
3072
+ let found = false;
3073
+ while (true) {
3074
+ if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
3075
+ const root = filterSingleRoot(vnode.children);
3076
+ if (!root) return;
3077
+ vnode = root;
3078
+ found = true;
3079
+ continue;
3080
+ }
3081
+ const component = vnode.component;
3082
+ if (component && component.subTree) {
3083
+ vnode = component.subTree;
3084
+ continue;
3085
+ }
3086
+ const suspense = vnode.suspense;
3087
+ if (suspense && suspense.activeBranch) {
3088
+ vnode = suspense.activeBranch;
3089
+ continue;
3090
+ }
3091
+ return found ? vnode.el : void 0;
3092
+ }
3093
+ };
3094
+ const getDevRootFragmentEl = (i) => {
3095
+ const el = i.subTree && resolveDevRootEl(i.subTree);
3096
+ return el === void 0 ? i.vnode.el : el;
3097
+ };
2943
3098
  let publicPropertiesMap;
2944
3099
  const getPublicPropertiesMap = () => {
2945
3100
  if (!publicPropertiesMap) publicPropertiesMap = extend(Object.create(null), {
2946
3101
  $: (i) => i,
2947
- $el: (i) => i.vnode.el,
3102
+ $el: (i) => getDevRootFragmentEl(i),
2948
3103
  $data: (i) => i.data,
2949
3104
  $props: (i) => /* @__PURE__ */ shallowReadonly(i.props),
2950
3105
  $attrs: (i) => /* @__PURE__ */ shallowReadonly(i.attrs),
@@ -3161,11 +3316,12 @@ function applyOptions(instance) {
3161
3316
  const opt = computedOptions[key];
3162
3317
  const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
3163
3318
  if (get === NOOP) warn$1(`Computed property "${key}" has no getter.`);
3319
+ const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
3320
+ warn$1(`Write operation failed: computed property "${key}" is readonly.`);
3321
+ };
3164
3322
  const c = computed({
3165
3323
  get,
3166
- set: !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
3167
- warn$1(`Write operation failed: computed property "${key}" is readonly.`);
3168
- }
3324
+ set
3169
3325
  });
3170
3326
  Object.defineProperty(ctx, key, {
3171
3327
  enumerable: true,
@@ -3222,9 +3378,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP)
3222
3378
  for (const key in injectOptions) {
3223
3379
  const opt = injectOptions[key];
3224
3380
  let injected;
3225
- if (isObject(opt)) if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
3226
- else injected = inject(opt.from || key);
3227
- else injected = inject(opt);
3381
+ if (isObject(opt)) {
3382
+ if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
3383
+ else injected = inject(opt.from || key);
3384
+ } else injected = inject(opt);
3228
3385
  if (/* @__PURE__ */ isRef(injected)) Object.defineProperty(ctx, key, {
3229
3386
  enumerable: true,
3230
3387
  configurable: true,
@@ -3245,13 +3402,14 @@ function createWatcher(raw, ctx, publicThis, key) {
3245
3402
  if (isFunction(handler)) watch(getter, handler);
3246
3403
  else warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
3247
3404
  } else if (isFunction(raw)) watch(getter, raw.bind(publicThis));
3248
- else if (isObject(raw)) if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
3249
- else {
3250
- const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
3251
- if (isFunction(handler)) watch(getter, handler, raw);
3252
- else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
3253
- }
3254
- else warn$1(`Invalid watch option: "${key}"`, raw);
3405
+ else if (isObject(raw)) {
3406
+ if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
3407
+ else {
3408
+ const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
3409
+ if (isFunction(handler)) watch(getter, handler, raw);
3410
+ else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
3411
+ }
3412
+ } else warn$1(`Invalid watch option: "${key}"`, raw);
3255
3413
  }
3256
3414
  /**
3257
3415
  * Resolve merged options and cache it on the component.
@@ -3337,7 +3495,7 @@ function mergeObjectOptions(to, from) {
3337
3495
  }
3338
3496
  function mergeEmitsOrPropsOptions(to, from) {
3339
3497
  if (to) {
3340
- if (isArray(to) && isArray(from)) return [...new Set([...to, ...from])];
3498
+ if (isArray(to) && isArray(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
3341
3499
  return extend(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
3342
3500
  } else return from;
3343
3501
  }
@@ -3456,8 +3614,10 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
3456
3614
  } else warn$1(`Cannot unmount an app that is not mounted.`);
3457
3615
  },
3458
3616
  provide(key, value) {
3459
- 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.`);
3460
- else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
3617
+ if (key in context.provides) {
3618
+ if (hasOwn(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
3619
+ else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
3620
+ }
3461
3621
  context.provides[key] = value;
3462
3622
  return app;
3463
3623
  },
@@ -3496,12 +3656,14 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
3496
3656
  if (instance.isUnmounted) return;
3497
3657
  {
3498
3658
  const { emitsOptions, propsOptions } = instance;
3499
- if (emitsOptions) if (!(event in emitsOptions) && true) {
3500
- 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.`);
3501
- } else {
3502
- const validator = emitsOptions[event];
3503
- if (isFunction(validator)) {
3504
- if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
3659
+ if (emitsOptions) {
3660
+ if (!(event in emitsOptions) && true) {
3661
+ 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.`);
3662
+ } else {
3663
+ const validator = emitsOptions[event];
3664
+ if (isFunction(validator)) {
3665
+ if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
3666
+ }
3505
3667
  }
3506
3668
  }
3507
3669
  }
@@ -3510,7 +3672,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
3510
3672
  const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
3511
3673
  if (modifiers) {
3512
3674
  if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
3513
- if (modifiers.number) args = rawArgs.map(looseToNumber);
3675
+ if (modifiers.number) args = args.map(looseToNumber);
3514
3676
  }
3515
3677
  devtoolsComponentEmit(instance, event, args);
3516
3678
  {
@@ -3637,8 +3799,9 @@ function renderComponentRoot$1(instance) {
3637
3799
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
3638
3800
  }
3639
3801
  if (vnode.transition) {
3640
- if (!isElementRoot(root)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
3641
- setTransitionHooks(root, vnode.transition);
3802
+ const child = isTeleport(root.type) ? getInnerChild(root) || root : root;
3803
+ if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
3804
+ setTransitionHooks(child, vnode.transition);
3642
3805
  }
3643
3806
  if (setRoot) setRoot(root);
3644
3807
  else result = root;
@@ -3688,19 +3851,22 @@ function filterSingleRoot(children, recurse = true) {
3688
3851
  let singleRoot;
3689
3852
  for (let i = 0; i < children.length; i++) {
3690
3853
  const child = children[i];
3691
- if (isVNode$2(child)) {
3692
- if (child.type !== Comment || child.children === "v-if") if (singleRoot) return;
3693
- else {
3694
- singleRoot = child;
3695
- if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
3854
+ if (isVNode$3(child)) {
3855
+ if (child.type !== Comment || child.children === "v-if") {
3856
+ if (singleRoot) return;
3857
+ else {
3858
+ singleRoot = child;
3859
+ if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
3860
+ }
3696
3861
  }
3697
3862
  } else return;
3698
3863
  }
3699
3864
  return singleRoot;
3700
3865
  }
3866
+ const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
3701
3867
  const getFunctionalFallthrough = (attrs) => {
3702
3868
  let res;
3703
- for (const key in attrs) if (key === "class" || key === "style" || isOn(key)) (res || (res = {}))[key] = attrs[key];
3869
+ for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
3704
3870
  return res;
3705
3871
  };
3706
3872
  const filterModelListeners = (attrs, props) => {
@@ -3812,16 +3978,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
3812
3978
  let key = propsToUpdate[i];
3813
3979
  if (isEmitListener(instance.emitsOptions, key)) continue;
3814
3980
  const value = rawProps[key];
3815
- if (options) if (hasOwn(attrs, key)) {
3816
- if (value !== attrs[key]) {
3817
- attrs[key] = value;
3818
- hasAttrsChanged = true;
3981
+ if (options) {
3982
+ if (hasOwn(attrs, key)) {
3983
+ if (value !== attrs[key]) {
3984
+ attrs[key] = value;
3985
+ hasAttrsChanged = true;
3986
+ }
3987
+ } else {
3988
+ const camelizedKey = camelize(key);
3989
+ props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
3819
3990
  }
3820
- } else {
3821
- const camelizedKey = camelize(key);
3822
- props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
3823
- }
3824
- else if (value !== attrs[key]) {
3991
+ } else if (value !== attrs[key]) {
3825
3992
  attrs[key] = value;
3826
3993
  hasAttrsChanged = true;
3827
3994
  }
@@ -3830,9 +3997,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
3830
3997
  } else {
3831
3998
  if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
3832
3999
  let kebabKey;
3833
- for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) if (options) {
3834
- if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
3835
- } else delete props[key];
4000
+ for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
4001
+ if (options) {
4002
+ if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
4003
+ } else delete props[key];
4004
+ }
3836
4005
  if (attrs !== rawCurrentProps) {
3837
4006
  for (const key in attrs) if (!rawProps || !hasOwn(rawProps, key) && true) {
3838
4007
  delete attrs[key];
@@ -3851,9 +4020,10 @@ function setFullProps(instance, rawProps, props, attrs) {
3851
4020
  if (isReservedProp(key)) continue;
3852
4021
  const value = rawProps[key];
3853
4022
  let camelKey;
3854
- if (options && hasOwn(options, camelKey = camelize(key))) if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
3855
- else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
3856
- else if (!isEmitListener(instance.emitsOptions, key)) {
4023
+ if (options && hasOwn(options, camelKey = camelize(key))) {
4024
+ if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
4025
+ else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
4026
+ } else if (!isEmitListener(instance.emitsOptions, key)) {
3857
4027
  if (!(key in attrs) || value !== attrs[key]) {
3858
4028
  attrs[key] = value;
3859
4029
  hasAttrsChanged = true;
@@ -3900,7 +4070,7 @@ function baseResolveDefault(factory, instance, key) {
3900
4070
  const prev = setCurrentInstance(instance);
3901
4071
  const props = /* @__PURE__ */ toRaw(instance.props);
3902
4072
  value = factory.call(null, props);
3903
- setCurrentInstance(...prev);
4073
+ restoreCurrentInstance(prev);
3904
4074
  return value;
3905
4075
  }
3906
4076
  const mixinPropsCache = /* @__PURE__ */ new WeakMap();
@@ -4016,7 +4186,7 @@ function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
4016
4186
  }
4017
4187
  if (validator && !validator(value, /* @__PURE__ */ shallowReadonly(resolvedProps))) warn$1("Invalid prop: custom validator check failed for prop \"" + key + "\".");
4018
4188
  }
4019
- const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
4189
+ const isSimpleType = /*@__PURE__*/ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
4020
4190
  /**
4021
4191
  * dev only
4022
4192
  */
@@ -4129,12 +4299,13 @@ const updateSlots = (instance, children, optimized) => {
4129
4299
  let deletionComparisonTarget = EMPTY_OBJ;
4130
4300
  if (vnode.shapeFlag & 32) {
4131
4301
  const type = children._;
4132
- if (type) if (isHmrUpdating) {
4133
- assignSlots(slots, children, optimized);
4134
- trigger(instance, "set", "$slots");
4135
- } else if (optimized && type === 1) needDeletionCheck = false;
4136
- else assignSlots(slots, children, optimized);
4137
- else {
4302
+ if (type) {
4303
+ if (isHmrUpdating) {
4304
+ assignSlots(slots, children, optimized);
4305
+ trigger(instance, "set", "$slots");
4306
+ } else if (optimized && type === 1) needDeletionCheck = false;
4307
+ else assignSlots(slots, children, optimized);
4308
+ } else {
4138
4309
  needDeletionCheck = !children.$stable;
4139
4310
  normalizeObjectSlots(children, slots, instance);
4140
4311
  }
@@ -4152,7 +4323,7 @@ const updateSlots = (instance, children, optimized) => {
4152
4323
  let supported;
4153
4324
  let perf;
4154
4325
  let cachedNow$1 = 0;
4155
- const p$1 = /* @__PURE__ */ Promise.resolve();
4326
+ const p$1 = /*@__PURE__*/ Promise.resolve();
4156
4327
  const getNow$1 = () => cachedNow$1 || (p$1.then(() => cachedNow$1 = 0), cachedNow$1 = isSupported() ? perf.now() : Date.now());
4157
4328
  /**
4158
4329
  * @internal
@@ -4222,6 +4393,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4222
4393
  optimized = false;
4223
4394
  n2.dynamicChildren = null;
4224
4395
  }
4396
+ if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
4397
+ if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
4398
+ n2.dynamicChildren.hasOnce = true;
4399
+ }
4225
4400
  const { type, ref, shapeFlag } = n2;
4226
4401
  switch (type) {
4227
4402
  case Text:
@@ -4237,8 +4412,8 @@ function baseCreateRenderer(options, createHydrationFns) {
4237
4412
  case Fragment:
4238
4413
  processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4239
4414
  break;
4240
- case VaporSlot:
4241
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
4415
+ case VaporSlot$1:
4416
+ getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
4242
4417
  break;
4243
4418
  default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4244
4419
  else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
@@ -4357,7 +4532,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4357
4532
  for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
4358
4533
  };
4359
4534
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
4360
- for (let i = start; i < children.length; i++) patch(null, children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode$1(children[i]), container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4535
+ for (let i = start; i < children.length; i++) {
4536
+ const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode$1(children[i]);
4537
+ patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4538
+ }
4361
4539
  };
4362
4540
  const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4363
4541
  const el = n2.el = n1.el;
@@ -4369,6 +4547,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4369
4547
  let vnodeHook;
4370
4548
  parentComponent && toggleRecurse(parentComponent, false);
4371
4549
  if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
4550
+ if (n2.ibu) n2.ibu();
4372
4551
  if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
4373
4552
  parentComponent && toggleRecurse(parentComponent, true);
4374
4553
  if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
@@ -4402,8 +4581,9 @@ function baseCreateRenderer(options, createHydrationFns) {
4402
4581
  if (n1.children !== n2.children) hostSetElementText(el, n2.children);
4403
4582
  }
4404
4583
  } else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
4405
- if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
4584
+ if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
4406
4585
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
4586
+ n2.iu && n2.iu();
4407
4587
  dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
4408
4588
  }, void 0, parentSuspense);
4409
4589
  };
@@ -4411,7 +4591,8 @@ function baseCreateRenderer(options, createHydrationFns) {
4411
4591
  for (let i = 0; i < newChildren.length; i++) {
4412
4592
  const oldVNode = oldChildren[i];
4413
4593
  const newVNode = newChildren[i];
4414
- patch(oldVNode, newVNode, oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
4594
+ const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
4595
+ patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
4415
4596
  }
4416
4597
  };
4417
4598
  const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
@@ -4449,41 +4630,15 @@ function baseCreateRenderer(options, createHydrationFns) {
4449
4630
  };
4450
4631
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4451
4632
  n2.slotScopeIds = slotScopeIds;
4452
- if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
4453
- else {
4454
- const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
4455
- getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
4456
- if (n2.dirs) {
4457
- invokeDirectiveHook(n2, null, parentComponent, "created");
4458
- invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
4459
- }
4460
- }, () => {
4461
- if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
4462
- });
4463
- if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
4464
- const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
4465
- if (vnodeMountedHook) {
4466
- const scopedVNode = n2;
4467
- queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
4468
- }
4469
- }
4470
- else {
4471
- const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
4472
- getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
4473
- if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
4474
- }, () => {
4475
- const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
4476
- if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
4477
- });
4478
- const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
4479
- if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
4480
- n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
4481
- vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
4482
- }, void 0, parentSuspense);
4483
- }
4484
- else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
4485
- else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
4486
- else updateComponent(n1, n2, optimized);
4633
+ if (n2.type.__vapor) {
4634
+ if (n1 == null) {
4635
+ if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
4636
+ else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
4637
+ } else getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized));
4638
+ } else if (n1 == null) {
4639
+ if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
4640
+ else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
4641
+ } else updateComponent(n1, n2, optimized);
4487
4642
  };
4488
4643
  const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
4489
4644
  const instance = initialVNode.component = createComponentInstance$1(initialVNode, parentComponent, parentSuspense);
@@ -4524,16 +4679,18 @@ function baseCreateRenderer(options, createHydrationFns) {
4524
4679
  };
4525
4680
  const updateComponent = (n1, n2, optimized) => {
4526
4681
  const instance = n2.component = n1.component;
4527
- if (shouldUpdateComponent(n1, n2, optimized)) if (instance.asyncDep && !instance.asyncResolved) {
4528
- pushWarningContext$1(n2);
4529
- updateComponentPreRender(instance, n2, optimized);
4530
- popWarningContext$1();
4531
- return;
4682
+ if (shouldUpdateComponent(n1, n2, optimized)) {
4683
+ if (instance.asyncDep && !instance.asyncResolved) {
4684
+ pushWarningContext$1(n2);
4685
+ n2.el = n1.el;
4686
+ updateComponentPreRender(instance, n2, optimized);
4687
+ popWarningContext$1();
4688
+ return;
4689
+ } else {
4690
+ instance.next = n2;
4691
+ instance.effect.run();
4692
+ }
4532
4693
  } else {
4533
- instance.next = n2;
4534
- instance.effect.run();
4535
- }
4536
- else {
4537
4694
  n2.el = n1.el;
4538
4695
  instance.vnode = n2;
4539
4696
  }
@@ -4631,6 +4788,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4631
4788
  } else next = vnode;
4632
4789
  if (bu) invokeArrayFns(bu);
4633
4790
  if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
4791
+ if (next.ibu) next.ibu();
4634
4792
  toggleRecurse(instance, true);
4635
4793
  startMeasure(instance, `render`);
4636
4794
  const nextTree = renderComponentRoot$1(instance);
@@ -4643,7 +4801,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4643
4801
  next.el = nextTree.el;
4644
4802
  if (originNext === null) updateHOCHostEl(instance, nextTree.el);
4645
4803
  if (u) queuePostRenderEffect(u, void 0, parentSuspense);
4646
- if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), void 0, parentSuspense);
4804
+ if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
4805
+ vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
4806
+ next.iu && next.iu();
4807
+ }, void 0, parentSuspense);
4647
4808
  devtoolsComponentUpdated(instance);
4648
4809
  popWarningContext$1();
4649
4810
  }
@@ -4683,9 +4844,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4683
4844
  if (shapeFlag & 8) {
4684
4845
  if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
4685
4846
  if (c2 !== c1) hostSetElementText(container, c2);
4686
- } else if (prevShapeFlag & 16) if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4687
- else unmountChildren(c1, parentComponent, parentSuspense, true);
4688
- else {
4847
+ } else if (prevShapeFlag & 16) {
4848
+ if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4849
+ else unmountChildren(c1, parentComponent, parentSuspense, true);
4850
+ } else {
4689
4851
  if (prevShapeFlag & 8) hostSetElementText(container, "");
4690
4852
  if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4691
4853
  }
@@ -4784,15 +4946,17 @@ function baseCreateRenderer(options, createHydrationFns) {
4784
4946
  const anchorVNode = c2[nextIndex + 1];
4785
4947
  const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
4786
4948
  if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4787
- else if (moved) if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
4788
- else j--;
4949
+ else if (moved) {
4950
+ if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
4951
+ else j--;
4952
+ }
4789
4953
  }
4790
4954
  }
4791
4955
  };
4792
4956
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
4793
4957
  const { el, type, transition, children, shapeFlag } = vnode;
4794
- if (isVaporComponent(type) || type === VaporSlot) {
4795
- getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
4958
+ if (isVaporComponent(type) || type === VaporSlot$1) {
4959
+ getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
4796
4960
  return;
4797
4961
  }
4798
4962
  if (shapeFlag & 6) {
@@ -4817,54 +4981,37 @@ function baseCreateRenderer(options, createHydrationFns) {
4817
4981
  moveStaticNode(vnode, container, anchor);
4818
4982
  return;
4819
4983
  }
4820
- if (moveType !== 2 && shapeFlag & 1 && transition) if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
4821
- else {
4822
- const { leave, delayLeave, afterLeave } = transition;
4823
- const remove = () => {
4984
+ if (moveType !== 2 && shapeFlag & 1 && transition) {
4985
+ if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
4986
+ else performTransitionLeave(el, transition, () => {
4824
4987
  if (vnode.ctx.isUnmounted) hostRemove(el);
4825
4988
  else hostInsert(el, container, anchor);
4826
- };
4827
- const performLeave = () => {
4828
- const wasLeaving = el._isLeaving || !!el[leaveCbKey];
4829
- if (el._isLeaving) el[leaveCbKey](true);
4830
- if (transition.persisted && !wasLeaving) remove();
4831
- else leave(el, () => {
4832
- remove();
4833
- afterLeave && afterLeave();
4834
- });
4835
- };
4836
- if (delayLeave) delayLeave(el, remove, performLeave);
4837
- else performLeave();
4838
- }
4839
- else hostInsert(el, container, anchor);
4989
+ }, true, true);
4990
+ } else hostInsert(el, container, anchor);
4840
4991
  };
4841
4992
  const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
4842
4993
  const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
4843
- if (patchFlag === -2) optimized = false;
4994
+ if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
4844
4995
  if (ref != null) {
4845
4996
  const prevSub = setActiveSub();
4846
4997
  setRef(ref, null, parentSuspense, vnode, true);
4847
4998
  setActiveSub(prevSub);
4848
4999
  }
4849
- if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
5000
+ if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
4850
5001
  if (shapeFlag & 256) {
4851
- if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
5002
+ if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
4852
5003
  else parentComponent.ctx.deactivate(vnode);
4853
5004
  return;
4854
5005
  }
5006
+ if (shapeFlag & 6 && isVaporComponent(type)) {
5007
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
5008
+ return;
5009
+ }
4855
5010
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
4856
5011
  const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
4857
5012
  let vnodeHook;
4858
5013
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
4859
- if (shapeFlag & 6) if (isVaporComponent(type)) {
4860
- if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
4861
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
4862
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
4863
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
4864
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
4865
- }, void 0, parentSuspense);
4866
- return;
4867
- } else unmountComponent(vnode.component, parentSuspense, doRemove);
5014
+ if (shapeFlag & 6) unmountComponent(vnode.component, parentSuspense, doRemove);
4868
5015
  else {
4869
5016
  if (shapeFlag & 128) {
4870
5017
  vnode.suspense.unmount(parentSuspense, doRemove);
@@ -4874,8 +5021,8 @@ function baseCreateRenderer(options, createHydrationFns) {
4874
5021
  if (shapeFlag & 64) vnode.type.remove(vnode, parentComponent, parentSuspense, internals, doRemove);
4875
5022
  else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
4876
5023
  else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
4877
- if (type === VaporSlot) {
4878
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
5024
+ if (type === VaporSlot$1) {
5025
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
4879
5026
  return;
4880
5027
  }
4881
5028
  if (doRemove) remove(vnode);
@@ -4899,6 +5046,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4899
5046
  }
4900
5047
  if (type === Static) {
4901
5048
  removeStaticNode(vnode);
5049
+ if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
4902
5050
  return;
4903
5051
  }
4904
5052
  if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
@@ -4923,7 +5071,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4923
5071
  if (effect) {
4924
5072
  effect.stop();
4925
5073
  unmount(subTree, instance, parentSuspense, doRemove);
4926
- } else if (doRemove && subTree && instance.vnode.el) remove(subTree);
5074
+ } else if (instance.vnode.el && subTree) {
5075
+ subTree.transition = instance.vnode.transition;
5076
+ unmount(subTree, instance, parentSuspense, doRemove);
5077
+ }
4927
5078
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
4928
5079
  queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
4929
5080
  devtoolsComponentRemoved(instance);
@@ -4997,12 +5148,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
4997
5148
  return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
4998
5149
  }
4999
5150
  function toggleRecurse({ effect, job, vapor }, allowed) {
5000
- if (!vapor) if (allowed) {
5001
- effect.flags |= 128;
5002
- job.flags |= 2;
5003
- } else {
5004
- effect.flags &= -129;
5005
- job.flags &= -3;
5151
+ if (!vapor) {
5152
+ if (allowed) {
5153
+ effect.flags |= 128;
5154
+ job.flags |= 2;
5155
+ } else {
5156
+ effect.flags &= -129;
5157
+ job.flags &= -3;
5158
+ }
5006
5159
  }
5007
5160
  }
5008
5161
  function needTransition(parentSuspense, transition) {
@@ -5042,8 +5195,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
5042
5195
  }
5043
5196
  function locateNonHydratedAsyncRoot(instance) {
5044
5197
  const subComponent = instance.subTree && instance.subTree.component;
5045
- if (subComponent) if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
5046
- else return locateNonHydratedAsyncRoot(subComponent);
5198
+ if (subComponent) {
5199
+ if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
5200
+ else return locateNonHydratedAsyncRoot(subComponent);
5201
+ }
5047
5202
  }
5048
5203
  function invalidateMount(hooks) {
5049
5204
  if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
@@ -5062,13 +5217,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
5062
5217
  function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
5063
5218
  const performRemove = () => {
5064
5219
  remove();
5065
- if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
5220
+ if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
5066
5221
  };
5067
5222
  if (force || isElement && transition && !transition.persisted) {
5068
5223
  const { leave, delayLeave } = transition;
5069
5224
  const performLeave = () => {
5225
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
5070
5226
  if (el._isLeaving && force) el[leaveCbKey](true);
5071
- leave(el, performRemove);
5227
+ if (force && transition.persisted && !wasLeaving) remove();
5228
+ else leave(el, performRemove);
5072
5229
  };
5073
5230
  if (delayLeave) delayLeave(el, performRemove, performLeave);
5074
5231
  else performLeave();
@@ -5087,7 +5244,7 @@ function isVaporComponent(type) {
5087
5244
  /**
5088
5245
  * shared between vdom and vapor
5089
5246
  */
5090
- function getInheritedScopeIds(vnode, parentComponent) {
5247
+ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
5091
5248
  const inheritedScopeIds = [];
5092
5249
  let currentParent = parentComponent;
5093
5250
  let currentVNode = vnode;
@@ -5103,6 +5260,8 @@ function getInheritedScopeIds(vnode, parentComponent) {
5103
5260
  currentParent = currentParent.parent;
5104
5261
  } else break;
5105
5262
  }
5263
+ const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
5264
+ if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
5106
5265
  return inheritedScopeIds;
5107
5266
  }
5108
5267
  function resolveAsyncComponentPlaceholder(anchorVnode) {
@@ -5115,9 +5274,10 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
5115
5274
  //#region packages/runtime-core/src/components/Suspense.ts
5116
5275
  const isSuspense = (type) => type.__isSuspense;
5117
5276
  function queueEffectWithSuspense(fn, id, suspense) {
5118
- if (suspense && suspense.pendingBranch) if (isArray(fn)) suspense.effects.push(...fn);
5119
- else suspense.effects.push(fn);
5120
- else queuePostFlushCb(fn, id);
5277
+ if (suspense && suspense.pendingBranch) {
5278
+ if (isArray(fn)) suspense.effects.push(...fn);
5279
+ else suspense.effects.push(fn);
5280
+ } else queuePostFlushCb(fn, id);
5121
5281
  }
5122
5282
  //#endregion
5123
5283
  //#region packages/runtime-core/src/vnode.ts
@@ -5125,7 +5285,7 @@ const Fragment = Symbol.for("v-fgt");
5125
5285
  const Text = Symbol.for("v-txt");
5126
5286
  const Comment = Symbol.for("v-cmt");
5127
5287
  const Static = Symbol.for("v-stc");
5128
- const VaporSlot = Symbol.for("v-vps");
5288
+ const VaporSlot$1 = Symbol.for("v-vps");
5129
5289
  const blockStack = [];
5130
5290
  let currentBlock = null;
5131
5291
  function closeBlock() {
@@ -5153,7 +5313,7 @@ function setBlockTracking(value, inVOnce = false) {
5153
5313
  isBlockTreeEnabled += value;
5154
5314
  if (value < 0 && currentBlock && inVOnce) currentBlock.hasOnce = true;
5155
5315
  }
5156
- function isVNode$2(value) {
5316
+ function isVNode$3(value) {
5157
5317
  return value ? value.__v_isVNode === true : false;
5158
5318
  }
5159
5319
  function isSameVNodeType(n1, n2) {
@@ -5215,20 +5375,37 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
5215
5375
  if (shapeFlag & 128) type.normalize(vnode);
5216
5376
  } else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
5217
5377
  if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
5378
+ if (props && vnode.shapeFlag & 1) {
5379
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
5380
+ 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.`);
5381
+ }
5218
5382
  if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
5219
5383
  return vnode;
5220
5384
  }
5385
+ /**
5386
+ * dev only
5387
+ * Whether children would actually render something. Empty text and empty
5388
+ * arrays are ignored, mirroring the compiler's `node.children.length` check
5389
+ * for `v-html` / `v-text`.
5390
+ */
5391
+ function hasContentChildren(children) {
5392
+ if (isString(children)) return children !== "";
5393
+ if (isArray(children)) return children.length > 0;
5394
+ return false;
5395
+ }
5221
5396
  const createVNode = createVNodeWithArgsTransform;
5222
5397
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
5223
5398
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
5224
5399
  if (!type) warn$1(`Invalid vnode type when creating vnode: ${type}.`);
5225
5400
  type = Comment;
5226
5401
  }
5227
- if (isVNode$2(type)) {
5402
+ if (isVNode$3(type)) {
5228
5403
  const cloned = cloneVNode(type, props, true);
5229
5404
  if (children) normalizeChildren(cloned, children);
5230
- if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
5231
- else currentBlock.push(cloned);
5405
+ if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
5406
+ if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
5407
+ else currentBlock.push(cloned);
5408
+ }
5232
5409
  cloned.patchFlag = -2;
5233
5410
  return cloned;
5234
5411
  }
@@ -5288,7 +5465,10 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
5288
5465
  ce: vnode.ce,
5289
5466
  vi: vnode.vi,
5290
5467
  vs: cloneVaporSlotMeta(vnode),
5291
- vb: vnode.vb
5468
+ vb: vnode.vb,
5469
+ ibu: vnode.ibu,
5470
+ iu: vnode.iu,
5471
+ cacheIndex: vnode.cacheIndex
5292
5472
  };
5293
5473
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
5294
5474
  return cloned;
@@ -5298,8 +5478,7 @@ function cloneVaporSlotMeta(vnode) {
5298
5478
  if (!vaporSlot) return vaporSlot;
5299
5479
  const cloned = {
5300
5480
  slot: vaporSlot.slot,
5301
- fallback: vaporSlot.fallback,
5302
- outletFallback: vaporSlot.outletFallback
5481
+ outlets: vaporSlot.outlets
5303
5482
  };
5304
5483
  if (vnode.el) {
5305
5484
  cloned.state = vaporSlot.state;
@@ -5326,7 +5505,7 @@ function createTextVNode(text = " ", flag = 0) {
5326
5505
  function normalizeVNode$1(child) {
5327
5506
  if (child == null || typeof child === "boolean") return createVNode(Comment);
5328
5507
  else if (isArray(child)) return createVNode(Fragment, null, child.slice());
5329
- else if (isVNode$2(child)) return cloneIfMounted(child);
5508
+ else if (isVNode$3(child)) return cloneIfMounted(child);
5330
5509
  else return createVNode(Text, null, String(child));
5331
5510
  }
5332
5511
  function cloneIfMounted(child) {
@@ -5337,25 +5516,28 @@ function normalizeChildren(vnode, children) {
5337
5516
  const { shapeFlag } = vnode;
5338
5517
  if (children == null) children = null;
5339
5518
  else if (isArray(children)) type = 16;
5340
- else if (typeof children === "object") if (shapeFlag & 65) {
5341
- const slot = children.default;
5342
- if (slot) {
5343
- slot._c && (slot._d = false);
5344
- normalizeChildren(vnode, slot());
5345
- slot._c && (slot._d = true);
5346
- }
5347
- return;
5348
- } else {
5349
- type = 32;
5350
- const slotFlag = children._;
5351
- if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
5352
- else if (slotFlag === 3 && currentRenderingInstance) if (currentRenderingInstance.slots._ === 1) children._ = 1;
5353
- else {
5354
- children._ = 2;
5355
- vnode.patchFlag |= 1024;
5519
+ else if (typeof children === "object") {
5520
+ if (shapeFlag & 65) {
5521
+ const slot = children.default;
5522
+ if (slot) {
5523
+ slot._c && (slot._d = false);
5524
+ normalizeChildren(vnode, slot());
5525
+ slot._c && (slot._d = true);
5526
+ }
5527
+ return;
5528
+ } else {
5529
+ type = 32;
5530
+ const slotFlag = children._;
5531
+ if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
5532
+ else if (slotFlag === 3 && currentRenderingInstance) {
5533
+ if (currentRenderingInstance.slots._ === 1) children._ = 1;
5534
+ else {
5535
+ children._ = 2;
5536
+ vnode.patchFlag |= 1024;
5537
+ }
5538
+ }
5356
5539
  }
5357
- }
5358
- else if (isFunction(children)) {
5540
+ } else if (isFunction(children)) {
5359
5541
  if (shapeFlag & 65) {
5360
5542
  normalizeChildren(vnode, { default: children });
5361
5543
  return;
@@ -5404,6 +5586,7 @@ let currentInstance = null;
5404
5586
  * @internal
5405
5587
  */
5406
5588
  const getCurrentGenericInstance = () => currentInstance || currentRenderingInstance;
5589
+ const getCurrentInstance = () => currentInstance && !currentInstance.vapor ? currentInstance : currentRenderingInstance;
5407
5590
  let isInSSRComponentSetup = false;
5408
5591
  let setInSSRSetupState;
5409
5592
  /**
@@ -5431,9 +5614,19 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
5431
5614
  simpleSetCurrentInstance(instance);
5432
5615
  }
5433
5616
  };
5617
+ /**
5618
+ * Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
5619
+ * `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
5620
+ * verbatim instead of re-triggering the `instance.scope` default.
5621
+ * @internal
5622
+ */
5623
+ const restoreCurrentInstance = (prev) => {
5624
+ setCurrentScope(prev[1]);
5625
+ simpleSetCurrentInstance(prev[0]);
5626
+ };
5434
5627
  //#endregion
5435
5628
  //#region packages/runtime-core/src/component.ts
5436
- const emptyAppContext = /* @__PURE__ */ createAppContext();
5629
+ const emptyAppContext = /*@__PURE__*/ createAppContext();
5437
5630
  let uid = 0;
5438
5631
  function createComponentInstance$1(vnode, parent, suspense) {
5439
5632
  const type = vnode.type;
@@ -5553,7 +5746,7 @@ function setupStatefulComponent(instance, isSSR) {
5553
5746
  const setupResult = callWithErrorHandling(setup, instance, 0, [/* @__PURE__ */ shallowReadonly(instance.props), setupContext]);
5554
5747
  const isAsyncSetup = isPromise(setupResult);
5555
5748
  setActiveSub(prevSub);
5556
- setCurrentInstance(...prev);
5749
+ restoreCurrentInstance(prev);
5557
5750
  if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
5558
5751
  if (isAsyncSetup) {
5559
5752
  const unsetCurrentInstance = () => {
@@ -5561,7 +5754,12 @@ function setupStatefulComponent(instance, isSSR) {
5561
5754
  };
5562
5755
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
5563
5756
  if (isSSR) return setupResult.then((resolvedResult) => {
5564
- handleSetupResult(instance, resolvedResult, isSSR);
5757
+ setInSSRSetupState(true);
5758
+ try {
5759
+ handleSetupResult(instance, resolvedResult, isSSR);
5760
+ } finally {
5761
+ setInSSRSetupState(false);
5762
+ }
5565
5763
  }).catch((e) => {
5566
5764
  handleError(e, instance, 0);
5567
5765
  });
@@ -5573,10 +5771,11 @@ function setupStatefulComponent(instance, isSSR) {
5573
5771
  } else finishComponentSetup(instance, isSSR);
5574
5772
  }
5575
5773
  function handleSetupResult(instance, setupResult, isSSR) {
5576
- if (isFunction(setupResult)) if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
5577
- else instance.render = setupResult;
5578
- else if (isObject(setupResult)) {
5579
- if (isVNode$2(setupResult)) warn$1("setup() should not return VNodes directly - return a render function instead.");
5774
+ if (isFunction(setupResult)) {
5775
+ if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
5776
+ else instance.render = setupResult;
5777
+ } else if (isObject(setupResult)) {
5778
+ if (isVNode$3(setupResult)) warn$1("setup() should not return VNodes directly - return a render function instead.");
5580
5779
  instance.devtoolsRawSetupState = setupResult;
5581
5780
  instance.setupState = proxyRefs(setupResult);
5582
5781
  exposeSetupStateOnRenderContext(instance);
@@ -5594,13 +5793,15 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
5594
5793
  applyOptions(instance);
5595
5794
  } finally {
5596
5795
  setActiveSub(prevSub);
5597
- setCurrentInstance(...prevInstance);
5796
+ restoreCurrentInstance(prevInstance);
5598
5797
  }
5599
5798
  }
5600
- if (!Component.render && instance.render === NOOP && !isSSR) if (Component.template)
5799
+ if (!Component.render && instance.render === NOOP && !isSSR) {
5800
+ if (Component.template)
5601
5801
  /* v8 ignore start */
5602
- warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Use \"vue.esm-browser.js\" instead.");
5603
- else warn$1(`Component is missing template or render function: `, Component);
5802
+ warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Use \"vue.esm-browser.js\" instead.");
5803
+ else warn$1(`Component is missing template or render function: `, Component);
5804
+ }
5604
5805
  }
5605
5806
  const attrsProxyHandlers = {
5606
5807
  get(target, key) {
@@ -5663,14 +5864,13 @@ function getComponentPublicInstance(instance) {
5663
5864
  if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
5664
5865
  get(target, key) {
5665
5866
  if (key in target) return target[key];
5666
- else {
5867
+ else if (!instance.vapor) {
5667
5868
  const publicPropertiesMap = getPublicPropertiesMap();
5668
5869
  if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
5669
5870
  }
5670
5871
  },
5671
5872
  has(target, key) {
5672
- const publicPropertiesMap = getPublicPropertiesMap();
5673
- return key in target || key in publicPropertiesMap;
5873
+ return key in target || !instance.vapor && key in getPublicPropertiesMap();
5674
5874
  }
5675
5875
  }));
5676
5876
  else return instance.proxy;
@@ -5704,7 +5904,7 @@ const computed = (getterOrOptions, debugOptions) => {
5704
5904
  };
5705
5905
  //#endregion
5706
5906
  //#region packages/runtime-core/src/index.ts
5707
- const version = "3.6.0-rc.1";
5907
+ const version = "3.6.0-rc.10";
5708
5908
  const warn = warn$1;
5709
5909
  /**
5710
5910
  * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
@@ -5715,19 +5915,22 @@ const ssrUtils = {
5715
5915
  setupComponent: setupComponent$1,
5716
5916
  renderComponentRoot: renderComponentRoot$1,
5717
5917
  setCurrentRenderingInstance: setCurrentRenderingInstance$1,
5718
- isVNode: isVNode$2,
5918
+ isVNode: isVNode$3,
5719
5919
  normalizeVNode: normalizeVNode$1,
5720
5920
  getComponentPublicInstance,
5721
5921
  ensureValidVNode: ensureValidVNode$1,
5722
5922
  pushWarningContext: pushWarningContext$1,
5723
- popWarningContext: popWarningContext$1
5923
+ popWarningContext: popWarningContext$1,
5924
+ VaporSlot: VaporSlot$1,
5925
+ rawVaporSlotKey: rawVaporSlotKey$2,
5926
+ invokeSlotFallback: invokeSlotFallback$1
5724
5927
  };
5725
5928
  //#endregion
5726
5929
  //#region packages/runtime-dom/src/nodeOps.ts
5727
5930
  let policy = void 0;
5728
5931
  const tt = typeof window !== "undefined" && window.trustedTypes;
5729
5932
  if (tt) try {
5730
- policy = /* @__PURE__ */ tt.createPolicy("vue", { createHTML: (val) => val });
5933
+ policy = /*@__PURE__*/ tt.createPolicy("vue", { createHTML: (val) => val });
5731
5934
  } catch (e) {
5732
5935
  warn(`Error creating trusted types policy: ${e}`);
5733
5936
  }
@@ -5735,7 +5938,7 @@ const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) =>
5735
5938
  const svgNS = "http://www.w3.org/2000/svg";
5736
5939
  const mathmlNS = "http://www.w3.org/1998/Math/MathML";
5737
5940
  const doc = typeof document !== "undefined" ? document : null;
5738
- const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
5941
+ const templateContainer = doc && /*@__PURE__*/ doc.createElement("template");
5739
5942
  const nodeOps = {
5740
5943
  insert: (child, parent, anchor) => {
5741
5944
  parent.insertBefore(child, anchor || null);
@@ -5810,14 +6013,15 @@ const vShow = {
5810
6013
  },
5811
6014
  updated(el, { value, oldValue }, { transition }) {
5812
6015
  if (!value === !oldValue) return;
5813
- if (transition) if (value) {
5814
- transition.beforeEnter(el);
5815
- setDisplay(el, true);
5816
- transition.enter(el);
5817
- } else transition.leave(el, () => {
5818
- setDisplay(el, false);
5819
- });
5820
- else setDisplay(el, value);
6016
+ if (transition) {
6017
+ if (value) {
6018
+ transition.beforeEnter(el);
6019
+ setDisplay(el, true);
6020
+ transition.enter(el);
6021
+ } else transition.leave(el, () => {
6022
+ setDisplay(el, false);
6023
+ });
6024
+ } else setDisplay(el, value);
5821
6025
  },
5822
6026
  beforeUnmount(el, { value }) {
5823
6027
  setDisplay(el, value);
@@ -5843,11 +6047,13 @@ function patchStyle(el, prev, next) {
5843
6047
  const isCssString = isString(next);
5844
6048
  let hasControlledDisplay = false;
5845
6049
  if (next && !isCssString) {
5846
- if (prev) if (!isString(prev)) {
5847
- for (const key in prev) if (next[key] == null) setStyle(style, key, "");
5848
- } else for (const prevStyle of prev.split(";")) {
5849
- const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
5850
- if (next[key] == null) setStyle(style, key, "");
6050
+ if (prev) {
6051
+ if (!isString(prev)) {
6052
+ for (const key in prev) if (next[key] == null) setStyle(style, key, "");
6053
+ } else for (const prevStyle of prev.split(";")) {
6054
+ const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
6055
+ if (next[key] == null) setStyle(style, key, "");
6056
+ }
5851
6057
  }
5852
6058
  for (const key in next) {
5853
6059
  if (key === "display") hasControlledDisplay = true;
@@ -5863,7 +6069,11 @@ function patchStyle(el, prev, next) {
5863
6069
  style.cssText = next;
5864
6070
  hasControlledDisplay = displayRE.test(next);
5865
6071
  }
5866
- } else if (prev) el.removeAttribute("style");
6072
+ } else if (prev) {
6073
+ const cssVarText = style[CSS_VAR_TEXT];
6074
+ if (cssVarText) style.cssText = cssVarText;
6075
+ else el.removeAttribute("style");
6076
+ }
5867
6077
  if (vShowOriginalDisplay in el) {
5868
6078
  el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
5869
6079
  if (el[vShowHidden]) style.display = "none";
@@ -5876,8 +6086,10 @@ function setStyle(style, name, rawVal) {
5876
6086
  else {
5877
6087
  const val = rawVal == null ? "" : String(rawVal);
5878
6088
  if (semicolonRE.test(val)) warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
5879
- if (name.startsWith("--")) style.setProperty(name, val);
5880
- else {
6089
+ if (name.startsWith("--")) {
6090
+ if (importantRE.test(val)) style.setProperty(name, val.replace(importantRE, ""), "important");
6091
+ else style.setProperty(name, val);
6092
+ } else {
5881
6093
  const prefixed = autoPrefix(style, name);
5882
6094
  if (importantRE.test(val)) style.setProperty(hyphenate(prefixed), val.replace(importantRE, ""), "important");
5883
6095
  else style[prefixed] = val;
@@ -5914,9 +6126,10 @@ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
5914
6126
  //#region packages/runtime-dom/src/modules/attrs.ts
5915
6127
  const xlinkNS = "http://www.w3.org/1999/xlink";
5916
6128
  function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
5917
- if (isSVG && key.startsWith("xlink:")) if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
5918
- else el.setAttributeNS(xlinkNS, key, value);
5919
- else if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
6129
+ if (isSVG && key.startsWith("xlink:")) {
6130
+ if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
6131
+ else el.setAttributeNS(xlinkNS, key, value);
6132
+ } else if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
5920
6133
  else el.setAttribute(key, isBoolean ? "" : isSymbol(value) ? String(value) : value);
5921
6134
  }
5922
6135
  //#endregion
@@ -5989,7 +6202,7 @@ function parseEventName(name) {
5989
6202
  return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
5990
6203
  }
5991
6204
  let cachedNow = 0;
5992
- const p = /* @__PURE__ */ Promise.resolve();
6205
+ const p = /*@__PURE__*/ Promise.resolve();
5993
6206
  const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
5994
6207
  function createInvoker(initialValue, instance) {
5995
6208
  const invoker = (e) => {
@@ -6071,13 +6284,22 @@ function onCompositionEnd(e) {
6071
6284
  }
6072
6285
  }
6073
6286
  const assignKey = Symbol("_assign");
6287
+ const initialValueKey = Symbol("_initialValue");
6074
6288
  const vModelText = {
6075
6289
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
6290
+ if (el.parentNode) {
6291
+ if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
6292
+ else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
6293
+ }
6076
6294
  el[assignKey] = getModelAssigner(vnode);
6077
6295
  vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
6078
6296
  },
6079
- mounted(el, { value }) {
6080
- el.value = value == null ? "" : value;
6297
+ mounted(el, { value, modifiers: { trim, number } }) {
6298
+ const newValue = value == null ? "" : value;
6299
+ const initialValue = el[initialValueKey];
6300
+ delete el[initialValueKey];
6301
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
6302
+ else el.value = newValue;
6081
6303
  },
6082
6304
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
6083
6305
  el[assignKey] = getModelAssigner(vnode);
@@ -6212,19 +6434,39 @@ const vModelSelectInit = (el, value, number, set) => {
6212
6434
  el._modelValue = value;
6213
6435
  addEventListener(el, "change", () => {
6214
6436
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
6215
- (set || el[assignKey])(el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
6216
- el._assigning = true;
6217
- nextTick(() => {
6218
- el._assigning = false;
6219
- });
6437
+ const multiple = el.multiple;
6438
+ const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
6439
+ const pending = el._pendingValue = [multiple, multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue];
6440
+ try {
6441
+ (set || el[assignKey])(assignedValue);
6442
+ } finally {
6443
+ nextTick(() => {
6444
+ if (el._pendingValue === pending) el._pendingValue = void 0;
6445
+ });
6446
+ }
6220
6447
  });
6221
6448
  };
6449
+ function isSameSelectValue(value, assignedValue, multiple) {
6450
+ if (!multiple) return looseEqual(value, assignedValue);
6451
+ if (isArray(value)) return looseEqual(value, assignedValue);
6452
+ if (isSet(value)) {
6453
+ if (value.size !== assignedValue.length) return false;
6454
+ for (const item of assignedValue) if (!value.has(item)) return false;
6455
+ return true;
6456
+ }
6457
+ return false;
6458
+ }
6222
6459
  /**
6223
6460
  * @internal
6224
6461
  */
6225
6462
  const vModelSetSelected = (el, value) => {
6226
6463
  el._modelValue = value;
6227
- if (el._assigning) return;
6464
+ const pending = el._pendingValue;
6465
+ el._pendingValue = void 0;
6466
+ if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
6467
+ setSelected(el, value);
6468
+ };
6469
+ function setSelected(el, value) {
6228
6470
  const isMultiple = el.multiple;
6229
6471
  const isArrayValue = isArray(value);
6230
6472
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -6234,18 +6476,19 @@ const vModelSetSelected = (el, value) => {
6234
6476
  for (let i = 0, l = el.options.length; i < l; i++) {
6235
6477
  const option = el.options[i];
6236
6478
  const optionValue = getValue(option);
6237
- if (isMultiple) if (isArrayValue) {
6238
- const optionType = typeof optionValue;
6239
- if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
6240
- else option.selected = looseIndexOf(value, optionValue) > -1;
6241
- } else option.selected = value.has(optionValue);
6242
- else if (looseEqual(getValue(option), value)) {
6479
+ if (isMultiple) {
6480
+ if (isArrayValue) {
6481
+ const optionType = typeof optionValue;
6482
+ if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
6483
+ else option.selected = looseIndexOf(value, optionValue) > -1;
6484
+ } else option.selected = value.has(optionValue);
6485
+ } else if (looseEqual(getValue(option), value)) {
6243
6486
  if (el.selectedIndex !== i) el.selectedIndex = i;
6244
6487
  return;
6245
6488
  }
6246
6489
  }
6247
6490
  if (!isMultiple && el.selectedIndex !== -1) el.selectedIndex = -1;
6248
- };
6491
+ }
6249
6492
  /**
6250
6493
  * @internal retrieve raw value set via :value bindings
6251
6494
  */
@@ -6308,7 +6551,7 @@ function initVModelForSSR() {
6308
6551
  }
6309
6552
  //#endregion
6310
6553
  //#region packages/runtime-dom/src/index.ts
6311
- const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
6554
+ const rendererOptions = /*@__PURE__*/ extend({ patchProp }, nodeOps);
6312
6555
  let renderer;
6313
6556
  function ensureRenderer() {
6314
6557
  return renderer || (renderer = createRenderer(rendererOptions));
@@ -6392,7 +6635,7 @@ const initDirectivesForSSR = () => {
6392
6635
  };
6393
6636
  //#endregion
6394
6637
  //#region packages/server-renderer/src/helpers/ssrRenderAttrs.ts
6395
- const shouldIgnoreProp = /* @__PURE__ */ makeMap(`,key,ref,innerHTML,textContent,ref_key,ref_for`);
6638
+ const shouldIgnoreProp = /*@__PURE__*/ makeMap(`,key,ref,innerHTML,textContent,ref_key,ref_for`);
6396
6639
  function ssrRenderAttrs(props, tag) {
6397
6640
  let ret = "";
6398
6641
  for (let key in props) {
@@ -6410,7 +6653,7 @@ function ssrRenderAttrs(props, tag) {
6410
6653
  function ssrRenderDynamicAttr(key, value, tag) {
6411
6654
  if (!isRenderableAttrValue(value)) return ``;
6412
6655
  const attrKey = tag && (tag.indexOf("-") > 0 || isSVGTag(tag)) ? key : propsToAttrMap[key] || key.toLowerCase();
6413
- if (isBooleanAttr(attrKey)) return includeBooleanAttr(value) ? ` ${attrKey}` : ``;
6656
+ if (isBooleanAttr(attrKey) || attrKey === "hidden" && (typeof value === "boolean" || typeof value === "number")) return includeBooleanAttr(value) ? ` ${attrKey}` : ``;
6414
6657
  else if (isSSRSafeAttrName(attrKey)) return value === "" ? ` ${attrKey}` : ` ${attrKey}="${escapeHtml(value)}"`;
6415
6658
  else {
6416
6659
  console.warn(`[@vue/server-renderer] Skipped rendering unsafe attribute name: ${attrKey}`);
@@ -6439,58 +6682,76 @@ function ssrResetCssVars(raw) {
6439
6682
  return raw;
6440
6683
  }
6441
6684
  //#endregion
6442
- //#region packages/server-renderer/src/helpers/ssrRenderComponent.ts
6443
- function ssrRenderComponent(comp, props = null, children = null, parentComponent = null, slotScopeId) {
6444
- if (isString(comp)) {
6445
- const { getBuffer, push } = createBuffer();
6446
- renderVNode(push, createVNode(comp, props, children), parentComponent, slotScopeId);
6447
- return getBuffer();
6448
- }
6449
- return renderComponentVNode(createVNode(comp, props, children), parentComponent, slotScopeId);
6450
- }
6451
- //#endregion
6452
6685
  //#region packages/server-renderer/src/helpers/ssrRenderSlot.ts
6453
- const { ensureValidVNode } = ssrUtils;
6686
+ const { ensureValidVNode, rawVaporSlotKey: rawVaporSlotKey$1 } = ssrUtils;
6687
+ let vaporSlots = 0;
6454
6688
  function ssrRenderSlot(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId) {
6455
- push(`<!--[-->`);
6456
6689
  ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId);
6457
- push(`<!--]-->`);
6458
6690
  }
6459
6691
  function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId, transition) {
6460
6692
  const slotFn = slots[slotName];
6693
+ let fallback = false;
6461
6694
  if (slotFn) {
6695
+ if (slotFn[rawVaporSlotKey$1]) vaporSlots++;
6696
+ const before = vaporSlots;
6462
6697
  const slotBuffer = [];
6463
6698
  const bufferedPush = (item) => {
6464
6699
  slotBuffer.push(item);
6465
6700
  };
6466
- const ret = slotFn(slotProps, bufferedPush, parentComponent, slotScopeId ? " " + slotScopeId : "");
6701
+ const ret = slotFn(slotProps || {}, bufferedPush, parentComponent, slotScopeId ? " " + slotScopeId : "");
6702
+ let vnodes;
6467
6703
  if (isArray(ret)) {
6468
- const validSlotContent = ensureValidVNode(ret);
6469
- if (validSlotContent) renderVNodeChildren(push, validSlotContent, parentComponent, slotScopeId);
6704
+ vnodes = ensureValidVNode(ret);
6705
+ if (vnodes && isVaporSlotContent(vnodes)) {
6706
+ renderVNodeChildren(bufferedPush, vnodes, parentComponent, slotScopeId);
6707
+ vnodes = void 0;
6708
+ }
6709
+ }
6710
+ if (vnodes !== void 0) {
6711
+ if (!transition) {
6712
+ fallback = !vnodes && !!fallbackRenderFn;
6713
+ push(fallback ? `<!--(-->` : `<!--[-->`);
6714
+ }
6715
+ if (vnodes) renderVNodeChildren(push, vnodes, parentComponent, slotScopeId);
6470
6716
  else if (fallbackRenderFn) fallbackRenderFn();
6471
6717
  else if (transition) push(`<!---->`);
6472
6718
  } else {
6473
6719
  let isEmptySlot = true;
6474
- if (transition) isEmptySlot = false;
6720
+ const owner = getCurrentInstance();
6721
+ if (transition || !(owner && owner.type.__vapor) && !fallbackRenderFn && vaporSlots !== before) isEmptySlot = false;
6475
6722
  else for (let i = 0; i < slotBuffer.length; i++) if (!isComment(slotBuffer[i])) {
6476
6723
  isEmptySlot = false;
6477
6724
  break;
6478
6725
  }
6726
+ if (!transition) {
6727
+ fallback = isEmptySlot && !!fallbackRenderFn;
6728
+ push(fallback ? `<!--(-->` : `<!--[-->`);
6729
+ }
6479
6730
  if (isEmptySlot) {
6480
6731
  if (fallbackRenderFn) fallbackRenderFn();
6481
6732
  } else {
6482
6733
  let start = 0;
6483
6734
  let end = slotBuffer.length;
6484
- if (transition && slotBuffer[0] === "<!--[-->" && slotBuffer[end - 1] === "<!--]-->") {
6485
- start++;
6486
- end--;
6735
+ if (transition) {
6736
+ const first = slotBuffer[0];
6737
+ if ((first === "<!--[-->" || first === "<!--(-->") && slotBuffer[end - 1] === (first === "<!--(-->" ? "<!--)-->" : "<!--]-->")) {
6738
+ start++;
6739
+ end--;
6740
+ }
6487
6741
  }
6488
6742
  if (start < end) for (let i = start; i < end; i++) push(slotBuffer[i]);
6489
6743
  else if (transition) push(`<!---->`);
6490
6744
  }
6491
6745
  }
6492
- } else if (fallbackRenderFn) fallbackRenderFn();
6493
- else if (transition) push(`<!---->`);
6746
+ } else {
6747
+ if (!transition) {
6748
+ fallback = !!fallbackRenderFn;
6749
+ push(fallback ? `<!--(-->` : `<!--[-->`);
6750
+ }
6751
+ if (fallbackRenderFn) fallbackRenderFn();
6752
+ else if (transition) push(`<!---->`);
6753
+ }
6754
+ if (!transition) push(fallback ? `<!--)-->` : `<!--]-->`);
6494
6755
  }
6495
6756
  const commentTestRE = /^<!--[\s\S]*-->$/;
6496
6757
  const commentRE = /<!--[^]*?-->/gm;
@@ -6500,6 +6761,16 @@ function isComment(item) {
6500
6761
  return !item.replace(commentRE, "").trim();
6501
6762
  }
6502
6763
  //#endregion
6764
+ //#region packages/server-renderer/src/helpers/ssrRenderComponent.ts
6765
+ function ssrRenderComponent(comp, props = null, children = null, parentComponent = null, slotScopeId) {
6766
+ if (isString(comp)) {
6767
+ const { getBuffer, push } = createBuffer();
6768
+ renderVNode(push, createVNode(comp, props, children), parentComponent, slotScopeId);
6769
+ return getBuffer();
6770
+ }
6771
+ return renderComponentVNode(createVNode(comp, props, children), parentComponent, slotScopeId);
6772
+ }
6773
+ //#endregion
6503
6774
  //#region packages/server-renderer/src/helpers/ssrRenderTeleport.ts
6504
6775
  function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) {
6505
6776
  parentPush("<!--teleport start-->");
@@ -6537,14 +6808,16 @@ function ssrRenderList(source, renderItem) {
6537
6808
  return;
6538
6809
  }
6539
6810
  for (let i = 0; i < source; i++) renderItem(i + 1, i);
6540
- } else if (isObject(source)) if (source[Symbol.iterator]) {
6541
- let i = 0;
6542
- for (const item of source) renderItem(item, i++);
6543
- } else {
6544
- const keys = Object.keys(source);
6545
- for (let i = 0, l = keys.length; i < l; i++) {
6546
- const key = keys[i];
6547
- renderItem(source[key], key, i);
6811
+ } else if (isObject(source)) {
6812
+ if (source[Symbol.iterator]) {
6813
+ let i = 0;
6814
+ for (const item of source) renderItem(item, i++);
6815
+ } else {
6816
+ const keys = Object.keys(source);
6817
+ for (let i = 0, l = keys.length; i < l; i++) {
6818
+ const key = keys[i];
6819
+ renderItem(source[key], key, i);
6820
+ }
6548
6821
  }
6549
6822
  }
6550
6823
  }
@@ -6595,7 +6868,7 @@ function ssrCompile(template, instance) {
6595
6868
  }
6596
6869
  //#endregion
6597
6870
  //#region packages/server-renderer/src/render.ts
6598
- const { createComponentInstance, setCurrentRenderingInstance, setupComponent, renderComponentRoot, normalizeVNode, pushWarningContext, popWarningContext } = ssrUtils;
6871
+ const { createComponentInstance, setCurrentRenderingInstance, setupComponent, renderComponentRoot, isVNode: isVNode$2, normalizeVNode, pushWarningContext, popWarningContext, VaporSlot, rawVaporSlotKey, invokeSlotFallback } = ssrUtils;
6599
6872
  function cleanupContext(context) {
6600
6873
  let firstError;
6601
6874
  if (context.__watcherHandles) {
@@ -6635,7 +6908,41 @@ function createBuffer() {
6635
6908
  }
6636
6909
  };
6637
6910
  }
6911
+ const vaporOutlets = /* @__PURE__ */ new WeakMap();
6912
+ const vaporInterface = { attachSlotOutlet(content, fallback, owner) {
6913
+ const lone = isVaporSlotContent(content);
6914
+ if (lone) vaporOutlets.set(content, {
6915
+ fallback,
6916
+ owner
6917
+ });
6918
+ return lone;
6919
+ } };
6920
+ function isVaporSlotContent(children) {
6921
+ const lone = findVaporSlot(children);
6922
+ vaporSlot = null;
6923
+ return lone;
6924
+ }
6925
+ let vaporSlot = null;
6926
+ function findVaporSlot(children) {
6927
+ for (let i = 0; i < children.length; i++) {
6928
+ const child = children[i];
6929
+ if (!isVNode$2(child)) return false;
6930
+ if (child.type === VaporSlot) {
6931
+ if (vaporSlot) return false;
6932
+ vaporSlot = child;
6933
+ } else if (child.type === Fragment) {
6934
+ if (child.patchFlag > 0 && child.patchFlag & 384 || !findVaporSlot(child.children)) return false;
6935
+ } else if (child.type !== Comment) return false;
6936
+ }
6937
+ return true;
6938
+ }
6638
6939
  function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
6940
+ const ctx = vnode.ctx;
6941
+ if (vnode.shapeFlag & 32 && ctx && ctx.type.__vapor) {
6942
+ const slots = vnode.children;
6943
+ for (const name in slots) if (isFunction(slots[name])) slots[name][rawVaporSlotKey] = slots[name];
6944
+ if (!ctx.appContext.vapor) ctx.appContext.vapor = vaporInterface;
6945
+ }
6639
6946
  const instance = vnode.component = createComponentInstance(vnode, parentComponent, null);
6640
6947
  const context = instance.appContext.provides[ssrContextKey];
6641
6948
  if (context) (context.__instanceScopes || (context.__instanceScopes = [])).push(instance.scope);
@@ -6699,7 +7006,8 @@ function renderComponentSubTree(instance, slotScopeId) {
6699
7006
  }
6700
7007
  } else if (instance.render && instance.render !== NOOP) renderVNode(push, instance.subTree = renderComponentRoot(instance), instance, slotScopeId);
6701
7008
  else {
6702
- warn(`Component ${comp.name || comp.__file || `<Anonymous>`} is missing template or render function.`);
7009
+ const componentName = comp.name || comp.__file || `<Anonymous>`;
7010
+ warn(`Component ${componentName} is missing template or render function.`);
6703
7011
  push(`<!---->`);
6704
7012
  }
6705
7013
  }
@@ -6719,12 +7027,25 @@ function renderVNode(push, vnode, parentComponent, slotScopeId) {
6719
7027
  case Static:
6720
7028
  push(children);
6721
7029
  break;
6722
- case Fragment:
7030
+ case Fragment: {
6723
7031
  if (vnode.slotScopeIds) slotScopeId = (slotScopeId ? slotScopeId + " " : "") + vnode.slotScopeIds.join(" ");
6724
- push(`<!--[-->`);
7032
+ const outlet = vnode.vo && vaporOutlets.get(children);
7033
+ if (outlet) {
7034
+ renderVaporOutlet(push, (_, push) => renderVNodeChildren(push, children, parentComponent, slotScopeId), null, outlet, parentComponent, slotScopeId);
7035
+ break;
7036
+ }
7037
+ const isFallback = shapeFlag & 1024;
7038
+ push(isFallback ? `<!--(-->` : `<!--[-->`);
6725
7039
  renderVNodeChildren(push, children, parentComponent, slotScopeId);
6726
- push(`<!--]-->`);
7040
+ push(isFallback ? `<!--)-->` : `<!--]-->`);
7041
+ break;
7042
+ }
7043
+ case VaporSlot: {
7044
+ if (vnode.slotScopeIds) slotScopeId = (slotScopeId ? slotScopeId + " " : "") + vnode.slotScopeIds.join(" ");
7045
+ const { slot, outlets } = vnode.vs;
7046
+ renderVaporOutlet(push, slot, vnode.props, outlets && outlets[0], parentComponent, slotScopeId);
6727
7047
  break;
7048
+ }
6728
7049
  default: if (shapeFlag & 1) renderElementVNode(push, vnode, parentComponent, slotScopeId);
6729
7050
  else if (shapeFlag & 6) push(renderComponentVNode(vnode, parentComponent, slotScopeId));
6730
7051
  else if (shapeFlag & 64) renderTeleportVNode(push, vnode, parentComponent, slotScopeId);
@@ -6732,6 +7053,11 @@ function renderVNode(push, vnode, parentComponent, slotScopeId) {
6732
7053
  else warn("[@vue/server-renderer] Invalid VNode type:", type, `(${typeof type})`);
6733
7054
  }
6734
7055
  }
7056
+ function renderVaporOutlet(push, slot, props, outlet, parentComponent, slotScopeId) {
7057
+ const prev = setCurrentRenderingInstance(parentComponent);
7058
+ ssrRenderSlot({ default: slot }, "default", props, outlet ? () => renderVNodeChildren(push, invokeSlotFallback(outlet.fallback, outlet.owner), parentComponent, slotScopeId) : null, push, parentComponent, slotScopeId);
7059
+ setCurrentRenderingInstance(prev);
7060
+ }
6735
7061
  function renderVNodeChildren(push, children, parentComponent, slotScopeId) {
6736
7062
  for (let i = 0; i < children.length; i++) renderVNode(push, normalizeVNode(children[i]), parentComponent, slotScopeId);
6737
7063
  }