import{Z as G,_ as E,l,$ as M,a0 as F,a1 as j}from"./vendor.cd162bf7.js";var T;const O=typeof window!="undefined",U=e=>typeof e=="string",b=()=>{};O&&((T=window==null?void 0:window.navigator)==null?void 0:T.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function V(e,t){function r(...n){e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})}return r}const A=e=>e();function X(e=A){const t=l(!0);function r(){t.value=!1}function n(){t.value=!0}return{isActive:t,pause:r,resume:n,eventFilter:(...i)=>{t.value&&e(...i)}}}function Y(e,t=!1,r="Timeout"){return new Promise((n,o)=>{setTimeout(t?()=>o(r):n,e)})}function K(e){return G()?(M(e),!0):!1}var W=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,B=(e,t)=>{var r={};for(var n in e)Z.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&W)for(var n of W(e))t.indexOf(n)<0&&q.call(e,n)&&(r[n]=e[n]);return r};function Q(e,t,r={}){const n=r,{eventFilter:o=A}=n,i=B(n,["eventFilter"]);return E(e,V(o,t),i)}var k=Object.defineProperty,ee=Object.defineProperties,te=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable,L=(e,t,r)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,re=(e,t)=>{for(var r in t||(t={}))x.call(t,r)&&L(e,r,t[r]);if(h)for(var r of h(t))D.call(t,r)&&L(e,r,t[r]);return e},ne=(e,t)=>ee(e,te(t)),ae=(e,t)=>{var r={};for(var n in e)x.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&h)for(var n of h(e))t.indexOf(n)<0&&D.call(e,n)&&(r[n]=e[n]);return r};function oe(e,t,r={}){const n=r,{eventFilter:o}=n,i=ae(n,["eventFilter"]),{eventFilter:d,pause:u,resume:s,isActive:v}=X(o);return{stop:Q(e,t,ne(re({},i),{eventFilter:d})),pause:u,resume:s,isActive:v}}function ie(e){var t;const r=j(e);return(t=r==null?void 0:r.$el)!=null?t:r}const m=O?window:void 0;O&&window.document;O&&window.navigator;O&&window.location;function R(...e){let t,r,n,o;if(U(e[0])?([r,n,o]=e,t=m):[t,r,n,o]=e,!t)return b;let i=b;const d=E(()=>ie(t),s=>{i(),!!s&&(s.addEventListener(r,n,o),i=()=>{s.removeEventListener(r,n,o),i=b})},{immediate:!0,flush:"post"}),u=()=>{d(),i()};return K(u),u}function de(e,t,r){const{immediate:n=!0,delay:o=0,onError:i=b,resetOnExecute:d=!0,shallow:u=!0}=r!=null?r:{},s=u?F(t):l(t),v=l(!1),y=l(!1),_=l(void 0);async function w(f=0,...g){d&&(s.value=t),_.value=void 0,v.value=!1,y.value=!0,f>0&&await Y(f);const S=typeof e=="function"?e(...g):e;try{const c=await S;s.value=c,v.value=!0}catch(c){_.value=c,i(c)}finally{y.value=!1}return s.value}return n&&w(o),{state:s,isReady:v,isLoading:y,error:_,execute:w}}const P=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},N="__vueuse_ssr_handlers__";P[N]=P[N]||{};const se=P[N];function le(e,t){return se[e]||t}function ue(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"||Array.isArray(e)?"object":Number.isNaN(e)?"any":"number"}const fe={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()}};function ce(e,t,r,n={}){var o;const{flush:i="pre",deep:d=!0,listenToStorageChanges:u=!0,writeDefaults:s=!0,shallow:v,window:y=m,eventFilter:_,onError:w=a=>{console.error(a)}}=n,f=(v?F:l)(t);if(!r)try{r=le("getDefaultStorage",()=>{var a;return(a=m)==null?void 0:a.localStorage})()}catch(a){w(a)}if(!r)return f;const g=j(t),S=ue(g),c=(o=n.serializer)!=null?o:fe[S],{pause:z,resume:I}=oe(f,()=>C(f.value),{flush:i,deep:d,eventFilter:_});return y&&u&&R(y,"storage",$),$(),f;function C(a){try{a==null?r.removeItem(e):r.setItem(e,c.write(a))}catch(p){w(p)}}function H(a){if(!(a&&a.key!==e)){z();try{const p=a?a.newValue:r.getItem(e);return p==null?(s&&g!==null&&r.setItem(e,c.write(g)),g):typeof p!="string"?p:c.read(p)}catch(p){w(p)}finally{I()}}}function $(a){a&&a.key!==e||(f.value=H(a))}}function ve(e,t,r={}){const{window:n=m}=r;return ce(e,t,n==null?void 0:n.localStorage,r)}var J;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(J||(J={}));function ye({window:e=m}={}){if(!e)return{x:l(0),y:l(0)};const t=l(e.pageXOffset),r=l(e.pageYOffset);return R("scroll",()=>{t.value=e.pageXOffset,r.value=e.pageYOffset},{capture:!1,passive:!0}),{x:t,y:r}}export{ye as a,de as b,ve as c,R as u};
