ray-template/assets/@vueuse-dacd7844.js
2023-03-10 16:52:07 +08:00

2 lines
2.3 KiB
JavaScript

import{g as y,o as h,n as E,a as b,b as m,u as P,r as f,w as C}from"./@vue-0f114043.js";var c;const _=typeof window<"u",Q=e=>typeof e=="string",l=()=>{};_&&((c=window==null?void 0:window.navigator)!=null&&c.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function T(e){return typeof e=="function"?e():P(e)}function N(e){return e}function S(e){return b()?(m(e),!0):!1}function W(e,n=!0){y()?h(e):n?e():E(e)}function x(e){var n;const t=T(e);return(n=t==null?void 0:t.$el)!=null?n:t}const g=_?window:void 0;function d(...e){let n,t,o,s;if(Q(e[0])?([t,o,s]=e,n=g):[n,t,o,s]=e,!n)return l;let i=l;const a=C(()=>x(n),u=>{i(),u&&(u.addEventListener(t,o,s),i=()=>{u.removeEventListener(t,o,s),i=l})},{immediate:!0,flush:"post"}),r=()=>{a(),i()};return S(r),r}const p=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},O="__vueuse_ssr_handlers__";p[O]=p[O]||{};var v;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(v||(v={}));var L=Object.defineProperty,w=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable,I=(e,n,t)=>n in e?L(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,U=(e,n)=>{for(var t in n||(n={}))H.call(n,t)&&I(e,t,n[t]);if(w)for(var t of w(n))B.call(n,t)&&I(e,t,n[t]);return e};const j={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};U({linear:N},j);function z(e={}){const{window:n=g,initialWidth:t=1/0,initialHeight:o=1/0,listenOrientation:s=!0}=e,i=f(t),a=f(o),r=()=>{n&&(i.value=n.innerWidth,a.value=n.innerHeight)};return r(),W(r),d("resize",r,{passive:!0}),s&&d("orientationchange",r,{passive:!0}),{width:i,height:a}}export{z as u};