@vueuse/components 13.3.0 → 13.4.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.d.mts +26 -0
- package/index.iife.js +84 -28
- package/index.iife.min.js +1 -1
- package/index.mjs +84 -28
- package/package.json +3 -3
package/index.d.mts
CHANGED
|
@@ -549,6 +549,14 @@ interface UseScrollOptions extends ConfigurableWindow {
|
|
|
549
549
|
top?: number;
|
|
550
550
|
bottom?: number;
|
|
551
551
|
};
|
|
552
|
+
/**
|
|
553
|
+
* Use MutationObserver to monitor specific DOM changes,
|
|
554
|
+
* such as attribute modifications, child node additions or removals, or subtree changes.
|
|
555
|
+
* @default { mutation: boolean }
|
|
556
|
+
*/
|
|
557
|
+
observe?: boolean | {
|
|
558
|
+
mutation?: boolean;
|
|
559
|
+
};
|
|
552
560
|
/**
|
|
553
561
|
* Trigger it when scrolling.
|
|
554
562
|
*
|
|
@@ -695,7 +703,25 @@ interface UseMouseOptions extends ConfigurableWindow, ConfigurableEventFilter {
|
|
|
695
703
|
}
|
|
696
704
|
|
|
697
705
|
interface MouseInElementOptions extends UseMouseOptions {
|
|
706
|
+
/**
|
|
707
|
+
* Whether to handle mouse events when the cursor is outside the target element.
|
|
708
|
+
* When enabled, mouse position will continue to be tracked even when outside the element bounds.
|
|
709
|
+
*
|
|
710
|
+
* @default true
|
|
711
|
+
*/
|
|
698
712
|
handleOutside?: boolean;
|
|
713
|
+
/**
|
|
714
|
+
* Listen to window resize event
|
|
715
|
+
*
|
|
716
|
+
* @default true
|
|
717
|
+
*/
|
|
718
|
+
windowScroll?: boolean;
|
|
719
|
+
/**
|
|
720
|
+
* Listen to window scroll event
|
|
721
|
+
*
|
|
722
|
+
* @default true
|
|
723
|
+
*/
|
|
724
|
+
windowResize?: boolean;
|
|
699
725
|
}
|
|
700
726
|
/**
|
|
701
727
|
* Reactive mouse position related to an element.
|
package/index.iife.js
CHANGED
|
@@ -1498,7 +1498,8 @@
|
|
|
1498
1498
|
isReady,
|
|
1499
1499
|
isLoading,
|
|
1500
1500
|
error,
|
|
1501
|
-
execute
|
|
1501
|
+
execute,
|
|
1502
|
+
executeImmediate: (...args) => execute(0, ...args)
|
|
1502
1503
|
};
|
|
1503
1504
|
function waitUntilIsLoaded() {
|
|
1504
1505
|
return new Promise((resolve, reject) => {
|
|
@@ -1617,6 +1618,9 @@
|
|
|
1617
1618
|
top: 0,
|
|
1618
1619
|
bottom: 0
|
|
1619
1620
|
},
|
|
1621
|
+
observe: _observe = {
|
|
1622
|
+
mutation: false
|
|
1623
|
+
},
|
|
1620
1624
|
eventListenerOptions = {
|
|
1621
1625
|
capture: false,
|
|
1622
1626
|
passive: true
|
|
@@ -1627,6 +1631,9 @@
|
|
|
1627
1631
|
console.error(e);
|
|
1628
1632
|
}
|
|
1629
1633
|
} = options;
|
|
1634
|
+
const observe = typeof _observe === "boolean" ? {
|
|
1635
|
+
mutation: _observe
|
|
1636
|
+
} : _observe;
|
|
1630
1637
|
const internalX = vue.shallowRef(0);
|
|
1631
1638
|
const internalY = vue.shallowRef(0);
|
|
1632
1639
|
const x = vue.computed({
|
|
@@ -1749,6 +1756,22 @@
|
|
|
1749
1756
|
onError(e);
|
|
1750
1757
|
}
|
|
1751
1758
|
});
|
|
1759
|
+
if ((observe == null ? void 0 : observe.mutation) && element != null && element !== window && element !== document) {
|
|
1760
|
+
useMutationObserver(
|
|
1761
|
+
element,
|
|
1762
|
+
() => {
|
|
1763
|
+
const _element = vue.toValue(element);
|
|
1764
|
+
if (!_element)
|
|
1765
|
+
return;
|
|
1766
|
+
setArrivedState(_element);
|
|
1767
|
+
},
|
|
1768
|
+
{
|
|
1769
|
+
attributes: true,
|
|
1770
|
+
childList: true,
|
|
1771
|
+
subtree: true
|
|
1772
|
+
}
|
|
1773
|
+
);
|
|
1774
|
+
}
|
|
1752
1775
|
useEventListener(
|
|
1753
1776
|
element,
|
|
1754
1777
|
"scrollend",
|
|
@@ -1948,6 +1971,8 @@
|
|
|
1948
1971
|
|
|
1949
1972
|
function useMouseInElement(target, options = {}) {
|
|
1950
1973
|
const {
|
|
1974
|
+
windowResize = true,
|
|
1975
|
+
windowScroll = true,
|
|
1951
1976
|
handleOutside = true,
|
|
1952
1977
|
window = defaultWindow
|
|
1953
1978
|
} = options;
|
|
@@ -1961,34 +1986,55 @@
|
|
|
1961
1986
|
const elementHeight = vue.shallowRef(0);
|
|
1962
1987
|
const elementWidth = vue.shallowRef(0);
|
|
1963
1988
|
const isOutside = vue.shallowRef(true);
|
|
1964
|
-
|
|
1965
|
-
|
|
1989
|
+
function update() {
|
|
1990
|
+
if (!window)
|
|
1991
|
+
return;
|
|
1992
|
+
const el = unrefElement(targetRef);
|
|
1993
|
+
if (!el || !(el instanceof Element))
|
|
1994
|
+
return;
|
|
1995
|
+
const {
|
|
1996
|
+
left,
|
|
1997
|
+
top,
|
|
1998
|
+
width,
|
|
1999
|
+
height
|
|
2000
|
+
} = el.getBoundingClientRect();
|
|
2001
|
+
elementPositionX.value = left + (type === "page" ? window.pageXOffset : 0);
|
|
2002
|
+
elementPositionY.value = top + (type === "page" ? window.pageYOffset : 0);
|
|
2003
|
+
elementHeight.value = height;
|
|
2004
|
+
elementWidth.value = width;
|
|
2005
|
+
const elX = x.value - elementPositionX.value;
|
|
2006
|
+
const elY = y.value - elementPositionY.value;
|
|
2007
|
+
isOutside.value = width === 0 || height === 0 || elX < 0 || elY < 0 || elX > width || elY > height;
|
|
2008
|
+
if (handleOutside) {
|
|
2009
|
+
elementX.value = elX;
|
|
2010
|
+
elementY.value = elY;
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
const stopFnList = [];
|
|
2014
|
+
function stop() {
|
|
2015
|
+
stopFnList.forEach((fn) => fn());
|
|
2016
|
+
stopFnList.length = 0;
|
|
2017
|
+
}
|
|
2018
|
+
shared.tryOnMounted(() => {
|
|
2019
|
+
update();
|
|
2020
|
+
});
|
|
1966
2021
|
if (window) {
|
|
1967
|
-
|
|
2022
|
+
const {
|
|
2023
|
+
stop: stopResizeObserver
|
|
2024
|
+
} = useResizeObserver(targetRef, update);
|
|
2025
|
+
const {
|
|
2026
|
+
stop: stopMutationObserver
|
|
2027
|
+
} = useMutationObserver(targetRef, update, {
|
|
2028
|
+
attributeFilter: ["style", "class"]
|
|
2029
|
+
});
|
|
2030
|
+
const stopWatch = vue.watch(
|
|
1968
2031
|
[targetRef, x, y],
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
top,
|
|
1976
|
-
width,
|
|
1977
|
-
height
|
|
1978
|
-
} = el.getBoundingClientRect();
|
|
1979
|
-
elementPositionX.value = left + (type === "page" ? window.pageXOffset : 0);
|
|
1980
|
-
elementPositionY.value = top + (type === "page" ? window.pageYOffset : 0);
|
|
1981
|
-
elementHeight.value = height;
|
|
1982
|
-
elementWidth.value = width;
|
|
1983
|
-
const elX = x.value - elementPositionX.value;
|
|
1984
|
-
const elY = y.value - elementPositionY.value;
|
|
1985
|
-
isOutside.value = width === 0 || height === 0 || elX < 0 || elY < 0 || elX > width || elY > height;
|
|
1986
|
-
if (handleOutside || !isOutside.value) {
|
|
1987
|
-
elementX.value = elX;
|
|
1988
|
-
elementY.value = elY;
|
|
1989
|
-
}
|
|
1990
|
-
},
|
|
1991
|
-
{ immediate: true }
|
|
2032
|
+
update
|
|
2033
|
+
);
|
|
2034
|
+
stopFnList.push(
|
|
2035
|
+
stopResizeObserver,
|
|
2036
|
+
stopMutationObserver,
|
|
2037
|
+
stopWatch
|
|
1992
2038
|
);
|
|
1993
2039
|
useEventListener(
|
|
1994
2040
|
document,
|
|
@@ -1996,6 +2042,16 @@
|
|
|
1996
2042
|
() => isOutside.value = true,
|
|
1997
2043
|
{ passive: true }
|
|
1998
2044
|
);
|
|
2045
|
+
if (windowScroll) {
|
|
2046
|
+
stopFnList.push(
|
|
2047
|
+
useEventListener("scroll", update, { capture: true, passive: true })
|
|
2048
|
+
);
|
|
2049
|
+
}
|
|
2050
|
+
if (windowResize) {
|
|
2051
|
+
stopFnList.push(
|
|
2052
|
+
useEventListener("resize", update, { passive: true })
|
|
2053
|
+
);
|
|
2054
|
+
}
|
|
1999
2055
|
}
|
|
2000
2056
|
return {
|
|
2001
2057
|
x,
|
|
@@ -2323,7 +2379,7 @@
|
|
|
2323
2379
|
rightCssVar.value = "env(safe-area-inset-right, 0px)";
|
|
2324
2380
|
bottomCssVar.value = "env(safe-area-inset-bottom, 0px)";
|
|
2325
2381
|
leftCssVar.value = "env(safe-area-inset-left, 0px)";
|
|
2326
|
-
update
|
|
2382
|
+
shared.tryOnMounted(update);
|
|
2327
2383
|
useEventListener("resize", shared.useDebounceFn(update), { passive: true });
|
|
2328
2384
|
}
|
|
2329
2385
|
function update() {
|
package/index.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(y,C,o,S){"use strict";const ye=o.defineComponent({name:"OnClickOutside",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const a=o.shallowRef();return C.onClickOutside(a,l=>{n("trigger",l)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:a},t.default())}}}),k=S.isClient?window:void 0;function V(e){var t;const n=o.toValue(e);return(t=n?.$el)!=null?t:n}function M(...e){const t=[],n=()=>{t.forEach(r=>r()),t.length=0},a=(r,c,f,u)=>(r.addEventListener(c,f,u),()=>r.removeEventListener(c,f,u)),l=o.computed(()=>{const r=S.toArray(o.toValue(e[0])).filter(c=>c!=null);return r.every(c=>typeof c!="string")?r:void 0}),s=S.watchImmediate(()=>{var r,c;return[(c=(r=l.value)==null?void 0:r.map(f=>V(f)))!=null?c:[k].filter(f=>f!=null),S.toArray(o.toValue(l.value?e[1]:e[0])),S.toArray(o.unref(l.value?e[2]:e[1])),o.toValue(l.value?e[3]:e[2])]},([r,c,f,u])=>{if(n(),!r?.length||!c?.length||!f?.length)return;const d=S.isObject(u)?{...u}:u;t.push(...r.flatMap(p=>c.flatMap(U=>f.map(g=>a(p,U,g,d)))))},{flush:"post"}),i=()=>{s(),n()};return S.tryOnScopeDispose(n),i}let te=!1;function ne(e,t,n={}){const{window:a=k,ignore:l=[],capture:s=!0,detectIframe:i=!1,controls:r=!1}=n;if(!a)return r?{stop:S.noop,cancel:S.noop,trigger:S.noop}:S.noop;if(S.isIOS&&!te){te=!0;const h={passive:!0};Array.from(a.document.body.children).forEach(m=>m.addEventListener("click",S.noop,h)),a.document.documentElement.addEventListener("click",S.noop,h)}let c=!0;const f=h=>o.toValue(l).some(m=>{if(typeof m=="string")return Array.from(a.document.querySelectorAll(m)).some(w=>w===h.target||h.composedPath().includes(w));{const w=V(m);return w&&(h.target===w||h.composedPath().includes(w))}});function u(h){const m=o.toValue(h);return m&&m.$.subTree.shapeFlag===16}function d(h,m){const w=o.toValue(h),O=w.$.subTree&&w.$.subTree.children;return O==null||!Array.isArray(O)?!1:O.some(R=>R.el===m.target||m.composedPath().includes(R.el))}const p=h=>{const m=V(e);if(h.target!=null&&!(!(m instanceof Element)&&u(e)&&d(e,h))&&!(!m||m===h.target||h.composedPath().includes(m))){if("detail"in h&&h.detail===0&&(c=!f(h)),!c){c=!0;return}t(h)}};let U=!1;const g=[M(a,"click",h=>{U||(U=!0,setTimeout(()=>{U=!1},0),p(h))},{passive:!0,capture:s}),M(a,"pointerdown",h=>{const m=V(e);c=!f(h)&&!!(m&&!h.composedPath().includes(m))},{passive:!0}),i&&M(a,"blur",h=>{setTimeout(()=>{var m;const w=V(e);((m=a.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!w?.contains(a.document.activeElement)&&t(h)},0)},{passive:!0})].filter(Boolean),b=()=>g.forEach(h=>h());return r?{stop:b,cancel:()=>{c=!1},trigger:h=>{c=!0,p(h),c=!1}}:b}const G=new WeakMap,oe={mounted(e,t){const n=!t.modifiers.bubble;let a;if(typeof t.value=="function")a=ne(e,t.value,{capture:n});else{const[l,s]=t.value;a=ne(e,l,Object.assign({capture:n},s))}G.set(e,a)},unmounted(e){const t=G.get(e);t&&typeof t=="function"?t():t?.stop(),G.delete(e)}};function we(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function ae(...e){let t,n,a={};e.length===3?(t=e[0],n=e[1],a=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],a=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:l=k,eventName:s="keydown",passive:i=!1,dedupe:r=!1}=a,c=we(t);return M(l,s,u=>{u.repeat&&o.toValue(r)||c(u)&&n(u)},i)}const Ue={mounted(e,t){var n,a;const l=(a=(n=t.arg)==null?void 0:n.split(","))!=null?a:!0;if(typeof t.value=="function")ae(l,t.value,{target:e});else{const[s,i]=t.value;ae(l,s,{target:e,...i})}}},Se=500,be=10;function J(e,t,n){var a,l;const s=o.computed(()=>V(e));let i,r,c,f=!1;function u(){i&&(clearTimeout(i),i=void 0),r=void 0,c=void 0,f=!1}function d(m){var w,O,R;const[P,T,v]=[c,r,f];if(u(),!n?.onMouseUp||!T||!P||(w=n?.modifiers)!=null&&w.self&&m.target!==s.value)return;(O=n?.modifiers)!=null&&O.prevent&&m.preventDefault(),(R=n?.modifiers)!=null&&R.stop&&m.stopPropagation();const D=m.x-T.x,L=m.y-T.y,W=Math.sqrt(D*D+L*L);n.onMouseUp(m.timeStamp-P,W,v)}function p(m){var w,O,R,P;(w=n?.modifiers)!=null&&w.self&&m.target!==s.value||(u(),(O=n?.modifiers)!=null&&O.prevent&&m.preventDefault(),(R=n?.modifiers)!=null&&R.stop&&m.stopPropagation(),r={x:m.x,y:m.y},c=m.timeStamp,i=setTimeout(()=>{f=!0,t(m)},(P=n?.delay)!=null?P:Se))}function U(m){var w,O,R,P;if((w=n?.modifiers)!=null&&w.self&&m.target!==s.value||!r||n?.distanceThreshold===!1)return;(O=n?.modifiers)!=null&&O.prevent&&m.preventDefault(),(R=n?.modifiers)!=null&&R.stop&&m.stopPropagation();const T=m.x-r.x,v=m.y-r.y;Math.sqrt(T*T+v*v)>=((P=n?.distanceThreshold)!=null?P:be)&&u()}const g={capture:(a=n?.modifiers)==null?void 0:a.capture,once:(l=n?.modifiers)==null?void 0:l.once},b=[M(s,"pointerdown",p,g),M(s,"pointermove",U,g),M(s,["pointerup","pointerleave"],d,g)];return()=>b.forEach(m=>m())}const Ce=o.defineComponent({name:"OnLongPress",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const a=o.shallowRef();return J(a,l=>{n("trigger",l)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:a},t.default())}}}),le={mounted(e,t){typeof t.value=="function"?J(e,t.value,{modifiers:t.modifiers}):J(e,...t.value)}},Ee=o.defineComponent({name:"UseActiveElement",setup(e,{slots:t}){const n=o.reactive({element:C.useActiveElement()});return()=>{if(t.default)return t.default(n)}}}),Re=o.defineComponent({name:"UseBattery",setup(e,{slots:t}){const n=o.reactive(C.useBattery(e));return()=>{if(t.default)return t.default(n)}}}),Oe=o.defineComponent({name:"UseBrowserLocation",setup(e,{slots:t}){const n=o.reactive(C.useBrowserLocation());return()=>{if(t.default)return t.default(n)}}}),Pe=o.defineComponent({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(e,{slots:t}){const n=o.reactive(C.useClipboard(e));return()=>{var a;return(a=t.default)==null?void 0:a.call(t,n)}}}),N=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},F="__vueuse_ssr_handlers__",Ve=Me();function Me(){return F in N||(N[F]=N[F]||{}),N[F]}function se(e,t){return Ve[e]||t}const De=Symbol("vueuse-ssr-width");function Te(){const e=o.hasInjectionContext()?S.injectLocal(De,null):null;return typeof e=="number"?e:void 0}function Le(){const e=o.shallowRef(!1),t=o.getCurrentInstance();return t&&o.onMounted(()=>{e.value=!0},t),e}function j(e){const t=Le();return o.computed(()=>(t.value,!!e()))}function ke(e,t={}){const{window:n=k,ssrWidth:a=Te()}=t,l=j(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),s=o.shallowRef(typeof a=="number"),i=o.shallowRef(),r=o.shallowRef(!1),c=f=>{r.value=f.matches};return o.watchEffect(()=>{if(s.value){s.value=!l.value;const f=o.toValue(e).split(",");r.value=f.some(u=>{const d=u.includes("not all"),p=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),U=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let g=!!(p||U);return p&&g&&(g=a>=S.pxValue(p[1])),U&&g&&(g=a<=S.pxValue(U[1])),d?!g:g});return}l.value&&(i.value=n.matchMedia(o.toValue(e)),r.value=i.value.matches)}),M(i,"change",c,{passive:!0}),o.computed(()=>r.value)}function _e(e){return ke("(prefers-color-scheme: dark)",e)}function Ae(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const Ie={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},re="vueuse-storage";function We(e,t,n,a={}){var l;const{flush:s="pre",deep:i=!0,listenToStorageChanges:r=!0,writeDefaults:c=!0,mergeDefaults:f=!1,shallow:u,window:d=k,eventFilter:p,onError:U=E=>{console.error(E)},initOnMounted:g}=a,b=(u?o.shallowRef:o.ref)(typeof t=="function"?t():t),h=o.computed(()=>o.toValue(e));if(!n)try{n=se("getDefaultStorage",()=>{var E;return(E=k)==null?void 0:E.localStorage})()}catch(E){U(E)}if(!n)return b;const m=o.toValue(t),w=Ae(m),O=(l=a.serializer)!=null?l:Ie[w],{pause:R,resume:P}=S.pausableWatch(b,()=>W(b.value),{flush:s,deep:i,eventFilter:p});o.watch(h,()=>I(),{flush:s});let T=!1;const v=E=>{g&&!T||I(E)},D=E=>{g&&!T||_(E)};d&&r&&(n instanceof Storage?M(d,"storage",v,{passive:!0}):M(d,re,D)),g?S.tryOnMounted(()=>{T=!0,I()}):I();function L(E,A){if(d){const z={key:h.value,oldValue:E,newValue:A,storageArea:n};d.dispatchEvent(n instanceof Storage?new StorageEvent("storage",z):new CustomEvent(re,{detail:z}))}}function W(E){try{const A=n.getItem(h.value);if(E==null)L(A,null),n.removeItem(h.value);else{const z=O.write(E);A!==z&&(n.setItem(h.value,z),L(A,z))}}catch(A){U(A)}}function B(E){const A=E?E.newValue:n.getItem(h.value);if(A==null)return c&&m!=null&&n.setItem(h.value,O.write(m)),m;if(!E&&f){const z=O.read(A);return typeof f=="function"?f(z,m):w==="object"&&!Array.isArray(z)?{...m,...z}:z}else return typeof A!="string"?A:O.read(A)}function I(E){if(!(E&&E.storageArea!==n)){if(E&&E.key==null){b.value=m;return}if(!(E&&E.key!==h.value)){R();try{E?.newValue!==O.write(b.value)&&(b.value=B(E))}catch(A){U(A)}finally{E?o.nextTick(P):P()}}}}function _(E){I(E.detail)}return b}const ze="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Be(e={}){const{selector:t="html",attribute:n="class",initialValue:a="auto",window:l=k,storage:s,storageKey:i="vueuse-color-scheme",listenToStorageChanges:r=!0,storageRef:c,emitAuto:f,disableTransition:u=!0}=e,d={auto:"",light:"light",dark:"dark",...e.modes||{}},p=_e({window:l}),U=o.computed(()=>p.value?"dark":"light"),g=c||(i==null?S.toRef(a):We(i,a,s,{window:l,listenToStorageChanges:r})),b=o.computed(()=>g.value==="auto"?U.value:g.value),h=se("updateHTMLAttrs",(R,P,T)=>{const v=typeof R=="string"?l?.document.querySelector(R):V(R);if(!v)return;const D=new Set,L=new Set;let W=null;if(P==="class"){const I=T.split(/\s/g);Object.values(d).flatMap(_=>(_||"").split(/\s/g)).filter(Boolean).forEach(_=>{I.includes(_)?D.add(_):L.add(_)})}else W={key:P,value:T};if(D.size===0&&L.size===0&&W===null)return;let B;u&&(B=l.document.createElement("style"),B.appendChild(document.createTextNode(ze)),l.document.head.appendChild(B));for(const I of D)v.classList.add(I);for(const I of L)v.classList.remove(I);W&&v.setAttribute(W.key,W.value),u&&(l.getComputedStyle(B).opacity,document.head.removeChild(B))});function m(R){var P;h(t,n,(P=d[R])!=null?P:R)}function w(R){e.onChanged?e.onChanged(R,m):m(R)}o.watch(b,w,{flush:"post",immediate:!0}),S.tryOnMounted(()=>w(b.value));const O=o.computed({get(){return f?g.value:b.value},set(R){g.value=R}});return Object.assign(O,{store:g,system:U,state:b})}const He=o.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:t}){const n=Be(e),a=o.reactive({mode:n,system:n.system,store:n.store});return()=>{if(t.default)return t.default(a)}}}),Ne=o.defineComponent({name:"UseDark",props:["selector","attribute","valueDark","valueLight","onChanged","storageKey","storage"],setup(e,{slots:t}){const n=C.useDark(e),a=o.reactive({isDark:n,toggleDark:S.useToggle(n)});return()=>{if(t.default)return t.default(a)}}}),Fe=o.defineComponent({name:"UseDeviceMotion",setup(e,{slots:t}){const n=C.useDeviceMotion();return()=>{if(t.default)return t.default(n)}}}),je=o.defineComponent({name:"UseDeviceOrientation",setup(e,{slots:t}){const n=o.reactive(C.useDeviceOrientation());return()=>{if(t.default)return t.default(n)}}}),Ye=o.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:t}){const n=o.reactive({pixelRatio:C.useDevicePixelRatio()});return()=>{if(t.default)return t.default(n)}}}),xe=o.defineComponent({name:"UseDevicesList",props:["onUpdated","requestPermissions","constraints"],setup(e,{slots:t}){const n=o.reactive(C.useDevicesList(e));return()=>{if(t.default)return t.default(n)}}}),Xe=o.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:t}){const n=o.reactive({visibility:C.useDocumentVisibility()});return()=>{if(t.default)return t.default(n)}}}),Ke=o.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as","handle","axis","onStart","onMove","onEnd","disabled","buttons","containerElement"],setup(e,{slots:t}){const n=o.shallowRef(),a=o.computed(()=>{var u;return(u=o.toValue(e.handle))!=null?u:n.value}),l=o.computed(()=>{var u;return(u=e.containerElement)!=null?u:void 0}),s=o.computed(()=>!!e.disabled),i=e.storageKey&&C.useStorage(e.storageKey,o.toValue(e.initialValue)||{x:0,y:0},C.isClient?e.storageType==="session"?sessionStorage:localStorage:void 0),r=i||e.initialValue||{x:0,y:0},c=(u,d)=>{var p;(p=e.onEnd)==null||p.call(e,u,d),i&&(i.value.x=u.x,i.value.y=u.y)},f=o.reactive(C.useDraggable(n,{...e,handle:a,initialValue:r,onEnd:c,disabled:s,containerElement:l}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n,style:`touch-action:none;${f.style}`},t.default(f))}}}),Ge=o.defineComponent({name:"UseElementBounding",props:["box","as"],setup(e,{slots:t}){const n=o.shallowRef(),a=o.reactive(C.useElementBounding(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}});function $(e,t,n={}){const{window:a=k,...l}=n;let s;const i=j(()=>a&&"MutationObserver"in a),r=()=>{s&&(s.disconnect(),s=void 0)},c=o.computed(()=>{const p=o.toValue(e),U=S.toArray(p).map(V).filter(S.notNullish);return new Set(U)}),f=o.watch(()=>c.value,p=>{r(),i.value&&p.size&&(s=new MutationObserver(t),p.forEach(U=>s.observe(U,l)))},{immediate:!0,flush:"post"}),u=()=>s?.takeRecords(),d=()=>{f(),r()};return S.tryOnScopeDispose(d),{isSupported:i,stop:d,takeRecords:u}}function Y(e,t,n={}){const{window:a=k,...l}=n;let s;const i=j(()=>a&&"ResizeObserver"in a),r=()=>{s&&(s.disconnect(),s=void 0)},c=o.computed(()=>{const d=o.toValue(e);return Array.isArray(d)?d.map(p=>V(p)):[V(d)]}),f=o.watch(c,d=>{if(r(),i.value&&a){s=new ResizeObserver(t);for(const p of d)p&&s.observe(p,l)}},{immediate:!0,flush:"post"}),u=()=>{r(),f()};return S.tryOnScopeDispose(u),{isSupported:i,stop:u}}function Je(e,t={}){const{reset:n=!0,windowResize:a=!0,windowScroll:l=!0,immediate:s=!0,updateTiming:i="sync"}=t,r=o.shallowRef(0),c=o.shallowRef(0),f=o.shallowRef(0),u=o.shallowRef(0),d=o.shallowRef(0),p=o.shallowRef(0),U=o.shallowRef(0),g=o.shallowRef(0);function b(){const m=V(e);if(!m){n&&(r.value=0,c.value=0,f.value=0,u.value=0,d.value=0,p.value=0,U.value=0,g.value=0);return}const w=m.getBoundingClientRect();r.value=w.height,c.value=w.bottom,f.value=w.left,u.value=w.right,d.value=w.top,p.value=w.width,U.value=w.x,g.value=w.y}function h(){i==="sync"?b():i==="next-frame"&&requestAnimationFrame(()=>b())}return Y(e,h),o.watch(()=>V(e),m=>!m&&h()),$(e,h,{attributeFilter:["style","class"]}),l&&M("scroll",h,{capture:!0,passive:!0}),a&&M("resize",h,{passive:!0}),S.tryOnMounted(()=>{s&&h()}),{height:r,bottom:c,left:f,right:u,top:d,width:p,x:U,y:g,update:h}}const $e={mounted(e,t){const[n,a]=typeof t.value=="function"?[t.value,{}]:t.value,{height:l,bottom:s,left:i,right:r,top:c,width:f,x:u,y:d}=Je(e,a);o.watch([l,s,i,r,c,f,u,d],()=>n({height:l,bottom:s,left:i,right:r,top:c,width:f,x:u,y:d}))}};function qe(e,t,n={}){const{window:a=k,document:l=a?.document,flush:s="sync"}=n;if(!a||!l)return S.noop;let i;const r=u=>{i?.(),i=u},c=o.watchEffect(()=>{const u=V(e);if(u){const{stop:d}=$(l,p=>{p.map(g=>[...g.removedNodes]).flat().some(g=>g===u||g.contains(u))&&t(p)},{window:a,childList:!0,subtree:!0});r(d)}},{flush:s}),f=()=>{c(),r()};return S.tryOnScopeDispose(f),f}function ie(e,t={}){const{delayEnter:n=0,delayLeave:a=0,triggerOnRemoval:l=!1,window:s=k}=t,i=o.shallowRef(!1);let r;const c=f=>{const u=f?n:a;r&&(clearTimeout(r),r=void 0),u?r=setTimeout(()=>i.value=f,u):i.value=f};return s&&(M(e,"mouseenter",()=>c(!0),{passive:!0}),M(e,"mouseleave",()=>c(!1),{passive:!0}),l&&qe(o.computed(()=>V(e)),()=>c(!1))),i}const Qe={mounted(e,t){const n=t.value;if(typeof n=="function"){const a=ie(e);o.watch(a,l=>n(l))}else{const[a,l]=n,s=ie(e,l);o.watch(s,i=>a(i))}}},Ze=o.defineComponent({name:"UseElementSize",props:["width","height","box","as"],setup(e,{slots:t}){var n,a;const l=o.shallowRef(),s=o.reactive(C.useElementSize(l,{width:(n=e.width)!=null?n:0,height:(a=e.height)!=null?a:0},{box:e.box}));return()=>{if(t.default)return o.h(e.as||"div",{ref:l},t.default(s))}}});function et(e,t={width:0,height:0},n={}){const{window:a=k,box:l="content-box"}=n,s=o.computed(()=>{var d,p;return(p=(d=V(e))==null?void 0:d.namespaceURI)==null?void 0:p.includes("svg")}),i=o.shallowRef(t.width),r=o.shallowRef(t.height),{stop:c}=Y(e,([d])=>{const p=l==="border-box"?d.borderBoxSize:l==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(a&&s.value){const U=V(e);if(U){const g=U.getBoundingClientRect();i.value=g.width,r.value=g.height}}else if(p){const U=S.toArray(p);i.value=U.reduce((g,{inlineSize:b})=>g+b,0),r.value=U.reduce((g,{blockSize:b})=>g+b,0)}else i.value=d.contentRect.width,r.value=d.contentRect.height},n);S.tryOnMounted(()=>{const d=V(e);d&&(i.value="offsetWidth"in d?d.offsetWidth:t.width,r.value="offsetHeight"in d?d.offsetHeight:t.height)});const f=o.watch(()=>V(e),d=>{i.value=d?t.width:0,r.value=d?t.height:0});function u(){c(),f()}return{width:i,height:r,stop:u}}const tt={mounted(e,t){var n;const a=typeof t.value=="function"?t.value:(n=t.value)==null?void 0:n[0],l=typeof t.value=="function"?[]:t.value.slice(1),{width:s,height:i}=et(e,...l);o.watch([s,i],([r,c])=>a({width:r,height:c}))}},nt=o.defineComponent({name:"UseElementVisibility",props:["as"],setup(e,{slots:t}){const n=o.shallowRef(),a=o.reactive({isVisible:C.useElementVisibility(n)});return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}});function q(e,t,n={}){const{root:a,rootMargin:l="0px",threshold:s=0,window:i=k,immediate:r=!0}=n,c=j(()=>i&&"IntersectionObserver"in i),f=o.computed(()=>{const g=o.toValue(e);return S.toArray(g).map(V).filter(S.notNullish)});let u=S.noop;const d=o.shallowRef(r),p=c.value?o.watch(()=>[f.value,V(a),d.value],([g,b])=>{if(u(),!d.value||!g.length)return;const h=new IntersectionObserver(t,{root:V(b),rootMargin:l,threshold:s});g.forEach(m=>m&&h.observe(m)),u=()=>{h.disconnect(),u=S.noop}},{immediate:r,flush:"post"}):S.noop,U=()=>{u(),p(),d.value=!1};return S.tryOnScopeDispose(U),{isSupported:c,isActive:d,pause(){u(),d.value=!1},resume(){d.value=!0},stop:U}}function Q(e,t={}){const{window:n=k,scrollTarget:a,threshold:l=0,rootMargin:s,once:i=!1}=t,r=o.shallowRef(!1),{stop:c}=q(e,f=>{let u=r.value,d=0;for(const p of f)p.time>=d&&(d=p.time,u=p.isIntersecting);r.value=u,i&&S.watchOnce(r,()=>{c()})},{root:a,window:n,threshold:l,rootMargin:o.toValue(s)});return r}const ot={mounted(e,t){if(typeof t.value=="function"){const n=t.value,a=Q(e);o.watch(a,l=>n(l),{immediate:!0})}else{const[n,a]=t.value,l=Q(e,a);o.watch(l,s=>n(s),{immediate:!0})}}},at=o.defineComponent({name:"UseEyeDropper",props:{sRGBHex:String},setup(e,{slots:t}){const n=o.reactive(C.useEyeDropper());return()=>{if(t.default)return t.default(n)}}}),lt=o.defineComponent({name:"UseFullscreen",props:["as"],setup(e,{slots:t}){const n=o.shallowRef(),a=o.reactive(C.useFullscreen(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}}),st=o.defineComponent({name:"UseGeolocation",props:["enableHighAccuracy","maximumAge","timeout","navigator"],setup(e,{slots:t}){const n=o.reactive(C.useGeolocation(e));return()=>{if(t.default)return t.default(n)}}}),rt=o.defineComponent({name:"UseIdle",props:["timeout","events","listenForVisibilityChange","initialState"],setup(e,{slots:t}){const n=o.reactive(C.useIdle(e.timeout,e));return()=>{if(t.default)return t.default(n)}}});function it(e,t,n){const{immediate:a=!0,delay:l=0,onError:s=S.noop,onSuccess:i=S.noop,resetOnExecute:r=!0,shallow:c=!0,throwError:f}=n??{},u=c?o.shallowRef(t):o.ref(t),d=o.shallowRef(!1),p=o.shallowRef(!1),U=o.shallowRef(void 0);async function g(m=0,...w){r&&(u.value=t),U.value=void 0,d.value=!1,p.value=!0,m>0&&await S.promiseTimeout(m);const O=typeof e=="function"?e(...w):e;try{const R=await O;u.value=R,d.value=!0,i(R)}catch(R){if(U.value=R,s(R),f)throw R}finally{p.value=!1}return u.value}a&&g(l);const b={state:u,isReady:d,isLoading:p,error:U,execute:g};function h(){return new Promise((m,w)=>{S.until(p).toBe(!1).then(()=>m(b)).catch(w)})}return{...b,then(m,w){return h().then(m,w)}}}async function ut(e){return new Promise((t,n)=>{const a=new Image,{src:l,srcset:s,sizes:i,class:r,loading:c,crossorigin:f,referrerPolicy:u,width:d,height:p,decoding:U,fetchPriority:g,ismap:b,usemap:h}=e;a.src=l,s!=null&&(a.srcset=s),i!=null&&(a.sizes=i),r!=null&&(a.className=r),c!=null&&(a.loading=c),f!=null&&(a.crossOrigin=f),u!=null&&(a.referrerPolicy=u),d!=null&&(a.width=d),p!=null&&(a.height=p),U!=null&&(a.decoding=U),g!=null&&(a.fetchPriority=g),b!=null&&(a.isMap=b),h!=null&&(a.useMap=h),a.onload=()=>t(a),a.onerror=n})}function ct(e,t={}){const n=it(()=>ut(o.toValue(e)),void 0,{resetOnExecute:!0,...t});return o.watch(()=>o.toValue(e),()=>n.execute(t.delay),{deep:!0}),n}const ft=o.defineComponent({name:"UseImage",props:["src","srcset","sizes","as","alt","class","loading","crossorigin","referrerPolicy","width","height","decoding","fetchPriority","ismap","usemap"],setup(e,{slots:t}){const n=o.reactive(ct(e));return()=>n.isLoading&&t.loading?t.loading(n):n.error&&t.error?t.error(n.error):t.default?t.default(n):o.h(e.as||"img",e)}});function x(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}const ue=1;function Z(e,t={}){const{throttle:n=0,idle:a=200,onStop:l=S.noop,onScroll:s=S.noop,offset:i={left:0,right:0,top:0,bottom:0},eventListenerOptions:r={capture:!1,passive:!0},behavior:c="auto",window:f=k,onError:u=v=>{console.error(v)}}=t,d=o.shallowRef(0),p=o.shallowRef(0),U=o.computed({get(){return d.value},set(v){b(v,void 0)}}),g=o.computed({get(){return p.value},set(v){b(void 0,v)}});function b(v,D){var L,W,B,I;if(!f)return;const _=o.toValue(e);if(!_)return;(B=_ instanceof Document?f.document.body:_)==null||B.scrollTo({top:(L=o.toValue(D))!=null?L:g.value,left:(W=o.toValue(v))!=null?W:U.value,behavior:o.toValue(c)});const E=((I=_?.document)==null?void 0:I.documentElement)||_?.documentElement||_;U!=null&&(d.value=E.scrollLeft),g!=null&&(p.value=E.scrollTop)}const h=o.shallowRef(!1),m=o.reactive({left:!0,right:!1,top:!0,bottom:!1}),w=o.reactive({left:!1,right:!1,top:!1,bottom:!1}),O=v=>{h.value&&(h.value=!1,w.left=!1,w.right=!1,w.top=!1,w.bottom=!1,l(v))},R=S.useDebounceFn(O,n+a),P=v=>{var D;if(!f)return;const L=((D=v?.document)==null?void 0:D.documentElement)||v?.documentElement||V(v),{display:W,flexDirection:B,direction:I}=getComputedStyle(L),_=I==="rtl"?-1:1,E=L.scrollLeft;w.left=E<d.value,w.right=E>d.value;const A=Math.abs(E*_)<=(i.left||0),z=Math.abs(E*_)+L.clientWidth>=L.scrollWidth-(i.right||0)-ue;W==="flex"&&B==="row-reverse"?(m.left=z,m.right=A):(m.left=A,m.right=z),d.value=E;let H=L.scrollTop;v===f.document&&!H&&(H=f.document.body.scrollTop),w.top=H<p.value,w.bottom=H>p.value;const ve=Math.abs(H)<=(i.top||0),ge=Math.abs(H)+L.clientHeight>=L.scrollHeight-(i.bottom||0)-ue;W==="flex"&&B==="column-reverse"?(m.top=ge,m.bottom=ve):(m.top=ve,m.bottom=ge),p.value=H},T=v=>{var D;if(!f)return;const L=(D=v.target.documentElement)!=null?D:v.target;P(L),h.value=!0,R(v),s(v)};return M(e,"scroll",n?S.useThrottleFn(T,n,!0,!1):T,r),S.tryOnMounted(()=>{try{const v=o.toValue(e);if(!v)return;P(v)}catch(v){u(v)}}),M(e,"scrollend",O,r),{x:U,y:g,isScrolling:h,arrivedState:m,directions:w,measure(){const v=o.toValue(e);f&&v&&P(v)}}}function ce(e,t,n={}){var a;const{direction:l="bottom",interval:s=100,canLoadMore:i=()=>!0}=n,r=o.reactive(Z(e,{...n,offset:{[l]:(a=n.distance)!=null?a:0,...n.offset}})),c=o.ref(),f=o.computed(()=>!!c.value),u=o.computed(()=>x(o.toValue(e))),d=Q(u);function p(){if(r.measure(),!u.value||!d.value||!i(u.value))return;const{scrollHeight:g,clientHeight:b,scrollWidth:h,clientWidth:m}=u.value,w=l==="bottom"||l==="top"?g<=b:h<=m;(r.arrivedState[l]||w)&&(c.value||(c.value=Promise.all([t(r),new Promise(O=>setTimeout(O,s))]).finally(()=>{c.value=null,o.nextTick(()=>p())})))}const U=o.watch(()=>[r.arrivedState[l],d.value],p,{immediate:!0});return S.tryOnUnmounted(U),{isLoading:f,reset(){o.nextTick(()=>p())}}}const dt={mounted(e,t){typeof t.value=="function"?ce(e,t.value):ce(e,...t.value)}},mt={mounted(e,t){typeof t.value=="function"?q(e,t.value):q(e,...t.value)}},pt=o.defineComponent({name:"UseMouse",props:["touch","resetOnTouchEnds","initialValue"],setup(e,{slots:t}){const n=o.reactive(C.useMouse(e));return()=>{if(t.default)return t.default(n)}}}),ht=o.defineComponent({name:"UseMouseElement",props:["handleOutside","as"],setup(e,{slots:t}){const n=o.shallowRef(),a=o.reactive(C.useMouseInElement(n,e));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}}),vt={page:e=>[e.pageX,e.pageY],client:e=>[e.clientX,e.clientY],screen:e=>[e.screenX,e.screenY],movement:e=>e instanceof MouseEvent?[e.movementX,e.movementY]:null};function gt(e={}){const{type:t="page",touch:n=!0,resetOnTouchEnds:a=!1,initialValue:l={x:0,y:0},window:s=k,target:i=s,scroll:r=!0,eventFilter:c}=e;let f=null,u=0,d=0;const p=o.shallowRef(l.x),U=o.shallowRef(l.y),g=o.shallowRef(null),b=typeof t=="function"?t:vt[t],h=v=>{const D=b(v);f=v,D&&([p.value,U.value]=D,g.value="mouse"),s&&(u=s.scrollX,d=s.scrollY)},m=v=>{if(v.touches.length>0){const D=b(v.touches[0]);D&&([p.value,U.value]=D,g.value="touch")}},w=()=>{if(!f||!s)return;const v=b(f);f instanceof MouseEvent&&v&&(p.value=v[0]+s.scrollX-u,U.value=v[1]+s.scrollY-d)},O=()=>{p.value=l.x,U.value=l.y},R=c?v=>c(()=>h(v),{}):v=>h(v),P=c?v=>c(()=>m(v),{}):v=>m(v),T=c?()=>c(()=>w(),{}):()=>w();if(i){const v={passive:!0};M(i,["mousemove","dragover"],R,v),n&&t!=="movement"&&(M(i,["touchstart","touchmove"],P,v),a&&M(i,"touchend",O,v)),r&&t==="page"&&M(s,"scroll",T,v)}return{x:p,y:U,sourceType:g}}function yt(e,t={}){const{handleOutside:n=!0,window:a=k}=t,l=t.type||"page",{x:s,y:i,sourceType:r}=gt(t),c=o.shallowRef(e??a?.document.body),f=o.shallowRef(0),u=o.shallowRef(0),d=o.shallowRef(0),p=o.shallowRef(0),U=o.shallowRef(0),g=o.shallowRef(0),b=o.shallowRef(!0);let h=()=>{};return a&&(h=o.watch([c,s,i],()=>{const m=V(c);if(!m||!(m instanceof Element))return;const{left:w,top:O,width:R,height:P}=m.getBoundingClientRect();d.value=w+(l==="page"?a.pageXOffset:0),p.value=O+(l==="page"?a.pageYOffset:0),U.value=P,g.value=R;const T=s.value-d.value,v=i.value-p.value;b.value=R===0||P===0||T<0||v<0||T>R||v>P,(n||!b.value)&&(f.value=T,u.value=v)},{immediate:!0}),M(document,"mouseleave",()=>b.value=!0,{passive:!0})),{x:s,y:i,sourceType:r,elementX:f,elementY:u,elementPositionX:d,elementPositionY:p,elementHeight:U,elementWidth:g,isOutside:b,stop:h}}const wt={mounted(e,t){const[n,a]=typeof t.value=="function"?[t.value,{}]:t.value,l=S.reactiveOmit(o.reactive(yt(e,a)),"stop");o.watch(l,s=>n(s))}},Ut=o.defineComponent({name:"UseMousePressed",props:["touch","initialValue","as"],setup(e,{slots:t}){const n=o.shallowRef(),a=o.reactive(C.useMousePressed({...e,target:n}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}}),St=o.defineComponent({name:"UseNetwork",setup(e,{slots:t}){const n=o.reactive(C.useNetwork());return()=>{if(t.default)return t.default(n)}}}),bt=o.defineComponent({name:"UseNow",props:["interval"],setup(e,{slots:t}){const n=o.reactive(C.useNow({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),Ct=o.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:t}){const n=S.toRef(e,"object"),a=C.useObjectUrl(n);return()=>{if(t.default&&a.value)return t.default(a)}}}),Et=o.defineComponent({name:"UseOffsetPagination",props:["total","page","pageSize","onPageChange","onPageSizeChange","onPageCountChange"],emits:["page-change","page-size-change","page-count-change"],setup(e,{slots:t,emit:n}){const a=o.reactive(C.useOffsetPagination({...e,onPageChange(...l){var s;(s=e.onPageChange)==null||s.call(e,...l),n("page-change",...l)},onPageSizeChange(...l){var s;(s=e.onPageSizeChange)==null||s.call(e,...l),n("page-size-change",...l)},onPageCountChange(...l){var s;(s=e.onPageCountChange)==null||s.call(e,...l),n("page-count-change",...l)}}));return()=>{if(t.default)return t.default(a)}}}),Rt=o.defineComponent({name:"UseOnline",setup(e,{slots:t}){const n=o.reactive({isOnline:C.useOnline()});return()=>{if(t.default)return t.default(n)}}}),Ot=o.defineComponent({name:"UsePageLeave",setup(e,{slots:t}){const n=o.reactive({isLeft:C.usePageLeave()});return()=>{if(t.default)return t.default(n)}}}),Pt=o.defineComponent({name:"UsePointer",props:["pointerTypes","initialValue","target"],setup(e,{slots:t}){const n=o.shallowRef(null),a=o.reactive(C.usePointer({...e,target:e.target==="self"?n:k}));return()=>{if(t.default)return t.default(a,{ref:n})}}}),Vt=o.defineComponent({name:"UsePointerLock",props:["as"],setup(e,{slots:t}){const n=o.shallowRef(),a=o.reactive(C.usePointerLock(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}}),Mt=o.defineComponent({name:"UsePreferredColorScheme",setup(e,{slots:t}){const n=o.reactive({colorScheme:C.usePreferredColorScheme()});return()=>{if(t.default)return t.default(n)}}}),Dt=o.defineComponent({name:"UsePreferredContrast",setup(e,{slots:t}){const n=o.reactive({contrast:C.usePreferredContrast()});return()=>{if(t.default)return t.default(n)}}}),Tt=o.defineComponent({name:"UsePreferredDark",setup(e,{slots:t}){const n=o.reactive({prefersDark:C.usePreferredDark()});return()=>{if(t.default)return t.default(n)}}}),Lt=o.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:t}){const n=o.reactive({languages:C.usePreferredLanguages()});return()=>{if(t.default)return t.default(n)}}}),kt=o.defineComponent({name:"UsePreferredReducedMotion",setup(e,{slots:t}){const n=o.reactive({motion:C.usePreferredReducedMotion()});return()=>{if(t.default)return t.default(n)}}}),_t=o.defineComponent({name:"UsePreferredReducedTransparency",setup(e,{slots:t}){const n=o.reactive({transparency:C.usePreferredReducedTransparency()});return()=>{if(t.default)return t.default(n)}}}),At={mounted(e,t){typeof t.value=="function"?Y(e,t.value):Y(e,...t.value)}};function X(e,t,n={}){const{window:a=k,initialValue:l,observe:s=!1}=n,i=o.shallowRef(l),r=o.computed(()=>{var f;return V(t)||((f=a?.document)==null?void 0:f.documentElement)});function c(){var f;const u=o.toValue(e),d=o.toValue(r);if(d&&a&&u){const p=(f=a.getComputedStyle(d).getPropertyValue(u))==null?void 0:f.trim();i.value=p||i.value||l}}return s&&$(r,c,{attributeFilter:["style","class"],window:a}),o.watch([r,()=>o.toValue(e)],(f,u)=>{u[0]&&u[1]&&u[0].style.removeProperty(u[1]),c()},{immediate:!0}),o.watch([i,r],([f,u])=>{const d=o.toValue(e);u?.style&&d&&(f==null?u.style.removeProperty(d):u.style.setProperty(d,f))},{immediate:!0}),i}const fe="--vueuse-safe-area-top",de="--vueuse-safe-area-right",me="--vueuse-safe-area-bottom",pe="--vueuse-safe-area-left";function It(){const e=o.shallowRef(""),t=o.shallowRef(""),n=o.shallowRef(""),a=o.shallowRef("");if(S.isClient){const s=X(fe),i=X(de),r=X(me),c=X(pe);s.value="env(safe-area-inset-top, 0px)",i.value="env(safe-area-inset-right, 0px)",r.value="env(safe-area-inset-bottom, 0px)",c.value="env(safe-area-inset-left, 0px)",l(),M("resize",S.useDebounceFn(l),{passive:!0})}function l(){e.value=K(fe),t.value=K(de),n.value=K(me),a.value=K(pe)}return{top:e,right:t,bottom:n,left:a,update:l}}function K(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const Wt=o.defineComponent({name:"UseScreenSafeArea",props:{top:Boolean,right:Boolean,bottom:Boolean,left:Boolean},setup(e,{slots:t}){const{top:n,right:a,bottom:l,left:s}=It();return()=>{if(t.default)return o.h("div",{style:{paddingTop:e.top?n.value:"",paddingRight:e.right?a.value:"",paddingBottom:e.bottom?l.value:"",paddingLeft:e.left?s.value:"",boxSizing:"border-box",maxHeight:"100vh",maxWidth:"100vw",overflow:"auto"}},t.default())}}}),zt={mounted(e,t){if(typeof t.value=="function"){const n=t.value,a=Z(e,{onScroll(){n(a)},onStop(){n(a)}})}else{const[n,a]=t.value,l=Z(e,{...a,onScroll(s){var i;(i=a.onScroll)==null||i.call(a,s),n(l)},onStop(s){var i;(i=a.onStop)==null||i.call(a,s),n(l)}})}}};function he(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!n||n.tagName==="BODY"?!1:he(n)}}function Bt(e){const t=e||window.event,n=t.target;return he(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const ee=new WeakMap;function Ht(e,t=!1){const n=o.shallowRef(t);let a=null,l="";o.watch(S.toRef(e),r=>{const c=x(o.toValue(r));if(c){const f=c;if(ee.get(f)||ee.set(f,f.style.overflow),f.style.overflow!=="hidden"&&(l=f.style.overflow),f.style.overflow==="hidden")return n.value=!0;if(n.value)return f.style.overflow="hidden"}},{immediate:!0});const s=()=>{const r=x(o.toValue(e));!r||n.value||(S.isIOS&&(a=M(r,"touchmove",c=>{Bt(c)},{passive:!1})),r.style.overflow="hidden",n.value=!0)},i=()=>{const r=x(o.toValue(e));!r||!n.value||(S.isIOS&&a?.(),r.style.overflow=l,ee.delete(r),n.value=!1)};return S.tryOnScopeDispose(i),o.computed({get(){return n.value},set(r){r?s():i()}})}function Nt(){let e=!1;const t=o.shallowRef(!1);return(n,a)=>{if(t.value=a.value,e)return;e=!0;const l=Ht(n,a.value);o.watch(t,s=>l.value=s)}}const Ft=Nt(),jt=o.defineComponent({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages","showSecond"],setup(e,{slots:t}){const n=o.reactive(C.useTimeAgo(()=>e.time,{...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),Yt=o.defineComponent({name:"UseTimestamp",props:["immediate","interval","offset"],setup(e,{slots:t}){const n=o.reactive(C.useTimestamp({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),xt=o.defineComponent({name:"UseVirtualList",props:["list","options","height"],setup(e,{slots:t,expose:n}){const{list:a}=o.toRefs(e),{list:l,containerProps:s,wrapperProps:i,scrollTo:r}=C.useVirtualList(a,e.options);return n({scrollTo:r}),s.style&&typeof s.style=="object"&&!Array.isArray(s.style)&&(s.style.height=e.height||"300px"),()=>o.h("div",{...s},[o.h("div",{...i.value},l.value.map(c=>o.h("div",{style:{overflow:"hidden",height:c.height}},t.default?t.default(c):"Please set content!")))])}}),Xt=o.defineComponent({name:"UseWindowFocus",setup(e,{slots:t}){const n=o.reactive({focused:C.useWindowFocus()});return()=>{if(t.default)return t.default(n)}}}),Kt=o.defineComponent({name:"UseWindowSize",props:["initialWidth","initialHeight"],setup(e,{slots:t}){const n=o.reactive(C.useWindowSize(e));return()=>{if(t.default)return t.default(n)}}});y.OnClickOutside=ye,y.OnLongPress=Ce,y.UseActiveElement=Ee,y.UseBattery=Re,y.UseBrowserLocation=Oe,y.UseClipboard=Pe,y.UseColorMode=He,y.UseDark=Ne,y.UseDeviceMotion=Fe,y.UseDeviceOrientation=je,y.UseDevicePixelRatio=Ye,y.UseDevicesList=xe,y.UseDocumentVisibility=Xe,y.UseDraggable=Ke,y.UseElementBounding=Ge,y.UseElementSize=Ze,y.UseElementVisibility=nt,y.UseEyeDropper=at,y.UseFullscreen=lt,y.UseGeolocation=st,y.UseIdle=rt,y.UseImage=ft,y.UseMouse=pt,y.UseMouseInElement=ht,y.UseMousePressed=Ut,y.UseNetwork=St,y.UseNow=bt,y.UseObjectUrl=Ct,y.UseOffsetPagination=Et,y.UseOnline=Rt,y.UsePageLeave=Ot,y.UsePointer=Pt,y.UsePointerLock=Vt,y.UsePreferredColorScheme=Mt,y.UsePreferredContrast=Dt,y.UsePreferredDark=Tt,y.UsePreferredLanguages=Lt,y.UsePreferredReducedMotion=kt,y.UsePreferredReducedTransparency=_t,y.UseScreenSafeArea=Wt,y.UseTimeAgo=jt,y.UseTimestamp=Yt,y.UseVirtualList=xt,y.UseWindowFocus=Xt,y.UseWindowSize=Kt,y.VOnClickOutside=oe,y.VOnLongPress=le,y.vElementBounding=$e,y.vElementHover=Qe,y.vElementSize=tt,y.vElementVisibility=ot,y.vInfiniteScroll=dt,y.vIntersectionObserver=mt,y.vMouseInElement=wt,y.vOnClickOutside=oe,y.vOnKeyStroke=Ue,y.vOnLongPress=le,y.vResizeObserver=At,y.vScroll=zt,y.vScrollLock=Ft})(this.VueUse=this.VueUse||{},VueUse,Vue,VueUse);
|
|
1
|
+
(function(y,E,o,U){"use strict";const Ue=o.defineComponent({name:"OnClickOutside",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const a=o.shallowRef();return E.onClickOutside(a,s=>{n("trigger",s)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:a},t.default())}}}),I=U.isClient?window:void 0;function L(e){var t;const n=o.toValue(e);return(t=n?.$el)!=null?t:n}function D(...e){const t=[],n=()=>{t.forEach(r=>r()),t.length=0},a=(r,c,f,i)=>(r.addEventListener(c,f,i),()=>r.removeEventListener(c,f,i)),s=o.computed(()=>{const r=U.toArray(o.toValue(e[0])).filter(c=>c!=null);return r.every(c=>typeof c!="string")?r:void 0}),l=U.watchImmediate(()=>{var r,c;return[(c=(r=s.value)==null?void 0:r.map(f=>L(f)))!=null?c:[I].filter(f=>f!=null),U.toArray(o.toValue(s.value?e[1]:e[0])),U.toArray(o.unref(s.value?e[2]:e[1])),o.toValue(s.value?e[3]:e[2])]},([r,c,f,i])=>{if(n(),!r?.length||!c?.length||!f?.length)return;const d=U.isObject(i)?{...i}:i;t.push(...r.flatMap(p=>c.flatMap(g=>f.map(v=>a(p,g,v,d)))))},{flush:"post"}),u=()=>{l(),n()};return U.tryOnScopeDispose(n),u}let te=!1;function ne(e,t,n={}){const{window:a=I,ignore:s=[],capture:l=!0,detectIframe:u=!1,controls:r=!1}=n;if(!a)return r?{stop:U.noop,cancel:U.noop,trigger:U.noop}:U.noop;if(U.isIOS&&!te){te=!0;const h={passive:!0};Array.from(a.document.body.children).forEach(m=>m.addEventListener("click",U.noop,h)),a.document.documentElement.addEventListener("click",U.noop,h)}let c=!0;const f=h=>o.toValue(s).some(m=>{if(typeof m=="string")return Array.from(a.document.querySelectorAll(m)).some(w=>w===h.target||h.composedPath().includes(w));{const w=L(m);return w&&(h.target===w||h.composedPath().includes(w))}});function i(h){const m=o.toValue(h);return m&&m.$.subTree.shapeFlag===16}function d(h,m){const w=o.toValue(h),O=w.$.subTree&&w.$.subTree.children;return O==null||!Array.isArray(O)?!1:O.some(b=>b.el===m.target||m.composedPath().includes(b.el))}const p=h=>{const m=L(e);if(h.target!=null&&!(!(m instanceof Element)&&i(e)&&d(e,h))&&!(!m||m===h.target||h.composedPath().includes(m))){if("detail"in h&&h.detail===0&&(c=!f(h)),!c){c=!0;return}t(h)}};let g=!1;const v=[D(a,"click",h=>{g||(g=!0,setTimeout(()=>{g=!1},0),p(h))},{passive:!0,capture:l}),D(a,"pointerdown",h=>{const m=L(e);c=!f(h)&&!!(m&&!h.composedPath().includes(m))},{passive:!0}),u&&D(a,"blur",h=>{setTimeout(()=>{var m;const w=L(e);((m=a.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!w?.contains(a.document.activeElement)&&t(h)},0)},{passive:!0})].filter(Boolean),C=()=>v.forEach(h=>h());return r?{stop:C,cancel:()=>{c=!1},trigger:h=>{c=!0,p(h),c=!1}}:C}const J=new WeakMap,oe={mounted(e,t){const n=!t.modifiers.bubble;let a;if(typeof t.value=="function")a=ne(e,t.value,{capture:n});else{const[s,l]=t.value;a=ne(e,s,Object.assign({capture:n},l))}J.set(e,a)},unmounted(e){const t=J.get(e);t&&typeof t=="function"?t():t?.stop(),J.delete(e)}};function be(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function ae(...e){let t,n,a={};e.length===3?(t=e[0],n=e[1],a=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],a=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:s=I,eventName:l="keydown",passive:u=!1,dedupe:r=!1}=a,c=be(t);return D(s,l,i=>{i.repeat&&o.toValue(r)||c(i)&&n(i)},u)}const Se={mounted(e,t){var n,a;const s=(a=(n=t.arg)==null?void 0:n.split(","))!=null?a:!0;if(typeof t.value=="function")ae(s,t.value,{target:e});else{const[l,u]=t.value;ae(s,l,{target:e,...u})}}},Ce=500,Ee=10;function $(e,t,n){var a,s;const l=o.computed(()=>L(e));let u,r,c,f=!1;function i(){u&&(clearTimeout(u),u=void 0),r=void 0,c=void 0,f=!1}function d(m){var w,O,b;const[V,k,R]=[c,r,f];if(i(),!n?.onMouseUp||!k||!V||(w=n?.modifiers)!=null&&w.self&&m.target!==l.value)return;(O=n?.modifiers)!=null&&O.prevent&&m.preventDefault(),(b=n?.modifiers)!=null&&b.stop&&m.stopPropagation();const _=m.x-k.x,S=m.y-k.y,A=Math.sqrt(_*_+S*S);n.onMouseUp(m.timeStamp-V,A,R)}function p(m){var w,O,b,V;(w=n?.modifiers)!=null&&w.self&&m.target!==l.value||(i(),(O=n?.modifiers)!=null&&O.prevent&&m.preventDefault(),(b=n?.modifiers)!=null&&b.stop&&m.stopPropagation(),r={x:m.x,y:m.y},c=m.timeStamp,u=setTimeout(()=>{f=!0,t(m)},(V=n?.delay)!=null?V:Ce))}function g(m){var w,O,b,V;if((w=n?.modifiers)!=null&&w.self&&m.target!==l.value||!r||n?.distanceThreshold===!1)return;(O=n?.modifiers)!=null&&O.prevent&&m.preventDefault(),(b=n?.modifiers)!=null&&b.stop&&m.stopPropagation();const k=m.x-r.x,R=m.y-r.y;Math.sqrt(k*k+R*R)>=((V=n?.distanceThreshold)!=null?V:Ee)&&i()}const v={capture:(a=n?.modifiers)==null?void 0:a.capture,once:(s=n?.modifiers)==null?void 0:s.once},C=[D(l,"pointerdown",p,v),D(l,"pointermove",g,v),D(l,["pointerup","pointerleave"],d,v)];return()=>C.forEach(m=>m())}const Re=o.defineComponent({name:"OnLongPress",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const a=o.shallowRef();return $(a,s=>{n("trigger",s)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:a},t.default())}}}),se={mounted(e,t){typeof t.value=="function"?$(e,t.value,{modifiers:t.modifiers}):$(e,...t.value)}},Oe=o.defineComponent({name:"UseActiveElement",setup(e,{slots:t}){const n=o.reactive({element:E.useActiveElement()});return()=>{if(t.default)return t.default(n)}}}),Pe=o.defineComponent({name:"UseBattery",setup(e,{slots:t}){const n=o.reactive(E.useBattery(e));return()=>{if(t.default)return t.default(n)}}}),Ve=o.defineComponent({name:"UseBrowserLocation",setup(e,{slots:t}){const n=o.reactive(E.useBrowserLocation());return()=>{if(t.default)return t.default(n)}}}),Me=o.defineComponent({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(e,{slots:t}){const n=o.reactive(E.useClipboard(e));return()=>{var a;return(a=t.default)==null?void 0:a.call(t,n)}}}),j=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},x="__vueuse_ssr_handlers__",De=Le();function Le(){return x in j||(j[x]=j[x]||{}),j[x]}function le(e,t){return De[e]||t}const Te=Symbol("vueuse-ssr-width");function _e(){const e=o.hasInjectionContext()?U.injectLocal(Te,null):null;return typeof e=="number"?e:void 0}function ke(){const e=o.shallowRef(!1),t=o.getCurrentInstance();return t&&o.onMounted(()=>{e.value=!0},t),e}function Y(e){const t=ke();return o.computed(()=>(t.value,!!e()))}function Ae(e,t={}){const{window:n=I,ssrWidth:a=_e()}=t,s=Y(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),l=o.shallowRef(typeof a=="number"),u=o.shallowRef(),r=o.shallowRef(!1),c=f=>{r.value=f.matches};return o.watchEffect(()=>{if(l.value){l.value=!s.value;const f=o.toValue(e).split(",");r.value=f.some(i=>{const d=i.includes("not all"),p=i.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),g=i.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let v=!!(p||g);return p&&v&&(v=a>=U.pxValue(p[1])),g&&v&&(v=a<=U.pxValue(g[1])),d?!v:v});return}s.value&&(u.value=n.matchMedia(o.toValue(e)),r.value=u.value.matches)}),D(u,"change",c,{passive:!0}),o.computed(()=>r.value)}function ze(e){return Ae("(prefers-color-scheme: dark)",e)}function Ie(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const We={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},re="vueuse-storage";function Be(e,t,n,a={}){var s;const{flush:l="pre",deep:u=!0,listenToStorageChanges:r=!0,writeDefaults:c=!0,mergeDefaults:f=!1,shallow:i,window:d=I,eventFilter:p,onError:g=P=>{console.error(P)},initOnMounted:v}=a,C=(i?o.shallowRef:o.ref)(typeof t=="function"?t():t),h=o.computed(()=>o.toValue(e));if(!n)try{n=le("getDefaultStorage",()=>{var P;return(P=I)==null?void 0:P.localStorage})()}catch(P){g(P)}if(!n)return C;const m=o.toValue(t),w=Ie(m),O=(s=a.serializer)!=null?s:We[w],{pause:b,resume:V}=U.pausableWatch(C,()=>A(C.value),{flush:l,deep:u,eventFilter:p});o.watch(h,()=>W(),{flush:l});let k=!1;const R=P=>{v&&!k||W(P)},_=P=>{v&&!k||B(P)};d&&r&&(n instanceof Storage?D(d,"storage",R,{passive:!0}):D(d,re,_)),v?U.tryOnMounted(()=>{k=!0,W()}):W();function S(P,M){if(d){const z={key:h.value,oldValue:P,newValue:M,storageArea:n};d.dispatchEvent(n instanceof Storage?new StorageEvent("storage",z):new CustomEvent(re,{detail:z}))}}function A(P){try{const M=n.getItem(h.value);if(P==null)S(M,null),n.removeItem(h.value);else{const z=O.write(P);M!==z&&(n.setItem(h.value,z),S(M,z))}}catch(M){g(M)}}function T(P){const M=P?P.newValue:n.getItem(h.value);if(M==null)return c&&m!=null&&n.setItem(h.value,O.write(m)),m;if(!P&&f){const z=O.read(M);return typeof f=="function"?f(z,m):w==="object"&&!Array.isArray(z)?{...m,...z}:z}else return typeof M!="string"?M:O.read(M)}function W(P){if(!(P&&P.storageArea!==n)){if(P&&P.key==null){C.value=m;return}if(!(P&&P.key!==h.value)){b();try{P?.newValue!==O.write(C.value)&&(C.value=T(P))}catch(M){g(M)}finally{P?o.nextTick(V):V()}}}}function B(P){W(P.detail)}return C}const He="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Ne(e={}){const{selector:t="html",attribute:n="class",initialValue:a="auto",window:s=I,storage:l,storageKey:u="vueuse-color-scheme",listenToStorageChanges:r=!0,storageRef:c,emitAuto:f,disableTransition:i=!0}=e,d={auto:"",light:"light",dark:"dark",...e.modes||{}},p=ze({window:s}),g=o.computed(()=>p.value?"dark":"light"),v=c||(u==null?U.toRef(a):Be(u,a,l,{window:s,listenToStorageChanges:r})),C=o.computed(()=>v.value==="auto"?g.value:v.value),h=le("updateHTMLAttrs",(b,V,k)=>{const R=typeof b=="string"?s?.document.querySelector(b):L(b);if(!R)return;const _=new Set,S=new Set;let A=null;if(V==="class"){const W=k.split(/\s/g);Object.values(d).flatMap(B=>(B||"").split(/\s/g)).filter(Boolean).forEach(B=>{W.includes(B)?_.add(B):S.add(B)})}else A={key:V,value:k};if(_.size===0&&S.size===0&&A===null)return;let T;i&&(T=s.document.createElement("style"),T.appendChild(document.createTextNode(He)),s.document.head.appendChild(T));for(const W of _)R.classList.add(W);for(const W of S)R.classList.remove(W);A&&R.setAttribute(A.key,A.value),i&&(s.getComputedStyle(T).opacity,document.head.removeChild(T))});function m(b){var V;h(t,n,(V=d[b])!=null?V:b)}function w(b){e.onChanged?e.onChanged(b,m):m(b)}o.watch(C,w,{flush:"post",immediate:!0}),U.tryOnMounted(()=>w(C.value));const O=o.computed({get(){return f?v.value:C.value},set(b){v.value=b}});return Object.assign(O,{store:v,system:g,state:C})}const Fe=o.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:t}){const n=Ne(e),a=o.reactive({mode:n,system:n.system,store:n.store});return()=>{if(t.default)return t.default(a)}}}),je=o.defineComponent({name:"UseDark",props:["selector","attribute","valueDark","valueLight","onChanged","storageKey","storage"],setup(e,{slots:t}){const n=E.useDark(e),a=o.reactive({isDark:n,toggleDark:U.useToggle(n)});return()=>{if(t.default)return t.default(a)}}}),xe=o.defineComponent({name:"UseDeviceMotion",setup(e,{slots:t}){const n=E.useDeviceMotion();return()=>{if(t.default)return t.default(n)}}}),Ye=o.defineComponent({name:"UseDeviceOrientation",setup(e,{slots:t}){const n=o.reactive(E.useDeviceOrientation());return()=>{if(t.default)return t.default(n)}}}),Xe=o.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:t}){const n=o.reactive({pixelRatio:E.useDevicePixelRatio()});return()=>{if(t.default)return t.default(n)}}}),Ke=o.defineComponent({name:"UseDevicesList",props:["onUpdated","requestPermissions","constraints"],setup(e,{slots:t}){const n=o.reactive(E.useDevicesList(e));return()=>{if(t.default)return t.default(n)}}}),Ge=o.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:t}){const n=o.reactive({visibility:E.useDocumentVisibility()});return()=>{if(t.default)return t.default(n)}}}),Je=o.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as","handle","axis","onStart","onMove","onEnd","disabled","buttons","containerElement"],setup(e,{slots:t}){const n=o.shallowRef(),a=o.computed(()=>{var i;return(i=o.toValue(e.handle))!=null?i:n.value}),s=o.computed(()=>{var i;return(i=e.containerElement)!=null?i:void 0}),l=o.computed(()=>!!e.disabled),u=e.storageKey&&E.useStorage(e.storageKey,o.toValue(e.initialValue)||{x:0,y:0},E.isClient?e.storageType==="session"?sessionStorage:localStorage:void 0),r=u||e.initialValue||{x:0,y:0},c=(i,d)=>{var p;(p=e.onEnd)==null||p.call(e,i,d),u&&(u.value.x=i.x,u.value.y=i.y)},f=o.reactive(E.useDraggable(n,{...e,handle:a,initialValue:r,onEnd:c,disabled:l,containerElement:s}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n,style:`touch-action:none;${f.style}`},t.default(f))}}}),$e=o.defineComponent({name:"UseElementBounding",props:["box","as"],setup(e,{slots:t}){const n=o.shallowRef(),a=o.reactive(E.useElementBounding(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}});function N(e,t,n={}){const{window:a=I,...s}=n;let l;const u=Y(()=>a&&"MutationObserver"in a),r=()=>{l&&(l.disconnect(),l=void 0)},c=o.computed(()=>{const p=o.toValue(e),g=U.toArray(p).map(L).filter(U.notNullish);return new Set(g)}),f=o.watch(()=>c.value,p=>{r(),u.value&&p.size&&(l=new MutationObserver(t),p.forEach(g=>l.observe(g,s)))},{immediate:!0,flush:"post"}),i=()=>l?.takeRecords(),d=()=>{f(),r()};return U.tryOnScopeDispose(d),{isSupported:u,stop:d,takeRecords:i}}function F(e,t,n={}){const{window:a=I,...s}=n;let l;const u=Y(()=>a&&"ResizeObserver"in a),r=()=>{l&&(l.disconnect(),l=void 0)},c=o.computed(()=>{const d=o.toValue(e);return Array.isArray(d)?d.map(p=>L(p)):[L(d)]}),f=o.watch(c,d=>{if(r(),u.value&&a){l=new ResizeObserver(t);for(const p of d)p&&l.observe(p,s)}},{immediate:!0,flush:"post"}),i=()=>{r(),f()};return U.tryOnScopeDispose(i),{isSupported:u,stop:i}}function qe(e,t={}){const{reset:n=!0,windowResize:a=!0,windowScroll:s=!0,immediate:l=!0,updateTiming:u="sync"}=t,r=o.shallowRef(0),c=o.shallowRef(0),f=o.shallowRef(0),i=o.shallowRef(0),d=o.shallowRef(0),p=o.shallowRef(0),g=o.shallowRef(0),v=o.shallowRef(0);function C(){const m=L(e);if(!m){n&&(r.value=0,c.value=0,f.value=0,i.value=0,d.value=0,p.value=0,g.value=0,v.value=0);return}const w=m.getBoundingClientRect();r.value=w.height,c.value=w.bottom,f.value=w.left,i.value=w.right,d.value=w.top,p.value=w.width,g.value=w.x,v.value=w.y}function h(){u==="sync"?C():u==="next-frame"&&requestAnimationFrame(()=>C())}return F(e,h),o.watch(()=>L(e),m=>!m&&h()),N(e,h,{attributeFilter:["style","class"]}),s&&D("scroll",h,{capture:!0,passive:!0}),a&&D("resize",h,{passive:!0}),U.tryOnMounted(()=>{l&&h()}),{height:r,bottom:c,left:f,right:i,top:d,width:p,x:g,y:v,update:h}}const Qe={mounted(e,t){const[n,a]=typeof t.value=="function"?[t.value,{}]:t.value,{height:s,bottom:l,left:u,right:r,top:c,width:f,x:i,y:d}=qe(e,a);o.watch([s,l,u,r,c,f,i,d],()=>n({height:s,bottom:l,left:u,right:r,top:c,width:f,x:i,y:d}))}};function Ze(e,t,n={}){const{window:a=I,document:s=a?.document,flush:l="sync"}=n;if(!a||!s)return U.noop;let u;const r=i=>{u?.(),u=i},c=o.watchEffect(()=>{const i=L(e);if(i){const{stop:d}=N(s,p=>{p.map(v=>[...v.removedNodes]).flat().some(v=>v===i||v.contains(i))&&t(p)},{window:a,childList:!0,subtree:!0});r(d)}},{flush:l}),f=()=>{c(),r()};return U.tryOnScopeDispose(f),f}function ie(e,t={}){const{delayEnter:n=0,delayLeave:a=0,triggerOnRemoval:s=!1,window:l=I}=t,u=o.shallowRef(!1);let r;const c=f=>{const i=f?n:a;r&&(clearTimeout(r),r=void 0),i?r=setTimeout(()=>u.value=f,i):u.value=f};return l&&(D(e,"mouseenter",()=>c(!0),{passive:!0}),D(e,"mouseleave",()=>c(!1),{passive:!0}),s&&Ze(o.computed(()=>L(e)),()=>c(!1))),u}const et={mounted(e,t){const n=t.value;if(typeof n=="function"){const a=ie(e);o.watch(a,s=>n(s))}else{const[a,s]=n,l=ie(e,s);o.watch(l,u=>a(u))}}},tt=o.defineComponent({name:"UseElementSize",props:["width","height","box","as"],setup(e,{slots:t}){var n,a;const s=o.shallowRef(),l=o.reactive(E.useElementSize(s,{width:(n=e.width)!=null?n:0,height:(a=e.height)!=null?a:0},{box:e.box}));return()=>{if(t.default)return o.h(e.as||"div",{ref:s},t.default(l))}}});function nt(e,t={width:0,height:0},n={}){const{window:a=I,box:s="content-box"}=n,l=o.computed(()=>{var d,p;return(p=(d=L(e))==null?void 0:d.namespaceURI)==null?void 0:p.includes("svg")}),u=o.shallowRef(t.width),r=o.shallowRef(t.height),{stop:c}=F(e,([d])=>{const p=s==="border-box"?d.borderBoxSize:s==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(a&&l.value){const g=L(e);if(g){const v=g.getBoundingClientRect();u.value=v.width,r.value=v.height}}else if(p){const g=U.toArray(p);u.value=g.reduce((v,{inlineSize:C})=>v+C,0),r.value=g.reduce((v,{blockSize:C})=>v+C,0)}else u.value=d.contentRect.width,r.value=d.contentRect.height},n);U.tryOnMounted(()=>{const d=L(e);d&&(u.value="offsetWidth"in d?d.offsetWidth:t.width,r.value="offsetHeight"in d?d.offsetHeight:t.height)});const f=o.watch(()=>L(e),d=>{u.value=d?t.width:0,r.value=d?t.height:0});function i(){c(),f()}return{width:u,height:r,stop:i}}const ot={mounted(e,t){var n;const a=typeof t.value=="function"?t.value:(n=t.value)==null?void 0:n[0],s=typeof t.value=="function"?[]:t.value.slice(1),{width:l,height:u}=nt(e,...s);o.watch([l,u],([r,c])=>a({width:r,height:c}))}},at=o.defineComponent({name:"UseElementVisibility",props:["as"],setup(e,{slots:t}){const n=o.shallowRef(),a=o.reactive({isVisible:E.useElementVisibility(n)});return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}});function q(e,t,n={}){const{root:a,rootMargin:s="0px",threshold:l=0,window:u=I,immediate:r=!0}=n,c=Y(()=>u&&"IntersectionObserver"in u),f=o.computed(()=>{const v=o.toValue(e);return U.toArray(v).map(L).filter(U.notNullish)});let i=U.noop;const d=o.shallowRef(r),p=c.value?o.watch(()=>[f.value,L(a),d.value],([v,C])=>{if(i(),!d.value||!v.length)return;const h=new IntersectionObserver(t,{root:L(C),rootMargin:s,threshold:l});v.forEach(m=>m&&h.observe(m)),i=()=>{h.disconnect(),i=U.noop}},{immediate:r,flush:"post"}):U.noop,g=()=>{i(),p(),d.value=!1};return U.tryOnScopeDispose(g),{isSupported:c,isActive:d,pause(){i(),d.value=!1},resume(){d.value=!0},stop:g}}function Q(e,t={}){const{window:n=I,scrollTarget:a,threshold:s=0,rootMargin:l,once:u=!1}=t,r=o.shallowRef(!1),{stop:c}=q(e,f=>{let i=r.value,d=0;for(const p of f)p.time>=d&&(d=p.time,i=p.isIntersecting);r.value=i,u&&U.watchOnce(r,()=>{c()})},{root:a,window:n,threshold:s,rootMargin:o.toValue(l)});return r}const st={mounted(e,t){if(typeof t.value=="function"){const n=t.value,a=Q(e);o.watch(a,s=>n(s),{immediate:!0})}else{const[n,a]=t.value,s=Q(e,a);o.watch(s,l=>n(l),{immediate:!0})}}},lt=o.defineComponent({name:"UseEyeDropper",props:{sRGBHex:String},setup(e,{slots:t}){const n=o.reactive(E.useEyeDropper());return()=>{if(t.default)return t.default(n)}}}),rt=o.defineComponent({name:"UseFullscreen",props:["as"],setup(e,{slots:t}){const n=o.shallowRef(),a=o.reactive(E.useFullscreen(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}}),it=o.defineComponent({name:"UseGeolocation",props:["enableHighAccuracy","maximumAge","timeout","navigator"],setup(e,{slots:t}){const n=o.reactive(E.useGeolocation(e));return()=>{if(t.default)return t.default(n)}}}),ut=o.defineComponent({name:"UseIdle",props:["timeout","events","listenForVisibilityChange","initialState"],setup(e,{slots:t}){const n=o.reactive(E.useIdle(e.timeout,e));return()=>{if(t.default)return t.default(n)}}});function ct(e,t,n){const{immediate:a=!0,delay:s=0,onError:l=U.noop,onSuccess:u=U.noop,resetOnExecute:r=!0,shallow:c=!0,throwError:f}=n??{},i=c?o.shallowRef(t):o.ref(t),d=o.shallowRef(!1),p=o.shallowRef(!1),g=o.shallowRef(void 0);async function v(m=0,...w){r&&(i.value=t),g.value=void 0,d.value=!1,p.value=!0,m>0&&await U.promiseTimeout(m);const O=typeof e=="function"?e(...w):e;try{const b=await O;i.value=b,d.value=!0,u(b)}catch(b){if(g.value=b,l(b),f)throw b}finally{p.value=!1}return i.value}a&&v(s);const C={state:i,isReady:d,isLoading:p,error:g,execute:v,executeImmediate:(...m)=>v(0,...m)};function h(){return new Promise((m,w)=>{U.until(p).toBe(!1).then(()=>m(C)).catch(w)})}return{...C,then(m,w){return h().then(m,w)}}}async function ft(e){return new Promise((t,n)=>{const a=new Image,{src:s,srcset:l,sizes:u,class:r,loading:c,crossorigin:f,referrerPolicy:i,width:d,height:p,decoding:g,fetchPriority:v,ismap:C,usemap:h}=e;a.src=s,l!=null&&(a.srcset=l),u!=null&&(a.sizes=u),r!=null&&(a.className=r),c!=null&&(a.loading=c),f!=null&&(a.crossOrigin=f),i!=null&&(a.referrerPolicy=i),d!=null&&(a.width=d),p!=null&&(a.height=p),g!=null&&(a.decoding=g),v!=null&&(a.fetchPriority=v),C!=null&&(a.isMap=C),h!=null&&(a.useMap=h),a.onload=()=>t(a),a.onerror=n})}function dt(e,t={}){const n=ct(()=>ft(o.toValue(e)),void 0,{resetOnExecute:!0,...t});return o.watch(()=>o.toValue(e),()=>n.execute(t.delay),{deep:!0}),n}const mt=o.defineComponent({name:"UseImage",props:["src","srcset","sizes","as","alt","class","loading","crossorigin","referrerPolicy","width","height","decoding","fetchPriority","ismap","usemap"],setup(e,{slots:t}){const n=o.reactive(dt(e));return()=>n.isLoading&&t.loading?t.loading(n):n.error&&t.error?t.error(n.error):t.default?t.default(n):o.h(e.as||"img",e)}});function X(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}const ue=1;function Z(e,t={}){const{throttle:n=0,idle:a=200,onStop:s=U.noop,onScroll:l=U.noop,offset:u={left:0,right:0,top:0,bottom:0},observe:r={mutation:!1},eventListenerOptions:c={capture:!1,passive:!0},behavior:f="auto",window:i=I,onError:d=S=>{console.error(S)}}=t,p=typeof r=="boolean"?{mutation:r}:r,g=o.shallowRef(0),v=o.shallowRef(0),C=o.computed({get(){return g.value},set(S){m(S,void 0)}}),h=o.computed({get(){return v.value},set(S){m(void 0,S)}});function m(S,A){var T,W,B,P;if(!i)return;const M=o.toValue(e);if(!M)return;(B=M instanceof Document?i.document.body:M)==null||B.scrollTo({top:(T=o.toValue(A))!=null?T:h.value,left:(W=o.toValue(S))!=null?W:C.value,behavior:o.toValue(f)});const z=((P=M?.document)==null?void 0:P.documentElement)||M?.documentElement||M;C!=null&&(g.value=z.scrollLeft),h!=null&&(v.value=z.scrollTop)}const w=o.shallowRef(!1),O=o.reactive({left:!0,right:!1,top:!0,bottom:!1}),b=o.reactive({left:!1,right:!1,top:!1,bottom:!1}),V=S=>{w.value&&(w.value=!1,b.left=!1,b.right=!1,b.top=!1,b.bottom=!1,s(S))},k=U.useDebounceFn(V,n+a),R=S=>{var A;if(!i)return;const T=((A=S?.document)==null?void 0:A.documentElement)||S?.documentElement||L(S),{display:W,flexDirection:B,direction:P}=getComputedStyle(T),M=P==="rtl"?-1:1,z=T.scrollLeft;b.left=z<g.value,b.right=z>g.value;const ve=Math.abs(z*M)<=(u.left||0),ge=Math.abs(z*M)+T.clientWidth>=T.scrollWidth-(u.right||0)-ue;W==="flex"&&B==="row-reverse"?(O.left=ge,O.right=ve):(O.left=ve,O.right=ge),g.value=z;let H=T.scrollTop;S===i.document&&!H&&(H=i.document.body.scrollTop),b.top=H<v.value,b.bottom=H>v.value;const ye=Math.abs(H)<=(u.top||0),we=Math.abs(H)+T.clientHeight>=T.scrollHeight-(u.bottom||0)-ue;W==="flex"&&B==="column-reverse"?(O.top=we,O.bottom=ye):(O.top=ye,O.bottom=we),v.value=H},_=S=>{var A;if(!i)return;const T=(A=S.target.documentElement)!=null?A:S.target;R(T),w.value=!0,k(S),l(S)};return D(e,"scroll",n?U.useThrottleFn(_,n,!0,!1):_,c),U.tryOnMounted(()=>{try{const S=o.toValue(e);if(!S)return;R(S)}catch(S){d(S)}}),p?.mutation&&e!=null&&e!==i&&e!==document&&N(e,()=>{const S=o.toValue(e);S&&R(S)},{attributes:!0,childList:!0,subtree:!0}),D(e,"scrollend",V,c),{x:C,y:h,isScrolling:w,arrivedState:O,directions:b,measure(){const S=o.toValue(e);i&&S&&R(S)}}}function ce(e,t,n={}){var a;const{direction:s="bottom",interval:l=100,canLoadMore:u=()=>!0}=n,r=o.reactive(Z(e,{...n,offset:{[s]:(a=n.distance)!=null?a:0,...n.offset}})),c=o.ref(),f=o.computed(()=>!!c.value),i=o.computed(()=>X(o.toValue(e))),d=Q(i);function p(){if(r.measure(),!i.value||!d.value||!u(i.value))return;const{scrollHeight:v,clientHeight:C,scrollWidth:h,clientWidth:m}=i.value,w=s==="bottom"||s==="top"?v<=C:h<=m;(r.arrivedState[s]||w)&&(c.value||(c.value=Promise.all([t(r),new Promise(O=>setTimeout(O,l))]).finally(()=>{c.value=null,o.nextTick(()=>p())})))}const g=o.watch(()=>[r.arrivedState[s],d.value],p,{immediate:!0});return U.tryOnUnmounted(g),{isLoading:f,reset(){o.nextTick(()=>p())}}}const pt={mounted(e,t){typeof t.value=="function"?ce(e,t.value):ce(e,...t.value)}},ht={mounted(e,t){typeof t.value=="function"?q(e,t.value):q(e,...t.value)}},vt=o.defineComponent({name:"UseMouse",props:["touch","resetOnTouchEnds","initialValue"],setup(e,{slots:t}){const n=o.reactive(E.useMouse(e));return()=>{if(t.default)return t.default(n)}}}),gt=o.defineComponent({name:"UseMouseElement",props:["handleOutside","as"],setup(e,{slots:t}){const n=o.shallowRef(),a=o.reactive(E.useMouseInElement(n,e));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}}),yt={page:e=>[e.pageX,e.pageY],client:e=>[e.clientX,e.clientY],screen:e=>[e.screenX,e.screenY],movement:e=>e instanceof MouseEvent?[e.movementX,e.movementY]:null};function wt(e={}){const{type:t="page",touch:n=!0,resetOnTouchEnds:a=!1,initialValue:s={x:0,y:0},window:l=I,target:u=l,scroll:r=!0,eventFilter:c}=e;let f=null,i=0,d=0;const p=o.shallowRef(s.x),g=o.shallowRef(s.y),v=o.shallowRef(null),C=typeof t=="function"?t:yt[t],h=R=>{const _=C(R);f=R,_&&([p.value,g.value]=_,v.value="mouse"),l&&(i=l.scrollX,d=l.scrollY)},m=R=>{if(R.touches.length>0){const _=C(R.touches[0]);_&&([p.value,g.value]=_,v.value="touch")}},w=()=>{if(!f||!l)return;const R=C(f);f instanceof MouseEvent&&R&&(p.value=R[0]+l.scrollX-i,g.value=R[1]+l.scrollY-d)},O=()=>{p.value=s.x,g.value=s.y},b=c?R=>c(()=>h(R),{}):R=>h(R),V=c?R=>c(()=>m(R),{}):R=>m(R),k=c?()=>c(()=>w(),{}):()=>w();if(u){const R={passive:!0};D(u,["mousemove","dragover"],b,R),n&&t!=="movement"&&(D(u,["touchstart","touchmove"],V,R),a&&D(u,"touchend",O,R)),r&&t==="page"&&D(l,"scroll",k,R)}return{x:p,y:g,sourceType:v}}function Ut(e,t={}){const{windowResize:n=!0,windowScroll:a=!0,handleOutside:s=!0,window:l=I}=t,u=t.type||"page",{x:r,y:c,sourceType:f}=wt(t),i=o.shallowRef(e??l?.document.body),d=o.shallowRef(0),p=o.shallowRef(0),g=o.shallowRef(0),v=o.shallowRef(0),C=o.shallowRef(0),h=o.shallowRef(0),m=o.shallowRef(!0);function w(){if(!l)return;const V=L(i);if(!V||!(V instanceof Element))return;const{left:k,top:R,width:_,height:S}=V.getBoundingClientRect();g.value=k+(u==="page"?l.pageXOffset:0),v.value=R+(u==="page"?l.pageYOffset:0),C.value=S,h.value=_;const A=r.value-g.value,T=c.value-v.value;m.value=_===0||S===0||A<0||T<0||A>_||T>S,s&&(d.value=A,p.value=T)}const O=[];function b(){O.forEach(V=>V()),O.length=0}if(U.tryOnMounted(()=>{w()}),l){const{stop:V}=F(i,w),{stop:k}=N(i,w,{attributeFilter:["style","class"]}),R=o.watch([i,r,c],w);O.push(V,k,R),D(document,"mouseleave",()=>m.value=!0,{passive:!0}),a&&O.push(D("scroll",w,{capture:!0,passive:!0})),n&&O.push(D("resize",w,{passive:!0}))}return{x:r,y:c,sourceType:f,elementX:d,elementY:p,elementPositionX:g,elementPositionY:v,elementHeight:C,elementWidth:h,isOutside:m,stop:b}}const bt={mounted(e,t){const[n,a]=typeof t.value=="function"?[t.value,{}]:t.value,s=U.reactiveOmit(o.reactive(Ut(e,a)),"stop");o.watch(s,l=>n(l))}},St=o.defineComponent({name:"UseMousePressed",props:["touch","initialValue","as"],setup(e,{slots:t}){const n=o.shallowRef(),a=o.reactive(E.useMousePressed({...e,target:n}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}}),Ct=o.defineComponent({name:"UseNetwork",setup(e,{slots:t}){const n=o.reactive(E.useNetwork());return()=>{if(t.default)return t.default(n)}}}),Et=o.defineComponent({name:"UseNow",props:["interval"],setup(e,{slots:t}){const n=o.reactive(E.useNow({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),Rt=o.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:t}){const n=U.toRef(e,"object"),a=E.useObjectUrl(n);return()=>{if(t.default&&a.value)return t.default(a)}}}),Ot=o.defineComponent({name:"UseOffsetPagination",props:["total","page","pageSize","onPageChange","onPageSizeChange","onPageCountChange"],emits:["page-change","page-size-change","page-count-change"],setup(e,{slots:t,emit:n}){const a=o.reactive(E.useOffsetPagination({...e,onPageChange(...s){var l;(l=e.onPageChange)==null||l.call(e,...s),n("page-change",...s)},onPageSizeChange(...s){var l;(l=e.onPageSizeChange)==null||l.call(e,...s),n("page-size-change",...s)},onPageCountChange(...s){var l;(l=e.onPageCountChange)==null||l.call(e,...s),n("page-count-change",...s)}}));return()=>{if(t.default)return t.default(a)}}}),Pt=o.defineComponent({name:"UseOnline",setup(e,{slots:t}){const n=o.reactive({isOnline:E.useOnline()});return()=>{if(t.default)return t.default(n)}}}),Vt=o.defineComponent({name:"UsePageLeave",setup(e,{slots:t}){const n=o.reactive({isLeft:E.usePageLeave()});return()=>{if(t.default)return t.default(n)}}}),Mt=o.defineComponent({name:"UsePointer",props:["pointerTypes","initialValue","target"],setup(e,{slots:t}){const n=o.shallowRef(null),a=o.reactive(E.usePointer({...e,target:e.target==="self"?n:I}));return()=>{if(t.default)return t.default(a,{ref:n})}}}),Dt=o.defineComponent({name:"UsePointerLock",props:["as"],setup(e,{slots:t}){const n=o.shallowRef(),a=o.reactive(E.usePointerLock(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}}),Lt=o.defineComponent({name:"UsePreferredColorScheme",setup(e,{slots:t}){const n=o.reactive({colorScheme:E.usePreferredColorScheme()});return()=>{if(t.default)return t.default(n)}}}),Tt=o.defineComponent({name:"UsePreferredContrast",setup(e,{slots:t}){const n=o.reactive({contrast:E.usePreferredContrast()});return()=>{if(t.default)return t.default(n)}}}),_t=o.defineComponent({name:"UsePreferredDark",setup(e,{slots:t}){const n=o.reactive({prefersDark:E.usePreferredDark()});return()=>{if(t.default)return t.default(n)}}}),kt=o.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:t}){const n=o.reactive({languages:E.usePreferredLanguages()});return()=>{if(t.default)return t.default(n)}}}),At=o.defineComponent({name:"UsePreferredReducedMotion",setup(e,{slots:t}){const n=o.reactive({motion:E.usePreferredReducedMotion()});return()=>{if(t.default)return t.default(n)}}}),zt=o.defineComponent({name:"UsePreferredReducedTransparency",setup(e,{slots:t}){const n=o.reactive({transparency:E.usePreferredReducedTransparency()});return()=>{if(t.default)return t.default(n)}}}),It={mounted(e,t){typeof t.value=="function"?F(e,t.value):F(e,...t.value)}};function K(e,t,n={}){const{window:a=I,initialValue:s,observe:l=!1}=n,u=o.shallowRef(s),r=o.computed(()=>{var f;return L(t)||((f=a?.document)==null?void 0:f.documentElement)});function c(){var f;const i=o.toValue(e),d=o.toValue(r);if(d&&a&&i){const p=(f=a.getComputedStyle(d).getPropertyValue(i))==null?void 0:f.trim();u.value=p||u.value||s}}return l&&N(r,c,{attributeFilter:["style","class"],window:a}),o.watch([r,()=>o.toValue(e)],(f,i)=>{i[0]&&i[1]&&i[0].style.removeProperty(i[1]),c()},{immediate:!0}),o.watch([u,r],([f,i])=>{const d=o.toValue(e);i?.style&&d&&(f==null?i.style.removeProperty(d):i.style.setProperty(d,f))},{immediate:!0}),u}const fe="--vueuse-safe-area-top",de="--vueuse-safe-area-right",me="--vueuse-safe-area-bottom",pe="--vueuse-safe-area-left";function Wt(){const e=o.shallowRef(""),t=o.shallowRef(""),n=o.shallowRef(""),a=o.shallowRef("");if(U.isClient){const l=K(fe),u=K(de),r=K(me),c=K(pe);l.value="env(safe-area-inset-top, 0px)",u.value="env(safe-area-inset-right, 0px)",r.value="env(safe-area-inset-bottom, 0px)",c.value="env(safe-area-inset-left, 0px)",U.tryOnMounted(s),D("resize",U.useDebounceFn(s),{passive:!0})}function s(){e.value=G(fe),t.value=G(de),n.value=G(me),a.value=G(pe)}return{top:e,right:t,bottom:n,left:a,update:s}}function G(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const Bt=o.defineComponent({name:"UseScreenSafeArea",props:{top:Boolean,right:Boolean,bottom:Boolean,left:Boolean},setup(e,{slots:t}){const{top:n,right:a,bottom:s,left:l}=Wt();return()=>{if(t.default)return o.h("div",{style:{paddingTop:e.top?n.value:"",paddingRight:e.right?a.value:"",paddingBottom:e.bottom?s.value:"",paddingLeft:e.left?l.value:"",boxSizing:"border-box",maxHeight:"100vh",maxWidth:"100vw",overflow:"auto"}},t.default())}}}),Ht={mounted(e,t){if(typeof t.value=="function"){const n=t.value,a=Z(e,{onScroll(){n(a)},onStop(){n(a)}})}else{const[n,a]=t.value,s=Z(e,{...a,onScroll(l){var u;(u=a.onScroll)==null||u.call(a,l),n(s)},onStop(l){var u;(u=a.onStop)==null||u.call(a,l),n(s)}})}}};function he(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!n||n.tagName==="BODY"?!1:he(n)}}function Nt(e){const t=e||window.event,n=t.target;return he(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const ee=new WeakMap;function Ft(e,t=!1){const n=o.shallowRef(t);let a=null,s="";o.watch(U.toRef(e),r=>{const c=X(o.toValue(r));if(c){const f=c;if(ee.get(f)||ee.set(f,f.style.overflow),f.style.overflow!=="hidden"&&(s=f.style.overflow),f.style.overflow==="hidden")return n.value=!0;if(n.value)return f.style.overflow="hidden"}},{immediate:!0});const l=()=>{const r=X(o.toValue(e));!r||n.value||(U.isIOS&&(a=D(r,"touchmove",c=>{Nt(c)},{passive:!1})),r.style.overflow="hidden",n.value=!0)},u=()=>{const r=X(o.toValue(e));!r||!n.value||(U.isIOS&&a?.(),r.style.overflow=s,ee.delete(r),n.value=!1)};return U.tryOnScopeDispose(u),o.computed({get(){return n.value},set(r){r?l():u()}})}function jt(){let e=!1;const t=o.shallowRef(!1);return(n,a)=>{if(t.value=a.value,e)return;e=!0;const s=Ft(n,a.value);o.watch(t,l=>s.value=l)}}const xt=jt(),Yt=o.defineComponent({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages","showSecond"],setup(e,{slots:t}){const n=o.reactive(E.useTimeAgo(()=>e.time,{...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),Xt=o.defineComponent({name:"UseTimestamp",props:["immediate","interval","offset"],setup(e,{slots:t}){const n=o.reactive(E.useTimestamp({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),Kt=o.defineComponent({name:"UseVirtualList",props:["list","options","height"],setup(e,{slots:t,expose:n}){const{list:a}=o.toRefs(e),{list:s,containerProps:l,wrapperProps:u,scrollTo:r}=E.useVirtualList(a,e.options);return n({scrollTo:r}),l.style&&typeof l.style=="object"&&!Array.isArray(l.style)&&(l.style.height=e.height||"300px"),()=>o.h("div",{...l},[o.h("div",{...u.value},s.value.map(c=>o.h("div",{style:{overflow:"hidden",height:c.height}},t.default?t.default(c):"Please set content!")))])}}),Gt=o.defineComponent({name:"UseWindowFocus",setup(e,{slots:t}){const n=o.reactive({focused:E.useWindowFocus()});return()=>{if(t.default)return t.default(n)}}}),Jt=o.defineComponent({name:"UseWindowSize",props:["initialWidth","initialHeight"],setup(e,{slots:t}){const n=o.reactive(E.useWindowSize(e));return()=>{if(t.default)return t.default(n)}}});y.OnClickOutside=Ue,y.OnLongPress=Re,y.UseActiveElement=Oe,y.UseBattery=Pe,y.UseBrowserLocation=Ve,y.UseClipboard=Me,y.UseColorMode=Fe,y.UseDark=je,y.UseDeviceMotion=xe,y.UseDeviceOrientation=Ye,y.UseDevicePixelRatio=Xe,y.UseDevicesList=Ke,y.UseDocumentVisibility=Ge,y.UseDraggable=Je,y.UseElementBounding=$e,y.UseElementSize=tt,y.UseElementVisibility=at,y.UseEyeDropper=lt,y.UseFullscreen=rt,y.UseGeolocation=it,y.UseIdle=ut,y.UseImage=mt,y.UseMouse=vt,y.UseMouseInElement=gt,y.UseMousePressed=St,y.UseNetwork=Ct,y.UseNow=Et,y.UseObjectUrl=Rt,y.UseOffsetPagination=Ot,y.UseOnline=Pt,y.UsePageLeave=Vt,y.UsePointer=Mt,y.UsePointerLock=Dt,y.UsePreferredColorScheme=Lt,y.UsePreferredContrast=Tt,y.UsePreferredDark=_t,y.UsePreferredLanguages=kt,y.UsePreferredReducedMotion=At,y.UsePreferredReducedTransparency=zt,y.UseScreenSafeArea=Bt,y.UseTimeAgo=Yt,y.UseTimestamp=Xt,y.UseVirtualList=Kt,y.UseWindowFocus=Gt,y.UseWindowSize=Jt,y.VOnClickOutside=oe,y.VOnLongPress=se,y.vElementBounding=Qe,y.vElementHover=et,y.vElementSize=ot,y.vElementVisibility=st,y.vInfiniteScroll=pt,y.vIntersectionObserver=ht,y.vMouseInElement=bt,y.vOnClickOutside=oe,y.vOnKeyStroke=Se,y.vOnLongPress=se,y.vResizeObserver=It,y.vScroll=Ht,y.vScrollLock=xt})(this.VueUse=this.VueUse||{},VueUse,Vue,VueUse);
|
package/index.mjs
CHANGED
|
@@ -1499,7 +1499,8 @@ function useAsyncState(promise, initialState, options) {
|
|
|
1499
1499
|
isReady,
|
|
1500
1500
|
isLoading,
|
|
1501
1501
|
error,
|
|
1502
|
-
execute
|
|
1502
|
+
execute,
|
|
1503
|
+
executeImmediate: (...args) => execute(0, ...args)
|
|
1503
1504
|
};
|
|
1504
1505
|
function waitUntilIsLoaded() {
|
|
1505
1506
|
return new Promise((resolve, reject) => {
|
|
@@ -1618,6 +1619,9 @@ function useScroll(element, options = {}) {
|
|
|
1618
1619
|
top: 0,
|
|
1619
1620
|
bottom: 0
|
|
1620
1621
|
},
|
|
1622
|
+
observe: _observe = {
|
|
1623
|
+
mutation: false
|
|
1624
|
+
},
|
|
1621
1625
|
eventListenerOptions = {
|
|
1622
1626
|
capture: false,
|
|
1623
1627
|
passive: true
|
|
@@ -1628,6 +1632,9 @@ function useScroll(element, options = {}) {
|
|
|
1628
1632
|
console.error(e);
|
|
1629
1633
|
}
|
|
1630
1634
|
} = options;
|
|
1635
|
+
const observe = typeof _observe === "boolean" ? {
|
|
1636
|
+
mutation: _observe
|
|
1637
|
+
} : _observe;
|
|
1631
1638
|
const internalX = shallowRef(0);
|
|
1632
1639
|
const internalY = shallowRef(0);
|
|
1633
1640
|
const x = computed({
|
|
@@ -1750,6 +1757,22 @@ function useScroll(element, options = {}) {
|
|
|
1750
1757
|
onError(e);
|
|
1751
1758
|
}
|
|
1752
1759
|
});
|
|
1760
|
+
if ((observe == null ? void 0 : observe.mutation) && element != null && element !== window && element !== document) {
|
|
1761
|
+
useMutationObserver(
|
|
1762
|
+
element,
|
|
1763
|
+
() => {
|
|
1764
|
+
const _element = toValue(element);
|
|
1765
|
+
if (!_element)
|
|
1766
|
+
return;
|
|
1767
|
+
setArrivedState(_element);
|
|
1768
|
+
},
|
|
1769
|
+
{
|
|
1770
|
+
attributes: true,
|
|
1771
|
+
childList: true,
|
|
1772
|
+
subtree: true
|
|
1773
|
+
}
|
|
1774
|
+
);
|
|
1775
|
+
}
|
|
1753
1776
|
useEventListener(
|
|
1754
1777
|
element,
|
|
1755
1778
|
"scrollend",
|
|
@@ -1949,6 +1972,8 @@ function useMouse(options = {}) {
|
|
|
1949
1972
|
|
|
1950
1973
|
function useMouseInElement(target, options = {}) {
|
|
1951
1974
|
const {
|
|
1975
|
+
windowResize = true,
|
|
1976
|
+
windowScroll = true,
|
|
1952
1977
|
handleOutside = true,
|
|
1953
1978
|
window = defaultWindow
|
|
1954
1979
|
} = options;
|
|
@@ -1962,34 +1987,55 @@ function useMouseInElement(target, options = {}) {
|
|
|
1962
1987
|
const elementHeight = shallowRef(0);
|
|
1963
1988
|
const elementWidth = shallowRef(0);
|
|
1964
1989
|
const isOutside = shallowRef(true);
|
|
1965
|
-
|
|
1966
|
-
|
|
1990
|
+
function update() {
|
|
1991
|
+
if (!window)
|
|
1992
|
+
return;
|
|
1993
|
+
const el = unrefElement(targetRef);
|
|
1994
|
+
if (!el || !(el instanceof Element))
|
|
1995
|
+
return;
|
|
1996
|
+
const {
|
|
1997
|
+
left,
|
|
1998
|
+
top,
|
|
1999
|
+
width,
|
|
2000
|
+
height
|
|
2001
|
+
} = el.getBoundingClientRect();
|
|
2002
|
+
elementPositionX.value = left + (type === "page" ? window.pageXOffset : 0);
|
|
2003
|
+
elementPositionY.value = top + (type === "page" ? window.pageYOffset : 0);
|
|
2004
|
+
elementHeight.value = height;
|
|
2005
|
+
elementWidth.value = width;
|
|
2006
|
+
const elX = x.value - elementPositionX.value;
|
|
2007
|
+
const elY = y.value - elementPositionY.value;
|
|
2008
|
+
isOutside.value = width === 0 || height === 0 || elX < 0 || elY < 0 || elX > width || elY > height;
|
|
2009
|
+
if (handleOutside) {
|
|
2010
|
+
elementX.value = elX;
|
|
2011
|
+
elementY.value = elY;
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2014
|
+
const stopFnList = [];
|
|
2015
|
+
function stop() {
|
|
2016
|
+
stopFnList.forEach((fn) => fn());
|
|
2017
|
+
stopFnList.length = 0;
|
|
2018
|
+
}
|
|
2019
|
+
tryOnMounted(() => {
|
|
2020
|
+
update();
|
|
2021
|
+
});
|
|
1967
2022
|
if (window) {
|
|
1968
|
-
|
|
2023
|
+
const {
|
|
2024
|
+
stop: stopResizeObserver
|
|
2025
|
+
} = useResizeObserver(targetRef, update);
|
|
2026
|
+
const {
|
|
2027
|
+
stop: stopMutationObserver
|
|
2028
|
+
} = useMutationObserver(targetRef, update, {
|
|
2029
|
+
attributeFilter: ["style", "class"]
|
|
2030
|
+
});
|
|
2031
|
+
const stopWatch = watch(
|
|
1969
2032
|
[targetRef, x, y],
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
top,
|
|
1977
|
-
width,
|
|
1978
|
-
height
|
|
1979
|
-
} = el.getBoundingClientRect();
|
|
1980
|
-
elementPositionX.value = left + (type === "page" ? window.pageXOffset : 0);
|
|
1981
|
-
elementPositionY.value = top + (type === "page" ? window.pageYOffset : 0);
|
|
1982
|
-
elementHeight.value = height;
|
|
1983
|
-
elementWidth.value = width;
|
|
1984
|
-
const elX = x.value - elementPositionX.value;
|
|
1985
|
-
const elY = y.value - elementPositionY.value;
|
|
1986
|
-
isOutside.value = width === 0 || height === 0 || elX < 0 || elY < 0 || elX > width || elY > height;
|
|
1987
|
-
if (handleOutside || !isOutside.value) {
|
|
1988
|
-
elementX.value = elX;
|
|
1989
|
-
elementY.value = elY;
|
|
1990
|
-
}
|
|
1991
|
-
},
|
|
1992
|
-
{ immediate: true }
|
|
2033
|
+
update
|
|
2034
|
+
);
|
|
2035
|
+
stopFnList.push(
|
|
2036
|
+
stopResizeObserver,
|
|
2037
|
+
stopMutationObserver,
|
|
2038
|
+
stopWatch
|
|
1993
2039
|
);
|
|
1994
2040
|
useEventListener(
|
|
1995
2041
|
document,
|
|
@@ -1997,6 +2043,16 @@ function useMouseInElement(target, options = {}) {
|
|
|
1997
2043
|
() => isOutside.value = true,
|
|
1998
2044
|
{ passive: true }
|
|
1999
2045
|
);
|
|
2046
|
+
if (windowScroll) {
|
|
2047
|
+
stopFnList.push(
|
|
2048
|
+
useEventListener("scroll", update, { capture: true, passive: true })
|
|
2049
|
+
);
|
|
2050
|
+
}
|
|
2051
|
+
if (windowResize) {
|
|
2052
|
+
stopFnList.push(
|
|
2053
|
+
useEventListener("resize", update, { passive: true })
|
|
2054
|
+
);
|
|
2055
|
+
}
|
|
2000
2056
|
}
|
|
2001
2057
|
return {
|
|
2002
2058
|
x,
|
|
@@ -2324,7 +2380,7 @@ function useScreenSafeArea() {
|
|
|
2324
2380
|
rightCssVar.value = "env(safe-area-inset-right, 0px)";
|
|
2325
2381
|
bottomCssVar.value = "env(safe-area-inset-bottom, 0px)";
|
|
2326
2382
|
leftCssVar.value = "env(safe-area-inset-left, 0px)";
|
|
2327
|
-
update
|
|
2383
|
+
tryOnMounted(update);
|
|
2328
2384
|
useEventListener("resize", useDebounceFn(update), { passive: true });
|
|
2329
2385
|
}
|
|
2330
2386
|
function update() {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vueuse/components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "13.
|
|
4
|
+
"version": "13.4.0",
|
|
5
5
|
"description": "Renderless components for VueUse",
|
|
6
6
|
"author": "Jacob Clevenger<https://github.com/wheatjs>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"vue": "^3.5.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@vueuse/
|
|
42
|
-
"@vueuse/
|
|
41
|
+
"@vueuse/core": "13.4.0",
|
|
42
|
+
"@vueuse/shared": "13.4.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "rollup --config=rollup.config.ts --configPlugin=rollup-plugin-esbuild",
|