@vue/server-renderer 3.6.0-rc.5 → 3.6.0-rc.7

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.5
2
+ * @vue/server-renderer v3.6.0-rc.7
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) => {
@@ -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,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];
@@ -309,6 +309,21 @@ function looseCompareArrays(a, b) {
309
309
  for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
310
310
  return equal;
311
311
  }
312
+ function looseCompareCollections(a, b) {
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])) {
319
+ index = i;
320
+ break;
321
+ }
322
+ if (index < 0) return false;
323
+ matched[index] = 1;
324
+ }
325
+ return true;
326
+ }
312
327
  function looseEqual(a, b) {
313
328
  if (a === b) return true;
314
329
  let aValidType = isDate(a);
@@ -324,6 +339,12 @@ function looseEqual(a, b) {
324
339
  bValidType = isObject(b);
325
340
  if (aValidType || bValidType) {
326
341
  if (!aValidType || !bValidType) return false;
342
+ aValidType = isMap(a);
343
+ bValidType = isMap(b);
344
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
345
+ aValidType = isSet(a);
346
+ bValidType = isSet(b);
347
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
327
348
  if (Object.keys(a).length !== Object.keys(b).length) return false;
328
349
  for (const key in a) {
329
350
  const aHasKey = a.hasOwnProperty(key);
@@ -770,9 +791,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
770
791
  if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
771
792
  }
772
793
  break;
773
- case "set":
774
- if (isMap(target)) run(depsMap.get(ITERATE_KEY));
775
- break;
794
+ case "set": if (isMap(target)) run(depsMap.get(ITERATE_KEY));
776
795
  }
777
796
  }
778
797
  }
@@ -965,8 +984,8 @@ function noTracking(self, method, args = []) {
965
984
  }
966
985
  //#endregion
967
986
  //#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));
987
+ const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
988
+ const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
970
989
  function hasOwnProperty(key) {
971
990
  if (!isSymbol(key)) key = String(key);
972
991
  const obj = /* @__PURE__ */ toRaw(this);
@@ -1021,12 +1040,14 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
1021
1040
  oldValue = /* @__PURE__ */ toRaw(oldValue);
1022
1041
  value = /* @__PURE__ */ toRaw(value);
1023
1042
  }
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;
1043
+ if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
1044
+ if (isOldValueReadonly) {
1045
+ warn$2(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
1046
+ return true;
1047
+ } else {
1048
+ oldValue.value = value;
1049
+ return true;
1050
+ }
1030
1051
  }
1031
1052
  }
1032
1053
  const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
@@ -1067,10 +1088,10 @@ var ReadonlyReactiveHandler = class extends BaseReactiveHandler {
1067
1088
  return true;
1068
1089
  }
1069
1090
  };
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);
1091
+ const mutableHandlers = /*@__PURE__*/ new MutableReactiveHandler();
1092
+ const readonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler();
1093
+ const shallowReactiveHandlers = /*@__PURE__*/ new MutableReactiveHandler(true);
1094
+ const shallowReadonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler(true);
1074
1095
  //#endregion
1075
1096
  //#region packages/reactivity/src/collectionHandlers.ts
1076
1097
  const toShallow = (value) => value;
@@ -1221,10 +1242,10 @@ function createInstrumentationGetter(isReadonly, shallow) {
1221
1242
  return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
1222
1243
  };
1223
1244
  }
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) };
1245
+ const mutableCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, false) };
1246
+ const shallowCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, true) };
1247
+ const readonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, false) };
1248
+ const shallowReadonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, true) };
1228
1249
  function checkIdentityKeys(target, has, key) {
1229
1250
  const rawKey = /* @__PURE__ */ toRaw(key);
1230
1251
  if (rawKey !== key && has.call(target, rawKey)) {
@@ -1249,7 +1270,7 @@ function targetTypeMap(rawType) {
1249
1270
  default: return 0;
1250
1271
  }
1251
1272
  }
1252
- /* @__NO_SIDE_EFFECTS__ */
1273
+ /*@__NO_SIDE_EFFECTS__*/
1253
1274
  function reactive(target) {
1254
1275
  if (/* @__PURE__ */ isReadonly(target)) return target;
1255
1276
  return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
@@ -1284,7 +1305,7 @@ function reactive(target) {
1284
1305
  * @param target - The source object.
1285
1306
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreactive}
1286
1307
  */
1287
- /* @__NO_SIDE_EFFECTS__ */
1308
+ /*@__NO_SIDE_EFFECTS__*/
1288
1309
  function shallowReactive(target) {
1289
1310
  return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
1290
1311
  }
@@ -1317,7 +1338,7 @@ function shallowReactive(target) {
1317
1338
  * @param target - The source object.
1318
1339
  * @see {@link https://vuejs.org/api/reactivity-core.html#readonly}
1319
1340
  */
1320
- /* @__NO_SIDE_EFFECTS__ */
1341
+ /*@__NO_SIDE_EFFECTS__*/
1321
1342
  function readonly(target) {
1322
1343
  return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
1323
1344
  }
@@ -1351,7 +1372,7 @@ function readonly(target) {
1351
1372
  * @param target - The source object.
1352
1373
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreadonly}
1353
1374
  */
1354
- /* @__NO_SIDE_EFFECTS__ */
1375
+ /*@__NO_SIDE_EFFECTS__*/
1355
1376
  function shallowReadonly(target) {
1356
1377
  return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
1357
1378
  }
@@ -1388,7 +1409,7 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
1388
1409
  * @param value - The value to check.
1389
1410
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#isreactive}
1390
1411
  */
1391
- /* @__NO_SIDE_EFFECTS__ */
1412
+ /*@__NO_SIDE_EFFECTS__*/
1392
1413
  function isReactive(value) {
1393
1414
  if (/* @__PURE__ */ isReadonly(value)) return /* @__PURE__ */ isReactive(value["__v_raw"]);
1394
1415
  return !!(value && value["__v_isReactive"]);
@@ -1404,11 +1425,11 @@ function isReactive(value) {
1404
1425
  * @param value - The value to check.
1405
1426
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#isreadonly}
1406
1427
  */
1407
- /* @__NO_SIDE_EFFECTS__ */
1428
+ /*@__NO_SIDE_EFFECTS__*/
1408
1429
  function isReadonly(value) {
1409
1430
  return !!(value && value["__v_isReadonly"]);
1410
1431
  }
1411
- /* @__NO_SIDE_EFFECTS__ */
1432
+ /*@__NO_SIDE_EFFECTS__*/
1412
1433
  function isShallow(value) {
1413
1434
  return !!(value && value["__v_isShallow"]);
1414
1435
  }
@@ -1419,7 +1440,7 @@ function isShallow(value) {
1419
1440
  * @param value - The value to check.
1420
1441
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#isproxy}
1421
1442
  */
1422
- /* @__NO_SIDE_EFFECTS__ */
1443
+ /*@__NO_SIDE_EFFECTS__*/
1423
1444
  function isProxy(value) {
1424
1445
  return value ? !!value["__v_raw"] : false;
1425
1446
  }
@@ -1446,7 +1467,7 @@ function isProxy(value) {
1446
1467
  * @param observed - The object for which the "raw" value is requested.
1447
1468
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#toraw}
1448
1469
  */
1449
- /* @__NO_SIDE_EFFECTS__ */
1470
+ /*@__NO_SIDE_EFFECTS__*/
1450
1471
  function toRaw(observed) {
1451
1472
  const raw = observed && observed["__v_raw"];
1452
1473
  return raw ? /* @__PURE__ */ toRaw(raw) : observed;
@@ -1495,7 +1516,7 @@ const toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value)
1495
1516
  const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
1496
1517
  //#endregion
1497
1518
  //#region packages/reactivity/src/ref.ts
1498
- /* @__NO_SIDE_EFFECTS__ */
1519
+ /*@__NO_SIDE_EFFECTS__*/
1499
1520
  function isRef(r) {
1500
1521
  return r ? r["__v_isRef"] === true : false;
1501
1522
  }
@@ -1595,10 +1616,12 @@ var ReactiveEffect = class {
1595
1616
  get dirty() {
1596
1617
  const flags = this.flags;
1597
1618
  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;
1619
+ if (flags & 32) {
1620
+ if (checkDirty(this.deps, this)) {
1621
+ this.flags = flags | 16;
1622
+ return true;
1623
+ } else this.flags = flags & -33;
1624
+ }
1602
1625
  return false;
1603
1626
  }
1604
1627
  };
@@ -1707,10 +1730,12 @@ var ComputedRefImpl = class {
1707
1730
  get _dirty() {
1708
1731
  const flags = this.flags;
1709
1732
  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;
1733
+ if (flags & 32) {
1734
+ if (checkDirty(this.deps, this)) {
1735
+ this.flags = flags | 16;
1736
+ return true;
1737
+ } else this.flags = flags & -33;
1738
+ }
1714
1739
  return false;
1715
1740
  }
1716
1741
  /**
@@ -1771,7 +1796,7 @@ var ComputedRefImpl = class {
1771
1796
  }
1772
1797
  };
1773
1798
  setupOnTrigger(ComputedRefImpl);
1774
- /* @__NO_SIDE_EFFECTS__ */
1799
+ /*@__NO_SIDE_EFFECTS__*/
1775
1800
  function computed$1(getterOrOptions, debugOptions, isSSR = false) {
1776
1801
  let getter;
1777
1802
  let setter;
@@ -1830,25 +1855,26 @@ var WatcherEffect = class extends ReactiveEffect {
1830
1855
  else if (isFunction(s)) return call ? call(s, 2) : s();
1831
1856
  else warnInvalidSource(s, onWarn);
1832
1857
  });
1833
- } else if (isFunction(source)) if (cb) getter = call ? () => call(source, 2) : source;
1834
- else getter = () => {
1835
- if (this.cleanupsLength) {
1836
- const prevSub = setActiveSub();
1858
+ } else if (isFunction(source)) {
1859
+ if (cb) getter = call ? () => call(source, 2) : source;
1860
+ else getter = () => {
1861
+ if (this.cleanupsLength) {
1862
+ const prevSub = setActiveSub();
1863
+ try {
1864
+ cleanup(this);
1865
+ } finally {
1866
+ setActiveSub(prevSub);
1867
+ }
1868
+ }
1869
+ const currentEffect = activeWatcher;
1870
+ activeWatcher = this;
1837
1871
  try {
1838
- cleanup(this);
1872
+ return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
1839
1873
  } finally {
1840
- setActiveSub(prevSub);
1874
+ activeWatcher = currentEffect;
1841
1875
  }
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 {
1876
+ };
1877
+ } else {
1852
1878
  getter = NOOP;
1853
1879
  warnInvalidSource(source, onWarn);
1854
1880
  }
@@ -2134,7 +2160,7 @@ let currentFlushPromise = null;
2134
2160
  let jobsLength = 0;
2135
2161
  let flushIndex = 0;
2136
2162
  let postFlushIndex = 0;
2137
- const resolvedPromise = /* @__PURE__ */ Promise.resolve();
2163
+ const resolvedPromise = /*@__PURE__*/ Promise.resolve();
2138
2164
  const RECURSION_LIMIT = 100;
2139
2165
  function nextTick(fn) {
2140
2166
  const p = currentFlushPromise || resolvedPromise;
@@ -2173,6 +2199,7 @@ const doFlushJobs = () => {
2173
2199
  flushJobs();
2174
2200
  } catch (e) {
2175
2201
  currentFlushPromise = null;
2202
+ if (jobsLength || postJobs.length) queueFlush();
2176
2203
  throw e;
2177
2204
  }
2178
2205
  };
@@ -2180,9 +2207,10 @@ function queueFlush() {
2180
2207
  if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(doFlushJobs);
2181
2208
  }
2182
2209
  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 (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
2210
+ if (!isArray(jobs)) {
2211
+ if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
2212
+ else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
2213
+ } else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
2186
2214
  queueFlush();
2187
2215
  }
2188
2216
  function flushPreFlushCbs(instance, seen) {
@@ -2196,8 +2224,11 @@ function flushPreFlushCbs(instance, seen) {
2196
2224
  i--;
2197
2225
  jobsLength--;
2198
2226
  if (cb.flags & 2) cb.flags &= -2;
2199
- cb();
2200
- if (!(cb.flags & 2)) cb.flags &= -2;
2227
+ try {
2228
+ cb();
2229
+ } finally {
2230
+ if (!(cb.flags & 2)) cb.flags &= -2;
2231
+ }
2201
2232
  }
2202
2233
  }
2203
2234
  function flushPostFlushCbs(seen) {
@@ -2210,18 +2241,22 @@ function flushPostFlushCbs(seen) {
2210
2241
  activePostJobs = postJobs;
2211
2242
  postJobs = [];
2212
2243
  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;
2244
+ try {
2245
+ while (postFlushIndex < activePostJobs.length) {
2246
+ const cb = activePostJobs[postFlushIndex++];
2247
+ if (checkRecursiveUpdates(seen, cb)) continue;
2248
+ if (cb.flags & 2) cb.flags &= -2;
2249
+ if (!(cb.flags & 4)) try {
2250
+ cb();
2251
+ } finally {
2252
+ if (!(cb.flags & 2)) cb.flags &= -2;
2253
+ }
2221
2254
  }
2255
+ } finally {
2256
+ while (postFlushIndex < activePostJobs.length) activePostJobs[postFlushIndex++].flags &= -2;
2257
+ activePostJobs = null;
2258
+ postFlushIndex = 0;
2222
2259
  }
2223
- activePostJobs = null;
2224
- postFlushIndex = 0;
2225
2260
  }
2226
2261
  }
2227
2262
  let isFlushing = false;
@@ -2231,9 +2266,12 @@ let isFlushing = false;
2231
2266
  function flushOnAppMount(instance) {
2232
2267
  if (!isFlushing) {
2233
2268
  isFlushing = true;
2234
- flushPreFlushCbs(instance);
2235
- flushPostFlushCbs();
2236
- isFlushing = false;
2269
+ try {
2270
+ flushPreFlushCbs(instance);
2271
+ flushPostFlushCbs();
2272
+ } finally {
2273
+ isFlushing = false;
2274
+ }
2237
2275
  }
2238
2276
  }
2239
2277
  function flushJobs(seen) {
@@ -2263,8 +2301,8 @@ function flushJobs(seen) {
2263
2301
  jobsLength = 0;
2264
2302
  jobs.length = 0;
2265
2303
  flushPostFlushCbs(seen);
2266
- currentFlushPromise = null;
2267
2304
  if (jobsLength || postJobs.length) flushJobs(seen);
2305
+ else currentFlushPromise = null;
2268
2306
  }
2269
2307
  }
2270
2308
  function checkRecursiveUpdates(seen, fn) {
@@ -2295,6 +2333,19 @@ getGlobalThis().__VUE_HMR_RUNTIME__ = {
2295
2333
  rerender: tryWrap(rerender),
2296
2334
  reload: tryWrap(reload)
2297
2335
  };
2336
+ function runWithHmrUpdating(fn) {
2337
+ isHmrUpdating = true;
2338
+ let done = false;
2339
+ try {
2340
+ fn();
2341
+ done = true;
2342
+ } finally {
2343
+ if (done) nextTick(() => {
2344
+ isHmrUpdating = false;
2345
+ });
2346
+ else isHmrUpdating = false;
2347
+ }
2348
+ }
2298
2349
  const map = /* @__PURE__ */ new Map();
2299
2350
  function registerHMR(instance) {
2300
2351
  const id = instance.type.__hmrId;
@@ -2336,18 +2387,16 @@ function rerender(id, newRender) {
2336
2387
  instance.render = newRender;
2337
2388
  normalizeClassComponent(instance.type).render = newRender;
2338
2389
  }
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();
2390
+ runWithHmrUpdating(() => {
2391
+ if (instance.vapor) {
2392
+ if (!instance.isUnmounted) instance.hmrRerender();
2393
+ } else {
2394
+ const i = instance;
2395
+ if (!(i.effect.flags & 1024)) {
2396
+ i.renderCache = [];
2397
+ i.effect.run();
2398
+ }
2347
2399
  }
2348
- }
2349
- nextTick(() => {
2350
- isHmrUpdating = false;
2351
2400
  });
2352
2401
  });
2353
2402
  }
@@ -2362,15 +2411,17 @@ function reload(id, newComp) {
2362
2411
  for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
2363
2412
  const dirtyInstances = new Set(instances);
2364
2413
  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
- }
2414
+ runWithHmrUpdating(() => {
2415
+ for (const instance of instances) {
2416
+ const parent = instance.parent;
2417
+ if (parent) {
2418
+ if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
2419
+ rerenderedParents.add(parent);
2420
+ parent.hmrRerender();
2421
+ }
2422
+ } else instance.hmrReload(newComp);
2423
+ }
2424
+ });
2374
2425
  } else {
2375
2426
  const parentUpdates = /* @__PURE__ */ new Map();
2376
2427
  const dirtyInstanceSet = new Set(instances);
@@ -2404,21 +2455,22 @@ function reload(id, newComp) {
2404
2455
  }
2405
2456
  parentUpdates.forEach((updates, parent) => {
2406
2457
  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();
2414
- }
2458
+ try {
2459
+ runWithHmrUpdating(() => {
2460
+ if (parent.vapor) parent.hmrRerender();
2461
+ else {
2462
+ const i = parent;
2463
+ if (!(i.effect.flags & 1024)) {
2464
+ i.renderCache = [];
2465
+ i.effect.run();
2466
+ }
2467
+ }
2468
+ });
2469
+ } finally {
2470
+ updates.forEach(([instance, dirtyInstances]) => {
2471
+ dirtyInstances.delete(instance);
2472
+ });
2415
2473
  }
2416
- nextTick(() => {
2417
- isHmrUpdating = false;
2418
- });
2419
- updates.forEach(([instance, dirtyInstances]) => {
2420
- dirtyInstances.delete(instance);
2421
- });
2422
2474
  });
2423
2475
  });
2424
2476
  }
@@ -2487,20 +2539,20 @@ function devtoolsInitApp(app, version) {
2487
2539
  function devtoolsUnmountApp(app) {
2488
2540
  emit$1("app:unmount", app);
2489
2541
  }
2490
- const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added");
2491
- const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated");
2492
- const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook("component:removed");
2542
+ const devtoolsComponentAdded = /*@__PURE__*/ createDevtoolsComponentHook("component:added");
2543
+ const devtoolsComponentUpdated = /*@__PURE__*/ createDevtoolsComponentHook("component:updated");
2544
+ const _devtoolsComponentRemoved = /*@__PURE__*/ createDevtoolsComponentHook("component:removed");
2493
2545
  const devtoolsComponentRemoved = (component) => {
2494
2546
  if (devtools && typeof devtools.cleanupBuffer === "function" && !devtools.cleanupBuffer(component)) _devtoolsComponentRemoved(component);
2495
2547
  };
2496
- /* @__NO_SIDE_EFFECTS__ */
2548
+ /*@__NO_SIDE_EFFECTS__*/
2497
2549
  function createDevtoolsComponentHook(hook) {
2498
2550
  return (component) => {
2499
2551
  emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component);
2500
2552
  };
2501
2553
  }
2502
- const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start");
2503
- const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end");
2554
+ const devtoolsPerfStart = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:start");
2555
+ const devtoolsPerfEnd = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:end");
2504
2556
  function createDevtoolsPerformanceHook(hook) {
2505
2557
  return (component, type, time) => {
2506
2558
  emit$1(hook, component.appContext.app, component.uid, component, type, time);
@@ -2827,15 +2879,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
2827
2879
  if (rawRef.f) {
2828
2880
  const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
2829
2881
  if (isUnmount) isArray(existing) && remove(existing, refValue);
2830
- else if (!isArray(existing)) if (_isString) {
2831
- refs[ref] = [refValue];
2832
- if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
2833
- } else {
2834
- const newVal = [refValue];
2835
- if (canSetRef(ref, rawRef.k)) ref.value = newVal;
2836
- if (rawRef.k) refs[rawRef.k] = newVal;
2837
- }
2838
- else if (!existing.includes(refValue)) existing.push(refValue);
2882
+ else if (!isArray(existing)) {
2883
+ if (_isString) {
2884
+ refs[ref] = [refValue];
2885
+ if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
2886
+ } else {
2887
+ const newVal = [refValue];
2888
+ if (canSetRef(ref, rawRef.k)) ref.value = newVal;
2889
+ if (rawRef.k) refs[rawRef.k] = newVal;
2890
+ }
2891
+ } else if (!existing.includes(refValue)) existing.push(refValue);
2839
2892
  } else if (_isString) {
2840
2893
  refs[ref] = value;
2841
2894
  if (canSetSetupRef(ref)) setupState[ref] = value;
@@ -2971,11 +3024,38 @@ const getPublicInstance = (i) => {
2971
3024
  if (isStatefulComponent(i)) return getComponentPublicInstance(i);
2972
3025
  return getPublicInstance(i.parent);
2973
3026
  };
3027
+ const resolveDevRootEl = (vnode) => {
3028
+ let found = false;
3029
+ while (true) {
3030
+ if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
3031
+ const root = filterSingleRoot(vnode.children);
3032
+ if (!root) return;
3033
+ vnode = root;
3034
+ found = true;
3035
+ continue;
3036
+ }
3037
+ const component = vnode.component;
3038
+ if (component && component.subTree) {
3039
+ vnode = component.subTree;
3040
+ continue;
3041
+ }
3042
+ const suspense = vnode.suspense;
3043
+ if (suspense && suspense.activeBranch) {
3044
+ vnode = suspense.activeBranch;
3045
+ continue;
3046
+ }
3047
+ return found ? vnode.el : void 0;
3048
+ }
3049
+ };
3050
+ const getDevRootFragmentEl = (i) => {
3051
+ const el = i.subTree && resolveDevRootEl(i.subTree);
3052
+ return el === void 0 ? i.vnode.el : el;
3053
+ };
2974
3054
  let publicPropertiesMap;
2975
3055
  const getPublicPropertiesMap = () => {
2976
3056
  if (!publicPropertiesMap) publicPropertiesMap = extend(Object.create(null), {
2977
3057
  $: (i) => i,
2978
- $el: (i) => i.vnode.el,
3058
+ $el: (i) => getDevRootFragmentEl(i),
2979
3059
  $data: (i) => i.data,
2980
3060
  $props: (i) => /* @__PURE__ */ shallowReadonly(i.props),
2981
3061
  $attrs: (i) => /* @__PURE__ */ shallowReadonly(i.attrs),
@@ -3192,11 +3272,12 @@ function applyOptions(instance) {
3192
3272
  const opt = computedOptions[key];
3193
3273
  const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
3194
3274
  if (get === NOOP) warn$1(`Computed property "${key}" has no getter.`);
3275
+ const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
3276
+ warn$1(`Write operation failed: computed property "${key}" is readonly.`);
3277
+ };
3195
3278
  const c = computed({
3196
3279
  get,
3197
- set: !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
3198
- warn$1(`Write operation failed: computed property "${key}" is readonly.`);
3199
- }
3280
+ set
3200
3281
  });
3201
3282
  Object.defineProperty(ctx, key, {
3202
3283
  enumerable: true,
@@ -3253,9 +3334,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP)
3253
3334
  for (const key in injectOptions) {
3254
3335
  const opt = injectOptions[key];
3255
3336
  let injected;
3256
- if (isObject(opt)) if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
3257
- else injected = inject(opt.from || key);
3258
- else injected = inject(opt);
3337
+ if (isObject(opt)) {
3338
+ if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
3339
+ else injected = inject(opt.from || key);
3340
+ } else injected = inject(opt);
3259
3341
  if (/* @__PURE__ */ isRef(injected)) Object.defineProperty(ctx, key, {
3260
3342
  enumerable: true,
3261
3343
  configurable: true,
@@ -3276,13 +3358,14 @@ function createWatcher(raw, ctx, publicThis, key) {
3276
3358
  if (isFunction(handler)) watch(getter, handler);
3277
3359
  else warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
3278
3360
  } else if (isFunction(raw)) watch(getter, raw.bind(publicThis));
3279
- else if (isObject(raw)) if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
3280
- else {
3281
- const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
3282
- if (isFunction(handler)) watch(getter, handler, raw);
3283
- else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
3284
- }
3285
- else warn$1(`Invalid watch option: "${key}"`, raw);
3361
+ else if (isObject(raw)) {
3362
+ if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
3363
+ else {
3364
+ const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
3365
+ if (isFunction(handler)) watch(getter, handler, raw);
3366
+ else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
3367
+ }
3368
+ } else warn$1(`Invalid watch option: "${key}"`, raw);
3286
3369
  }
3287
3370
  /**
3288
3371
  * Resolve merged options and cache it on the component.
@@ -3368,7 +3451,7 @@ function mergeObjectOptions(to, from) {
3368
3451
  }
3369
3452
  function mergeEmitsOrPropsOptions(to, from) {
3370
3453
  if (to) {
3371
- if (isArray(to) && isArray(from)) return [...new Set([...to, ...from])];
3454
+ if (isArray(to) && isArray(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
3372
3455
  return extend(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
3373
3456
  } else return from;
3374
3457
  }
@@ -3487,8 +3570,10 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
3487
3570
  } else warn$1(`Cannot unmount an app that is not mounted.`);
3488
3571
  },
3489
3572
  provide(key, value) {
3490
- 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.`);
3491
- else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
3573
+ if (key in context.provides) {
3574
+ if (hasOwn(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
3575
+ else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
3576
+ }
3492
3577
  context.provides[key] = value;
3493
3578
  return app;
3494
3579
  },
@@ -3527,12 +3612,14 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
3527
3612
  if (instance.isUnmounted) return;
3528
3613
  {
3529
3614
  const { emitsOptions, propsOptions } = instance;
3530
- if (emitsOptions) if (!(event in emitsOptions) && true) {
3531
- 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.`);
3532
- } else {
3533
- const validator = emitsOptions[event];
3534
- if (isFunction(validator)) {
3535
- if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
3615
+ if (emitsOptions) {
3616
+ if (!(event in emitsOptions) && true) {
3617
+ 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.`);
3618
+ } else {
3619
+ const validator = emitsOptions[event];
3620
+ if (isFunction(validator)) {
3621
+ if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
3622
+ }
3536
3623
  }
3537
3624
  }
3538
3625
  }
@@ -3541,7 +3628,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
3541
3628
  const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
3542
3629
  if (modifiers) {
3543
3630
  if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
3544
- if (modifiers.number) args = rawArgs.map(looseToNumber);
3631
+ if (modifiers.number) args = args.map(looseToNumber);
3545
3632
  }
3546
3633
  devtoolsComponentEmit(instance, event, args);
3547
3634
  {
@@ -3721,10 +3808,12 @@ function filterSingleRoot(children, recurse = true) {
3721
3808
  for (let i = 0; i < children.length; i++) {
3722
3809
  const child = children[i];
3723
3810
  if (isVNode$2(child)) {
3724
- if (child.type !== Comment || child.children === "v-if") if (singleRoot) return;
3725
- else {
3726
- singleRoot = child;
3727
- if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
3811
+ if (child.type !== Comment || child.children === "v-if") {
3812
+ if (singleRoot) return;
3813
+ else {
3814
+ singleRoot = child;
3815
+ if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
3816
+ }
3728
3817
  }
3729
3818
  } else return;
3730
3819
  }
@@ -3845,16 +3934,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
3845
3934
  let key = propsToUpdate[i];
3846
3935
  if (isEmitListener(instance.emitsOptions, key)) continue;
3847
3936
  const value = rawProps[key];
3848
- if (options) if (hasOwn(attrs, key)) {
3849
- if (value !== attrs[key]) {
3850
- attrs[key] = value;
3851
- hasAttrsChanged = true;
3937
+ if (options) {
3938
+ if (hasOwn(attrs, key)) {
3939
+ if (value !== attrs[key]) {
3940
+ attrs[key] = value;
3941
+ hasAttrsChanged = true;
3942
+ }
3943
+ } else {
3944
+ const camelizedKey = camelize(key);
3945
+ props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
3852
3946
  }
3853
- } else {
3854
- const camelizedKey = camelize(key);
3855
- props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
3856
- }
3857
- else if (value !== attrs[key]) {
3947
+ } else if (value !== attrs[key]) {
3858
3948
  attrs[key] = value;
3859
3949
  hasAttrsChanged = true;
3860
3950
  }
@@ -3863,9 +3953,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
3863
3953
  } else {
3864
3954
  if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
3865
3955
  let kebabKey;
3866
- for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) if (options) {
3867
- if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
3868
- } else delete props[key];
3956
+ for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
3957
+ if (options) {
3958
+ if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
3959
+ } else delete props[key];
3960
+ }
3869
3961
  if (attrs !== rawCurrentProps) {
3870
3962
  for (const key in attrs) if (!rawProps || !hasOwn(rawProps, key) && true) {
3871
3963
  delete attrs[key];
@@ -3884,9 +3976,10 @@ function setFullProps(instance, rawProps, props, attrs) {
3884
3976
  if (isReservedProp(key)) continue;
3885
3977
  const value = rawProps[key];
3886
3978
  let camelKey;
3887
- if (options && hasOwn(options, camelKey = camelize(key))) if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
3888
- else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
3889
- else if (!isEmitListener(instance.emitsOptions, key)) {
3979
+ if (options && hasOwn(options, camelKey = camelize(key))) {
3980
+ if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
3981
+ else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
3982
+ } else if (!isEmitListener(instance.emitsOptions, key)) {
3890
3983
  if (!(key in attrs) || value !== attrs[key]) {
3891
3984
  attrs[key] = value;
3892
3985
  hasAttrsChanged = true;
@@ -4049,7 +4142,7 @@ function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
4049
4142
  }
4050
4143
  if (validator && !validator(value, /* @__PURE__ */ shallowReadonly(resolvedProps))) warn$1("Invalid prop: custom validator check failed for prop \"" + key + "\".");
4051
4144
  }
4052
- const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
4145
+ const isSimpleType = /*@__PURE__*/ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
4053
4146
  /**
4054
4147
  * dev only
4055
4148
  */
@@ -4162,12 +4255,13 @@ const updateSlots = (instance, children, optimized) => {
4162
4255
  let deletionComparisonTarget = EMPTY_OBJ;
4163
4256
  if (vnode.shapeFlag & 32) {
4164
4257
  const type = children._;
4165
- if (type) if (isHmrUpdating) {
4166
- assignSlots(slots, children, optimized);
4167
- trigger(instance, "set", "$slots");
4168
- } else if (optimized && type === 1) needDeletionCheck = false;
4169
- else assignSlots(slots, children, optimized);
4170
- else {
4258
+ if (type) {
4259
+ if (isHmrUpdating) {
4260
+ assignSlots(slots, children, optimized);
4261
+ trigger(instance, "set", "$slots");
4262
+ } else if (optimized && type === 1) needDeletionCheck = false;
4263
+ else assignSlots(slots, children, optimized);
4264
+ } else {
4171
4265
  needDeletionCheck = !children.$stable;
4172
4266
  normalizeObjectSlots(children, slots, instance);
4173
4267
  }
@@ -4185,7 +4279,7 @@ const updateSlots = (instance, children, optimized) => {
4185
4279
  let supported;
4186
4280
  let perf;
4187
4281
  let cachedNow$1 = 0;
4188
- const p$1 = /* @__PURE__ */ Promise.resolve();
4282
+ const p$1 = /*@__PURE__*/ Promise.resolve();
4189
4283
  const getNow$1 = () => cachedNow$1 || (p$1.then(() => cachedNow$1 = 0), cachedNow$1 = isSupported() ? perf.now() : Date.now());
4190
4284
  /**
4191
4285
  * @internal
@@ -4390,7 +4484,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4390
4484
  for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
4391
4485
  };
4392
4486
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
4393
- 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);
4487
+ for (let i = start; i < children.length; i++) {
4488
+ const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode$1(children[i]);
4489
+ patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4490
+ }
4394
4491
  };
4395
4492
  const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4396
4493
  const el = n2.el = n1.el;
@@ -4402,6 +4499,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4402
4499
  let vnodeHook;
4403
4500
  parentComponent && toggleRecurse(parentComponent, false);
4404
4501
  if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
4502
+ if (n2.ibu) n2.ibu();
4405
4503
  if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
4406
4504
  parentComponent && toggleRecurse(parentComponent, true);
4407
4505
  if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
@@ -4435,8 +4533,9 @@ function baseCreateRenderer(options, createHydrationFns) {
4435
4533
  if (n1.children !== n2.children) hostSetElementText(el, n2.children);
4436
4534
  }
4437
4535
  } else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
4438
- if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
4536
+ if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
4439
4537
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
4538
+ n2.iu && n2.iu();
4440
4539
  dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
4441
4540
  }, void 0, parentSuspense);
4442
4541
  };
@@ -4444,7 +4543,8 @@ function baseCreateRenderer(options, createHydrationFns) {
4444
4543
  for (let i = 0; i < newChildren.length; i++) {
4445
4544
  const oldVNode = oldChildren[i];
4446
4545
  const newVNode = newChildren[i];
4447
- patch(oldVNode, newVNode, oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
4546
+ const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
4547
+ patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
4448
4548
  }
4449
4549
  };
4450
4550
  const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
@@ -4482,41 +4582,46 @@ function baseCreateRenderer(options, createHydrationFns) {
4482
4582
  };
4483
4583
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4484
4584
  n2.slotScopeIds = slotScopeIds;
4485
- if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
4486
- else {
4487
- const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
4488
- getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
4489
- if (n2.dirs) {
4490
- invokeDirectiveHook(n2, null, parentComponent, "created");
4491
- invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
4585
+ if (n2.type.__vapor) {
4586
+ if (n1 == null) {
4587
+ if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
4588
+ else {
4589
+ const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
4590
+ getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
4591
+ if (n2.dirs) {
4592
+ invokeDirectiveHook(n2, null, parentComponent, "created");
4593
+ invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
4594
+ }
4595
+ }, () => {
4596
+ if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
4597
+ });
4598
+ if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
4599
+ const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
4600
+ if (vnodeMountedHook) {
4601
+ const scopedVNode = n2;
4602
+ queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
4603
+ }
4492
4604
  }
4493
- }, () => {
4494
- if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
4495
- });
4496
- if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
4497
- const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
4498
- if (vnodeMountedHook) {
4499
- const scopedVNode = n2;
4500
- queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
4605
+ } else {
4606
+ const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
4607
+ getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
4608
+ if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
4609
+ }, () => {
4610
+ const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
4611
+ if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
4612
+ if (n2.ibu) n2.ibu();
4613
+ });
4614
+ const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
4615
+ if (shouldUpdate && (vnodeUpdatedHook || n2.dirs || n2.iu)) queuePostRenderEffect(() => {
4616
+ n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
4617
+ vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
4618
+ n2.iu && n2.iu();
4619
+ }, void 0, parentSuspense);
4501
4620
  }
4502
- }
4503
- else {
4504
- const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
4505
- getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
4506
- if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
4507
- }, () => {
4508
- const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
4509
- if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
4510
- });
4511
- const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
4512
- if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
4513
- n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
4514
- vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
4515
- }, void 0, parentSuspense);
4516
- }
4517
- else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
4518
- else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
4519
- else updateComponent(n1, n2, optimized);
4621
+ } else if (n1 == null) {
4622
+ if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
4623
+ else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
4624
+ } else updateComponent(n1, n2, optimized);
4520
4625
  };
4521
4626
  const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
4522
4627
  const instance = initialVNode.component = createComponentInstance$1(initialVNode, parentComponent, parentSuspense);
@@ -4557,16 +4662,17 @@ function baseCreateRenderer(options, createHydrationFns) {
4557
4662
  };
4558
4663
  const updateComponent = (n1, n2, optimized) => {
4559
4664
  const instance = n2.component = n1.component;
4560
- if (shouldUpdateComponent(n1, n2, optimized)) if (instance.asyncDep && !instance.asyncResolved) {
4561
- pushWarningContext$1(n2);
4562
- updateComponentPreRender(instance, n2, optimized);
4563
- popWarningContext$1();
4564
- return;
4665
+ if (shouldUpdateComponent(n1, n2, optimized)) {
4666
+ if (instance.asyncDep && !instance.asyncResolved) {
4667
+ pushWarningContext$1(n2);
4668
+ updateComponentPreRender(instance, n2, optimized);
4669
+ popWarningContext$1();
4670
+ return;
4671
+ } else {
4672
+ instance.next = n2;
4673
+ instance.effect.run();
4674
+ }
4565
4675
  } else {
4566
- instance.next = n2;
4567
- instance.effect.run();
4568
- }
4569
- else {
4570
4676
  n2.el = n1.el;
4571
4677
  instance.vnode = n2;
4572
4678
  }
@@ -4664,6 +4770,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4664
4770
  } else next = vnode;
4665
4771
  if (bu) invokeArrayFns(bu);
4666
4772
  if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
4773
+ if (next.ibu) next.ibu();
4667
4774
  toggleRecurse(instance, true);
4668
4775
  startMeasure(instance, `render`);
4669
4776
  const nextTree = renderComponentRoot$1(instance);
@@ -4676,7 +4783,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4676
4783
  next.el = nextTree.el;
4677
4784
  if (originNext === null) updateHOCHostEl(instance, nextTree.el);
4678
4785
  if (u) queuePostRenderEffect(u, void 0, parentSuspense);
4679
- if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), void 0, parentSuspense);
4786
+ if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
4787
+ vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
4788
+ next.iu && next.iu();
4789
+ }, void 0, parentSuspense);
4680
4790
  devtoolsComponentUpdated(instance);
4681
4791
  popWarningContext$1();
4682
4792
  }
@@ -4716,9 +4826,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4716
4826
  if (shapeFlag & 8) {
4717
4827
  if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
4718
4828
  if (c2 !== c1) hostSetElementText(container, c2);
4719
- } else if (prevShapeFlag & 16) if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4720
- else unmountChildren(c1, parentComponent, parentSuspense, true);
4721
- else {
4829
+ } else if (prevShapeFlag & 16) {
4830
+ if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4831
+ else unmountChildren(c1, parentComponent, parentSuspense, true);
4832
+ } else {
4722
4833
  if (prevShapeFlag & 8) hostSetElementText(container, "");
4723
4834
  if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4724
4835
  }
@@ -4817,8 +4928,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4817
4928
  const anchorVNode = c2[nextIndex + 1];
4818
4929
  const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
4819
4930
  if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4820
- else if (moved) if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
4821
- else j--;
4931
+ else if (moved) {
4932
+ if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
4933
+ else j--;
4934
+ }
4822
4935
  }
4823
4936
  }
4824
4937
  };
@@ -4850,26 +4963,13 @@ function baseCreateRenderer(options, createHydrationFns) {
4850
4963
  moveStaticNode(vnode, container, anchor);
4851
4964
  return;
4852
4965
  }
4853
- if (moveType !== 2 && shapeFlag & 1 && transition) if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
4854
- else {
4855
- const { leave, delayLeave, afterLeave } = transition;
4856
- const remove = () => {
4966
+ if (moveType !== 2 && shapeFlag & 1 && transition) {
4967
+ if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
4968
+ else performTransitionLeave(el, transition, () => {
4857
4969
  if (vnode.ctx.isUnmounted) hostRemove(el);
4858
4970
  else hostInsert(el, container, anchor);
4859
- };
4860
- const performLeave = () => {
4861
- const wasLeaving = el._isLeaving || !!el[leaveCbKey];
4862
- if (el._isLeaving) el[leaveCbKey](true);
4863
- if (transition.persisted && !wasLeaving) remove();
4864
- else leave(el, () => {
4865
- remove();
4866
- afterLeave && afterLeave();
4867
- });
4868
- };
4869
- if (delayLeave) delayLeave(el, remove, performLeave);
4870
- else performLeave();
4871
- }
4872
- else hostInsert(el, container, anchor);
4971
+ }, true, true);
4972
+ } else hostInsert(el, container, anchor);
4873
4973
  };
4874
4974
  const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
4875
4975
  const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
@@ -4889,16 +4989,17 @@ function baseCreateRenderer(options, createHydrationFns) {
4889
4989
  const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
4890
4990
  let vnodeHook;
4891
4991
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
4892
- if (shapeFlag & 6) if (isVaporComponent(type)) {
4893
- if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
4894
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
4895
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
4896
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
4897
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
4898
- }, void 0, parentSuspense);
4899
- return;
4900
- } else unmountComponent(vnode.component, parentSuspense, doRemove);
4901
- else {
4992
+ if (shapeFlag & 6) {
4993
+ if (isVaporComponent(type)) {
4994
+ if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
4995
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
4996
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
4997
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
4998
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
4999
+ }, void 0, parentSuspense);
5000
+ return;
5001
+ } else unmountComponent(vnode.component, parentSuspense, doRemove);
5002
+ } else {
4902
5003
  if (shapeFlag & 128) {
4903
5004
  vnode.suspense.unmount(parentSuspense, doRemove);
4904
5005
  return;
@@ -5030,12 +5131,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
5030
5131
  return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
5031
5132
  }
5032
5133
  function toggleRecurse({ effect, job, vapor }, allowed) {
5033
- if (!vapor) if (allowed) {
5034
- effect.flags |= 128;
5035
- job.flags |= 2;
5036
- } else {
5037
- effect.flags &= -129;
5038
- job.flags &= -3;
5134
+ if (!vapor) {
5135
+ if (allowed) {
5136
+ effect.flags |= 128;
5137
+ job.flags |= 2;
5138
+ } else {
5139
+ effect.flags &= -129;
5140
+ job.flags &= -3;
5141
+ }
5039
5142
  }
5040
5143
  }
5041
5144
  function needTransition(parentSuspense, transition) {
@@ -5075,8 +5178,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
5075
5178
  }
5076
5179
  function locateNonHydratedAsyncRoot(instance) {
5077
5180
  const subComponent = instance.subTree && instance.subTree.component;
5078
- if (subComponent) if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
5079
- else return locateNonHydratedAsyncRoot(subComponent);
5181
+ if (subComponent) {
5182
+ if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
5183
+ else return locateNonHydratedAsyncRoot(subComponent);
5184
+ }
5080
5185
  }
5081
5186
  function invalidateMount(hooks) {
5082
5187
  if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
@@ -5095,13 +5200,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
5095
5200
  function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
5096
5201
  const performRemove = () => {
5097
5202
  remove();
5098
- if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
5203
+ if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
5099
5204
  };
5100
5205
  if (force || isElement && transition && !transition.persisted) {
5101
5206
  const { leave, delayLeave } = transition;
5102
5207
  const performLeave = () => {
5208
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
5103
5209
  if (el._isLeaving && force) el[leaveCbKey](true);
5104
- leave(el, performRemove);
5210
+ if (force && transition.persisted && !wasLeaving) remove();
5211
+ else leave(el, performRemove);
5105
5212
  };
5106
5213
  if (delayLeave) delayLeave(el, performRemove, performLeave);
5107
5214
  else performLeave();
@@ -5150,9 +5257,10 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
5150
5257
  //#region packages/runtime-core/src/components/Suspense.ts
5151
5258
  const isSuspense = (type) => type.__isSuspense;
5152
5259
  function queueEffectWithSuspense(fn, id, suspense) {
5153
- if (suspense && suspense.pendingBranch) if (isArray(fn)) suspense.effects.push(...fn);
5154
- else suspense.effects.push(fn);
5155
- else queuePostFlushCb(fn, id);
5260
+ if (suspense && suspense.pendingBranch) {
5261
+ if (isArray(fn)) suspense.effects.push(...fn);
5262
+ else suspense.effects.push(fn);
5263
+ } else queuePostFlushCb(fn, id);
5156
5264
  }
5157
5265
  //#endregion
5158
5266
  //#region packages/runtime-core/src/vnode.ts
@@ -5277,8 +5385,10 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
5277
5385
  if (isVNode$2(type)) {
5278
5386
  const cloned = cloneVNode(type, props, true);
5279
5387
  if (children) normalizeChildren(cloned, children);
5280
- if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
5281
- else currentBlock.push(cloned);
5388
+ if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
5389
+ if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
5390
+ else currentBlock.push(cloned);
5391
+ }
5282
5392
  cloned.patchFlag = -2;
5283
5393
  return cloned;
5284
5394
  }
@@ -5338,7 +5448,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
5338
5448
  ce: vnode.ce,
5339
5449
  vi: vnode.vi,
5340
5450
  vs: cloneVaporSlotMeta(vnode),
5341
- vb: vnode.vb
5451
+ vb: vnode.vb,
5452
+ ibu: vnode.ibu,
5453
+ iu: vnode.iu
5342
5454
  };
5343
5455
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
5344
5456
  return cloned;
@@ -5387,25 +5499,28 @@ function normalizeChildren(vnode, children) {
5387
5499
  const { shapeFlag } = vnode;
5388
5500
  if (children == null) children = null;
5389
5501
  else if (isArray(children)) type = 16;
5390
- else if (typeof children === "object") if (shapeFlag & 65) {
5391
- const slot = children.default;
5392
- if (slot) {
5393
- slot._c && (slot._d = false);
5394
- normalizeChildren(vnode, slot());
5395
- slot._c && (slot._d = true);
5396
- }
5397
- return;
5398
- } else {
5399
- type = 32;
5400
- const slotFlag = children._;
5401
- if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
5402
- else if (slotFlag === 3 && currentRenderingInstance) if (currentRenderingInstance.slots._ === 1) children._ = 1;
5403
- else {
5404
- children._ = 2;
5405
- vnode.patchFlag |= 1024;
5502
+ else if (typeof children === "object") {
5503
+ if (shapeFlag & 65) {
5504
+ const slot = children.default;
5505
+ if (slot) {
5506
+ slot._c && (slot._d = false);
5507
+ normalizeChildren(vnode, slot());
5508
+ slot._c && (slot._d = true);
5509
+ }
5510
+ return;
5511
+ } else {
5512
+ type = 32;
5513
+ const slotFlag = children._;
5514
+ if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
5515
+ else if (slotFlag === 3 && currentRenderingInstance) {
5516
+ if (currentRenderingInstance.slots._ === 1) children._ = 1;
5517
+ else {
5518
+ children._ = 2;
5519
+ vnode.patchFlag |= 1024;
5520
+ }
5521
+ }
5406
5522
  }
5407
- }
5408
- else if (isFunction(children)) {
5523
+ } else if (isFunction(children)) {
5409
5524
  if (shapeFlag & 65) {
5410
5525
  normalizeChildren(vnode, { default: children });
5411
5526
  return;
@@ -5493,7 +5608,7 @@ const restoreCurrentInstance = (prev) => {
5493
5608
  };
5494
5609
  //#endregion
5495
5610
  //#region packages/runtime-core/src/component.ts
5496
- const emptyAppContext = /* @__PURE__ */ createAppContext();
5611
+ const emptyAppContext = /*@__PURE__*/ createAppContext();
5497
5612
  let uid = 0;
5498
5613
  function createComponentInstance$1(vnode, parent, suspense) {
5499
5614
  const type = vnode.type;
@@ -5638,9 +5753,10 @@ function setupStatefulComponent(instance, isSSR) {
5638
5753
  } else finishComponentSetup(instance, isSSR);
5639
5754
  }
5640
5755
  function handleSetupResult(instance, setupResult, isSSR) {
5641
- if (isFunction(setupResult)) if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
5642
- else instance.render = setupResult;
5643
- else if (isObject(setupResult)) {
5756
+ if (isFunction(setupResult)) {
5757
+ if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
5758
+ else instance.render = setupResult;
5759
+ } else if (isObject(setupResult)) {
5644
5760
  if (isVNode$2(setupResult)) warn$1("setup() should not return VNodes directly - return a render function instead.");
5645
5761
  instance.devtoolsRawSetupState = setupResult;
5646
5762
  instance.setupState = proxyRefs(setupResult);
@@ -5662,10 +5778,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
5662
5778
  restoreCurrentInstance(prevInstance);
5663
5779
  }
5664
5780
  }
5665
- if (!Component.render && instance.render === NOOP && !isSSR) if (Component.template)
5781
+ if (!Component.render && instance.render === NOOP && !isSSR) {
5782
+ if (Component.template)
5666
5783
  /* v8 ignore start */
5667
- warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Use \"vue.esm-browser.js\" instead.");
5668
- else warn$1(`Component is missing template or render function: `, Component);
5784
+ warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Use \"vue.esm-browser.js\" instead.");
5785
+ else warn$1(`Component is missing template or render function: `, Component);
5786
+ }
5669
5787
  }
5670
5788
  const attrsProxyHandlers = {
5671
5789
  get(target, key) {
@@ -5769,7 +5887,7 @@ const computed = (getterOrOptions, debugOptions) => {
5769
5887
  };
5770
5888
  //#endregion
5771
5889
  //#region packages/runtime-core/src/index.ts
5772
- const version = "3.6.0-rc.5";
5890
+ const version = "3.6.0-rc.7";
5773
5891
  const warn = warn$1;
5774
5892
  /**
5775
5893
  * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
@@ -5792,7 +5910,7 @@ const ssrUtils = {
5792
5910
  let policy = void 0;
5793
5911
  const tt = typeof window !== "undefined" && window.trustedTypes;
5794
5912
  if (tt) try {
5795
- policy = /* @__PURE__ */ tt.createPolicy("vue", { createHTML: (val) => val });
5913
+ policy = /*@__PURE__*/ tt.createPolicy("vue", { createHTML: (val) => val });
5796
5914
  } catch (e) {
5797
5915
  warn(`Error creating trusted types policy: ${e}`);
5798
5916
  }
@@ -5800,7 +5918,7 @@ const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) =>
5800
5918
  const svgNS = "http://www.w3.org/2000/svg";
5801
5919
  const mathmlNS = "http://www.w3.org/1998/Math/MathML";
5802
5920
  const doc = typeof document !== "undefined" ? document : null;
5803
- const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
5921
+ const templateContainer = doc && /*@__PURE__*/ doc.createElement("template");
5804
5922
  const nodeOps = {
5805
5923
  insert: (child, parent, anchor) => {
5806
5924
  parent.insertBefore(child, anchor || null);
@@ -5875,14 +5993,15 @@ const vShow = {
5875
5993
  },
5876
5994
  updated(el, { value, oldValue }, { transition }) {
5877
5995
  if (!value === !oldValue) return;
5878
- if (transition) if (value) {
5879
- transition.beforeEnter(el);
5880
- setDisplay(el, true);
5881
- transition.enter(el);
5882
- } else transition.leave(el, () => {
5883
- setDisplay(el, false);
5884
- });
5885
- else setDisplay(el, value);
5996
+ if (transition) {
5997
+ if (value) {
5998
+ transition.beforeEnter(el);
5999
+ setDisplay(el, true);
6000
+ transition.enter(el);
6001
+ } else transition.leave(el, () => {
6002
+ setDisplay(el, false);
6003
+ });
6004
+ } else setDisplay(el, value);
5886
6005
  },
5887
6006
  beforeUnmount(el, { value }) {
5888
6007
  setDisplay(el, value);
@@ -5908,11 +6027,13 @@ function patchStyle(el, prev, next) {
5908
6027
  const isCssString = isString(next);
5909
6028
  let hasControlledDisplay = false;
5910
6029
  if (next && !isCssString) {
5911
- if (prev) if (!isString(prev)) {
5912
- for (const key in prev) if (next[key] == null) setStyle(style, key, "");
5913
- } else for (const prevStyle of prev.split(";")) {
5914
- const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
5915
- if (next[key] == null) setStyle(style, key, "");
6030
+ if (prev) {
6031
+ if (!isString(prev)) {
6032
+ for (const key in prev) if (next[key] == null) setStyle(style, key, "");
6033
+ } else for (const prevStyle of prev.split(";")) {
6034
+ const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
6035
+ if (next[key] == null) setStyle(style, key, "");
6036
+ }
5916
6037
  }
5917
6038
  for (const key in next) {
5918
6039
  if (key === "display") hasControlledDisplay = true;
@@ -5941,8 +6062,10 @@ function setStyle(style, name, rawVal) {
5941
6062
  else {
5942
6063
  const val = rawVal == null ? "" : String(rawVal);
5943
6064
  if (semicolonRE.test(val)) warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
5944
- if (name.startsWith("--")) style.setProperty(name, val);
5945
- else {
6065
+ if (name.startsWith("--")) {
6066
+ if (importantRE.test(val)) style.setProperty(name, val.replace(importantRE, ""), "important");
6067
+ else style.setProperty(name, val);
6068
+ } else {
5946
6069
  const prefixed = autoPrefix(style, name);
5947
6070
  if (importantRE.test(val)) style.setProperty(hyphenate(prefixed), val.replace(importantRE, ""), "important");
5948
6071
  else style[prefixed] = val;
@@ -5979,9 +6102,10 @@ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
5979
6102
  //#region packages/runtime-dom/src/modules/attrs.ts
5980
6103
  const xlinkNS = "http://www.w3.org/1999/xlink";
5981
6104
  function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
5982
- if (isSVG && key.startsWith("xlink:")) if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
5983
- else el.setAttributeNS(xlinkNS, key, value);
5984
- else if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
6105
+ if (isSVG && key.startsWith("xlink:")) {
6106
+ if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
6107
+ else el.setAttributeNS(xlinkNS, key, value);
6108
+ } else if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
5985
6109
  else el.setAttribute(key, isBoolean ? "" : isSymbol(value) ? String(value) : value);
5986
6110
  }
5987
6111
  //#endregion
@@ -6054,7 +6178,7 @@ function parseEventName(name) {
6054
6178
  return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
6055
6179
  }
6056
6180
  let cachedNow = 0;
6057
- const p = /* @__PURE__ */ Promise.resolve();
6181
+ const p = /*@__PURE__*/ Promise.resolve();
6058
6182
  const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
6059
6183
  function createInvoker(initialValue, instance) {
6060
6184
  const invoker = (e) => {
@@ -6286,19 +6410,39 @@ const vModelSelectInit = (el, value, number, set) => {
6286
6410
  el._modelValue = value;
6287
6411
  addEventListener(el, "change", () => {
6288
6412
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
6289
- (set || el[assignKey])(el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
6290
- el._assigning = true;
6291
- nextTick(() => {
6292
- el._assigning = false;
6293
- });
6413
+ const multiple = el.multiple;
6414
+ const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
6415
+ const pending = el._pendingValue = [multiple, multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue];
6416
+ try {
6417
+ (set || el[assignKey])(assignedValue);
6418
+ } finally {
6419
+ nextTick(() => {
6420
+ if (el._pendingValue === pending) el._pendingValue = void 0;
6421
+ });
6422
+ }
6294
6423
  });
6295
6424
  };
6425
+ function isSameSelectValue(value, assignedValue, multiple) {
6426
+ if (!multiple) return looseEqual(value, assignedValue);
6427
+ if (isArray(value)) return looseEqual(value, assignedValue);
6428
+ if (isSet(value)) {
6429
+ if (value.size !== assignedValue.length) return false;
6430
+ for (const item of assignedValue) if (!value.has(item)) return false;
6431
+ return true;
6432
+ }
6433
+ return false;
6434
+ }
6296
6435
  /**
6297
6436
  * @internal
6298
6437
  */
6299
6438
  const vModelSetSelected = (el, value) => {
6300
6439
  el._modelValue = value;
6301
- if (el._assigning) return;
6440
+ const pending = el._pendingValue;
6441
+ el._pendingValue = void 0;
6442
+ if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
6443
+ setSelected(el, value);
6444
+ };
6445
+ function setSelected(el, value) {
6302
6446
  const isMultiple = el.multiple;
6303
6447
  const isArrayValue = isArray(value);
6304
6448
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -6308,18 +6452,19 @@ const vModelSetSelected = (el, value) => {
6308
6452
  for (let i = 0, l = el.options.length; i < l; i++) {
6309
6453
  const option = el.options[i];
6310
6454
  const optionValue = getValue(option);
6311
- if (isMultiple) if (isArrayValue) {
6312
- const optionType = typeof optionValue;
6313
- if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
6314
- else option.selected = looseIndexOf(value, optionValue) > -1;
6315
- } else option.selected = value.has(optionValue);
6316
- else if (looseEqual(getValue(option), value)) {
6455
+ if (isMultiple) {
6456
+ if (isArrayValue) {
6457
+ const optionType = typeof optionValue;
6458
+ if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
6459
+ else option.selected = looseIndexOf(value, optionValue) > -1;
6460
+ } else option.selected = value.has(optionValue);
6461
+ } else if (looseEqual(getValue(option), value)) {
6317
6462
  if (el.selectedIndex !== i) el.selectedIndex = i;
6318
6463
  return;
6319
6464
  }
6320
6465
  }
6321
6466
  if (!isMultiple && el.selectedIndex !== -1) el.selectedIndex = -1;
6322
- };
6467
+ }
6323
6468
  /**
6324
6469
  * @internal retrieve raw value set via :value bindings
6325
6470
  */
@@ -6382,7 +6527,7 @@ function initVModelForSSR() {
6382
6527
  }
6383
6528
  //#endregion
6384
6529
  //#region packages/runtime-dom/src/index.ts
6385
- const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
6530
+ const rendererOptions = /*@__PURE__*/ extend({ patchProp }, nodeOps);
6386
6531
  let renderer;
6387
6532
  function ensureRenderer() {
6388
6533
  return renderer || (renderer = createRenderer(rendererOptions));
@@ -6466,7 +6611,7 @@ const initDirectivesForSSR = () => {
6466
6611
  };
6467
6612
  //#endregion
6468
6613
  //#region packages/server-renderer/src/helpers/ssrRenderAttrs.ts
6469
- const shouldIgnoreProp = /* @__PURE__ */ makeMap(`,key,ref,innerHTML,textContent,ref_key,ref_for`);
6614
+ const shouldIgnoreProp = /*@__PURE__*/ makeMap(`,key,ref,innerHTML,textContent,ref_key,ref_for`);
6470
6615
  function ssrRenderAttrs(props, tag) {
6471
6616
  let ret = "";
6472
6617
  for (let key in props) {
@@ -6611,14 +6756,16 @@ function ssrRenderList(source, renderItem) {
6611
6756
  return;
6612
6757
  }
6613
6758
  for (let i = 0; i < source; i++) renderItem(i + 1, i);
6614
- } else if (isObject(source)) if (source[Symbol.iterator]) {
6615
- let i = 0;
6616
- for (const item of source) renderItem(item, i++);
6617
- } else {
6618
- const keys = Object.keys(source);
6619
- for (let i = 0, l = keys.length; i < l; i++) {
6620
- const key = keys[i];
6621
- renderItem(source[key], key, i);
6759
+ } else if (isObject(source)) {
6760
+ if (source[Symbol.iterator]) {
6761
+ let i = 0;
6762
+ for (const item of source) renderItem(item, i++);
6763
+ } else {
6764
+ const keys = Object.keys(source);
6765
+ for (let i = 0, l = keys.length; i < l; i++) {
6766
+ const key = keys[i];
6767
+ renderItem(source[key], key, i);
6768
+ }
6622
6769
  }
6623
6770
  }
6624
6771
  }
@@ -6773,7 +6920,8 @@ function renderComponentSubTree(instance, slotScopeId) {
6773
6920
  }
6774
6921
  } else if (instance.render && instance.render !== NOOP) renderVNode(push, instance.subTree = renderComponentRoot(instance), instance, slotScopeId);
6775
6922
  else {
6776
- warn(`Component ${comp.name || comp.__file || `<Anonymous>`} is missing template or render function.`);
6923
+ const componentName = comp.name || comp.__file || `<Anonymous>`;
6924
+ warn(`Component ${componentName} is missing template or render function.`);
6777
6925
  push(`<!---->`);
6778
6926
  }
6779
6927
  }