index.684ca989.js 5.3 KB

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