@vitejs/devtools 0.0.0-alpha.2 → 0.0.0-alpha.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,8 @@
1
- //#region ../../node_modules/.pnpm/@vue+shared@3.5.22/node_modules/@vue/shared/dist/shared.esm-bundler.js
1
+ import { createEventEmitter } from "@vitejs/devtools-kit/utils/events";
2
+
3
+ //#region ../../node_modules/.pnpm/@vue+shared@3.5.26/node_modules/@vue/shared/dist/shared.esm-bundler.js
2
4
  /**
3
- * @vue/shared v3.5.22
5
+ * @vue/shared v3.5.26
4
6
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
5
7
  * @license MIT
6
8
  **/
@@ -22,7 +24,7 @@ const remove = (arr, el) => {
22
24
  if (i > -1) arr.splice(i, 1);
23
25
  };
24
26
  const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
25
- const hasOwn$1 = (val, key) => hasOwnProperty$1.call(val, key);
27
+ const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
26
28
  const isArray = Array.isArray;
27
29
  const isMap = (val) => toTypeString(val) === "[object Map]";
28
30
  const isSet = (val) => toTypeString(val) === "[object Set]";
@@ -155,7 +157,12 @@ const stringifySymbol = (v, i = "") => {
155
157
  };
156
158
 
157
159
  //#endregion
158
- //#region ../../node_modules/.pnpm/@vue+reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
160
+ //#region ../../node_modules/.pnpm/@vue+reactivity@3.5.26/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
161
+ /**
162
+ * @vue/reactivity v3.5.26
163
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
164
+ * @license MIT
165
+ **/
159
166
  function warn$2(msg, ...args) {
160
167
  console.warn(`[Vue warn] ${msg}`, ...args);
161
168
  }
@@ -617,9 +624,9 @@ function addSub(link) {
617
624
  }
618
625
  }
619
626
  const targetMap = /* @__PURE__ */ new WeakMap();
620
- const ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "Object iterate" : "");
621
- const MAP_KEY_ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "Map keys iterate" : "");
622
- const ARRAY_ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "Array iterate" : "");
627
+ const ITERATE_KEY = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? "Object iterate" : "");
628
+ const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? "Map keys iterate" : "");
629
+ const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? "Array iterate" : "");
623
630
  function track(target, type, key) {
624
631
  if (shouldTrack && activeSub) {
625
632
  let depsMap = targetMap.get(target);
@@ -703,17 +710,21 @@ function shallowReadArray(arr) {
703
710
  track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
704
711
  return arr;
705
712
  }
713
+ function toWrapped(target, item) {
714
+ if (isReadonly(target)) return isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item);
715
+ return toReactive(item);
716
+ }
706
717
  const arrayInstrumentations = {
707
718
  __proto__: null,
708
719
  [Symbol.iterator]() {
709
- return iterator(this, Symbol.iterator, toReactive);
720
+ return iterator(this, Symbol.iterator, (item) => toWrapped(this, item));
710
721
  },
711
722
  concat(...args) {
712
723
  return reactiveReadArray(this).concat(...args.map((x) => isArray(x) ? reactiveReadArray(x) : x));
713
724
  },
714
725
  entries() {
715
726
  return iterator(this, "entries", (value) => {
716
- value[1] = toReactive(value[1]);
727
+ value[1] = toWrapped(this, value[1]);
717
728
  return value;
718
729
  });
719
730
  },
@@ -721,16 +732,16 @@ const arrayInstrumentations = {
721
732
  return apply(this, "every", fn, thisArg, void 0, arguments);
722
733
  },
723
734
  filter(fn, thisArg) {
724
- return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments);
735
+ return apply(this, "filter", fn, thisArg, (v) => v.map((item) => toWrapped(this, item)), arguments);
725
736
  },
726
737
  find(fn, thisArg) {
727
- return apply(this, "find", fn, thisArg, toReactive, arguments);
738
+ return apply(this, "find", fn, thisArg, (item) => toWrapped(this, item), arguments);
728
739
  },
729
740
  findIndex(fn, thisArg) {
730
741
  return apply(this, "findIndex", fn, thisArg, void 0, arguments);
731
742
  },
732
743
  findLast(fn, thisArg) {
733
- return apply(this, "findLast", fn, thisArg, toReactive, arguments);
744
+ return apply(this, "findLast", fn, thisArg, (item) => toWrapped(this, item), arguments);
734
745
  },
735
746
  findLastIndex(fn, thisArg) {
736
747
  return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
@@ -787,7 +798,7 @@ const arrayInstrumentations = {
787
798
  return noTracking(this, "unshift", args);
788
799
  },
789
800
  values() {
790
- return iterator(this, "values", toReactive);
801
+ return iterator(this, "values", (item) => toWrapped(this, item));
791
802
  }
792
803
  };
793
804
  function iterator(self$1, method, wrapValue) {
@@ -815,7 +826,7 @@ function apply(self$1, method, fn, thisArg, wrappedRetFn, args) {
815
826
  let wrappedFn = fn;
816
827
  if (arr !== self$1) {
817
828
  if (needsWrap) wrappedFn = function(item, index) {
818
- return fn.call(this, toReactive(item), index, self$1);
829
+ return fn.call(this, toWrapped(self$1, item), index, self$1);
819
830
  };
820
831
  else if (fn.length > 2) wrappedFn = function(item, index) {
821
832
  return fn.call(this, item, index, self$1);
@@ -829,7 +840,7 @@ function reduce(self$1, method, fn, args) {
829
840
  let wrappedFn = fn;
830
841
  if (arr !== self$1) {
831
842
  if (!isShallow(self$1)) wrappedFn = function(acc, item, index) {
832
- return fn.call(this, acc, toReactive(item), index, self$1);
843
+ return fn.call(this, acc, toWrapped(self$1, item), index, self$1);
833
844
  };
834
845
  else if (fn.length > 3) wrappedFn = function(acc, item, index) {
835
846
  return fn.call(this, acc, item, index, self$1);
@@ -902,13 +913,14 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
902
913
  }
903
914
  set(target, key, value, receiver) {
904
915
  let oldValue = target[key];
916
+ const isArrayWithIntegerKey = isArray(target) && isIntegerKey(key);
905
917
  if (!this._isShallow) {
906
918
  const isOldValueReadonly = isReadonly(oldValue);
907
919
  if (!isShallow(value) && !isReadonly(value)) {
908
920
  oldValue = toRaw(oldValue);
909
921
  value = toRaw(value);
910
922
  }
911
- if (!isArray(target) && isRef(oldValue) && !isRef(value)) if (isOldValueReadonly) {
923
+ if (!isArrayWithIntegerKey && isRef(oldValue) && !isRef(value)) if (isOldValueReadonly) {
912
924
  if (!!(process.env.NODE_ENV !== "production")) warn$2(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
913
925
  return true;
914
926
  } else {
@@ -916,7 +928,7 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
916
928
  return true;
917
929
  }
918
930
  }
919
- const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$1(target, key);
931
+ const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
920
932
  const result = Reflect.set(target, key, value, isRef(target) ? target : receiver);
921
933
  if (target === toRaw(receiver)) {
922
934
  if (!hadKey) trigger(target, "add", key, value);
@@ -925,7 +937,7 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
925
937
  return result;
926
938
  }
927
939
  deleteProperty(target, key) {
928
- const hadKey = hasOwn$1(target, key);
940
+ const hadKey = hasOwn(target, key);
929
941
  const oldValue = target[key];
930
942
  const result = Reflect.deleteProperty(target, key);
931
943
  if (result && hadKey) trigger(target, "delete", key, void 0, oldValue);
@@ -1106,7 +1118,7 @@ function createInstrumentationGetter(isReadonly2, shallow) {
1106
1118
  if (key === "__v_isReactive") return !isReadonly2;
1107
1119
  else if (key === "__v_isReadonly") return isReadonly2;
1108
1120
  else if (key === "__v_raw") return target;
1109
- return Reflect.get(hasOwn$1(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
1121
+ return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
1110
1122
  };
1111
1123
  }
1112
1124
  const mutableCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, false) };
@@ -1183,7 +1195,7 @@ function toRaw(observed) {
1183
1195
  return raw ? toRaw(raw) : observed;
1184
1196
  }
1185
1197
  function markRaw(value) {
1186
- if (!hasOwn$1(value, "__v_skip") && Object.isExtensible(value)) def(value, "__v_skip", true);
1198
+ if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) def(value, "__v_skip", true);
1187
1199
  return value;
1188
1200
  }
1189
1201
  const toReactive = (value) => isObject$1(value) ? reactive(value) : value;
@@ -1192,12 +1204,12 @@ function isRef(r) {
1192
1204
  return r ? r["__v_isRef"] === true : false;
1193
1205
  }
1194
1206
  function ref(value) {
1195
- return createRef$1(value, false);
1207
+ return createRef(value, false);
1196
1208
  }
1197
1209
  function shallowRef(value) {
1198
- return createRef$1(value, true);
1210
+ return createRef(value, true);
1199
1211
  }
1200
- function createRef$1(rawValue, shallow) {
1212
+ function createRef(rawValue, shallow) {
1201
1213
  if (isRef(rawValue)) return rawValue;
1202
1214
  return new RefImpl(rawValue, shallow);
1203
1215
  }
@@ -1275,7 +1287,7 @@ var CustomRefImpl = class {
1275
1287
  function customRef(factory) {
1276
1288
  return new CustomRefImpl(factory);
1277
1289
  }
1278
- function toRefs$1(object) {
1290
+ function toRefs(object) {
1279
1291
  if (!!(process.env.NODE_ENV !== "production") && !isProxy(object)) warn$2(`toRefs() expects a reactive object but received a plain one.`);
1280
1292
  const ret = isArray(object) ? new Array(object.length) : {};
1281
1293
  for (const key in object) ret[key] = propertyToRef(object, key);
@@ -1288,16 +1300,31 @@ var ObjectRefImpl = class {
1288
1300
  this._defaultValue = _defaultValue;
1289
1301
  this["__v_isRef"] = true;
1290
1302
  this._value = void 0;
1303
+ this._raw = toRaw(_object);
1304
+ let shallow = true;
1305
+ let obj = _object;
1306
+ if (!isArray(_object) || !isIntegerKey(String(_key))) do
1307
+ shallow = !isProxy(obj) || isShallow(obj);
1308
+ while (shallow && (obj = obj["__v_raw"]));
1309
+ this._shallow = shallow;
1291
1310
  }
1292
1311
  get value() {
1293
- const val = this._object[this._key];
1312
+ let val = this._object[this._key];
1313
+ if (this._shallow) val = unref(val);
1294
1314
  return this._value = val === void 0 ? this._defaultValue : val;
1295
1315
  }
1296
1316
  set value(newVal) {
1317
+ if (this._shallow && isRef(this._raw[this._key])) {
1318
+ const nestedRef = this._object[this._key];
1319
+ if (isRef(nestedRef)) {
1320
+ nestedRef.value = newVal;
1321
+ return;
1322
+ }
1323
+ }
1297
1324
  this._object[this._key] = newVal;
1298
1325
  }
1299
1326
  get dep() {
1300
- return getDepFromReactive(toRaw(this._object), this._key);
1327
+ return getDepFromReactive(this._raw, this._key);
1301
1328
  }
1302
1329
  };
1303
1330
  var GetterRefImpl = class {
@@ -1318,8 +1345,7 @@ function toRef$1(source, key, defaultValue) {
1318
1345
  else return ref(source);
1319
1346
  }
1320
1347
  function propertyToRef(source, key, defaultValue) {
1321
- const val = source[key];
1322
- return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1348
+ return new ObjectRefImpl(source, key, defaultValue);
1323
1349
  }
1324
1350
  var ComputedRefImpl = class {
1325
1351
  constructor(fn, setter, isSSR) {
@@ -1421,7 +1447,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
1421
1447
  if (isShallow(source2) || deep === false || deep === 0) return traverse(source2, 1);
1422
1448
  return traverse(source2);
1423
1449
  };
1424
- let effect$1;
1450
+ let effect;
1425
1451
  let getter;
1426
1452
  let cleanup;
1427
1453
  let boundCleanup;
@@ -1453,7 +1479,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
1453
1479
  }
1454
1480
  }
1455
1481
  const currentEffect = activeWatcher;
1456
- activeWatcher = effect$1;
1482
+ activeWatcher = effect;
1457
1483
  try {
1458
1484
  return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
1459
1485
  } finally {
@@ -1471,8 +1497,8 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
1471
1497
  }
1472
1498
  const scope = getCurrentScope();
1473
1499
  const watchHandle = () => {
1474
- effect$1.stop();
1475
- if (scope && scope.active) remove(scope.effects, effect$1);
1500
+ effect.stop();
1501
+ if (scope && scope.active) remove(scope.effects, effect);
1476
1502
  };
1477
1503
  if (once && cb) {
1478
1504
  const _cb = cb;
@@ -1483,13 +1509,13 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
1483
1509
  }
1484
1510
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
1485
1511
  const job = (immediateFirstRun) => {
1486
- if (!(effect$1.flags & 1) || !effect$1.dirty && !immediateFirstRun) return;
1512
+ if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) return;
1487
1513
  if (cb) {
1488
- const newValue = effect$1.run();
1514
+ const newValue = effect.run();
1489
1515
  if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
1490
1516
  if (cleanup) cleanup();
1491
1517
  const currentWatcher = activeWatcher;
1492
- activeWatcher = effect$1;
1518
+ activeWatcher = effect;
1493
1519
  try {
1494
1520
  const args = [
1495
1521
  newValue,
@@ -1502,30 +1528,30 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
1502
1528
  activeWatcher = currentWatcher;
1503
1529
  }
1504
1530
  }
1505
- } else effect$1.run();
1531
+ } else effect.run();
1506
1532
  };
1507
1533
  if (augmentJob) augmentJob(job);
1508
- effect$1 = new ReactiveEffect(getter);
1509
- effect$1.scheduler = scheduler ? () => scheduler(job, false) : job;
1510
- boundCleanup = (fn) => onWatcherCleanup(fn, false, effect$1);
1511
- cleanup = effect$1.onStop = () => {
1512
- const cleanups = cleanupMap.get(effect$1);
1534
+ effect = new ReactiveEffect(getter);
1535
+ effect.scheduler = scheduler ? () => scheduler(job, false) : job;
1536
+ boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);
1537
+ cleanup = effect.onStop = () => {
1538
+ const cleanups = cleanupMap.get(effect);
1513
1539
  if (cleanups) {
1514
1540
  if (call) call(cleanups, 4);
1515
1541
  else for (const cleanup2 of cleanups) cleanup2();
1516
- cleanupMap.delete(effect$1);
1542
+ cleanupMap.delete(effect);
1517
1543
  }
1518
1544
  };
1519
1545
  if (!!(process.env.NODE_ENV !== "production")) {
1520
- effect$1.onTrack = options.onTrack;
1521
- effect$1.onTrigger = options.onTrigger;
1546
+ effect.onTrack = options.onTrack;
1547
+ effect.onTrigger = options.onTrigger;
1522
1548
  }
1523
1549
  if (cb) if (immediate) job(true);
1524
- else oldValue = effect$1.run();
1550
+ else oldValue = effect.run();
1525
1551
  else if (scheduler) scheduler(job.bind(null, true), true);
1526
- else effect$1.run();
1527
- watchHandle.pause = effect$1.pause.bind(effect$1);
1528
- watchHandle.resume = effect$1.resume.bind(effect$1);
1552
+ else effect.run();
1553
+ watchHandle.pause = effect.pause.bind(effect);
1554
+ watchHandle.resume = effect.resume.bind(effect);
1529
1555
  watchHandle.stop = watchHandle;
1530
1556
  return watchHandle;
1531
1557
  }
@@ -1548,7 +1574,12 @@ function traverse(value, depth = Infinity, seen) {
1548
1574
  }
1549
1575
 
1550
1576
  //#endregion
1551
- //#region ../../node_modules/.pnpm/@vue+runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
1577
+ //#region ../../node_modules/.pnpm/@vue+runtime-core@3.5.26/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
1578
+ /**
1579
+ * @vue/runtime-core v3.5.26
1580
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
1581
+ * @license MIT
1582
+ **/
1552
1583
  const stack = [];
1553
1584
  function pushWarningContext(vnode) {
1554
1585
  stack.push(vnode);
@@ -2099,10 +2130,122 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
2099
2130
  }
2100
2131
  }
2101
2132
  }
2102
- const TeleportEndKey = Symbol("_vte");
2133
+ function provide(key, value) {
2134
+ if (!!(process.env.NODE_ENV !== "production")) {
2135
+ if (!currentInstance || currentInstance.isMounted) warn$1(`provide() can only be used inside setup().`);
2136
+ }
2137
+ if (currentInstance) {
2138
+ let provides = currentInstance.provides;
2139
+ const parentProvides = currentInstance.parent && currentInstance.parent.provides;
2140
+ if (parentProvides === provides) provides = currentInstance.provides = Object.create(parentProvides);
2141
+ provides[key] = value;
2142
+ }
2143
+ }
2144
+ function inject(key, defaultValue, treatDefaultAsFactory = false) {
2145
+ const instance = getCurrentInstance();
2146
+ if (instance || currentApp) {
2147
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
2148
+ if (provides && key in provides) return provides[key];
2149
+ else if (arguments.length > 1) return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
2150
+ else if (!!(process.env.NODE_ENV !== "production")) warn$1(`injection "${String(key)}" not found.`);
2151
+ } else if (!!(process.env.NODE_ENV !== "production")) warn$1(`inject() can only be used inside setup() or functional components.`);
2152
+ }
2153
+ function hasInjectionContext() {
2154
+ return !!(getCurrentInstance() || currentApp);
2155
+ }
2156
+ const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
2157
+ const useSSRContext = () => {
2158
+ {
2159
+ const ctx = inject(ssrContextKey);
2160
+ if (!ctx) process.env.NODE_ENV !== "production" && warn$1(`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`);
2161
+ return ctx;
2162
+ }
2163
+ };
2164
+ function watchEffect(effect, options) {
2165
+ return doWatch(effect, null, options);
2166
+ }
2167
+ function watch(source, cb, options) {
2168
+ if (!!(process.env.NODE_ENV !== "production") && !isFunction(cb)) warn$1(`\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`);
2169
+ return doWatch(source, cb, options);
2170
+ }
2171
+ function doWatch(source, cb, options = EMPTY_OBJ) {
2172
+ const { immediate, deep, flush, once } = options;
2173
+ if (!!(process.env.NODE_ENV !== "production") && !cb) {
2174
+ if (immediate !== void 0) warn$1(`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`);
2175
+ if (deep !== void 0) warn$1(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`);
2176
+ if (once !== void 0) warn$1(`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`);
2177
+ }
2178
+ const baseWatchOptions = extend({}, options);
2179
+ if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
2180
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
2181
+ let ssrCleanup;
2182
+ if (isInSSRComponentSetup) {
2183
+ if (flush === "sync") {
2184
+ const ctx = useSSRContext();
2185
+ ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
2186
+ } else if (!runsImmediately) {
2187
+ const watchStopHandle = () => {};
2188
+ watchStopHandle.stop = NOOP;
2189
+ watchStopHandle.resume = NOOP;
2190
+ watchStopHandle.pause = NOOP;
2191
+ return watchStopHandle;
2192
+ }
2193
+ }
2194
+ const instance = currentInstance;
2195
+ baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
2196
+ let isPre = false;
2197
+ if (flush === "post") baseWatchOptions.scheduler = (job) => {
2198
+ queuePostRenderEffect(job, instance && instance.suspense);
2199
+ };
2200
+ else if (flush !== "sync") {
2201
+ isPre = true;
2202
+ baseWatchOptions.scheduler = (job, isFirstRun) => {
2203
+ if (isFirstRun) job();
2204
+ else queueJob(job);
2205
+ };
2206
+ }
2207
+ baseWatchOptions.augmentJob = (job) => {
2208
+ if (cb) job.flags |= 4;
2209
+ if (isPre) {
2210
+ job.flags |= 2;
2211
+ if (instance) {
2212
+ job.id = instance.uid;
2213
+ job.i = instance;
2214
+ }
2215
+ }
2216
+ };
2217
+ const watchHandle = watch$1(source, cb, baseWatchOptions);
2218
+ if (isInSSRComponentSetup) {
2219
+ if (ssrCleanup) ssrCleanup.push(watchHandle);
2220
+ else if (runsImmediately) watchHandle();
2221
+ }
2222
+ return watchHandle;
2223
+ }
2224
+ function instanceWatch(source, value, options) {
2225
+ const publicThis = this.proxy;
2226
+ const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
2227
+ let cb;
2228
+ if (isFunction(value)) cb = value;
2229
+ else {
2230
+ cb = value.handler;
2231
+ options = value;
2232
+ }
2233
+ const reset = setCurrentInstance(this);
2234
+ const res = doWatch(getter, cb.bind(publicThis), options);
2235
+ reset();
2236
+ return res;
2237
+ }
2238
+ function createPathGetter(ctx, path) {
2239
+ const segments = path.split(".");
2240
+ return () => {
2241
+ let cur = ctx;
2242
+ for (let i = 0; i < segments.length && cur; i++) cur = cur[segments[i]];
2243
+ return cur;
2244
+ };
2245
+ }
2246
+ const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
2103
2247
  const isTeleport = (type) => type.__isTeleport;
2104
- const leaveCbKey = Symbol("_leaveCb");
2105
- const enterCbKey$1 = Symbol("_enterCb");
2248
+ const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
2106
2249
  function setTransitionHooks(vnode, hooks) {
2107
2250
  if (vnode.shapeFlag & 6 && vnode.component) {
2108
2251
  vnode.transition = hooks;
@@ -2164,10 +2307,10 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
2164
2307
  const rawSetupState = toRaw(setupState);
2165
2308
  const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => {
2166
2309
  if (!!(process.env.NODE_ENV !== "production")) {
2167
- if (hasOwn$1(rawSetupState, key) && !isRef(rawSetupState[key])) warn$1(`Template ref "${key}" used on a non-ref value. It will not work in the production build.`);
2310
+ if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) warn$1(`Template ref "${key}" used on a non-ref value. It will not work in the production build.`);
2168
2311
  if (knownTemplateRefs.has(rawSetupState[key])) return false;
2169
2312
  }
2170
- return hasOwn$1(rawSetupState, key);
2313
+ return hasOwn(rawSetupState, key);
2171
2314
  };
2172
2315
  const canSetRef = (ref2) => {
2173
2316
  return !!!(process.env.NODE_ENV !== "production") || !knownTemplateRefs.has(ref2);
@@ -2279,10 +2422,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
2279
2422
  if (prepend) hooks.unshift(wrappedHook);
2280
2423
  else hooks.push(wrappedHook);
2281
2424
  return wrappedHook;
2282
- } else if (!!(process.env.NODE_ENV !== "production")) {
2283
- const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
2284
- warn$1(`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`);
2285
- }
2425
+ } else if (!!(process.env.NODE_ENV !== "production")) warn$1(`${toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""))} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`);
2286
2426
  }
2287
2427
  const createHook = (lifecycle) => (hook, target = currentInstance) => {
2288
2428
  if (!isInSSRComponentSetup || lifecycle === "sp") injectHook(lifecycle, (...args) => hook(...args), target);
@@ -2299,7 +2439,7 @@ const onRenderTracked = createHook("rtc");
2299
2439
  function onErrorCaptured(hook, target = currentInstance) {
2300
2440
  injectHook("ec", hook, target);
2301
2441
  }
2302
- const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
2442
+ const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
2303
2443
  function renderList(source, renderItem, cache, index) {
2304
2444
  let ret;
2305
2445
  const cached = cache && cache[index];
@@ -2385,13 +2525,12 @@ const publicPropertiesMap = /* @__PURE__ */ extend(/* @__PURE__ */ Object.create
2385
2525
  $watch: (i) => __VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP
2386
2526
  });
2387
2527
  const isReservedPrefix = (key) => key === "_" || key === "$";
2388
- const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$1(state, key);
2528
+ const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
2389
2529
  const PublicInstanceProxyHandlers = {
2390
2530
  get({ _: instance }, key) {
2391
2531
  if (key === "__v_skip") return true;
2392
2532
  const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
2393
2533
  if (!!(process.env.NODE_ENV !== "production") && key === "__isVue") return true;
2394
- let normalizedProps;
2395
2534
  if (key[0] !== "$") {
2396
2535
  const n = accessCache[key];
2397
2536
  if (n !== void 0) switch (n) {
@@ -2403,13 +2542,13 @@ const PublicInstanceProxyHandlers = {
2403
2542
  else if (hasSetupBinding(setupState, key)) {
2404
2543
  accessCache[key] = 1;
2405
2544
  return setupState[key];
2406
- } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
2545
+ } else if (__VUE_OPTIONS_API__ && data !== EMPTY_OBJ && hasOwn(data, key)) {
2407
2546
  accessCache[key] = 2;
2408
2547
  return data[key];
2409
- } else if ((normalizedProps = instance.propsOptions[0]) && hasOwn$1(normalizedProps, key)) {
2548
+ } else if (hasOwn(props, key)) {
2410
2549
  accessCache[key] = 3;
2411
2550
  return props[key];
2412
- } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) {
2551
+ } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
2413
2552
  accessCache[key] = 4;
2414
2553
  return ctx[key];
2415
2554
  } else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) accessCache[key] = 0;
@@ -2423,12 +2562,12 @@ const PublicInstanceProxyHandlers = {
2423
2562
  } else if (!!(process.env.NODE_ENV !== "production") && key === "$slots") track(instance, "get", key);
2424
2563
  return publicGetter(instance);
2425
2564
  } else if ((cssModule = type.__cssModules) && (cssModule = cssModule[key])) return cssModule;
2426
- else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) {
2565
+ else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
2427
2566
  accessCache[key] = 4;
2428
2567
  return ctx[key];
2429
- } else if (globalProperties = appContext.config.globalProperties, hasOwn$1(globalProperties, key)) return globalProperties[key];
2568
+ } else if (globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)) return globalProperties[key];
2430
2569
  else if (!!(process.env.NODE_ENV !== "production") && currentRenderingInstance && (!isString(key) || key.indexOf("__v") !== 0)) {
2431
- if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn$1(data, key)) warn$1(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`);
2570
+ if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) warn$1(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`);
2432
2571
  else if (instance === currentRenderingInstance) warn$1(`Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`);
2433
2572
  }
2434
2573
  },
@@ -2437,13 +2576,13 @@ const PublicInstanceProxyHandlers = {
2437
2576
  if (hasSetupBinding(setupState, key)) {
2438
2577
  setupState[key] = value;
2439
2578
  return true;
2440
- } else if (!!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup && hasOwn$1(setupState, key)) {
2579
+ } else if (!!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup && hasOwn(setupState, key)) {
2441
2580
  warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
2442
2581
  return false;
2443
- } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
2582
+ } else if (__VUE_OPTIONS_API__ && data !== EMPTY_OBJ && hasOwn(data, key)) {
2444
2583
  data[key] = value;
2445
2584
  return true;
2446
- } else if (hasOwn$1(instance.props, key)) {
2585
+ } else if (hasOwn(instance.props, key)) {
2447
2586
  process.env.NODE_ENV !== "production" && warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
2448
2587
  return false;
2449
2588
  }
@@ -2458,13 +2597,13 @@ const PublicInstanceProxyHandlers = {
2458
2597
  else ctx[key] = value;
2459
2598
  return true;
2460
2599
  },
2461
- has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions, type } }, key) {
2462
- let normalizedProps, cssModules;
2463
- return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn$1(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn$1(normalizedProps, key) || hasOwn$1(ctx, key) || hasOwn$1(publicPropertiesMap, key) || hasOwn$1(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
2600
+ has({ _: { data, setupState, accessCache, ctx, appContext, props, type } }, key) {
2601
+ let cssModules;
2602
+ return !!(accessCache[key] || __VUE_OPTIONS_API__ && data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || hasOwn(props, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
2464
2603
  },
2465
2604
  defineProperty(target, key, descriptor) {
2466
2605
  if (descriptor.get != null) target._.accessCache[key] = 0;
2467
- else if (hasOwn$1(descriptor, "value")) this.set(target, key, descriptor.value, null);
2606
+ else if (hasOwn(descriptor, "value")) this.set(target, key, descriptor.value, null);
2468
2607
  return Reflect.defineProperty(target, key, descriptor);
2469
2608
  }
2470
2609
  };
@@ -2520,11 +2659,6 @@ function exposeSetupStateOnRenderContext(instance) {
2520
2659
  function normalizePropsOrEmits(props) {
2521
2660
  return isArray(props) ? props.reduce((normalized, p$1) => (normalized[p$1] = null, normalized), {}) : props;
2522
2661
  }
2523
- function mergeModels(a, b) {
2524
- if (!a || !b) return a || b;
2525
- if (isArray(a) && isArray(b)) return a.concat(b);
2526
- return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
2527
- }
2528
2662
  function createDuplicateChecker() {
2529
2663
  const cache = /* @__PURE__ */ Object.create(null);
2530
2664
  return (type, key) => {
@@ -2582,12 +2716,11 @@ function applyOptions(instance) {
2582
2716
  const opt = computedOptions[key];
2583
2717
  const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
2584
2718
  if (!!(process.env.NODE_ENV !== "production") && get === NOOP) warn$1(`Computed property "${key}" has no getter.`);
2585
- const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : !!(process.env.NODE_ENV !== "production") ? () => {
2586
- warn$1(`Write operation failed: computed property "${key}" is readonly.`);
2587
- } : NOOP;
2588
2719
  const c = computed({
2589
2720
  get,
2590
- set
2721
+ set: !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : !!(process.env.NODE_ENV !== "production") ? () => {
2722
+ warn$1(`Write operation failed: computed property "${key}" is readonly.`);
2723
+ } : NOOP
2591
2724
  });
2592
2725
  Object.defineProperty(ctx, key, {
2593
2726
  enumerable: true,
@@ -2658,7 +2791,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP)
2658
2791
  }
2659
2792
  }
2660
2793
  function callHook(hook, instance, type) {
2661
- callWithAsyncErrorHandling(isArray(hook) ? hook.map((h$1) => h$1.bind(instance.proxy)) : hook.bind(instance.proxy), instance, type);
2794
+ callWithAsyncErrorHandling(isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy), instance, type);
2662
2795
  }
2663
2796
  function createWatcher(raw, ctx, publicThis, key) {
2664
2797
  let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
@@ -2886,7 +3019,7 @@ If you want to remount the same app, move your app creation logic into a factory
2886
3019
  } else if (!!(process.env.NODE_ENV !== "production")) warn$1(`Cannot unmount an app that is not mounted.`);
2887
3020
  },
2888
3021
  provide(key, value) {
2889
- if (!!(process.env.NODE_ENV !== "production") && key in context.provides) if (hasOwn$1(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
3022
+ if (!!(process.env.NODE_ENV !== "production") && 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.`);
2890
3023
  else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
2891
3024
  context.provides[key] = value;
2892
3025
  return app;
@@ -2905,487 +3038,718 @@ If you want to remount the same app, move your app creation logic into a factory
2905
3038
  };
2906
3039
  }
2907
3040
  let currentApp = null;
2908
- function provide(key, value) {
2909
- if (!currentInstance) {
2910
- if (!!(process.env.NODE_ENV !== "production")) warn$1(`provide() can only be used inside setup().`);
2911
- } else {
2912
- let provides = currentInstance.provides;
2913
- const parentProvides = currentInstance.parent && currentInstance.parent.provides;
2914
- if (parentProvides === provides) provides = currentInstance.provides = Object.create(parentProvides);
2915
- provides[key] = value;
2916
- }
2917
- }
2918
- function inject(key, defaultValue, treatDefaultAsFactory = false) {
2919
- const instance = getCurrentInstance();
2920
- if (instance || currentApp) {
2921
- let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
2922
- if (provides && key in provides) return provides[key];
2923
- else if (arguments.length > 1) return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
2924
- else if (!!(process.env.NODE_ENV !== "production")) warn$1(`injection "${String(key)}" not found.`);
2925
- } else if (!!(process.env.NODE_ENV !== "production")) warn$1(`inject() can only be used inside setup() or functional components.`);
2926
- }
2927
- function hasInjectionContext() {
2928
- return !!(getCurrentInstance() || currentApp);
2929
- }
2930
- const internalObjectProto = {};
2931
- const createInternalObject = () => Object.create(internalObjectProto);
2932
- const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
2933
- function initProps(instance, rawProps, isStateful, isSSR = false) {
2934
- const props = {};
2935
- const attrs = createInternalObject();
2936
- instance.propsDefaults = /* @__PURE__ */ Object.create(null);
2937
- setFullProps(instance, rawProps, props, attrs);
2938
- for (const key in instance.propsOptions[0]) if (!(key in props)) props[key] = void 0;
2939
- if (!!(process.env.NODE_ENV !== "production")) validateProps(rawProps || {}, props, instance);
2940
- if (isStateful) instance.props = isSSR ? props : shallowReactive(props);
2941
- else if (!instance.type.props) instance.props = attrs;
2942
- else instance.props = props;
2943
- instance.attrs = attrs;
2944
- }
2945
- function isInHmrContext(instance) {
2946
- while (instance) {
2947
- if (instance.type.__hmrId) return true;
2948
- instance = instance.parent;
2949
- }
2950
- }
2951
- function updateProps(instance, rawProps, rawPrevProps, optimized) {
2952
- const { props, attrs, vnode: { patchFlag } } = instance;
2953
- const rawCurrentProps = toRaw(props);
2954
- const [options] = instance.propsOptions;
2955
- let hasAttrsChanged = false;
2956
- if (!(!!(process.env.NODE_ENV !== "production") && isInHmrContext(instance)) && (optimized || patchFlag > 0) && !(patchFlag & 16)) {
2957
- if (patchFlag & 8) {
2958
- const propsToUpdate = instance.vnode.dynamicProps;
2959
- for (let i = 0; i < propsToUpdate.length; i++) {
2960
- let key = propsToUpdate[i];
2961
- if (isEmitListener(instance.emitsOptions, key)) continue;
2962
- const value = rawProps[key];
2963
- if (options) if (hasOwn$1(attrs, key)) {
2964
- if (value !== attrs[key]) {
2965
- attrs[key] = value;
2966
- hasAttrsChanged = true;
2967
- }
2968
- } else {
2969
- const camelizedKey = camelize$1(key);
2970
- props[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance, false);
2971
- }
2972
- else if (value !== attrs[key]) {
2973
- attrs[key] = value;
2974
- hasAttrsChanged = true;
2975
- }
2976
- }
2977
- }
2978
- } else {
2979
- if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
2980
- let kebabKey;
2981
- for (const key in rawCurrentProps) if (!rawProps || !hasOwn$1(rawProps, key) && ((kebabKey = hyphenate$1(key)) === key || !hasOwn$1(rawProps, kebabKey))) if (options) {
2982
- if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, rawCurrentProps, key, void 0, instance, true);
2983
- } else delete props[key];
2984
- if (attrs !== rawCurrentProps) {
2985
- for (const key in attrs) if (!rawProps || !hasOwn$1(rawProps, key) && true) {
2986
- delete attrs[key];
2987
- hasAttrsChanged = true;
3041
+ const getModelModifiers = (props, modelName) => {
3042
+ return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize$1(modelName)}Modifiers`] || props[`${hyphenate$1(modelName)}Modifiers`];
3043
+ };
3044
+ function emit(instance, event, ...rawArgs) {
3045
+ if (instance.isUnmounted) return;
3046
+ const props = instance.vnode.props || EMPTY_OBJ;
3047
+ if (!!(process.env.NODE_ENV !== "production")) {
3048
+ const { emitsOptions, propsOptions: [propsOptions] } = instance;
3049
+ if (emitsOptions) if (!(event in emitsOptions) && true) {
3050
+ if (!propsOptions || !(toHandlerKey(camelize$1(event)) in propsOptions)) warn$1(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize$1(event))}" prop.`);
3051
+ } else {
3052
+ const validator = emitsOptions[event];
3053
+ if (isFunction(validator)) {
3054
+ if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
2988
3055
  }
2989
3056
  }
2990
3057
  }
2991
- if (hasAttrsChanged) trigger(instance.attrs, "set", "");
2992
- if (!!(process.env.NODE_ENV !== "production")) validateProps(rawProps || {}, props, instance);
2993
- }
2994
- function setFullProps(instance, rawProps, props, attrs) {
2995
- const [options, needCastKeys] = instance.propsOptions;
2996
- let hasAttrsChanged = false;
2997
- let rawCastValues;
2998
- if (rawProps) for (let key in rawProps) {
2999
- if (isReservedProp(key)) continue;
3000
- const value = rawProps[key];
3001
- let camelKey;
3002
- if (options && hasOwn$1(options, camelKey = camelize$1(key))) if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
3003
- else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
3004
- else if (!isEmitListener(instance.emitsOptions, key)) {
3005
- if (!(key in attrs) || value !== attrs[key]) {
3006
- attrs[key] = value;
3007
- hasAttrsChanged = true;
3008
- }
3009
- }
3058
+ let args = rawArgs;
3059
+ const isModelListener$1 = event.startsWith("update:");
3060
+ const modifiers = isModelListener$1 && getModelModifiers(props, event.slice(7));
3061
+ if (modifiers) {
3062
+ if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
3063
+ if (modifiers.number) args = rawArgs.map(looseToNumber);
3010
3064
  }
3011
- if (needCastKeys) {
3012
- const rawCurrentProps = toRaw(props);
3013
- const castValues = rawCastValues || EMPTY_OBJ;
3014
- for (let i = 0; i < needCastKeys.length; i++) {
3015
- const key = needCastKeys[i];
3016
- props[key] = resolvePropValue(options, rawCurrentProps, key, castValues[key], instance, !hasOwn$1(castValues, key));
3017
- }
3065
+ if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) devtoolsComponentEmit(instance, event, args);
3066
+ if (!!(process.env.NODE_ENV !== "production")) {
3067
+ const lowerCaseEvent = event.toLowerCase();
3068
+ if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) warn$1(`Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(instance, instance.type)} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate$1(event)}" instead of "${event}".`);
3018
3069
  }
3019
- return hasAttrsChanged;
3020
- }
3021
- function resolvePropValue(options, props, key, value, instance, isAbsent) {
3022
- const opt = options[key];
3023
- if (opt != null) {
3024
- const hasDefault = hasOwn$1(opt, "default");
3025
- if (hasDefault && value === void 0) {
3026
- const defaultValue = opt.default;
3027
- if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
3028
- const { propsDefaults } = instance;
3029
- if (key in propsDefaults) value = propsDefaults[key];
3030
- else {
3031
- const reset = setCurrentInstance(instance);
3032
- value = propsDefaults[key] = defaultValue.call(null, props);
3033
- reset();
3034
- }
3035
- } else value = defaultValue;
3036
- if (instance.ce) instance.ce._setProp(key, value);
3037
- }
3038
- if (opt[0]) {
3039
- if (isAbsent && !hasDefault) value = false;
3040
- else if (opt[1] && (value === "" || value === hyphenate$1(key))) value = true;
3041
- }
3070
+ let handlerName;
3071
+ let handler = props[handlerName = toHandlerKey(event)] || props[handlerName = toHandlerKey(camelize$1(event))];
3072
+ if (!handler && isModelListener$1) handler = props[handlerName = toHandlerKey(hyphenate$1(event))];
3073
+ if (handler) callWithAsyncErrorHandling(handler, instance, 6, args);
3074
+ const onceHandler = props[handlerName + `Once`];
3075
+ if (onceHandler) {
3076
+ if (!instance.emitted) instance.emitted = {};
3077
+ else if (instance.emitted[handlerName]) return;
3078
+ instance.emitted[handlerName] = true;
3079
+ callWithAsyncErrorHandling(onceHandler, instance, 6, args);
3042
3080
  }
3043
- return value;
3044
3081
  }
3045
- const mixinPropsCache = /* @__PURE__ */ new WeakMap();
3046
- function normalizePropsOptions(comp, appContext, asMixin = false) {
3047
- const cache = __VUE_OPTIONS_API__ && asMixin ? mixinPropsCache : appContext.propsCache;
3082
+ const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
3083
+ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
3084
+ const cache = __VUE_OPTIONS_API__ && asMixin ? mixinEmitsCache : appContext.emitsCache;
3048
3085
  const cached = cache.get(comp);
3049
- if (cached) return cached;
3050
- const raw = comp.props;
3051
- const normalized = {};
3052
- const needCastKeys = [];
3086
+ if (cached !== void 0) return cached;
3087
+ const raw = comp.emits;
3088
+ let normalized = {};
3053
3089
  let hasExtends = false;
3054
3090
  if (__VUE_OPTIONS_API__ && !isFunction(comp)) {
3055
- const extendProps = (raw2) => {
3056
- hasExtends = true;
3057
- const [props, keys] = normalizePropsOptions(raw2, appContext, true);
3058
- extend(normalized, props);
3059
- if (keys) needCastKeys.push(...keys);
3091
+ const extendEmits = (raw2) => {
3092
+ const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
3093
+ if (normalizedFromExtend) {
3094
+ hasExtends = true;
3095
+ extend(normalized, normalizedFromExtend);
3096
+ }
3060
3097
  };
3061
- if (!asMixin && appContext.mixins.length) appContext.mixins.forEach(extendProps);
3062
- if (comp.extends) extendProps(comp.extends);
3063
- if (comp.mixins) comp.mixins.forEach(extendProps);
3098
+ if (!asMixin && appContext.mixins.length) appContext.mixins.forEach(extendEmits);
3099
+ if (comp.extends) extendEmits(comp.extends);
3100
+ if (comp.mixins) comp.mixins.forEach(extendEmits);
3064
3101
  }
3065
3102
  if (!raw && !hasExtends) {
3066
- if (isObject$1(comp)) cache.set(comp, EMPTY_ARR);
3067
- return EMPTY_ARR;
3103
+ if (isObject$1(comp)) cache.set(comp, null);
3104
+ return null;
3068
3105
  }
3069
- if (isArray(raw)) for (let i = 0; i < raw.length; i++) {
3070
- if (!!(process.env.NODE_ENV !== "production") && !isString(raw[i])) warn$1(`props must be strings when using array syntax.`, raw[i]);
3071
- const normalizedKey = camelize$1(raw[i]);
3072
- if (validatePropName(normalizedKey)) normalized[normalizedKey] = EMPTY_OBJ;
3106
+ if (isArray(raw)) raw.forEach((key) => normalized[key] = null);
3107
+ else extend(normalized, raw);
3108
+ if (isObject$1(comp)) cache.set(comp, normalized);
3109
+ return normalized;
3110
+ }
3111
+ function isEmitListener(options, key) {
3112
+ if (!options || !isOn(key)) return false;
3113
+ key = key.slice(2).replace(/Once$/, "");
3114
+ return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate$1(key)) || hasOwn(options, key);
3115
+ }
3116
+ let accessedAttrs = false;
3117
+ function markAttrsAccessed() {
3118
+ accessedAttrs = true;
3119
+ }
3120
+ function renderComponentRoot(instance) {
3121
+ const { type: Component, vnode, proxy, withProxy, propsOptions: [propsOptions], slots, attrs, emit: emit$2, render: render$1, renderCache, props, data, setupState, ctx, inheritAttrs } = instance;
3122
+ const prev = setCurrentRenderingInstance(instance);
3123
+ let result;
3124
+ let fallthroughAttrs;
3125
+ if (!!(process.env.NODE_ENV !== "production")) accessedAttrs = false;
3126
+ try {
3127
+ if (vnode.shapeFlag & 4) {
3128
+ const proxyToUse = withProxy || proxy;
3129
+ const thisProxy = !!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup ? new Proxy(proxyToUse, { get(target, key, receiver) {
3130
+ warn$1(`Property '${String(key)}' was accessed via 'this'. Avoid using 'this' in templates.`);
3131
+ return Reflect.get(target, key, receiver);
3132
+ } }) : proxyToUse;
3133
+ result = normalizeVNode(render$1.call(thisProxy, proxyToUse, renderCache, !!(process.env.NODE_ENV !== "production") ? shallowReadonly(props) : props, setupState, data, ctx));
3134
+ fallthroughAttrs = attrs;
3135
+ } else {
3136
+ const render2 = Component;
3137
+ if (!!(process.env.NODE_ENV !== "production") && attrs === props) markAttrsAccessed();
3138
+ result = normalizeVNode(render2.length > 1 ? render2(!!(process.env.NODE_ENV !== "production") ? shallowReadonly(props) : props, !!(process.env.NODE_ENV !== "production") ? {
3139
+ get attrs() {
3140
+ markAttrsAccessed();
3141
+ return shallowReadonly(attrs);
3142
+ },
3143
+ slots,
3144
+ emit: emit$2
3145
+ } : {
3146
+ attrs,
3147
+ slots,
3148
+ emit: emit$2
3149
+ }) : render2(!!(process.env.NODE_ENV !== "production") ? shallowReadonly(props) : props, null));
3150
+ fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
3151
+ }
3152
+ } catch (err) {
3153
+ blockStack.length = 0;
3154
+ handleError(err, instance, 1);
3155
+ result = createVNode(Comment);
3073
3156
  }
3074
- else if (raw) {
3075
- if (!!(process.env.NODE_ENV !== "production") && !isObject$1(raw)) warn$1(`invalid props options`, raw);
3076
- for (const key in raw) {
3077
- const normalizedKey = camelize$1(key);
3078
- if (validatePropName(normalizedKey)) {
3079
- const opt = raw[key];
3080
- const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
3081
- const propType = prop.type;
3082
- let shouldCast = false;
3083
- let shouldCastTrue = true;
3084
- if (isArray(propType)) for (let index = 0; index < propType.length; ++index) {
3085
- const type = propType[index];
3086
- const typeName = isFunction(type) && type.name;
3087
- if (typeName === "Boolean") {
3088
- shouldCast = true;
3089
- break;
3090
- } else if (typeName === "String") shouldCastTrue = false;
3157
+ let root = result;
3158
+ let setRoot = void 0;
3159
+ if (!!(process.env.NODE_ENV !== "production") && result.patchFlag > 0 && result.patchFlag & 2048) [root, setRoot] = getChildRoot(result);
3160
+ if (fallthroughAttrs && inheritAttrs !== false) {
3161
+ const keys = Object.keys(fallthroughAttrs);
3162
+ const { shapeFlag } = root;
3163
+ if (keys.length) {
3164
+ if (shapeFlag & 7) {
3165
+ if (propsOptions && keys.some(isModelListener)) fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
3166
+ root = cloneVNode(root, fallthroughAttrs, false, true);
3167
+ } else if (!!(process.env.NODE_ENV !== "production") && !accessedAttrs && root.type !== Comment) {
3168
+ const allAttrs = Object.keys(attrs);
3169
+ const eventAttrs = [];
3170
+ const extraAttrs = [];
3171
+ for (let i = 0, l = allAttrs.length; i < l; i++) {
3172
+ const key = allAttrs[i];
3173
+ if (isOn(key)) {
3174
+ if (!isModelListener(key)) eventAttrs.push(key[2].toLowerCase() + key.slice(3));
3175
+ } else extraAttrs.push(key);
3091
3176
  }
3092
- else shouldCast = isFunction(propType) && propType.name === "Boolean";
3093
- prop[0] = shouldCast;
3094
- prop[1] = shouldCastTrue;
3095
- if (shouldCast || hasOwn$1(prop, "default")) needCastKeys.push(normalizedKey);
3177
+ if (extraAttrs.length) warn$1(`Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`);
3178
+ if (eventAttrs.length) warn$1(`Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`);
3096
3179
  }
3097
3180
  }
3098
3181
  }
3099
- const res = [normalized, needCastKeys];
3100
- if (isObject$1(comp)) cache.set(comp, res);
3101
- return res;
3102
- }
3103
- function validatePropName(key) {
3104
- if (key[0] !== "$" && !isReservedProp(key)) return true;
3105
- else if (!!(process.env.NODE_ENV !== "production")) warn$1(`Invalid prop name: "${key}" is a reserved property.`);
3106
- return false;
3107
- }
3108
- function getType(ctor) {
3109
- if (ctor === null) return "null";
3110
- if (typeof ctor === "function") return ctor.name || "";
3111
- else if (typeof ctor === "object") return ctor.constructor && ctor.constructor.name || "";
3112
- return "";
3113
- }
3114
- function validateProps(rawProps, props, instance) {
3115
- const resolvedValues = toRaw(props);
3116
- const options = instance.propsOptions[0];
3117
- const camelizePropsKey = Object.keys(rawProps).map((key) => camelize$1(key));
3118
- for (const key in options) {
3119
- let opt = options[key];
3120
- if (opt == null) continue;
3121
- validateProp(key, resolvedValues[key], opt, !!(process.env.NODE_ENV !== "production") ? shallowReadonly(resolvedValues) : resolvedValues, !camelizePropsKey.includes(key));
3122
- }
3123
- }
3124
- function validateProp(name, value, prop, props, isAbsent) {
3125
- const { type, required, validator, skipCheck } = prop;
3126
- if (required && isAbsent) {
3127
- warn$1("Missing required prop: \"" + name + "\"");
3128
- return;
3182
+ if (vnode.dirs) {
3183
+ if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) warn$1(`Runtime directive used on component with non-element root node. The directives will not function as intended.`);
3184
+ root = cloneVNode(root, null, false, true);
3185
+ root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
3129
3186
  }
3130
- if (value == null && !required) return;
3131
- if (type != null && type !== true && !skipCheck) {
3132
- let isValid = false;
3133
- const types = isArray(type) ? type : [type];
3134
- const expectedTypes = [];
3135
- for (let i = 0; i < types.length && !isValid; i++) {
3136
- const { valid, expectedType } = assertType(value, types[i]);
3137
- expectedTypes.push(expectedType || "");
3138
- isValid = valid;
3139
- }
3140
- if (!isValid) {
3141
- warn$1(getInvalidTypeMessage(name, value, expectedTypes));
3142
- return;
3143
- }
3187
+ if (vnode.transition) {
3188
+ if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) warn$1(`Component inside <Transition> renders non-element root node that cannot be animated.`);
3189
+ setTransitionHooks(root, vnode.transition);
3144
3190
  }
3145
- if (validator && !validator(value, props)) warn$1("Invalid prop: custom validator check failed for prop \"" + name + "\".");
3191
+ if (!!(process.env.NODE_ENV !== "production") && setRoot) setRoot(root);
3192
+ else result = root;
3193
+ setCurrentRenderingInstance(prev);
3194
+ return result;
3146
3195
  }
3147
- const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
3148
- function assertType(value, type) {
3149
- let valid;
3150
- const expectedType = getType(type);
3151
- if (expectedType === "null") valid = value === null;
3152
- else if (isSimpleType(expectedType)) {
3153
- const t = typeof value;
3154
- valid = t === expectedType.toLowerCase();
3155
- if (!valid && t === "object") valid = value instanceof type;
3156
- } else if (expectedType === "Object") valid = isObject$1(value);
3157
- else if (expectedType === "Array") valid = isArray(value);
3158
- else valid = value instanceof type;
3159
- return {
3160
- valid,
3161
- expectedType
3196
+ const getChildRoot = (vnode) => {
3197
+ const rawChildren = vnode.children;
3198
+ const dynamicChildren = vnode.dynamicChildren;
3199
+ const childRoot = filterSingleRoot(rawChildren, false);
3200
+ if (!childRoot) return [vnode, void 0];
3201
+ else if (!!(process.env.NODE_ENV !== "production") && childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) return getChildRoot(childRoot);
3202
+ const index = rawChildren.indexOf(childRoot);
3203
+ const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
3204
+ const setRoot = (updatedRoot) => {
3205
+ rawChildren[index] = updatedRoot;
3206
+ if (dynamicChildren) {
3207
+ if (dynamicIndex > -1) dynamicChildren[dynamicIndex] = updatedRoot;
3208
+ else if (updatedRoot.patchFlag > 0) vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
3209
+ }
3162
3210
  };
3211
+ return [normalizeVNode(childRoot), setRoot];
3212
+ };
3213
+ function filterSingleRoot(children, recurse = true) {
3214
+ let singleRoot;
3215
+ for (let i = 0; i < children.length; i++) {
3216
+ const child = children[i];
3217
+ if (isVNode(child)) {
3218
+ if (child.type !== Comment || child.children === "v-if") if (singleRoot) return;
3219
+ else {
3220
+ singleRoot = child;
3221
+ if (!!(process.env.NODE_ENV !== "production") && recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
3222
+ }
3223
+ } else return;
3224
+ }
3225
+ return singleRoot;
3163
3226
  }
3164
- function getInvalidTypeMessage(name, value, expectedTypes) {
3165
- if (expectedTypes.length === 0) return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
3166
- let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
3167
- const expectedType = expectedTypes[0];
3168
- const receivedType = toRawType(value);
3169
- const expectedValue = styleValue(value, expectedType);
3170
- const receivedValue = styleValue(value, receivedType);
3171
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) message += ` with value ${expectedValue}`;
3172
- message += `, got ${receivedType} `;
3173
- if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
3174
- return message;
3175
- }
3176
- function styleValue(value, type) {
3177
- if (type === "String") return `"${value}"`;
3178
- else if (type === "Number") return `${Number(value)}`;
3179
- else return `${value}`;
3180
- }
3181
- function isExplicable(type) {
3182
- return [
3183
- "string",
3184
- "number",
3185
- "boolean"
3186
- ].some((elem) => type.toLowerCase() === elem);
3187
- }
3188
- function isBoolean(...args) {
3189
- return args.some((elem) => elem.toLowerCase() === "boolean");
3190
- }
3191
- const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
3192
- const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
3193
- const normalizeSlot = (key, rawSlot, ctx) => {
3194
- if (rawSlot._n) return rawSlot;
3195
- const normalized = withCtx((...args) => {
3196
- if (!!(process.env.NODE_ENV !== "production") && currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) warn$1(`Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`);
3197
- return normalizeSlotValue(rawSlot(...args));
3198
- }, ctx);
3199
- normalized._c = false;
3200
- return normalized;
3201
- };
3202
- const normalizeObjectSlots = (rawSlots, slots, instance) => {
3203
- const ctx = rawSlots._ctx;
3204
- for (const key in rawSlots) {
3205
- if (isInternalKey(key)) continue;
3206
- const value = rawSlots[key];
3207
- if (isFunction(value)) slots[key] = normalizeSlot(key, value, ctx);
3208
- else if (value != null) {
3209
- if (!!(process.env.NODE_ENV !== "production") && true) warn$1(`Non-function value encountered for slot "${key}". Prefer function slots for better performance.`);
3210
- const normalized = normalizeSlotValue(value);
3211
- slots[key] = () => normalized;
3212
- }
3213
- }
3214
- };
3215
- const normalizeVNodeSlots = (instance, children) => {
3216
- if (!!(process.env.NODE_ENV !== "production") && !isKeepAlive(instance.vnode) && true) warn$1(`Non-function value encountered for default slot. Prefer function slots for better performance.`);
3217
- const normalized = normalizeSlotValue(children);
3218
- instance.slots.default = () => normalized;
3227
+ const getFunctionalFallthrough = (attrs) => {
3228
+ let res;
3229
+ for (const key in attrs) if (key === "class" || key === "style" || isOn(key)) (res || (res = {}))[key] = attrs[key];
3230
+ return res;
3219
3231
  };
3220
- const assignSlots = (slots, children, optimized) => {
3221
- for (const key in children) if (optimized || !isInternalKey(key)) slots[key] = children[key];
3232
+ const filterModelListeners = (attrs, props) => {
3233
+ const res = {};
3234
+ for (const key in attrs) if (!isModelListener(key) || !(key.slice(9) in props)) res[key] = attrs[key];
3235
+ return res;
3222
3236
  };
3223
- const initSlots = (instance, children, optimized) => {
3224
- const slots = instance.slots = createInternalObject();
3225
- if (instance.vnode.shapeFlag & 32) {
3226
- const type = children._;
3227
- if (type) {
3228
- assignSlots(slots, children, optimized);
3229
- if (optimized) def(slots, "_", type, true);
3230
- } else normalizeObjectSlots(children, slots);
3231
- } else if (children) normalizeVNodeSlots(instance, children);
3237
+ const isElementRoot = (vnode) => {
3238
+ return vnode.shapeFlag & 7 || vnode.type === Comment;
3232
3239
  };
3233
- const updateSlots = (instance, children, optimized) => {
3234
- const { vnode, slots } = instance;
3235
- let needDeletionCheck = true;
3236
- let deletionComparisonTarget = EMPTY_OBJ;
3237
- if (vnode.shapeFlag & 32) {
3238
- const type = children._;
3239
- if (type) if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) {
3240
- assignSlots(slots, children, optimized);
3241
- trigger(instance, "set", "$slots");
3242
- } else if (optimized && type === 1) needDeletionCheck = false;
3243
- else assignSlots(slots, children, optimized);
3244
- else {
3245
- needDeletionCheck = !children.$stable;
3246
- normalizeObjectSlots(children, slots);
3240
+ function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
3241
+ const { props: prevProps, children: prevChildren, component } = prevVNode;
3242
+ const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
3243
+ const emits = component.emitsOptions;
3244
+ if (!!(process.env.NODE_ENV !== "production") && (prevChildren || nextChildren) && isHmrUpdating) return true;
3245
+ if (nextVNode.dirs || nextVNode.transition) return true;
3246
+ if (optimized && patchFlag >= 0) {
3247
+ if (patchFlag & 1024) return true;
3248
+ if (patchFlag & 16) {
3249
+ if (!prevProps) return !!nextProps;
3250
+ return hasPropsChanged(prevProps, nextProps, emits);
3251
+ } else if (patchFlag & 8) {
3252
+ const dynamicProps = nextVNode.dynamicProps;
3253
+ for (let i = 0; i < dynamicProps.length; i++) {
3254
+ const key = dynamicProps[i];
3255
+ if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) return true;
3256
+ }
3247
3257
  }
3248
- deletionComparisonTarget = children;
3249
- } else if (children) {
3250
- normalizeVNodeSlots(instance, children);
3251
- deletionComparisonTarget = { default: 1 };
3258
+ } else {
3259
+ if (prevChildren || nextChildren) {
3260
+ if (!nextChildren || !nextChildren.$stable) return true;
3261
+ }
3262
+ if (prevProps === nextProps) return false;
3263
+ if (!prevProps) return !!nextProps;
3264
+ if (!nextProps) return true;
3265
+ return hasPropsChanged(prevProps, nextProps, emits);
3252
3266
  }
3253
- if (needDeletionCheck) {
3254
- for (const key in slots) if (!isInternalKey(key) && deletionComparisonTarget[key] == null) delete slots[key];
3267
+ return false;
3268
+ }
3269
+ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
3270
+ const nextKeys = Object.keys(nextProps);
3271
+ if (nextKeys.length !== Object.keys(prevProps).length) return true;
3272
+ for (let i = 0; i < nextKeys.length; i++) {
3273
+ const key = nextKeys[i];
3274
+ if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) return true;
3255
3275
  }
3256
- };
3257
- let supported;
3258
- let perf;
3259
- function startMeasure(instance, type) {
3260
- if (instance.appContext.config.performance && isSupported()) perf.mark(`vue-${type}-${instance.uid}`);
3261
- if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
3276
+ return false;
3262
3277
  }
3263
- function endMeasure(instance, type) {
3264
- if (instance.appContext.config.performance && isSupported()) {
3265
- const startTag = `vue-${type}-${instance.uid}`;
3266
- const endTag = startTag + `:end`;
3267
- const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
3268
- perf.mark(endTag);
3269
- perf.measure(measureName, startTag, endTag);
3270
- perf.clearMeasures(measureName);
3271
- perf.clearMarks(startTag);
3272
- perf.clearMarks(endTag);
3278
+ function updateHOCHostEl({ vnode, parent }, el) {
3279
+ while (parent) {
3280
+ const root = parent.subTree;
3281
+ if (root.suspense && root.suspense.activeBranch === vnode) root.el = vnode.el;
3282
+ if (root === vnode) {
3283
+ (vnode = parent.vnode).el = el;
3284
+ parent = parent.parent;
3285
+ } else break;
3273
3286
  }
3274
- if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
3275
3287
  }
3276
- function isSupported() {
3277
- if (supported !== void 0) return supported;
3278
- if (typeof window !== "undefined" && window.performance) {
3279
- supported = true;
3280
- perf = window.performance;
3281
- } else supported = false;
3282
- return supported;
3288
+ const internalObjectProto = {};
3289
+ const createInternalObject = () => Object.create(internalObjectProto);
3290
+ const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
3291
+ function initProps(instance, rawProps, isStateful, isSSR = false) {
3292
+ const props = {};
3293
+ const attrs = createInternalObject();
3294
+ instance.propsDefaults = /* @__PURE__ */ Object.create(null);
3295
+ setFullProps(instance, rawProps, props, attrs);
3296
+ for (const key in instance.propsOptions[0]) if (!(key in props)) props[key] = void 0;
3297
+ if (!!(process.env.NODE_ENV !== "production")) validateProps(rawProps || {}, props, instance);
3298
+ if (isStateful) instance.props = isSSR ? props : shallowReactive(props);
3299
+ else if (!instance.type.props) instance.props = attrs;
3300
+ else instance.props = props;
3301
+ instance.attrs = attrs;
3283
3302
  }
3284
- function initFeatureFlags() {
3285
- const needWarn = [];
3286
- if (typeof __VUE_OPTIONS_API__ !== "boolean") {
3287
- process.env.NODE_ENV !== "production" && needWarn.push(`__VUE_OPTIONS_API__`);
3288
- getGlobalThis().__VUE_OPTIONS_API__ = true;
3303
+ function isInHmrContext(instance) {
3304
+ while (instance) {
3305
+ if (instance.type.__hmrId) return true;
3306
+ instance = instance.parent;
3289
3307
  }
3290
- if (typeof __VUE_PROD_DEVTOOLS__ !== "boolean") {
3291
- process.env.NODE_ENV !== "production" && needWarn.push(`__VUE_PROD_DEVTOOLS__`);
3292
- getGlobalThis().__VUE_PROD_DEVTOOLS__ = false;
3308
+ }
3309
+ function updateProps(instance, rawProps, rawPrevProps, optimized) {
3310
+ const { props, attrs, vnode: { patchFlag } } = instance;
3311
+ const rawCurrentProps = toRaw(props);
3312
+ const [options] = instance.propsOptions;
3313
+ let hasAttrsChanged = false;
3314
+ if (!(!!(process.env.NODE_ENV !== "production") && isInHmrContext(instance)) && (optimized || patchFlag > 0) && !(patchFlag & 16)) {
3315
+ if (patchFlag & 8) {
3316
+ const propsToUpdate = instance.vnode.dynamicProps;
3317
+ for (let i = 0; i < propsToUpdate.length; i++) {
3318
+ let key = propsToUpdate[i];
3319
+ if (isEmitListener(instance.emitsOptions, key)) continue;
3320
+ const value = rawProps[key];
3321
+ if (options) if (hasOwn(attrs, key)) {
3322
+ if (value !== attrs[key]) {
3323
+ attrs[key] = value;
3324
+ hasAttrsChanged = true;
3325
+ }
3326
+ } else {
3327
+ const camelizedKey = camelize$1(key);
3328
+ props[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance, false);
3329
+ }
3330
+ else if (value !== attrs[key]) {
3331
+ attrs[key] = value;
3332
+ hasAttrsChanged = true;
3333
+ }
3334
+ }
3335
+ }
3336
+ } else {
3337
+ if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
3338
+ let kebabKey;
3339
+ for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate$1(key)) === key || !hasOwn(rawProps, kebabKey))) if (options) {
3340
+ if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, rawCurrentProps, key, void 0, instance, true);
3341
+ } else delete props[key];
3342
+ if (attrs !== rawCurrentProps) {
3343
+ for (const key in attrs) if (!rawProps || !hasOwn(rawProps, key) && true) {
3344
+ delete attrs[key];
3345
+ hasAttrsChanged = true;
3346
+ }
3347
+ }
3293
3348
  }
3294
- if (typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ !== "boolean") {
3295
- process.env.NODE_ENV !== "production" && needWarn.push(`__VUE_PROD_HYDRATION_MISMATCH_DETAILS__`);
3296
- getGlobalThis().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;
3349
+ if (hasAttrsChanged) trigger(instance.attrs, "set", "");
3350
+ if (!!(process.env.NODE_ENV !== "production")) validateProps(rawProps || {}, props, instance);
3351
+ }
3352
+ function setFullProps(instance, rawProps, props, attrs) {
3353
+ const [options, needCastKeys] = instance.propsOptions;
3354
+ let hasAttrsChanged = false;
3355
+ let rawCastValues;
3356
+ if (rawProps) for (let key in rawProps) {
3357
+ if (isReservedProp(key)) continue;
3358
+ const value = rawProps[key];
3359
+ let camelKey;
3360
+ if (options && hasOwn(options, camelKey = camelize$1(key))) if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
3361
+ else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
3362
+ else if (!isEmitListener(instance.emitsOptions, key)) {
3363
+ if (!(key in attrs) || value !== attrs[key]) {
3364
+ attrs[key] = value;
3365
+ hasAttrsChanged = true;
3366
+ }
3367
+ }
3297
3368
  }
3298
- if (!!(process.env.NODE_ENV !== "production") && needWarn.length) {
3299
- const multi = needWarn.length > 1;
3300
- console.warn(`Feature flag${multi ? `s` : ``} ${needWarn.join(", ")} ${multi ? `are` : `is`} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.
3301
-
3302
- For more details, see https://link.vuejs.org/feature-flags.`);
3369
+ if (needCastKeys) {
3370
+ const rawCurrentProps = toRaw(props);
3371
+ const castValues = rawCastValues || EMPTY_OBJ;
3372
+ for (let i = 0; i < needCastKeys.length; i++) {
3373
+ const key = needCastKeys[i];
3374
+ props[key] = resolvePropValue(options, rawCurrentProps, key, castValues[key], instance, !hasOwn(castValues, key));
3375
+ }
3303
3376
  }
3377
+ return hasAttrsChanged;
3304
3378
  }
3305
- const queuePostRenderEffect = queueEffectWithSuspense;
3306
- function createRenderer(options) {
3307
- return baseCreateRenderer(options);
3308
- }
3309
- function baseCreateRenderer(options, createHydrationFns) {
3310
- initFeatureFlags();
3311
- const target = getGlobalThis();
3312
- target.__VUE__ = true;
3313
- if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
3314
- const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, insertStaticContent: hostInsertStaticContent } = options;
3315
- const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!(process.env.NODE_ENV !== "production") && isHmrUpdating ? false : !!n2.dynamicChildren) => {
3316
- if (n1 === n2) return;
3317
- if (n1 && !isSameVNodeType(n1, n2)) {
3318
- anchor = getNextHostNode(n1);
3319
- unmount(n1, parentComponent, parentSuspense, true);
3320
- n1 = null;
3379
+ function resolvePropValue(options, props, key, value, instance, isAbsent) {
3380
+ const opt = options[key];
3381
+ if (opt != null) {
3382
+ const hasDefault = hasOwn(opt, "default");
3383
+ if (hasDefault && value === void 0) {
3384
+ const defaultValue = opt.default;
3385
+ if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
3386
+ const { propsDefaults } = instance;
3387
+ if (key in propsDefaults) value = propsDefaults[key];
3388
+ else {
3389
+ const reset = setCurrentInstance(instance);
3390
+ value = propsDefaults[key] = defaultValue.call(null, props);
3391
+ reset();
3392
+ }
3393
+ } else value = defaultValue;
3394
+ if (instance.ce) instance.ce._setProp(key, value);
3321
3395
  }
3322
- if (n2.patchFlag === -2) {
3323
- optimized = false;
3324
- n2.dynamicChildren = null;
3396
+ if (opt[0]) {
3397
+ if (isAbsent && !hasDefault) value = false;
3398
+ else if (opt[1] && (value === "" || value === hyphenate$1(key))) value = true;
3325
3399
  }
3326
- const { type, ref: ref$1, shapeFlag } = n2;
3327
- switch (type) {
3328
- case Text:
3329
- processText(n1, n2, container, anchor);
3330
- break;
3331
- case Comment:
3332
- processCommentNode(n1, n2, container, anchor);
3333
- break;
3334
- case Static:
3335
- if (n1 == null) mountStaticNode(n2, container, anchor, namespace);
3336
- else if (!!(process.env.NODE_ENV !== "production")) patchStaticNode(n1, n2, container, namespace);
3337
- break;
3338
- case Fragment:
3339
- processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3340
- break;
3341
- default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3342
- else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3343
- else if (shapeFlag & 64) type.process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals);
3344
- else if (shapeFlag & 128) type.process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals);
3345
- else if (!!(process.env.NODE_ENV !== "production")) warn$1("Invalid VNode type:", type, `(${typeof type})`);
3400
+ }
3401
+ return value;
3402
+ }
3403
+ const mixinPropsCache = /* @__PURE__ */ new WeakMap();
3404
+ function normalizePropsOptions(comp, appContext, asMixin = false) {
3405
+ const cache = __VUE_OPTIONS_API__ && asMixin ? mixinPropsCache : appContext.propsCache;
3406
+ const cached = cache.get(comp);
3407
+ if (cached) return cached;
3408
+ const raw = comp.props;
3409
+ const normalized = {};
3410
+ const needCastKeys = [];
3411
+ let hasExtends = false;
3412
+ if (__VUE_OPTIONS_API__ && !isFunction(comp)) {
3413
+ const extendProps = (raw2) => {
3414
+ hasExtends = true;
3415
+ const [props, keys] = normalizePropsOptions(raw2, appContext, true);
3416
+ extend(normalized, props);
3417
+ if (keys) needCastKeys.push(...keys);
3418
+ };
3419
+ if (!asMixin && appContext.mixins.length) appContext.mixins.forEach(extendProps);
3420
+ if (comp.extends) extendProps(comp.extends);
3421
+ if (comp.mixins) comp.mixins.forEach(extendProps);
3422
+ }
3423
+ if (!raw && !hasExtends) {
3424
+ if (isObject$1(comp)) cache.set(comp, EMPTY_ARR);
3425
+ return EMPTY_ARR;
3426
+ }
3427
+ if (isArray(raw)) for (let i = 0; i < raw.length; i++) {
3428
+ if (!!(process.env.NODE_ENV !== "production") && !isString(raw[i])) warn$1(`props must be strings when using array syntax.`, raw[i]);
3429
+ const normalizedKey = camelize$1(raw[i]);
3430
+ if (validatePropName(normalizedKey)) normalized[normalizedKey] = EMPTY_OBJ;
3431
+ }
3432
+ else if (raw) {
3433
+ if (!!(process.env.NODE_ENV !== "production") && !isObject$1(raw)) warn$1(`invalid props options`, raw);
3434
+ for (const key in raw) {
3435
+ const normalizedKey = camelize$1(key);
3436
+ if (validatePropName(normalizedKey)) {
3437
+ const opt = raw[key];
3438
+ const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
3439
+ const propType = prop.type;
3440
+ let shouldCast = false;
3441
+ let shouldCastTrue = true;
3442
+ if (isArray(propType)) for (let index = 0; index < propType.length; ++index) {
3443
+ const type = propType[index];
3444
+ const typeName = isFunction(type) && type.name;
3445
+ if (typeName === "Boolean") {
3446
+ shouldCast = true;
3447
+ break;
3448
+ } else if (typeName === "String") shouldCastTrue = false;
3449
+ }
3450
+ else shouldCast = isFunction(propType) && propType.name === "Boolean";
3451
+ prop[0] = shouldCast;
3452
+ prop[1] = shouldCastTrue;
3453
+ if (shouldCast || hasOwn(prop, "default")) needCastKeys.push(normalizedKey);
3454
+ }
3346
3455
  }
3347
- if (ref$1 != null && parentComponent) setRef(ref$1, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
3348
- else if (ref$1 == null && n1 && n1.ref != null) setRef(n1.ref, null, parentSuspense, n1, true);
3349
- };
3350
- const processText = (n1, n2, container, anchor) => {
3351
- if (n1 == null) hostInsert(n2.el = hostCreateText(n2.children), container, anchor);
3352
- else {
3353
- const el = n2.el = n1.el;
3354
- if (n2.children !== n1.children) hostSetText(el, n2.children);
3456
+ }
3457
+ const res = [normalized, needCastKeys];
3458
+ if (isObject$1(comp)) cache.set(comp, res);
3459
+ return res;
3460
+ }
3461
+ function validatePropName(key) {
3462
+ if (key[0] !== "$" && !isReservedProp(key)) return true;
3463
+ else if (!!(process.env.NODE_ENV !== "production")) warn$1(`Invalid prop name: "${key}" is a reserved property.`);
3464
+ return false;
3465
+ }
3466
+ function getType(ctor) {
3467
+ if (ctor === null) return "null";
3468
+ if (typeof ctor === "function") return ctor.name || "";
3469
+ else if (typeof ctor === "object") return ctor.constructor && ctor.constructor.name || "";
3470
+ return "";
3471
+ }
3472
+ function validateProps(rawProps, props, instance) {
3473
+ const resolvedValues = toRaw(props);
3474
+ const options = instance.propsOptions[0];
3475
+ const camelizePropsKey = Object.keys(rawProps).map((key) => camelize$1(key));
3476
+ for (const key in options) {
3477
+ let opt = options[key];
3478
+ if (opt == null) continue;
3479
+ validateProp(key, resolvedValues[key], opt, !!(process.env.NODE_ENV !== "production") ? shallowReadonly(resolvedValues) : resolvedValues, !camelizePropsKey.includes(key));
3480
+ }
3481
+ }
3482
+ function validateProp(name, value, prop, props, isAbsent) {
3483
+ const { type, required, validator, skipCheck } = prop;
3484
+ if (required && isAbsent) {
3485
+ warn$1("Missing required prop: \"" + name + "\"");
3486
+ return;
3487
+ }
3488
+ if (value == null && !required) return;
3489
+ if (type != null && type !== true && !skipCheck) {
3490
+ let isValid = false;
3491
+ const types = isArray(type) ? type : [type];
3492
+ const expectedTypes = [];
3493
+ for (let i = 0; i < types.length && !isValid; i++) {
3494
+ const { valid, expectedType } = assertType(value, types[i]);
3495
+ expectedTypes.push(expectedType || "");
3496
+ isValid = valid;
3355
3497
  }
3356
- };
3357
- const processCommentNode = (n1, n2, container, anchor) => {
3358
- if (n1 == null) hostInsert(n2.el = hostCreateComment(n2.children || ""), container, anchor);
3359
- else n2.el = n1.el;
3360
- };
3361
- const mountStaticNode = (n2, container, anchor, namespace) => {
3362
- [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, namespace, n2.el, n2.anchor);
3363
- };
3364
- const patchStaticNode = (n1, n2, container, namespace) => {
3365
- if (n2.children !== n1.children) {
3366
- const anchor = hostNextSibling(n1.anchor);
3367
- removeStaticNode(n1);
3368
- [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, namespace);
3369
- } else {
3370
- n2.el = n1.el;
3371
- n2.anchor = n1.anchor;
3498
+ if (!isValid) {
3499
+ warn$1(getInvalidTypeMessage(name, value, expectedTypes));
3500
+ return;
3372
3501
  }
3502
+ }
3503
+ if (validator && !validator(value, props)) warn$1("Invalid prop: custom validator check failed for prop \"" + name + "\".");
3504
+ }
3505
+ const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
3506
+ function assertType(value, type) {
3507
+ let valid;
3508
+ const expectedType = getType(type);
3509
+ if (expectedType === "null") valid = value === null;
3510
+ else if (isSimpleType(expectedType)) {
3511
+ const t = typeof value;
3512
+ valid = t === expectedType.toLowerCase();
3513
+ if (!valid && t === "object") valid = value instanceof type;
3514
+ } else if (expectedType === "Object") valid = isObject$1(value);
3515
+ else if (expectedType === "Array") valid = isArray(value);
3516
+ else valid = value instanceof type;
3517
+ return {
3518
+ valid,
3519
+ expectedType
3373
3520
  };
3374
- const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
3375
- let next;
3376
- while (el && el !== anchor) {
3377
- next = hostNextSibling(el);
3378
- hostInsert(el, container, nextSibling);
3379
- el = next;
3521
+ }
3522
+ function getInvalidTypeMessage(name, value, expectedTypes) {
3523
+ if (expectedTypes.length === 0) return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
3524
+ let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
3525
+ const expectedType = expectedTypes[0];
3526
+ const receivedType = toRawType(value);
3527
+ const expectedValue = styleValue(value, expectedType);
3528
+ const receivedValue = styleValue(value, receivedType);
3529
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) message += ` with value ${expectedValue}`;
3530
+ message += `, got ${receivedType} `;
3531
+ if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
3532
+ return message;
3533
+ }
3534
+ function styleValue(value, type) {
3535
+ if (type === "String") return `"${value}"`;
3536
+ else if (type === "Number") return `${Number(value)}`;
3537
+ else return `${value}`;
3538
+ }
3539
+ function isExplicable(type) {
3540
+ return [
3541
+ "string",
3542
+ "number",
3543
+ "boolean"
3544
+ ].some((elem) => type.toLowerCase() === elem);
3545
+ }
3546
+ function isBoolean(...args) {
3547
+ return args.some((elem) => elem.toLowerCase() === "boolean");
3548
+ }
3549
+ const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
3550
+ const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
3551
+ const normalizeSlot = (key, rawSlot, ctx) => {
3552
+ if (rawSlot._n) return rawSlot;
3553
+ const normalized = withCtx((...args) => {
3554
+ if (!!(process.env.NODE_ENV !== "production") && currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) warn$1(`Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`);
3555
+ return normalizeSlotValue(rawSlot(...args));
3556
+ }, ctx);
3557
+ normalized._c = false;
3558
+ return normalized;
3559
+ };
3560
+ const normalizeObjectSlots = (rawSlots, slots, instance) => {
3561
+ const ctx = rawSlots._ctx;
3562
+ for (const key in rawSlots) {
3563
+ if (isInternalKey(key)) continue;
3564
+ const value = rawSlots[key];
3565
+ if (isFunction(value)) slots[key] = normalizeSlot(key, value, ctx);
3566
+ else if (value != null) {
3567
+ if (!!(process.env.NODE_ENV !== "production") && true) warn$1(`Non-function value encountered for slot "${key}". Prefer function slots for better performance.`);
3568
+ const normalized = normalizeSlotValue(value);
3569
+ slots[key] = () => normalized;
3380
3570
  }
3381
- hostInsert(anchor, container, nextSibling);
3382
- };
3383
- const removeStaticNode = ({ el, anchor }) => {
3384
- let next;
3385
- while (el && el !== anchor) {
3386
- next = hostNextSibling(el);
3387
- hostRemove(el);
3388
- el = next;
3571
+ }
3572
+ };
3573
+ const normalizeVNodeSlots = (instance, children) => {
3574
+ if (!!(process.env.NODE_ENV !== "production") && !isKeepAlive(instance.vnode) && true) warn$1(`Non-function value encountered for default slot. Prefer function slots for better performance.`);
3575
+ const normalized = normalizeSlotValue(children);
3576
+ instance.slots.default = () => normalized;
3577
+ };
3578
+ const assignSlots = (slots, children, optimized) => {
3579
+ for (const key in children) if (optimized || !isInternalKey(key)) slots[key] = children[key];
3580
+ };
3581
+ const initSlots = (instance, children, optimized) => {
3582
+ const slots = instance.slots = createInternalObject();
3583
+ if (instance.vnode.shapeFlag & 32) {
3584
+ const type = children._;
3585
+ if (type) {
3586
+ assignSlots(slots, children, optimized);
3587
+ if (optimized) def(slots, "_", type, true);
3588
+ } else normalizeObjectSlots(children, slots);
3589
+ } else if (children) normalizeVNodeSlots(instance, children);
3590
+ };
3591
+ const updateSlots = (instance, children, optimized) => {
3592
+ const { vnode, slots } = instance;
3593
+ let needDeletionCheck = true;
3594
+ let deletionComparisonTarget = EMPTY_OBJ;
3595
+ if (vnode.shapeFlag & 32) {
3596
+ const type = children._;
3597
+ if (type) if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) {
3598
+ assignSlots(slots, children, optimized);
3599
+ trigger(instance, "set", "$slots");
3600
+ } else if (optimized && type === 1) needDeletionCheck = false;
3601
+ else assignSlots(slots, children, optimized);
3602
+ else {
3603
+ needDeletionCheck = !children.$stable;
3604
+ normalizeObjectSlots(children, slots);
3605
+ }
3606
+ deletionComparisonTarget = children;
3607
+ } else if (children) {
3608
+ normalizeVNodeSlots(instance, children);
3609
+ deletionComparisonTarget = { default: 1 };
3610
+ }
3611
+ if (needDeletionCheck) {
3612
+ for (const key in slots) if (!isInternalKey(key) && deletionComparisonTarget[key] == null) delete slots[key];
3613
+ }
3614
+ };
3615
+ let supported;
3616
+ let perf;
3617
+ function startMeasure(instance, type) {
3618
+ if (instance.appContext.config.performance && isSupported()) perf.mark(`vue-${type}-${instance.uid}`);
3619
+ if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
3620
+ }
3621
+ function endMeasure(instance, type) {
3622
+ if (instance.appContext.config.performance && isSupported()) {
3623
+ const startTag = `vue-${type}-${instance.uid}`;
3624
+ const endTag = startTag + `:end`;
3625
+ const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
3626
+ perf.mark(endTag);
3627
+ perf.measure(measureName, startTag, endTag);
3628
+ perf.clearMeasures(measureName);
3629
+ perf.clearMarks(startTag);
3630
+ perf.clearMarks(endTag);
3631
+ }
3632
+ if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
3633
+ }
3634
+ function isSupported() {
3635
+ if (supported !== void 0) return supported;
3636
+ if (typeof window !== "undefined" && window.performance) {
3637
+ supported = true;
3638
+ perf = window.performance;
3639
+ } else supported = false;
3640
+ return supported;
3641
+ }
3642
+ function initFeatureFlags() {
3643
+ const needWarn = [];
3644
+ if (typeof __VUE_OPTIONS_API__ !== "boolean") {
3645
+ process.env.NODE_ENV !== "production" && needWarn.push(`__VUE_OPTIONS_API__`);
3646
+ getGlobalThis().__VUE_OPTIONS_API__ = true;
3647
+ }
3648
+ if (typeof __VUE_PROD_DEVTOOLS__ !== "boolean") {
3649
+ process.env.NODE_ENV !== "production" && needWarn.push(`__VUE_PROD_DEVTOOLS__`);
3650
+ getGlobalThis().__VUE_PROD_DEVTOOLS__ = false;
3651
+ }
3652
+ if (typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ !== "boolean") {
3653
+ process.env.NODE_ENV !== "production" && needWarn.push(`__VUE_PROD_HYDRATION_MISMATCH_DETAILS__`);
3654
+ getGlobalThis().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;
3655
+ }
3656
+ if (!!(process.env.NODE_ENV !== "production") && needWarn.length) {
3657
+ const multi = needWarn.length > 1;
3658
+ console.warn(`Feature flag${multi ? `s` : ``} ${needWarn.join(", ")} ${multi ? `are` : `is`} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.
3659
+
3660
+ For more details, see https://link.vuejs.org/feature-flags.`);
3661
+ }
3662
+ }
3663
+ const queuePostRenderEffect = queueEffectWithSuspense;
3664
+ function createRenderer(options) {
3665
+ return baseCreateRenderer(options);
3666
+ }
3667
+ function baseCreateRenderer(options, createHydrationFns) {
3668
+ initFeatureFlags();
3669
+ const target = getGlobalThis();
3670
+ target.__VUE__ = true;
3671
+ if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
3672
+ const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, insertStaticContent: hostInsertStaticContent } = options;
3673
+ const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!(process.env.NODE_ENV !== "production") && isHmrUpdating ? false : !!n2.dynamicChildren) => {
3674
+ if (n1 === n2) return;
3675
+ if (n1 && !isSameVNodeType(n1, n2)) {
3676
+ anchor = getNextHostNode(n1);
3677
+ unmount(n1, parentComponent, parentSuspense, true);
3678
+ n1 = null;
3679
+ }
3680
+ if (n2.patchFlag === -2) {
3681
+ optimized = false;
3682
+ n2.dynamicChildren = null;
3683
+ }
3684
+ const { type, ref: ref$1, shapeFlag } = n2;
3685
+ switch (type) {
3686
+ case Text:
3687
+ processText(n1, n2, container, anchor);
3688
+ break;
3689
+ case Comment:
3690
+ processCommentNode(n1, n2, container, anchor);
3691
+ break;
3692
+ case Static:
3693
+ if (n1 == null) mountStaticNode(n2, container, anchor, namespace);
3694
+ else if (!!(process.env.NODE_ENV !== "production")) patchStaticNode(n1, n2, container, namespace);
3695
+ break;
3696
+ case Fragment:
3697
+ processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3698
+ break;
3699
+ default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3700
+ else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3701
+ else if (shapeFlag & 64) type.process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals);
3702
+ else if (shapeFlag & 128) type.process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals);
3703
+ else if (!!(process.env.NODE_ENV !== "production")) warn$1("Invalid VNode type:", type, `(${typeof type})`);
3704
+ }
3705
+ if (ref$1 != null && parentComponent) setRef(ref$1, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
3706
+ else if (ref$1 == null && n1 && n1.ref != null) setRef(n1.ref, null, parentSuspense, n1, true);
3707
+ };
3708
+ const processText = (n1, n2, container, anchor) => {
3709
+ if (n1 == null) hostInsert(n2.el = hostCreateText(n2.children), container, anchor);
3710
+ else {
3711
+ const el = n2.el = n1.el;
3712
+ if (n2.children !== n1.children) if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating && n2.patchFlag === -1 && "__elIndex" in n1) {
3713
+ const childNodes = container.childNodes;
3714
+ const newChild = hostCreateText(n2.children);
3715
+ const oldChild = childNodes[n2.__elIndex = n1.__elIndex];
3716
+ hostInsert(newChild, container, oldChild);
3717
+ hostRemove(oldChild);
3718
+ } else hostSetText(el, n2.children);
3719
+ }
3720
+ };
3721
+ const processCommentNode = (n1, n2, container, anchor) => {
3722
+ if (n1 == null) hostInsert(n2.el = hostCreateComment(n2.children || ""), container, anchor);
3723
+ else n2.el = n1.el;
3724
+ };
3725
+ const mountStaticNode = (n2, container, anchor, namespace) => {
3726
+ [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, namespace, n2.el, n2.anchor);
3727
+ };
3728
+ const patchStaticNode = (n1, n2, container, namespace) => {
3729
+ if (n2.children !== n1.children) {
3730
+ const anchor = hostNextSibling(n1.anchor);
3731
+ removeStaticNode(n1);
3732
+ [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, namespace);
3733
+ } else {
3734
+ n2.el = n1.el;
3735
+ n2.anchor = n1.anchor;
3736
+ }
3737
+ };
3738
+ const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
3739
+ let next;
3740
+ while (el && el !== anchor) {
3741
+ next = hostNextSibling(el);
3742
+ hostInsert(el, container, nextSibling);
3743
+ el = next;
3744
+ }
3745
+ hostInsert(anchor, container, nextSibling);
3746
+ };
3747
+ const removeStaticNode = ({ el, anchor }) => {
3748
+ let next;
3749
+ while (el && el !== anchor) {
3750
+ next = hostNextSibling(el);
3751
+ hostRemove(el);
3752
+ el = next;
3389
3753
  }
3390
3754
  hostRemove(anchor);
3391
3755
  };
@@ -3393,7 +3757,15 @@ function baseCreateRenderer(options, createHydrationFns) {
3393
3757
  if (n2.type === "svg") namespace = "svg";
3394
3758
  else if (n2.type === "math") namespace = "mathml";
3395
3759
  if (n1 == null) mountElement(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3396
- else patchElement(n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3760
+ else {
3761
+ const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
3762
+ try {
3763
+ if (customElement) customElement._beginPatch();
3764
+ patchElement(n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3765
+ } finally {
3766
+ if (customElement) customElement._endPatch();
3767
+ }
3768
+ }
3397
3769
  };
3398
3770
  const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
3399
3771
  let el;
@@ -3436,10 +3808,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3436
3808
  }
3437
3809
  };
3438
3810
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
3439
- for (let i = start; i < children.length; i++) {
3440
- const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
3441
- patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3442
- }
3811
+ for (let i = start; i < children.length; i++) patch(null, children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]), container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3443
3812
  };
3444
3813
  const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
3445
3814
  const el = n2.el = n1.el;
@@ -3493,8 +3862,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3493
3862
  for (let i = 0; i < newChildren.length; i++) {
3494
3863
  const oldVNode = oldChildren[i];
3495
3864
  const newVNode = newChildren[i];
3496
- const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
3497
- patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
3865
+ patch(oldVNode, newVNode, oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
3498
3866
  }
3499
3867
  };
3500
3868
  const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
@@ -3525,7 +3893,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3525
3893
  hostInsert(fragmentStartAnchor, container, anchor);
3526
3894
  hostInsert(fragmentEndAnchor, container, anchor);
3527
3895
  mountChildren(n2.children || [], container, fragmentEndAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3528
- } else if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && n1.dynamicChildren) {
3896
+ } else if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
3529
3897
  patchBlockChildren(n1.dynamicChildren, dynamicChildren, container, parentComponent, parentSuspense, namespace, slotScopeIds);
3530
3898
  if (!!(process.env.NODE_ENV !== "production")) traverseStaticChildren(n1, n2);
3531
3899
  else if (n2.key != null || parentComponent && n2 === parentComponent.subTree) traverseStaticChildren(n1, n2, true);
@@ -3662,17 +4030,17 @@ function baseCreateRenderer(options, createHydrationFns) {
3662
4030
  }
3663
4031
  };
3664
4032
  instance.scope.on();
3665
- const effect$1 = instance.effect = new ReactiveEffect(componentUpdateFn);
4033
+ const effect = instance.effect = new ReactiveEffect(componentUpdateFn);
3666
4034
  instance.scope.off();
3667
- const update = instance.update = effect$1.run.bind(effect$1);
3668
- const job = instance.job = effect$1.runIfDirty.bind(effect$1);
4035
+ const update = instance.update = effect.run.bind(effect);
4036
+ const job = instance.job = effect.runIfDirty.bind(effect);
3669
4037
  job.i = instance;
3670
4038
  job.id = instance.uid;
3671
- effect$1.scheduler = () => queueJob(job);
4039
+ effect.scheduler = () => queueJob(job);
3672
4040
  toggleRecurse(instance, true);
3673
4041
  if (!!(process.env.NODE_ENV !== "production")) {
3674
- effect$1.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
3675
- effect$1.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
4042
+ effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
4043
+ effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
3676
4044
  }
3677
4045
  update();
3678
4046
  };
@@ -3803,7 +4171,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3803
4171
  const nextIndex = s2 + i;
3804
4172
  const nextChild = c2[nextIndex];
3805
4173
  const anchorVNode = c2[nextIndex + 1];
3806
- const anchor = nextIndex + 1 < l2 ? anchorVNode.el || anchorVNode.placeholder : parentAnchor;
4174
+ const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
3807
4175
  if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3808
4176
  else if (moved) if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2);
3809
4177
  else j--;
@@ -3949,513 +4317,128 @@ function baseCreateRenderer(options, createHydrationFns) {
3949
4317
  if (vnode.shapeFlag & 128) return vnode.suspense.next();
3950
4318
  const el = hostNextSibling(vnode.anchor || vnode.el);
3951
4319
  const teleportEnd = el && el[TeleportEndKey];
3952
- return teleportEnd ? hostNextSibling(teleportEnd) : el;
3953
- };
3954
- let isFlushing = false;
3955
- const render$1 = (vnode, container, namespace) => {
3956
- if (vnode == null) {
3957
- if (container._vnode) unmount(container._vnode, null, null, true);
3958
- } else patch(container._vnode || null, vnode, container, null, null, null, namespace);
3959
- container._vnode = vnode;
3960
- if (!isFlushing) {
3961
- isFlushing = true;
3962
- flushPreFlushCbs();
3963
- flushPostFlushCbs();
3964
- isFlushing = false;
3965
- }
3966
- };
3967
- const internals = {
3968
- p: patch,
3969
- um: unmount,
3970
- m: move,
3971
- r: remove$1,
3972
- mt: mountComponent,
3973
- mc: mountChildren,
3974
- pc: patchChildren,
3975
- pbc: patchBlockChildren,
3976
- n: getNextHostNode,
3977
- o: options
3978
- };
3979
- let hydrate;
3980
- let hydrateNode;
3981
- if (createHydrationFns) [hydrate, hydrateNode] = createHydrationFns(internals);
3982
- return {
3983
- render: render$1,
3984
- hydrate,
3985
- createApp: createAppAPI(render$1, hydrate)
3986
- };
3987
- }
3988
- function resolveChildrenNamespace({ type, props }, currentNamespace) {
3989
- return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
3990
- }
3991
- function toggleRecurse({ effect: effect$1, job }, allowed) {
3992
- if (allowed) {
3993
- effect$1.flags |= 32;
3994
- job.flags |= 4;
3995
- } else {
3996
- effect$1.flags &= -33;
3997
- job.flags &= -5;
3998
- }
3999
- }
4000
- function needTransition(parentSuspense, transition) {
4001
- return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
4002
- }
4003
- function traverseStaticChildren(n1, n2, shallow = false) {
4004
- const ch1 = n1.children;
4005
- const ch2 = n2.children;
4006
- if (isArray(ch1) && isArray(ch2)) for (let i = 0; i < ch1.length; i++) {
4007
- const c1 = ch1[i];
4008
- let c2 = ch2[i];
4009
- if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
4010
- if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
4011
- c2 = ch2[i] = cloneIfMounted(ch2[i]);
4012
- c2.el = c1.el;
4013
- }
4014
- if (!shallow && c2.patchFlag !== -2) traverseStaticChildren(c1, c2);
4015
- }
4016
- if (c2.type === Text && c2.patchFlag !== -1) c2.el = c1.el;
4017
- if (c2.type === Comment && !c2.el) c2.el = c1.el;
4018
- if (!!(process.env.NODE_ENV !== "production")) c2.el && (c2.el.__vnode = c2);
4019
- }
4020
- }
4021
- function getSequence(arr) {
4022
- const p$1 = arr.slice();
4023
- const result = [0];
4024
- let i, j, u, v, c;
4025
- const len = arr.length;
4026
- for (i = 0; i < len; i++) {
4027
- const arrI = arr[i];
4028
- if (arrI !== 0) {
4029
- j = result[result.length - 1];
4030
- if (arr[j] < arrI) {
4031
- p$1[i] = j;
4032
- result.push(i);
4033
- continue;
4034
- }
4035
- u = 0;
4036
- v = result.length - 1;
4037
- while (u < v) {
4038
- c = u + v >> 1;
4039
- if (arr[result[c]] < arrI) u = c + 1;
4040
- else v = c;
4041
- }
4042
- if (arrI < arr[result[u]]) {
4043
- if (u > 0) p$1[i] = result[u - 1];
4044
- result[u] = i;
4045
- }
4046
- }
4047
- }
4048
- u = result.length;
4049
- v = result[u - 1];
4050
- while (u-- > 0) {
4051
- result[u] = v;
4052
- v = p$1[v];
4053
- }
4054
- return result;
4055
- }
4056
- function locateNonHydratedAsyncRoot(instance) {
4057
- const subComponent = instance.subTree.component;
4058
- if (subComponent) if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
4059
- else return locateNonHydratedAsyncRoot(subComponent);
4060
- }
4061
- function invalidateMount(hooks) {
4062
- if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 8;
4063
- }
4064
- const ssrContextKey = Symbol.for("v-scx");
4065
- const useSSRContext = () => {
4066
- {
4067
- const ctx = inject(ssrContextKey);
4068
- if (!ctx) process.env.NODE_ENV !== "production" && warn$1(`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`);
4069
- return ctx;
4070
- }
4071
- };
4072
- function watchEffect(effect$1, options) {
4073
- return doWatch(effect$1, null, options);
4074
- }
4075
- function watchSyncEffect(effect$1, options) {
4076
- return doWatch(effect$1, null, !!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "sync" }) : { flush: "sync" });
4077
- }
4078
- function watch(source, cb, options) {
4079
- if (!!(process.env.NODE_ENV !== "production") && !isFunction(cb)) warn$1(`\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`);
4080
- return doWatch(source, cb, options);
4081
- }
4082
- function doWatch(source, cb, options = EMPTY_OBJ) {
4083
- const { immediate, deep, flush, once } = options;
4084
- if (!!(process.env.NODE_ENV !== "production") && !cb) {
4085
- if (immediate !== void 0) warn$1(`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`);
4086
- if (deep !== void 0) warn$1(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`);
4087
- if (once !== void 0) warn$1(`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`);
4088
- }
4089
- const baseWatchOptions = extend({}, options);
4090
- if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
4091
- const runsImmediately = cb && immediate || !cb && flush !== "post";
4092
- let ssrCleanup;
4093
- if (isInSSRComponentSetup) {
4094
- if (flush === "sync") {
4095
- const ctx = useSSRContext();
4096
- ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
4097
- } else if (!runsImmediately) {
4098
- const watchStopHandle = () => {};
4099
- watchStopHandle.stop = NOOP;
4100
- watchStopHandle.resume = NOOP;
4101
- watchStopHandle.pause = NOOP;
4102
- return watchStopHandle;
4103
- }
4104
- }
4105
- const instance = currentInstance;
4106
- baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
4107
- let isPre = false;
4108
- if (flush === "post") baseWatchOptions.scheduler = (job) => {
4109
- queuePostRenderEffect(job, instance && instance.suspense);
4110
- };
4111
- else if (flush !== "sync") {
4112
- isPre = true;
4113
- baseWatchOptions.scheduler = (job, isFirstRun) => {
4114
- if (isFirstRun) job();
4115
- else queueJob(job);
4116
- };
4117
- }
4118
- baseWatchOptions.augmentJob = (job) => {
4119
- if (cb) job.flags |= 4;
4120
- if (isPre) {
4121
- job.flags |= 2;
4122
- if (instance) {
4123
- job.id = instance.uid;
4124
- job.i = instance;
4125
- }
4126
- }
4127
- };
4128
- const watchHandle = watch$1(source, cb, baseWatchOptions);
4129
- if (isInSSRComponentSetup) {
4130
- if (ssrCleanup) ssrCleanup.push(watchHandle);
4131
- else if (runsImmediately) watchHandle();
4132
- }
4133
- return watchHandle;
4134
- }
4135
- function instanceWatch(source, value, options) {
4136
- const publicThis = this.proxy;
4137
- const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
4138
- let cb;
4139
- if (isFunction(value)) cb = value;
4140
- else {
4141
- cb = value.handler;
4142
- options = value;
4143
- }
4144
- const reset = setCurrentInstance(this);
4145
- const res = doWatch(getter, cb.bind(publicThis), options);
4146
- reset();
4147
- return res;
4148
- }
4149
- function createPathGetter(ctx, path) {
4150
- const segments = path.split(".");
4151
- return () => {
4152
- let cur = ctx;
4153
- for (let i = 0; i < segments.length && cur; i++) cur = cur[segments[i]];
4154
- return cur;
4155
- };
4156
- }
4157
- function useModel(props, name, options = EMPTY_OBJ) {
4158
- const i = getCurrentInstance();
4159
- if (!!(process.env.NODE_ENV !== "production") && !i) {
4160
- warn$1(`useModel() called without active instance.`);
4161
- return ref();
4162
- }
4163
- const camelizedName = camelize$1(name);
4164
- if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][camelizedName]) {
4165
- warn$1(`useModel() called with prop "${name}" which is not declared.`);
4166
- return ref();
4167
- }
4168
- const hyphenatedName = hyphenate$1(name);
4169
- const modifiers = getModelModifiers(props, camelizedName);
4170
- const res = customRef((track$1, trigger$1) => {
4171
- let localValue;
4172
- let prevSetValue = EMPTY_OBJ;
4173
- let prevEmittedValue;
4174
- watchSyncEffect(() => {
4175
- const propValue = props[camelizedName];
4176
- if (hasChanged(localValue, propValue)) {
4177
- localValue = propValue;
4178
- trigger$1();
4179
- }
4180
- });
4181
- return {
4182
- get() {
4183
- track$1();
4184
- return options.get ? options.get(localValue) : localValue;
4185
- },
4186
- set(value) {
4187
- const emittedValue = options.set ? options.set(value) : value;
4188
- if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) return;
4189
- const rawProps = i.vnode.props;
4190
- if (!(rawProps && (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
4191
- localValue = value;
4192
- trigger$1();
4193
- }
4194
- i.emit(`update:${name}`, emittedValue);
4195
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) trigger$1();
4196
- prevSetValue = value;
4197
- prevEmittedValue = emittedValue;
4198
- }
4199
- };
4200
- });
4201
- res[Symbol.iterator] = () => {
4202
- let i2 = 0;
4203
- return { next() {
4204
- if (i2 < 2) return {
4205
- value: i2++ ? modifiers || EMPTY_OBJ : res,
4206
- done: false
4207
- };
4208
- else return { done: true };
4209
- } };
4210
- };
4211
- return res;
4212
- }
4213
- const getModelModifiers = (props, modelName) => {
4214
- return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize$1(modelName)}Modifiers`] || props[`${hyphenate$1(modelName)}Modifiers`];
4215
- };
4216
- function emit(instance, event, ...rawArgs) {
4217
- if (instance.isUnmounted) return;
4218
- const props = instance.vnode.props || EMPTY_OBJ;
4219
- if (!!(process.env.NODE_ENV !== "production")) {
4220
- const { emitsOptions, propsOptions: [propsOptions] } = instance;
4221
- if (emitsOptions) if (!(event in emitsOptions) && true) {
4222
- if (!propsOptions || !(toHandlerKey(camelize$1(event)) in propsOptions)) warn$1(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize$1(event))}" prop.`);
4223
- } else {
4224
- const validator = emitsOptions[event];
4225
- if (isFunction(validator)) {
4226
- if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
4227
- }
4228
- }
4229
- }
4230
- let args = rawArgs;
4231
- const isModelListener$1 = event.startsWith("update:");
4232
- const modifiers = isModelListener$1 && getModelModifiers(props, event.slice(7));
4233
- if (modifiers) {
4234
- if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
4235
- if (modifiers.number) args = rawArgs.map(looseToNumber);
4236
- }
4237
- if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) devtoolsComponentEmit(instance, event, args);
4238
- if (!!(process.env.NODE_ENV !== "production")) {
4239
- const lowerCaseEvent = event.toLowerCase();
4240
- if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) warn$1(`Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(instance, instance.type)} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate$1(event)}" instead of "${event}".`);
4241
- }
4242
- let handlerName;
4243
- let handler = props[handlerName = toHandlerKey(event)] || props[handlerName = toHandlerKey(camelize$1(event))];
4244
- if (!handler && isModelListener$1) handler = props[handlerName = toHandlerKey(hyphenate$1(event))];
4245
- if (handler) callWithAsyncErrorHandling(handler, instance, 6, args);
4246
- const onceHandler = props[handlerName + `Once`];
4247
- if (onceHandler) {
4248
- if (!instance.emitted) instance.emitted = {};
4249
- else if (instance.emitted[handlerName]) return;
4250
- instance.emitted[handlerName] = true;
4251
- callWithAsyncErrorHandling(onceHandler, instance, 6, args);
4252
- }
4253
- }
4254
- const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
4255
- function normalizeEmitsOptions(comp, appContext, asMixin = false) {
4256
- const cache = __VUE_OPTIONS_API__ && asMixin ? mixinEmitsCache : appContext.emitsCache;
4257
- const cached = cache.get(comp);
4258
- if (cached !== void 0) return cached;
4259
- const raw = comp.emits;
4260
- let normalized = {};
4261
- let hasExtends = false;
4262
- if (__VUE_OPTIONS_API__ && !isFunction(comp)) {
4263
- const extendEmits = (raw2) => {
4264
- const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
4265
- if (normalizedFromExtend) {
4266
- hasExtends = true;
4267
- extend(normalized, normalizedFromExtend);
4268
- }
4269
- };
4270
- if (!asMixin && appContext.mixins.length) appContext.mixins.forEach(extendEmits);
4271
- if (comp.extends) extendEmits(comp.extends);
4272
- if (comp.mixins) comp.mixins.forEach(extendEmits);
4273
- }
4274
- if (!raw && !hasExtends) {
4275
- if (isObject$1(comp)) cache.set(comp, null);
4276
- return null;
4277
- }
4278
- if (isArray(raw)) raw.forEach((key) => normalized[key] = null);
4279
- else extend(normalized, raw);
4280
- if (isObject$1(comp)) cache.set(comp, normalized);
4281
- return normalized;
4282
- }
4283
- function isEmitListener(options, key) {
4284
- if (!options || !isOn(key)) return false;
4285
- key = key.slice(2).replace(/Once$/, "");
4286
- return hasOwn$1(options, key[0].toLowerCase() + key.slice(1)) || hasOwn$1(options, hyphenate$1(key)) || hasOwn$1(options, key);
4287
- }
4288
- let accessedAttrs = false;
4289
- function markAttrsAccessed() {
4290
- accessedAttrs = true;
4291
- }
4292
- function renderComponentRoot(instance) {
4293
- const { type: Component, vnode, proxy, withProxy, propsOptions: [propsOptions], slots, attrs, emit: emit$2, render: render$1, renderCache, props, data, setupState, ctx, inheritAttrs } = instance;
4294
- const prev = setCurrentRenderingInstance(instance);
4295
- let result;
4296
- let fallthroughAttrs;
4297
- if (!!(process.env.NODE_ENV !== "production")) accessedAttrs = false;
4298
- try {
4299
- if (vnode.shapeFlag & 4) {
4300
- const proxyToUse = withProxy || proxy;
4301
- const thisProxy = !!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup ? new Proxy(proxyToUse, { get(target, key, receiver) {
4302
- warn$1(`Property '${String(key)}' was accessed via 'this'. Avoid using 'this' in templates.`);
4303
- return Reflect.get(target, key, receiver);
4304
- } }) : proxyToUse;
4305
- result = normalizeVNode(render$1.call(thisProxy, proxyToUse, renderCache, !!(process.env.NODE_ENV !== "production") ? shallowReadonly(props) : props, setupState, data, ctx));
4306
- fallthroughAttrs = attrs;
4307
- } else {
4308
- const render2 = Component;
4309
- if (!!(process.env.NODE_ENV !== "production") && attrs === props) markAttrsAccessed();
4310
- result = normalizeVNode(render2.length > 1 ? render2(!!(process.env.NODE_ENV !== "production") ? shallowReadonly(props) : props, !!(process.env.NODE_ENV !== "production") ? {
4311
- get attrs() {
4312
- markAttrsAccessed();
4313
- return shallowReadonly(attrs);
4314
- },
4315
- slots,
4316
- emit: emit$2
4317
- } : {
4318
- attrs,
4319
- slots,
4320
- emit: emit$2
4321
- }) : render2(!!(process.env.NODE_ENV !== "production") ? shallowReadonly(props) : props, null));
4322
- fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
4323
- }
4324
- } catch (err) {
4325
- blockStack.length = 0;
4326
- handleError(err, instance, 1);
4327
- result = createVNode(Comment);
4328
- }
4329
- let root = result;
4330
- let setRoot = void 0;
4331
- if (!!(process.env.NODE_ENV !== "production") && result.patchFlag > 0 && result.patchFlag & 2048) [root, setRoot] = getChildRoot(result);
4332
- if (fallthroughAttrs && inheritAttrs !== false) {
4333
- const keys = Object.keys(fallthroughAttrs);
4334
- const { shapeFlag } = root;
4335
- if (keys.length) {
4336
- if (shapeFlag & 7) {
4337
- if (propsOptions && keys.some(isModelListener)) fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
4338
- root = cloneVNode(root, fallthroughAttrs, false, true);
4339
- } else if (!!(process.env.NODE_ENV !== "production") && !accessedAttrs && root.type !== Comment) {
4340
- const allAttrs = Object.keys(attrs);
4341
- const eventAttrs = [];
4342
- const extraAttrs = [];
4343
- for (let i = 0, l = allAttrs.length; i < l; i++) {
4344
- const key = allAttrs[i];
4345
- if (isOn(key)) {
4346
- if (!isModelListener(key)) eventAttrs.push(key[2].toLowerCase() + key.slice(3));
4347
- } else extraAttrs.push(key);
4348
- }
4349
- if (extraAttrs.length) warn$1(`Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`);
4350
- if (eventAttrs.length) warn$1(`Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`);
4351
- }
4352
- }
4353
- }
4354
- if (vnode.dirs) {
4355
- if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) warn$1(`Runtime directive used on component with non-element root node. The directives will not function as intended.`);
4356
- root = cloneVNode(root, null, false, true);
4357
- root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
4358
- }
4359
- if (vnode.transition) {
4360
- if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) warn$1(`Component inside <Transition> renders non-element root node that cannot be animated.`);
4361
- setTransitionHooks(root, vnode.transition);
4362
- }
4363
- if (!!(process.env.NODE_ENV !== "production") && setRoot) setRoot(root);
4364
- else result = root;
4365
- setCurrentRenderingInstance(prev);
4366
- return result;
4367
- }
4368
- const getChildRoot = (vnode) => {
4369
- const rawChildren = vnode.children;
4370
- const dynamicChildren = vnode.dynamicChildren;
4371
- const childRoot = filterSingleRoot(rawChildren, false);
4372
- if (!childRoot) return [vnode, void 0];
4373
- else if (!!(process.env.NODE_ENV !== "production") && childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) return getChildRoot(childRoot);
4374
- const index = rawChildren.indexOf(childRoot);
4375
- const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
4376
- const setRoot = (updatedRoot) => {
4377
- rawChildren[index] = updatedRoot;
4378
- if (dynamicChildren) {
4379
- if (dynamicIndex > -1) dynamicChildren[dynamicIndex] = updatedRoot;
4380
- else if (updatedRoot.patchFlag > 0) vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
4381
- }
4320
+ return teleportEnd ? hostNextSibling(teleportEnd) : el;
4382
4321
  };
4383
- return [normalizeVNode(childRoot), setRoot];
4384
- };
4385
- function filterSingleRoot(children, recurse = true) {
4386
- let singleRoot;
4387
- for (let i = 0; i < children.length; i++) {
4388
- const child = children[i];
4389
- if (isVNode(child)) {
4390
- if (child.type !== Comment || child.children === "v-if") if (singleRoot) return;
4391
- else {
4392
- singleRoot = child;
4393
- if (!!(process.env.NODE_ENV !== "production") && recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
4322
+ let isFlushing = false;
4323
+ const render$1 = (vnode, container, namespace) => {
4324
+ let instance;
4325
+ if (vnode == null) {
4326
+ if (container._vnode) {
4327
+ unmount(container._vnode, null, null, true);
4328
+ instance = container._vnode.component;
4394
4329
  }
4395
- } else return;
4330
+ } else patch(container._vnode || null, vnode, container, null, null, null, namespace);
4331
+ container._vnode = vnode;
4332
+ if (!isFlushing) {
4333
+ isFlushing = true;
4334
+ flushPreFlushCbs(instance);
4335
+ flushPostFlushCbs();
4336
+ isFlushing = false;
4337
+ }
4338
+ };
4339
+ const internals = {
4340
+ p: patch,
4341
+ um: unmount,
4342
+ m: move,
4343
+ r: remove$1,
4344
+ mt: mountComponent,
4345
+ mc: mountChildren,
4346
+ pc: patchChildren,
4347
+ pbc: patchBlockChildren,
4348
+ n: getNextHostNode,
4349
+ o: options
4350
+ };
4351
+ let hydrate;
4352
+ let hydrateNode;
4353
+ if (createHydrationFns) [hydrate, hydrateNode] = createHydrationFns(internals);
4354
+ return {
4355
+ render: render$1,
4356
+ hydrate,
4357
+ createApp: createAppAPI(render$1, hydrate)
4358
+ };
4359
+ }
4360
+ function resolveChildrenNamespace({ type, props }, currentNamespace) {
4361
+ return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
4362
+ }
4363
+ function toggleRecurse({ effect, job }, allowed) {
4364
+ if (allowed) {
4365
+ effect.flags |= 32;
4366
+ job.flags |= 4;
4367
+ } else {
4368
+ effect.flags &= -33;
4369
+ job.flags &= -5;
4396
4370
  }
4397
- return singleRoot;
4398
4371
  }
4399
- const getFunctionalFallthrough = (attrs) => {
4400
- let res;
4401
- for (const key in attrs) if (key === "class" || key === "style" || isOn(key)) (res || (res = {}))[key] = attrs[key];
4402
- return res;
4403
- };
4404
- const filterModelListeners = (attrs, props) => {
4405
- const res = {};
4406
- for (const key in attrs) if (!isModelListener(key) || !(key.slice(9) in props)) res[key] = attrs[key];
4407
- return res;
4408
- };
4409
- const isElementRoot = (vnode) => {
4410
- return vnode.shapeFlag & 7 || vnode.type === Comment;
4411
- };
4412
- function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
4413
- const { props: prevProps, children: prevChildren, component } = prevVNode;
4414
- const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
4415
- const emits = component.emitsOptions;
4416
- if (!!(process.env.NODE_ENV !== "production") && (prevChildren || nextChildren) && isHmrUpdating) return true;
4417
- if (nextVNode.dirs || nextVNode.transition) return true;
4418
- if (optimized && patchFlag >= 0) {
4419
- if (patchFlag & 1024) return true;
4420
- if (patchFlag & 16) {
4421
- if (!prevProps) return !!nextProps;
4422
- return hasPropsChanged(prevProps, nextProps, emits);
4423
- } else if (patchFlag & 8) {
4424
- const dynamicProps = nextVNode.dynamicProps;
4425
- for (let i = 0; i < dynamicProps.length; i++) {
4426
- const key = dynamicProps[i];
4427
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) return true;
4372
+ function needTransition(parentSuspense, transition) {
4373
+ return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
4374
+ }
4375
+ function traverseStaticChildren(n1, n2, shallow = false) {
4376
+ const ch1 = n1.children;
4377
+ const ch2 = n2.children;
4378
+ if (isArray(ch1) && isArray(ch2)) for (let i = 0; i < ch1.length; i++) {
4379
+ const c1 = ch1[i];
4380
+ let c2 = ch2[i];
4381
+ if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
4382
+ if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
4383
+ c2 = ch2[i] = cloneIfMounted(ch2[i]);
4384
+ c2.el = c1.el;
4428
4385
  }
4386
+ if (!shallow && c2.patchFlag !== -2) traverseStaticChildren(c1, c2);
4429
4387
  }
4430
- } else {
4431
- if (prevChildren || nextChildren) {
4432
- if (!nextChildren || !nextChildren.$stable) return true;
4433
- }
4434
- if (prevProps === nextProps) return false;
4435
- if (!prevProps) return !!nextProps;
4436
- if (!nextProps) return true;
4437
- return hasPropsChanged(prevProps, nextProps, emits);
4388
+ if (c2.type === Text) if (c2.patchFlag !== -1) c2.el = c1.el;
4389
+ else c2.__elIndex = i + (n1.type === Fragment ? 1 : 0);
4390
+ if (c2.type === Comment && !c2.el) c2.el = c1.el;
4391
+ if (!!(process.env.NODE_ENV !== "production")) c2.el && (c2.el.__vnode = c2);
4438
4392
  }
4439
- return false;
4440
4393
  }
4441
- function hasPropsChanged(prevProps, nextProps, emitsOptions) {
4442
- const nextKeys = Object.keys(nextProps);
4443
- if (nextKeys.length !== Object.keys(prevProps).length) return true;
4444
- for (let i = 0; i < nextKeys.length; i++) {
4445
- const key = nextKeys[i];
4446
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) return true;
4394
+ function getSequence(arr) {
4395
+ const p$1 = arr.slice();
4396
+ const result = [0];
4397
+ let i, j, u, v, c;
4398
+ const len = arr.length;
4399
+ for (i = 0; i < len; i++) {
4400
+ const arrI = arr[i];
4401
+ if (arrI !== 0) {
4402
+ j = result[result.length - 1];
4403
+ if (arr[j] < arrI) {
4404
+ p$1[i] = j;
4405
+ result.push(i);
4406
+ continue;
4407
+ }
4408
+ u = 0;
4409
+ v = result.length - 1;
4410
+ while (u < v) {
4411
+ c = u + v >> 1;
4412
+ if (arr[result[c]] < arrI) u = c + 1;
4413
+ else v = c;
4414
+ }
4415
+ if (arrI < arr[result[u]]) {
4416
+ if (u > 0) p$1[i] = result[u - 1];
4417
+ result[u] = i;
4418
+ }
4419
+ }
4447
4420
  }
4448
- return false;
4449
- }
4450
- function updateHOCHostEl({ vnode, parent }, el) {
4451
- while (parent) {
4452
- const root = parent.subTree;
4453
- if (root.suspense && root.suspense.activeBranch === vnode) root.el = vnode.el;
4454
- if (root === vnode) {
4455
- (vnode = parent.vnode).el = el;
4456
- parent = parent.parent;
4457
- } else break;
4421
+ u = result.length;
4422
+ v = result[u - 1];
4423
+ while (u-- > 0) {
4424
+ result[u] = v;
4425
+ v = p$1[v];
4458
4426
  }
4427
+ return result;
4428
+ }
4429
+ function locateNonHydratedAsyncRoot(instance) {
4430
+ const subComponent = instance.subTree.component;
4431
+ if (subComponent) if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
4432
+ else return locateNonHydratedAsyncRoot(subComponent);
4433
+ }
4434
+ function invalidateMount(hooks) {
4435
+ if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 8;
4436
+ }
4437
+ function resolveAsyncComponentPlaceholder(anchorVnode) {
4438
+ if (anchorVnode.placeholder) return anchorVnode.placeholder;
4439
+ const instance = anchorVnode.component;
4440
+ if (instance) return resolveAsyncComponentPlaceholder(instance.subTree);
4441
+ return null;
4459
4442
  }
4460
4443
  const isSuspense = (type) => type.__isSuspense;
4461
4444
  function queueEffectWithSuspense(fn, suspense) {
@@ -4463,10 +4446,10 @@ function queueEffectWithSuspense(fn, suspense) {
4463
4446
  else suspense.effects.push(fn);
4464
4447
  else queuePostFlushCb(fn);
4465
4448
  }
4466
- const Fragment = Symbol.for("v-fgt");
4467
- const Text = Symbol.for("v-txt");
4468
- const Comment = Symbol.for("v-cmt");
4469
- const Static = Symbol.for("v-stc");
4449
+ const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
4450
+ const Text = /* @__PURE__ */ Symbol.for("v-txt");
4451
+ const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
4452
+ const Static = /* @__PURE__ */ Symbol.for("v-stc");
4470
4453
  const blockStack = [];
4471
4454
  let currentBlock = null;
4472
4455
  function openBlock(disableTracking = false) {
@@ -4640,6 +4623,11 @@ function deepCloneVNode(vnode) {
4640
4623
  function createTextVNode(text = " ", flag = 0) {
4641
4624
  return createVNode(Text, null, text, flag);
4642
4625
  }
4626
+ function createStaticVNode(content, numberOfNodes) {
4627
+ const vnode = createVNode(Static, null, content);
4628
+ vnode.staticCount = numberOfNodes;
4629
+ return vnode;
4630
+ }
4643
4631
  function createCommentVNode(text = "", asBlock = false) {
4644
4632
  return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
4645
4633
  }
@@ -4835,7 +4823,6 @@ function setupComponent(instance, isSSR = false, optimized = false) {
4835
4823
  return setupResult;
4836
4824
  }
4837
4825
  function setupStatefulComponent(instance, isSSR) {
4838
- var _a;
4839
4826
  const Component = instance.type;
4840
4827
  if (!!(process.env.NODE_ENV !== "production")) {
4841
4828
  if (Component.name) validateComponentName(Component.name, instance.appContext.config);
@@ -4871,10 +4858,7 @@ function setupStatefulComponent(instance, isSSR) {
4871
4858
  });
4872
4859
  else {
4873
4860
  instance.asyncDep = setupResult;
4874
- if (!!(process.env.NODE_ENV !== "production") && !instance.suspense) {
4875
- const name = (_a = Component.name) != null ? _a : "Anonymous";
4876
- warn$1(`Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`);
4877
- }
4861
+ if (!!(process.env.NODE_ENV !== "production") && !instance.suspense) warn$1(`Component <${formatComponentName(instance, Component)}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`);
4878
4862
  }
4879
4863
  } else handleSetupResult(instance, setupResult, isSSR);
4880
4864
  } else finishComponentSetup(instance, isSSR);
@@ -5010,11 +4994,11 @@ function formatComponentName(instance, Component, isRoot = false) {
5010
4994
  const match = Component.__file.match(/([^/\\]+)\.\w+$/);
5011
4995
  if (match) name = match[1];
5012
4996
  }
5013
- if (!name && instance && instance.parent) {
4997
+ if (!name && instance) {
5014
4998
  const inferFromRegistry = (registry) => {
5015
4999
  for (const key in registry) if (registry[key] === Component) return key;
5016
5000
  };
5017
- name = inferFromRegistry(instance.components || instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
5001
+ name = inferFromRegistry(instance.components) || instance.parent && inferFromRegistry(instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
5018
5002
  }
5019
5003
  return name ? classify(name) : isRoot ? `App` : `Anonymous`;
5020
5004
  }
@@ -5191,13 +5175,18 @@ function initCustomFormatter() {
5191
5175
  if (window.devtoolsFormatters) window.devtoolsFormatters.push(formatter);
5192
5176
  else window.devtoolsFormatters = [formatter];
5193
5177
  }
5194
- const version = "3.5.22";
5178
+ const version = "3.5.26";
5195
5179
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
5196
5180
  const devtools = (process.env.NODE_ENV, devtools$1);
5197
5181
  const setDevtoolsHook = (process.env.NODE_ENV, setDevtoolsHook$1);
5198
5182
 
5199
5183
  //#endregion
5200
- //#region ../../node_modules/.pnpm/@vue+runtime-dom@3.5.22/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js
5184
+ //#region ../../node_modules/.pnpm/@vue+runtime-dom@3.5.26/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js
5185
+ /**
5186
+ * @vue/runtime-dom v3.5.26
5187
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
5188
+ * @license MIT
5189
+ **/
5201
5190
  let policy = void 0;
5202
5191
  const tt = typeof window !== "undefined" && window.trustedTypes;
5203
5192
  if (tt) try {
@@ -5256,7 +5245,7 @@ const nodeOps = {
5256
5245
  return [before ? before.nextSibling : parent.firstChild, anchor ? anchor.previousSibling : parent.lastChild];
5257
5246
  }
5258
5247
  };
5259
- const vtcKey = Symbol("_vtc");
5248
+ const vtcKey = /* @__PURE__ */ Symbol("_vtc");
5260
5249
  function patchClass(el, value, isSVG) {
5261
5250
  const transitionClasses = el[vtcKey];
5262
5251
  if (transitionClasses) value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
@@ -5264,8 +5253,8 @@ function patchClass(el, value, isSVG) {
5264
5253
  else if (isSVG) el.setAttribute("class", value);
5265
5254
  else el.className = value;
5266
5255
  }
5267
- const vShowOriginalDisplay = Symbol("_vod");
5268
- const vShowHidden = Symbol("_vsh");
5256
+ const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
5257
+ const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
5269
5258
  const vShow = {
5270
5259
  name: "show",
5271
5260
  beforeMount(el, { value }, { transition }) {
@@ -5295,7 +5284,7 @@ function setDisplay(el, value) {
5295
5284
  el.style.display = value ? el[vShowOriginalDisplay] : "none";
5296
5285
  el[vShowHidden] = !value;
5297
5286
  }
5298
- const CSS_VAR_TEXT = Symbol(!!(process.env.NODE_ENV !== "production") ? "CSS_VAR_TEXT" : "");
5287
+ const CSS_VAR_TEXT = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? "CSS_VAR_TEXT" : "");
5299
5288
  const displayRE = /(?:^|;)\s*display\s*:/;
5300
5289
  function patchStyle(el, prev, next) {
5301
5290
  const style = el.style;
@@ -5406,17 +5395,15 @@ function addEventListener(el, event, handler, options) {
5406
5395
  function removeEventListener(el, event, handler, options) {
5407
5396
  el.removeEventListener(event, handler, options);
5408
5397
  }
5409
- const veiKey = Symbol("_vei");
5398
+ const veiKey = /* @__PURE__ */ Symbol("_vei");
5410
5399
  function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
5411
5400
  const invokers = el[veiKey] || (el[veiKey] = {});
5412
5401
  const existingInvoker = invokers[rawName];
5413
5402
  if (nextValue && existingInvoker) existingInvoker.value = !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue;
5414
5403
  else {
5415
5404
  const [name, options] = parseName(rawName);
5416
- if (nextValue) {
5417
- const invoker = invokers[rawName] = createInvoker(!!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue, instance);
5418
- addEventListener(el, name, invoker, options);
5419
- } else if (existingInvoker) {
5405
+ if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(!!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue, instance), options);
5406
+ else if (existingInvoker) {
5420
5407
  removeEventListener(el, name, existingInvoker, options);
5421
5408
  invokers[rawName] = void 0;
5422
5409
  }
@@ -5488,6 +5475,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
5488
5475
  return false;
5489
5476
  }
5490
5477
  if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") return false;
5478
+ if (key === "sandbox" && el.tagName === "IFRAME") return false;
5491
5479
  if (key === "form") return false;
5492
5480
  if (key === "list" && el.tagName === "INPUT") return false;
5493
5481
  if (key === "type" && el.tagName === "TEXTAREA") return false;
@@ -5533,6 +5521,8 @@ var VueElement = class VueElement extends BaseClass {
5533
5521
  this._nonce = this._def.nonce;
5534
5522
  this._connected = false;
5535
5523
  this._resolved = false;
5524
+ this._patching = false;
5525
+ this._dirty = false;
5536
5526
  this._numberProps = null;
5537
5527
  this._styleChildren = /* @__PURE__ */ new WeakSet();
5538
5528
  this._ob = null;
@@ -5633,7 +5623,7 @@ var VueElement = class VueElement extends BaseClass {
5633
5623
  this._app.mount(this._root);
5634
5624
  const exposed = this._instance && this._instance.exposed;
5635
5625
  if (!exposed) return;
5636
- for (const key in exposed) if (!hasOwn$1(this, key)) Object.defineProperty(this, key, { get: () => unref(exposed[key]) });
5626
+ for (const key in exposed) if (!hasOwn(this, key)) Object.defineProperty(this, key, { get: () => unref(exposed[key]) });
5637
5627
  else if (!!(process.env.NODE_ENV !== "production")) warn(`Exposed property "${key}" already exists on custom element.`);
5638
5628
  }
5639
5629
  _resolveProps(def$1) {
@@ -5645,7 +5635,7 @@ var VueElement = class VueElement extends BaseClass {
5645
5635
  return this._getProp(key);
5646
5636
  },
5647
5637
  set(val) {
5648
- this._setProp(key, val, true, true);
5638
+ this._setProp(key, val, true, !this._patching);
5649
5639
  }
5650
5640
  });
5651
5641
  }
@@ -5668,6 +5658,7 @@ var VueElement = class VueElement extends BaseClass {
5668
5658
  */
5669
5659
  _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
5670
5660
  if (val !== this._props[key]) {
5661
+ this._dirty = true;
5671
5662
  if (val === REMOVAL) delete this._props[key];
5672
5663
  else {
5673
5664
  this._props[key] = val;
@@ -5785,10 +5776,12 @@ var VueElement = class VueElement extends BaseClass {
5785
5776
  _getSlots() {
5786
5777
  const roots = [this];
5787
5778
  if (this._teleportTargets) roots.push(...this._teleportTargets);
5788
- return roots.reduce((res, i) => {
5789
- res.push(...Array.from(i.querySelectorAll("slot")));
5790
- return res;
5791
- }, []);
5779
+ const slots = /* @__PURE__ */ new Set();
5780
+ for (const root of roots) {
5781
+ const found = root.querySelectorAll("slot");
5782
+ for (let i = 0; i < found.length; i++) slots.add(found[i]);
5783
+ }
5784
+ return Array.from(slots);
5792
5785
  }
5793
5786
  /**
5794
5787
  * @internal
@@ -5799,6 +5792,20 @@ var VueElement = class VueElement extends BaseClass {
5799
5792
  /**
5800
5793
  * @internal
5801
5794
  */
5795
+ _beginPatch() {
5796
+ this._patching = true;
5797
+ this._dirty = false;
5798
+ }
5799
+ /**
5800
+ * @internal
5801
+ */
5802
+ _endPatch() {
5803
+ this._patching = false;
5804
+ if (this._dirty && this._instance) this._update();
5805
+ }
5806
+ /**
5807
+ * @internal
5808
+ */
5802
5809
  _removeChildStyle(comp) {
5803
5810
  if (!!(process.env.NODE_ENV !== "production")) {
5804
5811
  this._styleChildren.delete(comp);
@@ -5812,9 +5819,6 @@ var VueElement = class VueElement extends BaseClass {
5812
5819
  }
5813
5820
  }
5814
5821
  };
5815
- const moveCbKey = Symbol("_moveCb");
5816
- const enterCbKey = Symbol("_enterCb");
5817
- const assignKey = Symbol("_assign");
5818
5822
  const systemModifiers = [
5819
5823
  "ctrl",
5820
5824
  "shift",
@@ -5923,28 +5927,50 @@ function normalizeContainer(container) {
5923
5927
  }
5924
5928
 
5925
5929
  //#endregion
5926
- //#region ../../node_modules/.pnpm/vue@3.5.22_typescript@5.9.3/node_modules/vue/dist/vue.runtime.esm-bundler.js
5930
+ //#region ../../node_modules/.pnpm/vue@3.5.26_typescript@5.9.3/node_modules/vue/dist/vue.runtime.esm-bundler.js
5931
+ /**
5932
+ * vue v3.5.26
5933
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
5934
+ * @license MIT
5935
+ **/
5927
5936
  function initDev() {
5928
5937
  initCustomFormatter();
5929
5938
  }
5930
5939
  if (!!(process.env.NODE_ENV !== "production")) initDev();
5931
5940
 
5932
5941
  //#endregion
5933
- //#region ../../node_modules/.pnpm/@vueuse+shared@13.9.0_vue@3.5.22_typescript@5.9.3_/node_modules/@vueuse/shared/index.mjs
5934
- function tryOnScopeDispose(fn) {
5942
+ //#region ../../node_modules/.pnpm/@vueuse+shared@14.1.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js
5943
+ /**
5944
+ * Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing
5945
+ *
5946
+ * @param fn
5947
+ */
5948
+ function tryOnScopeDispose(fn, failSilently) {
5935
5949
  if (getCurrentScope()) {
5936
- onScopeDispose(fn);
5950
+ onScopeDispose(fn, failSilently);
5937
5951
  return true;
5938
5952
  }
5939
5953
  return false;
5940
5954
  }
5941
5955
  const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
5942
- const injectLocal = /* @__NO_SIDE_EFFECTS__ */ (...args) => {
5943
- var _a;
5956
+ /**
5957
+ * On the basis of `inject`, it is allowed to directly call inject to obtain the value after call provide in the same component.
5958
+ *
5959
+ * @example
5960
+ * ```ts
5961
+ * injectLocal('MyInjectionKey', 1)
5962
+ * const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1
5963
+ * ```
5964
+ *
5965
+ * @__NO_SIDE_EFFECTS__
5966
+ */
5967
+ const injectLocal = (...args) => {
5968
+ var _getCurrentInstance;
5944
5969
  const key = args[0];
5945
- const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
5946
- if (instance == null && !hasInjectionContext()) throw new Error("injectLocal must be called in setup");
5947
- if (instance && localProvidedStateMap.has(instance) && key in localProvidedStateMap.get(instance)) return localProvidedStateMap.get(instance)[key];
5970
+ const instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;
5971
+ const owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();
5972
+ if (owner == null && !hasInjectionContext()) throw new Error("injectLocal must be called in setup");
5973
+ if (owner && localProvidedStateMap.has(owner) && key in localProvidedStateMap.get(owner)) return localProvidedStateMap.get(owner)[key];
5948
5974
  return inject(...args);
5949
5975
  };
5950
5976
  const isClient = typeof window !== "undefined" && typeof document !== "undefined";
@@ -5961,6 +5987,9 @@ function toRef(...args) {
5961
5987
  set: noop
5962
5988
  }))) : ref(r);
5963
5989
  }
5990
+ /**
5991
+ * @internal
5992
+ */
5964
5993
  function createFilterWrapper(filter, fn) {
5965
5994
  function wrapper(...args) {
5966
5995
  return new Promise((resolve, reject) => {
@@ -5973,20 +6002,23 @@ function createFilterWrapper(filter, fn) {
5973
6002
  }
5974
6003
  return wrapper;
5975
6004
  }
5976
- const bypassFilter = (invoke) => {
5977
- return invoke();
6005
+ const bypassFilter = (invoke$1) => {
6006
+ return invoke$1();
5978
6007
  };
6008
+ /**
6009
+ * Create an EventFilter that debounce the events
6010
+ */
5979
6011
  function debounceFilter(ms, options = {}) {
5980
6012
  let timer;
5981
6013
  let maxTimer;
5982
6014
  let lastRejector = noop;
5983
- const _clearTimeout = (timer2) => {
5984
- clearTimeout(timer2);
6015
+ const _clearTimeout = (timer$1) => {
6016
+ clearTimeout(timer$1);
5985
6017
  lastRejector();
5986
6018
  lastRejector = noop;
5987
6019
  };
5988
6020
  let lastInvoker;
5989
- const filter = (invoke) => {
6021
+ const filter = (invoke$1) => {
5990
6022
  const duration = toValue(ms);
5991
6023
  const maxDuration = toValue(options.maxWait);
5992
6024
  if (timer) _clearTimeout(timer);
@@ -5995,11 +6027,11 @@ function debounceFilter(ms, options = {}) {
5995
6027
  _clearTimeout(maxTimer);
5996
6028
  maxTimer = void 0;
5997
6029
  }
5998
- return Promise.resolve(invoke());
6030
+ return Promise.resolve(invoke$1());
5999
6031
  }
6000
6032
  return new Promise((resolve, reject) => {
6001
6033
  lastRejector = options.rejectOnCancel ? reject : resolve;
6002
- lastInvoker = invoke;
6034
+ lastInvoker = invoke$1;
6003
6035
  if (maxDuration && !maxTimer) maxTimer = setTimeout(() => {
6004
6036
  if (timer) _clearTimeout(timer);
6005
6037
  maxTimer = void 0;
@@ -6008,12 +6040,18 @@ function debounceFilter(ms, options = {}) {
6008
6040
  timer = setTimeout(() => {
6009
6041
  if (maxTimer) _clearTimeout(maxTimer);
6010
6042
  maxTimer = void 0;
6011
- resolve(invoke());
6043
+ resolve(invoke$1());
6012
6044
  }, duration);
6013
6045
  });
6014
6046
  };
6015
6047
  return filter;
6016
6048
  }
6049
+ /**
6050
+ * EventFilter that gives extra controls to pause and resume the filter
6051
+ *
6052
+ * @param extendFilter Extra filter to apply when the PausableFilter is active, default to none
6053
+ * @param options Options to configure the filter
6054
+ */
6017
6055
  function pausableFilter(extendFilter = bypassFilter, options = {}) {
6018
6056
  const { initialState = "active" } = options;
6019
6057
  const isActive = toRef(initialState === "active");
@@ -6033,6 +6071,9 @@ function pausableFilter(extendFilter = bypassFilter, options = {}) {
6033
6071
  eventFilter
6034
6072
  };
6035
6073
  }
6074
+ /**
6075
+ * Get a px value for SSR use, do not rely on this method outside of SSR as REM unit is assumed at 16px, which might not be the case on the client
6076
+ */
6036
6077
  function pxValue(px) {
6037
6078
  return px.endsWith("rem") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);
6038
6079
  }
@@ -6040,10 +6081,10 @@ function toArray(value) {
6040
6081
  return Array.isArray(value) ? value : [value];
6041
6082
  }
6042
6083
  function cacheStringFunction(fn) {
6043
- const cache = /* @__PURE__ */ Object.create(null);
6044
- return (str) => {
6084
+ const cache = Object.create(null);
6085
+ return ((str) => {
6045
6086
  return cache[str] || (cache[str] = fn(str));
6046
- };
6087
+ });
6047
6088
  }
6048
6089
  const hyphenateRE = /\B([A-Z])/g;
6049
6090
  const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
@@ -6054,16 +6095,27 @@ const camelize = cacheStringFunction((str) => {
6054
6095
  function getLifeCycleTarget(target) {
6055
6096
  return target || getCurrentInstance();
6056
6097
  }
6057
- /* @__NO_SIDE_EFFECTS__ */
6098
+ /**
6099
+ * Debounce execution of a function.
6100
+ *
6101
+ * @see https://vueuse.org/useDebounceFn
6102
+ * @param fn A function to be executed after delay milliseconds debounced.
6103
+ * @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
6104
+ * @param options Options
6105
+ *
6106
+ * @return A new, debounce, function.
6107
+ *
6108
+ * @__NO_SIDE_EFFECTS__
6109
+ */
6058
6110
  function useDebounceFn(fn, ms = 200, options = {}) {
6059
6111
  return createFilterWrapper(debounceFilter(ms, options), fn);
6060
6112
  }
6061
6113
  function watchWithFilter(source, cb, options = {}) {
6062
- const { eventFilter = bypassFilter,...watchOptions } = options;
6114
+ const { eventFilter = bypassFilter, ...watchOptions } = options;
6063
6115
  return watch(source, createFilterWrapper(eventFilter, cb), watchOptions);
6064
6116
  }
6065
6117
  function watchPausable(source, cb, options = {}) {
6066
- const { eventFilter: filter, initialState = "active",...watchOptions } = options;
6118
+ const { eventFilter: filter, initialState = "active", ...watchOptions } = options;
6067
6119
  const { eventFilter, pause, resume, isActive } = pausableFilter(filter, { initialState });
6068
6120
  return {
6069
6121
  stop: watchWithFilter(source, cb, {
@@ -6075,37 +6127,25 @@ function watchPausable(source, cb, options = {}) {
6075
6127
  isActive
6076
6128
  };
6077
6129
  }
6078
- function toRefs(objectRef, options = {}) {
6079
- if (!isRef(objectRef)) return toRefs$1(objectRef);
6080
- const result = Array.isArray(objectRef.value) ? Array.from({ length: objectRef.value.length }) : {};
6081
- for (const key in objectRef.value) result[key] = customRef(() => ({
6082
- get() {
6083
- return objectRef.value[key];
6084
- },
6085
- set(v) {
6086
- var _a;
6087
- if ((_a = toValue(options.replaceRef)) != null ? _a : true) if (Array.isArray(objectRef.value)) {
6088
- const copy = [...objectRef.value];
6089
- copy[key] = v;
6090
- objectRef.value = copy;
6091
- } else {
6092
- const newObject = {
6093
- ...objectRef.value,
6094
- [key]: v
6095
- };
6096
- Object.setPrototypeOf(newObject, Object.getPrototypeOf(objectRef.value));
6097
- objectRef.value = newObject;
6098
- }
6099
- else objectRef.value[key] = v;
6100
- }
6101
- }));
6102
- return result;
6103
- }
6130
+ /** @deprecated use `watchPausable` instead */
6131
+ const pausableWatch = watchPausable;
6132
+ /**
6133
+ * Call onMounted() if it's inside a component lifecycle, if not, just call the function
6134
+ *
6135
+ * @param fn
6136
+ * @param sync if set to false, it will run in the nextTick() of Vue
6137
+ * @param target
6138
+ */
6104
6139
  function tryOnMounted(fn, sync = true, target) {
6105
6140
  if (getLifeCycleTarget(target)) onMounted(fn, target);
6106
6141
  else if (sync) fn();
6107
6142
  else nextTick(fn);
6108
6143
  }
6144
+ /**
6145
+ * Shorthand for watching value with {immediate: true}
6146
+ *
6147
+ * @see https://vueuse.org/watchImmediate
6148
+ */
6109
6149
  function watchImmediate(source, cb, options) {
6110
6150
  return watch(source, cb, {
6111
6151
  ...options,
@@ -6114,22 +6154,22 @@ function watchImmediate(source, cb, options) {
6114
6154
  }
6115
6155
 
6116
6156
  //#endregion
6117
- //#region ../../node_modules/.pnpm/@vueuse+core@13.9.0_vue@3.5.22_typescript@5.9.3_/node_modules/@vueuse/core/index.mjs
6157
+ //#region ../../node_modules/.pnpm/@vueuse+core@14.1.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js
6118
6158
  const defaultWindow = isClient ? window : void 0;
6119
6159
  const defaultDocument = isClient ? window.document : void 0;
6120
6160
  const defaultNavigator = isClient ? window.navigator : void 0;
6121
6161
  const defaultLocation = isClient ? window.location : void 0;
6162
+ /**
6163
+ * Get the dom element of a ref of element or Vue component instance
6164
+ *
6165
+ * @param elRef
6166
+ */
6122
6167
  function unrefElement(elRef) {
6123
- var _a;
6168
+ var _$el;
6124
6169
  const plain = toValue(elRef);
6125
- return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
6170
+ return (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain;
6126
6171
  }
6127
6172
  function useEventListener(...args) {
6128
- const cleanups = [];
6129
- const cleanup = () => {
6130
- cleanups.forEach((fn) => fn());
6131
- cleanups.length = 0;
6132
- };
6133
6173
  const register = (el, event, listener, options) => {
6134
6174
  el.addEventListener(event, listener, options);
6135
6175
  return () => el.removeEventListener(event, listener, options);
@@ -6138,28 +6178,30 @@ function useEventListener(...args) {
6138
6178
  const test = toArray(toValue(args[0])).filter((e) => e != null);
6139
6179
  return test.every((e) => typeof e !== "string") ? test : void 0;
6140
6180
  });
6141
- const stopWatch = watchImmediate(() => {
6142
- var _a, _b;
6181
+ return watchImmediate(() => {
6182
+ var _firstParamTargets$va, _firstParamTargets$va2;
6143
6183
  return [
6144
- (_b = (_a = firstParamTargets.value) == null ? void 0 : _a.map((e) => unrefElement(e))) != null ? _b : [defaultWindow].filter((e) => e != null),
6184
+ (_firstParamTargets$va = (_firstParamTargets$va2 = firstParamTargets.value) === null || _firstParamTargets$va2 === void 0 ? void 0 : _firstParamTargets$va2.map((e) => unrefElement(e))) !== null && _firstParamTargets$va !== void 0 ? _firstParamTargets$va : [defaultWindow].filter((e) => e != null),
6145
6185
  toArray(toValue(firstParamTargets.value ? args[1] : args[0])),
6146
6186
  toArray(unref(firstParamTargets.value ? args[2] : args[1])),
6147
6187
  toValue(firstParamTargets.value ? args[3] : args[2])
6148
6188
  ];
6149
- }, ([raw_targets, raw_events, raw_listeners, raw_options]) => {
6150
- cleanup();
6151
- if (!(raw_targets == null ? void 0 : raw_targets.length) || !(raw_events == null ? void 0 : raw_events.length) || !(raw_listeners == null ? void 0 : raw_listeners.length)) return;
6189
+ }, ([raw_targets, raw_events, raw_listeners, raw_options], _, onCleanup) => {
6190
+ if (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return;
6152
6191
  const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;
6153
- cleanups.push(...raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone)))));
6192
+ const cleanups = raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))));
6193
+ onCleanup(() => {
6194
+ cleanups.forEach((fn) => fn());
6195
+ });
6154
6196
  }, { flush: "post" });
6155
- const stop$1 = () => {
6156
- stopWatch();
6157
- cleanup();
6158
- };
6159
- tryOnScopeDispose(cleanup);
6160
- return stop$1;
6161
6197
  }
6162
- /* @__NO_SIDE_EFFECTS__ */
6198
+ /**
6199
+ * Mounted state in ref.
6200
+ *
6201
+ * @see https://vueuse.org/useMounted
6202
+ *
6203
+ * @__NO_SIDE_EFFECTS__
6204
+ */
6163
6205
  function useMounted() {
6164
6206
  const isMounted = shallowRef(false);
6165
6207
  const instance = getCurrentInstance();
@@ -6170,14 +6212,23 @@ function useMounted() {
6170
6212
  }
6171
6213
  /* @__NO_SIDE_EFFECTS__ */
6172
6214
  function useSupported(callback) {
6173
- const isMounted = /* @__PURE__ */ useMounted();
6215
+ const isMounted = useMounted();
6174
6216
  return computed(() => {
6175
6217
  isMounted.value;
6176
6218
  return Boolean(callback());
6177
6219
  });
6178
6220
  }
6221
+ /**
6222
+ * Watch for changes being made to the DOM tree.
6223
+ *
6224
+ * @see https://vueuse.org/useMutationObserver
6225
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver MutationObserver MDN
6226
+ * @param target
6227
+ * @param callback
6228
+ * @param options
6229
+ */
6179
6230
  function useMutationObserver(target, callback, options = {}) {
6180
- const { window: window$1 = defaultWindow,...mutationOptions } = options;
6231
+ const { window: window$1 = defaultWindow, ...mutationOptions } = options;
6181
6232
  let observer;
6182
6233
  const isSupported$1 = /* @__PURE__ */ useSupported(() => window$1 && "MutationObserver" in window$1);
6183
6234
  const cleanup = () => {
@@ -6186,12 +6237,10 @@ function useMutationObserver(target, callback, options = {}) {
6186
6237
  observer = void 0;
6187
6238
  }
6188
6239
  };
6189
- const targets = computed(() => {
6190
- const value = toValue(target);
6191
- const items = toArray(value).map(unrefElement).filter(notNullish);
6240
+ const stopWatch = watch(computed(() => {
6241
+ const items = toArray(toValue(target)).map(unrefElement).filter(notNullish);
6192
6242
  return new Set(items);
6193
- });
6194
- const stopWatch = watch(targets, (newTargets) => {
6243
+ }), (newTargets) => {
6195
6244
  cleanup();
6196
6245
  if (isSupported$1.value && newTargets.size) {
6197
6246
  observer = new MutationObserver(callback);
@@ -6202,16 +6251,16 @@ function useMutationObserver(target, callback, options = {}) {
6202
6251
  flush: "post"
6203
6252
  });
6204
6253
  const takeRecords = () => {
6205
- return observer == null ? void 0 : observer.takeRecords();
6254
+ return observer === null || observer === void 0 ? void 0 : observer.takeRecords();
6206
6255
  };
6207
- const stop$1 = () => {
6256
+ const stop = () => {
6208
6257
  stopWatch();
6209
6258
  cleanup();
6210
6259
  };
6211
- tryOnScopeDispose(stop$1);
6260
+ tryOnScopeDispose(stop);
6212
6261
  return {
6213
6262
  isSupported: isSupported$1,
6214
- stop: stop$1,
6263
+ stop,
6215
6264
  takeRecords
6216
6265
  };
6217
6266
  }
@@ -6221,6 +6270,13 @@ function useSSRWidth() {
6221
6270
  const ssrWidth = hasInjectionContext() ? injectLocal(ssrWidthSymbol, null) : null;
6222
6271
  return typeof ssrWidth === "number" ? ssrWidth : void 0;
6223
6272
  }
6273
+ /**
6274
+ * Reactive Media Query.
6275
+ *
6276
+ * @see https://vueuse.org/useMediaQuery
6277
+ * @param query
6278
+ * @param options
6279
+ */
6224
6280
  function useMediaQuery(query, options = {}) {
6225
6281
  const { window: window$1 = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
6226
6282
  const isSupported$1 = /* @__PURE__ */ useSupported(() => window$1 && "matchMedia" in window$1 && typeof window$1.matchMedia === "function");
@@ -6299,26 +6355,28 @@ const StorageSerializers = {
6299
6355
  }
6300
6356
  };
6301
6357
  const customStorageEventName = "vueuse-storage";
6302
- function useStorage(key, defaults, storage, options = {}) {
6303
- var _a;
6358
+ /**
6359
+ * Reactive LocalStorage/SessionStorage.
6360
+ *
6361
+ * @see https://vueuse.org/useStorage
6362
+ */
6363
+ function useStorage(key, defaults$1, storage, options = {}) {
6364
+ var _options$serializer;
6304
6365
  const { flush = "pre", deep = true, listenToStorageChanges = true, writeDefaults = true, mergeDefaults = false, shallow, window: window$1 = defaultWindow, eventFilter, onError = (e) => {
6305
6366
  console.error(e);
6306
6367
  }, initOnMounted } = options;
6307
- const data = (shallow ? shallowRef : ref)(typeof defaults === "function" ? defaults() : defaults);
6368
+ const data = (shallow ? shallowRef : ref)(typeof defaults$1 === "function" ? defaults$1() : defaults$1);
6308
6369
  const keyComputed = computed(() => toValue(key));
6309
6370
  if (!storage) try {
6310
- storage = getSSRHandler("getDefaultStorage", () => {
6311
- var _a2;
6312
- return (_a2 = defaultWindow) == null ? void 0 : _a2.localStorage;
6313
- })();
6371
+ storage = getSSRHandler("getDefaultStorage", () => defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.localStorage)();
6314
6372
  } catch (e) {
6315
6373
  onError(e);
6316
6374
  }
6317
6375
  if (!storage) return data;
6318
- const rawInit = toValue(defaults);
6376
+ const rawInit = toValue(defaults$1);
6319
6377
  const type = guessSerializerType(rawInit);
6320
- const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];
6321
- const { pause: pauseWatch, resume: resumeWatch } = watchPausable(data, (newValue) => write(newValue), {
6378
+ const serializer = (_options$serializer = options.serializer) !== null && _options$serializer !== void 0 ? _options$serializer : StorageSerializers[type];
6379
+ const { pause: pauseWatch, resume: resumeWatch } = pausableWatch(data, (newValue) => write(newValue), {
6322
6380
  flush,
6323
6381
  deep,
6324
6382
  eventFilter
@@ -6333,6 +6391,12 @@ function useStorage(key, defaults, storage, options = {}) {
6333
6391
  if (initOnMounted && !firstMounted) return;
6334
6392
  updateFromCustomEvent(ev);
6335
6393
  };
6394
+ /**
6395
+ * The custom event is needed for same-document syncing when using custom
6396
+ * storage backends, but it doesn't work across different documents.
6397
+ *
6398
+ * TODO: Consider implementing a BroadcastChannel-based solution that fixes this.
6399
+ */
6336
6400
  if (window$1 && listenToStorageChanges) if (storage instanceof Storage) useEventListener(window$1, "storage", onStorageEvent, { passive: true });
6337
6401
  else useEventListener(window$1, customStorageEventName, onStorageCustomEvent);
6338
6402
  if (initOnMounted) tryOnMounted(() => {
@@ -6394,7 +6458,7 @@ function useStorage(key, defaults, storage, options = {}) {
6394
6458
  pauseWatch();
6395
6459
  try {
6396
6460
  const serializedData = serializer.write(data.value);
6397
- if (event === void 0 || (event == null ? void 0 : event.newValue) !== serializedData) data.value = read(event);
6461
+ if (event === void 0 || (event === null || event === void 0 ? void 0 : event.newValue) !== serializedData) data.value = read(event);
6398
6462
  } catch (e) {
6399
6463
  onError(e);
6400
6464
  } finally {
@@ -6407,18 +6471,28 @@ function useStorage(key, defaults, storage, options = {}) {
6407
6471
  }
6408
6472
  return data;
6409
6473
  }
6474
+ /**
6475
+ * Manipulate CSS variables.
6476
+ *
6477
+ * @see https://vueuse.org/useCssVar
6478
+ * @param prop
6479
+ * @param target
6480
+ * @param options
6481
+ */
6410
6482
  function useCssVar(prop, target, options = {}) {
6411
6483
  const { window: window$1 = defaultWindow, initialValue, observe = false } = options;
6412
6484
  const variable = shallowRef(initialValue);
6413
6485
  const elRef = computed(() => {
6414
- var _a;
6415
- return unrefElement(target) || ((_a = window$1 == null ? void 0 : window$1.document) == null ? void 0 : _a.documentElement);
6486
+ var _window$document;
6487
+ return unrefElement(target) || (window$1 === null || window$1 === void 0 || (_window$document = window$1.document) === null || _window$document === void 0 ? void 0 : _window$document.documentElement);
6416
6488
  });
6417
6489
  function updateCssVar() {
6418
- var _a;
6419
6490
  const key = toValue(prop);
6420
6491
  const el = toValue(elRef);
6421
- if (el && window$1 && key) variable.value = ((_a = window$1.getComputedStyle(el).getPropertyValue(key)) == null ? void 0 : _a.trim()) || variable.value || initialValue;
6492
+ if (el && window$1 && key) {
6493
+ var _window$getComputedSt;
6494
+ variable.value = ((_window$getComputedSt = window$1.getComputedStyle(el).getPropertyValue(key)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.trim()) || variable.value || initialValue;
6495
+ }
6422
6496
  }
6423
6497
  if (observe) useMutationObserver(elRef, updateCssVar, {
6424
6498
  attributeFilter: ["style", "class"],
@@ -6430,13 +6504,21 @@ function useCssVar(prop, target, options = {}) {
6430
6504
  }, { immediate: true });
6431
6505
  watch([variable, elRef], ([val, el]) => {
6432
6506
  const raw_prop = toValue(prop);
6433
- if ((el == null ? void 0 : el.style) && raw_prop) if (val == null) el.style.removeProperty(raw_prop);
6507
+ if ((el === null || el === void 0 ? void 0 : el.style) && raw_prop) if (val == null) el.style.removeProperty(raw_prop);
6434
6508
  else el.style.setProperty(raw_prop, val);
6435
6509
  }, { immediate: true });
6436
6510
  return variable;
6437
6511
  }
6512
+ /**
6513
+ * Reports changes to the dimensions of an Element's content or the border-box
6514
+ *
6515
+ * @see https://vueuse.org/useResizeObserver
6516
+ * @param target
6517
+ * @param callback
6518
+ * @param options
6519
+ */
6438
6520
  function useResizeObserver(target, callback, options = {}) {
6439
- const { window: window$1 = defaultWindow,...observerOptions } = options;
6521
+ const { window: window$1 = defaultWindow, ...observerOptions } = options;
6440
6522
  let observer;
6441
6523
  const isSupported$1 = /* @__PURE__ */ useSupported(() => window$1 && "ResizeObserver" in window$1);
6442
6524
  const cleanup = () => {
@@ -6445,11 +6527,10 @@ function useResizeObserver(target, callback, options = {}) {
6445
6527
  observer = void 0;
6446
6528
  }
6447
6529
  };
6448
- const targets = computed(() => {
6530
+ const stopWatch = watch(computed(() => {
6449
6531
  const _targets = toValue(target);
6450
6532
  return Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];
6451
- });
6452
- const stopWatch = watch(targets, (els) => {
6533
+ }), (els) => {
6453
6534
  cleanup();
6454
6535
  if (isSupported$1.value && window$1) {
6455
6536
  observer = new ResizeObserver(callback);
@@ -6459,16 +6540,22 @@ function useResizeObserver(target, callback, options = {}) {
6459
6540
  immediate: true,
6460
6541
  flush: "post"
6461
6542
  });
6462
- const stop$1 = () => {
6543
+ const stop = () => {
6463
6544
  cleanup();
6464
6545
  stopWatch();
6465
6546
  };
6466
- tryOnScopeDispose(stop$1);
6547
+ tryOnScopeDispose(stop);
6467
6548
  return {
6468
6549
  isSupported: isSupported$1,
6469
- stop: stop$1
6550
+ stop
6470
6551
  };
6471
6552
  }
6553
+ /**
6554
+ * Reactive bounding box of an HTML element.
6555
+ *
6556
+ * @see https://vueuse.org/useElementBounding
6557
+ * @param target
6558
+ */
6472
6559
  function useElementBounding(target, options = {}) {
6473
6560
  const { reset = true, windowResize = true, windowScroll = true, immediate = true, updateTiming = "sync" } = options;
6474
6561
  const height = shallowRef(0);
@@ -6531,14 +6618,27 @@ function useElementBounding(target, options = {}) {
6531
6618
  update
6532
6619
  };
6533
6620
  }
6621
+ /**
6622
+ * Reactive LocalStorage.
6623
+ *
6624
+ * @see https://vueuse.org/useLocalStorage
6625
+ * @param key
6626
+ * @param initialValue
6627
+ * @param options
6628
+ */
6534
6629
  function useLocalStorage(key, initialValue, options = {}) {
6535
6630
  const { window: window$1 = defaultWindow } = options;
6536
- return useStorage(key, initialValue, window$1 == null ? void 0 : window$1.localStorage, options);
6631
+ return useStorage(key, initialValue, window$1 === null || window$1 === void 0 ? void 0 : window$1.localStorage, options);
6537
6632
  }
6538
6633
  const topVarName = "--vueuse-safe-area-top";
6539
6634
  const rightVarName = "--vueuse-safe-area-right";
6540
6635
  const bottomVarName = "--vueuse-safe-area-bottom";
6541
6636
  const leftVarName = "--vueuse-safe-area-left";
6637
+ /**
6638
+ * Reactive `env(safe-area-inset-*)`
6639
+ *
6640
+ * @see https://vueuse.org/useScreenSafeArea
6641
+ */
6542
6642
  function useScreenSafeArea() {
6543
6643
  const top = shallowRef("");
6544
6644
  const right = shallowRef("");
@@ -6610,7 +6710,14 @@ const DEFAULT_UNITS = [
6610
6710
  name: "year"
6611
6711
  }
6612
6712
  ];
6613
- /* @__NO_SIDE_EFFECTS__ */
6713
+ /**
6714
+ * Reactive window size.
6715
+ *
6716
+ * @see https://vueuse.org/useWindowSize
6717
+ * @param options
6718
+ *
6719
+ * @__NO_SIDE_EFFECTS__
6720
+ */
6614
6721
  function useWindowSize(options = {}) {
6615
6722
  const { window: window$1 = defaultWindow, initialWidth = Number.POSITIVE_INFINITY, initialHeight = Number.POSITIVE_INFINITY, listenOrientation = true, includeScrollbar = true, type = "inner" } = options;
6616
6723
  const width = shallowRef(initialWidth);
@@ -6636,10 +6743,7 @@ function useWindowSize(options = {}) {
6636
6743
  const listenerOptions = { passive: true };
6637
6744
  useEventListener("resize", update, listenerOptions);
6638
6745
  if (window$1 && type === "visual" && window$1.visualViewport) useEventListener(window$1.visualViewport, "resize", update, listenerOptions);
6639
- if (listenOrientation) {
6640
- const matches = useMediaQuery("(orientation: portrait)");
6641
- watch(matches, () => update());
6642
- }
6746
+ if (listenOrientation) watch(useMediaQuery("(orientation: portrait)"), () => update());
6643
6747
  return {
6644
6748
  width,
6645
6749
  height
@@ -6647,4 +6751,73 @@ function useWindowSize(options = {}) {
6647
6751
  }
6648
6752
 
6649
6753
  //#endregion
6650
- export { Fragment, computed, createBaseVNode, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, defineCustomElement, markRaw, mergeModels, nextTick, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, reactive, ref, renderList, renderSlot, toDisplayString, toRefs, toRefs$1, unref, useElementBounding, useEventListener, useLocalStorage, useModel, useScreenSafeArea, useTemplateRef, useWindowSize, vShow, watch, watchEffect, withCtx, withDirectives, withModifiers };
6754
+ //#region src/client/webcomponents/constants.ts
6755
+ const BUILTIN_ENTRY_CLIENT_AUTH_NOTICE = Object.freeze({
6756
+ type: "~builtin",
6757
+ id: "~client-auth-notice",
6758
+ title: "Unauthorized",
6759
+ icon: "i-fluent-emoji-flat-warning"
6760
+ });
6761
+ const BUILTIN_ENTRIES = Object.freeze([BUILTIN_ENTRY_CLIENT_AUTH_NOTICE]);
6762
+
6763
+ //#endregion
6764
+ //#region src/client/webcomponents/state/docks.ts
6765
+ function DEFAULT_DOCK_PANEL_STORE() {
6766
+ return {
6767
+ width: 80,
6768
+ height: 80,
6769
+ top: 0,
6770
+ left: 10,
6771
+ position: "bottom",
6772
+ open: false,
6773
+ inactiveTimeout: 3e3
6774
+ };
6775
+ }
6776
+ function createDockEntryState(entry, selected) {
6777
+ const events = createEventEmitter();
6778
+ const state = reactive({
6779
+ entryMeta: entry,
6780
+ get isActive() {
6781
+ return selected.value?.id === entry.id;
6782
+ },
6783
+ domElements: {},
6784
+ events: markRaw(events)
6785
+ });
6786
+ watch(() => selected.value?.id, (newSelectedId) => {
6787
+ if (newSelectedId === entry.id) events.emit("entry:activated");
6788
+ else events.emit("entry:deactivated");
6789
+ }, { immediate: true });
6790
+ watch(() => state.domElements.iframe, (newIframe) => {
6791
+ if (newIframe) events.emit("dom:iframe:mounted", newIframe);
6792
+ }, { immediate: true });
6793
+ watch(() => state.domElements.panel, (newPanel) => {
6794
+ if (newPanel) events.emit("dom:panel:mounted", newPanel);
6795
+ }, { immediate: true });
6796
+ return state;
6797
+ }
6798
+ let _docksEntriesRef;
6799
+ async function useDocksEntries(rpc) {
6800
+ if (_docksEntriesRef) return _docksEntriesRef;
6801
+ const dockEntries = _docksEntriesRef = shallowRef([]);
6802
+ async function updateDocksEntries() {
6803
+ if (!rpc.isTrusted) {
6804
+ console.warn("[VITE DEVTOOLS] Untrusted client, skipping docks entries update");
6805
+ return;
6806
+ }
6807
+ dockEntries.value = (await rpc.call("vite:internal:docks:list")).map((entry) => Object.freeze(entry));
6808
+ console.log("[VITE DEVTOOLS] Docks Entries Updated", [...dockEntries.value]);
6809
+ }
6810
+ rpc.events.on("rpc:is-trusted:updated", (isTrusted) => {
6811
+ if (isTrusted) updateDocksEntries();
6812
+ });
6813
+ rpc.client.register({
6814
+ name: "vite:internal:docks:updated",
6815
+ type: "action",
6816
+ handler: () => updateDocksEntries()
6817
+ });
6818
+ await updateDocksEntries();
6819
+ return dockEntries;
6820
+ }
6821
+
6822
+ //#endregion
6823
+ export { useTemplateRef as A, unref as B, defineComponent as C, openBlock as D, onUnmounted as E, markRaw as F, normalizeStyle as H, reactive as I, ref as L, watchEffect as M, withCtx as N, renderList as O, withDirectives as P, shallowRef as R, createVNode as S, onMounted as T, toDisplayString as U, normalizeClass as V, createBaseVNode as _, BUILTIN_ENTRY_CLIENT_AUTH_NOTICE as a, createElementBlock as b, useLocalStorage as c, watchImmediate as d, defineCustomElement as f, computed as g, Fragment as h, BUILTIN_ENTRIES as i, watch as j, renderSlot as k, useScreenSafeArea as l, withModifiers as m, createDockEntryState as n, useElementBounding as o, vShow as p, useDocksEntries as r, useEventListener as s, DEFAULT_DOCK_PANEL_STORE as t, useWindowSize as u, createBlock as v, nextTick as w, createStaticVNode as x, createCommentVNode as y, toRefs as z };