@vueuse/shared 11.0.3 → 11.2.0

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.
package/index.cjs CHANGED
@@ -94,6 +94,17 @@ function createGlobalState(stateFactory) {
94
94
 
95
95
  const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
96
96
 
97
+ const injectLocal = (...args) => {
98
+ var _a;
99
+ const key = args[0];
100
+ const instance = (_a = vueDemi.getCurrentInstance()) == null ? void 0 : _a.proxy;
101
+ if (instance == null)
102
+ throw new Error("injectLocal must be called in setup");
103
+ if (localProvidedStateMap.has(instance) && key in localProvidedStateMap.get(instance))
104
+ return localProvidedStateMap.get(instance)[key];
105
+ return vueDemi.inject(...args);
106
+ };
107
+
97
108
  const provideLocal = (key, value) => {
98
109
  var _a;
99
110
  const instance = (_a = vueDemi.getCurrentInstance()) == null ? void 0 : _a.proxy;
@@ -106,17 +117,6 @@ const provideLocal = (key, value) => {
106
117
  vueDemi.provide(key, value);
107
118
  };
108
119
 
109
- const injectLocal = (...args) => {
110
- var _a;
111
- const key = args[0];
112
- const instance = (_a = vueDemi.getCurrentInstance()) == null ? void 0 : _a.proxy;
113
- if (instance == null)
114
- throw new Error("injectLocal must be called in setup");
115
- if (localProvidedStateMap.has(instance) && key in localProvidedStateMap.get(instance))
116
- return localProvidedStateMap.get(instance)[key];
117
- return vueDemi.inject(...args);
118
- };
119
-
120
120
  function createInjectionState(composable, options) {
121
121
  const key = (options == null ? void 0 : options.injectionKey) || Symbol(composable.name || "InjectionState");
122
122
  const defaultValue = options == null ? void 0 : options.defaultValue;
@@ -287,6 +287,12 @@ function reactiveOmit(obj, ...keys) {
287
287
  return reactiveComputed(() => typeof predicate === "function" ? Object.fromEntries(Object.entries(vueDemi.toRefs(obj)).filter(([k, v]) => !predicate(toValue(v), k))) : Object.fromEntries(Object.entries(vueDemi.toRefs(obj)).filter((e) => !flatKeys.includes(e[0]))));
288
288
  }
289
289
 
290
+ const directiveHooks = {
291
+ mounted: vueDemi.isVue3 ? "mounted" : "inserted",
292
+ updated: vueDemi.isVue3 ? "updated" : "componentUpdated",
293
+ unmounted: vueDemi.isVue3 ? "unmounted" : "unbind"
294
+ };
295
+
290
296
  const isClient = typeof window !== "undefined" && typeof document !== "undefined";
291
297
  const isWorker = typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
292
298
  const isDef = (val) => typeof val !== "undefined";
@@ -435,12 +441,6 @@ function pausableFilter(extendFilter = bypassFilter) {
435
441
  return { isActive: vueDemi.readonly(isActive), pause, resume, eventFilter };
436
442
  }
437
443
 
438
- const directiveHooks = {
439
- mounted: vueDemi.isVue3 ? "mounted" : "inserted",
440
- updated: vueDemi.isVue3 ? "updated" : "componentUpdated",
441
- unmounted: vueDemi.isVue3 ? "unmounted" : "unbind"
442
- };
443
-
444
444
  function cacheStringFunction(fn) {
445
445
  const cache = /* @__PURE__ */ Object.create(null);
446
446
  return (str) => {
@@ -1031,7 +1031,7 @@ function useArrayReduce(list, reducer, ...args) {
1031
1031
  const reduceCallback = (sum, value, index) => reducer(toValue(sum), toValue(value), index);
1032
1032
  return vueDemi.computed(() => {
1033
1033
  const resolved = toValue(list);
1034
- return args.length ? resolved.reduce(reduceCallback, toValue(args[0])) : resolved.reduce(reduceCallback);
1034
+ return args.length ? resolved.reduce(reduceCallback, typeof args[0] === "function" ? toValue(args[0]()) : toValue(args[0])) : resolved.reduce(reduceCallback);
1035
1035
  });
1036
1036
  }
1037
1037
 
@@ -1183,7 +1183,8 @@ function useIntervalFn(cb, interval = 1e3, options = {}) {
1183
1183
  if (immediateCallback)
1184
1184
  cb();
1185
1185
  clean();
1186
- timer = setInterval(cb, intervalValue);
1186
+ if (isActive.value)
1187
+ timer = setInterval(cb, intervalValue);
1187
1188
  }
1188
1189
  if (immediate && isClient)
1189
1190
  resume();
package/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import * as vue_demi from 'vue-demi';
2
1
  import { WatchOptionsBase, Ref, ComputedRef, WritableComputedRef, WatchSource, ComputedGetter, WritableComputedOptions, ShallowRef, WatchOptions, InjectionKey, ShallowUnwrapRef as ShallowUnwrapRef$1, inject, provide, UnwrapNestedRefs, UnwrapRef, ToRef, ToRefs, WatchCallback, WatchStopHandle } from 'vue-demi';
2
+ import * as vue from 'vue-demi';
3
3
 
4
4
  /**
5
5
  * Note: If you are using Vue 3.4+, you can straight use computed instead.
@@ -167,19 +167,11 @@ interface EventHook<T = any> {
167
167
  */
168
168
  declare function createEventHook<T = any>(): EventHook<T>;
169
169
 
170
- declare const isClient: boolean;
171
- declare const isWorker: boolean;
172
- declare const isDef: <T = any>(val?: T) => val is T;
173
- declare const notNullish: <T = any>(val?: T | null | undefined) => val is T;
174
- declare const assert: (condition: boolean, ...infos: any[]) => void;
175
- declare const isObject: (val: any) => val is object;
176
- declare const now: () => number;
177
- declare const timestamp: () => number;
178
- declare const clamp: (n: number, min: number, max: number) => number;
179
- declare const noop: () => void;
180
- declare const rand: (min: number, max: number) => number;
181
- declare const hasOwn: <T extends object, K extends keyof T>(val: T, key: K) => key is K;
182
- declare const isIOS: boolean | "";
170
+ declare const directiveHooks: {
171
+ mounted: "mounted";
172
+ updated: "updated";
173
+ unmounted: "unmounted";
174
+ };
183
175
 
184
176
  type FunctionArgs<Args extends any[] = any[], Return = void> = (...args: Args) => Return;
185
177
  interface FunctionWrapperOptions<Args extends any[] = any[], This = any> {
@@ -256,11 +248,19 @@ declare function pausableFilter(extendFilter?: EventFilter): Pausable & {
256
248
  eventFilter: EventFilter;
257
249
  };
258
250
 
259
- declare const directiveHooks: {
260
- mounted: "mounted";
261
- updated: "updated";
262
- unmounted: "unmounted";
263
- };
251
+ declare const isClient: boolean;
252
+ declare const isWorker: boolean;
253
+ declare const isDef: <T = any>(val?: T) => val is T;
254
+ declare const notNullish: <T = any>(val?: T | null | undefined) => val is T;
255
+ declare const assert: (condition: boolean, ...infos: any[]) => void;
256
+ declare const isObject: (val: any) => val is object;
257
+ declare const now: () => number;
258
+ declare const timestamp: () => number;
259
+ declare const clamp: (n: number, min: number, max: number) => number;
260
+ declare const noop: () => void;
261
+ declare const rand: (min: number, max: number) => number;
262
+ declare const hasOwn: <T extends object, K extends keyof T>(val: T, key: K) => key is K;
263
+ declare const isIOS: boolean | "";
264
264
 
265
265
  declare const hyphenate: (str: string) => string;
266
266
  declare const camelize: (str: string) => string;
@@ -484,7 +484,7 @@ declare function refDefault<T>(source: Ref<T | undefined | null>, defaultValue:
484
484
  * @param [trailing] if true, update the value again after the delay time is up
485
485
  * @param [leading] if true, update the value on the leading edge of the ms timeout
486
486
  */
487
- declare function refThrottled<T>(value: Ref<T>, delay?: number, trailing?: boolean, leading?: boolean): Ref<T>;
487
+ declare function refThrottled<T>(value: Ref<T>, delay?: number, trailing?: boolean, leading?: boolean): Ref<T, T>;
488
488
 
489
489
  interface ControlledRefOptions<T> {
490
490
  /**
@@ -503,14 +503,14 @@ interface ControlledRefOptions<T> {
503
503
  /**
504
504
  * Fine-grained controls over ref and its reactivity.
505
505
  */
506
- declare function refWithControl<T>(initial: T, options?: ControlledRefOptions<T>): vue_demi.ShallowUnwrapRef<{
506
+ declare function refWithControl<T>(initial: T, options?: ControlledRefOptions<T>): vue.ShallowUnwrapRef<{
507
507
  get: (tracking?: boolean) => T;
508
508
  set: (value: T, triggering?: boolean) => void;
509
509
  untrackedGet: () => T;
510
510
  silentSet: (v: T) => void;
511
511
  peek: () => T;
512
512
  lay: (v: T) => void;
513
- }> & vue_demi.Ref<T>;
513
+ }> & vue.Ref<T, T>;
514
514
  /**
515
515
  * Alias for `refWithControl`
516
516
  */
@@ -610,7 +610,7 @@ interface SyncRefsOptions extends ConfigurableFlushSync {
610
610
  * @param source source ref
611
611
  * @param targets
612
612
  */
613
- declare function syncRefs<T>(source: WatchSource<T>, targets: Ref<T> | Ref<T>[], options?: SyncRefsOptions): vue_demi.WatchStopHandle;
613
+ declare function syncRefs<T>(source: WatchSource<T>, targets: Ref<T> | Ref<T>[], options?: SyncRefsOptions): vue.WatchHandle;
614
614
 
615
615
  /**
616
616
  * Converts ref to reactive.
@@ -784,7 +784,8 @@ declare function useArrayEvery<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>,
784
784
  *
785
785
  * @returns a shallow copy of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned.
786
786
  */
787
- declare function useArrayFilter<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: T[]) => boolean): ComputedRef<T[]>;
787
+ declare function useArrayFilter<T, S extends T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: T[]) => element is S): ComputedRef<S[]>;
788
+ declare function useArrayFilter<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: T[]) => unknown): ComputedRef<T[]>;
788
789
 
789
790
  /**
790
791
  * Reactive `Array.find`
@@ -912,7 +913,7 @@ interface UseCounterOptions {
912
913
  * @param options
913
914
  */
914
915
  declare function useCounter(initialValue?: MaybeRef<number>, options?: UseCounterOptions): {
915
- count: vue_demi.Ref<number>;
916
+ count: vue.Ref<number, MaybeRef<number>>;
916
917
  inc: (delta?: number) => number;
917
918
  dec: (delta?: number) => number;
918
919
  get: () => number;
@@ -944,7 +945,7 @@ declare function normalizeDate(date: DateLike): Date;
944
945
  * @param formatStr - The combination of tokens to format the date
945
946
  * @param options - UseDateFormatOptions
946
947
  */
947
- declare function useDateFormat(date: MaybeRefOrGetter<DateLike>, formatStr?: MaybeRefOrGetter<string>, options?: UseDateFormatOptions): vue_demi.ComputedRef<string>;
948
+ declare function useDateFormat(date: MaybeRefOrGetter<DateLike>, formatStr?: MaybeRefOrGetter<string>, options?: UseDateFormatOptions): vue.ComputedRef<string>;
948
949
  type UseDateFormatReturn = ReturnType<typeof useDateFormat>;
949
950
 
950
951
  /**
@@ -1129,7 +1130,7 @@ declare type WatchArrayCallback<V = any, OV = any> = (value: V, oldValue: OV, ad
1129
1130
  *
1130
1131
  * @see https://vueuse.org/watchArray
1131
1132
  */
1132
- declare function watchArray<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T[]> | T[], cb: WatchArrayCallback<T[], Immediate extends true ? T[] | undefined : T[]>, options?: WatchOptions<Immediate>): vue_demi.WatchStopHandle;
1133
+ declare function watchArray<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T[]> | T[], cb: WatchArrayCallback<T[], Immediate extends true ? T[] | undefined : T[]>, options?: WatchOptions<Immediate>): vue.WatchHandle;
1133
1134
 
1134
1135
  interface WatchWithFilterOptions<Immediate> extends WatchOptions<Immediate>, ConfigurableEventFilter {
1135
1136
  }
@@ -1216,6 +1217,6 @@ interface WheneverOptions extends WatchOptions {
1216
1217
  *
1217
1218
  * @see https://vueuse.org/whenever
1218
1219
  */
1219
- declare function whenever<T>(source: WatchSource<T | false | null | undefined>, cb: WatchCallback<T>, options?: WheneverOptions): vue_demi.WatchStopHandle;
1220
+ declare function whenever<T>(source: WatchSource<T | false | null | undefined>, cb: WatchCallback<T>, options?: WheneverOptions): vue.WatchHandle;
1220
1221
 
1221
1222
  export { type AnyFn, type ArgumentsType, type Arrayable, type Awaitable, type Awaited, type ComputedRefWithControl, type ComputedWithControlRefExtra, type ConfigurableEventFilter, type ConfigurableFlush, type ConfigurableFlushSync, type ControlledRefOptions, type CreateInjectionStateOptions, type DateLike, type DebounceFilterOptions, type DeepMaybeRef, type ElementOf, type EventFilter, type EventHook, type EventHookOff, type EventHookOn, type EventHookTrigger, type ExtendRefOptions, type Fn, type FunctionArgs, type FunctionWrapperOptions, type IfAny, type IgnoredUpdater, type IsAny, type MapOldSources, type MapSources, type MaybeRef, type MaybeRefOrGetter, type MultiWatchSources, type Mutable, type Pausable, type Promisify, type PromisifyFn, type Reactified, type ReactifyNested, type ReactifyObjectOptions, type ReactifyOptions, type ReactiveOmitPredicate, type ReactivePickPredicate, type ReadonlyRefOrGetter, type RemovableRef, type ShallowUnwrapRef, type SingletonPromiseReturn, type Stoppable, type SyncRefOptions, type SyncRefsOptions, type ThrottleFilterOptions, type ToRefsOptions, type UntilArrayInstance, type UntilBaseInstance, type UntilToMatchOptions, type UntilValueInstance, type UseArrayIncludesComparatorFn, type UseArrayIncludesOptions, type UseArrayReducer, type UseCounterOptions, type UseDateFormatOptions, type UseDateFormatReturn, type UseIntervalControls, type UseIntervalFnOptions, type UseIntervalOptions, type UseLastChangedOptions, type UseTimeoutFnOptions, type UseTimeoutOptions, type UseToNumberOptions, type UseToggleOptions, type WatchArrayCallback, type WatchAtMostOptions, type WatchAtMostReturn, type WatchDebouncedOptions, type WatchIgnorableReturn, type WatchPausableReturn, type WatchThrottledOptions, type WatchTriggerableCallback, type WatchTriggerableReturn, type WatchWithFilterOptions, type WheneverOptions, type WritableComputedRefWithControl, assert, refAutoReset as autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, computedWithControl as controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, reactify as createReactiveFn, createSharedComposable, createSingletonPromise, debounceFilter, refDebounced as debouncedRef, watchDebounced as debouncedWatch, directiveHooks, computedEager as eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, watchIgnorable as ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, watchPausable as pausableWatch, promiseTimeout, provideLocal, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refThrottled, refWithControl, resolveRef, resolveUnref, set, syncRef, syncRefs, throttleFilter, refThrottled as throttledRef, watchThrottled as throttledWatch, timestamp, toReactive, toRef, toRefs, toValue, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, refDebounced as useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, refThrottled as useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };
package/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import * as vue_demi from 'vue-demi';
2
1
  import { WatchOptionsBase, Ref, ComputedRef, WritableComputedRef, WatchSource, ComputedGetter, WritableComputedOptions, ShallowRef, WatchOptions, InjectionKey, ShallowUnwrapRef as ShallowUnwrapRef$1, inject, provide, UnwrapNestedRefs, UnwrapRef, ToRef, ToRefs, WatchCallback, WatchStopHandle } from 'vue-demi';
2
+ import * as vue from 'vue-demi';
3
3
 
4
4
  /**
5
5
  * Note: If you are using Vue 3.4+, you can straight use computed instead.
@@ -167,19 +167,11 @@ interface EventHook<T = any> {
167
167
  */
168
168
  declare function createEventHook<T = any>(): EventHook<T>;
169
169
 
170
- declare const isClient: boolean;
171
- declare const isWorker: boolean;
172
- declare const isDef: <T = any>(val?: T) => val is T;
173
- declare const notNullish: <T = any>(val?: T | null | undefined) => val is T;
174
- declare const assert: (condition: boolean, ...infos: any[]) => void;
175
- declare const isObject: (val: any) => val is object;
176
- declare const now: () => number;
177
- declare const timestamp: () => number;
178
- declare const clamp: (n: number, min: number, max: number) => number;
179
- declare const noop: () => void;
180
- declare const rand: (min: number, max: number) => number;
181
- declare const hasOwn: <T extends object, K extends keyof T>(val: T, key: K) => key is K;
182
- declare const isIOS: boolean | "";
170
+ declare const directiveHooks: {
171
+ mounted: "mounted";
172
+ updated: "updated";
173
+ unmounted: "unmounted";
174
+ };
183
175
 
184
176
  type FunctionArgs<Args extends any[] = any[], Return = void> = (...args: Args) => Return;
185
177
  interface FunctionWrapperOptions<Args extends any[] = any[], This = any> {
@@ -256,11 +248,19 @@ declare function pausableFilter(extendFilter?: EventFilter): Pausable & {
256
248
  eventFilter: EventFilter;
257
249
  };
258
250
 
259
- declare const directiveHooks: {
260
- mounted: "mounted";
261
- updated: "updated";
262
- unmounted: "unmounted";
263
- };
251
+ declare const isClient: boolean;
252
+ declare const isWorker: boolean;
253
+ declare const isDef: <T = any>(val?: T) => val is T;
254
+ declare const notNullish: <T = any>(val?: T | null | undefined) => val is T;
255
+ declare const assert: (condition: boolean, ...infos: any[]) => void;
256
+ declare const isObject: (val: any) => val is object;
257
+ declare const now: () => number;
258
+ declare const timestamp: () => number;
259
+ declare const clamp: (n: number, min: number, max: number) => number;
260
+ declare const noop: () => void;
261
+ declare const rand: (min: number, max: number) => number;
262
+ declare const hasOwn: <T extends object, K extends keyof T>(val: T, key: K) => key is K;
263
+ declare const isIOS: boolean | "";
264
264
 
265
265
  declare const hyphenate: (str: string) => string;
266
266
  declare const camelize: (str: string) => string;
@@ -484,7 +484,7 @@ declare function refDefault<T>(source: Ref<T | undefined | null>, defaultValue:
484
484
  * @param [trailing] if true, update the value again after the delay time is up
485
485
  * @param [leading] if true, update the value on the leading edge of the ms timeout
486
486
  */
487
- declare function refThrottled<T>(value: Ref<T>, delay?: number, trailing?: boolean, leading?: boolean): Ref<T>;
487
+ declare function refThrottled<T>(value: Ref<T>, delay?: number, trailing?: boolean, leading?: boolean): Ref<T, T>;
488
488
 
489
489
  interface ControlledRefOptions<T> {
490
490
  /**
@@ -503,14 +503,14 @@ interface ControlledRefOptions<T> {
503
503
  /**
504
504
  * Fine-grained controls over ref and its reactivity.
505
505
  */
506
- declare function refWithControl<T>(initial: T, options?: ControlledRefOptions<T>): vue_demi.ShallowUnwrapRef<{
506
+ declare function refWithControl<T>(initial: T, options?: ControlledRefOptions<T>): vue.ShallowUnwrapRef<{
507
507
  get: (tracking?: boolean) => T;
508
508
  set: (value: T, triggering?: boolean) => void;
509
509
  untrackedGet: () => T;
510
510
  silentSet: (v: T) => void;
511
511
  peek: () => T;
512
512
  lay: (v: T) => void;
513
- }> & vue_demi.Ref<T>;
513
+ }> & vue.Ref<T, T>;
514
514
  /**
515
515
  * Alias for `refWithControl`
516
516
  */
@@ -610,7 +610,7 @@ interface SyncRefsOptions extends ConfigurableFlushSync {
610
610
  * @param source source ref
611
611
  * @param targets
612
612
  */
613
- declare function syncRefs<T>(source: WatchSource<T>, targets: Ref<T> | Ref<T>[], options?: SyncRefsOptions): vue_demi.WatchStopHandle;
613
+ declare function syncRefs<T>(source: WatchSource<T>, targets: Ref<T> | Ref<T>[], options?: SyncRefsOptions): vue.WatchHandle;
614
614
 
615
615
  /**
616
616
  * Converts ref to reactive.
@@ -784,7 +784,8 @@ declare function useArrayEvery<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>,
784
784
  *
785
785
  * @returns a shallow copy of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned.
786
786
  */
787
- declare function useArrayFilter<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: T[]) => boolean): ComputedRef<T[]>;
787
+ declare function useArrayFilter<T, S extends T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: T[]) => element is S): ComputedRef<S[]>;
788
+ declare function useArrayFilter<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: T[]) => unknown): ComputedRef<T[]>;
788
789
 
789
790
  /**
790
791
  * Reactive `Array.find`
@@ -912,7 +913,7 @@ interface UseCounterOptions {
912
913
  * @param options
913
914
  */
914
915
  declare function useCounter(initialValue?: MaybeRef<number>, options?: UseCounterOptions): {
915
- count: vue_demi.Ref<number>;
916
+ count: vue.Ref<number, MaybeRef<number>>;
916
917
  inc: (delta?: number) => number;
917
918
  dec: (delta?: number) => number;
918
919
  get: () => number;
@@ -944,7 +945,7 @@ declare function normalizeDate(date: DateLike): Date;
944
945
  * @param formatStr - The combination of tokens to format the date
945
946
  * @param options - UseDateFormatOptions
946
947
  */
947
- declare function useDateFormat(date: MaybeRefOrGetter<DateLike>, formatStr?: MaybeRefOrGetter<string>, options?: UseDateFormatOptions): vue_demi.ComputedRef<string>;
948
+ declare function useDateFormat(date: MaybeRefOrGetter<DateLike>, formatStr?: MaybeRefOrGetter<string>, options?: UseDateFormatOptions): vue.ComputedRef<string>;
948
949
  type UseDateFormatReturn = ReturnType<typeof useDateFormat>;
949
950
 
950
951
  /**
@@ -1129,7 +1130,7 @@ declare type WatchArrayCallback<V = any, OV = any> = (value: V, oldValue: OV, ad
1129
1130
  *
1130
1131
  * @see https://vueuse.org/watchArray
1131
1132
  */
1132
- declare function watchArray<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T[]> | T[], cb: WatchArrayCallback<T[], Immediate extends true ? T[] | undefined : T[]>, options?: WatchOptions<Immediate>): vue_demi.WatchStopHandle;
1133
+ declare function watchArray<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T[]> | T[], cb: WatchArrayCallback<T[], Immediate extends true ? T[] | undefined : T[]>, options?: WatchOptions<Immediate>): vue.WatchHandle;
1133
1134
 
1134
1135
  interface WatchWithFilterOptions<Immediate> extends WatchOptions<Immediate>, ConfigurableEventFilter {
1135
1136
  }
@@ -1216,6 +1217,6 @@ interface WheneverOptions extends WatchOptions {
1216
1217
  *
1217
1218
  * @see https://vueuse.org/whenever
1218
1219
  */
1219
- declare function whenever<T>(source: WatchSource<T | false | null | undefined>, cb: WatchCallback<T>, options?: WheneverOptions): vue_demi.WatchStopHandle;
1220
+ declare function whenever<T>(source: WatchSource<T | false | null | undefined>, cb: WatchCallback<T>, options?: WheneverOptions): vue.WatchHandle;
1220
1221
 
1221
1222
  export { type AnyFn, type ArgumentsType, type Arrayable, type Awaitable, type Awaited, type ComputedRefWithControl, type ComputedWithControlRefExtra, type ConfigurableEventFilter, type ConfigurableFlush, type ConfigurableFlushSync, type ControlledRefOptions, type CreateInjectionStateOptions, type DateLike, type DebounceFilterOptions, type DeepMaybeRef, type ElementOf, type EventFilter, type EventHook, type EventHookOff, type EventHookOn, type EventHookTrigger, type ExtendRefOptions, type Fn, type FunctionArgs, type FunctionWrapperOptions, type IfAny, type IgnoredUpdater, type IsAny, type MapOldSources, type MapSources, type MaybeRef, type MaybeRefOrGetter, type MultiWatchSources, type Mutable, type Pausable, type Promisify, type PromisifyFn, type Reactified, type ReactifyNested, type ReactifyObjectOptions, type ReactifyOptions, type ReactiveOmitPredicate, type ReactivePickPredicate, type ReadonlyRefOrGetter, type RemovableRef, type ShallowUnwrapRef, type SingletonPromiseReturn, type Stoppable, type SyncRefOptions, type SyncRefsOptions, type ThrottleFilterOptions, type ToRefsOptions, type UntilArrayInstance, type UntilBaseInstance, type UntilToMatchOptions, type UntilValueInstance, type UseArrayIncludesComparatorFn, type UseArrayIncludesOptions, type UseArrayReducer, type UseCounterOptions, type UseDateFormatOptions, type UseDateFormatReturn, type UseIntervalControls, type UseIntervalFnOptions, type UseIntervalOptions, type UseLastChangedOptions, type UseTimeoutFnOptions, type UseTimeoutOptions, type UseToNumberOptions, type UseToggleOptions, type WatchArrayCallback, type WatchAtMostOptions, type WatchAtMostReturn, type WatchDebouncedOptions, type WatchIgnorableReturn, type WatchPausableReturn, type WatchThrottledOptions, type WatchTriggerableCallback, type WatchTriggerableReturn, type WatchWithFilterOptions, type WheneverOptions, type WritableComputedRefWithControl, assert, refAutoReset as autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, computedWithControl as controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, reactify as createReactiveFn, createSharedComposable, createSingletonPromise, debounceFilter, refDebounced as debouncedRef, watchDebounced as debouncedWatch, directiveHooks, computedEager as eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, watchIgnorable as ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, watchPausable as pausableWatch, promiseTimeout, provideLocal, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refThrottled, refWithControl, resolveRef, resolveUnref, set, syncRef, syncRefs, throttleFilter, refThrottled as throttledRef, watchThrottled as throttledWatch, timestamp, toReactive, toRef, toRefs, toValue, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, refDebounced as useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, refThrottled as useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as vue_demi from 'vue-demi';
2
1
  import { WatchOptionsBase, Ref, ComputedRef, WritableComputedRef, WatchSource, ComputedGetter, WritableComputedOptions, ShallowRef, WatchOptions, InjectionKey, ShallowUnwrapRef as ShallowUnwrapRef$1, inject, provide, UnwrapNestedRefs, UnwrapRef, ToRef, ToRefs, WatchCallback, WatchStopHandle } from 'vue-demi';
2
+ import * as vue from 'vue-demi';
3
3
 
4
4
  /**
5
5
  * Note: If you are using Vue 3.4+, you can straight use computed instead.
@@ -167,19 +167,11 @@ interface EventHook<T = any> {
167
167
  */
168
168
  declare function createEventHook<T = any>(): EventHook<T>;
169
169
 
170
- declare const isClient: boolean;
171
- declare const isWorker: boolean;
172
- declare const isDef: <T = any>(val?: T) => val is T;
173
- declare const notNullish: <T = any>(val?: T | null | undefined) => val is T;
174
- declare const assert: (condition: boolean, ...infos: any[]) => void;
175
- declare const isObject: (val: any) => val is object;
176
- declare const now: () => number;
177
- declare const timestamp: () => number;
178
- declare const clamp: (n: number, min: number, max: number) => number;
179
- declare const noop: () => void;
180
- declare const rand: (min: number, max: number) => number;
181
- declare const hasOwn: <T extends object, K extends keyof T>(val: T, key: K) => key is K;
182
- declare const isIOS: boolean | "";
170
+ declare const directiveHooks: {
171
+ mounted: "mounted";
172
+ updated: "updated";
173
+ unmounted: "unmounted";
174
+ };
183
175
 
184
176
  type FunctionArgs<Args extends any[] = any[], Return = void> = (...args: Args) => Return;
185
177
  interface FunctionWrapperOptions<Args extends any[] = any[], This = any> {
@@ -256,11 +248,19 @@ declare function pausableFilter(extendFilter?: EventFilter): Pausable & {
256
248
  eventFilter: EventFilter;
257
249
  };
258
250
 
259
- declare const directiveHooks: {
260
- mounted: "mounted";
261
- updated: "updated";
262
- unmounted: "unmounted";
263
- };
251
+ declare const isClient: boolean;
252
+ declare const isWorker: boolean;
253
+ declare const isDef: <T = any>(val?: T) => val is T;
254
+ declare const notNullish: <T = any>(val?: T | null | undefined) => val is T;
255
+ declare const assert: (condition: boolean, ...infos: any[]) => void;
256
+ declare const isObject: (val: any) => val is object;
257
+ declare const now: () => number;
258
+ declare const timestamp: () => number;
259
+ declare const clamp: (n: number, min: number, max: number) => number;
260
+ declare const noop: () => void;
261
+ declare const rand: (min: number, max: number) => number;
262
+ declare const hasOwn: <T extends object, K extends keyof T>(val: T, key: K) => key is K;
263
+ declare const isIOS: boolean | "";
264
264
 
265
265
  declare const hyphenate: (str: string) => string;
266
266
  declare const camelize: (str: string) => string;
@@ -484,7 +484,7 @@ declare function refDefault<T>(source: Ref<T | undefined | null>, defaultValue:
484
484
  * @param [trailing] if true, update the value again after the delay time is up
485
485
  * @param [leading] if true, update the value on the leading edge of the ms timeout
486
486
  */
487
- declare function refThrottled<T>(value: Ref<T>, delay?: number, trailing?: boolean, leading?: boolean): Ref<T>;
487
+ declare function refThrottled<T>(value: Ref<T>, delay?: number, trailing?: boolean, leading?: boolean): Ref<T, T>;
488
488
 
489
489
  interface ControlledRefOptions<T> {
490
490
  /**
@@ -503,14 +503,14 @@ interface ControlledRefOptions<T> {
503
503
  /**
504
504
  * Fine-grained controls over ref and its reactivity.
505
505
  */
506
- declare function refWithControl<T>(initial: T, options?: ControlledRefOptions<T>): vue_demi.ShallowUnwrapRef<{
506
+ declare function refWithControl<T>(initial: T, options?: ControlledRefOptions<T>): vue.ShallowUnwrapRef<{
507
507
  get: (tracking?: boolean) => T;
508
508
  set: (value: T, triggering?: boolean) => void;
509
509
  untrackedGet: () => T;
510
510
  silentSet: (v: T) => void;
511
511
  peek: () => T;
512
512
  lay: (v: T) => void;
513
- }> & vue_demi.Ref<T>;
513
+ }> & vue.Ref<T, T>;
514
514
  /**
515
515
  * Alias for `refWithControl`
516
516
  */
@@ -610,7 +610,7 @@ interface SyncRefsOptions extends ConfigurableFlushSync {
610
610
  * @param source source ref
611
611
  * @param targets
612
612
  */
613
- declare function syncRefs<T>(source: WatchSource<T>, targets: Ref<T> | Ref<T>[], options?: SyncRefsOptions): vue_demi.WatchStopHandle;
613
+ declare function syncRefs<T>(source: WatchSource<T>, targets: Ref<T> | Ref<T>[], options?: SyncRefsOptions): vue.WatchHandle;
614
614
 
615
615
  /**
616
616
  * Converts ref to reactive.
@@ -784,7 +784,8 @@ declare function useArrayEvery<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>,
784
784
  *
785
785
  * @returns a shallow copy of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned.
786
786
  */
787
- declare function useArrayFilter<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: T[]) => boolean): ComputedRef<T[]>;
787
+ declare function useArrayFilter<T, S extends T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: T[]) => element is S): ComputedRef<S[]>;
788
+ declare function useArrayFilter<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: T[]) => unknown): ComputedRef<T[]>;
788
789
 
789
790
  /**
790
791
  * Reactive `Array.find`
@@ -912,7 +913,7 @@ interface UseCounterOptions {
912
913
  * @param options
913
914
  */
914
915
  declare function useCounter(initialValue?: MaybeRef<number>, options?: UseCounterOptions): {
915
- count: vue_demi.Ref<number>;
916
+ count: vue.Ref<number, MaybeRef<number>>;
916
917
  inc: (delta?: number) => number;
917
918
  dec: (delta?: number) => number;
918
919
  get: () => number;
@@ -944,7 +945,7 @@ declare function normalizeDate(date: DateLike): Date;
944
945
  * @param formatStr - The combination of tokens to format the date
945
946
  * @param options - UseDateFormatOptions
946
947
  */
947
- declare function useDateFormat(date: MaybeRefOrGetter<DateLike>, formatStr?: MaybeRefOrGetter<string>, options?: UseDateFormatOptions): vue_demi.ComputedRef<string>;
948
+ declare function useDateFormat(date: MaybeRefOrGetter<DateLike>, formatStr?: MaybeRefOrGetter<string>, options?: UseDateFormatOptions): vue.ComputedRef<string>;
948
949
  type UseDateFormatReturn = ReturnType<typeof useDateFormat>;
949
950
 
950
951
  /**
@@ -1129,7 +1130,7 @@ declare type WatchArrayCallback<V = any, OV = any> = (value: V, oldValue: OV, ad
1129
1130
  *
1130
1131
  * @see https://vueuse.org/watchArray
1131
1132
  */
1132
- declare function watchArray<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T[]> | T[], cb: WatchArrayCallback<T[], Immediate extends true ? T[] | undefined : T[]>, options?: WatchOptions<Immediate>): vue_demi.WatchStopHandle;
1133
+ declare function watchArray<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T[]> | T[], cb: WatchArrayCallback<T[], Immediate extends true ? T[] | undefined : T[]>, options?: WatchOptions<Immediate>): vue.WatchHandle;
1133
1134
 
1134
1135
  interface WatchWithFilterOptions<Immediate> extends WatchOptions<Immediate>, ConfigurableEventFilter {
1135
1136
  }
@@ -1216,6 +1217,6 @@ interface WheneverOptions extends WatchOptions {
1216
1217
  *
1217
1218
  * @see https://vueuse.org/whenever
1218
1219
  */
1219
- declare function whenever<T>(source: WatchSource<T | false | null | undefined>, cb: WatchCallback<T>, options?: WheneverOptions): vue_demi.WatchStopHandle;
1220
+ declare function whenever<T>(source: WatchSource<T | false | null | undefined>, cb: WatchCallback<T>, options?: WheneverOptions): vue.WatchHandle;
1220
1221
 
1221
1222
  export { type AnyFn, type ArgumentsType, type Arrayable, type Awaitable, type Awaited, type ComputedRefWithControl, type ComputedWithControlRefExtra, type ConfigurableEventFilter, type ConfigurableFlush, type ConfigurableFlushSync, type ControlledRefOptions, type CreateInjectionStateOptions, type DateLike, type DebounceFilterOptions, type DeepMaybeRef, type ElementOf, type EventFilter, type EventHook, type EventHookOff, type EventHookOn, type EventHookTrigger, type ExtendRefOptions, type Fn, type FunctionArgs, type FunctionWrapperOptions, type IfAny, type IgnoredUpdater, type IsAny, type MapOldSources, type MapSources, type MaybeRef, type MaybeRefOrGetter, type MultiWatchSources, type Mutable, type Pausable, type Promisify, type PromisifyFn, type Reactified, type ReactifyNested, type ReactifyObjectOptions, type ReactifyOptions, type ReactiveOmitPredicate, type ReactivePickPredicate, type ReadonlyRefOrGetter, type RemovableRef, type ShallowUnwrapRef, type SingletonPromiseReturn, type Stoppable, type SyncRefOptions, type SyncRefsOptions, type ThrottleFilterOptions, type ToRefsOptions, type UntilArrayInstance, type UntilBaseInstance, type UntilToMatchOptions, type UntilValueInstance, type UseArrayIncludesComparatorFn, type UseArrayIncludesOptions, type UseArrayReducer, type UseCounterOptions, type UseDateFormatOptions, type UseDateFormatReturn, type UseIntervalControls, type UseIntervalFnOptions, type UseIntervalOptions, type UseLastChangedOptions, type UseTimeoutFnOptions, type UseTimeoutOptions, type UseToNumberOptions, type UseToggleOptions, type WatchArrayCallback, type WatchAtMostOptions, type WatchAtMostReturn, type WatchDebouncedOptions, type WatchIgnorableReturn, type WatchPausableReturn, type WatchThrottledOptions, type WatchTriggerableCallback, type WatchTriggerableReturn, type WatchWithFilterOptions, type WheneverOptions, type WritableComputedRefWithControl, assert, refAutoReset as autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, computedWithControl as controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, reactify as createReactiveFn, createSharedComposable, createSingletonPromise, debounceFilter, refDebounced as debouncedRef, watchDebounced as debouncedWatch, directiveHooks, computedEager as eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, watchIgnorable as ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, watchPausable as pausableWatch, promiseTimeout, provideLocal, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refThrottled, refWithControl, resolveRef, resolveUnref, set, syncRef, syncRefs, throttleFilter, refThrottled as throttledRef, watchThrottled as throttledWatch, timestamp, toReactive, toRef, toRefs, toValue, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, refDebounced as useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, refThrottled as useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };
package/index.iife.js CHANGED
@@ -220,6 +220,17 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
220
220
 
221
221
  const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
222
222
 
223
+ const injectLocal = (...args) => {
224
+ var _a;
225
+ const key = args[0];
226
+ const instance = (_a = vueDemi.getCurrentInstance()) == null ? void 0 : _a.proxy;
227
+ if (instance == null)
228
+ throw new Error("injectLocal must be called in setup");
229
+ if (localProvidedStateMap.has(instance) && key in localProvidedStateMap.get(instance))
230
+ return localProvidedStateMap.get(instance)[key];
231
+ return vueDemi.inject(...args);
232
+ };
233
+
223
234
  const provideLocal = (key, value) => {
224
235
  var _a;
225
236
  const instance = (_a = vueDemi.getCurrentInstance()) == null ? void 0 : _a.proxy;
@@ -232,17 +243,6 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
232
243
  vueDemi.provide(key, value);
233
244
  };
234
245
 
235
- const injectLocal = (...args) => {
236
- var _a;
237
- const key = args[0];
238
- const instance = (_a = vueDemi.getCurrentInstance()) == null ? void 0 : _a.proxy;
239
- if (instance == null)
240
- throw new Error("injectLocal must be called in setup");
241
- if (localProvidedStateMap.has(instance) && key in localProvidedStateMap.get(instance))
242
- return localProvidedStateMap.get(instance)[key];
243
- return vueDemi.inject(...args);
244
- };
245
-
246
246
  function createInjectionState(composable, options) {
247
247
  const key = (options == null ? void 0 : options.injectionKey) || Symbol(composable.name || "InjectionState");
248
248
  const defaultValue = options == null ? void 0 : options.defaultValue;
@@ -413,6 +413,12 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
413
413
  return reactiveComputed(() => typeof predicate === "function" ? Object.fromEntries(Object.entries(vueDemi.toRefs(obj)).filter(([k, v]) => !predicate(toValue(v), k))) : Object.fromEntries(Object.entries(vueDemi.toRefs(obj)).filter((e) => !flatKeys.includes(e[0]))));
414
414
  }
415
415
 
416
+ const directiveHooks = {
417
+ mounted: vueDemi.isVue3 ? "mounted" : "inserted",
418
+ updated: vueDemi.isVue3 ? "updated" : "componentUpdated",
419
+ unmounted: vueDemi.isVue3 ? "unmounted" : "unbind"
420
+ };
421
+
416
422
  const isClient = typeof window !== "undefined" && typeof document !== "undefined";
417
423
  const isWorker = typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
418
424
  const isDef = (val) => typeof val !== "undefined";
@@ -561,12 +567,6 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
561
567
  return { isActive: vueDemi.readonly(isActive), pause, resume, eventFilter };
562
568
  }
563
569
 
564
- const directiveHooks = {
565
- mounted: vueDemi.isVue3 ? "mounted" : "inserted",
566
- updated: vueDemi.isVue3 ? "updated" : "componentUpdated",
567
- unmounted: vueDemi.isVue3 ? "unmounted" : "unbind"
568
- };
569
-
570
570
  function cacheStringFunction(fn) {
571
571
  const cache = /* @__PURE__ */ Object.create(null);
572
572
  return (str) => {
@@ -1157,7 +1157,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1157
1157
  const reduceCallback = (sum, value, index) => reducer(toValue(sum), toValue(value), index);
1158
1158
  return vueDemi.computed(() => {
1159
1159
  const resolved = toValue(list);
1160
- return args.length ? resolved.reduce(reduceCallback, toValue(args[0])) : resolved.reduce(reduceCallback);
1160
+ return args.length ? resolved.reduce(reduceCallback, typeof args[0] === "function" ? toValue(args[0]()) : toValue(args[0])) : resolved.reduce(reduceCallback);
1161
1161
  });
1162
1162
  }
1163
1163
 
@@ -1309,7 +1309,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1309
1309
  if (immediateCallback)
1310
1310
  cb();
1311
1311
  clean();
1312
- timer = setInterval(cb, intervalValue);
1312
+ if (isActive.value)
1313
+ timer = setInterval(cb, intervalValue);
1313
1314
  }
1314
1315
  if (immediate && isClient)
1315
1316
  resume();
package/index.iife.min.js CHANGED
@@ -1 +1 @@
1
- var _VueDemiGlobal=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this,VueDemi=function(c,u,E){if(c.install)return c;if(!u)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),c;if(u.version.slice(0,4)==="2.7."){let v=function(T,A){var P,_={},U={config:u.config,use:u.use.bind(u),mixin:u.mixin.bind(u),component:u.component.bind(u),provide:function(I,F){return _[I]=F,this},directive:function(I,F){return F?(u.directive(I,F),U):u.directive(I)},mount:function(I,F){return P||(P=new u(Object.assign({propsData:A},T,{provide:Object.assign(_,T.provide)})),P.$mount(I,F),P)},unmount:function(){P&&(P.$destroy(),P=void 0)}};return U};var M=v;for(var S in u)c[S]=u[S];c.isVue2=!0,c.isVue3=!1,c.install=function(){},c.Vue=u,c.Vue2=u,c.version=u.version,c.warn=u.util.warn,c.hasInjectionContext=function(){return!!c.getCurrentInstance()},c.createApp=v}else if(u.version.slice(0,2)==="2.")if(E){for(var S in E)c[S]=E[S];c.isVue2=!0,c.isVue3=!1,c.install=function(){},c.Vue=u,c.Vue2=u,c.version=u.version,c.hasInjectionContext=function(){return!!c.getCurrentInstance()}}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(u.version.slice(0,2)==="3."){for(var S in u)c[S]=u[S];c.isVue2=!1,c.isVue3=!0,c.install=function(){},c.Vue=u,c.Vue2=void 0,c.version=u.version,c.set=function(v,T,A){return Array.isArray(v)?(v.length=Math.max(v.length,T),v.splice(T,1,A),A):(v[T]=A,A)},c.del=function(v,T){if(Array.isArray(v)){v.splice(T,1);return}delete v[T]}}else console.error("[vue-demi] Vue version "+u.version+" is unsupported.");return c}(_VueDemiGlobal.VueDemi=_VueDemiGlobal.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),_VueDemiGlobal.Vue||(typeof Vue<"u"?Vue:void 0),_VueDemiGlobal.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(c,u){"use strict";function E(t,e){var n;const r=u.shallowRef();return u.watchEffect(()=>{r.value=t()},{...e,flush:(n=e?.flush)!=null?n:"sync"}),u.readonly(r)}function S(t,e){let n,r,o;const i=u.ref(!0),l=()=>{i.value=!0,o()};u.watch(t,l,{flush:"sync"});const a=typeof e=="function"?e:e.get,f=typeof e=="function"?void 0:e.set,g=u.customRef((y,h)=>(r=y,o=h,{get(){return i.value&&(n=a(n),i.value=!1),r(),n},set(d){f?.(d)}}));return Object.isExtensible(g)&&(g.trigger=l),g}function M(t){return u.getCurrentScope()?(u.onScopeDispose(t),!0):!1}function v(){const t=new Set,e=o=>{t.delete(o)};return{on:o=>{t.add(o);const i=()=>e(o);return M(i),{off:i}},off:e,trigger:(...o)=>Promise.all(Array.from(t).map(i=>i(...o)))}}function T(t){let e=!1,n;const r=u.effectScope(!0);return(...o)=>(e||(n=r.run(()=>t(...o)),e=!0),n)}const A=new WeakMap,P=(t,e)=>{var n;const r=(n=u.getCurrentInstance())==null?void 0:n.proxy;if(r==null)throw new Error("provideLocal must be called in setup");A.has(r)||A.set(r,Object.create(null));const o=A.get(r);o[t]=e,u.provide(t,e)},_=(...t)=>{var e;const n=t[0],r=(e=u.getCurrentInstance())==null?void 0:e.proxy;if(r==null)throw new Error("injectLocal must be called in setup");return A.has(r)&&n in A.get(r)?A.get(r)[n]:u.inject(...t)};function U(t,e){const n=e?.injectionKey||Symbol(t.name||"InjectionState"),r=e?.defaultValue;return[(...l)=>{const a=t(...l);return P(n,a),a},()=>_(n,r)]}function I(t){let e=0,n,r;const o=()=>{e-=1,r&&e<=0&&(r.stop(),n=void 0,r=void 0)};return(...i)=>(e+=1,r||(r=u.effectScope(!0),n=r.run(()=>t(...i))),M(o),n)}function F(t,e,{enumerable:n=!1,unwrap:r=!0}={}){if(!u.isVue3&&!u.version.startsWith("2.7.")){if(process.env.NODE_ENV!=="production")throw new Error("[VueUse] extendRef only works in Vue 2.7 or above.");return}for(const[o,i]of Object.entries(e))o!=="value"&&(u.isRef(i)&&r?Object.defineProperty(t,o,{get(){return i.value},set(l){i.value=l},enumerable:n}):Object.defineProperty(t,o,{value:i,enumerable:n}));return t}function wt(t,e){return e==null?u.unref(t):u.unref(t)[e]}function mt(t){return u.unref(t)!=null}function pt(t,e){if(typeof Symbol<"u"){const n={...t};return Object.defineProperty(n,Symbol.iterator,{enumerable:!1,value(){let r=0;return{next:()=>({value:e[r++],done:r>e.length})}}}),n}else return Object.assign([...e],t)}function s(t){return typeof t=="function"?t():u.unref(t)}const vt=s;function Y(t,e){const n=e?.computedGetter===!1?u.unref:s;return function(...r){return u.computed(()=>t.apply(this,r.map(o=>n(o))))}}function bt(t,e={}){let n=[],r;if(Array.isArray(e))n=e;else{r=e;const{includeOwnProperties:o=!0}=e;n.push(...Object.keys(t)),o&&n.push(...Object.getOwnPropertyNames(t))}return Object.fromEntries(n.map(o=>{const i=t[o];return[o,typeof i=="function"?Y(i.bind(t),r):i]}))}function D(t){if(!u.isRef(t))return u.reactive(t);const e=new Proxy({},{get(n,r,o){return u.unref(Reflect.get(t.value,r,o))},set(n,r,o){return u.isRef(t.value[r])&&!u.isRef(o)?t.value[r].value=o:t.value[r]=o,!0},deleteProperty(n,r){return Reflect.deleteProperty(t.value,r)},has(n,r){return Reflect.has(t.value,r)},ownKeys(){return Object.keys(t.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return u.reactive(e)}function G(t){return D(u.computed(t))}function At(t,...e){const n=e.flat(),r=n[0];return G(()=>Object.fromEntries(typeof r=="function"?Object.entries(u.toRefs(t)).filter(([o,i])=>!r(s(i),o)):Object.entries(u.toRefs(t)).filter(o=>!n.includes(o[0]))))}const j=typeof window<"u"&&typeof document<"u",Ot=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,St=t=>typeof t<"u",Tt=t=>t!=null,Pt=(t,...e)=>{t||console.warn(...e)},Ft=Object.prototype.toString,tt=t=>Ft.call(t)==="[object Object]",Mt=()=>Date.now(),et=()=>+Date.now(),It=(t,e,n)=>Math.min(n,Math.max(e,t)),C=()=>{},Ct=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),Rt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Et=kt();function kt(){var t,e;return j&&((t=window?.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window?.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function N(t,e){function n(...r){return new Promise((o,i)=>{Promise.resolve(t(()=>e.apply(this,r),{fn:e,thisArg:this,args:r})).then(o).catch(i)})}return n}const B=t=>t();function z(t,e={}){let n,r,o=C;const i=a=>{clearTimeout(a),o(),o=C};return a=>{const f=s(t),g=s(e.maxWait);return n&&i(n),f<=0||g!==void 0&&g<=0?(r&&(i(r),r=null),Promise.resolve(a())):new Promise((y,h)=>{o=e.rejectOnCancel?h:y,g&&!r&&(r=setTimeout(()=>{n&&i(n),r=null,y(a())},g)),n=setTimeout(()=>{r&&i(r),r=null,y(a())},f)})}}function q(...t){let e=0,n,r=!0,o=C,i,l,a,f,g;!u.isRef(t[0])&&typeof t[0]=="object"?{delay:l,trailing:a=!0,leading:f=!0,rejectOnCancel:g=!1}=t[0]:[l,a=!0,f=!0,g=!1]=t;const y=()=>{n&&(clearTimeout(n),n=void 0,o(),o=C)};return d=>{const w=s(l),m=Date.now()-e,b=()=>i=d();return y(),w<=0?(e=Date.now(),b()):(m>w&&(f||!r)?(e=Date.now(),b()):a&&(i=new Promise((p,O)=>{o=g?O:p,n=setTimeout(()=>{e=Date.now(),r=!0,p(b()),y()},Math.max(0,w-m))})),!f&&!n&&(n=setTimeout(()=>r=!0,w)),r=!1,i)}}function nt(t=B){const e=u.ref(!0);function n(){e.value=!1}function r(){e.value=!0}const o=(...i)=>{e.value&&t(...i)};return{isActive:u.readonly(e),pause:n,resume:r,eventFilter:o}}const _t={mounted:u.isVue3?"mounted":"inserted",updated:u.isVue3?"updated":"componentUpdated",unmounted:u.isVue3?"unmounted":"unbind"};function rt(t){const e=Object.create(null);return n=>e[n]||(e[n]=t(n))}const jt=/\B([A-Z])/g,Nt=rt(t=>t.replace(jt,"-$1").toLowerCase()),Lt=/-(\w)/g,Wt=rt(t=>t.replace(Lt,(e,n)=>n?n.toUpperCase():""));function Z(t,e=!1,n="Timeout"){return new Promise((r,o)=>{setTimeout(e?()=>o(n):r,t)})}function Ut(t){return t}function Bt(t){let e;function n(){return e||(e=t()),e}return n.reset=async()=>{const r=e;e=void 0,r&&await r},n}function $t(t){return t()}function ot(t,...e){return e.some(n=>n in t)}function Ht(t,e){var n;if(typeof t=="number")return t+e;const r=((n=t.match(/^-?\d+\.?\d*/))==null?void 0:n[0])||"",o=t.slice(r.length),i=Number.parseFloat(r)+e;return Number.isNaN(i)?t:i+o}function Yt(t,e,n=!1){return e.reduce((r,o)=>(o in t&&(!n||t[o]!==void 0)&&(r[o]=t[o]),r),{})}function Gt(t,e,n=!1){return Object.fromEntries(Object.entries(t).filter(([r,o])=>(!n||o!==void 0)&&!e.includes(r)))}function zt(t){return Object.entries(t)}function L(t){return t||u.getCurrentInstance()}function J(...t){if(t.length!==1)return u.toRef(...t);const e=t[0];return typeof e=="function"?u.readonly(u.customRef(()=>({get:e,set:C}))):u.ref(e)}const qt=J;function Zt(t,...e){const n=e.flat(),r=n[0];return G(()=>Object.fromEntries(typeof r=="function"?Object.entries(u.toRefs(t)).filter(([o,i])=>r(s(i),o)):n.map(o=>[o,J(t,o)])))}function ct(t,e=1e4){return u.customRef((n,r)=>{let o=s(t),i;const l=()=>setTimeout(()=>{o=s(t),r()},s(e));return M(()=>{clearTimeout(i)}),{get(){return n(),o},set(a){o=a,r(),clearTimeout(i),i=l()}}})}function ut(t,e=200,n={}){return N(z(e,n),t)}function X(t,e=200,n={}){const r=u.ref(t.value),o=ut(()=>{r.value=t.value},e,n);return u.watch(t,()=>o()),r}function Jt(t,e){return u.computed({get(){var n;return(n=t.value)!=null?n:e},set(n){t.value=n}})}function it(t,e=200,n=!1,r=!0,o=!1){return N(q(e,n,r,o),t)}function K(t,e=200,n=!0,r=!0){if(e<=0)return t;const o=u.ref(t.value),i=it(()=>{o.value=t.value},e,n,r);return u.watch(t,()=>i()),o}function at(t,e={}){let n=t,r,o;const i=u.customRef((d,w)=>(r=d,o=w,{get(){return l()},set(m){a(m)}}));function l(d=!0){return d&&r(),n}function a(d,w=!0){var m,b;if(d===n)return;const p=n;((m=e.onBeforeChange)==null?void 0:m.call(e,d,p))!==!1&&(n=d,(b=e.onChanged)==null||b.call(e,d,p),w&&o())}return F(i,{get:l,set:a,untrackedGet:()=>l(!1),silentSet:d=>a(d,!1),peek:()=>l(!1),lay:d=>a(d,!1)},{enumerable:!0})}const Xt=at;function Kt(...t){if(t.length===2){const[e,n]=t;e.value=n}if(t.length===3)if(u.isVue2)u.set(...t);else{const[e,n,r]=t;e[n]=r}}function W(t,e,n={}){const{eventFilter:r=B,...o}=n;return u.watch(t,N(r,e),o)}function $(t,e,n={}){const{eventFilter:r,...o}=n,{eventFilter:i,pause:l,resume:a,isActive:f}=nt(r);return{stop:W(t,e,{...o,eventFilter:i}),pause:l,resume:a,isActive:f}}function Qt(t,e,...[n]){const{flush:r="sync",deep:o=!1,immediate:i=!0,direction:l="both",transform:a={}}=n||{},f=[],g="ltr"in a&&a.ltr||(d=>d),y="rtl"in a&&a.rtl||(d=>d);return(l==="both"||l==="ltr")&&f.push($(t,d=>{f.forEach(w=>w.pause()),e.value=g(d),f.forEach(w=>w.resume())},{flush:r,deep:o,immediate:i})),(l==="both"||l==="rtl")&&f.push($(e,d=>{f.forEach(w=>w.pause()),t.value=y(d),f.forEach(w=>w.resume())},{flush:r,deep:o,immediate:i})),()=>{f.forEach(d=>d.stop())}}function Vt(t,e,n={}){const{flush:r="sync",deep:o=!1,immediate:i=!0}=n;return Array.isArray(e)||(e=[e]),u.watch(t,l=>e.forEach(a=>a.value=l),{flush:r,deep:o,immediate:i})}function xt(t,e={}){if(!u.isRef(t))return u.toRefs(t);const n=Array.isArray(t.value)?Array.from({length:t.value.length}):{};for(const r in t.value)n[r]=u.customRef(()=>({get(){return t.value[r]},set(o){var i;if((i=s(e.replaceRef))!=null?i:!0)if(Array.isArray(t.value)){const a=[...t.value];a[r]=o,t.value=a}else{const a={...t.value,[r]:o};Object.setPrototypeOf(a,Object.getPrototypeOf(t.value)),t.value=a}else t.value[r]=o}}));return n}function Dt(t,e=!0,n){L(n)?u.onBeforeMount(t,n):e?t():u.nextTick(t)}function te(t,e){L(e)&&u.onBeforeUnmount(t,e)}function ee(t,e=!0,n){L()?u.onMounted(t,n):e?t():u.nextTick(t)}function ne(t,e){L(e)&&u.onUnmounted(t,e)}function Q(t,e=!1){function n(h,{flush:d="sync",deep:w=!1,timeout:m,throwOnTimeout:b}={}){let p=null;const x=[new Promise(H=>{p=u.watch(t,k=>{h(k)!==e&&(p?p():u.nextTick(()=>p?.()),H(k))},{flush:d,deep:w,immediate:!0})})];return m!=null&&x.push(Z(m,b).then(()=>s(t)).finally(()=>p?.())),Promise.race(x)}function r(h,d){if(!u.isRef(h))return n(k=>k===h,d);const{flush:w="sync",deep:m=!1,timeout:b,throwOnTimeout:p}=d??{};let O=null;const H=[new Promise(k=>{O=u.watch([t,h],([gt,He])=>{e!==(gt===He)&&(O?O():u.nextTick(()=>O?.()),k(gt))},{flush:w,deep:m,immediate:!0})})];return b!=null&&H.push(Z(b,p).then(()=>s(t)).finally(()=>(O?.(),s(t)))),Promise.race(H)}function o(h){return n(d=>!!d,h)}function i(h){return r(null,h)}function l(h){return r(void 0,h)}function a(h){return n(Number.isNaN,h)}function f(h,d){return n(w=>{const m=Array.from(w);return m.includes(h)||m.includes(s(h))},d)}function g(h){return y(1,h)}function y(h=1,d){let w=-1;return n(()=>(w+=1,w>=h),d)}return Array.isArray(s(t))?{toMatch:n,toContains:f,changed:g,changedTimes:y,get not(){return Q(t,!e)}}:{toMatch:n,toBe:r,toBeTruthy:o,toBeNull:i,toBeNaN:a,toBeUndefined:l,changed:g,changedTimes:y,get not(){return Q(t,!e)}}}function re(t){return Q(t)}function oe(t,e){return t===e}function ce(...t){var e;const n=t[0],r=t[1];let o=(e=t[2])!=null?e:oe;if(typeof o=="string"){const i=o;o=(l,a)=>l[i]===a[i]}return u.computed(()=>s(n).filter(i=>s(r).findIndex(l=>o(i,l))===-1))}function ue(t,e){return u.computed(()=>s(t).every((n,r,o)=>e(s(n),r,o)))}function ie(t,e){return u.computed(()=>s(t).map(n=>s(n)).filter(e))}function ae(t,e){return u.computed(()=>s(s(t).find((n,r,o)=>e(s(n),r,o))))}function le(t,e){return u.computed(()=>s(t).findIndex((n,r,o)=>e(s(n),r,o)))}function se(t,e){let n=t.length;for(;n-- >0;)if(e(t[n],n,t))return t[n]}function fe(t,e){return u.computed(()=>s(Array.prototype.findLast?s(t).findLast((n,r,o)=>e(s(n),r,o)):se(s(t),(n,r,o)=>e(s(n),r,o))))}function de(t){return tt(t)&&ot(t,"formIndex","comparator")}function he(...t){var e;const n=t[0],r=t[1];let o=t[2],i=0;if(de(o)&&(i=(e=o.fromIndex)!=null?e:0,o=o.comparator),typeof o=="string"){const l=o;o=(a,f)=>a[l]===s(f)}return o=o??((l,a)=>l===s(a)),u.computed(()=>s(n).slice(i).some((l,a,f)=>o(s(l),s(r),a,s(f))))}function ye(t,e){return u.computed(()=>s(t).map(n=>s(n)).join(s(e)))}function ge(t,e){return u.computed(()=>s(t).map(n=>s(n)).map(e))}function we(t,e,...n){const r=(o,i,l)=>e(s(o),s(i),l);return u.computed(()=>{const o=s(t);return n.length?o.reduce(r,s(n[0])):o.reduce(r)})}function me(t,e){return u.computed(()=>s(t).some((n,r,o)=>e(s(n),r,o)))}function pe(t){return Array.from(new Set(t))}function ve(t,e){return t.reduce((n,r)=>(n.some(o=>e(r,o,t))||n.push(r),n),[])}function be(t,e){return u.computed(()=>{const n=s(t).map(r=>s(r));return e?ve(n,e):pe(n)})}function Ae(t=0,e={}){let n=u.unref(t);const r=u.ref(t),{max:o=Number.POSITIVE_INFINITY,min:i=Number.NEGATIVE_INFINITY}=e,l=(h=1)=>r.value=Math.max(Math.min(o,r.value+h),i),a=(h=1)=>r.value=Math.min(Math.max(i,r.value-h),o),f=()=>r.value,g=h=>r.value=Math.max(i,Math.min(o,h));return{count:r,inc:l,dec:a,get:f,set:g,reset:(h=n)=>(n=h,g(h))}}const Oe=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[T\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/i,Se=/[YMDHhms]o|\[([^\]]+)\]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;function Te(t,e,n,r){let o=t<12?"AM":"PM";return r&&(o=o.split("").reduce((i,l)=>i+=`${l}.`,"")),n?o.toLowerCase():o}function R(t){const e=["th","st","nd","rd"],n=t%100;return t+(e[(n-20)%10]||e[n]||e[0])}function lt(t,e,n={}){var r;const o=t.getFullYear(),i=t.getMonth(),l=t.getDate(),a=t.getHours(),f=t.getMinutes(),g=t.getSeconds(),y=t.getMilliseconds(),h=t.getDay(),d=(r=n.customMeridiem)!=null?r:Te,w={Yo:()=>R(o),YY:()=>String(o).slice(-2),YYYY:()=>o,M:()=>i+1,Mo:()=>R(i+1),MM:()=>`${i+1}`.padStart(2,"0"),MMM:()=>t.toLocaleDateString(s(n.locales),{month:"short"}),MMMM:()=>t.toLocaleDateString(s(n.locales),{month:"long"}),D:()=>String(l),Do:()=>R(l),DD:()=>`${l}`.padStart(2,"0"),H:()=>String(a),Ho:()=>R(a),HH:()=>`${a}`.padStart(2,"0"),h:()=>`${a%12||12}`.padStart(1,"0"),ho:()=>R(a%12||12),hh:()=>`${a%12||12}`.padStart(2,"0"),m:()=>String(f),mo:()=>R(f),mm:()=>`${f}`.padStart(2,"0"),s:()=>String(g),so:()=>R(g),ss:()=>`${g}`.padStart(2,"0"),SSS:()=>`${y}`.padStart(3,"0"),d:()=>h,dd:()=>t.toLocaleDateString(s(n.locales),{weekday:"narrow"}),ddd:()=>t.toLocaleDateString(s(n.locales),{weekday:"short"}),dddd:()=>t.toLocaleDateString(s(n.locales),{weekday:"long"}),A:()=>d(a,f),AA:()=>d(a,f,!1,!0),a:()=>d(a,f,!0),aa:()=>d(a,f,!0,!0)};return e.replace(Se,(m,b)=>{var p,O;return(O=b??((p=w[m])==null?void 0:p.call(w)))!=null?O:m})}function st(t){if(t===null)return new Date(Number.NaN);if(t===void 0)return new Date;if(t instanceof Date)return new Date(t);if(typeof t=="string"&&!/Z$/i.test(t)){const e=t.match(Oe);if(e){const n=e[2]-1||0,r=(e[7]||"0").substring(0,3);return new Date(e[1],n,e[3]||1,e[4]||0,e[5]||0,e[6]||0,r)}}return new Date(t)}function Pe(t,e="HH:mm:ss",n={}){return u.computed(()=>lt(st(s(t)),s(e),n))}function ft(t,e=1e3,n={}){const{immediate:r=!0,immediateCallback:o=!1}=n;let i=null;const l=u.ref(!1);function a(){i&&(clearInterval(i),i=null)}function f(){l.value=!1,a()}function g(){const y=s(e);y<=0||(l.value=!0,o&&t(),a(),i=setInterval(t,y))}if(r&&j&&g(),u.isRef(e)||typeof e=="function"){const y=u.watch(e,()=>{l.value&&j&&g()});M(y)}return M(f),{isActive:l,pause:f,resume:g}}function Fe(t=1e3,e={}){const{controls:n=!1,immediate:r=!0,callback:o}=e,i=u.ref(0),l=()=>i.value+=1,a=()=>{i.value=0},f=ft(o?()=>{l(),o(i.value)}:l,t,{immediate:r});return n?{counter:i,reset:a,...f}:i}function Me(t,e={}){var n;const r=u.ref((n=e.initialValue)!=null?n:null);return u.watch(t,()=>r.value=et(),e),r}function dt(t,e,n={}){const{immediate:r=!0}=n,o=u.ref(!1);let i=null;function l(){i&&(clearTimeout(i),i=null)}function a(){o.value=!1,l()}function f(...g){l(),o.value=!0,i=setTimeout(()=>{o.value=!1,i=null,t(...g)},s(e))}return r&&(o.value=!0,j&&f()),M(a),{isPending:u.readonly(o),start:f,stop:a}}function Ie(t=1e3,e={}){const{controls:n=!1,callback:r}=e,o=dt(r??C,t,e),i=u.computed(()=>!o.isPending.value);return n?{ready:i,...o}:i}function Ce(t,e={}){const{method:n="parseFloat",radix:r,nanToZero:o}=e;return u.computed(()=>{let i=s(t);return typeof i=="string"&&(i=Number[n](i,r)),o&&Number.isNaN(i)&&(i=0),i})}function Re(t){return u.computed(()=>`${s(t)}`)}function Ee(t=!1,e={}){const{truthyValue:n=!0,falsyValue:r=!1}=e,o=u.isRef(t),i=u.ref(t);function l(a){if(arguments.length)return i.value=a,i.value;{const f=s(n);return i.value=i.value===f?s(r):f,i.value}}return o?l:[i,l]}function ke(t,e,n){let r=n?.immediate?[]:[...t instanceof Function?t():Array.isArray(t)?t:s(t)];return u.watch(t,(o,i,l)=>{const a=Array.from({length:r.length}),f=[];for(const y of o){let h=!1;for(let d=0;d<r.length;d++)if(!a[d]&&y===r[d]){a[d]=!0,h=!0;break}h||f.push(y)}const g=r.filter((y,h)=>!a[h]);e(o,r,f,g,l),r=[...o]},n)}function _e(t,e,n){const{count:r,...o}=n,i=u.ref(0),l=W(t,(...a)=>{i.value+=1,i.value>=s(r)&&u.nextTick(()=>l()),e(...a)},o);return{count:i,stop:l}}function ht(t,e,n={}){const{debounce:r=0,maxWait:o=void 0,...i}=n;return W(t,e,{...i,eventFilter:z(r,{maxWait:o})})}function je(t,e,n){return u.watch(t,e,{...n,deep:!0})}function V(t,e,n={}){const{eventFilter:r=B,...o}=n,i=N(r,e);let l,a,f;if(o.flush==="sync"){const g=u.ref(!1);a=()=>{},l=y=>{g.value=!0,y(),g.value=!1},f=u.watch(t,(...y)=>{g.value||i(...y)},o)}else{const g=[],y=u.ref(0),h=u.ref(0);a=()=>{y.value=h.value},g.push(u.watch(t,()=>{h.value++},{...o,flush:"sync"})),l=d=>{const w=h.value;d(),y.value+=h.value-w},g.push(u.watch(t,(...d)=>{const w=y.value>0&&y.value===h.value;y.value=0,h.value=0,!w&&i(...d)},o)),f=()=>{g.forEach(d=>d())}}return{stop:f,ignoreUpdates:l,ignorePrevAsyncUpdates:a}}function Ne(t,e,n){return u.watch(t,e,{...n,immediate:!0})}function Le(t,e,n){const r=u.watch(t,(...o)=>(u.nextTick(()=>r()),e(...o)),n);return r}function yt(t,e,n={}){const{throttle:r=0,trailing:o=!0,leading:i=!0,...l}=n;return W(t,e,{...l,eventFilter:q(r,o,i)})}function We(t,e,n={}){let r;function o(){if(!r)return;const y=r;r=void 0,y()}function i(y){r=y}const l=(y,h)=>(o(),e(y,h,i)),a=V(t,l,n),{ignoreUpdates:f}=a;return{...a,trigger:()=>{let y;return f(()=>{y=l(Ue(t),Be(t))}),y}}}function Ue(t){return u.isReactive(t)?t:Array.isArray(t)?t.map(e=>s(e)):s(t)}function Be(t){return Array.isArray(t)?t.map(()=>{}):void 0}function $e(t,e,n){const r=u.watch(t,(o,i,l)=>{o&&(n?.once&&u.nextTick(()=>r()),e(o,i,l))},{...n,once:!1});return r}c.assert=Pt,c.autoResetRef=ct,c.bypassFilter=B,c.camelize=Wt,c.clamp=It,c.computedEager=E,c.computedWithControl=S,c.containsProp=ot,c.controlledComputed=S,c.controlledRef=Xt,c.createEventHook=v,c.createFilterWrapper=N,c.createGlobalState=T,c.createInjectionState=U,c.createReactiveFn=Y,c.createSharedComposable=I,c.createSingletonPromise=Bt,c.debounceFilter=z,c.debouncedRef=X,c.debouncedWatch=ht,c.directiveHooks=_t,c.eagerComputed=E,c.extendRef=F,c.formatDate=lt,c.get=wt,c.getLifeCycleTarget=L,c.hasOwn=Rt,c.hyphenate=Nt,c.identity=Ut,c.ignorableWatch=V,c.increaseWithUnit=Ht,c.injectLocal=_,c.invoke=$t,c.isClient=j,c.isDef=St,c.isDefined=mt,c.isIOS=Et,c.isObject=tt,c.isWorker=Ot,c.makeDestructurable=pt,c.noop=C,c.normalizeDate=st,c.notNullish=Tt,c.now=Mt,c.objectEntries=zt,c.objectOmit=Gt,c.objectPick=Yt,c.pausableFilter=nt,c.pausableWatch=$,c.promiseTimeout=Z,c.provideLocal=P,c.rand=Ct,c.reactify=Y,c.reactifyObject=bt,c.reactiveComputed=G,c.reactiveOmit=At,c.reactivePick=Zt,c.refAutoReset=ct,c.refDebounced=X,c.refDefault=Jt,c.refThrottled=K,c.refWithControl=at,c.resolveRef=qt,c.resolveUnref=vt,c.set=Kt,c.syncRef=Qt,c.syncRefs=Vt,c.throttleFilter=q,c.throttledRef=K,c.throttledWatch=yt,c.timestamp=et,c.toReactive=D,c.toRef=J,c.toRefs=xt,c.toValue=s,c.tryOnBeforeMount=Dt,c.tryOnBeforeUnmount=te,c.tryOnMounted=ee,c.tryOnScopeDispose=M,c.tryOnUnmounted=ne,c.until=re,c.useArrayDifference=ce,c.useArrayEvery=ue,c.useArrayFilter=ie,c.useArrayFind=ae,c.useArrayFindIndex=le,c.useArrayFindLast=fe,c.useArrayIncludes=he,c.useArrayJoin=ye,c.useArrayMap=ge,c.useArrayReduce=we,c.useArraySome=me,c.useArrayUnique=be,c.useCounter=Ae,c.useDateFormat=Pe,c.useDebounce=X,c.useDebounceFn=ut,c.useInterval=Fe,c.useIntervalFn=ft,c.useLastChanged=Me,c.useThrottle=K,c.useThrottleFn=it,c.useTimeout=Ie,c.useTimeoutFn=dt,c.useToNumber=Ce,c.useToString=Re,c.useToggle=Ee,c.watchArray=ke,c.watchAtMost=_e,c.watchDebounced=ht,c.watchDeep=je,c.watchIgnorable=V,c.watchImmediate=Ne,c.watchOnce=Le,c.watchPausable=$,c.watchThrottled=yt,c.watchTriggerable=We,c.watchWithFilter=W,c.whenever=$e})(this.VueUse=this.VueUse||{},VueDemi);
1
+ var _VueDemiGlobal=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this,VueDemi=function(c,u,E){if(c.install)return c;if(!u)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),c;if(u.version.slice(0,4)==="2.7."){let v=function(T,A){var P,_={},U={config:u.config,use:u.use.bind(u),mixin:u.mixin.bind(u),component:u.component.bind(u),provide:function(I,F){return _[I]=F,this},directive:function(I,F){return F?(u.directive(I,F),U):u.directive(I)},mount:function(I,F){return P||(P=new u(Object.assign({propsData:A},T,{provide:Object.assign(_,T.provide)})),P.$mount(I,F),P)},unmount:function(){P&&(P.$destroy(),P=void 0)}};return U};var M=v;for(var S in u)c[S]=u[S];c.isVue2=!0,c.isVue3=!1,c.install=function(){},c.Vue=u,c.Vue2=u,c.version=u.version,c.warn=u.util.warn,c.hasInjectionContext=function(){return!!c.getCurrentInstance()},c.createApp=v}else if(u.version.slice(0,2)==="2.")if(E){for(var S in E)c[S]=E[S];c.isVue2=!0,c.isVue3=!1,c.install=function(){},c.Vue=u,c.Vue2=u,c.version=u.version,c.hasInjectionContext=function(){return!!c.getCurrentInstance()}}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(u.version.slice(0,2)==="3."){for(var S in u)c[S]=u[S];c.isVue2=!1,c.isVue3=!0,c.install=function(){},c.Vue=u,c.Vue2=void 0,c.version=u.version,c.set=function(v,T,A){return Array.isArray(v)?(v.length=Math.max(v.length,T),v.splice(T,1,A),A):(v[T]=A,A)},c.del=function(v,T){if(Array.isArray(v)){v.splice(T,1);return}delete v[T]}}else console.error("[vue-demi] Vue version "+u.version+" is unsupported.");return c}(_VueDemiGlobal.VueDemi=_VueDemiGlobal.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),_VueDemiGlobal.Vue||(typeof Vue<"u"?Vue:void 0),_VueDemiGlobal.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(c,u){"use strict";function E(t,e){var n;const r=u.shallowRef();return u.watchEffect(()=>{r.value=t()},{...e,flush:(n=e?.flush)!=null?n:"sync"}),u.readonly(r)}function S(t,e){let n,r,o;const i=u.ref(!0),l=()=>{i.value=!0,o()};u.watch(t,l,{flush:"sync"});const a=typeof e=="function"?e:e.get,f=typeof e=="function"?void 0:e.set,g=u.customRef((y,h)=>(r=y,o=h,{get(){return i.value&&(n=a(n),i.value=!1),r(),n},set(d){f?.(d)}}));return Object.isExtensible(g)&&(g.trigger=l),g}function M(t){return u.getCurrentScope()?(u.onScopeDispose(t),!0):!1}function v(){const t=new Set,e=o=>{t.delete(o)};return{on:o=>{t.add(o);const i=()=>e(o);return M(i),{off:i}},off:e,trigger:(...o)=>Promise.all(Array.from(t).map(i=>i(...o)))}}function T(t){let e=!1,n;const r=u.effectScope(!0);return(...o)=>(e||(n=r.run(()=>t(...o)),e=!0),n)}const A=new WeakMap,P=(...t)=>{var e;const n=t[0],r=(e=u.getCurrentInstance())==null?void 0:e.proxy;if(r==null)throw new Error("injectLocal must be called in setup");return A.has(r)&&n in A.get(r)?A.get(r)[n]:u.inject(...t)},_=(t,e)=>{var n;const r=(n=u.getCurrentInstance())==null?void 0:n.proxy;if(r==null)throw new Error("provideLocal must be called in setup");A.has(r)||A.set(r,Object.create(null));const o=A.get(r);o[t]=e,u.provide(t,e)};function U(t,e){const n=e?.injectionKey||Symbol(t.name||"InjectionState"),r=e?.defaultValue;return[(...l)=>{const a=t(...l);return _(n,a),a},()=>P(n,r)]}function I(t){let e=0,n,r;const o=()=>{e-=1,r&&e<=0&&(r.stop(),n=void 0,r=void 0)};return(...i)=>(e+=1,r||(r=u.effectScope(!0),n=r.run(()=>t(...i))),M(o),n)}function F(t,e,{enumerable:n=!1,unwrap:r=!0}={}){if(!u.isVue3&&!u.version.startsWith("2.7.")){if(process.env.NODE_ENV!=="production")throw new Error("[VueUse] extendRef only works in Vue 2.7 or above.");return}for(const[o,i]of Object.entries(e))o!=="value"&&(u.isRef(i)&&r?Object.defineProperty(t,o,{get(){return i.value},set(l){i.value=l},enumerable:n}):Object.defineProperty(t,o,{value:i,enumerable:n}));return t}function wt(t,e){return e==null?u.unref(t):u.unref(t)[e]}function mt(t){return u.unref(t)!=null}function pt(t,e){if(typeof Symbol<"u"){const n={...t};return Object.defineProperty(n,Symbol.iterator,{enumerable:!1,value(){let r=0;return{next:()=>({value:e[r++],done:r>e.length})}}}),n}else return Object.assign([...e],t)}function s(t){return typeof t=="function"?t():u.unref(t)}const vt=s;function Y(t,e){const n=e?.computedGetter===!1?u.unref:s;return function(...r){return u.computed(()=>t.apply(this,r.map(o=>n(o))))}}function bt(t,e={}){let n=[],r;if(Array.isArray(e))n=e;else{r=e;const{includeOwnProperties:o=!0}=e;n.push(...Object.keys(t)),o&&n.push(...Object.getOwnPropertyNames(t))}return Object.fromEntries(n.map(o=>{const i=t[o];return[o,typeof i=="function"?Y(i.bind(t),r):i]}))}function D(t){if(!u.isRef(t))return u.reactive(t);const e=new Proxy({},{get(n,r,o){return u.unref(Reflect.get(t.value,r,o))},set(n,r,o){return u.isRef(t.value[r])&&!u.isRef(o)?t.value[r].value=o:t.value[r]=o,!0},deleteProperty(n,r){return Reflect.deleteProperty(t.value,r)},has(n,r){return Reflect.has(t.value,r)},ownKeys(){return Object.keys(t.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return u.reactive(e)}function G(t){return D(u.computed(t))}function At(t,...e){const n=e.flat(),r=n[0];return G(()=>Object.fromEntries(typeof r=="function"?Object.entries(u.toRefs(t)).filter(([o,i])=>!r(s(i),o)):Object.entries(u.toRefs(t)).filter(o=>!n.includes(o[0]))))}const Ot={mounted:u.isVue3?"mounted":"inserted",updated:u.isVue3?"updated":"componentUpdated",unmounted:u.isVue3?"unmounted":"unbind"},j=typeof window<"u"&&typeof document<"u",St=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,Tt=t=>typeof t<"u",Pt=t=>t!=null,Ft=(t,...e)=>{t||console.warn(...e)},Mt=Object.prototype.toString,tt=t=>Mt.call(t)==="[object Object]",It=()=>Date.now(),et=()=>+Date.now(),Ct=(t,e,n)=>Math.min(n,Math.max(e,t)),C=()=>{},Rt=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),Et=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),kt=_t();function _t(){var t,e;return j&&((t=window?.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window?.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function N(t,e){function n(...r){return new Promise((o,i)=>{Promise.resolve(t(()=>e.apply(this,r),{fn:e,thisArg:this,args:r})).then(o).catch(i)})}return n}const B=t=>t();function z(t,e={}){let n,r,o=C;const i=a=>{clearTimeout(a),o(),o=C};return a=>{const f=s(t),g=s(e.maxWait);return n&&i(n),f<=0||g!==void 0&&g<=0?(r&&(i(r),r=null),Promise.resolve(a())):new Promise((y,h)=>{o=e.rejectOnCancel?h:y,g&&!r&&(r=setTimeout(()=>{n&&i(n),r=null,y(a())},g)),n=setTimeout(()=>{r&&i(r),r=null,y(a())},f)})}}function q(...t){let e=0,n,r=!0,o=C,i,l,a,f,g;!u.isRef(t[0])&&typeof t[0]=="object"?{delay:l,trailing:a=!0,leading:f=!0,rejectOnCancel:g=!1}=t[0]:[l,a=!0,f=!0,g=!1]=t;const y=()=>{n&&(clearTimeout(n),n=void 0,o(),o=C)};return d=>{const w=s(l),m=Date.now()-e,b=()=>i=d();return y(),w<=0?(e=Date.now(),b()):(m>w&&(f||!r)?(e=Date.now(),b()):a&&(i=new Promise((p,O)=>{o=g?O:p,n=setTimeout(()=>{e=Date.now(),r=!0,p(b()),y()},Math.max(0,w-m))})),!f&&!n&&(n=setTimeout(()=>r=!0,w)),r=!1,i)}}function nt(t=B){const e=u.ref(!0);function n(){e.value=!1}function r(){e.value=!0}const o=(...i)=>{e.value&&t(...i)};return{isActive:u.readonly(e),pause:n,resume:r,eventFilter:o}}function rt(t){const e=Object.create(null);return n=>e[n]||(e[n]=t(n))}const jt=/\B([A-Z])/g,Nt=rt(t=>t.replace(jt,"-$1").toLowerCase()),Lt=/-(\w)/g,Wt=rt(t=>t.replace(Lt,(e,n)=>n?n.toUpperCase():""));function Z(t,e=!1,n="Timeout"){return new Promise((r,o)=>{setTimeout(e?()=>o(n):r,t)})}function Ut(t){return t}function Bt(t){let e;function n(){return e||(e=t()),e}return n.reset=async()=>{const r=e;e=void 0,r&&await r},n}function $t(t){return t()}function ot(t,...e){return e.some(n=>n in t)}function Ht(t,e){var n;if(typeof t=="number")return t+e;const r=((n=t.match(/^-?\d+\.?\d*/))==null?void 0:n[0])||"",o=t.slice(r.length),i=Number.parseFloat(r)+e;return Number.isNaN(i)?t:i+o}function Yt(t,e,n=!1){return e.reduce((r,o)=>(o in t&&(!n||t[o]!==void 0)&&(r[o]=t[o]),r),{})}function Gt(t,e,n=!1){return Object.fromEntries(Object.entries(t).filter(([r,o])=>(!n||o!==void 0)&&!e.includes(r)))}function zt(t){return Object.entries(t)}function L(t){return t||u.getCurrentInstance()}function J(...t){if(t.length!==1)return u.toRef(...t);const e=t[0];return typeof e=="function"?u.readonly(u.customRef(()=>({get:e,set:C}))):u.ref(e)}const qt=J;function Zt(t,...e){const n=e.flat(),r=n[0];return G(()=>Object.fromEntries(typeof r=="function"?Object.entries(u.toRefs(t)).filter(([o,i])=>r(s(i),o)):n.map(o=>[o,J(t,o)])))}function ct(t,e=1e4){return u.customRef((n,r)=>{let o=s(t),i;const l=()=>setTimeout(()=>{o=s(t),r()},s(e));return M(()=>{clearTimeout(i)}),{get(){return n(),o},set(a){o=a,r(),clearTimeout(i),i=l()}}})}function ut(t,e=200,n={}){return N(z(e,n),t)}function X(t,e=200,n={}){const r=u.ref(t.value),o=ut(()=>{r.value=t.value},e,n);return u.watch(t,()=>o()),r}function Jt(t,e){return u.computed({get(){var n;return(n=t.value)!=null?n:e},set(n){t.value=n}})}function it(t,e=200,n=!1,r=!0,o=!1){return N(q(e,n,r,o),t)}function K(t,e=200,n=!0,r=!0){if(e<=0)return t;const o=u.ref(t.value),i=it(()=>{o.value=t.value},e,n,r);return u.watch(t,()=>i()),o}function at(t,e={}){let n=t,r,o;const i=u.customRef((d,w)=>(r=d,o=w,{get(){return l()},set(m){a(m)}}));function l(d=!0){return d&&r(),n}function a(d,w=!0){var m,b;if(d===n)return;const p=n;((m=e.onBeforeChange)==null?void 0:m.call(e,d,p))!==!1&&(n=d,(b=e.onChanged)==null||b.call(e,d,p),w&&o())}return F(i,{get:l,set:a,untrackedGet:()=>l(!1),silentSet:d=>a(d,!1),peek:()=>l(!1),lay:d=>a(d,!1)},{enumerable:!0})}const Xt=at;function Kt(...t){if(t.length===2){const[e,n]=t;e.value=n}if(t.length===3)if(u.isVue2)u.set(...t);else{const[e,n,r]=t;e[n]=r}}function W(t,e,n={}){const{eventFilter:r=B,...o}=n;return u.watch(t,N(r,e),o)}function $(t,e,n={}){const{eventFilter:r,...o}=n,{eventFilter:i,pause:l,resume:a,isActive:f}=nt(r);return{stop:W(t,e,{...o,eventFilter:i}),pause:l,resume:a,isActive:f}}function Qt(t,e,...[n]){const{flush:r="sync",deep:o=!1,immediate:i=!0,direction:l="both",transform:a={}}=n||{},f=[],g="ltr"in a&&a.ltr||(d=>d),y="rtl"in a&&a.rtl||(d=>d);return(l==="both"||l==="ltr")&&f.push($(t,d=>{f.forEach(w=>w.pause()),e.value=g(d),f.forEach(w=>w.resume())},{flush:r,deep:o,immediate:i})),(l==="both"||l==="rtl")&&f.push($(e,d=>{f.forEach(w=>w.pause()),t.value=y(d),f.forEach(w=>w.resume())},{flush:r,deep:o,immediate:i})),()=>{f.forEach(d=>d.stop())}}function Vt(t,e,n={}){const{flush:r="sync",deep:o=!1,immediate:i=!0}=n;return Array.isArray(e)||(e=[e]),u.watch(t,l=>e.forEach(a=>a.value=l),{flush:r,deep:o,immediate:i})}function xt(t,e={}){if(!u.isRef(t))return u.toRefs(t);const n=Array.isArray(t.value)?Array.from({length:t.value.length}):{};for(const r in t.value)n[r]=u.customRef(()=>({get(){return t.value[r]},set(o){var i;if((i=s(e.replaceRef))!=null?i:!0)if(Array.isArray(t.value)){const a=[...t.value];a[r]=o,t.value=a}else{const a={...t.value,[r]:o};Object.setPrototypeOf(a,Object.getPrototypeOf(t.value)),t.value=a}else t.value[r]=o}}));return n}function Dt(t,e=!0,n){L(n)?u.onBeforeMount(t,n):e?t():u.nextTick(t)}function te(t,e){L(e)&&u.onBeforeUnmount(t,e)}function ee(t,e=!0,n){L()?u.onMounted(t,n):e?t():u.nextTick(t)}function ne(t,e){L(e)&&u.onUnmounted(t,e)}function Q(t,e=!1){function n(h,{flush:d="sync",deep:w=!1,timeout:m,throwOnTimeout:b}={}){let p=null;const x=[new Promise(H=>{p=u.watch(t,k=>{h(k)!==e&&(p?p():u.nextTick(()=>p?.()),H(k))},{flush:d,deep:w,immediate:!0})})];return m!=null&&x.push(Z(m,b).then(()=>s(t)).finally(()=>p?.())),Promise.race(x)}function r(h,d){if(!u.isRef(h))return n(k=>k===h,d);const{flush:w="sync",deep:m=!1,timeout:b,throwOnTimeout:p}=d??{};let O=null;const H=[new Promise(k=>{O=u.watch([t,h],([gt,He])=>{e!==(gt===He)&&(O?O():u.nextTick(()=>O?.()),k(gt))},{flush:w,deep:m,immediate:!0})})];return b!=null&&H.push(Z(b,p).then(()=>s(t)).finally(()=>(O?.(),s(t)))),Promise.race(H)}function o(h){return n(d=>!!d,h)}function i(h){return r(null,h)}function l(h){return r(void 0,h)}function a(h){return n(Number.isNaN,h)}function f(h,d){return n(w=>{const m=Array.from(w);return m.includes(h)||m.includes(s(h))},d)}function g(h){return y(1,h)}function y(h=1,d){let w=-1;return n(()=>(w+=1,w>=h),d)}return Array.isArray(s(t))?{toMatch:n,toContains:f,changed:g,changedTimes:y,get not(){return Q(t,!e)}}:{toMatch:n,toBe:r,toBeTruthy:o,toBeNull:i,toBeNaN:a,toBeUndefined:l,changed:g,changedTimes:y,get not(){return Q(t,!e)}}}function re(t){return Q(t)}function oe(t,e){return t===e}function ce(...t){var e;const n=t[0],r=t[1];let o=(e=t[2])!=null?e:oe;if(typeof o=="string"){const i=o;o=(l,a)=>l[i]===a[i]}return u.computed(()=>s(n).filter(i=>s(r).findIndex(l=>o(i,l))===-1))}function ue(t,e){return u.computed(()=>s(t).every((n,r,o)=>e(s(n),r,o)))}function ie(t,e){return u.computed(()=>s(t).map(n=>s(n)).filter(e))}function ae(t,e){return u.computed(()=>s(s(t).find((n,r,o)=>e(s(n),r,o))))}function le(t,e){return u.computed(()=>s(t).findIndex((n,r,o)=>e(s(n),r,o)))}function se(t,e){let n=t.length;for(;n-- >0;)if(e(t[n],n,t))return t[n]}function fe(t,e){return u.computed(()=>s(Array.prototype.findLast?s(t).findLast((n,r,o)=>e(s(n),r,o)):se(s(t),(n,r,o)=>e(s(n),r,o))))}function de(t){return tt(t)&&ot(t,"formIndex","comparator")}function he(...t){var e;const n=t[0],r=t[1];let o=t[2],i=0;if(de(o)&&(i=(e=o.fromIndex)!=null?e:0,o=o.comparator),typeof o=="string"){const l=o;o=(a,f)=>a[l]===s(f)}return o=o??((l,a)=>l===s(a)),u.computed(()=>s(n).slice(i).some((l,a,f)=>o(s(l),s(r),a,s(f))))}function ye(t,e){return u.computed(()=>s(t).map(n=>s(n)).join(s(e)))}function ge(t,e){return u.computed(()=>s(t).map(n=>s(n)).map(e))}function we(t,e,...n){const r=(o,i,l)=>e(s(o),s(i),l);return u.computed(()=>{const o=s(t);return n.length?o.reduce(r,typeof n[0]=="function"?s(n[0]()):s(n[0])):o.reduce(r)})}function me(t,e){return u.computed(()=>s(t).some((n,r,o)=>e(s(n),r,o)))}function pe(t){return Array.from(new Set(t))}function ve(t,e){return t.reduce((n,r)=>(n.some(o=>e(r,o,t))||n.push(r),n),[])}function be(t,e){return u.computed(()=>{const n=s(t).map(r=>s(r));return e?ve(n,e):pe(n)})}function Ae(t=0,e={}){let n=u.unref(t);const r=u.ref(t),{max:o=Number.POSITIVE_INFINITY,min:i=Number.NEGATIVE_INFINITY}=e,l=(h=1)=>r.value=Math.max(Math.min(o,r.value+h),i),a=(h=1)=>r.value=Math.min(Math.max(i,r.value-h),o),f=()=>r.value,g=h=>r.value=Math.max(i,Math.min(o,h));return{count:r,inc:l,dec:a,get:f,set:g,reset:(h=n)=>(n=h,g(h))}}const Oe=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[T\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/i,Se=/[YMDHhms]o|\[([^\]]+)\]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;function Te(t,e,n,r){let o=t<12?"AM":"PM";return r&&(o=o.split("").reduce((i,l)=>i+=`${l}.`,"")),n?o.toLowerCase():o}function R(t){const e=["th","st","nd","rd"],n=t%100;return t+(e[(n-20)%10]||e[n]||e[0])}function lt(t,e,n={}){var r;const o=t.getFullYear(),i=t.getMonth(),l=t.getDate(),a=t.getHours(),f=t.getMinutes(),g=t.getSeconds(),y=t.getMilliseconds(),h=t.getDay(),d=(r=n.customMeridiem)!=null?r:Te,w={Yo:()=>R(o),YY:()=>String(o).slice(-2),YYYY:()=>o,M:()=>i+1,Mo:()=>R(i+1),MM:()=>`${i+1}`.padStart(2,"0"),MMM:()=>t.toLocaleDateString(s(n.locales),{month:"short"}),MMMM:()=>t.toLocaleDateString(s(n.locales),{month:"long"}),D:()=>String(l),Do:()=>R(l),DD:()=>`${l}`.padStart(2,"0"),H:()=>String(a),Ho:()=>R(a),HH:()=>`${a}`.padStart(2,"0"),h:()=>`${a%12||12}`.padStart(1,"0"),ho:()=>R(a%12||12),hh:()=>`${a%12||12}`.padStart(2,"0"),m:()=>String(f),mo:()=>R(f),mm:()=>`${f}`.padStart(2,"0"),s:()=>String(g),so:()=>R(g),ss:()=>`${g}`.padStart(2,"0"),SSS:()=>`${y}`.padStart(3,"0"),d:()=>h,dd:()=>t.toLocaleDateString(s(n.locales),{weekday:"narrow"}),ddd:()=>t.toLocaleDateString(s(n.locales),{weekday:"short"}),dddd:()=>t.toLocaleDateString(s(n.locales),{weekday:"long"}),A:()=>d(a,f),AA:()=>d(a,f,!1,!0),a:()=>d(a,f,!0),aa:()=>d(a,f,!0,!0)};return e.replace(Se,(m,b)=>{var p,O;return(O=b??((p=w[m])==null?void 0:p.call(w)))!=null?O:m})}function st(t){if(t===null)return new Date(Number.NaN);if(t===void 0)return new Date;if(t instanceof Date)return new Date(t);if(typeof t=="string"&&!/Z$/i.test(t)){const e=t.match(Oe);if(e){const n=e[2]-1||0,r=(e[7]||"0").substring(0,3);return new Date(e[1],n,e[3]||1,e[4]||0,e[5]||0,e[6]||0,r)}}return new Date(t)}function Pe(t,e="HH:mm:ss",n={}){return u.computed(()=>lt(st(s(t)),s(e),n))}function ft(t,e=1e3,n={}){const{immediate:r=!0,immediateCallback:o=!1}=n;let i=null;const l=u.ref(!1);function a(){i&&(clearInterval(i),i=null)}function f(){l.value=!1,a()}function g(){const y=s(e);y<=0||(l.value=!0,o&&t(),a(),l.value&&(i=setInterval(t,y)))}if(r&&j&&g(),u.isRef(e)||typeof e=="function"){const y=u.watch(e,()=>{l.value&&j&&g()});M(y)}return M(f),{isActive:l,pause:f,resume:g}}function Fe(t=1e3,e={}){const{controls:n=!1,immediate:r=!0,callback:o}=e,i=u.ref(0),l=()=>i.value+=1,a=()=>{i.value=0},f=ft(o?()=>{l(),o(i.value)}:l,t,{immediate:r});return n?{counter:i,reset:a,...f}:i}function Me(t,e={}){var n;const r=u.ref((n=e.initialValue)!=null?n:null);return u.watch(t,()=>r.value=et(),e),r}function dt(t,e,n={}){const{immediate:r=!0}=n,o=u.ref(!1);let i=null;function l(){i&&(clearTimeout(i),i=null)}function a(){o.value=!1,l()}function f(...g){l(),o.value=!0,i=setTimeout(()=>{o.value=!1,i=null,t(...g)},s(e))}return r&&(o.value=!0,j&&f()),M(a),{isPending:u.readonly(o),start:f,stop:a}}function Ie(t=1e3,e={}){const{controls:n=!1,callback:r}=e,o=dt(r??C,t,e),i=u.computed(()=>!o.isPending.value);return n?{ready:i,...o}:i}function Ce(t,e={}){const{method:n="parseFloat",radix:r,nanToZero:o}=e;return u.computed(()=>{let i=s(t);return typeof i=="string"&&(i=Number[n](i,r)),o&&Number.isNaN(i)&&(i=0),i})}function Re(t){return u.computed(()=>`${s(t)}`)}function Ee(t=!1,e={}){const{truthyValue:n=!0,falsyValue:r=!1}=e,o=u.isRef(t),i=u.ref(t);function l(a){if(arguments.length)return i.value=a,i.value;{const f=s(n);return i.value=i.value===f?s(r):f,i.value}}return o?l:[i,l]}function ke(t,e,n){let r=n?.immediate?[]:[...t instanceof Function?t():Array.isArray(t)?t:s(t)];return u.watch(t,(o,i,l)=>{const a=Array.from({length:r.length}),f=[];for(const y of o){let h=!1;for(let d=0;d<r.length;d++)if(!a[d]&&y===r[d]){a[d]=!0,h=!0;break}h||f.push(y)}const g=r.filter((y,h)=>!a[h]);e(o,r,f,g,l),r=[...o]},n)}function _e(t,e,n){const{count:r,...o}=n,i=u.ref(0),l=W(t,(...a)=>{i.value+=1,i.value>=s(r)&&u.nextTick(()=>l()),e(...a)},o);return{count:i,stop:l}}function ht(t,e,n={}){const{debounce:r=0,maxWait:o=void 0,...i}=n;return W(t,e,{...i,eventFilter:z(r,{maxWait:o})})}function je(t,e,n){return u.watch(t,e,{...n,deep:!0})}function V(t,e,n={}){const{eventFilter:r=B,...o}=n,i=N(r,e);let l,a,f;if(o.flush==="sync"){const g=u.ref(!1);a=()=>{},l=y=>{g.value=!0,y(),g.value=!1},f=u.watch(t,(...y)=>{g.value||i(...y)},o)}else{const g=[],y=u.ref(0),h=u.ref(0);a=()=>{y.value=h.value},g.push(u.watch(t,()=>{h.value++},{...o,flush:"sync"})),l=d=>{const w=h.value;d(),y.value+=h.value-w},g.push(u.watch(t,(...d)=>{const w=y.value>0&&y.value===h.value;y.value=0,h.value=0,!w&&i(...d)},o)),f=()=>{g.forEach(d=>d())}}return{stop:f,ignoreUpdates:l,ignorePrevAsyncUpdates:a}}function Ne(t,e,n){return u.watch(t,e,{...n,immediate:!0})}function Le(t,e,n){const r=u.watch(t,(...o)=>(u.nextTick(()=>r()),e(...o)),n);return r}function yt(t,e,n={}){const{throttle:r=0,trailing:o=!0,leading:i=!0,...l}=n;return W(t,e,{...l,eventFilter:q(r,o,i)})}function We(t,e,n={}){let r;function o(){if(!r)return;const y=r;r=void 0,y()}function i(y){r=y}const l=(y,h)=>(o(),e(y,h,i)),a=V(t,l,n),{ignoreUpdates:f}=a;return{...a,trigger:()=>{let y;return f(()=>{y=l(Ue(t),Be(t))}),y}}}function Ue(t){return u.isReactive(t)?t:Array.isArray(t)?t.map(e=>s(e)):s(t)}function Be(t){return Array.isArray(t)?t.map(()=>{}):void 0}function $e(t,e,n){const r=u.watch(t,(o,i,l)=>{o&&(n?.once&&u.nextTick(()=>r()),e(o,i,l))},{...n,once:!1});return r}c.assert=Ft,c.autoResetRef=ct,c.bypassFilter=B,c.camelize=Wt,c.clamp=Ct,c.computedEager=E,c.computedWithControl=S,c.containsProp=ot,c.controlledComputed=S,c.controlledRef=Xt,c.createEventHook=v,c.createFilterWrapper=N,c.createGlobalState=T,c.createInjectionState=U,c.createReactiveFn=Y,c.createSharedComposable=I,c.createSingletonPromise=Bt,c.debounceFilter=z,c.debouncedRef=X,c.debouncedWatch=ht,c.directiveHooks=Ot,c.eagerComputed=E,c.extendRef=F,c.formatDate=lt,c.get=wt,c.getLifeCycleTarget=L,c.hasOwn=Et,c.hyphenate=Nt,c.identity=Ut,c.ignorableWatch=V,c.increaseWithUnit=Ht,c.injectLocal=P,c.invoke=$t,c.isClient=j,c.isDef=Tt,c.isDefined=mt,c.isIOS=kt,c.isObject=tt,c.isWorker=St,c.makeDestructurable=pt,c.noop=C,c.normalizeDate=st,c.notNullish=Pt,c.now=It,c.objectEntries=zt,c.objectOmit=Gt,c.objectPick=Yt,c.pausableFilter=nt,c.pausableWatch=$,c.promiseTimeout=Z,c.provideLocal=_,c.rand=Rt,c.reactify=Y,c.reactifyObject=bt,c.reactiveComputed=G,c.reactiveOmit=At,c.reactivePick=Zt,c.refAutoReset=ct,c.refDebounced=X,c.refDefault=Jt,c.refThrottled=K,c.refWithControl=at,c.resolveRef=qt,c.resolveUnref=vt,c.set=Kt,c.syncRef=Qt,c.syncRefs=Vt,c.throttleFilter=q,c.throttledRef=K,c.throttledWatch=yt,c.timestamp=et,c.toReactive=D,c.toRef=J,c.toRefs=xt,c.toValue=s,c.tryOnBeforeMount=Dt,c.tryOnBeforeUnmount=te,c.tryOnMounted=ee,c.tryOnScopeDispose=M,c.tryOnUnmounted=ne,c.until=re,c.useArrayDifference=ce,c.useArrayEvery=ue,c.useArrayFilter=ie,c.useArrayFind=ae,c.useArrayFindIndex=le,c.useArrayFindLast=fe,c.useArrayIncludes=he,c.useArrayJoin=ye,c.useArrayMap=ge,c.useArrayReduce=we,c.useArraySome=me,c.useArrayUnique=be,c.useCounter=Ae,c.useDateFormat=Pe,c.useDebounce=X,c.useDebounceFn=ut,c.useInterval=Fe,c.useIntervalFn=ft,c.useLastChanged=Me,c.useThrottle=K,c.useThrottleFn=it,c.useTimeout=Ie,c.useTimeoutFn=dt,c.useToNumber=Ce,c.useToString=Re,c.useToggle=Ee,c.watchArray=ke,c.watchAtMost=_e,c.watchDebounced=ht,c.watchDeep=je,c.watchIgnorable=V,c.watchImmediate=Ne,c.watchOnce=Le,c.watchPausable=$,c.watchThrottled=yt,c.watchTriggerable=We,c.watchWithFilter=W,c.whenever=$e})(this.VueUse=this.VueUse||{},VueDemi);
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { shallowRef, watchEffect, readonly, ref, watch, customRef, getCurrentScope, onScopeDispose, effectScope, getCurrentInstance, provide, inject, isVue3, version, isRef, unref, computed, reactive, toRefs as toRefs$1, toRef as toRef$1, isVue2, set as set$1, onBeforeMount, nextTick, onBeforeUnmount, onMounted, onUnmounted, isReactive } from 'vue-demi';
1
+ import { shallowRef, watchEffect, readonly, ref, watch, customRef, getCurrentScope, onScopeDispose, effectScope, getCurrentInstance, inject, provide, isVue3, version, isRef, unref, computed, reactive, toRefs as toRefs$1, toRef as toRef$1, isVue2, set as set$1, onBeforeMount, nextTick, onBeforeUnmount, onMounted, onUnmounted, isReactive } from 'vue-demi';
2
2
 
3
3
  function computedEager(fn, options) {
4
4
  var _a;
@@ -92,6 +92,17 @@ function createGlobalState(stateFactory) {
92
92
 
93
93
  const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
94
94
 
95
+ const injectLocal = (...args) => {
96
+ var _a;
97
+ const key = args[0];
98
+ const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
99
+ if (instance == null)
100
+ throw new Error("injectLocal must be called in setup");
101
+ if (localProvidedStateMap.has(instance) && key in localProvidedStateMap.get(instance))
102
+ return localProvidedStateMap.get(instance)[key];
103
+ return inject(...args);
104
+ };
105
+
95
106
  const provideLocal = (key, value) => {
96
107
  var _a;
97
108
  const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
@@ -104,17 +115,6 @@ const provideLocal = (key, value) => {
104
115
  provide(key, value);
105
116
  };
106
117
 
107
- const injectLocal = (...args) => {
108
- var _a;
109
- const key = args[0];
110
- const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
111
- if (instance == null)
112
- throw new Error("injectLocal must be called in setup");
113
- if (localProvidedStateMap.has(instance) && key in localProvidedStateMap.get(instance))
114
- return localProvidedStateMap.get(instance)[key];
115
- return inject(...args);
116
- };
117
-
118
118
  function createInjectionState(composable, options) {
119
119
  const key = (options == null ? void 0 : options.injectionKey) || Symbol(composable.name || "InjectionState");
120
120
  const defaultValue = options == null ? void 0 : options.defaultValue;
@@ -285,6 +285,12 @@ function reactiveOmit(obj, ...keys) {
285
285
  return reactiveComputed(() => typeof predicate === "function" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => !predicate(toValue(v), k))) : Object.fromEntries(Object.entries(toRefs$1(obj)).filter((e) => !flatKeys.includes(e[0]))));
286
286
  }
287
287
 
288
+ const directiveHooks = {
289
+ mounted: isVue3 ? "mounted" : "inserted",
290
+ updated: isVue3 ? "updated" : "componentUpdated",
291
+ unmounted: isVue3 ? "unmounted" : "unbind"
292
+ };
293
+
288
294
  const isClient = typeof window !== "undefined" && typeof document !== "undefined";
289
295
  const isWorker = typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
290
296
  const isDef = (val) => typeof val !== "undefined";
@@ -433,12 +439,6 @@ function pausableFilter(extendFilter = bypassFilter) {
433
439
  return { isActive: readonly(isActive), pause, resume, eventFilter };
434
440
  }
435
441
 
436
- const directiveHooks = {
437
- mounted: isVue3 ? "mounted" : "inserted",
438
- updated: isVue3 ? "updated" : "componentUpdated",
439
- unmounted: isVue3 ? "unmounted" : "unbind"
440
- };
441
-
442
442
  function cacheStringFunction(fn) {
443
443
  const cache = /* @__PURE__ */ Object.create(null);
444
444
  return (str) => {
@@ -1029,7 +1029,7 @@ function useArrayReduce(list, reducer, ...args) {
1029
1029
  const reduceCallback = (sum, value, index) => reducer(toValue(sum), toValue(value), index);
1030
1030
  return computed(() => {
1031
1031
  const resolved = toValue(list);
1032
- return args.length ? resolved.reduce(reduceCallback, toValue(args[0])) : resolved.reduce(reduceCallback);
1032
+ return args.length ? resolved.reduce(reduceCallback, typeof args[0] === "function" ? toValue(args[0]()) : toValue(args[0])) : resolved.reduce(reduceCallback);
1033
1033
  });
1034
1034
  }
1035
1035
 
@@ -1181,7 +1181,8 @@ function useIntervalFn(cb, interval = 1e3, options = {}) {
1181
1181
  if (immediateCallback)
1182
1182
  cb();
1183
1183
  clean();
1184
- timer = setInterval(cb, intervalValue);
1184
+ if (isActive.value)
1185
+ timer = setInterval(cb, intervalValue);
1185
1186
  }
1186
1187
  if (immediate && isClient)
1187
1188
  resume();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vueuse/shared",
3
- "version": "11.0.3",
3
+ "version": "11.2.0",
4
4
  "author": "Anthony Fu <https://github.com/antfu>",
5
5
  "license": "MIT",
6
6
  "funding": "https://github.com/sponsors/antfu",