@vitejs/devtools 0.0.0-alpha.9 → 0.1.1

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.
Files changed (42) hide show
  1. package/dist/DockIcon-BtMEW4VE.js +97 -0
  2. package/dist/DockStandalone-CZAqITKs.js +81 -0
  3. package/dist/LogItem-BTrEubKY.js +205 -0
  4. package/dist/ToastOverlay-DO3Kl_rY.js +1055 -0
  5. package/dist/ViewBuiltinLogs-BL373XPJ.js +428 -0
  6. package/dist/ViewBuiltinTerminals-DdpE1Ftb.js +10409 -0
  7. package/dist/ViewJsonRender-coidkW9b.js +6835 -0
  8. package/dist/cli-commands-BRswBnHn.js +180 -0
  9. package/dist/cli-commands.js +3 -5
  10. package/dist/cli.js +3 -6
  11. package/dist/client/inject.js +171 -18
  12. package/dist/client/standalone/assets/DockStandalone-DDaYjGO1.js +1 -0
  13. package/dist/client/standalone/assets/LogItem-CKbVrExA.js +1 -0
  14. package/dist/client/standalone/assets/ViewBuiltinLogs-9oWDdl1G.js +1 -0
  15. package/dist/client/standalone/assets/ViewBuiltinTerminals-CpexS-ib.js +36 -0
  16. package/dist/client/standalone/assets/ViewJsonRender-CKPzRgqQ.js +43 -0
  17. package/dist/client/standalone/assets/dist-JpCJ4ieR.js +1 -0
  18. package/dist/client/standalone/assets/iconify-C-CPDXMf.js +2 -0
  19. package/dist/client/standalone/assets/index-3wlMt-60.js +3 -0
  20. package/dist/client/standalone/assets/index-6F2y1lxr.css +1 -0
  21. package/dist/client/standalone/assets/runtime-core.esm-bundler-oO31W4LZ.js +1 -0
  22. package/dist/client/standalone/index.html +7 -3
  23. package/dist/client/webcomponents.d.ts +21657 -31
  24. package/dist/client/webcomponents.js +307 -455
  25. package/dist/config.d.ts +25 -0
  26. package/dist/config.js +14 -0
  27. package/dist/dirs.js +7 -3
  28. package/dist/dist-Cgqg5_oP.js +1113 -0
  29. package/dist/iconify-YyqAMHKf.js +1625 -0
  30. package/dist/index.d.ts +256 -13
  31. package/dist/index.js +2 -4
  32. package/dist/plugins-Cvy_lJ0L.js +2135 -0
  33. package/dist/popup-ffZHGm5D.js +358 -0
  34. package/dist/utils-Csuu5uNf.js +10 -0
  35. package/dist/{dist-2aLfy0Lc.js → vue.runtime.esm-bundler-D2MZbyFr.js} +1948 -1734
  36. package/package.json +53 -21
  37. package/dist/cli-commands-CWESTkWI.js +0 -97
  38. package/dist/client/standalone/assets/index-CXKamp9k.js +0 -7
  39. package/dist/client/standalone/assets/index-DULlvzQC.css +0 -1
  40. package/dist/dirs-DcSK9l9L.js +0 -9
  41. package/dist/index-C-9eMTqf.d.ts +0 -142
  42. package/dist/plugins-5VE4Mfdt.js +0 -1365
@@ -0,0 +1,1113 @@
1
+ import { B as onScopeDispose, C as nextTick, G as shallowRef, H as readonly, I as customRef, J as toValue, K as toRef$1, L as getCurrentScope, M as watch, N as watchEffect, R as isRef, S as inject, T as onMounted, U as ref, W as shallowReadonly, Y as unref, l as computed, x as hasInjectionContext, y as getCurrentInstance } from "./vue.runtime.esm-bundler-D2MZbyFr.js";
2
+ //#region ../../node_modules/.pnpm/@vueuse+shared@14.2.1_vue@3.5.30_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js
3
+ /**
4
+ * Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing
5
+ *
6
+ * @param fn
7
+ */
8
+ function tryOnScopeDispose(fn, failSilently) {
9
+ if (getCurrentScope()) {
10
+ onScopeDispose(fn, failSilently);
11
+ return true;
12
+ }
13
+ return false;
14
+ }
15
+ const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
16
+ /**
17
+ * On the basis of `inject`, it is allowed to directly call inject to obtain the value after call provide in the same component.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * injectLocal('MyInjectionKey', 1)
22
+ * const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1
23
+ * ```
24
+ *
25
+ * @__NO_SIDE_EFFECTS__
26
+ */
27
+ const injectLocal = (...args) => {
28
+ var _getCurrentInstance;
29
+ const key = args[0];
30
+ const instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;
31
+ const owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();
32
+ if (owner == null && !hasInjectionContext()) throw new Error("injectLocal must be called in setup");
33
+ if (owner && localProvidedStateMap.has(owner) && key in localProvidedStateMap.get(owner)) return localProvidedStateMap.get(owner)[key];
34
+ return inject(...args);
35
+ };
36
+ const isClient = typeof window !== "undefined" && typeof document !== "undefined";
37
+ typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
38
+ const notNullish = (val) => val != null;
39
+ const toString = Object.prototype.toString;
40
+ const isObject = (val) => toString.call(val) === "[object Object]";
41
+ const noop = () => {};
42
+ const isIOS = /* @__PURE__ */ getIsIOS();
43
+ function getIsIOS() {
44
+ var _window, _window2, _window3;
45
+ return isClient && !!((_window = window) === null || _window === void 0 || (_window = _window.navigator) === null || _window === void 0 ? void 0 : _window.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.navigator) === null || _window2 === void 0 ? void 0 : _window2.maxTouchPoints) > 2 && /iPad|Macintosh/.test((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.navigator.userAgent));
46
+ }
47
+ function toRef(...args) {
48
+ if (args.length !== 1) return toRef$1(...args);
49
+ const r = args[0];
50
+ return typeof r === "function" ? readonly(customRef(() => ({
51
+ get: r,
52
+ set: noop
53
+ }))) : ref(r);
54
+ }
55
+ /**
56
+ * @internal
57
+ */
58
+ function createFilterWrapper(filter, fn) {
59
+ function wrapper(...args) {
60
+ return new Promise((resolve, reject) => {
61
+ Promise.resolve(filter(() => fn.apply(this, args), {
62
+ fn,
63
+ thisArg: this,
64
+ args
65
+ })).then(resolve).catch(reject);
66
+ });
67
+ }
68
+ return wrapper;
69
+ }
70
+ const bypassFilter = (invoke$1) => {
71
+ return invoke$1();
72
+ };
73
+ /**
74
+ * Create an EventFilter that debounce the events
75
+ */
76
+ function debounceFilter(ms, options = {}) {
77
+ let timer;
78
+ let maxTimer;
79
+ let lastRejector = noop;
80
+ const _clearTimeout = (timer$1) => {
81
+ clearTimeout(timer$1);
82
+ lastRejector();
83
+ lastRejector = noop;
84
+ };
85
+ let lastInvoker;
86
+ const filter = (invoke$1) => {
87
+ const duration = toValue(ms);
88
+ const maxDuration = toValue(options.maxWait);
89
+ if (timer) _clearTimeout(timer);
90
+ if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
91
+ if (maxTimer) {
92
+ _clearTimeout(maxTimer);
93
+ maxTimer = void 0;
94
+ }
95
+ return Promise.resolve(invoke$1());
96
+ }
97
+ return new Promise((resolve, reject) => {
98
+ lastRejector = options.rejectOnCancel ? reject : resolve;
99
+ lastInvoker = invoke$1;
100
+ if (maxDuration && !maxTimer) maxTimer = setTimeout(() => {
101
+ if (timer) _clearTimeout(timer);
102
+ maxTimer = void 0;
103
+ resolve(lastInvoker());
104
+ }, maxDuration);
105
+ timer = setTimeout(() => {
106
+ if (maxTimer) _clearTimeout(maxTimer);
107
+ maxTimer = void 0;
108
+ resolve(invoke$1());
109
+ }, duration);
110
+ });
111
+ };
112
+ return filter;
113
+ }
114
+ /**
115
+ * EventFilter that gives extra controls to pause and resume the filter
116
+ *
117
+ * @param extendFilter Extra filter to apply when the PausableFilter is active, default to none
118
+ * @param options Options to configure the filter
119
+ */
120
+ function pausableFilter(extendFilter = bypassFilter, options = {}) {
121
+ const { initialState = "active" } = options;
122
+ const isActive = toRef(initialState === "active");
123
+ function pause() {
124
+ isActive.value = false;
125
+ }
126
+ function resume() {
127
+ isActive.value = true;
128
+ }
129
+ const eventFilter = (...args) => {
130
+ if (isActive.value) extendFilter(...args);
131
+ };
132
+ return {
133
+ isActive: readonly(isActive),
134
+ pause,
135
+ resume,
136
+ eventFilter
137
+ };
138
+ }
139
+ /**
140
+ * Get a px value for SSR use, do not rely on this method outside of SSR as REM unit is assumed at 16px, which might not be the case on the client
141
+ */
142
+ function pxValue(px) {
143
+ return px.endsWith("rem") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);
144
+ }
145
+ function toArray(value) {
146
+ return Array.isArray(value) ? value : [value];
147
+ }
148
+ function cacheStringFunction(fn) {
149
+ const cache = Object.create(null);
150
+ return ((str) => {
151
+ return cache[str] || (cache[str] = fn(str));
152
+ });
153
+ }
154
+ const hyphenateRE = /\B([A-Z])/g;
155
+ cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
156
+ const camelizeRE = /-(\w)/g;
157
+ cacheStringFunction((str) => {
158
+ return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
159
+ });
160
+ function getLifeCycleTarget(target) {
161
+ return target || getCurrentInstance();
162
+ }
163
+ /**
164
+ * Debounce execution of a function.
165
+ *
166
+ * @see https://vueuse.org/useDebounceFn
167
+ * @param fn A function to be executed after delay milliseconds debounced.
168
+ * @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
169
+ * @param options Options
170
+ *
171
+ * @return A new, debounce, function.
172
+ *
173
+ * @__NO_SIDE_EFFECTS__
174
+ */
175
+ function useDebounceFn(fn, ms = 200, options = {}) {
176
+ return createFilterWrapper(debounceFilter(ms, options), fn);
177
+ }
178
+ function watchWithFilter(source, cb, options = {}) {
179
+ const { eventFilter = bypassFilter, ...watchOptions } = options;
180
+ return watch(source, createFilterWrapper(eventFilter, cb), watchOptions);
181
+ }
182
+ /** @deprecated Use Vue's built-in `watch` instead. This function will be removed in future version. */
183
+ function watchPausable(source, cb, options = {}) {
184
+ const { eventFilter: filter, initialState = "active", ...watchOptions } = options;
185
+ const { eventFilter, pause, resume, isActive } = pausableFilter(filter, { initialState });
186
+ return {
187
+ stop: watchWithFilter(source, cb, {
188
+ ...watchOptions,
189
+ eventFilter
190
+ }),
191
+ pause,
192
+ resume,
193
+ isActive
194
+ };
195
+ }
196
+ /**
197
+ * Call onMounted() if it's inside a component lifecycle, if not, just call the function
198
+ *
199
+ * @param fn
200
+ * @param sync if set to false, it will run in the nextTick() of Vue
201
+ * @param target
202
+ */
203
+ function tryOnMounted(fn, sync = true, target) {
204
+ if (getLifeCycleTarget(target)) onMounted(fn, target);
205
+ else if (sync) fn();
206
+ else nextTick(fn);
207
+ }
208
+ /**
209
+ * Wrapper for `setInterval` with controls
210
+ *
211
+ * @see https://vueuse.org/useIntervalFn
212
+ * @param cb
213
+ * @param interval
214
+ * @param options
215
+ */
216
+ function useIntervalFn(cb, interval = 1e3, options = {}) {
217
+ const { immediate = true, immediateCallback = false } = options;
218
+ let timer = null;
219
+ const isActive = shallowRef(false);
220
+ function clean() {
221
+ if (timer) {
222
+ clearInterval(timer);
223
+ timer = null;
224
+ }
225
+ }
226
+ function pause() {
227
+ isActive.value = false;
228
+ clean();
229
+ }
230
+ function resume() {
231
+ const intervalValue = toValue(interval);
232
+ if (intervalValue <= 0) return;
233
+ isActive.value = true;
234
+ if (immediateCallback) cb();
235
+ clean();
236
+ if (isActive.value) timer = setInterval(cb, intervalValue);
237
+ }
238
+ if (immediate && isClient) resume();
239
+ if (isRef(interval) || typeof interval === "function") tryOnScopeDispose(watch(interval, () => {
240
+ if (isActive.value && isClient) resume();
241
+ }));
242
+ tryOnScopeDispose(pause);
243
+ return {
244
+ isActive: shallowReadonly(isActive),
245
+ pause,
246
+ resume
247
+ };
248
+ }
249
+ function watchDebounced(source, cb, options = {}) {
250
+ const { debounce = 0, maxWait = void 0, ...watchOptions } = options;
251
+ return watchWithFilter(source, cb, {
252
+ ...watchOptions,
253
+ eventFilter: debounceFilter(debounce, { maxWait })
254
+ });
255
+ }
256
+ /**
257
+ * Shorthand for watching value with {immediate: true}
258
+ *
259
+ * @see https://vueuse.org/watchImmediate
260
+ */
261
+ function watchImmediate(source, cb, options) {
262
+ return watch(source, cb, {
263
+ ...options,
264
+ immediate: true
265
+ });
266
+ }
267
+ //#endregion
268
+ //#region ../../node_modules/.pnpm/@vueuse+core@14.2.1_vue@3.5.30_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js
269
+ const defaultWindow = isClient ? window : void 0;
270
+ isClient && window.document;
271
+ isClient && window.navigator;
272
+ isClient && window.location;
273
+ /**
274
+ * Get the dom element of a ref of element or Vue component instance
275
+ *
276
+ * @param elRef
277
+ */
278
+ function unrefElement(elRef) {
279
+ var _$el;
280
+ const plain = toValue(elRef);
281
+ return (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain;
282
+ }
283
+ function useEventListener(...args) {
284
+ const register = (el, event, listener, options) => {
285
+ el.addEventListener(event, listener, options);
286
+ return () => el.removeEventListener(event, listener, options);
287
+ };
288
+ const firstParamTargets = computed(() => {
289
+ const test = toArray(toValue(args[0])).filter((e) => e != null);
290
+ return test.every((e) => typeof e !== "string") ? test : void 0;
291
+ });
292
+ return watchImmediate(() => {
293
+ var _firstParamTargets$va, _firstParamTargets$va2;
294
+ return [
295
+ (_firstParamTargets$va = (_firstParamTargets$va2 = firstParamTargets.value) === null || _firstParamTargets$va2 === void 0 ? void 0 : _firstParamTargets$va2.map((e) => unrefElement(e))) !== null && _firstParamTargets$va !== void 0 ? _firstParamTargets$va : [defaultWindow].filter((e) => e != null),
296
+ toArray(toValue(firstParamTargets.value ? args[1] : args[0])),
297
+ toArray(unref(firstParamTargets.value ? args[2] : args[1])),
298
+ toValue(firstParamTargets.value ? args[3] : args[2])
299
+ ];
300
+ }, ([raw_targets, raw_events, raw_listeners, raw_options], _, onCleanup) => {
301
+ if (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return;
302
+ const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;
303
+ const cleanups = raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))));
304
+ onCleanup(() => {
305
+ cleanups.forEach((fn) => fn());
306
+ });
307
+ }, { flush: "post" });
308
+ }
309
+ let _iOSWorkaround = false;
310
+ function onClickOutside(target, handler, options = {}) {
311
+ const { window: window$1 = defaultWindow, ignore = [], capture = true, detectIframe = false, controls = false } = options;
312
+ if (!window$1) return controls ? {
313
+ stop: noop,
314
+ cancel: noop,
315
+ trigger: noop
316
+ } : noop;
317
+ if (isIOS && !_iOSWorkaround) {
318
+ _iOSWorkaround = true;
319
+ const listenerOptions = { passive: true };
320
+ Array.from(window$1.document.body.children).forEach((el) => el.addEventListener("click", noop, listenerOptions));
321
+ window$1.document.documentElement.addEventListener("click", noop, listenerOptions);
322
+ }
323
+ let shouldListen = true;
324
+ const shouldIgnore = (event) => {
325
+ return toValue(ignore).some((target$1) => {
326
+ if (typeof target$1 === "string") return Array.from(window$1.document.querySelectorAll(target$1)).some((el) => el === event.target || event.composedPath().includes(el));
327
+ else {
328
+ const el = unrefElement(target$1);
329
+ return el && (event.target === el || event.composedPath().includes(el));
330
+ }
331
+ });
332
+ };
333
+ /**
334
+ * Determines if the given target has multiple root elements.
335
+ * Referenced from: https://github.com/vuejs/test-utils/blob/ccb460be55f9f6be05ab708500a41ec8adf6f4bc/src/vue-wrapper.ts#L21
336
+ */
337
+ function hasMultipleRoots(target$1) {
338
+ const vm = toValue(target$1);
339
+ return vm && vm.$.subTree.shapeFlag === 16;
340
+ }
341
+ function checkMultipleRoots(target$1, event) {
342
+ const vm = toValue(target$1);
343
+ const children = vm.$.subTree && vm.$.subTree.children;
344
+ if (children == null || !Array.isArray(children)) return false;
345
+ return children.some((child) => child.el === event.target || event.composedPath().includes(child.el));
346
+ }
347
+ const listener = (event) => {
348
+ const el = unrefElement(target);
349
+ if (event.target == null) return;
350
+ if (!(el instanceof Element) && hasMultipleRoots(target) && checkMultipleRoots(target, event)) return;
351
+ if (!el || el === event.target || event.composedPath().includes(el)) return;
352
+ if ("detail" in event && event.detail === 0) shouldListen = !shouldIgnore(event);
353
+ if (!shouldListen) {
354
+ shouldListen = true;
355
+ return;
356
+ }
357
+ handler(event);
358
+ };
359
+ let isProcessingClick = false;
360
+ const cleanup = [
361
+ useEventListener(window$1, "click", (event) => {
362
+ if (!isProcessingClick) {
363
+ isProcessingClick = true;
364
+ setTimeout(() => {
365
+ isProcessingClick = false;
366
+ }, 0);
367
+ listener(event);
368
+ }
369
+ }, {
370
+ passive: true,
371
+ capture
372
+ }),
373
+ useEventListener(window$1, "pointerdown", (e) => {
374
+ const el = unrefElement(target);
375
+ shouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));
376
+ }, { passive: true }),
377
+ detectIframe && useEventListener(window$1, "blur", (event) => {
378
+ setTimeout(() => {
379
+ var _window$document$acti;
380
+ const el = unrefElement(target);
381
+ if (((_window$document$acti = window$1.document.activeElement) === null || _window$document$acti === void 0 ? void 0 : _window$document$acti.tagName) === "IFRAME" && !(el === null || el === void 0 ? void 0 : el.contains(window$1.document.activeElement))) handler(event);
382
+ }, 0);
383
+ }, { passive: true })
384
+ ].filter(Boolean);
385
+ const stop = () => cleanup.forEach((fn) => fn());
386
+ if (controls) return {
387
+ stop,
388
+ cancel: () => {
389
+ shouldListen = false;
390
+ },
391
+ trigger: (event) => {
392
+ shouldListen = true;
393
+ listener(event);
394
+ shouldListen = false;
395
+ }
396
+ };
397
+ return stop;
398
+ }
399
+ /**
400
+ * Mounted state in ref.
401
+ *
402
+ * @see https://vueuse.org/useMounted
403
+ *
404
+ * @__NO_SIDE_EFFECTS__
405
+ */
406
+ function useMounted() {
407
+ const isMounted = shallowRef(false);
408
+ const instance = getCurrentInstance();
409
+ if (instance) onMounted(() => {
410
+ isMounted.value = true;
411
+ }, instance);
412
+ return isMounted;
413
+ }
414
+ /* @__NO_SIDE_EFFECTS__ */
415
+ function useSupported(callback) {
416
+ const isMounted = useMounted();
417
+ return computed(() => {
418
+ isMounted.value;
419
+ return Boolean(callback());
420
+ });
421
+ }
422
+ /**
423
+ * Watch for changes being made to the DOM tree.
424
+ *
425
+ * @see https://vueuse.org/useMutationObserver
426
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver MutationObserver MDN
427
+ * @param target
428
+ * @param callback
429
+ * @param options
430
+ */
431
+ function useMutationObserver(target, callback, options = {}) {
432
+ const { window: window$1 = defaultWindow, ...mutationOptions } = options;
433
+ let observer;
434
+ const isSupported = /* @__PURE__ */ useSupported(() => window$1 && "MutationObserver" in window$1);
435
+ const cleanup = () => {
436
+ if (observer) {
437
+ observer.disconnect();
438
+ observer = void 0;
439
+ }
440
+ };
441
+ const stopWatch = watch(computed(() => {
442
+ const items = toArray(toValue(target)).map(unrefElement).filter(notNullish);
443
+ return new Set(items);
444
+ }), (newTargets) => {
445
+ cleanup();
446
+ if (isSupported.value && newTargets.size) {
447
+ observer = new MutationObserver(callback);
448
+ newTargets.forEach((el) => observer.observe(el, mutationOptions));
449
+ }
450
+ }, {
451
+ immediate: true,
452
+ flush: "post"
453
+ });
454
+ const takeRecords = () => {
455
+ return observer === null || observer === void 0 ? void 0 : observer.takeRecords();
456
+ };
457
+ const stop = () => {
458
+ stopWatch();
459
+ cleanup();
460
+ };
461
+ tryOnScopeDispose(stop);
462
+ return {
463
+ isSupported,
464
+ stop,
465
+ takeRecords
466
+ };
467
+ }
468
+ /**
469
+ * Call function on every `requestAnimationFrame`. With controls of pausing and resuming.
470
+ *
471
+ * @see https://vueuse.org/useRafFn
472
+ * @param fn
473
+ * @param options
474
+ */
475
+ function useRafFn(fn, options = {}) {
476
+ const { immediate = true, fpsLimit = null, window: window$1 = defaultWindow, once = false } = options;
477
+ const isActive = shallowRef(false);
478
+ const intervalLimit = computed(() => {
479
+ const limit = toValue(fpsLimit);
480
+ return limit ? 1e3 / limit : null;
481
+ });
482
+ let previousFrameTimestamp = 0;
483
+ let rafId = null;
484
+ function loop(timestamp$1) {
485
+ if (!isActive.value || !window$1) return;
486
+ if (!previousFrameTimestamp) previousFrameTimestamp = timestamp$1;
487
+ const delta = timestamp$1 - previousFrameTimestamp;
488
+ if (intervalLimit.value && delta < intervalLimit.value) {
489
+ rafId = window$1.requestAnimationFrame(loop);
490
+ return;
491
+ }
492
+ previousFrameTimestamp = timestamp$1;
493
+ fn({
494
+ delta,
495
+ timestamp: timestamp$1
496
+ });
497
+ if (once) {
498
+ isActive.value = false;
499
+ rafId = null;
500
+ return;
501
+ }
502
+ rafId = window$1.requestAnimationFrame(loop);
503
+ }
504
+ function resume() {
505
+ if (!isActive.value && window$1) {
506
+ isActive.value = true;
507
+ previousFrameTimestamp = 0;
508
+ rafId = window$1.requestAnimationFrame(loop);
509
+ }
510
+ }
511
+ function pause() {
512
+ isActive.value = false;
513
+ if (rafId != null && window$1) {
514
+ window$1.cancelAnimationFrame(rafId);
515
+ rafId = null;
516
+ }
517
+ }
518
+ if (immediate) resume();
519
+ tryOnScopeDispose(pause);
520
+ return {
521
+ isActive: readonly(isActive),
522
+ pause,
523
+ resume
524
+ };
525
+ }
526
+ const ssrWidthSymbol = Symbol("vueuse-ssr-width");
527
+ /* @__NO_SIDE_EFFECTS__ */
528
+ function useSSRWidth() {
529
+ const ssrWidth = hasInjectionContext() ? injectLocal(ssrWidthSymbol, null) : null;
530
+ return typeof ssrWidth === "number" ? ssrWidth : void 0;
531
+ }
532
+ /**
533
+ * Reactive Media Query.
534
+ *
535
+ * @see https://vueuse.org/useMediaQuery
536
+ * @param query
537
+ * @param options
538
+ */
539
+ function useMediaQuery(query, options = {}) {
540
+ const { window: window$1 = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
541
+ const isSupported = /* @__PURE__ */ useSupported(() => window$1 && "matchMedia" in window$1 && typeof window$1.matchMedia === "function");
542
+ const ssrSupport = shallowRef(typeof ssrWidth === "number");
543
+ const mediaQuery = shallowRef();
544
+ const matches = shallowRef(false);
545
+ const handler = (event) => {
546
+ matches.value = event.matches;
547
+ };
548
+ watchEffect(() => {
549
+ if (ssrSupport.value) {
550
+ ssrSupport.value = !isSupported.value;
551
+ matches.value = toValue(query).split(",").some((queryString) => {
552
+ const not = queryString.includes("not all");
553
+ const minWidth = queryString.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
554
+ const maxWidth = queryString.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
555
+ let res = Boolean(minWidth || maxWidth);
556
+ if (minWidth && res) res = ssrWidth >= pxValue(minWidth[1]);
557
+ if (maxWidth && res) res = ssrWidth <= pxValue(maxWidth[1]);
558
+ return not ? !res : res;
559
+ });
560
+ return;
561
+ }
562
+ if (!isSupported.value) return;
563
+ mediaQuery.value = window$1.matchMedia(toValue(query));
564
+ matches.value = mediaQuery.value.matches;
565
+ });
566
+ useEventListener(mediaQuery, "change", handler, { passive: true });
567
+ return computed(() => matches.value);
568
+ }
569
+ const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
570
+ const globalKey = "__vueuse_ssr_handlers__";
571
+ const handlers = /* @__PURE__ */ getHandlers();
572
+ function getHandlers() {
573
+ if (!(globalKey in _global)) _global[globalKey] = _global[globalKey] || {};
574
+ return _global[globalKey];
575
+ }
576
+ function getSSRHandler(key, fallback) {
577
+ return handlers[key] || fallback;
578
+ }
579
+ function guessSerializerType(rawInit) {
580
+ return rawInit == null ? "any" : rawInit instanceof Set ? "set" : rawInit instanceof Map ? "map" : rawInit instanceof Date ? "date" : typeof rawInit === "boolean" ? "boolean" : typeof rawInit === "string" ? "string" : typeof rawInit === "object" ? "object" : !Number.isNaN(rawInit) ? "number" : "any";
581
+ }
582
+ const StorageSerializers = {
583
+ boolean: {
584
+ read: (v) => v === "true",
585
+ write: (v) => String(v)
586
+ },
587
+ object: {
588
+ read: (v) => JSON.parse(v),
589
+ write: (v) => JSON.stringify(v)
590
+ },
591
+ number: {
592
+ read: (v) => Number.parseFloat(v),
593
+ write: (v) => String(v)
594
+ },
595
+ any: {
596
+ read: (v) => v,
597
+ write: (v) => String(v)
598
+ },
599
+ string: {
600
+ read: (v) => v,
601
+ write: (v) => String(v)
602
+ },
603
+ map: {
604
+ read: (v) => new Map(JSON.parse(v)),
605
+ write: (v) => JSON.stringify(Array.from(v.entries()))
606
+ },
607
+ set: {
608
+ read: (v) => new Set(JSON.parse(v)),
609
+ write: (v) => JSON.stringify(Array.from(v))
610
+ },
611
+ date: {
612
+ read: (v) => new Date(v),
613
+ write: (v) => v.toISOString()
614
+ }
615
+ };
616
+ const customStorageEventName = "vueuse-storage";
617
+ /**
618
+ * Reactive LocalStorage/SessionStorage.
619
+ *
620
+ * @see https://vueuse.org/useStorage
621
+ */
622
+ function useStorage(key, defaults$1, storage, options = {}) {
623
+ var _options$serializer;
624
+ const { flush = "pre", deep = true, listenToStorageChanges = true, writeDefaults = true, mergeDefaults = false, shallow, window: window$1 = defaultWindow, eventFilter, onError = (e) => {
625
+ console.error(e);
626
+ }, initOnMounted } = options;
627
+ const data = (shallow ? shallowRef : ref)(typeof defaults$1 === "function" ? defaults$1() : defaults$1);
628
+ const keyComputed = computed(() => toValue(key));
629
+ if (!storage) try {
630
+ storage = getSSRHandler("getDefaultStorage", () => defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.localStorage)();
631
+ } catch (e) {
632
+ onError(e);
633
+ }
634
+ if (!storage) return data;
635
+ const rawInit = toValue(defaults$1);
636
+ const type = guessSerializerType(rawInit);
637
+ const serializer = (_options$serializer = options.serializer) !== null && _options$serializer !== void 0 ? _options$serializer : StorageSerializers[type];
638
+ const { pause: pauseWatch, resume: resumeWatch } = watchPausable(data, (newValue) => write(newValue), {
639
+ flush,
640
+ deep,
641
+ eventFilter
642
+ });
643
+ watch(keyComputed, () => update(), { flush });
644
+ let firstMounted = false;
645
+ const onStorageEvent = (ev) => {
646
+ if (initOnMounted && !firstMounted) return;
647
+ update(ev);
648
+ };
649
+ const onStorageCustomEvent = (ev) => {
650
+ if (initOnMounted && !firstMounted) return;
651
+ updateFromCustomEvent(ev);
652
+ };
653
+ /**
654
+ * The custom event is needed for same-document syncing when using custom
655
+ * storage backends, but it doesn't work across different documents.
656
+ *
657
+ * TODO: Consider implementing a BroadcastChannel-based solution that fixes this.
658
+ */
659
+ if (window$1 && listenToStorageChanges) if (storage instanceof Storage) useEventListener(window$1, "storage", onStorageEvent, { passive: true });
660
+ else useEventListener(window$1, customStorageEventName, onStorageCustomEvent);
661
+ if (initOnMounted) tryOnMounted(() => {
662
+ firstMounted = true;
663
+ update();
664
+ });
665
+ else update();
666
+ function dispatchWriteEvent(oldValue, newValue) {
667
+ if (window$1) {
668
+ const payload = {
669
+ key: keyComputed.value,
670
+ oldValue,
671
+ newValue,
672
+ storageArea: storage
673
+ };
674
+ window$1.dispatchEvent(storage instanceof Storage ? new StorageEvent("storage", payload) : new CustomEvent(customStorageEventName, { detail: payload }));
675
+ }
676
+ }
677
+ function write(v) {
678
+ try {
679
+ const oldValue = storage.getItem(keyComputed.value);
680
+ if (v == null) {
681
+ dispatchWriteEvent(oldValue, null);
682
+ storage.removeItem(keyComputed.value);
683
+ } else {
684
+ const serialized = serializer.write(v);
685
+ if (oldValue !== serialized) {
686
+ storage.setItem(keyComputed.value, serialized);
687
+ dispatchWriteEvent(oldValue, serialized);
688
+ }
689
+ }
690
+ } catch (e) {
691
+ onError(e);
692
+ }
693
+ }
694
+ function read(event) {
695
+ const rawValue = event ? event.newValue : storage.getItem(keyComputed.value);
696
+ if (rawValue == null) {
697
+ if (writeDefaults && rawInit != null) storage.setItem(keyComputed.value, serializer.write(rawInit));
698
+ return rawInit;
699
+ } else if (!event && mergeDefaults) {
700
+ const value = serializer.read(rawValue);
701
+ if (typeof mergeDefaults === "function") return mergeDefaults(value, rawInit);
702
+ else if (type === "object" && !Array.isArray(value)) return {
703
+ ...rawInit,
704
+ ...value
705
+ };
706
+ return value;
707
+ } else if (typeof rawValue !== "string") return rawValue;
708
+ else return serializer.read(rawValue);
709
+ }
710
+ function update(event) {
711
+ if (event && event.storageArea !== storage) return;
712
+ if (event && event.key == null) {
713
+ data.value = rawInit;
714
+ return;
715
+ }
716
+ if (event && event.key !== keyComputed.value) return;
717
+ pauseWatch();
718
+ try {
719
+ const serializedData = serializer.write(data.value);
720
+ if (event === void 0 || (event === null || event === void 0 ? void 0 : event.newValue) !== serializedData) data.value = read(event);
721
+ } catch (e) {
722
+ onError(e);
723
+ } finally {
724
+ if (event) nextTick(resumeWatch);
725
+ else resumeWatch();
726
+ }
727
+ }
728
+ function updateFromCustomEvent(event) {
729
+ update(event.detail);
730
+ }
731
+ return data;
732
+ }
733
+ /**
734
+ * Manipulate CSS variables.
735
+ *
736
+ * @see https://vueuse.org/useCssVar
737
+ * @param prop
738
+ * @param target
739
+ * @param options
740
+ */
741
+ function useCssVar(prop, target, options = {}) {
742
+ const { window: window$1 = defaultWindow, initialValue, observe = false } = options;
743
+ const variable = shallowRef(initialValue);
744
+ const elRef = computed(() => {
745
+ var _window$document;
746
+ return unrefElement(target) || (window$1 === null || window$1 === void 0 || (_window$document = window$1.document) === null || _window$document === void 0 ? void 0 : _window$document.documentElement);
747
+ });
748
+ function updateCssVar() {
749
+ const key = toValue(prop);
750
+ const el = toValue(elRef);
751
+ if (el && window$1 && key) {
752
+ var _window$getComputedSt;
753
+ variable.value = ((_window$getComputedSt = window$1.getComputedStyle(el).getPropertyValue(key)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.trim()) || variable.value || initialValue;
754
+ }
755
+ }
756
+ if (observe) useMutationObserver(elRef, updateCssVar, {
757
+ attributeFilter: ["style", "class"],
758
+ window: window$1
759
+ });
760
+ watch([elRef, () => toValue(prop)], (_, old) => {
761
+ if (old[0] && old[1]) old[0].style.removeProperty(old[1]);
762
+ updateCssVar();
763
+ }, { immediate: true });
764
+ watch([variable, elRef], ([val, el]) => {
765
+ const raw_prop = toValue(prop);
766
+ if ((el === null || el === void 0 ? void 0 : el.style) && raw_prop) if (val == null) el.style.removeProperty(raw_prop);
767
+ else el.style.setProperty(raw_prop, val);
768
+ }, { immediate: true });
769
+ return variable;
770
+ }
771
+ /**
772
+ * Reports changes to the dimensions of an Element's content or the border-box
773
+ *
774
+ * @see https://vueuse.org/useResizeObserver
775
+ * @param target
776
+ * @param callback
777
+ * @param options
778
+ */
779
+ function useResizeObserver(target, callback, options = {}) {
780
+ const { window: window$1 = defaultWindow, ...observerOptions } = options;
781
+ let observer;
782
+ const isSupported = /* @__PURE__ */ useSupported(() => window$1 && "ResizeObserver" in window$1);
783
+ const cleanup = () => {
784
+ if (observer) {
785
+ observer.disconnect();
786
+ observer = void 0;
787
+ }
788
+ };
789
+ const stopWatch = watch(computed(() => {
790
+ const _targets = toValue(target);
791
+ return Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];
792
+ }), (els) => {
793
+ cleanup();
794
+ if (isSupported.value && window$1) {
795
+ observer = new ResizeObserver(callback);
796
+ for (const _el of els) if (_el) observer.observe(_el, observerOptions);
797
+ }
798
+ }, {
799
+ immediate: true,
800
+ flush: "post"
801
+ });
802
+ const stop = () => {
803
+ cleanup();
804
+ stopWatch();
805
+ };
806
+ tryOnScopeDispose(stop);
807
+ return {
808
+ isSupported,
809
+ stop
810
+ };
811
+ }
812
+ /**
813
+ * Reactive bounding box of an HTML element.
814
+ *
815
+ * @see https://vueuse.org/useElementBounding
816
+ * @param target
817
+ */
818
+ function useElementBounding(target, options = {}) {
819
+ const { reset = true, windowResize = true, windowScroll = true, immediate = true, updateTiming = "sync" } = options;
820
+ const height = shallowRef(0);
821
+ const bottom = shallowRef(0);
822
+ const left = shallowRef(0);
823
+ const right = shallowRef(0);
824
+ const top = shallowRef(0);
825
+ const width = shallowRef(0);
826
+ const x = shallowRef(0);
827
+ const y = shallowRef(0);
828
+ function recalculate() {
829
+ const el = unrefElement(target);
830
+ if (!el) {
831
+ if (reset) {
832
+ height.value = 0;
833
+ bottom.value = 0;
834
+ left.value = 0;
835
+ right.value = 0;
836
+ top.value = 0;
837
+ width.value = 0;
838
+ x.value = 0;
839
+ y.value = 0;
840
+ }
841
+ return;
842
+ }
843
+ const rect = el.getBoundingClientRect();
844
+ height.value = rect.height;
845
+ bottom.value = rect.bottom;
846
+ left.value = rect.left;
847
+ right.value = rect.right;
848
+ top.value = rect.top;
849
+ width.value = rect.width;
850
+ x.value = rect.x;
851
+ y.value = rect.y;
852
+ }
853
+ function update() {
854
+ if (updateTiming === "sync") recalculate();
855
+ else if (updateTiming === "next-frame") requestAnimationFrame(() => recalculate());
856
+ }
857
+ useResizeObserver(target, update);
858
+ watch(() => unrefElement(target), (ele) => !ele && update());
859
+ useMutationObserver(target, update, { attributeFilter: ["style", "class"] });
860
+ if (windowScroll) useEventListener("scroll", update, {
861
+ capture: true,
862
+ passive: true
863
+ });
864
+ if (windowResize) useEventListener("resize", update, { passive: true });
865
+ tryOnMounted(() => {
866
+ if (immediate) update();
867
+ });
868
+ return {
869
+ height,
870
+ bottom,
871
+ left,
872
+ right,
873
+ top,
874
+ width,
875
+ x,
876
+ y,
877
+ update
878
+ };
879
+ }
880
+ /**
881
+ * Reactive LocalStorage.
882
+ *
883
+ * @see https://vueuse.org/useLocalStorage
884
+ * @param key
885
+ * @param initialValue
886
+ * @param options
887
+ */
888
+ function useLocalStorage(key, initialValue, options = {}) {
889
+ const { window: window$1 = defaultWindow } = options;
890
+ return useStorage(key, initialValue, window$1 === null || window$1 === void 0 ? void 0 : window$1.localStorage, options);
891
+ }
892
+ function getDefaultScheduler$5(options) {
893
+ if ("interval" in options || "immediate" in options) {
894
+ const { interval = "requestAnimationFrame", immediate = true } = options;
895
+ return interval === "requestAnimationFrame" ? (fn) => useRafFn(fn, { immediate }) : (fn) => useIntervalFn(fn, interval, options);
896
+ }
897
+ return useRafFn;
898
+ }
899
+ /**
900
+ * Reactive current Date instance.
901
+ *
902
+ * @see https://vueuse.org/useNow
903
+ * @param options
904
+ *
905
+ * @__NO_SIDE_EFFECTS__
906
+ */
907
+ function useNow(options = {}) {
908
+ const { controls: exposeControls = false, scheduler = getDefaultScheduler$5(options) } = options;
909
+ const now = ref(/* @__PURE__ */ new Date());
910
+ const update = () => now.value = /* @__PURE__ */ new Date();
911
+ const controls = scheduler(update);
912
+ if (exposeControls) return {
913
+ now,
914
+ ...controls
915
+ };
916
+ else return now;
917
+ }
918
+ const topVarName = "--vueuse-safe-area-top";
919
+ const rightVarName = "--vueuse-safe-area-right";
920
+ const bottomVarName = "--vueuse-safe-area-bottom";
921
+ const leftVarName = "--vueuse-safe-area-left";
922
+ /**
923
+ * Reactive `env(safe-area-inset-*)`
924
+ *
925
+ * @see https://vueuse.org/useScreenSafeArea
926
+ */
927
+ function useScreenSafeArea() {
928
+ const top = shallowRef("");
929
+ const right = shallowRef("");
930
+ const bottom = shallowRef("");
931
+ const left = shallowRef("");
932
+ if (isClient) {
933
+ const topCssVar = useCssVar(topVarName);
934
+ const rightCssVar = useCssVar(rightVarName);
935
+ const bottomCssVar = useCssVar(bottomVarName);
936
+ const leftCssVar = useCssVar(leftVarName);
937
+ topCssVar.value = "env(safe-area-inset-top, 0px)";
938
+ rightCssVar.value = "env(safe-area-inset-right, 0px)";
939
+ bottomCssVar.value = "env(safe-area-inset-bottom, 0px)";
940
+ leftCssVar.value = "env(safe-area-inset-left, 0px)";
941
+ tryOnMounted(update);
942
+ useEventListener("resize", useDebounceFn(update), { passive: true });
943
+ }
944
+ function update() {
945
+ top.value = getValue(topVarName);
946
+ right.value = getValue(rightVarName);
947
+ bottom.value = getValue(bottomVarName);
948
+ left.value = getValue(leftVarName);
949
+ }
950
+ return {
951
+ top,
952
+ right,
953
+ bottom,
954
+ left,
955
+ update
956
+ };
957
+ }
958
+ function getValue(position) {
959
+ return getComputedStyle(document.documentElement).getPropertyValue(position);
960
+ }
961
+ const DEFAULT_UNITS = [
962
+ {
963
+ max: 6e4,
964
+ value: 1e3,
965
+ name: "second"
966
+ },
967
+ {
968
+ max: 276e4,
969
+ value: 6e4,
970
+ name: "minute"
971
+ },
972
+ {
973
+ max: 72e6,
974
+ value: 36e5,
975
+ name: "hour"
976
+ },
977
+ {
978
+ max: 5184e5,
979
+ value: 864e5,
980
+ name: "day"
981
+ },
982
+ {
983
+ max: 24192e5,
984
+ value: 6048e5,
985
+ name: "week"
986
+ },
987
+ {
988
+ max: 28512e6,
989
+ value: 2592e6,
990
+ name: "month"
991
+ },
992
+ {
993
+ max: Number.POSITIVE_INFINITY,
994
+ value: 31536e6,
995
+ name: "year"
996
+ }
997
+ ];
998
+ const DEFAULT_MESSAGES = {
999
+ justNow: "just now",
1000
+ past: (n) => n.match(/\d/) ? `${n} ago` : n,
1001
+ future: (n) => n.match(/\d/) ? `in ${n}` : n,
1002
+ month: (n, past) => n === 1 ? past ? "last month" : "next month" : `${n} month${n > 1 ? "s" : ""}`,
1003
+ year: (n, past) => n === 1 ? past ? "last year" : "next year" : `${n} year${n > 1 ? "s" : ""}`,
1004
+ day: (n, past) => n === 1 ? past ? "yesterday" : "tomorrow" : `${n} day${n > 1 ? "s" : ""}`,
1005
+ week: (n, past) => n === 1 ? past ? "last week" : "next week" : `${n} week${n > 1 ? "s" : ""}`,
1006
+ hour: (n) => `${n} hour${n > 1 ? "s" : ""}`,
1007
+ minute: (n) => `${n} minute${n > 1 ? "s" : ""}`,
1008
+ second: (n) => `${n} second${n > 1 ? "s" : ""}`,
1009
+ invalid: ""
1010
+ };
1011
+ function DEFAULT_FORMATTER(date) {
1012
+ return date.toISOString().slice(0, 10);
1013
+ }
1014
+ function getDefaultScheduler$4(options) {
1015
+ if ("updateInterval" in options) {
1016
+ const { updateInterval = 3e4 } = options;
1017
+ return (cb) => useIntervalFn(cb, updateInterval);
1018
+ }
1019
+ return (cb) => useIntervalFn(cb, 3e4);
1020
+ }
1021
+ /**
1022
+ * Reactive time ago formatter.
1023
+ *
1024
+ * @see https://vueuse.org/useTimeAgo
1025
+ *
1026
+ * @__NO_SIDE_EFFECTS__
1027
+ */
1028
+ function useTimeAgo(time, options = {}) {
1029
+ const { controls: exposeControls = false, scheduler = getDefaultScheduler$4(options) } = options;
1030
+ const { now, ...controls } = useNow({
1031
+ scheduler,
1032
+ controls: true
1033
+ });
1034
+ const timeAgo = computed(() => formatTimeAgo(new Date(toValue(time)), options, toValue(now)));
1035
+ if (exposeControls) return {
1036
+ timeAgo,
1037
+ ...controls
1038
+ };
1039
+ else return timeAgo;
1040
+ }
1041
+ function formatTimeAgo(from, options = {}, now = Date.now()) {
1042
+ const { max, messages = DEFAULT_MESSAGES, fullDateFormatter = DEFAULT_FORMATTER, units = DEFAULT_UNITS, showSecond = false, rounding = "round" } = options;
1043
+ const roundFn = typeof rounding === "number" ? (n) => +n.toFixed(rounding) : Math[rounding];
1044
+ const diff = +now - +from;
1045
+ const absDiff = Math.abs(diff);
1046
+ function getValue$1(diff$1, unit) {
1047
+ return roundFn(Math.abs(diff$1) / unit.value);
1048
+ }
1049
+ function format(diff$1, unit) {
1050
+ const val = getValue$1(diff$1, unit);
1051
+ const past = diff$1 > 0;
1052
+ const str = applyFormat(unit.name, val, past);
1053
+ return applyFormat(past ? "past" : "future", str, past);
1054
+ }
1055
+ function applyFormat(name, val, isPast) {
1056
+ const formatter = messages[name];
1057
+ if (typeof formatter === "function") return formatter(val, isPast);
1058
+ return formatter.replace("{0}", val.toString());
1059
+ }
1060
+ if (absDiff < 6e4 && !showSecond) return messages.justNow;
1061
+ if (typeof max === "number" && absDiff > max) return fullDateFormatter(new Date(from));
1062
+ if (typeof max === "string") {
1063
+ var _units$find;
1064
+ const unitMax = (_units$find = units.find((i) => i.name === max)) === null || _units$find === void 0 ? void 0 : _units$find.max;
1065
+ if (unitMax && absDiff > unitMax) return fullDateFormatter(new Date(from));
1066
+ }
1067
+ for (const [idx, unit] of units.entries()) {
1068
+ if (getValue$1(diff, unit) <= 0 && units[idx - 1]) return format(diff, units[idx - 1]);
1069
+ if (absDiff < unit.max) return format(diff, unit);
1070
+ }
1071
+ return messages.invalid;
1072
+ }
1073
+ /**
1074
+ * Reactive window size.
1075
+ *
1076
+ * @see https://vueuse.org/useWindowSize
1077
+ * @param options
1078
+ *
1079
+ * @__NO_SIDE_EFFECTS__
1080
+ */
1081
+ function useWindowSize(options = {}) {
1082
+ const { window: window$1 = defaultWindow, initialWidth = Number.POSITIVE_INFINITY, initialHeight = Number.POSITIVE_INFINITY, listenOrientation = true, includeScrollbar = true, type = "inner" } = options;
1083
+ const width = shallowRef(initialWidth);
1084
+ const height = shallowRef(initialHeight);
1085
+ const update = () => {
1086
+ if (window$1) if (type === "outer") {
1087
+ width.value = window$1.outerWidth;
1088
+ height.value = window$1.outerHeight;
1089
+ } else if (type === "visual" && window$1.visualViewport) {
1090
+ const { width: visualViewportWidth, height: visualViewportHeight, scale } = window$1.visualViewport;
1091
+ width.value = Math.round(visualViewportWidth * scale);
1092
+ height.value = Math.round(visualViewportHeight * scale);
1093
+ } else if (includeScrollbar) {
1094
+ width.value = window$1.innerWidth;
1095
+ height.value = window$1.innerHeight;
1096
+ } else {
1097
+ width.value = window$1.document.documentElement.clientWidth;
1098
+ height.value = window$1.document.documentElement.clientHeight;
1099
+ }
1100
+ };
1101
+ update();
1102
+ tryOnMounted(update);
1103
+ const listenerOptions = { passive: true };
1104
+ useEventListener("resize", update, listenerOptions);
1105
+ if (window$1 && type === "visual" && window$1.visualViewport) useEventListener(window$1.visualViewport, "resize", update, listenerOptions);
1106
+ if (listenOrientation) watch(useMediaQuery("(orientation: portrait)"), () => update());
1107
+ return {
1108
+ width,
1109
+ height
1110
+ };
1111
+ }
1112
+ //#endregion
1113
+ export { useScreenSafeArea as a, useDebounceFn as c, useLocalStorage as i, watchDebounced as l, useElementBounding as n, useTimeAgo as o, useEventListener as r, useWindowSize as s, onClickOutside as t, watchImmediate as u };