@vueuse/integrations 12.5.0 → 12.7.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.
Files changed (55) hide show
  1. package/index.cjs +42 -42
  2. package/index.d.cts +1 -1
  3. package/index.d.mts +1 -1
  4. package/index.d.ts +1 -1
  5. package/index.iife.js +42 -42
  6. package/index.iife.min.js +1 -1
  7. package/index.mjs +43 -43
  8. package/package.json +5 -5
  9. package/useAsyncValidator/component.cjs +1 -1
  10. package/useAsyncValidator/component.mjs +1 -1
  11. package/useAsyncValidator.cjs +3 -3
  12. package/useAsyncValidator.iife.js +3 -3
  13. package/useAsyncValidator.iife.min.js +1 -1
  14. package/useAsyncValidator.mjs +3 -3
  15. package/useAxios.cjs +8 -8
  16. package/useAxios.iife.js +8 -8
  17. package/useAxios.iife.min.js +1 -1
  18. package/useAxios.mjs +8 -8
  19. package/useCookies.cjs +1 -1
  20. package/useCookies.iife.js +1 -1
  21. package/useCookies.iife.min.js +1 -1
  22. package/useCookies.mjs +2 -2
  23. package/useDrauu.cjs +13 -13
  24. package/useDrauu.iife.js +13 -13
  25. package/useDrauu.iife.min.js +1 -1
  26. package/useDrauu.mjs +14 -14
  27. package/useFocusTrap.cjs +2 -2
  28. package/useFocusTrap.iife.js +2 -2
  29. package/useFocusTrap.iife.min.js +1 -1
  30. package/useFocusTrap.mjs +3 -3
  31. package/useFuse.cjs +5 -5
  32. package/useFuse.iife.js +5 -5
  33. package/useFuse.iife.min.js +1 -1
  34. package/useFuse.mjs +5 -5
  35. package/useIDBKeyval.cjs +1 -1
  36. package/useIDBKeyval.iife.js +1 -1
  37. package/useIDBKeyval.iife.min.js +1 -1
  38. package/useIDBKeyval.mjs +2 -2
  39. package/useJwt.cjs +1 -1
  40. package/useJwt.iife.js +1 -1
  41. package/useJwt.iife.min.js +1 -1
  42. package/useJwt.mjs +1 -1
  43. package/useQRCode.cjs +1 -1
  44. package/useQRCode.d.cts +1 -1
  45. package/useQRCode.d.mts +1 -1
  46. package/useQRCode.d.ts +1 -1
  47. package/useQRCode.iife.js +1 -1
  48. package/useQRCode.iife.min.js +1 -1
  49. package/useQRCode.mjs +2 -2
  50. package/useSortable/component.cjs +3 -3
  51. package/useSortable/component.mjs +4 -4
  52. package/useSortable.cjs +7 -7
  53. package/useSortable.iife.js +7 -7
  54. package/useSortable.iife.min.js +1 -1
  55. package/useSortable.mjs +8 -8
package/index.cjs CHANGED
@@ -44,15 +44,15 @@ function useAsyncValidator(value, rules, options = {}) {
44
44
  } = options;
45
45
  const valueRef = shared.toRef(value);
46
46
  const errorInfo = vue.shallowRef(null);
47
- const isFinished = vue.ref(true);
47
+ const isFinished = vue.shallowRef(true);
48
48
  const pass = vue.ref(!immediate || manual);
49
49
  const errors = vue.computed(() => {
50
50
  var _a;
51
- return ((_a = errorInfo.value) == null ? undefined : _a.errors) || [];
51
+ return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
52
52
  });
53
53
  const errorFields = vue.computed(() => {
54
54
  var _a;
55
- return ((_a = errorInfo.value) == null ? undefined : _a.fields) || {};
55
+ return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
56
56
  });
57
57
  const validator = vue.computed(() => new AsyncValidatorSchema(vue.toValue(rules)));
58
58
  const execute = async () => {
@@ -103,7 +103,7 @@ function useAsyncValidator(value, rules, options = {}) {
103
103
  }
104
104
 
105
105
  function useAxios(...args) {
106
- const url = typeof args[0] === "string" ? args[0] : undefined;
106
+ const url = typeof args[0] === "string" ? args[0] : void 0;
107
107
  const argsPlaceholder = typeof url === "string" ? 1 : 0;
108
108
  const defaultOptions = {
109
109
  immediate: !!argsPlaceholder,
@@ -113,7 +113,7 @@ function useAxios(...args) {
113
113
  let defaultConfig = {};
114
114
  let instance = axios;
115
115
  let options = defaultOptions;
116
- const isAxiosInstance = (val) => !!(val == null ? undefined : val.request);
116
+ const isAxiosInstance = (val) => !!(val == null ? void 0 : val.request);
117
117
  if (args.length > 0 + argsPlaceholder) {
118
118
  if (isAxiosInstance(args[0 + argsPlaceholder]))
119
119
  instance = args[0 + argsPlaceholder];
@@ -137,9 +137,9 @@ function useAxios(...args) {
137
137
  const initialData = options.initialData;
138
138
  const response = vue.shallowRef();
139
139
  const data = (shallow ? vue.shallowRef : vue.ref)(initialData);
140
- const isFinished = vue.ref(false);
141
- const isLoading = vue.ref(false);
142
- const isAborted = vue.ref(false);
140
+ const isFinished = vue.shallowRef(false);
141
+ const isLoading = vue.shallowRef(false);
142
+ const isAborted = vue.shallowRef(false);
143
143
  const error = vue.shallowRef();
144
144
  let abortController = new AbortController();
145
145
  const abort = (message) => {
@@ -168,9 +168,9 @@ function useAxios(...args) {
168
168
  };
169
169
  let executeCounter = 0;
170
170
  const execute = (executeUrl = url, config = {}) => {
171
- error.value = undefined;
171
+ error.value = void 0;
172
172
  const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
173
- if (_url === undefined) {
173
+ if (_url === void 0) {
174
174
  error.value = new axios.AxiosError(axios.AxiosError.ERR_INVALID_URL);
175
175
  isFinished.value = true;
176
176
  return promise;
@@ -194,7 +194,7 @@ function useAxios(...args) {
194
194
  onError(e);
195
195
  }).finally(() => {
196
196
  var _a;
197
- (_a = options.onFinish) == null ? undefined : _a.call(options);
197
+ (_a = options.onFinish) == null ? void 0 : _a.call(options);
198
198
  if (currentExecuteCounter === executeCounter)
199
199
  loading(false);
200
200
  });
@@ -251,7 +251,7 @@ function createCookies(req) {
251
251
  function useCookies(dependencies, { doNotParse = false, autoUpdateDependencies = false } = {}, cookies = new Cookie()) {
252
252
  const watchingDependencies = autoUpdateDependencies ? [...dependencies || []] : dependencies;
253
253
  let previousCookies = cookies.getAll({ doNotParse: true });
254
- const touches = vue.ref(0);
254
+ const touches = vue.shallowRef(0);
255
255
  const onChange = () => {
256
256
  const newCookies = cookies.getAll({ doNotParse: true });
257
257
  if (shouldUpdate(
@@ -308,19 +308,19 @@ function useDrauu(target, options) {
308
308
  const onCommittedHook = core.createEventHook();
309
309
  const onStartHook = core.createEventHook();
310
310
  const onEndHook = core.createEventHook();
311
- const canUndo = vue.ref(false);
312
- const canRedo = vue.ref(false);
313
- const altPressed = vue.ref(false);
314
- const shiftPressed = vue.ref(false);
311
+ const canUndo = vue.shallowRef(false);
312
+ const canRedo = vue.shallowRef(false);
313
+ const altPressed = vue.shallowRef(false);
314
+ const shiftPressed = vue.shallowRef(false);
315
315
  const brush = vue.ref({
316
316
  color: "black",
317
317
  size: 3,
318
318
  arrowEnd: false,
319
319
  cornerRadius: 0,
320
- dasharray: undefined,
320
+ dasharray: void 0,
321
321
  fill: "transparent",
322
322
  mode: "draw",
323
- ...options == null ? undefined : options.brush
323
+ ...options == null ? void 0 : options.brush
324
324
  });
325
325
  vue.watch(brush, () => {
326
326
  const instance = drauuInstance.value;
@@ -331,32 +331,32 @@ function useDrauu(target, options) {
331
331
  }, { deep: true });
332
332
  const undo = () => {
333
333
  var _a;
334
- return (_a = drauuInstance.value) == null ? undefined : _a.undo();
334
+ return (_a = drauuInstance.value) == null ? void 0 : _a.undo();
335
335
  };
336
336
  const redo = () => {
337
337
  var _a;
338
- return (_a = drauuInstance.value) == null ? undefined : _a.redo();
338
+ return (_a = drauuInstance.value) == null ? void 0 : _a.redo();
339
339
  };
340
340
  const clear = () => {
341
341
  var _a;
342
- return (_a = drauuInstance.value) == null ? undefined : _a.clear();
342
+ return (_a = drauuInstance.value) == null ? void 0 : _a.clear();
343
343
  };
344
344
  const cancel = () => {
345
345
  var _a;
346
- return (_a = drauuInstance.value) == null ? undefined : _a.cancel();
346
+ return (_a = drauuInstance.value) == null ? void 0 : _a.cancel();
347
347
  };
348
348
  const load = (svg) => {
349
349
  var _a;
350
- return (_a = drauuInstance.value) == null ? undefined : _a.load(svg);
350
+ return (_a = drauuInstance.value) == null ? void 0 : _a.load(svg);
351
351
  };
352
352
  const dump = () => {
353
353
  var _a;
354
- return (_a = drauuInstance.value) == null ? undefined : _a.dump();
354
+ return (_a = drauuInstance.value) == null ? void 0 : _a.dump();
355
355
  };
356
356
  const cleanup = () => {
357
357
  var _a;
358
358
  disposables.forEach((dispose) => dispose());
359
- (_a = drauuInstance.value) == null ? undefined : _a.unmount();
359
+ (_a = drauuInstance.value) == null ? void 0 : _a.unmount();
360
360
  };
361
361
  const syncStatus = () => {
362
362
  if (drauuInstance.value) {
@@ -411,8 +411,8 @@ function useDrauu(target, options) {
411
411
  function useFocusTrap(target, options = {}) {
412
412
  let trap;
413
413
  const { immediate, ...focusTrapOptions } = options;
414
- const hasFocus = vue.ref(false);
415
- const isPaused = vue.ref(false);
414
+ const hasFocus = vue.shallowRef(false);
415
+ const isPaused = vue.shallowRef(false);
416
416
  const activate = (opts) => trap && trap.activate(opts);
417
417
  const deactivate = (opts) => trap && trap.deactivate(opts);
418
418
  const pause = () => {
@@ -473,14 +473,14 @@ function useFuse(search, data, options) {
473
473
  var _a, _b;
474
474
  return new Fuse(
475
475
  (_a = vue.toValue(data)) != null ? _a : [],
476
- (_b = vue.toValue(options)) == null ? undefined : _b.fuseOptions
476
+ (_b = vue.toValue(options)) == null ? void 0 : _b.fuseOptions
477
477
  );
478
478
  };
479
479
  const fuse = vue.ref(createFuse());
480
480
  vue.watch(
481
481
  () => {
482
482
  var _a;
483
- return (_a = vue.toValue(options)) == null ? undefined : _a.fuseOptions;
483
+ return (_a = vue.toValue(options)) == null ? void 0 : _a.fuseOptions;
484
484
  },
485
485
  () => {
486
486
  fuse.value = createFuse();
@@ -496,10 +496,10 @@ function useFuse(search, data, options) {
496
496
  );
497
497
  const results = vue.computed(() => {
498
498
  const resolved = vue.toValue(options);
499
- if ((resolved == null ? undefined : resolved.matchAllWhenSearchEmpty) && !vue.toValue(search))
499
+ if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !vue.toValue(search))
500
500
  return vue.toValue(data).map((item, index) => ({ item, refIndex: index }));
501
- const limit = resolved == null ? undefined : resolved.resultLimit;
502
- return fuse.value.search(vue.toValue(search), limit ? { limit } : undefined);
501
+ const limit = resolved == null ? void 0 : resolved.resultLimit;
502
+ return fuse.value.search(vue.toValue(search), limit ? { limit } : void 0);
503
503
  });
504
504
  return {
505
505
  fuse,
@@ -517,7 +517,7 @@ function useIDBKeyval(key, initialValue, options = {}) {
517
517
  },
518
518
  writeDefaults = true
519
519
  } = options;
520
- const isFinished = vue.ref(false);
520
+ const isFinished = vue.shallowRef(false);
521
521
  const data = (shallow ? vue.shallowRef : vue.ref)(initialValue);
522
522
  const rawInit = vue.toValue(initialValue);
523
523
  async function read() {
@@ -572,7 +572,7 @@ function useJwt(encodedJwt, options = {}) {
572
572
  try {
573
573
  return jwtDecode.jwtDecode(encodedJwt2, options2);
574
574
  } catch (err) {
575
- onError == null ? undefined : onError(err);
575
+ onError == null ? void 0 : onError(err);
576
576
  return fallbackValue;
577
577
  }
578
578
  };
@@ -616,7 +616,7 @@ function useNProgress(currentProgress = null, options) {
616
616
 
617
617
  function useQRCode(text, options) {
618
618
  const src = shared.toRef(text);
619
- const result = vue.ref("");
619
+ const result = vue.shallowRef("");
620
620
  vue.watch(
621
621
  src,
622
622
  async (value) => {
@@ -637,20 +637,20 @@ function useSortable(el, list, options = {}) {
637
637
  }
638
638
  };
639
639
  const start = () => {
640
- const target = typeof el === "string" ? document == null ? undefined : document.querySelector(el) : core.unrefElement(el);
641
- if (!target || sortable !== undefined)
640
+ const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : core.unrefElement(el);
641
+ if (!target || sortable !== void 0)
642
642
  return;
643
643
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
644
644
  };
645
645
  const stop = () => {
646
- sortable == null ? undefined : sortable.destroy();
647
- sortable = undefined;
646
+ sortable == null ? void 0 : sortable.destroy();
647
+ sortable = void 0;
648
648
  };
649
649
  const option = (name, value) => {
650
- if (value !== undefined)
651
- sortable == null ? undefined : sortable.option(name, value);
650
+ if (value !== void 0)
651
+ sortable == null ? void 0 : sortable.option(name, value);
652
652
  else
653
- return sortable == null ? undefined : sortable.option(name);
653
+ return sortable == null ? void 0 : sortable.option(name);
654
654
  };
655
655
  core.tryOnMounted(start);
656
656
  core.tryOnScopeDispose(stop);
package/index.d.cts CHANGED
@@ -407,7 +407,7 @@ type UseNProgressReturn = ReturnType<typeof useNProgress>;
407
407
  * @param text
408
408
  * @param options
409
409
  */
410
- declare function useQRCode(text: MaybeRefOrGetter<string>, options?: QRCode.QRCodeToDataURLOptions): vue.Ref<string, string>;
410
+ declare function useQRCode(text: MaybeRefOrGetter<string>, options?: QRCode.QRCodeToDataURLOptions): vue.ShallowRef<string, string>;
411
411
 
412
412
  interface UseSortableReturn {
413
413
  /**
package/index.d.mts CHANGED
@@ -407,7 +407,7 @@ type UseNProgressReturn = ReturnType<typeof useNProgress>;
407
407
  * @param text
408
408
  * @param options
409
409
  */
410
- declare function useQRCode(text: MaybeRefOrGetter<string>, options?: QRCode.QRCodeToDataURLOptions): vue.Ref<string, string>;
410
+ declare function useQRCode(text: MaybeRefOrGetter<string>, options?: QRCode.QRCodeToDataURLOptions): vue.ShallowRef<string, string>;
411
411
 
412
412
  interface UseSortableReturn {
413
413
  /**
package/index.d.ts CHANGED
@@ -407,7 +407,7 @@ type UseNProgressReturn = ReturnType<typeof useNProgress>;
407
407
  * @param text
408
408
  * @param options
409
409
  */
410
- declare function useQRCode(text: MaybeRefOrGetter<string>, options?: QRCode.QRCodeToDataURLOptions): vue.Ref<string, string>;
410
+ declare function useQRCode(text: MaybeRefOrGetter<string>, options?: QRCode.QRCodeToDataURLOptions): vue.ShallowRef<string, string>;
411
411
 
412
412
  interface UseSortableReturn {
413
413
  /**
package/index.iife.js CHANGED
@@ -29,15 +29,15 @@
29
29
  } = options;
30
30
  const valueRef = shared.toRef(value);
31
31
  const errorInfo = vue.shallowRef(null);
32
- const isFinished = vue.ref(true);
32
+ const isFinished = vue.shallowRef(true);
33
33
  const pass = vue.ref(!immediate || manual);
34
34
  const errors = vue.computed(() => {
35
35
  var _a;
36
- return ((_a = errorInfo.value) == null ? undefined : _a.errors) || [];
36
+ return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
37
37
  });
38
38
  const errorFields = vue.computed(() => {
39
39
  var _a;
40
- return ((_a = errorInfo.value) == null ? undefined : _a.fields) || {};
40
+ return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
41
41
  });
42
42
  const validator = vue.computed(() => new AsyncValidatorSchema(vue.toValue(rules)));
43
43
  const execute = async () => {
@@ -88,7 +88,7 @@
88
88
  }
89
89
 
90
90
  function useAxios(...args) {
91
- const url = typeof args[0] === "string" ? args[0] : undefined;
91
+ const url = typeof args[0] === "string" ? args[0] : void 0;
92
92
  const argsPlaceholder = typeof url === "string" ? 1 : 0;
93
93
  const defaultOptions = {
94
94
  immediate: !!argsPlaceholder,
@@ -98,7 +98,7 @@
98
98
  let defaultConfig = {};
99
99
  let instance = axios;
100
100
  let options = defaultOptions;
101
- const isAxiosInstance = (val) => !!(val == null ? undefined : val.request);
101
+ const isAxiosInstance = (val) => !!(val == null ? void 0 : val.request);
102
102
  if (args.length > 0 + argsPlaceholder) {
103
103
  if (isAxiosInstance(args[0 + argsPlaceholder]))
104
104
  instance = args[0 + argsPlaceholder];
@@ -122,9 +122,9 @@
122
122
  const initialData = options.initialData;
123
123
  const response = vue.shallowRef();
124
124
  const data = (shallow ? vue.shallowRef : vue.ref)(initialData);
125
- const isFinished = vue.ref(false);
126
- const isLoading = vue.ref(false);
127
- const isAborted = vue.ref(false);
125
+ const isFinished = vue.shallowRef(false);
126
+ const isLoading = vue.shallowRef(false);
127
+ const isAborted = vue.shallowRef(false);
128
128
  const error = vue.shallowRef();
129
129
  let abortController = new AbortController();
130
130
  const abort = (message) => {
@@ -153,9 +153,9 @@
153
153
  };
154
154
  let executeCounter = 0;
155
155
  const execute = (executeUrl = url, config = {}) => {
156
- error.value = undefined;
156
+ error.value = void 0;
157
157
  const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
158
- if (_url === undefined) {
158
+ if (_url === void 0) {
159
159
  error.value = new axios.AxiosError(axios.AxiosError.ERR_INVALID_URL);
160
160
  isFinished.value = true;
161
161
  return promise;
@@ -179,7 +179,7 @@
179
179
  onError(e);
180
180
  }).finally(() => {
181
181
  var _a;
182
- (_a = options.onFinish) == null ? undefined : _a.call(options);
182
+ (_a = options.onFinish) == null ? void 0 : _a.call(options);
183
183
  if (currentExecuteCounter === executeCounter)
184
184
  loading(false);
185
185
  });
@@ -236,7 +236,7 @@
236
236
  function useCookies(dependencies, { doNotParse = false, autoUpdateDependencies = false } = {}, cookies = new Cookie()) {
237
237
  const watchingDependencies = autoUpdateDependencies ? [...dependencies || []] : dependencies;
238
238
  let previousCookies = cookies.getAll({ doNotParse: true });
239
- const touches = vue.ref(0);
239
+ const touches = vue.shallowRef(0);
240
240
  const onChange = () => {
241
241
  const newCookies = cookies.getAll({ doNotParse: true });
242
242
  if (shouldUpdate(
@@ -293,19 +293,19 @@
293
293
  const onCommittedHook = core.createEventHook();
294
294
  const onStartHook = core.createEventHook();
295
295
  const onEndHook = core.createEventHook();
296
- const canUndo = vue.ref(false);
297
- const canRedo = vue.ref(false);
298
- const altPressed = vue.ref(false);
299
- const shiftPressed = vue.ref(false);
296
+ const canUndo = vue.shallowRef(false);
297
+ const canRedo = vue.shallowRef(false);
298
+ const altPressed = vue.shallowRef(false);
299
+ const shiftPressed = vue.shallowRef(false);
300
300
  const brush = vue.ref({
301
301
  color: "black",
302
302
  size: 3,
303
303
  arrowEnd: false,
304
304
  cornerRadius: 0,
305
- dasharray: undefined,
305
+ dasharray: void 0,
306
306
  fill: "transparent",
307
307
  mode: "draw",
308
- ...options == null ? undefined : options.brush
308
+ ...options == null ? void 0 : options.brush
309
309
  });
310
310
  vue.watch(brush, () => {
311
311
  const instance = drauuInstance.value;
@@ -316,32 +316,32 @@
316
316
  }, { deep: true });
317
317
  const undo = () => {
318
318
  var _a;
319
- return (_a = drauuInstance.value) == null ? undefined : _a.undo();
319
+ return (_a = drauuInstance.value) == null ? void 0 : _a.undo();
320
320
  };
321
321
  const redo = () => {
322
322
  var _a;
323
- return (_a = drauuInstance.value) == null ? undefined : _a.redo();
323
+ return (_a = drauuInstance.value) == null ? void 0 : _a.redo();
324
324
  };
325
325
  const clear = () => {
326
326
  var _a;
327
- return (_a = drauuInstance.value) == null ? undefined : _a.clear();
327
+ return (_a = drauuInstance.value) == null ? void 0 : _a.clear();
328
328
  };
329
329
  const cancel = () => {
330
330
  var _a;
331
- return (_a = drauuInstance.value) == null ? undefined : _a.cancel();
331
+ return (_a = drauuInstance.value) == null ? void 0 : _a.cancel();
332
332
  };
333
333
  const load = (svg) => {
334
334
  var _a;
335
- return (_a = drauuInstance.value) == null ? undefined : _a.load(svg);
335
+ return (_a = drauuInstance.value) == null ? void 0 : _a.load(svg);
336
336
  };
337
337
  const dump = () => {
338
338
  var _a;
339
- return (_a = drauuInstance.value) == null ? undefined : _a.dump();
339
+ return (_a = drauuInstance.value) == null ? void 0 : _a.dump();
340
340
  };
341
341
  const cleanup = () => {
342
342
  var _a;
343
343
  disposables.forEach((dispose) => dispose());
344
- (_a = drauuInstance.value) == null ? undefined : _a.unmount();
344
+ (_a = drauuInstance.value) == null ? void 0 : _a.unmount();
345
345
  };
346
346
  const syncStatus = () => {
347
347
  if (drauuInstance.value) {
@@ -396,8 +396,8 @@
396
396
  function useFocusTrap(target, options = {}) {
397
397
  let trap;
398
398
  const { immediate, ...focusTrapOptions } = options;
399
- const hasFocus = vue.ref(false);
400
- const isPaused = vue.ref(false);
399
+ const hasFocus = vue.shallowRef(false);
400
+ const isPaused = vue.shallowRef(false);
401
401
  const activate = (opts) => trap && trap.activate(opts);
402
402
  const deactivate = (opts) => trap && trap.deactivate(opts);
403
403
  const pause = () => {
@@ -458,14 +458,14 @@
458
458
  var _a, _b;
459
459
  return new Fuse(
460
460
  (_a = vue.toValue(data)) != null ? _a : [],
461
- (_b = vue.toValue(options)) == null ? undefined : _b.fuseOptions
461
+ (_b = vue.toValue(options)) == null ? void 0 : _b.fuseOptions
462
462
  );
463
463
  };
464
464
  const fuse = vue.ref(createFuse());
465
465
  vue.watch(
466
466
  () => {
467
467
  var _a;
468
- return (_a = vue.toValue(options)) == null ? undefined : _a.fuseOptions;
468
+ return (_a = vue.toValue(options)) == null ? void 0 : _a.fuseOptions;
469
469
  },
470
470
  () => {
471
471
  fuse.value = createFuse();
@@ -481,10 +481,10 @@
481
481
  );
482
482
  const results = vue.computed(() => {
483
483
  const resolved = vue.toValue(options);
484
- if ((resolved == null ? undefined : resolved.matchAllWhenSearchEmpty) && !vue.toValue(search))
484
+ if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !vue.toValue(search))
485
485
  return vue.toValue(data).map((item, index) => ({ item, refIndex: index }));
486
- const limit = resolved == null ? undefined : resolved.resultLimit;
487
- return fuse.value.search(vue.toValue(search), limit ? { limit } : undefined);
486
+ const limit = resolved == null ? void 0 : resolved.resultLimit;
487
+ return fuse.value.search(vue.toValue(search), limit ? { limit } : void 0);
488
488
  });
489
489
  return {
490
490
  fuse,
@@ -502,7 +502,7 @@
502
502
  },
503
503
  writeDefaults = true
504
504
  } = options;
505
- const isFinished = vue.ref(false);
505
+ const isFinished = vue.shallowRef(false);
506
506
  const data = (shallow ? vue.shallowRef : vue.ref)(initialValue);
507
507
  const rawInit = vue.toValue(initialValue);
508
508
  async function read() {
@@ -557,7 +557,7 @@
557
557
  try {
558
558
  return jwtDecode.jwtDecode(encodedJwt2, options2);
559
559
  } catch (err) {
560
- onError == null ? undefined : onError(err);
560
+ onError == null ? void 0 : onError(err);
561
561
  return fallbackValue;
562
562
  }
563
563
  };
@@ -601,7 +601,7 @@
601
601
 
602
602
  function useQRCode(text, options) {
603
603
  const src = shared.toRef(text);
604
- const result = vue.ref("");
604
+ const result = vue.shallowRef("");
605
605
  vue.watch(
606
606
  src,
607
607
  async (value) => {
@@ -622,20 +622,20 @@
622
622
  }
623
623
  };
624
624
  const start = () => {
625
- const target = typeof el === "string" ? document == null ? undefined : document.querySelector(el) : core.unrefElement(el);
626
- if (!target || sortable !== undefined)
625
+ const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : core.unrefElement(el);
626
+ if (!target || sortable !== void 0)
627
627
  return;
628
628
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
629
629
  };
630
630
  const stop = () => {
631
- sortable == null ? undefined : sortable.destroy();
632
- sortable = undefined;
631
+ sortable == null ? void 0 : sortable.destroy();
632
+ sortable = void 0;
633
633
  };
634
634
  const option = (name, value) => {
635
- if (value !== undefined)
636
- sortable == null ? undefined : sortable.option(name, value);
635
+ if (value !== void 0)
636
+ sortable == null ? void 0 : sortable.option(name, value);
637
637
  else
638
- return sortable == null ? undefined : sortable.option(name);
638
+ return sortable == null ? void 0 : sortable.option(name);
639
639
  };
640
640
  core.tryOnMounted(start);
641
641
  core.tryOnScopeDispose(stop);
package/index.iife.min.js CHANGED
@@ -1 +1 @@
1
- (function(p,C,U,n,L,$,k,w,K,X,Y,P,Z,b,x,ee){"use strict";function te(t){var l=Object.create(null);return t&&Object.keys(t).forEach(function(e){if(e!=="default"){var a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(l,e,a.get?a:{enumerable:!0,get:function(){return t[e]}})}}),l.default=t,Object.freeze(l)}var ne=te($);const ae=U.default||U;function le(t,l,e={}){const{validateOption:a={},immediate:u=!0,manual:r=!1}=e,o=C.toRef(t),c=n.shallowRef(null),s=n.ref(!0),d=n.ref(!u||r),h=n.computed(()=>{var i;return((i=c.value)==null?void 0:i.errors)||[]}),g=n.computed(()=>{var i;return((i=c.value)==null?void 0:i.fields)||{}}),m=n.computed(()=>new ae(n.toValue(l))),y=async()=>{s.value=!1,d.value=!1;try{await m.value.validate(o.value,a),d.value=!0,c.value=null}catch(i){c.value=i}finally{s.value=!0}return{pass:d.value,errorInfo:c.value,errors:h.value,errorFields:g.value}};r||n.watch([o,m],()=>y(),{immediate:u,deep:!0});const V={isFinished:s,pass:d,errors:h,errorInfo:c,errorFields:g,execute:y};function A(){return new Promise((i,E)=>{C.until(s).toBe(!0).then(()=>i(V)).catch(D=>E(D))})}return{...V,then(i,E){return A().then(i,E)}}}function oe(...t){const l=typeof t[0]=="string"?t[0]:void 0,e=typeof l=="string"?1:0,a={immediate:!!e,shallow:!0,abortPrevious:!0};let u={},r=L,o=a;const c=v=>!!v?.request;t.length>0+e&&(c(t[0+e])?r=t[0+e]:u=t[0+e]),t.length>1+e&&c(t[1+e])&&(r=t[1+e]),(t.length===2+e&&!c(t[1+e])||t.length===3+e)&&(o=t[t.length-1]||a);const{shallow:s,onSuccess:d=C.noop,onError:h=C.noop,immediate:g,resetOnExecute:m=!1}=o,y=o.initialData,V=n.shallowRef(),A=(s?n.shallowRef:n.ref)(y),i=n.ref(!1),E=n.ref(!1),D=n.ref(!1),R=n.shallowRef();let S=new AbortController;const F=v=>{i.value||!E.value||(S.abort(v),S=new AbortController,D.value=!0,E.value=!1,i.value=!1)},f=v=>{E.value=v,i.value=!v},_=()=>{m&&(A.value=y)},Q=()=>new Promise((v,I)=>{C.until(i).toBe(!0).then(()=>R.value?I(R.value):v(q))}),H={then:(...v)=>Q().then(...v),catch:(...v)=>Q().catch(...v)};let j=0;const z=(v=l,I={})=>{R.value=void 0;const J=typeof v=="string"?v:l??I.url;if(J===void 0)return R.value=new L.AxiosError(L.AxiosError.ERR_INVALID_URL),i.value=!0,H;_(),o.abortPrevious!==!1&&F(),f(!0),j+=1;const we=j;return D.value=!1,r(J,{...u,...typeof v=="object"?v:I,signal:S.signal}).then(O=>{if(D.value)return;V.value=O;const M=O.data;A.value=M,d(M)}).catch(O=>{R.value=O,h(O)}).finally(()=>{var O;(O=o.onFinish)==null||O.call(o),we===j&&f(!1)}),H};g&&l&&z();const q={response:V,data:A,error:R,isFinished:i,isLoading:E,cancel:F,isAborted:D,isCanceled:D,abort:F,execute:z};return{...q,...H}}const N=Object.entries(ne).filter(([t,l])=>typeof l=="function"&&t.endsWith("Case")).reduce((t,[l,e])=>(t[l]=e,t),{});function ue(t,l,e){const a=n.computed(()=>{const r=n.toValue(l);if(!N[r])throw new Error(`Invalid change case type "${r}"`);return r});if(typeof t=="function")return n.computed(()=>N[a.value](n.toValue(t),n.toValue(e)));const u=n.ref(t);return n.computed({get(){return N[a.value](u.value,n.toValue(e))},set(r){u.value=r}})}function re(t){const l=new k(t?t.headers.cookie:null);return(e,{doNotParse:a=!1,autoUpdateDependencies:u=!1}={})=>T(e,{doNotParse:a,autoUpdateDependencies:u},l)}function T(t,{doNotParse:l=!1,autoUpdateDependencies:e=!1}={},a=new k){const u=e?[...t||[]]:t;let r=a.getAll({doNotParse:!0});const o=n.ref(0),c=()=>{const s=a.getAll({doNotParse:!0});se(u||null,s,r)&&o.value++,r=s};return a.addChangeListener(c),C.tryOnScopeDispose(()=>{a.removeChangeListener(c)}),{get:(...s)=>(e&&u&&!u.includes(s[0])&&u.push(s[0]),o.value,a.get(s[0],{doNotParse:l,...s[1]})),getAll:(...s)=>(o.value,a.getAll({doNotParse:l,...s[0]})),set:(...s)=>a.set(...s),remove:(...s)=>a.remove(...s),addChangeListener:(...s)=>a.addChangeListener(...s),removeChangeListener:(...s)=>a.removeChangeListener(...s)}}function se(t,l,e){if(!t)return!0;for(const a of t)if(l[a]!==e[a])return!0;return!1}function ce(t,l){const e=n.ref();let a=[];const u=w.createEventHook(),r=w.createEventHook(),o=w.createEventHook(),c=w.createEventHook(),s=w.createEventHook(),d=n.ref(!1),h=n.ref(!1),g=n.ref(!1),m=n.ref(!1),y=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw",...l?.brush});n.watch(y,()=>{const f=e.value;f&&(f.brush=y.value,f.mode=y.value.mode)},{deep:!0});const V=()=>{var f;return(f=e.value)==null?void 0:f.undo()},A=()=>{var f;return(f=e.value)==null?void 0:f.redo()},i=()=>{var f;return(f=e.value)==null?void 0:f.clear()},E=()=>{var f;return(f=e.value)==null?void 0:f.cancel()},D=f=>{var _;return(_=e.value)==null?void 0:_.load(f)},R=()=>{var f;return(f=e.value)==null?void 0:f.dump()},S=()=>{var f;a.forEach(_=>_()),(f=e.value)==null||f.unmount()},F=()=>{e.value&&(d.value=e.value.canUndo(),h.value=e.value.canRedo(),g.value=e.value.altPressed,m.value=e.value.shiftPressed)};return n.watch(()=>w.unrefElement(t),f=>{!f||typeof SVGSVGElement>"u"||!(f instanceof SVGSVGElement)||(e.value&&S(),e.value=K.createDrauu({el:f,...l}),F(),a=[e.value.on("canceled",()=>r.trigger()),e.value.on("committed",_=>o.trigger(_)),e.value.on("start",()=>c.trigger()),e.value.on("end",()=>s.trigger()),e.value.on("changed",()=>{F(),u.trigger()})])},{flush:"post"}),C.tryOnScopeDispose(()=>S()),{drauuInstance:e,load:D,dump:R,clear:i,cancel:E,undo:V,redo:A,canUndo:d,canRedo:h,brush:y,onChanged:u.on,onCommitted:o.on,onStart:c.on,onEnd:s.on,onCanceled:r.on}}function ie(t,l={}){let e;const{immediate:a,...u}=l,r=n.ref(!1),o=n.ref(!1),c=m=>e&&e.activate(m),s=m=>e&&e.deactivate(m),d=()=>{e&&(e.pause(),o.value=!0)},h=()=>{e&&(e.unpause(),o.value=!1)},g=n.computed(()=>{const m=n.toValue(t);return w.toArray(m).map(y=>{const V=n.toValue(y);return typeof V=="string"?V:w.unrefElement(V)}).filter(C.notNullish)});return n.watch(g,m=>{m.length&&(e=X.createFocusTrap(m,{...u,onActivate(){r.value=!0,l.onActivate&&l.onActivate()},onDeactivate(){r.value=!1,l.onDeactivate&&l.onDeactivate()}}),a&&c())},{flush:"post"}),w.tryOnScopeDispose(()=>s()),{hasFocus:r,isPaused:o,activate:c,deactivate:s,pause:d,unpause:h}}function fe(t,l,e){const a=()=>{var o,c;return new Y((o=n.toValue(l))!=null?o:[],(c=n.toValue(e))==null?void 0:c.fuseOptions)},u=n.ref(a());n.watch(()=>{var o;return(o=n.toValue(e))==null?void 0:o.fuseOptions},()=>{u.value=a()},{deep:!0}),n.watch(()=>n.toValue(l),o=>{u.value.setCollection(o)},{deep:!0});const r=n.computed(()=>{const o=n.toValue(e);if(o?.matchAllWhenSearchEmpty&&!n.toValue(t))return n.toValue(l).map((s,d)=>({item:s,refIndex:d}));const c=o?.resultLimit;return u.value.search(n.toValue(t),c?{limit:c}:void 0)});return{fuse:u,results:r}}function de(t,l,e={}){const{flush:a="pre",deep:u=!0,shallow:r=!1,onError:o=i=>{console.error(i)},writeDefaults:c=!0}=e,s=n.ref(!1),d=(r?n.shallowRef:n.ref)(l),h=n.toValue(l);async function g(){try{const i=await P.get(t);i===void 0?h!=null&&c&&await P.set(t,h):d.value=i}catch(i){o(i)}s.value=!0}g();async function m(){try{d.value==null?await P.del(t):await P.update(t,()=>n.toRaw(d.value))}catch(i){o(i)}}const{pause:y,resume:V}=w.watchPausable(d,()=>m(),{flush:a,deep:u});async function A(i){y(),d.value=i,await m(),V()}return{set:A,isFinished:s,data:d}}function he(t,l={}){const{onError:e,fallbackValue:a=null}=l,u=(c,s)=>{try{return Z.jwtDecode(c,s)}catch(d){return e?.(d),a}},r=n.computed(()=>u(n.toValue(t),{header:!0})),o=n.computed(()=>u(n.toValue(t)));return{header:r,payload:o}}function me(t=null,l){const e=C.toRef(t),a=n.computed({set:r=>r?b.start():b.done(),get:()=>typeof e.value=="number"&&e.value<1});l&&b.configure(l);const u=b.set;return b.set=r=>(e.value=r,u.call(b,r)),n.watchEffect(()=>{typeof e.value=="number"&&C.isClient&&u.call(b,e.value)}),C.tryOnScopeDispose(b.remove),{isLoading:a,progress:e,start:b.start,done:b.done,remove:()=>{e.value=null,b.remove()}}}function ve(t,l){const e=C.toRef(t),a=n.ref("");return n.watch(e,async u=>{e.value&&C.isClient&&(a.value=await x.toDataURL(u,l))},{immediate:!0}),a}function pe(t,l,e={}){let a;const{document:u=w.defaultDocument,...r}=e,o={onUpdate:h=>{G(l,h.oldIndex,h.newIndex,h)}},c=()=>{const h=typeof t=="string"?u?.querySelector(t):w.unrefElement(t);!h||a!==void 0||(a=new ee(h,{...o,...r}))},s=()=>{a?.destroy(),a=void 0},d=(h,g)=>{if(g!==void 0)a?.option(h,g);else return a?.option(h)};return w.tryOnMounted(c),w.tryOnScopeDispose(s),{stop:s,start:c,option:d}}function B(t,l,e){const a=t.children[e];t.insertBefore(l,a)}function W(t){t.parentNode&&t.parentNode.removeChild(t)}function G(t,l,e,a=null){a!=null&&(W(a.item),B(a.from,a.item,l));const u=n.isRef(t),r=u?[...n.toValue(t)]:n.toValue(t);if(e>=0&&e<r.length){const o=r.splice(l,1)[0];n.nextTick(()=>{r.splice(e,0,o),u&&(t.value=r)})}}p.createCookies=re,p.insertNodeAt=B,p.moveArrayElement=G,p.removeNode=W,p.useAsyncValidator=le,p.useAxios=oe,p.useChangeCase=ue,p.useCookies=T,p.useDrauu=ce,p.useFocusTrap=ie,p.useFuse=fe,p.useIDBKeyval=de,p.useJwt=he,p.useNProgress=me,p.useQRCode=ve,p.useSortable=pe})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,Vue,axios,changeCase,UniversalCookie,VueUse,Drauu,focusTrap,Fuse,idbKeyval,jwt_decode,nprogress,QRCode,Sortable);
1
+ (function(w,C,U,n,L,$,k,p,K,X,Y,P,Z,V,x,ee){"use strict";function te(t){var o=Object.create(null);return t&&Object.keys(t).forEach(function(e){if(e!=="default"){var a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,a.get?a:{enumerable:!0,get:function(){return t[e]}})}}),o.default=t,Object.freeze(o)}var ne=te($);const ae=U.default||U;function oe(t,o,e={}){const{validateOption:a={},immediate:r=!0,manual:u=!1}=e,l=C.toRef(t),c=n.shallowRef(null),s=n.shallowRef(!0),d=n.ref(!r||u),v=n.computed(()=>{var i;return((i=c.value)==null?void 0:i.errors)||[]}),g=n.computed(()=>{var i;return((i=c.value)==null?void 0:i.fields)||{}}),h=n.computed(()=>new ae(n.toValue(o))),y=async()=>{s.value=!1,d.value=!1;try{await h.value.validate(l.value,a),d.value=!0,c.value=null}catch(i){c.value=i}finally{s.value=!0}return{pass:d.value,errorInfo:c.value,errors:v.value,errorFields:g.value}};u||n.watch([l,h],()=>y(),{immediate:r,deep:!0});const R={isFinished:s,pass:d,errors:v,errorInfo:c,errorFields:g,execute:y};function E(){return new Promise((i,b)=>{C.until(s).toBe(!0).then(()=>i(R)).catch(A=>b(A))})}return{...R,then(i,b){return E().then(i,b)}}}function le(...t){const o=typeof t[0]=="string"?t[0]:void 0,e=typeof o=="string"?1:0,a={immediate:!!e,shallow:!0,abortPrevious:!0};let r={},u=L,l=a;const c=m=>!!m?.request;t.length>0+e&&(c(t[0+e])?u=t[0+e]:r=t[0+e]),t.length>1+e&&c(t[1+e])&&(u=t[1+e]),(t.length===2+e&&!c(t[1+e])||t.length===3+e)&&(l=t[t.length-1]||a);const{shallow:s,onSuccess:d=C.noop,onError:v=C.noop,immediate:g,resetOnExecute:h=!1}=l,y=l.initialData,R=n.shallowRef(),E=(s?n.shallowRef:n.ref)(y),i=n.shallowRef(!1),b=n.shallowRef(!1),A=n.shallowRef(!1),D=n.shallowRef();let S=new AbortController;const F=m=>{i.value||!b.value||(S.abort(m),S=new AbortController,A.value=!0,b.value=!1,i.value=!1)},f=m=>{b.value=m,i.value=!m},_=()=>{h&&(E.value=y)},Q=()=>new Promise((m,I)=>{C.until(i).toBe(!0).then(()=>D.value?I(D.value):m(q))}),H={then:(...m)=>Q().then(...m),catch:(...m)=>Q().catch(...m)};let j=0;const z=(m=o,I={})=>{D.value=void 0;const J=typeof m=="string"?m:o??I.url;if(J===void 0)return D.value=new L.AxiosError(L.AxiosError.ERR_INVALID_URL),i.value=!0,H;_(),l.abortPrevious!==!1&&F(),f(!0),j+=1;const pe=j;return A.value=!1,u(J,{...r,...typeof m=="object"?m:I,signal:S.signal}).then(O=>{if(A.value)return;R.value=O;const M=O.data;E.value=M,d(M)}).catch(O=>{D.value=O,v(O)}).finally(()=>{var O;(O=l.onFinish)==null||O.call(l),pe===j&&f(!1)}),H};g&&o&&z();const q={response:R,data:E,error:D,isFinished:i,isLoading:b,cancel:F,isAborted:A,isCanceled:A,abort:F,execute:z};return{...q,...H}}const N=Object.entries(ne).filter(([t,o])=>typeof o=="function"&&t.endsWith("Case")).reduce((t,[o,e])=>(t[o]=e,t),{});function re(t,o,e){const a=n.computed(()=>{const u=n.toValue(o);if(!N[u])throw new Error(`Invalid change case type "${u}"`);return u});if(typeof t=="function")return n.computed(()=>N[a.value](n.toValue(t),n.toValue(e)));const r=n.ref(t);return n.computed({get(){return N[a.value](r.value,n.toValue(e))},set(u){r.value=u}})}function ue(t){const o=new k(t?t.headers.cookie:null);return(e,{doNotParse:a=!1,autoUpdateDependencies:r=!1}={})=>T(e,{doNotParse:a,autoUpdateDependencies:r},o)}function T(t,{doNotParse:o=!1,autoUpdateDependencies:e=!1}={},a=new k){const r=e?[...t||[]]:t;let u=a.getAll({doNotParse:!0});const l=n.shallowRef(0),c=()=>{const s=a.getAll({doNotParse:!0});se(r||null,s,u)&&l.value++,u=s};return a.addChangeListener(c),C.tryOnScopeDispose(()=>{a.removeChangeListener(c)}),{get:(...s)=>(e&&r&&!r.includes(s[0])&&r.push(s[0]),l.value,a.get(s[0],{doNotParse:o,...s[1]})),getAll:(...s)=>(l.value,a.getAll({doNotParse:o,...s[0]})),set:(...s)=>a.set(...s),remove:(...s)=>a.remove(...s),addChangeListener:(...s)=>a.addChangeListener(...s),removeChangeListener:(...s)=>a.removeChangeListener(...s)}}function se(t,o,e){if(!t)return!0;for(const a of t)if(o[a]!==e[a])return!0;return!1}function ce(t,o){const e=n.ref();let a=[];const r=p.createEventHook(),u=p.createEventHook(),l=p.createEventHook(),c=p.createEventHook(),s=p.createEventHook(),d=n.shallowRef(!1),v=n.shallowRef(!1),g=n.shallowRef(!1),h=n.shallowRef(!1),y=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw",...o?.brush});n.watch(y,()=>{const f=e.value;f&&(f.brush=y.value,f.mode=y.value.mode)},{deep:!0});const R=()=>{var f;return(f=e.value)==null?void 0:f.undo()},E=()=>{var f;return(f=e.value)==null?void 0:f.redo()},i=()=>{var f;return(f=e.value)==null?void 0:f.clear()},b=()=>{var f;return(f=e.value)==null?void 0:f.cancel()},A=f=>{var _;return(_=e.value)==null?void 0:_.load(f)},D=()=>{var f;return(f=e.value)==null?void 0:f.dump()},S=()=>{var f;a.forEach(_=>_()),(f=e.value)==null||f.unmount()},F=()=>{e.value&&(d.value=e.value.canUndo(),v.value=e.value.canRedo(),g.value=e.value.altPressed,h.value=e.value.shiftPressed)};return n.watch(()=>p.unrefElement(t),f=>{!f||typeof SVGSVGElement>"u"||!(f instanceof SVGSVGElement)||(e.value&&S(),e.value=K.createDrauu({el:f,...o}),F(),a=[e.value.on("canceled",()=>u.trigger()),e.value.on("committed",_=>l.trigger(_)),e.value.on("start",()=>c.trigger()),e.value.on("end",()=>s.trigger()),e.value.on("changed",()=>{F(),r.trigger()})])},{flush:"post"}),C.tryOnScopeDispose(()=>S()),{drauuInstance:e,load:A,dump:D,clear:i,cancel:b,undo:R,redo:E,canUndo:d,canRedo:v,brush:y,onChanged:r.on,onCommitted:l.on,onStart:c.on,onEnd:s.on,onCanceled:u.on}}function ie(t,o={}){let e;const{immediate:a,...r}=o,u=n.shallowRef(!1),l=n.shallowRef(!1),c=h=>e&&e.activate(h),s=h=>e&&e.deactivate(h),d=()=>{e&&(e.pause(),l.value=!0)},v=()=>{e&&(e.unpause(),l.value=!1)},g=n.computed(()=>{const h=n.toValue(t);return p.toArray(h).map(y=>{const R=n.toValue(y);return typeof R=="string"?R:p.unrefElement(R)}).filter(C.notNullish)});return n.watch(g,h=>{h.length&&(e=X.createFocusTrap(h,{...r,onActivate(){u.value=!0,o.onActivate&&o.onActivate()},onDeactivate(){u.value=!1,o.onDeactivate&&o.onDeactivate()}}),a&&c())},{flush:"post"}),p.tryOnScopeDispose(()=>s()),{hasFocus:u,isPaused:l,activate:c,deactivate:s,pause:d,unpause:v}}function fe(t,o,e){const a=()=>{var l,c;return new Y((l=n.toValue(o))!=null?l:[],(c=n.toValue(e))==null?void 0:c.fuseOptions)},r=n.ref(a());n.watch(()=>{var l;return(l=n.toValue(e))==null?void 0:l.fuseOptions},()=>{r.value=a()},{deep:!0}),n.watch(()=>n.toValue(o),l=>{r.value.setCollection(l)},{deep:!0});const u=n.computed(()=>{const l=n.toValue(e);if(l?.matchAllWhenSearchEmpty&&!n.toValue(t))return n.toValue(o).map((s,d)=>({item:s,refIndex:d}));const c=l?.resultLimit;return r.value.search(n.toValue(t),c?{limit:c}:void 0)});return{fuse:r,results:u}}function de(t,o,e={}){const{flush:a="pre",deep:r=!0,shallow:u=!1,onError:l=i=>{console.error(i)},writeDefaults:c=!0}=e,s=n.shallowRef(!1),d=(u?n.shallowRef:n.ref)(o),v=n.toValue(o);async function g(){try{const i=await P.get(t);i===void 0?v!=null&&c&&await P.set(t,v):d.value=i}catch(i){l(i)}s.value=!0}g();async function h(){try{d.value==null?await P.del(t):await P.update(t,()=>n.toRaw(d.value))}catch(i){l(i)}}const{pause:y,resume:R}=p.watchPausable(d,()=>h(),{flush:a,deep:r});async function E(i){y(),d.value=i,await h(),R()}return{set:E,isFinished:s,data:d}}function ve(t,o={}){const{onError:e,fallbackValue:a=null}=o,r=(c,s)=>{try{return Z.jwtDecode(c,s)}catch(d){return e?.(d),a}},u=n.computed(()=>r(n.toValue(t),{header:!0})),l=n.computed(()=>r(n.toValue(t)));return{header:u,payload:l}}function he(t=null,o){const e=C.toRef(t),a=n.computed({set:u=>u?V.start():V.done(),get:()=>typeof e.value=="number"&&e.value<1});o&&V.configure(o);const r=V.set;return V.set=u=>(e.value=u,r.call(V,u)),n.watchEffect(()=>{typeof e.value=="number"&&C.isClient&&r.call(V,e.value)}),C.tryOnScopeDispose(V.remove),{isLoading:a,progress:e,start:V.start,done:V.done,remove:()=>{e.value=null,V.remove()}}}function me(t,o){const e=C.toRef(t),a=n.shallowRef("");return n.watch(e,async r=>{e.value&&C.isClient&&(a.value=await x.toDataURL(r,o))},{immediate:!0}),a}function we(t,o,e={}){let a;const{document:r=p.defaultDocument,...u}=e,l={onUpdate:v=>{G(o,v.oldIndex,v.newIndex,v)}},c=()=>{const v=typeof t=="string"?r?.querySelector(t):p.unrefElement(t);!v||a!==void 0||(a=new ee(v,{...l,...u}))},s=()=>{a?.destroy(),a=void 0},d=(v,g)=>{if(g!==void 0)a?.option(v,g);else return a?.option(v)};return p.tryOnMounted(c),p.tryOnScopeDispose(s),{stop:s,start:c,option:d}}function B(t,o,e){const a=t.children[e];t.insertBefore(o,a)}function W(t){t.parentNode&&t.parentNode.removeChild(t)}function G(t,o,e,a=null){a!=null&&(W(a.item),B(a.from,a.item,o));const r=n.isRef(t),u=r?[...n.toValue(t)]:n.toValue(t);if(e>=0&&e<u.length){const l=u.splice(o,1)[0];n.nextTick(()=>{u.splice(e,0,l),r&&(t.value=u)})}}w.createCookies=ue,w.insertNodeAt=B,w.moveArrayElement=G,w.removeNode=W,w.useAsyncValidator=oe,w.useAxios=le,w.useChangeCase=re,w.useCookies=T,w.useDrauu=ce,w.useFocusTrap=ie,w.useFuse=fe,w.useIDBKeyval=de,w.useJwt=ve,w.useNProgress=he,w.useQRCode=me,w.useSortable=we})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,Vue,axios,changeCase,UniversalCookie,VueUse,Drauu,focusTrap,Fuse,idbKeyval,jwt_decode,nprogress,QRCode,Sortable);